@acorex-platform/extension-communication-meta-client 1.0.2 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (8) hide show
  1. package/fesm2022/{acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs → acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs} +1 -1
  2. package/fesm2022/{acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs.map → acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs.map} +1 -1
  3. package/fesm2022/{acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs → acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs} +2 -2
  4. package/fesm2022/{acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs.map → acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs.map} +1 -1
  5. package/fesm2022/{acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs → acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs} +2 -2
  6. package/fesm2022/{acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs.map → acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs.map} +1 -1
  7. package/fesm2022/acorex-platform-extension-communication-meta-client.mjs +4 -4
  8. package/package.json +1 -1
@@ -53,4 +53,4 @@ async function resolveCommunicationMetaCommandError(translationService, error, f
53
53
  }
54
54
 
55
55
  export { CommunicationMetaCommandI18n as C, resolveCommunicationMetaCommandError as r };
56
- //# sourceMappingURL=acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs.map
56
+ //# sourceMappingURL=acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-meta-command.i18n.ts","../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-meta-command-error.util.ts"],"sourcesContent":["import { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';\n\nconst ROOT = `@${RootConfig.config.i18n}`;\n\nexport const CommunicationMetaCommandI18n = {\n errors: {\n phoneNumberRequired: `${ROOT}:settings.whatsapp.errors.phone-number-required`,\n accessTokenNotConfigured: `${ROOT}:settings.whatsapp.errors.access-token-not-configured`,\n phoneNumberIdNotConfigured: `${ROOT}:settings.whatsapp.errors.phone-number-id-not-configured`,\n tenantRequired: `${ROOT}:settings.whatsapp.errors.tenant-required`,\n recipientNotFound: `${ROOT}:settings.whatsapp.errors.recipient-not-found`,\n unauthorized: `${ROOT}:settings.whatsapp.errors.unauthorized`,\n outsideWindow: `${ROOT}:settings.whatsapp.errors.outside-window`,\n apiError: `${ROOT}:settings.whatsapp.errors.api-error`,\n },\n test: {\n failed: `${ROOT}:settings.whatsapp.test.messages.failed`,\n },\n connect: {\n failed: `${ROOT}:integration.connect.messages.failed`,\n },\n} as const;\n","import { extractRequestErrorInfo } from '@acorex-platform/framework-client/common';\nimport { AXP_COMMUNICATION_META_ERROR_CODES } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { CommunicationMetaCommandI18n } from './communication-meta-command.i18n';\n\nconst ERROR_I18N_BY_CODE: Record<string, string> = {\n [AXP_COMMUNICATION_META_ERROR_CODES.PHONE_NUMBER_REQUIRED]: CommunicationMetaCommandI18n.errors.phoneNumberRequired,\n [AXP_COMMUNICATION_META_ERROR_CODES.ACCESS_TOKEN_NOT_CONFIGURED]:\n CommunicationMetaCommandI18n.errors.accessTokenNotConfigured,\n [AXP_COMMUNICATION_META_ERROR_CODES.PHONE_NUMBER_ID_NOT_CONFIGURED]:\n CommunicationMetaCommandI18n.errors.phoneNumberIdNotConfigured,\n [AXP_COMMUNICATION_META_ERROR_CODES.TENANT_REQUIRED]: CommunicationMetaCommandI18n.errors.tenantRequired,\n [AXP_COMMUNICATION_META_ERROR_CODES.RECIPIENT_NOT_FOUND]: CommunicationMetaCommandI18n.errors.recipientNotFound,\n [AXP_COMMUNICATION_META_ERROR_CODES.UNAUTHORIZED]: CommunicationMetaCommandI18n.errors.unauthorized,\n [AXP_COMMUNICATION_META_ERROR_CODES.OUTSIDE_WINDOW]: CommunicationMetaCommandI18n.errors.outsideWindow,\n [AXP_COMMUNICATION_META_ERROR_CODES.API_ERROR]: CommunicationMetaCommandI18n.errors.apiError,\n};\n\nexport async function resolveCommunicationMetaCommandError(\n translationService: AXTranslationService,\n error: unknown,\n fallbackKey: string = CommunicationMetaCommandI18n.test.failed,\n): Promise<{ messageKeyOrText: string; displayText: string }> {\n const httpInfo = extractRequestErrorInfo(error);\n if (httpInfo?.code) {\n const messageKey = ERROR_I18N_BY_CODE[httpInfo.code];\n if (messageKey) {\n const displayText = await translationService.translateAsync(messageKey, {\n params: httpInfo.params,\n });\n return { messageKeyOrText: messageKey, displayText };\n }\n }\n\n if (httpInfo?.message) {\n return { messageKeyOrText: httpInfo.message, displayText: httpInfo.message };\n }\n\n if (error instanceof Error && error.message.trim()) {\n return { messageKeyOrText: error.message, displayText: error.message };\n }\n\n const displayText = await translationService.translateAsync(fallbackKey);\n return { messageKeyOrText: fallbackKey, displayText };\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAE;AAElC,MAAM,4BAA4B,GAAG;AAC1C,IAAA,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAA,EAAG,IAAI,CAAA,+CAAA,CAAiD;QAC7E,wBAAwB,EAAE,CAAA,EAAG,IAAI,CAAA,qDAAA,CAAuD;QACxF,0BAA0B,E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C,IAAI,CAAC,MAAM,EAAA;AAE9D,IAAA,MAAM,QAAQ,GAAG,uBAAuB,CAAC,KAAK,CAAC;AAC/C,IAAA,IAAI,QAAQ,EAAE,IAAI,EAAE;QAClB,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC;QACpD,IAAI,UAAU,EAAE;YACd,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,UAAU,EAAE;gBACtE,MAAM,EAAE,QAAQ,CAAC,MAAM;AACxB,aAAA,CAAC;AACF,YAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE;QACtD;IACF;AAEA,IAAA,IAAI,QAAQ,EAAE,OAAO,EAAE;AACrB,QAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE;IAC9E;IAEA,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;AAClD,QAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,OAAO,EAAE;IACxE;IAEA,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,WAAW,CAAC;AACxE,IAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE;AACvD;;"}
1
+ {"version":3,"file":"acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-meta-command.i18n.ts","../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-meta-command-error.util.ts"],"sourcesContent":["import { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';\n\nconst ROOT = `@${RootConfig.config.i18n}`;\n\nexport const CommunicationMetaCommandI18n = {\n errors: {\n phoneNumberRequired: `${ROOT}:settings.whatsapp.errors.phone-number-required`,\n accessTokenNotConfigured: `${ROOT}:settings.whatsapp.errors.access-token-not-configured`,\n phoneNumberIdNotConfigured: `${ROOT}:settings.whatsapp.errors.phone-number-id-not-configured`,\n tenantRequired: `${ROOT}:settings.whatsapp.errors.tenant-required`,\n recipientNotFound: `${ROOT}:settings.whatsapp.errors.recipient-not-found`,\n unauthorized: `${ROOT}:settings.whatsapp.errors.unauthorized`,\n outsideWindow: `${ROOT}:settings.whatsapp.errors.outside-window`,\n apiError: `${ROOT}:settings.whatsapp.errors.api-error`,\n },\n test: {\n failed: `${ROOT}:settings.whatsapp.test.messages.failed`,\n },\n connect: {\n failed: `${ROOT}:integration.connect.messages.failed`,\n },\n} as const;\n","import { extractRequestErrorInfo } from '@acorex-platform/framework-client/common';\nimport { AXP_COMMUNICATION_META_ERROR_CODES } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { CommunicationMetaCommandI18n } from './communication-meta-command.i18n';\n\nconst ERROR_I18N_BY_CODE: Record<string, string> = {\n [AXP_COMMUNICATION_META_ERROR_CODES.PHONE_NUMBER_REQUIRED]: CommunicationMetaCommandI18n.errors.phoneNumberRequired,\n [AXP_COMMUNICATION_META_ERROR_CODES.ACCESS_TOKEN_NOT_CONFIGURED]:\n CommunicationMetaCommandI18n.errors.accessTokenNotConfigured,\n [AXP_COMMUNICATION_META_ERROR_CODES.PHONE_NUMBER_ID_NOT_CONFIGURED]:\n CommunicationMetaCommandI18n.errors.phoneNumberIdNotConfigured,\n [AXP_COMMUNICATION_META_ERROR_CODES.TENANT_REQUIRED]: CommunicationMetaCommandI18n.errors.tenantRequired,\n [AXP_COMMUNICATION_META_ERROR_CODES.RECIPIENT_NOT_FOUND]: CommunicationMetaCommandI18n.errors.recipientNotFound,\n [AXP_COMMUNICATION_META_ERROR_CODES.UNAUTHORIZED]: CommunicationMetaCommandI18n.errors.unauthorized,\n [AXP_COMMUNICATION_META_ERROR_CODES.OUTSIDE_WINDOW]: CommunicationMetaCommandI18n.errors.outsideWindow,\n [AXP_COMMUNICATION_META_ERROR_CODES.API_ERROR]: CommunicationMetaCommandI18n.errors.apiError,\n};\n\nexport async function resolveCommunicationMetaCommandError(\n translationService: AXTranslationService,\n error: unknown,\n fallbackKey: string = CommunicationMetaCommandI18n.test.failed,\n): Promise<{ messageKeyOrText: string; displayText: string }> {\n const httpInfo = extractRequestErrorInfo(error);\n if (httpInfo?.code) {\n const messageKey = ERROR_I18N_BY_CODE[httpInfo.code];\n if (messageKey) {\n const displayText = await translationService.translateAsync(messageKey, {\n params: httpInfo.params,\n });\n return { messageKeyOrText: messageKey, displayText };\n }\n }\n\n if (httpInfo?.message) {\n return { messageKeyOrText: httpInfo.message, displayText: httpInfo.message };\n }\n\n if (error instanceof Error && error.message.trim()) {\n return { messageKeyOrText: error.message, displayText: error.message };\n }\n\n const displayText = await translationService.translateAsync(fallbackKey);\n return { messageKeyOrText: fallbackKey, displayText };\n}\n"],"names":[],"mappings":";;;AAEA,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,CAAE;AAElC,MAAM,4BAA4B,GAAG;AAC1C,IAAA,MAAM,EAAE;QACN,mBAAmB,EAAE,CAAA,EAAG,IAAI,CAAA,+CAAA,CAAiD;QAC7E,wBAAwB,EAAE,CAAA,EAAG,IAAI,CAAA,qDAAA,CAAuD;QACxF,0BAA0B,EAAE,CAAA,EAAG,IAAI,CAAA,wDAAA,CAA0D;QAC7F,cAAc,EAAE,CAAA,EAAG,IAAI,CAAA,yCAAA,CAA2C;QAClE,iBAAiB,EAAE,CAAA,EAAG,IAAI,CAAA,6CAAA,CAA+C;QACzE,YAAY,EAAE,CAAA,EAAG,IAAI,CAAA,sCAAA,CAAwC;QAC7D,aAAa,EAAE,CAAA,EAAG,IAAI,CAAA,wCAAA,CAA0C;QAChE,QAAQ,EAAE,CAAA,EAAG,IAAI,CAAA,mCAAA,CAAqC;AACvD,KAAA;AACD,IAAA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AAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,WAAW,EAAE;QACtD;IACF;AAEA,IAAA,IAAI,QAAQ,EAAE,OAAO,EAAE;AACrB,QAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE;IAC9E;IAEA,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE;AAClD,QAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,OAAO,EAAE;IACxE;IAEA,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAAC,WAAW,CAAC;AACxE,IAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE;AACvD;;"}
@@ -2,7 +2,7 @@ import { AXToastService } from '@acorex/components/toast';
2
2
  import { AXTranslationService } from '@acorex/core/translation';
3
3
  import * as i0 from '@angular/core';
4
4
  import { inject, Injectable } from '@angular/core';
5
- import { r as resolveCommunicationMetaCommandError, C as CommunicationMetaCommandI18n } from './acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs';
5
+ import { r as resolveCommunicationMetaCommandError, C as CommunicationMetaCommandI18n } from './acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs';
6
6
  import { AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';
7
7
  import { AXPLayoutBuilderService, resolveLayoutBuilderDialogResult } from '@acorex-platform/framework-client/layout/builder';
8
8
  import { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';
@@ -134,4 +134,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
134
134
  }] });
135
135
 
136
136
  export { CommunicationTestWhatsAppCommand };
137
- //# sourceMappingURL=acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs.map
137
+ //# sourceMappingURL=acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/features/whatsapp/communication-whatsapp-test-dialog.service.ts","../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-test-whatsapp.command.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\nimport {\n RootConfig,\n type CommunicationMetaWhatsAppTestResult,\n type CommunicationMetaWhatsAppUserLinkConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXMIntegrationConnectionManager } from '@acorex-platform/module-integration-management-client';\nimport { resolveCommunicationMetaCommandError } from '../../commands/communication-meta-command-error.util';\nimport { AXPCommunicationMetaClient } from '../../communication-meta-client.port';\n\n//#region ----- Types -----\n\ntype WhatsAppTestDialogResult = AXPRuntimeCommandResult<CommunicationMetaWhatsAppTestResult> | null;\n\n//#endregion\n\n//#region ----- WhatsApp test dialog -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXECommunicationWhatsAppTestDialogService {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly client = inject(AXPCommunicationMetaClient);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n\n private async resolveDefaultPhoneNumber(): Promise<string> {\n const connection = await this.connectionManager.findByUniqueKey({\n providerId: RootConfig.integration.providerId,\n connectionScope: 'user',\n connectionKey: 'default',\n });\n\n if (\n !connection ||\n connection.status !== AXP_INTEGRATION_CONNECTION_STATUS.Connected ||\n connection.isRevoked ||\n connection.isDisabled\n ) {\n return '';\n }\n\n const config = (connection.config ?? {}) as unknown as CommunicationMetaWhatsAppUserLinkConfig;\n return String(config.phoneNumber ?? connection.externalAccountId ?? '').trim();\n }\n\n async openAndSendTestMessage(): Promise<WhatsAppTestDialogResult> {\n const defaultPhoneNumber = await this.resolveDefaultPhoneNumber();\n\n try {\n const result = await this.layoutBuilder\n .create()\n .dialog<WhatsAppTestDialogResult>((dialog) => {\n dialog\n .setTitle('@extensions-communication-meta:settings.whatsapp.test.dialog.title')\n .setSize('sm')\n .setCloseButton(true)\n .setContext({ phoneNumber: defaultPhoneNumber })\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('16px')\n .formField(\n '@extensions-communication-meta:settings.whatsapp.test.dialog.fields.phone-number.title',\n (field) => {\n field.path('phoneNumber');\n field.textBox({\n validations: [{ rule: 'required' }],\n placeholder:\n '@extensions-communication-meta:settings.whatsapp.test.dialog.fields.phone-number.placeholder',\n });\n },\n );\n })\n .setActions((actions) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit('@extensions-communication-meta:settings.whatsapp.test.dialog.actions.send');\n })\n .onAction(async (dialogRef: AXPDialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n\n const context = dialogRef.context() as Record<string, unknown> | null;\n const phoneNumber = String(context?.['phoneNumber'] ?? '').trim();\n if (!phoneNumber) {\n throw new Error(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.test.messages.phone-number-required',\n ),\n );\n }\n\n try {\n const data = await this.client.testWhatsApp({ phoneNumber });\n return { success: true, kind: 'object', data };\n } catch (error) {\n const { messageKeyOrText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n );\n return {\n success: false,\n message: { text: messageKeyOrText },\n };\n }\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXPRuntimeCommandResult<CommunicationMetaWhatsAppTestResult>>(result);\n } catch (error) {\n const { messageKeyOrText } = await resolveCommunicationMetaCommandError(this.translationService, error);\n return {\n success: false,\n message: { text: messageKeyOrText },\n };\n }\n }\n}\n\n//#endregion\n","import { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport type { CommunicationMetaWhatsAppTestResult } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { CommunicationMetaCommandI18n } from './communication-meta-command.i18n';\nimport { AXECommunicationWhatsAppTestDialogService } from '../features/whatsapp/communication-whatsapp-test-dialog.service';\n\n//#region ----- WhatsApp test command -----\n\n@Injectable()\nexport class CommunicationTestWhatsAppCommand\n implements AXPCommand<void, CommunicationMetaWhatsAppTestResult | null>\n{\n private readonly dialog = inject(AXECommunicationWhatsAppTestDialogService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(): AXPCommandExecuteResultPromise<CommunicationMetaWhatsAppTestResult | null> {\n const result = await this.dialog.openAndSendTestMessage();\n\n // Cancel / header close — not a failure for the integrations panel.\n if (!result) {\n return { success: true, kind: 'object', data: null };\n }\n\n if (result.success) {\n this.toastService.success(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.test.messages.success',\n ),\n );\n return result;\n }\n\n if (result.message?.text) {\n const content = await this.translationService.translateAsync(result.message.text);\n const title = await this.translationService.translateAsync(CommunicationMetaCommandI18n.test.failed);\n this.toastService.show({ color: 'danger', title, content });\n }\n\n return result;\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;AAEA;MAGa,yCAAyC,CAAA;AADtD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC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OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE;QACtD;AAEA,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE;AAClB,YAAA,IAAI,CAAC,YAAY,CAAC,OAAO,CACvB,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAC1C,wEAAwE,CACzE,CACF;AACD,YAAA,OAAO,MAAM;QACf;AAEA,QAAA,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE;AACxB,YAAA,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;AACjF,YAAA,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC;AACpG,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC7D;AAEA,QAAA,OAAO,MAAM;IACf;8GA/BW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAhC,gCAAgC,EAAA,CAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C;;;"}
1
+ {"version":3,"file":"acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/features/whatsapp/communication-whatsapp-test-dialog.service.ts","../../../../libs/extensions/communication/meta/client/src/lib/commands/communication-test-whatsapp.command.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult, AXP_INTEGRATION_CONNECTION_STATUS } from '@acorex-platform/framework-shared/core';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\nimport {\n RootConfig,\n type CommunicationMetaWhatsAppTestResult,\n type CommunicationMetaWhatsAppUserLinkConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXMIntegrationConnectionManager } from '@acorex-platform/module-integration-management-client';\nimport { resolveCommunicationMetaCommandError } from '../../commands/communication-meta-command-error.util';\nimport { AXPCommunicationMetaClient } from '../../communication-meta-client.port';\n\n//#region ----- Types -----\n\ntype WhatsAppTestDialogResult = AXPRuntimeCommandResult<CommunicationMetaWhatsAppTestResult> | null;\n\n//#endregion\n\n//#region ----- WhatsApp test dialog -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXECommunicationWhatsAppTestDialogService {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n private readonly client = inject(AXPCommunicationMetaClient);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n\n private async resolveDefaultPhoneNumber(): Promise<string> {\n const connection = await this.connectionManager.findByUniqueKey({\n providerId: RootConfig.integration.providerId,\n connectionScope: 'user',\n connectionKey: 'default',\n });\n\n if (\n !connection ||\n connection.status !== AXP_INTEGRATION_CONNECTION_STATUS.Connected ||\n connection.isRevoked ||\n connection.isDisabled\n ) {\n return '';\n }\n\n const config = (connection.config ?? {}) as unknown as CommunicationMetaWhatsAppUserLinkConfig;\n return String(config.phoneNumber ?? connection.externalAccountId ?? '').trim();\n }\n\n async openAndSendTestMessage(): Promise<WhatsAppTestDialogResult> {\n const defaultPhoneNumber = await this.resolveDefaultPhoneNumber();\n\n try {\n const result = await this.layoutBuilder\n .create()\n .dialog<WhatsAppTestDialogResult>((dialog) => {\n dialog\n .setTitle('@extensions-communication-meta:settings.whatsapp.test.dialog.title')\n .setSize('sm')\n .setCloseButton(true)\n .setContext({ phoneNumber: defaultPhoneNumber })\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('16px')\n .formField(\n '@extensions-communication-meta:settings.whatsapp.test.dialog.fields.phone-number.title',\n (field) => {\n field.path('phoneNumber');\n field.textBox({\n validations: [{ rule: 'required' }],\n placeholder:\n '@extensions-communication-meta:settings.whatsapp.test.dialog.fields.phone-number.placeholder',\n });\n },\n );\n })\n .setActions((actions) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit('@extensions-communication-meta:settings.whatsapp.test.dialog.actions.send');\n })\n .onAction(async (dialogRef: AXPDialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n\n const context = dialogRef.context() as Record<string, unknown> | null;\n const phoneNumber = String(context?.['phoneNumber'] ?? '').trim();\n if (!phoneNumber) {\n throw new Error(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.test.messages.phone-number-required',\n ),\n );\n }\n\n try {\n const data = await this.client.testWhatsApp({ phoneNumber });\n return { success: true, kind: 'object', data };\n } catch (error) {\n const { messageKeyOrText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n );\n return {\n success: false,\n message: { text: messageKeyOrText },\n };\n }\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<AXPRuntimeCommandResult<CommunicationMetaWhatsAppTestResult>>(result);\n } catch (error) {\n const { messageKeyOrText } = await resolveCommunicationMetaCommandError(this.translationService, error);\n return {\n success: false,\n message: { text: messageKeyOrText },\n };\n }\n }\n}\n\n//#endregion\n","import { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport type { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport type { CommunicationMetaWhatsAppTestResult } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { Injectable, inject } from '@angular/core';\nimport { CommunicationMetaCommandI18n } from './communication-meta-command.i18n';\nimport { AXECommunicationWhatsAppTestDialogService } from '../features/whatsapp/communication-whatsapp-test-dialog.service';\n\n//#region ----- WhatsApp test command -----\n\n@Injectable()\nexport class CommunicationTestWhatsAppCommand\n implements AXPCommand<void, CommunicationMetaWhatsAppTestResult | null>\n{\n private readonly dialog = inject(AXECommunicationWhatsAppTestDialogService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(): AXPCommandExecuteResultPromise<CommunicationMetaWhatsAppTestResult | null> {\n const result = await this.dialog.openAndSendTestMessage();\n\n // Cancel / header close — not a failure for the integrations panel.\n if (!result) {\n return { success: true, kind: 'object', data: null };\n }\n\n if (result.success) {\n this.toastService.success(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.test.messages.success',\n ),\n );\n return result;\n }\n\n if (result.message?.text) {\n const content = await this.translationService.translateAsync(result.message.text);\n const title = await this.translationService.translateAsync(CommunicationMetaCommandI18n.test.failed);\n this.toastService.show({ color: 'danger', title, content });\n }\n\n return result;\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;AAEA;MAGa,yCAAyC,CAAA;AADtD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,0BAA0B,CAAC;AAC3C,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;AAgG7E,IAAA;AA9FS,IAAA,MAAM,yBAAyB,GAAA;QACrC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC;AAC9D,YAAA,UAAU,EAAE,UAAU,CAAC,WAAW,CAAC,UAAU;AAC7C,YAAA,eAAe,EAAE,MAAM;AACvB,YAAA,aAAa,EAAE,SAAS;AACzB,SAAA,CAAC;AAEF,QAAA,IACE,CAAC,UAAU;AACX,YAAA,UAAU,CAAC,MAAM,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AG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,4BAA4B,CAAC,IAAI,CAAC,MAAM,CAAC;AACpG,YAAA,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAC7D;AAEA,QAAA,OAAO,MAAM;IACf;8GA/BW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAhC,gCAAgC,EAAA,CAAA,CAAA;;2FAAhC,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAD5C;;;"}
@@ -7,7 +7,7 @@ import * as i0 from '@angular/core';
7
7
  import { inject, Injectable } from '@angular/core';
8
8
  import { trim, defaultTo } from 'lodash-es';
9
9
  import { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';
10
- import { r as resolveCommunicationMetaCommandError, C as CommunicationMetaCommandI18n } from './acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs';
10
+ import { r as resolveCommunicationMetaCommandError, C as CommunicationMetaCommandI18n } from './acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-CqzVyXbd.mjs';
11
11
 
12
12
  //#endregion
13
13
  //#region ----- WhatsApp connect dialog -----
@@ -305,4 +305,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
305
305
  }] });
306
306
 
307
307
  export { ConnectWhatsAppCommand };
308
- //# sourceMappingURL=acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs.map
308
+ //# sourceMappingURL=acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/features/connect/communication-whatsapp-connect-dialog.service.ts","../../../../libs/extensions/communication/meta/client/src/lib/features/connect/connect-whatsapp.command.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\n\n//#region ----- Types -----\n\nexport interface CommunicationWhatsAppConnectResult {\n phoneNumber: string;\n displayName?: string;\n}\n\ninterface WhatsAppConnectDialogContext {\n phoneNumber: string;\n displayName: string;\n}\n\n//#endregion\n\n//#region ----- WhatsApp connect dialog -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXECommunicationWhatsAppConnectDialogService {\n //#region ----- Services & Dependencies -----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n async openAndLinkAccount(): Promise<CommunicationWhatsAppConnectResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<CommunicationWhatsAppConnectResult | null>((dialog: IDialogBuilder<CommunicationWhatsAppConnectResult | null>) => {\n dialog\n .setTitle('@extensions-communication-meta:integration.connect.dialog.title')\n .setSize('sm')\n .setCloseButton(true)\n .setContext({ phoneNumber: '', displayName: '' } satisfies WhatsAppConnectDialogContext)\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: '@extensions-communication-meta:integration.connect.dialog.instructions',\n })\n .formField('@extensions-communication-meta:integration.connect.dialog.fields.phone-number.title', (field) => {\n field.path('phoneNumber');\n field.textBox({\n validations: [{ rule: 'required' }],\n placeholder:\n '@extensions-communication-meta:integration.connect.dialog.fields.phone-number.placeholder',\n });\n })\n .formField('@extensions-communication-meta:integration.connect.dialog.fields.display-name.title', (field) => {\n field.path('displayName');\n field.textBox({\n placeholder:\n '@extensions-communication-meta:integration.connect.dialog.fields.display-name.placeholder',\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit('@extensions-communication-meta:integration.connect.dialog.actions.connect');\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n\n const context = ref.context() as WhatsAppConnectDialogContext;\n const phoneNumber = String(context?.phoneNumber ?? '').trim();\n if (!phoneNumber) {\n throw new Error(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.errors.phone-number-required',\n ),\n );\n }\n\n const displayName = String(context?.displayName ?? '').trim();\n return {\n phoneNumber,\n ...(displayName ? { displayName } : {}),\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<CommunicationWhatsAppConnectResult>(result);\n }\n}\n\n//#endregion\n\n//#endregion\n","import { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\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 { Injectable, inject } from '@angular/core';\nimport { defaultTo, trim } from 'lodash-es';\nimport {\n RootConfig,\n type CommunicationMetaWhatsAppTenantConnectionConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { resolveCommunicationMetaCommandError } from '../../commands/communication-meta-command-error.util';\nimport { CommunicationMetaCommandI18n } from '../../commands/communication-meta-command.i18n';\nimport { AXECommunicationWhatsAppConnectDialogService } from './communication-whatsapp-connect-dialog.service';\n\nexport interface ConnectWhatsAppCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface WhatsAppTenantConnectFormContext {\n accessToken: string;\n phoneNumberId: string;\n webhookVerifyToken: string;\n appSecret: string;\n}\n\ninterface WhatsAppTenantConnectFormResult {\n accessToken: string;\n phoneNumberId: string;\n webhookVerifyToken: string;\n appSecret: string;\n}\n\n//#region ---- Connect WhatsApp (tenant Cloud API or user link) ----\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectWhatsAppCommand implements AXPCommand<ConnectWhatsAppCommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly connectDialog = inject(AXECommunicationWhatsAppConnectDialogService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: ConnectWhatsAppCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n const connectionScope = input.connectionScope ?? AXP_INTEGRATION_CONNECTION_SCOPE.User;\n if (connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {\n return this.connectTenantCloudApi(input);\n }\n return this.connectUserLink(input);\n }\n\n private async connectTenantCloudApi(\n input: ConnectWhatsAppCommandInput,\n ): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = AXP_INTEGRATION_CONNECTION_SCOPE.Tenant;\n const I18N = `@${RootConfig.config.i18n}:integration.connect.tenant`;\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n const existingConfig = (existing?.config ?? {}) as CommunicationMetaWhatsAppTenantConnectionConfig;\n\n const form = await this.openTenantConnectDialog({\n i18nPrefix: I18N,\n isReconfigure,\n context: {\n accessToken: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n phoneNumberId: existingConfig.phoneNumberId ?? '',\n webhookVerifyToken: isReconfigure && existingConfig.webhookVerifyToken\n ? AXP_INTEGRATION_CREDENTIAL_MASK\n : '',\n appSecret: isReconfigure && existingConfig.appSecret ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n },\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let accessToken = trim(form.accessToken);\n if (isMaskedIntegrationCredential(accessToken) && existing) {\n accessToken = trim(existingConfig.accessToken ?? '');\n }\n\n let webhookVerifyToken = trim(form.webhookVerifyToken);\n if (isMaskedIntegrationCredential(webhookVerifyToken) && existing) {\n webhookVerifyToken = trim(existingConfig.webhookVerifyToken ?? '');\n }\n\n let appSecret = trim(form.appSecret);\n if (isMaskedIntegrationCredential(appSecret) && existing) {\n appSecret = trim(existingConfig.appSecret ?? '');\n }\n\n const phoneNumberId = trim(form.phoneNumberId);\n if (!accessToken || !phoneNumberId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(`${I18N}.messages.credentials-required`),\n },\n };\n }\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? 'WhatsApp',\n externalAccountId: phoneNumberId,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: {\n accessToken,\n phoneNumberId,\n webhookVerifyToken: webhookVerifyToken || null,\n appSecret: appSecret || null,\n },\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n this.toastService.success(\n await this.translationService.translateAsync(`${I18N}.messages.success`),\n );\n\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(connection),\n },\n };\n } catch (error: unknown) {\n const { displayText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n CommunicationMetaCommandI18n.connect.failed,\n );\n return { success: false, message: { text: displayText } };\n }\n }\n\n private async connectUserLink(\n input: ConnectWhatsAppCommandInput,\n ): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = AXP_INTEGRATION_CONNECTION_SCOPE.User;\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n\n const linked = await this.connectDialog.openAndLinkAccount();\n if (!linked || typeof linked !== 'object' || !('phoneNumber' in linked)) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const phoneNumber = trim(linked.phoneNumber);\n if (!phoneNumber) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const displayName = defaultTo(trim(linked.displayName), 'WhatsApp');\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? displayName,\n externalAccountId: phoneNumber,\n externalAccountName: displayName,\n config: {\n phoneNumber,\n displayName: displayName || null,\n },\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n this.toastService.success(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:integration.connect.messages.success',\n ),\n );\n\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(connection),\n },\n };\n } catch (error: unknown) {\n const { displayText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n CommunicationMetaCommandI18n.connect.failed,\n );\n return { success: false, message: { text: displayText } };\n }\n }\n\n private async openTenantConnectDialog(input: {\n i18nPrefix: string;\n isReconfigure: boolean;\n context: WhatsAppTenantConnectFormContext;\n }): Promise<WhatsAppTenantConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<WhatsAppTenantConnectFormResult | null>((dialog: IDialogBuilder<WhatsAppTenantConnectFormResult | null>) => {\n dialog\n .setTitle(\n input.isReconfigure\n ? `${input.i18nPrefix}.dialog.configure-title`\n : `${input.i18nPrefix}.dialog.title`,\n )\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: `${input.i18nPrefix}.dialog.instructions`,\n })\n .formField(`${input.i18nPrefix}.dialog.fields.access-token`, (field) => {\n field.path('accessToken');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.access-token`,\n revealToggle: true,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.phone-number-id`, (field) => {\n field.path('phoneNumberId');\n field.textBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.phone-number-id`,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.webhook-verify-token`, (field) => {\n field.path('webhookVerifyToken');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.webhook-verify-token`,\n revealToggle: true,\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.app-secret`, (field) => {\n field.path('appSecret');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.app-secret`,\n revealToggle: true,\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${input.i18nPrefix}.dialog.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n const ctx = ref.context() as WhatsAppTenantConnectFormContext;\n const accessToken = trim(ctx.accessToken);\n const phoneNumberId = trim(ctx.phoneNumberId);\n if (!accessToken || !phoneNumberId) {\n throw new Error(`${input.i18nPrefix}.messages.credentials-required`);\n }\n return {\n accessToken,\n phoneNumberId,\n webhookVerifyToken: trim(ctx.webhookVerifyToken),\n appSecret: trim(ctx.appSecret),\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<WhatsAppTenantConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAuBA;AAEA;MAGa,4CAA4C,CAAA;AADzD,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAmEnE,IAAA;;AA/DC,IAAA,MAAM,kBAAkB,GAAA;AACtB,QAAA,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC;AACvB,aAAA,MAAM;AACN,aAAA,MAAM,CAA4C,CAAC,MAAiE,KAAI;YACvH;iBACG,QAAQ,CAAC,iEAAiE;iBAC1E,OAAO,CAAC,IAAI;iBACZ,cAAc,CAAC,IAAI;iBACnB,UAAU,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAyC;AACtF,iBAAA,OAAO,CAAC,CAAC,IAA2B,KAAI;gBACvC;qBACG,YAAY,CAAC,QAAQ;qBACrB,MAAM,CAAC,MAAM;qBACb,YAAY,CAAC,mBAAmB,EAAE;AACjC,oBAAA,OAAO,EAAE,wEAAwE;iBAClF;AACA,qBAAA,SAAS,CAAC,qFAAqF,EAAE,CAAC,KAAK,KAAI;AAC1G,oBAAA,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;oBACzB,KAAK,CAAC,OAAO,CAAC;AACZ,wBAAA,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AACnC,wBAAA,WAAW,EACT,2FAA2F;AAC9F,qBAAA,CAAC;AACJ,gBAAA,CAAC;AACA,qBAAA,SAAS,CAAC,qFAA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,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC;AAC7C,gBAAA,IAAI,CAAC,WAAW,IAAI,CAAC,aAAa,EAAE;oBAClC,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,KAAK,CAAC,UAAU,CAAA,8BAAA,CAAgC,CAAC;gBACtE;gBACA,OAAO;oBACL,WAAW;oBACX,aAAa;AACb,oBAAA,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC;AAChD,oBAAA,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;iBAC/B;AACH,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAkC,MAAM,CAAC;IAClF;8GA9PW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,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,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/features/connect/communication-whatsapp-connect-dialog.service.ts","../../../../libs/extensions/communication/meta/client/src/lib/features/connect/connect-whatsapp.command.ts"],"sourcesContent":["import { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\n\n//#region ----- Types -----\n\nexport interface CommunicationWhatsAppConnectResult {\n phoneNumber: string;\n displayName?: string;\n}\n\ninterface WhatsAppConnectDialogContext {\n phoneNumber: string;\n displayName: string;\n}\n\n//#endregion\n\n//#region ----- WhatsApp connect dialog -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXECommunicationWhatsAppConnectDialogService {\n //#region ----- Services & Dependencies -----\n\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n async openAndLinkAccount(): Promise<CommunicationWhatsAppConnectResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<CommunicationWhatsAppConnectResult | null>((dialog: IDialogBuilder<CommunicationWhatsAppConnectResult | null>) => {\n dialog\n .setTitle('@extensions-communication-meta:integration.connect.dialog.title')\n .setSize('sm')\n .setCloseButton(true)\n .setContext({ phoneNumber: '', displayName: '' } satisfies WhatsAppConnectDialogContext)\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: '@extensions-communication-meta:integration.connect.dialog.instructions',\n })\n .formField('@extensions-communication-meta:integration.connect.dialog.fields.phone-number.title', (field) => {\n field.path('phoneNumber');\n field.textBox({\n validations: [{ rule: 'required' }],\n placeholder:\n '@extensions-communication-meta:integration.connect.dialog.fields.phone-number.placeholder',\n });\n })\n .formField('@extensions-communication-meta:integration.connect.dialog.fields.display-name.title', (field) => {\n field.path('displayName');\n field.textBox({\n placeholder:\n '@extensions-communication-meta:integration.connect.dialog.fields.display-name.placeholder',\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit('@extensions-communication-meta:integration.connect.dialog.actions.connect');\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n\n const context = ref.context() as WhatsAppConnectDialogContext;\n const phoneNumber = String(context?.phoneNumber ?? '').trim();\n if (!phoneNumber) {\n throw new Error(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:settings.whatsapp.errors.phone-number-required',\n ),\n );\n }\n\n const displayName = String(context?.displayName ?? '').trim();\n return {\n phoneNumber,\n ...(displayName ? { displayName } : {}),\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<CommunicationWhatsAppConnectResult>(result);\n }\n}\n\n//#endregion\n\n//#endregion\n","import { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPRuntimeCommandResult,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\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 { Injectable, inject } from '@angular/core';\nimport { defaultTo, trim } from 'lodash-es';\nimport {\n RootConfig,\n type CommunicationMetaWhatsAppTenantConnectionConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { resolveCommunicationMetaCommandError } from '../../commands/communication-meta-command-error.util';\nimport { CommunicationMetaCommandI18n } from '../../commands/communication-meta-command.i18n';\nimport { AXECommunicationWhatsAppConnectDialogService } from './communication-whatsapp-connect-dialog.service';\n\nexport interface ConnectWhatsAppCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface WhatsAppTenantConnectFormContext {\n accessToken: string;\n phoneNumberId: string;\n webhookVerifyToken: string;\n appSecret: string;\n}\n\ninterface WhatsAppTenantConnectFormResult {\n accessToken: string;\n phoneNumberId: string;\n webhookVerifyToken: string;\n appSecret: string;\n}\n\n//#region ---- Connect WhatsApp (tenant Cloud API or user link) ----\n\n@Injectable({ providedIn: 'root' })\nexport class ConnectWhatsAppCommand implements AXPCommand<ConnectWhatsAppCommandInput, ConnectCommandResult> {\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly connectDialog = inject(AXECommunicationWhatsAppConnectDialogService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toastService = inject(AXToastService);\n private readonly translationService = inject(AXTranslationService);\n\n async execute(input: ConnectWhatsAppCommandInput = {}): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n const connectionScope = input.connectionScope ?? AXP_INTEGRATION_CONNECTION_SCOPE.User;\n if (connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {\n return this.connectTenantCloudApi(input);\n }\n return this.connectUserLink(input);\n }\n\n private async connectTenantCloudApi(\n input: ConnectWhatsAppCommandInput,\n ): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = AXP_INTEGRATION_CONNECTION_SCOPE.Tenant;\n const I18N = `@${RootConfig.config.i18n}:integration.connect.tenant`;\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n const existingConfig = (existing?.config ?? {}) as CommunicationMetaWhatsAppTenantConnectionConfig;\n\n const form = await this.openTenantConnectDialog({\n i18nPrefix: I18N,\n isReconfigure,\n context: {\n accessToken: isReconfigure ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n phoneNumberId: existingConfig.phoneNumberId ?? '',\n webhookVerifyToken: isReconfigure && existingConfig.webhookVerifyToken\n ? AXP_INTEGRATION_CREDENTIAL_MASK\n : '',\n appSecret: isReconfigure && existingConfig.appSecret ? AXP_INTEGRATION_CREDENTIAL_MASK : '',\n },\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let accessToken = trim(form.accessToken);\n if (isMaskedIntegrationCredential(accessToken) && existing) {\n accessToken = trim(existingConfig.accessToken ?? '');\n }\n\n let webhookVerifyToken = trim(form.webhookVerifyToken);\n if (isMaskedIntegrationCredential(webhookVerifyToken) && existing) {\n webhookVerifyToken = trim(existingConfig.webhookVerifyToken ?? '');\n }\n\n let appSecret = trim(form.appSecret);\n if (isMaskedIntegrationCredential(appSecret) && existing) {\n appSecret = trim(existingConfig.appSecret ?? '');\n }\n\n const phoneNumberId = trim(form.phoneNumberId);\n if (!accessToken || !phoneNumberId) {\n return {\n success: false,\n message: {\n text: await this.translationService.translateAsync(`${I18N}.messages.credentials-required`),\n },\n };\n }\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? 'WhatsApp',\n externalAccountId: phoneNumberId,\n externalAccountName: AXP_INTEGRATION_CREDENTIAL_MASK,\n config: {\n accessToken,\n phoneNumberId,\n webhookVerifyToken: webhookVerifyToken || null,\n appSecret: appSecret || null,\n },\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n this.toastService.success(\n await this.translationService.translateAsync(`${I18N}.messages.success`),\n );\n\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(connection),\n },\n };\n } catch (error: unknown) {\n const { displayText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n CommunicationMetaCommandI18n.connect.failed,\n );\n return { success: false, message: { text: displayText } };\n }\n }\n\n private async connectUserLink(\n input: ConnectWhatsAppCommandInput,\n ): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = AXP_INTEGRATION_CONNECTION_SCOPE.User;\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n\n const linked = await this.connectDialog.openAndLinkAccount();\n if (!linked || typeof linked !== 'object' || !('phoneNumber' in linked)) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const phoneNumber = trim(linked.phoneNumber);\n if (!phoneNumber) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const displayName = defaultTo(trim(linked.displayName), 'WhatsApp');\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? displayName,\n externalAccountId: phoneNumber,\n externalAccountName: displayName,\n config: {\n phoneNumber,\n displayName: displayName || null,\n },\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n this.toastService.success(\n await this.translationService.translateAsync(\n '@extensions-communication-meta:integration.connect.messages.success',\n ),\n );\n\n return { success: true, kind: 'object',\n data: {\n outcome: 'connected',\n connection: toSafeIntegrationConnectionDto(connection),\n },\n };\n } catch (error: unknown) {\n const { displayText } = await resolveCommunicationMetaCommandError(\n this.translationService,\n error,\n CommunicationMetaCommandI18n.connect.failed,\n );\n return { success: false, message: { text: displayText } };\n }\n }\n\n private async openTenantConnectDialog(input: {\n i18nPrefix: string;\n isReconfigure: boolean;\n context: WhatsAppTenantConnectFormContext;\n }): Promise<WhatsAppTenantConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<WhatsAppTenantConnectFormResult | null>((dialog: IDialogBuilder<WhatsAppTenantConnectFormResult | null>) => {\n dialog\n .setTitle(\n input.isReconfigure\n ? `${input.i18nPrefix}.dialog.configure-title`\n : `${input.i18nPrefix}.dialog.title`,\n )\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: `${input.i18nPrefix}.dialog.instructions`,\n })\n .formField(`${input.i18nPrefix}.dialog.fields.access-token`, (field) => {\n field.path('accessToken');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.access-token`,\n revealToggle: true,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.phone-number-id`, (field) => {\n field.path('phoneNumberId');\n field.textBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.phone-number-id`,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.webhook-verify-token`, (field) => {\n field.path('webhookVerifyToken');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.webhook-verify-token`,\n revealToggle: true,\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.app-secret`, (field) => {\n field.path('appSecret');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.app-secret`,\n revealToggle: true,\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${input.i18nPrefix}.dialog.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n const ctx = ref.context() as WhatsAppTenantConnectFormContext;\n const accessToken = trim(ctx.accessToken);\n const phoneNumberId = trim(ctx.phoneNumberId);\n if (!accessToken || !phoneNumberId) {\n throw new Error(`${input.i18nPrefix}.messages.credentials-required`);\n }\n return {\n accessToken,\n phoneNumberId,\n webhookVerifyToken: trim(ctx.webhookVerifyToken),\n appSecret: trim(ctx.appSecret),\n };\n });\n })\n .show();\n\n return resolveLayoutBuilderDialogResult<WhatsAppTenantConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],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;oBACX,aAAa;AACb,oBAAA,kBAAkB,EAAE,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC;AAChD,oBAAA,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;iBAC/B;AACH,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAkC,MAAM,CAAC;IAClF;8GA9PW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,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,sBAAsB,cADT,MAAM,EAAA,CAAA,CAAA;;2FACnB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBADlC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -316,11 +316,11 @@ class AXECommunicationMetaExtensionModule {
316
316
  provideCommandSetups([
317
317
  {
318
318
  key: AXECommunicationMetaCommandKeys.TestWhatsApp,
319
- command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
319
+ command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
320
320
  },
321
321
  {
322
322
  key: AXECommunicationMetaCommandKeys.ConnectionConnect,
323
- command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs').then((m) => m.ConnectWhatsAppCommand),
323
+ command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs').then((m) => m.ConnectWhatsAppCommand),
324
324
  },
325
325
  ]),
326
326
  {
@@ -355,11 +355,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
355
355
  provideCommandSetups([
356
356
  {
357
357
  key: AXECommunicationMetaCommandKeys.TestWhatsApp,
358
- command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
358
+ command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-CKhPUzwj.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
359
359
  },
360
360
  {
361
361
  key: AXECommunicationMetaCommandKeys.ConnectionConnect,
362
- command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs').then((m) => m.ConnectWhatsAppCommand),
362
+ command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-BtOQhPG9.mjs').then((m) => m.ConnectWhatsAppCommand),
363
363
  },
364
364
  ]),
365
365
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-communication-meta-client",
3
- "version": "1.0.2",
3
+ "version": "2.0.0-beta.0",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0 || ^22.0.0",