crisp-api 9.13.0 → 10.0.2

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.
Files changed (116) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/crisp.d.ts +167 -0
  4. package/dist/crisp.js +764 -0
  5. package/dist/resources/BaseResource.d.ts +15 -0
  6. package/dist/resources/BaseResource.js +20 -0
  7. package/dist/resources/BucketURL.d.ts +28 -0
  8. package/dist/resources/BucketURL.js +29 -0
  9. package/dist/resources/MediaAnimation.d.ts +14 -0
  10. package/dist/resources/MediaAnimation.js +32 -0
  11. package/dist/resources/PluginConnect.d.ts +50 -0
  12. package/dist/resources/PluginConnect.js +73 -0
  13. package/dist/resources/PluginSubscription.d.ts +103 -0
  14. package/dist/resources/PluginSubscription.js +122 -0
  15. package/dist/resources/WebsiteAnalytics.d.ts +14 -0
  16. package/dist/resources/WebsiteAnalytics.js +29 -0
  17. package/dist/resources/WebsiteAvailability.d.ts +31 -0
  18. package/dist/resources/WebsiteAvailability.js +36 -0
  19. package/dist/resources/WebsiteBase.d.ts +60 -0
  20. package/dist/resources/WebsiteBase.js +71 -0
  21. package/dist/resources/WebsiteBatch.d.ts +52 -0
  22. package/dist/resources/WebsiteBatch.js +70 -0
  23. package/dist/resources/WebsiteCampaign.d.ts +199 -0
  24. package/dist/resources/WebsiteCampaign.js +194 -0
  25. package/dist/resources/WebsiteConversation.d.ts +701 -0
  26. package/dist/resources/WebsiteConversation.js +595 -0
  27. package/dist/resources/WebsiteHelpdesk.d.ts +347 -0
  28. package/dist/resources/WebsiteHelpdesk.js +587 -0
  29. package/dist/resources/WebsiteOperator.d.ts +79 -0
  30. package/dist/resources/WebsiteOperator.js +93 -0
  31. package/dist/resources/WebsitePeople.d.ts +248 -0
  32. package/dist/resources/WebsitePeople.js +276 -0
  33. package/dist/resources/WebsiteSettings.d.ts +159 -0
  34. package/dist/resources/WebsiteSettings.js +36 -0
  35. package/dist/resources/WebsiteVerify.d.ts +38 -0
  36. package/dist/resources/WebsiteVerify.js +50 -0
  37. package/dist/resources/WebsiteVisitors.d.ts +113 -0
  38. package/dist/resources/WebsiteVisitors.js +88 -0
  39. package/dist/resources/index.d.ts +17 -0
  40. package/dist/resources/index.js +40 -0
  41. package/dist/services/bucket.d.ts +13 -0
  42. package/dist/services/bucket.js +28 -0
  43. package/dist/services/media.d.ts +13 -0
  44. package/dist/services/media.js +28 -0
  45. package/dist/services/plugin.d.ts +14 -0
  46. package/dist/services/plugin.js +30 -0
  47. package/dist/services/website.d.ts +24 -0
  48. package/dist/services/website.js +50 -0
  49. package/eslint.config.mjs +208 -0
  50. package/lib/crisp.ts +957 -0
  51. package/lib/resources/BaseResource.ts +29 -0
  52. package/lib/resources/BucketURL.ts +49 -0
  53. package/lib/resources/MediaAnimation.ts +34 -0
  54. package/lib/resources/PluginConnect.ts +128 -0
  55. package/lib/resources/PluginSubscription.ts +208 -0
  56. package/lib/resources/WebsiteAnalytics.ts +31 -0
  57. package/lib/resources/WebsiteAvailability.ts +54 -0
  58. package/lib/resources/WebsiteBase.ts +108 -0
  59. package/lib/resources/WebsiteBatch.ts +96 -0
  60. package/lib/resources/WebsiteCampaign.ts +399 -0
  61. package/lib/resources/WebsiteConversation.ts +1416 -0
  62. package/lib/resources/WebsiteHelpdesk.ts +982 -0
  63. package/lib/resources/WebsiteOperator.ts +161 -0
  64. package/lib/resources/WebsitePeople.ts +527 -0
  65. package/lib/resources/WebsiteSettings.ts +192 -0
  66. package/lib/resources/WebsiteVerify.ts +76 -0
  67. package/lib/resources/WebsiteVisitors.ts +196 -0
  68. package/lib/resources/index.ts +25 -0
  69. package/lib/services/bucket.ts +28 -0
  70. package/lib/services/media.ts +28 -0
  71. package/lib/services/plugin.ts +32 -0
  72. package/lib/services/website.ts +62 -0
  73. package/package.json +16 -11
  74. package/tsconfig.json +12 -5
  75. package/lib/crisp.js +0 -1171
  76. package/lib/resources/BucketURL.js +0 -34
  77. package/lib/resources/MediaAnimation.js +0 -41
  78. package/lib/resources/PluginConnect.js +0 -119
  79. package/lib/resources/PluginSubscription.js +0 -234
  80. package/lib/resources/WebsiteAnalytics.js +0 -37
  81. package/lib/resources/WebsiteAvailability.js +0 -48
  82. package/lib/resources/WebsiteBase.js +0 -100
  83. package/lib/resources/WebsiteBatch.js +0 -92
  84. package/lib/resources/WebsiteCampaign.js +0 -396
  85. package/lib/resources/WebsiteConversation.js +0 -1261
  86. package/lib/resources/WebsiteHelpdesk.js +0 -1198
  87. package/lib/resources/WebsiteOperator.js +0 -167
  88. package/lib/resources/WebsitePeople.js +0 -516
  89. package/lib/resources/WebsiteSettings.js +0 -50
  90. package/lib/resources/WebsiteVerify.js +0 -79
  91. package/lib/resources/WebsiteVisitors.js +0 -148
  92. package/lib/services/Bucket.js +0 -28
  93. package/lib/services/Media.js +0 -28
  94. package/lib/services/Plugin.js +0 -29
  95. package/lib/services/Website.js +0 -39
  96. package/types/crisp.d.ts +0 -151
  97. package/types/resources/BucketURL.d.ts +0 -15
  98. package/types/resources/MediaAnimation.d.ts +0 -15
  99. package/types/resources/PluginConnect.d.ts +0 -15
  100. package/types/resources/PluginSubscription.d.ts +0 -15
  101. package/types/resources/WebsiteAnalytics.d.ts +0 -15
  102. package/types/resources/WebsiteAvailability.d.ts +0 -15
  103. package/types/resources/WebsiteBase.d.ts +0 -15
  104. package/types/resources/WebsiteBatch.d.ts +0 -15
  105. package/types/resources/WebsiteCampaign.d.ts +0 -15
  106. package/types/resources/WebsiteConversation.d.ts +0 -15
  107. package/types/resources/WebsiteHelpdesk.d.ts +0 -15
  108. package/types/resources/WebsiteOperator.d.ts +0 -15
  109. package/types/resources/WebsitePeople.d.ts +0 -15
  110. package/types/resources/WebsiteSettings.d.ts +0 -15
  111. package/types/resources/WebsiteVerify.d.ts +0 -15
  112. package/types/resources/WebsiteVisitors.d.ts +0 -15
  113. package/types/services/Bucket.d.ts +0 -14
  114. package/types/services/Media.d.ts +0 -14
  115. package/types/services/Plugin.d.ts +0 -14
  116. package/types/services/Website.d.ts +0 -14
