@famgia/omnify-typescript 0.0.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/dist/chunk-2BXDNKIN.js +477 -0
- package/dist/chunk-2BXDNKIN.js.map +1 -0
- package/dist/index.cjs +522 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +200 -0
- package/dist/index.d.ts +200 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.cjs +545 -0
- package/dist/plugin.cjs.map +1 -0
- package/dist/plugin.d.cts +57 -0
- package/dist/plugin.d.ts +57 -0
- package/dist/plugin.js +82 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +62 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
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
|
+
enumToUnionType: () => enumToUnionType,
|
|
24
|
+
extractInlineEnums: () => extractInlineEnums,
|
|
25
|
+
formatEnum: () => formatEnum,
|
|
26
|
+
formatInterface: () => formatInterface,
|
|
27
|
+
formatProperty: () => formatProperty,
|
|
28
|
+
formatTypeAlias: () => formatTypeAlias,
|
|
29
|
+
generateEnums: () => generateEnums,
|
|
30
|
+
generateInterfaces: () => generateInterfaces,
|
|
31
|
+
generateTypeScript: () => generateTypeScript,
|
|
32
|
+
generateTypeScriptFile: () => generateTypeScriptFile,
|
|
33
|
+
generateTypeScriptFiles: () => generateTypeScriptFiles,
|
|
34
|
+
getPropertyType: () => getPropertyType,
|
|
35
|
+
getTypeScriptPath: () => getTypeScriptPath,
|
|
36
|
+
propertyToTSProperty: () => propertyToTSProperty,
|
|
37
|
+
schemaToEnum: () => schemaToEnum,
|
|
38
|
+
schemaToInterface: () => schemaToInterface,
|
|
39
|
+
toEnumMemberName: () => toEnumMemberName,
|
|
40
|
+
toEnumName: () => toEnumName,
|
|
41
|
+
toInterfaceName: () => toInterfaceName,
|
|
42
|
+
toPropertyName: () => toPropertyName
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(index_exports);
|
|
45
|
+
|
|
46
|
+
// src/interface-generator.ts
|
|
47
|
+
var TYPE_MAP = {
|
|
48
|
+
String: "string",
|
|
49
|
+
Int: "number",
|
|
50
|
+
BigInt: "number",
|
|
51
|
+
Float: "number",
|
|
52
|
+
Boolean: "boolean",
|
|
53
|
+
Text: "string",
|
|
54
|
+
LongText: "string",
|
|
55
|
+
Date: "string",
|
|
56
|
+
Time: "string",
|
|
57
|
+
Timestamp: "string",
|
|
58
|
+
Json: "unknown",
|
|
59
|
+
Email: "string",
|
|
60
|
+
Password: "string",
|
|
61
|
+
Enum: "string",
|
|
62
|
+
Select: "string",
|
|
63
|
+
Lookup: "number"
|
|
64
|
+
};
|
|
65
|
+
var FILE_INTERFACE_NAME = "File";
|
|
66
|
+
var PK_TYPE_MAP = {
|
|
67
|
+
Int: "number",
|
|
68
|
+
BigInt: "number",
|
|
69
|
+
Uuid: "string",
|
|
70
|
+
String: "string"
|
|
71
|
+
};
|
|
72
|
+
function toPropertyName(name) {
|
|
73
|
+
return name;
|
|
74
|
+
}
|
|
75
|
+
function toInterfaceName(schemaName) {
|
|
76
|
+
return schemaName;
|
|
77
|
+
}
|
|
78
|
+
function getPropertyType(property, _allSchemas) {
|
|
79
|
+
if (property.type === "File") {
|
|
80
|
+
const fileProp = property;
|
|
81
|
+
if (fileProp.multiple) {
|
|
82
|
+
return `${FILE_INTERFACE_NAME}[]`;
|
|
83
|
+
}
|
|
84
|
+
return `${FILE_INTERFACE_NAME} | null`;
|
|
85
|
+
}
|
|
86
|
+
if (property.type === "Association") {
|
|
87
|
+
const assocProp = property;
|
|
88
|
+
const targetName = assocProp.target ?? "unknown";
|
|
89
|
+
switch (assocProp.relation) {
|
|
90
|
+
// Standard relations
|
|
91
|
+
case "OneToOne":
|
|
92
|
+
case "ManyToOne":
|
|
93
|
+
return targetName;
|
|
94
|
+
case "OneToMany":
|
|
95
|
+
case "ManyToMany":
|
|
96
|
+
return `${targetName}[]`;
|
|
97
|
+
// Polymorphic relations
|
|
98
|
+
case "MorphTo":
|
|
99
|
+
if (assocProp.targets && assocProp.targets.length > 0) {
|
|
100
|
+
return assocProp.targets.join(" | ");
|
|
101
|
+
}
|
|
102
|
+
return "unknown";
|
|
103
|
+
case "MorphOne":
|
|
104
|
+
return targetName;
|
|
105
|
+
case "MorphMany":
|
|
106
|
+
case "MorphToMany":
|
|
107
|
+
case "MorphedByMany":
|
|
108
|
+
return `${targetName}[]`;
|
|
109
|
+
default:
|
|
110
|
+
return "unknown";
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (property.type === "Enum") {
|
|
114
|
+
const enumProp = property;
|
|
115
|
+
if (typeof enumProp.enum === "string") {
|
|
116
|
+
return enumProp.enum;
|
|
117
|
+
}
|
|
118
|
+
if (Array.isArray(enumProp.enum)) {
|
|
119
|
+
return enumProp.enum.map((v) => `'${v}'`).join(" | ");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (property.type === "Select") {
|
|
123
|
+
const selectProp = property;
|
|
124
|
+
if (selectProp.options && selectProp.options.length > 0) {
|
|
125
|
+
return selectProp.options.map((v) => `'${v}'`).join(" | ");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return TYPE_MAP[property.type] ?? "unknown";
|
|
129
|
+
}
|
|
130
|
+
function propertyToTSProperties(propertyName, property, allSchemas, options = {}) {
|
|
131
|
+
const baseProp = property;
|
|
132
|
+
const isReadonly = options.readonly ?? true;
|
|
133
|
+
if (property.type === "Association") {
|
|
134
|
+
const assocProp = property;
|
|
135
|
+
if (assocProp.relation === "MorphTo" && assocProp.targets && assocProp.targets.length > 0) {
|
|
136
|
+
const propBaseName = toPropertyName(propertyName);
|
|
137
|
+
const targetUnion = assocProp.targets.map((t) => `'${t}'`).join(" | ");
|
|
138
|
+
const relationUnion = assocProp.targets.join(" | ");
|
|
139
|
+
return [
|
|
140
|
+
{
|
|
141
|
+
name: `${propBaseName}Type`,
|
|
142
|
+
type: targetUnion,
|
|
143
|
+
optional: true,
|
|
144
|
+
// Polymorphic columns are nullable
|
|
145
|
+
readonly: isReadonly,
|
|
146
|
+
comment: `Polymorphic type for ${propertyName}`
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: `${propBaseName}Id`,
|
|
150
|
+
type: "number",
|
|
151
|
+
optional: true,
|
|
152
|
+
readonly: isReadonly,
|
|
153
|
+
comment: `Polymorphic ID for ${propertyName}`
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: propBaseName,
|
|
157
|
+
type: `${relationUnion} | null`,
|
|
158
|
+
optional: true,
|
|
159
|
+
readonly: isReadonly,
|
|
160
|
+
comment: baseProp.displayName ?? `Polymorphic relation to ${assocProp.targets.join(", ")}`
|
|
161
|
+
}
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const type = getPropertyType(property, allSchemas);
|
|
166
|
+
return [{
|
|
167
|
+
name: toPropertyName(propertyName),
|
|
168
|
+
type,
|
|
169
|
+
optional: baseProp.nullable ?? false,
|
|
170
|
+
readonly: isReadonly,
|
|
171
|
+
comment: baseProp.displayName
|
|
172
|
+
}];
|
|
173
|
+
}
|
|
174
|
+
function propertyToTSProperty(propertyName, property, allSchemas, options = {}) {
|
|
175
|
+
return propertyToTSProperties(propertyName, property, allSchemas, options)[0];
|
|
176
|
+
}
|
|
177
|
+
function schemaToInterface(schema, allSchemas, options = {}) {
|
|
178
|
+
const properties = [];
|
|
179
|
+
if (schema.options?.id !== false) {
|
|
180
|
+
const pkType = schema.options?.idType ?? "BigInt";
|
|
181
|
+
properties.push({
|
|
182
|
+
name: "id",
|
|
183
|
+
type: PK_TYPE_MAP[pkType] ?? "number",
|
|
184
|
+
optional: false,
|
|
185
|
+
readonly: options.readonly ?? true,
|
|
186
|
+
comment: "Primary key"
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (schema.properties) {
|
|
190
|
+
for (const [propName, property] of Object.entries(schema.properties)) {
|
|
191
|
+
properties.push(...propertyToTSProperties(propName, property, allSchemas, options));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
if (schema.options?.timestamps !== false) {
|
|
195
|
+
properties.push(
|
|
196
|
+
{
|
|
197
|
+
name: "createdAt",
|
|
198
|
+
type: "string",
|
|
199
|
+
optional: true,
|
|
200
|
+
readonly: options.readonly ?? true,
|
|
201
|
+
comment: "Creation timestamp"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "updatedAt",
|
|
205
|
+
type: "string",
|
|
206
|
+
optional: true,
|
|
207
|
+
readonly: options.readonly ?? true,
|
|
208
|
+
comment: "Last update timestamp"
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
if (schema.options?.softDelete) {
|
|
213
|
+
properties.push({
|
|
214
|
+
name: "deletedAt",
|
|
215
|
+
type: "string",
|
|
216
|
+
optional: true,
|
|
217
|
+
readonly: options.readonly ?? true,
|
|
218
|
+
comment: "Soft delete timestamp"
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
name: toInterfaceName(schema.name),
|
|
223
|
+
properties,
|
|
224
|
+
comment: schema.displayName ?? schema.name
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function formatProperty(property) {
|
|
228
|
+
const readonly = property.readonly ? "readonly " : "";
|
|
229
|
+
const optional = property.optional ? "?" : "";
|
|
230
|
+
const comment = property.comment ? ` /** ${property.comment} */
|
|
231
|
+
` : "";
|
|
232
|
+
return `${comment} ${readonly}${property.name}${optional}: ${property.type};`;
|
|
233
|
+
}
|
|
234
|
+
function formatInterface(iface) {
|
|
235
|
+
const comment = iface.comment ? `/**
|
|
236
|
+
* ${iface.comment}
|
|
237
|
+
*/
|
|
238
|
+
` : "";
|
|
239
|
+
const extendsClause = iface.extends && iface.extends.length > 0 ? ` extends ${iface.extends.join(", ")}` : "";
|
|
240
|
+
const properties = iface.properties.map(formatProperty).join("\n");
|
|
241
|
+
return `${comment}export interface ${iface.name}${extendsClause} {
|
|
242
|
+
${properties}
|
|
243
|
+
}`;
|
|
244
|
+
}
|
|
245
|
+
function generateInterfaces(schemas, options = {}) {
|
|
246
|
+
const interfaces = [];
|
|
247
|
+
for (const schema of Object.values(schemas)) {
|
|
248
|
+
if (schema.kind === "enum") {
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
interfaces.push(schemaToInterface(schema, schemas, options));
|
|
252
|
+
}
|
|
253
|
+
return interfaces;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/enum-generator.ts
|
|
257
|
+
function toEnumMemberName(value) {
|
|
258
|
+
return value.split(/[-_\s]+/).map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase()).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
259
|
+
}
|
|
260
|
+
function toEnumName(schemaName) {
|
|
261
|
+
return schemaName;
|
|
262
|
+
}
|
|
263
|
+
function schemaToEnum(schema) {
|
|
264
|
+
if (schema.kind !== "enum" || !schema.values) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
const values = schema.values.map((value) => ({
|
|
268
|
+
name: toEnumMemberName(value),
|
|
269
|
+
value
|
|
270
|
+
}));
|
|
271
|
+
return {
|
|
272
|
+
name: toEnumName(schema.name),
|
|
273
|
+
values,
|
|
274
|
+
comment: schema.displayName ?? schema.name
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function generateEnums(schemas) {
|
|
278
|
+
const enums = [];
|
|
279
|
+
for (const schema of Object.values(schemas)) {
|
|
280
|
+
if (schema.kind === "enum") {
|
|
281
|
+
const enumDef = schemaToEnum(schema);
|
|
282
|
+
if (enumDef) {
|
|
283
|
+
enums.push(enumDef);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return enums;
|
|
288
|
+
}
|
|
289
|
+
function formatEnum(enumDef) {
|
|
290
|
+
const comment = enumDef.comment ? `/**
|
|
291
|
+
* ${enumDef.comment}
|
|
292
|
+
*/
|
|
293
|
+
` : "";
|
|
294
|
+
const values = enumDef.values.map((v) => ` ${v.name} = '${v.value}',`).join("\n");
|
|
295
|
+
return `${comment}export enum ${enumDef.name} {
|
|
296
|
+
${values}
|
|
297
|
+
}`;
|
|
298
|
+
}
|
|
299
|
+
function enumToUnionType(enumDef) {
|
|
300
|
+
const type = enumDef.values.map((v) => `'${v.value}'`).join(" | ");
|
|
301
|
+
return {
|
|
302
|
+
name: enumDef.name,
|
|
303
|
+
type,
|
|
304
|
+
comment: enumDef.comment
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
function formatTypeAlias(alias) {
|
|
308
|
+
const comment = alias.comment ? `/**
|
|
309
|
+
* ${alias.comment}
|
|
310
|
+
*/
|
|
311
|
+
` : "";
|
|
312
|
+
return `${comment}export type ${alias.name} = ${alias.type};`;
|
|
313
|
+
}
|
|
314
|
+
function extractInlineEnums(schemas) {
|
|
315
|
+
const typeAliases = [];
|
|
316
|
+
for (const schema of Object.values(schemas)) {
|
|
317
|
+
if (schema.kind === "enum" || !schema.properties) {
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
for (const [propName, property] of Object.entries(schema.properties)) {
|
|
321
|
+
if (property.type === "Enum") {
|
|
322
|
+
const enumProp = property;
|
|
323
|
+
if (Array.isArray(enumProp.enum) && enumProp.enum.length > 0) {
|
|
324
|
+
const typeName = `${schema.name}${propName.charAt(0).toUpperCase() + propName.slice(1)}`;
|
|
325
|
+
typeAliases.push({
|
|
326
|
+
name: typeName,
|
|
327
|
+
type: enumProp.enum.map((v) => `'${v}'`).join(" | "),
|
|
328
|
+
comment: enumProp.displayName ?? `${schema.name} ${propName} enum`
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
if (property.type === "Select") {
|
|
333
|
+
const selectProp = property;
|
|
334
|
+
if (selectProp.options && selectProp.options.length > 0) {
|
|
335
|
+
const typeName = `${schema.name}${propName.charAt(0).toUpperCase() + propName.slice(1)}`;
|
|
336
|
+
typeAliases.push({
|
|
337
|
+
name: typeName,
|
|
338
|
+
type: selectProp.options.map((v) => `'${v}'`).join(" | "),
|
|
339
|
+
comment: selectProp.displayName ?? `${schema.name} ${propName} options`
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return typeAliases;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// src/generator.ts
|
|
349
|
+
var DEFAULT_OPTIONS = {
|
|
350
|
+
singleFile: true,
|
|
351
|
+
fileName: "types.ts",
|
|
352
|
+
readonly: true,
|
|
353
|
+
strictNullChecks: true
|
|
354
|
+
};
|
|
355
|
+
function generateHeader() {
|
|
356
|
+
return `/**
|
|
357
|
+
* Auto-generated TypeScript types from Omnify schemas.
|
|
358
|
+
* DO NOT EDIT - This file is automatically generated.
|
|
359
|
+
*/
|
|
360
|
+
|
|
361
|
+
`;
|
|
362
|
+
}
|
|
363
|
+
function generateTypeScriptFile(schemas, options = {}) {
|
|
364
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
365
|
+
const parts = [generateHeader()];
|
|
366
|
+
const types = [];
|
|
367
|
+
const enums = generateEnums(schemas);
|
|
368
|
+
if (enums.length > 0) {
|
|
369
|
+
parts.push("// Enums\n");
|
|
370
|
+
for (const enumDef of enums) {
|
|
371
|
+
parts.push(formatEnum(enumDef));
|
|
372
|
+
parts.push("\n\n");
|
|
373
|
+
types.push(enumDef.name);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
const inlineEnums = extractInlineEnums(schemas);
|
|
377
|
+
if (inlineEnums.length > 0) {
|
|
378
|
+
parts.push("// Type Aliases\n");
|
|
379
|
+
for (const alias of inlineEnums) {
|
|
380
|
+
parts.push(formatTypeAlias(alias));
|
|
381
|
+
parts.push("\n\n");
|
|
382
|
+
types.push(alias.name);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
const interfaces = generateInterfaces(schemas, opts);
|
|
386
|
+
if (interfaces.length > 0) {
|
|
387
|
+
parts.push("// Interfaces\n");
|
|
388
|
+
for (const iface of interfaces) {
|
|
389
|
+
parts.push(formatInterface(iface));
|
|
390
|
+
parts.push("\n\n");
|
|
391
|
+
types.push(iface.name);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return {
|
|
395
|
+
fileName: opts.fileName ?? "types.ts",
|
|
396
|
+
content: parts.join("").trim() + "\n",
|
|
397
|
+
types
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
function generateTypeScriptFiles(schemas, options = {}) {
|
|
401
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
402
|
+
const files = [];
|
|
403
|
+
const enums = generateEnums(schemas);
|
|
404
|
+
if (enums.length > 0) {
|
|
405
|
+
const content = generateHeader() + enums.map(formatEnum).join("\n\n") + "\n";
|
|
406
|
+
files.push({
|
|
407
|
+
fileName: "enums.ts",
|
|
408
|
+
content,
|
|
409
|
+
types: enums.map((e) => e.name)
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
const inlineEnums = extractInlineEnums(schemas);
|
|
413
|
+
if (inlineEnums.length > 0) {
|
|
414
|
+
const content = generateHeader() + inlineEnums.map(formatTypeAlias).join("\n\n") + "\n";
|
|
415
|
+
files.push({
|
|
416
|
+
fileName: "type-aliases.ts",
|
|
417
|
+
content,
|
|
418
|
+
types: inlineEnums.map((a) => a.name)
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
const interfaces = generateInterfaces(schemas, opts);
|
|
422
|
+
for (const iface of interfaces) {
|
|
423
|
+
const imports = collectImports(iface, enums, inlineEnums, interfaces);
|
|
424
|
+
const importStatement = formatImports(imports);
|
|
425
|
+
const content = generateHeader() + (importStatement ? importStatement + "\n\n" : "") + formatInterface(iface) + "\n";
|
|
426
|
+
files.push({
|
|
427
|
+
fileName: `${toKebabCase(iface.name)}.ts`,
|
|
428
|
+
content,
|
|
429
|
+
types: [iface.name]
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const indexContent = generateIndexFile(files);
|
|
433
|
+
files.push({
|
|
434
|
+
fileName: "index.ts",
|
|
435
|
+
content: indexContent,
|
|
436
|
+
types: []
|
|
437
|
+
});
|
|
438
|
+
return files;
|
|
439
|
+
}
|
|
440
|
+
function toKebabCase(name) {
|
|
441
|
+
return name.replace(/([A-Z])/g, "-$1").toLowerCase().replace(/^-/, "");
|
|
442
|
+
}
|
|
443
|
+
function collectImports(iface, enums, typeAliases, allInterfaces) {
|
|
444
|
+
const imports = /* @__PURE__ */ new Map();
|
|
445
|
+
const enumNames = new Set(enums.map((e) => e.name));
|
|
446
|
+
const aliasNames = new Set(typeAliases.map((a) => a.name));
|
|
447
|
+
const interfaceNames = new Set(allInterfaces.map((i) => i.name));
|
|
448
|
+
for (const prop of iface.properties) {
|
|
449
|
+
if (enumNames.has(prop.type)) {
|
|
450
|
+
const existing = imports.get("./enums.js") ?? [];
|
|
451
|
+
if (!existing.includes(prop.type)) {
|
|
452
|
+
imports.set("./enums.js", [...existing, prop.type]);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
if (aliasNames.has(prop.type)) {
|
|
456
|
+
const existing = imports.get("./type-aliases.js") ?? [];
|
|
457
|
+
if (!existing.includes(prop.type)) {
|
|
458
|
+
imports.set("./type-aliases.js", [...existing, prop.type]);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
const baseType = prop.type.replace("[]", "");
|
|
462
|
+
if (interfaceNames.has(baseType) && baseType !== iface.name) {
|
|
463
|
+
const fileName = `./${toKebabCase(baseType)}.js`;
|
|
464
|
+
const existing = imports.get(fileName) ?? [];
|
|
465
|
+
if (!existing.includes(baseType)) {
|
|
466
|
+
imports.set(fileName, [...existing, baseType]);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
return imports;
|
|
471
|
+
}
|
|
472
|
+
function formatImports(imports) {
|
|
473
|
+
if (imports.size === 0) return "";
|
|
474
|
+
const lines = [];
|
|
475
|
+
for (const [path, names] of imports) {
|
|
476
|
+
lines.push(`import type { ${names.join(", ")} } from '${path}';`);
|
|
477
|
+
}
|
|
478
|
+
return lines.join("\n");
|
|
479
|
+
}
|
|
480
|
+
function generateIndexFile(files) {
|
|
481
|
+
const exports2 = [generateHeader().trim(), ""];
|
|
482
|
+
for (const file of files) {
|
|
483
|
+
if (file.fileName === "index.ts") continue;
|
|
484
|
+
const moduleName = file.fileName.replace(".ts", ".js");
|
|
485
|
+
exports2.push(`export * from './${moduleName}';`);
|
|
486
|
+
}
|
|
487
|
+
return exports2.join("\n") + "\n";
|
|
488
|
+
}
|
|
489
|
+
function generateTypeScript(schemas, options = {}) {
|
|
490
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
491
|
+
if (opts.singleFile) {
|
|
492
|
+
return [generateTypeScriptFile(schemas, opts)];
|
|
493
|
+
}
|
|
494
|
+
return generateTypeScriptFiles(schemas, opts);
|
|
495
|
+
}
|
|
496
|
+
function getTypeScriptPath(file, outputDir = "src/types") {
|
|
497
|
+
return `${outputDir}/${file.fileName}`;
|
|
498
|
+
}
|
|
499
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
500
|
+
0 && (module.exports = {
|
|
501
|
+
enumToUnionType,
|
|
502
|
+
extractInlineEnums,
|
|
503
|
+
formatEnum,
|
|
504
|
+
formatInterface,
|
|
505
|
+
formatProperty,
|
|
506
|
+
formatTypeAlias,
|
|
507
|
+
generateEnums,
|
|
508
|
+
generateInterfaces,
|
|
509
|
+
generateTypeScript,
|
|
510
|
+
generateTypeScriptFile,
|
|
511
|
+
generateTypeScriptFiles,
|
|
512
|
+
getPropertyType,
|
|
513
|
+
getTypeScriptPath,
|
|
514
|
+
propertyToTSProperty,
|
|
515
|
+
schemaToEnum,
|
|
516
|
+
schemaToInterface,
|
|
517
|
+
toEnumMemberName,
|
|
518
|
+
toEnumName,
|
|
519
|
+
toInterfaceName,
|
|
520
|
+
toPropertyName
|
|
521
|
+
});
|
|
522
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/interface-generator.ts","../src/enum-generator.ts","../src/generator.ts"],"sourcesContent":["/**\n * @famgia/omnify-typescript\n *\n * TypeScript type definitions generator for Omnify schemas.\n */\n\nexport type {\n TypeScriptFile,\n TypeScriptOptions,\n TSProperty,\n TSInterface,\n TSEnum,\n TSEnumValue,\n TSTypeAlias,\n} from './types.js';\n\nexport {\n toPropertyName,\n toInterfaceName,\n getPropertyType,\n propertyToTSProperty,\n schemaToInterface,\n formatProperty,\n formatInterface,\n generateInterfaces,\n} from './interface-generator.js';\n\nexport {\n toEnumMemberName,\n toEnumName,\n schemaToEnum,\n generateEnums,\n formatEnum,\n enumToUnionType,\n formatTypeAlias,\n extractInlineEnums,\n} from './enum-generator.js';\n\nexport {\n generateTypeScriptFile,\n generateTypeScriptFiles,\n generateTypeScript,\n getTypeScriptPath,\n} from './generator.js';\n","/**\n * @famgia/omnify-laravel - TypeScript Interface Generator\n *\n * Generates TypeScript interfaces from schemas.\n */\n\nimport type { LoadedSchema, PropertyDefinition, SchemaCollection } from '@famgia/omnify-types';\nimport type { TSInterface, TSProperty, TypeScriptOptions } from './types.js';\n\n/**\n * Maps Omnify property types to TypeScript types.\n */\nconst TYPE_MAP: Record<string, string> = {\n String: 'string',\n Int: 'number',\n BigInt: 'number',\n Float: 'number',\n Boolean: 'boolean',\n Text: 'string',\n LongText: 'string',\n Date: 'string',\n Time: 'string',\n Timestamp: 'string',\n Json: 'unknown',\n Email: 'string',\n Password: 'string',\n Enum: 'string',\n Select: 'string',\n Lookup: 'number',\n};\n\n/**\n * File interface name (references the File.yaml schema).\n * The File schema is auto-generated by ensureFileSchema() when File type is used.\n */\nexport const FILE_INTERFACE_NAME = 'File';\n\n/**\n * Maps primary key types to TypeScript types.\n */\nconst PK_TYPE_MAP: Record<string, string> = {\n Int: 'number',\n BigInt: 'number',\n Uuid: 'string',\n String: 'string',\n};\n\n/**\n * Converts property name to TypeScript property name.\n * Preserves camelCase.\n */\nexport function toPropertyName(name: string): string {\n return name;\n}\n\n/**\n * Converts schema name to TypeScript interface name.\n * Preserves PascalCase.\n */\nexport function toInterfaceName(schemaName: string): string {\n return schemaName;\n}\n\n/**\n * Gets TypeScript type for a property.\n */\nexport function getPropertyType(\n property: PropertyDefinition,\n _allSchemas: SchemaCollection\n): string {\n // Handle File type specially (polymorphic relation to files table)\n // References the File interface generated from File.yaml schema\n if (property.type === 'File') {\n const fileProp = property as { multiple?: boolean };\n if (fileProp.multiple) {\n return `${FILE_INTERFACE_NAME}[]`;\n }\n return `${FILE_INTERFACE_NAME} | null`;\n }\n\n // Handle associations\n if (property.type === 'Association') {\n const assocProp = property as {\n relation?: string;\n target?: string;\n targets?: readonly string[];\n };\n\n const targetName = assocProp.target ?? 'unknown';\n\n switch (assocProp.relation) {\n // Standard relations\n case 'OneToOne':\n case 'ManyToOne':\n return targetName;\n case 'OneToMany':\n case 'ManyToMany':\n return `${targetName}[]`;\n\n // Polymorphic relations\n case 'MorphTo':\n // Union type of all possible targets\n if (assocProp.targets && assocProp.targets.length > 0) {\n return assocProp.targets.join(' | ');\n }\n return 'unknown';\n case 'MorphOne':\n return targetName;\n case 'MorphMany':\n case 'MorphToMany':\n case 'MorphedByMany':\n return `${targetName}[]`;\n\n default:\n return 'unknown';\n }\n }\n\n // Handle enum types\n if (property.type === 'Enum') {\n const enumProp = property as { enum?: string | readonly string[] };\n if (typeof enumProp.enum === 'string') {\n // Reference to a named enum\n return enumProp.enum;\n }\n if (Array.isArray(enumProp.enum)) {\n // Inline enum - create union type\n return enumProp.enum.map(v => `'${v}'`).join(' | ');\n }\n }\n\n // Handle Select with options\n if (property.type === 'Select') {\n const selectProp = property as { options?: readonly string[] };\n if (selectProp.options && selectProp.options.length > 0) {\n return selectProp.options.map(v => `'${v}'`).join(' | ');\n }\n }\n\n // Standard type mapping\n return TYPE_MAP[property.type] ?? 'unknown';\n}\n\n/**\n * Converts a property to TypeScript property definition.\n * For MorphTo, returns multiple properties (_type, _id, and relation).\n */\nexport function propertyToTSProperties(\n propertyName: string,\n property: PropertyDefinition,\n allSchemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TSProperty[] {\n const baseProp = property as { nullable?: boolean; displayName?: string };\n const isReadonly = options.readonly ?? true;\n\n // Handle MorphTo specially - it creates _type and _id columns\n if (property.type === 'Association') {\n const assocProp = property as {\n relation?: string;\n targets?: readonly string[];\n };\n\n if (assocProp.relation === 'MorphTo' && assocProp.targets && assocProp.targets.length > 0) {\n const propBaseName = toPropertyName(propertyName);\n const targetUnion = assocProp.targets.map(t => `'${t}'`).join(' | ');\n const relationUnion = assocProp.targets.join(' | ');\n\n return [\n {\n name: `${propBaseName}Type`,\n type: targetUnion,\n optional: true, // Polymorphic columns are nullable\n readonly: isReadonly,\n comment: `Polymorphic type for ${propertyName}`,\n },\n {\n name: `${propBaseName}Id`,\n type: 'number',\n optional: true,\n readonly: isReadonly,\n comment: `Polymorphic ID for ${propertyName}`,\n },\n {\n name: propBaseName,\n type: `${relationUnion} | null`,\n optional: true,\n readonly: isReadonly,\n comment: baseProp.displayName ?? `Polymorphic relation to ${assocProp.targets.join(', ')}`,\n },\n ];\n }\n }\n\n // Default: single property\n const type = getPropertyType(property, allSchemas);\n\n return [{\n name: toPropertyName(propertyName),\n type,\n optional: baseProp.nullable ?? false,\n readonly: isReadonly,\n comment: baseProp.displayName,\n }];\n}\n\n/**\n * Converts a property to TypeScript property definition (legacy - returns single property).\n */\nexport function propertyToTSProperty(\n propertyName: string,\n property: PropertyDefinition,\n allSchemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TSProperty {\n return propertyToTSProperties(propertyName, property, allSchemas, options)[0]!;\n}\n\n/**\n * Generates TypeScript interface from schema.\n */\nexport function schemaToInterface(\n schema: LoadedSchema,\n allSchemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TSInterface {\n const properties: TSProperty[] = [];\n\n // ID property (only if id is not disabled)\n if (schema.options?.id !== false) {\n const pkType = (schema.options?.idType ?? 'BigInt') as keyof typeof PK_TYPE_MAP;\n properties.push({\n name: 'id',\n type: PK_TYPE_MAP[pkType] ?? 'number',\n optional: false,\n readonly: options.readonly ?? true,\n comment: 'Primary key',\n });\n }\n\n // Schema properties\n if (schema.properties) {\n for (const [propName, property] of Object.entries(schema.properties)) {\n // Use propertyToTSProperties which handles MorphTo returning multiple properties\n properties.push(...propertyToTSProperties(propName, property, allSchemas, options));\n }\n }\n\n // Timestamps\n if (schema.options?.timestamps !== false) {\n properties.push(\n {\n name: 'createdAt',\n type: 'string',\n optional: true,\n readonly: options.readonly ?? true,\n comment: 'Creation timestamp',\n },\n {\n name: 'updatedAt',\n type: 'string',\n optional: true,\n readonly: options.readonly ?? true,\n comment: 'Last update timestamp',\n }\n );\n }\n\n // Soft delete\n if (schema.options?.softDelete) {\n properties.push({\n name: 'deletedAt',\n type: 'string',\n optional: true,\n readonly: options.readonly ?? true,\n comment: 'Soft delete timestamp',\n });\n }\n\n return {\n name: toInterfaceName(schema.name),\n properties,\n comment: schema.displayName ?? schema.name,\n };\n}\n\n/**\n * Formats a TypeScript property.\n */\nexport function formatProperty(property: TSProperty): string {\n const readonly = property.readonly ? 'readonly ' : '';\n const optional = property.optional ? '?' : '';\n const comment = property.comment ? ` /** ${property.comment} */\\n` : '';\n return `${comment} ${readonly}${property.name}${optional}: ${property.type};`;\n}\n\n/**\n * Formats a TypeScript interface.\n */\nexport function formatInterface(iface: TSInterface): string {\n const comment = iface.comment ? `/**\\n * ${iface.comment}\\n */\\n` : '';\n const extendsClause = iface.extends && iface.extends.length > 0\n ? ` extends ${iface.extends.join(', ')}`\n : '';\n const properties = iface.properties.map(formatProperty).join('\\n');\n\n return `${comment}export interface ${iface.name}${extendsClause} {\\n${properties}\\n}`;\n}\n\n/**\n * Generates interfaces for all schemas.\n * Note: File interface is now generated from File.yaml schema (use ensureFileSchema() to auto-create it).\n */\nexport function generateInterfaces(\n schemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TSInterface[] {\n const interfaces: TSInterface[] = [];\n\n for (const schema of Object.values(schemas)) {\n // Skip enum schemas\n if (schema.kind === 'enum') {\n continue;\n }\n\n interfaces.push(schemaToInterface(schema, schemas, options));\n }\n\n return interfaces;\n}\n","/**\n * @famgia/omnify-laravel - TypeScript Enum Generator\n *\n * Generates TypeScript enums from schema enum definitions.\n */\n\nimport type { LoadedSchema, SchemaCollection } from '@famgia/omnify-types';\nimport type { TSEnum, TSEnumValue, TSTypeAlias } from './types.js';\n\n/**\n * Converts enum value to valid TypeScript enum member name.\n */\nexport function toEnumMemberName(value: string): string {\n // Convert to PascalCase and remove invalid characters\n return value\n .split(/[-_\\s]+/)\n .map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join('')\n .replace(/[^a-zA-Z0-9]/g, '');\n}\n\n/**\n * Converts schema name to TypeScript enum name.\n */\nexport function toEnumName(schemaName: string): string {\n return schemaName;\n}\n\n/**\n * Generates TypeScript enum from schema enum.\n */\nexport function schemaToEnum(schema: LoadedSchema): TSEnum | null {\n if (schema.kind !== 'enum' || !schema.values) {\n return null;\n }\n\n const values: TSEnumValue[] = schema.values.map(value => ({\n name: toEnumMemberName(value),\n value,\n }));\n\n return {\n name: toEnumName(schema.name),\n values,\n comment: schema.displayName ?? schema.name,\n };\n}\n\n/**\n * Generates enums for all enum schemas.\n */\nexport function generateEnums(schemas: SchemaCollection): TSEnum[] {\n const enums: TSEnum[] = [];\n\n for (const schema of Object.values(schemas)) {\n if (schema.kind === 'enum') {\n const enumDef = schemaToEnum(schema);\n if (enumDef) {\n enums.push(enumDef);\n }\n }\n }\n\n return enums;\n}\n\n/**\n * Formats a TypeScript enum.\n */\nexport function formatEnum(enumDef: TSEnum): string {\n const comment = enumDef.comment ? `/**\\n * ${enumDef.comment}\\n */\\n` : '';\n const values = enumDef.values\n .map(v => ` ${v.name} = '${v.value}',`)\n .join('\\n');\n\n return `${comment}export enum ${enumDef.name} {\\n${values}\\n}`;\n}\n\n/**\n * Generates a union type alias as an alternative to enum.\n */\nexport function enumToUnionType(enumDef: TSEnum): TSTypeAlias {\n const type = enumDef.values\n .map(v => `'${v.value}'`)\n .join(' | ');\n\n return {\n name: enumDef.name,\n type,\n comment: enumDef.comment,\n };\n}\n\n/**\n * Formats a TypeScript type alias.\n */\nexport function formatTypeAlias(alias: TSTypeAlias): string {\n const comment = alias.comment ? `/**\\n * ${alias.comment}\\n */\\n` : '';\n return `${comment}export type ${alias.name} = ${alias.type};`;\n}\n\n/**\n * Extracts inline enums from properties for type generation.\n */\nexport function extractInlineEnums(schemas: SchemaCollection): TSTypeAlias[] {\n const typeAliases: TSTypeAlias[] = [];\n\n for (const schema of Object.values(schemas)) {\n if (schema.kind === 'enum' || !schema.properties) {\n continue;\n }\n\n for (const [propName, property] of Object.entries(schema.properties)) {\n if (property.type === 'Enum') {\n const enumProp = property as { enum?: readonly string[]; displayName?: string };\n\n // Only handle inline array enums (not references to named enums)\n if (Array.isArray(enumProp.enum) && enumProp.enum.length > 0) {\n const typeName = `${schema.name}${propName.charAt(0).toUpperCase() + propName.slice(1)}`;\n typeAliases.push({\n name: typeName,\n type: enumProp.enum.map(v => `'${v}'`).join(' | '),\n comment: enumProp.displayName ?? `${schema.name} ${propName} enum`,\n });\n }\n }\n\n if (property.type === 'Select') {\n const selectProp = property as { options?: readonly string[]; displayName?: string };\n\n if (selectProp.options && selectProp.options.length > 0) {\n const typeName = `${schema.name}${propName.charAt(0).toUpperCase() + propName.slice(1)}`;\n typeAliases.push({\n name: typeName,\n type: selectProp.options.map(v => `'${v}'`).join(' | '),\n comment: selectProp.displayName ?? `${schema.name} ${propName} options`,\n });\n }\n }\n }\n }\n\n return typeAliases;\n}\n","/**\n * @famgia/omnify-laravel - TypeScript Generator\n *\n * Main TypeScript code generator combining interfaces, enums, and types.\n */\n\nimport type { SchemaCollection } from '@famgia/omnify-types';\nimport type { TypeScriptFile, TypeScriptOptions, TSInterface, TSEnum, TSTypeAlias } from './types.js';\nimport { generateInterfaces, formatInterface } from './interface-generator.js';\nimport { generateEnums, formatEnum, formatTypeAlias, extractInlineEnums } from './enum-generator.js';\n\n/**\n * Default options for TypeScript generation.\n */\nconst DEFAULT_OPTIONS: TypeScriptOptions = {\n singleFile: true,\n fileName: 'types.ts',\n readonly: true,\n strictNullChecks: true,\n};\n\n/**\n * Generates the file header comment.\n */\nfunction generateHeader(): string {\n return `/**\n * Auto-generated TypeScript types from Omnify schemas.\n * DO NOT EDIT - This file is automatically generated.\n */\n\n`;\n}\n\n/**\n * Generates all TypeScript code as a single file.\n */\nexport function generateTypeScriptFile(\n schemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TypeScriptFile {\n const opts = { ...DEFAULT_OPTIONS, ...options };\n const parts: string[] = [generateHeader()];\n const types: string[] = [];\n\n // Generate enums first (they're referenced by interfaces)\n const enums = generateEnums(schemas);\n if (enums.length > 0) {\n parts.push('// Enums\\n');\n for (const enumDef of enums) {\n parts.push(formatEnum(enumDef));\n parts.push('\\n\\n');\n types.push(enumDef.name);\n }\n }\n\n // Generate inline enum type aliases\n const inlineEnums = extractInlineEnums(schemas);\n if (inlineEnums.length > 0) {\n parts.push('// Type Aliases\\n');\n for (const alias of inlineEnums) {\n parts.push(formatTypeAlias(alias));\n parts.push('\\n\\n');\n types.push(alias.name);\n }\n }\n\n // Generate interfaces\n const interfaces = generateInterfaces(schemas, opts);\n if (interfaces.length > 0) {\n parts.push('// Interfaces\\n');\n for (const iface of interfaces) {\n parts.push(formatInterface(iface));\n parts.push('\\n\\n');\n types.push(iface.name);\n }\n }\n\n return {\n fileName: opts.fileName ?? 'types.ts',\n content: parts.join('').trim() + '\\n',\n types,\n };\n}\n\n/**\n * Generates TypeScript code as multiple files.\n */\nexport function generateTypeScriptFiles(\n schemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TypeScriptFile[] {\n const opts = { ...DEFAULT_OPTIONS, ...options };\n const files: TypeScriptFile[] = [];\n\n // Enums file\n const enums = generateEnums(schemas);\n if (enums.length > 0) {\n const content = generateHeader() +\n enums.map(formatEnum).join('\\n\\n') + '\\n';\n files.push({\n fileName: 'enums.ts',\n content,\n types: enums.map(e => e.name),\n });\n }\n\n // Inline enums/type aliases file\n const inlineEnums = extractInlineEnums(schemas);\n if (inlineEnums.length > 0) {\n const content = generateHeader() +\n inlineEnums.map(formatTypeAlias).join('\\n\\n') + '\\n';\n files.push({\n fileName: 'type-aliases.ts',\n content,\n types: inlineEnums.map(a => a.name),\n });\n }\n\n // Individual interface files\n const interfaces = generateInterfaces(schemas, opts);\n for (const iface of interfaces) {\n const imports = collectImports(iface, enums, inlineEnums, interfaces);\n const importStatement = formatImports(imports);\n\n const content = generateHeader() +\n (importStatement ? importStatement + '\\n\\n' : '') +\n formatInterface(iface) + '\\n';\n\n files.push({\n fileName: `${toKebabCase(iface.name)}.ts`,\n content,\n types: [iface.name],\n });\n }\n\n // Index file\n const indexContent = generateIndexFile(files);\n files.push({\n fileName: 'index.ts',\n content: indexContent,\n types: [],\n });\n\n return files;\n}\n\n/**\n * Converts PascalCase to kebab-case.\n */\nfunction toKebabCase(name: string): string {\n return name\n .replace(/([A-Z])/g, '-$1')\n .toLowerCase()\n .replace(/^-/, '');\n}\n\n/**\n * Collects imports needed for an interface.\n */\nfunction collectImports(\n iface: TSInterface,\n enums: TSEnum[],\n typeAliases: TSTypeAlias[],\n allInterfaces: TSInterface[]\n): Map<string, string[]> {\n const imports = new Map<string, string[]>();\n const enumNames = new Set(enums.map(e => e.name));\n const aliasNames = new Set(typeAliases.map(a => a.name));\n const interfaceNames = new Set(allInterfaces.map(i => i.name));\n\n for (const prop of iface.properties) {\n // Check if type references an enum\n if (enumNames.has(prop.type)) {\n const existing = imports.get('./enums.js') ?? [];\n if (!existing.includes(prop.type)) {\n imports.set('./enums.js', [...existing, prop.type]);\n }\n }\n\n // Check if type references a type alias\n if (aliasNames.has(prop.type)) {\n const existing = imports.get('./type-aliases.js') ?? [];\n if (!existing.includes(prop.type)) {\n imports.set('./type-aliases.js', [...existing, prop.type]);\n }\n }\n\n // Check if type references another interface (for relationships)\n const baseType = prop.type.replace('[]', '');\n if (interfaceNames.has(baseType) && baseType !== iface.name) {\n const fileName = `./${toKebabCase(baseType)}.js`;\n const existing = imports.get(fileName) ?? [];\n if (!existing.includes(baseType)) {\n imports.set(fileName, [...existing, baseType]);\n }\n }\n }\n\n return imports;\n}\n\n/**\n * Formats import statements.\n */\nfunction formatImports(imports: Map<string, string[]>): string {\n if (imports.size === 0) return '';\n\n const lines: string[] = [];\n for (const [path, names] of imports) {\n lines.push(`import type { ${names.join(', ')} } from '${path}';`);\n }\n return lines.join('\\n');\n}\n\n/**\n * Generates index.ts file for re-exports.\n */\nfunction generateIndexFile(files: TypeScriptFile[]): string {\n const exports: string[] = [generateHeader().trim(), ''];\n\n for (const file of files) {\n if (file.fileName === 'index.ts') continue;\n const moduleName = file.fileName.replace('.ts', '.js');\n exports.push(`export * from './${moduleName}';`);\n }\n\n return exports.join('\\n') + '\\n';\n}\n\n/**\n * Generates TypeScript types with configurable output.\n */\nexport function generateTypeScript(\n schemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TypeScriptFile[] {\n const opts = { ...DEFAULT_OPTIONS, ...options };\n\n if (opts.singleFile) {\n return [generateTypeScriptFile(schemas, opts)];\n }\n\n return generateTypeScriptFiles(schemas, opts);\n}\n\n/**\n * Gets output path for a TypeScript file.\n */\nexport function getTypeScriptPath(\n file: TypeScriptFile,\n outputDir: string = 'src/types'\n): string {\n return `${outputDir}/${file.fileName}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACYA,IAAM,WAAmC;AAAA,EACvC,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACV;AAMO,IAAM,sBAAsB;AAKnC,IAAM,cAAsC;AAAA,EAC1C,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AACV;AAMO,SAAS,eAAe,MAAsB;AACnD,SAAO;AACT;AAMO,SAAS,gBAAgB,YAA4B;AAC1D,SAAO;AACT;AAKO,SAAS,gBACd,UACA,aACQ;AAGR,MAAI,SAAS,SAAS,QAA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