@nestia/sdk 14.0.0 → 14.0.2
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/README.md +1 -1
- package/assets/bundle/distribute/build-sdk.cjs +28 -0
- package/assets/bundle/distribute/package.json +7 -3
- package/assets/bundle/distribute/tsconfig.json +15 -105
- package/lib/INestiaConfig.d.ts +74 -34
- package/lib/NestiaSdkApplication.d.ts +60 -0
- package/lib/NestiaSdkApplication.js +121 -32
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.d.ts +21 -0
- package/lib/NestiaSwaggerComposer.js +32 -13
- package/lib/NestiaSwaggerComposer.js.map +1 -1
- package/lib/analyses/AccessorAnalyzer.d.ts +26 -0
- package/lib/analyses/AccessorAnalyzer.js +26 -0
- package/lib/analyses/AccessorAnalyzer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.d.ts +41 -0
- package/lib/analyses/ConfigAnalyzer.js +52 -77
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +25 -0
- package/lib/analyses/ImportAnalyzer.js +25 -0
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ParameterNameAnalyzer.d.ts +44 -0
- package/lib/analyses/ParameterNameAnalyzer.js +63 -0
- package/lib/analyses/ParameterNameAnalyzer.js.map +1 -0
- package/lib/analyses/PathAnalyzer.d.ts +93 -1
- package/lib/analyses/PathAnalyzer.js +160 -23
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectControllerAnalyzer.js +24 -1
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +35 -24
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +31 -0
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +21 -0
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +31 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +143 -23
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +27 -2
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectMcpOperationAnalyzer.js +35 -11
- package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMetadataAnalyzer.d.ts +47 -0
- package/lib/analyses/ReflectMetadataAnalyzer.js +47 -0
- package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +27 -5
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.d.ts +25 -0
- package/lib/analyses/SecurityAnalyzer.js +39 -19
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/analyses/SwaggerExampleAnalyzer.d.ts +31 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js +36 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +41 -3
- package/lib/analyses/TypedHttpRouteAnalyzer.js +196 -172
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +29 -0
- package/lib/analyses/TypedMcpRouteAnalyzer.js +152 -20
- package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +19 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +20 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
- package/lib/decorators/OperationMetadata.d.ts +6 -0
- package/lib/decorators/OperationMetadata.js +6 -0
- package/lib/decorators/OperationMetadata.js.map +1 -1
- package/lib/executable/internal/CommandParser.d.ts +19 -0
- package/lib/executable/internal/CommandParser.js +19 -0
- package/lib/executable/internal/CommandParser.js.map +1 -1
- package/lib/executable/internal/NestiaConfigLoader.d.ts +56 -0
- package/lib/executable/internal/NestiaConfigLoader.js +48 -42
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.d.ts +60 -0
- package/lib/executable/internal/NestiaSdkCommand.js +95 -3
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/internal/NestiaSdkWatcher.d.ts +81 -0
- package/lib/executable/internal/NestiaSdkWatcher.js +125 -41
- package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -1
- package/lib/executable/internal/NestiaSwaggerWatch.d.ts +80 -0
- package/lib/executable/internal/NestiaSwaggerWatch.js +308 -0
- package/lib/executable/internal/NestiaSwaggerWatch.js.map +1 -0
- package/lib/executable/sdk.js +16 -1
- package/lib/executable/sdk.js.map +1 -1
- package/lib/factories/ExpressionFactory.d.ts +18 -0
- package/lib/factories/ExpressionFactory.js +21 -2
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +24 -0
- package/lib/factories/IdentifierFactory.js +24 -0
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.d.ts +22 -4
- package/lib/factories/LiteralFactory.js +33 -11
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/factories/StatementFactory.d.ts +28 -1
- package/lib/factories/StatementFactory.js +28 -1
- package/lib/factories/StatementFactory.js.map +1 -1
- package/lib/factories/TypeFactory.d.ts +24 -0
- package/lib/factories/TypeFactory.js +15 -0
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/generates/CloneGenerator.d.ts +22 -0
- package/lib/generates/CloneGenerator.js +26 -5
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/E2eGenerator.d.ts +19 -0
- package/lib/generates/E2eGenerator.js +19 -0
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.d.ts +38 -0
- package/lib/generates/SdkGenerator.js +43 -5
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.d.ts +36 -6
- package/lib/generates/SwaggerGenerator.js +190 -40
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.d.ts +19 -0
- package/lib/generates/internal/E2eFileProgrammer.js +20 -1
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/FilePrinter.d.ts +57 -0
- package/lib/generates/internal/FilePrinter.js +74 -0
- package/lib/generates/internal/FilePrinter.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +93 -1
- package/lib/generates/internal/ImportDictionary.js +103 -2
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +121 -1
- package/lib/generates/internal/SdkAliasCollection.js +132 -11
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +19 -0
- package/lib/generates/internal/SdkDistributionComposer.js +149 -52
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkFileProgrammer.js +101 -12
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +29 -0
- package/lib/generates/internal/SdkHttpCloneProgrammer.js +33 -0
- package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpCloneReferencer.js +78 -25
- package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +40 -23
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +46 -34
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +142 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.js +175 -6
- package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +20 -0
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +36 -32
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +38 -0
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +66 -18
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.d.ts +63 -0
- package/lib/generates/internal/SdkImportWizard.js +63 -0
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +17 -2
- package/lib/generates/internal/SdkMcpRouteProgrammer.js +72 -24
- package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkPathTemplate.d.ts +36 -0
- package/lib/generates/internal/SdkPathTemplate.js +65 -0
- package/lib/generates/internal/SdkPathTemplate.js.map +1 -0
- package/lib/generates/internal/SdkRouteDirectory.d.ts +10 -0
- package/lib/generates/internal/SdkRouteDirectory.js +10 -0
- package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
- package/lib/generates/internal/SdkTypeProgrammer.d.ts +54 -1
- package/lib/generates/internal/SdkTypeProgrammer.js +111 -27
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +53 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.js +407 -67
- package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +40 -0
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +149 -142
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +46 -36
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +114 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +120 -5
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +75 -33
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +42 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationComposer.d.ts +18 -0
- package/lib/generates/internal/SwaggerOperationComposer.js +37 -8
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +40 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +230 -25
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +21 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +58 -7
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/internal/legacy.d.ts +342 -31
- package/lib/internal/legacy.js +207 -31
- package/lib/internal/legacy.js.map +1 -1
- package/lib/structures/INestiaProject.d.ts +10 -0
- package/lib/structures/INestiaSdkInput.d.ts +30 -0
- package/lib/structures/IOperationMetadata.d.ts +77 -0
- package/lib/structures/IReflectController.d.ts +10 -0
- package/lib/structures/IReflectHttpOperation.d.ts +10 -0
- package/lib/structures/IReflectHttpOperationException.d.ts +13 -2
- package/lib/structures/IReflectHttpOperationParameter.d.ts +55 -3
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +15 -3
- package/lib/structures/IReflectImport.d.ts +10 -0
- package/lib/structures/IReflectMcpOperation.d.ts +19 -0
- package/lib/structures/IReflectMcpOperationParameter.d.ts +9 -0
- package/lib/structures/IReflectOperationError.d.ts +28 -0
- package/lib/structures/IReflectOperationError.js +22 -2
- package/lib/structures/IReflectOperationError.js.map +1 -1
- package/lib/structures/IReflectType.d.ts +9 -0
- package/lib/structures/IReflectWebSocketOperation.d.ts +10 -0
- package/lib/structures/IReflectWebSocketOperationParameter.d.ts +55 -0
- package/lib/structures/ITypedApplication.d.ts +10 -0
- package/lib/structures/ITypedHttpRoute.d.ts +18 -0
- package/lib/structures/ITypedHttpRouteException.d.ts +13 -1
- package/lib/structures/ITypedHttpRouteParameter.d.ts +48 -1
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +13 -1
- package/lib/structures/ITypedMcpRoute.d.ts +11 -0
- package/lib/structures/ITypedWebSocketRoute.d.ts +18 -0
- package/lib/transform.d.ts +6 -0
- package/lib/transform.js +6 -0
- package/lib/transform.js.map +1 -1
- package/lib/utils/ArrayUtil.d.ts +31 -1
- package/lib/utils/ArrayUtil.js +32 -11
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/EmittedJavaScriptPatcher.d.ts +20 -0
- package/lib/utils/EmittedJavaScriptPatcher.js +65 -46
- package/lib/utils/EmittedJavaScriptPatcher.js.map +1 -1
- package/lib/utils/FileRetriever.d.ts +29 -0
- package/lib/utils/FileRetriever.js +29 -0
- package/lib/utils/FileRetriever.js.map +1 -1
- package/lib/utils/HttpResponseContentTypeUtil.d.ts +41 -0
- package/lib/utils/HttpResponseContentTypeUtil.js +31 -0
- package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -1
- package/lib/utils/MapUtil.d.ts +64 -1
- package/lib/utils/MapUtil.js +24 -3
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/PathUtil.d.ts +31 -0
- package/lib/utils/PathUtil.js +38 -0
- package/lib/utils/PathUtil.js.map +1 -1
- package/lib/utils/SdkBundlePath.d.ts +2 -0
- package/lib/utils/SdkBundlePath.js +10 -0
- package/lib/utils/SdkBundlePath.js.map +1 -0
- package/lib/utils/SdkInputFilter.d.ts +31 -0
- package/lib/utils/SdkInputFilter.js +115 -0
- package/lib/utils/SdkInputFilter.js.map +1 -0
- package/lib/utils/SourceFinder.d.ts +45 -0
- package/lib/utils/SourceFinder.js +74 -16
- package/lib/utils/SourceFinder.js.map +1 -1
- package/lib/utils/StringUtil.d.ts +77 -2
- package/lib/utils/StringUtil.js +166 -4
- package/lib/utils/StringUtil.js.map +1 -1
- package/lib/utils/TemporaryDirectory.d.ts +60 -0
- package/lib/utils/TemporaryDirectory.js +112 -0
- package/lib/utils/TemporaryDirectory.js.map +1 -0
- package/lib/utils/TsConfigReader.d.ts +42 -0
- package/lib/utils/TsConfigReader.js +98 -14
- package/lib/utils/TsConfigReader.js.map +1 -1
- package/lib/utils/TtscExecutor.d.ts +23 -1
- package/lib/utils/TtscExecutor.js +22 -0
- package/lib/utils/TtscExecutor.js.map +1 -1
- package/lib/utils/VersioningStrategy.d.ts +39 -2
- package/lib/utils/VersioningStrategy.js +46 -13
- package/lib/utils/VersioningStrategy.js.map +1 -1
- package/lib/validators/TextPlainValidator.d.ts +19 -0
- package/lib/validators/TextPlainValidator.js +19 -0
- package/lib/validators/TextPlainValidator.js.map +1 -1
- package/native/go.mod +1 -1
- package/native/go.sum +2 -2
- package/native/sdk/register.go +12 -2
- package/native/sdk/sdk_http_rules.go +210 -0
- package/native/sdk/sdk_metadata_json.go +79 -4
- package/native/sdk/sdk_transform.go +1157 -414
- package/package.json +8 -6
- package/src/INestiaConfig.ts +74 -34
- package/src/NestiaSdkApplication.ts +129 -41
- package/src/NestiaSwaggerComposer.ts +32 -14
- package/src/analyses/AccessorAnalyzer.ts +26 -0
- package/src/analyses/ConfigAnalyzer.ts +52 -90
- package/src/analyses/ImportAnalyzer.ts +25 -0
- package/src/analyses/ParameterNameAnalyzer.ts +75 -0
- package/src/analyses/PathAnalyzer.ts +167 -23
- package/src/analyses/ReflectControllerAnalyzer.ts +34 -1
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +36 -14
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +31 -0
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +153 -39
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +38 -7
- package/src/analyses/ReflectMcpOperationAnalyzer.ts +38 -3
- package/src/analyses/ReflectMetadataAnalyzer.ts +47 -0
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +40 -7
- package/src/analyses/SecurityAnalyzer.ts +45 -20
- package/src/analyses/SwaggerExampleAnalyzer.ts +39 -0
- package/src/analyses/TypedHttpRouteAnalyzer.ts +263 -198
- package/src/analyses/TypedMcpRouteAnalyzer.ts +180 -20
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +20 -0
- package/src/decorators/OperationMetadata.ts +6 -0
- package/src/executable/internal/CommandParser.ts +19 -0
- package/src/executable/internal/NestiaConfigLoader.ts +66 -50
- package/src/executable/internal/NestiaSdkCommand.ts +96 -3
- package/src/executable/internal/NestiaSdkWatcher.ts +172 -44
- package/src/executable/internal/NestiaSwaggerWatch.ts +359 -0
- package/src/executable/sdk.ts +24 -1
- package/src/factories/ExpressionFactory.ts +23 -2
- package/src/factories/IdentifierFactory.ts +24 -0
- package/src/factories/LiteralFactory.ts +51 -13
- package/src/factories/StatementFactory.ts +28 -1
- package/src/factories/TypeFactory.ts +24 -0
- package/src/generates/CloneGenerator.ts +26 -5
- package/src/generates/E2eGenerator.ts +19 -0
- package/src/generates/SdkGenerator.ts +43 -12
- package/src/generates/SwaggerGenerator.ts +229 -46
- package/src/generates/internal/E2eFileProgrammer.ts +20 -0
- package/src/generates/internal/FilePrinter.ts +71 -0
- package/src/generates/internal/ImportDictionary.ts +120 -2
- package/src/generates/internal/SdkAliasCollection.ts +144 -15
- package/src/generates/internal/SdkDistributionComposer.ts +181 -56
- package/src/generates/internal/SdkFileProgrammer.ts +126 -16
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +55 -0
- package/src/generates/internal/SdkHttpCloneReferencer.ts +97 -23
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +47 -30
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +53 -64
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +295 -13
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +37 -31
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +122 -18
- package/src/generates/internal/SdkImportWizard.ts +63 -0
- package/src/generates/internal/SdkMcpRouteProgrammer.ts +150 -33
- package/src/generates/internal/SdkPathTemplate.ts +88 -0
- package/src/generates/internal/SdkRouteDirectory.ts +10 -0
- package/src/generates/internal/SdkTypeProgrammer.ts +137 -36
- package/src/generates/internal/SdkTypeTagProgrammer.ts +536 -78
- package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +185 -142
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +62 -68
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +205 -5
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +89 -48
- package/src/generates/internal/SwaggerDescriptionComposer.ts +47 -1
- package/src/generates/internal/SwaggerOperationComposer.ts +38 -6
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +318 -36
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +74 -11
- package/src/internal/legacy-augmentation.d.ts +16 -0
- package/src/internal/legacy.ts +407 -49
- package/src/structures/INestiaProject.ts +10 -0
- package/src/structures/INestiaSdkInput.ts +30 -0
- package/src/structures/IOperationMetadata.ts +83 -0
- package/src/structures/IReflectController.ts +10 -0
- package/src/structures/IReflectHttpOperation.ts +10 -0
- package/src/structures/IReflectHttpOperationException.ts +17 -2
- package/src/structures/IReflectHttpOperationParameter.ts +56 -2
- package/src/structures/IReflectHttpOperationSuccess.ts +19 -3
- package/src/structures/IReflectImport.ts +10 -0
- package/src/structures/IReflectMcpOperation.ts +19 -0
- package/src/structures/IReflectMcpOperationParameter.ts +9 -0
- package/src/structures/IReflectOperationError.ts +31 -2
- package/src/structures/IReflectType.ts +9 -0
- package/src/structures/IReflectWebSocketOperation.ts +10 -0
- package/src/structures/IReflectWebSocketOperationParameter.ts +55 -0
- package/src/structures/ITypedApplication.ts +10 -0
- package/src/structures/ITypedHttpRoute.ts +18 -0
- package/src/structures/ITypedHttpRouteException.ts +14 -1
- package/src/structures/ITypedHttpRouteParameter.ts +48 -1
- package/src/structures/ITypedHttpRouteSuccess.ts +14 -1
- package/src/structures/ITypedMcpRoute.ts +12 -0
- package/src/structures/ITypedWebSocketRoute.ts +18 -0
- package/src/transform.ts +6 -0
- package/src/utils/ArrayUtil.ts +32 -13
- package/src/utils/EmittedJavaScriptPatcher.ts +70 -47
- package/src/utils/FileRetriever.ts +29 -0
- package/src/utils/HttpResponseContentTypeUtil.ts +41 -0
- package/src/utils/MapUtil.ts +68 -3
- package/src/utils/PathUtil.ts +38 -0
- package/src/utils/SdkBundlePath.ts +11 -0
- package/src/utils/SdkInputFilter.ts +108 -0
- package/src/utils/SourceFinder.ts +76 -18
- package/src/utils/StringUtil.ts +182 -5
- package/src/utils/TemporaryDirectory.ts +108 -0
- package/src/utils/TsConfigReader.ts +124 -26
- package/src/utils/TtscExecutor.ts +23 -1
- package/src/utils/VersioningStrategy.ts +51 -16
- package/src/validators/TextPlainValidator.ts +19 -0
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +0 -9
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +0 -178
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +0 -1
- package/lib/validators/HttpHeadersValidator.d.ts +0 -11
- package/lib/validators/HttpHeadersValidator.js +0 -15
- package/lib/validators/HttpHeadersValidator.js.map +0 -1
- package/lib/validators/HttpQueryValidator.d.ts +0 -10
- package/lib/validators/HttpQueryValidator.js +0 -14
- package/lib/validators/HttpQueryValidator.js.map +0 -1
- package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +0 -264
- package/src/validators/HttpHeadersValidator.ts +0 -12
- package/src/validators/HttpQueryValidator.ts +0 -11
|
@@ -1,7 +1,48 @@
|
|
|
1
1
|
import { INestApplication } from "@nestjs/common";
|
|
2
2
|
import { INestiaConfig } from "../INestiaConfig";
|
|
3
3
|
import { INestiaSdkInput } from "../structures/INestiaSdkInput";
|
|
4
|
+
/**
|
|
5
|
+
* Finds the controllers a configuration names, either by compiling and
|
|
6
|
+
* importing sources or by reading a running application.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation Sources are compiled once through ttsc into a temporary directory, imported, and the exports that carry the Nest `path` metadata are the controllers; an application is read from its module container; results are memoized per configuration object in a weakly keyed map, so a configuration the watcher reloads releases its entry with the object.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design Two public functions and a private runtime compiler; the output-specific bundle filter comes from SdkInputFilter and configuration/runtime materializations share the owned-child cleanup registry.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The generated SDK's own files are excluded from the input by the bundle list of the SDK, not by name, and the container is read through internals, as noted at `application`.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
12
|
+
* efficient algorithms: Discovery traverses candidate files once, compiles one runtime project and inspects every exported value; work scales with source/compiler input and export population. Application input instead traverses container controllers and resolves each unique class location.
|
|
13
|
+
* reuse equivalent work: The promise cache shares concurrent and completed analyses for the same config object. It assumes that object, its input sources and application state remain unchanged during its lifetime; callers must supply a fresh config object after changes. Bundle exclusion shares only installed asset descriptions and derives native/realpath roots separately for each output; distinct outputs never reuse one captured prefix.
|
|
14
|
+
* bound retention and release resources: The weakly keyed input map does not retain released config objects, but emitted directories are registered until owned generation cleanup or process exit. Imported CommonJS/ESM modules remain in the hosting Node loader; direct programmatic callers have no per-generation unload guarantee. CLI watch generations isolate this state in a short-lived child.
|
|
15
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
16
|
+
*/
|
|
4
17
|
export declare namespace ConfigAnalyzer {
|
|
18
|
+
/**
|
|
19
|
+
* Returns the analyzed input of a configuration: the controllers with their
|
|
20
|
+
* files and the global prefix and versioning options.
|
|
21
|
+
*
|
|
22
|
+
* The result is cached per configuration object.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation A function input is asked for the application and read as a running app; otherwise the matched TypeScript sources are compiled and imported, and the memo stores the promise so concurrent callers share one compilation.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One function delegating to `application` or to the runtime compiler.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The cache is keyed by the identity of the configuration object, so a different or reloaded configuration object is never served another's result; one object keeps its first result, which is the contract of a configuration that is not mutated between generations.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the two input forms and the caching.
|
|
28
|
+
* efficient algorithms: Discovery traverses candidate files once, compiles one runtime project and inspects every exported value; work scales with source/compiler input and export population. Application input instead traverses container controllers and resolves each unique class location.
|
|
29
|
+
* reuse equivalent work: The promise cache shares concurrent and completed analyses for the same config object. It assumes that object, its input sources and application state remain unchanged during its lifetime; callers must supply a fresh config object after changes. Bundle exclusion shares only installed asset descriptions and derives native/realpath roots separately for each output; distinct outputs never reuse one captured prefix.
|
|
30
|
+
* bound retention and release resources: The weakly keyed input map does not retain released config objects, but emitted directories are registered until owned generation cleanup or process exit. Imported CommonJS/ESM modules remain in the hosting Node loader; direct programmatic callers have no per-generation unload guarantee. CLI watch generations isolate this state in a short-lived child.
|
|
31
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
32
|
+
*/
|
|
5
33
|
const input: (config: INestiaConfig) => Promise<INestiaSdkInput>;
|
|
34
|
+
/**
|
|
35
|
+
* Reads the controllers, the global prefix, and the versioning options of a
|
|
36
|
+
* running NestJS application.
|
|
37
|
+
*
|
|
38
|
+
* @evidence contracts/common.md#principled-implementation The controllers come from the module container with their module paths, their files from the location of each class, decoded from the `file:` URL, and the prefix and versioning options from the application's configuration.
|
|
39
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
40
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts NestJS exposes no public accessor for the container or the configuration, so the function reads `app.container` and `app.config`; this is the one foreign-internal read of the package and stays a stated limit.
|
|
41
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what is read.
|
|
42
|
+
* efficient algorithms: The container is traversed once and a hash map groups each class with its module prefixes, so location lookup occurs once per unique controller class.
|
|
43
|
+
* reuse equivalent work: This invocation computes its own result and coordinates no completed or in-flight computation across requests.
|
|
44
|
+
* bound retention and release resources: The invocation retains local module/controller collections until it returns. The running application and its controllers remain caller-owned; this reader neither starts nor closes the app.
|
|
45
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
46
|
+
*/
|
|
6
47
|
const application: (app: INestApplication) => Promise<INestiaSdkInput>;
|
|
7
48
|
}
|
|
@@ -21,15 +21,44 @@ const get_function_location_1 = __importDefault(require("get-function-location")
|
|
|
21
21
|
const path_1 = __importDefault(require("path"));
|
|
22
22
|
const tstl_1 = require("tstl");
|
|
23
23
|
const url_1 = require("url");
|
|
24
|
-
const SdkGenerator_1 = require("../generates/SdkGenerator");
|
|
25
|
-
const ArrayUtil_1 = require("../utils/ArrayUtil");
|
|
26
24
|
const EmittedJavaScriptPatcher_1 = require("../utils/EmittedJavaScriptPatcher");
|
|
27
25
|
const MapUtil_1 = require("../utils/MapUtil");
|
|
26
|
+
const PathUtil_1 = require("../utils/PathUtil");
|
|
27
|
+
const SdkInputFilter_1 = require("../utils/SdkInputFilter");
|
|
28
28
|
const SourceFinder_1 = require("../utils/SourceFinder");
|
|
29
|
+
const TemporaryDirectory_1 = require("../utils/TemporaryDirectory");
|
|
29
30
|
const TsConfigReader_1 = require("../utils/TsConfigReader");
|
|
30
31
|
const TtscExecutor_1 = require("../utils/TtscExecutor");
|
|
32
|
+
/**
|
|
33
|
+
* Finds the controllers a configuration names, either by compiling and
|
|
34
|
+
* importing sources or by reading a running application.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation Sources are compiled once through ttsc into a temporary directory, imported, and the exports that carry the Nest `path` metadata are the controllers; an application is read from its module container; results are memoized per configuration object in a weakly keyed map, so a configuration the watcher reloads releases its entry with the object.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design Two public functions and a private runtime compiler; the output-specific bundle filter comes from SdkInputFilter and configuration/runtime materializations share the owned-child cleanup registry.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The generated SDK's own files are excluded from the input by the bundle list of the SDK, not by name, and the container is read through internals, as noted at `application`.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
40
|
+
* efficient algorithms: Discovery traverses candidate files once, compiles one runtime project and inspects every exported value; work scales with source/compiler input and export population. Application input instead traverses container controllers and resolves each unique class location.
|
|
41
|
+
* reuse equivalent work: The promise cache shares concurrent and completed analyses for the same config object. It assumes that object, its input sources and application state remain unchanged during its lifetime; callers must supply a fresh config object after changes. Bundle exclusion shares only installed asset descriptions and derives native/realpath roots separately for each output; distinct outputs never reuse one captured prefix.
|
|
42
|
+
* bound retention and release resources: The weakly keyed input map does not retain released config objects, but emitted directories are registered until owned generation cleanup or process exit. Imported CommonJS/ESM modules remain in the hosting Node loader; direct programmatic callers have no per-generation unload guarantee. CLI watch generations isolate this state in a short-lived child.
|
|
43
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
44
|
+
*/
|
|
31
45
|
var ConfigAnalyzer;
|
|
32
46
|
(function (ConfigAnalyzer) {
|
|
47
|
+
/**
|
|
48
|
+
* Returns the analyzed input of a configuration: the controllers with their
|
|
49
|
+
* files and the global prefix and versioning options.
|
|
50
|
+
*
|
|
51
|
+
* The result is cached per configuration object.
|
|
52
|
+
*
|
|
53
|
+
* @evidence contracts/common.md#principled-implementation A function input is asked for the application and read as a running app; otherwise the matched TypeScript sources are compiled and imported, and the memo stores the promise so concurrent callers share one compilation.
|
|
54
|
+
* @evidence contracts/common.md#clear-and-simple-design One function delegating to `application` or to the runtime compiler.
|
|
55
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The cache is keyed by the identity of the configuration object, so a different or reloaded configuration object is never served another's result; one object keeps its first result, which is the contract of a configuration that is not mutated between generations.
|
|
56
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the two input forms and the caching.
|
|
57
|
+
* efficient algorithms: Discovery traverses candidate files once, compiles one runtime project and inspects every exported value; work scales with source/compiler input and export population. Application input instead traverses container controllers and resolves each unique class location.
|
|
58
|
+
* reuse equivalent work: The promise cache shares concurrent and completed analyses for the same config object. It assumes that object, its input sources and application state remain unchanged during its lifetime; callers must supply a fresh config object after changes. Bundle exclusion shares only installed asset descriptions and derives native/realpath roots separately for each output; distinct outputs never reuse one captured prefix.
|
|
59
|
+
* bound retention and release resources: The weakly keyed input map does not retain released config objects, but emitted directories are registered until owned generation cleanup or process exit. Imported CommonJS/ESM modules remain in the hosting Node loader; direct programmatic callers have no per-generation unload guarantee. CLI watch generations isolate this state in a short-lived child.
|
|
60
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
61
|
+
*/
|
|
33
62
|
ConfigAnalyzer.input = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
34
63
|
return MapUtil_1.MapUtil.take(memory, config, () => __awaiter(this, void 0, void 0, function* () {
|
|
35
64
|
var _a;
|
|
@@ -44,7 +73,7 @@ var ConfigAnalyzer;
|
|
|
44
73
|
exclude: typeof config.input === "object" && !Array.isArray(config.input)
|
|
45
74
|
? ((_a = config.input.exclude) !== null && _a !== void 0 ? _a : [])
|
|
46
75
|
: [],
|
|
47
|
-
filter:
|
|
76
|
+
filter: yield SdkInputFilter_1.SdkInputFilter.create(config.output),
|
|
48
77
|
});
|
|
49
78
|
const runtime = yield RuntimeCompiler.compile(sources);
|
|
50
79
|
const controllers = [];
|
|
@@ -67,9 +96,22 @@ var ConfigAnalyzer;
|
|
|
67
96
|
};
|
|
68
97
|
}));
|
|
69
98
|
});
|
|
99
|
+
/**
|
|
100
|
+
* Reads the controllers, the global prefix, and the versioning options of a
|
|
101
|
+
* running NestJS application.
|
|
102
|
+
*
|
|
103
|
+
* @evidence contracts/common.md#principled-implementation The controllers come from the module container with their module paths, their files from the location of each class, decoded from the `file:` URL, and the prefix and versioning options from the application's configuration.
|
|
104
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
105
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts NestJS exposes no public accessor for the container or the configuration, so the function reads `app.container` and `app.config`; this is the one foreign-internal read of the package and stays a stated limit.
|
|
106
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what is read.
|
|
107
|
+
* efficient algorithms: The container is traversed once and a hash map groups each class with its module prefixes, so location lookup occurs once per unique controller class.
|
|
108
|
+
* reuse equivalent work: This invocation computes its own result and coordinates no completed or in-flight computation across requests.
|
|
109
|
+
* bound retention and release resources: The invocation retains local module/controller collections until it returns. The running application and its controllers remain caller-owned; this reader neither starts nor closes the app.
|
|
110
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source/controller identity is obtained from Node path/file-URL conversion, module resolution and native fs. Compiler projects use explicit cwd and native paths; emitted module imports use file URLs. Route prefix/version spelling is kept as protocol text, not treated as filesystem identity.
|
|
111
|
+
*/
|
|
70
112
|
ConfigAnalyzer.application = (app) => __awaiter(this, void 0, void 0, function* () {
|
|
71
113
|
var _a, _b, _c, _d;
|
|
72
|
-
var _e, _f, _g, _h;
|
|
114
|
+
var _e, _f, _g, _h, _j;
|
|
73
115
|
const container = app.container;
|
|
74
116
|
const modules = [...container.getModules().values()].filter((m) => !!m.controllers.size);
|
|
75
117
|
const unique = new tstl_1.HashMap();
|
|
@@ -84,7 +126,7 @@ var ConfigAnalyzer;
|
|
|
84
126
|
const file = (_g = (_a = (yield (0, get_function_location_1.default)(it.first))) === null || _a === void 0 ? void 0 : _a.source) !== null && _g !== void 0 ? _g : null;
|
|
85
127
|
if (file === null)
|
|
86
128
|
continue;
|
|
87
|
-
const location =
|
|
129
|
+
const location = PathUtil_1.PathUtil.location(file);
|
|
88
130
|
if (location.length === 0)
|
|
89
131
|
continue;
|
|
90
132
|
controllers.push({
|
|
@@ -105,15 +147,15 @@ var ConfigAnalyzer;
|
|
|
105
147
|
versioning: versioning === undefined || versioning.type !== common_1.VersioningType.URI
|
|
106
148
|
? undefined
|
|
107
149
|
: {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
150
|
+
// as NestJS's RoutePathFactory.getVersionPrefix(): `false` is no
|
|
151
|
+
// prefix at all, and only an absent one is the default "v"
|
|
152
|
+
prefix: versioning.prefix === false ? "" : ((_j = versioning.prefix) !== null && _j !== void 0 ? _j : "v"),
|
|
111
153
|
defaultVersion: versioning.defaultVersion,
|
|
112
154
|
},
|
|
113
155
|
};
|
|
114
156
|
});
|
|
115
157
|
})(ConfigAnalyzer || (exports.ConfigAnalyzer = ConfigAnalyzer = {}));
|
|
116
|
-
const memory = new
|
|
158
|
+
const memory = new WeakMap();
|
|
117
159
|
class RuntimeCompiler {
|
|
118
160
|
constructor(cwd, outDir) {
|
|
119
161
|
this.cwd = cwd;
|
|
@@ -124,9 +166,7 @@ class RuntimeCompiler {
|
|
|
124
166
|
var _a;
|
|
125
167
|
const cwd = process.cwd();
|
|
126
168
|
const runtimeRoot = path_1.default.join(cwd, "node_modules", ".nestia", "runtime");
|
|
127
|
-
|
|
128
|
-
ensureRuntimeCleanup(runtimeRoot);
|
|
129
|
-
const outDir = yield fs_1.default.promises.mkdtemp(path_1.default.join(runtimeRoot, "run-"));
|
|
169
|
+
const outDir = TemporaryDirectory_1.TemporaryDirectory.create(runtimeRoot, "run-");
|
|
130
170
|
const project = path_1.default.join(cwd, `.nestia.runtime.${process.pid}.${Date.now()}.json`);
|
|
131
171
|
const relative = (file) => path_1.default.relative(cwd, file).split("\\").join("/");
|
|
132
172
|
yield fs_1.default.promises.writeFile(project, JSON.stringify({
|
|
@@ -167,41 +207,6 @@ class RuntimeCompiler {
|
|
|
167
207
|
return emitted;
|
|
168
208
|
}
|
|
169
209
|
}
|
|
170
|
-
const RUNTIME_ROOTS = new Set();
|
|
171
|
-
let RUNTIME_CLEANUP_REGISTERED = false;
|
|
172
|
-
const ensureRuntimeCleanup = (runtimeRoot) => {
|
|
173
|
-
RUNTIME_ROOTS.add(runtimeRoot);
|
|
174
|
-
if (RUNTIME_CLEANUP_REGISTERED === true)
|
|
175
|
-
return;
|
|
176
|
-
RUNTIME_CLEANUP_REGISTERED = true;
|
|
177
|
-
const sweep = () => {
|
|
178
|
-
for (const location of RUNTIME_ROOTS)
|
|
179
|
-
fs_1.default.rmSync(location, { force: true, recursive: true });
|
|
180
|
-
};
|
|
181
|
-
process.once("exit", sweep);
|
|
182
|
-
// process.once("exit", …) does not fire on SIGINT/SIGTERM. Without these
|
|
183
|
-
// handlers a Ctrl-C during codegen leaves `run-*` mkdtemp directories
|
|
184
|
-
// behind under node_modules/.nestia/runtime/ until a subsequent clean exit.
|
|
185
|
-
// The module-level RUNTIME_CLEANUP_REGISTERED flag above guards against
|
|
186
|
-
// re-entrancy within this module; we deliberately do NOT gate on
|
|
187
|
-
// `process.listenerCount(signal) > 0` because NestiaConfigLoader's parallel
|
|
188
|
-
// sweep registers first, and that gate would skip our registration —
|
|
189
|
-
// leaving RUNTIME_ROOTS unswept on Ctrl-C while config-loader cleans up.
|
|
190
|
-
// Windows note: `process.kill(pid, "SIGINT")` calls TerminateProcess
|
|
191
|
-
// rather than re-raising through the listener queue, so the handler
|
|
192
|
-
// cascade documented above only holds on POSIX. On Windows, whichever
|
|
193
|
-
// module registers FIRST runs its sweep and the second is skipped —
|
|
194
|
-
// RUNTIME_ROOTS cleanup is best-effort there. SIGHUP is a no-op for
|
|
195
|
-
// most common code paths on Windows (Node fires it on console-close
|
|
196
|
-
// and exits within seconds).
|
|
197
|
-
const onSignal = (signal) => {
|
|
198
|
-
sweep();
|
|
199
|
-
process.kill(process.pid, signal);
|
|
200
|
-
};
|
|
201
|
-
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
202
|
-
process.once(signal, onSignal);
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
210
|
const sdkTransformEnv = () => process.env.NESTIA_SDK_TRANSFORM === undefined
|
|
206
211
|
? { NESTIA_SDK_TRANSFORM: "1" }
|
|
207
212
|
: {};
|
|
@@ -243,35 +248,5 @@ const normalizeProjectPath = (project) => {
|
|
|
243
248
|
const next = project !== null && project !== void 0 ? project : "tsconfig.json";
|
|
244
249
|
return path_1.default.isAbsolute(next) || next.startsWith(".") ? next : `./${next}`;
|
|
245
250
|
};
|
|
246
|
-
const normalize_file = (str) => str.substring(str.startsWith("file:///")
|
|
247
|
-
? process.cwd()[0] === "/"
|
|
248
|
-
? 7
|
|
249
|
-
: 8
|
|
250
|
-
: str.startsWith("file://")
|
|
251
|
-
? 7
|
|
252
|
-
: 0);
|
|
253
|
-
const filter = (config) => (location) => __awaiter(void 0, void 0, void 0, function* () {
|
|
254
|
-
return SourceFinder_1.SourceFinder.isTypeScriptSource(location) &&
|
|
255
|
-
(config.output === undefined ||
|
|
256
|
-
(location.indexOf(path_1.default.join(config.output, "functional")) === -1 &&
|
|
257
|
-
(yield (yield bundler.get(config.output))(location))) === false);
|
|
258
|
-
});
|
|
259
251
|
const dynamicImport = Function("specifier", "return import(specifier);");
|
|
260
|
-
const bundler = new tstl_1.Singleton((output) => __awaiter(void 0, void 0, void 0, function* () {
|
|
261
|
-
const assets = yield fs_1.default.promises.readdir(SdkGenerator_1.SdkGenerator.BUNDLE_PATH);
|
|
262
|
-
const tuples = yield ArrayUtil_1.ArrayUtil.asyncMap(assets, (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
263
|
-
const relative = path_1.default.join(output, file);
|
|
264
|
-
const location = path_1.default.join(SdkGenerator_1.SdkGenerator.BUNDLE_PATH, file);
|
|
265
|
-
const stats = yield fs_1.default.promises.stat(location);
|
|
266
|
-
return new tstl_1.Pair(relative, stats.isDirectory());
|
|
267
|
-
}));
|
|
268
|
-
return (file) => __awaiter(void 0, void 0, void 0, function* () {
|
|
269
|
-
for (const it of tuples)
|
|
270
|
-
if (it.second === false && file === it.first)
|
|
271
|
-
return true;
|
|
272
|
-
else if (it.second === true && file.indexOf(it.first) === 0)
|
|
273
|
-
return true;
|
|
274
|
-
return false;
|
|
275
|
-
});
|
|
276
|
-
}));
|
|
277
252
|
//# sourceMappingURL=ConfigAnalyzer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigAnalyzer.js","sourceRoot":"","sources":["../../src/analyses/ConfigAnalyzer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,8DAA8D;AAC9D,2CAAkE;AAClE,wDAAuD;AAGvD,4CAAoB;AACpB,kFAAwD;AACxD,gDAAwB;AACxB,+BAAgD;AAChD,6BAAoC;AAGpC,4DAAyD;AAEzD,kDAA+C;AAC/C,gFAA6E;AAC7E,8CAA2C;AAC3C,wDAAqD;AACrD,4DAAyD;AACzD,wDAAqD;AAErD,IAAiB,cAAc,CAoG9B;AApGD,WAAiB,cAAc;IAChB,oBAAK,GAAG,CACnB,MAAqB,EACK,EAAE;QAC5B,OAAO,iBAAO,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAS,EAAE;;YAC7C,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,UAAU;gBACpC,OAAO,0BAAW,CAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAE3C,MAAM,OAAO,GAAa,MAAM,2BAAY,CAAC,IAAI,CAAC;gBAChD,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;oBAClC,CAAC,CAAC,MAAM,CAAC,KAAK;oBACd,CAAC,CAAC,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ;wBAChC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO;wBACtB,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;gBACpB,OAAO,EACL,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;oBAC9D,CAAC,CAAC,OAAC,MAAM,CAAC,KAAK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OAAO,cAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;AAC5E,CAAC,CAAC;AAEF,MAAM,aAAa,GAAwC,QAAQ,CACjE,WAAW,EACX,2BAA2B,CACW,CAAC"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { IReflectImport } from "../structures/IReflectImport";
|
|
2
|
+
/**
|
|
3
|
+
* Helpers for the import lists of routes.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation The namespace merges the imports collected for one route and keeps a removal notice for the old analysis entry.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The merge is generic.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
9
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
10
|
+
*/
|
|
2
11
|
export declare namespace ImportAnalyzer {
|
|
3
12
|
/**
|
|
4
13
|
* @deprecated Removed in the Go-migration cycle. Import metadata is now
|
|
@@ -8,7 +17,23 @@ export declare namespace ImportAnalyzer {
|
|
|
8
17
|
* `ts.SourceFile` to derive imports should read the metadata delivered
|
|
9
18
|
* through `Reflect.getMetadata("nestia/OperationMetadata", …)` instead. See
|
|
10
19
|
* `packages/core/MIGRATION.md`.
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The function exists only to give an actionable error to a caller of the removed API, and always throws.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One statement.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reports the removal instead of failing later with a missing function.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the replacement.
|
|
24
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer.analyze analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
11
25
|
*/
|
|
12
26
|
const analyze: () => never;
|
|
27
|
+
/**
|
|
28
|
+
* Merges import records by file: namespace imports and default imports are
|
|
29
|
+
* deduplicated and sorted, and the named elements of every import of a file
|
|
30
|
+
* are combined with their aliases.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/common.md#principled-implementation Imports are grouped by file, each group emits its namespace imports, default imports, and one element list with an alias map for renamed elements, so the same file is imported once per kind.
|
|
33
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over one group merger.
|
|
34
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The merge follows the import records, with no file special-cased.
|
|
35
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the grouping and the merging.
|
|
36
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer.merge analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
37
|
+
*/
|
|
13
38
|
const merge: (imports: IReflectImport[]) => IReflectImport[];
|
|
14
39
|
}
|
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ImportAnalyzer = void 0;
|
|
4
4
|
const MapUtil_1 = require("../utils/MapUtil");
|
|
5
|
+
/**
|
|
6
|
+
* Helpers for the import lists of routes.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The namespace merges the imports collected for one route and keeps a removal notice for the old analysis entry.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The merge is generic.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
13
|
+
*/
|
|
5
14
|
var ImportAnalyzer;
|
|
6
15
|
(function (ImportAnalyzer) {
|
|
7
16
|
/**
|
|
@@ -12,12 +21,28 @@ var ImportAnalyzer;
|
|
|
12
21
|
* `ts.SourceFile` to derive imports should read the metadata delivered
|
|
13
22
|
* through `Reflect.getMetadata("nestia/OperationMetadata", …)` instead. See
|
|
14
23
|
* `packages/core/MIGRATION.md`.
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The function exists only to give an actionable error to a caller of the removed API, and always throws.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One statement.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reports the removal instead of failing later with a missing function.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the replacement.
|
|
28
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer.analyze analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
15
29
|
*/
|
|
16
30
|
ImportAnalyzer.analyze = () => {
|
|
17
31
|
throw new Error("ImportAnalyzer.analyze was removed in @nestia/sdk@next. " +
|
|
18
32
|
"Imports are now attached by the native transformer; read them from " +
|
|
19
33
|
"IOperationMetadata.imports (see packages/core/MIGRATION.md).");
|
|
20
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* Merges import records by file: namespace imports and default imports are
|
|
37
|
+
* deduplicated and sorted, and the named elements of every import of a file
|
|
38
|
+
* are combined with their aliases.
|
|
39
|
+
*
|
|
40
|
+
* @evidence contracts/common.md#principled-implementation Imports are grouped by file, each group emits its namespace imports, default imports, and one element list with an alias map for renamed elements, so the same file is imported once per kind.
|
|
41
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over one group merger.
|
|
42
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The merge follows the import records, with no file special-cased.
|
|
43
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the grouping and the merging.
|
|
44
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ImportAnalyzer.merge analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
45
|
+
*/
|
|
21
46
|
ImportAnalyzer.merge = (imports) => {
|
|
22
47
|
// group by files
|
|
23
48
|
const fileGroups = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImportAnalyzer.js","sourceRoot":"","sources":["../../src/analyses/ImportAnalyzer.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAE3C,IAAiB,cAAc,
|
|
1
|
+
{"version":3,"file":"ImportAnalyzer.js","sourceRoot":"","sources":["../../src/analyses/ImportAnalyzer.ts"],"names":[],"mappings":";;;AACA,8CAA2C;AAE3C;;;;;;;;GAQG;AACH,IAAiB,cAAc,CAgH9B;AAhHD,WAAiB,cAAc;IAC7B;;;;;;;;;;;;;OAaG;IACU,sBAAO,GAAG,GAAU,EAAE;QACjC,MAAM,IAAI,KAAK,CACb,0DAA0D;YACxD,qEAAqE;YACrE,8DAA8D,CACjE,CAAC;IACJ,CAAC,CAAC;IAEF;;;;;;;;;;OAUG;IACU,oBAAK,GAAG,CAAC,OAAyB,EAAoB,EAAE;QACnE,iBAAiB;QACjB,MAAM,UAAU,GAAkC,IAAI,GAAG,EAAE,CAAC;QAC5D,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAqB,iBAAO,CAAC,IAAI,CAC1C,UAAU,EACV,GAAG,CAAC,IAAI,EACR,GAAG,EAAE,CAAC,EAAE,CACT,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;aACpC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,UAAU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AAS,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACrD,MAAM,cAAc,GAA2B,EAAE,CAAC;YAClD,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;gBACvC,IAAI,QAAQ,KAAK,KAAK;oBAAE,cAAc,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;YAC3D,CAAC;YACD,MAAM,MAAM,SAAmB,cAAc,CAAC,CAAC,CAAC,mCAAI;gBAClD,IAAI;gBACJ,QAAQ,EAAE,EAAE;gBACZ,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3B,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,KAAK,CAAC;gBAC1C,MAAM,CAAC,cAAc,GAAG,cAAc,CAAC;YACzC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;gBAAE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,CAAC,GAAG,cAAc,EAAE,GAAG,cAAc,CAAC,CAAC;IAChD,CAAC;AACH,CAAC,EAhHgB,cAAc,aAAd,cAAc,GAAd,cAAc,QAgH9B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gives names to parameters that declare none, such as destructured ones.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation A missing name is derived from the field, camel-cased when it is not an identifier, or from the category, and then made unique against the names already taken.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design One function, one record type, and one private candidate rule.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule is generic.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
8
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ParameterNameAnalyzer analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
9
|
+
*/
|
|
10
|
+
export declare namespace ParameterNameAnalyzer {
|
|
11
|
+
/**
|
|
12
|
+
* A parameter to name: its current name, its category, and an optional field.
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/common.md#principled-implementation The three members are the inputs of the naming rule.
|
|
15
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
16
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
17
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes and the meaning of its members.
|
|
18
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ParameterNameAnalyzer.IParameter analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
19
|
+
*/
|
|
20
|
+
interface IParameter {
|
|
21
|
+
name: string;
|
|
22
|
+
category: string;
|
|
23
|
+
field?: string | null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Names every parameter that declares no name of its own.
|
|
27
|
+
*
|
|
28
|
+
* A destructured parameter, `@TypedBody() { title }: IBody`, binds names but
|
|
29
|
+
* is not one, so the SDK's metadata carries it with an empty name. Its source
|
|
30
|
+
* text is no identifier the SDK could declare, and passing it as one would
|
|
31
|
+
* send `{ title }` alone. It is named after what it carries instead: its
|
|
32
|
+
* field when that is an identifier, or reads as one with its separators
|
|
33
|
+
* dropped in camel case, otherwise its category, such as `body` or `query`.
|
|
34
|
+
* The name yields to every other parameter's, which are the user's and are
|
|
35
|
+
* kept.
|
|
36
|
+
*
|
|
37
|
+
* @evidence contracts/common.md#principled-implementation The names in use are collected first, and each new name is escaped against them with underscores and added, so the result has no duplicates.
|
|
38
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
39
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing names are never changed.
|
|
40
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the rule.
|
|
41
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ParameterNameAnalyzer.name analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
42
|
+
*/
|
|
43
|
+
const name: <T extends IParameter>(parameters: T[]) => T[];
|
|
44
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParameterNameAnalyzer = void 0;
|
|
4
|
+
const utils_1 = require("@typia/utils");
|
|
5
|
+
const StringUtil_1 = require("../utils/StringUtil");
|
|
6
|
+
/**
|
|
7
|
+
* Gives names to parameters that declare none, such as destructured ones.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation A missing name is derived from the field, camel-cased when it is not an identifier, or from the category, and then made unique against the names already taken.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One function, one record type, and one private candidate rule.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule is generic.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ParameterNameAnalyzer analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
14
|
+
*/
|
|
15
|
+
var ParameterNameAnalyzer;
|
|
16
|
+
(function (ParameterNameAnalyzer) {
|
|
17
|
+
/**
|
|
18
|
+
* Names every parameter that declares no name of its own.
|
|
19
|
+
*
|
|
20
|
+
* A destructured parameter, `@TypedBody() { title }: IBody`, binds names but
|
|
21
|
+
* is not one, so the SDK's metadata carries it with an empty name. Its source
|
|
22
|
+
* text is no identifier the SDK could declare, and passing it as one would
|
|
23
|
+
* send `{ title }` alone. It is named after what it carries instead: its
|
|
24
|
+
* field when that is an identifier, or reads as one with its separators
|
|
25
|
+
* dropped in camel case, otherwise its category, such as `body` or `query`.
|
|
26
|
+
* The name yields to every other parameter's, which are the user's and are
|
|
27
|
+
* kept.
|
|
28
|
+
*
|
|
29
|
+
* @evidence contracts/common.md#principled-implementation The names in use are collected first, and each new name is escaped against them with underscores and added, so the result has no duplicates.
|
|
30
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
31
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Existing names are never changed.
|
|
32
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the rule.
|
|
33
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ParameterNameAnalyzer.name analyzes reflected route metadata; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
34
|
+
*/
|
|
35
|
+
ParameterNameAnalyzer.name = (parameters) => {
|
|
36
|
+
const taken = parameters
|
|
37
|
+
.map((p) => p.name)
|
|
38
|
+
.filter((name) => name.length !== 0);
|
|
39
|
+
return parameters.map((p) => {
|
|
40
|
+
if (p.name.length !== 0)
|
|
41
|
+
return p;
|
|
42
|
+
const name = StringUtil_1.StringUtil.escapeDuplicate(taken)(candidate(p));
|
|
43
|
+
taken.push(name);
|
|
44
|
+
return Object.assign(Object.assign({}, p), { name });
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const candidate = (p) => {
|
|
48
|
+
if (p.field !== undefined && p.field !== null && p.field.length !== 0) {
|
|
49
|
+
if (utils_1.NamingConvention.variable(p.field))
|
|
50
|
+
return p.field;
|
|
51
|
+
// `x-tenant` as `xTenant`
|
|
52
|
+
const camel = p.field
|
|
53
|
+
.split(/[^A-Za-z0-9_$]+/)
|
|
54
|
+
.filter((word) => word.length !== 0)
|
|
55
|
+
.map((word, i) => i === 0 ? word : word.charAt(0).toUpperCase() + word.slice(1))
|
|
56
|
+
.join("");
|
|
57
|
+
if (utils_1.NamingConvention.variable(camel))
|
|
58
|
+
return camel;
|
|
59
|
+
}
|
|
60
|
+
return p.category;
|
|
61
|
+
};
|
|
62
|
+
})(ParameterNameAnalyzer || (exports.ParameterNameAnalyzer = ParameterNameAnalyzer = {}));
|
|
63
|
+
//# sourceMappingURL=ParameterNameAnalyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParameterNameAnalyzer.js","sourceRoot":"","sources":["../../src/analyses/ParameterNameAnalyzer.ts"],"names":[],"mappings":";;;AAAA,wCAAgD;AAEhD,oDAAiD;AAEjD;;;;;;;;GAQG;AACH,IAAiB,qBAAqB,CA6DrC;AA7DD,WAAiB,qBAAqB;IAgBpC;;;;;;;;;;;;;;;;;OAiBG;IACU,0BAAI,GAAG,CAAuB,UAAe,EAAO,EAAE;QACjE,MAAM,KAAK,GAAa,UAAU;aAC/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aAClB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;QACvC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1B,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAC;YAClC,MAAM,IAAI,GAAW,uBAAU,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACrE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjB,uCAAY,CAAC,KAAE,IAAI,IAAG;QACxB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,CAAa,EAAU,EAAE;QAC1C,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtE,IAAI,wBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAC,KAAK,CAAC;YACvD,0BAA0B;YAC1B,MAAM,KAAK,GAAW,CAAC,CAAC,KAAK;iBAC1B,KAAK,CAAC,iBAAiB,CAAC;iBACxB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC;iBACnC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CACf,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAC9D;iBACA,IAAI,CAAC,EAAE,CAAC,CAAC;YACZ,IAAI,wBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,OAAO,KAAK,CAAC;QACrD,CAAC;QACD,OAAO,CAAC,CAAC,QAAQ,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC,EA7DgB,qBAAqB,aAArB,qBAAqB,GAArB,qBAAqB,QA6DrC"}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { RequestMethod } from "@nestjs/common";
|
|
2
|
+
/**
|
|
3
|
+
* Helpers for route paths: joining, prefixing, and reading their parameters the
|
|
4
|
+
* way the router does.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation Paths are parsed by `path-to-regexp` after Fastify colon escapes are converted, so the parameters and literals are those the server reads.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design Several small functions over one tokenizer and one parser.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The router's own grammar decides, and no path is special-cased.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
10
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
11
|
+
*/
|
|
2
12
|
export declare namespace PathAnalyzer {
|
|
13
|
+
/**
|
|
14
|
+
* The route paths joined as the router joins them: one `/` between them, and
|
|
15
|
+
* none doubled. A route path is router syntax, never a file path, so a
|
|
16
|
+
* backslash stays the escape of the character after it (`items\\:batchGet`).
|
|
17
|
+
*
|
|
18
|
+
* @evidence contracts/common.md#principled-implementation The parts are joined, split on slashes, and empty segments are dropped, so any number of slashes at the boundaries collapses.
|
|
19
|
+
* @evidence contracts/common.md#clear-and-simple-design One expression.
|
|
20
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It applies to every input.
|
|
21
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result form.
|
|
22
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.join interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
23
|
+
*/
|
|
3
24
|
export const join: (...args: string[]) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Joins a path with the global prefix, unless the route is excluded from the
|
|
27
|
+
* prefix.
|
|
28
|
+
*
|
|
29
|
+
* @evidence contracts/common.md#principled-implementation The exclusion list is matched by method and by exact path or pattern, as NestJS does, and an excluded route is joined with an empty prefix.
|
|
30
|
+
* @evidence contracts/common.md#clear-and-simple-design One function delegating the exclusion test to a private helper.
|
|
31
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The exclusion rule is NestJS's.
|
|
32
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the exclusion.
|
|
33
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.joinWithGlobalPrefix interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
34
|
+
*/
|
|
4
35
|
export const joinWithGlobalPrefix: (props: {
|
|
5
36
|
globalPrefix: string;
|
|
6
37
|
exclude: IGlobalPrefixExclude[] | undefined;
|
|
@@ -8,7 +39,68 @@ export declare namespace PathAnalyzer {
|
|
|
8
39
|
method: string;
|
|
9
40
|
path: string;
|
|
10
41
|
}) => string;
|
|
11
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Whether a route path holds a wildcard: a `*` not escaped as the literal
|
|
44
|
+
* character (`\\*`), which a route path may hold since #1713.
|
|
45
|
+
*
|
|
46
|
+
* @evidence contracts/common.md#principled-implementation A star preceded by a backslash is a literal, so the test looks for a star at the start or after a non-backslash character.
|
|
47
|
+
* @evidence contracts/common.md#clear-and-simple-design One regular expression.
|
|
48
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the router's escaping rule.
|
|
49
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the escaped case.
|
|
50
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.wildcard interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
51
|
+
*/
|
|
52
|
+
export const wildcard: (str: string) => boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The literal text and parameters of a path, in order, as path-to-regexp
|
|
55
|
+
* reads it: `/files/:id.json` is `/files/`, the parameter `id`, then `.json`,
|
|
56
|
+
* and `/range/:from-:to` holds two parameters parted by `-`. Every generator
|
|
57
|
+
* that writes a path with its parameters filled in reads it from here, never
|
|
58
|
+
* by splitting the text at `:` or `/`. `null` for a path it cannot parse.
|
|
59
|
+
*
|
|
60
|
+
* @evidence contracts/common.md#principled-implementation Tokens come from `path-to-regexp`, so text next to a parameter in one segment, such as `/files/:id.json`, is kept in place, adjacent literals merge, and an unnamed parameter makes the path unreadable.
|
|
61
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over the tokenizer.
|
|
62
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The grammar is the router's.
|
|
63
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result and why generators use it.
|
|
64
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.segments interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
65
|
+
*/
|
|
66
|
+
export const segments: (str: string) => ISegment[] | null;
|
|
67
|
+
/**
|
|
68
|
+
* The path in OpenAPI's template syntax, each parameter written `{name}`:
|
|
69
|
+
* `/files/:id.json` is `/files/{id}.json`.
|
|
70
|
+
*
|
|
71
|
+
* @evidence contracts/common.md#principled-implementation The segments are joined with literals verbatim and parameters in braces.
|
|
72
|
+
* @evidence contracts/common.md#clear-and-simple-design One expression over `segments`.
|
|
73
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It uses the same segmenter as the SDK generator.
|
|
74
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the fallback.
|
|
75
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.toOpenApi interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
76
|
+
*/
|
|
77
|
+
export const toOpenApi: (str: string) => string;
|
|
78
|
+
/**
|
|
79
|
+
* A segment of a path: literal text or a named parameter.
|
|
80
|
+
*
|
|
81
|
+
* @evidence contracts/common.md#principled-implementation The union is discriminated by `type`, so a consumer handles each case once.
|
|
82
|
+
* @evidence contracts/common.md#clear-and-simple-design A two-member union.
|
|
83
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
84
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the two cases.
|
|
85
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.ISegment interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
86
|
+
*/
|
|
87
|
+
export type ISegment = {
|
|
88
|
+
type: "literal";
|
|
89
|
+
value: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: "param";
|
|
92
|
+
name: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Returns the names of the parameters of a path, or `null` when the path
|
|
96
|
+
* cannot be parsed.
|
|
97
|
+
*
|
|
98
|
+
* @evidence contracts/common.md#principled-implementation The parsed arguments are filtered to the parameters, and an empty parameter name makes the path unreadable.
|
|
99
|
+
* @evidence contracts/common.md#clear-and-simple-design One filter over the private parser.
|
|
100
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The grammar is the router's.
|
|
101
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
102
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation PathAnalyzer.parameters interprets router protocol paths; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
103
|
+
*/
|
|
12
104
|
export const parameters: (str: string) => string[] | null;
|
|
13
105
|
interface IGlobalPrefixExclude {
|
|
14
106
|
path: string;
|