@peopl-health/nexus 4.2.14 → 4.2.15

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.
@@ -144,7 +144,7 @@ class TwilioProvider extends MessageProvider {
144
144
  provider: 'twilio',
145
145
  status: result.status,
146
146
  result,
147
- finalize: { sid: chunks ? null : result.sid, status: result.status?.toLowerCase() || null }
147
+ finalize: { sid: chunks ? null : result.sid, status: result.status?.toLowerCase() || null, body: contentSid ? messageData.body : null }
148
148
  };
149
149
  }
150
150
 
@@ -267,7 +267,7 @@ class NexusMessaging {
267
267
  await this.messageStorage.finalizePendingMessage(parentId, result.finalize.sid, {
268
268
  status: result.finalize.status,
269
269
  updatedAt: new Date()
270
- });
270
+ }, { body: result.finalize.body });
271
271
  }
272
272
 
273
273
  if (this.messageStorage && !providerStores) {
@@ -57,11 +57,12 @@ class MongoStorage {
57
57
  return doc;
58
58
  }
59
59
 
60
- async finalizePendingMessage(docId, sid, statusInfo = null) {
60
+ async finalizePendingMessage(docId, sid, statusInfo = null, extras = null) {
61
61
  const set = {};
62
62
  if (statusInfo) {
63
63
  for (const [k, v] of Object.entries(statusInfo)) set[`statusInfo.${k}`] = v;
64
64
  }
65
+ if (extras?.body) set.body = extras.body;
65
66
  if (Object.keys(set).length) {
66
67
  await Message.updateOne({ _id: docId }, { $set: set });
67
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peopl-health/nexus",
3
- "version": "4.2.14",
3
+ "version": "4.2.15",
4
4
  "description": "Core messaging and assistant library for WhatsApp communication platforms",
5
5
  "keywords": [
6
6
  "whatsapp",