@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,4 +1,5 @@
|
|
|
1
1
|
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { IOperationMetadata } from "./IOperationMetadata";
|
|
2
3
|
import { IReflectImport } from "./IReflectImport";
|
|
3
4
|
import { IReflectMcpOperationParameter } from "./IReflectMcpOperationParameter";
|
|
4
5
|
import { IReflectType } from "./IReflectType";
|
|
@@ -8,6 +9,12 @@ import { IReflectType } from "./IReflectType";
|
|
|
8
9
|
* Produced by {@link ReflectMcpOperationAnalyzer.analyze}; consumed by
|
|
9
10
|
* {@link TypedMcpRouteAnalyzer.analyze} to produce the final
|
|
10
11
|
* {@link ITypedMcpRoute}.
|
|
12
|
+
*
|
|
13
|
+
* @evidence contracts/common.md#principled-implementation The record joins the route metadata of the decorator with the compile-time metadata.
|
|
14
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
15
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
16
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
17
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectMcpOperation describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
11
18
|
*/
|
|
12
19
|
export interface IReflectMcpOperation {
|
|
13
20
|
protocol: "mcp";
|
|
@@ -21,11 +28,23 @@ export interface IReflectMcpOperation {
|
|
|
21
28
|
function: Function;
|
|
22
29
|
parameters: IReflectMcpOperationParameter[];
|
|
23
30
|
returnType: IReflectType | null;
|
|
31
|
+
/** Native JSON return analysis; optional for source-only reflected inputs. */
|
|
32
|
+
returnMetadata?: IOperationMetadata.IResponse["primitive"];
|
|
24
33
|
imports: IReflectImport[];
|
|
25
34
|
description: string | null;
|
|
26
35
|
jsDocTags: IJsDocTagInfo[];
|
|
27
36
|
}
|
|
28
37
|
export declare namespace IReflectMcpOperation {
|
|
38
|
+
/**
|
|
39
|
+
* The behavior hints of a tool: read-only, destructive, idempotent, and
|
|
40
|
+
* open-world.
|
|
41
|
+
*
|
|
42
|
+
* @evidence contracts/common.md#principled-implementation The four optional flags are the hints the MCP protocol defines.
|
|
43
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
44
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
45
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
46
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectMcpOperation.IAnnotations describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
47
|
+
*/
|
|
29
48
|
interface IAnnotations {
|
|
30
49
|
readOnlyHint?: boolean;
|
|
31
50
|
destructiveHint?: boolean;
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { IOperationMetadata } from "./IOperationMetadata";
|
|
2
3
|
import { IReflectImport } from "./IReflectImport";
|
|
3
4
|
import { IReflectType } from "./IReflectType";
|
|
4
5
|
/**
|
|
5
6
|
* Parameter descriptor for an MCP tool method. Reflected from
|
|
6
7
|
* `"nestia/McpRoute/Parameters"` metadata plus compile-time type information
|
|
7
8
|
* collected by the nestia transformer.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation A tool has at most one parameter, and the record is what the SDK needs to type it.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectMcpOperationParameter describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
8
15
|
*/
|
|
9
16
|
export interface IReflectMcpOperationParameter {
|
|
10
17
|
category: "params";
|
|
11
18
|
name: string;
|
|
12
19
|
index: number;
|
|
13
20
|
type: IReflectType;
|
|
21
|
+
/** Native JSON wire analysis, retained independently of the source import. */
|
|
22
|
+
metadata?: IOperationMetadata.IResponse["primitive"];
|
|
14
23
|
imports: IReflectImport[];
|
|
15
24
|
description: string | null;
|
|
16
25
|
jsDocTags: IJsDocTagInfo[];
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { IComparable } from "tstl";
|
|
2
2
|
import { IOperationMetadata } from "../structures/IOperationMetadata";
|
|
3
|
+
/**
|
|
4
|
+
* An error or warning of the reflection: the file, the class, the function, the
|
|
5
|
+
* origin, and the contents.
|
|
6
|
+
*
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation The members locate a problem down to the part of a function, and the namespace's key orders errors by that location so a report groups them.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design A record and one key class in its namespace.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior. The key class only compares fields.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the record locates.
|
|
11
|
+
* @evidence contracts/portability.md#os-neutral-implementation file carries the original native source identity for diagnostics; class, function and from identify declarations rather than filesystem components.
|
|
12
|
+
*/
|
|
3
13
|
export interface IReflectOperationError {
|
|
4
14
|
file: string;
|
|
5
15
|
class: string;
|
|
@@ -8,9 +18,27 @@ export interface IReflectOperationError {
|
|
|
8
18
|
contents: Array<string | IOperationMetadata.IError>;
|
|
9
19
|
}
|
|
10
20
|
export declare namespace IReflectOperationError {
|
|
21
|
+
/**
|
|
22
|
+
* An ordering key of an error: file, then class, then function, then origin.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The key implements the strict weak order over the four fields that tstl's tree map requires, with an absent value ordered as the empty string.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One class with one method.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It compares fields and holds no state beyond the error.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the order.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation The key retains supplied source file spelling and declaration identifiers. Ordering is lexical for diagnostic grouping without asserting filesystem case or symlink equivalence.
|
|
29
|
+
*/
|
|
11
30
|
class Key implements Pick<IComparable<Key>, "less"> {
|
|
12
31
|
readonly error: IReflectOperationError;
|
|
13
32
|
constructor(error: IReflectOperationError);
|
|
33
|
+
/**
|
|
34
|
+
* Returns whether this key orders before the other.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation The fields are compared in order and the first that differs decides, which is a lexicographic order.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One method of chained comparisons.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It compares only the four location fields.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
40
|
+
* @evidence contracts/portability.md#os-neutral-implementation Comparison orders source identity strings and declaration fields lexically; it neither canonicalizes native paths nor treats ordering as filesystem equivalence.
|
|
41
|
+
*/
|
|
14
42
|
less(obj: Key): boolean;
|
|
15
43
|
}
|
|
16
44
|
}
|
|
@@ -3,18 +3,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IReflectOperationError = void 0;
|
|
4
4
|
var IReflectOperationError;
|
|
5
5
|
(function (IReflectOperationError) {
|
|
6
|
+
/**
|
|
7
|
+
* An ordering key of an error: file, then class, then function, then origin.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The key implements the strict weak order over the four fields that tstl's tree map requires, with an absent value ordered as the empty string.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One class with one method.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It compares fields and holds no state beyond the error.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the order.
|
|
13
|
+
* @evidence contracts/portability.md#os-neutral-implementation The key retains supplied source file spelling and declaration identifiers. Ordering is lexical for diagnostic grouping without asserting filesystem case or symlink equivalence.
|
|
14
|
+
*/
|
|
6
15
|
class Key {
|
|
7
16
|
constructor(error) {
|
|
8
17
|
this.error = error;
|
|
9
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Returns whether this key orders before the other.
|
|
21
|
+
*
|
|
22
|
+
* @evidence contracts/common.md#principled-implementation The fields are compared in order and the first that differs decides, which is a lexicographic order.
|
|
23
|
+
* @evidence contracts/common.md#clear-and-simple-design One method of chained comparisons.
|
|
24
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It compares only the four location fields.
|
|
25
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
26
|
+
* @evidence contracts/portability.md#os-neutral-implementation Comparison orders source identity strings and declaration fields lexically; it neither canonicalizes native paths nor treats ordering as filesystem equivalence.
|
|
27
|
+
*/
|
|
10
28
|
less(obj) {
|
|
11
29
|
var _a, _b, _c, _d;
|
|
12
30
|
if (this.error.file !== obj.error.file)
|
|
13
31
|
return this.error.file < obj.error.file;
|
|
14
32
|
else if (this.error.class !== obj.error.class)
|
|
15
33
|
return this.error.class < obj.error.class;
|
|
16
|
-
|
|
17
|
-
|
|
34
|
+
const leftFunction = (_a = this.error.function) !== null && _a !== void 0 ? _a : "";
|
|
35
|
+
const rightFunction = (_b = obj.error.function) !== null && _b !== void 0 ? _b : "";
|
|
36
|
+
if (leftFunction !== rightFunction)
|
|
37
|
+
return leftFunction < rightFunction;
|
|
18
38
|
return ((_c = this.error.from) !== null && _c !== void 0 ? _c : "") < ((_d = obj.error.from) !== null && _d !== void 0 ? _d : "");
|
|
19
39
|
}
|
|
20
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IReflectOperationError.js","sourceRoot":"","sources":["../../src/structures/IReflectOperationError.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IReflectOperationError.js","sourceRoot":"","sources":["../../src/structures/IReflectOperationError.ts"],"names":[],"mappings":";;;AAqBA,IAAiB,sBAAsB,CAiCtC;AAjCD,WAAiB,sBAAsB;IACrC;;;;;;;;OAQG;IACH,MAAa,GAAG;QACd,YAAmC,KAA6B;yBAA7B,KAAK;QAA2B,CAAC;QAEpE;;;;;;;;WAQG;QACI,IAAI,CAAC,GAAQ;;YAClB,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,KAAK,CAAC,IAAI;gBACpC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;iBACrC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,KAAK,CAAC,KAAK;gBAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC;YAC5C,MAAM,YAAY,SAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,mCAAI,EAAE,CAAC;YAC/C,MAAM,aAAa,SAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,mCAAI,EAAE,CAAC;YAC/C,IAAI,YAAY,KAAK,aAAa;gBAAE,OAAO,YAAY,GAAG,aAAa,CAAC;YACxE,OAAO,OAAC,IAAI,CAAC,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC,GAAG,OAAC,GAAG,CAAC,KAAK,CAAC,IAAI,mCAAI,EAAE,CAAC,CAAC;QAC1D,CAAC;KACF;IAtBY,uBAAA,GAAG,MAsBf,CAAA;AACH,CAAC,EAjCgB,sBAAsB,aAAtB,sBAAsB,GAAtB,sBAAsB,QAiCtC"}
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A reflected type: its name and, for a generic, its type arguments.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation The name is the text the transform recorded and the arguments make the type recursive.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
8
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectType describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
9
|
+
*/
|
|
1
10
|
export interface IReflectType {
|
|
2
11
|
name: string;
|
|
3
12
|
typeArguments?: IReflectType[];
|
|
@@ -2,6 +2,16 @@ import { VERSION_NEUTRAL } from "@nestjs/common";
|
|
|
2
2
|
import { IJsDocTagInfo } from "typia";
|
|
3
3
|
import { IReflectImport } from "./IReflectImport";
|
|
4
4
|
import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
|
|
5
|
+
/**
|
|
6
|
+
* A reflected WebSocket operation: its name, paths, function, versions,
|
|
7
|
+
* parameters, and imports.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The record joins the route metadata of the decorator with the compile-time metadata.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperation describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
14
|
+
*/
|
|
5
15
|
export interface IReflectWebSocketOperation {
|
|
6
16
|
protocol: "websocket";
|
|
7
17
|
name: string;
|
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
import { IJsDocTagInfo } from "typia";
|
|
2
2
|
import { IReflectImport } from "./IReflectImport";
|
|
3
3
|
import { IReflectType } from "./IReflectType";
|
|
4
|
+
/**
|
|
5
|
+
* A parameter of a WebSocket operation: an acceptor, a driver, a header, a path
|
|
6
|
+
* parameter, or a query.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The union is discriminated by `category`, and a preconfigured form carries what the decorators alone record.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design A union of five records plus the preconfigured form.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
13
|
+
*/
|
|
4
14
|
export type IReflectWebSocketOperationParameter = IReflectWebSocketOperationParameter.IAcceptor | IReflectWebSocketOperationParameter.IDriver | IReflectWebSocketOperationParameter.IHeader | IReflectWebSocketOperationParameter.IParam | IReflectWebSocketOperationParameter.IQuery;
|
|
5
15
|
export declare namespace IReflectWebSocketOperationParameter {
|
|
16
|
+
/**
|
|
17
|
+
* The parameter category `acceptor` of a WebSocket operation.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation The alias fixes the category of the shared base.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the category.
|
|
23
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter.IAcceptor describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
24
|
+
*/
|
|
6
25
|
export type IAcceptor = IBase<"acceptor">;
|
|
26
|
+
/**
|
|
27
|
+
* The parameter category `driver` of a WebSocket operation.
|
|
28
|
+
*
|
|
29
|
+
* @evidence contracts/common.md#principled-implementation The alias fixes the category of the shared base.
|
|
30
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
31
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
32
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the category.
|
|
33
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter.IDriver describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
34
|
+
*/
|
|
7
35
|
export type IDriver = IBase<"driver">;
|
|
36
|
+
/**
|
|
37
|
+
* The parameter category `header` of a WebSocket operation.
|
|
38
|
+
*
|
|
39
|
+
* @evidence contracts/common.md#principled-implementation The alias fixes the category of the shared base.
|
|
40
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
41
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
42
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the category.
|
|
43
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter.IHeader describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
44
|
+
*/
|
|
8
45
|
export type IHeader = IBase<"header">;
|
|
46
|
+
/**
|
|
47
|
+
* The parameter category `query` of a WebSocket operation.
|
|
48
|
+
*
|
|
49
|
+
* @evidence contracts/common.md#principled-implementation The alias fixes the category of the shared base.
|
|
50
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
51
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
52
|
+
* @evidence contracts/common.md#meaningful-documentation The comment names the category.
|
|
53
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter.IQuery describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
54
|
+
*/
|
|
9
55
|
export type IQuery = IBase<"query">;
|
|
56
|
+
/**
|
|
57
|
+
* A path parameter of a WebSocket operation with its field name.
|
|
58
|
+
*
|
|
59
|
+
* @evidence contracts/common.md#principled-implementation The record adds the field that names the path placeholder to the shared base.
|
|
60
|
+
* @evidence contracts/common.md#clear-and-simple-design A record extending the shared base.
|
|
61
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
62
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
63
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation IReflectWebSocketOperationParameter.IParam describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
64
|
+
*/
|
|
10
65
|
export interface IParam extends IBase<"param"> {
|
|
11
66
|
field: string;
|
|
12
67
|
}
|
|
@@ -3,6 +3,16 @@ import { INestiaProject } from "./INestiaProject";
|
|
|
3
3
|
import { ITypedHttpRoute } from "./ITypedHttpRoute";
|
|
4
4
|
import { ITypedMcpRoute } from "./ITypedMcpRoute";
|
|
5
5
|
import { ITypedWebSocketRoute } from "./ITypedWebSocketRoute";
|
|
6
|
+
/**
|
|
7
|
+
* The typed application: the project, the metadata dictionary, and the typed
|
|
8
|
+
* routes.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation The record is the input of every generator.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedApplication describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
15
|
+
*/
|
|
6
16
|
export interface ITypedApplication {
|
|
7
17
|
project: INestiaProject;
|
|
8
18
|
collection: IMetadataDictionary;
|
|
@@ -4,6 +4,16 @@ import { IReflectImport } from "./IReflectImport";
|
|
|
4
4
|
import { ITypedHttpRouteException } from "./ITypedHttpRouteException";
|
|
5
5
|
import { ITypedHttpRouteParameter } from "./ITypedHttpRouteParameter";
|
|
6
6
|
import { ITypedHttpRouteSuccess } from "./ITypedHttpRouteSuccess";
|
|
7
|
+
/**
|
|
8
|
+
* A typed HTTP route: one path of an operation with its parameters split by
|
|
9
|
+
* kind, its success, its exceptions, and its documentation.
|
|
10
|
+
*
|
|
11
|
+
* @evidence contracts/common.md#principled-implementation The reflected operation is expanded per path and its parameters are classified for the generators.
|
|
12
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
13
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
14
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
15
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRoute describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
16
|
+
*/
|
|
7
17
|
export interface ITypedHttpRoute {
|
|
8
18
|
protocol: "http";
|
|
9
19
|
function: Function;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import { OpenApi } from "@typia/interface";
|
|
2
2
|
import { MetadataSchema } from "../internal/legacy";
|
|
3
3
|
import { IReflectType } from "./IReflectType";
|
|
4
|
+
/**
|
|
5
|
+
* A typed exception: its status, description, examples, type, and resolved
|
|
6
|
+
* metadata.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The resolved metadata is what the SDK and the Swagger generators print.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteException describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
13
|
+
*/
|
|
4
14
|
export interface ITypedHttpRouteException {
|
|
5
15
|
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
6
16
|
description: string | null;
|
|
@@ -2,18 +2,63 @@ import { OpenApi } from "@typia/interface";
|
|
|
2
2
|
import { IJsDocTagInfo } from "typia";
|
|
3
3
|
import { MetadataSchema } from "../internal/legacy";
|
|
4
4
|
import { IReflectType } from "./IReflectType";
|
|
5
|
+
/**
|
|
6
|
+
* A typed parameter of a route: a body, headers, a path parameter, or a query.
|
|
7
|
+
*
|
|
8
|
+
* @evidence contracts/common.md#principled-implementation The union is discriminated by `category`, and each member carries the resolved metadata.
|
|
9
|
+
* @evidence contracts/common.md#clear-and-simple-design A union of four records.
|
|
10
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
11
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
12
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteParameter describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
13
|
+
*/
|
|
5
14
|
export type ITypedHttpRouteParameter = ITypedHttpRouteParameter.IBody | ITypedHttpRouteParameter.IHeaders | ITypedHttpRouteParameter.IPath | ITypedHttpRouteParameter.IQuery;
|
|
6
15
|
export declare namespace ITypedHttpRouteParameter {
|
|
16
|
+
/**
|
|
17
|
+
* The typed form of a body parameter.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation The record extends the shared base with the members its category adds.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design A record extending the shared base.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
23
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteParameter.IBody describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
24
|
+
*/
|
|
7
25
|
export interface IBody extends IBase<"body"> {
|
|
8
26
|
contentType: "application/json" | "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain";
|
|
9
27
|
encrypted: boolean;
|
|
10
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The typed form of a headers parameter.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/common.md#principled-implementation The record extends the shared base with the members its category adds.
|
|
33
|
+
* @evidence contracts/common.md#clear-and-simple-design A record extending the shared base.
|
|
34
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
35
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
36
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteParameter.IHeaders describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
37
|
+
*/
|
|
11
38
|
export interface IHeaders extends IBase<"headers"> {
|
|
12
39
|
field: string | null;
|
|
13
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The typed form of a path parameter parameter.
|
|
43
|
+
*
|
|
44
|
+
* @evidence contracts/common.md#principled-implementation The record extends the shared base with the members its category adds.
|
|
45
|
+
* @evidence contracts/common.md#clear-and-simple-design A record extending the shared base.
|
|
46
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
47
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
48
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteParameter.IPath describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
49
|
+
*/
|
|
14
50
|
export interface IPath extends IBase<"param"> {
|
|
15
51
|
field: string;
|
|
16
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* The typed form of a query parameter.
|
|
55
|
+
*
|
|
56
|
+
* @evidence contracts/common.md#principled-implementation The record extends the shared base with the members its category adds.
|
|
57
|
+
* @evidence contracts/common.md#clear-and-simple-design A record extending the shared base.
|
|
58
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
59
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
60
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteParameter.IQuery describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
61
|
+
*/
|
|
17
62
|
export interface IQuery extends IBase<"query"> {
|
|
18
63
|
field: string | null;
|
|
19
64
|
}
|
|
@@ -2,6 +2,16 @@ import { OpenApi } from "@typia/interface";
|
|
|
2
2
|
import { MetadataSchema } from "../internal/legacy";
|
|
3
3
|
import { HttpResponseContentTypeUtil } from "../utils/HttpResponseContentTypeUtil";
|
|
4
4
|
import { IReflectType } from "./IReflectType";
|
|
5
|
+
/**
|
|
6
|
+
* A typed success response: its type, status, content type, binary and
|
|
7
|
+
* encrypted flags, metadata, examples, and header directives.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The header directives are the `@setHeader` and `@assignHeaders` tags, which the SDK function applies to the connection.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
13
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedHttpRouteSuccess describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
14
|
+
*/
|
|
5
15
|
export interface ITypedHttpRouteSuccess {
|
|
6
16
|
type: IReflectType;
|
|
7
17
|
status: number | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { MetadataSchema } from "../internal/legacy";
|
|
2
3
|
import { IReflectController } from "./IReflectController";
|
|
3
4
|
import { IReflectImport } from "./IReflectImport";
|
|
4
5
|
import { IReflectMcpOperation } from "./IReflectMcpOperation";
|
|
@@ -10,6 +11,12 @@ import { IReflectType } from "./IReflectType";
|
|
|
10
11
|
* Carries everything the SDK generator needs to emit a typed client function:
|
|
11
12
|
* the controller reference, accessor path, typia-derived input schema, and
|
|
12
13
|
* input/output type info.
|
|
14
|
+
*
|
|
15
|
+
* @evidence contracts/common.md#principled-implementation The record is the tool operation in the form the SDK generator reads.
|
|
16
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
17
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
18
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
19
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedMcpRoute describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
13
20
|
*/
|
|
14
21
|
export interface ITypedMcpRoute {
|
|
15
22
|
protocol: "mcp";
|
|
@@ -22,6 +29,10 @@ export interface ITypedMcpRoute {
|
|
|
22
29
|
function: Function;
|
|
23
30
|
input: IReflectMcpOperationParameter | null;
|
|
24
31
|
returnType: IReflectType | null;
|
|
32
|
+
/** Resolved JSON wire graphs used by structural DTO cloning. */
|
|
33
|
+
inputMetadata?: MetadataSchema;
|
|
34
|
+
/** Absent when source-only analysis was requested without cloning. */
|
|
35
|
+
outputMetadata?: MetadataSchema;
|
|
25
36
|
inputSchema: object;
|
|
26
37
|
outputSchema: object | null;
|
|
27
38
|
annotations: IReflectMcpOperation.IAnnotations | null;
|
|
@@ -3,6 +3,16 @@ import { IJsDocTagInfo } from "typia";
|
|
|
3
3
|
import { IReflectController } from "./IReflectController";
|
|
4
4
|
import { IReflectImport } from "./IReflectImport";
|
|
5
5
|
import { ITypedWebSocketRouteParameter } from "./ITypedWebSocketRouteParameter";
|
|
6
|
+
/**
|
|
7
|
+
* A typed WebSocket route: one path with its acceptor, header, path parameters,
|
|
8
|
+
* query, and driver separated.
|
|
9
|
+
*
|
|
10
|
+
* @evidence contracts/common.md#principled-implementation The reflected operation is expanded per path and its parameters are classified.
|
|
11
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record with no behavior.
|
|
12
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
13
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes; its members are named for their meaning.
|
|
14
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ITypedWebSocketRoute describes protocol or type metadata; any embedded import/source record preserves the identity supplied by its owner. This declaration defines no native path conversion or process boundary.
|
|
15
|
+
*/
|
|
6
16
|
export interface ITypedWebSocketRoute {
|
|
7
17
|
protocol: "websocket";
|
|
8
18
|
controller: IReflectController;
|
package/lib/transform.d.ts
CHANGED
|
@@ -8,5 +8,11 @@ import type { ITtscPlugin, ITtscPluginFactoryContext } from "ttsc";
|
|
|
8
8
|
* contributor — but only for projects that actually depend on `@nestia/sdk`. A
|
|
9
9
|
* project depending on `@nestia/core` alone never links, compiles, or ships any
|
|
10
10
|
* of this SDK transform code.
|
|
11
|
+
*
|
|
12
|
+
* @evidence contracts/common.md#principled-implementation The package root is resolved through `@nestia/sdk/package.json` from the consumer's project, so the source path is the installed package's, not a workspace layout, and the descriptor returns only a name and a source directory.
|
|
13
|
+
* @evidence contracts/common.md#clear-and-simple-design One function returning two properties; the transform itself is native.
|
|
14
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The resolution goes through the package manifest, as the development rules require, and nothing is patched.
|
|
15
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the descriptor returns.
|
|
16
|
+
* @evidence contracts/portability.md#os-neutral-implementation createRequire anchors package resolution to the consumer project's package.json; Node resolution yields the installed manifest's native pathname and path.dirname/path.resolve derive the contributor source without a workspace-specific separator or shell lookup.
|
|
11
17
|
*/
|
|
12
18
|
export default function createTtscPlugin(context: ITtscPluginFactoryContext): ITtscPlugin;
|
package/lib/transform.js
CHANGED
|
@@ -15,6 +15,12 @@ const node_path_1 = __importDefault(require("node:path"));
|
|
|
15
15
|
* contributor — but only for projects that actually depend on `@nestia/sdk`. A
|
|
16
16
|
* project depending on `@nestia/core` alone never links, compiles, or ships any
|
|
17
17
|
* of this SDK transform code.
|
|
18
|
+
*
|
|
19
|
+
* @evidence contracts/common.md#principled-implementation The package root is resolved through `@nestia/sdk/package.json` from the consumer's project, so the source path is the installed package's, not a workspace layout, and the descriptor returns only a name and a source directory.
|
|
20
|
+
* @evidence contracts/common.md#clear-and-simple-design One function returning two properties; the transform itself is native.
|
|
21
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The resolution goes through the package manifest, as the development rules require, and nothing is patched.
|
|
22
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the descriptor returns.
|
|
23
|
+
* @evidence contracts/portability.md#os-neutral-implementation createRequire anchors package resolution to the consumer project's package.json; Node resolution yields the installed manifest's native pathname and path.dirname/path.resolve derive the contributor source without a workspace-specific separator or shell lookup.
|
|
18
24
|
*/
|
|
19
25
|
function createTtscPlugin(context) {
|
|
20
26
|
const requireFrom = (0, node_module_1.createRequire)(node_path_1.default.join(context.projectRoot, "package.json"));
|
package/lib/transform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,0DAA6B;AAG7B
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA4C;AAC5C,0DAA6B;AAG7B;;;;;;;;;;;;;;;GAeG;AACH,0BACE,OAAkC;IAElC,MAAM,WAAW,GAAG,IAAA,2BAAa,EAC/B,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,CAAC,CAC/C,CAAC;IACF,MAAM,IAAI,GAAW,mBAAI,CAAC,OAAO,CAC/B,WAAW,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAChD,CAAC;IACF,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,mBAAI,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;KAC5C,CAAC;AACJ,CAAC"}
|
package/lib/utils/ArrayUtil.d.ts
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array helpers of the SDK generator.
|
|
3
|
+
*
|
|
4
|
+
* @evidence contracts/common.md#principled-implementation The namespace holds a membership test and a sequential asynchronous map.
|
|
5
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
6
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts They are plain helpers.
|
|
7
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
8
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
9
|
+
*/
|
|
1
10
|
export declare namespace ArrayUtil {
|
|
11
|
+
/**
|
|
12
|
+
* Reports whether the array contains every one of the items.
|
|
13
|
+
*
|
|
14
|
+
* Membership uses `includes`, so an `undefined` or `NaN` item is found when
|
|
15
|
+
* the array holds it.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/common.md#principled-implementation `Array.prototype.includes` compares by SameValueZero and the result is the conjunction over the items.
|
|
18
|
+
* @evidence contracts/common.md#clear-and-simple-design One `every` over `includes`.
|
|
19
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No item is special-cased.
|
|
20
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the conjunction and the comparison.
|
|
21
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil.has operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
22
|
+
*/
|
|
2
23
|
function has<T>(array: T[], ...items: T[]): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Maps the elements with an asynchronous function, one after another, and
|
|
26
|
+
* returns the results in order.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/common.md#principled-implementation Each call is awaited before the next starts, so the order of the results is the order of the elements and a rejection stops the mapping.
|
|
29
|
+
* @evidence contracts/common.md#clear-and-simple-design One loop.
|
|
30
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No element is skipped or retried.
|
|
31
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the sequential order.
|
|
32
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil.asyncMap operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
33
|
+
*/
|
|
3
34
|
function asyncMap<X, Y>(array: X[], closure: (input: X) => Promise<Y>): Promise<Y[]>;
|
|
4
|
-
function asyncFilter<T>(array: T[], closure: (input: T) => Promise<boolean>): Promise<T[]>;
|
|
5
35
|
}
|
package/lib/utils/ArrayUtil.js
CHANGED
|
@@ -10,12 +10,43 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.ArrayUtil = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Array helpers of the SDK generator.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation The namespace holds a membership test and a sequential asynchronous map.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts They are plain helpers.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
20
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
21
|
+
*/
|
|
13
22
|
var ArrayUtil;
|
|
14
23
|
(function (ArrayUtil) {
|
|
24
|
+
/**
|
|
25
|
+
* Reports whether the array contains every one of the items.
|
|
26
|
+
*
|
|
27
|
+
* Membership uses `includes`, so an `undefined` or `NaN` item is found when
|
|
28
|
+
* the array holds it.
|
|
29
|
+
*
|
|
30
|
+
* @evidence contracts/common.md#principled-implementation `Array.prototype.includes` compares by SameValueZero and the result is the conjunction over the items.
|
|
31
|
+
* @evidence contracts/common.md#clear-and-simple-design One `every` over `includes`.
|
|
32
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No item is special-cased.
|
|
33
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the conjunction and the comparison.
|
|
34
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil.has operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
35
|
+
*/
|
|
15
36
|
function has(array, ...items) {
|
|
16
|
-
return items.every((
|
|
37
|
+
return items.every((item) => array.includes(item));
|
|
17
38
|
}
|
|
18
39
|
ArrayUtil.has = has;
|
|
40
|
+
/**
|
|
41
|
+
* Maps the elements with an asynchronous function, one after another, and
|
|
42
|
+
* returns the results in order.
|
|
43
|
+
*
|
|
44
|
+
* @evidence contracts/common.md#principled-implementation Each call is awaited before the next starts, so the order of the results is the order of the elements and a rejection stops the mapping.
|
|
45
|
+
* @evidence contracts/common.md#clear-and-simple-design One loop.
|
|
46
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No element is skipped or retried.
|
|
47
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the sequential order.
|
|
48
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation ArrayUtil.asyncMap operates on caller-supplied arrays and promises without resolving file identity or launching a process; callback boundaries remain the caller's responsibility.
|
|
49
|
+
*/
|
|
19
50
|
function asyncMap(array, closure) {
|
|
20
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
52
|
const ret = [];
|
|
@@ -25,15 +56,5 @@ var ArrayUtil;
|
|
|
25
56
|
});
|
|
26
57
|
}
|
|
27
58
|
ArrayUtil.asyncMap = asyncMap;
|
|
28
|
-
function asyncFilter(array, closure) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
const ret = [];
|
|
31
|
-
for (const elem of array)
|
|
32
|
-
if ((yield closure(elem)) === true)
|
|
33
|
-
ret.push(elem);
|
|
34
|
-
return ret;
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
ArrayUtil.asyncFilter = asyncFilter;
|
|
38
59
|
})(ArrayUtil || (exports.ArrayUtil = ArrayUtil = {}));
|
|
39
60
|
//# sourceMappingURL=ArrayUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrayUtil.js","sourceRoot":"","sources":["../../src/utils/ArrayUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,IAAiB,SAAS,
|
|
1
|
+
{"version":3,"file":"ArrayUtil.js","sourceRoot":"","sources":["../../src/utils/ArrayUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;GAQG;AACH,IAAiB,SAAS,CAmCzB;AAnCD,WAAiB,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,SAAgB,GAAG,CAAI,KAAU,EAAE,GAAG,KAAU;QAC9C,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC;IAFe,UAAA,GAAG,MAElB,CAAA;IAED;;;;;;;;;OASG;IACH,SAAsB,QAAQ,CAC5B,KAAU,EACV,OAAiC;;YAEjC,MAAM,GAAG,GAAQ,EAAE,CAAC;YACpB,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,GAAG,CAAC,IAAI,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;YACxD,OAAO,GAAG,CAAC;QACb,CAAC;KAAA;IAPqB,UAAA,QAAQ,WAO7B,CAAA;AACH,CAAC,EAnCgB,SAAS,aAAT,SAAS,GAAT,SAAS,QAmCzB"}
|