lago-javascript-client 0.39.0-beta → 0.41.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.
@@ -8,6 +8,259 @@
8
8
  * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
9
  * ---------------------------------------------------------------
10
10
  */
11
+ /** @example "US" */
12
+ export var Country;
13
+ (function (Country) {
14
+ Country["AD"] = "AD";
15
+ Country["AE"] = "AE";
16
+ Country["AF"] = "AF";
17
+ Country["AG"] = "AG";
18
+ Country["AI"] = "AI";
19
+ Country["AL"] = "AL";
20
+ Country["AM"] = "AM";
21
+ Country["AO"] = "AO";
22
+ Country["AQ"] = "AQ";
23
+ Country["AR"] = "AR";
24
+ Country["AS"] = "AS";
25
+ Country["AT"] = "AT";
26
+ Country["AU"] = "AU";
27
+ Country["AW"] = "AW";
28
+ Country["AX"] = "AX";
29
+ Country["AZ"] = "AZ";
30
+ Country["BA"] = "BA";
31
+ Country["BB"] = "BB";
32
+ Country["BD"] = "BD";
33
+ Country["BE"] = "BE";
34
+ Country["BF"] = "BF";
35
+ Country["BG"] = "BG";
36
+ Country["BH"] = "BH";
37
+ Country["BI"] = "BI";
38
+ Country["BJ"] = "BJ";
39
+ Country["BL"] = "BL";
40
+ Country["BM"] = "BM";
41
+ Country["BN"] = "BN";
42
+ Country["BO"] = "BO";
43
+ Country["BQ"] = "BQ";
44
+ Country["BR"] = "BR";
45
+ Country["BS"] = "BS";
46
+ Country["BT"] = "BT";
47
+ Country["BV"] = "BV";
48
+ Country["BW"] = "BW";
49
+ Country["BY"] = "BY";
50
+ Country["BZ"] = "BZ";
51
+ Country["CA"] = "CA";
52
+ Country["CC"] = "CC";
53
+ Country["CD"] = "CD";
54
+ Country["CF"] = "CF";
55
+ Country["CG"] = "CG";
56
+ Country["CH"] = "CH";
57
+ Country["CI"] = "CI";
58
+ Country["CK"] = "CK";
59
+ Country["CL"] = "CL";
60
+ Country["CM"] = "CM";
61
+ Country["CN"] = "CN";
62
+ Country["CO"] = "CO";
63
+ Country["CR"] = "CR";
64
+ Country["CU"] = "CU";
65
+ Country["CV"] = "CV";
66
+ Country["CW"] = "CW";
67
+ Country["CX"] = "CX";
68
+ Country["CY"] = "CY";
69
+ Country["CZ"] = "CZ";
70
+ Country["DE"] = "DE";
71
+ Country["DJ"] = "DJ";
72
+ Country["DK"] = "DK";
73
+ Country["DM"] = "DM";
74
+ Country["DO"] = "DO";
75
+ Country["DZ"] = "DZ";
76
+ Country["EC"] = "EC";
77
+ Country["EE"] = "EE";
78
+ Country["EG"] = "EG";
79
+ Country["EH"] = "EH";
80
+ Country["ER"] = "ER";
81
+ Country["ES"] = "ES";
82
+ Country["ET"] = "ET";
83
+ Country["FI"] = "FI";
84
+ Country["FJ"] = "FJ";
85
+ Country["FK"] = "FK";
86
+ Country["FM"] = "FM";
87
+ Country["FO"] = "FO";
88
+ Country["FR"] = "FR";
89
+ Country["GA"] = "GA";
90
+ Country["GB"] = "GB";
91
+ Country["GD"] = "GD";
92
+ Country["GE"] = "GE";
93
+ Country["GF"] = "GF";
94
+ Country["GG"] = "GG";
95
+ Country["GH"] = "GH";
96
+ Country["GI"] = "GI";
97
+ Country["GL"] = "GL";
98
+ Country["GM"] = "GM";
99
+ Country["GN"] = "GN";
100
+ Country["GP"] = "GP";
101
+ Country["GQ"] = "GQ";
102
+ Country["GR"] = "GR";
103
+ Country["GS"] = "GS";
104
+ Country["GT"] = "GT";
105
+ Country["GU"] = "GU";
106
+ Country["GW"] = "GW";
107
+ Country["GY"] = "GY";
108
+ Country["HK"] = "HK";
109
+ Country["HM"] = "HM";
110
+ Country["HN"] = "HN";
111
+ Country["HR"] = "HR";
112
+ Country["HT"] = "HT";
113
+ Country["HU"] = "HU";
114
+ Country["ID"] = "ID";
115
+ Country["IE"] = "IE";
116
+ Country["IL"] = "IL";
117
+ Country["IM"] = "IM";
118
+ Country["IN"] = "IN";
119
+ Country["IO"] = "IO";
120
+ Country["IQ"] = "IQ";
121
+ Country["IR"] = "IR";
122
+ Country["IS"] = "IS";
123
+ Country["IT"] = "IT";
124
+ Country["JE"] = "JE";
125
+ Country["JM"] = "JM";
126
+ Country["JO"] = "JO";
127
+ Country["JP"] = "JP";
128
+ Country["KE"] = "KE";
129
+ Country["KG"] = "KG";
130
+ Country["KH"] = "KH";
131
+ Country["KI"] = "KI";
132
+ Country["KM"] = "KM";
133
+ Country["KN"] = "KN";
134
+ Country["KP"] = "KP";
135
+ Country["KR"] = "KR";
136
+ Country["KW"] = "KW";
137
+ Country["KY"] = "KY";
138
+ Country["KZ"] = "KZ";
139
+ Country["LA"] = "LA";
140
+ Country["LB"] = "LB";
141
+ Country["LC"] = "LC";
142
+ Country["LI"] = "LI";
143
+ Country["LK"] = "LK";
144
+ Country["LR"] = "LR";
145
+ Country["LS"] = "LS";
146
+ Country["LT"] = "LT";
147
+ Country["LU"] = "LU";
148
+ Country["LV"] = "LV";
149
+ Country["LY"] = "LY";
150
+ Country["MA"] = "MA";
151
+ Country["MC"] = "MC";
152
+ Country["MD"] = "MD";
153
+ Country["ME"] = "ME";
154
+ Country["MF"] = "MF";
155
+ Country["MG"] = "MG";
156
+ Country["MH"] = "MH";
157
+ Country["MK"] = "MK";
158
+ Country["ML"] = "ML";
159
+ Country["MM"] = "MM";
160
+ Country["MN"] = "MN";
161
+ Country["MO"] = "MO";
162
+ Country["MP"] = "MP";
163
+ Country["MQ"] = "MQ";
164
+ Country["MR"] = "MR";
165
+ Country["MS"] = "MS";
166
+ Country["MT"] = "MT";
167
+ Country["MU"] = "MU";
168
+ Country["MV"] = "MV";
169
+ Country["MW"] = "MW";
170
+ Country["MX"] = "MX";
171
+ Country["MY"] = "MY";
172
+ Country["MZ"] = "MZ";
173
+ Country["NA"] = "NA";
174
+ Country["NC"] = "NC";
175
+ Country["NE"] = "NE";
176
+ Country["NF"] = "NF";
177
+ Country["NG"] = "NG";
178
+ Country["NI"] = "NI";
179
+ Country["NL"] = "NL";
180
+ Country["NO"] = "NO";
181
+ Country["NP"] = "NP";
182
+ Country["NR"] = "NR";
183
+ Country["NU"] = "NU";
184
+ Country["NZ"] = "NZ";
185
+ Country["OM"] = "OM";
186
+ Country["PA"] = "PA";
187
+ Country["PE"] = "PE";
188
+ Country["PF"] = "PF";
189
+ Country["PG"] = "PG";
190
+ Country["PH"] = "PH";
191
+ Country["PK"] = "PK";
192
+ Country["PL"] = "PL";
193
+ Country["PM"] = "PM";
194
+ Country["PN"] = "PN";
195
+ Country["PR"] = "PR";
196
+ Country["PS"] = "PS";
197
+ Country["PT"] = "PT";
198
+ Country["PW"] = "PW";
199
+ Country["PY"] = "PY";
200
+ Country["QA"] = "QA";
201
+ Country["RE"] = "RE";
202
+ Country["RO"] = "RO";
203
+ Country["RS"] = "RS";
204
+ Country["RU"] = "RU";
205
+ Country["RW"] = "RW";
206
+ Country["SA"] = "SA";
207
+ Country["SB"] = "SB";
208
+ Country["SC"] = "SC";
209
+ Country["SD"] = "SD";
210
+ Country["SE"] = "SE";
211
+ Country["SG"] = "SG";
212
+ Country["SH"] = "SH";
213
+ Country["SI"] = "SI";
214
+ Country["SJ"] = "SJ";
215
+ Country["SK"] = "SK";
216
+ Country["SL"] = "SL";
217
+ Country["SM"] = "SM";
218
+ Country["SN"] = "SN";
219
+ Country["SO"] = "SO";
220
+ Country["SR"] = "SR";
221
+ Country["SS"] = "SS";
222
+ Country["ST"] = "ST";
223
+ Country["SV"] = "SV";
224
+ Country["SX"] = "SX";
225
+ Country["SY"] = "SY";
226
+ Country["SZ"] = "SZ";
227
+ Country["TC"] = "TC";
228
+ Country["TD"] = "TD";
229
+ Country["TF"] = "TF";
230
+ Country["TG"] = "TG";
231
+ Country["TH"] = "TH";
232
+ Country["TJ"] = "TJ";
233
+ Country["TK"] = "TK";
234
+ Country["TL"] = "TL";
235
+ Country["TM"] = "TM";
236
+ Country["TN"] = "TN";
237
+ Country["TO"] = "TO";
238
+ Country["TR"] = "TR";
239
+ Country["TT"] = "TT";
240
+ Country["TV"] = "TV";
241
+ Country["TW"] = "TW";
242
+ Country["TZ"] = "TZ";
243
+ Country["UA"] = "UA";
244
+ Country["UG"] = "UG";
245
+ Country["UM"] = "UM";
246
+ Country["US"] = "US";
247
+ Country["UY"] = "UY";
248
+ Country["UZ"] = "UZ";
249
+ Country["VA"] = "VA";
250
+ Country["VC"] = "VC";
251
+ Country["VE"] = "VE";
252
+ Country["VG"] = "VG";
253
+ Country["VI"] = "VI";
254
+ Country["VN"] = "VN";
255
+ Country["VU"] = "VU";
256
+ Country["WF"] = "WF";
257
+ Country["WS"] = "WS";
258
+ Country["YE"] = "YE";
259
+ Country["YT"] = "YT";
260
+ Country["ZA"] = "ZA";
261
+ Country["ZM"] = "ZM";
262
+ Country["ZW"] = "ZW";
263
+ })(Country || (Country = {}));
11
264
  /** @example "USD" */
