lago-javascript-client 0.39.1-beta → 0.43.0-beta

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.
@@ -648,7 +648,7 @@ export class HttpClient {
648
648
  ...(requestParams.headers || {}),
649
649
  ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
650
650
  },
651
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
651
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
652
652
  body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
653
653
  }).then(async (response) => {
654
654
  const r = response;
@@ -681,7 +681,7 @@ export class HttpClient {
681
681
  }
682
682
  /**
683
683
  * @title Lago API documentation
684
- * @version 0.39.0-beta
684
+ * @version 0.41.0-beta
685
685
  * @license AGPLv3
686
686
  * @baseUrl https://api.getlago.com/api/v1
687
687
  * @externalDocs https://github.com/getlago
@@ -1213,40 +1213,6 @@ export class Api extends HttpClient {
1213
1213
  format: "json",
1214
1214
  ...params,
1215
1215
  }),
1216
- /**
1217
- * @description Apply an existing tax to a customer
1218
- *
1219
- * @tags customers
1220
- * @name ApplyTax
1221
- * @summary Apply a tax
1222
- * @request POST:/customers/{external_customer_id}/applied_taxes
1223
- * @secure
1224
- */
1225
- applyTax: (externalCustomerId, data, params = {}) => this.request({
1226
- path: `/customers/${externalCustomerId}/applied_taxes`,
1227
- method: "POST",
1228
- body: data,
1229
- secure: true,
1230
- type: ContentType.Json,
1231
- format: "json",
1232
- ...params,
1233
- }),
1234
- /**
1235
- * @description Delete customer's appplied tax
1236
- *
1237
- * @tags customers
1238
- * @name DeleteAppliedTax
1239
- * @summary Delete customer's appplied tax
1240
- * @request DELETE:/customers/{external_customer_id}/applied_taxes/{tax_code}
1241
- * @secure
1242
- */
1243
- deleteAppliedTax: (externalCustomerId, taxCode, params = {}) => this.request({
1244
- path: `/customers/${externalCustomerId}/applied_taxes/${taxCode}`,
1245
- method: "DELETE",
1246
- secure: true,
1247
- format: "json",
1248
- ...params,
1249
- }),
1250
1216
  /**
1251
1217
  * @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
1252
1218
  *
@@ -1708,9 +1674,10 @@ export class Api extends HttpClient {
1708
1674
  * @request DELETE:/subscriptions/{external_id}
1709
1675
  * @secure
1710
1676
  */
1711
- destroySubscription: (externalId, params = {}) => this.request({
1677
+ destroySubscription: (externalId, query, params = {}) => this.request({
1712
1678
  path: `/subscriptions/${externalId}`,
1713
1679
  method: "DELETE",
1680
+ query: query,
1714
1681
  secure: true,
1715
1682
  format: "json",
1716
1683
  ...params,
@@ -1718,7 +1685,7 @@ export class Api extends HttpClient {
1718
1685
  };
1719
1686
  taxes = {
1720
1687
  /**
1721
- * @description Create a tax
1688
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
1722
1689
  *
1723
1690
  * @tags taxes
1724
1691
  * @name CreateTax
@@ -1736,11 +1703,11 @@ export class Api extends HttpClient {
1736
1703
  ...params,
1737
1704
  }),
1738
1705
  /**
1739
- * @description Find all taxes in certain organization
1706
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
1740
1707
  *
1741
1708
  * @tags taxes
1742
1709
  * @name FindAllTaxes
1743
- * @summary Find taxes
1710
+ * @summary List all taxes
1744
1711
  * @request GET:/taxes
1745
1712
  * @secure
1746
1713
  */
@@ -1753,11 +1720,11 @@ export class Api extends HttpClient {
1753
1720
  ...params,
1754
1721
  }),
1755
1722
  /**
1756
- * @description Update an existing tax by code
1723
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
1757
1724
  *
1758
1725
  * @tags taxes
1759
1726
  * @name UpdateTax
1760
- * @summary Update an existing tax
1727
+ * @summary Update a tax
1761
1728
  * @request PUT:/taxes/{code}
1762
1729
  * @secure
1763
1730
  */
@@ -1771,11 +1738,11 @@ export class Api extends HttpClient {
1771
1738
  ...params,
1772
1739
  }),
1773
1740
  /**
1774
- * @description Return a single tax
1741
+ * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
1775
1742
  *
1776
1743
  * @tags taxes
1777
1744
  * @name FindTax
1778
- * @summary Find tax by code
1745
+ * @summary Retrieve a Tax
1779
1746
  * @request GET:/taxes/{code}
1780
1747
  * @secure
1781
1748
  */
@@ -1787,7 +1754,7 @@ export class Api extends HttpClient {
1787
1754
  ...params,
1788
1755
  }),
1789
1756
  /**
1790
- * @description Delete a tax
1757
+ * @description This endpoint is used to delete a tax.
1791
1758
  *
1792
1759
  * @tags taxes
1793
1760
  * @name DestroyTax
@@ -1944,4 +1911,91 @@ export class Api extends HttpClient {
1944
1911
  ...params,
1945
1912
  }),
1946
1913
  };
1914
+ webhookEndpoints = {
1915
+ /**
1916
+ * @description This endpoint is used to create a webhook endpoint.
1917
+ *
1918
+ * @tags webhook_endpoints
1919
+ * @name CreateWebhookEndpoint
1920
+ * @summary Create a webhook_endpoint
1921
+ * @request POST:/webhook_endpoints
1922
+ * @secure
1923
+ */
1924
+ createWebhookEndpoint: (data, params = {}) => this.request({
1925
+ path: `/webhook_endpoints`,
1926
+ method: "POST",
1927
+ body: data,
1928
+ secure: true,
1929
+ type: ContentType.Json,
1930
+ format: "json",
1931
+ ...params,
1932
+ }),
1933
+ /**
1934
+ * @description This endpoint is used to list all webhook endpoints.
1935
+ *
1936
+ * @tags webhook_endpoints
1937
+ * @name FindAllWebhookEndpoints
1938
+ * @summary List all webhook endpoints
1939
+ * @request GET:/webhook_endpoints
1940
+ * @secure
1941
+ */
1942
+ findAllWebhookEndpoints: (query, params = {}) => this.request({
1943
+ path: `/webhook_endpoints`,
1944
+ method: "GET",
1945
+ query: query,
1946
+ secure: true,
1947
+ format: "json",
1948
+ ...params,
1949
+ }),
1950
+ /**
1951
+ * @description This endpoint is used to update an existing webhook endpoint.
1952
+ *
1953
+ * @tags webhook_endpoints
1954
+ * @name UpdateWebhookEndpoint
1955
+ * @summary Update a webhook endpoint
1956
+ * @request PUT:/webhook_endpoints/{lago_id}
1957
+ * @secure
1958
+ */
1959
+ updateWebhookEndpoint: (lagoId, data, params = {}) => this.request({
1960
+ path: `/webhook_endpoints/${lagoId}`,
1961
+ method: "PUT",
1962
+ body: data,
1963
+ secure: true,
1964
+ type: ContentType.Json,
1965
+ format: "json",
1966
+ ...params,
1967
+ }),
1968
+ /**
1969
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
1970
+ *
1971
+ * @tags webhook_endpoints
1972
+ * @name FindWebhookEndpoint
1973
+ * @summary Retrieve a webhook endpoint
1974
+ * @request GET:/webhook_endpoints/{lago_id}
1975
+ * @secure
1976
+ */
1977
+ findWebhookEndpoint: (lagoId, params = {}) => this.request({
1978
+ path: `/webhook_endpoints/${lagoId}`,
1979
+ method: "GET",
1980
+ secure: true,
1981
+ format: "json",
1982
+ ...params,
1983
+ }),
1984
+ /**
1985
+ * @description This endpoint is used to delete an existing webhook endpoint.
1986
+ *
1987
+ * @tags webhook_endpoints
1988
+ * @name DestroyWebhookEndpoint
1989
+ * @summary Delete a webhook endpoint
1990
+ * @request DELETE:/webhook_endpoints/{lago_id}
1991
+ * @secure
1992
+ */
1993
+ destroyWebhookEndpoint: (lagoId, params = {}) => this.request({
1994
+ path: `/webhook_endpoints/${lagoId}`,
1995
+ method: "DELETE",
1996
+ secure: true,
1997
+ format: "json",
1998
+ ...params,
1999
+ }),
2000
+ };
1947
2001
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "types": "./types/mod.d.ts",
5
5
  "name": "lago-javascript-client",
6
6
  "sideEffects": false,
7
- "version": "v0.39.1-beta",
7
+ "version": "v0.43.0-beta",
8
8
  "description": "Lago JavaScript API Client",
9
9
  "repository": {
10
10
  "type": "git",
@@ -651,7 +651,7 @@ class HttpClient {
651
651
  ...(requestParams.headers || {}),
652
652
  ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
653
653
  },
654
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
654
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
655
655
  body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
656
656
  }).then(async (response) => {
657
657
  const r = response;
@@ -685,7 +685,7 @@ class HttpClient {
685
685
  exports.HttpClient = HttpClient;
686
686
  /**
687
687
  * @title Lago API documentation
688
- * @version 0.39.0-beta
688
+ * @version 0.41.0-beta
689
689
  * @license AGPLv3
690
690
  * @baseUrl https://api.getlago.com/api/v1
691
691
  * @externalDocs https://github.com/getlago
@@ -1217,40 +1217,6 @@ class Api extends HttpClient {
1217
1217
  format: "json",
1218
1218
  ...params,
1219
1219
  }),
1220
- /**
1221
- * @description Apply an existing tax to a customer
1222
- *
1223
- * @tags customers
1224
- * @name ApplyTax
1225
- * @summary Apply a tax
1226
- * @request POST:/customers/{external_customer_id}/applied_taxes
1227
- * @secure
1228
- */
1229
- applyTax: (externalCustomerId, data, params = {}) => this.request({
1230
- path: `/customers/${externalCustomerId}/applied_taxes`,
1231
- method: "POST",
1232
- body: data,
1233
- secure: true,
1234
- type: ContentType.Json,
1235
- format: "json",
1236
- ...params,
1237
- }),
1238
- /**
1239
- * @description Delete customer's appplied tax
1240
- *
1241
- * @tags customers
1242
- * @name DeleteAppliedTax
1243
- * @summary Delete customer's appplied tax
1244
- * @request DELETE:/customers/{external_customer_id}/applied_taxes/{tax_code}
1245
- * @secure
1246
- */
1247
- deleteAppliedTax: (externalCustomerId, taxCode, params = {}) => this.request({
1248
- path: `/customers/${externalCustomerId}/applied_taxes/${taxCode}`,
1249
- method: "DELETE",
1250
- secure: true,
1251
- format: "json",
1252
- ...params,
1253
- }),
1254
1220
  /**
1255
1221
  * @description Retrieves an embeddable link for displaying a customer portal. This endpoint allows you to fetch the URL that can be embedded to provide customers access to a dedicated portal
1256
1222
  *
@@ -1712,9 +1678,10 @@ class Api extends HttpClient {
1712
1678
  * @request DELETE:/subscriptions/{external_id}
1713
1679
  * @secure
1714
1680
  */
1715
- destroySubscription: (externalId, params = {}) => this.request({
1681
+ destroySubscription: (externalId, query, params = {}) => this.request({
1716
1682
  path: `/subscriptions/${externalId}`,
1717
1683
  method: "DELETE",
1684
+ query: query,
1718
1685
  secure: true,
1719
1686
  format: "json",
1720
1687
  ...params,
@@ -1722,7 +1689,7 @@ class Api extends HttpClient {
1722
1689
  };
1723
1690
  taxes = {
1724
1691
  /**
1725
- * @description Create a tax
1692
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
1726
1693
  *
1727
1694
  * @tags taxes
1728
1695
  * @name CreateTax
@@ -1740,11 +1707,11 @@ class Api extends HttpClient {
1740
1707
  ...params,
1741
1708
  }),
1742
1709
  /**
1743
- * @description Find all taxes in certain organization
1710
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
1744
1711
  *
1745
1712
  * @tags taxes
1746
1713
  * @name FindAllTaxes
1747
- * @summary Find taxes
1714
+ * @summary List all taxes
1748
1715
  * @request GET:/taxes
1749
1716
  * @secure
1750
1717
  */
@@ -1757,11 +1724,11 @@ class Api extends HttpClient {
1757
1724
  ...params,
1758
1725
  }),
1759
1726
  /**
1760
- * @description Update an existing tax by code
1727
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
1761
1728
  *
1762
1729
  * @tags taxes
1763
1730
  * @name UpdateTax
1764
- * @summary Update an existing tax
1731
+ * @summary Update a tax
1765
1732
  * @request PUT:/taxes/{code}
1766
1733
  * @secure
1767
1734
  */
@@ -1775,11 +1742,11 @@ class Api extends HttpClient {
1775
1742
  ...params,
1776
1743
  }),
1777
1744
  /**
1778
- * @description Return a single tax
1745
+ * @description This endpoint retrieves an existing tax representing a customizable tax rate applicable to either the organization or a specific customer. The tax is identified by its unique code.
1779
1746
  *
1780
1747
  * @tags taxes
1781
1748
  * @name FindTax
1782
- * @summary Find tax by code
1749
+ * @summary Retrieve a Tax
1783
1750
  * @request GET:/taxes/{code}
1784
1751
  * @secure
1785
1752
  */
@@ -1791,7 +1758,7 @@ class Api extends HttpClient {
1791
1758
  ...params,
1792
1759
  }),
1793
1760
  /**
1794
- * @description Delete a tax
1761
+ * @description This endpoint is used to delete a tax.
1795
1762
  *
1796
1763
  * @tags taxes
1797
1764
  * @name DestroyTax
@@ -1948,5 +1915,92 @@ class Api extends HttpClient {
1948
1915
  ...params,
1949
1916
  }),
1950
1917
  };
1918
+ webhookEndpoints = {
1919
+ /**
1920
+ * @description This endpoint is used to create a webhook endpoint.
1921
+ *
1922
+ * @tags webhook_endpoints
1923
+ * @name CreateWebhookEndpoint
1924
+ * @summary Create a webhook_endpoint
1925
+ * @request POST:/webhook_endpoints
1926
+ * @secure
1927
+ */
1928
+ createWebhookEndpoint: (data, params = {}) => this.request({
1929
+ path: `/webhook_endpoints`,
1930
+ method: "POST",
1931
+ body: data,
1932
+ secure: true,
1933
+ type: ContentType.Json,
1934
+ format: "json",
1935
+ ...params,
1936
+ }),
1937
+ /**
1938
+ * @description This endpoint is used to list all webhook endpoints.
1939
+ *
1940
+ * @tags webhook_endpoints
1941
+ * @name FindAllWebhookEndpoints
1942
+ * @summary List all webhook endpoints
1943
+ * @request GET:/webhook_endpoints
1944
+ * @secure
1945
+ */
1946
+ findAllWebhookEndpoints: (query, params = {}) => this.request({
1947
+ path: `/webhook_endpoints`,
1948
+ method: "GET",
1949
+ query: query,
1950
+ secure: true,
1951
+ format: "json",
1952
+ ...params,
1953
+ }),
1954
+ /**
1955
+ * @description This endpoint is used to update an existing webhook endpoint.
1956
+ *
1957
+ * @tags webhook_endpoints
1958
+ * @name UpdateWebhookEndpoint
1959
+ * @summary Update a webhook endpoint
1960
+ * @request PUT:/webhook_endpoints/{lago_id}
1961
+ * @secure
1962
+ */
1963
+ updateWebhookEndpoint: (lagoId, data, params = {}) => this.request({
1964
+ path: `/webhook_endpoints/${lagoId}`,
1965
+ method: "PUT",
1966
+ body: data,
1967
+ secure: true,
1968
+ type: ContentType.Json,
1969
+ format: "json",
1970
+ ...params,
1971
+ }),
1972
+ /**
1973
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
1974
+ *
1975
+ * @tags webhook_endpoints
1976
+ * @name FindWebhookEndpoint
1977
+ * @summary Retrieve a webhook endpoint
1978
+ * @request GET:/webhook_endpoints/{lago_id}
1979
+ * @secure
1980
+ */
1981
+ findWebhookEndpoint: (lagoId, params = {}) => this.request({
1982
+ path: `/webhook_endpoints/${lagoId}`,
1983
+ method: "GET",
1984
+ secure: true,
1985
+ format: "json",
1986
+ ...params,
1987
+ }),
1988
+ /**
1989
+ * @description This endpoint is used to delete an existing webhook endpoint.
1990
+ *
1991
+ * @tags webhook_endpoints
1992
+ * @name DestroyWebhookEndpoint
1993
+ * @summary Delete a webhook endpoint
1994
+ * @request DELETE:/webhook_endpoints/{lago_id}
1995
+ * @secure
1996
+ */
1997
+ destroyWebhookEndpoint: (lagoId, params = {}) => this.request({
1998
+ path: `/webhook_endpoints/${lagoId}`,
1999
+ method: "DELETE",
2000
+ secure: true,
2001
+ format: "json",
2002
+ ...params,
2003
+ }),
2004
+ };
1951
2005
  }
1952
2006
  exports.Api = Api;