@nestia/sdk 12.0.0-dev.20260612.2 → 12.0.0-dev.20260619.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.
Files changed (93) hide show
  1. package/assets/bundle/distribute/package.json +1 -1
  2. package/lib/factories/ExpressionFactory.d.ts +9 -0
  3. package/lib/factories/ExpressionFactory.js +16 -0
  4. package/lib/factories/ExpressionFactory.js.map +1 -0
  5. package/lib/factories/IdentifierFactory.d.ts +22 -0
  6. package/lib/factories/IdentifierFactory.js +50 -0
  7. package/lib/factories/IdentifierFactory.js.map +1 -0
  8. package/lib/factories/LiteralFactory.d.ts +9 -0
  9. package/lib/factories/LiteralFactory.js +48 -0
  10. package/lib/factories/LiteralFactory.js.map +1 -0
  11. package/lib/factories/StatementFactory.d.ts +14 -0
  12. package/lib/factories/StatementFactory.js +20 -0
  13. package/lib/factories/StatementFactory.js.map +1 -0
  14. package/lib/factories/TypeFactory.d.ts +24 -0
  15. package/lib/factories/TypeFactory.js +27 -0
  16. package/lib/factories/TypeFactory.js.map +1 -0
  17. package/lib/generates/CloneGenerator.js +2 -2
  18. package/lib/generates/CloneGenerator.js.map +1 -1
  19. package/lib/generates/internal/E2eFileProgrammer.js +30 -29
  20. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  21. package/lib/generates/internal/FilePrinter.d.ts +2 -2
  22. package/lib/generates/internal/FilePrinter.js +14 -25
  23. package/lib/generates/internal/FilePrinter.js.map +1 -1
  24. package/lib/generates/internal/ImportDictionary.d.ts +1 -1
  25. package/lib/generates/internal/ImportDictionary.js +10 -9
  26. package/lib/generates/internal/ImportDictionary.js.map +1 -1
  27. package/lib/generates/internal/SdkAliasCollection.d.ts +12 -12
  28. package/lib/generates/internal/SdkAliasCollection.js +23 -25
  29. package/lib/generates/internal/SdkAliasCollection.js.map +1 -1
  30. package/lib/generates/internal/SdkFileProgrammer.js +2 -2
  31. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  32. package/lib/generates/internal/SdkHttpCloneProgrammer.d.ts +1 -1
  33. package/lib/generates/internal/SdkHttpCloneProgrammer.js +3 -3
  34. package/lib/generates/internal/SdkHttpCloneProgrammer.js.map +1 -1
  35. package/lib/generates/internal/SdkHttpFunctionProgrammer.d.ts +1 -1
  36. package/lib/generates/internal/SdkHttpFunctionProgrammer.js +45 -48
  37. package/lib/generates/internal/SdkHttpFunctionProgrammer.js.map +1 -1
  38. package/lib/generates/internal/SdkHttpNamespaceProgrammer.d.ts +1 -1
  39. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js +61 -60
  40. package/lib/generates/internal/SdkHttpNamespaceProgrammer.js.map +1 -1
  41. package/lib/generates/internal/SdkHttpParameterProgrammer.d.ts +2 -2
  42. package/lib/generates/internal/SdkHttpParameterProgrammer.js +11 -13
  43. package/lib/generates/internal/SdkHttpParameterProgrammer.js.map +1 -1
  44. package/lib/generates/internal/SdkHttpRouteProgrammer.d.ts +1 -1
  45. package/lib/generates/internal/SdkHttpSimulationProgrammer.d.ts +1 -1
  46. package/lib/generates/internal/SdkHttpSimulationProgrammer.js +50 -48
  47. package/lib/generates/internal/SdkHttpSimulationProgrammer.js.map +1 -1
  48. package/lib/generates/internal/SdkMcpRouteProgrammer.d.ts +1 -1
  49. package/lib/generates/internal/SdkMcpRouteProgrammer.js +54 -53
  50. package/lib/generates/internal/SdkMcpRouteProgrammer.js.map +1 -1
  51. package/lib/generates/internal/SdkTypeProgrammer.d.ts +3 -3
  52. package/lib/generates/internal/SdkTypeProgrammer.js +42 -43
  53. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -1
  54. package/lib/generates/internal/SdkTypeTagProgrammer.d.ts +2 -1
  55. package/lib/generates/internal/SdkTypeTagProgrammer.js +7 -9
  56. package/lib/generates/internal/SdkTypeTagProgrammer.js.map +1 -1
  57. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.d.ts +2 -2
  58. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js +45 -47
  59. package/lib/generates/internal/SdkWebSocketNamespaceProgrammer.js.map +1 -1
  60. package/lib/generates/internal/SdkWebSocketParameterProgrammer.d.ts +3 -3
  61. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js +9 -9
  62. package/lib/generates/internal/SdkWebSocketParameterProgrammer.js.map +1 -1
  63. package/lib/generates/internal/SdkWebSocketRouteProgrammer.d.ts +2 -2
  64. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js +34 -40
  65. package/lib/generates/internal/SdkWebSocketRouteProgrammer.js.map +1 -1
  66. package/lib/transform.d.ts +5 -9
  67. package/lib/transform.js +8 -31
  68. package/lib/transform.js.map +1 -1
  69. package/package.json +11 -11
  70. package/src/factories/ExpressionFactory.ts +23 -0
  71. package/src/factories/IdentifierFactory.ts +84 -0
  72. package/src/factories/LiteralFactory.ts +54 -0
  73. package/src/factories/StatementFactory.ts +56 -0
  74. package/src/factories/TypeFactory.ts +27 -0
  75. package/src/generates/CloneGenerator.ts +8 -7
  76. package/src/generates/internal/E2eFileProgrammer.ts +59 -53
  77. package/src/generates/internal/FilePrinter.ts +28 -36
  78. package/src/generates/internal/ImportDictionary.ts +19 -21
  79. package/src/generates/internal/SdkAliasCollection.ts +55 -49
  80. package/src/generates/internal/SdkFileProgrammer.ts +4 -7
  81. package/src/generates/internal/SdkHttpCloneProgrammer.ts +11 -13
  82. package/src/generates/internal/SdkHttpFunctionProgrammer.ts +90 -101
  83. package/src/generates/internal/SdkHttpNamespaceProgrammer.ts +153 -166
  84. package/src/generates/internal/SdkHttpParameterProgrammer.ts +15 -17
  85. package/src/generates/internal/SdkHttpRouteProgrammer.ts +1 -1
  86. package/src/generates/internal/SdkHttpSimulationProgrammer.ts +121 -130
  87. package/src/generates/internal/SdkMcpRouteProgrammer.ts +135 -140
  88. package/src/generates/internal/SdkTypeProgrammer.ts +389 -382
  89. package/src/generates/internal/SdkTypeTagProgrammer.ts +13 -17
  90. package/src/generates/internal/SdkWebSocketNamespaceProgrammer.ts +124 -130
  91. package/src/generates/internal/SdkWebSocketParameterProgrammer.ts +17 -15
  92. package/src/generates/internal/SdkWebSocketRouteProgrammer.ts +112 -139
  93. package/src/transform.ts +14 -45
