@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
|
@@ -3,7 +3,26 @@ import { INestiaProject } from "../../structures/INestiaProject";
|
|
|
3
3
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
4
4
|
import { ITypedHttpRouteParameter } from "../../structures/ITypedHttpRouteParameter";
|
|
5
5
|
import { ImportDictionary } from "./ImportDictionary";
|
|
6
|
+
/**
|
|
7
|
+
* The parameters of an HTTP route's SDK function.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The namespace decides the identifiers, lists the entries, and writes the declarations and the arguments in positional or keyword mode.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design Several small functions over one entry type.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The three consumers share one decision.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
14
|
+
*/
|
|
6
15
|
export declare namespace SdkHttpParameterProgrammer {
|
|
16
|
+
/**
|
|
17
|
+
* One parameter of a route: its key, whether it is required, its type, and
|
|
18
|
+
* the reflected parameter.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The record is what a declaration or an argument needs.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design A four-member record.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
24
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.IEntry composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
25
|
+
*/
|
|
7
26
|
interface IEntry {
|
|
8
27
|
key: string;
|
|
9
28
|
required: boolean;
|
|
@@ -29,6 +48,12 @@ export declare namespace SdkHttpParameterProgrammer {
|
|
|
29
48
|
* generated code actually references for this route and configuration, and an
|
|
30
49
|
* own identifier yields only to the names its scope can see, so nothing is
|
|
31
50
|
* renamed where no name is shadowed.
|
|
51
|
+
*
|
|
52
|
+
* @evidence contracts/common.md#principled-implementation One decision serves the three scopes, so they cannot disagree.
|
|
53
|
+
* @evidence contracts/common.md#clear-and-simple-design A record of names and two lookups.
|
|
54
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
55
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
56
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.INames composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
32
57
|
*/
|
|
33
58
|
interface INames {
|
|
34
59
|
connection: string;
|
|
@@ -40,17 +65,74 @@ export declare namespace SdkHttpParameterProgrammer {
|
|
|
40
65
|
key: string;
|
|
41
66
|
value: string;
|
|
42
67
|
elem: string;
|
|
43
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Local identifier of a significant parameter in positional mode.
|
|
70
|
+
*
|
|
71
|
+
* @evidence contracts/common.md#principled-implementation A parameter yields to a name the SDK cannot change and keeps its own otherwise.
|
|
72
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup.
|
|
73
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reads the decision.
|
|
74
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
75
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.INames.parameter composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
76
|
+
*/
|
|
44
77
|
parameter: (p: ITypedHttpRouteParameter) => string;
|
|
45
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Reads a significant parameter: `props.<name>` or its local.
|
|
80
|
+
*
|
|
81
|
+
* @evidence contracts/common.md#principled-implementation The read follows the mode of the function.
|
|
82
|
+
* @evidence contracts/common.md#clear-and-simple-design One lookup.
|
|
83
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reads the decision.
|
|
84
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
85
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.INames.access composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
86
|
+
*/
|
|
46
87
|
access: (p: ITypedHttpRouteParameter) => Expression;
|
|
47
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Decides the identifiers of a route's function, `path()`, and `simulate()`
|
|
91
|
+
* once.
|
|
92
|
+
*
|
|
93
|
+
* @evidence contracts/common.md#principled-implementation The fixed names each scope references are collected, and every own identifier avoids them and the other own identifiers it can see.
|
|
94
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over the scope sets.
|
|
95
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Only shadowed names are renamed.
|
|
96
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
97
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getNames composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
98
|
+
*/
|
|
48
99
|
const getNames: (props: {
|
|
49
100
|
project: INestiaProject;
|
|
50
101
|
route: ITypedHttpRoute;
|
|
51
102
|
}) => INames;
|
|
103
|
+
/**
|
|
104
|
+
* Returns every parameter of a route: path, query, header, query object,
|
|
105
|
+
* body, and header object.
|
|
106
|
+
*
|
|
107
|
+
* @evidence contracts/common.md#principled-implementation The list is the concatenation in that order.
|
|
108
|
+
* @evidence contracts/common.md#clear-and-simple-design One list.
|
|
109
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It adds no parameter.
|
|
110
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
111
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getAll composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
112
|
+
*/
|
|
52
113
|
const getAll: (route: ITypedHttpRoute) => ITypedHttpRouteParameter[];
|
|
114
|
+
/**
|
|
115
|
+
* Returns the parameters that make up a call: path, query, the query object,
|
|
116
|
+
* and the body when asked.
|
|
117
|
+
*
|
|
118
|
+
* @evidence contracts/common.md#principled-implementation Headers travel in the connection and are not arguments.
|
|
119
|
+
* @evidence contracts/common.md#clear-and-simple-design One list.
|
|
120
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The body is included by the caller's choice.
|
|
121
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
122
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getSignificant composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
123
|
+
*/
|
|
53
124
|
const getSignificant: (route: ITypedHttpRoute, body: boolean) => (ITypedHttpRouteParameter.IBody | ITypedHttpRouteParameter.IPath | ITypedHttpRouteParameter.IQuery)[];
|
|
125
|
+
/**
|
|
126
|
+
* Returns the entries of a route: path and query parameters, the query
|
|
127
|
+
* object, and the body when asked, with the type each has in the function or
|
|
128
|
+
* in the test.
|
|
129
|
+
*
|
|
130
|
+
* @evidence contracts/common.md#principled-implementation The type is the alias `Query` or `Body` in the function, and the reflected or cloned type in a test.
|
|
131
|
+
* @evidence contracts/common.md#clear-and-simple-design One list of three groups.
|
|
132
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts An empty route has no entries.
|
|
133
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
134
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getEntries composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
135
|
+
*/
|
|
54
136
|
const getEntries: (props: {
|
|
55
137
|
project: INestiaProject;
|
|
56
138
|
importer: ImportDictionary;
|
|
@@ -59,6 +141,16 @@ export declare namespace SdkHttpParameterProgrammer {
|
|
|
59
141
|
prefix: boolean | string;
|
|
60
142
|
e2e?: boolean;
|
|
61
143
|
}) => IEntry[];
|
|
144
|
+
/**
|
|
145
|
+
* Returns the parameter declarations of a route's function: one `props`
|
|
146
|
+
* object in keyword mode, and one positional parameter per entry otherwise.
|
|
147
|
+
*
|
|
148
|
+
* @evidence contracts/common.md#principled-implementation A required parameter cannot follow an optional one, so an optional one before a required one trades its `?` for `undefined` in its type.
|
|
149
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of two modes.
|
|
150
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from `getNames`.
|
|
151
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
152
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getParameterDeclarations composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
153
|
+
*/
|
|
62
154
|
const getParameterDeclarations: (props: {
|
|
63
155
|
project: INestiaProject;
|
|
64
156
|
importer: ImportDictionary;
|
|
@@ -66,6 +158,16 @@ export declare namespace SdkHttpParameterProgrammer {
|
|
|
66
158
|
body: boolean;
|
|
67
159
|
prefix: boolean;
|
|
68
160
|
}) => Node[];
|
|
161
|
+
/**
|
|
162
|
+
* Returns the arguments to call a route's function with: the `props` object
|
|
163
|
+
* in keyword mode, and the parameters otherwise.
|
|
164
|
+
*
|
|
165
|
+
* @evidence contracts/common.md#principled-implementation The identifiers are those declared by `getNames`.
|
|
166
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of two modes.
|
|
167
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No argument is invented for an empty route.
|
|
168
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
169
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getArguments composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
170
|
+
*/
|
|
69
171
|
const getArguments: (props: {
|
|
70
172
|
project: INestiaProject;
|
|
71
173
|
route: ITypedHttpRoute;
|
|
@@ -4,8 +4,27 @@ exports.SdkHttpParameterProgrammer = void 0;
|
|
|
4
4
|
const factory_1 = require("@ttsc/factory");
|
|
5
5
|
const StringUtil_1 = require("../../utils/StringUtil");
|
|
6
6
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
7
|
+
/**
|
|
8
|
+
* The parameters of an HTTP route's SDK function.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation The namespace decides the identifiers, lists the entries, and writes the declarations and the arguments in positional or keyword mode.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design Several small functions over one entry type.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The three consumers share one decision.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
15
|
+
*/
|
|
7
16
|
var SdkHttpParameterProgrammer;
|
|
8
17
|
(function (SdkHttpParameterProgrammer) {
|
|
18
|
+
/**
|
|
19
|
+
* Decides the identifiers of a route's function, `path()`, and `simulate()`
|
|
20
|
+
* once.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/common.md#principled-implementation The fixed names each scope references are collected, and every own identifier avoids them and the other own identifiers it can see.
|
|
23
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over the scope sets.
|
|
24
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Only shadowed names are renamed.
|
|
25
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
26
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getNames composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
27
|
+
*/
|
|
9
28
|
SdkHttpParameterProgrammer.getNames = (props) => {
|
|
10
29
|
var _a;
|
|
11
30
|
const { project, route } = props;
|
|
@@ -83,6 +102,16 @@ var SdkHttpParameterProgrammer;
|
|
|
83
102
|
? factory_1.factory.createPropertyAccessExpression(factory_1.factory.createIdentifier(names.props), p.name)
|
|
84
103
|
: factory_1.factory.createIdentifier((_a = locals.get(p)) !== null && _a !== void 0 ? _a : p.name); } });
|
|
85
104
|
};
|
|
105
|
+
/**
|
|
106
|
+
* Returns every parameter of a route: path, query, header, query object,
|
|
107
|
+
* body, and header object.
|
|
108
|
+
*
|
|
109
|
+
* @evidence contracts/common.md#principled-implementation The list is the concatenation in that order.
|
|
110
|
+
* @evidence contracts/common.md#clear-and-simple-design One list.
|
|
111
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It adds no parameter.
|
|
112
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
113
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getAll composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
114
|
+
*/
|
|
86
115
|
SdkHttpParameterProgrammer.getAll = (route) => [
|
|
87
116
|
...route.pathParameters,
|
|
88
117
|
...route.queryParameters,
|
|
@@ -91,12 +120,33 @@ var SdkHttpParameterProgrammer;
|
|
|
91
120
|
...(route.body ? [route.body] : []),
|
|
92
121
|
...(route.headerObject ? [route.headerObject] : []),
|
|
93
122
|
];
|
|
123
|
+
/**
|
|
124
|
+
* Returns the parameters that make up a call: path, query, the query object,
|
|
125
|
+
* and the body when asked.
|
|
126
|
+
*
|
|
127
|
+
* @evidence contracts/common.md#principled-implementation Headers travel in the connection and are not arguments.
|
|
128
|
+
* @evidence contracts/common.md#clear-and-simple-design One list.
|
|
129
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The body is included by the caller's choice.
|
|
130
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
131
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getSignificant composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
132
|
+
*/
|
|
94
133
|
SdkHttpParameterProgrammer.getSignificant = (route, body) => [
|
|
95
134
|
...route.pathParameters,
|
|
96
135
|
...route.queryParameters,
|
|
97
136
|
...(route.queryObject ? [route.queryObject] : []),
|
|
98
137
|
...(body && route.body ? [route.body] : []),
|
|
99
138
|
];
|
|
139
|
+
/**
|
|
140
|
+
* Returns the entries of a route: path and query parameters, the query
|
|
141
|
+
* object, and the body when asked, with the type each has in the function or
|
|
142
|
+
* in the test.
|
|
143
|
+
*
|
|
144
|
+
* @evidence contracts/common.md#principled-implementation The type is the alias `Query` or `Body` in the function, and the reflected or cloned type in a test.
|
|
145
|
+
* @evidence contracts/common.md#clear-and-simple-design One list of three groups.
|
|
146
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts An empty route has no entries.
|
|
147
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
148
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getEntries composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
149
|
+
*/
|
|
100
150
|
SdkHttpParameterProgrammer.getEntries = (props) => {
|
|
101
151
|
if (props.route.pathParameters.length === 0 &&
|
|
102
152
|
props.route.queryParameters.length === 0 &&
|
|
@@ -147,6 +197,16 @@ var SdkHttpParameterProgrammer;
|
|
|
147
197
|
: []),
|
|
148
198
|
];
|
|
149
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* Returns the parameter declarations of a route's function: one `props`
|
|
202
|
+
* object in keyword mode, and one positional parameter per entry otherwise.
|
|
203
|
+
*
|
|
204
|
+
* @evidence contracts/common.md#principled-implementation A required parameter cannot follow an optional one, so an optional one before a required one trades its `?` for `undefined` in its type.
|
|
205
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of two modes.
|
|
206
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The names come from `getNames`.
|
|
207
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
208
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getParameterDeclarations composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
209
|
+
*/
|
|
150
210
|
SdkHttpParameterProgrammer.getParameterDeclarations = (props) => {
|
|
151
211
|
const entries = SdkHttpParameterProgrammer.getEntries(props);
|
|
152
212
|
if (entries.length === 0)
|
|
@@ -187,6 +247,16 @@ var SdkHttpParameterProgrammer;
|
|
|
187
247
|
e.type,
|
|
188
248
|
factory_1.factory.createKeywordTypeNode(factory_1.SyntaxKind.UndefinedKeyword),
|
|
189
249
|
]);
|
|
250
|
+
/**
|
|
251
|
+
* Returns the arguments to call a route's function with: the `props` object
|
|
252
|
+
* in keyword mode, and the parameters otherwise.
|
|
253
|
+
*
|
|
254
|
+
* @evidence contracts/common.md#principled-implementation The identifiers are those declared by `getNames`.
|
|
255
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of two modes.
|
|
256
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No argument is invented for an empty route.
|
|
257
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
258
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpParameterProgrammer.getArguments composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
259
|
+
*/
|
|
190
260
|
SdkHttpParameterProgrammer.getArguments = (props) => {
|
|
191
261
|
const parameters = SdkHttpParameterProgrammer.getSignificant(props.route, props.body);
|
|
192
262
|
if (parameters.length === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkHttpParameterProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpParameterProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAMuB;AAKvB,uDAAoD;AAEpD,6DAA0D;AAE1D,IAAiB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"SdkHttpParameterProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpParameterProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAMuB;AAKvB,uDAAoD;AAEpD,6DAA0D;AAE1D;;;;;;;;GAQG;AACH,IAAiB,0BAA0B,CAoa1C;AApaD,WAAiB,0BAA0B;IA8EzC;;;;;;;;;OASG;IACU,mCAAQ,GAAG,CAAC,KAGxB,EAAU,EAAE;;QACX,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;QACjC,MAAM,UAAU,GAA+B,yCAAc,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAC3E,MAAM,QAAQ,GACZ,OAAO,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,IAAI,UAAU,CAAC,MAAM,K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AAS,CAAC,KAAK,KAAK,IAAI;QAC1B,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI;YAC5B,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,WAAW,CAAC,CAAC;QACvE,CAAC,CAAC,CAAC,CAAC,IAAI;QACR,CAAC,CAAC,iBAAO,CAAC,mBAAmB,CAAC;YAC1B,CAAC,CAAC,IAAI;YACN,iBAAO,CAAC,qBAAqB,CAAC,oBAAU,CAAC,gBAAgB,CAAC;SAC3D,CAAC,CAAC;IAET;;;;;;;;;OASG;IACU,uCAAY,GAAG,CAAC,KAI5B,EAAU,EAAE;QACX,MAAM,UAAU,GAAG,yCAAc,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3D,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,EAAE,CAAC;QACvC,MAAM,KAAK,GAAW,mCAAQ,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI;YACvC,OAAO,CAAC,iBAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iBAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC;AACJ,CAAC,EApagB,0BAA0B,aAA1B,0BAA0B,GAA1B,0BAA0B,QAoa1C"}
|
|
@@ -2,6 +2,26 @@ import { type Node } from "@ttsc/factory";
|
|
|
2
2
|
import { INestiaProject } from "../../structures/INestiaProject";
|
|
3
3
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
4
4
|
import { ImportDictionary } from "./ImportDictionary";
|
|
5
|
+
/**
|
|
6
|
+
* Writes an HTTP route into the SDK: its function and its namespace.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The namespace pairs the two declarations and describes the function.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design One public function and one description helper.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The description is from the route's own comment.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpRouteProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
13
|
+
*/
|
|
5
14
|
export declare namespace SdkHttpRouteProgrammer {
|
|
15
|
+
/**
|
|
16
|
+
* Returns the function and the namespace of a route, the function carrying
|
|
17
|
+
* the route's description, `@param`, and exception tags, and a `@nestia`
|
|
18
|
+
* postfix.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The two nodes share the identifiers of one decision.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The description keeps the names the function declares.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
24
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpRouteProgrammer.write composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
25
|
+
*/
|
|
6
26
|
const write: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => Node[];
|
|
7
27
|
}
|
|
@@ -5,8 +5,28 @@ const FilePrinter_1 = require("./FilePrinter");
|
|
|
5
5
|
const SdkHttpFunctionProgrammer_1 = require("./SdkHttpFunctionProgrammer");
|
|
6
6
|
const SdkHttpNamespaceProgrammer_1 = require("./SdkHttpNamespaceProgrammer");
|
|
7
7
|
const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
|
|
8
|
+
/**
|
|
9
|
+
* Writes an HTTP route into the SDK: its function and its namespace.
|
|
10
|
+
*
|
|
11
|
+
* @evidence contracts/common.md#principled-implementation The namespace pairs the two declarations and describes the function.
|
|
12
|
+
* @evidence contracts/common.md#clear-and-simple-design One public function and one description helper.
|
|
13
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The description is from the route's own comment.
|
|
14
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
15
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpRouteProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
16
|
+
*/
|
|
8
17
|
var SdkHttpRouteProgrammer;
|
|
9
18
|
(function (SdkHttpRouteProgrammer) {
|
|
19
|
+
/**
|
|
20
|
+
* Returns the function and the namespace of a route, the function carrying
|
|
21
|
+
* the route's description, `@param`, and exception tags, and a `@nestia`
|
|
22
|
+
* postfix.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The two nodes share the identifiers of one decision.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The description keeps the names the function declares.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
28
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpRouteProgrammer.write composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
29
|
+
*/
|
|
10
30
|
SdkHttpRouteProgrammer.write = (project) => (importer) => (route) => [
|
|
11
31
|
FilePrinter_1.FilePrinter.description(SdkHttpFunctionProgrammer_1.SdkHttpFunctionProgrammer.write(project)(importer)(route), describe(project, route)),
|
|
12
32
|
SdkHttpNamespaceProgrammer_1.SdkHttpNamespaceProgrammer.write(project)(importer)(route),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkHttpRouteProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpRouteProgrammer.ts"],"names":[],"mappings":";;;AAKA,+CAA4C;AAE5C,2EAAwE;AACxE,6EAA0E;AAC1E,6EAA0E;AAE1E,IAAiB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SdkHttpRouteProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpRouteProgrammer.ts"],"names":[],"mappings":";;;AAKA,+CAA4C;AAE5C,2EAAwE;AACxE,6EAA0E;AAC1E,6EAA0E;AAE1E;;;;;;;;GAQG;AACH,IAAiB,sBAAsB,CA8FtC;AA9FD,WAAiB,sBAAsB;IACrC;;;;;;;;;;OAUG;IACU,4BAAK,GAChB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,KAAsB,EAAU,EAAE,CAAC;QAClC,yBAAW,CAAC,WAAW,CACrB,qDAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EACzD,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CACzB;QACD,uDAA0B,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;KAC3D,CAAC;IAEJ,MAAM,QAAQ,GAAG,CACf,OAAuB,EACvB,KAAsB,EACd,EAAE;;;QACV,MAAM,KAAK,GACT,uDAA0B,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1D,mBAAmB;QACnB,MAAM,mBAAmB,GAAa,KAAK,CAAC,WAAW;YACrD,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC;YAC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,GAAG,CAAC,mBAAmB,CAAC,MAAM,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,8DAA8D;YAC9D,eAAe,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,EAAE;YACzD,SAAS,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,EAAE;YACrC,4BAA4B,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;YACtD,iEAAiE;SAClE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC;AACJ,CAAC,EA9FgB,sBAAsB,aAAtB,sBAAsB,GAAtB,sBAAsB,QA8FtC"}
|
|
@@ -2,7 +2,45 @@ import { type Node } from "@ttsc/factory";
|
|
|
2
2
|
import { INestiaProject } from "../../structures/INestiaProject";
|
|
3
3
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
4
4
|
import { ImportDictionary } from "./ImportDictionary";
|
|
5
|
+
/**
|
|
6
|
+
* Writes the mockup functions of an HTTP route.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The namespace prints random for the response type and simulate for structural parameter assertions followed by random response creation. Simulation operates on typed SDK arguments rather than parsing HTTP transport values.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design Two public functions and their helpers.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Generated validation calls typia.assert through NestiaSimulator's error adapter. It does not reproduce arbitrary server pipes or the server transform's prune and equality modes; simulation rejects structural type violations without contacting a server.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
12
|
+
* efficient algorithms: Response construction has a fixed AST skeleton; request assertion emission visits significant parameters once and allocates one validator expression per parameter. Type and parameter projection costs belong to the called programmers.
|
|
13
|
+
* reuse equivalent work: These writers construct route-specific mutable AST nodes and coordinate no completed or in-flight generation across requests.
|
|
14
|
+
* bound retention and release resources: Returned ASTs transfer to the file writer. The emitted binary random function closes its empty stream during construction; the programmer itself retains no stream or producer task.
|
|
15
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
16
|
+
*/
|
|
5
17
|
export declare namespace SdkHttpSimulationProgrammer {
|
|
18
|
+
/**
|
|
19
|
+
* Returns `random`: it makes a value of the response, a closed empty stream
|
|
20
|
+
* for a binary one. Binary readers receive EOF without waiting for payload.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/common.md#principled-implementation Ordinary responses call typia.random of the output type. Binary responses construct a stream with the existing binary chunk type and a start callback that closes its own controller synchronously; no bytes are enqueued, so the first read reports EOF under Streams semantics.
|
|
23
|
+
* @evidence contracts/common.md#clear-and-simple-design The existing binary versus ordinary expression branch owns response generation. Its inline stream source supplies closure without another runtime helper, import or transport.
|
|
24
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The binary case has no random content.
|
|
25
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states that binary random output is closed and readers receive EOF without waiting for payload.
|
|
26
|
+
* bound retention and release resources: The emitted binary source queues no bytes or producer task and closes each empty stream during construction. The writer returns its AST without retaining stream handles; runtime readers belong to the generated SDK caller.
|
|
27
|
+
* efficient algorithms: After response-type projection, either branch allocates a fixed AST skeleton; the binary branch emits one empty stream constructor without traversing or generating payload bytes.
|
|
28
|
+
* reuse equivalent work: The returned AST belongs to this route and importer. Each generated runtime call needs its own random value or stream, so neither mutable syntax nor runtime response identity is shared.
|
|
29
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer.random composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
30
|
+
*/
|
|
6
31
|
const random: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => Node;
|
|
32
|
+
/**
|
|
33
|
+
* Returns `simulate`: it asserts the parameters and returns a random output,
|
|
34
|
+
* wrapped as a propagation when configured.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation The status of the wrapper is the declared one or the method's default. A response without a content type has no Content-Type entry; a declared media type supplies a string header, preserving the propagation header contract.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The parameters are validated before a response is made.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
40
|
+
* efficient algorithms: Parameter declarations and assertion nodes grow linearly with significant route parameters; propagation adds a fixed response wrapper and one catch block. The private assertion writer handles the connection headers separately rather than duplicating every parameter validation.
|
|
41
|
+
* reuse equivalent work: Simulation syntax contains this route's names, arguments, output type and importer aliases; this operation coordinates no reusable result across generation requests.
|
|
42
|
+
* bound retention and release resources: This function returns an AST to its caller and owns no retained cache, stream, handle or background task; runtime random response creation is documented by random.
|
|
43
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer.simulate composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
44
|
+
*/
|
|
7
45
|
const simulate: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => Node;
|
|
8
46
|
}
|
|
@@ -11,16 +11,60 @@ const legacy_1 = require("../../internal/legacy");
|
|
|
11
11
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
12
12
|
const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
|
|
13
13
|
const SdkImportWizard_1 = require("./SdkImportWizard");
|
|
14
|
+
/**
|
|
15
|
+
* Writes the mockup functions of an HTTP route.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/common.md#principled-implementation The namespace prints random for the response type and simulate for structural parameter assertions followed by random response creation. Simulation operates on typed SDK arguments rather than parsing HTTP transport values.
|
|
18
|
+
* @evidence contracts/common.md#clear-and-simple-design Two public functions and their helpers.
|
|
19
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Generated validation calls typia.assert through NestiaSimulator's error adapter. It does not reproduce arbitrary server pipes or the server transform's prune and equality modes; simulation rejects structural type violations without contacting a server.
|
|
20
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
21
|
+
* efficient algorithms: Response construction has a fixed AST skeleton; request assertion emission visits significant parameters once and allocates one validator expression per parameter. Type and parameter projection costs belong to the called programmers.
|
|
22
|
+
* reuse equivalent work: These writers construct route-specific mutable AST nodes and coordinate no completed or in-flight generation across requests.
|
|
23
|
+
* bound retention and release resources: Returned ASTs transfer to the file writer. The emitted binary random function closes its empty stream during construction; the programmer itself retains no stream or producer task.
|
|
24
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
25
|
+
*/
|
|
14
26
|
var SdkHttpSimulationProgrammer;
|
|
15
27
|
(function (SdkHttpSimulationProgrammer) {
|
|
28
|
+
/**
|
|
29
|
+
* Returns `random`: it makes a value of the response, a closed empty stream
|
|
30
|
+
* for a binary one. Binary readers receive EOF without waiting for payload.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/common.md#principled-implementation Ordinary responses call typia.random of the output type. Binary responses construct a stream with the existing binary chunk type and a start callback that closes its own controller synchronously; no bytes are enqueued, so the first read reports EOF under Streams semantics.
|
|
33
|
+
* @evidence contracts/common.md#clear-and-simple-design The existing binary versus ordinary expression branch owns response generation. Its inline stream source supplies closure without another runtime helper, import or transport.
|
|
34
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The binary case has no random content.
|
|
35
|
+
* @evidence contracts/common.md#meaningful-documentation The prose states that binary random output is closed and readers receive EOF without waiting for payload.
|
|
36
|
+
* bound retention and release resources: The emitted binary source queues no bytes or producer task and closes each empty stream during construction. The writer returns its AST without retaining stream handles; runtime readers belong to the generated SDK caller.
|
|
37
|
+
* efficient algorithms: After response-type projection, either branch allocates a fixed AST skeleton; the binary branch emits one empty stream constructor without traversing or generating payload bytes.
|
|
38
|
+
* reuse equivalent work: The returned AST belongs to this route and importer. Each generated runtime call needs its own random value or stream, so neither mutable syntax nor runtime response identity is shared.
|
|
39
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer.random composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
40
|
+
*/
|
|
16
41
|
SdkHttpSimulationProgrammer.random = (project) => (importer) => (route) => {
|
|
17
42
|
const output = SdkAliasCollection_1.SdkAliasCollection.responseBody(project)(importer)(route);
|
|
18
43
|
return constant("random")(factory_1.factory.createArrowFunction(undefined, undefined, [], project.config.primitive === false || route.success.binary === true
|
|
19
44
|
? output
|
|
20
45
|
: factory_1.factory.createTypeReferenceNode(SdkImportWizard_1.SdkImportWizard.Resolved(importer), [output]), undefined, route.success.binary === true
|
|
21
|
-
? factory_1.factory.createNewExpression(factory_1.factory.createIdentifier("ReadableStream"), [SdkAliasCollection_1.SdkAliasCollection.binaryChunk()], [
|
|
46
|
+
? factory_1.factory.createNewExpression(factory_1.factory.createIdentifier("ReadableStream"), [SdkAliasCollection_1.SdkAliasCollection.binaryChunk()], [
|
|
47
|
+
factory_1.factory.createObjectLiteralExpression([
|
|
48
|
+
factory_1.factory.createPropertyAssignment("start", factory_1.factory.createArrowFunction(undefined, undefined, [
|
|
49
|
+
factory_1.factory.createParameterDeclaration(undefined, undefined, "controller"),
|
|
50
|
+
], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier("controller"), "close"), undefined, []))),
|
|
51
|
+
]),
|
|
52
|
+
])
|
|
22
53
|
: factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [output], undefined)));
|
|
23
54
|
};
|
|
55
|
+
/**
|
|
56
|
+
* Returns `simulate`: it asserts the parameters and returns a random output,
|
|
57
|
+
* wrapped as a propagation when configured.
|
|
58
|
+
*
|
|
59
|
+
* @evidence contracts/common.md#principled-implementation The status of the wrapper is the declared one or the method's default. A response without a content type has no Content-Type entry; a declared media type supplies a string header, preserving the propagation header contract.
|
|
60
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
61
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The parameters are validated before a response is made.
|
|
62
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
63
|
+
* efficient algorithms: Parameter declarations and assertion nodes grow linearly with significant route parameters; propagation adds a fixed response wrapper and one catch block. The private assertion writer handles the connection headers separately rather than duplicating every parameter validation.
|
|
64
|
+
* reuse equivalent work: Simulation syntax contains this route's names, arguments, output type and importer aliases; this operation coordinates no reusable result across generation requests.
|
|
65
|
+
* bound retention and release resources: This function returns an AST to its caller and owns no retained cache, stream, handle or background task; runtime random response creation is documented by random.
|
|
66
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation SdkHttpSimulationProgrammer.simulate composes SDK syntax, identifiers or import bindings; it does not resolve native file identity or launch a process. Source resolution and file emission belong to their filesystem owners.
|
|
67
|
+
*/
|
|
24
68
|
SdkHttpSimulationProgrammer.simulate = (project) => (importer) => (route) => {
|
|
25
69
|
var _a;
|
|
26
70
|
const names = SdkHttpParameterProgrammer_1.SdkHttpParameterProgrammer.getNames({ project, route });
|
|
@@ -48,9 +92,9 @@ var SdkHttpSimulationProgrammer;
|
|
|
48
92
|
? factory_1.factory.createAsExpression(factory_1.factory.createObjectLiteralExpression([
|
|
49
93
|
factory_1.factory.createPropertyAssignment("success", factory_1.factory.createTrue()),
|
|
50
94
|
factory_1.factory.createPropertyAssignment("status", ExpressionFactory_1.ExpressionFactory.number((_a = route.success.status) !== null && _a !== void 0 ? _a : (route.method === "POST" ? 201 : 200))),
|
|
51
|
-
factory_1.factory.createPropertyAssignment("headers", LiteralFactory_1.LiteralFactory.write(
|
|
52
|
-
|
|
53
|
-
|
|
95
|
+
factory_1.factory.createPropertyAssignment("headers", LiteralFactory_1.LiteralFactory.write(route.success.contentType === null
|
|
96
|
+
? {}
|
|
97
|
+
: { "Content-Type": route.success.contentType })),
|
|
54
98
|
factory_1.factory.createPropertyAssignment("data", caller()),
|
|
55
99
|
], true), factory_1.factory.createTypeReferenceNode("Output"))
|
|
56
100
|
: caller()),
|
|
@@ -93,7 +137,7 @@ var SdkHttpSimulationProgrammer;
|
|
|
93
137
|
factory_1.factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(typia), "assert"), undefined, [names.access(p)])),
|
|
94
138
|
]))
|
|
95
139
|
.map(factory_1.factory.createExpressionStatement);
|
|
96
|
-
//
|
|
140
|
+
// Headers travel in the connection and receive a structural assertion.
|
|
97
141
|
if (route.headerObject !== null)
|
|
98
142
|
individual.push(factory_1.factory.createExpressionStatement(factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(names.assert), "headers"), undefined, [
|
|
99
143
|
factory_1.factory.createArrowFunction(undefined, undefined, [], undefined, undefined, factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(typia), "assert"), [factory_1.factory.createTypeReferenceNode(`${route.name}.Headers`)], [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkHttpSimulationProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpSimulationProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAUuB;AAEvB,yEAAsE;AACtE,yEAAsE;AACtE,mEAAgE;AAChE,uEAAoE;AACpE,6DAA0D;AAC1D,kDAA+C;AAI/C,6DAA0D;AAC1D,6EAA0E;AAC1E,uDAAoD;AAEpD,IAAiB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"SdkHttpSimulationProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkHttpSimulationProgrammer.ts"],"names":[],"mappings":";;;AAAA,2CAUuB;AAEvB,yEAAsE;AACtE,yEAAsE;AACtE,mEAAgE;AAChE,uEAAoE;AACpE,6DAA0D;AAC1D,kDAA+C;AAI/C,6DAA0D;AAC1D,6EAA0E;AAC1E,uDAAoD;AAEpD;;;;;;;;;;;GAWG;AACH,IAAiB,2BAA2B,CAoX3C;AApXD,WAAiB,2BAA2B;IAC1C;;;;;;;;;;;;OAYG;IACU,kCAAM,GACjB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,KAAsB,EAAQ,EAAE;QAC/B,MAAM,MAAM,GAAa,uCAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,CAC/D,QAAQ,CACT,CAAC,KAAK,CAAa,CAAC;QACrB,OAAO,QAAQ,CAAC,QAAQ,CAAC,CACvB,iBAAO,CAAC,mBAAmB,CACzB,SAAS,EACT,SAAS,EACT,EAAE,EACF,OAAO,CAAC,MAAM,CAAC,SAAS,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI;YACjE,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,iBAAO,CAAC,uBAAuB,CAC7B,iCAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAClC,CAAC,MAAM,CAAC,CACT,EACL,SAAS,EACT,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI;YAC3B,CAAC,CAAC,iBAAO,CAAC,mBAAmB,CACzB,iBAAO,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,EAC1C,CAAC,uCAAkB,CAAC,WAAW,EAAc,CAAC,EAC9C;gBACE,iB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