{"version":3,"file":"acorex-platform-domain-contracts.mjs","sources":["../../../../libs/platform/domain-contracts/src/lib/definitions/base.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/aggregate-definition.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/entity-definition.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/relation-definition.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/menu-definition.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/permission-definition.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/command-registry.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/query-registry.types.ts","../../../../libs/platform/domain-contracts/src/lib/definitions/widget-catalog.types.ts","../../../../libs/platform/domain-contracts/src/lib/index.ts","../../../../libs/platform/domain-contracts/src/acorex-platform-domain-contracts.ts"],"sourcesContent":["import { AXPExpression } from '@acorex/platform/contracts';\n\nexport enum AXPDomainActionSide {\n    Client = 'client',\n    Server = 'server',\n    Both = 'both',\n}\n\n/**\n * Interface for defining actions\n */\nexport interface AXPDomainAction {\n    event: string;\n    side: 'client' | 'server' | 'both';\n    condition?: AXPExpression;\n    expression: AXPExpression;\n}\n\nexport enum AXPEntityCommandScope {\n    TypeLevel = 'typeLevel',\n    Selected = 'selected',\n    Individual = 'individual',\n    Section = 'section',\n}\n\nexport interface AXPDomainRealtedModuleEntity {\n    moduleId?: string;\n    module?: {\n        id?: string;\n        name?: string;\n        title?: string;\n    },\n    entityId?: string;\n    entity?: {\n        id?: string;\n        name?: string;\n        title?: string;\n    },\n}\n\n","import { AXPValidationRules } from '@acorex/platform/contracts';\n\nimport { AXPEntityDefinition } from \"./entity-definition.types\";\nimport { AXPDomainAction } from \"./base.types\";\n\n//#region ----   Entity Loading Types   ----\n\nexport type AXPAggregateEntityList = {\n    [key: string]: () => Promise<AXPEntityDefinition>;\n}\n\n//#endregion\n\n//#region ----   Aggregate Definition   ----\n\n/**\n * Aggregate definition. Relations are stored in a separate collection (like MySQL join table).\n * Join when needed via relations collection.\n */\nexport interface AXPAggregateDefinition {\n    name: string;\n    title: string;\n    entities: AXPEntityDefinition[] | AXPAggregateEntityList | Record<string, string>;\n    validations: AXPValidationRules;\n    actions: AXPDomainAction[];\n}\n\n//#endregion\n","import { AXPValidationRules } from '@acorex/platform/contracts';\nimport { AXPDomainAction } from \"./base.types\";\nimport type { AXPPluginDefinitionValue } from \"./plugin-definition.types\";\nimport type { AXPPropertyDefinition } from \"./property-definition.types\";\n\nexport enum AXPEntityType {\n    Entity,\n    AggregateRoot,\n    ValueObject,\n}\n\nexport interface AXPEntityDefinition {\n    name: string;\n    title: string;\n    fields: AXPEntityPropertyDefinition[];\n    type: AXPEntityType;\n    /** Entity plugins (e.g. common.history, common.lock). Name + optional options only. */\n    plugins?: AXPPluginDefinitionValue[];\n    /** Property groups for layout */\n    groups?: Array<{ id: string; title: string }>;\n    /** List/table columns */\n    columns?: Array<{ name: string }>;\n    /** Display formats */\n    formats?: { individual?: string; plural?: string };\n    /** Layout interfaces (master create/update/single/list). Pass-through for converter. */\n    interfaces?: Record<string, unknown>;\n    /** Module name (e.g. ContentManagement). Derived from path or explicit. */\n    module?: string;\n    /** Entity icon. */\n    icon?: string;\n}\n\nexport interface AXPEntityPropertyFeatures {\n    nullable: boolean;\n    readOnly: boolean; // for update\n}\n\n/**\n * Entity field: flattened embedded property definition (interface, validations, features) plus entity-only metadata.\n * Top-level name/title are the entity property name/title.\n */\nexport interface AXPEntityPropertyDefinition extends AXPPropertyDefinition {\n    actions?: AXPDomainAction[];\n    /** Nullable/readOnly for entity binding; distinct from property.features (searchable, filterable, etc.). */\n    fieldFeatures?: AXPEntityPropertyFeatures;\n}\n","export enum AXPRelationshipKind {\n    Association,\n    Composition,\n    Aggregation,\n}\n\nexport enum AXPRelationshipCardinality {\n    OneToOne,\n    OneToMany,\n    ManyToMany,\n}\n\n/**\n * Standalone relation definition with full source and target.\n * Relations live in their own collection, independent of aggregates.\n */\nexport interface AXPRelationDefinition {\n    id?: string;\n    type: AXPRelationshipCardinality;\n    kind: AXPRelationshipKind;\n    source: {\n        aggregate: string;\n        entity: string;\n        key: string;\n    };\n    target: {\n        aggregate: string;\n        entity: string;\n        key: string;\n    };\n    isRequired: boolean;\n}","//#region ----   Serializable menu definition (storage / CRUD contract)   ----\n\n/**\n * Discriminated JSON for `AXPMenuDefinitionRecord.command`.\n * Modal navigation is omitted (Angular `Type` is not JSON-serializable).\n */\nexport type AXPMenuDefinitionStoredCommand =\n  | {\n      kind: 'navigate';\n      navigateType: 'router';\n      path: string;\n      extras?: Record<string, unknown>;\n    }\n  | {\n      kind: 'execute';\n      name: string;\n      options?: Record<string, unknown>;\n    };\n\n/**\n * Optional reference to an entity list route: resolved at runtime via `AXPEntityService.createPath`.\n */\nexport interface AXPMenuDefinitionEntityListRef {\n  module: string;\n  entity: string;\n}\n\n/**\n * Serializable menu definition for definition stores (Dexie/Firestore in mock today).\n * Mirrors persisted shape for `AXPEntityDefinitionCrudService` menu APIs — not identical to shell `AXPMenuItem`.\n */\nexport interface AXPMenuDefinitionRecord {\n  /** Same as `AXPMenuItem.name` (unique key). */\n  name: string;\n  text: string;\n  description?: string;\n  icon?: string;\n  priority?: number;\n  type?: 'menu' | 'group' | 'break';\n  /**\n   * Parent menu `name` for `context.find(attachParentName).addItems(...)`.\n   * Empty omits attachment (provider may add to root — see implementation).\n   */\n  attachParentName?: string;\n  /** Literal router path; if both this and `entityListRef` are set, implementations may prefer this. */\n  path?: string;\n  entityListRef?: AXPMenuDefinitionEntityListRef;\n  policyFeatures?: string[];\n  policyPermissions?: string[];\n  badgeKey?: string;\n  command?: AXPMenuDefinitionStoredCommand;\n  /**\n   * Optional module classification (references `PlatformManagement.ModuleDefinitions` when using the category plugin).\n   */\n  categoryIds?: string[];\n  /** Denormalized labels for list/display (mirrors product category pattern). */\n  categories?: Array<{ id: string; title?: string }>;\n  meta?: Record<string, unknown>;\n}\n\n//#endregion\n","//#region ----   Serializable permission definition (storage / CRUD contract)   ----\n\n/**\n * One level of child permissions under a root permission (fluent `addChild` only).\n * Nested `children` under leaves are not part of the storage contract.\n */\nexport interface AXPPermissionLeafRecord {\n  name: string;\n  title: string;\n  description?: string;\n  requiredFeatures?: string[];\n}\n\n/**\n * Root permission row: one `addPermission` … `endPermission` chain, with optional sibling `addChild` entries.\n */\nexport interface AXPPermissionDefinitionRecord {\n  name: string;\n  title: string;\n  description?: string;\n  requiredFeatures?: string[];\n  /** At most one level — matches `AXPPermissionDefinitionProviderContext` fluent API. */\n  children?: AXPPermissionLeafRecord[];\n}\n\n/**\n * Serializable permission group for definition stores (Dexie/Firestore).\n * Aligns with `AXPPermissionGroupDefinition` / fluent providers; one row per group.\n */\nexport interface AXPPermissionGroupDefinitionRecord {\n  name: string;\n  title: string;\n  description?: string;\n  permissions: AXPPermissionDefinitionRecord[];\n  /**\n   * Optional module classification (references `PlatformManagement.ModuleDefinitions` when using the category plugin).\n   */\n  categoryIds?: string[];\n  /** Denormalized labels for list/display (mirrors product category pattern). */\n  categories?: Array<{ id: string; title?: string }>;\n}\n\n//#endregion\n","import { defineCommand } from '@acorex/platform/runtime-contracts';\nimport type { AXPDefinitionCategory } from '@acorex/platform/contracts';\n\nimport type { AXPPropertyDefinition } from './property-definition.types';\n\n//#region ---- Command registry persisted record ----\n\n/** Surfaces where a command may be exposed (tooling / automation). Build-time: optional on `defineCommand`. */\nexport type AXPCommandCapability = 'ai' | 'workflow';\n\n/**\n * Persisted command registry row (e.g. Dexie/Firestore via AXPEntityDefinitionCrudService).\n * `name` is the runtime command key; `active` is the toggle stored for mock/admin UIs.\n */\nexport interface AXPCommandRegistryRecord {\n  name: string;\n  active: boolean;\n  /** Human / AI-oriented description of what the command does. */\n  description?: string;\n  /** Input parameters as schema rows (same shape as interface `optionDefinitions`). */\n  inputOptionDefinitions?: AXPPropertyDefinition[];\n  /** Output shape as schema rows (same shape as interface `optionDefinitions`). */\n  outputOptionDefinitions?: AXPPropertyDefinition[];\n  /** Display title from build-time command metadata (`*.definition.ts`). */\n  catalogTitle?: string;\n  /** Where the command runs (metadata). */\n  executionMode?: 'frontend' | 'backend' | 'both';\n  /** Pretty-printed JSON of the outcomes definition from metadata (readonly display). */\n  outcomesDefinitionJson?: string;\n  /** Pretty-printed JSON of AI hints from metadata (readonly display). */\n  aiMetadataJson?: string;\n  /**\n   * Optional capability flags (from build-time `capabilities` on command metadata).\n   * Omitted or empty means no declared surface; consumers may still apply legacy rules (e.g. AI `ai-tool` tag).\n   */\n  capabilities?: AXPCommandCapability[];\n  /** Optional grouping from build-time command metadata (`categories` on `defineCommand`). */\n  categories?: AXPDefinitionCategory[];\n}\n\n//#endregion\n","import { defineQuery } from '@acorex/platform/runtime-contracts';\nimport type { AXPDefinitionCategory } from '@acorex/platform/contracts';\n\nimport type { AXPCommandCapability } from './command-registry.types';\nimport type { AXPPropertyDefinition } from './property-definition.types';\n\n//#region ---- Query registry persisted record ----\n\n/**\n * Persisted query registry row (e.g. Dexie/Firestore via AXPEntityDefinitionCrudService).\n * `name` is the runtime query key; `active` is the toggle stored for mock/admin UIs.\n * Queries expose `fetch(input)` only — no command outcomes.\n */\nexport interface AXPQueryRegistryRecord {\n  name: string;\n  active: boolean;\n  /** Human / AI-oriented description of what the query returns. */\n  description?: string;\n  /** Input parameters (filter / criteria) as property definition rows. */\n  inputOptionDefinitions?: AXPPropertyDefinition[];\n  /** Result shape as property definition rows (documentation / tooling). */\n  outputOptionDefinitions?: AXPPropertyDefinition[];\n  /** Display title from build-time query metadata (`*.query.definition.ts`). */\n  catalogTitle?: string;\n  /** Where the query runs (metadata). */\n  executionMode?: 'frontend' | 'backend' | 'both';\n  /** Pretty-printed JSON of AI hints from metadata (readonly display). */\n  aiMetadataJson?: string;\n  /**\n   * Optional capability flags (from build-time `capabilities` on query metadata).\n   * Omitted or empty means no declared surface; consumers may still apply legacy rules (e.g. AI `ai-tool` tag).\n   */\n  capabilities?: AXPCommandCapability[];\n  /** Optional grouping from build-time query metadata (`categories` on `defineQuery`). */\n  categories?: AXPDefinitionCategory[];\n}\n\n//#endregion\n","import { defineWidget } from '@acorex/platform/runtime-contracts';\n//#region ---- Widget catalog persisted record ----\n\n/**\n * Persisted layout-widget catalog row (Dexie/Firestore via AXPEntityDefinitionCrudService).\n * `name` is the widget registry name from build-time `defineWidget` metadata; `metadataJson` holds the full payload.\n */\nexport interface AXPWidgetCatalogRecord {\n  name: string;\n  active: boolean;\n  description?: string;\n  /** Localized / catalog title from metadata `title`. */\n  catalogTitle?: string;\n  /** Pretty-printed JSON of full widget metadata (`defineWidget` sidecar). */\n  metadataJson?: string;\n}\n\n//#endregion\n","//#region ---- Domain definition contracts ----\n\nexport * from './definitions/base.types';\nexport * from './definitions/module-definition.types';\nexport * from './definitions/aggregate-definition.types';\nexport * from './definitions/entity-definition.types';\nexport * from './definitions/plugin-definition.types';\nexport * from './definitions/property-definition.types';\nexport * from './definitions/relation-definition.types';\nexport * from './definitions/interface-definition.types';\nexport * from './definitions/validation-definition.types';\nexport * from './definitions/menu-definition.types';\nexport * from './definitions/permission-definition.types';\nexport * from './definitions/command-registry.types';\nexport * from './definitions/query-registry.types';\nexport * from './definitions/widget-catalog.types';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"IAEY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC3B,IAAA,mBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,mBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACjB,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,GAAA,EAAA,CAAA,CAAA;IAgBnB;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC7B,IAAA,qBAAA,CAAA,WAAA,CAAA,GAAA,WAAuB;AACvB,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,YAAA,CAAA,GAAA,YAA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