crisp-api 8.4.0 → 8.5.0
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 +39 -7
- package/README.md +48 -10
- package/lib/crisp.js +1 -0
- package/lib/resources/WebsiteBatch.js +9 -21
- package/lib/resources/WebsiteConversation.js +24 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v8.5.0
|
|
5
|
+
|
|
6
|
+
### Breaking Changes
|
|
7
|
+
|
|
8
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchResolveConversations` method.
|
|
9
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchReadConversations` method.
|
|
10
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchRemoveConversations` method.
|
|
11
|
+
|
|
12
|
+
### New Features
|
|
13
|
+
|
|
14
|
+
* Added the new `CrispClient.website.updateConversationInbox` method.
|
|
15
|
+
|
|
4
16
|
## v8.4.0
|
|
5
17
|
|
|
6
18
|
### New Features
|
package/EXAMPLES.md
CHANGED
|
@@ -230,6 +230,16 @@ CrispClient.website.assignConversationRouting(websiteID, sessionID, assign);
|
|
|
230
230
|
|
|
231
231
|
=========================
|
|
232
232
|
|
|
233
|
+
https://docs.crisp.chat/references/rest-api/v1/#update-conversation-inbox
|
|
234
|
+
|
|
235
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
236
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
237
|
+
var inboxID = "bf6935c9-43b3-4f8e-87ea-175c1e1ed1a9";
|
|
238
|
+
|
|
239
|
+
CrispClient.website.updateConversationInbox(websiteID, sessionID, inboxID);
|
|
240
|
+
|
|
241
|
+
=========================
|
|
242
|
+
|
|
233
243
|
https://docs.crisp.chat/references/rest-api/v1/#get-conversation-metas
|
|
234
244
|
|
|
235
245
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
@@ -1829,7 +1839,16 @@ https://docs.crisp.chat/references/rest-api/v1/#batch-resolve-items
|
|
|
1829
1839
|
|
|
1830
1840
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1831
1841
|
|
|
1832
|
-
|
|
1842
|
+
var operation = {
|
|
1843
|
+
"inbox_id": null,
|
|
1844
|
+
|
|
1845
|
+
"sessions": [
|
|
1846
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1847
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1848
|
+
]
|
|
1849
|
+
};
|
|
1850
|
+
|
|
1851
|
+
CrispClient.website.batchResolveConversations(websiteID, operation);
|
|
1833
1852
|
|
|
1834
1853
|
=========================
|
|
1835
1854
|
|
|
@@ -1837,7 +1856,16 @@ https://docs.crisp.chat/references/rest-api/v1/#batch-read-items
|
|
|
1837
1856
|
|
|
1838
1857
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1839
1858
|
|
|
1840
|
-
|
|
1859
|
+
var operation = {
|
|
1860
|
+
"inbox_id": null,
|
|
1861
|
+
|
|
1862
|
+
"sessions": [
|
|
1863
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1864
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1865
|
+
]
|
|
1866
|
+
};
|
|
1867
|
+
|
|
1868
|
+
CrispClient.website.batchReadConversations(websiteID, operation);
|
|
1841
1869
|
|
|
1842
1870
|
=========================
|
|
1843
1871
|
|
|
@@ -1845,12 +1873,16 @@ https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items
|
|
|
1845
1873
|
|
|
1846
1874
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1847
1875
|
|
|
1848
|
-
var
|
|
1849
|
-
"
|
|
1850
|
-
|
|
1851
|
-
|
|
1876
|
+
var operation = {
|
|
1877
|
+
"inbox_id": null,
|
|
1878
|
+
|
|
1879
|
+
"sessions": [
|
|
1880
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1881
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1882
|
+
]
|
|
1883
|
+
};
|
|
1852
1884
|
|
|
1853
|
-
CrispClient.website.batchRemoveConversations(websiteID,
|
|
1885
|
+
CrispClient.website.batchRemoveConversations(websiteID, operation);
|
|
1854
1886
|
|
|
1855
1887
|
=========================
|
|
1856
1888
|
|
package/README.md
CHANGED
|
@@ -485,6 +485,20 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
485
485
|
```
|
|
486
486
|
</details>
|
|
487
487
|
|
|
488
|
+
* **Update Conversation Inbox** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-conversation-inbox)
|
|
489
|
+
* `CrispClient.website.updateConversationInbox(websiteID, sessionID, inboxID)`
|
|
490
|
+
* <details>
|
|
491
|
+
<summary>See Example</summary>
|
|
492
|
+
|
|
493
|
+
```javascript
|
|
494
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
495
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
496
|
+
var inboxID = "bf6935c9-43b3-4f8e-87ea-175c1e1ed1a9";
|
|
497
|
+
|
|
498
|
+
CrispClient.website.updateConversationInbox(websiteID, sessionID, inboxID);
|
|
499
|
+
```
|
|
500
|
+
</details>
|
|
501
|
+
|
|
488
502
|
* **⭐ Get Conversation Metas** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-metas)
|
|
489
503
|
* `CrispClient.website.getConversationMetas(websiteID, sessionID)`
|
|
490
504
|
* <details>
|
|
@@ -2632,43 +2646,65 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2632
2646
|
|
|
2633
2647
|
* #### **Website Batch**
|
|
2634
2648
|
* **Batch Resolve Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-resolve-items)
|
|
2635
|
-
* `CrispClient.website.batchResolveConversations(websiteID,
|
|
2649
|
+
* `CrispClient.website.batchResolveConversations(websiteID, operation)`
|
|
2636
2650
|
* <details>
|
|
2637
2651
|
<summary>See Example</summary>
|
|
2638
2652
|
|
|
2639
2653
|
```javascript
|
|
2640
2654
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2641
2655
|
|
|
2642
|
-
|
|
2656
|
+
var operation = {
|
|
2657
|
+
"inbox_id": null,
|
|
2658
|
+
|
|
2659
|
+
"sessions": [
|
|
2660
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2661
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2662
|
+
]
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
CrispClient.website.batchResolveConversations(websiteID, operation);
|
|
2643
2666
|
```
|
|
2644
2667
|
</details>
|
|
2645
2668
|
|
|
2646
2669
|
* **Batch Read Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-read-items)
|
|
2647
|
-
* `CrispClient.website.batchReadConversations(websiteID,
|
|
2670
|
+
* `CrispClient.website.batchReadConversations(websiteID, operation)`
|
|
2648
2671
|
* <details>
|
|
2649
2672
|
<summary>See Example</summary>
|
|
2650
2673
|
|
|
2651
2674
|
```javascript
|
|
2652
2675
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2653
2676
|
|
|
2654
|
-
|
|
2677
|
+
var operation = {
|
|
2678
|
+
"inbox_id": null,
|
|
2679
|
+
|
|
2680
|
+
"sessions": [
|
|
2681
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2682
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2683
|
+
]
|
|
2684
|
+
};
|
|
2685
|
+
|
|
2686
|
+
CrispClient.website.batchReadConversations(websiteID, operation);
|
|
2655
2687
|
```
|
|
2656
2688
|
</details>
|
|
2657
2689
|
|
|
2658
2690
|
* **Batch Remove Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items)
|
|
2659
|
-
* `CrispClient.website.batchRemoveConversations(websiteID,
|
|
2691
|
+
* `CrispClient.website.batchRemoveConversations(websiteID, operation)`
|
|
2660
2692
|
* <details>
|
|
2661
2693
|
<summary>See Example</summary>
|
|
2662
2694
|
|
|
2663
2695
|
```javascript
|
|
2664
2696
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2665
2697
|
|
|
2666
|
-
var
|
|
2667
|
-
"
|
|
2668
|
-
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2669
|
-
];
|
|
2698
|
+
var operation = {
|
|
2699
|
+
"inbox_id": null,
|
|
2670
2700
|
|
|
2671
|
-
|
|
2701
|
+
"sessions": [
|
|
2702
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2703
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2704
|
+
]
|
|
2705
|
+
};
|
|
2706
|
+
|
|
2707
|
+
CrispClient.website.batchRemoveConversations(websiteID, operation);
|
|
2672
2708
|
```
|
|
2673
2709
|
</details>
|
|
2674
2710
|
|
|
@@ -3440,6 +3476,8 @@ Available events are listed below:
|
|
|
3440
3476
|
* `session:set_mentions`
|
|
3441
3477
|
* **Session Set Routing** [`user`, `plugin`]:
|
|
3442
3478
|
* `session:set_routing`
|
|
3479
|
+
* **Session Set Inbox** [`user`, `plugin`]:
|
|
3480
|
+
* `session:set_inbox`
|
|
3443
3481
|
* **Session Removed** [`user`, `plugin`]:
|
|
3444
3482
|
* `session:removed`
|
|
3445
3483
|
|
package/lib/crisp.js
CHANGED
|
@@ -21,18 +21,14 @@ function WebsiteBatch(service, crisp) {
|
|
|
21
21
|
* @public
|
|
22
22
|
* @method batchResolveConversations
|
|
23
23
|
* @param {string} websiteID
|
|
24
|
-
* @param {object}
|
|
24
|
+
* @param {object} operation
|
|
25
25
|
* @return {Promise}
|
|
26
26
|
*/
|
|
27
|
-
service.batchResolveConversations = function(websiteID,
|
|
27
|
+
service.batchResolveConversations = function(websiteID, operation) {
|
|
28
28
|
return crisp.patch(
|
|
29
29
|
crisp._prepareRestUrl(["website", websiteID, "batch", "resolve"]),
|
|
30
30
|
|
|
31
|
-
null,
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
sessions : sessions
|
|
35
|
-
}
|
|
31
|
+
null, operation
|
|
36
32
|
);
|
|
37
33
|
};
|
|
38
34
|
|
|
@@ -42,18 +38,14 @@ function WebsiteBatch(service, crisp) {
|
|
|
42
38
|
* @public
|
|
43
39
|
* @method batchReadConversations
|
|
44
40
|
* @param {string} websiteID
|
|
45
|
-
* @param {object}
|
|
41
|
+
* @param {object} operation
|
|
46
42
|
* @return {Promise}
|
|
47
43
|
*/
|
|
48
|
-
service.batchReadConversations = function(websiteID,
|
|
44
|
+
service.batchReadConversations = function(websiteID, operation) {
|
|
49
45
|
return crisp.patch(
|
|
50
46
|
crisp._prepareRestUrl(["website", websiteID, "batch", "read"]),
|
|
51
47
|
|
|
52
|
-
null,
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
sessions : sessions
|
|
56
|
-
}
|
|
48
|
+
null, operation
|
|
57
49
|
);
|
|
58
50
|
};
|
|
59
51
|
|
|
@@ -63,18 +55,14 @@ function WebsiteBatch(service, crisp) {
|
|
|
63
55
|
* @public
|
|
64
56
|
* @method batchRemoveConversations
|
|
65
57
|
* @param {string} websiteID
|
|
66
|
-
* @param {object}
|
|
58
|
+
* @param {object} operation
|
|
67
59
|
* @return {Promise}
|
|
68
60
|
*/
|
|
69
|
-
service.batchRemoveConversations = function(websiteID,
|
|
61
|
+
service.batchRemoveConversations = function(websiteID, operation) {
|
|
70
62
|
return crisp.patch(
|
|
71
63
|
crisp._prepareRestUrl(["website", websiteID, "batch", "remove"]),
|
|
72
64
|
|
|
73
|
-
null,
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
sessions : sessions
|
|
77
|
-
}
|
|
65
|
+
null, operation
|
|
78
66
|
);
|
|
79
67
|
};
|
|
80
68
|
|
|
@@ -431,6 +431,30 @@ function WebsiteConversation(service, crisp) {
|
|
|
431
431
|
);
|
|
432
432
|
};
|
|
433
433
|
|
|
434
|
+
/**
|
|
435
|
+
* Update Conversation Inbox
|
|
436
|
+
* @memberof WebsiteConversation
|
|
437
|
+
* @public
|
|
438
|
+
* @method updateConversationInbox
|
|
439
|
+
* @param {string} websiteID
|
|
440
|
+
* @param {string} sessionID
|
|
441
|
+
* @param {string} inboxID
|
|
442
|
+
* @return {Promise}
|
|
443
|
+
*/
|
|
444
|
+
service.updateConversationInbox = function(websiteID, sessionID, inboxID) {
|
|
445
|
+
return crisp.patch(
|
|
446
|
+
crisp._prepareRestUrl([
|
|
447
|
+
"website", websiteID, "conversation", sessionID, "inbox"
|
|
448
|
+
]),
|
|
449
|
+
|
|
450
|
+
null,
|
|
451
|
+
|
|
452
|
+
{
|
|
453
|
+
inbox_id : inboxID
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
};
|
|
457
|
+
|
|
434
458
|
/**
|
|
435
459
|
* Get Conversation Metas
|
|
436
460
|
* @memberof WebsiteConversation
|
package/package.json
CHANGED