@nestia/sdk 3.10.0 → 3.11.0-dev.20240812
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/lib/NestiaSdkApplication.d.ts +1 -3
- package/lib/NestiaSdkApplication.js +138 -136
- package/lib/NestiaSdkApplication.js.map +1 -1
- package/lib/analyses/ConfigAnalyzer.d.ts +2 -2
- package/lib/analyses/ConfigAnalyzer.js +39 -80
- package/lib/analyses/ConfigAnalyzer.js.map +1 -1
- package/lib/analyses/ExceptionAnalyzer.d.ts +0 -16
- package/lib/analyses/ExceptionAnalyzer.js +142 -105
- package/lib/analyses/ExceptionAnalyzer.js.map +1 -1
- package/lib/analyses/GenericAnalyzer.d.ts +1 -2
- package/lib/analyses/GenericAnalyzer.js.map +1 -1
- package/lib/analyses/ImportAnalyzer.d.ts +6 -11
- package/lib/analyses/ImportAnalyzer.js +70 -42
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectControllerAnalyzer.d.ts +7 -1
- package/lib/analyses/ReflectControllerAnalyzer.js +28 -99
- package/lib/analyses/ReflectControllerAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.d.ts +6 -2
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +72 -152
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.d.ts +15 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js +215 -0
- package/lib/analyses/ReflectHttpOperationParameterAnalyzer.js.map +1 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.d.ts +15 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js +81 -0
- package/lib/analyses/ReflectHttpOperationResponseAnalyzer.js.map +1 -0
- package/lib/analyses/ReflectMetadataAnalyzer.d.ts +1 -3
- package/lib/analyses/ReflectMetadataAnalyzer.js +0 -4
- package/lib/analyses/ReflectMetadataAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.d.ts +6 -2
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +72 -48
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/analyses/TypedHttpRouteAnalyzer.d.ts +15 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.js +111 -0
- package/lib/analyses/TypedHttpRouteAnalyzer.js.map +1 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.d.ts +10 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js +9 -0
- package/lib/analyses/TypedWebSocketRouteAnalyzer.js.map +1 -0
- package/lib/decorators/OperationMetadata.d.ts +2 -0
- package/lib/decorators/OperationMetadata.js +10 -0
- package/lib/decorators/OperationMetadata.js.map +1 -0
- package/lib/executable/internal/NestiaConfigLoader.d.ts +1 -1
- package/lib/executable/internal/NestiaConfigLoader.js +33 -3
- package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js +1 -1
- package/lib/executable/internal/NestiaSdkCommand.js.map +1 -1
- package/lib/generates/CloneGenerator.d.ts +0 -5
- package/lib/generates/CloneGenerator.js +60 -60
- package/lib/generates/CloneGenerator.js.map +1 -1
- package/lib/generates/E2eGenerator.d.ts +2 -3
- package/lib/generates/E2eGenerator.js +9 -8
- package/lib/generates/E2eGenerator.js.map +1 -1
- package/lib/generates/OpenAiGenerator.d.ts +2 -4
- package/lib/generates/OpenAiGenerator.js +13 -3
- package/lib/generates/OpenAiGenerator.js.map +1 -1
- package/lib/generates/SdkGenerator.d.ts +4 -4
- package/lib/generates/SdkGenerator.js +63 -73
- package/lib/generates/SdkGenerator.js.map +1 -1
- package/lib/generates/SwaggerGenerator.d.ts +6 -18
- package/lib/generates/SwaggerGenerator.js +60 -235
- package/lib/generates/SwaggerGenerator.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +5 -9
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.d.ts +6 -4
- package/lib/generates/internal/SdkAliasCollection.js +33 -31
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkDistributionComposer.d.ts +4 -1
- package/lib/generates/internal/SdkDistributionComposer.js +6 -6
- package/lib/generates/internal/SdkDistributionComposer.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.d.ts +2 -4
- package/lib/generates/internal/SdkFileProgrammer.js +6 -6
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +0 -12
- package/lib/generates/internal/SdkHttpCloneProgrammer.js +142 -97
- package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js +37 -59
- package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +31 -48
- package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpRouteProgrammer.js +7 -3
- package/lib/generates/internal/SdkHttpRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +4 -3
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +7 -13
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +1 -2
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +11 -16
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +1 -2
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +7 -10
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/generates/internal/SwaggerDescriptionComposer.d.ts +23 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js +44 -0
- package/lib/generates/internal/SwaggerDescriptionComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationComposer.d.ts +12 -0
- package/lib/generates/internal/SwaggerOperationComposer.js +68 -0
- package/lib/generates/internal/SwaggerOperationComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.d.ts +18 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.js +99 -0
- package/lib/generates/internal/SwaggerOperationParameterComposer.js.map +1 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.d.ts +9 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js +91 -0
- package/lib/generates/internal/SwaggerOperationResponseComposer.js.map +1 -0
- package/lib/structures/INestiaProject.d.ts +5 -5
- package/lib/structures/INestiaSdkInput.d.ts +20 -0
- package/lib/structures/{ISwaggerError.js → INestiaSdkInput.js} +1 -1
- package/lib/structures/INestiaSdkInput.js.map +1 -0
- package/lib/structures/IReflectApplication.d.ts +6 -0
- package/lib/structures/IReflectApplication.js +3 -0
- package/lib/structures/IReflectApplication.js.map +1 -0
- package/lib/structures/IReflectController.d.ts +3 -5
- package/lib/structures/IReflectHttpOperation.d.ts +13 -65
- package/lib/structures/IReflectHttpOperationException.d.ts +14 -0
- package/lib/structures/IReflectHttpOperationException.js +3 -0
- package/lib/structures/IReflectHttpOperationException.js.map +1 -0
- package/lib/structures/IReflectHttpOperationParameter.d.ts +35 -0
- package/lib/structures/IReflectHttpOperationParameter.js +3 -0
- package/lib/structures/IReflectHttpOperationParameter.js.map +1 -0
- package/lib/structures/IReflectHttpOperationSuccess.d.ts +15 -0
- package/lib/structures/IReflectHttpOperationSuccess.js +3 -0
- package/lib/structures/IReflectHttpOperationSuccess.js.map +1 -0
- package/lib/structures/IReflectOperationError.d.ts +16 -0
- package/lib/structures/IReflectOperationError.js +23 -0
- package/lib/structures/IReflectOperationError.js.map +1 -0
- package/lib/structures/IReflectType.d.ts +4 -0
- package/lib/structures/{IErrorReport.js → IReflectType.js} +1 -1
- package/lib/structures/IReflectType.js.map +1 -0
- package/lib/structures/IReflectTypeImport.d.ts +4 -0
- package/lib/structures/{ISwaggerLazySchema.js → IReflectTypeImport.js} +1 -1
- package/lib/structures/IReflectTypeImport.js.map +1 -0
- package/lib/structures/IReflectWebSocketOperation.d.ts +8 -9
- package/lib/structures/IReflectWebSocketOperationParameter.d.ts +23 -0
- package/lib/structures/IReflectWebSocketOperationParameter.js +3 -0
- package/lib/structures/IReflectWebSocketOperationParameter.js.map +1 -0
- package/lib/structures/ITypedApplication.d.ts +7 -0
- package/lib/structures/{INormalizedInput.js → ITypedApplication.js} +1 -1
- package/lib/structures/ITypedApplication.js.map +1 -0
- package/lib/structures/ITypedHttpRoute.d.ts +14 -42
- package/lib/structures/ITypedHttpRouteException.d.ts +10 -0
- package/lib/structures/ITypedHttpRouteException.js +3 -0
- package/lib/structures/ITypedHttpRouteException.js.map +1 -0
- package/lib/structures/ITypedHttpRouteParameter.d.ts +31 -0
- package/lib/structures/ITypedHttpRouteParameter.js +3 -0
- package/lib/structures/ITypedHttpRouteParameter.js.map +1 -0
- package/lib/structures/ITypedHttpRouteSuccess.d.ts +19 -0
- package/lib/structures/{ISwaggerLazyProperty.js → ITypedHttpRouteSuccess.js} +1 -1
- package/lib/structures/ITypedHttpRouteSuccess.js.map +1 -0
- package/lib/structures/ITypedWebSocketRoute.d.ts +8 -44
- package/lib/structures/ITypedWebSocketRouteParameter.d.ts +2 -0
- package/lib/structures/ITypedWebSocketRouteParameter.js +3 -0
- package/lib/structures/ITypedWebSocketRouteParameter.js.map +1 -0
- package/lib/transform.d.ts +3 -0
- package/lib/transform.js +8 -0
- package/lib/transform.js.map +1 -0
- package/lib/transformers/IOperationMetadata.d.ts +36 -0
- package/lib/transformers/IOperationMetadata.js +3 -0
- package/lib/transformers/IOperationMetadata.js.map +1 -0
- package/lib/transformers/ISdkTransformerContext.d.ts +7 -0
- package/lib/transformers/ISdkTransformerContext.js +3 -0
- package/lib/transformers/ISdkTransformerContext.js.map +1 -0
- package/lib/transformers/SdkMetadataProgrammer.d.ts +11 -0
- package/lib/transformers/SdkMetadataProgrammer.js +159 -0
- package/lib/transformers/SdkMetadataProgrammer.js.map +1 -0
- package/lib/transformers/SdkTransformer.d.ts +4 -0
- package/lib/transformers/SdkTransformer.js +88 -0
- package/lib/transformers/SdkTransformer.js.map +1 -0
- package/lib/transformers/TextPlainValidator.d.ts +4 -0
- package/lib/transformers/TextPlainValidator.js +19 -0
- package/lib/transformers/TextPlainValidator.js.map +1 -0
- package/lib/utils/StringUtil.d.ts +1 -0
- package/lib/utils/StringUtil.js +1 -0
- package/lib/utils/StringUtil.js.map +1 -1
- package/package.json +8 -8
- package/src/NestiaSdkApplication.ts +173 -160
- package/src/analyses/ConfigAnalyzer.ts +50 -98
- package/src/analyses/ExceptionAnalyzer.ts +142 -142
- package/src/analyses/GenericAnalyzer.ts +3 -5
- package/src/analyses/ImportAnalyzer.ts +130 -115
- package/src/analyses/ReflectControllerAnalyzer.ts +63 -115
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +142 -278
- package/src/analyses/ReflectHttpOperationParameterAnalyzer.ts +319 -0
- package/src/analyses/ReflectHttpOperationResponseAnalyzer.ts +117 -0
- package/src/analyses/ReflectMetadataAnalyzer.ts +1 -18
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +143 -78
- package/src/analyses/TypedHttpRouteAnalyzer.ts +178 -0
- package/src/analyses/TypedWebSocketRouteAnalyzer.ts +18 -0
- package/src/decorators/OperationMetadata.ts +15 -0
- package/src/executable/internal/NestiaConfigLoader.ts +17 -3
- package/src/executable/internal/NestiaSdkCommand.ts +1 -4
- package/src/generates/CloneGenerator.ts +60 -59
- package/src/generates/E2eGenerator.ts +20 -21
- package/src/generates/OpenAiGenerator.ts +44 -45
- package/src/generates/SdkGenerator.ts +97 -125
- package/src/generates/SwaggerGenerator.ts +114 -416
- package/src/generates/internal/E2eFileProgrammer.ts +5 -14
- package/src/generates/internal/SdkAliasCollection.ts +33 -41
- package/src/generates/internal/SdkDistributionComposer.ts +9 -6
- package/src/generates/internal/SdkFileProgrammer.ts +11 -14
- package/src/generates/internal/SdkHttpCloneProgrammer.ts +142 -142
- package/src/generates/internal/SdkHttpFunctionProgrammer.ts +20 -47
- package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +245 -275
- package/src/generates/internal/SdkHttpRouteProgrammer.ts +7 -7
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +11 -23
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +197 -233
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +5 -15
- package/src/generates/internal/{SwaggerDescriptionGenerator.ts → SwaggerDescriptionComposer.ts} +25 -5
- package/src/generates/internal/SwaggerOperationComposer.ts +90 -0
- package/src/generates/internal/SwaggerOperationParameterComposer.ts +173 -0
- package/src/generates/internal/SwaggerOperationResponseComposer.ts +110 -0
- package/src/structures/INestiaProject.ts +5 -5
- package/src/structures/INestiaSdkInput.ts +25 -0
- package/src/structures/IReflectApplication.ts +8 -0
- package/src/structures/IReflectController.ts +3 -5
- package/src/structures/IReflectHttpOperation.ts +14 -76
- package/src/structures/IReflectHttpOperationException.ts +19 -0
- package/src/structures/IReflectHttpOperationParameter.ts +81 -0
- package/src/structures/IReflectHttpOperationSuccess.ts +22 -0
- package/src/structures/IReflectOperationError.ts +26 -0
- package/src/structures/IReflectType.ts +4 -0
- package/src/structures/IReflectTypeImport.ts +4 -0
- package/src/structures/IReflectWebSocketOperation.ts +9 -9
- package/src/structures/IReflectWebSocketOperationParameter.ts +38 -0
- package/src/structures/ITypedApplication.ts +8 -0
- package/src/structures/ITypedHttpRoute.ts +15 -45
- package/src/structures/ITypedHttpRouteException.ts +15 -0
- package/src/structures/ITypedHttpRouteParameter.ts +41 -0
- package/src/structures/ITypedHttpRouteSuccess.ts +22 -0
- package/src/structures/ITypedWebSocketRoute.ts +8 -56
- package/src/structures/ITypedWebSocketRouteParameter.ts +3 -0
- package/src/transform.ts +9 -0
- package/src/transformers/IOperationMetadata.ts +38 -0
- package/src/transformers/ISdkTransformerContext.ts +8 -0
- package/src/transformers/SdkMetadataProgrammer.ts +227 -0
- package/src/transformers/SdkTransformer.ts +168 -0
- package/src/transformers/TextPlainValidator.ts +17 -0
- package/src/utils/StringUtil.ts +3 -0
- package/lib/analyses/TypedControllerAnalyzer.d.ts +0 -8
- package/lib/analyses/TypedControllerAnalyzer.js +0 -77
- package/lib/analyses/TypedControllerAnalyzer.js.map +0 -1
- package/lib/analyses/TypedHttpOperationAnalyzer.d.ts +0 -15
- package/lib/analyses/TypedHttpOperationAnalyzer.js +0 -263
- package/lib/analyses/TypedHttpOperationAnalyzer.js.map +0 -1
- package/lib/analyses/TypedWebSocketOperationAnalyzer.d.ts +0 -15
- package/lib/analyses/TypedWebSocketOperationAnalyzer.js +0 -226
- package/lib/analyses/TypedWebSocketOperationAnalyzer.js.map +0 -1
- package/lib/generates/internal/SwaggerDescriptionGenerator.d.ts +0 -14
- package/lib/generates/internal/SwaggerDescriptionGenerator.js +0 -33
- package/lib/generates/internal/SwaggerDescriptionGenerator.js.map +0 -1
- package/lib/generates/internal/SwaggerSchemaGenerator.d.ts +0 -21
- package/lib/generates/internal/SwaggerSchemaGenerator.js +0 -289
- package/lib/generates/internal/SwaggerSchemaGenerator.js.map +0 -1
- package/lib/generates/internal/SwaggerSchemaValidator.d.ts +0 -7
- package/lib/generates/internal/SwaggerSchemaValidator.js +0 -191
- package/lib/generates/internal/SwaggerSchemaValidator.js.map +0 -1
- package/lib/structures/IErrorReport.d.ts +0 -6
- package/lib/structures/IErrorReport.js.map +0 -1
- package/lib/structures/INormalizedInput.d.ts +0 -19
- package/lib/structures/INormalizedInput.js.map +0 -1
- package/lib/structures/ISwaggerError.d.ts +0 -6
- package/lib/structures/ISwaggerError.js.map +0 -1
- package/lib/structures/ISwaggerLazyProperty.d.ts +0 -6
- package/lib/structures/ISwaggerLazyProperty.js.map +0 -1
- package/lib/structures/ISwaggerLazySchema.d.ts +0 -6
- package/lib/structures/ISwaggerLazySchema.js.map +0 -1
- package/lib/structures/ITypeTuple.d.ts +0 -5
- package/lib/structures/ITypeTuple.js +0 -3
- package/lib/structures/ITypeTuple.js.map +0 -1
- package/src/analyses/TypedControllerAnalyzer.ts +0 -92
- package/src/analyses/TypedHttpOperationAnalyzer.ts +0 -365
- package/src/analyses/TypedWebSocketOperationAnalyzer.ts +0 -375
- package/src/generates/internal/SwaggerSchemaGenerator.ts +0 -473
- package/src/generates/internal/SwaggerSchemaValidator.ts +0 -206
- package/src/structures/IErrorReport.ts +0 -6
- package/src/structures/INormalizedInput.ts +0 -20
- package/src/structures/ISwaggerError.ts +0 -8
- package/src/structures/ISwaggerLazyProperty.ts +0 -7
- package/src/structures/ISwaggerLazySchema.ts +0 -7
- package/src/structures/ITypeTuple.ts +0 -6
|
@@ -19,16 +19,15 @@ const FilePrinter_1 = require("./FilePrinter");
|
|
|
19
19
|
const ImportDictionary_1 = require("./ImportDictionary");
|
|
20
20
|
const SdkAliasCollection_1 = require("./SdkAliasCollection");
|
|
21
21
|
const SdkImportWizard_1 = require("./SdkImportWizard");
|
|
22
|
-
const SdkTypeProgrammer_1 = require("./SdkTypeProgrammer");
|
|
23
22
|
var E2eFileProgrammer;
|
|
24
23
|
(function (E2eFileProgrammer) {
|
|
25
24
|
E2eFileProgrammer.generate = (project) => (props) => (route) => __awaiter(this, void 0, void 0, function* () {
|
|
26
25
|
const importer = new ImportDictionary_1.ImportDictionary(`${props.current}/${getFunctionName(route)}.ts`);
|
|
27
26
|
if (project.config.clone !== true)
|
|
28
27
|
for (const tuple of route.imports)
|
|
29
|
-
for (const instance of tuple
|
|
28
|
+
for (const instance of tuple.instances)
|
|
30
29
|
importer.internal({
|
|
31
|
-
file: tuple
|
|
30
|
+
file: tuple.file,
|
|
32
31
|
type: true,
|
|
33
32
|
instance,
|
|
34
33
|
});
|
|
@@ -58,7 +57,7 @@ var E2eFileProgrammer;
|
|
|
58
57
|
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createIdentifier("connection")),
|
|
59
58
|
typescript_1.default.factory.createPropertyAssignment("headers", typescript_1.default.factory.createObjectLiteralExpression([
|
|
60
59
|
typescript_1.default.factory.createSpreadAssignment(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier("connection"))("headers")),
|
|
61
|
-
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [
|
|
60
|
+
typescript_1.default.factory.createSpreadAssignment(typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [SdkAliasCollection_1.SdkAliasCollection.name(headers.type)], undefined)),
|
|
62
61
|
], true)),
|
|
63
62
|
], true)
|
|
64
63
|
: typescript_1.default.factory.createIdentifier("connection");
|
|
@@ -66,7 +65,7 @@ var E2eFileProgrammer;
|
|
|
66
65
|
connection,
|
|
67
66
|
...route.parameters
|
|
68
67
|
.filter((p) => p.category !== "headers")
|
|
69
|
-
.map((p) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [
|
|
68
|
+
.map((p) => typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("random"), [SdkAliasCollection_1.SdkAliasCollection.name(p.type)], undefined)),
|
|
70
69
|
]);
|
|
71
70
|
const assert = typescript_1.default.factory.createCallExpression(IdentifierFactory_1.IdentifierFactory.access(typescript_1.default.factory.createIdentifier(SdkImportWizard_1.SdkImportWizard.typia(importer)))("assert"), undefined, [typescript_1.default.factory.createIdentifier("output")]);
|
|
72
71
|
return typescript_1.default.factory.createArrowFunction([typescript_1.default.factory.createModifier(typescript_1.default.SyntaxKind.AsyncKeyword)], undefined, [
|
|
@@ -74,7 +73,7 @@ var E2eFileProgrammer;
|
|
|
74
73
|
], undefined, undefined, typescript_1.default.factory.createBlock([
|
|
75
74
|
typescript_1.default.factory.createVariableStatement([], typescript_1.default.factory.createVariableDeclarationList([
|
|
76
75
|
typescript_1.default.factory.createVariableDeclaration("output", undefined, project.config.propagate !== true &&
|
|
77
|
-
route.
|
|
76
|
+
route.success.type.name === "void"
|
|
78
77
|
? undefined
|
|
79
78
|
: SdkAliasCollection_1.SdkAliasCollection.output(project)(importer)(route), typescript_1.default.factory.createAwaitExpression(caller)),
|
|
80
79
|
], typescript_1.default.NodeFlags.Const)),
|
|
@@ -83,7 +82,4 @@ var E2eFileProgrammer;
|
|
|
83
82
|
};
|
|
84
83
|
})(E2eFileProgrammer || (exports.E2eFileProgrammer = E2eFileProgrammer = {}));
|
|
85
84
|
const getFunctionName = (route) => ["test", "api", ...route.accessors].join("_");
|
|
86
|
-
const getTypeName = (project) => (importer) => (p) => p.metadata
|
|
87
|
-
? SdkTypeProgrammer_1.SdkTypeProgrammer.write(project)(importer)(p.metadata)
|
|
88
|
-
: typescript_1.default.factory.createTypeReferenceNode(p.typeName);
|
|
89
85
|
//# sourceMappingURL=E2eFileProgrammer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA4B;AAC5B,6EAA0E;AAI1E,+CAA4C;AAC5C,yDAAsD;AACtD,6DAA0D;AAC1D,uDAAoD;
|
|
1
|
+
{"version":3,"file":"E2eFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/E2eFileProgrammer.ts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AM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
2
|
import { INestiaProject } from "../../structures/INestiaProject";
|
|
3
|
+
import { IReflectType } from "../../structures/IReflectType";
|
|
3
4
|
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
5
|
+
import { ITypedHttpRouteParameter } from "../../structures/ITypedHttpRouteParameter";
|
|
4
6
|
import { ImportDictionary } from "./ImportDictionary";
|
|
5
7
|
export declare namespace SdkAliasCollection {
|
|
6
|
-
const name: (
|
|
7
|
-
const headers: (project: INestiaProject) => (importer: ImportDictionary) => (param:
|
|
8
|
-
const query: (project: INestiaProject) => (importer: ImportDictionary) => (param:
|
|
9
|
-
const input: (project: INestiaProject) => (importer: ImportDictionary) => (param:
|
|
8
|
+
const name: (type: IReflectType) => ts.TypeNode;
|
|
9
|
+
const headers: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter.IHeaders) => ts.TypeNode;
|
|
10
|
+
const query: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter.IQuery) => ts.TypeNode;
|
|
11
|
+
const input: (project: INestiaProject) => (importer: ImportDictionary) => (param: ITypedHttpRouteParameter) => ts.TypeNode;
|
|
10
12
|
const output: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => ts.TypeNode;
|
|
11
13
|
const responseBody: (project: INestiaProject) => (importer: ImportDictionary) => (route: ITypedHttpRoute) => ts.TypeNode;
|
|
12
14
|
}
|
|
@@ -6,14 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.SdkAliasCollection = void 0;
|
|
7
7
|
const typescript_1 = __importDefault(require("typescript"));
|
|
8
8
|
const typia_1 = __importDefault(require("typia"));
|
|
9
|
-
const SdkTypeProgrammer_1 = require("./SdkTypeProgrammer");
|
|
10
9
|
var SdkAliasCollection;
|
|
11
10
|
(function (SdkAliasCollection) {
|
|
12
|
-
SdkAliasCollection.name = (
|
|
13
|
-
? SdkTypeProgrammer_1.SdkTypeProgrammer.write(project)(importer)(p.metadata)
|
|
14
|
-
: typescript_1.default.factory.createTypeReferenceNode(p.typeName);
|
|
11
|
+
SdkAliasCollection.name = (type) => typescript_1.default.factory.createTypeReferenceNode(type.name, type.typeArguments ? type.typeArguments.map(SdkAliasCollection.name) : undefined);
|
|
15
12
|
SdkAliasCollection.headers = (project) => (importer) => (param) => {
|
|
16
|
-
const type = SdkAliasCollection.name(
|
|
13
|
+
const type = SdkAliasCollection.name(param);
|
|
17
14
|
if (project.config.primitive === false)
|
|
18
15
|
return type;
|
|
19
16
|
return typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
@@ -23,7 +20,7 @@ var SdkAliasCollection;
|
|
|
23
20
|
}), [type]);
|
|
24
21
|
};
|
|
25
22
|
SdkAliasCollection.query = (project) => (importer) => (param) => {
|
|
26
|
-
const type = SdkAliasCollection.name(
|
|
23
|
+
const type = SdkAliasCollection.name(param);
|
|
27
24
|
if (project.config.primitive === false)
|
|
28
25
|
return type;
|
|
29
26
|
return typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
@@ -33,52 +30,57 @@ var SdkAliasCollection;
|
|
|
33
30
|
}), [type]);
|
|
34
31
|
};
|
|
35
32
|
SdkAliasCollection.input = (project) => (importer) => (param) => {
|
|
36
|
-
const type = SdkAliasCollection.name(
|
|
33
|
+
const type = SdkAliasCollection.name(param.type);
|
|
37
34
|
if (project.config.clone === true || project.config.primitive === false)
|
|
38
35
|
return type;
|
|
39
36
|
return typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
40
37
|
type: true,
|
|
41
38
|
library: "@nestia/fetcher",
|
|
42
|
-
instance: (() => { const $io0 = input => true === input.custom && "body" === input.category && "number" === typeof input.index && "string" === typeof input.name && (undefined === input.field || "string" === typeof input.field) && "boolean" === typeof input.encrypted && ("application/json" === input.contentType || "text/plain" === input.contentType || "application/x-www-form-urlencoded" === input.contentType || "multipart/form-data" === input.contentType) && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && $io1(input.examples)); const $io1 = input => Object.keys(input).every(key => {
|
|
39
|
+
instance: (() => { const $io0 = input => ("application/json" === input.contentType || "application/x-www-form-urlencoded" === input.contentType || "multipart/form-data" === input.contentType || "text/plain" === input.contentType) && "boolean" === typeof input.encrypted && "body" === input.category && "string" === typeof input.name && "number" === typeof input.index && ("object" === typeof input.type && null !== input.type && $io1(input.type)) && ("object" === typeof input.metadata && null !== input.metadata && $io2(input.metadata)) && ("object" === typeof input.components && null !== input.components && $io20(input.components)) && "function" === typeof input.validate && true && (undefined === input.examples || "object" === typeof input.examples && null !== input.examples && false === Array.isArray(input.examples) && $io26(input.examples)) && (null === input.description || "string" === typeof input.description) && (Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))); const $io1 = input => "string" === typeof input.name && (undefined === input.typeArguments || Array.isArray(input.typeArguments) && input.typeArguments.every(elem => "object" === typeof elem && null !== elem && $io1(elem))); const $io2 = input => "boolean" === typeof input.any && "boolean" === typeof input.required && "boolean" === typeof input.optional && "boolean" === typeof input.nullable && "boolean" === typeof input.functional && (Array.isArray(input.atomics) && input.atomics.every(elem => "object" === typeof elem && null !== elem && $io3(elem))) && (Array.isArray(input.constants) && input.constants.every(elem => "object" === typeof elem && null !== elem && $iu0(elem))) && (Array.isArray(input.templates) && input.templates.every(elem => "object" === typeof elem && null !== elem && $io15(elem))) && (null === input.escaped || "object" === typeof input.escaped && null !== input.escaped && $io16(input.escaped)) && (null === input.rest || "object" === typeof input.rest && null !== input.rest && $io2(input.rest)) && (Array.isArray(input.arrays) && input.arrays.every(elem => "object" === typeof elem && null !== elem && $io17(elem))) && (Array.isArray(input.tuples) && input.tuples.every(elem => "object" === typeof elem && null !== elem && $io18(elem))) && (Array.isArray(input.objects) && input.objects.every(elem => "string" === typeof elem)) && (Array.isArray(input.aliases) && input.aliases.every(elem => "string" === typeof elem)) && (Array.isArray(input.natives) && input.natives.every(elem => "string" === typeof elem)) && (Array.isArray(input.sets) && input.sets.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && (Array.isArray(input.maps) && input.maps.every(elem => "object" === typeof elem && null !== elem && $io19(elem))); const $io3 = input => ("string" === input.type || "number" === input.type || "bigint" === input.type || "boolean" === input.type) && (Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))); const $io4 = input => ("string" === input.target || "number" === input.target || "bigint" === input.target || "boolean" === input.target || "array" === input.target) && "string" === typeof input.name && "string" === typeof input.kind && (null !== input.exclusive && undefined !== input.exclusive && ("boolean" === typeof input.exclusive || Array.isArray(input.exclusive) && input.exclusive.every(elem => "string" === typeof elem))) && true && (undefined === input.validate || "string" === typeof input.validate) && (undefined === input.schema || "object" === typeof input.schema && null !== input.schema && false === Array.isArray(input.schema) && $io5(input.schema)); const $io5 = input => true; const $io6 = input => "boolean" === input.type && (Array.isArray(input.values) && input.values.every(elem => "object" === typeof elem && null !== elem && $io7(elem))); const $io7 = input => "boolean" === typeof input.value && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))) && (null === input.description || undefined === input.description || "string" === typeof input.description) && (undefined === input.jsDocTags || Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))); const $io8 = input => "string" === typeof input.name && (undefined === input.text || Array.isArray(input.text) && input.text.every(elem => "object" === typeof elem && null !== elem && $io9(elem))); const $io9 = input => "string" === typeof input.text && "string" === typeof input.kind; const $io10 = input => "number" === input.type && (Array.isArray(input.values) && input.values.every(elem => "object" === typeof elem && null !== elem && $io11(elem))); const $io11 = input => "number" === typeof input.value && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))) && (null === input.description || undefined === input.description || "string" === typeof input.description) && (undefined === input.jsDocTags || Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))); const $io12 = input => "string" === input.type && (Array.isArray(input.values) && input.values.every(elem => "object" === typeof elem && null !== elem && $io13(elem))); const $io13 = input => "string" === typeof input.value && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))) && (null === input.description || undefined === input.description || "string" === typeof input.description) && (undefined === input.jsDocTags || Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))); const $io14 = input => "bigint" === input.type && (Array.isArray(input.values) && input.values.every(elem => "object" === typeof elem && null !== elem && $io13(elem))); const $io15 = input => Array.isArray(input.row) && input.row.every(elem => "object" === typeof elem && null !== elem && $io2(elem)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))); const $io16 = input => "object" === typeof input.original && null !== input.original && $io2(input.original) && ("object" === typeof input.returns && null !== input.returns && $io2(input.returns)); const $io17 = input => "string" === typeof input.name && (Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))); const $io18 = input => "string" === typeof input.name && (Array.isArray(input.tags) && input.tags.every(elem => Array.isArray(elem) && elem.every(elem => "object" === typeof elem && null !== elem && $io4(elem)))); const $io19 = input => "object" === typeof input.key && null !== input.key && $io2(input.key) && ("object" === typeof input.value && null !== input.value && $io2(input.value)); const $io20 = input => Array.isArray(input.objects) && input.objects.every(elem => "object" === typeof elem && null !== elem && $io21(elem)) && (Array.isArray(input.aliases) && input.aliases.every(elem => "object" === typeof elem && null !== elem && $io23(elem))) && (Array.isArray(input.arrays) && input.arrays.every(elem => "object" === typeof elem && null !== elem && $io24(elem))) && (Array.isArray(input.tuples) && input.tuples.every(elem => "object" === typeof elem && null !== elem && $io25(elem))); const $io21 = input => "string" === typeof input.name && (Array.isArray(input.properties) && input.properties.every(elem => "object" === typeof elem && null !== elem && $io22(elem))) && (undefined === input.description || "string" === typeof input.description) && (Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))) && "number" === typeof input.index && "boolean" === typeof input.recursive && (Array.isArray(input.nullables) && input.nullables.every(elem => "boolean" === typeof elem)); const $io22 = input => "object" === typeof input.key && null !== input.key && $io2(input.key) && ("object" === typeof input.value && null !== input.value && $io2(input.value)) && (null === input.description || "string" === typeof input.description) && (Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))); const $io23 = input => "string" === typeof input.name && ("object" === typeof input.value && null !== input.value && $io2(input.value)) && (Array.isArray(input.nullables) && input.nullables.every(elem => "boolean" === typeof elem)) && (null === input.description || "string" === typeof input.description) && (Array.isArray(input.jsDocTags) && input.jsDocTags.every(elem => "object" === typeof elem && null !== elem && $io8(elem))) && "boolean" === typeof input.recursive; const $io24 = input => "string" === typeof input.name && ("object" === typeof input.value && null !== input.value && $io2(input.value)) && (Array.isArray(input.nullables) && input.nullables.every(elem => "boolean" === typeof elem)) && "boolean" === typeof input.recursive && (null === input.index || "number" === typeof input.index); const $io25 = input => "string" === typeof input.name && (Array.isArray(input.elements) && input.elements.every(elem => "object" === typeof elem && null !== elem && $io2(elem))) && (null === input.index || "number" === typeof input.index) && "boolean" === typeof input.recursive && (Array.isArray(input.nullables) && input.nullables.every(elem => "boolean" === typeof elem)); const $io26 = input => Object.keys(input).every(key => {
|
|
43
40
|
const value = input[key];
|
|
44
41
|
if (undefined === value)
|
|
45
42
|
return true;
|
|
46
43
|
return true;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
}); const $iu0 = input => (() => {
|
|
45
|
+
if ("bigint" === input.type)
|
|
46
|
+
return $io14(input);
|
|
47
|
+
else if ("string" === input.type)
|
|
48
|
+
return $io12(input);
|
|
49
|
+
else if ("number" === input.type)
|
|
50
|
+
return $io10(input);
|
|
51
|
+
else if ("boolean" === input.type)
|
|
52
|
+
return $io6(input);
|
|
53
|
+
else
|
|
54
|
+
return false;
|
|
55
|
+
})(); return input => "object" === typeof input && null !== input && $io0(input); })()(param) &&
|
|
56
|
+
(param.contentType === "application/json" ||
|
|
57
|
+
param.encrypted === true)
|
|
58
|
+
? "Primitive"
|
|
59
|
+
: "Resolved",
|
|
51
60
|
}), [type]);
|
|
52
61
|
};
|
|
53
62
|
SdkAliasCollection.output = (project) => (importer) => (route) => {
|
|
54
63
|
var _a;
|
|
55
64
|
if (project.config.propagate !== true) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const filter = (flag) => (type.getFlags() & flag) !== 0;
|
|
59
|
-
if (project.config.clone === true ||
|
|
60
|
-
project.config.primitive === false ||
|
|
61
|
-
filter(typescript_1.default.TypeFlags.Undefined) ||
|
|
62
|
-
filter(typescript_1.default.TypeFlags.Never) ||
|
|
63
|
-
filter(typescript_1.default.TypeFlags.Void) ||
|
|
64
|
-
filter(typescript_1.default.TypeFlags.VoidLike))
|
|
65
|
-
return node;
|
|
65
|
+
if (project.config.clone === true || project.config.primitive === false)
|
|
66
|
+
return SdkAliasCollection.name(route.success.type);
|
|
66
67
|
return typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
67
68
|
type: true,
|
|
68
69
|
library: "@nestia/fetcher",
|
|
69
|
-
instance: route.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
instance: route.success.contentType === "application/json" ||
|
|
71
|
+
route.success.encrypted === true
|
|
72
|
+
? "Primitive"
|
|
73
|
+
: "Resolved",
|
|
74
|
+
}), [SdkAliasCollection.name(route.success.type)]);
|
|
73
75
|
}
|
|
74
76
|
const branches = [
|
|
75
77
|
{
|
|
76
|
-
status: String((_a = route.status) !== null && _a !== void 0 ? _a : (route.method === "POST" ? 201 : 200)),
|
|
77
|
-
type: SdkAliasCollection.name(
|
|
78
|
+
status: String((_a = route.success.status) !== null && _a !== void 0 ? _a : (route.method === "POST" ? 201 : 200)),
|
|
79
|
+
type: SdkAliasCollection.name(route.success.type),
|
|
78
80
|
},
|
|
79
81
|
...Object.entries(route.exceptions).map(([status, value]) => ({
|
|
80
82
|
status,
|
|
81
|
-
type: SdkAliasCollection.name(
|
|
83
|
+
type: SdkAliasCollection.name(value.type),
|
|
82
84
|
})),
|
|
83
85
|
];
|
|
84
86
|
return typescript_1.default.factory.createTypeReferenceNode(importer.external({
|
|
@@ -87,9 +89,9 @@ var SdkAliasCollection;
|
|
|
87
89
|
instance: "IPropagation",
|
|
88
90
|
}), [
|
|
89
91
|
typescript_1.default.factory.createTypeLiteralNode(branches.map((b) => typescript_1.default.factory.createPropertySignature(undefined, typescript_1.default.factory.createNumericLiteral(b.status), undefined, b.type))),
|
|
90
|
-
...(route.status
|
|
92
|
+
...(route.success.status
|
|
91
93
|
? [
|
|
92
|
-
typescript_1.default.factory.createLiteralTypeNode(typescript_1.default.factory.createNumericLiteral(route.status)),
|
|
94
|
+
typescript_1.default.factory.createLiteralTypeNode(typescript_1.default.factory.createNumericLiteral(route.success.status)),
|
|
93
95
|
]
|
|
94
96
|
: []),
|
|
95
97
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkAliasCollection.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkAliasCollection.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,kDAA0B;
|
|
1
|
+
{"version":3,"file":"SdkAliasCollection.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkAliasCollection.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA4B;AAC5B,kDAA0B;AAS1B,IAAiB,kBAAkB,CAqIlC;AArID,WAAiB,kBAAkB;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,oBAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CACtD;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR,CACF,CAAC;IACJ,CAAC,CAAC;IAES,+BAAY,GACvB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CAAC,QAA0B,EAAE,EAAE,CAC/B,CAAC,KAAsB,EAAe,EAAE,CACtC,mBAAA,MAAM,iCACD,OAAO,KACV,MAAM,kCACD,OAAO,CAAC,MAAM,KACjB,SAAS,EAAE,KAAK,OAElB,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC,EArIgB,kBAAkB,kCAAlB,kBAAkB,QAqIlC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { INestiaConfig } from "../../INestiaConfig";
|
|
2
2
|
export declare namespace SdkDistributionComposer {
|
|
3
|
-
const compose: (
|
|
3
|
+
const compose: (props: {
|
|
4
|
+
config: INestiaConfig;
|
|
5
|
+
websocket: boolean;
|
|
6
|
+
}) => Promise<void>;
|
|
4
7
|
}
|
|
@@ -19,12 +19,12 @@ const path_1 = __importDefault(require("path"));
|
|
|
19
19
|
const typia_1 = __importDefault(require("typia"));
|
|
20
20
|
var SdkDistributionComposer;
|
|
21
21
|
(function (SdkDistributionComposer) {
|
|
22
|
-
SdkDistributionComposer.compose = (
|
|
23
|
-
if (!fs_1.default.existsSync(config.distribute))
|
|
24
|
-
yield fs_1.default.promises.mkdir(config.distribute);
|
|
22
|
+
SdkDistributionComposer.compose = (props) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
if (!fs_1.default.existsSync(props.config.distribute))
|
|
24
|
+
yield fs_1.default.promises.mkdir(props.config.distribute);
|
|
25
25
|
const root = process.cwd();
|
|
26
|
-
const output = path_1.default.resolve(config.output);
|
|
27
|
-
process.chdir(config.distribute);
|
|
26
|
+
const output = path_1.default.resolve(props.config.output);
|
|
27
|
+
process.chdir(props.config.distribute);
|
|
28
28
|
const exit = () => process.chdir(root);
|
|
29
29
|
if (yield configured())
|
|
30
30
|
return exit();
|
|
@@ -40,7 +40,7 @@ var SdkDistributionComposer;
|
|
|
40
40
|
execute("npm install --save-dev rimraf");
|
|
41
41
|
execute(`npm install --save @nestia/fetcher@${v.version}`);
|
|
42
42
|
execute(`npm install --save typia@${v.typia}`);
|
|
43
|
-
if (websocket)
|
|
43
|
+
if (props.websocket)
|
|
44
44
|
execute(`npm install --save tgrid@${v.tgrid}`);
|
|
45
45
|
execute("npx typia setup --manager npm");
|
|
46
46
|
exit();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkDistributionComposer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkDistributionComposer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AACxB,kDAA0B;AAI1B,IAAiB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"SdkDistributionComposer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkDistributionComposer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kEAA+B;AAC/B,4CAAoB;AACpB,gDAAwB;AACxB,kDAA0B;AAI1B,IAAiB,uBAAuB,CAwFvC;AAxFD,WAAiB,uBAAuB;IACzB,+BAAO,GAAG,CAAO,KAG7B,EAAE,EAAE;QACH,IAAI,CAAC,YAAE,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,UAAW,CAAC;YAC1C,MAAM,YAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UAAW,CAAC,CAAC;QAEpD,MAAM,IAAI,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,MAAM,GAAW,cAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAO,CAAC,CAAC;QAC1D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,UA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AC,WAAW,CAAC;aAClB,IAAI,CAAC,MAAM,CAAC;aACZ,KAAK,CAAC,YAAY,CAAC;aACnB,IAAI,CAAC,OAAO,CAAC,EAChB,MAAM,CACP,CAAC;IACJ,CAAC,CAAA,CAAC;IAEJ,MAAM,YAAY,GAAG,GAAiC,EAAE;QACtD,MAAM,OAAO,GAAW,MAAM,YAAE,CAAC,QAAQ,CAAC,QAAQ,CAChD,SAAS,GAAG,wBAAwB,EACpC,MAAM,CACP,CAAC;QACF,MAAM,IAAI,GAIN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxB,+BAAO,eAAK,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;8DACd,IAAI,CAAC,eAAe,GACpB,IAAI,CAAC,YAAY,KACpB,OAAO,EAAE,IAAI,CAAC,OAAO,KACpB;IACL,CAAC,CAAA,CAAC;AACJ,CAAC,EAxFgB,uBAAuB,uCAAvB,uBAAuB,QAwFvC;AAOD,MAAM,MAAM,GAAG,SAAS,GAAG,oCAAoC,CAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
3
|
-
import { ITypedWebSocketRoute } from "../../structures/ITypedWebSocketRoute";
|
|
1
|
+
import { ITypedApplication } from "../../structures/ITypedApplication";
|
|
4
2
|
export declare namespace SdkFileProgrammer {
|
|
5
|
-
const generate: (
|
|
3
|
+
const generate: (app: ITypedApplication) => Promise<void>;
|
|
6
4
|
}
|
|
@@ -26,13 +26,13 @@ var SdkFileProgrammer;
|
|
|
26
26
|
/* ---------------------------------------------------------
|
|
27
27
|
CONSTRUCTOR
|
|
28
28
|
--------------------------------------------------------- */
|
|
29
|
-
SdkFileProgrammer.generate = (
|
|
29
|
+
SdkFileProgrammer.generate = (app) => __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
// CONSTRUCT FOLDER TREE
|
|
31
31
|
const root = new SdkRouteDirectory_1.SdkRouteDirectory(null, "functional");
|
|
32
|
-
for (const route of
|
|
32
|
+
for (const route of app.routes)
|
|
33
33
|
emplace(root)(route);
|
|
34
34
|
// ITERATE FILES
|
|
35
|
-
yield iterate(project)(root)(project.config.output
|
|
35
|
+
yield iterate(app.project)(root)(`${app.project.config.output}/functional`);
|
|
36
36
|
});
|
|
37
37
|
const emplace = (directory) => (route) => {
|
|
38
38
|
// OPEN DIRECTORIES
|
|
@@ -64,15 +64,15 @@ var SdkFileProgrammer;
|
|
|
64
64
|
directory.routes.forEach((route, i) => {
|
|
65
65
|
if (project.config.clone !== true || route.protocol === "websocket")
|
|
66
66
|
for (const tuple of route.imports)
|
|
67
|
-
for (const instance of tuple
|
|
67
|
+
for (const instance of tuple.instances)
|
|
68
68
|
importer.internal({
|
|
69
|
-
file: tuple
|
|
69
|
+
file: tuple.file,
|
|
70
70
|
instance,
|
|
71
71
|
type: true,
|
|
72
72
|
});
|
|
73
73
|
statements.push(...(route.protocol === "http"
|
|
74
74
|
? SdkHttpRouteProgrammer_1.SdkHttpRouteProgrammer.write(project)(importer)(route)
|
|
75
|
-
: SdkWebSocketRouteProgrammer_1.SdkWebSocketRouteProgrammer.write(
|
|
75
|
+
: SdkWebSocketRouteProgrammer_1.SdkWebSocketRouteProgrammer.write(importer)(route)));
|
|
76
76
|
if (i !== directory.routes.length - 1)
|
|
77
77
|
statements.push(FilePrinter_1.FilePrinter.enter());
|
|
78
78
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,4DAA4B;
|
|
1
|
+
{"version":3,"file":"SdkFileProgrammer.js","sourceRoot":"","sources":["../../../src/generates/internal/SdkFileProgrammer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,4DAA4B;AAM5B,iDAA8C;AAC9C,+C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IAAI,CACb,GAAG,CAAC,KAAK,CAAC,QAAQ,KAAK,MAAM;gBAC3B,CAAC,CAAC,+CAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;gBACxD,CAAC,CAAC,yDAA2B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CACxD,CAAC;YACF,IAAI,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBACnC,UAAU,CAAC,IAAI,CAAC,yBAAW,CAAC,KAAK,EAAE,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,uBAAuB;QACvB,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC;YAC/B,UAAU,CAAC,IAAI,CACb,GAAG,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,EAChC,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,UAAU,CAAC,MAAM;gBACxC,CAAC,CAAC,CAAC,yBAAW,CAAC,KAAK,EAAE,CAAC;gBACvB,CAAC,CAAC,EAAE,CAAC,EACP,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAC3C,CAAC;QACJ,MAAM,yBAAW,CAAC,KAAK,CAAC;YACtB,QAAQ,EAAE,QAAQ,CAAC,IAAI;YACvB,UAAU;YACV,GAAG,EACD,OAAO;gBACP,4BAA4B;gBAC5B,cAAc,SAAS,CAAC,MAAM,IAAI;gBAClC,uEAAuE;gBACvE,OAAO;gBACP,sEAAsE;SACzE,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACN,CAAC,EArGgB,iBAAiB,iCAAjB,iBAAiB,QAqGjC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { INestiaProject } from "../../structures/INestiaProject";
|
|
3
|
-
import { ITypedHttpRoute } from "../../structures/ITypedHttpRoute";
|
|
4
|
-
import { ImportDictionary } from "./ImportDictionary";
|
|
5
|
-
export declare namespace SdkHttpCloneProgrammer {
|
|
6
|
-
interface IModule {
|
|
7
|
-
name: string;
|
|
8
|
-
children: Map<string, IModule>;
|
|
9
|
-
programmer: null | ((importer: ImportDictionary) => ts.TypeAliasDeclaration);
|
|
10
|
-
}
|
|
11
|
-
const write: (project: INestiaProject) => (routes: ITypedHttpRoute[]) => Map<string, IModule>;
|
|
12
|
-
}
|