@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
|
@@ -14,14 +14,34 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.SdkGenerator = void 0;
|
|
16
16
|
const fs_1 = __importDefault(require("fs"));
|
|
17
|
-
const
|
|
17
|
+
const SdkBundlePath_1 = require("../utils/SdkBundlePath");
|
|
18
18
|
const StringUtil_1 = require("../utils/StringUtil");
|
|
19
19
|
const CloneGenerator_1 = require("./CloneGenerator");
|
|
20
20
|
const SdkDistributionComposer_1 = require("./internal/SdkDistributionComposer");
|
|
21
21
|
const SdkFileProgrammer_1 = require("./internal/SdkFileProgrammer");
|
|
22
22
|
const SdkHttpParameterProgrammer_1 = require("./internal/SdkHttpParameterProgrammer");
|
|
23
|
+
/**
|
|
24
|
+
* Generates the SDK library and validates the analyzed routes it needs.
|
|
25
|
+
*
|
|
26
|
+
* @evidence contracts/common.md#principled-implementation The namespace bundles the static files, writes the DTOs and the functions, composes the distribution package, and reports the errors the generation would meet.
|
|
27
|
+
* @evidence contracts/common.md#clear-and-simple-design Two public functions, one public constant, and the private validators.
|
|
28
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts Validation and generation share the same route model.
|
|
29
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
30
|
+
* @evidence contracts/portability.md#os-neutral-implementation Static bundle enumeration and output creation use Node fs; declaration/module path conversion and distribution process launching are delegated to ImportDictionary and SdkDistributionComposer. Existing file spelling is checked by the filesystem rather than an OS-name case rule.
|
|
31
|
+
*/
|
|
23
32
|
var SdkGenerator;
|
|
24
33
|
(function (SdkGenerator) {
|
|
34
|
+
/**
|
|
35
|
+
* Writes the SDK into the configured output directory: the bundled files, the
|
|
36
|
+
* DTOs when `clone` is on, the functions, and the distribution package when
|
|
37
|
+
* `distribute` is set.
|
|
38
|
+
*
|
|
39
|
+
* @evidence contracts/common.md#principled-implementation The steps run in dependency order, the bundle first and the distribution last. An absent output option throws before writing; a configured directory that does not exist is created recursively.
|
|
40
|
+
* @evidence contracts/common.md#clear-and-simple-design One function that delegates each step.
|
|
41
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The steps are sequential and each awaits the previous one.
|
|
42
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
43
|
+
* @evidence contracts/portability.md#os-neutral-implementation Node mkdir and the bundle writer accept the configured native output path; subsequent file and process boundaries belong to their delegated writers. Configuration omission is distinct from a missing on-disk directory.
|
|
44
|
+
*/
|
|
25
45
|
SdkGenerator.generate = (app) => __awaiter(this, void 0, void 0, function* () {
|
|
26
46
|
if (app.project.config.output === undefined)
|
|
27
47
|
throw new Error("Output directory is not defined.");
|
|
@@ -43,6 +63,18 @@ var SdkGenerator;
|
|
|
43
63
|
websocket: app.routes.some((r) => r.protocol === "websocket"),
|
|
44
64
|
});
|
|
45
65
|
});
|
|
66
|
+
/**
|
|
67
|
+
* Returns the errors of routes that cannot become an SDK: MCP tools with
|
|
68
|
+
* duplicate names or accessors, and, without `clone`, HTTP routes whose
|
|
69
|
+
* parameter or return types are implicit, plus implicit exception types when
|
|
70
|
+
* propagation is enabled.
|
|
71
|
+
*
|
|
72
|
+
* @evidence contracts/common.md#principled-implementation The MCP checks always apply, and the implicit return check applies only where the SDK would have to name the type, because `clone` writes it as a declaration instead.
|
|
73
|
+
* @evidence contracts/common.md#clear-and-simple-design One function over three checks.
|
|
74
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The list is collected, not thrown, so one run reports every error.
|
|
75
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
76
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation Validation judges analyzed route types and names and performs no native filesystem or process operation.
|
|
77
|
+
*/
|
|
46
78
|
SdkGenerator.validate = (app) => {
|
|
47
79
|
const errors = [];
|
|
48
80
|
validateMcpDuplicates(errors)(app.routes);
|
|
@@ -109,7 +141,7 @@ var SdkGenerator;
|
|
|
109
141
|
props.errors.push({
|
|
110
142
|
file: props.route.controller.file,
|
|
111
143
|
class: props.route.controller.class.name,
|
|
112
|
-
function: props.route.
|
|
144
|
+
function: props.route.key,
|
|
113
145
|
from: `parameter ${JSON.stringify(p.name)}`,
|
|
114
146
|
contents: [`implicit (unnamed) parameter type.`],
|
|
115
147
|
});
|
|
@@ -120,7 +152,7 @@ var SdkGenerator;
|
|
|
120
152
|
props.errors.push({
|
|
121
153
|
file: props.route.controller.file,
|
|
122
154
|
class: props.route.controller.class.name,
|
|
123
|
-
function: props.route.
|
|
155
|
+
function: props.route.key,
|
|
124
156
|
from: `exception ${JSON.stringify(key)}`,
|
|
125
157
|
contents: [`implicit (unnamed) exception type.`],
|
|
126
158
|
});
|
|
@@ -129,7 +161,7 @@ var SdkGenerator;
|
|
|
129
161
|
props.errors.push({
|
|
130
162
|
file: props.route.controller.file,
|
|
131
163
|
class: props.route.controller.class.name,
|
|
132
|
-
function: props.route.
|
|
164
|
+
function: props.route.key,
|
|
133
165
|
from: "success",
|
|
134
166
|
contents: [`implicit (unnamed) return type.`],
|
|
135
167
|
});
|
|
@@ -148,6 +180,12 @@ var SdkGenerator;
|
|
|
148
180
|
* Files the user already has are never touched, so that hand-written
|
|
149
181
|
* customizations (e.g. extra re-exports in `module.ts`) survive regeneration.
|
|
150
182
|
* Only missing files are filled in from the bundle.
|
|
183
|
+
*
|
|
184
|
+
* @evidence contracts/common.md#principled-implementation A file that the user has customized is never overwritten, and only files that are missing are filled in from the bundle.
|
|
185
|
+
* @evidence contracts/common.md#clear-and-simple-design One loop with two guards.
|
|
186
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The existing target is checked before the write.
|
|
187
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
188
|
+
* @evidence contracts/portability.md#os-neutral-implementation fs.readdir/stat enumerate the installed bundle and fs.existsSync checks each target under the filesystem's own policy before writing UTF-8. Forward slash suffixes are accepted by Node on supported native platforms; concurrent generation into the same output is not an exclusive ownership guarantee.
|
|
151
189
|
*/
|
|
152
190
|
SdkGenerator.bundle = (output) => __awaiter(this, void 0, void 0, function* () {
|
|
153
191
|
const files = yield fs_1.default.promises.readdir(SdkGenerator.BUNDLE_PATH);
|
|
@@ -163,6 +201,6 @@ var SdkGenerator;
|
|
|
163
201
|
yield fs_1.default.promises.writeFile(target, content, "utf8");
|
|
164
202
|
}
|
|
165
203
|
});
|
|
166
|
-
SdkGenerator.BUNDLE_PATH =
|
|
204
|
+
SdkGenerator.BUNDLE_PATH = SdkBundlePath_1.SDK_BUNDLE_PATH;
|
|
167
205
|
})(SdkGenerator || (exports.SdkGenerator = SdkGenerator = {}));
|
|
168
206
|
//# sourceMappingURL=SdkGenerator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkGenerator.js","sourceRoot":"","sources":["../../src/generates/SdkGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;
|
|
1
|
+
{"version":3,"file":"SdkGenerator.js","sourceRoot":"","s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QAAQ,CAAC,OAAO,CAAC,wBAAW,CAAC,CAAC;QAC/D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,OAAO,GAAW,GAAG,wBAAW,IAAI,IAAI,EAAE,CAAC;YACjD,MAAM,MAAM,GAAW,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;YAC3C,MAAM,KAAK,GAAa,MAAM,YAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACxD,IAAI,KAAK,CAAC,MAAM,EAAE,KAAK,KAAK;gBAAE,SAAS;YACvC,IAAI,YAAE,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,IAAI;gBAAE,SAAS;YAE7C,MAAM,OAAO,GAAW,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACpE,MAAM,YAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC;IACH,CAAC,CAAA,CAAC;IAEW,wBAAW,GAAG,+BAAe,CAAC;AAC7C,CAAC,EAlMgB,YAAY,aAAZ,YAAY,GAAZ,YAAY,QAkM5B"}
|
|
@@ -1,13 +1,43 @@
|
|
|
1
1
|
import { OpenApi } from "@typia/interface";
|
|
2
2
|
import { INestiaConfig } from "../INestiaConfig";
|
|
3
3
|
import { ITypedApplication } from "../structures/ITypedApplication";
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Composes and writes the OpenAPI document.
|
|
6
|
+
*
|
|
7
|
+
* @evidence contracts/common.md#principled-implementation The namespace resolves the output location, builds the document from the routes, downgrades it when an older version is configured, and writes it.
|
|
8
|
+
* @evidence contracts/common.md#clear-and-simple-design Three public functions and private helpers for security, customizers, and the copy of the document.
|
|
9
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The composition never edits data it does not own.
|
|
10
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
11
|
+
* @evidence contracts/portability.md#os-neutral-implementation Output locations use Node path.parse/resolve/join and UTF-8 fs writes; package defaults are located through FileRetriever from the current native working directory. HTTP operation paths remain protocol strings handled by PathAnalyzer.
|
|
12
|
+
*/
|
|
5
13
|
export declare namespace SwaggerGenerator {
|
|
14
|
+
/**
|
|
15
|
+
* Writes the document to the configured location: a `.json` path as it is,
|
|
16
|
+
* and a directory as its `swagger.json`.
|
|
17
|
+
*
|
|
18
|
+
* The document is downgraded when `openapi` names an older version.
|
|
19
|
+
*
|
|
20
|
+
* @evidence contracts/common.md#principled-implementation The directory is created recursively and a failure to create it is reported with its cause; the document is composed, converted, and written in that order.
|
|
21
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
22
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The failure to create the directory is not swallowed.
|
|
23
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
24
|
+
* @evidence contracts/portability.md#os-neutral-implementation path.parse classifies an output by its extension, path.resolve and path.dirname obtain native destinations, and fs.mkdir/writeFile own creation and writing without shell interpretation. Any nonempty extension denotes a file; the example .json extension is not an exclusive suffix check.
|
|
25
|
+
*/
|
|
6
26
|
const generate: (app: ITypedApplication) => Promise<void>;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Returns the document the composition starts from: the configured info,
|
|
29
|
+
* servers, security schemes, and tags, or the defaults.
|
|
30
|
+
*
|
|
31
|
+
* Tags are copied immediately; configured servers, security schemes and
|
|
32
|
+
* nested info values remain shared until compose detaches the document before
|
|
33
|
+
* customizers run. Callers using initialize alone must preserve those shared
|
|
34
|
+
* values.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation A per-call lazy Singleton reads package metadata at most once when info defaults need it. Each call allocates a document and copies the tag list; configured servers, security schemes and nested info values are detached later by compose before customization.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The defaults follow the configuration contract; initialize does not mutate configured values, while compose owns detaching the remaining shared JSON trees.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The comment identifies defaults and distinguishes the immediate tag copy from values shared until compose, including the restriction on initialize-only callers.
|
|
40
|
+
* @evidence contracts/portability.md#os-neutral-implementation The lazy package-info reader starts from process.cwd and FileRetriever supplies the nearest package.json within its bounded native-parent search. fs.readFile reads UTF-8; unreadable or malformed package metadata yields documented info defaults rather than an OS-specific fallback command.
|
|
41
|
+
*/
|
|
12
42
|
const initialize: (config: Omit<INestiaConfig.ISwaggerConfig, "output">) => Promise<OpenApi.IDocument>;
|
|
13
43
|
}
|
|
@@ -17,13 +17,34 @@ const utils_1 = require("@typia/utils");
|
|
|
17
17
|
const fs_1 = __importDefault(require("fs"));
|
|
18
18
|
const path_1 = __importDefault(require("path"));
|
|
19
19
|
const tstl_1 = require("tstl");
|
|
20
|
+
const PathAnalyzer_1 = require("../analyses/PathAnalyzer");
|
|
20
21
|
const legacy_1 = require("../internal/legacy");
|
|
21
22
|
const FileRetriever_1 = require("../utils/FileRetriever");
|
|
22
23
|
const SdkHttpParameterProgrammer_1 = require("./internal/SdkHttpParameterProgrammer");
|
|
23
24
|
const SwaggerOperationComposer_1 = require("./internal/SwaggerOperationComposer");
|
|
24
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Composes and writes the OpenAPI document.
|
|
27
|
+
*
|
|
28
|
+
* @evidence contracts/common.md#principled-implementation The namespace resolves the output location, builds the document from the routes, downgrades it when an older version is configured, and writes it.
|
|
29
|
+
* @evidence contracts/common.md#clear-and-simple-design Three public functions and private helpers for security, customizers, and the copy of the document.
|
|
30
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The composition never edits data it does not own.
|
|
31
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
32
|
+
* @evidence contracts/portability.md#os-neutral-implementation Output locations use Node path.parse/resolve/join and UTF-8 fs writes; package defaults are located through FileRetriever from the current native working directory. HTTP operation paths remain protocol strings handled by PathAnalyzer.
|
|
33
|
+
*/
|
|
25
34
|
var SwaggerGenerator;
|
|
26
35
|
(function (SwaggerGenerator) {
|
|
36
|
+
/**
|
|
37
|
+
* Writes the document to the configured location: a `.json` path as it is,
|
|
38
|
+
* and a directory as its `swagger.json`.
|
|
39
|
+
*
|
|
40
|
+
* The document is downgraded when `openapi` names an older version.
|
|
41
|
+
*
|
|
42
|
+
* @evidence contracts/common.md#principled-implementation The directory is created recursively and a failure to create it is reported with its cause; the document is composed, converted, and written in that order.
|
|
43
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
44
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The failure to create the directory is not swallowed.
|
|
45
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
46
|
+
* @evidence contracts/portability.md#os-neutral-implementation path.parse classifies an output by its extension, path.resolve and path.dirname obtain native destinations, and fs.mkdir/writeFile own creation and writing without shell interpretation. Any nonempty extension denotes a file; the example .json extension is not an exclusive suffix check.
|
|
47
|
+
*/
|
|
27
48
|
SwaggerGenerator.generate = (app) => __awaiter(this, void 0, void 0, function* () {
|
|
28
49
|
var _a;
|
|
29
50
|
// GET CONFIGURATION
|
|
@@ -37,13 +58,12 @@ var SwaggerGenerator;
|
|
|
37
58
|
? path_1.default.resolve(config.output)
|
|
38
59
|
: path_1.default.join(path_1.default.resolve(config.output), "swagger.json");
|
|
39
60
|
const directory = path_1.default.dirname(location);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
throw new Error(`Error on NestiaApplication.swagger(): failed to create output directory: ${directory}`);
|
|
61
|
+
try {
|
|
62
|
+
yield fs_1.default.promises.mkdir(directory, { recursive: true });
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
throw new Error(`Error on NestiaApplication.swagger(): failed to create output directory: ${directory} (${error instanceof Error ? error.message : String(error)})`);
|
|
66
|
+
}
|
|
47
67
|
// COMPOSE SWAGGER DOCUMENT
|
|
48
68
|
const document = SwaggerGenerator.compose({
|
|
49
69
|
config,
|
|
@@ -57,6 +77,19 @@ var SwaggerGenerator;
|
|
|
57
77
|
? JSON.stringify(specified)
|
|
58
78
|
: JSON.stringify(specified, null, typeof config.beautify === "number" ? config.beautify : 2), "utf8");
|
|
59
79
|
});
|
|
80
|
+
/**
|
|
81
|
+
* Composes the document of the HTTP routes into the given document: the
|
|
82
|
+
* components of every schema, and the paths.
|
|
83
|
+
*
|
|
84
|
+
* A route tagged `@internal` or `@hidden`, or excluded by
|
|
85
|
+
* `@ApiExcludeEndpoint`, is left out.
|
|
86
|
+
*
|
|
87
|
+
* @evidence contracts/common.md#principled-implementation The schemas of all routes are composed in one call, so a component shared by routes exists once, and the readonly arrays are emended before the paths refer to them.
|
|
88
|
+
* @evidence contracts/common.md#clear-and-simple-design One function of sequential steps.
|
|
89
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The exclusion is the documented set of tags and decorators.
|
|
90
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
91
|
+
* @evidenceExclude contracts/portability.md#os-neutral-implementation compose operates on analyzed metadata and OpenAPI protocol paths; it neither opens native files nor launches processes.
|
|
92
|
+
*/
|
|
60
93
|
SwaggerGenerator.compose = (props) => {
|
|
61
94
|
var _a;
|
|
62
95
|
var _b;
|
|
@@ -75,11 +108,6 @@ var SwaggerGenerator;
|
|
|
75
108
|
version: "3.1",
|
|
76
109
|
metadatas,
|
|
77
110
|
});
|
|
78
|
-
json.schemas.forEach((schema, i) => SwaggerReadonlyArrayEmender_1.SwaggerReadonlyArrayEmender.emend({
|
|
79
|
-
components: json.components,
|
|
80
|
-
schema,
|
|
81
|
-
metadata: metadatas[i],
|
|
82
|
-
}));
|
|
83
111
|
const dict = new WeakMap();
|
|
84
112
|
json.schemas.forEach((schema, i) => dict.set(metadatas[i], schema));
|
|
85
113
|
const schema = (metadata) => dict.get(metadata);
|
|
@@ -92,6 +120,21 @@ var SwaggerGenerator;
|
|
|
92
120
|
document }));
|
|
93
121
|
return document;
|
|
94
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* Returns the document the composition starts from: the configured info,
|
|
125
|
+
* servers, security schemes, and tags, or the defaults.
|
|
126
|
+
*
|
|
127
|
+
* Tags are copied immediately; configured servers, security schemes and
|
|
128
|
+
* nested info values remain shared until compose detaches the document before
|
|
129
|
+
* customizers run. Callers using initialize alone must preserve those shared
|
|
130
|
+
* values.
|
|
131
|
+
*
|
|
132
|
+
* @evidence contracts/common.md#principled-implementation A per-call lazy Singleton reads package metadata at most once when info defaults need it. Each call allocates a document and copies the tag list; configured servers, security schemes and nested info values are detached later by compose before customization.
|
|
133
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
134
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The defaults follow the configuration contract; initialize does not mutate configured values, while compose owns detaching the remaining shared JSON trees.
|
|
135
|
+
* @evidence contracts/common.md#meaningful-documentation The comment identifies defaults and distinguishes the immediate tag copy from values shared until compose, including the restriction on initialize-only callers.
|
|
136
|
+
* @evidence contracts/portability.md#os-neutral-implementation The lazy package-info reader starts from process.cwd and FileRetriever supplies the nearest package.json within its bounded native-parent search. fs.readFile reads UTF-8; unreadable or malformed package metadata yields documented info defaults rather than an OS-specific fallback command.
|
|
137
|
+
*/
|
|
95
138
|
SwaggerGenerator.initialize = (config) => __awaiter(this, void 0, void 0, function* () {
|
|
96
139
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
97
140
|
var _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
@@ -137,7 +180,8 @@ var SwaggerGenerator;
|
|
|
137
180
|
schemas: {},
|
|
138
181
|
securitySchemes: config.security,
|
|
139
182
|
},
|
|
140
|
-
|
|
183
|
+
// a copy, because composing pushes each route's tags into this list
|
|
184
|
+
tags: clone((_t = config.tags) !== null && _t !== void 0 ? _t : []),
|
|
141
185
|
"x-typia-emended-v12": true,
|
|
142
186
|
};
|
|
143
187
|
});
|
|
@@ -173,48 +217,154 @@ var SwaggerGenerator;
|
|
|
173
217
|
get: new tstl_1.Singleton(() => (key) => {
|
|
174
218
|
var _a, _b;
|
|
175
219
|
const method = key.method.toLowerCase();
|
|
176
|
-
const
|
|
220
|
+
const normalized = "/" +
|
|
177
221
|
key.path
|
|
178
222
|
.split("/")
|
|
179
223
|
.filter((str) => !!str.length)
|
|
180
|
-
.map((str) => str.startsWith(":") ? `{${str.substring(1)}}` : str)
|
|
181
224
|
.join("/");
|
|
225
|
+
// a route path, `:id`, as the router reads it; an accessor already
|
|
226
|
+
// in OpenAPI form, `{id}`, is taken as is
|
|
227
|
+
const path = normalized.includes(":")
|
|
228
|
+
? PathAnalyzer_1.PathAnalyzer.toOpenApi(normalized)
|
|
229
|
+
: normalized;
|
|
182
230
|
return (_b = (_a = props.document.paths) === null || _a === void 0 ? void 0 : _a[path]) === null || _b === void 0 ? void 0 : _b[method];
|
|
183
231
|
}),
|
|
184
232
|
};
|
|
185
233
|
// COMPOSE OPERATIONS
|
|
234
|
+
const violations = [];
|
|
186
235
|
for (const r of props.routes) {
|
|
187
|
-
const
|
|
236
|
+
const method = r.method.toLowerCase();
|
|
188
237
|
const path = getPath(r);
|
|
189
238
|
(_a = (_c = props.document).paths) !== null && _a !== void 0 ? _a : (_c.paths = {});
|
|
190
239
|
(_b = (_d = props.document.paths)[path]) !== null && _b !== void 0 ? _b : (_d[path] = {});
|
|
191
|
-
props.document.paths[path][
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
});
|
|
240
|
+
props.document.paths[path][method] = SwaggerOperationComposer_1.SwaggerOperationComposer.compose(Object.assign(Object.assign({}, props), { route: r }));
|
|
241
|
+
violations.push(...validateSecurity({
|
|
242
|
+
config: props.config,
|
|
243
|
+
route: r,
|
|
244
|
+
security: props.document.paths[path][method].security,
|
|
245
|
+
}));
|
|
246
|
+
const closure = Reflect.getMetadata("nestia/SwaggerCustomizer", r.controller.class.prototype, r.key);
|
|
247
|
+
if (closure !== undefined)
|
|
248
|
+
customizers.push({
|
|
249
|
+
route: r,
|
|
250
|
+
method,
|
|
251
|
+
path,
|
|
252
|
+
closures: Array.isArray(closure) ? closure : [closure],
|
|
205
253
|
});
|
|
206
|
-
}
|
|
207
254
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
255
|
+
if (violations.length !== 0)
|
|
256
|
+
throw new Error([
|
|
257
|
+
`Error on Swagger composition: invalid security requirements. Declare every scheme a route names, with its scopes, in the "security" of the Swagger configuration: "swagger.security" of "nestia.config.ts", or the configuration given to NestiaSwaggerComposer.document().`,
|
|
258
|
+
"",
|
|
259
|
+
"List of violations:",
|
|
260
|
+
...violations,
|
|
261
|
+
].join("\n"));
|
|
262
|
+
// DETACH, then DO CUSTOMIZE
|
|
263
|
+
detach(props.document);
|
|
264
|
+
// Each customizer receives the operation composed for its own route, found
|
|
265
|
+
// before any customizer runs, since one may move or delete paths.
|
|
266
|
+
const operations = customizers.map((c) => props.document.paths[c.path][c.method]);
|
|
267
|
+
customizers.forEach((c, i) => {
|
|
268
|
+
for (const closure of c.closures)
|
|
269
|
+
closure({
|
|
270
|
+
swagger: props.document,
|
|
271
|
+
method: c.route.method,
|
|
272
|
+
path: c.path,
|
|
273
|
+
route: operations[i],
|
|
274
|
+
at: (func) => neighbor.at.get().get(func),
|
|
275
|
+
get: (accessor) => neighbor.get.get()(accessor),
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Replaces every member of the composed document with a copy, in place.
|
|
281
|
+
*
|
|
282
|
+
* Operations still hold values nestia does not own by reference: decorator
|
|
283
|
+
* examples, `@ApiExtension` values, security requirements, and the configured
|
|
284
|
+
* servers, security schemes, and document info. They outlive the document,
|
|
285
|
+
* since route metadata and the configuration serve every composition in the
|
|
286
|
+
* process, so a `SwaggerCustomizer` or a caller editing one document edited
|
|
287
|
+
* all of them, and the next composition started from the edit. It runs before
|
|
288
|
+
* the customizers, which may then edit freely.
|
|
289
|
+
*/
|
|
290
|
+
const detach = (document) => {
|
|
291
|
+
const copy = clone(document);
|
|
292
|
+
for (const key of Object.keys(document))
|
|
293
|
+
delete document[key];
|
|
294
|
+
Object.assign(document, copy);
|
|
211
295
|
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
296
|
+
/**
|
|
297
|
+
* Copies the arrays and plain objects `value` is built of, keeping every
|
|
298
|
+
* other value as it is.
|
|
299
|
+
*
|
|
300
|
+
* A document is edited as the tree its JSON is, so every reference to an
|
|
301
|
+
* array or plain object gets its own copy, except a reference back to an
|
|
302
|
+
* enclosing one, which stays circular. Values are not converted: a JSON copy
|
|
303
|
+
* would throw on a bigint example or turn a `Date` into a string before the
|
|
304
|
+
* customizer or caller that handles it runs.
|
|
305
|
+
*/
|
|
306
|
+
const clone = (value, ancestors = new Map()) => {
|
|
307
|
+
if (typeof value !== "object" || value === null)
|
|
308
|
+
return value;
|
|
309
|
+
const prototype = Object.getPrototypeOf(value);
|
|
310
|
+
const array = Array.isArray(value);
|
|
311
|
+
if (!array && prototype !== Object.prototype && prototype !== null)
|
|
312
|
+
return value;
|
|
313
|
+
const circular = ancestors.get(value);
|
|
314
|
+
if (circular !== undefined)
|
|
315
|
+
return circular;
|
|
316
|
+
const output = (array ? new Array(value.length) : {});
|
|
317
|
+
ancestors.set(value, output);
|
|
318
|
+
for (const key of Object.keys(value))
|
|
319
|
+
Object.defineProperty(output, key, {
|
|
320
|
+
value: clone(value[key], ancestors),
|
|
321
|
+
writable: true,
|
|
322
|
+
enumerable: true,
|
|
323
|
+
configurable: true,
|
|
324
|
+
});
|
|
325
|
+
ancestors.delete(value);
|
|
326
|
+
return output;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* The violations of an operation's security requirements against the
|
|
330
|
+
* configured `swagger.security` schemes: a scheme it never declares, an
|
|
331
|
+
* OAuth2 scope no flow of the scheme declares, and, for an OpenAPI 3.0 or
|
|
332
|
+
* Swagger 2.0 document, scopes on a scheme other than OAuth2 or OpenID
|
|
333
|
+
* Connect, which those versions require to be empty. From 3.1 on, such a
|
|
334
|
+
* scheme's array lists the role names the operation requires. An OpenID
|
|
335
|
+
* Connect scheme lists no scopes of its own, so its scopes are not checked.
|
|
336
|
+
*/
|
|
337
|
+
const validateSecurity = (props) => {
|
|
338
|
+
var _a;
|
|
339
|
+
var _b, _c, _d;
|
|
340
|
+
const violations = [];
|
|
341
|
+
const report = (message) => {
|
|
342
|
+
violations.push(` - ${message} (${props.route.controller.class.name}.${props.route.key}() at "${props.route.method} ${props.route.path}")`);
|
|
343
|
+
};
|
|
344
|
+
for (const requirement of (_b = props.security) !== null && _b !== void 0 ? _b : [])
|
|
345
|
+
for (const [name, scopes] of Object.entries(requirement)) {
|
|
346
|
+
const scheme = (_a = props.config.security) === null || _a === void 0 ? void 0 : _a[name];
|
|
347
|
+
if (scheme === undefined)
|
|
348
|
+
report(`target security scheme "${name}" does not exist.`);
|
|
349
|
+
else if (scopes.length === 0 || scheme.type === "openIdConnect")
|
|
350
|
+
continue;
|
|
351
|
+
else if (scheme.type !== "oauth2") {
|
|
352
|
+
const version = (_c = props.config.openapi) !== null && _c !== void 0 ? _c : "3.2";
|
|
353
|
+
if (version === "3.0" || version === "2.0")
|
|
354
|
+
report(`target security scheme "${name}" is neither "oauth2" nor "openIdConnect" type, but you've configured the scopes, which OpenAPI ${version} requires to be empty.`);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
const declared = new Set(Object.values((_d = scheme.flows) !== null && _d !== void 0 ? _d : {}).flatMap((flow) => { var _a; return Object.keys((_a = flow === null || flow === void 0 ? void 0 : flow.scopes) !== null && _a !== void 0 ? _a : {}); }));
|
|
358
|
+
for (const scope of scopes)
|
|
359
|
+
if (declared.has(scope) === false)
|
|
360
|
+
report(`target security scheme "${name}" does not have a specific scope "${scope}".`);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return violations;
|
|
217
364
|
};
|
|
365
|
+
// each parameter where the router reads it; a replacement by text would
|
|
366
|
+
// turn `:identity` into `{id}entity` for a path also holding `:id`
|
|
367
|
+
const getPath = (route) => PathAnalyzer_1.PathAnalyzer.toOpenApi(route.path);
|
|
218
368
|
const isSwaggerExcluded = (route) => {
|
|
219
369
|
const controller = Reflect.getMetadata("swagger/apiExcludeController", route.controller.class);
|
|
220
370
|
if (Array.isArray(controller) && controller[0] === true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwaggerGenerator.js","sourceRoot":"","sources":["../../src/generates/SwaggerGenerator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAQA,wCAAgD;AAChD,4CAAoB;AACpB,gDAAwB;AACxB,+BAAiC;AAIjC,+CAI4B;AAG5B,0DAAuD;AACvD,sFAAmF;AACnF,kFAA+E;AAC/E,wFAAqF;AAErF,IAAiB,gBAAgB,CAwThC;AAxTD,WAAiB,gBAAgB;IAClB,yBAAQ,GAAG,CAAO,GAAsB,EAAiB,EAAE;;QACtE,oBAAoB;QACpB,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC;QAC3C,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS;YAC1C,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAiC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QAExE,kBAAkB;QAClB,MAAM,MAAM,GAAoB,cAAI,CAAC,KAAK,CAAC,MAAM,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QACF,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC;QAErE,MAAM,QAAQ,GAAY,OAAO,CAAC,WAAW,CAC3C,4BAA4B,EAC5B,KAAK,CAAC,QAAQ,CACf,CAAC;QACF,OAAO,CACL,QAAQ,KAAK,SAAS;YACtB,CAAC,OAAO,QAAQ,KAAK,QAAQ;gBAC3B,QAAQ,KAAK,IAAI;gBAChB,QAAkC,CAAC,OAAO,KAAK,KAAK,CAAC,CACzD,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,EAtegB,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QAsehC"}
|
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
import { INestiaProject } from "../../structures/INestiaProject";
|
|
2
2
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
3
|
+
/**
|
|
4
|
+
* Writes the e2e test file of one HTTP route.
|
|
5
|
+
*
|
|
6
|
+
* @evidence contracts/common.md#principled-implementation The namespace prints an exported function that calls the route's SDK function with random arguments and asserts its result.
|
|
7
|
+
* @evidence contracts/common.md#clear-and-simple-design One public function and private helpers.
|
|
8
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The generated file uses the SDK the same way a user does.
|
|
9
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
10
|
+
* @evidence contracts/portability.md#os-neutral-implementation The caller supplies native api/current locations; ImportDictionary converts relative imports to slash-separated language specifiers, and FilePrinter writes the computed test pathname through Node fs with UTF-8. No filename case policy is inferred.
|
|
11
|
+
*/
|
|
3
12
|
export declare namespace E2eFileProgrammer {
|
|
13
|
+
/**
|
|
14
|
+
* Writes the test file of a route, named after its accessor, with the imports
|
|
15
|
+
* it needs.
|
|
16
|
+
*
|
|
17
|
+
* @evidence contracts/common.md#principled-implementation The imports are collected while the function is built and printed before it.
|
|
18
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
19
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The file name is derived from the route accessor.
|
|
20
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
21
|
+
* @evidence contracts/portability.md#os-neutral-implementation The caller supplies native api/current locations; ImportDictionary converts relative imports to slash-separated language specifiers, and FilePrinter writes the computed test pathname through Node fs with UTF-8. No filename case policy is inferred.
|
|
22
|
+
*/
|
|
4
23
|
const generate: (project: INestiaProject) => (props: {
|
|
5
24
|
api: string;
|
|
6
25
|
current: string;
|
|
@@ -18,8 +18,27 @@ const ImportDictionary_1 = require("./ImportDictionary");
|
|
|
18
18
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
19
19
|
const SdkHttpParameterProgrammer_1 = require("./SdkHttpParameterProgrammer");
|
|
20
20
|
const SdkImportWizard_1 = require("./SdkImportWizard");
|
|
21
|
+
/**
|
|
22
|
+
* Writes the e2e test file of one HTTP route.
|
|
23
|
+
*
|
|
24
|
+
* @evidence contracts/common.md#principled-implementation The namespace prints an exported function that calls the route's SDK function with random arguments and asserts its result.
|
|
25
|
+
* @evidence contracts/common.md#clear-and-simple-design One public function and private helpers.
|
|
26
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The generated file uses the SDK the same way a user does.
|
|
27
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
28
|
+
* @evidence contracts/portability.md#os-neutral-implementation The caller supplies native api/current locations; ImportDictionary converts relative imports to slash-separated language specifiers, and FilePrinter writes the computed test pathname through Node fs with UTF-8. No filename case policy is inferred.
|
|
29
|
+
*/
|
|
21
30
|
var E2eFileProgrammer;
|
|
22
31
|
(function (E2eFileProgrammer) {
|
|
32
|
+
/**
|
|
33
|
+
* Writes the test file of a route, named after its accessor, with the imports
|
|
34
|
+
* it needs.
|
|
35
|
+
*
|
|
36
|
+
* @evidence contracts/common.md#principled-implementation The imports are collected while the function is built and printed before it.
|
|
37
|
+
* @evidence contracts/common.md#clear-and-simple-design One function.
|
|
38
|
+
* @evidence contracts/common.md#prohibited-implementation-shortcuts The file name is derived from the route accessor.
|
|
39
|
+
* @evidence contracts/common.md#meaningful-documentation The comment states what the declaration produces and its result.
|
|
40
|
+
* @evidence contracts/portability.md#os-neutral-implementation The caller supplies native api/current locations; ImportDictionary converts relative imports to slash-separated language specifiers, and FilePrinter writes the computed test pathname through Node fs with UTF-8. No filename case policy is inferred.
|
|
41
|
+
*/
|
|
23
42
|
E2eFileProgrammer.generate = (project) => (props) => (route) => __awaiter(this, void 0, void 0, function* () {
|
|
24
43
|
const importer = new ImportDictionary_1.ImportDictionary(`${props.current}/${getFunctionName(route)}.ts`);
|
|
25
44
|
if (project.config.clone !== true)
|
|
@@ -73,7 +92,7 @@ var E2eFileProgrammer;
|
|
|
73
92
|
LiteralFactory_1.LiteralFactory.write(Object.fromEntries(entries.map((e) => [
|
|
74
93
|
e.key,
|
|
75
94
|
factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [getRandomType(importer)(e)], undefined),
|
|
76
|
-
]))),
|
|
95
|
+
])), true),
|
|
77
96
|
]
|
|
78
97
|
: entries.map((e) => factory_1.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(factory_1.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)), "random"), [getRandomType(importer)(e)], undefined))),
|
|
79
98
|
]);
|