crisp-api 9.7.0 → 9.9.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.9.0
5
+
6
+ ### New Features
7
+
8
+ * Added support for the `session:set_origin` RTM API event.
9
+
10
+ ## v9.8.0
11
+
12
+ ### New Features
13
+
14
+ * Added the new `CrispClient.website.markConversationAsUnread` method.
15
+
4
16
  ## v9.7.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";
@@ -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
@@ -4,9 +4,9 @@
4
4
 
5
5
  The Crisp API Node wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your JavaScript code.
6
6
 
7
- Copyright 2024 Crisp IM SAS. See LICENSE for copying information.
7
+ Copyright 2025 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: 17/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,
@@ -3480,6 +3498,8 @@ Available events are listed below:
3480
3498
  * `session:set_avatar`
3481
3499
  * **Session Set Nickname** [`user`, `plugin`]:
3482
3500
  * `session:set_nickname`
3501
+ * **Session Set Origin** [`user`, `plugin`]:
3502
+ * `session:set_origin`
3483
3503
  * **Session Set Data** [`user`, `plugin`]:
3484
3504
  * `session:set_data`
3485
3505
  * **Session Sync Pages** [`user`, `plugin`]:
@@ -3542,6 +3562,8 @@ Available events are listed below:
3542
3562
  * `message:acknowledge:read:send`
3543
3563
  * **Message Acknowledge Read Received** [`user`, `plugin`]:
3544
3564
  * `message:acknowledge:read:received`
3565
+ * **Message Acknowledge Unread Send** [`user`, `plugin`]:
3566
+ * `message:acknowledge:unread:send`
3545
3567
  * **Message Acknowledge Delivered** [`user`, `plugin`]:
3546
3568
  * `message:acknowledge:delivered`
3547
3569
  * **Message Acknowledge Ignored** [`user`, `plugin`]:
package/lib/crisp.js CHANGED
@@ -60,6 +60,7 @@ Crisp.DEFAULT_RTM_EVENTS = [
60
60
  "session:set_subject",
61
61
  "session:set_avatar",
62
62
  "session:set_nickname",
63
+ "session:set_origin",
63
64
  "session:set_data",
64
65
  "session:sync:pages",
65
66
  "session:sync:events",
@@ -92,6 +93,7 @@ Crisp.DEFAULT_RTM_EVENTS = [
92
93
  "message:compose:receive",
93
94
  "message:acknowledge:read:send",
94
95
  "message:acknowledge:read:received",
96
+ "message:acknowledge:unread:send",
95
97
  "message:acknowledge:delivered",
96
98
  "message:acknowledge:ignored",
97
99
  "message:notify:unread:send",
@@ -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.9.0",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {