@acorex/connectivity 21.0.0-next.85 → 21.0.0-next.89

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.
Files changed (60) hide show
  1. package/fesm2022/acorex-connectivity-api.mjs +72 -5
  2. package/fesm2022/acorex-connectivity-api.mjs.map +1 -1
  3. package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs → acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs} +8994 -6098
  4. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs.map +1 -0
  5. package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-CY_5d0KF.mjs → acorex-connectivity-mock-assign-to-manager.activity-B5mLzeqZ.mjs} +2 -2
  6. package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-B5mLzeqZ.mjs.map +1 -0
  7. package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CIof4zTg.mjs.map +1 -1
  8. package/fesm2022/acorex-connectivity-mock-category-with-items.query-DAKUJIIt.mjs.map +1 -1
  9. package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-Hj-2bHyJ.mjs → acorex-connectivity-mock-chat-generate-image.command-D6P8wF4j.mjs} +2 -2
  10. package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-D6P8wF4j.mjs.map +1 -0
  11. package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-0ZnevjmT.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-BsQerczW.mjs} +2 -2
  12. package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-BsQerczW.mjs.map +1 -0
  13. package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-D8sCgp69.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-BUz8bAZW.mjs} +2 -2
  14. package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-BUz8bAZW.mjs.map +1 -0
  15. package/fesm2022/acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs.map +1 -1
  16. package/fesm2022/acorex-connectivity-mock-distribution-record.activity-a1_k9Czb.mjs.map +1 -1
  17. package/fesm2022/acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs.map +1 -1
  18. package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs.map +1 -1
  19. package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs.map +1 -1
  20. package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map +1 -1
  21. package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs.map +1 -1
  22. package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map +1 -1
  23. package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map +1 -1
  24. package/fesm2022/{acorex-connectivity-mock-get-product-list.query-Bv1im5yj.mjs → acorex-connectivity-mock-get-product-list.query-o9TcY_RC.mjs} +2 -2
  25. package/fesm2022/acorex-connectivity-mock-get-product-list.query-o9TcY_RC.mjs.map +1 -0
  26. package/fesm2022/{acorex-connectivity-mock-get-product-pdf-data.query-Cp65_mpB.mjs → acorex-connectivity-mock-get-product-pdf-data.query-DUZvwsmY.mjs} +2 -2
  27. package/fesm2022/{acorex-connectivity-mock-get-product-pdf-data.query-Cp65_mpB.mjs.map → acorex-connectivity-mock-get-product-pdf-data.query-DUZvwsmY.mjs.map} +1 -1
  28. package/fesm2022/{acorex-connectivity-mock-get-subscriptions-chart-data.query-CkQnH-F_.mjs → acorex-connectivity-mock-get-subscriptions-chart-data.query-BXDzY2Sd.mjs} +2 -2
  29. package/fesm2022/{acorex-connectivity-mock-get-subscriptions-chart-data.query-CkQnH-F_.mjs.map → acorex-connectivity-mock-get-subscriptions-chart-data.query-BXDzY2Sd.mjs.map} +1 -1
  30. package/fesm2022/{acorex-connectivity-mock-get-subscriptions-timeline.query-C_ecGCyk.mjs → acorex-connectivity-mock-get-subscriptions-timeline.query-D_jVT-7a.mjs} +2 -2
  31. package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-D_jVT-7a.mjs.map +1 -0
  32. package/fesm2022/{acorex-connectivity-mock-get-tenant-application-access.query-t4BHU8qk.mjs → acorex-connectivity-mock-get-tenant-application-access.query-BG6t0137.mjs} +2 -2
  33. package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-BG6t0137.mjs.map +1 -0
  34. package/fesm2022/{acorex-connectivity-mock-get-tenant-user-distribution.query-jQAsUf_h.mjs → acorex-connectivity-mock-get-tenant-user-distribution.query-gqSqvIaa.mjs} +2 -2
  35. package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-gqSqvIaa.mjs.map +1 -0
  36. package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs.map +1 -1
  37. package/fesm2022/acorex-connectivity-mock-jira-instance-sync.command-BYOuTU3R.mjs +475 -0
  38. package/fesm2022/acorex-connectivity-mock-jira-instance-sync.command-BYOuTU3R.mjs.map +1 -0
  39. package/fesm2022/{acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs → acorex-connectivity-mock-notification-management-email-send.command-Df6E-9-c.mjs} +2 -2
  40. package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-Df6E-9-c.mjs.map +1 -0
  41. package/fesm2022/acorex-connectivity-mock-sample.command-CJmDL4pL.mjs.map +1 -1
  42. package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs.map +1 -1
  43. package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-D2QjJXu4.mjs → acorex-connectivity-mock-user-roles-for-list-column.query-cSJo8qQX.mjs} +2 -2
  44. package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-D2QjJXu4.mjs.map → acorex-connectivity-mock-user-roles-for-list-column.query-cSJo8qQX.mjs.map} +1 -1
  45. package/fesm2022/acorex-connectivity-mock.mjs +1 -1
  46. package/package.json +2 -2
  47. package/types/acorex-connectivity-api.d.ts +9 -2
  48. package/types/acorex-connectivity-mock.d.ts +458 -529
  49. package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs.map +0 -1
  50. package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-CY_5d0KF.mjs.map +0 -1
  51. package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-Hj-2bHyJ.mjs.map +0 -1
  52. package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-0ZnevjmT.mjs.map +0 -1
  53. package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-D8sCgp69.mjs.map +0 -1
  54. package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs +0 -968
  55. package/fesm2022/acorex-connectivity-mock-contact-core.module-5TLCGWOR.mjs.map +0 -1
  56. package/fesm2022/acorex-connectivity-mock-get-product-list.query-Bv1im5yj.mjs.map +0 -1
  57. package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-C_ecGCyk.mjs.map +0 -1
  58. package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-t4BHU8qk.mjs.map +0 -1
  59. package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-jQAsUf_h.mjs.map +0 -1
  60. package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-DAQfIWoD.mjs.map +0 -1
@@ -5,7 +5,7 @@ import { RootConfig as RootConfig$2 } from '@acorex/modules/organization-managem
5
5
  import { RootConfig as RootConfig$1 } from '@acorex/modules/person-core';
6
6
  import { AXPSessionService } from '@acorex/platform/auth';
7
7
  import { AXPEntityStorageService } from '@acorex/platform/layout/entity';
8
- import { e as axcSyncSingleEmployeeDenormalizedOrgFields } from './acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs';
8
+ import { e as axcSyncSingleEmployeeDenormalizedOrgFields } from './acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs';
9
9
 
10
10
  const EMPLOYEE_ENTITY = RootConfig.entities.employee.source;
11
11
  const PERSON_ENTITY = `${RootConfig$1.module.name}.${RootConfig$1.entities.person.name}`;
@@ -285,4 +285,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
285
285
  }] });
286
286
 
287
287
  export { AssignToManagerActivity };
