crisp-api 9.7.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,12 @@
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
+
4
10
  ## v9.7.0
5
11
 
6
12
  ### 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";
@@ -1637,7 +1650,8 @@ var settings = {
1637
1650
  },
1638
1651
  "inbox": {
1639
1652
  "lock_removal": false,
1640
- "force_operator_token": false
1653
+ "force_operator_token": false,
1654
+ "locale": ""
1641
1655
  },
1642
1656
  "emails": {
1643
1657
  "rating": true,
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: 30/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>
@@ -2383,7 +2400,8 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
2383
2400
  },
2384
2401
  "inbox": {
2385
2402
  "lock_removal": false,
2386
- "force_operator_token": false
2403
+ "force_operator_token": false,
2404
+ "locale": ""
2387
2405
  },
2388
2406
  "emails": {
2389
2407
  "rating": true,
@@ -3542,6 +3560,8 @@ Available events are listed below:
3542
3560
  * `message:acknowledge:read:send`
3543
3561
  * **Message Acknowledge Read Received** [`user`, `plugin`]:
3544
3562
  * `message:acknowledge:read:received`
3563
+ * **Message Acknowledge Unread Send** [`user`, `plugin`]:
3564
+ * `message:acknowledge:unread:send`
3545
3565
  * **Message Acknowledge Delivered** [`user`, `plugin`]:
3546
3566
  * `message:acknowledge:delivered`
3547
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
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.7.0",
4
+ "version": "9.8.0",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {