moonflower 0.11.2 → 1.0.1
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.
- package/dist/errors/BaseHttpError.cjs +2 -0
- package/dist/errors/BaseHttpError.cjs.map +1 -0
- package/dist/{src/errors → errors}/BaseHttpError.d.ts +1 -0
- package/dist/errors/BaseHttpError.d.ts.map +1 -0
- package/dist/errors/BaseHttpError.mjs +10 -0
- package/dist/errors/BaseHttpError.mjs.map +1 -0
- package/dist/errors/HttpErrorHandler.cjs +2 -0
- package/dist/errors/HttpErrorHandler.cjs.map +1 -0
- package/dist/{src/errors → errors}/HttpErrorHandler.d.ts +2 -1
- package/dist/errors/HttpErrorHandler.d.ts.map +1 -0
- package/dist/errors/HttpErrorHandler.mjs +19 -0
- package/dist/errors/HttpErrorHandler.mjs.map +1 -0
- package/dist/errors/UserFacingErrors.cjs +2 -0
- package/dist/errors/UserFacingErrors.cjs.map +1 -0
- package/dist/{src/errors → errors}/UserFacingErrors.d.ts +1 -0
- package/dist/errors/UserFacingErrors.d.ts.map +1 -0
- package/dist/errors/UserFacingErrors.mjs +23 -0
- package/dist/errors/UserFacingErrors.mjs.map +1 -0
- package/dist/hooks/authentication/useAuth.cjs +2 -0
- package/dist/hooks/authentication/useAuth.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/authentication/useAuth.d.ts +1 -0
- package/dist/hooks/authentication/useAuth.d.ts.map +1 -0
- package/dist/hooks/authentication/useAuth.mjs +5 -0
- package/dist/hooks/authentication/useAuth.mjs.map +1 -0
- package/dist/hooks/authentication/useOptionalAuth.cjs +2 -0
- package/dist/hooks/authentication/useOptionalAuth.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/authentication/useOptionalAuth.d.ts +1 -0
- package/dist/hooks/authentication/useOptionalAuth.d.ts.map +1 -0
- package/dist/hooks/authentication/useOptionalAuth.mjs +14 -0
- package/dist/hooks/authentication/useOptionalAuth.mjs.map +1 -0
- package/dist/hooks/useApiEndpoint.cjs +2 -0
- package/dist/hooks/useApiEndpoint.cjs.map +1 -0
- package/dist/hooks/useApiEndpoint.d.ts.map +1 -0
- package/dist/hooks/useApiEndpoint.mjs +5 -0
- package/dist/hooks/useApiEndpoint.mjs.map +1 -0
- package/dist/hooks/useApiEndpoint.spec.d.ts +2 -0
- package/dist/hooks/useApiEndpoint.spec.d.ts.map +1 -0
- package/dist/hooks/useApiHeader/index.d.ts.map +1 -0
- package/dist/hooks/useApiHeader/useApiHeader.cjs +2 -0
- package/dist/hooks/useApiHeader/useApiHeader.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useApiHeader/useApiHeader.d.ts +1 -0
- package/dist/hooks/useApiHeader/useApiHeader.d.ts.map +1 -0
- package/dist/hooks/useApiHeader/useApiHeader.mjs +6 -0
- package/dist/hooks/useApiHeader/useApiHeader.mjs.map +1 -0
- package/dist/hooks/useApiHeader/useApiHeader.spec.d.ts +2 -0
- package/dist/hooks/useApiHeader/useApiHeader.spec.d.ts.map +1 -0
- package/dist/hooks/useApiHeader/useApiHeader.spec.data.d.ts.map +1 -0
- package/dist/hooks/useCookieParams.cjs +2 -0
- package/dist/hooks/useCookieParams.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useCookieParams.d.ts +1 -0
- package/dist/hooks/useCookieParams.d.ts.map +1 -0
- package/dist/hooks/useCookieParams.mjs +41 -0
- package/dist/hooks/useCookieParams.mjs.map +1 -0
- package/dist/hooks/useCookieParams.spec.d.ts +2 -0
- package/dist/hooks/useCookieParams.spec.d.ts.map +1 -0
- package/dist/hooks/useExposeApiModel/index.d.ts.map +1 -0
- package/dist/hooks/useExposeApiModel/useExposeApiModel.d.ts.map +1 -0
- package/dist/hooks/useExposeApiModel/useExposeApiModel.spec.d.ts +2 -0
- package/dist/hooks/useExposeApiModel/useExposeApiModel.spec.d.ts.map +1 -0
- package/dist/hooks/useExposeApiModel/useExposeApiModel.spec.data.d.ts.map +1 -0
- package/dist/hooks/useExposeApiModel.cjs +2 -0
- package/dist/hooks/useExposeApiModel.cjs.map +1 -0
- package/dist/hooks/useExposeApiModel.d.ts +1 -0
- package/dist/hooks/useExposeApiModel.mjs +8 -0
- package/dist/hooks/useExposeApiModel.mjs.map +1 -0
- package/dist/hooks/useHeaderParams.cjs +2 -0
- package/dist/hooks/useHeaderParams.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useHeaderParams.d.ts +1 -0
- package/dist/hooks/useHeaderParams.d.ts.map +1 -0
- package/dist/hooks/useHeaderParams.mjs +42 -0
- package/dist/hooks/useHeaderParams.mjs.map +1 -0
- package/dist/hooks/useHeaderParams.spec.d.ts +2 -0
- package/dist/hooks/useHeaderParams.spec.d.ts.map +1 -0
- package/dist/hooks/usePathParams.cjs +2 -0
- package/dist/hooks/usePathParams.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/usePathParams.d.ts +1 -0
- package/dist/hooks/usePathParams.d.ts.map +1 -0
- package/dist/hooks/usePathParams.mjs +35 -0
- package/dist/hooks/usePathParams.mjs.map +1 -0
- package/dist/hooks/usePathParams.spec.d.ts +2 -0
- package/dist/hooks/usePathParams.spec.d.ts.map +1 -0
- package/dist/hooks/useQueryParams.cjs +2 -0
- package/dist/hooks/useQueryParams.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useQueryParams.d.ts +1 -0
- package/dist/hooks/useQueryParams.d.ts.map +1 -0
- package/dist/hooks/useQueryParams.mjs +40 -0
- package/dist/hooks/useQueryParams.mjs.map +1 -0
- package/dist/hooks/useQueryParams.spec.d.ts +2 -0
- package/dist/hooks/useQueryParams.spec.d.ts.map +1 -0
- package/dist/hooks/useRequestBody.cjs +2 -0
- package/dist/hooks/useRequestBody.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useRequestBody.d.ts +1 -0
- package/dist/hooks/useRequestBody.d.ts.map +1 -0
- package/dist/hooks/useRequestBody.mjs +42 -0
- package/dist/hooks/useRequestBody.mjs.map +1 -0
- package/dist/hooks/useRequestBody.spec.d.ts +2 -0
- package/dist/hooks/useRequestBody.spec.d.ts.map +1 -0
- package/dist/hooks/useRequestRawBody.cjs +2 -0
- package/dist/hooks/useRequestRawBody.cjs.map +1 -0
- package/dist/{src/hooks → hooks}/useRequestRawBody.d.ts +1 -0
- package/dist/hooks/useRequestRawBody.d.ts.map +1 -0
- package/dist/hooks/useRequestRawBody.mjs +27 -0
- package/dist/hooks/useRequestRawBody.mjs.map +1 -0
- package/dist/hooks/useRequestRawBody.spec.d.ts +2 -0
- package/dist/hooks/useRequestRawBody.spec.d.ts.map +1 -0
- package/dist/hooks/useReturnValue.cjs +2 -0
- package/dist/hooks/useReturnValue.cjs.map +1 -0
- package/dist/hooks/useReturnValue.d.ts.map +1 -0
- package/dist/hooks/useReturnValue.mjs +10 -0
- package/dist/hooks/useReturnValue.mjs.map +1 -0
- package/dist/hooks/useReturnValue.spec.d.ts +2 -0
- package/dist/hooks/useReturnValue.spec.d.ts.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +54 -0
- package/dist/index.mjs.map +1 -0
- package/dist/openapi/analyzerModule/analyzerModule.cjs +2 -0
- package/dist/openapi/analyzerModule/analyzerModule.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/analyzerModule.d.ts +1 -0
- package/dist/openapi/analyzerModule/analyzerModule.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/analyzerModule.mjs +142 -0
- package/dist/openapi/analyzerModule/analyzerModule.mjs.map +1 -0
- package/dist/openapi/analyzerModule/getSourceFileTimestamp.cjs +2 -0
- package/dist/openapi/analyzerModule/getSourceFileTimestamp.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/getSourceFileTimestamp.d.ts +1 -0
- package/dist/openapi/analyzerModule/getSourceFileTimestamp.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/getSourceFileTimestamp.mjs +37 -0
- package/dist/openapi/analyzerModule/getSourceFileTimestamp.mjs.map +1 -0
- package/dist/openapi/analyzerModule/nodeParsers.cjs +2 -0
- package/dist/openapi/analyzerModule/nodeParsers.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/nodeParsers.d.ts +2 -1
- package/dist/openapi/analyzerModule/nodeParsers.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/nodeParsers.mjs +371 -0
- package/dist/openapi/analyzerModule/nodeParsers.mjs.map +1 -0
- package/dist/openapi/analyzerModule/parseEndpoint.cjs +2 -0
- package/dist/openapi/analyzerModule/parseEndpoint.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/parseEndpoint.d.ts +1 -0
- package/dist/openapi/analyzerModule/parseEndpoint.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/parseEndpoint.mjs +185 -0
- package/dist/openapi/analyzerModule/parseEndpoint.mjs.map +1 -0
- package/dist/openapi/analyzerModule/parseExposedModels.cjs +2 -0
- package/dist/openapi/analyzerModule/parseExposedModels.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/parseExposedModels.d.ts +1 -0
- package/dist/openapi/analyzerModule/parseExposedModels.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/parseExposedModels.mjs +23 -0
- package/dist/openapi/analyzerModule/parseExposedModels.mjs.map +1 -0
- package/dist/openapi/analyzerModule/sourceFileCache.cjs +2 -0
- package/dist/openapi/analyzerModule/sourceFileCache.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/analyzerModule/sourceFileCache.d.ts +1 -0
- package/dist/openapi/analyzerModule/sourceFileCache.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/sourceFileCache.mjs +49 -0
- package/dist/openapi/analyzerModule/sourceFileCache.mjs.map +1 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.spec.d.ts +2 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.spec.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/test/openApiAnalyzer.spec.data.d.ts.map +1 -0
- package/dist/openapi/analyzerModule/types.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverImports/discoverImports.cjs +2 -0
- package/dist/openapi/discoveryModule/discoverImports/discoverImports.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/discoveryModule/discoverImports/discoverImports.d.ts +1 -0
- package/dist/openapi/discoveryModule/discoverImports/discoverImports.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverImports/discoverImports.mjs +18 -0
- package/dist/openapi/discoveryModule/discoverImports/discoverImports.mjs.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts +4 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts +4 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.cjs +2 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/discoveryModule/discoverRouterFiles/discoverRouterFiles.d.ts +3 -3
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.mjs +43 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.mjs.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.spec.d.ts +2 -0
- package/dist/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.spec.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.cjs +2 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/discoveryModule/discoverRouters/discoverRouters.d.ts +2 -1
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.mjs +25 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.mjs.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.spec.d.ts +2 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.spec.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts +5 -0
- package/dist/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts.map +1 -0
- package/dist/openapi/discoveryModule/index.d.ts.map +1 -0
- package/dist/openapi/generatorModule/generateComponentSchemas.cjs +2 -0
- package/dist/openapi/generatorModule/generateComponentSchemas.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/generatorModule/generateComponentSchemas.d.ts +1 -0
- package/dist/openapi/generatorModule/generateComponentSchemas.d.ts.map +1 -0
- package/dist/openapi/generatorModule/generateComponentSchemas.mjs +11 -0
- package/dist/openapi/generatorModule/generateComponentSchemas.mjs.map +1 -0
- package/dist/openapi/generatorModule/generatePaths.cjs +2 -0
- package/dist/openapi/generatorModule/generatePaths.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/generatorModule/generatePaths.d.ts +1 -0
- package/dist/openapi/generatorModule/generatePaths.d.ts.map +1 -0
- package/dist/openapi/generatorModule/generatePaths.mjs +77 -0
- package/dist/openapi/generatorModule/generatePaths.mjs.map +1 -0
- package/dist/openapi/generatorModule/generatorModule.cjs +2 -0
- package/dist/openapi/generatorModule/generatorModule.cjs.map +1 -0
- package/dist/openapi/generatorModule/generatorModule.d.ts +17 -0
- package/dist/openapi/generatorModule/generatorModule.d.ts.map +1 -0
- package/dist/openapi/generatorModule/generatorModule.mjs +17 -0
- package/dist/openapi/generatorModule/generatorModule.mjs.map +1 -0
- package/dist/openapi/generatorModule/getSchema.cjs +2 -0
- package/dist/openapi/generatorModule/getSchema.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/generatorModule/getSchema.d.ts +1 -0
- package/dist/openapi/generatorModule/getSchema.d.ts.map +1 -0
- package/dist/openapi/generatorModule/getSchema.mjs +108 -0
- package/dist/openapi/generatorModule/getSchema.mjs.map +1 -0
- package/dist/openapi/generatorModule/index.d.ts.map +1 -0
- package/dist/openapi/generatorModule/test/openApiGenerator.spec.d.ts +2 -0
- package/dist/openapi/generatorModule/test/openApiGenerator.spec.d.ts.map +1 -0
- package/dist/{src/openapi → openapi}/generatorModule/test/openApiGenerator.spec.data.d.ts +1 -0
- package/dist/{src/openapi → openapi}/generatorModule/test/openApiGenerator.spec.data.d.ts.map +1 -1
- package/dist/openapi/initOpenApiEngine.cjs +2 -0
- package/dist/openapi/initOpenApiEngine.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/initOpenApiEngine.d.ts +2 -1
- package/dist/openapi/initOpenApiEngine.d.ts.map +1 -0
- package/dist/openapi/initOpenApiEngine.mjs +11 -0
- package/dist/openapi/initOpenApiEngine.mjs.map +1 -0
- package/dist/openapi/manager/OpenApiManager.cjs +2 -0
- package/dist/openapi/manager/OpenApiManager.cjs.map +1 -0
- package/dist/{src/openapi → openapi}/manager/OpenApiManager.d.ts +1 -0
- package/dist/openapi/manager/OpenApiManager.d.ts.map +1 -0
- package/dist/openapi/manager/OpenApiManager.mjs +81 -0
- package/dist/openapi/manager/OpenApiManager.mjs.map +1 -0
- package/dist/openapi/router/OpenApiRouter.cjs +2 -0
- package/dist/openapi/router/OpenApiRouter.cjs.map +1 -0
- package/dist/openapi/router/OpenApiRouter.d.ts +4 -0
- package/dist/openapi/router/OpenApiRouter.d.ts.map +1 -0
- package/dist/openapi/router/OpenApiRouter.mjs +10 -0
- package/dist/openapi/router/OpenApiRouter.mjs.map +1 -0
- package/dist/{src/openapi → openapi}/types.d.ts +1 -0
- package/dist/openapi/types.d.ts.map +1 -0
- package/dist/router/Router.cjs +2 -0
- package/dist/router/Router.cjs.map +1 -0
- package/dist/{src/router → router}/Router.d.ts +3 -2
- package/dist/router/Router.d.ts.map +1 -0
- package/dist/router/Router.mjs +63 -0
- package/dist/router/Router.mjs.map +1 -0
- package/dist/router/parseEndpointReturnValue.cjs +2 -0
- package/dist/router/parseEndpointReturnValue.cjs.map +1 -0
- package/dist/router/parseEndpointReturnValue.d.ts.map +1 -0
- package/dist/router/parseEndpointReturnValue.mjs +21 -0
- package/dist/router/parseEndpointReturnValue.mjs.map +1 -0
- package/dist/router/parseEndpointReturnValue.spec.d.ts +2 -0
- package/dist/router/parseEndpointReturnValue.spec.d.ts.map +1 -0
- package/dist/{src/setupTests.d.ts.map → setupTests.d.ts.map} +1 -1
- package/dist/test/TestAppRouter.d.ts +8 -0
- package/dist/test/TestAppRouter.d.ts.map +1 -0
- package/dist/test/app.d.ts +4 -0
- package/dist/test/app.d.ts.map +1 -0
- package/dist/test/app.spec.d.ts +2 -0
- package/dist/test/app.spec.d.ts.map +1 -0
- package/dist/utils/TypeUtils.d.ts.map +1 -0
- package/dist/utils/loadTestData.d.ts +2 -0
- package/dist/utils/loadTestData.d.ts.map +1 -0
- package/dist/utils/logger.cjs +2 -0
- package/dist/utils/logger.cjs.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.mjs +62 -0
- package/dist/utils/logger.mjs.map +1 -0
- package/dist/{src/utils → utils}/mockContext.d.ts +2 -1
- package/dist/utils/mockContext.d.ts.map +1 -0
- package/dist/utils/nameOf.d.ts.map +1 -0
- package/dist/utils/object.cjs +2 -0
- package/dist/utils/object.cjs.map +1 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.mjs +7 -0
- package/dist/utils/object.mjs.map +1 -0
- package/dist/utils/object.spec.d.ts +2 -0
- package/dist/utils/object.spec.d.ts.map +1 -0
- package/dist/{src/utils → utils}/printers.d.ts +1 -0
- package/dist/utils/printers.d.ts.map +1 -0
- package/dist/utils/printers.spec.d.ts +2 -0
- package/dist/utils/printers.spec.d.ts.map +1 -0
- package/dist/utils/validationMessages.cjs +2 -0
- package/dist/utils/validationMessages.cjs.map +1 -0
- package/dist/{src/utils → utils}/validationMessages.d.ts +1 -0
- package/dist/utils/validationMessages.d.ts.map +1 -0
- package/dist/utils/validationMessages.mjs +20 -0
- package/dist/utils/validationMessages.mjs.map +1 -0
- package/dist/validators/BuiltInValidators.cjs +2 -0
- package/dist/validators/BuiltInValidators.cjs.map +1 -0
- package/dist/{src/validators → validators}/BuiltInValidators.d.ts +10 -10
- package/dist/validators/BuiltInValidators.d.ts.map +1 -0
- package/dist/validators/BuiltInValidators.mjs +66 -0
- package/dist/validators/BuiltInValidators.mjs.map +1 -0
- package/dist/validators/InternalParamWrappers.cjs +2 -0
- package/dist/validators/InternalParamWrappers.cjs.map +1 -0
- package/dist/{src/validators → validators}/InternalParamWrappers.d.ts +1 -0
- package/dist/validators/InternalParamWrappers.d.ts.map +1 -0
- package/dist/validators/InternalParamWrappers.mjs +8 -0
- package/dist/validators/InternalParamWrappers.mjs.map +1 -0
- package/dist/validators/ParamWrappers.cjs +2 -0
- package/dist/validators/ParamWrappers.cjs.map +1 -0
- package/dist/{src/validators → validators}/ParamWrappers.d.ts +1 -0
- package/dist/validators/ParamWrappers.d.ts.map +1 -0
- package/dist/validators/ParamWrappers.mjs +16 -0
- package/dist/validators/ParamWrappers.mjs.map +1 -0
- package/dist/validators/types.d.ts.map +1 -0
- package/eslint.config.mjs +1 -2
- package/package.json +110 -10
- package/src/openapi/analyzerModule/nodeParsers.ts +17 -1
- package/src/openapi/discoveryModule/discoverImports/discoverImports.ts +0 -1
- package/src/openapi/discoveryModule/discoverRouters/discoverRouters.ts +1 -3
- package/tsconfig.json +4 -2
- package/vite.config.ts +92 -5
- package/dist/cli/cli.d.ts +0 -2
- package/dist/cli/cli.d.ts.map +0 -1
- package/dist/cli/cli.js +0 -89
- package/dist/cli/prettyprint.d.ts +0 -4
- package/dist/cli/prettyprint.d.ts.map +0 -1
- package/dist/cli/prettyprint.js +0 -19
- package/dist/src/errors/BaseHttpError.d.ts.map +0 -1
- package/dist/src/errors/BaseHttpError.js +0 -13
- package/dist/src/errors/HttpErrorHandler.d.ts.map +0 -1
- package/dist/src/errors/HttpErrorHandler.js +0 -23
- package/dist/src/errors/UserFacingErrors.d.ts.map +0 -1
- package/dist/src/errors/UserFacingErrors.js +0 -23
- package/dist/src/hooks/authentication/useAuth.d.ts.map +0 -1
- package/dist/src/hooks/authentication/useAuth.js +0 -7
- package/dist/src/hooks/authentication/useOptionalAuth.d.ts.map +0 -1
- package/dist/src/hooks/authentication/useOptionalAuth.js +0 -16
- package/dist/src/hooks/useApiEndpoint.d.ts.map +0 -1
- package/dist/src/hooks/useApiEndpoint.js +0 -7
- package/dist/src/hooks/useApiHeader/index.d.ts.map +0 -1
- package/dist/src/hooks/useApiHeader/index.js +0 -17
- package/dist/src/hooks/useApiHeader/useApiHeader.d.ts.map +0 -1
- package/dist/src/hooks/useApiHeader/useApiHeader.js +0 -6
- package/dist/src/hooks/useApiHeader/useApiHeader.spec.data.d.ts.map +0 -1
- package/dist/src/hooks/useApiHeader/useApiHeader.spec.data.js +0 -22
- package/dist/src/hooks/useCookieParams.d.ts.map +0 -1
- package/dist/src/hooks/useCookieParams.js +0 -50
- package/dist/src/hooks/useExposeApiModel/index.d.ts.map +0 -1
- package/dist/src/hooks/useExposeApiModel/index.js +0 -17
- package/dist/src/hooks/useExposeApiModel/useExposeApiModel.d.ts.map +0 -1
- package/dist/src/hooks/useExposeApiModel/useExposeApiModel.js +0 -9
- package/dist/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.d.ts.map +0 -1
- package/dist/src/hooks/useExposeApiModel/useExposeApiModel.spec.data.js +0 -16
- package/dist/src/hooks/useHeaderParams.d.ts.map +0 -1
- package/dist/src/hooks/useHeaderParams.js +0 -52
- package/dist/src/hooks/usePathParams.d.ts.map +0 -1
- package/dist/src/hooks/usePathParams.js +0 -46
- package/dist/src/hooks/useQueryParams.d.ts.map +0 -1
- package/dist/src/hooks/useQueryParams.js +0 -50
- package/dist/src/hooks/useRequestBody.d.ts.map +0 -1
- package/dist/src/hooks/useRequestBody.js +0 -59
- package/dist/src/hooks/useRequestRawBody.d.ts.map +0 -1
- package/dist/src/hooks/useRequestRawBody.js +0 -34
- package/dist/src/hooks/useReturnValue.d.ts.map +0 -1
- package/dist/src/hooks/useReturnValue.js +0 -12
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -34
- package/dist/src/openapi/analyzerModule/analyzerModule.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/analyzerModule.js +0 -257
- package/dist/src/openapi/analyzerModule/analyzerWorker.d.ts +0 -2
- package/dist/src/openapi/analyzerModule/analyzerWorker.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/analyzerWorker.js +0 -10
- package/dist/src/openapi/analyzerModule/getSourceFileTimestamp.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/getSourceFileTimestamp.js +0 -52
- package/dist/src/openapi/analyzerModule/nodeParsers.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/nodeParsers.js +0 -555
- package/dist/src/openapi/analyzerModule/parseEndpoint.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/parseEndpoint.js +0 -291
- package/dist/src/openapi/analyzerModule/parseExposedModels.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/parseExposedModels.js +0 -32
- package/dist/src/openapi/analyzerModule/sourceFileCache.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/sourceFileCache.js +0 -67
- package/dist/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.js +0 -427
- package/dist/src/openapi/analyzerModule/types.d.ts.map +0 -1
- package/dist/src/openapi/analyzerModule/types.js +0 -2
- package/dist/src/openapi/discoveryModule/discoverImports/discoverImports.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverImports/discoverImports.js +0 -33
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts +0 -3
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterA.spec.data.js +0 -8
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts +0 -3
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/data/testRouterB.spec.data.js +0 -8
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverRouterFiles/discoverRouterFiles.js +0 -91
- package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.js +0 -31
- package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts +0 -4
- package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/discoverRouters/discoverRouters.spec.data.js +0 -38
- package/dist/src/openapi/discoveryModule/index.d.ts.map +0 -1
- package/dist/src/openapi/discoveryModule/index.js +0 -18
- package/dist/src/openapi/generatorModule/generateComponentSchemas.d.ts.map +0 -1
- package/dist/src/openapi/generatorModule/generateComponentSchemas.js +0 -12
- package/dist/src/openapi/generatorModule/generatePaths.d.ts.map +0 -1
- package/dist/src/openapi/generatorModule/generatePaths.js +0 -118
- package/dist/src/openapi/generatorModule/generatorModule.d.ts +0 -16
- package/dist/src/openapi/generatorModule/generatorModule.d.ts.map +0 -1
- package/dist/src/openapi/generatorModule/generatorModule.js +0 -18
- package/dist/src/openapi/generatorModule/getSchema.d.ts.map +0 -1
- package/dist/src/openapi/generatorModule/getSchema.js +0 -143
- package/dist/src/openapi/generatorModule/index.d.ts.map +0 -1
- package/dist/src/openapi/generatorModule/index.js +0 -20
- package/dist/src/openapi/generatorModule/test/openApiGenerator.spec.data.js +0 -1126
- package/dist/src/openapi/initOpenApiEngine.d.ts.map +0 -1
- package/dist/src/openapi/initOpenApiEngine.js +0 -14
- package/dist/src/openapi/manager/OpenApiManager.d.ts.map +0 -1
- package/dist/src/openapi/manager/OpenApiManager.js +0 -86
- package/dist/src/openapi/router/OpenApiRouter.d.ts +0 -3
- package/dist/src/openapi/router/OpenApiRouter.d.ts.map +0 -1
- package/dist/src/openapi/router/OpenApiRouter.js +0 -11
- package/dist/src/openapi/types.d.ts.map +0 -1
- package/dist/src/openapi/types.js +0 -2
- package/dist/src/router/Router.d.ts.map +0 -1
- package/dist/src/router/Router.js +0 -84
- package/dist/src/router/parseEndpointReturnValue.d.ts.map +0 -1
- package/dist/src/router/parseEndpointReturnValue.js +0 -40
- package/dist/src/router/responseValueToJson.d.ts +0 -2
- package/dist/src/router/responseValueToJson.d.ts.map +0 -1
- package/dist/src/router/responseValueToJson.js +0 -10
- package/dist/src/setupTests.js +0 -3
- package/dist/src/test/TestAppRouter.d.ts +0 -7
- package/dist/src/test/TestAppRouter.d.ts.map +0 -1
- package/dist/src/test/TestAppRouter.js +0 -64
- package/dist/src/test/app.d.ts +0 -3
- package/dist/src/test/app.d.ts.map +0 -1
- package/dist/src/test/app.js +0 -41
- package/dist/src/utils/TypeUtils.d.ts.map +0 -1
- package/dist/src/utils/TypeUtils.js +0 -2
- package/dist/src/utils/loadTestData.d.ts +0 -2
- package/dist/src/utils/loadTestData.d.ts.map +0 -1
- package/dist/src/utils/loadTestData.js +0 -50
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/dist/src/utils/logger.js +0 -80
- package/dist/src/utils/mockContext.d.ts.map +0 -1
- package/dist/src/utils/mockContext.js +0 -95
- package/dist/src/utils/nameOf.d.ts.map +0 -1
- package/dist/src/utils/nameOf.js +0 -7
- package/dist/src/utils/object.d.ts.map +0 -1
- package/dist/src/utils/object.js +0 -25
- package/dist/src/utils/printers.d.ts.map +0 -1
- package/dist/src/utils/printers.js +0 -86
- package/dist/src/utils/validationMessages.d.ts.map +0 -1
- package/dist/src/utils/validationMessages.js +0 -43
- package/dist/src/validators/BuiltInValidators.d.ts.map +0 -1
- package/dist/src/validators/BuiltInValidators.js +0 -66
- package/dist/src/validators/InternalParamWrappers.d.ts.map +0 -1
- package/dist/src/validators/InternalParamWrappers.js +0 -5
- package/dist/src/validators/ParamWrappers.d.ts.map +0 -1
- package/dist/src/validators/ParamWrappers.js +0 -9
- package/dist/src/validators/types.d.ts.map +0 -1
- package/dist/src/validators/types.js +0 -2
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/tsconfig.build.json +0 -15
- /package/dist/{src/hooks → hooks}/useApiEndpoint.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useApiHeader/index.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useApiHeader/useApiHeader.spec.data.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useExposeApiModel/index.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useExposeApiModel/useExposeApiModel.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useExposeApiModel/useExposeApiModel.spec.data.d.ts +0 -0
- /package/dist/{src/hooks → hooks}/useReturnValue.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/openapi → openapi}/analyzerModule/test/openApiAnalyzer.spec.data.d.ts +0 -0
- /package/dist/{src/openapi → openapi}/analyzerModule/types.d.ts +0 -0
- /package/dist/{src/openapi → openapi}/discoveryModule/index.d.ts +0 -0
- /package/dist/{src/openapi → openapi}/generatorModule/index.d.ts +0 -0
- /package/dist/{src/router → router}/parseEndpointReturnValue.d.ts +0 -0
- /package/dist/{src/setupTests.d.ts → setupTests.d.ts} +0 -0
- /package/dist/{src/utils → utils}/TypeUtils.d.ts +0 -0
- /package/dist/{src/utils → utils}/logger.d.ts +0 -0
- /package/dist/{src/utils → utils}/nameOf.d.ts +0 -0
- /package/dist/{src/utils → utils}/object.d.ts +0 -0
- /package/dist/{src/validators → validators}/types.d.ts +0 -0
|
@@ -1,555 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getValuesOfObjectLiteral = exports.getProperTypeShape = exports.getValidatorPropertyStringValue = exports.getValidatorPropertyOptionality = exports.getValidatorPropertyShape = exports.getShapeOfValidatorLiteral = exports.getRecursiveNodeShape = exports.getTypeReferenceShape = exports.findPropertyAssignmentValueNode = exports.findNodeImplementation = void 0;
|
|
4
|
-
const ts_morph_1 = require("ts-morph");
|
|
5
|
-
const logger_1 = require("../../utils/logger");
|
|
6
|
-
const OpenApiManager_1 = require("../manager/OpenApiManager");
|
|
7
|
-
const implementationCache = new WeakMap();
|
|
8
|
-
const findNodeImplementation = (node) => {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
const cached = implementationCache.get(node);
|
|
11
|
-
if (cached) {
|
|
12
|
-
return cached;
|
|
13
|
-
}
|
|
14
|
-
if (node.getKind() === ts_morph_1.SyntaxKind.Identifier) {
|
|
15
|
-
const implementationNode = (_a = node.asKind(ts_morph_1.SyntaxKind.Identifier).getImplementations()[0]) === null || _a === void 0 ? void 0 : _a.getNode();
|
|
16
|
-
if (implementationNode) {
|
|
17
|
-
const implementationParentNode = implementationNode.getParent();
|
|
18
|
-
const assignmentValueNode = implementationParentNode.getLastChild();
|
|
19
|
-
if (assignmentValueNode === node) {
|
|
20
|
-
throw new Error('Recursive implementation found');
|
|
21
|
-
}
|
|
22
|
-
const result = (0, exports.findNodeImplementation)(assignmentValueNode);
|
|
23
|
-
implementationCache.set(node, result);
|
|
24
|
-
return result;
|
|
25
|
-
}
|
|
26
|
-
const definitionNode = (_b = node.asKind(ts_morph_1.SyntaxKind.Identifier).getDefinitions()[0]) === null || _b === void 0 ? void 0 : _b.getNode();
|
|
27
|
-
if (definitionNode) {
|
|
28
|
-
const definitionParentNode = definitionNode.getParent();
|
|
29
|
-
const assignmentValueNode = definitionParentNode.getLastChild();
|
|
30
|
-
if (assignmentValueNode === node) {
|
|
31
|
-
throw new Error('Recursive implementation found');
|
|
32
|
-
}
|
|
33
|
-
const result = (0, exports.findNodeImplementation)(assignmentValueNode);
|
|
34
|
-
implementationCache.set(node, result);
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
throw new Error('No implementation nor definition available');
|
|
38
|
-
}
|
|
39
|
-
implementationCache.set(node, node);
|
|
40
|
-
return node;
|
|
41
|
-
};
|
|
42
|
-
exports.findNodeImplementation = findNodeImplementation;
|
|
43
|
-
const findPropertyAssignmentValueNode = (node) => {
|
|
44
|
-
const identifierChildren = node.getChildrenOfKind(ts_morph_1.SyntaxKind.Identifier);
|
|
45
|
-
if (identifierChildren.length === 2) {
|
|
46
|
-
return (0, exports.findNodeImplementation)(identifierChildren[1]);
|
|
47
|
-
}
|
|
48
|
-
const lastMatchingChild = node.getChildren().reverse();
|
|
49
|
-
return lastMatchingChild.find((child) => child.getKind() !== ts_morph_1.SyntaxKind.GreaterThanToken &&
|
|
50
|
-
child.getKind() !== ts_morph_1.SyntaxKind.CommaToken &&
|
|
51
|
-
child.getKind() !== ts_morph_1.SyntaxKind.SemicolonToken);
|
|
52
|
-
};
|
|
53
|
-
exports.findPropertyAssignmentValueNode = findPropertyAssignmentValueNode;
|
|
54
|
-
const getTypeReferenceShape = (node) => {
|
|
55
|
-
const firstChild = node.getFirstChild();
|
|
56
|
-
if (firstChild.isKind(ts_morph_1.SyntaxKind.SyntaxList)) {
|
|
57
|
-
return (0, exports.getRecursiveNodeShape)(firstChild.getFirstChild());
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
return (0, exports.getRecursiveNodeShape)(firstChild);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
exports.getTypeReferenceShape = getTypeReferenceShape;
|
|
64
|
-
const getRecursiveNodeShape = (nodeOrReference) => {
|
|
65
|
-
var _a;
|
|
66
|
-
const typeName = (_a = nodeOrReference.getSymbol()) === null || _a === void 0 ? void 0 : _a.getName();
|
|
67
|
-
if (typeName && OpenApiManager_1.OpenApiManager.getInstance().hasExposedModel(typeName)) {
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
role: 'ref',
|
|
71
|
-
shape: typeName,
|
|
72
|
-
optional: false,
|
|
73
|
-
},
|
|
74
|
-
];
|
|
75
|
-
}
|
|
76
|
-
const node = (0, exports.findNodeImplementation)(nodeOrReference);
|
|
77
|
-
const undefinedNode = node.asKind(ts_morph_1.SyntaxKind.UndefinedKeyword);
|
|
78
|
-
if (undefinedNode) {
|
|
79
|
-
return 'undefined';
|
|
80
|
-
}
|
|
81
|
-
const literalNode = node.asKind(ts_morph_1.SyntaxKind.LiteralType);
|
|
82
|
-
if (literalNode) {
|
|
83
|
-
if (literalNode.getFirstChildByKind(ts_morph_1.SyntaxKind.TrueKeyword)) {
|
|
84
|
-
return 'true';
|
|
85
|
-
}
|
|
86
|
-
if (literalNode.getFirstChildByKind(ts_morph_1.SyntaxKind.FalseKeyword)) {
|
|
87
|
-
return 'false';
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const booleanLiteralNode = node.asKind(ts_morph_1.SyntaxKind.BooleanKeyword) ||
|
|
91
|
-
node.asKind(ts_morph_1.SyntaxKind.TrueKeyword) ||
|
|
92
|
-
node.asKind(ts_morph_1.SyntaxKind.FalseKeyword);
|
|
93
|
-
if (booleanLiteralNode) {
|
|
94
|
-
return 'boolean';
|
|
95
|
-
}
|
|
96
|
-
const stringLiteralNode = node.asKind(ts_morph_1.SyntaxKind.StringKeyword) || node.asKind(ts_morph_1.SyntaxKind.StringLiteral);
|
|
97
|
-
if (stringLiteralNode) {
|
|
98
|
-
return 'string';
|
|
99
|
-
}
|
|
100
|
-
const numberLiteralNode = node.asKind(ts_morph_1.SyntaxKind.NumberKeyword) || node.asKind(ts_morph_1.SyntaxKind.NumericLiteral);
|
|
101
|
-
if (numberLiteralNode) {
|
|
102
|
-
return 'number';
|
|
103
|
-
}
|
|
104
|
-
const bigIntNode = node.asKind(ts_morph_1.SyntaxKind.BigIntKeyword) || node.asKind(ts_morph_1.SyntaxKind.BigIntLiteral);
|
|
105
|
-
if (bigIntNode) {
|
|
106
|
-
return 'bigint';
|
|
107
|
-
}
|
|
108
|
-
const typeLiteralNode = node.asKind(ts_morph_1.SyntaxKind.TypeLiteral);
|
|
109
|
-
if (typeLiteralNode) {
|
|
110
|
-
const properties = typeLiteralNode
|
|
111
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList)
|
|
112
|
-
.getChildrenOfKind(ts_morph_1.SyntaxKind.PropertySignature);
|
|
113
|
-
const propertyShapes = properties.map((propNode) => {
|
|
114
|
-
const identifier = propNode.getFirstChildByKind(ts_morph_1.SyntaxKind.Identifier);
|
|
115
|
-
const valueNode = (0, exports.findPropertyAssignmentValueNode)(propNode);
|
|
116
|
-
const questionMarkToken = identifier.getNextSiblingIfKind(ts_morph_1.SyntaxKind.QuestionToken);
|
|
117
|
-
return {
|
|
118
|
-
role: 'property',
|
|
119
|
-
identifier: identifier.getText(),
|
|
120
|
-
shape: (0, exports.getRecursiveNodeShape)(valueNode),
|
|
121
|
-
optional: valueNode.getType().isNullable() || !!questionMarkToken,
|
|
122
|
-
};
|
|
123
|
-
});
|
|
124
|
-
return propertyShapes;
|
|
125
|
-
}
|
|
126
|
-
const typeReferenceNode = node.asKind(ts_morph_1.SyntaxKind.TypeReference);
|
|
127
|
-
if (typeReferenceNode) {
|
|
128
|
-
return (0, exports.getRecursiveNodeShape)(typeReferenceNode.getFirstChild());
|
|
129
|
-
}
|
|
130
|
-
const propertyAccessNode = node.asKind(ts_morph_1.SyntaxKind.PropertyAccessExpression);
|
|
131
|
-
if (propertyAccessNode) {
|
|
132
|
-
const lastChild = (0, exports.findNodeImplementation)(node.getLastChild());
|
|
133
|
-
return (0, exports.getProperTypeShape)(lastChild.asKind(ts_morph_1.SyntaxKind.CallExpression).getReturnType(), lastChild);
|
|
134
|
-
}
|
|
135
|
-
const unionTypeNode = node.asKind(ts_morph_1.SyntaxKind.UnionType);
|
|
136
|
-
if (unionTypeNode) {
|
|
137
|
-
return (0, exports.getProperTypeShape)(unionTypeNode.getType(), node);
|
|
138
|
-
}
|
|
139
|
-
const typeQueryNode = node.asKind(ts_morph_1.SyntaxKind.TypeQuery);
|
|
140
|
-
if (typeQueryNode) {
|
|
141
|
-
return (0, exports.getRecursiveNodeShape)(typeQueryNode.getLastChild());
|
|
142
|
-
}
|
|
143
|
-
const qualifiedNameNode = node.asKind(ts_morph_1.SyntaxKind.QualifiedName);
|
|
144
|
-
if (qualifiedNameNode) {
|
|
145
|
-
return (0, exports.getRecursiveNodeShape)(qualifiedNameNode.getLastChild());
|
|
146
|
-
}
|
|
147
|
-
const callExpressionNode = node.asKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
148
|
-
if (callExpressionNode) {
|
|
149
|
-
return (0, exports.getProperTypeShape)(callExpressionNode.getReturnType(), callExpressionNode);
|
|
150
|
-
}
|
|
151
|
-
const awaitExpressionNode = node.asKind(ts_morph_1.SyntaxKind.AwaitExpression);
|
|
152
|
-
if (awaitExpressionNode) {
|
|
153
|
-
return (0, exports.getRecursiveNodeShape)(awaitExpressionNode.getChildAtIndex(1));
|
|
154
|
-
}
|
|
155
|
-
const asExpressionNode = node.asKind(ts_morph_1.SyntaxKind.AsExpression);
|
|
156
|
-
if (asExpressionNode) {
|
|
157
|
-
return (0, exports.getRecursiveNodeShape)(asExpressionNode.getChildAtIndex(2));
|
|
158
|
-
}
|
|
159
|
-
const fileName = node.getSourceFile().getFilePath().split('/').pop();
|
|
160
|
-
logger_1.Logger.warn(`[${fileName}] Unknown node type: ${node.getKindName()}`);
|
|
161
|
-
return 'unknown_1';
|
|
162
|
-
};
|
|
163
|
-
exports.getRecursiveNodeShape = getRecursiveNodeShape;
|
|
164
|
-
const getShapeOfValidatorLiteral = (objectLiteralNode) => {
|
|
165
|
-
const syntaxListNode = objectLiteralNode.getFirstDescendantByKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
166
|
-
const assignmentNodes = syntaxListNode.getChildrenOfKind(ts_morph_1.SyntaxKind.PropertyAssignment);
|
|
167
|
-
const properties = assignmentNodes.map((node) => {
|
|
168
|
-
const identifierNode = node.getFirstChild();
|
|
169
|
-
const identifierName = (() => {
|
|
170
|
-
if (identifierNode.isKind(ts_morph_1.SyntaxKind.Identifier)) {
|
|
171
|
-
return identifierNode.getText();
|
|
172
|
-
}
|
|
173
|
-
if (identifierNode.isKind(ts_morph_1.SyntaxKind.StringLiteral)) {
|
|
174
|
-
return identifierNode.getLiteralText();
|
|
175
|
-
}
|
|
176
|
-
const fileName = node.getSourceFile().getFilePath().split('/').pop();
|
|
177
|
-
logger_1.Logger.warn(`[${fileName}] Unknown identifier name: ${identifierNode.getText()}`);
|
|
178
|
-
return 'unknown_30';
|
|
179
|
-
})();
|
|
180
|
-
const assignmentValueNode = node.getLastChild();
|
|
181
|
-
const innerLiteralNode = (0, exports.findNodeImplementation)(assignmentValueNode);
|
|
182
|
-
return {
|
|
183
|
-
role: 'property',
|
|
184
|
-
identifier: identifierName,
|
|
185
|
-
shape: (0, exports.getValidatorPropertyShape)(innerLiteralNode),
|
|
186
|
-
optional: (0, exports.getValidatorPropertyOptionality)(innerLiteralNode),
|
|
187
|
-
description: (0, exports.getValidatorPropertyStringValue)(innerLiteralNode, 'description'),
|
|
188
|
-
errorMessage: (0, exports.getValidatorPropertyStringValue)(innerLiteralNode, 'errorMessage'),
|
|
189
|
-
};
|
|
190
|
-
});
|
|
191
|
-
return properties || [];
|
|
192
|
-
};
|
|
193
|
-
exports.getShapeOfValidatorLiteral = getShapeOfValidatorLiteral;
|
|
194
|
-
const getValidatorPropertyShape = (innerLiteralNode) => {
|
|
195
|
-
var _a;
|
|
196
|
-
const inlineValidatorAsExpression = innerLiteralNode
|
|
197
|
-
.getParent()
|
|
198
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.AsExpression);
|
|
199
|
-
if (inlineValidatorAsExpression) {
|
|
200
|
-
const typeReference = inlineValidatorAsExpression.getLastChildByKind(ts_morph_1.SyntaxKind.TypeReference);
|
|
201
|
-
return (0, exports.getTypeReferenceShape)(typeReference);
|
|
202
|
-
}
|
|
203
|
-
const childTypeReferenceNode = innerLiteralNode.getParent().getFirstChildByKind(ts_morph_1.SyntaxKind.TypeReference);
|
|
204
|
-
if (childTypeReferenceNode) {
|
|
205
|
-
return (0, exports.getTypeReferenceShape)(childTypeReferenceNode);
|
|
206
|
-
}
|
|
207
|
-
if (innerLiteralNode.getParent().getChildrenOfKind(ts_morph_1.SyntaxKind.SyntaxList).length >= 2) {
|
|
208
|
-
const typeNode = innerLiteralNode
|
|
209
|
-
.getParent()
|
|
210
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList)
|
|
211
|
-
.getFirstChild();
|
|
212
|
-
return (0, exports.getRecursiveNodeShape)(typeNode);
|
|
213
|
-
}
|
|
214
|
-
const childCallExpressionNode = innerLiteralNode.getParent().getFirstChildByKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
215
|
-
if (childCallExpressionNode) {
|
|
216
|
-
const callExpressionArgument = (0, exports.findNodeImplementation)(childCallExpressionNode.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList).getFirstChild());
|
|
217
|
-
const typeReferenceNode = callExpressionArgument
|
|
218
|
-
.getParent()
|
|
219
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.TypeReference);
|
|
220
|
-
if (typeReferenceNode) {
|
|
221
|
-
return (0, exports.getProperTypeShape)(typeReferenceNode.getType(), typeReferenceNode, []);
|
|
222
|
-
}
|
|
223
|
-
const thingyNode = callExpressionArgument
|
|
224
|
-
.getParent()
|
|
225
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
|
|
226
|
-
if (thingyNode) {
|
|
227
|
-
return (0, exports.getValidatorPropertyShape)(thingyNode);
|
|
228
|
-
}
|
|
229
|
-
if (callExpressionArgument.getKind() === ts_morph_1.SyntaxKind.CallExpression) {
|
|
230
|
-
return (0, exports.getValidatorPropertyShape)(callExpressionArgument);
|
|
231
|
-
}
|
|
232
|
-
if (callExpressionArgument.getKind() === ts_morph_1.SyntaxKind.IntersectionType) {
|
|
233
|
-
return (0, exports.getValidatorPropertyShape)(callExpressionArgument);
|
|
234
|
-
}
|
|
235
|
-
const fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop();
|
|
236
|
-
logger_1.Logger.warn(`[${fileName}] Unknown call expression argument: ${callExpressionArgument.getKindName()}`);
|
|
237
|
-
return 'unknown_3';
|
|
238
|
-
}
|
|
239
|
-
const innerNodePropertyAssignments = innerLiteralNode
|
|
240
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList)
|
|
241
|
-
.getChildrenOfKind(ts_morph_1.SyntaxKind.PropertyAssignment);
|
|
242
|
-
const parsePropertyAssignment = innerNodePropertyAssignments.find((prop) => {
|
|
243
|
-
var _a;
|
|
244
|
-
return ((_a = prop.getFirstChildByKind(ts_morph_1.SyntaxKind.Identifier)) === null || _a === void 0 ? void 0 : _a.getText()) === 'parse';
|
|
245
|
-
});
|
|
246
|
-
if (parsePropertyAssignment) {
|
|
247
|
-
const returnType = (0, exports.findPropertyAssignmentValueNode)(parsePropertyAssignment)
|
|
248
|
-
.asKind(ts_morph_1.SyntaxKind.ArrowFunction)
|
|
249
|
-
.getReturnType();
|
|
250
|
-
return (0, exports.getProperTypeShape)(returnType, parsePropertyAssignment);
|
|
251
|
-
}
|
|
252
|
-
const importTypeNode = (_a = innerLiteralNode
|
|
253
|
-
.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList)) === null || _a === void 0 ? void 0 : _a.getFirstChildByKind(ts_morph_1.SyntaxKind.ImportType);
|
|
254
|
-
if (importTypeNode) {
|
|
255
|
-
const indexOfGreaterThanToken = importTypeNode
|
|
256
|
-
.getLastChildByKind(ts_morph_1.SyntaxKind.GreaterThanToken)
|
|
257
|
-
.getChildIndex();
|
|
258
|
-
const targetSyntaxList = importTypeNode.getChildAtIndex(indexOfGreaterThanToken - 1);
|
|
259
|
-
return (0, exports.getRecursiveNodeShape)(targetSyntaxList.getFirstChild());
|
|
260
|
-
}
|
|
261
|
-
const fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop();
|
|
262
|
-
logger_1.Logger.warn(`[${fileName}] Unknown import type node`);
|
|
263
|
-
return 'unknown_2';
|
|
264
|
-
};
|
|
265
|
-
exports.getValidatorPropertyShape = getValidatorPropertyShape;
|
|
266
|
-
const getValidatorPropertyOptionality = (node) => {
|
|
267
|
-
const callExpressionNode = node.asKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
268
|
-
if (callExpressionNode) {
|
|
269
|
-
const identifierNode = callExpressionNode.getFirstChildByKind(ts_morph_1.SyntaxKind.Identifier);
|
|
270
|
-
if ((identifierNode === null || identifierNode === void 0 ? void 0 : identifierNode.getText()) === 'OptionalParam') {
|
|
271
|
-
return true;
|
|
272
|
-
}
|
|
273
|
-
else if ((identifierNode === null || identifierNode === void 0 ? void 0 : identifierNode.getText()) === 'RequiredParam') {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
const syntaxListNode = callExpressionNode.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
277
|
-
const literalExpression = (0, exports.findNodeImplementation)(syntaxListNode.getFirstChild());
|
|
278
|
-
return (0, exports.getValidatorPropertyOptionality)(literalExpression);
|
|
279
|
-
}
|
|
280
|
-
const syntaxListNode = node.getFirstDescendantByKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
281
|
-
const assignmentNodes = syntaxListNode.getChildrenOfKind(ts_morph_1.SyntaxKind.PropertyAssignment);
|
|
282
|
-
return assignmentNodes.some((node) => {
|
|
283
|
-
const identifierNode = node.getFirstDescendantByKind(ts_morph_1.SyntaxKind.Identifier);
|
|
284
|
-
const identifierName = identifierNode.getText();
|
|
285
|
-
if (identifierName === 'optional') {
|
|
286
|
-
const value = (0, exports.findPropertyAssignmentValueNode)(node);
|
|
287
|
-
return value.getKind() === ts_morph_1.SyntaxKind.TrueKeyword;
|
|
288
|
-
}
|
|
289
|
-
return false;
|
|
290
|
-
});
|
|
291
|
-
};
|
|
292
|
-
exports.getValidatorPropertyOptionality = getValidatorPropertyOptionality;
|
|
293
|
-
const getValidatorPropertyStringValue = (nodeOrReference, name) => {
|
|
294
|
-
const node = (0, exports.findNodeImplementation)(nodeOrReference);
|
|
295
|
-
const callExpressionNode = node.asKind(ts_morph_1.SyntaxKind.CallExpression);
|
|
296
|
-
if (callExpressionNode) {
|
|
297
|
-
const targetChild = callExpressionNode.getLastChildByKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
298
|
-
return (0, exports.getValidatorPropertyStringValue)(targetChild, name);
|
|
299
|
-
}
|
|
300
|
-
const syntaxListNode = node.asKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
301
|
-
if (syntaxListNode) {
|
|
302
|
-
const children = syntaxListNode.getChildren().map((c) => (0, exports.getValidatorPropertyStringValue)(c, name));
|
|
303
|
-
return children.find((value) => !!value && value !== 'unknown_25') || '';
|
|
304
|
-
}
|
|
305
|
-
const objectLiteralNode = node.asKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
|
|
306
|
-
if (objectLiteralNode) {
|
|
307
|
-
const values = (0, exports.getValuesOfObjectLiteral)(objectLiteralNode);
|
|
308
|
-
const targetValue = values.find((value) => value.identifier === name);
|
|
309
|
-
if (!targetValue) {
|
|
310
|
-
return '';
|
|
311
|
-
}
|
|
312
|
-
if (Array.isArray(targetValue.value)) {
|
|
313
|
-
return 'array';
|
|
314
|
-
}
|
|
315
|
-
return targetValue.value || '';
|
|
316
|
-
}
|
|
317
|
-
const intersectionTypeNode = node.asKind(ts_morph_1.SyntaxKind.IntersectionType);
|
|
318
|
-
if (intersectionTypeNode) {
|
|
319
|
-
return (intersectionTypeNode
|
|
320
|
-
.getTypeNodes()
|
|
321
|
-
.flatMap((t) => (0, exports.getValidatorPropertyStringValue)(t, name))
|
|
322
|
-
.filter((v) => !!v && v !== 'unknown_25')[0] || 'unknown_27');
|
|
323
|
-
}
|
|
324
|
-
const typeLiteralNode = node.asKind(ts_morph_1.SyntaxKind.TypeLiteral);
|
|
325
|
-
if (typeLiteralNode) {
|
|
326
|
-
return (0, exports.getValidatorPropertyStringValue)(typeLiteralNode.getFirstChildByKind(ts_morph_1.SyntaxKind.SyntaxList), name);
|
|
327
|
-
}
|
|
328
|
-
const propertySignatureNode = node.asKind(ts_morph_1.SyntaxKind.PropertySignature);
|
|
329
|
-
if (propertySignatureNode) {
|
|
330
|
-
const identifier = node.getFirstDescendantByKind(ts_morph_1.SyntaxKind.Identifier);
|
|
331
|
-
if (identifier.getText() === name) {
|
|
332
|
-
const targetNode = (0, exports.findPropertyAssignmentValueNode)(propertySignatureNode).getFirstDescendantByKind(ts_morph_1.SyntaxKind.StringLiteral);
|
|
333
|
-
return targetNode.getLiteralText();
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
const fileName = node.getSourceFile().getFilePath().split('/').pop();
|
|
337
|
-
logger_1.Logger.dev(`[${fileName}] Unknown property string value node ${node.getKindName()}`);
|
|
338
|
-
return 'unknown_25';
|
|
339
|
-
};
|
|
340
|
-
exports.getValidatorPropertyStringValue = getValidatorPropertyStringValue;
|
|
341
|
-
const isPromise = (type) => {
|
|
342
|
-
const symbol = type.getSymbol();
|
|
343
|
-
if (!type.isObject() || !symbol) {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
const args = type.getTypeArguments();
|
|
347
|
-
return symbol.getName() === 'Promise' && args.length === 1;
|
|
348
|
-
};
|
|
349
|
-
const getProperTypeShape = (typeOrPromise, atLocation, stack = []) => {
|
|
350
|
-
var _a;
|
|
351
|
-
const typeName = (_a = typeOrPromise.getAliasSymbol()) === null || _a === void 0 ? void 0 : _a.getName();
|
|
352
|
-
if (typeName && OpenApiManager_1.OpenApiManager.getInstance().hasExposedModel(typeName)) {
|
|
353
|
-
return [
|
|
354
|
-
{
|
|
355
|
-
role: 'ref',
|
|
356
|
-
shape: typeName,
|
|
357
|
-
optional: false,
|
|
358
|
-
},
|
|
359
|
-
];
|
|
360
|
-
}
|
|
361
|
-
const type = isPromise(typeOrPromise) ? typeOrPromise.getTypeArguments()[0] : typeOrPromise;
|
|
362
|
-
if (stack.some((previousType) => previousType === type)) {
|
|
363
|
-
return 'circular';
|
|
364
|
-
}
|
|
365
|
-
const nextStack = stack.concat(type);
|
|
366
|
-
if (type.getText() === 'void') {
|
|
367
|
-
return 'void';
|
|
368
|
-
}
|
|
369
|
-
if (type.isAny()) {
|
|
370
|
-
return 'any';
|
|
371
|
-
}
|
|
372
|
-
if (type.isNull()) {
|
|
373
|
-
return 'null';
|
|
374
|
-
}
|
|
375
|
-
if (type.isUndefined()) {
|
|
376
|
-
return 'undefined';
|
|
377
|
-
}
|
|
378
|
-
if (type.isBoolean() || type.isBooleanLiteral()) {
|
|
379
|
-
return 'boolean';
|
|
380
|
-
}
|
|
381
|
-
if (type.isStringLiteral()) {
|
|
382
|
-
return [
|
|
383
|
-
{
|
|
384
|
-
role: 'literal_string',
|
|
385
|
-
shape: String(type.getLiteralValue()),
|
|
386
|
-
optional: false,
|
|
387
|
-
},
|
|
388
|
-
];
|
|
389
|
-
}
|
|
390
|
-
if (type.isNumberLiteral()) {
|
|
391
|
-
return [
|
|
392
|
-
{
|
|
393
|
-
role: 'literal_number',
|
|
394
|
-
shape: String(type.getLiteralValue()),
|
|
395
|
-
optional: false,
|
|
396
|
-
},
|
|
397
|
-
];
|
|
398
|
-
}
|
|
399
|
-
if (type.isString() || type.isTemplateLiteral()) {
|
|
400
|
-
return 'string';
|
|
401
|
-
}
|
|
402
|
-
if (type.isNumber()) {
|
|
403
|
-
return 'number';
|
|
404
|
-
}
|
|
405
|
-
if (type.getText() === 'bigint') {
|
|
406
|
-
return 'bigint';
|
|
407
|
-
}
|
|
408
|
-
if (type.isTuple()) {
|
|
409
|
-
return [
|
|
410
|
-
{
|
|
411
|
-
role: 'tuple',
|
|
412
|
-
shape: type.getTupleElements().map((t) => ({
|
|
413
|
-
role: 'tuple_entry',
|
|
414
|
-
shape: (0, exports.getProperTypeShape)(t, atLocation, nextStack),
|
|
415
|
-
optional: false,
|
|
416
|
-
})),
|
|
417
|
-
optional: false,
|
|
418
|
-
},
|
|
419
|
-
];
|
|
420
|
-
}
|
|
421
|
-
if (type.isArray()) {
|
|
422
|
-
return [
|
|
423
|
-
{
|
|
424
|
-
role: 'array',
|
|
425
|
-
shape: (0, exports.getProperTypeShape)(type.getArrayElementType(), atLocation, nextStack),
|
|
426
|
-
optional: false,
|
|
427
|
-
},
|
|
428
|
-
];
|
|
429
|
-
}
|
|
430
|
-
if (type.isObject() && type.getText() === 'Buffer') {
|
|
431
|
-
return [
|
|
432
|
-
{
|
|
433
|
-
role: 'buffer',
|
|
434
|
-
shape: 'buffer',
|
|
435
|
-
optional: false,
|
|
436
|
-
},
|
|
437
|
-
];
|
|
438
|
-
}
|
|
439
|
-
if (type.isObject() && type.getProperties().length === 0) {
|
|
440
|
-
const targetType = type.getAliasTypeArguments()[1];
|
|
441
|
-
return [
|
|
442
|
-
{
|
|
443
|
-
role: 'record',
|
|
444
|
-
shape: (0, exports.getProperTypeShape)(targetType, atLocation, nextStack),
|
|
445
|
-
optional: false,
|
|
446
|
-
},
|
|
447
|
-
];
|
|
448
|
-
}
|
|
449
|
-
if (type.isObject()) {
|
|
450
|
-
if (type.getText() === 'Date') {
|
|
451
|
-
return 'Date';
|
|
452
|
-
}
|
|
453
|
-
return type
|
|
454
|
-
.getProperties()
|
|
455
|
-
.map((prop) => {
|
|
456
|
-
const valueDeclaration = prop.getValueDeclaration() || prop.getDeclarations()[0];
|
|
457
|
-
if (!valueDeclaration) {
|
|
458
|
-
return {
|
|
459
|
-
role: 'property',
|
|
460
|
-
identifier: prop.getName(),
|
|
461
|
-
shape: (0, exports.getProperTypeShape)(prop.getTypeAtLocation(atLocation), atLocation, nextStack),
|
|
462
|
-
optional: false,
|
|
463
|
-
};
|
|
464
|
-
}
|
|
465
|
-
const valueDeclarationNode = valueDeclaration.asKind(ts_morph_1.SyntaxKind.PropertySignature) ||
|
|
466
|
-
valueDeclaration.asKind(ts_morph_1.SyntaxKind.PropertyAssignment) ||
|
|
467
|
-
valueDeclaration.asKind(ts_morph_1.SyntaxKind.ShorthandPropertyAssignment);
|
|
468
|
-
if (!valueDeclarationNode) {
|
|
469
|
-
return {
|
|
470
|
-
role: 'property',
|
|
471
|
-
identifier: prop.getName(),
|
|
472
|
-
shape: (0, exports.getProperTypeShape)(prop.getTypeAtLocation(atLocation), atLocation, nextStack),
|
|
473
|
-
optional: false,
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
const isOptional = prop.getTypeAtLocation(atLocation).isNullable();
|
|
477
|
-
const shape = (0, exports.getProperTypeShape)(prop.getTypeAtLocation(atLocation), atLocation, nextStack);
|
|
478
|
-
return {
|
|
479
|
-
role: 'property',
|
|
480
|
-
identifier: prop.getName(),
|
|
481
|
-
shape: shape,
|
|
482
|
-
optional: isOptional,
|
|
483
|
-
};
|
|
484
|
-
})
|
|
485
|
-
.filter((val) => val.shape !== 'undefined');
|
|
486
|
-
}
|
|
487
|
-
if (type.isUnion()) {
|
|
488
|
-
const unfilteredShapes = type.getUnionTypes().map((type) => ({
|
|
489
|
-
role: 'union_entry',
|
|
490
|
-
shape: (0, exports.getProperTypeShape)(type, atLocation, nextStack),
|
|
491
|
-
optional: false,
|
|
492
|
-
}));
|
|
493
|
-
const dedupedShapes = unfilteredShapes.filter((type, index, arr) => !arr.find((dup, dupIndex) => dup.shape === type.shape && dupIndex > index));
|
|
494
|
-
const isNullable = dedupedShapes.some((shape) => shape.shape === 'undefined');
|
|
495
|
-
const shapes = dedupedShapes.filter((shape) => shape.shape !== 'undefined');
|
|
496
|
-
if (shapes.length === 1) {
|
|
497
|
-
return shapes[0].shape;
|
|
498
|
-
}
|
|
499
|
-
return [
|
|
500
|
-
{
|
|
501
|
-
role: 'union',
|
|
502
|
-
shape: shapes,
|
|
503
|
-
optional: isNullable,
|
|
504
|
-
},
|
|
505
|
-
];
|
|
506
|
-
}
|
|
507
|
-
if (type.isIntersection()) {
|
|
508
|
-
const children = type.getIntersectionTypes();
|
|
509
|
-
const shapesOfChildren = children
|
|
510
|
-
.map((child) => (0, exports.getProperTypeShape)(child, atLocation, nextStack))
|
|
511
|
-
.filter((shape) => typeof shape !== 'string');
|
|
512
|
-
return shapesOfChildren.reduce((total, current) => [...total, ...current], []);
|
|
513
|
-
}
|
|
514
|
-
const fileName = atLocation.getSourceFile().getFilePath().split('/').pop();
|
|
515
|
-
logger_1.Logger.warn(`[${fileName}] Unknown type shape node ${typeOrPromise.getText()}`);
|
|
516
|
-
return 'unknown_5';
|
|
517
|
-
};
|
|
518
|
-
exports.getProperTypeShape = getProperTypeShape;
|
|
519
|
-
const getLiteralValueOfNode = (node) => {
|
|
520
|
-
if (node.isKind(ts_morph_1.SyntaxKind.Identifier)) {
|
|
521
|
-
return getLiteralValueOfNode((0, exports.findNodeImplementation)(node));
|
|
522
|
-
}
|
|
523
|
-
else if (node.isKind(ts_morph_1.SyntaxKind.StringLiteral)) {
|
|
524
|
-
return node.getLiteralValue();
|
|
525
|
-
}
|
|
526
|
-
else if (node.isKind(ts_morph_1.SyntaxKind.ArrayLiteralExpression)) {
|
|
527
|
-
return node.forEachChildAsArray().map((child) => getLiteralValueOfNode(child));
|
|
528
|
-
}
|
|
529
|
-
else if (node.isKind(ts_morph_1.SyntaxKind.PropertyAccessExpression)) {
|
|
530
|
-
return getLiteralValueOfNode((0, exports.findPropertyAssignmentValueNode)(node));
|
|
531
|
-
}
|
|
532
|
-
else if (node.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
|
|
533
|
-
return (0, exports.getValuesOfObjectLiteral)(node);
|
|
534
|
-
}
|
|
535
|
-
const fileName = node.getSourceFile().getFilePath().split('/').pop();
|
|
536
|
-
logger_1.Logger.dev(`[${fileName}] Unknown literal value node ${node.getKindName()}`);
|
|
537
|
-
return 'unknown_6';
|
|
538
|
-
};
|
|
539
|
-
const getValuesOfObjectLiteral = (objectLiteralNode) => {
|
|
540
|
-
const syntaxListNode = objectLiteralNode.getFirstDescendantByKind(ts_morph_1.SyntaxKind.SyntaxList);
|
|
541
|
-
const assignmentNodes = syntaxListNode.getChildrenOfKind(ts_morph_1.SyntaxKind.PropertyAssignment);
|
|
542
|
-
const properties = assignmentNodes.map((node) => {
|
|
543
|
-
const identifierNode = node.getFirstDescendantByKind(ts_morph_1.SyntaxKind.Identifier);
|
|
544
|
-
const identifierName = identifierNode.getText();
|
|
545
|
-
const assignmentValueNode = node.getLastChild();
|
|
546
|
-
const targetNode = (0, exports.findNodeImplementation)(assignmentValueNode);
|
|
547
|
-
const value = getLiteralValueOfNode(targetNode);
|
|
548
|
-
return {
|
|
549
|
-
identifier: identifierName,
|
|
550
|
-
value,
|
|
551
|
-
};
|
|
552
|
-
});
|
|
553
|
-
return properties || [];
|
|
554
|
-
};
|
|
555
|
-
exports.getValuesOfObjectLiteral = getValuesOfObjectLiteral;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseEndpoint.d.ts","sourceRoot":"","sources":["../../../../src/openapi/analyzerModule/parseEndpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,EAAE,EAAE,MAAM,UAAU,CAAA;AAG/C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAYvC,eAAO,MAAM,aAAa,SAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,kBAAkB,MAAM,iBAqHxE,CAAA"}
|