@goast/core 0.3.7 → 0.4.0-beta1

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 (300) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -4
  3. package/esm/_dnt.shims.d.ts +11 -0
  4. package/esm/_dnt.shims.d.ts.map +1 -0
  5. package/esm/_dnt.shims.js +66 -0
  6. package/esm/index.d.ts +6 -0
  7. package/esm/index.d.ts.map +1 -0
  8. package/esm/lib/ast/index.d.ts +2 -0
  9. package/esm/lib/ast/index.d.ts.map +1 -0
  10. package/{types → esm}/lib/ast/node.d.ts +2 -1
  11. package/esm/lib/ast/node.d.ts.map +1 -0
  12. package/esm/lib/ast/node.js +6 -0
  13. package/{types → esm}/lib/codegen/config.d.ts +3 -2
  14. package/esm/lib/codegen/config.d.ts.map +1 -0
  15. package/{types → esm}/lib/codegen/endpoints-generator.d.ts +4 -3
  16. package/esm/lib/codegen/endpoints-generator.d.ts.map +1 -0
  17. package/{types → esm}/lib/codegen/generator.d.ts +8 -8
  18. package/esm/lib/codegen/generator.d.ts.map +1 -0
  19. package/esm/lib/codegen/generator.js +23 -9
  20. package/esm/lib/codegen/index.d.ts +7 -0
  21. package/esm/lib/codegen/index.d.ts.map +1 -0
  22. package/{types → esm}/lib/codegen/internal-utils.d.ts +1 -0
  23. package/esm/lib/codegen/internal-utils.d.ts.map +1 -0
  24. package/{types → esm}/lib/codegen/schemas-generator.d.ts +4 -3
  25. package/esm/lib/codegen/schemas-generator.d.ts.map +1 -0
  26. package/{types → esm}/lib/codegen/services-generator.d.ts +4 -3
  27. package/esm/lib/codegen/services-generator.d.ts.map +1 -0
  28. package/{types → esm}/lib/codegen/types.d.ts +3 -2
  29. package/esm/lib/codegen/types.d.ts.map +1 -0
  30. package/esm/lib/collect/collector.d.ts +4 -0
  31. package/esm/lib/collect/collector.d.ts.map +1 -0
  32. package/{types → esm}/lib/collect/helpers.d.ts +3 -2
  33. package/esm/lib/collect/helpers.d.ts.map +1 -0
  34. package/esm/lib/collect/index.d.ts +4 -0
  35. package/esm/lib/collect/index.d.ts.map +1 -0
  36. package/{types → esm}/lib/collect/types.d.ts +2 -1
  37. package/esm/lib/collect/types.d.ts.map +1 -0
  38. package/{types → esm}/lib/internal-utils.d.ts +1 -0
  39. package/esm/lib/internal-utils.d.ts.map +1 -0
  40. package/esm/lib/parse/deref-proxy.d.ts +4 -0
  41. package/esm/lib/parse/deref-proxy.d.ts.map +1 -0
  42. package/esm/lib/parse/deref-proxy.js +18 -3
  43. package/esm/lib/parse/index.d.ts +4 -0
  44. package/esm/lib/parse/index.d.ts.map +1 -0
  45. package/{types → esm}/lib/parse/openapi-types.d.ts +1 -0
  46. package/esm/lib/parse/openapi-types.d.ts.map +1 -0
  47. package/{types → esm}/lib/parse/parser.d.ts +4 -3
  48. package/esm/lib/parse/parser.d.ts.map +1 -0
  49. package/esm/lib/parse/parser.js +17 -6
  50. package/{types → esm}/lib/parse/types.d.ts +3 -2
  51. package/esm/lib/parse/types.d.ts.map +1 -0
  52. package/{types → esm}/lib/transform/api-types.d.ts +3 -2
  53. package/esm/lib/transform/api-types.d.ts.map +1 -0
  54. package/{types → esm}/lib/transform/helpers.d.ts +4 -3
  55. package/esm/lib/transform/helpers.d.ts.map +1 -0
  56. package/esm/lib/transform/helpers.js +9 -3
  57. package/esm/lib/transform/index.d.ts +3 -0
  58. package/esm/lib/transform/index.d.ts.map +1 -0
  59. package/esm/lib/transform/transform-document.d.ts +4 -0
  60. package/esm/lib/transform/transform-document.d.ts.map +1 -0
  61. package/esm/lib/transform/transform-endpoint.d.ts +5 -0
  62. package/esm/lib/transform/transform-endpoint.d.ts.map +1 -0
  63. package/esm/lib/transform/transform-schema.d.ts +5 -0
  64. package/esm/lib/transform/transform-schema.d.ts.map +1 -0
  65. package/esm/lib/transform/transform-schema.js +3 -1
  66. package/esm/lib/transform/transformer.d.ts +5 -0
  67. package/esm/lib/transform/transformer.d.ts.map +1 -0
  68. package/esm/lib/transform/transformer.js +1 -1
  69. package/{types → esm}/lib/transform/types.d.ts +5 -4
  70. package/esm/lib/transform/types.d.ts.map +1 -0
  71. package/{types → esm}/lib/utils/action-provider.d.ts +2 -1
  72. package/esm/lib/utils/action-provider.d.ts.map +1 -0
  73. package/esm/lib/utils/action-provider.js +6 -1
  74. package/{types → esm}/lib/utils/array.utils.d.ts +1 -0
  75. package/esm/lib/utils/array.utils.d.ts.map +1 -0
  76. package/{types → esm}/lib/utils/class.utils.d.ts +1 -0
  77. package/esm/lib/utils/class.utils.d.ts.map +1 -0
  78. package/{types → esm}/lib/utils/common.utils.d.ts +2 -1
  79. package/esm/lib/utils/common.utils.d.ts.map +1 -0
  80. package/{types → esm}/lib/utils/condition.d.ts +1 -0
  81. package/esm/lib/utils/condition.d.ts.map +1 -0
  82. package/esm/lib/utils/endpoint.utils.d.ts +3 -0
  83. package/esm/lib/utils/endpoint.utils.d.ts.map +1 -0
  84. package/{types → esm}/lib/utils/error.utils.d.ts +1 -0
  85. package/esm/lib/utils/error.utils.d.ts.map +1 -0
  86. package/{types → esm}/lib/utils/factory.d.ts +2 -1
  87. package/esm/lib/utils/factory.d.ts.map +1 -0
  88. package/esm/lib/utils/factory.js +6 -1
  89. package/{types → esm}/lib/utils/file-system.utils.d.ts +2 -1
  90. package/esm/lib/utils/file-system.utils.d.ts.map +1 -0
  91. package/esm/lib/utils/file-system.utils.js +4 -4
  92. package/{types → esm}/lib/utils/generator.utils.d.ts +1 -0
  93. package/esm/lib/utils/generator.utils.d.ts.map +1 -0
  94. package/esm/lib/utils/index.d.ts +15 -0
  95. package/esm/lib/utils/index.d.ts.map +1 -0
  96. package/{types → esm}/lib/utils/object.utils.d.ts +1 -0
  97. package/esm/lib/utils/object.utils.d.ts.map +1 -0
  98. package/esm/lib/utils/object.utils.js +6 -1
  99. package/{types → esm}/lib/utils/schema.utils.d.ts +3 -2
  100. package/esm/lib/utils/schema.utils.d.ts.map +1 -0
  101. package/{types → esm}/lib/utils/source-builder.d.ts +8 -6
  102. package/esm/lib/utils/source-builder.d.ts.map +1 -0
  103. package/esm/lib/utils/source-builder.js +39 -6
  104. package/esm/lib/utils/string-builder/index.d.ts +4 -0
  105. package/esm/lib/utils/string-builder/index.d.ts.map +1 -0
  106. package/{types → esm}/lib/utils/string-builder/options.d.ts +1 -0
  107. package/esm/lib/utils/string-builder/options.d.ts.map +1 -0
  108. package/esm/lib/utils/string-builder/options.js +1 -1
  109. package/{types → esm}/lib/utils/string-builder/string-builder.d.ts +3 -2
  110. package/esm/lib/utils/string-builder/string-builder.d.ts.map +1 -0
  111. package/esm/lib/utils/string-builder/string-builder.js +12 -1
  112. package/{types → esm}/lib/utils/string-builder/utils.d.ts +3 -2
  113. package/esm/lib/utils/string-builder/utils.d.ts.map +1 -0
  114. package/{types → esm}/lib/utils/string.utils.d.ts +3 -2
  115. package/esm/lib/utils/string.utils.d.ts.map +1 -0
  116. package/{types → esm}/lib/utils/string.utils.types.d.ts +1 -0
  117. package/esm/lib/utils/string.utils.types.d.ts.map +1 -0
  118. package/{types → esm}/lib/utils/type.utils.d.ts +1 -0
  119. package/esm/lib/utils/type.utils.d.ts.map +1 -0
  120. package/esm/package.json +3 -0
  121. package/package.json +24 -32
  122. package/script/_dnt.shims.d.ts +11 -0
  123. package/script/_dnt.shims.d.ts.map +1 -0
  124. package/script/_dnt.shims.js +75 -0
  125. package/script/index.d.ts +6 -0
  126. package/script/index.d.ts.map +1 -0
  127. package/script/index.js +8 -0
  128. package/script/lib/ast/index.d.ts +2 -0
  129. package/script/lib/ast/index.d.ts.map +1 -0
  130. package/{cjs → script}/lib/ast/index.js +1 -1
  131. package/script/lib/ast/node.d.ts +15 -0
  132. package/script/lib/ast/node.d.ts.map +1 -0
  133. package/{cjs → script}/lib/ast/node.js +6 -0
  134. package/script/lib/codegen/config.d.ts +16 -0
  135. package/script/lib/codegen/config.d.ts.map +1 -0
  136. package/script/lib/codegen/config.js +11 -0
  137. package/script/lib/codegen/endpoints-generator.d.ts +16 -0
  138. package/script/lib/codegen/endpoints-generator.d.ts.map +1 -0
  139. package/{cjs → script}/lib/codegen/endpoints-generator.js +4 -4
  140. package/script/lib/codegen/generator.d.ts +39 -0
  141. package/script/lib/codegen/generator.d.ts.map +1 -0
  142. package/{cjs → script}/lib/codegen/generator.js +33 -18
  143. package/script/lib/codegen/index.d.ts +7 -0
  144. package/script/lib/codegen/index.d.ts.map +1 -0
  145. package/script/lib/codegen/index.js +9 -0
  146. package/script/lib/codegen/internal-utils.d.ts +2 -0
  147. package/script/lib/codegen/internal-utils.d.ts.map +1 -0
  148. package/script/lib/codegen/schemas-generator.d.ts +17 -0
  149. package/script/lib/codegen/schemas-generator.d.ts.map +1 -0
  150. package/{cjs → script}/lib/codegen/schemas-generator.js +6 -6
  151. package/script/lib/codegen/services-generator.d.ts +16 -0
  152. package/script/lib/codegen/services-generator.d.ts.map +1 -0
  153. package/{cjs → script}/lib/codegen/services-generator.js +4 -4
  154. package/script/lib/codegen/types.d.ts +18 -0
  155. package/script/lib/codegen/types.d.ts.map +1 -0
  156. package/script/lib/collect/collector.d.ts +4 -0
  157. package/script/lib/collect/collector.d.ts.map +1 -0
  158. package/{cjs → script}/lib/collect/collector.js +28 -28
  159. package/script/lib/collect/helpers.d.ts +5 -0
  160. package/script/lib/collect/helpers.d.ts.map +1 -0
  161. package/{cjs → script}/lib/collect/helpers.js +2 -2
  162. package/script/lib/collect/index.d.ts +4 -0
  163. package/script/lib/collect/index.d.ts.map +1 -0
  164. package/script/lib/collect/index.js +6 -0
  165. package/script/lib/collect/types.d.ts +13 -0
  166. package/script/lib/collect/types.d.ts.map +1 -0
  167. package/script/lib/internal-utils.d.ts +2 -0
  168. package/script/lib/internal-utils.d.ts.map +1 -0
  169. package/script/lib/parse/deref-proxy.d.ts +4 -0
  170. package/script/lib/parse/deref-proxy.d.ts.map +1 -0
  171. package/{cjs → script}/lib/parse/deref-proxy.js +21 -6
  172. package/script/lib/parse/index.d.ts +4 -0
  173. package/script/lib/parse/index.d.ts.map +1 -0
  174. package/script/lib/parse/index.js +6 -0
  175. package/script/lib/parse/openapi-types.d.ts +898 -0
  176. package/script/lib/parse/openapi-types.d.ts.map +1 -0
  177. package/script/lib/parse/parser.d.ts +19 -0
  178. package/script/lib/parse/parser.d.ts.map +1 -0
  179. package/{cjs → script}/lib/parse/parser.js +32 -21
  180. package/script/lib/parse/types.d.ts +24 -0
  181. package/script/lib/parse/types.d.ts.map +1 -0
  182. package/script/lib/parse/types.js +5 -0
  183. package/script/lib/transform/api-types.d.ts +195 -0
  184. package/script/lib/transform/api-types.d.ts.map +1 -0
  185. package/script/lib/transform/helpers.d.ts +51 -0
  186. package/script/lib/transform/helpers.d.ts.map +1 -0
  187. package/{cjs → script}/lib/transform/helpers.js +16 -10
  188. package/script/lib/transform/index.d.ts +3 -0
  189. package/script/lib/transform/index.d.ts.map +1 -0
  190. package/script/lib/transform/index.js +5 -0
  191. package/script/lib/transform/transform-document.d.ts +4 -0
  192. package/script/lib/transform/transform-document.d.ts.map +1 -0
  193. package/{cjs → script}/lib/transform/transform-document.js +2 -2
  194. package/script/lib/transform/transform-endpoint.d.ts +5 -0
  195. package/script/lib/transform/transform-endpoint.d.ts.map +1 -0
  196. package/{cjs → script}/lib/transform/transform-endpoint.js +18 -18
  197. package/script/lib/transform/transform-schema.d.ts +5 -0
  198. package/script/lib/transform/transform-schema.d.ts.map +1 -0
  199. package/{cjs → script}/lib/transform/transform-schema.js +14 -12
  200. package/script/lib/transform/transformer.d.ts +5 -0
  201. package/script/lib/transform/transformer.d.ts.map +1 -0
  202. package/{cjs → script}/lib/transform/transformer.js +10 -10
  203. package/script/lib/transform/types.d.ts +36 -0
  204. package/script/lib/transform/types.d.ts.map +1 -0
  205. package/script/lib/utils/action-provider.d.ts +29 -0
  206. package/script/lib/utils/action-provider.d.ts.map +1 -0
  207. package/{cjs → script}/lib/utils/action-provider.js +6 -1
  208. package/script/lib/utils/array.utils.d.ts +2 -0
  209. package/script/lib/utils/array.utils.d.ts.map +1 -0
  210. package/script/lib/utils/class.utils.d.ts +8 -0
  211. package/script/lib/utils/class.utils.d.ts.map +1 -0
  212. package/script/lib/utils/common.utils.d.ts +16 -0
  213. package/script/lib/utils/common.utils.d.ts.map +1 -0
  214. package/script/lib/utils/condition.d.ts +4 -0
  215. package/script/lib/utils/condition.d.ts.map +1 -0
  216. package/script/lib/utils/endpoint.utils.d.ts +3 -0
  217. package/script/lib/utils/endpoint.utils.d.ts.map +1 -0
  218. package/script/lib/utils/error.utils.d.ts +2 -0
  219. package/script/lib/utils/error.utils.d.ts.map +1 -0
  220. package/script/lib/utils/factory.d.ts +21 -0
  221. package/script/lib/utils/factory.d.ts.map +1 -0
  222. package/{cjs → script}/lib/utils/factory.js +6 -1
  223. package/script/lib/utils/file-system.utils.d.ts +9 -0
  224. package/script/lib/utils/file-system.utils.d.ts.map +1 -0
  225. package/{cjs → script}/lib/utils/file-system.utils.js +6 -5
  226. package/script/lib/utils/generator.utils.d.ts +2 -0
  227. package/script/lib/utils/generator.utils.d.ts.map +1 -0
  228. package/script/lib/utils/index.d.ts +15 -0
  229. package/script/lib/utils/index.d.ts.map +1 -0
  230. package/script/lib/utils/index.js +17 -0
  231. package/script/lib/utils/object.utils.d.ts +3 -0
  232. package/script/lib/utils/object.utils.d.ts.map +1 -0
  233. package/{cjs → script}/lib/utils/object.utils.js +6 -1
  234. package/script/lib/utils/schema.utils.d.ts +11 -0
  235. package/script/lib/utils/schema.utils.d.ts.map +1 -0
  236. package/{cjs → script}/lib/utils/schema.utils.js +2 -2
  237. package/script/lib/utils/source-builder.d.ts +233 -0
  238. package/script/lib/utils/source-builder.d.ts.map +1 -0
  239. package/{cjs → script}/lib/utils/source-builder.js +59 -26
  240. package/script/lib/utils/string-builder/index.d.ts +4 -0
  241. package/script/lib/utils/string-builder/index.d.ts.map +1 -0
  242. package/script/lib/utils/string-builder/index.js +8 -0
  243. package/script/lib/utils/string-builder/options.d.ts +15 -0
  244. package/script/lib/utils/string-builder/options.d.ts.map +1 -0
  245. package/{cjs → script}/lib/utils/string-builder/options.js +2 -2
  246. package/script/lib/utils/string-builder/string-builder.d.ts +73 -0
  247. package/script/lib/utils/string-builder/string-builder.d.ts.map +1 -0
  248. package/{cjs → script}/lib/utils/string-builder/string-builder.js +17 -6
  249. package/script/lib/utils/string-builder/utils.d.ts +22 -0
  250. package/script/lib/utils/string-builder/utils.d.ts.map +1 -0
  251. package/{cjs → script}/lib/utils/string-builder/utils.js +4 -4
  252. package/script/lib/utils/string.utils.d.ts +130 -0
  253. package/script/lib/utils/string.utils.d.ts.map +1 -0
  254. package/{cjs → script}/lib/utils/string.utils.js +2 -2
  255. package/script/lib/utils/string.utils.types.d.ts +150 -0
  256. package/script/lib/utils/string.utils.types.d.ts.map +1 -0
  257. package/script/lib/utils/type.utils.d.ts +56 -0
  258. package/script/lib/utils/type.utils.d.ts.map +1 -0
  259. package/script/package.json +3 -0
  260. package/cjs/index.js +0 -8
  261. package/cjs/lib/codegen/config.js +0 -11
  262. package/cjs/lib/codegen/index.js +0 -9
  263. package/cjs/lib/collect/index.js +0 -6
  264. package/cjs/lib/parse/index.js +0 -6
  265. package/cjs/lib/parse/types.js +0 -5
  266. package/cjs/lib/transform/index.js +0 -5
  267. package/cjs/lib/utils/index.js +0 -17
  268. package/cjs/lib/utils/string-builder/index.js +0 -8
  269. package/cjs/package.json +0 -1
  270. package/types/index.d.ts +0 -5
  271. package/types/lib/ast/index.d.ts +0 -1
  272. package/types/lib/codegen/index.d.ts +0 -6
  273. package/types/lib/collect/collector.d.ts +0 -3
  274. package/types/lib/collect/index.d.ts +0 -3
  275. package/types/lib/parse/deref-proxy.d.ts +0 -3
  276. package/types/lib/parse/index.d.ts +0 -3
  277. package/types/lib/transform/index.d.ts +0 -2
  278. package/types/lib/transform/transform-document.d.ts +0 -3
  279. package/types/lib/transform/transform-endpoint.d.ts +0 -4
  280. package/types/lib/transform/transform-schema.d.ts +0 -4
  281. package/types/lib/transform/transformer.d.ts +0 -4
  282. package/types/lib/utils/endpoint.utils.d.ts +0 -2
  283. package/types/lib/utils/index.d.ts +0 -14
  284. package/types/lib/utils/string-builder/index.d.ts +0 -3
  285. /package/{cjs → script}/lib/codegen/internal-utils.js +0 -0
  286. /package/{cjs → script}/lib/codegen/types.js +0 -0
  287. /package/{cjs → script}/lib/collect/types.js +0 -0
  288. /package/{cjs → script}/lib/internal-utils.js +0 -0
  289. /package/{cjs → script}/lib/parse/openapi-types.js +0 -0
  290. /package/{cjs → script}/lib/transform/api-types.js +0 -0
  291. /package/{cjs → script}/lib/transform/types.js +0 -0
  292. /package/{cjs → script}/lib/utils/array.utils.js +0 -0
  293. /package/{cjs → script}/lib/utils/class.utils.js +0 -0
  294. /package/{cjs → script}/lib/utils/common.utils.js +0 -0
  295. /package/{cjs → script}/lib/utils/condition.js +0 -0
  296. /package/{cjs → script}/lib/utils/endpoint.utils.js +0 -0
  297. /package/{cjs → script}/lib/utils/error.utils.js +0 -0
  298. /package/{cjs → script}/lib/utils/generator.utils.js +0 -0
  299. /package/{cjs → script}/lib/utils/string.utils.types.js +0 -0
  300. /package/{cjs → script}/lib/utils/type.utils.js +0 -0
