@kurotako/gen-typescript 0.1.0
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/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/dist/index.cjs +895 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +73 -0
- package/dist/index.d.ts +73 -0
- package/dist/index.js +863 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,895 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
TypeScriptAliasCycleError: () => TypeScriptAliasCycleError,
|
|
24
|
+
TypeScriptAliasPublicNameCollisionError: () => TypeScriptAliasPublicNameCollisionError,
|
|
25
|
+
TypeScriptEnumCollisionError: () => TypeScriptEnumCollisionError,
|
|
26
|
+
TypeScriptEnumPublicNameCollisionError: () => TypeScriptEnumPublicNameCollisionError,
|
|
27
|
+
TypeScriptGenError: () => TypeScriptGenError,
|
|
28
|
+
typescriptGenerator: () => typescriptGenerator
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
|
+
|
|
32
|
+
// src/errors.ts
|
|
33
|
+
var TypeScriptGenError = class extends Error {
|
|
34
|
+
code;
|
|
35
|
+
constructor(code, message, options) {
|
|
36
|
+
super(message, options);
|
|
37
|
+
this.name = new.target.name;
|
|
38
|
+
this.code = code;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var TypeScriptAliasCycleError = class extends TypeScriptGenError {
|
|
42
|
+
namespace;
|
|
43
|
+
aliasNames;
|
|
44
|
+
constructor(namespace, aliasNames) {
|
|
45
|
+
const sortedNames = [...aliasNames].sort(
|
|
46
|
+
(left, right) => left.localeCompare(right)
|
|
47
|
+
);
|
|
48
|
+
super(
|
|
49
|
+
"typescript_alias_cycle",
|
|
50
|
+
`source type aliases ${sortedNames.map((name) => `'${name}'`).join(", ")} form a direct reference cycle in namespace '${namespace}'; pure TypeScript aliases cannot represent it`
|
|
51
|
+
);
|
|
52
|
+
this.namespace = namespace;
|
|
53
|
+
this.aliasNames = sortedNames;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var TypeScriptAliasPublicNameCollisionError = class extends TypeScriptGenError {
|
|
57
|
+
namespace;
|
|
58
|
+
names;
|
|
59
|
+
constructor(namespace, names) {
|
|
60
|
+
const sortedNames = [...names].sort(
|
|
61
|
+
(left, right) => left.localeCompare(right)
|
|
62
|
+
);
|
|
63
|
+
super(
|
|
64
|
+
"typescript_alias_public_name_collision",
|
|
65
|
+
`source type aliases ${sortedNames.map((name) => `'${name}'`).join(", ")} collide with generated public identifiers in namespace '${namespace}'; rename one of the conflicting source definitions`
|
|
66
|
+
);
|
|
67
|
+
this.namespace = namespace;
|
|
68
|
+
this.names = sortedNames;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var TypeScriptEnumPublicNameCollisionError = class extends TypeScriptGenError {
|
|
72
|
+
namespace;
|
|
73
|
+
names;
|
|
74
|
+
constructor(namespace, names) {
|
|
75
|
+
const sortedNames = [...names].sort(
|
|
76
|
+
(left, right) => left.localeCompare(right)
|
|
77
|
+
);
|
|
78
|
+
super(
|
|
79
|
+
"typescript_enum_public_name_collision",
|
|
80
|
+
`source enums ${sortedNames.map((name) => `'${name}'`).join(", ")} collide with other public identifiers in namespace '${namespace}'; rename one of the conflicting source definitions`
|
|
81
|
+
);
|
|
82
|
+
this.namespace = namespace;
|
|
83
|
+
this.names = sortedNames;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var TypeScriptEnumCollisionError = class extends TypeScriptGenError {
|
|
87
|
+
enumName;
|
|
88
|
+
firstOrigin;
|
|
89
|
+
secondOrigin;
|
|
90
|
+
constructor(enumName, firstOrigin, secondOrigin) {
|
|
91
|
+
super(
|
|
92
|
+
"typescript_enum_collision",
|
|
93
|
+
`enum '${enumName}' is defined twice with different values (${firstOrigin} vs ${secondOrigin}); rename one of them in the source schema`
|
|
94
|
+
);
|
|
95
|
+
this.enumName = enumName;
|
|
96
|
+
this.firstOrigin = firstOrigin;
|
|
97
|
+
this.secondOrigin = secondOrigin;
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// src/generator.ts
|
|
102
|
+
var import_config = require("@kurotako/config");
|
|
103
|
+
|
|
104
|
+
// src/artifact.ts
|
|
105
|
+
var import_ir = require("@kurotako/ir");
|
|
106
|
+
|
|
107
|
+
// src/names.ts
|
|
108
|
+
var VARIANTS = [
|
|
109
|
+
"full",
|
|
110
|
+
"create",
|
|
111
|
+
"update",
|
|
112
|
+
"where",
|
|
113
|
+
"select"
|
|
114
|
+
];
|
|
115
|
+
var FAMILIES = ["flat", "deep"];
|
|
116
|
+
var VARIANT_TOKEN = {
|
|
117
|
+
full: "",
|
|
118
|
+
create: "Create",
|
|
119
|
+
update: "Update",
|
|
120
|
+
where: "Where",
|
|
121
|
+
select: "Select"
|
|
122
|
+
};
|
|
123
|
+
var FAMILY_TOKEN = {
|
|
124
|
+
flat: "",
|
|
125
|
+
deep: "Deep"
|
|
126
|
+
};
|
|
127
|
+
function typeName(entity, variant = "", family = "") {
|
|
128
|
+
return `${entity}${variant}${family}Dto`;
|
|
129
|
+
}
|
|
130
|
+
function enumConst(name) {
|
|
131
|
+
return name;
|
|
132
|
+
}
|
|
133
|
+
function enumTypeName(name) {
|
|
134
|
+
return name;
|
|
135
|
+
}
|
|
136
|
+
function entityModule(namespace, entity) {
|
|
137
|
+
return `${namespace}/typescript/${entity}.type`;
|
|
138
|
+
}
|
|
139
|
+
function enumsModule(namespace) {
|
|
140
|
+
return `${namespace}/typescript/enums`;
|
|
141
|
+
}
|
|
142
|
+
function filtersModule(namespace) {
|
|
143
|
+
return `${namespace}/typescript/filters`;
|
|
144
|
+
}
|
|
145
|
+
function scalarsModule(namespace) {
|
|
146
|
+
return `${namespace}/typescript/scalars`;
|
|
147
|
+
}
|
|
148
|
+
function barrelModule(namespace) {
|
|
149
|
+
return `${namespace}/typescript`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// src/emit/enums.ts
|
|
153
|
+
function sameValues(a, b) {
|
|
154
|
+
const left = a.values.map((value) => value.name);
|
|
155
|
+
const right = b.values.map((value) => value.name);
|
|
156
|
+
return left.length === right.length && left.every((value, i) => value === right[i]);
|
|
157
|
+
}
|
|
158
|
+
function collectEnums(source) {
|
|
159
|
+
const byName = /* @__PURE__ */ new Map();
|
|
160
|
+
const add = (definition, origin) => {
|
|
161
|
+
const previous = byName.get(definition.name);
|
|
162
|
+
if (previous === void 0) {
|
|
163
|
+
byName.set(definition.name, { definition, origin });
|
|
164
|
+
} else if (!sameValues(previous.definition, definition)) {
|
|
165
|
+
throw new TypeScriptEnumCollisionError(
|
|
166
|
+
definition.name,
|
|
167
|
+
previous.origin,
|
|
168
|
+
origin
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
for (const definition of Object.values(source.enums))
|
|
173
|
+
add(definition, "source-level");
|
|
174
|
+
for (const entity of Object.values(source.entities)) {
|
|
175
|
+
for (const definition of Object.values(entity.enums ?? {})) {
|
|
176
|
+
add(definition, `entity '${entity.name}'`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return [...byName.values()].map(({ definition }) => definition).sort((left, right) => left.name.localeCompare(right.name));
|
|
180
|
+
}
|
|
181
|
+
function emitEnums(source) {
|
|
182
|
+
const blocks = collectEnums(source).map((definition) => {
|
|
183
|
+
const values = definition.values.map((value) => JSON.stringify(value.name)).join(", ");
|
|
184
|
+
const name = enumConst(definition.name);
|
|
185
|
+
return `export const ${name} = [${values}] as const;
|
|
186
|
+
export type ${enumTypeName(definition.name)} = (typeof ${name})[number];`;
|
|
187
|
+
});
|
|
188
|
+
return blocks.length === 0 ? "export {};\n" : `${blocks.join("\n\n")}
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// src/artifact.ts
|
|
193
|
+
function roleStem(variant, family) {
|
|
194
|
+
const variantStem = variant === "full" ? "" : variant;
|
|
195
|
+
return family === "flat" ? variantStem : variantStem === "" ? "deep" : `${variantStem}Deep`;
|
|
196
|
+
}
|
|
197
|
+
function entitySymbols(name) {
|
|
198
|
+
const symbols = {};
|
|
199
|
+
for (const variant of VARIANTS) {
|
|
200
|
+
for (const family of FAMILIES) {
|
|
201
|
+
const stem = roleStem(variant, family);
|
|
202
|
+
const key = stem === "" ? "type" : `${stem}Type`;
|
|
203
|
+
symbols[key] = typeName(
|
|
204
|
+
name,
|
|
205
|
+
VARIANT_TOKEN[variant],
|
|
206
|
+
FAMILY_TOKEN[family]
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return symbols;
|
|
211
|
+
}
|
|
212
|
+
function buildArtifact(ir) {
|
|
213
|
+
const entities = {};
|
|
214
|
+
for (const { namespace, entity } of (0, import_ir.iterEntities)(ir)) {
|
|
215
|
+
entities[`${namespace}.${entity.name}`] = {
|
|
216
|
+
module: entityModule(namespace, entity.name),
|
|
217
|
+
symbols: entitySymbols(entity.name)
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
const perNamespace = {};
|
|
221
|
+
for (const [namespace, source] of Object.entries(ir.sources)) {
|
|
222
|
+
const enums = {};
|
|
223
|
+
for (const definition of collectEnums(source)) {
|
|
224
|
+
enums[definition.name] = {
|
|
225
|
+
constName: enumConst(definition.name),
|
|
226
|
+
typeName: enumTypeName(definition.name),
|
|
227
|
+
module: enumsModule(namespace)
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
perNamespace[namespace] = {
|
|
231
|
+
barrelModule: barrelModule(namespace),
|
|
232
|
+
filtersModule: filtersModule(namespace),
|
|
233
|
+
scalarsModule: scalarsModule(namespace),
|
|
234
|
+
enums
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
entities,
|
|
239
|
+
extra: {
|
|
240
|
+
families: ["flat", "deep"],
|
|
241
|
+
variants: ["full", "create", "update", "where", "select"],
|
|
242
|
+
perNamespace
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// src/render/scalars.ts
|
|
248
|
+
var import_ir2 = require("@kurotako/ir");
|
|
249
|
+
function emptyDependencies() {
|
|
250
|
+
return {
|
|
251
|
+
enums: /* @__PURE__ */ new Set(),
|
|
252
|
+
entityRefs: /* @__PURE__ */ new Set(),
|
|
253
|
+
aliases: /* @__PURE__ */ new Set(),
|
|
254
|
+
usesJsonValue: false
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function collectTypeDependencies(type, source, entity, into = emptyDependencies()) {
|
|
258
|
+
switch (type.kind) {
|
|
259
|
+
case "enum": {
|
|
260
|
+
const definition = (0, import_ir2.resolveEnum)(source, entity, type.ref);
|
|
261
|
+
into.enums.add(definition?.name ?? type.ref);
|
|
262
|
+
break;
|
|
263
|
+
}
|
|
264
|
+
case "ref":
|
|
265
|
+
if (source.entities[type.ref] !== void 0) {
|
|
266
|
+
into.entityRefs.add(type.ref);
|
|
267
|
+
} else if (source.typeAliases?.[type.ref] !== void 0) {
|
|
268
|
+
into.aliases.add(type.ref);
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
case "scalar":
|
|
272
|
+
if ((0, import_ir2.scalarTsType)(type) === "JsonValue") {
|
|
273
|
+
into.usesJsonValue = true;
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
case "union":
|
|
277
|
+
for (const variant of type.variants) {
|
|
278
|
+
collectTypeDependencies(variant, source, entity, into);
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
case "unknown":
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
return into;
|
|
285
|
+
}
|
|
286
|
+
function renderFieldType(type, source) {
|
|
287
|
+
switch (type.kind) {
|
|
288
|
+
case "ref":
|
|
289
|
+
return source.entities[type.ref] !== void 0 ? typeName(type.ref) : type.ref;
|
|
290
|
+
case "union": {
|
|
291
|
+
const variants = (0, import_ir2.flattenUnion)(type);
|
|
292
|
+
return variants.length === 0 ? "unknown" : variants.map(
|
|
293
|
+
(variant) => variant.kind === "union" ? `(${renderFieldType(variant, source)})` : renderFieldType(variant, source)
|
|
294
|
+
).join(" | ");
|
|
295
|
+
}
|
|
296
|
+
case "scalar":
|
|
297
|
+
case "enum":
|
|
298
|
+
case "unknown":
|
|
299
|
+
return (0, import_ir2.scalarTsType)(type);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
function fieldTsType(field, source, entity) {
|
|
303
|
+
collectTypeDependencies(field.type, source, entity);
|
|
304
|
+
return renderFieldType(field.type, source);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/emit/aliases.ts
|
|
308
|
+
function emitAliases(source) {
|
|
309
|
+
const aliases = Object.values(source.typeAliases ?? {});
|
|
310
|
+
const enums = /* @__PURE__ */ new Set();
|
|
311
|
+
const entityRefs = /* @__PURE__ */ new Set();
|
|
312
|
+
let usesJsonValue = false;
|
|
313
|
+
for (const alias of aliases) {
|
|
314
|
+
const dependencies = collectTypeDependencies(alias.type, source, void 0);
|
|
315
|
+
for (const name of dependencies.enums) enums.add(name);
|
|
316
|
+
for (const name of dependencies.entityRefs) entityRefs.add(name);
|
|
317
|
+
usesJsonValue ||= dependencies.usesJsonValue;
|
|
318
|
+
}
|
|
319
|
+
const imports = [];
|
|
320
|
+
if (enums.size > 0) {
|
|
321
|
+
imports.push({ specifier: "./enums", names: [...enums] });
|
|
322
|
+
}
|
|
323
|
+
if (usesJsonValue) {
|
|
324
|
+
imports.push({ specifier: "./scalars", names: ["JsonValue"] });
|
|
325
|
+
}
|
|
326
|
+
for (const ref of entityRefs) {
|
|
327
|
+
imports.push({
|
|
328
|
+
specifier: `./${ref}.type`,
|
|
329
|
+
names: [typeName(ref)]
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
const blocks = aliases.map((alias) => {
|
|
333
|
+
const doc = alias.doc === void 0 ? "" : `/** ${alias.doc} */
|
|
334
|
+
`;
|
|
335
|
+
return `${doc}export type ${alias.name} = ${renderFieldType(alias.type, source)};`;
|
|
336
|
+
});
|
|
337
|
+
const importBlock = imports.sort((left, right) => left.specifier.localeCompare(right.specifier)).map(
|
|
338
|
+
({ specifier, names }) => `import type { ${names.sort((left, right) => left.localeCompare(right)).join(", ")} } from '${specifier}';`
|
|
339
|
+
).join("\n");
|
|
340
|
+
return `${[importBlock, ...blocks].filter((block) => block !== "").join("\n\n")}
|
|
341
|
+
`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// src/emit/barrel.ts
|
|
345
|
+
function emitBarrel(source, emitsScalars, emitsAliases = Object.keys(source.typeAliases ?? {}).length > 0) {
|
|
346
|
+
const lines = [];
|
|
347
|
+
if (emitsScalars) lines.push("export type * from './scalars';");
|
|
348
|
+
lines.push("export * from './enums';");
|
|
349
|
+
if (emitsAliases) lines.push("export type * from './aliases';");
|
|
350
|
+
if (Object.keys(source.entities).length > 0) {
|
|
351
|
+
lines.push("export type * from './filters';");
|
|
352
|
+
}
|
|
353
|
+
for (const entity of Object.values(source.entities)) {
|
|
354
|
+
lines.push(`export type * from './${entity.name}.type';`);
|
|
355
|
+
}
|
|
356
|
+
return `${lines.join("\n")}
|
|
357
|
+
`;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// src/render/jsdoc.ts
|
|
361
|
+
function jsDoc(field) {
|
|
362
|
+
const tags = [];
|
|
363
|
+
const constraints = field.constraints;
|
|
364
|
+
if (constraints.min !== void 0) tags.push(`@min ${constraints.min}`);
|
|
365
|
+
if (constraints.max !== void 0) tags.push(`@max ${constraints.max}`);
|
|
366
|
+
if (constraints.minLength !== void 0) {
|
|
367
|
+
tags.push(`@minLength ${constraints.minLength}`);
|
|
368
|
+
}
|
|
369
|
+
if (constraints.maxLength !== void 0) {
|
|
370
|
+
tags.push(`@maxLength ${constraints.maxLength}`);
|
|
371
|
+
}
|
|
372
|
+
if (constraints.regex !== void 0) {
|
|
373
|
+
tags.push(`@pattern ${constraints.regex}`);
|
|
374
|
+
}
|
|
375
|
+
if (constraints.format !== void 0) {
|
|
376
|
+
tags.push(`@format ${constraints.format}`);
|
|
377
|
+
}
|
|
378
|
+
if (constraints.unique) tags.push("@unique");
|
|
379
|
+
if (field.default?.kind === "value") {
|
|
380
|
+
tags.push(`@default ${JSON.stringify(field.default.value)}`);
|
|
381
|
+
}
|
|
382
|
+
if (field.type.kind === "unknown") {
|
|
383
|
+
tags.push(
|
|
384
|
+
field.type.hint === void 0 ? "@see unknown" : `@see unknown: ${field.type.hint}`
|
|
385
|
+
);
|
|
386
|
+
}
|
|
387
|
+
const prose = field.doc?.split("\n") ?? [];
|
|
388
|
+
if (prose.length === 0 && tags.length === 0) {
|
|
389
|
+
return "";
|
|
390
|
+
}
|
|
391
|
+
const lines = [...prose];
|
|
392
|
+
if (prose.length > 0 && tags.length > 0) lines.push("");
|
|
393
|
+
lines.push(...tags);
|
|
394
|
+
return ["/**", ...lines.map((line) => ` * ${line}`), " */"].join("\n");
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// src/render/field.ts
|
|
398
|
+
function memberLine(field, opts, source, entity) {
|
|
399
|
+
let type = fieldTsType(field, source, entity);
|
|
400
|
+
if (field.list) {
|
|
401
|
+
if (type.includes(" | ")) type = `(${type})`;
|
|
402
|
+
type = `${type}[]`;
|
|
403
|
+
}
|
|
404
|
+
if (field.nullable) type = `${type} | null`;
|
|
405
|
+
const member = ` ${field.name}${opts.optional ? "?" : ""}: ${type};`;
|
|
406
|
+
const doc = jsDoc(field);
|
|
407
|
+
const indentedDoc = doc.split("\n").map((line) => ` ${line}`).join("\n");
|
|
408
|
+
return doc === "" ? member : `${indentedDoc}
|
|
409
|
+
${member}`;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
// src/render/relations.ts
|
|
413
|
+
var import_ir3 = require("@kurotako/ir");
|
|
414
|
+
function relationMember(relation, family, variant, opts) {
|
|
415
|
+
if (family === "flat") return null;
|
|
416
|
+
if ((0, import_ir3.isCrossSource)(opts.fromNamespace, relation)) {
|
|
417
|
+
opts.logger?.debug(
|
|
418
|
+
`gen-typescript: relation '${relation.name}' targets another source ('${relation.target.namespace}.${relation.target.entity}'); degrading to the FK id (flat) in the deep family`
|
|
419
|
+
);
|
|
420
|
+
return null;
|
|
421
|
+
}
|
|
422
|
+
const target = relation.target.entity;
|
|
423
|
+
const many = relation.cardinality === "many";
|
|
424
|
+
if (variant === "where") {
|
|
425
|
+
const dto = typeName(target, "Where", "Deep");
|
|
426
|
+
return {
|
|
427
|
+
type: many ? `{ some?: ${dto}; every?: ${dto}; none?: ${dto} }` : dto,
|
|
428
|
+
optional: true
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
if (variant === "select") {
|
|
432
|
+
return {
|
|
433
|
+
type: `boolean | ${typeName(target, "Select", "Deep")}`,
|
|
434
|
+
optional: true
|
|
435
|
+
};
|
|
436
|
+
}
|
|
437
|
+
return {
|
|
438
|
+
type: many ? `${typeName(target, VARIANT_TOKEN[variant], "Deep")}[]` : typeName(target, VARIANT_TOKEN[variant], "Deep"),
|
|
439
|
+
optional: relation.optional || many || variant === "update"
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// src/render/variants.ts
|
|
444
|
+
var import_ir4 = require("@kurotako/ir");
|
|
445
|
+
function variantFields(entity, variant) {
|
|
446
|
+
switch (variant) {
|
|
447
|
+
case "full":
|
|
448
|
+
return entity.fields.map((field) => ({
|
|
449
|
+
field,
|
|
450
|
+
optional: field.optional
|
|
451
|
+
}));
|
|
452
|
+
case "create":
|
|
453
|
+
return (0, import_ir4.createFields)(entity).map((field) => ({
|
|
454
|
+
field,
|
|
455
|
+
optional: (0, import_ir4.isCreateOptional)(field)
|
|
456
|
+
}));
|
|
457
|
+
case "update":
|
|
458
|
+
return (0, import_ir4.updateFields)(entity).map((field) => ({ field, optional: true }));
|
|
459
|
+
case "where":
|
|
460
|
+
case "select":
|
|
461
|
+
return entity.fields.map((field) => ({ field, optional: true }));
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
function filterClass(field) {
|
|
465
|
+
if (field.type.kind === "enum") return `Enum${field.type.ref}Filter`;
|
|
466
|
+
if (field.type.kind !== "scalar") return null;
|
|
467
|
+
switch (field.type.scalar) {
|
|
468
|
+
case "string":
|
|
469
|
+
case "uuid":
|
|
470
|
+
case "decimal":
|
|
471
|
+
case "bytes":
|
|
472
|
+
return "StringFilter";
|
|
473
|
+
case "int":
|
|
474
|
+
return "IntFilter";
|
|
475
|
+
case "float":
|
|
476
|
+
return "FloatFilter";
|
|
477
|
+
case "bigint":
|
|
478
|
+
return "BigIntFilter";
|
|
479
|
+
case "boolean":
|
|
480
|
+
return "BoolFilter";
|
|
481
|
+
case "date":
|
|
482
|
+
case "datetime":
|
|
483
|
+
return "DateTimeFilter";
|
|
484
|
+
case "json":
|
|
485
|
+
return null;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// src/emit/entity.ts
|
|
490
|
+
function typeBlock(name, members) {
|
|
491
|
+
return `export type ${name} = {
|
|
492
|
+
${members.join("\n")}
|
|
493
|
+
};`;
|
|
494
|
+
}
|
|
495
|
+
function relationLine(name, member) {
|
|
496
|
+
return ` ${name}${member.optional ? "?" : ""}: ${member.type};`;
|
|
497
|
+
}
|
|
498
|
+
function importsFor(enums, aliases, filters, usesJsonValue, siblings) {
|
|
499
|
+
const imports = [];
|
|
500
|
+
if (aliases.size > 0) {
|
|
501
|
+
imports.push({ specifier: "./aliases", names: [...aliases] });
|
|
502
|
+
}
|
|
503
|
+
if (enums.size > 0) {
|
|
504
|
+
imports.push({ specifier: "./enums", names: [...enums] });
|
|
505
|
+
}
|
|
506
|
+
if (filters.size > 0) {
|
|
507
|
+
imports.push({ specifier: "./filters", names: [...filters] });
|
|
508
|
+
}
|
|
509
|
+
if (usesJsonValue) {
|
|
510
|
+
imports.push({ specifier: "./scalars", names: ["JsonValue"] });
|
|
511
|
+
}
|
|
512
|
+
for (const [entity, names] of siblings) {
|
|
513
|
+
imports.push({ specifier: `./${entity}.type`, names: [...names] });
|
|
514
|
+
}
|
|
515
|
+
return imports.sort((left, right) => left.specifier.localeCompare(right.specifier)).map(
|
|
516
|
+
({ specifier, names }) => `import type { ${names.sort((left, right) => left.localeCompare(right)).join(", ")} } from '${specifier}';`
|
|
517
|
+
).join("\n");
|
|
518
|
+
}
|
|
519
|
+
function emitEntity(source, entity, logger) {
|
|
520
|
+
const usedEnums = /* @__PURE__ */ new Set();
|
|
521
|
+
const usedAliases = /* @__PURE__ */ new Set();
|
|
522
|
+
const usedEntityRefs = /* @__PURE__ */ new Set();
|
|
523
|
+
let usesJsonValue = false;
|
|
524
|
+
const usedFilters = /* @__PURE__ */ new Set();
|
|
525
|
+
const siblings = /* @__PURE__ */ new Map();
|
|
526
|
+
for (const field of entity.fields) {
|
|
527
|
+
const dependencies = collectTypeDependencies(field.type, source, entity);
|
|
528
|
+
for (const name of dependencies.enums) usedEnums.add(name);
|
|
529
|
+
for (const name of dependencies.aliases) usedAliases.add(name);
|
|
530
|
+
for (const name of dependencies.entityRefs) usedEntityRefs.add(name);
|
|
531
|
+
usesJsonValue ||= dependencies.usesJsonValue;
|
|
532
|
+
}
|
|
533
|
+
const trackSibling = (target, name) => {
|
|
534
|
+
if (target === entity.name) return;
|
|
535
|
+
const names = siblings.get(target) ?? /* @__PURE__ */ new Set();
|
|
536
|
+
names.add(name);
|
|
537
|
+
siblings.set(target, names);
|
|
538
|
+
};
|
|
539
|
+
for (const ref of usedEntityRefs) {
|
|
540
|
+
trackSibling(ref, typeName(ref));
|
|
541
|
+
}
|
|
542
|
+
const relation = (relationIndex, variant) => {
|
|
543
|
+
const current = entity.relations[relationIndex];
|
|
544
|
+
if (current === void 0) return null;
|
|
545
|
+
const member = relationMember(current, "deep", variant, {
|
|
546
|
+
fromNamespace: source.namespace,
|
|
547
|
+
logger
|
|
548
|
+
});
|
|
549
|
+
if (member !== null) {
|
|
550
|
+
trackSibling(
|
|
551
|
+
current.target.entity,
|
|
552
|
+
typeName(current.target.entity, VARIANT_TOKEN[variant], "Deep")
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
return member;
|
|
556
|
+
};
|
|
557
|
+
const blocks = [];
|
|
558
|
+
for (const variant of VARIANTS) {
|
|
559
|
+
for (const family of FAMILIES) {
|
|
560
|
+
const name = typeName(
|
|
561
|
+
entity.name,
|
|
562
|
+
VARIANT_TOKEN[variant],
|
|
563
|
+
FAMILY_TOKEN[family]
|
|
564
|
+
);
|
|
565
|
+
if (variant === "where") {
|
|
566
|
+
blocks.push(renderWhere(name, family));
|
|
567
|
+
} else if (variant === "select") {
|
|
568
|
+
blocks.push(renderSelect(name, family));
|
|
569
|
+
} else {
|
|
570
|
+
blocks.push(renderRecord(name, variant, family));
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const imports = importsFor(
|
|
575
|
+
usedEnums,
|
|
576
|
+
usedAliases,
|
|
577
|
+
usedFilters,
|
|
578
|
+
usesJsonValue,
|
|
579
|
+
siblings
|
|
580
|
+
);
|
|
581
|
+
return `${[imports, "", ...blocks].join("\n\n").trim()}
|
|
582
|
+
`;
|
|
583
|
+
function renderRecord(name, variant, family) {
|
|
584
|
+
const own = variantFields(entity, variant).map(
|
|
585
|
+
(selection) => memberLine(
|
|
586
|
+
selection.field,
|
|
587
|
+
{ optional: variant === "update" ? false : selection.optional },
|
|
588
|
+
source,
|
|
589
|
+
entity
|
|
590
|
+
)
|
|
591
|
+
);
|
|
592
|
+
const relations = [];
|
|
593
|
+
if (family === "deep") {
|
|
594
|
+
for (let index = 0; index < entity.relations.length; index += 1) {
|
|
595
|
+
const current = entity.relations[index];
|
|
596
|
+
const member = relation(index, variant);
|
|
597
|
+
if (current !== void 0 && member !== null) {
|
|
598
|
+
relations.push(relationLine(current.name, member));
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
if (variant === "update") {
|
|
603
|
+
const base = `Partial<{
|
|
604
|
+
${own.join("\n")}
|
|
605
|
+
}>`;
|
|
606
|
+
return relations.length === 0 ? `export type ${name} = ${base};` : `export type ${name} = ${base} & {
|
|
607
|
+
${relations.join("\n")}
|
|
608
|
+
};`;
|
|
609
|
+
}
|
|
610
|
+
return typeBlock(name, [...own, ...relations]);
|
|
611
|
+
}
|
|
612
|
+
function renderWhere(name, family) {
|
|
613
|
+
const members = [];
|
|
614
|
+
for (const field of entity.fields) {
|
|
615
|
+
const filter = filterClass(field);
|
|
616
|
+
if (filter === null) continue;
|
|
617
|
+
usedFilters.add(filter);
|
|
618
|
+
members.push(` ${field.name}?: ${filter};`);
|
|
619
|
+
}
|
|
620
|
+
if (family === "deep") {
|
|
621
|
+
for (let index = 0; index < entity.relations.length; index += 1) {
|
|
622
|
+
const current = entity.relations[index];
|
|
623
|
+
const member = relation(index, "where");
|
|
624
|
+
if (current !== void 0 && member !== null) {
|
|
625
|
+
members.push(relationLine(current.name, member));
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
members.push(
|
|
630
|
+
` AND?: ${name} | ${name}[];`,
|
|
631
|
+
` OR?: ${name} | ${name}[];`,
|
|
632
|
+
` NOT?: ${name} | ${name}[];`
|
|
633
|
+
);
|
|
634
|
+
return typeBlock(name, members);
|
|
635
|
+
}
|
|
636
|
+
function renderSelect(name, family) {
|
|
637
|
+
const members = entity.fields.map((field) => ` ${field.name}?: boolean;`);
|
|
638
|
+
for (let index = 0; index < entity.relations.length; index += 1) {
|
|
639
|
+
const current = entity.relations[index];
|
|
640
|
+
if (current === void 0) continue;
|
|
641
|
+
if (family === "flat") {
|
|
642
|
+
members.push(` ${current.name}?: boolean;`);
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
const member = relation(index, "select");
|
|
646
|
+
members.push(
|
|
647
|
+
member === null ? ` ${current.name}?: boolean;` : relationLine(current.name, member)
|
|
648
|
+
);
|
|
649
|
+
}
|
|
650
|
+
return typeBlock(name, members);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// src/emit/filters.ts
|
|
655
|
+
var import_ir5 = require("@kurotako/ir");
|
|
656
|
+
var EQUALITY_OPS = ["equals", "not"];
|
|
657
|
+
var LIST_OPS = ["in", "notIn"];
|
|
658
|
+
var ORDER_OPS = ["lt", "lte", "gt", "gte"];
|
|
659
|
+
var STRING_OPS = ["contains", "startsWith", "endsWith"];
|
|
660
|
+
var SCALAR_FILTER_ORDER = [
|
|
661
|
+
"StringFilter",
|
|
662
|
+
"IntFilter",
|
|
663
|
+
"FloatFilter",
|
|
664
|
+
"BigIntFilter",
|
|
665
|
+
"DateTimeFilter",
|
|
666
|
+
"BoolFilter"
|
|
667
|
+
];
|
|
668
|
+
function collectFilterNames(source) {
|
|
669
|
+
const names = /* @__PURE__ */ new Set();
|
|
670
|
+
for (const entity of Object.values(source.entities)) {
|
|
671
|
+
for (const field of entity.fields) {
|
|
672
|
+
const filter = filterClass(field);
|
|
673
|
+
if (filter !== null) names.add(filter);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return names;
|
|
677
|
+
}
|
|
678
|
+
function baseType(name) {
|
|
679
|
+
switch (name) {
|
|
680
|
+
case "StringFilter":
|
|
681
|
+
return (0, import_ir5.scalarTsType)({ kind: "scalar", scalar: "string" });
|
|
682
|
+
case "IntFilter":
|
|
683
|
+
case "FloatFilter":
|
|
684
|
+
return (0, import_ir5.scalarTsType)({ kind: "scalar", scalar: "int" });
|
|
685
|
+
case "BigIntFilter":
|
|
686
|
+
return (0, import_ir5.scalarTsType)({ kind: "scalar", scalar: "bigint" });
|
|
687
|
+
case "DateTimeFilter":
|
|
688
|
+
return (0, import_ir5.scalarTsType)({ kind: "scalar", scalar: "datetime" });
|
|
689
|
+
case "BoolFilter":
|
|
690
|
+
return (0, import_ir5.scalarTsType)({ kind: "scalar", scalar: "boolean" });
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
function operations(name) {
|
|
694
|
+
if (name === "BoolFilter") return EQUALITY_OPS;
|
|
695
|
+
if (name === "StringFilter") {
|
|
696
|
+
return [...EQUALITY_OPS, ...LIST_OPS, ...ORDER_OPS, ...STRING_OPS];
|
|
697
|
+
}
|
|
698
|
+
return [...EQUALITY_OPS, ...LIST_OPS, ...ORDER_OPS];
|
|
699
|
+
}
|
|
700
|
+
function emitInterface(name, type, ops) {
|
|
701
|
+
const members = ops.map((operation) => {
|
|
702
|
+
const list = LIST_OPS.includes(operation);
|
|
703
|
+
return ` ${operation}?: ${list ? `${type}[]` : type};`;
|
|
704
|
+
});
|
|
705
|
+
return `export interface ${name} {
|
|
706
|
+
${members.join("\n")}
|
|
707
|
+
}`;
|
|
708
|
+
}
|
|
709
|
+
function emitFilters(source) {
|
|
710
|
+
const scalars = /* @__PURE__ */ new Set();
|
|
711
|
+
const enums = /* @__PURE__ */ new Set();
|
|
712
|
+
for (const entity of Object.values(source.entities)) {
|
|
713
|
+
for (const field of entity.fields) {
|
|
714
|
+
const filter = filterClass(field);
|
|
715
|
+
if (filter === null) continue;
|
|
716
|
+
if (field.type.kind === "enum") enums.add(field.type.ref);
|
|
717
|
+
else scalars.add(filter);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
const enumNames = [...enums].sort((left, right) => left.localeCompare(right));
|
|
721
|
+
const blocks = [];
|
|
722
|
+
for (const name of SCALAR_FILTER_ORDER) {
|
|
723
|
+
if (scalars.has(name))
|
|
724
|
+
blocks.push(emitInterface(name, baseType(name), operations(name)));
|
|
725
|
+
}
|
|
726
|
+
for (const name of enumNames) {
|
|
727
|
+
blocks.push(
|
|
728
|
+
emitInterface(`Enum${name}Filter`, enumTypeName(name), [
|
|
729
|
+
...EQUALITY_OPS,
|
|
730
|
+
...LIST_OPS
|
|
731
|
+
])
|
|
732
|
+
);
|
|
733
|
+
}
|
|
734
|
+
const imports = enumNames.length === 0 ? "" : `import type { ${enumNames.map(enumTypeName).join(", ")} } from './enums';
|
|
735
|
+
|
|
736
|
+
`;
|
|
737
|
+
return blocks.length === 0 ? "export {};\n" : `${imports}${blocks.join("\n\n")}
|
|
738
|
+
`;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
// src/emit/scalars.ts
|
|
742
|
+
function emitScalars() {
|
|
743
|
+
return `export type JsonValue =
|
|
744
|
+
| null
|
|
745
|
+
| boolean
|
|
746
|
+
| number
|
|
747
|
+
| string
|
|
748
|
+
| JsonValue[]
|
|
749
|
+
| { [key: string]: JsonValue };
|
|
750
|
+
`;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
// src/generator.ts
|
|
754
|
+
function sourceUsesJsonValue(source) {
|
|
755
|
+
for (const entity of Object.values(source.entities)) {
|
|
756
|
+
for (const field of entity.fields) {
|
|
757
|
+
if (collectTypeDependencies(field.type, source, entity).usesJsonValue) {
|
|
758
|
+
return true;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
for (const alias of Object.values(source.typeAliases ?? {})) {
|
|
763
|
+
if (collectTypeDependencies(alias.type, source, void 0).usesJsonValue) {
|
|
764
|
+
return true;
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
return false;
|
|
768
|
+
}
|
|
769
|
+
function cyclicAliasNames(source, cycles) {
|
|
770
|
+
const aliases = source.typeAliases ?? {};
|
|
771
|
+
const candidates = Object.keys(aliases).filter(
|
|
772
|
+
(name) => cycles.has(`${source.namespace}.${name}`)
|
|
773
|
+
);
|
|
774
|
+
const candidateSet = new Set(candidates);
|
|
775
|
+
const references = /* @__PURE__ */ new Map();
|
|
776
|
+
for (const name of candidates) {
|
|
777
|
+
const alias = aliases[name];
|
|
778
|
+
if (alias === void 0) continue;
|
|
779
|
+
const dependencies = collectTypeDependencies(alias.type, source, void 0);
|
|
780
|
+
references.set(
|
|
781
|
+
name,
|
|
782
|
+
[...dependencies.aliases].filter(
|
|
783
|
+
(dependency) => candidateSet.has(dependency)
|
|
784
|
+
)
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
const reachesSelf = (start, current, seen) => {
|
|
788
|
+
for (const next of references.get(current) ?? []) {
|
|
789
|
+
if (next === start) return true;
|
|
790
|
+
if (!seen.has(next)) {
|
|
791
|
+
seen.add(next);
|
|
792
|
+
if (reachesSelf(start, next, seen)) return true;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
return false;
|
|
796
|
+
};
|
|
797
|
+
return candidates.filter((name) => reachesSelf(name, name, /* @__PURE__ */ new Set([name])));
|
|
798
|
+
}
|
|
799
|
+
function generatedPublicNames(source) {
|
|
800
|
+
const enumNames = new Set(collectEnums(source).map(({ name }) => name));
|
|
801
|
+
const generatedTypeNames = /* @__PURE__ */ new Set();
|
|
802
|
+
for (const entity of Object.values(source.entities)) {
|
|
803
|
+
for (const variant of VARIANTS) {
|
|
804
|
+
for (const family of FAMILIES) {
|
|
805
|
+
generatedTypeNames.add(
|
|
806
|
+
typeName(entity.name, VARIANT_TOKEN[variant], FAMILY_TOKEN[family])
|
|
807
|
+
);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
for (const name of collectFilterNames(source)) generatedTypeNames.add(name);
|
|
812
|
+
if (sourceUsesJsonValue(source)) generatedTypeNames.add("JsonValue");
|
|
813
|
+
return {
|
|
814
|
+
enumNames,
|
|
815
|
+
generatedTypeNames,
|
|
816
|
+
aliasNames: new Set(Object.keys(source.typeAliases ?? {}))
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
function validateSourceEmission(source, cycles) {
|
|
820
|
+
const aliasesInCycles = cyclicAliasNames(source, cycles);
|
|
821
|
+
if (aliasesInCycles.length > 0) {
|
|
822
|
+
throw new TypeScriptAliasCycleError(source.namespace, aliasesInCycles);
|
|
823
|
+
}
|
|
824
|
+
const { enumNames, generatedTypeNames, aliasNames } = generatedPublicNames(source);
|
|
825
|
+
const aliasCollisions = [...aliasNames].filter(
|
|
826
|
+
(name) => enumNames.has(name) || generatedTypeNames.has(name)
|
|
827
|
+
);
|
|
828
|
+
if (aliasCollisions.length > 0) {
|
|
829
|
+
throw new TypeScriptAliasPublicNameCollisionError(
|
|
830
|
+
source.namespace,
|
|
831
|
+
aliasCollisions
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
const enumCollisions = [...enumNames].filter(
|
|
835
|
+
(name) => generatedTypeNames.has(name) || aliasNames.has(name)
|
|
836
|
+
);
|
|
837
|
+
if (enumCollisions.length > 0) {
|
|
838
|
+
throw new TypeScriptEnumPublicNameCollisionError(
|
|
839
|
+
source.namespace,
|
|
840
|
+
enumCollisions
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
var typescriptGenerator = (0, import_config.defineGenerator)({
|
|
845
|
+
name: "typescript",
|
|
846
|
+
generate(ctx) {
|
|
847
|
+
const files = [];
|
|
848
|
+
for (const [namespace, source] of Object.entries(ctx.ir.sources)) {
|
|
849
|
+
validateSourceEmission(source, ctx.cycles);
|
|
850
|
+
const prefix = `${namespace}/typescript`;
|
|
851
|
+
const emitsScalars = sourceUsesJsonValue(source);
|
|
852
|
+
if (emitsScalars) {
|
|
853
|
+
files.push({ path: `${prefix}/scalars.ts`, content: emitScalars() });
|
|
854
|
+
}
|
|
855
|
+
files.push({ path: `${prefix}/enums.ts`, content: emitEnums(source) });
|
|
856
|
+
if (Object.keys(source.entities).length > 0) {
|
|
857
|
+
files.push({
|
|
858
|
+
path: `${prefix}/filters.ts`,
|
|
859
|
+
content: emitFilters(source)
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
if (Object.keys(source.typeAliases ?? {}).length > 0) {
|
|
863
|
+
files.push({
|
|
864
|
+
path: `${prefix}/aliases.ts`,
|
|
865
|
+
content: emitAliases(source)
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
for (const entity of Object.values(source.entities)) {
|
|
869
|
+
files.push({
|
|
870
|
+
path: `${prefix}/${entity.name}.type.ts`,
|
|
871
|
+
content: emitEntity(source, entity, ctx.logger)
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
files.push({
|
|
875
|
+
path: `${prefix}/index.ts`,
|
|
876
|
+
content: emitBarrel(
|
|
877
|
+
source,
|
|
878
|
+
emitsScalars,
|
|
879
|
+
Object.keys(source.typeAliases ?? {}).length > 0
|
|
880
|
+
)
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
return { files, artifact: buildArtifact(ctx.ir) };
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
887
|
+
0 && (module.exports = {
|
|
888
|
+
TypeScriptAliasCycleError,
|
|
889
|
+
TypeScriptAliasPublicNameCollisionError,
|
|
890
|
+
TypeScriptEnumCollisionError,
|
|
891
|
+
TypeScriptEnumPublicNameCollisionError,
|
|
892
|
+
TypeScriptGenError,
|
|
893
|
+
typescriptGenerator
|
|
894
|
+
});
|
|
895
|
+
//# sourceMappingURL=index.cjs.map
|