crisp-api 10.0.2 → 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.
Files changed (71) hide show
  1. package/CHANGELOG.md +6 -2
  2. package/dist/crisp.d.ts +41 -29
  3. package/dist/crisp.js +43 -34
  4. package/dist/resources/BaseResource.d.ts +6 -0
  5. package/dist/resources/BaseResource.js +6 -0
  6. package/dist/resources/BucketURL.d.ts +9 -0
  7. package/dist/resources/BucketURL.js +6 -0
  8. package/dist/resources/MediaAnimation.d.ts +6 -0
  9. package/dist/resources/MediaAnimation.js +9 -1
  10. package/dist/resources/PluginConnect.d.ts +9 -0
  11. package/dist/resources/PluginConnect.js +6 -0
  12. package/dist/resources/PluginSubscription.d.ts +9 -0
  13. package/dist/resources/PluginSubscription.js +9 -1
  14. package/dist/resources/WebsiteAnalytics.d.ts +6 -0
  15. package/dist/resources/WebsiteAnalytics.js +9 -1
  16. package/dist/resources/WebsiteAvailability.d.ts +9 -0
  17. package/dist/resources/WebsiteAvailability.js +12 -2
  18. package/dist/resources/WebsiteBase.d.ts +9 -0
  19. package/dist/resources/WebsiteBase.js +6 -0
  20. package/dist/resources/WebsiteBatch.d.ts +9 -0
  21. package/dist/resources/WebsiteBatch.js +6 -0
  22. package/dist/resources/WebsiteCampaign.d.ts +9 -0
  23. package/dist/resources/WebsiteCampaign.js +8 -1
  24. package/dist/resources/WebsiteConversation.d.ts +9 -0
  25. package/dist/resources/WebsiteConversation.js +15 -3
  26. package/dist/resources/WebsiteHelpdesk.d.ts +10 -1
  27. package/dist/resources/WebsiteHelpdesk.js +6 -0
  28. package/dist/resources/WebsiteOperator.d.ts +9 -0
  29. package/dist/resources/WebsiteOperator.js +6 -0
  30. package/dist/resources/WebsitePeople.d.ts +9 -0
  31. package/dist/resources/WebsitePeople.js +6 -0
  32. package/dist/resources/WebsiteSettings.d.ts +9 -0
  33. package/dist/resources/WebsiteSettings.js +6 -0
  34. package/dist/resources/WebsiteVerify.d.ts +9 -0
  35. package/dist/resources/WebsiteVerify.js +6 -0
  36. package/dist/resources/WebsiteVisitors.d.ts +9 -0
  37. package/dist/resources/WebsiteVisitors.js +12 -2
  38. package/dist/resources/index.d.ts +3 -0
  39. package/dist/resources/index.js +3 -1
  40. package/dist/services/bucket.d.ts +6 -0
  41. package/dist/services/bucket.js +3 -0
  42. package/dist/services/media.d.ts +6 -0
  43. package/dist/services/media.js +3 -0
  44. package/dist/services/plugin.d.ts +6 -0
  45. package/dist/services/plugin.js +3 -0
  46. package/dist/services/website.d.ts +6 -0
  47. package/dist/services/website.js +3 -0
  48. package/lib/crisp.ts +123 -74
  49. package/lib/resources/BaseResource.ts +8 -0
  50. package/lib/resources/BucketURL.ts +12 -3
  51. package/lib/resources/MediaAnimation.ts +11 -1
  52. package/lib/resources/PluginConnect.ts +12 -5
  53. package/lib/resources/PluginSubscription.ts +36 -8
  54. package/lib/resources/WebsiteAnalytics.ts +11 -1
  55. package/lib/resources/WebsiteAvailability.ts +24 -4
  56. package/lib/resources/WebsiteBase.ts +14 -3
  57. package/lib/resources/WebsiteBatch.ts +24 -4
  58. package/lib/resources/WebsiteCampaign.ts +49 -16
  59. package/lib/resources/WebsiteConversation.ts +136 -45
  60. package/lib/resources/WebsiteHelpdesk.ts +75 -33
  61. package/lib/resources/WebsiteOperator.ts +28 -6
  62. package/lib/resources/WebsitePeople.ts +60 -19
  63. package/lib/resources/WebsiteSettings.ts +17 -2
  64. package/lib/resources/WebsiteVerify.ts +17 -3
  65. package/lib/resources/WebsiteVisitors.ts +32 -9
  66. package/lib/resources/index.ts +4 -1
  67. package/lib/services/bucket.ts +8 -0
  68. package/lib/services/media.ts +8 -0
  69. package/lib/services/plugin.ts +8 -0
  70. package/lib/services/website.ts +8 -0
  71. package/package.json +1 -1
@@ -12,6 +12,10 @@
12
12
  // PROJECT: RESOURCES
13
13
  import BaseResource from "./BaseResource";
14
14
 
15
+ /**************************************************************************
16
+ * INTERFACES
17
+ ***************************************************************************/
18
+
15
19
  export interface WebsiteVerifyKeyData {
16
20
  data?: WebsiteVerifyKey;
17
21
  }
