lib-fints 1.0.2 → 1.1.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.
Files changed (36) hide show
  1. package/README.md +39 -31
  2. package/dist/client.js +27 -10
  3. package/dist/codes.js +8 -0
  4. package/dist/config.js +2 -2
  5. package/dist/dialog.js +9 -6
  6. package/dist/interactions/customerInteraction.js +16 -8
  7. package/dist/interactions/initDialogInteraction.js +49 -21
  8. package/dist/segment.js +1 -1
  9. package/dist/segmentDefinition.js +3 -0
  10. package/dist/segments/HITAN.js +2 -3
  11. package/dist/segments/HITANS.js +8 -3
  12. package/dist/segments/HKTAN.js +2 -2
  13. package/dist/tests/HKTAN.test.js +2 -1
  14. package/dist/types/client.d.ts +7 -7
  15. package/dist/types/client.d.ts.map +1 -1
  16. package/dist/types/codes.d.ts +7 -0
  17. package/dist/types/codes.d.ts.map +1 -1
  18. package/dist/types/config.d.ts.map +1 -1
  19. package/dist/types/dialog.d.ts +1 -1
  20. package/dist/types/dialog.d.ts.map +1 -1
  21. package/dist/types/interactions/customerInteraction.d.ts +2 -2
  22. package/dist/types/interactions/customerInteraction.d.ts.map +1 -1
  23. package/dist/types/interactions/initDialogInteraction.d.ts +4 -3
  24. package/dist/types/interactions/initDialogInteraction.d.ts.map +1 -1
  25. package/dist/types/segment.d.ts.map +1 -1
  26. package/dist/types/segmentDefinition.d.ts +1 -0
  27. package/dist/types/segmentDefinition.d.ts.map +1 -1
  28. package/dist/types/segments/HITAN.d.ts +3 -3
  29. package/dist/types/segments/HITAN.d.ts.map +1 -1
  30. package/dist/types/segments/HITANS.d.ts +9 -4
  31. package/dist/types/segments/HITANS.d.ts.map +1 -1
  32. package/dist/types/segments/HKTAN.d.ts +2 -1
  33. package/dist/types/segments/HKTAN.d.ts.map +1 -1
  34. package/dist/types/tanMethod.d.ts +21 -0
  35. package/dist/types/tanMethod.d.ts.map +1 -1
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lib-FinTS
2
2
 
3
- A Typescript/Javascript client library for Online-Banking via the FinTS 3.0 protocol with PIN/TAN. The library has no dependencies on other libraries
3
+ A Typescript/Javascript client library for Online-Banking via the FinTS 3.0 protocol with PIN/TAN, supporting PSD2 and decoupled TAN methods. The library has no dependencies on other libraries
4
4
 
5
5
  ## Getting Started
6
6
 
@@ -22,7 +22,7 @@ In order to communicate with banks via the FinTS protocol you have to register a
22
22
  The library is written in Typescript and compiled to the ES2022 Javascript language standard which means a minimum Node version of 18 is required.
23
23
 
24
24
  **A note about Browsers:**
25
- It wouldn't be hard to make the code compatible with a browser environment, but communicating directly from the front-end with a bank server will most likely fail because of the imposed CORS restrictions from web browsers and the lack of corresponding CORS headers in bank server responses.
25
+ In theory the library is compatible with a browser environment, but communicating directly from the front-end with a bank server will, apart from security considerations, most likely fail because of the imposed CORS restrictions from web browsers and the lack of corresponding CORS headers in bank server responses.
26
26
 
27
27
  ### Installing
28
28
 
@@ -34,7 +34,7 @@ npm i lib-fints
34
34
 
35
35
  ### Sample Usage
36
36
 
37
- The main public API of this library is the `FinTSClient` class and `FinTSConfig` class. In order to instantiate the client you need to provide a configration instance. There are basically two ways to initialize a configuration object, one is when you communicate with a bank for the first time and the other when you already have banking information from a prevous session available (more on that later).
37
+ The main public API of this library is the `FinTSClient` class and `FinTSConfig` class. In order to instantiate the client you need to provide a configuration instance. There are basically two ways to initialize a configuration object, one is when you communicate with a bank for the first time and the other when you already have banking information from a prevous session available (more on that later).
38
38
 
39
39
  If you don't have any previous banking information available you can use the static `forFirstTimeUse()` factory method like this:
40
40
 
@@ -57,16 +57,16 @@ If the call is successfull the response will contain a `bankingInformation` obje
57
57
 
58
58
  ```typescript
59
59
  export type BankingInformation = {
60
- systemId: string;
61
- bpd?: BPD;
62
- upd?: UPD;
63
- bankMessages: BankMessage[];
60
+ systemId: string;
61
+ bpd?: BPD;
62
+ upd?: UPD;
63
+ bankMessages: BankMessage[];
64
64
  };
65
65
  ```
66
66
 
67
67
  The BPD object (_BankParameterDaten_) contains general information (e.g. available TAN methods and allowed transactions) and the UPD object (_UserParameterDaten_) user-specific information which is mainly the list of the user's bank accounts.
68
68
 
69
- Unfortunately with this first synchronization call most banks will most likely only return most of the BPA information but no UPD (accounts) information, which is needed to fetch balances or statements. The reason for this is that you need to specify a TAN method before making the synchronization call, but how would you know which TAN methods are available and how to specify them? This is why you need to make a second synchronization call with a TAN method selected from the `availableTanMethodIds`in the BPA, returned from the first synchronization call:
69
+ Unfortunately with this first synchronization call most banks will likely only return the BPA information but no UPD (accounts) information, which is needed to fetch balances or statements. The reason for this is that you need to specify a TAN method before making the synchronization call, but you can only know which TAN methods are available from the BPA? This is why you need to make a second synchronization call with a TAN method selected from the `availableTanMethodIds`in the BPA, returned from the first synchronization call:
70
70
 
71
71
  ```typescript
72
72
  // for simplicity, we just select the first available TAN method
@@ -88,7 +88,7 @@ const balanceResponse = await client.getAccountBalance(account.accountNumber);
88
88
  const statementResponse = await client.getAccountStatements(account.accountNumber);
89
89
  ```
90
90
 
91
- These are only the most basic steps needed to retrieve information from the bank. It kept many questions unanswered like "how to handle TANs" or "how to avoid synchronizations every time you start a new session". These are explained in the corresponding sections below.
91
+ These are only the most basic steps needed to retrieve information from the bank. There are still some unanswered questions like "how to handle TANs" or "how to avoid synchronizations every time you start a new session". These are explained in the corresponding sections below.
92
92
 
93
93
  ## More detailed API Description
94
94
 
@@ -99,27 +99,35 @@ Most transactions may require authorization with a two step TAN process. As ment
99
99
  ```typescript
100
100
  // we use the node readline interface later to ask the user for a TAN
101
101
  const rl = readline.createInterface({
102
- input: process.stdin,
103
- output: process.stdout,
102
+ input: process.stdin,
103
+ output: process.stdout,
104
104
  });
105
105
 
106
106
  let response = await client.getAccountStatements(account.accountNumber);
107
107
 
108
108
  if (!response.success) {
109
- return;
109
+ return;
110
110
  }
111
111
 
112
112
  // need to check if a TAN is required to continue the transaction
113
113
  if (response.requiresTan) {
114
- // asking the user for the TAN, using the tanChallenge property
115
- const tan = await rl.question(response.tanChallenge + ': ');
116
- // continue the transaction by providing the tanReference from the response and the entered TAN
117
- response = await client.getAccountStatementsWithTan(response.tanReference!, tan);
114
+ // asking the user for the TAN, using the tanChallenge property
115
+ const tan = await rl.question(response.tanChallenge + ': ');
116
+ // continue the transaction by providing the tanReference from the response and the entered TAN
117
+ response = await client.getAccountStatementsWithTan(response.tanReference!, tan);
118
118
  }
119
119
  ```
