@getivy/node-sdk 0.1.0-alpha.2 → 0.1.0-alpha.20
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 +209 -0
- package/LICENSE +1 -1
- package/README.md +18 -18
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +12 -1
- package/core.d.ts.map +1 -1
- package/core.js +29 -20
- package/core.js.map +1 -1
- package/core.mjs +31 -22
- 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 +15 -12
- package/index.d.ts +15 -12
- package/index.d.ts.map +1 -1
- package/index.js +45 -42
- package/index.js.map +1 -1
- package/index.mjs +43 -40
- 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/resources/banks.d.ts +12 -0
- package/resources/banks.d.ts.map +1 -1
- package/resources/charges.d.ts +0 -13
- package/resources/charges.d.ts.map +1 -1
- package/resources/checkoutsession.d.ts +444 -1305
- package/resources/checkoutsession.d.ts.map +1 -1
- package/resources/customers.d.ts +41 -4
- package/resources/customers.d.ts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/orders.d.ts +89 -659
- package/resources/orders.d.ts.map +1 -1
- package/resources/orders.js +0 -6
- package/resources/orders.js.map +1 -1
- package/resources/orders.mjs +0 -6
- package/resources/orders.mjs.map +1 -1
- package/resources/refunds.d.ts +1 -1
- package/resources/refunds.d.ts.map +1 -1
- package/resources/webhooksubscription.d.ts +155 -0
- package/resources/webhooksubscription.d.ts.map +1 -0
- package/resources/webhooksubscription.js +42 -0
- package/resources/webhooksubscription.js.map +1 -0
- package/resources/webhooksubscription.mjs +38 -0
- package/resources/webhooksubscription.mjs.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +18 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/_shims/index.d.ts +2 -0
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +5 -1
- package/src/core.ts +49 -22
- package/src/error.ts +2 -2
- package/src/index.ts +57 -36
- package/src/resource.ts +3 -3
- package/src/resources/banks.ts +15 -0
- package/src/resources/charges.ts +0 -13
- package/src/resources/checkoutsession.ts +2103 -4416
- package/src/resources/customers.ts +46 -4
- package/src/resources/index.ts +14 -7
- package/src/resources/orders.ts +107 -1635
- package/src/resources/refunds.ts +0 -1
- package/src/resources/webhooksubscription.ts +353 -0
- package/src/resources.ts +1 -0
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/core.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VERSION } from './version';
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
IvyError,
|
|
4
4
|
APIError,
|
|
5
5
|
APIConnectionError,
|
|
6
6
|
APIConnectionTimeoutError,
|
|
@@ -16,7 +16,12 @@ import {
|
|
|
16
16
|
type RequestInit,
|
|
17
17
|
type Response,
|
|
18
18
|
type HeadersInit,
|
|
19
|
+
init,
|
|
19
20
|
} from './_shims/index';
|
|
21
|
+
|
|
22
|
+
// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881
|
|
23
|
+
init();
|
|
24
|
+
|
|
20
25
|
export { type Response };
|
|
21
26
|
import { BlobLike, isBlobLike, isMultipartBody } from './uploads';
|
|
22
27
|
export {
|
|
@@ -28,6 +33,20 @@ export {
|
|
|
28
33
|
|
|
29
34
|
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
30
35
|
|
|
36
|
+
/**
|
|
37
|
+
* An alias to the builtin `Array` type so we can
|
|
38
|
+
* easily alias it in import statements if there are name clashes.
|
|
39
|
+
*/
|
|
40
|
+
type _Array<T> = Array<T>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* An alias to the builtin `Record` type so we can
|
|
44
|
+
* easily alias it in import statements if there are name clashes.
|
|
45
|
+
*/
|
|
46
|
+
type _Record<K extends keyof any, T> = Record<K, T>;
|
|
47
|
+
|
|
48
|
+
export type { _Array as Array, _Record as Record };
|
|
49
|
+
|
|
31
50
|
type PromiseOrValue<T> = T | Promise<T>;
|
|
32
51
|
|
|
33
52
|
type APIResponseProps = {
|
|
@@ -48,8 +67,8 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
|
|
|
48
67
|
}
|
|
49
68
|
|
|
50
69
|
const contentType = response.headers.get('content-type');
|
|
51
|
-
const
|
|
52
|
-
|
|
70
|
+
const mediaType = contentType?.split(';')[0]?.trim();
|
|
71
|
+
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
53
72
|
if (isJSON) {
|
|
54
73
|
const json = await response.json();
|
|
55
74
|
|
|
@@ -277,9 +296,10 @@ export abstract class APIClient {
|
|
|
277
296
|
}
|
|
278
297
|
|
|
279
298
|
buildRequest<Req>(
|
|
280
|
-
|
|
299
|
+
inputOptions: FinalRequestOptions<Req>,
|
|
281
300
|
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
282
301
|
): { req: RequestInit; url: string; timeout: number } {
|
|
302
|
+
const options = { ...inputOptions };
|
|
283
303
|
const { method, path, query, headers: headers = {} } = options;
|
|
284
304
|
|
|
285
305
|
const body =
|
|
@@ -292,9 +312,9 @@ export abstract class APIClient {
|
|
|
292
312
|
|
|
293
313
|
const url = this.buildURL(path!, query);
|
|
294
314
|
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
295
|
-
|
|
315
|
+
options.timeout = options.timeout ?? this.timeout;
|
|
296
316
|
const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url);
|
|
297
|
-
const minAgentTimeout = timeout + 1000;
|
|
317
|
+
const minAgentTimeout = options.timeout + 1000;
|
|
298
318
|
if (
|
|
299
319
|
typeof (httpAgent as any)?.options?.timeout === 'number' &&
|
|
300
320
|
minAgentTimeout > ((httpAgent as any).options.timeout ?? 0)
|
|
@@ -307,8 +327,8 @@ export abstract class APIClient {
|
|
|
307
327
|
}
|
|
308
328
|
|
|
309
329
|
if (this.idempotencyHeader && method !== 'get') {
|
|
310
|
-
if (!
|
|
311
|
-
headers[this.idempotencyHeader] =
|
|
330
|
+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
|
|
331
|
+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
|
|
312
332
|
}
|
|
313
333
|
|
|
314
334
|
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });
|
|
@@ -323,7 +343,7 @@ export abstract class APIClient {
|
|
|
323
343
|
signal: options.signal ?? null,
|
|
324
344
|
};
|
|
325
345
|
|
|
326
|
-
return { req, url, timeout };
|
|
346
|
+
return { req, url, timeout: options.timeout };
|
|
327
347
|
}
|
|
328
348
|
|
|
329
349
|
private buildHeaders({
|
|
@@ -351,15 +371,22 @@ export abstract class APIClient {
|
|
|
351
371
|
delete reqHeaders['content-type'];
|
|
352
372
|
}
|
|
353
373
|
|
|
354
|
-
// Don't set
|
|
355
|
-
//
|
|
356
|
-
//
|
|
374
|
+
// Don't set theses headers if they were already set or removed through default headers or by the caller.
|
|
375
|
+
// We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account
|
|
376
|
+
// for the removal case.
|
|
357
377
|
if (
|
|
358
378
|
getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined &&
|
|
359
379
|
getHeader(headers, 'x-stainless-retry-count') === undefined
|
|
360
380
|
) {
|
|
361
381
|
reqHeaders['x-stainless-retry-count'] = String(retryCount);
|
|
362
382
|
}
|
|
383
|
+
if (
|
|
384
|
+
getHeader(defaultHeaders, 'x-stainless-timeout') === undefined &&
|
|
385
|
+
getHeader(headers, 'x-stainless-timeout') === undefined &&
|
|
386
|
+
options.timeout
|
|
387
|
+
) {
|
|
388
|
+
reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000));
|
|
389
|
+
}
|
|
363
390
|
|
|
364
391
|
this.validateHeaders(reqHeaders, headers);
|
|
365
392
|
|
|
@@ -387,7 +414,7 @@ export abstract class APIClient {
|
|
|
387
414
|
!headers ? {}
|
|
388
415
|
: Symbol.iterator in headers ?
|
|
389
416
|
Object.fromEntries(Array.from(headers as Iterable<string[]>).map((header) => [...header]))
|
|
390
|
-
: { ...headers }
|
|
417
|
+
: { ...(headers as any as Record<string, string>) }
|
|
391
418
|
);
|
|
392
419
|
}
|
|
393
420
|
|
|
@@ -504,7 +531,7 @@ export abstract class APIClient {
|
|
|
504
531
|
if (value === null) {
|
|
505
532
|
return `${encodeURIComponent(key)}=`;
|
|
506
533
|
}
|
|
507
|
-
throw new
|
|
534
|
+
throw new IvyError(
|
|
508
535
|
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
509
536
|
);
|
|
510
537
|
})
|
|
@@ -654,7 +681,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
|
654
681
|
async getNextPage(): Promise<this> {
|
|
655
682
|
const nextInfo = this.nextPageInfo();
|
|
656
683
|
if (!nextInfo) {
|
|
657
|
-
throw new
|
|
684
|
+
throw new IvyError(
|
|
658
685
|
'No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.',
|
|
659
686
|
);
|
|
660
687
|
}
|
|
@@ -990,10 +1017,10 @@ export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve
|
|
|
990
1017
|
|
|
991
1018
|
const validatePositiveInteger = (name: string, n: unknown): number => {
|
|
992
1019
|
if (typeof n !== 'number' || !Number.isInteger(n)) {
|
|
993
|
-
throw new
|
|
1020
|
+
throw new IvyError(`${name} must be an integer`);
|
|
994
1021
|
}
|
|
995
1022
|
if (n < 0) {
|
|
996
|
-
throw new
|
|
1023
|
+
throw new IvyError(`${name} must be a positive integer`);
|
|
997
1024
|
}
|
|
998
1025
|
return n;
|
|
999
1026
|
};
|
|
@@ -1009,7 +1036,7 @@ export const castToError = (err: any): Error => {
|
|
|
1009
1036
|
};
|
|
1010
1037
|
|
|
1011
1038
|
export const ensurePresent = <T>(value: T | null | undefined): T => {
|
|
1012
|
-
if (value == null) throw new
|
|
1039
|
+
if (value == null) throw new IvyError(`Expected a value to be given but received ${value} instead.`);
|
|
1013
1040
|
return value;
|
|
1014
1041
|
};
|
|
1015
1042
|
|
|
@@ -1034,14 +1061,14 @@ export const coerceInteger = (value: unknown): number => {
|
|
|
1034
1061
|
if (typeof value === 'number') return Math.round(value);
|
|
1035
1062
|
if (typeof value === 'string') return parseInt(value, 10);
|
|
1036
1063
|
|
|
1037
|
-
throw new
|
|
1064
|
+
throw new IvyError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
1038
1065
|
};
|
|
1039
1066
|
|
|
1040
1067
|
export const coerceFloat = (value: unknown): number => {
|
|
1041
1068
|
if (typeof value === 'number') return value;
|
|
1042
1069
|
if (typeof value === 'string') return parseFloat(value);
|
|
1043
1070
|
|
|
1044
|
-
throw new
|
|
1071
|
+
throw new IvyError(`Could not coerce ${value} (type: ${typeof value}) into a number`);
|
|
1045
1072
|
};
|
|
1046
1073
|
|
|
1047
1074
|
export const coerceBoolean = (value: unknown): boolean => {
|
|
@@ -1107,7 +1134,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void {
|
|
|
1107
1134
|
|
|
1108
1135
|
export function debug(action: string, ...args: any[]) {
|
|
1109
1136
|
if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') {
|
|
1110
|
-
console.log(`
|
|
1137
|
+
console.log(`Ivy:DEBUG:${action}`, ...args);
|
|
1111
1138
|
}
|
|
1112
1139
|
}
|
|
1113
1140
|
|
|
@@ -1192,7 +1219,7 @@ export const toBase64 = (str: string | null | undefined): string => {
|
|
|
1192
1219
|
return btoa(str);
|
|
1193
1220
|
}
|
|
1194
1221
|
|
|
1195
|
-
throw new
|
|
1222
|
+
throw new IvyError('Cannot generate b64 string; Expected `Buffer` or `btoa` to be defined');
|
|
1196
1223
|
};
|
|
1197
1224
|
|
|
1198
1225
|
export function isObj(obj: unknown): obj is Record<string, unknown> {
|
package/src/error.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { castToError, Headers } from './core';
|
|
4
4
|
|
|
5
|
-
export class
|
|
5
|
+
export class IvyError extends Error {}
|
|
6
6
|
|
|
7
7
|
export class APIError<
|
|
8
8
|
TStatus extends number | undefined = number | undefined,
|
|
9
9
|
THeaders extends Headers | undefined = Headers | undefined,
|
|
10
10
|
TError extends Object | undefined = Object | undefined,
|
|
11
|
-
> extends
|
|
11
|
+
> extends IvyError {
|
|
12
12
|
/** HTTP status for the response that caused the error */
|
|
13
13
|
readonly status: TStatus;
|
|
14
14
|
/** HTTP headers for the response that caused the error */
|
package/src/index.ts
CHANGED
|
@@ -41,13 +41,7 @@ import {
|
|
|
41
41
|
MandateRevokeResponse,
|
|
42
42
|
Mandates,
|
|
43
43
|
} from './resources/mandates';
|
|
44
|
-
import {
|
|
45
|
-
OrderRetrieveParams,
|
|
46
|
-
OrderRetrieveResponse,
|
|
47
|
-
OrderUpdateParams,
|
|
48
|
-
OrderUpdateResponse,
|
|
49
|
-
Orders,
|
|
50
|
-
} from './resources/orders';
|
|
44
|
+
import { OrderRetrieveParams, OrderRetrieveResponse, Orders } from './resources/orders';
|
|
51
45
|
import {
|
|
52
46
|
PayoutCreateParams,
|
|
53
47
|
PayoutListParams,
|
|
@@ -78,6 +72,19 @@ import {
|
|
|
78
72
|
SubaccountRetrieveParams,
|
|
79
73
|
Subaccounts,
|
|
80
74
|
} from './resources/subaccounts';
|
|
75
|
+
import {
|
|
76
|
+
Webhooksubscription,
|
|
77
|
+
WebhooksubscriptionCreateParams,
|
|
78
|
+
WebhooksubscriptionCreateResponse,
|
|
79
|
+
WebhooksubscriptionDeleteParams,
|
|
80
|
+
WebhooksubscriptionDeleteResponse,
|
|
81
|
+
WebhooksubscriptionListParams,
|
|
82
|
+
WebhooksubscriptionListResponse,
|
|
83
|
+
WebhooksubscriptionPingParams,
|
|
84
|
+
WebhooksubscriptionPingResponse,
|
|
85
|
+
WebhooksubscriptionUpdateParams,
|
|
86
|
+
WebhooksubscriptionUpdateResponse,
|
|
87
|
+
} from './resources/webhooksubscription';
|
|
81
88
|
|
|
82
89
|
const environments = {
|
|
83
90
|
production: 'https://api.getivy.de',
|
|
@@ -103,7 +110,7 @@ export interface ClientOptions {
|
|
|
103
110
|
/**
|
|
104
111
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
105
112
|
*
|
|
106
|
-
* Defaults to process.env['
|
|
113
|
+
* Defaults to process.env['IVY_BASE_URL'].
|
|
107
114
|
*/
|
|
108
115
|
baseURL?: string | null | undefined;
|
|
109
116
|
|
|
@@ -158,19 +165,19 @@ export interface ClientOptions {
|
|
|
158
165
|
}
|
|
159
166
|
|
|
160
167
|
/**
|
|
161
|
-
* API Client for interfacing with the
|
|
168
|
+
* API Client for interfacing with the Ivy API.
|
|
162
169
|
*/
|
|
163
|
-
export class
|
|
170
|
+
export class Ivy extends Core.APIClient {
|
|
164
171
|
apiKey: string;
|
|
165
172
|
|
|
166
173
|
private _options: ClientOptions;
|
|
167
174
|
|
|
168
175
|
/**
|
|
169
|
-
* API Client for interfacing with the
|
|
176
|
+
* API Client for interfacing with the Ivy API.
|
|
170
177
|
*
|
|
171
178
|
* @param {string | undefined} [opts.apiKey=process.env['IVY_API_KEY'] ?? undefined]
|
|
172
179
|
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
173
|
-
* @param {string} [opts.baseURL=process.env['
|
|
180
|
+
* @param {string} [opts.baseURL=process.env['IVY_BASE_URL'] ?? https://api.getivy.de] - Override the default base URL for the API.
|
|
174
181
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
175
182
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
176
183
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -179,13 +186,13 @@ export class Getivy extends Core.APIClient {
|
|
|
179
186
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
180
187
|
*/
|
|
181
188
|
constructor({
|
|
182
|
-
baseURL = Core.readEnv('
|
|
189
|
+
baseURL = Core.readEnv('IVY_BASE_URL'),
|
|
183
190
|
apiKey = Core.readEnv('IVY_API_KEY'),
|
|
184
191
|
...opts
|
|
185
192
|
}: ClientOptions = {}) {
|
|
186
193
|
if (apiKey === undefined) {
|
|
187
|
-
throw new Errors.
|
|
188
|
-
"The IVY_API_KEY environment variable is missing or empty; either provide it, or instantiate the
|
|
194
|
+
throw new Errors.IvyError(
|
|
195
|
+
"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
196
|
);
|
|
190
197
|
}
|
|
191
198
|
|
|
@@ -197,8 +204,8 @@ export class Getivy extends Core.APIClient {
|
|
|
197
204
|
};
|
|
198
205
|
|
|
199
206
|
if (baseURL && opts.environment) {
|
|
200
|
-
throw new Errors.
|
|
201
|
-
'Ambiguous URL; The `baseURL` option (or
|
|
207
|
+
throw new Errors.IvyError(
|
|
208
|
+
'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
209
|
);
|
|
203
210
|
}
|
|
204
211
|
|
|
@@ -227,6 +234,7 @@ export class Getivy extends Core.APIClient {
|
|
|
227
234
|
reports: API.Reports = new API.Reports(this);
|
|
228
235
|
subaccounts: API.Subaccounts = new API.Subaccounts(this);
|
|
229
236
|
balance: API.Balance = new API.Balance(this);
|
|
237
|
+
webhooksubscription: API.Webhooksubscription = new API.Webhooksubscription(this);
|
|
230
238
|
|
|
231
239
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
232
240
|
return this._options.defaultQuery;
|
|
@@ -243,10 +251,10 @@ export class Getivy extends Core.APIClient {
|
|
|
243
251
|
return { 'X-Ivy-Api-Key': this.apiKey };
|
|
244
252
|
}
|
|
245
253
|
|
|
246
|
-
static
|
|
254
|
+
static Ivy = this;
|
|
247
255
|
static DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
248
256
|
|
|
249
|
-
static
|
|
257
|
+
static IvyError = Errors.IvyError;
|
|
250
258
|
static APIError = Errors.APIError;
|
|
251
259
|
static APIConnectionError = Errors.APIConnectionError;
|
|
252
260
|
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
@@ -264,19 +272,20 @@ export class Getivy extends Core.APIClient {
|
|
|
264
272
|
static fileFromPath = Uploads.fileFromPath;
|
|
265
273
|
}
|
|
266
274
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
Ivy.Banks = Banks;
|
|
276
|
+
Ivy.Checkoutsession = Checkoutsession;
|
|
277
|
+
Ivy.Customers = Customers;
|
|
278
|
+
Ivy.Orders = Orders;
|
|
279
|
+
Ivy.Charges = Charges;
|
|
280
|
+
Ivy.Mandates = Mandates;
|
|
281
|
+
Ivy.Capabilities = Capabilities;
|
|
282
|
+
Ivy.Refunds = Refunds;
|
|
283
|
+
Ivy.Payouts = Payouts;
|
|
284
|
+
Ivy.Reports = Reports;
|
|
285
|
+
Ivy.Subaccounts = Subaccounts;
|
|
286
|
+
Ivy.Balance = Balance;
|
|
287
|
+
Ivy.Webhooksubscription = Webhooksubscription;
|
|
288
|
+
export declare namespace Ivy {
|
|
280
289
|
export type RequestOptions = Core.RequestOptions;
|
|
281
290
|
|
|
282
291
|
export {
|
|
@@ -310,9 +319,7 @@ export declare namespace Getivy {
|
|
|
310
319
|
export {
|
|
311
320
|
Orders as Orders,
|
|
312
321
|
type OrderRetrieveResponse as OrderRetrieveResponse,
|
|
313
|
-
type OrderUpdateResponse as OrderUpdateResponse,
|
|
314
322
|
type OrderRetrieveParams as OrderRetrieveParams,
|
|
315
|
-
type OrderUpdateParams as OrderUpdateParams,
|
|
316
323
|
};
|
|
317
324
|
|
|
318
325
|
export { Charges as Charges, type Charge as Charge, type ChargeCreateParams as ChargeCreateParams };
|
|
@@ -371,11 +378,25 @@ export declare namespace Getivy {
|
|
|
371
378
|
type BalanceRetrieveResponse as BalanceRetrieveResponse,
|
|
372
379
|
type BalanceRetrieveParams as BalanceRetrieveParams,
|
|
373
380
|
};
|
|
381
|
+
|
|
382
|
+
export {
|
|
383
|
+
Webhooksubscription as Webhooksubscription,
|
|
384
|
+
type WebhooksubscriptionCreateResponse as WebhooksubscriptionCreateResponse,
|
|
385
|
+
type WebhooksubscriptionUpdateResponse as WebhooksubscriptionUpdateResponse,
|
|
386
|
+
type WebhooksubscriptionListResponse as WebhooksubscriptionListResponse,
|
|
387
|
+
type WebhooksubscriptionDeleteResponse as WebhooksubscriptionDeleteResponse,
|
|
388
|
+
type WebhooksubscriptionPingResponse as WebhooksubscriptionPingResponse,
|
|
389
|
+
type WebhooksubscriptionCreateParams as WebhooksubscriptionCreateParams,
|
|
390
|
+
type WebhooksubscriptionUpdateParams as WebhooksubscriptionUpdateParams,
|
|
391
|
+
type WebhooksubscriptionListParams as WebhooksubscriptionListParams,
|
|
392
|
+
type WebhooksubscriptionDeleteParams as WebhooksubscriptionDeleteParams,
|
|
393
|
+
type WebhooksubscriptionPingParams as WebhooksubscriptionPingParams,
|
|
394
|
+
};
|
|
374
395
|
}
|
|
375
396
|
|
|
376
397
|
export { toFile, fileFromPath } from './uploads';
|
|
377
398
|
export {
|
|
378
|
-
|
|
399
|
+
IvyError,
|
|
379
400
|
APIError,
|
|
380
401
|
APIConnectionError,
|
|
381
402
|
APIConnectionTimeoutError,
|
|
@@ -390,4 +411,4 @@ export {
|
|
|
390
411
|
UnprocessableEntityError,
|
|
391
412
|
} from './error';
|
|
392
413
|
|
|
393
|
-
export default
|
|
414
|
+
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/resources/banks.ts
CHANGED
|
@@ -307,6 +307,11 @@ export interface BankRetrieveResponse {
|
|
|
307
307
|
*/
|
|
308
308
|
name: string;
|
|
309
309
|
|
|
310
|
+
/**
|
|
311
|
+
* The payment schemes supported by the bank.
|
|
312
|
+
*/
|
|
313
|
+
supportedPaymentSchemes: Array<'SEPA_INSTANT' | 'FASTER_PAYMENTS' | 'SEPA' | 'ELIXIR' | 'EXPRESS_ELIXIR'>;
|
|
314
|
+
|
|
310
315
|
/**
|
|
311
316
|
* If true, the bank is only available in test (sandbox) mode.
|
|
312
317
|
*/
|
|
@@ -616,6 +621,11 @@ export namespace BankListResponse {
|
|
|
616
621
|
*/
|
|
617
622
|
name: string;
|
|
618
623
|
|
|
624
|
+
/**
|
|
625
|
+
* The payment schemes supported by the bank.
|
|
626
|
+
*/
|
|
627
|
+
supportedPaymentSchemes: Array<'SEPA_INSTANT' | 'FASTER_PAYMENTS' | 'SEPA' | 'ELIXIR' | 'EXPRESS_ELIXIR'>;
|
|
628
|
+
|
|
619
629
|
/**
|
|
620
630
|
* If true, the bank is only available in test (sandbox) mode.
|
|
621
631
|
*/
|
|
@@ -926,6 +936,11 @@ export namespace BankSearchResponse {
|
|
|
926
936
|
*/
|
|
927
937
|
name: string;
|
|
928
938
|
|
|
939
|
+
/**
|
|
940
|
+
* The payment schemes supported by the bank.
|
|
941
|
+
*/
|
|
942
|
+
supportedPaymentSchemes: Array<'SEPA_INSTANT' | 'FASTER_PAYMENTS' | 'SEPA' | 'ELIXIR' | 'EXPRESS_ELIXIR'>;
|
|
943
|
+
|
|
929
944
|
/**
|
|
930
945
|
* If true, the bank is only available in test (sandbox) mode.
|
|
931
946
|
*/
|
package/src/resources/charges.ts
CHANGED
|
@@ -69,25 +69,12 @@ export namespace ChargeCreateParams {
|
|
|
69
69
|
*/
|
|
70
70
|
total: number;
|
|
71
71
|
|
|
72
|
-
/**
|
|
73
|
-
* The shipping amount.
|
|
74
|
-
*/
|
|
75
72
|
shipping?: number;
|
|
76
73
|
|
|
77
|
-
/**
|
|
78
|
-
* The subtotal amount, i.e. the total amount without VAT and shipping.
|
|
79
|
-
*/
|
|
80
74
|
subTotal?: number;
|
|
81
75
|
|
|
82
|
-
/**
|
|
83
|
-
* The total net amount, i.e. the total amount without VAT. This value is rounded
|
|
84
|
-
* to 2 decimal places for the actual transfer.
|
|
85
|
-
*/
|
|
86
76
|
totalNet?: number;
|
|
87
77
|
|
|
88
|
-
/**
|
|
89
|
-
* The VAT amount.
|
|
90
|
-
*/
|
|
91
78
|
vat?: number;
|
|
92
79
|
}
|
|
93
80
|
|