@rempays/shared-core 1.0.2-beta.14 → 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.
@@ -24,7 +24,7 @@ class DynamoDBClientWrapper {
24
24
  ExpressionAttributeNames: options.expressionAttributeNames,
25
25
  }),
26
26
  ...(options?.expressionAttributeValues && {
27
- ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues),
27
+ ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues, { removeUndefinedValues: true }),
28
28
  }),
29
29
  });
30
30
  await this.client.send(command);
@@ -58,7 +58,7 @@ class DynamoDBClientWrapper {
58
58
  ExpressionAttributeNames: options.expressionAttributeNames,
59
59
  }),
60
60
  ...(options.expressionAttributeValues && {
61
- ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues),
61
+ ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues, { removeUndefinedValues: true }),
62
62
  }),
63
63
  ReturnValues: 'ALL_NEW',
64
64
  });
@@ -90,7 +90,7 @@ class DynamoDBClientWrapper {
90
90
  ExpressionAttributeNames: options.expressionAttributeNames,
91
91
  }),
92
92
  ...(options.expressionAttributeValues && {
93
- ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues),
93
+ ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(options.expressionAttributeValues, { removeUndefinedValues: true }),
94
94
  }),
95
95
  ...(options.limit && { Limit: options.limit }),
96
96
  ...(options.scanIndexForward !== undefined && {
@@ -27,7 +27,7 @@ class ChatService {
27
27
  };
28
28
  await this.client.send(new client_dynamodb_1.PutItemCommand({
29
29
  TableName: this.tableName,
30
- Item: (0, util_dynamodb_1.marshall)(item),
30
+ Item: (0, util_dynamodb_1.marshall)(item, { removeUndefinedValues: true }),
31
31
  }));
32
32
  return newChat;
33
33
  }
@@ -86,7 +86,7 @@ class ChatService {
86
86
  }),
87
87
  UpdateExpression: `SET ${updateExpressions.join(', ')}`,
88
88
  ExpressionAttributeNames: expressionAttributeNames,
89
- ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(expressionAttributeValues),
89
+ ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(expressionAttributeValues, { removeUndefinedValues: true }),
90
90
  }));
91
91
  return this.getChat(chatId);
92
92
  }
@@ -140,7 +140,7 @@ class ChatService {
140
140
  };
141
141
  await this.client.send(new client_dynamodb_1.PutItemCommand({
142
142
  TableName: this.tableName,
143
- Item: (0, util_dynamodb_1.marshall)(item),
143
+ Item: (0, util_dynamodb_1.marshall)(item, { removeUndefinedValues: true }),
144
144
  }));
145
145
  // Actualizar metadata del chat
146
146
  const chat = await this.getChat(chatId);
@@ -27,7 +27,7 @@ class SystemPromptService {
27
27
  };
28
28
  await this.client.send(new client_dynamodb_1.PutItemCommand({
29
29
  TableName: this.tableName,
30
- Item: (0, util_dynamodb_1.marshall)(item),
30
+ Item: (0, util_dynamodb_1.marshall)(item, { removeUndefinedValues: true }),
31
31
  }));
32
32
  return newPrompt;
33
33
  }
@@ -133,7 +133,7 @@ class SystemPromptService {
133
133
  }),
134
134
  UpdateExpression: `SET ${updateExpressions.join(', ')}`,
135
135
  ExpressionAttributeNames: expressionAttributeNames,
136
- ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(expressionAttributeValues),
136
+ ExpressionAttributeValues: (0, util_dynamodb_1.marshall)(expressionAttributeValues, { removeUndefinedValues: true }),
137
137
  }));
138
138
  return this.getPrompt(templateCode, version);
139
139
  }
@@ -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.14",
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",