crisp-api 9.13.0 → 10.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -2
  3. package/dist/crisp.d.ts +179 -0
  4. package/dist/crisp.js +773 -0
  5. package/dist/resources/BaseResource.d.ts +21 -0
  6. package/dist/resources/BaseResource.js +26 -0
  7. package/dist/resources/BucketURL.d.ts +37 -0
  8. package/dist/resources/BucketURL.js +35 -0
  9. package/dist/resources/MediaAnimation.d.ts +20 -0
  10. package/dist/resources/MediaAnimation.js +40 -0
  11. package/dist/resources/PluginConnect.d.ts +59 -0
  12. package/dist/resources/PluginConnect.js +79 -0
  13. package/dist/resources/PluginSubscription.d.ts +112 -0
  14. package/dist/resources/PluginSubscription.js +130 -0
  15. package/dist/resources/WebsiteAnalytics.d.ts +20 -0
  16. package/dist/resources/WebsiteAnalytics.js +37 -0
  17. package/dist/resources/WebsiteAvailability.d.ts +40 -0
  18. package/dist/resources/WebsiteAvailability.js +46 -0
  19. package/dist/resources/WebsiteBase.d.ts +69 -0
  20. package/dist/resources/WebsiteBase.js +77 -0
  21. package/dist/resources/WebsiteBatch.d.ts +61 -0
  22. package/dist/resources/WebsiteBatch.js +76 -0
  23. package/dist/resources/WebsiteCampaign.d.ts +208 -0
  24. package/dist/resources/WebsiteCampaign.js +201 -0
  25. package/dist/resources/WebsiteConversation.d.ts +710 -0
  26. package/dist/resources/WebsiteConversation.js +607 -0
  27. package/dist/resources/WebsiteHelpdesk.d.ts +356 -0
  28. package/dist/resources/WebsiteHelpdesk.js +593 -0
  29. package/dist/resources/WebsiteOperator.d.ts +88 -0
  30. package/dist/resources/WebsiteOperator.js +99 -0
  31. package/dist/resources/WebsitePeople.d.ts +257 -0
  32. package/dist/resources/WebsitePeople.js +282 -0
  33. package/dist/resources/WebsiteSettings.d.ts +168 -0
  34. package/dist/resources/WebsiteSettings.js +42 -0
  35. package/dist/resources/WebsiteVerify.d.ts +47 -0
  36. package/dist/resources/WebsiteVerify.js +56 -0
  37. package/dist/resources/WebsiteVisitors.d.ts +122 -0
  38. package/dist/resources/WebsiteVisitors.js +98 -0
  39. package/dist/resources/index.d.ts +20 -0
  40. package/dist/resources/index.js +42 -0
  41. package/dist/services/bucket.d.ts +19 -0
  42. package/dist/services/bucket.js +31 -0
  43. package/dist/services/media.d.ts +19 -0
  44. package/dist/services/media.js +31 -0
  45. package/dist/services/plugin.d.ts +20 -0
  46. package/dist/services/plugin.js +33 -0
  47. package/dist/services/website.d.ts +30 -0
  48. package/dist/services/website.js +53 -0
  49. package/eslint.config.mjs +208 -0
  50. package/lib/crisp.ts +1006 -0
  51. package/lib/resources/BaseResource.ts +37 -0
  52. package/lib/resources/BucketURL.ts +58 -0
  53. package/lib/resources/MediaAnimation.ts +44 -0
  54. package/lib/resources/PluginConnect.ts +135 -0
  55. package/lib/resources/PluginSubscription.ts +236 -0
  56. package/lib/resources/WebsiteAnalytics.ts +41 -0
  57. package/lib/resources/WebsiteAvailability.ts +74 -0
  58. package/lib/resources/WebsiteBase.ts +119 -0
  59. package/lib/resources/WebsiteBatch.ts +116 -0
  60. package/lib/resources/WebsiteCampaign.ts +432 -0
  61. package/lib/resources/WebsiteConversation.ts +1507 -0
  62. package/lib/resources/WebsiteHelpdesk.ts +1024 -0
  63. package/lib/resources/WebsiteOperator.ts +183 -0
  64. package/lib/resources/WebsitePeople.ts +568 -0
  65. package/lib/resources/WebsiteSettings.ts +207 -0
  66. package/lib/resources/WebsiteVerify.ts +90 -0
  67. package/lib/resources/WebsiteVisitors.ts +219 -0
  68. package/lib/resources/index.ts +28 -0
  69. package/lib/services/bucket.ts +36 -0
  70. package/lib/services/media.ts +36 -0
  71. package/lib/services/plugin.ts +40 -0
  72. package/lib/services/website.ts +70 -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,37 @@
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: MAIN
13
+ import Crisp from "@/crisp";
14
+
15
+ /**************************************************************************
16
+ * CLASSES
17
+ ***************************************************************************/
18
+
19
+ /**
20
+ * Crisp Base Resource
21
+ */
22
+ class BaseResource {
23
+ protected crisp: Crisp;
24
+
25
+ /**
26
+ * Constructor
27
+ */
28
+ constructor(crisp: Crisp) {
29
+ this.crisp = crisp;
30
+ }
31
+ }
32
+
33
+ /**************************************************************************
34
+ * EXPORTS
35
+ ***************************************************************************/
36
+
37
+ export default BaseResource;
@@ -0,0 +1,58 @@
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
+ /**************************************************************************
16
+ * TYPES
17
+ ***************************************************************************/
18
+
19
+ export type BucketURLRequestFile = {
20
+ name?: string;
21
+ type?: string;
22
+ };
23
+
24
+ export type BucketURLRequestResource = {
25
+ type?: string;
26
+ id?: string;
27
+ };
28
+
29
+ export type BucketURLRequest = {
30
+ namespace?: string;
31
+ id?: string;
32
+ file?: BucketURLRequestFile;
33
+ resource?: BucketURLRequestResource;
34
+ };
35
+
36
+ /**************************************************************************
37
+ * CLASSES
38
+ ***************************************************************************/
39
+
40
+ /**
41
+ * Crisp BucketURL Resource
42
+ */
43
+ class BucketURL extends BaseResource {
44
+ /**
45
+ * Generate Bucket URL
46
+ */
47
+ generateBucketURL(data: BucketURLRequest) {
48
+ return this.crisp.post(
49
+ this.crisp.prepareRestUrl(["bucket", "url", "generate"]), null, data
50
+ );
51
+ };
52
+ }
53
+
54
+ /**************************************************************************
55
+ * EXPORTS
56
+ ***************************************************************************/
57
+
58
+ export default BucketURL;
@@ -0,0 +1,44 @@
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
+ /**************************************************************************
16
+ * CLASSES
17
+ ***************************************************************************/
18
+
19
+ /**
20
+ * Crisp MediaAnimation Resource
21
+ */
22
+ class MediaAnimation extends BaseResource {
23
+ /**
24
+ * List Animation Medias
25
+ */
26
+ listAnimationMedias(pageNumber: number, listID: string, searchQuery: object) {
27
+ return this.crisp.get(
28
+ this.crisp.prepareRestUrl([
29
+ "media", "animation", "list", String(pageNumber)
30
+ ]),
31
+
32
+ {
33
+ list_id: listID,
34
+ search_query: searchQuery
35
+ }
36
+ );
37
+ };
38
+ }
39
+
40
+ /**************************************************************************
41
+ * EXPORTS
42
+ ***************************************************************************/
43
+
44
+ export default MediaAnimation;
@@ -0,0 +1,135 @@
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
+ /**************************************************************************
16
+ * TYPES
17
+ ***************************************************************************/
18
+
19
+ export type PluginConnectAccount = {
20
+ plugin_id?: string;
21
+ };
22
+
23
+ export type PluginConnectAllWebsites = {
24
+ website_id?: string;
25
+ token?: string;
26
+ settings?: object;
27
+ }
28
+
29
+ export type PluginConnectWebsitesSince = {
30
+ website_id?: string;
31
+ token?: string;
32
+ settings?: object;
33
+ difference?: string;
34
+ }
35
+
36
+ export type PluginConnectEndpoints = {
37
+ socket?: PluginConnectEndpointsSocket;
38
+ }
39
+
40
+ export type PluginConnectEndpointsSocket = {
41
+ app?: string;
42
+ }
43
+
44
+ /**************************************************************************
45
+ * CLASSES
46
+ ***************************************************************************/
47
+
48
+ /**
49
+ * Crisp PluginConnect Resource
50
+ */
51
+ class PluginConnect extends BaseResource {
52
+ /**
53
+ * Get Connect Account
54
+ */
55
+ getConnectAccount(): Promise<PluginConnectAccount> {
56
+ return this.crisp.get(
57
+ this.crisp.prepareRestUrl(["plugin", "connect", "account"]), {}
58
+ );
59
+ };
60
+
61
+ /**
62
+ * Check Connect Session Validity
63
+ */
64
+ checkConnectSessionValidity() {
65
+ return this.crisp.head(
66
+ this.crisp.prepareRestUrl(["plugin", "connect", "session"]),
67
+
68
+ {}
69
+ );
70
+ };
71
+
72
+ /**
73
+ * List All Connect Websites
74
+ */
75
+ listAllConnectWebsites(
76
+ pageNumber: number, filterConfigured: boolean
77
+ ): Promise<PluginConnectAllWebsites> {
78
+ // Generate query
79
+ let query = {
80
+ filter_configured: (
81
+ (filterConfigured === true) ? "1" : "0"
82
+ )
83
+ };
84
+
85
+ return this.crisp.get(
86
+ this.crisp.prepareRestUrl([
87
+ "plugin", "connect", "websites", "all", String(pageNumber)
88
+ ]),
89
+
90
+ query
91
+ );
92
+ };
93
+
94
+ /**
95
+ * List Connect Websites Since
96
+ */
97
+ listConnectWebsitesSince(
98
+ dateSince: string, filterConfigured: boolean
99
+ ): Promise<PluginConnectWebsitesSince> {
100
+ // Generate query
101
+ let query = {
102
+ filter_configured: (
103
+ (filterConfigured === true) ? "1" : "0"
104
+ )
105
+ };
106
+
107
+ if (dateSince) {
108
+ // @ts-ignore
109
+ query.date_since = dateSince;
110
+ }
111
+
112
+ return this.crisp.get(
113
+ this.crisp.prepareRestUrl([
114
+ "plugin", "connect", "websites", "since"
115
+ ]),
116
+
117
+ query
118
+ );
119
+ };
120
+
121
+ /**
122
+ * Get Connect Endpoints
123
+ */
124
+ getConnectEndpoints(): Promise<PluginConnectEndpoints> {
125
+ return this.crisp.get(
126
+ this.crisp.prepareRestUrl(["plugin", "connect", "endpoints"]), {}
127
+ );
128
+ };
129
+ }
130
+
131
+ /**************************************************************************
132
+ * EXPORTS
133
+ ***************************************************************************/
134
+
135
+ export default PluginConnect;
@@ -0,0 +1,236 @@
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
+ /**************************************************************************
16
+ * TYPES
17
+ ***************************************************************************/
18
+
19
+ type PluginSubscription = {
20
+ id?: string;
21
+ urn?: string;
22
+ type?: string;
23
+ category?: string;
24
+ name?: string;
25
+ summary?: string;
26
+ price?: number;
27
+ plans?: PluginSubscriptionPlan[];
28
+ icon?: string;
29
+ website_url?: string;
30
+ contact_url?: string;
31
+ terms_url?: string;
32
+ privacy_url?: string;
33
+ help_url?: string;
34
+ video_url?: string;
35
+ configurable?: boolean;
36
+ since?: string;
37
+ active?: boolean;
38
+ website_id?: string;
39
+ card_id?: string;
40
+ }
41
+
42
+ type PluginSubscriptionPlan = {
43
+ id?: string;
44
+ name?: string;
45
+ price?: number;
46
+ }
47
+
48
+ type PluginSubscriptionSettings = {
49
+ plugin_id?: string;
50
+ website_id?: string;
51
+ token?: string;
52
+ schema?: object;
53
+ settings?: object;
54
+ settings_form_url?: string;
55
+ callback_url?: string;
56
+ }
57
+
58
+ type PluginSubscriptionChannelForward = {
59
+ namespace?: string;
60
+ identifier?: string;
61
+ payload?: object;
62
+ }
63
+
64
+ type PluginSubscriptionEventDispatch = {
65
+ name?: string;
66
+ data?: object;
67
+ }
68
+
69
+ /**************************************************************************
70
+ * CLASSES
71
+ ***************************************************************************/
72
+
73
+ /**
74
+ * Crisp PluginSubscription Resource
75
+ */
76
+ class PluginSubscriptionService extends BaseResource {
77
+ /**
78
+ * List All Active Subscriptions
79
+ */
80
+ listAllActiveSubscriptions(): Promise<PluginSubscription[]> {
81
+ return this.crisp.get(
82
+ this.crisp.prepareRestUrl(["plugins", "subscription"])
83
+ );
84
+ };
85
+
86
+ /**
87
+ * List Subscriptions For A Website
88
+ */
89
+ listSubscriptionsForWebsite(
90
+ websiteID: string
91
+ ): Promise<PluginSubscription[]> {
92
+ return this.crisp.get(
93
+ this.crisp.prepareRestUrl(["plugins", "subscription", websiteID])
94
+ );
95
+ };
96
+
97
+ /**
98
+ * Get Subscription Details
99
+ */
100
+ getSubscriptionDetails(
101
+ websiteID: string, pluginID: string
102
+ ): Promise<PluginSubscription> {
103
+ return this.crisp.get(
104
+ this.crisp.prepareRestUrl(["plugins", "subscription", websiteID, pluginID])
105
+ );
106
+ };
107
+
108
+ /**
109
+ * Subscribe Website To Plugin
110
+ */
111
+ subscribeWebsiteToPlugin(websiteID: string, pluginID: string) {
112
+ return this.crisp.post(
113
+ this.crisp.prepareRestUrl(["plugins", "subscription", websiteID]),
114
+
115
+ null,
116
+
117
+ {
118
+ plugin_id: pluginID
119
+ }
120
+ );
121
+ };
122
+
123
+ /**
124
+ * Unsubscribe Plugin From Website
125
+ */
126
+ unsubscribePluginFromWebsite(websiteID: string, pluginID: string) {
127
+ return this.crisp.delete(
128
+ this.crisp.prepareRestUrl([
129
+ "plugins", "subscription", websiteID, pluginID
130
+ ])
131
+ );
132
+ };
133
+
134
+ /**
135
+ * Get Subscription Settings
136
+ */
137
+ getSubscriptionSettings(
138
+ websiteID: string, pluginID: string
139
+ ): Promise<PluginSubscriptionSettings> {
140
+ return this.crisp.get(
141
+ this.crisp.prepareRestUrl([
142
+ "plugins", "subscription", websiteID, pluginID, "settings"
143
+ ])
144
+ );
145
+ };
146
+
147
+ /**
148
+ * Save Subscription Settings
149
+ */
150
+ saveSubscriptionSettings(
151
+ websiteID: string, pluginID: string, settings: object
152
+ ) {
153
+ return this.crisp.put(
154
+ this.crisp.prepareRestUrl([
155
+ "plugins", "subscription", websiteID, pluginID, "settings"
156
+ ]),
157
+
158
+ null, settings
159
+ );
160
+ };
161
+
162
+ /**
163
+ * Update Subscription Settings
164
+ */
165
+ updateSubscriptionSettings(
166
+ websiteID: string, pluginID: string, settings: object
167
+ ) {
168
+ return this.crisp.patch(
169
+ this.crisp.prepareRestUrl([
170
+ "plugins", "subscription", websiteID, pluginID, "settings"
171
+ ]),
172
+
173
+ null, settings
174
+ );
175
+ };
176
+
177
+ /**
178
+ * Get Plugin Usage Bills
179
+ */
180
+ getPluginUsageBills(websiteID: string, pluginID: string) {
181
+ return this.crisp.get(
182
+ this.crisp.prepareRestUrl([
183
+ "plugins", "subscription", websiteID, pluginID, "bill", "usage"
184
+ ])
185
+ );
186
+ };
187
+
188
+ /**
189
+ * Report Plugin Usage To Bill
190
+ */
191
+ reportPluginUsageToBill(websiteID: string, pluginID: string, usage: object) {
192
+ return this.crisp.post(
193
+ this.crisp.prepareRestUrl([
194
+ "plugins", "subscription", websiteID, pluginID, "bill", "usage"
195
+ ]),
196
+
197
+ null, usage
198
+ );
199
+ };
200
+
201
+ /**
202
+ * Forward Plugin Payload To Channel
203
+ */
204
+ forwardPluginPayloadToChannel(
205
+ websiteID: string, pluginID: string, payload: PluginSubscriptionChannelForward
206
+ ) {
207
+ return this.crisp.post(
208
+ this.crisp.prepareRestUrl([
209
+ "plugins", "subscription", websiteID, pluginID, "channel"
210
+ ]),
211
+
212
+ null, payload
213
+ );
214
+ };
215
+
216
+ /**
217
+ * Dispatch Plugin Event
218
+ */
219
+ dispatchPluginEvent(
220
+ websiteID: string, pluginID: string, payload: PluginSubscriptionEventDispatch
221
+ ) {
222
+ return this.crisp.post(
223
+ this.crisp.prepareRestUrl([
224
+ "plugins", "subscription", websiteID, pluginID, "event"
225
+ ]),
226
+
227
+ null, payload
228
+ );
229
+ };
230
+ }
231
+
232
+ /**************************************************************************
233
+ * EXPORTS
234
+ ***************************************************************************/
235
+
236
+ export default PluginSubscriptionService;
@@ -0,0 +1,41 @@
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
+ /**************************************************************************
16
+ * CLASSES
17
+ ***************************************************************************/
18
+
19
+ /**
20
+ * Crisp WebsiteAnalytics Resource
21
+ */
22
+ class WebsiteAnalytics extends BaseResource {
23
+ /**
24
+ * Generate Analytics
25
+ */
26
+ generateAnalytics(websiteID: string, query: object) {
27
+ return this.crisp.post(
28
+ this.crisp.prepareRestUrl([
29
+ "website", websiteID, "analytics", "generate"
30
+ ]),
31
+
32
+ null, query
33
+ );
34
+ };
35
+ }
36
+
37
+ /**************************************************************************
38
+ * EXPORTS
39
+ ***************************************************************************/
40
+
41
+ export default WebsiteAnalytics;
@@ -0,0 +1,74 @@
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
+ /**************************************************************************
16
+ * TYPES
17
+ ***************************************************************************/
18
+
19
+ type WebsiteAvailabilityStatus = {
20
+ status?: string;
21
+ since?: number;
22
+ }
23
+
24
+ type WebsiteAvailabilityOperator = {
25
+ user_id?: string;
26
+ type?: string;
27
+ time?: WebsiteAvailabilityOperatorTime;
28
+ }
29
+
30
+ type WebsiteAvailabilityOperatorTime = {
31
+ for?: number;
32
+ since?: number;
33
+ }
34
+
35
+ /**************************************************************************
36
+ * CLASSES
37
+ ***************************************************************************/
38
+
39
+ /**
40
+ * Crisp WebsiteAvailability Resource
41
+ */
42
+ class WebsiteAvailability extends BaseResource {
43
+ /**
44
+ * Get Website Availability Status
45
+ */
46
+ getWebsiteAvailabilityStatus(
47
+ websiteID: string
48
+ ): Promise<WebsiteAvailabilityStatus> {
49
+ return this.crisp.get(
50
+ this.crisp.prepareRestUrl([
51
+ "website", websiteID, "availability", "status"
52
+ ])
53
+ );
54
+ };
55
+
56
+ /**
57
+ * List Website Operator Availabilities
58
+ */
59
+ listWebsiteOperatorAvailabilities(
60
+ websiteID: string
61
+ ): Promise<WebsiteAvailabilityOperator[]> {
62
+ return this.crisp.get(
63
+ this.crisp.prepareRestUrl([
64
+ "website", websiteID, "availability", "operators"
65
+ ])
66
+ );
67
+ };
68
+ }
69
+
70
+ /**************************************************************************
71
+ * EXPORTS
72
+ ***************************************************************************/
73
+
74
+ export default WebsiteAvailability;