import { CypherType, EntityDescriptor, EntitySchemaInput, RelationshipDef } from "../interfaces/entity.schema.interface"; /** Maximum number of dot-path segments allowed in a single `include` entry (each segment = one relationship hop from the include root). */ export declare const MAX_INCLUDE_DEPTH = 6; /** * Convert a Neo4j field value based on its CypherType * * Exported because repositories that map scalar rollup rows by hand cannot go * through the descriptor's auto-generated `mapper()` — `EntityFactory` only maps * record columns that are actual Neo4j Nodes — and MUST NOT reimplement the * temporal formatting. There is exactly one implementation of that formatting * and this is it; see `TokenUsageAdminRepository`. */ export declare function convertFieldValue(value: any, type: CypherType): any; /** * Define an entity descriptor using a clean, declarative schema * * This function takes a schema definition and computes all derived values: * - Extracts field names, string fields, required fields, and defaults * - Generates UNIQUE constraint for 'id' * - Generates FULLTEXT index from string fields * - Auto-generates mapper function from fields and computed definitions * - Derives childrenTokens from relationships * - Creates a complete DataModelInterface * * @template T - The entity type (e.g., Glossary) * @template R - The relationships record type for autocomplete support * * @example * ```typescript * export const GlossaryDescriptor = defineEntity()({ * type: "glossaries", * endpoint: "glossaries", * nodeName: "glossary", * labelName: "Glossary", * * fields: { * name: { type: 'string', required: true }, * description: { type: 'string' }, * aiStatus: { type: 'string', default: AiStatus.Pending, meta: true }, * }, * * computed: { * relevance: { * compute: (params) => params.record.has("totalScore") ? Number(params.record.get("totalScore")) : 0, * meta: true, * }, * }, * * relationships: { * author: { model: authorMeta, direction: 'in', relationship: 'PUBLISHED', cardinality: 'one' }, * topic: { model: topicMeta, direction: 'out', relationship: 'RELEVANT_FOR', cardinality: 'many' }, * }, * }); * * // Access with autocomplete: * GlossaryDescriptor.model // DataModelInterface with mapper, childrenTokens, etc. * GlossaryDescriptor.relationships.author * GlossaryDescriptor.fieldNames // ['name', 'description', 'aiStatus'] * ``` */ export declare function defineEntity(): >(schema: EntitySchemaInput) => EntityDescriptor; /** * Create an alias descriptor from a base descriptor with different meta. * * Alias descriptors share the same entity type, fields, computed, and relationships * as the base descriptor, but have different type/endpoint/nodeName/labelName. * * This is useful for entities like User that have aliases (Owner, Author, Assignee) * which represent the same entity but appear as different relationship endpoints. * * @param baseDescriptor - The base EntityDescriptor to alias * @param aliasMeta - The DataMeta for the alias (type, endpoint, nodeName, labelName) * @returns A new EntityDescriptor with the alias meta * * @example * ```typescript * // In user.ts: * export const UserDescriptor = defineEntity()({ ... }); * * export const OwnerDescriptor = defineEntityAlias(UserDescriptor, ownerMeta); * export const AuthorDescriptor = defineEntityAlias(UserDescriptor, authorMeta); * export const AssigneeDescriptor = defineEntityAlias(UserDescriptor, assigneeMeta); * ``` */ export declare function defineEntityAlias>(baseDescriptor: EntityDescriptor, aliasMeta: { type: string; endpoint: string; nodeName: string; labelName: string; }): EntityDescriptor; //# sourceMappingURL=define-entity.d.ts.map