@coderoftime/fints 0.1.0 → 0.2.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 +142 -1
- package/README.md +127 -37
- package/dist/client.d.ts +48 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +199 -0
- package/dist/client.js.map +1 -0
- package/dist/core/account.d.ts +35 -7
- package/dist/core/account.d.ts.map +1 -1
- package/dist/core/account.js +84 -13
- package/dist/core/account.js.map +1 -1
- package/dist/core/amount.d.ts +2 -1
- package/dist/core/amount.d.ts.map +1 -1
- package/dist/core/amount.js +4 -1
- package/dist/core/amount.js.map +1 -1
- package/dist/core/balance.d.ts +1 -0
- package/dist/core/balance.d.ts.map +1 -1
- package/dist/core/balance.js +6 -5
- package/dist/core/balance.js.map +1 -1
- package/dist/core/bank-info.d.ts +1 -1
- package/dist/core/bank-info.js +1 -1
- package/dist/core/client.d.ts +50 -15
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/config.d.ts +28 -16
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +66 -26
- package/dist/core/config.js.map +1 -1
- package/dist/core/errors.d.ts +85 -23
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +112 -47
- package/dist/core/errors.js.map +1 -1
- package/dist/core/feedback.d.ts +4 -1
- package/dist/core/feedback.d.ts.map +1 -1
- package/dist/core/feedback.js +4 -1
- package/dist/core/feedback.js.map +1 -1
- package/dist/core/transaction.d.ts +6 -1
- package/dist/core/transaction.d.ts.map +1 -1
- package/dist/core/transaction.js +9 -4
- package/dist/core/transaction.js.map +1 -1
- package/dist/core/transport.d.ts +33 -6
- package/dist/core/transport.d.ts.map +1 -1
- package/dist/core/transport.js +77 -20
- package/dist/core/transport.js.map +1 -1
- package/dist/formats/camt.d.ts +24 -4
- package/dist/formats/camt.d.ts.map +1 -1
- package/dist/formats/camt.js +124 -41
- package/dist/formats/camt.js.map +1 -1
- package/dist/formats/mt940.d.ts +15 -3
- package/dist/formats/mt940.d.ts.map +1 -1
- package/dist/formats/mt940.js +161 -82
- 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 +24 -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 +6 -0
- package/dist/formats/sepa-purpose.d.ts.map +1 -1
- package/dist/formats/sepa-purpose.js +23 -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 +7 -10
- package/dist/session/dialog-runner.d.ts.map +1 -1
- package/dist/session/dialog-runner.js +15 -16
- 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 +156 -84
- 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 +33 -25
- package/dist/session/session-setup.d.ts.map +1 -1
- package/dist/session/session-setup.js +87 -65
- package/dist/session/session-setup.js.map +1 -1
- package/dist/session/session-state.d.ts +9 -6
- package/dist/session/session-state.d.ts.map +1 -1
- package/dist/session/session-state.js +52 -17
- package/dist/session/session-state.js.map +1 -1
- package/dist/session/signed-dialog.d.ts +77 -0
- package/dist/session/signed-dialog.d.ts.map +1 -0
- package/dist/session/signed-dialog.js +170 -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 +8 -4
- package/dist/session/user-prompts.d.ts.map +1 -1
- package/dist/session/user-prompts.js +34 -14
- package/dist/session/user-prompts.js.map +1 -1
- package/dist/tan/challenge.d.ts +34 -13
- package/dist/tan/challenge.d.ts.map +1 -1
- package/dist/tan/challenge.js +25 -26
- package/dist/tan/challenge.js.map +1 -1
- package/dist/tan/flicker.d.ts +7 -1
- package/dist/tan/flicker.d.ts.map +1 -1
- package/dist/tan/flicker.js +40 -6
- package/dist/tan/flicker.js.map +1 -1
- package/dist/tan/tan-image.d.ts +3 -2
- package/dist/tan/tan-image.d.ts.map +1 -1
- package/dist/tan/tan-image.js +7 -5
- package/dist/tan/tan-image.js.map +1 -1
- package/dist/tan/tan-models.d.ts +5 -1
- package/dist/tan/tan-models.d.ts.map +1 -1
- package/dist/tan/tan-models.js +10 -5
- package/dist/tan/tan-models.js.map +1 -1
- package/dist/util/async.d.ts +0 -2
- package/dist/util/async.d.ts.map +1 -1
- package/dist/util/async.js +0 -4
- package/dist/util/async.js.map +1 -1
- package/dist/util/bytes.d.ts +2 -3
- package/dist/util/bytes.d.ts.map +1 -1
- package/dist/util/bytes.js +12 -20
- 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 +9 -16
- package/dist/util/dates.d.ts.map +1 -1
- package/dist/util/dates.js +39 -19
- package/dist/util/dates.js.map +1 -1
- package/dist/util/errors.d.ts +9 -1
- package/dist/util/errors.d.ts.map +1 -1
- package/dist/util/errors.js +12 -3
- package/dist/util/errors.js.map +1 -1
- 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 +21 -4
- package/dist/util/text.d.ts.map +1 -1
- package/dist/util/text.js +42 -13
- package/dist/util/text.js.map +1 -1
- package/dist/util/xml.d.ts +4 -3
- package/dist/util/xml.d.ts.map +1 -1
- package/dist/util/xml.js +37 -26
- 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 +34 -0
- package/dist/v3/bank-connection.d.ts.map +1 -0
- package/dist/v3/bank-connection.js +58 -0
- package/dist/v3/bank-connection.js.map +1 -0
- package/dist/v3/dialog.d.ts +80 -46
- package/dist/v3/dialog.d.ts.map +1 -1
- package/dist/v3/dialog.js +162 -59
- package/dist/v3/dialog.js.map +1 -1
- package/dist/v3/message.d.ts +17 -4
- package/dist/v3/message.d.ts.map +1 -1
- package/dist/v3/message.js +62 -18
- package/dist/v3/message.js.map +1 -1
- package/dist/v3/parameter-store.d.ts +75 -0
- package/dist/v3/parameter-store.d.ts.map +1 -0
- package/dist/v3/parameter-store.js +143 -0
- package/dist/v3/parameter-store.js.map +1 -0
- package/dist/v3/parameters.d.ts +38 -12
- package/dist/v3/parameters.d.ts.map +1 -1
- package/dist/v3/parameters.js +91 -37
- package/dist/v3/parameters.js.map +1 -1
- package/dist/v3/protocol.d.ts +43 -50
- package/dist/v3/protocol.d.ts.map +1 -1
- package/dist/v3/protocol.js +58 -208
- 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 +120 -0
- package/dist/v3/queries.js.map +1 -0
- package/dist/v3/segments.d.ts +29 -12
- package/dist/v3/segments.d.ts.map +1 -1
- package/dist/v3/segments.js +65 -23
- package/dist/v3/segments.js.map +1 -1
- package/dist/v3/syntax.d.ts +65 -14
- package/dist/v3/syntax.d.ts.map +1 -1
- package/dist/v3/syntax.js +167 -101
- package/dist/v3/syntax.js.map +1 -1
- package/package.json +10 -6
- package/src/client.ts +252 -0
- package/src/core/account.ts +86 -13
- package/src/core/amount.ts +3 -1
- package/src/core/balance.ts +6 -5
- package/src/core/bank-info.ts +1 -1
- package/src/core/client.ts +52 -15
- package/src/core/config.ts +69 -28
- package/src/core/errors.ts +122 -48
- package/src/core/feedback.ts +4 -1
- package/src/core/transaction.ts +9 -4
- package/src/core/transport.ts +98 -23
- package/src/formats/camt.ts +136 -39
- package/src/formats/mt940.ts +167 -81
- package/src/formats/readers.ts +24 -31
- package/src/formats/record-budget.ts +18 -0
- package/src/formats/sepa-purpose.ts +21 -2
- package/src/index.ts +4 -2
- package/src/session/app-approval.ts +51 -38
- package/src/session/dialog-runner.ts +31 -28
- package/src/session/login-guard.ts +174 -88
- package/src/session/sepa-accounts.ts +63 -45
- package/src/session/session-setup.ts +90 -71
- package/src/session/session-state.ts +56 -22
- package/src/session/signed-dialog.ts +192 -0
- package/src/session/tan-selection.ts +50 -39
- package/src/session/user-prompts.ts +35 -16
- package/src/tan/challenge.ts +40 -31
- package/src/tan/flicker.ts +44 -6
- package/src/tan/tan-image.ts +7 -5
- package/src/tan/tan-models.ts +10 -5
- package/src/util/async.ts +0 -5
- package/src/util/bytes.ts +13 -19
- package/src/util/call-context.ts +3 -2
- package/src/util/dates.ts +41 -24
- package/src/util/errors.ts +14 -3
- package/src/util/json.ts +16 -0
- package/src/util/text.ts +42 -12
- package/src/util/xml.ts +37 -26
- package/src/v3/account-extension.ts +7 -12
- package/src/v3/bank-connection.ts +67 -0
- package/src/v3/dialog.ts +175 -91
- package/src/v3/message.ts +69 -17
- package/src/v3/parameter-store.ts +160 -0
- package/src/v3/parameters.ts +110 -37
- package/src/v3/protocol.ts +70 -253
- package/src/v3/queries.ts +190 -0
- package/src/v3/segments.ts +65 -22
- package/src/v3/syntax.ts +153 -91
- 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/v3/protocol.js
CHANGED
|
@@ -1,83 +1,35 @@
|
|
|
1
1
|
// Internal to the package, and named after the FinTS specification. Documentation is where the meaning is not evident.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { hasErrors } from '../core/feedback.js';
|
|
5
|
-
import { camtTransactions, mt940Transactions } from '../formats/readers.js';
|
|
6
|
-
import { BankConnection, checkMessageSize } from '../session/bank-connection.js';
|
|
7
|
-
import { LoginGuard } from '../session/login-guard.js';
|
|
8
|
-
import { offeredVersion, requireBankParameters } from '../session/parameter-data.js';
|
|
9
|
-
import { balanceQuery, checkBeforeSigning, chooseTransactions, } from '../session/protocol.js';
|
|
10
|
-
import { invalidArgument } from '../util/errors.js';
|
|
11
|
-
import { readOptionalString } from '../util/json.js';
|
|
2
|
+
import { requirePinLength } from '../core/config.js';
|
|
3
|
+
import { clientClosedError } from '../core/errors.js';
|
|
12
4
|
import { decodeBankText } from '../util/text.js';
|
|
13
|
-
import {
|
|
14
|
-
import { buildMessage, decodeTransport, encodeTransport
|
|
15
|
-
import {
|
|
16
|
-
import { balanceAccount, parseBalance, parseSepaAccounts, parseTanMedia, Segments } from './segments.js';
|
|
17
|
-
import { isLatin1 } from './syntax.js';
|
|
5
|
+
import { BankConnection, checkMessageSize } from './bank-connection.js';
|
|
6
|
+
import { buildMessage, decodeTransport, encodeTransport } from './message.js';
|
|
7
|
+
import { Segments } from './segments.js';
|
|
18
8
|
/** Customer ID the specification reserves for anonymous dialogs. */
|
|
19
9
|
const anonymousCustomerId = '9999999999';
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
function requireLatin1(text, name) {
|
|
24
|
-
// The message leaves out the value, which may be the PIN.
|
|
25
|
-
if (!isLatin1(text))
|
|
26
|
-
throw invalidArgument(`${name} contains characters FinTS 3.0 cannot send (ISO 8859-1 only)`);
|
|
27
|
-
return text;
|
|
10
|
+
/** Whether `segments` are those of a dialog end, the one message a closing client still sends. */
|
|
11
|
+
function isDialogEnd(segments) {
|
|
12
|
+
return segments.length === 1 && segments[0].type === 'HKEND';
|
|
28
13
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
requireLatin1(config.userId, 'userId');
|
|
35
|
-
requireLatin1(config.customerId, 'customerId');
|
|
36
|
-
requireLatin1(config.productId, 'productId');
|
|
37
|
-
requireLatin1(config.productVersion, 'productVersion');
|
|
38
|
-
// Cut short, the product would be one the bank does not know.
|
|
39
|
-
requireMaxLength(config.productId, maxProductIdLength, 'productId');
|
|
40
|
-
requireMaxLength(config.productVersion, maxProductVersionLength, 'productVersion');
|
|
41
|
-
return config;
|
|
42
|
-
}
|
|
43
|
-
/** The segments of `type` in all `pages`. */
|
|
44
|
-
function all(pages, type) {
|
|
45
|
-
return pages.flatMap((p) => p.findAll(type));
|
|
46
|
-
}
|
|
47
|
-
/** FinTS 3.0 messages and business transactions (HBCI segment syntax, PIN/TAN security). */
|
|
14
|
+
/**
|
|
15
|
+
* Builds, signs and posts FinTS 3.0 messages (HBCI segment syntax, PIN/TAN security) for the user `parameters.config`
|
|
16
|
+
* names, with the parameter data and IDs `parameters` keeps. Every message signed with the PIN takes it from the
|
|
17
|
+
* `PinGuard` (`post`), which keeps it from going out after a refused login.
|
|
18
|
+
*/
|
|
48
19
|
export class FinTs3Protocol {
|
|
20
|
+
parameters;
|
|
21
|
+
guard;
|
|
49
22
|
config;
|
|
50
|
-
pin;
|
|
51
23
|
connection;
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
constructor(config, pin, transport, logger) {
|
|
62
|
-
this.config = requireSendable(config);
|
|
63
|
-
this.pin = requireLatin1(requirePin(pin), 'pin');
|
|
64
|
-
this.connection = new BankConnection(config.url, transport, logger);
|
|
65
|
-
}
|
|
66
|
-
get bankParameters() {
|
|
67
|
-
return this.bpd;
|
|
68
|
-
}
|
|
69
|
-
get userParameters() {
|
|
70
|
-
return this.upd;
|
|
71
|
-
}
|
|
72
|
-
/** Dialogs cannot start without the customer system ID. */
|
|
73
|
-
get synchronization() {
|
|
74
|
-
return this.systemId === undefined ? 'required' : 'none';
|
|
75
|
-
}
|
|
76
|
-
forgetSystemId() {
|
|
77
|
-
const had = this.systemId !== undefined;
|
|
78
|
-
this.systemId = undefined;
|
|
79
|
-
return had;
|
|
80
|
-
}
|
|
24
|
+
/** Whether the client is closing, so that only dialog ends go out (`beginClose`). */
|
|
25
|
+
closing = false;
|
|
26
|
+
constructor(parameters, guard, transport, logger) {
|
|
27
|
+
this.parameters = parameters;
|
|
28
|
+
this.guard = guard;
|
|
29
|
+
this.config = parameters.config;
|
|
30
|
+
this.connection = new BankConnection(this.config.url, transport, logger);
|
|
31
|
+
}
|
|
32
|
+
/** Identification (HKIDN) and processing preparation (HKVVB), which open every dialog. */
|
|
81
33
|
initSegments(systemId, anonymous = false) {
|
|
82
34
|
return [
|
|
83
35
|
Segments.identification({
|
|
@@ -88,18 +40,26 @@ export class FinTs3Protocol {
|
|
|
88
40
|
systemIdRequired: !anonymous,
|
|
89
41
|
}),
|
|
90
42
|
Segments.processingPreparation({
|
|
91
|
-
bpdVersion: this.
|
|
92
|
-
updVersion: anonymous ? 0 :
|
|
93
|
-
language: this.
|
|
43
|
+
bpdVersion: this.parameters.reportedBpdVersion,
|
|
44
|
+
updVersion: anonymous ? 0 : this.parameters.reportedUpdVersion,
|
|
45
|
+
language: this.parameters.bankParameters?.dialogLanguage ?? 0,
|
|
94
46
|
productId: this.config.productId,
|
|
95
47
|
productVersion: this.config.productVersion,
|
|
96
48
|
}),
|
|
97
49
|
];
|
|
98
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Sends `segments` as message `number` of the dialog `dialogId` and returns the bank's answer, not yet parsed.
|
|
53
|
+
*
|
|
54
|
+
* With `signing` the message is signed with the PIN, which `PinGuard.pin` hands out, and the `tan`; without, it
|
|
55
|
+
* goes out unsigned, as in an anonymous dialog.
|
|
56
|
+
*/
|
|
99
57
|
async post(message) {
|
|
58
|
+
if (this.closing && !isDialogEnd(message.segments))
|
|
59
|
+
throw clientClosedError();
|
|
100
60
|
const signing = message.signing;
|
|
101
|
-
|
|
102
|
-
|
|
61
|
+
// The first message of a signed dialog logs in: from here on the bank may count the PIN.
|
|
62
|
+
const login = signing !== undefined && message.number === 1;
|
|
103
63
|
const outgoing = buildMessage({
|
|
104
64
|
dialogId: message.dialogId,
|
|
105
65
|
messageNumber: message.number,
|
|
@@ -111,150 +71,40 @@ export class FinTs3Protocol {
|
|
|
111
71
|
bankCode: this.config.bankCode,
|
|
112
72
|
userId: this.config.userId,
|
|
113
73
|
systemId: signing.systemId,
|
|
114
|
-
pin: this.pin,
|
|
74
|
+
pin: login ? this.pinForLogin() : this.guard.pin,
|
|
115
75
|
securityFunction: signing.securityFunction,
|
|
116
76
|
},
|
|
117
77
|
tan: message.tan,
|
|
118
78
|
});
|
|
119
|
-
checkMessageSize(outgoing.bytes.length, this.
|
|
79
|
+
checkMessageSize(outgoing.bytes.length, this.parameters.bankParameters?.bankInfo.maxMessageSize);
|
|
120
80
|
this.connection.log('outgoing', () => outgoing.masked);
|
|
81
|
+
if (login)
|
|
82
|
+
this.guard.loginSent();
|
|
121
83
|
const bytes = decodeTransport(await this.connection.post(encodeTransport(outgoing.bytes), 'text/plain'));
|
|
122
84
|
this.connection.log('incoming', () => decodeBankText(bytes));
|
|
123
85
|
return bytes;
|
|
124
86
|
}
|
|
125
|
-
keepParameterData(response) {
|
|
126
|
-
this.keepBankParameters(response);
|
|
127
|
-
this.upd = Upd3.fromSegments(response.segments, this.config.bankCode, this.config.countryCode) ?? this.upd;
|
|
128
|
-
this.systemId = response.find('HISYN')?.text(1) ?? this.systemId;
|
|
129
|
-
}
|
|
130
|
-
keepBankParameters(response) {
|
|
131
|
-
this.bpd = Bpd3.fromSegments(response.segments, this.config.bankCode) ?? this.bpd;
|
|
132
|
-
}
|
|
133
|
-
/** Keeps the bank parameter data of an anonymous dialog, and nothing that belongs to a user. */
|
|
134
|
-
async fetchBankParametersAnonymously() {
|
|
135
|
-
const response = await this.requestBankParametersAnonymously();
|
|
136
|
-
this.keepBankParameters(response);
|
|
137
|
-
return response;
|
|
138
|
-
}
|
|
139
87
|
/**
|
|
140
|
-
*
|
|
141
|
-
* rejects the announcement, with a return code or by failing on it, is asked again without it.
|
|
88
|
+
* The PIN to sign a login with, the first message of a dialog.
|
|
142
89
|
*
|
|
143
|
-
*
|
|
90
|
+
* Throws instead where the guard holds the PIN back (`PinGuard.pin`), or if the bank parameters rule out the PIN's
|
|
91
|
+
* length: the bank would count such a PIN as a failed attempt. The later messages of a dialog, its end included, take
|
|
92
|
+
* the PIN the bank has accepted, whatever the parameter data it delivered since say.
|
|
144
93
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
catch (error) {
|
|
151
|
-
if (error instanceof FinTsTransportError && error.statusCode === undefined)
|
|
152
|
-
throw error;
|
|
153
|
-
if (!(error instanceof FinTsError))
|
|
154
|
-
throw error;
|
|
155
|
-
return this.anonymousDialog(false);
|
|
156
|
-
}
|
|
157
|
-
if (!hasErrors(announced.feedback) || announced.find('HIBPA') !== undefined)
|
|
158
|
-
return announced;
|
|
159
|
-
return this.anonymousDialog(false);
|
|
160
|
-
}
|
|
161
|
-
async anonymousDialog(announceSca) {
|
|
162
|
-
const dialog = FinTs3Dialog.anonymous(this);
|
|
163
|
-
try {
|
|
164
|
-
return await dialog.requestBankParameters(announceSca);
|
|
165
|
-
}
|
|
166
|
-
finally {
|
|
167
|
-
await dialog.end();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
newDialog(method, tanMedium) {
|
|
171
|
-
return FinTs3Dialog.signed(this, method, tanMedium);
|
|
172
|
-
}
|
|
173
|
-
combine(first, second) {
|
|
174
|
-
return IncomingMessage3.combine(first, second);
|
|
175
|
-
}
|
|
176
|
-
// --- Business transactions ---
|
|
177
|
-
version(transaction, implemented, options = {}) {
|
|
178
|
-
return offeredVersion(this.bpd, this.upd, transaction, new Set(implemented), options);
|
|
179
|
-
}
|
|
180
|
-
tanMedia() {
|
|
181
|
-
const version = this.version('HKTAB', [4, 5]);
|
|
182
|
-
if (version === undefined)
|
|
183
|
-
return undefined;
|
|
184
|
-
return {
|
|
185
|
-
order: () => Segments.tanMedia(version),
|
|
186
|
-
read: (pages) => all(pages, 'HITAB').flatMap(parseTanMedia),
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
sepaAccounts() {
|
|
190
|
-
const version = this.version('HKSPA', [1, 2, 3], { requiresEntry: true });
|
|
191
|
-
if (version === undefined)
|
|
192
|
-
return undefined;
|
|
193
|
-
return {
|
|
194
|
-
order: (continuation) => Segments.sepaAccounts(version, continuation),
|
|
195
|
-
read: (pages) => all(pages, 'HISPA').flatMap((s) => parseSepaAccounts(s, this.config.countryCode, this.config.bankCode)),
|
|
196
|
-
};
|
|
94
|
+
pinForLogin() {
|
|
95
|
+
const pin = this.guard.pin;
|
|
96
|
+
const length = this.parameters.bankParameters?.pinTan.pinLength;
|
|
97
|
+
requirePinLength(pin, length?.min, length?.max);
|
|
98
|
+
return pin;
|
|
197
99
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
accountOf: balanceAccount,
|
|
207
|
-
read: parseBalance,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
transactions(account, format, from, to) {
|
|
211
|
-
const request = chooseTransactions(format, account, this.upd, {
|
|
212
|
-
camt: { name: 'HKCAZ', version: this.version('HKCAZ', [1], { account }) },
|
|
213
|
-
camtFormats: requireBankParameters(this.bpd).camtFormats,
|
|
214
|
-
mt940: { name: 'HKKAZ', version: this.version('HKKAZ', [6, 7], { account }) },
|
|
215
|
-
});
|
|
216
|
-
const version = request.version;
|
|
217
|
-
if (request.camt) {
|
|
218
|
-
return {
|
|
219
|
-
order: (continuation) => Segments.transactionsCamt(version, account, request.camtFormats, { from, to, continuation }),
|
|
220
|
-
// The third element group holds the booked documents, the fourth element the pending one.
|
|
221
|
-
read: (pages) => camtTransactions(all(pages, 'HICAZ').flatMap((s) => s
|
|
222
|
-
.group(3)
|
|
223
|
-
.filter((d) => !d.isEmpty)
|
|
224
|
-
.map((d) => d.bytes)), all(pages, 'HICAZ')
|
|
225
|
-
.map((s) => s.binary(4))
|
|
226
|
-
.filter((d) => d !== undefined)),
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
return {
|
|
230
|
-
order: (continuation) => Segments.transactionsMt940(version, account, { from, to, continuation }),
|
|
231
|
-
// The first element holds the booked transactions, the second the pending ones.
|
|
232
|
-
read: (pages) => mt940Transactions(all(pages, 'HIKAZ')
|
|
233
|
-
.map((s) => s.binary(1))
|
|
234
|
-
.filter((d) => d !== undefined), all(pages, 'HIKAZ')
|
|
235
|
-
.map((s) => s.binary(2))
|
|
236
|
-
.filter((d) => d !== undefined), request.currency),
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
// --- Saved state ---
|
|
240
|
-
saveState() {
|
|
241
|
-
return {
|
|
242
|
-
systemId: this.systemId ?? null,
|
|
243
|
-
bpd: this.bpd === undefined ? null : encodeSegments(this.bpd.segments),
|
|
244
|
-
upd: this.upd === undefined ? null : encodeSegments(this.upd.segments),
|
|
245
|
-
};
|
|
246
|
-
}
|
|
247
|
-
restoreState(saved) {
|
|
248
|
-
const bpd = readOptionalString(saved, 'bpd');
|
|
249
|
-
const upd = readOptionalString(saved, 'upd');
|
|
250
|
-
const restoredSystemId = readOptionalString(saved, 'systemId');
|
|
251
|
-
const restoredBpd = bpd === undefined ? undefined : Bpd3.fromSegments(decodeSegments(bpd), this.config.bankCode);
|
|
252
|
-
const restoredUpd = upd === undefined
|
|
253
|
-
? undefined
|
|
254
|
-
: Upd3.fromSegments(decodeSegments(upd), this.config.bankCode, this.config.countryCode);
|
|
255
|
-
this.systemId = restoredSystemId;
|
|
256
|
-
this.bpd = restoredBpd;
|
|
257
|
-
this.upd = restoredUpd;
|
|
100
|
+
/**
|
|
101
|
+
* Aborts the request on its way, and sends nothing but dialog ends from now on: any other message fails with
|
|
102
|
+
* `FinTsStateError` before it goes out, so that a call under way stops at its next one. The client calls it as soon as
|
|
103
|
+
* it is closed, and `close` once it has ended its dialog.
|
|
104
|
+
*/
|
|
105
|
+
beginClose() {
|
|
106
|
+
this.closing = true;
|
|
107
|
+
this.connection.abortRequests();
|
|
258
108
|
}
|
|
259
109
|
close() {
|
|
260
110
|
this.connection.close();
|
package/dist/v3/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/v3/protocol.ts"],"names":[],"mappings":"AAAA,uHAAuH;AAKvH,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GAInB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAmB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAwC,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChG,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,cAA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C,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACK,WAAW;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,MAAM,CAAC,SAAS,CAAC;QAChE,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QAChD,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;;OAIG;IACH,UAAU;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;IAClC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Account } from '../core/account.js';
|
|
2
|
+
import type { Balance } from '../core/balance.js';
|
|
3
|
+
import type { FinTsFeedback } from '../core/feedback.js';
|
|
4
|
+
import type { Transaction, TransactionFormat } from '../core/transaction.js';
|
|
5
|
+
import type { TanMedium } from '../tan/tan-models.js';
|
|
6
|
+
import type { IncomingMessage3 } from './message.js';
|
|
7
|
+
import type { ParameterStore } from './parameter-store.js';
|
|
8
|
+
import type { Segment, SegmentSpec } from './syntax.js';
|
|
9
|
+
/**
|
|
10
|
+
* A business transaction: the order to send for each page, and how to read all pages the bank sent.
|
|
11
|
+
*
|
|
12
|
+
* Where the bank does not offer the transaction, the builders of the lookups the session makes for itself, of the TAN
|
|
13
|
+
* media and the SEPA accounts, return `undefined`, and those of the app's queries, of a balance and of transactions,
|
|
14
|
+
* throw `FinTsUnsupportedError`.
|
|
15
|
+
*/
|
|
16
|
+
export interface Query<T> {
|
|
17
|
+
/** The order for the page at `continuation`; `undefined` for the first page. */
|
|
18
|
+
readonly order: (continuation: string | undefined) => SegmentSpec;
|
|
19
|
+
/** Reads the result; throws `FormatError` for malformed data. */
|
|
20
|
+
readonly read: (pages: readonly IncomingMessage3[]) => T;
|
|
21
|
+
}
|
|
22
|
+
/** Lists the TAN media, and keeps the names as the bank sent them in `parameters`; `undefined` if the bank does not. */
|
|
23
|
+
export declare function tanMediaQuery(parameters: ParameterStore): Query<TanMedium[]> | undefined;
|
|
24
|
+
/** Lists IBAN and BIC of the accounts; `undefined` if the bank does not offer it. */
|
|
25
|
+
export declare function sepaAccountsQuery(parameters: ParameterStore): Query<Account[]> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The balance (HISAL) of `account` in `records`: the one whose account matches. A single record must match as well,
|
|
28
|
+
* though the query asked for this one account only: it names the account it is for.
|
|
29
|
+
*
|
|
30
|
+
* Throws `FinTsBankError` with the bank's `feedback` if there is none, and `FinTsProtocolError` if none matches.
|
|
31
|
+
*
|
|
32
|
+
* @internal Exported for the tests.
|
|
33
|
+
*/
|
|
34
|
+
export declare function balanceRecord(records: readonly Segment[], account: Account, feedback: readonly FinTsFeedback[]): Segment;
|
|
35
|
+
/**
|
|
36
|
+
* The balance of `account`, which the session has taken as the bank knows it, with the transactions the bank permits
|
|
37
|
+
* for it (`SepaAccounts.complete`); throws `FinTsUnsupportedError` if the bank does not report balances.
|
|
38
|
+
*/
|
|
39
|
+
export declare function balanceQuery(parameters: ParameterStore, account: Account): Query<Balance>;
|
|
40
|
+
/**
|
|
41
|
+
* The transactions of `account` in `format`, from the day of `from` to that of `to`. The session has taken `account` as
|
|
42
|
+
* the bank knows it, with the transactions the bank permits for it and its currency (`SepaAccounts.complete`).
|
|
43
|
+
*
|
|
44
|
+
* The client reads camt.052 only, so camt counts as offered only where the bank offers a camt.052 format. With `auto`
|
|
45
|
+
* the client takes camt where the bank offers it, unless the user parameter data list only MT940 transactions for the
|
|
46
|
+
* account.
|
|
47
|
+
*
|
|
48
|
+
* Throws `FinTsUnsupportedError` if the bank does not offer the chosen format for the account.
|
|
49
|
+
*/
|
|
50
|
+
export declare function transactionsQuery(parameters: ParameterStore, account: Account, format: TransactionFormat, from: Date | undefined, to: Date | undefined): Query<Transaction[]>;
|
|
51
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/v3/queries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,WAAW,KAAK,CAAC,CAAC;IACtB,gFAAgF;IAChF,QAAQ,CAAC,KAAK,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,KAAK,WAAW,CAAC;IAElE,iEAAiE;IACjE,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,KAAK,CAAC,CAAC;CAC1D;AAsBD,wHAAwH;AACxH,wBAAgB,aAAa,CAAC,UAAU,EAAE,cAAc,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC,GAAG,SAAS,CAYxF;AAED,qFAAqF;AACrF,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,cAAc,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,GAAG,SAAS,CAQ1F;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAiBzF;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,cAAc,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,IAAI,GAAG,SAAS,EACtB,EAAE,EAAE,IAAI,GAAG,SAAS,GACnB,KAAK,CAAC,WAAW,EAAE,CAAC,CAqDtB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Internal to the package, and named after the FinTS specification. Documentation is where the meaning is not evident.
|
|
2
|
+
import { FinTsBankError, FinTsProtocolError, FinTsUnsupportedError } from '../core/errors.js';
|
|
3
|
+
import { camtTransactions, mt940Transactions } from '../formats/readers.js';
|
|
4
|
+
import { lists, offeredVersion, requireBankParameters } from './parameters.js';
|
|
5
|
+
import { balanceAccount, camtAccount, parseBalance, parseSepaAccounts, parseTanMedia, Segments } from './segments.js';
|
|
6
|
+
/** The segments of `type` in all `pages`. */
|
|
7
|
+
function all(pages, type) {
|
|
8
|
+
return pages.flatMap((p) => p.findAll(type));
|
|
9
|
+
}
|
|
10
|
+
function version(parameters, transaction, implemented, options = {}) {
|
|
11
|
+
return offeredVersion(parameters.bankParameters, parameters.userParameters, transaction, new Set(implemented), options);
|
|
12
|
+
}
|
|
13
|
+
/** Lists the TAN media, and keeps the names as the bank sent them in `parameters`; `undefined` if the bank does not. */
|
|
14
|
+
export function tanMediaQuery(parameters) {
|
|
15
|
+
const offered = version(parameters, 'HKTAB', [4, 5]);
|
|
16
|
+
if (offered === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
return {
|
|
19
|
+
order: () => Segments.tanMedia(offered),
|
|
20
|
+
read: (pages) => {
|
|
21
|
+
const names = new Map();
|
|
22
|
+
const media = all(pages, 'HITAB').flatMap((s) => parseTanMedia(s, names));
|
|
23
|
+
parameters.keepTanMediumNames(names);
|
|
24
|
+
return media;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Lists IBAN and BIC of the accounts; `undefined` if the bank does not offer it. */
|
|
29
|
+
export function sepaAccountsQuery(parameters) {
|
|
30
|
+
const offered = version(parameters, 'HKSPA', [1, 2, 3], { requiresEntry: true });
|
|
31
|
+
if (offered === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
const { countryCode, bankCode } = parameters.config;
|
|
34
|
+
return {
|
|
35
|
+
order: (continuation) => Segments.sepaAccounts(offered, continuation),
|
|
36
|
+
read: (pages) => all(pages, 'HISPA').flatMap((s) => parseSepaAccounts(s, countryCode, bankCode)),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The balance (HISAL) of `account` in `records`: the one whose account matches. A single record must match as well,
|
|
41
|
+
* though the query asked for this one account only: it names the account it is for.
|
|
42
|
+
*
|
|
43
|
+
* Throws `FinTsBankError` with the bank's `feedback` if there is none, and `FinTsProtocolError` if none matches.
|
|
44
|
+
*
|
|
45
|
+
* @internal Exported for the tests.
|
|
46
|
+
*/
|
|
47
|
+
export function balanceRecord(records, account, feedback) {
|
|
48
|
+
if (records.length === 0)
|
|
49
|
+
throw new FinTsBankError(feedback, 'No balance returned');
|
|
50
|
+
const match = records.find((record) => balanceAccount(record).matches(account));
|
|
51
|
+
if (match === undefined) {
|
|
52
|
+
throw new FinTsProtocolError('The bank returned balances, but none for the requested account');
|
|
53
|
+
}
|
|
54
|
+
return match;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The balance of `account`, which the session has taken as the bank knows it, with the transactions the bank permits
|
|
58
|
+
* for it (`SepaAccounts.complete`); throws `FinTsUnsupportedError` if the bank does not report balances.
|
|
59
|
+
*/
|
|
60
|
+
export function balanceQuery(parameters, account) {
|
|
61
|
+
const offered = version(parameters, 'HKSAL', [6, 7, 8], { account });
|
|
62
|
+
if (offered === undefined) {
|
|
63
|
+
throw new FinTsUnsupportedError('The bank reports no balance (HKSAL) for this account');
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
order: (continuation) => Segments.balance(offered, account, continuation),
|
|
67
|
+
read: (pages) => parseBalance(balanceRecord(all(pages, 'HISAL'), account, pages.flatMap((p) => p.feedback)), account),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* The transactions of `account` in `format`, from the day of `from` to that of `to`. The session has taken `account` as
|
|
72
|
+
* the bank knows it, with the transactions the bank permits for it and its currency (`SepaAccounts.complete`).
|
|
73
|
+
*
|
|
74
|
+
* The client reads camt.052 only, so camt counts as offered only where the bank offers a camt.052 format. With `auto`
|
|
75
|
+
* the client takes camt where the bank offers it, unless the user parameter data list only MT940 transactions for the
|
|
76
|
+
* account.
|
|
77
|
+
*
|
|
78
|
+
* Throws `FinTsUnsupportedError` if the bank does not offer the chosen format for the account.
|
|
79
|
+
*/
|
|
80
|
+
export function transactionsQuery(parameters, account, format, from, to) {
|
|
81
|
+
const camtFormats = requireBankParameters(parameters.bankParameters).camtFormats.filter((f) => f.includes('camt.052'));
|
|
82
|
+
const camtVersion = camtFormats.length === 0 ? undefined : version(parameters, 'HKCAZ', [1], { account });
|
|
83
|
+
const camt = format === 'camt' ||
|
|
84
|
+
(format === 'auto' && camtVersion !== undefined && (lists(account, 'HKCAZ') || !lists(account, 'HKKAZ')));
|
|
85
|
+
const offered = camt ? camtVersion : version(parameters, 'HKKAZ', [6, 7], { account });
|
|
86
|
+
if (offered === undefined) {
|
|
87
|
+
throw new FinTsUnsupportedError(`The bank offers no ${camt ? 'camt ' : ''}transactions (${camt ? 'HKCAZ' : 'HKKAZ'}) for this account`);
|
|
88
|
+
}
|
|
89
|
+
if (camt) {
|
|
90
|
+
return {
|
|
91
|
+
order: (continuation) => Segments.transactionsCamt(offered, account, camtFormats, { from, to, continuation }),
|
|
92
|
+
// The first element names the account, the third element group holds the booked documents, the fourth
|
|
93
|
+
// element the pending one.
|
|
94
|
+
read: (pages) => {
|
|
95
|
+
const segments = all(pages, 'HICAZ');
|
|
96
|
+
if (!segments.every((s) => camtAccount(s).matches(account))) {
|
|
97
|
+
throw new FinTsProtocolError('The bank returned the transactions of another account than the one asked for');
|
|
98
|
+
}
|
|
99
|
+
return camtTransactions(segments.flatMap((s) => s
|
|
100
|
+
.group(3)
|
|
101
|
+
.filter((d) => !d.isEmpty)
|
|
102
|
+
.map((d) => d.bytes)), segments.map((s) => s.binary(4)).filter((d) => d !== undefined));
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
order: (continuation) => Segments.transactionsMt940(offered, account, { from, to, continuation }),
|
|
108
|
+
// The first element holds the booked transactions, the second the pending ones. Unlike HICAZ, HIKAZ names no
|
|
109
|
+
// account, and banks write the account line of a statement (`:25:`) in many ways, so it is not compared with
|
|
110
|
+
// `account`: a strict comparison would fail every query of such a bank.
|
|
111
|
+
read: (pages) => mt940Transactions(all(pages, 'HIKAZ')
|
|
112
|
+
.map((s) => s.binary(1))
|
|
113
|
+
.filter((d) => d !== undefined), all(pages, 'HIKAZ')
|
|
114
|
+
.map((s) => s.binary(2))
|
|
115
|
+
.filter((d) => d !== undefined),
|
|
116
|
+
// The currency of statements that state none.
|
|
117
|
+
account.currency),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/v3/queries.ts"],"names":[],"mappings":"AAAA,uHAAuH;AAIvH,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG9F,OAAO,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CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;qBACzB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CACvB,EACD,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAChE,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC;IACD,OAAO;QACL,KAAK,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC;QACjG,6GAA6G;QAC7G,6GAA6G;QAC7G,wEAAwE;QACxE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CACd,iBAAiB,CACf,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;aAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,EACjC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC;aAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aACvB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC;QACjC,8CAA8C;QAC9C,OAAO,CAAC,QAAQ,CACjB;KACJ,CAAC;AACJ,CAAC"}
|
package/dist/v3/segments.d.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { Account } from '../core/account.js';
|
|
2
2
|
import { Balance } from '../core/balance.js';
|
|
3
3
|
import { TanMedium } from '../tan/tan-models.js';
|
|
4
|
-
import { type Segment, SegmentSpec
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { type Segment, SegmentSpec } from './syntax.js';
|
|
5
|
+
/**
|
|
6
|
+
* The filler the specification names for a reference that does not exist.
|
|
7
|
+
*
|
|
8
|
+
* The bank puts it into a dummy answer when no approval is needed. The client sends it as the TAN medium name in the
|
|
9
|
+
* dialog that looks up the TAN media, before it knows a medium; the bank ignores it there (PIN/TAN B.4.3.1.3).
|
|
10
|
+
*/
|
|
11
|
+
export declare const noReference = "noref";
|
|
12
|
+
/**
|
|
13
|
+
* Builders for the request segments the client sends. Values the bank issued, such as the customer system ID, the TAN
|
|
14
|
+
* order reference and the position to continue at, go back as `Verbatim`.
|
|
15
|
+
*/
|
|
12
16
|
export declare const Segments: Readonly<{
|
|
13
17
|
/** HKIDN: who is logging in, from which customer system. */
|
|
14
18
|
identification(parts: {
|
|
@@ -29,7 +33,10 @@ export declare const Segments: Readonly<{
|
|
|
29
33
|
/** HKSYN: requests a new customer system ID. */
|
|
30
34
|
synchronization(): SegmentSpec;
|
|
31
35
|
dialogEnd(dialogId: string): SegmentSpec;
|
|
32
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* HKTAN process 4: asks for strong customer authentication of the `segmentType` sent in the same message, with the TAN
|
|
38
|
+
* medium `mediumName`, as the bank sent it.
|
|
39
|
+
*/
|
|
33
40
|
tanProcess4(version: number, segmentType: string, mediumName?: string): SegmentSpec;
|
|
34
41
|
/** HKTAN process 2: submits the TAN (carried in the signature) for the order with `reference`. */
|
|
35
42
|
tanProcess2(version: number, reference: string): SegmentSpec;
|
|
@@ -58,6 +65,7 @@ export declare const Segments: Readonly<{
|
|
|
58
65
|
export declare class TanResponse {
|
|
59
66
|
/** The TAN process the segment answers: `4` asks for an approval, `S` answers a status request. */
|
|
60
67
|
readonly process: string | undefined;
|
|
68
|
+
/** The order reference, as `Segment.verbatim` reads it, to send back byte for byte. */
|
|
61
69
|
readonly reference: string | undefined;
|
|
62
70
|
readonly challenge: string | undefined;
|
|
63
71
|
readonly hhdUc: Uint8Array | undefined;
|
|
@@ -65,7 +73,9 @@ export declare class TanResponse {
|
|
|
65
73
|
readonly mediumName: string | undefined;
|
|
66
74
|
constructor(
|
|
67
75
|
/** The TAN process the segment answers: `4` asks for an approval, `S` answers a status request. */
|
|
68
|
-
process: string | undefined,
|
|
76
|
+
process: string | undefined,
|
|
77
|
+
/** The order reference, as `Segment.verbatim` reads it, to send back byte for byte. */
|
|
78
|
+
reference: string | undefined, challenge: string | undefined, hhdUc: Uint8Array | undefined, validUntil: Date | undefined, mediumName: string | undefined);
|
|
69
79
|
static parse(s: Segment): TanResponse;
|
|
70
80
|
/** Whether the bank needs no approval although it answered with a TAN segment. */
|
|
71
81
|
get isDummy(): boolean;
|
|
@@ -79,11 +89,18 @@ export declare function parseBalance(s: Segment, account: Account): Balance;
|
|
|
79
89
|
* The account a balance (HISAL) belongs to: international (IBAN, BIC, then national) from version 7, national before.
|
|
80
90
|
*/
|
|
81
91
|
export declare function balanceAccount(s: Segment): Account;
|
|
92
|
+
/** The account camt transactions (HICAZ) belong to, which the first element names (international). */
|
|
93
|
+
export declare function camtAccount(s: Segment): Account;
|
|
82
94
|
/**
|
|
83
95
|
* Parses the SEPA account list (HISPA), one account per data element. An account the bank marks as no payment account
|
|
84
96
|
* ("Kontoverwendung SEPA" N) is left out: it has no SEPA connection.
|
|
85
97
|
*/
|
|
86
98
|
export declare function parseSepaAccounts(s: Segment, defaultCountry: string, defaultBank: string): Account[];
|
|
87
|
-
/**
|
|
88
|
-
|
|
99
|
+
/**
|
|
100
|
+
* Parses the TAN media list (HITAB versions 4 and 5, PIN/TAN "TAN-Medium-Liste").
|
|
101
|
+
*
|
|
102
|
+
* Each name whose text is not what `Segment.verbatim` reads, such as a name in UTF-8, goes into `namesAsSent`, keyed
|
|
103
|
+
* by its text: it has to go back as the bank sent it, which its text does not tell where it fits ISO 8859-1.
|
|
104
|
+
*/
|
|
105
|
+
export declare function parseTanMedia(s: Segment, namesAsSent?: Map<string, string>): TanMedium[];
|
|
89
106
|
//# sourceMappingURL=segments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/v3/segments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../src/v3/segments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAqB,MAAM,sBAAsB,CAAC;AAGpE,OAAO,EAAE,KAAK,OAAO,EAAE,WAAW,EAA+B,MAAM,aAAa,CAAC;AAErF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,UAAU,CAAC;AA0BnC;;;GAGG;AACH,eAAO,MAAM,QAAQ;IACnB,4DAA4D;0BACtC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,OAAO,CAAC;KAC3B,GAAG,WAAW;IASf,2GAA2G;iCAC9E;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,WAAW;IAUf,gDAAgD;uBAC7B,WAAW;wBAIV,MAAM,GAAG,WAAW;IAIxC;;;OAGG;yBACkB,MAAM,eAAe,MAAM,eAAe,M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