/** * Port of SchemaReader.php — reads schemas.json data. */ import type { SchemasJson, SchemaDefinition, ExpandedProperty, PackageExportInfo, AuditConfigExport } from '../types.js'; export declare class SchemaReader { private data; constructor(data: SchemasJson); static fromData(data: SchemasJson): SchemaReader; /** Returns the raw root document — needed by generators that read * top-level config like locale.enforceLanguageFk. */ getRoot(): SchemasJson; getSchemas(): Record; getSchema(name: string): SchemaDefinition | undefined; /** Find a pivot by its logical pair, independent of the pivot schema's * filename/name. User-authored pivots predate the sorted `` naming * convention and may be called `CouponBranch` for `[Coupon, Branch]`. */ findPivotSchema(a: string, b: string): { name: string; schema: SchemaDefinition; } | undefined; getObjectSchemas(): Record; getVisibleObjectSchemas(): Record; getEnumSchemas(): Record; /** Check if a schema belongs to a package. */ isPackageSchema(name: string): boolean; /** Object schemas owned by the project (not from packages). */ getProjectObjectSchemas(): Record; /** Object schemas from packages (not project-owned). */ getPackageObjectSchemas(): Record; /** Visible object schemas owned by the project. */ getProjectVisibleObjectSchemas(): Record; /** Get the top-level packages map. */ getPackages(): Record; /** * Resolve the model namespace for a target schema. * - Project schema → uses the project's model namespace * - Package schema → uses the package's codegen.laravel.model.namespace (if set) */ resolveModelNamespace(targetName: string, projectModelNamespace: string): string; /** * Resolve the resource namespace for a target schema. * Returns null if the target is a package schema without a resource namespace * (meaning no resource class exists for it in the project). */ resolveResourceNamespace(targetName: string, projectResourceNamespace: string): string | null; getCompoundTypes(): Record; getSimpleTypes(): Record; getCustomEnums(): Record; getDatabaseDriver(): string; getLocale(): { readonly locales: string[]; readonly defaultLocale: string; readonly fallbackLocale: string; readonly enforceLanguageFk?: boolean; }; getLocales(): string[]; getDefaultLocale(): string; getExpandedProperties(schemaName: string): Record; getPropertyOrder(schemaName: string): string[]; getTableName(schemaName: string): string; /** Get schemas that have api options configured. */ getSchemasWithApi(): Record; /** Check if any schema has api options. */ hasApiSchemas(): boolean; /** Check if any schema has File-type properties OR the project has * `file:` config (issue #64: generate File infrastructure even when * no schema declares `type: File` yet). */ hasFileProperties(): boolean; /** Get the file config from schemas.json. */ getFileConfig(): import("../types.js").FileConfigExport | null; /** Get all schemas that have File-type properties. */ getSchemasWithFileProperties(): Record; /** Get global audit config from schemas.json. */ getAuditConfig(): AuditConfigExport | null; /** True when ANY schema (project or package) is audited — the audits * table + supporting infra (trait, job, model) are emitted as a unit. */ hasAuditLog(): boolean; /** Resolve per-schema audit-log enablement: per-schema override wins * over the global default. Returns false for non-object schemas. */ isAuditLogEnabled(schemaName: string): boolean; /** Object schemas with audit-log enabled (folded global + per-schema). */ getSchemasWithAuditLog(): Record; /** Merged scrub list for a schema (global defaults + per-schema overrides). * Duplicates are de-duplicated; order is global-first then per-schema. */ getAuditExcludesFor(schemaName: string): string[]; /** Static tag list configured for a schema (or empty). Used by the * trait to populate the `tags` column on every audit row. */ getAuditTagsFor(schemaName: string): string[]; /** Audit user-model schema name (typically `User`). Required when the * feature is enabled — the omnify-go validator already rejects * `audit.log: true` without a model, so this returns "" only when the * feature is itself off. */ getAuditUserModel(): string; /** Laravel queue name for WriteAuditLog dispatch. Empty string means * sync fallback (low-traffic / dev mode). */ getAuditQueue(): string; /** Prunable retention period (e.g. `90d`). Empty string means audits * are kept forever — no Prunable scope is registered. */ getAuditRetention(): string; /** Get schemas that have service options configured (options.service). */ getSchemasWithService(): Record; /** Check if any schema has service options. */ hasServiceSchemas(): boolean; /** Get translatable field names (snake_case) for a schema. */ getTranslatableFields(schemaName: string): string[]; /** * Get translatable fields with type info (snake_case name + the * declared property type). Used by translation-model-generator to * emit `$casts` for non-string types — without these the model * returns raw strings for Json / Boolean / Int columns and Eloquent * accessors break at runtime. */ getTranslatableFieldDetails(schemaName: string): Array<{ name: string; type: string; }>; }