crisp-api 10.6.0 → 10.7.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 +16 -0
- package/EXAMPLES.md +9 -0
- package/README.md +14 -1
- package/dist/crisp.js +1 -1
- package/dist/resources/PluginConnect.d.ts +9 -8
- package/dist/resources/WebsiteConversation.d.ts +17 -0
- package/dist/resources/WebsiteConversation.js +9 -0
- package/dist/resources/WebsiteInbox.d.ts +4 -1
- package/lib/resources/PluginConnect.ts +10 -9
- package/lib/resources/WebsiteConversation.ts +24 -0
- package/lib/resources/WebsiteInbox.ts +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v10.7.0
|
|
5
|
+
|
|
6
|
+
### New Features
|
|
7
|
+
|
|
8
|
+
* Added the new `CrispClient.website.getConversationRelations` method.
|
|
9
|
+
|
|
10
|
+
### Changes
|
|
11
|
+
|
|
12
|
+
* Added optional `properties` on all message types.
|
|
13
|
+
|
|
14
|
+
## v10.6.1
|
|
15
|
+
|
|
16
|
+
### Changes
|
|
17
|
+
|
|
18
|
+
* Added missing `PluginConnectWebsitePlan` type in the `PluginConnect` resource.
|
|
19
|
+
|
|
4
20
|
## v10.6.0
|
|
5
21
|
|
|
6
22
|
### New Features
|
package/EXAMPLES.md
CHANGED
|
@@ -374,6 +374,15 @@ CrispClient.website.changeConversationState(websiteID, sessionID, state);
|
|
|
374
374
|
|
|
375
375
|
=========================
|
|
376
376
|
|
|
377
|
+
https://docs.crisp.chat/references/rest-api/v1/#get-conversation-relations
|
|
378
|
+
|
|
379
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
380
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
381
|
+
|
|
382
|
+
CrispClient.website.getConversationRelations(websiteID, sessionID);
|
|
383
|
+
|
|
384
|
+
=========================
|
|
385
|
+
|
|
377
386
|
https://docs.crisp.chat/references/rest-api/v1/#get-conversation-participants
|
|
378
387
|
|
|
379
388
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, ac
|
|
|
6
6
|
|
|
7
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: 09/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
|
|
@@ -694,6 +694,19 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
694
694
|
```
|
|
695
695
|
</details>
|
|
696
696
|
|
|
697
|
+
* **Get Conversation Relations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-relations)
|
|
698
|
+
* `CrispClient.website.getConversationRelations(websiteID, sessionID)`
|
|
699
|
+
* <details>
|
|
700
|
+
<summary>See Example</summary>
|
|
701
|
+
|
|
702
|
+
```javascript
|
|
703
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
704
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
705
|
+
|
|
706
|
+
CrispClient.website.getConversationRelations(websiteID, sessionID);
|
|
707
|
+
```
|
|
708
|
+
</details>
|
|
709
|
+
|
|
697
710
|
* **Get Conversation Participants** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-participants)
|
|
698
711
|
* `CrispClient.website.getConversationParticipants(websiteID, sessionID)`
|
|
699
712
|
* <details>
|
package/dist/crisp.js
CHANGED
|
@@ -8,17 +8,18 @@ import BaseResource from "./BaseResource";
|
|
|
8
8
|
export type PluginConnectAccount = {
|
|
9
9
|
plugin_id?: string;
|
|
10
10
|
};
|
|
11
|
-
export type
|
|
12
|
-
website_id?: string;
|
|
13
|
-
token?: string;
|
|
14
|
-
settings?: object;
|
|
15
|
-
};
|
|
16
|
-
export type PluginConnectWebsitesSince = {
|
|
11
|
+
export type PluginConnectWebsite = {
|
|
17
12
|
website_id?: string;
|
|
18
13
|
token?: string;
|
|
19
14
|
settings?: object;
|
|
15
|
+
plan?: PluginConnectWebsitePlan;
|
|
20
16
|
difference?: string;
|
|
21
17
|
};
|
|
18
|
+
export type PluginConnectWebsitePlan = {
|
|
19
|
+
id?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
trialing?: boolean;
|
|
22
|
+
};
|
|
22
23
|
export type PluginConnectEndpoints = {
|
|
23
24
|
socket?: PluginConnectEndpointsSocket;
|
|
24
25
|
rescue?: PluginConnectEndpointsRescue;
|
|
@@ -47,11 +48,11 @@ declare class PluginConnect extends BaseResource {
|
|
|
47
48
|
/**
|
|
48
49
|
* List All Connect Websites
|
|
49
50
|
*/
|
|
50
|
-
listAllConnectWebsites(pageNumber: number, filterConfigured: boolean, includePlan: boolean): Promise<
|
|
51
|
+
listAllConnectWebsites(pageNumber: number, filterConfigured: boolean, includePlan: boolean): Promise<PluginConnectWebsite[]>;
|
|
51
52
|
/**
|
|
52
53
|
* List Connect Websites Since
|
|
53
54
|
*/
|
|
54
|
-
listConnectWebsitesSince(dateSince: string, filterConfigured: boolean, includePlan: boolean): Promise<
|
|
55
|
+
listConnectWebsitesSince(dateSince: string, filterConfigured: boolean, includePlan: boolean): Promise<PluginConnectWebsite[]>;
|
|
55
56
|
/**
|
|
56
57
|
* Get Connect Endpoints
|
|
57
58
|
*/
|
|
@@ -71,6 +71,13 @@ export interface ConversationVerification {
|
|
|
71
71
|
method?: string;
|
|
72
72
|
annotation?: string;
|
|
73
73
|
}
|
|
74
|
+
export interface ConversationRelations {
|
|
75
|
+
conversations?: ConversationRelationsConversations;
|
|
76
|
+
}
|
|
77
|
+
export interface ConversationRelationsConversations {
|
|
78
|
+
parent?: string | null;
|
|
79
|
+
children?: string[];
|
|
80
|
+
}
|
|
74
81
|
export interface ConversationParticipant {
|
|
75
82
|
type?: string;
|
|
76
83
|
target?: string;
|
|
@@ -159,6 +166,9 @@ export interface ConversationMessage {
|
|
|
159
166
|
user?: ConversationMessageUser;
|
|
160
167
|
references?: ConversationMessageReference[];
|
|
161
168
|
original?: ConversationMessageOriginal;
|
|
169
|
+
properties?: {
|
|
170
|
+
[key: string]: string | number | boolean;
|
|
171
|
+
};
|
|
162
172
|
}
|
|
163
173
|
export interface ConversationFileMessageContent {
|
|
164
174
|
name?: string;
|
|
@@ -256,6 +266,9 @@ export interface ConversationMessageNewBase {
|
|
|
256
266
|
user?: ConversationMessageUser;
|
|
257
267
|
references?: ConversationMessageReference[];
|
|
258
268
|
original?: ConversationMessageOriginal;
|
|
269
|
+
properties?: {
|
|
270
|
+
[key: string]: string | number | boolean;
|
|
271
|
+
};
|
|
259
272
|
timestamp?: number;
|
|
260
273
|
stealth?: boolean;
|
|
261
274
|
translated?: boolean;
|
|
@@ -573,6 +586,10 @@ declare class WebsiteConversation extends BaseResource {
|
|
|
573
586
|
* Change Conversation State
|
|
574
587
|
*/
|
|
575
588
|
changeConversationState(websiteID: string, sessionID: string, state: ConversationState): Promise<any>;
|
|
589
|
+
/**
|
|
590
|
+
* Get Conversation Relations
|
|
591
|
+
*/
|
|
592
|
+
getConversationRelations(websiteID: string, sessionID: string): Promise<ConversationRelations>;
|
|
576
593
|
/**
|
|
577
594
|
* Get Conversation Participants
|
|
578
595
|
*/
|
|
@@ -342,6 +342,15 @@ class WebsiteConversation extends BaseResource_1.default {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
;
|
|
345
|
+
/**
|
|
346
|
+
* Get Conversation Relations
|
|
347
|
+
*/
|
|
348
|
+
getConversationRelations(websiteID, sessionID) {
|
|
349
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
350
|
+
"website", websiteID, "conversation", sessionID, "relations"
|
|
351
|
+
]));
|
|
352
|
+
}
|
|
353
|
+
;
|
|
345
354
|
/**
|
|
346
355
|
* Get Conversation Participants
|
|
347
356
|
*/
|
|
@@ -21,6 +21,9 @@ export type WebsiteInboxCondition = {
|
|
|
21
21
|
operator?: "eq" | "neq" | "gte" | "lte" | "gt" | "lt";
|
|
22
22
|
query?: string[];
|
|
23
23
|
};
|
|
24
|
+
export type WebsiteInboxNew = {
|
|
25
|
+
inbox_id?: string;
|
|
26
|
+
};
|
|
24
27
|
export type WebsiteInboxOrders = {
|
|
25
28
|
orders?: WebsiteInboxOrder[];
|
|
26
29
|
};
|
|
@@ -46,7 +49,7 @@ declare class WebsiteInboxService extends BaseResource {
|
|
|
46
49
|
/**
|
|
47
50
|
* Create A New Inbox
|
|
48
51
|
*/
|
|
49
|
-
createNewInbox(websiteID: string, inbox: WebsiteInbox): Promise<
|
|
52
|
+
createNewInbox(websiteID: string, inbox: WebsiteInbox): Promise<WebsiteInboxNew>;
|
|
50
53
|
/**
|
|
51
54
|
* Check If Inbox Exists
|
|
52
55
|
*/
|
|
@@ -20,19 +20,20 @@ export type PluginConnectAccount = {
|
|
|
20
20
|
plugin_id?: string;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
export type
|
|
24
|
-
website_id?: string;
|
|
25
|
-
token?: string;
|
|
26
|
-
settings?: object;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type PluginConnectWebsitesSince = {
|
|
23
|
+
export type PluginConnectWebsite = {
|
|
30
24
|
website_id?: string;
|
|
31
25
|
token?: string;
|
|
32
26
|
settings?: object;
|
|
27
|
+
plan?: PluginConnectWebsitePlan;
|
|
33
28
|
difference?: string;
|
|
34
29
|
}
|
|
35
30
|
|
|
31
|
+
export type PluginConnectWebsitePlan = {
|
|
32
|
+
id?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
trialing?: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
36
37
|
export type PluginConnectEndpoints = {
|
|
37
38
|
socket?: PluginConnectEndpointsSocket;
|
|
38
39
|
rescue?: PluginConnectEndpointsRescue;
|
|
@@ -79,7 +80,7 @@ class PluginConnect extends BaseResource {
|
|
|
79
80
|
*/
|
|
80
81
|
listAllConnectWebsites(
|
|
81
82
|
pageNumber: number, filterConfigured: boolean, includePlan: boolean
|
|
82
|
-
): Promise<
|
|
83
|
+
): Promise<PluginConnectWebsite[]> {
|
|
83
84
|
// Generate query
|
|
84
85
|
let query = {
|
|
85
86
|
filter_configured: (
|
|
@@ -105,7 +106,7 @@ class PluginConnect extends BaseResource {
|
|
|
105
106
|
*/
|
|
106
107
|
listConnectWebsitesSince(
|
|
107
108
|
dateSince: string, filterConfigured: boolean, includePlan: boolean
|
|
108
|
-
): Promise<
|
|
109
|
+
): Promise<PluginConnectWebsite[]> {
|
|
109
110
|
// Generate query
|
|
110
111
|
let query = {
|
|
111
112
|
filter_configured: (
|
|
@@ -92,6 +92,15 @@ export interface ConversationVerification {
|
|
|
92
92
|
annotation?: string;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
export interface ConversationRelations {
|
|
96
|
+
conversations?: ConversationRelationsConversations;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface ConversationRelationsConversations {
|
|
100
|
+
parent?: string|null;
|
|
101
|
+
children?: string[];
|
|
102
|
+
}
|
|
103
|
+
|
|
95
104
|
export interface ConversationParticipant {
|
|
96
105
|
type?: string;
|
|
97
106
|
target?: string;
|
|
@@ -213,6 +222,7 @@ export interface ConversationMessage {
|
|
|
213
222
|
user?: ConversationMessageUser;
|
|
214
223
|
references?: ConversationMessageReference[];
|
|
215
224
|
original?: ConversationMessageOriginal;
|
|
225
|
+
properties?: { [key: string]: string|number|boolean };
|
|
216
226
|
}
|
|
217
227
|
|
|
218
228
|
export interface ConversationFileMessageContent {
|
|
@@ -338,6 +348,7 @@ export interface ConversationMessageNewBase {
|
|
|
338
348
|
user?: ConversationMessageUser;
|
|
339
349
|
references?: ConversationMessageReference[];
|
|
340
350
|
original?: ConversationMessageOriginal;
|
|
351
|
+
properties?: { [key: string]: string|number|boolean };
|
|
341
352
|
timestamp?: number;
|
|
342
353
|
stealth?: boolean;
|
|
343
354
|
translated?: boolean;
|
|
@@ -1061,6 +1072,19 @@ class WebsiteConversation extends BaseResource {
|
|
|
1061
1072
|
);
|
|
1062
1073
|
};
|
|
1063
1074
|
|
|
1075
|
+
/**
|
|
1076
|
+
* Get Conversation Relations
|
|
1077
|
+
*/
|
|
1078
|
+
getConversationRelations(
|
|
1079
|
+
websiteID: string, sessionID: string
|
|
1080
|
+
): Promise<ConversationRelations> {
|
|
1081
|
+
return this.crisp.get(
|
|
1082
|
+
this.crisp.prepareRestUrl([
|
|
1083
|
+
"website", websiteID, "conversation", sessionID, "relations"
|
|
1084
|
+
])
|
|
1085
|
+
);
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1064
1088
|
/**
|
|
1065
1089
|
* Get Conversation Participants
|
|
1066
1090
|
*/
|
|
@@ -34,6 +34,10 @@ export type WebsiteInboxCondition = {
|
|
|
34
34
|
query?: string[];
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
+
export type WebsiteInboxNew = {
|
|
38
|
+
inbox_id?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
37
41
|
export type WebsiteInboxOrders = {
|
|
38
42
|
orders?: WebsiteInboxOrder[];
|
|
39
43
|
}
|
|
@@ -80,7 +84,9 @@ class WebsiteInboxService extends BaseResource {
|
|
|
80
84
|
/**
|
|
81
85
|
* Create A New Inbox
|
|
82
86
|
*/
|
|
83
|
-
createNewInbox(
|
|
87
|
+
createNewInbox(
|
|
88
|
+
websiteID: string, inbox: WebsiteInbox
|
|
89
|
+
): Promise<WebsiteInboxNew> {
|
|
84
90
|
return this.crisp.post(
|
|
85
91
|
this.crisp.prepareRestUrl(["website", websiteID, "inbox"]), null, inbox
|
|
86
92
|
);
|
package/package.json
CHANGED