openapi-typesafe 0.0.0 → 1.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (678) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +71 -1
  3. package/bin/cli.js +4 -0
  4. package/dist/adapters/node-file-system/node-file-system.cjs +46 -0
  5. package/dist/adapters/node-file-system/node-file-system.cjs.map +1 -0
  6. package/dist/adapters/node-file-system/node-file-system.mjs +40 -0
  7. package/dist/adapters/node-file-system/node-file-system.mjs.map +1 -0
  8. package/dist/adapters/redocly-loader/alias-limit.cjs +16 -0
  9. package/dist/adapters/redocly-loader/alias-limit.cjs.map +1 -0
  10. package/dist/adapters/redocly-loader/alias-limit.mjs +14 -0
  11. package/dist/adapters/redocly-loader/alias-limit.mjs.map +1 -0
  12. package/dist/adapters/redocly-loader/allowed-hosts.cjs +42 -0
  13. package/dist/adapters/redocly-loader/allowed-hosts.cjs.map +1 -0
  14. package/dist/adapters/redocly-loader/allowed-hosts.mjs +40 -0
  15. package/dist/adapters/redocly-loader/allowed-hosts.mjs.map +1 -0
  16. package/dist/adapters/redocly-loader/bundled-ref-repair.cjs +53 -0
  17. package/dist/adapters/redocly-loader/bundled-ref-repair.cjs.map +1 -0
  18. package/dist/adapters/redocly-loader/bundled-ref-repair.mjs +51 -0
  19. package/dist/adapters/redocly-loader/bundled-ref-repair.mjs.map +1 -0
  20. package/dist/adapters/redocly-loader/malformed-refs.cjs +41 -0
  21. package/dist/adapters/redocly-loader/malformed-refs.cjs.map +1 -0
  22. package/dist/adapters/redocly-loader/malformed-refs.mjs +38 -0
  23. package/dist/adapters/redocly-loader/malformed-refs.mjs.map +1 -0
  24. package/dist/adapters/redocly-loader/redocly-config-source.cjs +42 -0
  25. package/dist/adapters/redocly-loader/redocly-config-source.cjs.map +1 -0
  26. package/dist/adapters/redocly-loader/redocly-config-source.mjs +35 -0
  27. package/dist/adapters/redocly-loader/redocly-config-source.mjs.map +1 -0
  28. package/dist/adapters/redocly-loader/redocly-schema-loader.cjs +169 -0
  29. package/dist/adapters/redocly-loader/redocly-schema-loader.cjs.map +1 -0
  30. package/dist/adapters/redocly-loader/redocly-schema-loader.mjs +167 -0
  31. package/dist/adapters/redocly-loader/redocly-schema-loader.mjs.map +1 -0
  32. package/dist/adapters/redocly-loader/ref-access.cjs +107 -0
  33. package/dist/adapters/redocly-loader/ref-access.cjs.map +1 -0
  34. package/dist/adapters/redocly-loader/ref-access.mjs +99 -0
  35. package/dist/adapters/redocly-loader/ref-access.mjs.map +1 -0
  36. package/dist/adapters/redocly-loader/ref-holders.cjs +31 -0
  37. package/dist/adapters/redocly-loader/ref-holders.cjs.map +1 -0
  38. package/dist/adapters/redocly-loader/ref-holders.mjs +29 -0
  39. package/dist/adapters/redocly-loader/ref-holders.mjs.map +1 -0
  40. package/dist/adapters/redocly-loader/remote-fetch.cjs +60 -0
  41. package/dist/adapters/redocly-loader/remote-fetch.cjs.map +1 -0
  42. package/dist/adapters/redocly-loader/remote-fetch.mjs +56 -0
  43. package/dist/adapters/redocly-loader/remote-fetch.mjs.map +1 -0
  44. package/dist/adapters/redocly-loader/schema-load-errors.cjs +87 -0
  45. package/dist/adapters/redocly-loader/schema-load-errors.cjs.map +1 -0
  46. package/dist/adapters/redocly-loader/schema-load-errors.mjs +77 -0
  47. package/dist/adapters/redocly-loader/schema-load-errors.mjs.map +1 -0
  48. package/dist/adapters/redocly-loader/schema-source.cjs +104 -0
  49. package/dist/adapters/redocly-loader/schema-source.cjs.map +1 -0
  50. package/dist/adapters/redocly-loader/schema-source.mjs +98 -0
  51. package/dist/adapters/redocly-loader/schema-source.mjs.map +1 -0
  52. package/dist/adapters/redocly-loader/unsupported-keys.cjs +62 -0
  53. package/dist/adapters/redocly-loader/unsupported-keys.cjs.map +1 -0
  54. package/dist/adapters/redocly-loader/unsupported-keys.mjs +58 -0
  55. package/dist/adapters/redocly-loader/unsupported-keys.mjs.map +1 -0
  56. package/dist/adapters/terminal-logger/terminal-logger.cjs +67 -0
  57. package/dist/adapters/terminal-logger/terminal-logger.cjs.map +1 -0
  58. package/dist/adapters/terminal-logger/terminal-logger.mjs +59 -0
  59. package/dist/adapters/terminal-logger/terminal-logger.mjs.map +1 -0
  60. package/dist/adapters/type-ast-bridge/footer-nodes.cjs +21 -0
  61. package/dist/adapters/type-ast-bridge/footer-nodes.cjs.map +1 -0
  62. package/dist/adapters/type-ast-bridge/footer-nodes.mjs +17 -0
  63. package/dist/adapters/type-ast-bridge/footer-nodes.mjs.map +1 -0
  64. package/dist/adapters/type-ast-bridge/ir-declarations-to-typescript.cjs +75 -0
  65. package/dist/adapters/type-ast-bridge/ir-declarations-to-typescript.cjs.map +1 -0
  66. package/dist/adapters/type-ast-bridge/ir-declarations-to-typescript.mjs +71 -0
  67. package/dist/adapters/type-ast-bridge/ir-declarations-to-typescript.mjs.map +1 -0
  68. package/dist/adapters/type-ast-bridge/ir-to-typescript.cjs +145 -0
  69. package/dist/adapters/type-ast-bridge/ir-to-typescript.cjs.map +1 -0
  70. package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs +139 -0
  71. package/dist/adapters/type-ast-bridge/ir-to-typescript.mjs.map +1 -0
  72. package/dist/adapters/type-ast-bridge/lazy-node.cjs +23 -0
  73. package/dist/adapters/type-ast-bridge/lazy-node.cjs.map +1 -0
  74. package/dist/adapters/type-ast-bridge/lazy-node.mjs +21 -0
  75. package/dist/adapters/type-ast-bridge/lazy-node.mjs.map +1 -0
  76. package/dist/adapters/type-ast-bridge/load-typescript.cjs +57 -0
  77. package/dist/adapters/type-ast-bridge/load-typescript.cjs.map +1 -0
  78. package/dist/adapters/type-ast-bridge/load-typescript.mjs +51 -0
  79. package/dist/adapters/type-ast-bridge/load-typescript.mjs.map +1 -0
  80. package/dist/adapters/type-ast-bridge/print-typescript.cjs +21 -0
  81. package/dist/adapters/type-ast-bridge/print-typescript.cjs.map +1 -0
  82. package/dist/adapters/type-ast-bridge/print-typescript.mjs +19 -0
  83. package/dist/adapters/type-ast-bridge/print-typescript.mjs.map +1 -0
  84. package/dist/adapters/type-ast-bridge/typescript-raw-text.cjs +33 -0
  85. package/dist/adapters/type-ast-bridge/typescript-raw-text.cjs.map +1 -0
  86. package/dist/adapters/type-ast-bridge/typescript-raw-text.mjs +29 -0
  87. package/dist/adapters/type-ast-bridge/typescript-raw-text.mjs.map +1 -0
  88. package/dist/adapters/type-ast-bridge/typescript-to-ir.cjs +204 -0
  89. package/dist/adapters/type-ast-bridge/typescript-to-ir.cjs.map +1 -0
  90. package/dist/adapters/type-ast-bridge/typescript-to-ir.mjs +201 -0
  91. package/dist/adapters/type-ast-bridge/typescript-to-ir.mjs.map +1 -0
  92. package/dist/api/ast-to-string.cjs +39 -0
  93. package/dist/api/ast-to-string.cjs.map +1 -0
  94. package/dist/api/ast-to-string.mjs +37 -0
  95. package/dist/api/ast-to-string.mjs.map +1 -0
  96. package/dist/api/comment-header.cjs +11 -0
  97. package/dist/api/comment-header.cjs.map +1 -0
  98. package/dist/api/comment-header.mjs +9 -0
  99. package/dist/api/comment-header.mjs.map +1 -0
  100. package/dist/api/default-ports.cjs +38 -0
  101. package/dist/api/default-ports.cjs.map +1 -0
  102. package/dist/api/default-ports.mjs +28 -0
  103. package/dist/api/default-ports.mjs.map +1 -0
  104. package/dist/api/discriminator-enum.cjs +44 -0
  105. package/dist/api/discriminator-enum.cjs.map +1 -0
  106. package/dist/api/discriminator-enum.mjs +42 -0
  107. package/dist/api/discriminator-enum.mjs.map +1 -0
  108. package/dist/api/discriminator-scan.cjs +168 -0
  109. package/dist/api/discriminator-scan.cjs.map +1 -0
  110. package/dist/api/discriminator-scan.mjs +165 -0
  111. package/dist/api/discriminator-scan.mjs.map +1 -0
  112. package/dist/api/document-declarations.cjs +28 -0
  113. package/dist/api/document-declarations.cjs.map +1 -0
  114. package/dist/api/document-declarations.mjs +26 -0
  115. package/dist/api/document-declarations.mjs.map +1 -0
  116. package/dist/api/document-refs.cjs +53 -0
  117. package/dist/api/document-refs.cjs.map +1 -0
  118. package/dist/api/document-refs.mjs +50 -0
  119. package/dist/api/document-refs.mjs.map +1 -0
  120. package/dist/api/document-run.cjs +107 -0
  121. package/dist/api/document-run.cjs.map +1 -0
  122. package/dist/api/document-run.mjs +101 -0
  123. package/dist/api/document-run.mjs.map +1 -0
  124. package/dist/api/footer-entry.cjs +18 -0
  125. package/dist/api/footer-entry.cjs.map +1 -0
  126. package/dist/api/footer-entry.mjs +15 -0
  127. package/dist/api/footer-entry.mjs.map +1 -0
  128. package/dist/api/footer-sink.cjs +53 -0
  129. package/dist/api/footer-sink.cjs.map +1 -0
  130. package/dist/api/footer-sink.mjs +51 -0
  131. package/dist/api/footer-sink.mjs.map +1 -0
  132. package/dist/api/legacy-callback-warning.cjs +25 -0
  133. package/dist/api/legacy-callback-warning.cjs.map +1 -0
  134. package/dist/api/legacy-callback-warning.mjs +22 -0
  135. package/dist/api/legacy-callback-warning.mjs.map +1 -0
  136. package/dist/api/legacy-ts-helpers.cjs +203 -0
  137. package/dist/api/legacy-ts-helpers.cjs.map +1 -0
  138. package/dist/api/legacy-ts-helpers.mjs +187 -0
  139. package/dist/api/legacy-ts-helpers.mjs.map +1 -0
  140. package/dist/api/legacy-utils.cjs +65 -0
  141. package/dist/api/legacy-utils.cjs.map +1 -0
  142. package/dist/api/legacy-utils.mjs +50 -0
  143. package/dist/api/legacy-utils.mjs.map +1 -0
  144. package/dist/api/openapi-ts.cjs +40 -0
  145. package/dist/api/openapi-ts.cjs.map +1 -0
  146. package/dist/api/openapi-ts.mjs +34 -0
  147. package/dist/api/openapi-ts.mjs.map +1 -0
  148. package/dist/api/schema-callbacks.cjs +140 -0
  149. package/dist/api/schema-callbacks.cjs.map +1 -0
  150. package/dist/api/schema-callbacks.mjs +136 -0
  151. package/dist/api/schema-callbacks.mjs.map +1 -0
  152. package/dist/api/string-to-ast.cjs +21 -0
  153. package/dist/api/string-to-ast.cjs.map +1 -0
  154. package/dist/api/string-to-ast.mjs +18 -0
  155. package/dist/api/string-to-ast.mjs.map +1 -0
  156. package/dist/api/transform-context.cjs +82 -0
  157. package/dist/api/transform-context.cjs.map +1 -0
  158. package/dist/api/transform-context.mjs +65 -0
  159. package/dist/api/transform-context.mjs.map +1 -0
  160. package/dist/api/transform-schema.cjs +31 -0
  161. package/dist/api/transform-schema.cjs.map +1 -0
  162. package/dist/api/transform-schema.mjs +26 -0
  163. package/dist/api/transform-schema.mjs.map +1 -0
  164. package/dist/api/type-helpers.cjs +85 -0
  165. package/dist/api/type-helpers.cjs.map +1 -0
  166. package/dist/api/type-helpers.mjs +66 -0
  167. package/dist/api/type-helpers.mjs.map +1 -0
  168. package/dist/api/unsupported-feature-warnings.cjs +17 -0
  169. package/dist/api/unsupported-feature-warnings.cjs.map +1 -0
  170. package/dist/api/unsupported-feature-warnings.mjs +15 -0
  171. package/dist/api/unsupported-feature-warnings.mjs.map +1 -0
  172. package/dist/application/print/comment-writer.cjs +95 -0
  173. package/dist/application/print/comment-writer.cjs.map +1 -0
  174. package/dist/application/print/comment-writer.mjs +93 -0
  175. package/dist/application/print/comment-writer.mjs.map +1 -0
  176. package/dist/application/print/declaration-printer.cjs +83 -0
  177. package/dist/application/print/declaration-printer.cjs.map +1 -0
  178. package/dist/application/print/declaration-printer.mjs +81 -0
  179. package/dist/application/print/declaration-printer.mjs.map +1 -0
  180. package/dist/application/print/literal-text.cjs +52 -0
  181. package/dist/application/print/literal-text.cjs.map +1 -0
  182. package/dist/application/print/literal-text.mjs +48 -0
  183. package/dist/application/print/literal-text.mjs.map +1 -0
  184. package/dist/application/print/print-nodes.cjs +38 -0
  185. package/dist/application/print/print-nodes.cjs.map +1 -0
  186. package/dist/application/print/print-nodes.mjs +36 -0
  187. package/dist/application/print/print-nodes.mjs.map +1 -0
  188. package/dist/application/print/print-options.cjs +6 -0
  189. package/dist/application/print/print-options.cjs.map +1 -0
  190. package/dist/application/print/print-options.mjs +4 -0
  191. package/dist/application/print/print-options.mjs.map +1 -0
  192. package/dist/application/print/text-writer.cjs +63 -0
  193. package/dist/application/print/text-writer.cjs.map +1 -0
  194. package/dist/application/print/text-writer.mjs +60 -0
  195. package/dist/application/print/text-writer.mjs.map +1 -0
  196. package/dist/application/print/type-printer.cjs +214 -0
  197. package/dist/application/print/type-printer.cjs.map +1 -0
  198. package/dist/application/print/type-printer.mjs +210 -0
  199. package/dist/application/print/type-printer.mjs.map +1 -0
  200. package/dist/application/stack-overflow.cjs +36 -0
  201. package/dist/application/stack-overflow.cjs.map +1 -0
  202. package/dist/application/stack-overflow.mjs +31 -0
  203. package/dist/application/stack-overflow.mjs.map +1 -0
  204. package/dist/application/transform/document/components.cjs +104 -0
  205. package/dist/application/transform/document/components.cjs.map +1 -0
  206. package/dist/application/transform/document/components.mjs +102 -0
  207. package/dist/application/transform/document/components.mjs.map +1 -0
  208. package/dist/application/transform/document/defs-root.cjs +18 -0
  209. package/dist/application/transform/document/defs-root.cjs.map +1 -0
  210. package/dist/application/transform/document/defs-root.mjs +16 -0
  211. package/dist/application/transform/document/defs-root.mjs.map +1 -0
  212. package/dist/application/transform/document/document-member.cjs +13 -0
  213. package/dist/application/transform/document/document-member.cjs.map +1 -0
  214. package/dist/application/transform/document/document-member.mjs +11 -0
  215. package/dist/application/transform/document/document-member.mjs.map +1 -0
  216. package/dist/application/transform/document/document.cjs +86 -0
  217. package/dist/application/transform/document/document.cjs.map +1 -0
  218. package/dist/application/transform/document/document.mjs +83 -0
  219. package/dist/application/transform/document/document.mjs.map +1 -0
  220. package/dist/application/transform/document/header.cjs +27 -0
  221. package/dist/application/transform/document/header.cjs.map +1 -0
  222. package/dist/application/transform/document/header.mjs +25 -0
  223. package/dist/application/transform/document/header.mjs.map +1 -0
  224. package/dist/application/transform/document/kept-deprecated.cjs +96 -0
  225. package/dist/application/transform/document/kept-deprecated.cjs.map +1 -0
  226. package/dist/application/transform/document/kept-deprecated.mjs +94 -0
  227. package/dist/application/transform/document/kept-deprecated.mjs.map +1 -0
  228. package/dist/application/transform/document/media-type.cjs +42 -0
  229. package/dist/application/transform/document/media-type.cjs.map +1 -0
  230. package/dist/application/transform/document/media-type.mjs +38 -0
  231. package/dist/application/transform/document/media-type.mjs.map +1 -0
  232. package/dist/application/transform/document/operation.cjs +45 -0
  233. package/dist/application/transform/document/operation.cjs.map +1 -0
  234. package/dist/application/transform/document/operation.mjs +43 -0
  235. package/dist/application/transform/document/operation.mjs.map +1 -0
  236. package/dist/application/transform/document/parameter.cjs +25 -0
  237. package/dist/application/transform/document/parameter.cjs.map +1 -0
  238. package/dist/application/transform/document/parameter.mjs +23 -0
  239. package/dist/application/transform/document/parameter.mjs.map +1 -0
  240. package/dist/application/transform/document/parameters.cjs +114 -0
  241. package/dist/application/transform/document/parameters.cjs.map +1 -0
  242. package/dist/application/transform/document/parameters.mjs +112 -0
  243. package/dist/application/transform/document/parameters.mjs.map +1 -0
  244. package/dist/application/transform/document/path-item-conflicts.cjs +51 -0
  245. package/dist/application/transform/document/path-item-conflicts.cjs.map +1 -0
  246. package/dist/application/transform/document/path-item-conflicts.mjs +49 -0
  247. package/dist/application/transform/document/path-item-conflicts.mjs.map +1 -0
  248. package/dist/application/transform/document/path-item.cjs +82 -0
  249. package/dist/application/transform/document/path-item.cjs.map +1 -0
  250. package/dist/application/transform/document/path-item.mjs +80 -0
  251. package/dist/application/transform/document/path-item.mjs.map +1 -0
  252. package/dist/application/transform/document/path-key-overlaps.cjs +57 -0
  253. package/dist/application/transform/document/path-key-overlaps.cjs.map +1 -0
  254. package/dist/application/transform/document/path-key-overlaps.mjs +55 -0
  255. package/dist/application/transform/document/path-key-overlaps.mjs.map +1 -0
  256. package/dist/application/transform/document/paths-enum.cjs +75 -0
  257. package/dist/application/transform/document/paths-enum.cjs.map +1 -0
  258. package/dist/application/transform/document/paths-enum.mjs +72 -0
  259. package/dist/application/transform/document/paths-enum.mjs.map +1 -0
  260. package/dist/application/transform/document/paths.cjs +127 -0
  261. package/dist/application/transform/document/paths.cjs.map +1 -0
  262. package/dist/application/transform/document/paths.mjs +125 -0
  263. package/dist/application/transform/document/paths.mjs.map +1 -0
  264. package/dist/application/transform/document/request-body.cjs +36 -0
  265. package/dist/application/transform/document/request-body.cjs.map +1 -0
  266. package/dist/application/transform/document/request-body.mjs +34 -0
  267. package/dist/application/transform/document/request-body.mjs.map +1 -0
  268. package/dist/application/transform/document/response.cjs +59 -0
  269. package/dist/application/transform/document/response.cjs.map +1 -0
  270. package/dist/application/transform/document/response.mjs +57 -0
  271. package/dist/application/transform/document/response.mjs.map +1 -0
  272. package/dist/application/transform/document/responses.cjs +23 -0
  273. package/dist/application/transform/document/responses.cjs.map +1 -0
  274. package/dist/application/transform/document/responses.mjs +21 -0
  275. package/dist/application/transform/document/responses.mjs.map +1 -0
  276. package/dist/application/transform/document/root-type-aliases.cjs +69 -0
  277. package/dist/application/transform/document/root-type-aliases.cjs.map +1 -0
  278. package/dist/application/transform/document/root-type-aliases.mjs +65 -0
  279. package/dist/application/transform/document/root-type-aliases.mjs.map +1 -0
  280. package/dist/application/transform/document/webhooks.cjs +19 -0
  281. package/dist/application/transform/document/webhooks.cjs.map +1 -0
  282. package/dist/application/transform/document/webhooks.mjs +17 -0
  283. package/dist/application/transform/document/webhooks.mjs.map +1 -0
  284. package/dist/application/transform/document-entries.cjs +17 -0
  285. package/dist/application/transform/document-entries.cjs.map +1 -0
  286. package/dist/application/transform/document-entries.mjs +14 -0
  287. package/dist/application/transform/document-entries.mjs.map +1 -0
  288. package/dist/application/transform/footer/document-footer.cjs +88 -0
  289. package/dist/application/transform/footer/document-footer.cjs.map +1 -0
  290. package/dist/application/transform/footer/document-footer.mjs +86 -0
  291. package/dist/application/transform/footer/document-footer.mjs.map +1 -0
  292. package/dist/application/transform/footer/enum-naming.cjs +121 -0
  293. package/dist/application/transform/footer/enum-naming.cjs.map +1 -0
  294. package/dist/application/transform/footer/enum-naming.mjs +115 -0
  295. package/dist/application/transform/footer/enum-naming.mjs.map +1 -0
  296. package/dist/application/transform/helper-types.cjs +68 -0
  297. package/dist/application/transform/helper-types.cjs.map +1 -0
  298. package/dist/application/transform/helper-types.mjs +65 -0
  299. package/dist/application/transform/helper-types.mjs.map +1 -0
  300. package/dist/application/transform/literal-type.cjs +36 -0
  301. package/dist/application/transform/literal-type.cjs.map +1 -0
  302. package/dist/application/transform/literal-type.mjs +34 -0
  303. package/dist/application/transform/literal-type.mjs.map +1 -0
  304. package/dist/application/transform/numbered-names.cjs +18 -0
  305. package/dist/application/transform/numbered-names.cjs.map +1 -0
  306. package/dist/application/transform/numbered-names.mjs +16 -0
  307. package/dist/application/transform/numbered-names.mjs.map +1 -0
  308. package/dist/application/transform/ref-type.cjs +57 -0
  309. package/dist/application/transform/ref-type.cjs.map +1 -0
  310. package/dist/application/transform/ref-type.mjs +54 -0
  311. package/dist/application/transform/ref-type.mjs.map +1 -0
  312. package/dist/application/transform/schema/array-type.cjs +105 -0
  313. package/dist/application/transform/schema/array-type.cjs.map +1 -0
  314. package/dist/application/transform/schema/array-type.mjs +103 -0
  315. package/dist/application/transform/schema/array-type.mjs.map +1 -0
  316. package/dist/application/transform/schema/composition-type.cjs +107 -0
  317. package/dist/application/transform/schema/composition-type.cjs.map +1 -0
  318. package/dist/application/transform/schema/composition-type.mjs +105 -0
  319. package/dist/application/transform/schema/composition-type.mjs.map +1 -0
  320. package/dist/application/transform/schema/core-type.cjs +84 -0
  321. package/dist/application/transform/schema/core-type.cjs.map +1 -0
  322. package/dist/application/transform/schema/core-type.mjs +82 -0
  323. package/dist/application/transform/schema/core-type.mjs.map +1 -0
  324. package/dist/application/transform/schema/discriminator-property.cjs +21 -0
  325. package/dist/application/transform/schema/discriminator-property.cjs.map +1 -0
  326. package/dist/application/transform/schema/discriminator-property.mjs +19 -0
  327. package/dist/application/transform/schema/discriminator-property.mjs.map +1 -0
  328. package/dist/application/transform/schema/enum-rule.cjs +107 -0
  329. package/dist/application/transform/schema/enum-rule.cjs.map +1 -0
  330. package/dist/application/transform/schema/enum-rule.mjs +105 -0
  331. package/dist/application/transform/schema/enum-rule.mjs.map +1 -0
  332. package/dist/application/transform/schema/object-type.cjs +173 -0
  333. package/dist/application/transform/schema/object-type.cjs.map +1 -0
  334. package/dist/application/transform/schema/object-type.mjs +170 -0
  335. package/dist/application/transform/schema/object-type.mjs.map +1 -0
  336. package/dist/application/transform/schema/presence-members.cjs +59 -0
  337. package/dist/application/transform/schema/presence-members.cjs.map +1 -0
  338. package/dist/application/transform/schema/presence-members.mjs +57 -0
  339. package/dist/application/transform/schema/presence-members.mjs.map +1 -0
  340. package/dist/application/transform/schema/schema-transform.cjs +72 -0
  341. package/dist/application/transform/schema/schema-transform.cjs.map +1 -0
  342. package/dist/application/transform/schema/schema-transform.mjs +68 -0
  343. package/dist/application/transform/schema/schema-transform.mjs.map +1 -0
  344. package/dist/application/transform/schema/unevaluated-properties.cjs +61 -0
  345. package/dist/application/transform/schema/unevaluated-properties.cjs.map +1 -0
  346. package/dist/application/transform/schema/unevaluated-properties.mjs +59 -0
  347. package/dist/application/transform/schema/unevaluated-properties.mjs.map +1 -0
  348. package/dist/application/transform/schema-comment.cjs +84 -0
  349. package/dist/application/transform/schema-comment.cjs.map +1 -0
  350. package/dist/application/transform/schema-comment.mjs +81 -0
  351. package/dist/application/transform/schema-comment.mjs.map +1 -0
  352. package/dist/application/transform/shared-types.cjs +8 -0
  353. package/dist/application/transform/shared-types.cjs.map +1 -0
  354. package/dist/application/transform/shared-types.mjs +6 -0
  355. package/dist/application/transform/shared-types.mjs.map +1 -0
  356. package/dist/application/transform/type-combinators.cjs +49 -0
  357. package/dist/application/transform/type-combinators.cjs.map +1 -0
  358. package/dist/application/transform/type-combinators.mjs +42 -0
  359. package/dist/application/transform/type-combinators.mjs.map +1 -0
  360. package/dist/cli/cli-arguments.cjs +137 -0
  361. package/dist/cli/cli-arguments.cjs.map +1 -0
  362. package/dist/cli/cli-arguments.mjs +129 -0
  363. package/dist/cli/cli-arguments.mjs.map +1 -0
  364. package/dist/cli/cli-errors.cjs +80 -0
  365. package/dist/cli/cli-errors.cjs.map +1 -0
  366. package/dist/cli/cli-errors.mjs +76 -0
  367. package/dist/cli/cli-errors.mjs.map +1 -0
  368. package/dist/cli/cli-output.cjs +37 -0
  369. package/dist/cli/cli-output.cjs.map +1 -0
  370. package/dist/cli/cli-output.mjs +30 -0
  371. package/dist/cli/cli-output.mjs.map +1 -0
  372. package/dist/cli/docs-links.cjs +6 -0
  373. package/dist/cli/docs-links.cjs.map +1 -0
  374. package/dist/cli/docs-links.mjs +4 -0
  375. package/dist/cli/docs-links.mjs.map +1 -0
  376. package/dist/cli/fix-option.cjs +19 -0
  377. package/dist/cli/fix-option.cjs.map +1 -0
  378. package/dist/cli/fix-option.mjs +16 -0
  379. package/dist/cli/fix-option.mjs.map +1 -0
  380. package/dist/cli/help-text.cjs +44 -0
  381. package/dist/cli/help-text.cjs.map +1 -0
  382. package/dist/cli/help-text.mjs +42 -0
  383. package/dist/cli/help-text.mjs.map +1 -0
  384. package/dist/cli/main.cjs +62 -0
  385. package/dist/cli/main.cjs.map +1 -0
  386. package/dist/cli/main.d.cts +2 -0
  387. package/dist/cli/main.d.mts +2 -0
  388. package/dist/cli/main.d.ts +2 -0
  389. package/dist/cli/main.mjs +54 -0
  390. package/dist/cli/main.mjs.map +1 -0
  391. package/dist/cli/redocly-apis.cjs +65 -0
  392. package/dist/cli/redocly-apis.cjs.map +1 -0
  393. package/dist/cli/redocly-apis.mjs +62 -0
  394. package/dist/cli/redocly-apis.mjs.map +1 -0
  395. package/dist/cli/ref-limits.cjs +14 -0
  396. package/dist/cli/ref-limits.cjs.map +1 -0
  397. package/dist/cli/ref-limits.mjs +12 -0
  398. package/dist/cli/ref-limits.mjs.map +1 -0
  399. package/dist/cli/run-cli.cjs +100 -0
  400. package/dist/cli/run-cli.cjs.map +1 -0
  401. package/dist/cli/run-cli.mjs +98 -0
  402. package/dist/cli/run-cli.mjs.map +1 -0
  403. package/dist/domain/assert-never.cjs +8 -0
  404. package/dist/domain/assert-never.cjs.map +1 -0
  405. package/dist/domain/assert-never.mjs +6 -0
  406. package/dist/domain/assert-never.mjs.map +1 -0
  407. package/dist/domain/errors.cjs +50 -0
  408. package/dist/domain/errors.cjs.map +1 -0
  409. package/dist/domain/errors.mjs +46 -0
  410. package/dist/domain/errors.mjs.map +1 -0
  411. package/dist/domain/ir/constructors.cjs +89 -0
  412. package/dist/domain/ir/constructors.cjs.map +1 -0
  413. package/dist/domain/ir/constructors.mjs +71 -0
  414. package/dist/domain/ir/constructors.mjs.map +1 -0
  415. package/dist/domain/ir/identifier-text.cjs +29 -0
  416. package/dist/domain/ir/identifier-text.cjs.map +1 -0
  417. package/dist/domain/ir/identifier-text.mjs +25 -0
  418. package/dist/domain/ir/identifier-text.mjs.map +1 -0
  419. package/dist/domain/ir/newer-identifier-ranges.cjs +109 -0
  420. package/dist/domain/ir/newer-identifier-ranges.cjs.map +1 -0
  421. package/dist/domain/ir/newer-identifier-ranges.mjs +106 -0
  422. package/dist/domain/ir/newer-identifier-ranges.mjs.map +1 -0
  423. package/dist/domain/ir/normalize.cjs +32 -0
  424. package/dist/domain/ir/normalize.cjs.map +1 -0
  425. package/dist/domain/ir/normalize.mjs +29 -0
  426. package/dist/domain/ir/normalize.mjs.map +1 -0
  427. package/dist/domain/ir/property-name.cjs +19 -0
  428. package/dist/domain/ir/property-name.cjs.map +1 -0
  429. package/dist/domain/ir/property-name.mjs +16 -0
  430. package/dist/domain/ir/property-name.mjs.map +1 -0
  431. package/dist/domain/ir/raw-text-escapes.cjs +25 -0
  432. package/dist/domain/ir/raw-text-escapes.cjs.map +1 -0
  433. package/dist/domain/ir/raw-text-escapes.mjs +22 -0
  434. package/dist/domain/ir/raw-text-escapes.mjs.map +1 -0
  435. package/dist/domain/openapi/alias-expansion.cjs +50 -0
  436. package/dist/domain/openapi/alias-expansion.cjs.map +1 -0
  437. package/dist/domain/openapi/alias-expansion.mjs +45 -0
  438. package/dist/domain/openapi/alias-expansion.mjs.map +1 -0
  439. package/dist/domain/openapi/binary-content.cjs +48 -0
  440. package/dist/domain/openapi/binary-content.cjs.map +1 -0
  441. package/dist/domain/openapi/binary-content.mjs +45 -0
  442. package/dist/domain/openapi/binary-content.mjs.map +1 -0
  443. package/dist/domain/openapi/components-object.cjs +29 -0
  444. package/dist/domain/openapi/components-object.cjs.map +1 -0
  445. package/dist/domain/openapi/components-object.mjs +24 -0
  446. package/dist/domain/openapi/components-object.mjs.map +1 -0
  447. package/dist/domain/openapi/json-pointer.cjs +31 -0
  448. package/dist/domain/openapi/json-pointer.cjs.map +1 -0
  449. package/dist/domain/openapi/json-pointer.mjs +27 -0
  450. package/dist/domain/openapi/json-pointer.mjs.map +1 -0
  451. package/dist/domain/openapi/media-type-object.cjs +14 -0
  452. package/dist/domain/openapi/media-type-object.cjs.map +1 -0
  453. package/dist/domain/openapi/media-type-object.mjs +11 -0
  454. package/dist/domain/openapi/media-type-object.mjs.map +1 -0
  455. package/dist/domain/openapi/parameter-object.cjs +13 -0
  456. package/dist/domain/openapi/parameter-object.cjs.map +1 -0
  457. package/dist/domain/openapi/parameter-object.mjs +10 -0
  458. package/dist/domain/openapi/parameter-object.mjs.map +1 -0
  459. package/dist/domain/openapi/path-item-object.cjs +35 -0
  460. package/dist/domain/openapi/path-item-object.cjs.map +1 -0
  461. package/dist/domain/openapi/path-item-object.mjs +30 -0
  462. package/dist/domain/openapi/path-item-object.mjs.map +1 -0
  463. package/dist/domain/openapi/unsupported-features.cjs +87 -0
  464. package/dist/domain/openapi/unsupported-features.cjs.map +1 -0
  465. package/dist/domain/openapi/unsupported-features.mjs +84 -0
  466. package/dist/domain/openapi/unsupported-features.mjs.map +1 -0
  467. package/dist/domain/output-fixes.cjs +66 -0
  468. package/dist/domain/output-fixes.cjs.map +1 -0
  469. package/dist/domain/output-fixes.mjs +59 -0
  470. package/dist/domain/output-fixes.mjs.map +1 -0
  471. package/dist/index.cjs +98 -0
  472. package/dist/index.cjs.map +1 -0
  473. package/dist/index.d.cts +812 -0
  474. package/dist/index.d.mts +812 -0
  475. package/dist/index.d.ts +812 -0
  476. package/dist/index.mjs +27 -0
  477. package/dist/index.mjs.map +1 -0
  478. package/dist/transform/components-object.cjs +14 -0
  479. package/dist/transform/components-object.cjs.map +1 -0
  480. package/dist/transform/components-object.mjs +10 -0
  481. package/dist/transform/components-object.mjs.map +1 -0
  482. package/dist/transform/header-object.cjs +12 -0
  483. package/dist/transform/header-object.cjs.map +1 -0
  484. package/dist/transform/header-object.mjs +10 -0
  485. package/dist/transform/header-object.mjs.map +1 -0
  486. package/dist/transform/media-type-object.cjs +12 -0
  487. package/dist/transform/media-type-object.cjs.map +1 -0
  488. package/dist/transform/media-type-object.mjs +10 -0
  489. package/dist/transform/media-type-object.mjs.map +1 -0
  490. package/dist/transform/operation-object.cjs +26 -0
  491. package/dist/transform/operation-object.cjs.map +1 -0
  492. package/dist/transform/operation-object.mjs +21 -0
  493. package/dist/transform/operation-object.mjs.map +1 -0
  494. package/dist/transform/parameter-object.cjs +12 -0
  495. package/dist/transform/parameter-object.cjs.map +1 -0
  496. package/dist/transform/parameter-object.mjs +10 -0
  497. package/dist/transform/parameter-object.mjs.map +1 -0
  498. package/dist/transform/path-item-object.cjs +12 -0
  499. package/dist/transform/path-item-object.cjs.map +1 -0
  500. package/dist/transform/path-item-object.mjs +10 -0
  501. package/dist/transform/path-item-object.mjs.map +1 -0
  502. package/dist/transform/paths-object.cjs +11 -0
  503. package/dist/transform/paths-object.cjs.map +1 -0
  504. package/dist/transform/paths-object.mjs +9 -0
  505. package/dist/transform/paths-object.mjs.map +1 -0
  506. package/dist/transform/request-body-object.cjs +12 -0
  507. package/dist/transform/request-body-object.cjs.map +1 -0
  508. package/dist/transform/request-body-object.mjs +10 -0
  509. package/dist/transform/request-body-object.mjs.map +1 -0
  510. package/dist/transform/response-object.cjs +12 -0
  511. package/dist/transform/response-object.cjs.map +1 -0
  512. package/dist/transform/response-object.mjs +10 -0
  513. package/dist/transform/response-object.mjs.map +1 -0
  514. package/dist/transform/responses-object.cjs +12 -0
  515. package/dist/transform/responses-object.cjs.map +1 -0
  516. package/dist/transform/responses-object.mjs +10 -0
  517. package/dist/transform/responses-object.mjs.map +1 -0
  518. package/dist/transform/schema-object.cjs +21 -0
  519. package/dist/transform/schema-object.cjs.map +1 -0
  520. package/dist/transform/schema-object.mjs +16 -0
  521. package/dist/transform/schema-object.mjs.map +1 -0
  522. package/package.json +115 -4
  523. package/src/adapters/node-file-system/node-file-system.ts +44 -0
  524. package/src/adapters/redocly-loader/alias-limit.ts +20 -0
  525. package/src/adapters/redocly-loader/allowed-hosts.ts +62 -0
  526. package/src/adapters/redocly-loader/bundled-ref-repair.ts +65 -0
  527. package/src/adapters/redocly-loader/malformed-refs.ts +61 -0
  528. package/src/adapters/redocly-loader/redocly-config-source.ts +43 -0
  529. package/src/adapters/redocly-loader/redocly-schema-loader.ts +246 -0
  530. package/src/adapters/redocly-loader/ref-access.ts +146 -0
  531. package/src/adapters/redocly-loader/ref-holders.ts +43 -0
  532. package/src/adapters/redocly-loader/remote-fetch.ts +104 -0
  533. package/src/adapters/redocly-loader/schema-load-errors.ts +124 -0
  534. package/src/adapters/redocly-loader/schema-source.ts +151 -0
  535. package/src/adapters/redocly-loader/unsupported-keys.ts +102 -0
  536. package/src/adapters/terminal-logger/terminal-logger.ts +98 -0
  537. package/src/adapters/type-ast-bridge/footer-nodes.ts +38 -0
  538. package/src/adapters/type-ast-bridge/ir-declarations-to-typescript.ts +100 -0
  539. package/src/adapters/type-ast-bridge/ir-to-typescript.ts +220 -0
  540. package/src/adapters/type-ast-bridge/lazy-node.ts +24 -0
  541. package/src/adapters/type-ast-bridge/load-typescript.ts +84 -0
  542. package/src/adapters/type-ast-bridge/print-typescript.ts +33 -0
  543. package/src/adapters/type-ast-bridge/typescript-raw-text.ts +49 -0
  544. package/src/adapters/type-ast-bridge/typescript-to-ir.ts +280 -0
  545. package/src/adapters/type-ast-bridge/typescript-types.ts +8 -0
  546. package/src/api/ast-to-string.ts +59 -0
  547. package/src/api/comment-header.ts +7 -0
  548. package/src/api/default-ports.ts +44 -0
  549. package/src/api/discriminator-enum.ts +76 -0
  550. package/src/api/discriminator-scan.ts +272 -0
  551. package/src/api/document-declarations.ts +41 -0
  552. package/src/api/document-refs.ts +71 -0
  553. package/src/api/document-run.ts +159 -0
  554. package/src/api/footer-entry.ts +23 -0
  555. package/src/api/footer-sink.ts +67 -0
  556. package/src/api/legacy-callback-warning.ts +29 -0
  557. package/src/api/legacy-ts-helpers.ts +311 -0
  558. package/src/api/legacy-utils.ts +118 -0
  559. package/src/api/openapi-ts.ts +62 -0
  560. package/src/api/schema-callbacks.ts +211 -0
  561. package/src/api/string-to-ast.ts +27 -0
  562. package/src/api/transform-context.ts +87 -0
  563. package/src/api/transform-schema.ts +39 -0
  564. package/src/api/type-helpers.ts +130 -0
  565. package/src/api/unsupported-feature-warnings.ts +26 -0
  566. package/src/application/ports/file-system.ts +12 -0
  567. package/src/application/ports/logger.ts +16 -0
  568. package/src/application/ports/redocly-config-source.ts +16 -0
  569. package/src/application/ports/schema-loader.ts +32 -0
  570. package/src/application/print/comment-writer.ts +91 -0
  571. package/src/application/print/declaration-printer.ts +100 -0
  572. package/src/application/print/literal-text.ts +62 -0
  573. package/src/application/print/print-nodes.ts +62 -0
  574. package/src/application/print/print-options.ts +11 -0
  575. package/src/application/print/text-writer.ts +83 -0
  576. package/src/application/print/type-printer.ts +281 -0
  577. package/src/application/stack-overflow.ts +54 -0
  578. package/src/application/transform/document/components.ts +189 -0
  579. package/src/application/transform/document/defs-root.ts +25 -0
  580. package/src/application/transform/document/document-member.ts +20 -0
  581. package/src/application/transform/document/document.ts +157 -0
  582. package/src/application/transform/document/header.ts +34 -0
  583. package/src/application/transform/document/kept-deprecated.ts +135 -0
  584. package/src/application/transform/document/media-type.ts +78 -0
  585. package/src/application/transform/document/operation.ts +64 -0
  586. package/src/application/transform/document/parameter.ts +45 -0
  587. package/src/application/transform/document/parameters.ts +200 -0
  588. package/src/application/transform/document/path-item-conflicts.ts +79 -0
  589. package/src/application/transform/document/path-item.ts +168 -0
  590. package/src/application/transform/document/path-key-overlaps.ts +112 -0
  591. package/src/application/transform/document/paths-enum.ts +127 -0
  592. package/src/application/transform/document/paths.ts +211 -0
  593. package/src/application/transform/document/request-body.ts +50 -0
  594. package/src/application/transform/document/response.ts +109 -0
  595. package/src/application/transform/document/responses.ts +29 -0
  596. package/src/application/transform/document/root-type-aliases.ts +106 -0
  597. package/src/application/transform/document/webhooks.ts +22 -0
  598. package/src/application/transform/document-entries.ts +28 -0
  599. package/src/application/transform/footer/document-footer.ts +127 -0
  600. package/src/application/transform/footer/enum-naming.ts +181 -0
  601. package/src/application/transform/helper-types.ts +92 -0
  602. package/src/application/transform/literal-type.ts +54 -0
  603. package/src/application/transform/numbered-names.ts +20 -0
  604. package/src/application/transform/ref-type.ts +97 -0
  605. package/src/application/transform/schema/array-type.ts +152 -0
  606. package/src/application/transform/schema/composition-type.ts +183 -0
  607. package/src/application/transform/schema/core-type.ts +115 -0
  608. package/src/application/transform/schema/discriminator-property.ts +28 -0
  609. package/src/application/transform/schema/enum-rule.ts +157 -0
  610. package/src/application/transform/schema/object-type.ts +271 -0
  611. package/src/application/transform/schema/presence-members.ts +96 -0
  612. package/src/application/transform/schema/schema-context.ts +110 -0
  613. package/src/application/transform/schema/schema-rule.ts +29 -0
  614. package/src/application/transform/schema/schema-transform.ts +99 -0
  615. package/src/application/transform/schema/unevaluated-properties.ts +105 -0
  616. package/src/application/transform/schema-comment.ts +116 -0
  617. package/src/application/transform/shared-types.ts +9 -0
  618. package/src/application/transform/transform-context.ts +51 -0
  619. package/src/application/transform/type-combinators.ts +57 -0
  620. package/src/cli/cli-arguments.ts +198 -0
  621. package/src/cli/cli-dependencies.ts +42 -0
  622. package/src/cli/cli-errors.ts +125 -0
  623. package/src/cli/cli-output.ts +53 -0
  624. package/src/cli/docs-links.ts +6 -0
  625. package/src/cli/fix-option.ts +29 -0
  626. package/src/cli/help-text.ts +52 -0
  627. package/src/cli/main.ts +67 -0
  628. package/src/cli/redocly-apis.ts +91 -0
  629. package/src/cli/ref-limits.ts +16 -0
  630. package/src/cli/run-cli.ts +114 -0
  631. package/src/domain/assert-never.ts +8 -0
  632. package/src/domain/errors.ts +74 -0
  633. package/src/domain/ir/constructors.ts +137 -0
  634. package/src/domain/ir/identifier-text.ts +49 -0
  635. package/src/domain/ir/newer-identifier-ranges.ts +109 -0
  636. package/src/domain/ir/nodes.ts +224 -0
  637. package/src/domain/ir/normalize.ts +51 -0
  638. package/src/domain/ir/property-name.ts +28 -0
  639. package/src/domain/ir/raw-text-escapes.ts +37 -0
  640. package/src/domain/openapi/alias-expansion.ts +72 -0
  641. package/src/domain/openapi/binary-content.ts +74 -0
  642. package/src/domain/openapi/components-object.ts +52 -0
  643. package/src/domain/openapi/document-object.ts +12 -0
  644. package/src/domain/openapi/header-object.ts +9 -0
  645. package/src/domain/openapi/json-pointer.ts +46 -0
  646. package/src/domain/openapi/media-type-object.ts +26 -0
  647. package/src/domain/openapi/operation-object.ts +13 -0
  648. package/src/domain/openapi/parameter-object.ts +30 -0
  649. package/src/domain/openapi/path-item-object.ts +70 -0
  650. package/src/domain/openapi/request-body-object.ts +7 -0
  651. package/src/domain/openapi/response-object.ts +14 -0
  652. package/src/domain/openapi/schema-object.ts +59 -0
  653. package/src/domain/openapi/unsupported-features.ts +139 -0
  654. package/src/domain/output-fixes.ts +95 -0
  655. package/src/index.ts +67 -0
  656. package/src/transform/components-object.ts +25 -0
  657. package/src/transform/header-object.ts +19 -0
  658. package/src/transform/media-type-object.ts +19 -0
  659. package/src/transform/operation-object.ts +36 -0
  660. package/src/transform/parameter-object.ts +19 -0
  661. package/src/transform/parameters-array.ts +19 -0
  662. package/src/transform/path-item-object.ts +22 -0
  663. package/src/transform/paths-enum.ts +8 -0
  664. package/src/transform/paths-object.ts +15 -0
  665. package/src/transform/request-body-object.ts +19 -0
  666. package/src/transform/response-object.ts +19 -0
  667. package/src/transform/responses-object.ts +19 -0
  668. package/src/transform/schema-object.ts +36 -0
  669. package/src/transform/webhooks-object.ts +15 -0
  670. package/src/types/generator-options.ts +267 -0
  671. package/src/types/openapi-common.ts +100 -0
  672. package/src/types/openapi-document.ts +196 -0
  673. package/src/types/openapi-path-item.ts +130 -0
  674. package/src/types/openapi-request.ts +209 -0
  675. package/src/types/openapi-response.ts +81 -0
  676. package/src/types/openapi-schema.ts +169 -0
  677. package/src/types/openapi-security.ts +116 -0
  678. package/src/types.ts +12 -0