@@ -28,6 +32,10 @@ export interface WebsiteVerifySettingsUpdate {
28
32
  enabled?: boolean;
29
33
  }
30
34
 
35
+ /**************************************************************************
36
+ * CLASSES
37
+ ***************************************************************************/
38
+
31
39
  /**
32
40
  * Crisp WebsiteVerify Resource
33
41
  */
@@ -35,7 +43,7 @@ class WebsiteVerify extends BaseResource {
35
43
  /**
36
44
  * Get Verify Settings
37
45
  */
38
- getVerifySettings(websiteID: string) : Promise<WebsiteVerifySettings> {
46
+ getVerifySettings(websiteID: string): Promise<WebsiteVerifySettings> {
39
47
  return this.crisp.get(
40
48
  this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"])
41
49
  );
@@ -44,7 +52,9 @@ class WebsiteVerify extends BaseResource {
44
52
  /**
45
53
  * Update Verify Settings
46
54
  */
47
- updateVerifySettings(websiteID: string, settings: WebsiteVerifySettingsUpdate) {
55
+ updateVerifySettings(
56
+ websiteID: string, settings: WebsiteVerifySettingsUpdate
57
+ ) {
48
58
  return this.crisp.patch(
49
59
  this.crisp.prepareRestUrl(["website", websiteID, "verify", "settings"]),
50
60
 
@@ -55,7 +65,7 @@ class WebsiteVerify extends BaseResource {
55
65
  /**
56
66
  * Get Verify Key
57
67
  */
58
- getVerifyKey(websiteID: string) : Promise<WebsiteVerifyKey> {
68
+ getVerifyKey(websiteID: string): Promise<WebsiteVerifyKey> {
59
69
  return this.crisp.get(
60
70
  this.crisp.prepareRestUrl(["website", websiteID, "verify", "key"])
61
71
  );
@@ -73,4 +83,8 @@ class WebsiteVerify extends BaseResource {
73
83
  };
74
84
  }
75
85
 
86
+ /**************************************************************************
87
+ * EXPORTS
88
+ ***************************************************************************/
89
+
76
90
  export default WebsiteVerify;
@@ -12,6 +12,10 @@
12
12
  // PROJECT: RESOURCES
13
13
  import BaseResource from "./BaseResource";
14
14
 
15
+ /**************************************************************************
16
+ * INTERFACES
17
+ ***************************************************************************/
18
+
15
19
  export interface WebsiteVisitorCount {
16
20
  count?: number;
17
21
  active?: number;
@@ -100,6 +104,10 @@ export interface WebsiteVisitorsBlocked {
100
104
  blocked?: number;
101
105
  }
102
106
 
107
+ /**************************************************************************
108
+ * CLASSES
109
+ ***************************************************************************/
110
+
103
111
  /**
104
112
  * Crisp WebsiteVisitors Resource
105
113
  */
@@ -107,7 +115,7 @@ class WebsiteVisitors extends BaseResource {
107
115
  /**
108
116
  * Count Visitors
109
117
  */
110
- countVisitors(websiteID: string) : Promise<WebsiteVisitorCount> {
118
+ countVisitors(websiteID: string): Promise<WebsiteVisitorCount> {
111
119
  return this.crisp.get(
112
120
  this.crisp.prepareRestUrl(["website", websiteID, "visitors", "count"])
113
121
  );
@@ -116,7 +124,9 @@ class WebsiteVisitors extends BaseResource {
116
124
  /**
117
125
  * List Visitors
118
126
  */
119
- listVisitors(websiteID: string, pageNumber: number = 1) : Promise<WebsiteVisitor[]> {
127
+ listVisitors(
128
+ websiteID: string, pageNumber: number = 1
129
+ ): Promise<WebsiteVisitor[]> {
120
130
  return this.crisp.get(
121
131
  this.crisp.prepareRestUrl([
122
132
  "website", websiteID, "visitors", "list", String(pageNumber)
@@ -128,8 +138,9 @@ class WebsiteVisitors extends BaseResource {
128
138
  * Pinpoint Visitors On A Map
129
139
  */
130
140
  pinpointVisitorsOnMap(
131
- websiteID: string, centerLongitude: number, centerLatitude: number, centerRadius: number
132
- ) : Promise<WebsiteVisitorsMapPoint[]> {
141
+ websiteID: string, centerLongitude: number, centerLatitude: number,
142
+ centerRadius: number
143
+ ): Promise<WebsiteVisitorsMapPoint[]> {
133
144
  // Generate query
134
145
  const query: Record<string, string> = {};
135
146
 
@@ -157,7 +168,9 @@ class WebsiteVisitors extends BaseResource {
157
168
  /**
158
169
  * Get Session Identifier From Token
159
170
  */
160
- getSessionIdentifierFromToken(websiteID: string, tokenID: string) : Promise<WebsiteVisitorsToken> {
171
+ getSessionIdentifierFromToken(
172
+ websiteID: string, tokenID: string
173
+ ): Promise<WebsiteVisitorsToken> {
161
174
  return this.crisp.get(
162
175
  this.crisp.prepareRestUrl([
163
176
  "website", websiteID, "visitors", "token", tokenID
@@ -168,7 +181,7 @@ class WebsiteVisitors extends BaseResource {
168
181
  /**
169
182
  * Count Blocked Visitors
170
183
  */
171
- countBlockedVisitors(websiteID: string) : Promise<WebsiteVisitorsBlocked> {
184
+ countBlockedVisitors(websiteID: string): Promise<WebsiteVisitorsBlocked> {
172
185
  return this.crisp.get(
173
186
  this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked"])
174
187
  );
@@ -177,9 +190,13 @@ class WebsiteVisitors extends BaseResource {
177
190
  /**
178
191
  * Count Blocked Visitors In Rule
179
192
  */
180
- countBlockedVisitorsInRule(websiteID: string, rule: string) : Promise<number> {
193
+ countBlockedVisitorsInRule(
194
+ websiteID: string, rule: string
195
+ ): Promise<number> {
181
196
  return this.crisp.get(
182
- this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked", rule])
197
+ this.crisp.prepareRestUrl([
198
+ "website", websiteID, "visitors", "blocked", rule
199
+ ])
183
200
  );
184
201
  };
185
202
 
@@ -188,9 +205,15 @@ class WebsiteVisitors extends BaseResource {
188
205
  */
189
206
  clearBlockedVisitorsInRule(websiteID: string, rule: string) {
190
207
  return this.crisp.delete(
191
- this.crisp.prepareRestUrl(["website", websiteID, "visitors", "blocked", rule])
208
+ this.crisp.prepareRestUrl([
209
+ "website", websiteID, "visitors", "blocked", rule
210
+ ])
192
211
  );
193
212
  };
194
213
  }
195
214
 
215
+ /**************************************************************************
216
+ * EXPORTS
217
+ ***************************************************************************/
218
+
196
219
  export default WebsiteVisitors;
@@ -5,7 +5,10 @@
5
5
  * Author: Baptiste Jamin <baptiste@crisp.chat>
6
6
  */
7
7
 
8
- // Used to export all types
8
+ /**************************************************************************
9
+ * EXPORTS
10
+ ***************************************************************************/
11
+
9
12
  export * from "./BaseResource";
10
13
  export * from "./BucketURL";
11
14
  export * from "./MediaAnimation";
@@ -12,6 +12,10 @@
12
12
  // PROJECT: RESOURCES
13
13
  import BucketURL from "@/resources/BucketURL";
14
14
 
15
+ /**************************************************************************
16
+ * CLASSES
17
+ ***************************************************************************/
18
+
15
19
  /**
16
20
  * Bucket Service
17
21
  */
@@ -22,6 +26,10 @@ class BucketService {
22
26
  ];
23
27
  }
24
28
 
29
+ /**************************************************************************
30
+ * EXPORTS
31
+ ***************************************************************************/
32
+
25
33
  export interface BucketServiceInterface extends
26
34
  BucketURL {}
27
35
 
@@ -12,6 +12,10 @@
12
12
  // PROJECT: RESOURCES
13
13
  import MediaAnimation from "@/resources/MediaAnimation";
14
14
 
15
+ /**************************************************************************
16
+ * CLASSES
17
+ ***************************************************************************/
18
+
15
19
  /**
16
20
  * Crisp Media Service
17
21
  */
@@ -22,6 +26,10 @@ class MediaService {
22
26
  ];
23
27
  }
24
28
 
29
+ /**************************************************************************
30
+ * EXPORTS
31
+ ***************************************************************************/
32
+
25
33
  export interface MediaServiceInterface extends
26
34
  MediaAnimation {}
27
35
 
@@ -13,6 +13,10 @@
13
13
  import PluginConnect from "@/resources/PluginConnect";
14
14
  import PluginSubscription from "@/resources/PluginSubscription";
15
15
 
16
+ /**************************************************************************
17
+ * CLASSES
18
+ ***************************************************************************/
19
+
16
20
  /**
17
21
  * Crisp Plugin Service
18
22
  */
@@ -24,6 +28,10 @@ class PluginService {
24
28
  ];
25
29
  }
26
30
 
31
+ /**************************************************************************
32
+ * EXPORTS
33
+ ***************************************************************************/
34
+
27
35
  export interface PluginServiceInterface extends
28
36
  PluginConnect,
29
37
  PluginSubscription {
@@ -23,6 +23,10 @@ import WebsiteSettings from "@/resources/WebsiteSettings";
23
23
  import WebsiteVerify from "@/resources/WebsiteVerify";
24
24
  import WebsiteVisitors from "@/resources/WebsiteVisitors";
25
25
 
26
+ /**************************************************************************
27
+ * CLASSES
28
+ ***************************************************************************/
29
+
26
30
  /**
27
31
  * Website Service
28
32
  */
@@ -44,6 +48,10 @@ class WebsiteService {
44
48
  ];
45
49
  }
46
50
 
51
+ /**************************************************************************
52
+ * EXPORTS
53
+ ***************************************************************************/
54
+
47
55
  export interface WebsiteServiceInterface extends
48
56
  WebsiteBase,
49
57
  WebsiteAnalytics,
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.0.2",
4
+ "version": "10.0.3",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {