bkper-js 1.34.0 → 1.34.1
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 +2 -2
- package/lib/model/Message.js +8 -7
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -2087,9 +2087,9 @@ export declare class Message {
|
|
|
2087
2087
|
*/
|
|
2088
2088
|
deleteProperty(key: string): Message;
|
|
2089
2089
|
/**
|
|
2090
|
-
*
|
|
2090
|
+
* Creates the Message and receives the synchronous Agent response.
|
|
2091
2091
|
*
|
|
2092
|
-
* @returns The created Message
|
|
2092
|
+
* @returns The Agent response Message, with the created Message as its parent
|
|
2093
2093
|
*/
|
|
2094
2094
|
create(): Promise<Message>;
|
|
2095
2095
|
}
|
package/lib/model/Message.js
CHANGED
|
@@ -140,9 +140,9 @@ export class Message {
|
|
|
140
140
|
return this;
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
|
-
*
|
|
143
|
+
* Creates the Message and receives the synchronous Agent response.
|
|
144
144
|
*
|
|
145
|
-
* @returns The created Message
|
|
145
|
+
* @returns The Agent response Message, with the created Message as its parent
|
|
146
146
|
*/
|
|
147
147
|
create() {
|
|
148
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -150,12 +150,13 @@ export class Message {
|
|
|
150
150
|
if (!conversationId) {
|
|
151
151
|
throw new Error('Conversation id null!');
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
this.parent = new Message(this.conversation, this.payload.parent);
|
|
157
|
-
this.conversation.updateMessagesCache(this.parent);
|
|
153
|
+
const responsePayload = yield ConversationService.createMessage(conversationId, this.payload);
|
|
154
|
+
if (responsePayload.parent) {
|
|
155
|
+
this.payload = responsePayload.parent;
|
|
158
156
|
}
|
|
157
|
+
const responseMessage = new Message(this.conversation, responsePayload);
|
|
158
|
+
this.conversation.updateMessagesCache(this);
|
|
159
|
+
this.conversation.updateMessagesCache(responseMessage);
|
|
159
160
|
return this;
|
|
160
161
|
});
|
|
161
162
|
}
|