lago-javascript-client 1.30.0 → 1.32.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.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.28.1
151
+ * @version 1.31.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -349,6 +349,41 @@ export class Api extends HttpClient {
349
349
  ...params,
350
350
  }),
351
351
  };
352
+ apiLogs = {
353
+ /**
354
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
355
+ *
356
+ * @tags api_logs
357
+ * @name FindAllApiLogs
358
+ * @summary List all api logs
359
+ * @request GET:/api_logs
360
+ * @secure
361
+ */
362
+ findAllApiLogs: (query, params = {}) => this.request({
363
+ path: `/api_logs`,
364
+ method: "GET",
365
+ query: query,
366
+ secure: true,
367
+ format: "json",
368
+ ...params,
369
+ }),
370
+ /**
371
+ * @description This endpoint retrieves an existing api log that represents a request made to the API. The api log is identified by its unique request_id.
372
+ *
373
+ * @tags api_logs
374
+ * @name FindApiLog
375
+ * @summary Retrieve an api log
376
+ * @request GET:/api_logs/{request_id}
377
+ * @secure
378
+ */
379
+ findApiLog: (requestId, params = {}) => this.request({
380
+ path: `/api_logs/${requestId}`,
381
+ method: "GET",
382
+ secure: true,
383
+ format: "json",
384
+ ...params,
385
+ }),
386
+ };
352
387
  analytics = {
353
388
  /**
354
389
  * @description Gross revenue is the sum of monthly `finalized` invoice payments and fees paid in advance that are not invoiceable. This total is calculated after deducting taxes and discounts.
@@ -988,6 +1023,7 @@ export class Api extends HttpClient {
988
1023
  body: data,
989
1024
  secure: true,
990
1025
  type: ContentType.Json,
1026
+ format: "json",
991
1027
  ...params,
992
1028
  }),
993
1029
  /**
@@ -1008,6 +1044,42 @@ export class Api extends HttpClient {
1008
1044
  format: "json",
1009
1045
  ...params,
1010
1046
  }),
1047
+ /**
1048
+ * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance standard or percentage charges
1049
+ *
1050
+ * @tags events
1051
+ * @name EventEstimateInstantFees
1052
+ * @summary Estimate instant fees for a pay in advance charge
1053
+ * @request POST:/events/estimate_instant_fees
1054
+ * @secure
1055
+ */
1056
+ eventEstimateInstantFees: (data, params = {}) => this.request({
1057
+ path: `/events/estimate_instant_fees`,
1058
+ method: "POST",
1059
+ body: data,
1060
+ secure: true,
1061
+ type: ContentType.Json,
1062
+ format: "json",
1063
+ ...params,
1064
+ }),
1065
+ /**
1066
+ * @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple pay in advance standard or percentage charges
1067
+ *
1068
+ * @tags events
1069
+ * @name EventBatchEstimateInstantFees
1070
+ * @summary Batch estimate instant fees for a pay in advance charge
1071
+ * @request POST:/events/batch_estimate_instant_fees
1072
+ * @secure
1073
+ */
1074
+ eventBatchEstimateInstantFees: (data, params = {}) => this.request({
1075
+ path: `/events/batch_estimate_instant_fees`,
1076
+ method: "POST",
1077
+ body: data,
1078
+ secure: true,
1079
+ type: ContentType.Json,
1080
+ format: "json",
1081
+ ...params,
1082
+ }),
1011
1083
  /**
1012
1084
  * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
1013
1085
  *
@@ -1294,7 +1366,7 @@ export class Api extends HttpClient {
1294
1366
  ...params,
1295
1367
  }),
1296
1368
  /**
1297
- * @description This endpoint is used for voiding an invoice. You can void an invoice only when it's in a `finalized` status, and the payment status is not `succeeded`.
1369
+ * @description This endpoint is used for voiding an invoice. • When no body parameters are provided, the invoice can be voided only if it is in a `finalized` status and its payment status is NOT `succeeded`. • When `generate_credit_note` is provided (optionally with `refund_amount` and/or `credit_amount`), this validation is bypassed: the invoice is forcibly voided and a credit note is generated. If the specified refund/credit amounts do not cover the full invoice total, the remainder is issued on a second credit note that is created and immediately voided.
1298
1370
  *
1299
1371
  * @tags invoices
1300
1372
  * @name VoidInvoice
@@ -1302,10 +1374,12 @@ export class Api extends HttpClient {
1302
1374
  * @request POST:/invoices/{lago_id}/void
1303
1375
  * @secure
1304
1376
  */
1305
- voidInvoice: (lagoId, params = {}) => this.request({
1377
+ voidInvoice: (lagoId, data, params = {}) => this.request({
1306
1378
  path: `/invoices/${lagoId}/void`,
1307
1379
  method: "POST",
1380
+ body: data,
1308
1381
  secure: true,
1382
+ type: ContentType.Json,
1309
1383
  format: "json",
1310
1384
  ...params,
1311
1385
  }),
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "name": "lago-javascript-client",
5
5
  "sideEffects": false,
6
- "version": "v1.30.0",
6
+ "version": "v1.32.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",