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,354 @@
|
|
|
1
|
+
import { BaseAPI, BaseClass, BusinessVerticalEnum, RequesterClass, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/profile/types/upload.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Upload session information for creating upload sessions.
|
|
6
|
+
*/
|
|
7
|
+
interface UploadSession {
|
|
8
|
+
id: string;
|
|
9
|
+
video?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Response from creating an upload session.
|
|
13
|
+
*/
|
|
14
|
+
interface UploadSessionResponse {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Response from uploading business profile media.
|
|
19
|
+
*/
|
|
20
|
+
interface UploadBusinessProfileResponse {
|
|
21
|
+
h: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Upload handle information containing file details and handle.
|
|
25
|
+
*/
|
|
26
|
+
interface UploadHandle {
|
|
27
|
+
handle: string;
|
|
28
|
+
file_size: number;
|
|
29
|
+
upload_result: {
|
|
30
|
+
handle_type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Request parameters for creating upload session.
|
|
36
|
+
*/
|
|
37
|
+
interface CreateUploadSessionParams {
|
|
38
|
+
/**
|
|
39
|
+
* Length of the file to be uploaded in bytes.
|
|
40
|
+
*/
|
|
41
|
+
fileLength: number;
|
|
42
|
+
/**
|
|
43
|
+
* MIME type of the file (e.g., 'image/jpeg').
|
|
44
|
+
*/
|
|
45
|
+
fileType: string;
|
|
46
|
+
/**
|
|
47
|
+
* Name of the file with extension.
|
|
48
|
+
*/
|
|
49
|
+
fileName: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Request parameters for uploading media.
|
|
53
|
+
*/
|
|
54
|
+
interface UploadMediaParams {
|
|
55
|
+
/**
|
|
56
|
+
* The upload session ID from createUploadSession response.
|
|
57
|
+
*/
|
|
58
|
+
uploadId: string;
|
|
59
|
+
/**
|
|
60
|
+
* The binary data of the file (Buffer).
|
|
61
|
+
*/
|
|
62
|
+
file: Buffer;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Request parameters for getting upload handle.
|
|
66
|
+
*/
|
|
67
|
+
interface GetUploadHandleParams {
|
|
68
|
+
/**
|
|
69
|
+
* The upload session ID from createUploadSession response.
|
|
70
|
+
*/
|
|
71
|
+
uploadId: string;
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/api/profile/types/common.d.ts
|
|
75
|
+
/**
|
|
76
|
+
* Available fields that can be requested when retrieving a business profile.
|
|
77
|
+
*/
|
|
78
|
+
type BusinessProfileField = 'about' | 'address' | 'description' | 'email' | 'profile_picture_url' | 'websites' | 'vertical';
|
|
79
|
+
type BusinessProfileFieldsParam = BusinessProfileField[] | string;
|
|
80
|
+
/**
|
|
81
|
+
* Business profile data structure containing all profile information.
|
|
82
|
+
*/
|
|
83
|
+
interface BusinessProfileData {
|
|
84
|
+
/**
|
|
85
|
+
* The business's About text. This text appears in the business's profile, beneath its profile image,
|
|
86
|
+
* phone number, and contact buttons.
|
|
87
|
+
* - String cannot be empty
|
|
88
|
+
* - Strings must be between 1 and 139 characters
|
|
89
|
+
* - Rendered emojis are supported however their unicode values are not.
|
|
90
|
+
* Emoji unicode values must be Java- or JavaScript-escape encoded
|
|
91
|
+
* - Hyperlinks can be included but will not render as clickable links
|
|
92
|
+
* - Markdown is not supported
|
|
93
|
+
*/
|
|
94
|
+
about?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Address of the business. Character limit 256.
|
|
97
|
+
*/
|
|
98
|
+
address?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Description of the business. Character limit 512.
|
|
101
|
+
*/
|
|
102
|
+
description?: string;
|
|
103
|
+
/**
|
|
104
|
+
* The contact email address (in valid email format) of the business. Character limit 128.
|
|
105
|
+
*/
|
|
106
|
+
email?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The messaging service used for the request. Always set it to "whatsapp" if you are using
|
|
109
|
+
* the WhatsApp Business API.
|
|
110
|
+
*/
|
|
111
|
+
messaging_product: string;
|
|
112
|
+
/**
|
|
113
|
+
* Profile picture URL.
|
|
114
|
+
*/
|
|
115
|
+
profile_picture_url?: string;
|
|
116
|
+
/**
|
|
117
|
+
* The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
|
|
118
|
+
* - You must include the http:// or https:// portion of the URL
|
|
119
|
+
* - There is a maximum of 2 websites with a maximum of 256 characters each
|
|
120
|
+
*/
|
|
121
|
+
websites?: string[];
|
|
122
|
+
/**
|
|
123
|
+
* Business category. This can be either an empty string or one of the predefined business categories.
|
|
124
|
+
* @see BusinessVerticalEnum for all available options
|
|
125
|
+
*/
|
|
126
|
+
vertical?: BusinessVerticalEnum | string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Response structure for business profile GET requests.
|
|
130
|
+
*/
|
|
131
|
+
interface BusinessProfileResponse {
|
|
132
|
+
data: BusinessProfileData[];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Request structure for updating business profile.
|
|
136
|
+
*/
|
|
137
|
+
interface UpdateBusinessProfileRequest {
|
|
138
|
+
/**
|
|
139
|
+
* The messaging service used for the request. Always set it to "whatsapp" if you are using
|
|
140
|
+
* the WhatsApp Business API.
|
|
141
|
+
* @required
|
|
142
|
+
*/
|
|
143
|
+
messaging_product: string;
|
|
144
|
+
/**
|
|
145
|
+
* The business's About text. This text appears in the business's profile, beneath its profile image,
|
|
146
|
+
* phone number, and contact buttons.
|
|
147
|
+
* - String cannot be empty
|
|
148
|
+
* - Strings must be between 1 and 139 characters
|
|
149
|
+
* - Rendered emojis are supported however their unicode values are not.
|
|
150
|
+
* Emoji unicode values must be Java- or JavaScript-escape encoded
|
|
151
|
+
* - Hyperlinks can be included but will not render as clickable links
|
|
152
|
+
* - Markdown is not supported
|
|
153
|
+
*/
|
|
154
|
+
about?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Address of the business. Character limit 256.
|
|
157
|
+
*/
|
|
158
|
+
address?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Description of the business. Character limit 512.
|
|
161
|
+
*/
|
|
162
|
+
description?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Business category. This can be either an empty string or one of the predefined business categories.
|
|
165
|
+
* @see BusinessVerticalEnum for all available options
|
|
166
|
+
*/
|
|
167
|
+
vertical?: BusinessVerticalEnum | string;
|
|
168
|
+
/**
|
|
169
|
+
* The contact email address (in valid email format) of the business. Character limit 128.
|
|
170
|
+
*/
|
|
171
|
+
email?: string;
|
|
172
|
+
/**
|
|
173
|
+
* The URLs associated with the business. For instance, a website, Facebook Page, or Instagram.
|
|
174
|
+
* - You must include the http:// or https:// portion of the URL
|
|
175
|
+
* - There is a maximum of 2 websites with a maximum of 256 characters each
|
|
176
|
+
*/
|
|
177
|
+
websites?: string[];
|
|
178
|
+
/**
|
|
179
|
+
* Handle of the profile picture. This handle is generated when you upload the binary file
|
|
180
|
+
* for the profile picture to Meta using the Resumable Upload API.
|
|
181
|
+
*/
|
|
182
|
+
profile_picture_handle?: string;
|
|
183
|
+
}
|
|
184
|
+
declare class BusinessProfileClass extends BaseClass {
|
|
185
|
+
/**
|
|
186
|
+
* Get your business profile.
|
|
187
|
+
* @param fields Specific fields to be returned in the response. If not specified, all fields will be returned.
|
|
188
|
+
*/
|
|
189
|
+
getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
|
|
190
|
+
/**
|
|
191
|
+
* Update your business profile.
|
|
192
|
+
* @param updateRequest The request object containing the fields to update.
|
|
193
|
+
*/
|
|
194
|
+
updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
|
|
195
|
+
/**
|
|
196
|
+
* Create an upload session for profile picture.
|
|
197
|
+
* @param fileLength Length of the file to be uploaded in bytes.
|
|
198
|
+
* @param fileType MIME type of the file (e.g., 'image/jpeg').
|
|
199
|
+
* @param fileName Name of the file.
|
|
200
|
+
*/
|
|
201
|
+
createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
|
|
202
|
+
/**
|
|
203
|
+
* Upload media file to the upload session.
|
|
204
|
+
* @param uploadId The ID of the upload session.
|
|
205
|
+
* @param file The binary data of the file.
|
|
206
|
+
*/
|
|
207
|
+
uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Get the upload handle information.
|
|
210
|
+
* @param uploadId The ID of the upload session.
|
|
211
|
+
*/
|
|
212
|
+
getUploadHandle(uploadId: string): Promise<UploadHandle>;
|
|
213
|
+
}
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/api/profile/BusinessProfileApi.d.ts
|
|
216
|
+
/**
|
|
217
|
+
* API for managing WhatsApp Business Profiles and profile pictures.
|
|
218
|
+
*
|
|
219
|
+
* This API allows you to:
|
|
220
|
+
* - Get business profile information
|
|
221
|
+
* - Update business profile details
|
|
222
|
+
* - Upload profile pictures using a three-step process:
|
|
223
|
+
* 1. Create an upload session
|
|
224
|
+
* 2. Upload the image binary data
|
|
225
|
+
* 3. Get the upload handle to use when updating the profile
|
|
226
|
+
*/
|
|
227
|
+
declare class BusinessProfileApi extends BaseAPI implements BusinessProfileClass {
|
|
228
|
+
private readonly endpoint;
|
|
229
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
230
|
+
/**
|
|
231
|
+
* Get your business profile information.
|
|
232
|
+
*
|
|
233
|
+
* Use this method to retrieve details about your WhatsApp business profile, including
|
|
234
|
+
* about text, address, description, email, profile picture URL, websites, and vertical.
|
|
235
|
+
*
|
|
236
|
+
* @param fields Fields to be returned in the response. If not specified, all fields will be returned.
|
|
237
|
+
* Possible values: about, address, description, email, profile_picture_url, websites, vertical
|
|
238
|
+
* @returns The business profile information.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* // Get all business profile fields
|
|
242
|
+
* const profile = await whatsappClient.businessProfile.getBusinessProfile();
|
|
243
|
+
*
|
|
244
|
+
* // Get specific business profile fields
|
|
245
|
+
* const profile = await whatsappClient.businessProfile.getBusinessProfile('about,address,email');
|
|
246
|
+
*
|
|
247
|
+
* // Using the BusinessProfileFieldsParam type
|
|
248
|
+
* const profile = await whatsappClient.businessProfile.getBusinessProfile(['about', 'address', 'email']);
|
|
249
|
+
*/
|
|
250
|
+
getBusinessProfile(fields?: BusinessProfileFieldsParam): Promise<BusinessProfileResponse>;
|
|
251
|
+
/**
|
|
252
|
+
* Update your business profile.
|
|
253
|
+
*
|
|
254
|
+
* Use this method to update one or more fields of your WhatsApp business profile.
|
|
255
|
+
*
|
|
256
|
+
* @param updateRequest The request object containing the fields to update.
|
|
257
|
+
* - messaging_product: Required. Always set to "whatsapp".
|
|
258
|
+
* - about: Optional. Business's About text (1-139 characters).
|
|
259
|
+
* - address: Optional. Business address (max 256 characters).
|
|
260
|
+
* - description: Optional. Business description (max 512 characters).
|
|
261
|
+
* - vertical: Optional. Business category (use BusinessVerticalEnum for type safety).
|
|
262
|
+
* - email: Optional. Contact email (valid format, max 128 characters).
|
|
263
|
+
* - websites: Optional. Up to 2 URLs (max 256 characters each).
|
|
264
|
+
* - profile_picture_handle: Optional. Handle from upload process.
|
|
265
|
+
* @returns Response indicating success or failure.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* // Update business profile with multiple fields including vertical using enum
|
|
269
|
+
* await whatsappClient.businessProfile.updateBusinessProfile({
|
|
270
|
+
* messaging_product: 'whatsapp',
|
|
271
|
+
* about: 'We provide excellent service',
|
|
272
|
+
* email: 'contact@example.com',
|
|
273
|
+
* websites: ['https://example.com'],
|
|
274
|
+
* vertical: BusinessVerticalEnum.RETAIL
|
|
275
|
+
* });
|
|
276
|
+
*/
|
|
277
|
+
updateBusinessProfile(updateRequest: UpdateBusinessProfileRequest): Promise<ResponseSuccess>;
|
|
278
|
+
/**
|
|
279
|
+
* Create an upload session for a profile picture.
|
|
280
|
+
*
|
|
281
|
+
* This is the first step in the profile picture upload process.
|
|
282
|
+
*
|
|
283
|
+
* @param fileLength Length of the file to be uploaded in bytes.
|
|
284
|
+
* @param fileType MIME type of the file (e.g., 'image/jpeg').
|
|
285
|
+
* @param fileName Name of the file with extension.
|
|
286
|
+
* @returns Response containing the upload session ID needed for the next step.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* // Create upload session for profile picture
|
|
290
|
+
* const session = await whatsappClient.businessProfile.createUploadSession(
|
|
291
|
+
* fileBuffer.length,
|
|
292
|
+
* 'image/jpeg',
|
|
293
|
+
* 'profile.jpg'
|
|
294
|
+
* );
|
|
295
|
+
* const uploadSessionId = session.upload_session_id;
|
|
296
|
+
*/
|
|
297
|
+
createUploadSession(fileLength: number, fileType: string, fileName: string): Promise<UploadSessionResponse>;
|
|
298
|
+
/**
|
|
299
|
+
* Upload media file to the upload session.
|
|
300
|
+
*
|
|
301
|
+
* This is the second step in the profile picture upload process.
|
|
302
|
+
* Upload the binary content of the file to the previously created upload session.
|
|
303
|
+
*
|
|
304
|
+
* @param uploadId The upload session ID from createUploadSession response.
|
|
305
|
+
* @param file The binary data of the file (Buffer).
|
|
306
|
+
* @returns Response indicating success or failure.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* // Upload the actual file content
|
|
310
|
+
* await whatsappClient.businessProfile.uploadMedia(
|
|
311
|
+
* uploadSessionId,
|
|
312
|
+
* fileBuffer
|
|
313
|
+
* );
|
|
314
|
+
*/
|
|
315
|
+
uploadMedia(uploadId: string, file: Buffer): Promise<UploadBusinessProfileResponse>;
|
|
316
|
+
/**
|
|
317
|
+
* Get the upload handle information.
|
|
318
|
+
*
|
|
319
|
+
* This is the third step in the profile picture upload process.
|
|
320
|
+
* After uploading the file, get the handle to use when updating the profile.
|
|
321
|
+
*
|
|
322
|
+
* @param uploadId The upload session ID from createUploadSession response.
|
|
323
|
+
* @returns Response containing the upload handle information.
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* // Complete profile picture update process
|
|
327
|
+
* // 1. Create upload session
|
|
328
|
+
* const session = await whatsappClient.businessProfile.createUploadSession(
|
|
329
|
+
* fileBuffer.length, 'image/jpeg', 'profile.jpg'
|
|
330
|
+
* );
|
|
331
|
+
*
|
|
332
|
+
* // 2. Upload the image data
|
|
333
|
+
* await whatsappClient.businessProfile.uploadMedia(
|
|
334
|
+
* session.upload_session_id, fileBuffer
|
|
335
|
+
* );
|
|
336
|
+
*
|
|
337
|
+
* // 3. Get the handle for the uploaded file
|
|
338
|
+
* const handleInfo = await whatsappClient.businessProfile.getUploadHandle(
|
|
339
|
+
* session.upload_session_id
|
|
340
|
+
* );
|
|
341
|
+
*
|
|
342
|
+
* // 4. Update profile with new picture and business information
|
|
343
|
+
* await whatsappClient.businessProfile.updateBusinessProfile({
|
|
344
|
+
* messaging_product: 'whatsapp',
|
|
345
|
+
* profile_picture_handle: handleInfo.handle,
|
|
346
|
+
* vertical: BusinessVerticalEnum.RESTAURANT,
|
|
347
|
+
* about: 'Delicious food served daily'
|
|
348
|
+
* });
|
|
349
|
+
*/
|
|
350
|
+
getUploadHandle(uploadId: string): Promise<UploadHandle>;
|
|
351
|
+
}
|
|
352
|
+
//#endregion
|
|
353
|
+
export { BusinessProfileApi, type BusinessProfileClass, type BusinessProfileData, type BusinessProfileField, type BusinessProfileFieldsParam, type BusinessProfileResponse, type CreateUploadSessionParams, type GetUploadHandleParams, type UpdateBusinessProfileRequest, type UploadBusinessProfileResponse, type UploadHandle, type UploadMediaParams, type UploadSession, type UploadSessionResponse };
|
|
354
|
+
//# sourceMappingURL=index-3KglHVAg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-3KglHVAg.d.ts","names":[],"sources":["../src/api/profile/types/upload.ts","../src/api/profile/types/common.ts","../src/api/profile/BusinessProfileApi.ts"],"sourcesContent":[],"mappings":";;;;;;AAGiB,UAAA,aAAA,CAAa;EAQb,EAAA,EAAA,MAAA;EAOA,KAAA,CAAA,EAAA,OAAA;AAOjB;AAYA;AAkBA;AAcA;UA1DiB,qBAAA;;;ACHjB;AASA;AAKA;AAiDiB,UDrDA,6BAAA,CCsDP;EAMO,CAAA,EAAA,MAAA;AAiDjB;;;;AAK6D,UD3G5C,YAAA,CC2G4C;QAMpB,EAAA,MAAA;WAAuC,EAAA,MAAA;eAAR,EAAA;IAQiB,WAAA,EAAA,MAAA;IAAR,IAAA,EAAA,MAAA;;;;;;AAnB/B,UD1FjC,yBAAA,CC0FiC;EAAS;;;;EC3GtC;;;UAG2B,EAAA,MAAA;;;;UA2DD,EAAA,MAAA;;;;;AAgED,UF3F7B,iBAAA,CE2F6B;;;;UAsCD,EAAA,MAAA;;;;QFzHnC;;;;;UAMO,qBAAA;;;;;;;;AA1DjB;AAOA;AAOA;AAYiB,KC7BL,oBAAA,GD6B8B,OAAA,GAAA,SAAA,GAAA,aAAA,GAAA,OAAA,GAAA,qBAAA,GAAA,UAAA,GAAA,UAAA;AAkBzB,KCtCL,0BAAA,GAA6B,oBD8CzB,EAAA,GAAA,MAAA;AAMhB;;;UC/CiB,mBAAA;EAdL;AASZ;AAKA;AAiDA;AAOA;AAiDA;;;;;OAWyC,CAAA,EAAA,MAAA;;;;SAQwC,CAAA,EAAA,MAAA;;;;aAalC,CAAA,EAAA,MAAA;;;;;;;ACxJZ;;mBAgBX,EAAA,MAAA;;;;qBAwB8C,CAAA,EAAA,MAAA;;;;;;UAmGxB,CAAA,EAAA,MAAA,EAAA;;;;;UA9HE,CAAA,ED6CjC,oBC7CiC,GAAA,MAAA;;;;;UDmD/B,uBAAA;QACP;;;;;UAMO,4BAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8BF;;;;;;;;;;;;;;;;;cAmBM,oBAAA,SAA6B,SAAA;;;;;8BAKlB,6BAA6B,QAAQ;;;;;uCAM5B,+BAA+B,QAAQ;;;;;;;+EAQC,QAAQ;;;;;;sCAOjD,SAAS,QAAQ;;;;;qCAMlB,QAAQ;;;;ADpJ/C;AAOA;AAOA;AAYA;AAkBA;AAcA;;;;AC7DA;AASA;AAKiB,cCFI,kBAAA,SAA2B,OAAA,YAAmB,oBD6ChC,CAAA;EAMlB,iBAAA,QAAA;EAOA,WAAA,CAAA,MAAA,ECvDO,cDuDqB,EAAA,MAAA,ECvDG,cDqFjC;EAmBM;;;;;;;;;;;;;;;;;;;;EC3GA,kBAAA,CAAA,MAAmB,CAAA,EA2BF,0BA3BE,CAAA,EA2B8B,OA3B9B,CA2BsC,uBA3BtC,CAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;uCA8DO,+BAAkC,QAAQ;;;;;;;;;;;;;;;;;;;;+EAgClF,QAAQ;;;;;;;;;;;;;;;;;;sCAgC+B,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAsClB,QAAQ"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { BaseAPI, RequesterClass, ResponseData, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/qrCode/types/common.d.ts
|
|
4
|
+
type QrCodeResponse = {
|
|
5
|
+
code: string;
|
|
6
|
+
prefilled_message: string;
|
|
7
|
+
deep_link_url: string;
|
|
8
|
+
qr_image_url?: string;
|
|
9
|
+
};
|
|
10
|
+
type QrCodesResponse = ResponseData<QrCodeResponse[]>;
|
|
11
|
+
type CreateQrCodeRequest = {
|
|
12
|
+
prefilled_message: string;
|
|
13
|
+
generate_qr_image?: 'SVG' | 'PNG';
|
|
14
|
+
};
|
|
15
|
+
type UpdateQrCodeRequest = {
|
|
16
|
+
code: string;
|
|
17
|
+
prefilled_message: string;
|
|
18
|
+
};
|
|
19
|
+
interface QrCodeClass {
|
|
20
|
+
createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
|
|
21
|
+
getQrCodes(): Promise<QrCodesResponse>;
|
|
22
|
+
getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
|
|
23
|
+
updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
|
|
24
|
+
deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/api/qrCode/QrCodeApi.d.ts
|
|
28
|
+
/**
|
|
29
|
+
* API for managing WhatsApp QR Codes.
|
|
30
|
+
*
|
|
31
|
+
* This API allows you to:
|
|
32
|
+
* - Create QR codes with prefilled messages
|
|
33
|
+
* - Get all QR codes
|
|
34
|
+
* - Get specific QR code details
|
|
35
|
+
* - Update QR code messages
|
|
36
|
+
* - Delete QR codes
|
|
37
|
+
*/
|
|
38
|
+
declare class QrCodeApi extends BaseAPI implements QrCodeClass {
|
|
39
|
+
private readonly endpoint;
|
|
40
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
41
|
+
/**
|
|
42
|
+
* Create a new QR code with a prefilled message.
|
|
43
|
+
*
|
|
44
|
+
* @param request The QR code creation request
|
|
45
|
+
* @returns QR code information including code, deep link URL, and optional image URL
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* const qrCode = await whatsappClient.qrCode.createQrCode({
|
|
49
|
+
* prefilled_message: 'Hello from WhatsApp!',
|
|
50
|
+
* generate_qr_image: 'PNG'
|
|
51
|
+
* });
|
|
52
|
+
*/
|
|
53
|
+
createQrCode(request: CreateQrCodeRequest): Promise<QrCodeResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Get all QR codes for the current phone number.
|
|
56
|
+
*
|
|
57
|
+
* @returns List of all QR codes
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* const qrCodes = await whatsappClient.qrCode.getQrCodes();
|
|
61
|
+
*/
|
|
62
|
+
getQrCodes(): Promise<QrCodesResponse>;
|
|
63
|
+
/**
|
|
64
|
+
* Get a specific QR code by ID.
|
|
65
|
+
*
|
|
66
|
+
* @param qrCodeId The QR code ID to retrieve
|
|
67
|
+
* @returns QR code information
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* const qrCode = await whatsappClient.qrCode.getQrCode('qr_code_123');
|
|
71
|
+
*/
|
|
72
|
+
getQrCode(qrCodeId: string): Promise<QrCodeResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Update an existing QR code's prefilled message.
|
|
75
|
+
*
|
|
76
|
+
* @param request The QR code update request containing code and new message
|
|
77
|
+
* @returns Updated QR code information
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* const updatedQrCode = await whatsappClient.qrCode.updateQrCode({
|
|
81
|
+
* code: 'existing_qr_code',
|
|
82
|
+
* prefilled_message: 'Updated message!'
|
|
83
|
+
* });
|
|
84
|
+
*/
|
|
85
|
+
updateQrCode(request: UpdateQrCodeRequest): Promise<QrCodeResponse>;
|
|
86
|
+
/**
|
|
87
|
+
* Delete a QR code.
|
|
88
|
+
*
|
|
89
|
+
* @param qrCodeId The QR code ID to delete
|
|
90
|
+
* @returns Response indicating success or failure
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await whatsappClient.qrCode.deleteQrCode('qr_code_123');
|
|
94
|
+
*/
|
|
95
|
+
deleteQrCode(qrCodeId: string): Promise<ResponseSuccess>;
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
export { type CreateQrCodeRequest, QrCodeApi, type QrCodeClass, type QrCodeResponse, type QrCodesResponse, type UpdateQrCodeRequest };
|
|
99
|
+
//# sourceMappingURL=index-BNeg6hHx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BNeg6hHx.d.ts","names":[],"sources":["../src/api/qrCode/types/common.ts","../src/api/qrCode/QrCodeApi.ts"],"sourcesContent":[],"mappings":";;;KAEY,cAAA;;EAAA,iBAAc,EAAA,MAAA;EAOd,aAAA,EAAA,MAAe;EAAA,YAAA,CAAA,EAAA,MAAA;;AAAG,KAAlB,eAAA,GAAkB,YAAA,CAAa,cAAb,EAAA,CAAA;AAAY,KAE9B,mBAAA,GAF8B;EAE9B,iBAAA,EAAA,MAAmB;EAKnB,iBAAA,CAAA,EAAA,KAAmB,GAAA,KAAA;AAK/B,CAAA;AAA4B,KALhB,mBAAA,GAKgB;MACF,EAAA,MAAA;mBAA8B,EAAA,MAAA;;AAC9B,UAFT,WAAA,CAES;cAAR,CAAA,OAAA,EADQ,mBACR,CAAA,EAD8B,OAC9B,CADsC,cACtC,CAAA;YACuB,EAAA,EADvB,OACuB,CADf,eACe,CAAA;WAAR,CAAA,QAAA,EAAA,MAAA,CAAA,EAAA,OAAA,CAAQ,cAAR,CAAA;cACP,CAAA,OAAA,EAAA,mBAAA,CAAA,EAAsB,OAAtB,CAA8B,cAA9B,CAAA;cAA8B,CAAA,QAAA,EAAA,MAAA,CAAA,EACpB,OADoB,CACZ,eADY,CAAA;;;;AAhBxD;;;;;AAEA;AAKA;AAKA;;;AACwD,cCLnC,SAAA,SAAkB,OAAA,YAAmB,WDKF,CAAA;mBAAR,QAAA;aACtB,CAAA,MAAA,ECHF,cDGE,EAAA,MAAA,ECHsB,cDGtB;;;;;;;;;;;;;ECNL,YAAU,CAAA,OAAA,EAmBC,mBAnBD,CAAA,EAmB8B,OAnB9B,CAmBsC,cAnBtC,CAAA;EAAA;;;;;;;;YAsDgB,CAAA,CAAA,EAlBvB,OAkBuB,CAlBf,eAkBe,CAAA;;;;;;;;;;+BAAR,QAAQ;;;;;;;;;;;;;wBAqBf,sBAA6B,QAAQ;;;;;;;;;;kCAkB3B,QAAQ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseAPI, RequesterClass, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/twoStepVerification/types/common.d.ts
|
|
4
|
+
type TwoStepVerificationRequest = {
|
|
5
|
+
pin: string;
|
|
6
|
+
};
|
|
7
|
+
interface TwoStepVerificationClass {
|
|
8
|
+
setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/api/twoStepVerification/TwoStepVerificationApi.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* API for managing WhatsApp Two-Step Verification.
|
|
14
|
+
*
|
|
15
|
+
* This API allows you to:
|
|
16
|
+
* - Set a two-step verification PIN code
|
|
17
|
+
* - Manage two-step verification settings
|
|
18
|
+
*/
|
|
19
|
+
declare class TwoStepVerificationApi extends BaseAPI implements TwoStepVerificationClass {
|
|
20
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
21
|
+
/**
|
|
22
|
+
* Set a two-step verification PIN code.
|
|
23
|
+
*
|
|
24
|
+
* @param pin The PIN code to set for two-step verification (6-digit numeric string)
|
|
25
|
+
* @returns Response indicating success or failure
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await whatsappClient.twoStepVerification.setTwoStepVerificationCode('123456');
|
|
29
|
+
*/
|
|
30
|
+
setTwoStepVerificationCode(pin: string): Promise<ResponseSuccess>;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { TwoStepVerificationApi, type TwoStepVerificationClass, type TwoStepVerificationRequest };
|
|
34
|
+
//# sourceMappingURL=index-BiTq23oi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BiTq23oi.d.ts","names":[],"sources":["../src/api/twoStepVerification/types/common.ts","../src/api/twoStepVerification/TwoStepVerificationApi.ts"],"sourcesContent":[],"mappings":";;;KAEY,0BAAA;;AAAZ,CAAA;AAIiB,UAAA,wBAAA,CAAwB;EAAA,0BAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EACI,OADJ,CACY,eADZ,CAAA;;;;AAAzC;;;;;;;cCQqB,sBAAA,SAA+B,OAAA,YAAmB;EAAlD,WAAA,CAAA,MAAA,EACG,cADoB,EAAA,MAAA,EACI,cADJ;EAAA;;;;;;;;;2CAcO,QAAQ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseAPI, DataLocalizationRegionEnum, RequesterClass, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/registration/types/common.d.ts
|
|
4
|
+
type RegistrationRequest = {
|
|
5
|
+
messaging_product: 'whatsapp';
|
|
6
|
+
pin: string;
|
|
7
|
+
data_localization_region?: DataLocalizationRegionEnum;
|
|
8
|
+
};
|
|
9
|
+
interface RegistrationClass {
|
|
10
|
+
register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
|
|
11
|
+
deregister(): Promise<ResponseSuccess>;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/api/registration/RegistrationApi.d.ts
|
|
15
|
+
/**
|
|
16
|
+
* API for managing WhatsApp Business Account registration.
|
|
17
|
+
*
|
|
18
|
+
* This API allows you to:
|
|
19
|
+
* - Register a WhatsApp Business Account with a PIN
|
|
20
|
+
* - Deregister a WhatsApp Business Account
|
|
21
|
+
*/
|
|
22
|
+
declare class RegistrationApi extends BaseAPI implements RegistrationClass {
|
|
23
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
24
|
+
/**
|
|
25
|
+
* Register a WhatsApp Business Account using a PIN.
|
|
26
|
+
*
|
|
27
|
+
* @param pin The registration PIN received via SMS or voice call
|
|
28
|
+
* @param dataLocalizationRegion Optional data localization region
|
|
29
|
+
* @returns Response indicating success or failure
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await whatsappClient.registration.register('123456', DataLocalizationRegionEnum.Asia);
|
|
33
|
+
*/
|
|
34
|
+
register(pin: string, dataLocalizationRegion?: DataLocalizationRegionEnum): Promise<ResponseSuccess>;
|
|
35
|
+
/**
|
|
36
|
+
* Deregister a WhatsApp Business Account.
|
|
37
|
+
*
|
|
38
|
+
* @returns Response indicating success or failure
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await whatsappClient.registration.deregister();
|
|
42
|
+
*/
|
|
43
|
+
deregister(): Promise<ResponseSuccess>;
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { RegistrationApi, type RegistrationClass, type RegistrationRequest };
|
|
47
|
+
//# sourceMappingURL=index-BmfnREgM.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BmfnREgM.d.ts","names":[],"sources":["../src/api/registration/types/common.ts","../src/api/registration/RegistrationApi.ts"],"sourcesContent":[],"mappings":";;;KAGY,mBAAA;EAAA,iBAAA,EAAA,UAAmB;EAMd,GAAA,EAAA,MAAA;EAAiB,wBAAA,CAAA,EAHH,0BAGG;;AACsD,UADvE,iBAAA,CACuE;UAAR,CAAA,GAAA,EAAA,MAAA,EAAA,sBAAA,CAAA,EAA7B,0BAA6B,CAAA,EAAA,OAAA,CAAQ,eAAR,CAAA;YACtD,EAAA,EAAR,OAAQ,CAAA,eAAA,CAAA;;;;;;;;;;;cCGL,eAAA,SAAwB,OAAA,YAAmB;sBACxC,wBAAwB;;AAVH;;;;;;;;;UASA,CAAA,GAAA,EAAA,MAAA,EAAA,sBAAA,CAAA,EAeY,0BAfZ,CAAA,EAeyC,OAfzC,CAeiD,eAfjD,CAAA;;;;;;;;;gBAsCrB,QAAQ"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseAPI, RequesterClass, ResponseData, ResponseSuccess, WabaConfigType } from "./base-CfDkvT1x.js";
|
|
2
|
+
|
|
3
|
+
//#region src/api/encryption/types/publicKey.d.ts
|
|
4
|
+
type EncryptionPublicKeyResponse = ResponseData<{
|
|
5
|
+
business_public_key: string;
|
|
6
|
+
business_public_key_signature_status: 'VALID' | 'MISMATCH';
|
|
7
|
+
}>;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/api/encryption/types/common.d.ts
|
|
10
|
+
interface EncryptionClass {
|
|
11
|
+
getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
|
|
12
|
+
setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/api/encryption/EncryptionApi.d.ts
|
|
16
|
+
declare class EncryptionApi extends BaseAPI implements EncryptionClass {
|
|
17
|
+
private readonly endpoint;
|
|
18
|
+
constructor(config: WabaConfigType, client: RequesterClass);
|
|
19
|
+
getEncryptionPublicKey(): Promise<EncryptionPublicKeyResponse>;
|
|
20
|
+
setEncryptionPublicKey(businessPublicKey: string): Promise<ResponseSuccess>;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { EncryptionApi, type EncryptionClass, type EncryptionPublicKeyResponse };
|
|
24
|
+
//# sourceMappingURL=index-CaGffSja.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CaGffSja.d.ts","names":[],"sources":["../src/api/encryption/types/publicKey.ts","../src/api/encryption/types/common.ts","../src/api/encryption/EncryptionApi.ts"],"sourcesContent":[],"mappings":";;;KAEY,2BAAA,GAA8B;;EAA9B,oCAA2B,EAAA,OAAG,GAAA,UAAY;;;;UCCrC,eAAA;EDDL,sBAAA,EAAA,ECEkB,ODFS,CCED,2BDFgB,CAAA;qDCGC,QAAQ;;;;cCC1C,aAAA,SAAsB,OAAA,YAAmB;;sBAGtC,wBAAwB;EDN/B,sBAAe,CAAA,CAAA,ECUI,ODVJ,CCUY,2BDVZ,CAAA;EAAA,sBAAA,CAAA,iBAAA,EAAA,MAAA,CAAA,ECmB6B,ODnB7B,CCmBqC,eDnBrC,CAAA"}
|