crisp-api 10.10.1 → 10.10.2
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 +6 -0
- package/EXAMPLES.md +11 -0
- package/README.md +15 -0
- package/dist/crisp.js +1 -1
- package/dist/resources/WebsiteConversation.d.ts +4 -0
- package/dist/resources/WebsiteConversation.js +17 -0
- package/lib/resources/WebsiteConversation.ts +25 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/EXAMPLES.md
CHANGED
|
@@ -602,6 +602,17 @@ CrispClient.website.transmitSignalingOnOngoingCallSession(websiteID, sessionID,
|
|
|
602
602
|
|
|
603
603
|
=========================
|
|
604
604
|
|
|
605
|
+
https://docs.crisp.chat/references/rest-api/v1/#request-tool-call-for-conversation
|
|
606
|
+
|
|
607
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
608
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
609
|
+
|
|
610
|
+
var command = "list_tools";
|
|
611
|
+
|
|
612
|
+
CrispClient.website.requestToolCallForConversation(websiteID, sessionID, command);
|
|
613
|
+
|
|
614
|
+
=========================
|
|
615
|
+
|
|
605
616
|
https://docs.crisp.chat/references/rest-api/v1/#deliver-widget-button-action-for-conversation
|
|
606
617
|
|
|
607
618
|
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
package/README.md
CHANGED
|
@@ -1003,6 +1003,21 @@ All methods that you will most likely need when building a Crisp integration are
|
|
|
1003
1003
|
```
|
|
1004
1004
|
</details>
|
|
1005
1005
|
|
|
1006
|
+
* **Request Tool Call For Conversation**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#request-tool-call-for-conversation)
|
|
1007
|
+
* `CrispClient.website.requestToolCallForConversation(websiteID, sessionID, command, payload)`
|
|
1008
|
+
* <details>
|
|
1009
|
+
<summary>See Example</summary>
|
|
1010
|
+
|
|
1011
|
+
```javascript
|
|
1012
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
1013
|
+
var sessionID = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881";
|
|
1014
|
+
|
|
1015
|
+
var command = "list_tools";
|
|
1016
|
+
|
|
1017
|
+
CrispClient.website.requestToolCallForConversation(websiteID, sessionID, command);
|
|
1018
|
+
```
|
|
1019
|
+
</details>
|
|
1020
|
+
|
|
1006
1021
|
* **Deliver Widget Button Action For Conversation**: [Reference](https://docs.crisp.chat/references/rest-api/v1/#deliver-widget-button-action-for-conversation)
|
|
1007
1022
|
* `CrispClient.website.deliverWidgetButtonActionForConversation(websiteID, sessionID, pluginID, sectionID, itemID, data, value)`
|
|
1008
1023
|
* <details>
|
package/dist/crisp.js
CHANGED
|
@@ -668,6 +668,10 @@ declare class WebsiteConversation extends BaseResource {
|
|
|
668
668
|
* Transmit Signaling On Ongoing Call Session
|
|
669
669
|
*/
|
|
670
670
|
transmitSignalingOnOngoingCallSession(websiteID: string, sessionID: string, callID: string, payload: object): Promise<any>;
|
|
671
|
+
/**
|
|
672
|
+
* Request Tool Call For Conversation
|
|
673
|
+
*/
|
|
674
|
+
requestToolCallForConversation(websiteID: string, sessionID: string, command: string, payload?: object): Promise<any>;
|
|
671
675
|
/**
|
|
672
676
|
* Deliver Widget Button Action For Conversation
|
|
673
677
|
*/
|
|
@@ -569,6 +569,23 @@ class WebsiteConversation extends BaseResource_1.default {
|
|
|
569
569
|
]), null, payload);
|
|
570
570
|
}
|
|
571
571
|
;
|
|
572
|
+
/**
|
|
573
|
+
* Request Tool Call For Conversation
|
|
574
|
+
*/
|
|
575
|
+
requestToolCallForConversation(websiteID, sessionID, command, payload) {
|
|
576
|
+
// Generate body
|
|
577
|
+
let body = {
|
|
578
|
+
command: command
|
|
579
|
+
};
|
|
580
|
+
if (payload) {
|
|
581
|
+
// @ts-ignore
|
|
582
|
+
body.payload = payload;
|
|
583
|
+
}
|
|
584
|
+
return this.crisp.post(this.crisp.prepareRestUrl([
|
|
585
|
+
"website", websiteID, "conversation", sessionID, "tool"
|
|
586
|
+
]), null, body);
|
|
587
|
+
}
|
|
588
|
+
;
|
|
572
589
|
/**
|
|
573
590
|
* Deliver Widget Button Action For Conversation
|
|
574
591
|
*/
|
|
@@ -1429,6 +1429,31 @@ class WebsiteConversation extends BaseResource {
|
|
|
1429
1429
|
);
|
|
1430
1430
|
};
|
|
1431
1431
|
|
|
1432
|
+
/**
|
|
1433
|
+
* Request Tool Call For Conversation
|
|
1434
|
+
*/
|
|
1435
|
+
requestToolCallForConversation(
|
|
1436
|
+
websiteID: string, sessionID: string, command: string, payload?: object
|
|
1437
|
+
) {
|
|
1438
|
+
// Generate body
|
|
1439
|
+
let body = {
|
|
1440
|
+
command: command
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
if (payload) {
|
|
1444
|
+
// @ts-ignore
|
|
1445
|
+
body.payload = payload;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
return this.crisp.post(
|
|
1449
|
+
this.crisp.prepareRestUrl([
|
|
1450
|
+
"website", websiteID, "conversation", sessionID, "tool"
|
|
1451
|
+
]),
|
|
1452
|
+
|
|
1453
|
+
null, body
|
|
1454
|
+
);
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1432
1457
|
/**
|
|
1433
1458
|
* Deliver Widget Button Action For Conversation
|
|
1434
1459
|
*/
|
package/package.json
CHANGED