@rempays/shared-core 1.0.2-beta.12 → 1.0.2-beta.14
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.
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { SendTextParams, SendTemplateParams, SendInteractiveParams, SendInteractiveListParams, SendImageParams, SendDocumentParams, SendLocationParams, SetTypingParams, MarkAsReadParams } from
|
|
1
|
+
import type { SendTextParams, SendTemplateParams, SendInteractiveParams, SendInteractiveListParams, SendImageParams, SendDocumentParams, SendLocationParams, SetTypingParams, MarkAsReadParams, SendAudioParams, SendVideoParams, MediaInfoResponse, CreateTemplateParams, BusinessProfileParams, BusinessProfileResponse, UpdateDisplayNameParams, DisplayNameStatusResponse } from "./types";
|
|
2
2
|
export declare class FacebookApi {
|
|
3
3
|
private static token;
|
|
4
4
|
private static phoneNumberId;
|
|
5
5
|
private static apiVersion;
|
|
6
|
+
private static appId;
|
|
7
|
+
constructor(token?: string, phoneNumberId?: string, apiVersion?: string, appId?: string);
|
|
6
8
|
private static init;
|
|
7
9
|
private static post;
|
|
8
10
|
static sendText(params: SendTextParams): Promise<any>;
|
|
@@ -11,7 +13,33 @@ export declare class FacebookApi {
|
|
|
11
13
|
static sendInteractiveList(params: SendInteractiveListParams): Promise<any>;
|
|
12
14
|
static sendImage(params: SendImageParams): Promise<any>;
|
|
13
15
|
static sendDocument(params: SendDocumentParams): Promise<any>;
|
|
16
|
+
static sendAudio(params: SendAudioParams): Promise<any>;
|
|
17
|
+
static sendVideo(params: SendVideoParams): Promise<any>;
|
|
14
18
|
static sendLocation(params: SendLocationParams): Promise<any>;
|
|
15
19
|
static setTyping(params: SetTypingParams): Promise<any>;
|
|
16
20
|
static markAsRead(params: MarkAsReadParams): Promise<any>;
|
|
21
|
+
static getMediaInfo(mediaId: string): Promise<MediaInfoResponse>;
|
|
22
|
+
static downloadMedia(mediaId: string): Promise<Buffer>;
|
|
23
|
+
static buildGoogleMapsUrl(latitude: number, longitude: number): string;
|
|
24
|
+
static listTemplates(wabaId: string): Promise<any>;
|
|
25
|
+
static createTemplate(params: CreateTemplateParams): Promise<any>;
|
|
26
|
+
static deleteTemplate(wabaId: string, name: string): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Uploads an image and updates the business profile picture.
|
|
29
|
+
* @param buffer Image binary data
|
|
30
|
+
* @param mimeType Image MIME type (image/jpeg or image/png)
|
|
31
|
+
*/
|
|
32
|
+
static updateProfilePicture(buffer: Buffer, mimeType: string): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Uploads media for chat (messages).
|
|
35
|
+
* @param buffer Media binary data
|
|
36
|
+
* @param mimeType MIME type of the file
|
|
37
|
+
*/
|
|
38
|
+
static uploadMedia(buffer: Buffer, mimeType: string): Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
}>;
|
|
41
|
+
static getBusinessProfile(): Promise<BusinessProfileResponse>;
|
|
42
|
+
static updateBusinessProfile(params: BusinessProfileParams): Promise<any>;
|
|
43
|
+
static updateDisplayName(params: UpdateDisplayNameParams): Promise<any>;
|
|
44
|
+
static getDisplayNameStatus(): Promise<DisplayNameStatusResponse>;
|
|
17
45
|
}
|
|
@@ -3,12 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FacebookApi = void 0;
|
|
4
4
|
const http_1 = require("./http");
|
|
5
5
|
class FacebookApi {
|
|
6
|
+
constructor(token, phoneNumberId, apiVersion, appId) {
|
|
7
|
+
if (token)
|
|
8
|
+
FacebookApi.token = token;
|
|
9
|
+
if (phoneNumberId)
|
|
10
|
+
FacebookApi.phoneNumberId = phoneNumberId;
|
|
11
|
+
if (apiVersion)
|
|
12
|
+
FacebookApi.apiVersion = apiVersion;
|
|
13
|
+
if (appId)
|
|
14
|
+
FacebookApi.appId = appId;
|
|
15
|
+
}
|
|
6
16
|
static async init() {
|
|
7
17
|
if (this.token && this.phoneNumberId && this.apiVersion)
|
|
8
18
|
return;
|
|
9
|
-
this.token = process.env.FACEBOOK_API_TOKEN || null;
|
|
10
|
-
this.phoneNumberId =
|
|
11
|
-
|
|
19
|
+
this.token = this.token || process.env.FACEBOOK_API_TOKEN || null;
|
|
20
|
+
this.phoneNumberId =
|
|
21
|
+
this.phoneNumberId || process.env.FACEBOOK_PHONE_NUMBER_ID || null;
|
|
22
|
+
this.apiVersion =
|
|
23
|
+
this.apiVersion || process.env.FACEBOOK_API_VERSION || "v18.0";
|
|
24
|
+
this.appId = this.appId || process.env.FACEBOOK_APP_ID || null;
|
|
12
25
|
if (!this.token || !this.phoneNumberId) {
|
|
13
26
|
throw new Error("Facebook API environment variables are not properly configured (FACEBOOK_API_TOKEN, FACEBOOK_PHONE_NUMBER_ID)");
|
|
14
27
|
}
|
|
@@ -37,16 +50,25 @@ class FacebookApi {
|
|
|
37
50
|
throw new Error(msg);
|
|
38
51
|
}
|
|
39
52
|
}
|
|
53
|
+
/*
|
|
54
|
+
TEXT
|
|
55
|
+
*/
|
|
40
56
|
static async sendText(params) {
|
|
41
57
|
const payload = {
|
|
42
58
|
messaging_product: "whatsapp",
|
|
43
59
|
recipient_type: "individual",
|
|
44
60
|
to: params.to,
|
|
45
61
|
type: "text",
|
|
46
|
-
text: {
|
|
62
|
+
text: {
|
|
63
|
+
body: params.body,
|
|
64
|
+
preview_url: params.previewUrl ?? true,
|
|
65
|
+
},
|
|
47
66
|
};
|
|
48
67
|
return await this.post("messages", payload);
|
|
49
68
|
}
|
|
69
|
+
/*
|
|
70
|
+
TEMPLATE
|
|
71
|
+
*/
|
|
50
72
|
static async sendTemplate(params) {
|
|
51
73
|
const payload = {
|
|
52
74
|
messaging_product: "whatsapp",
|
|
@@ -60,6 +82,9 @@ class FacebookApi {
|
|
|
60
82
|
};
|
|
61
83
|
return await this.post("messages", payload);
|
|
62
84
|
}
|
|
85
|
+
/*
|
|
86
|
+
BUTTONS
|
|
87
|
+
*/
|
|
63
88
|
static async sendInteractiveButtons(params) {
|
|
64
89
|
const payload = {
|
|
65
90
|
messaging_product: "whatsapp",
|
|
@@ -80,6 +105,9 @@ class FacebookApi {
|
|
|
80
105
|
};
|
|
81
106
|
return await this.post("messages", payload);
|
|
82
107
|
}
|
|
108
|
+
/*
|
|
109
|
+
LIST
|
|
110
|
+
*/
|
|
83
111
|
static async sendInteractiveList(params) {
|
|
84
112
|
const payload = {
|
|
85
113
|
messaging_product: "whatsapp",
|
|
@@ -109,15 +137,25 @@ class FacebookApi {
|
|
|
109
137
|
}
|
|
110
138
|
return await this.post("messages", payload);
|
|
111
139
|
}
|
|
140
|
+
/*
|
|
141
|
+
IMAGE
|
|
142
|
+
*/
|
|
112
143
|
static async sendImage(params) {
|
|
113
144
|
const payload = {
|
|
114
145
|
messaging_product: "whatsapp",
|
|
115
146
|
to: params.to,
|
|
116
147
|
type: "image",
|
|
117
|
-
image: {
|
|
148
|
+
image: {
|
|
149
|
+
link: params.link,
|
|
150
|
+
id: params.id,
|
|
151
|
+
caption: params.caption
|
|
152
|
+
},
|
|
118
153
|
};
|
|
119
154
|
return await this.post("messages", payload);
|
|
120
155
|
}
|
|
156
|
+
/*
|
|
157
|
+
DOCUMENT
|
|
158
|
+
*/
|
|
121
159
|
static async sendDocument(params) {
|
|
122
160
|
const payload = {
|
|
123
161
|
messaging_product: "whatsapp",
|
|
@@ -125,12 +163,47 @@ class FacebookApi {
|
|
|
125
163
|
type: "document",
|
|
126
164
|
document: {
|
|
127
165
|
link: params.link,
|
|
166
|
+
id: params.id,
|
|
128
167
|
caption: params.caption,
|
|
129
168
|
filename: params.filename,
|
|
130
169
|
},
|
|
131
170
|
};
|
|
132
171
|
return await this.post("messages", payload);
|
|
133
172
|
}
|
|
173
|
+
/*
|
|
174
|
+
AUDIO (NEW)
|
|
175
|
+
*/
|
|
176
|
+
static async sendAudio(params) {
|
|
177
|
+
const payload = {
|
|
178
|
+
messaging_product: "whatsapp",
|
|
179
|
+
to: params.to,
|
|
180
|
+
type: "audio",
|
|
181
|
+
audio: {
|
|
182
|
+
link: params.link,
|
|
183
|
+
id: params.id,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
return await this.post("messages", payload);
|
|
187
|
+
}
|
|
188
|
+
/*
|
|
189
|
+
VIDEO (NEW)
|
|
190
|
+
*/
|
|
191
|
+
static async sendVideo(params) {
|
|
192
|
+
const payload = {
|
|
193
|
+
messaging_product: "whatsapp",
|
|
194
|
+
to: params.to,
|
|
195
|
+
type: "video",
|
|
196
|
+
video: {
|
|
197
|
+
link: params.link,
|
|
198
|
+
id: params.id,
|
|
199
|
+
caption: params.caption,
|
|
200
|
+
},
|
|
201
|
+
};
|
|
202
|
+
return await this.post("messages", payload);
|
|
203
|
+
}
|
|
204
|
+
/*
|
|
205
|
+
LOCATION
|
|
206
|
+
*/
|
|
134
207
|
static async sendLocation(params) {
|
|
135
208
|
const payload = {
|
|
136
209
|
messaging_product: "whatsapp",
|
|
@@ -145,6 +218,9 @@ class FacebookApi {
|
|
|
145
218
|
};
|
|
146
219
|
return await this.post("messages", payload);
|
|
147
220
|
}
|
|
221
|
+
/*
|
|
222
|
+
TYPING
|
|
223
|
+
*/
|
|
148
224
|
static async setTyping(params) {
|
|
149
225
|
const payload = {
|
|
150
226
|
messaging_product: "whatsapp",
|
|
@@ -154,6 +230,9 @@ class FacebookApi {
|
|
|
154
230
|
};
|
|
155
231
|
return await this.post("messages", payload);
|
|
156
232
|
}
|
|
233
|
+
/*
|
|
234
|
+
READ
|
|
235
|
+
*/
|
|
157
236
|
static async markAsRead(params) {
|
|
158
237
|
const payload = {
|
|
159
238
|
messaging_product: "whatsapp",
|
|
@@ -162,8 +241,182 @@ class FacebookApi {
|
|
|
162
241
|
};
|
|
163
242
|
return await this.post("messages", payload);
|
|
164
243
|
}
|
|
244
|
+
/*
|
|
245
|
+
MEDIA INFO (NEW)
|
|
246
|
+
*/
|
|
247
|
+
static async getMediaInfo(mediaId) {
|
|
248
|
+
await this.init();
|
|
249
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
250
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${mediaId}`;
|
|
251
|
+
const { data } = await http.get(url);
|
|
252
|
+
return data;
|
|
253
|
+
}
|
|
254
|
+
/*
|
|
255
|
+
DOWNLOAD MEDIA (NEW)
|
|
256
|
+
*/
|
|
257
|
+
static async downloadMedia(mediaId) {
|
|
258
|
+
await this.init();
|
|
259
|
+
const media = await this.getMediaInfo(mediaId);
|
|
260
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
261
|
+
const { data } = await http.get(media.url, {
|
|
262
|
+
responseType: "arraybuffer",
|
|
263
|
+
});
|
|
264
|
+
return data;
|
|
265
|
+
}
|
|
266
|
+
/*
|
|
267
|
+
GOOGLE MAP URL (NEW)
|
|
268
|
+
*/
|
|
269
|
+
static buildGoogleMapsUrl(latitude, longitude) {
|
|
270
|
+
return `https://www.google.com/maps?q=${latitude},${longitude}`;
|
|
271
|
+
}
|
|
272
|
+
static async listTemplates(wabaId) {
|
|
273
|
+
await this.init();
|
|
274
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
275
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${wabaId}/message_templates`;
|
|
276
|
+
const { data } = await http.get(url);
|
|
277
|
+
return data;
|
|
278
|
+
}
|
|
279
|
+
static async createTemplate(params) {
|
|
280
|
+
await this.init();
|
|
281
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
282
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${params.wabaId}/message_templates`;
|
|
283
|
+
const payload = {
|
|
284
|
+
name: params.name,
|
|
285
|
+
category: params.category,
|
|
286
|
+
language: params.language,
|
|
287
|
+
components: [
|
|
288
|
+
{
|
|
289
|
+
type: "BODY",
|
|
290
|
+
text: params.bodyText
|
|
291
|
+
}
|
|
292
|
+
]
|
|
293
|
+
};
|
|
294
|
+
const { data } = await http.post(url, payload);
|
|
295
|
+
return data;
|
|
296
|
+
}
|
|
297
|
+
static async deleteTemplate(wabaId, name) {
|
|
298
|
+
await this.init();
|
|
299
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
300
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${wabaId}/message_templates`;
|
|
301
|
+
const { data } = await http.delete(url, {
|
|
302
|
+
params: { name }
|
|
303
|
+
});
|
|
304
|
+
return data;
|
|
305
|
+
}
|
|
306
|
+
/*
|
|
307
|
+
PROFILE PICTURE UPLOAD (TWO-STEP)
|
|
308
|
+
*/
|
|
309
|
+
/**
|
|
310
|
+
* Uploads an image and updates the business profile picture.
|
|
311
|
+
* @param buffer Image binary data
|
|
312
|
+
* @param mimeType Image MIME type (image/jpeg or image/png)
|
|
313
|
+
*/
|
|
314
|
+
static async updateProfilePicture(buffer, mimeType) {
|
|
315
|
+
await this.init();
|
|
316
|
+
if (!this.appId) {
|
|
317
|
+
throw new Error("FACEBOOK_APP_ID is required for profile picture uploads");
|
|
318
|
+
}
|
|
319
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
320
|
+
// 1. Create upload session
|
|
321
|
+
const sessionUrl = `https://graph.facebook.com/${this.apiVersion}/${this.appId}/uploads`;
|
|
322
|
+
const { data: sessionData } = await http.post(sessionUrl, null, {
|
|
323
|
+
params: {
|
|
324
|
+
file_length: buffer.length,
|
|
325
|
+
file_type: mimeType,
|
|
326
|
+
access_token: this.token
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
const sessionId = sessionData.id;
|
|
330
|
+
// 2. Upload the file data
|
|
331
|
+
const uploadUrl = `https://graph.facebook.com/${this.apiVersion}/${sessionId}`;
|
|
332
|
+
const { data: uploadData } = await http.post(uploadUrl, buffer, {
|
|
333
|
+
headers: {
|
|
334
|
+
'file_offset': 0,
|
|
335
|
+
'Content-Type': mimeType
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
const handle = uploadData.h;
|
|
339
|
+
// 3. Update the business profile with the handle
|
|
340
|
+
return await this.updateBusinessProfile({
|
|
341
|
+
profile_picture_handle: handle
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
/*
|
|
345
|
+
CHAT MEDIA UPLOAD
|
|
346
|
+
*/
|
|
347
|
+
/**
|
|
348
|
+
* Uploads media for chat (messages).
|
|
349
|
+
* @param buffer Media binary data
|
|
350
|
+
* @param mimeType MIME type of the file
|
|
351
|
+
*/
|
|
352
|
+
static async uploadMedia(buffer, mimeType) {
|
|
353
|
+
await this.init();
|
|
354
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
355
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}/media`;
|
|
356
|
+
const formData = new FormData();
|
|
357
|
+
const blob = new Blob([buffer], { type: mimeType });
|
|
358
|
+
formData.append('file', blob, 'media');
|
|
359
|
+
formData.append('type', mimeType);
|
|
360
|
+
formData.append('messaging_product', 'whatsapp');
|
|
361
|
+
const { data } = await http.post(url, formData, {
|
|
362
|
+
headers: {
|
|
363
|
+
'Content-Type': 'multipart/form-data'
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
return data; // Returns { id: "media_id" }
|
|
367
|
+
}
|
|
368
|
+
/*
|
|
369
|
+
BUSINESS PROFILE
|
|
370
|
+
*/
|
|
371
|
+
static async getBusinessProfile() {
|
|
372
|
+
await this.init();
|
|
373
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
374
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}/whatsapp_business_profile`;
|
|
375
|
+
const { data } = await http.get(url, {
|
|
376
|
+
params: {
|
|
377
|
+
fields: "about,address,description,email,profile_picture_url,websites,vertical"
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
// The response is usually { data: [ { ... } ] }
|
|
381
|
+
return data.data?.[0] || data;
|
|
382
|
+
}
|
|
383
|
+
static async updateBusinessProfile(params) {
|
|
384
|
+
const payload = {
|
|
385
|
+
messaging_product: "whatsapp",
|
|
386
|
+
...params
|
|
387
|
+
};
|
|
388
|
+
return await this.post("whatsapp_business_profile", payload);
|
|
389
|
+
}
|
|
390
|
+
/*
|
|
391
|
+
DISPLAY NAME
|
|
392
|
+
*/
|
|
393
|
+
static async updateDisplayName(params) {
|
|
394
|
+
await this.init();
|
|
395
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
396
|
+
// Using phone number ID directly with query params as per Meta documentation
|
|
397
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}`;
|
|
398
|
+
const { data } = await http.post(url, null, {
|
|
399
|
+
params: {
|
|
400
|
+
new_display_name: params.new_display_name
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
return data;
|
|
404
|
+
}
|
|
405
|
+
static async getDisplayNameStatus() {
|
|
406
|
+
await this.init();
|
|
407
|
+
const http = (0, http_1.getHttpClient)(this.token);
|
|
408
|
+
// Using phone number ID to get status of display names
|
|
409
|
+
const url = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}`;
|
|
410
|
+
const { data } = await http.get(url, {
|
|
411
|
+
params: {
|
|
412
|
+
fields: "verified_name,name_status,new_display_name,new_name_status"
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
return data;
|
|
416
|
+
}
|
|
165
417
|
}
|
|
166
418
|
exports.FacebookApi = FacebookApi;
|
|
167
419
|
FacebookApi.token = null;
|
|
168
420
|
FacebookApi.phoneNumberId = null;
|
|
169
421
|
FacebookApi.apiVersion = null;
|
|
422
|
+
FacebookApi.appId = null;
|
|
@@ -7,7 +7,13 @@ export interface SendTemplateParams {
|
|
|
7
7
|
to: string;
|
|
8
8
|
name: string;
|
|
9
9
|
languageCode: string;
|
|
10
|
-
components?:
|
|
10
|
+
components?: Array<{
|
|
11
|
+
type: "header" | "body" | "button";
|
|
12
|
+
parameters?: Array<{
|
|
13
|
+
type: "text" | "image" | "document" | "video";
|
|
14
|
+
text?: string;
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
11
17
|
}
|
|
12
18
|
export interface SendInteractiveParams {
|
|
13
19
|
to: string;
|
|
@@ -43,12 +49,14 @@ export interface SendInteractiveListParams {
|
|
|
43
49
|
}
|
|
44
50
|
export interface SendImageParams {
|
|
45
51
|
to: string;
|
|
46
|
-
link
|
|
52
|
+
link?: string;
|
|
53
|
+
id?: string;
|
|
47
54
|
caption?: string;
|
|
48
55
|
}
|
|
49
56
|
export interface SendDocumentParams {
|
|
50
57
|
to: string;
|
|
51
|
-
link
|
|
58
|
+
link?: string;
|
|
59
|
+
id?: string;
|
|
52
60
|
filename?: string;
|
|
53
61
|
caption?: string;
|
|
54
62
|
}
|
|
@@ -107,3 +115,57 @@ export interface PhoneNumberInfo {
|
|
|
107
115
|
quality_rating?: string;
|
|
108
116
|
code_verification_status?: string;
|
|
109
117
|
}
|
|
118
|
+
export interface SendAudioParams {
|
|
119
|
+
to: string;
|
|
120
|
+
link?: string;
|
|
121
|
+
id?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface SendVideoParams {
|
|
124
|
+
to: string;
|
|
125
|
+
link?: string;
|
|
126
|
+
id?: string;
|
|
127
|
+
caption?: string;
|
|
128
|
+
}
|
|
129
|
+
export interface MediaInfoResponse {
|
|
130
|
+
url: string;
|
|
131
|
+
mime_type: string;
|
|
132
|
+
sha256: string;
|
|
133
|
+
file_size: number;
|
|
134
|
+
}
|
|
135
|
+
export interface CreateTemplateParams {
|
|
136
|
+
wabaId: string;
|
|
137
|
+
name: string;
|
|
138
|
+
category: "MARKETING" | "UTILITY" | "AUTHENTICATION";
|
|
139
|
+
language: string;
|
|
140
|
+
bodyText: string;
|
|
141
|
+
}
|
|
142
|
+
export interface BusinessProfileParams {
|
|
143
|
+
about?: string;
|
|
144
|
+
address?: string;
|
|
145
|
+
description?: string;
|
|
146
|
+
email?: string;
|
|
147
|
+
websites?: string[];
|
|
148
|
+
vertical?: WhatsAppBusinessVertical;
|
|
149
|
+
profile_picture_handle?: string;
|
|
150
|
+
}
|
|
151
|
+
export type WhatsAppBusinessVertical = "" | "UNDEFINED" | "OTHER" | "AUTO" | "BEAUTY" | "APPAREL" | "EDU" | "ENTERTAIN" | "EVENT_PLAN" | "FINANCE" | "GROCERY" | "GOVT" | "HOTEL" | "HEALTH" | "NONPROFIT" | "PROF_SERVICES" | "RETAIL" | "TRAVEL" | "RESTAURANT" | "NOT_A_BIZ";
|
|
152
|
+
export interface BusinessProfileResponse {
|
|
153
|
+
messaging_product: "whatsapp";
|
|
154
|
+
about: string;
|
|
155
|
+
address: string;
|
|
156
|
+
description: string;
|
|
157
|
+
email: string;
|
|
158
|
+
websites: string[];
|
|
159
|
+
vertical: WhatsAppBusinessVertical;
|
|
160
|
+
profile_picture_url?: string;
|
|
161
|
+
}
|
|
162
|
+
export interface UpdateDisplayNameParams {
|
|
163
|
+
new_display_name: string;
|
|
164
|
+
}
|
|
165
|
+
export interface DisplayNameStatusResponse {
|
|
166
|
+
verified_name: string;
|
|
167
|
+
name_status: string;
|
|
168
|
+
new_display_name?: string;
|
|
169
|
+
new_name_status?: string;
|
|
170
|
+
id: string;
|
|
171
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rempays/shared-core",
|
|
3
|
-
"version": "1.0.2-beta.
|
|
3
|
+
"version": "1.0.2-beta.14",
|
|
4
4
|
"description": "Core utilities layer for RemPays platform with AWS services integration (Cognito, S3, Secrets Manager, Textract, Facebook API, DynamoDB)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|