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 +6 -0
- package/lib/model/Conversation.js +4 -0
- package/lib/model/Message.js +11 -0
- package/package.json +1 -1
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
|
package/lib/model/Message.js
CHANGED
|
@@ -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
|
}
|