@@ -1,55 +1,47 @@
1
1
  import {
2
- Node,
2
+ type Node,
3
+ type Statement,
3
4
  SyntaxKind,
4
- TypeScriptFactory,
5
- TypeScriptPrinter,
6
- } from "@nestia/factory";
5
+ TsPrinter,
6
+ addSyntheticLeadingComment,
7
+ factory,
8
+ } from "@ttsc/factory";
7
9
  import fs from "fs";
8
10
  import { format } from "prettier";
9
11
 
10
12
  export namespace FilePrinter {
11
- export const description = <T extends Node>(
12
- node: T,
13
- comment: string,
14
- ): T => {
13
+ export const description = <T extends Node>(node: T, comment: string): T => {
15
14
  if (comment.length === 0) return node;
16
- node.emitNode ??= {};
17
- node.emitNode.leadingComments = [
18
- ...(node.emitNode.leadingComments ?? []),
19
- {
20
- kind: SyntaxKind.MultiLineCommentTrivia,
21
- text: [
22
- "*",
23
- ...comment
24
- .split("\r\n")
25
- .join("\n")
26
- .split("\n")
27
- .map(
28
- (str) =>
29
- ` * ${str.split("*/").join("*\\\\/").split("*\\/").join("*\\\\/")}`,
30
- ),
31
- "",
32
- ].join("\n"),
33
- hasTrailingNewLine: true,
34
- },
35
- ];
36
- return node;
15
+ return addSyntheticLeadingComment(
16
+ node,
17
+ SyntaxKind.MultiLineCommentTrivia,
18
+ [
19
+ "*",
20
+ ...comment
21
+ .split("\r\n")
22
+ .join("\n")
23
+ .split("\n")
24
+ .map(
25
+ (str) =>
26
+ ` * ${str.split("*/").join("*\\\\/").split("*\\/").join("*\\\\/")}`,
27
+ ),
28
+ "",
29
+ ].join("\n"),
30
+ true,
31
+ );
37
32
  };
38
33
 
39
34
  export const enter = () =>
40
- TypeScriptFactory.createExpressionStatement(
41
- TypeScriptFactory.createIdentifier("\n"),
42
- );
35
+ factory.createExpressionStatement(factory.createIdentifier("\n"));
43
36
 
44
37
  export const write = async (props: {
45
38
  location: string;
46
39
  statements: Node[];
47
40
  top?: string;
48
41
  }): Promise<void> => {
49
- const script: string = TypeScriptPrinter.write({
50
- statements: props.statements,
51
- top: props.top,
52
- });
42
+ const script: string =
43
+ (props.top ?? "") +
44
+ new TsPrinter().printFile(undefined, props.statements as Statement[]);
53
45
  await fs.promises.writeFile(props.location, await beautify(script), "utf8");
54
46
  };
55
47
 
@@ -1,4 +1,4 @@
1
- import { Node, TypeScriptFactory } from "@nestia/factory";
1
+ import { type ImportClause, type Node, factory } from "@ttsc/factory";
2
2
  import path from "path";
3
3
  import { HashMap, TreeMap, hash } from "tstl";
4
4
 
@@ -109,11 +109,10 @@ export class ImportDictionary {
109
109
  .sort((a, b) => a.file.localeCompare(b.file));
110
110
  for (const c of compositions)
111
111
  container.push(
112
- TypeScriptFactory.createImportDeclaration(
112
+ factory.createImportDeclaration(
113
113
  undefined,
114
114
  this.toImportClaude(c),
115
- TypeScriptFactory.createStringLiteral(c.file),
116
- undefined,
115
+ factory.createStringLiteral(c.file),
117
116
  ),
118
117
  );
119
118
  };
@@ -127,29 +126,28 @@ export class ImportDictionary {
127
126
  ];
128
127
  }
129
128
 
130
- private toImportClaude(c: ICompositeValue): Node {
129
+ private toImportClaude(c: ICompositeValue): ImportClause {
130
+ // A namespace import cannot carry a per-binding `type` modifier, so the
131
+ // type-only flag stays off here (a value namespace import resolves type
132
+ // members fine), matching the legacy printer output `import * as X`.
131
133
  if (c.asterisk !== null)
132
- return TypeScriptFactory.createImportClause(
133
- c.declaration,
134
+ return factory.createImportClause(
135
+ false,
134
136
  undefined,
135
- TypeScriptFactory.createNamespaceImport(
136
- TypeScriptFactory.createIdentifier(c.asterisk),
137
- ),
137
+ factory.createNamespaceImport(factory.createIdentifier(c.asterisk)),
138
138
  );
139
- return TypeScriptFactory.createImportClause(
139
+ // `c.declaration` (type-only) belongs on the import clause, not on each
140
+ // specifier — emitting both produces the invalid `import type { type X }`.
141
+ return factory.createImportClause(
140
142
  c.declaration,
141
- c.default !== null
142
- ? TypeScriptFactory.createIdentifier(c.default)
143
- : undefined,
143
+ c.default !== null ? factory.createIdentifier(c.default) : undefined,
144
144
  c.elements.size() !== 0
145
- ? TypeScriptFactory.createNamedImports(
145
+ ? factory.createNamedImports(
146
146
  Array.from(c.elements).map(({ first: name, second: alias }) =>
147
- TypeScriptFactory.createImportSpecifier(
148
- c.declaration,
149
- alias !== null
150
- ? TypeScriptFactory.createIdentifier(name)
151
- : undefined,
152
- TypeScriptFactory.createIdentifier(alias ?? name),
147
+ factory.createImportSpecifier(
148
+ false,
149
+ alias !== null ? factory.createIdentifier(name) : undefined,
150
+ factory.createIdentifier(alias ?? name),
153
151
  ),
154
152
  ),
155
153
  )
@@ -1,6 +1,11 @@
1
- import { Node, SyntaxKind, TypeScriptFactory } from "@nestia/factory";
2
- import { TypeFactory } from "@nestia/factory";
1
+ import {
2
+ SyntaxKind,
3
+ type TypeElement,
4
+ type TypeNode,
5
+ factory,
6
+ } from "@ttsc/factory";
3
7
 
8
+ import { TypeFactory } from "../../factories/TypeFactory";
4
9
  import { MetadataSchema, sizeOf } from "../../internal/legacy";
5
10
  import { INestiaProject } from "../../structures/INestiaProject";
6
11
  import { IReflectType } from "../../structures/IReflectType";
@@ -13,35 +18,33 @@ import { SdkHttpParameterProgrammer } from "./SdkHttpParameterProgrammer";
13
18
  import { SdkTypeProgrammer } from "./SdkTypeProgrammer";
14
19
 
15
20
  export namespace SdkAliasCollection {
16
- export const name = ({ type }: { type: IReflectType }): Node =>
17
- TypeScriptFactory.createTypeReferenceNode(
21
+ export const name = ({ type }: { type: IReflectType }): TypeNode =>
22
+ factory.createTypeReferenceNode(
18
23
  type.name,
19
24
  type.typeArguments
20
25
  ? type.typeArguments.map((a) => name({ type: a }))
21
26
  : undefined,
22
27
  );
23
28
 
24
- export const binaryChunk = (): Node =>
25
- TypeScriptFactory.createTypeReferenceNode("Uint8Array", [
26
- TypeScriptFactory.createTypeReferenceNode("ArrayBufferLike"),
29
+ export const binaryChunk = (): TypeNode =>
30
+ factory.createTypeReferenceNode("Uint8Array", [
31
+ factory.createTypeReferenceNode("ArrayBufferLike"),
27
32
  ]);
28
33
 
29
- export const binaryResponse = (): Node =>
30
- TypeScriptFactory.createTypeReferenceNode("ReadableStream", [
31
- binaryChunk(),
32
- ]);
34
+ export const binaryResponse = (): TypeNode =>
35
+ factory.createTypeReferenceNode("ReadableStream", [binaryChunk()]);
33
36
 
34
37
  export const from =
35
38
  (project: INestiaProject) =>
36
39
  (importer: ImportDictionary) =>
37
- (metadata: MetadataSchema) =>
38
- SdkTypeProgrammer.write(project)(importer)(metadata);
40
+ (metadata: MetadataSchema): TypeNode =>
41
+ SdkTypeProgrammer.write(project)(importer)(metadata) as TypeNode;
39
42
 
40
43
  export const httpProps =
41
44
  (project: INestiaProject) =>
42
45
  (importer: ImportDictionary) =>
43
- (route: ITypedHttpRoute): Node =>
44
- TypeScriptFactory.createTypeLiteralNode(
46
+ (route: ITypedHttpRoute): TypeNode =>
47
+ factory.createTypeLiteralNode(
45
48
  SdkHttpParameterProgrammer.getEntries({
46
49
  project,
47
50
  importer,
@@ -50,12 +53,12 @@ export namespace SdkAliasCollection {
50
53
  prefix: false,
51
54
  })
52
55
  .map((e) => {
53
- const signature: Node = TypeScriptFactory.createPropertySignature(
56
+ const signature: TypeElement = factory.createPropertySignature(
54
57
  undefined,
55
58
  e.key,
56
59
  e.required
57
60
  ? undefined
58
- : TypeScriptFactory.createToken(SyntaxKind.QuestionToken),
61
+ : factory.createToken(SyntaxKind.QuestionToken),
59
62
  e.type,
60
63
  );
61
64
  const description: string | null =
@@ -71,7 +74,7 @@ export namespace SdkAliasCollection {
71
74
  null;
72
75
  return description?.length
73
76
  ? [
74
- TypeScriptFactory.createIdentifier("\n") as any,
77
+ factory.createIdentifier("\n") as any,
75
78
  FilePrinter.description(signature, description),
76
79
  ]
77
80
  : [signature];
@@ -79,10 +82,10 @@ export namespace SdkAliasCollection {
79
82
  .flat(),
80
83
  );
81
84
 
82
- export const websocketProps = (route: ITypedWebSocketRoute): Node =>
83
- TypeScriptFactory.createTypeLiteralNode([
85
+ export const websocketProps = (route: ITypedWebSocketRoute): TypeNode =>
86
+ factory.createTypeLiteralNode([
84
87
  ...route.pathParameters.map((p) =>
85
- TypeScriptFactory.createPropertySignature(
88
+ factory.createPropertySignature(
86
89
  undefined,
87
90
  p.name,
88
91
  undefined,
@@ -91,31 +94,31 @@ export namespace SdkAliasCollection {
91
94
  ),
92
95
  ...(route.query
93
96
  ? [
94
- TypeScriptFactory.createPropertySignature(
97
+ factory.createPropertySignature(
95
98
  undefined,
96
99
  "query",
97
100
  undefined,
98
- TypeScriptFactory.createTypeReferenceNode("Query"),
101
+ factory.createTypeReferenceNode("Query"),
99
102
  ),
100
103
  ]
101
104
  : []),
102
- TypeScriptFactory.createPropertySignature(
105
+ factory.createPropertySignature(
103
106
  undefined,
104
107
  "provider",
105
108
  undefined,
106
- TypeScriptFactory.createTypeReferenceNode("Provider"),
109
+ factory.createTypeReferenceNode("Provider"),
107
110
  ),
108
111
  ]);
109
112
 
110
113
  export const headers =
111
114
  (project: INestiaProject) =>
112
115
  (importer: ImportDictionary) =>
113
- (param: ITypedHttpRouteParameter.IHeaders): Node => {
116
+ (param: ITypedHttpRouteParameter.IHeaders): TypeNode => {
114
117
  if (project.config.clone === true)
115
118
  return from(project)(importer)(param.metadata);
116
- const type: Node = name(param);
119
+ const type: TypeNode = name(param);
117
120
  if (project.config.primitive === false) return type;
118
- return TypeScriptFactory.createTypeReferenceNode(
121
+ return factory.createTypeReferenceNode(
119
122
  importer.external({
120
123
  file: "typia",
121
124
  declaration: true,
@@ -129,12 +132,12 @@ export namespace SdkAliasCollection {
129
132
  export const query =
130
133
  (project: INestiaProject) =>
131
134
  (importer: ImportDictionary) =>
132
- (param: ITypedHttpRouteParameter.IQuery): Node => {
135
+ (param: ITypedHttpRouteParameter.IQuery): TypeNode => {
133
136
  if (project.config.clone === true)
134
137
  return from(project)(importer)(param.metadata);
135
- const type: Node = name(param);
138
+ const type: TypeNode = name(param);
136
139
  if (project.config.primitive === false) return type;
137
- return TypeScriptFactory.createTypeReferenceNode(
140
+ return factory.createTypeReferenceNode(
138
141
  importer.external({
139
142
  file: "typia",
140
143
  declaration: true,
@@ -148,18 +151,18 @@ export namespace SdkAliasCollection {
148
151
  export const body =
149
152
  (project: INestiaProject) =>
150
153
  (importer: ImportDictionary) =>
151
- (param: ITypedHttpRouteParameter.IBody): Node => {
154
+ (param: ITypedHttpRouteParameter.IBody): TypeNode => {
152
155
  if (project.config.clone === true) {
153
- const type: Node = from(project)(importer)(param.metadata);
156
+ const type: TypeNode = from(project)(importer)(param.metadata);
154
157
  return param.contentType === "multipart/form-data"
155
158
  ? formDataInput(importer)(type)
156
159
  : type;
157
160
  }
158
- const type: Node = name(param);
161
+ const type: TypeNode = name(param);
159
162
  if (param.contentType === "multipart/form-data")
160
163
  return formDataInput(importer)(type);
161
164
  else if (project.config.primitive === false) return type;
162
- return TypeScriptFactory.createTypeReferenceNode(
165
+ return factory.createTypeReferenceNode(
163
166
  importer.external({
164
167
  file: "typia",
165
168
  declaration: true,
@@ -176,14 +179,17 @@ export namespace SdkAliasCollection {
176
179
  export const response =
177
180
  (project: INestiaProject) =>
178
181
  (importer: ImportDictionary) =>
179
- (route: ITypedHttpRoute): Node => {
180
- const schema = (p: { metadata: MetadataSchema; type: IReflectType }) =>
182
+ (route: ITypedHttpRoute): TypeNode => {
183
+ const schema = (p: {
184
+ metadata: MetadataSchema;
185
+ type: IReflectType;
186
+ }): TypeNode =>
181
187
  sizeOf(p.metadata) === 0
182
188
  ? TypeFactory.keyword("void")
183
189
  : project.config.clone === true
184
190
  ? from(project)(importer)(p.metadata)
185
191
  : project.config.primitive !== false
186
- ? TypeScriptFactory.createTypeReferenceNode(
192
+ ? factory.createTypeReferenceNode(
187
193
  importer.external({
188
194
  file: "typia",
189
195
  declaration: true,
@@ -197,7 +203,7 @@ export namespace SdkAliasCollection {
197
203
  [name(p)],
198
204
  )
199
205
  : name(p);
200
- const success: Node =
206
+ const success: TypeNode =
201
207
  route.success.binary === true
202
208
  ? binaryResponse()
203
209
  : schema(route.success);
@@ -215,7 +221,7 @@ export namespace SdkAliasCollection {
215
221
  type: schema(value),
216
222
  })),
217
223
  ];
218
- return TypeScriptFactory.createTypeReferenceNode(
224
+ return factory.createTypeReferenceNode(
219
225
  importer.external({
220
226
  file: "@nestia/fetcher",
221
227
  declaration: true,
@@ -223,11 +229,11 @@ export namespace SdkAliasCollection {
223
229
  name: "IPropagation",
224
230
  }),
225
231
  [
226
- TypeScriptFactory.createTypeLiteralNode(
232
+ factory.createTypeLiteralNode(
227
233
  branches.map((b) =>
228
- TypeScriptFactory.createPropertySignature(
234
+ factory.createPropertySignature(
229
235
  undefined,
230
- TypeScriptFactory.createNumericLiteral(b.status),
236
+ factory.createNumericLiteral(b.status),
231
237
  undefined,
232
238
  b.type,
233
239
  ),
@@ -235,8 +241,8 @@ export namespace SdkAliasCollection {
235
241
  ),
236
242
  ...(route.success.status
237
243
  ? [
238
- TypeScriptFactory.createLiteralTypeNode(
239
- TypeScriptFactory.createNumericLiteral(route.success.status),
244
+ factory.createLiteralTypeNode(
245
+ factory.createNumericLiteral(route.success.status),
240
246
  ),
241
247
  ]
242
248
  : []),
@@ -247,7 +253,7 @@ export namespace SdkAliasCollection {
247
253
  export const responseBody =
248
254
  (project: INestiaProject) =>
249
255
  (importer: ImportDictionary) =>
250
- (route: ITypedHttpRoute): Node =>
256
+ (route: ITypedHttpRoute): TypeNode =>
251
257
  response({
252
258
  ...project,
253
259
  config: {
@@ -256,8 +262,8 @@ export namespace SdkAliasCollection {
256
262
  },
257
263
  })(importer)(route);
258
264
 
259
- const formDataInput = (importer: ImportDictionary) => (type: Node) =>
260
- TypeScriptFactory.createTypeReferenceNode(
265
+ const formDataInput = (importer: ImportDictionary) => (type: TypeNode) =>
266
+ factory.createTypeReferenceNode(
261
267
  importer.external({
262
268
  file: "@nestia/fetcher",
263
269
  declaration: true,
@@ -270,5 +276,5 @@ export namespace SdkAliasCollection {
270
276
 
271
277
  interface IBranch {
272
278
  status: string;
273
- type: Node;
279
+ type: TypeNode;
274
280
  }
@@ -1,4 +1,4 @@
1
- import { Node, TypeScriptFactory } from "@nestia/factory";
1
+ import { type Node, factory } from "@ttsc/factory";
2
2
  import fs from "fs";
3
3
 
4
4
  import { INestiaProject } from "../../structures/INestiaProject";
@@ -60,14 +60,11 @@ export namespace SdkFileProgrammer {
60
60
  for (const [key, value] of directory.children) {
61
61
  await iterate(project)(value)(`${outDir}/${key}`);
62
62
  statements.push(
63
- TypeScriptFactory.createExportDeclaration(
63
+ factory.createExportDeclaration(
64
64
  undefined,
65
65
  false,
66
- TypeScriptFactory.createNamespaceExport(
67
- TypeScriptFactory.createIdentifier(key),
68
- ),
69
- TypeScriptFactory.createStringLiteral(`./${key}/index`),
70
- undefined,
66
+ factory.createNamespaceExport(factory.createIdentifier(key)),
67
+ factory.createStringLiteral(`./${key}/index`),
71
68
  ),
72
69
  );
73
70
  }
@@ -1,12 +1,12 @@
1
- import { Node, SyntaxKind, TypeScriptFactory } from "@nestia/factory";
1
+ import { type Node, SyntaxKind, type TypeNode, factory } from "@ttsc/factory";
2
+ import { IPointer } from "tstl";
3
+ import { IJsDocTagInfo } from "typia";
4
+
2
5
  import {
3
6
  MetadataAliasType,
4
7
  MetadataAtomic,
5
8
  MetadataObjectType,
6
9
  } from "../../internal/legacy";
7
- import { IPointer } from "tstl";
8
- import { IJsDocTagInfo } from "typia";
9
-
10
10
  import { INestiaProject } from "../../structures/INestiaProject";
11
11
  import { ITypedApplication } from "../../structures/ITypedApplication";
12
12
  import { MapUtil } from "../../utils/MapUtil";
@@ -19,9 +19,7 @@ export namespace SdkHttpCloneProgrammer {
19
19
  export interface IModule {
20
20
  name: string;
21
21
  children: Map<string, IModule>;
22
- programmer:
23
- | null
24
- | ((importer: ImportDictionary) => Node);
22
+ programmer: null | ((importer: ImportDictionary) => Node);
25
23
  }
26
24
 
27
25
  export const write = (app: ITypedApplication): Map<string, IModule> => {
@@ -71,11 +69,11 @@ export namespace SdkHttpCloneProgrammer {
71
69
  (importer: ImportDictionary) =>
72
70
  (alias: MetadataAliasType): Node =>
73
71
  FilePrinter.description(
74
- TypeScriptFactory.createTypeAliasDeclaration(
75
- [TypeScriptFactory.createToken(SyntaxKind.ExportKeyword)],
72
+ factory.createTypeAliasDeclaration(
73
+ [factory.createToken(SyntaxKind.ExportKeyword)],
76
74
  alias.name.split(".").at(-1)!,
77
75
  [],
78
- SdkTypeProgrammer.write(project)(importer)(alias.value),
76
+ SdkTypeProgrammer.write(project)(importer)(alias.value) as TypeNode,
79
77
  ),
80
78
  writeComment([])(alias.description, alias.jsDocTags),
81
79
  );
@@ -85,11 +83,11 @@ export namespace SdkHttpCloneProgrammer {
85
83
  (importer: ImportDictionary) =>
86
84
  (object: MetadataObjectType): Node => {
87
85
  return FilePrinter.description(
88
- TypeScriptFactory.createTypeAliasDeclaration(
89
- [TypeScriptFactory.createToken(SyntaxKind.ExportKeyword)],
86
+ factory.createTypeAliasDeclaration(
87
+ [factory.createToken(SyntaxKind.ExportKeyword)],
90
88
  object.name.split(".").at(-1)!,
91
89
  [],
92
- SdkTypeProgrammer.write_object(project)(importer)(object),
90
+ SdkTypeProgrammer.write_object(project)(importer)(object) as TypeNode,
93
91
  ),
94
92
  writeComment([])(object.description ?? null, object.jsDocTags),
95
93
  );