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 Helpdesk {
16
20
  name?: string;
17
21
  url?: string;
@@ -156,6 +160,10 @@ export interface HelpdeskDomain {
156
160
  verified?: boolean;
157
161
  }
158
162
 
163
+ /**************************************************************************
164
+ * CLASSES
165
+ ***************************************************************************/
166
+
159
167
  /**
160
168
  * Crisp WebsiteHelpdesk Resource
161
169
  */
@@ -172,7 +180,7 @@ class WebsiteHelpdesk extends BaseResource {
172
180
  /**
173
181
  * Resolve Helpdesk
174
182
  */
175
- resolveHelpdesk(websiteID: string) : Promise<Helpdesk> {
183
+ resolveHelpdesk(websiteID: string): Promise<Helpdesk> {
176
184
  return this.crisp.get(
177
185
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk"])
178
186
  );
@@ -208,7 +216,9 @@ class WebsiteHelpdesk extends BaseResource {
208
216
  /**
209
217
  * List Helpdesk Locales
210
218
  */
211
- listHelpdeskLocales(websiteID: string, pageNumber: number = 1) {
219
+ listHelpdeskLocales(
220
+ websiteID: string, pageNumber: number = 1
221
+ ): Promise<HelpdeskLocale[]> {
212
222
  return this.crisp.get(
213
223
  this.crisp.prepareRestUrl([
214
224
  "website", websiteID, "helpdesk", "locales", String(pageNumber)
@@ -245,7 +255,9 @@ class WebsiteHelpdesk extends BaseResource {
245
255
  /**
246
256
  * Resolve Helpdesk Locale
247
257
  */
248
- resolveHelpdeskLocale(websiteID: string, locale: string) : Promise<HelpdeskLocale> {
258
+ resolveHelpdeskLocale(
259
+ websiteID: string, locale: string
260
+ ): Promise<HelpdeskLocale> {
249
261
  return this.crisp.get(
250
262
  this.crisp.prepareRestUrl([
251
263
  "website", websiteID, "helpdesk", "locale", locale
@@ -268,7 +280,8 @@ class WebsiteHelpdesk extends BaseResource {
268
280
  * List Helpdesk Locale Articles
269
281
  */
270
282
  listHelpdeskLocaleArticles(
271
- websiteID: string, locale: string, pageNumber: number = 1, options: object = {}
283
+ websiteID: string, locale: string, pageNumber: number = 1,
284
+ options: object = {}
272
285
  ) {
273
286
  return this.crisp.get(
274
287
  this.crisp.prepareRestUrl([
@@ -283,7 +296,9 @@ class WebsiteHelpdesk extends BaseResource {
283
296
  /**
284
297
  * Add A New Helpdesk Locale Article
285
298
  */
286
- addNewHelpdeskLocaleArticle(websiteID: string, locale: string, title: string) {
299
+ addNewHelpdeskLocaleArticle(
300
+ websiteID: string, locale: string, title: string
301
+ ) {
287
302
  return this.crisp.post(
288
303
  this.crisp.prepareRestUrl([
289
304
  "website", websiteID, "helpdesk", "locale", locale, "article"
@@ -300,7 +315,9 @@ class WebsiteHelpdesk extends BaseResource {
300
315
  /**
301
316
  * Check If Helpdesk Locale Article Exists
302
317
  */
303
- checkHelpdeskLocaleArticleExists(websiteID: string, locale: string, articleId: string) {
318
+ checkHelpdeskLocaleArticleExists(
319
+ websiteID: string, locale: string, articleId: string
320
+ ) {
304
321
  return this.crisp.head(
305
322
  this.crisp.prepareRestUrl([
306
323
  "website", websiteID, "helpdesk", "locale", locale, "article", articleId
@@ -311,7 +328,9 @@ class WebsiteHelpdesk extends BaseResource {
311
328
  /**
312
329
  * Resolve Helpdesk Locale Article
313
330
  */
314
- resolveHelpdeskLocaleArticle(websiteID: string, locale: string, articleId: string) : Promise<HelpdeskLocaleArticle> {
331
+ resolveHelpdeskLocaleArticle(
332
+ websiteID: string, locale: string, articleId: string
333
+ ): Promise<HelpdeskLocaleArticle> {
315
334
  return this.crisp.get(
316
335
  this.crisp.prepareRestUrl([
317
336
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -324,7 +343,8 @@ class WebsiteHelpdesk extends BaseResource {
324
343
  * Save Helpdesk Locale Article
325
344
  */
326
345
  saveHelpdeskLocaleArticle(
327
- websiteID: string, locale: string, articleId: string, article: HelpdeskLocaleArticle
346
+ websiteID: string, locale: string, articleId: string,
347
+ article: HelpdeskLocaleArticle
328
348
  ) {
329
349
  return this.crisp.put(
330
350
  this.crisp.prepareRestUrl([
@@ -340,7 +360,8 @@ class WebsiteHelpdesk extends BaseResource {
340
360
  * Update Helpdesk Locale Article
341
361
  */
342
362
  updateHelpdeskLocaleArticle(
343
- websiteID: string, locale: string, articleId: string, article: HelpdeskLocaleArticle
363
+ websiteID: string, locale: string, articleId: string,
364
+ article: HelpdeskLocaleArticle
344
365
  ) {
345
366
  return this.crisp.patch(
346
367
  this.crisp.prepareRestUrl([
@@ -355,7 +376,9 @@ class WebsiteHelpdesk extends BaseResource {
355
376
  /**
356
377
  * Delete Helpdesk Locale Article
357
378
  */
358
- deleteHelpdeskLocaleArticle(websiteID: string, locale: string, articleId: string) {
379
+ deleteHelpdeskLocaleArticle(
380
+ websiteID: string, locale: string, articleId: string
381
+ ) {
359
382
  return this.crisp.delete(
360
383
  this.crisp.prepareRestUrl([
361
384
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -383,7 +406,7 @@ class WebsiteHelpdesk extends BaseResource {
383
406
  */
384
407
  resolveHelpdeskLocaleArticleCategory(
385
408
  websiteID: string, locale: string, articleId: string
386
- ) : Promise<HelpdeskLocaleArticleCategory> {
409
+ ): Promise<HelpdeskLocaleArticleCategory> {
387
410
  return this.crisp.get(
388
411
  this.crisp.prepareRestUrl([
389
412
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -396,7 +419,8 @@ class WebsiteHelpdesk extends BaseResource {
396
419
  * Update Helpdesk Locale Article Category
397
420
  */
398
421
  updateHelpdeskLocaleArticleCategory(
399
- websiteID: string, locale: string, articleId: string, categoryId: string, sectionId?: string
422
+ websiteID: string, locale: string, articleId: string, categoryId: string,
423
+ sectionId?: string
400
424
  ) {
401
425
  // Generate body
402
426
  let body = {
@@ -423,7 +447,7 @@ class WebsiteHelpdesk extends BaseResource {
423
447
  */
424
448
  listHelpdeskLocaleArticleAlternates(
425
449
  websiteID: string, locale: string, articleId: string
426
- ) : Promise<HelpdeskLocaleArticleAlternate[]> {
450
+ ): Promise<HelpdeskLocaleArticleAlternate[]> {
427
451
  return this.crisp.get(
428
452
  this.crisp.prepareRestUrl([
429
453
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -451,7 +475,7 @@ class WebsiteHelpdesk extends BaseResource {
451
475
  */
452
476
  resolveHelpdeskLocaleArticleAlternate(
453
477
  websiteID: string, locale: string, articleId: string, localeLinked: string
454
- ) : Promise<HelpdeskLocaleArticleAlternate> {
478
+ ): Promise<HelpdeskLocaleArticleAlternate> {
455
479
  return this.crisp.get(
456
480
  this.crisp.prepareRestUrl([
457
481
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -464,7 +488,8 @@ class WebsiteHelpdesk extends BaseResource {
464
488
  * Save Helpdesk Locale Article Alternate
465
489
  */
466
490
  saveHelpdeskLocaleArticleAlternate(
467
- websiteID: string, locale: string, articleId: string, localeLinked: string, articleIdLinked: string
491
+ websiteID: string, locale: string, articleId: string, localeLinked: string,
492
+ articleIdLinked: string
468
493
  ) {
469
494
  return this.crisp.put(
470
495
  this.crisp.prepareRestUrl([
@@ -535,7 +560,7 @@ class WebsiteHelpdesk extends BaseResource {
535
560
  */
536
561
  listHelpdeskLocaleCategories(
537
562
  websiteID: string, locale: string, pageNumber: number = 1
538
- ) : Promise<HelpdeskLocaleArticleCategory[]> {
563
+ ): Promise<HelpdeskLocaleArticleCategory[]> {
539
564
  return this.crisp.get(
540
565
  this.crisp.prepareRestUrl([
541
566
  "website", websiteID, "helpdesk", "locale", locale, "categories",
@@ -580,7 +605,7 @@ class WebsiteHelpdesk extends BaseResource {
580
605
  */
581
606
  resolveHelpdeskLocaleCategory(
582
607
  websiteID: string, locale: string, categoryId: string
583
- ) : Promise<HelpdeskLocaleArticleCategory> {
608
+ ): Promise<HelpdeskLocaleArticleCategory> {
584
609
  return this.crisp.get(
585
610
  this.crisp.prepareRestUrl([
586
611
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -593,7 +618,8 @@ class WebsiteHelpdesk extends BaseResource {
593
618
  * Save Helpdesk Locale Category
594
619
  */
595
620
  saveHelpdeskLocaleCategory(
596
- websiteID: string, locale: string, categoryId: string, category: HelpdeskLocaleArticleCategory
621
+ websiteID: string, locale: string, categoryId: string,
622
+ category: HelpdeskLocaleArticleCategory
597
623
  ) {
598
624
  return this.crisp.put(
599
625
  this.crisp.prepareRestUrl([
@@ -608,7 +634,8 @@ class WebsiteHelpdesk extends BaseResource {
608
634
  * Update Helpdesk Locale Category
609
635
  */
610
636
  updateHelpdeskLocaleCategory(
611
- websiteID: string, locale: string, categoryId: string, category: HelpdeskLocaleArticleCategory
637
+ websiteID: string, locale: string, categoryId: string,
638
+ category: HelpdeskLocaleArticleCategory
612
639
  ) {
613
640
  return this.crisp.patch(
614
641
  this.crisp.prepareRestUrl([
@@ -638,8 +665,9 @@ class WebsiteHelpdesk extends BaseResource {
638
665
  * List Helpdesk Locale Sections
639
666
  */
640
667
  listHelpdeskLocaleSections(
641
- websiteID: string, locale: string, categoryId: string, pageNumber: number = 1
642
- ) : Promise<HelpdeskLocaleSection[]> {
668
+ websiteID: string, locale: string, categoryId: string,
669
+ pageNumber: number = 1
670
+ ): Promise<HelpdeskLocaleSection[]> {
643
671
  return this.crisp.get(
644
672
  this.crisp.prepareRestUrl([
645
673
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -687,7 +715,7 @@ class WebsiteHelpdesk extends BaseResource {
687
715
  */
688
716
  resolveHelpdeskLocaleSection(
689
717
  websiteID: string, locale: string, categoryId: string, sectionId: string
690
- ) : Promise<HelpdeskLocaleSection> {
718
+ ): Promise<HelpdeskLocaleSection> {
691
719
  return this.crisp.get(
692
720
  this.crisp.prepareRestUrl([
693
721
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -700,7 +728,8 @@ class WebsiteHelpdesk extends BaseResource {
700
728
  * Save Helpdesk Locale Section
701
729
  */
702
730
  saveHelpdeskLocaleSection(
703
- websiteID: string, locale: string, categoryId: string, sectionId: string, section: HelpdeskLocaleSection
731
+ websiteID: string, locale: string, categoryId: string, sectionId: string,
732
+ section: HelpdeskLocaleSection
704
733
  ) {
705
734
  return this.crisp.put(
706
735
  this.crisp.prepareRestUrl([
@@ -716,7 +745,8 @@ class WebsiteHelpdesk extends BaseResource {
716
745
  * Update Helpdesk Locale Section
717
746
  */
718
747
  updateHelpdeskLocaleSection(
719
- websiteID: string, locale: string, categoryId: string, sectionId: string, section: HelpdeskLocaleSection
748
+ websiteID: string, locale: string, categoryId: string, sectionId: string,
749
+ section: HelpdeskLocaleSection
720
750
  ) {
721
751
  return this.crisp.patch(
722
752
  this.crisp.prepareRestUrl([
@@ -746,8 +776,9 @@ class WebsiteHelpdesk extends BaseResource {
746
776
  * Map Helpdesk Locale Feedback Ratings
747
777
  */
748
778
  mapHelpdeskLocaleFeedbackRatings(
749
- websiteID: string, locale: string, filterDateStart?: string | null, filterDateEnd?: string | null
750
- ) : Promise<HelpdeskLocaleFeedbackRatings> {
779
+ websiteID: string, locale: string, filterDateStart?: string | null,
780
+ filterDateEnd?: string | null
781
+ ): Promise<HelpdeskLocaleFeedbackRatings> {
751
782
  filterDateStart = (filterDateStart || null);
752
783
  filterDateEnd = (filterDateEnd || null);
753
784
 
@@ -778,8 +809,9 @@ class WebsiteHelpdesk extends BaseResource {
778
809
  * List Helpdesk Locale Feedbacks
779
810
  */
780
811
  listHelpdeskLocaleFeedbacks(
781
- websiteID: string, locale: string, pageNumber: number = 1, filterDateStart?: string | null, filterDateEnd?: string | null
782
- ) : Promise<HelpdeskLocaleFeedbackItem[]> {
812
+ websiteID: string, locale: string, pageNumber: number = 1,
813
+ filterDateStart?: string | null, filterDateEnd?: string | null
814
+ ): Promise<HelpdeskLocaleFeedbackItem[]> {
783
815
  filterDateStart = (filterDateStart || null);
784
816
  filterDateEnd = (filterDateEnd || null);
785
817
 
@@ -843,7 +875,9 @@ class WebsiteHelpdesk extends BaseResource {
843
875
  /**
844
876
  * List Helpdesk Redirections
845
877
  */
846
- listHelpdeskRedirections(websiteID: string, pageNumber: number = 1) : Promise<HelpdeskRedirection[]> {
878
+ listHelpdeskRedirections(
879
+ websiteID: string, pageNumber: number = 1
880
+ ): Promise<HelpdeskRedirection[]> {
847
881
  return this.crisp.get(
848
882
  this.crisp.prepareRestUrl([
849
883
  "website", websiteID, "helpdesk", "redirections", String(pageNumber)
@@ -883,7 +917,9 @@ class WebsiteHelpdesk extends BaseResource {
883
917
  /**
884
918
  * Resolve Helpdesk Redirection
885
919
  */
886
- resolveHelpdeskRedirection(websiteID: string, redirectionId: string) : Promise<HelpdeskRedirection> {
920
+ resolveHelpdeskRedirection(
921
+ websiteID: string, redirectionId: string
922
+ ): Promise<HelpdeskRedirection> {
887
923
  return this.crisp.get(
888
924
  this.crisp.prepareRestUrl([
889
925
  "website", websiteID, "helpdesk", "redirection", redirectionId
@@ -905,7 +941,7 @@ class WebsiteHelpdesk extends BaseResource {
905
941
  /**
906
942
  * Resolve Helpdesk Settings
907
943
  */
908
- resolveHelpdeskSettings(websiteID: string) : Promise<HelpdeskSettings> {
944
+ resolveHelpdeskSettings(websiteID: string): Promise<HelpdeskSettings> {
909
945
  return this.crisp.get(
910
946
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk", "settings"])
911
947
  );
@@ -925,7 +961,7 @@ class WebsiteHelpdesk extends BaseResource {
925
961
  /**
926
962
  * Resolve Helpdesk Domain
927
963
  */
928
- resolveHelpdeskDomain(websiteID: string) : Promise<HelpdeskDomain> {
964
+ resolveHelpdeskDomain(websiteID: string): Promise<HelpdeskDomain> {
929
965
  return this.crisp.get(
930
966
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk", "domain"])
931
967
  );
@@ -934,7 +970,9 @@ class WebsiteHelpdesk extends BaseResource {
934
970
  /**
935
971
  * Request Helpdesk Domain Change
936
972
  */
937
- requestHelpdeskDomainChange(websiteID: string, basic: string, custom: string) {
973
+ requestHelpdeskDomainChange(
974
+ websiteID: string, basic: string, custom: string
975
+ ) {
938
976
  // Generate body
939
977
  let body = {};
940
978
 
@@ -979,4 +1017,8 @@ class WebsiteHelpdesk extends BaseResource {
979
1017
  };
980
1018
  }
981
1019
 
1020
+ /**************************************************************************
1021
+ * EXPORTS
1022
+ ***************************************************************************/
1023
+
982
1024
  export default WebsiteHelpdesk;
@@ -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 WebsiteOperatorListOne {
16
20
  type?: string;
17
21
  details?: WebsiteOperator;
@@ -55,6 +59,10 @@ export interface WebsiteOperatorEmailTarget {
55
59
  url?: string;
56
60
  }
57
61
 
62
+ /**************************************************************************
63
+ * CLASSES
64
+ ***************************************************************************/
65
+
58
66
  /**
59
67
  * Crisp WebsiteOperator Resource
60
68
  */
@@ -62,7 +70,7 @@ class WebsiteOperatorService extends BaseResource {
62
70
  /**
63
71
  * List Website Operators
64
72
  */
65
- listWebsiteOperators(websiteID: string) : Promise<WebsiteOperatorListOne[]> {
73
+ listWebsiteOperators(websiteID: string): Promise<WebsiteOperatorListOne[]> {
66
74
  return this.crisp.get(
67
75
  this.crisp.prepareRestUrl([
68
76
  "website", websiteID, "operators", "list"
@@ -73,7 +81,9 @@ class WebsiteOperatorService extends BaseResource {
73
81
  /**
74
82
  * List Last Active Website Operators
75
83
  */
76
- listLastActiveWebsiteOperators(websiteID: string) : Promise<WebsiteOperatorsLastActiveListOne[]> {
84
+ listLastActiveWebsiteOperators(
85
+ websiteID: string
86
+ ): Promise<WebsiteOperatorsLastActiveListOne[]> {
77
87
  return this.crisp.get(
78
88
  this.crisp.prepareRestUrl([
79
89
  "website", websiteID, "operators", "active"
@@ -95,7 +105,9 @@ class WebsiteOperatorService extends BaseResource {
95
105
  /**
96
106
  * Send Email To Website Operators
97
107
  */
98
- sendEmailToWebsiteOperators(websiteID: string, emailData: WebsiteOperatorEmail) {
108
+ sendEmailToWebsiteOperators(
109
+ websiteID: string, emailData: WebsiteOperatorEmail
110
+ ) {
99
111
  return this.crisp.post(
100
112
  this.crisp.prepareRestUrl(["website", websiteID, "operators", "email"]),
101
113
 
@@ -106,7 +118,9 @@ class WebsiteOperatorService extends BaseResource {
106
118
  /**
107
119
  * Get A Website Operator
108
120
  */
109
- getWebsiteOperator(websiteID: string, userID: string) : Promise<WebsiteOperator> {
121
+ getWebsiteOperator(
122
+ websiteID: string, userID: string
123
+ ): Promise<WebsiteOperator> {
110
124
  return this.crisp.get(
111
125
  this.crisp.prepareRestUrl([
112
126
  "website", websiteID, "operator", userID
@@ -117,7 +131,9 @@ class WebsiteOperatorService extends BaseResource {
117
131
  /**
118
132
  * Invite A Website Operator
119
133
  */
120
- inviteWebsiteOperator(websiteID: string, email: string, role: string, verify: boolean) {
134
+ inviteWebsiteOperator(
135
+ websiteID: string, email: string, role: string, verify: boolean
136
+ ) {
121
137
  return this.crisp.post(
122
138
  this.crisp.prepareRestUrl(["website", websiteID, "operator"]),
123
139
 
@@ -134,7 +150,9 @@ class WebsiteOperatorService extends BaseResource {
134
150
  /**
135
151
  * Change Operator Membership
136
152
  */
137
- changeOperatorMembership(websiteID: string, userID: string, role: string, title: string) {
153
+ changeOperatorMembership(
154
+ websiteID: string, userID: string, role: string, title: string
155
+ ) {
138
156
  return this.crisp.patch(
139
157
  this.crisp.prepareRestUrl(["website", websiteID, "operator", userID]),
140
158
 
@@ -157,5 +175,9 @@ class WebsiteOperatorService extends BaseResource {
157
175
  };
158
176
  }
159
177
 
178
+ /**************************************************************************
179
+ * EXPORTS
180
+ ***************************************************************************/
181
+
160
182
  export default WebsiteOperatorService;
161
183
 
@@ -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 PeopleStatistics {
16
20
  total?: number;
17
21
  }
@@ -172,6 +176,10 @@ export interface PeopleProfileImportSetupOptions {
172
176
  skip_header?: boolean;
173
177
  }
174
178
 
179
+ /**************************************************************************
180
+ * CLASSES
181
+ ***************************************************************************/
182
+
175
183
  /**
176
184
  * Crisp WebsitePeople Resource
177
185
  * @class
@@ -181,7 +189,7 @@ class WebsitePeople extends BaseResource {
181
189
  /**
182
190
  * Get People Statistics
183
191
  */
184
- getPeopleStatistics(websiteID: string) : Promise<PeopleStatistics> {
192
+ getPeopleStatistics(websiteID: string): Promise<PeopleStatistics> {
185
193
  return this.crisp.get(
186
194
  this.crisp.prepareRestUrl(["website", websiteID, "people", "stats"])
187
195
  );
@@ -190,7 +198,9 @@ class WebsitePeople extends BaseResource {
190
198
  /**
191
199
  * List Suggested People Segments
192
200
  */
193
- listSuggestedPeopleSegments(websiteID: string, pageNumber: number = 1) : Promise<PeopleSuggestedSegment[]> {
201
+ listSuggestedPeopleSegments(
202
+ websiteID: string, pageNumber: number = 1
203
+ ): Promise<PeopleSuggestedSegment[]> {
194
204
  return this.crisp.get(
195
205
  this.crisp.prepareRestUrl([
196
206
  "website", websiteID, "people", "suggest", "segments", String(pageNumber)
@@ -218,7 +228,9 @@ class WebsitePeople extends BaseResource {
218
228
  /**
219
229
  * List Suggested People Data Keys
220
230
  */
221
- listSuggestedPeopleDataKeys(websiteID: string, pageNumber: number = 1) : Promise<PeopleSuggestedDataKey[]> {
231
+ listSuggestedPeopleDataKeys(
232
+ websiteID: string, pageNumber: number = 1
233
+ ): Promise<PeopleSuggestedDataKey[]> {
222
234
  return this.crisp.get(
223
235
  this.crisp.prepareRestUrl([
224
236
  "website", websiteID, "people", "suggest", "data", String(pageNumber)
@@ -246,7 +258,9 @@ class WebsitePeople extends BaseResource {
246
258
  /**
247
259
  * List Suggested People Events
248
260
  */
249
- listSuggestedPeopleEvents(websiteID: string, pageNumber: number = 1) : Promise<PeopleSuggestedEvent[]> {
261
+ listSuggestedPeopleEvents(
262
+ websiteID: string, pageNumber: number = 1
263
+ ): Promise<PeopleSuggestedEvent[]> {
250
264
  return this.crisp.get(
251
265
  this.crisp.prepareRestUrl([
252
266
  "website", websiteID, "people", "suggest", "events", String(pageNumber)
@@ -275,9 +289,10 @@ class WebsitePeople extends BaseResource {
275
289
  * List People Profiles
276
290
  */
277
291
  listPeopleProfiles(
278
- websiteID: string, pageNumber: number = 1, searchField?: string, searchOrder?: string, searchOperator?: string,
279
- searchFilter?: string, searchText?: string
280
- ) : Promise<PeopleProfile[]> {
292
+ websiteID: string, pageNumber: number = 1, searchField?: string,
293
+ searchOrder?: string, searchOperator?: string, searchFilter?: string,
294
+ searchText?: string
295
+ ): Promise<PeopleProfile[]> {
281
296
  // Generate query
282
297
  let query = {};
283
298
 
@@ -351,7 +366,9 @@ class WebsitePeople extends BaseResource {
351
366
  /**
352
367
  * Get People Profile
353
368
  */
354
- savePeopleProfile(websiteID: string, peopleID: string, profile: PeopleProfileUpdateCard) {
369
+ savePeopleProfile(
370
+ websiteID: string, peopleID: string, profile: PeopleProfileUpdateCard
371
+ ) {
355
372
  return this.crisp.put(
356
373
  this.crisp.prepareRestUrl([
357
374
  "website", websiteID, "people", "profile", peopleID
@@ -364,7 +381,9 @@ class WebsitePeople extends BaseResource {
364
381
  /**
365
382
  * Update People Profile
366
383
  */
367
- updatePeopleProfile(websiteID: string, peopleID: string, profile: PeopleProfileUpdateCard) {
384
+ updatePeopleProfile(
385
+ websiteID: string, peopleID: string, profile: PeopleProfileUpdateCard
386
+ ) {
368
387
  return this.crisp.patch(
369
388
  this.crisp.prepareRestUrl([
370
389
  "website", websiteID, "people", "profile", peopleID
@@ -388,7 +407,9 @@ class WebsitePeople extends BaseResource {
388
407
  /**
389
408
  * List People Conversations
390
409
  */
391
- listPeopleConversations(websiteID: string, peopleID: string, pageNumber: number = 1) : Promise<string[]> {
410
+ listPeopleConversations(
411
+ websiteID: string, peopleID: string, pageNumber: number = 1
412
+ ): Promise<string[]> {
392
413
  return this.crisp.get(
393
414
  this.crisp.prepareRestUrl([
394
415
  "website", websiteID, "people", "conversations", peopleID, "list",
@@ -400,7 +421,9 @@ class WebsitePeople extends BaseResource {
400
421
  /**
401
422
  * List People Campaigns
402
423
  */
403
- listPeopleCampaigns(websiteID: string, peopleID: string, pageNumber: number = 1) : Promise<PeopleCampaign[]> {
424
+ listPeopleCampaigns(
425
+ websiteID: string, peopleID: string, pageNumber: number = 1
426
+ ): Promise<PeopleCampaign[]> {
404
427
  return this.crisp.get(
405
428
  this.crisp.prepareRestUrl([
406
429
  "website", websiteID, "people", "campaigns", peopleID, "list",
@@ -412,7 +435,9 @@ class WebsitePeople extends BaseResource {
412
435
  /**
413
436
  * Add A People Event
414
437
  */
415
- addPeopleEvent(websiteID: string, peopleID: string, peopleEvent: PeopleEvent) {
438
+ addPeopleEvent(
439
+ websiteID: string, peopleID: string, peopleEvent: PeopleEvent
440
+ ) {
416
441
  return this.crisp.post(
417
442
  this.crisp.prepareRestUrl([
418
443
  "website", websiteID, "people", "events", peopleID
@@ -425,7 +450,9 @@ class WebsitePeople extends BaseResource {
425
450
  /**
426
451
  * List People Events
427
452
  */
428
- listPeopleEvents(websiteID: string, peopleID: string, pageNumber: number = 1) : Promise<PeopleEvent[]> {
453
+ listPeopleEvents(
454
+ websiteID: string, peopleID: string, pageNumber: number = 1
455
+ ): Promise<PeopleEvent[]> {
429
456
  return this.crisp.get(
430
457
  this.crisp.prepareRestUrl([
431
458
  "website", websiteID, "people", "events", peopleID, "list",
@@ -437,7 +464,7 @@ class WebsitePeople extends BaseResource {
437
464
  /**
438
465
  * Get People Data
439
466
  */
440
- getPeopleData(websiteID: string, peopleID: string) : Promise<PeopleData> {
467
+ getPeopleData(websiteID: string, peopleID: string): Promise<PeopleData> {
441
468
  return this.crisp.get(
442
469
  this.crisp.prepareRestUrl([
443
470
  "website", websiteID, "people", "data", peopleID
@@ -448,7 +475,9 @@ class WebsitePeople extends BaseResource {
448
475
  /**
449
476
  * Save People Data
450
477
  */
451
- savePeopleData(websiteID: string, peopleID: string, peopleData: Record<string, boolean|string|number>) {
478
+ savePeopleData(
479
+ websiteID: string, peopleID: string, peopleData: Record<string, boolean|string|number>
480
+ ) {
452
481
  return this.crisp.put(
453
482
  this.crisp.prepareRestUrl([
454
483
  "website", websiteID, "people", "data", peopleID
@@ -461,7 +490,10 @@ class WebsitePeople extends BaseResource {
461
490
  /**
462
491
  * Update People Data
463
492
  */
464
- updatePeopleData(websiteID: string, peopleID: string, peopleData: Record<string, boolean|string|number>) {
493
+ updatePeopleData(
494
+ websiteID: string, peopleID: string,
495
+ peopleData: Record<string, boolean|string|number>
496
+ ) {
465
497
  return this.crisp.patch(
466
498
  this.crisp.prepareRestUrl([
467
499
  "website", websiteID, "people", "data", peopleID
@@ -474,7 +506,9 @@ class WebsitePeople extends BaseResource {
474
506
  /**
475
507
  * Get People Subscription Status
476
508
  */
477
- getPeopleSubscriptionStatus(websiteID: string, peopleID: string) : Promise<PeopleSubscription> {
509
+ getPeopleSubscriptionStatus(
510
+ websiteID: string, peopleID: string
511
+ ): Promise<PeopleSubscription> {
478
512
  return this.crisp.get(
479
513
  this.crisp.prepareRestUrl([
480
514
  "website", websiteID, "people", "subscription", peopleID
@@ -486,7 +520,8 @@ class WebsitePeople extends BaseResource {
486
520
  * Update People Subscription Status
487
521
  */
488
522
  updatePeopleSubscriptionStatus(
489
- websiteID: string, peopleID: string, peopleSubscription: PeopleSubscriptionUpdate
523
+ websiteID: string, peopleID: string,
524
+ peopleSubscription: PeopleSubscriptionUpdate
490
525
  ) {
491
526
  return this.crisp.patch(
492
527
  this.crisp.prepareRestUrl([
@@ -513,7 +548,9 @@ class WebsitePeople extends BaseResource {
513
548
  /**
514
549
  * Import People Profiles
515
550
  */
516
- importPeopleProfiles(websiteID: string, importSetup: PeopleProfileImportSetup) {
551
+ importPeopleProfiles(
552
+ websiteID: string, importSetup: PeopleProfileImportSetup
553
+ ) {
517
554
  return this.crisp.post(
518
555
  this.crisp.prepareRestUrl([
519
556
  "website", websiteID, "people", "import", "profiles"
@@ -524,4 +561,8 @@ class WebsitePeople extends BaseResource {
524
561
  };
525
562
  }
526
563
 
564
+ /**************************************************************************
565
+ * EXPORTS
566
+ ***************************************************************************/
567
+
527
568
  export default WebsitePeople;
@@ -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 WebsiteSettings {
16
20
  websiteID?: string;
17
21
  name?: string;
@@ -165,6 +169,10 @@ export interface WebsiteSettingsUpdateChatbox {
165
169
  blocked_ips?: string[];
166
170
  }
167
171
 
172
+ /**************************************************************************
173
+ * CLASSES
174
+ ***************************************************************************/
175
+
168
176
  /**
169
177
  * Crisp WebsiteSettings Resource
170
178
  */
@@ -172,7 +180,7 @@ class WebsiteSettingsService extends BaseResource {
172
180
  /**
173
181
  * Get Website Settings
174
182
  */
175
- getWebsiteSettings(websiteID: string) : Promise<WebsiteSettings> {
183
+ getWebsiteSettings(websiteID: string): Promise<WebsiteSettings> {
176
184
  return this.crisp.get(
177
185
  this.crisp.prepareRestUrl(["website", websiteID, "settings"])
178
186
  );
@@ -183,10 +191,17 @@ class WebsiteSettingsService extends BaseResource {
183
191
  */
184
192
  updateWebsiteSettings(websiteID: string, settings: WebsiteSettingsUpdate) {
185
193
  return this.crisp.patch(
186
- this.crisp.prepareRestUrl(["website", websiteID, "settings"]), null, settings
194
+ this.crisp.prepareRestUrl(["website", websiteID, "settings"]),
195
+
196
+ null,
197
+ settings
187
198
  );
188
199
  };
189
200
  }
190
201
 
202
+ /**************************************************************************
203
+ * EXPORTS
204
+ ***************************************************************************/
205
+
191
206
  export default WebsiteSettingsService;
192
207