@acorex-platform/extension-communication-meta-client 0.0.21

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.
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Meta communication extension (WhatsApp Cloud API first; Messenger / Instagram later).
3
+ * Package group: libs/extensions/communication/meta — no separate core lib.
4
+ */
5
+ const RootConfig = {
6
+ module: {
7
+ name: 'CommunicationMetaExtension',
8
+ icon: 'fa-brands fa-whatsapp',
9
+ },
10
+ config: {
11
+ i18n: 'extensions-communication-meta',
12
+ },
13
+ integration: {
14
+ /** WhatsApp Cloud API — first Meta messaging product in this extension. */
15
+ channelKey: 'whatsapp',
16
+ providerId: 'whatsapp',
17
+ },
18
+ };
19
+ const AXPCommunicationMetaSettingKeys = {
20
+ DebugRedirectPhoneNumber: 'CommunicationMetaExtension:Setting:Debug.Redirect.PhoneNumber',
21
+ UserDeliveryChannelEnabled: 'CommunicationMetaExtension:Setting:User.Whatsapp.DeliveryChannel.Enabled',
22
+ };
23
+ /** Keys seeded at platform scope on startup (never include secrets). */
24
+ const AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS = {
25
+ [AXPCommunicationMetaSettingKeys.DebugRedirectPhoneNumber]: '',
26
+ };
27
+ const AXP_COMMUNICATION_META_SETTING_DEFAULTS = {
28
+ ...AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS,
29
+ [AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled]: true,
30
+ };
31
+ const AXECommunicationMetaCommandKeys = {
32
+ TestWhatsApp: 'CommunicationMetaExtension:Communication:TestWhatsApp',
33
+ ConnectionConnect: 'CommunicationMetaExtension:Integration:ConnectWhatsApp',
34
+ };
35
+
36
+ /** Shared communication integration domain (Telegram, WhatsApp, …). */
37
+ const AXE_COMMUNICATION_DOMAIN_ID = 'communication';
38
+
39
+ const AXP_COMMUNICATION_META_ERROR_CODES = {
40
+ PHONE_NUMBER_REQUIRED: 'COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_REQUIRED',
41
+ ACCESS_TOKEN_NOT_CONFIGURED: 'COMMUNICATION_META_WHATSAPP_ACCESS_TOKEN_NOT_CONFIGURED',
42
+ PHONE_NUMBER_ID_NOT_CONFIGURED: 'COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_ID_NOT_CONFIGURED',
43
+ TENANT_REQUIRED: 'COMMUNICATION_META_WHATSAPP_TENANT_REQUIRED',
44
+ RECIPIENT_NOT_FOUND: 'COMMUNICATION_META_WHATSAPP_RECIPIENT_NOT_FOUND',
45
+ UNAUTHORIZED: 'COMMUNICATION_META_WHATSAPP_UNAUTHORIZED',
46
+ OUTSIDE_WINDOW: 'COMMUNICATION_META_WHATSAPP_OUTSIDE_WINDOW',
47
+ API_ERROR: 'COMMUNICATION_META_WHATSAPP_API_ERROR',
48
+ };
49
+
50
+ //#region ---- WhatsApp test types ----
51
+ //#endregion
52
+
53
+ /**
54
+ * Generated bundle index. Do not edit.
55
+ */
56
+
57
+ export { AXECommunicationMetaCommandKeys, AXE_COMMUNICATION_DOMAIN_ID, AXPCommunicationMetaSettingKeys, AXP_COMMUNICATION_META_ERROR_CODES, AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS, AXP_COMMUNICATION_META_SETTING_DEFAULTS, RootConfig };
58
+ //# sourceMappingURL=acorex-platform-extension-communication-meta-client-contracts.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-communication-meta-client-contracts.mjs","sources":["../../../../libs/extensions/communication/meta/contracts/src/root-config.ts","../../../../libs/extensions/communication/meta/contracts/src/integration-domain.constants.ts","../../../../libs/extensions/communication/meta/contracts/src/communication-meta.errors.ts","../../../../libs/extensions/communication/meta/contracts/src/communication-meta.test.types.ts","../../../../libs/extensions/communication/meta/contracts/src/acorex-platform-extension-communication-meta-client-contracts.ts"],"sourcesContent":["/**\n * Meta communication extension (WhatsApp Cloud API first; Messenger / Instagram later).\n * Package group: libs/extensions/communication/meta — no separate core lib.\n */\nexport const RootConfig = {\n module: {\n name: 'CommunicationMetaExtension',\n icon: 'fa-brands fa-whatsapp',\n },\n config: {\n i18n: 'extensions-communication-meta',\n },\n integration: {\n /** WhatsApp Cloud API — first Meta messaging product in this extension. */\n channelKey: 'whatsapp',\n providerId: 'whatsapp',\n },\n} as const;\n\nexport const AXPCommunicationMetaSettingKeys = {\n DebugRedirectPhoneNumber: 'CommunicationMetaExtension:Setting:Debug.Redirect.PhoneNumber',\n UserDeliveryChannelEnabled: 'CommunicationMetaExtension:Setting:User.Whatsapp.DeliveryChannel.Enabled',\n} as const;\n\n/** Keys seeded at platform scope on startup (never include secrets). */\nexport const AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS: Record<string, unknown> = {\n [AXPCommunicationMetaSettingKeys.DebugRedirectPhoneNumber]: '',\n};\n\nexport const AXP_COMMUNICATION_META_SETTING_DEFAULTS: Record<string, unknown> = {\n ...AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS,\n [AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled]: true,\n};\n\nexport const AXECommunicationMetaCommandKeys = {\n TestWhatsApp: 'CommunicationMetaExtension:Communication:TestWhatsApp',\n ConnectionConnect: 'CommunicationMetaExtension:Integration:ConnectWhatsApp',\n} as const;\n","/** Shared communication integration domain (Telegram, WhatsApp, …). */\nexport const AXE_COMMUNICATION_DOMAIN_ID = 'communication';\n","export const AXP_COMMUNICATION_META_ERROR_CODES = {\n PHONE_NUMBER_REQUIRED: 'COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_REQUIRED',\n ACCESS_TOKEN_NOT_CONFIGURED: 'COMMUNICATION_META_WHATSAPP_ACCESS_TOKEN_NOT_CONFIGURED',\n PHONE_NUMBER_ID_NOT_CONFIGURED: 'COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_ID_NOT_CONFIGURED',\n TENANT_REQUIRED: 'COMMUNICATION_META_WHATSAPP_TENANT_REQUIRED',\n RECIPIENT_NOT_FOUND: 'COMMUNICATION_META_WHATSAPP_RECIPIENT_NOT_FOUND',\n UNAUTHORIZED: 'COMMUNICATION_META_WHATSAPP_UNAUTHORIZED',\n OUTSIDE_WINDOW: 'COMMUNICATION_META_WHATSAPP_OUTSIDE_WINDOW',\n API_ERROR: 'COMMUNICATION_META_WHATSAPP_API_ERROR',\n} as const;\n\nexport type AXPCommunicationMetaErrorCode =\n (typeof AXP_COMMUNICATION_META_ERROR_CODES)[keyof typeof AXP_COMMUNICATION_META_ERROR_CODES];\n\nexport interface AXPCommunicationMetaApiErrorPayload {\n code: AXPCommunicationMetaErrorCode;\n description?: string;\n}\n","//#region ---- WhatsApp test types ----\n\nexport interface CommunicationMetaWhatsAppTestInput {\n phoneNumber: string;\n}\n\nexport interface CommunicationMetaWhatsAppTestResult {\n phoneNumber: string;\n messageId?: string;\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;;AAGG;AACI,MAAM,UAAU,GAAG;AACxB,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,4BAA4B;AAClC,QAAA,IAAI,EAAE,uBAAuB;AAC9B,KAAA;AACD,IAAA,MAAM,EAAE;AACN,QAAA,IAAI,EAAE,+BAA+B;AACtC,KAAA;AACD,IAAA,WAAW,EAAE;;AAEX,QAAA,UAAU,EAAE,UAAU;AACtB,QAAA,UAAU,EAAE,UAAU;AACvB,KAAA;;AAGI,MAAM,+BAA+B,GAAG;AAC7C,IAAA,wBAAwB,EAAE,+DAA+D;AACzF,IAAA,0BAA0B,EAAE,0EAA0E;;AAGxG;AACO,MAAM,6CAA6C,GAA4B;AACpF,IAAA,CAAC,+BAA+B,CAAC,wBAAwB,GAAG,EAAE;;AAGzD,MAAM,uCAAuC,GAA4B;AAC9E,IAAA,GAAG,6CAA6C;AAChD,IAAA,CAAC,+BAA+B,CAAC,0BAA0B,GAAG,IAAI;;AAG7D,MAAM,+BAA+B,GAAG;AAC7C,IAAA,YAAY,EAAE,uDAAuD;AACrE,IAAA,iBAAiB,EAAE,wDAAwD;;;ACpC7E;AACO,MAAM,2BAA2B,GAAG;;ACDpC,MAAM,kCAAkC,GAAG;AAChD,IAAA,qBAAqB,EAAE,mDAAmD;AAC1E,IAAA,2BAA2B,EAAE,yDAAyD;AACtF,IAAA,8BAA8B,EAAE,4DAA4D;AAC5F,IAAA,eAAe,EAAE,6CAA6C;AAC9D,IAAA,mBAAmB,EAAE,iDAAiD;AACtE,IAAA,YAAY,EAAE,0CAA0C;AACxD,IAAA,cAAc,EAAE,4CAA4C;AAC5D,IAAA,SAAS,EAAE,uCAAuC;;;ACRpD;AAWA;;ACXA;;AAEG;;;;"}
@@ -0,0 +1,483 @@
1
+ import { AXMIntegrationConnectionManager, hasConfiguredIntegrationCredentials, AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';
2
+ import { AXP_SETTING_DEFINITION_PROVIDER, AXP_INTEGRATION_DOMAIN_PROVIDER, AXP_INTEGRATION_PROVIDER, AXP_INTEGRATION_RUNTIME_PROVIDER } from '@acorex-platform/framework-client/common';
3
+ import { AXP_LOGO_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';
4
+ import { provideCommandSetups } from '@acorex-platform/framework-client/runtime';
5
+ import * as i0 from '@angular/core';
6
+ import { Injectable, inject, NgModule, input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { RootConfig, AXE_COMMUNICATION_DOMAIN_ID, AXECommunicationMetaCommandKeys, AXP_COMMUNICATION_META_SETTING_DEFAULTS, AXPCommunicationMetaSettingKeys } from '@acorex-platform/extension-communication-meta-client/contracts';
8
+ import { AXP_INTEGRATION_CATEGORY, AXP_INTEGRATION_AUTH_METHOD_TYPE, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CAPABILITY, AXP_INTEGRATION_CONNECTION_STATUS, AXPWidgetsList } from '@acorex-platform/framework-shared/core';
9
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
10
+ import { AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP, AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION } from '@acorex-platform/module-platform-dev-tools-client/contracts';
11
+ import { resolveCommunicationDeliveryChannelsSettingsSection } from '@acorex-platform/module-communication-management-client';
12
+ import { AXP_TEXT_TEMPLATE_CHANNEL_DEFINITION_PROVIDER } from '@acorex-platform/module-content-management-client';
13
+
14
+ const I18N = `@${RootConfig.config.i18n}:integration.domain`;
15
+ //#region ---- Communication integration domain ----
16
+ class AXECommunicationMetaIntegrationDomainProvider {
17
+ async provide(context) {
18
+ context.register({
19
+ id: AXE_COMMUNICATION_DOMAIN_ID,
20
+ module: RootConfig.module.name,
21
+ displayName: `${I18N}.title`,
22
+ description: `${I18N}.description`,
23
+ icon: 'fa-light fa-comments',
24
+ category: AXP_INTEGRATION_CATEGORY.Messaging,
25
+ capabilities: [],
26
+ settingsGroup: AXE_COMMUNICATION_DOMAIN_ID,
27
+ sortOrder: 20,
28
+ });
29
+ }
30
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaIntegrationDomainProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaIntegrationDomainProvider }); }
32
+ }
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaIntegrationDomainProvider, decorators: [{
34
+ type: Injectable
35
+ }] });
36
+
37
+ //#region ---- WhatsApp logo registry key ----
38
+ const axpWhatsAppLogoKey = 'whatsapp';
39
+ //#endregion
40
+
41
+ //#region ---- WhatsApp integration provider ----
42
+ class AXECommunicationWhatsAppIntegrationProvider {
43
+ async provide(context) {
44
+ const I18N = `@${RootConfig.config.i18n}:integration`;
45
+ context.register({
46
+ domainId: AXE_COMMUNICATION_DOMAIN_ID,
47
+ id: RootConfig.integration.providerId,
48
+ module: RootConfig.module.name,
49
+ displayName: `${I18N}.display-name`,
50
+ description: `${I18N}.description`,
51
+ icon: RootConfig.module.icon,
52
+ logoKey: axpWhatsAppLogoKey,
53
+ capabilities: [AXP_INTEGRATION_CAPABILITY.Messaging],
54
+ connectionScopes: [
55
+ AXP_INTEGRATION_CONNECTION_SCOPE.Tenant,
56
+ AXP_INTEGRATION_CONNECTION_SCOPE.User,
57
+ ],
58
+ allowMultipleConnections: false,
59
+ defaultConnectionKey: 'default',
60
+ connectCommandKey: AXECommunicationMetaCommandKeys.ConnectionConnect,
61
+ connectDisabledBadgeKey: `@${RootConfig.config.i18n}:settings.user-integration.not-configured-badge`,
62
+ connectDisabledMessageKey: `@${RootConfig.config.i18n}:settings.user-integration.not-configured-notice`,
63
+ manageActions: [
64
+ {
65
+ titleKey: `@${RootConfig.config.i18n}:settings.whatsapp.test.action`,
66
+ commandKey: AXECommunicationMetaCommandKeys.TestWhatsApp,
67
+ icon: 'fa-brands fa-whatsapp',
68
+ color: 'primary',
69
+ connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],
70
+ },
71
+ ],
72
+ authMethods: [
73
+ {
74
+ type: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,
75
+ label: `${I18N}.auth.link.label`,
76
+ instructions: `${I18N}.auth.link.instructions`,
77
+ supportsValidation: true,
78
+ fields: [],
79
+ },
80
+ ],
81
+ });
82
+ }
83
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
84
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationProvider }); }
85
+ }
86
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationProvider, decorators: [{
87
+ type: Injectable
88
+ }] });
89
+
90
+ //#region ---- WhatsApp integration runtime ----
91
+ class AXECommunicationWhatsAppIntegrationRuntimeProvider {
92
+ constructor() {
93
+ this.providerId = RootConfig.integration.providerId;
94
+ this.connectionManager = inject(AXMIntegrationConnectionManager);
95
+ }
96
+ async getHooks() {
97
+ return {
98
+ getConnectAvailability: (ctx) => this.isConnectAvailable(ctx),
99
+ validateConnection: (ctx) => this.validateConnection(ctx),
100
+ };
101
+ }
102
+ async isConnectAvailable(ctx) {
103
+ if (ctx?.connectionScope !== AXP_INTEGRATION_CONNECTION_SCOPE.User) {
104
+ return true;
105
+ }
106
+ const tenantConnection = await this.connectionManager.findByUniqueKey({
107
+ providerId: RootConfig.integration.providerId,
108
+ connectionScope: AXP_INTEGRATION_CONNECTION_SCOPE.Tenant,
109
+ connectionKey: 'default',
110
+ });
111
+ return hasConfiguredIntegrationCredentials(tenantConnection);
112
+ }
113
+ async validateConnection(ctx) {
114
+ if (ctx.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {
115
+ const config = (ctx.config ?? {});
116
+ const accessToken = String(config.accessToken ?? '').trim();
117
+ const phoneNumberId = String(config.phoneNumberId ?? '').trim();
118
+ if (!accessToken || !phoneNumberId) {
119
+ return {
120
+ valid: false,
121
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
122
+ errorMessage: 'WhatsApp Cloud API credentials are incomplete on the connection.',
123
+ };
124
+ }
125
+ return {
126
+ valid: true,
127
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
128
+ externalAccountId: phoneNumberId,
129
+ externalAccountName: phoneNumberId,
130
+ };
131
+ }
132
+ const config = (ctx.config ?? {});
133
+ const phoneNumber = String(config.phoneNumber ?? '').trim();
134
+ if (!phoneNumber) {
135
+ return {
136
+ valid: false,
137
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,
138
+ errorMessage: 'WhatsApp phone number is missing from the connection.',
139
+ };
140
+ }
141
+ const displayName = String(config.displayName ?? '').trim();
142
+ return {
143
+ valid: true,
144
+ status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,
145
+ externalAccountId: phoneNumber,
146
+ externalAccountName: displayName || phoneNumber,
147
+ };
148
+ }
149
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationRuntimeProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
150
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationRuntimeProvider }); }
151
+ }
152
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppIntegrationRuntimeProvider, decorators: [{
153
+ type: Injectable
154
+ }] });
155
+
156
+ const whatsAppLogoProvider = {
157
+ key: axpWhatsAppLogoKey,
158
+ resolve: async (request) => ({
159
+ kind: 'component',
160
+ load: () => Promise.resolve().then(function () { return whatsappLogo_component; }).then((module) => module.AXECommunicationWhatsAppLogoComponent),
161
+ inputs: {
162
+ appearance: request.appearance,
163
+ size: request.size,
164
+ },
165
+ }),
166
+ };
167
+ const AXE_WHATSAPP_LOGO_PROVIDER = {
168
+ provide: AXP_LOGO_PROVIDER,
169
+ useValue: whatsAppLogoProvider,
170
+ multi: true,
171
+ };
172
+
173
+ const CommunicationMetaExtensionManifest = {
174
+ name: RootConfig.module.name,
175
+ version: '1.0.0',
176
+ title: `@${RootConfig.config.i18n}:integration.display-name`,
177
+ icon: RootConfig.module.icon,
178
+ i18n: RootConfig.config.i18n,
179
+ type: 'integration',
180
+ domain: 'communication',
181
+ dependencies: [],
182
+ };
183
+
184
+ const INTEGRATIONS_SETTINGS_GROUP = 'integrations';
185
+ const USER_INTEGRATION_I18N = `@${RootConfig.config.i18n}:settings.user-integration`;
186
+ const DELIVERY_CHANNEL_I18N = `@${RootConfig.config.i18n}:settings.delivery-channel`;
187
+ const DEV_TOOLS_I18N = '@platform-dev-tools:settings.communication-debug-redirect';
188
+ const DELIVERY_CHANNEL_VISIBILITY = `{{ integration.isUserConnected('${RootConfig.integration.providerId}') }}`;
189
+ //#region ---- Meta / WhatsApp settings provider ----
190
+ class AXECommunicationMetaSettingsProvider {
191
+ constructor() {
192
+ this.sessionService = inject(AXPSessionService);
193
+ }
194
+ async provide(context) {
195
+ // User-facing WhatsApp settings only when the edition entitles this extension.
196
+ if (this.sessionService.isModuleEnabled(RootConfig.module.name)) {
197
+ this.registerDeliveryChannelPreference(context);
198
+ this.registerUserIntegrationSettings(context);
199
+ }
200
+ this.registerDevToolsRedirectSettings(context);
201
+ }
202
+ /** User-scope receive toggle — only when WhatsApp integration is wired in this app. */
203
+ registerDeliveryChannelPreference(context) {
204
+ if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {
205
+ return;
206
+ }
207
+ const section = resolveCommunicationDeliveryChannelsSettingsSection(context);
208
+ if (!section) {
209
+ return;
210
+ }
211
+ section
212
+ .addSetting({
213
+ key: AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled,
214
+ title: `${DELIVERY_CHANNEL_I18N}.title`,
215
+ scope: 'U',
216
+ overridableAt: [],
217
+ isInherited: true,
218
+ defaultValue: AXP_COMMUNICATION_META_SETTING_DEFAULTS[AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled],
219
+ widget: {
220
+ type: AXPWidgetsList.Editors.ToggleSwitch,
221
+ options: { visibility: DELIVERY_CHANNEL_VISIBILITY },
222
+ },
223
+ description: `${DELIVERY_CHANNEL_I18N}.description`,
224
+ })
225
+ .endSection();
226
+ }
227
+ registerDevToolsRedirectSettings(context) {
228
+ const section = resolveCommunicationDebugRedirectSection(context);
229
+ if (!section) {
230
+ return;
231
+ }
232
+ section
233
+ .addSetting({
234
+ key: AXPCommunicationMetaSettingKeys.DebugRedirectPhoneNumber,
235
+ title: `${DEV_TOOLS_I18N}.whatsapp-phone-number.title`,
236
+ scope: 'P',
237
+ overridableAt: [],
238
+ isInherited: false,
239
+ defaultValue: '',
240
+ widget: {
241
+ type: AXPWidgetsList.Editors.TextBox,
242
+ },
243
+ description: `${DEV_TOOLS_I18N}.whatsapp-phone-number.description`,
244
+ })
245
+ .endSection();
246
+ }
247
+ registerUserIntegrationSettings(context) {
248
+ if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {
249
+ return;
250
+ }
251
+ const integrations = context.group(INTEGRATIONS_SETTINGS_GROUP);
252
+ if (!integrations) {
253
+ return;
254
+ }
255
+ integrations
256
+ .addSection('whatsapp', `${USER_INTEGRATION_I18N}.section-title`, `${USER_INTEGRATION_I18N}.section-description`)
257
+ .addSetting({
258
+ key: 'WhatsApp:Setting:ConnectionPanel',
259
+ title: `${USER_INTEGRATION_I18N}.connection-title`,
260
+ scope: 'U',
261
+ overridableAt: [],
262
+ isInherited: false,
263
+ widget: {
264
+ type: AXPWidgetsList.Advanced.IntegrationConnectionsPanel,
265
+ layout: { stacked: true },
266
+ options: {
267
+ providerId: RootConfig.integration.providerId,
268
+ connectionScope: 'user',
269
+ },
270
+ },
271
+ description: `${USER_INTEGRATION_I18N}.connection-description`,
272
+ })
273
+ .endSection();
274
+ }
275
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaSettingsProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
276
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaSettingsProvider }); }
277
+ }
278
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaSettingsProvider, decorators: [{
279
+ type: Injectable
280
+ }] });
281
+ function resolveCommunicationDebugRedirectSection(context) {
282
+ const devTools = context.group(AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP);
283
+ if (!devTools) {
284
+ return null;
285
+ }
286
+ const hasSection = context
287
+ .getGroup(AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP)
288
+ ?.sections.some((section) => section.name === AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION);
289
+ if (hasSection) {
290
+ return devTools.section(AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION);
291
+ }
292
+ return devTools.addSection(AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION, `${DEV_TOOLS_I18N}.title`, `${DEV_TOOLS_I18N}.description`);
293
+ }
294
+
295
+ const TEMPLATE_I18N = `@${RootConfig.config.i18n}:templates.channels`;
296
+ //#region ---- WhatsApp text template channel ----
297
+ class AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider {
298
+ getChannels() {
299
+ return [
300
+ {
301
+ name: 'whatsapp',
302
+ communicationChannelKey: RootConfig.integration.channelKey,
303
+ title: `${TEMPLATE_I18N}.whatsapp`,
304
+ type: 'plain',
305
+ hasSubject: true,
306
+ notConfiguredMessageKey: `${TEMPLATE_I18N}.not-configured.whatsapp`,
307
+ configureSettings: {
308
+ group: 'integrations',
309
+ section: 'communication',
310
+ scope: 'T',
311
+ },
312
+ },
313
+ ];
314
+ }
315
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
316
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider }); }
317
+ }
318
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider, decorators: [{
319
+ type: Injectable
320
+ }] });
321
+ //#endregion
322
+ const communicationMetaWhatsAppTextTemplateChannelProvider = {
323
+ provide: AXP_TEXT_TEMPLATE_CHANNEL_DEFINITION_PROVIDER,
324
+ useClass: AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider,
325
+ multi: true,
326
+ };
327
+
328
+ //#region ---- Meta communication extension client module ----
329
+ class AXECommunicationMetaExtensionModule {
330
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaExtensionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
331
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaExtensionModule, imports: [AXMIntegrationManagementModule] }); }
332
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaExtensionModule, providers: [
333
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: CommunicationMetaExtensionManifest, multi: true },
334
+ AXE_WHATSAPP_LOGO_PROVIDER,
335
+ provideCommandSetups([
336
+ {
337
+ key: AXECommunicationMetaCommandKeys.TestWhatsApp,
338
+ command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
339
+ },
340
+ {
341
+ key: AXECommunicationMetaCommandKeys.ConnectionConnect,
342
+ command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs').then((m) => m.ConnectWhatsAppCommand),
343
+ },
344
+ ]),
345
+ {
346
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
347
+ useClass: AXECommunicationMetaSettingsProvider,
348
+ multi: true,
349
+ },
350
+ {
351
+ provide: AXP_INTEGRATION_DOMAIN_PROVIDER,
352
+ useClass: AXECommunicationMetaIntegrationDomainProvider,
353
+ multi: true,
354
+ },
355
+ {
356
+ provide: AXP_INTEGRATION_PROVIDER,
357
+ useClass: AXECommunicationWhatsAppIntegrationProvider,
358
+ multi: true,
359
+ },
360
+ {
361
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
362
+ useClass: AXECommunicationWhatsAppIntegrationRuntimeProvider,
363
+ multi: true,
364
+ },
365
+ communicationMetaWhatsAppTextTemplateChannelProvider,
366
+ ], imports: [AXMIntegrationManagementModule] }); }
367
+ }
368
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationMetaExtensionModule, decorators: [{
369
+ type: NgModule,
370
+ args: [{
371
+ imports: [AXMIntegrationManagementModule],
372
+ providers: [
373
+ { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: CommunicationMetaExtensionManifest, multi: true },
374
+ AXE_WHATSAPP_LOGO_PROVIDER,
375
+ provideCommandSetups([
376
+ {
377
+ key: AXECommunicationMetaCommandKeys.TestWhatsApp,
378
+ command: () => import('./acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs').then((m) => m.CommunicationTestWhatsAppCommand),
379
+ },
380
+ {
381
+ key: AXECommunicationMetaCommandKeys.ConnectionConnect,
382
+ command: () => import('./acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs').then((m) => m.ConnectWhatsAppCommand),
383
+ },
384
+ ]),
385
+ {
386
+ provide: AXP_SETTING_DEFINITION_PROVIDER,
387
+ useClass: AXECommunicationMetaSettingsProvider,
388
+ multi: true,
389
+ },
390
+ {
391
+ provide: AXP_INTEGRATION_DOMAIN_PROVIDER,
392
+ useClass: AXECommunicationMetaIntegrationDomainProvider,
393
+ multi: true,
394
+ },
395
+ {
396
+ provide: AXP_INTEGRATION_PROVIDER,
397
+ useClass: AXECommunicationWhatsAppIntegrationProvider,
398
+ multi: true,
399
+ },
400
+ {
401
+ provide: AXP_INTEGRATION_RUNTIME_PROVIDER,
402
+ useClass: AXECommunicationWhatsAppIntegrationRuntimeProvider,
403
+ multi: true,
404
+ },
405
+ communicationMetaWhatsAppTextTemplateChannelProvider,
406
+ ],
407
+ }]
408
+ }] });
409
+
410
+ class AXPCommunicationMetaClient {
411
+ }
412
+
413
+ //#region ---- WhatsApp mark vector paths ----
414
+ const AXE_WHATSAPP_MARK_GREEN = '#25D366';
415
+ /** Official-style WhatsApp speech-bubble mark (simplified path). */
416
+ const AXE_WHATSAPP_MARK_PATH = 'M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91C21.95 6.45 17.5 2 12.04 2zm5.77 14.05c-.24.68-1.42 1.28-1.96 1.36-.5.07-1.14.1-1.84-.12-.42-.13-.96-.31-1.66-.61-2.92-1.26-4.82-4.21-4.96-4.4-.14-.19-1.15-1.53-1.15-2.92 0-1.39.73-2.07.99-2.35.26-.28.57-.35.76-.35h.55c.17 0 .41-.06.64.49.24.57.81 1.97.88 2.11.07.14.12.31.02.5-.1.19-.14.31-.28.48-.14.17-.29.37-.42.5-.14.14-.28.29-.12.57.17.28.74 1.22 1.59 1.98 1.09.97 2.01 1.27 2.29 1.41.28.14.45.12.61-.07.17-.19.69-.8.87-1.08.19-.28.37-.23.62-.14.26.1 1.64.77 1.92.91.28.14.47.21.54.33.07.12.07.68-.17 1.36z';
417
+ //#endregion
418
+
419
+ //#region ---- WhatsApp brand logo (owned by Meta communication extension) ----
420
+ class AXECommunicationWhatsAppLogoComponent {
421
+ constructor() {
422
+ this.appearance = input('colored', /* @ts-ignore */
423
+ ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
424
+ this.size = input(20, /* @ts-ignore */
425
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
426
+ this.markPath = AXE_WHATSAPP_MARK_PATH;
427
+ this.markGreen = AXE_WHATSAPP_MARK_GREEN;
428
+ this.resolvedAppearance = computed(() => {
429
+ const value = this.appearance();
430
+ return value === 'monochrome' ? 'monochrome' : 'colored';
431
+ }, /* @ts-ignore */
432
+ ...(ngDevMode ? [{ debugName: "resolvedAppearance" }] : /* istanbul ignore next */ []));
433
+ }
434
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppLogoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
435
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXECommunicationWhatsAppLogoComponent, isStandalone: true, selector: "axe-whatsapp-logo", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "inline-flex items-center justify-center" }, ngImport: i0, template: `
436
+ @switch (resolvedAppearance()) {
437
+ @case ('monochrome') {
438
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
439
+ <path fill="currentColor" [attr.d]="markPath" />
440
+ </svg>
441
+ }
442
+ @default {
443
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
444
+ <path [attr.fill]="markGreen" [attr.d]="markPath" />
445
+ </svg>
446
+ }
447
+ }
448
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.Eager }); }
449
+ }
450
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXECommunicationWhatsAppLogoComponent, decorators: [{
451
+ type: Component,
452
+ args: [{
453
+ selector: 'axe-whatsapp-logo',
454
+ host: { class: 'inline-flex items-center justify-center' },
455
+ changeDetection: ChangeDetectionStrategy.Eager,
456
+ template: `
457
+ @switch (resolvedAppearance()) {
458
+ @case ('monochrome') {
459
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
460
+ <path fill="currentColor" [attr.d]="markPath" />
461
+ </svg>
462
+ }
463
+ @default {
464
+ <svg [attr.width]="size()" [attr.height]="size()" viewBox="0 0 24 24" aria-hidden="true">
465
+ <path [attr.fill]="markGreen" [attr.d]="markPath" />
466
+ </svg>
467
+ }
468
+ }
469
+ `,
470
+ }]
471
+ }], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
472
+
473
+ var whatsappLogo_component = /*#__PURE__*/Object.freeze({
474
+ __proto__: null,
475
+ AXECommunicationWhatsAppLogoComponent: AXECommunicationWhatsAppLogoComponent
476
+ });
477
+
478
+ /**
479
+ * Generated bundle index. Do not edit.
480
+ */
481
+
482
+ export { AXECommunicationMetaExtensionModule, AXECommunicationWhatsAppLogoComponent, AXE_WHATSAPP_LOGO_PROVIDER, AXE_WHATSAPP_MARK_GREEN, AXE_WHATSAPP_MARK_PATH, AXPCommunicationMetaClient, axpWhatsAppLogoKey };
483
+ //# sourceMappingURL=acorex-platform-extension-communication-meta-client.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-extension-communication-meta-client.mjs","sources":["../../../../libs/extensions/communication/meta/client/src/lib/integration/communication.integration-domain.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/brand/whatsapp-logo-key.ts","../../../../libs/extensions/communication/meta/client/src/lib/integration/whatsapp.integration.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/integration/whatsapp.integration-runtime.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/brand/whatsapp-logo.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/manifest.ts","../../../../libs/extensions/communication/meta/client/src/lib/settings/communication-meta-settings.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/templates/communication-meta-whatsapp-text-template-channel-definition.provider.ts","../../../../libs/extensions/communication/meta/client/src/lib/communication-meta-extension.module.ts","../../../../libs/extensions/communication/meta/client/src/lib/communication-meta-client.port.ts","../../../../libs/extensions/communication/meta/client/src/lib/brand/whatsapp-mark.paths.ts","../../../../libs/extensions/communication/meta/client/src/lib/brand/whatsapp-logo.component.ts","../../../../libs/extensions/communication/meta/client/src/acorex-platform-extension-communication-meta-client.ts"],"sourcesContent":["import { AXP_INTEGRATION_CATEGORY } from '@acorex-platform/framework-shared/core';\nimport {\n type AXPIntegrationDomainProvider,\n AXPIntegrationDomainProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXE_COMMUNICATION_DOMAIN_ID,\n RootConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\n\nconst I18N = `@${RootConfig.config.i18n}:integration.domain`;\n\n//#region ---- Communication integration domain ----\n\n@Injectable()\nexport class AXECommunicationMetaIntegrationDomainProvider implements AXPIntegrationDomainProvider {\n async provide(context: AXPIntegrationDomainProviderContext): Promise<void> {\n context.register({\n id: AXE_COMMUNICATION_DOMAIN_ID,\n module: RootConfig.module.name,\n displayName: `${I18N}.title`,\n description: `${I18N}.description`,\n icon: 'fa-light fa-comments',\n category: AXP_INTEGRATION_CATEGORY.Messaging,\n capabilities: [],\n settingsGroup: AXE_COMMUNICATION_DOMAIN_ID,\n sortOrder: 20,\n });\n }\n}\n\n//#endregion\n","//#region ---- WhatsApp logo registry key ----\n\nexport const axpWhatsAppLogoKey = 'whatsapp' as const;\n\n//#endregion\n","import {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CAPABILITY,\n AXP_INTEGRATION_CONNECTION_SCOPE,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXPIntegrationProvider,\n AXPIntegrationProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { Injectable } from '@angular/core';\nimport {\n AXE_COMMUNICATION_DOMAIN_ID,\n AXECommunicationMetaCommandKeys,\n RootConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { axpWhatsAppLogoKey } from '../brand/whatsapp-logo-key';\n\n//#region ---- WhatsApp integration provider ----\n\n@Injectable()\nexport class AXECommunicationWhatsAppIntegrationProvider implements AXPIntegrationProvider {\n async provide(context: AXPIntegrationProviderContext): Promise<void> {\n const I18N = `@${RootConfig.config.i18n}:integration`;\n\n context.register({\n domainId: AXE_COMMUNICATION_DOMAIN_ID,\n id: RootConfig.integration.providerId,\n module: RootConfig.module.name,\n displayName: `${I18N}.display-name`,\n description: `${I18N}.description`,\n icon: RootConfig.module.icon,\n logoKey: axpWhatsAppLogoKey,\n capabilities: [AXP_INTEGRATION_CAPABILITY.Messaging],\n connectionScopes: [\n AXP_INTEGRATION_CONNECTION_SCOPE.Tenant,\n AXP_INTEGRATION_CONNECTION_SCOPE.User,\n ],\n allowMultipleConnections: false,\n defaultConnectionKey: 'default',\n connectCommandKey: AXECommunicationMetaCommandKeys.ConnectionConnect,\n connectDisabledBadgeKey: `@${RootConfig.config.i18n}:settings.user-integration.not-configured-badge`,\n connectDisabledMessageKey: `@${RootConfig.config.i18n}:settings.user-integration.not-configured-notice`,\n manageActions: [\n {\n titleKey: `@${RootConfig.config.i18n}:settings.whatsapp.test.action`,\n commandKey: AXECommunicationMetaCommandKeys.TestWhatsApp,\n icon: 'fa-brands fa-whatsapp',\n color: 'primary',\n connectionScopes: [AXP_INTEGRATION_CONNECTION_SCOPE.Tenant],\n },\n ],\n authMethods: [\n {\n type: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n label: `${I18N}.auth.link.label`,\n instructions: `${I18N}.auth.link.instructions`,\n supportsValidation: true,\n fields: [],\n },\n ],\n });\n }\n}\n\n//#endregion\n","import {\n AXP_INTEGRATION_CONNECTION_SCOPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n type AXPIntegrationConnectAvailabilityContext,\n type AXPIntegrationProviderRuntimeHooks,\n type AXPIntegrationRuntimeContext,\n type AXPIntegrationValidationResult,\n} from '@acorex-platform/framework-shared/core';\nimport { type AXPIntegrationRuntimeProvider } from '@acorex-platform/framework-client/common';\nimport {\n AXMIntegrationConnectionManager,\n hasConfiguredIntegrationCredentials,\n} from '@acorex-platform/module-integration-management-client';\nimport { Injectable, inject } from '@angular/core';\nimport {\n RootConfig,\n type CommunicationMetaWhatsAppTenantConnectionConfig,\n type CommunicationMetaWhatsAppUserLinkConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\n\n//#region ---- WhatsApp integration runtime ----\n\n@Injectable()\nexport class AXECommunicationWhatsAppIntegrationRuntimeProvider implements AXPIntegrationRuntimeProvider {\n readonly providerId = RootConfig.integration.providerId;\n\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n\n async getHooks(): Promise<AXPIntegrationProviderRuntimeHooks> {\n return {\n getConnectAvailability: (ctx) => this.isConnectAvailable(ctx),\n validateConnection: (ctx) => this.validateConnection(ctx),\n };\n }\n\n private async isConnectAvailable(\n ctx?: AXPIntegrationConnectAvailabilityContext,\n ): Promise<boolean> {\n if (ctx?.connectionScope !== AXP_INTEGRATION_CONNECTION_SCOPE.User) {\n return true;\n }\n\n const tenantConnection = await this.connectionManager.findByUniqueKey({\n providerId: RootConfig.integration.providerId,\n connectionScope: AXP_INTEGRATION_CONNECTION_SCOPE.Tenant,\n connectionKey: 'default',\n });\n\n return hasConfiguredIntegrationCredentials(tenantConnection);\n }\n\n private async validateConnection(\n ctx: AXPIntegrationRuntimeContext,\n ): Promise<AXPIntegrationValidationResult> {\n if (ctx.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {\n const config = (ctx.config ?? {}) as CommunicationMetaWhatsAppTenantConnectionConfig;\n const accessToken = String(config.accessToken ?? '').trim();\n const phoneNumberId = String(config.phoneNumberId ?? '').trim();\n if (!accessToken || !phoneNumberId) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'WhatsApp Cloud API credentials are incomplete on the connection.',\n };\n }\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountId: phoneNumberId,\n externalAccountName: phoneNumberId,\n };\n }\n\n const config = (ctx.config ?? {}) as unknown as CommunicationMetaWhatsAppUserLinkConfig;\n const phoneNumber = String(config.phoneNumber ?? '').trim();\n\n if (!phoneNumber) {\n return {\n valid: false,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Invalid,\n errorMessage: 'WhatsApp phone number is missing from the connection.',\n };\n }\n\n const displayName = String(config.displayName ?? '').trim();\n return {\n valid: true,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n externalAccountId: phoneNumber,\n externalAccountName: displayName || phoneNumber,\n };\n }\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 { axpWhatsAppLogoKey } from './whatsapp-logo-key';\n\nconst whatsAppLogoProvider: AXPLogoProvider = {\n key: axpWhatsAppLogoKey,\n resolve: async (request: AXPLogoRequest): Promise<AXPLogoView> => ({\n kind: 'component',\n load: () =>\n import('./whatsapp-logo.component').then((module) => module.AXECommunicationWhatsAppLogoComponent),\n inputs: {\n appearance: request.appearance,\n size: request.size,\n },\n }),\n};\n\nexport const AXE_WHATSAPP_LOGO_PROVIDER = {\n provide: AXP_LOGO_PROVIDER,\n useValue: whatsAppLogoProvider,\n multi: true,\n} as const;\n","import { AXPModuleManifest } from '@acorex-platform/framework-client/core';\nimport { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';\n\nexport const CommunicationMetaExtensionManifest: AXPModuleManifest = {\n name: RootConfig.module.name,\n version: '1.0.0',\n title: `@${RootConfig.config.i18n}:integration.display-name`,\n icon: RootConfig.module.icon,\n i18n: RootConfig.config.i18n,\n type: 'integration',\n domain: 'communication',\n dependencies: [],\n};\n","import { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport {\n AXPSettingDefinitionProvider,\n AXPSettingDefinitionProviderContext,\n} from '@acorex-platform/framework-client/common';\nimport { AXPWidgetsList } from '@acorex-platform/framework-shared/core';\nimport { Injectable, inject } from '@angular/core';\nimport {\n AXPCommunicationMetaSettingKeys,\n AXP_COMMUNICATION_META_SETTING_DEFAULTS,\n RootConfig,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\nimport {\n AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION,\n AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP,\n} from '@acorex-platform/module-platform-dev-tools-client/contracts';\nimport { resolveCommunicationDeliveryChannelsSettingsSection } from '@acorex-platform/module-communication-management-client';\n\nconst INTEGRATIONS_SETTINGS_GROUP = 'integrations';\nconst USER_INTEGRATION_I18N = `@${RootConfig.config.i18n}:settings.user-integration`;\nconst DELIVERY_CHANNEL_I18N = `@${RootConfig.config.i18n}:settings.delivery-channel`;\nconst DEV_TOOLS_I18N = '@platform-dev-tools:settings.communication-debug-redirect';\nconst DELIVERY_CHANNEL_VISIBILITY = `{{ integration.isUserConnected('${RootConfig.integration.providerId}') }}`;\n\n//#region ---- Meta / WhatsApp settings provider ----\n\n@Injectable()\nexport class AXECommunicationMetaSettingsProvider implements AXPSettingDefinitionProvider {\n private readonly sessionService = inject(AXPSessionService);\n\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n // User-facing WhatsApp settings only when the edition entitles this extension.\n if (this.sessionService.isModuleEnabled(RootConfig.module.name)) {\n this.registerDeliveryChannelPreference(context);\n this.registerUserIntegrationSettings(context);\n }\n this.registerDevToolsRedirectSettings(context);\n }\n\n /** User-scope receive toggle — only when WhatsApp integration is wired in this app. */\n private registerDeliveryChannelPreference(context: AXPSettingDefinitionProviderContext): void {\n if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {\n return;\n }\n\n const section = resolveCommunicationDeliveryChannelsSettingsSection(context);\n if (!section) {\n return;\n }\n\n section\n .addSetting({\n key: AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled,\n title: `${DELIVERY_CHANNEL_I18N}.title`,\n scope: 'U',\n overridableAt: [],\n isInherited: true,\n defaultValue:\n AXP_COMMUNICATION_META_SETTING_DEFAULTS[\n AXPCommunicationMetaSettingKeys.UserDeliveryChannelEnabled\n ],\n widget: {\n type: AXPWidgetsList.Editors.ToggleSwitch,\n options: { visibility: DELIVERY_CHANNEL_VISIBILITY },\n },\n description: `${DELIVERY_CHANNEL_I18N}.description`,\n })\n .endSection();\n }\n\n private registerDevToolsRedirectSettings(context: AXPSettingDefinitionProviderContext): void {\n const section = resolveCommunicationDebugRedirectSection(context);\n if (!section) {\n return;\n }\n\n section\n .addSetting({\n key: AXPCommunicationMetaSettingKeys.DebugRedirectPhoneNumber,\n title: `${DEV_TOOLS_I18N}.whatsapp-phone-number.title`,\n scope: 'P',\n overridableAt: [],\n isInherited: false,\n defaultValue: '',\n widget: {\n type: AXPWidgetsList.Editors.TextBox,\n },\n description: `${DEV_TOOLS_I18N}.whatsapp-phone-number.description`,\n })\n .endSection();\n }\n\n private registerUserIntegrationSettings(context: AXPSettingDefinitionProviderContext): void {\n if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {\n return;\n }\n\n const integrations = context.group(INTEGRATIONS_SETTINGS_GROUP);\n if (!integrations) {\n return;\n }\n\n integrations\n .addSection('whatsapp', `${USER_INTEGRATION_I18N}.section-title`, `${USER_INTEGRATION_I18N}.section-description`)\n .addSetting({\n key: 'WhatsApp:Setting:ConnectionPanel',\n title: `${USER_INTEGRATION_I18N}.connection-title`,\n scope: 'U',\n overridableAt: [],\n isInherited: false,\n widget: {\n type: AXPWidgetsList.Advanced.IntegrationConnectionsPanel,\n layout: { stacked: true },\n options: {\n providerId: RootConfig.integration.providerId,\n connectionScope: 'user',\n },\n },\n description: `${USER_INTEGRATION_I18N}.connection-description`,\n })\n .endSection();\n }\n}\n\nfunction resolveCommunicationDebugRedirectSection(context: AXPSettingDefinitionProviderContext) {\n const devTools = context.group(AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP);\n if (!devTools) {\n return null;\n }\n\n const hasSection = context\n .getGroup(AXP_PLATFORM_DEV_TOOLS_SETTINGS_GROUP)\n ?.sections.some((section) => section.name === AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION);\n\n if (hasSection) {\n return devTools.section(AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION);\n }\n\n return devTools.addSection(\n AXP_PLATFORM_DEV_TOOLS_COMMUNICATION_DEBUG_REDIRECT_SECTION,\n `${DEV_TOOLS_I18N}.title`,\n `${DEV_TOOLS_I18N}.description`,\n );\n}\n\n//#endregion\n","import { Injectable } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXP_TEXT_TEMPLATE_CHANNEL_DEFINITION_PROVIDER } from '@acorex-platform/module-content-management-client';\nimport type {\n AXMTextTemplateChannelDefinition,\n AXMTextTemplateChannelDefinitionProvider,\n} from '@acorex-platform/module-content-management-client/contracts';\n\nconst TEMPLATE_I18N = `@${RootConfig.config.i18n}:templates.channels`;\n\n//#region ---- WhatsApp text template channel ----\n\n@Injectable()\nexport class AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider\n implements AXMTextTemplateChannelDefinitionProvider\n{\n getChannels(): AXMTextTemplateChannelDefinition[] {\n return [\n {\n name: 'whatsapp',\n communicationChannelKey: RootConfig.integration.channelKey,\n title: `${TEMPLATE_I18N}.whatsapp`,\n type: 'plain',\n hasSubject: true,\n notConfiguredMessageKey: `${TEMPLATE_I18N}.not-configured.whatsapp`,\n configureSettings: {\n group: 'integrations',\n section: 'communication',\n scope: 'T',\n },\n },\n ];\n }\n}\n\n//#endregion\n\nexport const communicationMetaWhatsAppTextTemplateChannelProvider = {\n provide: AXP_TEXT_TEMPLATE_CHANNEL_DEFINITION_PROVIDER,\n useClass: AXECommunicationMetaWhatsAppTextTemplateChannelDefinitionProvider,\n multi: true,\n};\n","import { AXMIntegrationManagementModule } from '@acorex-platform/module-integration-management-client';\nimport {\n AXP_INTEGRATION_DOMAIN_PROVIDER,\n AXP_INTEGRATION_PROVIDER,\n AXP_INTEGRATION_RUNTIME_PROVIDER,\n AXP_SETTING_DEFINITION_PROVIDER,\n} from '@acorex-platform/framework-client/common';\nimport { AXP_MODULE_MANIFEST_PROVIDER } from '@acorex-platform/framework-client/core';\nimport { provideCommandSetups } from '@acorex-platform/framework-client/runtime';\nimport { NgModule } from '@angular/core';\nimport { AXECommunicationMetaCommandKeys } from '@acorex-platform/extension-communication-meta-client/contracts';\nimport { AXECommunicationMetaIntegrationDomainProvider } from './integration/communication.integration-domain.provider';\nimport { AXECommunicationWhatsAppIntegrationProvider } from './integration/whatsapp.integration.provider';\nimport { AXECommunicationWhatsAppIntegrationRuntimeProvider } from './integration/whatsapp.integration-runtime.provider';\nimport { AXE_WHATSAPP_LOGO_PROVIDER } from './brand/whatsapp-logo.provider';\nimport { CommunicationMetaExtensionManifest } from './manifest';\nimport { AXECommunicationMetaSettingsProvider } from './settings/communication-meta-settings.provider';\nimport { communicationMetaWhatsAppTextTemplateChannelProvider } from './templates/communication-meta-whatsapp-text-template-channel-definition.provider';\n\n//#region ---- Meta communication extension client module ----\n\n@NgModule({\n imports: [AXMIntegrationManagementModule],\n providers: [\n { provide: AXP_MODULE_MANIFEST_PROVIDER, useValue: CommunicationMetaExtensionManifest, multi: true },\n AXE_WHATSAPP_LOGO_PROVIDER,\n provideCommandSetups([\n {\n key: AXECommunicationMetaCommandKeys.TestWhatsApp,\n command: () =>\n import('./commands/communication-test-whatsapp.command').then((m) => m.CommunicationTestWhatsAppCommand),\n },\n {\n key: AXECommunicationMetaCommandKeys.ConnectionConnect,\n command: () => import('./features/connect/connect-whatsapp.command').then((m) => m.ConnectWhatsAppCommand),\n },\n ]),\n {\n provide: AXP_SETTING_DEFINITION_PROVIDER,\n useClass: AXECommunicationMetaSettingsProvider,\n multi: true,\n },\n {\n provide: AXP_INTEGRATION_DOMAIN_PROVIDER,\n useClass: AXECommunicationMetaIntegrationDomainProvider,\n multi: true,\n },\n {\n provide: AXP_INTEGRATION_PROVIDER,\n useClass: AXECommunicationWhatsAppIntegrationProvider,\n multi: true,\n },\n {\n provide: AXP_INTEGRATION_RUNTIME_PROVIDER,\n useClass: AXECommunicationWhatsAppIntegrationRuntimeProvider,\n multi: true,\n },\n communicationMetaWhatsAppTextTemplateChannelProvider,\n ],\n})\nexport class AXECommunicationMetaExtensionModule {}\n\n//#endregion\n","import type {\n CommunicationMetaWhatsAppTestInput,\n CommunicationMetaWhatsAppTestResult,\n} from '@acorex-platform/extension-communication-meta-client/contracts';\n\nexport abstract class AXPCommunicationMetaClient {\n abstract testWhatsApp(input: CommunicationMetaWhatsAppTestInput): Promise<CommunicationMetaWhatsAppTestResult>;\n}\n","//#region ---- WhatsApp mark vector paths ----\n\nexport const AXE_WHATSAPP_MARK_GREEN = '#25D366';\n\n/** Official-style WhatsApp speech-bubble mark (simplified path). */\nexport const AXE_WHATSAPP_MARK_PATH =\n 'M12.04 2C6.58 2 2.13 6.45 2.13 11.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91C21.95 6.45 17.5 2 12.04 2zm5.77 14.05c-.24.68-1.42 1.28-1.96 1.36-.5.07-1.14.1-1.84-.12-.42-.13-.96-.31-1.66-.61-2.92-1.26-4.82-4.21-4.96-4.4-.14-.19-1.15-1.53-1.15-2.92 0-1.39.73-2.07.99-2.35.26-.28.57-.35.76-.35h.55c.17 0 .41-.06.64.49.24.57.81 1.97.88 2.11.07.14.12.31.02.5-.1.19-.14.31-.28.48-.14.17-.29.37-.42.5-.14.14-.28.29-.12.57.17.28.74 1.22 1.59 1.98 1.09.97 2.01 1.27 2.29 1.41.28.14.45.12.61-.07.17-.19.69-.8.87-1.08.19-.28.37-.23.62-.14.26.1 1.64.77 1.92.91.28.14.47.21.54.33.07.12.07.68-.17 1.36z';\n\n//#endregion\n","import type { AXPLogoAppearance } from '@acorex-platform/framework-client/core';\nimport { Component, computed, input, ChangeDetectionStrategy } from '@angular/core';\nimport { AXE_WHATSAPP_MARK_GREEN, AXE_WHATSAPP_MARK_PATH } from './whatsapp-mark.paths';\n\n//#region ---- WhatsApp brand logo (owned by Meta communication extension) ----\n\n@Component({\n selector: 'axe-whatsapp-logo',\n host: { class: 'inline-flex items-center justify-center' },\n changeDetection: ChangeDetectionStrategy.Eager,\n template: `\n @switch (resolvedAppearance()) {\n @case ('monochrome') {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path fill=\"currentColor\" [attr.d]=\"markPath\" />\n </svg>\n }\n @default {\n <svg [attr.width]=\"size()\" [attr.height]=\"size()\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path [attr.fill]=\"markGreen\" [attr.d]=\"markPath\" />\n </svg>\n }\n }\n `,\n})\nexport class AXECommunicationWhatsAppLogoComponent {\n appearance = input<AXPLogoAppearance>('colored');\n size = input(20);\n\n protected readonly markPath = AXE_WHATSAPP_MARK_PATH;\n protected readonly markGreen = AXE_WHATSAPP_MARK_GREEN;\n\n protected readonly resolvedAppearance = computed(() => {\n const value = this.appearance();\n return value === 'monochrome' ? 'monochrome' : 'colored';\n });\n}\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAWA,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,mBAAA,CAAqB;AAE5D;MAGa,6CAA6C,CAAA;IACxD,MAAM,OAAO,CAAC,OAA4C,EAAA;QACxD,OAAO,CAAC,QAAQ,CAAC;AACf,YAAA,EAAE,EAAE,2BAA2B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