crisp-api 10.8.1 → 10.8.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/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v10.8.2
5
+
6
+ ### Changes
7
+
8
+ * Added `mode_initial` and `home` properties on `chatbox` options in website settings.
9
+
4
10
  ## v10.8.1
5
11
 
6
12
  ### Changes
package/EXAMPLES.md CHANGED
@@ -1717,6 +1717,8 @@ var settings = {
1717
1717
  "visitor_compose": false,
1718
1718
  "file_transfer": true,
1719
1719
  "audio_record": true,
1720
+ "mode_initial": "chat",
1721
+ "home": true,
1720
1722
  "overlay_search": true,
1721
1723
  "overlay_mode": false,
1722
1724
  "helpdesk_link": true,
package/README.md CHANGED
@@ -22,7 +22,7 @@ To authenticate against the API, obtain your authentication token keypair by fol
22
22
  Then, add authentication parameters to your `client` instance right after you create it:
23
23
 
24
24
  ```javascript
25
- var Crisp = require("crisp-api");
25
+ var { Crisp } = require("crisp-api");
26
26
  var CrispClient = new Crisp();
27
27
 
28
28
  // Authenticate to API with your plugin token (identifier, key)
@@ -37,7 +37,7 @@ CrispClient.authenticateTier("plugin", identifier, key);
37
37
  You may follow the [REST API Quickstart](https://docs.crisp.chat/guides/rest-api/quickstart/) guide, which will get you running with the REST API in minutes.
38
38
 
39
39
  ```javascript
40
- var Crisp = require("crisp-api");
40
+ var { Crisp } = require("crisp-api");
41
41
  var CrispClient = new Crisp();
42
42
 
43
43
  CrispClient.authenticateTier("plugin", identifier, key);
@@ -56,7 +56,7 @@ CrispClient.website.listConversations(websiteID, 1)
56
56
  ### Create your own bot!
57
57
 
58
58
  ```javascript
59
- var Crisp = require("crisp-api");
59
+ var { Crisp } = require("crisp-api");
60
60
  var CrispClient = new Crisp();
61
61
 
62
62
  CrispClient.authenticateTier("plugin", identifier, key);
@@ -2492,6 +2492,8 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
2492
2492
  "visitor_compose": false,
2493
2493
  "file_transfer": true,
2494
2494
  "audio_record": true,
2495
+ "mode_initial": "chat",
2496
+ "home": true,
2495
2497
  "overlay_search": true,
2496
2498
  "overlay_mode": false,
2497
2499
  "helpdesk_link": true,
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.8.1";
49
+ const VERSION = "10.8.3";
50
50
  // Base configuration
51
51
  const DEFAULT_REQUEST_TIMEOUT = 10000;
52
52
  const DEFAULT_SOCKET_TIMEOUT = 10000;
@@ -87,6 +87,7 @@ export interface ConversationParticipants {
87
87
  }
88
88
  export interface ConversationParticipantsSave {
89
89
  participants?: ConversationParticipant[];
90
+ user?: ConversationMessageUser;
90
91
  }
91
92
  export interface ConversationMeta {
92
93
  nickname?: string;
@@ -585,7 +586,7 @@ declare class WebsiteConversation extends BaseResource {
585
586
  /**
586
587
  * Change Conversation State
587
588
  */
588
- changeConversationState(websiteID: string, sessionID: string, state: ConversationState): Promise<any>;
589
+ changeConversationState(websiteID: string, sessionID: string, state: ConversationState, user?: ConversationMessageUser): Promise<any>;
589
590
  /**
590
591
  * Get Conversation Relations
591
592
  */
@@ -605,7 +606,7 @@ declare class WebsiteConversation extends BaseResource {
605
606
  /**
606
607
  * Block Incoming Messages For Conversation
607
608
  */
608
- blockIncomingMessagesForConversation(websiteID: string, sessionID: string, blocked: boolean): Promise<any>;
609
+ blockIncomingMessagesForConversation(websiteID: string, sessionID: string, blocked: boolean, user?: ConversationMessageUser): Promise<any>;
609
610
  /**
610
611
  * Get Verify Status For Conversation
611
612
  */
@@ -653,7 +654,7 @@ declare class WebsiteConversation extends BaseResource {
653
654
  /**
654
655
  * Initiate New Call Session For Conversation
655
656
  */
656
- initiateNewCallSessionForConversation(websiteID: string, sessionID: string, mode: string): Promise<any>;
657
+ initiateNewCallSessionForConversation(websiteID: string, sessionID: string, mode: string, user?: ConversationMessageUser): Promise<any>;
657
658
  /**
658
659
  * Get Ongoing Call Session For Conversation
659
660
  */
@@ -661,7 +662,7 @@ declare class WebsiteConversation extends BaseResource {
661
662
  /**
662
663
  * Abort Ongoing Call Session For Conversation
663
664
  */
664
- abortOngoingCallSessionForConversation(websiteID: string, sessionID: string, callID: string): Promise<any>;
665
+ abortOngoingCallSessionForConversation(websiteID: string, sessionID: string, callID: string, user?: ConversationMessageUser): Promise<any>;
665
666
  /**
666
667
  * Transmit Signaling On Ongoing Call Session
667
668
  */
@@ -681,7 +682,7 @@ declare class WebsiteConversation extends BaseResource {
681
682
  /**
682
683
  * Schedule A Reminder For Conversation
683
684
  */
684
- scheduleReminderForConversation(websiteID: string, sessionID: string, date: string, note: string): Promise<any>;
685
+ scheduleReminderForConversation(websiteID: string, sessionID: string, date: string, note: string, user?: ConversationMessageUser): Promise<any>;
685
686
  /**
686
687
  * Report Conversation
687
688
  */
@@ -334,11 +334,12 @@ class WebsiteConversation extends BaseResource_1.default {
334
334
  /**
335
335
  * Change Conversation State
336
336
  */
337
- changeConversationState(websiteID, sessionID, state) {
337
+ changeConversationState(websiteID, sessionID, state, user) {
338
338
  return this.crisp.patch(this.crisp.prepareRestUrl([
339
339
  "website", websiteID, "conversation", sessionID, "state"
340
340
  ]), null, {
341
- state: state
341
+ state: state,
342
+ user: user
342
343
  });
343
344
  }
344
345
  ;
@@ -381,11 +382,12 @@ class WebsiteConversation extends BaseResource_1.default {
381
382
  /**
382
383
  * Block Incoming Messages For Conversation
383
384
  */
384
- blockIncomingMessagesForConversation(websiteID, sessionID, blocked) {
385
+ blockIncomingMessagesForConversation(websiteID, sessionID, blocked, user) {
385
386
  return this.crisp.patch(this.crisp.prepareRestUrl([
386
387
  "website", websiteID, "conversation", sessionID, "block"
387
388
  ]), null, {
388
- blocked: (blocked || false)
389
+ blocked: (blocked || false),
390
+ user: user
389
391
  });
390
392
  }
391
393
  ;
@@ -505,11 +507,12 @@ class WebsiteConversation extends BaseResource_1.default {
505
507
  /**
506
508
  * Initiate New Call Session For Conversation
507
509
  */
508
- initiateNewCallSessionForConversation(websiteID, sessionID, mode) {
510
+ initiateNewCallSessionForConversation(websiteID, sessionID, mode, user) {
509
511
  return this.crisp.post(this.crisp.prepareRestUrl([
510
512
  "website", websiteID, "conversation", sessionID, "call"
511
513
  ]), null, {
512
- mode: (mode || "audio")
514
+ mode: (mode || "audio"),
515
+ user: user
513
516
  });
514
517
  }
515
518
  ;
@@ -525,10 +528,12 @@ class WebsiteConversation extends BaseResource_1.default {
525
528
  /**
526
529
  * Abort Ongoing Call Session For Conversation
527
530
  */
528
- abortOngoingCallSessionForConversation(websiteID, sessionID, callID) {
531
+ abortOngoingCallSessionForConversation(websiteID, sessionID, callID, user) {
529
532
  return this.crisp.delete(this.crisp.prepareRestUrl([
530
533
  "website", websiteID, "conversation", sessionID, "call", callID
531
- ]));
534
+ ]), null, {
535
+ user: user
536
+ });
532
537
  }
533
538
  ;
534
539
  /**
@@ -591,12 +596,13 @@ class WebsiteConversation extends BaseResource_1.default {
591
596
  /**
592
597
  * Schedule A Reminder For Conversation
593
598
  */
594
- scheduleReminderForConversation(websiteID, sessionID, date, note) {
599
+ scheduleReminderForConversation(websiteID, sessionID, date, note, user) {
595
600
  return this.crisp.post(this.crisp.prepareRestUrl([
596
601
  "website", websiteID, "conversation", sessionID, "reminder"
597
602
  ]), null, {
598
603
  date: date,
599
- note: note
604
+ note: note,
605
+ user: user
600
606
  });
601
607
  }
602
608
  ;
@@ -21,11 +21,19 @@ export interface HelpdeskLocale {
21
21
  categories?: number;
22
22
  }
23
23
  export interface HelpdeskLocaleArticle {
24
- locale_id?: string;
25
- locale?: string;
24
+ article_id?: string;
25
+ title?: string;
26
+ description?: string | null;
27
+ content?: string;
28
+ status?: "published" | "draft";
29
+ visibility?: "visible" | "hidden";
30
+ featured?: boolean;
31
+ visits?: number;
32
+ order?: number;
26
33
  url?: string;
27
- articles?: number;
28
- categories?: number;
34
+ created_at?: number;
35
+ updated_at?: number;
36
+ published_at?: number;
29
37
  }
30
38
  export interface HelpdeskLocaleArticleCategory {
31
39
  category_id?: string;
@@ -61,6 +61,8 @@ export interface WebsiteSettingsChatbox {
61
61
  visitor_compose?: boolean;
62
62
  file_transfer?: boolean;
63
63
  audio_record?: boolean;
64
+ mode_initial?: string;
65
+ home?: boolean;
64
66
  overlay_search?: boolean;
65
67
  overlay_mode?: boolean;
66
68
  helpdesk_link?: boolean;
@@ -78,6 +80,7 @@ export interface WebsiteSettingsChatbox {
78
80
  blocked_pages?: string[];
79
81
  blocked_countries?: string[];
80
82
  blocked_locales?: string[];
83
+ blocked_ips?: string[];
81
84
  }
82
85
  export interface WebsiteSettingsUpdate {
83
86
  websiteID?: string;
@@ -135,6 +138,8 @@ export interface WebsiteSettingsUpdateChatbox {
135
138
  visitor_compose?: boolean;
136
139
  file_transfer?: boolean;
137
140
  audio_record?: boolean;
141
+ mode_initial?: string;
142
+ home?: boolean;
138
143
  overlay_search?: boolean;
139
144
  overlay_mode?: boolean;
140
145
  helpdesk_link?: boolean;
@@ -112,6 +112,7 @@ export interface ConversationParticipants {
112
112
 
113
113
  export interface ConversationParticipantsSave {
114
114
  participants?: ConversationParticipant[];
115
+ user?: ConversationMessageUser;
115
116
  }
116
117
 
117
118
  export interface ConversationMeta {
@@ -1057,7 +1058,8 @@ class WebsiteConversation extends BaseResource {
1057
1058
  * Change Conversation State
1058
1059
  */
1059
1060
  changeConversationState(
1060
- websiteID: string, sessionID: string, state: ConversationState
1061
+ websiteID: string, sessionID: string, state: ConversationState,
1062
+ user?: ConversationMessageUser
1061
1063
  ) {
1062
1064
  return this.crisp.patch(
1063
1065
  this.crisp.prepareRestUrl([
@@ -1067,7 +1069,8 @@ class WebsiteConversation extends BaseResource {
1067
1069
  null,
1068
1070
 
1069
1071
  {
1070
- state: state
1072
+ state: state,
1073
+ user: user
1071
1074
  }
1072
1075
  );
1073
1076
  };
@@ -1130,7 +1133,8 @@ class WebsiteConversation extends BaseResource {
1130
1133
  * Block Incoming Messages For Conversation
1131
1134
  */
1132
1135
  blockIncomingMessagesForConversation(
1133
- websiteID: string, sessionID: string, blocked: boolean
1136
+ websiteID: string, sessionID: string, blocked: boolean,
1137
+ user?: ConversationMessageUser
1134
1138
  ) {
1135
1139
  return this.crisp.patch(
1136
1140
  this.crisp.prepareRestUrl([
@@ -1140,7 +1144,8 @@ class WebsiteConversation extends BaseResource {
1140
1144
  null,
1141
1145
 
1142
1146
  {
1143
- blocked: (blocked || false)
1147
+ blocked: (blocked || false),
1148
+ user: user
1144
1149
  }
1145
1150
  );
1146
1151
  };
@@ -1334,7 +1339,8 @@ class WebsiteConversation extends BaseResource {
1334
1339
  * Initiate New Call Session For Conversation
1335
1340
  */
1336
1341
  initiateNewCallSessionForConversation(
1337
- websiteID: string, sessionID: string, mode: string
1342
+ websiteID: string, sessionID: string, mode: string,
1343
+ user?: ConversationMessageUser
1338
1344
  ) {
1339
1345
  return this.crisp.post(
1340
1346
  this.crisp.prepareRestUrl([
@@ -1344,7 +1350,8 @@ class WebsiteConversation extends BaseResource {
1344
1350
  null,
1345
1351
 
1346
1352
  {
1347
- mode: (mode || "audio")
1353
+ mode: (mode || "audio"),
1354
+ user: user
1348
1355
  }
1349
1356
  );
1350
1357
  };
@@ -1366,12 +1373,19 @@ class WebsiteConversation extends BaseResource {
1366
1373
  * Abort Ongoing Call Session For Conversation
1367
1374
  */
1368
1375
  abortOngoingCallSessionForConversation(
1369
- websiteID: string, sessionID: string, callID: string
1376
+ websiteID: string, sessionID: string, callID: string,
1377
+ user?: ConversationMessageUser
1370
1378
  ) {
1371
1379
  return this.crisp.delete(
1372
1380
  this.crisp.prepareRestUrl([
1373
1381
  "website", websiteID, "conversation", sessionID, "call", callID
1374
- ])
1382
+ ]),
1383
+
1384
+ null,
1385
+
1386
+ {
1387
+ user: user
1388
+ }
1375
1389
  );
1376
1390
  };
1377
1391
 
@@ -1469,7 +1483,8 @@ class WebsiteConversation extends BaseResource {
1469
1483
  * Schedule A Reminder For Conversation
1470
1484
  */
1471
1485
  scheduleReminderForConversation(
1472
- websiteID: string, sessionID: string, date: string, note: string
1486
+ websiteID: string, sessionID: string, date: string, note: string,
1487
+ user?: ConversationMessageUser
1473
1488
  ) {
1474
1489
  return this.crisp.post(
1475
1490
  this.crisp.prepareRestUrl([
@@ -1480,7 +1495,8 @@ class WebsiteConversation extends BaseResource {
1480
1495
 
1481
1496
  {
1482
1497
  date: date,
1483
- note: note
1498
+ note: note,
1499
+ user: user
1484
1500
  }
1485
1501
  );
1486
1502
  };
@@ -35,11 +35,19 @@ export interface HelpdeskLocale {
35
35
  }
36
36
 
37
37
  export interface HelpdeskLocaleArticle {
38
- locale_id?: string;
39
- locale?: string;
38
+ article_id?: string;
39
+ title?: string;
40
+ description?: string | null;
41
+ content?: string;
42
+ status?: "published" | "draft";
43
+ visibility?: "visible" | "hidden";
44
+ featured?: boolean;
45
+ visits?: number;
46
+ order?: number;
40
47
  url?: string;
41
- articles?: number;
42
- categories?: number;
48
+ created_at?: number;
49
+ updated_at?: number;
50
+ published_at?: number;
43
51
  }
44
52
 
45
53
  export interface HelpdeskLocaleArticleCategory {
@@ -77,6 +77,8 @@ export interface WebsiteSettingsChatbox {
77
77
  visitor_compose?: boolean;
78
78
  file_transfer?: boolean;
79
79
  audio_record?: boolean;
80
+ mode_initial?: string;
81
+ home?: boolean;
80
82
  overlay_search?: boolean;
81
83
  overlay_mode?: boolean;
82
84
  helpdesk_link?: boolean;
@@ -94,6 +96,7 @@ export interface WebsiteSettingsChatbox {
94
96
  blocked_pages?: string[];
95
97
  blocked_countries?: string[];
96
98
  blocked_locales?: string[];
99
+ blocked_ips?: string[];
97
100
  }
98
101
 
99
102
  export interface WebsiteSettingsUpdate {
@@ -157,6 +160,8 @@ export interface WebsiteSettingsUpdateChatbox {
157
160
  visitor_compose?: boolean;
158
161
  file_transfer?: boolean;
159
162
  audio_record?: boolean;
163
+ mode_initial?: string;
164
+ home?: boolean;
160
165
  overlay_search?: boolean;
161
166
  overlay_mode?: boolean;
162
167
  helpdesk_link?: boolean;
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.8.1",
4
+ "version": "10.8.3",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {