@acorex-platform/extension-project-management-servicem8-client 0.0.70 → 2.0.0-next.0

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.
@@ -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//#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). */\n byResourceType?: {\n job?: { upserted: number; deactivated: number };\n customer?: { upserted: number; deactivated: number };\n site?: { 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,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,WAAW,EAAE,kCAAkC;AAC/C,IAAA,QAAQ,EAAE,+BAA+B;AACzC,IAAA,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AAGH;;AClDA;AA8BA;;AC9BA;AA8BA;;AC9BA;AA0HA;;AC1HA;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 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,EAA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AO,EAAE;YACP,IAAI,EAAE,+BAA+B,CAAC,gBAAgB;AACvD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,cAAc,EAAE;YACd,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,WAAW,EAAE;YACX,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACF,KAAA;;AAGH;;AClDA;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;;"}
@@ -169,12 +169,13 @@
169
169
  "pull": {
170
170
  "progress": {
171
171
  "starting": "Starting ServiceM8 job pull.",
172
- "fetching": "Fetching jobs, customers, and sites.",
172
+ "fetching": "Fetching jobs, customers, sites, and employees.",
173
173
  "related-customers": "Loading related customers.",
174
174
  "related-sites": "Loading related sites.",
175
175
  "saving-jobs": "Saving jobs.",
176
176
  "saving-customers": "Saving customers.",
177
177
  "saving-sites": "Saving sites.",
178
+ "saving-employees": "Saving employees.",
178
179
  "finishing": "Finishing sync.",
179
180
  "skipped": "No modified jobs since last sync.",
180
181
  "complete-full": "Full sync finished.",
@@ -169,12 +169,13 @@
169
169
  "pull": {
170
170
  "progress": {
171
171
  "starting": "Starting ServiceM8 job pull.",
172
- "fetching": "Fetching jobs, customers, and sites.",
172
+ "fetching": "Fetching jobs, customers, sites, and employees.",
173
173
  "related-customers": "Loading related customers.",
174
174
  "related-sites": "Loading related sites.",
175
175
  "saving-jobs": "Saving jobs.",
176
176
  "saving-customers": "Saving customers.",
177
177
  "saving-sites": "Saving sites.",
178
+ "saving-employees": "Saving employees.",
178
179
  "finishing": "Finishing sync.",
179
180
  "skipped": "No modified jobs since last sync.",
180
181
  "complete-full": "Full sync finished.",
@@ -169,12 +169,13 @@
169
169
  "pull": {
170
170
  "progress": {
171
171
  "starting": "در حال شروع دریافت کارها از ServiceM8.",
172
- "fetching": "در حال دریافت کارها، مشتری‌ها و سایت‌ها.",
172
+ "fetching": "در حال دریافت کارها، مشتری‌ها، سایت‌ها و کارکنان.",
173
173
  "related-customers": "در حال بارگذاری مشتری‌های مرتبط.",
174
174
  "related-sites": "در حال بارگذاری سایت‌های مرتبط.",
175
175
  "saving-jobs": "در حال ذخیره کارها.",
176
176
  "saving-customers": "در حال ذخیره مشتری‌ها.",
177
177
  "saving-sites": "در حال ذخیره سایت‌ها.",
178
+ "saving-employees": "در حال ذخیره کارکنان.",
178
179
  "finishing": "در حال نهایی‌سازی همگام‌سازی.",
179
180
  "skipped": "از همگام‌سازی قبلی تغییری نبود.",
180
181
  "complete-full": "همگام‌سازی کامل تمام شد.",
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-project-management-servicem8-client",
3
- "version": "0.0.70",
3
+ "version": "2.0.0-next.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@acorex-platform/extension-project-management-core-client": "0.0.70",
6
+ "@acorex-platform/extension-project-management-core-client": "2.0.0-next.0",
7
7
  "@angular/common": "^21.0.0 || ^22.0.0",
8
8
  "@angular/core": "^21.0.0 || ^22.0.0"
9
9
  },
@@ -181,6 +181,18 @@ interface AXEServiceM8RemoteSite {
181
181
  active?: number | boolean | null;
182
182
  edit_date?: string | null;
183
183
  }
184
+ /** ServiceM8 `staff.json` — cached as `resourceType=employee` (active only). */
185
+ interface AXEServiceM8RemoteEmployee {
186
+ uuid: string;
187
+ job_title?: string | null;
188
+ first?: string | null;
189
+ last?: string | null;
190
+ active?: number | boolean | string | null;
191
+ mobile?: string | null;
192
+ email?: string | null;
193
+ lng?: number | string | null;
194
+ lat?: number | string | null;
195
+ }
184
196
  interface AXEServiceM8PullJobsRequest {
185
197
  /** When set, pulls for this ServiceM8 connection (required for multi-connection schedules). */
186
198
  connectionId?: string;
@@ -199,7 +211,7 @@ interface AXEServiceM8PullJobsResponse {
199
211
  skipped?: boolean;
200
212
  /** Whether this run used incremental or full snapshot mode. */
201
213
  syncMode?: 'incremental' | 'full';
202
- /** Per data-type upsert counts (jobs / customers / sites). */
214
+ /** Per data-type upsert counts (jobs / customers / sites / employees). */
203
215
  byResourceType?: {
204
216
  job?: {
205
217
  upserted: number;
@@ -213,6 +225,10 @@ interface AXEServiceM8PullJobsResponse {
213
225
  upserted: number;
214
226
  deactivated: number;
215
227
  };
228
+ employee?: {
229
+ upserted: number;
230
+ deactivated: number;
231
+ };
216
232
  };
217
233
  }
218
234
  interface AXEServiceM8ImportJobRequest {
@@ -255,4 +271,4 @@ declare const AXE_SERVICEM8_API_BASE_URL = "https://api.servicem8.com";
255
271
  declare const AXE_SERVICEM8_OAUTH_SCOPES = "read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts";
256
272
 
257
273
  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 };
258
- export type { AXEServiceM8ConnectionConfig, AXEServiceM8ConnectionLifecycleRequest, AXEServiceM8ConnectionLifecycleResponse, AXEServiceM8ImportCustomerRequest, AXEServiceM8ImportCustomerResponse, AXEServiceM8ImportJobRequest, AXEServiceM8ImportJobResponse, AXEServiceM8JobsSyncState, AXEServiceM8OAuthCompleteRequest, AXEServiceM8OAuthCompleteResponse, AXEServiceM8OAuthStartRequest, AXEServiceM8OAuthStartResponse, AXEServiceM8OAuthValidateRequest, AXEServiceM8OAuthValidateResponse, AXEServiceM8PullJobsRequest, AXEServiceM8PullJobsResponse, AXEServiceM8RemoteCustomer, AXEServiceM8RemoteJob, AXEServiceM8RemoteSite, AXEServiceM8SyncPlatformProjectRequest };
274
+ export type { AXEServiceM8ConnectionConfig, AXEServiceM8ConnectionLifecycleRequest, AXEServiceM8ConnectionLifecycleResponse, AXEServiceM8ImportCustomerRequest, AXEServiceM8ImportCustomerResponse, AXEServiceM8ImportJobRequest, AXEServiceM8ImportJobResponse, AXEServiceM8JobsSyncState, AXEServiceM8OAuthCompleteRequest, AXEServiceM8OAuthCompleteResponse, AXEServiceM8OAuthStartRequest, AXEServiceM8OAuthStartResponse, AXEServiceM8OAuthValidateRequest, AXEServiceM8OAuthValidateResponse, AXEServiceM8PullJobsRequest, AXEServiceM8PullJobsResponse, AXEServiceM8RemoteCustomer, AXEServiceM8RemoteEmployee, AXEServiceM8RemoteJob, AXEServiceM8RemoteSite, AXEServiceM8SyncPlatformProjectRequest };