@acorex-platform/extension-project-management-simpro-client 1.0.1 → 2.0.0-next.1
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-simpro-client-contracts.mjs.map +1 -1
- package/i18n/en-AU/extensions-simpro.json +2 -1
- package/i18n/en-US/extensions-simpro.json +2 -1
- package/i18n/fa-IR/extensions-simpro.json +2 -1
- package/package.json +2 -2
- package/types/acorex-platform-extension-project-management-simpro-client-contracts.d.ts +35 -2
package/fesm2022/acorex-platform-extension-project-management-simpro-client-contracts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-simpro-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/simpro/contracts/src/root-config.ts","../../../../libs/extensions/project-management/simpro/contracts/src/manifest.ts","../../../../libs/extensions/project-management/simpro/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/simpro.errors.ts","../../../../libs/extensions/project-management/simpro/contracts/src/acorex-platform-extension-project-management-simpro-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-simpro',\n};\n\nconst MODULE_NAME = 'SimproExtension';\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 SimproExtensionManifest: 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 AXESimproCommandKeys = {\n ConnectionConnect: 'simpro-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'simpro-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'simpro-extension.Connection:Lifecycle',\n OAuthStart: 'simpro-extension.OAuth:Start',\n OAuthComplete: 'simpro-extension.OAuth:Complete',\n OAuthValidate: 'simpro-extension.OAuth:Validate',\n ProjectImportFromSimpro: 'simpro-extension.Project:ImportFromSimpro',\n CustomerImportFromSimpro: 'simpro-extension.Customer:ImportFromSimpro',\n ProjectSync: 'simpro-extension.Project:Sync',\n JobsPull: 'simpro-extension.Jobs:Pull',\n JobsRefresh: 'simpro-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXESimproMenuKeys = {\n SimproExtensionConfig: 'simpro-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 AXESimproPermissions = {\n SimproExtension: {\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 ---- Simpro tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped Simpro (cloud-only). */\nexport interface AXESimproConnectionConfig {\n /** Simpro multi-company ID (0 for single-company builds). */\n companyId?: number;\n /** OAuth2 client ID from the Simpro application key file. */\n clientId?: string;\n /** OAuth2 client secret from the Simpro application key file. */\n clientSecret?: string;\n /** Optional override when it differs from `{buildUrl}/oauth2/login`. */\n authorizationUrl?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from Simpro token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full Simpro token JSON response (mirrors legacy SimproJson). */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXESimproJobsSyncState;\n}\n\n/** Simpro job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXESimproJobsSyncState {\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 ---- Simpro OAuth API (client ↔ server) ----\n\nexport interface AXESimproOAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXESimproOAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXESimproOAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXESimproOAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXESimproOAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXESimproOAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote Simpro DTOs ----\n\nimport type { AXESimproProjectSyncStrategy } from './sync.types';\n\nexport interface AXESimproRemotePartyRef {\n ID?: number;\n Name?: string | null;\n GivenName?: string | null;\n CompanyName?: string | null;\n}\n\nexport interface AXESimproRemoteAddress {\n Address?: string | null;\n City?: string | null;\n State?: string | null;\n PostalCode?: string | null;\n}\n\nexport interface AXESimproRemoteJob {\n ID: number;\n Name?: string | null;\n Description?: string | null;\n OrderNo?: string | null;\n RequestNo?: string | null;\n Type?: string | null;\n Stage?: string | { Name?: string } | null;\n DateIssued?: string | null;\n DueDate?: string | null;\n DueTime?: string | null;\n DateModified?: string | null;\n Status?: { ID?: number; Name?: string } | string | null;\n Customer?: AXESimproRemotePartyRef | string | null;\n Site?: AXESimproRemotePartyRef | string | null;\n}\n\nexport interface AXESimproRemoteCustomer {\n ID: number;\n GivenName?: string | null;\n FamilyName?: string | null;\n Title?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n Address?: AXESimproRemoteAddress | null;\n BillingAddress?: AXESimproRemoteAddress | null;\n}\n\nexport interface AXESimproRemoteSitePrimaryContact {\n CellPhone?: string | null;\n Email?: string | null;\n Contact?: { ID?: number } | null;\n}\n\nexport interface AXESimproRemoteSite {\n ID: number;\n Name?: string | null;\n Address?: AXESimproRemoteAddress | null;\n PrimaryContact?: AXESimproRemoteSitePrimaryContact | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXESimproPullJobsRequest {\n /** When set, pulls for this Simpro connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum Simpro 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 AXESimproPullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in Simpro. */\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 AXESimproImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXESimproProjectSyncStrategy;\n}\n\nexport interface AXESimproImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXESimproImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXESimproImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXESimproSyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXESimproConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXESimproConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ----- Simpro error codes -----\n\nexport const AXE_SIMPRO_ERROR_CODES = {\n COMPANY_ID_ZERO_MULTI: 'SIMPRO_COMPANY_ID_ZERO_MULTI',\n COMPANY_ID_INVALID: 'SIMPRO_COMPANY_ID_INVALID',\n} as const;\n\nexport type AXESimproErrorCode = (typeof AXE_SIMPRO_ERROR_CODES)[keyof typeof AXE_SIMPRO_ERROR_CODES];\n\n/** Client i18n keys for known Simpro error codes. */\nexport const AXE_SIMPRO_ERROR_I18N_KEYS: Record<AXESimproErrorCode, string> = {\n [AXE_SIMPRO_ERROR_CODES.COMPANY_ID_ZERO_MULTI]: '@extensions-simpro:errors.company-id-zero-multi',\n [AXE_SIMPRO_ERROR_CODES.COMPANY_ID_INVALID]: '@extensions-simpro:errors.company-id-invalid',\n};\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,mBAAmB;CAC1B;AAED,MAAM,WAAW,GAAG,iBAAiB;AAE9B,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QAAA,IAAI,EAAE,uBAAuB;AAC9B,KAAA;;AAGH;;ACjBA;AAKO,MAAM,uBAAuB,GAAsB;AACxD,IAAA,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC5B,IAAA,OAAO,EAAE,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,oBAAoB,GAAG;AAClC,IAAA,iBAAiB,EAAE,qCAAqC;AACxD,IAAA,uBAAuB,EAAE,2CAA2C;AACpE,IAAA,mBAAmB,EAAE,uCAAuC;AAC5D,IAAA,UAAU,EAA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AAa,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;AAgCA;;AChCA;AA8BA;;AC9BA;AA6HA;;AC7HA;AAEO,MAAM,sBAAsB,GAAG;AACpC,IAAA,qBAAqB,EAAE,8BAA8B;AACrD,IAAA,kBAAkB,EAAE,2BAA2B;;AAKjD;AACO,MAAM,0BAA0B,GAAuC;AAC5E,IAAA,CAAC,sBAAsB,CAAC,qBAAqB,GAAG,iDAAiD;AACjG,IAAA,CAAC,sBAAsB,CAAC,kBAAkB,GAAG,8CAA8C;;AAG7F;;ACfA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-simpro-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/simpro/contracts/src/root-config.ts","../../../../libs/extensions/project-management/simpro/contracts/src/manifest.ts","../../../../libs/extensions/project-management/simpro/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/simpro/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/simpro/contracts/src/simpro.errors.ts","../../../../libs/extensions/project-management/simpro/contracts/src/acorex-platform-extension-project-management-simpro-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-simpro',\n};\n\nconst MODULE_NAME = 'SimproExtension';\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 SimproExtensionManifest: 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 AXESimproCommandKeys = {\n ConnectionConnect: 'simpro-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'simpro-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'simpro-extension.Connection:Lifecycle',\n OAuthStart: 'simpro-extension.OAuth:Start',\n OAuthComplete: 'simpro-extension.OAuth:Complete',\n OAuthValidate: 'simpro-extension.OAuth:Validate',\n ProjectImportFromSimpro: 'simpro-extension.Project:ImportFromSimpro',\n CustomerImportFromSimpro: 'simpro-extension.Customer:ImportFromSimpro',\n ProjectSync: 'simpro-extension.Project:Sync',\n JobsPull: 'simpro-extension.Jobs:Pull',\n JobsRefresh: 'simpro-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXESimproMenuKeys = {\n SimproExtensionConfig: 'simpro-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 AXESimproPermissions = {\n SimproExtension: {\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 ---- Simpro tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped Simpro (cloud-only). */\nexport interface AXESimproConnectionConfig {\n /** Simpro multi-company ID (0 for single-company builds). */\n companyId?: number;\n /** OAuth2 client ID from the Simpro application key file. */\n clientId?: string;\n /** OAuth2 client secret from the Simpro application key file. */\n clientSecret?: string;\n /** Optional override when it differs from `{buildUrl}/oauth2/login`. */\n authorizationUrl?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from Simpro token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full Simpro token JSON response (mirrors legacy SimproJson). */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXESimproJobsSyncState;\n}\n\n/** Simpro job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXESimproJobsSyncState {\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 ---- Simpro OAuth API (client ↔ server) ----\n\nexport interface AXESimproOAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXESimproOAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXESimproOAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXESimproOAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXESimproOAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXESimproOAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote Simpro DTOs ----\n\nimport type { AXESimproProjectSyncStrategy } from './sync.types';\n\nexport interface AXESimproRemotePartyRef {\n ID?: number;\n Name?: string | null;\n GivenName?: string | null;\n CompanyName?: string | null;\n}\n\nexport interface AXESimproRemoteAddress {\n Address?: string | null;\n City?: string | null;\n State?: string | null;\n PostalCode?: string | null;\n}\n\nexport interface AXESimproRemoteJob {\n ID: number;\n Name?: string | null;\n Description?: string | null;\n OrderNo?: string | null;\n RequestNo?: string | null;\n Type?: string | null;\n Stage?: string | { Name?: string } | null;\n DateIssued?: string | null;\n DueDate?: string | null;\n DueTime?: string | null;\n DateModified?: string | null;\n Status?: { ID?: number; Name?: string } | string | null;\n Customer?: AXESimproRemotePartyRef | string | null;\n Site?: AXESimproRemotePartyRef | string | null;\n}\n\nexport interface AXESimproRemoteCustomer {\n ID: number;\n GivenName?: string | null;\n FamilyName?: string | null;\n Title?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n Address?: AXESimproRemoteAddress | null;\n BillingAddress?: AXESimproRemoteAddress | null;\n}\n\nexport interface AXESimproRemoteSitePrimaryContact {\n CellPhone?: string | null;\n Email?: string | null;\n Contact?: { ID?: number } | null;\n}\n\nexport interface AXESimproRemoteSite {\n ID: number;\n Name?: string | null;\n Address?: AXESimproRemoteAddress | null;\n PrimaryContact?: AXESimproRemoteSitePrimaryContact | null;\n}\n\n/** Subset of Simpro `/employees/` fields cached as `resourceType=employee`. */\nexport interface AXESimproRemoteEmployee {\n ID: number;\n Name?: string | null;\n Position?: string | null;\n DateOfBirth?: string | null;\n Archived?: boolean | null;\n Address?: (AXESimproRemoteAddress & { Country?: string | null }) | null;\n PrimaryContact?: {\n Email?: string | null;\n SecondaryEmail?: string | null;\n WorkPhone?: string | null;\n Extension?: string | null;\n CellPhone?: string | null;\n Fax?: string | null;\n PreferredNotificationMethod?: string | null;\n } | null;\n AccountSetup?: {\n Username?: string | null;\n IsMobility?: boolean | null;\n SecurityGroups?: Array<{ ID?: number; Name?: string | null }> | null;\n } | null;\n UserProfile?: Record<string, unknown> | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXESimproPullJobsRequest {\n /** When set, pulls for this Simpro connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum Simpro 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 AXESimproPullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in Simpro. */\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 AXESimproImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXESimproProjectSyncStrategy;\n}\n\nexport interface AXESimproImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXESimproImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXESimproImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXESimproSyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXESimproConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXESimproConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ----- Simpro error codes -----\n\nexport const AXE_SIMPRO_ERROR_CODES = {\n COMPANY_ID_ZERO_MULTI: 'SIMPRO_COMPANY_ID_ZERO_MULTI',\n COMPANY_ID_INVALID: 'SIMPRO_COMPANY_ID_INVALID',\n} as const;\n\nexport type AXESimproErrorCode = (typeof AXE_SIMPRO_ERROR_CODES)[keyof typeof AXE_SIMPRO_ERROR_CODES];\n\n/** Client i18n keys for known Simpro error codes. */\nexport const AXE_SIMPRO_ERROR_I18N_KEYS: Record<AXESimproErrorCode, string> = {\n [AXE_SIMPRO_ERROR_CODES.COMPANY_ID_ZERO_MULTI]: '@extensions-simpro:errors.company-id-zero-multi',\n [AXE_SIMPRO_ERROR_CODES.COMPANY_ID_INVALID]: '@extensions-simpro:errors.company-id-invalid',\n};\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,mBAAmB;CAC1B;AAED,MAAM,WAAW,GAAG,iBAAiB;AAE9B,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QA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Starting Simpro job pull.",
|
|
193
|
-
"fetching": "Fetching jobs, customers, and
|
|
193
|
+
"fetching": "Fetching jobs, customers, sites, and employees.",
|
|
194
194
|
"related-customers": "Loading related customers.",
|
|
195
195
|
"related-sites": "Loading related sites.",
|
|
196
196
|
"saving-jobs": "Saving jobs.",
|
|
197
197
|
"saving-customers": "Saving customers.",
|
|
198
198
|
"saving-sites": "Saving sites.",
|
|
199
|
+
"saving-employees": "Saving employees.",
|
|
199
200
|
"finishing": "Finishing sync.",
|
|
200
201
|
"skipped": "No modified jobs since last sync.",
|
|
201
202
|
"complete-full": "Full sync finished.",
|
|
@@ -190,12 +190,13 @@
|
|
|
190
190
|
"pull": {
|
|
191
191
|
"progress": {
|
|
192
192
|
"starting": "Starting Simpro job pull.",
|
|
193
|
-
"fetching": "Fetching jobs, customers, and
|
|
193
|
+
"fetching": "Fetching jobs, customers, sites, and employees.",
|
|
194
194
|
"related-customers": "Loading related customers.",
|
|
195
195
|
"related-sites": "Loading related sites.",
|
|
196
196
|
"saving-jobs": "Saving jobs.",
|
|
197
197
|
"saving-customers": "Saving customers.",
|
|
198
198
|
"saving-sites": "Saving sites.",
|
|
199
|
+
"saving-employees": "Saving employees.",
|
|
199
200
|
"finishing": "Finishing sync.",
|
|
200
201
|
"skipped": "No modified jobs since last sync.",
|
|
201
202
|
"complete-full": "Full sync finished.",
|
|
@@ -174,12 +174,13 @@
|
|
|
174
174
|
"pull": {
|
|
175
175
|
"progress": {
|
|
176
176
|
"starting": "در حال شروع دریافت کارها از Simpro.",
|
|
177
|
-
"fetching": "در حال دریافت کارها،
|
|
177
|
+
"fetching": "در حال دریافت کارها، مشتریها، سایتها و کارکنان.",
|
|
178
178
|
"related-customers": "در حال بارگذاری مشتریهای مرتبط.",
|
|
179
179
|
"related-sites": "در حال بارگذاری سایتهای مرتبط.",
|
|
180
180
|
"saving-jobs": "در حال ذخیره کارها.",
|
|
181
181
|
"saving-customers": "در حال ذخیره مشتریها.",
|
|
182
182
|
"saving-sites": "در حال ذخیره سایتها.",
|
|
183
|
+
"saving-employees": "در حال ذخیره کارکنان.",
|
|
183
184
|
"finishing": "در حال نهاییسازی همگامسازی.",
|
|
184
185
|
"skipped": "از همگامسازی قبلی تغییری نبود.",
|
|
185
186
|
"complete-full": "همگامسازی کامل تمام شد.",
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/extension-project-management-simpro-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@acorex-platform/extension-project-management-core-client": "
|
|
6
|
+
"@acorex-platform/extension-project-management-core-client": "2.0.0-next.1",
|
|
7
7
|
"@angular/common": "^21.0.0 || ^22.0.0",
|
|
8
8
|
"@angular/core": "^21.0.0 || ^22.0.0"
|
|
9
9
|
},
|
|
@@ -190,6 +190,35 @@ interface AXESimproRemoteSite {
|
|
|
190
190
|
Address?: AXESimproRemoteAddress | null;
|
|
191
191
|
PrimaryContact?: AXESimproRemoteSitePrimaryContact | null;
|
|
192
192
|
}
|
|
193
|
+
/** Subset of Simpro `/employees/` fields cached as `resourceType=employee`. */
|
|
194
|
+
interface AXESimproRemoteEmployee {
|
|
195
|
+
ID: number;
|
|
196
|
+
Name?: string | null;
|
|
197
|
+
Position?: string | null;
|
|
198
|
+
DateOfBirth?: string | null;
|
|
199
|
+
Archived?: boolean | null;
|
|
200
|
+
Address?: (AXESimproRemoteAddress & {
|
|
201
|
+
Country?: string | null;
|
|
202
|
+
}) | null;
|
|
203
|
+
PrimaryContact?: {
|
|
204
|
+
Email?: string | null;
|
|
205
|
+
SecondaryEmail?: string | null;
|
|
206
|
+
WorkPhone?: string | null;
|
|
207
|
+
Extension?: string | null;
|
|
208
|
+
CellPhone?: string | null;
|
|
209
|
+
Fax?: string | null;
|
|
210
|
+
PreferredNotificationMethod?: string | null;
|
|
211
|
+
} | null;
|
|
212
|
+
AccountSetup?: {
|
|
213
|
+
Username?: string | null;
|
|
214
|
+
IsMobility?: boolean | null;
|
|
215
|
+
SecurityGroups?: Array<{
|
|
216
|
+
ID?: number;
|
|
217
|
+
Name?: string | null;
|
|
218
|
+
}> | null;
|
|
219
|
+
} | null;
|
|
220
|
+
UserProfile?: Record<string, unknown> | null;
|
|
221
|
+
}
|
|
193
222
|
interface AXESimproPullJobsRequest {
|
|
194
223
|
/** When set, pulls for this Simpro connection (required for multi-connection schedules). */
|
|
195
224
|
connectionId?: string;
|
|
@@ -208,7 +237,7 @@ interface AXESimproPullJobsResponse {
|
|
|
208
237
|
skipped?: boolean;
|
|
209
238
|
/** Whether this run used incremental or full snapshot mode. */
|
|
210
239
|
syncMode?: 'incremental' | 'full';
|
|
211
|
-
/** Per data-type upsert counts (jobs / customers / sites). */
|
|
240
|
+
/** Per data-type upsert counts (jobs / customers / sites / employees). */
|
|
212
241
|
byResourceType?: {
|
|
213
242
|
job?: {
|
|
214
243
|
upserted: number;
|
|
@@ -222,6 +251,10 @@ interface AXESimproPullJobsResponse {
|
|
|
222
251
|
upserted: number;
|
|
223
252
|
deactivated: number;
|
|
224
253
|
};
|
|
254
|
+
employee?: {
|
|
255
|
+
upserted: number;
|
|
256
|
+
deactivated: number;
|
|
257
|
+
};
|
|
225
258
|
};
|
|
226
259
|
}
|
|
227
260
|
interface AXESimproImportJobRequest {
|
|
@@ -260,4 +293,4 @@ type AXESimproErrorCode = (typeof AXE_SIMPRO_ERROR_CODES)[keyof typeof AXE_SIMPR
|
|
|
260
293
|
declare const AXE_SIMPRO_ERROR_I18N_KEYS: Record<AXESimproErrorCode, string>;
|
|
261
294
|
|
|
262
295
|
export { AXESimproCommandKeys, AXESimproMenuKeys, AXESimproPermissions, AXE_SIMPRO_ERROR_CODES, AXE_SIMPRO_ERROR_I18N_KEYS, AXPAdministrationPermissionKeys, RootConfig, SimproExtensionManifest };
|
|
263
|
-
export type { AXESimproConnectionConfig, AXESimproConnectionLifecycleRequest, AXESimproConnectionLifecycleResponse, AXESimproErrorCode, AXESimproImportCustomerRequest, AXESimproImportCustomerResponse, AXESimproImportJobRequest, AXESimproImportJobResponse, AXESimproJobsSyncState, AXESimproOAuthCompleteRequest, AXESimproOAuthCompleteResponse, AXESimproOAuthStartRequest, AXESimproOAuthStartResponse, AXESimproOAuthValidateRequest, AXESimproOAuthValidateResponse, AXESimproPullJobsRequest, AXESimproPullJobsResponse, AXESimproRemoteAddress, AXESimproRemoteCustomer, AXESimproRemoteJob, AXESimproRemotePartyRef, AXESimproRemoteSite, AXESimproRemoteSitePrimaryContact, AXESimproSyncPlatformProjectRequest };
|
|
296
|
+
export type { AXESimproConnectionConfig, AXESimproConnectionLifecycleRequest, AXESimproConnectionLifecycleResponse, AXESimproErrorCode, AXESimproImportCustomerRequest, AXESimproImportCustomerResponse, AXESimproImportJobRequest, AXESimproImportJobResponse, AXESimproJobsSyncState, AXESimproOAuthCompleteRequest, AXESimproOAuthCompleteResponse, AXESimproOAuthStartRequest, AXESimproOAuthStartResponse, AXESimproOAuthValidateRequest, AXESimproOAuthValidateResponse, AXESimproPullJobsRequest, AXESimproPullJobsResponse, AXESimproRemoteAddress, AXESimproRemoteCustomer, AXESimproRemoteEmployee, AXESimproRemoteJob, AXESimproRemotePartyRef, AXESimproRemoteSite, AXESimproRemoteSitePrimaryContact, AXESimproSyncPlatformProjectRequest };
|