@acorex-platform/extension-project-management-simpro-client 0.0.30 → 0.0.32

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,4 +1,4 @@
1
- import { AXP_INTEGRATION_CONNECTION_STATUS, AXP_INTEGRATION_AUTH_METHOD_TYPE } from '@acorex-platform/framework-shared/core';
1
+ import { createRandomUuid, AXP_INTEGRATION_CONNECTION_STATUS, AXP_INTEGRATION_AUTH_METHOD_TYPE } from '@acorex-platform/framework-shared/core';
2
2
  import { AXMIntegrationConnectionManager, AXP_INTEGRATION_CREDENTIAL_MASK, toSafeIntegrationConnectionDto, isMaskedIntegrationCredential, hasConfiguredIntegrationCredentials } from '@acorex-platform/module-integration-management-client';
3
3
  import { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';
4
4
  import { AXTranslationService } from '@acorex/core/translation';
@@ -46,7 +46,7 @@ class ConnectSimproCommand {
46
46
  const isReconfigure = !!existing;
47
47
  const existingConfig = (existing?.config ?? {});
48
48
  const connectionKey = existing?.connectionKey
49
- ?? (trim(input.connectionKey) || crypto.randomUUID());
49
+ ?? (trim(input.connectionKey) || createRandomUuid());
50
50
  const title = await this.translationService.translateAsync(isReconfigure
51
51
  ? '@extensions-simpro:integration.connect.dialog.reconfigure-title'
52
52
  : '@extensions-simpro:integration.connect.dialog.title');
@@ -268,4 +268,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
268
268
  }] });
269
269
 
270
270
  export { ConnectSimproCommand };
