crisp-api 10.9.2 → 10.9.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.
package/dist/crisp.d.ts CHANGED
@@ -9,7 +9,7 @@ import { WebsiteServiceInterface } from "./services/website";
9
9
  * TYPES
10
10
  ***************************************************************************/
11
11
  export type RTM_MODES = "websockets" | "webhooks";
12
- export type CrispTier = "user" | "plugin";
12
+ export type CrispTier = "user" | "website" | "plugin";
13
13
  /**************************************************************************
14
14
  * INTERFACES
15
15
  ***************************************************************************/
@@ -79,7 +79,7 @@ declare class Crisp {
79
79
  /**
80
80
  * Sets the authentication tier
81
81
  */
82
- setTier(tier: "user" | "plugin"): void;
82
+ setTier(tier: "user" | "website" | "plugin"): void;
83
83
  /**
84
84
  * Authenticates
85
85
  */
package/dist/crisp.js CHANGED
@@ -46,7 +46,7 @@ const AVAILABLE_RTM_MODES = [
46
46
  "websockets",
47
47
  "webhooks"
48
48
  ];
49
- const VERSION = "10.9.2";
49
+ const VERSION = "10.9.3";
50
50
  // Base configuration
51
51
  const DEFAULT_REQUEST_TIMEOUT = 10000;
52
52
  const DEFAULT_SOCKET_TIMEOUT = 10000;
@@ -578,6 +578,10 @@ class Crisp {
578
578
  // Acquire RTM API URL from remote
579
579
  let restUrlSegments;
580
580
  switch (this.auth.tier) {
581
+ case "website": {
582
+ restUrlSegments = ["website", "connect", "endpoints"];
583
+ break;
584
+ }
581
585
  case "plugin": {
582
586
  restUrlSegments = ["plugin", "connect", "endpoints"];
583
587
  break;
@@ -555,7 +555,7 @@ declare class WebsiteConversation extends BaseResource {
555
555
  /**
556
556
  * Update Conversation Inbox
557
557
  */
558
- updateConversationInbox(websiteID: string, sessionID: string, inboxID: string): Promise<any>;
558
+ updateConversationInbox(websiteID: string, sessionID: string, inboxID?: string | null): Promise<any>;
559
559
  /**
560
560
  * Get Conversation Metas
561
561
  */
@@ -268,7 +268,7 @@ class WebsiteConversation extends BaseResource_1.default {
268
268
  return this.crisp.patch(this.crisp.prepareRestUrl([
269
269
  "website", websiteID, "conversation", sessionID, "inbox"
270
270
  ]), null, {
271
- inbox_id: inboxID
271
+ inbox_id: inboxID || null
272
272
  });
273
273
  }
274
274
  /**
package/lib/crisp.ts CHANGED
@@ -31,7 +31,7 @@ import Website, { WebsiteServiceInterface } from "@/services/website";
31
31
 
32
32
  export type RTM_MODES = "websockets" | "webhooks";
33
33
 
34
- export type CrispTier = "user" | "plugin";
34
+ export type CrispTier = "user" | "website" | "plugin";
35
35
 
36
36
  /**************************************************************************
37
37
  * CONSTANTS
@@ -322,7 +322,7 @@ class Crisp {
322
322
  /**
323
323
  * Sets the authentication tier
324
324
  */
325
- setTier(tier: "user" | "plugin") {
325
+ setTier(tier: "user" | "website" | "plugin") {
326
326
  this.auth.tier = (tier || "user");
327
327
  }
328
328
 
@@ -753,6 +753,12 @@ class Crisp {
753
753
  let restUrlSegments;
754
754
 
755
755
  switch (this.auth.tier) {
756
+ case "website": {
757
+ restUrlSegments = ["website", "connect", "endpoints"];
758
+
759
+ break;
760
+ }
761
+
756
762
  case "plugin": {
757
763
  restUrlSegments = ["plugin", "connect", "endpoints"];
758
764
 
@@ -947,7 +947,7 @@ class WebsiteConversation extends BaseResource {
947
947
  * Update Conversation Inbox
948
948
  */
949
949
  updateConversationInbox(
950
- websiteID: string, sessionID: string, inboxID: string
950
+ websiteID: string, sessionID: string, inboxID?: string | null
951
951
  ) {
952
952
  return this.crisp.patch(
953
953
  this.crisp.prepareRestUrl([
@@ -957,7 +957,7 @@ class WebsiteConversation extends BaseResource {
957
957
  null,
958
958
 
959
959
  {
960
- inbox_id: inboxID
960
+ inbox_id: inboxID || null
961
961
  }
962
962
  );
963
963
  }
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": "10.9.2",
4
+ "version": "10.9.3",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {