@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.
- package/fesm2022/acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs +56 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-communication-meta-command-error.util-Be3gOQPr.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs +137 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-communication-test-whatsapp.command-GVjrHXJx.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs +308 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-connect-whatsapp.command-Dpo-31ex.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-contracts.mjs +58 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client.mjs +483 -0
- package/fesm2022/acorex-platform-extension-communication-meta-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-extension-communication-meta-client-contracts.d.ts +76 -0
- package/types/acorex-platform-extension-communication-meta-client.d.ts +38 -0
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@acorex-platform/extension-communication-meta-client",
|
|
3
|
+
"version": "0.0.21",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/common": "^21.0.0",
|
|
7
|
+
"@angular/core": "^21.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"module": "fesm2022/acorex-platform-extension-communication-meta-client.mjs",
|
|
13
|
+
"typings": "types/acorex-platform-extension-communication-meta-client.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/acorex-platform-extension-communication-meta-client.d.ts",
|
|
20
|
+
"default": "./fesm2022/acorex-platform-extension-communication-meta-client.mjs"
|
|
21
|
+
},
|
|
22
|
+
"./contracts": {
|
|
23
|
+
"types": "./types/acorex-platform-extension-communication-meta-client-contracts.d.ts",
|
|
24
|
+
"default": "./fesm2022/acorex-platform-extension-communication-meta-client-contracts.mjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"type": "module"
|
|
28
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
declare const RootConfig: {
|
|
6
|
+
readonly module: {
|
|
7
|
+
readonly name: "CommunicationMetaExtension";
|
|
8
|
+
readonly icon: "fa-brands fa-whatsapp";
|
|
9
|
+
};
|
|
10
|
+
readonly config: {
|
|
11
|
+
readonly i18n: "extensions-communication-meta";
|
|
12
|
+
};
|
|
13
|
+
readonly integration: {
|
|
14
|
+
/** WhatsApp Cloud API — first Meta messaging product in this extension. */
|
|
15
|
+
readonly channelKey: "whatsapp";
|
|
16
|
+
readonly providerId: "whatsapp";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const AXPCommunicationMetaSettingKeys: {
|
|
20
|
+
readonly DebugRedirectPhoneNumber: "CommunicationMetaExtension:Setting:Debug.Redirect.PhoneNumber";
|
|
21
|
+
readonly UserDeliveryChannelEnabled: "CommunicationMetaExtension:Setting:User.Whatsapp.DeliveryChannel.Enabled";
|
|
22
|
+
};
|
|
23
|
+
/** Keys seeded at platform scope on startup (never include secrets). */
|
|
24
|
+
declare const AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS: Record<string, unknown>;
|
|
25
|
+
declare const AXP_COMMUNICATION_META_SETTING_DEFAULTS: Record<string, unknown>;
|
|
26
|
+
declare const AXECommunicationMetaCommandKeys: {
|
|
27
|
+
readonly TestWhatsApp: "CommunicationMetaExtension:Communication:TestWhatsApp";
|
|
28
|
+
readonly ConnectionConnect: "CommunicationMetaExtension:Integration:ConnectWhatsApp";
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** Shared communication integration domain (Telegram, WhatsApp, …). */
|
|
32
|
+
declare const AXE_COMMUNICATION_DOMAIN_ID = "communication";
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Tenant-scoped WhatsApp Cloud API credentials stored on IntegrationConnection.config.
|
|
36
|
+
*/
|
|
37
|
+
interface CommunicationMetaWhatsAppTenantConnectionConfig {
|
|
38
|
+
accessToken?: string;
|
|
39
|
+
phoneNumberId?: string;
|
|
40
|
+
webhookVerifyToken?: string;
|
|
41
|
+
appSecret?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
declare const AXP_COMMUNICATION_META_ERROR_CODES: {
|
|
45
|
+
readonly PHONE_NUMBER_REQUIRED: "COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_REQUIRED";
|
|
46
|
+
readonly ACCESS_TOKEN_NOT_CONFIGURED: "COMMUNICATION_META_WHATSAPP_ACCESS_TOKEN_NOT_CONFIGURED";
|
|
47
|
+
readonly PHONE_NUMBER_ID_NOT_CONFIGURED: "COMMUNICATION_META_WHATSAPP_PHONE_NUMBER_ID_NOT_CONFIGURED";
|
|
48
|
+
readonly TENANT_REQUIRED: "COMMUNICATION_META_WHATSAPP_TENANT_REQUIRED";
|
|
49
|
+
readonly RECIPIENT_NOT_FOUND: "COMMUNICATION_META_WHATSAPP_RECIPIENT_NOT_FOUND";
|
|
50
|
+
readonly UNAUTHORIZED: "COMMUNICATION_META_WHATSAPP_UNAUTHORIZED";
|
|
51
|
+
readonly OUTSIDE_WINDOW: "COMMUNICATION_META_WHATSAPP_OUTSIDE_WINDOW";
|
|
52
|
+
readonly API_ERROR: "COMMUNICATION_META_WHATSAPP_API_ERROR";
|
|
53
|
+
};
|
|
54
|
+
type AXPCommunicationMetaErrorCode = (typeof AXP_COMMUNICATION_META_ERROR_CODES)[keyof typeof AXP_COMMUNICATION_META_ERROR_CODES];
|
|
55
|
+
interface AXPCommunicationMetaApiErrorPayload {
|
|
56
|
+
code: AXPCommunicationMetaErrorCode;
|
|
57
|
+
description?: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** User WhatsApp destination stored on the integration connection config. */
|
|
61
|
+
interface CommunicationMetaWhatsAppUserLinkConfig {
|
|
62
|
+
/** E.164 phone number (digits with country code, optional leading +). */
|
|
63
|
+
phoneNumber: string;
|
|
64
|
+
displayName?: string | null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface CommunicationMetaWhatsAppTestInput {
|
|
68
|
+
phoneNumber: string;
|
|
69
|
+
}
|
|
70
|
+
interface CommunicationMetaWhatsAppTestResult {
|
|
71
|
+
phoneNumber: string;
|
|
72
|
+
messageId?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { AXECommunicationMetaCommandKeys, AXE_COMMUNICATION_DOMAIN_ID, AXPCommunicationMetaSettingKeys, AXP_COMMUNICATION_META_ERROR_CODES, AXP_COMMUNICATION_META_PLATFORM_SEED_DEFAULTS, AXP_COMMUNICATION_META_SETTING_DEFAULTS, RootConfig };
|
|
76
|
+
export type { AXPCommunicationMetaApiErrorPayload, AXPCommunicationMetaErrorCode, CommunicationMetaWhatsAppTenantConnectionConfig, CommunicationMetaWhatsAppTestInput, CommunicationMetaWhatsAppTestResult, CommunicationMetaWhatsAppUserLinkConfig };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as i1 from '@acorex-platform/module-integration-management-client';
|
|
3
|
+
import { CommunicationMetaWhatsAppTestInput, CommunicationMetaWhatsAppTestResult } from '@acorex-platform/extension-communication-meta-client/contracts';
|
|
4
|
+
import { AXPLogoAppearance, AXPLogoProvider } from '@acorex-platform/framework-client/core';
|
|
5
|
+
|
|
6
|
+
declare class AXECommunicationMetaExtensionModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXECommunicationMetaExtensionModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXECommunicationMetaExtensionModule, never, [typeof i1.AXMIntegrationManagementModule], never>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXECommunicationMetaExtensionModule>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare abstract class AXPCommunicationMetaClient {
|
|
13
|
+
abstract testWhatsApp(input: CommunicationMetaWhatsAppTestInput): Promise<CommunicationMetaWhatsAppTestResult>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare class AXECommunicationWhatsAppLogoComponent {
|
|
17
|
+
appearance: i0.InputSignal<AXPLogoAppearance>;
|
|
18
|
+
size: i0.InputSignal<number>;
|
|
19
|
+
protected readonly markPath = "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";
|
|
20
|
+
protected readonly markGreen = "#25D366";
|
|
21
|
+
protected readonly resolvedAppearance: i0.Signal<"colored" | "monochrome">;
|
|
22
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXECommunicationWhatsAppLogoComponent, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AXECommunicationWhatsAppLogoComponent, "axe-whatsapp-logo", never, { "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const axpWhatsAppLogoKey: "whatsapp";
|
|
27
|
+
|
|
28
|
+
declare const AXE_WHATSAPP_MARK_GREEN = "#25D366";
|
|
29
|
+
/** Official-style WhatsApp speech-bubble mark (simplified path). */
|
|
30
|
+
declare 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";
|
|
31
|
+
|
|
32
|
+
declare const AXE_WHATSAPP_LOGO_PROVIDER: {
|
|
33
|
+
readonly provide: i0.InjectionToken<AXPLogoProvider[]>;
|
|
34
|
+
readonly useValue: AXPLogoProvider;
|
|
35
|
+
readonly multi: true;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { AXECommunicationMetaExtensionModule, AXECommunicationWhatsAppLogoComponent, AXE_WHATSAPP_LOGO_PROVIDER, AXE_WHATSAPP_MARK_GREEN, AXE_WHATSAPP_MARK_PATH, AXPCommunicationMetaClient, axpWhatsAppLogoKey };
|