@coderoftime/fints 0.0.0-stage → 0.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 (254) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +28 -0
  3. package/README.md +156 -2
  4. package/dist/core/account.d.ts +140 -0
  5. package/dist/core/account.d.ts.map +1 -0
  6. package/dist/core/account.js +174 -0
  7. package/dist/core/account.js.map +1 -0
  8. package/dist/core/amount.d.ts +62 -0
  9. package/dist/core/amount.d.ts.map +1 -0
  10. package/dist/core/amount.js +189 -0
  11. package/dist/core/amount.js.map +1 -0
  12. package/dist/core/balance.d.ts +54 -0
  13. package/dist/core/balance.d.ts.map +1 -0
  14. package/dist/core/balance.js +53 -0
  15. package/dist/core/balance.js.map +1 -0
  16. package/dist/core/bank-info.d.ts +49 -0
  17. package/dist/core/bank-info.d.ts.map +1 -0
  18. package/dist/core/bank-info.js +52 -0
  19. package/dist/core/bank-info.js.map +1 -0
  20. package/dist/core/client.d.ts +126 -0
  21. package/dist/core/client.d.ts.map +1 -0
  22. package/dist/core/client.js +2 -0
  23. package/dist/core/client.js.map +1 -0
  24. package/dist/core/config.d.ts +68 -0
  25. package/dist/core/config.d.ts.map +1 -0
  26. package/dist/core/config.js +113 -0
  27. package/dist/core/config.js.map +1 -0
  28. package/dist/core/errors.d.ts +91 -0
  29. package/dist/core/errors.d.ts.map +1 -0
  30. package/dist/core/errors.js +182 -0
  31. package/dist/core/errors.js.map +1 -0
  32. package/dist/core/feedback.d.ts +69 -0
  33. package/dist/core/feedback.d.ts.map +1 -0
  34. package/dist/core/feedback.js +124 -0
  35. package/dist/core/feedback.js.map +1 -0
  36. package/dist/core/transaction.d.ts +98 -0
  37. package/dist/core/transaction.d.ts.map +1 -0
  38. package/dist/core/transaction.js +91 -0
  39. package/dist/core/transaction.js.map +1 -0
  40. package/dist/core/transport.d.ts +37 -0
  41. package/dist/core/transport.d.ts.map +1 -0
  42. package/dist/core/transport.js +92 -0
  43. package/dist/core/transport.js.map +1 -0
  44. package/dist/formats/camt.d.ts +12 -0
  45. package/dist/formats/camt.d.ts.map +1 -0
  46. package/dist/formats/camt.js +159 -0
  47. package/dist/formats/camt.js.map +1 -0
  48. package/dist/formats/mt940.d.ts +42 -0
  49. package/dist/formats/mt940.d.ts.map +1 -0
  50. package/dist/formats/mt940.js +297 -0
  51. package/dist/formats/mt940.js.map +1 -0
  52. package/dist/formats/readers.d.ts +11 -0
  53. package/dist/formats/readers.d.ts.map +1 -0
  54. package/dist/formats/readers.js +47 -0
  55. package/dist/formats/readers.js.map +1 -0
  56. package/dist/formats/sepa-purpose.d.ts +22 -0
  57. package/dist/formats/sepa-purpose.d.ts.map +1 -0
  58. package/dist/formats/sepa-purpose.js +68 -0
  59. package/dist/formats/sepa-purpose.js.map +1 -0
  60. package/dist/index.d.ts +28 -0
  61. package/dist/index.d.ts.map +1 -0
  62. package/dist/index.js +27 -0
  63. package/dist/index.js.map +1 -0
  64. package/dist/session/app-approval.d.ts +60 -0
  65. package/dist/session/app-approval.d.ts.map +1 -0
  66. package/dist/session/app-approval.js +215 -0
  67. package/dist/session/app-approval.js.map +1 -0
  68. package/dist/session/bank-connection.d.ts +28 -0
  69. package/dist/session/bank-connection.d.ts.map +1 -0
  70. package/dist/session/bank-connection.js +48 -0
  71. package/dist/session/bank-connection.js.map +1 -0
  72. package/dist/session/dialog-runner.d.ts +34 -0
  73. package/dist/session/dialog-runner.d.ts.map +1 -0
  74. package/dist/session/dialog-runner.js +112 -0
  75. package/dist/session/dialog-runner.js.map +1 -0
  76. package/dist/session/login-guard.d.ts +73 -0
  77. package/dist/session/login-guard.d.ts.map +1 -0
  78. package/dist/session/login-guard.js +109 -0
  79. package/dist/session/login-guard.js.map +1 -0
  80. package/dist/session/parameter-data.d.ts +83 -0
  81. package/dist/session/parameter-data.d.ts.map +1 -0
  82. package/dist/session/parameter-data.js +68 -0
  83. package/dist/session/parameter-data.js.map +1 -0
  84. package/dist/session/pin-tan-client.d.ts +54 -0
  85. package/dist/session/pin-tan-client.d.ts.map +1 -0
  86. package/dist/session/pin-tan-client.js +153 -0
  87. package/dist/session/pin-tan-client.js.map +1 -0
  88. package/dist/session/pin-tan-dialog.d.ts +71 -0
  89. package/dist/session/pin-tan-dialog.d.ts.map +1 -0
  90. package/dist/session/pin-tan-dialog.js +124 -0
  91. package/dist/session/pin-tan-dialog.js.map +1 -0
  92. package/dist/session/protocol.d.ts +209 -0
  93. package/dist/session/protocol.d.ts.map +1 -0
  94. package/dist/session/protocol.js +75 -0
  95. package/dist/session/protocol.js.map +1 -0
  96. package/dist/session/response-handler.d.ts +48 -0
  97. package/dist/session/response-handler.d.ts.map +1 -0
  98. package/dist/session/response-handler.js +121 -0
  99. package/dist/session/response-handler.js.map +1 -0
  100. package/dist/session/sepa-accounts.d.ts +34 -0
  101. package/dist/session/sepa-accounts.d.ts.map +1 -0
  102. package/dist/session/sepa-accounts.js +96 -0
  103. package/dist/session/sepa-accounts.js.map +1 -0
  104. package/dist/session/session-setup.d.ts +72 -0
  105. package/dist/session/session-setup.d.ts.map +1 -0
  106. package/dist/session/session-setup.js +160 -0
  107. package/dist/session/session-setup.js.map +1 -0
  108. package/dist/session/session-state.d.ts +47 -0
  109. package/dist/session/session-state.d.ts.map +1 -0
  110. package/dist/session/session-state.js +147 -0
  111. package/dist/session/session-state.js.map +1 -0
  112. package/dist/session/tan-selection.d.ts +88 -0
  113. package/dist/session/tan-selection.d.ts.map +1 -0
  114. package/dist/session/tan-selection.js +178 -0
  115. package/dist/session/tan-selection.js.map +1 -0
  116. package/dist/session/user-prompts.d.ts +61 -0
  117. package/dist/session/user-prompts.d.ts.map +1 -0
  118. package/dist/session/user-prompts.js +164 -0
  119. package/dist/session/user-prompts.js.map +1 -0
  120. package/dist/tan/challenge.d.ts +114 -0
  121. package/dist/tan/challenge.d.ts.map +1 -0
  122. package/dist/tan/challenge.js +185 -0
  123. package/dist/tan/challenge.js.map +1 -0
  124. package/dist/tan/flicker.d.ts +36 -0
  125. package/dist/tan/flicker.d.ts.map +1 -0
  126. package/dist/tan/flicker.js +262 -0
  127. package/dist/tan/flicker.js.map +1 -0
  128. package/dist/tan/tan-image.d.ts +21 -0
  129. package/dist/tan/tan-image.d.ts.map +1 -0
  130. package/dist/tan/tan-image.js +41 -0
  131. package/dist/tan/tan-image.js.map +1 -0
  132. package/dist/tan/tan-models.d.ts +145 -0
  133. package/dist/tan/tan-models.d.ts.map +1 -0
  134. package/dist/tan/tan-models.js +148 -0
  135. package/dist/tan/tan-models.js.map +1 -0
  136. package/dist/util/async.d.ts +24 -0
  137. package/dist/util/async.d.ts.map +1 -0
  138. package/dist/util/async.js +49 -0
  139. package/dist/util/async.js.map +1 -0
  140. package/dist/util/bytes.d.ts +23 -0
  141. package/dist/util/bytes.d.ts.map +1 -0
  142. package/dist/util/bytes.js +136 -0
  143. package/dist/util/bytes.js.map +1 -0
  144. package/dist/util/call-context.d.ts +12 -0
  145. package/dist/util/call-context.d.ts.map +1 -0
  146. package/dist/util/call-context.js +29 -0
  147. package/dist/util/call-context.js.map +1 -0
  148. package/dist/util/dates.d.ts +62 -0
  149. package/dist/util/dates.d.ts.map +1 -0
  150. package/dist/util/dates.js +169 -0
  151. package/dist/util/dates.js.map +1 -0
  152. package/dist/util/errors.d.ts +9 -0
  153. package/dist/util/errors.d.ts.map +1 -0
  154. package/dist/util/errors.js +15 -0
  155. package/dist/util/errors.js.map +1 -0
  156. package/dist/util/immutable-map.d.ts +16 -0
  157. package/dist/util/immutable-map.d.ts.map +1 -0
  158. package/dist/util/immutable-map.js +38 -0
  159. package/dist/util/immutable-map.js.map +1 -0
  160. package/dist/util/json.d.ts +13 -0
  161. package/dist/util/json.d.ts.map +1 -0
  162. package/dist/util/json.js +44 -0
  163. package/dist/util/json.js.map +1 -0
  164. package/dist/util/text.d.ts +20 -0
  165. package/dist/util/text.d.ts.map +1 -0
  166. package/dist/util/text.js +78 -0
  167. package/dist/util/text.js.map +1 -0
  168. package/dist/util/xml.d.ts +35 -0
  169. package/dist/util/xml.d.ts.map +1 -0
  170. package/dist/util/xml.js +183 -0
  171. package/dist/util/xml.js.map +1 -0
  172. package/dist/v3/account-extension.d.ts +25 -0
  173. package/dist/v3/account-extension.d.ts.map +1 -0
  174. package/dist/v3/account-extension.js +176 -0
  175. package/dist/v3/account-extension.js.map +1 -0
  176. package/dist/v3/client.d.ts +24 -0
  177. package/dist/v3/client.d.ts.map +1 -0
  178. package/dist/v3/client.js +16 -0
  179. package/dist/v3/client.js.map +1 -0
  180. package/dist/v3/dialog.d.ts +78 -0
  181. package/dist/v3/dialog.d.ts.map +1 -0
  182. package/dist/v3/dialog.js +138 -0
  183. package/dist/v3/dialog.js.map +1 -0
  184. package/dist/v3/message.d.ts +72 -0
  185. package/dist/v3/message.d.ts.map +1 -0
  186. package/dist/v3/message.js +259 -0
  187. package/dist/v3/message.js.map +1 -0
  188. package/dist/v3/parameters.d.ts +79 -0
  189. package/dist/v3/parameters.d.ts.map +1 -0
  190. package/dist/v3/parameters.js +396 -0
  191. package/dist/v3/parameters.js.map +1 -0
  192. package/dist/v3/protocol.d.ts +68 -0
  193. package/dist/v3/protocol.d.ts.map +1 -0
  194. package/dist/v3/protocol.js +263 -0
  195. package/dist/v3/protocol.js.map +1 -0
  196. package/dist/v3/segments.d.ts +89 -0
  197. package/dist/v3/segments.d.ts.map +1 -0
  198. package/dist/v3/segments.js +283 -0
  199. package/dist/v3/segments.js.map +1 -0
  200. package/dist/v3/syntax.d.ts +76 -0
  201. package/dist/v3/syntax.d.ts.map +1 -0
  202. package/dist/v3/syntax.js +301 -0
  203. package/dist/v3/syntax.js.map +1 -0
  204. package/package.json +63 -4
  205. package/src/core/account.ts +250 -0
  206. package/src/core/amount.ts +209 -0
  207. package/src/core/balance.ts +84 -0
  208. package/src/core/bank-info.ts +66 -0
  209. package/src/core/client.ts +149 -0
  210. package/src/core/config.ts +141 -0
  211. package/src/core/errors.ts +203 -0
  212. package/src/core/feedback.ts +137 -0
  213. package/src/core/transaction.ts +156 -0
  214. package/src/core/transport.ts +114 -0
  215. package/src/formats/camt.ts +169 -0
  216. package/src/formats/mt940.ts +333 -0
  217. package/src/formats/readers.ts +56 -0
  218. package/src/formats/sepa-purpose.ts +75 -0
  219. package/src/index.ts +68 -0
  220. package/src/session/app-approval.ts +265 -0
  221. package/src/session/bank-connection.ts +51 -0
  222. package/src/session/dialog-runner.ts +119 -0
  223. package/src/session/login-guard.ts +135 -0
  224. package/src/session/parameter-data.ts +137 -0
  225. package/src/session/pin-tan-client.ts +186 -0
  226. package/src/session/pin-tan-dialog.ts +160 -0
  227. package/src/session/protocol.ts +311 -0
  228. package/src/session/response-handler.ts +130 -0
  229. package/src/session/sepa-accounts.ts +97 -0
  230. package/src/session/session-setup.ts +165 -0
  231. package/src/session/session-state.ts +170 -0
  232. package/src/session/tan-selection.ts +192 -0
  233. package/src/session/user-prompts.ts +174 -0
  234. package/src/tan/challenge.ts +252 -0
  235. package/src/tan/flicker.ts +270 -0
  236. package/src/tan/tan-image.ts +36 -0
  237. package/src/tan/tan-models.ts +247 -0
  238. package/src/util/async.ts +53 -0
  239. package/src/util/bytes.ts +135 -0
  240. package/src/util/call-context.ts +40 -0
  241. package/src/util/dates.ts +193 -0
  242. package/src/util/errors.ts +16 -0
  243. package/src/util/immutable-map.ts +47 -0
  244. package/src/util/json.ts +51 -0
  245. package/src/util/text.ts +82 -0
  246. package/src/util/xml.ts +172 -0
  247. package/src/v3/account-extension.ts +190 -0
  248. package/src/v3/client.ts +29 -0
  249. package/src/v3/dialog.ts +199 -0
  250. package/src/v3/message.ts +321 -0
  251. package/src/v3/parameters.ts +451 -0
  252. package/src/v3/protocol.ts +331 -0
  253. package/src/v3/segments.ts +331 -0
  254. package/src/v3/syntax.ts +307 -0
