crisp-api 10.1.0 → 10.3.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 +37 -2
- package/README.md +21 -6
- package/dist/crisp.js +1 -1
- package/dist/resources/PluginConnect.d.ts +2 -2
- package/dist/resources/PluginConnect.js +6 -4
- package/dist/resources/PluginSubscription.d.ts +4 -0
- package/dist/resources/PluginSubscription.js +9 -0
- package/dist/resources/WebsiteSettings.d.ts +4 -0
- package/lib/resources/PluginConnect.ts +10 -2
- package/lib/resources/PluginSubscription.ts +11 -0
- package/lib/resources/WebsiteSettings.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.3.0
|
|
5
|
+
|
|
6
|
+
### New Features
|
|
7
|
+
|
|
8
|
+
* Added a new `includePlan` parameter to `CrispClient.plugin.listAllConnectWebsites` and `CrispClient.plugin.listConnectWebsitesSince` methods.
|
|
9
|
+
|
|
10
|
+
## v10.2.0
|
|
11
|
+
|
|
12
|
+
### New Features
|
|
13
|
+
|
|
14
|
+
* Added the new `CrispClient.plugin.getPluginAttestProvenance` method.
|
|
15
|
+
|
|
4
16
|
## v10.1.0
|
|
5
17
|
|
|
6
18
|
### New Features
|
package/EXAMPLES.md
CHANGED
|
@@ -1711,9 +1711,11 @@ var settings = {
|
|
|
1711
1711
|
"overlay_mode": false,
|
|
1712
1712
|
"helpdesk_link": true,
|
|
1713
1713
|
"helpdesk_only": false,
|
|
1714
|
+
"helpdesk_navigate": "deep",
|
|
1714
1715
|
"status_health_dead": true,
|
|
1715
1716
|
"check_domain": false,
|
|
1716
1717
|
"color_theme": "blue",
|
|
1718
|
+
"color_mode": "auto",
|
|
1717
1719
|
"layout_theme": "default",
|
|
1718
1720
|
"text_theme": "default",
|
|
1719
1721
|
"welcome_message": "default",
|
|
@@ -2258,7 +2260,7 @@ https://docs.crisp.chat/references/rest-api/v1/#list-all-connect-websites
|
|
|
2258
2260
|
|
|
2259
2261
|
var pageNumber = 1;
|
|
2260
2262
|
|
|
2261
|
-
CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured);
|
|
2263
|
+
CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured, includePlan);
|
|
2262
2264
|
|
|
2263
2265
|
=========================
|
|
2264
2266
|
|
|
@@ -2266,7 +2268,7 @@ https://docs.crisp.chat/references/rest-api/v1/#list-connect-websites-since
|
|
|
2266
2268
|
|
|
2267
2269
|
var dateSince = "2023-08-16T09:00:00Z";
|
|
2268
2270
|
|
|
2269
|
-
CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured);
|
|
2271
|
+
CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured, includePlan);
|
|
2270
2272
|
|
|
2271
2273
|
=========================
|
|
2272
2274
|
|
|
@@ -2358,6 +2360,39 @@ CrispClient.plugin.updateSubscriptionSettings(websiteID, pluginID, settings);
|
|
|
2358
2360
|
|
|
2359
2361
|
=========================
|
|
2360
2362
|
|
|
2363
|
+
https://docs.crisp.chat/references/rest-api/v1/#get-plugin-usage-bills
|
|
2364
|
+
|
|
2365
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2366
|
+
var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
|
|
2367
|
+
|
|
2368
|
+
CrispClient.plugin.getPluginUsageBills(websiteID, pluginID);
|
|
2369
|
+
|
|
2370
|
+
=========================
|
|
2371
|
+
|
|
2372
|
+
https://docs.crisp.chat/references/rest-api/v1/#report-plugin-usage-to-bill
|
|
2373
|
+
|
|
2374
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2375
|
+
var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
|
|
2376
|
+
|
|
2377
|
+
var usage = {
|
|
2378
|
+
"name": "Paid messages sent",
|
|
2379
|
+
"units": 250,
|
|
2380
|
+
"price": 0.10
|
|
2381
|
+
};
|
|
2382
|
+
|
|
2383
|
+
CrispClient.plugin.reportPluginUsageToBill(websiteID, pluginID, usage);
|
|
2384
|
+
|
|
2385
|
+
=========================
|
|
2386
|
+
|
|
2387
|
+
https://docs.crisp.chat/references/rest-api/v1/#get-plugin-attest-provenance
|
|
2388
|
+
|
|
2389
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2390
|
+
var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
|
|
2391
|
+
|
|
2392
|
+
CrispClient.plugin.getPluginAttestProvenance(websiteID, pluginID);
|
|
2393
|
+
|
|
2394
|
+
=========================
|
|
2395
|
+
|
|
2361
2396
|
https://docs.crisp.chat/references/rest-api/v1/#forward-plugin-payload-to-channel
|
|
2362
2397
|
|
|
2363
2398
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your JavaScript code.
|
|
6
6
|
|
|
7
|
-
Copyright
|
|
7
|
+
Copyright 2026 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: 06/01/2026
|
|
10
10
|
* **😘 Maintainers**: [@baptistejamin](https://github.com/baptistejamin), [@eliottvincent](https://github.com/eliottvincent), [@valeriansaliou](https://github.com/valeriansaliou)
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
@@ -2473,9 +2473,11 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2473
2473
|
"overlay_mode": false,
|
|
2474
2474
|
"helpdesk_link": true,
|
|
2475
2475
|
"helpdesk_only": false,
|
|
2476
|
+
"helpdesk_navigate": "deep",
|
|
2476
2477
|
"status_health_dead": true,
|
|
2477
2478
|
"check_domain": false,
|
|
2478
2479
|
"color_theme": "blue",
|
|
2480
|
+
"color_mode": "auto",
|
|
2479
2481
|
"layout_theme": "default",
|
|
2480
2482
|
"text_theme": "default",
|
|
2481
2483
|
"welcome_message": "default",
|
|
@@ -3223,26 +3225,26 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
3223
3225
|
</details>
|
|
3224
3226
|
|
|
3225
3227
|
* **⭐ List All Connect Websites** [`plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-all-connect-websites)
|
|
3226
|
-
* `CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured)`
|
|
3228
|
+
* `CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured, includePlan)`
|
|
3227
3229
|
* <details>
|
|
3228
3230
|
<summary>See Example</summary>
|
|
3229
3231
|
|
|
3230
3232
|
```javascript
|
|
3231
3233
|
var pageNumber = 1;
|
|
3232
3234
|
|
|
3233
|
-
CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured);
|
|
3235
|
+
CrispClient.plugin.listAllConnectWebsites(pageNumber, filterConfigured, includePlan);
|
|
3234
3236
|
```
|
|
3235
3237
|
</details>
|
|
3236
3238
|
|
|
3237
3239
|
* **⭐ List Connect Websites Since** [`plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-connect-websites-since)
|
|
3238
|
-
* `CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured)`
|
|
3240
|
+
* `CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured, includePlan)`
|
|
3239
3241
|
* <details>
|
|
3240
3242
|
<summary>See Example</summary>
|
|
3241
3243
|
|
|
3242
3244
|
```javascript
|
|
3243
3245
|
var dateSince = "2023-08-16T09:00:00Z";
|
|
3244
3246
|
|
|
3245
|
-
CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured);
|
|
3247
|
+
CrispClient.plugin.listConnectWebsitesSince(dateSince, filterConfigured, includePlan);
|
|
3246
3248
|
```
|
|
3247
3249
|
</details>
|
|
3248
3250
|
|
|
@@ -3404,6 +3406,19 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
3404
3406
|
```
|
|
3405
3407
|
</details>
|
|
3406
3408
|
|
|
3409
|
+
* **Get Plugin Attest Provenance** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-plugin-attest-provenance)
|
|
3410
|
+
* `CrispClient.plugin.getPluginAttestProvenance(websiteID, pluginID)`
|
|
3411
|
+
* <details>
|
|
3412
|
+
<summary>See Example</summary>
|
|
3413
|
+
|
|
3414
|
+
```javascript
|
|
3415
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3416
|
+
var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
|
|
3417
|
+
|
|
3418
|
+
CrispClient.plugin.getPluginAttestProvenance(websiteID, pluginID);
|
|
3419
|
+
```
|
|
3420
|
+
</details>
|
|
3421
|
+
|
|
3407
3422
|
* **Forward Plugin Payload To Channel** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#forward-plugin-payload-to-channel)
|
|
3408
3423
|
* `CrispClient.plugin.forwardPluginPayloadToChannel(websiteID, pluginID, payload)`
|
|
3409
3424
|
* <details>
|
package/dist/crisp.js
CHANGED
|
@@ -47,11 +47,11 @@ declare class PluginConnect extends BaseResource {
|
|
|
47
47
|
/**
|
|
48
48
|
* List All Connect Websites
|
|
49
49
|
*/
|
|
50
|
-
listAllConnectWebsites(pageNumber: number, filterConfigured: boolean): Promise<PluginConnectAllWebsite[]>;
|
|
50
|
+
listAllConnectWebsites(pageNumber: number, filterConfigured: boolean, includePlan: boolean): Promise<PluginConnectAllWebsite[]>;
|
|
51
51
|
/**
|
|
52
52
|
* List Connect Websites Since
|
|
53
53
|
*/
|
|
54
|
-
listConnectWebsitesSince(dateSince: string, filterConfigured: boolean): Promise<PluginConnectWebsitesSince[]>;
|
|
54
|
+
listConnectWebsitesSince(dateSince: string, filterConfigured: boolean, includePlan: boolean): Promise<PluginConnectWebsitesSince[]>;
|
|
55
55
|
/**
|
|
56
56
|
* Get Connect Endpoints
|
|
57
57
|
*/
|
|
@@ -38,10 +38,11 @@ class PluginConnect extends BaseResource_1.default {
|
|
|
38
38
|
/**
|
|
39
39
|
* List All Connect Websites
|
|
40
40
|
*/
|
|
41
|
-
listAllConnectWebsites(pageNumber, filterConfigured) {
|
|
41
|
+
listAllConnectWebsites(pageNumber, filterConfigured, includePlan) {
|
|
42
42
|
// Generate query
|
|
43
43
|
let query = {
|
|
44
|
-
filter_configured: ((filterConfigured === true) ? "1" : "0")
|
|
44
|
+
filter_configured: ((filterConfigured === true) ? "1" : "0"),
|
|
45
|
+
include_plan: ((includePlan === true) ? "1" : "0")
|
|
45
46
|
};
|
|
46
47
|
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
47
48
|
"plugin", "connect", "websites", "all", String(pageNumber)
|
|
@@ -51,10 +52,11 @@ class PluginConnect extends BaseResource_1.default {
|
|
|
51
52
|
/**
|
|
52
53
|
* List Connect Websites Since
|
|
53
54
|
*/
|
|
54
|
-
listConnectWebsitesSince(dateSince, filterConfigured) {
|
|
55
|
+
listConnectWebsitesSince(dateSince, filterConfigured, includePlan) {
|
|
55
56
|
// Generate query
|
|
56
57
|
let query = {
|
|
57
|
-
filter_configured: ((filterConfigured === true) ? "1" : "0")
|
|
58
|
+
filter_configured: ((filterConfigured === true) ? "1" : "0"),
|
|
59
|
+
include_plan: ((includePlan === true) ? "1" : "0")
|
|
58
60
|
};
|
|
59
61
|
if (dateSince) {
|
|
60
62
|
// @ts-ignore
|
|
@@ -97,6 +97,10 @@ declare class PluginSubscriptionService extends BaseResource {
|
|
|
97
97
|
* Report Plugin Usage To Bill
|
|
98
98
|
*/
|
|
99
99
|
reportPluginUsageToBill(websiteID: string, pluginID: string, usage: object): Promise<any>;
|
|
100
|
+
/**
|
|
101
|
+
* Get Plugin Attest Provenance
|
|
102
|
+
*/
|
|
103
|
+
getPluginAttestProvenance(websiteID: string, pluginID: string): Promise<any>;
|
|
100
104
|
/**
|
|
101
105
|
* Forward Plugin Payload To Channel
|
|
102
106
|
*/
|
|
@@ -105,6 +105,15 @@ class PluginSubscriptionService extends BaseResource_1.default {
|
|
|
105
105
|
]), null, usage);
|
|
106
106
|
}
|
|
107
107
|
;
|
|
108
|
+
/**
|
|
109
|
+
* Get Plugin Attest Provenance
|
|
110
|
+
*/
|
|
111
|
+
getPluginAttestProvenance(websiteID, pluginID) {
|
|
112
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
113
|
+
"plugins", "subscription", websiteID, pluginID, "attest", "provenance"
|
|
114
|
+
]));
|
|
115
|
+
}
|
|
116
|
+
;
|
|
108
117
|
/**
|
|
109
118
|
* Forward Plugin Payload To Channel
|
|
110
119
|
*/
|
|
@@ -64,9 +64,11 @@ export interface WebsiteSettingsChatbox {
|
|
|
64
64
|
overlay_mode?: boolean;
|
|
65
65
|
helpdesk_link?: boolean;
|
|
66
66
|
helpdesk_only?: boolean;
|
|
67
|
+
helpdesk_navigate?: string;
|
|
67
68
|
status_health_dead?: boolean;
|
|
68
69
|
check_domain?: boolean;
|
|
69
70
|
color_theme?: string;
|
|
71
|
+
color_mode?: string;
|
|
70
72
|
layout_theme?: string;
|
|
71
73
|
text_theme?: string;
|
|
72
74
|
welcome_message?: string;
|
|
@@ -135,9 +137,11 @@ export interface WebsiteSettingsUpdateChatbox {
|
|
|
135
137
|
overlay_mode?: boolean;
|
|
136
138
|
helpdesk_link?: boolean;
|
|
137
139
|
helpdesk_only?: boolean;
|
|
140
|
+
helpdesk_navigate?: string;
|
|
138
141
|
status_health_dead?: boolean;
|
|
139
142
|
check_domain?: boolean;
|
|
140
143
|
color_theme?: string;
|
|
144
|
+
color_mode?: string;
|
|
141
145
|
layout_theme?: string;
|
|
142
146
|
text_theme?: string;
|
|
143
147
|
welcome_message?: string;
|
|
@@ -78,12 +78,16 @@ class PluginConnect extends BaseResource {
|
|
|
78
78
|
* List All Connect Websites
|
|
79
79
|
*/
|
|
80
80
|
listAllConnectWebsites(
|
|
81
|
-
pageNumber: number, filterConfigured: boolean
|
|
81
|
+
pageNumber: number, filterConfigured: boolean, includePlan: boolean
|
|
82
82
|
): Promise<PluginConnectAllWebsite[]> {
|
|
83
83
|
// Generate query
|
|
84
84
|
let query = {
|
|
85
85
|
filter_configured: (
|
|
86
86
|
(filterConfigured === true) ? "1" : "0"
|
|
87
|
+
),
|
|
88
|
+
|
|
89
|
+
include_plan: (
|
|
90
|
+
(includePlan === true) ? "1" : "0"
|
|
87
91
|
)
|
|
88
92
|
};
|
|
89
93
|
|
|
@@ -100,12 +104,16 @@ class PluginConnect extends BaseResource {
|
|
|
100
104
|
* List Connect Websites Since
|
|
101
105
|
*/
|
|
102
106
|
listConnectWebsitesSince(
|
|
103
|
-
dateSince: string, filterConfigured: boolean
|
|
107
|
+
dateSince: string, filterConfigured: boolean, includePlan: boolean
|
|
104
108
|
): Promise<PluginConnectWebsitesSince[]> {
|
|
105
109
|
// Generate query
|
|
106
110
|
let query = {
|
|
107
111
|
filter_configured: (
|
|
108
112
|
(filterConfigured === true) ? "1" : "0"
|
|
113
|
+
),
|
|
114
|
+
|
|
115
|
+
include_plan: (
|
|
116
|
+
(includePlan === true) ? "1" : "0"
|
|
109
117
|
)
|
|
110
118
|
};
|
|
111
119
|
|
|
@@ -198,6 +198,17 @@ class PluginSubscriptionService extends BaseResource {
|
|
|
198
198
|
);
|
|
199
199
|
};
|
|
200
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Get Plugin Attest Provenance
|
|
203
|
+
*/
|
|
204
|
+
getPluginAttestProvenance(websiteID: string, pluginID: string) {
|
|
205
|
+
return this.crisp.get(
|
|
206
|
+
this.crisp.prepareRestUrl([
|
|
207
|
+
"plugins", "subscription", websiteID, pluginID, "attest", "provenance"
|
|
208
|
+
])
|
|
209
|
+
);
|
|
210
|
+
};
|
|
211
|
+
|
|
201
212
|
/**
|
|
202
213
|
* Forward Plugin Payload To Channel
|
|
203
214
|
*/
|
|
@@ -80,9 +80,11 @@ export interface WebsiteSettingsChatbox {
|
|
|
80
80
|
overlay_mode?: boolean;
|
|
81
81
|
helpdesk_link?: boolean;
|
|
82
82
|
helpdesk_only?: boolean;
|
|
83
|
+
helpdesk_navigate?: string;
|
|
83
84
|
status_health_dead?: boolean;
|
|
84
85
|
check_domain?: boolean;
|
|
85
86
|
color_theme?: string;
|
|
87
|
+
color_mode?: string;
|
|
86
88
|
layout_theme?: string;
|
|
87
89
|
text_theme?: string;
|
|
88
90
|
welcome_message?: string;
|
|
@@ -157,9 +159,11 @@ export interface WebsiteSettingsUpdateChatbox {
|
|
|
157
159
|
overlay_mode?: boolean;
|
|
158
160
|
helpdesk_link?: boolean;
|
|
159
161
|
helpdesk_only?: boolean;
|
|
162
|
+
helpdesk_navigate?: string;
|
|
160
163
|
status_health_dead?: boolean;
|
|
161
164
|
check_domain?: boolean;
|
|
162
165
|
color_theme?: string;
|
|
166
|
+
color_mode?: string;
|
|
163
167
|
layout_theme?: string;
|
|
164
168
|
text_theme?: string;
|
|
165
169
|
welcome_message?: string;
|
package/package.json
CHANGED