271
- //# sourceMappingURL=acorex-platform-extension-project-management-simpro-client-connect-simpro.command-BPDls4Yt.mjs.map
271
+ //# sourceMappingURL=acorex-platform-extension-project-management-simpro-client-connect-simpro.command-DyuvQLNr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-project-management-simpro-client-connect-simpro.command-DyuvQLNr.mjs","sources":["../../../../libs/extensions/project-management/simpro/client/src/lib/features/connect/simpro-build-url.util.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/connect/connect-simpro.command.ts"],"sourcesContent":["//#region ---- Simpro build URL validation ----\n\n/** Rejects common misconfiguration (OAuth callback URL pasted as build URL). */\nexport function validateSimproBuildUrl(raw: string): string | null {\n const buildUrl = raw.trim().replace(/\\/+$/, '');\n if (!buildUrl) {\n return 'Simpro build URL is required.';\n }\n\n if (buildUrl.includes('/integrations/oauth/callback')) {\n return 'Use your Simpro site URL (e.g. https://your-build.simprosuite.com), not the OAuth callback URL.';\n }\n\n try {\n const parsed = new URL(buildUrl);\n if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {\n return 'Build URL must be your Simpro cloud site, not localhost.';\n }\n } catch {\n return 'Build URL must be a valid URL (e.g. https://enterprise-sandbox-au.simprosuite.com).';\n }\n\n return null;\n}\n\n//#endregion\n","//#region ---- Connect Simpro (OAuth authorization code) ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n createRandomUuid,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n AXP_INTEGRATION_CREDENTIAL_MASK,\n hasConfiguredIntegrationCredentials,\n isMaskedIntegrationCredential,\n toSafeIntegrationConnectionDto,\n type ConnectCommandResult,\n} from '@acorex-platform/module-integration-management-client';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n type IFormFieldBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXESimproOAuthHttpClient } from '../../api/simpro-oauth-http.client';\nimport { resolveSimproCommandError } from '../../api/simpro-command-error.util';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, isEmpty, trim } from 'lodash-es';\nimport type { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport type { AXMIntegrationManagementIntegrationConnectionEntityModel } from '@acorex-platform/module-integration-management-client/contracts';\nimport { buildIntegrationOAuthCallbackUrl } from '@acorex-platform/module-integration-management-client/contracts';\nimport { validateSimproBuildUrl } from './simpro-build-url.util';\n\nexport interface ConnectSimproCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n /** When set, reconfigure / reconnect this existing connection. */\n connectionId?: string;\n /** Optional explicit key; new connections get a generated key when omitted. */\n connectionKey?: string;\n}\n\ninterface AXESimproConnectFormContext {\n displayName: string;\n buildUrl: string;\n companyIdText: string;\n clientId: string;\n clientSecret: string;\n}\n\ninterface AXESimproConnectFormResult {\n displayName: string;\n buildUrl: string;\n companyId: number;\n clientId: string;\n clientSecret: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectSimproCommand implements AXPCommand<ConnectSimproCommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly simproHttp = inject(AXESimproOAuthHttpClient);\n\n async execute(input: ConnectSimproCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'simpro';\n const connectionScope = input.connectionScope ?? 'tenant';\n const existing = await this.resolveExistingConnection(providerId, connectionScope, input);\n const isReconfigure = !!existing;\n const existingConfig = (existing?.config ?? {}) as AXESimproConnectionConfig;\n const connectionKey =\n existing?.connectionKey\n ?? (trim(input.connectionKey) || createRandomUuid());\n\n const title = await this.translationService.translateAsync(\n isReconfigure\n ? '@extensions-simpro:integration.connect.dialog.reconfigure-title'\n : '@extensions-simpro:integration.connect.dialog.title',\n );\n\n const form = await this.openConnectDialog({\n title: title ?? 'Connect Simpro',\n context: {\n displayName: existing?.displayName ?? 'Simpro',\n buildUrl: existing?.instanceUrl ?? '',\n companyIdText: String(existingConfig.companyId ?? 0),\n clientId: existingConfig.clientId ?? '',\n clientSecret: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n },\n existing,\n existingConfig,\n isReconfigure,\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const credentialsChanged = this.credentialsChanged(existing, existingConfig, form);\n const needsAuthorization = this.needsOAuthAuthorization(existingConfig, credentialsChanged);\n\n const config: AXESimproConnectionConfig = {\n companyId: form.companyId,\n clientId: form.clientId,\n clientSecret: form.clientSecret,\n ...(credentialsChanged\n ? {}\n : {\n accessToken: existingConfig.accessToken,\n refreshToken: existingConfig.refreshToken,\n tokenExpiresAt: existingConfig.tokenExpiresAt,\n oauthTokenJson: existingConfig.oauthTokenJson,\n authorizationUrl: existingConfig.authorizationUrl,\n }),\n };\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n connectionScope,\n connectionKey,\n displayName: defaultTo(trim(form.displayName), 'Simpro'),\n instanceUrl: form.buildUrl,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: config as Record<string, unknown>,\n status: needsAuthorization\n ? AXP_INTEGRATION_CONNECTION_STATUS.PendingAuthorization\n : AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n if (needsAuthorization) {\n // App-agnostic: Simpro uses a fixed registered redirect URI (ignores authorize redirect_uri).\n const redirectUri = buildIntegrationOAuthCallbackUrl(window.location.origin, providerId);\n const oauth = await this.simproHttp.startOAuth({\n redirectUri,\n connectionId: connection.id,\n });\n return { success: true, kind: 'object',\n data: { outcome: 'redirect', redirectUrl: oauth.redirectUrl },\n };\n }\n\n const validation = await this.simproHttp.validateOAuth({ connectionId: connection.id });\n if (!validation.valid) {\n return {\n success: false,\n message: { text: validation.message ?? 'Simpro connection validation failed. Re-authorize Simpro.' },\n };\n }\n\n const refreshed = await this.connectionManager.getByIdForCurrentUser(connection.id);\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(refreshed ?? connection),\n },\n };\n } catch (error: unknown) {\n const resolved = await resolveSimproCommandError(\n this.translationService,\n error,\n '@extensions-simpro:errors.connect-failed',\n );\n return { success: false, message: { text: resolved.messageKeyOrText } };\n }\n }\n\n private async resolveExistingConnection(\n providerId: string,\n connectionScope: AXPIntegrationConnectionScope,\n input: ConnectSimproCommandInput,\n ): Promise<AXMIntegrationManagementIntegrationConnectionEntityModel | null> {\n if (input.connectionId) {\n const byId = await this.connectionManager.getByIdForCurrentUser(input.connectionId);\n if (!byId) {\n throw new Error('Connection not found or access denied.');\n }\n return byId;\n }\n\n const connectionKey = trim(input.connectionKey);\n if (!connectionKey) {\n return null;\n }\n\n return this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey,\n });\n }\n\n private credentialsChanged(\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null,\n existingConfig: AXESimproConnectionConfig,\n form: AXESimproConnectFormResult,\n ): boolean {\n if (!existing) {\n return true;\n }\n if (trim(form.buildUrl) !== trim(existing.instanceUrl ?? '')) {\n return true;\n }\n if (trim(form.clientId) !== trim(existingConfig.clientId ?? '')) {\n return true;\n }\n if (!isMaskedIntegrationCredential(form.clientSecret)) {\n return true;\n }\n return false;\n }\n\n private needsOAuthAuthorization(\n existingConfig: AXESimproConnectionConfig,\n credentialsChanged: boolean,\n ): boolean {\n if (credentialsChanged) {\n return true;\n }\n return isEmpty(trim(existingConfig.refreshToken ?? ''));\n }\n\n private async openConnectDialog(input: {\n title: string;\n context: AXESimproConnectFormContext;\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null;\n existingConfig: AXESimproConnectionConfig;\n isReconfigure: boolean;\n }): Promise<AXESimproConnectFormResult | null> {\n const result: unknown = await this.layoutBuilder\n .create()\n .dialog<AXESimproConnectFormResult | null>((dialog: IDialogBuilder<AXESimproConnectFormResult | null>) => {\n dialog\n .setTitle(input.title)\n .setSize('md')\n .setCloseButton(true)\n .setContext({ ...input.context })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: '@extensions-simpro:integration.connect.instructions',\n })\n .formField('@extensions-simpro:integration.connect.fields.display-name', (field: IFormFieldBuilder) => {\n field.path('displayName');\n field.textBox({\n placeholder: '@extensions-simpro:integration.connect.placeholders.display-name',\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.build-url.label', (field) => {\n field.path('buildUrl');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.build-url.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.company-id.label', (field) => {\n field.path('companyIdText');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.company-id.placeholder',\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.client-id.label', (field) => {\n field.path('clientId');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.client-id.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.client-secret.label', (field) => {\n field.path('clientSecret');\n field.passwordBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.client-secret.placeholder',\n revealToggle: true,\n validations: input.isReconfigure ? [] : [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(\n input.isReconfigure && hasConfiguredIntegrationCredentials(input.existing)\n ? '@extensions-simpro:integration.connect.actions.save'\n : '@extensions-simpro:integration.connect.actions.save-and-authorize',\n );\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n\n const ctx = ref.context() as AXESimproConnectFormContext;\n const buildUrl = trim(ctx.buildUrl).replace(/\\/+$/, '');\n const buildUrlError = validateSimproBuildUrl(buildUrl);\n if (buildUrlError) {\n throw new Error(buildUrlError);\n }\n\n const clientId = trim(ctx.clientId);\n if (!clientId) {\n throw new Error('Simpro client ID is required.');\n }\n\n let clientSecret = trim(ctx.clientSecret);\n if (isMaskedIntegrationCredential(clientSecret) && input.existing) {\n clientSecret = trim(input.existingConfig.clientSecret ?? '');\n }\n if (!clientSecret) {\n throw new Error('Simpro client secret is required.');\n }\n\n const companyId = Number(trim(ctx.companyIdText));\n return {\n displayName: trim(ctx.displayName) || 'Simpro',\n buildUrl,\n companyId: Number.isFinite(companyId) ? companyId : 0,\n clientId,\n clientSecret,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXESimproConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAEA;AACM,SAAU,sBAAsB,CAAC,GAAW,EAAA;AAChD,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC/C,IAAI,CAAC,QAAQ,EAAE;AACb,QAAA,OAAO,+BAA+B;IACxC;AAEA,IAAA,IAAI,QAAQ,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE;AACrD,QAAA,OAAO,iGAAiG;IAC1G;AAEA,IAAA,IAAI;AACF,QAAA,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC;AAChC,QAAA,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,KAAK,WAAW,EAAE;AACtE,YAAA,OAAO,0DAA0D;QACnE;IACF;AAAE,IAAA,MAAM;AACN,QAAA,OAAO,qFAAqF;IAC9F;AAEA,IAAA,OAAO,IAAI;AACb;AAEA;;MCsCa,oBAAoB,CAAA;AADjC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC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B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,oBAAoB,cADP,MAAM,EAAA,CAAA,CAAA;;2FACnB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
@@ -2,17 +2,18 @@ import { AXMIntegrationManagementModule } from '@acorex-platform/module-integrat
2
2
  import { AXPIntegrationRuntimeService, AXP_INTEGRATION_SECRET_STORE, AXPSettingsService, AXP_INTEGRATION_RUNTIME_PROVIDER, AXP_INTEGRATION_CONNECTION_LIFECYCLE, AXP_MENU_PROVIDER, AXP_INTEGRATION_PROVIDER } from '@acorex-platform/framework-client/common';
