@acorex/connectivity 21.0.0-next.70 → 21.0.0-next.72
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.
- package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-DXJDJBvf.mjs → acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.mjs} +4916 -3286
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-B-ZAFQQM.mjs → acorex-connectivity-mock-assign-to-manager.activity-7uIojNj1.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-B-ZAFQQM.mjs.map → acorex-connectivity-mock-assign-to-manager.activity-7uIojNj1.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-DBn-KZft.mjs → acorex-connectivity-mock-chat-generate-image.command-B5cbkpr0.mjs} +23 -26
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-B5cbkpr0.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-CdhGiZsU.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-rqgbcQxF.mjs} +38 -48
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-rqgbcQxF.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-D3om-6Pi.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-DMKreUYD.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-D3om-6Pi.mjs.map → acorex-connectivity-mock-chat-transcribe-speech.command-DMKreUYD.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-B_duq_t1.mjs → acorex-connectivity-mock-user-roles-for-list-column.query-CoH1CYkf.mjs} +2 -2
- package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-B_duq_t1.mjs.map → acorex-connectivity-mock-user-roles-for-list-column.query-CoH1CYkf.mjs.map} +1 -1
- package/fesm2022/acorex-connectivity-mock.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-connectivity-mock.d.ts +127 -212
- package/fesm2022/acorex-connectivity-mock-acorex-connectivity-mock-DXJDJBvf.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-DBn-KZft.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-CdhGiZsU.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 {
|
|
8
|
+
import { e as axcSyncSingleEmployeeDenormalizedOrgFields } from './acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.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-
|
|
288
|
+
//# sourceMappingURL=acorex-connectivity-mock-assign-to-manager.activity-7uIojNj1.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-assign-to-manager.activity-B-ZAFQQM.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/core';\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,CAAC,GAAG,CAAC,GAAG,IAAI;IAChC;AACA,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE;AAChE,QAAA,MAAM,EAAE,GAAI,KAAyB,CAAC,EAAE;QACxC,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,EAAE,EAAE;AAC3B,YAAA,OAAO,IAAI;QACb;QACA,MAAM,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE;AAC3B,QAAA,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;IAChC;AACA,IAAA,OAAO,IAAI;AACb;AAEA;AACA,SAAS,wBAAwB,CAAC,GAAY,EAAA;IAC5C,IAAI,GAAG,IAAI,IAAI,IAAI,G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AS;YACT,cAAc,EAAE,cAAc,IAAI,IAAI;YACtC,oBAAoB,EAAE,CAAC,EAAE,YAAY,IAAI,cAAc,CAAC,IAAI,CAAC,mBAAmB;YAChF,YAAY,EAAE,YAAY,IAAI,IAAI;YAClC,cAAc,EAAE,cAAc,IAAI,IAAI;AACvC,SAAA,CAAC;QAEF,OAAO;AACL,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE;gBACJ,SAAS;gBACT,iBAAiB;gBACjB,OAAO;gBACP,QAAQ;AACT,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GArOW,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-assign-to-manager.activity-7uIojNj1.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/core';\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,QAA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L,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,IAAI,EAAE;gBACJ,SAAS;gBACT,iBAAiB;gBACjB,OAAO;gBACP,QAAQ;AACT,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,MAAM;AAChB,aAAA;SACF;IACH;8GArOW,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,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RootConfig, modelRowHasPurpose, blobOrFileFromImageResult, persistAiGeneratedImage, AI_CHAT_GENERATED_IMAGE_REF_TYPE, AI_GENERATED_IMAGE_MAX_REMOTE_URL_IN_TOOL } from '@acorex/modules/ai-management';
|
|
2
2
|
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,
|
|
6
|
+
import { A as AXCAiChatRouterService, a as AXMAiModelStableIds } from './acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.mjs';
|
|
7
7
|
|
|
8
8
|
//#region ---- Imports ----
|
|
9
9
|
function parseGenerateImageInput(args) {
|
|
@@ -31,38 +31,35 @@ function parseGenerateImageInput(args) {
|
|
|
31
31
|
class AiManagementChatGenerateImageCommand {
|
|
32
32
|
constructor() {
|
|
33
33
|
this.aiChatRouter = inject(AXCAiChatRouterService);
|
|
34
|
-
this.runContext = inject(AXPAiChatToolRunContextService);
|
|
35
34
|
this.fileStorage = inject(AXPFileStorageService);
|
|
36
35
|
this.entityService = inject(AXPEntityService);
|
|
37
|
-
this.
|
|
38
|
-
.withEntity(RootConfig.module.name, RootConfig.entities.
|
|
36
|
+
this.modelData = this.entityService
|
|
37
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.model.name)
|
|
39
38
|
.data();
|
|
40
39
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Resolves the image catalog row from the command `model` input only (invalid ids are ignored).
|
|
42
|
+
*/
|
|
43
|
+
async resolveImageModelEntityId(explicitModel) {
|
|
44
|
+
const candidates = [
|
|
45
|
+
explicitModel?.trim(),
|
|
46
|
+
AXMAiModelStableIds.openrouterGrokImagineImageQuality,
|
|
47
|
+
].filter((id) => Boolean(id?.trim()));
|
|
48
|
+
for (const candidate of candidates) {
|
|
49
|
+
const row = await this.modelData.byKey(candidate);
|
|
50
|
+
if (row && modelRowHasPurpose(row, 'image')) {
|
|
51
|
+
return candidate;
|
|
52
|
+
}
|
|
50
53
|
}
|
|
54
|
+
return AXMAiModelStableIds.openrouterGrokImagineImageQuality;
|
|
55
|
+
}
|
|
56
|
+
async execute(input) {
|
|
51
57
|
const parsed = parseGenerateImageInput(input);
|
|
52
58
|
if (!parsed.ok) {
|
|
53
59
|
return { success: false, message: { text: parsed.error } };
|
|
54
60
|
}
|
|
55
61
|
try {
|
|
56
|
-
const
|
|
57
|
-
if (!assist) {
|
|
58
|
-
return {
|
|
59
|
-
success: false,
|
|
60
|
-
message: { text: `Assist row was not found (id: ${ctx.assistId.trim()}).` },
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
const modelEntityId = parsed.model?.trim() ||
|
|
64
|
-
resolveDelegatedAssistOptionModel(assist, ctx.agentId) ||
|
|
65
|
-
AXMAiModelStableIds.openaiGptImage1;
|
|
62
|
+
const modelEntityId = await this.resolveImageModelEntityId(parsed.model);
|
|
66
63
|
let composedPrompt = parsed.prompt;
|
|
67
64
|
if (parsed.style?.trim()) {
|
|
68
65
|
composedPrompt = `${composedPrompt}\nStyle: ${parsed.style.trim()}`;
|
|
@@ -75,7 +72,7 @@ class AiManagementChatGenerateImageCommand {
|
|
|
75
72
|
try {
|
|
76
73
|
const file = await blobOrFileFromImageResult(imageUrl);
|
|
77
74
|
const { fileId } = await persistAiGeneratedImage(this.fileStorage, file, {
|
|
78
|
-
refId:
|
|
75
|
+
refId: modelEntityId,
|
|
79
76
|
refType: AI_CHAT_GENERATED_IMAGE_REF_TYPE,
|
|
80
77
|
});
|
|
81
78
|
return {
|
|
@@ -111,4 +108,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
111
108
|
}] });
|
|
112
109
|
|
|
113
110
|
export { AiManagementChatGenerateImageCommand };
|
|
114
|
-
//# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-
|
|
111
|
+
//# sourceMappingURL=acorex-connectivity-mock-chat-generate-image.command-B5cbkpr0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-B5cbkpr0.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/core';\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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M,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;;;;;"}
|
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
import { AXPAiChatToolRunContextService, RootConfig, persistAiGeneratedSpeech, AI_CHAT_GENERATED_SPEECH_REF_TYPE } from '@acorex/modules/ai-management';
|
|
1
|
+
import { AXPAiChatToolRunContextService, RootConfig, modelRowHasPurpose, prepareTtsBytesForBrowserPlayback, persistAiGeneratedSpeech, AI_CHAT_GENERATED_SPEECH_REF_TYPE } from '@acorex/modules/ai-management';
|
|
2
2
|
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,
|
|
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-ChTgoKCp.mjs';
|
|
7
7
|
|
|
8
8
|
//#region ---- Imports ----
|
|
9
|
-
function extForMime(mime) {
|
|
10
|
-
const m = mime.toLowerCase();
|
|
11
|
-
if (m.includes('mpeg') || m.includes('mp3')) {
|
|
12
|
-
return 'mp3';
|
|
13
|
-
}
|
|
14
|
-
if (m.includes('wav')) {
|
|
15
|
-
return 'wav';
|
|
16
|
-
}
|
|
17
|
-
if (m.includes('opus')) {
|
|
18
|
-
return 'opus';
|
|
19
|
-
}
|
|
20
|
-
if (m.includes('ogg')) {
|
|
21
|
-
return 'ogg';
|
|
22
|
-
}
|
|
23
|
-
if (m.includes('aac')) {
|
|
24
|
-
return 'aac';
|
|
25
|
-
}
|
|
26
|
-
if (m.includes('flac')) {
|
|
27
|
-
return 'flac';
|
|
28
|
-
}
|
|
29
|
-
return 'bin';
|
|
30
|
-
}
|
|
31
9
|
function parseSynthesizeInput(args) {
|
|
32
10
|
const obj = args != null && typeof args === 'object' && !Array.isArray(args)
|
|
33
11
|
? args
|
|
@@ -56,10 +34,31 @@ class AiManagementChatSynthesizeSpeechCommand {
|
|
|
56
34
|
this.runContext = inject(AXPAiChatToolRunContextService);
|
|
57
35
|
this.fileStorage = inject(AXPFileStorageService);
|
|
58
36
|
this.entityService = inject(AXPEntityService);
|
|
37
|
+
this.modelData = this.entityService
|
|
38
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.model.name)
|
|
39
|
+
.data();
|
|
59
40
|
this.assistData = this.entityService
|
|
60
41
|
.withEntity(RootConfig.module.name, RootConfig.entities.assist.name)
|
|
61
42
|
.data();
|
|
62
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Resolves the TTS catalog row from the command `model` input only (invalid ids are ignored).
|
|
46
|
+
*/
|
|
47
|
+
async resolveTtsModelEntityId(explicitModel) {
|
|
48
|
+
const candidates = [
|
|
49
|
+
explicitModel?.trim(),
|
|
50
|
+
AXMAiModelStableIds.openrouterGemini31FlashTtsPreview,
|
|
51
|
+
AXMAiModelStableIds.openrouterKokoro82m,
|
|
52
|
+
AXMAiModelStableIds.openrouterGrokVoiceTts10,
|
|
53
|
+
].filter((id) => Boolean(id?.trim()));
|
|
54
|
+
for (const candidate of candidates) {
|
|
55
|
+
const row = await this.modelData.byKey(candidate);
|
|
56
|
+
if (row && modelRowHasPurpose(row, 'tts')) {
|
|
57
|
+
return candidate;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return AXMAiModelStableIds.openrouterGemini31FlashTtsPreview;
|
|
61
|
+
}
|
|
63
62
|
async execute(input) {
|
|
64
63
|
const ctx = this.runContext.getContext();
|
|
65
64
|
if (!ctx?.assistId?.trim()) {
|
|
@@ -75,37 +74,28 @@ class AiManagementChatSynthesizeSpeechCommand {
|
|
|
75
74
|
return { success: false, message: { text: parsed.error } };
|
|
76
75
|
}
|
|
77
76
|
try {
|
|
77
|
+
const modelEntityId = await this.resolveTtsModelEntityId(parsed.model);
|
|
78
|
+
const modelRow = await this.modelData.byKey(modelEntityId);
|
|
79
|
+
const catalogApiModelName = modelRow?.name?.trim() ?? '';
|
|
78
80
|
const assist = await this.assistData.byKey(ctx.assistId.trim());
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const modelEntityId = parsed.model?.trim() || resolveDelegatedAssistOptionModel(assist, ctx.agentId) || '';
|
|
86
|
-
if (!modelEntityId) {
|
|
87
|
-
return {
|
|
88
|
-
success: false,
|
|
89
|
-
message: {
|
|
90
|
-
text: 'No TTS model: pass "model" (catalog id) or set options.model on the text-to-speech delegated specialist row for this assist.',
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
const voiceFromAssist = resolveDelegatedAssistOptionString(assist, ctx.agentId, 'voice') || undefined;
|
|
95
|
-
const voice = parsed.voice?.trim() || voiceFromAssist || 'alloy';
|
|
81
|
+
const voiceFromAssist = assist ? resolveDelegatedAssistOptionString(assist, ctx.agentId, 'voice') || undefined : undefined;
|
|
82
|
+
const formatFromAssist = assist ? resolveDelegatedAssistOptionString(assist, ctx.agentId, 'responseFormat') || undefined : undefined;
|
|
83
|
+
const voice = resolveOpenAiCompatibleTtsVoice(catalogApiModelName, parsed.voice?.trim() || voiceFromAssist);
|
|
84
|
+
const responseFormat = parsed.responseFormat?.trim() ||
|
|
85
|
+
formatFromAssist?.trim() ||
|
|
86
|
+
OPENROUTER_GEMINI_FLASH_TTS_DEFAULT_FORMAT;
|
|
96
87
|
const { audioBytes, mimeType } = await this.aiChatRouter.synthesizeSpeech({
|
|
97
88
|
modelEntityId,
|
|
98
89
|
text: parsed.text,
|
|
99
90
|
voice,
|
|
100
|
-
|
|
91
|
+
responseFormat,
|
|
101
92
|
});
|
|
102
|
-
const
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
const file = new File([audioBytes], fileName, { type: mt });
|
|
93
|
+
const prepared = prepareTtsBytesForBrowserPlayback(audioBytes, mimeType?.trim() || 'application/octet-stream');
|
|
94
|
+
const fileName = `ai-tts.${prepared.extension}`;
|
|
95
|
+
const file = new File([prepared.audioBytes], fileName, { type: prepared.mimeType });
|
|
106
96
|
try {
|
|
107
97
|
const { fileId } = await persistAiGeneratedSpeech(this.fileStorage, file, {
|
|
108
|
-
refId:
|
|
98
|
+
refId: ctx.assistId.trim(),
|
|
109
99
|
refType: AI_CHAT_GENERATED_SPEECH_REF_TYPE,
|
|
110
100
|
});
|
|
111
101
|
return { success: true, data: { fileId, text: parsed.text } };
|
|
@@ -128,4 +118,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
128
118
|
}] });
|
|
129
119
|
|
|
130
120
|
export { AiManagementChatSynthesizeSpeechCommand };
|
|
131
|
-
//# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-
|
|
121
|
+
//# sourceMappingURL=acorex-connectivity-mock-chat-synthesize-speech.command-rqgbcQxF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-connectivity-mock-chat-synthesize-speech.command-rqgbcQxF.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/core';\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;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AY,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-
|
|
6
|
+
import { A as AXCAiChatRouterService, r as resolveDelegatedAssistOptionModel, b as resolveAssistSpeechModelId, c as resolveDelegatedAssistOptionString } from './acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.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-
|
|
121
|
+
//# sourceMappingURL=acorex-connectivity-mock-chat-transcribe-speech.command-DMKreUYD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-
|
|
1
|
+
{"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-DMKreUYD.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/core';\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,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,QAAQ,GAAG,OAAO,GAAG,CAAC,UAAU,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IACzF,OAAO;AACL,QAAA,EAAE,EAAE,IAAI;QACR,MAAM;AACN,QAAA,IAAI,KAAK,GAAG,EAAE,KAAK,EAAE,GAAG,E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AA;;2FAAvC,uCAAuC,EAAA,UAAA,EAAA,CAAA;kBADnD;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable } from '@angular/core';
|
|
3
|
-
import { m as mockUsers } from './acorex-connectivity-mock-acorex-connectivity-mock-
|
|
3
|
+
import { m as mockUsers } from './acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.mjs';
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
/**
|
|
@@ -27,4 +27,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
27
27
|
}] });
|
|
28
28
|
|
|
29
29
|
export { UserRolesForListColumnQuery };
|
|
30
|
-
//# sourceMappingURL=acorex-connectivity-mock-user-roles-for-list-column.query-
|
|
30
|
+
//# sourceMappingURL=acorex-connectivity-mock-user-roles-for-list-column.query-CoH1CYkf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-user-roles-for-list-column.query-
|
|
1
|
+
{"version":3,"file":"acorex-connectivity-mock-user-roles-for-list-column.query-CoH1CYkf.mjs","sources":["../../../../libs/connectivity/mock/src/lib/security-management/user/user-roles-for-list-column.query.ts"],"sourcesContent":["import { AXPQuery } from '@acorex/platform/runtime';\nimport { Injectable } from '@angular/core';\nimport { mockUsers } from './user.mock';\n\n//#region ---- Types ----\n\nexport interface UserRolesForListColumnQueryInput {\n userId?: string;\n}\n\nexport interface UserRolesForListColumnQueryResult {\n items: { id: string; title: unknown }[];\n}\n\n//#endregion\n\n/**\n * Resolves role rows for the user list lookup column when using {@link countOnly} column resolve.\n */\n@Injectable({ providedIn: 'root' })\nexport class UserRolesForListColumnQuery implements AXPQuery<UserRolesForListColumnQueryInput, UserRolesForListColumnQueryResult> {\n async fetch(input: UserRolesForListColumnQueryInput): Promise<UserRolesForListColumnQueryResult> {\n const userId = input?.userId?.trim();\n if (!userId) {\n return { items: [] };\n }\n const user = mockUsers.find((u) => u.id === userId);\n if (!user?.roles?.length) {\n return { items: [] };\n }\n return { items: user.roles };\n }\n}\n"],"names":[],"mappings":";;;;AAcA;AAEA;;AAEG;MAEU,2BAA2B,CAAA;IACtC,MAAM,KAAK,CAAC,KAAuC,EAAA;QACjD,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;QACpC,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB;AACA,QAAA,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,MAAM,CAAC;AACnD,QAAA,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE;AACxB,YAAA,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB;AACA,QAAA,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;IAC9B;8GAXW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { e as ACTIVITY_CATEGORIES, f as ACTIVITY_CATEGORY_ID_BY_KEY, g as ACTIVITY_DEFINITIONS, h as AI_ASSIST_MOCK, i as AI_MODEL_MOCK, j as APPLICATIONS, k as APPLICATION_CATEGORY_IDS, l as APPLICATION_CATEGORY_MOCKS, n as AXCActivityCategorySeeder, o as AXCActivityDefinitionSeeder, p as AXCAiAssistSeeder, q as AXCAiManagementMockModule, s as AXCAiModelSeeder, t as AXCAppTermDataSeeder, u as AXCAppVersionDataSeeder, v as AXCApplicationCategoryDataSeeder, w as AXCApplicationDataSeeder, x as AXCApplicationManagementMockModule, y as AXCAssessmentManagementMockModule, z as AXCAssetManagementMockModule, B as AXCAuthMockModule, C as AXCCalendarDataSeeder, D as AXCCalendarEventDataSeeder, E as AXCCalendarManagementMockModule, F as AXCCommandRegistryDataSeeder, G as AXCCommonMockModule, H as AXCContactCoreMockModule, I as AXCContentManagementMockModule, J as AXCConversationDataSeeder, K as AXCConversationMockConversationApi, L as AXCConversationMockMessageApi, M as AXCConversationMockModule, N as AXCConversationMockRealtimeApi, O as AXCConversationMockUploaderApi, P as AXCConversationMockUserApi, Q as AXCCustomerManagementMockModule, R as AXCDashboardManagementMockModule, S as AXCDataManagementMockModule, T as AXCDexieEntityStorageService, U as AXCDocumentManagementMockModule, V as AXCEditionDataSeeder, W as AXCEntityDefinitionSeederService, X as AXCEntityDefinitionsModule, Y as AXCEntityStorageInsertCommand, Z as AXCEntityStorageModule, _ as AXCEntityStorageQueryQuery, $ as AXCFileStorageServiceDexie, a0 as AXCFileStorageServiceFirestore, a1 as AXCFinancialCoreMockModule, a2 as AXCFirestoreEntityStorageService, a3 as AXCFormTemplateManagementMockModule, a4 as AXCGoogleStrategyMock, a5 as AXCHealthCoreMockModule, a6 as AXCHelpDeskMockModule, a7 as AXCHumanCapitalManagementMockModule, a8 as AXCIdentifierManagementMockModule, a9 as AXCImageCaptchaChallengeProviderMock, aa as AXCLearningManagementMockModule, ab as AXCLocaleManagementMockModule, ac as AXCLocationManagementMockModule, ad as AXCLockService, ae as AXCMeasurementCoreMockModule, af as AXCMeetingManagementMockModule, ag as AXCMetaDataDefinitionDataSeeder, ah as AXCMetadataCategorySeeder, ai as AXCMiddlewaresModule, aj as AXCMockCaptchaChallengeComponent, ak as AXCMockEntityLogListener, al as AXCMockModule, am as AXCMockShowMetaDataFormPopupCommand, an as AXCNotificationManagementMockModule, ao as AXCOrderManagementMockModule, ap as AXCOrganizationManagementMockModule, aq as AXCPersonCoreMockModule, ar as AXCPlatformManagementMockModule, as as AXCProcurementManagementMockModule, at as AXCProductCatalogMockModule, au as AXCProjectManagementMockModule, av as AXCQueryRegistryDataSeeder, aw as AXCReportManagementMockModule, ax as AXCSecurityManagementMockModule, ay as AXCStoredEntityDefinitionLoader, az as AXCSubscriptionManagementMockModule, aA as AXCSupplierManagementMockModule, aB as AXCTaskManagementMockModule, aC as AXCTenantManagementMockModule, aD as AXCTenantSeeder, aE as AXCTextTemplateRenderBackend, aF as AXCTokensDataSeeder, aG as AXCUserPassStrategyMock, aH as AXCVersionDB, aI as AXCVersioningService, aJ as AXCWidgetCatalogDataSeeder, aK as AXCWorkflowCategorySeeder, aL as AXCWorkflowDefinitionDataSeeder, aM as AXCWorkflowEngine, aN as AXCWorkflowExecutionDB, aO as AXCWorkflowExecutionStoreDexie, aP as AXCWorkflowExecutionStoreFirestore, aQ as AXCWorkflowInstanceCartableDemoSeeder, aR as AXCWorkflowManagementMockModule, aS as AXC_ENTITY_STORAGE_BACKEND_TYPE, aT as AXC_FIRESTORE_CONFIG, aU as AXC_FIRESTORE_DB, aV as AXC_WORKFLOW_EXECUTION_STORE, aW as AXMAiDemisAssistAgentUuid, aX as AXMAiDemisAssistId, aY as AXMAiDemisGeneralAssistId, a as AXMAiModelStableIds, aZ as AXMAiPlatformAssistantAssistId, a_ as AXMAutomationDataSeeder, a$ as AXMBusinessUnitDataSeeder, b0 as AXMCalendarEventTypeSeeder, b1 as AXMDashboardChartDataSourceDefinition, b2 as AXMEmployeeDataSeeder, b3 as AXMEmploymentTypeDataSeeder, b4 as AXMFormDataSourcesProvider, b5 as AXMJobDefinitionDataSeeder, b6 as AXMJobLevelDataSeeder, b7 as AXMLeaveRequestDataSeeder, b8 as AXMMeetingDataSeeder, b9 as AXMMeetingFilesDataSeeder, ba as AXMMeetingParticipantDataSeeder, bb as AXMMeetingRoleTypeDataSeeder, bc as AXMMeetingSessionDataSeeder, bd as AXMMeetingTypeDataSeeder, be as AXMMeetingTypeFileTemplateDataSeeder, bf as AXMPositionAssignmentDataSeeder, bg as AXMPositionDataSeeder, bh as AXMQuestionBankItemCategoryDataSeeder, bi as AXMQuestionBankItemDataSeeder, bj as AXMQuestionnaireCategoryDataSeeder, bk as AXMQuestionnaireDataSeeder, bl as AXMResponsibilityDataSeeder, bm as AXMTagDataSeeder, bn as AXMTeamBusinessUnitDataSeeder, bo as AXMTeamDataSeeder, bp as AXMTeamMemberDataSeeder, bq as AXMTeamMemberRoleDataSeeder, br as AXMWorkflowDashboardChartDataSourceDefinition, bs as AXM_AI_REGISTRY_COMMAND_NAME, bt as AXM_AI_REGISTRY_QUERY_NAME, bu as AXM_CORPORATE_BUSINESS_UNIT_ID, bv as AXPDashboardDataSeeder, bw as AXPIdentifierDB, bx as AXPMessageDataSeeder, by as AXPMockChecksumProvider, bz as AXPMockClockProvider, bA as AXPMockIdentifierService, bB as AXPMockLookupProvider, bC as AXPMockPolicyProvider, bD as AXPMockSequenceProvider, bE as AXPRoomDataSeeder, bF as AXPSecurityManagementRoleDataSeeder, bG as AXPSecurityManagementUserDataSeeder, bH as AXPTaskBoardPlatformManagementTaskProvider, bI as AXPTaskBoardProjectManagementTaskProvider, bJ as AXVChangeType, bK as BCC, bL as BOC, bM as BUSINESS_UNITS_MOCK, bN as CHAT_LAST_MESSAGE_IDS, bO as COLLABORATION_STANDARD, bP as COSTMANAGER_ENTERPRISE, bQ as COSTMANAGER_PROFESSIONAL, bR as COSTMANAGER_STANDARD, bS as CP, bT as CRM_ENTERPRISE, bU as DASHBOARDS, bV as EDITIONS, bW as EMPLOYEES_MOCK, bX as EMPLOYMENT_TYPES_MOCK, bY as ENTITY_DEFINITION_MAP, bZ as ENTITY_REGISTRY, b_ as FINANCE_BASIC, b$ as FINANCE_ENTERPRISE, c0 as FINANCE_PRO, c1 as G, c2 as HR_ENTERPRISE, c3 as HW, c4 as JOB_DEFINITIONS_CATEGORY_MOCK, c5 as JOB_DEFINITIONS_MOCK, c6 as JOB_DEFINITION_CATEGORY_KEY_TO_ID, c7 as JOB_LEVELS_MOCK, c8 as LASER_PLUMBING_TENANT_ID, c9 as LEAVE_REQUESTS_MOCK, ca as MAGFA_COMMERCE_STANDARD, cb as MAGFA_CONVERSATION_DASHBOARD, cc as MAGFA_TENANT_ID, cd as METADATA_CATEGORY_IDS, ce as METADATA_GENERAL_CATEGORY_REFS, cf as METADATA_SYSTEM_CATEGORY_REFS, cg as MLC, ch as OHR, ci as ORDERING_BASIC, cj as ORDERING_ENTERPRISE, ck as ORDERING_STANDARD, cl as OWNERSHIP_FILTER_BYPASS, cm as PLATFORM_CONSOLE, cn as PLATFORM_TENANT_ID, co as PM, cp as POSITIONS_CATEGORY_MOCK, cq as POSITIONS_MOCK, cr as POSITION_ASSIGNMENTS_MOCK, cs as QCP, ct as QGEN, cu as QHW, cv as QOHR, cw as QPM, cx as QTLE, cy as QUESTIONNAIRE_CATEGORY_MOCK, cz as QUESTION_BANK_ITEM_CATEGORY_MOCK, cA as QWS, cB as RESPONSIBILITIES_CATEGORY_MOCK, cC as RESPONSIBILITIES_MOCK, cD as RESPONSIBILITY_CATEGORY_KEY_TO_ID, cE as SAFETYMINDER_BASIC, cF as SAFETYMINDER_ENTERPRISE, cG as SAFETYMINDER_PROFESSIONAL, cH as SHOP_BASIC, cI as SHOP_ENTERPRISE, cJ as SHOP_PRO, cK as TAGS_MOCK, cL as TASKS, cM as TASK_STATUSES, cN as TASK_TEMPLATES, cO as TASK_TYPES, cP as TEAMS_CATEGORY_MOCK, cQ as TEAMS_MOCK, cR as TEAM_BUSINESS_UNITS_MOCK, cS as TEAM_CATEGORY_KEY_TO_ID, cT as TEAM_MEMBERS_MOCK, cU as TEAM_MEMBER_ROLES_MOCK, cV as TIMEPLICITY_TENANT_ID, cW as TLA, cX as TOKENS, cY as TPC, cZ as VISIBILITY_FILTER_BYPASS, c_ as WORKFLOW_CATEGORIES, c$ as WS, d0 as activityCategoryMocks, d1 as activityDefinitionEntityMock, d2 as applyEntityDefinitionFirestoreSnapshot, d3 as attachmentsInterface, d4 as automationCommandMiddleware, d5 as automationMock, d6 as avatarInterface, d7 as awaitConversationMockSharedStorage, d8 as axVersionDB, d9 as axWorkflowExecutionDB, da as axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows, db as axcPatchEmployeeActivePrimaryPositionRefsFromRows, dc as axcPatchEmployeeManagerRefsFromRows, dd as axcResolveCommandRegistrySeedId, de as axcResolveQueryRegistrySeedId, df as axcResolveWidgetCatalogSeedId, dg as bankCategory, dh as buildEntityStorageQuickSearchFilter, di as buildWorkflowInstanceCartableDemoRows, dj as bypassAllFilters, dk as bypassOwnershipFilter, dl as bypassVisibilityFilter, dm as calendarEventMock, dn as calendarEventTypeMockData, dp as calendarMock, dq as chatMessageMock, dr as chatMock, ds as checkboxInterface, dt as childCountMiddleware, du as clearEntityDefinitionFirestoreCollections, dv as colorInterface, dw as computeDiff, dx as contactInterface, dy as conversationDemoSeedUserIds, dz as createFileCastMiddleware, dA as createWidgetLayoutConfig, dB as createWorkflowDefinitionEntityMock, dC as dateInterface, dD as dateTimeInterface, dE as descriptionInterface, dF as documentFolderSyncMiddleware, dG as emailInterface, dH as enrichWorkflowGraph, dI as entityDefDb, dJ as entityValidationMiddleware, dK as finalizeActivityCategoryItemCounts, dL as findEmployeeById, dM as folderStorageMiddleware, dN as groupOrderItemCalculatorMiddleware, dO as historyMiddleware, dP as identifierCommitMiddleware, dQ as imageInterface, dR as inspectionOkXNaInterface, dS as loadMockPropertyDefinitions, dT as lockGuardMiddleware, dU as longTextAnswerInterface, dV as lookupInterface, dW as lookupResolverMiddleware, dX as mapInterface, dY as meetingFilesMock, dZ as meetingIds, d_ as meetingMock, d$ as meetingParticipantMock, e0 as meetingRoleTypeMock, e1 as meetingSessionMock, e2 as meetingTimeSlotMock, e3 as meetingTypeFileTemplateMock, e4 as meetingTypeMock, e5 as mergeDetailRelationMiddleware, e6 as mergeQuickSearchIntoRequest, e7 as metadataCategoryMocks, e8 as mockParticipantIndexForSecurityUserId, e9 as mockQuestionBankItemByName, ea as mockRoleDefinitions, m as mockUsers, eb as multipleChoiceInterface, ec as multipleSelectInterface, ed as normalizeAnyFileArrayForView, ee as normalizeSnapshotFileFieldsForView, ef as numberInterface, eg as parseEntityStorageInsertData, eh as parseEntityStorageQueryRequest, ei as participantIds, ej as participantMock, ek as passwordInterface, el as personIdentifierTypeMock, em as personIds, en as personLegalIds, eo as personMock, ep as personNaturalIds, eq as phoneInterface, er as primaryMiddleware, es as provideMockPropertySetups, et as qrcodeInterface, eu as questionBankItemMock, ev as questionnaireMock, ew as ratingInterface, ex as richTextInterface, ey as scaleInterface, ez as selectInterface, eA as selectionListInterface, eB as sexAtBirthInterface, eC as signatureInterface, eD as statusDefaultMiddleware, eE as tagInterface, eF as tenantMocks, eG as textAreaInterface, eH as textInterface, eI as timeDurationInterface, eJ as titleInterface, eK as toUiRows, eL as toggleInterface, eM as tokenCategoryIds, eN as tokenCategoryMocks, eO as urlInterface, eP as versionInterface, eQ as visibilityFilterMiddleware, eR as workflowDefinitionEntityMock, eS as workflowDefinitionIds, eT as workflowDefinitionMock, eU as yesNoInterface } from './acorex-connectivity-mock-acorex-connectivity-mock-DXJDJBvf.mjs';
|
|
1
|
+
export { f as ACTIVITY_CATEGORIES, g as ACTIVITY_CATEGORY_ID_BY_KEY, h as ACTIVITY_DEFINITIONS, i as AI_ASSIST_MOCK, j as AI_MODEL_MOCK, k as APPLICATIONS, l as APPLICATION_CATEGORY_IDS, n as APPLICATION_CATEGORY_MOCKS, o as AXCActivityCategorySeeder, p as AXCActivityDefinitionSeeder, q as AXCAiAssistSeeder, s as AXCAiManagementMockModule, t as AXCAiModelSeeder, u as AXCAppTermDataSeeder, v as AXCAppVersionDataSeeder, w as AXCApplicationCategoryDataSeeder, x as AXCApplicationDataSeeder, y as AXCApplicationManagementMockModule, z as AXCAssessmentManagementMockModule, B as AXCAssetManagementMockModule, C as AXCAuthMockModule, D as AXCCalendarDataSeeder, E as AXCCalendarManagementMockModule, F as AXCCalendarOccasionDataSeeder, G as AXCCommandRegistryDataSeeder, H as AXCCommonMockModule, I as AXCContactCoreMockModule, J as AXCContentManagementMockModule, K as AXCConversationDataSeeder, L as AXCConversationMockConversationApi, M as AXCConversationMockMessageApi, N as AXCConversationMockModule, P as AXCConversationMockRealtimeApi, Q as AXCConversationMockUploaderService, R as AXCConversationMockUserApi, S as AXCCustomerManagementMockModule, T as AXCDashboardManagementMockModule, U as AXCDataManagementMockModule, V as AXCDexieEntityStorageService, W as AXCDocumentManagementMockModule, X as AXCEditionDataSeeder, Y as AXCEntityDefinitionSeederService, Z as AXCEntityDefinitionsModule, _ as AXCEntityStorageInsertCommand, $ as AXCEntityStorageModule, a0 as AXCEntityStorageQueryQuery, a1 as AXCFileStorageServiceDexie, a2 as AXCFileStorageServiceFirestore, a3 as AXCFinancialCoreMockModule, a4 as AXCFirestoreEntityStorageService, a5 as AXCFormTemplateManagementMockModule, a6 as AXCGoogleStrategyMock, a7 as AXCHealthCoreMockModule, a8 as AXCHelpDeskMockModule, a9 as AXCHumanCapitalManagementMockModule, aa as AXCIdentifierManagementMockModule, ab as AXCImageCaptchaChallengeProviderMock, ac as AXCLearningManagementMockModule, ad as AXCLocaleManagementMockModule, ae as AXCLocationManagementMockModule, af as AXCLockService, ag as AXCMeasurementCoreMockModule, ah as AXCMeetingManagementMockModule, ai as AXCMetaDataDefinitionDataSeeder, aj as AXCMetadataCategorySeeder, ak as AXCMiddlewaresModule, al as AXCMockCaptchaChallengeComponent, am as AXCMockEntityLogListener, an as AXCMockModule, ao as AXCMockShowMetaDataFormPopupCommand, ap as AXCNotificationManagementMockModule, aq as AXCOrderManagementMockModule, ar as AXCOrganizationManagementMockModule, as as AXCPersonCoreMockModule, at as AXCPlatformManagementMockModule, au as AXCProcurementManagementMockModule, av as AXCProductCatalogMockModule, aw as AXCProjectManagementMockModule, ax as AXCQueryRegistryDataSeeder, ay as AXCReportManagementMockModule, az as AXCSecurityManagementMockModule, aA as AXCStoredEntityDefinitionLoader, aB as AXCSubscriptionManagementMockModule, aC as AXCSupplierManagementMockModule, aD as AXCTaskManagementMockModule, aE as AXCTenantManagementMockModule, aF as AXCTenantSeeder, aG as AXCTextTemplateRenderBackend, aH as AXCTokensDataSeeder, aI as AXCUserPassStrategyMock, aJ as AXCVersionDB, aK as AXCVersioningService, aL as AXCWidgetCatalogDataSeeder, aM as AXCWorkflowCategorySeeder, aN as AXCWorkflowDefinitionDataSeeder, aO as AXCWorkflowEngine, aP as AXCWorkflowExecutionDB, aQ as AXCWorkflowExecutionStoreDexie, aR as AXCWorkflowExecutionStoreFirestore, aS as AXCWorkflowInstanceCartableDemoSeeder, aT as AXCWorkflowManagementMockModule, aU as AXC_ENTITY_STORAGE_BACKEND_TYPE, aV as AXC_FIRESTORE_CONFIG, aW as AXC_FIRESTORE_DB, aX as AXC_WORKFLOW_EXECUTION_STORE, aY as AXMAiDemisAssistAgentUuid, aZ as AXMAiDemisAssistId, a_ as AXMAiDemisGeneralAssistId, a as AXMAiModelStableIds, a$ as AXMAiPlatformAssistantAssistId, b0 as AXMAutomationDataSeeder, b1 as AXMBusinessUnitDataSeeder, b2 as AXMCalendarOccasionTypeSeeder, b3 as AXMDashboardChartDataSourceDefinition, b4 as AXMEmployeeDataSeeder, b5 as AXMEmploymentTypeDataSeeder, b6 as AXMFormDataSourcesProvider, b7 as AXMJobDefinitionDataSeeder, b8 as AXMJobLevelDataSeeder, b9 as AXMLeaveRequestDataSeeder, ba as AXMMeetingDataSeeder, bb as AXMMeetingFilesDataSeeder, bc as AXMMeetingParticipantDataSeeder, bd as AXMMeetingRoleTypeDataSeeder, be as AXMMeetingSessionDataSeeder, bf as AXMMeetingTypeDataSeeder, bg as AXMMeetingTypeFileTemplateDataSeeder, bh as AXMPositionAssignmentDataSeeder, bi as AXMPositionDataSeeder, bj as AXMQuestionBankItemCategoryDataSeeder, bk as AXMQuestionBankItemDataSeeder, bl as AXMQuestionnaireCategoryDataSeeder, bm as AXMQuestionnaireDataSeeder, bn as AXMResponsibilityDataSeeder, bo as AXMTagDataSeeder, bp as AXMTeamBusinessUnitDataSeeder, bq as AXMTeamDataSeeder, br as AXMTeamMemberDataSeeder, bs as AXMTeamMemberRoleDataSeeder, bt as AXMWorkflowDashboardChartDataSourceDefinition, bu as AXM_AI_REGISTRY_COMMAND_NAME, bv as AXM_AI_REGISTRY_QUERY_NAME, bw as AXM_CORPORATE_BUSINESS_UNIT_ID, bx as AXPDashboardDataSeeder, by as AXPIdentifierDB, bz as AXPMessageDataSeeder, bA as AXPMockChecksumProvider, bB as AXPMockClockProvider, bC as AXPMockIdentifierService, bD as AXPMockLookupProvider, bE as AXPMockPolicyProvider, bF as AXPMockSequenceProvider, bG as AXPRoomDataSeeder, bH as AXPSecurityManagementRoleDataSeeder, bI as AXPSecurityManagementUserDataSeeder, bJ as AXPTaskBoardPlatformManagementTaskProvider, bK as AXPTaskBoardProjectManagementTaskProvider, bL as AXVChangeType, bM as BCC, bN as BOC, bO as BUSINESS_UNITS_MOCK, bP as CHAT_LAST_MESSAGE_IDS, bQ as COLLABORATION_STANDARD, bR as COSTMANAGER_ENTERPRISE, bS as COSTMANAGER_PROFESSIONAL, bT as COSTMANAGER_STANDARD, bU as CP, bV as CRM_ENTERPRISE, bW as DASHBOARDS, bX as EDITIONS, bY as EMPLOYEES_MOCK, bZ as EMPLOYMENT_TYPES_MOCK, b_ as ENTITY_DEFINITION_MAP, b$ as ENTITY_REGISTRY, c0 as FINANCE_BASIC, c1 as FINANCE_ENTERPRISE, c2 as FINANCE_PRO, c3 as G, c4 as HR_ENTERPRISE, c5 as HW, c6 as JOB_DEFINITIONS_CATEGORY_MOCK, c7 as JOB_DEFINITIONS_MOCK, c8 as JOB_DEFINITION_CATEGORY_KEY_TO_ID, c9 as JOB_LEVELS_MOCK, ca as LASER_PLUMBING_TENANT_ID, cb as LEAVE_REQUESTS_MOCK, cc as MAGFA_COMMERCE_STANDARD, cd as MAGFA_CONVERSATION_DASHBOARD, ce as MAGFA_TENANT_ID, cf as METADATA_CATEGORY_IDS, cg as METADATA_GENERAL_CATEGORY_REFS, ch as METADATA_SYSTEM_CATEGORY_REFS, ci as MLC, cj as MOCK_CALENDAR_AUSTRALIA_ID, ck as MOCK_CALENDAR_INTERNATIONAL_GREGORIAN_ID, cl as MOCK_CALENDAR_IRAN_PERSIAN_ID, cm as MOCK_CALENDAR_NEW_ZEALAND_ID, cn as OHR, co as ORDERING_BASIC, cp as ORDERING_ENTERPRISE, cq as ORDERING_STANDARD, cr as OWNERSHIP_FILTER_BYPASS, cs as PLATFORM_CONSOLE, ct as PLATFORM_TENANT_ID, cu as PM, cv as POSITIONS_CATEGORY_MOCK, cw as POSITIONS_MOCK, cx as POSITION_ASSIGNMENTS_MOCK, cy as QCP, cz as QGEN, cA as QHW, cB as QOHR, cC as QPM, cD as QTLE, cE as QUESTIONNAIRE_CATEGORY_MOCK, cF as QUESTION_BANK_ITEM_CATEGORY_MOCK, cG as QWS, cH as RESPONSIBILITIES_CATEGORY_MOCK, cI as RESPONSIBILITIES_MOCK, cJ as RESPONSIBILITY_CATEGORY_KEY_TO_ID, cK as SAFETYMINDER_BASIC, cL as SAFETYMINDER_ENTERPRISE, cM as SAFETYMINDER_PROFESSIONAL, cN as SHOP_BASIC, cO as SHOP_ENTERPRISE, cP as SHOP_PRO, cQ as TAGS_MOCK, cR as TASKS, cS as TASK_STATUSES, cT as TASK_TEMPLATES, cU as TASK_TYPES, cV as TEAMS_CATEGORY_MOCK, cW as TEAMS_MOCK, cX as TEAM_BUSINESS_UNITS_MOCK, cY as TEAM_CATEGORY_KEY_TO_ID, cZ as TEAM_MEMBERS_MOCK, c_ as TEAM_MEMBER_ROLES_MOCK, c$ as TIMEPLICITY_TENANT_ID, d0 as TLA, d1 as TOKENS, d2 as TPC, d3 as VISIBILITY_FILTER_BYPASS, d4 as WORKFLOW_CATEGORIES, d5 as WS, d6 as activityCategoryMocks, d7 as activityDefinitionEntityMock, d8 as applyEntityDefinitionFirestoreSnapshot, d9 as attachmentsInterface, da as automationCommandMiddleware, db as automationMock, dc as avatarInterface, dd as awaitConversationMockSharedStorage, de as axVersionDB, df as axWorkflowExecutionDB, dg as axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows, dh as axcPatchEmployeeActivePrimaryPositionRefsFromRows, di as axcPatchEmployeeManagerRefsFromRows, dj as axcResolveCommandRegistrySeedId, dk as axcResolveQueryRegistrySeedId, dl as axcResolveWidgetCatalogSeedId, dm as bankCategory, dn as buildEntityStorageQuickSearchFilter, dp as buildWorkflowInstanceCartableDemoRows, dq as bypassAllFilters, dr as bypassOwnershipFilter, ds as bypassVisibilityFilter, dt as calendarMock, du as calendarOccasionMock, dv as calendarOccasionSeedData, dw as calendarOccasionTypeMockData, dx as chatMessageMock, dy as chatMock, dz as checkboxInterface, dA as childCountMiddleware, dB as clearEntityDefinitionFirestoreCollections, dC as colorInterface, dD as computeDiff, dE as contactInterface, dF as conversationDemoSeedUserIds, dG as createFileCastMiddleware, dH as createWidgetLayoutConfig, dI as createWorkflowDefinitionEntityMock, dJ as dateInterface, dK as dateTimeInterface, dL as descriptionInterface, dM as documentFolderSyncMiddleware, dN as emailInterface, dO as enrichCalendarOccasionForStorage, dP as enrichWorkflowGraph, dQ as entityDefDb, dR as entityValidationMiddleware, dS as finalizeActivityCategoryItemCounts, dT as findEmployeeById, dU as folderStorageMiddleware, dV as groupOrderItemCalculatorMiddleware, dW as historyMiddleware, dX as identifierCommitMiddleware, dY as imageInterface, dZ as inspectionOkXNaInterface, d_ as loadMockPropertyDefinitions, d$ as lockGuardMiddleware, e0 as longTextAnswerInterface, e1 as lookupInterface, e2 as lookupResolverMiddleware, e3 as mapInterface, e4 as meetingFilesMock, e5 as meetingIds, e6 as meetingMock, e7 as meetingParticipantMock, e8 as meetingRoleTypeMock, e9 as meetingSessionMock, ea as meetingTimeSlotMock, eb as meetingTypeFileTemplateMock, ec as meetingTypeMock, ed as mergeDetailRelationMiddleware, ee as mergeQuickSearchIntoRequest, ef as metadataCategoryMocks, eg as mockParticipantIndexForSecurityUserId, eh as mockQuestionBankItemByName, ei as mockRoleDefinitions, m as mockUsers, ej as multipleChoiceInterface, ek as multipleSelectInterface, el as normalizeAnyFileArrayForView, em as normalizeSnapshotFileFieldsForView, en as numberInterface, eo as parseEntityStorageInsertData, ep as parseEntityStorageQueryRequest, eq as participantIds, er as participantMock, es as passwordInterface, et as personIdentifierTypeMock, eu as personIds, ev as personLegalIds, ew as personMock, ex as personNaturalIds, ey as phoneInterface, ez as primaryMiddleware, eA as provideMockPropertySetups, eB as qrcodeInterface, eC as questionBankItemMock, eD as questionnaireMock, eE as ratingInterface, eF as registerConversationMockAfterHydration, eG as richTextInterface, eH as scaleInterface, eI as selectInterface, eJ as selectionListInterface, eK as sexAtBirthInterface, eL as signatureInterface, eM as statusDefaultMiddleware, eN as tagInterface, eO as tenantMocks, eP as textAreaInterface, eQ as textInterface, eR as timeDurationInterface, eS as titleInterface, eT as toUiRows, eU as toggleInterface, eV as tokenCategoryIds, eW as tokenCategoryMocks, eX as urlInterface, eY as versionInterface, eZ as visibilityFilterMiddleware, e_ as workflowDefinitionEntityMock, e$ as workflowDefinitionIds, f0 as workflowDefinitionMock, f1 as yesNoInterface } from './acorex-connectivity-mock-acorex-connectivity-mock-ChTgoKCp.mjs';
|
|
2
2
|
export { AXC_TEXT_TEMPLATE_RENDER_COMMAND_KEY } from '@acorex/modules/content-management';
|
|
3
3
|
//# sourceMappingURL=acorex-connectivity-mock.mjs.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/connectivity",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.72",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/modules": "21.0.0-next.
|
|
5
|
+
"@acorex/modules": "21.0.0-next.72"
|
|
6
6
|
},
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"module": "fesm2022/acorex-connectivity.mjs",
|