@@ -0,0 +1,267 @@
1
+ import type { PathLike } from "node:fs";
2
+ import type { Readable } from "node:stream";
3
+ import type { Config as RedoclyConfig } from "@redocly/openapi-core";
4
+ import type { ts } from "../adapters/type-ast-bridge/typescript-types.js";
5
+ import type { FooterEntry } from "../api/footer-entry.js";
6
+ import type { Logger } from "../application/ports/logger.js";
7
+ import type { DocumentFooter } from "../application/transform/transform-context.js";
8
+ import type { IrPropertySignature, IrType } from "../domain/ir/nodes.js";
9
+ import type { OutputFix, OutputFixName } from "../domain/output-fixes.js";
10
+ import type { ReferenceObject } from "./openapi-common.js";
11
+ import type { OpenAPI3 } from "./openapi-document.js";
12
+ import type { DiscriminatorObject, SchemaObject } from "./openapi-schema.js";
13
+
14
+ export interface TransformObject {
15
+ /** The type: an IR type (from the helpers), or a TypeScript node (read by the bridge). */
16
+ schema: IrType | ts.TypeNode;
17
+ questionToken: boolean;
18
+ }
19
+
20
+ /**
21
+ * Every source type `openapiTS` accepts: YAML or JSON text, a URL, a parsed document, bytes or a
22
+ * stream.
23
+ */
24
+ export type SchemaSource = string | URL | OpenAPI3 | Buffer | Readable;
25
+
26
+ /** The generator options other than the schema callbacks. */
27
+ export interface OpenAPITSBaseOptions {
28
+ /** Treat all objects as if they have `additionalProperties: true` by default (default: false) */
29
+ additionalProperties?: boolean;
30
+ /** Alphabetize all keys? (default: false) */
31
+ alphabetize?: boolean;
32
+ /** (optional) Generate tuples using array minItems / maxItems */
33
+ arrayLength?: boolean;
34
+ /**
35
+ * Type raw binary strings as `Blob` instead of `string` (default: false): `format: binary`
36
+ * (OpenAPI 3.0), or a `contentMediaType` that is not text and has no `contentEncoding` (3.1).
37
+ * `Blob` is a global type of the DOM lib and `@types/node`.
38
+ */
39
+ binaryAsBlob?: boolean;
40
+ /**
41
+ * Allow schema objects with no specified properties to have additional properties if not
42
+ * expressly forbidden? (default: false)
43
+ */
44
+ emptyObjectsUnknown?: boolean;
45
+ /** Provide current working directory (cwd) which helps resolve relative remote schemas */
46
+ cwd?: PathLike;
47
+ /**
48
+ * Load local `$ref` files only from this directory and below it; a relative path resolves
49
+ * against `cwd`. Default: no limit. Threat model R1, ADR-017.
50
+ */
51
+ localRefRoot?: string | URL;
52
+ /**
53
+ * Load remote `$ref` documents only from these hosts (`name` or `name:port`); `[]` loads none.
54
+ * Redirects are checked too. Default: any host. Threat model R2, ADR-017.
55
+ */
56
+ remoteRefHosts?: readonly string[];
57
+ /** Should schema objects with a default value not be considered optional? */
58
+ defaultNonNullable?: boolean;
59
+ /** Exclude deprecated fields from types? (default: false) */
60
+ excludeDeprecated?: boolean;
61
+ /**
62
+ * Opt-in fixes of the output of valid schemas (default: none), ADR-021. `"all"` turns on every
63
+ * fix of the installed version, so a minor update can change the output; list the names to keep
64
+ * it stable. An unknown name fails with `OPTION_FIX_UNKNOWN`.
65
+ * @see https://github.com/openapi-typesafe/openapi-typesafe/blob/main/docs/cli.md#fix
66
+ */
67
+ fix?: readonly OutputFixName[];
68
+ /** Add readonly properties and readonly arrays? (default: false) */
69
+ immutable?: boolean;
70
+ /**
71
+ * Lint the document with the Redocly config before generating (default: true). Bundling errors
72
+ * still fail the run.
73
+ */
74
+ lint?: boolean;
75
+ /** (optional) Should logging be suppressed? (necessary for STDOUT) */
76
+ silent?: boolean;
77
+ /** (optional) OpenAPI version. Must be present if parsing raw schema */
78
+ version?: number;
79
+ /** (optional) Export type instead of interface */
80
+ exportType?: boolean;
81
+ /** Export true TypeScript enums instead of unions */
82
+ enum?: boolean;
83
+ /** Export union values as arrays */
84
+ enumValues?: boolean;
85
+ /** Only generate TS Enums when `x-enum-*` metadata is available */
86
+ conditionalEnums?: boolean;
87
+ /** Dedupe enum values */
88
+ dedupeEnums?: boolean;
89
+ /** (optional) Substitute path parameter names with their respective types */
90
+ pathParamsAsTypes?: boolean;
91
+ /**
92
+ * Treat all objects as if they have \`required\` set to all properties by default (default:
93
+ * false)
94
+ */
95
+ propertiesRequiredByDefault?: boolean;
96
+ /** (optional) Generate schema types at root level */
97
+ rootTypes?: boolean;
98
+ /** (optional) Do not add Schema prefix to types at root level */
99
+ rootTypesNoSchemaPrefix?: boolean;
100
+ /** (optional) Keep casing of root types */
101
+ rootTypesKeepCasing?: boolean;
102
+ /**
103
+ * Configure Redocly for validation, schema fetching, and bundling
104
+ * @see https://redocly.com/docs/cli/configuration/
105
+ */
106
+ redocly?: RedoclyConfig;
107
+ /** Inject arbitrary TypeScript types into the start of the file */
108
+ inject?: string;
109
+ /** Generate ApiPaths enum */
110
+ makePathsEnum?: boolean;
111
+ /** Generate path params based on path even if they are not defined in the open api schema */
112
+ generatePathParams?: boolean;
113
+ /** Generate $Read/$Write markers for readOnly/writeOnly properties (default: false) */
114
+ readWriteMarkers?: boolean;
115
+ }
116
+
117
+ /**
118
+ * The schema callbacks of the original API: they receive TypeScript nodes (ADR-004, decisions 5
119
+ * and 6). Results may be IR (from the helpers) or TypeScript nodes, read by the bridge.
120
+ */
121
+ export interface LegacyCallbackOptions {
122
+ /** Unset or false: the callbacks below receive TypeScript nodes. */
123
+ irCallbacks?: false;
124
+ /** Manually transform certain Schema Objects with a custom TypeScript type */
125
+ transform?: (
126
+ schemaObject: SchemaObject,
127
+ options: TransformNodeOptions,
128
+ ) => IrType | ts.TypeNode | TransformObject | undefined;
129
+ /**
130
+ * Modify TypeScript types built from Schema Objects (receives a TypeScript node)
131
+ * @deprecated Use `irCallbacks: true` (ADR-004, decision 6); the TypeScript form is removed in
132
+ * 2.0.
133
+ */
134
+ postTransform?: (
135
+ type: ts.TypeNode,
136
+ options: TransformNodeOptions,
137
+ ) => IrType | ts.TypeNode | undefined;
138
+ /**
139
+ * Modify property signatures for Schema Object properties (receives a TypeScript node)
140
+ * @deprecated Use `irCallbacks: true` (ADR-004, decision 6); the TypeScript form is removed in
141
+ * 2.0.
142
+ */
143
+ transformProperty?: (
144
+ property: ts.PropertySignature,
145
+ schemaObject: SchemaObject,
146
+ options: TransformNodeOptions,
147
+ ) => IrPropertySignature | ts.PropertySignature | undefined;
148
+ }
149
+
150
+ /**
151
+ * The schema callbacks that have a deprecated TypeScript-node form (ADR-004, decisions 5 and 6).
152
+ */
153
+ export type LegacyCallbackName = "transform" | "postTransform" | "transformProperty";
154
+
155
+ /** A type an IR callback returns: an IR type, or TypeScript type text printed as written. */
156
+ export type IrCallbackType = IrType | string;
157
+
158
+ /** What an IR `transform` callback returns to make the property optional. */
159
+ export interface IrTransformObject {
160
+ schema: IrCallbackType;
161
+ questionToken: boolean;
162
+ }
163
+
164
+ /** Replace the generated type of a Schema Object; `undefined` keeps the generated type. */
165
+ export type IrTransform = (
166
+ schemaObject: SchemaObject,
167
+ options: TransformNodeOptions,
168
+ ) => IrCallbackType | IrTransformObject | undefined;
169
+
170
+ /** Modify the generated type of a Schema Object; `undefined` keeps it. */
171
+ export type IrPostTransform = (
172
+ type: IrType,
173
+ options: TransformNodeOptions,
174
+ ) => IrCallbackType | undefined;
175
+
176
+ /** Modify the generated property of a Schema Object property; `undefined` keeps it. */
177
+ export type IrTransformProperty = (
178
+ property: IrPropertySignature,
179
+ schemaObject: SchemaObject,
180
+ options: TransformNodeOptions,
181
+ ) => IrPropertySignature | undefined;
182
+
183
+ /** The schema callbacks on IR (ENGINEERING_PLAN 6.3): they receive and return IR nodes. */
184
+ export interface IrCallbackOptions {
185
+ irCallbacks: true;
186
+ transform?: IrTransform;
187
+ postTransform?: IrPostTransform;
188
+ transformProperty?: IrTransformProperty;
189
+ }
190
+
191
+ /** The options of the original API: callbacks on TypeScript nodes. */
192
+ export interface OpenAPITSOptions extends OpenAPITSBaseOptions, LegacyCallbackOptions {}
193
+
194
+ /** The options with `irCallbacks: true`: callbacks on IR nodes. */
195
+ export interface OpenAPITSIrOptions extends OpenAPITSBaseOptions, IrCallbackOptions {}
196
+
197
+ /** Either form of the generator options. */
198
+ export type GeneratorOptions = OpenAPITSOptions | OpenAPITSIrOptions;
199
+
200
+ /** Context passed to all submodules */
201
+ export interface GlobalContext {
202
+ // user options
203
+ additionalProperties: boolean;
204
+ alphabetize: boolean;
205
+ arrayLength: boolean;
206
+ binaryAsBlob: boolean;
207
+ defaultNonNullable: boolean;
208
+ discriminators: {
209
+ objects: Record<string, DiscriminatorObject>;
210
+ refsHandled: string[];
211
+ };
212
+ emptyObjectsUnknown: boolean;
213
+ enum: boolean;
214
+ enumValues: boolean;
215
+ conditionalEnums: boolean;
216
+ dedupeEnums: boolean;
217
+ excludeDeprecated: boolean;
218
+ exportType: boolean;
219
+ /** The opt-in output fixes of this run, `all` expanded (ADR-021). Unset: none. */
220
+ fix?: readonly OutputFix[];
221
+ immutable: boolean;
222
+ /**
223
+ * Declarations written after the main types, in order. The generator adds IR declarations;
224
+ * callbacks may add IR declarations or TypeScript nodes.
225
+ */
226
+ injectFooter: FooterEntry[];
227
+ /**
228
+ * @internal Footer state of this run (enum registry and enum naming), created on first use by
229
+ * the transform context adapter. Not an option; do not set it.
230
+ */
231
+ runFooter?: DocumentFooter;
232
+ /**
233
+ * @internal The deprecated callback forms this run has warned about (once each). Not an
234
+ * option; do not set it.
235
+ */
236
+ legacyCallbackWarnings?: Set<LegacyCallbackName>;
237
+ /**
238
+ * @internal Where this run reports warnings and debug output. Not an option; a context without
239
+ * it logs to the terminal.
240
+ */
241
+ logger?: Logger;
242
+ pathParamsAsTypes: boolean;
243
+ /** Whether the callbacks below take IR (`OpenAPITSIrOptions`) or TypeScript nodes. */
244
+ irCallbacks: boolean;
245
+ postTransform: GeneratorOptions["postTransform"];
246
+ propertiesRequiredByDefault: boolean;
247
+ rootTypes: boolean;
248
+ rootTypesNoSchemaPrefix: boolean;
249
+ rootTypesKeepCasing: boolean;
250
+ redoc: RedoclyConfig;
251
+ silent: boolean;
252
+ transform: GeneratorOptions["transform"];
253
+ transformProperty: GeneratorOptions["transformProperty"];
254
+ /** retrieve a node by $ref */
255
+ resolve<T>($ref: string): T | undefined;
256
+ inject?: string;
257
+ makePathsEnum: boolean;
258
+ generatePathParams: boolean;
259
+ readWriteMarkers: boolean;
260
+ }
261
+
262
+ /** generic options for most internal transform* functions */
263
+ export interface TransformNodeOptions {
264
+ path?: string;
265
+ schema?: SchemaObject | ReferenceObject;
266
+ ctx: GlobalContext;
267
+ }
@@ -0,0 +1,100 @@
1
+ // Many types allow for true “any” for inheritance to work
2
+
3
+ // Note: these OpenAPI types are meant only for internal use, not external
4
+ // consumption. Some formatting may be better in other libraries meant for
5
+ // consumption. Some typing may be “loose” or “incorrect” in order to guarantee
6
+ // that all logical paths are handled. In other words, these are built more
7
+ // for ways schemas _can_ be written, not necessarily how they _should_ be.
8
+
9
+ export interface Extensable {
10
+ [key: `x-${string}`]: any;
11
+ }
12
+
13
+ // Note: these OpenAPI types are meant only for internal use, not external
14
+ // consumption. Some formatting may be better in other libraries meant for
15
+ // consumption. Some typing may be “loose” or “incorrect” in order to guarantee
16
+ // that all logical paths are handled. In other words, these are built more
17
+ // for ways schemas _can_ be written, not necessarily how they _should_ be.
18
+
19
+ /**
20
+ * [4.8.5] Server Object
21
+ * An object representing a Server.
22
+ */
23
+ export interface ServerObject extends Extensable {
24
+ /**
25
+ * REQUIRED. A URL to the target host. This URL supports Server Variables and MAY be relative, to
26
+ * indicate that the host location is relative to the location where the OpenAPI document is being
27
+ * served. Variable substitutions will be made when a variable is named in {brackets}.
28
+ */
29
+ url: string;
30
+ /**
31
+ * An optional string describing the host designated by the URL. CommonMark syntax MAY be used for
32
+ * rich text representation.
33
+ */
34
+ description: string;
35
+ /**
36
+ * A map between a variable name and its value. The value is used for substitution in the server’s
37
+ * URL template.
38
+ */
39
+ variables: { [name: string]: ServerVariableObject };
40
+ }
41
+
42
+ /**
43
+ * [4.8.6] Server Variable Object
44
+ * An object representing a Server Variable for server URL template substitution.
45
+ */
46
+ export interface ServerVariableObject extends Extensable {
47
+ /**
48
+ * An enumeration of string values to be used if the substitution options are from a limited set.
49
+ * The array MUST NOT be empty.
50
+ */
51
+ enum?: string[];
52
+ /**
53
+ * REQUIRED. The default value to use for substitution, which SHALL be sent if an alternate value
54
+ * is not supplied. Note this behavior is different than the Schema Object’s treatment of default
55
+ * values, because in those cases parameter values are optional. If the enum is defined, the value
56
+ * MUST exist in the enum’s values.
57
+ */
58
+ default: string;
59
+ /**
60
+ * An optional description for the server variable. CommonMark syntax MAY be used for rich text
61
+ * representation.
62
+ */
63
+ description?: string;
64
+ }
65
+
66
+ /**
67
+ * [4.8.11] External Documentation Object
68
+ * Allows referencing an external resource for extended documentation.
69
+ */
70
+ export interface ExternalDocumentationObject extends Extensable {
71
+ /**
72
+ * A description of the target documentation. CommonMark syntax MAY be used for rich text
73
+ * representation.
74
+ */
75
+ description?: string;
76
+ /** REQUIRED. The URL for the target documentation. This MUST be in the form of a URL. */
77
+ url: string;
78
+ }
79
+
80
+ /**
81
+ * [4.8.23] Reference Object
82
+ * A simple object to allow referencing other components in the OpenAPI document, internally and
83
+ * externally. The $ref string value contains a URI [RFC3986], which identifies the location of the
84
+ * value being referenced. See the rules for resolving Relative References.
85
+ */
86
+ export interface ReferenceObject extends Extensable {
87
+ /** REQUIRED. The reference identifier. This MUST be in the form of a URI. */
88
+ $ref: string;
89
+ /**
90
+ * A short summary which by default SHOULD override that of the referenced component. If the
91
+ * referenced object-type does not allow a summary field, then this field has no effect.
92
+ */
93
+ summary?: string;
94
+ /**
95
+ * A description which by default SHOULD override that of the referenced component. CommonMark
96
+ * syntax MAY be used for rich text representation. If the referenced object-type does not allow a
97
+ * description field, then this field has no effect.
98
+ */
99
+ description?: string;
100
+ }
@@ -0,0 +1,196 @@
1
+ import type {
2
+ Extensable,
3
+ ExternalDocumentationObject,
4
+ ReferenceObject,
5
+ ServerObject,
6
+ } from "./openapi-common.js";
7
+ import type { CallbackObject, PathItemObject } from "./openapi-path-item.js";
8
+ import type {
9
+ ExampleObject,
10
+ HeaderObject,
11
+ MediaTypeObject,
12
+ ParameterObject,
13
+ RequestBodyObject,
14
+ } from "./openapi-request.js";
15
+ import type { LinkObject, ResponseObject } from "./openapi-response.js";
16
+ import type { $defs, SchemaObject } from "./openapi-schema.js";
17
+ import type { SecurityRequirementObject, SecuritySchemeObject } from "./openapi-security.js";
18
+
19
+ /**
20
+ * [4.8] Schema
21
+ * @see https://spec.openapis.org/oas/v3.1.0#schema
22
+ */
23
+ export interface OpenAPI3 extends Extensable {
24
+ /**
25
+ * REQUIRED. This string MUST be the version number of the OpenAPI Specification that the OpenAPI
26
+ * document uses. The openapi field SHOULD be used by tooling to interpret the OpenAPI document.
27
+ * This is not related to the API info.version string.
28
+ */
29
+ openapi: string;
30
+ /** REQUIRED. Provides metadata about the API. The metadata MAY be used by tooling as required. */
31
+ info: InfoObject; // required
32
+ /**
33
+ * The default value for the $schema keyword within Schema Objects contained within this OAS
34
+ * document. This MUST be in the form of a URI.
35
+ */
36
+ jsonSchemaDialect?: string;
37
+ /**
38
+ * An array of Server Objects, which provide connectivity information to a target server. If the
39
+ * servers property is not provided, or is an empty array, the default value would be a Server
40
+ * Object with a url value of /.
41
+ */
42
+ servers?: ServerObject[];
43
+ /** The available paths and operations for the API. */
44
+ paths?: PathsObject;
45
+ /**
46
+ * The incoming webhooks that MAY be received as part of this API and that the API consumer MAY
47
+ * choose to implement. Closely related to the callbacks feature, this section describes requests
48
+ * initiated other than by an API call, for example by an out of band registration. The key name
49
+ * is a unique string to refer to each webhook, while the (optionally referenced) Path Item Object
50
+ * describes a request that may be initiated by the API provider and the expected responses. An
51
+ * example is available.
52
+ */
53
+ webhooks?: { [id: string]: PathItemObject | ReferenceObject };
54
+ /** An element to hold various schemas for the document. */
55
+ components?: ComponentsObject;
56
+ /**
57
+ * A declaration of which security mechanisms can be used across the API. The list of values
58
+ * includes alternative security requirement objects that can be used. Only one of the security
59
+ * requirement objects need to be satisfied to authorize a request. Individual operations can
60
+ * override this definition. To make security optional, an empty security requirement ({}) can be
61
+ * included in the array.
62
+ */
63
+ security?: SecurityRequirementObject[];
64
+ /**
65
+ * A list of tags used by the document with additional metadata. The order of the tags can be used
66
+ * to reflect on their order by the parsing tools. Not all tags that are used by the Operation
67
+ * Object must be declared. The tags that are not declared MAY be organized randomly or based on
68
+ * the tools’ logic. Each tag name in the list MUST be unique.
69
+ */
70
+ tags?: TagObject[];
71
+ /** Additional external documentation. */
72
+ externalDocs?: ExternalDocumentationObject;
73
+ $defs?: $defs;
74
+ }
75
+
76
+ /**
77
+ * [4.8.2] Info Object
78
+ * The object provides metadata about the API.
79
+ */
80
+ export interface InfoObject extends Extensable {
81
+ /** REQUIRED. The title of the API. */
82
+ title: string;
83
+ /** A short summary of the API. */
84
+ summary?: string;
85
+ /** A description of the API. CommonMark syntax MAY be used for rich text representation. */
86
+ description?: string;
87
+ /** A URL to the Terms of Service for the API. This MUST be in the form of a URL. */
88
+ termsOfService?: string;
89
+ /** The contact information for the exposed API. */
90
+ contact?: ContactObject;
91
+ /** The license information for the exposed API. */
92
+ license?: LicenseObject;
93
+ /**
94
+ * REQUIRED. The version of the OpenAPI document (which is distinct from the OpenAPI Specification
95
+ * version or the API implementation version).
96
+ */
97
+ version: string;
98
+ }
99
+
100
+ /**
101
+ * [4.8.3] Contact Object
102
+ * Contact information for the exposed API.
103
+ */
104
+ export interface ContactObject extends Extensable {
105
+ /** The identifying name of the contact person/organization. */
106
+ name?: string;
107
+ /** The URL pointing to the contact information. This MUST be in the form of a URL. */
108
+ url?: string;
109
+ /**
110
+ * The email address of the contact person/organization. This MUST be in the form of an email
111
+ * address.
112
+ */
113
+ email?: string;
114
+ }
115
+
116
+ /**
117
+ * [4.8.4] License object
118
+ * License information for the exposed API.
119
+ */
120
+ export interface LicenseObject extends Extensable {
121
+ /** REQUIRED. The license name used for the API. */
122
+ name: string;
123
+ /**
124
+ * An SPDX license expression for the API. The identifier field is mutually exclusive of the url
125
+ * field.
126
+ */
127
+ identifier: string;
128
+ /**
129
+ * A URL to the license used for the API. This MUST be in the form of a URL. The url field is
130
+ * mutually exclusive of the identifier field.
131
+ */
132
+ url: string;
133
+ }
134
+
135
+ /**
136
+ * [4.8.7] Components Object
137
+ * Holds a set of reusable objects for different aspects of the OAS.
138
+ */
139
+ export interface ComponentsObject extends Extensable {
140
+ /** An object to hold reusable Schema Objects.*/
141
+ schemas?: Record<string, SchemaObject>;
142
+ /** An object to hold reusable Response Objects. */
143
+ responses?: Record<string, ResponseObject | ReferenceObject>;
144
+ /** An object to hold reusable Parameter Objects. */
145
+ parameters?: Record<string, ParameterObject | ReferenceObject>;
146
+ /** An object to hold reusable Example Objects. */
147
+ examples?: Record<string, ExampleObject | ReferenceObject>;
148
+ /** An object to hold reusable Request Body Objects. */
149
+ requestBodies?: Record<string, RequestBodyObject | ReferenceObject>;
150
+ /** An object to hold reusable Header Objects. */
151
+ headers?: Record<string, HeaderObject | ReferenceObject>;
152
+ /** An object to hold reusable Security Scheme Objects. */
153
+ securitySchemes?: Record<string, SecuritySchemeObject | ReferenceObject>;
154
+ /** An object to hold reusable Link Objects. */
155
+ links?: Record<string, LinkObject | ReferenceObject>;
156
+ /** An object to hold reusable Callback Objects. */
157
+ callbacks?: Record<string, CallbackObject | ReferenceObject>;
158
+ /** An object to hold reusable Path Item Objects. */
159
+ pathItems?: Record<string, PathItemObject | ReferenceObject>;
160
+ /** An object to hold reusable Media Type Objects (OpenAPI 3.2). */
161
+ mediaTypes?: Record<string, MediaTypeObject | ReferenceObject>;
162
+ }
163
+
164
+ /**
165
+ * [4.8.8] Paths Object
166
+ * Holds the relative paths to the individual endpoints and their operations. The path is appended
167
+ * to the URL from the Server Object in order to construct the full URL. The Paths MAY be empty, due
168
+ * to Access Control List (ACL) constraints.
169
+ */
170
+ export interface PathsObject {
171
+ // note: paths object does support $refs; the schema just defines it in a weird way
172
+ [pathname: string]: PathItemObject | ReferenceObject;
173
+ }
174
+
175
+ /**
176
+ * [x.x.x] Webhooks Object
177
+ * Holds the webhooks definitions, indexed by their names. A webhook is defined by a Path Item
178
+ * Object; the only difference is that the request is initiated by the API provider.
179
+ */
180
+ export interface WebhooksObject {
181
+ [name: string]: PathItemObject;
182
+ }
183
+
184
+ /**
185
+ * [4.8.22] Tag Object
186
+ * Adds metadata to a single tag that is used by the Operation Object. It is not mandatory to have a
187
+ * Tag Object per tag defined in the Operation Object instances.
188
+ */
189
+ export interface TagObject extends Extensable {
190
+ /** REQUIRED. The name of the tag. */
191
+ name: string;
192
+ /** A description for the tag. CommonMark syntax MAY be used for rich text representation. */
193
+ description?: string;
194
+ /** Additional external documentation for this tag. */
195
+ externalDocs?: ExternalDocumentationObject;
196
+ }
@@ -0,0 +1,130 @@
1
+ import type {
2
+ Extensable,
3
+ ExternalDocumentationObject,
4
+ ReferenceObject,
5
+ ServerObject,
6
+ } from "./openapi-common.js";
7
+ import type { ParameterObject, RequestBodyObject } from "./openapi-request.js";
8
+ import type { ResponsesObject } from "./openapi-response.js";
9
+ import type { SecurityRequirementObject } from "./openapi-security.js";
10
+
11
+ /**
12
+ * [4.8.9] Path Item Object
13
+ * Describes the operations available on a single path. A Path Item MAY be empty, due to ACL
14
+ * constraints. The path itself is still exposed to the documentation viewer but they will not know
15
+ * which operations and parameters are available.
16
+ */
17
+ export interface PathItemObject extends Extensable {
18
+ /** A definition of a GET operation on this path. */
19
+ get?: OperationObject | ReferenceObject;
20
+ /** A definition of a PUT operation on this path. */
21
+ put?: OperationObject | ReferenceObject;
22
+ /** A definition of a POST operation on this path. */
23
+ post?: OperationObject | ReferenceObject;
24
+ /** A definition of a DELETE operation on this path. */
25
+ delete?: OperationObject | ReferenceObject;
26
+ /** A definition of a OPTIONS operation on this path. */
27
+ options?: OperationObject | ReferenceObject;
28
+ /** A definition of a HEAD operation on this path. */
29
+ head?: OperationObject | ReferenceObject;
30
+ /** A definition of a PATCH operation on this path. */
31
+ patch?: OperationObject | ReferenceObject;
32
+ /** A definition of a TRACE operation on this path. */
33
+ trace?: OperationObject | ReferenceObject;
34
+ /** A definition of a QUERY operation on this path (OpenAPI 3.2). */
35
+ query?: OperationObject | ReferenceObject;
36
+ /**
37
+ * Operations for other HTTP methods, keyed by the method name exactly as it is sent
38
+ * (OpenAPI 3.2). The fixed methods above must not appear here.
39
+ */
40
+ additionalOperations?: Record<string, OperationObject | ReferenceObject>;
41
+ /** An alternative server array to service all operations in this path. */
42
+ servers?: ServerObject[];
43
+ /**
44
+ * A list of parameters that are applicable for all the operations described under this path.
45
+ * These parameters can be overridden at the operation level, but cannot be removed there. The
46
+ * list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of
47
+ * a name and location. The list can use the Reference Object to link to parameters that are
48
+ * defined at the OpenAPI Object’s components/parameters.
49
+ */
50
+ parameters?: (ParameterObject | ReferenceObject)[];
51
+ }
52
+
53
+ /**
54
+ * [4.8.10] Operation Object
55
+ * Describes a single API operation on a path.
56
+ */
57
+ export interface OperationObject extends Extensable {
58
+ /**
59
+ * A list of tags for API documentation control. Tags can be used for logical grouping of
60
+ * operations by resources or any other qualifier.
61
+ */
62
+ tags?: string[];
63
+ /** A short summary of what the operation does. */
64
+ summary?: string;
65
+ /**
66
+ * A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text
67
+ * representation.
68
+ */
69
+ description?: string;
70
+ /** Additional external documentation for this operation. */
71
+ externalDocs?: ExternalDocumentationObject;
72
+ /**
73
+ * Unique string used to identify the operation. The id MUST be unique among all operations
74
+ * described in the API. The operationId value is case-sensitive. Tools and libraries MAY use the
75
+ * operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common
76
+ * programming naming conventions.
77
+ */
78
+ operationId?: string;
79
+ /**
80
+ * A list of parameters that are applicable for this operation. If a parameter is already defined
81
+ * at the Path Item, the new definition will override it but can never remove it. The list MUST
82
+ * NOT include duplicated parameters. A unique parameter is defined by a combination of a name and
83
+ * location. The list can use the Reference Object to link to parameters that are defined at the
84
+ * OpenAPI Object’s components/parameters.
85
+ */
86
+ parameters?: (ParameterObject | ReferenceObject)[];
87
+ /**
88
+ * The request body applicable for this operation. The requestBody is fully supported in HTTP
89
+ * methods where the HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request
90
+ * bodies. In other cases where the HTTP spec is vague (such as GET, HEAD and DELETE), requestBody
91
+ * is permitted but does not have well-defined semantics and SHOULD be avoided if possible.
92
+ */
93
+ requestBody?: RequestBodyObject | ReferenceObject;
94
+ /** The list of possible responses as they are returned from executing this operation. */
95
+ responses?: ResponsesObject;
96
+ /**
97
+ * A map of possible out-of band callbacks related to the parent operation. The key is a unique
98
+ * identifier for the Callback Object. Each value in the map is a Callback Object that describes a
99
+ * request that may be initiated by the API provider and the expected responses.
100
+ */
101
+ callbacks?: Record<string, CallbackObject | ReferenceObject>;
102
+ /**
103
+ * Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared
104
+ * operation. Default value is false.
105
+ */
106
+ deprecated?: boolean;
107
+ /**
108
+ * A declaration of which security mechanisms can be used for this operation. The list of values
109
+ * includes alternative security requirement objects that can be used. Only one of the security
110
+ * requirement objects need to be satisfied to authorize a request. To make security optional, an
111
+ * empty security requirement ({}) can be included in the array. This definition overrides any
112
+ * declared top-level security. To remove a top-level security declaration, an empty array can be
113
+ * used.
114
+ */
115
+ security?: SecurityRequirementObject[];
116
+ /**
117
+ * An alternative server array to service this operation. If an alternative server object is
118
+ * specified at the Path Item Object or Root level, it will be overridden by this value.
119
+ */
120
+ servers?: ServerObject[];
121
+ }
122
+
123
+ /**
124
+ * [4.8.18] Callback Object
125
+ * A map of possible out-of band callbacks related to the parent operation. Each value in the map is
126
+ * a Path Item Object that describes a set of requests that may be initiated by the API provider and
127
+ * the expected responses. The key value used to identify the path item object is an expression,
128
+ * evaluated at runtime, that identifies a URL to use for the callback operation.
129
+ */
130
+ export type CallbackObject = Record<string, PathItemObject>;