3
3
  import { AXP_LOGO_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER } from '@acorex-platform/framework-client/core';
4
4
  import { AXPEntityService, ensureListActions, actionExists, AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';
5
- import { AXPCommandService, provideCommandSetups } from '@acorex-platform/framework-client/runtime';
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, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
8
8
  import { AXESimproCommandKeys, RootConfig as RootConfig$2, AXPAdministrationPermissionKeys, AXESimproMenuKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';
9
9
  import { AXE_PM_INTEGRATION_PROVIDER_SIMPRO } from '@acorex-platform/extension-project-management-core-client/contracts';
10
10
  import { RootConfig } from '@acorex-platform/module-project-management-client/contracts';
11
- import { AXPSystemActionType, AXPWidgetsList, AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CAPABILITY, AXPRegionalSetting, AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';
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
13
  import { RootConfig as RootConfig$1 } from '@acorex-platform/module-customer-management-client/contracts';
14
14
  import { AXFormatService } from '@acorex/core/format';
15
15
  import { trim, defaultTo } from 'lodash-es';
16
+ import { AXPBackgroundJobQueryKeys } from '@acorex-platform/framework-shared/background-job';
16
17
  import { AXPCommonMenuKeys } from '@acorex-platform/module-common-client/contracts';
17
18
 
18
19
  const AXE_SIMPRO_EXPRESSION_SCOPE = 'SimproExtension';
@@ -218,6 +219,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
218
219
 
219
220
  //#region ---- Simpro integration settings badges ----
220
221
  const SIMPRO_I18N = '@extensions-simpro:integration.badges';
222
+ /** Must match `SIMPRO_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */
223
+ const SIMPRO_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'simpro-extension.jobs.pull';
221
224
  async function formatSyncTimestamp(iso, formatService, settingsService) {
222
225
  const parsed = Date.parse(iso);
223
226
  if (!Number.isFinite(parsed)) {
@@ -228,30 +231,75 @@ async function formatSyncTimestamp(iso, formatService, settingsService) {
228
231
  const format = `${dateFormat} ${timeFormat}`.trim();
229
232
  return formatService.format(new Date(parsed), 'datetime', { format });
230
233
  }
231
- async function resolveSimproConnectionSettingsBadges(ctx, formatService, settingsService) {
234
+ function isFailureNewer(schedule) {
235
+ const failed = schedule.lastFailureAt ? Date.parse(schedule.lastFailureAt) : NaN;
236
+ const succeeded = schedule.lastSuccessAt ? Date.parse(schedule.lastSuccessAt) : NaN;
237
+ if (!Number.isFinite(failed)) {
238
+ return false;
239
+ }
240
+ if (!Number.isFinite(succeeded)) {
241
+ return true;
242
+ }
243
+ return failed >= succeeded;
244
+ }
245
+ async function resolveSimproConnectionSettingsBadges(ctx, formatService, settingsService, schedule) {
232
246
  const config = (ctx.connection.config ?? {});
233
247
  const jobsSync = config.jobsSync;
234
248
  const lastSync = config.jobsSync?.lastSyncAt?.trim() ||
235
249
  (typeof jobsSync?.['lastSuccessfulSyncAt'] === 'string' ? jobsSync['lastSuccessfulSyncAt'].trim() : '');
250
+ const badges = [];
236
251
  if (!lastSync) {
237
- return [
238
- {
239
- labelKey: `${SIMPRO_I18N}.never-synced`,
240
- color: 'warning',
241
- },
242
- ];
252
+ badges.push({
253
+ labelKey: `${SIMPRO_I18N}.never-synced`,
254
+ color: 'warning',
255
+ });
243
256
  }
244
- const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);
245
- if (!datetime) {
246
- return [];
257
+ else {
258
+ const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);
259
+ if (datetime) {
260
+ badges.push({
261
+ labelKey: `${SIMPRO_I18N}.last-sync`,
262
+ params: { datetime },
263
+ color: 'success',
264
+ });
265
+ }
247
266
  }
248
- return [
249
- {
250
- labelKey: `${SIMPRO_I18N}.last-sync`,
251
- params: { datetime },
252
- color: 'success',
253
- },
254
- ];
267
+ if (!schedule) {
268
+ return badges;
269
+ }
270
+ if (schedule.status === 'pause') {
271
+ badges.push({
272
+ labelKey: `${SIMPRO_I18N}.schedule-paused`,
273
+ color: 'warning',
274
+ });
275
+ }
276
+ else if (schedule.status === 'disabled') {
277
+ badges.push({
278
+ labelKey: `${SIMPRO_I18N}.schedule-disabled`,
279
+ color: 'warning',
280
+ });
281
+ }
282
+ if (schedule.nextRunAt) {
283
+ const datetime = await formatSyncTimestamp(schedule.nextRunAt, formatService, settingsService);
284
+ if (datetime) {
285
+ badges.push({
286
+ labelKey: `${SIMPRO_I18N}.next-run`,
287
+ params: { datetime },
288
+ color: 'secondary',
289
+ });
290
+ }
291
+ }
292
+ if (isFailureNewer(schedule) && schedule.lastFailureAt) {
293
+ const datetime = await formatSyncTimestamp(schedule.lastFailureAt, formatService, settingsService);
294
+ if (datetime) {
295
+ badges.push({
296
+ labelKey: `${SIMPRO_I18N}.last-failure`,
297
+ params: { datetime },
298
+ color: 'danger',
299
+ });
300
+ }
301
+ }
302
+ return badges;
255
303
  }
256
304
  //#endregion
257
305
 
@@ -261,12 +309,13 @@ class AXESimproIntegrationRuntimeProvider {
261
309
  this.secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });
262
310
  this.formatService = inject(AXFormatService);
263
311
  this.settingsService = inject(AXPSettingsService);
312
+ this.queryService = inject(AXPQueryService, { optional: true });
264
313
  }
265
314
  async getHooks() {
266
315
  return {
267
316
  validateConnection: (ctx) => this.validateConnection(ctx),
268
317
  createClient: (ctx) => this.createClient(ctx),
269
- getConnectionSettingsBadges: (ctx) => resolveSimproConnectionSettingsBadges(ctx, this.formatService, this.settingsService),
318
+ getConnectionSettingsBadges: async (ctx) => resolveSimproConnectionSettingsBadges(ctx, this.formatService, this.settingsService, await this.loadPullSchedule(ctx.connection.id)),
270
319
  };
271
320
  }
272
321
  async validateConnection(ctx) {
@@ -324,6 +373,21 @@ class AXESimproIntegrationRuntimeProvider {
324
373
  }
325
374
  return { clientId, clientSecret };
326
375
  }
376
+ async loadPullSchedule(connectionId) {
377
+ if (!this.queryService || !connectionId.trim()) {
378
+ return null;
379
+ }
380
+ try {
381
+ const result = await this.queryService.fetch(AXPBackgroundJobQueryKeys.ScheduleGetByScope, {
382
+ commandKey: SIMPRO_PULL_JOBS_SCHEDULE_COMMAND_KEY,
383
+ connectionId,
384
+ });
385
+ return runtimeQueryPayloadData(result) ?? null;
386
+ }
387
+ catch {
388
+ return null;
389
+ }
390
+ }
327
391
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXESimproIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
328
392
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXESimproIntegrationRuntimeProvider }); }
329
393
  }
