@coderoftime/fints 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/CHANGELOG.md +519 -1
  2. package/README.md +138 -40
  3. package/dist/client.d.ts +49 -0
  4. package/dist/client.d.ts.map +1 -0
  5. package/dist/client.js +242 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/core/account.d.ts +46 -7
  8. package/dist/core/account.d.ts.map +1 -1
  9. package/dist/core/account.js +143 -24
  10. package/dist/core/account.js.map +1 -1
  11. package/dist/core/amount.d.ts +15 -4
  12. package/dist/core/amount.d.ts.map +1 -1
  13. package/dist/core/amount.js +46 -9
  14. package/dist/core/amount.js.map +1 -1
  15. package/dist/core/balance.d.ts +4 -0
  16. package/dist/core/balance.d.ts.map +1 -1
  17. package/dist/core/balance.js +11 -5
  18. package/dist/core/balance.js.map +1 -1
  19. package/dist/core/bank-info.d.ts +21 -4
  20. package/dist/core/bank-info.d.ts.map +1 -1
  21. package/dist/core/bank-info.js +26 -5
  22. package/dist/core/bank-info.js.map +1 -1
  23. package/dist/core/client.d.ts +81 -19
  24. package/dist/core/client.d.ts.map +1 -1
  25. package/dist/core/config.d.ts +40 -20
  26. package/dist/core/config.d.ts.map +1 -1
  27. package/dist/core/config.js +85 -30
  28. package/dist/core/config.js.map +1 -1
  29. package/dist/core/errors.d.ts +100 -26
  30. package/dist/core/errors.d.ts.map +1 -1
  31. package/dist/core/errors.js +136 -53
  32. package/dist/core/errors.js.map +1 -1
  33. package/dist/core/feedback.d.ts +11 -1
  34. package/dist/core/feedback.d.ts.map +1 -1
  35. package/dist/core/feedback.js +14 -2
  36. package/dist/core/feedback.js.map +1 -1
  37. package/dist/core/transaction.d.ts +11 -1
  38. package/dist/core/transaction.d.ts.map +1 -1
  39. package/dist/core/transaction.js +21 -4
  40. package/dist/core/transaction.js.map +1 -1
  41. package/dist/core/transport.d.ts +48 -6
  42. package/dist/core/transport.d.ts.map +1 -1
  43. package/dist/core/transport.js +126 -29
  44. package/dist/core/transport.js.map +1 -1
  45. package/dist/formats/camt.d.ts +28 -5
  46. package/dist/formats/camt.d.ts.map +1 -1
  47. package/dist/formats/camt.js +132 -50
  48. package/dist/formats/camt.js.map +1 -1
  49. package/dist/formats/mt940.d.ts +29 -5
  50. package/dist/formats/mt940.d.ts.map +1 -1
  51. package/dist/formats/mt940.js +209 -113
  52. package/dist/formats/mt940.js.map +1 -1
  53. package/dist/formats/readers.d.ts +6 -2
  54. package/dist/formats/readers.d.ts.map +1 -1
  55. package/dist/formats/readers.js +28 -29
  56. package/dist/formats/readers.js.map +1 -1
  57. package/dist/formats/record-budget.d.ts +7 -0
  58. package/dist/formats/record-budget.d.ts.map +1 -0
  59. package/dist/formats/record-budget.js +17 -0
  60. package/dist/formats/record-budget.js.map +1 -0
  61. package/dist/formats/sepa-purpose.d.ts +9 -0
  62. package/dist/formats/sepa-purpose.d.ts.map +1 -1
  63. package/dist/formats/sepa-purpose.js +32 -2
  64. package/dist/formats/sepa-purpose.js.map +1 -1
  65. package/dist/index.d.ts +3 -3
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +2 -2
  68. package/dist/index.js.map +1 -1
  69. package/dist/session/app-approval.d.ts +11 -5
  70. package/dist/session/app-approval.d.ts.map +1 -1
  71. package/dist/session/app-approval.js +23 -12
  72. package/dist/session/app-approval.js.map +1 -1
  73. package/dist/session/dialog-runner.d.ts +11 -11
  74. package/dist/session/dialog-runner.d.ts.map +1 -1
  75. package/dist/session/dialog-runner.js +34 -19
  76. package/dist/session/dialog-runner.js.map +1 -1
  77. package/dist/session/login-guard.d.ts +54 -49
  78. package/dist/session/login-guard.d.ts.map +1 -1
  79. package/dist/session/login-guard.js +170 -83
  80. package/dist/session/login-guard.js.map +1 -1
  81. package/dist/session/sepa-accounts.d.ts +20 -14
  82. package/dist/session/sepa-accounts.d.ts.map +1 -1
  83. package/dist/session/sepa-accounts.js +62 -46
  84. package/dist/session/sepa-accounts.js.map +1 -1
  85. package/dist/session/session-setup.d.ts +41 -24
  86. package/dist/session/session-setup.d.ts.map +1 -1
  87. package/dist/session/session-setup.js +106 -63
  88. package/dist/session/session-setup.js.map +1 -1
  89. package/dist/session/session-state.d.ts +10 -6
  90. package/dist/session/session-state.d.ts.map +1 -1
  91. package/dist/session/session-state.js +72 -18
  92. package/dist/session/session-state.js.map +1 -1
  93. package/dist/session/signed-dialog.d.ts +83 -0
  94. package/dist/session/signed-dialog.d.ts.map +1 -0
  95. package/dist/session/signed-dialog.js +185 -0
  96. package/dist/session/signed-dialog.js.map +1 -0
  97. package/dist/session/tan-selection.d.ts +26 -18
  98. package/dist/session/tan-selection.d.ts.map +1 -1
  99. package/dist/session/tan-selection.js +44 -33
  100. package/dist/session/tan-selection.js.map +1 -1
  101. package/dist/session/user-prompts.d.ts +14 -5
  102. package/dist/session/user-prompts.d.ts.map +1 -1
  103. package/dist/session/user-prompts.js +53 -18
  104. package/dist/session/user-prompts.js.map +1 -1
  105. package/dist/tan/challenge.d.ts +47 -24
  106. package/dist/tan/challenge.d.ts.map +1 -1
  107. package/dist/tan/challenge.js +56 -51
  108. package/dist/tan/challenge.js.map +1 -1
  109. package/dist/tan/flicker.d.ts +11 -1
  110. package/dist/tan/flicker.d.ts.map +1 -1
  111. package/dist/tan/flicker.js +70 -24
  112. package/dist/tan/flicker.js.map +1 -1
  113. package/dist/tan/tan-image.d.ts +6 -2
  114. package/dist/tan/tan-image.d.ts.map +1 -1
  115. package/dist/tan/tan-image.js +14 -6
  116. package/dist/tan/tan-image.js.map +1 -1
  117. package/dist/tan/tan-models.d.ts +14 -2
  118. package/dist/tan/tan-models.d.ts.map +1 -1
  119. package/dist/tan/tan-models.js +24 -7
  120. package/dist/tan/tan-models.js.map +1 -1
  121. package/dist/util/arguments.d.ts +13 -0
  122. package/dist/util/arguments.d.ts.map +1 -0
  123. package/dist/util/arguments.js +40 -0
  124. package/dist/util/arguments.js.map +1 -0
  125. package/dist/util/async.d.ts +4 -3
  126. package/dist/util/async.d.ts.map +1 -1
  127. package/dist/util/async.js +6 -7
  128. package/dist/util/async.js.map +1 -1
  129. package/dist/util/bytes.d.ts +3 -4
  130. package/dist/util/bytes.d.ts.map +1 -1
  131. package/dist/util/bytes.js +13 -21
  132. package/dist/util/bytes.js.map +1 -1
  133. package/dist/util/call-context.d.ts.map +1 -1
  134. package/dist/util/call-context.js +3 -2
  135. package/dist/util/call-context.js.map +1 -1
  136. package/dist/util/dates.d.ts +6 -20
  137. package/dist/util/dates.d.ts.map +1 -1
  138. package/dist/util/dates.js +58 -28
  139. package/dist/util/dates.js.map +1 -1
  140. package/dist/util/errors.d.ts +13 -3
  141. package/dist/util/errors.d.ts.map +1 -1
  142. package/dist/util/errors.js +19 -6
  143. package/dist/util/errors.js.map +1 -1
  144. package/dist/util/immutable-map.d.ts +5 -2
  145. package/dist/util/immutable-map.d.ts.map +1 -1
  146. package/dist/util/immutable-map.js +15 -12
  147. package/dist/util/immutable-map.js.map +1 -1
  148. package/dist/util/inspect.d.ts +11 -0
  149. package/dist/util/inspect.d.ts.map +1 -0
  150. package/dist/util/inspect.js +14 -0
  151. package/dist/util/inspect.js.map +1 -0
  152. package/dist/util/json.d.ts +4 -0
  153. package/dist/util/json.d.ts.map +1 -1
  154. package/dist/util/json.js +18 -0
  155. package/dist/util/json.js.map +1 -1
  156. package/dist/util/text.d.ts +38 -5
  157. package/dist/util/text.d.ts.map +1 -1
  158. package/dist/util/text.js +90 -16
  159. package/dist/util/text.js.map +1 -1
  160. package/dist/util/xml.d.ts +9 -6
  161. package/dist/util/xml.d.ts.map +1 -1
  162. package/dist/util/xml.js +129 -56
  163. package/dist/util/xml.js.map +1 -1
  164. package/dist/v3/account-extension.d.ts.map +1 -1
  165. package/dist/v3/account-extension.js +7 -10
  166. package/dist/v3/account-extension.js.map +1 -1
  167. package/dist/v3/bank-connection.d.ts +54 -0
  168. package/dist/v3/bank-connection.d.ts.map +1 -0
  169. package/dist/v3/bank-connection.js +118 -0
  170. package/dist/v3/bank-connection.js.map +1 -0
  171. package/dist/v3/dialog.d.ts +84 -46
  172. package/dist/v3/dialog.d.ts.map +1 -1
  173. package/dist/v3/dialog.js +174 -60
  174. package/dist/v3/dialog.js.map +1 -1
  175. package/dist/v3/message.d.ts +32 -11
  176. package/dist/v3/message.d.ts.map +1 -1
  177. package/dist/v3/message.js +144 -83
  178. package/dist/v3/message.js.map +1 -1
  179. package/dist/v3/parameter-store.d.ts +111 -0
  180. package/dist/v3/parameter-store.d.ts.map +1 -0
  181. package/dist/v3/parameter-store.js +197 -0
  182. package/dist/v3/parameter-store.js.map +1 -0
  183. package/dist/v3/parameters.d.ts +44 -17
  184. package/dist/v3/parameters.d.ts.map +1 -1
  185. package/dist/v3/parameters.js +136 -60
  186. package/dist/v3/parameters.js.map +1 -1
  187. package/dist/v3/protocol.d.ts +50 -50
  188. package/dist/v3/protocol.d.ts.map +1 -1
  189. package/dist/v3/protocol.js +91 -210
  190. package/dist/v3/protocol.js.map +1 -1
  191. package/dist/v3/queries.d.ts +51 -0
  192. package/dist/v3/queries.d.ts.map +1 -0
  193. package/dist/v3/queries.js +128 -0
  194. package/dist/v3/queries.js.map +1 -0
  195. package/dist/v3/segments.d.ts +43 -19
  196. package/dist/v3/segments.d.ts.map +1 -1
  197. package/dist/v3/segments.js +84 -33
  198. package/dist/v3/segments.js.map +1 -1
  199. package/dist/v3/syntax.d.ts +68 -13
  200. package/dist/v3/syntax.d.ts.map +1 -1
  201. package/dist/v3/syntax.js +183 -102
  202. package/dist/v3/syntax.js.map +1 -1
  203. package/package.json +10 -6
  204. package/src/client.ts +293 -0
  205. package/src/core/account.ts +153 -24
  206. package/src/core/amount.ts +45 -10
  207. package/src/core/balance.ts +12 -5
  208. package/src/core/bank-info.ts +29 -5
  209. package/src/core/client.ts +83 -19
  210. package/src/core/config.ts +95 -35
  211. package/src/core/errors.ts +148 -54
  212. package/src/core/feedback.ts +16 -2
  213. package/src/core/transaction.ts +22 -4
  214. package/src/core/transport.ts +153 -32
  215. package/src/formats/camt.ts +153 -45
  216. package/src/formats/mt940.ts +244 -122
  217. package/src/formats/readers.ts +28 -31
  218. package/src/formats/record-budget.ts +18 -0
  219. package/src/formats/sepa-purpose.ts +29 -2
  220. package/src/index.ts +4 -2
  221. package/src/session/app-approval.ts +51 -38
  222. package/src/session/dialog-runner.ts +61 -31
  223. package/src/session/login-guard.ts +189 -87
  224. package/src/session/sepa-accounts.ts +63 -45
  225. package/src/session/session-setup.ts +105 -68
  226. package/src/session/session-state.ts +74 -23
  227. package/src/session/signed-dialog.ts +222 -0
  228. package/src/session/tan-selection.ts +50 -39
  229. package/src/session/user-prompts.ts +62 -18
  230. package/src/tan/challenge.ts +87 -64
  231. package/src/tan/flicker.ts +72 -23
  232. package/src/tan/tan-image.ts +15 -6
  233. package/src/tan/tan-models.ts +26 -7
  234. package/src/util/arguments.ts +40 -0
  235. package/src/util/async.ts +10 -9
  236. package/src/util/bytes.ts +14 -20
  237. package/src/util/call-context.ts +3 -2
  238. package/src/util/dates.ts +64 -33
  239. package/src/util/errors.ts +22 -6
  240. package/src/util/immutable-map.ts +15 -12
  241. package/src/util/inspect.ts +14 -0
  242. package/src/util/json.ts +16 -0
  243. package/src/util/text.ts +87 -15
  244. package/src/util/xml.ts +130 -52
  245. package/src/v3/account-extension.ts +7 -12
  246. package/src/v3/bank-connection.ts +126 -0
  247. package/src/v3/dialog.ts +186 -92
  248. package/src/v3/message.ts +140 -79
  249. package/src/v3/parameter-store.ts +226 -0
  250. package/src/v3/parameters.ts +166 -66
  251. package/src/v3/protocol.ts +103 -253
  252. package/src/v3/queries.ts +198 -0
  253. package/src/v3/segments.ts +86 -31
  254. package/src/v3/syntax.ts +172 -93
  255. package/dist/session/bank-connection.d.ts +0 -28
  256. package/dist/session/bank-connection.d.ts.map +0 -1
  257. package/dist/session/bank-connection.js +0 -48
  258. package/dist/session/bank-connection.js.map +0 -1
  259. package/dist/session/parameter-data.d.ts +0 -83
  260. package/dist/session/parameter-data.d.ts.map +0 -1
  261. package/dist/session/parameter-data.js +0 -68
  262. package/dist/session/parameter-data.js.map +0 -1
  263. package/dist/session/pin-tan-client.d.ts +0 -54
  264. package/dist/session/pin-tan-client.d.ts.map +0 -1
  265. package/dist/session/pin-tan-client.js +0 -153
  266. package/dist/session/pin-tan-client.js.map +0 -1
  267. package/dist/session/pin-tan-dialog.d.ts +0 -71
  268. package/dist/session/pin-tan-dialog.d.ts.map +0 -1
  269. package/dist/session/pin-tan-dialog.js +0 -124
  270. package/dist/session/pin-tan-dialog.js.map +0 -1
  271. package/dist/session/protocol.d.ts +0 -209
  272. package/dist/session/protocol.d.ts.map +0 -1
  273. package/dist/session/protocol.js +0 -75
  274. package/dist/session/protocol.js.map +0 -1
  275. package/dist/session/response-handler.d.ts +0 -48
  276. package/dist/session/response-handler.d.ts.map +0 -1
  277. package/dist/session/response-handler.js +0 -121
  278. package/dist/session/response-handler.js.map +0 -1
  279. package/dist/v3/client.d.ts +0 -24
  280. package/dist/v3/client.d.ts.map +0 -1
  281. package/dist/v3/client.js +0 -16
  282. package/dist/v3/client.js.map +0 -1
  283. package/src/session/bank-connection.ts +0 -51
  284. package/src/session/parameter-data.ts +0 -137
  285. package/src/session/pin-tan-client.ts +0 -186
  286. package/src/session/pin-tan-dialog.ts +0 -160
  287. package/src/session/protocol.ts +0 -311
  288. package/src/session/response-handler.ts +0 -130
  289. package/src/v3/client.ts +0 -29
@@ -1,5 +1,6 @@
1
1
  import { Amount } from '../core/amount.js';
2
2
  import { Transaction, type TransactionStatus } from '../core/transaction.js';
3
+ import { RecordBudget } from './record-budget.js';
3
4
  /** One statement from an MT940 or MT942 file, with its balances and transactions. */
4
5
  export interface Mt940Statement {
5
6
  /** The sender's reference of the statement (field 20). */
@@ -12,13 +13,22 @@ export interface Mt940Statement {
12
13
  readonly currency: string | undefined;
13
14
  /** The balance at the start of the statement (field 60), negative for a debit. */
14
15
  readonly openingBalance: Amount | undefined;
15
- /** The date of `openingBalance`. */
16
+ /**
17
+ * The date of `openingBalance`; `undefined` where the bank states none, as `0` or `000000` for the first statement of
18
+ * an account.
19
+ */
16
20
  readonly openingDate: Date | undefined;
17
21
  /** The balance at the end of the statement (field 62), negative for a debit. */
18
22
  readonly closingBalance: Amount | undefined;
19
- /** The date of `closingBalance`. */
23
+ /**
24
+ * The date of `closingBalance`; `undefined` where the bank states none, as `0` or `000000` for the first statement of
25
+ * an account.
26
+ */
20
27
  readonly closingDate: Date | undefined;
21
- /** The transactions of the statement, in the order the bank lists them. */
28
+ /**
29
+ * The transactions of the statement, in the order the bank lists them; they lead from `openingBalance` to
30
+ * `closingBalance` where the statement states these.
31
+ */
22
32
  readonly transactions: readonly Transaction[];
23
33
  }
24
34
  /** What the MT940 parser takes besides the text. */
@@ -28,15 +38,29 @@ export interface Mt940Options {
28
38
  /** The currency of statements that state none in their balances. */
29
39
  currency?: string | undefined;
30
40
  }
41
+ /** Longest field the parser reads, from its tag to the next one: SWIFT fields have a few hundred characters. */
42
+ export declare const maxFieldLength = 65536;
31
43
  /** Parser for SWIFT MT940/MT942 statements, including German structured `:86:` fields. */
32
44
  export declare const Mt940: Readonly<{
33
45
  /** Parses all transactions; see `parse`. */
34
46
  parseTransactions(text: string, options?: Mt940Options): Transaction[];
35
47
  /**
36
- * Parses all statements.
48
+ * Parses all statements. Their lines are separated by line breaks, and by `@@` as well where the first line holds it,
49
+ * as some banks separate them.
50
+ *
51
+ * Throws `FormatError` for text without any field, if a transaction line (`:61:`), a balance or the creation date of
52
+ * an MT942 (`:13D:`) cannot be read or the currency of a transaction is unknown, and for a closing balance dated
53
+ * before the opening one. It does as well for a statement that states only one of its opening and closing balances,
54
+ * one of them, its account, its number or its creation date twice, or transactions that do not lead from the one
55
+ * balance to the other: a line of a purpose that starts like a field, such as `:61:` or `:25:`, would pass for a
56
+ * transaction, the account or a statement of its own otherwise. Text of more than 200,000 statements and
57
+ * transactions, or with a field of more than 65,536 characters, is a `FormatError` as well.
37
58
  *
38
- * Throws `FormatError` if a transaction line (`:61:`) cannot be read or the currency of a transaction is unknown.
59
+ * Throws `TypeError` for a `status` other than `booked` and `pending`, `null` included, and for a `currency` that is
60
+ * no string; `null` counts as no currency.
39
61
  */
40
62
  parse(text: string, options?: Mt940Options): Mt940Statement[];
41
63
  }>;
64
+ /** `Mt940.parse`, which takes each statement and transaction from `budget`, before it builds it. */
65
+ export declare function parseMt940(text: string, options: Mt940Options, budget: RecordBudget): Mt940Statement[];
42
66
  //# sourceMappingURL=mt940.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mt940.d.ts","sourceRoot":"","sources":["../../src/formats/mt940.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAM7E,qFAAqF;AACrF,MAAM,WAAW,cAAc;IAC7B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,mDAAmD;IACnD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,iDAAiD;IACjD,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,gGAAgG;IAChG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,kFAAkF;IAClF,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;IACvC,gFAAgF;IAChF,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,oCAAoC;IACpC,QAAQ,CAAC,WAAW,EAAE,IAAI,GAAG,SAAS,CAAC;IACvC,2EAA2E;IAC3E,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE,CAAC;CAC/C;AAED,o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AAS,WAAW,EAAE,CAAC;CAC/C;AAED,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,0FAA0F;IAC1F,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAID,gHAAgH;AAChH,eAAO,MAAM,cAAc,QAAS,CAAC;AAErC,0FAA0F;AAC1F,eAAO,MAAM,KAAK;IAChB,4CAA4C;4BACpB,MAAM,YAAW,YAAY,GAAQ,WAAW,EAAE;IAI1E;;;;;;;;;;;;;;OAcG;gBACS,MAAM,YAAW,YAAY,GAAQ,cAAc,EAAE;EAKjE,CAAC;AAEH,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,GAAG,cAAc,EAAE,CAkBtG"}
@@ -1,50 +1,111 @@
1
- import { Amount } from '../core/amount.js';
2
- import { Transaction } from '../core/transaction.js';
1
+ import { addsUpTo, Amount } from '../core/amount.js';
2
+ import { requireStatus, Transaction } from '../core/transaction.js';
3
+ import { optionalString } from '../util/arguments.js';
3
4
  import { clampedDate, parseSwiftDate } from '../util/dates.js';
4
- import { FormatError } from '../util/errors.js';
5
- import { escapeRegExp } from '../util/text.js';
5
+ import { fail, FormatError } from '../util/errors.js';
6
+ import { frozenWithInspect } from '../util/inspect.js';
7
+ import { counted, maskedId, nonBlank, trimBlanks } from '../util/text.js';
8
+ import { RecordBudget } from './record-budget.js';
6
9
  import { providedReference, SepaPurpose } from './sepa-purpose.js';
7
10
  const tagPattern = /^:(\d{2}[A-Z]?):/gm;
8
- const statementEnd = /\n-\s*$/;
9
- const trailingNewlines = /\n+$/;
11
+ /** Longest field the parser reads, from its tag to the next one: SWIFT fields have a few hundred characters. */
12
+ export const maxFieldLength = 65_536;
10
13
  /** Parser for SWIFT MT940/MT942 statements, including German structured `:86:` fields. */
11
14
  export const Mt940 = Object.freeze({
12
15
  /** Parses all transactions; see `parse`. */
13
16
  parseTransactions(text, options = {}) {
14
- return Mt940.parse(text, options).flatMap((s) => [...s.transactions]);
17
+ return Mt940.parse(text, options).flatMap((s) => s.transactions);
15
18
  },
16
19
  /**
17
- * Parses all statements.
20
+ * Parses all statements. Their lines are separated by line breaks, and by `@@` as well where the first line holds it,
21
+ * as some banks separate them.
18
22
  *
19
- * Throws `FormatError` if a transaction line (`:61:`) cannot be read or the currency of a transaction is unknown.
23
+ * Throws `FormatError` for text without any field, if a transaction line (`:61:`), a balance or the creation date of
24
+ * an MT942 (`:13D:`) cannot be read or the currency of a transaction is unknown, and for a closing balance dated
25
+ * before the opening one. It does as well for a statement that states only one of its opening and closing balances,
26
+ * one of them, its account, its number or its creation date twice, or transactions that do not lead from the one
27
+ * balance to the other: a line of a purpose that starts like a field, such as `:61:` or `:25:`, would pass for a
28
+ * transaction, the account or a statement of its own otherwise. Text of more than 200,000 statements and
29
+ * transactions, or with a field of more than 65,536 characters, is a `FormatError` as well.
30
+ *
31
+ * Throws `TypeError` for a `status` other than `booked` and `pending`, `null` included, and for a `currency` that is
32
+ * no string; `null` counts as no currency.
20
33
  */
21
34
  parse(text, options = {}) {
22
- const status = options.status ?? 'booked';
23
- const lines = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
24
- // Some banks separate lines with `@@` instead of line breaks; where there are line breaks, `@@` is text.
25
- const normalized = lines.includes('\n') ? lines : lines.replace(/@@/g, '\n');
26
- const tags = [...normalized.matchAll(tagPattern)];
27
- const statements = [];
28
- let current;
29
- tags.forEach((tag, i) => {
30
- const end = i + 1 < tags.length ? tags[i + 1].index : normalized.length;
31
- const value = normalized
32
- .substring(tag.index + tag[0].length, end)
33
- .replace(statementEnd, '')
34
- .replace(trailingNewlines, '');
35
- if (tag[1] === '20' || current === undefined) {
36
- if (current !== undefined)
37
- statements.push(current.build());
38
- current = new StatementBuilder(status, options.currency);
39
- }
40
- current.add(tag[1], value);
41
- });
42
- if (current !== undefined)
43
- statements.push(current.build());
44
- return statements;
35
+ const status = options.status === undefined ? undefined : requireStatus(options.status);
36
+ const currency = optionalString(options.currency, 'currency');
37
+ return parseMt940(text, { status, currency }, new RecordBudget());
45
38
  },
46
39
  });
47
- const balancePattern = /^([CD])(\d{6})([A-Z]{3})(\d+,\d*)/;
40
+ /** `Mt940.parse`, which takes each statement and transaction from `budget`, before it builds it. */
41
+ export function parseMt940(text, options, budget) {
42
+ const status = options.status ?? 'booked';
43
+ const normalized = withLineFeeds(text);
44
+ const statements = [];
45
+ let current;
46
+ for (const [tag, value] of taggedParts(normalized, tagPattern)) {
47
+ if (value.length > maxFieldLength)
48
+ throw new FormatError(`MT940 field :${tag}: too long`);
49
+ if (tag === '20' || current === undefined) {
50
+ if (current !== undefined)
51
+ statements.push(current.build());
52
+ budget.take();
53
+ current = new StatementBuilder(status, options.currency);
54
+ }
55
+ if (tag === '61')
56
+ budget.take();
57
+ current.add(tag, fieldValue(value));
58
+ }
59
+ if (current !== undefined)
60
+ statements.push(current.build());
61
+ else if (normalized.trim() !== '')
62
+ throw new FormatError('MT940 data without fields');
63
+ return statements;
64
+ }
65
+ /**
66
+ * The parts of `text` that the matches of `tag` start, each the first group of its match and the text up to the next
67
+ * match: the fields of a statement, or the subfields of a `:86:`. One by one: text of a few megabytes holds millions of
68
+ * them. A pattern that matched the text up to the next tag as well would run out of backtracking stack on a part of a
69
+ * few million characters.
70
+ */
71
+ function* taggedParts(text, tag) {
72
+ let current;
73
+ let start = 0;
74
+ for (const match of text.matchAll(tag)) {
75
+ if (current !== undefined)
76
+ yield [current, text.substring(start, match.index)];
77
+ current = match[1];
78
+ start = match.index + match[0].length;
79
+ }
80
+ if (current !== undefined)
81
+ yield [current, text.substring(start)];
82
+ }
83
+ /**
84
+ * `text` with line feeds between its lines, without the blanks and the byte order mark it may start with, which would
85
+ * hide its first tag. Some banks separate the lines with `@@`, and may still break the line between statements or at
86
+ * the ends. So `@@` separates lines where the first line holds it, which the bank writes; in other text, `@@` may be
87
+ * part of a purpose, which the payer writes.
88
+ */
89
+ function withLineFeeds(text) {
90
+ const lines = trimBlanks(text.replace(/\r\n?/g, '\n'), { end: false });
91
+ return lines.split('\n', 1)[0].includes('@@') ? lines.replace(/@@/g, '\n') : lines;
92
+ }
93
+ /**
94
+ * The value of a field in `text`, which runs from its tag to the next one: without the statement end (`-`) and the line
95
+ * feeds at its end. Other blanks there stay: the subfield of a `:86:` that ends it may precede others in the purpose.
96
+ *
97
+ * Trimmed without a pattern such as `/\n+$/`, which takes quadratic time on a long run of line breaks.
98
+ */
99
+ function fieldValue(text) {
100
+ const trimmed = text.trimEnd();
101
+ let end = trimmed.endsWith('\n-') ? trimmed.length - 2 : text.length;
102
+ while (end > 0 && text.charCodeAt(end - 1) === 0x0a)
103
+ end--;
104
+ return text.substring(0, end);
105
+ }
106
+ /** The date is `0` or `000000` for the first statement of an account. */
107
+ const balancePattern = /^([CD])(\d{6}|0)([A-Z]{3})(\d+,\d*)/;
108
+ const dateTimePattern = /^(\d{6})\d{4}/;
48
109
  const currencyPrefix = /^([A-Z]{3})/;
49
110
  class StatementBuilder {
50
111
  status;
@@ -57,6 +118,8 @@ class StatementBuilder {
57
118
  openingDate;
58
119
  closing;
59
120
  closingDate;
121
+ /** The day an MT942 was created (field 13D). */
122
+ creationDate;
60
123
  transactions = [];
61
124
  /**
62
125
  * The tag added last: a `:86:` right after a `:61:` details the transaction, anywhere else it informs the account
@@ -72,35 +135,53 @@ class StatementBuilder {
72
135
  add(tag, value) {
73
136
  switch (tag) {
74
137
  case '20':
75
- this.reference = value.trim();
138
+ this.reference = trimBlanks(value);
76
139
  break;
77
140
  case '25':
78
- this.accountId = value.trim();
141
+ if (this.accountId !== undefined)
142
+ throw new FormatError('MT940 statement with two accounts', this.reference);
143
+ this.accountId = trimBlanks(value);
79
144
  break;
80
145
  case '28C':
81
146
  case '28':
82
- this.statementNumber = value.trim();
147
+ if (this.statementNumber !== undefined) {
148
+ throw new FormatError('MT940 statement with two statement numbers', this.reference);
149
+ }
150
+ this.statementNumber = trimBlanks(value);
151
+ break;
152
+ case '13D':
153
+ case '13': {
154
+ if (this.creationDate !== undefined) {
155
+ throw new FormatError('MT940 statement with two creation dates', this.reference);
156
+ }
157
+ const m = dateTimePattern.exec(trimBlanks(value));
158
+ this.creationDate = (m && parseSwiftDate(m[1])) ?? fail('Invalid MT940 creation date', value);
83
159
  break;
160
+ }
84
161
  case '60F':
85
162
  case '60M': {
86
- const balance = parseBalance(value);
87
- if (balance) {
88
- [this.opening, this.openingDate] = balance;
89
- this.currency ??= balance[0].currency;
163
+ if (this.opening !== undefined) {
164
+ throw new FormatError('MT940 statement with two opening balances', this.reference);
90
165
  }
166
+ const [balance, date] = parseBalance(value);
167
+ this.opening = balance;
168
+ this.openingDate = date;
169
+ this.currency ??= balance.currency;
91
170
  break;
92
171
  }
93
172
  case '62F':
94
173
  case '62M': {
95
- const balance = parseBalance(value);
96
- if (balance) {
97
- [this.closing, this.closingDate] = balance;
98
- this.currency ??= balance[0].currency;
174
+ if (this.closing !== undefined) {
175
+ throw new FormatError('MT940 statement with two closing balances', this.reference);
99
176
  }
177
+ const [balance, date] = parseBalance(value);
178
+ this.closing = balance;
179
+ this.closingDate = date;
180
+ this.currency ??= balance.currency;
100
181
  break;
101
182
  }
102
183
  case '34F':
103
- this.currency ??= currencyPrefix.exec(value.trim())?.[1];
184
+ this.currency ??= currencyPrefix.exec(trimBlanks(value))?.[1];
104
185
  break;
105
186
  case '61':
106
187
  this.transactions.push(new TransactionLines(value));
@@ -117,7 +198,14 @@ class StatementBuilder {
117
198
  if (statementCurrency === undefined && this.transactions.length > 0) {
118
199
  throw new FormatError('MT940 statement without currency', this.reference);
119
200
  }
120
- return Object.freeze({
201
+ const { openingDate, closingDate } = this;
202
+ if (openingDate && closingDate && closingDate.getTime() < openingDate.getTime()) {
203
+ throw new FormatError('MT940 closing balance dated before the opening balance', this.reference);
204
+ }
205
+ const period = openingDate && closingDate ? [openingDate, closingDate] : undefined;
206
+ const transactions = this.transactions.map((t) => t.toTransaction(statementCurrency, this.status, period, this.creationDate));
207
+ this.checkBalances(transactions);
208
+ return frozenWithInspect({
121
209
  reference: this.reference,
122
210
  accountId: this.accountId,
123
211
  statementNumber: this.statementNumber,
@@ -126,18 +214,31 @@ class StatementBuilder {
126
214
  openingDate: this.openingDate,
127
215
  closingBalance: this.closing,
128
216
  closingDate: this.closingDate,
129
- transactions: Object.freeze(this.transactions.map((t) => t.toTransaction(statementCurrency, this.status))),
130
- });
217
+ transactions: Object.freeze(transactions),
218
+ }, (s) => `Mt940Statement(${maskedId(s.accountId ?? '')}, ${counted(s.transactions.length, 'transaction')})`);
219
+ }
220
+ /** Checks that the statement states both balances or neither, and that its `transactions` lead from one to the other. */
221
+ checkBalances(transactions) {
222
+ const { opening, closing } = this;
223
+ if (opening === undefined && closing === undefined)
224
+ return;
225
+ if (opening === undefined || closing === undefined) {
226
+ throw new FormatError('MT940 statement with only one of its balances', this.reference);
227
+ }
228
+ if (opening.currency !== this.currency || closing.currency !== this.currency) {
229
+ throw new FormatError('MT940 balances in another currency than the statement', this.reference);
230
+ }
231
+ if (!addsUpTo([opening, ...transactions.map((t) => t.amount)], closing)) {
232
+ throw new FormatError('MT940 transactions do not add up to the closing balance', this.reference);
233
+ }
131
234
  }
132
235
  }
133
236
  function parseBalance(value) {
134
- const m = balancePattern.exec(value.trim());
237
+ const m = balancePattern.exec(trimBlanks(value));
135
238
  if (!m)
136
- return undefined;
239
+ throw new FormatError('Unreadable MT940 balance', value);
137
240
  const amount = Amount.parseDecimal(m[4], m[3]);
138
- const date = parseSwiftDate(m[2]);
139
- if (date === undefined)
140
- throw new FormatError('Invalid balance date', value);
241
+ const date = Number(m[2]) === 0 ? undefined : (parseSwiftDate(m[2]) ?? fail('Invalid balance date', value));
141
242
  return [m[1] === 'D' ? amount.negate() : amount, date];
142
243
  }
143
244
  /**
@@ -145,6 +246,9 @@ function parseBalance(value) {
145
246
  * reference, optional bank reference and supplementary details.
146
247
  */
147
248
  const line61 = /^(\d{6})(\d{4})?(RC|RD|C|D)([A-Z])?(\d+,\d*)([NFS][A-Z0-9]{3})([^\n]*?)(?:\/\/([^\n]*))?(?:\n([\s\S]*))?$/;
249
+ function spanning(a, b) {
250
+ return a.getTime() <= b.getTime() ? [a, b] : [b, a];
251
+ }
148
252
  /** The `:61:` line of a transaction and its `:86:` details. */
149
253
  class TransactionLines {
150
254
  line;
@@ -152,28 +256,27 @@ class TransactionLines {
152
256
  constructor(line) {
153
257
  this.line = line;
154
258
  }
155
- toTransaction(currency, status) {
156
- const m = line61.exec(this.line.trim());
259
+ toTransaction(currency, status, period, created) {
260
+ const m = line61.exec(trimBlanks(this.line));
157
261
  const valueDate = m ? parseSwiftDate(m[1]) : undefined;
158
262
  if (!m || valueDate === undefined)
159
263
  throw new FormatError('Unreadable MT940 transaction line (:61:)', this.line);
160
264
  const mark = m[3];
161
265
  const amount = Amount.parseDecimal(m[5], currency);
162
266
  const debit = mark === 'D' || mark === 'RC';
163
- const customerReference = m[7]?.trim();
164
- const bankReference = m[8]?.trim();
165
267
  const d = Details.parse(this.details);
268
+ const reference = nonBlank(m[7]);
269
+ // `KREF+` stands for the customer reference that :86: states.
270
+ const customerReference = reference === 'KREF+' ? d.sepa.get('KREF') : reference;
166
271
  return new Transaction({
167
272
  status,
168
- bookingDate: this.bookingDate(m[2], valueDate),
273
+ bookingDate: this.bookingDate(m[2], valueDate, period ?? spanning(valueDate, created ?? valueDate)),
169
274
  valueDate,
170
275
  amount: debit ? amount.negate() : amount,
171
276
  isReversal: mark.startsWith('R'),
172
277
  transactionTypeId: m[6],
173
- customerReference: customerReference === undefined || customerReference === '' || customerReference === 'NONREF'
174
- ? undefined
175
- : customerReference,
176
- bankReference: bankReference === undefined || bankReference === '' ? undefined : bankReference,
278
+ customerReference: customerReference === 'NONREF' ? undefined : customerReference,
279
+ bankReference: nonBlank(m[8]),
177
280
  transactionCode: d.transactionCode,
178
281
  bookingText: d.bookingText,
179
282
  primaNota: d.primaNota,
@@ -191,35 +294,40 @@ class TransactionLines {
191
294
  purposeCodes: d.sepa,
192
295
  });
193
296
  }
194
- /** The booking date `MMDD`, in the year that places it closest to `valueDate` (across a year end). */
195
- bookingDate(mmdd, valueDate) {
297
+ /**
298
+ * The booking date `MMDD`, in the year that places it within `period`, or else closest to it; of several such years,
299
+ * the one closest to `valueDate`. The value date alone misleads: banks book refunds and corrections with the value
300
+ * date of the original booking, up to 13 months before.
301
+ */
302
+ bookingDate(mmdd, valueDate, [first, last]) {
196
303
  if (mmdd === undefined)
197
304
  return undefined;
198
305
  const month = Number(mmdd.substring(0, 2));
199
306
  const day = Number(mmdd.substring(2, 4));
200
- let year = valueDate.getFullYear();
201
- if (month === 12 && valueDate.getMonth() === 0)
202
- year--;
203
- if (month === 1 && valueDate.getMonth() === 11)
204
- year++;
205
- const date = clampedDate(year, month, day);
206
- if (date === undefined)
207
- throw new FormatError('Invalid booking date', this.line);
208
- return date;
307
+ const outside = (date) => Math.max(first.getTime() - date.getTime(), date.getTime() - last.getTime(), 0);
308
+ const fromValueDate = (date) => Math.abs(date.getTime() - valueDate.getTime());
309
+ // The best year lies next to one of these, however long the period.
310
+ const years = new Set([first, valueDate, last].flatMap((d) => [d.getFullYear() - 1, d.getFullYear(), d.getFullYear() + 1]));
311
+ let best;
312
+ for (const year of years) {
313
+ const date = clampedDate(year, month, day);
314
+ if (date === undefined)
315
+ throw new FormatError('Invalid booking date', this.line);
316
+ if (best === undefined || (outside(date) - outside(best) || fromValueDate(date) - fromValueDate(best)) < 0) {
317
+ best = date;
318
+ }
319
+ }
320
+ return best;
209
321
  }
210
322
  }
211
323
  /**
212
- * Three-digit business transaction code (GVC), then the first subfield: a separator, usually `?`, and its two-digit
213
- * number. Text that merely starts with three digits, such as `100 Euro`, is free text.
324
+ * Three-digit business transaction code (GVC), then the first subfield: `?` and its two-digit number. Text that merely
325
+ * starts with three digits, such as `100 Euro` or `100,00 EUR`, is free text.
214
326
  */
215
- const structuredPattern = /^(\d{3})([^\w\s])\d{2}/;
327
+ const structuredPattern = /^\d{3}\?\d{2}/;
328
+ const subfieldTag = /\?(\d{2})/g;
216
329
  const ibanPattern = /^[A-Z]{2}\d{2}[A-Z0-9]+$/;
217
330
  const bicPattern = /^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/;
218
- /** Subfield pattern for a separator: the separator, a two-digit key, then everything up to the next subfield. */
219
- function subfieldPattern(separator) {
220
- const s = escapeRegExp(separator);
221
- return new RegExp(`${s}(\\d{2})((?:(?!${s}\\d{2})[\\s\\S])*)`, 'g');
222
- }
223
331
  /** The German structured `:86:` field: a business transaction code and `?nn` subfields. */
224
332
  class Details {
225
333
  transactionCode;
@@ -237,61 +345,49 @@ class Details {
237
345
  if (raw === undefined)
238
346
  return d;
239
347
  const text = raw.replace(/\n/g, '');
240
- const structured = structuredPattern.exec(text);
241
- if (!structured) {
348
+ if (!structuredPattern.test(text)) {
242
349
  // Free text, whose lines are separate phrases; the purpose and its keywords are read from the same text.
243
- const free = raw.replace(/\n/g, ' ').trim();
350
+ const free = trimBlanks(raw.replace(/\n/g, ' '));
244
351
  d.sepa = SepaPurpose.parse(free);
245
- d.purpose = d.sepa.get('SVWZ') ?? (free === '' ? undefined : free);
352
+ d.purpose = d.sepa.get('SVWZ') ?? nonBlank(free);
246
353
  return d;
247
354
  }
248
- d.transactionCode = structured[1];
249
- const subfields = Details.subfields(text.substring(3), structured[2]);
250
- const subfield = (key) => {
251
- const value = subfields.get(key)?.trim();
252
- return value === undefined || value === '' ? undefined : value;
253
- };
355
+ d.transactionCode = text.substring(0, 3);
356
+ const subfields = Details.subfields(text.substring(3));
357
+ const subfield = (key) => nonBlank(subfields.get(key));
254
358
  // Subfields continue each other: they are joined keeping the spaces at their boundaries.
255
359
  const parts = (keys) => keys.map((k) => subfields.get(k)).filter((v) => v !== undefined);
256
360
  d.bookingText = subfield(0);
257
361
  d.primaNota = subfield(10);
258
362
  const purposeParts = parts([20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 60, 61, 62, 63]);
259
- const purpose = purposeParts.join('').trim();
260
363
  d.sepa = SepaPurpose.parseParts(purposeParts);
261
- d.purpose = d.sepa.get('SVWZ') ?? (purpose === '' ? undefined : purpose);
262
- const name = parts([32, 33]).join('').trim();
263
- d.name = name === '' ? undefined : name;
364
+ d.purpose = d.sepa.get('SVWZ') ?? nonBlank(purposeParts.join(''));
365
+ d.name = nonBlank(parts([32, 33]).join(''));
264
366
  d.readCounterpartyAccount(subfield(30), subfield(31));
265
- d.iban ??= d.sepa.get('IBAN');
266
- d.bic ??= d.sepa.get('BIC');
267
367
  return d;
268
368
  }
269
369
  /** The text of each subfield (`?nn` and what follows), by its number; a subfield that appears twice is joined. */
270
- static subfields(text, separator) {
370
+ static subfields(text) {
271
371
  const subfields = new Map();
272
- for (const m of text.matchAll(subfieldPattern(separator))) {
273
- const key = Number(m[1]);
274
- subfields.set(key, (subfields.get(key) ?? '') + m[2]);
372
+ for (const [tag, value] of taggedParts(text, subfieldTag)) {
373
+ const key = Number(tag);
374
+ subfields.set(key, (subfields.get(key) ?? '') + value);
275
375
  }
276
376
  return subfields;
277
377
  }
278
378
  /**
279
- * Takes the counterparty's account from subfields 30 (bank) and 31 (account): IBAN and BIC, or account number and
280
- * bank code.
379
+ * Takes the counterparty's account from subfields 30 (bank) and 31 (account): a BIC, or else a bank code, and an IBAN,
380
+ * or else an account number.
281
381
  */
282
382
  readCounterpartyAccount(bank, account) {
283
- if (account !== undefined && ibanPattern.test(account)) {
284
- this.iban = account;
285
- this.bic = bank;
286
- return;
287
- }
288
- this.accountNumber = account;
289
- if (bank !== undefined && bicPattern.test(bank)) {
383
+ if (bank !== undefined && bicPattern.test(bank))
290
384
  this.bic = bank;
291
- }
292
- else {
385
+ else
293
386
  this.bankCode = bank;
294
- }
387
+ if (account !== undefined && ibanPattern.test(account))
388
+ this.iban = account;
389
+ else
390
+ this.accountNumber = account;
295
391
  }
296
392
  }
297
393
  //# source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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5C,CAAC,CAAC,uBAAuB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,kHAAkH;IAC1G,MAAM,CAAC,SAAS,CAAC,IAAY;QACnC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;YAC1D,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;OAGG;IACK,uBAAuB,CAAC,IAAwB,EAAE,OAA2B;QACnF,IAAI,IAAI,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC;;YAC5D,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC1B,IAAI,OAAO,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC;YAAE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;;YACvE,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC;IACpC,CAAC;CACF"}
@@ -3,9 +3,13 @@ import type { Transaction } from '../core/transaction.js';
3
3
  * The transactions in MT940 data: the `booked` parts joined, since a statement may continue on the next page, then the
4
4
  * `pending` ones (MT942).
5
5
  *
6
- * `currency` applies to statements that do not state one; throws `FormatError` if both are missing.
6
+ * `currency` applies to statements that do not state one; throws `FormatError` if both are missing, and for more than
7
+ * 200,000 statements and transactions in all.
7
8
  */
8
9
  export declare function mt940Transactions(booked: readonly Uint8Array[], pending: readonly Uint8Array[], currency: string | undefined): Transaction[];
9
- /** The transactions in camt documents; each document stands on its own. */
10
+ /**
11
+ * The transactions in camt documents; each document stands on its own. Throws `FormatError` for more than 200,000
12
+ * statements and transactions in all.
13
+ */
10
14
  export declare function camtTransactions(booked: readonly Uint8Array[], pending: readonly Uint8Array[]): Transaction[];
11
15
  //# sourceMappingURL=readers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"readers.d.ts","sourceRoot":"","sources":["../../src/formats/readers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,WAAW,EAAE,CAKf;AA4BD,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,EAAE,CAK7G"}
1
+ {"version":3,"file":"readers.d.ts","sourceRoot":"","sources":["../../src/formats/readers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAM1D;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,OAAO,EAAE,SAAS,UAAU,EAAE,EAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,GAC3B,WAAW,EAAE,CAMf;AAmBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,UAAU,EAAE,GAAG,WAAW,EAAE,CAM7G"}