crisp-api 8.2.2 → 8.3.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 +13 -1
- package/EXAMPLES.md +1 -0
- package/README.md +20 -0
- package/lib/resources/PluginSubscription.js +20 -0
- package/lib/resources/WebsiteHelpdesk.js +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## v8.3.0
|
|
5
|
+
|
|
6
|
+
### New Features
|
|
7
|
+
|
|
8
|
+
* Added the new `CrispClient.plugin.reportPluginUsageToBill` method.
|
|
9
|
+
|
|
10
|
+
## v8.2.3
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* Use a `github:` prefix on dependency `fbemitter` to fix Yarn 3 (closes [#59](https://github.com/crisp-im/node-crisp-api/issues/59)).
|
|
15
|
+
|
|
4
16
|
## v8.2.2
|
|
5
17
|
|
|
6
18
|
### Changes
|
|
7
19
|
|
|
8
|
-
* Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)
|
|
20
|
+
* Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)`.
|
|
9
21
|
|
|
10
22
|
## v8.2.1
|
|
11
23
|
|
package/EXAMPLES.md
CHANGED
package/README.md
CHANGED
|
@@ -2288,6 +2288,7 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
2288
2288
|
"chatbox": {
|
|
2289
2289
|
"tile": "default",
|
|
2290
2290
|
"wait_game": false,
|
|
2291
|
+
"website_logo": true,
|
|
2291
2292
|
"last_operator_face": false,
|
|
2292
2293
|
"ongoing_operator_face": true,
|
|
2293
2294
|
"activity_metrics": true,
|
|
@@ -3205,6 +3206,25 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
|
|
|
3205
3206
|
```
|
|
3206
3207
|
</details>
|
|
3207
3208
|
|
|
3209
|
+
* **Report Plugin Usage To Bill** [`plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#report-plugin-usage-to-bill)
|
|
3210
|
+
* `CrispClient.plugin.reportPluginUsageToBill(websiteID, pluginID, usage)`
|
|
3211
|
+
* <details>
|
|
3212
|
+
<summary>See Example</summary>
|
|
3213
|
+
|
|
3214
|
+
```javascript
|
|
3215
|
+
var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
|
|
3216
|
+
var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
|
|
3217
|
+
|
|
3218
|
+
var usage = {
|
|
3219
|
+
"name": "Paid messages sent",
|
|
3220
|
+
"units": 250,
|
|
3221
|
+
"price": 0.10
|
|
3222
|
+
};
|
|
3223
|
+
|
|
3224
|
+
CrispClient.plugin.reportPluginUsageToBill(websiteID, pluginID, usage);
|
|
3225
|
+
```
|
|
3226
|
+
</details>
|
|
3227
|
+
|
|
3208
3228
|
* **Forward Plugin Payload To Channel** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#forward-plugin-payload-to-channel)
|
|
3209
3229
|
* `CrispClient.plugin.forwardPluginPayloadToChannel(websiteID, pluginID, payload)`
|
|
3210
3230
|
* <details>
|
|
@@ -150,6 +150,26 @@ function PluginSubscription(service, crisp) {
|
|
|
150
150
|
);
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Report Plugin Usage To Bill
|
|
155
|
+
* @memberof PluginSubscription
|
|
156
|
+
* @public
|
|
157
|
+
* @method reportPluginUsageToBill
|
|
158
|
+
* @param {string} websiteID
|
|
159
|
+
* @param {string} pluginID
|
|
160
|
+
* @param {object} usage
|
|
161
|
+
* @return {Promise}
|
|
162
|
+
*/
|
|
163
|
+
service.reportPluginUsageToBill = function(websiteID, pluginID, usage) {
|
|
164
|
+
return crisp.post(
|
|
165
|
+
crisp._prepareRestUrl([
|
|
166
|
+
"plugins", "subscription", websiteID, pluginID, "bill", "usage"
|
|
167
|
+
]),
|
|
168
|
+
|
|
169
|
+
null, usage
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
153
173
|
/**
|
|
154
174
|
* Forward Plugin Payload To Channel
|
|
155
175
|
* @memberof PluginSubscription
|
|
@@ -184,7 +184,8 @@ function WebsiteHelpdesk(service, crisp) {
|
|
|
184
184
|
* @return {Promise}
|
|
185
185
|
*/
|
|
186
186
|
service.listHelpdeskLocaleArticles = function(
|
|
187
|
-
websiteID, locale, pageNumber, options
|
|
187
|
+
websiteID, locale, pageNumber, options={}
|
|
188
|
+
) {
|
|
188
189
|
return crisp.get(
|
|
189
190
|
crisp._prepareRestUrl([
|
|
190
191
|
"website", websiteID, "helpdesk", "locale", locale, "articles",
|
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": "8.
|
|
4
|
+
"version": "8.3.0",
|
|
5
5
|
"homepage": "https://github.com/crisp-im/node-crisp-api",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"socket.io-client": "4.7.2",
|
|
52
|
-
"fbemitter": "
|
|
52
|
+
"fbemitter": "github:crisp-dev/emitter#695f60594bdca0c876e5c232de57702ab3151b6f",
|
|
53
53
|
"got": "11.8.5"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|