@acorex/connectivity 21.0.0-next.91 → 21.0.0-next.93
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-api.mjs.map +1 -1
- package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-B5bnzTKN.mjs → acorex-connectivity-mock-acorex-connectivity-mock-g0RVU1Og.mjs} +3962 -3636
- package/fesm2022/{acorex-connectivity-mock-acorex-connectivity-mock-B5bnzTKN.mjs.map → acorex-connectivity-mock-acorex-connectivity-mock-g0RVU1Og.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-assign-to-manager.activity-Dv7Jzdhf.mjs → acorex-connectivity-mock-assign-to-manager.activity-CTrrsAvF.mjs} +2 -2
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-CTrrsAvF.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-category-metadata-inheritance.query-CIof4zTg.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-category-with-items.query-DAKUJIIt.mjs.map +1 -1
- package/fesm2022/{acorex-connectivity-mock-chat-generate-image.command-C_1j3JPR.mjs → acorex-connectivity-mock-chat-generate-image.command-CSbgiZEm.mjs} +2 -3
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-CSbgiZEm.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-chat-synthesize-speech.command-0y5swsxw.mjs → acorex-connectivity-mock-chat-synthesize-speech.command-CjdySQzM.mjs} +2 -3
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-CjdySQzM.mjs.map +1 -0
- package/fesm2022/{acorex-connectivity-mock-chat-transcribe-speech.command-D59NedG-.mjs → acorex-connectivity-mock-chat-transcribe-speech.command-Wm1Ao81s.mjs} +2 -3
- package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-Wm1Ao81s.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-check-permission.activity-vr3OHtjC.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-distribution-record.activity-a1_k9Czb.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-entity-create.activity-CdoUzUvF.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-entity-delete.activity-ErEN1c24.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-entity-read.activity-1fJW8gVe.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-entity-update.activity-06HTKiQQ.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-extract-document-text.command-nGfUTSf6.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-application-versions-chart-data.query-DwVuYuKx.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-application-versions-timeline.query-sFKYynZA.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-current-session-user.activity-CsmxwXsM.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-current-user-manager.activity-C1mj2bgB.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-employee-list.query-BWbZj3tp.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-location-list.query-CQ2rFDUM.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-product-chart-data.query-D7DBzLT-.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-product-list.query-o9TcY_RC.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-product-pdf-data.query-DUZvwsmY.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-chart-data.query-BXDzY2Sd.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-subscriptions-timeline.query-D_jVT-7a.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-application-access.query-BG6t0137.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-chart-data.query-CgMZxfzh.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-registration-timeline.query-COmTsDCV.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-get-tenant-user-distribution.query-gqSqvIaa.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-if.activity-DvzuhItL.mjs.map +1 -1
- package/fesm2022/{acorex-connectivity-mock-jira-instance-sync.command-BYOuTU3R.mjs → acorex-connectivity-mock-jira-instance-sync.command-CaOd4PJa.mjs} +1 -2
- package/fesm2022/{acorex-connectivity-mock-jira-instance-sync.command-BYOuTU3R.mjs.map → acorex-connectivity-mock-jira-instance-sync.command-CaOd4PJa.mjs.map} +1 -1
- package/fesm2022/{acorex-connectivity-mock-notification-management-email-send.command-Df6E-9-c.mjs → acorex-connectivity-mock-notification-management-email-send.command-BuH_Lm6V.mjs} +1 -2
- package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-BuH_Lm6V.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock-sample.command-CJmDL4pL.mjs.map +1 -1
- package/fesm2022/acorex-connectivity-mock-structured-text-completion.command-l31pjl9-.mjs.map +1 -1
- package/fesm2022/{acorex-connectivity-mock-user-roles-for-list-column.query-DVuh_6NC.mjs → acorex-connectivity-mock-user-roles-for-list-column.query-wRFHOp-X.mjs} +2 -2
- package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-wRFHOp-X.mjs.map +1 -0
- package/fesm2022/acorex-connectivity-mock.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-connectivity-api.d.ts +1 -2
- package/types/acorex-connectivity-mock.d.ts +73 -56
- package/fesm2022/acorex-connectivity-mock-assign-to-manager.activity-Dv7Jzdhf.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-generate-image.command-C_1j3JPR.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-synthesize-speech.command-0y5swsxw.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-chat-transcribe-speech.command-D59NedG-.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-notification-management-email-send.command-Df6E-9-c.mjs.map +0 -1
- package/fesm2022/acorex-connectivity-mock-user-roles-for-list-column.query-DVuh_6NC.mjs.map +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { AXPAppStartUpService,
|
|
1
|
+
import { AXPAppStartUpService, AXPDataSourceDefinitionProvider, AXPDataSourceDefinition, AXPDistributedEventListenerProvider } from '@acorex/platform/core';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injector, Type, InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
4
4
|
import * as _acorex_platform_auth from '@acorex/platform/auth';
|
|
5
5
|
import { AXPAuthStrategy, AXPBaseCredentials, AXPSignInResult, AXPSessionContext, AXPLoginChallengeProvider, AXPChallengeCheckResult, AXPLoginChallengeData, AXPLoginChallengeComponentBase } from '@acorex/platform/auth';
|
|
6
6
|
import * as i1 from '@acorex/platform/runtime';
|
|
7
|
-
import { AXPCommand, AXPQuery } from '@acorex/platform/runtime';
|
|
8
7
|
import { Router } from '@angular/router';
|
|
9
8
|
import { AXMAuthConfigs } from '@acorex/modules/auth';
|
|
9
|
+
import { AXPCommand, AXPQuery } from '@acorex/platform/runtime-contracts';
|
|
10
10
|
import * as _acorex_platform_contracts from '@acorex/platform/contracts';
|
|
11
|
-
import { AXPExecuteCommandResult, AXPMultiLanguageString, AXPCategoryEntity, AXPCategorizedEntityDto, AXPCategoryListItem, AXPIntegrationSecretPayload, AXPIntegrationAuthContext, AXPIntegrationResolvedCredentials, AXPWorkflowInstance, AXPWorkflowDefinition, AXPWorkflowGraph, AXPActivityCategory, AXPActivityDefinition, createMultiLanguageString, AXPWorkflowCategory, AXPExecuteCommand, AXPFileStorageCreateRequest, AXPFileStorageInfo, AXPFileStorageUpdateRequest, AXPFileStorageFindRequest, AXPFileManyStorageInfo, AXPFileListItem } from '@acorex/platform/contracts';
|
|
11
|
+
import { AXPExecuteCommandResult, AXPQueryRequest, AXPMultiLanguageString, AXPCategoryEntity, AXPCategorizedEntityDto, AXPCategoryListItem, AXPIntegrationSecretPayload, AXPIntegrationAuthContext, AXPIntegrationResolvedCredentials, AXPWorkflowInstance, AXPWorkflowDefinition, AXPWorkflowGraph, AXPActivityCategory, AXPActivityDefinition, createMultiLanguageString, AXPWorkflowCategory, AXPExecuteCommand, AXPActionMenuItem, AXPFileStorageCreateRequest, AXPFileStorageInfo, AXPFileStorageUpdateRequest, AXPFileStorageFindRequest, AXPFileManyStorageInfo, AXPFileListItem } from '@acorex/platform/contracts';
|
|
12
12
|
import { AXPEntityAggregateRequest, AXPEntityQueryAllOptions, AXPEntityQueryAllResult, AXPEntityAggregateOptions, AXPEntityAggregateResult, AXPEntity, AXPRecordStateInfo, AXPMockDto } from '@acorex/platform/layout/entity-contracts';
|
|
13
13
|
import { AXDataSourceFilterOption } from '@acorex/cdk/common';
|
|
14
14
|
import { AXPEntityStorageService, AXPEntityDefinitionLoader, AXPDataSeeder, AXPEntityStorageMiddleware } from '@acorex/platform/layout/entity';
|
|
@@ -20,7 +20,7 @@ import { AXMApplicationManagementApplicationEntityModel, AXMApplicationManagemen
|
|
|
20
20
|
import { PreQuestionnaireConfig, PostQuestionnaireConfig, QuestionnaireEntityDisplaySettings, QuestionnaireOutcomesValue } from '@acorex/modules/assessment-management';
|
|
21
21
|
import { AXMTenantManagementTenantEntityModel } from '@acorex/modules/tenant-management';
|
|
22
22
|
import { AXMSecurityManagementRolesEntityModel, AXMSecurityManagementUsersEntityModel, AXMUserAccessState } from '@acorex/modules/security-management';
|
|
23
|
-
import { AXMOrganizationManagementBusinessUnitEntityModel,
|
|
23
|
+
import { AXMOrganizationManagementBusinessUnitEntityModel, AXMOrganizationManagementTeamEntityModel, AXMOrganizationManagementTeamBusinessUnitEntityModel, AXMOrganizationManagementTeamMemberRoleEntityModel, AXMOrganizationManagementTeamMemberEntityModel, AXMOrganizationManagementPositionEntityModel, AXMOrganizationManagementJobDefinitionEntityModel, AXMOrganizationManagementJobLevelEntityModel, AXMOrganizationManagementResponsibilityEntityModel } from '@acorex/modules/organization-management';
|
|
24
24
|
import { AXMHumanCapitalManagementEmploymentTypeEntityModel } from '@acorex/modules/human-capital-management';
|
|
25
25
|
import { AXPIntegrationSecretStore, AXPIntegrationSecretRefInput, AXPIntegrationOAuthService, AXPIntegrationOAuthStartInput, AXPIntegrationOAuthCompleteInput, AXPLockService, AXPLockRequest, AXPLockInfo, AXPUnLockRequest, AXPLockGetInfoRequest, AXPFileStorageService, AXPVersioningService, AXPVersionEntry as AXPVersionEntry$1, CanonicalChange as CanonicalChange$1, AXVChangeType as AXVChangeType$1 } from '@acorex/platform/common';
|
|
26
26
|
import { AXMPersonCorePersonEntityModel, AXMPersonCorePersonIdentifierTypeEntityModel } from '@acorex/modules/person-core';
|
|
@@ -158,6 +158,12 @@ declare class AXCIntegrationManagementMockModule {
|
|
|
158
158
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXCIntegrationManagementMockModule>;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
+
declare class AXCGitLabExtensionMockModule {
|
|
162
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXCGitLabExtensionMockModule, never>;
|
|
163
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXCGitLabExtensionMockModule, never, never, never>;
|
|
164
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXCGitLabExtensionMockModule>;
|
|
165
|
+
}
|
|
166
|
+
|
|
161
167
|
declare class AXCJiraManagementMockModule {
|
|
162
168
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXCJiraManagementMockModule, never>;
|
|
163
169
|
static ɵmod: i0.ɵɵNgModuleDeclaration<AXCJiraManagementMockModule, never, never, never>;
|
|
@@ -374,7 +380,7 @@ declare class AXCMiddlewaresModule {
|
|
|
374
380
|
declare class AXCMockModule {
|
|
375
381
|
constructor(appInitService: AXPAppStartUpService, injector: Injector);
|
|
376
382
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXCMockModule, never>;
|
|
377
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AXCMockModule, never, [typeof _acorex_platform_auth.AXPAuthModule, typeof AXCCommonMockModule, typeof AXCIdentifierManagementMockModule, typeof AXCSecurityManagementMockModule, typeof AXCFormTemplateManagementMockModule, typeof AXCBusinessCoreMockModule, typeof AXCCustomerManagementMockModule, typeof AXCSupplierManagementMockModule, typeof AXCProcurementManagementMockModule, typeof AXCOrderManagementMockModule, typeof AXCTenantManagementMockModule, typeof AXCSubscriptionManagementMockModule, typeof AXCLocationManagementMockModule, typeof AXCContactCoreMockModule, typeof AXCOrganizationManagementMockModule, typeof AXCAssessmentManagementMockModule, typeof AXCHumanCapitalManagementMockModule, typeof AXCAttendanceManagementMockModule, typeof AXCTimesheetManagementMockModule, typeof AXCIntegrationManagementMockModule, typeof AXCJiraManagementMockModule, typeof AXCReportManagementMockModule, typeof AXCLocaleManagementMockModule, typeof AXCDashboardManagementMockModule, typeof AXCConversationMockModule, typeof AXCAuthMockModule, typeof AXCAiManagementMockModule, typeof AXCPlatformManagementMockModule, typeof AXCApplicationManagementMockModule, typeof AXCLearningManagementMockModule, typeof AXCAssetManagementMockModule, typeof AXCProjectManagementMockModule, typeof AXCDocumentManagementMockModule, typeof AXCHelpDeskMockModule, typeof AXCCalendarManagementMockModule, typeof AXCDataManagementMockModule, typeof AXCWorkflowManagementMockModule, typeof AXCNotificationManagementMockModule, typeof AXCTaskManagementMockModule, typeof AXCPersonCoreMockModule, typeof AXCHealthCoreMockModule, typeof AXCContentManagementMockModule, typeof AXCMeetingManagementMockModule, typeof AXCSettingsManagementMockModule, typeof AXCFinancialCoreMockModule, typeof AXCMeasurementCoreMockModule, typeof AXCProductCatalogMockModule, typeof AXCReservationManagementMockModule, typeof AXCMaintenanceManagementMockModule, typeof AXCRiskManagementMockModule, typeof AXCWorkplaceSafetyManagementMockModule, typeof AXCMiddlewaresModule], never>;
|
|
383
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXCMockModule, never, [typeof _acorex_platform_auth.AXPAuthModule, typeof AXCCommonMockModule, typeof AXCIdentifierManagementMockModule, typeof AXCSecurityManagementMockModule, typeof AXCFormTemplateManagementMockModule, typeof AXCBusinessCoreMockModule, typeof AXCCustomerManagementMockModule, typeof AXCSupplierManagementMockModule, typeof AXCProcurementManagementMockModule, typeof AXCOrderManagementMockModule, typeof AXCTenantManagementMockModule, typeof AXCSubscriptionManagementMockModule, typeof AXCLocationManagementMockModule, typeof AXCContactCoreMockModule, typeof AXCOrganizationManagementMockModule, typeof AXCAssessmentManagementMockModule, typeof AXCHumanCapitalManagementMockModule, typeof AXCAttendanceManagementMockModule, typeof AXCTimesheetManagementMockModule, typeof AXCIntegrationManagementMockModule, typeof AXCGitLabExtensionMockModule, typeof AXCJiraManagementMockModule, typeof AXCReportManagementMockModule, typeof AXCLocaleManagementMockModule, typeof AXCDashboardManagementMockModule, typeof AXCConversationMockModule, typeof AXCAuthMockModule, typeof AXCAiManagementMockModule, typeof AXCPlatformManagementMockModule, typeof AXCApplicationManagementMockModule, typeof AXCLearningManagementMockModule, typeof AXCAssetManagementMockModule, typeof AXCProjectManagementMockModule, typeof AXCDocumentManagementMockModule, typeof AXCHelpDeskMockModule, typeof AXCCalendarManagementMockModule, typeof AXCDataManagementMockModule, typeof AXCWorkflowManagementMockModule, typeof AXCNotificationManagementMockModule, typeof AXCTaskManagementMockModule, typeof AXCPersonCoreMockModule, typeof AXCHealthCoreMockModule, typeof AXCContentManagementMockModule, typeof AXCMeetingManagementMockModule, typeof AXCSettingsManagementMockModule, typeof AXCFinancialCoreMockModule, typeof AXCMeasurementCoreMockModule, typeof AXCProductCatalogMockModule, typeof AXCReservationManagementMockModule, typeof AXCMaintenanceManagementMockModule, typeof AXCRiskManagementMockModule, typeof AXCWorkplaceSafetyManagementMockModule, typeof AXCMiddlewaresModule], never>;
|
|
378
384
|
static ɵinj: i0.ɵɵInjectorDeclaration<AXCMockModule>;
|
|
379
385
|
}
|
|
380
386
|
|
|
@@ -1568,64 +1574,18 @@ declare class AXMBusinessUnitDataSeeder implements AXPDataSeeder {
|
|
|
1568
1574
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMBusinessUnitDataSeeder>;
|
|
1569
1575
|
}
|
|
1570
1576
|
|
|
1571
|
-
interface
|
|
1572
|
-
jobLevels?: AXPCategoryListItem[];
|
|
1573
|
-
}
|
|
1574
|
-
/** English category keys → id (for parents after localized titles). */
|
|
1575
|
-
declare const JOB_DEFINITION_CATEGORY_KEY_TO_ID: Record<string, string>;
|
|
1576
|
-
declare const JOB_DEFINITIONS_CATEGORY_MOCK: AXPCategoryEntity<string>[];
|
|
1577
|
-
declare const JOB_DEFINITIONS_MOCK: AXMOrganizationManagementJobDefinitionMockModel[];
|
|
1578
|
-
|
|
1579
|
-
declare function findEmployeeById(employeeId: string): AXCEmployeeMockDto | undefined;
|
|
1580
|
-
interface AXCEmployeeMockDto {
|
|
1577
|
+
interface AXCEmployeeTeamSnapshot {
|
|
1581
1578
|
id: string;
|
|
1582
|
-
statusId: string;
|
|
1583
|
-
userId?: string;
|
|
1584
1579
|
personId: string;
|
|
1585
1580
|
person: {
|
|
1586
1581
|
id: string;
|
|
1587
1582
|
displayName: string;
|
|
1588
1583
|
fullName: string;
|
|
1589
1584
|
};
|
|
1590
|
-
birthDate: Date;
|
|
1591
1585
|
employeeCode: string;
|
|
1592
|
-
|
|
1593
|
-
jobDefinition: AXMOrganizationManagementJobDefinitionMockModel;
|
|
1594
|
-
employmentTypeId: string;
|
|
1595
|
-
employmentType: AXMHumanCapitalManagementEmploymentTypeEntityModel;
|
|
1596
|
-
hireDate: Date;
|
|
1597
|
-
managerId: string | null;
|
|
1598
|
-
manager: AXCEmployeeMockDto | null;
|
|
1599
|
-
activePrimaryPositionId?: string | null;
|
|
1600
|
-
activePrimaryPosition?: {
|
|
1601
|
-
id: string;
|
|
1602
|
-
title?: unknown;
|
|
1603
|
-
} | null;
|
|
1604
|
-
activePrimaryBusinessUnitId?: string | null;
|
|
1605
|
-
activePrimaryBusinessUnit?: {
|
|
1606
|
-
id: string;
|
|
1607
|
-
title?: unknown;
|
|
1608
|
-
} | null;
|
|
1609
|
-
imageId: string[];
|
|
1586
|
+
statusId: string;
|
|
1610
1587
|
}
|
|
1611
|
-
|
|
1612
|
-
/** Sync in-memory mock rows with `managerId` values (e.g. after storage reconciliation). */
|
|
1613
|
-
declare function axcPatchEmployeeManagerRefsFromRows(rows: {
|
|
1614
|
-
id: string;
|
|
1615
|
-
managerId?: string | null;
|
|
1616
|
-
}[]): void;
|
|
1617
|
-
/** Sync in-memory mock rows with `activePrimaryPositionId` / nested position (after storage reconciliation). */
|
|
1618
|
-
declare function axcPatchEmployeeActivePrimaryPositionRefsFromRows(rows: {
|
|
1619
|
-
id: string;
|
|
1620
|
-
activePrimaryPositionId?: string | null;
|
|
1621
|
-
}[]): void;
|
|
1622
|
-
/** Sync in-memory mock rows with `activePrimaryBusinessUnitId` / nested business unit (after storage reconciliation). */
|
|
1623
|
-
declare function axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows(rows: {
|
|
1624
|
-
id: string;
|
|
1625
|
-
activePrimaryBusinessUnitId?: string | null;
|
|
1626
|
-
}[]): void;
|
|
1627
|
-
|
|
1628
|
-
type AXCEmployeeMock$1 = (typeof EMPLOYEES_MOCK)[number];
|
|
1588
|
+
type AXCEmployeeMock$1 = AXCEmployeeTeamSnapshot;
|
|
1629
1589
|
interface AXMOrganizationManagementTeamMockModel extends AXMOrganizationManagementTeamEntityModel {
|
|
1630
1590
|
leaderId: string;
|
|
1631
1591
|
leader: AXCEmployeeMock$1;
|
|
@@ -1671,7 +1631,7 @@ declare class AXMTeamMemberRoleDataSeeder implements AXPDataSeeder {
|
|
|
1671
1631
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMTeamMemberRoleDataSeeder>;
|
|
1672
1632
|
}
|
|
1673
1633
|
|
|
1674
|
-
type AXCEmployeeMock =
|
|
1634
|
+
type AXCEmployeeMock = AXCEmployeeTeamSnapshot;
|
|
1675
1635
|
type AXCTeamMock = (typeof TEAMS_MOCK)[number];
|
|
1676
1636
|
type AXCTeamMemberRoleMock = (typeof TEAM_MEMBER_ROLES_MOCK)[number];
|
|
1677
1637
|
interface AXMOrganizationManagementTeamMemberMockModel extends AXMOrganizationManagementTeamMemberEntityModel {
|
|
@@ -1705,6 +1665,14 @@ declare class AXMPositionDataSeeder implements AXPDataSeeder {
|
|
|
1705
1665
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMPositionDataSeeder>;
|
|
1706
1666
|
}
|
|
1707
1667
|
|
|
1668
|
+
interface AXMOrganizationManagementJobDefinitionMockModel extends AXMOrganizationManagementJobDefinitionEntityModel {
|
|
1669
|
+
jobLevels?: AXPCategoryListItem[];
|
|
1670
|
+
}
|
|
1671
|
+
/** English category keys → id (for parents after localized titles). */
|
|
1672
|
+
declare const JOB_DEFINITION_CATEGORY_KEY_TO_ID: Record<string, string>;
|
|
1673
|
+
declare const JOB_DEFINITIONS_CATEGORY_MOCK: AXPCategoryEntity<string>[];
|
|
1674
|
+
declare const JOB_DEFINITIONS_MOCK: AXMOrganizationManagementJobDefinitionMockModel[];
|
|
1675
|
+
|
|
1708
1676
|
declare class AXMJobDefinitionDataSeeder implements AXPDataSeeder {
|
|
1709
1677
|
private storageService;
|
|
1710
1678
|
seed(): Promise<void>;
|
|
@@ -1745,6 +1713,55 @@ declare class AXMResponsibilityDataSeeder implements AXPDataSeeder {
|
|
|
1745
1713
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXMResponsibilityDataSeeder>;
|
|
1746
1714
|
}
|
|
1747
1715
|
|
|
1716
|
+
declare function findEmployeeById(employeeId: string): AXCEmployeeMockDto | undefined;
|
|
1717
|
+
interface AXCEmployeeMockDto {
|
|
1718
|
+
id: string;
|
|
1719
|
+
statusId: string;
|
|
1720
|
+
userId?: string;
|
|
1721
|
+
personId: string;
|
|
1722
|
+
person: {
|
|
1723
|
+
id: string;
|
|
1724
|
+
displayName: string;
|
|
1725
|
+
fullName: string;
|
|
1726
|
+
};
|
|
1727
|
+
birthDate: Date;
|
|
1728
|
+
employeeCode: string;
|
|
1729
|
+
jobDefinitionId: string;
|
|
1730
|
+
jobDefinition: AXMOrganizationManagementJobDefinitionMockModel;
|
|
1731
|
+
employmentTypeId: string;
|
|
1732
|
+
employmentType: AXMHumanCapitalManagementEmploymentTypeEntityModel;
|
|
1733
|
+
hireDate: Date;
|
|
1734
|
+
managerId: string | null;
|
|
1735
|
+
manager: AXCEmployeeMockDto | null;
|
|
1736
|
+
activePrimaryPositionId?: string | null;
|
|
1737
|
+
activePrimaryPosition?: {
|
|
1738
|
+
id: string;
|
|
1739
|
+
title?: unknown;
|
|
1740
|
+
} | null;
|
|
1741
|
+
activePrimaryBusinessUnitId?: string | null;
|
|
1742
|
+
activePrimaryBusinessUnit?: {
|
|
1743
|
+
id: string;
|
|
1744
|
+
title?: unknown;
|
|
1745
|
+
} | null;
|
|
1746
|
+
imageId: string[];
|
|
1747
|
+
}
|
|
1748
|
+
declare const EMPLOYEES_MOCK: AXCEmployeeMockDto[];
|
|
1749
|
+
/** Sync in-memory mock rows with `managerId` values (e.g. after storage reconciliation). */
|
|
1750
|
+
declare function axcPatchEmployeeManagerRefsFromRows(rows: {
|
|
1751
|
+
id: string;
|
|
1752
|
+
managerId?: string | null;
|
|
1753
|
+
}[]): void;
|
|
1754
|
+
/** Sync in-memory mock rows with `activePrimaryPositionId` / nested position (after storage reconciliation). */
|
|
1755
|
+
declare function axcPatchEmployeeActivePrimaryPositionRefsFromRows(rows: {
|
|
1756
|
+
id: string;
|
|
1757
|
+
activePrimaryPositionId?: string | null;
|
|
1758
|
+
}[]): void;
|
|
1759
|
+
/** Sync in-memory mock rows with `activePrimaryBusinessUnitId` / nested business unit (after storage reconciliation). */
|
|
1760
|
+
declare function axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows(rows: {
|
|
1761
|
+
id: string;
|
|
1762
|
+
activePrimaryBusinessUnitId?: string | null;
|
|
1763
|
+
}[]): void;
|
|
1764
|
+
|
|
1748
1765
|
declare class AXMEmployeeDataSeeder implements AXPDataSeeder {
|
|
1749
1766
|
private storageService;
|
|
1750
1767
|
seed(): Promise<void>;
|
|
@@ -4116,4 +4133,4 @@ declare function bypassAllFilters<T extends AXPQueryRequest>(request: T): T;
|
|
|
4116
4133
|
declare const AXCMockEntityLogListener: AXPDistributedEventListenerProvider<any>;
|
|
4117
4134
|
|
|
4118
4135
|
export { ACTIVITY_CATEGORIES, ACTIVITY_CATEGORY_ID_BY_KEY, ACTIVITY_DEFINITIONS, AI_ASSIST_MOCK, AI_MODEL_MOCK, APPLICATIONS, APPLICATION_CATEGORY_IDS, APPLICATION_CATEGORY_MOCKS, AXCActivityCategorySeeder, AXCActivityDefinitionSeeder, AXCAiAssistSeeder, AXCAiManagementMockModule, AXCAiModelSeeder, AXCAppTermDataSeeder, AXCAppVersionDataSeeder, AXCApplicationCategoryDataSeeder, AXCApplicationDataSeeder, AXCApplicationManagementMockModule, AXCAssessmentManagementMockModule, AXCAssetManagementMockModule, AXCAuthMockModule, AXCCalendarDataSeeder, AXCCalendarManagementMockModule, AXCCalendarOccasionDataSeeder, AXCCommandRegistryDataSeeder, AXCCommonMockModule, AXCContactCoreMockModule, AXCContentManagementMockModule, AXCConversationMockModule, AXCConversationMockUploaderService, AXCCustomerManagementMockModule, AXCDashboardManagementMockModule, AXCDataManagementMockModule, AXCDexieEntityStorageService, AXCDocumentManagementMockModule, AXCEditionDataSeeder, AXCEntityDefinitionSeederService, AXCEntityDefinitionsModule, AXCEntityStorageInsertCommand, AXCEntityStorageModule, AXCEntityStorageQueryQuery, AXCFileStorageServiceDexie, AXCFileStorageServiceFirestore, AXCFinancialCoreMockModule, AXCFirestoreEntityStorageService, AXCFormTemplateManagementMockModule, AXCGoogleStrategyMock, AXCHealthCoreMockModule, AXCHelpDeskMockModule, AXCHumanCapitalManagementMockModule, AXCIdentifierManagementMockModule, AXCImageCaptchaChallengeProviderMock, AXCIntegrationLifecycleEventsService, AXCIntegrationManagementMockModule, AXCIntegrationOAuthMockService, AXCIntegrationSecretStoreMock, AXCIntegrationTokenRefreshService, AXCJiraManagementMockModule, AXCLearningManagementMockModule, AXCLocaleManagementMockModule, AXCLocationManagementMockModule, AXCLockService, AXCMeasurementCoreMockModule, AXCMeetingManagementMockModule, AXCMetaDataDefinitionDataSeeder, AXCMetadataCategorySeeder, AXCMiddlewaresModule, AXCMockCaptchaChallengeComponent, AXCMockEntityLogListener, AXCMockModule, AXCMockShowMetaDataFormPopupCommand, AXCNotificationManagementMockModule, AXCOrderManagementMockModule, AXCOrganizationManagementMockModule, AXCPersonCoreMockModule, AXCPlatformManagementMockModule, AXCProcurementManagementMockModule, AXCProductCatalogMockModule, AXCProjectManagementMockModule, AXCQueryRegistryDataSeeder, AXCReportManagementMockModule, AXCSecurityManagementMockModule, AXCStoredEntityDefinitionLoader, AXCSubscriptionManagementMockModule, AXCSupplierManagementMockModule, AXCTaskManagementMockModule, AXCTenantManagementMockModule, AXCTenantSeeder, AXCTextTemplateRenderBackend, AXCTokensDataSeeder, AXCUserPassStrategyMock, AXCVersionDB, AXCVersioningService, AXCWidgetCatalogDataSeeder, AXCWorkflowCategorySeeder, AXCWorkflowDefinitionDataSeeder, AXCWorkflowEngine, AXCWorkflowExecutionDB, AXCWorkflowExecutionStoreDexie, AXCWorkflowExecutionStoreFirestore, AXCWorkflowInstanceCartableDemoSeeder, AXCWorkflowManagementMockModule, AXC_ENTITY_STORAGE_BACKEND_TYPE, AXC_FIRESTORE_CONFIG, AXC_FIRESTORE_DB, AXC_WORKFLOW_EXECUTION_STORE, AXMAiDemisAssistAgentUuid, AXMAiDemisAssistId, AXMAiDemisGeneralAssistId, AXMAiModelStableIds, AXMAiPlatformAssistantAssistId, AXMAutomationDataSeeder, AXMBusinessUnitDataSeeder, AXMCalendarOccasionTypeSeeder, AXMDashboardChartDataSourceDefinition, AXMEmployeeDataSeeder, AXMEmploymentTypeDataSeeder, AXMFormDataSourcesProvider, AXMJiraManagementMockIds, AXMJobDefinitionDataSeeder, AXMJobLevelDataSeeder, AXMLeaveRequestDataSeeder, AXMMeetingDataSeeder, AXMMeetingFilesDataSeeder, AXMMeetingParticipantDataSeeder, AXMMeetingRoleTypeDataSeeder, AXMMeetingSessionDataSeeder, AXMMeetingTypeDataSeeder, AXMMeetingTypeFileTemplateDataSeeder, AXMPositionAssignmentDataSeeder, AXMPositionDataSeeder, AXMQuestionBankItemCategoryDataSeeder, AXMQuestionBankItemDataSeeder, AXMQuestionnaireCategoryDataSeeder, AXMQuestionnaireDataSeeder, AXMResponsibilityDataSeeder, AXMTagDataSeeder, AXMTeamBusinessUnitDataSeeder, AXMTeamDataSeeder, AXMTeamMemberDataSeeder, AXMTeamMemberRoleDataSeeder, AXMWorkflowDashboardChartDataSourceDefinition, AXM_AI_REGISTRY_COMMAND_NAME, AXM_AI_REGISTRY_QUERY_NAME, AXM_CORPORATE_BUSINESS_UNIT_ID, AXPDashboardDataSeeder, AXPIdentifierDB, AXPMessageDataSeeder, AXPMockChecksumProvider, AXPMockClockProvider, AXPMockIdentifierService, AXPMockLookupProvider, AXPMockPolicyProvider, AXPMockSequenceProvider, AXPRoomDataSeeder, AXPSecurityManagementRoleDataSeeder, AXPSecurityManagementUserDataSeeder, AXPTaskBoardPlatformManagementTaskProvider, AXVChangeType, BCC, BOC, BUSINESS_UNITS_MOCK, COLLABORATION_STANDARD, CP, DASHBOARDS, EDITIONS, EMPLOYEES_MOCK, EMPLOYMENT_TYPES_MOCK, ENTITY_DEFINITION_MAP, ENTITY_REGISTRY, G, HR_ENTERPRISE, HW, JOB_DEFINITIONS_CATEGORY_MOCK, JOB_DEFINITIONS_MOCK, JOB_DEFINITION_CATEGORY_KEY_TO_ID, JOB_LEVELS_MOCK, LASER_PLUMBING_TENANT_ID, LEAVE_REQUESTS_MOCK, MAGFA_COMMERCE_STANDARD, MAGFA_CONVERSATION_DASHBOARD, MAGFA_TENANT_ID, METADATA_CATEGORY_IDS, METADATA_GENERAL_CATEGORY_REFS, METADATA_SYSTEM_CATEGORY_REFS, MLC, MOCK_CALENDAR_AUSTRALIA_ID, MOCK_CALENDAR_INTERNATIONAL_GREGORIAN_ID, MOCK_CALENDAR_IRAN_PERSIAN_ID, MOCK_CALENDAR_NEW_ZEALAND_ID, MOCK_DATA_SEED_VERSION, MOCK_ENTITY_SEED_META_KEY, OHR, OWNERSHIP_FILTER_BYPASS, PLATFORM_CONSOLE, PLATFORM_TENANT_ID, PM, POSITIONS_CATEGORY_MOCK, POSITIONS_MOCK, POSITION_ASSIGNMENTS_MOCK, QCP, QGEN, QHW, QOHR, QPM, QTLE, QUESTIONNAIRE_CATEGORY_MOCK, QUESTION_BANK_ITEM_CATEGORY_MOCK, QWS, RESPONSIBILITIES_CATEGORY_MOCK, RESPONSIBILITIES_MOCK, RESPONSIBILITY_CATEGORY_KEY_TO_ID, SAFETYMINDER_BASIC, SAFETYMINDER_ENTERPRISE, SAFETYMINDER_PROFESSIONAL, TAGS_MOCK, TASKS, TASK_STATUSES, TASK_TEMPLATES, TASK_TYPES, TEAMS_CATEGORY_MOCK, TEAMS_MOCK, TEAM_BUSINESS_UNITS_MOCK, TEAM_CATEGORY_KEY_TO_ID, TEAM_MEMBERS_MOCK, TEAM_MEMBER_ROLES_MOCK, TIMEPLICITY_TENANT_ID, TLA, TOKENS, TPC, VISIBILITY_FILTER_BYPASS, WORKFLOW_CATEGORIES, WS, activityCategoryMocks, activityDefinitionEntityMock, applyEntityDefinitionFirestoreSnapshot, attachmentsInterface, automationCommandMiddleware, automationMock, avatarInterface, axVersionDB, axWorkflowExecutionDB, axcPatchEmployeeActivePrimaryBusinessUnitRefsFromRows, axcPatchEmployeeActivePrimaryPositionRefsFromRows, axcPatchEmployeeManagerRefsFromRows, axcResolveCommandRegistrySeedId, axcResolveQueryRegistrySeedId, axcResolveWidgetCatalogSeedId, bankCategory, buildEntityStorageQuickSearchFilter, buildWorkflowInstanceCartableDemoRows, bypassAllFilters, bypassOwnershipFilter, bypassVisibilityFilter, calendarMock, calendarOccasionMock, calendarOccasionSeedData, calendarOccasionTypeMockData, checkboxInterface, childCountMiddleware, clearEntityDefinitionFirestoreCollections, colorInterface, computeDiff, contactInterface, createFileCastMiddleware, createWidgetLayoutConfig, createWorkflowDefinitionEntityMock, dateInterface, dateTimeInterface, descriptionInterface, documentFolderSyncMiddleware, emailInterface, enrichCalendarOccasionForStorage, enrichWorkflowGraph, entityDefDb, entityValidationMiddleware, finalizeActivityCategoryItemCounts, findEmployeeById, folderStorageMiddleware, groupOrderItemCalculatorMiddleware, historyMiddleware, identifierCommitMiddleware, imageInterface, inspectionOkXNaInterface, loadMockPropertyDefinitions, lockGuardMiddleware, longTextAnswerInterface, lookupInterface, lookupResolverMiddleware, mapInterface, meetingFilesMock, meetingIds, meetingMock, meetingParticipantMock, meetingRoleTypeMock, meetingSessionMock, meetingTimeSlotMock, meetingTypeFileTemplateMock, meetingTypeMock, mergeDetailRelationMiddleware, mergeQuickSearchIntoRequest, metadataCategoryMocks, mockQuestionBankItemByName, mockRoleDefinitions, mockUsers, multipleChoiceInterface, multipleSelectInterface, normalizeAnyFileArrayForView, normalizeSnapshotFileFieldsForView, numberInterface, parseEntityStorageInsertData, parseEntityStorageQueryRequest, participantIds, passwordInterface, personIdentifierTypeMock, personIds, personLegalIds, personMock, personNaturalIds, phoneInterface, primaryMiddleware, provideMockPropertySetups, qrcodeInterface, questionBankItemMock, questionnaireMock, ratingInterface, richTextInterface, scaleInterface, selectInterface, selectionListInterface, sexAtBirthInterface, signatureInterface, statusDefaultMiddleware, tagInterface, tenantMocks, textAreaInterface, textInterface, timeDurationInterface, titleInterface, toUiRows, toggleInterface, tokenCategoryIds, tokenCategoryMocks, urlInterface, versionInterface, visibilityFilterMiddleware, workflowDefinitionEntityMock, workflowDefinitionIds, workflowDefinitionMock, yesNoInterface };
|
|
4119
|
-
export type { AXCBookmarkEntity, AXCEntityStorageBackendType, AXCEntityStorageInsertInput, AXCEntityStorageInsertOutput, AXCEntityStorageQueryInput, AXCEntityStorageQueryResult, AXCFirestoreConfig, AXCLeaveRequestMockDto, AXCMockEntitySeedMeta, AXCPositionAssignmentMockDto, AXCWorkflowExecutionStore, AXMAiManagementAssistDemisMockMetadata, AXMAiManagementAssistMockModel, AXMAiManagementModelMockModel, AXMApplicationManagementApplicationCategoryMockModel, AXMOrganizationManagementBusinessUnitMockModel, AXMOrganizationManagementJobDefinitionMockModel, AXMOrganizationManagementJobLevelMockModel, AXMOrganizationManagementPositionMockModel, AXMOrganizationManagementResponsibilityMockModel, AXMOrganizationManagementTeamBusinessUnitMockModel, AXMOrganizationManagementTeamMemberMockModel, AXMOrganizationManagementTeamMemberRoleMockModel, AXMOrganizationManagementTeamMockModel, AXMTag, AXPLogRow, AXPRuleRow, AXPSeqRow, AXPTextTemplateRenderRequest, AXPTextTemplateRenderResult, AXPVersionChange, AXPVersionEntry, AXPVersionStream, AutomationCommandDto, AutomationMockDto, CanonicalChange, CanonicalChangeOp, CompleteOAuthMockInput, CreateWorkflowDefinitionEntityMockOptions, EntityDefinitionFirestoreSnapshotFile, FirestoreSnapshotOperation, IntegrationLifecycleEventPayload, MockUserPassCredentials, QuestionBankItemCategoryTitle, QuestionBankItemMockDto, QuestionnaireCategoryTitle, QuestionnaireMockDto, ShowMetaDataFormPopupMockInput, StartOAuthMockInput, Task, TaskStatus, TaskTemplate, TaskType, UIDiffRow, VersionedFileInfo, WorkflowInstanceEntityBookmark };
|
|
4136
|
+
export type { AXCBookmarkEntity, AXCEmployeeTeamSnapshot, AXCEntityStorageBackendType, AXCEntityStorageInsertInput, AXCEntityStorageInsertOutput, AXCEntityStorageQueryInput, AXCEntityStorageQueryResult, AXCFirestoreConfig, AXCLeaveRequestMockDto, AXCMockEntitySeedMeta, AXCPositionAssignmentMockDto, AXCWorkflowExecutionStore, AXMAiManagementAssistDemisMockMetadata, AXMAiManagementAssistMockModel, AXMAiManagementModelMockModel, AXMApplicationManagementApplicationCategoryMockModel, AXMOrganizationManagementBusinessUnitMockModel, AXMOrganizationManagementJobDefinitionMockModel, AXMOrganizationManagementJobLevelMockModel, AXMOrganizationManagementPositionMockModel, AXMOrganizationManagementResponsibilityMockModel, AXMOrganizationManagementTeamBusinessUnitMockModel, AXMOrganizationManagementTeamMemberMockModel, AXMOrganizationManagementTeamMemberRoleMockModel, AXMOrganizationManagementTeamMockModel, AXMTag, AXPLogRow, AXPRuleRow, AXPSeqRow, AXPTextTemplateRenderRequest, AXPTextTemplateRenderResult, AXPVersionChange, AXPVersionEntry, AXPVersionStream, AutomationCommandDto, AutomationMockDto, CanonicalChange, CanonicalChangeOp, CompleteOAuthMockInput, CreateWorkflowDefinitionEntityMockOptions, EntityDefinitionFirestoreSnapshotFile, FirestoreSnapshotOperation, IntegrationLifecycleEventPayload, MockUserPassCredentials, QuestionBankItemCategoryTitle, QuestionBankItemMockDto, QuestionnaireCategoryTitle, QuestionnaireMockDto, ShowMetaDataFormPopupMockInput, StartOAuthMockInput, Task, TaskStatus, TaskTemplate, TaskType, UIDiffRow, VersionedFileInfo, WorkflowInstanceEntityBookmark };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-assign-to-manager.activity-Dv7Jzdhf.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;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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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-chat-generate-image.command-C_1j3JPR.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,QAA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ACnD;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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-chat-synthesize-speech.command-0y5swsxw.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,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IAChF,MAAM,cAAc,GAClB,OAAO,GAAG,CAAC,gBAAgB,CAAC,KAAK,QAAQ,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,GAAG,SAAS;IACtF,OAAO;AACL,QAAA,EAAE,EAAE,IAAI;QACR,IAAI;AACJ,QAAA,IAAI,KAAK,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,C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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;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-chat-transcribe-speech.command-D59NedG-.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,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I,cAAc,GAAG,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC;AACvD,gBAAA,IAAI,QAAQ,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC;AAClC,aAAA,CAAC;YAEF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE;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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-notification-management-email-send.command-Df6E-9-c.mjs","sources":["../../../../libs/connectivity/mock/src/lib/notification-management/commands/notification-management-email-send.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPDataGenerator, AXPExecuteCommandResult } from '@acorex/platform/contracts';\nimport { AXPCommand } from '@acorex/platform/runtime';\nimport type {\n NotificationManagementEmailSendInput,\n NotificationManagementEmailSendResult,\n} from '@acorex/modules/notification-management';\nimport { AXToastService } from '@acorex/components/toast';\nimport { inject, Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Input parsing ----\n\nfunction parseSendInput(\n raw: unknown,\n): { ok: true; value: NotificationManagementEmailSendInput } | { ok: false; error: string } {\n const obj =\n raw != null && typeof raw === 'object' && !Array.isArray(raw) ? (raw as Record<string, unknown>) : null;\n if (!obj) {\n return { ok: false, error: 'Invalid arguments: expected an object.' };\n }\n const to = typeof obj['to'] === 'string' ? obj['to'].trim() : '';\n const subject = typeof obj['subject'] === 'string' ? obj['subject'].trim() : '';\n const body = typeof obj['body'] === 'string' ? obj['body'].trim() : '';\n if (!to) {\n return { ok: false, error: 'Invalid arguments: \"to\" is required.' };\n }\n if (!subject) {\n return { ok: false, error: 'Invalid arguments: \"subject\" is required.' };\n }\n if (!body) {\n return { ok: false, error: 'Invalid arguments: \"body\" is required.' };\n }\n const cc = typeof obj['cc'] === 'string' ? obj['cc'].trim() : '';\n const bcc = typeof obj['bcc'] === 'string' ? obj['bcc'].trim() : '';\n const tid = typeof obj['textTemplateId'] === 'string' ? obj['textTemplateId'].trim() : '';\n return {\n ok: true,\n value: {\n to,\n subject,\n body,\n ...(cc ? { cc } : {}),\n ...(bcc ? { bcc } : {}),\n ...(tid ? { textTemplateId: tid } : {}),\n },\n };\n}\n\n//#endregion\n\n//#region ---- Mock send command ----\n\nconst MOCK_SEND_LATENCY_MS = 120;\n\n@Injectable()\nexport class NotificationManagementEmailSendMockCommand\n implements AXPCommand<NotificationManagementEmailSendInput, NotificationManagementEmailSendResult> {\n private readonly toastService = inject(AXToastService);\n\n async execute(\n input: NotificationManagementEmailSendInput,\n ): Promise<AXPExecuteCommandResult<NotificationManagementEmailSendResult>> {\n await new Promise<void>((resolve) => setTimeout(resolve, MOCK_SEND_LATENCY_MS));\n const parsed = parseSendInput(input);\n if (!parsed.ok) {\n return { success: false, message: { text: parsed.error } };\n }\n // Mock transport: surface as UI toast only; replace with HTTP when backend exists.\n this.toastService.show({\n color: 'warning',\n title: 'Email send (simulation)',\n content: `No email was delivered — mock only.\\n To: ${parsed.value.to}.\\n Subject: ${parsed.value.subject}.`,\n });\n return {\n success: true,\n data: { messageId: AXPDataGenerator.uuid() },\n };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAAA;AAWA;AAEA;AAEA,SAAS,cAAc,CACrB,GAAY,EAAA;IAEZ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AA,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,CAAC,IAAI,EAAE,EAAE;SAC7C;IACH;8GAtBW,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1C,0CAA0C,EAAA,CAAA,CAAA;;2FAA1C,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBADtD;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-connectivity-mock-user-roles-for-list-column.query-DVuh_6NC.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;;;;;"}
|