document-specification.d.ts 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. // OpenApi version 3.1.0
  2. // https://spec.openapis.org/oas/v3.1.0
  3. /**
  4. * Document object.
  5. * https://spec.openapis.org/oas/v3.1.0#openapi-object
  6. */
  7. export type OADocumentObject = {
  8. openapi: string;
  9. info: OAInfoObject;
  10. jsonSchemaDialect?: string;
  11. servers?: OAServerObject[];
  12. paths?: OAPathsObject;
  13. webhooks?: OAWebhooksObject;
  14. components?: OAComponentsObject;
  15. security?: OASecurityRequirementObject[];
  16. tags?: OATagObject[];
  17. externalDocs?: OAExternalDocumentationObject;
  18. };
  19. /**
  20. * Info Object.
  21. * https://spec.openapis.org/oas/v3.1.0#info-object
  22. */
  23. export type OAInfoObject = {
  24. title: string;
  25. summary?: string;
  26. description?: string;
  27. termsOfService?: string;
  28. contact?: OAContactObject;
  29. license?: OALicenseObject;
  30. version: string;
  31. };
  32. /**
  33. * Contact Object.
  34. * https://spec.openapis.org/oas/v3.1.0#contact-object
  35. */
  36. export type OAContactObject = {
  37. name?: string;
  38. url?: string;
  39. email?: string;
  40. };
  41. /**
  42. * License Object.
  43. * https://spec.openapis.org/oas/v3.1.0#license-object
  44. */
  45. export type OALicenseObject = {
  46. name: string;
  47. identifier?: string;
  48. url?: string;
  49. };
  50. /**
  51. * Server Object.
  52. * https://spec.openapis.org/oas/v3.1.0#server-object
  53. */
  54. export type OAServerObject = {
  55. url: string;
  56. description?: string;
  57. variables?: OAServerVariablesObject;
  58. };
  59. /**
  60. * Server variable object.
  61. * https://spec.openapis.org/oas/v3.1.0#server-variable-object
  62. */
  63. export type OAServerVariableObject = {
  64. enum?: string[];
  65. default: string;
  66. description?: string;
  67. };
  68. /**
  69. * Paths Object.
  70. * https://spec.openapis.org/oas/v3.1.0#paths-object
  71. */
  72. export type OAPathsObject = {
  73. [path: string]: OAPathItemObject | undefined;
  74. };
  75. /**
  76. * Path Item Object
  77. * https://spec.openapis.org/oas/v3.1.0#path-item-object
  78. */
  79. export type OAPathItemObject = {
  80. $ref?: string;
  81. summary?: string;
  82. description?: string;
  83. get?: OAOperationObject;
  84. put?: OAOperationObject;
  85. post?: OAOperationObject;
  86. delete?: OAOperationObject;
  87. options?: OAOperationObject;
  88. head?: OAOperationObject;
  89. patch?: OAOperationObject;
  90. trace?: OAOperationObject;
  91. servers?: OAServerObject[];
  92. parameters?: (OAParameterObject | OAReferenceObject)[];
  93. };
  94. /**
  95. * Operation Method.
  96. * https://spec.openapis.org/oas/v3.1.0#path-item-object
  97. */
  98. export declare const OAOperationMethod: {
  99. GET: 'get';
  100. PUT: 'put';
  101. POST: 'post';
  102. DELETE: 'delete';
  103. OPTIONS: 'options';
  104. HEAD: 'head';
  105. PATCH: 'patch';
  106. TRACE: 'trace';
  107. };
  108. export type OAOperationMethod =
  109. (typeof OAOperationMethod)[keyof typeof OAOperationMethod];
  110. /**
  111. * Parameter Object.
  112. * https://spec.openapis.org/oas/v3.1.0#parameter-object
  113. */
  114. export type OAParameterObject = {
  115. name: string;
  116. in: OAParameterLocation;
  117. description?: string;
  118. required?: boolean;
  119. deprecated?: boolean;
  120. allowEmptyValue?: boolean;
  121. style?: OAParameterStyle;
  122. explode?: boolean;
  123. allowReserved?: boolean;
  124. schema?: OASchemaObject;
  125. content?: OAContentObject;
  126. };
  127. /**
  128. * Parameter Location.
  129. * https://spec.openapis.org/oas/v3.1.0#parameter-locations
  130. */
  131. export declare const OAParameterLocation: {
  132. QUERY: 'query';
  133. HEADER: 'header';
  134. PATH: 'path';
  135. COOKIE: 'cookie';
  136. };
  137. export type OAParameterLocation =
  138. (typeof OAParameterLocation)[keyof typeof OAParameterLocation];
  139. /**
  140. * Parameter Style.
  141. * https://spec.openapis.org/oas/v3.1.0#style-values
  142. */
  143. export declare const OAParameterStyle: {
  144. MATRIX: 'matrix';
  145. LABEL: 'label';
  146. FORM: 'form';
  147. SIMPLE: 'simple';
  148. SPACE_DELIMITED: 'spaceDelimited';
  149. PIPE_DELIMITED: 'pipeDelimited';
  150. DEEP_OBJECT: 'deepObject';
  151. };
  152. export type OAParameterStyle =
  153. (typeof OAParameterStyle)[keyof typeof OAParameterStyle];
  154. /**
  155. * Reference Object.
  156. * https://spec.openapis.org/oas/v3.1.0#reference-object
  157. */
  158. export type OAReferenceObject = {
  159. $ref: string;
  160. summary?: string;
  161. description?: string;
  162. };
  163. /**
  164. * Schema Object.
  165. * https://spec.openapis.org/oas/v3.1.0#schema-object
  166. */
  167. export type OASchemaObject = {
  168. type?: OADataType | OADataType[];
  169. format?: OADataFormat | string;
  170. items?: OASchemaObject | OAReferenceObject;
  171. required?: string[];
  172. minimum?: number;
  173. maximum?: number;
  174. default?: unknown;
  175. properties?: OASchemaPropertiesObject;
  176. discriminator?: OADiscriminatorObject;
  177. xml?: OAXmlObject;
  178. externalDocs?: OAExternalDocumentationObject;
  179. };
  180. /**
  181. * Data type.
  182. * https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-4.2.1
  183. */
  184. export declare const OADataType: {
  185. STRING: 'string';
  186. NUMBER: 'number';
  187. INTEGER: 'integer';
  188. BOOLEAN: 'boolean';
  189. OBJECT: 'object';
  190. ARRAY: 'array';
  191. NULL: 'null';
  192. };
  193. export type OADataType = (typeof OADataType)[keyof typeof OADataType];
  194. /**
  195. * Data format.
  196. * https://spec.openapis.org/oas/v3.1.0#dataTypeFormat
  197. */
  198. export declare const OADataFormat: {
  199. INT32: 'int32';
  200. INT64: 'int64';
  201. FLOAT: 'float';
  202. DOUBLE: 'double';
  203. PASSWORD: 'password';
  204. BINARY: 'binary';
  205. };
  206. export type OADataFormat = (typeof OADataFormat)[keyof typeof OADataFormat];
  207. /**
  208. * Discriminator Object.
  209. * https://spec.openapis.org/oas/v3.1.0#discriminator-object
  210. */
  211. export type OADiscriminatorObject = {
  212. propertyName: string;
  213. mapping?: {[name: string]: string | undefined};
  214. };
  215. /**
  216. * Xml Object.
  217. * https://spec.openapis.org/oas/v3.1.0#xml-object
  218. */
  219. export type OAXmlObject = {
  220. name?: string;
  221. namespace?: string;
  222. prefix?: string;
  223. attribute?: boolean;
  224. wrapped?: boolean;
  225. };
  226. /**
  227. * External Documentation Object.
  228. * https://spec.openapis.org/oas/v3.1.0#external-documentation-object
  229. */
  230. export type OAExternalDocumentationObject = {
  231. description?: string;
  232. url: string;
  233. };
  234. /**
  235. * Operation Object.
  236. * https://spec.openapis.org/oas/v3.1.0#operation-object
  237. */
  238. export type OAOperationObject = {
  239. tags?: string[];
  240. summary?: string;
  241. description?: string;
  242. externalDocs?: OAExternalDocumentationObject;
  243. operationId?: string;
  244. parameters?: (OAParameterObject | OAReferenceObject)[];
  245. requestBody?: OARequestBodyObject | OAReferenceObject;
  246. responses?: OAResponsesObject;
  247. callbacks?: OACallbacksObject;
  248. };
  249. /**
  250. * Callback Object.
  251. * https://spec.openapis.org/oas/v3.1.0#callback-object
  252. */
  253. export type OACallbackObject = {
  254. [expression: string]: OAPathItemObject | OAReferenceObject | undefined;
  255. };
  256. /**
  257. * Request Body Object.
  258. * https://spec.openapis.org/oas/v3.1.0#request-body-object
  259. */
  260. export type OARequestBodyObject = {
  261. description?: string;
  262. content: OAContentObject;
  263. required?: boolean;
  264. };
  265. /**
  266. * Media type.
  267. * https://spec.openapis.org/oas/v3.1.0#media-types
  268. */
  269. export declare const OAMediaType: {
  270. TEXT_PLAIN: 'text/plain';
  271. TEXT_HTML: 'text/html';
  272. APPLICATION_XML: 'application/xml';
  273. APPLICATION_JSON: 'application/json';
  274. MULTIPART_FORM_DATA: 'multipart/form-data';
  275. };
  276. export type OAMediaType = (typeof OAMediaType)[keyof typeof OAMediaType];
  277. /**
  278. * Responses Object.
  279. * https://spec.openapis.org/oas/v3.1.0#responses-object
  280. */
  281. export type OAResponsesObject = {
  282. [httpStatusCode: string]: OAResponseObject | OAReferenceObject | undefined;
  283. };
  284. /**
  285. * Response Object.
  286. * https://spec.openapis.org/oas/v3.1.0#response-object
  287. */
  288. export type OAResponseObject = {
  289. description: string;
  290. headers?: OAHeadersObject;
  291. content?: OAContentObject;
  292. links?: OALinksObject;
  293. };
  294. /**
  295. * Media Type Object.
  296. * https://spec.openapis.org/oas/v3.1.0#media-type-object
  297. */
  298. export type OAMediaTypeObject = {
  299. schema?: OASchemaObject;
  300. example?: unknown;
  301. examples?: OAExamplesObject;
  302. encoding?: OAPropertiesEncodingObject;
  303. };
  304. /**
  305. * Example Object.
  306. * https://spec.openapis.org/oas/v3.1.0#example-object
  307. */
  308. export type OAExampleObject = {
  309. summary?: string;
  310. description?: string;
  311. value?: unknown;
  312. externalValue?: string;
  313. };
  314. /**
  315. * Encoding Object.
  316. * https://spec.openapis.org/oas/v3.1.0#encoding-object
  317. */
  318. export type OAEncodingObject = {
  319. contentType?: string;
  320. headers?: OAHeadersObject;
  321. style?: OAParameterStyle;
  322. explode?: boolean;
  323. allowReserved?: boolean;
  324. };
  325. /**
  326. * Header Object.
  327. * https://spec.openapis.org/oas/v3.1.0#header-object
  328. */
  329. export type OAHeaderObject = Omit<OAParameterObject, 'name' | 'in'>;
  330. /**
  331. * Link Object.
  332. * https://spec.openapis.org/oas/v3.1.0#link-object
  333. */
  334. export type OALinkObject = {
  335. operationRef?: string;
  336. operationId?: string;
  337. parameters?: {[name: string]: unknown | undefined};
  338. requestBody?: unknown;
  339. description?: string;
  340. server?: OAServerObject;
  341. };
  342. /**
  343. * Components Object.
  344. * https://spec.openapis.org/oas/v3.1.0#components-object
  345. */
  346. export type OAComponentsObject = {
  347. schemas?: {[name: string]: OASchemaObject | undefined};
  348. responses?: {
  349. [name: string]: OAResponseObject | OAReferenceObject | undefined;
  350. };
  351. parameters?: {
  352. [name: string]: OAParameterObject | OAReferenceObject | undefined;
  353. };
  354. examples?: {
  355. [name: string]: OAExampleObject | OAReferenceObject | undefined;
  356. };
  357. requestBodies?: {
  358. [name: string]: OARequestBodyObject | OAReferenceObject | undefined;
  359. };
  360. headers?: {
  361. [name: string]: OAHeaderObject | OAReferenceObject | undefined;
  362. };
  363. securitySchemes?: {
  364. [name: string]: OASecuritySchemeObject | OAReferenceObject | undefined;
  365. };
  366. links?: {
  367. [name: string]: OALinkObject | OAReferenceObject | undefined;
  368. };
  369. callbacks?: {
  370. [name: string]: OACallbackObject | OAReferenceObject | undefined;
  371. };
  372. pathItems?: {
  373. [name: string]: OAPathItemObject | OAReferenceObject | undefined;
  374. };
  375. };
  376. /**
  377. * Security Scheme Object.
  378. * https://spec.openapis.org/oas/v3.1.0#security-scheme-object
  379. */
  380. export type OASecuritySchemeObject = {
  381. type: OASecuritySchemeType;
  382. description?: string;
  383. name?: string;
  384. in?: OAApiKeyLocation;
  385. scheme?: string;
  386. bearerFormat?: string;
  387. flows?: OAOAuthFlowsObject;
  388. openIdConnectUrl?: string;
  389. };
  390. /**
  391. * Security Scheme Type.
  392. * https://spec.openapis.org/oas/v3.1.0#security-scheme-object
  393. */
  394. export declare const OASecuritySchemeType: {
  395. API_KEY: 'apiKey';
  396. HTTP: 'http';
  397. MUTUAL_TLS: 'mutualTLS';
  398. OAUTH_2: 'oauth2';
  399. OPEN_ID_CONNECT: 'openIdConnect';
  400. };
  401. export type OASecuritySchemeType =
  402. (typeof OASecuritySchemeType)[keyof typeof OASecuritySchemeType];
  403. /**
  404. * Api Key Location.
  405. * https://spec.openapis.org/oas/v3.1.0#security-scheme-object
  406. */
  407. export declare const OAApiKeyLocation: {
  408. QUERY: 'query';
  409. HEADER: 'header';
  410. COOKIE: 'cookie';
  411. };
  412. export type OAApiKeyLocation =
  413. (typeof OAApiKeyLocation)[keyof typeof OAApiKeyLocation];
  414. /**
  415. * OAuth Flows Object.
  416. * https://spec.openapis.org/oas/v3.1.0#oauth-flows-object
  417. */
  418. export type OAOAuthFlowsObject = {
  419. implicit?: OAOAuthFlowObject;
  420. password?: OAOAuthFlowObject;
  421. clientCredentials?: OAOAuthFlowObject;
  422. authorizationCode?: OAOAuthFlowObject;
  423. };
  424. /**
  425. * OAuth Flow Object.
  426. * https://spec.openapis.org/oas/v3.1.0#oauth-flow-object
  427. */
  428. export type OAOAuthFlowObject = {
  429. authorizationUrl: string;
  430. tokenUrl: string;
  431. refreshUrl?: string;
  432. scopes: {[name: string]: string | undefined};
  433. };
  434. /**
  435. * Security Requirement Object.
  436. * https://spec.openapis.org/oas/v3.1.0#security-requirement-object
  437. */
  438. export type OASecurityRequirementObject = {
  439. [name: string]: string[] | undefined;
  440. };
  441. /**
  442. * Tag object.
  443. * https://spec.openapis.org/oas/v3.1.0#tag-object
  444. */
  445. export type OATagObject = {
  446. name: string;
  447. description?: string;
  448. externalDocs?: OAExternalDocumentationObject;
  449. };
  450. /**
  451. * Server Variables Object.
  452. * (non-spec type)
  453. */
  454. export type OAServerVariablesObject = {
  455. [name: string]: OAServerVariableObject | undefined;
  456. };
  457. /**
  458. * Schema Properties Object.
  459. * (non-spec type)
  460. */
  461. export type OASchemaPropertiesObject = {
  462. [name: string]: OASchemaObject | OAReferenceObject | undefined;
  463. };
  464. /**
  465. * Webhooks Object.
  466. * (non-spec type)
  467. */
  468. export type OAWebhooksObject = {
  469. [name: string]: OAPathItemObject | OAReferenceObject | undefined;
  470. };
  471. /**
  472. * Callbacks Object.
  473. * (non-spec type)
  474. */
  475. export type OACallbacksObject = {
  476. [key: string]: OACallbackObject | OAReferenceObject | undefined;
  477. };
  478. /**
  479. * Content Object.
  480. * (non-spec type)
  481. */
  482. export type OAContentObject = {
  483. [mediaType: string]: OAMediaTypeObject | undefined;
  484. };
  485. /**
  486. * Headers Object.
  487. * (non-spec type)
  488. */
  489. export type OAHeadersObject = {
  490. [name: string]: OAHeaderObject | OAReferenceObject | undefined;
  491. };
  492. /**
  493. * Links Object.
  494. * (non-spec type)
  495. */
  496. export type OALinksObject = {
  497. [name: string]: OALinkObject | OAReferenceObject | undefined;
  498. };
  499. /**
  500. * Examples Object.
  501. * (non-spec type)
  502. */
  503. export type OAExamplesObject = {
  504. [name: string]: OAExampleObject | OAReferenceObject | undefined;
  505. };
  506. /**
  507. * Properties Encoding Object.
  508. * (non-spec type)
  509. */
  510. export type OAPropertiesEncodingObject = {
  511. [propertyName: string]: OAEncodingObject | undefined;
  512. };