lago-javascript-client 1.28.1 → 1.31.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.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.28.1
155
+ * @version 1.31.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -231,6 +231,41 @@ class Api extends HttpClient {
231
231
  ...params,
232
232
  }),
233
233
  };
234
+ activityLogs = {
235
+ /**
236
+ * @description This endpoint retrieves all existing activity logs that represent actions performed on application resources.
237
+ *
238
+ * @tags activity_logs
239
+ * @name FindAllActivityLogs
240
+ * @summary List all activity logs
241
+ * @request GET:/activity_logs
242
+ * @secure
243
+ */
244
+ findAllActivityLogs: (query, params = {}) => this.request({
245
+ path: `/activity_logs`,
246
+ method: "GET",
247
+ query: query,
248
+ secure: true,
249
+ format: "json",
250
+ ...params,
251
+ }),
252
+ /**
253
+ * @description This endpoint retrieves an existing activity log that represents an action performed on some resource. The activity log is identified by its unique activity_id.
254
+ *
255
+ * @tags activity_logs
256
+ * @name FindActivityLog
257
+ * @summary Retrieve an activity log
258
+ * @request GET:/activity_logs/{activity_id}
259
+ * @secure
260
+ */
261
+ findActivityLog: (activityId, params = {}) => this.request({
262
+ path: `/activity_logs/${activityId}`,
263
+ method: "GET",
264
+ secure: true,
265
+ format: "json",
266
+ ...params,
267
+ }),
268
+ };
234
269
  addOns = {
235
270
  /**
236
271
  * @description This endpoint is used to create an add-on that can be then attached to a one-off invoice.
@@ -318,6 +353,41 @@ class Api extends HttpClient {
318
353
  ...params,
319
354
  }),
320
355
  };
356
+ apiLogs = {
357
+ /**
358
+ * @description This endpoint retrieves all existing api logs that represent requests performed to Lago's API.
359
+ *
360
+ * @tags api_logs
361
+ * @name FindAllApiLogs
362
+ * @summary List all api logs
363
+ * @request GET:/api_logs
364
+ * @secure
365
+ */
366
+ findAllApiLogs: (query, params = {}) => this.request({
367
+ path: `/api_logs`,
368
+ method: "GET",
369
+ query: query,
370
+ secure: true,
371
+ format: "json",
372
+ ...params,
373
+ }),
374
+ /**
375
+ * @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.
376
+ *
377
+ * @tags api_logs
378
+ * @name FindApiLog
379
+ * @summary Retrieve an api log
380
+ * @request GET:/api_logs/{request_id}
381
+ * @secure
382
+ */
383
+ findApiLog: (requestId, params = {}) => this.request({
384
+ path: `/api_logs/${requestId}`,
385
+ method: "GET",
386
+ secure: true,
387
+ format: "json",
388
+ ...params,
389
+ }),
390
+ };
321
391
  analytics = {
322
392
  /**
323
393
  * @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.
@@ -1263,7 +1333,7 @@ class Api extends HttpClient {
1263
1333
  ...params,
1264
1334
  }),
1265
1335
  /**
1266
- * @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`.
1336
+ * @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.
1267
1337
  *
1268
1338
  * @tags invoices
1269
1339
  * @name VoidInvoice
@@ -1271,10 +1341,12 @@ class Api extends HttpClient {
1271
1341
  * @request POST:/invoices/{lago_id}/void
1272
1342
  * @secure
1273
1343
  */
1274
- voidInvoice: (lagoId, params = {}) => this.request({
1344
+ voidInvoice: (lagoId, data, params = {}) => this.request({
1275
1345
  path: `/invoices/${lagoId}/void`,
1276
1346
  method: "POST",
1347
+ body: data,
1277
1348
  secure: true,
1349
+ type: ContentType.Json,
1278
1350
  format: "json",
1279
1351
  ...params,
1280
1352
  }),
@@ -1556,9 +1628,10 @@ class Api extends HttpClient {
1556
1628
  * @request GET:/subscriptions/{external_id}
1557
1629
  * @secure
1558
1630
  */
1559
- findSubscription: (externalId, params = {}) => this.request({
1631
+ findSubscription: (externalId, query, params = {}) => this.request({
1560
1632
  path: `/subscriptions/${externalId}`,
1561
1633
  method: "GET",
1634
+ query: query,
1562
1635
  secure: true,
1563
1636
  format: "json",
1564
1637
  ...params,
@@ -1603,7 +1676,7 @@ class Api extends HttpClient {
1603
1676
  *
1604
1677
  * @tags subscriptions
1605
1678
  * @name GetSubscriptionLifetimeUsage
1606
- * @summary Retrive subscription lifetime usage
1679
+ * @summary Retrieve subscription lifetime usage
1607
1680
  * @request GET:/subscriptions/{external_id}/lifetime_usage
1608
1681
  * @secure
1609
1682
  */
@@ -1632,6 +1705,90 @@ class Api extends HttpClient {
1632
1705
  format: "json",
1633
1706
  ...params,
1634
1707
  }),
1708
+ /**
1709
+ * @description This endpoint enables the retrieval of all alerts for a subscription.
1710
+ *
1711
+ * @tags subscriptions
1712
+ * @name GetSubscriptionAlerts
1713
+ * @summary List subscription alerts
1714
+ * @request GET:/subscriptions/{external_id}/alerts
1715
+ * @secure
1716
+ */
1717
+ getSubscriptionAlerts: (externalId, params = {}) => this.request({
1718
+ path: `/subscriptions/${externalId}/alerts`,
1719
+ method: "GET",
1720
+ secure: true,
1721
+ format: "json",
1722
+ ...params,
1723
+ }),
1724
+ /**
1725
+ * @description This endpoint allows you to create a new alert for a subscription.
1726
+ *
1727
+ * @tags subscriptions
1728
+ * @name CreateSubscriptionAlert
1729
+ * @summary Create a subscription alert
1730
+ * @request POST:/subscriptions/{external_id}/alerts
1731
+ * @secure
1732
+ */
1733
+ createSubscriptionAlert: (externalId, data, params = {}) => this.request({
1734
+ path: `/subscriptions/${externalId}/alerts`,
1735
+ method: "POST",
1736
+ body: data,
1737
+ secure: true,
1738
+ type: ContentType.Json,
1739
+ format: "json",
1740
+ ...params,
1741
+ }),
1742
+ /**
1743
+ * @description This endpoint enables the retrieval of a specific alert for a subscription.
1744
+ *
1745
+ * @tags subscriptions
1746
+ * @name GetSubscriptionAlert
1747
+ * @summary Retrieve a subscription alert
1748
+ * @request GET:/subscriptions/{external_id}/alerts/{code}
1749
+ * @secure
1750
+ */
1751
+ getSubscriptionAlert: (externalId, code, params = {}) => this.request({
1752
+ path: `/subscriptions/${externalId}/alerts/${code}`,
1753
+ method: "GET",
1754
+ secure: true,
1755
+ format: "json",
1756
+ ...params,
1757
+ }),
1758
+ /**
1759
+ * @description This endpoint allows you to update an existing alert for a subscription.
1760
+ *
1761
+ * @tags subscriptions
1762
+ * @name UpdateSubscriptionAlert
1763
+ * @summary Update a subscription alert
1764
+ * @request PUT:/subscriptions/{external_id}/alerts/{code}
1765
+ * @secure
1766
+ */
1767
+ updateSubscriptionAlert: (externalId, code, data, params = {}) => this.request({
1768
+ path: `/subscriptions/${externalId}/alerts/${code}`,
1769
+ method: "PUT",
1770
+ body: data,
1771
+ secure: true,
1772
+ type: ContentType.Json,
1773
+ format: "json",
1774
+ ...params,
1775
+ }),
1776
+ /**
1777
+ * @description This endpoint allows you to delete an existing alert for a subscription.
1778
+ *
1779
+ * @tags subscriptions
1780
+ * @name DeleteSubscriptionAlert
1781
+ * @summary Delete a subscription alert
1782
+ * @request DELETE:/subscriptions/{external_id}/alerts/{code}
1783
+ * @secure
1784
+ */
1785
+ deleteSubscriptionAlert: (externalId, code, params = {}) => this.request({
1786
+ path: `/subscriptions/${externalId}/alerts/${code}`,
1787
+ method: "DELETE",
1788
+ secure: true,
1789
+ format: "json",
1790
+ ...params,
1791
+ }),
1635
1792
  };
1636
1793
  taxes = {
1637
1794
  /**