12
265
  export var Currency;
13
266
  (function (Currency) {
@@ -395,7 +648,7 @@ export class HttpClient {
395
648
  ...(requestParams.headers || {}),
396
649
  ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
397
650
  },
398
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal,
651
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
399
652
  body: typeof body === "undefined" || body === null ? null : payloadFormatter(body),
400
653
  }).then(async (response) => {
401
654
  const r = response;
@@ -428,7 +681,7 @@ export class HttpClient {
428
681
  }
429
682
  /**
430
683
  * @title Lago API documentation
431
- * @version 0.39.0-beta
684
+ * @version 0.41.0-beta
432
685
  * @license AGPLv3
433
686
  * @baseUrl https://api.getlago.com/api/v1
434
687
  * @externalDocs https://github.com/getlago
@@ -1455,9 +1708,10 @@ export class Api extends HttpClient {
1455
1708
  * @request DELETE:/subscriptions/{external_id}
1456
1709
  * @secure
1457
1710
  */
1458
- destroySubscription: (externalId, params = {}) => this.request({
1711
+ destroySubscription: (externalId, query, params = {}) => this.request({
1459
1712
  path: `/subscriptions/${externalId}`,
1460
1713
  method: "DELETE",
1714
+ query: query,
1461
1715
  secure: true,
1462
1716
  format: "json",
1463
1717
  ...params,
@@ -1465,7 +1719,7 @@ export class Api extends HttpClient {
1465
1719
  };
1466
1720
  taxes = {
1467
1721
  /**
1468
- * @description Create a tax
1722
+ * @description This endpoint creates a new tax representing a customizable tax rate applicable to either the organization or a specific customer.
1469
1723
  *
1470
1724
  * @tags taxes
1471
1725
  * @name CreateTax
@@ -1483,11 +1737,11 @@ export class Api extends HttpClient {
1483
1737
  ...params,
1484
1738
  }),
1485
1739
  /**
1486
- * @description Find all taxes in certain organization
1740
+ * @description This endpoint retrieves all existing taxes representing a customizable tax rate applicable to either the organization or a specific customer.
1487
1741
  *
1488
1742
  * @tags taxes
1489
1743
  * @name FindAllTaxes
1490
- * @summary Find taxes
1744
+ * @summary List all taxes
1491
1745
  * @request GET:/taxes
1492
1746
  * @secure
1493
1747
  */
@@ -1500,11 +1754,11 @@ export class Api extends HttpClient {
1500
1754
  ...params,
1501
1755
  }),
1502
1756
  /**
1503
- * @description Update an existing tax by code
1757
+ * @description This endpoint updates an existing tax representing a customizable tax rate applicable to either the organization or a specific customer.
1504
1758
  *
1505
1759
  * @tags taxes
1506
1760
  * @name UpdateTax
1507
- * @summary Update an existing tax
1761
+ * @summary Update a tax
1508
1762
  * @request PUT:/taxes/{code}
1509
1763
  * @secure
1510
1764
  */
@@ -1518,11 +1772,11 @@ export class Api extends HttpClient {
1518
1772
  ...params,
1519
1773
  }),
1520
1774
  /**
1521
- * @description Return a single tax
1775
+ * @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.
1522
1776
  *
1523
1777
  * @tags taxes
1524
1778
  * @name FindTax
1525
- * @summary Find tax by code
1779
+ * @summary Retrieve a Tax
1526
1780
  * @request GET:/taxes/{code}
1527
1781
  * @secure
1528
1782
  */
@@ -1534,7 +1788,7 @@ export class Api extends HttpClient {
1534
1788
  ...params,
1535
1789
  }),
1536
1790
  /**
1537
- * @description Delete a tax
1791
+ * @description This endpoint is used to delete a tax.
1538
1792
  *
1539
1793
  * @tags taxes
1540
1794
  * @name DestroyTax
@@ -1691,4 +1945,91 @@ export class Api extends HttpClient {
1691
1945
  ...params,
1692
1946
  }),
1693
1947
  };
1948
+ webhookEndpoints = {
1949
+ /**
1950
+ * @description This endpoint is used to create a webhook endpoint.
1951
+ *
1952
+ * @tags webhook_endpoints
1953
+ * @name CreateWebhookEndpoint
1954
+ * @summary Create a webhook_endpoint
1955
+ * @request POST:/webhook_endpoints
1956
+ * @secure
1957
+ */
1958
+ createWebhookEndpoint: (data, params = {}) => this.request({
1959
+ path: `/webhook_endpoints`,
1960
+ method: "POST",
1961
+ body: data,
1962
+ secure: true,
1963
+ type: ContentType.Json,
1964
+ format: "json",
1965
+ ...params,
1966
+ }),
1967
+ /**
1968
+ * @description This endpoint is used to list all webhook endpoints.
1969
+ *
1970
+ * @tags webhook_endpoints
1971
+ * @name FindAllWebhookEndpoints
1972
+ * @summary List all webhook endpoints
1973
+ * @request GET:/webhook_endpoints
1974
+ * @secure
1975
+ */
1976
+ findAllWebhookEndpoints: (query, params = {}) => this.request({
1977
+ path: `/webhook_endpoints`,
1978
+ method: "GET",
1979
+ query: query,
1980
+ secure: true,
1981
+ format: "json",
1982
+ ...params,
1983
+ }),
1984
+ /**
1985
+ * @description This endpoint is used to update an existing webhook endpoint.
1986
+ *
1987
+ * @tags webhook_endpoints
1988
+ * @name UpdateWebhookEndpoint
1989
+ * @summary Update a webhook endpoint
1990
+ * @request PUT:/webhook_endpoints/{lago_id}
1991
+ * @secure
1992
+ */
1993
+ updateWebhookEndpoint: (lagoId, data, params = {}) => this.request({
1994
+ path: `/webhook_endpoints/${lagoId}`,
1995
+ method: "PUT",
1996
+ body: data,
1997
+ secure: true,
1998
+ type: ContentType.Json,
1999
+ format: "json",
2000
+ ...params,
2001
+ }),
2002
+ /**
2003
+ * @description This endpoint is used to retrieve an existing webhook endpoint.
2004
+ *
2005
+ * @tags webhook_endpoints
2006
+ * @name FindWebhookEndpoint
2007
+ * @summary Retrieve a webhook endpoint
2008
+ * @request GET:/webhook_endpoints/{lago_id}
2009
+ * @secure
2010
+ */
2011
+ findWebhookEndpoint: (lagoId, params = {}) => this.request({
2012
+ path: `/webhook_endpoints/${lagoId}`,
2013
+ method: "GET",
2014
+ secure: true,
2015
+ format: "json",
2016
+ ...params,
2017
+ }),
2018
+ /**
2019
+ * @description This endpoint is used to delete an existing webhook endpoint.
2020
+ *
2021
+ * @tags webhook_endpoints
2022
+ * @name DestroyWebhookEndpoint
2023
+ * @summary Delete a webhook endpoint
2024
+ * @request DELETE:/webhook_endpoints/{lago_id}
2025
+ * @secure
2026
+ */
2027
+ destroyWebhookEndpoint: (lagoId, params = {}) => this.request({
2028
+ path: `/webhook_endpoints/${lagoId}`,
2029
+ method: "DELETE",
2030
+ secure: true,
2031
+ format: "json",
2032
+ ...params,
2033
+ }),
2034
+ };
1694
2035
  }
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.0-beta",
7
+ "version": "v0.41.0-beta",
8
8
  "description": "Lago JavaScript API Client",
9
9
  "repository": {
10
10
  "type": "git",