@rempays/shared-core 1.0.2-beta.15 → 1.0.2-beta.16

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.
@@ -38,7 +38,9 @@ export declare class FacebookApi {
38
38
  static uploadMedia(buffer: Buffer, mimeType: string): Promise<{
39
39
  id: string;
40
40
  }>;
41
- static getBusinessProfile(): Promise<BusinessProfileResponse>;
41
+ static getBusinessProfile(): Promise<{
42
+ data: BusinessProfileResponse[];
43
+ }>;
42
44
  static updateBusinessProfile(params: BusinessProfileParams): Promise<any>;
43
45
  static updateDisplayName(params: UpdateDisplayNameParams): Promise<any>;
44
46
  static getDisplayNameStatus(): Promise<DisplayNameStatusResponse>;
@@ -371,14 +371,12 @@ class FacebookApi {
371
371
  static async getBusinessProfile() {
372
372
  await this.init();
373
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;
374
+ // Fields requested directly in URL to ensure they are always sent
375
+ const fields = "about,address,description,email,profile_picture_url,websites,vertical";
376
+ const url = `https://graph.facebook.com/${this.apiVersion}/${this.phoneNumberId}/whatsapp_business_profile?fields=${fields}`;
377
+ const { data } = await http.get(url);
378
+ // Returning the full structure { data: [ ... ] } as requested
379
+ return data;
382
380
  }
383
381
  static async updateBusinessProfile(params) {
384
382
  const payload = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rempays/shared-core",
3
- "version": "1.0.2-beta.15",
3
+ "version": "1.0.2-beta.16",
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",