bkper-js 1.34.2 → 1.34.4

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.
package/lib/index.d.ts CHANGED
@@ -1483,6 +1483,7 @@ export declare class Conversation {
1483
1483
  */
1484
1484
  getMessages(): Promise<Message[]>;
1485
1485
 
1486
+
1486
1487
  /**
1487
1488
  * Performs create Conversation
1488
1489
  *
@@ -2023,6 +2024,11 @@ export declare class Message {
2023
2024
  * @returns The Agent associated with the Message, in any
2024
2025
  */
2025
2026
  getAgent(): Agent | undefined;
2027
+ /**
2028
+ *
2029
+ * @returns The Conversation of the Message
2030
+ */
2031
+ getConversation(): Conversation;
2026
2032
  /**
2027
2033
  *
2028
2034
  * @returns The User associated with the Message
@@ -97,6 +97,10 @@ export class Conversation {
97
97
  this.messagesMap.set(messageId, message);
98
98
  }
99
99
  }
100
+ /** @internal */
101
+ setUpdatedAt(updatedAtMs) {
102
+ this.payload.updatedAt = updatedAtMs;
103
+ }
100
104
  /**
101
105
  * Performs create Conversation
102
106
  *
@@ -42,6 +42,13 @@ export class Message {
42
42
  getAgent() {
43
43
  return this.payload.agent ? new Agent(this.payload.agent) : undefined;
44
44
  }
45
+ /**
46
+ *
47
+ * @returns The Conversation of the Message
48
+ */
49
+ getConversation() {
50
+ return this.conversation;
51
+ }
45
52
  /**
46
53
  *
47
54
  * @returns The User associated with the Message
@@ -157,6 +164,10 @@ export class Message {
157
164
  const responseMessage = new Message(this.conversation, responsePayload);
158
165
  this.conversation.updateMessagesCache(this);
159
166
  this.conversation.updateMessagesCache(responseMessage);
167
+ // Set conversation updatedAt
168
+ if (responsePayload.createdAt) {
169
+ this.conversation.setUpdatedAt(responsePayload.createdAt);
170
+ }
160
171
  return this;
161
172
  });
162
173
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bkper-js",
3
- "version": "1.34.2",
3
+ "version": "1.34.4",
4
4
  "description": "Javascript client for Bkper REST API",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",