@@ -0,0 +1,189 @@
1
+ import { FormatError } from '../util/errors.js';
2
+ /** Most decimal places an amount has: ISO 20022, the widest of the bank formats, allows five. */
3
+ const maxScale = 5;
4
+ /** Largest `minorUnits` an amount holds: 2^53 - 1, which JavaScript numbers represent exactly. */
5
+ const maxMinorUnits = Number.MAX_SAFE_INTEGER;
6
+ const powersOfTen = [1, 10, 100, 1000, 10000, 100000];
7
+ /** Most digits a parsed amount has: few enough that the sum of two parsed amounts still fits. */
8
+ const maxDigits = 15;
9
+ const decimal = /^([+-]?)(\d*)(?:[.,](\d*))?$/;
10
+ /** Decimal places of the minor unit of `currency` (ISO 4217): two, except for the currencies listed here. */
11
+ function minorUnitDigits(currency) {
12
+ switch (currency) {
13
+ case 'BIF':
14
+ case 'CLP':
15
+ case 'DJF':
16
+ case 'GNF':
17
+ case 'ISK':
18
+ case 'JPY':
19
+ case 'KMF':
20
+ case 'KRW':
21
+ case 'PYG':
22
+ case 'RWF':
23
+ case 'UGX':
24
+ case 'UYI':
25
+ case 'VND':
26
+ case 'VUV':
27
+ case 'XAF':
28
+ case 'XOF':
29
+ case 'XPF':
30
+ return 0;
31
+ case 'BHD':
32
+ case 'IQD':
33
+ case 'JOD':
34
+ case 'KWD':
35
+ case 'LYD':
36
+ case 'OMR':
37
+ case 'TND':
38
+ return 3;
39
+ case 'CLF':
40
+ case 'UYW':
41
+ return 4;
42
+ default:
43
+ return 2;
44
+ }
45
+ }
46
+ /** A money amount stored as an integer number of `scale`-digit minor units. */
47
+ export class Amount {
48
+ /** The amount in units of 10^-`scale` of the currency, negative for a debit: 1234 with scale 2 is 12.34. */
49
+ minorUnits;
50
+ /** Number of decimal places `minorUnits` has, from 0 to 5. */
51
+ scale;
52
+ /** ISO 4217 currency code, for example `EUR`. */
53
+ currency;
54
+ /**
55
+ * An amount of `minorUnits` with `scale` decimal places; throws `RangeError` for a `scale` outside 0 to 5, and for
56
+ * `minorUnits` that are no integer or beyond 2^53 - 1 in either direction, about 90 trillion at two decimal places.
57
+ */
58
+ constructor(minorUnits, scale, currency) {
59
+ if (!Number.isInteger(scale) || scale < 0 || scale > maxScale) {
60
+ throw new RangeError(`scale must be an integer from 0 to ${maxScale}: ${scale}`);
61
+ }
62
+ if (!Number.isSafeInteger(minorUnits))
63
+ throw new RangeError(`minorUnits out of range: ${minorUnits}`);
64
+ // No negative zero, which would format as `-0.00`.
65
+ this.minorUnits = minorUnits === 0 ? 0 : minorUnits;
66
+ this.scale = scale;
67
+ this.currency = currency;
68
+ }
69
+ /**
70
+ * Parses a number as banks send it: digits with at most one decimal separator, `,` (FinTS 3.0, MT940) or `.` (camt),
71
+ * and no thousands separators.
72
+ *
73
+ * The amount has the decimal places of the `currency`'s minor unit (ISO 4217): two for most currencies, none for
74
+ * `JPY`, three for `KWD`. It has more where the value has more significant digits. So `100,` in `EUR` is `100.00`, in
75
+ * `JPY` `100`.
76
+ *
77
+ * Throws `FormatError` for anything else, so that `1.234,56` in bank data is an error, not a guess, and for more than
78
+ * five decimal places (trailing zeros aside) or more than 15 digits.
79
+ */
80
+ static parseDecimal(value, currency) {
81
+ const match = decimal.exec(value.trim());
82
+ const whole = match?.[2] ?? '';
83
+ let fraction = match?.[3] ?? '';
84
+ if (!match || (whole === '' && fraction === ''))
85
+ throw new FormatError('Invalid amount', value);
86
+ const minorDigits = minorUnitDigits(currency);
87
+ while (fraction.length > minorDigits && fraction.endsWith('0')) {
88
+ fraction = fraction.substring(0, fraction.length - 1);
89
+ }
90
+ fraction = fraction.padEnd(minorDigits, '0');
91
+ const digits = `${whole.replace(/^0+/, '')}${fraction}`;
92
+ if (fraction.length > maxScale || digits.length > maxDigits) {
93
+ throw new FormatError(`Amount with more than ${maxScale} decimal places or ${maxDigits} digits`, value);
94
+ }
95
+ // Nothing is left of a zero without decimal places, such as `0` in `JPY`.
96
+ const units = digits === '' ? 0 : Number(digits);
97
+ return new Amount(match[1] === '-' ? -units : units, fraction.length, currency);
98
+ }
99
+ /** The amount as a floating-point number, which cannot hold every decimal fraction exactly; do not calculate with it. */
100
+ get value() {
101
+ return this.minorUnits / powersOfTen[this.scale];
102
+ }
103
+ /** Whether the amount is below zero. */
104
+ get isNegative() {
105
+ return this.minorUnits < 0;
106
+ }
107
+ /** Whether the amount is zero. */
108
+ get isZero() {
109
+ return this.minorUnits === 0;
110
+ }
111
+ /** This amount with the opposite sign. */
112
+ negate() {
113
+ return new Amount(-this.minorUnits, this.scale, this.currency);
114
+ }
115
+ /** This amount without its sign. */
116
+ abs() {
117
+ return this.isNegative ? this.negate() : this;
118
+ }
119
+ /**
120
+ * The sum with `other`, at the larger of the two scales; throws `TypeError` for another currency and `RangeError` for
121
+ * a sum beyond what an amount holds.
122
+ */
123
+ add(other) {
124
+ this.checkCurrency(other);
125
+ const [mine, theirs] = this.atCommonScale(other);
126
+ const sum = mine + theirs;
127
+ const limit = BigInt(maxMinorUnits);
128
+ if (sum > limit || sum < -limit)
129
+ throw new RangeError(`The sum of ${this.toString()} and ${other.toString()} is too large for an Amount`);
130
+ return new Amount(Number(sum), Math.max(this.scale, other.scale), this.currency);
131
+ }
132
+ /** The difference to `other`; throws `TypeError` for another currency. */
133
+ subtract(other) {
134
+ return this.add(other.negate());
135
+ }
136
+ /** Compares by value, whatever the scales; throws `TypeError` for another currency. */
137
+ compareTo(other) {
138
+ this.checkCurrency(other);
139
+ return this.compareValue(other);
140
+ }
141
+ /** Whether `other` is the same amount in the same currency, whatever the `scale`: 1.50 equals 1.500. */
142
+ equals(other) {
143
+ return other instanceof Amount && other.currency === this.currency && this.compareValue(other) === 0;
144
+ }
145
+ /** Formats the amount without currency, for example `-12.50`. */
146
+ toDecimalString(decimalSeparator = '.') {
147
+ const digits = Math.abs(this.minorUnits)
148
+ .toString()
149
+ .padStart(this.scale + 1, '0');
150
+ const whole = digits.substring(0, digits.length - this.scale);
151
+ const fraction = digits.substring(digits.length - this.scale);
152
+ const sign = this.isNegative ? '-' : '';
153
+ return this.scale === 0 ? `${sign}${whole}` : `${sign}${whole}${decimalSeparator}${fraction}`;
154
+ }
155
+ toString() {
156
+ return `${this.toDecimalString()} ${this.currency}`;
157
+ }
158
+ /** The minor units of both amounts at the larger scale, as `bigint`s, since the factor could leave the safe range. */
159
+ atCommonScale(other) {
160
+ const target = Math.max(this.scale, other.scale);
161
+ return [this.rescale(target), other.rescale(target)];
162
+ }
163
+ rescale(target) {
164
+ return BigInt(this.minorUnits) * BigInt(powersOfTen[target - this.scale]);
165
+ }
166
+ compareValue(other) {
167
+ if (this.scale === other.scale)
168
+ return Math.sign(this.minorUnits - other.minorUnits);
169
+ const [mine, theirs] = this.atCommonScale(other);
170
+ return mine === theirs ? 0 : mine < theirs ? -1 : 1;
171
+ }
172
+ checkCurrency(other) {
173
+ if (other.currency !== this.currency)
174
+ throw new TypeError(`Currency mismatch: ${this.currency} vs ${other.currency}`);
175
+ }
176
+ }
177
+ /**
178
+ * `amount` as a credit (unchanged) or a debit (negated), by the bank's credit/debit `mark`.
179
+ *
180
+ * Throws `FormatError` for any other `mark`, `undefined` included: a missing mark must not be read as a credit.
181
+ */
182
+ export function withMark(amount, mark, credit, debit) {
183
+ if (mark === credit)
184
+ return amount;
185
+ if (mark === debit)
186
+ return amount.negate();
187
+ throw new FormatError(`Credit/debit mark is neither "${credit}" nor "${debit}"`, mark);
188
+ }
189
+ //# sourceMappingURL=amount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/core/amount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,iGAAiG;AACjG,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,kGAAkG;AAClG,MAAM,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAC9C,MAAM,WAAW,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAEtD,iGAAiG;AACjG,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAE/C,6GAA6G;AAC7G,SAAS,eAAe,CAAC,QAAgB;IACvC,QAAQ,QAAQ,EAA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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,CAAC;IAEO,aAAa,CAAC,KAAa;QACjC,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ;YAClC,MAAM,IAAI,SAAS,CAAC,sBAAsB,IAAI,CAAC,QAAQ,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACpF,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAc,EAAE,IAAwB,EAAE,MAAc,EAAE,KAAa;IAC9F,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,MAAM,CAAC;IACnC,IAAI,IAAI,KAAK,KAAK;QAAE,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;IAC3C,MAAM,IAAI,WAAW,CAAC,iCAAiC,MAAM,UAAU,KAAK,GAAG,EAAE,IAAI,CAAC,CAAC;AACzF,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { Account } from './account.js';
2
+ import type { Amount } from './amount.js';
3
+ /** What `Balance` takes; the bank states the amounts it knows. */
4
+ export interface BalanceInit {
5
+ account: Account;
6
+ booked: Amount;
7
+ bookedAsOf: Date;
8
+ bookedAsOfTime?: Date | undefined;
9
+ pending?: Amount | undefined;
10
+ creditLine?: Amount | undefined;
11
+ available?: Amount | undefined;
12
+ used?: Amount | undefined;
13
+ overdraft?: Amount | undefined;
14
+ bookingDate?: Date | undefined;
15
+ bookingTime?: Date | undefined;
16
+ productName?: string | undefined;
17
+ }
18
+ /** Account balance as reported by the bank. */
19
+ export declare class Balance {
20
+ /** The account the balance belongs to. */
21
+ readonly account: Account;
22
+ /** Booked balance; negative when overdrawn. */
23
+ readonly booked: Amount;
24
+ /**
25
+ * The calendar day the bank states with the booked balance: the day it transmitted the balance, which need not be the
26
+ * day the balance was booked (`bookingDate`). A local `Date` at midnight.
27
+ */
28
+ readonly bookedAsOf: Date;
29
+ /** The exact moment of `bookedAsOf`, where the bank states the time of day as well; `undefined` otherwise. */
30
+ readonly bookedAsOfTime: Date | undefined;
31
+ /** Balance of pending (not yet booked) transactions, if the bank reports it. */
32
+ readonly pending: Amount | undefined;
33
+ /** Arranged overdraft limit. */
34
+ readonly creditLine: Amount | undefined;
35
+ /** Amount currently available for payments. */
36
+ readonly available: Amount | undefined;
37
+ /** Amount already drawn on the account's limit. */
38
+ readonly used: Amount | undefined;
39
+ /** Amount by which the account exceeds its limit. */
40
+ readonly overdraft: Amount | undefined;
41
+ /** The calendar day the booked balance was booked (Buchungszeitpunkt), where the bank states it. */
42
+ readonly bookingDate: Date | undefined;
43
+ /** The exact moment of `bookingDate`, where the bank states the time of day as well; `undefined` otherwise. */
44
+ readonly bookingTime: Date | undefined;
45
+ /** The bank's name for the account, for example `Girokonto`. */
46
+ readonly productName: string | undefined;
47
+ constructor(init: BalanceInit);
48
+ /**
49
+ * The account, as `Account.toString` shows it, and the date; no amount, so that logs and crash reports do not collect
50
+ * account data.
51
+ */
52
+ toString(): string;
53
+ }
54
+ //# sourceMappingURL=balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../src/core/balance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,kEAAkE;AAClE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,IAAI,CAAC;IACjB,cAAc,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,+CAA+C;AAC/C,qBAAa,OAAO;IAClB,0CAA0C;IAC1C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC;IAE1B,8GAA8G;IAC9G,QAAQ,CAAC,cAAc,EAAE,IAAI,GAAG,SAAS,CAAC;IAE1C,gFAAgF;IAChF,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC,gCAAgC;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,mDAAmD;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAElC,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvC,oGAAoG;IACpG,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvC,+GAA+G;IAC/G,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;IAEvC,gEAAgE;IAChE,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE7B,IAAI,EAAE,WAAW;IAe7B;;;OAGG;IACH,QAAQ,IAAI,MAAM;CAGnB"}
@@ -0,0 +1,53 @@
1
+ import { formatIsoDate } from '../util/dates.js';
2
+ /** Account balance as reported by the bank. */
3
+ export class Balance {
4
+ /** The account the balance belongs to. */
5
+ account;
6
+ /** Booked balance; negative when overdrawn. */
7
+ booked;
8
+ /**
9
+ * The calendar day the bank states with the booked balance: the day it transmitted the balance, which need not be the
10
+ * day the balance was booked (`bookingDate`). A local `Date` at midnight.
11
+ */
12
+ bookedAsOf;
13
+ /** The exact moment of `bookedAsOf`, where the bank states the time of day as well; `undefined` otherwise. */
14
+ bookedAsOfTime;
15
+ /** Balance of pending (not yet booked) transactions, if the bank reports it. */
16
+ pending;
17
+ /** Arranged overdraft limit. */
18
+ creditLine;
19
+ /** Amount currently available for payments. */
20
+ available;
21
+ /** Amount already drawn on the account's limit. */
22
+ used;
23
+ /** Amount by which the account exceeds its limit. */
24
+ overdraft;
25
+ /** The calendar day the booked balance was booked (Buchungszeitpunkt), where the bank states it. */
26
+ bookingDate;
27
+ /** The exact moment of `bookingDate`, where the bank states the time of day as well; `undefined` otherwise. */
28
+ bookingTime;
29
+ /** The bank's name for the account, for example `Girokonto`. */
30
+ productName;
31
+ constructor(init) {
32
+ this.account = init.account;
33
+ this.booked = init.booked;
34
+ this.bookedAsOf = init.bookedAsOf;
35
+ this.bookedAsOfTime = init.bookedAsOfTime;
36
+ this.pending = init.pending;
37
+ this.creditLine = init.creditLine;
38
+ this.available = init.available;
39
+ this.used = init.used;
40
+ this.overdraft = init.overdraft;
41
+ this.bookingDate = init.bookingDate;
42
+ this.bookingTime = init.bookingTime;
43
+ this.productName = init.productName;
44
+ }
45
+ /**
46
+ * The account, as `Account.toString` shows it, and the date; no amount, so that logs and crash reports do not collect
47
+ * account data.
48
+ */
49
+ toString() {
50
+ return `Balance(${this.account.toString()}, ${formatIsoDate(this.bookedAsOf)})`;
51
+ }
52
+ }
53
+ //# sourceMappingURL=balance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.js","sourceRoot":"","sources":["../../src/core/balance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAoBjD,+CAA+C;AAC/C,MAAM,OAAO,OAAO;IAClB,0CAA0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;CACF"}
@@ -0,0 +1,49 @@
1
+ /** General bank information from the bank parameter data (BPD). */
2
+ export declare class BankInfo {
3
+ /** German bank code (BLZ). */
4
+ readonly bankCode: string;
5
+ /** The bank's name. */
6
+ readonly name: string | undefined;
7
+ /** Version of the bank parameter data this information comes from. */
8
+ readonly bpdVersion: number;
9
+ /** FinTS versions the bank supports, as it names them. */
10
+ readonly supportedVersions: readonly string[];
11
+ /** Languages the bank's messages come in, as codes the bank defines. */
12
+ readonly languages: readonly string[];
13
+ /** Largest message in kilobytes (1024 bytes) the bank accepts; the client sends nothing larger. */
14
+ readonly maxMessageSize: number | undefined;
15
+ /**
16
+ * Time in seconds before which a client must not send a life-indicator message to keep an idle dialog open, `0` for
17
+ * none (HIBPA, Formals C.9). This client sends no such messages.
18
+ */
19
+ readonly minTimeout: number | undefined;
20
+ /**
21
+ * Time in seconds after which the bank will likely end a dialog without messages, `0` for no limit (HIBPA, Formals
22
+ * C.9). The client starts a new dialog for a call after that time.
23
+ */
24
+ readonly maxTimeout: number | undefined;
25
+ constructor(init: {
26
+ bankCode: string;
27
+ name?: string | undefined;
28
+ bpdVersion: number;
29
+ supportedVersions?: readonly string[];
30
+ languages?: readonly string[];
31
+ maxMessageSize?: number | undefined;
32
+ minTimeout?: number | undefined;
33
+ maxTimeout?: number | undefined;
34
+ });
35
+ }
36
+ /** Free-text message sent by the bank during login. */
37
+ export declare class BankMessage {
38
+ /** What the message is about. */
39
+ readonly subject: string;
40
+ /** The message itself. */
41
+ readonly text: string;
42
+ constructor(
43
+ /** What the message is about. */
44
+ subject: string,
45
+ /** The message itself. */
46
+ text: string);
47
+ toString(): string;
48
+ }
49
+ //# sourceMappingURL=bank-info.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank-info.d.ts","sourceRoot":"","sources":["../../src/core/bank-info.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,qBAAa,QAAQ;IACnB,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,M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;
5
+ /** The bank's name. */
6
+ name;
7
+ /** Version of the bank parameter data this information comes from. */
8
+ bpdVersion;
9
+ /** FinTS versions the bank supports, as it names them. */
10
+ supportedVersions;
11
+ /** Languages the bank's messages come in, as codes the bank defines. */
12
+ languages;
13
+ /** Largest message in kilobytes (1024 bytes) the bank accepts; the client sends nothing larger. */
14
+ maxMessageSize;
15
+ /**
16
+ * Time in seconds before which a client must not send a life-indicator message to keep an idle dialog open, `0` for
17
+ * none (HIBPA, Formals C.9). This client sends no such messages.
18
+ */
19
+ minTimeout;
20
+ /**
21
+ * Time in seconds after which the bank will likely end a dialog without messages, `0` for no limit (HIBPA, Formals
22
+ * C.9). The client starts a new dialog for a call after that time.
23
+ */
24
+ maxTimeout;
25
+ constructor(init) {
26
+ this.bankCode = init.bankCode;
27
+ this.name = init.name;
28
+ this.bpdVersion = init.bpdVersion;
29
+ this.supportedVersions = Object.freeze([...(init.supportedVersions ?? [])]);
30
+ this.languages = Object.freeze([...(init.languages ?? [])]);
31
+ this.maxMessageSize = init.maxMessageSize;
32
+ this.minTimeout = init.minTimeout;
33
+ this.maxTimeout = init.maxTimeout;
34
+ }
35
+ }
36
+ /** Free-text message sent by the bank during login. */
37
+ export class BankMessage {
38
+ subject;
39
+ text;
40
+ constructor(
41
+ /** What the message is about. */
42
+ subject,
43
+ /** The message itself. */
44
+ text) {
45
+ this.subject = subject;
46
+ this.text = text;
47
+ }
48
+ toString() {
49
+ return `${this.subject}: ${this.text}`;
50
+ }
51
+ }
52
+ //# sourceMappingURL=bank-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bank-info.js","sourceRoot":"","sources":["../../src/core/bank-info.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,OAAO,QAAQ;IACnB,8BAA8B;IACrB,QAAQ,CAAS;IAE1B,uBAAuB;IACd,IAAI,CAAqB;IAElC,sEAAsE;IAC7D,UAAU,CAAS;IAE5B,0DAA0D;IACjD,iBAAiB,CAAoB;IAE9C,wEAAwE;IAC/D,SAAS,CAAoB;IAEtC,mGAAmG;IAC1F,cAAc,CAAqB;IAE5C;;;OAGG;IACM,UAAU,CAAqB;IAExC;;;OAGG;IACM,UAAU,CAAqB;IAExC,YAAY,IASX;QACC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5E,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;CACF;AAED,uDAAuD;AACvD,MAAM,OAAO,WAAW;IAGX;IAEA;IAJX;IACE,iCAAiC;IACxB,OAAe;IACxB,0BAA0B;IACjB,IAAY;QAFZ,YAAO,GAAP,OAAO,CAAQ;QAEf,SAAI,GAAJ,IAAI,CAAQ;IACpB,CAAC;IAEJ,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;CACF"}
@@ -0,0 +1,126 @@
1
+ import type { TanCallback, TanMediumSelector, TanMethodSelector } from '../tan/challenge.js';
2
+ import type { TanMedium, TanMethod } from '../tan/tan-models.js';
3
+ import type { Account } from './account.js';
4
+ import type { Balance } from './balance.js';
5
+ import type { BankInfo, BankMessage } from './bank-info.js';
6
+ import type { FinTsFeedback } from './feedback.js';
7
+ import type { Transaction, TransactionFormat } from './transaction.js';
8
+ import type { FinTsTransport } from './transport.js';
9
+ /** Which way a FinTS message travels: from the client to the bank, or back. */
10
+ export type MessageDirection = 'outgoing' | 'incoming';
11
+ /** Receives every FinTS message with PIN and TAN masked. */
12
+ export type MessageLogger = (direction: MessageDirection, message: string) => void;
13
+ /** Receives free-text messages the bank sends during login. */
14
+ export type BankMessageHandler = (message: BankMessage) => void;
15
+ /** Receives a warning the bank sends, a return code from 3000 to 3999. */
16
+ export type WarningHandler = (warning: FinTsFeedback) => void;
17
+ /**
18
+ * How a client reaches the user and the bank, apart from the login data in `FinTsConfig`.
19
+ *
20
+ * An error thrown by a callback that only informs the app (`onBankMessage`, `onWarning`, `logger`) fails the call once
21
+ * the call's exchange with the bank is over, so that it cannot break off a dialog half-way; an error of the call itself
22
+ * takes precedence.
23
+ */
24
+ export interface FinTsClientOptions {
25
+ /** Called whenever the bank asks for a TAN or an app approval. */
26
+ tanCallback: TanCallback;
27
+ /** Picks the TAN method when the bank offers several; the first is used without it. */
28
+ tanMethodSelector?: TanMethodSelector;
29
+ /** Picks the TAN medium when the method needs one and the user has several; the first is used without it. */
30
+ tanMediumSelector?: TanMediumSelector;
31
+ /** Receives the free-text messages the bank sends during login. */
32
+ onBankMessage?: BankMessageHandler;
33
+ /**
34
+ * Receives the bank's warnings, such as 3951 (switch to another TAN method), but not those the client acts on itself,
35
+ * such as 3040 (more data follow). Show them to the user with code and text, as the specification asks.
36
+ */
37
+ onWarning?: WarningHandler;
38
+ /** Receives every FinTS message with PIN and TAN masked, for diagnosis; the messages contain account data. */
39
+ logger?: MessageLogger;
40
+ /**
41
+ * The `FinTsClient.state` of a previous session, which skips the bank setup steps.
42
+ *
43
+ * A state saved for another user or bank is ignored.
44
+ */
45
+ state?: string | undefined;
46
+ /**
47
+ * Sends the messages; an `HttpTransport` by default.
48
+ *
49
+ * The client closes it on `FinTsClient.close`, so hand each client a transport of its own.
50
+ */
51
+ transport?: FinTsTransport;
52
+ }
53
+ /** What `getTransactions` takes besides the account. */
54
+ export interface TransactionQuery {
55
+ /** The first day, a day in the future counting as today; banks typically ask for a TAN beyond 90 days ago. */
56
+ from?: Date | undefined;
57
+ /** The last day, a day in the future counting as today. */
58
+ to?: Date | undefined;
59
+ /** The format to ask for; `auto` by default. */
60
+ format?: TransactionFormat;
61
+ }
62
+ /**
63
+ * Read access to a bank account over FinTS.
64
+ *
65
+ * All calls share one bank dialog, so strong authentication happens once per session. Calls run one after another; call
66
+ * `close` when done.
67
+ *
68
+ * A callback in `FinTsClientOptions` must not wait for another call of its client, which would wait for the running
69
+ * call. On Node.js, Deno and Bun such a call fails with `FinTsStateError`; elsewhere it would wait forever. `close` works
70
+ * from anywhere.
71
+ */
72
+ export interface FinTsClient {
73
+ /**
74
+ * Serialized session data: bank and user parameters, customer system ID, the TAN methods the user may use, the chosen
75
+ * TAN method and medium, and the SEPA account list.
76
+ *
77
+ * Contains no PIN or TAN, but account details, so store it encrypted.
78
+ */
79
+ readonly state: string;
80
+ /** Security function code of the TAN method in use, for example `942`; `undefined` before the first login. */
81
+ readonly selectedTanMethod: string | undefined;
82
+ /** Name of the TAN medium sent to the bank, if the method needs one. */
83
+ readonly selectedTanMedium: string | undefined;
84
+ /**
85
+ * Switches to another TAN method, and optionally TAN medium, for the following calls.
86
+ *
87
+ * Ends the current dialog, so the next call logs in again with the new method. If the bank does not offer
88
+ * `securityFunction`, the client picks another method at that login.
89
+ */
90
+ selectTanMethod(securityFunction: string, tanMedium?: string): Promise<void>;
91
+ /** General information about the bank, from the bank parameter data. */
92
+ getBankInfo(): Promise<BankInfo>;
93
+ /** TAN procedures the bank allows for this user. */
94
+ getTanMethods(): Promise<TanMethod[]>;
95
+ /** TAN devices registered for this user. */
96
+ getTanMedia(): Promise<TanMedium[]>;
97
+ /** Accounts of the user, completed with IBAN and BIC where the bank provides them. */
98
+ getAccounts(): Promise<Account[]>;
99
+ /**
100
+ * The balance of `account`.
101
+ *
102
+ * Where the user parameter data carry the complete balance (account extension), possibly from the saved `state`, it
103
+ * comes from there without a query; `Balance.bookedAsOf` tells the day it states.
104
+ *
105
+ * Throws `FinTsUnsupportedError`, without asking the bank, where the parameter data rule the query out.
106
+ */
107
+ getBalance(account: Account): Promise<Balance>;
108
+ /**
109
+ * Transactions from the day of `from` to the day of `to`, both included, booked and pending, sorted by date; those of
110
+ * the same day in the bank's order.
111
+ *
112
+ * Only the local calendar day counts, and a day in the future counts as today. Banks typically ask for a TAN when
113
+ * `from` is more than 90 days ago; see also `Account.dataStatus`. Throws `TypeError` if `from` lies on a day after
114
+ * `to`, and `FinTsUnsupportedError`, without asking the bank, where the parameter data rule the query out.
115
+ */
116
+ getTransactions(account: Account, query?: TransactionQuery): Promise<Transaction[]>;
117
+ /**
118
+ * Ends the bank dialog and releases the connection.
119
+ *
120
+ * A running call stops at its next step, also while it waits for a TAN, an app approval or a selection, and fails with
121
+ * `FinTsStateError`, as do all later calls. A request already on its way is awaited, at most for the transport's
122
+ * timeout.
123
+ */
124
+ close(): Promise<void>;
125
+ }
126
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7F,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,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Q,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,8GAA8G;IAC9G,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/C,wEAAwE;IACxE,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/C;;;;;OAKG;IACH,eAAe,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7E,wEAAwE;IACxE,WAAW,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEjC,oDAAoD;IACpD,aAAa,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAEtC,4CAA4C;IAC5C,WAAW,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;IAEpC,sFAAsF;IACtF,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/C;;;;;;;OAOG;IACH,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAEpF;;;;;;OAMG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/core/client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,68 @@
1
+ /** Numeric country code of Germany (ISO 3166), where FinTS banks are. */
2
+ export declare const defaultCountryCode = "280";
3
+ /** What `FinTsConfig` takes. */
4
+ export interface FinTsConfigInit {
5
+ /** The bank's FinTS PIN/TAN endpoint; must be https. */
6
+ url: string | URL;
7
+ /** German bank code (BLZ). */
8
+ bankCode: string;
9
+ /** Login name (Benutzerkennung / Legitimations-ID). */
10
+ userId: string;
11
+ /** Customer ID; defaults to `userId`. */
12
+ customerId?: string | undefined;
13
+ /** FinTS product registration number from the Deutsche Kreditwirtschaft; at most 25 characters. */
14
+ productId: string;
15
+ /** Version of the app as registered with the product; at most five characters. `1.0` by default. */
16
+ productVersion?: string;
17
+ /** Numeric country code of the bank, `280` (Germany) by default. */
18
+ countryCode?: string;
19
+ /**
20
+ * Allows plain http for the loopback addresses `localhost`, `127.x.x.x` and `::1`, for tests against a local server.
21
+ *
22
+ * Any other host must use https, whatever this says: the PIN travels with every message.
23
+ */
24
+ allowInsecureUrl?: boolean;
25
+ }
26
+ /** Connection and login data for one bank user. */
27
+ export declare class FinTsConfig {
28
+ /** Numeric country code of Germany (ISO 3166), where FinTS banks are. */
29
+ static readonly defaultCountryCode = "280";
30
+ readonly url: URL;
31
+ readonly bankCode: string;
32
+ readonly userId: string;
33
+ private readonly explicitCustomerId;
34
+ readonly productId: string;
35
+ readonly productVersion: string;
36
+ readonly countryCode: string;
37
+ readonly allowInsecureUrl: boolean;
38
+ /**
39
+ * Throws `TypeError` if `url` is not a valid URL, has no host or is not https, unless `allowInsecureUrl` is set and
40
+ * `url` is a loopback address, and if a login detail or the product is empty: the bank would refuse the login.
41
+ */
42
+ constructor(init: FinTsConfigInit);
43
+ /** Customer ID; defaults to `userId`. */
44
+ get customerId(): string;
45
+ }
46
+ /** The host of `url` without the brackets of an IPv6 address, as `URL` writes it. */
47
+ export declare function hostOf(url: URL): string;
48
+ /**
49
+ * Throws `TypeError` unless `url` names a host and uses https: the PIN travels with every message.
50
+ *
51
+ * With `allowInsecure`, http is accepted for loopback hosts only.
52
+ */
53
+ export declare function requireSecureUrl(url: URL, allowInsecure?: boolean): void;
54
+ /**
55
+ * Throws `TypeError` for an empty PIN, which the bank would count as a failed attempt, and for one with leading or
56
+ * trailing blanks: FinTS values carry none (Formals B.4.1), so such a PIN could only go out changed.
57
+ *
58
+ * The message leaves out the value.
59
+ */
60
+ export declare function requirePin(pin: string): string;
61
+ /**
62
+ * Throws `TypeError` if `pin` is shorter than `min` or longer than `max` characters, the bank's limits: the bank would
63
+ * count such a PIN as a failed attempt. A limit that is `undefined` or below 1 does not apply.
64
+ *
65
+ * The message leaves out the PIN and its length.
66
+ */
67
+ export declare function requirePinLength(pin: string, min: number | undefined, max: number | undefined): void;
68
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,gCAAgC;AAChC,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,mGAAmG;IACnG,SAAS,EAAE,MAAM,CAAC;IAClB,oGAAoG;IACpG,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,mDAAmD;AACnD,qBAAa,WAAW;IACtB,yEAAyE;IACzE,MAAM,CAAC,QAAQ,CAAC,kBAAkB,SAAsB;IAExD,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC;IAClB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAqB;IACxD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAA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