@coderoftime/fints 0.1.0 → 0.3.0
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 +519 -1
- package/README.md +138 -40
- package/dist/client.d.ts +49 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +242 -0
- package/dist/client.js.map +1 -0
- package/dist/core/account.d.ts +46 -7
- package/dist/core/account.d.ts.map +1 -1
- package/dist/core/account.js +143 -24
- package/dist/core/account.js.map +1 -1
- package/dist/core/amount.d.ts +15 -4
- package/dist/core/amount.d.ts.map +1 -1
- package/dist/core/amount.js +46 -9
- package/dist/core/amount.js.map +1 -1
- package/dist/core/balance.d.ts +4 -0
- package/dist/core/balance.d.ts.map +1 -1
- package/dist/core/balance.js +11 -5
- package/dist/core/balance.js.map +1 -1
- package/dist/core/bank-info.d.ts +21 -4
- package/dist/core/bank-info.d.ts.map +1 -1
- package/dist/core/bank-info.js +26 -5
- package/dist/core/bank-info.js.map +1 -1
- package/dist/core/client.d.ts +81 -19
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/config.d.ts +40 -20
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +85 -30
- package/dist/core/config.js.map +1 -1
- package/dist/core/errors.d.ts +100 -26
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +136 -53
- package/dist/core/errors.js.map +1 -1
- package/dist/core/feedback.d.ts +11 -1
- package/dist/core/feedback.d.ts.map +1 -1
- package/dist/core/feedback.js +14 -2
- package/dist/core/feedback.js.map +1 -1
- package/dist/core/transaction.d.ts +11 -1
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/transaction.js +21 -4
- package/dist/core/transaction.js.map +1 -1
- package/dist/core/transport.d.ts +48 -6
- package/dist/core/transport.d.ts.map +1 -1
- package/dist/core/transport.js +126 -29
- package/dist/core/transport.js.map +1 -1
- package/dist/formats/camt.d.ts +28 -5
- package/dist/formats/camt.d.ts.map +1 -1
- package/dist/formats/camt.js +132 -50
- package/dist/formats/camt.js.map +1 -1
- package/dist/formats/mt940.d.ts +29 -5
- package/dist/formats/mt940.d.ts.map +1 -1
- package/dist/formats/mt940.js +209 -113
- package/dist/formats/mt940.js.map +1 -1
- package/dist/formats/readers.d.ts +6 -2
- package/dist/formats/readers.d.ts.map +1 -1
- package/dist/formats/readers.js +28 -29
- package/dist/formats/readers.js.map +1 -1
- package/dist/formats/record-budget.d.ts +7 -0
- package/dist/formats/record-budget.d.ts.map +1 -0
- package/dist/formats/record-budget.js +17 -0
- package/dist/formats/record-budget.js.map +1 -0
- package/dist/formats/sepa-purpose.d.ts +9 -0
- package/dist/formats/sepa-purpose.d.ts.map +1 -1
- package/dist/formats/sepa-purpose.js +32 -2
- package/dist/formats/sepa-purpose.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/session/app-approval.d.ts +11 -5
- package/dist/session/app-approval.d.ts.map +1 -1
- package/dist/session/app-approval.js +23 -12
- package/dist/session/app-approval.js.map +1 -1
- package/dist/session/dialog-runner.d.ts +11 -11
- package/dist/session/dialog-runner.d.ts.map +1 -1
- package/dist/session/dialog-runner.js +34 -19
- package/dist/session/dialog-runner.js.map +1 -1
- package/dist/session/login-guard.d.ts +54 -49
- package/dist/session/login-guard.d.ts.map +1 -1
- package/dist/session/login-guard.js +170 -83
- package/dist/session/login-guard.js.map +1 -1
- package/dist/session/sepa-accounts.d.ts +20 -14
- package/dist/session/sepa-accounts.d.ts.map +1 -1
- package/dist/session/sepa-accounts.js +62 -46
- package/dist/session/sepa-accounts.js.map +1 -1
- package/dist/session/session-setup.d.ts +41 -24
- package/dist/session/session-setup.d.ts.map +1 -1
- package/dist/session/session-setup.js +106 -63
- package/dist/session/session-setup.js.map +1 -1
- package/dist/session/session-state.d.ts +10 -6
- package/dist/session/session-state.d.ts.map +1 -1
- package/dist/session/session-state.js +72 -18
- package/dist/session/session-state.js.map +1 -1
- package/dist/session/signed-dialog.d.ts +83 -0
- package/dist/session/signed-dialog.d.ts.map +1 -0
- package/dist/session/signed-dialog.js +185 -0
- package/dist/session/signed-dialog.js.map +1 -0
- package/dist/session/tan-selection.d.ts +26 -18
- package/dist/session/tan-selection.d.ts.map +1 -1
- package/dist/session/tan-selection.js +44 -33
- package/dist/session/tan-selection.js.map +1 -1
- package/dist/session/user-prompts.d.ts +14 -5
- package/dist/session/user-prompts.d.ts.map +1 -1
- package/dist/session/user-prompts.js +53 -18
- package/dist/session/user-prompts.js.map +1 -1
- package/dist/tan/challenge.d.ts +47 -24
- package/dist/tan/challenge.d.ts.map +1 -1
- package/dist/tan/challenge.js +56 -51
- package/dist/tan/challenge.js.map +1 -1
- package/dist/tan/flicker.d.ts +11 -1
- package/dist/tan/flicker.d.ts.map +1 -1
- package/dist/tan/flicker.js +70 -24
- package/dist/tan/flicker.js.map +1 -1
- package/dist/tan/tan-image.d.ts +6 -2
- package/dist/tan/tan-image.d.ts.map +1 -1
- package/dist/tan/tan-image.js +14 -6
- package/dist/tan/tan-image.js.map +1 -1
- package/dist/tan/tan-models.d.ts +14 -2
- package/dist/tan/tan-models.d.ts.map +1 -1
- package/dist/tan/tan-models.js +24 -7
- package/dist/tan/tan-models.js.map +1 -1
- package/dist/util/arguments.d.ts +13 -0
- package/dist/util/arguments.d.ts.map +1 -0
- package/dist/util/arguments.js +40 -0
- package/dist/util/arguments.js.map +1 -0
- package/dist/util/async.d.ts +4 -3
- package/dist/util/async.d.ts.map +1 -1
- package/dist/util/async.js +6 -7
- package/dist/util/async.js.map +1 -1
- package/dist/util/bytes.d.ts +3 -4
- package/dist/util/bytes.d.ts.map +1 -1
- package/dist/util/bytes.js +13 -21
- package/dist/util/bytes.js.map +1 -1
- package/dist/util/call-context.d.ts.map +1 -1
- package/dist/util/call-context.js +3 -2
- package/dist/util/call-context.js.map +1 -1
- package/dist/util/dates.d.ts +6 -20
- package/dist/util/dates.d.ts.map +1 -1
- package/dist/util/dates.js +58 -28
- package/dist/util/dates.js.map +1 -1
- package/dist/util/errors.d.ts +13 -3
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +19 -6
- package/dist/util/errors.js.map +1 -1
- package/dist/util/immutable-map.d.ts +5 -2
- package/dist/util/immutable-map.d.ts.map +1 -1
- package/dist/util/immutable-map.js +15 -12
- package/dist/util/immutable-map.js.map +1 -1
- package/dist/util/inspect.d.ts +11 -0
- package/dist/util/inspect.d.ts.map +1 -0
- package/dist/util/inspect.js +14 -0
- package/dist/util/inspect.js.map +1 -0
- package/dist/util/json.d.ts +4 -0
- package/dist/util/json.d.ts.map +1 -1
- package/dist/util/json.js +18 -0
- package/dist/util/json.js.map +1 -1
- package/dist/util/text.d.ts +38 -5
- package/dist/util/text.d.ts.map +1 -1
- package/dist/util/text.js +90 -16
- package/dist/util/text.js.map +1 -1
- package/dist/util/xml.d.ts +9 -6
- package/dist/util/xml.d.ts.map +1 -1
- package/dist/util/xml.js +129 -56
- package/dist/util/xml.js.map +1 -1
- package/dist/v3/account-extension.d.ts.map +1 -1
- package/dist/v3/account-extension.js +7 -10
- package/dist/v3/account-extension.js.map +1 -1
- package/dist/v3/bank-connection.d.ts +54 -0
- package/dist/v3/bank-connection.d.ts.map +1 -0
- package/dist/v3/bank-connection.js +118 -0
- package/dist/v3/bank-connection.js.map +1 -0
- package/dist/v3/dialog.d.ts +84 -46
- package/dist/v3/dialog.d.ts.map +1 -1
- package/dist/v3/dialog.js +174 -60
- package/dist/v3/dialog.js.map +1 -1
- package/dist/v3/message.d.ts +32 -11
- package/dist/v3/message.d.ts.map +1 -1
- package/dist/v3/message.js +144 -83
- package/dist/v3/message.js.map +1 -1
- package/dist/v3/parameter-store.d.ts +111 -0
- package/dist/v3/parameter-store.d.ts.map +1 -0
- package/dist/v3/parameter-store.js +197 -0
- package/dist/v3/parameter-store.js.map +1 -0
- package/dist/v3/parameters.d.ts +44 -17
- package/dist/v3/parameters.d.ts.map +1 -1
- package/dist/v3/parameters.js +136 -60
- package/dist/v3/parameters.js.map +1 -1
- package/dist/v3/protocol.d.ts +50 -50
- package/dist/v3/protocol.d.ts.map +1 -1
- package/dist/v3/protocol.js +91 -210
- package/dist/v3/protocol.js.map +1 -1
- package/dist/v3/queries.d.ts +51 -0
- package/dist/v3/queries.d.ts.map +1 -0
- package/dist/v3/queries.js +128 -0
- package/dist/v3/queries.js.map +1 -0
- package/dist/v3/segments.d.ts +43 -19
- package/dist/v3/segments.d.ts.map +1 -1
- package/dist/v3/segments.js +84 -33
- package/dist/v3/segments.js.map +1 -1
- package/dist/v3/syntax.d.ts +68 -13
- package/dist/v3/syntax.d.ts.map +1 -1
- package/dist/v3/syntax.js +183 -102
- package/dist/v3/syntax.js.map +1 -1
- package/package.json +10 -6
- package/src/client.ts +293 -0
- package/src/core/account.ts +153 -24
- package/src/core/amount.ts +45 -10
- package/src/core/balance.ts +12 -5
- package/src/core/bank-info.ts +29 -5
- package/src/core/client.ts +83 -19
- package/src/core/config.ts +95 -35
- package/src/core/errors.ts +148 -54
- package/src/core/feedback.ts +16 -2
- package/src/core/transaction.ts +22 -4
- package/src/core/transport.ts +153 -32
- package/src/formats/camt.ts +153 -45
- package/src/formats/mt940.ts +244 -122
- package/src/formats/readers.ts +28 -31
- package/src/formats/record-budget.ts +18 -0
- package/src/formats/sepa-purpose.ts +29 -2
- package/src/index.ts +4 -2
- package/src/session/app-approval.ts +51 -38
- package/src/session/dialog-runner.ts +61 -31
- package/src/session/login-guard.ts +189 -87
- package/src/session/sepa-accounts.ts +63 -45
- package/src/session/session-setup.ts +105 -68
- package/src/session/session-state.ts +74 -23
- package/src/session/signed-dialog.ts +222 -0
- package/src/session/tan-selection.ts +50 -39
- package/src/session/user-prompts.ts +62 -18
- package/src/tan/challenge.ts +87 -64
- package/src/tan/flicker.ts +72 -23
- package/src/tan/tan-image.ts +15 -6
- package/src/tan/tan-models.ts +26 -7
- package/src/util/arguments.ts +40 -0
- package/src/util/async.ts +10 -9
- package/src/util/bytes.ts +14 -20
- package/src/util/call-context.ts +3 -2
- package/src/util/dates.ts +64 -33
- package/src/util/errors.ts +22 -6
- package/src/util/immutable-map.ts +15 -12
- package/src/util/inspect.ts +14 -0
- package/src/util/json.ts +16 -0
- package/src/util/text.ts +87 -15
- package/src/util/xml.ts +130 -52
- package/src/v3/account-extension.ts +7 -12
- package/src/v3/bank-connection.ts +126 -0
- package/src/v3/dialog.ts +186 -92
- package/src/v3/message.ts +140 -79
- package/src/v3/parameter-store.ts +226 -0
- package/src/v3/parameters.ts +166 -66
- package/src/v3/protocol.ts +103 -253
- package/src/v3/queries.ts +198 -0
- package/src/v3/segments.ts +86 -31
- package/src/v3/syntax.ts +172 -93
- package/dist/session/bank-connection.d.ts +0 -28
- package/dist/session/bank-connection.d.ts.map +0 -1
- package/dist/session/bank-connection.js +0 -48
- package/dist/session/bank-connection.js.map +0 -1
- package/dist/session/parameter-data.d.ts +0 -83
- package/dist/session/parameter-data.d.ts.map +0 -1
- package/dist/session/parameter-data.js +0 -68
- package/dist/session/parameter-data.js.map +0 -1
- package/dist/session/pin-tan-client.d.ts +0 -54
- package/dist/session/pin-tan-client.d.ts.map +0 -1
- package/dist/session/pin-tan-client.js +0 -153
- package/dist/session/pin-tan-client.js.map +0 -1
- package/dist/session/pin-tan-dialog.d.ts +0 -71
- package/dist/session/pin-tan-dialog.d.ts.map +0 -1
- package/dist/session/pin-tan-dialog.js +0 -124
- package/dist/session/pin-tan-dialog.js.map +0 -1
- package/dist/session/protocol.d.ts +0 -209
- package/dist/session/protocol.d.ts.map +0 -1
- package/dist/session/protocol.js +0 -75
- package/dist/session/protocol.js.map +0 -1
- package/dist/session/response-handler.d.ts +0 -48
- package/dist/session/response-handler.d.ts.map +0 -1
- package/dist/session/response-handler.js +0 -121
- package/dist/session/response-handler.js.map +0 -1
- package/dist/v3/client.d.ts +0 -24
- package/dist/v3/client.d.ts.map +0 -1
- package/dist/v3/client.js +0 -16
- package/dist/v3/client.js.map +0 -1
- package/src/session/bank-connection.ts +0 -51
- package/src/session/parameter-data.ts +0 -137
- package/src/session/pin-tan-client.ts +0 -186
- package/src/session/pin-tan-dialog.ts +0 -160
- package/src/session/protocol.ts +0 -311
- package/src/session/response-handler.ts +0 -130
- package/src/v3/client.ts +0 -29
package/dist/core/config.js
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
import { optionalBoolean, optionalString, requireString } from '../util/arguments.js';
|
|
1
2
|
import { invalidArgument } from '../util/errors.js';
|
|
2
|
-
|
|
3
|
+
import { inspectCustom } from '../util/inspect.js';
|
|
4
|
+
import { isLatin1, trimBlanks } from '../util/text.js';
|
|
5
|
+
/**
|
|
6
|
+
* The country code FinTS gives Germany, where FinTS banks are: the ISO 3166 code of the Federal Republic before 1990,
|
|
7
|
+
* not today's `276`.
|
|
8
|
+
*/
|
|
3
9
|
export const defaultCountryCode = '280';
|
|
4
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Longest bank code (Kreditinstitutscode), user or customer ID (data type `id`), product ID (Produktbezeichnung) and
|
|
12
|
+
* product version FinTS 3.0 takes.
|
|
13
|
+
*/
|
|
14
|
+
const maxBankCodeLength = 30;
|
|
15
|
+
const maxIdLength = 30;
|
|
16
|
+
const maxProductIdLength = 25;
|
|
17
|
+
const maxProductVersionLength = 5;
|
|
18
|
+
/** Connection and login data for one bank user; frozen, so that the client sends what the constructor has checked. */
|
|
5
19
|
export class FinTsConfig {
|
|
6
|
-
/**
|
|
20
|
+
/** The country code FinTS gives Germany, where FinTS banks are: `280`, not today's ISO 3166 code `276`. */
|
|
7
21
|
static defaultCountryCode = defaultCountryCode;
|
|
8
|
-
|
|
22
|
+
href;
|
|
9
23
|
bankCode;
|
|
10
24
|
userId;
|
|
11
25
|
explicitCustomerId;
|
|
@@ -14,8 +28,17 @@ export class FinTsConfig {
|
|
|
14
28
|
countryCode;
|
|
15
29
|
allowInsecureUrl;
|
|
16
30
|
/**
|
|
17
|
-
* Throws `TypeError` if `url` is not a valid URL, has no host or is not https, unless
|
|
18
|
-
* `
|
|
31
|
+
* Throws `TypeError` if `url` is not a valid URL, has no host, holds a user name or password, or is not https, unless
|
|
32
|
+
* `allowInsecureUrl` is set and `url` is a loopback address. Throws as well where the bank would refuse the login: for
|
|
33
|
+
* a login or product detail that is empty, has characters FinTS 3.0 cannot send (it uses ISO 8859-1, so `€` and most
|
|
34
|
+
* non-Latin letters are not possible) or is longer than its field (30 characters for the bank code, the user ID and
|
|
35
|
+
* the customer ID, 25 for the product ID, 5 for its version), for a country code of other than three digits, and for
|
|
36
|
+
* a German bank code of other than eight. Throws as well for a detail of another type than `FinTsConfigInit` names,
|
|
37
|
+
* such as a number as `bankCode` or the string `'false'` as `allowInsecureUrl`; `null` counts as a detail not given.
|
|
38
|
+
* The message leaves out the value.
|
|
39
|
+
*
|
|
40
|
+
* Drops leading and trailing blanks of the login details and the product, as FinTS sends them without (Formals
|
|
41
|
+
* B.4.1): `'alice '` is the user `alice`, also for a saved state.
|
|
19
42
|
*/
|
|
20
43
|
constructor(init) {
|
|
21
44
|
// `URL` would read `https:bank` and `https:///bank` as the host `bank`; such a URL is a mistake, not a host.
|
|
@@ -29,31 +52,59 @@ export class FinTsConfig {
|
|
|
29
52
|
catch {
|
|
30
53
|
throw invalidArgument('Not a valid URL', 'url');
|
|
31
54
|
}
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
this.userId = init.userId;
|
|
35
|
-
this.explicitCustomerId = init.customerId;
|
|
36
|
-
this.productId = init.productId;
|
|
37
|
-
this.productVersion = init.productVersion ?? '1.0';
|
|
38
|
-
this.countryCode = init.countryCode ?? defaultCountryCode;
|
|
39
|
-
this.allowInsecureUrl = init.allowInsecureUrl ?? false;
|
|
55
|
+
this.href = url.href;
|
|
56
|
+
this.allowInsecureUrl = optionalBoolean(init.allowInsecureUrl, 'allowInsecureUrl') ?? false;
|
|
40
57
|
requireSecureUrl(url, this.allowInsecureUrl);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
this.countryCode = requireValue(init.countryCode ?? defaultCountryCode, 'countryCode');
|
|
59
|
+
if (!/^\d{3}$/.test(this.countryCode)) {
|
|
60
|
+
throw invalidArgument('Must be three digits, 280 for Germany', 'countryCode');
|
|
61
|
+
}
|
|
62
|
+
this.bankCode = requireValue(init.bankCode, 'bankCode', maxBankCodeLength);
|
|
63
|
+
if (this.countryCode === defaultCountryCode && !/^\d{8}$/.test(this.bankCode)) {
|
|
64
|
+
throw invalidArgument('A German bank code (BLZ) has eight digits', 'bankCode');
|
|
65
|
+
}
|
|
66
|
+
this.userId = requireValue(init.userId, 'userId', maxIdLength);
|
|
67
|
+
const customerId = optionalString(init.customerId, 'customerId');
|
|
68
|
+
this.explicitCustomerId =
|
|
69
|
+
customerId === undefined ? undefined : requireValue(customerId, 'customerId', maxIdLength);
|
|
70
|
+
this.productId = requireValue(init.productId, 'productId', maxProductIdLength);
|
|
71
|
+
this.productVersion = requireValue(init.productVersion ?? '1.0', 'productVersion', maxProductVersionLength);
|
|
72
|
+
Object.freeze(this);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The bank's FinTS PIN/TAN endpoint, as checked by the constructor. A new `URL` on each access, so that changing one
|
|
76
|
+
* cannot change where the client posts the PIN.
|
|
77
|
+
*/
|
|
78
|
+
get url() {
|
|
79
|
+
return new URL(this.href);
|
|
48
80
|
}
|
|
49
81
|
/** Customer ID; defaults to `userId`. */
|
|
50
82
|
get customerId() {
|
|
51
83
|
return this.explicitCustomerId ?? this.userId;
|
|
52
84
|
}
|
|
85
|
+
/** What Node.js's `util.inspect` and `console.log` show: the bank code, neither the login data nor the product ID. */
|
|
86
|
+
[inspectCustom]() {
|
|
87
|
+
return `FinTsConfig(${this.bankCode})`;
|
|
88
|
+
}
|
|
53
89
|
}
|
|
54
|
-
|
|
55
|
-
|
|
90
|
+
/**
|
|
91
|
+
* `value` without leading and trailing blanks; throws `TypeError` if it is no string, nothing is left, or what is left
|
|
92
|
+
* is not sendable (`requireLatin1`) or longer than `maxLength`: cut short, a value would be one the bank does not know.
|
|
93
|
+
*/
|
|
94
|
+
function requireValue(value, name, maxLength = Number.POSITIVE_INFINITY) {
|
|
95
|
+
const trimmed = trimBlanks(requireString(value, name));
|
|
96
|
+
if (trimmed === '')
|
|
56
97
|
throw invalidArgument('Must not be empty', name);
|
|
98
|
+
requireLatin1(trimmed, name);
|
|
99
|
+
if (trimmed.length > maxLength)
|
|
100
|
+
throw invalidArgument(`At most ${maxLength} characters in FinTS 3.0`, name);
|
|
101
|
+
return trimmed;
|
|
102
|
+
}
|
|
103
|
+
/** `text`, unless it has characters FinTS 3.0 cannot send (ISO 8859-1 only); the message leaves out the value. */
|
|
104
|
+
export function requireLatin1(text, name) {
|
|
105
|
+
if (!isLatin1(text))
|
|
106
|
+
throw invalidArgument('Contains characters FinTS 3.0 cannot send (ISO 8859-1 only)', name);
|
|
107
|
+
return text;
|
|
57
108
|
}
|
|
58
109
|
/** The host of `url` without the brackets of an IPv6 address, as `URL` writes it. */
|
|
59
110
|
export function hostOf(url) {
|
|
@@ -63,27 +114,31 @@ export function hostOf(url) {
|
|
|
63
114
|
/**
|
|
64
115
|
* Throws `TypeError` unless `url` names a host and uses https: the PIN travels with every message.
|
|
65
116
|
*
|
|
66
|
-
* With `allowInsecure`, http is accepted for loopback hosts only.
|
|
117
|
+
* With `allowInsecure`, http is accepted for loopback hosts only. Throws as well for a user name or password in `url`:
|
|
118
|
+
* `fetch` refuses such a URL, with the whole URL in its error message. The message leaves them out.
|
|
67
119
|
*/
|
|
68
|
-
|
|
120
|
+
function requireSecureUrl(url, allowInsecure = false) {
|
|
69
121
|
if (hostOf(url) === '')
|
|
70
122
|
throw invalidArgument('The URL has no host', 'url');
|
|
123
|
+
if (url.username !== '' || url.password !== '')
|
|
124
|
+
throw invalidArgument('The URL must not contain credentials', 'url');
|
|
71
125
|
const loopbackHttp = allowInsecure && url.protocol === 'http:' && isLoopback(hostOf(url));
|
|
72
126
|
if (url.protocol !== 'https:' && !loopbackHttp)
|
|
73
127
|
throw invalidArgument('PIN/TAN requires an https URL', 'url');
|
|
74
128
|
}
|
|
75
129
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
130
|
+
* `pin`, unless FinTS 3.0 cannot send it: throws `TypeError` for an empty PIN, which the bank would count as a failed
|
|
131
|
+
* attempt, for one with leading or trailing blanks, which would go out without them since FinTS values carry none
|
|
132
|
+
* (Formals B.4.1), and for one with characters outside ISO 8859-1.
|
|
78
133
|
*
|
|
79
134
|
* The message leaves out the value.
|
|
80
135
|
*/
|
|
81
136
|
export function requirePin(pin) {
|
|
82
|
-
if (pin
|
|
137
|
+
if (trimBlanks(pin) === '')
|
|
83
138
|
throw invalidArgument('The PIN is empty', 'pin');
|
|
84
|
-
if (pin
|
|
139
|
+
if (trimBlanks(pin) !== pin)
|
|
85
140
|
throw invalidArgument('The PIN begins or ends with a blank', 'pin');
|
|
86
|
-
return pin;
|
|
141
|
+
return requireLatin1(pin, 'pin');
|
|
87
142
|
}
|
|
88
143
|
/**
|
|
89
144
|
* Throws `TypeError` if `pin` is shorter than `min` or longer than `max` characters, the bank's limits: the bank would
|
package/dist/core/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,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AI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,GAAG,CAAC,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5D,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChB,MAAM,eAAe,CAAC,0BAA0B,KAAK,aAAa,EAAE,KAAK,CAAC,CAAC;IAC7E,CAAC;AACH,CAAC;AAED,MAAM,eAAe,GAAG,+CAA+C,CAAC;AAExE;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,KAAK,KAAK,IAAI,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -1,54 +1,101 @@
|
|
|
1
1
|
import { type FinTsFeedback } from './feedback.js';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Base class of all errors the client raises about the bank and its data.
|
|
4
|
+
*
|
|
5
|
+
* Each error class states its `name`: a minifier renames classes, and `constructor.name` would show a meaningless one.
|
|
6
|
+
*/
|
|
3
7
|
export declare abstract class FinTsError extends Error {
|
|
4
|
-
|
|
8
|
+
abstract name: string;
|
|
5
9
|
}
|
|
6
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* The connection to the bank failed or returned an HTTP error.
|
|
12
|
+
*
|
|
13
|
+
* It carries no `cause`: the transport's own error may hold the message it was sending, PIN and TAN included.
|
|
14
|
+
*/
|
|
7
15
|
export declare class FinTsTransportError extends FinTsError {
|
|
8
|
-
|
|
16
|
+
name: string;
|
|
17
|
+
/**
|
|
18
|
+
* The HTTP status code of the bank's answer, `undefined` where none came, for example after a timeout; the client
|
|
19
|
+
* acts on it (`FinTsTransport.post`).
|
|
20
|
+
*/
|
|
9
21
|
readonly statusCode: number | undefined;
|
|
10
22
|
constructor(message: string, options?: {
|
|
11
23
|
statusCode?: number;
|
|
12
|
-
cause?: unknown;
|
|
13
24
|
});
|
|
14
25
|
}
|
|
15
26
|
/** The bank's response could not be understood. */
|
|
16
27
|
export declare class FinTsProtocolError extends FinTsError {
|
|
17
|
-
|
|
28
|
+
name: string;
|
|
18
29
|
}
|
|
19
30
|
/** The bank does not offer the requested business transaction. */
|
|
20
31
|
export declare class FinTsUnsupportedError extends FinTsError {
|
|
21
|
-
|
|
32
|
+
name: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The client has no TAN method or medium to log in with: the method in use needs a TAN medium the client could not
|
|
36
|
+
* learn, or the bank offers the user only TAN methods the client cannot run. Pass a medium to
|
|
37
|
+
* `FinTsClient.selectTanMethod`, or choose another method.
|
|
38
|
+
*
|
|
39
|
+
* The client does not send a login the bank would refuse for it, but the steps before, such as the synchronization or
|
|
40
|
+
* the lookup of the TAN media, may have gone out.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FinTsTanSetupError extends FinTsError {
|
|
43
|
+
name: string;
|
|
22
44
|
}
|
|
23
45
|
/**
|
|
24
|
-
* The bank rejected the request; `feedback` holds all return codes.
|
|
46
|
+
* The bank rejected the request; `feedback` holds all return codes. A refused login is a `FinTsLoginRefusedError`.
|
|
25
47
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
48
|
+
* The message is not safe to log: by default it holds the code, text and parameters of each error the bank names, such
|
|
49
|
+
* as an IBAN or a login name, and so does `stack`. Log `codes` instead. `feedback` is a getter, not a field, so that
|
|
50
|
+
* `JSON.stringify` and Node.js's report of an uncaught error, which show an error's fields as they are, leave out at
|
|
51
|
+
* least the warnings and successes, such as the new login data of return code 3072.
|
|
28
52
|
*/
|
|
29
53
|
export declare class FinTsBankError extends FinTsError {
|
|
54
|
+
#private;
|
|
55
|
+
name: string;
|
|
56
|
+
/**
|
|
57
|
+
* A rejection with the return codes in `feedback`; `message` defaults to the errors among them, with the bank's texts
|
|
58
|
+
* and parameters, such as `9010: Konto gesperrt [DE89370400440532013000]`, so it is not safe to log.
|
|
59
|
+
*/
|
|
60
|
+
constructor(feedback: readonly FinTsFeedback[], message?: string);
|
|
30
61
|
/** All return codes of the response, warnings and successes included. */
|
|
31
|
-
|
|
32
|
-
/** A rejection with the return codes in `feedback`; `message` defaults to the errors among them. */
|
|
33
|
-
constructor(feedback: readonly FinTsFeedback[], message?: string, name?: string);
|
|
62
|
+
get feedback(): readonly FinTsFeedback[];
|
|
34
63
|
/** The return codes of `feedback`. */
|
|
35
64
|
get codes(): string[];
|
|
36
65
|
}
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The bank refused the login, so the client sends the PIN no more: every later call that would send it fails with this
|
|
68
|
+
* error without contacting the bank, also in a client restored from the saved state, until
|
|
69
|
+
* `FinTsClient.clearLoginRefusal` takes a PIN the user has entered anew; for good where the bank has changed the login
|
|
70
|
+
* data (`FinTsLoginDataChangedError`).
|
|
71
|
+
*
|
|
72
|
+
* Banks lock the access after a few failed logins, and a return code does not always tell whether the PIN was the
|
|
73
|
+
* reason, so any error in the answer to a login refuses it, also one that ends the dialog, and so does a wrong PIN
|
|
74
|
+
* wherever the bank reports it. Only where the bank names a reason the client can take care of, another TAN method or a
|
|
75
|
+
* new customer system ID, does the same call log in once more, for each reason once. The client refuses the login
|
|
76
|
+
* itself where it could not read the answers to two logins in a row, which the bank may have counted as failed
|
|
77
|
+
* attempts; `feedback` is empty then.
|
|
78
|
+
*/
|
|
79
|
+
export declare class FinTsLoginRefusedError extends FinTsBankError {
|
|
80
|
+
name: string;
|
|
81
|
+
}
|
|
82
|
+
/** Wrong or blocked PIN. */
|
|
83
|
+
export declare class FinTsPinError extends FinTsLoginRefusedError {
|
|
84
|
+
name: string;
|
|
40
85
|
}
|
|
41
86
|
/** Invalid, expired or rejected TAN, as the bank reports it in answer to a TAN or to an approval status request. */
|
|
42
87
|
export declare class FinTsTanError extends FinTsBankError {
|
|
43
|
-
|
|
88
|
+
name: string;
|
|
44
89
|
}
|
|
45
90
|
/**
|
|
46
|
-
* The bank has changed the user's login data and expects the new ones from now on (return code 3072)
|
|
91
|
+
* The bank has changed the user's login data and expects the new ones from now on (return code 3072), also where it
|
|
92
|
+
* names an error next to them, but for a rejected PIN, which is a `FinTsPinError`.
|
|
47
93
|
*
|
|
48
|
-
* The client has ended the dialog,
|
|
49
|
-
* `loginName` replaces user ID and customer ID: pass it as `userId`, without a customer ID.
|
|
94
|
+
* The client has ended the dialog, where the bank opened one, and logs in with the old data no more. Create a new
|
|
95
|
+
* client with the new data; a `loginName` replaces user ID and customer ID: pass it as `userId`, without a customer ID.
|
|
50
96
|
*/
|
|
51
|
-
export declare class FinTsLoginDataChangedError extends
|
|
97
|
+
export declare class FinTsLoginDataChangedError extends FinTsLoginRefusedError {
|
|
98
|
+
name: string;
|
|
52
99
|
constructor(feedback: readonly FinTsFeedback[]);
|
|
53
100
|
/** The new user ID (Benutzerkennung); `undefined` where the bank names none. */
|
|
54
101
|
get userId(): string | undefined;
|
|
@@ -58,16 +105,24 @@ export declare class FinTsLoginDataChangedError extends FinTsBankError {
|
|
|
58
105
|
get loginName(): string | undefined;
|
|
59
106
|
private parameter;
|
|
60
107
|
}
|
|
61
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* The bank ended the dialog, for example after a timeout; the next call logs in anew. Where the bank ends the dialog
|
|
110
|
+
* in answer to a login, the call fails with `FinTsLoginRefusedError` instead.
|
|
111
|
+
*/
|
|
62
112
|
export declare class FinTsDialogAbortedError extends FinTsBankError {
|
|
63
|
-
|
|
113
|
+
name: string;
|
|
64
114
|
}
|
|
65
115
|
/** The user cancelled the TAN entry or the approval in the banking app. */
|
|
66
116
|
export declare class FinTsTanCancelledError extends FinTsError {
|
|
117
|
+
name: string;
|
|
67
118
|
constructor();
|
|
68
119
|
}
|
|
69
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* The user did not approve in the banking app in time: within the status requests the bank allows, 60 where it states
|
|
122
|
+
* none, and 10 minutes of polling at most.
|
|
123
|
+
*/
|
|
70
124
|
export declare class FinTsDecoupledTimeoutError extends FinTsError {
|
|
125
|
+
name: string;
|
|
71
126
|
constructor();
|
|
72
127
|
}
|
|
73
128
|
/**
|
|
@@ -76,8 +131,10 @@ export declare class FinTsDecoupledTimeoutError extends FinTsError {
|
|
|
76
131
|
* It does not extend `FinTsError`: it tells about the app's use of the client, not about the bank.
|
|
77
132
|
*/
|
|
78
133
|
export declare class FinTsStateError extends Error {
|
|
79
|
-
|
|
134
|
+
name: string;
|
|
80
135
|
}
|
|
136
|
+
/** The error of whatever a closed client is asked to do. */
|
|
137
|
+
export declare function clientClosedError(): FinTsStateError;
|
|
81
138
|
/**
|
|
82
139
|
* The most specific error for the errors in `feedback`, the answer to a message that `completesApproval` or not.
|
|
83
140
|
*
|
|
@@ -86,6 +143,23 @@ export declare class FinTsStateError extends Error {
|
|
|
86
143
|
* for a wrong TAN, after which it would send the PIN again.
|
|
87
144
|
*/
|
|
88
145
|
export declare function bankErrorFor(feedback: readonly FinTsFeedback[], completesApproval?: boolean): FinTsBankError;
|
|
89
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* The refusal of a login whose answer carried `feedback`: `FinTsPinError` for a rejected PIN, else
|
|
148
|
+
* `FinTsLoginDataChangedError` for new login data, also next to other errors, and `FinTsLoginRefusedError` for anything
|
|
149
|
+
* else. The same for a refusal restored from the saved state, which keeps only `feedback`.
|
|
150
|
+
*
|
|
151
|
+
* New login data end the old ones for good, so the session takes care of no other reason the answer names.
|
|
152
|
+
*/
|
|
153
|
+
export declare function loginRefusalFor(feedback: readonly FinTsFeedback[]): FinTsLoginRefusedError;
|
|
154
|
+
/**
|
|
155
|
+
* Runs `parse` on data from the bank and reports malformed data as `FinTsProtocolError`, whose message leaves the data
|
|
156
|
+
* out (`FormatError`).
|
|
157
|
+
*/
|
|
90
158
|
export declare function parseBankData<T>(parse: () => T): T;
|
|
159
|
+
/**
|
|
160
|
+
* Runs `lookup`, which only completes data, such as the SEPA account list; `undefined` where the bank rejects it, so
|
|
161
|
+
* that the caller carries on without it. An aborted dialog counts as a rejection: banks end the dialog along with many.
|
|
162
|
+
* A refused login and a rejected TAN fail the call: the user must hear of them.
|
|
163
|
+
*/
|
|
164
|
+
export declare function tryLookUp<T>(lookup: () => Promise<T>): Promise<T | undefined>;
|
|
91
165
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsC,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEvF;;;;GAIG;AACH,8BAAsB,UAAW,SAAQ,KAAK;IAC5C,SAAkB,IAAI,EAAE,MAAM,CAAC;CAChC;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,UAAU;IACxC,IAAI,SAAyB;IAEtC;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE5B,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;CAI/D;AAED,mDAAmD;AACnD,qBAAa,kBAAmB,SAAQ,UAAU;IACvC,IAAI,SAAwB;CACtC;AAED,kEAAkE;AAClE,qBAAa,qBAAsB,SAAQ,UAAU;IAC1C,IAAI,SAA2B;CACzC;AAED;;;;;;;GAOG;AACH,qBAAa,kBAAmB,SAAQ,UAAU;IACvC,IAAI,SAAwB;CACtC;AAED;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,UAAU;;IACnC,IAAI,SAAoB;IAIjC;;;OAGG;gBACS,QAAQ,EAAE,SAAS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