@rempays/shared-core 1.0.2-beta.18 → 1.0.2-beta.19

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,4 +1,4 @@
1
- import type { SendTextParams, SendTemplateParams, SendInteractiveParams, SendInteractiveListParams, SendImageParams, SendDocumentParams, SendLocationParams, SetTypingParams, MarkAsReadParams, SendAudioParams, SendVideoParams, MediaInfoResponse, CreateTemplateParams, BusinessProfileResponse, UpdateDisplayNameParams, DisplayNameStatusResponse } from "./types";
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;
@@ -23,11 +23,7 @@ export declare class FacebookApi {
23
23
  static listTemplates(wabaId: string): Promise<any>;
24
24
  static createTemplate(params: CreateTemplateParams): Promise<any>;
25
25
  static deleteTemplate(wabaId: string, name: string): Promise<any>;
26
- /**
27
- * Updates the business profile picture using a direct URL.
28
- * @param url Public URL of the image
29
- */
30
- static updateProfilePicture(url: string): Promise<any>;
26
+ static updateBusinessProfile(params: BusinessProfileParams): Promise<any>;
31
27
  /**
32
28
  * Uploads media for chat (messages).
33
29
  * @param buffer Media binary data
@@ -304,22 +304,12 @@ class FacebookApi {
304
304
  });
305
305
  return data;
306
306
  }
307
- /*
308
- PROFILE PICTURE UPLOAD (TWO-STEP)
309
- */
310
- /**
311
- * Updates the business profile picture using a direct URL.
312
- * @param url Public URL of the image
313
- */
314
- static async updateProfilePicture(url) {
315
- await this.init();
316
- const http = (0, http_1.getHttpClient)(this.token);
317
- const urlEnv = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}/profile_picture`;
307
+ static async updateBusinessProfile(params) {
318
308
  const payload = {
319
- profile_picture_url: url,
309
+ messaging_product: "whatsapp",
310
+ ...params,
320
311
  };
321
- const { data } = await http.post(urlEnv, payload);
322
- return data;
312
+ return await this.post("whatsapp_business_profile", payload);
323
313
  }
324
314
  /*
325
315
  CHAT MEDIA UPLOAD
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rempays/shared-core",
3
- "version": "1.0.2-beta.18",
3
+ "version": "1.0.2-beta.19",
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",