288
- //# sourceMappingURL=acorex-connectivity-mock-assign-to-manager.activity-CY_5d0KF.mjs.map
288
+ //# sourceMappingURL=acorex-connectivity-mock-assign-to-manager.activity-B5mLzeqZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-assign-to-manager.activity-B5mLzeqZ.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/assign-to-manager.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { RootConfig as HcmRootConfig } from '@acorex/modules/human-capital-management';\nimport { RootConfig as OrgRootConfig } from '@acorex/modules/organization-management';\nimport { RootConfig as PersonRootConfig } from '@acorex/modules/person-core';\nimport { AXPSessionService } from '@acorex/platform/auth';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { axcSyncSingleEmployeeDenormalizedOrgFields } from '../../organization-management/org-chart/employee-manager-resolution';\n\nconst EMPLOYEE_ENTITY = HcmRootConfig.entities.employee.source;\nconst PERSON_ENTITY = `${PersonRootConfig.module.name}.${PersonRootConfig.entities.person.name}`;\n\n//#region ---- Helpers ----\n\n/**\n * Resolves a persisted FK or lookup snapshot to a scalar id (avoids `String([object Object])` from expanded rows).\n */\nfunction axcScalarEntityId(value: unknown): string | null {\n if (value == null || value === '') {\n return null;\n }\n if (typeof value === 'string' || typeof value === 'number') {\n const s = String(value).trim();\n return s.length > 0 ? s : null;\n }\n if (typeof value === 'object' && value !== null && 'id' in value) {\n const id = (value as { id: unknown }).id;\n if (id == null || id === '') {\n return null;\n }\n const s = String(id).trim();\n return s.length > 0 ? s : null;\n }\n return null;\n}\n\n/** Non-empty trimmed string or undefined (for optional workflow command inputs). */\nfunction axcOptionalTrimmedString(raw: unknown): string | undefined {\n if (raw == null || raw === '') {\n return undefined;\n }\n const s = typeof raw === 'string' ? raw.trim() : String(raw).trim();\n return s.length > 0 ? s : undefined;\n}\n\ntype EmployeeOutputShape = { displayName: string; [key: string]: unknown };\n\n/**\n * Reads subject employee FK from any aggregate row (leave request, lifecycle process, etc.).\n */\nfunction axcExtractSubjectEmployeeIdFromRecord(record: Record<string, unknown>): {\n subjectEmployeeId: string | null;\n nestedEmployeeHint: EmployeeOutputShape | null;\n nameHint: string | undefined;\n} {\n const scalarFields = [\n 'employeeId',\n 'assigneeEmployeeId',\n 'subjectEmployeeId',\n 'requesterEmployeeId',\n 'ownerEmployeeId',\n ] as const;\n\n for (const field of scalarFields) {\n const id = axcScalarEntityId(record[field]);\n if (id) {\n return { subjectEmployeeId: id, nestedEmployeeHint: null, nameHint: undefined };\n }\n }\n\n const nestedFields = ['employee', 'assignee', 'subject'] as const;\n for (const field of nestedFields) {\n const nested = record[field];\n const id = axcScalarEntityId(nested);\n if (!id) {\n continue;\n }\n let hint: EmployeeOutputShape | null = null;\n if (nested !== null && typeof nested === 'object') {\n const o = nested as {\n displayName?: string;\n person?: { displayName?: string };\n [key: string]: unknown;\n };\n hint = {\n displayName: o.person?.displayName ?? o.displayName ?? '',\n ...o,\n };\n }\n return { subjectEmployeeId: id, nestedEmployeeHint: hint, nameHint: undefined };\n }\n\n const nameHintRaw = record['employeeName'];\n const nameHint =\n typeof nameHintRaw === 'string' && nameHintRaw.trim() !== ''\n ? nameHintRaw.trim()\n : typeof nameHintRaw === 'object' &&\n nameHintRaw !== null &&\n 'en-US' in (nameHintRaw as object)\n ? String((nameHintRaw as { 'en-US'?: unknown })['en-US'] ?? '').trim() || undefined\n : undefined;\n\n return {\n subjectEmployeeId: null,\n nestedEmployeeHint: null,\n nameHint,\n };\n}\n\n//#endregion\n\nexport interface AssignToManagerInput {\n /** When set (scalar or `{ id }`), resolves manager for this employee (highest precedence). */\n employeeId?: unknown;\n /**\n * Full entity source key for the workflow aggregate (e.g. `HumanCapitalManagement.LeaveRequest`).\n * Used with `sourceRecordId` when `employeeId` is not set.\n */\n sourceEntity?: unknown;\n /** Primary key of the record under `sourceEntity`. */\n sourceRecordId?: unknown;\n /** When org manager cannot be resolved, this platform user id is returned as `managerId` (e.g. initiator for review fallback). */\n fallbackUserId?: unknown;\n}\n\nexport interface AssignToManagerOutput {\n /** Manager's login **user** id — use for `assignedUserIds` / `candidateUserIds`. */\n managerId: string | null;\n /** HumanCapitalManagement.Employee id for the line manager when resolved from org chart. */\n managerEmployeeId: string | null;\n /** Resolved manager employee row (displayName + stored fields). */\n manager: EmployeeOutputShape;\n /** Subject employee under evaluation (whose manager was resolved). */\n employee: EmployeeOutputShape;\n}\n\n/**\n * Assign To Manager Activity (Backend - Mock)\n *\n * Resolves the line-manager **employee** from org chart storage, then the manager's **login user id**\n * (`Employee.userId` or `Person.userId`). Works for any workflow: pass `employeeId`, or `sourceEntity` + `sourceRecordId`\n * for an aggregate that carries an employee FK / nested employee.\n *\n * Execution Mode: backend\n * Activity Type: workflow-activity:assign-to-manager\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class AssignToManagerActivity implements AXPCommand<AssignToManagerInput, AssignToManagerOutput> {\n private readonly entityStorage = inject(AXPEntityStorageService);\n private readonly sessionService = inject(AXPSessionService);\n\n //#region ---- Employee / manager resolution ----\n\n /**\n * Resolves login user id for an employee row (storage may omit `userId` while Person still links the account).\n */\n private async resolveLoginUserIdForEmployeeRow(\n managerEmp: { userId?: string | null; personId?: string | null } | null,\n ): Promise<string | null> {\n const direct =\n managerEmp?.userId != null && String(managerEmp.userId).trim() !== '' ? String(managerEmp.userId).trim() : null;\n if (direct) {\n return direct;\n }\n const personId =\n managerEmp?.personId != null && String(managerEmp.personId).trim() !== ''\n ? String(managerEmp.personId).trim()\n : null;\n if (!personId) {\n return null;\n }\n try {\n const person = (await this.entityStorage.getOne(PERSON_ENTITY, personId)) as { userId?: string | null } | null;\n const uid =\n person?.userId != null && String(person.userId).trim() !== '' ? String(person.userId).trim() : null;\n return uid;\n } catch {\n return null;\n }\n }\n\n private mapEmployeeRowToOutput(\n emp:\n | ({\n displayName?: string;\n person?: { displayName?: string };\n [key: string]: unknown;\n } & { id?: string })\n | null,\n ): EmployeeOutputShape {\n if (!emp) {\n return { displayName: '' };\n }\n return {\n displayName: emp.person?.displayName ?? emp.displayName ?? '',\n ...emp,\n };\n }\n\n /**\n * Syncs denormalized manager on the subject employee, loads manager employee, returns ids + row shape.\n */\n private async resolveManagerDetails(employeeId: string): Promise<{\n managerUserId: string | null;\n managerEmployeeId: string | null;\n manager: EmployeeOutputShape;\n }> {\n await axcSyncSingleEmployeeDenormalizedOrgFields(\n this.entityStorage,\n OrgRootConfig,\n HcmRootConfig,\n String(employeeId),\n true,\n );\n\n const emp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, String(employeeId))) as {\n managerId?: string | null;\n } | null;\n\n const managerEmployeeIdRaw = emp?.managerId != null ? String(emp.managerId).trim() : '';\n if (!managerEmployeeIdRaw) {\n return {\n managerUserId: null,\n managerEmployeeId: null,\n manager: { displayName: '' },\n };\n }\n\n const managerEmp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, managerEmployeeIdRaw)) as {\n userId?: string | null;\n personId?: string | null;\n displayName?: string;\n person?: { displayName?: string };\n [key: string]: unknown;\n } | null;\n\n const managerUserId = await this.resolveLoginUserIdForEmployeeRow(managerEmp);\n\n return {\n managerUserId,\n managerEmployeeId: managerEmployeeIdRaw,\n manager: this.mapEmployeeRowToOutput(managerEmp),\n };\n }\n\n private async findEmployeeIdByUserId(userId: string): Promise<string | null> {\n try {\n const result = await this.entityStorage.query(EMPLOYEE_ENTITY, {\n skip: 0,\n take: 1,\n filter: {\n field: 'userId',\n operator: { type: 'equal' },\n value: userId,\n },\n });\n const row = result.items?.[0] as { id?: string } | undefined;\n return row?.id != null ? String(row.id) : null;\n } catch {\n return null;\n }\n }\n\n private async loadSubjectEmployeeOutput(subjectEmployeeId: string): Promise<EmployeeOutputShape> {\n try {\n const emp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, subjectEmployeeId)) as {\n managerId?: string;\n userId?: string;\n displayName?: string;\n person?: { displayName?: string };\n [key: string]: unknown;\n } | null;\n return emp ? this.mapEmployeeRowToOutput(emp) : { displayName: '' };\n } catch {\n return { displayName: '' };\n }\n }\n\n //#endregion\n\n async execute(input: AssignToManagerInput): Promise<AXPExecuteCommandResult<AssignToManagerOutput>> {\n const sourceEntity = axcOptionalTrimmedString(input.sourceEntity);\n const sourceRecordId = axcOptionalTrimmedString(input.sourceRecordId);\n\n let managerId: string | null = null;\n let managerEmployeeId: string | null = null;\n let manager: EmployeeOutputShape = { displayName: '' };\n let employee: EmployeeOutputShape = { displayName: '' };\n\n let subjectEmployeeId: string | null = null;\n\n const employeeIdFromInput = axcScalarEntityId(input.employeeId);\n\n const applyManagerResolution = async (empId: string): Promise<void> => {\n subjectEmployeeId = empId;\n employee = await this.loadSubjectEmployeeOutput(empId);\n const details = await this.resolveManagerDetails(empId);\n managerId = details.managerUserId;\n managerEmployeeId = details.managerEmployeeId;\n manager = details.manager;\n };\n\n if (employeeIdFromInput) {\n try {\n await applyManagerResolution(employeeIdFromInput);\n } catch {\n // keep defaults\n }\n } else if (sourceEntity && sourceRecordId) {\n try {\n const record = (await this.entityStorage.getOne(sourceEntity, sourceRecordId)) as Record<string, unknown> | null;\n if (record) {\n const { subjectEmployeeId: fromRecord, nestedEmployeeHint, nameHint } =\n axcExtractSubjectEmployeeIdFromRecord(record);\n\n if (fromRecord) {\n await applyManagerResolution(fromRecord);\n if (!employee.displayName && nestedEmployeeHint) {\n employee = {\n ...nestedEmployeeHint,\n displayName: nestedEmployeeHint.displayName || employee.displayName,\n };\n }\n }\n\n if (!employee.displayName && nameHint) {\n employee = {\n ...employee,\n displayName: nameHint,\n };\n }\n }\n } catch {\n // keep defaults\n }\n }\n\n const sessionUserId = this.sessionService.user?.id;\n if (managerId == null && sessionUserId && !subjectEmployeeId) {\n const initiatorEmployeeId = await this.findEmployeeIdByUserId(String(sessionUserId));\n if (initiatorEmployeeId) {\n try {\n await applyManagerResolution(initiatorEmployeeId);\n } catch {\n // ignore\n }\n }\n }\n\n const fallbackUserId = axcScalarEntityId(input.fallbackUserId);\n if (managerId == null && fallbackUserId) {\n managerId = fallbackUserId;\n }\n\n console.log('[WFM-LifecycleTaskTrace] assign-to-manager', {\n subjectEmployeeId,\n managerEmployeeId,\n managerId,\n fallbackUserId: fallbackUserId ?? null,\n usedSourceRecordPath: !!(sourceEntity && sourceRecordId) && !employeeIdFromInput,\n sourceEntity: sourceEntity ?? null,\n sourceRecordId: sourceRecordId ?? null,\n });\n\n return {\n success: true,\n data: {\n managerId,\n managerEmployeeId,\n manager,\n employee,\n },\n metadata: {\n outcome: 'done',\n },\n };\n }\n}\n"],"names":["HcmRootConfig","PersonRootConfig","OrgRootConfig"],"mappings":";;;;;;;;;AAUA,MAAM,eAAe,GAAGA,UAAa,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM;AAC9D,MAAM,aAAa,GAAG,CAAA,EAAGC,YAAgB,CAAC,MAAM,CAAC,IAAI,CAAA,CAAA,EAAIA,YAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE;AAEhG;AAEA;;AAEG;AACH,SAAS,iBAAiB,CAAC,KAAc,EAAA;IACvC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,EAAE;AACjC,QAAA,OAAO,IAAI;IACb;IACA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE;AAC9B,QAAA,OAAO,CAAC,CAAC,MAAM,GAAG,CAA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AAA;;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-category-metadata-inheritance.query-CIof4zTg.mjs","sources":["../../../../libs/connectivity/mock/src/lib/data-management/metadata/queries/category-metadata-inheritance.query.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMMetaDataDefinitionEntityModel, META_DATA_SELECTOR_FIELD, RootConfig } from '@acorex/modules/data-management';\nimport { AXPCategoryEntity } from '@acorex/platform/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { get } from 'lodash-es';\nexport interface CategoryMetadataInheritanceQueryParams {\n entityName: string;\n categoryId: string;\n}\n\n/**\n * Result structure that preserves groups organization\n */\nexport interface CategoryMetadataInheritanceGroupResult {\n name: string;\n title?: string;\n description?: string;\n order: number;\n fields: Array<{\n id: string;\n name: string;\n title: string;\n description?: string;\n interface: string;\n configuration?: any;\n defaultValue?: any;\n order: number;\n }>;\n}\n\nexport type CategoryMetadataInheritanceResult = CategoryMetadataInheritanceGroupResult[];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AXCQueryCategoryMetadataInheritanceQuery implements AXPQuery<CategoryMetadataInheritanceQueryParams, CategoryMetadataInheritanceResult> {\n private readonly entityService = inject(AXPEntityService);\n private readonly metaDataService = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.metaDataDefinition.name)\n .data<any, any>();\n\n async fetch(params: CategoryMetadataInheritanceQueryParams): Promise<CategoryMetadataInheritanceResult> {\n const { entityName, categoryId } = params;\n const [moduleName, entityPart] = entityName.split('.');\n const service = this.entityService.withEntity(moduleName, `${entityPart}Category`).data<any, any>();\n // Find the category by ID\n const category = await this.findCategoryById(categoryId, service);\n if (!category) {\n throw new Error(`Category with ID ${categoryId} not found`);\n }\n\n // Build the hierarchy (traverse up to root)\n const hierarchy = await this.buildCategoryHierarchy(category, service);\n\n // Collect and merge groups from all categories in hierarchy\n const mergedGroups = this.mergeMetadataGroupsFromHierarchy(hierarchy);\n return mergedGroups;\n }\n\n private async findCategoryById(categoryId: string, service: any): Promise<AXPCategoryEntity | null> {\n try {\n const result = await service.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'id',\n operator: {\n type: 'equal',\n },\n value: categoryId,\n },\n ],\n },\n take: 1,\n skip: 0,\n });\n\n return result.items.length > 0 ? result.items[0] : null;\n } catch (error) {\n console.error('Error finding category by ID:', error);\n return null;\n }\n }\n\n private async buildCategoryHierarchy(category: AXPCategoryEntity, service: any): Promise<AXPCategoryEntity[]> {\n const hierarchy: AXPCategoryEntity[] = [category];\n let currentCategory = category;\n\n // Traverse up the parent hierarchy\n while (currentCategory.parentId) {\n try {\n const parentResult = await service.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'id',\n operator: {\n type: 'equal',\n },\n value: currentCategory.parentId,\n },\n ],\n },\n take: 1,\n skip: 0,\n });\n\n if (parentResult.items.length > 0) {\n const parent = parentResult.items[0];\n hierarchy.unshift(parent); // Add to beginning to maintain hierarchy order\n currentCategory = parent;\n } else {\n break; // Parent not found, stop traversal\n }\n } catch (error) {\n console.error('Error finding parent category:', error);\n break;\n }\n }\n\n return hierarchy;\n }\n\n /**\n * Merge metadata groups from category hierarchy, preserving group structure\n * Groups are merged by name, with fields from child categories taking precedence\n */\n private mergeMetadataGroupsFromHierarchy(hierarchy: AXPCategoryEntity[]): CategoryMetadataInheritanceResult {\n const groupsMap = new Map<string, CategoryMetadataInheritanceGroupResult>();\n const seenFieldIds = new Set<string>();\n\n // Process hierarchy from root to leaf (child categories override parent fields)\n for (const category of hierarchy) {\n // Type: AXMMetaDataBuilderValue from @acorex/modules/data-management\n const metaDataList = get(category, META_DATA_SELECTOR_FIELD) as {\n groups?: Array<{\n name: string;\n title?: string;\n description?: string;\n order: number;\n fields?: Array<{\n id: string;\n name: string;\n title: string;\n description?: string;\n interface: string;\n configuration?: any;\n order: number;\n }>;\n }>;\n } | undefined;\n\n if (!metaDataList || !metaDataList.groups || !Array.isArray(metaDataList.groups)) {\n continue;\n }\n\n // Process each group in the category's metadata\n for (const group of metaDataList.groups) {\n const groupName = group.name || 'default';\n\n // Get or create group\n if (!groupsMap.has(groupName)) {\n groupsMap.set(groupName, {\n name: groupName,\n title: group.title,\n description: group.description,\n order: group.order ?? 0,\n fields: [],\n });\n }\n\n const mergedGroup = groupsMap.get(groupName)!;\n\n // Process fields in this group\n if (group.fields && Array.isArray(group.fields)) {\n for (const field of group.fields) {\n // Skip if we've already seen this field (child categories override)\n if (seenFieldIds.has(field.id)) {\n // Remove existing field and add new one (child overrides parent)\n mergedGroup.fields = mergedGroup.fields.filter(f => f.id !== field.id);\n }\n\n // Add field to merged group\n // Ensure title is always present (use name as fallback)\n mergedGroup.fields.push({\n id: field.id,\n name: field.name,\n title: field.title || field.name || 'Untitled Field',\n description: field.description,\n interface: field.interface,\n configuration: field.configuration,\n order: field.order ?? mergedGroup.fields.length,\n });\n\n seenFieldIds.add(field.id);\n }\n }\n }\n }\n\n // Convert map to array and sort by order\n const result = Array.from(groupsMap.values())\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))\n .map(group => ({\n ...group,\n fields: group.fields.sort((a, b) => (a.order ?? 0) - (b.order ?? 0)),\n }));\n\n return result;\n }\n\n private async collectInheritedMetadata(hierarchy: AXPCategoryEntity[]): Promise<AXMMetaDataDefinitionEntityModel[]> {\n const allMetadata: AXMMetaDataDefinitionEntityModel[] = [];\n const seenMetadataIds = new Set<string>();\n\n // Collect metadata from each level in the hierarchy\n for (const category of hierarchy) {\n try {\n const metadataResult = await this.metaDataService.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'categoryIds',\n operator: {\n type: 'contains',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n // Add metadata fields that haven't been seen before (avoid duplicates)\n for (const metadata of metadataResult.items) {\n if (!seenMetadataIds.has(metadata.id)) {\n allMetadata.push(metadata);\n seenMetadataIds.add(metadata.id);\n }\n }\n } catch (error) {\n console.error(`Error collecting metadata for category ${category.id}:`, error);\n }\n }\n\n return allMetadata;\n }\n}\n"],"names":[],"mappings":";;;;;;MAoCa,wCAAwC,CAAA;AAHrD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC;AACrC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AAC9E,aAAA,IAAI,EAAY;AAoNpB,IAAA;IAlNC,MAAM,KAAK,CAAC,MAA8C,EAAA;AACxD,QAAA,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM;AACzC,QAAA,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;AACtD,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,UAAU,CAAA,QAAA,CAAU,CAAC,CAAC,IAAI,EAAY;;QAE/F,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC;QACjE,IAAI,CAAC,QAAQ,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,UAAU,CAAA,UAAA,CAAY,CAAC;QAC/D;;QAGA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO,CAAC;;QAGtE,MAAM,YAAY,GAAG,IAAI,CAAC,gCAAgC,CAAC,SAAS,CAAC;AACrE,QAAA,OAAO,YAAY;IACvB;AAEQ,IAAA,MAAM,g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A,EAA0C,QAAQ,CAAC,EAAE,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;YAClF;QACJ;AAEA,QAAA,OAAO,WAAW;IACtB;8GAvNS,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,cAFrC,MAAM,EAAA,CAAA,CAAA;;2FAET,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAHpD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-category-metadata-inheritance.query-CIof4zTg.mjs","sources":["../../../../libs/connectivity/mock/src/lib/data-management/metadata/queries/category-metadata-inheritance.query.ts"],"sourcesContent":["import { type AXPCategoryEntity } from '@acorex/platform/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMMetaDataDefinitionEntityModel, META_DATA_SELECTOR_FIELD, RootConfig } from '@acorex/modules/data-management';\n\nimport { AXPQuery } from '@acorex/platform/runtime';\nimport { get } from 'lodash-es';\nexport interface CategoryMetadataInheritanceQueryParams {\n entityName: string;\n categoryId: string;\n}\n\n/**\n * Result structure that preserves groups organization\n */\nexport interface CategoryMetadataInheritanceGroupResult {\n name: string;\n title?: string;\n description?: string;\n order: number;\n fields: Array<{\n id: string;\n name: string;\n title: string;\n description?: string;\n interface: string;\n configuration?: any;\n defaultValue?: any;\n order: number;\n }>;\n}\n\nexport type CategoryMetadataInheritanceResult = CategoryMetadataInheritanceGroupResult[];\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AXCQueryCategoryMetadataInheritanceQuery implements AXPQuery<CategoryMetadataInheritanceQueryParams, CategoryMetadataInheritanceResult> {\n private readonly entityService = inject(AXPEntityService);\n private readonly metaDataService = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.metaDataDefinition.name)\n .data<any, any>();\n\n async fetch(params: CategoryMetadataInheritanceQueryParams): Promise<CategoryMetadataInheritanceResult> {\n const { entityName, categoryId } = params;\n const [moduleName, entityPart] = entityName.split('.');\n const service = this.entityService.withEntity(moduleName, `${entityPart}Category`).data<any, any>();\n // Find the category by ID\n const category = await this.findCategoryById(categoryId, service);\n if (!category) {\n throw new Error(`Category with ID ${categoryId} not found`);\n }\n\n // Build the hierarchy (traverse up to root)\n const hierarchy = await this.buildCategoryHierarchy(category, service);\n\n // Collect and merge groups from all categories in hierarchy\n const mergedGroups = this.mergeMetadataGroupsFromHierarchy(hierarchy);\n return mergedGroups;\n }\n\n private async findCategoryById(categoryId: string, service: any): Promise<AXPCategoryEntity | null> {\n try {\n const result = await service.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'id',\n operator: {\n type: 'equal',\n },\n value: categoryId,\n },\n ],\n },\n take: 1,\n skip: 0,\n });\n\n return result.items.length > 0 ? result.items[0] : null;\n } catch (error) {\n console.error('Error finding category by ID:', error);\n return null;\n }\n }\n\n private async buildCategoryHierarchy(category: AXPCategoryEntity, service: any): Promise<AXPCategoryEntity[]> {\n const hierarchy: AXPCategoryEntity[] = [category];\n let currentCategory = category;\n\n // Traverse up the parent hierarchy\n while (currentCategory.parentId) {\n try {\n const parentResult = await service.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'id',\n operator: {\n type: 'equal',\n },\n value: currentCategory.parentId,\n },\n ],\n },\n take: 1,\n skip: 0,\n });\n\n if (parentResult.items.length > 0) {\n const parent = parentResult.items[0];\n hierarchy.unshift(parent); // Add to beginning to maintain hierarchy order\n currentCategory = parent;\n } else {\n break; // Parent not found, stop traversal\n }\n } catch (error) {\n console.error('Error finding parent category:', error);\n break;\n }\n }\n\n return hierarchy;\n }\n\n /**\n * Merge metadata groups from category hierarchy, preserving group structure\n * Groups are merged by name, with fields from child categories taking precedence\n */\n private mergeMetadataGroupsFromHierarchy(hierarchy: AXPCategoryEntity[]): CategoryMetadataInheritanceResult {\n const groupsMap = new Map<string, CategoryMetadataInheritanceGroupResult>();\n const seenFieldIds = new Set<string>();\n\n // Process hierarchy from root to leaf (child categories override parent fields)\n for (const category of hierarchy) {\n // Type: AXMMetaDataBuilderValue from @acorex/modules/data-management\n const metaDataList = get(category, META_DATA_SELECTOR_FIELD) as {\n groups?: Array<{\n name: string;\n title?: string;\n description?: string;\n order: number;\n fields?: Array<{\n id: string;\n name: string;\n title: string;\n description?: string;\n interface: string;\n configuration?: any;\n order: number;\n }>;\n }>;\n } | undefined;\n\n if (!metaDataList || !metaDataList.groups || !Array.isArray(metaDataList.groups)) {\n continue;\n }\n\n // Process each group in the category's metadata\n for (const group of metaDataList.groups) {\n const groupName = group.name || 'default';\n\n // Get or create group\n if (!groupsMap.has(groupName)) {\n groupsMap.set(groupName, {\n name: groupName,\n title: group.title,\n description: group.description,\n order: group.order ?? 0,\n fields: [],\n });\n }\n\n const mergedGroup = groupsMap.get(groupName)!;\n\n // Process fields in this group\n if (group.fields && Array.isArray(group.fields)) {\n for (const field of group.fields) {\n // Skip if we've already seen this field (child categories override)\n if (seenFieldIds.has(field.id)) {\n // Remove existing field and add new one (child overrides parent)\n mergedGroup.fields = mergedGroup.fields.filter(f => f.id !== field.id);\n }\n\n // Add field to merged group\n // Ensure title is always present (use name as fallback)\n mergedGroup.fields.push({\n id: field.id,\n name: field.name,\n title: field.title || field.name || 'Untitled Field',\n description: field.description,\n interface: field.interface,\n configuration: field.configuration,\n order: field.order ?? mergedGroup.fields.length,\n });\n\n seenFieldIds.add(field.id);\n }\n }\n }\n }\n\n // Convert map to array and sort by order\n const result = Array.from(groupsMap.values())\n .sort((a, b) => (a.order ?? 0) - (b.order ?? 0))\n .map(group => ({\n ...group,\n fields: group.fields.sort((a, b) => (a.order ?? 0) - (b.order ?? 0)),\n }));\n\n return result;\n }\n\n private async collectInheritedMetadata(hierarchy: AXPCategoryEntity[]): Promise<AXMMetaDataDefinitionEntityModel[]> {\n const allMetadata: AXMMetaDataDefinitionEntityModel[] = [];\n const seenMetadataIds = new Set<string>();\n\n // Collect metadata from each level in the hierarchy\n for (const category of hierarchy) {\n try {\n const metadataResult = await this.metaDataService.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'categoryIds',\n operator: {\n type: 'contains',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n // Add metadata fields that haven't been seen before (avoid duplicates)\n for (const metadata of metadataResult.items) {\n if (!seenMetadataIds.has(metadata.id)) {\n allMetadata.push(metadata);\n seenMetadataIds.add(metadata.id);\n }\n }\n } catch (error) {\n console.error(`Error collecting metadata for category ${category.id}:`, error);\n }\n }\n\n return allMetadata;\n }\n}\n"],"names":[],"mappings":";;;;;;MAqCa,wCAAwC,CAAA;AAHrD,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;QACxC,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC;AACrC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AAC9E,aAAA,IAAI,EAAY;AAoNpB,IAAA;IAlNC,MAAM,KAAK,CAAC,MAA8C,EAAA;AACxD,QAAA,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,MAAM;AACzC,QAAA,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;AACtD,QAAA,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,EAAE,GAAG,UAAU,CAAA,QAAA,CAAU,CAAC,CAAC,IAAI,EAAY;;Q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AAI;AACV,oBAAA,IAAI,EAAE,CAAC;AACV,iBAAA,CAAC;;AAGF,gBAAA,KAAK,MAAM,QAAQ,IAAI,cAAc,CAAC,KAAK,EAAE;oBACzC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;AACnC,wBAAA,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1B,wBAAA,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACpC;gBACJ;YACJ;YAAE,OAAO,KAAK,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,CAAA,uCAAA,EAA0C,QAAQ,CAAC,EAAE,CAAA,CAAA,CAAG,EAAE,KAAK,CAAC;YAClF;QACJ;AAEA,QAAA,OAAO,WAAW;IACtB;8GAvNS,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,cAFrC,MAAM,EAAA,CAAA,CAAA;;2FAET,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAHpD,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE;AACf,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-category-with-items.query-DAKUJIIt.mjs","sources":["../../../../libs/connectivity/mock/src/lib/data-management/metadata/queries/category-with-items.query.ts"],"sourcesContent":["import { Injector, inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMMetaDataDefinitionEntityModel, RootConfig } from '@acorex/modules/data-management';\nimport { AXPCategoryEntityWithItems } from '@acorex/platform/core';\nimport { AXPQuery } from '@acorex/platform/runtime';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXCQueryCategoryWithItemsQuery implements AXPQuery<void, AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]> {\n private readonly entityService = inject(AXPEntityService);\n private readonly injector = inject(Injector);\n private readonly categoryEntityData = this.entityService\n .withEntity(RootConfig.module.name, `${RootConfig.entities.metaDataDefinition.name}Category`)\n .data<any, any>();\n private readonly metaDataService = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.metaDataDefinition.name)\n .data<any, any>();\n\n fetch(): Promise<any> {\n return this.getAllWithItems();\n }\n\n private async getAllWithItems(): Promise<AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]> {\n const rootCategories = await this.categoryEntityData.query({\n take: 1000,\n skip: 0,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'parentId',\n operator: {\n type: 'isNull',\n },\n },\n ],\n },\n });\n\n const builtRoots = await Promise.all(rootCategories.items.map((category) => this.buildCategoryTree(category)));\n const categories = builtRoots.filter((c): c is AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> => Boolean(c));\n\n const allItems: AXMMetaDataDefinitionEntityModel[] = [];\n const collectItems = (nodes: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]) => {\n for (const node of nodes) {\n if (node.items?.length) {\n allItems.push(...node.items);\n }\n if (node.children?.length) {\n collectItems(node.children);\n }\n }\n };\n collectItems(categories);\n\n const allNode: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> & { categories?: any[] } = {\n id: 'all',\n title: 'All',\n childrenCount: 0,\n items: allItems,\n children: [],\n categories: [],\n };\n\n return [allNode, ...categories];\n }\n\n private async buildCategoryTree(category: any): Promise<AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> | null> {\n const itemsResult = await this.metaDataService.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'categoryIds',\n operator: {\n type: 'contains',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n const childCategoriesResult = await this.categoryEntityData.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'parentId',\n operator: {\n type: 'equal',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n const builtChildren = await Promise.all(childCategoriesResult.items.map((child) => this.buildCategoryTree(child)));\n const children = builtChildren.filter((c): c is AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> => Boolean(c));\n\n const node: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> & { categories?: any[] } = {\n ...category,\n items: itemsResult.items,\n categories: children,\n children: children,\n };\n\n if ((!node.items || node.items.length === 0) && (!node.children || node.children.length === 0)) {\n return null;\n }\n\n return node;\n }\n}\n"],"names":[],"mappings":";;;;;MASa,8BAA8B,CAAA;AAH3C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC3B,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC;AACxC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA,EAAG,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,UAAU;AAC3F,aAAA,IAAI,EAAY;QACF,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC;AACrC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AAC9E,aAAA,IAAI,EAAY;AAsGpB,IAAA;IApGC,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,eAAe,EAAE;IAC/B;AAEQ,IAAA,MAAM,eAAe,GAAA;QAC3B,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;AACzD,YAAA,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AK;AACxB,YAAA,UAAU,EAAE,QAAQ;AACpB,YAAA,QAAQ,EAAE,QAAQ;SACnB;AAED,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;AAC9F,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,OAAO,IAAI;IACb;8GA7GW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-category-with-items.query-DAKUJIIt.mjs","sources":["../../../../libs/connectivity/mock/src/lib/data-management/metadata/queries/category-with-items.query.ts"],"sourcesContent":["import { type AXPCategoryEntityWithItems } from '@acorex/platform/contracts';\nimport { Injector, inject, Injectable } from '@angular/core';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXMMetaDataDefinitionEntityModel, RootConfig } from '@acorex/modules/data-management';\n\nimport { AXPQuery } from '@acorex/platform/runtime';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AXCQueryCategoryWithItemsQuery implements AXPQuery<void, AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]> {\n private readonly entityService = inject(AXPEntityService);\n private readonly injector = inject(Injector);\n private readonly categoryEntityData = this.entityService\n .withEntity(RootConfig.module.name, `${RootConfig.entities.metaDataDefinition.name}Category`)\n .data<any, any>();\n private readonly metaDataService = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.metaDataDefinition.name)\n .data<any, any>();\n\n fetch(): Promise<any> {\n return this.getAllWithItems();\n }\n\n private async getAllWithItems(): Promise<AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]> {\n const rootCategories = await this.categoryEntityData.query({\n take: 1000,\n skip: 0,\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'parentId',\n operator: {\n type: 'isNull',\n },\n },\n ],\n },\n });\n\n const builtRoots = await Promise.all(rootCategories.items.map((category) => this.buildCategoryTree(category)));\n const categories = builtRoots.filter((c): c is AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> => Boolean(c));\n\n const allItems: AXMMetaDataDefinitionEntityModel[] = [];\n const collectItems = (nodes: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel>[]) => {\n for (const node of nodes) {\n if (node.items?.length) {\n allItems.push(...node.items);\n }\n if (node.children?.length) {\n collectItems(node.children);\n }\n }\n };\n collectItems(categories);\n\n const allNode: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> & { categories?: any[] } = {\n id: 'all',\n title: 'All',\n childrenCount: 0,\n items: allItems,\n children: [],\n categories: [],\n };\n\n return [allNode, ...categories];\n }\n\n private async buildCategoryTree(category: any): Promise<AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> | null> {\n const itemsResult = await this.metaDataService.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'categoryIds',\n operator: {\n type: 'contains',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n const childCategoriesResult = await this.categoryEntityData.query({\n filter: {\n logic: 'and',\n filters: [\n {\n field: 'parentId',\n operator: {\n type: 'equal',\n },\n value: category.id,\n },\n ],\n },\n take: 1000,\n skip: 0,\n });\n\n const builtChildren = await Promise.all(childCategoriesResult.items.map((child) => this.buildCategoryTree(child)));\n const children = builtChildren.filter((c): c is AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> => Boolean(c));\n\n const node: AXPCategoryEntityWithItems<AXMMetaDataDefinitionEntityModel> & { categories?: any[] } = {\n ...category,\n items: itemsResult.items,\n categories: children,\n children: children,\n };\n\n if ((!node.items || node.items.length === 0) && (!node.children || node.children.length === 0)) {\n return null;\n }\n\n return node;\n }\n}\n"],"names":[],"mappings":";;;;;MAUa,8BAA8B,CAAA;AAH3C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAC3B,IAAA,CAAA,kBAAkB,GAAG,IAAI,CAAC;AACxC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,CAAA,EAAG,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,UAAU;AAC3F,aAAA,IAAI,EAAY;QACF,IAAA,CAAA,eAAe,GAAG,IAAI,CAAC;AACrC,aAAA,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI;AAC9E,aAAA,IAAI,EAAY;AAsGpB,IAAA;IApGC,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,eAAe,EAAE;IAC/B;AAEQ,IAAA,MAAM,eAAe,GAAA;QAC3B,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,KAAK,CAAC;AACzD,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,IAAI,EAAE,CAAC;AACP,YAAA,MAAM,EAAE;AACN,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,OAAO,EAAE;AACP,oBAAA;AACE,wBAAA,KAAK,EAAE,UAAU;AACjB,wBA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AC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE;AAC9F,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,OAAO,IAAI;IACb;8GA7GW,8BAA8B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA9B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,8BAA8B,cAF7B,MAAM,EAAA,CAAA,CAAA;;2FAEP,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, a as AXMAiModelStableIds } from './acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs';
6
+ import { A as AXCAiChatRouterService, a as AXMAiModelStableIds } from './acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function parseGenerateImageInput(args) {
@@ -108,4 +108,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
108
108
  }] });
