crisp-api 10.0.2 → 10.0.4

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 +15 -2
  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 +81 -34
  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;
@@ -48,6 +52,11 @@ export interface HelpdeskLocaleArticleAlternate {
48
52
  article_id?: string;
49
53
  }
50
54
 
55
+ export interface HelpdeskLocaleArticlePage {
56
+ title?: string;
57
+ url?: string;
58
+ }
59
+
51
60
  export interface HelpdeskLocaleSection {
52
61
  section_id?: string;
53
62
  name?: string;
@@ -156,6 +165,10 @@ export interface HelpdeskDomain {
156
165
  verified?: boolean;
157
166
  }
158
167
 
168
+ /**************************************************************************
169
+ * CLASSES
170
+ ***************************************************************************/
171
+
159
172
  /**
160
173
  * Crisp WebsiteHelpdesk Resource
161
174
  */
@@ -172,7 +185,7 @@ class WebsiteHelpdesk extends BaseResource {
172
185
  /**
173
186
  * Resolve Helpdesk
174
187
  */
175
- resolveHelpdesk(websiteID: string) : Promise<Helpdesk> {
188
+ resolveHelpdesk(websiteID: string): Promise<Helpdesk> {
176
189
  return this.crisp.get(
177
190
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk"])
178
191
  );
@@ -208,7 +221,9 @@ class WebsiteHelpdesk extends BaseResource {
208
221
  /**
209
222
  * List Helpdesk Locales
210
223
  */
211
- listHelpdeskLocales(websiteID: string, pageNumber: number = 1) {
224
+ listHelpdeskLocales(
225
+ websiteID: string, pageNumber: number = 1
226
+ ): Promise<HelpdeskLocale[]> {
212
227
  return this.crisp.get(
213
228
  this.crisp.prepareRestUrl([
214
229
  "website", websiteID, "helpdesk", "locales", String(pageNumber)
@@ -245,7 +260,9 @@ class WebsiteHelpdesk extends BaseResource {
245
260
  /**
246
261
  * Resolve Helpdesk Locale
247
262
  */
248
- resolveHelpdeskLocale(websiteID: string, locale: string) : Promise<HelpdeskLocale> {
263
+ resolveHelpdeskLocale(
264
+ websiteID: string, locale: string
265
+ ): Promise<HelpdeskLocale> {
249
266
  return this.crisp.get(
250
267
  this.crisp.prepareRestUrl([
251
268
  "website", websiteID, "helpdesk", "locale", locale
@@ -268,7 +285,8 @@ class WebsiteHelpdesk extends BaseResource {
268
285
  * List Helpdesk Locale Articles
269
286
  */
270
287
  listHelpdeskLocaleArticles(
271
- websiteID: string, locale: string, pageNumber: number = 1, options: object = {}
288
+ websiteID: string, locale: string, pageNumber: number = 1,
289
+ options: object = {}
272
290
  ) {
273
291
  return this.crisp.get(
274
292
  this.crisp.prepareRestUrl([
@@ -283,7 +301,9 @@ class WebsiteHelpdesk extends BaseResource {
283
301
  /**
284
302
  * Add A New Helpdesk Locale Article
285
303
  */
286
- addNewHelpdeskLocaleArticle(websiteID: string, locale: string, title: string) {
304
+ addNewHelpdeskLocaleArticle(
305
+ websiteID: string, locale: string, title: string
306
+ ) {
287
307
  return this.crisp.post(
288
308
  this.crisp.prepareRestUrl([
289
309
  "website", websiteID, "helpdesk", "locale", locale, "article"
@@ -300,7 +320,9 @@ class WebsiteHelpdesk extends BaseResource {
300
320
  /**
301
321
  * Check If Helpdesk Locale Article Exists
302
322
  */
303
- checkHelpdeskLocaleArticleExists(websiteID: string, locale: string, articleId: string) {
323
+ checkHelpdeskLocaleArticleExists(
324
+ websiteID: string, locale: string, articleId: string
325
+ ) {
304
326
  return this.crisp.head(
305
327
  this.crisp.prepareRestUrl([
306
328
  "website", websiteID, "helpdesk", "locale", locale, "article", articleId
@@ -311,7 +333,9 @@ class WebsiteHelpdesk extends BaseResource {
311
333
  /**
312
334
  * Resolve Helpdesk Locale Article
313
335
  */
314
- resolveHelpdeskLocaleArticle(websiteID: string, locale: string, articleId: string) : Promise<HelpdeskLocaleArticle> {
336
+ resolveHelpdeskLocaleArticle(
337
+ websiteID: string, locale: string, articleId: string
338
+ ): Promise<HelpdeskLocaleArticle> {
315
339
  return this.crisp.get(
316
340
  this.crisp.prepareRestUrl([
317
341
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -324,7 +348,8 @@ class WebsiteHelpdesk extends BaseResource {
324
348
  * Save Helpdesk Locale Article
325
349
  */
326
350
  saveHelpdeskLocaleArticle(
327
- websiteID: string, locale: string, articleId: string, article: HelpdeskLocaleArticle
351
+ websiteID: string, locale: string, articleId: string,
352
+ article: HelpdeskLocaleArticle
328
353
  ) {
329
354
  return this.crisp.put(
330
355
  this.crisp.prepareRestUrl([
@@ -340,7 +365,8 @@ class WebsiteHelpdesk extends BaseResource {
340
365
  * Update Helpdesk Locale Article
341
366
  */
342
367
  updateHelpdeskLocaleArticle(
343
- websiteID: string, locale: string, articleId: string, article: HelpdeskLocaleArticle
368
+ websiteID: string, locale: string, articleId: string,
369
+ article: HelpdeskLocaleArticle
344
370
  ) {
345
371
  return this.crisp.patch(
346
372
  this.crisp.prepareRestUrl([
@@ -355,7 +381,9 @@ class WebsiteHelpdesk extends BaseResource {
355
381
  /**
356
382
  * Delete Helpdesk Locale Article
357
383
  */
358
- deleteHelpdeskLocaleArticle(websiteID: string, locale: string, articleId: string) {
384
+ deleteHelpdeskLocaleArticle(
385
+ websiteID: string, locale: string, articleId: string
386
+ ) {
359
387
  return this.crisp.delete(
360
388
  this.crisp.prepareRestUrl([
361
389
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -369,7 +397,7 @@ class WebsiteHelpdesk extends BaseResource {
369
397
  */
370
398
  resolveHelpdeskLocaleArticlePage(
371
399
  websiteID: string, locale: string, articleId: string
372
- ) {
400
+ ) : Promise<HelpdeskLocaleArticlePage> {
373
401
  return this.crisp.get(
374
402
  this.crisp.prepareRestUrl([
375
403
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -383,7 +411,7 @@ class WebsiteHelpdesk extends BaseResource {
383
411
  */
384
412
  resolveHelpdeskLocaleArticleCategory(
385
413
  websiteID: string, locale: string, articleId: string
386
- ) : Promise<HelpdeskLocaleArticleCategory> {
414
+ ): Promise<HelpdeskLocaleArticleCategory> {
387
415
  return this.crisp.get(
388
416
  this.crisp.prepareRestUrl([
389
417
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -396,7 +424,8 @@ class WebsiteHelpdesk extends BaseResource {
396
424
  * Update Helpdesk Locale Article Category
397
425
  */
398
426
  updateHelpdeskLocaleArticleCategory(
399
- websiteID: string, locale: string, articleId: string, categoryId: string, sectionId?: string
427
+ websiteID: string, locale: string, articleId: string, categoryId: string,
428
+ sectionId?: string
400
429
  ) {
401
430
  // Generate body
402
431
  let body = {
@@ -423,7 +452,7 @@ class WebsiteHelpdesk extends BaseResource {
423
452
  */
424
453
  listHelpdeskLocaleArticleAlternates(
425
454
  websiteID: string, locale: string, articleId: string
426
- ) : Promise<HelpdeskLocaleArticleAlternate[]> {
455
+ ): Promise<HelpdeskLocaleArticleAlternate[]> {
427
456
  return this.crisp.get(
428
457
  this.crisp.prepareRestUrl([
429
458
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -451,7 +480,7 @@ class WebsiteHelpdesk extends BaseResource {
451
480
  */
452
481
  resolveHelpdeskLocaleArticleAlternate(
453
482
  websiteID: string, locale: string, articleId: string, localeLinked: string
454
- ) : Promise<HelpdeskLocaleArticleAlternate> {
483
+ ): Promise<HelpdeskLocaleArticleAlternate> {
455
484
  return this.crisp.get(
456
485
  this.crisp.prepareRestUrl([
457
486
  "website", websiteID, "helpdesk", "locale", locale, "article",
@@ -464,7 +493,8 @@ class WebsiteHelpdesk extends BaseResource {
464
493
  * Save Helpdesk Locale Article Alternate
465
494
  */
466
495
  saveHelpdeskLocaleArticleAlternate(
467
- websiteID: string, locale: string, articleId: string, localeLinked: string, articleIdLinked: string
496
+ websiteID: string, locale: string, articleId: string, localeLinked: string,
497
+ articleIdLinked: string
468
498
  ) {
469
499
  return this.crisp.put(
470
500
  this.crisp.prepareRestUrl([
@@ -535,7 +565,7 @@ class WebsiteHelpdesk extends BaseResource {
535
565
  */
536
566
  listHelpdeskLocaleCategories(
537
567
  websiteID: string, locale: string, pageNumber: number = 1
538
- ) : Promise<HelpdeskLocaleArticleCategory[]> {
568
+ ): Promise<HelpdeskLocaleArticleCategory[]> {
539
569
  return this.crisp.get(
540
570
  this.crisp.prepareRestUrl([
541
571
  "website", websiteID, "helpdesk", "locale", locale, "categories",
@@ -580,7 +610,7 @@ class WebsiteHelpdesk extends BaseResource {
580
610
  */
581
611
  resolveHelpdeskLocaleCategory(
582
612
  websiteID: string, locale: string, categoryId: string
583
- ) : Promise<HelpdeskLocaleArticleCategory> {
613
+ ): Promise<HelpdeskLocaleArticleCategory> {
584
614
  return this.crisp.get(
585
615
  this.crisp.prepareRestUrl([
586
616
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -593,7 +623,8 @@ class WebsiteHelpdesk extends BaseResource {
593
623
  * Save Helpdesk Locale Category
594
624
  */
595
625
  saveHelpdeskLocaleCategory(
596
- websiteID: string, locale: string, categoryId: string, category: HelpdeskLocaleArticleCategory
626
+ websiteID: string, locale: string, categoryId: string,
627
+ category: HelpdeskLocaleArticleCategory
597
628
  ) {
598
629
  return this.crisp.put(
599
630
  this.crisp.prepareRestUrl([
@@ -608,7 +639,8 @@ class WebsiteHelpdesk extends BaseResource {
608
639
  * Update Helpdesk Locale Category
609
640
  */
610
641
  updateHelpdeskLocaleCategory(
611
- websiteID: string, locale: string, categoryId: string, category: HelpdeskLocaleArticleCategory
642
+ websiteID: string, locale: string, categoryId: string,
643
+ category: HelpdeskLocaleArticleCategory
612
644
  ) {
613
645
  return this.crisp.patch(
614
646
  this.crisp.prepareRestUrl([
@@ -638,8 +670,9 @@ class WebsiteHelpdesk extends BaseResource {
638
670
  * List Helpdesk Locale Sections
639
671
  */
640
672
  listHelpdeskLocaleSections(
641
- websiteID: string, locale: string, categoryId: string, pageNumber: number = 1
642
- ) : Promise<HelpdeskLocaleSection[]> {
673
+ websiteID: string, locale: string, categoryId: string,
674
+ pageNumber: number = 1
675
+ ): Promise<HelpdeskLocaleSection[]> {
643
676
  return this.crisp.get(
644
677
  this.crisp.prepareRestUrl([
645
678
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -687,7 +720,7 @@ class WebsiteHelpdesk extends BaseResource {
687
720
  */
688
721
  resolveHelpdeskLocaleSection(
689
722
  websiteID: string, locale: string, categoryId: string, sectionId: string
690
- ) : Promise<HelpdeskLocaleSection> {
723
+ ): Promise<HelpdeskLocaleSection> {
691
724
  return this.crisp.get(
692
725
  this.crisp.prepareRestUrl([
693
726
  "website", websiteID, "helpdesk", "locale", locale, "category",
@@ -700,7 +733,8 @@ class WebsiteHelpdesk extends BaseResource {
700
733
  * Save Helpdesk Locale Section
701
734
  */
702
735
  saveHelpdeskLocaleSection(
703
- websiteID: string, locale: string, categoryId: string, sectionId: string, section: HelpdeskLocaleSection
736
+ websiteID: string, locale: string, categoryId: string, sectionId: string,
737
+ section: HelpdeskLocaleSection
704
738
  ) {
705
739
  return this.crisp.put(
706
740
  this.crisp.prepareRestUrl([
@@ -716,7 +750,8 @@ class WebsiteHelpdesk extends BaseResource {
716
750
  * Update Helpdesk Locale Section
717
751
  */
718
752
  updateHelpdeskLocaleSection(
719
- websiteID: string, locale: string, categoryId: string, sectionId: string, section: HelpdeskLocaleSection
753
+ websiteID: string, locale: string, categoryId: string, sectionId: string,
754
+ section: HelpdeskLocaleSection
720
755
  ) {
721
756
  return this.crisp.patch(
722
757
  this.crisp.prepareRestUrl([
@@ -746,8 +781,9 @@ class WebsiteHelpdesk extends BaseResource {
746
781
  * Map Helpdesk Locale Feedback Ratings
747
782
  */
748
783
  mapHelpdeskLocaleFeedbackRatings(
749
- websiteID: string, locale: string, filterDateStart?: string | null, filterDateEnd?: string | null
750
- ) : Promise<HelpdeskLocaleFeedbackRatings> {
784
+ websiteID: string, locale: string, filterDateStart?: string | null,
785
+ filterDateEnd?: string | null
786
+ ): Promise<HelpdeskLocaleFeedbackRatings> {
751
787
  filterDateStart = (filterDateStart || null);
752
788
  filterDateEnd = (filterDateEnd || null);
753
789
 
@@ -778,8 +814,9 @@ class WebsiteHelpdesk extends BaseResource {
778
814
  * List Helpdesk Locale Feedbacks
779
815
  */
780
816
  listHelpdeskLocaleFeedbacks(
781
- websiteID: string, locale: string, pageNumber: number = 1, filterDateStart?: string | null, filterDateEnd?: string | null
782
- ) : Promise<HelpdeskLocaleFeedbackItem[]> {
817
+ websiteID: string, locale: string, pageNumber: number = 1,
818
+ filterDateStart?: string | null, filterDateEnd?: string | null
819
+ ): Promise<HelpdeskLocaleFeedbackItem[]> {
783
820
  filterDateStart = (filterDateStart || null);
784
821
  filterDateEnd = (filterDateEnd || null);
785
822
 
@@ -843,7 +880,9 @@ class WebsiteHelpdesk extends BaseResource {
843
880
  /**
844
881
  * List Helpdesk Redirections
845
882
  */
846
- listHelpdeskRedirections(websiteID: string, pageNumber: number = 1) : Promise<HelpdeskRedirection[]> {
883
+ listHelpdeskRedirections(
884
+ websiteID: string, pageNumber: number = 1
885
+ ): Promise<HelpdeskRedirection[]> {
847
886
  return this.crisp.get(
848
887
  this.crisp.prepareRestUrl([
849
888
  "website", websiteID, "helpdesk", "redirections", String(pageNumber)
@@ -883,7 +922,9 @@ class WebsiteHelpdesk extends BaseResource {
883
922
  /**
884
923
  * Resolve Helpdesk Redirection
885
924
  */
886
- resolveHelpdeskRedirection(websiteID: string, redirectionId: string) : Promise<HelpdeskRedirection> {
925
+ resolveHelpdeskRedirection(
926
+ websiteID: string, redirectionId: string
927
+ ): Promise<HelpdeskRedirection> {
887
928
  return this.crisp.get(
888
929
  this.crisp.prepareRestUrl([
889
930
  "website", websiteID, "helpdesk", "redirection", redirectionId
@@ -905,7 +946,7 @@ class WebsiteHelpdesk extends BaseResource {
905
946
  /**
906
947
  * Resolve Helpdesk Settings
907
948
  */
908
- resolveHelpdeskSettings(websiteID: string) : Promise<HelpdeskSettings> {
949
+ resolveHelpdeskSettings(websiteID: string): Promise<HelpdeskSettings> {
909
950
  return this.crisp.get(
910
951
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk", "settings"])
911
952
  );
@@ -925,7 +966,7 @@ class WebsiteHelpdesk extends BaseResource {
925
966
  /**
926
967
  * Resolve Helpdesk Domain
927
968
  */
928
- resolveHelpdeskDomain(websiteID: string) : Promise<HelpdeskDomain> {
969
+ resolveHelpdeskDomain(websiteID: string): Promise<HelpdeskDomain> {
929
970
  return this.crisp.get(
930
971
  this.crisp.prepareRestUrl(["website", websiteID, "helpdesk", "domain"])
931
972
  );
@@ -934,7 +975,9 @@ class WebsiteHelpdesk extends BaseResource {
934
975
  /**
935
976
  * Request Helpdesk Domain Change
936
977
  */
937
- requestHelpdeskDomainChange(websiteID: string, basic: string, custom: string) {
978
+ requestHelpdeskDomainChange(
979
+ websiteID: string, basic: string, custom: string
980
+ ) {
938
981
  // Generate body
939
982
  let body = {};
940
983
 
@@ -979,4 +1022,8 @@ class WebsiteHelpdesk extends BaseResource {
979
1022
  };
980
1023
  }
981
1024
 
1025
+ /**************************************************************************
1026
+ * EXPORTS
1027
+ ***************************************************************************/
1028
+
982
1029
  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;