@getivy/node-sdk 0.1.0-alpha.2 → 0.1.0-alpha.3
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/CHANGELOG.md +8 -0
- package/LICENSE +1 -1
- package/README.md +17 -17
- package/core.js +9 -9
- package/core.js.map +1 -1
- package/core.mjs +10 -10
- package/core.mjs.map +1 -1
- package/error.d.ts +2 -2
- package/error.d.ts.map +1 -1
- package/error.js +4 -4
- package/error.js.map +1 -1
- package/error.mjs +2 -2
- package/error.mjs.map +1 -1
- package/index.d.mts +10 -10
- package/index.d.ts +10 -10
- package/index.d.ts.map +1 -1
- package/index.js +42 -42
- package/index.js.map +1 -1
- package/index.mjs +39 -39
- package/index.mjs.map +1 -1
- package/package.json +3 -3
- package/resource.d.ts +3 -3
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/src/core.ts +10 -10
- package/src/error.ts +2 -2
- package/src/index.ts +27 -27
- package/src/resource.ts +3 -3
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/index.ts
CHANGED
|
@@ -103,7 +103,7 @@ export interface ClientOptions {
|
|
|
103
103
|
/**
|
|
104
104
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
105
105
|
*
|
|
106
|
-
* Defaults to process.env['
|
|
106
|
+
* Defaults to process.env['IVY_BASE_URL'].
|
|
107
107
|
*/
|
|
108
108
|
baseURL?: string | null | undefined;
|
|
109
109
|
|
|
@@ -158,19 +158,19 @@ export interface ClientOptions {
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* API Client for interfacing with the
|
|
161
|
+
* API Client for interfacing with the Ivy API.
|
|
162
162
|
*/
|
|
163
|
-
export class
|
|
163
|
+
export class Ivy extends Core.APIClient {
|
|
164
164
|
apiKey: string;
|
|
165
165
|
|
|
166
166
|
private _options: ClientOptions;
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* API Client for interfacing with the
|
|
169
|
+
* API Client for interfacing with the Ivy API.
|
|
170
170
|
*
|
|
171
171
|
* @param {string | undefined} [opts.apiKey=process.env['IVY_API_KEY'] ?? undefined]
|
|
172
172
|
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
173
|
-
* @param {string} [opts.baseURL=process.env['
|
|
173
|
+
* @param {string} [opts.baseURL=process.env['IVY_BASE_URL'] ?? https://api.getivy.de] - Override the default base URL for the API.
|
|
174
174
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
175
175
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
176
176
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -179,13 +179,13 @@ export class Getivy extends Core.APIClient {
|
|
|
179
179
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
180
180
|
*/
|
|
181
181
|
constructor({
|
|
182
|
-
baseURL = Core.readEnv('
|
|
182
|
+
baseURL = Core.readEnv('IVY_BASE_URL'),
|
|
183
183
|
apiKey = Core.readEnv('IVY_API_KEY'),
|
|
184
184
|
...opts
|
|
185
185
|
}: ClientOptions = {}) {
|
|
186
186
|
if (apiKey === undefined) {
|
|
187
|
-
throw new Errors.
|
|
188
|
-
"The IVY_API_KEY environment variable is missing or empty; either provide it, or instantiate the
|
|
187
|
+
throw new Errors.IvyError(
|
|
188
|
+
"The IVY_API_KEY environment variable is missing or empty; either provide it, or instantiate the Ivy client with an apiKey option, like new Ivy({ apiKey: 'My API Key' }).",
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
191
|
|
|
@@ -197,8 +197,8 @@ export class Getivy extends Core.APIClient {
|
|
|
197
197
|
};
|
|
198
198
|
|
|
199
199
|
if (baseURL && opts.environment) {
|
|
200
|
-
throw new Errors.
|
|
201
|
-
'Ambiguous URL; The `baseURL` option (or
|
|
200
|
+
throw new Errors.IvyError(
|
|
201
|
+
'Ambiguous URL; The `baseURL` option (or IVY_BASE_URL env var) and the `environment` option are given. If you want to use the environment you must pass baseURL: null',
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -243,10 +243,10 @@ export class Getivy extends Core.APIClient {
|
|
|
243
243
|
return { 'X-Ivy-Api-Key': this.apiKey };
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
static
|
|
246
|
+
static Ivy = this;
|
|
247
247
|
static DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
248
248
|
|
|
249
|
-
static
|
|
249
|
+
static IvyError = Errors.IvyError;
|
|
250
250
|
static APIError = Errors.APIError;
|
|
251
251
|
static APIConnectionError = Errors.APIConnectionError;
|
|
252
252
|
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
@@ -264,19 +264,19 @@ export class Getivy extends Core.APIClient {
|
|
|
264
264
|
static fileFromPath = Uploads.fileFromPath;
|
|
265
265
|
}
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
export declare namespace
|
|
267
|
+
Ivy.Banks = Banks;
|
|
268
|
+
Ivy.Checkoutsession = Checkoutsession;
|
|
269
|
+
Ivy.Customers = Customers;
|
|
270
|
+
Ivy.Orders = Orders;
|
|
271
|
+
Ivy.Charges = Charges;
|
|
272
|
+
Ivy.Mandates = Mandates;
|
|
273
|
+
Ivy.Capabilities = Capabilities;
|
|
274
|
+
Ivy.Refunds = Refunds;
|
|
275
|
+
Ivy.Payouts = Payouts;
|
|
276
|
+
Ivy.Reports = Reports;
|
|
277
|
+
Ivy.Subaccounts = Subaccounts;
|
|
278
|
+
Ivy.Balance = Balance;
|
|
279
|
+
export declare namespace Ivy {
|
|
280
280
|
export type RequestOptions = Core.RequestOptions;
|
|
281
281
|
|
|
282
282
|
export {
|
|
@@ -375,7 +375,7 @@ export declare namespace Getivy {
|
|
|
375
375
|
|
|
376
376
|
export { toFile, fileFromPath } from './uploads';
|
|
377
377
|
export {
|
|
378
|
-
|
|
378
|
+
IvyError,
|
|
379
379
|
APIError,
|
|
380
380
|
APIConnectionError,
|
|
381
381
|
APIConnectionTimeoutError,
|
|
@@ -390,4 +390,4 @@ export {
|
|
|
390
390
|
UnprocessableEntityError,
|
|
391
391
|
} from './error';
|
|
392
392
|
|
|
393
|
-
export default
|
|
393
|
+
export default Ivy;
|
package/src/resource.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { Ivy } from './index';
|
|
4
4
|
|
|
5
5
|
export class APIResource {
|
|
6
|
-
protected _client:
|
|
6
|
+
protected _client: Ivy;
|
|
7
7
|
|
|
8
|
-
constructor(client:
|
|
8
|
+
constructor(client: Ivy) {
|
|
9
9
|
this._client = client;
|
|
10
10
|
}
|
|
11
11
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|