crisp-api 10.9.3 → 10.10.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/EXAMPLES.md +8 -0
- package/README.md +141 -2
- package/dist/crisp.js +1 -1
- package/dist/resources/WebsiteBatch.d.ts +43 -0
- package/dist/resources/WebsiteBatch.js +42 -0
- package/dist/resources/WebsiteCampaign.d.ts +1 -0
- package/dist/resources/WebsiteConnect.d.ts +34 -0
- package/dist/resources/WebsiteConnect.js +37 -0
- package/dist/resources/index.d.ts +1 -0
- package/dist/resources/index.js +1 -0
- package/dist/services/website.d.ts +2 -1
- package/dist/services/website.js +2 -0
- package/lib/resources/WebsiteBatch.ts +102 -0
- package/lib/resources/WebsiteCampaign.ts +1 -0
- package/lib/resources/WebsiteConnect.ts +57 -0
- package/lib/resources/index.ts +1 -0
- package/lib/services/website.ts +3 -0
- package/package.json +1 -1
package/EXAMPLES.md
CHANGED
|
@@ -2379,6 +2379,14 @@ CrispClient.website.listCampaignStatistics(websiteID, campaignID, action, pageNu
|
|
|
2379
2379
|
|
|
2380
2380
|
=========================
|
|
2381
2381
|
|
|
2382
|
+
https://docs.crisp.chat/references/rest-api/v1/#get-website-connect-endpoints
|
|
2383
|
+
|
|
2384
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2385
|
+
|
|
2386
|
+
CrispClient.website.getConnectEndpoints(websiteID);
|
|
2387
|
+
|
|
2388
|
+
=========================
|
|
2389
|
+
|
|
2382
2390
|
https://docs.crisp.chat/references/rest-api/v1/#get-connect-account
|
|
2383
2391
|
|
|
2384
2392
|
CrispClient.plugin.getConnectAccount();
|
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ Then, add authentication parameters to your `client` instance right after you cr
|
|
|
25
25
|
var { Crisp } = require("crisp-api");
|
|
26
26
|
var CrispClient = new Crisp();
|
|
27
27
|
|
|
28
|
-
// Authenticate to API with your
|
|
28
|
+
// Authenticate to API with your token (identifier, key)
|
|
29
29
|
// eg. CrispClient.authenticate("7c3ef21c-1e04-41ce-8c06-5605c346f73e", "cc29e1a5086e428fcc6a697d5837a66d82808e65c5cce006fbf2191ceea80a0a");
|
|
30
|
-
CrispClient.authenticateTier(
|
|
30
|
+
CrispClient.authenticateTier(tier, identifier, key);
|
|
31
31
|
|
|
32
32
|
// Now, you can use authenticated API sections.
|
|
33
33
|
```
|
|
@@ -115,6 +115,7 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
115
115
|
<li><a href="#website-verify">Website Verify</a></li>
|
|
116
116
|
<li><a href="#website-campaigns">Website Campaigns</a></li>
|
|
117
117
|
<li><a href="#website-campaign">Website Campaign</a></li>
|
|
118
|
+
<li><a href="#website-connect">Website Connect</a></li>
|
|
118
119
|
</ul>
|
|
119
120
|
</details>
|
|
120
121
|
<details>
|
|
@@ -2794,6 +2795,25 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2794
2795
|
```
|
|
2795
2796
|
</details>
|
|
2796
2797
|
|
|
2798
|
+
* **Batch Unresolve Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-unresolve-items)
|
|
2799
|
+
* `CrispClient.website.batchUnresolveConversations(websiteID, operation)`
|
|
2800
|
+
* <details>
|
|
2801
|
+
<summary>See Example</summary>
|
|
2802
|
+
|
|
2803
|
+
```javascript
|
|
2804
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2805
|
+
|
|
2806
|
+
var operation = {
|
|
2807
|
+
"sessions": [
|
|
2808
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2809
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2810
|
+
]
|
|
2811
|
+
};
|
|
2812
|
+
|
|
2813
|
+
CrispClient.website.batchUnresolveConversations(websiteID, operation);
|
|
2814
|
+
```
|
|
2815
|
+
</details>
|
|
2816
|
+
|
|
2797
2817
|
* **Batch Read Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-read-items)
|
|
2798
2818
|
* `CrispClient.website.batchReadConversations(websiteID, operation)`
|
|
2799
2819
|
* <details>
|
|
@@ -2815,6 +2835,25 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2815
2835
|
```
|
|
2816
2836
|
</details>
|
|
2817
2837
|
|
|
2838
|
+
* **Batch Unread Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-unread-items)
|
|
2839
|
+
* `CrispClient.website.batchUnreadConversations(websiteID, operation)`
|
|
2840
|
+
* <details>
|
|
2841
|
+
<summary>See Example</summary>
|
|
2842
|
+
|
|
2843
|
+
```javascript
|
|
2844
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2845
|
+
|
|
2846
|
+
var operation = {
|
|
2847
|
+
"sessions": [
|
|
2848
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2849
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2850
|
+
]
|
|
2851
|
+
};
|
|
2852
|
+
|
|
2853
|
+
CrispClient.website.batchUnreadConversations(websiteID, operation);
|
|
2854
|
+
```
|
|
2855
|
+
</details>
|
|
2856
|
+
|
|
2818
2857
|
* **Batch Remove Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items)
|
|
2819
2858
|
* `CrispClient.website.batchRemoveConversations(websiteID, operation)`
|
|
2820
2859
|
* <details>
|
|
@@ -2853,6 +2892,92 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2853
2892
|
```
|
|
2854
2893
|
</details>
|
|
2855
2894
|
|
|
2895
|
+
* **Batch Report Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-report-items)
|
|
2896
|
+
* `CrispClient.website.batchReportConversations(websiteID, operation)`
|
|
2897
|
+
* <details>
|
|
2898
|
+
<summary>See Example</summary>
|
|
2899
|
+
|
|
2900
|
+
```javascript
|
|
2901
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2902
|
+
|
|
2903
|
+
var operation = {
|
|
2904
|
+
"sessions": [
|
|
2905
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2906
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2907
|
+
],
|
|
2908
|
+
|
|
2909
|
+
"flag": "spam"
|
|
2910
|
+
};
|
|
2911
|
+
|
|
2912
|
+
CrispClient.website.batchReportConversations(websiteID, operation);
|
|
2913
|
+
```
|
|
2914
|
+
</details>
|
|
2915
|
+
|
|
2916
|
+
* **Batch Block Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-block-items)
|
|
2917
|
+
* `CrispClient.website.batchBlockConversations(websiteID, operation)`
|
|
2918
|
+
* <details>
|
|
2919
|
+
<summary>See Example</summary>
|
|
2920
|
+
|
|
2921
|
+
```javascript
|
|
2922
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2923
|
+
|
|
2924
|
+
var operation = {
|
|
2925
|
+
"sessions": [
|
|
2926
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2927
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2928
|
+
],
|
|
2929
|
+
|
|
2930
|
+
"blocked": true
|
|
2931
|
+
};
|
|
2932
|
+
|
|
2933
|
+
CrispClient.website.batchBlockConversations(websiteID, operation);
|
|
2934
|
+
```
|
|
2935
|
+
</details>
|
|
2936
|
+
|
|
2937
|
+
* **Batch Routing Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-routing-items)
|
|
2938
|
+
* `CrispClient.website.batchRoutingConversations(websiteID, operation)`
|
|
2939
|
+
* <details>
|
|
2940
|
+
<summary>See Example</summary>
|
|
2941
|
+
|
|
2942
|
+
```javascript
|
|
2943
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2944
|
+
|
|
2945
|
+
var operation = {
|
|
2946
|
+
"sessions": [
|
|
2947
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2948
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2949
|
+
],
|
|
2950
|
+
|
|
2951
|
+
"assigned": {
|
|
2952
|
+
"user_id": "a4c32c68-be91-4e29-b97e-b3b6af886eaa"
|
|
2953
|
+
}
|
|
2954
|
+
};
|
|
2955
|
+
|
|
2956
|
+
CrispClient.website.batchRoutingConversations(websiteID, operation);
|
|
2957
|
+
```
|
|
2958
|
+
</details>
|
|
2959
|
+
|
|
2960
|
+
* **Batch Inbox Conversations**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-inbox-items)
|
|
2961
|
+
* `CrispClient.website.batchInboxConversations(websiteID, operation)`
|
|
2962
|
+
* <details>
|
|
2963
|
+
<summary>See Example</summary>
|
|
2964
|
+
|
|
2965
|
+
```javascript
|
|
2966
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
2967
|
+
|
|
2968
|
+
var operation = {
|
|
2969
|
+
"sessions": [
|
|
2970
|
+
"session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
|
|
2971
|
+
"session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
|
|
2972
|
+
],
|
|
2973
|
+
|
|
2974
|
+
"inbox_id": "d42e8b3b-ea8f-4e79-a9f8-d0e467fc1c31"
|
|
2975
|
+
};
|
|
2976
|
+
|
|
2977
|
+
CrispClient.website.batchInboxConversations(websiteID, operation);
|
|
2978
|
+
```
|
|
2979
|
+
</details>
|
|
2980
|
+
|
|
2856
2981
|
|
|
2857
2982
|
* #### **Website Inbox**
|
|
2858
2983
|
* **List Inboxes**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-website-inboxes)
|
|
@@ -3379,6 +3504,20 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
3379
3504
|
</details>
|
|
3380
3505
|
|
|
3381
3506
|
|
|
3507
|
+
* #### **Website Connect**
|
|
3508
|
+
* **Get Connect Endpoints**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-website-connect-endpoints)
|
|
3509
|
+
* `CrispClient.website.getConnectEndpoints(websiteID)`
|
|
3510
|
+
* <details>
|
|
3511
|
+
<summary>See Example</summary>
|
|
3512
|
+
|
|
3513
|
+
```javascript
|
|
3514
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3515
|
+
|
|
3516
|
+
CrispClient.website.getConnectEndpoints(websiteID);
|
|
3517
|
+
```
|
|
3518
|
+
</details>
|
|
3519
|
+
|
|
3520
|
+
|
|
3382
3521
|
### Plugin
|
|
3383
3522
|
|
|
3384
3523
|
* #### **Plugin Connect**
|
package/dist/crisp.js
CHANGED
|
@@ -9,6 +9,25 @@ export type WebsiteBatchConversationsOperation = {
|
|
|
9
9
|
inbox_id?: string;
|
|
10
10
|
sessions?: string[];
|
|
11
11
|
};
|
|
12
|
+
export type WebsiteBatchReportOperation = {
|
|
13
|
+
sessions: string[];
|
|
14
|
+
flag: string;
|
|
15
|
+
};
|
|
16
|
+
export type WebsiteBatchBlockOperation = {
|
|
17
|
+
sessions: string[];
|
|
18
|
+
blocked: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type WebsiteBatchRoutingOperationAssigned = {
|
|
21
|
+
user_id: string;
|
|
22
|
+
};
|
|
23
|
+
export type WebsiteBatchRoutingOperation = {
|
|
24
|
+
sessions: string[];
|
|
25
|
+
assigned: WebsiteBatchRoutingOperationAssigned | null;
|
|
26
|
+
};
|
|
27
|
+
export type WebsiteBatchInboxOperation = {
|
|
28
|
+
sessions: string[];
|
|
29
|
+
inbox_id: string | null;
|
|
30
|
+
};
|
|
12
31
|
export type WebsiteBatchPeopleOperationInner = {
|
|
13
32
|
profiles?: string[];
|
|
14
33
|
search?: string;
|
|
@@ -24,6 +43,10 @@ declare class WebsiteBatch extends BaseResource {
|
|
|
24
43
|
* Batch Resolve Conversations
|
|
25
44
|
*/
|
|
26
45
|
batchResolveConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* Batch Unresolve Conversations
|
|
48
|
+
*/
|
|
49
|
+
batchUnresolveConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
27
50
|
/**
|
|
28
51
|
* Batch Read Conversations
|
|
29
52
|
* @memberof WebsiteBatch
|
|
@@ -34,6 +57,10 @@ declare class WebsiteBatch extends BaseResource {
|
|
|
34
57
|
* @return {Promise}
|
|
35
58
|
*/
|
|
36
59
|
batchReadConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* Batch Unread Conversations
|
|
62
|
+
*/
|
|
63
|
+
batchUnreadConversations(websiteID: string, operation: WebsiteBatchConversationsOperation): Promise<any>;
|
|
37
64
|
/**
|
|
38
65
|
* Batch Remove Conversations
|
|
39
66
|
* @memberof WebsiteBatch
|
|
@@ -54,6 +81,22 @@ declare class WebsiteBatch extends BaseResource {
|
|
|
54
81
|
* @return {Promise}
|
|
55
82
|
*/
|
|
56
83
|
batchRemovePeople(websiteID: string, people: WebsiteBatchPeopleOperationInner): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* Batch Report Conversations
|
|
86
|
+
*/
|
|
87
|
+
batchReportConversations(websiteID: string, operation: WebsiteBatchReportOperation): Promise<any>;
|
|
88
|
+
/**
|
|
89
|
+
* Batch Block Conversations
|
|
90
|
+
*/
|
|
91
|
+
batchBlockConversations(websiteID: string, operation: WebsiteBatchBlockOperation): Promise<any>;
|
|
92
|
+
/**
|
|
93
|
+
* Batch Routing Conversations
|
|
94
|
+
*/
|
|
95
|
+
batchRoutingConversations(websiteID: string, operation: WebsiteBatchRoutingOperation): Promise<any>;
|
|
96
|
+
/**
|
|
97
|
+
* Batch Inbox Conversations
|
|
98
|
+
*/
|
|
99
|
+
batchInboxConversations(websiteID: string, operation: WebsiteBatchInboxOperation): Promise<any>;
|
|
57
100
|
}
|
|
58
101
|
/**************************************************************************
|
|
59
102
|
* EXPORTS
|
|
@@ -28,6 +28,13 @@ class WebsiteBatch extends BaseResource_1.default {
|
|
|
28
28
|
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "resolve"]), null, operation);
|
|
29
29
|
}
|
|
30
30
|
;
|
|
31
|
+
/**
|
|
32
|
+
* Batch Unresolve Conversations
|
|
33
|
+
*/
|
|
34
|
+
batchUnresolveConversations(websiteID, operation) {
|
|
35
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "unresolve"]), null, operation);
|
|
36
|
+
}
|
|
37
|
+
;
|
|
31
38
|
/**
|
|
32
39
|
* Batch Read Conversations
|
|
33
40
|
* @memberof WebsiteBatch
|
|
@@ -41,6 +48,13 @@ class WebsiteBatch extends BaseResource_1.default {
|
|
|
41
48
|
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "read"]), null, operation);
|
|
42
49
|
}
|
|
43
50
|
;
|
|
51
|
+
/**
|
|
52
|
+
* Batch Unread Conversations
|
|
53
|
+
*/
|
|
54
|
+
batchUnreadConversations(websiteID, operation) {
|
|
55
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "unread"]), null, operation);
|
|
56
|
+
}
|
|
57
|
+
;
|
|
44
58
|
/**
|
|
45
59
|
* Batch Remove Conversations
|
|
46
60
|
* @memberof WebsiteBatch
|
|
@@ -69,6 +83,34 @@ class WebsiteBatch extends BaseResource_1.default {
|
|
|
69
83
|
});
|
|
70
84
|
}
|
|
71
85
|
;
|
|
86
|
+
/**
|
|
87
|
+
* Batch Report Conversations
|
|
88
|
+
*/
|
|
89
|
+
batchReportConversations(websiteID, operation) {
|
|
90
|
+
return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "batch", "report"]), null, operation);
|
|
91
|
+
}
|
|
92
|
+
;
|
|
93
|
+
/**
|
|
94
|
+
* Batch Block Conversations
|
|
95
|
+
*/
|
|
96
|
+
batchBlockConversations(websiteID, operation) {
|
|
97
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "block"]), null, operation);
|
|
98
|
+
}
|
|
99
|
+
;
|
|
100
|
+
/**
|
|
101
|
+
* Batch Routing Conversations
|
|
102
|
+
*/
|
|
103
|
+
batchRoutingConversations(websiteID, operation) {
|
|
104
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "routing"]), null, operation);
|
|
105
|
+
}
|
|
106
|
+
;
|
|
107
|
+
/**
|
|
108
|
+
* Batch Inbox Conversations
|
|
109
|
+
*/
|
|
110
|
+
batchInboxConversations(websiteID, operation) {
|
|
111
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "batch", "inbox"]), null, operation);
|
|
112
|
+
}
|
|
113
|
+
;
|
|
72
114
|
}
|
|
73
115
|
/**************************************************************************
|
|
74
116
|
* EXPORTS
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* TYPES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
export type WebsiteConnectEndpoints = {
|
|
9
|
+
socket?: WebsiteConnectEndpointsSocket;
|
|
10
|
+
rescue?: WebsiteConnectEndpointsRescue;
|
|
11
|
+
};
|
|
12
|
+
export type WebsiteConnectEndpointsSocket = {
|
|
13
|
+
app?: string;
|
|
14
|
+
stream?: string;
|
|
15
|
+
};
|
|
16
|
+
export type WebsiteConnectEndpointsRescue = {
|
|
17
|
+
socket?: WebsiteConnectEndpointsSocket;
|
|
18
|
+
};
|
|
19
|
+
/**************************************************************************
|
|
20
|
+
* CLASSES
|
|
21
|
+
***************************************************************************/
|
|
22
|
+
/**
|
|
23
|
+
* Crisp WebsiteConnect Resource
|
|
24
|
+
*/
|
|
25
|
+
declare class WebsiteConnect extends BaseResource {
|
|
26
|
+
/**
|
|
27
|
+
* Get Connect Endpoints
|
|
28
|
+
*/
|
|
29
|
+
getConnectEndpoints(websiteID: string): Promise<WebsiteConnectEndpoints>;
|
|
30
|
+
}
|
|
31
|
+
/**************************************************************************
|
|
32
|
+
* EXPORTS
|
|
33
|
+
***************************************************************************/
|
|
34
|
+
export default WebsiteConnect;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This file is part of node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2026 Crisp IM SAS
|
|
6
|
+
* All rights belong to Crisp IM SAS
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/**************************************************************************
|
|
13
|
+
* IMPORTS
|
|
14
|
+
***************************************************************************/
|
|
15
|
+
// PROJECT: RESOURCES
|
|
16
|
+
const BaseResource_1 = __importDefault(require("./BaseResource"));
|
|
17
|
+
/**************************************************************************
|
|
18
|
+
* CLASSES
|
|
19
|
+
***************************************************************************/
|
|
20
|
+
/**
|
|
21
|
+
* Crisp WebsiteConnect Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteConnect extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Get Connect Endpoints
|
|
26
|
+
*/
|
|
27
|
+
getConnectEndpoints(websiteID) {
|
|
28
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
29
|
+
"website", websiteID, "connect", "endpoints"
|
|
30
|
+
]));
|
|
31
|
+
}
|
|
32
|
+
;
|
|
33
|
+
}
|
|
34
|
+
/**************************************************************************
|
|
35
|
+
* EXPORTS
|
|
36
|
+
***************************************************************************/
|
|
37
|
+
exports.default = WebsiteConnect;
|
|
@@ -12,6 +12,7 @@ export * from "./WebsiteAvailability";
|
|
|
12
12
|
export * from "./WebsiteBase";
|
|
13
13
|
export * from "./WebsiteBatch";
|
|
14
14
|
export * from "./WebsiteCampaign";
|
|
15
|
+
export * from "./WebsiteConnect";
|
|
15
16
|
export * from "./WebsiteConversation";
|
|
16
17
|
export * from "./WebsiteHelpdesk";
|
|
17
18
|
export * from "./WebsiteInbox";
|
package/dist/resources/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./WebsiteAvailability"), exports);
|
|
|
34
34
|
__exportStar(require("./WebsiteBase"), exports);
|
|
35
35
|
__exportStar(require("./WebsiteBatch"), exports);
|
|
36
36
|
__exportStar(require("./WebsiteCampaign"), exports);
|
|
37
|
+
__exportStar(require("./WebsiteConnect"), exports);
|
|
37
38
|
__exportStar(require("./WebsiteConversation"), exports);
|
|
38
39
|
__exportStar(require("./WebsiteHelpdesk"), exports);
|
|
39
40
|
__exportStar(require("./WebsiteInbox"), exports);
|
|
@@ -6,6 +6,7 @@ import WebsiteAnalytics from "../resources/WebsiteAnalytics";
|
|
|
6
6
|
import WebsiteAvailability from "../resources/WebsiteAvailability";
|
|
7
7
|
import WebsiteBatch from "../resources/WebsiteBatch";
|
|
8
8
|
import WebsiteCampaign from "../resources/WebsiteCampaign";
|
|
9
|
+
import WebsiteConnect from "../resources/WebsiteConnect";
|
|
9
10
|
import WebsiteConversation from "../resources/WebsiteConversation";
|
|
10
11
|
import WebsiteHelpdesk from "../resources/WebsiteHelpdesk";
|
|
11
12
|
import WebsiteInbox from "../resources/WebsiteInbox";
|
|
@@ -26,6 +27,6 @@ declare class WebsiteService {
|
|
|
26
27
|
/**************************************************************************
|
|
27
28
|
* EXPORTS
|
|
28
29
|
***************************************************************************/
|
|
29
|
-
export interface WebsiteServiceInterface extends WebsiteBase, WebsiteAnalytics, WebsiteAvailability, WebsiteBatch, WebsiteCampaign, WebsiteConversation, WebsiteHelpdesk, WebsiteInbox, WebsiteOperator, WebsitePeople, WebsiteSettings, WebsiteVerify, WebsiteVisitors {
|
|
30
|
+
export interface WebsiteServiceInterface extends WebsiteBase, WebsiteAnalytics, WebsiteAvailability, WebsiteBatch, WebsiteCampaign, WebsiteConnect, WebsiteConversation, WebsiteHelpdesk, WebsiteInbox, WebsiteOperator, WebsitePeople, WebsiteSettings, WebsiteVerify, WebsiteVisitors {
|
|
30
31
|
}
|
|
31
32
|
export default WebsiteService;
|
package/dist/services/website.js
CHANGED
|
@@ -18,6 +18,7 @@ const WebsiteAnalytics_1 = __importDefault(require("../resources/WebsiteAnalytic
|
|
|
18
18
|
const WebsiteAvailability_1 = __importDefault(require("../resources/WebsiteAvailability"));
|
|
19
19
|
const WebsiteBatch_1 = __importDefault(require("../resources/WebsiteBatch"));
|
|
20
20
|
const WebsiteCampaign_1 = __importDefault(require("../resources/WebsiteCampaign"));
|
|
21
|
+
const WebsiteConnect_1 = __importDefault(require("../resources/WebsiteConnect"));
|
|
21
22
|
const WebsiteConversation_1 = __importDefault(require("../resources/WebsiteConversation"));
|
|
22
23
|
const WebsiteHelpdesk_1 = __importDefault(require("../resources/WebsiteHelpdesk"));
|
|
23
24
|
const WebsiteInbox_1 = __importDefault(require("../resources/WebsiteInbox"));
|
|
@@ -41,6 +42,7 @@ class WebsiteService {
|
|
|
41
42
|
WebsiteAvailability_1.default,
|
|
42
43
|
WebsiteBatch_1.default,
|
|
43
44
|
WebsiteCampaign_1.default,
|
|
45
|
+
WebsiteConnect_1.default,
|
|
44
46
|
WebsiteConversation_1.default,
|
|
45
47
|
WebsiteHelpdesk_1.default,
|
|
46
48
|
WebsiteInbox_1.default,
|
|
@@ -21,6 +21,30 @@ export type WebsiteBatchConversationsOperation = {
|
|
|
21
21
|
sessions?: string[];
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
export type WebsiteBatchReportOperation = {
|
|
25
|
+
sessions: string[];
|
|
26
|
+
flag: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type WebsiteBatchBlockOperation = {
|
|
30
|
+
sessions: string[];
|
|
31
|
+
blocked: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type WebsiteBatchRoutingOperationAssigned = {
|
|
35
|
+
user_id: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type WebsiteBatchRoutingOperation = {
|
|
39
|
+
sessions: string[];
|
|
40
|
+
assigned: WebsiteBatchRoutingOperationAssigned | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type WebsiteBatchInboxOperation = {
|
|
44
|
+
sessions: string[];
|
|
45
|
+
inbox_id: string | null;
|
|
46
|
+
}
|
|
47
|
+
|
|
24
48
|
export type WebsiteBatchPeopleOperationInner = {
|
|
25
49
|
profiles?: string[];
|
|
26
50
|
search?: string;
|
|
@@ -47,6 +71,19 @@ class WebsiteBatch extends BaseResource {
|
|
|
47
71
|
);
|
|
48
72
|
};
|
|
49
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Batch Unresolve Conversations
|
|
76
|
+
*/
|
|
77
|
+
batchUnresolveConversations(
|
|
78
|
+
websiteID: string, operation: WebsiteBatchConversationsOperation
|
|
79
|
+
) {
|
|
80
|
+
return this.crisp.patch(
|
|
81
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "unresolve"]),
|
|
82
|
+
|
|
83
|
+
null, operation
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
50
87
|
/**
|
|
51
88
|
* Batch Read Conversations
|
|
52
89
|
* @memberof WebsiteBatch
|
|
@@ -66,6 +103,19 @@ class WebsiteBatch extends BaseResource {
|
|
|
66
103
|
);
|
|
67
104
|
};
|
|
68
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Batch Unread Conversations
|
|
108
|
+
*/
|
|
109
|
+
batchUnreadConversations(
|
|
110
|
+
websiteID: string, operation: WebsiteBatchConversationsOperation
|
|
111
|
+
) {
|
|
112
|
+
return this.crisp.patch(
|
|
113
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "unread"]),
|
|
114
|
+
|
|
115
|
+
null, operation
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
69
119
|
/**
|
|
70
120
|
* Batch Remove Conversations
|
|
71
121
|
* @memberof WebsiteBatch
|
|
@@ -107,6 +157,58 @@ class WebsiteBatch extends BaseResource {
|
|
|
107
157
|
}
|
|
108
158
|
);
|
|
109
159
|
};
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Batch Report Conversations
|
|
163
|
+
*/
|
|
164
|
+
batchReportConversations(
|
|
165
|
+
websiteID: string, operation: WebsiteBatchReportOperation
|
|
166
|
+
) {
|
|
167
|
+
return this.crisp.post(
|
|
168
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "report"]),
|
|
169
|
+
|
|
170
|
+
null, operation
|
|
171
|
+
);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Batch Block Conversations
|
|
176
|
+
*/
|
|
177
|
+
batchBlockConversations(
|
|
178
|
+
websiteID: string, operation: WebsiteBatchBlockOperation
|
|
179
|
+
) {
|
|
180
|
+
return this.crisp.patch(
|
|
181
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "block"]),
|
|
182
|
+
|
|
183
|
+
null, operation
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Batch Routing Conversations
|
|
189
|
+
*/
|
|
190
|
+
batchRoutingConversations(
|
|
191
|
+
websiteID: string, operation: WebsiteBatchRoutingOperation
|
|
192
|
+
) {
|
|
193
|
+
return this.crisp.patch(
|
|
194
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "routing"]),
|
|
195
|
+
|
|
196
|
+
null, operation
|
|
197
|
+
);
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Batch Inbox Conversations
|
|
202
|
+
*/
|
|
203
|
+
batchInboxConversations(
|
|
204
|
+
websiteID: string, operation: WebsiteBatchInboxOperation
|
|
205
|
+
) {
|
|
206
|
+
return this.crisp.patch(
|
|
207
|
+
this.crisp.prepareRestUrl(["website", websiteID, "batch", "inbox"]),
|
|
208
|
+
|
|
209
|
+
null, operation
|
|
210
|
+
);
|
|
211
|
+
};
|
|
110
212
|
}
|
|
111
213
|
|
|
112
214
|
/**************************************************************************
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of node-crisp-api
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2026 Crisp IM SAS
|
|
5
|
+
* All rights belong to Crisp IM SAS
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**************************************************************************
|
|
9
|
+
* IMPORTS
|
|
10
|
+
***************************************************************************/
|
|
11
|
+
|
|
12
|
+
// PROJECT: RESOURCES
|
|
13
|
+
import BaseResource from "./BaseResource";
|
|
14
|
+
|
|
15
|
+
/**************************************************************************
|
|
16
|
+
* TYPES
|
|
17
|
+
***************************************************************************/
|
|
18
|
+
|
|
19
|
+
export type WebsiteConnectEndpoints = {
|
|
20
|
+
socket?: WebsiteConnectEndpointsSocket;
|
|
21
|
+
rescue?: WebsiteConnectEndpointsRescue;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type WebsiteConnectEndpointsSocket = {
|
|
25
|
+
app?: string;
|
|
26
|
+
stream?: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type WebsiteConnectEndpointsRescue = {
|
|
30
|
+
socket?: WebsiteConnectEndpointsSocket;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**************************************************************************
|
|
34
|
+
* CLASSES
|
|
35
|
+
***************************************************************************/
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Crisp WebsiteConnect Resource
|
|
39
|
+
*/
|
|
40
|
+
class WebsiteConnect extends BaseResource {
|
|
41
|
+
/**
|
|
42
|
+
* Get Connect Endpoints
|
|
43
|
+
*/
|
|
44
|
+
getConnectEndpoints(websiteID: string): Promise<WebsiteConnectEndpoints> {
|
|
45
|
+
return this.crisp.get(
|
|
46
|
+
this.crisp.prepareRestUrl([
|
|
47
|
+
"website", websiteID, "connect", "endpoints"
|
|
48
|
+
])
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**************************************************************************
|
|
54
|
+
* EXPORTS
|
|
55
|
+
***************************************************************************/
|
|
56
|
+
|
|
57
|
+
export default WebsiteConnect;
|
package/lib/resources/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from "./WebsiteAvailability";
|
|
|
20
20
|
export * from "./WebsiteBase";
|
|
21
21
|
export * from "./WebsiteBatch";
|
|
22
22
|
export * from "./WebsiteCampaign";
|
|
23
|
+
export * from "./WebsiteConnect";
|
|
23
24
|
export * from "./WebsiteConversation";
|
|
24
25
|
export * from "./WebsiteHelpdesk";
|
|
25
26
|
export * from "./WebsiteInbox";
|
package/lib/services/website.ts
CHANGED
|
@@ -15,6 +15,7 @@ import WebsiteAnalytics from "@/resources/WebsiteAnalytics";
|
|
|
15
15
|
import WebsiteAvailability from "@/resources/WebsiteAvailability";
|
|
16
16
|
import WebsiteBatch from "@/resources/WebsiteBatch";
|
|
17
17
|
import WebsiteCampaign from "@/resources/WebsiteCampaign";
|
|
18
|
+
import WebsiteConnect from "@/resources/WebsiteConnect";
|
|
18
19
|
import WebsiteConversation from "@/resources/WebsiteConversation";
|
|
19
20
|
import WebsiteHelpdesk from "@/resources/WebsiteHelpdesk";
|
|
20
21
|
import WebsiteInbox from "@/resources/WebsiteInbox";
|
|
@@ -39,6 +40,7 @@ class WebsiteService {
|
|
|
39
40
|
WebsiteAvailability,
|
|
40
41
|
WebsiteBatch,
|
|
41
42
|
WebsiteCampaign,
|
|
43
|
+
WebsiteConnect,
|
|
42
44
|
WebsiteConversation,
|
|
43
45
|
WebsiteHelpdesk,
|
|
44
46
|
WebsiteInbox,
|
|
@@ -60,6 +62,7 @@ export interface WebsiteServiceInterface extends
|
|
|
60
62
|
WebsiteAvailability,
|
|
61
63
|
WebsiteBatch,
|
|
62
64
|
WebsiteCampaign,
|
|
65
|
+
WebsiteConnect,
|
|
63
66
|
WebsiteConversation,
|
|
64
67
|
WebsiteHelpdesk,
|
|
65
68
|
WebsiteInbox,
|
package/package.json
CHANGED