crisp-api 8.2.3 → 8.3.1

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,29 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## v8.3.1
5
+
6
+ ### New Features
7
+
8
+ * Added the new `CrispClient.plugin.getPluginUsageBills` method.
9
+
10
+ ## v8.3.0
11
+
12
+ ### New Features
13
+
14
+ * Added the new `CrispClient.plugin.reportPluginUsageToBill` method.
15
+
4
16
  ## v8.2.3
5
17
 
6
- ### Changes
18
+ ### Bug Fixes
7
19
 
8
- * Use a `github:` prefix for dependency `fbemitter` to fix issue 59 related to Yarn 3
20
+ * Use a `github:` prefix on dependency `fbemitter` to fix Yarn 3 (closes [#59](https://github.com/crisp-im/node-crisp-api/issues/59)).
9
21
 
10
22
  ## v8.2.2
11
23
 
12
24
  ### Changes
13
25
 
14
- * Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)`
26
+ * Added an options parameter on `CrispClient.website.listHelpdeskLocales(websiteID, pageNumber, options)`.
15
27
 
16
28
  ## v8.2.1
17
29
 
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,38 @@ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
3205
3206
  ```
3206
3207
  </details>
3207
3208
 
3209
+ * **Get Plugin Usage Bills** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-plugin-usage-bills)
3210
+ * `CrispClient.plugin.getPluginUsageBills(websiteID, pluginID)`
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
+ CrispClient.plugin.getPluginUsageBills(websiteID, pluginID);
3219
+ ```
3220
+ </details>
3221
+
3222
+ * **Report Plugin Usage To Bill** [`plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#report-plugin-usage-to-bill)
3223
+ * `CrispClient.plugin.reportPluginUsageToBill(websiteID, pluginID, usage)`
3224
+ * <details>
3225
+ <summary>See Example</summary>
3226
+
3227
+ ```javascript
3228
+ var websiteID = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc";
3229
+ var pluginID = "c64f3595-adee-425a-8d3a-89d47f7ed6bb";
3230
+
3231
+ var usage = {
3232
+ "name": "Paid messages sent",
3233
+ "units": 250,
3234
+ "price": 0.10
3235
+ };
3236
+
3237
+ CrispClient.plugin.reportPluginUsageToBill(websiteID, pluginID, usage);
3238
+ ```
3239
+ </details>
3240
+
3208
3241
  * **Forward Plugin Payload To Channel** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#forward-plugin-payload-to-channel)
3209
3242
  * `CrispClient.plugin.forwardPluginPayloadToChannel(websiteID, pluginID, payload)`
3210
3243
  * <details>
@@ -150,6 +150,43 @@ function PluginSubscription(service, crisp) {
150
150
  );
151
151
  };
152
152
 
153
+ /**
154
+ * Get Plugin Usage Bills
155
+ * @memberof PluginSubscription
156
+ * @public
157
+ * @method getPluginUsageBills
158
+ * @param {string} websiteID
159
+ * @param {string} pluginID
160
+ * @return {Promise}
161
+ */
162
+ service.getPluginUsageBills = function(websiteID, pluginID) {
163
+ return crisp.get(
164
+ crisp._prepareRestUrl([
165
+ "plugins", "subscription", websiteID, pluginID, "bill", "usage"
166
+ ])
167
+ );
168
+ };
169
+
170
+ /**
171
+ * Report Plugin Usage To Bill
172
+ * @memberof PluginSubscription
173
+ * @public
174
+ * @method reportPluginUsageToBill
175
+ * @param {string} websiteID
176
+ * @param {string} pluginID
177
+ * @param {object} usage
178
+ * @return {Promise}
179
+ */
180
+ service.reportPluginUsageToBill = function(websiteID, pluginID, usage) {
181
+ return crisp.post(
182
+ crisp._prepareRestUrl([
183
+ "plugins", "subscription", websiteID, pluginID, "bill", "usage"
184
+ ]),
185
+
186
+ null, usage
187
+ );
188
+ };
189
+
153
190
  /**
154
191
  * Forward Plugin Payload To Channel
155
192
  * @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.1",
5
5
  "homepage": "https://github.com/crisp-im/node-crisp-api",
6
6
  "license": "MIT",
7
7
  "author": {