crisp-api 9.6.0 → 9.8.0

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,18 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v9.8.0
5
+
6
+ ### New Features
7
+
8
+ * Added the new `CrispClient.website.markConversationAsUnread` method.
9
+
10
+ ## v9.7.0
11
+
12
+ ### New Features
13
+
14
+ * Added the new `CrispClient.website.reportConversation` method.
15
+
4
16
  ## v9.6.0
5
17
 
6
18
  ### New Features
package/EXAMPLES.md CHANGED
@@ -207,6 +207,19 @@ CrispClient.website.markMessagesReadInConversation(websiteID, sessionID, read);
207
207
 
208
208
  =========================
209
209
 
210
+ https://docs.crisp.chat/references/rest-api/v1/#mark-conversation-as-unread
211
+
212
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
213
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
214
+
215
+ var unread = {
216
+ "from": "operator"
217
+ };
218
+
219
+ CrispClient.website.markConversationAsUnread(websiteID, sessionID, unread);
220
+
221
+ =========================
222
+
210
223
  https://docs.crisp.chat/references/rest-api/v1/#mark-messages-as-delivered-in-conversation
211
224
 
212
225
  var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
@@ -611,6 +624,17 @@ CrispClient.website.deliverWidgetDataEditActionForConversation(websiteID, sessio
611
624
 
612
625
  =========================
613
626
 
627
+ https://docs.crisp.chat/references/rest-api/v1/#report-conversation
628
+
629
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
630
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
631
+
632
+ var flag = "spam";
633
+
634
+ CrispClient.website.reportConversation(websiteID, sessionID, flag);
635
+
636
+ =========================
637
+
614
638
  https://docs.crisp.chat/references/rest-api/v1/#schedule-a-reminder-for-conversation
615
639
 
616
640
  var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
@@ -1626,7 +1650,8 @@ var settings = {
1626
1650
  },
1627
1651
  "inbox": {
1628
1652
  "lock_removal": false,
1629
- "force_operator_token": false
1653
+ "force_operator_token": false,
1654
+ "locale": ""
1630
1655
  },
1631
1656
  "emails": {
1632
1657
  "rating": true,
@@ -1642,6 +1667,7 @@ var settings = {
1642
1667
  "ongoing_operator_face": true,
1643
1668
  "activity_metrics": true,
1644
1669
  "operator_privacy": false,
1670
+ "visitor_privacy": false,
1645
1671
  "availability_tooltip": true,
1646
1672
  "hide_vacation": false,
1647
1673
  "hide_on_away": false,
package/README.md CHANGED
@@ -6,7 +6,7 @@ The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, ac
6
6
 
7
7
  Copyright 2024 Crisp IM SAS. See LICENSE for copying information.
8
8
 
9
- * **📝 Implements**: [REST API Reference (V1)](https://docs.crisp.chat/references/rest-api/v1/) at revision: 27/01/2025
9
+ * **📝 Implements**: [REST API Reference (V1)](https://docs.crisp.chat/references/rest-api/v1/) at revision: 14/03/2025
10
10
  * **😘 Maintainers**: [@baptistejamin](https://github.com/baptistejamin), [@eliottvincent](https://github.com/eliottvincent), [@valeriansaliou](https://github.com/valeriansaliou)
11
11
 
12
12
  ## Installation
@@ -458,6 +458,23 @@ All methods that you will most likely need when building a Crisp integration are
458
458
  ```
459
459
  </details>
460
460
 
461
+ * **Mark Conversation As Unread** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#mark-conversation-as-unread)
462
+ * `CrispClient.website.markConversationAsUnread(websiteID, sessionID, unread)`
463
+ * <details>
464
+ <summary>See Example</summary>
465
+
466
+ ```javascript
467
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
468
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
469
+
470
+ var unread = {
471
+ "from": "operator"
472
+ };
473
+
474
+ CrispClient.website.markConversationAsUnread(websiteID, sessionID, unread);
475
+ ```
476
+ </details>
477
+
461
478
  * **⭐ Mark Messages As Delivered In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#mark-messages-as-delivered-in-conversation)
462
479
  * `CrispClient.website.markMessagesDeliveredInConversation(websiteID, sessionID, delivered)`
463
480
  * <details>
@@ -1012,6 +1029,21 @@ All methods that you will most likely need when building a Crisp integration are
1012
1029
  ```
1013
1030
  </details>
1014
1031
 
1032
+ * **Report Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#report-conversation)
1033
+ * `CrispClient.website.reportConversation(websiteID, sessionID, flag)`
1034
+ * <details>
1035
+ <summary>See Example</summary>
1036
+
1037
+ ```javascript
1038
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
1039
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
1040
+
1041
+ var flag = "spam";
1042
+
1043
+ CrispClient.website.reportConversation(websiteID, sessionID, flag);
1044
+ ```
1045
+ </details>
1046
+
1015
1047
 
1016
1048
  * ### **Website People** _(these are your end-users)_
1017
1049
  * **Get People Statistics** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-statistics)
@@ -2368,7 +2400,8 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
2368
2400
  },
2369
2401
  "inbox": {
2370
2402
  "lock_removal": false,
2371
- "force_operator_token": false
2403
+ "force_operator_token": false,
2404
+ "locale": ""
2372
2405
  },
2373
2406
  "emails": {
2374
2407
  "rating": true,
@@ -2384,6 +2417,7 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
2384
2417
  "ongoing_operator_face": true,
2385
2418
  "activity_metrics": true,
2386
2419
  "operator_privacy": false,
2420
+ "visitor_privacy": false,
2387
2421
  "availability_tooltip": true,
2388
2422
  "hide_vacation": false,
2389
2423
  "hide_on_away": false,
@@ -3526,6 +3560,8 @@ Available events are listed below:
3526
3560
  * `message:acknowledge:read:send`
3527
3561
  * **Message Acknowledge Read Received** [`user`, `plugin`]:
3528
3562
  * `message:acknowledge:read:received`
3563
+ * **Message Acknowledge Unread Send** [`user`, `plugin`]:
3564
+ * `message:acknowledge:unread:send`
3529
3565
  * **Message Acknowledge Delivered** [`user`, `plugin`]:
3530
3566
  * `message:acknowledge:delivered`
3531
3567
  * **Message Acknowledge Ignored** [`user`, `plugin`]:
@@ -406,6 +406,26 @@ function WebsiteConversation(service, crisp) {
406
406
  );
407
407
  };
408
408
 
409
+ /**
410
+ * Mark Conversation As Unread
411
+ * @memberof WebsiteConversation
412
+ * @public
413
+ * @method markConversationAsUnread
414
+ * @param {string} websiteID
415
+ * @param {string} sessionID
416
+ * @param {object} unread
417
+ * @return {Promise}
418
+ */
419
+ service.markConversationAsUnread = function(websiteID, sessionID, unread) {
420
+ return crisp.patch(
421
+ crisp._prepareRestUrl([
422
+ "website", websiteID, "conversation", sessionID, "unread"
423
+ ]),
424
+
425
+ null, unread
426
+ );
427
+ };
428
+
409
429
  /**
410
430
  * Mark Messages As Delivered In Conversation
411
431
  * @memberof WebsiteConversation
@@ -1164,6 +1184,32 @@ function WebsiteConversation(service, crisp) {
1164
1184
  }
1165
1185
  );
1166
1186
  };
1187
+
1188
+ /**
1189
+ * Report Conversation
1190
+ * @memberof WebsiteConversation
1191
+ * @public
1192
+ * @method reportConversation
1193
+ * @param {string} websiteID
1194
+ * @param {string} sessionID
1195
+ * @param {string} flag
1196
+ * @return {Promise}
1197
+ */
1198
+ service.reportConversation = function(
1199
+ websiteID, sessionID, flag
1200
+ ) {
1201
+ return crisp.post(
1202
+ crisp._prepareRestUrl([
1203
+ "website", websiteID, "conversation", sessionID, "report"
1204
+ ]),
1205
+
1206
+ null,
1207
+
1208
+ {
1209
+ flag : flag
1210
+ }
1211
+ );
1212
+ };
1167
1213
  }
1168
1214
 
1169
1215
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "crisp-api",
3
3
  "description": "Crisp API wrapper for Node - official, maintained by Crisp",
4
- "version": "9.6.0",
4
+ "version": "9.8.0",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {