@getivy/node-sdk 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +217 -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 +42 -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/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 +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/orders.d.ts +243 -101
- package/resources/orders.d.ts.map +1 -1
- package/resources/orders.js +6 -6
- package/resources/orders.js.map +1 -1
- package/resources/orders.mjs +6 -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 +60 -31
- 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 +15 -2
- package/src/resources/orders.ts +288 -118
- 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
|
@@ -42,10 +42,10 @@ import {
|
|
|
42
42
|
Mandates,
|
|
43
43
|
} from './resources/mandates';
|
|
44
44
|
import {
|
|
45
|
+
OrderCreateParams,
|
|
46
|
+
OrderCreateResponse,
|
|
45
47
|
OrderRetrieveParams,
|
|
46
48
|
OrderRetrieveResponse,
|
|
47
|
-
OrderUpdateParams,
|
|
48
|
-
OrderUpdateResponse,
|
|
49
49
|
Orders,
|
|
50
50
|
} from './resources/orders';
|
|
51
51
|
import {
|
|
@@ -78,6 +78,19 @@ import {
|
|
|
78
78
|
SubaccountRetrieveParams,
|
|
79
79
|
Subaccounts,
|
|
80
80
|
} from './resources/subaccounts';
|
|
81
|
+
import {
|
|
82
|
+
Webhooksubscription,
|
|
83
|
+
WebhooksubscriptionCreateParams,
|
|
84
|
+
WebhooksubscriptionCreateResponse,
|
|
85
|
+
WebhooksubscriptionDeleteParams,
|
|
86
|
+
WebhooksubscriptionDeleteResponse,
|
|
87
|
+
WebhooksubscriptionListParams,
|
|
88
|
+
WebhooksubscriptionListResponse,
|
|
89
|
+
WebhooksubscriptionPingParams,
|
|
90
|
+
WebhooksubscriptionPingResponse,
|
|
91
|
+
WebhooksubscriptionUpdateParams,
|
|
92
|
+
WebhooksubscriptionUpdateResponse,
|
|
93
|
+
} from './resources/webhooksubscription';
|
|
81
94
|
|
|
82
95
|
const environments = {
|
|
83
96
|
production: 'https://api.getivy.de',
|
|
@@ -103,7 +116,7 @@ export interface ClientOptions {
|
|
|
103
116
|
/**
|
|
104
117
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
105
118
|
*
|
|
106
|
-
* Defaults to process.env['
|
|
119
|
+
* Defaults to process.env['IVY_BASE_URL'].
|
|
107
120
|
*/
|
|
108
121
|
baseURL?: string | null | undefined;
|
|
109
122
|
|
|
@@ -158,19 +171,19 @@ export interface ClientOptions {
|
|
|
158
171
|
}
|
|
159
172
|
|
|
160
173
|
/**
|
|
161
|
-
* API Client for interfacing with the
|
|
174
|
+
* API Client for interfacing with the Ivy API.
|
|
162
175
|
*/
|
|
163
|
-
export class
|
|
176
|
+
export class Ivy extends Core.APIClient {
|
|
164
177
|
apiKey: string;
|
|
165
178
|
|
|
166
179
|
private _options: ClientOptions;
|
|
167
180
|
|
|
168
181
|
/**
|
|
169
|
-
* API Client for interfacing with the
|
|
182
|
+
* API Client for interfacing with the Ivy API.
|
|
170
183
|
*
|
|
171
184
|
* @param {string | undefined} [opts.apiKey=process.env['IVY_API_KEY'] ?? undefined]
|
|
172
185
|
* @param {Environment} [opts.environment=production] - Specifies the environment URL to use for the API.
|
|
173
|
-
* @param {string} [opts.baseURL=process.env['
|
|
186
|
+
* @param {string} [opts.baseURL=process.env['IVY_BASE_URL'] ?? https://api.getivy.de] - Override the default base URL for the API.
|
|
174
187
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
175
188
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
176
189
|
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
@@ -179,13 +192,13 @@ export class Getivy extends Core.APIClient {
|
|
|
179
192
|
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
180
193
|
*/
|
|
181
194
|
constructor({
|
|
182
|
-
baseURL = Core.readEnv('
|
|
195
|
+
baseURL = Core.readEnv('IVY_BASE_URL'),
|
|
183
196
|
apiKey = Core.readEnv('IVY_API_KEY'),
|
|
184
197
|
...opts
|
|
185
198
|
}: ClientOptions = {}) {
|
|
186
199
|
if (apiKey === undefined) {
|
|
187
|
-
throw new Errors.
|
|
188
|
-
"The IVY_API_KEY environment variable is missing or empty; either provide it, or instantiate the
|
|
200
|
+
throw new Errors.IvyError(
|
|
201
|
+
"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
202
|
);
|
|
190
203
|
}
|
|
191
204
|
|
|
@@ -197,8 +210,8 @@ export class Getivy extends Core.APIClient {
|
|
|
197
210
|
};
|
|
198
211
|
|
|
199
212
|
if (baseURL && opts.environment) {
|
|
200
|
-
throw new Errors.
|
|
201
|
-
'Ambiguous URL; The `baseURL` option (or
|
|
213
|
+
throw new Errors.IvyError(
|
|
214
|
+
'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
215
|
);
|
|
203
216
|
}
|
|
204
217
|
|
|
@@ -227,6 +240,7 @@ export class Getivy extends Core.APIClient {
|
|
|
227
240
|
reports: API.Reports = new API.Reports(this);
|
|
228
241
|
subaccounts: API.Subaccounts = new API.Subaccounts(this);
|
|
229
242
|
balance: API.Balance = new API.Balance(this);
|
|
243
|
+
webhooksubscription: API.Webhooksubscription = new API.Webhooksubscription(this);
|
|
230
244
|
|
|
231
245
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
232
246
|
return this._options.defaultQuery;
|
|
@@ -243,10 +257,10 @@ export class Getivy extends Core.APIClient {
|
|
|
243
257
|
return { 'X-Ivy-Api-Key': this.apiKey };
|
|
244
258
|
}
|
|
245
259
|
|
|
246
|
-
static
|
|
260
|
+
static Ivy = this;
|
|
247
261
|
static DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
248
262
|
|
|
249
|
-
static
|
|
263
|
+
static IvyError = Errors.IvyError;
|
|
250
264
|
static APIError = Errors.APIError;
|
|
251
265
|
static APIConnectionError = Errors.APIConnectionError;
|
|
252
266
|
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
@@ -264,19 +278,20 @@ export class Getivy extends Core.APIClient {
|
|
|
264
278
|
static fileFromPath = Uploads.fileFromPath;
|
|
265
279
|
}
|
|
266
280
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
281
|
+
Ivy.Banks = Banks;
|
|
282
|
+
Ivy.Checkoutsession = Checkoutsession;
|
|
283
|
+
Ivy.Customers = Customers;
|
|
284
|
+
Ivy.Orders = Orders;
|
|
285
|
+
Ivy.Charges = Charges;
|
|
286
|
+
Ivy.Mandates = Mandates;
|
|
287
|
+
Ivy.Capabilities = Capabilities;
|
|
288
|
+
Ivy.Refunds = Refunds;
|
|
289
|
+
Ivy.Payouts = Payouts;
|
|
290
|
+
Ivy.Reports = Reports;
|
|
291
|
+
Ivy.Subaccounts = Subaccounts;
|
|
292
|
+
Ivy.Balance = Balance;
|
|
293
|
+
Ivy.Webhooksubscription = Webhooksubscription;
|
|
294
|
+
export declare namespace Ivy {
|
|
280
295
|
export type RequestOptions = Core.RequestOptions;
|
|
281
296
|
|
|
282
297
|
export {
|
|
@@ -309,10 +324,10 @@ export declare namespace Getivy {
|
|
|
309
324
|
|
|
310
325
|
export {
|
|
311
326
|
Orders as Orders,
|
|
327
|
+
type OrderCreateResponse as OrderCreateResponse,
|
|
312
328
|
type OrderRetrieveResponse as OrderRetrieveResponse,
|
|
313
|
-
type
|
|
329
|
+
type OrderCreateParams as OrderCreateParams,
|
|
314
330
|
type OrderRetrieveParams as OrderRetrieveParams,
|
|
315
|
-
type OrderUpdateParams as OrderUpdateParams,
|
|
316
331
|
};
|
|
317
332
|
|
|
318
333
|
export { Charges as Charges, type Charge as Charge, type ChargeCreateParams as ChargeCreateParams };
|
|
@@ -371,11 +386,25 @@ export declare namespace Getivy {
|
|
|
371
386
|
type BalanceRetrieveResponse as BalanceRetrieveResponse,
|
|
372
387
|
type BalanceRetrieveParams as BalanceRetrieveParams,
|
|
373
388
|
};
|
|
389
|
+
|
|
390
|
+
export {
|
|
391
|
+
Webhooksubscription as Webhooksubscription,
|
|
392
|
+
type WebhooksubscriptionCreateResponse as WebhooksubscriptionCreateResponse,
|
|
393
|
+
type WebhooksubscriptionUpdateResponse as WebhooksubscriptionUpdateResponse,
|
|
394
|
+
type WebhooksubscriptionListResponse as WebhooksubscriptionListResponse,
|
|
395
|
+
type WebhooksubscriptionDeleteResponse as WebhooksubscriptionDeleteResponse,
|
|
396
|
+
type WebhooksubscriptionPingResponse as WebhooksubscriptionPingResponse,
|
|
397
|
+
type WebhooksubscriptionCreateParams as WebhooksubscriptionCreateParams,
|
|
398
|
+
type WebhooksubscriptionUpdateParams as WebhooksubscriptionUpdateParams,
|
|
399
|
+
type WebhooksubscriptionListParams as WebhooksubscriptionListParams,
|
|
400
|
+
type WebhooksubscriptionDeleteParams as WebhooksubscriptionDeleteParams,
|
|
401
|
+
type WebhooksubscriptionPingParams as WebhooksubscriptionPingParams,
|
|
402
|
+
};
|
|
374
403
|
}
|
|
375
404
|
|
|
376
405
|
export { toFile, fileFromPath } from './uploads';
|
|
377
406
|
export {
|
|
378
|
-
|
|
407
|
+
IvyError,
|
|
379
408
|
APIError,
|
|
380
409
|
APIConnectionError,
|
|
381
410
|
APIConnectionTimeoutError,
|
|
@@ -390,4 +419,4 @@ export {
|
|
|
390
419
|
UnprocessableEntityError,
|
|
391
420
|
} from './error';
|
|
392
421
|
|
|
393
|
-
export default
|
|
422
|
+
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
|
|