@@ -460,7 +524,7 @@ class AXESimproExtensionModule {
460
524
  provideCommandSetups([
461
525
  {
462
526
  key: AXESimproCommandKeys.ConnectionConnect,
463
- command: () => import('./acorex-platform-extension-project-management-simpro-client-connect-simpro.command-BPDls4Yt.mjs').then((c) => c.ConnectSimproCommand),
527
+ command: () => import('./acorex-platform-extension-project-management-simpro-client-connect-simpro.command-DyuvQLNr.mjs').then((c) => c.ConnectSimproCommand),
464
528
  },
465
529
  {
466
530
  key: AXESimproCommandKeys.ConnectionCompleteOAuth,
@@ -490,7 +554,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
490
554
  provideCommandSetups([
491
555
  {
492
556
  key: AXESimproCommandKeys.ConnectionConnect,
493
- command: () => import('./acorex-platform-extension-project-management-simpro-client-connect-simpro.command-BPDls4Yt.mjs').then((c) => c.ConnectSimproCommand),
557
+ command: () => import('./acorex-platform-extension-project-management-simpro-client-connect-simpro.command-DyuvQLNr.mjs').then((c) => c.ConnectSimproCommand),
494
558
  },
495
559
  {
496
560
  key: AXESimproCommandKeys.ConnectionCompleteOAuth,
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-project-management-simpro-client.mjs","sources":["../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/simpro-expression-scope.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/simpro-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/project-simpro.entity-modifier.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/customer-management/customer-simpro.entity-modifier.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo-key.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.integration.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.integration-runtime.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/manifest.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/simpro-extension.module.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-mark.paths.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo.component.ts","../../../../libs/extensions/project-management/simpro/client/src/acorex-platform-extension-project-management-simpro-client.ts"],"sourcesContent":["export const AXE_SIMPRO_EXPRESSION_SCOPE = 'SimproExtension';\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_SIMPRO } 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_SIMPRO_EXPRESSION_SCOPE } from './simpro-expression-scope';\n\n//#endregion\n\nexport class AXESimproProjectLinkExpressionEvaluatorScopeProvider 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_SIMPRO_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_SIMPRO;\n },\n hasSimproConnection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'simpro', 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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SIMPRO_EXPRESSION_SCOPE } from './simpro-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXESimproCommandKeys.ProjectImportFromSimpro,\n title: '@extensions-simpro:actions.import-from-simpro.title',\n command: { name: AXESimproCommandKeys.ProjectImportFromSimpro },\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: AXESimproCommandKeys.ProjectSync,\n title: '@extensions-simpro:actions.sync.title',\n command: {\n name: AXESimproCommandKeys.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_SIMPRO_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds Simpro import/sync actions to ProjectManagement.Project views. */\nexport const AXESimproProjectEntityModifier: 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, AXESimproCommandKeys.ProjectImportFromSimpro)) {\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, AXESimproCommandKeys.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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-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: AXESimproCommandKeys.CustomerImportFromSimpro,\n title: '@extensions-simpro:actions.import-from-simpro.title',\n command: { name: AXESimproCommandKeys.CustomerImportFromSimpro },\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 Simpro import action to CustomerManagement.Customer list views. */\nexport const AXESimproCustomerEntityModifier: 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.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, AXESimproCommandKeys.CustomerImportFromSimpro)) {\n listActions.push(buildImportAction());\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 ---- Simpro logo registry key ----\n\nexport const axpSimproLogoKey = 'simpro' as const;\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 { AXESimproCommandKeys, RootConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { axpSimproLogoKey } from '../brand/simpro-logo-key';\n\n@Injectable()\nexport class AXESimproIntegrationProvider 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: 'simpro',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpSimproLogoKey,\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: AXESimproCommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXESimproCommandKeys.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 ---- Simpro 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 { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\n\nconst SIMPRO_I18N = '@extensions-simpro:integration.badges';\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\nexport async function resolveSimproConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXESimproConnectionConfig;\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 if (!lastSync) {\n return [\n {\n labelKey: `${SIMPRO_I18N}.never-synced`,\n color: 'warning',\n },\n ];\n }\n\n const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);\n if (!datetime) {\n return [];\n }\n\n return [\n {\n labelKey: `${SIMPRO_I18N}.last-sync`,\n params: { datetime },\n color: 'success',\n },\n ];\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\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 { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-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 { resolveSimproConnectionSettingsBadges } from './simpro-integration-settings-badges.util';\n\n@Injectable()\nexport class AXESimproIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'simpro';\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\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n createClient: (ctx) => this.createClient(ctx),\n getConnectionSettingsBadges: (ctx) =>\n resolveSimproConnectionSettingsBadges(ctx, this.formatService, this.settingsService),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n const buildUrl = trim(defaultTo(ctx.instanceUrl, ''));\n if (!buildUrl) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Simpro build URL is missing on the connection.',\n };\n }\n\n if (!this.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Simpro client ID and client secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: buildUrl,\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 AXESimproConnectionConfig;\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 AXESimproConnectionConfig;\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('Simpro 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('Simpro connection has no usable client credentials.');\n }\n\n return { clientId, clientSecret };\n }\n}\n\nexport const provideSimproIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXESimproIntegrationRuntimeProvider,\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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXESimproConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'simpro';\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(AXESimproCommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideSimproConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXESimproConnectionLifecycleHandler,\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 { axpSimproLogoKey } from './simpro-logo-key';\n\nconst simproLogoProvider: AXPLogoProvider = {\n key: axpSimproLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'component',\n load: () => import('./simpro-logo.component').then((module) => module.AXESimproLogoComponent),\n inputs: {\n appearance: request.appearance,\n size: request.size,\n },\n }),\n};\n\nexport const AXE_SIMPRO_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: simproLogoProvider,\n multi: true,\n} as const;\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\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 ---- 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 AXESimproMenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-simpro-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXESimproMenuProvider 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(AXESimproMenuKeys.SimproExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXESimproMenuKeys.SimproExtensionConfig,\n text: '@extensions-simpro: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, AXP_MODULE_MANIFEST_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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { AXESimproProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/simpro-project-link-expression-evaluator-scope.provider';\nimport { AXESimproProjectEntityModifier } from './features/project-management/project-simpro.entity-modifier';\nimport { AXESimproCustomerEntityModifier } from './features/customer-management/customer-simpro.entity-modifier';\nimport { AXESimproIntegrationProvider } from './integration/simpro.integration.provider';\nimport { provideSimproIntegrationRuntimeProvider } from './integration/simpro.integration-runtime.provider';\nimport { provideSimproConnectionLifecycleHandler } from './integration/simpro.connection-lifecycle.handler';\nimport { AXE_SIMPRO_LOGO_PROVIDER } from './brand/simpro-logo.provider';\nimport { SimproExtensionManifest } from './manifest';\nimport { AXESimproMenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SIMPRO_LOGO_PROVIDER,\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: SimproExtensionManifest, multi: true },\n { provide: AXP_MENU_PROVIDER, useClass: AXESimproMenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXESimproProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXESimproCustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXESimproProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXESimproIntegrationProvider, multi: true },\n provideSimproIntegrationRuntimeProvider,\n provideSimproConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXESimproCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-simpro.command').then((c) => c.ConnectSimproCommand),\n },\n {\n key: AXESimproCommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-simpro-oauth.command').then((c) => c.CompleteSimproOAuthCommand),\n },\n ]),\n ],\n})\nexport class AXESimproExtensionModule {}\n\n//#endregion\n","//#region ---- Simpro mark vector paths ----\n\nexport const AXE_SIMPRO_MARK_BLUE = '#00338D';\nexport const AXE_SIMPRO_MARK_GOLD = '#FFCC00';\n\nexport const AXE_SIMPRO_MARK_PATH = 'M12 4.2C12.5 4.2 12.5 8.6 13.6 9.2C14.7 9.9 18.5 7.6 18.8 8.1C19 8.6 15.2 10.7 15.2 12C15.2 13.3 19 15.4 18.8 15.9C18.5 16.4 14.7 14.1 13.6 14.8C12.5 15.4 12.5 19.8 12 19.8C11.5 19.8 11.5 15.4 10.4 14.8C9.3 14.1 5.5 16.4 5.2 15.9C5 15.4 8.8 13.3 8.8 12C8.8 10.7 5 8.6 5.2 8.1C5.5 7.6 9.3 9.9 10.4 9.2C11.5 8.6 11.5 4.2 12 4.2Z';\n\n//#endregion\n","import type { AXPLogoAppearance } from '@acorex-platform/framework-client/core';\nimport { Component, computed, input, ChangeDetectionStrategy } from '@angular/core';\nimport { AXE_SIMPRO_MARK_BLUE, AXE_SIMPRO_MARK_GOLD, AXE_SIMPRO_MARK_PATH } from './simpro-mark.paths';\n\n//#region ---- Simpro brand logo (owned by Simpro extension) ----\n\n@Component({\n selector: 'axe-simpro-logo',\n host: { class: 'inline-flex items-center justify-center' },\n changeDetection: ChangeDetectionStrategy.Eager,\n template: `\n @switch (resolvedAppearance()) {\n @case ('monochrome') {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"currentColor\" />\n <path fill=\"#fff\" [attr.d]=\"markPath\" />\n </svg>\n }\n @default {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"12\" [attr.fill]=\"markBlue\" />\n <path [attr.fill]=\"markGold\" [attr.d]=\"markPath\" />\n </svg>\n }\n }\n `,\n})\nexport class AXESimproLogoComponent {\n appearance = input<AXPLogoAppearance>('colored');\n size = input(20);\n\n protected readonly markPath = AXE_SIMPRO_MARK_PATH;\n protected readonly markBlue = AXE_SIMPRO_MARK_BLUE;\n protected readonly markGold = AXE_SIMPRO_MARK_GOLD;\n\n protected readonly resolvedAppearance = computed(() => {\n const value = this.appearance();\n return value === 'monochrome' ? 'monochrome' : 'colored';\n });\n}\n\n//#endregion\n","/**\n * Generated bundle index.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CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,YAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,cAAA,EAAA,yCAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAjBvB;;;;;;;;;;;;;;;AAeT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,KAAA,EAAA,CAAA,CAAA;;2FAEU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBArBlC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,yCAAyC,EAAE;oBAC1D,eAAe,EAAE,uBAAuB,CAAC,KAAK;AAC9C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;AAeT,EAAA,CAAA;AACF,iBAAA;;;;;;;;AC1BD;;AAEG;;;;"}
1
+ {"version":3,"file":"acorex-platform-extension-project-management-simpro-client.mjs","sources":["../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/simpro-expression-scope.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/simpro-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/project-management/project-simpro.entity-modifier.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/customer-management/customer-simpro.entity-modifier.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo-key.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.integration.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.integration-runtime.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/integration/simpro.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/manifest.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/simpro-extension.module.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-mark.paths.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/brand/simpro-logo.component.ts","../../../../libs/extensions/project-management/simpro/client/src/acorex-platform-extension-project-management-simpro-client.ts"],"sourcesContent":["export const AXE_SIMPRO_EXPRESSION_SCOPE = 'SimproExtension';\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_SIMPRO } 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_SIMPRO_EXPRESSION_SCOPE } from './simpro-expression-scope';\n\n//#endregion\n\nexport class AXESimproProjectLinkExpressionEvaluatorScopeProvider 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_SIMPRO_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_SIMPRO;\n },\n hasSimproConnection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'simpro', 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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SIMPRO_EXPRESSION_SCOPE } from './simpro-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXESimproCommandKeys.ProjectImportFromSimpro,\n title: '@extensions-simpro:actions.import-from-simpro.title',\n command: { name: AXESimproCommandKeys.ProjectImportFromSimpro },\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: AXESimproCommandKeys.ProjectSync,\n title: '@extensions-simpro:actions.sync.title',\n command: {\n name: AXESimproCommandKeys.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_SIMPRO_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds Simpro import/sync actions to ProjectManagement.Project views. */\nexport const AXESimproProjectEntityModifier: 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, AXESimproCommandKeys.ProjectImportFromSimpro)) {\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, AXESimproCommandKeys.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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-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: AXESimproCommandKeys.CustomerImportFromSimpro,\n title: '@extensions-simpro:actions.import-from-simpro.title',\n command: { name: AXESimproCommandKeys.CustomerImportFromSimpro },\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 Simpro import action to CustomerManagement.Customer list views. */\nexport const AXESimproCustomerEntityModifier: 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.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, AXESimproCommandKeys.CustomerImportFromSimpro)) {\n listActions.push(buildImportAction());\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 ---- Simpro logo registry key ----\n\nexport const axpSimproLogoKey = 'simpro' as const;\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 { AXESimproCommandKeys, RootConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { axpSimproLogoKey } from '../brand/simpro-logo-key';\n\n@Injectable()\nexport class AXESimproIntegrationProvider 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: 'simpro',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpSimproLogoKey,\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: AXESimproCommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXESimproCommandKeys.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 ---- Simpro 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 { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\n\nconst SIMPRO_I18N = '@extensions-simpro:integration.badges';\n\n/** Must match `SIMPRO_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const SIMPRO_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'simpro-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 resolveSimproConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXESimproConnectionConfig;\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: `${SIMPRO_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: `${SIMPRO_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: `${SIMPRO_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${SIMPRO_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: `${SIMPRO_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: `${SIMPRO_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 { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-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 resolveSimproConnectionSettingsBadges,\n SIMPRO_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './simpro-integration-settings-badges.util';\n\n@Injectable()\nexport class AXESimproIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'simpro';\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 resolveSimproConnectionSettingsBadges(\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 const buildUrl = trim(defaultTo(ctx.instanceUrl, ''));\n if (!buildUrl) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Simpro build URL is missing on the connection.',\n };\n }\n\n if (!this.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'Simpro client ID and client secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: buildUrl,\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 AXESimproConnectionConfig;\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 AXESimproConnectionConfig;\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('Simpro 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('Simpro 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: SIMPRO_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideSimproIntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXESimproIntegrationRuntimeProvider,\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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXESimproConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'simpro';\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(AXESimproCommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideSimproConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXESimproConnectionLifecycleHandler,\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 { axpSimproLogoKey } from './simpro-logo-key';\n\nconst simproLogoProvider: AXPLogoProvider = {\n key: axpSimproLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'component',\n load: () => import('./simpro-logo.component').then((module) => module.AXESimproLogoComponent),\n inputs: {\n appearance: request.appearance,\n size: request.size,\n },\n }),\n};\n\nexport const AXE_SIMPRO_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: simproLogoProvider,\n multi: true,\n} as const;\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\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 ---- 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 AXESimproMenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-simpro-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXESimproMenuProvider 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(AXESimproMenuKeys.SimproExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXESimproMenuKeys.SimproExtensionConfig,\n text: '@extensions-simpro: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, AXP_MODULE_MANIFEST_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 { AXESimproCommandKeys } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport { AXESimproProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/simpro-project-link-expression-evaluator-scope.provider';\nimport { AXESimproProjectEntityModifier } from './features/project-management/project-simpro.entity-modifier';\nimport { AXESimproCustomerEntityModifier } from './features/customer-management/customer-simpro.entity-modifier';\nimport { AXESimproIntegrationProvider } from './integration/simpro.integration.provider';\nimport { provideSimproIntegrationRuntimeProvider } from './integration/simpro.integration-runtime.provider';\nimport { provideSimproConnectionLifecycleHandler } from './integration/simpro.connection-lifecycle.handler';\nimport { AXE_SIMPRO_LOGO_PROVIDER } from './brand/simpro-logo.provider';\nimport { SimproExtensionManifest } from './manifest';\nimport { AXESimproMenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SIMPRO_LOGO_PROVIDER,\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: SimproExtensionManifest, multi: true },\n { provide: AXP_MENU_PROVIDER, useClass: AXESimproMenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXESimproProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXESimproCustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXESimproProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXESimproIntegrationProvider, multi: true },\n provideSimproIntegrationRuntimeProvider,\n provideSimproConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXESimproCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-simpro.command').then((c) => c.ConnectSimproCommand),\n },\n {\n key: AXESimproCommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-simpro-oauth.command').then((c) => c.CompleteSimproOAuthCommand),\n },\n ]),\n ],\n})\nexport class AXESimproExtensionModule {}\n\n//#endregion\n","//#region ---- Simpro mark vector paths ----\n\nexport const AXE_SIMPRO_MARK_BLUE = '#00338D';\nexport const AXE_SIMPRO_MARK_GOLD = '#FFCC00';\n\nexport const AXE_SIMPRO_MARK_PATH = 'M12 4.2C12.5 4.2 12.5 8.6 13.6 9.2C14.7 9.9 18.5 7.6 18.8 8.1C19 8.6 15.2 10.7 15.2 12C15.2 13.3 19 15.4 18.8 15.9C18.5 16.4 14.7 14.1 13.6 14.8C12.5 15.4 12.5 19.8 12 19.8C11.5 19.8 11.5 15.4 10.4 14.8C9.3 14.1 5.5 16.4 5.2 15.9C5 15.4 8.8 13.3 8.8 12C8.8 10.7 5 8.6 5.2 8.1C5.5 7.6 9.3 9.9 10.4 9.2C11.5 8.6 11.5 4.2 12 4.2Z';\n\n//#endregion\n","import type { AXPLogoAppearance } from '@acorex-platform/framework-client/core';\nimport { Component, computed, input, ChangeDetectionStrategy } from '@angular/core';\nimport { AXE_SIMPRO_MARK_BLUE, AXE_SIMPRO_MARK_GOLD, AXE_SIMPRO_MARK_PATH } from './simpro-mark.paths';\n\n//#region ---- Simpro brand logo (owned by Simpro extension) ----\n\n@Component({\n selector: 'axe-simpro-logo',\n host: { class: 'inline-flex items-center justify-center' },\n changeDetection: ChangeDetectionStrategy.Eager,\n template: `\n @switch (resolvedAppearance()) {\n @case ('monochrome') {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"currentColor\" />\n <path fill=\"#fff\" [attr.d]=\"markPath\" />\n </svg>\n }\n @default {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <circle cx=\"12\" cy=\"12\" r=\"12\" [attr.fill]=\"markBlue\" />\n <path [attr.fill]=\"markGold\" [attr.d]=\"markPath\" />\n </svg>\n }\n }\n `,\n})\nexport class AXESimproLogoComponent {\n appearance = input<AXPLogoAppearance>('colored');\n size = input(20);\n\n protected readonly markPath = AXE_SIMPRO_MARK_PATH;\n protected readonly markBlue = AXE_SIMPRO_MARK_BLUE;\n protected readonly markGold = AXE_SIMPRO_MARK_GOLD;\n\n protected readonly resolvedAppearance = computed(() => {\n const value = this.appearance();\n return value === 'monochrome' ? 'monochrome' : 'colored';\n });\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","buildImportAction","CustomerRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;AAAO,MAAM,2BAA2B,GAAG,iBAAiB;;ACA5D;AAWA;MAEa,oDAAoD,CAAA;AAAjE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;IA2B5E;IAzBE,MAAM,OAAO,CAAC,OAAmD,EAAA;AAC/D,QAAA,OAAO,CAAC,QAAQ,CAAC,2BAA2B,EAAE;AAC5C,YAAA,cAAc,EAAE,OAAO,oBAA8B,KAAsB;AACzE,gBAAA,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,KAAK,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE;gBACrG,IAAI,CAAC,iBAAiB,EAAE;AACtB,oBAAA,OAAO,KAAK;gBACd;AAEA,gBAAA,MAAM,OAAO,IAAI,MAAM,IAAI,CAAC;AACzB,qBAAA,UAAU,CAACA,UAAY,CAAC,MAAM,CAAC,IAAI,EAAEA,UAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;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AE,KAAK,EAAE,yCAAyC,EAAE;oBAC1D,eAAe,EAAE,uBAAuB,CAAC,KAAK;AAC9C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;AAeT,EAAA,CAAA;AACF,iBAAA;;;;;;;;AC1BD;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-project-management-simpro-client",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
- "@acorex-platform/extension-project-management-core-client": "0.0.30",
6
+ "@acorex-platform/extension-project-management-core-client": "0.0.32",
7
7
  "@angular/common": "^21.0.0 || ^22.0.0",
8
8
  "@angular/core": "^21.0.0 || ^22.0.0"
9
9
  },
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-platform-extension-project-management-simpro-client-connect-simpro.command-BPDls4Yt.mjs","sources":["../../../../libs/extensions/project-management/simpro/client/src/lib/features/connect/simpro-build-url.util.ts","../../../../libs/extensions/project-management/simpro/client/src/lib/features/connect/connect-simpro.command.ts"],"sourcesContent":["//#region ---- Simpro build URL validation ----\n\n/** Rejects common misconfiguration (OAuth callback URL pasted as build URL). */\nexport function validateSimproBuildUrl(raw: string): string | null {\n const buildUrl = raw.trim().replace(/\\/+$/, '');\n if (!buildUrl) {\n return 'Simpro build URL is required.';\n }\n\n if (buildUrl.includes('/integrations/oauth/callback')) {\n return 'Use your Simpro site URL (e.g. https://your-build.simprosuite.com), not the OAuth callback URL.';\n }\n\n try {\n const parsed = new URL(buildUrl);\n if (parsed.hostname === 'localhost' || parsed.hostname === '127.0.0.1') {\n return 'Build URL must be your Simpro cloud site, not localhost.';\n }\n } catch {\n return 'Build URL must be a valid URL (e.g. https://enterprise-sandbox-au.simprosuite.com).';\n }\n\n return null;\n}\n\n//#endregion\n","//#region ---- Connect Simpro (OAuth authorization code) ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n AXP_INTEGRATION_CREDENTIAL_MASK,\n hasConfiguredIntegrationCredentials,\n isMaskedIntegrationCredential,\n toSafeIntegrationConnectionDto,\n type ConnectCommandResult,\n} from '@acorex-platform/module-integration-management-client';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n type IFormFieldBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXESimproOAuthHttpClient } from '../../api/simpro-oauth-http.client';\nimport { resolveSimproCommandError } from '../../api/simpro-command-error.util';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, isEmpty, trim } from 'lodash-es';\nimport type { AXESimproConnectionConfig } from '@acorex-platform/extension-project-management-simpro-client/contracts';\nimport type { AXMIntegrationManagementIntegrationConnectionEntityModel } from '@acorex-platform/module-integration-management-client/contracts';\nimport { buildIntegrationOAuthCallbackUrl } from '@acorex-platform/module-integration-management-client/contracts';\nimport { validateSimproBuildUrl } from './simpro-build-url.util';\n\nexport interface ConnectSimproCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n /** When set, reconfigure / reconnect this existing connection. */\n connectionId?: string;\n /** Optional explicit key; new connections get a generated key when omitted. */\n connectionKey?: string;\n}\n\ninterface AXESimproConnectFormContext {\n displayName: string;\n buildUrl: string;\n companyIdText: string;\n clientId: string;\n clientSecret: string;\n}\n\ninterface AXESimproConnectFormResult {\n displayName: string;\n buildUrl: string;\n companyId: number;\n clientId: string;\n clientSecret: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectSimproCommand implements AXPCommand<ConnectSimproCommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly simproHttp = inject(AXESimproOAuthHttpClient);\n\n async execute(input: ConnectSimproCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'simpro';\n const connectionScope = input.connectionScope ?? 'tenant';\n const existing = await this.resolveExistingConnection(providerId, connectionScope, input);\n const isReconfigure = !!existing;\n const existingConfig = (existing?.config ?? {}) as AXESimproConnectionConfig;\n const connectionKey =\n existing?.connectionKey\n ?? (trim(input.connectionKey) || crypto.randomUUID());\n\n const title = await this.translationService.translateAsync(\n isReconfigure\n ? '@extensions-simpro:integration.connect.dialog.reconfigure-title'\n : '@extensions-simpro:integration.connect.dialog.title',\n );\n\n const form = await this.openConnectDialog({\n title: title ?? 'Connect Simpro',\n context: {\n displayName: existing?.displayName ?? 'Simpro',\n buildUrl: existing?.instanceUrl ?? '',\n companyIdText: String(existingConfig.companyId ?? 0),\n clientId: existingConfig.clientId ?? '',\n clientSecret: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n },\n existing,\n existingConfig,\n isReconfigure,\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const credentialsChanged = this.credentialsChanged(existing, existingConfig, form);\n const needsAuthorization = this.needsOAuthAuthorization(existingConfig, credentialsChanged);\n\n const config: AXESimproConnectionConfig = {\n companyId: form.companyId,\n clientId: form.clientId,\n clientSecret: form.clientSecret,\n ...(credentialsChanged\n ? {}\n : {\n accessToken: existingConfig.accessToken,\n refreshToken: existingConfig.refreshToken,\n tokenExpiresAt: existingConfig.tokenExpiresAt,\n oauthTokenJson: existingConfig.oauthTokenJson,\n authorizationUrl: existingConfig.authorizationUrl,\n }),\n };\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n connectionScope,\n connectionKey,\n displayName: defaultTo(trim(form.displayName), 'Simpro'),\n instanceUrl: form.buildUrl,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: config as Record<string, unknown>,\n status: needsAuthorization\n ? AXP_INTEGRATION_CONNECTION_STATUS.PendingAuthorization\n : AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n if (needsAuthorization) {\n // App-agnostic: Simpro uses a fixed registered redirect URI (ignores authorize redirect_uri).\n const redirectUri = buildIntegrationOAuthCallbackUrl(window.location.origin, providerId);\n const oauth = await this.simproHttp.startOAuth({\n redirectUri,\n connectionId: connection.id,\n });\n return { success: true, kind: 'object',\n data: { outcome: 'redirect', redirectUrl: oauth.redirectUrl },\n };\n }\n\n const validation = await this.simproHttp.validateOAuth({ connectionId: connection.id });\n if (!validation.valid) {\n return {\n success: false,\n message: { text: validation.message ?? 'Simpro connection validation failed. Re-authorize Simpro.' },\n };\n }\n\n const refreshed = await this.connectionManager.getByIdForCurrentUser(connection.id);\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(refreshed ?? connection),\n },\n };\n } catch (error: unknown) {\n const resolved = await resolveSimproCommandError(\n this.translationService,\n error,\n '@extensions-simpro:errors.connect-failed',\n );\n return { success: false, message: { text: resolved.messageKeyOrText } };\n }\n }\n\n private async resolveExistingConnection(\n providerId: string,\n connectionScope: AXPIntegrationConnectionScope,\n input: ConnectSimproCommandInput,\n ): Promise<AXMIntegrationManagementIntegrationConnectionEntityModel | null> {\n if (input.connectionId) {\n const byId = await this.connectionManager.getByIdForCurrentUser(input.connectionId);\n if (!byId) {\n throw new Error('Connection not found or access denied.');\n }\n return byId;\n }\n\n const connectionKey = trim(input.connectionKey);\n if (!connectionKey) {\n return null;\n }\n\n return this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey,\n });\n }\n\n private credentialsChanged(\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null,\n existingConfig: AXESimproConnectionConfig,\n form: AXESimproConnectFormResult,\n ): boolean {\n if (!existing) {\n return true;\n }\n if (trim(form.buildUrl) !== trim(existing.instanceUrl ?? '')) {\n return true;\n }\n if (trim(form.clientId) !== trim(existingConfig.clientId ?? '')) {\n return true;\n }\n if (!isMaskedIntegrationCredential(form.clientSecret)) {\n return true;\n }\n return false;\n }\n\n private needsOAuthAuthorization(\n existingConfig: AXESimproConnectionConfig,\n credentialsChanged: boolean,\n ): boolean {\n if (credentialsChanged) {\n return true;\n }\n return isEmpty(trim(existingConfig.refreshToken ?? ''));\n }\n\n private async openConnectDialog(input: {\n title: string;\n context: AXESimproConnectFormContext;\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null;\n existingConfig: AXESimproConnectionConfig;\n isReconfigure: boolean;\n }): Promise<AXESimproConnectFormResult | null> {\n const result: unknown = await this.layoutBuilder\n .create()\n .dialog<AXESimproConnectFormResult | null>((dialog: IDialogBuilder<AXESimproConnectFormResult | null>) => {\n dialog\n .setTitle(input.title)\n .setSize('md')\n .setCloseButton(true)\n .setContext({ ...input.context })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: '@extensions-simpro:integration.connect.instructions',\n })\n .formField('@extensions-simpro:integration.connect.fields.display-name', (field: IFormFieldBuilder) => {\n field.path('displayName');\n field.textBox({\n placeholder: '@extensions-simpro:integration.connect.placeholders.display-name',\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.build-url.label', (field) => {\n field.path('buildUrl');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.build-url.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.company-id.label', (field) => {\n field.path('companyIdText');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.company-id.placeholder',\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.client-id.label', (field) => {\n field.path('clientId');\n field.textBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.client-id.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-simpro:integration.auth.oauth.client-secret.label', (field) => {\n field.path('clientSecret');\n field.passwordBox({\n placeholder: '@extensions-simpro:integration.auth.oauth.client-secret.placeholder',\n revealToggle: true,\n validations: input.isReconfigure ? [] : [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(\n input.isReconfigure && hasConfiguredIntegrationCredentials(input.existing)\n ? '@extensions-simpro:integration.connect.actions.save'\n : '@extensions-simpro:integration.connect.actions.save-and-authorize',\n );\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n\n const ctx = ref.context() as AXESimproConnectFormContext;\n const buildUrl = trim(ctx.buildUrl).replace(/\\/+$/, '');\n const buildUrlError = validateSimproBuildUrl(buildUrl);\n if (buildUrlError) {\n throw new Error(buildUrlError);\n }\n\n const clientId = trim(ctx.clientId);\n if (!clientId) {\n throw new Error('Simpro client ID is required.');\n }\n\n let clientSecret = trim(ctx.clientSecret);\n if (isMaskedIntegrationCredential(clientSecret) && input.existing) {\n clientSecret = trim(input.existingConfig.clientSecret ?? '');\n }\n if (!clientSecret) {\n throw new Error('Simpro client secret is required.');\n }\n\n const companyId = Number(trim(ctx.companyIdText));\n return {\n displayName: trim(ctx.displayName) || 'Simpro',\n buildUrl,\n companyId: Number.isFinite(companyId) ? companyId : 0,\n clientId,\n clientSecret,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXESimproConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAEA;AACM,SAAU,sBAAsB,CAAC,GAAW,EAAA;AAChD,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,E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