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,607 @@
1
+ "use strict";
2
+ /*
3
+ * node-crisp-api
4
+ *
5
+ * Copyright 2022, Crisp IM SAS
6
+ * Author: Baptiste Jamin <baptiste@crisp.chat>
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ /**************************************************************************
13
+ * IMPORTS
14
+ ***************************************************************************/
15
+ // PROJECT: RESOURCES
16
+ const BaseResource_1 = __importDefault(require("./BaseResource"));
17
+ /**************************************************************************
18
+ * CLASSES
19
+ ***************************************************************************/
20
+ /**
21
+ * Crisp WebsiteConversation Resource
22
+ * @class
23
+ */
24
+ class WebsiteConversation extends BaseResource_1.default {
25
+ /**
26
+ * List Conversations
27
+ */
28
+ listConversations(websiteID, pageNumber = 1) {
29
+ return this.crisp.get(this.crisp.prepareRestUrl(["website", websiteID, "conversations", String(pageNumber)]));
30
+ }
31
+ ;
32
+ /**
33
+ * List Suggested Conversation Segments
34
+ */
35
+ listSuggestedConversationSegments(websiteID, pageNumber = 1) {
36
+ return this.crisp.get(this.crisp.prepareRestUrl([
37
+ "website", websiteID, "conversations", "suggest", "segments", String(pageNumber)
38
+ ]));
39
+ }
40
+ ;
41
+ /**
42
+ * Delete Suggested Conversation Segment
43
+ */
44
+ deleteSuggestedConversationSegment(websiteID, segment) {
45
+ return this.crisp.delete(this.crisp.prepareRestUrl([
46
+ "website", websiteID, "conversations", "suggest", "segment"
47
+ ]), null, {
48
+ segment: segment
49
+ });
50
+ }
51
+ ;
52
+ /**
53
+ * List Suggested Conversation Data Keys
54
+ */
55
+ listSuggestedConversationDataKeys(websiteID, pageNumber = 1) {
56
+ return this.crisp.get(this.crisp.prepareRestUrl([
57
+ "website", websiteID, "conversations", "suggest", "data", String(pageNumber)
58
+ ]));
59
+ }
60
+ ;
61
+ /**
62
+ * Delete Suggested Conversation Data Key
63
+ */
64
+ deleteSuggestedConversationDataKey(websiteID, key) {
65
+ return this.crisp.delete(this.crisp.prepareRestUrl([
66
+ "website", websiteID, "conversations", "suggest", "data"
67
+ ]), null, {
68
+ key: key
69
+ });
70
+ }
71
+ ;
72
+ /**
73
+ * List Spam Conversations
74
+ */
75
+ listSpamConversations(websiteID, pageNumber = 1) {
76
+ return this.crisp.get(this.crisp.prepareRestUrl([
77
+ "website", websiteID, "conversations", "spams", String(pageNumber)
78
+ ]));
79
+ }
80
+ ;
81
+ /**
82
+ * Resolve Spam Conversation Content
83
+ */
84
+ resolveSpamConversationContent(websiteID, spamID) {
85
+ return this.crisp.get(this.crisp.prepareRestUrl([
86
+ "website", websiteID, "conversations", "spam", spamID, "content"
87
+ ]));
88
+ }
89
+ ;
90
+ /**
91
+ * Submit Spam Conversation Decision
92
+ */
93
+ submitSpamConversationDecision(websiteID, spamID, action) {
94
+ return this.crisp.post(this.crisp.prepareRestUrl([
95
+ "website", websiteID, "conversations", "spam", spamID, "decision"
96
+ ]), null, {
97
+ action: action
98
+ });
99
+ }
100
+ ;
101
+ /**
102
+ * Create A New Conversation
103
+ */
104
+ createNewConversation(websiteID) {
105
+ return this.crisp.post(this.crisp.prepareRestUrl(["website", websiteID, "conversation"]), null, null);
106
+ }
107
+ ;
108
+ /**
109
+ * Check If Conversation Exists
110
+ */
111
+ checkConversationExists(websiteID, sessionID) {
112
+ return this.crisp.head(this.crisp.prepareRestUrl([
113
+ "website", websiteID, "conversation", sessionID
114
+ ]));
115
+ }
116
+ ;
117
+ /**
118
+ * Get A Conversation
119
+ */
120
+ getConversation(websiteID, sessionID) {
121
+ return this.crisp.get(this.crisp.prepareRestUrl([
122
+ "website", websiteID, "conversation", sessionID
123
+ ]));
124
+ }
125
+ ;
126
+ /**
127
+ * Remove A Conversation
128
+ */
129
+ removeConversation(websiteID, sessionID) {
130
+ return this.crisp.delete(this.crisp.prepareRestUrl([
131
+ "website", websiteID, "conversation", sessionID
132
+ ]));
133
+ }
134
+ ;
135
+ /**
136
+ * Initiate A Conversation With Existing Session
137
+ */
138
+ initiateConversationWithExistingSession(websiteID, sessionID) {
139
+ return this.crisp.post(this.crisp.prepareRestUrl([
140
+ "website", websiteID, "conversation", sessionID, "initiate"
141
+ ]), null, null);
142
+ }
143
+ ;
144
+ /**
145
+ * Get Messages In Conversation
146
+ */
147
+ getMessagesInConversation(websiteID, sessionID, timestampBefore) {
148
+ // Generate query
149
+ let query = {};
150
+ if (timestampBefore) {
151
+ // @ts-ignore
152
+ query.timestamp_before = String(timestampBefore);
153
+ }
154
+ return this.crisp.get(this.crisp.prepareRestUrl([
155
+ "website", websiteID, "conversation", sessionID, "messages"
156
+ ]), query);
157
+ }
158
+ ;
159
+ /**
160
+ * Send A Message In Conversation
161
+ */
162
+ sendMessageInConversation(websiteID, sessionID, message) {
163
+ return this.crisp.post(this.crisp.prepareRestUrl([
164
+ "website", websiteID, "conversation", sessionID, "message"
165
+ ]), null, message);
166
+ }
167
+ ;
168
+ /**
169
+ * Get A Message In Conversation
170
+ */
171
+ getMessageInConversation(websiteID, sessionID, fingerprint) {
172
+ return this.crisp.get(this.crisp.prepareRestUrl([
173
+ "website", websiteID, "conversation", sessionID, "message", String(fingerprint)
174
+ ]));
175
+ }
176
+ ;
177
+ /**
178
+ * Update A Message In Conversation
179
+ */
180
+ updateMessageInConversation(websiteID, sessionID, fingerprint, content) {
181
+ return this.crisp.patch(this.crisp.prepareRestUrl([
182
+ "website", websiteID, "conversation", sessionID, "message", String(fingerprint)
183
+ ]), null, {
184
+ content: content
185
+ });
186
+ }
187
+ ;
188
+ /**
189
+ * Remove A Message In Conversation
190
+ */
191
+ removeMessageInConversation(websiteID, sessionID, fingerprint) {
192
+ return this.crisp.delete(this.crisp.prepareRestUrl([
193
+ "website", websiteID, "conversation", sessionID, "message", String(fingerprint)
194
+ ]));
195
+ }
196
+ ;
197
+ /**
198
+ * Compose A Message In Conversation
199
+ */
200
+ composeMessageInConversation(websiteID, sessionID, compose) {
201
+ return this.crisp.patch(this.crisp.prepareRestUrl([
202
+ "website", websiteID, "conversation", sessionID, "compose"
203
+ ]), null, compose);
204
+ }
205
+ ;
206
+ /**
207
+ * Mark Messages As Read In Conversation
208
+ */
209
+ markMessagesReadInConversation(websiteID, sessionID, read) {
210
+ return this.crisp.patch(this.crisp.prepareRestUrl([
211
+ "website", websiteID, "conversation", sessionID, "read"
212
+ ]), null, read);
213
+ }
214
+ ;
215
+ /**
216
+ * Mark Conversation As Unread
217
+ */
218
+ markConversationAsUnread(websiteID, sessionID, unread) {
219
+ return this.crisp.patch(this.crisp.prepareRestUrl([
220
+ "website", websiteID, "conversation", sessionID, "unread"
221
+ ]), null, unread);
222
+ }
223
+ ;
224
+ /**
225
+ * Mark Messages As Delivered In Conversation
226
+ */
227
+ markMessagesDeliveredInConversation(websiteID, sessionID, delivered) {
228
+ return this.crisp.patch(this.crisp.prepareRestUrl([
229
+ "website", websiteID, "conversation", sessionID, "delivered"
230
+ ]), null, delivered);
231
+ }
232
+ ;
233
+ /**
234
+ * Update Conversation Open State
235
+ */
236
+ updateConversationOpenState(websiteID, sessionID, opened) {
237
+ return this.crisp.patch(this.crisp.prepareRestUrl([
238
+ "website", websiteID, "conversation", sessionID, "open"
239
+ ]), null, {
240
+ opened: (opened || false)
241
+ });
242
+ }
243
+ ;
244
+ /**
245
+ * Get Conversation Routing Assign
246
+ */
247
+ getConversationRoutingAssign(websiteID, sessionID) {
248
+ return this.crisp.get(this.crisp.prepareRestUrl([
249
+ "website", websiteID, "conversation", sessionID, "routing"
250
+ ]));
251
+ }
252
+ ;
253
+ /**
254
+ * Assign Conversation Routing
255
+ */
256
+ assignConversationRouting(websiteID, sessionID, assign) {
257
+ return this.crisp.patch(this.crisp.prepareRestUrl([
258
+ "website", websiteID, "conversation", sessionID, "routing"
259
+ ]), null, assign);
260
+ }
261
+ ;
262
+ /**
263
+ * Update Conversation Inbox
264
+ */
265
+ updateConversationInbox(websiteID, sessionID, inboxID) {
266
+ return this.crisp.patch(this.crisp.prepareRestUrl([
267
+ "website", websiteID, "conversation", sessionID, "inbox"
268
+ ]), null, {
269
+ inbox_id: inboxID
270
+ });
271
+ }
272
+ /**
273
+ * Get Conversation Metas
274
+ */
275
+ getConversationMetas(websiteID, sessionID) {
276
+ return this.crisp.get(this.crisp.prepareRestUrl([
277
+ "website", websiteID, "conversation", sessionID, "meta"
278
+ ]));
279
+ }
280
+ /**
281
+ * Update Conversation Metas
282
+ */
283
+ updateConversationMetas(websiteID, sessionID, metas) {
284
+ return this.crisp.patch(this.crisp.prepareRestUrl([
285
+ "website", websiteID, "conversation", sessionID, "meta"
286
+ ]), null, metas);
287
+ }
288
+ /**
289
+ * Get An Original Message In Conversation
290
+ */
291
+ getOriginalMessageInConversation(websiteID, sessionID, originalID) {
292
+ return this.crisp.get(this.crisp.prepareRestUrl([
293
+ "website", websiteID, "conversation", sessionID, "original", originalID
294
+ ]));
295
+ }
296
+ /**
297
+ * List Conversation Pages
298
+ */
299
+ listConversationPages(websiteID, sessionID, pageNumber = 1) {
300
+ return this.crisp.get(this.crisp.prepareRestUrl([
301
+ "website", websiteID, "conversation", sessionID, "pages", String(pageNumber)
302
+ ]));
303
+ }
304
+ ;
305
+ /**
306
+ * List Conversation Events
307
+ */
308
+ listConversationEvents(websiteID, sessionID, pageNumber = 1) {
309
+ return this.crisp.get(this.crisp.prepareRestUrl([
310
+ "website", websiteID, "conversation", sessionID, "events", String(pageNumber)
311
+ ]));
312
+ }
313
+ ;
314
+ /**
315
+ * List Conversation Files
316
+ */
317
+ listConversationFiles(websiteID, sessionID, pageNumber = 1) {
318
+ return this.crisp.get(this.crisp.prepareRestUrl([
319
+ "website", websiteID, "conversation", sessionID, "files", String(pageNumber)
320
+ ]));
321
+ }
322
+ ;
323
+ /**
324
+ * Get Conversation State
325
+ */
326
+ getConversationState(websiteID, sessionID) {
327
+ return this.crisp.get(this.crisp.prepareRestUrl([
328
+ "website", websiteID, "conversation", sessionID, "state"
329
+ ]));
330
+ }
331
+ ;
332
+ /**
333
+ * Change Conversation State
334
+ */
335
+ changeConversationState(websiteID, sessionID, state) {
336
+ return this.crisp.patch(this.crisp.prepareRestUrl([
337
+ "website", websiteID, "conversation", sessionID, "state"
338
+ ]), null, {
339
+ state: state
340
+ });
341
+ }
342
+ ;
343
+ /**
344
+ * Get Conversation Participants
345
+ */
346
+ getConversationParticipants(websiteID, sessionID) {
347
+ return this.crisp.get(this.crisp.prepareRestUrl([
348
+ "website", websiteID, "conversation", sessionID, "participants"
349
+ ]));
350
+ }
351
+ ;
352
+ /**
353
+ * Save Conversation Participants
354
+ */
355
+ saveConversationParticipants(websiteID, sessionID, participants) {
356
+ return this.crisp.put(this.crisp.prepareRestUrl([
357
+ "website", websiteID, "conversation", sessionID, "participants"
358
+ ]), null, participants);
359
+ }
360
+ ;
361
+ /**
362
+ * Get Block Status For Conversation
363
+ */
364
+ getBlockStatusForConversation(websiteID, sessionID) {
365
+ return this.crisp.get(this.crisp.prepareRestUrl([
366
+ "website", websiteID, "conversation", sessionID, "block"
367
+ ]));
368
+ }
369
+ ;
370
+ /**
371
+ * Block Incoming Messages For Conversation
372
+ */
373
+ blockIncomingMessagesForConversation(websiteID, sessionID, blocked) {
374
+ return this.crisp.patch(this.crisp.prepareRestUrl([
375
+ "website", websiteID, "conversation", sessionID, "block"
376
+ ]), null, {
377
+ blocked: (blocked || false)
378
+ });
379
+ }
380
+ ;
381
+ /**
382
+ * Get Verify Status For Conversation
383
+ */
384
+ getVerifyStatusForConversation(websiteID, sessionID) {
385
+ return this.crisp.get(this.crisp.prepareRestUrl([
386
+ "website", websiteID, "conversation", sessionID, "verify"
387
+ ]));
388
+ }
389
+ ;
390
+ /**
391
+ * Update Verify Status For Conversation
392
+ */
393
+ updateVerifyStatusForConversation(websiteID, sessionID, verified) {
394
+ return this.crisp.patch(this.crisp.prepareRestUrl([
395
+ "website", websiteID, "conversation", sessionID, "verify"
396
+ ]), null, {
397
+ verified: (verified || false)
398
+ });
399
+ }
400
+ ;
401
+ /**
402
+ * Request Identity Verification For Conversation
403
+ */
404
+ requestIdentityVerificationForConversation(websiteID, sessionID, verification) {
405
+ return this.crisp.post(this.crisp.prepareRestUrl([
406
+ "website", websiteID, "conversation", sessionID, "verify", "identity"
407
+ ]), null, verification);
408
+ }
409
+ ;
410
+ /**
411
+ * Redeem Identity Verification Link For Conversation
412
+ */
413
+ redeemIdentityVerificationLinkForConversation(websiteID, sessionID, verification) {
414
+ return this.crisp.put(this.crisp.prepareRestUrl([
415
+ "website", websiteID, "conversation", sessionID, "verify", "identity",
416
+ "link"
417
+ ]), null, verification);
418
+ }
419
+ ;
420
+ /**
421
+ * Request Email Transcript For Conversation
422
+ */
423
+ requestEmailTranscriptForConversation(websiteID, sessionID, to, email) {
424
+ // Generate body
425
+ let body = {
426
+ to: to
427
+ };
428
+ if (email) {
429
+ // @ts-ignore
430
+ body.email = email;
431
+ }
432
+ return this.crisp.post(this.crisp.prepareRestUrl([
433
+ "website", websiteID, "conversation", sessionID, "transcript"
434
+ ]), null, body);
435
+ }
436
+ ;
437
+ /**
438
+ * Request Chatbox Binding Purge For Conversation
439
+ */
440
+ requestChatboxBindingPurgeForConversation(websiteID, sessionID) {
441
+ return this.crisp.post(this.crisp.prepareRestUrl([
442
+ "website", websiteID, "conversation", sessionID, "purge"
443
+ ]), null, null);
444
+ }
445
+ ;
446
+ /**
447
+ * Request User Feedback For Conversation
448
+ */
449
+ requestUserFeedbackForConversation(websiteID, sessionID) {
450
+ return this.crisp.post(this.crisp.prepareRestUrl([
451
+ "website", websiteID, "conversation", sessionID, "feedback"
452
+ ]), null, null);
453
+ }
454
+ ;
455
+ /**
456
+ * List Browsing Sessions For Conversation
457
+ */
458
+ listBrowsingSessionsForConversation(websiteID, sessionID) {
459
+ return this.crisp.get(this.crisp.prepareRestUrl([
460
+ "website", websiteID, "conversation", sessionID, "browsing"
461
+ ]));
462
+ }
463
+ ;
464
+ /**
465
+ * Initiate Browsing Session For Conversation
466
+ */
467
+ initiateBrowsingSessionForConversation(websiteID, sessionID) {
468
+ return this.crisp.post(this.crisp.prepareRestUrl([
469
+ "website", websiteID, "conversation", sessionID, "browsing"
470
+ ]), null, null);
471
+ }
472
+ ;
473
+ /**
474
+ * Send Action To An Existing Browsing Session
475
+ */
476
+ sendActionToExistingBrowsingSession(websiteID, sessionID, browsingID, action) {
477
+ return this.crisp.patch(this.crisp.prepareRestUrl([
478
+ "website", websiteID, "conversation", sessionID, "browsing", browsingID
479
+ ]), null, {
480
+ action: action
481
+ });
482
+ }
483
+ ;
484
+ /**
485
+ * Assist Existing Browsing Session
486
+ */
487
+ assistExistingBrowsingSession(websiteID, sessionID, browsingID, assist) {
488
+ return this.crisp.patch(this.crisp.prepareRestUrl([
489
+ "website", websiteID, "conversation", sessionID, "browsing", browsingID,
490
+ "assist"
491
+ ]), null, assist);
492
+ }
493
+ ;
494
+ /**
495
+ * Initiate New Call Session For Conversation
496
+ */
497
+ initiateNewCallSessionForConversation(websiteID, sessionID, mode) {
498
+ return this.crisp.post(this.crisp.prepareRestUrl([
499
+ "website", websiteID, "conversation", sessionID, "call"
500
+ ]), null, {
501
+ mode: (mode || "audio")
502
+ });
503
+ }
504
+ ;
505
+ /**
506
+ * Get Ongoing Call Session For Conversation
507
+ */
508
+ getOngoingCallSessionForConversation(websiteID, sessionID) {
509
+ return this.crisp.get(this.crisp.prepareRestUrl([
510
+ "website", websiteID, "conversation", sessionID, "call"
511
+ ]));
512
+ }
513
+ ;
514
+ /**
515
+ * Abort Ongoing Call Session For Conversation
516
+ */
517
+ abortOngoingCallSessionForConversation(websiteID, sessionID, callID) {
518
+ return this.crisp.delete(this.crisp.prepareRestUrl([
519
+ "website", websiteID, "conversation", sessionID, "call", callID
520
+ ]));
521
+ }
522
+ ;
523
+ /**
524
+ * Transmit Signaling On Ongoing Call Session
525
+ */
526
+ transmitSignalingOnOngoingCallSession(websiteID, sessionID, callID, payload) {
527
+ return this.crisp.patch(this.crisp.prepareRestUrl([
528
+ "website", websiteID, "conversation", sessionID, "call", callID
529
+ ]), null, payload);
530
+ }
531
+ ;
532
+ /**
533
+ * Deliver Widget Button Action For Conversation
534
+ */
535
+ deliverWidgetButtonActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data, value) {
536
+ // Generate body
537
+ let body = {
538
+ section_id: sectionID,
539
+ item_id: itemID,
540
+ data: data
541
+ };
542
+ if (typeof value !== "undefined") {
543
+ // @ts-ignore
544
+ body.value = value;
545
+ }
546
+ return this.crisp.post(this.crisp.prepareRestUrl([
547
+ "website", websiteID, "conversation", sessionID, "widget", pluginID,
548
+ "button"
549
+ ]), null, body);
550
+ }
551
+ ;
552
+ /**
553
+ * Deliver Widget Data Fetch Action For Conversation
554
+ */
555
+ deliverWidgetDataFetchActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data) {
556
+ return this.crisp.post(this.crisp.prepareRestUrl([
557
+ "website", websiteID, "conversation", sessionID, "widget", pluginID,
558
+ "data"
559
+ ]), null, {
560
+ section_id: sectionID,
561
+ item_id: itemID,
562
+ data: data
563
+ });
564
+ }
565
+ ;
566
+ /**
567
+ * Deliver Widget Data Edit Action For Conversation
568
+ */
569
+ deliverWidgetDataEditActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, value) {
570
+ return this.crisp.post(this.crisp.prepareRestUrl([
571
+ "website", websiteID, "conversation", sessionID, "widget", pluginID,
572
+ "data"
573
+ ]), null, {
574
+ section_id: sectionID,
575
+ item_id: itemID,
576
+ value: value
577
+ });
578
+ }
579
+ ;
580
+ /**
581
+ * Schedule A Reminder For Conversation
582
+ */
583
+ scheduleReminderForConversation(websiteID, sessionID, date, note) {
584
+ return this.crisp.post(this.crisp.prepareRestUrl([
585
+ "website", websiteID, "conversation", sessionID, "reminder"
586
+ ]), null, {
587
+ date: date,
588
+ note: note
589
+ });
590
+ }
591
+ ;
592
+ /**
593
+ * Report Conversation
594
+ */
595
+ reportConversation(websiteID, sessionID, flag) {
596
+ return this.crisp.post(this.crisp.prepareRestUrl([
597
+ "website", websiteID, "conversation", sessionID, "report"
598
+ ]), null, {
599
+ flag: flag
600
+ });
601
+ }
602
+ ;
603
+ }
604
+ /**************************************************************************
605
+ * EXPORTS
606
+ ***************************************************************************/
607
+ exports.default = WebsiteConversation;