moonflower 0.9.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 (268) hide show
  1. package/.eslintrc.js +26 -0
  2. package/.prettierrc.js +7 -0
  3. package/README.md +383 -0
  4. package/cli/cli.ts +59 -0
  5. package/cli/entry.cjs +3 -0
  6. package/cli/prettyprint.ts +16 -0
  7. package/dist/cli/cli.d.ts +2 -0
  8. package/dist/cli/cli.d.ts.map +1 -0
  9. package/dist/cli/cli.js +79 -0
  10. package/dist/cli/prettyprint.d.ts +4 -0
  11. package/dist/cli/prettyprint.d.ts.map +1 -0
  12. package/dist/cli/prettyprint.js +18 -0
  13. package/dist/src/errors/BaseHttpError.d.ts +13 -0
  14. package/dist/src/errors/BaseHttpError.d.ts.map +1 -0
  15. package/dist/src/errors/BaseHttpError.js +13 -0
  16. package/dist/src/errors/HttpErrorHandler.d.ts +3 -0
  17. package/dist/src/errors/HttpErrorHandler.d.ts.map +1 -0
  18. package/dist/src/errors/HttpErrorHandler.js +23 -0
  19. package/dist/src/errors/UserFacingErrors.d.ts +11 -0
  20. package/dist/src/errors/UserFacingErrors.d.ts.map +1 -0
  21. package/dist/src/errors/UserFacingErrors.js +23 -0
  22. package/dist/src/hooks/authentication/useAuth.d.ts +3 -0
  23. package/dist/src/hooks/authentication/useAuth.d.ts.map +1 -0
  24. package/dist/src/hooks/authentication/useAuth.js +7 -0
  25. package/dist/src/hooks/authentication/useOptionalAuth.d.ts +3 -0
  26. package/dist/src/hooks/authentication/useOptionalAuth.d.ts.map +1 -0
  27. package/dist/src/hooks/authentication/useOptionalAuth.js +16 -0
  28. package/dist/src/hooks/useApiEndpoint.d.ts +8 -0
  29. package/dist/src/hooks/useApiEndpoint.d.ts.map +1 -0
  30. package/dist/src/hooks/useApiEndpoint.js +7 -0
  31. package/dist/src/hooks/useApiHeader/index.d.ts +2 -0
  32. package/dist/src/hooks/useApiHeader/index.d.ts.map +1 -0
  33. package/dist/src/hooks/useApiHeader/index.js +17 -0
  34. package/dist/src/hooks/useApiHeader/useApiHeader.d.ts +3 -0
  35. package/dist/src/hooks/useApiHeader/useApiHeader.d.ts.map +1 -0
  36. package/dist/src/hooks/useApiHeader/useApiHeader.js +6 -0
  37. package/dist/src/hooks/useApiHeader/useApiHeader.spec.data.d.ts +2 -0
  38. package/dist/src/hooks/useApiHeader/useApiHeader.spec.data.d.ts.map +1 -0
  39. package/dist/src/hooks/useApiHeader/useApiHeader.spec.data.js +22 -0
  40. package/dist/src/hooks/useCookieParams.d.ts +9 -0
  41. package/dist/src/hooks/useCookieParams.d.ts.map +1 -0
  42. package/dist/src/hooks/useCookieParams.js +50 -0
  43. package/dist/src/hooks/useExposeApiModel/index.d.ts +2 -0
  44. package/dist/src/hooks/useExposeApiModel/index.d.ts.map +1 -0
  45. package/dist/src/hooks/useExposeApiModel/index.js +17 -0
  46. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.d.ts +3 -0
  47. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.d.ts.map +1 -0
  48. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.js +9 -0
  49. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.d.ts +2 -0
  50. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.d.ts.map +1 -0
  51. package/dist/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.js +16 -0
  52. package/dist/src/hooks/useHeaderParams.d.ts +12 -0
  53. package/dist/src/hooks/useHeaderParams.d.ts.map +1 -0
  54. package/dist/src/hooks/useHeaderParams.js +52 -0
  55. package/dist/src/hooks/usePathParams.d.ts +22 -0
  56. package/dist/src/hooks/usePathParams.d.ts.map +1 -0
  57. package/dist/src/hooks/usePathParams.js +46 -0
  58. package/dist/src/hooks/useQueryParams.d.ts +9 -0
  59. package/dist/src/hooks/useQueryParams.d.ts.map +1 -0
  60. package/dist/src/hooks/useQueryParams.js +50 -0
  61. package/dist/src/hooks/useRequestBody.d.ts +9 -0
  62. package/dist/src/hooks/useRequestBody.d.ts.map +1 -0
  63. package/dist/src/hooks/useRequestBody.js +59 -0
  64. package/dist/src/hooks/useRequestRawBody.d.ts +7 -0
  65. package/dist/src/hooks/useRequestRawBody.d.ts.map +1 -0
  66. package/dist/src/hooks/useRequestRawBody.js +34 -0
  67. package/dist/src/index.d.ts +18 -0
  68. package/dist/src/index.d.ts.map +1 -0
  69. package/dist/src/index.js +33 -0
  70. package/dist/src/openapi/analyzerModule/analyzerModule.d.ts +18 -0
  71. package/dist/src/openapi/analyzerModule/analyzerModule.d.ts.map +1 -0
  72. package/dist/src/openapi/analyzerModule/analyzerModule.js +192 -0
  73. package/dist/src/openapi/analyzerModule/nodeParsers.d.ts +19 -0
  74. package/dist/src/openapi/analyzerModule/nodeParsers.d.ts.map +1 -0
  75. package/dist/src/openapi/analyzerModule/nodeParsers.js +521 -0
  76. package/dist/src/openapi/analyzerModule/parseEndpoint.d.ts +4 -0
  77. package/dist/src/openapi/analyzerModule/parseEndpoint.d.ts.map +1 -0
  78. package/dist/src/openapi/analyzerModule/parseEndpoint.js +246 -0
  79. package/dist/src/openapi/analyzerModule/parseExposedModels.d.ts +5 -0
  80. package/dist/src/openapi/analyzerModule/parseExposedModels.d.ts.map +1 -0
  81. package/dist/src/openapi/analyzerModule/parseExposedModels.js +32 -0
  82. package/dist/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.d.ts +2 -0
  83. package/dist/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.d.ts.map +1 -0
  84. package/dist/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.js +400 -0
  85. package/dist/src/openapi/analyzerModule/types.d.ts +53 -0
  86. package/dist/src/openapi/analyzerModule/types.d.ts.map +1 -0
  87. package/dist/src/openapi/analyzerModule/types.js +2 -0
  88. package/dist/src/openapi/discoveryModule/discoverImports/discoverImports.d.ts +8 -0
  89. package/dist/src/openapi/discoveryModule/discoverImports/discoverImports.d.ts.map +1 -0
  90. package/dist/src/openapi/discoveryModule/discoverImports/discoverImports.js +33 -0
  91. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts +4 -0
  92. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts.map +1 -0
  93. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.js +8 -0
  94. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts +4 -0
  95. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts.map +1 -0
  96. package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.js +8 -0
  97. package/dist/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.d.ts +17 -0
  98. package/dist/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.d.ts.map +1 -0
  99. package/dist/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.js +80 -0
  100. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.d.ts +6 -0
  101. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.d.ts.map +1 -0
  102. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.js +31 -0
  103. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts +5 -0
  104. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts.map +1 -0
  105. package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.js +38 -0
  106. package/dist/src/openapi/discoveryModule/index.d.ts +3 -0
  107. package/dist/src/openapi/discoveryModule/index.d.ts.map +1 -0
  108. package/dist/src/openapi/discoveryModule/index.js +18 -0
  109. package/dist/src/openapi/generatorModule/generateComponentSchemas.d.ts +4 -0
  110. package/dist/src/openapi/generatorModule/generateComponentSchemas.d.ts.map +1 -0
  111. package/dist/src/openapi/generatorModule/generateComponentSchemas.js +12 -0
  112. package/dist/src/openapi/generatorModule/generatePaths.d.ts +10 -0
  113. package/dist/src/openapi/generatorModule/generatePaths.d.ts.map +1 -0
  114. package/dist/src/openapi/generatorModule/generatePaths.js +116 -0
  115. package/dist/src/openapi/generatorModule/generatorModule.d.ts +16 -0
  116. package/dist/src/openapi/generatorModule/generatorModule.d.ts.map +1 -0
  117. package/dist/src/openapi/generatorModule/generatorModule.js +18 -0
  118. package/dist/src/openapi/generatorModule/getSchema.d.ts +36 -0
  119. package/dist/src/openapi/generatorModule/getSchema.d.ts.map +1 -0
  120. package/dist/src/openapi/generatorModule/getSchema.js +133 -0
  121. package/dist/src/openapi/generatorModule/index.d.ts +5 -0
  122. package/dist/src/openapi/generatorModule/index.d.ts.map +1 -0
  123. package/dist/src/openapi/generatorModule/index.js +20 -0
  124. package/dist/src/openapi/generatorModule/test/openApiGenerator.spec.data.d.ts +515 -0
  125. package/dist/src/openapi/generatorModule/test/openApiGenerator.spec.data.d.ts.map +1 -0
  126. package/dist/src/openapi/generatorModule/test/openApiGenerator.spec.data.js +1119 -0
  127. package/dist/src/openapi/initOpenApiEngine.d.ts +4 -0
  128. package/dist/src/openapi/initOpenApiEngine.d.ts.map +1 -0
  129. package/dist/src/openapi/initOpenApiEngine.js +14 -0
  130. package/dist/src/openapi/manager/OpenApiManager.d.ts +67 -0
  131. package/dist/src/openapi/manager/OpenApiManager.d.ts.map +1 -0
  132. package/dist/src/openapi/manager/OpenApiManager.js +86 -0
  133. package/dist/src/openapi/router/OpenApiRouter.d.ts +4 -0
  134. package/dist/src/openapi/router/OpenApiRouter.d.ts.map +1 -0
  135. package/dist/src/openapi/router/OpenApiRouter.js +11 -0
  136. package/dist/src/openapi/types.d.ts +81 -0
  137. package/dist/src/openapi/types.d.ts.map +1 -0
  138. package/dist/src/openapi/types.js +2 -0
  139. package/dist/src/router/Router.d.ts +23 -0
  140. package/dist/src/router/Router.d.ts.map +1 -0
  141. package/dist/src/router/Router.js +81 -0
  142. package/dist/src/router/responseValueToJson.d.ts +2 -0
  143. package/dist/src/router/responseValueToJson.d.ts.map +1 -0
  144. package/dist/src/router/responseValueToJson.js +10 -0
  145. package/dist/src/setupTests.d.ts +1 -0
  146. package/dist/src/setupTests.d.ts.map +1 -0
  147. package/dist/src/setupTests.js +3 -0
  148. package/dist/src/test/TestAppRouter.d.ts +8 -0
  149. package/dist/src/test/TestAppRouter.d.ts.map +1 -0
  150. package/dist/src/test/TestAppRouter.js +58 -0
  151. package/dist/src/test/app.d.ts +3 -0
  152. package/dist/src/test/app.d.ts.map +1 -0
  153. package/dist/src/test/app.js +41 -0
  154. package/dist/src/utils/TypeUtils.d.ts +22 -0
  155. package/dist/src/utils/TypeUtils.d.ts.map +1 -0
  156. package/dist/src/utils/TypeUtils.js +2 -0
  157. package/dist/src/utils/fromZodSchema.d.ts +2 -0
  158. package/dist/src/utils/fromZodSchema.d.ts.map +1 -0
  159. package/dist/src/utils/fromZodSchema.js +6 -0
  160. package/dist/src/utils/loadTestData.d.ts +2 -0
  161. package/dist/src/utils/loadTestData.d.ts.map +1 -0
  162. package/dist/src/utils/loadTestData.js +39 -0
  163. package/dist/src/utils/mockContext.d.ts +20 -0
  164. package/dist/src/utils/mockContext.d.ts.map +1 -0
  165. package/dist/src/utils/mockContext.js +85 -0
  166. package/dist/src/utils/nameOf.d.ts +5 -0
  167. package/dist/src/utils/nameOf.d.ts.map +1 -0
  168. package/dist/src/utils/nameOf.js +7 -0
  169. package/dist/src/utils/object.d.ts +7 -0
  170. package/dist/src/utils/object.d.ts.map +1 -0
  171. package/dist/src/utils/object.js +21 -0
  172. package/dist/src/utils/printers.d.ts +6 -0
  173. package/dist/src/utils/printers.d.ts.map +1 -0
  174. package/dist/src/utils/printers.js +76 -0
  175. package/dist/src/utils/validationMessages.d.ts +18 -0
  176. package/dist/src/utils/validationMessages.d.ts.map +1 -0
  177. package/dist/src/utils/validationMessages.js +43 -0
  178. package/dist/src/validators/BuiltInValidators.d.ts +61 -0
  179. package/dist/src/validators/BuiltInValidators.d.ts.map +1 -0
  180. package/dist/src/validators/BuiltInValidators.js +66 -0
  181. package/dist/src/validators/InternalParamWrappers.d.ts +5 -0
  182. package/dist/src/validators/InternalParamWrappers.d.ts.map +1 -0
  183. package/dist/src/validators/InternalParamWrappers.js +5 -0
  184. package/dist/src/validators/ParamWrappers.d.ts +11 -0
  185. package/dist/src/validators/ParamWrappers.d.ts.map +1 -0
  186. package/dist/src/validators/ParamWrappers.js +9 -0
  187. package/dist/src/validators/types.d.ts +18 -0
  188. package/dist/src/validators/types.d.ts.map +1 -0
  189. package/dist/src/validators/types.js +2 -0
  190. package/dist/tsconfig.build.tsbuildinfo +1 -0
  191. package/package.json +59 -0
  192. package/src/errors/BaseHttpError.ts +16 -0
  193. package/src/errors/HttpErrorHandler.ts +20 -0
  194. package/src/errors/UserFacingErrors.ts +39 -0
  195. package/src/hooks/authentication/useAuth.ts +8 -0
  196. package/src/hooks/authentication/useOptionalAuth.ts +17 -0
  197. package/src/hooks/useApiEndpoint.spec.ts +11 -0
  198. package/src/hooks/useApiEndpoint.ts +10 -0
  199. package/src/hooks/useApiHeader/index.ts +1 -0
  200. package/src/hooks/useApiHeader/useApiHeader.spec.data.ts +22 -0
  201. package/src/hooks/useApiHeader/useApiHeader.spec.ts +34 -0
  202. package/src/hooks/useApiHeader/useApiHeader.ts +6 -0
  203. package/src/hooks/useCookieParams.spec.ts +174 -0
  204. package/src/hooks/useCookieParams.ts +73 -0
  205. package/src/hooks/useExposeApiModel/index.ts +1 -0
  206. package/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.ts +48 -0
  207. package/src/hooks/useExposeApiModel/useExposeApiModel.spec.ts +388 -0
  208. package/src/hooks/useExposeApiModel/useExposeApiModel.ts +9 -0
  209. package/src/hooks/useHeaderParams.spec.ts +186 -0
  210. package/src/hooks/useHeaderParams.ts +83 -0
  211. package/src/hooks/usePathParams.spec.ts +161 -0
  212. package/src/hooks/usePathParams.ts +89 -0
  213. package/src/hooks/useQueryParams.spec.ts +224 -0
  214. package/src/hooks/useQueryParams.ts +73 -0
  215. package/src/hooks/useRequestBody.spec.ts +215 -0
  216. package/src/hooks/useRequestBody.ts +94 -0
  217. package/src/hooks/useRequestRawBody.spec.ts +154 -0
  218. package/src/hooks/useRequestRawBody.ts +56 -0
  219. package/src/index.ts +17 -0
  220. package/src/openapi/analyzerModule/analyzerModule.ts +228 -0
  221. package/src/openapi/analyzerModule/nodeParsers.ts +648 -0
  222. package/src/openapi/analyzerModule/parseEndpoint.ts +305 -0
  223. package/src/openapi/analyzerModule/parseExposedModels.ts +34 -0
  224. package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.ts +521 -0
  225. package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.ts +1043 -0
  226. package/src/openapi/analyzerModule/types.ts +72 -0
  227. package/src/openapi/discoveryModule/discoverImports/discoverImports.ts +43 -0
  228. package/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.ts +7 -0
  229. package/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.ts +7 -0
  230. package/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.spec.ts +36 -0
  231. package/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.ts +80 -0
  232. package/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.ts +42 -0
  233. package/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.ts +18 -0
  234. package/src/openapi/discoveryModule/discoverRouters/discoverRouters.ts +39 -0
  235. package/src/openapi/discoveryModule/index.ts +2 -0
  236. package/src/openapi/generatorModule/generateComponentSchemas.ts +12 -0
  237. package/src/openapi/generatorModule/generatePaths.ts +138 -0
  238. package/src/openapi/generatorModule/generatorModule.ts +17 -0
  239. package/src/openapi/generatorModule/getSchema.ts +169 -0
  240. package/src/openapi/generatorModule/index.ts +4 -0
  241. package/src/openapi/generatorModule/test/openApiGenerator.spec.data.ts +1119 -0
  242. package/src/openapi/generatorModule/test/openApiGenerator.spec.ts +783 -0
  243. package/src/openapi/initOpenApiEngine.ts +20 -0
  244. package/src/openapi/manager/OpenApiManager.ts +153 -0
  245. package/src/openapi/router/OpenApiRouter.ts +11 -0
  246. package/src/openapi/types.ts +86 -0
  247. package/src/router/Router.ts +123 -0
  248. package/src/router/responseValueToJson.ts +6 -0
  249. package/src/setupTests.ts +3 -0
  250. package/src/test/TestAppRouter.ts +76 -0
  251. package/src/test/app.spec.ts +130 -0
  252. package/src/test/app.ts +43 -0
  253. package/src/utils/TypeUtils.ts +51 -0
  254. package/src/utils/loadTestData.ts +15 -0
  255. package/src/utils/mockContext.ts +86 -0
  256. package/src/utils/nameOf.ts +7 -0
  257. package/src/utils/object.spec.ts +27 -0
  258. package/src/utils/object.ts +17 -0
  259. package/src/utils/printers.spec.ts +103 -0
  260. package/src/utils/printers.ts +49 -0
  261. package/src/utils/validationMessages.ts +65 -0
  262. package/src/validators/BuiltInValidators.ts +64 -0
  263. package/src/validators/InternalParamWrappers.ts +14 -0
  264. package/src/validators/ParamWrappers.ts +22 -0
  265. package/src/validators/types.ts +35 -0
  266. package/tsconfig.build.json +15 -0
  267. package/tsconfig.json +29 -0
  268. package/vite.config.ts +16 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSchema = void 0;
4
+ const getSchema = (shape) => {
5
+ if (typeof shape === 'string' && shape === 'any') {
6
+ return generateAny();
7
+ }
8
+ if (typeof shape === 'string' && shape === 'circular') {
9
+ return generateAny();
10
+ }
11
+ if (typeof shape === 'string' && shape === 'null') {
12
+ return {
13
+ type: 'null',
14
+ };
15
+ }
16
+ if (typeof shape === 'string' && shape === 'Date') {
17
+ return {
18
+ type: 'string',
19
+ format: 'date-time',
20
+ };
21
+ }
22
+ if (typeof shape === 'string' && shape === 'bigint') {
23
+ return {
24
+ type: 'string',
25
+ format: 'bigint',
26
+ };
27
+ }
28
+ if (typeof shape === 'string') {
29
+ return {
30
+ type: shape,
31
+ };
32
+ }
33
+ if (shape.length === 0) {
34
+ return {
35
+ type: 'unknown_20',
36
+ };
37
+ }
38
+ const isStringLiteral = shape[0].role === 'literal_string';
39
+ if (isStringLiteral) {
40
+ const typedShape = shape[0];
41
+ return {
42
+ type: 'string',
43
+ enum: [typedShape.shape],
44
+ };
45
+ }
46
+ const isNumberLiteral = shape[0].role === 'literal_number';
47
+ if (isNumberLiteral) {
48
+ const typedShape = shape[0];
49
+ return {
50
+ type: 'number',
51
+ enum: [typedShape.shape],
52
+ };
53
+ }
54
+ const isObject = shape[0].role === 'property';
55
+ if (isObject) {
56
+ const typedShapes = shape;
57
+ const properties = {};
58
+ typedShapes.forEach((prop) => {
59
+ properties[prop.identifier] = (0, exports.getSchema)(prop.shape);
60
+ });
61
+ const required = typedShapes.filter((prop) => !prop.optional).map((prop) => prop.identifier);
62
+ return {
63
+ type: 'object',
64
+ properties,
65
+ required: required.length > 0 ? required : undefined,
66
+ };
67
+ }
68
+ const isUnion = shape[0].role === 'union';
69
+ if (isUnion) {
70
+ const typedShape = shape[0];
71
+ return {
72
+ oneOf: typedShape.shape.map((unionEntry) => (0, exports.getSchema)(unionEntry.shape)),
73
+ };
74
+ }
75
+ const isRecord = shape[0].role === 'record';
76
+ if (isRecord) {
77
+ const recordShape = shape[0];
78
+ return {
79
+ type: 'object',
80
+ additionalProperties: (0, exports.getSchema)(recordShape.shape),
81
+ };
82
+ }
83
+ const isArray = shape[0].role === 'array';
84
+ if (isArray) {
85
+ return {
86
+ type: 'array',
87
+ items: (0, exports.getSchema)(shape[0].shape),
88
+ };
89
+ }
90
+ const isRef = shape[0].role === 'ref';
91
+ if (isRef) {
92
+ const refShape = shape[0];
93
+ return {
94
+ $ref: `#/components/schemas/${refShape.shape}`,
95
+ };
96
+ }
97
+ const isTuple = shape[0].role === 'tuple';
98
+ if (isTuple) {
99
+ const tupleShape = shape[0];
100
+ const tupleEntries = tupleShape.shape;
101
+ return {
102
+ type: 'array',
103
+ items: {
104
+ oneOf: tupleEntries.map((entry) => (0, exports.getSchema)(entry.shape)),
105
+ },
106
+ minItems: tupleEntries.length,
107
+ maxItems: tupleEntries.length,
108
+ };
109
+ }
110
+ return {
111
+ type: 'unknown_21',
112
+ };
113
+ };
114
+ exports.getSchema = getSchema;
115
+ const generateAny = () => ({
116
+ oneOf: [
117
+ {
118
+ type: 'string',
119
+ },
120
+ {
121
+ type: 'boolean',
122
+ },
123
+ {
124
+ type: 'number',
125
+ },
126
+ {
127
+ type: 'object',
128
+ },
129
+ {
130
+ type: 'array',
131
+ },
132
+ ],
133
+ });
@@ -0,0 +1,5 @@
1
+ export * from './generateComponentSchemas';
2
+ export * from './generatePaths';
3
+ export * from './generatorModule';
4
+ export * from './getSchema';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/openapi/generatorModule/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./generateComponentSchemas"), exports);
18
+ __exportStar(require("./generatePaths"), exports);
19
+ __exportStar(require("./generatorModule"), exports);
20
+ __exportStar(require("./getSchema"), exports);
@@ -0,0 +1,515 @@
1
+ import { EndpointData } from '../../types';
2
+ export declare const manyEndpointsData: EndpointData[];
3
+ export declare const manyEndpointsResults: {
4
+ openapi: string;
5
+ info: {
6
+ title: string;
7
+ version: string;
8
+ };
9
+ paths: {
10
+ '/test/908c3e74-cf67-4ec7-a281-66a79f95d44d': {
11
+ get: {
12
+ operationId: string;
13
+ summary: string;
14
+ description: string;
15
+ parameters: never[];
16
+ responses: {
17
+ '200': {
18
+ description: string;
19
+ };
20
+ };
21
+ };
22
+ };
23
+ '/test/bf6147f2-a1dc-4cc2-8327-e6f041f828bf/{firstParam}/{secondParam}/{optionalParam}': {
24
+ get: {
25
+ description: string;
26
+ parameters: {
27
+ name: string;
28
+ in: string;
29
+ description: string;
30
+ required: boolean;
31
+ schema: {
32
+ type: string;
33
+ };
34
+ }[];
35
+ responses: {
36
+ '200': {
37
+ description: string;
38
+ };
39
+ };
40
+ };
41
+ };
42
+ '/test/ef25ef5e-0f8f-4732-bf59-8825f94a5287/{firstParam}/{secondParam}/{optionalParam}': {
43
+ get: {
44
+ description: string;
45
+ parameters: {
46
+ name: string;
47
+ in: string;
48
+ description: string;
49
+ required: boolean;
50
+ schema: {
51
+ type: string;
52
+ };
53
+ }[];
54
+ responses: {
55
+ '200': {
56
+ description: string;
57
+ };
58
+ };
59
+ };
60
+ };
61
+ '/test/5ab5dd0d-b241-4378-bea1-a2dd696d699a/{firstParam}/{secondParam}': {
62
+ get: {
63
+ description: string;
64
+ parameters: {
65
+ name: string;
66
+ in: string;
67
+ description: string;
68
+ required: boolean;
69
+ schema: {
70
+ type: string;
71
+ properties: {
72
+ foo: {
73
+ type: string;
74
+ };
75
+ bar: {
76
+ type: string;
77
+ };
78
+ };
79
+ required: string[];
80
+ };
81
+ }[];
82
+ responses: {
83
+ '200': {
84
+ description: string;
85
+ };
86
+ };
87
+ };
88
+ };
89
+ '/test/209df2a1-55f9-4859-bc31-3277547c7d88/{firstParam}/{secondParam}': {
90
+ get: {
91
+ description: string;
92
+ parameters: {
93
+ name: string;
94
+ in: string;
95
+ description: string;
96
+ required: boolean;
97
+ schema: {
98
+ type: string;
99
+ properties: {
100
+ foo: {
101
+ type: string;
102
+ };
103
+ };
104
+ };
105
+ }[];
106
+ responses: {
107
+ '200': {
108
+ description: string;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ '/test/89d961f1-7d36-4271-8bd3-665ee0992590/{firstParam}/{secondParam}': {
114
+ get: {
115
+ description: string;
116
+ parameters: {
117
+ name: string;
118
+ in: string;
119
+ description: string;
120
+ required: boolean;
121
+ schema: {
122
+ type: string;
123
+ properties: {
124
+ foo: {
125
+ oneOf: {
126
+ type: string;
127
+ }[];
128
+ };
129
+ };
130
+ required: string[];
131
+ };
132
+ }[];
133
+ responses: {
134
+ '200': {
135
+ description: string;
136
+ };
137
+ };
138
+ };
139
+ };
140
+ '/test/f89310d9-25ac-4005-93e4-614179d3bbd4': {
141
+ get: {
142
+ description: string;
143
+ parameters: {
144
+ name: string;
145
+ in: string;
146
+ description: string;
147
+ required: boolean;
148
+ schema: {
149
+ type: string;
150
+ };
151
+ }[];
152
+ responses: {
153
+ '200': {
154
+ description: string;
155
+ };
156
+ };
157
+ };
158
+ };
159
+ '/test/6040cd01-a0c6-4b70-9901-b647f19b19a7': {
160
+ get: {
161
+ description: string;
162
+ parameters: never[];
163
+ responses: {
164
+ '200': {
165
+ description: string;
166
+ };
167
+ };
168
+ };
169
+ };
170
+ '/test/f3754325-6d9c-42b6-becf-4a9e72bd2c4e': {
171
+ get: {
172
+ description: string;
173
+ parameters: never[];
174
+ responses: {
175
+ '200': {
176
+ description: string;
177
+ };
178
+ };
179
+ };
180
+ };
181
+ '/test/1ab973ff-9937-4e2d-b432-ff43a9df42cb': {
182
+ get: {
183
+ description: string;
184
+ parameters: never[];
185
+ responses: {
186
+ '200': {
187
+ description: string;
188
+ };
189
+ };
190
+ };
191
+ };
192
+ '/test/f74f6003-2aba-4f8c-855e-c0149f4217b7': {
193
+ get: {
194
+ description: string;
195
+ parameters: never[];
196
+ responses: {
197
+ '200': {
198
+ description: string;
199
+ };
200
+ };
201
+ };
202
+ };
203
+ '/test/e8e5496b-11a0-41e3-a68d-f03d524e413c': {
204
+ get: {
205
+ description: string;
206
+ parameters: never[];
207
+ responses: {
208
+ '200': {
209
+ description: string;
210
+ };
211
+ };
212
+ };
213
+ };
214
+ '/test/7268be93-ce90-44b1-9a2f-8b286d7aae67': {
215
+ get: {
216
+ description: string;
217
+ parameters: never[];
218
+ responses: {
219
+ '200': {
220
+ description: string;
221
+ };
222
+ };
223
+ };
224
+ };
225
+ '/test/185c6075-a0f4-4607-af81-b51923f5866f': {
226
+ get: {
227
+ description: string;
228
+ parameters: never[];
229
+ responses: {
230
+ '200': {
231
+ description: string;
232
+ };
233
+ };
234
+ };
235
+ };
236
+ '/test/e1bedf55-6d3a-4c01-9c66-6ec74cc66c3b': {
237
+ get: {
238
+ description: string;
239
+ parameters: never[];
240
+ responses: {
241
+ '200': {
242
+ description: string;
243
+ content: {
244
+ 'application/json': {
245
+ schema: {
246
+ oneOf: {
247
+ type: string;
248
+ }[];
249
+ };
250
+ };
251
+ };
252
+ };
253
+ };
254
+ };
255
+ };
256
+ '/test/78ad5fba-f4e2-4924-b28a-23e39dd146f7': {
257
+ get: {
258
+ description: string;
259
+ parameters: never[];
260
+ responses: {
261
+ '200': {
262
+ description: string;
263
+ content: {
264
+ 'application/json': {
265
+ schema: {
266
+ oneOf: {
267
+ type: string;
268
+ }[];
269
+ };
270
+ };
271
+ };
272
+ };
273
+ };
274
+ };
275
+ };
276
+ '/test/c542cb10-538c-44eb-8d13-5111e273ead0': {
277
+ get: {
278
+ description: string;
279
+ parameters: never[];
280
+ responses: {
281
+ '200': {
282
+ description: string;
283
+ content: {
284
+ 'application/json': {
285
+ schema: {
286
+ oneOf: {
287
+ type: string;
288
+ properties: {
289
+ foo: {
290
+ type: string;
291
+ };
292
+ bar: {
293
+ type: string;
294
+ };
295
+ };
296
+ required: string[];
297
+ }[];
298
+ };
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ };
305
+ '/test/03888127-6b97-42df-b429-87a6588ab2a4': {
306
+ get: {
307
+ description: string;
308
+ parameters: never[];
309
+ responses: {
310
+ '200': {
311
+ description: string;
312
+ content: {
313
+ 'application/json': {
314
+ schema: {
315
+ oneOf: {
316
+ type: string;
317
+ properties: {
318
+ foo: {
319
+ type: string;
320
+ };
321
+ bar: {
322
+ type: string;
323
+ };
324
+ };
325
+ }[];
326
+ };
327
+ };
328
+ };
329
+ };
330
+ };
331
+ };
332
+ };
333
+ '/test/b73347dc-c16f-4272-95b4-bf1716bf9c14': {
334
+ get: {
335
+ description: string;
336
+ parameters: never[];
337
+ responses: {
338
+ '200': {
339
+ description: string;
340
+ content: {
341
+ 'application/json': {
342
+ schema: {
343
+ oneOf: {
344
+ type: string;
345
+ properties: {
346
+ foo: {
347
+ oneOf: {
348
+ type: string;
349
+ }[];
350
+ };
351
+ };
352
+ required: string[];
353
+ }[];
354
+ };
355
+ };
356
+ };
357
+ };
358
+ };
359
+ };
360
+ };
361
+ '/test/666b9ed1-62db-447a-80a7-8f35ec50ab02': {
362
+ get: {
363
+ description: string;
364
+ parameters: never[];
365
+ responses: {
366
+ '200': {
367
+ description: string;
368
+ content: {
369
+ 'application/json': {
370
+ schema: {
371
+ oneOf: {
372
+ type: string;
373
+ properties: {
374
+ foo: {
375
+ type: string;
376
+ };
377
+ };
378
+ required: string[];
379
+ }[];
380
+ };
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ };
387
+ '/test/97bb5db8-1871-4c1d-998e-a724c04c5741': {
388
+ get: {
389
+ description: string;
390
+ parameters: {
391
+ name: string;
392
+ in: string;
393
+ description: string;
394
+ required: boolean;
395
+ schema: {
396
+ type: string;
397
+ };
398
+ }[];
399
+ responses: {
400
+ '200': {
401
+ description: string;
402
+ content: {
403
+ 'application/json': {
404
+ schema: {
405
+ oneOf: {
406
+ type: string;
407
+ properties: {
408
+ foo: {
409
+ type: string;
410
+ };
411
+ bar: {
412
+ type: string;
413
+ };
414
+ baz: {
415
+ type: string;
416
+ };
417
+ };
418
+ required: string[];
419
+ }[];
420
+ };
421
+ };
422
+ };
423
+ };
424
+ };
425
+ };
426
+ };
427
+ '/test/4188ebf2-eae6-4994-8732-c7f43d4da861': {
428
+ get: {
429
+ description: string;
430
+ parameters: {
431
+ name: string;
432
+ in: string;
433
+ description: string;
434
+ required: boolean;
435
+ schema: {
436
+ type: string;
437
+ };
438
+ }[];
439
+ responses: {
440
+ '200': {
441
+ description: string;
442
+ content: {
443
+ 'application/json': {
444
+ schema: {
445
+ oneOf: ({
446
+ type: string;
447
+ properties: {
448
+ test: {
449
+ type: string;
450
+ };
451
+ foo?: undefined;
452
+ bar?: undefined;
453
+ baz?: undefined;
454
+ };
455
+ required: string[];
456
+ } | {
457
+ type: string;
458
+ properties: {
459
+ foo: {
460
+ type: string;
461
+ };
462
+ bar: {
463
+ type: string;
464
+ };
465
+ baz: {
466
+ type: string;
467
+ };
468
+ test?: undefined;
469
+ };
470
+ required: string[];
471
+ })[];
472
+ };
473
+ };
474
+ };
475
+ };
476
+ };
477
+ };
478
+ };
479
+ '/test/32f18a25-2408-46cf-9519-f9a8d855bf84': {
480
+ get: {
481
+ description: string;
482
+ parameters: never[];
483
+ responses: {
484
+ '200': {
485
+ description: string;
486
+ content: {
487
+ 'application/json': {
488
+ schema: {
489
+ oneOf: {
490
+ type: string;
491
+ }[];
492
+ };
493
+ };
494
+ };
495
+ };
496
+ };
497
+ };
498
+ };
499
+ '/test/196f2937-e369-435f-b239-62eaacaa6fbd': {
500
+ get: {
501
+ description: string;
502
+ parameters: never[];
503
+ responses: {
504
+ '204': {
505
+ description: string;
506
+ };
507
+ };
508
+ };
509
+ };
510
+ };
511
+ components: {
512
+ schemas: {};
513
+ };
514
+ };
515
+ //# sourceMappingURL=openApiGenerator.spec.data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openApiGenerator.spec.data.d.ts","sourceRoot":"","sources":["../../../../../src/openapi/generatorModule/test/openApiGenerator.spec.data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAmvB3C,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuWhC,CAAA"}