109
109
 
110
110
  export { AiManagementChatGenerateImageCommand };
111
- //# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-Hj-2bHyJ.mjs.map
111
+ //# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-D6P8wF4j.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-D6P8wF4j.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-generate-image.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AI_CHAT_GENERATED_IMAGE_REF_TYPE,\n AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL,\n blobOrFileFromImageResult,\n modelRowHasPurpose,\n persistAiGeneratedImage,\n RootConfig,\n} from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPFileStorageService } from '@acorex/platform/common';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\n\nimport type { AXMAiModelRow } from '../ai-agent-engine.types';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\nimport { AXMAiModelStableIds } from '../model/model.mock';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatGenerateImage ----\n\nexport interface AiManagementChatGenerateImageInput {\n /**\n * Catalog `AiModel` row id (image purpose). Supplied on the command invocation or via\n * agent `commandIds[].command.options.model` defaults merged before execute.\n */\n model?: string;\n prompt?: string;\n size?: string;\n style?: string;\n}\n\nfunction parseGenerateImageInput(args: unknown):\n | { ok: true; model?: string; prompt: string; size?: string; style?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const prompt = typeof obj['prompt'] === 'string' ? obj['prompt'].trim() : '';\n if (!prompt) {\n return { ok: false, error: 'Invalid arguments: \"prompt\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const size = typeof obj['size'] === 'string' ? obj['size'].trim() : undefined;\n const style = typeof obj['style'] === 'string' ? obj['style'].trim() : undefined;\n return {\n ok: true,\n prompt,\n ...(model ? { model } : {}),\n ...(size ? { size } : {}),\n ...(style ? { style } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatGenerateImageCommand\n implements\n AXPCommand<\n AiManagementChatGenerateImageInput,\n { fileId?: string; prompt: string; imageUrl?: string }\n >\n{\n private readonly aiChatRouter = inject(AXCAiChatRouterService);\n private readonly fileStorage = inject(AXPFileStorageService);\n private readonly entityService = inject(AXPEntityService);\n\n private readonly modelData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.model.name)\n .data<string, AXMAiModelRow, AXMAiModelRow, AXMAiModelRow, AXMAiModelRow>();\n\n /**\n * Resolves the image catalog row from the command `model` input only (invalid ids are ignored).\n */\n private async resolveImageModelEntityId(explicitModel: string | undefined): Promise<string> {\n const candidates = [\n explicitModel?.trim(),\n AXMAiModelStableIds.openrouterGrokImagineImageQuality,\n ].filter((id): id is string => Boolean(id?.trim()));\n\n for (const candidate of candidates) {\n const row = await this.modelData.byKey(candidate);\n if (row && modelRowHasPurpose(row as unknown as Record<string, unknown>, 'image')) {\n return candidate;\n }\n }\n\n return AXMAiModelStableIds.openrouterGrokImagineImageQuality;\n }\n\n async execute(\n input: AiManagementChatGenerateImageInput,\n ): Promise<\n AXPExecuteCommandResult<{\n fileId?: string;\n prompt: string;\n imageUrl?: string;\n }>\n > {\n const parsed = parseGenerateImageInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n try {\n const modelEntityId = await this.resolveImageModelEntityId(parsed.model);\n\n let composedPrompt = parsed.prompt;\n if (parsed.style?.trim()) {\n composedPrompt = `${composedPrompt}\\nStyle: ${parsed.style.trim()}`;\n }\n\n const { imageUrl } = await this.aiChatRouter.generateImage({\n modelEntityId,\n prompt: composedPrompt,\n size: parsed.size?.trim() || undefined,\n });\n\n try {\n const file = await blobOrFileFromImageResult(imageUrl);\n const { fileId } = await persistAiGeneratedImage(this.fileStorage, file, {\n refId: modelEntityId,\n refType: AI_CHAT_GENERATED_IMAGE_REF_TYPE,\n });\n return {\n success: true,\n data: {\n fileId,\n prompt: parsed.prompt,\n },\n };\n } catch (persistErr) {\n const u = imageUrl.trim();\n if (u.startsWith('https://') && u.length <= AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL) {\n return {\n success: true,\n data: { prompt: parsed.prompt, imageUrl: u },\n };\n }\n const pmsg = persistErr instanceof Error ? persistErr.message : String(persistErr);\n throw new Error(`Could not store generated image for chat replay. ${pmsg}`);\n }\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAmCA,SAAS,uBAAuB,CAAC,IAAa,EAAA;AAG5C,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE;IAC5E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,gEAAgE,EAAE;IAC/F;IACA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAChF,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAC7E,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAA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AAE,OAAO,UAAU,EAAE;AACnB,gBAAA,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE;AACzB,gBAAA,IAAI,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,IAAI,yCAAyC,EAAE;oBACrF,OAAO;AACL,wBAAA,OAAO,EAAE,IAAI;wBACb,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE;qBAC7C;gBACH;AACA,gBAAA,MAAM,IAAI,GAAG,UAAU,YAAY,KAAK,GAAG,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAClF,gBAAA,MAAM,IAAI,KAAK,CAAC,oDAAoD,IAAI,CAAA,CAAE,CAAC;YAC7E;QACF;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GA1FW,oCAAoC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApC,oCAAoC,EAAA,CAAA,CAAA;;2FAApC,oCAAoC,EAAA,UAAA,EAAA,CAAA;kBADhD;;;;;"}
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, a as AXMAiModelStableIds, c as resolveDelegatedAssistOptionString, d as resolveOpenAiCompatibleTtsVoice, O as OPENROUTER_GEMINI_FLASH_TTS_DEFAULT_FORMAT } from './acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs';
6
+ import { A as AXCAiChatRouterService, a as AXMAiModelStableIds, c as resolveDelegatedAssistOptionString, d as resolveOpenAiCompatibleTtsVoice, O as OPENROUTER_GEMINI_FLASH_TTS_DEFAULT_FORMAT } from './acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function parseSynthesizeInput(args) {
@@ -118,4 +118,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
118
118
  }] });
119
119
 
120
120
  export { AiManagementChatSynthesizeSpeechCommand };
121
- //# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-0ZnevjmT.mjs.map
121
+ //# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-BsQerczW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-synthesize-speech.command-BsQerczW.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-synthesize-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n AXPAiChatToolRunContextService,\n modelRowHasPurpose,\n persistAiGeneratedSpeech,\n prepareTtsBytesForBrowserPlayback,\n RootConfig,\n} from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPFileStorageService } from '@acorex/platform/common';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\n\nimport type { AXMAiAssistRow, AXMAiModelRow } from '../ai-agent-engine.types';\nimport {\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\nimport {\n OPENROUTER_GEMINI_FLASH_TTS_DEFAULT_FORMAT,\n resolveOpenAiCompatibleTtsVoice,\n} from '../chat/open-ai-tts-compat.util';\nimport { AXMAiModelStableIds } from '../model/model.mock';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatSynthesizeSpeech ----\n\nexport interface AiManagementChatSynthesizeSpeechInput {\n /**\n * Catalog `AiModel` row id (tts purpose). Supplied on the command invocation or via\n * agent `commandIds[].command.options.model` defaults merged before execute.\n */\n model?: string;\n text?: string;\n voice?: string;\n responseFormat?: string;\n}\n\nfunction parseSynthesizeInput(args: unknown):\n | { ok: true; model?: string; text: string; voice?: string; responseFormat?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const text = typeof obj['text'] === 'string' ? obj['text'].trim() : '';\n if (!text) {\n return { ok: false, error: 'Invalid arguments: \"text\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const voice = typeof obj['voice'] === 'string' ? obj['voice'].trim() : undefined;\n const responseFormat =\n typeof obj['responseFormat'] === 'string' ? obj['responseFormat'].trim() : undefined;\n return {\n ok: true,\n text,\n ...(model ? { model } : {}),\n ...(voice ? { voice } : {}),\n ...(responseFormat ? { responseFormat } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatSynthesizeSpeechCommand\n implements\n AXPCommand<\n AiManagementChatSynthesizeSpeechInput,\n { fileId?: string; text: string }\n >\n{\n private readonly aiChatRouter = inject(AXCAiChatRouterService);\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n private readonly fileStorage = inject(AXPFileStorageService);\n private readonly entityService = inject(AXPEntityService);\n\n private readonly modelData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.model.name)\n .data<string, AXMAiModelRow, AXMAiModelRow, AXMAiModelRow, AXMAiModelRow>();\n\n private readonly assistData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assist.name)\n .data<string, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow>();\n\n /**\n * Resolves the TTS catalog row from the command `model` input only (invalid ids are ignored).\n */\n private async resolveTtsModelEntityId(explicitModel: string | undefined): Promise<string> {\n const candidates = [\n explicitModel?.trim(),\n AXMAiModelStableIds.openrouterGemini31FlashTtsPreview,\n AXMAiModelStableIds.openrouterKokoro82m,\n AXMAiModelStableIds.openrouterGrokVoiceTts10,\n ].filter((id): id is string => Boolean(id?.trim()));\n\n for (const candidate of candidates) {\n const row = await this.modelData.byKey(candidate);\n if (row && modelRowHasPurpose(row as unknown as Record<string, unknown>, 'tts')) {\n return candidate;\n }\n }\n\n return AXMAiModelStableIds.openrouterGemini31FlashTtsPreview;\n }\n\n async execute(\n input: AiManagementChatSynthesizeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ fileId?: string; text: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Text-to-speech requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseSynthesizeInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n try {\n const modelEntityId = await this.resolveTtsModelEntityId(parsed.model);\n const modelRow = await this.modelData.byKey(modelEntityId);\n const catalogApiModelName = modelRow?.name?.trim() ?? '';\n\n const assist = await this.assistData.byKey(ctx.assistId.trim());\n const voiceFromAssist =\n assist ? resolveDelegatedAssistOptionString(assist, ctx.agentId, 'voice') || undefined : undefined;\n const formatFromAssist =\n assist ? resolveDelegatedAssistOptionString(assist, ctx.agentId, 'responseFormat') || undefined : undefined;\n const voice = resolveOpenAiCompatibleTtsVoice(\n catalogApiModelName,\n parsed.voice?.trim() || voiceFromAssist,\n );\n const responseFormat =\n parsed.responseFormat?.trim() ||\n formatFromAssist?.trim() ||\n OPENROUTER_GEMINI_FLASH_TTS_DEFAULT_FORMAT;\n\n const { audioBytes, mimeType } = await this.aiChatRouter.synthesizeSpeech({\n modelEntityId,\n text: parsed.text,\n voice,\n responseFormat,\n });\n\n const prepared = prepareTtsBytesForBrowserPlayback(audioBytes, mimeType?.trim() || 'application/octet-stream');\n const fileName = `ai-tts.${prepared.extension}`;\n const file = new File([prepared.audioBytes], fileName, { type: prepared.mimeType });\n\n try {\n const { fileId } = await persistAiGeneratedSpeech(this.fileStorage, file, {\n refId: ctx.assistId.trim(),\n refType: AI_CHAT_GENERATED_SPEECH_REF_TYPE,\n });\n return { success: true, data: { fileId, text: parsed.text } };\n } catch (persistErr) {\n const pmsg = persistErr instanceof Error ? persistErr.message : String(persistErr);\n throw new Error(`Could not store synthesized speech for chat replay. ${pmsg}`);\n }\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AA0CA,SAAS,oBAAoB,CAAC,IAAa,EAAA;AAGzC,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC,MAAM,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE;IACtE,IAAI,CAAC,IAAI,EAAE;QACT,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,8DAA8D,EAAE;IAC7F;IACA,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAChF,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,QAAQ,GAAG,GA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E,oBAAA,KAAK,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE;AAC1B,oBAAA,OAAO,EAAE,iCAAiC;AAC3C,iBAAA,CAAC;AACF,gBAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE;YAC/D;YAAE,OAAO,UAAU,EAAE;AACnB,gBAAA,MAAM,IAAI,GAAG,UAAU,YAAY,KAAK,GAAG,UAAU,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAClF,gBAAA,MAAM,IAAI,KAAK,CAAC,uDAAuD,IAAI,CAAA,CAAE,CAAC;YAChF;QACF;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GAvGW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
@@ -3,7 +3,7 @@ import * as i0 from '@angular/core';
3
3
  import { inject, Injectable } from '@angular/core';
