@acorex-platform/extension-project-management-servicem8-client 2.0.0-next.5 → 2.0.0-next.7
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-servicem8-client-contracts.mjs +5 -0
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client.mjs +66 -8
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client.mjs.map +1 -1
- package/i18n/en-AU/extensions-servicem8.json +37 -0
- package/i18n/en-US/extensions-servicem8.json +37 -0
- package/i18n/fa-IR/extensions-servicem8.json +37 -0
- package/package.json +2 -2
- package/types/acorex-platform-extension-project-management-servicem8-client-contracts.d.ts +43 -1
package/fesm2022/acorex-platform-extension-project-management-servicem8-client-contracts.mjs
CHANGED
|
@@ -38,6 +38,8 @@ const AXEServiceM8CommandKeys = {
|
|
|
38
38
|
OAuthValidate: 'servicem8-extension.OAuth:Validate',
|
|
39
39
|
ProjectImportFromServiceM8: 'servicem8-extension.Project:ImportFromServiceM8',
|
|
40
40
|
CustomerImportFromServiceM8: 'servicem8-extension.Customer:ImportFromServiceM8',
|
|
41
|
+
EmployeeSyncFromServiceM8: 'servicem8-extension.Employee:SyncFromServiceM8',
|
|
42
|
+
EmployeeLinkFromServiceM8: 'servicem8-extension.Employee:LinkFromServiceM8',
|
|
41
43
|
ProjectSync: 'servicem8-extension.Project:Sync',
|
|
42
44
|
JobsPull: 'servicem8-extension.Jobs:Pull',
|
|
43
45
|
JobsRefresh: 'servicem8-extension.Jobs:Refresh',
|
|
@@ -92,6 +94,9 @@ const AXEServiceM8Permissions = {
|
|
|
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-servicem8-client-contracts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/servicem8/contracts/src/root-config.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/manifest.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/servicem8.constants.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/acorex-platform-extension-project-management-servicem8-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-servicem8',\n};\n\nconst MODULE_NAME = 'ServiceM8Extension';\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 ServiceM8ExtensionManifest: 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 AXEServiceM8CommandKeys = {\n ConnectionConnect: 'servicem8-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'servicem8-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'servicem8-extension.Connection:Lifecycle',\n OAuthStart: 'servicem8-extension.OAuth:Start',\n OAuthComplete: 'servicem8-extension.OAuth:Complete',\n OAuthValidate: 'servicem8-extension.OAuth:Validate',\n ProjectImportFromServiceM8: 'servicem8-extension.Project:ImportFromServiceM8',\n CustomerImportFromServiceM8: 'servicem8-extension.Customer:ImportFromServiceM8',\n ProjectSync: 'servicem8-extension.Project:Sync',\n JobsPull: 'servicem8-extension.Jobs:Pull',\n JobsRefresh: 'servicem8-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEServiceM8MenuKeys = {\n ServiceM8ExtensionConfig: 'servicem8-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 AXEServiceM8Permissions = {\n ServiceM8Extension: {\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 ---- ServiceM8 tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped ServiceM8. */\nexport interface AXEServiceM8ConnectionConfig {\n /** OAuth2 App ID from the ServiceM8 developer add-on. */\n clientId?: string;\n /** OAuth2 App Secret from the ServiceM8 developer add-on. */\n clientSecret?: string;\n /** Space-separated scopes granted at authorize time. */\n scope?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from ServiceM8 token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full ServiceM8 token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEServiceM8JobsSyncState;\n}\n\n/** ServiceM8 job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEServiceM8JobsSyncState {\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 ---- ServiceM8 OAuth API (client ↔ server) ----\n\nexport interface AXEServiceM8OAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEServiceM8OAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote ServiceM8 DTOs ----\n\nimport type { AXEServiceM8ProjectSyncStrategy } from './sync.types';\n\n/** Subset of ServiceM8 `job.json` fields used for cache / import / sync. */\nexport interface AXEServiceM8RemoteJob {\n uuid: string;\n generated_job_id?: string | null;\n job_description?: string | null;\n job_address?: string | null;\n status?: string | null;\n date?: string | null;\n edit_date?: string | null;\n company_uuid?: string | null;\n company_name?: string | null;\n purchase_order_number?: string | null;\n active?: number | boolean | null;\n billing_address?: string | null;\n work_done_description?: string | null;\n}\n\n/**\n * ServiceM8 company (client) — cached as `resourceType=customer`.\n * Includes ServiceM8 address fields plus optional Simpro-shaped aliases when present.\n */\nexport interface AXEServiceM8RemoteCustomer {\n uuid: string;\n name?: string | null;\n address?: string | null;\n address_street?: string | null;\n address_city?: string | null;\n address_state?: string | null;\n address_postcode?: string | null;\n address_country?: string | null;\n fax_number?: string | null;\n FamilyName?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 companycontact — cached as `resourceType=site`. */\nexport interface AXEServiceM8RemoteSite {\n uuid: string;\n company_uuid?: string | null;\n first?: string | null;\n last?: string | null;\n phone?: string | null;\n mobile?: string | null;\n email?: string | null;\n type?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 `staff.json` — cached as `resourceType=employee` (active only). */\nexport interface AXEServiceM8RemoteEmployee {\n uuid: string;\n job_title?: string | null;\n first?: string | null;\n last?: string | null;\n active?: number | boolean | string | null;\n mobile?: string | null;\n email?: string | null;\n lng?: number | string | null;\n lat?: number | string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEServiceM8PullJobsRequest {\n /** When set, pulls for this ServiceM8 connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum ServiceM8 jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental filter) and reconciles deactivations.\n * When false (default for schedules), pulls jobs modified since the last successful sync.\n */\n force?: boolean;\n}\n\nexport interface AXEServiceM8PullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in ServiceM8. */\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 AXEServiceM8ImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEServiceM8ProjectSyncStrategy;\n}\n\nexport interface AXEServiceM8ImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8ImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEServiceM8ImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8SyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEServiceM8ConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEServiceM8ConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- ServiceM8 API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (fixed host). */\nexport const AXE_SERVICEM8_OAUTH_AUTHORIZE_URL = 'https://go.servicem8.com/oauth/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_SERVICEM8_OAUTH_TOKEN_URL = 'https://go.servicem8.com/oauth/access_token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_SERVICEM8_API_BASE_URL = 'https://api.servicem8.com';\n\n/**\n * OAuth scopes for connect / authorize.\n * Space-separated; encoded as `scope=` query value by the OAuth start flow.\n */\nexport const AXE_SERVICEM8_OAUTH_SCOPES =\n 'read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts';\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,sBAAsB;CAC7B;AAED,MAAM,WAAW,GAAG,oBAAoB;AAEjC,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,0BAA0B,GAAsB;AAC3D,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AAC9B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,aAAa;AACnB,IAAA,MAAM,EAAE,oBAAoB;AAC5B,IAAA,YAAY,EAAE,EAAE;;AAGlB;;AChBA;AAEO,MAAM,uBAAuB,GAAG;AACrC,IAAA,iBAAiB,EAAE,wCAAwC;AAC3D,IAAA,uBAAuB,EAAE,8CAA8C;AACvE,IAAA,mBAAmB,EAAE,0C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,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;AA8BA;;AC9BA;AA8BA;;AC9BA;AAwIA;;ACxIA;AAEA;AACO,MAAM,iCAAiC,GAAG;AAEjD;AACO,MAAM,6BAA6B,GAAG;AAE7C;AACO,MAAM,0BAA0B,GAAG;AAE1C;;;AAGG;AACI,MAAM,0BAA0B,GACrC;AAEF;;AClBA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/servicem8/contracts/src/root-config.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/manifest.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/servicem8.constants.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/acorex-platform-extension-project-management-servicem8-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-servicem8',\n};\n\nconst MODULE_NAME = 'ServiceM8Extension';\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 ServiceM8ExtensionManifest: 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 AXEServiceM8CommandKeys = {\n ConnectionConnect: 'servicem8-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'servicem8-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'servicem8-extension.Connection:Lifecycle',\n OAuthStart: 'servicem8-extension.OAuth:Start',\n OAuthComplete: 'servicem8-extension.OAuth:Complete',\n OAuthValidate: 'servicem8-extension.OAuth:Validate',\n ProjectImportFromServiceM8: 'servicem8-extension.Project:ImportFromServiceM8',\n CustomerImportFromServiceM8: 'servicem8-extension.Customer:ImportFromServiceM8',\n EmployeeSyncFromServiceM8: 'servicem8-extension.Employee:SyncFromServiceM8',\n EmployeeLinkFromServiceM8: 'servicem8-extension.Employee:LinkFromServiceM8',\n ProjectSync: 'servicem8-extension.Project:Sync',\n JobsPull: 'servicem8-extension.Jobs:Pull',\n JobsRefresh: 'servicem8-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEServiceM8MenuKeys = {\n ServiceM8ExtensionConfig: 'servicem8-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 AXEServiceM8Permissions = {\n ServiceM8Extension: {\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 ---- ServiceM8 tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped ServiceM8. */\nexport interface AXEServiceM8ConnectionConfig {\n /** OAuth2 App ID from the ServiceM8 developer add-on. */\n clientId?: string;\n /** OAuth2 App Secret from the ServiceM8 developer add-on. */\n clientSecret?: string;\n /** Space-separated scopes granted at authorize time. */\n scope?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from ServiceM8 token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full ServiceM8 token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEServiceM8JobsSyncState;\n}\n\n/** ServiceM8 job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEServiceM8JobsSyncState {\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 ---- ServiceM8 OAuth API (client ↔ server) ----\n\nexport interface AXEServiceM8OAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEServiceM8OAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote ServiceM8 DTOs ----\n\nimport type { AXEServiceM8ProjectSyncStrategy } from './sync.types';\n\n/** Subset of ServiceM8 `job.json` fields used for cache / import / sync. */\nexport interface AXEServiceM8RemoteJob {\n uuid: string;\n generated_job_id?: string | null;\n job_description?: string | null;\n job_address?: string | null;\n status?: string | null;\n date?: string | null;\n edit_date?: string | null;\n company_uuid?: string | null;\n company_name?: string | null;\n purchase_order_number?: string | null;\n active?: number | boolean | null;\n billing_address?: string | null;\n work_done_description?: string | null;\n}\n\n/**\n * ServiceM8 company (client) — cached as `resourceType=customer`.\n * Includes ServiceM8 address fields plus optional Simpro-shaped aliases when present.\n */\nexport interface AXEServiceM8RemoteCustomer {\n uuid: string;\n name?: string | null;\n address?: string | null;\n address_street?: string | null;\n address_city?: string | null;\n address_state?: string | null;\n address_postcode?: string | null;\n address_country?: string | null;\n fax_number?: string | null;\n FamilyName?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 companycontact — cached as `resourceType=site`. */\nexport interface AXEServiceM8RemoteSite {\n uuid: string;\n company_uuid?: string | null;\n first?: string | null;\n last?: string | null;\n phone?: string | null;\n mobile?: string | null;\n email?: string | null;\n type?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 `staff.json` — cached as `resourceType=employee` (active only). */\nexport interface AXEServiceM8RemoteEmployee {\n uuid: string;\n job_title?: string | null;\n first?: string | null;\n last?: string | null;\n active?: number | boolean | string | null;\n mobile?: string | null;\n email?: string | null;\n lng?: number | string | null;\n lat?: number | string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEServiceM8PullJobsRequest {\n /** When set, pulls for this ServiceM8 connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum ServiceM8 jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental filter) and reconciles deactivations.\n * When false (default for schedules), pulls jobs modified since the last successful sync.\n */\n force?: boolean;\n}\n\nexport interface AXEServiceM8PullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in ServiceM8. */\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 AXEServiceM8ImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEServiceM8ProjectSyncStrategy;\n}\n\nexport interface AXEServiceM8ImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8ImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEServiceM8ImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\n/** Username conflict: remote login username matches an unlinked platform employee's User. */\nexport interface AXEServiceM8EmployeeUsernameConflict {\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 AXEServiceM8SyncEmployeesRequest {\n connectionIds?: string[];\n}\n\nexport interface AXEServiceM8SyncEmployeesResponse {\n created: number;\n updated: number;\n skipped: number;\n conflicts: AXEServiceM8EmployeeUsernameConflict[];\n errors: Array<{ remoteId: string; message: string }>;\n}\n\nexport interface AXEServiceM8LinkEmployeesRequest {\n links: Array<{ remoteRecordId: string; platformEmployeeId: string }>;\n}\n\nexport interface AXEServiceM8LinkEmployeesResponse {\n linked: number;\n errors: Array<{ remoteRecordId: string; message: string }>;\n}\n\nexport interface AXEServiceM8SyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEServiceM8ConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEServiceM8ConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- ServiceM8 API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (fixed host). */\nexport const AXE_SERVICEM8_OAUTH_AUTHORIZE_URL = 'https://go.servicem8.com/oauth/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_SERVICEM8_OAUTH_TOKEN_URL = 'https://go.servicem8.com/oauth/access_token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_SERVICEM8_API_BASE_URL = 'https://api.servicem8.com';\n\n/**\n * OAuth scopes for connect / authorize.\n * Space-separated; encoded as `scope=` query value by the OAuth start flow.\n */\nexport const AXE_SERVICEM8_OAUTH_SCOPES =\n 'read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts';\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,sBAAsB;CAC7B;AAED,MAAM,WAAW,GAAG,oBAAoB;AAEjC,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,0BAA0B,GAAsB;AAC3D,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,OAAO,EAAE,OAAO;AAChB,IAAA,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,KAAK;AAC9B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,IAAI,EAAE,aAAa;AACnB,IAAA,MAAM,EAAE,oBAAoB;AAC5B,IAAA,YAAY,EAAE,EAAE;;AAGlB;;AChBA;AAEO,MAAM,uBAAuB,GAAG;AACrC,IAAA,iBAAiB,EAAE,wCAAwC;AAC3D,IAAA,uBAAuB,EAAE,8CAA8C;AACvE,IAAA,mBAAmB,EAAE,0CAA0C;AAC/D,IAAA,UAAU,EAAE,iCAAiC;AAC7C,IAAA,aAAa,EAAE,oCAAoC;AACnD,IAAA,aAAa,EAAE,oCAAoC;AACnD,IAAA,0BAA0B,EAAE,iDAAiD;AAC7E,IAAA,2BAA2B,EAAE,kDAAkD;AAC/E,IAAA,yBAAyB,EAAE,gDAAgD;AAC3E,IAAA,yBAAyB,EAAE,gDAAgD;AAC3E,IAAA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AAE;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;;ACrDA;AA8BA;;AC9BA;AA8BA;;AC9BA;AAyKA;;ACzKA;AAEA;AACO,MAAM,iCAAiC,GAAG;AAEjD;AACO,MAAM,6BAA6B,GAAG;AAE7C;AACO,MAAM,0BAA0B,GAAG;AAE1C;;;AAGG;AACI,MAAM,0BAA0B,GACrC;AAEF;;AClBA;;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 { AXEServiceM8CommandKeys, RootConfig as RootConfig$
|
|
8
|
+
import { AXPAdministrationPermissionKeys, AXEServiceM8CommandKeys, RootConfig as RootConfig$3, AXEServiceM8MenuKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';
|
|
9
9
|
import { AXE_PM_INTEGRATION_PROVIDER_SERVICEM8 } 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 { AXEServiceM8CommandKeys as AXEServiceM8CommandKeys$1 } from '@acorex-platform/extension-project-management-servicem8-client/contracts';
|
|
13
|
+
import { AXPAdministrationPermissionKeys as AXPAdministrationPermissionKeys$1, AXEServiceM8CommandKeys as AXEServiceM8CommandKeys$1 } from '@acorex-platform/extension-project-management-servicem8-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 AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider {
|
|
|
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: AXEServiceM8CommandKeys.ProjectImportFromServiceM8,
|
|
@@ -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_SERVICEM8_EXPRESSION_SCOPE}.hasProjectLink(context.eval("id"))) }}`,
|
|
86
90
|
};
|
|
87
91
|
}
|
|
@@ -123,6 +127,7 @@ const AXEServiceM8ProjectEntityModifier = {
|
|
|
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 AXEServiceM8CustomerEntityModifier = {
|
|
|
163
170
|
};
|
|
164
171
|
//#endregion
|
|
165
172
|
|
|
173
|
+
//#region ---- Imports ----
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ----- Constants -----
|
|
176
|
+
const SYNC_ORDER = 39;
|
|
177
|
+
const MANAGE_INTEGRATION_ACTIONS_HIDDEN = `{{ !permission.check("${AXPAdministrationPermissionKeys.ManageIntegrationActions}") }}`;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region ----- Actions -----
|
|
180
|
+
function buildSyncEmployeesAction() {
|
|
181
|
+
return {
|
|
182
|
+
name: AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8,
|
|
183
|
+
title: '@extensions-servicem8:actions.sync-employees-from-servicem8.title',
|
|
184
|
+
command: { name: AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8 },
|
|
185
|
+
priority: 'secondary',
|
|
186
|
+
type: AXPSystemActionType.Import,
|
|
187
|
+
icon: 'fa-light fa-user',
|
|
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 ServiceM8 employee sync action to HumanCapitalManagement.Employee list views. */
|
|
197
|
+
const AXEServiceM8EmployeeEntityModifier = {
|
|
198
|
+
entityName: RootConfig$2.entities.employee.name,
|
|
199
|
+
order: 53,
|
|
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, AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8)) {
|
|
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 ---- ServiceM8 logo registry key ----
|
|
167
223
|
const axpServiceM8LogoKey = 'servicem8';
|
|
168
224
|
/** Mark artwork (1024×1024); consuming apps copy to `assets/images/brand/integrations/`. */
|
|
@@ -173,14 +229,14 @@ const AXE_SERVICEM8_MARK_ASPECT = 1;
|
|
|
173
229
|
|
|
174
230
|
class AXEServiceM8IntegrationProvider {
|
|
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: 'servicem8',
|
|
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: axpServiceM8LogoKey,
|
|
185
241
|
capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],
|
|
186
242
|
connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
|
|
@@ -455,7 +511,7 @@ const AXE_SERVICEM8_LOGO_PROVIDER = {
|
|
|
455
511
|
//#endregion
|
|
456
512
|
class AXEServiceM8MenuProvider {
|
|
457
513
|
async provide(context) {
|
|
458
|
-
const module = RootConfig$
|
|
514
|
+
const module = RootConfig$3.module;
|
|
459
515
|
const policy = {
|
|
460
516
|
features: [module.name],
|
|
461
517
|
permissions: [AXPAdministrationPermissionKeys.MaintainConnections],
|
|
@@ -492,6 +548,7 @@ class AXEServiceM8ExtensionModule {
|
|
|
492
548
|
{ provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },
|
|
493
549
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },
|
|
494
550
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },
|
|
551
|
+
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8EmployeeEntityModifier, multi: true },
|
|
495
552
|
{
|
|
496
553
|
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
497
554
|
useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,
|
|
@@ -521,6 +578,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
521
578
|
{ provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },
|
|
522
579
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },
|
|
523
580
|
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },
|
|
581
|
+
{ provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8EmployeeEntityModifier, multi: true },
|
|
524
582
|
{
|
|
525
583
|
provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,
|
|
526
584
|
useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-expression-scope.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/project-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/customer-management/customer-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo-key.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration-runtime.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/servicem8-extension.module.ts","../../../../libs/extensions/project-management/servicem8/client/src/acorex-platform-extension-project-management-servicem8-client.ts"],"sourcesContent":["export const AXE_SERVICEM8_EXPRESSION_SCOPE = 'ServiceM8Extension';\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_SERVICEM8 } 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_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nexport class AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider 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_SERVICEM8_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_SERVICEM8;\n },\n hasServiceM8Connection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'servicem8', 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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8 },\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: AXEServiceM8CommandKeys.ProjectSync,\n title: '@extensions-servicem8:actions.sync.title',\n command: {\n name: AXEServiceM8CommandKeys.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_SERVICEM8_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds ServiceM8 import/sync actions to ProjectManagement.Project views. */\nexport const AXEServiceM8ProjectEntityModifier: 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, AXEServiceM8CommandKeys.ProjectImportFromServiceM8)) {\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, AXEServiceM8CommandKeys.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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-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: AXEServiceM8CommandKeys.CustomerImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8 },\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 ServiceM8 import action to CustomerManagement.Customer list views. */\nexport const AXEServiceM8CustomerEntityModifier: 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, AXEServiceM8CommandKeys.CustomerImportFromServiceM8)) {\n listActions.push(buildImportAction());\n }\n return {\n ...next,\n actions: listActions,\n };\n });\n },\n};\n\n//#endregion\n","//#region ---- ServiceM8 logo registry key ----\n\nexport const axpServiceM8LogoKey = 'servicem8' as const;\n\n/** Mark artwork (1024×1024); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_SERVICEM8_MARK_SRC = 'assets/images/brand/integrations/servicem8-mark.png';\n\n/** Source mark is square. */\nexport const AXE_SERVICEM8_MARK_ASPECT = 1;\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 { AXEServiceM8CommandKeys, RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { axpServiceM8LogoKey } from '../brand/servicem8-logo-key';\n\n@Injectable()\nexport class AXEServiceM8IntegrationProvider 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: 'servicem8',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpServiceM8LogoKey,\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: AXEServiceM8CommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n authMethods: [\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 ---- ServiceM8 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 { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nconst SERVICEM8_I18N = '@extensions-servicem8:integration.badges';\n\n/** Must match `SERVICEM8_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'servicem8-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 resolveServiceM8ConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEServiceM8ConnectionConfig;\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: `${SERVICEM8_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: `${SERVICEM8_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: `${SERVICEM8_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${SERVICEM8_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: `${SERVICEM8_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: `${SERVICEM8_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 { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-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 resolveServiceM8ConnectionSettingsBadges,\n SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './servicem8-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEServiceM8IntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'servicem8';\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 resolveServiceM8ConnectionSettingsBadges(\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.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'ServiceM8 App ID and App Secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'ServiceM8')) || 'ServiceM8',\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 hasClientCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const legacyToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean((clientId && clientSecret) || legacyToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\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('ServiceM8 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('ServiceM8 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: SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideServiceM8IntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEServiceM8IntegrationRuntimeProvider,\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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEServiceM8ConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'servicem8';\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(AXEServiceM8CommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideServiceM8ConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEServiceM8ConnectionLifecycleHandler,\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_SERVICEM8_MARK_ASPECT,\n AXE_SERVICEM8_MARK_SRC,\n axpServiceM8LogoKey,\n} from './servicem8-logo-key';\n\nconst servicem8LogoProvider: AXPLogoProvider = {\n key: axpServiceM8LogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_SERVICEM8_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_SERVICEM8_MARK_ASPECT),\n }),\n};\n\nexport const AXE_SERVICEM8_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: servicem8LogoProvider,\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 AXEServiceM8MenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEServiceM8MenuProvider 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(AXEServiceM8MenuKeys.ServiceM8ExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEServiceM8MenuKeys.ServiceM8ExtensionConfig,\n text: '@extensions-servicem8: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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/servicem8-project-link-expression-evaluator-scope.provider';\nimport { AXEServiceM8ProjectEntityModifier } from './features/project-management/project-servicem8.entity-modifier';\nimport { AXEServiceM8CustomerEntityModifier } from './features/customer-management/customer-servicem8.entity-modifier';\nimport { AXEServiceM8IntegrationProvider } from './integration/servicem8.integration.provider';\nimport { provideServiceM8IntegrationRuntimeProvider } from './integration/servicem8.integration-runtime.provider';\nimport { provideServiceM8ConnectionLifecycleHandler } from './integration/servicem8.connection-lifecycle.handler';\nimport { AXE_SERVICEM8_LOGO_PROVIDER } from './brand/servicem8-logo.provider';\nimport { AXEServiceM8MenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SERVICEM8_LOGO_PROVIDER,\n { provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEServiceM8IntegrationProvider, multi: true },\n provideServiceM8IntegrationRuntimeProvider,\n provideServiceM8ConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEServiceM8CommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-servicem8.command').then((c) => c.ConnectServiceM8Command),\n },\n {\n key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-servicem8-oauth.command').then((c) => c.CompleteServiceM8OAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEServiceM8ExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","buildImportAction","AXEServiceM8CommandKeys","CustomerRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,8BAA8B,GAAG,oBAAoB;;ACAlE;AAWA;MAEa,uDAAuD,CAAA;AAApE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,C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AAK,EAAE,IAAI,EAAE;wBAC7F,0CAA0C;wBAC1C,0CAA0C;AAC1C,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,iBAAiB;AAC9C,gCAAA,OAAO,EAAE,MAAM,OAAO,wGAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;AAC7G,6BAAA;AACD,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,uBAAuB;AACpD,gCAAA,OAAO,EAAE,MACP,OAAO,+GAAqD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,6BAA6B,CAAC;AAC7G,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;AC/CD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-expression-scope.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/project-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/customer-management/customer-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/human-capital/employee-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo-key.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration-runtime.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/servicem8-extension.module.ts","../../../../libs/extensions/project-management/servicem8/client/src/acorex-platform-extension-project-management-servicem8-client.ts"],"sourcesContent":["export const AXE_SERVICEM8_EXPRESSION_SCOPE = 'ServiceM8Extension';\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_SERVICEM8 } 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_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nexport class AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider 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_SERVICEM8_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_SERVICEM8;\n },\n hasServiceM8Connection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'servicem8', 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 AXEServiceM8CommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-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: AXEServiceM8CommandKeys.ProjectImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8 },\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: AXEServiceM8CommandKeys.ProjectSync,\n title: '@extensions-servicem8:actions.sync.title',\n command: {\n name: AXEServiceM8CommandKeys.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_SERVICEM8_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds ServiceM8 import/sync actions to ProjectManagement.Project views. */\nexport const AXEServiceM8ProjectEntityModifier: 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, AXEServiceM8CommandKeys.ProjectImportFromServiceM8)) {\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, AXEServiceM8CommandKeys.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 AXEServiceM8CommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-servicem8-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: AXEServiceM8CommandKeys.CustomerImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8 },\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 ServiceM8 import action to CustomerManagement.Customer list views. */\nexport const AXEServiceM8CustomerEntityModifier: 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, AXEServiceM8CommandKeys.CustomerImportFromServiceM8)) {\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 AXEServiceM8CommandKeys,\n AXPAdministrationPermissionKeys,\n} from '@acorex-platform/extension-project-management-servicem8-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 = 39;\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: AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8,\n title: '@extensions-servicem8:actions.sync-employees-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8 },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-user',\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 ServiceM8 employee sync action to HumanCapitalManagement.Employee list views. */\nexport const AXEServiceM8EmployeeEntityModifier: AXPEntityModifierProvider = {\n entityName: HcmRootConfig.entities.employee.name,\n order: 53,\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, AXEServiceM8CommandKeys.EmployeeSyncFromServiceM8)) {\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 ---- ServiceM8 logo registry key ----\n\nexport const axpServiceM8LogoKey = 'servicem8' as const;\n\n/** Mark artwork (1024×1024); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_SERVICEM8_MARK_SRC = 'assets/images/brand/integrations/servicem8-mark.png';\n\n/** Source mark is square. */\nexport const AXE_SERVICEM8_MARK_ASPECT = 1;\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 { AXEServiceM8CommandKeys, RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { axpServiceM8LogoKey } from '../brand/servicem8-logo-key';\n\n@Injectable()\nexport class AXEServiceM8IntegrationProvider 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: 'servicem8',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpServiceM8LogoKey,\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: AXEServiceM8CommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n authMethods: [\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 ---- ServiceM8 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 { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nconst SERVICEM8_I18N = '@extensions-servicem8:integration.badges';\n\n/** Must match `SERVICEM8_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'servicem8-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 resolveServiceM8ConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEServiceM8ConnectionConfig;\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: `${SERVICEM8_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: `${SERVICEM8_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: `${SERVICEM8_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${SERVICEM8_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: `${SERVICEM8_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: `${SERVICEM8_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 { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-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 resolveServiceM8ConnectionSettingsBadges,\n SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './servicem8-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEServiceM8IntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'servicem8';\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 resolveServiceM8ConnectionSettingsBadges(\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.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'ServiceM8 App ID and App Secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'ServiceM8')) || 'ServiceM8',\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 hasClientCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const legacyToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean((clientId && clientSecret) || legacyToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\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('ServiceM8 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('ServiceM8 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: SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideServiceM8IntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEServiceM8IntegrationRuntimeProvider,\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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEServiceM8ConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'servicem8';\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(AXEServiceM8CommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideServiceM8ConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEServiceM8ConnectionLifecycleHandler,\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_SERVICEM8_MARK_ASPECT,\n AXE_SERVICEM8_MARK_SRC,\n axpServiceM8LogoKey,\n} from './servicem8-logo-key';\n\nconst servicem8LogoProvider: AXPLogoProvider = {\n key: axpServiceM8LogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_SERVICEM8_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_SERVICEM8_MARK_ASPECT),\n }),\n};\n\nexport const AXE_SERVICEM8_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: servicem8LogoProvider,\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 AXEServiceM8MenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEServiceM8MenuProvider 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(AXEServiceM8MenuKeys.ServiceM8ExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEServiceM8MenuKeys.ServiceM8ExtensionConfig,\n text: '@extensions-servicem8: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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/servicem8-project-link-expression-evaluator-scope.provider';\nimport { AXEServiceM8ProjectEntityModifier } from './features/project-management/project-servicem8.entity-modifier';\nimport { AXEServiceM8CustomerEntityModifier } from './features/customer-management/customer-servicem8.entity-modifier';\nimport { AXEServiceM8EmployeeEntityModifier } from './features/human-capital/employee-servicem8.entity-modifier';\nimport { AXEServiceM8IntegrationProvider } from './integration/servicem8.integration.provider';\nimport { provideServiceM8IntegrationRuntimeProvider } from './integration/servicem8.integration-runtime.provider';\nimport { provideServiceM8ConnectionLifecycleHandler } from './integration/servicem8.connection-lifecycle.handler';\nimport { AXE_SERVICEM8_LOGO_PROVIDER } from './brand/servicem8-logo.provider';\nimport { AXEServiceM8MenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SERVICEM8_LOGO_PROVIDER,\n { provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8EmployeeEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEServiceM8IntegrationProvider, multi: true },\n provideServiceM8IntegrationRuntimeProvider,\n provideServiceM8ConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEServiceM8CommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-servicem8.command').then((c) => c.ConnectServiceM8Command),\n },\n {\n key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-servicem8-oauth.command').then((c) => c.CompleteServiceM8OAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEServiceM8ExtensionModule {}\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","AXEServiceM8CommandKeys","CustomerRootConfig","HcmRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAO,MAAM,8BAA8B,GAAG,oBAAoB;;ACAlE;AAWA;MAEa,uDAAuD,CAAA;AAApE,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,8BAA8B,EAAE;AAC/C,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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AAE,IAAI,EAAE;wBAC1F,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,kCAAkC,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC3F,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,kCAAkC,EAAE,KAAK,EAAE,IAAI,EAAE;AAC3F,wBAAA;AACE,4BAAA,OAAO,EAAE,uCAAuC;AAChD,4BAAA,QAAQ,EAAE,uDAAuD;AACjE,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;wBACD,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,+BAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC7F,0CAA0C;wBAC1C,0CAA0C;AAC1C,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,iBAAiB;AAC9C,gCAAA,OAAO,EAAE,MAAM,OAAO,wGAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;AAC7G,6BAAA;AACD,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,uBAAuB;AACpD,gCAAA,OAAO,EAAE,MACP,OAAO,+GAAqD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,6BAA6B,CAAC;AAC7G,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACjDD;;AAEG;;"}
|
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
},
|
|
109
109
|
"sync": {
|
|
110
110
|
"title": "Sync"
|
|
111
|
+
},
|
|
112
|
+
"sync-employees-from-servicem8": {
|
|
113
|
+
"title": "Sync from ServiceM8"
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
"import": {
|
|
@@ -189,5 +192,39 @@
|
|
|
189
192
|
"title": "Syncing with ServiceM8",
|
|
190
193
|
"status": "Updating project from ServiceM8…"
|
|
191
194
|
}
|
|
195
|
+
},
|
|
196
|
+
"sync-employees": {
|
|
197
|
+
"not-connected": {
|
|
198
|
+
"title": "Connect ServiceM8 to Sync Employees",
|
|
199
|
+
"message": "ServiceM8 is not connected for this tenant. Open Administration → Integrations to connect your account, then try syncing again."
|
|
200
|
+
},
|
|
201
|
+
"success": "Synced employees from ServiceM8: {{created}} created, {{updated}} updated, {{skipped}} skipped, {{errors}} errors.",
|
|
202
|
+
"link-success": "Linked {{count}} employees to ServiceM8.",
|
|
203
|
+
"conflicts": {
|
|
204
|
+
"title": "Matching Usernames Found",
|
|
205
|
+
"message": "Some employees in the system have usernames that match ServiceM8 staff, but they are not linked to ServiceM8. Select the records you want to link and update, then submit.",
|
|
206
|
+
"selector-title": "Link Matching ServiceM8 Employees",
|
|
207
|
+
"submit": "Submit",
|
|
208
|
+
"matching-employee": "Matching Employee"
|
|
209
|
+
},
|
|
210
|
+
"loading": {
|
|
211
|
+
"fetch": {
|
|
212
|
+
"title": "Loading from ServiceM8",
|
|
213
|
+
"status": "Pulling employees into cache…"
|
|
214
|
+
},
|
|
215
|
+
"sync": {
|
|
216
|
+
"title": "Syncing Employees",
|
|
217
|
+
"status": "Creating and updating employees from ServiceM8…"
|
|
218
|
+
},
|
|
219
|
+
"link": {
|
|
220
|
+
"title": "Linking Employees",
|
|
221
|
+
"status": "Linking selected employees to ServiceM8…"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"errors": {
|
|
226
|
+
"pull-employees-failed": "Failed to pull ServiceM8 employees.",
|
|
227
|
+
"sync-employees-failed": "ServiceM8 employee sync failed.",
|
|
228
|
+
"link-employees-failed": "ServiceM8 employee link failed."
|
|
192
229
|
}
|
|
193
230
|
}
|
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
},
|
|
109
109
|
"sync": {
|
|
110
110
|
"title": "Sync"
|
|
111
|
+
},
|
|
112
|
+
"sync-employees-from-servicem8": {
|
|
113
|
+
"title": "Sync from ServiceM8"
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
"import": {
|
|
@@ -189,5 +192,39 @@
|
|
|
189
192
|
"title": "Syncing with ServiceM8",
|
|
190
193
|
"status": "Updating project from ServiceM8…"
|
|
191
194
|
}
|
|
195
|
+
},
|
|
196
|
+
"sync-employees": {
|
|
197
|
+
"not-connected": {
|
|
198
|
+
"title": "Connect ServiceM8 to Sync Employees",
|
|
199
|
+
"message": "ServiceM8 is not connected for this tenant. Open Administration → Integrations to connect your account, then try syncing again."
|
|
200
|
+
},
|
|
201
|
+
"success": "Synced employees from ServiceM8: {{created}} created, {{updated}} updated, {{skipped}} skipped, {{errors}} errors.",
|
|
202
|
+
"link-success": "Linked {{count}} employees to ServiceM8.",
|
|
203
|
+
"conflicts": {
|
|
204
|
+
"title": "Matching Usernames Found",
|
|
205
|
+
"message": "Some employees in the system have usernames that match ServiceM8 staff, but they are not linked to ServiceM8. Select the records you want to link and update, then submit.",
|
|
206
|
+
"selector-title": "Link Matching ServiceM8 Employees",
|
|
207
|
+
"submit": "Submit",
|
|
208
|
+
"matching-employee": "Matching Employee"
|
|
209
|
+
},
|
|
210
|
+
"loading": {
|
|
211
|
+
"fetch": {
|
|
212
|
+
"title": "Loading from ServiceM8",
|
|
213
|
+
"status": "Pulling employees into cache…"
|
|
214
|
+
},
|
|
215
|
+
"sync": {
|
|
216
|
+
"title": "Syncing Employees",
|
|
217
|
+
"status": "Creating and updating employees from ServiceM8…"
|
|
218
|
+
},
|
|
219
|
+
"link": {
|
|
220
|
+
"title": "Linking Employees",
|
|
221
|
+
"status": "Linking selected employees to ServiceM8…"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"errors": {
|
|
226
|
+
"pull-employees-failed": "Failed to pull ServiceM8 employees.",
|
|
227
|
+
"sync-employees-failed": "ServiceM8 employee sync failed.",
|
|
228
|
+
"link-employees-failed": "ServiceM8 employee link failed."
|
|
192
229
|
}
|
|
193
230
|
}
|
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
},
|
|
109
109
|
"sync": {
|
|
110
110
|
"title": "همگامسازی"
|
|
111
|
+
},
|
|
112
|
+
"sync-employees-from-servicem8": {
|
|
113
|
+
"title": "همگامسازی از ServiceM8"
|
|
111
114
|
}
|
|
112
115
|
},
|
|
113
116
|
"import": {
|
|
@@ -189,5 +192,39 @@
|
|
|
189
192
|
"title": "همگامسازی با ServiceM8",
|
|
190
193
|
"status": "در حال بهروزرسانی پروژه از ServiceM8…"
|
|
191
194
|
}
|
|
195
|
+
},
|
|
196
|
+
"sync-employees": {
|
|
197
|
+
"not-connected": {
|
|
198
|
+
"title": "برای همگامسازی کارکنان ServiceM8 را متصل کنید",
|
|
199
|
+
"message": "ServiceM8 برای این tenant متصل نیست. برای اتصال حساب، مدیریت ← یکپارچهسازیها را باز کنید و دوباره همگامسازی را امتحان کنید."
|
|
200
|
+
},
|
|
201
|
+
"success": "همگامسازی کارکنان از ServiceM8: {{created}} ایجاد، {{updated}} بهروزرسانی، {{skipped}} رد شده، {{errors}} خطا.",
|
|
202
|
+
"link-success": "{{count}} کارمند به ServiceM8 پیوند داده شد.",
|
|
203
|
+
"conflicts": {
|
|
204
|
+
"title": "نامهای کاربری منطبق پیدا شد",
|
|
205
|
+
"message": "برخی کارکنان در سیستم نام کاربری یکسان با کارکنان ServiceM8 دارند اما به ServiceM8 پیوند نشدهاند. رکوردهایی را که میخواهید پیوند و بهروزرسانی شوند انتخاب کنید و سپس ثبت کنید.",
|
|
206
|
+
"selector-title": "پیوند کارکنان منطبق ServiceM8",
|
|
207
|
+
"submit": "ثبت",
|
|
208
|
+
"matching-employee": "کارمند منطبق"
|
|
209
|
+
},
|
|
210
|
+
"loading": {
|
|
211
|
+
"fetch": {
|
|
212
|
+
"title": "بارگذاری از ServiceM8",
|
|
213
|
+
"status": "در حال کشیدن کارکنان به حافظه…"
|
|
214
|
+
},
|
|
215
|
+
"sync": {
|
|
216
|
+
"title": "همگامسازی کارکنان",
|
|
217
|
+
"status": "در حال ایجاد و بهروزرسانی کارکنان از ServiceM8…"
|
|
218
|
+
},
|
|
219
|
+
"link": {
|
|
220
|
+
"title": "پیوند کارکنان",
|
|
221
|
+
"status": "در حال پیوند کارکنان انتخابشده به ServiceM8…"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"errors": {
|
|
226
|
+
"pull-employees-failed": "دریافت کارکنان از ServiceM8 ناموفق بود.",
|
|
227
|
+
"sync-employees-failed": "همگامسازی کارکنان از ServiceM8 ناموفق بود.",
|
|
228
|
+
"link-employees-failed": "پیوند کارکنان به ServiceM8 ناموفق بود."
|
|
192
229
|
}
|
|
193
230
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/extension-project-management-servicem8-client",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.7",
|
|
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.7",
|
|
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 AXEServiceM8CommandKeys: {
|
|
|
24
24
|
readonly OAuthValidate: "servicem8-extension.OAuth:Validate";
|
|
25
25
|
readonly ProjectImportFromServiceM8: "servicem8-extension.Project:ImportFromServiceM8";
|
|
26
26
|
readonly CustomerImportFromServiceM8: "servicem8-extension.Customer:ImportFromServiceM8";
|
|
27
|
+
readonly EmployeeSyncFromServiceM8: "servicem8-extension.Employee:SyncFromServiceM8";
|
|
28
|
+
readonly EmployeeLinkFromServiceM8: "servicem8-extension.Employee:LinkFromServiceM8";
|
|
27
29
|
readonly ProjectSync: "servicem8-extension.Project:Sync";
|
|
28
30
|
readonly JobsPull: "servicem8-extension.Jobs:Pull";
|
|
29
31
|
readonly JobsRefresh: "servicem8-extension.Jobs:Refresh";
|
|
@@ -74,6 +76,9 @@ declare const AXEServiceM8Permissions: {
|
|
|
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
|
};
|
|
@@ -247,6 +252,43 @@ interface AXEServiceM8ImportCustomerResponse {
|
|
|
247
252
|
platformCustomerId: string;
|
|
248
253
|
created: boolean;
|
|
249
254
|
}
|
|
255
|
+
/** Username conflict: remote login username matches an unlinked platform employee's User. */
|
|
256
|
+
interface AXEServiceM8EmployeeUsernameConflict {
|
|
257
|
+
remoteRecordId: string;
|
|
258
|
+
remoteId: string;
|
|
259
|
+
connectionId: string;
|
|
260
|
+
username: string;
|
|
261
|
+
remoteName: string;
|
|
262
|
+
platformEmployeeId: string;
|
|
263
|
+
platformEmployeeCode: string;
|
|
264
|
+
platformEmployeeName?: string;
|
|
265
|
+
}
|
|
266
|
+
interface AXEServiceM8SyncEmployeesRequest {
|
|
267
|
+
connectionIds?: string[];
|
|
268
|
+
}
|
|
269
|
+
interface AXEServiceM8SyncEmployeesResponse {
|
|
270
|
+
created: number;
|
|
271
|
+
updated: number;
|
|
272
|
+
skipped: number;
|
|
273
|
+
conflicts: AXEServiceM8EmployeeUsernameConflict[];
|
|
274
|
+
errors: Array<{
|
|
275
|
+
remoteId: string;
|
|
276
|
+
message: string;
|
|
277
|
+
}>;
|
|
278
|
+
}
|
|
279
|
+
interface AXEServiceM8LinkEmployeesRequest {
|
|
280
|
+
links: Array<{
|
|
281
|
+
remoteRecordId: string;
|
|
282
|
+
platformEmployeeId: string;
|
|
283
|
+
}>;
|
|
284
|
+
}
|
|
285
|
+
interface AXEServiceM8LinkEmployeesResponse {
|
|
286
|
+
linked: number;
|
|
287
|
+
errors: Array<{
|
|
288
|
+
remoteRecordId: string;
|
|
289
|
+
message: string;
|
|
290
|
+
}>;
|
|
291
|
+
}
|
|
250
292
|
interface AXEServiceM8SyncPlatformProjectRequest {
|
|
251
293
|
platformProjectId: string;
|
|
252
294
|
}
|
|
@@ -271,4 +313,4 @@ declare const AXE_SERVICEM8_API_BASE_URL = "https://api.servicem8.com";
|
|
|
271
313
|
declare const AXE_SERVICEM8_OAUTH_SCOPES = "read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts";
|
|
272
314
|
|
|
273
315
|
export { AXEServiceM8CommandKeys, AXEServiceM8MenuKeys, AXEServiceM8Permissions, AXE_SERVICEM8_API_BASE_URL, AXE_SERVICEM8_OAUTH_AUTHORIZE_URL, AXE_SERVICEM8_OAUTH_SCOPES, AXE_SERVICEM8_OAUTH_TOKEN_URL, AXPAdministrationPermissionKeys, RootConfig, ServiceM8ExtensionManifest };
|
|
274
|
-
export type { AXEServiceM8ConnectionConfig, AXEServiceM8ConnectionLifecycleRequest, AXEServiceM8ConnectionLifecycleResponse, AXEServiceM8ImportCustomerRequest, AXEServiceM8ImportCustomerResponse, AXEServiceM8ImportJobRequest, AXEServiceM8ImportJobResponse, AXEServiceM8JobsSyncState, AXEServiceM8OAuthCompleteRequest, AXEServiceM8OAuthCompleteResponse, AXEServiceM8OAuthStartRequest, AXEServiceM8OAuthStartResponse, AXEServiceM8OAuthValidateRequest, AXEServiceM8OAuthValidateResponse, AXEServiceM8PullJobsRequest, AXEServiceM8PullJobsResponse, AXEServiceM8RemoteCustomer, AXEServiceM8RemoteEmployee, AXEServiceM8RemoteJob, AXEServiceM8RemoteSite, AXEServiceM8SyncPlatformProjectRequest };
|
|
316
|
+
export type { AXEServiceM8ConnectionConfig, AXEServiceM8ConnectionLifecycleRequest, AXEServiceM8ConnectionLifecycleResponse, AXEServiceM8EmployeeUsernameConflict, AXEServiceM8ImportCustomerRequest, AXEServiceM8ImportCustomerResponse, AXEServiceM8ImportJobRequest, AXEServiceM8ImportJobResponse, AXEServiceM8JobsSyncState, AXEServiceM8LinkEmployeesRequest, AXEServiceM8LinkEmployeesResponse, AXEServiceM8OAuthCompleteRequest, AXEServiceM8OAuthCompleteResponse, AXEServiceM8OAuthStartRequest, AXEServiceM8OAuthStartResponse, AXEServiceM8OAuthValidateRequest, AXEServiceM8OAuthValidateResponse, AXEServiceM8PullJobsRequest, AXEServiceM8PullJobsResponse, AXEServiceM8RemoteCustomer, AXEServiceM8RemoteEmployee, AXEServiceM8RemoteJob, AXEServiceM8RemoteSite, AXEServiceM8SyncEmployeesRequest, AXEServiceM8SyncEmployeesResponse, AXEServiceM8SyncPlatformProjectRequest };
|