120
120
 
121
121
  The `FinTSClient`contains for every transaction method like `synchronize()` or `getAccountStatements()` a corresponding `...WithTan()` method which needs to be called to continue the transaction with the given `tanReference` returned in the first response. The response object of this second call should now contain all transaction related data, assuming `success=true`.
122
122
 
123
+ **Decoupled TAN methods**
124
+
125
+ The library now also supports decoupled TAN methods where you don't actually have to provide a TAN entered by a user, but the approval is done "decoupled" on another device (e.g. mobile phone via banking app). The procedure explained above is still very similar, `requiresTan` will signal a required approval and you can continue with one of the `...WithTan()` methods where you can ommit the last `tan` parameter.
126
+
127
+ You could ask the user to confirm that the approval was given and then continue with the call or periodically call the method until it returns the transaction result (`requiresTan=false` and `success=true`). The continuation methods will keep returning `requiresTan=true` as long as the user hasn't approved the transaction.
128
+
129
+ see also the `decoupled` property on the `TanMethod` object for related parameters given by the bank.
130
+
123
131
  ### Starting a session from saved banking information
124
132
 
125
133
  As mentioned earlier there is a second way to initialize the `FinTSClient` with a `FinTSConfig` when you already performed a synchronization in a previous session and this is by providing the `bankingInformation` object received from previous uses. This `bankingInformation` object, which contains the general bank (BPD) and accounts information (UPD), should be persisted after a session and reloaded in the next session.
@@ -127,13 +135,13 @@ This not only saves you from making the same synchronization requests every time
127
135
 
128
136
  ```typescript
129
137
  const config = FinTSConfig.fromBankingInformation(
130
- productId,
131
- productVersion,
132
- bankingInformation,
133
- userId,
134
- pin,
135
- tanMethodId,
136
- tanMediaName // when also needed (see below)
138
+ productId,
139
+ productVersion,
140
+ bankingInformation,
141
+ userId,
142
+ pin,
143
+ tanMethodId,
144
+ tanMediaName // when also needed (see below)
137
145
  );
138
146
  const client = new FinTSClient(config);
139
147
  ```
@@ -148,12 +156,12 @@ You can get a list of all available TAN methods from the `config.availableTanMet
148
156
 
149
157
  ```typescript
150
158
  export type TanMethod = {
151
- id: number;
152
- name: string;
153
- version: number;
154
- activeTanMediaCount: number;
155
- activeTanMedia: string[];
156
- tanMediaRequirement: TanMediaRequirement;
159
+ id: number;
160
+ name: string;
161
+ version: number;
162
+ activeTanMediaCount: number;
163
+ activeTanMedia: string[];
164
+ tanMediaRequirement: TanMediaRequirement;
157
165
  };
