crisp-api 10.6.1 → 10.7.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,16 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v10.7.0
5
+
6
+ ### New Features
7
+
8
+ * Added the new `CrispClient.website.getConversationRelations` method.
9
+
10
+ ### Changes
11
+
12
+ * Added optional `properties` on all message types.
13
+
4
14
  ## v10.6.1
5
15
 
6
16
  ### Changes
package/EXAMPLES.md CHANGED
@@ -374,6 +374,15 @@ CrispClient.website.changeConversationState(websiteID, sessionID, state);
374
374
 
375
375
  =========================
376
376
 
377
+ https://docs.crisp.chat/references/rest-api/v1/#get-conversation-relations
378
+
379
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
380
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
381
+
382
+ CrispClient.website.getConversationRelations(websiteID, sessionID);
383
+
384
+ =========================
385
+
377
386
  https://docs.crisp.chat/references/rest-api/v1/#get-conversation-participants
378
387
 
379
388
  var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
package/README.md CHANGED
@@ -694,6 +694,19 @@ All methods that you will most likely need when building a Crisp integration are
694
694
  ```
695
695
  </details>
696
696
 
697
+ * **Get Conversation Relations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-relations)
698
+ * `CrispClient.website.getConversationRelations(websiteID, sessionID)`
699
+ * <details>
700
+ <summary>See Example</summary>
701
+
702
+ ```javascript
703
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
704
+ var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
705
+
706
+ CrispClient.website.getConversationRelations(websiteID, sessionID);
707
+ ```
708
+ </details>
709
+
697
710
  * **Get Conversation Participants** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-participants)
698
711
  * `CrispClient.website.getConversationParticipants(websiteID, sessionID)`
699
712
  * <details>
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.6.1";
49
+ const VERSION = "10.7.0";
50
50
  // Base configuration
51
51
  const DEFAULT_REQUEST_TIMEOUT = 10000;
52
52
  const DEFAULT_SOCKET_TIMEOUT = 10000;
@@ -71,6 +71,13 @@ export interface ConversationVerification {
71
71
  method?: string;
72
72
  annotation?: string;
73
73
  }
74
+ export interface ConversationRelations {
75
+ conversations?: ConversationRelationsConversations;
76
+ }
77
+ export interface ConversationRelationsConversations {
78
+ parent?: string | null;
79
+ children?: string[];
80
+ }
74
81
  export interface ConversationParticipant {
75
82
  type?: string;
76
83
  target?: string;
@@ -159,6 +166,9 @@ export interface ConversationMessage {
159
166
  user?: ConversationMessageUser;
160
167
  references?: ConversationMessageReference[];
161
168
  original?: ConversationMessageOriginal;
169
+ properties?: {
170
+ [key: string]: string | number | boolean;
171
+ };
162
172
  }
163
173
  export interface ConversationFileMessageContent {
164
174
  name?: string;
@@ -256,6 +266,9 @@ export interface ConversationMessageNewBase {
256
266
  user?: ConversationMessageUser;
257
267
  references?: ConversationMessageReference[];
258
268
  original?: ConversationMessageOriginal;
269
+ properties?: {
270
+ [key: string]: string | number | boolean;
271
+ };
259
272
  timestamp?: number;
260
273
  stealth?: boolean;
261
274
  translated?: boolean;
@@ -573,6 +586,10 @@ declare class WebsiteConversation extends BaseResource {
573
586
  * Change Conversation State
574
587
  */
575
588
  changeConversationState(websiteID: string, sessionID: string, state: ConversationState): Promise<any>;
589
+ /**
590
+ * Get Conversation Relations
591
+ */
592
+ getConversationRelations(websiteID: string, sessionID: string): Promise<ConversationRelations>;
576
593
  /**
577
594
  * Get Conversation Participants
578
595
  */
@@ -342,6 +342,15 @@ class WebsiteConversation extends BaseResource_1.default {
342
342
  });
343
343
  }
344
344
  ;
345
+ /**
346
+ * Get Conversation Relations
347
+ */
348
+ getConversationRelations(websiteID, sessionID) {
349
+ return this.crisp.get(this.crisp.prepareRestUrl([
350
+ "website", websiteID, "conversation", sessionID, "relations"
351
+ ]));
352
+ }
353
+ ;
345
354
  /**
346
355
  * Get Conversation Participants
347
356
  */
@@ -92,6 +92,15 @@ export interface ConversationVerification {
92
92
  annotation?: string;
93
93
  }
94
94
 
95
+ export interface ConversationRelations {
96
+ conversations?: ConversationRelationsConversations;
97
+ }
98
+
99
+ export interface ConversationRelationsConversations {
100
+ parent?: string|null;
101
+ children?: string[];
102
+ }
103
+
95
104
  export interface ConversationParticipant {
96
105
  type?: string;
97
106
  target?: string;
@@ -213,6 +222,7 @@ export interface ConversationMessage {
213
222
  user?: ConversationMessageUser;
214
223
  references?: ConversationMessageReference[];
215
224
  original?: ConversationMessageOriginal;
225
+ properties?: { [key: string]: string|number|boolean };
216
226
  }
217
227
 
218
228
  export interface ConversationFileMessageContent {
@@ -338,6 +348,7 @@ export interface ConversationMessageNewBase {
338
348
  user?: ConversationMessageUser;
339
349
  references?: ConversationMessageReference[];
340
350
  original?: ConversationMessageOriginal;
351
+ properties?: { [key: string]: string|number|boolean };
341
352
  timestamp?: number;
342
353
  stealth?: boolean;
343
354
  translated?: boolean;
@@ -1061,6 +1072,19 @@ class WebsiteConversation extends BaseResource {
1061
1072
  );
1062
1073
  };
1063
1074
 
1075
+ /**
1076
+ * Get Conversation Relations
1077
+ */
1078
+ getConversationRelations(
1079
+ websiteID: string, sessionID: string
1080
+ ): Promise<ConversationRelations> {
1081
+ return this.crisp.get(
1082
+ this.crisp.prepareRestUrl([
1083
+ "website", websiteID, "conversation", sessionID, "relations"
1084
+ ])
1085
+ );
1086
+ };
1087
+
1064
1088
  /**
1065
1089
  * Get Conversation Participants
1066
1090
  */
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.6.1",
4
+ "version": "10.7.0",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {