@nestia/sdk 14.0.0 → 14.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/assets/bundle/distribute/build-sdk.cjs +28 -0
- package/assets/bundle/distribute/package.json +7 -3
- package/assets/bundle/distribute/tsconfig.json +15 -105
- package/lib/INestiaConfig.d.ts +74 -34
- package/lib/NestiaSdkApplication.d.ts +60 -0
- package/lib/NestiaSdkApplication.js +121 -32
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/NestiaSwaggerComposer.d.ts +21 -0
- package/lib/NestiaSwaggerComposer.js +32 -13
- package/lib/NestiaSwaggerComposer.js.map +1 -1
- package/lib/analyses/AccessorAnalyzer.d.ts +26 -0
- package/lib/analyses/AccessorAnalyzer.js +26 -0
- package/lib/analyses/AccessorAnalyzer.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.d.ts +41 -0
- package/lib/analyses/ConfigAnalyzer.js +52 -77
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +25 -0
- package/lib/analyses/ImportAnalyzer.js +25 -0
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ParameterNameAnalyzer.d.ts +44 -0
- package/lib/analyses/ParameterNameAnalyzer.js +63 -0
- package/lib/analyses/ParameterNameAnalyzer.js.map +1 -0
- package/lib/analyses/PathAnalyzer.d.ts +93 -1
- package/lib/analyses/PathAnalyzer.js +160 -23
- package/lib/analyses/PathAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectControllerAnalyzer.js +24 -1
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +35 -24
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.d.ts +31 -0
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js +21 -0
- package/lib/analyses/ReflectHttpOperationExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +31 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +143 -23
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +32 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +27 -2
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMcpOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectMcpOperationAnalyzer.js +35 -11
- package/lib/analyses/ReflectMcpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectMetadataAnalyzer.d.ts +47 -0
- package/lib/analyses/ReflectMetadataAnalyzer.js +47 -0
- package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +29 -0
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +27 -5
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/SecurityAnalyzer.d.ts +25 -0
- package/lib/analyses/SecurityAnalyzer.js +39 -19
- package/lib/analyses/SecurityAnalyzer.js.map +1 -1
- package/lib/analyses/SwaggerExampleAnalyzer.d.ts +31 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js +36 -0
- package/lib/analyses/SwaggerExampleAnalyzer.js.map +1 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +41 -3
- package/lib/analyses/TypedHttpRouteAnalyzer.js +196 -172
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedMcpRouteAnalyzer.d.ts +29 -0
- package/lib/analyses/TypedMcpRouteAnalyzer.js +152 -20
- package/lib/analyses/TypedMcpRouteAnalyzer.js.map +1 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +19 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +20 -1
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -1
- package/lib/decorators/OperationMetadata.d.ts +6 -0
- package/lib/decorators/OperationMetadata.js +6 -0
- package/lib/decorators/OperationMetadata.js.map +1 -1
- package/lib/executable/internal/CommandParser.d.ts +19 -0
- package/lib/executable/internal/CommandParser.js +19 -0
- package/lib/executable/internal/CommandParser.js.map +1 -1
- package/lib/executable/internal/NestiaConfigLoader.d.ts +56 -0
- package/lib/executable/internal/NestiaConfigLoader.js +48 -42
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.d.ts +60 -0
- package/lib/executable/internal/NestiaSdkCommand.js +95 -3
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/executable/internal/NestiaSdkWatcher.d.ts +81 -0
- package/lib/executable/internal/NestiaSdkWatcher.js +125 -41
- package/lib/executable/internal/NestiaSdkWatcher.js.map +1 -1
- package/lib/executable/internal/NestiaSwaggerWatch.d.ts +80 -0
- package/lib/executable/internal/NestiaSwaggerWatch.js +308 -0
- package/lib/executable/internal/NestiaSwaggerWatch.js.map +1 -0
- package/lib/executable/sdk.js +16 -1
- package/lib/executable/sdk.js.map +1 -1
- package/lib/factories/ExpressionFactory.d.ts +18 -0
- package/lib/factories/ExpressionFactory.js +21 -2
- package/lib/factories/ExpressionFactory.js.map +1 -1
- package/lib/factories/IdentifierFactory.d.ts +24 -0
- package/lib/factories/IdentifierFactory.js +24 -0
- package/lib/factories/IdentifierFactory.js.map +1 -1
- package/lib/factories/LiteralFactory.d.ts +22 -4
- package/lib/factories/LiteralFactory.js +33 -11
- package/lib/factories/LiteralFactory.js.map +1 -1
- package/lib/factories/StatementFactory.d.ts +28 -1
- package/lib/factories/StatementFactory.js +28 -1
- package/lib/factories/StatementFactory.js.map +1 -1
- package/lib/factories/TypeFactory.d.ts +24 -0
- package/lib/factories/TypeFactory.js +15 -0
- package/lib/factories/TypeFactory.js.map +1 -1
- package/lib/generates/CloneGenerator.d.ts +22 -0
- package/lib/generates/CloneGenerator.js +26 -5
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/E2eGenerator.d.ts +19 -0
- package/lib/generates/E2eGenerator.js +19 -0
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.d.ts +38 -0
- package/lib/generates/SdkGenerator.js +43 -5
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.d.ts +36 -6
- package/lib/generates/SwaggerGenerator.js +190 -40
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.d.ts +19 -0
- package/lib/generates/internal/E2eFileProgrammer.js +20 -1
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/FilePrinter.d.ts +57 -0
- package/lib/generates/internal/FilePrinter.js +74 -0
- package/lib/generates/internal/FilePrinter.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +93 -1
- package/lib/generates/internal/ImportDictionary.js +103 -2
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +121 -1
- package/lib/generates/internal/SdkAliasCollection.js +132 -11
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +19 -0
- package/lib/generates/internal/SdkDistributionComposer.js +149 -52
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkFileProgrammer.js +101 -12
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +29 -0
- package/lib/generates/internal/SdkHttpCloneProgrammer.js +33 -0
- package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpCloneReferencer.js +78 -25
- package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +40 -23
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +46 -34
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +142 -1
- package/lib/generates/internal/SdkHttpParameterProgrammer.js +175 -6
- package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +20 -0
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +36 -32
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +38 -0
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +66 -18
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.d.ts +63 -0
- package/lib/generates/internal/SdkImportWizard.js +63 -0
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +17 -2
- package/lib/generates/internal/SdkMcpRouteProgrammer.js +72 -24
- package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkPathTemplate.d.ts +36 -0
- package/lib/generates/internal/SdkPathTemplate.js +65 -0
- package/lib/generates/internal/SdkPathTemplate.js.map +1 -0
- package/lib/generates/internal/SdkRouteDirectory.d.ts +10 -0
- package/lib/generates/internal/SdkRouteDirectory.js +10 -0
- package/lib/generates/internal/SdkRouteDirectory.js.map +1 -1
- package/lib/generates/internal/SdkTypeProgrammer.d.ts +54 -1
- package/lib/generates/internal/SdkTypeProgrammer.js +111 -27
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +53 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.js +407 -67
- package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.d.ts +40 -0
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js +149 -142
- package/lib/generates/internal/SdkWebSocketCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +19 -0
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +46 -36
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +114 -1
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +120 -5
- package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +18 -0
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +75 -33
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +42 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationComposer.d.ts +18 -0
- package/lib/generates/internal/SwaggerOperationComposer.js +37 -8
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +40 -1
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +230 -25
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -1
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +21 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +58 -7
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -1
- package/lib/internal/legacy.d.ts +342 -31
- package/lib/internal/legacy.js +207 -31
- package/lib/internal/legacy.js.map +1 -1
- package/lib/structures/INestiaProject.d.ts +10 -0
- package/lib/structures/INestiaSdkInput.d.ts +30 -0
- package/lib/structures/IOperationMetadata.d.ts +77 -0
- package/lib/structures/IReflectController.d.ts +10 -0
- package/lib/structures/IReflectHttpOperation.d.ts +10 -0
- package/lib/structures/IReflectHttpOperationException.d.ts +13 -2
- package/lib/structures/IReflectHttpOperationParameter.d.ts +55 -3
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +15 -3
- package/lib/structures/IReflectImport.d.ts +10 -0
- package/lib/structures/IReflectMcpOperation.d.ts +19 -0
- package/lib/structures/IReflectMcpOperationParameter.d.ts +9 -0
- package/lib/structures/IReflectOperationError.d.ts +28 -0
- package/lib/structures/IReflectOperationError.js +22 -2
- package/lib/structures/IReflectOperationError.js.map +1 -1
- package/lib/structures/IReflectType.d.ts +9 -0
- package/lib/structures/IReflectWebSocketOperation.d.ts +10 -0
- package/lib/structures/IReflectWebSocketOperationParameter.d.ts +55 -0
- package/lib/structures/ITypedApplication.d.ts +10 -0
- package/lib/structures/ITypedHttpRoute.d.ts +18 -0
- package/lib/structures/ITypedHttpRouteException.d.ts +13 -1
- package/lib/structures/ITypedHttpRouteParameter.d.ts +48 -1
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +13 -1
- package/lib/structures/ITypedMcpRoute.d.ts +11 -0
- package/lib/structures/ITypedWebSocketRoute.d.ts +18 -0
- package/lib/transform.d.ts +6 -0
- package/lib/transform.js +6 -0
- package/lib/transform.js.map +1 -1
- package/lib/utils/ArrayUtil.d.ts +31 -1
- package/lib/utils/ArrayUtil.js +32 -11
- package/lib/utils/ArrayUtil.js.map +1 -1
- package/lib/utils/EmittedJavaScriptPatcher.d.ts +20 -0
- package/lib/utils/EmittedJavaScriptPatcher.js +65 -46
- package/lib/utils/EmittedJavaScriptPatcher.js.map +1 -1
- package/lib/utils/FileRetriever.d.ts +29 -0
- package/lib/utils/FileRetriever.js +29 -0
- package/lib/utils/FileRetriever.js.map +1 -1
- package/lib/utils/HttpResponseContentTypeUtil.d.ts +41 -0
- package/lib/utils/HttpResponseContentTypeUtil.js +31 -0
- package/lib/utils/HttpResponseContentTypeUtil.js.map +1 -1
- package/lib/utils/MapUtil.d.ts +64 -1
- package/lib/utils/MapUtil.js +24 -3
- package/lib/utils/MapUtil.js.map +1 -1
- package/lib/utils/PathUtil.d.ts +31 -0
- package/lib/utils/PathUtil.js +38 -0
- package/lib/utils/PathUtil.js.map +1 -1
- package/lib/utils/SdkBundlePath.d.ts +2 -0
- package/lib/utils/SdkBundlePath.js +10 -0
- package/lib/utils/SdkBundlePath.js.map +1 -0
- package/lib/utils/SdkInputFilter.d.ts +31 -0
- package/lib/utils/SdkInputFilter.js +115 -0
- package/lib/utils/SdkInputFilter.js.map +1 -0
- package/lib/utils/SourceFinder.d.ts +45 -0
- package/lib/utils/SourceFinder.js +74 -16
- package/lib/utils/SourceFinder.js.map +1 -1
- package/lib/utils/StringUtil.d.ts +77 -2
- package/lib/utils/StringUtil.js +166 -4
- package/lib/utils/StringUtil.js.map +1 -1
- package/lib/utils/TemporaryDirectory.d.ts +60 -0
- package/lib/utils/TemporaryDirectory.js +112 -0
- package/lib/utils/TemporaryDirectory.js.map +1 -0
- package/lib/utils/TsConfigReader.d.ts +42 -0
- package/lib/utils/TsConfigReader.js +98 -14
- package/lib/utils/TsConfigReader.js.map +1 -1
- package/lib/utils/TtscExecutor.d.ts +23 -1
- package/lib/utils/TtscExecutor.js +22 -0
- package/lib/utils/TtscExecutor.js.map +1 -1
- package/lib/utils/VersioningStrategy.d.ts +39 -2
- package/lib/utils/VersioningStrategy.js +46 -13
- package/lib/utils/VersioningStrategy.js.map +1 -1
- package/lib/validators/TextPlainValidator.d.ts +19 -0
- package/lib/validators/TextPlainValidator.js +19 -0
- package/lib/validators/TextPlainValidator.js.map +1 -1
- package/native/go.mod +1 -1
- package/native/go.sum +2 -2
- package/native/sdk/register.go +12 -2
- package/native/sdk/sdk_http_rules.go +210 -0
- package/native/sdk/sdk_metadata_json.go +79 -4
- package/native/sdk/sdk_transform.go +1157 -414
- package/package.json +8 -6
- package/src/INestiaConfig.ts +74 -34
- package/src/NestiaSdkApplication.ts +129 -41
- package/src/NestiaSwaggerComposer.ts +32 -14
- package/src/analyses/AccessorAnalyzer.ts +26 -0
- package/src/analyses/ConfigAnalyzer.ts +52 -90
- package/src/analyses/ImportAnalyzer.ts +25 -0
- package/src/analyses/ParameterNameAnalyzer.ts +75 -0
- package/src/analyses/PathAnalyzer.ts +167 -23
- package/src/analyses/ReflectControllerAnalyzer.ts +34 -1
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +36 -14
- package/src/analyses/ReflectHttpOperationExceptionAnalyzer.ts +31 -0
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +153 -39
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +38 -7
- package/src/analyses/ReflectMcpOperationAnalyzer.ts +38 -3
- package/src/analyses/ReflectMetadataAnalyzer.ts +47 -0
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +40 -7
- package/src/analyses/SecurityAnalyzer.ts +45 -20
- package/src/analyses/SwaggerExampleAnalyzer.ts +39 -0
- package/src/analyses/TypedHttpRouteAnalyzer.ts +263 -198
- package/src/analyses/TypedMcpRouteAnalyzer.ts +180 -20
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +20 -0
- package/src/decorators/OperationMetadata.ts +6 -0
- package/src/executable/internal/CommandParser.ts +19 -0
- package/src/executable/internal/NestiaConfigLoader.ts +66 -50
- package/src/executable/internal/NestiaSdkCommand.ts +96 -3
- package/src/executable/internal/NestiaSdkWatcher.ts +172 -44
- package/src/executable/internal/NestiaSwaggerWatch.ts +359 -0
- package/src/executable/sdk.ts +24 -1
- package/src/factories/ExpressionFactory.ts +23 -2
- package/src/factories/IdentifierFactory.ts +24 -0
- package/src/factories/LiteralFactory.ts +51 -13
- package/src/factories/StatementFactory.ts +28 -1
- package/src/factories/TypeFactory.ts +24 -0
- package/src/generates/CloneGenerator.ts +26 -5
- package/src/generates/E2eGenerator.ts +19 -0
- package/src/generates/SdkGenerator.ts +43 -12
- package/src/generates/SwaggerGenerator.ts +229 -46
- package/src/generates/internal/E2eFileProgrammer.ts +20 -0
- package/src/generates/internal/FilePrinter.ts +71 -0
- package/src/generates/internal/ImportDictionary.ts +120 -2
- package/src/generates/internal/SdkAliasCollection.ts +144 -15
- package/src/generates/internal/SdkDistributionComposer.ts +181 -56
- package/src/generates/internal/SdkFileProgrammer.ts +126 -16
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +55 -0
- package/src/generates/internal/SdkHttpCloneReferencer.ts +97 -23
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +47 -30
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +53 -64
- package/src/generates/internal/SdkHttpParameterProgrammer.ts +295 -13
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +37 -31
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +122 -18
- package/src/generates/internal/SdkImportWizard.ts +63 -0
- package/src/generates/internal/SdkMcpRouteProgrammer.ts +150 -33
- package/src/generates/internal/SdkPathTemplate.ts +88 -0
- package/src/generates/internal/SdkRouteDirectory.ts +10 -0
- package/src/generates/internal/SdkTypeProgrammer.ts +137 -36
- package/src/generates/internal/SdkTypeTagProgrammer.ts +536 -78
- package/src/generates/internal/SdkWebSocketCloneProgrammer.ts +185 -142
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +62 -68
- package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +205 -5
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +89 -48
- package/src/generates/internal/SwaggerDescriptionComposer.ts +47 -1
- package/src/generates/internal/SwaggerOperationComposer.ts +38 -6
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +318 -36
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +74 -11
- package/src/internal/legacy-augmentation.d.ts +16 -0
- package/src/internal/legacy.ts +407 -49
- package/src/structures/INestiaProject.ts +10 -0
- package/src/structures/INestiaSdkInput.ts +30 -0
- package/src/structures/IOperationMetadata.ts +83 -0
- package/src/structures/IReflectController.ts +10 -0
- package/src/structures/IReflectHttpOperation.ts +10 -0
- package/src/structures/IReflectHttpOperationException.ts +17 -2
- package/src/structures/IReflectHttpOperationParameter.ts +56 -2
- package/src/structures/IReflectHttpOperationSuccess.ts +19 -3
- package/src/structures/IReflectImport.ts +10 -0
- package/src/structures/IReflectMcpOperation.ts +19 -0
- package/src/structures/IReflectMcpOperationParameter.ts +9 -0
- package/src/structures/IReflectOperationError.ts +31 -2
- package/src/structures/IReflectType.ts +9 -0
- package/src/structures/IReflectWebSocketOperation.ts +10 -0
- package/src/structures/IReflectWebSocketOperationParameter.ts +55 -0
- package/src/structures/ITypedApplication.ts +10 -0
- package/src/structures/ITypedHttpRoute.ts +18 -0
- package/src/structures/ITypedHttpRouteException.ts +14 -1
- package/src/structures/ITypedHttpRouteParameter.ts +48 -1
- package/src/structures/ITypedHttpRouteSuccess.ts +14 -1
- package/src/structures/ITypedMcpRoute.ts +12 -0
- package/src/structures/ITypedWebSocketRoute.ts +18 -0
- package/src/transform.ts +6 -0
- package/src/utils/ArrayUtil.ts +32 -13
- package/src/utils/EmittedJavaScriptPatcher.ts +70 -47
- package/src/utils/FileRetriever.ts +29 -0
- package/src/utils/HttpResponseContentTypeUtil.ts +41 -0
- package/src/utils/MapUtil.ts +68 -3
- package/src/utils/PathUtil.ts +38 -0
- package/src/utils/SdkBundlePath.ts +11 -0
- package/src/utils/SdkInputFilter.ts +108 -0
- package/src/utils/SourceFinder.ts +76 -18
- package/src/utils/StringUtil.ts +182 -5
- package/src/utils/TemporaryDirectory.ts +108 -0
- package/src/utils/TsConfigReader.ts +124 -26
- package/src/utils/TtscExecutor.ts +23 -1
- package/src/utils/VersioningStrategy.ts +51 -16
- package/src/validators/TextPlainValidator.ts +19 -0
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.d.ts +0 -9
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js +0 -178
- package/lib/generates/internal/SwaggerReadonlyArrayEmender.js.map +0 -1
- package/lib/validators/HttpHeadersValidator.d.ts +0 -11
- package/lib/validators/HttpHeadersValidator.js +0 -15
- package/lib/validators/HttpHeadersValidator.js.map +0 -1
- package/lib/validators/HttpQueryValidator.d.ts +0 -10
- package/lib/validators/HttpQueryValidator.js +0 -14
- package/lib/validators/HttpQueryValidator.js.map +0 -1
- package/src/generates/internal/SwaggerReadonlyArrayEmender.ts +0 -264
- package/src/validators/HttpHeadersValidator.ts +0 -12
- package/src/validators/HttpQueryValidator.ts +0 -11
package/lib/internal/legacy.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
+
/// <reference path="../../src/internal/legacy-augmentation.d.ts" preserve="true" />
|
|
1
2
|
import type { IJsonSchemaCollection, IMetadataComponents, IMetadataSchema, IMetadataTypeTag, OpenApi } from "@typia/interface";
|
|
2
|
-
declare module "@typia/interface" {
|
|
3
|
-
namespace IMetadataSchema {
|
|
4
|
-
interface IReference {
|
|
5
|
-
type?: IArrayType | ITupleType | IObjectType | IAliasType;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
3
|
/**
|
|
10
4
|
* Plain `IMetadataSchema` augmented with the fields the nestia transform
|
|
11
5
|
* pre-bakes. `size`, `name`, and `empty` replace the methods the legacy
|
|
@@ -18,6 +12,12 @@ declare module "@typia/interface" {
|
|
|
18
12
|
* overlay — still satisfy the type when passed through legacy utilities. The
|
|
19
13
|
* utilities read the fields via the optional accessor and fall back when
|
|
20
14
|
* absent.
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/common.md#principled-implementation The plain metadata carries baked members the legacy class computed by methods, and each is optional because nested metadata does not carry them.
|
|
17
|
+
* @evidence contracts/common.md#clear-and-simple-design One extending interface.
|
|
18
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
19
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the baked fields.
|
|
20
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
21
21
|
*/
|
|
22
22
|
export interface IReflectMetadata extends IMetadataSchema {
|
|
23
23
|
size?: number;
|
|
@@ -25,6 +25,16 @@ export interface IReflectMetadata extends IMetadataSchema {
|
|
|
25
25
|
empty?: boolean;
|
|
26
26
|
jsonSchema?: IReflectJsonSchema;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* The JSON schema that the transform bakes beside a metadata: the version, the
|
|
30
|
+
* components, the schema, and the schema of each property.
|
|
31
|
+
*
|
|
32
|
+
* @evidence contracts/common.md#principled-implementation The bake is data produced by the Go side, so the record only names its parts.
|
|
33
|
+
* @evidence contracts/common.md#clear-and-simple-design A record.
|
|
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 and its members state what each part is.
|
|
36
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
37
|
+
*/
|
|
28
38
|
export interface IReflectJsonSchema {
|
|
29
39
|
version: "3.0" | "3.1";
|
|
30
40
|
components: OpenApi.IComponents;
|
|
@@ -34,6 +44,12 @@ export interface IReflectJsonSchema {
|
|
|
34
44
|
* Cross-reference dictionary produced by `MetadataComponents.from`. Each map is
|
|
35
45
|
* keyed by the entry's `.name`, matching the lookup pattern the legacy
|
|
36
46
|
* `MetadataComponents.dictionary` getter offered.
|
|
47
|
+
*
|
|
48
|
+
* @evidence contracts/common.md#principled-implementation Four maps by kind let a reference be resolved by name in constant time.
|
|
49
|
+
* @evidence contracts/common.md#clear-and-simple-design A four-member record.
|
|
50
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
51
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the four kinds.
|
|
52
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
37
53
|
*/
|
|
38
54
|
export interface IMetadataDictionary {
|
|
39
55
|
objects: Map<string, IMetadataSchema.IObjectType>;
|
|
@@ -41,25 +57,110 @@ export interface IMetadataDictionary {
|
|
|
41
57
|
arrays: Map<string, IMetadataSchema.IArrayType>;
|
|
42
58
|
tuples: Map<string, IMetadataSchema.ITupleType>;
|
|
43
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The name the SDK uses for a metadata schema.
|
|
62
|
+
*
|
|
63
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
64
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
65
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
66
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
67
|
+
*/
|
|
44
68
|
export type MetadataSchema = IMetadataSchema;
|
|
69
|
+
/**
|
|
70
|
+
* The components of a metadata together with their dictionary.
|
|
71
|
+
*
|
|
72
|
+
* @evidence contracts/common.md#principled-implementation The intersection adds the name index to the plain components.
|
|
73
|
+
* @evidence contracts/common.md#clear-and-simple-design One intersection type and a namespace with one builder.
|
|
74
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior. The builder only indexes.
|
|
75
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the added dictionary.
|
|
76
|
+
*/
|
|
45
77
|
export type MetadataComponents = IMetadataComponents & {
|
|
46
78
|
dictionary: IMetadataDictionary;
|
|
47
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* The name the SDK uses for an alias type.
|
|
82
|
+
*
|
|
83
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
84
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
85
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
86
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
87
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
88
|
+
*/
|
|
48
89
|
export type MetadataAliasType = IMetadataSchema.IAliasType;
|
|
90
|
+
/**
|
|
91
|
+
* The name the SDK uses for an array type.
|
|
92
|
+
*
|
|
93
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
94
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
95
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
96
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
97
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
98
|
+
*/
|
|
49
99
|
export type MetadataArrayType = IMetadataSchema.IArrayType;
|
|
100
|
+
/**
|
|
101
|
+
* The name the SDK uses for a tuple type.
|
|
102
|
+
*
|
|
103
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
104
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
105
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
106
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
107
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
108
|
+
*/
|
|
50
109
|
export type MetadataTupleType = IMetadataSchema.ITupleType;
|
|
110
|
+
/**
|
|
111
|
+
* The name the SDK uses for an object type.
|
|
112
|
+
*
|
|
113
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
114
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
115
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
116
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
117
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
118
|
+
*/
|
|
51
119
|
export type MetadataObjectType = IMetadataSchema.IObjectType;
|
|
120
|
+
/**
|
|
121
|
+
* The name the SDK uses for an atomic type.
|
|
122
|
+
*
|
|
123
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
124
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
125
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
126
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
127
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
128
|
+
*/
|
|
52
129
|
export type MetadataAtomic = IMetadataSchema.IAtomic;
|
|
53
130
|
/**
|
|
54
131
|
* Flattened constant-value shape: typia v13 splits `IConstant.IValue<T>` by the
|
|
55
132
|
* atomic discriminator, but sdk's literal writer just needs the runtime `value`
|
|
56
133
|
* payload, so collapse the union to a single ergonomic shape.
|
|
134
|
+
*
|
|
135
|
+
* @evidence contracts/common.md#principled-implementation The generators need only the value payload, so the union is collapsed into one shape.
|
|
136
|
+
* @evidence contracts/common.md#clear-and-simple-design A two-member record.
|
|
137
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
138
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the flattening.
|
|
139
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
57
140
|
*/
|
|
58
141
|
export interface MetadataConstantValue {
|
|
59
142
|
value: string | number | bigint | boolean;
|
|
60
143
|
tags: IMetadataTypeTag[][];
|
|
61
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* The name the SDK uses for an escaped type.
|
|
147
|
+
*
|
|
148
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
149
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
150
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
151
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
152
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
153
|
+
*/
|
|
62
154
|
export type MetadataEscaped = IMetadataSchema.IEscaped;
|
|
155
|
+
/**
|
|
156
|
+
* The name the SDK uses for an object property.
|
|
157
|
+
*
|
|
158
|
+
* @evidence contracts/common.md#principled-implementation The alias maps the legacy class name to the plain interface of typia, so the generators keep their names.
|
|
159
|
+
* @evidence contracts/common.md#clear-and-simple-design One alias.
|
|
160
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
161
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the alias stands for.
|
|
162
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
163
|
+
*/
|
|
63
164
|
export type MetadataProperty = IMetadataSchema.IProperty;
|
|
64
165
|
/**
|
|
65
166
|
* Reference to a named array/tuple/object/alias type. typia v13's plain
|
|
@@ -68,37 +169,152 @@ export type MetadataProperty = IMetadataSchema.IProperty;
|
|
|
68
169
|
* dictionary. `MetadataSchema.from` walks the metadata tree once and attaches
|
|
69
170
|
* the resolved `.type` field so downstream sdk code can keep its `ref.type`
|
|
70
171
|
* access pattern.
|
|
172
|
+
*
|
|
173
|
+
* @evidence contracts/common.md#principled-implementation The reference is the plain interface plus the `type` that `MetadataSchema.from` resolves against the dictionary.
|
|
174
|
+
* @evidence contracts/common.md#clear-and-simple-design One intersection type.
|
|
175
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
176
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the resolved member.
|
|
177
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
71
178
|
*/
|
|
72
179
|
export type MetadataArray = IMetadataSchema.IReference & {
|
|
73
180
|
type: MetadataArrayType;
|
|
74
181
|
};
|
|
182
|
+
/**
|
|
183
|
+
* A reference to a named tuple type, with the resolved type attached.
|
|
184
|
+
*
|
|
185
|
+
* @evidence contracts/common.md#principled-implementation The reference is the plain interface plus the `type` that `MetadataSchema.from` resolves against the dictionary.
|
|
186
|
+
* @evidence contracts/common.md#clear-and-simple-design One intersection type.
|
|
187
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
188
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the resolved member.
|
|
189
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
190
|
+
*/
|
|
75
191
|
export type MetadataTuple = IMetadataSchema.IReference & {
|
|
76
192
|
type: MetadataTupleType;
|
|
77
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* A reference to a named object type, with the resolved type attached.
|
|
196
|
+
*
|
|
197
|
+
* @evidence contracts/common.md#principled-implementation The reference is the plain interface plus the `type` that `MetadataSchema.from` resolves against the dictionary.
|
|
198
|
+
* @evidence contracts/common.md#clear-and-simple-design One intersection type.
|
|
199
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
200
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the resolved member.
|
|
201
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
202
|
+
*/
|
|
78
203
|
export type MetadataObject = IMetadataSchema.IReference & {
|
|
79
204
|
type: MetadataObjectType;
|
|
80
205
|
};
|
|
206
|
+
/**
|
|
207
|
+
* A reference to a named alias type, with the resolved type attached.
|
|
208
|
+
*
|
|
209
|
+
* @evidence contracts/common.md#principled-implementation The reference is the plain interface plus the `type` that `MetadataSchema.from` resolves against the dictionary.
|
|
210
|
+
* @evidence contracts/common.md#clear-and-simple-design One intersection type.
|
|
211
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
212
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the resolved member.
|
|
213
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
214
|
+
*/
|
|
81
215
|
export type MetadataAlias = IMetadataSchema.IReference & {
|
|
82
216
|
type: MetadataAliasType;
|
|
83
217
|
};
|
|
84
|
-
/**
|
|
218
|
+
/**
|
|
219
|
+
* `MetadataSchema.size()` → reads the pre-baked `size` field.
|
|
220
|
+
*
|
|
221
|
+
* @evidence contracts/common.md#principled-implementation The transform bakes the size, which replaces a method of the legacy class.
|
|
222
|
+
* @evidence contracts/common.md#clear-and-simple-design One read.
|
|
223
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reads the baked field.
|
|
224
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the fallback.
|
|
225
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
226
|
+
*/
|
|
85
227
|
export declare const sizeOf: (m: IMetadataSchema) => number;
|
|
86
|
-
/**
|
|
228
|
+
/**
|
|
229
|
+
* `MetadataSchema.getName()` → reads the pre-baked `name` field.
|
|
230
|
+
*
|
|
231
|
+
* @evidence contracts/common.md#principled-implementation The transform bakes the name, which replaces a method of the legacy class.
|
|
232
|
+
* @evidence contracts/common.md#clear-and-simple-design One read.
|
|
233
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reads the baked field.
|
|
234
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the fallback.
|
|
235
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
236
|
+
*/
|
|
87
237
|
export declare const nameOf: (m: IMetadataSchema) => string;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
238
|
+
/**
|
|
239
|
+
* A property is required only when neither omission nor undefined is allowed.
|
|
240
|
+
*
|
|
241
|
+
* @evidence contracts/common.md#principled-implementation Both flags must exclude absence, so the conjunction with the negated optional flag is the definition.
|
|
242
|
+
* @evidence contracts/common.md#clear-and-simple-design One expression.
|
|
243
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It reads two flags.
|
|
244
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the definition.
|
|
245
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
246
|
+
*/
|
|
91
247
|
export declare const isRequiredOf: (m: IMetadataSchema) => boolean;
|
|
248
|
+
/**
|
|
249
|
+
* Reads a constant's value as the SDK's Go contributor writes it.
|
|
250
|
+
*
|
|
251
|
+
* JSON holds neither a bigint nor NaN or ±Infinity, so the metadata carries a
|
|
252
|
+
* bigint value as its decimal digits and a non-finite number by its name
|
|
253
|
+
* (`"Infinity"`), both as strings. `type` is the constant's type, which is its
|
|
254
|
+
* value's own, so a bigint or number constant's string is always one of those;
|
|
255
|
+
* every other value is returned as it is.
|
|
256
|
+
*
|
|
257
|
+
* @evidence contracts/common.md#principled-implementation JSON holds neither bigint nor a non-finite number, so those are carried as strings and converted back by the constant's own type.
|
|
258
|
+
* @evidence contracts/common.md#clear-and-simple-design One conditional.
|
|
259
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The conversion follows the documented encoding.
|
|
260
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the encoding.
|
|
261
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
262
|
+
*/
|
|
263
|
+
export declare const decodeMetadataValue: (type: string, value: unknown) => unknown;
|
|
264
|
+
/**
|
|
265
|
+
* Reads a type tag's value as the SDK's Go contributor writes it.
|
|
266
|
+
*
|
|
267
|
+
* A tag's `target` is the type it tags, not its value's: `tags.Sequence<1>` on
|
|
268
|
+
* a bigint holds a number, and `tags.Example<"Infinity">` on a number holds a
|
|
269
|
+
* string. So a value encoded as a string, a bigint's digits or a non-finite
|
|
270
|
+
* number's name, arrives with the type it stands for in `encoding`.
|
|
271
|
+
*
|
|
272
|
+
* @evidence contracts/common.md#principled-implementation A tag's target is the type it tags, so a value carried as a string states the type it stands for in `encoding`.
|
|
273
|
+
* @evidence contracts/common.md#clear-and-simple-design One conditional over `decodeMetadataValue`.
|
|
274
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It follows the documented encoding.
|
|
275
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states why the encoding exists.
|
|
276
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
277
|
+
*/
|
|
278
|
+
export declare const decodeTagValue: (tag: IMetadataTypeTag & {
|
|
279
|
+
encoding?: "bigint" | "number";
|
|
280
|
+
}) => unknown;
|
|
92
281
|
/**
|
|
93
282
|
* Equivalent of the legacy `MetadataSchema.isSoleLiteral()` method: `true` when
|
|
94
283
|
* the schema represents exactly one constant literal value and nothing else.
|
|
95
284
|
* Used by sdk's type printer to fall back to literal emission instead of a
|
|
96
285
|
* union.
|
|
286
|
+
*
|
|
287
|
+
* @evidence contracts/common.md#principled-implementation Every other form must be empty, the metadata must not be nullable, any, rest, or escaped, and there must be one constant with one value.
|
|
288
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of guards.
|
|
289
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The list of forms is exhaustive over the metadata's members.
|
|
290
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the meaning.
|
|
291
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
97
292
|
*/
|
|
98
293
|
export declare const isSoleLiteralOf: (m: IMetadataSchema) => boolean;
|
|
294
|
+
/**
|
|
295
|
+
* Indexes metadata component names in memory; component names are symbolic type
|
|
296
|
+
* identities rather than native pathnames.
|
|
297
|
+
*
|
|
298
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Indexes metadata component names in memory; component names are symbolic type identities rather than native pathnames.
|
|
299
|
+
*/
|
|
99
300
|
export declare namespace MetadataComponents {
|
|
301
|
+
/**
|
|
302
|
+
* Builds the components with a dictionary indexing each kind by name.
|
|
303
|
+
*
|
|
304
|
+
* @evidence contracts/common.md#principled-implementation Each kind is a map from name to type, and the plain components are kept beside it.
|
|
305
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
306
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It only indexes.
|
|
307
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result.
|
|
308
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
309
|
+
*/
|
|
100
310
|
const from: (plain: IMetadataComponents) => MetadataComponents;
|
|
101
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Resolves symbolic type references in a metadata graph; dictionary lookup owns
|
|
314
|
+
* no native file or process boundary.
|
|
315
|
+
*
|
|
316
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Resolves symbolic type references in a metadata graph; dictionary lookup owns no native file or process boundary.
|
|
317
|
+
*/
|
|
102
318
|
export declare namespace MetadataSchema {
|
|
103
319
|
/**
|
|
104
320
|
* Walks the metadata tree and attaches the resolved `.type` field to every
|
|
@@ -106,21 +322,65 @@ export declare namespace MetadataSchema {
|
|
|
106
322
|
* index. This is idempotent — references whose `.type` has already been
|
|
107
323
|
* resolved are left alone — and mutates the input, matching the in-place
|
|
108
324
|
* resolution model `@typia/core` 12.x used.
|
|
325
|
+
*
|
|
326
|
+
* @evidence contracts/common.md#principled-implementation The walk tracks visited targets, not wrapper schemas, because wrappers are rebuilt on this side and are not shared, so a cyclic type such as a node with children terminates.
|
|
327
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over two private walkers.
|
|
328
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The in-place mutation is documented and is confined to the metadata the analysis owns.
|
|
329
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the mutation, the idempotence, and the cycle rule.
|
|
330
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
109
331
|
*/
|
|
110
332
|
const from: (plain: IMetadataSchema, dictionary?: IMetadataDictionary) => IMetadataSchema;
|
|
111
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Validation of a metadata by a policy function.
|
|
336
|
+
*
|
|
337
|
+
* @evidence contracts/common.md#principled-implementation The namespace walks the metadata once and collects the messages of the validator, and holds the types of the walk.
|
|
338
|
+
* @evidence contracts/common.md#clear-and-simple-design One function and three types.
|
|
339
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The policies are the callers'.
|
|
340
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
341
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
342
|
+
*/
|
|
112
343
|
export declare namespace MetadataFactory {
|
|
344
|
+
/**
|
|
345
|
+
* Where a node is: its object, property, parameter, and whether it is an
|
|
346
|
+
* output.
|
|
347
|
+
*
|
|
348
|
+
* @evidence contracts/common.md#principled-implementation The record locates a visited node for the error report.
|
|
349
|
+
* @evidence contracts/common.md#clear-and-simple-design A four-member record.
|
|
350
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
351
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the members.
|
|
352
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
353
|
+
*/
|
|
113
354
|
interface IExplore {
|
|
114
355
|
object: IMetadataSchema.IObjectType | null;
|
|
115
356
|
property: string | null;
|
|
116
357
|
parameter: string | null;
|
|
117
358
|
output: boolean;
|
|
118
359
|
}
|
|
360
|
+
/**
|
|
361
|
+
* A validation error: the name of the type, where it is, and the messages.
|
|
362
|
+
*
|
|
363
|
+
* @evidence contracts/common.md#principled-implementation The record is one violation of the policy.
|
|
364
|
+
* @evidence contracts/common.md#clear-and-simple-design A three-member record.
|
|
365
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
366
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the members.
|
|
367
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
368
|
+
*/
|
|
119
369
|
interface IError {
|
|
120
370
|
name: string;
|
|
121
371
|
explore: IExplore;
|
|
122
372
|
messages: string[];
|
|
123
373
|
}
|
|
374
|
+
/**
|
|
375
|
+
* A policy: it receives a node and its location and returns the messages of
|
|
376
|
+
* the violations, if any.
|
|
377
|
+
*
|
|
378
|
+
* @evidence contracts/common.md#principled-implementation The function type is the whole contract of a policy.
|
|
379
|
+
* @evidence contracts/common.md#clear-and-simple-design One function type.
|
|
380
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
381
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the arguments and the result.
|
|
382
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
383
|
+
*/
|
|
124
384
|
type Validator = (props: {
|
|
125
385
|
metadata: IMetadataSchema;
|
|
126
386
|
explore: IExplore;
|
|
@@ -133,13 +393,27 @@ export declare namespace MetadataFactory {
|
|
|
133
393
|
* walker, kept lean: the typia native transform has already validated
|
|
134
394
|
* structural invariants, so the validator is only called for SDK-side policy
|
|
135
395
|
* checks (JSON-serializability, query/header atomic-only rules, …).
|
|
396
|
+
*
|
|
397
|
+
* @evidence contracts/common.md#principled-implementation The walk visits objects, arrays, tuples, aliases, and escaped types through their resolved references, tracking visited targets rather than wrappers, and reports each node with the location of its property.
|
|
398
|
+
* @evidence contracts/common.md#clear-and-simple-design One function with one recursive visitor.
|
|
399
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It calls only the caller's policy.
|
|
400
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the walk and the termination.
|
|
401
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
136
402
|
*/
|
|
137
403
|
const validate: (props: {
|
|
138
|
-
options?: unknown;
|
|
139
404
|
functor: Validator;
|
|
140
405
|
metadata: IMetadataSchema;
|
|
141
406
|
}) => IError[];
|
|
142
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* The JSON policy of the SDK.
|
|
410
|
+
*
|
|
411
|
+
* @evidence contracts/common.md#principled-implementation The namespace holds the validator that rejects types JSON cannot carry.
|
|
412
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
413
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule is JSON's.
|
|
414
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
415
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
416
|
+
*/
|
|
143
417
|
export declare namespace JsonMetadataFactory {
|
|
144
418
|
/**
|
|
145
419
|
* Rejects metadata that cannot be losslessly JSON-serialized. The typia
|
|
@@ -147,34 +421,71 @@ export declare namespace JsonMetadataFactory {
|
|
|
147
421
|
* only adds the JSON-policy bans the legacy `@typia/core` walker enforced —
|
|
148
422
|
* bare `bigint` payloads, function-typed properties, and `Map` / `Set`
|
|
149
423
|
* containers that have no canonical JSON representation.
|
|
424
|
+
*
|
|
425
|
+
* @evidence contracts/common.md#principled-implementation JSON has no representation for those four forms, so each is a violation, and other structural problems are already rejected by the transform.
|
|
426
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of four checks.
|
|
427
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The list is the JSON limitation.
|
|
428
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the four bans.
|
|
429
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
150
430
|
*/
|
|
151
431
|
const validate: MetadataFactory.Validator;
|
|
152
432
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
export declare namespace HttpFormDataProgrammer {
|
|
163
|
-
const validate: MetadataFactory.Validator;
|
|
164
|
-
}
|
|
433
|
+
/**
|
|
434
|
+
* Produces the JSON schemas of metadata from what the transform baked.
|
|
435
|
+
*
|
|
436
|
+
* @evidence contracts/common.md#principled-implementation The namespace copies the baked schemas and components, and falls back to a small converter for metadata without a bake.
|
|
437
|
+
* @evidence contracts/common.md#clear-and-simple-design Two functions with a private converter.
|
|
438
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The copies keep one composition from editing another's data.
|
|
439
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states its purpose.
|
|
440
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
441
|
+
*/
|
|
165
442
|
export declare namespace JsonSchemasProgrammer {
|
|
166
443
|
/**
|
|
167
444
|
* Consumes the per-metadata `jsonSchema` field the nestia transform
|
|
168
445
|
* pre-bakes. Top-level route metadata (success / parameter / exception)
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
446
|
+
* carries a baked schema whenever typia can describe the type. Metadata
|
|
447
|
+
* without one falls back to a minimal JS-side converter that reads only the
|
|
448
|
+
* atomic kinds — no type tags, template patterns, or constant annotations —
|
|
449
|
+
* so it is no substitute for the bake.
|
|
450
|
+
*
|
|
451
|
+
* The schemas and components are copies. The bake belongs to the route
|
|
452
|
+
* metadata, which every composition in the process reads, while the composer
|
|
453
|
+
* may edit what it is given in place, and so can a `SwaggerCustomizer`;
|
|
454
|
+
* handing the bake out by reference let each document inherit the previous
|
|
455
|
+
* one's edits.
|
|
456
|
+
*
|
|
457
|
+
* @evidence contracts/common.md#principled-implementation The bake belongs to route metadata that every composition reads while the composer edits its input in place, so copies are returned, and the components are copied once after the last bake of each name wins.
|
|
458
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
459
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The fallback is stated as weaker than the bake.
|
|
460
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the copies and the fallback.
|
|
461
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
175
462
|
*/
|
|
176
463
|
const writeSchemas: (props: {
|
|
177
464
|
version: "3.0" | "3.1";
|
|
178
465
|
metadatas: readonly IMetadataSchema[];
|
|
179
466
|
}) => IJsonSchemaCollection;
|
|
467
|
+
/**
|
|
468
|
+
* Writes the schema of one property of `metadata`'s first object type, for a
|
|
469
|
+
* decomposed query or headers parameter.
|
|
470
|
+
*
|
|
471
|
+
* Reads the schema baked beside `metadata`'s own schema (see
|
|
472
|
+
* {@link IReflectJsonSchema.properties}), resolved against the same
|
|
473
|
+
* components. The schema and components are copies, for the reason
|
|
474
|
+
* {@link writeSchemas} gives. Returns `null` when that bake exists but has no
|
|
475
|
+
* entry for the property, because typia's object schema omits it, so no
|
|
476
|
+
* parameter describes it either. Only metadata the transform did not bake
|
|
477
|
+
* falls back to {@link writeSchemas} over the property value.
|
|
478
|
+
*
|
|
479
|
+
* @evidence contracts/common.md#principled-implementation The property schemas are baked beside the metadata's own schema and resolved against the same components, copied for the same reason as `writeSchemas`, and a bake without the property means typia omits it.
|
|
480
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
481
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Only metadata without a bake falls back.
|
|
482
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the result and the null case.
|
|
483
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This metadata adapter represents schema values, named type references and validation results in memory. It neither interprets native pathname identity nor opens files or launches processes.
|
|
484
|
+
*/
|
|
485
|
+
const writeProperty: (props: {
|
|
486
|
+
version: "3.0" | "3.1";
|
|
487
|
+
metadata: IMetadataSchema;
|
|
488
|
+
key: string;
|
|
489
|
+
value: IMetadataSchema;
|
|
490
|
+
}) => IJsonSchemaCollection | null;
|
|
180
491
|
}
|