lago-javascript-client 0.31.0-beta → 0.35.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/openapi/client.js +24 -6
- package/package.json +1 -1
- package/script/openapi/client.js +24 -6
- package/types/openapi/client.d.ts +51 -17
package/esm/openapi/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.35.0-beta
|
|
152
152
|
* @baseUrl https://api.getlago.com/api/v1
|
|
153
153
|
* @externalDocs https://github.com/getlago
|
|
154
154
|
* @contact <tech@getlago.com>
|
|
@@ -567,12 +567,12 @@ export class Api extends HttpClient {
|
|
|
567
567
|
* @description Return the deleted customer
|
|
568
568
|
*
|
|
569
569
|
* @tags customers
|
|
570
|
-
* @name
|
|
570
|
+
* @name DestroyCustomer
|
|
571
571
|
* @summary Delete a customer
|
|
572
572
|
* @request DELETE:/customers/{external_id}
|
|
573
573
|
* @secure
|
|
574
574
|
*/
|
|
575
|
-
|
|
575
|
+
destroyCustomer: (externalId, params = {}) => this.request({
|
|
576
576
|
path: `/customers/${externalId}`,
|
|
577
577
|
method: "DELETE",
|
|
578
578
|
secure: true,
|
|
@@ -681,11 +681,11 @@ export class Api extends HttpClient {
|
|
|
681
681
|
...params,
|
|
682
682
|
}),
|
|
683
683
|
/**
|
|
684
|
-
* @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple
|
|
684
|
+
* @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 charges
|
|
685
685
|
*
|
|
686
686
|
* @tags events
|
|
687
687
|
* @name EventEstimateFees
|
|
688
|
-
* @summary Estimate fees for an
|
|
688
|
+
* @summary Estimate fees for an pay in advance charge
|
|
689
689
|
* @request POST:/events/estimate_fees
|
|
690
690
|
* @secure
|
|
691
691
|
*/
|
|
@@ -758,7 +758,7 @@ export class Api extends HttpClient {
|
|
|
758
758
|
*
|
|
759
759
|
* @tags plans
|
|
760
760
|
* @name FindPlan
|
|
761
|
-
* @summary
|
|
761
|
+
* @summary Find plan by code
|
|
762
762
|
* @request GET:/plans/{code}
|
|
763
763
|
* @secure
|
|
764
764
|
*/
|
|
@@ -875,6 +875,24 @@ export class Api extends HttpClient {
|
|
|
875
875
|
}),
|
|
876
876
|
};
|
|
877
877
|
invoices = {
|
|
878
|
+
/**
|
|
879
|
+
* @description Create a new one off Invoice
|
|
880
|
+
*
|
|
881
|
+
* @tags invoices
|
|
882
|
+
* @name CreateInvoice
|
|
883
|
+
* @summary Create a new invoice
|
|
884
|
+
* @request POST:/invoices
|
|
885
|
+
* @secure
|
|
886
|
+
*/
|
|
887
|
+
createInvoice: (data, params = {}) => this.request({
|
|
888
|
+
path: `/invoices`,
|
|
889
|
+
method: "POST",
|
|
890
|
+
body: data,
|
|
891
|
+
secure: true,
|
|
892
|
+
type: ContentType.Json,
|
|
893
|
+
format: "json",
|
|
894
|
+
...params,
|
|
895
|
+
}),
|
|
878
896
|
/**
|
|
879
897
|
* @description Find all invoices in certain organisation
|
|
880
898
|
*
|
package/package.json
CHANGED
package/script/openapi/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.35.0-beta
|
|
156
156
|
* @baseUrl https://api.getlago.com/api/v1
|
|
157
157
|
* @externalDocs https://github.com/getlago
|
|
158
158
|
* @contact <tech@getlago.com>
|
|
@@ -571,12 +571,12 @@ class Api extends HttpClient {
|
|
|
571
571
|
* @description Return the deleted customer
|
|
572
572
|
*
|
|
573
573
|
* @tags customers
|
|
574
|
-
* @name
|
|
574
|
+
* @name DestroyCustomer
|
|
575
575
|
* @summary Delete a customer
|
|
576
576
|
* @request DELETE:/customers/{external_id}
|
|
577
577
|
* @secure
|
|
578
578
|
*/
|
|
579
|
-
|
|
579
|
+
destroyCustomer: (externalId, params = {}) => this.request({
|
|
580
580
|
path: `/customers/${externalId}`,
|
|
581
581
|
method: "DELETE",
|
|
582
582
|
secure: true,
|
|
@@ -685,11 +685,11 @@ class Api extends HttpClient {
|
|
|
685
685
|
...params,
|
|
686
686
|
}),
|
|
687
687
|
/**
|
|
688
|
-
* @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple
|
|
688
|
+
* @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 charges
|
|
689
689
|
*
|
|
690
690
|
* @tags events
|
|
691
691
|
* @name EventEstimateFees
|
|
692
|
-
* @summary Estimate fees for an
|
|
692
|
+
* @summary Estimate fees for an pay in advance charge
|
|
693
693
|
* @request POST:/events/estimate_fees
|
|
694
694
|
* @secure
|
|
695
695
|
*/
|
|
@@ -762,7 +762,7 @@ class Api extends HttpClient {
|
|
|
762
762
|
*
|
|
763
763
|
* @tags plans
|
|
764
764
|
* @name FindPlan
|
|
765
|
-
* @summary
|
|
765
|
+
* @summary Find plan by code
|
|
766
766
|
* @request GET:/plans/{code}
|
|
767
767
|
* @secure
|
|
768
768
|
*/
|
|
@@ -879,6 +879,24 @@ class Api extends HttpClient {
|
|
|
879
879
|
}),
|
|
880
880
|
};
|
|
881
881
|
invoices = {
|
|
882
|
+
/**
|
|
883
|
+
* @description Create a new one off Invoice
|
|
884
|
+
*
|
|
885
|
+
* @tags invoices
|
|
886
|
+
* @name CreateInvoice
|
|
887
|
+
* @summary Create a new invoice
|
|
888
|
+
* @request POST:/invoices
|
|
889
|
+
* @secure
|
|
890
|
+
*/
|
|
891
|
+
createInvoice: (data, params = {}) => this.request({
|
|
892
|
+
path: `/invoices`,
|
|
893
|
+
method: "POST",
|
|
894
|
+
body: data,
|
|
895
|
+
secure: true,
|
|
896
|
+
type: ContentType.Json,
|
|
897
|
+
format: "json",
|
|
898
|
+
...params,
|
|
899
|
+
}),
|
|
882
900
|
/**
|
|
883
901
|
* @description Find all invoices in certain organisation
|
|
884
902
|
*
|
|
@@ -567,7 +567,7 @@ export interface ChargeUsageObject {
|
|
|
567
567
|
lago_id?: string;
|
|
568
568
|
/** Charge model type */
|
|
569
569
|
charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
570
|
-
|
|
570
|
+
pay_in_advance?: boolean;
|
|
571
571
|
/** @example 1200 */
|
|
572
572
|
min_amount_cents?: number;
|
|
573
573
|
};
|
|
@@ -750,7 +750,9 @@ export interface ChargeObject {
|
|
|
750
750
|
/** Charge model type */
|
|
751
751
|
charge_model: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
752
752
|
/** @example true */
|
|
753
|
-
|
|
753
|
+
pay_in_advance?: boolean;
|
|
754
|
+
/** @example true */
|
|
755
|
+
invoiceable?: boolean;
|
|
754
756
|
/** @example 1200 */
|
|
755
757
|
min_amount_cents?: number;
|
|
756
758
|
properties?: object;
|
|
@@ -831,7 +833,8 @@ export interface PlanInput {
|
|
|
831
833
|
billable_metric_id?: string;
|
|
832
834
|
/** Charge model type */
|
|
833
835
|
charge_model?: "standard" | "graduated" | "package" | "percentage" | "volume";
|
|
834
|
-
|
|
836
|
+
pay_in_advance?: boolean;
|
|
837
|
+
invoiceable?: boolean;
|
|
835
838
|
min_amount_cents?: number;
|
|
836
839
|
properties?: object;
|
|
837
840
|
group_properties?: {
|
|
@@ -1015,6 +1018,10 @@ export interface FeeObject {
|
|
|
1015
1018
|
total_amount_currency?: string;
|
|
1016
1019
|
/** @example 5 */
|
|
1017
1020
|
events_count?: number;
|
|
1021
|
+
/** @example true */
|
|
1022
|
+
pay_in_advance?: boolean;
|
|
1023
|
+
/** @example true */
|
|
1024
|
+
invoiceable?: boolean;
|
|
1018
1025
|
/**
|
|
1019
1026
|
* @format date-time
|
|
1020
1027
|
* @example "2022-08-08T00:00:00Z"
|
|
@@ -1163,9 +1170,6 @@ export type InvoiceObjectExtended = InvoiceObject & {
|
|
|
1163
1170
|
export interface Invoice {
|
|
1164
1171
|
invoice: InvoiceObjectExtended;
|
|
1165
1172
|
}
|
|
1166
|
-
export interface Invoices {
|
|
1167
|
-
invoices: InvoiceObject[];
|
|
1168
|
-
}
|
|
1169
1173
|
export interface InvoicesPaginated {
|
|
1170
1174
|
invoices: InvoiceObject[];
|
|
1171
1175
|
meta: PaginationMeta;
|
|
@@ -1187,6 +1191,24 @@ export interface InvoiceInput {
|
|
|
1187
1191
|
}[];
|
|
1188
1192
|
};
|
|
1189
1193
|
}
|
|
1194
|
+
export interface InvoiceOneOffInput {
|
|
1195
|
+
invoice: {
|
|
1196
|
+
/** @example "_ID_" */
|
|
1197
|
+
external_customer_id: string;
|
|
1198
|
+
/** @example "EUR" */
|
|
1199
|
+
currency?: string;
|
|
1200
|
+
fees?: {
|
|
1201
|
+
/** @example "12345" */
|
|
1202
|
+
add_on_code: string;
|
|
1203
|
+
/** @example 1200 */
|
|
1204
|
+
unit_amount_cents?: number;
|
|
1205
|
+
/** @example 2.5 */
|
|
1206
|
+
units?: number;
|
|
1207
|
+
/** @example "This is description" */
|
|
1208
|
+
description?: string;
|
|
1209
|
+
}[];
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1190
1212
|
export interface WalletObject {
|
|
1191
1213
|
/**
|
|
1192
1214
|
* @format uuid
|
|
@@ -1314,9 +1336,6 @@ export interface WalletTransactionObject {
|
|
|
1314
1336
|
*/
|
|
1315
1337
|
created_at: string;
|
|
1316
1338
|
}
|
|
1317
|
-
export interface WalletTransaction {
|
|
1318
|
-
wallet_transaction: WalletTransactionObject;
|
|
1319
|
-
}
|
|
1320
1339
|
export interface WalletTransactions {
|
|
1321
1340
|
wallet_transactions: WalletTransactionObject[];
|
|
1322
1341
|
}
|
|
@@ -1611,7 +1630,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1611
1630
|
}
|
|
1612
1631
|
/**
|
|
1613
1632
|
* @title Lago API documentation
|
|
1614
|
-
* @version 0.
|
|
1633
|
+
* @version 0.35.0-beta
|
|
1615
1634
|
* @baseUrl https://api.getlago.com/api/v1
|
|
1616
1635
|
* @externalDocs https://github.com/getlago
|
|
1617
1636
|
* @contact <tech@getlago.com>
|
|
@@ -1939,12 +1958,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
1939
1958
|
* @description Return the deleted customer
|
|
1940
1959
|
*
|
|
1941
1960
|
* @tags customers
|
|
1942
|
-
* @name
|
|
1961
|
+
* @name DestroyCustomer
|
|
1943
1962
|
* @summary Delete a customer
|
|
1944
1963
|
* @request DELETE:/customers/{external_id}
|
|
1945
1964
|
* @secure
|
|
1946
1965
|
*/
|
|
1947
|
-
|
|
1966
|
+
destroyCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
1948
1967
|
/**
|
|
1949
1968
|
* @description Return a customer current usage
|
|
1950
1969
|
*
|
|
@@ -2019,11 +2038,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2019
2038
|
*/
|
|
2020
2039
|
findEvent: (id: string, params?: RequestParams) => Promise<HttpResponse<Event, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
2021
2040
|
/**
|
|
2022
|
-
* @description Estimate the fees that would be created after reception of an event for a billable metric attached to one or multiple
|
|
2041
|
+
* @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 charges
|
|
2023
2042
|
*
|
|
2024
2043
|
* @tags events
|
|
2025
2044
|
* @name EventEstimateFees
|
|
2026
|
-
* @summary Estimate fees for an
|
|
2045
|
+
* @summary Estimate fees for an pay in advance charge
|
|
2027
2046
|
* @request POST:/events/estimate_fees
|
|
2028
2047
|
* @secure
|
|
2029
2048
|
*/
|
|
@@ -2076,7 +2095,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2076
2095
|
*
|
|
2077
2096
|
* @tags plans
|
|
2078
2097
|
* @name FindPlan
|
|
2079
|
-
* @summary
|
|
2098
|
+
* @summary Find plan by code
|
|
2080
2099
|
* @request GET:/plans/{code}
|
|
2081
2100
|
* @secure
|
|
2082
2101
|
*/
|
|
@@ -2112,7 +2131,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2112
2131
|
* @request GET:/subscriptions
|
|
2113
2132
|
* @secure
|
|
2114
2133
|
*/
|
|
2115
|
-
findAllSubscriptions: (query
|
|
2134
|
+
findAllSubscriptions: (query?: {
|
|
2116
2135
|
/**
|
|
2117
2136
|
* Number of page
|
|
2118
2137
|
* @example 2
|
|
@@ -2127,7 +2146,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2127
2146
|
* External customer ID
|
|
2128
2147
|
* @example "12345"
|
|
2129
2148
|
*/
|
|
2130
|
-
external_customer_id
|
|
2149
|
+
external_customer_id?: string;
|
|
2150
|
+
/**
|
|
2151
|
+
* Code of the plan attached to the subscription
|
|
2152
|
+
* @example "example_code"
|
|
2153
|
+
*/
|
|
2154
|
+
plan_code?: string;
|
|
2131
2155
|
}, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiResponseUnauthorized | ApiResponseNotFound>>;
|
|
2132
2156
|
/**
|
|
2133
2157
|
* @description Update an existing subscription by external ID
|
|
@@ -2163,6 +2187,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
2163
2187
|
fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiResponseUnauthorized>>;
|
|
2164
2188
|
};
|
|
2165
2189
|
invoices: {
|
|
2190
|
+
/**
|
|
2191
|
+
* @description Create a new one off Invoice
|
|
2192
|
+
*
|
|
2193
|
+
* @tags invoices
|
|
2194
|
+
* @name CreateInvoice
|
|
2195
|
+
* @summary Create a new invoice
|
|
2196
|
+
* @request POST:/invoices
|
|
2197
|
+
* @secure
|
|
2198
|
+
*/
|
|
2199
|
+
createInvoice: (data: InvoiceOneOffInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
|
|
2166
2200
|
/**
|
|
2167
2201
|
* @description Find all invoices in certain organisation
|
|
2168
2202
|
*
|