meta-cloud-api 1.1.2 → 1.1.4
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/dist/WebhookProcessor-BUZFeZD_.js +3 -0
- package/dist/WebhookProcessor-BUZFeZD_.js.map +1 -0
- package/dist/WebhookProcessor-Dq2Pa2cY.d.ts +718 -0
- package/dist/WebhookProcessor-Dq2Pa2cY.d.ts.map +1 -0
- package/dist/api/encryption/index.d.ts +3 -10
- package/dist/api/encryption/index.js +1 -2
- package/dist/api/flow/index.d.ts +5 -11
- package/dist/api/flow/index.js +1 -2
- package/dist/api/index.d.ts +17 -18
- package/dist/api/index.js +1 -2
- package/dist/api/media/index.d.ts +3 -10
- package/dist/api/media/index.js +1 -2
- package/dist/api/messages/builders/index.d.ts +442 -439
- package/dist/api/messages/builders/index.d.ts.map +1 -0
- package/dist/api/messages/builders/index.js +1 -3
- package/dist/api/messages/builders/index.js.map +1 -1
- package/dist/api/messages/index.d.ts +4 -10
- package/dist/api/messages/index.js +1 -2
- package/dist/api/phone/index.d.ts +3 -10
- package/dist/api/phone/index.js +1 -2
- package/dist/api/profile/index.d.ts +3 -10
- package/dist/api/profile/index.js +1 -2
- package/dist/api/qrCode/index.d.ts +3 -10
- package/dist/api/qrCode/index.js +1 -2
- package/dist/api/registration/index.d.ts +3 -10
- package/dist/api/registration/index.js +1 -2
- package/dist/api/template/index.d.ts +3 -21
- package/dist/api/template/index.js +1 -2
- package/dist/api/twoStepVerification/index.d.ts +3 -10
- package/dist/api/twoStepVerification/index.js +1 -2
- package/dist/api/waba/index.d.ts +3 -10
- package/dist/api/waba/index.js +1 -2
- package/dist/api-8hRAOyaL.js +1 -0
- package/dist/base-CfDkvT1x.d.ts +807 -0
- package/dist/base-CfDkvT1x.d.ts.map +1 -0
- package/dist/base-D-cXu_lA.js +2 -0
- package/dist/base-D-cXu_lA.js.map +1 -0
- package/dist/buildFieldsQueryString-Cr-jz3p0.js +2 -0
- package/dist/buildFieldsQueryString-Cr-jz3p0.js.map +1 -0
- package/dist/chunk-CTAAG5j7.js +1 -0
- package/dist/common-C6FXBDm7.js +2 -0
- package/dist/common-C6FXBDm7.js.map +1 -0
- package/dist/common-CVbsmD26.d.ts +426 -0
- package/dist/common-CVbsmD26.d.ts.map +1 -0
- package/dist/common-CvPVD1o6.d.ts +406 -0
- package/dist/common-CvPVD1o6.d.ts.map +1 -0
- package/dist/core/webhook/frameworks/express.d.ts +20 -53
- package/dist/core/webhook/frameworks/express.js +1 -2
- package/dist/core/webhook/frameworks/nextjs-app.d.ts +36 -39
- package/dist/core/webhook/frameworks/nextjs-app.d.ts.map +1 -0
- package/dist/core/webhook/frameworks/nextjs-app.js +1 -1
- package/dist/core/webhook/frameworks/nextjs-app.js.map +1 -1
- package/dist/core/webhook/frameworks/nextjs.d.ts +20 -49
- package/dist/core/webhook/frameworks/nextjs.js +1 -2
- package/dist/core/webhook/index.d.ts +20 -29
- package/dist/core/webhook/index.js +1 -2
- package/dist/core/whatsapp/index.d.ts +18 -42
- package/dist/core/whatsapp/index.js +1 -2
- package/dist/encryption-Cwc0xcVL.js +2 -0
- package/dist/encryption-Cwc0xcVL.js.map +1 -0
- package/dist/enums-CSUpFXb8.js +2 -0
- package/dist/enums-CSUpFXb8.js.map +1 -0
- package/dist/express-B6fQdflY.d.ts +78 -0
- package/dist/express-B6fQdflY.d.ts.map +1 -0
- package/dist/express-CrfNLYMM.js +2 -0
- package/dist/express-CrfNLYMM.js.map +1 -0
- package/dist/flow-CVes0Qus.js +2 -0
- package/dist/flow-CVes0Qus.js.map +1 -0
- package/dist/flowTypeGuards-Gn3-slCW.js +2 -0
- package/dist/flowTypeGuards-Gn3-slCW.js.map +1 -0
- package/dist/handler-BGqjZ0xg.js +2 -0
- package/dist/handler-BGqjZ0xg.js.map +1 -0
- package/dist/index-3KglHVAg.d.ts +354 -0
- package/dist/index-3KglHVAg.d.ts.map +1 -0
- package/dist/index-BNeg6hHx.d.ts +99 -0
- package/dist/index-BNeg6hHx.d.ts.map +1 -0
- package/dist/index-BiTq23oi.d.ts +34 -0
- package/dist/index-BiTq23oi.d.ts.map +1 -0
- package/dist/index-BmfnREgM.d.ts +47 -0
- package/dist/index-BmfnREgM.d.ts.map +1 -0
- package/dist/index-CaGffSja.d.ts +24 -0
- package/dist/index-CaGffSja.d.ts.map +1 -0
- package/dist/index-CeTmbIXi.d.ts +180 -0
- package/dist/index-CeTmbIXi.d.ts.map +1 -0
- package/dist/index-CoyByMuM.d.ts +137 -0
- package/dist/index-CoyByMuM.d.ts.map +1 -0
- package/dist/index-CwujtcvH.d.ts +370 -0
- package/dist/index-CwujtcvH.d.ts.map +1 -0
- package/dist/index-DQ7z58xp.d.ts +104 -0
- package/dist/index-DQ7z58xp.d.ts.map +1 -0
- package/dist/index-DQkgkiB6.d.ts +30 -0
- package/dist/index-DQkgkiB6.d.ts.map +1 -0
- package/dist/index-LKrIp3Oo.d.ts +1 -0
- package/dist/index-_-06JPan.d.ts +143 -0
- package/dist/index-_-06JPan.d.ts.map +1 -0
- package/dist/index-a_YS40Iv.d.ts +91 -0
- package/dist/index-a_YS40Iv.d.ts.map +1 -0
- package/dist/index-d7TLqtYh.d.ts +171 -0
- package/dist/index-d7TLqtYh.d.ts.map +1 -0
- package/dist/index.d.ts +21 -27
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{isMetaError-CQLXyEL4.d.ts → isMetaError-B3AglYeY.d.ts} +28 -25
- package/dist/isMetaError-B3AglYeY.d.ts.map +1 -0
- package/dist/media-Dw5OGzDD.js +2 -0
- package/dist/media-Dw5OGzDD.js.map +1 -0
- package/dist/messages-h5-NW8QO.js +2 -0
- package/dist/messages-h5-NW8QO.js.map +1 -0
- package/dist/nextjs-DxRCL4t3.js +2 -0
- package/dist/nextjs-DxRCL4t3.js.map +1 -0
- package/dist/objectToQueryString-CAHI0qTs.js +2 -0
- package/dist/objectToQueryString-CAHI0qTs.js.map +1 -0
- package/dist/phone-CZyWLyWB.js +2 -0
- package/dist/phone-CZyWLyWB.js.map +1 -0
- package/dist/profile-Bb7GDP0n.js +2 -0
- package/dist/profile-Bb7GDP0n.js.map +1 -0
- package/dist/qrCode-CeZEtX9J.js +2 -0
- package/dist/qrCode-CeZEtX9J.js.map +1 -0
- package/dist/registration-BkjhC3xw.js +2 -0
- package/dist/registration-BkjhC3xw.js.map +1 -0
- package/dist/template-Bgy-BCXJ.js +2 -0
- package/dist/template-Bgy-BCXJ.js.map +1 -0
- package/dist/twoStepVerification-DYlYF_P5.js +2 -0
- package/dist/twoStepVerification-DYlYF_P5.js.map +1 -0
- package/dist/types/index.d.ts +3 -6
- package/dist/types/index.js +1 -2
- package/dist/utils/index.d.ts +23 -20
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +1 -2
- package/dist/version-BUuqrHc6.js +3 -0
- package/dist/version-BUuqrHc6.js.map +1 -0
- package/dist/waba-SF2W3z2U.js +2 -0
- package/dist/waba-SF2W3z2U.js.map +1 -0
- package/dist/webhook-D4DQ01Xq.js +2 -0
- package/dist/webhook-D4DQ01Xq.js.map +1 -0
- package/dist/whatsapp-B85mxH5f.js +10 -0
- package/dist/whatsapp-B85mxH5f.js.map +1 -0
- package/package.json +27 -125
- package/dist/BusinessProfileApi-C_sEOrWM.d.ts +0 -353
- package/dist/EncryptionApi-CcCfeK2b.d.ts +0 -22
- package/dist/FlowApi-DDHrFT_Q.d.ts +0 -136
- package/dist/MediaApi-CY9RVo7u.d.ts +0 -90
- package/dist/MessageApi-CX_jN8da.d.ts +0 -171
- package/dist/PhoneNumberApi-B-hY7g1M.d.ts +0 -142
- package/dist/QrCodeApi-DRICKN04.d.ts +0 -98
- package/dist/RegistrationApi-CFPzU1Vw.d.ts +0 -47
- package/dist/TemplateApi-D9Q_7cf3.d.ts +0 -161
- package/dist/TwoStepVerificationApi-C0jpAKfu.d.ts +0 -33
- package/dist/WabaApi-BfvpkpFr.d.ts +0 -175
- package/dist/WebhookProcessor-C3oUXCBl.d.ts +0 -707
- package/dist/WhatsApp-BG0rDhMn.d.ts +0 -82
- package/dist/api/encryption/index.js.map +0 -1
- package/dist/api/flow/index.js.map +0 -1
- package/dist/api/index.js.map +0 -1
- package/dist/api/media/index.js.map +0 -1
- package/dist/api/messages/index.js.map +0 -1
- package/dist/api/phone/index.js.map +0 -1
- package/dist/api/profile/index.js.map +0 -1
- package/dist/api/qrCode/index.js.map +0 -1
- package/dist/api/registration/index.js.map +0 -1
- package/dist/api/template/index.js.map +0 -1
- package/dist/api/twoStepVerification/index.js.map +0 -1
- package/dist/api/waba/index.js.map +0 -1
- package/dist/base-BV6DyzGS.d.ts +0 -18
- package/dist/chunk-5577QQ7V.js +0 -2
- package/dist/chunk-5577QQ7V.js.map +0 -1
- package/dist/chunk-6DFC5L3X.js +0 -2
- package/dist/chunk-6DFC5L3X.js.map +0 -1
- package/dist/chunk-7QBIZCJ4.js +0 -2
- package/dist/chunk-7QBIZCJ4.js.map +0 -1
- package/dist/chunk-AMHQGG6Z.js +0 -2
- package/dist/chunk-AMHQGG6Z.js.map +0 -1
- package/dist/chunk-BAOZ4U74.js +0 -10
- package/dist/chunk-BAOZ4U74.js.map +0 -1
- package/dist/chunk-CRZ7EUYR.js +0 -2
- package/dist/chunk-CRZ7EUYR.js.map +0 -1
- package/dist/chunk-FKXSL2JK.js +0 -3
- package/dist/chunk-FKXSL2JK.js.map +0 -1
- package/dist/chunk-FSKBLPGE.js +0 -2
- package/dist/chunk-FSKBLPGE.js.map +0 -1
- package/dist/chunk-GM63NGNV.js +0 -2
- package/dist/chunk-GM63NGNV.js.map +0 -1
- package/dist/chunk-IYSR44P6.js +0 -2
- package/dist/chunk-IYSR44P6.js.map +0 -1
- package/dist/chunk-J2JPTKU6.js +0 -2
- package/dist/chunk-J2JPTKU6.js.map +0 -1
- package/dist/chunk-JC6YMVID.js +0 -2
- package/dist/chunk-JC6YMVID.js.map +0 -1
- package/dist/chunk-JPAV644F.js +0 -2
- package/dist/chunk-JPAV644F.js.map +0 -1
- package/dist/chunk-JXCLRKQ7.js +0 -2
- package/dist/chunk-JXCLRKQ7.js.map +0 -1
- package/dist/chunk-KMAH6636.js +0 -2
- package/dist/chunk-KMAH6636.js.map +0 -1
- package/dist/chunk-L4ESAO2S.js +0 -2
- package/dist/chunk-L4ESAO2S.js.map +0 -1
- package/dist/chunk-LV3TULSI.js +0 -2
- package/dist/chunk-LV3TULSI.js.map +0 -1
- package/dist/chunk-MJEG3K4V.js +0 -2
- package/dist/chunk-MJEG3K4V.js.map +0 -1
- package/dist/chunk-PHPQ5HP3.js +0 -2
- package/dist/chunk-PHPQ5HP3.js.map +0 -1
- package/dist/chunk-RIL6QABY.js +0 -2
- package/dist/chunk-RIL6QABY.js.map +0 -1
- package/dist/chunk-RWCVPWRC.js +0 -2
- package/dist/chunk-RWCVPWRC.js.map +0 -1
- package/dist/chunk-SNNRWNGZ.js +0 -2
- package/dist/chunk-SNNRWNGZ.js.map +0 -1
- package/dist/chunk-U5FBZ6UB.js +0 -3
- package/dist/chunk-U5FBZ6UB.js.map +0 -1
- package/dist/chunk-VHAODWCN.js +0 -2
- package/dist/chunk-VHAODWCN.js.map +0 -1
- package/dist/chunk-ZMNXRMWK.js +0 -2
- package/dist/chunk-ZMNXRMWK.js.map +0 -1
- package/dist/common-B8kp4RdL.d.ts +0 -403
- package/dist/common-CGbls9Y8.d.ts +0 -425
- package/dist/core/webhook/frameworks/express.js.map +0 -1
- package/dist/core/webhook/frameworks/nextjs.js.map +0 -1
- package/dist/core/webhook/index.js.map +0 -1
- package/dist/core/whatsapp/index.js.map +0 -1
- package/dist/enums-DIimUG6s.d.ts +0 -707
- package/dist/factory-B37vOPki.d.ts +0 -200
- package/dist/handler-DbySwF0E.d.ts +0 -20
- package/dist/httpsClient-Cbd2Y6mg.d.ts +0 -19
- package/dist/logger-BdE0Vyim.d.ts +0 -9
- package/dist/request-CUjrMn8R.d.ts +0 -50
- package/dist/types/config.d.ts +0 -78
- package/dist/types/config.js +0 -2
- package/dist/types/config.js.map +0 -1
- package/dist/types/enums.d.ts +0 -1
- package/dist/types/enums.js +0 -2
- package/dist/types/enums.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { BaseAPI, RequesterClass, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/waba/types/common.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* WhatsApp Business Account subscription configuration
|
|
7
|
+
*/
|
|
8
|
+
type WabaSubscription = {
|
|
9
|
+
whatsapp_business_api_data: {
|
|
10
|
+
id: string;
|
|
11
|
+
link: string;
|
|
12
|
+
name: string;
|
|
13
|
+
category: string;
|
|
14
|
+
};
|
|
15
|
+
override_callback_uri?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Parameters for updating WABA subscription
|
|
19
|
+
*/
|
|
20
|
+
interface UpdateWabaSubscription {
|
|
21
|
+
override_callback_uri: string;
|
|
22
|
+
verify_token: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Response containing all WABA subscriptions
|
|
26
|
+
*/
|
|
27
|
+
interface WabaSubscriptions {
|
|
28
|
+
data: Array<WabaSubscription>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* WABA account review status enumeration
|
|
32
|
+
*/
|
|
33
|
+
declare enum WabaAccountReviewStatus {
|
|
34
|
+
Approved = "APPROVED",
|
|
35
|
+
Active = "ACTIVE",
|
|
36
|
+
Inactive = "INACTIVE",
|
|
37
|
+
Disabled = "DISABLED",
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* WABA health status for message sending capability
|
|
41
|
+
*/
|
|
42
|
+
declare enum WabaHealthStatusCanSendMessage {
|
|
43
|
+
Blocked = "BLOCKED",
|
|
44
|
+
Limited = "LIMITED",
|
|
45
|
+
Available = "AVAILABLE",
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* WABA account status enumeration
|
|
49
|
+
*/
|
|
50
|
+
declare enum WabaAccountStatus {
|
|
51
|
+
Approved = "APPROVED",
|
|
52
|
+
Active = "ACTIVE",
|
|
53
|
+
Inactive = "INACTIVE",
|
|
54
|
+
Disabled = "DISABLED",
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Business verification status enumeration
|
|
58
|
+
*/
|
|
59
|
+
declare enum WabaBusinessVerificationStatus {
|
|
60
|
+
Verified = "verified",
|
|
61
|
+
PendingSubmission = "pending_submission",
|
|
62
|
+
Unverified = "unverified",
|
|
63
|
+
Rejected = "rejected",
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* WABA health status error details
|
|
67
|
+
*/
|
|
68
|
+
interface WabaHealthStatusError {
|
|
69
|
+
error_code?: number;
|
|
70
|
+
error_description?: string;
|
|
71
|
+
possible_solution?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* WABA health status entity information
|
|
75
|
+
*/
|
|
76
|
+
interface WabaHealthStatusEntity {
|
|
77
|
+
entity_type?: string;
|
|
78
|
+
id?: string;
|
|
79
|
+
can_send_message?: string;
|
|
80
|
+
errors?: WabaHealthStatusError[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Overall WABA health status
|
|
84
|
+
*/
|
|
85
|
+
interface WabaHealthStatus {
|
|
86
|
+
can_send_message?: WabaHealthStatusCanSendMessage;
|
|
87
|
+
entities?: WabaHealthStatusEntity[];
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* WhatsApp Business Account information
|
|
91
|
+
*/
|
|
92
|
+
interface WabaAccount {
|
|
93
|
+
account_review_status?: WabaAccountReviewStatus;
|
|
94
|
+
id?: string;
|
|
95
|
+
health_status?: WabaHealthStatus;
|
|
96
|
+
status?: WabaAccountStatus;
|
|
97
|
+
business_verification_status?: WabaBusinessVerificationStatus;
|
|
98
|
+
message_template_namespace?: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
ownership_type?: string;
|
|
101
|
+
currency?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Available fields for WABA account queries
|
|
105
|
+
*/
|
|
106
|
+
type WabaAccountFields = 'id' | 'name' | 'account_review_status' | 'auth_international_rate_eligibility' | 'business_verification_status' | 'country' | 'currency' | 'health_status' | 'status' | 'ownership_type' | 'message_template_namespace';
|
|
107
|
+
/**
|
|
108
|
+
* Parameter type for specifying which WABA account fields to retrieve
|
|
109
|
+
*/
|
|
110
|
+
type WabaAccountFieldsParam = WabaAccountFields[];
|
|
111
|
+
/**
|
|
112
|
+
* Interface defining all WABA API methods
|
|
113
|
+
*/
|
|
114
|
+
interface WABAClass {
|
|
115
|
+
getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
|
|
116
|
+
getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
|
|
117
|
+
updateWabaSubscription(params: UpdateWabaSubscription): Promise<ResponseSuccess>;
|
|
118
|
+
unsubscribeFromWaba(): Promise<ResponseSuccess>;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/api/waba/WabaApi.d.ts
|
|
122
|
+
/**
|
|
123
|
+
* API for managing WhatsApp Business Account (WABA).
|
|
124
|
+
*
|
|
125
|
+
* This API allows you to:
|
|
126
|
+
* - Get WABA account information
|
|
127
|
+
* - Manage WABA subscriptions
|
|
128
|
+
* - Subscribe/unsubscribe from WABA webhooks
|
|
129
|
+
* - Update subscription settings
|
|
130
|
+
*/
|
|
131
|
+
declare class WabaApi extends BaseAPI implements WABAClass {
|
|
132
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
133
|
+
/**
|
|
134
|
+
* Retrieve WhatsApp Business Account information.
|
|
135
|
+
*
|
|
136
|
+
* @param fields Optional array of specific fields to retrieve
|
|
137
|
+
* @returns WABA account information including status, health, verification status, etc.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* const account = await whatsappClient.waba.getWabaAccount(['id', 'name', 'status']);
|
|
141
|
+
*/
|
|
142
|
+
getWabaAccount(fields?: WabaAccountFieldsParam): Promise<WabaAccount>;
|
|
143
|
+
/**
|
|
144
|
+
* Get all WABA subscriptions for the business account.
|
|
145
|
+
*
|
|
146
|
+
* @returns List of all subscribed apps and their configurations
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* const subscriptions = await whatsappClient.waba.getAllWabaSubscriptions();
|
|
150
|
+
*/
|
|
151
|
+
getAllWabaSubscriptions(): Promise<WabaSubscriptions>;
|
|
152
|
+
/**
|
|
153
|
+
* Update WABA subscription configuration.
|
|
154
|
+
*
|
|
155
|
+
* @param params Configuration parameters including callback URI and verify token
|
|
156
|
+
* @returns Response indicating success or failure
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* await whatsappClient.waba.updateWabaSubscription({
|
|
160
|
+
* override_callback_uri: 'https://example.com/webhook',
|
|
161
|
+
* verify_token: 'your_verify_token'
|
|
162
|
+
* });
|
|
163
|
+
*/
|
|
164
|
+
updateWabaSubscription({
|
|
165
|
+
override_callback_uri,
|
|
166
|
+
verify_token
|
|
167
|
+
}: UpdateWabaSubscription): Promise<ResponseSuccess>;
|
|
168
|
+
/**
|
|
169
|
+
* Unsubscribe from WABA webhooks.
|
|
170
|
+
*
|
|
171
|
+
* @returns Response indicating success or failure
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* await whatsappClient.waba.unsubscribeFromWaba();
|
|
175
|
+
*/
|
|
176
|
+
unsubscribeFromWaba(): Promise<ResponseSuccess>;
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
export { type UpdateWabaSubscription, type WABAClass, type WabaAccount, WabaAccountFields, WabaAccountFieldsParam, WabaAccountReviewStatus, WabaAccountStatus, WabaApi, WabaBusinessVerificationStatus, WabaHealthStatus, WabaHealthStatusCanSendMessage, WabaHealthStatusEntity, WabaHealthStatusError, WabaSubscription, type WabaSubscriptions };
|
|
180
|
+
//# sourceMappingURL=index-CeTmbIXi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CeTmbIXi.d.ts","names":[],"sources":["../src/api/waba/types/common.ts","../src/api/waba/WabaApi.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;AAaiB,KAbL,gBAAA,GAa2B;EAQtB,0BAAiB,EAAA;IAAA,EAAA,EAAA,MAAA;IAClB,IAAA,EAAA,MAAA;IAAN,IAAA,EAAA,MAAA;IAAK,QAAA,EAAA,MAAA;EAMH,CAAA;EAUA,qBAAA,CAAA,EAAA,MAAA;AASZ,CAAA;AAUA;AAUA;AASA;AAUiB,UAzEA,sBAAA,CAyEgB;EAAA,qBAAA,EAAA,MAAA;cACV,EAAA,MAAA;;;AAOvB;;AAC4B,UA1EX,iBAAA,CA0EW;MAER,EA3EV,KA2EU,CA3EJ,gBA2EI,CAAA;;;;AAYpB;AAgBY,aAjGA,uBAAA;EAsGK,QAAA,GAAA,UAAS;EAAA,MAAA,GAAA,QAAA;UACE,GAAA,UAAA;UAAiC,GAAA,UAAA;;;;;AAEO,aA/FxD,8BAAA;SA+FgD,GAAA,SAAA;SACzB,GAAA,SAAA;WAAR,GAAA,WAAA;;;;;AC1HN,aDmCT,iBAAA;ECnCiB,QAAA,GAAA,UAAA;QACL,GAAA,QAAA;UAAwB,GAAA,UAAA;UAad,GAAA,UAAA;;;;;AAyC1B,aDVI,8BAAA;UCWJ,GAAA,UAAA;mBACD,GAAA,oBAAA;YAAsC,GAAA,YAAA;UAAR,GAAA,UAAA;;;;;AAzDiC,UDuDrD,qBAAA,CCvDqD;;;;;;;;UDgErD,sBAAA;;;;WAIJ;;;;;UAMI,gBAAA;qBACM;aACR;;;;;UAME,WAAA;0BACW;;kBAER;WACP;iCACsB;;;;;;;;;KAUvB,iBAAA;;;;KAgBA,sBAAA,GAAyB;;;;UAKpB,SAAA;0BACW,yBAAyB,QAAQ;6BAC9B,QAAQ;iCACJ,yBAAyB,QAAQ;yBACzC,QAAQ;;;;AAzHnC;AAQA;;;;;AAOA;AAUA;AASA;AAUY,cC7CS,OAAA,SAAgB,OAAA,YAAmB,SD6Cd,CAAA;EAUzB,WAAA,CAAA,MAAA,ECtDO,cDsDc,EAAA,MAAA,ECtDU,cDsDV;EASrB;AAUjB;;;;;AAQA;;;gBAGoB,CAAA,MAAA,CAAA,ECvEc,sBDuEd,CAAA,ECvE4C,ODuE5C,CCvEoD,WDuEpD,CAAA;;;;AAYpB;AAgBA;AAKA;;;yBAC6D,CAAA,CAAA,ECtFxB,ODsFwB,CCtFhB,iBDsFgB,CAAA;;;;;;;;;;;;;ECvHxC,sBAAQ,CAAA;IAAA,qBAAA;IAAA;EAAA,CAAA,EAyDtB,sBAzDsB,CAAA,EAyDQ,OAzDR,CAyDgB,eAzDhB,CAAA;EAAA;;;;;;;;qBAuDrB,CAAA,CAAA,EAuByB,OAvBzB,CAuBiC,eAvBjC,CAAA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { BaseAPI, RequesterClass, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
import { CreateFlowResponse, Flow, FlowAssetsResponse, FlowCategoryEnum, FlowClass, FlowMigrationResponse, FlowPreviewResponse, FlowsListResponse, UpdateFlowResponse, ValidateFlowJsonResponse } from "./common-CvPVD1o6.js";
|
|
3
|
+
|
|
4
|
+
//#region src/api/flow/FlowApi.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* API for managing WhatsApp Flows.
|
|
8
|
+
*
|
|
9
|
+
* This API allows you to:
|
|
10
|
+
* - List flows
|
|
11
|
+
* - Create flows
|
|
12
|
+
* - Get flow details and previews
|
|
13
|
+
* - Update flow metadata and JSON
|
|
14
|
+
* - Delete flows
|
|
15
|
+
* - Publish and deprecate flows
|
|
16
|
+
* - Migrate flows between WABAs
|
|
17
|
+
* - Validate flow JSON
|
|
18
|
+
*/
|
|
19
|
+
declare class FlowApi extends BaseAPI implements FlowClass {
|
|
20
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
21
|
+
/**
|
|
22
|
+
* List Flows
|
|
23
|
+
*
|
|
24
|
+
* @param wabaId - The WABA ID
|
|
25
|
+
* @returns Promise with the list of flows
|
|
26
|
+
*/
|
|
27
|
+
listFlows(wabaId: string): Promise<FlowsListResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Create Flow
|
|
30
|
+
*
|
|
31
|
+
* @param wabaId - The WABA ID
|
|
32
|
+
* @param data - The flow data including name, categories, endpoint_uri, and optional clone_flow_id
|
|
33
|
+
* @returns Promise with the created flow ID and validation errors if any
|
|
34
|
+
*/
|
|
35
|
+
createFlow(wabaId: string, data: {
|
|
36
|
+
name: string;
|
|
37
|
+
categories?: FlowCategoryEnum[];
|
|
38
|
+
endpoint_uri?: string;
|
|
39
|
+
clone_flow_id?: string;
|
|
40
|
+
flow_json?: string;
|
|
41
|
+
publish?: boolean;
|
|
42
|
+
}): Promise<CreateFlowResponse>;
|
|
43
|
+
/**
|
|
44
|
+
* Get Flow details
|
|
45
|
+
*
|
|
46
|
+
* @param flowId - The flow ID
|
|
47
|
+
* @param fields - Optional fields to return (e.g., 'name,status,preview.invalidate(false)')
|
|
48
|
+
* @param dateFormat - Optional date format
|
|
49
|
+
* @returns Promise with the flow details or preview response
|
|
50
|
+
*/
|
|
51
|
+
getFlow(flowId: string, fields?: string, dateFormat?: string): Promise<Flow | FlowPreviewResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Get Flow Preview URL
|
|
54
|
+
*
|
|
55
|
+
* @param flowId - The flow ID
|
|
56
|
+
* @param invalidate - Optional. If true, invalidates existing preview and generates a new one. Defaults to false.
|
|
57
|
+
* @returns Promise with the flow preview details
|
|
58
|
+
*/
|
|
59
|
+
getFlowPreview(flowId: string, invalidate?: boolean): Promise<FlowPreviewResponse>;
|
|
60
|
+
/**
|
|
61
|
+
* Update Flow Metadata
|
|
62
|
+
*
|
|
63
|
+
* @param flowId - The flow ID
|
|
64
|
+
* @param data - The flow metadata to update (name, categories, endpoint_uri, application_id)
|
|
65
|
+
* @returns Promise with the success status
|
|
66
|
+
*/
|
|
67
|
+
updateFlowMetadata(flowId: string, data: {
|
|
68
|
+
name?: string;
|
|
69
|
+
categories?: FlowCategoryEnum[];
|
|
70
|
+
endpoint_uri?: string;
|
|
71
|
+
application_id?: string;
|
|
72
|
+
}): Promise<ResponseSuccess>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete Flow (only works if the Flow is in DRAFT status)
|
|
75
|
+
*
|
|
76
|
+
* @param flowId - The flow ID
|
|
77
|
+
* @returns Promise with the success status
|
|
78
|
+
*/
|
|
79
|
+
deleteFlow(flowId: string): Promise<ResponseSuccess>;
|
|
80
|
+
/**
|
|
81
|
+
* List Assets (e.g., get Flow JSON download URL)
|
|
82
|
+
*
|
|
83
|
+
* @param flowId - The flow ID
|
|
84
|
+
* @returns Promise with the list of assets
|
|
85
|
+
*/
|
|
86
|
+
listAssets(flowId: string): Promise<FlowAssetsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* Update Flow JSON by uploading a file, buffer, JSON object, or Blob.
|
|
89
|
+
*
|
|
90
|
+
* @param flowId - The flow ID
|
|
91
|
+
* @param data - Object containing the file data and optional name.
|
|
92
|
+
* @param data.file - The Flow JSON content as a Buffer, JSON object, or Blob.
|
|
93
|
+
* @param data.name - Optional name for the asset, defaults to 'flow.json'.
|
|
94
|
+
* @returns Promise with the success status and validation errors, if any.
|
|
95
|
+
*/
|
|
96
|
+
updateFlowJson(flowId: string, data: {
|
|
97
|
+
file: Blob | Buffer | object;
|
|
98
|
+
name?: string;
|
|
99
|
+
}): Promise<UpdateFlowResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Validate Flow JSON by attempting an update without publishing.
|
|
102
|
+
* This is a convenience method; the API doesn't have a dedicated validation endpoint.
|
|
103
|
+
*
|
|
104
|
+
* @param flowId - The ID of the Flow (must exist, can be in DRAFT status).
|
|
105
|
+
* @param flowJsonData - The Flow JSON content as a file path (string), Buffer, JSON object, or Blob.
|
|
106
|
+
* @returns Promise indicating if the JSON is valid and includes validation errors if any.
|
|
107
|
+
*/
|
|
108
|
+
validateFlowJson(flowId: string, flowJsonData: Blob | Buffer | object): Promise<ValidateFlowJsonResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* Publish Flow
|
|
111
|
+
*
|
|
112
|
+
* @param flowId - The flow ID
|
|
113
|
+
* @returns Promise with the success status
|
|
114
|
+
*/
|
|
115
|
+
publishFlow(flowId: string): Promise<ResponseSuccess>;
|
|
116
|
+
/**
|
|
117
|
+
* Deprecate Flow
|
|
118
|
+
*
|
|
119
|
+
* @param flowId - The flow ID
|
|
120
|
+
* @returns Promise with the success status
|
|
121
|
+
*/
|
|
122
|
+
deprecateFlow(flowId: string): Promise<ResponseSuccess>;
|
|
123
|
+
/**
|
|
124
|
+
* Migrate Flows between WABAs
|
|
125
|
+
*
|
|
126
|
+
* @param destinationWabaId - The destination WABA ID
|
|
127
|
+
* @param data - The migration data including source_waba_id and optional source_flow_names
|
|
128
|
+
* @returns Promise with migration results (successes and failures)
|
|
129
|
+
*/
|
|
130
|
+
migrateFlows(destinationWabaId: string, data: {
|
|
131
|
+
source_waba_id: string;
|
|
132
|
+
source_flow_names?: string[];
|
|
133
|
+
}): Promise<FlowMigrationResponse>;
|
|
134
|
+
}
|
|
135
|
+
//#endregion
|
|
136
|
+
export { FlowApi };
|
|
137
|
+
//# sourceMappingURL=index-CoyByMuM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CoyByMuM.d.ts","names":[],"sources":["../src/api/flow/FlowApi.ts"],"sourcesContent":[],"mappings":";;;;;AAKqC;;;;;;;;;;;;;AAgGkC,cAjFlD,OAAA,SAAgB,OAAA,YAAmB,SAiFe,CAAA;aAiB9C,CAAA,MAAA,EAjGD,cAiGC,EAAA,MAAA,EAjGuB,cAiGvB;;;;;;;WA0DP,CAAA,MAAA,EAAA,MAAA,CAAA,EAjJmB,OAiJnB,CAjJ2B,iBAiJ3B,CAAA;;;;;;;;YA6E6B,CAAA,MAAA,EAAA,MAAA,EAAA,IAAA,EAAA;IAAR,IAAA,EAAA,MAAA;IAgBU,UAAA,CAAA,EA/NxB,gBA+NwB,EAAA;IAAR,YAAA,CAAA,EAAA,MAAA;IAuB1B,aAAA,CAAA,EAAA,MAAA;IAAR,SAAA,CAAA,EAAA,MAAA;IAhR8B,OAAA,CAAA,EAAA,OAAA;MAgC9B,OAhCiD,CAgCzC,kBAhCyC,CAAA;EAAc;;;;;;;;iEA4DG,QAAQ,OAAY;;;;;;;;wDAqBtB,QAAQ;;;;;;;;;;iBAiBtD;;;MAIlB,QAAQ;;;;;;;8BAuBuB,QAAQ;;;;;;;8BAUR,QAAQ;;;;;;;;;;;UAqB5B,OAAO;;MAGlB,QAAQ;;;;;;;;;iDAgDO,OAAO,kBACtB,QAAQ;;;;;;;+BAyBwB,QAAQ;;;;;;;iCAgBN,QAAQ;;;;;;;;;;;MAuB1C,QAAQ"}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
import { BaseAPI, CategoryEnum, CurrencyCodesEnum, GeneralRequestBody, LanguagesEnum, RequesterClass, ResponsePagination, ResponseSuccess, TemplateStatusEnum, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/template/types/common.d.ts
|
|
4
|
+
type TemplateFormat = 'TEXT' | 'IMAGE' | 'VIDEO' | 'DOCUMENT' | 'LOCATION' | 'PRODUCT';
|
|
5
|
+
type PhoneNumberButton = {
|
|
6
|
+
type: 'PHONE_NUMBER';
|
|
7
|
+
text: string;
|
|
8
|
+
phone_number: string;
|
|
9
|
+
};
|
|
10
|
+
type URLButton = {
|
|
11
|
+
type: 'URL';
|
|
12
|
+
text: string;
|
|
13
|
+
url: string;
|
|
14
|
+
example?: string[];
|
|
15
|
+
};
|
|
16
|
+
type QuickReplyButton = {
|
|
17
|
+
type: 'QUICK_REPLY';
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
type CopyCodeButton = {
|
|
21
|
+
type: 'COPY_CODE';
|
|
22
|
+
example: string;
|
|
23
|
+
};
|
|
24
|
+
type FlowButton = {
|
|
25
|
+
type: 'FLOW';
|
|
26
|
+
text: string;
|
|
27
|
+
flow_id?: string;
|
|
28
|
+
flow_name?: string;
|
|
29
|
+
flow_json?: string;
|
|
30
|
+
flow_action?: 'navigate' | 'data_exchange';
|
|
31
|
+
navigate_screen?: string;
|
|
32
|
+
};
|
|
33
|
+
type MPMButton = {
|
|
34
|
+
type: 'MPM';
|
|
35
|
+
action?: {
|
|
36
|
+
thumbnail_product_retailer_id: string;
|
|
37
|
+
sections: Array<{
|
|
38
|
+
title?: string;
|
|
39
|
+
product_items: Array<{
|
|
40
|
+
product_retailer_id: string;
|
|
41
|
+
}>;
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
type OTPButton = {
|
|
46
|
+
type: 'OTP';
|
|
47
|
+
};
|
|
48
|
+
type SPMButton = {
|
|
49
|
+
type: 'SPM';
|
|
50
|
+
action?: {
|
|
51
|
+
product_retailer_id: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type CatalogButton = {
|
|
55
|
+
type: 'CATALOG';
|
|
56
|
+
action?: {
|
|
57
|
+
thumbnail_product_retailer_id: string;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
type TemplateButton = PhoneNumberButton | URLButton | QuickReplyButton | CopyCodeButton | FlowButton | MPMButton | OTPButton | SPMButton | CatalogButton;
|
|
61
|
+
type TemplateHeaderExample = {
|
|
62
|
+
header_text?: string[];
|
|
63
|
+
header_text_named_params?: Array<{
|
|
64
|
+
param_name: string;
|
|
65
|
+
example: string;
|
|
66
|
+
}>;
|
|
67
|
+
header_handle?: string[];
|
|
68
|
+
};
|
|
69
|
+
type TemplateHeader = {
|
|
70
|
+
type: 'HEADER';
|
|
71
|
+
format: TemplateFormat;
|
|
72
|
+
text?: string;
|
|
73
|
+
example?: TemplateHeaderExample;
|
|
74
|
+
};
|
|
75
|
+
type TemplateBody = {
|
|
76
|
+
type: 'BODY';
|
|
77
|
+
text: string;
|
|
78
|
+
example?: {
|
|
79
|
+
body_text?: Array<Array<string>>;
|
|
80
|
+
body_text_named_params?: Array<{
|
|
81
|
+
param_name: string;
|
|
82
|
+
example: string;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
type TemplateFooter = {
|
|
87
|
+
type: 'FOOTER';
|
|
88
|
+
text: string;
|
|
89
|
+
};
|
|
90
|
+
type TemplateButtons = {
|
|
91
|
+
type: 'BUTTONS';
|
|
92
|
+
buttons: TemplateButton[];
|
|
93
|
+
};
|
|
94
|
+
type TemplateLimitedTimeOffer = {
|
|
95
|
+
type: 'LIMITED_TIME_OFFER';
|
|
96
|
+
limited_time_offer: {
|
|
97
|
+
expiration_time_ms: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
type TemplateCarousel = {
|
|
101
|
+
type: 'CAROUSEL';
|
|
102
|
+
cards: Array<{
|
|
103
|
+
card_index: number;
|
|
104
|
+
components: ComponentTypes[];
|
|
105
|
+
}>;
|
|
106
|
+
};
|
|
107
|
+
type MediaCarouselCard = {
|
|
108
|
+
card_index: number;
|
|
109
|
+
components: (TemplateHeader | TemplateBody | TemplateButtons)[];
|
|
110
|
+
};
|
|
111
|
+
type ProductCarouselCard = {
|
|
112
|
+
card_index: number;
|
|
113
|
+
components: TemplateHeader[];
|
|
114
|
+
};
|
|
115
|
+
type ComponentTypes = TemplateHeader | TemplateBody | TemplateFooter | TemplateButtons | TemplateLimitedTimeOffer | TemplateCarousel;
|
|
116
|
+
type TemplateRequestBody = GeneralRequestBody & {
|
|
117
|
+
name: string;
|
|
118
|
+
language: LanguagesEnum;
|
|
119
|
+
category?: CategoryEnum;
|
|
120
|
+
components?: ComponentTypes[];
|
|
121
|
+
};
|
|
122
|
+
type TemplateResponse = {
|
|
123
|
+
id: string;
|
|
124
|
+
status: string;
|
|
125
|
+
language: LanguagesEnum;
|
|
126
|
+
category: CategoryEnum;
|
|
127
|
+
name: string;
|
|
128
|
+
components: ComponentTypes[];
|
|
129
|
+
};
|
|
130
|
+
type TemplateGetParams = {
|
|
131
|
+
limit?: number;
|
|
132
|
+
name?: string;
|
|
133
|
+
language?: LanguagesEnum;
|
|
134
|
+
category?: CategoryEnum;
|
|
135
|
+
status?: TemplateStatusEnum;
|
|
136
|
+
};
|
|
137
|
+
type TemplateDeleteParams = {
|
|
138
|
+
hsm_id: string;
|
|
139
|
+
name: string;
|
|
140
|
+
};
|
|
141
|
+
declare class TemplateClass {
|
|
142
|
+
getTemplate(templateId: string): Promise<TemplateResponse>;
|
|
143
|
+
updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
|
|
144
|
+
getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
|
|
145
|
+
createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
|
|
146
|
+
deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/api/template/types/factory.d.ts
|
|
150
|
+
interface TextParameter {
|
|
151
|
+
type: 'text';
|
|
152
|
+
value: string;
|
|
153
|
+
}
|
|
154
|
+
interface CurrencyParameter {
|
|
155
|
+
type: 'currency';
|
|
156
|
+
amount_1000: number;
|
|
157
|
+
code: CurrencyCodesEnum;
|
|
158
|
+
fallback_value: string;
|
|
159
|
+
}
|
|
160
|
+
interface DateTimeParameter {
|
|
161
|
+
type: 'date_time';
|
|
162
|
+
fallback_value: string;
|
|
163
|
+
}
|
|
164
|
+
interface MediaParameter {
|
|
165
|
+
type: 'image' | 'video' | 'document';
|
|
166
|
+
handle?: string;
|
|
167
|
+
link?: string;
|
|
168
|
+
}
|
|
169
|
+
interface LocationParameter {
|
|
170
|
+
type: 'location';
|
|
171
|
+
latitude?: number;
|
|
172
|
+
longitude?: number;
|
|
173
|
+
name?: string;
|
|
174
|
+
address?: string;
|
|
175
|
+
}
|
|
176
|
+
interface ProductParameter {
|
|
177
|
+
type: 'product';
|
|
178
|
+
product_retailer_id: string;
|
|
179
|
+
}
|
|
180
|
+
type TemplateParameter = TextParameter | CurrencyParameter | DateTimeParameter | MediaParameter | LocationParameter | ProductParameter;
|
|
181
|
+
interface HeaderOptions {
|
|
182
|
+
format: TemplateFormat;
|
|
183
|
+
text?: string;
|
|
184
|
+
parameters?: TemplateParameter[];
|
|
185
|
+
example?: {
|
|
186
|
+
header_text?: string[];
|
|
187
|
+
header_text_named_params?: Array<{
|
|
188
|
+
param_name: string;
|
|
189
|
+
example: string;
|
|
190
|
+
}>;
|
|
191
|
+
header_handle?: string[];
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
interface BodyOptions {
|
|
195
|
+
text: string;
|
|
196
|
+
parameters?: TemplateParameter[];
|
|
197
|
+
example?: {
|
|
198
|
+
body_text?: string[][];
|
|
199
|
+
body_text_named_params?: Array<{
|
|
200
|
+
param_name: string;
|
|
201
|
+
example: string;
|
|
202
|
+
}>;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
interface FooterOptions {
|
|
206
|
+
text: string;
|
|
207
|
+
}
|
|
208
|
+
interface ButtonOptions {
|
|
209
|
+
phone_number?: {
|
|
210
|
+
text: string;
|
|
211
|
+
phone_number: string;
|
|
212
|
+
};
|
|
213
|
+
url?: {
|
|
214
|
+
text: string;
|
|
215
|
+
url: string;
|
|
216
|
+
example?: string;
|
|
217
|
+
};
|
|
218
|
+
quick_reply?: {
|
|
219
|
+
text: string;
|
|
220
|
+
}[];
|
|
221
|
+
copy_code?: {
|
|
222
|
+
example: string;
|
|
223
|
+
};
|
|
224
|
+
flow?: {
|
|
225
|
+
text: string;
|
|
226
|
+
flow_id?: string;
|
|
227
|
+
flow_name?: string;
|
|
228
|
+
flow_json?: string;
|
|
229
|
+
flow_action?: 'navigate' | 'data_exchange';
|
|
230
|
+
navigate_screen?: string;
|
|
231
|
+
};
|
|
232
|
+
mpm?: boolean;
|
|
233
|
+
otp?: boolean;
|
|
234
|
+
spm?: boolean;
|
|
235
|
+
}
|
|
236
|
+
interface CarouselCard {
|
|
237
|
+
image?: string;
|
|
238
|
+
video?: string;
|
|
239
|
+
product?: string;
|
|
240
|
+
body?: string;
|
|
241
|
+
bodyParameters?: TemplateParameter[];
|
|
242
|
+
buttons?: ButtonOptions;
|
|
243
|
+
}
|
|
244
|
+
interface CarouselOptions {
|
|
245
|
+
cards: CarouselCard[];
|
|
246
|
+
}
|
|
247
|
+
interface LimitedTimeOfferOptions {
|
|
248
|
+
expiration_time_ms: number;
|
|
249
|
+
}
|
|
250
|
+
interface ProductSection {
|
|
251
|
+
title?: string;
|
|
252
|
+
product_items: Array<{
|
|
253
|
+
product_retailer_id: string;
|
|
254
|
+
}>;
|
|
255
|
+
}
|
|
256
|
+
interface TemplateOptions {
|
|
257
|
+
name: string;
|
|
258
|
+
language: LanguagesEnum;
|
|
259
|
+
category: CategoryEnum;
|
|
260
|
+
header?: HeaderOptions;
|
|
261
|
+
body?: BodyOptions;
|
|
262
|
+
footer?: FooterOptions;
|
|
263
|
+
buttons?: ButtonOptions;
|
|
264
|
+
carousel?: CarouselOptions;
|
|
265
|
+
limitedTimeOffer?: LimitedTimeOfferOptions;
|
|
266
|
+
}
|
|
267
|
+
interface OTPTemplateOptions {
|
|
268
|
+
name: string;
|
|
269
|
+
language: LanguagesEnum;
|
|
270
|
+
code_expiration_minutes?: number;
|
|
271
|
+
add_security_recommendation?: boolean;
|
|
272
|
+
}
|
|
273
|
+
interface AuthenticationTemplateOptions {
|
|
274
|
+
name: string;
|
|
275
|
+
language: LanguagesEnum;
|
|
276
|
+
code_expiration_minutes?: number;
|
|
277
|
+
add_security_recommendation?: boolean;
|
|
278
|
+
copy_code_button?: boolean;
|
|
279
|
+
}
|
|
280
|
+
interface CatalogTemplateOptions {
|
|
281
|
+
name: string;
|
|
282
|
+
language: LanguagesEnum;
|
|
283
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
284
|
+
body: BodyOptions;
|
|
285
|
+
footer?: FooterOptions;
|
|
286
|
+
thumbnail_product_retailer_id: string;
|
|
287
|
+
}
|
|
288
|
+
interface CouponTemplateOptions {
|
|
289
|
+
name: string;
|
|
290
|
+
language: LanguagesEnum;
|
|
291
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
292
|
+
body: BodyOptions;
|
|
293
|
+
footer?: FooterOptions;
|
|
294
|
+
coupon_code: string;
|
|
295
|
+
}
|
|
296
|
+
interface LimitedTimeOfferTemplateOptions {
|
|
297
|
+
name: string;
|
|
298
|
+
language: LanguagesEnum;
|
|
299
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
300
|
+
body: BodyOptions;
|
|
301
|
+
footer?: FooterOptions;
|
|
302
|
+
expiration_time_ms: number;
|
|
303
|
+
}
|
|
304
|
+
interface MediaCardCarouselTemplateOptions {
|
|
305
|
+
name: string;
|
|
306
|
+
language: LanguagesEnum;
|
|
307
|
+
cards: Array<{
|
|
308
|
+
header: {
|
|
309
|
+
format: 'IMAGE' | 'VIDEO';
|
|
310
|
+
example: {
|
|
311
|
+
header_handle: string[];
|
|
312
|
+
};
|
|
313
|
+
};
|
|
314
|
+
body: BodyOptions;
|
|
315
|
+
buttons?: ButtonOptions;
|
|
316
|
+
}>;
|
|
317
|
+
}
|
|
318
|
+
interface MPMTemplateOptions {
|
|
319
|
+
name: string;
|
|
320
|
+
language: LanguagesEnum;
|
|
321
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
322
|
+
body: BodyOptions;
|
|
323
|
+
footer?: FooterOptions;
|
|
324
|
+
thumbnail_product_retailer_id: string;
|
|
325
|
+
sections: ProductSection[];
|
|
326
|
+
}
|
|
327
|
+
interface ProductCardCarouselTemplateOptions {
|
|
328
|
+
name: string;
|
|
329
|
+
language: LanguagesEnum;
|
|
330
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
331
|
+
body: BodyOptions;
|
|
332
|
+
footer?: FooterOptions;
|
|
333
|
+
cards: Array<{
|
|
334
|
+
product_retailer_id: string;
|
|
335
|
+
}>;
|
|
336
|
+
}
|
|
337
|
+
interface SPMTemplateOptions {
|
|
338
|
+
name: string;
|
|
339
|
+
language: LanguagesEnum;
|
|
340
|
+
header?: Omit<HeaderOptions, 'format'>;
|
|
341
|
+
body: BodyOptions;
|
|
342
|
+
footer?: FooterOptions;
|
|
343
|
+
product_retailer_id: string;
|
|
344
|
+
}
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/api/template/TemplateApi.d.ts
|
|
347
|
+
declare class TemplateApi extends BaseAPI implements TemplateClass {
|
|
348
|
+
private readonly endpoint;
|
|
349
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
350
|
+
getTemplate(templateId: string): Promise<TemplateResponse>;
|
|
351
|
+
updateTemplate(templateId: string, template: Partial<TemplateRequestBody>): Promise<ResponseSuccess>;
|
|
352
|
+
getTemplates(params?: TemplateGetParams): Promise<ResponsePagination<TemplateResponse>>;
|
|
353
|
+
createTemplate(template: TemplateRequestBody): Promise<TemplateResponse>;
|
|
354
|
+
deleteTemplate(params: TemplateDeleteParams): Promise<ResponseSuccess>;
|
|
355
|
+
}
|
|
356
|
+
//#endregion
|
|
357
|
+
//#region src/api/template/factories/index.d.ts
|
|
358
|
+
declare function createTemplate(options: TemplateOptions): TemplateRequestBody;
|
|
359
|
+
declare function createOTPTemplate(options: OTPTemplateOptions): TemplateRequestBody;
|
|
360
|
+
declare function createAuthenticationTemplate(options: AuthenticationTemplateOptions): TemplateRequestBody;
|
|
361
|
+
declare function createCatalogTemplate(options: CatalogTemplateOptions): TemplateRequestBody;
|
|
362
|
+
declare function createCouponTemplate(options: CouponTemplateOptions): TemplateRequestBody;
|
|
363
|
+
declare function createLimitedTimeOfferTemplate(options: LimitedTimeOfferTemplateOptions): TemplateRequestBody;
|
|
364
|
+
declare function createMediaCardCarouselTemplate(options: MediaCardCarouselTemplateOptions): TemplateRequestBody;
|
|
365
|
+
declare function createMPMTemplate(options: MPMTemplateOptions): TemplateRequestBody;
|
|
366
|
+
declare function createProductCardCarouselTemplate(options: ProductCardCarouselTemplateOptions): TemplateRequestBody;
|
|
367
|
+
declare function createSPMTemplate(options: SPMTemplateOptions): TemplateRequestBody;
|
|
368
|
+
//#endregion
|
|
369
|
+
export { AuthenticationTemplateOptions, BodyOptions, ButtonOptions, CarouselCard, CarouselOptions, CatalogButton, CatalogTemplateOptions, ComponentTypes, CopyCodeButton, CouponTemplateOptions, CurrencyParameter, DateTimeParameter, FlowButton, FooterOptions, HeaderOptions, LimitedTimeOfferOptions, LimitedTimeOfferTemplateOptions, LocationParameter, MPMButton, MPMTemplateOptions, MediaCardCarouselTemplateOptions, MediaCarouselCard, MediaParameter, OTPButton, OTPTemplateOptions, PhoneNumberButton, ProductCardCarouselTemplateOptions, ProductCarouselCard, ProductParameter, ProductSection, QuickReplyButton, SPMButton, SPMTemplateOptions, TemplateApi, TemplateBody, TemplateButton, TemplateButtons, TemplateCarousel, type TemplateClass, type TemplateDeleteParams, TemplateFooter, TemplateFormat, type TemplateGetParams, TemplateHeader, TemplateHeaderExample, TemplateLimitedTimeOffer, TemplateOptions, TemplateParameter, type TemplateRequestBody, type TemplateResponse, TextParameter, URLButton, createAuthenticationTemplate, createCatalogTemplate, createCouponTemplate, createLimitedTimeOfferTemplate, createMPMTemplate, createMediaCardCarouselTemplate, createOTPTemplate, createProductCardCarouselTemplate, createSPMTemplate, createTemplate };
|
|
370
|
+
//# sourceMappingURL=index-CwujtcvH.d.ts.map
|