@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,81 @@
|
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
|
|
3
|
+
import { IMetadata } from "typia/lib/schemas/metadata/IMetadata";
|
|
4
|
+
import { IMetadataComponents } from "typia/lib/schemas/metadata/IMetadataComponents";
|
|
5
|
+
|
|
6
|
+
import { IReflectType } from "./IReflectType";
|
|
7
|
+
|
|
8
|
+
export type IReflectHttpOperationParameter =
|
|
9
|
+
| IReflectHttpOperationParameter.IBody
|
|
10
|
+
| IReflectHttpOperationParameter.IHeaders
|
|
11
|
+
| IReflectHttpOperationParameter.IParam
|
|
12
|
+
| IReflectHttpOperationParameter.IQuery;
|
|
13
|
+
export namespace IReflectHttpOperationParameter {
|
|
14
|
+
export interface IBody extends IBase<"body"> {
|
|
15
|
+
contentType:
|
|
16
|
+
| "application/json"
|
|
17
|
+
| "application/x-www-form-urlencoded"
|
|
18
|
+
| "multipart/form-data"
|
|
19
|
+
| "text/plain";
|
|
20
|
+
encrypted: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface IHeaders extends IBase<"headers"> {
|
|
23
|
+
field: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface IParam extends IBase<"param"> {
|
|
26
|
+
field: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IQuery extends IBase<"query"> {
|
|
29
|
+
field: string | null;
|
|
30
|
+
}
|
|
31
|
+
interface IBase<Category extends string> {
|
|
32
|
+
category: Category;
|
|
33
|
+
name: string;
|
|
34
|
+
index: number;
|
|
35
|
+
type: IReflectType;
|
|
36
|
+
metadata: IMetadata;
|
|
37
|
+
components: IMetadataComponents;
|
|
38
|
+
validate: MetadataFactory.Validator;
|
|
39
|
+
example?: any;
|
|
40
|
+
examples?: Record<string, any>;
|
|
41
|
+
description: string | null;
|
|
42
|
+
jsDocTags: IJsDocTagInfo[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export type IPreconfigured =
|
|
49
|
+
| IPreconfigured.IBody
|
|
50
|
+
| IPreconfigured.IHeaders
|
|
51
|
+
| IPreconfigured.IParam
|
|
52
|
+
| IPreconfigured.IQuery;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
|
+
export namespace IPreconfigured {
|
|
58
|
+
export interface IBody extends IBase<"body"> {
|
|
59
|
+
field?: string;
|
|
60
|
+
encrypted?: boolean;
|
|
61
|
+
contentType:
|
|
62
|
+
| "application/json"
|
|
63
|
+
| "application/x-www-form-urlencoded"
|
|
64
|
+
| "multipart/form-data"
|
|
65
|
+
| "text/plain";
|
|
66
|
+
}
|
|
67
|
+
export interface IHeaders extends IBase<"headers"> {
|
|
68
|
+
field?: string;
|
|
69
|
+
}
|
|
70
|
+
export interface IParam extends IBase<"param"> {
|
|
71
|
+
field?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface IQuery extends IBase<"query"> {
|
|
74
|
+
field?: string;
|
|
75
|
+
}
|
|
76
|
+
interface IBase<Category extends string> {
|
|
77
|
+
category: Category;
|
|
78
|
+
index: number;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MetadataFactory } from "typia/lib/factories/MetadataFactory";
|
|
2
|
+
import { IMetadata } from "typia/lib/schemas/metadata/IMetadata";
|
|
3
|
+
import { IMetadataComponents } from "typia/lib/schemas/metadata/IMetadataComponents";
|
|
4
|
+
|
|
5
|
+
import { IReflectType } from "./IReflectType";
|
|
6
|
+
|
|
7
|
+
export interface IReflectHttpOperationSuccess {
|
|
8
|
+
type: IReflectType;
|
|
9
|
+
status: number;
|
|
10
|
+
contentType:
|
|
11
|
+
| "application/json"
|
|
12
|
+
| "text/plain"
|
|
13
|
+
| "application/x-www-form-urlencoded"
|
|
14
|
+
| "application/json"
|
|
15
|
+
| null;
|
|
16
|
+
encrypted: boolean;
|
|
17
|
+
components: IMetadataComponents;
|
|
18
|
+
metadata: IMetadata;
|
|
19
|
+
validate: MetadataFactory.Validator;
|
|
20
|
+
example?: any;
|
|
21
|
+
examples?: Record<string, any>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IComparable } from "tstl";
|
|
2
|
+
|
|
3
|
+
import { IOperationMetadata } from "../transformers/IOperationMetadata";
|
|
4
|
+
|
|
5
|
+
export interface IReflectOperationError {
|
|
6
|
+
file: string;
|
|
7
|
+
class: string;
|
|
8
|
+
function: string | null;
|
|
9
|
+
from: string | null;
|
|
10
|
+
contents: Array<string | IOperationMetadata.IError>;
|
|
11
|
+
}
|
|
12
|
+
export namespace IReflectOperationError {
|
|
13
|
+
export class Key implements Pick<IComparable<Key>, "less"> {
|
|
14
|
+
public constructor(public readonly error: IReflectOperationError) {}
|
|
15
|
+
|
|
16
|
+
public less(obj: Key): boolean {
|
|
17
|
+
if (this.error.file !== obj.error.file)
|
|
18
|
+
return this.error.file < obj.error.file;
|
|
19
|
+
else if (this.error.class !== obj.error.class)
|
|
20
|
+
return this.error.class < obj.error.class;
|
|
21
|
+
else if (this.error.function !== obj.error.function)
|
|
22
|
+
return (this.error.function ?? "") < (obj.error.function ?? "");
|
|
23
|
+
return (this.error.from ?? "") < (obj.error.from ?? "");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { VERSION_NEUTRAL } from "@nestjs/common";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
import { IReflectTypeImport } from "./IReflectTypeImport";
|
|
5
|
+
import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
|
|
2
6
|
|
|
3
7
|
export interface IReflectWebSocketOperation {
|
|
4
8
|
protocol: "websocket";
|
|
5
|
-
target: Function;
|
|
6
9
|
name: string;
|
|
7
10
|
paths: string[];
|
|
11
|
+
function: Function;
|
|
8
12
|
versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
9
|
-
parameters:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
category: "acceptor" | "driver" | "header" | "param" | "query";
|
|
14
|
-
field: string;
|
|
15
|
-
index: number;
|
|
16
|
-
}
|
|
13
|
+
parameters: IReflectWebSocketOperationParameter[];
|
|
14
|
+
imports: IReflectTypeImport[];
|
|
15
|
+
description: string | null;
|
|
16
|
+
jsDocTags: ts.JSDocTagInfo[];
|
|
17
17
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
|
|
3
|
+
import { IReflectType } from "./IReflectType";
|
|
4
|
+
import { IReflectTypeImport } from "./IReflectTypeImport";
|
|
5
|
+
|
|
6
|
+
export type IReflectWebSocketOperationParameter =
|
|
7
|
+
| IReflectWebSocketOperationParameter.IAcceptor
|
|
8
|
+
| IReflectWebSocketOperationParameter.IDriver
|
|
9
|
+
| IReflectWebSocketOperationParameter.IHeader
|
|
10
|
+
| IReflectWebSocketOperationParameter.IParam
|
|
11
|
+
| IReflectWebSocketOperationParameter.IQuery;
|
|
12
|
+
export namespace IReflectWebSocketOperationParameter {
|
|
13
|
+
export type IAcceptor = IBase<"acceptor">;
|
|
14
|
+
export type IDriver = IBase<"driver">;
|
|
15
|
+
export type IHeader = IBase<"header">;
|
|
16
|
+
export type IQuery = IBase<"query">;
|
|
17
|
+
export interface IParam extends IBase<"param"> {
|
|
18
|
+
field: string;
|
|
19
|
+
}
|
|
20
|
+
interface IBase<Category extends string> {
|
|
21
|
+
category: Category;
|
|
22
|
+
name: string;
|
|
23
|
+
index: number;
|
|
24
|
+
type: IReflectType;
|
|
25
|
+
imports: IReflectTypeImport[];
|
|
26
|
+
description: string | null;
|
|
27
|
+
jsDocTags: IJsDocTagInfo[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export interface IPreconfigured {
|
|
34
|
+
category: "acceptor" | "driver" | "header" | "param" | "query";
|
|
35
|
+
index: number;
|
|
36
|
+
field?: string;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { INestiaProject } from "./INestiaProject";
|
|
2
|
+
import { ITypedHttpRoute } from "./ITypedHttpRoute";
|
|
3
|
+
import { ITypedWebSocketRoute } from "./ITypedWebSocketRoute";
|
|
4
|
+
|
|
5
|
+
export interface ITypedApplication {
|
|
6
|
+
project: INestiaProject;
|
|
7
|
+
routes: Array<ITypedHttpRoute | ITypedWebSocketRoute>;
|
|
8
|
+
}
|
|
@@ -1,59 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
3
2
|
|
|
4
3
|
import { IReflectController } from "./IReflectController";
|
|
5
|
-
import {
|
|
4
|
+
import { IReflectTypeImport } from "./IReflectTypeImport";
|
|
5
|
+
import { ITypedHttpRouteException } from "./ITypedHttpRouteException";
|
|
6
|
+
import { ITypedHttpRouteParameter } from "./ITypedHttpRouteParameter";
|
|
7
|
+
import { ITypedHttpRouteSuccess } from "./ITypedHttpRouteSuccess";
|
|
6
8
|
|
|
7
9
|
export interface ITypedHttpRoute {
|
|
8
10
|
protocol: "http";
|
|
9
|
-
controller: IReflectController;
|
|
10
11
|
function: Function;
|
|
12
|
+
controller: IReflectController;
|
|
11
13
|
name: string;
|
|
12
14
|
method: string;
|
|
13
15
|
path: string;
|
|
14
|
-
encrypted: boolean;
|
|
15
|
-
status?: number;
|
|
16
|
-
|
|
17
16
|
accessors: string[];
|
|
18
|
-
parameters:
|
|
19
|
-
|
|
20
|
-
output: ITypedHttpRoute.IOutput;
|
|
21
|
-
|
|
22
|
-
location: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
operationId?: string;
|
|
25
|
-
jsDocTags: ts.JSDocTagInfo[];
|
|
26
|
-
setHeaders: Array<
|
|
27
|
-
| { type: "setter"; source: string; target?: string }
|
|
28
|
-
| { type: "assigner"; source: string }
|
|
29
|
-
>;
|
|
30
|
-
security: Record<string, string[]>[];
|
|
17
|
+
parameters: ITypedHttpRouteParameter[];
|
|
18
|
+
success: ITypedHttpRouteSuccess;
|
|
31
19
|
exceptions: Record<
|
|
32
20
|
number | "2XX" | "3XX" | "4XX" | "5XX",
|
|
33
|
-
|
|
21
|
+
ITypedHttpRouteException
|
|
34
22
|
>;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export type IParameter = IReflectHttpOperation.IParameter & {
|
|
42
|
-
optional: boolean;
|
|
43
|
-
type: ts.Type;
|
|
44
|
-
typeName: string;
|
|
45
|
-
metadata?: Metadata;
|
|
46
|
-
description?: string;
|
|
47
|
-
jsDocTags: ts.JSDocTagInfo[];
|
|
48
|
-
};
|
|
49
|
-
export interface IOutput {
|
|
50
|
-
type: ts.Type;
|
|
51
|
-
typeName: string;
|
|
52
|
-
metadata?: Metadata;
|
|
53
|
-
description?: string;
|
|
54
|
-
contentType:
|
|
55
|
-
| "application/x-www-form-urlencoded"
|
|
56
|
-
| "application/json"
|
|
57
|
-
| "text/plain";
|
|
58
|
-
}
|
|
23
|
+
security: Record<string, string[]>[];
|
|
24
|
+
tags: string[];
|
|
25
|
+
imports: IReflectTypeImport[];
|
|
26
|
+
description: string | null;
|
|
27
|
+
jsDocTags: IJsDocTagInfo[];
|
|
28
|
+
operationId: string | undefined;
|
|
59
29
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
2
|
+
|
|
3
|
+
import { IReflectType } from "./IReflectType";
|
|
4
|
+
|
|
5
|
+
export interface ITypedHttpRouteException {
|
|
6
|
+
// BASIC PROPERTIES
|
|
7
|
+
status: number | "2XX" | "3XX" | "4XX" | "5XX";
|
|
8
|
+
description: string | null;
|
|
9
|
+
example: any;
|
|
10
|
+
examples: Record<string, any>;
|
|
11
|
+
|
|
12
|
+
// REFLECTED PROPERTIES
|
|
13
|
+
type: IReflectType;
|
|
14
|
+
metadata: Metadata;
|
|
15
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
3
|
+
|
|
4
|
+
import { IReflectType } from "./IReflectType";
|
|
5
|
+
|
|
6
|
+
export type ITypedHttpRouteParameter =
|
|
7
|
+
| ITypedHttpRouteParameter.IBody
|
|
8
|
+
| ITypedHttpRouteParameter.IHeaders
|
|
9
|
+
| ITypedHttpRouteParameter.IParam
|
|
10
|
+
| ITypedHttpRouteParameter.IQuery;
|
|
11
|
+
export namespace ITypedHttpRouteParameter {
|
|
12
|
+
export interface IBody extends IBase<"body"> {
|
|
13
|
+
contentType:
|
|
14
|
+
| "application/json"
|
|
15
|
+
| "application/x-www-form-urlencoded"
|
|
16
|
+
| "multipart/form-data"
|
|
17
|
+
| "text/plain";
|
|
18
|
+
encrypted: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface IHeaders extends IBase<"headers"> {
|
|
21
|
+
field: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface IParam extends IBase<"param"> {
|
|
24
|
+
field: string;
|
|
25
|
+
}
|
|
26
|
+
export interface IQuery extends IBase<"query"> {
|
|
27
|
+
field: string | null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface IBase<Category extends string> {
|
|
31
|
+
category: Category;
|
|
32
|
+
name: string;
|
|
33
|
+
index: number;
|
|
34
|
+
type: IReflectType;
|
|
35
|
+
metadata: Metadata;
|
|
36
|
+
example?: any;
|
|
37
|
+
examples?: Record<string, any>;
|
|
38
|
+
description: string | null;
|
|
39
|
+
jsDocTags: IJsDocTagInfo[];
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
2
|
+
|
|
3
|
+
import { IReflectType } from "./IReflectType";
|
|
4
|
+
|
|
5
|
+
export interface ITypedHttpRouteSuccess {
|
|
6
|
+
type: IReflectType;
|
|
7
|
+
status: number | null;
|
|
8
|
+
contentType:
|
|
9
|
+
| "application/json"
|
|
10
|
+
| "text/plain"
|
|
11
|
+
| "application/x-www-form-urlencoded"
|
|
12
|
+
| "application/json"
|
|
13
|
+
| null;
|
|
14
|
+
encrypted: boolean;
|
|
15
|
+
metadata: Metadata;
|
|
16
|
+
example?: any;
|
|
17
|
+
examples?: Record<string, any>;
|
|
18
|
+
setHeaders: Array<
|
|
19
|
+
| { type: "setter"; source: string; target?: string }
|
|
20
|
+
| { type: "assigner"; source: string }
|
|
21
|
+
>;
|
|
22
|
+
}
|
|
@@ -1,68 +1,20 @@
|
|
|
1
|
+
import { VERSION_NEUTRAL } from "@nestjs/common";
|
|
1
2
|
import ts from "typescript";
|
|
2
|
-
import { Metadata } from "typia/lib/schemas/metadata/Metadata";
|
|
3
3
|
|
|
4
4
|
import { IReflectController } from "./IReflectController";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { IReflectTypeImport } from "./IReflectTypeImport";
|
|
6
|
+
import { ITypedWebSocketRouteParameter } from "./ITypedWebSocketRouteParameter";
|
|
7
7
|
|
|
8
8
|
export interface ITypedWebSocketRoute {
|
|
9
9
|
protocol: "websocket";
|
|
10
10
|
controller: IReflectController;
|
|
11
11
|
name: string;
|
|
12
12
|
path: string;
|
|
13
|
-
|
|
14
13
|
accessors: string[];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
description
|
|
14
|
+
function: Function;
|
|
15
|
+
versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
16
|
+
parameters: ITypedWebSocketRouteParameter[];
|
|
17
|
+
imports: IReflectTypeImport[];
|
|
18
|
+
description: string | null;
|
|
20
19
|
jsDocTags: ts.JSDocTagInfo[];
|
|
21
20
|
}
|
|
22
|
-
export namespace ITypedWebSocketRoute {
|
|
23
|
-
export type IParameter =
|
|
24
|
-
| IAcceptorParameter
|
|
25
|
-
| IDriverParameter
|
|
26
|
-
| IHeaderParameter
|
|
27
|
-
| IPathParameter
|
|
28
|
-
| IQueryParameter;
|
|
29
|
-
export interface IAcceptorParameter
|
|
30
|
-
extends Omit<IReflectWebSocketOperation.IParameter, "category"> {
|
|
31
|
-
category: "acceptor";
|
|
32
|
-
name: string;
|
|
33
|
-
header: ITypeTuple;
|
|
34
|
-
provider: ITypeTuple;
|
|
35
|
-
listener: ITypeTuple;
|
|
36
|
-
}
|
|
37
|
-
export interface IDriverParameter
|
|
38
|
-
extends Omit<IReflectWebSocketOperation.IParameter, "category"> {
|
|
39
|
-
category: "driver";
|
|
40
|
-
name: string;
|
|
41
|
-
type: ts.Type;
|
|
42
|
-
typeName: string;
|
|
43
|
-
}
|
|
44
|
-
export interface IHeaderParameter
|
|
45
|
-
extends Omit<IReflectWebSocketOperation.IParameter, "header"> {
|
|
46
|
-
category: "header";
|
|
47
|
-
name: string;
|
|
48
|
-
type: ts.Type;
|
|
49
|
-
typeName: string;
|
|
50
|
-
metadata?: Metadata;
|
|
51
|
-
}
|
|
52
|
-
export interface IPathParameter
|
|
53
|
-
extends Omit<IReflectWebSocketOperation.IParameter, "path"> {
|
|
54
|
-
category: "param";
|
|
55
|
-
name: string;
|
|
56
|
-
type: ts.Type;
|
|
57
|
-
typeName: string;
|
|
58
|
-
metadata?: Metadata;
|
|
59
|
-
}
|
|
60
|
-
export interface IQueryParameter
|
|
61
|
-
extends Omit<IReflectWebSocketOperation.IParameter, "query"> {
|
|
62
|
-
category: "query";
|
|
63
|
-
name: string;
|
|
64
|
-
type: ts.Type;
|
|
65
|
-
typeName: string;
|
|
66
|
-
metadata?: Metadata;
|
|
67
|
-
}
|
|
68
|
-
}
|
package/src/transform.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
|
|
3
|
+
import { SdkTransformer } from "./transformers/SdkTransformer";
|
|
4
|
+
|
|
5
|
+
export const transform = (
|
|
6
|
+
program: ts.Program,
|
|
7
|
+
): ts.TransformerFactory<ts.SourceFile> =>
|
|
8
|
+
SdkTransformer.transformFile(program.getTypeChecker());
|
|
9
|
+
export default transform;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IJsDocTagInfo } from "typia";
|
|
2
|
+
import { IMetadata } from "typia/lib/schemas/metadata/IMetadata";
|
|
3
|
+
import { IMetadataComponents } from "typia/lib/schemas/metadata/IMetadataComponents";
|
|
4
|
+
import { ValidationPipe } from "typia/lib/typings/ValidationPipe";
|
|
5
|
+
|
|
6
|
+
import { IReflectType } from "../structures/IReflectType";
|
|
7
|
+
import { IReflectTypeImport } from "../structures/IReflectTypeImport";
|
|
8
|
+
|
|
9
|
+
export interface IOperationMetadata {
|
|
10
|
+
parameters: IOperationMetadata.IParameter[];
|
|
11
|
+
success: IOperationMetadata.IResponse;
|
|
12
|
+
exceptions: Record<string, IOperationMetadata.IResponse>;
|
|
13
|
+
description: string | null;
|
|
14
|
+
jsDocTags: IJsDocTagInfo[];
|
|
15
|
+
}
|
|
16
|
+
export namespace IOperationMetadata {
|
|
17
|
+
export interface IParameter extends IResponse {
|
|
18
|
+
name: string;
|
|
19
|
+
index: number;
|
|
20
|
+
description: string | null;
|
|
21
|
+
jsDocTags: IJsDocTagInfo[];
|
|
22
|
+
}
|
|
23
|
+
export interface IResponse {
|
|
24
|
+
type: IReflectType | null;
|
|
25
|
+
imports: IReflectTypeImport[];
|
|
26
|
+
primitive: ValidationPipe<ISchema, IError>;
|
|
27
|
+
resolved: ValidationPipe<ISchema, IError>;
|
|
28
|
+
}
|
|
29
|
+
export interface ISchema {
|
|
30
|
+
components: IMetadataComponents;
|
|
31
|
+
metadata: IMetadata;
|
|
32
|
+
}
|
|
33
|
+
export interface IError {
|
|
34
|
+
name: string;
|
|
35
|
+
accessor: string | null;
|
|
36
|
+
messages: string[];
|
|
37
|
+
}
|
|
38
|
+
}
|