@@ -0,0 +1,192 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import BaseResource from "./BaseResource";
14
+
15
+ export interface WebsiteSettings {
16
+ websiteID?: string;
17
+ name?: string;
18
+ domain?: string;
19
+ logo?: string;
20
+ audit?: WebsiteSettingsAudit;
21
+ contact?: WebsiteSettingsContact;
22
+ inbox?: WebsiteSettingsInbox;
23
+ emails?: WebsiteSettingsEmails;
24
+ chatbox?: WebsiteSettingsChatbox;
25
+ }
26
+
27
+ export interface WebsiteSettingsAudit {
28
+ log?: boolean;
29
+ }
30
+
31
+ export interface WebsiteSettingsContact {
32
+ email?: string;
33
+ phone?: string;
34
+ messenger?: string;
35
+ telegram?: string;
36
+ twitter?: string;
37
+ whatsapp?: string;
38
+ instagram?: string;
39
+ }
40
+
41
+ export interface WebsiteSettingsInbox {
42
+ lock_removal?: boolean;
43
+ force_operator_token?: boolean;
44
+ locale?: string;
45
+ }
46
+
47
+ export interface WebsiteSettingsEmails {
48
+ rating?: boolean;
49
+ transcript?: boolean;
50
+ enrich?: boolean;
51
+ junk_filter?: boolean;
52
+ }
53
+
54
+ export interface WebsiteSettingsChatbox {
55
+ tile?: string;
56
+ wait_game?: boolean;
57
+ website_logo?: boolean;
58
+ last_operator_face?: boolean;
59
+ ongoing_operator_face?: boolean;
60
+ activity_metrics?: boolean;
61
+ operator_privacy?: boolean;
62
+ visitor_privacy?: boolean;
63
+ availability_tooltip?: boolean;
64
+ hide_vacation?: boolean;
65
+ hide_on_away?: boolean;
66
+ hide_on_mobile?: boolean;
67
+ position_reverse?: boolean;
68
+ email_visitors?: boolean;
69
+ phone_visitors?: boolean;
70
+ force_identify?: boolean;
71
+ ignore_privacy?: boolean;
72
+ visitor_compose?: boolean;
73
+ file_transfer?: boolean;
74
+ audio_record?: boolean;
75
+ overlay_search?: boolean;
76
+ overlay_mode?: boolean;
77
+ helpdesk_link?: boolean;
78
+ helpdesk_only?: boolean;
79
+ status_health_dead?: boolean;
80
+ check_domain?: boolean;
81
+ color_theme?: string;
82
+ text_theme?: string;
83
+ welcome_message?: string;
84
+ locale?: string;
85
+ allowed_pages?: string[];
86
+ blocked_pages?: string[];
87
+ blocked_countries?: string[];
88
+ blocked_locales?: string[];
89
+ }
90
+
91
+ export interface WebsiteSettingsUpdate {
92
+ websiteID?: string;
93
+ name?: string;
94
+ domain?: string;
95
+ logo?: string;
96
+ audit?: WebsiteSettingsUpdateAudit;
97
+ contact?: WebsiteSettingsUpdateContact;
98
+ inbox?: WebsiteSettingsUpdateInbox;
99
+ emails?: WebsiteSettingsUpdateEmails;
100
+ chatbox?: WebsiteSettingsUpdateChatbox;
101
+ }
102
+
103
+ export interface WebsiteSettingsUpdateAudit {
104
+ log?: boolean;
105
+ }
106
+
107
+ export interface WebsiteSettingsUpdateContact {
108
+ email?: string;
109
+ phone?: string;
110
+ messenger?: string;
111
+ telegram?: string;
112
+ twitter?: string;
113
+ whatsapp?: string;
114
+ instagram?: string;
115
+ }
116
+
117
+ export interface WebsiteSettingsUpdateInbox {
118
+ lock_removal?: boolean;
119
+ force_operator_token?: boolean;
120
+ locale?: string;
121
+ }
122
+
123
+ export interface WebsiteSettingsUpdateEmails {
124
+ rating?: boolean;
125
+ transcript?: boolean;
126
+ enrich?: boolean;
127
+ junk_filter?: boolean;
128
+ }
129
+
130
+ export interface WebsiteSettingsUpdateChatbox {
131
+ tile?: string;
132
+ wait_game?: boolean;
133
+ website_logo?: boolean;
134
+ last_operator_face?: boolean;
135
+ ongoing_operator_face?: boolean;
136
+ activity_metrics?: boolean;
137
+ operator_privacy?: boolean;
138
+ visitor_privacy?: boolean;
139
+ availability_tooltip?: boolean;
140
+ hide_vacation?: boolean;
141
+ hide_on_away?: boolean;
142
+ hide_on_mobile?: boolean;
143
+ position_reverse?: boolean;
144
+ email_visitors?: boolean;
145
+ phone_visitors?: boolean;
146
+ force_identify?: boolean;
147
+ ignore_privacy?: boolean;
148
+ visitor_compose?: boolean;
149
+ file_transfer?: boolean;
150
+ audio_record?: boolean;
151
+ overlay_search?: boolean;
152
+ overlay_mode?: boolean;
153
+ helpdesk_link?: boolean;
154
+ helpdesk_only?: boolean;
155
+ status_health_dead?: boolean;
156
+ check_domain?: boolean;
157
+ color_theme?: string;
158
+ text_theme?: string;
159
+ welcome_message?: string;
160
+ locale?: string;
161
+ allowed_pages?: string[];
162
+ blocked_pages?: string[];
163
+ blocked_countries?: string[];
164
+ blocked_locales?: string[];
165
+ blocked_ips?: string[];
166
+ }
167
+
168
+ /**
169
+ * Crisp WebsiteSettings Resource
170
+ */
171
+ class WebsiteSettingsService extends BaseResource {
172
+ /**
173
+ * Get Website Settings
174
+ */
175
+ getWebsiteSettings(websiteID: string) : Promise<WebsiteSettings> {
176
+ return this.crisp.get(
177
+ this.crisp.prepareRestUrl(["website", websiteID, "settings"])
178
+ );
179
+ };
180
+
181
+ /**
182
+ * Update Website Settings
183
+ */
184
+ updateWebsiteSettings(websiteID: string, settings: WebsiteSettingsUpdate) {
185
+ return this.crisp.patch(
186
+ this.crisp.prepareRestUrl(["website", websiteID, "settings"]), null, settings
187
+ );
188
+ };
189
+ }
190
+
191
+ export default WebsiteSettingsService;
192
+
@@ -0,0 +1,76 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Valerian Saliou <valerian@valeriansaliou.name>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import BaseResource from "./BaseResource";
14
+
15
+ export interface WebsiteVerifyKeyData {
16
+ data?: WebsiteVerifyKey;
17
+ }
18
+
19
+ export interface WebsiteVerifySettings {
20
+ enabled?: boolean;
21
+ }
22
+
23
+ export interface WebsiteVerifyKey {
24
+ secret?: string;
25
+ }
26
+
27
+ export interface WebsiteVerifySettingsUpdate {
28
+ enabled?: boolean;
29
+ }
30
+
31
+ /**
32
+ * Crisp WebsiteVerify Resource
33
+ */
34
+ class WebsiteVerify extends BaseResource {
35
+ /**
36
+ * Get Verify Settings
37
+ */
38
+ getVerifySettings(websiteID: string) : Promise<WebsiteVerifySettings> {
39
+ return this.crisp.get(
40
+ this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"])
41
+ );
42
+ };
43
+
44
+ /**
45
+ * Update Verify Settings
46
+ */
47
+ updateVerifySettings(websiteID: string, settings: WebsiteVerifySettingsUpdate) {
48
+ return this.crisp.patch(
49
+ this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"]),
50
+
51
+ null, settings
52
+ );
53
+ };
54
+
55
+ /**
56
+ * Get Verify Key
57
+ */
58
+ getVerifyKey(websiteID: string) : Promise<WebsiteVerifyKey> {
59
+ return this.crisp.get(
60
+ this.crisp.prepareRestUrl(["website", websiteID, "verify", "key"])
61
+ );
62
+ };
63
+
64
+ /**
65
+ * Roll Verify Key
66
+ */
67
+ rollVerifyKey(websiteID: string) {
68
+ return this.crisp.post(
69
+ this.crisp.prepareRestUrl(["website", websiteID, "verify", "key"]),
70
+
71
+ null, null
72
+ );
73
+ };
74
+ }
75
+
76
+ export default WebsiteVerify;
@@ -0,0 +1,196 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Valerian Saliou <valerian@valeriansaliou.name>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import BaseResource from "./BaseResource";
14
+
15
+ export interface WebsiteVisitorCount {
16
+ count?: number;
17
+ active?: number;
18
+ limited?: boolean;
19
+ }
20
+
21
+ export interface WebsiteVisitor {
22
+ session_id?: string;
23
+ inbox_id?: string;
24
+ nickname?: string;
25
+ email?: string;
26
+ avatar?: string;
27
+ useragent?: string;
28
+ initiated?: boolean;
29
+ active?: boolean;
30
+ last_page?: WebsiteVisitorLastPage;
31
+ geolocation?: WebsiteVisitorGeolocation;
32
+ timezone?: number;
33
+ capabilities?: string[];
34
+ locales?: string[];
35
+ }
36
+
37
+ export interface WebsiteVisitorLastPage {
38
+ page_title?: string;
39
+ page_url?: string;
40
+ }
41
+
42
+ export interface WebsiteVisitorGeolocation {
43
+ coordinates?: WebsiteVisitorGeolocationCoordinates;
44
+ city?: string;
45
+ region?: string;
46
+ country?: string;
47
+ }
48
+
49
+ export interface WebsiteVisitorGeolocationCoordinates {
50
+ latitude?: number;
51
+ longitude?: number;
52
+ }
53
+
54
+ export interface WebsiteVisitorsMapPointsData {
55
+ data?: WebsiteVisitorsMapPoint[];
56
+ }
57
+
58
+ export interface WebsiteVisitorsMapPoint {
59
+ visitors?: WebsiteVisitorsMapPointVisitors;
60
+ geolocation?: WebsiteVisitorsMapPointGeolocation;
61
+ }
62
+
63
+ export interface WebsiteVisitorsMapPointGeolocation {
64
+ coordinates?: WebsiteVisitorsMapPointGeolocationCoordinates;
65
+ city?: string;
66
+ region?: string;
67
+ country?: string;
68
+ }
69
+
70
+ export interface WebsiteVisitorsMapPointGeolocationCoordinates {
71
+ latitude?: number;
72
+ longitude?: number;
73
+ }
74
+
75
+ export interface WebsiteVisitorsMapPointVisitors {
76
+ count?: number;
77
+ threshold?: number;
78
+ sessions?: WebsiteVisitorsMapPointVisitorsSession[];
79
+ }
80
+
81
+ export interface WebsiteVisitorsMapPointVisitorsSession {
82
+ session_id?: string;
83
+ nickname?: string;
84
+ email?: string;
85
+ avatar?: string;
86
+ initiated?: boolean;
87
+ active?: boolean;
88
+ last_page?: WebsiteVisitorLastPage;
89
+ timezone?: number;
90
+ capabilities?: string[];
91
+ locales?: string[];
92
+ }
93
+
94
+ export interface WebsiteVisitorsToken {
95
+ session_id?: string;
96
+ }
97
+
98
+ export interface WebsiteVisitorsBlocked {
99
+ rule?: string[];
100
+ blocked?: number;
101
+ }
102
+
103
+ /**
104
+ * Crisp WebsiteVisitors Resource
105
+ */
106
+ class WebsiteVisitors extends BaseResource {
107
+ /**
108
+ * Count Visitors
109
+ */
110
+ countVisitors(websiteID: string) : Promise<WebsiteVisitorCount> {
111
+ return this.crisp.get(
112
+ this.crisp.prepareRestUrl(["website", websiteID, "visitors", "count"])
113
+ );
114
+ };
115
+
116
+ /**
117
+ * List Visitors
118
+ */
119
+ listVisitors(websiteID: string, pageNumber: number = 1) : Promise<WebsiteVisitor[]> {
120
+ return this.crisp.get(
121
+ this.crisp.prepareRestUrl([
122
+ "website", websiteID, "visitors", "list", String(pageNumber)
123
+ ])
124
+ );
125
+ };
126
+
127
+ /**
128
+ * Pinpoint Visitors On A Map
129
+ */
130
+ pinpointVisitorsOnMap(
131
+ websiteID: string, centerLongitude: number, centerLatitude: number, centerRadius: number
132
+ ) : Promise<WebsiteVisitorsMapPoint[]> {
133
+ // Generate query
134
+ const query: Record<string, string> = {};
135
+
136
+ if (typeof centerLongitude === "number") {
137
+ query.center_longitude = String(centerLongitude);
138
+ }
139
+
140
+ if (typeof centerLatitude === "number") {
141
+ query.center_latitude = String(centerLatitude);
142
+ }
143
+
144
+ if (typeof centerRadius === "number") {
145
+ query.center_radius = String(centerRadius);
146
+ }
147
+
148
+ return this.crisp.get(
149
+ this.crisp.prepareRestUrl([
150
+ "website", websiteID, "visitors", "map"
151
+ ]),
152
+
153
+ query
154
+ );
155
+ };
156
+
157
+ /**
158
+ * Get Session Identifier From Token
159
+ */
160
+ getSessionIdentifierFromToken(websiteID: string, tokenID: string) : Promise<WebsiteVisitorsToken> {
161
+ return this.crisp.get(
162
+ this.crisp.prepareRestUrl([
163
+ "website", websiteID, "visitors", "token", tokenID
164
+ ])
165
+ );
166
+ };
167
+
168
+ /**
169
+ * Count Blocked Visitors
170
+ */
171
+ countBlockedVisitors(websiteID: string) : Promise<WebsiteVisitorsBlocked> {
172
+ return this.crisp.get(
173
+ this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked"])
174
+ );
175
+ };
176
+
177
+ /**
178
+ * Count Blocked Visitors In Rule
179
+ */
180
+ countBlockedVisitorsInRule(websiteID: string, rule: string) : Promise<number> {
181
+ return this.crisp.get(
182
+ this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked", rule])
183
+ );
184
+ };
185
+
186
+ /**
187
+ * Clear Blocked Visitors In Rule
188
+ */
189
+ clearBlockedVisitorsInRule(websiteID: string, rule: string) {
190
+ return this.crisp.delete(
191
+ this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked", rule])
192
+ );
193
+ };
194
+ }
195
+
196
+ export default WebsiteVisitors;
@@ -0,0 +1,25 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ // Used to export all types
9
+ export * from "./BaseResource";
10
+ export * from "./BucketURL";
11
+ export * from "./MediaAnimation";
12
+ export * from "./PluginConnect";
13
+ export * from "./PluginSubscription";
14
+ export * from "./WebsiteAnalytics";
15
+ export * from "./WebsiteAvailability";
16
+ export * from "./WebsiteBase";
17
+ export * from "./WebsiteBatch";
18
+ export * from "./WebsiteCampaign";
19
+ export * from "./WebsiteConversation";
20
+ export * from "./WebsiteHelpdesk";
21
+ export * from "./WebsiteOperator";
22
+ export * from "./WebsitePeople";
23
+ export * from "./WebsiteSettings";
24
+ export * from "./WebsiteVerify";
25
+ export * from "./WebsiteVisitors";
@@ -0,0 +1,28 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import BucketURL from "@/resources/BucketURL";
14
+
15
+ /**
16
+ * Bucket Service
17
+ */
18
+ class BucketService {
19
+ /* eslint-disable @typescript-eslint/no-explicit-any */
20
+ public __resources: any[] = [
21
+ BucketURL
22
+ ];
23
+ }
24
+
25
+ export interface BucketServiceInterface extends
26
+ BucketURL {}
27
+
28
+ export default BucketService;
@@ -0,0 +1,28 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import MediaAnimation from "@/resources/MediaAnimation";
14
+
15
+ /**
16
+ * Crisp Media Service
17
+ */
18
+ class MediaService {
19
+ /* eslint-disable @typescript-eslint/no-explicit-any */
20
+ public __resources: any[] = [
21
+ MediaAnimation
22
+ ];
23
+ }
24
+
25
+ export interface MediaServiceInterface extends
26
+ MediaAnimation {}
27
+
28
+ export default MediaService;
@@ -0,0 +1,32 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import PluginConnect from "@/resources/PluginConnect";
14
+ import PluginSubscription from "@/resources/PluginSubscription";
15
+
16
+ /**
17
+ * Crisp Plugin Service
18
+ */
19
+ class PluginService {
20
+ /* eslint-disable @typescript-eslint/no-explicit-any */
21
+ public __resources: any[] = [
22
+ PluginConnect,
23
+ PluginSubscription
24
+ ];
25
+ }
26
+
27
+ export interface PluginServiceInterface extends
28
+ PluginConnect,
29
+ PluginSubscription {
30
+ }
31
+
32
+ export default PluginService;
@@ -0,0 +1,62 @@
1
+ /*
2
+ * node-crisp-api
3
+ *
4
+ * Copyright 2022, Crisp IM SAS
5
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
6
+ */
7
+
8
+ /**************************************************************************
9
+ * IMPORTS
10
+ ***************************************************************************/
11
+
12
+ // PROJECT: RESOURCES
13
+ import WebsiteBase from "@/resources/WebsiteBase";
14
+ import WebsiteAnalytics from "@/resources/WebsiteAnalytics";
15
+ import WebsiteAvailability from "@/resources/WebsiteAvailability";
16
+ import WebsiteBatch from "@/resources/WebsiteBatch";
17
+ import WebsiteCampaign from "@/resources/WebsiteCampaign";
18
+ import WebsiteConversation from "@/resources/WebsiteConversation";
19
+ import WebsiteOperator from "@/resources/WebsiteOperator";
20
+ import WebsitePeople from "@/resources/WebsitePeople";
21
+ import WebsiteHelpdesk from "@/resources/WebsiteHelpdesk";
22
+ import WebsiteSettings from "@/resources/WebsiteSettings";
23
+ import WebsiteVerify from "@/resources/WebsiteVerify";
24
+ import WebsiteVisitors from "@/resources/WebsiteVisitors";
25
+
26
+ /**
27
+ * Website Service
28
+ */
29
+ class WebsiteService {
30
+ /* eslint-disable @typescript-eslint/no-explicit-any */
31
+ public __resources: any[] = [
32
+ WebsiteBase,
33
+ WebsiteAnalytics,
34
+ WebsiteAvailability,
35
+ WebsiteBatch,
36
+ WebsiteCampaign,
37
+ WebsiteConversation,
38
+ WebsiteOperator,
39
+ WebsitePeople,
40
+ WebsiteHelpdesk,
41
+ WebsiteSettings,
42
+ WebsiteVerify,
43
+ WebsiteVisitors
44
+ ];
45
+ }
46
+
47
+ export interface WebsiteServiceInterface extends
48
+ WebsiteBase,
49
+ WebsiteAnalytics,
50
+ WebsiteAvailability,
51
+ WebsiteBatch,
52
+ WebsiteCampaign,
53
+ WebsiteConversation,
54
+ WebsiteOperator,
55
+ WebsitePeople,
56
+ WebsiteHelpdesk,
57
+ WebsiteSettings,
58
+ WebsiteVerify,
59
+ WebsiteVisitors {
60
+ }
61
+
62
+ export default WebsiteService;
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": "9.13.0",
4
+ "version": "10.0.2",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {
@@ -34,23 +34,28 @@
34
34
  "url": "https://github.com/crisp-im/node-crisp-api/blob/master/LICENSE"
35
35
  }