4
4
  import { AXPFileStorageService } from '@acorex/platform/common';
5
5
  import { AXPEntityService } from '@acorex/platform/layout/entity';
6
- import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, b as resolveAssistSpeechModelId, c as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-Btm13GJK.mjs';
6
+ import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, b as resolveAssistSpeechModelId, c as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-BCfVjkOd.mjs';
7
7
 
8
8
  //#region ---- Imports ----
9
9
  function parseTranscribeInput(args) {
@@ -118,4 +118,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
118
118
  }] });
119
119
 
120
120
  export { AiManagementChatTranscribeSpeechCommand };
121
- //# sourceMappingURL=acorex-connectivity-mock-chat-transcribe-speech.command-D8sCgp69.mjs.map
121
+ //# sourceMappingURL=acorex-connectivity-mock-chat-transcribe-speech.command-BUz8bAZW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-BUz8bAZW.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/chat-transcribe-speech.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPAiChatToolRunContextService, RootConfig } from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPFileStorageService } from '@acorex/platform/common';\nimport { AXPEntityService } from '@acorex/platform/layout/entity';\n\nimport type { AXMAiAssistRow } from '../ai-agent-engine.types';\nimport {\n resolveAssistSpeechModelId,\n resolveDelegatedAssistOptionModel,\n resolveDelegatedAssistOptionString,\n} from '../ai-delegated-agent-parameters.util';\nimport { AXCAiChatRouterService } from '../chat/ai-chat-router.service';\n\n//#endregion\n\n//#region ---- Command: AiManagement:ChatTranscribeSpeech ----\n\nexport interface AiManagementChatTranscribeSpeechInput {\n /** Catalog `AiModel` row id for a speech-purpose model. When omitted, uses `delegatedAgents[].options.model` for the active delegated specialist (`agentId` in run context). */\n model?: string;\n fileId?: string;\n language?: string;\n}\n\nfunction parseTranscribeInput(args: unknown):\n | { ok: true; model?: string; fileId: string; language?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const fileId = typeof obj['fileId'] === 'string' ? obj['fileId'].trim() : '';\n if (!fileId) {\n return { ok: false, error: 'Invalid arguments: \"fileId\" is required and must be non-empty.' };\n }\n const model = typeof obj['model'] === 'string' ? obj['model'].trim() : undefined;\n const language = typeof obj['language'] === 'string' ? obj['language'].trim() : undefined;\n return {\n ok: true,\n fileId,\n ...(model ? { model } : {}),\n ...(language ? { language } : {}),\n };\n}\n\n@Injectable()\nexport class AiManagementChatTranscribeSpeechCommand\n implements AXPCommand<AiManagementChatTranscribeSpeechInput, { text: string }>\n{\n private readonly aiChatRouter = inject(AXCAiChatRouterService);\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n private readonly fileStorage = inject(AXPFileStorageService);\n private readonly entityService = inject(AXPEntityService);\n\n private readonly assistData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.assist.name)\n .data<string, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow, AXMAiAssistRow>();\n\n async execute(\n input: AiManagementChatTranscribeSpeechInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n if (!ctx?.assistId?.trim()) {\n return {\n success: false,\n message: {\n text: 'Speech transcription requires an active AI chat run context (assist id).',\n },\n };\n }\n\n const parsed = parseTranscribeInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n try {\n const assist = await this.assistData.byKey(ctx.assistId.trim());\n if (!assist) {\n return {\n success: false,\n message: { text: `Assist row was not found (id: ${ctx.assistId.trim()}).` },\n };\n }\n\n const modelEntityId =\n parsed.model?.trim() ||\n resolveDelegatedAssistOptionModel(assist, ctx.agentId) ||\n resolveAssistSpeechModelId(assist) ||\n '';\n if (!modelEntityId) {\n return {\n success: false,\n message: {\n text:\n 'No speech model: pass \"model\" (catalog id) or set options.model on the speech-to-text delegated specialist row for this assist.',\n },\n };\n }\n\n let mimeType = 'application/octet-stream';\n let audioBytes: ArrayBuffer;\n let uploadFileName: string | undefined;\n try {\n const info = await this.fileStorage.getInfo(parsed.fileId);\n const file = info.binary;\n mimeType = info.mimeType?.trim() || file.type?.trim() || mimeType;\n uploadFileName = info.name?.trim() || file.name?.trim() || undefined;\n audioBytes = await file.arrayBuffer();\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return {\n success: false,\n message: { text: `Could not read audio file (fileId: ${parsed.fileId}). ${msg}` },\n };\n }\n\n if (audioBytes.byteLength === 0) {\n return {\n success: false,\n message: { text: `Audio file is empty (fileId: ${parsed.fileId}).` },\n };\n }\n\n const language =\n parsed.language?.trim() ||\n resolveDelegatedAssistOptionString(assist, ctx.agentId, 'language') ||\n undefined;\n\n const { text } = await this.aiChatRouter.transcribeSpeech({\n modelEntityId,\n audioBytes,\n mimeType,\n ...(uploadFileName ? { fileName: uploadFileName } : {}),\n ...(language ? { language } : {}),\n });\n\n return { success: true, data: { text } };\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AA4BA,SAAS,oBAAoB,CAAC,IAAa,EAAA;AAGzC,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE;IAC5E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,g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AE;QAC1C;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GAhGW,uCAAuC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAvC,uCAAuC,EAAA,CAAA,CAAA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/check-permission.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\n//#region ---- Types ----\n\nexport interface CheckPermissionInput {\n permission: string;\n userId?: string;\n}\n\nexport interface CheckPermissionOutput {\n hasPermission: boolean;\n userId: string;\n permission: string;\n}\n\n//#endregion\n\n/**\n * CheckPermission Activity (Backend - Mock)\n *\n * Checks if a user has specific permission.\n * Execution Mode: backend\n * Activity Type: workflow-activity:check-permission\n *\n * Outcomes: HasPermission | NoPermission\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckPermissionActivity implements AXPCommand<CheckPermissionInput, CheckPermissionOutput> {\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(\n input: CheckPermissionInput,\n ): Promise<AXPExecuteCommandResult<CheckPermissionOutput>> {\n const hasPermission = this.sessionService.authorize(input.permission);\n\n const output: CheckPermissionOutput = {\n hasPermission,\n userId: input.userId || 'current-user',\n permission: input.permission,\n };\n\n return {\n success: true,\n data: output,\n metadata: {\n outcome: hasPermission ? 'HasPermission' : 'NoPermission',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;;;AAQG;MAIU,uBAAuB,CAAA;AAHpC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAqB5D,IAAA;IAnBC,MAAM,OAAO,CACX,KAA2B,EAAA;AAE3B,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;AAErE,QAAA,MAAM,MAAM,GAA0B;YACpC,aAAa;AACb,YAAA,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,cAAc;YACtC,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B;QAED,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,QAAQ,EAAE;gBACR,OAAO,EAAE,aAAa,GAAG,eAAe,GAAG,cAAc;AAC1D,aAAA;SACF;IACH;8GArBW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFtB,MAAM,EAAA,CAAA,CAAA;;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/check-permission.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\n\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\n//#region ---- Types ----\n\nexport interface CheckPermissionInput {\n permission: string;\n userId?: string;\n}\n\nexport interface CheckPermissionOutput {\n hasPermission: boolean;\n userId: string;\n permission: string;\n}\n\n//#endregion\n\n/**\n * CheckPermission Activity (Backend - Mock)\n *\n * Checks if a user has specific permission.\n * Execution Mode: backend\n * Activity Type: workflow-activity:check-permission\n *\n * Outcomes: HasPermission | NoPermission\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class CheckPermissionActivity implements AXPCommand<CheckPermissionInput, CheckPermissionOutput> {\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(\n input: CheckPermissionInput,\n ): Promise<AXPExecuteCommandResult<CheckPermissionOutput>> {\n const hasPermission = this.sessionService.authorize(input.permission);\n\n const output: CheckPermissionOutput = {\n hasPermission,\n userId: input.userId || 'current-user',\n permission: input.permission,\n };\n\n return {\n success: true,\n data: output,\n metadata: {\n outcome: hasPermission ? 'HasPermission' : 'NoPermission',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;AAmBA;AAEA;;;;;;;;AAQG;MAIU,uBAAuB,CAAA;AAHpC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAqB5D,IAAA;IAnBC,MAAM,OAAO,CACX,KAA2B,EAAA;AAE3B,QAAA,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;AAErE,QAAA,MAAM,MAAM,GAA0B;YACpC,aAAa;AACb,YAAA,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,cAAc;YACtC,UAAU,EAAE,KAAK,CAAC,UAAU;SAC7B;QAED,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE,MAAM;AACZ,YAAA,QAAQ,EAAE;gBACR,OAAO,EAAE,aAAa,GAAG,eAAe,GAAG,cAAc;AAC1D,aAAA;SACF;IACH;8GArBW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,cAFtB,MAAM,EAAA,CAAA,CAAA;;2FAEP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAHnC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-distribution-record.activity-a1_k9Czb.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/distribution-record.activity.ts"],"sourcesContent":["import { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\n\nexport interface DistributionRecordInput {\n refId: string;\n refType: string;\n assignedTo: string[];\n}\n\nexport interface DistributionRecordOutput {\n success: boolean;\n message: string;\n}\n\n/**\n * Distribution Record Activity (Backend - Mock)\n *\n * Creates distribution records for assigned users.\n * Key: Distribution:Record (not workflow-activity - used by other flows)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DistributionRecordActivity\n implements AXPCommand<DistributionRecordInput, DistributionRecordOutput> {\n private readonly entityService = inject(AXPEntityService);\n\n async execute(\n input: DistributionRecordInput,\n ): Promise<AXPExecuteCommandResult<DistributionRecordOutput>> {\n const dataService = this.entityService\n .withEntity(`${input.refType}Distribution`)\n .data<any, any>();\n\n const dataServiceEntity = this.entityService.withEntity(input.refType).data<any, any>();\n\n try {\n for (const user of input.assignedTo) {\n await dataService.create({\n distributionRefId: input.refId,\n assignedId: user,\n distributionDate: new Date(),\n });\n const refEntity = await dataServiceEntity.byKey(input.refId);\n await dataServiceEntity.update(input.refId, {\n stateInfo: {\n ...refEntity?.stateInfo,\n isDistributed: true,\n },\n });\n }\n return {\n success: true,\n data: {\n success: true,\n message: 'Distribution records created successfully',\n },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error) {\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Failed to create distribution records',\n },\n data: {\n success: false,\n message: 'Failed to create distribution records',\n },\n metadata: {\n outcome: 'Failed',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAgBA;;;;;AAKG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAoD1D,IAAA;IAlDC,MAAM,OAAO,CACX,KAA8B,EAAA;AAE9B,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC;AACtB,aAAA,UAAU,CAAC,CAAA,EAAG,KAAK,CAAC,OAAO,cAAc;AACzC,aAAA,IAAI,EAAY;AAEnB,QAAA,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAY;AAEvF,QAAA,IAAI;AACF,YAAA,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,UAAU,EAAE;gBACnC,MAAM,WAAW,CAAC,MAAM,CAAC;oBACvB,iBAAiB,EAAE,KAAK,CAAC,KAAK;AAC9B,oBAAA,UAAU,EAAE,IAAI;oBAChB,gBAAgB,EAAE,IAAI,IAAI,EAAE;AAC7B,iBAAA,CAAC;gBACF,MAAM,SAAS,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;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"version":3,"file":"acorex-connectivity-mock-distribution-record.activity-a1_k9Czb.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/distribution-record.activity.ts"],"sourcesContent":["import { AXPEntityService } from '@acorex/platform/layout/entity';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\n\nexport interface DistributionRecordInput {\n refId: string;\n refType: string;\n assignedTo: string[];\n}\n\nexport interface DistributionRecordOutput {\n success: boolean;\n message: string;\n}\n\n/**\n * Distribution Record Activity (Backend - Mock)\n *\n * Creates distribution records for assigned users.\n * Key: Distribution:Record (not workflow-activity - used by other flows)\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DistributionRecordActivity\n implements AXPCommand<DistributionRecordInput, DistributionRecordOutput> {\n private readonly entityService = inject(AXPEntityService);\n\n async execute(\n input: DistributionRecordInput,\n ): Promise<AXPExecuteCommandResult<DistributionRecordOutput>> {\n const dataService = this.entityService\n .withEntity(`${input.refType}Distribution`)\n .data<any, any>();\n\n const dataServiceEntity = this.entityService.withEntity(input.refType).data<any, any>();\n\n try {\n for (const user of input.assignedTo) {\n await dataService.create({\n distributionRefId: input.refId,\n assignedId: user,\n distributionDate: new Date(),\n });\n const refEntity = await dataServiceEntity.byKey(input.refId);\n await dataServiceEntity.update(input.refId, {\n stateInfo: {\n ...refEntity?.stateInfo,\n isDistributed: true,\n },\n });\n }\n return {\n success: true,\n data: {\n success: true,\n message: 'Distribution records created successfully',\n },\n metadata: {\n outcome: 'Done',\n },\n };\n } catch (error) {\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : 'Failed to create distribution records',\n },\n data: {\n success: false,\n message: 'Failed to create distribution records',\n },\n metadata: {\n outcome: 'Failed',\n },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAgBA;;;;;AAKG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;AAKmB,QAAA,IAAA,CAA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GAAG,uCAAuC;AACvF,iBAAA;AACD,gBAAA,IAAI,EAAE;AACJ,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,uCAAuC;AACjD,iBAAA;AACD,gBAAA,QAAQ,EAAE;AACR,oBAAA,OAAO,EAAE,QAAQ;AAClB,iBAAA;aACF;QACH;IACF;8GArDW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFzB,MAAM,EAAA,CAAA,CAAA;;2FAEP,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-create.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityCreateInput {\n entity: string;\n data: Record<string, any>;\n}\n\nexport interface EntityCreateOutput {\n id: string;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Create Activity (Mock – Dexie)\n *\n * Inserts one entity into storage (Dexie in mock).\n * Activity type: workflow-activity:entity-create\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityCreateActivity implements AXPCommand<EntityCreateInput, EntityCreateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityCreateInput,\n ): Promise<AXPExecuteCommandResult<EntityCreateOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { id: '', success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { id: '', success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const payload = { ...input.data };\n delete payload['workflowInfo'];\n\n const id = await this.storage.insertOne(input.entity, payload as any);\n const statusId =\n typeof payload['statusId'] === 'string' ? payload['statusId'].trim() : payload['statusId'];\n\n return {\n success: true,\n data: {\n id,\n success: true,\n ...(statusId != null && String(statusId).length > 0 ? { statusId: String(statusId) } : {}),\n },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Create failed' },\n data: { id: '', success: false, error: error?.message ?? 'Create failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAgD3D,IAAA;IA9CC,MAAM,OAAO,CACX,KAAwB,EAAA;AAExB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AAC7D,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,K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AAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE;AAC1E,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GAhDW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-create.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityCreateInput {\n entity: string;\n data: Record<string, any>;\n}\n\nexport interface EntityCreateOutput {\n id: string;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Create Activity (Mock – Dexie)\n *\n * Inserts one entity into storage (Dexie in mock).\n * Activity type: workflow-activity:entity-create\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityCreateActivity implements AXPCommand<EntityCreateInput, EntityCreateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityCreateInput,\n ): Promise<AXPExecuteCommandResult<EntityCreateOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { id: '', success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { id: '', success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const payload = { ...input.data };\n delete payload['workflowInfo'];\n\n const id = await this.storage.insertOne(input.entity, payload as any);\n const statusId =\n typeof payload['statusId'] === 'string' ? payload['statusId'].trim() : payload['statusId'];\n\n return {\n success: true,\n data: {\n id,\n success: true,\n ...(statusId != null && String(statusId).length > 0 ? { statusId: String(statusId) } : {}),\n },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Create failed' },\n data: { id: '', success: false, error: error?.message ?? 'Create failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAgD3D,IAAA;IA9CC,MAAM,OAAO,CACX,KAAwB,EAAA;AAExB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AAC7D,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACjD,OAAO;AACL,oBAAA,OA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;AAC1E,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GAhDW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-delete.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityDeleteInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityDeleteOutput {\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Delete Activity (Mock – Dexie)\n *\n * Deletes one entity from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-delete\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityDeleteActivity implements AXPCommand<EntityDeleteInput, EntityDeleteOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityDeleteInput,\n ): Promise<AXPExecuteCommandResult<EntityDeleteOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n await this.storage.deleteOne(input.entity, input.id);\n\n return {\n success: true,\n data: { success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Delete failed' },\n data: { success: false, error: error?.message ?? 'Delete failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAiBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAuC3D,IAAA;IArCC,MAAM,OAAO,CACX,KAAwB,EAAA;AAExB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACrD,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE;gBACd,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE;AACjD,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AAEA,YAAA,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;YAEpD,OAAO;AACL,gBAAA,OAAO,EAAE,IAAI;AACb,gBAAA,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;AACvB,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aAC9B;QACH;QAAE,OAAO,KAAU,EAAE;YACnB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE;AACpD,gBAAA,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,eAAe,EAAE;AAClE,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GAvCW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-delete.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\n\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityDeleteInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityDeleteOutput {\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Delete Activity (Mock – Dexie)\n *\n * Deletes one entity from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-delete\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityDeleteActivity implements AXPCommand<EntityDeleteInput, EntityDeleteOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityDeleteInput,\n ): Promise<AXPExecuteCommandResult<EntityDeleteOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n await this.storage.deleteOne(input.entity, input.id);\n\n return {\n success: true,\n data: { success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Delete failed' },\n data: { success: false, error: error?.message ?? 'Delete failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAuC3D,IAAA;IArCC,MAAM,OAAO,CACX,KAAwB,EAAA;AAExB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACrD,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,EAAE,EAAE,E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}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-read.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityReadInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityReadOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Read Activity (Mock – Dexie)\n *\n * Loads one entity by id from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-read\n * Outcomes: Done | NotFound | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityReadActivity implements AXPCommand<EntityReadInput, EntityReadOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityReadInput,\n ): Promise<AXPExecuteCommandResult<EntityReadOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const data = await this.storage.getOne(input.entity, input.id);\n\n if (data == null) {\n return {\n success: true,\n data: { data: null, success: false, error: 'Not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n return {\n success: true,\n data: { data, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Read failed' },\n data: { data: null, success: false, error: error?.message ?? 'Read failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAkBA;AAEA;;;;;;AAMG;MAEU,kBAAkB,CAAA;AAD/B,IAAA,WAA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EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;AAC7B,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;aAC9B;QACH;QAAE,OAAO,KAAU,EAAE;YACnB,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE;AAClD,gBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE;AAC5E,gBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GA/CW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA;;2FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-read.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\n\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityReadInput {\n entity: string;\n id: string;\n}\n\nexport interface EntityReadOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Read Activity (Mock – Dexie)\n *\n * Loads one entity by id from storage (Dexie in mock).\n * Activity type: workflow-activity:entity-read\n * Outcomes: Done | NotFound | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityReadActivity implements AXPCommand<EntityReadInput, EntityReadOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityReadInput,\n ): Promise<AXPExecuteCommandResult<EntityReadOutput>> {\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const data = await this.storage.getOne(input.entity, input.id);\n\n if (data == null) {\n return {\n success: true,\n data: { data: null, success: false, error: 'Not found' },\n metadata: { outcome: 'NotFound' },\n };\n }\n\n return {\n success: true,\n data: { data, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Read failed' },\n data: { data: null, success: false, error: error?.message ?? 'Read failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAmBA;AAEA;;;;;;AAMG;MAEU,kBAAkB,CAAA;AAD/B,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AA+C3D,IAAA;IA7CC,MAAM,OAAO,CACX,KAAsB,EAAA;AAEtB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAA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BAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;aAChC;QACH;IACF;8GA/CW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cADL,MAAM,EAAA,CAAA,CAAA;;2FACnB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-update.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityUpdateInput {\n entity: string;\n id: string;\n data: Record<string, any>;\n}\n\nexport interface EntityUpdateOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Update Activity (Mock – Dexie)\n *\n * Updates one entity in storage (Dexie in mock).\n * Activity type: workflow-activity:entity-update\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityUpdateActivity implements AXPCommand<EntityUpdateInput, EntityUpdateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityUpdateInput,\n ): Promise<AXPExecuteCommandResult<EntityUpdateOutput>> {\n\n\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { data: null, success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const updated = await this.storage.updateOne(input.entity, input.id, input.data as any);\n\n return {\n success: true,\n data: { data: updated, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Update failed' },\n data: { data: null, success: false, error: error?.message ?? 'Update failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAmBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAiD3D,IAAA;IA/CC,MAAM,OAAO,CACX,KAAwB,EAAA;AAIxB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACjE,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE;gBACd,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;AACnC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK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ApB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/entity-update.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\n\n//#region ---- Types ----\n\nexport interface EntityUpdateInput {\n entity: string;\n id: string;\n data: Record<string, any>;\n}\n\nexport interface EntityUpdateOutput {\n data: any;\n success: boolean;\n error?: string;\n}\n\n//#endregion\n\n/**\n * Entity Update Activity (Mock – Dexie)\n *\n * Updates one entity in storage (Dexie in mock).\n * Activity type: workflow-activity:entity-update\n * Outcomes: Done | Failed\n */\n@Injectable({ providedIn: 'root' })\nexport class EntityUpdateActivity implements AXPCommand<EntityUpdateInput, EntityUpdateOutput> {\n private readonly storage = inject(AXPEntityStorageService);\n\n async execute(\n input: EntityUpdateInput,\n ): Promise<AXPExecuteCommandResult<EntityUpdateOutput>> {\n\n\n try {\n if (!input?.entity) {\n return {\n success: false,\n message: { text: 'entity is required' },\n data: { data: null, success: false, error: 'entity is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input?.id) {\n return {\n success: false,\n message: { text: 'id is required' },\n data: { data: null, success: false, error: 'id is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n if (!input.data || typeof input.data !== 'object') {\n return {\n success: false,\n message: { text: 'data is required' },\n data: { data: null, success: false, error: 'data is required' },\n metadata: { outcome: 'Failed' },\n };\n }\n\n const updated = await this.storage.updateOne(input.entity, input.id, input.data as any);\n\n return {\n success: true,\n data: { data: updated, success: true },\n metadata: { outcome: 'Done' },\n };\n } catch (error: any) {\n return {\n success: false,\n message: { text: error?.message ?? 'Update failed' },\n data: { data: null, success: false, error: error?.message ?? 'Update failed' },\n metadata: { outcome: 'Failed' },\n };\n }\n }\n}\n"],"names":[],"mappings":";;;;AAmBA;AAEA;;;;;;AAMG;MAEU,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAiD3D,IAAA;IA/CC,MAAM,OAAO,CACX,KAAwB,EAAA;AAIxB,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE;gBAClB,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE;AACvC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE;AACjE,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE;gBACd,OAAO;AACL,oBAAA,OAAO,EAAE,KAAK;AACd,oBAAA,OAAO,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;AACnC,oBAAA,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE;AAC7D,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;iBAChC;YACH;AACA,YAAA,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;gBACjD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AA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/extract-document-text.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPAiChatTransport } from '@acorex/modules/ai-management';\nimport { AXPAiChatToolRunContextService } from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPAiEngine } from '@acorex/modules/ai-management';\n\nimport type { AXCAiEngine } from '../ai-agent-engine';\n\n//#endregion\n\n//#region ---- Command ----\n\nexport interface AiManagementExtractDocumentTextInput {\n fileId?: string;\n instruction?: string;\n /** When not in an AI chat run context (e.g. document metadata prefill). */\n assistId?: string;\n chatTransport?: AXPAiChatTransport;\n modelEntityId?: string;\n}\n\nfunction parseExtractInput(args: unknown):\n | { ok: true; fileId: string; instruction?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const fileId = typeof obj['fileId'] === 'string' ? obj['fileId'].trim() : '';\n if (!fileId) {\n return { ok: false, error: 'Invalid arguments: \"fileId\" is required.' };\n }\n const instruction = typeof obj['instruction'] === 'string' ? obj['instruction'].trim() : undefined;\n return { ok: true, fileId, ...(instruction ? { instruction } : {}) };\n}\n\n@Injectable()\nexport class AiManagementExtractDocumentTextCommand\n implements AXPCommand<AiManagementExtractDocumentTextInput, { text: string }>\n{\n private readonly engine = inject(AXPAiEngine) as AXCAiEngine;\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n\n async execute(\n input: AiManagementExtractDocumentTextInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n const parsed = parseExtractInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n const assistId = ctx?.assistId?.trim() ?? input.assistId?.trim();\n const chatTransport = ctx?.chatTransport ?? input.chatTransport;\n const modelEntityId = ctx?.modelEntityId ?? input.modelEntityId;\n\n if (!assistId || !chatTransport) {\n return {\n success: false,\n message: {\n text: 'Document extraction requires assist id and chat transport (active chat context or input fields).',\n },\n };\n }\n\n try {\n const data = await this.engine.extractDocumentTextFromStoredFile({\n assistId,\n chatTransport,\n modelEntityId,\n fileId: parsed.fileId,\n instruction: parsed.instruction,\n });\n return { success: true, data };\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAwBA,SAAS,iBAAiB,CAAC,IAAa,EAAA;AAGtC,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,QAAQ,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE;IAC5E,IAAI,CAAC,MAAM,EAAE;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,0CAA0C,EAAE;IACzE;IACA,MAAM,WAAW,GAAG,OAAO,GAAG,CAAC,aAAa,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAClG,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,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AAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;QAChC;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GAzCW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAtC,sCAAsC,EAAA,CAAA,CAAA;;2FAAtC,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs","sources":["../../../../libs/connectivity/mock/src/lib/ai-management/commands/extract-document-text.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport type { AXPAiChatTransport } from '@acorex/modules/ai-management';\nimport { AXPAiChatToolRunContextService } from '@acorex/modules/ai-management';\nimport { Injectable, inject } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPAiEngine } from '@acorex/modules/ai-management';\n\nimport type { AXCAiEngine } from '../ai-agent-engine';\n\n//#endregion\n\n//#region ---- Command ----\n\nexport interface AiManagementExtractDocumentTextInput {\n fileId?: string;\n instruction?: string;\n /** When not in an AI chat run context (e.g. document metadata prefill). */\n assistId?: string;\n chatTransport?: AXPAiChatTransport;\n modelEntityId?: string;\n}\n\nfunction parseExtractInput(args: unknown):\n | { ok: true; fileId: string; instruction?: string }\n | { ok: false; error: string } {\n const obj =\n args != null && typeof args === 'object' && !Array.isArray(args)\n ? (args as Record<string, unknown>)\n : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const fileId = typeof obj['fileId'] === 'string' ? obj['fileId'].trim() : '';\n if (!fileId) {\n return { ok: false, error: 'Invalid arguments: \"fileId\" is required.' };\n }\n const instruction = typeof obj['instruction'] === 'string' ? obj['instruction'].trim() : undefined;\n return { ok: true, fileId, ...(instruction ? { instruction } : {}) };\n}\n\n@Injectable()\nexport class AiManagementExtractDocumentTextCommand\n implements AXPCommand<AiManagementExtractDocumentTextInput, { text: string }>\n{\n private readonly engine = inject(AXPAiEngine) as AXCAiEngine;\n private readonly runContext = inject(AXPAiChatToolRunContextService);\n\n async execute(\n input: AiManagementExtractDocumentTextInput,\n ): Promise<AXPExecuteCommandResult<{ text: string }>> {\n const ctx = this.runContext.getContext();\n const parsed = parseExtractInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n\n const assistId = ctx?.assistId?.trim() ?? input.assistId?.trim();\n const chatTransport = ctx?.chatTransport ?? input.chatTransport;\n const modelEntityId = ctx?.modelEntityId ?? input.modelEntityId;\n\n if (!assistId || !chatTransport) {\n return {\n success: false,\n message: {\n text: 'Document extraction requires assist id and chat transport (active chat context or input fields).',\n },\n };\n }\n\n try {\n const data = await this.engine.extractDocumentTextFromStoredFile({\n assistId,\n chatTransport,\n modelEntityId,\n fileId: parsed.fileId,\n instruction: parsed.instruction,\n });\n return { success: true, data };\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { success: false, message: { text: msg } };\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAwBA,SAAS,iBAAiB,CAAC,IAAa,EAAA;AAGtC,IAAA,MAAM,GAAG,GACP,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;AAC7D,UAAG;UACD,IAAI;IACV,IAAI,CAAC,GAAG,EAAE;QACR,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,wCAAwC,EAAE;IACvE;IACA,MAAM,MAAM,GAAG,OAAO,GA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,CAAC,aAAa,EAAE;YAC/B,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,kGAAkG;AACzG,iBAAA;aACF;QACH;AAEA,QAAA,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,iCAAiC,CAAC;gBAC/D,QAAQ;gBACR,aAAa;gBACb,aAAa;gBACb,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,WAAW,EAAE,MAAM,CAAC,WAAW;AAChC,aAAA,CAAC;AACF,YAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;QAChC;QAAE,OAAO,CAAC,EAAE;AACV,YAAA,MAAM,GAAG,GAAG,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC;AACtD,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QACnD;IACF;8GAzCW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAtC,sCAAsC,EAAA,CAAA,CAAA;;2FAAtC,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-session-user.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nexport interface GetCurrentSessionUserOutput {\n userId: string | null;\n}\n\n/**\n * Returns the platform user id of the current session (workflow initiator when run in UI).\n *\n * Activity Type: workflow-activity:get-current-session-user\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentSessionUserActivity\n implements AXPCommand<Record<string, never>, GetCurrentSessionUserOutput>\n{\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentSessionUserOutput>> {\n const userId = this.sessionService.user?.id ?? null;\n console.log('[WFM-LifecycleTaskTrace] get-current-session-user', {\n userId,\n hasSession: !!this.sessionService.user,\n });\n return {\n success: true,\n data: { userId },\n metadata: {\n outcome: 'Done',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAgB5D,IAAA;AAdC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI;AACnD,QAAA,OAAO,CAAC,GAAG,CAAC,mDAAmD,EAAE;YAC/D,MAAM;AACN,YAAA,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI;AACvC,SAAA,CAAC;QACF,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,MAAM,EAAE;AAChB,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GAlBW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cAF5B,MAAM,EAAA,CAAA,CAAA;;2FAEP,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-session-user.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nexport interface GetCurrentSessionUserOutput {\n userId: string | null;\n}\n\n/**\n * Returns the platform user id of the current session (workflow initiator when run in UI).\n *\n * Activity Type: workflow-activity:get-current-session-user\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentSessionUserActivity\n implements AXPCommand<Record<string, never>, GetCurrentSessionUserOutput>\n{\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentSessionUserOutput>> {\n const userId = this.sessionService.user?.id ?? null;\n console.log('[WFM-LifecycleTaskTrace] get-current-session-user', {\n userId,\n hasSession: !!this.sessionService.user,\n });\n return {\n success: true,\n data: { userId },\n metadata: {\n outcome: 'Done',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;AASA;;;;AAIG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAgB5D,IAAA;AAdC,IAAA,MAAM,OAAO,GAAA;QACX,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,IAAI,IAAI;AACnD,QAAA,OAAO,CAAC,GAAG,CAAC,mDAAmD,EAAE;YAC/D,MAAM;AACN,YAAA,UAAU,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI;AACvC,SAAA,CAAC;QACF,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,MAAM,EAAE;AAChB,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GAlBW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cAF5B,MAAM,EAAA,CAAA,CAAA;;2FAEP,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-user-manager.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/core';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nconst EMPLOYEE_ENTITY = 'HumanCapitalManagement.Employee';\n\nexport interface GetCurrentUserManagerOutput {\n managerId: string | null;\n}\n\n/**\n * Get Current User Manager Activity (Backend - Mock)\n *\n * Resolves the manager of the current user (Employee → managerId → manager's userId).\n * Use when assigning a review task to the current user's manager (e.g. questionnaire review)\n * without a leave request or other ref entity.\n *\n * Execution Mode: backend\n * Activity Type: workflow-activity:get-current-user-manager\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentUserManagerActivity implements AXPCommand<Record<string, never>, GetCurrentUserManagerOutput> {\n private readonly entityStorage = inject(AXPEntityStorageService);\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentUserManagerOutput>> {\n let managerId: string | null = null;\n const userId = this.sessionService.user?.id;\n\n if (userId) {\n try {\n const result = await this.entityStorage.query(EMPLOYEE_ENTITY, {\n skip: 0,\n take: 1,\n filter: {\n field: 'userId',\n operator: { type: 'equal' },\n value: userId,\n },\n });\n const employees = result.items as { id: string; managerId?: string | null }[] | undefined;\n const employee = employees?.[0];\n const managerEmployeeId = employee?.managerId;\n\n if (managerEmployeeId) {\n const managerEmp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, managerEmployeeId)) as {\n userId?: string;\n } | null;\n managerId = managerEmp?.userId ?? managerEmployeeId;\n }\n } catch {\n // keep managerId null\n }\n }\n\n return {\n success: true,\n data: {\n managerId,\n },\n metadata: {\n outcome: 'Done',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;;AAMA,MAAM,eAAe,GAAG,iCAAiC;AAMzD;;;;;;;;;AASG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AA0C5D,IAAA;AAxCC,IAAA,MAAM,OAAO,GAAA;QACX,IAAI,SAAS,GAAkB,IAAI;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE;QAE3C,IAAI,MAAM,EAAE;AACV,YAAA,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,eAAe,EAAE;AAC7D,oBAAA,IAAI,EAAE,CAAC;AACP,oBAAA,IAAI,EAAE,CAAC;AACP,oBAAA,MAAM,EAAE;AACN,wBAAA,KAAK,EAAE,QAAQ;AACf,wBAAA,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE;AAC3B,wBAAA,KAAK,EAAE,MAAM;AACd,qBAAA;AACF,iBAAA,CAAC;AACF,gBAAA,MAAM,SAAS,GAAG,MAAM,CAAC,KAAgE;AACzF,gBAAA,MAAM,QAAQ,GAAG,SAAS,GAAG,CAAC,CAAC;AAC/B,gBAAA,MAAM,iBAAiB,GAAG,QAAQ,EAAE,SAAS;gBAE7C,IAAI,iBAAiB,EAAE;AACrB,oBAAA,MAAM,UAAU,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAE/E;AACR,oBAAA,SAAS,GAAG,UAAU,EAAE,MAAM,IAAI,iBAAiB;gBACrD;YACF;AAAE,YAAA,MAAM;;YAER;QACF;QAEA,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE;gBACJ,SAAS;AACV,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GA3CW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cAF5B,MAAM,EAAA,CAAA,CAAA;;2FAEP,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs","sources":["../../../../libs/connectivity/mock/src/lib/workflow-management/activities/get-current-user-manager.activity.ts"],"sourcesContent":["import { inject, Injectable } from '@angular/core';\nimport { AXPExecuteCommandResult } from '@acorex/platform/contracts';\n\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport { AXPEntityStorageService } from '@acorex/platform/layout/entity';\nimport { AXPSessionService } from '@acorex/platform/auth';\n\nconst EMPLOYEE_ENTITY = 'HumanCapitalManagement.Employee';\n\nexport interface GetCurrentUserManagerOutput {\n managerId: string | null;\n}\n\n/**\n * Get Current User Manager Activity (Backend - Mock)\n *\n * Resolves the manager of the current user (Employee → managerId → manager's userId).\n * Use when assigning a review task to the current user's manager (e.g. questionnaire review)\n * without a leave request or other ref entity.\n *\n * Execution Mode: backend\n * Activity Type: workflow-activity:get-current-user-manager\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class GetCurrentUserManagerActivity implements AXPCommand<Record<string, never>, GetCurrentUserManagerOutput> {\n private readonly entityStorage = inject(AXPEntityStorageService);\n private readonly sessionService = inject(AXPSessionService);\n\n async execute(): Promise<AXPExecuteCommandResult<GetCurrentUserManagerOutput>> {\n let managerId: string | null = null;\n const userId = this.sessionService.user?.id;\n\n if (userId) {\n try {\n const result = await this.entityStorage.query(EMPLOYEE_ENTITY, {\n skip: 0,\n take: 1,\n filter: {\n field: 'userId',\n operator: { type: 'equal' },\n value: userId,\n },\n });\n const employees = result.items as { id: string; managerId?: string | null }[] | undefined;\n const employee = employees?.[0];\n const managerEmployeeId = employee?.managerId;\n\n if (managerEmployeeId) {\n const managerEmp = (await this.entityStorage.getOne(EMPLOYEE_ENTITY, managerEmployeeId)) as {\n userId?: string;\n } | null;\n managerId = managerEmp?.userId ?? managerEmployeeId;\n }\n } catch {\n // keep managerId null\n }\n }\n\n return {\n success: true,\n data: {\n managerId,\n },\n metadata: {\n outcome: 'Done',\n },\n };\n }\n}\n"],"names":[],"mappings":";;;;;AAOA,MAAM,eAAe,GAAG,iCAAiC;AAMzD;;;;;;;;;AASG;MAIU,6BAA6B,CAAA;AAH1C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA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AA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,6BAA6B,cAF5B,MAAM,EAAA,CAAA,CAAA;;2FAEP,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBAHzC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;;;"}
@@ -1,4 +1,4 @@
1
- import { resolveMultiLanguageString } from '@acorex/core/translation';
1
+ import { resolveMultiLanguageString } from '@acorex/platform/contracts';
2
2
  import { RootConfig } from '@acorex/modules/product-catalog';
3
3
  import { AXPEntityService } from '@acorex/platform/layout/entity';
4
4
  import * as i0 from '@angular/core';
@@ -251,4 +251,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
251
251
  }] });
252
252
 
253
253
  export { GetProductListQuery };
254
- //# sourceMappingURL=acorex-connectivity-mock-get-product-list.query-Bv1im5yj.mjs.map
254
+ //# sourceMappingURL=acorex-connectivity-mock-get-product-list.query-o9TcY_RC.mjs.map