crisp-api 10.10.0 → 10.10.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/CHANGELOG.md +6 -0
- package/EXAMPLES.md +78 -1
- package/README.md +94 -1
- package/dist/crisp.js +1 -1
- package/dist/resources/WebsiteBatch.d.ts +25 -0
- package/dist/resources/WebsiteBatch.js +34 -0
- package/dist/resources/WebsiteSettings.d.ts +0 -2
- package/lib/resources/WebsiteBatch.ts +76 -0
- package/lib/resources/WebsiteSettings.ts +0 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.10.1
|
|
5
|
+
|
|
6
|
+
### Changes
|
|
7
|
+
|
|
8
|
+
* Added `CrispClient.website.batchUpdateConversationsData`, `CrispClient.website.batchUpdatePeopleData`, `CrispClient.website.batchUpdateConversationsSegments` and `CrispClient.website.batchUpdatePeopleSegments` methods.
|
|
9
|
+
|
|
4
10
|
## v10.9.3
|
|
5
11
|
|
|
6
12
|
### Changes
|
package/EXAMPLES.md
CHANGED
|
@@ -1692,7 +1692,6 @@ var settings = {
|
|
|
1692
1692
|
"emails": {
|
|
1693
1693
|
"rating": true,
|
|
1694
1694
|
"transcript": true,
|
|
1695
|
-
"enrich": true,
|
|
1696
1695
|
"junk_filter": true
|
|
1697
1696
|
},
|
|
1698
1697
|
"chatbox": {
|
|
@@ -1990,6 +1989,84 @@ CrispClient.website.batchRemovePeople(websiteID, people);
|
|
|
1990
1989
|
|
|
1991
1990
|
=========================
|
|
1992
1991
|
|
|
1992
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-data-items
|
|
1993
|
+
|
|
1994
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1995
|
+
|
|
1996
|
+
var operation = {
|
|
1997
|
+
"sessions": [
|
|
1998
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
1999
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2000
|
+
],
|
|
2001
|
+
|
|
2002
|
+
"data": {
|
|
2003
|
+
"plan": "pro",
|
|
2004
|
+
"subscribed": true
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
CrispClient.website.batchUpdateConversationsData(websiteID, operation);
|
|
2009
|
+
|
|
2010
|
+
=========================
|
|
2011
|
+
|
|
2012
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-data-items
|
|
2013
|
+
|
|
2014
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2015
|
+
|
|
2016
|
+
var people = {
|
|
2017
|
+
"profiles": [
|
|
2018
|
+
"eee8759d-52db-48e5-982d-3426e3566ce0"
|
|
2019
|
+
]
|
|
2020
|
+
};
|
|
2021
|
+
|
|
2022
|
+
var data = {
|
|
2023
|
+
"plan": "pro",
|
|
2024
|
+
"subscribed": true
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
CrispClient.website.batchUpdatePeopleData(websiteID, people, data);
|
|
2028
|
+
|
|
2029
|
+
=========================
|
|
2030
|
+
|
|
2031
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-segments-items
|
|
2032
|
+
|
|
2033
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2034
|
+
|
|
2035
|
+
var operation = {
|
|
2036
|
+
"sessions": [
|
|
2037
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2038
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2039
|
+
],
|
|
2040
|
+
|
|
2041
|
+
"segments": [
|
|
2042
|
+
"vip",
|
|
2043
|
+
"lead"
|
|
2044
|
+
]
|
|
2045
|
+
};
|
|
2046
|
+
|
|
2047
|
+
CrispClient.website.batchUpdateConversationsSegments(websiteID, operation);
|
|
2048
|
+
|
|
2049
|
+
=========================
|
|
2050
|
+
|
|
2051
|
+
https://docs.crisp.chat/references/rest-api/v1/#batch-segments-items
|
|
2052
|
+
|
|
2053
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2054
|
+
|
|
2055
|
+
var people = {
|
|
2056
|
+
"profiles": [
|
|
2057
|
+
"eee8759d-52db-48e5-982d-3426e3566ce0"
|
|
2058
|
+
]
|
|
2059
|
+
};
|
|
2060
|
+
|
|
2061
|
+
var segments = [
|
|
2062
|
+
"vip",
|
|
2063
|
+
"lead"
|
|
2064
|
+
];
|
|
2065
|
+
|
|
2066
|
+
CrispClient.website.batchUpdatePeopleSegments(websiteID, people, segments);
|
|
2067
|
+
|
|
2068
|
+
=========================
|
|
2069
|
+
|
|
1993
2070
|
https://docs.crisp.chat/references/rest-api/v1/#list-website-inboxes
|
|
1994
2071
|
|
|
1995
2072
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
package/README.md
CHANGED
|
@@ -2468,7 +2468,6 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2468
2468
|
"emails": {
|
|
2469
2469
|
"rating": true,
|
|
2470
2470
|
"transcript": true,
|
|
2471
|
-
"enrich": true,
|
|
2472
2471
|
"junk_filter": true
|
|
2473
2472
|
},
|
|
2474
2473
|
"chatbox": {
|
|
@@ -2978,6 +2977,100 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2978
2977
|
```
|
|
2979
2978
|
</details>
|
|
2980
2979
|
|
|
2980
|
+
* **Batch Update Conversations Data**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-data-items)
|
|
2981
|
+
* `CrispClient.website.batchUpdateConversationsData(websiteID, operation)`
|
|
2982
|
+
* <details>
|
|
2983
|
+
<summary>See Example</summary>
|
|
2984
|
+
|
|
2985
|
+
```javascript
|
|
2986
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2987
|
+
|
|
2988
|
+
var operation = {
|
|
2989
|
+
"sessions": [
|
|
2990
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2991
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2992
|
+
],
|
|
2993
|
+
|
|
2994
|
+
"data": {
|
|
2995
|
+
"plan": "pro",
|
|
2996
|
+
"subscribed": true
|
|
2997
|
+
}
|
|
2998
|
+
};
|
|
2999
|
+
|
|
3000
|
+
CrispClient.website.batchUpdateConversationsData(websiteID, operation);
|
|
3001
|
+
```
|
|
3002
|
+
</details>
|
|
3003
|
+
|
|
3004
|
+
* **Batch Update People Data**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-data-items)
|
|
3005
|
+
* `CrispClient.website.batchUpdatePeopleData(websiteID, people, data)`
|
|
3006
|
+
* <details>
|
|
3007
|
+
<summary>See Example</summary>
|
|
3008
|
+
|
|
3009
|
+
```javascript
|
|
3010
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3011
|
+
|
|
3012
|
+
var people = {
|
|
3013
|
+
"profiles": [
|
|
3014
|
+
"eee8759d-52db-48e5-982d-3426e3566ce0"
|
|
3015
|
+
]
|
|
3016
|
+
};
|
|
3017
|
+
|
|
3018
|
+
var data = {
|
|
3019
|
+
"plan": "pro",
|
|
3020
|
+
"subscribed": true
|
|
3021
|
+
};
|
|
3022
|
+
|
|
3023
|
+
CrispClient.website.batchUpdatePeopleData(websiteID, people, data);
|
|
3024
|
+
```
|
|
3025
|
+
</details>
|
|
3026
|
+
|
|
3027
|
+
* **Batch Update Conversations Segments**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-segments-items)
|
|
3028
|
+
* `CrispClient.website.batchUpdateConversationsSegments(websiteID, operation)`
|
|
3029
|
+
* <details>
|
|
3030
|
+
<summary>See Example</summary>
|
|
3031
|
+
|
|
3032
|
+
```javascript
|
|
3033
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3034
|
+
|
|
3035
|
+
var operation = {
|
|
3036
|
+
"sessions": [
|
|
3037
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
3038
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
3039
|
+
],
|
|
3040
|
+
|
|
3041
|
+
"segments": [
|
|
3042
|
+
"vip",
|
|
3043
|
+
"lead"
|
|
3044
|
+
]
|
|
3045
|
+
};
|
|
3046
|
+
|
|
3047
|
+
CrispClient.website.batchUpdateConversationsSegments(websiteID, operation);
|
|
3048
|
+
```
|
|
3049
|
+
</details>
|
|
3050
|
+
|
|
3051
|
+
* **Batch Update People Segments**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-segments-items)
|
|
3052
|
+
* `CrispClient.website.batchUpdatePeopleSegments(websiteID, people, segments)`
|
|
3053
|
+
* <details>
|
|
3054
|
+
<summary>See Example</summary>
|
|
3055
|
+
|
|
3056
|
+
```javascript
|
|
3057
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3058
|
+
|
|
3059
|
+
var people = {
|
|
3060
|
+
"profiles": [
|
|
3061
|
+
"eee8759d-52db-48e5-982d-3426e3566ce0"
|
|
3062
|
+
]
|
|
3063
|
+
};
|
|
3064
|
+
|
|
3065
|
+
var segments = [
|
|
3066
|
+
"vip",
|
|
3067
|
+
"lead"
|
|
3068
|
+
];
|
|
3069
|
+
|
|
3070
|
+
CrispClient.website.batchUpdatePeopleSegments(websiteID, people, segments);
|
|
3071
|
+
```
|
|
3072
|
+
</details>
|
|
3073
|
+
|
|
2981
3074
|
|
|
2982
3075
|
* #### **Website Inbox**
|
|
2983
3076
|
* **List Inboxes**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-website-inboxes)
|
package/dist/crisp.js
CHANGED
|
@@ -32,6 +32,15 @@ export type WebsiteBatchPeopleOperationInner = {
|
|
|
32
32
|
profiles?: string[];
|
|
33
33
|
search?: string;
|
|
34
34
|
};
|
|
35
|
+
export type WebsiteBatchDataPayload = Record<string, string | number | boolean>;
|
|
36
|
+
export type WebsiteBatchConversationsDataOperation = {
|
|
37
|
+
sessions: string[];
|
|
38
|
+
data: WebsiteBatchDataPayload;
|
|
39
|
+
};
|
|
40
|
+
export type WebsiteBatchConversationsSegmentsOperation = {
|
|
41
|
+
sessions: string[];
|
|
42
|
+
segments: string[];
|
|
43
|
+
};
|
|
35
44
|
/**************************************************************************
|
|
36
45
|
* CLASSES
|
|
37
46
|
***************************************************************************/
|
|
@@ -97,6 +106,22 @@ declare class WebsiteBatch extends BaseResource {
|
|
|
97
106
|
* Batch Inbox Conversations
|
|
98
107
|
*/
|
|
99
108
|
batchInboxConversations(websiteID: string, operation: WebsiteBatchInboxOperation): Promise<any>;
|
|
109
|
+
/**
|
|
110
|
+
* Batch Update Conversations Data
|
|
111
|
+
*/
|
|
112
|
+
batchUpdateConversationsData(websiteID: string, operation: WebsiteBatchConversationsDataOperation): Promise<any>;
|
|
113
|
+
/**
|
|
114
|
+
* Batch Update People Data
|
|
115
|
+
*/
|
|
116
|
+
batchUpdatePeopleData(websiteID: string, people: WebsiteBatchPeopleOperationInner, data: WebsiteBatchDataPayload): Promise<any>;
|
|
117
|
+
/**
|
|
118
|
+
* Batch Update Conversations Segments
|
|
119
|
+
*/
|
|
120
|
+
batchUpdateConversationsSegments(websiteID: string, operation: WebsiteBatchConversationsSegmentsOperation): Promise<any>;
|
|
121
|
+
/**
|
|
122
|
+
* Batch Update People Segments
|
|
123
|
+
*/
|
|
124
|
+
batchUpdatePeopleSegments(websiteID: string, people: WebsiteBatchPeopleOperationInner, segments: string[]): Promise<any>;
|
|
100
125
|
}
|
|
101
126
|
/**************************************************************************
|
|
102
127
|
* EXPORTS
|
|
@@ -111,6 +111,40 @@ class WebsiteBatch extends BaseResource_1.default {
|
|
|
111
111
|
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "inbox"]), null, operation);
|
|
112
112
|
}
|
|
113
113
|
;
|
|
114
|
+
/**
|
|
115
|
+
* Batch Update Conversations Data
|
|
116
|
+
*/
|
|
117
|
+
batchUpdateConversationsData(websiteID, operation) {
|
|
118
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "data"]), null, operation);
|
|
119
|
+
}
|
|
120
|
+
;
|
|
121
|
+
/**
|
|
122
|
+
* Batch Update People Data
|
|
123
|
+
*/
|
|
124
|
+
batchUpdatePeopleData(websiteID, people, data) {
|
|
125
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "data"]), null, {
|
|
126
|
+
people: people,
|
|
127
|
+
data: data
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
;
|
|
131
|
+
/**
|
|
132
|
+
* Batch Update Conversations Segments
|
|
133
|
+
*/
|
|
134
|
+
batchUpdateConversationsSegments(websiteID, operation) {
|
|
135
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "segments"]), null, operation);
|
|
136
|
+
}
|
|
137
|
+
;
|
|
138
|
+
/**
|
|
139
|
+
* Batch Update People Segments
|
|
140
|
+
*/
|
|
141
|
+
batchUpdatePeopleSegments(websiteID, people, segments) {
|
|
142
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "segments"]), null, {
|
|
143
|
+
people: people,
|
|
144
|
+
segments: segments
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
;
|
|
114
148
|
}
|
|
115
149
|
/**************************************************************************
|
|
116
150
|
* EXPORTS
|
|
@@ -36,7 +36,6 @@ export interface WebsiteSettingsInbox {
|
|
|
36
36
|
export interface WebsiteSettingsEmails {
|
|
37
37
|
rating?: boolean;
|
|
38
38
|
transcript?: boolean;
|
|
39
|
-
enrich?: boolean;
|
|
40
39
|
junk_filter?: boolean;
|
|
41
40
|
}
|
|
42
41
|
export interface WebsiteSettingsChatbox {
|
|
@@ -113,7 +112,6 @@ export interface WebsiteSettingsUpdateInbox {
|
|
|
113
112
|
export interface WebsiteSettingsUpdateEmails {
|
|
114
113
|
rating?: boolean;
|
|
115
114
|
transcript?: boolean;
|
|
116
|
-
enrich?: boolean;
|
|
117
115
|
junk_filter?: boolean;
|
|
118
116
|
}
|
|
119
117
|
export interface WebsiteSettingsUpdateChatbox {
|
|
@@ -50,6 +50,18 @@ export type WebsiteBatchPeopleOperationInner = {
|
|
|
50
50
|
search?: string;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
export type WebsiteBatchDataPayload = Record<string, string | number | boolean>;
|
|
54
|
+
|
|
55
|
+
export type WebsiteBatchConversationsDataOperation = {
|
|
56
|
+
sessions: string[];
|
|
57
|
+
data: WebsiteBatchDataPayload;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type WebsiteBatchConversationsSegmentsOperation = {
|
|
61
|
+
sessions: string[];
|
|
62
|
+
segments: string[];
|
|
63
|
+
}
|
|
64
|
+
|
|
53
65
|
/**************************************************************************
|
|
54
66
|
* CLASSES
|
|
55
67
|
***************************************************************************/
|
|
@@ -209,6 +221,70 @@ class WebsiteBatch extends BaseResource {
|
|
|
209
221
|
null, operation
|
|
210
222
|
);
|
|
211
223
|
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Batch Update Conversations Data
|
|
227
|
+
*/
|
|
228
|
+
batchUpdateConversationsData(
|
|
229
|
+
websiteID: string, operation: WebsiteBatchConversationsDataOperation
|
|
230
|
+
) {
|
|
231
|
+
return this.crisp.patch(
|
|
232
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "data"]),
|
|
233
|
+
|
|
234
|
+
null, operation
|
|
235
|
+
);
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Batch Update People Data
|
|
240
|
+
*/
|
|
241
|
+
batchUpdatePeopleData(
|
|
242
|
+
websiteID: string, people: WebsiteBatchPeopleOperationInner,
|
|
243
|
+
data: WebsiteBatchDataPayload
|
|
244
|
+
) {
|
|
245
|
+
return this.crisp.patch(
|
|
246
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "data"]),
|
|
247
|
+
|
|
248
|
+
null,
|
|
249
|
+
|
|
250
|
+
{
|
|
251
|
+
people: people,
|
|
252
|
+
data: data
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Batch Update Conversations Segments
|
|
259
|
+
*/
|
|
260
|
+
batchUpdateConversationsSegments(
|
|
261
|
+
websiteID: string, operation: WebsiteBatchConversationsSegmentsOperation
|
|
262
|
+
) {
|
|
263
|
+
return this.crisp.patch(
|
|
264
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "segments"]),
|
|
265
|
+
|
|
266
|
+
null, operation
|
|
267
|
+
);
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Batch Update People Segments
|
|
272
|
+
*/
|
|
273
|
+
batchUpdatePeopleSegments(
|
|
274
|
+
websiteID: string, people: WebsiteBatchPeopleOperationInner,
|
|
275
|
+
segments: string[]
|
|
276
|
+
) {
|
|
277
|
+
return this.crisp.patch(
|
|
278
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "segments"]),
|
|
279
|
+
|
|
280
|
+
null,
|
|
281
|
+
|
|
282
|
+
{
|
|
283
|
+
people: people,
|
|
284
|
+
segments: segments
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
};
|
|
212
288
|
}
|
|
213
289
|
|
|
214
290
|
/**************************************************************************
|
|
@@ -51,7 +51,6 @@ export interface WebsiteSettingsInbox {
|
|
|
51
51
|
export interface WebsiteSettingsEmails {
|
|
52
52
|
rating?: boolean;
|
|
53
53
|
transcript?: boolean;
|
|
54
|
-
enrich?: boolean;
|
|
55
54
|
junk_filter?: boolean;
|
|
56
55
|
}
|
|
57
56
|
|
|
@@ -134,7 +133,6 @@ export interface WebsiteSettingsUpdateInbox {
|
|
|
134
133
|
export interface WebsiteSettingsUpdateEmails {
|
|
135
134
|
rating?: boolean;
|
|
136
135
|
transcript?: boolean;
|
|
137
|
-
enrich?: boolean;
|
|
138
136
|
junk_filter?: boolean;
|
|
139
137
|
}
|
|
140
138
|
|
package/package.json
CHANGED