158
166
  ```
159
167
 
@@ -163,7 +171,7 @@ The property `activeTanMedia` contains a list of the TAN media names you can use
163
171
 
164
172
  #### Banking Information may be updated any time
165
173
 
166
- The `bankingInformation` is primarily obtained by the `synchronize()` calls as seen above. But what if the banking information changed since the last synchronization call and how would you know? For this reason the BPD and UPD are versioned and with every transaction made, not just synchronizations, the currently used versions are provided to the bank and if something changed, the bank will sent back new versions of the BPD and UPD respectively. This is all handled by the client but you need to check the `bankingInformationUpdated` property, which is available in every response, which tells you if there were changes and make sure to persist the new version for future sessions. You can always get the up-to-date version of the `bankingInformation` object with `config.bankingInformation`.
174
+ The `bankingInformation` is primarily obtained through the `synchronize()` calls as demonstrated above. However, it is possible that the banking information may have changed since the last synchronization call. To address this, the BPD and UPD are versioned, and with every transaction made, not just synchronizations, the currently used versions are provided to the bank. If any changes have occurred, the bank will send back new versions of the BPD and UPD respectively. This process is managed by the client, but it is essential to check the `bankingInformationUpdated` property, which is available in every response. This property indicates if there have been any changes, and it is important to persist the new version for future sessions. The most up-to-date version of the `bankingInformation` object can always be retrieved using `config.bankingInformation`.
167
175
 
168
176
  ### Debugging
169
177
 
@@ -178,7 +186,7 @@ This will print out all sent messages and received responses to the console in a
178
186
  ## Limitations
179
187
 
180
188
  - Only FinTS 3.0 is supported (older versions may not work)
181
- - Only PIN/TAN security is supported
189
+ - Only PIN/TAN security is supported (inluding decoupled TAN methods)
182
190
  - Currently only the following transactions are supported:
183
191
  - Synchronize bank and account information
184
192
  - Fetching account balances
package/dist/client.js CHANGED
@@ -3,10 +3,10 @@ import { HKTAB } from './segments/HKTAB.js';
3
3
  import { StatementInteraction } from './interactions/statementInteraction.js';
4
4
  import { BalanceInteraction } from './interactions/balanceInteraction.js';
5
5
  import { FinTSConfig } from './config.js';
6
- import { InitDialogInteraction } from './interactions/initDialogInteraction.js';
7
6
  import { TanMediaInteraction } from './interactions/tanMediaInteraction.js';
8
7
  import { HKSAL } from './segments/HKSAL.js';
9
8
  import { HKKAZ } from './segments/HKKAZ.js';
9
+ import { InitDialogInteraction } from './interactions/initDialogInteraction.js';
10
10
  /**
11
11
  * A client to communicate with a bank over the FinTS protocol
12
12
  */
@@ -66,7 +66,7 @@ export class FinTSClient {
66
66
  /**
67
67
  * Continues the synchronization transaction when a TAN is required
68
68
  * @param tanReference The TAN reference provided in the first call's response
69
- * @param tan The TAN entered by the user
69
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
70
70
  * @returns the synchronization response
71
71
  */
72
72
  async synchronizeWithTan(tanReference, tan) {
@@ -93,7 +93,7 @@ export class FinTSClient {
93
93
  /**
94
94
  * Continues the account balance fetching when a TAN is required
95
95
  * @param tanReference The TAN reference provided in the first call's response
96
- * @param tan The TAN entered by the user
96
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
97
97
  * @returns the account balance response
98
98
  */
99
99
  async getAccountBalanceWithTan(tanReference, tan) {
@@ -122,7 +122,7 @@ export class FinTSClient {
122
122
  /**
123
123
  * Continues the account statements fetching when a TAN is required
124
124
  * @param tanReference The TAN reference provided in the first call's response
125
- * @param tan The TAN entered by the user
125
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
126
126
  * @returns an account statements response containing an array of statements
127
127
  */
128
128
  async getAccountStatementsWithTan(tanReference, tan) {
@@ -130,7 +130,7 @@ export class FinTSClient {
130
130
  }
131
131
  async startCustomerOrderInteraction(interaction) {
132
132
  const dialog = new Dialog(this.config);
133
- const syncResponse = await this.initDialog(dialog);
133
+ const syncResponse = await this.initDialog(dialog, false, interaction);
134
134
  if (!syncResponse.success || syncResponse.requiresTan) {
135
135
  return syncResponse;
136
136
  }
@@ -149,13 +149,30 @@ export class FinTSClient {
149
149
  throw new Error('No open customer interaction found for TAN reference: ' + tanReference);
150
150
  }
151
151
  const dialog = interaction.dialog;
152
- const response = await dialog.sendTanMessage(interaction.segId, tanReference, tan);
153
- await dialog.end();
152
+ let responseMessage = await dialog.sendTanMessage(interaction.segId, tanReference, tan);
153
+ let clientResponse = interaction.getClientResponse(responseMessage);
154
154
  this.openCustomerInteractions.delete(tanReference);
155
- return interaction.getClientResponse(response);
155
+ if (!clientResponse.success) {
156
+ await dialog.end();
157
+ return clientResponse;
158
+ }
159
+ if (clientResponse.requiresTan) {
160
+ this.openCustomerInteractions.set(clientResponse.tanReference, interaction);
161
+ return clientResponse;
162
+ }
163
+ const initDialogInteraction = interaction;
164
+ if (initDialogInteraction.followUpInteraction) {
165
+ clientResponse = await dialog.startCustomerOrderInteraction(initDialogInteraction.followUpInteraction);
166
+ if (clientResponse.requiresTan) {
167
+ this.openCustomerInteractions.set(clientResponse.tanReference, initDialogInteraction.followUpInteraction);
168
+ return clientResponse;
169
+ }
170
+ }
171
+ await dialog.end();
172
+ return clientResponse;
156
173
  }
157
- async initDialog(dialog, syncSystemId = false) {
158
- const interaction = new InitDialogInteraction(this.config, syncSystemId);
174
+ async initDialog(dialog, syncSystemId = false, followUpInteraction) {
175
+ const interaction = new InitDialogInteraction(this.config, syncSystemId, followUpInteraction);
159
176
  const initResponse = await dialog.initialize(interaction);
160
177
  if (initResponse.requiresTan) {
161
178
  this.openCustomerInteractions.set(initResponse.tanReference, interaction);
package/dist/codes.js CHANGED
@@ -77,3 +77,11 @@ export var TanUsage;
77
77
  TanUsage[TanUsage["Single"] = 1] = "Single";
78
78
  TanUsage[TanUsage["MobileAndGenerator"] = 2] = "MobileAndGenerator";
79
79
  })(TanUsage || (TanUsage = {}));
80
+ export var TanProcess;
81
+ (function (TanProcess) {
82
+ TanProcess["Process1"] = "1";
83
+ TanProcess["Process2"] = "2";
84
+ TanProcess["Process3"] = "3";
85
+ TanProcess["Process4"] = "4";
86
+ TanProcess["Status"] = "S";
87
+ })(TanProcess || (TanProcess = {}));
package/dist/config.js CHANGED
@@ -114,8 +114,8 @@ export class FinTSConfig {
114
114
  * @param tanMethodId The ID of the TAN method to select, corresponding to an ID in availableTanMethods
115
115
  */
116
116
  selectTanMethod(tanMethodId) {
117
- if (!this.bankingInformation.bpd?.availableTanMethodIds?.find((id) => id === tanMethodId)) {
118
- throw new Error(`TAN Method '${tanMethodId}' not found in the available TAN methods in the BPD`);
117
+ if (!this.availableTanMethods.find((method) => method.id === tanMethodId)) {
118
+ throw new Error(`TAN Method '${tanMethodId}' is not supported`);
119
119
  }
120
120
  this.tanMethodId = tanMethodId;
121
121
  }
package/dist/dialog.js CHANGED
@@ -1,4 +1,4 @@
1
- import { TanMediaRequirement } from './codes.js';
1
+ import { TanMediaRequirement, TanProcess } from './codes.js';
2
2
  import { HttpClient } from './httpClient.js';
3
3
  import { CustomerMessage, CustomerOrderMessage } from './message.js';
4
4
  import { HKEND } from './segments/HKEND.js';
@@ -45,7 +45,7 @@ export class Dialog {
45
45
  if (this.config.userId && this.config.pin && isScaSupported) {
46
46
  const hktan = {
47
47
  header: { segId: HKTAN.Id, segNr: 0, version: tanMethod.version },
48
- tanProcess: 4,
48
+ tanProcess: TanProcess.Process4,
49
49
  segId: HKIDN.Id,
50
50
  };
51
51
  message.addSegment(hktan);
@@ -107,7 +107,7 @@ export class Dialog {
107
107
  if (this.config.userId && this.config.pin && this.config.tanMethodId) {
108
108
  const hktan = {
109
109
  header: { segId: HKTAN.Id, segNr: 0, version: this.config.selectedTanMethod.version },
110
- tanProcess: 4,
110
+ tanProcess: TanProcess.Process4,
111
111
  segId: interaction.segId,
112
112
  tanMedia: this.config.tanMediaName,
113
113
  };
@@ -142,8 +142,11 @@ export class Dialog {
142
142
  return interaction.getClientResponse(responseMessage);
143
143
  }
144
144
  async sendTanMessage(refSegId, tanOrderReference, tan) {
145
- if (!refSegId || !tanOrderReference || !tan) {
146
- throw Error('refSegId, tanOrderReference and TAN must be provided to send a TAN message');
145
+ if (!refSegId || !tanOrderReference) {
146
+ throw Error('refSegId and tanOrderReference must be provided to send a TAN message');
147
+ }
148
+ if (!this.config.selectedTanMethod?.isDecoupled && !tan) {
149
+ throw Error('TAN must be provided for non-decoupled TAN methods');
147
150
  }
148
151
  if (!this.isInitialized) {
149
152
  throw Error('dialog must be initialized before sending a TAN message');
@@ -159,7 +162,7 @@ export class Dialog {
159
162
  if (this.config.userId && this.config.pin && this.config.tanMethodId) {
160
163
  const hktan = {
161
164
  header: { segId: HKTAN.Id, segNr: 0, version: this.config.selectedTanMethod.version },
162
- tanProcess: 2,
165
+ tanProcess: this.config.selectedTanMethod?.isDecoupled ? TanProcess.Status : TanProcess.Process2,
163
166
  segId: refSegId,
164
167
  orderRef: tanOrderReference,
165
168
  nextTan: false,
@@ -9,39 +9,47 @@ export class CustomerInteraction {
9
9
  getSegments(init) {
10
10
  return this.createSegments(init);
11
11
  }
12
- getClientResponse(response) {
13
- const clientResponse = this.handleBaseResponse(response);
12
+ getClientResponse(message) {
13
+ const clientResponse = this.handleBaseResponse(message);
14
14
  if (clientResponse.success && !clientResponse.requiresTan) {
15
- this.handleResponse(response, clientResponse);
15
+ this.handleResponse(message, clientResponse);
16
16
  }
17
17
  return clientResponse;
18
18
  }
19
19
  handleBaseResponse(response) {
20
20
  const hnhbk = response.findSegment(HNHBK.Id);
21
21
  const dialogId = hnhbk?.dialogId ?? '';
22
- if (response.hasReturnCode(30)) {
22
+ const bankAnswers = response.getBankAnswers();
23
+ if (response.hasReturnCode(30) ||
24
+ response.hasReturnCode(3955) ||
25
+ response.hasReturnCode(3956) ||
26
+ response.hasReturnCode(3957)) {
23
27
  const hitan = response.findSegment(HITAN.Id);
24
28
  if (hitan) {
25
29
  return {
26
30
  dialogId,
27
31
  success: true,
28
32
  bankingInformationUpdated: false,
29
- bankAnswers: response.getBankAnswers(),
33
+ bankAnswers: bankAnswers,
30
34
  requiresTan: true,
31
35
  tanReference: hitan.orderReference,
32
- tanChallenge: hitan.challenge,
36
+ tanChallenge: hitan.challenge ??
37
+ bankAnswers.find((answer) => answer.code === 3955)?.text ??
38
+ bankAnswers.find((answer) => answer.code === 3956)?.text ??
39
+ bankAnswers.find((answer) => answer.code === 3957)?.text ??
40
+ '',
33
41
  tanMediaName: hitan.tanMedia,
34
42
  };
35
43
  }
36
44
  else {
37
- throw new Error('HITAN segment not found in response, despite return code 30');
45
+ throw new Error('HITAN segment not found in response, despite return code indicating security approval');
38
46
  }
39
47
  }
40
48
  return {
41
49
  dialogId,
42
50
  success: response.getHighestReturnCode() < 9000,
43
51
  bankingInformationUpdated: false,
44
- bankAnswers: response.getBankAnswers(),
52
+ bankAnswers: bankAnswers,
45
53
  requiresTan: false,
46
54
  };
47
55
  }
@@ -13,12 +13,14 @@ import { finTsAccountTypeToEnum } from '../bankAccount.js';
13
13
  import { HIKIM } from '../segments/HIKIM.js';
14
14
  import { HIUPD } from '../segments/HIUPD.js';
15
15
  export class InitDialogInteraction extends CustomerInteraction {
16
- init;
16
+ config;
17
17
  syncSystemId;
18
- constructor(init, syncSystemId = false) {
18
+ followUpInteraction;
19
+ constructor(config, syncSystemId = false, followUpInteraction) {
19
20
  super(HKIDN.Id);
20
- this.init = init;
21
+ this.config = config;
21
22
  this.syncSystemId = syncSystemId;
23
+ this.followUpInteraction = followUpInteraction;
22
24
  }
23
25
  createSegments(init) {
24
26
  const segments = [];
@@ -27,7 +29,7 @@ export class InitDialogInteraction extends CustomerInteraction {
27
29
  bank: { country: init.countryCode, bankId: init.bankId },
28
30
  customerId: init.customerId ?? init.userId ?? '9999999999',
29
31
  systemId: init.bankingInformation.systemId,
30
- systemIdRequired: this.init.userId ? 1 : 0,
32
+ systemIdRequired: this.config.userId ? 1 : 0,
31
33
  };
32
34
  segments.push(hkidn);
33
35
  const hkvvb = {
@@ -39,7 +41,7 @@ export class InitDialogInteraction extends CustomerInteraction {
39
41
  productVersion: init.productVersion,
40
42
  };
41
43
  segments.push(hkvvb);
42
- if (this.syncSystemId && this.init.userId && init.bankingInformation.systemId === '0') {
44
+ if (this.syncSystemId && this.config.userId && init.bankingInformation.systemId === '0') {
43
45
  const hksyn = {
44
46
  header: { segId: HKSYN.Id, segNr: 0, version: HKSYN.Version },
45
47
  mode: SyncMode.NewSystemId,
@@ -49,27 +51,40 @@ export class InitDialogInteraction extends CustomerInteraction {
49
51
  return segments;
50
52
  }
51
53
  handleResponse(response, clientResponse) {
52
- const currentBankingInformationSnapshot = JSON.stringify(this.init.bankingInformation);
54
+ const currentBankingInformationSnapshot = JSON.stringify(this.config.bankingInformation);
53
55
  const hisyn = response.findSegment(HISYN.Id);
54
56
  if (hisyn && hisyn.systemId) {
55
- this.init.bankingInformation.systemId = hisyn.systemId;
57
+ this.config.bankingInformation.systemId = hisyn.systemId;
56
58
  }
57
59
  const bankAnswers = clientResponse.bankAnswers;
58
60
  const hibpa = response.findSegment(HIBPA.Id);
59
61
  if (hibpa) {
60
62
  const hitansSegments = response.findAllSegments(HITANS.Id);
63
+ hitansSegments.sort((a, b) => b.header.version - a.header.version);
61
64
  const supportedTanMethods = [];
62
65
  hitansSegments.forEach((hitans) => {
63
- supportedTanMethods.push(...(hitans?.params.tanMethods.map((t) => ({
64
- id: t.secFunc,
65
- name: t.methodName,
66
+ supportedTanMethods.push(...(hitans?.params.tanMethods
67
+ .map((method) => ({
68
+ id: method.secFunc,
69
+ name: method.methodName,
66
70
  version: hitans.header.version,
67
- activeTanMediaCount: t.activeTanMedia,
71
+ isDecoupled: isDecoupledTanMethod(method),
72
+ activeTanMediaCount: method.activeTanMedia,
68
73
  activeTanMedia: [],
69
- tanMediaRequirement: t.tanMediaRequired,
70
- })) ?? []));
74
+ tanMediaRequirement: method.tanMediaRequired,
75
+ decoupled: isDecoupledTanMethod(method)
76
+ ? {
77
+ maxStatusRequests: method.decoupledMaxStatusRequests,
78
+ waitingSecondsBeforeFirstStatusRequest: method.decoupledWaitBeforeFirstStatusRequest,
79
+ waitingSecondsBetweenStatusRequests: method.decoupledWaitBetweenStatusRequests,
80
+ manualConfirmationAllowed: method.decoupledManualConfirmationAllowed ?? false,
81
+ autoConfirmationAllowed: method.decoupledAutoConfirmationAllowed ?? false,
82
+ }
83
+ : undefined,
84
+ }))
85
+ .filter((method) => !supportedTanMethods.some((existing) => existing.id === method.id)) ?? []));
71
86
  });
72
- let bankingUrl = this.init.bankingUrl;
87
+ let bankingUrl = this.config.bankingUrl;
73
88
  const hikom = response.findSegment(HIKOM.Id);
74
89
  if (hikom) {
75
90
  bankingUrl = hikom?.comParams.address;
@@ -111,12 +126,12 @@ export class InitDialogInteraction extends CustomerInteraction {
111
126
  availableTanMethodIds: [],
112
127
  allowedTransactions: bankTransactions,
113
128
  };
114
- this.init.bankingInformation.bpd = bpd;
129
+ this.config.bankingInformation.bpd = bpd;
115
130
  }
116
131
  const tanMethodMessaqe = bankAnswers.find((answer) => answer.code === 3920);
117
132
  let availableTanMethodIds = [];
118
- if (tanMethodMessaqe && this.init.bankingInformation.bpd) {
119
- this.init.bankingInformation.bpd.availableTanMethodIds =
133
+ if (tanMethodMessaqe && this.config.bankingInformation.bpd) {
134
+ this.config.bankingInformation.bpd.availableTanMethodIds =
120
135
  tanMethodMessaqe.params?.map((p) => Number.parseInt(p)) ?? [];
121
136
  }
122
137
  const hiupa = response.findSegment(HIUPA.Id);
@@ -143,13 +158,26 @@ export class InitDialogInteraction extends CustomerInteraction {
143
158
  usage: hiupa.updUsage,
144
159
  bankAccounts: accounts,
145
160
  };
146
- this.init.bankingInformation.upd = upd;
161
+ this.config.bankingInformation.upd = upd;
147
162
  }
148
163
  const hikimSegments = response.findAllSegments(HIKIM.Id);
149
164
  const bankMessages = hikimSegments.map((s) => ({ subject: s.subject, text: s.text }));
150
- this.init.bankingInformation.bankMessages = bankMessages;
151
- clientResponse.bankingInformation = this.init.bankingInformation;
165
+ this.config.bankingInformation.bankMessages = bankMessages;
166
+ clientResponse.bankingInformation = this.config.bankingInformation;
152
167
  clientResponse.bankingInformationUpdated =
153
- currentBankingInformationSnapshot !== JSON.stringify(this.init.bankingInformation);
168
+ currentBankingInformationSnapshot !== JSON.stringify(this.config.bankingInformation);
169
+ }
170
+ }
171
+ function isDecoupledTanMethod(tanMethod) {
172
+ if (tanMethod.zkaMethod === 'Decoupled' || tanMethod.zkaMethod === 'DecoupledPush') {
173
+ return true;
174
+ }
175
+ if (tanMethod.decoupledMaxStatusRequests !== undefined ||
176
+ tanMethod.decoupledWaitBeforeFirstStatusRequest !== undefined ||
177
+ tanMethod.decoupledWaitBetweenStatusRequests !== undefined ||
178
+ tanMethod.decoupledManualConfirmationAllowed !== undefined ||
179
+ tanMethod.decoupledAutoConfirmationAllowed !== undefined) {
180
+ return true;
154
181
  }
182
+ return false;
155
183
  }
package/dist/segment.js CHANGED
@@ -43,7 +43,7 @@ export function segmentToString(segment) {
43
43
  text += ` RefSeg: ${segment.header.refSegNr}`;
44
44
  }
45
45
  const segmentDefinition = getSegmentDefinition(segment.header.segId);
46
- let texts = segmentDefinition.elements.map((element, index) => {
46
+ let texts = segmentDefinition.getElementsForVersion(segment.header.version).map((element) => {
47
47
  if (element.maxCount > 1) {
48
48
  return keyedSegment[element.name]
49
49
  .map((value) => element.toString(value))
@@ -3,6 +3,9 @@ import { SegmentHeaderGroup } from './segmentHeader.js';
3
3
  export class SegmentDefinition {
4
4
  id = this.constructor.name;
5
5
  static header = new SegmentHeaderGroup();
6
+ getElementsForVersion(version) {
7
+ return this.elements.filter((element) => version >= (element.minVersion ?? 0) && version <= (element.maxVersion ?? Number.MAX_SAFE_INTEGER));
8
+ }
6
9
  encode(data) {
7
10
  const headerText = SegmentDefinition.header.encode(data.header, [data.header.segId], data.header.version);
8
11
  const elementsText = encodeElements(data, this.elements, '+', data.header.version, [data.header.segId]);
@@ -1,7 +1,6 @@
1
1
  import { Time } from '../dataElements/Time.js';
2
2
  import { Dat } from '../dataElements/Dat.js';
3
3
  import { Binary } from '../dataElements/Binary.js';
4
- import { Numeric } from '../dataElements/Numeric.js';
5
4
  import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
6
5
  import { DataGroup } from '../dataGroups/DataGroup.js';
7
6
  import { SegmentDefinition } from '../segmentDefinition.js';
@@ -10,9 +9,9 @@ import { SegmentDefinition } from '../segmentDefinition.js';
10
9
  */
11
10
  export class HITAN extends SegmentDefinition {
12
11
  static Id = this.name;
13
- version = 6;
12
+ version = 7;
14
13
  elements = [
15
- new Numeric('tanProcess', 1, 1, 1),
14
+ new AlphaNumeric('tanProcess', 1, 1, 1),
16
15
  new Binary('orderHash', 0, 1, 256),
17
16
  new AlphaNumeric('orderReference', 0, 1, 35),
18
17
  new AlphaNumeric('challenge', 0, 1, 2048),
@@ -9,7 +9,7 @@ import { BusinessTransactionParameter } from './businessTransactionParameter.js'
9
9
  */
10
10
  export class HITANS extends BusinessTransactionParameter {
11
11
  static Id = this.name;
12
- version = 6;
12
+ version = 7;
13
13
  constructor() {
14
14
  super([
15
15
  new YesNo('oneStepAllowed', 1, 1),
@@ -23,8 +23,8 @@ export class HITANS extends BusinessTransactionParameter {
23
23
  new AlphaNumeric('zkaMethod', 0, 1, 32, 4),
24
24
  new AlphaNumeric('zkaVersion', 0, 1, 10, 4),
25
25
  new AlphaNumeric('methodName', 1, 1, 30, 1),
26
- new Numeric('tanMaxLen', 1, 1, 2, 1),
27
- new Numeric('format', 1, 1, 1, 1),
26
+ new Numeric('tanMaxLen', 0, 1, 2, 1),
27
+ new Numeric('format', 0, 1, 1, 1),
28
28
  new AlphaNumeric('challengeText', 1, 1, 30, 1),
29
29
  new Numeric('maxChallengeLen', 1, 1, 4, 1),
30
30
  new Numeric('supportedActiveTanLists', 0, 1, 1, 1, 5),
@@ -42,6 +42,11 @@ export class HITANS extends BusinessTransactionParameter {
42
42
  new Numeric('tanMediaRequired', 1, 1, 1, 3),
43
43
  new YesNo('hdducRequired', 1, 1, 6),
44
44
  new Numeric('activeTanMedia', 0, 1, 1, 3),
45
+ new Numeric('decoupledMaxStatusRequests', 0, 1, 3, 7),
46
+ new Numeric('decoupledWaitBeforeFirstStatusRequest', 0, 1, 3, 7),
47
+ new Numeric('decoupledWaitBetweenStatusRequests', 0, 1, 3, 7),
48
+ new YesNo('decoupledManualConfirmationAllowed', 0, 1, 7),
49
+ new YesNo('decoupledAutoConfirmationAllowed', 0, 1, 7),
45
50
  ], 1, 98),
46
51
  ]);
47
52
  }
@@ -10,10 +10,10 @@ import { SegmentDefinition } from '../segmentDefinition.js';
10
10
  */
11
11
  export class HKTAN extends SegmentDefinition {
12
12
  static Id = this.name;
13
- static Version = 6;
13
+ static Version = 7;
14
14
  version = HKTAN.Version;
15
15
  elements = [
16
- new Numeric('tanProcess', 1, 1, 1),
16
+ new AlphaNumeric('tanProcess', 1, 1, 1),
17
17
  new AlphaNumeric('segId', 0, 1, 6),
18
18
  new InternationalAccountGroup('customerAccount', 0, 1),
19
19
  new Binary('orderHash', 0, 1, 256),
@@ -2,13 +2,14 @@ import { describe, it, expect } from 'vitest';
2
2
  import { registerSegments } from '../segments/registry.js';
3
3
  import { HKTAN } from '../segments/HKTAN.js';
4
4
  import { decode, encode } from '../segment.js';
5
+ import { TanProcess } from '../codes.js';
5
6
  registerSegments();
6
7
  describe('HKTAN', () => {
7
8
  it('encode', () => {
8
9
  const segment = {
9
10
  header: { segId: HKTAN.Id, segNr: 1, version: 6 },
10
11
  segId: 'HKKAZ',
11
- tanProcess: 4,
12
+ tanProcess: TanProcess.Process4,
12
13
  tanMedia: 'Media1',
13
14
  };
14
15
  expect(encode(segment)).toBe("HKTAN:1:6+4+HKKAZ+++++++++Media1'");
@@ -1,8 +1,8 @@
1
1
  import { StatementResponse } from './interactions/statementInteraction.js';
2
2
  import { AccountBalanceResponse } from './interactions/balanceInteraction.js';
3
3
  import { FinTSConfig } from './config.js';
4
- import { InitResponse } from './interactions/initDialogInteraction.js';
5
4
  import { TanMethod } from './tanMethod.js';
5
+ import { InitResponse } from './interactions/initDialogInteraction.js';
6
6
  export interface SynchronizeResponse extends InitResponse {
7
7
  }
8
8
  /**
@@ -35,10 +35,10 @@ export declare class FinTSClient {
35
35
  /**
36
36
  * Continues the synchronization transaction when a TAN is required
37
37
  * @param tanReference The TAN reference provided in the first call's response
38
- * @param tan The TAN entered by the user
38
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
39
39
  * @returns the synchronization response
40
40
  */
41
- synchronizeWithTan(tanReference: string, tan: string): Promise<SynchronizeResponse>;
41
+ synchronizeWithTan(tanReference: string, tan?: string): Promise<SynchronizeResponse>;
42
42
  /**
43
43
  * Checks if the bank supports fetching an account balance in general or for the given account number when provided
44
44
  * @param accountNumber when the account number is provided, checks if the account supports fetching the balance
@@ -54,10 +54,10 @@ export declare class FinTSClient {
54
54
  /**
55
55
  * Continues the account balance fetching when a TAN is required
56
56
  * @param tanReference The TAN reference provided in the first call's response
57
- * @param tan The TAN entered by the user
57
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
58
58
  * @returns the account balance response
59
59
  */
60
- getAccountBalanceWithTan(tanReference: string, tan: string): Promise<AccountBalanceResponse>;
60
+ getAccountBalanceWithTan(tanReference: string, tan?: string): Promise<AccountBalanceResponse>;
61
61
  /**
62
62
  * Checks if the bank supports fetching account statements in general or for the given account number when provided
63
63
  * @param accountNumber when the account number is provided, checks if the account supports fetching of statements
@@ -75,10 +75,10 @@ export declare class FinTSClient {
75
75
  /**
76
76
  * Continues the account statements fetching when a TAN is required
77
77
  * @param tanReference The TAN reference provided in the first call's response
78
- * @param tan The TAN entered by the user
78
+ * @param tan The TAN entered by the user, can be omitted if a decoupled TAN method is used
79
79
  * @returns an account statements response containing an array of statements
80
80
  */
81
- getAccountStatementsWithTan(tanReference: string, tan: string): Promise<StatementResponse>;
81
+ getAccountStatementsWithTan(tanReference: string, tan?: string): Promise<StatementResponse>;
82
82
  private startCustomerOrderInteraction;
83
83
  private continueCustomerInteractionWithTan;
84
84
  private initDialog;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAwB,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAsB,MAAM,sCAAsC,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAyB,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,WAAW,mBAAoB,SAAQ,YAAY;CAAG;AAE5D;;GAEG;AACH,qBAAa,WAAW;IAOH,MAAM,EAAE,WAAW;IANtC,OAAO,CAAC,wBAAwB,CAA0C;IAE1E;;;OAGG;gBACgB,MAAM,EAAE,WAAW;IAUtC;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS;IAK/C;;;OAGG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAI1C;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAwBjD;;;;;OAKG;IACG,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAIzF;;;;OAIG;IACH,oBAAoB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO;IAMrD;;;;OAIG;IACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAI/E;;;;;OAKG;IACG,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAIlG;;;;OAIG;IACH,uBAAuB,CAAC,aAAa,CAAC,EAAE,MAAM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ACG,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAI/E;;;;;OAKG;IACG,wBAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAInG;;;;OAIG;IACH,uBAAuB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO;IAMxD;;;;;;OAMG;IACG,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIrG;;;;;OAKG;IACG,2BAA2B,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAInF,6BAA6B;YAqB7B,kCAAkC;YA0ClC,UAAU;CAcxB"}
@@ -65,4 +65,11 @@ export declare enum TanUsage {
65
65
  Single = 1,
66
66
  MobileAndGenerator = 2
67
67
  }
68
+ export declare enum TanProcess {
69
+ Process1 = "1",
70
+ Process2 = "2",
71
+ Process3 = "3",
72
+ Process4 = "4",
73
+ Status = "S"
74
+ }
68
75
  //# sourceMappingURL=codes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/codes.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,OAAO;IACjB,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;CACV;AAED,oBAAY,aAAa;IACvB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;IACV,UAAU,IAAI;CACf;AAED,oBAAY,QAAQ;IAClB,WAAW,IAAI;IACf,kBAAkB,IAAI;IACtB,WAAW,IAAI;CAChB;AAED,oBAAY,SAAS;IACnB,WAAW,MAAM;IACjB,GAAG,MAAM;IACT,IAAI,MAAM;IACV,KAAK,MAAM;IACX,IAAI,MAAM;CACX;AAED,oBAAY,QAAQ;IAClB,iBAAiB,IAAI;IACrB,cAAc,IAAI;CACnB;AAED,oBAAY,WAAW;IACrB,MAAM,MAAM;IACZ,KAAK,MAAM;CACZ;AAED,oBAAY,YAAY;IACtB,GAAG,IAAI;IACP,MAAM,IAAI;IACV,SAAS,IAAI;CACd;AAED,oBAAY,aAAa;IACvB,GAAG,MAAM;IACT,IAAI,MAAM;IACV,YAAY,MAAM;IAClB,MAAM,MAAM;IACZ,OAAO,MAAM;IACb,SAAS,MAAM;CAChB;AAED,oBAAY,mBAAmB;IAC7B,UAAU,IAAI;IACd,QAAQ,IAAI;IACZ,QAAQ,IAAI;CACb;AAED,oBAAY,SAAS;IACnB,MAAM,IAAI;IACV,SAAS,IAAI;IACb,kBAAkB,IAAI;IACtB,qBAAqB,IAAI;CAC1B;AAED,oBAAY,QAAQ;IAClB,GAAG,IAAI;IACP,MAAM,IAAI;IACV,kBAAkB,IAAI;CACvB"}
1
+ {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["../../src/codes.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IACnB,OAAO,IAAI;IACX,MAAM,IAAI;IACV,OAAO,IAAI;IACX,MAAM,IAAI;CACV;AAED,oBAAY,OAAO;IAClB,OAAO,IAAI;IACX,KAAK,IAAI;IACT,KAAK,IAAI;CACT;AAED,oBAAY,aAAa;IACxB,IAAI,IAAI;IACR,MAAM,IAAI;IACV,MAAM,IAAI;IACV,MAAM,IAAI;IACV,UAAU,IAAI;CACd;AAED,oBAAY,QAAQ;IACnB,WAAW,IAAI;IACf,kBAAkB,IAAI;IACtB,WAAW,IAAI;CACf;AAED,oBAAY,SAAS;IACpB,WAAW,MAAM;IACjB,GAAG,MAAM;IACT,IAAI,MAAM;IACV,KAAK,MAAM;IACX,IAAI,MAAM;CACV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AmB,IAAI,SAAS,EAAE,CAMrC;IAED;;;OAGG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM;IAQnC;;;OAGG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM;IAYnC;;OAEG;IACH,IAAI,iBAAiB,IAAI,SAAS,GAAG,SAAS,CAE7C;IAED;;;OAGG;IACH,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIhD;;;;OAIG;IACH,6BAA6B,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAK9E;;;OAGG;IACH,iCAAiC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAetE;;;OAGG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM;CASpC"}
@@ -14,7 +14,7 @@ export declare class Dialog {
14
14
  initialize(interaction: InitDialogInteraction): Promise<InitResponse>;
15
15
  end(): Promise<boolean>;
16
16
  startCustomerOrderInteraction<TClientResponse extends ClientResponse>(interaction: CustomerOrderInteraction): Promise<TClientResponse>;
17
- sendTanMessage(refSegId: string, tanOrderReference: string, tan: string): Promise<Message>;
17
+ sendTanMessage(refSegId: string, tanOrderReference: string, tan?: string): Promise<Message>;
18
18
  private checkEnded;
19
19
  private getHttpClient;
20
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAyC,OAAO,EAAE,MAAM,cAAc,CAAC;AAQ9E,OAAO,EAAE,cAAc,EAAuB,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACtH,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAG9F,qBAAa,MAAM;IAOE,MAAM,EAAE,WAAW;IANtC,QAAQ,EAAE,MAA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E,wBAAwB,GACnC,OAAO,CAAC,eAAe,CAAC;IA+FrB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAuDjG,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,aAAa;CAOrB"}
@@ -9,7 +9,7 @@ import { Segment } from '../segment.js';
9
9
  * @property success Whether the interaction was successful
10
10
  * @property bankingInformationUpdated Whether the banking information were updated
11
11
  * @property bankAnswers The answers from the bank
12
- * @property requiresTan Whether a TAN is required to continue the transaction
12
+ * @property requiresTan Whether security approval is required to continue the transaction (a user entered TAN or decoupled approval)
13
13
  * @property tanReference A reference for the TAN which needs to be provided in the continuation method
14
14
  * @property tanChallenge A prompt provided by the bank which should be displayed to the user to enter the TAN
15
15
  * @property tanMediaName The name of the TAN media to use for the TAN input
@@ -29,7 +29,7 @@ export declare abstract class CustomerInteraction {
29
29
  dialog?: Dialog;
30
30
  constructor(segId: string);
31
31
  getSegments(init: FinTSConfig): Segment[];
32
- getClientResponse<TResponse extends ClientResponse>(response: Message): TResponse;
32
+ getClientResponse<TResponse extends ClientResponse>(message: Message): TResponse;
33
33
  protected abstract createSegments(init: FinTSConfig): Segment[];
34
34
  protected abstract handleResponse(response: Message, clientResponse: ClientResponse): void;
35
35
  private handleBaseResponse;
@@ -1 +1 @@
1
- {"version":3,"file":"customerInteraction.d.ts","sourceRoot":"","sources":["../../../src/interactions/customerInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAIxC;;;;;;;;;;GAUG;AACH,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,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,yBAAyB,EAAE,OAAO,CAAC;IACnC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8BAAsB,mBAAmB;IAGrB,KAAK,EAAE,MAAM;IAFhC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEG,KAAK,EAAE,MAAM;IAEhC,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,EAAE;IAIzC,iBAAiB,CAAC,SAAS,SAAS,cAAc,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS;IAUhF,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,EAAE;IAC/D,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,GAAG,IAAI;IAE1F,OAAO,CAAC,kBAAkB;CAyC1B;AAED,8BAAsB,wBAAyB,SAAQ,mBAAmB;IACvC,aAAa,EAAE,MAAM;gBAA3C,KAAK,EAAE,MAAM,EAAS,aAAa,EAAE,MAAM;CAGvD"}
@@ -1,4 +1,4 @@
1
- import { ClientResponse, CustomerInteraction } from './customerInteraction.js';
1
+ import { ClientResponse, CustomerInteraction, CustomerOrderInteraction } from './customerInteraction.js';
2
2
  import { Message } from '../message.js';
3
3
  import { Segment } from '../segment.js';
4
4
  import { FinTSConfig } from '../config.js';
@@ -7,9 +7,10 @@ export interface InitResponse extends ClientResponse {
7
7
  bankingInformation?: BankingInformation;
8
8
  }
9
9
  export declare class InitDialogInteraction extends CustomerInteraction {
10
- init: FinTSConfig;
10
+ config: FinTSConfig;
11
11
  syncSystemId: boolean;
12
- constructor(init: FinTSConfig, syncSystemId?: boolean);
12
+ followUpInteraction?: CustomerOrderInteraction | undefined;
13
+ constructor(config: FinTSConfig, syncSystemId?: boolean, followUpInteraction?: CustomerOrderInteraction | undefined);
13
14
  createSegments(init: FinTSConfig): Segment[];
14
15
  handleResponse(response: Message, clientResponse: InitResponse): void;
15
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"initDialogInteraction.d.ts","sourceRoot":"","sources":["../../../src/interactions/initDialogInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAe,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAiB3E,MAAM,WAAW,YAAa,SAAQ,cAAc;IAClD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,qBAAa,qBAAsB,SAAQ,mBAAmB;IACzC,IAAI,EAAE,WAAW;IAAS,YAAY;gBAAtC,IAAI,EAAE,WAAW,EAAS,YAAY,UAAQ;IAIjE,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,EAAE;IAoC5C,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY;CA8H/D"}
1
+ {"version":3,"file":"initDialogInteraction.d.ts","sourceRoot":"","sources":["../../../src/interactions/initDialogInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAe,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAiB3E,MAAM,WAAW,YAAa,SAAQ,cAAc;IACnD,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACxC;AAED,qBAAa,qBAAsB,SAAQ,mBAAmB;IAErD,MAAM,EAAE,WAAW;IACnB,YAAY;IACZ,mBAAmB,CAAC;gBAFpB,MAAM,EAAE,WAAW,EACnB,YAAY,UAAQ,EACpB,mBAAmB,CAAC,sCAA0B;IAKtD,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,EAAE;IAoC5C,cAAc,CAAC,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY;CA2I9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../src/segment.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG;IAClD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CA6B5C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAQ5C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CA0BxD"}
1
+ {"version":3,"file":"segment.d.ts","sourceRoot":"","sources":["../../src/segment.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG;IACrB,MAAM,EAAE,aAAa,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CA6B5C;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAQ5C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CA0BxD"}
@@ -6,6 +6,7 @@ export declare abstract class SegmentDefinition {
6
6
  abstract version: number;
7
7
  static header: SegmentHeaderGroup;
8
8
  abstract elements: DataElement[];
9
+ getElementsForVersion(version: number): DataElement[];
9
10
  encode(data: Segment): string;
10
11
  }
11
12
  //# sourceMappingURL=segmentDefinition.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmentDefinition.d.ts","sourceRoot":"","sources":["../../src/segmentDefinition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,8BAAsB,iBAAiB;IACrC,EAAE,SAAyB;IAE3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,MAAM,qBAA4B;IACzC,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;IAEjC,MAAM,CAAC,IAAI,EAAE,OAAO;CAKrB"}
1
+ {"version":3,"file":"segmentDefinition.d.ts","sourceRoot":"","sources":["../../src/segmentDefinition.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,8BAAsB,iBAAiB;IACtC,EAAE,SAAyB;IAE3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,MAAM,qBAA4B;IACzC,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,CAAC;IAEjC,qBAAqB,CAAC,OAAO,EAAE,MAAM;IAMrC,MAAM,CAAC,IAAI,EAAE,OAAO;CAKpB"}
@@ -1,12 +1,12 @@
1
1
  import { Binary } from '../dataElements/Binary.js';
2
- import { Numeric } from '../dataElements/Numeric.js';
3
2
  import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
4
3
  import { TimeStamp } from '../dataGroups/TimeStamp.js';
5
4
  import { DataGroup } from '../dataGroups/DataGroup.js';
6
5
  import { Segment } from '../segment.js';
7
6
  import { SegmentDefinition } from '../segmentDefinition.js';
7
+ import { TanProcess } from '../codes.js';
8
8
  export type HITANSegment = Segment & {
9
- tanProcess: number;
9
+ tanProcess: TanProcess;
10
10
  orderHash?: string;
11
11
  orderReference?: string;
12
12
  challenge?: string;
@@ -20,6 +20,6 @@ export type HITANSegment = Segment & {
20
20
  export declare class HITAN extends SegmentDefinition {
21
21
  static Id: string;
22
22
  version: number;
23
- elements: (DataGroup | AlphaNumeric | Numeric | Binary)[];
23
+ elements: (DataGroup | AlphaNumeric | Binary)[];
24
24
  }
25
25
  //# sourceMappingURL=HITAN.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"HITAN.d.ts","sourceRoot":"","sources":["../../../src/segments/HITAN.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,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type HitansTanMethod = {
11
11
  secFunc: number;
12
12
  tanProcess: number;
13
13
  methodId: string;
14
- zkaMethod: string;
15
- zkaVersion: string;
14
+ zkaMethod?: string;
15
+ zkaVersion?: string;
16
16
  methodName: string;
17
- tanMaxLen: number;
18
- format: number;
17
+ tanMaxLen?: number;
18
+ format?: number;
19
19
  challengeText: string;
20
20
  maxChallengeLen: number;
21
21
  multipleTans: boolean;
@@ -29,6 +29,11 @@ export type HitansTanMethod = {
29
29
  tanMediaRequired: TanMediaRequirement;
30
30
  hdducRequired: boolean;
31
31
  activeTanMedia: number;
32
+ decoupledMaxStatusRequests?: number;
33
+ decoupledWaitBeforeFirstStatusRequest?: number;
34
+ decoupledWaitBetweenStatusRequests?: number;
35
+ decoupledManualConfirmationAllowed?: boolean;
36
+ decoupledAutoConfirmationAllowed?: boolean;
32
37
  };
33
38
  /**
34
39
  * Parameters for two-step TAN methods
@@ -1 +1 @@
1
- {"version":3,"file":"HITANS.d.ts","sourceRoot":"","sources":["../../../src/segments/HITANS.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMlD,OAAO,EAAE,4BAA4B,EAAE,mCAAmC,EAAE,MAAM,mCAAmC,CAAC;AAEtH,MAAM,MAAM,aAAa,GAAG,mCAAmC,CAAC,eAAe,CAAC,CAAC;AAEjF,MAAM,MAAM,eAAe,GAAG;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAA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,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,uBAAuB,EAAE,MAAM,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,mBAAmB,CAAC;IACtC,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,qCAAqC,CAAC,EAAE,MAAM,CAAC;IAC/C,kCAAkC,CAAC,EAAE,MAAM,CAAC;IAC5C,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAC7C,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,qBAAa,MAAO,SAAQ,4BAA4B;IACvD,MAAM,CAAC,EAAE,SAAa;IACtB,OAAO,SAAK;;CA+CZ"}
@@ -6,8 +6,9 @@ import { InternationalAccount } from '../dataGroups/InternationalAccount.js';
6
6
  import { DataGroup } from '../dataGroups/DataGroup.js';
7
7
  import { Segment } from '../segment.js';
8
8
  import { SegmentDefinition } from '../segmentDefinition.js';
9
+ import { TanProcess } from '../codes.js';
9
10
  export type HKTANSegment = Segment & {
10
- tanProcess: number;
11
+ tanProcess: TanProcess;
11
12
  segId: string;
12
13
  customerAccount?: InternationalAccount;
13
14
  orderHash?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"HKTAN.d.ts","sourceRoot":"","sources":["../../../src/segments/HKTAN.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BA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a,KAAM,SAAQ,iBAAiB;IAC3C,MAAM,CAAC,EAAE,SAAa;IACtB,MAAM,CAAC,OAAO,SAAK;IACnB,OAAO,SAAiB;IACxB,QAAQ,0DAwBN;CACF"}
@@ -1,10 +1,31 @@
1
1
  import { TanMediaRequirement } from './codes.js';
2
+ /**
3
+ * Represents a TAN (Transaction Authentication Number) method used to approve transactions.
4
+ *
5
+ * @property {number} id - The unique identifier for the TAN method.
6
+ * @property {string} name - The name of the TAN method.
7
+ * @property {number} version - The version of the TAN method.
8
+ * @property {boolean} isDecoupled - Indicates if the TAN method is decoupled, in which case no real TAN needs to be provided.
9
+ * @property {number} activeTanMediaCount - The number of active TAN media available for approval.
10
+ * @property {string[]} activeTanMedia - The names of active TAN media.
11
+ * @property {TanMediaRequirement} tanMediaRequirement - A value indicating wether a TAN media is required.
12
+ * @property {DecoupledParams} [decoupled] - Optional parameters for decoupled TAN methods, is only set when isDecoupled is also true.
13
+ */
2
14
  export type TanMethod = {
3
15
  id: number;
4
16
  name: string;
5
17
  version: number;
18
+ isDecoupled: boolean;
6
19
  activeTanMediaCount: number;
7
20
  activeTanMedia: string[];
8
21
  tanMediaRequirement: TanMediaRequirement;
22
+ decoupled?: DecoupledParams;
23
+ };
24
+ export type DecoupledParams = {
25
+ maxStatusRequests: number;
26
+ waitingSecondsBeforeFirstStatusRequest: number;
27
+ waitingSecondsBetweenStatusRequests: number;
28
+ manualConfirmationAllowed: boolean;
29
+ autoConfirmationAllowed: boolean;
9
30
  };
10
31
  //# sourceMappingURL=tanMethod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tanMethod.d.ts","sourceRoot":"","sources":["../../src/tanMethod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C,CAAC"}
1
+ {"version":3,"file":"tanMethod.d.ts","sourceRoot":"","sources":["../../src/tanMethod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sCAAsC,EAAE,MAAM,CAAC;IAC/C,mCAAmC,EAAE,MAAM,CAAC;IAC5C,yBAAyB,EAAE,OAAO,CAAC;IACnC,uBAAuB,EAAE,OAAO,CAAC;CACjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lib-fints",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "description": "Typescript/Javascript client library for Online-Banking via the FinTS 3.0 protocol with PIN/TAN",
5
5
  "engines": {
6
6
  "node": ">=18.0.0"