crisp-api 8.5.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 +12 -0
- package/EXAMPLES.md +2 -20
- package/README.md +4 -30
- package/lib/resources/WebsiteAnalytics.js +7 -83
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
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
|
+
|
|
4
16
|
## v8.5.0
|
|
5
17
|
|
|
6
18
|
### Breaking Changes
|
package/EXAMPLES.md
CHANGED
|
@@ -1809,29 +1809,11 @@ CrispClient.website.listWebsiteOperatorAvailabilities(websiteID);
|
|
|
1809
1809
|
|
|
1810
1810
|
=========================
|
|
1811
1811
|
|
|
1812
|
-
https://docs.crisp.chat/references/rest-api/v1/#
|
|
1812
|
+
https://docs.crisp.chat/references/rest-api/v1/#generate-analytics
|
|
1813
1813
|
|
|
1814
1814
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1815
1815
|
|
|
1816
|
-
CrispClient.website.
|
|
1817
|
-
|
|
1818
|
-
=========================
|
|
1819
|
-
|
|
1820
|
-
https://docs.crisp.chat/references/rest-api/v1/#list-analytics-filters
|
|
1821
|
-
|
|
1822
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1823
|
-
var pageNumber = 1;
|
|
1824
|
-
|
|
1825
|
-
CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
1826
|
-
|
|
1827
|
-
=========================
|
|
1828
|
-
|
|
1829
|
-
https://docs.crisp.chat/references/rest-api/v1/#list-analytics-classifiers
|
|
1830
|
-
|
|
1831
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1832
|
-
var pageNumber = 1;
|
|
1833
|
-
|
|
1834
|
-
CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
1816
|
+
CrispClient.website.generateAnalytics(websiteID, query);
|
|
1835
1817
|
|
|
1836
1818
|
=========================
|
|
1837
1819
|
|
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
|
|
@@ -2605,41 +2605,15 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2605
2605
|
|
|
2606
2606
|
|
|
2607
2607
|
* #### **Website Analytics**
|
|
2608
|
-
* **
|
|
2609
|
-
* `CrispClient.website.
|
|
2608
|
+
* **Generate Analytics** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#generate-analytics)
|
|
2609
|
+
* `CrispClient.website.generateAnalytics(websiteID, query)`
|
|
2610
2610
|
* <details>
|
|
2611
2611
|
<summary>See Example</summary>
|
|
2612
2612
|
|
|
2613
2613
|
```javascript
|
|
2614
2614
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2615
2615
|
|
|
2616
|
-
CrispClient.website.
|
|
2617
|
-
```
|
|
2618
|
-
</details>
|
|
2619
|
-
|
|
2620
|
-
* **List Analytics Filters** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-analytics-filters)
|
|
2621
|
-
* `CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)`
|
|
2622
|
-
* <details>
|
|
2623
|
-
<summary>See Example</summary>
|
|
2624
|
-
|
|
2625
|
-
```javascript
|
|
2626
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2627
|
-
var pageNumber = 1;
|
|
2628
|
-
|
|
2629
|
-
CrispClient.website.listAnalyticsFilters(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
2630
|
-
```
|
|
2631
|
-
</details>
|
|
2632
|
-
|
|
2633
|
-
* **List Analytics Classifiers** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-analytics-classifiers)
|
|
2634
|
-
* `CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo)`
|
|
2635
|
-
* <details>
|
|
2636
|
-
<summary>See Example</summary>
|
|
2637
|
-
|
|
2638
|
-
```javascript
|
|
2639
|
-
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2640
|
-
var pageNumber = 1;
|
|
2641
|
-
|
|
2642
|
-
CrispClient.website.listAnalyticsClassifiers(websiteID, pageNumber, pointType, pointMetric, dateFrom, dateTo);
|
|
2616
|
+
CrispClient.website.generateAnalytics(websiteID, query);
|
|
2643
2617
|
```
|
|
2644
2618
|
</details>
|
|
2645
2619
|
|
|
@@ -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
|
}
|
package/package.json
CHANGED