crisp-api 10.10.5 → 10.11.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 +13 -0
- package/EXAMPLES.md +74 -0
- package/README.md +101 -0
- package/dist/crisp.js +16 -23
- package/dist/events/Events.d.ts +6 -2
- package/dist/resources/PluginConnect.js +3 -3
- package/dist/resources/WebsiteBase.d.ts +0 -10
- package/dist/resources/WebsiteBase.js +0 -10
- package/dist/resources/WebsiteBatch.d.ts +0 -18
- package/dist/resources/WebsiteBatch.js +0 -18
- package/dist/resources/WebsiteCampaign.d.ts +0 -1
- package/dist/resources/WebsiteCampaign.js +0 -1
- package/dist/resources/WebsiteConversation.js +17 -20
- package/dist/resources/WebsiteHelpdesk.d.ts +2 -2
- package/dist/resources/WebsiteHelpdesk.js +8 -15
- package/dist/resources/WebsiteInbox.d.ts +2 -0
- package/dist/resources/WebsitePeople.d.ts +1 -0
- package/dist/resources/WebsitePeople.js +1 -6
- package/dist/resources/WebsiteSettings.d.ts +6 -0
- package/dist/resources/WebsiteTeams.d.ts +54 -0
- package/dist/resources/WebsiteTeams.js +73 -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/eslint.config.mjs +13 -184
- package/lib/crisp.ts +17 -22
- package/lib/events/Events.ts +6 -2
- package/lib/resources/PluginConnect.ts +3 -3
- package/lib/resources/WebsiteBase.ts +0 -10
- package/lib/resources/WebsiteBatch.ts +0 -18
- package/lib/resources/WebsiteCampaign.ts +0 -1
- package/lib/resources/WebsiteConversation.ts +17 -20
- package/lib/resources/WebsiteHelpdesk.ts +8 -15
- package/lib/resources/WebsiteInbox.ts +2 -0
- package/lib/resources/WebsitePeople.ts +2 -6
- package/lib/resources/WebsiteSettings.ts +6 -0
- package/lib/resources/WebsiteTeams.ts +109 -0
- package/lib/resources/index.ts +1 -0
- package/lib/services/bucket.ts +1 -0
- package/lib/services/media.ts +1 -0
- package/lib/services/plan.ts +1 -0
- package/lib/services/website.ts +3 -0
- package/package.json +4 -4
|
@@ -436,12 +436,12 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
436
436
|
sectionId?: string
|
|
437
437
|
) {
|
|
438
438
|
// Generate body
|
|
439
|
-
|
|
439
|
+
const body = {
|
|
440
440
|
category_id: categoryId
|
|
441
441
|
};
|
|
442
442
|
|
|
443
443
|
if (sectionId !== undefined) {
|
|
444
|
-
// @ts-
|
|
444
|
+
// @ts-expect-error - sectionId is a string
|
|
445
445
|
body.section_id = sectionId;
|
|
446
446
|
}
|
|
447
447
|
|
|
@@ -739,7 +739,7 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
739
739
|
|
|
740
740
|
/**
|
|
741
741
|
* Save Helpdesk Locale Section
|
|
742
|
-
|
|
742
|
+
*/
|
|
743
743
|
saveHelpdeskLocaleSection(
|
|
744
744
|
websiteID: string, locale: string, categoryId: string, sectionId: string,
|
|
745
745
|
section: HelpdeskLocaleSection
|
|
@@ -796,15 +796,13 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
796
796
|
filterDateEnd = (filterDateEnd || null);
|
|
797
797
|
|
|
798
798
|
// Generate query
|
|
799
|
-
|
|
799
|
+
const query: Record<string, unknown> = {};
|
|
800
800
|
|
|
801
801
|
if (filterDateStart !== null) {
|
|
802
|
-
// @ts-ignore
|
|
803
802
|
query.filter_date_start = filterDateStart;
|
|
804
803
|
}
|
|
805
804
|
|
|
806
805
|
if (filterDateEnd !== null) {
|
|
807
|
-
// @ts-ignore
|
|
808
806
|
query.filter_date_end = filterDateEnd;
|
|
809
807
|
}
|
|
810
808
|
|
|
@@ -829,15 +827,13 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
829
827
|
filterDateEnd = (filterDateEnd || null);
|
|
830
828
|
|
|
831
829
|
// Generate query
|
|
832
|
-
|
|
830
|
+
const query: Record<string, unknown> = {};
|
|
833
831
|
|
|
834
832
|
if (filterDateStart !== null) {
|
|
835
|
-
// @ts-ignore
|
|
836
833
|
query.filter_date_start = filterDateStart;
|
|
837
834
|
}
|
|
838
835
|
|
|
839
836
|
if (filterDateEnd !== null) {
|
|
840
|
-
// @ts-ignore
|
|
841
837
|
query.filter_date_end = filterDateEnd;
|
|
842
838
|
}
|
|
843
839
|
|
|
@@ -953,7 +949,7 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
953
949
|
|
|
954
950
|
/**
|
|
955
951
|
* Resolve Helpdesk Settings
|
|
956
|
-
|
|
952
|
+
*/
|
|
957
953
|
resolveHelpdeskSettings(websiteID: string): Promise<HelpdeskSettings> {
|
|
958
954
|
return this.crisp.get(
|
|
959
955
|
this.crisp.prepareRestUrl(["website", websiteID, "helpdesk", "settings"])
|
|
@@ -987,15 +983,13 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
987
983
|
websiteID: string, basic: string, custom: string
|
|
988
984
|
) {
|
|
989
985
|
// Generate body
|
|
990
|
-
|
|
986
|
+
const body: Record<string, unknown> = {};
|
|
991
987
|
|
|
992
988
|
if (basic !== undefined) {
|
|
993
|
-
// @ts-ignore
|
|
994
989
|
body.basic = basic;
|
|
995
990
|
}
|
|
996
991
|
|
|
997
992
|
if (custom !== undefined) {
|
|
998
|
-
// @ts-ignore
|
|
999
993
|
body.custom = custom;
|
|
1000
994
|
}
|
|
1001
995
|
|
|
@@ -1013,10 +1007,9 @@ class WebsiteHelpdesk extends BaseResource {
|
|
|
1013
1007
|
custom = (custom || null);
|
|
1014
1008
|
|
|
1015
1009
|
// Generate query
|
|
1016
|
-
|
|
1010
|
+
const query: Record<string, unknown> = {};
|
|
1017
1011
|
|
|
1018
1012
|
if (custom !== null) {
|
|
1019
|
-
// @ts-ignore
|
|
1020
1013
|
query.custom = custom;
|
|
1021
1014
|
}
|
|
1022
1015
|
|
|
@@ -82,6 +82,7 @@ export interface PeopleProfileCardPerson {
|
|
|
82
82
|
export interface PeopleProfileCardPersonProfile {
|
|
83
83
|
type?: string;
|
|
84
84
|
handle?: string;
|
|
85
|
+
url?: string;
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
export interface PeopleProfileCardPersonEmployment {
|
|
@@ -294,30 +295,25 @@ class WebsitePeople extends BaseResource {
|
|
|
294
295
|
searchText?: string
|
|
295
296
|
): Promise<PeopleProfile[]> {
|
|
296
297
|
// Generate query
|
|
297
|
-
|
|
298
|
+
const query: Record<string, unknown> = {};
|
|
298
299
|
|
|
299
300
|
if (searchField) {
|
|
300
|
-
// @ts-ignore
|
|
301
301
|
query.sort_field = searchField;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
304
|
if (searchOrder) {
|
|
305
|
-
// @ts-ignore
|
|
306
305
|
query.sort_order = searchOrder;
|
|
307
306
|
}
|
|
308
307
|
|
|
309
308
|
if (searchOperator) {
|
|
310
|
-
// @ts-ignore
|
|
311
309
|
query.search_operator = searchOperator;
|
|
312
310
|
}
|
|
313
311
|
|
|
314
312
|
if (searchFilter) {
|
|
315
|
-
// @ts-ignore
|
|
316
313
|
query.search_filter = searchFilter;
|
|
317
314
|
}
|
|
318
315
|
|
|
319
316
|
if (searchText) {
|
|
320
|
-
// @ts-ignore
|
|
321
317
|
query.search_text = searchText;
|
|
322
318
|
}
|
|
323
319
|
|
|
@@ -20,6 +20,7 @@ export interface WebsiteSettings {
|
|
|
20
20
|
websiteID?: string;
|
|
21
21
|
name?: string;
|
|
22
22
|
domain?: string;
|
|
23
|
+
domain_alternates?: string[];
|
|
23
24
|
logo?: string;
|
|
24
25
|
audit?: WebsiteSettingsAudit;
|
|
25
26
|
contact?: WebsiteSettingsContact;
|
|
@@ -51,6 +52,7 @@ export interface WebsiteSettingsInbox {
|
|
|
51
52
|
export interface WebsiteSettingsEmails {
|
|
52
53
|
rating?: boolean;
|
|
53
54
|
transcript?: boolean;
|
|
55
|
+
trackers?: boolean;
|
|
54
56
|
junk_filter?: boolean;
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -76,6 +78,7 @@ export interface WebsiteSettingsChatbox {
|
|
|
76
78
|
visitor_compose?: boolean;
|
|
77
79
|
file_transfer?: boolean;
|
|
78
80
|
audio_record?: boolean;
|
|
81
|
+
guard_level?: string;
|
|
79
82
|
mode_initial?: string;
|
|
80
83
|
home?: boolean;
|
|
81
84
|
overlay_search?: boolean;
|
|
@@ -102,6 +105,7 @@ export interface WebsiteSettingsUpdate {
|
|
|
102
105
|
websiteID?: string;
|
|
103
106
|
name?: string;
|
|
104
107
|
domain?: string;
|
|
108
|
+
domain_alternates?: string[];
|
|
105
109
|
logo?: string;
|
|
106
110
|
audit?: WebsiteSettingsUpdateAudit;
|
|
107
111
|
contact?: WebsiteSettingsUpdateContact;
|
|
@@ -133,6 +137,7 @@ export interface WebsiteSettingsUpdateInbox {
|
|
|
133
137
|
export interface WebsiteSettingsUpdateEmails {
|
|
134
138
|
rating?: boolean;
|
|
135
139
|
transcript?: boolean;
|
|
140
|
+
trackers?: boolean;
|
|
136
141
|
junk_filter?: boolean;
|
|
137
142
|
}
|
|
138
143
|
|
|
@@ -158,6 +163,7 @@ export interface WebsiteSettingsUpdateChatbox {
|
|
|
158
163
|
visitor_compose?: boolean;
|
|
159
164
|
file_transfer?: boolean;
|
|
160
165
|
audio_record?: boolean;
|
|
166
|
+
guard_level?: string;
|
|
161
167
|
mode_initial?: string;
|
|
162
168
|
home?: boolean;
|
|
163
169
|
overlay_search?: boolean;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 WebsiteTeam = {
|
|
20
|
+
team_id?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
emoji?: string;
|
|
23
|
+
operators?: string[];
|
|
24
|
+
created_at?: number;
|
|
25
|
+
updated_at?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type WebsiteTeamNew = {
|
|
29
|
+
team_id?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**************************************************************************
|
|
33
|
+
* CLASSES
|
|
34
|
+
***************************************************************************/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Crisp WebsiteTeams Resource
|
|
38
|
+
*/
|
|
39
|
+
class WebsiteTeamsService extends BaseResource {
|
|
40
|
+
/**
|
|
41
|
+
* List Teams
|
|
42
|
+
*/
|
|
43
|
+
listTeams(
|
|
44
|
+
websiteID: string, pageNumber: number = 1
|
|
45
|
+
): Promise<WebsiteTeam[]> {
|
|
46
|
+
return this.crisp.get(
|
|
47
|
+
this.crisp.prepareRestUrl([
|
|
48
|
+
"website", websiteID, "teams", "list", String(pageNumber)
|
|
49
|
+
])
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Create A New Team
|
|
55
|
+
*/
|
|
56
|
+
createNewTeam(
|
|
57
|
+
websiteID: string, team: WebsiteTeam
|
|
58
|
+
): Promise<WebsiteTeamNew> {
|
|
59
|
+
return this.crisp.post(
|
|
60
|
+
this.crisp.prepareRestUrl(["website", websiteID, "team"]), null, team
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Check If Team Exists
|
|
66
|
+
*/
|
|
67
|
+
checkTeamExists(websiteID: string, teamID: string) {
|
|
68
|
+
return this.crisp.head(
|
|
69
|
+
this.crisp.prepareRestUrl(["website", websiteID, "team", teamID])
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Get Team
|
|
75
|
+
*/
|
|
76
|
+
getTeam(websiteID: string, teamID: string): Promise<WebsiteTeam> {
|
|
77
|
+
return this.crisp.get(
|
|
78
|
+
this.crisp.prepareRestUrl(["website", websiteID, "team", teamID])
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Save Team
|
|
84
|
+
*/
|
|
85
|
+
saveTeam(websiteID: string, teamID: string, team: WebsiteTeam) {
|
|
86
|
+
return this.crisp.put(
|
|
87
|
+
this.crisp.prepareRestUrl([
|
|
88
|
+
"website", websiteID, "team", teamID
|
|
89
|
+
]),
|
|
90
|
+
|
|
91
|
+
null, team
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Delete Team
|
|
97
|
+
*/
|
|
98
|
+
deleteTeam(websiteID: string, teamID: string) {
|
|
99
|
+
return this.crisp.delete(
|
|
100
|
+
this.crisp.prepareRestUrl(["website", websiteID, "team", teamID])
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**************************************************************************
|
|
106
|
+
* EXPORTS
|
|
107
|
+
***************************************************************************/
|
|
108
|
+
|
|
109
|
+
export default WebsiteTeamsService;
|
package/lib/resources/index.ts
CHANGED
package/lib/services/bucket.ts
CHANGED
package/lib/services/media.ts
CHANGED
package/lib/services/plan.ts
CHANGED
|
@@ -30,6 +30,7 @@ class PlanService {
|
|
|
30
30
|
* EXPORTS
|
|
31
31
|
***************************************************************************/
|
|
32
32
|
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
33
34
|
export interface PlanServiceInterface extends PlanSubscription {
|
|
34
35
|
}
|
|
35
36
|
|
package/lib/services/website.ts
CHANGED
|
@@ -22,6 +22,7 @@ import WebsiteInbox from "@/resources/WebsiteInbox";
|
|
|
22
22
|
import WebsiteOperator from "@/resources/WebsiteOperator";
|
|
23
23
|
import WebsitePeople from "@/resources/WebsitePeople";
|
|
24
24
|
import WebsiteSettings from "@/resources/WebsiteSettings";
|
|
25
|
+
import WebsiteTeams from "@/resources/WebsiteTeams";
|
|
25
26
|
import WebsiteVerify from "@/resources/WebsiteVerify";
|
|
26
27
|
import WebsiteVisitors from "@/resources/WebsiteVisitors";
|
|
27
28
|
|
|
@@ -47,6 +48,7 @@ class WebsiteService {
|
|
|
47
48
|
WebsiteOperator,
|
|
48
49
|
WebsitePeople,
|
|
49
50
|
WebsiteSettings,
|
|
51
|
+
WebsiteTeams,
|
|
50
52
|
WebsiteVerify,
|
|
51
53
|
WebsiteVisitors
|
|
52
54
|
];
|
|
@@ -69,6 +71,7 @@ export interface WebsiteServiceInterface extends
|
|
|
69
71
|
WebsiteOperator,
|
|
70
72
|
WebsitePeople,
|
|
71
73
|
WebsiteSettings,
|
|
74
|
+
WebsiteTeams,
|
|
72
75
|
WebsiteVerify,
|
|
73
76
|
WebsiteVisitors {
|
|
74
77
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crisp-api",
|
|
3
3
|
"description": "Crisp API wrapper for Node - official, maintained by Crisp",
|
|
4
|
-
"version": "10.
|
|
4
|
+
"version": "10.11.0",
|
|
5
5
|
"homepage": "https://github.com/crisp-im/node-crisp-api",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"@typescript-eslint/eslint-plugin": "8.39.1",
|
|
55
55
|
"tsc-alias": "1.8.16",
|
|
56
56
|
"typescript": "5.9.3",
|
|
57
|
-
"eslint": "9.
|
|
58
|
-
"eslint-plugin-crisp": "1.
|
|
59
|
-
"eslint-plugin-jsdoc": "
|
|
57
|
+
"eslint": "9.39.1",
|
|
58
|
+
"eslint-plugin-crisp": "1.4.12",
|
|
59
|
+
"eslint-plugin-jsdoc": "54.1.0",
|
|
60
60
|
"globals": "15.15.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|