lago-javascript-client 0.27.1-beta → 0.28.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/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lago JavaScript Client
|
|
2
2
|
|
|
3
|
-
This is a JavaScript wrapper for Lago API. Works in Cloudflare Workers, Deno, and Node.js. Generated from [the Lago
|
|
3
|
+
This is a JavaScript wrapper for Lago API. Works in Cloudflare Workers, Deno, and Node.js. Generated from [the Lago OpenAPI document](https://swagger.getlago.com/#/).
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/js/lago-javascript-client)
|
|
6
6
|
[](https://spdx.org/licenses/MIT.html)
|
|
@@ -76,10 +76,10 @@ Change the affected fields in `scripts/build_npm.ts` and commit to GitHub. GitHu
|
|
|
76
76
|
|
|
77
77
|
Requires [Deno](https://deno.land/) and [Node.js >= 18](https://nodejs.org/en/)
|
|
78
78
|
|
|
79
|
-
### Generate client from
|
|
79
|
+
### Generate client from OpenAPI
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
deno task generate:
|
|
82
|
+
deno task generate:openapi
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
### Run tests
|
package/esm/mod.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// deno-lint-ignore-file no-explicit-any
|
|
2
|
-
import { Api } from "./
|
|
2
|
+
import { Api } from "./openapi/client.js";
|
|
3
3
|
export const Client = (apiKey, apiConfig) => {
|
|
4
4
|
const api = new Api({
|
|
5
5
|
securityWorker: (apiKey) => apiKey ? { headers: { Authorization: `Bearer ${apiKey}` } } : {},
|
|
@@ -30,4 +30,4 @@ export async function getLagoError(error) {
|
|
|
30
30
|
}
|
|
31
31
|
throw new Error(error);
|
|
32
32
|
}
|
|
33
|
-
export * from "./
|
|
33
|
+
export * from "./openapi/client.js";
|
|
@@ -148,7 +148,7 @@ export class HttpClient {
|
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* @title Lago API documentation
|
|
151
|
-
* @version 0.
|
|
151
|
+
* @version 0.28.0-beta
|
|
152
152
|
* @baseUrl https://api.getlago.com/api/v1
|
|
153
153
|
* @externalDocs https://github.com/getlago
|
|
154
154
|
* @contact <tech@getlago.com>
|
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.
|
|
7
|
+
"version": "v0.28.0-beta",
|
|
8
8
|
"description": "Lago JavaScript API Client",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/node": "^18.11.9",
|
|
46
46
|
"chalk": "^4.1.2",
|
|
47
|
-
"@deno/shim-deno": "~0.
|
|
47
|
+
"@deno/shim-deno": "~0.14.0",
|
|
48
48
|
"urlpattern-polyfill": "^6.0.2"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/script/mod.js
CHANGED
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.getLagoError = exports.Client = void 0;
|
|
18
18
|
// deno-lint-ignore-file no-explicit-any
|
|
19
|
-
const client_js_1 = require("./
|
|
19
|
+
const client_js_1 = require("./openapi/client.js");
|
|
20
20
|
const Client = (apiKey, apiConfig) => {
|
|
21
21
|
const api = new client_js_1.Api({
|
|
22
22
|
securityWorker: (apiKey) => apiKey ? { headers: { Authorization: `Bearer ${apiKey}` } } : {},
|
|
@@ -49,4 +49,4 @@ async function getLagoError(error) {
|
|
|
49
49
|
throw new Error(error);
|
|
50
50
|
}
|
|
51
51
|
exports.getLagoError = getLagoError;
|
|
52
|
-
__exportStar(require("./
|
|
52
|
+
__exportStar(require("./openapi/client.js"), exports);
|
|
@@ -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.28.0-beta
|
|
156
156
|
* @baseUrl https://api.getlago.com/api/v1
|
|
157
157
|
* @externalDocs https://github.com/getlago
|
|
158
158
|
* @contact <tech@getlago.com>
|
package/types/mod.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Api, ApiConfig, HttpResponse } from "./
|
|
1
|
+
import { Api, ApiConfig, HttpResponse } from "./openapi/client.js";
|
|
2
2
|
export declare const Client: (apiKey: string, apiConfig?: ApiConfig) => Api<unknown>;
|
|
3
3
|
type ExtractLagoError<E> = E extends (...args: any) => Promise<HttpResponse<infer T, infer P>> ? P : never;
|
|
4
4
|
export declare function getLagoError<T>(error: any): Promise<ExtractLagoError<T>>;
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./openapi/client.js";
|
|
@@ -1142,8 +1142,13 @@ export interface WalletObject {
|
|
|
1142
1142
|
rate_amount: number;
|
|
1143
1143
|
/** @example 500 */
|
|
1144
1144
|
credits_balance: number;
|
|
1145
|
-
/**
|
|
1145
|
+
/**
|
|
1146
|
+
* @deprecated
|
|
1147
|
+
* @example 1000
|
|
1148
|
+
*/
|
|
1146
1149
|
balance: number;
|
|
1150
|
+
/** @example 100000 */
|
|
1151
|
+
balance_cents: number;
|
|
1147
1152
|
/** @example 100 */
|
|
1148
1153
|
consumed_credits: number;
|
|
1149
1154
|
/**
|
|
@@ -1513,7 +1518,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
1513
1518
|
}
|
|
1514
1519
|
/**
|
|
1515
1520
|
* @title Lago API documentation
|
|
1516
|
-
* @version 0.
|
|
1521
|
+
* @version 0.28.0-beta
|
|
1517
1522
|
* @baseUrl https://api.getlago.com/api/v1
|
|
1518
1523
|
* @externalDocs https://github.com/getlago
|
|
1519
1524
|
* @contact <tech@getlago.com>
|