@famgia/omnify-laravel 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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/migration/schema-builder.ts","../src/migration/generator.ts","../src/typescript/interface-generator.ts","../src/typescript/enum-generator.ts","../src/typescript/generator.ts"],"sourcesContent":["/**\n * @famgia/omnify-laravel\n *\n * Laravel migration and TypeScript type generator for Omnify schemas.\n */\n\n// Migration generation\nexport {\n // Types\n type MigrationFile,\n type MigrationOptions,\n type ColumnMethod,\n type ColumnModifier,\n type ForeignKeyDefinition,\n type IndexDefinition,\n type TableBlueprint,\n type MigrationOperation,\n type MigrationDefinition,\n // Schema builder\n toColumnName,\n toTableName,\n propertyToColumnMethod,\n generatePrimaryKeyColumn,\n generateTimestampColumns,\n generateSoftDeleteColumn,\n generateForeignKey,\n schemaToBlueprint,\n formatColumnMethod,\n formatForeignKey,\n formatIndex,\n // Generator\n generateMigrations,\n generateMigrationFromSchema,\n generateDropMigrationForTable,\n formatMigrationFile,\n getMigrationPath,\n} from './migration/index.js';\n\n// TypeScript generation\nexport {\n // Types\n type TypeScriptFile,\n type TypeScriptOptions,\n type TSProperty,\n type TSInterface,\n type TSEnum,\n type TSEnumValue,\n type TSTypeAlias,\n // Interface generator\n toPropertyName,\n toInterfaceName,\n getPropertyType,\n propertyToTSProperty,\n schemaToInterface,\n formatProperty,\n formatInterface,\n generateInterfaces,\n // Enum generator\n toEnumMemberName,\n toEnumName,\n schemaToEnum,\n generateEnums,\n formatEnum,\n enumToUnionType,\n formatTypeAlias,\n extractInlineEnums,\n // Main generator\n generateTypeScriptFile,\n generateTypeScriptFiles,\n generateTypeScript,\n getTypeScriptPath,\n} from './typescript/index.js';\n","/**\n * @famgia/omnify-laravel - Schema Builder Converter\n *\n * Converts SQL types and operations to Laravel Schema Builder methods.\n */\n\nimport type { PropertyDefinition, LoadedSchema, SchemaCollection } from '@famgia/omnify-types';\nimport type {\n ColumnMethod,\n ColumnModifier,\n ForeignKeyDefinition,\n IndexDefinition,\n TableBlueprint,\n} from './types.js';\n\n/**\n * Maps Omnify property types to Laravel column methods.\n */\nconst TYPE_METHOD_MAP: Record<string, string> = {\n String: 'string',\n Int: 'integer',\n BigInt: 'bigInteger',\n Float: 'double',\n Boolean: 'boolean',\n Text: 'text',\n LongText: 'longText',\n Date: 'date',\n Time: 'time',\n Timestamp: 'timestamp',\n Json: 'json',\n Email: 'string',\n Password: 'string',\n File: 'string',\n MultiFile: 'json',\n Enum: 'enum',\n Select: 'string',\n Lookup: 'unsignedBigInteger',\n};\n\n/**\n * Maps primary key types to Laravel methods.\n */\nconst PK_METHOD_MAP: Record<string, string> = {\n Int: 'increments',\n BigInt: 'bigIncrements',\n Uuid: 'uuid',\n String: 'string',\n};\n\n/**\n * Converts a property name to snake_case column name.\n */\nexport function toColumnName(propertyName: string): string {\n return propertyName.replace(/([A-Z])/g, '_$1').toLowerCase().replace(/^_/, '');\n}\n\n/**\n * Converts schema name to snake_case plural table name.\n */\nexport function toTableName(schemaName: string): string {\n const snakeCase = schemaName\n .replace(/([A-Z])/g, '_$1')\n .toLowerCase()\n .replace(/^_/, '');\n\n // Simple pluralization\n if (snakeCase.endsWith('y')) {\n return snakeCase.slice(0, -1) + 'ies';\n } else if (\n snakeCase.endsWith('s') ||\n snakeCase.endsWith('x') ||\n snakeCase.endsWith('ch') ||\n snakeCase.endsWith('sh')\n ) {\n return snakeCase + 'es';\n } else {\n return snakeCase + 's';\n }\n}\n\n/**\n * Converts a property to Laravel column method.\n */\nexport function propertyToColumnMethod(\n propertyName: string,\n property: PropertyDefinition\n): ColumnMethod | null {\n // Skip associations - they're handled separately\n if (property.type === 'Association') {\n return null;\n }\n\n const columnName = toColumnName(propertyName);\n const method = TYPE_METHOD_MAP[property.type] ?? 'string';\n const args: (string | number | boolean)[] = [columnName];\n const modifiers: ColumnModifier[] = [];\n\n // Handle length for string types\n const propWithLength = property as { length?: number };\n if (method === 'string' && propWithLength.length) {\n args.push(propWithLength.length);\n }\n\n // Handle enum values\n if (property.type === 'Enum') {\n const enumProp = property as { enum?: readonly string[] };\n if (enumProp.enum && enumProp.enum.length > 0) {\n args.push(enumProp.enum as unknown as string);\n }\n }\n\n // Add modifiers\n const baseProp = property as {\n nullable?: boolean;\n unique?: boolean;\n default?: unknown;\n unsigned?: boolean;\n };\n\n if (baseProp.nullable) {\n modifiers.push({ method: 'nullable' });\n }\n\n if (baseProp.unique) {\n modifiers.push({ method: 'unique' });\n }\n\n if (baseProp.default !== undefined) {\n const defaultValue = typeof baseProp.default === 'string'\n ? baseProp.default\n : JSON.stringify(baseProp.default);\n modifiers.push({ method: 'default', args: [defaultValue] });\n }\n\n if (baseProp.unsigned && (method === 'integer' || method === 'bigInteger')) {\n modifiers.push({ method: 'unsigned' });\n }\n\n return {\n name: columnName,\n method,\n args,\n modifiers,\n };\n}\n\n/**\n * Generates primary key column method.\n */\nexport function generatePrimaryKeyColumn(\n pkType: 'Int' | 'BigInt' | 'Uuid' | 'String' = 'BigInt'\n): ColumnMethod {\n const method = PK_METHOD_MAP[pkType] ?? 'bigIncrements';\n\n if (pkType === 'Uuid') {\n return {\n name: 'id',\n method: 'uuid',\n args: ['id'],\n modifiers: [{ method: 'primary' }],\n };\n }\n\n if (pkType === 'String') {\n return {\n name: 'id',\n method: 'string',\n args: ['id', 255],\n modifiers: [{ method: 'primary' }],\n };\n }\n\n // For Int/BigInt, use increments which auto-creates primary key\n return {\n name: 'id',\n method,\n args: ['id'],\n modifiers: [],\n };\n}\n\n/**\n * Generates timestamp columns.\n */\nexport function generateTimestampColumns(): ColumnMethod[] {\n return [\n {\n name: 'created_at',\n method: 'timestamp',\n args: ['created_at'],\n modifiers: [{ method: 'nullable' }],\n },\n {\n name: 'updated_at',\n method: 'timestamp',\n args: ['updated_at'],\n modifiers: [{ method: 'nullable' }],\n },\n ];\n}\n\n/**\n * Generates soft delete column.\n */\nexport function generateSoftDeleteColumn(): ColumnMethod {\n return {\n name: 'deleted_at',\n method: 'timestamp',\n args: ['deleted_at'],\n modifiers: [{ method: 'nullable' }],\n };\n}\n\n/**\n * Generates foreign key column and constraint from association.\n */\nexport function generateForeignKey(\n propertyName: string,\n property: PropertyDefinition,\n allSchemas: SchemaCollection\n): { column: ColumnMethod; foreignKey: ForeignKeyDefinition; index: IndexDefinition } | null {\n if (property.type !== 'Association') {\n return null;\n }\n\n const assocProp = property as {\n relation?: string;\n target?: string;\n onDelete?: string;\n onUpdate?: string;\n };\n\n // Only create FK column for ManyToOne and OneToOne (owning side)\n if (assocProp.relation !== 'ManyToOne' && assocProp.relation !== 'OneToOne') {\n return null;\n }\n\n const columnName = toColumnName(propertyName) + '_id';\n const targetSchema = assocProp.target ? allSchemas[assocProp.target] : undefined;\n const targetTable = assocProp.target ? toTableName(assocProp.target) : 'unknown';\n const targetPkType = targetSchema?.options?.primaryKeyType ?? 'BigInt';\n\n // Determine column method based on target PK type\n let method = 'unsignedBigInteger';\n if (targetPkType === 'Int') {\n method = 'unsignedInteger';\n } else if (targetPkType === 'Uuid') {\n method = 'uuid';\n } else if (targetPkType === 'String') {\n method = 'string';\n }\n\n const column: ColumnMethod = {\n name: columnName,\n method,\n args: [columnName],\n modifiers: assocProp.relation === 'ManyToOne' ? [{ method: 'nullable' }] : [],\n };\n\n const foreignKey: ForeignKeyDefinition = {\n columns: [columnName],\n references: 'id',\n on: [targetTable],\n onDelete: assocProp.onDelete ?? 'restrict',\n onUpdate: assocProp.onUpdate ?? 'cascade',\n };\n\n const index: IndexDefinition = {\n name: `idx_${columnName}`,\n columns: [columnName],\n unique: false,\n };\n\n return { column, foreignKey, index };\n}\n\n/**\n * Generates table blueprint from schema.\n */\nexport function schemaToBlueprint(\n schema: LoadedSchema,\n allSchemas: SchemaCollection\n): TableBlueprint {\n const tableName = toTableName(schema.name);\n const columns: ColumnMethod[] = [];\n const foreignKeys: ForeignKeyDefinition[] = [];\n const indexes: IndexDefinition[] = [];\n\n // Primary key\n const pkType = (schema.options?.primaryKeyType ?? 'BigInt') as 'Int' | 'BigInt' | 'Uuid' | 'String';\n columns.push(generatePrimaryKeyColumn(pkType));\n\n // Process properties\n if (schema.properties) {\n for (const [propName, property] of Object.entries(schema.properties)) {\n // Handle regular columns\n const columnMethod = propertyToColumnMethod(propName, property);\n if (columnMethod) {\n columns.push(columnMethod);\n }\n\n // Handle foreign keys\n const fkResult = generateForeignKey(propName, property, allSchemas);\n if (fkResult) {\n columns.push(fkResult.column);\n foreignKeys.push(fkResult.foreignKey);\n indexes.push(fkResult.index);\n }\n }\n }\n\n // Timestamps\n if (schema.options?.timestamps !== false) {\n columns.push(...generateTimestampColumns());\n }\n\n // Soft delete\n if (schema.options?.softDelete) {\n columns.push(generateSoftDeleteColumn());\n }\n\n // Custom indexes\n if (schema.options?.indexes) {\n for (const index of schema.options.indexes) {\n indexes.push({\n name: index.name,\n columns: index.columns.map(toColumnName),\n unique: index.unique ?? false,\n });\n }\n }\n\n // Unique constraints\n if (schema.options?.unique) {\n const uniqueConstraints = Array.isArray(schema.options.unique[0])\n ? (schema.options.unique as readonly (readonly string[])[])\n : [schema.options.unique as readonly string[]];\n\n for (const constraint of uniqueConstraints) {\n indexes.push({\n columns: constraint.map(toColumnName),\n unique: true,\n });\n }\n }\n\n return {\n tableName,\n columns,\n primaryKey: ['id'],\n foreignKeys,\n indexes,\n };\n}\n\n/**\n * Formats a column method to PHP code.\n */\nexport function formatColumnMethod(column: ColumnMethod): string {\n const args = column.args.map(arg => {\n if (typeof arg === 'string') {\n return `'${arg}'`;\n }\n if (Array.isArray(arg)) {\n return `[${(arg as string[]).map(v => `'${v}'`).join(', ')}]`;\n }\n return String(arg);\n }).join(', ');\n\n let code = `$table->${column.method}(${args})`;\n\n for (const modifier of column.modifiers) {\n if (modifier.args && modifier.args.length > 0) {\n const modArgs = modifier.args.map(arg => {\n if (typeof arg === 'string') {\n return `'${arg}'`;\n }\n return String(arg);\n }).join(', ');\n code += `->${modifier.method}(${modArgs})`;\n } else {\n code += `->${modifier.method}()`;\n }\n }\n\n return code + ';';\n}\n\n/**\n * Formats a foreign key to PHP code.\n */\nexport function formatForeignKey(fk: ForeignKeyDefinition): string {\n const column = fk.columns[0];\n const table = fk.on[0];\n let code = `$table->foreign('${column}')->references('${fk.references}')->on('${table}')`;\n\n if (fk.onDelete) {\n code += `->onDelete('${fk.onDelete}')`;\n }\n if (fk.onUpdate) {\n code += `->onUpdate('${fk.onUpdate}')`;\n }\n\n return code + ';';\n}\n\n/**\n * Formats an index to PHP code.\n */\nexport function formatIndex(index: IndexDefinition): string {\n const columns = index.columns.length === 1\n ? `'${index.columns[0]}'`\n : `[${index.columns.map(c => `'${c}'`).join(', ')}]`;\n\n const method = index.unique ? 'unique' : 'index';\n const name = index.name ? `, '${index.name}'` : '';\n\n return `$table->${method}(${columns}${name});`;\n}\n","/**\n * @famgia/omnify-laravel - Migration Generator\n *\n * Generates Laravel migration files from schemas.\n */\n\nimport type { LoadedSchema, SchemaCollection } from '@famgia/omnify-types';\nimport type {\n MigrationFile,\n MigrationOptions,\n TableBlueprint,\n} from './types.js';\nimport {\n schemaToBlueprint,\n formatColumnMethod,\n formatForeignKey,\n formatIndex,\n} from './schema-builder.js';\n\n/**\n * Generates timestamp prefix for migration file name.\n */\nfunction generateTimestamp(): string {\n const now = new Date();\n const year = now.getFullYear();\n const month = String(now.getMonth() + 1).padStart(2, '0');\n const day = String(now.getDate()).padStart(2, '0');\n const hours = String(now.getHours()).padStart(2, '0');\n const minutes = String(now.getMinutes()).padStart(2, '0');\n const seconds = String(now.getSeconds()).padStart(2, '0');\n return `${year}_${month}_${day}_${hours}${minutes}${seconds}`;\n}\n\n/**\n * Converts table name to Laravel migration class name.\n */\nfunction toClassName(tableName: string, type: 'create' | 'alter' | 'drop'): string {\n const pascalCase = tableName\n .split('_')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n\n switch (type) {\n case 'create':\n return `Create${pascalCase}Table`;\n case 'alter':\n return `Alter${pascalCase}Table`;\n case 'drop':\n return `Drop${pascalCase}Table`;\n }\n}\n\n/**\n * Generates file name for migration.\n */\nfunction generateFileName(\n tableName: string,\n type: 'create' | 'alter' | 'drop',\n timestamp?: string\n): string {\n const ts = timestamp ?? generateTimestamp();\n const action = type === 'create' ? 'create' : type === 'drop' ? 'drop' : 'update';\n return `${ts}_${action}_${tableName}_table.php`;\n}\n\n/**\n * Renders the up method body for a create table operation.\n */\nfunction renderCreateTableUp(blueprint: TableBlueprint): string {\n const lines: string[] = [];\n\n // Column definitions\n for (const column of blueprint.columns) {\n lines.push(` ${formatColumnMethod(column)}`);\n }\n\n // Foreign keys (separate for Laravel best practices)\n // Note: Foreign keys should be in a separate migration or at the end\n // We'll include them in the same migration for simplicity\n\n return lines.join('\\n');\n}\n\n/**\n * Renders foreign key constraints (usually added after all columns).\n */\nfunction renderForeignKeys(blueprint: TableBlueprint): string {\n if (blueprint.foreignKeys.length === 0) {\n return '';\n }\n\n const lines = blueprint.foreignKeys.map(fk => ` ${formatForeignKey(fk)}`);\n return '\\n' + lines.join('\\n');\n}\n\n/**\n * Renders indexes.\n */\nfunction renderIndexes(blueprint: TableBlueprint): string {\n // Filter out indexes that are already handled (primary key, unique columns)\n const customIndexes = blueprint.indexes.filter(idx => {\n // Skip single-column unique indexes (handled by column modifier)\n if (idx.unique && idx.columns.length === 1) {\n return false;\n }\n return true;\n });\n\n if (customIndexes.length === 0) {\n return '';\n }\n\n const lines = customIndexes.map(idx => ` ${formatIndex(idx)}`);\n return '\\n' + lines.join('\\n');\n}\n\n/**\n * Generates a create table migration.\n */\nfunction generateCreateMigration(\n blueprint: TableBlueprint,\n options: MigrationOptions = {}\n): MigrationFile {\n const className = toClassName(blueprint.tableName, 'create');\n const fileName = generateFileName(blueprint.tableName, 'create', options.timestamp);\n\n const connection = options.connection\n ? `\\n protected $connection = '${options.connection}';\\n`\n : '';\n\n const upContent = renderCreateTableUp(blueprint);\n const foreignKeyContent = renderForeignKeys(blueprint);\n const indexContent = renderIndexes(blueprint);\n\n const content = `<?php\n\nuse Illuminate\\\\Database\\\\Migrations\\\\Migration;\nuse Illuminate\\\\Database\\\\Schema\\\\Blueprint;\nuse Illuminate\\\\Support\\\\Facades\\\\Schema;\n\nreturn new class extends Migration\n{${connection}\n /**\n * Run the migrations.\n */\n public function up(): void\n {\n Schema::create('${blueprint.tableName}', function (Blueprint $table) {\n${upContent}${foreignKeyContent}${indexContent}\n });\n }\n\n /**\n * Reverse the migrations.\n */\n public function down(): void\n {\n Schema::dropIfExists('${blueprint.tableName}');\n }\n};\n`;\n\n return {\n fileName,\n className,\n content,\n tables: [blueprint.tableName],\n type: 'create',\n };\n}\n\n/**\n * Generates a drop table migration.\n */\nfunction generateDropMigration(\n tableName: string,\n options: MigrationOptions = {}\n): MigrationFile {\n const className = toClassName(tableName, 'drop');\n const fileName = generateFileName(tableName, 'drop', options.timestamp);\n\n const connection = options.connection\n ? `\\n protected $connection = '${options.connection}';\\n`\n : '';\n\n const content = `<?php\n\nuse Illuminate\\\\Database\\\\Migrations\\\\Migration;\nuse Illuminate\\\\Database\\\\Schema\\\\Blueprint;\nuse Illuminate\\\\Support\\\\Facades\\\\Schema;\n\nreturn new class extends Migration\n{${connection}\n /**\n * Run the migrations.\n */\n public function up(): void\n {\n Schema::dropIfExists('${tableName}');\n }\n\n /**\n * Reverse the migrations.\n */\n public function down(): void\n {\n // Cannot recreate table without schema information\n // This is a one-way migration\n }\n};\n`;\n\n return {\n fileName,\n className,\n content,\n tables: [tableName],\n type: 'drop',\n };\n}\n\n/**\n * Generates migrations for all schemas.\n */\nexport function generateMigrations(\n schemas: SchemaCollection,\n options: MigrationOptions = {}\n): MigrationFile[] {\n const migrations: MigrationFile[] = [];\n let timestampOffset = 0;\n\n for (const schema of Object.values(schemas)) {\n // Skip enum schemas\n if (schema.kind === 'enum') {\n continue;\n }\n\n // Generate timestamp with offset to ensure unique filenames\n const timestamp = options.timestamp ?? generateTimestamp();\n const offsetTimestamp = incrementTimestamp(timestamp, timestampOffset);\n timestampOffset++;\n\n const blueprint = schemaToBlueprint(schema, schemas);\n const migration = generateCreateMigration(blueprint, {\n ...options,\n timestamp: offsetTimestamp,\n });\n migrations.push(migration);\n }\n\n return migrations;\n}\n\n/**\n * Increments a timestamp by seconds.\n */\nfunction incrementTimestamp(timestamp: string, seconds: number): string {\n if (seconds === 0) return timestamp;\n\n // Parse timestamp: YYYY_MM_DD_HHMMSS\n const parts = timestamp.split('_');\n if (parts.length < 4) {\n // Invalid format, return original\n return timestamp;\n }\n\n const yearPart = parts[0] ?? '2024';\n const monthPart = parts[1] ?? '01';\n const dayPart = parts[2] ?? '01';\n const timePart = parts[3] ?? '000000';\n\n const year = parseInt(yearPart, 10);\n const month = parseInt(monthPart, 10) - 1;\n const day = parseInt(dayPart, 10);\n const hours = parseInt(timePart.substring(0, 2), 10);\n const minutes = parseInt(timePart.substring(2, 4), 10);\n const secs = parseInt(timePart.substring(4, 6), 10);\n\n const date = new Date(year, month, day, hours, minutes, secs + seconds);\n\n const newYear = date.getFullYear();\n const newMonth = String(date.getMonth() + 1).padStart(2, '0');\n const newDay = String(date.getDate()).padStart(2, '0');\n const newHours = String(date.getHours()).padStart(2, '0');\n const newMinutes = String(date.getMinutes()).padStart(2, '0');\n const newSecs = String(date.getSeconds()).padStart(2, '0');\n\n return `${newYear}_${newMonth}_${newDay}_${newHours}${newMinutes}${newSecs}`;\n}\n\n/**\n * Generates migration from a single schema.\n */\nexport function generateMigrationFromSchema(\n schema: LoadedSchema,\n allSchemas: SchemaCollection,\n options: MigrationOptions = {}\n): MigrationFile {\n const blueprint = schemaToBlueprint(schema, allSchemas);\n return generateCreateMigration(blueprint, options);\n}\n\n/**\n * Generates drop migration for a table.\n */\nexport function generateDropMigrationForTable(\n tableName: string,\n options: MigrationOptions = {}\n): MigrationFile {\n return generateDropMigration(tableName, options);\n}\n\n/**\n * Formats migration content for writing to file.\n */\nexport function formatMigrationFile(migration: MigrationFile): string {\n return migration.content;\n}\n\n/**\n * Gets the output path for a migration file.\n */\nexport function getMigrationPath(\n migration: MigrationFile,\n outputDir: string = 'database/migrations'\n): string {\n return `${outputDir}/${migration.fileName}`;\n}\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 File: 'string',\n MultiFile: 'string[]',\n Enum: 'string',\n Select: 'string',\n Lookup: 'number',\n};\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 associations\n if (property.type === 'Association') {\n const assocProp = property as {\n relation?: string;\n target?: string;\n };\n\n const targetName = assocProp.target ?? 'unknown';\n\n switch (assocProp.relation) {\n case 'OneToOne':\n case 'ManyToOne':\n return targetName;\n case 'OneToMany':\n case 'ManyToMany':\n return `${targetName}[]`;\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 */\nexport function propertyToTSProperty(\n propertyName: string,\n property: PropertyDefinition,\n allSchemas: SchemaCollection,\n options: TypeScriptOptions = {}\n): TSProperty {\n const type = getPropertyType(property, allSchemas);\n const baseProp = property as { nullable?: boolean; displayName?: string };\n\n return {\n name: toPropertyName(propertyName),\n type,\n optional: baseProp.nullable ?? false,\n readonly: options.readonly ?? true,\n comment: baseProp.displayName,\n };\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\n const pkType = (schema.options?.primaryKeyType ?? '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 // Schema properties\n if (schema.properties) {\n for (const [propName, property] of Object.entries(schema.properties)) {\n properties.push(propertyToTSProperty(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 */\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACkBA,IAAM,kBAA0C;AAAA,EAC9C,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,WAAW;AAAA,EACX,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AACV;AAKA,IAAM,gBAAwC;AAAA,EAC5C,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AACV;AAKO,SAAS,aAAa,cAA8B;AACzD,SAAO,aAAa,QAAQ,YAAY,KAAK,EAAE,YAAY,EAAE,QAAQ,MAAM,EAAE;AAC/E;AAKO,SAAS,YAAY,YAA4B;AACtD,QAAM,YAAY,WACf,QAAQ,YAAY,K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EtD,aAAW,QAAQ,OAAO;AACxB,QAAI,KAAK,aAAa,WAAY;AAClC,UAAM,aAAa,KAAK,SAAS,QAAQ,OAAO,KAAK;AACrD,IAAAA,SAAQ,KAAK,oBAAoB,UAAU,IAAI;AAAA,EACjD;AAEA,SAAOA,SAAQ,KAAK,IAAI,IAAI;AAC9B;AAKO,SAAS,mBACd,SACA,UAA6B,CAAC,GACZ;AAClB,QAAM,OAAO,EAAE,GAAG,iBAAiB,GAAG,QAAQ;AAE9C,MAAI,KAAK,YAAY;AACnB,WAAO,CAAC,uBAAuB,SAAS,IAAI,CAAC;AAAA,EAC/C;AAEA,SAAO,wBAAwB,SAAS,IAAI;AAC9C;AAKO,SAAS,kBACd,MACA,YAAoB,aACZ;AACR,SAAO,GAAG,SAAS,IAAI,KAAK,QAAQ;AACtC;","names":["exports"]}
@@ -0,0 +1,402 @@
1
+ import { PropertyDefinition, SchemaCollection, LoadedSchema } from '@famgia/omnify-types';
2
+
3
+ /**
4
+ * @famgia/omnify-laravel - Migration Types
5
+ *
6
+ * Types for Laravel migration generation.
7
+ */
8
+ /**
9
+ * Laravel migration file structure.
10
+ */
11
+ interface MigrationFile {
12
+ /** File name with timestamp prefix */
13
+ readonly fileName: string;
14
+ /** Migration class name */
15
+ readonly className: string;
16
+ /** Full file content */
17
+ readonly content: string;
18
+ /** Tables affected */
19
+ readonly tables: readonly string[];
20
+ /** Whether this is a create or alter migration */
21
+ readonly type: 'create' | 'alter' | 'drop';
22
+ }
23
+ /**
24
+ * Migration generation options.
25
+ */
26
+ interface MigrationOptions {
27
+ /** Output directory for migrations */
28
+ readonly outputDir?: string | undefined;
29
+ /** Timestamp prefix (defaults to current time) */
30
+ readonly timestamp?: string | undefined;
31
+ /** Whether to generate down migration */
32
+ readonly generateDown?: boolean | undefined;
33
+ /** Database connection name */
34
+ readonly connection?: string | undefined;
35
+ }
36
+ /**
37
+ * Schema Builder column method.
38
+ */
39
+ interface ColumnMethod {
40
+ /** Column name */
41
+ readonly name: string;
42
+ /** Method name (e.g., 'string', 'integer', 'boolean') */
43
+ readonly method: string;
44
+ /** Method arguments */
45
+ readonly args: readonly (string | number | boolean)[];
46
+ /** Chained modifiers (e.g., nullable(), unique(), default()) */
47
+ readonly modifiers: readonly ColumnModifier[];
48
+ }
49
+ /**
50
+ * Column modifier (chained method).
51
+ */
52
+ interface ColumnModifier {
53
+ /** Modifier method name */
54
+ readonly method: string;
55
+ /** Modifier arguments */
56
+ readonly args?: readonly (string | number | boolean)[] | undefined;
57
+ }
58
+ /**
59
+ * Foreign key definition for Schema Builder.
60
+ */
61
+ interface ForeignKeyDefinition {
62
+ /** Local column(s) */
63
+ readonly columns: readonly string[];
64
+ /** Referenced table */
65
+ readonly references: string;
66
+ /** Referenced column(s) */
67
+ readonly on: readonly string[];
68
+ /** ON DELETE action */
69
+ readonly onDelete?: string | undefined;
70
+ /** ON UPDATE action */
71
+ readonly onUpdate?: string | undefined;
72
+ }
73
+ /**
74
+ * Index definition for Schema Builder.
75
+ */
76
+ interface IndexDefinition {
77
+ /** Index name */
78
+ readonly name?: string | undefined;
79
+ /** Columns in the index */
80
+ readonly columns: readonly string[];
81
+ /** Whether this is a unique index */
82
+ readonly unique: boolean;
83
+ }
84
+ /**
85
+ * Table blueprint for Schema Builder.
86
+ */
87
+ interface TableBlueprint {
88
+ /** Table name */
89
+ readonly tableName: string;
90
+ /** Column definitions */
91
+ readonly columns: readonly ColumnMethod[];
92
+ /** Primary key column(s) */
93
+ readonly primaryKey?: readonly string[] | undefined;
94
+ /** Foreign key constraints */
95
+ readonly foreignKeys: readonly ForeignKeyDefinition[];
96
+ /** Index definitions */
97
+ readonly indexes: readonly IndexDefinition[];
98
+ }
99
+ /**
100
+ * Migration operation (up or down).
101
+ */
102
+ interface MigrationOperation {
103
+ /** Operation type */
104
+ readonly type: 'create' | 'table' | 'drop' | 'dropIfExists';
105
+ /** Table name */
106
+ readonly tableName: string;
107
+ /** Blueprint (for create/table operations) */
108
+ readonly blueprint?: TableBlueprint | undefined;
109
+ }
110
+ /**
111
+ * Complete migration definition.
112
+ */
113
+ interface MigrationDefinition {
114
+ /** Migration class name */
115
+ readonly className: string;
116
+ /** UP operations */
117
+ readonly up: readonly MigrationOperation[];
118
+ /** DOWN operations */
119
+ readonly down: readonly MigrationOperation[];
120
+ /** Database connection */
121
+ readonly connection?: string | undefined;
122
+ }
123
+
124
+ /**
125
+ * @famgia/omnify-laravel - Schema Builder Converter
126
+ *
127
+ * Converts SQL types and operations to Laravel Schema Builder methods.
128
+ */
129
+
130
+ /**
131
+ * Converts a property name to snake_case column name.
132
+ */
133
+ declare function toColumnName(propertyName: string): string;
134
+ /**
135
+ * Converts schema name to snake_case plural table name.
136
+ */
137
+ declare function toTableName(schemaName: string): string;
138
+ /**
139
+ * Converts a property to Laravel column method.
140
+ */
141
+ declare function propertyToColumnMethod(propertyName: string, property: PropertyDefinition): ColumnMethod | null;
142
+ /**
143
+ * Generates primary key column method.
144
+ */
145
+ declare function generatePrimaryKeyColumn(pkType?: 'Int' | 'BigInt' | 'Uuid' | 'String'): ColumnMethod;
146
+ /**
147
+ * Generates timestamp columns.
148
+ */
149
+ declare function generateTimestampColumns(): ColumnMethod[];
150
+ /**
151
+ * Generates soft delete column.
152
+ */
153
+ declare function generateSoftDeleteColumn(): ColumnMethod;
154
+ /**
155
+ * Generates foreign key column and constraint from association.
156
+ */
157
+ declare function generateForeignKey(propertyName: string, property: PropertyDefinition, allSchemas: SchemaCollection): {
158
+ column: ColumnMethod;
159
+ foreignKey: ForeignKeyDefinition;
160
+ index: IndexDefinition;
161
+ } | null;
162
+ /**
163
+ * Generates table blueprint from schema.
164
+ */
165
+ declare function schemaToBlueprint(schema: LoadedSchema, allSchemas: SchemaCollection): TableBlueprint;
166
+ /**
167
+ * Formats a column method to PHP code.
168
+ */
169
+ declare function formatColumnMethod(column: ColumnMethod): string;
170
+ /**
171
+ * Formats a foreign key to PHP code.
172
+ */
173
+ declare function formatForeignKey(fk: ForeignKeyDefinition): string;
174
+ /**
175
+ * Formats an index to PHP code.
176
+ */
177
+ declare function formatIndex(index: IndexDefinition): string;
178
+
179
+ /**
180
+ * @famgia/omnify-laravel - Migration Generator
181
+ *
182
+ * Generates Laravel migration files from schemas.
183
+ */
184
+
185
+ /**
186
+ * Generates migrations for all schemas.
187
+ */
188
+ declare function generateMigrations(schemas: SchemaCollection, options?: MigrationOptions): MigrationFile[];
189
+ /**
190
+ * Generates migration from a single schema.
191
+ */
192
+ declare function generateMigrationFromSchema(schema: LoadedSchema, allSchemas: SchemaCollection, options?: MigrationOptions): MigrationFile;
193
+ /**
194
+ * Generates drop migration for a table.
195
+ */
196
+ declare function generateDropMigrationForTable(tableName: string, options?: MigrationOptions): MigrationFile;
197
+ /**
198
+ * Formats migration content for writing to file.
199
+ */
200
+ declare function formatMigrationFile(migration: MigrationFile): string;
201
+ /**
202
+ * Gets the output path for a migration file.
203
+ */
204
+ declare function getMigrationPath(migration: MigrationFile, outputDir?: string): string;
205
+
206
+ /**
207
+ * @famgia/omnify-laravel - TypeScript Types
208
+ *
209
+ * Types for TypeScript code generation.
210
+ */
211
+ /**
212
+ * Generated TypeScript file.
213
+ */
214
+ interface TypeScriptFile {
215
+ /** File name */
216
+ readonly fileName: string;
217
+ /** Full file content */
218
+ readonly content: string;
219
+ /** Types defined in this file */
220
+ readonly types: readonly string[];
221
+ }
222
+ /**
223
+ * TypeScript generation options.
224
+ */
225
+ interface TypeScriptOptions {
226
+ /** Output directory for TypeScript files */
227
+ readonly outputDir?: string | undefined;
228
+ /** Whether to generate a single file or multiple files */
229
+ readonly singleFile?: boolean | undefined;
230
+ /** File name for single file output */
231
+ readonly fileName?: string | undefined;
232
+ /** Whether to export as default */
233
+ readonly exportDefault?: boolean | undefined;
234
+ /** Whether to include readonly modifiers */
235
+ readonly readonly?: boolean | undefined;
236
+ /** Whether to use strict null checks compatible types */
237
+ readonly strictNullChecks?: boolean | undefined;
238
+ }
239
+ /**
240
+ * TypeScript property definition.
241
+ */
242
+ interface TSProperty {
243
+ /** Property name */
244
+ readonly name: string;
245
+ /** TypeScript type */
246
+ readonly type: string;
247
+ /** Whether the property is optional */
248
+ readonly optional: boolean;
249
+ /** Whether the property is readonly */
250
+ readonly readonly: boolean;
251
+ /** JSDoc comment */
252
+ readonly comment?: string | undefined;
253
+ }
254
+ /**
255
+ * TypeScript interface definition.
256
+ */
257
+ interface TSInterface {
258
+ /** Interface name */
259
+ readonly name: string;
260
+ /** Properties */
261
+ readonly properties: readonly TSProperty[];
262
+ /** Extended interfaces */
263
+ readonly extends?: readonly string[] | undefined;
264
+ /** JSDoc comment */
265
+ readonly comment?: string | undefined;
266
+ }
267
+ /**
268
+ * TypeScript enum definition.
269
+ */
270
+ interface TSEnum {
271
+ /** Enum name */
272
+ readonly name: string;
273
+ /** Enum values */
274
+ readonly values: readonly TSEnumValue[];
275
+ /** JSDoc comment */
276
+ readonly comment?: string | undefined;
277
+ }
278
+ /**
279
+ * TypeScript enum value.
280
+ */
281
+ interface TSEnumValue {
282
+ /** Value name */
283
+ readonly name: string;
284
+ /** Value (string or number) */
285
+ readonly value: string | number;
286
+ }
287
+ /**
288
+ * TypeScript type alias definition.
289
+ */
290
+ interface TSTypeAlias {
291
+ /** Type name */
292
+ readonly name: string;
293
+ /** Type definition */
294
+ readonly type: string;
295
+ /** JSDoc comment */
296
+ readonly comment?: string | undefined;
297
+ }
298
+
299
+ /**
300
+ * @famgia/omnify-laravel - TypeScript Interface Generator
301
+ *
302
+ * Generates TypeScript interfaces from schemas.
303
+ */
304
+
305
+ /**
306
+ * Converts property name to TypeScript property name.
307
+ * Preserves camelCase.
308
+ */
309
+ declare function toPropertyName(name: string): string;
310
+ /**
311
+ * Converts schema name to TypeScript interface name.
312
+ * Preserves PascalCase.
313
+ */
314
+ declare function toInterfaceName(schemaName: string): string;
315
+ /**
316
+ * Gets TypeScript type for a property.
317
+ */
318
+ declare function getPropertyType(property: PropertyDefinition, _allSchemas: SchemaCollection): string;
319
+ /**
320
+ * Converts a property to TypeScript property definition.
321
+ */
322
+ declare function propertyToTSProperty(propertyName: string, property: PropertyDefinition, allSchemas: SchemaCollection, options?: TypeScriptOptions): TSProperty;
323
+ /**
324
+ * Generates TypeScript interface from schema.
325
+ */
326
+ declare function schemaToInterface(schema: LoadedSchema, allSchemas: SchemaCollection, options?: TypeScriptOptions): TSInterface;
327
+ /**
328
+ * Formats a TypeScript property.
329
+ */
330
+ declare function formatProperty(property: TSProperty): string;
331
+ /**
332
+ * Formats a TypeScript interface.
333
+ */
334
+ declare function formatInterface(iface: TSInterface): string;
335
+ /**
336
+ * Generates interfaces for all schemas.
337
+ */
338
+ declare function generateInterfaces(schemas: SchemaCollection, options?: TypeScriptOptions): TSInterface[];
339
+
340
+ /**
341
+ * @famgia/omnify-laravel - TypeScript Enum Generator
342
+ *
343
+ * Generates TypeScript enums from schema enum definitions.
344
+ */
345
+
346
+ /**
347
+ * Converts enum value to valid TypeScript enum member name.
348
+ */
349
+ declare function toEnumMemberName(value: string): string;
350
+ /**
351
+ * Converts schema name to TypeScript enum name.
352
+ */
353
+ declare function toEnumName(schemaName: string): string;
354
+ /**
355
+ * Generates TypeScript enum from schema enum.
356
+ */
357
+ declare function schemaToEnum(schema: LoadedSchema): TSEnum | null;
358
+ /**
359
+ * Generates enums for all enum schemas.
360
+ */
361
+ declare function generateEnums(schemas: SchemaCollection): TSEnum[];
362
+ /**
363
+ * Formats a TypeScript enum.
364
+ */
365
+ declare function formatEnum(enumDef: TSEnum): string;
366
+ /**
367
+ * Generates a union type alias as an alternative to enum.
368
+ */
369
+ declare function enumToUnionType(enumDef: TSEnum): TSTypeAlias;
370
+ /**
371
+ * Formats a TypeScript type alias.
372
+ */
373
+ declare function formatTypeAlias(alias: TSTypeAlias): string;
374
+ /**
375
+ * Extracts inline enums from properties for type generation.
376
+ */
377
+ declare function extractInlineEnums(schemas: SchemaCollection): TSTypeAlias[];
378
+
379
+ /**
380
+ * @famgia/omnify-laravel - TypeScript Generator
381
+ *
382
+ * Main TypeScript code generator combining interfaces, enums, and types.
383
+ */
384
+
385
+ /**
386
+ * Generates all TypeScript code as a single file.
387
+ */
388
+ declare function generateTypeScriptFile(schemas: SchemaCollection, options?: TypeScriptOptions): TypeScriptFile;
389
+ /**
390
+ * Generates TypeScript code as multiple files.
391
+ */
392
+ declare function generateTypeScriptFiles(schemas: SchemaCollection, options?: TypeScriptOptions): TypeScriptFile[];
393
+ /**
394
+ * Generates TypeScript types with configurable output.
395
+ */
396
+ declare function generateTypeScript(schemas: SchemaCollection, options?: TypeScriptOptions): TypeScriptFile[];
397
+ /**
398
+ * Gets output path for a TypeScript file.
399
+ */
400
+ declare function getTypeScriptPath(file: TypeScriptFile, outputDir?: string): string;
401
+
402
+ export { type ColumnMethod, type ColumnModifier, type ForeignKeyDefinition, type IndexDefinition, type MigrationDefinition, type MigrationFile, type MigrationOperation, type MigrationOptions, type TSEnum, type TSEnumValue, type TSInterface, type TSProperty, type TSTypeAlias, type TableBlueprint, type TypeScriptFile, type TypeScriptOptions, enumToUnionType, extractInlineEnums, formatColumnMethod, formatEnum, formatForeignKey, formatIndex, formatInterface, formatMigrationFile, formatProperty, formatTypeAlias, generateDropMigrationForTable, generateEnums, generateForeignKey, generateInterfaces, generateMigrationFromSchema, generateMigrations, generatePrimaryKeyColumn, generateSoftDeleteColumn, generateTimestampColumns, generateTypeScript, generateTypeScriptFile, generateTypeScriptFiles, getMigrationPath, getPropertyType, getTypeScriptPath, propertyToColumnMethod, propertyToTSProperty, schemaToBlueprint, schemaToEnum, schemaToInterface, toColumnName, toEnumMemberName, toEnumName, toInterfaceName, toPropertyName, toTableName };