lago-javascript-client 0.21.0-beta → 0.23.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.
- package/esm/swagger/client.js +50 -1
- package/package.json +1 -1
- package/script/swagger/client.js +50 -1
- package/types/swagger/client.d.ts +77 -9
package/esm/swagger/client.js
CHANGED
|
@@ -148,7 +148,7 @@ export class HttpClient {
|
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* @title Lago API documentation
|
|
151
|
-
* @version 0.
|
|
151
|
+
* @version 0.23.0-beta
|
|
152
152
|
* @baseUrl https://api.getlago.com/api/v1
|
|
153
153
|
* @externalDocs https://github.com/getlago
|
|
154
154
|
* @contact <tech@getlago.com>
|
|
@@ -546,6 +546,22 @@ export class Api extends HttpClient {
|
|
|
546
546
|
format: "json",
|
|
547
547
|
...params,
|
|
548
548
|
}),
|
|
549
|
+
/**
|
|
550
|
+
* @description Return the deleted customer
|
|
551
|
+
*
|
|
552
|
+
* @tags customers
|
|
553
|
+
* @name DeleteCustomer
|
|
554
|
+
* @summary Delete a customer
|
|
555
|
+
* @request DELETE:/customers/{external_id}
|
|
556
|
+
* @secure
|
|
557
|
+
*/
|
|
558
|
+
deleteCustomer: (externalId, params = {}) => this.request({
|
|
559
|
+
path: `/customers/${externalId}`,
|
|
560
|
+
method: "DELETE",
|
|
561
|
+
secure: true,
|
|
562
|
+
format: "json",
|
|
563
|
+
...params,
|
|
564
|
+
}),
|
|
549
565
|
/**
|
|
550
566
|
* @description Return a customer current usage
|
|
551
567
|
*
|
|
@@ -563,6 +579,22 @@ export class Api extends HttpClient {
|
|
|
563
579
|
format: "json",
|
|
564
580
|
...params,
|
|
565
581
|
}),
|
|
582
|
+
/**
|
|
583
|
+
* @description Delete customer's appplied coupon
|
|
584
|
+
*
|
|
585
|
+
* @tags customers
|
|
586
|
+
* @name DeleteAppliedCoupon
|
|
587
|
+
* @summary Delete customer's appplied coupon
|
|
588
|
+
* @request DELETE:/customers/{customer_external_id}/applied_coupons/{applied_coupon_id}
|
|
589
|
+
* @secure
|
|
590
|
+
*/
|
|
591
|
+
deleteAppliedCoupon: (customerExternalId, appliedCouponId, params = {}) => this.request({
|
|
592
|
+
path: `/customers/${customerExternalId}/applied_coupons/${appliedCouponId}`,
|
|
593
|
+
method: "DELETE",
|
|
594
|
+
secure: true,
|
|
595
|
+
format: "json",
|
|
596
|
+
...params,
|
|
597
|
+
}),
|
|
566
598
|
/**
|
|
567
599
|
* @description Find all customers in certain organisation
|
|
568
600
|
*
|
|
@@ -1010,6 +1042,23 @@ export class Api extends HttpClient {
|
|
|
1010
1042
|
format: "json",
|
|
1011
1043
|
...params,
|
|
1012
1044
|
}),
|
|
1045
|
+
/**
|
|
1046
|
+
* @description Find all wallet transactions for certain wallet
|
|
1047
|
+
*
|
|
1048
|
+
* @tags wallets
|
|
1049
|
+
* @name FindAllWalletTransactions
|
|
1050
|
+
* @summary Find wallet transactions
|
|
1051
|
+
* @request GET:/wallets/{id}/wallet_transactions
|
|
1052
|
+
* @secure
|
|
1053
|
+
*/
|
|
1054
|
+
findAllWalletTransactions: (id, query, params = {}) => this.request({
|
|
1055
|
+
path: `/wallets/${id}/wallet_transactions`,
|
|
1056
|
+
method: "GET",
|
|
1057
|
+
query: query,
|
|
1058
|
+
secure: true,
|
|
1059
|
+
format: "json",
|
|
1060
|
+
...params,
|
|
1061
|
+
}),
|
|
1013
1062
|
};
|
|
1014
1063
|
walletTransactions = {
|
|
1015
1064
|
/**
|
package/package.json
CHANGED
package/script/swagger/client.js
CHANGED
|
@@ -152,7 +152,7 @@ class HttpClient {
|
|
|
152
152
|
exports.HttpClient = HttpClient;
|
|
153
153
|
/**
|
|
154
154
|
* @title Lago API documentation
|
|
155
|
-
* @version 0.
|
|
155
|
+
* @version 0.23.0-beta
|
|
156
156
|
* @baseUrl https://api.getlago.com/api/v1
|
|
157
157
|
* @externalDocs https://github.com/getlago
|
|
158
158
|
* @contact <tech@getlago.com>
|
|
@@ -550,6 +550,22 @@ class Api extends HttpClient {
|
|
|
550
550
|
format: "json",
|
|
551
551
|
...params,
|
|
552
552
|
}),
|
|
553
|
+
/**
|
|
554
|
+
* @description Return the deleted customer
|
|
555
|
+
*
|
|
556
|
+
* @tags customers
|
|
557
|
+
* @name DeleteCustomer
|
|
558
|
+
* @summary Delete a customer
|
|
559
|
+
* @request DELETE:/customers/{external_id}
|
|
560
|
+
* @secure
|
|
561
|
+
*/
|
|
562
|
+
deleteCustomer: (externalId, params = {}) => this.request({
|
|
563
|
+
path: `/customers/${externalId}`,
|
|
564
|
+
method: "DELETE",
|
|
565
|
+
secure: true,
|
|
566
|
+
format: "json",
|
|
567
|
+
...params,
|
|
568
|
+
}),
|
|
553
569
|
/**
|
|
554
570
|
* @description Return a customer current usage
|
|
555
571
|
*
|
|
@@ -567,6 +583,22 @@ class Api extends HttpClient {
|
|
|
567
583
|
format: "json",
|
|
568
584
|
...params,
|
|
569
585
|
}),
|
|
586
|
+
/**
|
|
587
|
+
* @description Delete customer's appplied coupon
|
|
588
|
+
*
|
|
589
|
+
* @tags customers
|
|
590
|
+
* @name DeleteAppliedCoupon
|
|
591
|
+
* @summary Delete customer's appplied coupon
|
|
592
|
+
* @request DELETE:/customers/{customer_external_id}/applied_coupons/{applied_coupon_id}
|
|
593
|
+
* @secure
|
|
594
|
+
*/
|
|
595
|
+
deleteAppliedCoupon: (customerExternalId, appliedCouponId, params = {}) => this.request({
|
|
596
|
+
path: `/customers/${customerExternalId}/applied_coupons/${appliedCouponId}`,
|
|
597
|
+
method: "DELETE",
|
|
598
|
+
secure: true,
|
|
599
|
+
format: "json",
|
|
600
|
+
...params,
|
|
601
|
+
}),
|
|
570
602
|
/**
|
|
571
603
|
* @description Find all customers in certain organisation
|
|
572
604
|
*
|
|
@@ -1014,6 +1046,23 @@ class Api extends HttpClient {
|
|
|
1014
1046
|
format: "json",
|
|
1015
1047
|
...params,
|
|
1016
1048
|
}),
|
|
1049
|
+
/**
|
|
1050
|
+
* @description Find all wallet transactions for certain wallet
|
|
1051
|
+
*
|
|
1052
|
+
* @tags wallets
|
|
1053
|
+
* @name FindAllWalletTransactions
|
|
1054
|
+
* @summary Find wallet transactions
|
|
1055
|
+
* @request GET:/wallets/{id}/wallet_transactions
|
|
1056
|
+
* @secure
|
|
1057
|
+
*/
|
|
1058
|
+
findAllWalletTransactions: (id, query, params = {}) => this.request({
|
|
1059
|
+
path: `/wallets/${id}/wallet_transactions`,
|
|
1060
|
+
method: "GET",
|
|
1061
|
+
query: query,
|
|
1062
|
+
secure: true,
|
|
1063
|
+
format: "json",
|
|
1064
|
+
...params,
|
|
1065
|
+
}),
|
|
1017
1066
|
};
|
|
1018
1067
|
walletTransactions = {
|
|
1019
1068
|
/**
|
|
@@ -140,6 +140,9 @@ export interface CouponObject {
|
|
|
140
140
|
amount_currency?: string;
|
|
141
141
|
/** @example true */
|
|
142
142
|
reusable?: boolean;
|
|
143
|
+
/** @example true */
|
|
144
|
+
limited_plans?: boolean;
|
|
145
|
+
plan_codes?: string[];
|
|
143
146
|
/** @example "2022-09-14T16:35:31.000Z" */
|
|
144
147
|
created_at?: string;
|
|
145
148
|
/** @example 25 */
|
|
@@ -183,6 +186,9 @@ export interface CouponInput {
|
|
|
183
186
|
expiration_at?: string;
|
|
184
187
|
/** Expiration type */
|
|
185
188
|
expiration?: "no_expiration" | "time_limit";
|
|
189
|
+
applies_to?: {
|
|
190
|
+
plan_codes?: string[];
|
|
191
|
+
};
|
|
186
192
|
};
|
|
187
193
|
}
|
|
188
194
|
export interface AppliedCouponObject {
|
|
@@ -248,6 +254,8 @@ export interface BillingConfigurationOrganization {
|
|
|
248
254
|
invoice_footer?: string;
|
|
249
255
|
/** @example 5 */
|
|
250
256
|
invoice_grace_period?: number;
|
|
257
|
+
/** @example "fr" */
|
|
258
|
+
document_locale?: string;
|
|
251
259
|
/** @example 25 */
|
|
252
260
|
vat_rate?: number;
|
|
253
261
|
}
|
|
@@ -269,7 +277,7 @@ export interface OrganizationObject {
|
|
|
269
277
|
/** @example "state1" */
|
|
270
278
|
state?: string;
|
|
271
279
|
/** @example 10000 */
|
|
272
|
-
|
|
280
|
+
zipcode?: string;
|
|
273
281
|
/** @example "example@example.com" */
|
|
274
282
|
email?: string;
|
|
275
283
|
/** @example "City" */
|
|
@@ -298,7 +306,7 @@ export interface OrganizationInput {
|
|
|
298
306
|
/** @example "state1" */
|
|
299
307
|
state?: string;
|
|
300
308
|
/** @example 10000 */
|
|
301
|
-
|
|
309
|
+
zipcode?: string;
|
|
302
310
|
/** @example "example@example.com" */
|
|
303
311
|
email?: string;
|
|
304
312
|
/** @example "City" */
|
|
@@ -321,6 +329,8 @@ export interface BillingConfigurationCustomer {
|
|
|
321
329
|
provider_customer_id?: string;
|
|
322
330
|
/** @example true */
|
|
323
331
|
sync_with_provider?: boolean;
|
|
332
|
+
/** @example "fr" */
|
|
333
|
+
document_locale?: string;
|
|
324
334
|
/** @example 25 */
|
|
325
335
|
vat_rate?: number;
|
|
326
336
|
[key: string]: any;
|
|
@@ -347,7 +357,7 @@ export interface CustomerObject {
|
|
|
347
357
|
/** @example "state1" */
|
|
348
358
|
state?: string;
|
|
349
359
|
/** @example 10000 */
|
|
350
|
-
|
|
360
|
+
zipcode?: string;
|
|
351
361
|
/** @example "example@example.com" */
|
|
352
362
|
email?: string;
|
|
353
363
|
/** @example "City" */
|
|
@@ -391,7 +401,7 @@ export interface CustomerInput {
|
|
|
391
401
|
/** @example "state1" */
|
|
392
402
|
state?: string;
|
|
393
403
|
/** @example 10000 */
|
|
394
|
-
|
|
404
|
+
zipcode?: string;
|
|
395
405
|
/** @example "example@example.com" */
|
|
396
406
|
email?: string;
|
|
397
407
|
/** @example "City" */
|
|
@@ -566,6 +576,10 @@ export interface PlanObject {
|
|
|
566
576
|
pay_in_advance?: boolean;
|
|
567
577
|
/** @example false */
|
|
568
578
|
bill_charges_monthly?: boolean;
|
|
579
|
+
/** @example 2 */
|
|
580
|
+
active_subscriptions_count?: number;
|
|
581
|
+
/** @example 2 */
|
|
582
|
+
draft_invoices_count?: number;
|
|
569
583
|
charges?: ChargeObject[];
|
|
570
584
|
}
|
|
571
585
|
export interface Plan {
|
|
@@ -852,6 +866,9 @@ export interface WalletTransactionObject {
|
|
|
852
866
|
export interface WalletTransaction {
|
|
853
867
|
wallet_transaction?: WalletTransactionObject;
|
|
854
868
|
}
|
|
869
|
+
export interface WalletTransactions {
|
|
870
|
+
wallet_transactions?: WalletTransactionObject[];
|
|
871
|
+
}
|
|
855
872
|
export interface WalletTransactionInput {
|
|
856
873
|
wallet_transaction?: {
|
|
857
874
|
/** @example "985da83c-c007-4fbb-afcd-b00c07c41ffe" */
|
|
@@ -1069,7 +1086,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1069
1086
|
}
|
|
1070
1087
|
/**
|
|
1071
1088
|
* @title Lago API documentation
|
|
1072
|
-
* @version 0.
|
|
1089
|
+
* @version 0.23.0-beta
|
|
1073
1090
|
* @baseUrl https://api.getlago.com/api/v1
|
|
1074
1091
|
* @externalDocs https://github.com/getlago
|
|
1075
1092
|
* @contact <tech@getlago.com>
|
|
@@ -1201,7 +1218,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1201
1218
|
* @request DELETE:/add_ons/{code}
|
|
1202
1219
|
* @secure
|
|
1203
1220
|
*/
|
|
1204
|
-
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1221
|
+
destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1205
1222
|
/**
|
|
1206
1223
|
* @description Find all add-ons in certain organisation
|
|
1207
1224
|
*
|
|
@@ -1276,7 +1293,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1276
1293
|
* @request DELETE:/coupons/{code}
|
|
1277
1294
|
* @secure
|
|
1278
1295
|
*/
|
|
1279
|
-
destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1296
|
+
destroyCoupon: (code: string, params?: RequestParams) => Promise<HttpResponse<Coupon, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1280
1297
|
/**
|
|
1281
1298
|
* @description Find all coupons in certain organisation
|
|
1282
1299
|
*
|
|
@@ -1372,6 +1389,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1372
1389
|
* @secure
|
|
1373
1390
|
*/
|
|
1374
1391
|
findCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1392
|
+
/**
|
|
1393
|
+
* @description Return the deleted customer
|
|
1394
|
+
*
|
|
1395
|
+
* @tags customers
|
|
1396
|
+
* @name DeleteCustomer
|
|
1397
|
+
* @summary Delete a customer
|
|
1398
|
+
* @request DELETE:/customers/{external_id}
|
|
1399
|
+
* @secure
|
|
1400
|
+
*/
|
|
1401
|
+
deleteCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1375
1402
|
/**
|
|
1376
1403
|
* @description Return a customer current usage
|
|
1377
1404
|
*
|
|
@@ -1388,6 +1415,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1388
1415
|
*/
|
|
1389
1416
|
external_subscription_id: string;
|
|
1390
1417
|
}, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1418
|
+
/**
|
|
1419
|
+
* @description Delete customer's appplied coupon
|
|
1420
|
+
*
|
|
1421
|
+
* @tags customers
|
|
1422
|
+
* @name DeleteAppliedCoupon
|
|
1423
|
+
* @summary Delete customer's appplied coupon
|
|
1424
|
+
* @request DELETE:/customers/{customer_external_id}/applied_coupons/{applied_coupon_id}
|
|
1425
|
+
* @secure
|
|
1426
|
+
*/
|
|
1427
|
+
deleteAppliedCoupon: (customerExternalId: string, appliedCouponId: string, params?: RequestParams) => Promise<HttpResponse<AppliedCoupon, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1391
1428
|
/**
|
|
1392
1429
|
* @description Find all customers in certain organisation
|
|
1393
1430
|
*
|
|
@@ -1482,7 +1519,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1482
1519
|
* @request DELETE:/plans/{code}
|
|
1483
1520
|
* @secure
|
|
1484
1521
|
*/
|
|
1485
|
-
destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound
|
|
1522
|
+
destroyPlan: (code: string, params?: RequestParams) => Promise<HttpResponse<Plan, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1486
1523
|
/**
|
|
1487
1524
|
* @description Find all plans in certain organisation
|
|
1488
1525
|
*
|
|
@@ -1745,6 +1782,37 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1745
1782
|
*/
|
|
1746
1783
|
external_customer_id: string;
|
|
1747
1784
|
}, params?: RequestParams) => Promise<HttpResponse<Wallets, ApiResponseUnauthorized>>;
|
|
1785
|
+
/**
|
|
1786
|
+
* @description Find all wallet transactions for certain wallet
|
|
1787
|
+
*
|
|
1788
|
+
* @tags wallets
|
|
1789
|
+
* @name FindAllWalletTransactions
|
|
1790
|
+
* @summary Find wallet transactions
|
|
1791
|
+
* @request GET:/wallets/{id}/wallet_transactions
|
|
1792
|
+
* @secure
|
|
1793
|
+
*/
|
|
1794
|
+
findAllWalletTransactions: (id: string, query?: {
|
|
1795
|
+
/**
|
|
1796
|
+
* Number of page
|
|
1797
|
+
* @example 2
|
|
1798
|
+
*/
|
|
1799
|
+
page?: number;
|
|
1800
|
+
/**
|
|
1801
|
+
* Number of records per page
|
|
1802
|
+
* @example 20
|
|
1803
|
+
*/
|
|
1804
|
+
per_page?: number;
|
|
1805
|
+
/**
|
|
1806
|
+
* Status (pending or settled)
|
|
1807
|
+
* @example "pending"
|
|
1808
|
+
*/
|
|
1809
|
+
status?: string;
|
|
1810
|
+
/**
|
|
1811
|
+
* Transaction Type (inbound or outbound)
|
|
1812
|
+
* @example "inbound"
|
|
1813
|
+
*/
|
|
1814
|
+
transaction_type?: string;
|
|
1815
|
+
}, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1748
1816
|
};
|
|
1749
1817
|
walletTransactions: {
|
|
1750
1818
|
/**
|
|
@@ -1756,7 +1824,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1756
1824
|
* @request POST:/wallet_transactions
|
|
1757
1825
|
* @secure
|
|
1758
1826
|
*/
|
|
1759
|
-
createWalletTransaction: (data: WalletTransactionInput, params?: RequestParams) => Promise<HttpResponse<
|
|
1827
|
+
createWalletTransaction: (data: WalletTransactionInput, params?: RequestParams) => Promise<HttpResponse<WalletTransactions, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
|
|
1760
1828
|
};
|
|
1761
1829
|
creditNotes: {
|
|
1762
1830
|
/**
|