crisp-api 9.13.0 → 10.0.3
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/README.md +2 -2
- package/dist/crisp.d.ts +179 -0
- package/dist/crisp.js +773 -0
- package/dist/resources/BaseResource.d.ts +21 -0
- package/dist/resources/BaseResource.js +26 -0
- package/dist/resources/BucketURL.d.ts +37 -0
- package/dist/resources/BucketURL.js +35 -0
- package/dist/resources/MediaAnimation.d.ts +20 -0
- package/dist/resources/MediaAnimation.js +40 -0
- package/dist/resources/PluginConnect.d.ts +59 -0
- package/dist/resources/PluginConnect.js +79 -0
- package/dist/resources/PluginSubscription.d.ts +112 -0
- package/dist/resources/PluginSubscription.js +130 -0
- package/dist/resources/WebsiteAnalytics.d.ts +20 -0
- package/dist/resources/WebsiteAnalytics.js +37 -0
- package/dist/resources/WebsiteAvailability.d.ts +40 -0
- package/dist/resources/WebsiteAvailability.js +46 -0
- package/dist/resources/WebsiteBase.d.ts +69 -0
- package/dist/resources/WebsiteBase.js +77 -0
- package/dist/resources/WebsiteBatch.d.ts +61 -0
- package/dist/resources/WebsiteBatch.js +76 -0
- package/dist/resources/WebsiteCampaign.d.ts +208 -0
- package/dist/resources/WebsiteCampaign.js +201 -0
- package/dist/resources/WebsiteConversation.d.ts +710 -0
- package/dist/resources/WebsiteConversation.js +607 -0
- package/dist/resources/WebsiteHelpdesk.d.ts +356 -0
- package/dist/resources/WebsiteHelpdesk.js +593 -0
- package/dist/resources/WebsiteOperator.d.ts +88 -0
- package/dist/resources/WebsiteOperator.js +99 -0
- package/dist/resources/WebsitePeople.d.ts +257 -0
- package/dist/resources/WebsitePeople.js +282 -0
- package/dist/resources/WebsiteSettings.d.ts +168 -0
- package/dist/resources/WebsiteSettings.js +42 -0
- package/dist/resources/WebsiteVerify.d.ts +47 -0
- package/dist/resources/WebsiteVerify.js +56 -0
- package/dist/resources/WebsiteVisitors.d.ts +122 -0
- package/dist/resources/WebsiteVisitors.js +98 -0
- package/dist/resources/index.d.ts +20 -0
- package/dist/resources/index.js +42 -0
- package/dist/services/bucket.d.ts +19 -0
- package/dist/services/bucket.js +31 -0
- package/dist/services/media.d.ts +19 -0
- package/dist/services/media.js +31 -0
- package/dist/services/plugin.d.ts +20 -0
- package/dist/services/plugin.js +33 -0
- package/dist/services/website.d.ts +30 -0
- package/dist/services/website.js +53 -0
- package/eslint.config.mjs +208 -0
- package/lib/crisp.ts +1006 -0
- package/lib/resources/BaseResource.ts +37 -0
- package/lib/resources/BucketURL.ts +58 -0
- package/lib/resources/MediaAnimation.ts +44 -0
- package/lib/resources/PluginConnect.ts +135 -0
- package/lib/resources/PluginSubscription.ts +236 -0
- package/lib/resources/WebsiteAnalytics.ts +41 -0
- package/lib/resources/WebsiteAvailability.ts +74 -0
- package/lib/resources/WebsiteBase.ts +119 -0
- package/lib/resources/WebsiteBatch.ts +116 -0
- package/lib/resources/WebsiteCampaign.ts +432 -0
- package/lib/resources/WebsiteConversation.ts +1507 -0
- package/lib/resources/WebsiteHelpdesk.ts +1024 -0
- package/lib/resources/WebsiteOperator.ts +183 -0
- package/lib/resources/WebsitePeople.ts +568 -0
- package/lib/resources/WebsiteSettings.ts +207 -0
- package/lib/resources/WebsiteVerify.ts +90 -0
- package/lib/resources/WebsiteVisitors.ts +219 -0
- package/lib/resources/index.ts +28 -0
- package/lib/services/bucket.ts +36 -0
- package/lib/services/media.ts +36 -0
- package/lib/services/plugin.ts +40 -0
- package/lib/services/website.ts +70 -0
- package/package.json +16 -11
- package/tsconfig.json +12 -5
- package/lib/crisp.js +0 -1171
- package/lib/resources/BucketURL.js +0 -34
- package/lib/resources/MediaAnimation.js +0 -41
- package/lib/resources/PluginConnect.js +0 -119
- package/lib/resources/PluginSubscription.js +0 -234
- package/lib/resources/WebsiteAnalytics.js +0 -37
- package/lib/resources/WebsiteAvailability.js +0 -48
- package/lib/resources/WebsiteBase.js +0 -100
- package/lib/resources/WebsiteBatch.js +0 -92
- package/lib/resources/WebsiteCampaign.js +0 -396
- package/lib/resources/WebsiteConversation.js +0 -1261
- package/lib/resources/WebsiteHelpdesk.js +0 -1198
- package/lib/resources/WebsiteOperator.js +0 -167
- package/lib/resources/WebsitePeople.js +0 -516
- package/lib/resources/WebsiteSettings.js +0 -50
- package/lib/resources/WebsiteVerify.js +0 -79
- package/lib/resources/WebsiteVisitors.js +0 -148
- package/lib/services/Bucket.js +0 -28
- package/lib/services/Media.js +0 -28
- package/lib/services/Plugin.js +0 -29
- package/lib/services/Website.js +0 -39
- package/types/crisp.d.ts +0 -151
- package/types/resources/BucketURL.d.ts +0 -15
- package/types/resources/MediaAnimation.d.ts +0 -15
- package/types/resources/PluginConnect.d.ts +0 -15
- package/types/resources/PluginSubscription.d.ts +0 -15
- package/types/resources/WebsiteAnalytics.d.ts +0 -15
- package/types/resources/WebsiteAvailability.d.ts +0 -15
- package/types/resources/WebsiteBase.d.ts +0 -15
- package/types/resources/WebsiteBatch.d.ts +0 -15
- package/types/resources/WebsiteCampaign.d.ts +0 -15
- package/types/resources/WebsiteConversation.d.ts +0 -15
- package/types/resources/WebsiteHelpdesk.d.ts +0 -15
- package/types/resources/WebsiteOperator.d.ts +0 -15
- package/types/resources/WebsitePeople.d.ts +0 -15
- package/types/resources/WebsiteSettings.d.ts +0 -15
- package/types/resources/WebsiteVerify.d.ts +0 -15
- package/types/resources/WebsiteVisitors.d.ts +0 -15
- package/types/services/Bucket.d.ts +0 -14
- package/types/services/Media.d.ts +0 -14
- package/types/services/Plugin.d.ts +0 -14
- package/types/services/Website.d.ts +0 -14
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* INTERFACES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
export interface WebsiteSettings {
|
|
9
|
+
websiteID?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
domain?: string;
|
|
12
|
+
logo?: string;
|
|
13
|
+
audit?: WebsiteSettingsAudit;
|
|
14
|
+
contact?: WebsiteSettingsContact;
|
|
15
|
+
inbox?: WebsiteSettingsInbox;
|
|
16
|
+
emails?: WebsiteSettingsEmails;
|
|
17
|
+
chatbox?: WebsiteSettingsChatbox;
|
|
18
|
+
}
|
|
19
|
+
export interface WebsiteSettingsAudit {
|
|
20
|
+
log?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface WebsiteSettingsContact {
|
|
23
|
+
email?: string;
|
|
24
|
+
phone?: string;
|
|
25
|
+
messenger?: string;
|
|
26
|
+
telegram?: string;
|
|
27
|
+
twitter?: string;
|
|
28
|
+
whatsapp?: string;
|
|
29
|
+
instagram?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface WebsiteSettingsInbox {
|
|
32
|
+
lock_removal?: boolean;
|
|
33
|
+
force_operator_token?: boolean;
|
|
34
|
+
locale?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface WebsiteSettingsEmails {
|
|
37
|
+
rating?: boolean;
|
|
38
|
+
transcript?: boolean;
|
|
39
|
+
enrich?: boolean;
|
|
40
|
+
junk_filter?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface WebsiteSettingsChatbox {
|
|
43
|
+
tile?: string;
|
|
44
|
+
wait_game?: boolean;
|
|
45
|
+
website_logo?: boolean;
|
|
46
|
+
last_operator_face?: boolean;
|
|
47
|
+
ongoing_operator_face?: boolean;
|
|
48
|
+
activity_metrics?: boolean;
|
|
49
|
+
operator_privacy?: boolean;
|
|
50
|
+
visitor_privacy?: boolean;
|
|
51
|
+
availability_tooltip?: boolean;
|
|
52
|
+
hide_vacation?: boolean;
|
|
53
|
+
hide_on_away?: boolean;
|
|
54
|
+
hide_on_mobile?: boolean;
|
|
55
|
+
position_reverse?: boolean;
|
|
56
|
+
email_visitors?: boolean;
|
|
57
|
+
phone_visitors?: boolean;
|
|
58
|
+
force_identify?: boolean;
|
|
59
|
+
ignore_privacy?: boolean;
|
|
60
|
+
visitor_compose?: boolean;
|
|
61
|
+
file_transfer?: boolean;
|
|
62
|
+
audio_record?: boolean;
|
|
63
|
+
overlay_search?: boolean;
|
|
64
|
+
overlay_mode?: boolean;
|
|
65
|
+
helpdesk_link?: boolean;
|
|
66
|
+
helpdesk_only?: boolean;
|
|
67
|
+
status_health_dead?: boolean;
|
|
68
|
+
check_domain?: boolean;
|
|
69
|
+
color_theme?: string;
|
|
70
|
+
text_theme?: string;
|
|
71
|
+
welcome_message?: string;
|
|
72
|
+
locale?: string;
|
|
73
|
+
allowed_pages?: string[];
|
|
74
|
+
blocked_pages?: string[];
|
|
75
|
+
blocked_countries?: string[];
|
|
76
|
+
blocked_locales?: string[];
|
|
77
|
+
}
|
|
78
|
+
export interface WebsiteSettingsUpdate {
|
|
79
|
+
websiteID?: string;
|
|
80
|
+
name?: string;
|
|
81
|
+
domain?: string;
|
|
82
|
+
logo?: string;
|
|
83
|
+
audit?: WebsiteSettingsUpdateAudit;
|
|
84
|
+
contact?: WebsiteSettingsUpdateContact;
|
|
85
|
+
inbox?: WebsiteSettingsUpdateInbox;
|
|
86
|
+
emails?: WebsiteSettingsUpdateEmails;
|
|
87
|
+
chatbox?: WebsiteSettingsUpdateChatbox;
|
|
88
|
+
}
|
|
89
|
+
export interface WebsiteSettingsUpdateAudit {
|
|
90
|
+
log?: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface WebsiteSettingsUpdateContact {
|
|
93
|
+
email?: string;
|
|
94
|
+
phone?: string;
|
|
95
|
+
messenger?: string;
|
|
96
|
+
telegram?: string;
|
|
97
|
+
twitter?: string;
|
|
98
|
+
whatsapp?: string;
|
|
99
|
+
instagram?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface WebsiteSettingsUpdateInbox {
|
|
102
|
+
lock_removal?: boolean;
|
|
103
|
+
force_operator_token?: boolean;
|
|
104
|
+
locale?: string;
|
|
105
|
+
}
|
|
106
|
+
export interface WebsiteSettingsUpdateEmails {
|
|
107
|
+
rating?: boolean;
|
|
108
|
+
transcript?: boolean;
|
|
109
|
+
enrich?: boolean;
|
|
110
|
+
junk_filter?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface WebsiteSettingsUpdateChatbox {
|
|
113
|
+
tile?: string;
|
|
114
|
+
wait_game?: boolean;
|
|
115
|
+
website_logo?: boolean;
|
|
116
|
+
last_operator_face?: boolean;
|
|
117
|
+
ongoing_operator_face?: boolean;
|
|
118
|
+
activity_metrics?: boolean;
|
|
119
|
+
operator_privacy?: boolean;
|
|
120
|
+
visitor_privacy?: boolean;
|
|
121
|
+
availability_tooltip?: boolean;
|
|
122
|
+
hide_vacation?: boolean;
|
|
123
|
+
hide_on_away?: boolean;
|
|
124
|
+
hide_on_mobile?: boolean;
|
|
125
|
+
position_reverse?: boolean;
|
|
126
|
+
email_visitors?: boolean;
|
|
127
|
+
phone_visitors?: boolean;
|
|
128
|
+
force_identify?: boolean;
|
|
129
|
+
ignore_privacy?: boolean;
|
|
130
|
+
visitor_compose?: boolean;
|
|
131
|
+
file_transfer?: boolean;
|
|
132
|
+
audio_record?: boolean;
|
|
133
|
+
overlay_search?: boolean;
|
|
134
|
+
overlay_mode?: boolean;
|
|
135
|
+
helpdesk_link?: boolean;
|
|
136
|
+
helpdesk_only?: boolean;
|
|
137
|
+
status_health_dead?: boolean;
|
|
138
|
+
check_domain?: boolean;
|
|
139
|
+
color_theme?: string;
|
|
140
|
+
text_theme?: string;
|
|
141
|
+
welcome_message?: string;
|
|
142
|
+
locale?: string;
|
|
143
|
+
allowed_pages?: string[];
|
|
144
|
+
blocked_pages?: string[];
|
|
145
|
+
blocked_countries?: string[];
|
|
146
|
+
blocked_locales?: string[];
|
|
147
|
+
blocked_ips?: string[];
|
|
148
|
+
}
|
|
149
|
+
/**************************************************************************
|
|
150
|
+
* CLASSES
|
|
151
|
+
***************************************************************************/
|
|
152
|
+
/**
|
|
153
|
+
* Crisp WebsiteSettings Resource
|
|
154
|
+
*/
|
|
155
|
+
declare class WebsiteSettingsService extends BaseResource {
|
|
156
|
+
/**
|
|
157
|
+
* Get Website Settings
|
|
158
|
+
*/
|
|
159
|
+
getWebsiteSettings(websiteID: string): Promise<WebsiteSettings>;
|
|
160
|
+
/**
|
|
161
|
+
* Update Website Settings
|
|
162
|
+
*/
|
|
163
|
+
updateWebsiteSettings(websiteID: string, settings: WebsiteSettingsUpdate): Promise<any>;
|
|
164
|
+
}
|
|
165
|
+
/**************************************************************************
|
|
166
|
+
* EXPORTS
|
|
167
|
+
***************************************************************************/
|
|
168
|
+
export default WebsiteSettingsService;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Baptiste Jamin <baptiste@crisp.chat>
|
|
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 WebsiteSettings Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteSettingsService extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Get Website Settings
|
|
26
|
+
*/
|
|
27
|
+
getWebsiteSettings(websiteID) {
|
|
28
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "settings"]));
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* Update Website Settings
|
|
33
|
+
*/
|
|
34
|
+
updateWebsiteSettings(websiteID, settings) {
|
|
35
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "settings"]), null, settings);
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
}
|
|
39
|
+
/**************************************************************************
|
|
40
|
+
* EXPORTS
|
|
41
|
+
***************************************************************************/
|
|
42
|
+
exports.default = WebsiteSettingsService;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* INTERFACES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
export interface WebsiteVerifyKeyData {
|
|
9
|
+
data?: WebsiteVerifyKey;
|
|
10
|
+
}
|
|
11
|
+
export interface WebsiteVerifySettings {
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface WebsiteVerifyKey {
|
|
15
|
+
secret?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface WebsiteVerifySettingsUpdate {
|
|
18
|
+
enabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**************************************************************************
|
|
21
|
+
* CLASSES
|
|
22
|
+
***************************************************************************/
|
|
23
|
+
/**
|
|
24
|
+
* Crisp WebsiteVerify Resource
|
|
25
|
+
*/
|
|
26
|
+
declare class WebsiteVerify extends BaseResource {
|
|
27
|
+
/**
|
|
28
|
+
* Get Verify Settings
|
|
29
|
+
*/
|
|
30
|
+
getVerifySettings(websiteID: string): Promise<WebsiteVerifySettings>;
|
|
31
|
+
/**
|
|
32
|
+
* Update Verify Settings
|
|
33
|
+
*/
|
|
34
|
+
updateVerifySettings(websiteID: string, settings: WebsiteVerifySettingsUpdate): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Get Verify Key
|
|
37
|
+
*/
|
|
38
|
+
getVerifyKey(websiteID: string): Promise<WebsiteVerifyKey>;
|
|
39
|
+
/**
|
|
40
|
+
* Roll Verify Key
|
|
41
|
+
*/
|
|
42
|
+
rollVerifyKey(websiteID: string): Promise<any>;
|
|
43
|
+
}
|
|
44
|
+
/**************************************************************************
|
|
45
|
+
* EXPORTS
|
|
46
|
+
***************************************************************************/
|
|
47
|
+
export default WebsiteVerify;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Valerian Saliou <valerian@valeriansaliou.name>
|
|
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 WebsiteVerify Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteVerify extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Get Verify Settings
|
|
26
|
+
*/
|
|
27
|
+
getVerifySettings(websiteID) {
|
|
28
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"]));
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* Update Verify Settings
|
|
33
|
+
*/
|
|
34
|
+
updateVerifySettings(websiteID, settings) {
|
|
35
|
+
return this.crisp.patch(this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"]), null, settings);
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
/**
|
|
39
|
+
* Get Verify Key
|
|
40
|
+
*/
|
|
41
|
+
getVerifyKey(websiteID) {
|
|
42
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "verify", "key"]));
|
|
43
|
+
}
|
|
44
|
+
;
|
|
45
|
+
/**
|
|
46
|
+
* Roll Verify Key
|
|
47
|
+
*/
|
|
48
|
+
rollVerifyKey(websiteID) {
|
|
49
|
+
return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "verify", "key"]), null, null);
|
|
50
|
+
}
|
|
51
|
+
;
|
|
52
|
+
}
|
|
53
|
+
/**************************************************************************
|
|
54
|
+
* EXPORTS
|
|
55
|
+
***************************************************************************/
|
|
56
|
+
exports.default = WebsiteVerify;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BaseResource from "./BaseResource";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* INTERFACES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
export interface WebsiteVisitorCount {
|
|
9
|
+
count?: number;
|
|
10
|
+
active?: number;
|
|
11
|
+
limited?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface WebsiteVisitor {
|
|
14
|
+
session_id?: string;
|
|
15
|
+
inbox_id?: string;
|
|
16
|
+
nickname?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
avatar?: string;
|
|
19
|
+
useragent?: string;
|
|
20
|
+
initiated?: boolean;
|
|
21
|
+
active?: boolean;
|
|
22
|
+
last_page?: WebsiteVisitorLastPage;
|
|
23
|
+
geolocation?: WebsiteVisitorGeolocation;
|
|
24
|
+
timezone?: number;
|
|
25
|
+
capabilities?: string[];
|
|
26
|
+
locales?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface WebsiteVisitorLastPage {
|
|
29
|
+
page_title?: string;
|
|
30
|
+
page_url?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface WebsiteVisitorGeolocation {
|
|
33
|
+
coordinates?: WebsiteVisitorGeolocationCoordinates;
|
|
34
|
+
city?: string;
|
|
35
|
+
region?: string;
|
|
36
|
+
country?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface WebsiteVisitorGeolocationCoordinates {
|
|
39
|
+
latitude?: number;
|
|
40
|
+
longitude?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface WebsiteVisitorsMapPointsData {
|
|
43
|
+
data?: WebsiteVisitorsMapPoint[];
|
|
44
|
+
}
|
|
45
|
+
export interface WebsiteVisitorsMapPoint {
|
|
46
|
+
visitors?: WebsiteVisitorsMapPointVisitors;
|
|
47
|
+
geolocation?: WebsiteVisitorsMapPointGeolocation;
|
|
48
|
+
}
|
|
49
|
+
export interface WebsiteVisitorsMapPointGeolocation {
|
|
50
|
+
coordinates?: WebsiteVisitorsMapPointGeolocationCoordinates;
|
|
51
|
+
city?: string;
|
|
52
|
+
region?: string;
|
|
53
|
+
country?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface WebsiteVisitorsMapPointGeolocationCoordinates {
|
|
56
|
+
latitude?: number;
|
|
57
|
+
longitude?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface WebsiteVisitorsMapPointVisitors {
|
|
60
|
+
count?: number;
|
|
61
|
+
threshold?: number;
|
|
62
|
+
sessions?: WebsiteVisitorsMapPointVisitorsSession[];
|
|
63
|
+
}
|
|
64
|
+
export interface WebsiteVisitorsMapPointVisitorsSession {
|
|
65
|
+
session_id?: string;
|
|
66
|
+
nickname?: string;
|
|
67
|
+
email?: string;
|
|
68
|
+
avatar?: string;
|
|
69
|
+
initiated?: boolean;
|
|
70
|
+
active?: boolean;
|
|
71
|
+
last_page?: WebsiteVisitorLastPage;
|
|
72
|
+
timezone?: number;
|
|
73
|
+
capabilities?: string[];
|
|
74
|
+
locales?: string[];
|
|
75
|
+
}
|
|
76
|
+
export interface WebsiteVisitorsToken {
|
|
77
|
+
session_id?: string;
|
|
78
|
+
}
|
|
79
|
+
export interface WebsiteVisitorsBlocked {
|
|
80
|
+
rule?: string[];
|
|
81
|
+
blocked?: number;
|
|
82
|
+
}
|
|
83
|
+
/**************************************************************************
|
|
84
|
+
* CLASSES
|
|
85
|
+
***************************************************************************/
|
|
86
|
+
/**
|
|
87
|
+
* Crisp WebsiteVisitors Resource
|
|
88
|
+
*/
|
|
89
|
+
declare class WebsiteVisitors extends BaseResource {
|
|
90
|
+
/**
|
|
91
|
+
* Count Visitors
|
|
92
|
+
*/
|
|
93
|
+
countVisitors(websiteID: string): Promise<WebsiteVisitorCount>;
|
|
94
|
+
/**
|
|
95
|
+
* List Visitors
|
|
96
|
+
*/
|
|
97
|
+
listVisitors(websiteID: string, pageNumber?: number): Promise<WebsiteVisitor[]>;
|
|
98
|
+
/**
|
|
99
|
+
* Pinpoint Visitors On A Map
|
|
100
|
+
*/
|
|
101
|
+
pinpointVisitorsOnMap(websiteID: string, centerLongitude: number, centerLatitude: number, centerRadius: number): Promise<WebsiteVisitorsMapPoint[]>;
|
|
102
|
+
/**
|
|
103
|
+
* Get Session Identifier From Token
|
|
104
|
+
*/
|
|
105
|
+
getSessionIdentifierFromToken(websiteID: string, tokenID: string): Promise<WebsiteVisitorsToken>;
|
|
106
|
+
/**
|
|
107
|
+
* Count Blocked Visitors
|
|
108
|
+
*/
|
|
109
|
+
countBlockedVisitors(websiteID: string): Promise<WebsiteVisitorsBlocked>;
|
|
110
|
+
/**
|
|
111
|
+
* Count Blocked Visitors In Rule
|
|
112
|
+
*/
|
|
113
|
+
countBlockedVisitorsInRule(websiteID: string, rule: string): Promise<number>;
|
|
114
|
+
/**
|
|
115
|
+
* Clear Blocked Visitors In Rule
|
|
116
|
+
*/
|
|
117
|
+
clearBlockedVisitorsInRule(websiteID: string, rule: string): Promise<any>;
|
|
118
|
+
}
|
|
119
|
+
/**************************************************************************
|
|
120
|
+
* EXPORTS
|
|
121
|
+
***************************************************************************/
|
|
122
|
+
export default WebsiteVisitors;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Valerian Saliou <valerian@valeriansaliou.name>
|
|
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 WebsiteVisitors Resource
|
|
22
|
+
*/
|
|
23
|
+
class WebsiteVisitors extends BaseResource_1.default {
|
|
24
|
+
/**
|
|
25
|
+
* Count Visitors
|
|
26
|
+
*/
|
|
27
|
+
countVisitors(websiteID) {
|
|
28
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "visitors", "count"]));
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
/**
|
|
32
|
+
* List Visitors
|
|
33
|
+
*/
|
|
34
|
+
listVisitors(websiteID, pageNumber = 1) {
|
|
35
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
36
|
+
"website", websiteID, "visitors", "list", String(pageNumber)
|
|
37
|
+
]));
|
|
38
|
+
}
|
|
39
|
+
;
|
|
40
|
+
/**
|
|
41
|
+
* Pinpoint Visitors On A Map
|
|
42
|
+
*/
|
|
43
|
+
pinpointVisitorsOnMap(websiteID, centerLongitude, centerLatitude, centerRadius) {
|
|
44
|
+
// Generate query
|
|
45
|
+
const query = {};
|
|
46
|
+
if (typeof centerLongitude === "number") {
|
|
47
|
+
query.center_longitude = String(centerLongitude);
|
|
48
|
+
}
|
|
49
|
+
if (typeof centerLatitude === "number") {
|
|
50
|
+
query.center_latitude = String(centerLatitude);
|
|
51
|
+
}
|
|
52
|
+
if (typeof centerRadius === "number") {
|
|
53
|
+
query.center_radius = String(centerRadius);
|
|
54
|
+
}
|
|
55
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
56
|
+
"website", websiteID, "visitors", "map"
|
|
57
|
+
]), query);
|
|
58
|
+
}
|
|
59
|
+
;
|
|
60
|
+
/**
|
|
61
|
+
* Get Session Identifier From Token
|
|
62
|
+
*/
|
|
63
|
+
getSessionIdentifierFromToken(websiteID, tokenID) {
|
|
64
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
65
|
+
"website", websiteID, "visitors", "token", tokenID
|
|
66
|
+
]));
|
|
67
|
+
}
|
|
68
|
+
;
|
|
69
|
+
/**
|
|
70
|
+
* Count Blocked Visitors
|
|
71
|
+
*/
|
|
72
|
+
countBlockedVisitors(websiteID) {
|
|
73
|
+
return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked"]));
|
|
74
|
+
}
|
|
75
|
+
;
|
|
76
|
+
/**
|
|
77
|
+
* Count Blocked Visitors In Rule
|
|
78
|
+
*/
|
|
79
|
+
countBlockedVisitorsInRule(websiteID, rule) {
|
|
80
|
+
return this.crisp.get(this.crisp.prepareRestUrl([
|
|
81
|
+
"website", websiteID, "visitors", "blocked", rule
|
|
82
|
+
]));
|
|
83
|
+
}
|
|
84
|
+
;
|
|
85
|
+
/**
|
|
86
|
+
* Clear Blocked Visitors In Rule
|
|
87
|
+
*/
|
|
88
|
+
clearBlockedVisitorsInRule(websiteID, rule) {
|
|
89
|
+
return this.crisp.delete(this.crisp.prepareRestUrl([
|
|
90
|
+
"website", websiteID, "visitors", "blocked", rule
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
;
|
|
94
|
+
}
|
|
95
|
+
/**************************************************************************
|
|
96
|
+
* EXPORTS
|
|
97
|
+
***************************************************************************/
|
|
98
|
+
exports.default = WebsiteVisitors;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* EXPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
export * from "./BaseResource";
|
|
5
|
+
export * from "./BucketURL";
|
|
6
|
+
export * from "./MediaAnimation";
|
|
7
|
+
export * from "./PluginConnect";
|
|
8
|
+
export * from "./PluginSubscription";
|
|
9
|
+
export * from "./WebsiteAnalytics";
|
|
10
|
+
export * from "./WebsiteAvailability";
|
|
11
|
+
export * from "./WebsiteBase";
|
|
12
|
+
export * from "./WebsiteBatch";
|
|
13
|
+
export * from "./WebsiteCampaign";
|
|
14
|
+
export * from "./WebsiteConversation";
|
|
15
|
+
export * from "./WebsiteHelpdesk";
|
|
16
|
+
export * from "./WebsiteOperator";
|
|
17
|
+
export * from "./WebsitePeople";
|
|
18
|
+
export * from "./WebsiteSettings";
|
|
19
|
+
export * from "./WebsiteVerify";
|
|
20
|
+
export * from "./WebsiteVisitors";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Baptiste Jamin <baptiste@crisp.chat>
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
/**************************************************************************
|
|
24
|
+
* EXPORTS
|
|
25
|
+
***************************************************************************/
|
|
26
|
+
__exportStar(require("./BaseResource"), exports);
|
|
27
|
+
__exportStar(require("./BucketURL"), exports);
|
|
28
|
+
__exportStar(require("./MediaAnimation"), exports);
|
|
29
|
+
__exportStar(require("./PluginConnect"), exports);
|
|
30
|
+
__exportStar(require("./PluginSubscription"), exports);
|
|
31
|
+
__exportStar(require("./WebsiteAnalytics"), exports);
|
|
32
|
+
__exportStar(require("./WebsiteAvailability"), exports);
|
|
33
|
+
__exportStar(require("./WebsiteBase"), exports);
|
|
34
|
+
__exportStar(require("./WebsiteBatch"), exports);
|
|
35
|
+
__exportStar(require("./WebsiteCampaign"), exports);
|
|
36
|
+
__exportStar(require("./WebsiteConversation"), exports);
|
|
37
|
+
__exportStar(require("./WebsiteHelpdesk"), exports);
|
|
38
|
+
__exportStar(require("./WebsiteOperator"), exports);
|
|
39
|
+
__exportStar(require("./WebsitePeople"), exports);
|
|
40
|
+
__exportStar(require("./WebsiteSettings"), exports);
|
|
41
|
+
__exportStar(require("./WebsiteVerify"), exports);
|
|
42
|
+
__exportStar(require("./WebsiteVisitors"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import BucketURL from "../resources/BucketURL";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* CLASSES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
/**
|
|
9
|
+
* Bucket Service
|
|
10
|
+
*/
|
|
11
|
+
declare class BucketService {
|
|
12
|
+
__resources: any[];
|
|
13
|
+
}
|
|
14
|
+
/**************************************************************************
|
|
15
|
+
* EXPORTS
|
|
16
|
+
***************************************************************************/
|
|
17
|
+
export interface BucketServiceInterface extends BucketURL {
|
|
18
|
+
}
|
|
19
|
+
export default BucketService;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* node-crisp-api
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2022, Crisp IM SAS
|
|
6
|
+
* Author: Baptiste Jamin <baptiste@crisp.chat>
|
|
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 BucketURL_1 = __importDefault(require("../resources/BucketURL"));
|
|
17
|
+
/**************************************************************************
|
|
18
|
+
* CLASSES
|
|
19
|
+
***************************************************************************/
|
|
20
|
+
/**
|
|
21
|
+
* Bucket Service
|
|
22
|
+
*/
|
|
23
|
+
class BucketService {
|
|
24
|
+
constructor() {
|
|
25
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
26
|
+
this.__resources = [
|
|
27
|
+
BucketURL_1.default
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.default = BucketService;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**************************************************************************
|
|
2
|
+
* IMPORTS
|
|
3
|
+
***************************************************************************/
|
|
4
|
+
import MediaAnimation from "../resources/MediaAnimation";
|
|
5
|
+
/**************************************************************************
|
|
6
|
+
* CLASSES
|
|
7
|
+
***************************************************************************/
|
|
8
|
+
/**
|
|
9
|
+
* Crisp Media Service
|
|
10
|
+
*/
|
|
11
|
+
declare class MediaService {
|
|
12
|
+
__resources: any[];
|
|
13
|
+
}
|
|
14
|
+
/**************************************************************************
|
|
15
|
+
* EXPORTS
|
|
16
|
+
***************************************************************************/
|
|
17
|
+
export interface MediaServiceInterface extends MediaAnimation {
|
|
18
|
+
}
|
|
19
|
+
export default MediaService;
|