crisp-api 8.4.0 → 9.0.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 +24 -0
- package/EXAMPLES.md +39 -25
- package/README.md +52 -40
- package/lib/crisp.js +1 -0
- package/lib/resources/WebsiteAnalytics.js +7 -83
- 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,30 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v9.0.0
|
|
5
|
+
|
|
6
|
+
### Breaking Changes
|
|
7
|
+
|
|
8
|
+
* ⚠️ Removed the `CrispClient.website.acquireAnalyticsPoints` method (API route has been removed).
|
|
9
|
+
* ⚠️ Removed the `CrispClient.website.listAnalyticsFilters` method (API route has been removed).
|
|
10
|
+
* ⚠️ Removed the `CrispClient.website.listAnalyticsClassifiers` method (API route has been removed).
|
|
11
|
+
|
|
12
|
+
### New Features
|
|
13
|
+
|
|
14
|
+
* Added the new `CrispClient.website.generateAnalytics` method.
|
|
15
|
+
|
|
16
|
+
## v8.5.0
|
|
17
|
+
|
|
18
|
+
### Breaking Changes
|
|
19
|
+
|
|
20
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchResolveConversations` method.
|
|
21
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchReadConversations` method.
|
|
22
|
+
* ⚠️ Changed the argument of the `CrispClient.website.batchRemoveConversations` method.
|
|
23
|
+
|
|
24
|
+
### New Features
|
|
25
|
+
|
|
26
|
+
* Added the new `CrispClient.website.updateConversationInbox` method.
|
|
27
|
+
|
|
4
28
|
## v8.4.0
|
|
5
29
|
|
|
6
30
|
### 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";
|
|
@@ -1799,45 +1809,45 @@ CrispClient.website.listWebsiteOperatorAvailabilities(websiteID);
|
|
|
1799
1809
|
|
|
1800
1810
|
=========================
|
|
1801
1811
|
|
|
1802
|
-
https://docs.crisp.chat/references/rest-api/v1/#
|
|
1812
|
+
https://docs.crisp.chat/references/rest-api/v1/#generate-analytics
|
|
1803
1813
|
|
|
1804
1814
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1805
1815
|
|
|
1806
|
-
CrispClient.website.
|
|
1816
|
+
CrispClient.website.generateAnalytics(websiteID, query);
|
|
1807
1817
|
|
|
1808
1818
|
=========================
|
|
1809
1819
|
|
|
1810
|
-
https://docs.crisp.chat/references/rest-api/v1/#
|
|
1820
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-resolve-items
|
|
1811
1821
|
|
|
1812
1822
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1813
|
-
var pageNumber = 1;
|
|
1814
|
-
|
|
1815
|
-
CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
1816
|
-
|
|
1817
|
-
=========================
|
|
1818
1823
|
|
|
1819
|
-
|
|
1824
|
+
var operation = {
|
|
1825
|
+
"inbox_id": null,
|
|
1820
1826
|
|
|
1821
|
-
|
|
1822
|
-
|
|
1827
|
+
"sessions": [
|
|
1828
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1829
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1830
|
+
]
|
|
1831
|
+
};
|
|
1823
1832
|
|
|
1824
|
-
CrispClient.website.
|
|
1833
|
+
CrispClient.website.batchResolveConversations(websiteID, operation);
|
|
1825
1834
|
|
|
1826
1835
|
=========================
|
|
1827
1836
|
|
|
1828
|
-
https://docs.crisp.chat/references/rest-api/v1/#batch-
|
|
1837
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-read-items
|
|
1829
1838
|
|
|
1830
1839
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1831
1840
|
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
=========================
|
|
1835
|
-
|
|
1836
|
-
https://docs.crisp.chat/references/rest-api/v1/#batch-read-items
|
|
1841
|
+
var operation = {
|
|
1842
|
+
"inbox_id": null,
|
|
1837
1843
|
|
|
1838
|
-
|
|
1844
|
+
"sessions": [
|
|
1845
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1846
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1847
|
+
]
|
|
1848
|
+
};
|
|
1839
1849
|
|
|
1840
|
-
CrispClient.website.batchReadConversations(websiteID,
|
|
1850
|
+
CrispClient.website.batchReadConversations(websiteID, operation);
|
|
1841
1851
|
|
|
1842
1852
|
=========================
|
|
1843
1853
|
|
|
@@ -1845,12 +1855,16 @@ https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items
|
|
|
1845
1855
|
|
|
1846
1856
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1847
1857
|
|
|
1848
|
-
var
|
|
1849
|
-
"
|
|
1850
|
-
|
|
1851
|
-
|
|
1858
|
+
var operation = {
|
|
1859
|
+
"inbox_id": null,
|
|
1860
|
+
|
|
1861
|
+
"sessions": [
|
|
1862
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1863
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
1864
|
+
]
|
|
1865
|
+
};
|
|
1852
1866
|
|
|
1853
|
-
CrispClient.website.batchRemoveConversations(websiteID,
|
|
1867
|
+
CrispClient.website.batchRemoveConversations(websiteID, operation);
|
|
1854
1868
|
|
|
1855
1869
|
=========================
|
|
1856
1870
|
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, ac
|
|
|
6
6
|
|
|
7
7
|
Copyright 2023 Crisp IM SAS. See LICENSE for copying information.
|
|
8
8
|
|
|
9
|
-
* **📝 Implements**: [REST API Reference (V1)](https://docs.crisp.chat/references/rest-api/v1/) at revision:
|
|
9
|
+
* **📝 Implements**: [REST API Reference (V1)](https://docs.crisp.chat/references/rest-api/v1/) at revision: 27/08/2024
|
|
10
10
|
* **😘 Maintainers**: [@baptistejamin](https://github.com/baptistejamin), [@eliottvincent](https://github.com/eliottvincent), [@valeriansaliou](https://github.com/valeriansaliou)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
@@ -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>
|
|
@@ -2591,84 +2605,80 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2591
2605
|
|
|
2592
2606
|
|
|
2593
2607
|
* #### **Website Analytics**
|
|
2594
|
-
* **
|
|
2595
|
-
* `CrispClient.website.
|
|
2596
|
-
* <details>
|
|
2597
|
-
<summary>See Example</summary>
|
|
2598
|
-
|
|
2599
|
-
```javascript
|
|
2600
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2601
|
-
|
|
2602
|
-
CrispClient.website.acquireAnalyticsPoints(websiteID, pointType, pointMetric, dateFrom, dateTo, dateSplit, classifier, filterPrimary, filterSecondary, filterTertiary);
|
|
2603
|
-
```
|
|
2604
|
-
</details>
|
|
2605
|
-
|
|
2606
|
-
* **List Analytics Filters** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-analytics-filters)
|
|
2607
|
-
* `CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)`
|
|
2608
|
-
* <details>
|
|
2609
|
-
<summary>See Example</summary>
|
|
2610
|
-
|
|
2611
|
-
```javascript
|
|
2612
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2613
|
-
var pageNumber = 1;
|
|
2614
|
-
|
|
2615
|
-
CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
2616
|
-
```
|
|
2617
|
-
</details>
|
|
2618
|
-
|
|
2619
|
-
* **List Analytics Classifiers** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-analytics-classifiers)
|
|
2620
|
-
* `CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)`
|
|
2608
|
+
* **Generate Analytics** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#generate-analytics)
|
|
2609
|
+
* `CrispClient.website.generateAnalytics(websiteID, query)`
|
|
2621
2610
|
* <details>
|
|
2622
2611
|
<summary>See Example</summary>
|
|
2623
2612
|
|
|
2624
2613
|
```javascript
|
|
2625
2614
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2626
|
-
var pageNumber = 1;
|
|
2627
2615
|
|
|
2628
|
-
CrispClient.website.
|
|
2616
|
+
CrispClient.website.generateAnalytics(websiteID, query);
|
|
2629
2617
|
```
|
|
2630
2618
|
</details>
|
|
2631
2619
|
|
|
2632
2620
|
|
|
2633
2621
|
* #### **Website Batch**
|
|
2634
2622
|
* **Batch Resolve Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-resolve-items)
|
|
2635
|
-
* `CrispClient.website.batchResolveConversations(websiteID,
|
|
2623
|
+
* `CrispClient.website.batchResolveConversations(websiteID, operation)`
|
|
2636
2624
|
* <details>
|
|
2637
2625
|
<summary>See Example</summary>
|
|
2638
2626
|
|
|
2639
2627
|
```javascript
|
|
2640
2628
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2641
2629
|
|
|
2642
|
-
|
|
2630
|
+
var operation = {
|
|
2631
|
+
"inbox_id": null,
|
|
2632
|
+
|
|
2633
|
+
"sessions": [
|
|
2634
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2635
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2636
|
+
]
|
|
2637
|
+
};
|
|
2638
|
+
|
|
2639
|
+
CrispClient.website.batchResolveConversations(websiteID, operation);
|
|
2643
2640
|
```
|
|
2644
2641
|
</details>
|
|
2645
2642
|
|
|
2646
2643
|
* **Batch Read Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-read-items)
|
|
2647
|
-
* `CrispClient.website.batchReadConversations(websiteID,
|
|
2644
|
+
* `CrispClient.website.batchReadConversations(websiteID, operation)`
|
|
2648
2645
|
* <details>
|
|
2649
2646
|
<summary>See Example</summary>
|
|
2650
2647
|
|
|
2651
2648
|
```javascript
|
|
2652
2649
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2653
2650
|
|
|
2654
|
-
|
|
2651
|
+
var operation = {
|
|
2652
|
+
"inbox_id": null,
|
|
2653
|
+
|
|
2654
|
+
"sessions": [
|
|
2655
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2656
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2657
|
+
]
|
|
2658
|
+
};
|
|
2659
|
+
|
|
2660
|
+
CrispClient.website.batchReadConversations(websiteID, operation);
|
|
2655
2661
|
```
|
|
2656
2662
|
</details>
|
|
2657
2663
|
|
|
2658
2664
|
* **Batch Remove Conversations** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items)
|
|
2659
|
-
* `CrispClient.website.batchRemoveConversations(websiteID,
|
|
2665
|
+
* `CrispClient.website.batchRemoveConversations(websiteID, operation)`
|
|
2660
2666
|
* <details>
|
|
2661
2667
|
<summary>See Example</summary>
|
|
2662
2668
|
|
|
2663
2669
|
```javascript
|
|
2664
2670
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2665
2671
|
|
|
2666
|
-
var
|
|
2667
|
-
"
|
|
2668
|
-
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2669
|
-
];
|
|
2672
|
+
var operation = {
|
|
2673
|
+
"inbox_id": null,
|
|
2670
2674
|
|
|
2671
|
-
|
|
2675
|
+
"sessions": [
|
|
2676
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2677
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2678
|
+
]
|
|
2679
|
+
};
|
|
2680
|
+
|
|
2681
|
+
CrispClient.website.batchRemoveConversations(websiteID, operation);
|
|
2672
2682
|
```
|
|
2673
2683
|
</details>
|
|
2674
2684
|
|
|
@@ -3440,6 +3450,8 @@ Available events are listed below:
|
|
|
3440
3450
|
* `session:set_mentions`
|
|
3441
3451
|
* **Session Set Routing** [`user`, `plugin`]:
|
|
3442
3452
|
* `session:set_routing`
|
|
3453
|
+
* **Session Set Inbox** [`user`, `plugin`]:
|
|
3454
|
+
* `session:set_inbox`
|
|
3443
3455
|
* **Session Removed** [`user`, `plugin`]:
|
|
3444
3456
|
* `session:removed`
|
|
3445
3457
|
|
package/lib/crisp.js
CHANGED
|
@@ -16,95 +16,19 @@
|
|
|
16
16
|
*/
|
|
17
17
|
function WebsiteAnalytics(service, crisp) {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Generate Analytics
|
|
20
20
|
* @memberof WebsiteAnalytics
|
|
21
21
|
* @public
|
|
22
|
-
* @method
|
|
22
|
+
* @method generateAnalytics
|
|
23
23
|
* @param {string} websiteID
|
|
24
|
-
* @param {
|
|
25
|
-
* @param {string} pointMetric
|
|
26
|
-
* @param {string} dateFrom
|
|
27
|
-
* @param {string} dateTo
|
|
28
|
-
* @param {string} dateSplit
|
|
29
|
-
* @param {string} classifier
|
|
30
|
-
* @param {string} filterSecondary
|
|
31
|
-
* @param {string} filterTertiary
|
|
24
|
+
* @param {object} query
|
|
32
25
|
* @return {Promise}
|
|
33
26
|
*/
|
|
34
|
-
service.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
) {
|
|
38
|
-
return crisp.get(
|
|
39
|
-
crisp._prepareRestUrl([
|
|
40
|
-
"website", websiteID, "analytics", pointType, pointMetric, "points"
|
|
41
|
-
]),
|
|
27
|
+
service.generateAnalytics = function(websiteID, query) {
|
|
28
|
+
return crisp.post(
|
|
29
|
+
crisp._prepareRestUrl(["website", websiteID, "analytics", "generate"]),
|
|
42
30
|
|
|
43
|
-
|
|
44
|
-
date_from : dateFrom,
|
|
45
|
-
date_to : dateTo,
|
|
46
|
-
date_split : dateSplit,
|
|
47
|
-
classifier : classifier,
|
|
48
|
-
filter_primary : filterPrimary,
|
|
49
|
-
filter_secondary : filterSecondary,
|
|
50
|
-
filter_tertiary : filterTertiary
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* List Analytics Filters
|
|
57
|
-
* @memberof WebsiteAnalytics
|
|
58
|
-
* @public
|
|
59
|
-
* @method listAnalyticsFilters
|
|
60
|
-
* @param {string} websiteID
|
|
61
|
-
* @param {number} pageNumber
|
|
62
|
-
* @param {string} pointType
|
|
63
|
-
* @param {string} pointMetric
|
|
64
|
-
* @param {string} dateFrom
|
|
65
|
-
* @param {string} dateTo
|
|
66
|
-
* @return {Promise}
|
|
67
|
-
*/
|
|
68
|
-
service.listAnalyticsFilters = function(
|
|
69
|
-
websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo
|
|
70
|
-
) {
|
|
71
|
-
return crisp.get(
|
|
72
|
-
crisp._prepareRestUrl([
|
|
73
|
-
"website", websiteID, "analytics", pointType, pointMetric, "filters"
|
|
74
|
-
]),
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
date_from : dateFrom,
|
|
78
|
-
date_to : dateTo
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* List Analytics Classifiers
|
|
85
|
-
* @memberof WebsiteAnalytics
|
|
86
|
-
* @public
|
|
87
|
-
* @method listAnalyticsClassifiers
|
|
88
|
-
* @param {string} websiteID
|
|
89
|
-
* @param {number} pageNumber
|
|
90
|
-
* @param {string} pointType
|
|
91
|
-
* @param {string} pointMetric
|
|
92
|
-
* @param {string} dateFrom
|
|
93
|
-
* @param {string} dateTo
|
|
94
|
-
* @return {Promise}
|
|
95
|
-
*/
|
|
96
|
-
service.listAnalyticsClassifiers = function(
|
|
97
|
-
websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo
|
|
98
|
-
) {
|
|
99
|
-
return crisp.get(
|
|
100
|
-
crisp._prepareRestUrl([
|
|
101
|
-
"website", websiteID, "analytics", pointType, pointMetric, "classifiers"
|
|
102
|
-
]),
|
|
103
|
-
|
|
104
|
-
{
|
|
105
|
-
date_from : dateFrom,
|
|
106
|
-
date_to : dateTo
|
|
107
|
-
}
|
|
31
|
+
null, query
|
|
108
32
|
);
|
|
109
33
|
};
|
|
110
34
|
}
|
|
@@ -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