routex-client 0.4.2 → 0.4.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/README.md +6 -0
- package/client.d.ts +703 -0
- package/index.d.ts +1 -703
- package/index.js +67 -54
- package/package.json +2 -1
package/README.md
CHANGED
package/client.d.ts
ADDED
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
export declare enum AccountField {
|
|
2
|
+
Iban = "IBAN",
|
|
3
|
+
Number = "NUMBER",
|
|
4
|
+
Bic = "BIC",
|
|
5
|
+
BankCode = "BANKCODE",
|
|
6
|
+
Currency = "CURRENCY",
|
|
7
|
+
Name = "NAME",
|
|
8
|
+
DisplayName = "DISPLAYNAME",
|
|
9
|
+
OwnerName = "OWNERNAME",
|
|
10
|
+
ProductName = "PRODUCTNAME",
|
|
11
|
+
Status = "STATUS",
|
|
12
|
+
Type = "TYPE"
|
|
13
|
+
}
|
|
14
|
+
export declare enum AccountStatus {
|
|
15
|
+
Available = "AVAILABLE",
|
|
16
|
+
Terminated = "TERMINATED",
|
|
17
|
+
Blocked = "BLOCKED"
|
|
18
|
+
}
|
|
19
|
+
export declare enum AccountType {
|
|
20
|
+
/**
|
|
21
|
+
* Account used to post debits and credits.
|
|
22
|
+
* ISO 20022 ExternalCashAccountType1Code CACC.
|
|
23
|
+
*/
|
|
24
|
+
Current = "CURRENT",
|
|
25
|
+
/**
|
|
26
|
+
* Account used for credit card payments.
|
|
27
|
+
* ISO 20022 ExternalCashAccountType1Code CARD.
|
|
28
|
+
*/
|
|
29
|
+
Card = "CARD",
|
|
30
|
+
/**
|
|
31
|
+
* Account used for savings.
|
|
32
|
+
* ISO 20022 ExternalCashAccountType1Code SVGS.
|
|
33
|
+
*/
|
|
34
|
+
Savings = "SAVINGS",
|
|
35
|
+
/**
|
|
36
|
+
* Account used for call money.
|
|
37
|
+
* No dedicated ISO 20022 code (falls into SVGS).
|
|
38
|
+
*/
|
|
39
|
+
CallMoney = "CALL_MONEY",
|
|
40
|
+
/**
|
|
41
|
+
* Account used for time deposits.
|
|
42
|
+
* No dedicated ISO 20022 code (falls into SVGS).
|
|
43
|
+
*/
|
|
44
|
+
TimeDeposit = "TIME_DEPOSIT",
|
|
45
|
+
/**
|
|
46
|
+
* Account used for loans.
|
|
47
|
+
* ISO 20022 ExternalCashAccountType1Code LOAN.
|
|
48
|
+
*/
|
|
49
|
+
Loan = "LOAN",
|
|
50
|
+
Securities = "SECURITIES",
|
|
51
|
+
Insurance = "INSURANCE",
|
|
52
|
+
Commerce = "COMMERCE",
|
|
53
|
+
Rewards = "REWARDS"
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Requirements for user identifier and password.
|
|
57
|
+
*/
|
|
58
|
+
export interface CredentialsModel {
|
|
59
|
+
/**
|
|
60
|
+
* A full set of credentials may be provided to support fully embedded authentication (including scraped redirects).
|
|
61
|
+
*/
|
|
62
|
+
full: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Only a user identifier without a password may be provided.
|
|
65
|
+
* This is typically the case for decoupled authentication where the user e.g. authorizes access in a mobile application.
|
|
66
|
+
* Note that if password-less authentication fails (e.g. as no device for decoupled authentication is set up for the user and
|
|
67
|
+
* a redirect is not supported), an error is returned and the transaction has to get restarted with a full set of credentials.
|
|
68
|
+
*/
|
|
69
|
+
userId: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Credentials are not required. The user will provide them to the service provider during a redirect.
|
|
72
|
+
*/
|
|
73
|
+
none: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Connection meta data
|
|
77
|
+
*/
|
|
78
|
+
export interface ConnectionInfo {
|
|
79
|
+
/**
|
|
80
|
+
* Unique identifier.
|
|
81
|
+
*/
|
|
82
|
+
id: string;
|
|
83
|
+
/**
|
|
84
|
+
* ISO 3166-1 ALPHA-2 country codes.
|
|
85
|
+
*/
|
|
86
|
+
countries: string[];
|
|
87
|
+
/**
|
|
88
|
+
* Display name.
|
|
89
|
+
*/
|
|
90
|
+
displayName: string;
|
|
91
|
+
/**
|
|
92
|
+
* Credentials model.
|
|
93
|
+
*/
|
|
94
|
+
credentials: CredentialsModel;
|
|
95
|
+
/**
|
|
96
|
+
* Human-friendly label for the user identifier if relevant.
|
|
97
|
+
*/
|
|
98
|
+
userId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Advice for the credentials to be displayed.
|
|
101
|
+
*/
|
|
102
|
+
advice?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Logo identifier.
|
|
105
|
+
*/
|
|
106
|
+
logoId?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface ConfirmationOptions {
|
|
109
|
+
ticket: string;
|
|
110
|
+
context: Uint8Array;
|
|
111
|
+
}
|
|
112
|
+
export interface ResponseOptions {
|
|
113
|
+
ticket: string;
|
|
114
|
+
context: Uint8Array;
|
|
115
|
+
response: string;
|
|
116
|
+
}
|
|
117
|
+
interface ServiceOptions {
|
|
118
|
+
credentials: Credentials;
|
|
119
|
+
session?: Uint8Array;
|
|
120
|
+
recurringConsents?: boolean;
|
|
121
|
+
ticket: string;
|
|
122
|
+
}
|
|
123
|
+
export interface AccountsOptions extends ServiceOptions {
|
|
124
|
+
fields: AccountField[];
|
|
125
|
+
filter?: AccountFilter;
|
|
126
|
+
}
|
|
127
|
+
export interface BalancesOptions extends ServiceOptions {
|
|
128
|
+
accounts: AccountReference[];
|
|
129
|
+
}
|
|
130
|
+
export type TransactionsOptions = ServiceOptions;
|
|
131
|
+
export interface CollectPaymentOptions extends ServiceOptions {
|
|
132
|
+
account?: AccountReference;
|
|
133
|
+
}
|
|
134
|
+
interface AccountReference {
|
|
135
|
+
iban: string;
|
|
136
|
+
currency?: string;
|
|
137
|
+
}
|
|
138
|
+
export interface Credentials {
|
|
139
|
+
connectionId: string;
|
|
140
|
+
userId?: string;
|
|
141
|
+
password?: string;
|
|
142
|
+
connectionData?: Uint8Array;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Filters for the connection lookup
|
|
146
|
+
*
|
|
147
|
+
* String filters look for the given value anywhere in the related field, case-insensitive.
|
|
148
|
+
*/
|
|
149
|
+
export type SearchFilter =
|
|
150
|
+
/**
|
|
151
|
+
* List of ISO 3166-1 alpha-2 country codes to consider.
|
|
152
|
+
*/
|
|
153
|
+
{
|
|
154
|
+
countries: string[];
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* String filter for the provider / product name or any alias.
|
|
158
|
+
*/
|
|
159
|
+
| {
|
|
160
|
+
name: string;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* String filter for the BIC.
|
|
164
|
+
*/
|
|
165
|
+
| {
|
|
166
|
+
bic: string;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* String filter for the (national) bank code.
|
|
170
|
+
*/
|
|
171
|
+
| {
|
|
172
|
+
bankCode: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* String filter for any of those fields.
|
|
176
|
+
*/
|
|
177
|
+
| {
|
|
178
|
+
term: string;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* Response from YAXI Open Banking services.
|
|
182
|
+
*
|
|
183
|
+
* The response either carries an authenticated Result
|
|
184
|
+
* or an interrupt (i.e. a dialog or redirect for the user).
|
|
185
|
+
*/
|
|
186
|
+
export declare class OBResponse {
|
|
187
|
+
private _json;
|
|
188
|
+
static fromJSON(json: ResultJSON | DialogJSON | RedirectJSON | RedirectHandleJSON): OBResponse;
|
|
189
|
+
protected constructor(json: ResultJSON | DialogJSON | RedirectJSON | RedirectHandleJSON);
|
|
190
|
+
toJSON(): ResultJSON | DialogJSON | RedirectJSON | RedirectHandleJSON;
|
|
191
|
+
}
|
|
192
|
+
type ResultJSON = {
|
|
193
|
+
Result: [string, string?, string?];
|
|
194
|
+
};
|
|
195
|
+
/**
|
|
196
|
+
* Data returned by YAXI Open Banking services, authenticated with an HMAC
|
|
197
|
+
*
|
|
198
|
+
* jwt can be used for transfer to a remote system as JSON Web Token {@link https://jwt.io/}.
|
|
199
|
+
* The remote system can verify and read the data from the "data" claim.
|
|
200
|
+
* To read the data locally, the frontend can decode the JWT without verification.
|
|
201
|
+
*
|
|
202
|
+
* Besides the value itself, it contains a timestamp and a ticket identifier
|
|
203
|
+
* (bound to known input parameters and service type).
|
|
204
|
+
*/
|
|
205
|
+
export declare class Result extends OBResponse {
|
|
206
|
+
readonly jwt: string;
|
|
207
|
+
readonly session?: Uint8Array;
|
|
208
|
+
readonly connectionData?: Uint8Array;
|
|
209
|
+
static fromJSON(json: ResultJSON): Result;
|
|
210
|
+
private constructor();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Context of a user dialog.
|
|
214
|
+
*/
|
|
215
|
+
export declare enum DialogContext {
|
|
216
|
+
/**
|
|
217
|
+
* SCA or TAN process.
|
|
218
|
+
*
|
|
219
|
+
* There are multiple cases, distinguishable by the input:
|
|
220
|
+
* - {@link Confirmation}: Decoupled process (e.g. confirmation in a SCA app).
|
|
221
|
+
* - {@link Selection}: TAN method selection.
|
|
222
|
+
* - {@link Field}: TAN entry.
|
|
223
|
+
*/
|
|
224
|
+
Sca = "SCA",
|
|
225
|
+
/**
|
|
226
|
+
* Account selection.
|
|
227
|
+
*
|
|
228
|
+
* A {@link Selection} gets returned with this context when an account has to be selected.
|
|
229
|
+
* Note that there might be just a single option that may be chosen automatically without user interaction.
|
|
230
|
+
*/
|
|
231
|
+
Accounts = "ACCOUNTS",
|
|
232
|
+
/**
|
|
233
|
+
* Pending redirect confirmation.
|
|
234
|
+
*
|
|
235
|
+
* A {@link Confirmation} gets returned with this context when a redirect got confirmed but no result is known yet.
|
|
236
|
+
*/
|
|
237
|
+
Redirect = "REDIRECT",
|
|
238
|
+
/**
|
|
239
|
+
* Pending SCT Inst payment.
|
|
240
|
+
*
|
|
241
|
+
* A {@link Confirmation} gets returned with this context when an SCT Inst payment has been initialized and not reached the final status yet.
|
|
242
|
+
*/
|
|
243
|
+
PaymentStatus = "PAYMENT_STATUS",
|
|
244
|
+
/**
|
|
245
|
+
* Verification of Payee confirmation.
|
|
246
|
+
*
|
|
247
|
+
* A {@link Confirmation} gets returned with this context when an explicit confirmation of the creditor is required due to a name mismatch.
|
|
248
|
+
* Note that this confirmation has legal implications, releasing the bank from liabilities in case of the transfer to an unintended receiver due to incorrect creditor data.
|
|
249
|
+
*/
|
|
250
|
+
VopConfirmation = "VOP_CONFIRMATION",
|
|
251
|
+
/**
|
|
252
|
+
* Pending Verification of Payee check.
|
|
253
|
+
* A {@link Confirmation} gets returned with this context when a Verification of Payee check for a bulk payment is still pending.
|
|
254
|
+
*/
|
|
255
|
+
VopCheck = "VOP_CHECK"
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Image data for a dialog.
|
|
259
|
+
*/
|
|
260
|
+
export interface Image {
|
|
261
|
+
mimeType: string;
|
|
262
|
+
/**
|
|
263
|
+
* Binary data in the format defined by mimeType.
|
|
264
|
+
*/
|
|
265
|
+
data: Uint8Array;
|
|
266
|
+
/**
|
|
267
|
+
* HHD_UC data block
|
|
268
|
+
*
|
|
269
|
+
* In cases where the ASPSP provides HHD_UC data for optical coupling with a HandHeld-Device
|
|
270
|
+
* for the generation of an OTP, especially for an HHD_OPT animated graphic, the raw HHD_UC
|
|
271
|
+
* data stream is provided here.
|
|
272
|
+
*
|
|
273
|
+
* The publicly available document "HandHeld-Device (HHD) for the generation of an OTP HHD
|
|
274
|
+
* enhancement for optical interfaces" describes how to implement the animated graphic for
|
|
275
|
+
* HHD_OPT in section C. data provides a pre-rendered animated GIF
|
|
276
|
+
* to be presented with a width of 62.5 mm.
|
|
277
|
+
*/
|
|
278
|
+
hhdUcData?: Uint8Array;
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Just a primary action to confirm the dialog.
|
|
282
|
+
*/
|
|
283
|
+
export declare class Confirmation {
|
|
284
|
+
/**
|
|
285
|
+
* Context object that can be used to confirm the dialog.
|
|
286
|
+
*/
|
|
287
|
+
context: Uint8Array;
|
|
288
|
+
/**
|
|
289
|
+
* If polling is acceptable, a delay in seconds is specified for which the client has to wait before automatically confirming.
|
|
290
|
+
*/
|
|
291
|
+
pollingDelaySecs?: number;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* A selection of options the user can choose from.
|
|
295
|
+
*/
|
|
296
|
+
export declare class Selection {
|
|
297
|
+
/**
|
|
298
|
+
* Options are meant to be rendered e.g. as radio buttons where the user must select exactly
|
|
299
|
+
* one to for a confirmation button to get enabled. Another example for an implementation is
|
|
300
|
+
* one button per option that immediately confirms the selection.
|
|
301
|
+
*/
|
|
302
|
+
options: Array<{
|
|
303
|
+
key: string;
|
|
304
|
+
label: string;
|
|
305
|
+
explanation?: string;
|
|
306
|
+
}>;
|
|
307
|
+
/**
|
|
308
|
+
* Context object that can be used to respond to the dialog.
|
|
309
|
+
*/
|
|
310
|
+
context: Uint8Array;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* An input field.
|
|
314
|
+
*/
|
|
315
|
+
export declare class Field {
|
|
316
|
+
/**
|
|
317
|
+
* Type that may be used for showing hints or dedicated keyboard layouts and for applying input restrictions or validation.
|
|
318
|
+
*/
|
|
319
|
+
type: InputType;
|
|
320
|
+
/**
|
|
321
|
+
* Indicates if the input should be masked.
|
|
322
|
+
*/
|
|
323
|
+
secrecyLevel: SecrecyLevel;
|
|
324
|
+
/**
|
|
325
|
+
* Minimal length to allow.
|
|
326
|
+
*/
|
|
327
|
+
minLength?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Maximum length to allow.
|
|
330
|
+
*/
|
|
331
|
+
maxLength?: number;
|
|
332
|
+
/**
|
|
333
|
+
* Context object that can be used to respond to the dialog.
|
|
334
|
+
*/
|
|
335
|
+
context: Uint8Array;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Type of an input field.
|
|
339
|
+
*/
|
|
340
|
+
export declare enum InputType {
|
|
341
|
+
Date = "DATE",
|
|
342
|
+
Email = "EMAIL",
|
|
343
|
+
Number = "NUMBER",
|
|
344
|
+
Phone = "PHONE",
|
|
345
|
+
Text = "TEXT"
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Level of secrecy for an input field.
|
|
349
|
+
*/
|
|
350
|
+
export declare enum SecrecyLevel {
|
|
351
|
+
/**
|
|
352
|
+
* The data is not a secret.
|
|
353
|
+
*/
|
|
354
|
+
Plain = "PLAIN",
|
|
355
|
+
/**
|
|
356
|
+
* The data is a one-time password. This can usually be treated as
|
|
357
|
+
* no secret but the implementer might still choose to mask the input.
|
|
358
|
+
*/
|
|
359
|
+
Otp = "OTP",
|
|
360
|
+
/**
|
|
361
|
+
* The data is a secret password. Input must be masked.
|
|
362
|
+
*/
|
|
363
|
+
Password = "PASSWORD"
|
|
364
|
+
}
|
|
365
|
+
type DialogJSON = {
|
|
366
|
+
Dialog: {
|
|
367
|
+
context?: string;
|
|
368
|
+
message?: string;
|
|
369
|
+
image: {
|
|
370
|
+
mimeType: string;
|
|
371
|
+
data: string;
|
|
372
|
+
hhdUcData?: string;
|
|
373
|
+
};
|
|
374
|
+
input: {
|
|
375
|
+
Confirmation: {
|
|
376
|
+
context: string;
|
|
377
|
+
pollingDelaySecs?: number;
|
|
378
|
+
};
|
|
379
|
+
} | {
|
|
380
|
+
Selection: {
|
|
381
|
+
options: [{
|
|
382
|
+
key: string;
|
|
383
|
+
label: string;
|
|
384
|
+
explanation?: string;
|
|
385
|
+
}];
|
|
386
|
+
context: string;
|
|
387
|
+
};
|
|
388
|
+
} | {
|
|
389
|
+
Field: {
|
|
390
|
+
type: string;
|
|
391
|
+
secrecyLevel: string;
|
|
392
|
+
minLength?: number;
|
|
393
|
+
maxLength?: number;
|
|
394
|
+
context: string;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* User dialog.
|
|
401
|
+
*
|
|
402
|
+
* This is meant to be displayed as a dialog in some User Interface and consists of:
|
|
403
|
+
*
|
|
404
|
+
* - A way to cancel the dialog (typically an X symbol and / or a "Cancel" button).
|
|
405
|
+
* - The display part:
|
|
406
|
+
* - The message.
|
|
407
|
+
* - An optional image.
|
|
408
|
+
* - The interactive part defined by the input.
|
|
409
|
+
*
|
|
410
|
+
* The input contains a context for continuing the
|
|
411
|
+
* process at the service that issued the dialog object.
|
|
412
|
+
*/
|
|
413
|
+
export declare class Dialog extends OBResponse {
|
|
414
|
+
readonly context?: DialogContext;
|
|
415
|
+
readonly message?: string;
|
|
416
|
+
readonly image?: Image;
|
|
417
|
+
/**
|
|
418
|
+
* Data defining the interactive part of a user dialog.
|
|
419
|
+
*/
|
|
420
|
+
readonly input: Confirmation | Selection | Field;
|
|
421
|
+
static fromJSON(json: DialogJSON): Dialog;
|
|
422
|
+
private constructor();
|
|
423
|
+
}
|
|
424
|
+
type RedirectJSON = {
|
|
425
|
+
Redirect: {
|
|
426
|
+
url: string;
|
|
427
|
+
context: string;
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* User redirect.
|
|
432
|
+
*
|
|
433
|
+
* The user is meant to get sent to the url and the context can
|
|
434
|
+
* be used for continuing the process at the service that issued the redirect object afterward.
|
|
435
|
+
*
|
|
436
|
+
* A web application needs to direct the user agent to the returned URL.
|
|
437
|
+
* A desktop or mobile application could either open it in a browser or inside an element like a WebView.
|
|
438
|
+
*/
|
|
439
|
+
export declare class Redirect extends OBResponse {
|
|
440
|
+
readonly url: URL;
|
|
441
|
+
readonly context: Uint8Array;
|
|
442
|
+
static fromJSON(json: RedirectJSON): Redirect;
|
|
443
|
+
private constructor();
|
|
444
|
+
}
|
|
445
|
+
type RedirectHandleJSON = {
|
|
446
|
+
RedirectHandle: {
|
|
447
|
+
handle: string;
|
|
448
|
+
context: string;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Incomplete user redirect.
|
|
453
|
+
*
|
|
454
|
+
* A final redirect URI needs to get registered, using the handle, to receive the URL to send the user to.
|
|
455
|
+
*/
|
|
456
|
+
export declare class RedirectHandle extends OBResponse {
|
|
457
|
+
readonly handle: string;
|
|
458
|
+
readonly context: Uint8Array;
|
|
459
|
+
static fromJSON(json: RedirectHandleJSON): RedirectHandle;
|
|
460
|
+
private constructor();
|
|
461
|
+
}
|
|
462
|
+
export type AccountFilter = {
|
|
463
|
+
eq: [AccountField, string | null];
|
|
464
|
+
} | {
|
|
465
|
+
notEq: [AccountField, string | null];
|
|
466
|
+
} | {
|
|
467
|
+
all: AccountFilter[];
|
|
468
|
+
} | {
|
|
469
|
+
any: AccountFilter[];
|
|
470
|
+
} | {
|
|
471
|
+
supports: SupportedService;
|
|
472
|
+
};
|
|
473
|
+
export declare enum SupportedService {
|
|
474
|
+
CollectPayment = "COLLECT_PAYMENT"
|
|
475
|
+
}
|
|
476
|
+
export type RoutexClientOptions = URL | {
|
|
477
|
+
url?: URL;
|
|
478
|
+
retryPolicyFactory?: () => RetryPolicy;
|
|
479
|
+
};
|
|
480
|
+
export declare class RoutexClient {
|
|
481
|
+
private _url;
|
|
482
|
+
private _settlement;
|
|
483
|
+
private _traceId?;
|
|
484
|
+
private _redirectUri?;
|
|
485
|
+
private _retryPolicyFactory;
|
|
486
|
+
constructor(options?: RoutexClientOptions);
|
|
487
|
+
private _unsealBody;
|
|
488
|
+
private _request;
|
|
489
|
+
/**
|
|
490
|
+
* Search for service connections (banks and other providers)
|
|
491
|
+
*
|
|
492
|
+
* The result is a list of connections that match all the {@link SearchFilter}s.
|
|
493
|
+
* If IBAN detection is enabled and the first value of a term filter is detected
|
|
494
|
+
* to be a possible prefix of an IBAN that contains a national bank code,
|
|
495
|
+
* the result might contain additional connections that match that bank code.
|
|
496
|
+
*/
|
|
497
|
+
search({ ticket, filters, ibanDetection, limit, }: {
|
|
498
|
+
ticket: string;
|
|
499
|
+
filters?: SearchFilter[];
|
|
500
|
+
ibanDetection: boolean;
|
|
501
|
+
limit?: number;
|
|
502
|
+
}): Promise<ConnectionInfo[]>;
|
|
503
|
+
/**
|
|
504
|
+
* Get information for a service connection
|
|
505
|
+
*/
|
|
506
|
+
info(ticket: string, connectionId: string): Promise<ConnectionInfo>;
|
|
507
|
+
/**
|
|
508
|
+
* Trace identifier returned with the last request
|
|
509
|
+
*/
|
|
510
|
+
traceId(): Uint8Array | undefined;
|
|
511
|
+
/**
|
|
512
|
+
* Retrieve trace data
|
|
513
|
+
*/
|
|
514
|
+
trace(ticket: string, traceId: Uint8Array): Promise<string>;
|
|
515
|
+
/**
|
|
516
|
+
* Set a redirect URI for subsequent service requests.
|
|
517
|
+
*
|
|
518
|
+
* Redirects will eventually forward to that URI.
|
|
519
|
+
* It can be used to redirect back to a web application or to jump
|
|
520
|
+
* back into the context of a desktop or mobile application.
|
|
521
|
+
* If no redirect URI is set, {@link RedirectHandle}s will get returned instead of {@link Redirect}s.
|
|
522
|
+
*/
|
|
523
|
+
setRedirectUri(redirectUri: string): void;
|
|
524
|
+
/**
|
|
525
|
+
* Register a redirect URI for a given redirect handle.
|
|
526
|
+
*
|
|
527
|
+
* Returns the URL that the user is meant to get sent to.
|
|
528
|
+
*/
|
|
529
|
+
registerRedirectUri({ ticket, handle, redirectUri, }: {
|
|
530
|
+
ticket: string;
|
|
531
|
+
handle: string;
|
|
532
|
+
redirectUri: string;
|
|
533
|
+
}): Promise<URL>;
|
|
534
|
+
private _respond;
|
|
535
|
+
private _confirm;
|
|
536
|
+
/**
|
|
537
|
+
* Fetch a list of accounts
|
|
538
|
+
*/
|
|
539
|
+
accounts({ credentials, session, recurringConsents, ticket, fields, filter, }: AccountsOptions): Promise<OBResponse>;
|
|
540
|
+
/**
|
|
541
|
+
* Respond to {@link Dialog} returned while fetching accounts
|
|
542
|
+
*/
|
|
543
|
+
respondAccounts(options: ResponseOptions): Promise<OBResponse>;
|
|
544
|
+
/**
|
|
545
|
+
* Confirm {@link Dialog} or {@link Redirect} returned while fetching accounts
|
|
546
|
+
*/
|
|
547
|
+
confirmAccounts(options: ConfirmationOptions): Promise<OBResponse>;
|
|
548
|
+
/**
|
|
549
|
+
* Fetch a list of balances
|
|
550
|
+
*/
|
|
551
|
+
balances({ credentials, session, recurringConsents, ticket, accounts, }: BalancesOptions): Promise<OBResponse>;
|
|
552
|
+
/**
|
|
553
|
+
* Respond to {@link Dialog} returned while fetching balances
|
|
554
|
+
*/
|
|
555
|
+
respondBalances(options: ResponseOptions): Promise<OBResponse>;
|
|
556
|
+
/**
|
|
557
|
+
* Confirm {@link Dialog} or {@link Redirect} returned while fetching balances
|
|
558
|
+
*/
|
|
559
|
+
confirmBalances(options: ConfirmationOptions): Promise<OBResponse>;
|
|
560
|
+
/**
|
|
561
|
+
* Fetch a list of transactions
|
|
562
|
+
*/
|
|
563
|
+
transactions({ credentials, session, recurringConsents, ticket, }: TransactionsOptions): Promise<OBResponse>;
|
|
564
|
+
/**
|
|
565
|
+
* Respond to {@link Dialog} returned while fetching transactions
|
|
566
|
+
*/
|
|
567
|
+
respondTransactions(options: ResponseOptions): Promise<OBResponse>;
|
|
568
|
+
/**
|
|
569
|
+
* Confirm {@link Dialog} or {@link Redirect} returned while fetching transactions
|
|
570
|
+
*/
|
|
571
|
+
confirmTransactions(options: ConfirmationOptions): Promise<OBResponse>;
|
|
572
|
+
/**
|
|
573
|
+
* Collect a predefined payment
|
|
574
|
+
*/
|
|
575
|
+
collectPayment({ credentials, session, recurringConsents, ticket, account, }: CollectPaymentOptions): Promise<OBResponse>;
|
|
576
|
+
/**
|
|
577
|
+
* Respond to {@link Dialog} returned while initiating the payment
|
|
578
|
+
*/
|
|
579
|
+
respondCollectPayment(options: ResponseOptions): Promise<OBResponse>;
|
|
580
|
+
/**
|
|
581
|
+
* Confirm {@link Dialog} or {@link Redirect} returned initiating the payment
|
|
582
|
+
*/
|
|
583
|
+
confirmCollectPayment(options: ConfirmationOptions): Promise<OBResponse>;
|
|
584
|
+
}
|
|
585
|
+
export declare class RequestException extends Error {
|
|
586
|
+
constructor(error: string, options?: ErrorOptions);
|
|
587
|
+
}
|
|
588
|
+
export declare class UnexpectedErrorException extends Error {
|
|
589
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
590
|
+
userMessage?: string;
|
|
591
|
+
}
|
|
592
|
+
export declare class CanceledException extends Error {
|
|
593
|
+
constructor(options?: ErrorOptions);
|
|
594
|
+
}
|
|
595
|
+
export declare class InvalidCredentialsException extends Error {
|
|
596
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
597
|
+
userMessage?: string;
|
|
598
|
+
}
|
|
599
|
+
export declare class ServiceBlockedException extends Error {
|
|
600
|
+
constructor(code?: string, userMessage?: string, options?: ErrorOptions);
|
|
601
|
+
code?: ServiceBlockedCode;
|
|
602
|
+
userMessage?: string;
|
|
603
|
+
}
|
|
604
|
+
export declare enum ServiceBlockedCode {
|
|
605
|
+
/**
|
|
606
|
+
* Something is not set up for the user, e.g., there are no TAN methods.
|
|
607
|
+
*/
|
|
608
|
+
MissingSetup = "MISSING_SETUP",
|
|
609
|
+
/**
|
|
610
|
+
* User attention is required via another channel. Typically the user needs to log into the Online Banking.
|
|
611
|
+
*/
|
|
612
|
+
ActionRequired = "ACTION_REQUIRED"
|
|
613
|
+
}
|
|
614
|
+
export declare class UnauthorizedException extends Error {
|
|
615
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
616
|
+
userMessage?: string;
|
|
617
|
+
}
|
|
618
|
+
export declare class ConsentExpiredException extends Error {
|
|
619
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
620
|
+
userMessage?: string;
|
|
621
|
+
}
|
|
622
|
+
export declare class AccessExceededException extends Error {
|
|
623
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
624
|
+
userMessage?: string;
|
|
625
|
+
}
|
|
626
|
+
export declare class PeriodOutOfBoundsException extends Error {
|
|
627
|
+
constructor(userMessage?: string, options?: ErrorOptions);
|
|
628
|
+
userMessage?: string;
|
|
629
|
+
}
|
|
630
|
+
export declare class UnsupportedProductException extends Error {
|
|
631
|
+
constructor(reason?: string, userMessage?: string, options?: ErrorOptions);
|
|
632
|
+
reason?: UnsupportedProductReason;
|
|
633
|
+
userMessage?: string;
|
|
634
|
+
}
|
|
635
|
+
export declare enum UnsupportedProductReason {
|
|
636
|
+
/**
|
|
637
|
+
* The amount is not allowed for the payment product.
|
|
638
|
+
*/
|
|
639
|
+
Limit = "LIMIT",
|
|
640
|
+
/**
|
|
641
|
+
* The recipient is not capable to receive the payment product.
|
|
642
|
+
*/
|
|
643
|
+
Recipient = "RECIPIENT"
|
|
644
|
+
}
|
|
645
|
+
export declare class PaymentFailedException extends Error {
|
|
646
|
+
constructor(code?: string, userMessage?: string, options?: ErrorOptions);
|
|
647
|
+
code?: PaymentFailedCode;
|
|
648
|
+
userMessage?: string;
|
|
649
|
+
}
|
|
650
|
+
export declare enum PaymentFailedCode {
|
|
651
|
+
LimitExceeded = "LIMIT_EXCEEDED",
|
|
652
|
+
InsufficientFunds = "INSUFFICIENT_FUNDS"
|
|
653
|
+
}
|
|
654
|
+
export declare class UnexpectedValueException extends Error {
|
|
655
|
+
constructor(error: string, options?: ErrorOptions);
|
|
656
|
+
}
|
|
657
|
+
export declare class TicketException extends Error {
|
|
658
|
+
constructor(error: string, code: string, options?: ErrorOptions);
|
|
659
|
+
code: TicketExceptionCode;
|
|
660
|
+
}
|
|
661
|
+
export declare enum TicketExceptionCode {
|
|
662
|
+
Missing = "MISSING",
|
|
663
|
+
Invalid = "INVALID",
|
|
664
|
+
MissingKey = "MISSING_KEY",
|
|
665
|
+
UnknownKey = "UNKNOWN_KEY",
|
|
666
|
+
Mismatch = "MISMATCH",
|
|
667
|
+
Expired = "EXPIRED",
|
|
668
|
+
InvalidLifetime = "INVALID_LIFETIME",
|
|
669
|
+
ExpiredKey = "EXPIRED_KEY",
|
|
670
|
+
KeyEnvironmentMismatch = "KEY_ENVIRONMENT_MISMATCH"
|
|
671
|
+
}
|
|
672
|
+
export declare class ProviderErrorException extends Error {
|
|
673
|
+
constructor(code?: string, userMessage?: string, options?: ErrorOptions);
|
|
674
|
+
code?: ProviderErrorCode;
|
|
675
|
+
userMessage?: string;
|
|
676
|
+
}
|
|
677
|
+
export declare enum ProviderErrorCode {
|
|
678
|
+
Maintenance = "MAINTENANCE"
|
|
679
|
+
}
|
|
680
|
+
export declare class ResponseException extends Error {
|
|
681
|
+
constructor(text: string, response: Response, options?: ErrorOptions);
|
|
682
|
+
response: Response;
|
|
683
|
+
}
|
|
684
|
+
export declare class NotFoundException extends Error {
|
|
685
|
+
constructor(options?: ErrorOptions);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* A policy to determine whether a failed operation should be retried. Gets
|
|
689
|
+
* passed the error which caused the operation to fail and should return a
|
|
690
|
+
* `Promise` that resolves to `true` if the request should be retried.
|
|
691
|
+
* Implementations can wait for some time before resolving the `Promise` to add
|
|
692
|
+
* a wait time between retries.
|
|
693
|
+
*/
|
|
694
|
+
export type RetryPolicy = (error: unknown) => Promise<boolean>;
|
|
695
|
+
/**
|
|
696
|
+
* A `RetryPolicy` that allows `maxTimes` retries if a `RequestException`
|
|
697
|
+
* occurred. Doesn't wait any time, but instantly returns.
|
|
698
|
+
*/
|
|
699
|
+
export declare function retryRequestExceptionNTimesPolicy(maxTimes: number): RetryPolicy;
|
|
700
|
+
export declare const _testing: {
|
|
701
|
+
[Key: string]: unknown;
|
|
702
|
+
};
|
|
703
|
+
export {};
|