@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/README.md
CHANGED
|
@@ -60,7 +60,7 @@ Check out the document in the [website](https://nestia.io/docs/):
|
|
|
60
60
|
### 🏠 Home
|
|
61
61
|
- [Introduction](https://nestia.io/docs/)
|
|
62
62
|
- [Setup](https://nestia.io/docs/setup/)
|
|
63
|
-
- [Pure TypeScript](https://nestia.io/docs/
|
|
63
|
+
- [Pure TypeScript](https://nestia.io/docs/core/TypedBody/)
|
|
64
64
|
|
|
65
65
|
### 📖 Features
|
|
66
66
|
- Core Library
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const cp = require("node:child_process");
|
|
2
|
+
const fs = require("node:fs");
|
|
3
|
+
const path = require("node:path");
|
|
4
|
+
|
|
5
|
+
// Resolve the generated package's data against its own location, so invoking
|
|
6
|
+
// the build from another directory cannot redirect deletion or generation.
|
|
7
|
+
const { nestia } = require("./package.json");
|
|
8
|
+
const root = path.resolve(__dirname, nestia.root);
|
|
9
|
+
const output = path.resolve(__dirname, nestia.output);
|
|
10
|
+
fs.rmSync(path.join(output, "functional"), { recursive: true, force: true });
|
|
11
|
+
|
|
12
|
+
const args = ["nestia", "sdk"];
|
|
13
|
+
if (process.platform !== "win32")
|
|
14
|
+
cp.execFileSync("npx", args, { cwd: root, stdio: "inherit" });
|
|
15
|
+
else {
|
|
16
|
+
// Node cannot start a .cmd shim directly. The npm installation beside the
|
|
17
|
+
// shim provides the same entry point without interpreting a shell string.
|
|
18
|
+
const directory = (process.env.PATH ?? "")
|
|
19
|
+
.split(path.delimiter)
|
|
20
|
+
.find((entry) => fs.existsSync(path.join(entry, "npx.cmd")));
|
|
21
|
+
const cli = directory === undefined ? undefined : [
|
|
22
|
+
path.join(directory, "node_modules/npm/bin/npx-cli.js"),
|
|
23
|
+
path.resolve(directory, "../npm/bin/npx-cli.js"),
|
|
24
|
+
].find((entry) => fs.existsSync(entry));
|
|
25
|
+
if (cli === undefined)
|
|
26
|
+
throw new Error("Unable to locate npx's JavaScript entry point beside npx.cmd on PATH.");
|
|
27
|
+
cp.execFileSync(process.execPath, [cli, ...args], { cwd: root, stdio: "inherit" });
|
|
28
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ORGANIZATION/PROJECT-api",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.2",
|
|
4
4
|
"description": "SDK library generated by Nestia",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "npm run build:sdk && npm run compile",
|
|
9
|
-
"build:sdk": "
|
|
10
|
-
"compile": "rimraf lib &&
|
|
9
|
+
"build:sdk": "node build-sdk.cjs",
|
|
10
|
+
"compile": "rimraf lib && ttsc",
|
|
11
11
|
"deploy": "npm run build && npm publish"
|
|
12
12
|
},
|
|
13
13
|
"repository": {
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"url": "https://github.com/samchon/nestia/issues"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://nestia.io",
|
|
23
|
+
"nestia": {
|
|
24
|
+
"root": "${root}",
|
|
25
|
+
"output": "${output}"
|
|
26
|
+
},
|
|
23
27
|
"files": [
|
|
24
28
|
"lib",
|
|
25
29
|
"package.json",
|
|
@@ -1,109 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
"ES2015"
|
|
18
|
-
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
19
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
20
|
-
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
21
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
22
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
23
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
24
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
25
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
26
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
27
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
28
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
29
|
-
|
|
30
|
-
/* Modules */
|
|
31
|
-
"module": "commonjs", /* Specify what module code is generated. */
|
|
32
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
33
|
-
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
34
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
35
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
36
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
37
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
38
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
39
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
40
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
41
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
42
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
43
|
-
|
|
44
|
-
/* JavaScript Support */
|
|
45
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
46
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
47
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
48
|
-
|
|
49
|
-
/* Emit */
|
|
50
|
-
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
51
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
52
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
53
|
-
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
54
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
55
|
-
"outDir": "./lib", /* Specify an output folder for all emitted files. */
|
|
56
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
57
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
58
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
59
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
60
|
-
"downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
61
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
62
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
63
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
64
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
65
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
66
|
-
"newLine": "lf", /* Set the newline character for emitting files. */
|
|
67
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
68
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
69
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
70
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
71
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
72
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
73
|
-
|
|
74
|
-
/* Interop Constraints */
|
|
75
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
76
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
77
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
78
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
79
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
80
|
-
|
|
81
|
-
/* Type Checking */
|
|
82
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
83
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
84
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
85
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
86
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
87
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
88
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
89
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
90
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
91
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
92
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
93
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
94
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
95
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
96
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
97
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
98
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
99
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
100
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
101
|
-
|
|
102
|
-
/* Completeness */
|
|
103
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
104
|
-
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"lib": ["DOM", "ESNext"],
|
|
5
|
+
"module": "nodenext",
|
|
6
|
+
"moduleResolution": "nodenext",
|
|
7
|
+
"rootDir": "${output}",
|
|
8
|
+
"types": ["*"],
|
|
9
|
+
"declaration": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"outDir": "./lib",
|
|
12
|
+
"newLine": "lf",
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strict": true,
|
|
16
|
+
"skipLibCheck": true
|
|
105
17
|
},
|
|
106
|
-
"include": [
|
|
107
|
-
"${output}"
|
|
108
|
-
]
|
|
18
|
+
"include": ["${output}"]
|
|
109
19
|
}
|
package/lib/INestiaConfig.d.ts
CHANGED
|
@@ -4,6 +4,11 @@ import type { OpenApi } from "typia";
|
|
|
4
4
|
* Definition for the `nestia.config.ts` file.
|
|
5
5
|
*
|
|
6
6
|
* @author Jeongho Nam - https://github.com/samchon
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation The input names the controllers to analyze and every optional property enables or refines one output (SDK, distribution, e2e, Swagger), so one configuration file drives every generator.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record whose nested types describe the input and the Swagger options.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation Every property documents its meaning and default, which are the public contract of the configuration file.
|
|
11
|
+
* @evidence contracts/portability.md#os-neutral-implementation Source inputs and output/distribution/e2e destinations carry native pathname strings interpreted by their owning Node filesystem operations; the application callback bypasses source compilation. Swagger route paths are distinct protocol values, not native file identities.
|
|
7
12
|
*/
|
|
8
13
|
export interface INestiaConfig {
|
|
9
14
|
/**
|
|
@@ -40,10 +45,15 @@ export interface INestiaConfig {
|
|
|
40
45
|
* Recommend to use `"packages/api"` value.
|
|
41
46
|
*/
|
|
42
47
|
distribute?: string;
|
|
43
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Groups HTTP and WebSocket SDK call arguments in one props object after the
|
|
50
|
+
* connection. MCP wrappers retain their client and arguments parameters.
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
44
54
|
keyword?: boolean;
|
|
45
55
|
/**
|
|
46
|
-
* Allow simulation mode.
|
|
56
|
+
* Allow simulation mode for HTTP SDK calls.
|
|
47
57
|
*
|
|
48
58
|
* If you configure this property to be `true`, the SDK library would be
|
|
49
59
|
* contain simulation mode. In the simulation mode, the SDK library would not
|
|
@@ -61,7 +71,8 @@ export interface INestiaConfig {
|
|
|
61
71
|
*
|
|
62
72
|
* If you configure this property and runs `npx nestia e2e` command,
|
|
63
73
|
* `@nestia/sdk` will analyze your NestJS backend server code, and generates
|
|
64
|
-
* e2e test functions for
|
|
74
|
+
* e2e test functions for the analyzed HTTP endpoints. WebSocket and MCP
|
|
75
|
+
* operations have no generated HTTP test function.
|
|
65
76
|
*
|
|
66
77
|
* If not configured, you can't run `npx nestia e2e` command.
|
|
67
78
|
*/
|
|
@@ -70,10 +81,10 @@ export interface INestiaConfig {
|
|
|
70
81
|
* Whether to use propagation mode or not.
|
|
71
82
|
*
|
|
72
83
|
* If being configured, interaction functions of the SDK library would perform
|
|
73
|
-
*
|
|
74
|
-
* exception even when status code is not 200 (or 201), but just returning the
|
|
84
|
+
* propagation mode. HTTP failure statuses are returned through the
|
|
75
85
|
* {@link IPropagation} typed instance, which can specify its body type through
|
|
76
|
-
* discriminated union determined by status code.
|
|
86
|
+
* discriminated union determined by status code. Transport, decoding and
|
|
87
|
+
* configured assertion failures can still throw.
|
|
77
88
|
*
|
|
78
89
|
* @default false
|
|
79
90
|
*/
|
|
@@ -81,9 +92,10 @@ export interface INestiaConfig {
|
|
|
81
92
|
/**
|
|
82
93
|
* Whether to clone DTO structures or not.
|
|
83
94
|
*
|
|
84
|
-
* If
|
|
85
|
-
*
|
|
86
|
-
*
|
|
95
|
+
* If enabled, named DTOs reachable from analyzed routes are emitted into
|
|
96
|
+
* `structures`, with anonymous forms written inline. HTTP and MCP DTOs use
|
|
97
|
+
* their wire metadata; supported WebSocket declarations are copied from local
|
|
98
|
+
* sources, while external or unsupported imports retain source links.
|
|
87
99
|
*
|
|
88
100
|
* @default false
|
|
89
101
|
*/
|
|
@@ -91,8 +103,10 @@ export interface INestiaConfig {
|
|
|
91
103
|
/**
|
|
92
104
|
* Whether to wrap DTO by primitive type.
|
|
93
105
|
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
106
|
+
* Unless false, source DTO aliases use Primitive for JSON bodies and
|
|
107
|
+
* responses, and Resolved for query, headers and other resolved wire forms.
|
|
108
|
+
* Clone mode writes the analyzed metadata directly; multipart bodies use
|
|
109
|
+
* FormDataInput and binary responses use ReadableStream.
|
|
96
110
|
*
|
|
97
111
|
* For refenrece, if a DTO type be capsuled by the {@link Primitive} type, all
|
|
98
112
|
* of methods in the DTO type would be automatically erased. Also, if the DTO
|
|
@@ -105,9 +119,10 @@ export interface INestiaConfig {
|
|
|
105
119
|
/**
|
|
106
120
|
* Whether to assert parameter types or not.
|
|
107
121
|
*
|
|
108
|
-
* If
|
|
109
|
-
*
|
|
110
|
-
*
|
|
122
|
+
* If true, HTTP path, query and body arguments are checked through
|
|
123
|
+
* [`typia.assert<T>()` function](https://typia.io/docs/validators/assert/).
|
|
124
|
+
* The connection, connection headers, WebSocket and MCP arguments are outside
|
|
125
|
+
* this option.
|
|
111
126
|
*
|
|
112
127
|
* This option would make your SDK library compilation time a little bit
|
|
113
128
|
* slower, but would enahcne the type safety even in the runtime level.
|
|
@@ -116,16 +131,13 @@ export interface INestiaConfig {
|
|
|
116
131
|
*/
|
|
117
132
|
assert?: boolean;
|
|
118
133
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* If you configure this property to be `true`, the SDK library would utilize
|
|
122
|
-
* the [`typia.assertStringify<T>()
|
|
123
|
-
* function`](https://github.com/samchon/typia#enhanced-json) to boost up JSON
|
|
124
|
-
* serialization speed and ensure type safety.
|
|
134
|
+
* Generates specialized JSON serialization for JSON and encrypted request
|
|
135
|
+
* bodies.
|
|
125
136
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
137
|
+
* When enabled, the SDK emits a `typia.json.assertStringify` function for the
|
|
138
|
+
* body type. With `assert` enabled, argument validation runs separately and
|
|
139
|
+
* serialization uses `typia.json.stringify` without repeating the assertion.
|
|
140
|
+
* Compilation and runtime costs depend on the body type and workload.
|
|
129
141
|
*
|
|
130
142
|
* @default false
|
|
131
143
|
*/
|
|
@@ -135,6 +147,12 @@ export declare namespace INestiaConfig {
|
|
|
135
147
|
/**
|
|
136
148
|
* List of files or directories to include or exclude to specifying the NestJS
|
|
137
149
|
* controllers.
|
|
150
|
+
*
|
|
151
|
+
* @evidence contracts/common.md#principled-implementation Include lists select controller files or directories and exclude lists remove files from that selection.
|
|
152
|
+
* @evidence contracts/common.md#clear-and-simple-design A two-member record.
|
|
153
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
154
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes and the meaning of its members.
|
|
155
|
+
* @evidence contracts/portability.md#os-neutral-implementation Include and exclude strings represent native files, directories or glob patterns. SourceFinder owns resolving them against the current working directory and distinguishing literal existing paths from wildcard suffixes.
|
|
138
156
|
*/
|
|
139
157
|
interface IInput {
|
|
140
158
|
/** List of files or directories containing the NestJS controller classes. */
|
|
@@ -142,7 +160,15 @@ export declare namespace INestiaConfig {
|
|
|
142
160
|
/** List of files or directories to be excluded. */
|
|
143
161
|
exclude?: string[];
|
|
144
162
|
}
|
|
145
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Building `swagger.json` is also possible.
|
|
165
|
+
*
|
|
166
|
+
* @evidence contracts/common.md#principled-implementation The output path is required and every other option refines the composed OpenAPI document before it is written.
|
|
167
|
+
* @evidence contracts/common.md#clear-and-simple-design A flat record of options with one callback.
|
|
168
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a type and adds no runtime behavior.
|
|
169
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the type describes and the meaning of its members.
|
|
170
|
+
* @evidence contracts/portability.md#os-neutral-implementation output is a native destination interpreted by path.parse/resolve in SwaggerGenerator; a nonempty extension denotes a file and otherwise the destination is a directory. Server URLs and operation paths retain protocol spelling independently of that filesystem boundary.
|
|
171
|
+
*/
|
|
146
172
|
interface ISwaggerConfig {
|
|
147
173
|
/**
|
|
148
174
|
* Response path of the `swagger.json`.
|
|
@@ -155,12 +181,11 @@ export declare namespace INestiaConfig {
|
|
|
155
181
|
/**
|
|
156
182
|
* OpenAPI version.
|
|
157
183
|
*
|
|
158
|
-
* If you configure this property to be `2.0` or `3.
|
|
159
|
-
* `swagger.json` file would follow the specified OpenAPI version
|
|
160
|
-
*
|
|
161
|
-
* specification by {@link OpenApi.downgrade} method.
|
|
184
|
+
* If you configure this property to be `2.0`, `3.0`, or `3.1`, the newly
|
|
185
|
+
* generated `swagger.json` file would follow the specified OpenAPI version,
|
|
186
|
+
* downgraded from the OpenAPI v3.2 specification.
|
|
162
187
|
*
|
|
163
|
-
* @default 3.
|
|
188
|
+
* @default 3.2
|
|
164
189
|
*/
|
|
165
190
|
openapi?: "2.0" | "3.0" | "3.1" | "3.2";
|
|
166
191
|
/**
|
|
@@ -178,10 +203,12 @@ export declare namespace INestiaConfig {
|
|
|
178
203
|
* Whether to include additional information or not.
|
|
179
204
|
*
|
|
180
205
|
* If configured to be `true`, those properties would be added into each API
|
|
181
|
-
*
|
|
206
|
+
* endpoint.
|
|
182
207
|
*
|
|
183
|
-
* - `x-nestia-method`
|
|
184
|
-
* - `x-nestia-namespace
|
|
208
|
+
* - `x-nestia-method`: the HTTP method, such as `"GET"`
|
|
209
|
+
* - `x-nestia-namespace`: the SDK function's accessor, such as
|
|
210
|
+
* `"bbs.articles.index"`
|
|
211
|
+
* - `x-nestia-jsDocTags`: the JSDoc tags of the controller method
|
|
185
212
|
*
|
|
186
213
|
* @default false
|
|
187
214
|
*/
|
|
@@ -199,7 +226,10 @@ export declare namespace INestiaConfig {
|
|
|
199
226
|
*
|
|
200
227
|
* When generating `swagger.json` file through `nestia`, if your controllers
|
|
201
228
|
* or theirs methods have a security key which is not enrolled in here
|
|
202
|
-
* property, it would be an error.
|
|
229
|
+
* property, it would be an error. So would an OAuth2 scope none of the
|
|
230
|
+
* scheme's flows declares, and, for an OpenAPI `3.0` or `2.0` document,
|
|
231
|
+
* scopes on a scheme other than OAuth2 or OpenID Connect, which those
|
|
232
|
+
* versions require to be empty; from `3.1` on they list role names.
|
|
203
233
|
*/
|
|
204
234
|
security?: Record<string, OpenApi.ISecurityScheme>;
|
|
205
235
|
/**
|
|
@@ -219,7 +249,12 @@ export declare namespace INestiaConfig {
|
|
|
219
249
|
* If you configure this property to be `true`, the query DTO would be
|
|
220
250
|
* decomposed into individual query parameters per each property. Otherwise
|
|
221
251
|
* you set it to be `false`, the query DTO would be one object type which
|
|
222
|
-
* contains all of query parameters
|
|
252
|
+
* contains all of query parameters, spread into its keys by `style: form`
|
|
253
|
+
* and `explode: true`.
|
|
254
|
+
*
|
|
255
|
+
* Swagger 2.0 has no object query parameter, and no OpenAPI version can
|
|
256
|
+
* spread an object into headers, so a query DTO of a Swagger 2.0 document
|
|
257
|
+
* and a headers DTO are decomposed regardless of this property.
|
|
223
258
|
*
|
|
224
259
|
* @default true
|
|
225
260
|
*/
|
|
@@ -229,6 +264,11 @@ export declare namespace INestiaConfig {
|
|
|
229
264
|
*
|
|
230
265
|
* @param props Properties of the API endpoint.
|
|
231
266
|
* @returns Operation ID.
|
|
267
|
+
* @evidence contracts/common.md#principled-implementation An explicit @operationId tag takes precedence; otherwise this callback receives the four identifying facts once for the composed operation and supplies its identifier.
|
|
268
|
+
* @evidence contracts/common.md#clear-and-simple-design One optional callback with a single argument object.
|
|
269
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts It is a caller-supplied function and nothing about a particular naming scheme is built in.
|
|
270
|
+
* @evidence contracts/common.md#meaningful-documentation The comment documents the arguments and the result.
|
|
271
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation This callback receives HTTP endpoint identity and returns an OpenAPI identifier; it owns no native pathname or process boundary.
|
|
232
272
|
*/
|
|
233
273
|
operationId?(props: {
|
|
234
274
|
class: string;
|
|
@@ -1,10 +1,70 @@
|
|
|
1
1
|
import { INestiaConfig } from "./INestiaConfig";
|
|
2
|
+
/**
|
|
3
|
+
* Runs the generators of `@nestia/sdk` over one configuration.
|
|
4
|
+
*
|
|
5
|
+
* Each method validates the configuration for the output it needs, analyzes the
|
|
6
|
+
* controllers and the TypeScript metadata, reports every error at once, and
|
|
7
|
+
* then generates.
|
|
8
|
+
*
|
|
9
|
+
* @evidence contracts/common.md#principled-implementation The shared pipeline reflects controllers, types routes from transform metadata, assigns accessors and rejects collected analysis errors before writing. SDK-specific representability checks are attached by sdk and SDK-producing all; e2e currently invokes the SDK writer without that additional validation callback.
|
|
10
|
+
* @evidence contracts/common.md#clear-and-simple-design One class with four public generators over one private pipeline; directory assertion, title, and error report are module-private helpers.
|
|
11
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts No controller or route name is special-cased; the same pipeline serves the CLI and programmatic callers.
|
|
12
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the four generators and that the errors of an analysis are reported together.
|
|
13
|
+
* @evidence contracts/portability.md#os-neutral-implementation Output checks and diagnostic locations use Node fs.stat and path operations; controller compilation and output writes remain owned by ConfigAnalyzer and the generators. Filesystem errors distinguish missing/non-directory locations from other native failures.
|
|
14
|
+
*/
|
|
2
15
|
export declare class NestiaSdkApplication {
|
|
3
16
|
private readonly config;
|
|
4
17
|
constructor(config: INestiaConfig);
|
|
18
|
+
/**
|
|
19
|
+
* Generates everything the configuration asks for: the SDK and its e2e tests
|
|
20
|
+
* when `output` is set, and the Swagger document when `swagger` is set.
|
|
21
|
+
*
|
|
22
|
+
* It throws when neither `output` nor `swagger.output` is configured.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The SDK validation is attached only when an SDK is generated, so a Swagger-only run does not fail on SDK rules, and the e2e tests are generated after the SDK they import.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One method that composes the generators inside the shared pipeline.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The error names the properties a caller can configure; none is stale.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what is generated and the failure.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation all delegates configured output creation to the native writers and does not apply the explicit parent-directory checks used by sdk/e2e/swagger. Diagnostic source paths are rendered relative to the current native working directory.
|
|
29
|
+
*/
|
|
5
30
|
all(): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Generates the SDK and the automatic e2e test functions.
|
|
33
|
+
*
|
|
34
|
+
* It throws when `output` or `e2e` is missing, or when the parent directory
|
|
35
|
+
* of either does not exist.
|
|
36
|
+
*
|
|
37
|
+
* @evidence contracts/common.md#principled-implementation The e2e functions import the generated SDK, so the SDK is generated first, and both parent directories are asserted before any analysis runs.
|
|
38
|
+
* @evidence contracts/common.md#clear-and-simple-design One method over the shared pipeline.
|
|
39
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The directory check follows the configuration and no path is special-cased.
|
|
40
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the requirements and the failures.
|
|
41
|
+
* @evidence contracts/portability.md#os-neutral-implementation path.resolve obtains each native parent and fs.stat follows symlinks to verify a directory before analysis. ENOENT/ENOTDIR become configuration diagnostics; permission and other filesystem errors propagate without a platform-specific shell fallback.
|
|
42
|
+
*/
|
|
6
43
|
e2e(): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Generates the SDK library.
|
|
46
|
+
*
|
|
47
|
+
* It throws when `output` is missing or its parent directory does not exist.
|
|
48
|
+
*
|
|
49
|
+
* @evidence contracts/common.md#principled-implementation The SDK validation runs after route typing and before the generator, so a route the SDK cannot express is reported instead of written.
|
|
50
|
+
* @evidence contracts/common.md#clear-and-simple-design One method over the shared pipeline.
|
|
51
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The directory check follows the configuration.
|
|
52
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the requirement and the failures.
|
|
53
|
+
* @evidence contracts/portability.md#os-neutral-implementation The configured output parent is resolved through Node path and verified by fs.stat, including linked directories. Generator writes use their own native boundaries; this entry does not infer case identity from an OS name.
|
|
54
|
+
*/
|
|
7
55
|
sdk(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Generates the Swagger document.
|
|
58
|
+
*
|
|
59
|
+
* It throws when `swagger.output` is missing or the directory that will hold
|
|
60
|
+
* the document does not exist; the output may be a file or a directory.
|
|
61
|
+
*
|
|
62
|
+
* @evidence contracts/common.md#principled-implementation The directory to check is the parent of a file path with an extension and the path itself otherwise, which is how the generator decides where to write.
|
|
63
|
+
* @evidence contracts/common.md#clear-and-simple-design One method over the shared pipeline.
|
|
64
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The rule is the generator's own output rule.
|
|
65
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states the requirement and the two output forms.
|
|
66
|
+
* @evidence contracts/portability.md#os-neutral-implementation path.parse/resolve decide the native containing directory from whether the output has an extension, matching SwaggerGenerator's destination rule. The common directory check distinguishes missing paths from non-directory entries and propagates other filesystem errors.
|
|
67
|
+
*/
|
|
8
68
|
swagger(): Promise<void>;
|
|
9
69
|
private generate;
|
|
10
70
|
}
|