@nestia/sdk 14.0.1 → 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/assets/bundle/distribute/build-sdk.cjs +28 -0
- package/assets/bundle/distribute/package.json +6 -2
- package/lib/INestiaConfig.d.ts +55 -24
- package/lib/NestiaSdkApplication.d.ts +60 -0
- package/lib/NestiaSdkApplication.js +63 -5
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.d.ts +21 -0
- package/lib/NestiaSwaggerComposer.js +21 -3
- 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 +48 -73
- 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 +24 -0
- package/lib/analyses/ParameterNameAnalyzer.js +15 -0
- package/lib/analyses/ParameterNameAnalyzer.js.map +1 -1
- package/lib/analyses/PathAnalyzer.d.ts +63 -1
- package/lib/analyses/PathAnalyzer.js +54 -9
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectControllerAnalyzer.js +22 -0
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +28 -17
- 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 +21 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +22 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectMcpOperationAnalyzer.js +30 -9
- 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 +21 -2
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.d.ts +15 -0
- package/lib/analyses/SecurityAnalyzer.js +15 -0
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/analyses/SwaggerExampleAnalyzer.d.ts +16 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js +16 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -1
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +41 -3
- package/lib/analyses/TypedHttpRouteAnalyzer.js +172 -157
- 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 +19 -0
- 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 +122 -38
- 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/factories/ExpressionFactory.d.ts +17 -2
- package/lib/factories/ExpressionFactory.js +17 -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 +30 -10
- 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 +40 -2
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.d.ts +36 -6
- package/lib/generates/SwaggerGenerator.js +55 -13
- 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 +43 -0
- package/lib/generates/internal/FilePrinter.js +43 -0
- package/lib/generates/internal/FilePrinter.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +92 -2
- package/lib/generates/internal/ImportDictionary.js +91 -3
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +119 -0
- package/lib/generates/internal/SdkAliasCollection.js +124 -7
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +19 -0
- package/lib/generates/internal/SdkDistributionComposer.js +98 -59
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkFileProgrammer.js +18 -0
- 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 +19 -0
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +19 -0
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +104 -2
- package/lib/generates/internal/SdkHttpParameterProgrammer.js +70 -0
- package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +20 -0
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +20 -0
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +38 -0
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +49 -5
- 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 +33 -13
- package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkPathTemplate.d.ts +15 -0
- package/lib/generates/internal/SdkPathTemplate.js +15 -0
- package/lib/generates/internal/SdkPathTemplate.js.map +1 -1
- 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 +96 -12
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +36 -3
- package/lib/generates/internal/SdkTypeTagProgrammer.js +28 -7
- 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 +19 -0
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +81 -2
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +48 -0
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +18 -0
- 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 +18 -0
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +39 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +31 -8
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +19 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +19 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/internal/legacy.d.ts +296 -16
- package/lib/internal/legacy.js +127 -10
- 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 +55 -0
- package/lib/structures/IReflectController.d.ts +10 -0
- package/lib/structures/IReflectHttpOperation.d.ts +10 -0
- package/lib/structures/IReflectHttpOperationException.d.ts +10 -0
- package/lib/structures/IReflectHttpOperationParameter.d.ts +47 -0
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +11 -0
- 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 +10 -0
- package/lib/structures/ITypedHttpRouteException.d.ts +10 -0
- package/lib/structures/ITypedHttpRouteParameter.d.ts +45 -0
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +10 -0
- package/lib/structures/ITypedMcpRoute.d.ts +11 -0
- package/lib/structures/ITypedWebSocketRoute.d.ts +10 -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 +35 -0
- package/lib/utils/SourceFinder.js +47 -12
- 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 +26 -1
- package/lib/utils/VersioningStrategy.js +30 -9
- 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_metadata_json.go +6 -1
- package/native/sdk/sdk_transform.go +388 -397
- package/package.json +7 -5
- package/src/INestiaConfig.ts +55 -24
- package/src/NestiaSdkApplication.ts +66 -7
- package/src/NestiaSwaggerComposer.ts +21 -6
- package/src/analyses/AccessorAnalyzer.ts +26 -0
- package/src/analyses/ConfigAnalyzer.ts +49 -87
- package/src/analyses/ImportAnalyzer.ts +25 -0
- package/src/analyses/ParameterNameAnalyzer.ts +24 -0
- package/src/analyses/PathAnalyzer.ts +63 -11
- package/src/analyses/ReflectControllerAnalyzer.ts +32 -0
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +32 -10
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +31 -0
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +31 -0
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +32 -0
- package/src/analyses/ReflectMcpOperationAnalyzer.ts +32 -1
- package/src/analyses/ReflectMetadataAnalyzer.ts +47 -0
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +33 -4
- package/src/analyses/SecurityAnalyzer.ts +15 -0
- package/src/analyses/SwaggerExampleAnalyzer.ts +16 -0
- package/src/analyses/TypedHttpRouteAnalyzer.ts +240 -184
- package/src/analyses/TypedMcpRouteAnalyzer.ts +180 -20
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +19 -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 +169 -41
- package/src/executable/internal/NestiaSwaggerWatch.ts +359 -0
- package/src/factories/ExpressionFactory.ts +17 -2
- package/src/factories/IdentifierFactory.ts +24 -0
- package/src/factories/LiteralFactory.ts +44 -11
- 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 +40 -9
- package/src/generates/SwaggerGenerator.ts +56 -14
- package/src/generates/internal/E2eFileProgrammer.ts +20 -0
- package/src/generates/internal/FilePrinter.ts +43 -0
- package/src/generates/internal/ImportDictionary.ts +110 -3
- package/src/generates/internal/SdkAliasCollection.ts +133 -11
- package/src/generates/internal/SdkDistributionComposer.ts +117 -66
- package/src/generates/internal/SdkFileProgrammer.ts +18 -0
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +55 -0
- package/src/generates/internal/SdkHttpCloneReferencer.ts +97 -23
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +19 -0
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +19 -0
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +104 -2
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +20 -0
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +72 -5
- package/src/generates/internal/SdkImportWizard.ts +63 -0
- package/src/generates/internal/SdkMcpRouteProgrammer.ts +38 -18
- package/src/generates/internal/SdkPathTemplate.ts +15 -0
- package/src/generates/internal/SdkRouteDirectory.ts +10 -0
- package/src/generates/internal/SdkTypeProgrammer.ts +118 -14
- package/src/generates/internal/SdkTypeTagProgrammer.ts +37 -7
- package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +185 -142
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +19 -0
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +81 -2
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +18 -0
- package/src/generates/internal/SwaggerDescriptionComposer.ts +47 -1
- package/src/generates/internal/SwaggerOperationComposer.ts +18 -0
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +41 -8
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +19 -0
- package/src/internal/legacy-augmentation.d.ts +16 -0
- package/src/internal/legacy.ts +296 -26
- package/src/structures/INestiaProject.ts +10 -0
- package/src/structures/INestiaSdkInput.ts +30 -0
- package/src/structures/IOperationMetadata.ts +55 -0
- package/src/structures/IReflectController.ts +10 -0
- package/src/structures/IReflectHttpOperation.ts +10 -0
- package/src/structures/IReflectHttpOperationException.ts +10 -0
- package/src/structures/IReflectHttpOperationParameter.ts +47 -0
- package/src/structures/IReflectHttpOperationSuccess.ts +11 -0
- 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 +10 -0
- package/src/structures/ITypedHttpRouteException.ts +10 -0
- package/src/structures/ITypedHttpRouteParameter.ts +45 -0
- package/src/structures/ITypedHttpRouteSuccess.ts +10 -0
- package/src/structures/ITypedMcpRoute.ts +12 -0
- package/src/structures/ITypedWebSocketRoute.ts +10 -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 +51 -14
- 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 +33 -13
- 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/src/generates/internal/SwaggerReadonlyArrayEmender.ts +0 -264
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
import cp from "child_process";
|
|
2
|
+
/**
|
|
3
|
+
* Runs the `ttsc` compiler of the project.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation The binary is found from the project's own `ttsc` package, with the SDK's dependency as a fallback, and is run with the current Node.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design One function and a resolution cache.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The binary comes from the package manifest, not a fixed path.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
9
|
+
* @evidence contracts/portability.md#os-neutral-implementation The compiler runs as a child of the current Node executable (`process.execPath`) on the JavaScript entry that the package manifest's `bin` names, found through Node module resolution from the project directory, so no platform shim (`.cmd`, `.ps1` or shell script) and no `PATH` lookup is involved. Arguments are an array, never a command line, and the entry path is joined with `path.join` and checked with `existsSync`.
|
|
10
|
+
*/
|
|
2
11
|
export declare namespace TtscExecutor {
|
|
12
|
+
/**
|
|
13
|
+
* Compiles a project with `ttsc` and returns captured output, or null when
|
|
14
|
+
* the selected stdio does not pipe standard output.
|
|
15
|
+
*
|
|
16
|
+
* The cache directory of the environment is passed on, and a non-zero exit
|
|
17
|
+
* throws.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation The command is run with an argument array and the current Node executable, so no shell or platform shim is involved.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The environment is extended, not replaced.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the arguments and the failure.
|
|
23
|
+
* @evidence contracts/portability.md#os-neutral-implementation The working directory and the environment are explicit. Standard output is piped by default with a 64 MiB buffer; callers may select another stdio mode. A non-zero exit surfaces as Node's process error carrying `status` and available captured output.
|
|
24
|
+
*/
|
|
3
25
|
const run: (props: {
|
|
4
26
|
cwd: string;
|
|
5
27
|
env?: NodeJS.ProcessEnv;
|
|
6
28
|
project: string;
|
|
7
29
|
stdio?: cp.StdioOptions;
|
|
8
|
-
}) => Buffer;
|
|
30
|
+
}) => Buffer | null;
|
|
9
31
|
}
|
|
@@ -7,8 +7,30 @@ exports.TtscExecutor = void 0;
|
|
|
7
7
|
const child_process_1 = __importDefault(require("child_process"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
|
+
/**
|
|
11
|
+
* Runs the `ttsc` compiler of the project.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/common.md#principled-implementation The binary is found from the project's own `ttsc` package, with the SDK's dependency as a fallback, and is run with the current Node.
|
|
14
|
+
* @evidence contracts/common.md#clear-and-simple-design One function and a resolution cache.
|
|
15
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The binary comes from the package manifest, not a fixed path.
|
|
16
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
17
|
+
* @evidence contracts/portability.md#os-neutral-implementation The compiler runs as a child of the current Node executable (`process.execPath`) on the JavaScript entry that the package manifest's `bin` names, found through Node module resolution from the project directory, so no platform shim (`.cmd`, `.ps1` or shell script) and no `PATH` lookup is involved. Arguments are an array, never a command line, and the entry path is joined with `path.join` and checked with `existsSync`.
|
|
18
|
+
*/
|
|
10
19
|
var TtscExecutor;
|
|
11
20
|
(function (TtscExecutor) {
|
|
21
|
+
/**
|
|
22
|
+
* Compiles a project with `ttsc` and returns captured output, or null when
|
|
23
|
+
* the selected stdio does not pipe standard output.
|
|
24
|
+
*
|
|
25
|
+
* The cache directory of the environment is passed on, and a non-zero exit
|
|
26
|
+
* throws.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/common.md#principled-implementation The command is run with an argument array and the current Node executable, so no shell or platform shim is involved.
|
|
29
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
30
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The environment is extended, not replaced.
|
|
31
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the arguments and the failure.
|
|
32
|
+
* @evidence contracts/portability.md#os-neutral-implementation The working directory and the environment are explicit. Standard output is piped by default with a 64 MiB buffer; callers may select another stdio mode. A non-zero exit surfaces as Node's process error carrying `status` and available captured output.
|
|
33
|
+
*/
|
|
12
34
|
TtscExecutor.run = (props) => {
|
|
13
35
|
var _a;
|
|
14
36
|
const args = [bin(props.cwd), "-p", props.project];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TtscExecutor.js","sourceRoot":"","sources":["../../src/utils/TtscExecutor.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AAExB,IAAiB,YAAY,
|
|
1
|
+
{"version":3,"file":"TtscExecutor.js","sourceRoot":"","sources":["../../src/utils/TtscExecutor.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AAExB;;;;;;;;GAQG;AACH,IAAiB,YAAY,CA4E5B;AA5ED,WAAiB,YAAY;IAC3B;;;;;;;;;;;;OAYG;IACU,gBAAG,GAAG,CAAC,KAKnB,EAAiB,EAAE;;QAClB,MAAM,IAAI,GAAa,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc,KAAK,SAAS;YAC1C,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACvD,OAAO,uBAAE,CAAC,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,EAAE;YAC7C,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,GAAG,kCACE,OAAO,CAAC,GAAG,GACX,KAAK,CAAC,GAAG,CACb;YACD,KAAK,QAAE,KAAK,CAAC,KAAK,mCAAI,MAAM;YAC5B,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,IAAI,GAAwB,IAAI,GAAG,EAAE,CAAC;IAE5C,MAAM,GAAG,GAAG,CAAC,GAAW,EAAU,EAAE;;QAClC,MAAM,MAAM,GAAuB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACjD,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,MAAM,CAAC;QAExC,sEAAsE;QACtE,oEAAoE;QACpE,wCAAwC;QACxC,IAAI,QAAgB,CAAC;QACrB,IAAI,CAAC;YACH,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;mBAAO,CAAC;YACP,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,SAAS,GAAW,cAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACjD,MAAM,IAAI,GAA8C,IAAI,CAAC,KAAK,CAChE,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAClC,CAAC;QACF,MAAM,QAAQ,GACZ,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,GAAG,0CAAE,IAAI,CAAC;QAC3D,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,GACR,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI;gBAC/C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;gBAClC,CAAC,CAAC,QAAQ,CAAC;YACf,MAAM,IAAI,KAAK,CACb,sDAAsD;gBACpD,0BAA0B,IAAI,IAAI;gBAClC,6CAA6C,CAChD,CAAC;QACJ,CAAC;QAED,MAAM,QAAQ,GAAW,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QACxD,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC1B,MAAM,IAAI,KAAK,CACb,+BAA+B,QAAQ,KAAK;gBAC1C,6CAA6C,CAChD,CAAC;QACJ,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC,EA5EgB,YAAY,aAAZ,YAAY,GAAZ,YAAY,QA4E5B"}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
import { VERSION_NEUTRAL, VersionValue } from "@nestjs/common/interfaces";
|
|
2
2
|
import { INestiaProject } from "../structures/INestiaProject";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the URI versions of a controller method as NestJS does.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The namespace turns version metadata and the default version into path segments.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
10
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
11
|
+
*/
|
|
3
12
|
export declare namespace VersioningStrategy {
|
|
4
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Casts version metadata to a list: absence stays absent and a single value
|
|
15
|
+
* is a one-element list.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/common.md#principled-implementation A single version becomes a list while absence stays distinct from an explicit empty list, which registers no paths rather than inheriting other versions.
|
|
18
|
+
* @evidence contracts/common.md#clear-and-simple-design One conditional.
|
|
19
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It adds nothing.
|
|
20
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the cases.
|
|
21
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.cast maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
22
|
+
*/
|
|
23
|
+
const cast: (value: VersionValue | undefined) => Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
5
24
|
/**
|
|
6
25
|
* Version path segments of a route, resolved as NestJS resolves them: the
|
|
7
26
|
* method's versions, else the controller's, else the default version, and no
|
|
@@ -10,6 +29,12 @@ export declare namespace VersioningStrategy {
|
|
|
10
29
|
* The controller's and the method's versions were joined, so a method
|
|
11
30
|
* overriding its controller's version was also described at the controller's,
|
|
12
31
|
* and a route with no version and no default got no path at all (#1735).
|
|
32
|
+
*
|
|
33
|
+
* @evidence contracts/common.md#principled-implementation The first present method, controller or default list wins, including an empty list that registers no paths. Duplicates are removed, neutral and absent versions have no segment, and with versioning off the only segment is empty.
|
|
34
|
+
* @evidence contracts/common.md#clear-and-simple-design One curried function.
|
|
35
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
|
|
36
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the precedence.
|
|
37
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.merge maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
13
38
|
*/
|
|
14
39
|
const merge: (project: Omit<INestiaProject, "config">) => (props: {
|
|
15
40
|
controller: Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VersioningStrategy = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Resolves the URI versions of a controller method as NestJS does.
|
|
6
|
+
*
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation The namespace turns version metadata and the default version into path segments.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
11
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
12
|
+
*/
|
|
4
13
|
var VersioningStrategy;
|
|
5
14
|
(function (VersioningStrategy) {
|
|
6
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Casts version metadata to a list: absence stays absent and a single value
|
|
17
|
+
* is a one-element list.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation A single version becomes a list while absence stays distinct from an explicit empty list, which registers no paths rather than inheriting other versions.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design One conditional.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It adds nothing.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the cases.
|
|
23
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.cast maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
24
|
+
*/
|
|
25
|
+
VersioningStrategy.cast = (value) => value === undefined ? undefined : Array.isArray(value) ? value : [value];
|
|
7
26
|
/**
|
|
8
27
|
* Version path segments of a route, resolved as NestJS resolves them: the
|
|
9
28
|
* method's versions, else the controller's, else the default version, and no
|
|
@@ -12,23 +31,25 @@ var VersioningStrategy;
|
|
|
12
31
|
* The controller's and the method's versions were joined, so a method
|
|
13
32
|
* overriding its controller's version was also described at the controller's,
|
|
14
33
|
* and a route with no version and no default got no path at all (#1735).
|
|
34
|
+
*
|
|
35
|
+
* @evidence contracts/common.md#principled-implementation The first present method, controller or default list wins, including an empty list that registers no paths. Duplicates are removed, neutral and absent versions have no segment, and with versioning off the only segment is empty.
|
|
36
|
+
* @evidence contracts/common.md#clear-and-simple-design One curried function.
|
|
37
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The precedence is NestJS's.
|
|
38
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the precedence.
|
|
39
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation VersioningStrategy.merge maps Nest version metadata to URI segments, which are protocol spelling rather than native file paths.
|
|
15
40
|
*/
|
|
16
41
|
VersioningStrategy.merge = (project) => (props) => {
|
|
17
42
|
var _a, _b;
|
|
18
43
|
const versioning = project.input.versioning;
|
|
19
44
|
if (versioning === undefined)
|
|
20
45
|
return [""];
|
|
21
|
-
const chosen = ((_a = props.method)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
? props.controller
|
|
25
|
-
: VersioningStrategy.cast(versioning.defaultVersion);
|
|
46
|
+
const chosen = (_b = (_a = props.method) !== null && _a !== void 0 ? _a : props.controller) !== null && _b !== void 0 ? _b : VersioningStrategy.cast(versioning.defaultVersion);
|
|
47
|
+
if (chosen === undefined)
|
|
48
|
+
return [""];
|
|
26
49
|
const unique = [
|
|
27
50
|
...new Set(chosen),
|
|
28
51
|
];
|
|
29
|
-
return unique.
|
|
30
|
-
? unique.map((x) => typeof x === "symbol" ? "" : `${versioning.prefix}${x}`)
|
|
31
|
-
: [""];
|
|
52
|
+
return unique.map((x) => typeof x === "symbol" ? "" : `${versioning.prefix}${x}`);
|
|
32
53
|
};
|
|
33
54
|
})(VersioningStrategy || (exports.VersioningStrategy = VersioningStrategy = {}));
|
|
34
55
|
//# sourceMappingURL=VersioningStrategy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersioningStrategy.js","sourceRoot":"","sources":["../../src/utils/VersioningStrategy.ts"],"names":[],"mappings":";;;AAIA,IAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"VersioningStrategy.js","sourceRoot":"","sources":["../../src/utils/VersioningStrategy.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;GAQG;AACH,IAAiB,kBAAkB,CAiDlC;AAjDD,WAAiB,kBAAkB;IACjC;;;;;;;;;OASG;IACU,uBAAI,GAAG,CAClB,KAA+B,EACqB,EAAE,CACtD,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAE3E;;;;;;;;;;;;;;OAcG;IACU,wBAAK,GAChB,CAAC,OAAuC,EAAE,EAAE,CAC5C,CAAC,KAGA,EAAY,EAAE;;QACb,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;QAC5C,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QAC1C,MAAM,MAAM,eACV,KAAK,CAAC,MAAM,mCAAI,KAAK,CAAC,UAAU,mCAAI,uBAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QACtE,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,MAAM,MAAM,GAA2C;YACrD,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC;SACnB,CAAC;QACF,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACtB,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CACxD,CAAC;IACJ,CAAC,CAAC;AACN,CAAC,EAjDgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAiDlC"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { MetadataSchema } from "../internal/legacy";
|
|
2
|
+
/**
|
|
3
|
+
* Validates that a type can be a `text/plain` body or response.
|
|
4
|
+
*
|
|
5
|
+
* @evidence contracts/common.md#principled-implementation A plain text body is a string, so the type may hold only string forms.
|
|
6
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
7
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule follows the content type.
|
|
8
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
9
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
|
|
10
|
+
*/
|
|
2
11
|
export declare namespace TextPlainValidator {
|
|
12
|
+
/**
|
|
13
|
+
* Returns an error message unless every member of the metadata is a string, a
|
|
14
|
+
* string constant, a string template, or the native String.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation The number of string forms is counted and compared with the size of the metadata, so any other form makes the counts differ, and an empty type is also refused.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The count is exact and no type is special-cased.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the accepted forms.
|
|
20
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator.validate checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
|
|
21
|
+
*/
|
|
3
22
|
const validate: (props: {
|
|
4
23
|
metadata: MetadataSchema;
|
|
5
24
|
}) => string[];
|
|
@@ -2,8 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TextPlainValidator = void 0;
|
|
4
4
|
const legacy_1 = require("../internal/legacy");
|
|
5
|
+
/**
|
|
6
|
+
* Validates that a type can be a `text/plain` body or response.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation A plain text body is a string, so the type may hold only string forms.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule follows the content type.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
|
|
13
|
+
*/
|
|
5
14
|
var TextPlainValidator;
|
|
6
15
|
(function (TextPlainValidator) {
|
|
16
|
+
/**
|
|
17
|
+
* Returns an error message unless every member of the metadata is a string, a
|
|
18
|
+
* string constant, a string template, or the native String.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The number of string forms is counted and compared with the size of the metadata, so any other form makes the counts differ, and an empty type is also refused.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The count is exact and no type is special-cased.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the accepted forms.
|
|
24
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation TextPlainValidator.validate checks the metadata union accepted for a text/plain payload; it owns no native filesystem or executable representation.
|
|
25
|
+
*/
|
|
7
26
|
TextPlainValidator.validate = (props) => {
|
|
8
27
|
const expected = props.metadata.atomics.filter((a) => a.type === "string").length +
|
|
9
28
|
props.metadata.constants
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextPlainValidator.js","sourceRoot":"","sources":["../../src/validators/TextPlainValidator.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAE5D,IAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"TextPlainValidator.js","sourceRoot":"","sources":["../../src/validators/TextPlainValidator.ts"],"names":[],"mappings":";;;AAAA,+CAA4D;AAE5D;;;;;;;;GAQG;AACH,IAAiB,kBAAkB,CAwBlC;AAxBD,WAAiB,kBAAkB;IACjC;;;;;;;;;OASG;IACU,2BAAQ,GAAG,CAAC,KAAmC,EAAY,EAAE;QACxE,MAAM,QAAQ,GACZ,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM;YAChE,KAAK,CAAC,QAAQ,CAAC,SAAS;iBACrB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;iBAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;iBAC3B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC7B,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM;YAC/B,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;QACnE,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,IAAA,eAAM,EAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,QAAQ;YACrE,OAAO,CAAC,+DAA+D,CAAC,CAAC;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC,EAxBgB,kBAAkB,aAAlB,kBAAkB,GAAlB,kBAAkB,QAwBlC"}
|
package/native/go.mod
CHANGED
|
@@ -9,7 +9,7 @@ require (
|
|
|
9
9
|
github.com/microsoft/typescript-go/shim/scanner v0.0.0
|
|
10
10
|
github.com/samchon/nestia/packages/core/native v0.0.0
|
|
11
11
|
github.com/samchon/ttsc/packages/ttsc v0.0.0
|
|
12
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
12
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3
|
|
13
13
|
)
|
|
14
14
|
|
|
15
15
|
require (
|
package/native/go.sum
CHANGED
|
@@ -38,8 +38,8 @@ github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20260820075544-3
|
|
|
38
38
|
github.com/samchon/ttsc/packages/ttsc/shim/vfs/cachedvfs v0.0.0-20260820075544-3fe6b732f888/go.mod h1:XS3LhXkn5xadyRe3tW+9+suW/7gh7dPdL43Q+s/lUDo=
|
|
39
39
|
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20260820075544-3fe6b732f888 h1:ihiKD2OhuYc7Dngxw3uFYbVoiA/xuPwwQoUakB59E40=
|
|
40
40
|
github.com/samchon/ttsc/packages/ttsc/shim/vfs/osvfs v0.0.0-20260820075544-3fe6b732f888/go.mod h1:otX+qw8aZLNCoBmCwMAn53Nw0RQTPzSoId3DxmE67So=
|
|
41
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
42
|
-
github.com/samchon/typia/packages/typia/native v0.0.0-
|
|
41
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3 h1:XtRIf6wvDuSHLsphMXiB3lm6p0/2sxHMfc6FMjI5LLA=
|
|
42
|
+
github.com/samchon/typia/packages/typia/native v0.0.0-20260926142025-755176823ba3/go.mod h1:pUTSG5IZxw8Hohle//RsDXnE+8ZhAus7mPDKFqzvZnk=
|
|
43
43
|
github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
|
|
44
44
|
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
|
|
45
45
|
github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs=
|
package/native/sdk/register.go
CHANGED
|
@@ -90,6 +90,15 @@ func (linkedPlugin) ApplyProgram(prog *driver.Program, _ driver.PluginContext) e
|
|
|
90
90
|
// alongside the typia and core transforms, exactly as the typia build command
|
|
91
91
|
// wires `nativetransform.Transform`. A site-collection failure is returned as
|
|
92
92
|
// diagnostics; the returned transform is nil when there are no sites.
|
|
93
|
+
//
|
|
94
|
+
// @evidence contracts/common.md#principled-implementation Decorated class-method sites are collected once for the program, and the returned transform maps each original method to its synthetic counterpart so the decorator lands on the printed node; collection failures return diagnostics and no sites return nil. Private reflection helpers use TypeReference/TypeQuery roles and checker aliases for authored imports, declaration sources for free types, and IsLibFile for actual libraries; locally bound TypeParameter symbols have no module import identity. Async aliases use the checker-resolved payload and TypeToTypeNode to apply generic defaults and substitutions after shared declaration-based Promise/Observable classification; type operators retain valid source or projected syntax and parenthesized operands preserve generic arguments. Only fixed language keywords are excluded by spelling. Readonly array and tuple schema markers follow actual checker numeric-index immutability and tuple target flags; substituted object properties, ordered schema dictionaries, nested and inferred types retain those facts without classifying authored alias names. Metadata nulls use the explicit upstream JSON null marker, so authored strings remain strings without encoded-text substitution. The shared private tag serializer omits a schema member when upstream analysis supplies nil for an absent or undefined optional schema, while preserving explicit empty objects and null instance leaves inside populated schema objects.
|
|
95
|
+
// @evidence contracts/common.md#clear-and-simple-design Site collection and one per-file closure share file grouping and the module specifier. Private import reflection centralizes reference traversal, authored binding selection and declaration fallback so the reflected type forms use one policy. Checker-generated alias payload nodes carry identifier symbols separately because they have no authored source span; the public printer supplies their text. All raw tag matrices share one serialization boundary, keeping optional tag representation separate from JSON Schema baking.
|
|
96
|
+
// @evidence contracts/common.md#prohibited-implementation-shortcuts The shared module specifier binds one generated alias without controller special cases. Import decisions use semantic AST roles, checker bindings and actual library identity rather than regex matches in literals, built-in-name whitelists or fixture/path spelling. Alias projection uses the supported checker and printer APIs without reparsing or mutating foreign behavior. Optional-schema omission depends on the analyzed nil value, never tag names, fixture paths or a TypeScript-writer compensation; invalid top-level null and scalar schemas remain upstream analyzer errors.
|
|
97
|
+
// @evidence contracts/common.md#meaningful-documentation The public comment explains injected metadata, original-to-synthetic mapping and nil/diagnostic results. Private helper comments explain reference roles, shadowable library names, declaration fallback, annotation-local binders, checker projection and type-operator syntax; these details remain documented at their implementation owners. The private tag serializer explains why absence cannot become JSON null and why empty objects and nested null content stay intact.
|
|
98
|
+
// @evidence contracts/portability.md#os-neutral-implementation File grouping converts both collected paths and emitted source names through filepath.ToSlash; it preserves the compiler's filename identity without guessing volume case policy. The contributor receives an existing compiler program and launches no shell. Declaration-package ownership uses the shared SourceFilePackageName ancestor walk through that program's filesystem, retaining its overlay observations and native filepath operations.
|
|
99
|
+
// @evidence contracts/performance.md#efficient-algorithms Site analysis visits the program once; grouping costs O(S) for S sites plus filename lengths. Each participating emitted file is traversed once to index original method identities, followed by O(Sf) injections for its sites. The method index avoids a separate AST traversal for every route.
|
|
100
|
+
// @evidence contracts/performance.md#reuse-equivalent-work The returned closure shares the collected metadata and file grouping across file emissions of this program. A new EmitTransform invocation recollects against its supplied program; these AST identities cannot safely be reused for another compilation.
|
|
101
|
+
// @evidence contracts/performance.md#bound-retention-and-release-resources The closure retains the site's AST nodes and metadata strings for its compiler emission lifetime. Each per-file method index becomes unreachable after that file returns; there are no process-global program caches, file handles or background tasks in this operation.
|
|
93
102
|
func EmitTransform(prog *driver.Program) (driver.PluginTransform, []transform.Diagnostic) {
|
|
94
103
|
sites, diagnostics := collectNestiaSDKSites(prog)
|
|
95
104
|
if len(diagnostics) > 0 {
|
|
@@ -181,8 +190,9 @@ func synthesized(node *shimast.Node) *shimast.Node {
|
|
|
181
190
|
|
|
182
191
|
// injectOperationMetadataDecorator prepends a synthesized
|
|
183
192
|
// `@__OperationMetadata.OperationMetadata("<json>")` decorator to a controller
|
|
184
|
-
// method.
|
|
185
|
-
//
|
|
193
|
+
// method. Site collection visits decorated class methods, including methods
|
|
194
|
+
// outside Nest controllers; their existing modifier lists carry the decorators
|
|
195
|
+
// and can be extended in place. Runtime controller analysis selects routes.
|
|
186
196
|
func injectOperationMetadataDecorator(
|
|
187
197
|
factory *shimast.NodeFactory,
|
|
188
198
|
method *shimast.Node,
|
|
@@ -284,7 +284,12 @@ func nestiaSDKMetadataTypeTag(tag schemametadata.IMetadataTypeTag) map[string]an
|
|
|
284
284
|
"kind": tag.Kind,
|
|
285
285
|
"exclusive": tag.Exclusive,
|
|
286
286
|
"value": value,
|
|
287
|
-
|
|
287
|
+
}
|
|
288
|
+
// TagBase's optional schema is absent when the analyzer supplies nil.
|
|
289
|
+
// An explicit empty object and null leaves inside an actual schema object
|
|
290
|
+
// remain intact; writing an absent schema as null creates an invalid tag.
|
|
291
|
+
if tag.Schema != nil {
|
|
292
|
+
output["schema"] = tag.Schema
|
|
288
293
|
}
|
|
289
294
|
// A tag's target is the type it tags, not its value's: `tags.Sequence<1>`
|
|
290
295
|
// on a bigint holds a number, `tags.Example<"Infinity">` on a number a
|