36
36
  ],
37
- "main": "lib/crisp.js",
38
- "types": "types/crisp.d.ts",
37
+ "main": "dist/crisp.js",
38
+ "types": "dist/crisp.d.ts",
39
39
  "engines": {
40
- "node": ">= 10.19.0"
40
+ "node": ">= 16.0.0"
41
41
  },
42
42
  "scripts": {
43
- "test": "check-build",
44
- "generate:types": "rm -rf ./types/* && tsc"
43
+ "test": "eslint lib",
44
+ "build": "npx tsc && npx tsc-alias && node -e \"const fs=require('fs');const f='dist/crisp.js';const v=require('./package.json').version;fs.writeFileSync(f, fs.readFileSync(f,'utf8').replace(/__PKG_VERSION_PLACEHOLDER__/g,v));\""
45
45
  },
46
46
  "devDependencies": {
47
- "check-build": "2.8.2",
48
- "typescript": "5.1.6"
47
+ "@typescript-eslint/eslint-plugin": "8.39.1",
48
+ "tsc-alias": "1.8.16",
49
+ "typescript": "5.9.2",
50
+ "eslint": "9.29.0",
51
+ "eslint-plugin-crisp": "1.1.13",
52
+ "eslint-plugin-jsdoc": "^54.1.0",
53
+ "globals": "15.15.0"
49
54
  },
50
55
  "dependencies": {
51
- "socket.io-client": "4.7.2",
52
- "fbemitter": "github:crisp-dev/emitter#695f60594bdca0c876e5c232de57702ab3151b6f",
53
- "got": "11.8.5"
56
+ "mitt": "3.0.1",
57
+ "got": "11.8.5",
58
+ "socket.io-client": "4.7.2"
54
59
  },
55
60
  "keywords": [
56
61
  "crisp",