@acorex-platform/extension-project-management-servicem8-client 0.0.33 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-complete-servicem8-oauth.command-CepIVvQD.mjs.map +1 -1
- package/fesm2022/{acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-3MmHke4f.mjs → acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs} +3 -13
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-servicem8-oauth-http.client-CsrgXYgR.mjs.map +1 -1
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client.mjs +2 -2
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client.mjs.map +1 -1
- package/package.json +2 -2
- package/fesm2022/acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-3MmHke4f.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-complete-servicem8-oauth.command-CepIVvQD.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/connect/complete-servicem8-oauth.command.ts"],"sourcesContent":["//#region ---- Complete ServiceM8 OAuth callback ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPRuntimeCommandResult, AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXP_INTEGRATION_CONNECTION_ESTABLISHED } from '@acorex-platform/framework-client/common';\nimport {\n AXMIntegrationConnectionManager,\n toSafeIntegrationConnectionDto,\n} from '@acorex-platform/module-integration-management-client';\nimport { AXEServiceM8OAuthHttpClient } from '../../api/servicem8-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\n\nexport interface CompleteServiceM8OAuthCommandInput {\n state: string;\n code: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CompleteServiceM8OAuthCommand\n implements AXPCommand<CompleteServiceM8OAuthCommandInput, AXPSafeIntegrationConnectionDto>\n{\n private readonly http = inject(AXEServiceM8OAuthHttpClient);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly establishedHandlers = inject(AXP_INTEGRATION_CONNECTION_ESTABLISHED, { optional: true });\n\n async execute(\n input: CompleteServiceM8OAuthCommandInput,\n ): AXPCommandExecuteResultPromise<AXPSafeIntegrationConnectionDto> {\n try {\n const { connectionId } = await this.http.completeOAuth({\n state: input.state,\n code: input.code,\n });\n\n const connection = await this.connectionManager.getByIdForCurrentUser(connectionId);\n if (!connection) {\n return { success: false, message: { text: 'Connection not found after ServiceM8 OAuth callback.' } };\n }\n\n const safe = toSafeIntegrationConnectionDto(connection);\n await this.dispatchEstablished(safe);\n return { success: true, kind: 'object', data: safe };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'ServiceM8 OAuth callback failed.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async dispatchEstablished(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n const list = this.establishedHandlers ?? [];\n for (const handler of list) {\n const resolved = handler instanceof Promise ? await handler : handler;\n if (resolved.providerId === connection.providerId) {\n await resolved.onEstablished(connection);\n }\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;MAkBa,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAC1C,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;QAC3D,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,sCAAsC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAkC1G,IAAA;IAhCC,MAAM,O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F;8GAtCW,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,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,6BAA6B,cADhB,MAAM,EAAA,CAAA,CAAA;;2FACnB,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-complete-servicem8-oauth.command-CepIVvQD.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/connect/complete-servicem8-oauth.command.ts"],"sourcesContent":["//#region ---- Complete ServiceM8 OAuth callback ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPRuntimeCommandResult, AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXP_INTEGRATION_CONNECTION_ESTABLISHED } from '@acorex-platform/framework-client/common';\nimport {\n AXMIntegrationConnectionManager,\n toSafeIntegrationConnectionDto,\n} from '@acorex-platform/module-integration-management-client';\nimport { AXEServiceM8OAuthHttpClient } from '../../api/servicem8-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\n\nexport interface CompleteServiceM8OAuthCommandInput {\n state: string;\n code: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class CompleteServiceM8OAuthCommand\n implements AXPCommand<CompleteServiceM8OAuthCommandInput, AXPSafeIntegrationConnectionDto>\n{\n private readonly http = inject(AXEServiceM8OAuthHttpClient);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly establishedHandlers = inject(AXP_INTEGRATION_CONNECTION_ESTABLISHED, { optional: true });\n\n async execute(\n input: CompleteServiceM8OAuthCommandInput,\n ): AXPCommandExecuteResultPromise<AXPSafeIntegrationConnectionDto> {\n try {\n const { connectionId } = await this.http.completeOAuth({\n state: input.state,\n code: input.code,\n });\n\n const connection = await this.connectionManager.getByIdForCurrentUser(connectionId);\n if (!connection) {\n return { success: false, message: { text: 'Connection not found after ServiceM8 OAuth callback.' } };\n }\n\n const safe = toSafeIntegrationConnectionDto(connection);\n await this.dispatchEstablished(safe);\n return { success: true, kind: 'object', data: safe };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'ServiceM8 OAuth callback failed.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async dispatchEstablished(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n const list = this.establishedHandlers ?? [];\n for (const handler of list) {\n const resolved = handler instanceof Promise ? await handler : handler;\n if (resolved.providerId === connection.providerId) {\n await resolved.onEstablished(connection);\n }\n }\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;MAkBa,6BAA6B,CAAA;AAD1C,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAC1C,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;QAC3D,IAAA,CAAA,mBAAmB,GAAG,MAAM,CAAC,sCAAsC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAkC1G,IAAA;IAhCC,MAAM,OAAO,CACX,KAAyC,EAAA;AAEzC,QAAA,IAAI;YACF,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;gBACrD,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,IAAI,EAAE,KAAK,CAAC,IAAI;AACjB,aAAA,CAAC;YAEF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,YAAY,CAAC;YACnF,IAAI,CAAC,UAAU,EAAE;AACf,g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AAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createRandomUuid, AXP_INTEGRATION_CONNECTION_STATUS, AXP_INTEGRATION_AUTH_METHOD_TYPE } from '@acorex-platform/framework-shared/core';
|
|
2
|
-
import { AXPSessionService } from '@acorex-platform/framework-client/auth';
|
|
3
2
|
import { AXMIntegrationConnectionManager, AXP_INTEGRATION_CREDENTIAL_MASK, toSafeIntegrationConnectionDto, isMaskedIntegrationCredential, hasConfiguredIntegrationCredentials } from '@acorex-platform/module-integration-management-client';
|
|
4
3
|
import { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';
|
|
5
4
|
import { AXTranslationService } from '@acorex/core/translation';
|
|
@@ -8,21 +7,13 @@ import * as i0 from '@angular/core';
|
|
|
8
7
|
import { inject, Injectable } from '@angular/core';
|
|
9
8
|
import { trim, defaultTo, isEmpty } from 'lodash-es';
|
|
10
9
|
import { AXE_SERVICEM8_OAUTH_SCOPES, AXE_SERVICEM8_API_BASE_URL } from '@acorex-platform/extension-project-management-servicem8-client/contracts';
|
|
11
|
-
|
|
12
|
-
//#region ---- ServiceM8 OAuth helpers (client) ----
|
|
13
|
-
/** Resolves the demo app path segment used in the OAuth callback URL. */
|
|
14
|
-
function resolveServiceM8OAuthAppName(applicationName) {
|
|
15
|
-
const trimmed = String(applicationName ?? '').trim();
|
|
16
|
-
return trimmed || 'demo';
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
10
|
+
import { buildIntegrationOAuthCallbackUrl } from '@acorex-platform/module-integration-management-client/contracts';
|
|
19
11
|
|
|
20
12
|
class ConnectServiceM8Command {
|
|
21
13
|
constructor() {
|
|
22
14
|
this.connectionManager = inject(AXMIntegrationConnectionManager);
|
|
23
15
|
this.layoutBuilder = inject(AXPLayoutBuilderService);
|
|
24
16
|
this.translationService = inject(AXTranslationService);
|
|
25
|
-
this.sessionService = inject(AXPSessionService);
|
|
26
17
|
this.servicem8Http = inject(AXEServiceM8OAuthHttpClient);
|
|
27
18
|
}
|
|
28
19
|
async execute(input = {}) {
|
|
@@ -82,8 +73,7 @@ class ConnectServiceM8Command {
|
|
|
82
73
|
isDisabled: false,
|
|
83
74
|
});
|
|
84
75
|
if (needsAuthorization) {
|
|
85
|
-
const
|
|
86
|
-
const redirectUri = `${window.location.origin}/${appName}/integrations/oauth/callback/${providerId}`;
|
|
76
|
+
const redirectUri = buildIntegrationOAuthCallbackUrl(window.location.origin, providerId);
|
|
87
77
|
const oauth = await this.servicem8Http.startOAuth({
|
|
88
78
|
redirectUri,
|
|
89
79
|
connectionId: connection.id,
|
|
@@ -225,4 +215,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
225
215
|
}] });
|
|
226
216
|
|
|
227
217
|
export { ConnectServiceM8Command };
|
|
228
|
-
//# sourceMappingURL=acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-
|
|
218
|
+
//# sourceMappingURL=acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/connect/connect-servicem8.command.ts"],"sourcesContent":["//#region ---- Connect ServiceM8 (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 { AXEServiceM8OAuthHttpClient } from '../../api/servicem8-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, isEmpty, trim } from 'lodash-es';\nimport {\n AXE_SERVICEM8_API_BASE_URL,\n AXE_SERVICEM8_OAUTH_SCOPES,\n type AXEServiceM8ConnectionConfig,\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport {\n buildIntegrationOAuthCallbackUrl,\n type AXMIntegrationManagementIntegrationConnectionEntityModel,\n} from '@acorex-platform/module-integration-management-client/contracts';\n\nexport interface ConnectServiceM8CommandInput {\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 AXEServiceM8ConnectFormContext {\n displayName: string;\n clientId: string;\n clientSecret: string;\n}\n\ninterface AXEServiceM8ConnectFormResult {\n displayName: string;\n clientId: string;\n clientSecret: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectServiceM8Command implements AXPCommand<ConnectServiceM8CommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly servicem8Http = inject(AXEServiceM8OAuthHttpClient);\n\n async execute(input: ConnectServiceM8CommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'servicem8';\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 AXEServiceM8ConnectionConfig;\n const connectionKey =\n existing?.connectionKey\n ?? (trim(input.connectionKey) || createRandomUuid());\n\n const title = await this.translationService.translateAsync(\n isReconfigure\n ? '@extensions-servicem8:integration.connect.dialog.reconfigure-title'\n : '@extensions-servicem8:integration.connect.dialog.title',\n );\n\n const form = await this.openConnectDialog({\n title: title ?? 'Connect ServiceM8',\n context: {\n displayName: existing?.displayName ?? 'ServiceM8',\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(existingConfig, form);\n const needsAuthorization = this.needsOAuthAuthorization(existingConfig, credentialsChanged);\n\n const config: AXEServiceM8ConnectionConfig = {\n clientId: form.clientId,\n clientSecret: form.clientSecret,\n scope: AXE_SERVICEM8_OAUTH_SCOPES,\n ...(credentialsChanged\n ? {}\n : {\n accessToken: existingConfig.accessToken,\n refreshToken: existingConfig.refreshToken,\n tokenExpiresAt: existingConfig.tokenExpiresAt,\n oauthTokenJson: existingConfig.oauthTokenJson,\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), 'ServiceM8'),\n instanceUrl: AXE_SERVICEM8_API_BASE_URL,\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 const redirectUri = buildIntegrationOAuthCallbackUrl(window.location.origin, providerId);\n const oauth = await this.servicem8Http.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.servicem8Http.validateOAuth({ connectionId: connection.id });\n if (!validation.valid) {\n return {\n success: false,\n message: { text: validation.message ?? 'ServiceM8 connection validation failed. Re-authorize ServiceM8.' },\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 message = error instanceof Error ? error.message : 'Failed to connect ServiceM8.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async resolveExistingConnection(\n providerId: string,\n connectionScope: AXPIntegrationConnectionScope,\n input: ConnectServiceM8CommandInput,\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 existingConfig: AXEServiceM8ConnectionConfig,\n form: AXEServiceM8ConnectFormResult,\n ): boolean {\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: AXEServiceM8ConnectionConfig,\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: AXEServiceM8ConnectFormContext;\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null;\n existingConfig: AXEServiceM8ConnectionConfig;\n isReconfigure: boolean;\n }): Promise<AXEServiceM8ConnectFormResult | null> {\n const result: unknown = await this.layoutBuilder\n .create()\n .dialog<AXEServiceM8ConnectFormResult | null>((dialog: IDialogBuilder<AXEServiceM8ConnectFormResult | 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-servicem8:integration.connect.instructions',\n })\n .formField('@extensions-servicem8:integration.connect.fields.display-name', (field: IFormFieldBuilder) => {\n field.path('displayName');\n field.textBox({\n placeholder: '@extensions-servicem8:integration.connect.placeholders.display-name',\n });\n })\n .formField('@extensions-servicem8:integration.auth.oauth.client-id.label', (field) => {\n field.path('clientId');\n field.textBox({\n placeholder: '@extensions-servicem8:integration.auth.oauth.client-id.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-servicem8:integration.auth.oauth.client-secret.label', (field) => {\n field.path('clientSecret');\n field.passwordBox({\n placeholder: '@extensions-servicem8: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-servicem8:integration.connect.actions.save'\n : '@extensions-servicem8: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 AXEServiceM8ConnectFormContext;\n const clientId = trim(ctx.clientId);\n if (!clientId) {\n throw new Error('ServiceM8 App 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('ServiceM8 App Secret is required.');\n }\n\n return {\n displayName: trim(ctx.displayName) || 'ServiceM8',\n clientId,\n clientSecret,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXEServiceM8ConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;MA+Da,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;AAC3D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAuOrE,IAAA;AArOC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAsC,EAAE,EAAA;AACpD,QAAA,IAAI;AACF,YAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,WAAW;AAClD,YAAA,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,QAAQ;AACzD,YAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,CAAC;AACzF,YAAA,MAAM,aAAa,GAAG,CAAC,CAAC,QAAQ;YAChC,MAAM,cAAc,IAAI,QAAQ,EAAE,MAAM,IAAI,EAAE,CAAiC;AAC/E,YAAA,MAAM,aAAa,GACjB,QAAQ,EAAE;oBACN,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,gBAAgB,EAAE,CAAC;YAEtD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CACxD;AACE,kBAAE;kBACA,wDAAwD,CAC7D;AAED,YAAA,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,iBAA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AC;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAgC,MAAM,CAAC;IAChF;8GA1OW,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAvB,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,uBAAuB,cADV,MAAM,EAAA,CAAA,CAAA;;2FACnB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBADnC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
package/fesm2022/acorex-platform-extension-project-management-servicem8-client-contracts.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/servicem8/contracts/src/root-config.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/servicem8.constants.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/acorex-platform-extension-project-management-servicem8-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-servicem8',\n};\n\nconst MODULE_NAME = 'ServiceM8Extension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n title: `@${config.i18n}:integration.display-name`,\n icon: 'fa-light fa-briefcase',\n },\n};\n\n//#endregion\n","//#region ---- Command Keys ----\n\nexport const AXEServiceM8CommandKeys = {\n ConnectionConnect: 'servicem8-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'servicem8-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'servicem8-extension.Connection:Lifecycle',\n OAuthStart: 'servicem8-extension.OAuth:Start',\n OAuthComplete: 'servicem8-extension.OAuth:Complete',\n OAuthValidate: 'servicem8-extension.OAuth:Validate',\n ProjectImportFromServiceM8: 'servicem8-extension.Project:ImportFromServiceM8',\n CustomerImportFromServiceM8: 'servicem8-extension.Customer:ImportFromServiceM8',\n ProjectSync: 'servicem8-extension.Project:Sync',\n JobsPull: 'servicem8-extension.Jobs:Pull',\n JobsRefresh: 'servicem8-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEServiceM8MenuKeys = {\n ServiceM8ExtensionConfig: 'servicem8-extension:Menu:Configuration',\n} as const;\n\n//#endregion\n","//#region ---- Permission Keys ----\n\n/**\n * Administration capabilities used by this extension.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n ManageIntegrationActions: 'Administration:Permission:ManageIntegrationActions',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXEServiceM8Permissions = {\n ServiceM8Extension: {\n Management: AXPAdministrationPermissionKeys.MaintainConnections,\n Catalog: {\n View: AXPAdministrationPermissionKeys.ViewIntegrations,\n },\n ProjectImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n CustomerImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n ProjectSync: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n },\n} as const;\n\n//#endregion\n","//#region ---- ServiceM8 tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped ServiceM8. */\nexport interface AXEServiceM8ConnectionConfig {\n /** OAuth2 App ID from the ServiceM8 developer add-on. */\n clientId?: string;\n /** OAuth2 App Secret from the ServiceM8 developer add-on. */\n clientSecret?: string;\n /** Space-separated scopes granted at authorize time. */\n scope?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from ServiceM8 token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full ServiceM8 token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEServiceM8JobsSyncState;\n}\n\n/** ServiceM8 job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEServiceM8JobsSyncState {\n /** ISO timestamp — last successful job pull (incremental sync watermark). */\n lastSyncAt?: string;\n /** ISO timestamp — last full snapshot reconcile (deactivation pass). */\n lastFullReconcileAt?: string;\n}\n\n//#endregion\n","//#region ---- ServiceM8 OAuth API (client ↔ server) ----\n\nexport interface AXEServiceM8OAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEServiceM8OAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote ServiceM8 DTOs ----\n\nimport type { AXEServiceM8ProjectSyncStrategy } from './sync.types';\n\n/** Subset of ServiceM8 `job.json` fields used for cache / import / sync. */\nexport interface AXEServiceM8RemoteJob {\n uuid: string;\n generated_job_id?: string | null;\n job_description?: string | null;\n job_address?: string | null;\n status?: string | null;\n date?: string | null;\n edit_date?: string | null;\n company_uuid?: string | null;\n company_name?: string | null;\n purchase_order_number?: string | null;\n active?: number | boolean | null;\n billing_address?: string | null;\n work_done_description?: string | null;\n}\n\n/**\n * ServiceM8 company (client) — cached as `resourceType=customer`.\n * Includes ServiceM8 address fields plus optional Simpro-shaped aliases when present.\n */\nexport interface AXEServiceM8RemoteCustomer {\n uuid: string;\n name?: string | null;\n address?: string | null;\n address_street?: string | null;\n address_city?: string | null;\n address_state?: string | null;\n address_postcode?: string | null;\n address_country?: string | null;\n fax_number?: string | null;\n FamilyName?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 companycontact — cached as `resourceType=site`. */\nexport interface AXEServiceM8RemoteSite {\n uuid: string;\n company_uuid?: string | null;\n first?: string | null;\n last?: string | null;\n phone?: string | null;\n mobile?: string | null;\n email?: string | null;\n type?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEServiceM8PullJobsRequest {\n /** When set, pulls for this ServiceM8 connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum ServiceM8 jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental filter) and reconciles deactivations.\n * When false (default for schedules), pulls jobs modified since the last successful sync.\n */\n force?: boolean;\n}\n\nexport interface AXEServiceM8PullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in ServiceM8. */\n skipped?: boolean;\n /** Whether this run used incremental or full snapshot mode. */\n syncMode?: 'incremental' | 'full';\n /** Per data-type upsert counts (jobs / customers / sites). */\n byResourceType?: {\n job?: { upserted: number; deactivated: number };\n customer?: { upserted: number; deactivated: number };\n site?: { upserted: number; deactivated: number };\n };\n}\n\nexport interface AXEServiceM8ImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEServiceM8ProjectSyncStrategy;\n}\n\nexport interface AXEServiceM8ImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8ImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEServiceM8ImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8SyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEServiceM8ConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEServiceM8ConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- ServiceM8 API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (fixed host). */\nexport const AXE_SERVICEM8_OAUTH_AUTHORIZE_URL = 'https://go.servicem8.com/oauth/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_SERVICEM8_OAUTH_TOKEN_URL = 'https://go.servicem8.com/oauth/access_token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_SERVICEM8_API_BASE_URL = 'https://api.servicem8.com';\n\n/**\n * OAuth scopes for connect / authorize.\n * Space-separated; encoded as `scope=` query value by the OAuth start flow.\n */\nexport const AXE_SERVICEM8_OAUTH_SCOPES =\n 'read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,sBAAsB;CAC7B;AAED,MAAM,WAAW,GAAG,oBAAoB;AAEjC,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QAAA,IAAI,EAAE,uBAAuB;AAC9B,KAAA;;AAGH;;ACjBA;AAEO,MAAM,uBAAuB,GAAG;AACrC,IAAA,iBAAiB,EAAE,wCAAwC;AAC3D,IAAA,uBAAuB,EAAE,8CAA8C;AACvE,IAAA,mBAAmB,EAAE,0CAA0C;AAC/D,IAAA,UAAU,EAAE,iCAAiC;AAC7C,IAAA,aAAa,EAAE,oCAAoC;AACnD,IAAA,aAAa,EAAE,oCAAoC;AACnD,IAAA,0BAA0B,EAAE,iDAAiD;AAC7E,IAAA,2BAA2B,EAAE,kDAAkD;AAC/E,IAAA,WAAW,EAAE,kCAAkC;AAC/C,IAAA,QAAQ,EAAE,+BAA+B;AACzC,IAAA,WAAW,EAAE,kCAAkC;;AAGjD;;AChBA;AAEO,MAAM,oBAAoB,GAAG;AAClC,IAAA,wBAAwB,EAAE,wCAAwC;;AAGpE;;ACNA;AAEA;;;AAGG;AACI,MAAM,+BAA+B,GAAG;AAC7C,IAAA,MAAM,EAAE,kCAAkC;AAC1C,IAAA,qBAAqB,EAAE,iDAAiD;AACxE,IAAA,cAAc,EAAE,0CAA0C;AAC1D,IAAA,gB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-client-contracts.mjs","sources":["../../../../libs/extensions/project-management/servicem8/contracts/src/root-config.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/commands.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/menu.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/permission.keys.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/connection.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/oauth.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/project-sync.api.types.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/servicem8.constants.ts","../../../../libs/extensions/project-management/servicem8/contracts/src/acorex-platform-extension-project-management-servicem8-client-contracts.ts"],"sourcesContent":["//#region ---- Module Config ----\n\nconst config = {\n i18n: 'extensions-servicem8',\n};\n\nconst MODULE_NAME = 'ServiceM8Extension';\n\nexport const RootConfig = {\n config,\n module: {\n name: MODULE_NAME,\n title: `@${config.i18n}:integration.display-name`,\n icon: 'fa-light fa-briefcase',\n },\n};\n\n//#endregion\n","//#region ---- Command Keys ----\n\nexport const AXEServiceM8CommandKeys = {\n ConnectionConnect: 'servicem8-extension.Connection:Connect',\n ConnectionCompleteOAuth: 'servicem8-extension.Connection:CompleteOAuth',\n ConnectionLifecycle: 'servicem8-extension.Connection:Lifecycle',\n OAuthStart: 'servicem8-extension.OAuth:Start',\n OAuthComplete: 'servicem8-extension.OAuth:Complete',\n OAuthValidate: 'servicem8-extension.OAuth:Validate',\n ProjectImportFromServiceM8: 'servicem8-extension.Project:ImportFromServiceM8',\n CustomerImportFromServiceM8: 'servicem8-extension.Customer:ImportFromServiceM8',\n ProjectSync: 'servicem8-extension.Project:Sync',\n JobsPull: 'servicem8-extension.Jobs:Pull',\n JobsRefresh: 'servicem8-extension.Jobs:Refresh',\n} as const;\n\n//#endregion\n","//#region ---- Menu Keys ----\n\nexport const AXEServiceM8MenuKeys = {\n ServiceM8ExtensionConfig: 'servicem8-extension:Menu:Configuration',\n} as const;\n\n//#endregion\n","//#region ---- Permission Keys ----\n\n/**\n * Administration capabilities used by this extension.\n * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).\n */\nexport const AXPAdministrationPermissionKeys = {\n Access: 'Administration:Permission:Access',\n MaintainUsersAndRoles: 'Administration:Permission:MaintainUsersAndRoles',\n ManageSessions: 'Administration:Permission:ManageSessions',\n MaintainPolicies: 'Administration:Permission:MaintainPolicies',\n ViewIntegrations: 'Administration:Permission:ViewIntegrations',\n MaintainConnections: 'Administration:Permission:MaintainConnections',\n ManageIntegrationActions: 'Administration:Permission:ManageIntegrationActions',\n MaintainWorkflows: 'Administration:Permission:MaintainWorkflows',\n ManageWorkflowActions: 'Administration:Permission:ManageWorkflowActions',\n ViewRules: 'Administration:Permission:ViewRules',\n MaintainRules: 'Administration:Permission:MaintainRules',\n ManageRuleActions: 'Administration:Permission:ManageRuleActions',\n MaintainAi: 'Administration:Permission:MaintainAi',\n UseAiAssist: 'Administration:Permission:UseAiAssist',\n MaintainDashboards: 'Administration:Permission:MaintainDashboards',\n ViewJobs: 'Administration:Permission:ViewJobs',\n ManageJobActions: 'Administration:Permission:ManageJobActions',\n ViewObservability: 'Administration:Permission:ViewObservability',\n MaintainObservability: 'Administration:Permission:MaintainObservability',\n} as const;\n\n/**\n * @deprecated Prefer {@link AXPAdministrationPermissionKeys}.\n * Legacy nested shape kept so existing imports compile during migration.\n */\nexport const AXEServiceM8Permissions = {\n ServiceM8Extension: {\n Management: AXPAdministrationPermissionKeys.MaintainConnections,\n Catalog: {\n View: AXPAdministrationPermissionKeys.ViewIntegrations,\n },\n ProjectImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n CustomerImport: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n ProjectSync: {\n Execute: AXPAdministrationPermissionKeys.ManageIntegrationActions,\n },\n },\n} as const;\n\n//#endregion\n","//#region ---- ServiceM8 tenant connection config ----\n\n/** Stored on IntegrationManagement connection `config` for tenant-scoped ServiceM8. */\nexport interface AXEServiceM8ConnectionConfig {\n /** OAuth2 App ID from the ServiceM8 developer add-on. */\n clientId?: string;\n /** OAuth2 App Secret from the ServiceM8 developer add-on. */\n clientSecret?: string;\n /** Space-separated scopes granted at authorize time. */\n scope?: string;\n /** Current bearer token (authorization-code flow). */\n accessToken?: string;\n /** Refresh token from ServiceM8 token response. */\n refreshToken?: string;\n /** ISO timestamp when `accessToken` expires. */\n tokenExpiresAt?: string;\n /** Full ServiceM8 token JSON response. */\n oauthTokenJson?: string;\n /** Background job pull sync state (server-managed). */\n jobsSync?: AXEServiceM8JobsSyncState;\n}\n\n/** ServiceM8 job pull sync state stored on the tenant connection `config.jobsSync`. */\nexport interface AXEServiceM8JobsSyncState {\n /** ISO timestamp — last successful job pull (incremental sync watermark). */\n lastSyncAt?: string;\n /** ISO timestamp — last full snapshot reconcile (deactivation pass). */\n lastFullReconcileAt?: string;\n}\n\n//#endregion\n","//#region ---- ServiceM8 OAuth API (client ↔ server) ----\n\nexport interface AXEServiceM8OAuthStartRequest {\n redirectUri: string;\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthStartResponse {\n redirectUrl: string;\n state: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteRequest {\n state: string;\n code: string;\n}\n\nexport interface AXEServiceM8OAuthCompleteResponse {\n connectionId: string;\n}\n\nexport interface AXEServiceM8OAuthValidateRequest {\n connectionId?: string;\n}\n\nexport interface AXEServiceM8OAuthValidateResponse {\n valid: boolean;\n message?: string;\n}\n\n//#endregion\n","//#region ---- Remote ServiceM8 DTOs ----\n\nimport type { AXEServiceM8ProjectSyncStrategy } from './sync.types';\n\n/** Subset of ServiceM8 `job.json` fields used for cache / import / sync. */\nexport interface AXEServiceM8RemoteJob {\n uuid: string;\n generated_job_id?: string | null;\n job_description?: string | null;\n job_address?: string | null;\n status?: string | null;\n date?: string | null;\n edit_date?: string | null;\n company_uuid?: string | null;\n company_name?: string | null;\n purchase_order_number?: string | null;\n active?: number | boolean | null;\n billing_address?: string | null;\n work_done_description?: string | null;\n}\n\n/**\n * ServiceM8 company (client) — cached as `resourceType=customer`.\n * Includes ServiceM8 address fields plus optional Simpro-shaped aliases when present.\n */\nexport interface AXEServiceM8RemoteCustomer {\n uuid: string;\n name?: string | null;\n address?: string | null;\n address_street?: string | null;\n address_city?: string | null;\n address_state?: string | null;\n address_postcode?: string | null;\n address_country?: string | null;\n fax_number?: string | null;\n FamilyName?: string | null;\n Phone?: string | null;\n Email?: string | null;\n EIN?: string | null;\n CompanyName?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n/** ServiceM8 companycontact — cached as `resourceType=site`. */\nexport interface AXEServiceM8RemoteSite {\n uuid: string;\n company_uuid?: string | null;\n first?: string | null;\n last?: string | null;\n phone?: string | null;\n mobile?: string | null;\n email?: string | null;\n type?: string | null;\n active?: number | boolean | null;\n edit_date?: string | null;\n}\n\n//#endregion\n\n//#region ---- API request / response ----\n\nexport interface AXEServiceM8PullJobsRequest {\n /** When set, pulls for this ServiceM8 connection (required for multi-connection schedules). */\n connectionId?: string;\n /** Maximum ServiceM8 jobs to pull into the cache (default 250, max 1000). */\n maxJobs?: number;\n /**\n * When true, runs a full snapshot (no incremental filter) and reconciles deactivations.\n * When false (default for schedules), pulls jobs modified since the last successful sync.\n */\n force?: boolean;\n}\n\nexport interface AXEServiceM8PullJobsResponse {\n upserted: number;\n deactivated: number;\n /** True when incremental pull found no modified jobs in ServiceM8. */\n skipped?: boolean;\n /** Whether this run used incremental or full snapshot mode. */\n syncMode?: 'incremental' | 'full';\n /** Per data-type upsert counts (jobs / customers / sites). */\n byResourceType?: {\n job?: { upserted: number; deactivated: number };\n customer?: { upserted: number; deactivated: number };\n site?: { upserted: number; deactivated: number };\n };\n}\n\nexport interface AXEServiceM8ImportJobRequest {\n remoteRecordId: string;\n projectTypeId: string;\n syncStrategy: AXEServiceM8ProjectSyncStrategy;\n}\n\nexport interface AXEServiceM8ImportJobResponse {\n platformProjectId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8ImportCustomerRequest {\n remoteRecordId: string;\n}\n\nexport interface AXEServiceM8ImportCustomerResponse {\n platformCustomerId: string;\n created: boolean;\n}\n\nexport interface AXEServiceM8SyncPlatformProjectRequest {\n platformProjectId: string;\n}\n\nexport interface AXEServiceM8ConnectionLifecycleRequest {\n connectionId: string;\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled';\n}\n\nexport interface AXEServiceM8ConnectionLifecycleResponse {\n ok: true;\n}\n\n//#endregion\n","//#region ---- ServiceM8 API / OAuth constants ----\n\n/** Public OAuth authorize endpoint (fixed host). */\nexport const AXE_SERVICEM8_OAUTH_AUTHORIZE_URL = 'https://go.servicem8.com/oauth/authorize';\n\n/** Public OAuth token endpoint (authorization_code + refresh_token). */\nexport const AXE_SERVICEM8_OAUTH_TOKEN_URL = 'https://go.servicem8.com/oauth/access_token';\n\n/** REST API base URL stored on connection `instanceUrl`. */\nexport const AXE_SERVICEM8_API_BASE_URL = 'https://api.servicem8.com';\n\n/**\n * OAuth scopes for connect / authorize.\n * Space-separated; encoded as `scope=` query value by the OAuth start flow.\n */\nexport const AXE_SERVICEM8_OAUTH_SCOPES =\n 'read_customers read_jobs read_staff read_job_contacts read_job_attachments publish_job_attachments read_customer_contacts';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAAA;AAEA,MAAM,MAAM,GAAG;AACb,IAAA,IAAI,EAAE,sBAAsB;CAC7B;AAED,MAAM,WAAW,GAAG,oBAAoB;AAEjC,MAAM,UAAU,GAAG;IACxB,MAAM;AACN,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,WAAW;AACjB,QAAA,KAAK,EAAE,CAAA,CAAA,EAAI,MAAM,CAAC,IAAI,CAAA,yBAAA,CAA2B;AACjD,QAAA,IAAI,EAAE,uBAAuB;AAC9B,KAAA;;AAGH;;ACjBA;AAEO,MAAM,uBAAuB,G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B,EAAE;QAClB,UAAU,EAAE,+BAA+B,CAAC,mBAAmB;AAC/D,QAAA,OAAO,EAAE;YACP,IAAI,EAAE,+BAA+B,CAAC,gBAAgB;AACvD,SAAA;AACD,QAAA,aAAa,EAAE;YACb,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,cAAc,EAAE;YACd,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACD,QAAA,WAAW,EAAE;YACX,OAAO,EAAE,+BAA+B,CAAC,wBAAwB;AAClE,SAAA;AACF,KAAA;;AAGH;;AClDA;AA8BA;;AC9BA;AA8BA;;AC9BA;AA0HA;;AC1HA;AAEA;AACO,MAAM,iCAAiC,GAAG;AAEjD;AACO,MAAM,6BAA6B,GAAG;AAE7C;AACO,MAAM,0BAA0B,GAAG;AAE1C;;;AAGG;AACI,MAAM,0BAA0B,GACrC;AAEF;;AClBA;;AAEG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-servicem8-oauth-http.client-CsrgXYgR.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/api/servicem8-oauth-http.client.ts"],"sourcesContent":["import { commandMessageTextForError } from '@acorex-platform/framework-client/common';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXEServiceM8CommandKeys,\n type AXEServiceM8OAuthCompleteRequest,\n type AXEServiceM8OAuthCompleteResponse,\n type AXEServiceM8OAuthStartRequest,\n type AXEServiceM8OAuthStartResponse,\n type AXEServiceM8OAuthValidateRequest,\n type AXEServiceM8OAuthValidateResponse,\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class AXEServiceM8OAuthHttpClient {\n private readonly commandService = inject(AXPCommandService);\n\n startOAuth(body: AXEServiceM8OAuthStartRequest): Promise<AXEServiceM8OAuthStartResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthStart, body);\n }\n\n completeOAuth(body: AXEServiceM8OAuthCompleteRequest): Promise<AXEServiceM8OAuthCompleteResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthComplete, body);\n }\n\n validateOAuth(body: AXEServiceM8OAuthValidateRequest = {}): Promise<AXEServiceM8OAuthValidateResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthValidate, body);\n }\n\n private async runCommand<TInput, TResult>(key: string, input: TInput): Promise<TResult> {\n const result = await this.commandService.execute<TInput, TResult>(key, input);\n if (!result?.success) {\n throw new Error(commandMessageTextForError(result?.message?.text) || `ServiceM8 OAuth command failed: ${key}`);\n }\n return result.data as TResult;\n }\n}\n"],"names":[],"mappings":";;;;;;MAca,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAqB5D,IAAA;AAnBC,IAAA,UAAU,CAAC,IAAmC,EAAA;QAC5C,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,CAAC;IAClE;AAEA,IAAA,aAAa,CAAC,IAAsC,EAAA;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC;IACrE;IAEA,aAAa,CAAC,OAAyC,EAAE,EAAA;QACvD,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC;IACrE;AAEQ,IAAA,MAAM,UAAU,CAAkB,GAAW,EAAE,KAAa,EAAA;AAClE,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAkB,GAAG,EAAE,KAAK,CAAC;AAC7E,QAAA,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE;AACpB,YAAA,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAA,gCAAA,EAAmC,GAAG,CAAA,CAAE,CAAC;QAChH;QACA,OAAO,MAAM,CAAC,IAAe;IAC/B;8GArBW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client-servicem8-oauth-http.client-CsrgXYgR.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/api/servicem8-oauth-http.client.ts"],"sourcesContent":["import { commandMessageTextForError } from '@acorex-platform/framework-client/common';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXEServiceM8CommandKeys,\n type AXEServiceM8OAuthCompleteRequest,\n type AXEServiceM8OAuthCompleteResponse,\n type AXEServiceM8OAuthStartRequest,\n type AXEServiceM8OAuthStartResponse,\n type AXEServiceM8OAuthValidateRequest,\n type AXEServiceM8OAuthValidateResponse,\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class AXEServiceM8OAuthHttpClient {\n private readonly commandService = inject(AXPCommandService);\n\n startOAuth(body: AXEServiceM8OAuthStartRequest): Promise<AXEServiceM8OAuthStartResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthStart, body);\n }\n\n completeOAuth(body: AXEServiceM8OAuthCompleteRequest): Promise<AXEServiceM8OAuthCompleteResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthComplete, body);\n }\n\n validateOAuth(body: AXEServiceM8OAuthValidateRequest = {}): Promise<AXEServiceM8OAuthValidateResponse> {\n return this.runCommand(AXEServiceM8CommandKeys.OAuthValidate, body);\n }\n\n private async runCommand<TInput, TResult>(key: string, input: TInput): Promise<TResult> {\n const result = await this.commandService.execute<TInput, TResult>(key, input);\n if (!result?.success) {\n throw new Error(commandMessageTextForError(result?.message?.text) || `ServiceM8 OAuth command failed: ${key}`);\n }\n return result.data as TResult;\n }\n}\n"],"names":[],"mappings":";;;;;;MAca,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAqB5D,IAAA;AAnBC,IAAA,UAAU,CAAC,IAAmC,EAAA;QAC5C,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,UAAU,EAAE,IAAI,CAAC;IAClE;AAEA,IAAA,aAAa,CAAC,IAAsC,EAAA;QAClD,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC;IACrE;IAEA,aAAa,CAAC,OAAyC,EAAE,EAAA;QACvD,OAAO,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC,aAAa,EAAE,IAAI,CAAC;IACrE;AAEQ,IAAA,MAAM,UAAU,CAAkB,GAAW,EAAE,KAAa,EAAA;AAClE,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAkB,GAAG,EAAE,KAAK,CAAC;AAC7E,QAAA,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE;AACpB,YAAA,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAA,gCAAA,EAAmC,GAAG,CAAA,CAAE,CAAC;QAChH;QACA,OAAO,MAAM,CAAC,IAAe;IAC/B;8GArBW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,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,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -517,7 +517,7 @@ class AXEServiceM8ExtensionModule {
|
|
|
517
517
|
provideCommandSetups([
|
|
518
518
|
{
|
|
519
519
|
key: AXEServiceM8CommandKeys.ConnectionConnect,
|
|
520
|
-
command: () => import('./acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-
|
|
520
|
+
command: () => import('./acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs').then((c) => c.ConnectServiceM8Command),
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
523
|
key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,
|
|
@@ -547,7 +547,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
547
547
|
provideCommandSetups([
|
|
548
548
|
{
|
|
549
549
|
key: AXEServiceM8CommandKeys.ConnectionConnect,
|
|
550
|
-
command: () => import('./acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-
|
|
550
|
+
command: () => import('./acorex-platform-extension-project-management-servicem8-client-connect-servicem8.command-Dk02y8bs.mjs').then((c) => c.ConnectServiceM8Command),
|
|
551
551
|
},
|
|
552
552
|
{
|
|
553
553
|
key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-expression-scope.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/project-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/customer-management/customer-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo-key.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration-runtime.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/manifest.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/servicem8-extension.module.ts","../../../../libs/extensions/project-management/servicem8/client/src/acorex-platform-extension-project-management-servicem8-client.ts"],"sourcesContent":["export const AXE_SERVICEM8_EXPRESSION_SCOPE = 'ServiceM8Extension';\n","//#region ---- Imports ----\n\nimport { AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationRuntimeService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\nimport { AXE_PM_INTEGRATION_PROVIDER_SERVICEM8 } from '@acorex-platform/extension-project-management-core-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport type { AXMProjectManagementProjectEntityModel } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nexport class AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {\n private readonly entityService = inject(AXPEntityService);\n private readonly integrationRuntime = inject(AXPIntegrationRuntimeService);\n\n async provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void> {\n context.addScope(AXE_SERVICEM8_EXPRESSION_SCOPE, {\n hasProjectLink: async (platformProjectIdRaw?: unknown): Promise<boolean> => {\n const platformProjectId = typeof platformProjectIdRaw === 'string' ? platformProjectIdRaw.trim() : '';\n if (!platformProjectId) {\n return false;\n }\n\n const project = (await this.entityService\n .withEntity(PmRootConfig.module.name, PmRootConfig.entities.project.name)\n .data<string, AXMProjectManagementProjectEntityModel>()\n .byKey(platformProjectId)) as AXMProjectManagementProjectEntityModel | null;\n\n return project?.integrationRef?.source === AXE_PM_INTEGRATION_PROVIDER_SERVICEM8;\n },\n hasServiceM8Connection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'servicem8', connectionScope: 'tenant' });\n return true;\n } catch {\n return false;\n }\n },\n });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8 },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\nfunction buildSyncAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.ProjectSync,\n title: '@extensions-servicem8:actions.sync.title',\n command: {\n name: AXEServiceM8CommandKeys.ProjectSync,\n options: { platformProjectId: '{{ context.eval(\"id\") }}' },\n },\n priority: 'secondary',\n type: AXPSystemActionType.Sync,\n icon: 'fa-light fa-arrows-rotate',\n scope: AXPEntityCommandScope.Individual,\n order: SYNC_ORDER,\n hidden: `{{ !(await ${AXE_SERVICEM8_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds ServiceM8 import/sync actions to ProjectManagement.Project views. */\nexport const AXEServiceM8ProjectEntityModifier: AXPEntityModifierProvider = {\n entityName: PmRootConfig.entities.project.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== PmRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n\n if (!actionExists(listActions, AXEServiceM8CommandKeys.ProjectImportFromServiceM8)) {\n listActions.push(buildImportAction());\n }\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXEServiceM8CommandKeys.ProjectSync)) {\n singleActions.push(buildSyncAction());\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as CustomerRootConfig } from '@acorex-platform/module-customer-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst IMPORT_ORDER = 36;\n\n//#endregion\n\n//#region ----- Actions -----\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8 },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\n//#endregion\n\n//#region ----- Modifier -----\n\n/** Adds ServiceM8 import action to CustomerManagement.Customer list views. */\nexport const AXEServiceM8CustomerEntityModifier: AXPEntityModifierProvider = {\n entityName: CustomerRootConfig.entities.customer.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== CustomerRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.master.list.update((list) => {\n const next = list ?? { actions: [], views: [] };\n const listActions = [...(next.actions ?? [])];\n if (!actionExists(listActions, AXEServiceM8CommandKeys.CustomerImportFromServiceM8)) {\n listActions.push(buildImportAction());\n }\n return {\n ...next,\n actions: listActions,\n };\n });\n },\n};\n\n//#endregion\n","//#region ---- ServiceM8 logo registry key ----\n\nexport const axpServiceM8LogoKey = 'servicem8' as const;\n\n/** Mark artwork (1024×1024); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_SERVICEM8_MARK_SRC = 'assets/images/brand/integrations/servicem8-mark.png';\n\n/** Source mark is square. */\nexport const AXE_SERVICEM8_MARK_ASPECT = 1;\n\n//#endregion\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXPWidgetsList,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationProvider, AXPIntegrationProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXEServiceM8CommandKeys, RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { axpServiceM8LogoKey } from '../brand/servicem8-logo-key';\n\n@Injectable()\nexport class AXEServiceM8IntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: 'project-management',\n id: 'servicem8',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpServiceM8LogoKey,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: true,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEServiceM8CommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n label: `${I18N}.auth.oauth.label`,\n instructions: `${I18N}.auth.oauth.instructions`,\n usesRedirect: false,\n supportsRefresh: true,\n supportsRevoke: false,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.TextBox,\n path: 'clientId',\n options: { placeholder: `${I18N}.auth.oauth.client-id.placeholder` },\n },\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'clientSecret',\n options: { placeholder: `${I18N}.auth.oauth.client-secret.placeholder` },\n },\n ],\n },\n ],\n });\n }\n}\n","//#region ---- ServiceM8 integration settings badges ----\n\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPRegionalSetting } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPIntegrationConnectionSettingsContext,\n AXPIntegrationSettingsRowBadge,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\nimport type { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nconst SERVICEM8_I18N = '@extensions-servicem8:integration.badges';\n\n/** Must match `SERVICEM8_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'servicem8-extension.jobs.pull';\n\nasync function formatSyncTimestamp(\n iso: string,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n): Promise<string | undefined> {\n const parsed = Date.parse(iso);\n if (!Number.isFinite(parsed)) {\n return undefined;\n }\n\n const dateFormat = await settingsService.get(AXPRegionalSetting.ShortDate);\n const timeFormat = await settingsService.get(AXPRegionalSetting.ShortTime);\n const format = `${dateFormat} ${timeFormat}`.trim();\n\n return formatService.format(new Date(parsed), 'datetime', { format });\n}\n\nfunction isFailureNewer(schedule: AXPBackgroundJobSchedule): boolean {\n const failed = schedule.lastFailureAt ? Date.parse(schedule.lastFailureAt) : NaN;\n const succeeded = schedule.lastSuccessAt ? Date.parse(schedule.lastSuccessAt) : NaN;\n if (!Number.isFinite(failed)) {\n return false;\n }\n if (!Number.isFinite(succeeded)) {\n return true;\n }\n return failed >= succeeded;\n}\n\nexport async function resolveServiceM8ConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEServiceM8ConnectionConfig;\n const jobsSync = config.jobsSync as Record<string, unknown> | undefined;\n const lastSync =\n config.jobsSync?.lastSyncAt?.trim() ||\n (typeof jobsSync?.['lastSuccessfulSyncAt'] === 'string' ? jobsSync['lastSuccessfulSyncAt'].trim() : '');\n\n const badges: AXPIntegrationSettingsRowBadge[] = [];\n\n if (!lastSync) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.never-synced`,\n color: 'warning',\n });\n } else {\n const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.last-sync`,\n params: { datetime },\n color: 'success',\n });\n }\n }\n\n if (!schedule) {\n return badges;\n }\n\n if (schedule.status === 'pause') {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.schedule-disabled`,\n color: 'warning',\n });\n }\n\n if (schedule.nextRunAt) {\n const datetime = await formatSyncTimestamp(schedule.nextRunAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.next-run`,\n params: { datetime },\n color: 'secondary',\n });\n }\n }\n\n if (isFailureNewer(schedule) && schedule.lastFailureAt) {\n const datetime = await formatSyncTimestamp(schedule.lastFailureAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.last-failure`,\n params: { datetime },\n color: 'danger',\n });\n }\n }\n\n return badges;\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\n runtimeQueryPayloadData,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_INTEGRATION_SECRET_STORE,\n type AXPIntegrationRuntimeProvider,\n} from '@acorex-platform/framework-client/common';\nimport type { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { defaultTo, trim } from 'lodash-es';\nimport { AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXPBackgroundJobQueryKeys,\n type AXPBackgroundJobSchedule,\n} from '@acorex-platform/framework-shared/background-job';\nimport {\n resolveServiceM8ConnectionSettingsBadges,\n SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './servicem8-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEServiceM8IntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'servicem8';\n\n private readonly secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });\n private readonly formatService = inject(AXFormatService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly queryService = inject(AXPQueryService, { optional: true });\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n createClient: (ctx) => this.createClient(ctx),\n getConnectionSettingsBadges: async (ctx) =>\n resolveServiceM8ConnectionSettingsBadges(\n ctx,\n this.formatService,\n this.settingsService,\n await this.loadPullSchedule(ctx.connection.id),\n ),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n if (!this.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'ServiceM8 App ID and App Secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'ServiceM8')) || 'ServiceM8',\n };\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<{ clientId: string; baseUrl?: string }> {\n const credentials = await this.resolveClientCredentials(ctx);\n return {\n clientId: credentials.clientId,\n baseUrl: defaultTo(ctx.instanceUrl, undefined),\n };\n }\n\n private hasClientCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const legacyToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean((clientId && clientSecret) || legacyToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const configClientId = trim(defaultTo(config.clientId, ''));\n const configClientSecret = trim(defaultTo(config.clientSecret, ''));\n\n if (configClientId && configClientSecret) {\n return { clientId: configClientId, clientSecret: configClientSecret };\n }\n\n if (!this.secretStore || !trim(defaultTo(ctx.secretRef, ''))) {\n throw new Error('ServiceM8 connection has no client credentials.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const clientId = trim(defaultTo(credentials.token ?? credentials.email, ''));\n const clientSecret = trim(defaultTo(credentials.password ?? credentials.apiToken, ''));\n if (!clientId || !clientSecret) {\n throw new Error('ServiceM8 connection has no usable client credentials.');\n }\n\n return { clientId, clientSecret };\n }\n\n private async loadPullSchedule(connectionId: string): Promise<AXPBackgroundJobSchedule | null> {\n if (!this.queryService || !connectionId.trim()) {\n return null;\n }\n try {\n const result = await this.queryService.fetch<\n { commandKey: string; connectionId?: string },\n AXPBackgroundJobSchedule | null\n >(AXPBackgroundJobQueryKeys.ScheduleGetByScope, {\n commandKey: SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideServiceM8IntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEServiceM8IntegrationRuntimeProvider,\n multi: true,\n};\n","//#region ---- Imports ----\n\nimport {\n AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n type AXPIntegrationConnectionLifecycleHandler,\n} from '@acorex-platform/framework-client/common';\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEServiceM8ConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'servicem8';\n\n private readonly commandService = inject(AXPCommandService);\n\n async onDisconnected(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'disconnected');\n }\n\n async onDeleted(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'deleted');\n }\n\n async onEnabledChanged(connection: AXPSafeIntegrationConnectionDto, enabled: boolean): Promise<void> {\n if (enabled) {\n if (connection.status === AXP_INTEGRATION_CONNECTION_STATUS.Connected) {\n await this.runLifecycle(connection.id, 'enabled');\n }\n return;\n }\n await this.runLifecycle(connection.id, 'disabled');\n }\n\n private async runLifecycle(\n connectionId: string,\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled',\n ): Promise<void> {\n await this.commandService.execute(AXEServiceM8CommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideServiceM8ConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEServiceM8ConnectionLifecycleHandler,\n multi: true,\n};\n\n//#endregion\n","import {\n AXP_LOGO_PROVIDER,\n type AXPLogoProvider,\n type AXPLogoRequest,\n type AXPLogoView,\n} from '@acorex-platform/framework-client/core';\nimport {\n AXE_SERVICEM8_MARK_ASPECT,\n AXE_SERVICEM8_MARK_SRC,\n axpServiceM8LogoKey,\n} from './servicem8-logo-key';\n\nconst servicem8LogoProvider: AXPLogoProvider = {\n key: axpServiceM8LogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_SERVICEM8_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_SERVICEM8_MARK_ASPECT),\n }),\n};\n\nexport const AXE_SERVICEM8_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: servicem8LogoProvider,\n multi: true,\n} as const;\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nexport const ServiceM8ExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'project-management',\n dependencies: [],\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXEServiceM8MenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEServiceM8MenuProvider implements AXPMenuProvider {\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n const policy = {\n features: [module.name],\n permissions: [AXPAdministrationPermissionKeys.MaintainConnections],\n };\n\n const configMenu = context.find(AXPCommonMenuKeys.Configuration);\n if (!context.find(AXEServiceM8MenuKeys.ServiceM8ExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEServiceM8MenuKeys.ServiceM8ExtensionConfig,\n text: '@extensions-servicem8:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n priority: 8940,\n policy,\n children: [],\n },\n ]);\n }\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport { AXP_INTEGRATION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, 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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/servicem8-project-link-expression-evaluator-scope.provider';\nimport { AXEServiceM8ProjectEntityModifier } from './features/project-management/project-servicem8.entity-modifier';\nimport { AXEServiceM8CustomerEntityModifier } from './features/customer-management/customer-servicem8.entity-modifier';\nimport { AXEServiceM8IntegrationProvider } from './integration/servicem8.integration.provider';\nimport { provideServiceM8IntegrationRuntimeProvider } from './integration/servicem8.integration-runtime.provider';\nimport { provideServiceM8ConnectionLifecycleHandler } from './integration/servicem8.connection-lifecycle.handler';\nimport { AXE_SERVICEM8_LOGO_PROVIDER } from './brand/servicem8-logo.provider';\nimport { ServiceM8ExtensionManifest } from './manifest';\nimport { AXEServiceM8MenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SERVICEM8_LOGO_PROVIDER,\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: ServiceM8ExtensionManifest, multi: true },\n { provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEServiceM8IntegrationProvider, multi: true },\n provideServiceM8IntegrationRuntimeProvider,\n provideServiceM8ConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEServiceM8CommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-servicem8.command').then((c) => c.ConnectServiceM8Command),\n },\n {\n key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-servicem8-oauth.command').then((c) => c.CompleteServiceM8OAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEServiceM8ExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","buildImportAction","AXEServiceM8CommandKeys","CustomerRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,8BAA8B,GAAG,oBAAoB;;ACAlE;AAWA;MAEa,uDAAuD,CAAA;AAApE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;IA2B5E;IAzBE,MAAM,OAAO,CAAC,OAAmD,EAAA;AAC/D,QAAA,OAAO,CAAC,QAAQ,CAAC,8BAA8B,EAAE;AAC/C,YAAA,cAAc,EAAE,OAAO,oBAA8B,KAAsB;AACzE,gBAAA,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,KAAK,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE;gBACrG,IAA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E,QAAQ,EAAE,kCAAkC,EAAE,KAAK,EAAE,IAAI,EAAE;AAC3F,wBAAA;AACE,4BAAA,OAAO,EAAE,uCAAuC;AAChD,4BAAA,QAAQ,EAAE,uDAAuD;AACjE,4BAAA,KAAK,EAAE,IAAI;AACZ,yBAAA;wBACD,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,+BAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;wBAC7F,0CAA0C;wBAC1C,0CAA0C;AAC1C,wBAAA,oBAAoB,CAAC;AACnB,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,iBAAiB;AAC9C,gCAAA,OAAO,EAAE,MAAM,OAAO,wGAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;AAC7G,6BAAA;AACD,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,uBAAuB;AACpD,gCAAA,OAAO,EAAE,MACP,OAAO,+GAAqD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,6BAA6B,CAAC;AAC7G,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACjDD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-project-management-servicem8-client.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-expression-scope.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/servicem8-project-link-expression-evaluator-scope.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/project-management/project-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/customer-management/customer-servicem8.entity-modifier.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo-key.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8-integration-settings-badges.util.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.integration-runtime.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/integration/servicem8.connection-lifecycle.handler.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/brand/servicem8-logo.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/manifest.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/menu.provider.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/servicem8-extension.module.ts","../../../../libs/extensions/project-management/servicem8/client/src/acorex-platform-extension-project-management-servicem8-client.ts"],"sourcesContent":["export const AXE_SERVICEM8_EXPRESSION_SCOPE = 'ServiceM8Extension';\n","//#region ---- Imports ----\n\nimport { AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationRuntimeService } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { inject } from '@angular/core';\nimport { AXE_PM_INTEGRATION_PROVIDER_SERVICEM8 } from '@acorex-platform/extension-project-management-core-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport type { AXMProjectManagementProjectEntityModel } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nexport class AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider implements AXPExpressionEvaluatorScopeProvider {\n private readonly entityService = inject(AXPEntityService);\n private readonly integrationRuntime = inject(AXPIntegrationRuntimeService);\n\n async provide(context: AXPExpressionEvaluatorScopeProviderContext): Promise<void> {\n context.addScope(AXE_SERVICEM8_EXPRESSION_SCOPE, {\n hasProjectLink: async (platformProjectIdRaw?: unknown): Promise<boolean> => {\n const platformProjectId = typeof platformProjectIdRaw === 'string' ? platformProjectIdRaw.trim() : '';\n if (!platformProjectId) {\n return false;\n }\n\n const project = (await this.entityService\n .withEntity(PmRootConfig.module.name, PmRootConfig.entities.project.name)\n .data<string, AXMProjectManagementProjectEntityModel>()\n .byKey(platformProjectId)) as AXMProjectManagementProjectEntityModel | null;\n\n return project?.integrationRef?.source === AXE_PM_INTEGRATION_PROVIDER_SERVICEM8;\n },\n hasServiceM8Connection: async (): Promise<boolean> => {\n try {\n await this.integrationRuntime.getConnection({ providerId: 'servicem8', connectionScope: 'tenant' });\n return true;\n } catch {\n return false;\n }\n },\n });\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as PmRootConfig } from '@acorex-platform/module-project-management-client/contracts';\nimport { AXE_SERVICEM8_EXPRESSION_SCOPE } from './servicem8-expression-scope';\n\n//#endregion\n\nconst IMPORT_ORDER = 36;\nconst SYNC_ORDER = 37;\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.ProjectImportFromServiceM8 },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\nfunction buildSyncAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.ProjectSync,\n title: '@extensions-servicem8:actions.sync.title',\n command: {\n name: AXEServiceM8CommandKeys.ProjectSync,\n options: { platformProjectId: '{{ context.eval(\"id\") }}' },\n },\n priority: 'secondary',\n type: AXPSystemActionType.Sync,\n icon: 'fa-light fa-arrows-rotate',\n scope: AXPEntityCommandScope.Individual,\n order: SYNC_ORDER,\n hidden: `{{ !(await ${AXE_SERVICEM8_EXPRESSION_SCOPE}.hasProjectLink(context.eval(\"id\"))) }}`,\n };\n}\n\n/** Adds ServiceM8 import/sync actions to ProjectManagement.Project views. */\nexport const AXEServiceM8ProjectEntityModifier: AXPEntityModifierProvider = {\n entityName: PmRootConfig.entities.project.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== PmRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.update((interfaces) => {\n const next = (interfaces ?? {}) as Record<string, unknown>;\n const master = (next['master'] ?? {}) as Record<string, unknown>;\n const list = (master['list'] ?? { actions: [], views: [] }) as Record<string, unknown>;\n const listActions = (list['actions'] ?? []) as AXPEntityAction[];\n\n if (!actionExists(listActions, AXEServiceM8CommandKeys.ProjectImportFromServiceM8)) {\n listActions.push(buildImportAction());\n }\n list['actions'] = listActions;\n master['list'] = list;\n\n const single = master['single'] as Record<string, unknown> | undefined;\n if (single) {\n const singleActions = (single['actions'] ?? []) as AXPEntityAction[];\n if (!actionExists(singleActions, AXEServiceM8CommandKeys.ProjectSync)) {\n singleActions.push(buildSyncAction());\n }\n single['actions'] = singleActions;\n }\n\n next['master'] = master;\n return next as typeof interfaces;\n });\n },\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXPSystemActionType } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityAction, AXPEntityCommandScope } from '@acorex-platform/framework-shared/entity';\nimport {\n actionExists,\n AXPEntityModifierProvider,\n ensureListActions,\n} from '@acorex-platform/framework-client/layout/entity';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { RootConfig as CustomerRootConfig } from '@acorex-platform/module-customer-management-client/contracts';\n\n//#endregion\n\n//#region ----- Constants -----\n\nconst IMPORT_ORDER = 36;\n\n//#endregion\n\n//#region ----- Actions -----\n\nfunction buildImportAction(): AXPEntityAction {\n return {\n name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8,\n title: '@extensions-servicem8:actions.import-from-servicem8.title',\n command: { name: AXEServiceM8CommandKeys.CustomerImportFromServiceM8 },\n priority: 'secondary',\n type: AXPSystemActionType.Import,\n icon: 'fa-light fa-briefcase',\n scope: AXPEntityCommandScope.TypeLevel,\n order: IMPORT_ORDER,\n };\n}\n\n//#endregion\n\n//#region ----- Modifier -----\n\n/** Adds ServiceM8 import action to CustomerManagement.Customer list views. */\nexport const AXEServiceM8CustomerEntityModifier: AXPEntityModifierProvider = {\n entityName: CustomerRootConfig.entities.customer.name,\n order: 50,\n modifier: (ctx) => {\n if (ctx.module.get() !== CustomerRootConfig.module.name) {\n return;\n }\n\n ensureListActions(ctx);\n\n ctx.interfaces.master.list.update((list) => {\n const next = list ?? { actions: [], views: [] };\n const listActions = [...(next.actions ?? [])];\n if (!actionExists(listActions, AXEServiceM8CommandKeys.CustomerImportFromServiceM8)) {\n listActions.push(buildImportAction());\n }\n return {\n ...next,\n actions: listActions,\n };\n });\n },\n};\n\n//#endregion\n","//#region ---- ServiceM8 logo registry key ----\n\nexport const axpServiceM8LogoKey = 'servicem8' as const;\n\n/** Mark artwork (1024×1024); consuming apps copy to `assets/images/brand/integrations/`. */\nexport const AXE_SERVICEM8_MARK_SRC = 'assets/images/brand/integrations/servicem8-mark.png';\n\n/** Source mark is square. */\nexport const AXE_SERVICEM8_MARK_ASPECT = 1;\n\n//#endregion\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXPWidgetsList,\n} from '@acorex-platform/framework-shared/core';\nimport { AXPIntegrationProvider, AXPIntegrationProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport { AXEServiceM8CommandKeys, RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { axpServiceM8LogoKey } from '../brand/servicem8-logo-key';\n\n@Injectable()\nexport class AXEServiceM8IntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: 'project-management',\n id: 'servicem8',\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpServiceM8LogoKey,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Sync, AXP_INTEGRATION_CAPABILITY.Import],\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n allowMultipleConnections: true,\n defaultConnectionKey: 'default',\n connectCommandKey: AXEServiceM8CommandKeys.ConnectionConnect,\n completeOAuthCommandKey: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.OAuth2,\n label: `${I18N}.auth.oauth.label`,\n instructions: `${I18N}.auth.oauth.instructions`,\n usesRedirect: false,\n supportsRefresh: true,\n supportsRevoke: false,\n supportsValidation: true,\n fields: [\n {\n type: AXPWidgetsList.Editors.TextBox,\n path: 'clientId',\n options: { placeholder: `${I18N}.auth.oauth.client-id.placeholder` },\n },\n {\n type: AXPWidgetsList.Editors.PasswordBox,\n path: 'clientSecret',\n options: { placeholder: `${I18N}.auth.oauth.client-secret.placeholder` },\n },\n ],\n },\n ],\n });\n }\n}\n","//#region ---- ServiceM8 integration settings badges ----\n\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { AXPRegionalSetting } from '@acorex-platform/framework-shared/core';\nimport type {\n AXPIntegrationConnectionSettingsContext,\n AXPIntegrationSettingsRowBadge,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPBackgroundJobSchedule } from '@acorex-platform/framework-shared/background-job';\nimport type { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nconst SERVICEM8_I18N = '@extensions-servicem8:integration.badges';\n\n/** Must match `SERVICEM8_PULL_JOBS_COMMAND_KEY` / schedule `command.key`. */\nexport const SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY = 'servicem8-extension.jobs.pull';\n\nasync function formatSyncTimestamp(\n iso: string,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n): Promise<string | undefined> {\n const parsed = Date.parse(iso);\n if (!Number.isFinite(parsed)) {\n return undefined;\n }\n\n const dateFormat = await settingsService.get(AXPRegionalSetting.ShortDate);\n const timeFormat = await settingsService.get(AXPRegionalSetting.ShortTime);\n const format = `${dateFormat} ${timeFormat}`.trim();\n\n return formatService.format(new Date(parsed), 'datetime', { format });\n}\n\nfunction isFailureNewer(schedule: AXPBackgroundJobSchedule): boolean {\n const failed = schedule.lastFailureAt ? Date.parse(schedule.lastFailureAt) : NaN;\n const succeeded = schedule.lastSuccessAt ? Date.parse(schedule.lastSuccessAt) : NaN;\n if (!Number.isFinite(failed)) {\n return false;\n }\n if (!Number.isFinite(succeeded)) {\n return true;\n }\n return failed >= succeeded;\n}\n\nexport async function resolveServiceM8ConnectionSettingsBadges(\n ctx: AXPIntegrationConnectionSettingsContext,\n formatService: AXFormatService,\n settingsService: AXPSettingsService,\n schedule?: AXPBackgroundJobSchedule | null,\n): Promise<AXPIntegrationSettingsRowBadge[]> {\n const config = (ctx.connection.config ?? {}) as AXEServiceM8ConnectionConfig;\n const jobsSync = config.jobsSync as Record<string, unknown> | undefined;\n const lastSync =\n config.jobsSync?.lastSyncAt?.trim() ||\n (typeof jobsSync?.['lastSuccessfulSyncAt'] === 'string' ? jobsSync['lastSuccessfulSyncAt'].trim() : '');\n\n const badges: AXPIntegrationSettingsRowBadge[] = [];\n\n if (!lastSync) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.never-synced`,\n color: 'warning',\n });\n } else {\n const datetime = await formatSyncTimestamp(lastSync, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.last-sync`,\n params: { datetime },\n color: 'success',\n });\n }\n }\n\n if (!schedule) {\n return badges;\n }\n\n if (schedule.status === 'pause') {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.schedule-paused`,\n color: 'warning',\n });\n } else if (schedule.status === 'disabled') {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.schedule-disabled`,\n color: 'warning',\n });\n }\n\n if (schedule.nextRunAt) {\n const datetime = await formatSyncTimestamp(schedule.nextRunAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.next-run`,\n params: { datetime },\n color: 'secondary',\n });\n }\n }\n\n if (isFailureNewer(schedule) && schedule.lastFailureAt) {\n const datetime = await formatSyncTimestamp(schedule.lastFailureAt, formatService, settingsService);\n if (datetime) {\n badges.push({\n labelKey: `${SERVICEM8_I18N}.last-failure`,\n params: { datetime },\n color: 'danger',\n });\n }\n }\n\n return badges;\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_STATUS,\n runtimeQueryPayloadData,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_INTEGRATION_SECRET_STORE,\n type AXPIntegrationRuntimeProvider,\n} from '@acorex-platform/framework-client/common';\nimport type { AXEServiceM8ConnectionConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { AXFormatService } from '@acorex/core/format';\nimport { AXPSettingsService } from '@acorex-platform/framework-client/common';\nimport { defaultTo, trim } from 'lodash-es';\nimport { AXPQueryService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXPBackgroundJobQueryKeys,\n type AXPBackgroundJobSchedule,\n} from '@acorex-platform/framework-shared/background-job';\nimport {\n resolveServiceM8ConnectionSettingsBadges,\n SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n} from './servicem8-integration-settings-badges.util';\n\n@Injectable()\nexport class AXEServiceM8IntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = 'servicem8';\n\n private readonly secretStore = inject(AXP_INTEGRATION_SECRET_STORE, { optional: true });\n private readonly formatService = inject(AXFormatService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly queryService = inject(AXPQueryService, { optional: true });\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n validateConnection: (ctx) => this.validateConnection(ctx),\n createClient: (ctx) => this.createClient(ctx),\n getConnectionSettingsBadges: async (ctx) =>\n resolveServiceM8ConnectionSettingsBadges(\n ctx,\n this.formatService,\n this.settingsService,\n await this.loadPullSchedule(ctx.connection.id),\n ),\n };\n }\n\n private async validateConnection(ctx: AXPIntegrationRuntimeContext): Promise<AXPIntegrationValidationResult> {\n if (!this.hasClientCredentials(ctx)) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'ServiceM8 App ID and App Secret are required.',\n };\n }\n\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountName: trim(defaultTo(ctx.instanceUrl, 'ServiceM8')) || 'ServiceM8',\n };\n }\n\n private async createClient(ctx: AXPIntegrationRuntimeContext): Promise<{ clientId: string; baseUrl?: string }> {\n const credentials = await this.resolveClientCredentials(ctx);\n return {\n clientId: credentials.clientId,\n baseUrl: defaultTo(ctx.instanceUrl, undefined),\n };\n }\n\n private hasClientCredentials(ctx: AXPIntegrationRuntimeContext): boolean {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const clientId = trim(defaultTo(config.clientId, ''));\n const clientSecret = trim(defaultTo(config.clientSecret, ''));\n const legacyToken = trim(defaultTo(config.accessToken, ''));\n const refreshToken = trim(defaultTo(config.refreshToken, ''));\n return Boolean((clientId && clientSecret) || legacyToken || refreshToken);\n }\n\n private async resolveClientCredentials(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<{ clientId: string; clientSecret?: string }> {\n const config = (ctx.config ?? {}) as AXEServiceM8ConnectionConfig;\n const configClientId = trim(defaultTo(config.clientId, ''));\n const configClientSecret = trim(defaultTo(config.clientSecret, ''));\n\n if (configClientId && configClientSecret) {\n return { clientId: configClientId, clientSecret: configClientSecret };\n }\n\n if (!this.secretStore || !trim(defaultTo(ctx.secretRef, ''))) {\n throw new Error('ServiceM8 connection has no client credentials.');\n }\n\n const credentials = await this.secretStore.resolve(ctx.secretRef, ctx);\n const clientId = trim(defaultTo(credentials.token ?? credentials.email, ''));\n const clientSecret = trim(defaultTo(credentials.password ?? credentials.apiToken, ''));\n if (!clientId || !clientSecret) {\n throw new Error('ServiceM8 connection has no usable client credentials.');\n }\n\n return { clientId, clientSecret };\n }\n\n private async loadPullSchedule(connectionId: string): Promise<AXPBackgroundJobSchedule | null> {\n if (!this.queryService || !connectionId.trim()) {\n return null;\n }\n try {\n const result = await this.queryService.fetch<\n { commandKey: string; connectionId?: string },\n AXPBackgroundJobSchedule | null\n >(AXPBackgroundJobQueryKeys.ScheduleGetByScope, {\n commandKey: SERVICEM8_PULL_JOBS_SCHEDULE_COMMAND_KEY,\n connectionId,\n });\n return runtimeQueryPayloadData(result) ?? null;\n } catch {\n return null;\n }\n }\n}\n\nexport const provideServiceM8IntegrationRuntimeProvider = {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXEServiceM8IntegrationRuntimeProvider,\n multi: true,\n};\n","//#region ---- Imports ----\n\nimport {\n AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n type AXPIntegrationConnectionLifecycleHandler,\n} from '@acorex-platform/framework-client/common';\nimport { AXP_INTEGRATION_CONNECTION_STATUS, type AXPSafeIntegrationConnectionDto } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { Injectable, inject } from '@angular/core';\n\n//#endregion\n\n//#region ---- Handler ----\n\n@Injectable()\nexport class AXEServiceM8ConnectionLifecycleHandler implements AXPIntegrationConnectionLifecycleHandler {\n readonly providerId = 'servicem8';\n\n private readonly commandService = inject(AXPCommandService);\n\n async onDisconnected(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'disconnected');\n }\n\n async onDeleted(connection: AXPSafeIntegrationConnectionDto): Promise<void> {\n await this.runLifecycle(connection.id, 'deleted');\n }\n\n async onEnabledChanged(connection: AXPSafeIntegrationConnectionDto, enabled: boolean): Promise<void> {\n if (enabled) {\n if (connection.status === AXP_INTEGRATION_CONNECTION_STATUS.Connected) {\n await this.runLifecycle(connection.id, 'enabled');\n }\n return;\n }\n await this.runLifecycle(connection.id, 'disabled');\n }\n\n private async runLifecycle(\n connectionId: string,\n action: 'connected' | 'disconnected' | 'deleted' | 'enabled' | 'disabled',\n ): Promise<void> {\n await this.commandService.execute(AXEServiceM8CommandKeys.ConnectionLifecycle, {\n connectionId,\n action,\n });\n }\n}\n\nexport const provideServiceM8ConnectionLifecycleHandler = {\n provide: AXP_INTEGRATION_CONNECTION_LIFECYCLE,\n useClass: AXEServiceM8ConnectionLifecycleHandler,\n multi: true,\n};\n\n//#endregion\n","import {\n AXP_LOGO_PROVIDER,\n type AXPLogoProvider,\n type AXPLogoRequest,\n type AXPLogoView,\n} from '@acorex-platform/framework-client/core';\nimport {\n AXE_SERVICEM8_MARK_ASPECT,\n AXE_SERVICEM8_MARK_SRC,\n axpServiceM8LogoKey,\n} from './servicem8-logo-key';\n\nconst servicem8LogoProvider: AXPLogoProvider = {\n key: axpServiceM8LogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'image',\n src: AXE_SERVICEM8_MARK_SRC,\n height: request.size,\n width: Math.round(request.size * AXE_SERVICEM8_MARK_ASPECT),\n }),\n};\n\nexport const AXE_SERVICEM8_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: servicem8LogoProvider,\n multi: true,\n} as const;\n","//#region ---- Manifest ----\n\nimport { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\nexport const ServiceM8ExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: RootConfig.module.title,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'project-management',\n dependencies: [],\n};\n\n//#endregion\n","//#region ---- Imports ----\n\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXEServiceM8MenuKeys,\n RootConfig,\n AXPAdministrationPermissionKeys\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\n\n//#endregion\n\n@Injectable()\nexport class AXEServiceM8MenuProvider implements AXPMenuProvider {\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n const policy = {\n features: [module.name],\n permissions: [AXPAdministrationPermissionKeys.MaintainConnections],\n };\n\n const configMenu = context.find(AXPCommonMenuKeys.Configuration);\n if (!context.find(AXEServiceM8MenuKeys.ServiceM8ExtensionConfig).exists) {\n configMenu.addItems([\n {\n name: AXEServiceM8MenuKeys.ServiceM8ExtensionConfig,\n text: '@extensions-servicem8:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n priority: 8940,\n policy,\n children: [],\n },\n ]);\n }\n }\n}\n\n//#endregion\n","//#region ---- Imports ----\n\nimport { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport { AXP_INTEGRATION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex-platform/framework-client/common';\nimport { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, 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 { AXEServiceM8CommandKeys } from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport { AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider } from './features/project-management/servicem8-project-link-expression-evaluator-scope.provider';\nimport { AXEServiceM8ProjectEntityModifier } from './features/project-management/project-servicem8.entity-modifier';\nimport { AXEServiceM8CustomerEntityModifier } from './features/customer-management/customer-servicem8.entity-modifier';\nimport { AXEServiceM8IntegrationProvider } from './integration/servicem8.integration.provider';\nimport { provideServiceM8IntegrationRuntimeProvider } from './integration/servicem8.integration-runtime.provider';\nimport { provideServiceM8ConnectionLifecycleHandler } from './integration/servicem8.connection-lifecycle.handler';\nimport { AXE_SERVICEM8_LOGO_PROVIDER } from './brand/servicem8-logo.provider';\nimport { ServiceM8ExtensionManifest } from './manifest';\nimport { AXEServiceM8MenuProvider } from './menu.provider';\n\n//#endregion\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n AXE_SERVICEM8_LOGO_PROVIDER,\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: ServiceM8ExtensionManifest, multi: true },\n { provide: AXP_MENU_PROVIDER, useClass: AXEServiceM8MenuProvider, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8ProjectEntityModifier, multi: true },\n { provide: AXP_ENTITY_MODIFIER, useValue: AXEServiceM8CustomerEntityModifier, multi: true },\n {\n provide: AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER,\n useClass: AXEServiceM8ProjectLinkExpressionEvaluatorScopeProvider,\n multi: true,\n },\n { provide: AXP_INTEGRATION_PROVIDER, useClass: AXEServiceM8IntegrationProvider, multi: true },\n provideServiceM8IntegrationRuntimeProvider,\n provideServiceM8ConnectionLifecycleHandler,\n provideCommandSetups([\n {\n key: AXEServiceM8CommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-servicem8.command').then((c) => c.ConnectServiceM8Command),\n },\n {\n key: AXEServiceM8CommandKeys.ConnectionCompleteOAuth,\n command: () =>\n import('./features/connect/complete-servicem8-oauth.command').then((c) => c.CompleteServiceM8OAuthCommand),\n },\n ]),\n ],\n})\nexport class AXEServiceM8ExtensionModule {}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["PmRootConfig","IMPORT_ORDER","buildImportAction","AXEServiceM8CommandKeys","CustomerRootConfig","RootConfig"],"mappings":";;;;;;;;;;;;;;;;;;;AAAO,MAAM,8BAA8B,GAAG,oBAAoB;;ACAlE;AAWA;MAEa,uDAAuD,CAAA;AAApE,IAAA,WAAA,GAAA;AACmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;IA2B5E;IAzBE,MAAM,OAAO,CAAC,OAAmD,EAAA;AAC/D,QAAA,OAAO,CAAC,QAAQ,CAAC,8BAA8B,EAAE;AAC/C,YAAA,cAAc,EAAE,OAAO,oBAA8B,KAAsB;AACzE,gBAAA,MAAM,iBAAiB,GAAG,OAAO,oBAAoB,KAAK,QAAQ,GAAG,oBAAoB,CAAC,IAAI,EAAE,GAAG,EAAE;gBACrG,IAAI,CAAC,iBAAiB,EAAE;AACtB,oBAAA,OAAO,KAAK;gBACd;AAEA,gBAAA,MAAM,OAAO,IAAI,MAAM,IAAI,CAAC;AACzB,qBAAA,UAAU,CAACA,UAAY,CAAC,MAAM,CAAC,IAAI,EAAEA,UAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;AACvE,qBAAA,IAAI;AACJ,qBAAA,KAAK,CAAC,iBAAiB,CAAC,CAAkD;AAE7E,gBAAA,OAAO,OAAO,EAAE,cAAc,EAAE,MAAM,KAAK,qCAAqC;YAClF,CAAC;YACD,sBAAsB,EAAE,YAA6B;AACnD,gBAAA,IAAI;AACF,oBAAA,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AE,MAAM,OAAO,wGAA8C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,CAAC;AAC7G,6BAAA;AACD,4BAAA;gCACE,GAAG,EAAE,uBAAuB,CAAC,uBAAuB;AACpD,gCAAA,OAAO,EAAE,MACP,OAAO,+GAAqD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,6BAA6B,CAAC;AAC7G,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA;;;ACjDD;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex-platform/extension-project-management-servicem8-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@acorex-platform/extension-project-management-core-client": "0.0.
|
|
6
|
+
"@acorex-platform/extension-project-management-core-client": "0.0.37",
|
|
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-servicem8-client-connect-servicem8.command-3MmHke4f.mjs","sources":["../../../../libs/extensions/project-management/servicem8/client/src/lib/features/connect/servicem8-oauth.util.ts","../../../../libs/extensions/project-management/servicem8/client/src/lib/features/connect/connect-servicem8.command.ts"],"sourcesContent":["//#region ---- ServiceM8 OAuth helpers (client) ----\n\n/** Resolves the demo app path segment used in the OAuth callback URL. */\nexport function resolveServiceM8OAuthAppName(applicationName: string | null | undefined): string {\n const trimmed = String(applicationName ?? '').trim();\n return trimmed || 'demo';\n}\n\n//#endregion\n","//#region ---- Connect ServiceM8 (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 { AXPSessionService } from '@acorex-platform/framework-client/auth';\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 { AXEServiceM8OAuthHttpClient } from '../../api/servicem8-oauth-http.client';\nimport { Injectable, inject } from '@angular/core';\nimport { defaultTo, isEmpty, trim } from 'lodash-es';\nimport {\n AXE_SERVICEM8_API_BASE_URL,\n AXE_SERVICEM8_OAUTH_SCOPES,\n type AXEServiceM8ConnectionConfig,\n} from '@acorex-platform/extension-project-management-servicem8-client/contracts';\nimport type { AXMIntegrationManagementIntegrationConnectionEntityModel } from '@acorex-platform/module-integration-management-client/contracts';\nimport { resolveServiceM8OAuthAppName } from './servicem8-oauth.util';\n\nexport interface ConnectServiceM8CommandInput {\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 AXEServiceM8ConnectFormContext {\n displayName: string;\n clientId: string;\n clientSecret: string;\n}\n\ninterface AXEServiceM8ConnectFormResult {\n displayName: string;\n clientId: string;\n clientSecret: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectServiceM8Command implements AXPCommand<ConnectServiceM8CommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly servicem8Http = inject(AXEServiceM8OAuthHttpClient);\n\n async execute(input: ConnectServiceM8CommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? 'servicem8';\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 AXEServiceM8ConnectionConfig;\n const connectionKey =\n existing?.connectionKey\n ?? (trim(input.connectionKey) || createRandomUuid());\n\n const title = await this.translationService.translateAsync(\n isReconfigure\n ? '@extensions-servicem8:integration.connect.dialog.reconfigure-title'\n : '@extensions-servicem8:integration.connect.dialog.title',\n );\n\n const form = await this.openConnectDialog({\n title: title ?? 'Connect ServiceM8',\n context: {\n displayName: existing?.displayName ?? 'ServiceM8',\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(existingConfig, form);\n const needsAuthorization = this.needsOAuthAuthorization(existingConfig, credentialsChanged);\n\n const config: AXEServiceM8ConnectionConfig = {\n clientId: form.clientId,\n clientSecret: form.clientSecret,\n scope: AXE_SERVICEM8_OAUTH_SCOPES,\n ...(credentialsChanged\n ? {}\n : {\n accessToken: existingConfig.accessToken,\n refreshToken: existingConfig.refreshToken,\n tokenExpiresAt: existingConfig.tokenExpiresAt,\n oauthTokenJson: existingConfig.oauthTokenJson,\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), 'ServiceM8'),\n instanceUrl: AXE_SERVICEM8_API_BASE_URL,\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 const appName = resolveServiceM8OAuthAppName(this.sessionService.application?.name);\n const redirectUri = `${window.location.origin}/${appName}/integrations/oauth/callback/${providerId}`;\n const oauth = await this.servicem8Http.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.servicem8Http.validateOAuth({ connectionId: connection.id });\n if (!validation.valid) {\n return {\n success: false,\n message: { text: validation.message ?? 'ServiceM8 connection validation failed. Re-authorize ServiceM8.' },\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 message = error instanceof Error ? error.message : 'Failed to connect ServiceM8.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async resolveExistingConnection(\n providerId: string,\n connectionScope: AXPIntegrationConnectionScope,\n input: ConnectServiceM8CommandInput,\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 existingConfig: AXEServiceM8ConnectionConfig,\n form: AXEServiceM8ConnectFormResult,\n ): boolean {\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: AXEServiceM8ConnectionConfig,\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: AXEServiceM8ConnectFormContext;\n existing: AXMIntegrationManagementIntegrationConnectionEntityModel | null;\n existingConfig: AXEServiceM8ConnectionConfig;\n isReconfigure: boolean;\n }): Promise<AXEServiceM8ConnectFormResult | null> {\n const result: unknown = await this.layoutBuilder\n .create()\n .dialog<AXEServiceM8ConnectFormResult | null>((dialog: IDialogBuilder<AXEServiceM8ConnectFormResult | 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-servicem8:integration.connect.instructions',\n })\n .formField('@extensions-servicem8:integration.connect.fields.display-name', (field: IFormFieldBuilder) => {\n field.path('displayName');\n field.textBox({\n placeholder: '@extensions-servicem8:integration.connect.placeholders.display-name',\n });\n })\n .formField('@extensions-servicem8:integration.auth.oauth.client-id.label', (field) => {\n field.path('clientId');\n field.textBox({\n placeholder: '@extensions-servicem8:integration.auth.oauth.client-id.placeholder',\n validations: [{ rule: 'required' }],\n });\n })\n .formField('@extensions-servicem8:integration.auth.oauth.client-secret.label', (field) => {\n field.path('clientSecret');\n field.passwordBox({\n placeholder: '@extensions-servicem8: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-servicem8:integration.connect.actions.save'\n : '@extensions-servicem8: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 AXEServiceM8ConnectFormContext;\n const clientId = trim(ctx.clientId);\n if (!clientId) {\n throw new Error('ServiceM8 App 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('ServiceM8 App Secret is required.');\n }\n\n return {\n displayName: trim(ctx.displayName) || 'ServiceM8',\n clientId,\n clientSecret,\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXEServiceM8ConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAEA;AACM,SAAU,4BAA4B,CAAC,eAA0C,EAAA;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;IACpD,OAAO,OAAO,IAAI,MAAM;AAC1B;AAEA;;MCsDa,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;AAC3D,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAwOrE,IAAA;AAtOC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAsC,EAAE,EAAA;AACpD,QAAA,IAAI;AACF,YAAA,MAAM,UAAU,GA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