@@ -0,0 +1,17 @@
1
+ import { type DefaultGenerationProviderConfig, OpenApiGenerationProviderBase } from './generator.js';
2
+ import type { AnyConfig, OpenApiGenerationProviderContext, OpenApiGeneratorContext, OpenApiGeneratorInput, OpenApiGeneratorOutput } from './types.js';
3
+ import type { ApiSchema } from '../transform/index.js';
4
+ export type OpenApiSchemasGenerationProviderContext<TInput extends OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput, TConfig extends AnyConfig, TSchemaOutput extends OpenApiGeneratorOutput> = OpenApiGenerationProviderContext<TInput, TConfig> & {
5
+ existingSchemaResults: Map<string, TSchemaOutput>;
6
+ output: TOutput;
7
+ };
8
+ export declare abstract class OpenApiSchemasGenerationProviderBase<TInput extends OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput, TConfig extends AnyConfig, TSchemaOutput extends OpenApiGeneratorOutput, TContext extends OpenApiSchemasGenerationProviderContext<TInput, TOutput, TConfig, TSchemaOutput>> extends OpenApiGenerationProviderBase<TInput, TOutput, TConfig, TContext> {
9
+ protected getProviderContext(context: OpenApiGeneratorContext<TInput>, config: Partial<TConfig> | undefined, defaultConfig: DefaultGenerationProviderConfig<TConfig>): OpenApiSchemasGenerationProviderContext<TInput, TOutput, TConfig, TSchemaOutput>;
10
+ protected onGenerate(ctx: TContext): TOutput;
11
+ getSchemaResult(ctx: TContext, schema: ApiSchema): TSchemaOutput;
12
+ protected getSchemaReference(ctx: TContext, schema: ApiSchema): ApiSchema | undefined;
13
+ protected abstract initResult(ctx: OpenApiGenerationProviderContext<TInput, TConfig>): TOutput;
14
+ protected abstract generateSchema(ctx: TContext, schema: ApiSchema): TSchemaOutput;
15
+ protected abstract addSchemaResult(ctx: TContext, schema: ApiSchema, result: TSchemaOutput): void;
16
+ }
17
+ //# sourceMappingURL=schemas-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas-generator.d.ts","sourceRoot":"","sources":["../../../src/lib/codegen/schemas-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAErG,OAAO,KAAK,EACV,SAAS,EACT,gCAAgC,EAChC,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,MAAM,MAAM,uCAAuC,CACjD,MAAM,SAAS,qBAAqB,EACpC,OAAO,SAAS,sBAAsB,EACtC,OAAO,SAAS,SAAS,EACzB,aAAa,SAAS,sBAAsB,IAC1C,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAClD,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,8BAAsB,oCAAoC,CACxD,MAAM,SAAS,qBAAqB,EACpC,OAAO,SAAS,sBAAsB,EACtC,OAAO,SAAS,SAAS,EACzB,aAAa,SAAS,sBAAsB,EAC5C,QAAQ,SAAS,uCAAuC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,CACjG,SAAQ,6BAA6B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;cACtD,kBAAkB,CACnC,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,EACxC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EACpC,aAAa,EAAE,+BAA+B,CAAC,OAAO,CAAC,GACtD,uCAAuC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC;cAQhE,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO;IAQ9C,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,aAAa;IAkBvE,SAAS,CAAC,kBAAkB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAKrF,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IAE9F,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,aAAa;IAElF,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAClG"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenApiSchemasGenerationProviderBase = void 0;
4
- const generator_1 = require("./generator");
5
- const internal_utils_1 = require("./internal-utils");
6
- const utils_1 = require("../utils");
7
- class OpenApiSchemasGenerationProviderBase extends generator_1.OpenApiGenerationProviderBase {
4
+ const generator_js_1 = require("./generator.js");
5
+ const internal_utils_js_1 = require("./internal-utils.js");
6
+ const index_js_1 = require("../utils/index.js");
7
+ class OpenApiSchemasGenerationProviderBase extends generator_js_1.OpenApiGenerationProviderBase {
8
8
  getProviderContext(context, config, defaultConfig) {
9
9
  const ctx = super.getProviderContext(context, config, defaultConfig);
10
10
  return Object.assign(ctx, {
@@ -30,13 +30,13 @@ class OpenApiSchemasGenerationProviderBase extends generator_1.OpenApiGeneration
30
30
  else {
31
31
  result = this.generateSchema(ctx, schema);
32
32
  }
33
- (0, internal_utils_1.addSourceIfTest)(ctx.config, result, () => `${schema.$src.file}#${schema.$src.path}`);
33
+ (0, internal_utils_js_1.addSourceIfTest)(ctx.config, result, () => `${schema.$src.file}#${schema.$src.path}`);
34
34
  ctx.existingSchemaResults.set(schema.id, result);
35
35
  this.addSchemaResult(ctx, schema, result);
36
36
  return result;
37
37
  }
38
38
  getSchemaReference(ctx, schema) {
39
- const ref = (0, utils_1.getSchemaReference)(schema, ['description']);
39
+ const ref = (0, index_js_1.getSchemaReference)(schema, ['description']);
40
40
  return ref.id !== schema.id ? ref : undefined;
41
41
  }
42
42
  }
@@ -0,0 +1,16 @@
1
+ import { type DefaultGenerationProviderConfig, OpenApiGenerationProviderBase } from './generator.js';
2
+ import type { AnyConfig, OpenApiGenerationProviderContext, OpenApiGeneratorContext, OpenApiGeneratorInput, OpenApiGeneratorOutput } from './types.js';
3
+ import type { ApiService } from '../transform/index.js';
4
+ export type OpenApiServicesGenerationProviderContext<TInput extends OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput, TConfig extends AnyConfig, TServiceOutput extends OpenApiGeneratorOutput> = OpenApiGenerationProviderContext<TInput, TConfig> & {
5
+ existingServiceResults: Map<string, TServiceOutput>;
6
+ output: TOutput;
7
+ };
8
+ export declare abstract class OpenApiServicesGenerationProviderBase<TInput extends OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput, TConfig extends AnyConfig, TServiceOutput extends OpenApiGeneratorOutput, TContext extends OpenApiServicesGenerationProviderContext<TInput, TOutput, TConfig, TServiceOutput>> extends OpenApiGenerationProviderBase<TInput, TOutput, TConfig, TContext> {
9
+ protected getProviderContext(context: OpenApiGeneratorContext<TInput>, config: Partial<TConfig> | undefined, defaultConfig: DefaultGenerationProviderConfig<TConfig>): OpenApiServicesGenerationProviderContext<TInput, TOutput, TConfig, TServiceOutput>;
10
+ onGenerate(ctx: TContext): TOutput;
11
+ getServiceResult(ctx: TContext, service: ApiService): TServiceOutput;
12
+ protected abstract initResult(ctx: OpenApiGenerationProviderContext<TInput, TConfig>): TOutput;
13
+ protected abstract generateService(ctx: TContext, service: ApiService): TServiceOutput;
14
+ protected abstract addServiceResult(ctx: TContext, service: ApiService, result: TServiceOutput): void;
15
+ }
16
+ //# sourceMappingURL=services-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services-generator.d.ts","sourceRoot":"","sources":["../../../src/lib/codegen/services-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAErG,OAAO,KAAK,EACV,SAAS,EACT,gCAAgC,EAChC,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,wCAAwC,CAClD,MAAM,SAAS,qBAAqB,EACpC,OAAO,SAAS,sBAAsB,EACtC,OAAO,SAAS,SAAS,EACzB,cAAc,SAAS,sBAAsB,IAC3C,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtD,sBAAsB,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACpD,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,8BAAsB,qCAAqC,CACzD,MAAM,SAAS,qBAAqB,EACpC,OAAO,SAAS,sBAAsB,EACtC,OAAO,SAAS,SAAS,EACzB,cAAc,SAAS,sBAAsB,EAC7C,QAAQ,SAAS,wCAAwC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CACnG,SAAQ,6BAA6B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC;cACtD,kBAAkB,CACnC,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,EACxC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EACpC,aAAa,EAAE,+BAA+B,CAAC,OAAO,CAAC,GACtD,wCAAwC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC;IAQrE,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO;IAQ3C,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,cAAc;IAe3E,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO;IAE9F,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,GAAG,cAAc;IAEtF,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI;CACtG"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OpenApiServicesGenerationProviderBase = void 0;
4
- const generator_1 = require("./generator");
5
- const internal_utils_1 = require("./internal-utils");
6
- class OpenApiServicesGenerationProviderBase extends generator_1.OpenApiGenerationProviderBase {
4
+ const generator_js_1 = require("./generator.js");
5
+ const internal_utils_js_1 = require("./internal-utils.js");
6
+ class OpenApiServicesGenerationProviderBase extends generator_js_1.OpenApiGenerationProviderBase {
7
7
  getProviderContext(context, config, defaultConfig) {
8
8
  const ctx = super.getProviderContext(context, config, defaultConfig);
9
9
  return Object.assign(ctx, {
@@ -22,7 +22,7 @@ class OpenApiServicesGenerationProviderBase extends generator_1.OpenApiGeneratio
22
22
  if (existingResult)
23
23
  return existingResult;
24
24
  const result = this.generateService(ctx, service);
25
- (0, internal_utils_1.addSourceIfTest)(ctx.config, result, () => service.$src ? `${service.$src.file}#${service.$src.path}` : `tag:${service.name}`);
25
+ (0, internal_utils_js_1.addSourceIfTest)(ctx.config, result, () => service.$src ? `${service.$src.file}#${service.$src.path}` : `tag:${service.name}`);
26
26
  this.addServiceResult(ctx, service, result);
27
27
  return result;
28
28
  }
@@ -0,0 +1,18 @@
1
+ import type { OpenApiGeneratorConfig } from './config.js';
2
+ import type { ApiData } from '../transform/index.js';
3
+ export type AnyConfig = Readonly<Record<string, unknown>>;
4
+ export type OpenApiGeneratorInput = Record<string, unknown>;
5
+ export type OpenApiGeneratorOutput = Record<string, unknown> | undefined;
6
+ export type OpenApiGeneratorContext<TInput extends OpenApiGeneratorInput = OpenApiGeneratorInput> = {
7
+ data: ApiData;
8
+ input: TInput;
9
+ config: OpenApiGeneratorConfig;
10
+ };
11
+ export type OpenApiGenerationProviderContext<TInput extends OpenApiGeneratorInput, TConfig extends AnyConfig> = Omit<OpenApiGeneratorContext<TInput>, 'config'> & {
12
+ config: OpenApiGeneratorConfig & TConfig;
13
+ };
14
+ export interface OpenApiGenerationProvider<TInput extends OpenApiGeneratorInput = OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput = OpenApiGeneratorOutput, TConfig extends AnyConfig = AnyConfig> {
15
+ generate(...args: Parameters<OpenApiGenerationProviderFn<TInput, TOutput, TConfig>>): ReturnType<OpenApiGenerationProviderFn<TInput, TOutput, TConfig>>;
16
+ }
17
+ export type OpenApiGenerationProviderFn<TInput extends OpenApiGeneratorInput = OpenApiGeneratorInput, TOutput extends OpenApiGeneratorOutput = OpenApiGeneratorOutput, TConfig extends AnyConfig = AnyConfig> = (context: OpenApiGeneratorContext<TInput>, config?: Partial<TConfig>) => TOutput;
18
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/codegen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC5D,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;AACzE,MAAM,MAAM,uBAAuB,CAAC,MAAM,SAAS,qBAAqB,GAAG,qBAAqB,IAAI;IAClG,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,gCAAgC,CAAC,MAAM,SAAS,qBAAqB,EAAE,OAAO,SAAS,SAAS,IACxG,IAAI,CACJ,uBAAuB,CAAC,MAAM,CAAC,EAC/B,QAAQ,CACT,GACC;IACA,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC;CAC1C,CAAC;AAEJ,MAAM,WAAW,yBAAyB,CACxC,MAAM,SAAS,qBAAqB,GAAG,qBAAqB,EAC5D,OAAO,SAAS,sBAAsB,GAAG,sBAAsB,EAC/D,OAAO,SAAS,SAAS,GAAG,SAAS;IAErC,QAAQ,CACN,GAAG,IAAI,EAAE,UAAU,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,GACzE,UAAU,CAAC,2BAA2B,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;CACtE;AAED,MAAM,MAAM,2BAA2B,CACrC,MAAM,SAAS,qBAAqB,GAAG,qBAAqB,EAC5D,OAAO,SAAS,sBAAsB,GAAG,sBAAsB,EAC/D,OAAO,SAAS,SAAS,GAAG,SAAS,IACnC,CAAC,OAAO,EAAE,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { OpenApiCollectorData } from './types.js';
2
+ import type { Deref, OpenApiDocument } from '../parse/index.js';
3
+ export declare function collectOpenApi(apis: Deref<OpenApiDocument>[]): OpenApiCollectorData;
4
+ //# sourceMappingURL=collector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../src/lib/collect/collector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EAQhB,MAAM,mBAAmB,CAAC;AAI3B,wBAAgB,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,GAAG,oBAAoB,CAUnF"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.collectOpenApi = collectOpenApi;
4
- const helpers_1 = require("./helpers");
4
+ const helpers_js_1 = require("./helpers.js");
5
5
  function collectOpenApi(apis) {
6
6
  const data = {
7
7
  documents: [],
@@ -13,30 +13,30 @@ function collectOpenApi(apis) {
13
13
  }
14
14
  const jsonSchemaProperties = ['$id', 'allOf', 'anyOf', 'oneOf', 'enum', 'not', 'properties', 'title', 'type'];
15
15
  function collectDocument(data, documents) {
16
- (0, helpers_1.collect)(data, documents, (data, document) => {
16
+ (0, helpers_js_1.collect)(data, documents, (data, document) => {
17
17
  var _a, _b, _c, _d, _e;
18
18
  data.documents.push(document);
19
19
  collectPaths(data, document.paths);
20
- (0, helpers_1.collectRecord)(data, (_a = document.components) === null || _a === void 0 ? void 0 : _a.schemas, collectSchema);
21
- (0, helpers_1.collectRecord)(data, document.definitions, collectSchema);
22
- (0, helpers_1.collectRecord)(data, (_b = document.components) === null || _b === void 0 ? void 0 : _b.parameters, collectParameter);
23
- (0, helpers_1.collectRecord)(data, document.parameters, collectParameter);
24
- (0, helpers_1.collectRecord)(data, (_c = document.components) === null || _c === void 0 ? void 0 : _c.requestBodies, collectRequestBody);
25
- (0, helpers_1.collectRecord)(data, (_d = document.components) === null || _d === void 0 ? void 0 : _d.responses, collectResponse);
26
- (0, helpers_1.collectRecord)(data, document.responses, collectResponse);
27
- (0, helpers_1.collectRecord)(data, (_e = document.components) === null || _e === void 0 ? void 0 : _e.headers, collectHeader);
20
+ (0, helpers_js_1.collectRecord)(data, (_a = document.components) === null || _a === void 0 ? void 0 : _a.schemas, collectSchema);
21
+ (0, helpers_js_1.collectRecord)(data, document.definitions, collectSchema);
22
+ (0, helpers_js_1.collectRecord)(data, (_b = document.components) === null || _b === void 0 ? void 0 : _b.parameters, collectParameter);
23
+ (0, helpers_js_1.collectRecord)(data, document.parameters, collectParameter);
24
+ (0, helpers_js_1.collectRecord)(data, (_c = document.components) === null || _c === void 0 ? void 0 : _c.requestBodies, collectRequestBody);
25
+ (0, helpers_js_1.collectRecord)(data, (_d = document.components) === null || _d === void 0 ? void 0 : _d.responses, collectResponse);
26
+ (0, helpers_js_1.collectRecord)(data, document.responses, collectResponse);
27
+ (0, helpers_js_1.collectRecord)(data, (_e = document.components) === null || _e === void 0 ? void 0 : _e.headers, collectHeader);
28
28
  if (Object.keys(document).some((key) => jsonSchemaProperties.includes(key))) {
29
29
  collectSchema(data, document);
30
30
  }
31
31
  });
32
32
  }
33
33
  function collectPaths(data, paths) {
34
- (0, helpers_1.collect)(data, paths, (data, path) => {
35
- (0, helpers_1.collectRecord)(data, path, collectPathItem);
34
+ (0, helpers_js_1.collect)(data, paths, (data, path) => {
35
+ (0, helpers_js_1.collectRecord)(data, path, collectPathItem);
36
36
  });
37
37
  }
38
38
  function collectPathItem(data, pathItems, path) {
39
- (0, helpers_1.collect)(data, pathItems, (data, pathItem) => {
39
+ (0, helpers_js_1.collect)(data, pathItems, (data, pathItem) => {
40
40
  collectParameter(data, pathItem.parameters);
41
41
  for (const m of ['get', 'put', 'post', 'delete', 'options', 'head', 'patch', 'trace']) {
42
42
  const operation = pathItem[m];
@@ -53,12 +53,12 @@ function collectPathItem(data, pathItems, path) {
53
53
  });
54
54
  collectParameter(data, operation.parameters);
55
55
  collectRequestBody(data, operation.requestBody);
56
- (0, helpers_1.collectRecord)(data, operation.responses, collectResponse);
56
+ (0, helpers_js_1.collectRecord)(data, operation.responses, collectResponse);
57
57
  }
58
58
  });
59
59
  }
60
60
  function collectSchema(data, schemas) {
61
- (0, helpers_1.collect)(data, schemas, (data, schema) => {
61
+ (0, helpers_js_1.collect)(data, schemas, (data, schema) => {
62
62
  var _a;
63
63
  const key = `${schema.$src.file}#${schema.$src.path}`;
64
64
  if (data.schemas.has(key))
@@ -69,10 +69,10 @@ function collectSchema(data, schemas) {
69
69
  collectSchema(data, schema.oneOf);
70
70
  collectSchema(data, schema.items);
71
71
  collectSchema(data, schema.not);
72
- (0, helpers_1.collectRecord)(data, schema.properties, collectSchema);
73
- (0, helpers_1.collectRecord)(data, schema.patternProperties, collectSchema);
74
- (0, helpers_1.collectRecord)(data, schema.dependencies, collectSchema);
75
- (0, helpers_1.collectRecord)(data, schema.definitions, collectSchema);
72
+ (0, helpers_js_1.collectRecord)(data, schema.properties, collectSchema);
73
+ (0, helpers_js_1.collectRecord)(data, schema.patternProperties, collectSchema);
74
+ (0, helpers_js_1.collectRecord)(data, schema.dependencies, collectSchema);
75
+ (0, helpers_js_1.collectRecord)(data, schema.definitions, collectSchema);
76
76
  if (typeof schema.additionalProperties === 'object') {
77
77
  collectSchema(data, schema.additionalProperties);
78
78
  }
@@ -80,32 +80,32 @@ function collectSchema(data, schemas) {
80
80
  collectSchema(data, schema.additionalItems);
81
81
  }
82
82
  if (typeof schema.discriminator === 'object') {
83
- (0, helpers_1.collectRecord)(data, (_a = schema.discriminator) === null || _a === void 0 ? void 0 : _a.mapping, collectSchema);
83
+ (0, helpers_js_1.collectRecord)(data, (_a = schema.discriminator) === null || _a === void 0 ? void 0 : _a.mapping, collectSchema);
84
84
  }
85
85
  });
86
86
  }
87
87
  function collectParameter(data, parameters) {
88
- (0, helpers_1.collect)(data, parameters, (data, parameter) => {
88
+ (0, helpers_js_1.collect)(data, parameters, (data, parameter) => {
89
89
  collectSchema(data, parameter.schema);
90
90
  });
91
91
  }
92
92
  function collectMediaType(data, mediaTypes) {
93
- (0, helpers_1.collect)(data, mediaTypes, (data, mediaType) => {
93
+ (0, helpers_js_1.collect)(data, mediaTypes, (data, mediaType) => {
94
94
  collectSchema(data, mediaType.schema);
95
95
  });
96
96
  }
97
97
  function collectRequestBody(data, requestBody) {
98
- (0, helpers_1.collect)(data, requestBody, (data, requestBody) => {
99
- (0, helpers_1.collectRecord)(data, requestBody.content, collectMediaType);
98
+ (0, helpers_js_1.collect)(data, requestBody, (data, requestBody) => {
99
+ (0, helpers_js_1.collectRecord)(data, requestBody.content, collectMediaType);
100
100
  });
101
101
  }
102
102
  function isSchema(obj) {
103
103
  return obj && typeof obj === 'object' && obj['type'] !== undefined;
104
104
  }
105
105
  function collectResponse(data, responses) {
106
- (0, helpers_1.collect)(data, responses, (data, responses) => {
107
- (0, helpers_1.collectRecord)(data, responses.content, collectMediaType);
108
- (0, helpers_1.collect)(data, responses.headers, (data, header) => {
106
+ (0, helpers_js_1.collect)(data, responses, (data, responses) => {
107
+ (0, helpers_js_1.collectRecord)(data, responses.content, collectMediaType);
108
+ (0, helpers_js_1.collect)(data, responses.headers, (data, header) => {
109
109
  if (isSchema(header)) {
110
110
  collectSchema(data, header);
111
111
  }
@@ -116,7 +116,7 @@ function collectResponse(data, responses) {
116
116
  });
117
117
  }
118
118
  function collectHeader(data, headers) {
119
- (0, helpers_1.collect)(data, headers, (data, headers) => {
119
+ (0, helpers_js_1.collect)(data, headers, (data, headers) => {
120
120
  collectSchema(data, headers.schema);
121
121
  });
122
122
  }
@@ -0,0 +1,5 @@
1
+ import type { OpenApiCollectorData } from './types.js';
2
+ import type { Nullable } from '../utils/index.js';
3
+ export declare function collect<T extends Record<`x-${string}`, unknown>>(data: OpenApiCollectorData, obj: Nullable<T | Nullable<T>[]>, func: (data: OpenApiCollectorData, obj: NonNullable<T>) => void): void;
4
+ export declare function collectRecord<T extends Record<`x-${string}`, unknown>>(data: OpenApiCollectorData, obj: Nullable<Record<string, Nullable<T>>>, func: (data: OpenApiCollectorData, obj: NonNullable<T>, key: string) => void): void;
5
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/collect/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,OAAO,CAAC,EAC9D,IAAI,EAAE,oBAAoB,EAC1B,GAAG,EAAE,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAChC,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,IAAI,QAahE;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,KAAK,MAAM,EAAE,EAAE,OAAO,CAAC,EACpE,IAAI,EAAE,oBAAoB,EAC1B,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,EAC1C,IAAI,EAAE,CAAC,IAAI,EAAE,oBAAoB,EAAE,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,QAU7E"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.collect = collect;
4
4
  exports.collectRecord = collectRecord;
5
- const internal_utils_1 = require("../internal-utils");
5
+ const internal_utils_js_1 = require("../internal-utils.js");
6
6
  function collect(data, obj, func) {
7
7
  if (!obj)
8
8
  return;
@@ -25,7 +25,7 @@ function collectRecord(data, obj, func) {
25
25
  if (!obj)
26
26
  return;
27
27
  for (const key in obj) {
28
- if (!(0, internal_utils_1.isOpenApiObjectProperty)(key))
28
+ if (!(0, internal_utils_js_1.isOpenApiObjectProperty)(key))
29
29
  continue;
30
30
  const value = obj[key];
31
31
  if (!value)
@@ -0,0 +1,4 @@
1
+ export * from './collector.js';
2
+ export * from './helpers.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/collect/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./collector.js"), exports);
5
+ tslib_1.__exportStar(require("./helpers.js"), exports);
6
+ tslib_1.__exportStar(require("./types.js"), exports);
@@ -0,0 +1,13 @@
1
+ import type { Deref, OpenApiDocument, OpenApiHttpMethod, OpenApiOperation, OpenApiPathItem, OpenApiSchema } from '../parse/index.js';
2
+ export type OpenApiCollectorEndpointInfo = {
3
+ path: string;
4
+ method: OpenApiHttpMethod;
5
+ pathItem: Deref<OpenApiPathItem>;
6
+ operation: Deref<OpenApiOperation>;
7
+ };
8
+ export type OpenApiCollectorData = {
9
+ documents: Deref<OpenApiDocument>[];
10
+ schemas: Map<string, Deref<OpenApiSchema>>;
11
+ endpoints: Map<string, OpenApiCollectorEndpointInfo>;
12
+ };
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/collect/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACd,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IACjC,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC;IACpC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3C,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;CACtD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function isOpenApiObjectProperty<T extends string>(propertyName: T): propertyName is Exclude<T, `$${string}` | `x-${string}`>;
2
+ //# sourceMappingURL=internal-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-utils.d.ts","sourceRoot":"","sources":["../../src/lib/internal-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,MAAM,EACtD,YAAY,EAAE,CAAC,GACd,YAAY,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,EAAE,GAAG,KAAK,MAAM,EAAE,CAAC,CAE1D"}
@@ -0,0 +1,4 @@
1
+ import type { OpenApiObject } from './openapi-types.js';
2
+ import type { Deref, DerefSource } from './types.js';
3
+ export declare function createDerefProxy<T extends OpenApiObject<string>>(obj: T, source: DerefSource<T>, ref?: Deref<T>): Deref<T>;
4
+ //# sourceMappingURL=deref-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deref-proxy.d.ts","sourceRoot":"","sources":["../../../src/lib/parse/deref-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGrD,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,EAC9D,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,EACtB,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,GACb,KAAK,CAAC,CAAC,CAAC,CAEV"}
@@ -1,16 +1,31 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createDerefProxy = createDerefProxy;
4
- const utils_1 = require("../utils");
4
+ const index_js_1 = require("../utils/index.js");
5
5
  function createDerefProxy(obj, source, ref) {
6
6
  return new Proxy(obj, new DerefProxyHandler(source, ref));
7
7
  }
8
8
  const propertiesNotDerivedFromRef = ['title'];
9
9
  class DerefProxyHandler {
10
10
  constructor(_source, _ref) {
11
- this._source = _source;
12
- this._ref = _ref;
13
- this._overwrittenValues = {};
11
+ Object.defineProperty(this, "_source", {
12
+ enumerable: true,
13
+ configurable: true,
14
+ writable: true,
15
+ value: _source
16
+ });
17
+ Object.defineProperty(this, "_ref", {
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true,
21
+ value: _ref
22
+ });
23
+ Object.defineProperty(this, "_overwrittenValues", {
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true,
27
+ value: {}
28
+ });
14
29
  }
15
30
  get(target, prop) {
16
31
  var _a;
@@ -42,9 +57,9 @@ class DerefProxyHandler {
42
57
  return true;
43
58
  }
44
59
  has(target, prop) {
45
- return prop in target || (!(0, utils_1.isNullish)(this._ref) && prop in this._ref);
60
+ return prop in target || (!(0, index_js_1.isNullish)(this._ref) && prop in this._ref);
46
61
  }
47
62
  ownKeys(target) {
48
- return Array.from(new Set([...Object.keys(target), ...(!(0, utils_1.isNullish)(this._ref) ? Object.keys(this._ref) : []), '$ref', '$src']));
63
+ return Array.from(new Set([...Object.keys(target), ...(!(0, index_js_1.isNullish)(this._ref) ? Object.keys(this._ref) : []), '$ref', '$src']));
49
64
  }
50
65
  }
@@ -0,0 +1,4 @@
1
+ export * from './openapi-types.js';
2
+ export * from './parser.js';
3
+ export * from './types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/parse/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./openapi-types.js"), exports);
5
+ tslib_1.__exportStar(require("./parser.js"), exports);
6
+ tslib_1.__exportStar(require("./types.js"), exports);