@nestia/sdk 7.1.1 → 7.2.1
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/analyses/DtoAnalyzer.d.ts +21 -0
- package/lib/analyses/DtoAnalyzer.js +203 -0
- package/lib/analyses/DtoAnalyzer.js.map +1 -0
- package/lib/analyses/ImportAnalyzer.d.ts +3 -8
- package/lib/analyses/ImportAnalyzer.js +84 -102
- package/lib/analyses/ImportAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js +1 -1
- package/lib/analyses/ReflectHttpOperationAnalyzer.js.map +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js +1 -1
- package/lib/analyses/ReflectWebSocketOperationAnalyzer.js.map +1 -1
- package/lib/generates/internal/E2eFileProgrammer.js +3 -9
- package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
- package/lib/generates/internal/ImportDictionary.d.ts +9 -11
- package/lib/generates/internal/ImportDictionary.js +55 -48
- package/lib/generates/internal/ImportDictionary.js.map +1 -1
- package/lib/generates/internal/SdkAliasCollection.js +24 -18
- package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
- package/lib/generates/internal/SdkFileProgrammer.js +1 -7
- package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.js +3 -1
- package/lib/generates/internal/SdkHttpCloneReferencer.js.map +1 -1
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js +4 -3
- package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkImportWizard.js +28 -21
- package/lib/generates/internal/SdkImportWizard.js.map +1 -1
- package/lib/generates/internal/SdkTypeProgrammer.js +3 -2
- package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkTypeTagProgrammer.js +10 -8
- package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +8 -6
- package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +12 -9
- package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
- package/lib/structures/IReflectHttpOperation.d.ts +2 -2
- package/lib/structures/IReflectImport.d.ts +6 -0
- package/lib/structures/{IReflectTypeImport.js → IReflectImport.js} +1 -1
- package/lib/structures/IReflectImport.js.map +1 -0
- package/lib/structures/IReflectWebSocketOperation.d.ts +2 -2
- package/lib/structures/IReflectWebSocketOperationParameter.d.ts +2 -2
- package/lib/structures/ITypedHttpRoute.d.ts +2 -2
- package/lib/structures/ITypedWebSocketRoute.d.ts +2 -2
- package/lib/transformers/IOperationMetadata.d.ts +3 -3
- package/lib/transformers/SdkOperationProgrammer.d.ts +3 -1
- package/lib/transformers/SdkOperationProgrammer.js +57 -26
- package/lib/transformers/SdkOperationProgrammer.js.map +1 -1
- package/lib/transformers/SdkOperationTransformer.js +3 -3
- package/lib/transformers/SdkOperationTransformer.js.map +1 -1
- package/package.json +4 -4
- package/src/analyses/DtoAnalyzer.ts +246 -0
- package/src/analyses/ImportAnalyzer.ts +110 -155
- package/src/analyses/ReflectHttpOperationAnalyzer.ts +1 -1
- package/src/analyses/ReflectWebSocketOperationAnalyzer.ts +3 -3
- package/src/generates/internal/E2eFileProgrammer.ts +3 -11
- package/src/generates/internal/ImportDictionary.ts +111 -84
- package/src/generates/internal/SdkAliasCollection.ts +24 -18
- package/src/generates/internal/SdkFileProgrammer.ts +1 -7
- package/src/generates/internal/SdkHttpCloneReferencer.ts +3 -1
- package/src/generates/internal/SdkHttpSimulationProgrammer.ts +4 -3
- package/src/generates/internal/SdkImportWizard.ts +28 -21
- package/src/generates/internal/SdkTypeProgrammer.ts +3 -2
- package/src/generates/internal/SdkTypeTagProgrammer.ts +10 -8
- package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +8 -6
- package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +12 -9
- package/src/structures/IReflectHttpOperation.ts +2 -2
- package/src/structures/IReflectHttpOperationParameter.ts +2 -6
- package/src/structures/IReflectImport.ts +6 -0
- package/src/structures/IReflectWebSocketOperation.ts +2 -2
- package/src/structures/IReflectWebSocketOperationParameter.ts +3 -5
- package/src/structures/ITypedHttpRoute.ts +2 -2
- package/src/structures/ITypedWebSocketRoute.ts +2 -2
- package/src/transformers/IOperationMetadata.ts +3 -3
- package/src/transformers/SdkOperationProgrammer.ts +60 -31
- package/src/transformers/SdkOperationTransformer.ts +7 -8
- package/lib/structures/IReflectTypeImport.d.ts +0 -4
- package/lib/structures/IReflectTypeImport.js.map +0 -1
- package/src/structures/IReflectTypeImport.ts +0 -4
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import { HashMap,
|
|
2
|
+
import { HashMap, TreeSet, hash } from "tstl";
|
|
3
3
|
import ts from "typescript";
|
|
4
4
|
|
|
5
|
+
import { ImportAnalyzer } from "../../analyses/ImportAnalyzer";
|
|
6
|
+
import { IReflectImport } from "../../structures/IReflectImport";
|
|
5
7
|
import { FilePrinter } from "./FilePrinter";
|
|
6
8
|
|
|
7
9
|
export class ImportDictionary {
|
|
8
|
-
private readonly components_: HashMap<
|
|
9
|
-
new HashMap(
|
|
10
|
+
private readonly components_: HashMap<ICompositeKey, ICompositeValue> =
|
|
11
|
+
new HashMap(
|
|
12
|
+
(key) => hash(key.file, key.declaration, key.asterisk, key.default),
|
|
13
|
+
(a, b) =>
|
|
14
|
+
a.file === b.file &&
|
|
15
|
+
a.declaration === b.declaration &&
|
|
16
|
+
a.asterisk === b.asterisk &&
|
|
17
|
+
a.default === b.default,
|
|
18
|
+
);
|
|
10
19
|
|
|
11
20
|
public constructor(public readonly file: string) {}
|
|
12
21
|
|
|
@@ -14,23 +23,42 @@ export class ImportDictionary {
|
|
|
14
23
|
return this.components_.empty();
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
public
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
public declarations(imports: IReflectImport[]): void {
|
|
27
|
+
imports = ImportAnalyzer.merge(imports);
|
|
28
|
+
for (const imp of imports) {
|
|
29
|
+
if (imp.asterisk !== null)
|
|
30
|
+
this.internal({
|
|
31
|
+
type: "asterisk",
|
|
32
|
+
file: imp.file,
|
|
33
|
+
name: imp.asterisk,
|
|
34
|
+
declaration: true,
|
|
35
|
+
});
|
|
36
|
+
if (imp.default !== null)
|
|
37
|
+
this.internal({
|
|
38
|
+
type: "default",
|
|
39
|
+
file: imp.file,
|
|
40
|
+
name: imp.default,
|
|
41
|
+
declaration: true,
|
|
42
|
+
});
|
|
43
|
+
for (const elem of imp.elements)
|
|
44
|
+
this.internal({
|
|
45
|
+
type: "element",
|
|
46
|
+
file: imp.file,
|
|
47
|
+
name: elem,
|
|
48
|
+
declaration: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
31
51
|
}
|
|
32
52
|
|
|
33
|
-
public
|
|
53
|
+
public external(props: ImportDictionary.IProps): string {
|
|
54
|
+
const file: string = `node_modules/${props.file}`;
|
|
55
|
+
return this.internal({
|
|
56
|
+
...props,
|
|
57
|
+
file,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public internal(props: ImportDictionary.IProps): string {
|
|
34
62
|
const file: string = normalize(
|
|
35
63
|
(() => {
|
|
36
64
|
if (props.file.substring(props.file.length - 5) === ".d.ts")
|
|
@@ -40,27 +68,25 @@ export class ImportDictionary {
|
|
|
40
68
|
return props.file;
|
|
41
69
|
})(),
|
|
42
70
|
);
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
} else composition.elements.insert(props.instance);
|
|
56
|
-
return props.instance ?? file;
|
|
71
|
+
const key: ICompositeKey = {
|
|
72
|
+
file: file,
|
|
73
|
+
declaration: props.declaration,
|
|
74
|
+
asterisk: props.type === "asterisk" ? props.name : null,
|
|
75
|
+
default: props.type === "default" ? props.name : null,
|
|
76
|
+
};
|
|
77
|
+
const value: ICompositeValue = this.components_.take(key, () => ({
|
|
78
|
+
...key,
|
|
79
|
+
elements: new TreeSet<string>(),
|
|
80
|
+
}));
|
|
81
|
+
if (props.type === "element") value.elements.insert(props.name);
|
|
82
|
+
return props.name;
|
|
57
83
|
}
|
|
58
84
|
|
|
59
85
|
public toStatements(outDir: string): ts.Statement[] {
|
|
60
86
|
outDir = path.resolve(outDir);
|
|
87
|
+
|
|
61
88
|
const external: ts.ImportDeclaration[] = [];
|
|
62
89
|
const internal: ts.ImportDeclaration[] = [];
|
|
63
|
-
|
|
64
90
|
const locator = (str: string) => {
|
|
65
91
|
const location: string = path
|
|
66
92
|
.relative(outDir, str)
|
|
@@ -76,48 +102,26 @@ export class ImportDictionary {
|
|
|
76
102
|
const enroll =
|
|
77
103
|
(filter: (str: string) => boolean) =>
|
|
78
104
|
(container: ts.ImportDeclaration[]) => {
|
|
79
|
-
const compositions:
|
|
105
|
+
const compositions: ICompositeValue[] = this.components_
|
|
80
106
|
.toJSON()
|
|
81
|
-
.filter((c) => filter(c.second.
|
|
82
|
-
.map(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
brackets.push(
|
|
92
|
-
`{ ${c.elements
|
|
93
|
-
.toJSON()
|
|
94
|
-
.sort((a, b) => a.localeCompare(b))
|
|
95
|
-
.join(", ")} }`,
|
|
96
|
-
);
|
|
107
|
+
.filter((c) => filter(c.second.file))
|
|
108
|
+
.map(
|
|
109
|
+
(e) =>
|
|
110
|
+
({
|
|
111
|
+
...e.second,
|
|
112
|
+
file: locator(e.second.file),
|
|
113
|
+
}) satisfies ICompositeValue,
|
|
114
|
+
)
|
|
115
|
+
.sort((a, b) => a.file.localeCompare(b.file));
|
|
116
|
+
for (const c of compositions)
|
|
97
117
|
container.push(
|
|
98
118
|
ts.factory.createImportDeclaration(
|
|
99
119
|
undefined,
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
? ts.factory.createIdentifier(c.name ?? c.location)
|
|
104
|
-
: undefined,
|
|
105
|
-
c.elements.empty() === false
|
|
106
|
-
? ts.factory.createNamedImports(
|
|
107
|
-
[...c.elements].map((elem) =>
|
|
108
|
-
ts.factory.createImportSpecifier(
|
|
109
|
-
false,
|
|
110
|
-
undefined,
|
|
111
|
-
ts.factory.createIdentifier(elem),
|
|
112
|
-
),
|
|
113
|
-
),
|
|
114
|
-
)
|
|
115
|
-
: undefined,
|
|
116
|
-
),
|
|
117
|
-
ts.factory.createStringLiteral(c.location),
|
|
120
|
+
this.toImportClaude(c),
|
|
121
|
+
ts.factory.createStringLiteral(c.file),
|
|
122
|
+
undefined,
|
|
118
123
|
),
|
|
119
124
|
);
|
|
120
|
-
}
|
|
121
125
|
};
|
|
122
126
|
|
|
123
127
|
enroll((str) => str.indexOf(NODE_MODULES) !== -1)(external);
|
|
@@ -128,27 +132,50 @@ export class ImportDictionary {
|
|
|
128
132
|
...internal,
|
|
129
133
|
];
|
|
130
134
|
}
|
|
135
|
+
|
|
136
|
+
private toImportClaude(c: ICompositeValue): ts.ImportClause {
|
|
137
|
+
if (c.asterisk !== null)
|
|
138
|
+
return ts.factory.createImportClause(
|
|
139
|
+
c.declaration,
|
|
140
|
+
undefined,
|
|
141
|
+
ts.factory.createNamespaceImport(
|
|
142
|
+
ts.factory.createIdentifier(c.asterisk),
|
|
143
|
+
),
|
|
144
|
+
);
|
|
145
|
+
return ts.factory.createImportClause(
|
|
146
|
+
c.declaration,
|
|
147
|
+
c.default !== null ? ts.factory.createIdentifier(c.default) : undefined,
|
|
148
|
+
c.elements.size() !== 0
|
|
149
|
+
? ts.factory.createNamedImports(
|
|
150
|
+
Array.from(c.elements).map((elem) =>
|
|
151
|
+
ts.factory.createImportSpecifier(
|
|
152
|
+
false,
|
|
153
|
+
undefined,
|
|
154
|
+
ts.factory.createIdentifier(elem),
|
|
155
|
+
),
|
|
156
|
+
),
|
|
157
|
+
)
|
|
158
|
+
: undefined,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
131
161
|
}
|
|
132
162
|
export namespace ImportDictionary {
|
|
133
|
-
export interface
|
|
134
|
-
type:
|
|
135
|
-
library: string;
|
|
136
|
-
instance: string | null;
|
|
137
|
-
}
|
|
138
|
-
export interface IInternalProps {
|
|
139
|
-
type: boolean;
|
|
163
|
+
export interface IProps {
|
|
164
|
+
type: "default" | "element" | "asterisk";
|
|
140
165
|
file: string;
|
|
141
|
-
|
|
142
|
-
|
|
166
|
+
name: string;
|
|
167
|
+
declaration: boolean;
|
|
143
168
|
}
|
|
144
169
|
}
|
|
145
170
|
|
|
146
|
-
interface
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
171
|
+
interface ICompositeKey {
|
|
172
|
+
file: string;
|
|
173
|
+
declaration: boolean;
|
|
174
|
+
asterisk: string | null;
|
|
175
|
+
default: string | null;
|
|
176
|
+
}
|
|
177
|
+
interface ICompositeValue extends ICompositeKey {
|
|
178
|
+
elements: TreeSet<string>;
|
|
152
179
|
}
|
|
153
180
|
|
|
154
181
|
const NODE_MODULES = "node_modules/";
|
|
@@ -108,9 +108,10 @@ export namespace SdkAliasCollection {
|
|
|
108
108
|
if (project.config.primitive === false) return type;
|
|
109
109
|
return ts.factory.createTypeReferenceNode(
|
|
110
110
|
importer.external({
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
file: "typia",
|
|
112
|
+
declaration: true,
|
|
113
|
+
type: "element",
|
|
114
|
+
name: "Resolved",
|
|
114
115
|
}),
|
|
115
116
|
[type],
|
|
116
117
|
);
|
|
@@ -126,9 +127,10 @@ export namespace SdkAliasCollection {
|
|
|
126
127
|
if (project.config.primitive === false) return type;
|
|
127
128
|
return ts.factory.createTypeReferenceNode(
|
|
128
129
|
importer.external({
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
file: "typia",
|
|
131
|
+
declaration: true,
|
|
132
|
+
type: "element",
|
|
133
|
+
name: "Resolved",
|
|
132
134
|
}),
|
|
133
135
|
[type],
|
|
134
136
|
);
|
|
@@ -150,9 +152,10 @@ export namespace SdkAliasCollection {
|
|
|
150
152
|
else if (project.config.primitive === false) return type;
|
|
151
153
|
return ts.factory.createTypeReferenceNode(
|
|
152
154
|
importer.external({
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
155
|
+
file: "typia",
|
|
156
|
+
declaration: true,
|
|
157
|
+
type: "element",
|
|
158
|
+
name:
|
|
156
159
|
param.contentType === "application/json" || param.encrypted === true
|
|
157
160
|
? "Primitive"
|
|
158
161
|
: "Resolved",
|
|
@@ -173,9 +176,10 @@ export namespace SdkAliasCollection {
|
|
|
173
176
|
: project.config.primitive !== false
|
|
174
177
|
? ts.factory.createTypeReferenceNode(
|
|
175
178
|
importer.external({
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
file: "typia",
|
|
180
|
+
declaration: true,
|
|
181
|
+
type: "element",
|
|
182
|
+
name:
|
|
179
183
|
route.success.contentType === "application/json" ||
|
|
180
184
|
route.success.encrypted === true
|
|
181
185
|
? "Primitive"
|
|
@@ -200,9 +204,10 @@ export namespace SdkAliasCollection {
|
|
|
200
204
|
];
|
|
201
205
|
return ts.factory.createTypeReferenceNode(
|
|
202
206
|
importer.external({
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
207
|
+
file: "@nestia/fetcher",
|
|
208
|
+
declaration: true,
|
|
209
|
+
type: "element",
|
|
210
|
+
name: "IPropagation",
|
|
206
211
|
}),
|
|
207
212
|
[
|
|
208
213
|
ts.factory.createTypeLiteralNode(
|
|
@@ -241,9 +246,10 @@ export namespace SdkAliasCollection {
|
|
|
241
246
|
const formDataInput = (importer: ImportDictionary) => (type: ts.TypeNode) =>
|
|
242
247
|
ts.factory.createTypeReferenceNode(
|
|
243
248
|
importer.external({
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
file: "@nestia/fetcher",
|
|
250
|
+
declaration: true,
|
|
251
|
+
type: "element",
|
|
252
|
+
name: "FormDataInput",
|
|
247
253
|
}),
|
|
248
254
|
[type],
|
|
249
255
|
);
|
|
@@ -76,13 +76,7 @@ export namespace SdkFileProgrammer {
|
|
|
76
76
|
);
|
|
77
77
|
directory.routes.forEach((route, i) => {
|
|
78
78
|
if (!(project.config.clone === true && route.protocol === "http"))
|
|
79
|
-
|
|
80
|
-
for (const instance of tuple.instances)
|
|
81
|
-
importer.internal({
|
|
82
|
-
file: tuple.file,
|
|
83
|
-
instance,
|
|
84
|
-
type: true,
|
|
85
|
-
});
|
|
79
|
+
importer.declarations(route.imports);
|
|
86
80
|
statements.push(
|
|
87
81
|
...(route.protocol === "http"
|
|
88
82
|
? SdkHttpRouteProgrammer.write(project)(importer)(route)
|
|
@@ -140,9 +140,10 @@ export namespace SdkHttpSimulationProgrammer {
|
|
|
140
140
|
IdentifierFactory.access(
|
|
141
141
|
ts.factory.createIdentifier(
|
|
142
142
|
importer.external({
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
file: `@nestia/fetcher/lib/NestiaSimulator`,
|
|
144
|
+
declaration: false,
|
|
145
|
+
type: "element",
|
|
146
|
+
name: "NestiaSimulator",
|
|
146
147
|
}),
|
|
147
148
|
),
|
|
148
149
|
"assert",
|
|
@@ -6,50 +6,57 @@ export namespace SdkImportWizard {
|
|
|
6
6
|
|
|
7
7
|
export const HttpError = (importer: ImportDictionary) =>
|
|
8
8
|
importer.external({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
declaration: true,
|
|
10
|
+
file: "@nestia/fetcher",
|
|
11
|
+
type: "element",
|
|
12
|
+
name: "HttpError",
|
|
12
13
|
});
|
|
13
14
|
|
|
14
15
|
export const IConnection = (importer: ImportDictionary) =>
|
|
15
16
|
importer.external({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
declaration: true,
|
|
18
|
+
file: "@nestia/fetcher",
|
|
19
|
+
type: "element",
|
|
20
|
+
name: "IConnection",
|
|
19
21
|
});
|
|
20
22
|
|
|
21
23
|
export const Primitive = (importer: ImportDictionary) =>
|
|
22
24
|
importer.external({
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
declaration: true,
|
|
26
|
+
file: "typia",
|
|
27
|
+
type: "element",
|
|
28
|
+
name: "Primitive",
|
|
26
29
|
});
|
|
27
30
|
|
|
28
31
|
export const Resolved = (importer: ImportDictionary) =>
|
|
29
32
|
importer.external({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
declaration: true,
|
|
34
|
+
file: "typia",
|
|
35
|
+
type: "element",
|
|
36
|
+
name: "Resolved",
|
|
33
37
|
});
|
|
34
38
|
|
|
35
39
|
export const typia = (importer: ImportDictionary) =>
|
|
36
40
|
importer.external({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
declaration: false,
|
|
42
|
+
file: "typia",
|
|
43
|
+
type: "default",
|
|
44
|
+
name: "typia",
|
|
40
45
|
});
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
const PlainFetcher = (importer: ImportDictionary) =>
|
|
44
49
|
importer.external({
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
declaration: false,
|
|
51
|
+
file: "@nestia/fetcher/lib/PlainFetcher",
|
|
52
|
+
type: "element",
|
|
53
|
+
name: "PlainFetcher",
|
|
48
54
|
});
|
|
49
55
|
|
|
50
56
|
const EncryptedFetcher = (importer: ImportDictionary) =>
|
|
51
57
|
importer.external({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
declaration: false,
|
|
59
|
+
file: "@nestia/fetcher/lib/EncryptedFetcher",
|
|
60
|
+
type: "element",
|
|
61
|
+
name: "EncryptedFetcher",
|
|
55
62
|
});
|
|
@@ -377,8 +377,9 @@ const importInternalFile =
|
|
|
377
377
|
if (importer.file === `${project.config.output}/structures/${top}.ts`)
|
|
378
378
|
return;
|
|
379
379
|
importer.internal({
|
|
380
|
-
|
|
380
|
+
declaration: true,
|
|
381
381
|
file: `${project.config.output}/structures/${name.split(".")[0]}`,
|
|
382
|
-
|
|
382
|
+
type: "element",
|
|
383
|
+
name: top,
|
|
383
384
|
});
|
|
384
385
|
};
|
|
@@ -10,13 +10,14 @@ export namespace SdkTypeTagProgrammer {
|
|
|
10
10
|
from: "object" | "array" | "boolean" | "number" | "bigint" | "string",
|
|
11
11
|
tag: IMetadataTypeTag,
|
|
12
12
|
) => {
|
|
13
|
-
const
|
|
14
|
-
if (PREDEFINED[from]?.has(
|
|
13
|
+
const name: string = tag.name.split("<")[0];
|
|
14
|
+
if (PREDEFINED[from]?.has(name) === true)
|
|
15
15
|
return ts.factory.createTypeReferenceNode(
|
|
16
16
|
importer.external({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
declaration: true,
|
|
18
|
+
file: `typia/lib/tags/${name}`,
|
|
19
|
+
type: "element",
|
|
20
|
+
name: name,
|
|
20
21
|
}),
|
|
21
22
|
[
|
|
22
23
|
ts.factory.createLiteralTypeNode(
|
|
@@ -26,9 +27,10 @@ export namespace SdkTypeTagProgrammer {
|
|
|
26
27
|
);
|
|
27
28
|
return ts.factory.createTypeReferenceNode(
|
|
28
29
|
importer.external({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
declaration: true,
|
|
31
|
+
file: `typia/lib/tags/TagBase`,
|
|
32
|
+
type: "element",
|
|
33
|
+
name: "TagBase",
|
|
32
34
|
}),
|
|
33
35
|
[
|
|
34
36
|
ts.factory.createLiteralTypeNode(
|
|
@@ -52,9 +52,10 @@ export namespace SdkWebSocketNamespaceProgrammer {
|
|
|
52
52
|
undefined,
|
|
53
53
|
ts.factory.createTypeReferenceNode(
|
|
54
54
|
importer.external({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
declaration: false,
|
|
56
|
+
file: "tgrid",
|
|
57
|
+
type: "element",
|
|
58
|
+
name: "WebSocketConnector",
|
|
58
59
|
}),
|
|
59
60
|
[
|
|
60
61
|
ts.factory.createTypeReferenceNode("Header"),
|
|
@@ -69,9 +70,10 @@ export namespace SdkWebSocketNamespaceProgrammer {
|
|
|
69
70
|
undefined,
|
|
70
71
|
ts.factory.createTypeReferenceNode(
|
|
71
72
|
importer.external({
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
declaration: true,
|
|
74
|
+
file: "tgrid",
|
|
75
|
+
type: "element",
|
|
76
|
+
name: "Driver",
|
|
75
77
|
}),
|
|
76
78
|
[ts.factory.createTypeReferenceNode("Listener")],
|
|
77
79
|
),
|
|
@@ -107,9 +107,10 @@ export namespace SdkWebSocketRouteProgrammer {
|
|
|
107
107
|
local("connector")(
|
|
108
108
|
ts.factory.createTypeReferenceNode(
|
|
109
109
|
importer.external({
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
declaration: false,
|
|
111
|
+
file: "tgrid",
|
|
112
|
+
type: "element",
|
|
113
|
+
name: "WebSocketConnector",
|
|
113
114
|
}),
|
|
114
115
|
[
|
|
115
116
|
ts.factory.createTypeReferenceNode(`${route.name}.Header`),
|
|
@@ -121,9 +122,10 @@ export namespace SdkWebSocketRouteProgrammer {
|
|
|
121
122
|
ts.factory.createNewExpression(
|
|
122
123
|
ts.factory.createIdentifier(
|
|
123
124
|
importer.external({
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
declaration: false,
|
|
126
|
+
file: "tgrid",
|
|
127
|
+
type: "element",
|
|
128
|
+
name: "WebSocketConnector",
|
|
127
129
|
}),
|
|
128
130
|
),
|
|
129
131
|
undefined,
|
|
@@ -178,9 +180,10 @@ export namespace SdkWebSocketRouteProgrammer {
|
|
|
178
180
|
local("driver")(
|
|
179
181
|
ts.factory.createTypeReferenceNode(
|
|
180
182
|
importer.external({
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
declaration: true,
|
|
184
|
+
file: "tgrid",
|
|
185
|
+
type: "element",
|
|
186
|
+
name: "Driver",
|
|
184
187
|
}),
|
|
185
188
|
[ts.factory.createTypeReferenceNode(`${route.name}.Listener`)],
|
|
186
189
|
),
|
|
@@ -4,7 +4,7 @@ import { IJsDocTagInfo } from "typia";
|
|
|
4
4
|
import { IReflectHttpOperationException } from "./IReflectHttpOperationException";
|
|
5
5
|
import { IReflectHttpOperationParameter } from "./IReflectHttpOperationParameter";
|
|
6
6
|
import { IReflectHttpOperationSuccess } from "./IReflectHttpOperationSuccess";
|
|
7
|
-
import {
|
|
7
|
+
import { IReflectImport } from "./IReflectImport";
|
|
8
8
|
|
|
9
9
|
export interface IReflectHttpOperation {
|
|
10
10
|
protocol: "http";
|
|
@@ -18,7 +18,7 @@ export interface IReflectHttpOperation {
|
|
|
18
18
|
exceptions: Record<string, IReflectHttpOperationException>;
|
|
19
19
|
security: Record<string, string[]>[];
|
|
20
20
|
tags: string[];
|
|
21
|
-
imports:
|
|
21
|
+
imports: IReflectImport[];
|
|
22
22
|
operationId: string | undefined;
|
|
23
23
|
description: string | null;
|
|
24
24
|
jsDocTags: IJsDocTagInfo[];
|
|
@@ -42,18 +42,14 @@ export namespace IReflectHttpOperationParameter {
|
|
|
42
42
|
jsDocTags: IJsDocTagInfo[];
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
45
|
+
/** @internal */
|
|
48
46
|
export type IPreconfigured =
|
|
49
47
|
| IPreconfigured.IBody
|
|
50
48
|
| IPreconfigured.IHeaders
|
|
51
49
|
| IPreconfigured.IParam
|
|
52
50
|
| IPreconfigured.IQuery;
|
|
53
51
|
|
|
54
|
-
/**
|
|
55
|
-
* @internal
|
|
56
|
-
*/
|
|
52
|
+
/** @internal */
|
|
57
53
|
export namespace IPreconfigured {
|
|
58
54
|
export interface IBody extends IBase<"body"> {
|
|
59
55
|
field?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VERSION_NEUTRAL } from "@nestjs/common";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { IReflectImport } from "./IReflectImport";
|
|
5
5
|
import { IReflectWebSocketOperationParameter } from "./IReflectWebSocketOperationParameter";
|
|
6
6
|
|
|
7
7
|
export interface IReflectWebSocketOperation {
|
|
@@ -11,7 +11,7 @@ export interface IReflectWebSocketOperation {
|
|
|
11
11
|
function: Function;
|
|
12
12
|
versions: Array<string | typeof VERSION_NEUTRAL> | undefined;
|
|
13
13
|
parameters: IReflectWebSocketOperationParameter[];
|
|
14
|
-
imports:
|
|
14
|
+
imports: IReflectImport[];
|
|
15
15
|
description: string | null;
|
|
16
16
|
jsDocTags: ts.JSDocTagInfo[];
|
|
17
17
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IJsDocTagInfo } from "typia";
|
|
2
2
|
|
|
3
|
+
import { IReflectImport } from "./IReflectImport";
|
|
3
4
|
import { IReflectType } from "./IReflectType";
|
|
4
|
-
import { IReflectTypeImport } from "./IReflectTypeImport";
|
|
5
5
|
|
|
6
6
|
export type IReflectWebSocketOperationParameter =
|
|
7
7
|
| IReflectWebSocketOperationParameter.IAcceptor
|
|
@@ -22,14 +22,12 @@ export namespace IReflectWebSocketOperationParameter {
|
|
|
22
22
|
name: string;
|
|
23
23
|
index: number;
|
|
24
24
|
type: IReflectType;
|
|
25
|
-
imports:
|
|
25
|
+
imports: IReflectImport[];
|
|
26
26
|
description: string | null;
|
|
27
27
|
jsDocTags: IJsDocTagInfo[];
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
/**
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
30
|
+
/** @internal */
|
|
33
31
|
export interface IPreconfigured {
|
|
34
32
|
category: "acceptor" | "driver" | "header" | "param" | "query";
|
|
35
33
|
index: number;
|