@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
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { CommentFactory } from "typia/lib/factories/CommentFactory";
|
|
3
|
+
import { MetadataCollection } from "typia/lib/factories/MetadataCollection";
|
|
4
|
+
import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
|
|
5
|
+
import { TypeFactory } from "typia/lib/factories/TypeFactory";
|
|
6
|
+
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
7
|
+
import { MetadataObject } from "typia/lib/schemas/metadata/MetadataObject";
|
|
8
|
+
import { ValidationPipe } from "typia/lib/typings/ValidationPipe";
|
|
9
|
+
import { Escaper } from "typia/lib/utils/Escaper";
|
|
10
|
+
|
|
11
|
+
import { ImportAnalyzer } from "../analyses/ImportAnalyzer";
|
|
12
|
+
import { IOperationMetadata } from "./IOperationMetadata";
|
|
13
|
+
import { ISdkTransformerContext } from "./ISdkTransformerContext";
|
|
14
|
+
|
|
15
|
+
export namespace SdkMetadataProgrammer {
|
|
16
|
+
export interface IProps {
|
|
17
|
+
context: ISdkTransformerContext;
|
|
18
|
+
generics: WeakMap<ts.Type, ts.Type>;
|
|
19
|
+
node: ts.MethodDeclaration;
|
|
20
|
+
}
|
|
21
|
+
export const write = (p: IProps): IOperationMetadata => {
|
|
22
|
+
const symbol: ts.Symbol | undefined = p.context.checker.getSymbolAtLocation(
|
|
23
|
+
p.node,
|
|
24
|
+
);
|
|
25
|
+
const signature: ts.Signature | undefined =
|
|
26
|
+
p.context.checker.getSignatureFromDeclaration(p.node);
|
|
27
|
+
return {
|
|
28
|
+
parameters: p.node.parameters.map((parameter, index) =>
|
|
29
|
+
writeParameter({
|
|
30
|
+
context: p.context,
|
|
31
|
+
generics: p.generics,
|
|
32
|
+
parameter,
|
|
33
|
+
index,
|
|
34
|
+
}),
|
|
35
|
+
),
|
|
36
|
+
success: writeResponse({
|
|
37
|
+
context: p.context,
|
|
38
|
+
generics: p.generics,
|
|
39
|
+
type: getReturnType({
|
|
40
|
+
checker: p.context.checker,
|
|
41
|
+
signature,
|
|
42
|
+
}),
|
|
43
|
+
}),
|
|
44
|
+
exceptions: {}, // @todo
|
|
45
|
+
description: (symbol && CommentFactory.description(symbol)) ?? null,
|
|
46
|
+
jsDocTags: signature?.getJsDocTags() ?? [],
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const writeParameter = (props: {
|
|
51
|
+
context: ISdkTransformerContext;
|
|
52
|
+
generics: WeakMap<ts.Type, ts.Type>;
|
|
53
|
+
parameter: ts.ParameterDeclaration;
|
|
54
|
+
index: number;
|
|
55
|
+
}): IOperationMetadata.IParameter => {
|
|
56
|
+
const symbol: ts.Symbol | undefined =
|
|
57
|
+
props.context.checker.getSymbolAtLocation(props.parameter);
|
|
58
|
+
return {
|
|
59
|
+
...writeType({
|
|
60
|
+
...props,
|
|
61
|
+
type:
|
|
62
|
+
props.context.checker.getTypeFromTypeNode(
|
|
63
|
+
props.parameter.type ?? TypeFactory.keyword("any"),
|
|
64
|
+
) ?? null,
|
|
65
|
+
required: props.parameter.questionToken === undefined,
|
|
66
|
+
}),
|
|
67
|
+
name: props.parameter.name.getText(),
|
|
68
|
+
index: props.index,
|
|
69
|
+
description: (symbol && CommentFactory.description(symbol)) ?? null,
|
|
70
|
+
jsDocTags: symbol?.getJsDocTags() ?? [],
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const writeResponse = (props: {
|
|
75
|
+
context: ISdkTransformerContext;
|
|
76
|
+
generics: WeakMap<ts.Type, ts.Type>;
|
|
77
|
+
type: ts.Type | null;
|
|
78
|
+
}): IOperationMetadata.IResponse =>
|
|
79
|
+
writeType({
|
|
80
|
+
...props,
|
|
81
|
+
required: true,
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
const writeType = (p: {
|
|
85
|
+
context: ISdkTransformerContext;
|
|
86
|
+
generics: WeakMap<ts.Type, ts.Type>;
|
|
87
|
+
type: ts.Type | null;
|
|
88
|
+
required: boolean;
|
|
89
|
+
}): IOperationMetadata.IResponse => {
|
|
90
|
+
const analyzed: ImportAnalyzer.IOutput = p.type
|
|
91
|
+
? ImportAnalyzer.analyze(p.context.checker, p.generics, p.type)
|
|
92
|
+
: {
|
|
93
|
+
type: { name: "any" },
|
|
94
|
+
imports: [],
|
|
95
|
+
};
|
|
96
|
+
const [primitive, resolved] = [true, false].map((escape) =>
|
|
97
|
+
MetadataFactory.analyze(
|
|
98
|
+
p.context.checker,
|
|
99
|
+
p.context.api,
|
|
100
|
+
)({
|
|
101
|
+
escape,
|
|
102
|
+
constant: true,
|
|
103
|
+
absorb: true,
|
|
104
|
+
})(p.context.collection)(p.type),
|
|
105
|
+
);
|
|
106
|
+
return {
|
|
107
|
+
...analyzed,
|
|
108
|
+
primitive: writeSchema({
|
|
109
|
+
collection: p.context.collection,
|
|
110
|
+
result: primitive,
|
|
111
|
+
}),
|
|
112
|
+
resolved: writeSchema({
|
|
113
|
+
collection: p.context.collection,
|
|
114
|
+
result: resolved,
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const writeSchema = (p: {
|
|
120
|
+
collection: MetadataCollection;
|
|
121
|
+
result: ValidationPipe<Metadata, MetadataFactory.IError>;
|
|
122
|
+
}): ValidationPipe<IOperationMetadata.ISchema, IOperationMetadata.IError> => {
|
|
123
|
+
if (p.result.success === false)
|
|
124
|
+
return {
|
|
125
|
+
success: false,
|
|
126
|
+
errors: p.result.errors.map((e) => ({
|
|
127
|
+
name: e.name,
|
|
128
|
+
accessor:
|
|
129
|
+
e.explore.object !== null
|
|
130
|
+
? join({
|
|
131
|
+
object: e.explore.object,
|
|
132
|
+
key: e.explore.property,
|
|
133
|
+
})
|
|
134
|
+
: null,
|
|
135
|
+
messages: e.messages,
|
|
136
|
+
})),
|
|
137
|
+
};
|
|
138
|
+
const visited: Set<string> = iterateVisited(p.result.data);
|
|
139
|
+
return {
|
|
140
|
+
success: true,
|
|
141
|
+
data: {
|
|
142
|
+
components: {
|
|
143
|
+
objects: p.collection
|
|
144
|
+
.objects()
|
|
145
|
+
.filter((o) => visited.has(o.name))
|
|
146
|
+
.map((o) => o.toJSON()),
|
|
147
|
+
aliases: p.collection
|
|
148
|
+
.aliases()
|
|
149
|
+
.filter((a) => visited.has(a.name))
|
|
150
|
+
.map((a) => a.toJSON()),
|
|
151
|
+
arrays: p.collection
|
|
152
|
+
.arrays()
|
|
153
|
+
.filter((a) => visited.has(a.name))
|
|
154
|
+
.map((a) => a.toJSON()),
|
|
155
|
+
tuples: p.collection
|
|
156
|
+
.tuples()
|
|
157
|
+
.filter((t) => visited.has(t.name))
|
|
158
|
+
.map((t) => t.toJSON()),
|
|
159
|
+
},
|
|
160
|
+
metadata: p.result.data.toJSON(),
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const getReturnType = (p: {
|
|
166
|
+
checker: ts.TypeChecker;
|
|
167
|
+
signature: ts.Signature | undefined;
|
|
168
|
+
}): ts.Type | null => {
|
|
169
|
+
const type: ts.Type | null = p.signature?.getReturnType() ?? null;
|
|
170
|
+
if (type === null) return null;
|
|
171
|
+
else if (type.symbol?.name === "Promise") {
|
|
172
|
+
const generic: readonly ts.Type[] = p.checker.getTypeArguments(
|
|
173
|
+
type as ts.TypeReference,
|
|
174
|
+
);
|
|
175
|
+
return generic[0] ?? null;
|
|
176
|
+
}
|
|
177
|
+
return type;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const iterateVisited = (metdata: Metadata): Set<string> => {
|
|
182
|
+
const names: Set<string> = new Set();
|
|
183
|
+
const visited: WeakSet<Metadata> = new WeakSet();
|
|
184
|
+
const iterate = (metadata: Metadata): void => {
|
|
185
|
+
if (visited.has(metadata)) return;
|
|
186
|
+
visited.add(metadata);
|
|
187
|
+
for (const alias of metadata.aliases) {
|
|
188
|
+
names.add(alias.name);
|
|
189
|
+
iterate(alias.value);
|
|
190
|
+
}
|
|
191
|
+
for (const array of metadata.arrays) {
|
|
192
|
+
names.add(array.type.name);
|
|
193
|
+
iterate(array.type.value);
|
|
194
|
+
}
|
|
195
|
+
for (const tuple of metadata.tuples) {
|
|
196
|
+
names.add(tuple.type.name);
|
|
197
|
+
tuple.type.elements.map(iterate);
|
|
198
|
+
}
|
|
199
|
+
for (const object of metadata.objects) {
|
|
200
|
+
names.add(object.name);
|
|
201
|
+
object.properties.map((p) => {
|
|
202
|
+
iterate(p.key);
|
|
203
|
+
iterate(p.value);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (metadata.escaped) {
|
|
207
|
+
iterate(metadata.escaped.original);
|
|
208
|
+
iterate(metadata.escaped.returns);
|
|
209
|
+
}
|
|
210
|
+
if (metadata.rest) iterate(metadata.rest);
|
|
211
|
+
};
|
|
212
|
+
iterate(metdata);
|
|
213
|
+
return names;
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
const join = ({
|
|
217
|
+
object,
|
|
218
|
+
key,
|
|
219
|
+
}: {
|
|
220
|
+
object: MetadataObject;
|
|
221
|
+
key: string | object | null;
|
|
222
|
+
}) => {
|
|
223
|
+
if (key === null) return object.name;
|
|
224
|
+
else if (typeof key === "object") return `${object.name}[key]`;
|
|
225
|
+
else if (Escaper.variable(key)) return `${object.name}.${key}`;
|
|
226
|
+
return `${object.name}[${JSON.stringify(key)}]`;
|
|
227
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { HashSet, hash } from "tstl";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
import { LiteralFactory } from "typia/lib/factories/LiteralFactory";
|
|
4
|
+
import { MetadataCollection } from "typia/lib/factories/MetadataCollection";
|
|
5
|
+
import { TypeFactory } from "typia/lib/factories/TypeFactory";
|
|
6
|
+
|
|
7
|
+
import { GenericAnalyzer } from "../analyses/GenericAnalyzer";
|
|
8
|
+
import { IOperationMetadata } from "./IOperationMetadata";
|
|
9
|
+
import { ISdkTransformerContext } from "./ISdkTransformerContext";
|
|
10
|
+
import { SdkMetadataProgrammer } from "./SdkMetadataProgrammer";
|
|
11
|
+
|
|
12
|
+
export namespace SdkTransformer {
|
|
13
|
+
export const transformFile =
|
|
14
|
+
(checker: ts.TypeChecker) => (api: ts.TransformationContext) => {
|
|
15
|
+
const context: ISdkTransformerContext = {
|
|
16
|
+
checker,
|
|
17
|
+
api,
|
|
18
|
+
collection: new MetadataCollection({
|
|
19
|
+
replace: MetadataCollection.replace,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
return (file: ts.SourceFile): ts.SourceFile => {
|
|
23
|
+
if (file.isDeclarationFile === true) return file;
|
|
24
|
+
const visitor: IVisitor = {
|
|
25
|
+
done: false,
|
|
26
|
+
visited: new HashSet(),
|
|
27
|
+
};
|
|
28
|
+
file = ts.visitEachChild(
|
|
29
|
+
file,
|
|
30
|
+
(node) =>
|
|
31
|
+
transformNode({
|
|
32
|
+
context,
|
|
33
|
+
visitor,
|
|
34
|
+
node,
|
|
35
|
+
}),
|
|
36
|
+
api,
|
|
37
|
+
);
|
|
38
|
+
if (visitor.done === false) return file;
|
|
39
|
+
return ts.factory.updateSourceFile(file, [
|
|
40
|
+
ts.factory.createImportDeclaration(
|
|
41
|
+
undefined,
|
|
42
|
+
ts.factory.createImportClause(
|
|
43
|
+
false,
|
|
44
|
+
undefined,
|
|
45
|
+
ts.factory.createNamespaceImport(
|
|
46
|
+
ts.factory.createIdentifier("__OperationMetadata"),
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
ts.factory.createStringLiteral(
|
|
50
|
+
"@nestia/sdk/lib/decorators/OperationMetadata",
|
|
51
|
+
),
|
|
52
|
+
undefined,
|
|
53
|
+
),
|
|
54
|
+
...file.statements,
|
|
55
|
+
]);
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
interface IVisitor {
|
|
60
|
+
done: boolean;
|
|
61
|
+
visited: HashSet<MethodKey>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const transformNode = (props: {
|
|
65
|
+
context: ISdkTransformerContext;
|
|
66
|
+
visitor: IVisitor;
|
|
67
|
+
node: ts.Node;
|
|
68
|
+
}): ts.Node =>
|
|
69
|
+
ts.isClassDeclaration(props.node)
|
|
70
|
+
? transformClass({
|
|
71
|
+
...props,
|
|
72
|
+
node: props.node,
|
|
73
|
+
})
|
|
74
|
+
: props.node;
|
|
75
|
+
|
|
76
|
+
const transformClass = (props: {
|
|
77
|
+
context: ISdkTransformerContext;
|
|
78
|
+
visitor: IVisitor;
|
|
79
|
+
node: ts.ClassDeclaration;
|
|
80
|
+
}): ts.ClassDeclaration => {
|
|
81
|
+
const generics: WeakMap<ts.Type, ts.Type> = GenericAnalyzer.analyze(
|
|
82
|
+
props.context.checker,
|
|
83
|
+
props.node,
|
|
84
|
+
);
|
|
85
|
+
return ts.factory.updateClassDeclaration(
|
|
86
|
+
props.node,
|
|
87
|
+
props.node.modifiers,
|
|
88
|
+
props.node.name,
|
|
89
|
+
props.node.typeParameters,
|
|
90
|
+
props.node.heritageClauses,
|
|
91
|
+
props.node.members.map((m) =>
|
|
92
|
+
ts.isMethodDeclaration(m)
|
|
93
|
+
? transformMethod({
|
|
94
|
+
...props,
|
|
95
|
+
generics,
|
|
96
|
+
class: props.node,
|
|
97
|
+
node: m,
|
|
98
|
+
})
|
|
99
|
+
: m,
|
|
100
|
+
),
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const transformMethod = (props: {
|
|
105
|
+
context: ISdkTransformerContext;
|
|
106
|
+
visitor: IVisitor;
|
|
107
|
+
class: ts.ClassDeclaration;
|
|
108
|
+
generics: WeakMap<ts.Type, ts.Type>;
|
|
109
|
+
node: ts.MethodDeclaration;
|
|
110
|
+
}): ts.MethodDeclaration => {
|
|
111
|
+
const decorators: readonly ts.Decorator[] | undefined = ts.getDecorators
|
|
112
|
+
? ts.getDecorators(props.node)
|
|
113
|
+
: (props.node as any).decorators;
|
|
114
|
+
if (!decorators?.length) return props.node;
|
|
115
|
+
|
|
116
|
+
const key: MethodKey = new MethodKey(
|
|
117
|
+
props.class.name?.getText() ?? "",
|
|
118
|
+
props.node.name.getText(),
|
|
119
|
+
);
|
|
120
|
+
props.visitor.done ||= true;
|
|
121
|
+
if (props.visitor.visited.has(key)) return props.node;
|
|
122
|
+
else props.visitor.visited.insert(key);
|
|
123
|
+
|
|
124
|
+
const metadata: IOperationMetadata = SdkMetadataProgrammer.write(props);
|
|
125
|
+
return ts.factory.updateMethodDeclaration(
|
|
126
|
+
props.node,
|
|
127
|
+
[
|
|
128
|
+
...(props.node.modifiers ?? []),
|
|
129
|
+
ts.factory.createDecorator(
|
|
130
|
+
ts.factory.createCallExpression(
|
|
131
|
+
ts.factory.createIdentifier(
|
|
132
|
+
"__OperationMetadata.OperationMetadata",
|
|
133
|
+
),
|
|
134
|
+
undefined,
|
|
135
|
+
[
|
|
136
|
+
ts.factory.createAsExpression(
|
|
137
|
+
LiteralFactory.generate(metadata),
|
|
138
|
+
TypeFactory.keyword("any"),
|
|
139
|
+
),
|
|
140
|
+
],
|
|
141
|
+
),
|
|
142
|
+
),
|
|
143
|
+
],
|
|
144
|
+
props.node.asteriskToken,
|
|
145
|
+
props.node.name,
|
|
146
|
+
props.node.questionToken,
|
|
147
|
+
props.node.typeParameters,
|
|
148
|
+
props.node.parameters,
|
|
149
|
+
props.node.type,
|
|
150
|
+
props.node.body,
|
|
151
|
+
);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
class MethodKey {
|
|
156
|
+
public constructor(
|
|
157
|
+
public readonly className: string,
|
|
158
|
+
public readonly methodName: string,
|
|
159
|
+
) {}
|
|
160
|
+
|
|
161
|
+
public equals(o: MethodKey): boolean {
|
|
162
|
+
return this.className === o.className && this.methodName === o.methodName;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
public hashCode(): number {
|
|
166
|
+
return hash(this.className, this.methodName);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
2
|
+
|
|
3
|
+
export namespace TextPlainValidator {
|
|
4
|
+
export const validate = (metadata: Metadata): string[] => {
|
|
5
|
+
const expected: number =
|
|
6
|
+
metadata.atomics.filter((a) => a.type === "string").length +
|
|
7
|
+
metadata.constants
|
|
8
|
+
.filter((c) => c.type === "string")
|
|
9
|
+
.map((c) => c.values.length)
|
|
10
|
+
.reduce((a, b) => a + b, 0) +
|
|
11
|
+
metadata.templates.length +
|
|
12
|
+
metadata.natives.filter((n) => n === "String").length;
|
|
13
|
+
if (metadata.size() === 0 || metadata.size() !== expected)
|
|
14
|
+
return [`Only string type is allowed in the "text/plain" content type.`];
|
|
15
|
+
return [];
|
|
16
|
+
};
|
|
17
|
+
}
|
package/src/utils/StringUtil.ts
CHANGED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { INestiaProject } from "../structures/INestiaProject";
|
|
3
|
-
import { IReflectController } from "../structures/IReflectController";
|
|
4
|
-
import { ITypedHttpRoute } from "../structures/ITypedHttpRoute";
|
|
5
|
-
import { ITypedWebSocketRoute } from "../structures/ITypedWebSocketRoute";
|
|
6
|
-
export declare namespace TypedControllerAnalyzer {
|
|
7
|
-
const analyze: (project: INestiaProject) => (sourceFile: ts.SourceFile, controller: IReflectController) => Promise<Array<ITypedHttpRoute | ITypedWebSocketRoute>>;
|
|
8
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TypedControllerAnalyzer = void 0;
|
|
16
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
17
|
-
const GenericAnalyzer_1 = require("./GenericAnalyzer");
|
|
18
|
-
const TypedHttpOperationAnalyzer_1 = require("./TypedHttpOperationAnalyzer");
|
|
19
|
-
const TypedWebSocketOperationAnalyzer_1 = require("./TypedWebSocketOperationAnalyzer");
|
|
20
|
-
var TypedControllerAnalyzer;
|
|
21
|
-
(function (TypedControllerAnalyzer) {
|
|
22
|
-
TypedControllerAnalyzer.analyze = (project) => (sourceFile, controller) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
// FIND CONTROLLER CLASS
|
|
24
|
-
const ret = [];
|
|
25
|
-
typescript_1.default.forEachChild(sourceFile, (node) => {
|
|
26
|
-
var _a;
|
|
27
|
-
if (typescript_1.default.isClassDeclaration(node) &&
|
|
28
|
-
((_a = node.name) === null || _a === void 0 ? void 0 : _a.escapedText) === controller.name) {
|
|
29
|
-
// ANALYZE THE CONTROLLER
|
|
30
|
-
ret.push(..._Analyze_controller(project)(controller, node));
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return ret;
|
|
35
|
-
});
|
|
36
|
-
/* ---------------------------------------------------------
|
|
37
|
-
CLASS
|
|
38
|
-
--------------------------------------------------------- */
|
|
39
|
-
const _Analyze_controller = (project) => (controller, classNode) => {
|
|
40
|
-
const classType = project.checker.getTypeAtLocation(classNode);
|
|
41
|
-
const generics = GenericAnalyzer_1.GenericAnalyzer.analyze(project.checker, classNode);
|
|
42
|
-
const ret = [];
|
|
43
|
-
for (const symbol of classType.getProperties()) {
|
|
44
|
-
// GET METHOD DECLARATION
|
|
45
|
-
const declaration = (symbol.declarations ||
|
|
46
|
-
[])[0];
|
|
47
|
-
if (!declaration || !typescript_1.default.isMethodDeclaration(declaration))
|
|
48
|
-
continue;
|
|
49
|
-
// IDENTIFIER MUST BE
|
|
50
|
-
const identifier = declaration.name;
|
|
51
|
-
if (!typescript_1.default.isIdentifier(identifier))
|
|
52
|
-
continue;
|
|
53
|
-
// ANALYZED WITH THE REFLECTED-FUNCTION
|
|
54
|
-
const operation = controller.operations.find((f) => f.name === identifier.escapedText);
|
|
55
|
-
if (operation === undefined)
|
|
56
|
-
continue;
|
|
57
|
-
const routes = operation.protocol === "http"
|
|
58
|
-
? TypedHttpOperationAnalyzer_1.TypedHttpOperationAnalyzer.analyze(project)({
|
|
59
|
-
controller,
|
|
60
|
-
generics,
|
|
61
|
-
operation,
|
|
62
|
-
declaration,
|
|
63
|
-
symbol,
|
|
64
|
-
})
|
|
65
|
-
: TypedWebSocketOperationAnalyzer_1.TypedWebSocketOperationAnalyzer.analyze(project)({
|
|
66
|
-
controller,
|
|
67
|
-
operation,
|
|
68
|
-
declaration,
|
|
69
|
-
symbol,
|
|
70
|
-
generics,
|
|
71
|
-
});
|
|
72
|
-
ret.push(...routes);
|
|
73
|
-
}
|
|
74
|
-
return ret;
|
|
75
|
-
};
|
|
76
|
-
})(TypedControllerAnalyzer || (exports.TypedControllerAnalyzer = TypedControllerAnalyzer = {}));
|
|
77
|
-
//# sourceMappingURL=TypedControllerAnalyzer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedControllerAnalyzer.js","sourceRoot":"","sources":["../../src/analyses/TypedControllerAnalyzer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4DAA4B;AAQ5B,uDAAoD;AACpD,6EAA0E;AAC1E,uFAAoF;AAEpF,IAAiB,uBAAuB,CA+EvC;AA/ED,WAAiB,uBAAuB;IACzB,+BAAO,GAClB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CACE,UAAyB,EACzB,UAA8B,EAC0B,EAAE;QAC1D,wBAAwB;QACxB,MAAM,GAAG,GAAkD,EAAE,CAAC;QAC9D,oBAAE,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;;YACnC,IACE,oBAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;gBAC3B,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,WAAW,MAAK,UAAU,CAAC,IAAI,EAC1C,CAAC;gBACD,yBAAyB;gBACzB,GAAG,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC5D,OAAO;YACT,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,CAAC;IACb,CAAC,CAAA,CAAC;IAEJ;;kEAE8D;IAC9D,MAAM,mBAAmB,GACvB,CAAC,OAAuB,EAAE,EAAE,CAC5B,CACE,UAA8B,EAC9B,SAA8B,EACiB,EAAE;QACjD,MAAM,SAAS,GAAqB,OAAO,CAAC,OAAO,CAAC,iBAAiB,CACnE,SAAS,CACU,CAAC;QACtB,MAAM,QAAQ,GAA+B,iCAAe,CAAC,OAAO,CAClE,OAAO,CAAC,OAAO,EACf,SAAS,CACV,CAAC;QAEF,MAAM,GAAG,GAAkD,EAAE,CAAC;QAC9D,KAAK,MAAM,MAAM,IAAI,SAAS,CAAC,aAAa,EAAE,EAAE,CAAC;YAC/C,yBAAyB;YACzB,MAAM,WAAW,GAA+B,CAAC,MAAM,CAAC,YAAY;gBAClE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YACT,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAE,CAAC,mBAAmB,CAAC,WAAW,CAAC;gBAAE,SAAS;YAEnE,qBAAqB;YACrB,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC;YACpC,IAAI,CAAC,oBAAE,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE,SAAS;YAE3C,uCAAuC;YACvC,MAAM,SAAS,GAGC,UAAU,CAAC,UAAU,CAAC,IAAI,CACxC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,WAAW,CACzC,CAAC;YACF,IAAI,SAAS,KAAK,SAAS;gBAAE,SAAS;YAEtC,MAAM,MAAM,GACV,SAAS,CAAC,QAAQ,KAAK,MAAM;gBAC3B,CAAC,CAAC,uDAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBAC1C,UAAU;oBACV,QAAQ;oBACR,SAAS;oBACT,WAAW;oBACX,MAAM;iBACP,CAAC;gBACJ,CAAC,CAAC,iEAA+B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;oBAC/C,UAAU;oBACV,SAAS;oBACT,WAAW;oBACX,MAAM;oBACN,QAAQ;iBACT,CAAC,CAAC;YACT,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC;QACtB,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,CAAC;AACN,CAAC,EA/EgB,uBAAuB,uCAAvB,uBAAuB,QA+EvC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { INestiaProject } from "../structures/INestiaProject";
|
|
3
|
-
import { IReflectController } from "../structures/IReflectController";
|
|
4
|
-
import { IReflectHttpOperation } from "../structures/IReflectHttpOperation";
|
|
5
|
-
import { ITypedHttpRoute } from "../structures/ITypedHttpRoute";
|
|
6
|
-
import { GenericAnalyzer } from "./GenericAnalyzer";
|
|
7
|
-
export declare namespace TypedHttpOperationAnalyzer {
|
|
8
|
-
const analyze: (project: INestiaProject) => (props: {
|
|
9
|
-
controller: IReflectController;
|
|
10
|
-
operation: IReflectHttpOperation;
|
|
11
|
-
declaration: ts.MethodDeclaration;
|
|
12
|
-
symbol: ts.Symbol;
|
|
13
|
-
generics: GenericAnalyzer.Dictionary;
|
|
14
|
-
}) => ITypedHttpRoute[];
|
|
15
|
-
}
|