crisp-api 8.2.3 → 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 CHANGED
@@ -1,17 +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
+
4
10
  ## v8.2.3
5
11
 
6
- ### Changes
12
+ ### Bug Fixes
7
13
 
8
- * Use a `github:` prefix for dependency `fbemitter` to fix issue 59 related to Yarn 3
14
+ * Use a `github:` prefix on dependency `fbemitter` to fix Yarn 3 (closes [#59](https://github.com/crisp-im/node-crisp-api/issues/59)).
9
15
 
10
16
  ## v8.2.2
11
17
 
12
18
  ### Changes
13
19
 
14
- * Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)`
20
+ * Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)`.
15
21
 
16
22
  ## v8.2.1
17
23
 
package/EXAMPLES.md CHANGED
@@ -1570,6 +1570,7 @@ var settings = {
1570
1570
  "chatbox": {
1571
1571
  "tile": "default",
1572
1572
  "wait_game": false,
1573
+ "website_logo": true,
1573
1574
  "last_operator_face": false,
1574
1575
  "ongoing_operator_face": true,
1575
1576
  "activity_metrics": true,
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.2.3",
4
+ "version": "8.3.0",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {