@acorex-platform/extension-project-management-fergus-client 2.0.0-next.4 → 2.0.0-next.43
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-platform-extension-project-management-fergus-client-contracts.mjs +5 -0
- package/fesm2022/acorex-platform-extension-project-management-fergus-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-extension-project-management-fergus-client.mjs +66 -8
- package/fesm2022/acorex-platform-extension-project-management-fergus-client.mjs.map +1 -1
- package/i18n/en-AU/extensions-fergus.json +37 -0
- package/i18n/en-US/extensions-fergus.json +37 -0
- package/i18n/fa-IR/extensions-fergus.json +37 -0
- package/package.json +2 -2
- package/types/acorex-platform-extension-project-management-fergus-client-contracts.d.ts +43 -1
|
@@ -38,6 +38,8 @@ const AXEFergusCommandKeys = {
|
|
|
38
38
|
OAuthValidate: 'fergus-extension.OAuth:Validate',
|
|
39
39
|
ProjectImportFromFergus: 'fergus-extension.Project:ImportFromFergus',
|
|
40
40
|
CustomerImportFromFergus: 'fergus-extension.Customer:ImportFromFergus',
|
|
41
|
+
EmployeeSyncFromFergus: 'fergus-extension.Employee:SyncFromFergus',
|
|
42
|
+
EmployeeLinkFromFergus: 'fergus-extension.Employee:LinkFromFergus',
|
|
41
43
|
ProjectSync: 'fergus-extension.Project:Sync',
|
|
42
44
|
JobsPull: 'fergus-extension.Jobs:Pull',
|
|
43
45
|
JobsRefresh: 'fergus-extension.Jobs:Refresh',
|
|
@@ -92,6 +94,9 @@ const AXEFergusPermissions = {
|
|
|
92
94
|
CustomerImport: {
|
|
93
95
|
Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,
|
|
94
96
|
},
|
|
97
|
+
EmployeeImport: {
|
|
98
|
+
Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,
|
|
99
|
+
},
|
|
95
100
|
ProjectSync: {
|
|
96
101
|
Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,
|
|
97
102
|
},
|
package/fesm2022/acorex-platform-extension-project-management-fergus-client-contracts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-fergus-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/fergus/contracts/src/root-config.ts","../../../../libs/extensions/project-management/fergus/contracts/src/manifest.ts","../../../../libs/extensions/project-management/fergus/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/fergus.constants.ts","../../../../libs/extensions/project-management/fergus/contracts/src/acorex-platform-extension-project-management-fergus-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-fergus',\n};\n\nconst MODULE_NAME = 'FergusExtension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n title: `@${config.i18n}:integration.display-name`,\n icon: 'fa-light fa-briefcase',\n },\n};\n\n//#endregion\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-shared/core';\nimport { RootConfig } from './root-config';\n\nexport const FergusExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'project-management',\n dependencies: [],\n};\n\n//#endregion\n","//#region ---- Command Keys ----\n\nexport const AXEFergusCommandKeys = {\n ConnectionConnect: 'fergus-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'fergus-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'fergus-extension.Connection:Lifecycle',\n OAuthStart: 'fergus-extension.OAuth:Start',\n OAuthComplete: 'fergus-extension.OAuth:Complete',\n OAuthValidate: 'fergus-extension.OAuth:Validate',\n ProjectImportFromFergus: 'fergus-extension.Project:ImportFromFergus',\n CustomerImportFromFergus: 'fergus-extension.Customer:ImportFromFergus',\n ProjectSync: 'fergus-extension.Project:Sync',\n JobsPull: 'fergus-extension.Jobs:Pull',\n JobsRefresh: 'fergus-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEFergusMenuKeys = {\n FergusExtensionConfig: 'fergus-extension:Menu:Configuration',\n} as const;\n\n//#endregion\n","//#region ---- Permission Keys ----\n\n/**\n * Administration capabilities used by this extension.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n ManageIntegrationActions: 'Administration:Permission:ManageIntegrationActions',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXEFergusPermissions = {\n FergusExtension: {\n Management: AXPAdministrationPermissionKeys.MaintainConnections,\n Catalog: {\n View: AXPAdministrationPermissionKeys.ViewIntegrations,\n },\n ProjectImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n CustomerImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n ProjectSync: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n },\n} as const;\n\n//#endregion\n","//#region ---- Fergus tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped Fergus. */\nexport interface AXEFergusConnectionConfig {\n /** OAuth2 client ID from the Fergus developer application. */\n clientId?: string;\n /** OAuth2 client secret from the Fergus developer application. */\n clientSecret?: string;\n /**\n * Optional Personal Access Token (PAT).\n * When set, API calls use this bearer token and OAuth refresh is skipped.\n */\n personalAccessToken?: string;\n /** Space-separated scopes granted at authorize time (often empty for Fergus). */\n scope?: string;\n /** Current bearer token (authorization-code flow or PAT copy). */\n accessToken?: string;\n /** Refresh token from Fergus token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires (omit / far-future for PAT). */\n tokenExpiresAt?: string;\n /** Full Fergus token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEFergusJobsSyncState;\n}\n\n/** Fergus job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEFergusJobsSyncState {\n /** ISO timestamp — last successful job pull (incremental sync watermark). */\n lastSyncAt?: string;\n /** ISO timestamp — last full snapshot reconcile (deactivation pass). */\n lastFullReconcileAt?: string;\n}\n\n//#endregion\n","//#region ---- Fergus OAuth API (client ↔ server) ----\n\nexport interface AXEFergusOAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEFergusOAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEFergusOAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEFergusOAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEFergusOAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEFergusOAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote Fergus DTOs ----\n\nimport type { AXEFergusProjectSyncStrategy } from './sync.types';\n\n/** Shared address subset used on Fergus customer / site payloads. */\nexport interface AXEFergusRemoteAddress {\n id?: number;\n address1?: string | null;\n address2?: string | null;\n addressSuburb?: string | null;\n addressCity?: string | null;\n addressRegion?: string | null;\n addressPostcode?: string | null;\n addressCountry?: string | null;\n}\n\nexport interface AXEFergusRemoteContactItem {\n id?: number;\n contactType?: string | null;\n contactValue?: string | null;\n}\n\nexport interface AXEFergusRemoteContact {\n id?: number;\n firstName?: string | null;\n lastName?: string | null;\n position?: string | null;\n company?: string | null;\n contactItems?: AXEFergusRemoteContactItem[] | null;\n}\n\nexport interface AXEFergusRemoteSitePrimaryContact {\n CellPhone?: string | null;\n Email?: string | null;\n Contact?: { ID?: number } | null;\n}\n\n/** Subset of Fergus Open API `Job` fields used for cache / import / sync. */\nexport interface AXEFergusRemoteJob {\n id: number;\n jobNo?: string | null;\n jobNumber?: string | null;\n description?: string | null;\n longDescription?: string | null;\n /** Display name when Fergus returns one (optional). */\n name?: string | null;\n Name?: string | null;\n createdAt?: string | null;\n lastModified?: string | null;\n jobType?: string | null;\n status?: string | null;\n assignedGroups?: string[] | null;\n customer?: {\n id?: number;\n customerFullName?: string | null;\n } | null;\n siteAddress?: {\n id?: number;\n name?: string | null;\n address1?: string | null;\n address2?: string | null;\n addressSuburb?: string | null;\n addressCity?: string | null;\n addressRegion?: string | null;\n addressCountry?: string | null;\n addressPostcode?: string | null;\n } | null;\n customerReference?: string | null;\n onHold?: boolean | null;\n archived?: boolean | null;\n parentJobId?: number | null;\n}\n\nexport interface AXEFergusRemoteCustomer {\n id: number;\n companyId?: number | null;\n customerFullName?: string | null;\n mainContact?: AXEFergusRemoteContact | null;\n physicalAddress?: AXEFergusRemoteAddress | null;\n postalAddress?: AXEFergusRemoteAddress | null;\n customerSource?: string | null;\n}\n\nexport interface AXEFergusRemoteSite {\n id: number;\n companyId?: number | null;\n name?: string | null;\n physicalAddress?: AXEFergusRemoteAddress | null;\n postalAddress?: AXEFergusRemoteAddress | null;\n PrimaryContact?: AXEFergusRemoteSitePrimaryContact | null;\n isArchived?: boolean | null;\n defaultContact?: AXEFergusRemoteContact | null;\n}\n\n/** Fergus `/users` — cached as `resourceType=employee` (`status=active` only). */\nexport interface AXEFergusRemoteEmployee {\n id: number;\n companyId?: number | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n userType?: string | null;\n address?: AXEFergusRemoteAddress | Record<string, unknown> | null;\n status?: string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEFergusPullJobsRequest {\n /** When set, pulls for this Fergus connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum Fergus jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental watermark) and reconciles deactivations.\n * When false (default for schedules), pulls newest jobs until the last-sync watermark.\n */\n force?: boolean;\n}\n\nexport interface AXEFergusPullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in Fergus. */\n skipped?: boolean;\n /** Whether this run used incremental or full snapshot mode. */\n syncMode?: 'incremental' | 'full';\n /** Per data-type upsert counts (jobs / customers / sites / employees). */\n byResourceType?: {\n job?: { upserted: number; deactivated: number };\n customer?: { upserted: number; deactivated: number };\n site?: { upserted: number; deactivated: number };\n employee?: { upserted: number; deactivated: number };\n };\n}\n\nexport interface AXEFergusImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEFergusProjectSyncStrategy;\n}\n\nexport interface AXEFergusImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEFergusImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEFergusImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXEFergusSyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEFergusConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEFergusConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- Fergus API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (Cognito-hosted). */\nexport const AXE_FERGUS_OAUTH_AUTHORIZE_URL = 'https://auth.fergus.com/oauth2/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_FERGUS_OAUTH_TOKEN_URL = 'https://auth.fergus.com/oauth2/token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_FERGUS_API_BASE_URL = 'https://api.fergus.com';\n\n/**\n * OAuth scopes for connect.\n * Fergus OpenAPI currently advertises an empty scope set; leave blank unless\n * the registered application requires explicit scopes.\n */\nexport const AXE_FERGUS_OAUTH_SCOPES = '';\n\n/** Default page size for Fergus `GET /jobs` (API max is 100). */\nexport const AXE_FERGUS_JOBS_PAGE_SIZE = 100;\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,mBAAmB;CAC1B;AAED,MAAM,WAAW,GAAG,iBAAiB;AAE9B,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QAAA,IAAI,EAAE,uBAAuB;AAC9B,KAAA;;AAGH;;ACjBA;AAKO,MAAM,uBAAuB,GAAsB;AACxD,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,OAAO,EAAE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;AAChE,IAAA,UAAU,EAAE,sCAAsC;AAClD,IAAA,WAAW,EAAE,uCAAuC;AACpD,IAAA,kBAAkB,EAAE,8CAA8C;AAClE,IAAA,QAAQ,EAAE,oCAAoC;AAC9C,IAAA,gBAAgB,EAAE,4CAA4C;AAC9D,IAAA,iBAAiB,EAAE,6CAA6C;AAChE,IAAA,qBAAqB,EAAE,iDAAiD;;AAG1E;;;AAGG;AACI,MAAM,oBAAoB,GAAG;AAClC,IAAA,eAAe,EAAE;QACf,UAAU,EAAE,+BAA+B,CAAC,mBAAmB;AAC/D,QAAA,OAAO,EAAE;YACP,IAAI,EAAE,+BAA+B,CAAC,gBAAgB;AACvD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,cAAc,EAAE;YACd,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,WAAW,EAAE;YACX,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACF,KAAA;;AAGH;;AClDA;AAmCA;;ACnCA;AA8BA;;AC9BA;AA2KA;;AC3KA;AAEA;AACO,MAAM,8BAA8B,GAAG;AAE9C;AACO,MAAM,0BAA0B,GAAG;AAE1C;AACO,MAAM,uBAAuB,GAAG;AAEvC;;;;AAIG;AACI,MAAM,uBAAuB,GAAG;AAEvC;AACO,MAAM,yBAAyB,GAAG;AAEzC;;ACrBA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-fergus-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/fergus/contracts/src/root-config.ts","../../../../libs/extensions/project-management/fergus/contracts/src/manifest.ts","../../../../libs/extensions/project-management/fergus/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/fergus/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/fergus/contracts/src/fergus.constants.ts","../../../../libs/extensions/project-management/fergus/contracts/src/acorex-platform-extension-project-management-fergus-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-fergus',\n};\n\nconst MODULE_NAME = 'FergusExtension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n title: `@${config.i18n}:integration.display-name`,\n icon: 'fa-light fa-briefcase',\n },\n};\n\n//#endregion\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-shared/core';\nimport { RootConfig } from './root-config';\n\nexport const FergusExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'project-management',\n dependencies: [],\n};\n\n//#endregion\n","//#region ---- Command Keys ----\n\nexport const AXEFergusCommandKeys = {\n ConnectionConnect: 'fergus-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'fergus-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'fergus-extension.Connection:Lifecycle',\n OAuthStart: 'fergus-extension.OAuth:Start',\n OAuthComplete: 'fergus-extension.OAuth:Complete',\n OAuthValidate: 'fergus-extension.OAuth:Validate',\n ProjectImportFromFergus: 'fergus-extension.Project:ImportFromFergus',\n CustomerImportFromFergus: 'fergus-extension.Customer:ImportFromFergus',\n EmployeeSyncFromFergus: 'fergus-extension.Employee:SyncFromFergus',\n EmployeeLinkFromFergus: 'fergus-extension.Employee:LinkFromFergus',\n ProjectSync: 'fergus-extension.Project:Sync',\n JobsPull: 'fergus-extension.Jobs:Pull',\n JobsRefresh: 'fergus-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEFergusMenuKeys = {\n FergusExtensionConfig: 'fergus-extension:Menu:Configuration',\n} as const;\n\n//#endregion\n","//#region ---- Permission Keys ----\n\n/**\n * Administration capabilities used by this extension.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n ManageIntegrationActions: 'Administration:Permission:ManageIntegrationActions',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXEFergusPermissions = {\n FergusExtension: {\n Management: AXPAdministrationPermissionKeys.MaintainConnections,\n Catalog: {\n View: AXPAdministrationPermissionKeys.ViewIntegrations,\n },\n ProjectImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n CustomerImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n EmployeeImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n ProjectSync: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n },\n} as const;\n\n//#endregion\n","//#region ---- Fergus tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped Fergus. */\nexport interface AXEFergusConnectionConfig {\n /** OAuth2 client ID from the Fergus developer application. */\n clientId?: string;\n /** OAuth2 client secret from the Fergus developer application. */\n clientSecret?: string;\n /**\n * Optional Personal Access Token (PAT).\n * When set, API calls use this bearer token and OAuth refresh is skipped.\n */\n personalAccessToken?: string;\n /** Space-separated scopes granted at authorize time (often empty for Fergus). */\n scope?: string;\n /** Current bearer token (authorization-code flow or PAT copy). */\n accessToken?: string;\n /** Refresh token from Fergus token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires (omit / far-future for PAT). */\n tokenExpiresAt?: string;\n /** Full Fergus token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEFergusJobsSyncState;\n}\n\n/** Fergus job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEFergusJobsSyncState {\n /** ISO timestamp — last successful job pull (incremental sync watermark). */\n lastSyncAt?: string;\n /** ISO timestamp — last full snapshot reconcile (deactivation pass). */\n lastFullReconcileAt?: string;\n}\n\n//#endregion\n","//#region ---- Fergus OAuth API (client ↔ server) ----\n\nexport interface AXEFergusOAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEFergusOAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEFergusOAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEFergusOAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEFergusOAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEFergusOAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote Fergus DTOs ----\n\nimport type { AXEFergusProjectSyncStrategy } from './sync.types';\n\n/** Shared address subset used on Fergus customer / site payloads. */\nexport interface AXEFergusRemoteAddress {\n id?: number;\n address1?: string | null;\n address2?: string | null;\n addressSuburb?: string | null;\n addressCity?: string | null;\n addressRegion?: string | null;\n addressPostcode?: string | null;\n addressCountry?: string | null;\n}\n\nexport interface AXEFergusRemoteContactItem {\n id?: number;\n contactType?: string | null;\n contactValue?: string | null;\n}\n\nexport interface AXEFergusRemoteContact {\n id?: number;\n firstName?: string | null;\n lastName?: string | null;\n position?: string | null;\n company?: string | null;\n contactItems?: AXEFergusRemoteContactItem[] | null;\n}\n\nexport interface AXEFergusRemoteSitePrimaryContact {\n CellPhone?: string | null;\n Email?: string | null;\n Contact?: { ID?: number } | null;\n}\n\n/** Subset of Fergus Open API `Job` fields used for cache / import / sync. */\nexport interface AXEFergusRemoteJob {\n id: number;\n jobNo?: string | null;\n jobNumber?: string | null;\n description?: string | null;\n longDescription?: string | null;\n /** Display name when Fergus returns one (optional). */\n name?: string | null;\n Name?: string | null;\n createdAt?: string | null;\n lastModified?: string | null;\n jobType?: string | null;\n status?: string | null;\n assignedGroups?: string[] | null;\n customer?: {\n id?: number;\n customerFullName?: string | null;\n } | null;\n siteAddress?: {\n id?: number;\n name?: string | null;\n address1?: string | null;\n address2?: string | null;\n addressSuburb?: string | null;\n addressCity?: string | null;\n addressRegion?: string | null;\n addressCountry?: string | null;\n addressPostcode?: string | null;\n } | null;\n customerReference?: string | null;\n onHold?: boolean | null;\n archived?: boolean | null;\n parentJobId?: number | null;\n}\n\nexport interface AXEFergusRemoteCustomer {\n id: number;\n companyId?: number | null;\n customerFullName?: string | null;\n mainContact?: AXEFergusRemoteContact | null;\n physicalAddress?: AXEFergusRemoteAddress | null;\n postalAddress?: AXEFergusRemoteAddress | null;\n customerSource?: string | null;\n}\n\nexport interface AXEFergusRemoteSite {\n id: number;\n companyId?: number | null;\n name?: string | null;\n physicalAddress?: AXEFergusRemoteAddress | null;\n postalAddress?: AXEFergusRemoteAddress | null;\n PrimaryContact?: AXEFergusRemoteSitePrimaryContact | null;\n isArchived?: boolean | null;\n defaultContact?: AXEFergusRemoteContact | null;\n}\n\n/** Fergus `/users` — cached as `resourceType=employee` (`status=active` only). */\nexport interface AXEFergusRemoteEmployee {\n id: number;\n companyId?: number | null;\n firstName?: string | null;\n lastName?: string | null;\n email?: string | null;\n userType?: string | null;\n address?: AXEFergusRemoteAddress | Record<string, unknown> | null;\n status?: string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEFergusPullJobsRequest {\n /** When set, pulls for this Fergus connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum Fergus jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental watermark) and reconciles deactivations.\n * When false (default for schedules), pulls newest jobs until the last-sync watermark.\n */\n force?: boolean;\n}\n\nexport interface AXEFergusPullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in Fergus. */\n skipped?: boolean;\n /** Whether this run used incremental or full snapshot mode. */\n syncMode?: 'incremental' | 'full';\n /** Per data-type upsert counts (jobs / customers / sites / employees). */\n byResourceType?: {\n job?: { upserted: number; deactivated: number };\n customer?: { upserted: number; deactivated: number };\n site?: { upserted: number; deactivated: number };\n employee?: { upserted: number; deactivated: number };\n };\n}\n\nexport interface AXEFergusImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEFergusProjectSyncStrategy;\n}\n\nexport interface AXEFergusImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEFergusImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEFergusImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\n/** Username conflict: remote login username matches an unlinked platform employee's User. */\nexport interface AXEFergusEmployeeUsernameConflict {\n remoteRecordId: string;\n remoteId: string;\n connectionId: string;\n username: string;\n remoteName: string;\n platformEmployeeId: string;\n platformEmployeeCode: string;\n platformEmployeeName?: string;\n}\n\nexport interface AXEFergusSyncEmployeesRequest {\n connectionIds?: string[];\n}\n\nexport interface AXEFergusSyncEmployeesResponse {\n created: number;\n updated: number;\n skipped: number;\n conflicts: AXEFergusEmployeeUsernameConflict[];\n errors: Array<{ remoteId: string; message: string }>;\n}\n\nexport interface AXEFergusLinkEmployeesRequest {\n links: Array<{ remoteRecordId: string; platformEmployeeId: string }>;\n}\n\nexport interface AXEFergusLinkEmployeesResponse {\n linked: number;\n errors: Array<{ remoteRecordId: string; message: string }>;\n}\n\nexport interface AXEFergusSyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEFergusConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEFergusConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- Fergus API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (Cognito-hosted). */\nexport const AXE_FERGUS_OAUTH_AUTHORIZE_URL = 'https://auth.fergus.com/oauth2/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_FERGUS_OAUTH_TOKEN_URL = 'https://auth.fergus.com/oauth2/token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_FERGUS_API_BASE_URL = 'https://api.fergus.com';\n\n/**\n * OAuth scopes for connect.\n * Fergus OpenAPI currently advertises an empty scope set; leave blank unless\n * the registered application requires explicit scopes.\n */\nexport const AXE_FERGUS_OAUTH_SCOPES = '';\n\n/** Default page size for Fergus `GET /jobs` (API max is 100). */\nexport const AXE_FERGUS_JOBS_PAGE_SIZE = 100;\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,mBAAmB;CAC1B;AAED,MAAM,WAAW,GAAG,iBAAiB;AAE9B,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW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,MAAM,uBAAuB,GAAG;AAEvC;AACO,MAAM,yBAAyB,GAAG;AAEzC;;ACrBA;;AAEG;;"}
|
|
@@ -5,13 +5,14 @@ import { AXPEntityService, ensureListActions, actionExists, AXP_ENTITY_MODIFIER
|
|
|
5
5
|
import { AXPQueryService, AXPCommandService, provideCommandSetups } from '@acorex-platform/framework-client/runtime';
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { inject, Injectable, NgModule } from '@angular/core';
|
|
8
|
-
import { AXEFergusCommandKeys, RootConfig as RootConfig$
|
|
8
|
+
import { AXPAdministrationPermissionKeys, AXEFergusCommandKeys, RootConfig as RootConfig$3, AXEFergusMenuKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';
|
|
9
9
|
import { AXE_PM_INTEGRATION_PROVIDER_FERGUS } from '@acorex-platform/extension-project-management-core-client/contracts';
|
|
10
10
|
import { RootConfig } from '@acorex-platform/module-project-management-client/contracts';
|
|
11
11
|
import { AXPSystemActionType, AXPWidgetsList, AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CAPABILITY, AXPRegionalSetting, AXP_INTEGRATION_CONNECTION_STATUS, runtimeQueryPayloadData } from '@acorex-platform/framework-shared/core';
|
|
12
12
|
import { AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';
|
|
13
|
-
import { AXEFergusCommandKeys as AXEFergusCommandKeys$1 } from '@acorex-platform/extension-project-management-fergus-client/contracts';
|
|
13
|
+
import { AXPAdministrationPermissionKeys as AXPAdministrationPermissionKeys$1, AXEFergusCommandKeys as AXEFergusCommandKeys$1 } from '@acorex-platform/extension-project-management-fergus-client/contracts';
|
|
14
14
|
import { RootConfig as RootConfig$1 } from '@acorex-platform/module-customer-management-client/contracts';
|
|
15
|
+
import { RootConfig as RootConfig$2 } from '@acorex-platform/module-human-capital-management-client/contracts';
|
|
15
16
|
import { AXFormatService } from '@acorex/core/format';
|
|
16
17
|
import { trim, defaultTo } from 'lodash-es';
|
|
17
18
|
import { AXPBackgroundJobQueryKeys } from '@acorex-platform/framework-shared/background-job';
|
|
@@ -56,7 +57,8 @@ class AXEFergusProjectLinkExpressionEvaluatorScopeProvider {
|
|
|
56
57
|
//#region ---- Imports ----
|
|
57
58
|
//#endregion
|
|
58
59
|
const IMPORT_ORDER$1 = 36;
|
|
59
|
-
const SYNC_ORDER = 37;
|
|
60
|
+
const SYNC_ORDER$1 = 37;
|
|
61
|
+
const MANAGE_INTEGRATION_ACTIONS_HIDDEN$2 = `{{ !permission.check("${AXPAdministrationPermissionKeys.ManageIntegrationActions}") }}`;
|
|
60
62
|
function buildImportAction$1() {
|
|
61
63
|
return {
|
|
62
64
|
name: AXEFergusCommandKeys.ProjectImportFromFergus,
|
|
@@ -67,6 +69,8 @@ function buildImportAction$1() {
|
|
|
67
69
|
icon: 'fa-light fa-briefcase',
|
|
68
70
|
scope: AXPEntityCommandScope.TypeLevel,
|
|
69
71
|
order: IMPORT_ORDER$1,
|
|
72
|
+
permissions: [AXPAdministrationPermissionKeys.ManageIntegrationActions],
|
|
73
|
+
hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN$2,
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
76
|
function buildSyncAction() {
|
|
@@ -81,7 +85,7 @@ function buildSyncAction() {
|
|
|
81
85
|
type: AXPSystemActionType.Sync,
|
|
82
86
|
icon: 'fa-light fa-arrows-rotate',
|
|
83
87
|
scope: AXPEntityCommandScope.Individual,
|
|
84
|
-
order: SYNC_ORDER,
|
|
88
|
+
order: SYNC_ORDER$1,
|
|
85
89
|
hidden: `{{ !(await ${AXE_FERGUS_EXPRESSION_SCOPE}.hasProjectLink(context.eval("id"))) }}`,
|
|
86
90
|
};
|
|
87
91
|
}
|
|
@@ -123,6 +127,7 @@ const AXEFergusProjectEntityModifier = {
|
|
|
123
127
|
//#endregion
|
|
124
128
|
//#region ----- Constants -----
|
|
125
129
|
const IMPORT_ORDER = 36;
|
|
130
|
+
const MANAGE_INTEGRATION_ACTIONS_HIDDEN$1 = `{{ !permission.check("${AXPAdministrationPermissionKeys$1.ManageIntegrationActions}") }}`;
|
|
126
131
|
//#endregion
|
|
127
132
|
//#region ----- Actions -----
|
|
128
133
|
function buildImportAction() {
|
|
@@ -135,6 +140,8 @@ function buildImportAction() {
|
|
|
135
140
|
icon: 'fa-light fa-briefcase',
|
|
136
141
|
scope: AXPEntityCommandScope.TypeLevel,
|
|
137
142
|
order: IMPORT_ORDER,
|
|
143
|
+
permissions: [AXPAdministrationPermissionKeys$1.ManageIntegrationActions],
|
|
144
|
+
hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN$1,
|
|
138
145
|
};
|
|
139
146
|
}
|
|
140
147
|
//#endregion
|
|
@@ -163,6 +170,55 @@ const AXEFergusCustomerEntityModifier = {
|
|
|
163
170
|
};
|
|
164
171
|
//#endregion
|
|
165
172
|
|
|
173
|
+
//#region ---- Imports ----
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ----- Constants -----
|
|
176
|
+
const SYNC_ORDER = 40;
|
|
177
|
+
const MANAGE_INTEGRATION_ACTIONS_HIDDEN = `{{ !permission.check("${AXPAdministrationPermissionKeys.ManageIntegrationActions}") }}`;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ----- Actions -----
|
|
180
|
+
function buildSyncEmployeesAction() {
|
|
181
|
+
return {
|
|
182
|
+
name: AXEFergusCommandKeys.EmployeeSyncFromFergus,
|
|
183
|
+
title: '@extensions-fergus:actions.sync-employees-from-fergus.title',
|
|
184
|
+
command: { name: AXEFergusCommandKeys.EmployeeSyncFromFergus },
|
|
185
|
+
priority: 'secondary',
|
|
186
|
+
type: AXPSystemActionType.Import,
|
|
187
|
+
icon: 'fa-light fa-user-hard-hat',
|
|
188
|
+
scope: AXPEntityCommandScope.TypeLevel,
|
|
189
|
+
order: SYNC_ORDER,
|
|
190
|
+
permissions: [AXPAdministrationPermissionKeys.ManageIntegrationActions],
|
|
191
|
+
hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN,
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
//#endregion
|
|
195
|
+
//#region ----- Modifier -----
|
|
196
|
+
/** Adds Fergus employee sync action to HumanCapitalManagement.Employee list views. */
|
|
197
|
+
const AXEFergusEmployeeEntityModifier = {
|
|
198
|
+
entityName: RootConfig$2.entities.employee.name,
|
|
199
|
+
order: 54,
|
|
200
|
+
modifier: (ctx) => {
|
|
201
|
+
if (ctx.module.get() !== RootConfig$2.module.name) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
ensureListActions(ctx);
|
|
205
|
+
ctx.interfaces.update((interfaces) => {
|
|
206
|
+
const next = (interfaces ?? {});
|
|
207
|
+
const master = (next['master'] ?? {});
|
|
208
|
+
const list = (master['list'] ?? { actions: [], views: [] });
|
|
209
|
+
const listActions = (list['actions'] ?? []);
|
|
210
|
+
if (!actionExists(listActions, AXEFergusCommandKeys.EmployeeSyncFromFergus)) {
|
|
211
|
+
listActions.push(buildSyncEmployeesAction());
|
|
212
|
+
}
|
|
213
|
+
list['actions'] = listActions;
|
|
214
|
+
master['list'] = list;
|
|
215
|
+
next['master'] = master;
|
|
216
|
+
return next;
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
//#endregion
|
|
221
|
+
|
|
166
222
|
//#region ---- Fergus logo registry key ----
|
|
167
223
|
const axpFergusLogoKey = 'fergus';
|
|
168
224
|
/** Mark artwork; consuming apps copy to `assets/images/brand/integrations/`. */
|
|
@@ -173,14 +229,14 @@ const AXE_FERGUS_MARK_ASPECT = 266 / 311;
|
|
|
173
229
|
|
|
174
230
|
class AXEFergusIntegrationProvider {
|
|
175
231
|
async provide(context) {
|
|
176
|
-
const I18N = `@${RootConfig$
|
|
232
|
+
const I18N = `@${RootConfig$3.config.i18n}:integration`;
|
|
177
233
|
context.register({
|
|
178
234
|
domainId: 'project-management',
|
|
179
235
|
id: 'fergus',
|
|
180
|
-
module: RootConfig$
|
|
236
|
+
module: RootConfig$3.module.name,
|
|
181
237
|
displayName: `${I18N}.display-name`,
|
|
182
238
|
description: `${I18N}.description`,
|
|
183
|
-
icon: RootConfig$
|
|
239
|
+
icon: RootConfig$3.module.icon,
|
|
184
240
|
logoKey: axpFergusLogoKey,
|
|
185
241
|
capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],
|
|
186
242
|
connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
|
|
@@ -469,7 +525,7 @@ const AXE_FERGUS_LOGO_PROVIDER = {
|
|
|
469
525
|
//#endregion
|
|
470
526
|
class AXEFergusMenuProvider {
|
|
471
527
|
async provide(context) {
|
|
472
|
-
const module = RootConfig$
|
|
528
|
+
const module = RootConfig$3.module;
|
|
473
529
|
const policy = {
|
|
474
530
|
features: [module.name],
|
|
475
531
|
permissions: [AXPAdministrationPermissionKeys.MaintainConnections],
|
|
@@ -507,6 +563,7 @@ class AXEFergusExtensionModule {
|
|
|
507
563
|
{ provide: AXP_MENU_PROVIDER, useClass: AXEFergusMenuProvider, multi: true },
|
|
508
564
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusProjectEntityModifier, multi: true },
|
|
509
565
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusCustomerEntityModifier, multi: true },
|
|
566
|
+
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusEmployeeEntityModifier, multi: true },
|
|
510
567
|
{
|
|
511
568
|
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
512
569
|
useClass: AXEFergusProjectLinkExpressionEvaluatorScopeProvider,
|
|
@@ -536,6 +593,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
536
593
|
{ provide: AXP_MENU_PROVIDER, useClass: AXEFergusMenuProvider, multi: true },
|
|
537
594
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusProjectEntityModifier, multi: true },
|
|
538
595
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusCustomerEntityModifier, multi: true },
|
|
596
|
+
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusEmployeeEntityModifier, multi: true },
|
|
539
597
|
{
|
|
540
598
|
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
541
599
|
useClass: AXEFergusProjectLinkExpressionEvaluatorScopeProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-fergus-client.mjs","sources":["../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/fergus-expression-scope.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/fergus-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/project-fergus.entity-modifier.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/customer-management/customer-fergus.entity-modifier.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/brand/fergus-logo-key.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.integration.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.integration-runtime.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/brand/fergus-logo.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/fergus-extension.module.ts","../../../../libs/extensions/project-management/fergus/client/src/acorex-platform-extension-project-management-fergus-client.ts"],"sourcesContent":["export const AXE_FERGUS_EXPRESSION_SCOPE = 'FergusExtension';\n","//#region ---- Imports ----\n\nimport { AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationRuntimeService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\nimport { AXE_PM_INTEGRATION_PROVIDER_FERGUS } from '@acorex-platform/extension-project-management-core-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport type { AXMProjectManagementProjectEntityModel } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_FERGUS_EXPRESSION_SCOPE } from './fergus-expression-scope';\n\n//#endregion\n\nexport class AXEFergusProjectLinkExpressionEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {\n private readonly entityService = inject(AXPEntityService);\n private readonly integrationRuntime = inject(AXPIntegrationRuntimeService);\n\n async provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void> {\n context.addScope(AXE_FERGUS_EXPRESSION_SCOPE, {\n hasProjectLink: async (platformProjectIdRaw?: unknown): Promise<boolean> => {\n const platformProjectId = typeof platformProjectIdRaw === 'string' ? platformProjectIdRaw.trim() : '';\n if (!platformProjectId) {\n return false;\n }\n\n const project = (await this.entityService\n .withEntity(PmRootConfig.module.name, PmRootConfig.entities.project.name)\n .data<string, AXMProjectManagementProjectEntityModel>()\n .byKey(platformProjectId)) as AXMProjectManagementProjectEntityModel | null;\n\n return project?.integrationRef?.source === AXE_PM_INTEGRATION_PROVIDER_FERGUS;\n },\n hasFergusConnection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'fergus', connectionScope: 'tenant' });\n return true;\n } catch {\n return false;\n }\n },\n });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_FERGUS_EXPRESSION_SCOPE } from './fergus-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.ProjectImportFromFergus,\n title: '@extensions-fergus:actions.import-from-fergus.title',\n command: { name: AXEFergusCommandKeys.ProjectImportFromFergus },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\nfunction buildSyncAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.ProjectSync,\n title: '@extensions-fergus:actions.sync.title',\n command: {\n name: AXEFergusCommandKeys.ProjectSync,\n options: { platformProjectId: '{{ context.eval(\"id\") }}' },\n },\n priority: 'secondary',\n type: AXPSystemActionType.Sync,\n icon: 'fa-light fa-arrows-rotate',\n scope: AXPEntityCommandScope.Individual,\n order: SYNC_ORDER,\n hidden: `{{ !(await ${AXE_FERGUS_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds Fergus import/sync actions to ProjectManagement.Project views. */\nexport const AXEFergusProjectEntityModifier: AXPEntityModifierProvider = {\n entityName: PmRootConfig.entities.project.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== PmRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n\n if (!actionExists(listActions, AXEFergusCommandKeys.ProjectImportFromFergus)) {\n listActions.push(buildImportAction());\n }\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXEFergusCommandKeys.ProjectSync)) {\n singleActions.push(buildSyncAction());\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { RootConfig as CustomerRootConfig } from '@acorex-platform/module-customer-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst IMPORT_ORDER = 36;\n\n//#endregion\n\n//#region ----- Actions -----\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.CustomerImportFromFergus,\n title: '@extensions-fergus:actions.import-from-fergus.title',\n command: { name: AXEFergusCommandKeys.CustomerImportFromFergus },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\n//#endregion\n\n//#region ----- Modifier -----\n\n/** Adds Fergus import action to CustomerManagement.Customer list views. */\nexport const AXEFergusCustomerEntityModifier: AXPEntityModifierProvider = {\n entityName: CustomerRootConfig.entities.customer.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== CustomerRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.master.list.update((list) => {\n const next = list ?? { actions: [], views: [] };\n const listActions = [...(next.actions ?? [])];\n if (!actionExists(listActions, AXEFergusCommandKeys.CustomerImportFromFergus)) {\n listActions.push(buildImportAction());\n }\n return {\n ...next,\n actions: listActions,\n };\n });\n },\n};\n\n//#endregion\n","//#region ---- Fergus logo registry key ----\n\nexport const axpFergusLogoKey = 'fergus' as const;\n\n/** Mark artwork; consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_FERGUS_MARK_SRC = 'assets/images/brand/integrations/fergus-mark.png';\n\n/** Source mark is 266×311. */\nexport const AXE_FERGUS_MARK_ASPECT = 266 / 311;\n\n//#endregion\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXPWidgetsList,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationProvider, AXPIntegrationProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXEFergusCommandKeys, RootConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { axpFergusLogoKey } from '../brand/fergus-logo-key';\n\n@Injectable()\nexport class AXEFergusIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: 'project-management',\n id: 'fergus',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpFergusLogoKey,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: true,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEFergusCommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEFergusCommandKeys.ConnectionCompleteOAuth,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,\n label: `${I18N}.auth.pat.label`,\n instructions: `${I18N}.auth.pat.instructions`,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'personalAccessToken',\n options: { placeholder: `${I18N}.auth.pat.token.placeholder` },\n },\n ],\n },\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n label: `${I18N}.auth.oauth.label`,\n instructions: `${I18N}.auth.oauth.instructions`,\n usesRedirect: false,\n supportsRefresh: true,\n supportsRevoke: false,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.TextBox,\n path: 'clientId',\n options: { placeholder: `${I18N}.auth.oauth.client-id.placeholder` },\n },\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'clientSecret',\n options: { placeholder: `${I18N}.auth.oauth.client-secret.placeholder` },\n },\n ],\n },\n ],\n });\n }\n}\n","//#region ---- Fergus integration settings badges ----\n\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPRegionalSetting } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPIntegrationConnectionSettingsContext,\n AXPIntegrationSettingsRowBadge,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\nimport type { AXEFergusConnectionConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\n\nconst FERGUS_I18N = '@extensions-fergus:integration.badges';\n\n/** Must match `FERGUS_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'fergus-extension.jobs.pull';\n\nasync function formatSyncTimestamp(\n iso: string,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n): Promise<string | undefined> {\n const parsed = Date.parse(iso);\n if (!Number.isFinite(parsed)) {\n return undefined;\n }\n\n const dateFormat = await settingsService.get(AXPRegionalSetting.ShortDate);\n const timeFormat = await settingsService.get(AXPRegionalSetting.ShortTime);\n const format = `${dateFormat} ${timeFormat}`.trim();\n\n return formatService.format(new Date(parsed), 'datetime', { format });\n}\n\nfunction isFailureNewer(schedule: AXPBackgroundJobSchedule): boolean {\n const failed = schedule.lastFailureAt ? Date.parse(schedule.lastFailureAt) : NaN;\n const succeeded = schedule.lastSuccessAt ? Date.parse(schedule.lastSuccessAt) : NaN;\n if (!Number.isFinite(failed)) {\n return false;\n }\n if (!Number.isFinite(succeeded)) {\n return true;\n }\n return failed >= succeeded;\n}\n\nexport async function resolveFergusConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEFergusConnectionConfig;\n const jobsSync = config.jobsSync as Record<string, unknown> | undefined;\n const lastSync =\n config.jobsSync?.lastSyncAt?.trim() ||\n (typeof jobsSync?.['lastSuccessfulSyncAt'] === 'string' ? jobsSync['lastSuccessfulSyncAt'].trim() : '');\n\n const badges: AXPIntegrationSettingsRowBadge[] = [];\n\n if (!lastSync) {\n badges.push({\n labelKey: `${FERGUS_I18N}.never-synced`,\n color: 'warning',\n });\n } else {\n const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.last-sync`,\n params: { datetime },\n color: 'success',\n });\n }\n }\n\n if (!schedule) {\n return badges;\n }\n\n if (schedule.status === 'pause') {\n badges.push({\n labelKey: `${FERGUS_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${FERGUS_I18N}.schedule-disabled`,\n color: 'warning',\n });\n }\n\n if (schedule.nextRunAt) {\n const datetime = await formatSyncTimestamp(schedule.nextRunAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.next-run`,\n params: { datetime },\n color: 'secondary',\n });\n }\n }\n\n if (isFailureNewer(schedule) && schedule.lastFailureAt) {\n const datetime = await formatSyncTimestamp(schedule.lastFailureAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.last-failure`,\n params: { datetime },\n color: 'danger',\n });\n }\n }\n\n return badges;\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\n runtimeQueryPayloadData,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_INTEGRATION_SECRET_STORE,\n type AXPIntegrationRuntimeProvider,\n} from '@acorex-platform/framework-client/common';\nimport type { AXEFergusConnectionConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { defaultTo, trim } from 'lodash-es';\nimport { AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXPBackgroundJobQueryKeys,\n type AXPBackgroundJobSchedule,\n} from '@acorex-platform/framework-shared/background-job';\nimport {\n resolveFergusConnectionSettingsBadges,\n FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './fergus-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEFergusIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'fergus';\n\n private readonly secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });\n private readonly formatService = inject(AXFormatService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly queryService = inject(AXPQueryService, { optional: true });\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n createClient: (ctx) => this.createClient(ctx),\n getConnectionSettingsBadges: async (ctx) =>\n resolveFergusConnectionSettingsBadges(\n ctx,\n this.formatService,\n this.settingsService,\n await this.loadPullSchedule(ctx.connection.id),\n ),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n if (!this.hasUsableCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Fergus Personal Access Token or OAuth client credentials are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'Fergus')) || 'Fergus',\n };\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<{ clientId: string; baseUrl?: string }> {\n const credentials = await this.resolveClientCredentials(ctx);\n return {\n clientId: credentials.clientId,\n baseUrl: defaultTo(ctx.instanceUrl, undefined),\n };\n }\n\n private hasUsableCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEFergusConnectionConfig;\n const personalAccessToken = trim(defaultTo(config.personalAccessToken, ''));\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const accessToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean(personalAccessToken || (clientId && clientSecret) || accessToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEFergusConnectionConfig;\n const configClientId = trim(defaultTo(config.clientId, ''));\n const configClientSecret = trim(defaultTo(config.clientSecret, ''));\n\n if (configClientId && configClientSecret) {\n return { clientId: configClientId, clientSecret: configClientSecret };\n }\n\n if (!this.secretStore || !trim(defaultTo(ctx.secretRef, ''))) {\n throw new Error('Fergus connection has no client credentials.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const clientId = trim(defaultTo(credentials.token ?? credentials.email, ''));\n const clientSecret = trim(defaultTo(credentials.password ?? credentials.apiToken, ''));\n if (!clientId || !clientSecret) {\n throw new Error('Fergus connection has no usable client credentials.');\n }\n\n return { clientId, clientSecret };\n }\n\n private async loadPullSchedule(connectionId: string): Promise<AXPBackgroundJobSchedule | null> {\n if (!this.queryService || !connectionId.trim()) {\n return null;\n }\n try {\n const result = await this.queryService.fetch<\n { commandKey: string; connectionId?: string },\n AXPBackgroundJobSchedule | null\n >(AXPBackgroundJobQueryKeys.ScheduleGetByScope, {\n commandKey: FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideFergusIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEFergusIntegrationRuntimeProvider,\n multi: true,\n};\n","//#region ---- Imports ----\n\nimport {\n AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n type AXPIntegrationConnectionLifecycleHandler,\n} from '@acorex-platform/framework-client/common';\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEFergusConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'fergus';\n\n private readonly commandService = inject(AXPCommandService);\n\n async onDisconnected(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'disconnected');\n }\n\n async onDeleted(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'deleted');\n }\n\n async onEnabledChanged(connection: AXPSafeIntegrationConnectionDto, enabled: boolean): Promise<void> {\n if (enabled) {\n if (connection.status === AXP_INTEGRATION_CONNECTION_STATUS.Connected) {\n await this.runLifecycle(connection.id, 'enabled');\n }\n return;\n }\n await this.runLifecycle(connection.id, 'disabled');\n }\n\n private async runLifecycle(\n connectionId: string,\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled',\n ): Promise<void> {\n await this.commandService.execute(AXEFergusCommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideFergusConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEFergusConnectionLifecycleHandler,\n multi: true,\n};\n\n//#endregion\n","import {\n AXP_LOGO_PROVIDER,\n type AXPLogoProvider,\n type AXPLogoRequest,\n type AXPLogoView,\n} from '@acorex-platform/framework-client/core';\nimport {\n AXE_FERGUS_MARK_ASPECT,\n AXE_FERGUS_MARK_SRC,\n axpFergusLogoKey,\n} from './fergus-logo-key';\n\nconst fergusLogoProvider: AXPLogoProvider = {\n key: axpFergusLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_FERGUS_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_FERGUS_MARK_ASPECT),\n }),\n};\n\nexport const AXE_FERGUS_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: fergusLogoProvider,\n multi: true,\n} as const;\n","//#region ---- Imports ----\n\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXEFergusMenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-fergus-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEFergusMenuProvider implements AXPMenuProvider {\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n const policy = {\n features: [module.name],\n permissions: [AXPAdministrationPermissionKeys.MaintainConnections],\n };\n\n const configMenu = context.find(AXPCommonMenuKeys.Configuration);\n if (!context.find(AXEFergusMenuKeys.FergusExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEFergusMenuKeys.FergusExtensionConfig,\n text: '@extensions-fergus:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n priority: 8940,\n policy,\n children: [],\n },\n ]);\n }\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport { AXP_INTEGRATION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { NgModule } from '@angular/core';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { AXEFergusProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/fergus-project-link-expression-evaluator-scope.provider';\nimport { AXEFergusProjectEntityModifier } from './features/project-management/project-fergus.entity-modifier';\nimport { AXEFergusCustomerEntityModifier } from './features/customer-management/customer-fergus.entity-modifier';\nimport { AXEFergusIntegrationProvider } from './integration/fergus.integration.provider';\nimport { provideFergusIntegrationRuntimeProvider } from './integration/fergus.integration-runtime.provider';\nimport { provideFergusConnectionLifecycleHandler } from './integration/fergus.connection-lifecycle.handler';\nimport { AXE_FERGUS_LOGO_PROVIDER } from './brand/fergus-logo.provider';\nimport { AXEFergusMenuProvider } from './menu.provider';\n\n//#endregion\n\n//#region ---- Module ----\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_FERGUS_LOGO_PROVIDER,\n { provide: AXP_MENU_PROVIDER, useClass: AXEFergusMenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusCustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEFergusProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEFergusIntegrationProvider, multi: true },\n provideFergusIntegrationRuntimeProvider,\n provideFergusConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEFergusCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-fergus.command').then((c) => c.ConnectFergusCommand),\n },\n {\n key: AXEFergusCommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-fergus-oauth.command').then((c) => c.CompleteFergusOAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEFergusExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","buildImportAction","AXEFergusCommandKeys","CustomerRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,2BAA2B,GAAG,iBAAiB;;ACA5D;AAWA;MAEa,oDAAoD,CAAA;AAAjE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;IA2B5E;IAzBE,MAAM,OAAO,CAAC,OAAmD,EAAA;AAC/D,QAAA,OAAO,CAAC,QAAQ,CAAC,2BAA2B,EAAE;AAC5C,YAAA,cAAc,EAAE,OAAO,oBAA8B,KAAsB;AACzE,gBAAA,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,KAAK,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE;gBACrG,IAAI,CAAC,iBAAiB,EAAE;AACtB,oBAAA,OAAO,KAAK;gBACd;AAEA,gBAAA,MAAM,OAAO,IAAI,MAAM,IAAI,CAAC;AACzB,qBAAA,UAAU,CAACA,UAAY,CAAC,MAAM,CA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E,IAAI;AACZ,yBAAA;wBACD,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,4BAA4B,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC1F,uCAAuC;wBACvC,uCAAuC;AACvC,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,oBAAoB,CAAC,iBAAiB;AAC3C,gCAAA,OAAO,EAAE,MAAM,OAAO,kGAA2C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,CAAC;AACvG,6BAAA;AACD,4BAAA;gCACE,GAAG,EAAE,oBAAoB,CAAC,uBAAuB;AACjD,gCAAA,OAAO,EAAE,MACP,OAAO,yGAAkD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACvG,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACjDD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-fergus-client.mjs","sources":["../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/fergus-expression-scope.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/fergus-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/project-management/project-fergus.entity-modifier.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/customer-management/customer-fergus.entity-modifier.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/features/human-capital/employee-fergus.entity-modifier.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/brand/fergus-logo-key.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.integration.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.integration-runtime.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/integration/fergus.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/brand/fergus-logo.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/fergus/client/src/lib/fergus-extension.module.ts","../../../../libs/extensions/project-management/fergus/client/src/acorex-platform-extension-project-management-fergus-client.ts"],"sourcesContent":["export const AXE_FERGUS_EXPRESSION_SCOPE = 'FergusExtension';\n","//#region ---- Imports ----\n\nimport { AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationRuntimeService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\nimport { AXE_PM_INTEGRATION_PROVIDER_FERGUS } from '@acorex-platform/extension-project-management-core-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport type { AXMProjectManagementProjectEntityModel } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_FERGUS_EXPRESSION_SCOPE } from './fergus-expression-scope';\n\n//#endregion\n\nexport class AXEFergusProjectLinkExpressionEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {\n private readonly entityService = inject(AXPEntityService);\n private readonly integrationRuntime = inject(AXPIntegrationRuntimeService);\n\n async provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void> {\n context.addScope(AXE_FERGUS_EXPRESSION_SCOPE, {\n hasProjectLink: async (platformProjectIdRaw?: unknown): Promise<boolean> => {\n const platformProjectId = typeof platformProjectIdRaw === 'string' ? platformProjectIdRaw.trim() : '';\n if (!platformProjectId) {\n return false;\n }\n\n const project = (await this.entityService\n .withEntity(PmRootConfig.module.name, PmRootConfig.entities.project.name)\n .data<string, AXMProjectManagementProjectEntityModel>()\n .byKey(platformProjectId)) as AXMProjectManagementProjectEntityModel | null;\n\n return project?.integrationRef?.source === AXE_PM_INTEGRATION_PROVIDER_FERGUS;\n },\n hasFergusConnection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'fergus', connectionScope: 'tenant' });\n return true;\n } catch {\n return false;\n }\n },\n });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXEFergusCommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_FERGUS_EXPRESSION_SCOPE } from './fergus-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nconst MANAGE_INTEGRATION_ACTIONS_HIDDEN = `{{ !permission.check(\"${AXPAdministrationPermissionKeys.ManageIntegrationActions}\") }}`;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.ProjectImportFromFergus,\n title: '@extensions-fergus:actions.import-from-fergus.title',\n command: { name: AXEFergusCommandKeys.ProjectImportFromFergus },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n permissions: [AXPAdministrationPermissionKeys.ManageIntegrationActions],\n hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN,\n };\n}\n\nfunction buildSyncAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.ProjectSync,\n title: '@extensions-fergus:actions.sync.title',\n command: {\n name: AXEFergusCommandKeys.ProjectSync,\n options: { platformProjectId: '{{ context.eval(\"id\") }}' },\n },\n priority: 'secondary',\n type: AXPSystemActionType.Sync,\n icon: 'fa-light fa-arrows-rotate',\n scope: AXPEntityCommandScope.Individual,\n order: SYNC_ORDER,\n hidden: `{{ !(await ${AXE_FERGUS_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds Fergus import/sync actions to ProjectManagement.Project views. */\nexport const AXEFergusProjectEntityModifier: AXPEntityModifierProvider = {\n entityName: PmRootConfig.entities.project.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== PmRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n\n if (!actionExists(listActions, AXEFergusCommandKeys.ProjectImportFromFergus)) {\n listActions.push(buildImportAction());\n }\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXEFergusCommandKeys.ProjectSync)) {\n singleActions.push(buildSyncAction());\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXEFergusCommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { RootConfig as CustomerRootConfig } from '@acorex-platform/module-customer-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst IMPORT_ORDER = 36;\n\nconst MANAGE_INTEGRATION_ACTIONS_HIDDEN = `{{ !permission.check(\"${AXPAdministrationPermissionKeys.ManageIntegrationActions}\") }}`;\n\n//#endregion\n\n//#region ----- Actions -----\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.CustomerImportFromFergus,\n title: '@extensions-fergus:actions.import-from-fergus.title',\n command: { name: AXEFergusCommandKeys.CustomerImportFromFergus },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n permissions: [AXPAdministrationPermissionKeys.ManageIntegrationActions],\n hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN,\n };\n}\n\n//#endregion\n\n//#region ----- Modifier -----\n\n/** Adds Fergus import action to CustomerManagement.Customer list views. */\nexport const AXEFergusCustomerEntityModifier: AXPEntityModifierProvider = {\n entityName: CustomerRootConfig.entities.customer.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== CustomerRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.master.list.update((list) => {\n const next = list ?? { actions: [], views: [] };\n const listActions = [...(next.actions ?? [])];\n if (!actionExists(listActions, AXEFergusCommandKeys.CustomerImportFromFergus)) {\n listActions.push(buildImportAction());\n }\n return {\n ...next,\n actions: listActions,\n };\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXEFergusCommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { RootConfig as HcmRootConfig } from '@acorex-platform/module-human-capital-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst SYNC_ORDER = 40;\n\nconst MANAGE_INTEGRATION_ACTIONS_HIDDEN = `{{ !permission.check(\"${AXPAdministrationPermissionKeys.ManageIntegrationActions}\") }}`;\n\n//#endregion\n\n//#region ----- Actions -----\n\nfunction buildSyncEmployeesAction(): AXPEntityAction {\n return {\n name: AXEFergusCommandKeys.EmployeeSyncFromFergus,\n title: '@extensions-fergus:actions.sync-employees-from-fergus.title',\n command: { name: AXEFergusCommandKeys.EmployeeSyncFromFergus },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-user-hard-hat',\n scope: AXPEntityCommandScope.TypeLevel,\n order: SYNC_ORDER,\n permissions: [AXPAdministrationPermissionKeys.ManageIntegrationActions],\n hidden: MANAGE_INTEGRATION_ACTIONS_HIDDEN,\n };\n}\n\n//#endregion\n\n//#region ----- Modifier -----\n\n/** Adds Fergus employee sync action to HumanCapitalManagement.Employee list views. */\nexport const AXEFergusEmployeeEntityModifier: AXPEntityModifierProvider = {\n entityName: HcmRootConfig.entities.employee.name,\n order: 54,\n modifier: (ctx) => {\n if (ctx.module.get() !== HcmRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n\n if (!actionExists(listActions, AXEFergusCommandKeys.EmployeeSyncFromFergus)) {\n listActions.push(buildSyncEmployeesAction());\n }\n list['actions'] = listActions;\n master['list'] = list;\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Fergus logo registry key ----\n\nexport const axpFergusLogoKey = 'fergus' as const;\n\n/** Mark artwork; consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_FERGUS_MARK_SRC = 'assets/images/brand/integrations/fergus-mark.png';\n\n/** Source mark is 266×311. */\nexport const AXE_FERGUS_MARK_ASPECT = 266 / 311;\n\n//#endregion\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXPWidgetsList,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationProvider, AXPIntegrationProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXEFergusCommandKeys, RootConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { axpFergusLogoKey } from '../brand/fergus-logo-key';\n\n@Injectable()\nexport class AXEFergusIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: 'project-management',\n id: 'fergus',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpFergusLogoKey,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: true,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEFergusCommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEFergusCommandKeys.ConnectionCompleteOAuth,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.Pat,\n label: `${I18N}.auth.pat.label`,\n instructions: `${I18N}.auth.pat.instructions`,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'personalAccessToken',\n options: { placeholder: `${I18N}.auth.pat.token.placeholder` },\n },\n ],\n },\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n label: `${I18N}.auth.oauth.label`,\n instructions: `${I18N}.auth.oauth.instructions`,\n usesRedirect: false,\n supportsRefresh: true,\n supportsRevoke: false,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.TextBox,\n path: 'clientId',\n options: { placeholder: `${I18N}.auth.oauth.client-id.placeholder` },\n },\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'clientSecret',\n options: { placeholder: `${I18N}.auth.oauth.client-secret.placeholder` },\n },\n ],\n },\n ],\n });\n }\n}\n","//#region ---- Fergus integration settings badges ----\n\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPRegionalSetting } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPIntegrationConnectionSettingsContext,\n AXPIntegrationSettingsRowBadge,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\nimport type { AXEFergusConnectionConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\n\nconst FERGUS_I18N = '@extensions-fergus:integration.badges';\n\n/** Must match `FERGUS_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'fergus-extension.jobs.pull';\n\nasync function formatSyncTimestamp(\n iso: string,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n): Promise<string | undefined> {\n const parsed = Date.parse(iso);\n if (!Number.isFinite(parsed)) {\n return undefined;\n }\n\n const dateFormat = await settingsService.get(AXPRegionalSetting.ShortDate);\n const timeFormat = await settingsService.get(AXPRegionalSetting.ShortTime);\n const format = `${dateFormat} ${timeFormat}`.trim();\n\n return formatService.format(new Date(parsed), 'datetime', { format });\n}\n\nfunction isFailureNewer(schedule: AXPBackgroundJobSchedule): boolean {\n const failed = schedule.lastFailureAt ? Date.parse(schedule.lastFailureAt) : NaN;\n const succeeded = schedule.lastSuccessAt ? Date.parse(schedule.lastSuccessAt) : NaN;\n if (!Number.isFinite(failed)) {\n return false;\n }\n if (!Number.isFinite(succeeded)) {\n return true;\n }\n return failed >= succeeded;\n}\n\nexport async function resolveFergusConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEFergusConnectionConfig;\n const jobsSync = config.jobsSync as Record<string, unknown> | undefined;\n const lastSync =\n config.jobsSync?.lastSyncAt?.trim() ||\n (typeof jobsSync?.['lastSuccessfulSyncAt'] === 'string' ? jobsSync['lastSuccessfulSyncAt'].trim() : '');\n\n const badges: AXPIntegrationSettingsRowBadge[] = [];\n\n if (!lastSync) {\n badges.push({\n labelKey: `${FERGUS_I18N}.never-synced`,\n color: 'warning',\n });\n } else {\n const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.last-sync`,\n params: { datetime },\n color: 'success',\n });\n }\n }\n\n if (!schedule) {\n return badges;\n }\n\n if (schedule.status === 'pause') {\n badges.push({\n labelKey: `${FERGUS_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${FERGUS_I18N}.schedule-disabled`,\n color: 'warning',\n });\n }\n\n if (schedule.nextRunAt) {\n const datetime = await formatSyncTimestamp(schedule.nextRunAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.next-run`,\n params: { datetime },\n color: 'secondary',\n });\n }\n }\n\n if (isFailureNewer(schedule) && schedule.lastFailureAt) {\n const datetime = await formatSyncTimestamp(schedule.lastFailureAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${FERGUS_I18N}.last-failure`,\n params: { datetime },\n color: 'danger',\n });\n }\n }\n\n return badges;\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\n runtimeQueryPayloadData,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_INTEGRATION_SECRET_STORE,\n type AXPIntegrationRuntimeProvider,\n} from '@acorex-platform/framework-client/common';\nimport type { AXEFergusConnectionConfig } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { defaultTo, trim } from 'lodash-es';\nimport { AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXPBackgroundJobQueryKeys,\n type AXPBackgroundJobSchedule,\n} from '@acorex-platform/framework-shared/background-job';\nimport {\n resolveFergusConnectionSettingsBadges,\n FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './fergus-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEFergusIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'fergus';\n\n private readonly secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });\n private readonly formatService = inject(AXFormatService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly queryService = inject(AXPQueryService, { optional: true });\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n createClient: (ctx) => this.createClient(ctx),\n getConnectionSettingsBadges: async (ctx) =>\n resolveFergusConnectionSettingsBadges(\n ctx,\n this.formatService,\n this.settingsService,\n await this.loadPullSchedule(ctx.connection.id),\n ),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n if (!this.hasUsableCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Fergus Personal Access Token or OAuth client credentials are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'Fergus')) || 'Fergus',\n };\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<{ clientId: string; baseUrl?: string }> {\n const credentials = await this.resolveClientCredentials(ctx);\n return {\n clientId: credentials.clientId,\n baseUrl: defaultTo(ctx.instanceUrl, undefined),\n };\n }\n\n private hasUsableCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEFergusConnectionConfig;\n const personalAccessToken = trim(defaultTo(config.personalAccessToken, ''));\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const accessToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean(personalAccessToken || (clientId && clientSecret) || accessToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEFergusConnectionConfig;\n const configClientId = trim(defaultTo(config.clientId, ''));\n const configClientSecret = trim(defaultTo(config.clientSecret, ''));\n\n if (configClientId && configClientSecret) {\n return { clientId: configClientId, clientSecret: configClientSecret };\n }\n\n if (!this.secretStore || !trim(defaultTo(ctx.secretRef, ''))) {\n throw new Error('Fergus connection has no client credentials.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const clientId = trim(defaultTo(credentials.token ?? credentials.email, ''));\n const clientSecret = trim(defaultTo(credentials.password ?? credentials.apiToken, ''));\n if (!clientId || !clientSecret) {\n throw new Error('Fergus connection has no usable client credentials.');\n }\n\n return { clientId, clientSecret };\n }\n\n private async loadPullSchedule(connectionId: string): Promise<AXPBackgroundJobSchedule | null> {\n if (!this.queryService || !connectionId.trim()) {\n return null;\n }\n try {\n const result = await this.queryService.fetch<\n { commandKey: string; connectionId?: string },\n AXPBackgroundJobSchedule | null\n >(AXPBackgroundJobQueryKeys.ScheduleGetByScope, {\n commandKey: FERGUS_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideFergusIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEFergusIntegrationRuntimeProvider,\n multi: true,\n};\n","//#region ---- Imports ----\n\nimport {\n AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n type AXPIntegrationConnectionLifecycleHandler,\n} from '@acorex-platform/framework-client/common';\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEFergusConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'fergus';\n\n private readonly commandService = inject(AXPCommandService);\n\n async onDisconnected(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'disconnected');\n }\n\n async onDeleted(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'deleted');\n }\n\n async onEnabledChanged(connection: AXPSafeIntegrationConnectionDto, enabled: boolean): Promise<void> {\n if (enabled) {\n if (connection.status === AXP_INTEGRATION_CONNECTION_STATUS.Connected) {\n await this.runLifecycle(connection.id, 'enabled');\n }\n return;\n }\n await this.runLifecycle(connection.id, 'disabled');\n }\n\n private async runLifecycle(\n connectionId: string,\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled',\n ): Promise<void> {\n await this.commandService.execute(AXEFergusCommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideFergusConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEFergusConnectionLifecycleHandler,\n multi: true,\n};\n\n//#endregion\n","import {\n AXP_LOGO_PROVIDER,\n type AXPLogoProvider,\n type AXPLogoRequest,\n type AXPLogoView,\n} from '@acorex-platform/framework-client/core';\nimport {\n AXE_FERGUS_MARK_ASPECT,\n AXE_FERGUS_MARK_SRC,\n axpFergusLogoKey,\n} from './fergus-logo-key';\n\nconst fergusLogoProvider: AXPLogoProvider = {\n key: axpFergusLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_FERGUS_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_FERGUS_MARK_ASPECT),\n }),\n};\n\nexport const AXE_FERGUS_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: fergusLogoProvider,\n multi: true,\n} as const;\n","//#region ---- Imports ----\n\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXEFergusMenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-fergus-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEFergusMenuProvider implements AXPMenuProvider {\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n const policy = {\n features: [module.name],\n permissions: [AXPAdministrationPermissionKeys.MaintainConnections],\n };\n\n const configMenu = context.find(AXPCommonMenuKeys.Configuration);\n if (!context.find(AXEFergusMenuKeys.FergusExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEFergusMenuKeys.FergusExtensionConfig,\n text: '@extensions-fergus:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n priority: 8940,\n policy,\n children: [],\n },\n ]);\n }\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport { AXP_INTEGRATION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { NgModule } from '@angular/core';\nimport { AXEFergusCommandKeys } from '@acorex-platform/extension-project-management-fergus-client/contracts';\nimport { AXEFergusProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/fergus-project-link-expression-evaluator-scope.provider';\nimport { AXEFergusProjectEntityModifier } from './features/project-management/project-fergus.entity-modifier';\nimport { AXEFergusCustomerEntityModifier } from './features/customer-management/customer-fergus.entity-modifier';\nimport { AXEFergusEmployeeEntityModifier } from './features/human-capital/employee-fergus.entity-modifier';\nimport { AXEFergusIntegrationProvider } from './integration/fergus.integration.provider';\nimport { provideFergusIntegrationRuntimeProvider } from './integration/fergus.integration-runtime.provider';\nimport { provideFergusConnectionLifecycleHandler } from './integration/fergus.connection-lifecycle.handler';\nimport { AXE_FERGUS_LOGO_PROVIDER } from './brand/fergus-logo.provider';\nimport { AXEFergusMenuProvider } from './menu.provider';\n\n//#endregion\n\n//#region ---- Module ----\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_FERGUS_LOGO_PROVIDER,\n { provide: AXP_MENU_PROVIDER, useClass: AXEFergusMenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusCustomerEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEFergusEmployeeEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEFergusProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEFergusIntegrationProvider, multi: true },\n provideFergusIntegrationRuntimeProvider,\n provideFergusConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEFergusCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-fergus.command').then((c) => c.ConnectFergusCommand),\n },\n {\n key: AXEFergusCommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-fergus-oauth.command').then((c) => c.CompleteFergusOAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEFergusExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","SYNC_ORDER","MANAGE_INTEGRATION_ACTIONS_HIDDEN","buildImportAction","AXPAdministrationPermissionKeys","AXEFergusCommandKeys","CustomerRootConfig","HcmRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAO,MAAM,2BAA2B,GAAG,iBAAiB;;ACA5D;AAWA;MAEa,oDAAoD,CAAA;AAAjE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;IA2B5E;IAzBE,MAAM,OAAO,CAAC,OAAmD,EAAA;AAC/D,QAAA,OAAO,CAAC,QAAQ,CAAC,2BAA2B,EAAE;AAC5C,YAAA,cAAc,EAAE,OAAO,oBAA8B,KAAsB;AACzE,gBAAA,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,KAAK,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE;gBACrG,IAAI,CAAC,iBAAiB,EAAE;AACtB,oBAAA,OAAO,KAAK;gBACd;AAEA,gBAAA,MAAM,OAAO,IAAI,MAAM,IAAI,CAAC;AACzB,qBAAA,UAAU,CAACA,UAAY,CAAC,MAAM,CAAC,IAAI,EAAEA,UAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;AACvE,qBAAA,IAAI;AACJ,qBAAA,KAAK,CAAC,iBAAiB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oBAAoB,CAAC,uBAAuB;AACjD,gCAAA,OAAO,EAAE,MACP,OAAO,yGAAkD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACvG,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACnDD;;AAEG;;"}
|
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
},
|
|
111
111
|
"sync": {
|
|
112
112
|
"title": "Sync"
|
|
113
|
+
},
|
|
114
|
+
"sync-employees-from-fergus": {
|
|
115
|
+
"title": "Sync from Fergus"
|
|
113
116
|
}
|
|
114
117
|
},
|
|
115
118
|
"import": {
|
|
@@ -191,5 +194,39 @@
|
|
|
191
194
|
"title": "Syncing with Fergus",
|
|
192
195
|
"status": "Updating Project from Fergus…"
|
|
193
196
|
}
|
|
197
|
+
},
|
|
198
|
+
"sync-employees": {
|
|
199
|
+
"not-connected": {
|
|
200
|
+
"title": "Connect Fergus to Sync Employees",
|
|
201
|
+
"message": "Fergus is not connected for this tenant. Open Administration → Integrations to connect your account, then try syncing again."
|
|
202
|
+
},
|
|
203
|
+
"success": "Synced employees from Fergus: {{created}} created, {{updated}} updated, {{skipped}} skipped, {{errors}} errors.",
|
|
204
|
+
"link-success": "Linked {{count}} employees to Fergus.",
|
|
205
|
+
"conflicts": {
|
|
206
|
+
"title": "Matching Usernames Found",
|
|
207
|
+
"message": "Some employees in the system have usernames that match Fergus staff, but they are not linked to Fergus. Select the records you want to link and update, then submit.",
|
|
208
|
+
"selector-title": "Link Matching Fergus Employees",
|
|
209
|
+
"submit": "Submit",
|
|
210
|
+
"matching-employee": "Matching Employee"
|
|
211
|
+
},
|
|
212
|
+
"loading": {
|
|
213
|
+
"fetch": {
|
|
214
|
+
"title": "Loading from Fergus",
|
|
215
|
+
"status": "Pulling employees into cache…"
|
|
216
|
+
},
|
|
217
|
+
"sync": {
|
|
218
|
+
"title": "Syncing Employees",
|
|
219
|
+
"status": "Creating and updating employees from Fergus…"
|
|
220
|
+
},
|
|
221
|
+
"link": {
|
|
222
|
+
"title": "Linking Employees",
|
|
223
|
+
"status": "Linking selected employees to Fergus…"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"errors": {
|
|
228
|
+
"pull-employees-failed": "Failed to pull Fergus employees.",
|
|
229
|
+
"sync-employees-failed": "Fergus employee sync failed.",
|
|
230
|
+
"link-employees-failed": "Fergus employee link failed."
|
|
194
231
|
}
|
|
195
232
|
}
|
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
},
|
|
111
111
|
"sync": {
|
|
112
112
|
"title": "Sync"
|
|
113
|
+
},
|
|
114
|
+
"sync-employees-from-fergus": {
|
|
115
|
+
"title": "Sync from Fergus"
|
|
113
116
|
}
|
|
114
117
|
},
|
|
115
118
|
"import": {
|
|
@@ -191,5 +194,39 @@
|
|
|
191
194
|
"title": "Syncing with Fergus",
|
|
192
195
|
"status": "Updating Project from Fergus…"
|
|
193
196
|
}
|
|
197
|
+
},
|
|
198
|
+
"sync-employees": {
|
|
199
|
+
"not-connected": {
|
|
200
|
+
"title": "Connect Fergus to Sync Employees",
|
|
201
|
+
"message": "Fergus is not connected for this tenant. Open Administration → Integrations to connect your account, then try syncing again."
|
|
202
|
+
},
|
|
203
|
+
"success": "Synced employees from Fergus: {{created}} created, {{updated}} updated, {{skipped}} skipped, {{errors}} errors.",
|
|
204
|
+
"link-success": "Linked {{count}} employees to Fergus.",
|
|
205
|
+
"conflicts": {
|
|
206
|
+
"title": "Matching Usernames Found",
|
|
207
|
+
"message": "Some employees in the system have usernames that match Fergus staff, but they are not linked to Fergus. Select the records you want to link and update, then submit.",
|
|
208
|
+
"selector-title": "Link Matching Fergus Employees",
|
|
209
|
+
"submit": "Submit",
|
|
210
|
+
"matching-employee": "Matching Employee"
|
|
211
|
+
},
|
|
212
|
+
"loading": {
|
|
213
|
+
"fetch": {
|
|
214
|
+
"title": "Loading from Fergus",
|
|
215
|
+
"status": "Pulling employees into cache…"
|
|
216
|
+
},
|
|
217
|
+
"sync": {
|
|
218
|
+
"title": "Syncing Employees",
|
|
219
|
+
"status": "Creating and updating employees from Fergus…"
|
|
220
|
+
},
|
|
221
|
+
"link": {
|
|
222
|
+
"title": "Linking Employees",
|
|
223
|
+
"status": "Linking selected employees to Fergus…"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"errors": {
|
|
228
|
+
"pull-employees-failed": "Failed to pull Fergus employees.",
|
|
229
|
+
"sync-employees-failed": "Fergus employee sync failed.",
|
|
230
|
+
"link-employees-failed": "Fergus employee link failed."
|
|
194
231
|
}
|
|
195
232
|
}
|
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
},
|
|
111
111
|
"sync": {
|
|
112
112
|
"title": "همگامسازی"
|
|
113
|
+
},
|
|
114
|
+
"sync-employees-from-fergus": {
|
|
115
|
+
"title": "همگامسازی از Fergus"
|
|
113
116
|
}
|
|
114
117
|
},
|
|
115
118
|
"import": {
|
|
@@ -191,5 +194,39 @@
|
|
|
191
194
|
"title": "همگامسازی با Fergus",
|
|
192
195
|
"status": "در حال بهروزرسانی پروژه از Fergus…"
|
|
193
196
|
}
|
|
197
|
+
},
|
|
198
|
+
"sync-employees": {
|
|
199
|
+
"not-connected": {
|
|
200
|
+
"title": "برای همگامسازی کارکنان Fergus را متصل کنید",
|
|
201
|
+
"message": "Fergus برای این tenant متصل نیست. برای اتصال حساب، مدیریت ← یکپارچهسازیها را باز کنید و دوباره همگامسازی را امتحان کنید."
|
|
202
|
+
},
|
|
203
|
+
"success": "همگامسازی کارکنان از Fergus: {{created}} ایجاد، {{updated}} بهروزرسانی، {{skipped}} رد شده، {{errors}} خطا.",
|
|
204
|
+
"link-success": "{{count}} کارمند به Fergus پیوند داده شد.",
|
|
205
|
+
"conflicts": {
|
|
206
|
+
"title": "نامهای کاربری منطبق پیدا شد",
|
|
207
|
+
"message": "برخی کارکنان در سیستم نام کاربری یکسان با کارکنان Fergus دارند اما به Fergus پیوند نشدهاند. رکوردهایی را که میخواهید پیوند و بهروزرسانی شوند انتخاب کنید و سپس ثبت کنید.",
|
|
208
|
+
"selector-title": "پیوند کارکنان منطبق Fergus",
|
|
209
|
+
"submit": "ثبت",
|
|
210
|
+
"matching-employee": "کارمند منطبق"
|
|
211
|
+
},
|
|
212
|
+
"loading": {
|
|
213
|
+
"fetch": {
|
|
214
|
+
"title": "بارگذاری از Fergus",
|
|
215
|
+
"status": "در حال کشیدن کارکنان به حافظه…"
|
|
216
|
+
},
|
|
217
|
+
"sync": {
|
|
218
|
+
"title": "همگامسازی کارکنان",
|
|
219
|
+
"status": "در حال ایجاد و بهروزرسانی کارکنان از Fergus…"
|
|
220
|
+
},
|
|
221
|
+
"link": {
|
|
222
|
+
"title": "پیوند کارکنان",
|
|
223
|
+
"status": "در حال پیوند کارکنان انتخابشده به Fergus…"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
"errors": {
|
|
228
|
+
"pull-employees-failed": "دریافت کارکنان از Fergus ناموفق بود.",
|
|
229
|
+
"sync-employees-failed": "همگامسازی کارکنان از Fergus ناموفق بود.",
|
|
230
|
+
"link-employees-failed": "پیوند کارکنان به Fergus ناموفق بود."
|
|
194
231
|
}
|
|
195
232
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/extension-project-management-fergus-client",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.43",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@acorex-platform/extension-project-management-core-client": "2.0.0-next.
|
|
6
|
+
"@acorex-platform/extension-project-management-core-client": "2.0.0-next.43",
|
|
7
7
|
"@angular/common": "^21.0.0 || ^22.0.0",
|
|
8
8
|
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
9
9
|
},
|
|
@@ -24,6 +24,8 @@ declare const AXEFergusCommandKeys: {
|
|
|
24
24
|
readonly OAuthValidate: "fergus-extension.OAuth:Validate";
|
|
25
25
|
readonly ProjectImportFromFergus: "fergus-extension.Project:ImportFromFergus";
|
|
26
26
|
readonly CustomerImportFromFergus: "fergus-extension.Customer:ImportFromFergus";
|
|
27
|
+
readonly EmployeeSyncFromFergus: "fergus-extension.Employee:SyncFromFergus";
|
|
28
|
+
readonly EmployeeLinkFromFergus: "fergus-extension.Employee:LinkFromFergus";
|
|
27
29
|
readonly ProjectSync: "fergus-extension.Project:Sync";
|
|
28
30
|
readonly JobsPull: "fergus-extension.Jobs:Pull";
|
|
29
31
|
readonly JobsRefresh: "fergus-extension.Jobs:Refresh";
|
|
@@ -74,6 +76,9 @@ declare const AXEFergusPermissions: {
|
|
|
74
76
|
readonly CustomerImport: {
|
|
75
77
|
readonly Execute: "Administration:Permission:ManageIntegrationActions";
|
|
76
78
|
};
|
|
79
|
+
readonly EmployeeImport: {
|
|
80
|
+
readonly Execute: "Administration:Permission:ManageIntegrationActions";
|
|
81
|
+
};
|
|
77
82
|
readonly ProjectSync: {
|
|
78
83
|
readonly Execute: "Administration:Permission:ManageIntegrationActions";
|
|
79
84
|
};
|
|
@@ -285,6 +290,43 @@ interface AXEFergusImportCustomerResponse {
|
|
|
285
290
|
platformCustomerId: string;
|
|
286
291
|
created: boolean;
|
|
287
292
|
}
|
|
293
|
+
/** Username conflict: remote login username matches an unlinked platform employee's User. */
|
|
294
|
+
interface AXEFergusEmployeeUsernameConflict {
|
|
295
|
+
remoteRecordId: string;
|
|
296
|
+
remoteId: string;
|
|
297
|
+
connectionId: string;
|
|
298
|
+
username: string;
|
|
299
|
+
remoteName: string;
|
|
300
|
+
platformEmployeeId: string;
|
|
301
|
+
platformEmployeeCode: string;
|
|
302
|
+
platformEmployeeName?: string;
|
|
303
|
+
}
|
|
304
|
+
interface AXEFergusSyncEmployeesRequest {
|
|
305
|
+
connectionIds?: string[];
|
|
306
|
+
}
|
|
307
|
+
interface AXEFergusSyncEmployeesResponse {
|
|
308
|
+
created: number;
|
|
309
|
+
updated: number;
|
|
310
|
+
skipped: number;
|
|
311
|
+
conflicts: AXEFergusEmployeeUsernameConflict[];
|
|
312
|
+
errors: Array<{
|
|
313
|
+
remoteId: string;
|
|
314
|
+
message: string;
|
|
315
|
+
}>;
|
|
316
|
+
}
|
|
317
|
+
interface AXEFergusLinkEmployeesRequest {
|
|
318
|
+
links: Array<{
|
|
319
|
+
remoteRecordId: string;
|
|
320
|
+
platformEmployeeId: string;
|
|
321
|
+
}>;
|
|
322
|
+
}
|
|
323
|
+
interface AXEFergusLinkEmployeesResponse {
|
|
324
|
+
linked: number;
|
|
325
|
+
errors: Array<{
|
|
326
|
+
remoteRecordId: string;
|
|
327
|
+
message: string;
|
|
328
|
+
}>;
|
|
329
|
+
}
|
|
288
330
|
interface AXEFergusSyncPlatformProjectRequest {
|
|
289
331
|
platformProjectId: string;
|
|
290
332
|
}
|
|
@@ -312,4 +354,4 @@ declare const AXE_FERGUS_OAUTH_SCOPES = "";
|
|
|
312
354
|
declare const AXE_FERGUS_JOBS_PAGE_SIZE = 100;
|
|
313
355
|
|
|
314
356
|
export { AXEFergusCommandKeys, AXEFergusMenuKeys, AXEFergusPermissions, AXE_FERGUS_API_BASE_URL, AXE_FERGUS_JOBS_PAGE_SIZE, AXE_FERGUS_OAUTH_AUTHORIZE_URL, AXE_FERGUS_OAUTH_SCOPES, AXE_FERGUS_OAUTH_TOKEN_URL, AXPAdministrationPermissionKeys, FergusExtensionManifest, RootConfig };
|
|
315
|
-
export type { AXEFergusConnectionConfig, AXEFergusConnectionLifecycleRequest, AXEFergusConnectionLifecycleResponse, AXEFergusImportCustomerRequest, AXEFergusImportCustomerResponse, AXEFergusImportJobRequest, AXEFergusImportJobResponse, AXEFergusJobsSyncState, AXEFergusOAuthCompleteRequest, AXEFergusOAuthCompleteResponse, AXEFergusOAuthStartRequest, AXEFergusOAuthStartResponse, AXEFergusOAuthValidateRequest, AXEFergusOAuthValidateResponse, AXEFergusPullJobsRequest, AXEFergusPullJobsResponse, AXEFergusRemoteAddress, AXEFergusRemoteContact, AXEFergusRemoteContactItem, AXEFergusRemoteCustomer, AXEFergusRemoteEmployee, AXEFergusRemoteJob, AXEFergusRemoteSite, AXEFergusRemoteSitePrimaryContact, AXEFergusSyncPlatformProjectRequest };
|
|
357
|
+
export type { AXEFergusConnectionConfig, AXEFergusConnectionLifecycleRequest, AXEFergusConnectionLifecycleResponse, AXEFergusEmployeeUsernameConflict, AXEFergusImportCustomerRequest, AXEFergusImportCustomerResponse, AXEFergusImportJobRequest, AXEFergusImportJobResponse, AXEFergusJobsSyncState, AXEFergusLinkEmployeesRequest, AXEFergusLinkEmployeesResponse, AXEFergusOAuthCompleteRequest, AXEFergusOAuthCompleteResponse, AXEFergusOAuthStartRequest, AXEFergusOAuthStartResponse, AXEFergusOAuthValidateRequest, AXEFergusOAuthValidateResponse, AXEFergusPullJobsRequest, AXEFergusPullJobsResponse, AXEFergusRemoteAddress, AXEFergusRemoteContact, AXEFergusRemoteContactItem, AXEFergusRemoteCustomer, AXEFergusRemoteEmployee, AXEFergusRemoteJob, AXEFergusRemoteSite, AXEFergusRemoteSitePrimaryContact, AXEFergusSyncEmployeesRequest, AXEFergusSyncEmployeesResponse, AXEFergusSyncPlatformProjectRequest };
|