crisp-api 10.10.2 → 10.10.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/CHANGELOG.md +12 -0
- package/EXAMPLES.md +2 -0
- package/README.md +3 -1
- package/dist/crisp.js +1 -1
- package/dist/resources/WebsiteBase.d.ts +2 -0
- package/dist/resources/WebsiteConversation.d.ts +1 -1
- package/dist/resources/WebsiteConversation.js +9 -1
- package/lib/resources/WebsiteBase.ts +2 -0
- package/lib/resources/WebsiteConversation.ts +12 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.10.4
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* Added `timestampAfter` and `timestampAround` parameters on `CrispClient.website.getMessagesInConversation` method.
|
|
9
|
+
|
|
10
|
+
## v10.10.3
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
* Added types for new `verified` and `institutional` field on `Website` payload.
|
|
15
|
+
|
|
4
16
|
## v10.10.2
|
|
5
17
|
|
|
6
18
|
### Changes
|
package/EXAMPLES.md
CHANGED
|
@@ -122,6 +122,8 @@ https://docs.crisp.chat/references/rest-api/v1/#get-messages-in-conversation
|
|
|
122
122
|
|
|
123
123
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
124
124
|
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
125
|
+
|
|
126
|
+
// Either 'timestampBefore', 'timestampAfter' or 'timestampAround'
|
|
125
127
|
var timestampBefore = 1641206011000;
|
|
126
128
|
|
|
127
129
|
CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore);
|
package/README.md
CHANGED
|
@@ -356,13 +356,15 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
356
356
|
</details>
|
|
357
357
|
|
|
358
358
|
* **⭐ Get Messages In Conversation**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-messages-in-conversation)
|
|
359
|
-
* `CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore)`
|
|
359
|
+
* `CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore, timestampAfter, timestampAround)`
|
|
360
360
|
* <details>
|
|
361
361
|
<summary>See Example</summary>
|
|
362
362
|
|
|
363
363
|
```javascript
|
|
364
364
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
365
365
|
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
366
|
+
|
|
367
|
+
// Either 'timestampBefore', 'timestampAfter' or 'timestampAround'
|
|
366
368
|
var timestampBefore = 1641206011000;
|
|
367
369
|
|
|
368
370
|
CrispClient.website.getMessagesInConversation(websiteID, sessionID, timestampBefore);
|
package/dist/crisp.js
CHANGED
|
@@ -507,7 +507,7 @@ declare class WebsiteConversation extends BaseResource {
|
|
|
507
507
|
/**
|
|
508
508
|
* Get Messages In Conversation
|
|
509
509
|
*/
|
|
510
|
-
getMessagesInConversation(websiteID: string, sessionID: string, timestampBefore?: string | number): Promise<ConversationMessage[]>;
|
|
510
|
+
getMessagesInConversation(websiteID: string, sessionID: string, timestampBefore?: string | number, timestampAfter?: string | number, timestampAround?: string | number): Promise<ConversationMessage[]>;
|
|
511
511
|
/**
|
|
512
512
|
* Send A Message In Conversation
|
|
513
513
|
*/
|
|
@@ -146,13 +146,21 @@ class WebsiteConversation extends BaseResource_1.default {
|
|
|
146
146
|
/**
|
|
147
147
|
* Get Messages In Conversation
|
|
148
148
|
*/
|
|
149
|
-
getMessagesInConversation(websiteID, sessionID, timestampBefore) {
|
|
149
|
+
getMessagesInConversation(websiteID, sessionID, timestampBefore, timestampAfter, timestampAround) {
|
|
150
150
|
// Generate query
|
|
151
151
|
let query = {};
|
|
152
152
|
if (timestampBefore) {
|
|
153
153
|
// @ts-ignore
|
|
154
154
|
query.timestamp_before = String(timestampBefore);
|
|
155
155
|
}
|
|
156
|
+
if (timestampAfter) {
|
|
157
|
+
// @ts-ignore
|
|
158
|
+
query.timestamp_after = String(timestampAfter);
|
|
159
|
+
}
|
|
160
|
+
if (timestampAround) {
|
|
161
|
+
// @ts-ignore
|
|
162
|
+
query.timestamp_around = String(timestampAround);
|
|
163
|
+
}
|
|
156
164
|
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
157
165
|
"website", websiteID, "conversation", sessionID, "messages"
|
|
158
166
|
]), query);
|
|
@@ -759,7 +759,8 @@ class WebsiteConversation extends BaseResource {
|
|
|
759
759
|
* Get Messages In Conversation
|
|
760
760
|
*/
|
|
761
761
|
getMessagesInConversation(
|
|
762
|
-
websiteID: string, sessionID: string, timestampBefore?: string|number
|
|
762
|
+
websiteID: string, sessionID: string, timestampBefore?: string|number,
|
|
763
|
+
timestampAfter?: string|number, timestampAround?: string|number
|
|
763
764
|
): Promise<ConversationMessage[]> {
|
|
764
765
|
// Generate query
|
|
765
766
|
let query = {};
|
|
@@ -769,6 +770,16 @@ class WebsiteConversation extends BaseResource {
|
|
|
769
770
|
query.timestamp_before = String(timestampBefore);
|
|
770
771
|
}
|
|
771
772
|
|
|
773
|
+
if (timestampAfter) {
|
|
774
|
+
// @ts-ignore
|
|
775
|
+
query.timestamp_after = String(timestampAfter);
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
if (timestampAround) {
|
|
779
|
+
// @ts-ignore
|
|
780
|
+
query.timestamp_around = String(timestampAround);
|
|
781
|
+
}
|
|
782
|
+
|
|
772
783
|
return this.crisp.get(
|
|
773
784
|
this.crisp.prepareRestUrl([
|
|
774
785
|
"website", websiteID, "conversation", sessionID, "messages"
|
package/package.json
CHANGED