crisp-api 6.3.1 → 6.4.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 +14 -1
- package/EXAMPLES.md +9 -0
- package/README.md +13 -0
- package/lib/crisp.js +7 -5
- package/lib/resources/WebsiteConversation.js +16 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v6.4.0
|
|
5
|
+
|
|
6
|
+
### New Features
|
|
7
|
+
|
|
8
|
+
* Added the new `CrispClient.website.requestUserFeedbackForConversation` method.
|
|
9
|
+
|
|
10
|
+
## v6.3.2
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* Prevent Got from throwing errors for non `2xx / 3xx` response codes.
|
|
15
|
+
* Fixed body payload type.
|
|
16
|
+
|
|
4
17
|
## v6.3.1
|
|
5
18
|
|
|
6
19
|
### Breaking Changes
|
|
@@ -9,7 +22,7 @@ Changelog
|
|
|
9
22
|
|
|
10
23
|
### Changes
|
|
11
24
|
|
|
12
|
-
* Upgraded dependencies (closes [#30](https://github.com/crisp-im/node-crisp-api/issues/30).
|
|
25
|
+
* Upgraded dependencies (closes [#30](https://github.com/crisp-im/node-crisp-api/issues/30)).
|
|
13
26
|
|
|
14
27
|
## v6.3.0
|
|
15
28
|
|
package/EXAMPLES.md
CHANGED
|
@@ -402,6 +402,15 @@ CrispClient.website.requestChatboxBindingPurgeForConversation(websiteID, session
|
|
|
402
402
|
|
|
403
403
|
=========================
|
|
404
404
|
|
|
405
|
+
https://docs.crisp.chat/references/rest-api/v1/#request-user-feedback-for-conversation
|
|
406
|
+
|
|
407
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
408
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
409
|
+
|
|
410
|
+
CrispClient.website.requestUserFeedbackForConversation(websiteID, sessionID);
|
|
411
|
+
|
|
412
|
+
=========================
|
|
413
|
+
|
|
405
414
|
https://docs.crisp.chat/references/rest-api/v1/#list-browsing-sessions-for-conversation
|
|
406
415
|
|
|
407
416
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
package/README.md
CHANGED
|
@@ -716,6 +716,19 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
716
716
|
```
|
|
717
717
|
</details>
|
|
718
718
|
|
|
719
|
+
* **Request User Feedback For Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#request-user-feedback-for-conversation)
|
|
720
|
+
* `CrispClient.website.requestUserFeedbackForConversation(websiteID, sessionID)`
|
|
721
|
+
* <details>
|
|
722
|
+
<summary>See Example</summary>
|
|
723
|
+
|
|
724
|
+
```javascript
|
|
725
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
726
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
727
|
+
|
|
728
|
+
CrispClient.website.requestUserFeedbackForConversation(websiteID, sessionID);
|
|
729
|
+
```
|
|
730
|
+
</details>
|
|
731
|
+
|
|
719
732
|
* **List Browsing Sessions For Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-browsing-sessions-for-conversation)
|
|
720
733
|
* `CrispClient.website.listBrowsingSessionsForConversation(websiteID, sessionID)`
|
|
721
734
|
* <details>
|
package/lib/crisp.js
CHANGED
|
@@ -667,13 +667,15 @@ Crisp.prototype = {
|
|
|
667
667
|
*/
|
|
668
668
|
_request : function(resource, method, query, body, resolve, reject) {
|
|
669
669
|
var requestParameters = {
|
|
670
|
-
responseType
|
|
671
|
-
timeout
|
|
670
|
+
responseType : "json",
|
|
671
|
+
timeout : Crisp.DEFAULT_REQUEST_TIMEOUT,
|
|
672
672
|
|
|
673
|
-
headers
|
|
673
|
+
headers : {
|
|
674
674
|
"User-Agent" : this._useragent,
|
|
675
675
|
"X-Crisp-Tier" : this._tier
|
|
676
|
-
}
|
|
676
|
+
},
|
|
677
|
+
|
|
678
|
+
throwHttpErrors : false
|
|
677
679
|
};
|
|
678
680
|
|
|
679
681
|
// Add authorization?
|
|
@@ -683,7 +685,7 @@ Crisp.prototype = {
|
|
|
683
685
|
|
|
684
686
|
// Add body?
|
|
685
687
|
if (body) {
|
|
686
|
-
requestParameters.
|
|
688
|
+
requestParameters.json = body;
|
|
687
689
|
}
|
|
688
690
|
|
|
689
691
|
// Add query?
|
|
@@ -613,6 +613,22 @@ function WebsiteConversation(service, crisp) {
|
|
|
613
613
|
);
|
|
614
614
|
};
|
|
615
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Request User Feedback For Conversation
|
|
618
|
+
* @memberof WebsiteConversation
|
|
619
|
+
* @method requestUserFeedbackForConversation
|
|
620
|
+
* @return Promise
|
|
621
|
+
*/
|
|
622
|
+
service.requestUserFeedbackForConversation = function(
|
|
623
|
+
websiteID, sessionID
|
|
624
|
+
) {
|
|
625
|
+
return crisp.post(
|
|
626
|
+
crisp._prepareRestUrl([
|
|
627
|
+
"website", websiteID, "conversation", sessionID, "feedback"
|
|
628
|
+
])
|
|
629
|
+
);
|
|
630
|
+
};
|
|
631
|
+
|
|
616
632
|
/**
|
|
617
633
|
* List Browsing Sessions For Conversation
|
|
618
634
|
* @memberof WebsiteConversation
|
package/package.json
CHANGED