bkper-js 1.34.1 → 1.34.3
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 +1 -0
- package/lib/model/Conversation.js +6 -2
- package/lib/model/Message.js +5 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -54,14 +54,14 @@ export class Conversation {
|
|
|
54
54
|
* @returns The Date the Conversation was created
|
|
55
55
|
*/
|
|
56
56
|
getCreatedAt() {
|
|
57
|
-
return this.payload.createdAt ? new Date(this.payload.createdAt) : undefined;
|
|
57
|
+
return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
61
61
|
* @returns The Date the Conversation was last updated
|
|
62
62
|
*/
|
|
63
63
|
getUpdatedAt() {
|
|
64
|
-
return this.payload.updatedAt ? new Date(this.payload.updatedAt) : undefined;
|
|
64
|
+
return this.payload.updatedAt ? new Date(new Number(this.payload.updatedAt).valueOf()) : undefined;
|
|
65
65
|
}
|
|
66
66
|
/**
|
|
67
67
|
* Gets the Messages that compose this Conversation
|
|
@@ -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
|
*
|
package/lib/model/Message.js
CHANGED
|
@@ -54,7 +54,7 @@ export class Message {
|
|
|
54
54
|
* @returns The Date the Message was created
|
|
55
55
|
*/
|
|
56
56
|
getCreatedAt() {
|
|
57
|
-
return this.payload.createdAt ? new Date(this.payload.createdAt) : undefined;
|
|
57
|
+
return this.payload.createdAt ? new Date(new Number(this.payload.createdAt).valueOf()) : undefined;
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
@@ -157,6 +157,10 @@ export class Message {
|
|
|
157
157
|
const responseMessage = new Message(this.conversation, responsePayload);
|
|
158
158
|
this.conversation.updateMessagesCache(this);
|
|
159
159
|
this.conversation.updateMessagesCache(responseMessage);
|
|
160
|
+
// Set conversation updatedAt
|
|
161
|
+
if (responsePayload.createdAt) {
|
|
162
|
+
this.conversation.setUpdatedAt(responsePayload.createdAt);
|
|
163
|
+
}
|
|
160
164
|
return this;
|
|
161
165
|
});
|
|
162
166
|
}
|