lib-fints 1.0.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 (306) hide show
  1. package/LICENSE +504 -0
  2. package/README.md +216 -0
  3. package/dist/accountBalance.js +1 -0
  4. package/dist/bankAccount.js +34 -0
  5. package/dist/bankAnswer.js +1 -0
  6. package/dist/bankTransaction.js +1 -0
  7. package/dist/bankingInformation.js +1 -0
  8. package/dist/bpd.js +1 -0
  9. package/dist/client.js +165 -0
  10. package/dist/codes.js +79 -0
  11. package/dist/config.js +181 -0
  12. package/dist/dataElements/AlphaNumeric.js +24 -0
  13. package/dist/dataElements/Amount.js +6 -0
  14. package/dist/dataElements/Binary.js +20 -0
  15. package/dist/dataElements/Country.js +6 -0
  16. package/dist/dataElements/Currency.js +6 -0
  17. package/dist/dataElements/Dat.js +18 -0
  18. package/dist/dataElements/DataElement.js +37 -0
  19. package/dist/dataElements/Digits.js +23 -0
  20. package/dist/dataElements/Float.js +21 -0
  21. package/dist/dataElements/Identification.js +6 -0
  22. package/dist/dataElements/Numeric.js +26 -0
  23. package/dist/dataElements/Text.js +21 -0
  24. package/dist/dataElements/Time.js +18 -0
  25. package/dist/dataElements/YesNo.js +18 -0
  26. package/dist/dataGroups/Account.js +12 -0
  27. package/dist/dataGroups/Balance.js +15 -0
  28. package/dist/dataGroups/BankIdentification.js +8 -0
  29. package/dist/dataGroups/DataGroup.js +54 -0
  30. package/dist/dataGroups/InternationalAccount.js +15 -0
  31. package/dist/dataGroups/Money.js +8 -0
  32. package/dist/dataGroups/RefMessage.js +8 -0
  33. package/dist/dataGroups/TimeStamp.js +8 -0
  34. package/dist/decoder.js +97 -0
  35. package/dist/dialog.js +189 -0
  36. package/dist/encoder.js +47 -0
  37. package/dist/format.js +6 -0
  38. package/dist/httpClient.js +41 -0
  39. package/dist/httpClientNode.js +59 -0
  40. package/dist/index.js +15 -0
  41. package/dist/interactions/balanceInteraction.js +47 -0
  42. package/dist/interactions/customerInteraction.js +55 -0
  43. package/dist/interactions/initDialogInteraction.js +155 -0
  44. package/dist/interactions/statementInteraction.js +44 -0
  45. package/dist/interactions/tanMediaInteraction.js +27 -0
  46. package/dist/message.js +198 -0
  47. package/dist/mt940parser.js +307 -0
  48. package/dist/parser.js +30 -0
  49. package/dist/partedSegment.js +8 -0
  50. package/dist/segment.js +59 -0
  51. package/dist/segmentDefinition.js +11 -0
  52. package/dist/segmentHeader.js +13 -0
  53. package/dist/segments/HIBPA.js +23 -0
  54. package/dist/segments/HIKAZ.js +13 -0
  55. package/dist/segments/HIKAZS.js +13 -0
  56. package/dist/segments/HIKIM.js +11 -0
  57. package/dist/segments/HIKOM.js +23 -0
  58. package/dist/segments/HIPINS.js +22 -0
  59. package/dist/segments/HIRMG.js +20 -0
  60. package/dist/segments/HIRMS.js +20 -0
  61. package/dist/segments/HISAL.js +31 -0
  62. package/dist/segments/HISYN.js +16 -0
  63. package/dist/segments/HITAB.js +37 -0
  64. package/dist/segments/HITAN.js +23 -0
  65. package/dist/segments/HITANS.js +48 -0
  66. package/dist/segments/HIUPA.js +18 -0
  67. package/dist/segments/HIUPD.js +34 -0
  68. package/dist/segments/HKEND.js +11 -0
  69. package/dist/segments/HKIDN.js +18 -0
  70. package/dist/segments/HKKAZ.js +24 -0
  71. package/dist/segments/HKSAL.js +21 -0
  72. package/dist/segments/HKSYN.js +11 -0
  73. package/dist/segments/HKTAB.js +12 -0
  74. package/dist/segments/HKTAN.js +35 -0
  75. package/dist/segments/HKVVB.js +18 -0
  76. package/dist/segments/HNHBK.js +20 -0
  77. package/dist/segments/HNHBS.js +11 -0
  78. package/dist/segments/HNSHA.js +17 -0
  79. package/dist/segments/HNSHK.js +43 -0
  80. package/dist/segments/HNVSD.js +11 -0
  81. package/dist/segments/HNVSK.js +45 -0
  82. package/dist/segments/businessTransactionParameter.js +20 -0
  83. package/dist/segments/registry.js +71 -0
  84. package/dist/tanMethod.js +1 -0
  85. package/dist/tests/HIBPA.test.js +26 -0
  86. package/dist/tests/HIPINS.test.js +14 -0
  87. package/dist/tests/HIRMG.test.js +24 -0
  88. package/dist/tests/HITAB.test.js +19 -0
  89. package/dist/tests/HITANS.test.js +19 -0
  90. package/dist/tests/HIUPA.test.js +11 -0
  91. package/dist/tests/HIUPD.test.js +11 -0
  92. package/dist/tests/HKIDN.test.js +22 -0
  93. package/dist/tests/HKSAL.test.js +45 -0
  94. package/dist/tests/HKTAN.test.js +21 -0
  95. package/dist/tests/HNSHK.test.js +11 -0
  96. package/dist/tests/HNVSK.test.js +11 -0
  97. package/dist/tests/client.test.js +33 -0
  98. package/dist/tests/datatypes.test.js +8 -0
  99. package/dist/tests/message.test.js +80 -0
  100. package/dist/tests/mt940parser.test.js +56 -0
  101. package/dist/tests/parser.test.js +20 -0
  102. package/dist/types/accountBalance.d.ts +9 -0
  103. package/dist/types/accountBalance.d.ts.map +1 -0
  104. package/dist/types/bankAccount.d.ts +27 -0
  105. package/dist/types/bankAccount.d.ts.map +1 -0
  106. package/dist/types/bankAnswer.d.ts +6 -0
  107. package/dist/types/bankAnswer.d.ts.map +1 -0
  108. package/dist/types/bankTransaction.d.ts +6 -0
  109. package/dist/types/bankTransaction.d.ts.map +1 -0
  110. package/dist/types/bankingInformation.d.ts +20 -0
  111. package/dist/types/bankingInformation.d.ts.map +1 -0
  112. package/dist/types/bpd.d.ts +17 -0
  113. package/dist/types/bpd.d.ts.map +1 -0
  114. package/dist/types/client.d.ts +86 -0
  115. package/dist/types/client.d.ts.map +1 -0
  116. package/dist/types/codes.d.ts +68 -0
  117. package/dist/types/codes.d.ts.map +1 -0
  118. package/dist/types/config.d.ts +99 -0
  119. package/dist/types/config.d.ts.map +1 -0
  120. package/dist/types/dataElements/AlphaNumeric.d.ts +8 -0
  121. package/dist/types/dataElements/AlphaNumeric.d.ts.map +1 -0
  122. package/dist/types/dataElements/Amount.d.ts +5 -0
  123. package/dist/types/dataElements/Amount.d.ts.map +1 -0
  124. package/dist/types/dataElements/Binary.d.ts +8 -0
  125. package/dist/types/dataElements/Binary.d.ts.map +1 -0
  126. package/dist/types/dataElements/Country.d.ts +5 -0
  127. package/dist/types/dataElements/Country.d.ts.map +1 -0
  128. package/dist/types/dataElements/Currency.d.ts +5 -0
  129. package/dist/types/dataElements/Currency.d.ts.map +1 -0
  130. package/dist/types/dataElements/Dat.d.ts +8 -0
  131. package/dist/types/dataElements/Dat.d.ts.map +1 -0
  132. package/dist/types/dataElements/DataElement.d.ts +14 -0
  133. package/dist/types/dataElements/DataElement.d.ts.map +1 -0
  134. package/dist/types/dataElements/Digits.d.ts +8 -0
  135. package/dist/types/dataElements/Digits.d.ts.map +1 -0
  136. package/dist/types/dataElements/Float.d.ts +8 -0
  137. package/dist/types/dataElements/Float.d.ts.map +1 -0
  138. package/dist/types/dataElements/Identification.d.ts +5 -0
  139. package/dist/types/dataElements/Identification.d.ts.map +1 -0
  140. package/dist/types/dataElements/Numeric.d.ts +9 -0
  141. package/dist/types/dataElements/Numeric.d.ts.map +1 -0
  142. package/dist/types/dataElements/Text.d.ts +8 -0
  143. package/dist/types/dataElements/Text.d.ts.map +1 -0
  144. package/dist/types/dataElements/Time.d.ts +8 -0
  145. package/dist/types/dataElements/Time.d.ts.map +1 -0
  146. package/dist/types/dataElements/YesNo.d.ts +7 -0
  147. package/dist/types/dataElements/YesNo.d.ts.map +1 -0
  148. package/dist/types/dataGroups/Account.d.ts +14 -0
  149. package/dist/types/dataGroups/Account.d.ts.map +1 -0
  150. package/dist/types/dataGroups/Balance.d.ts +12 -0
  151. package/dist/types/dataGroups/Balance.d.ts.map +1 -0
  152. package/dist/types/dataGroups/BankIdentification.d.ts +5 -0
  153. package/dist/types/dataGroups/BankIdentification.d.ts.map +1 -0
  154. package/dist/types/dataGroups/DataGroup.d.ts +10 -0
  155. package/dist/types/dataGroups/DataGroup.d.ts.map +1 -0
  156. package/dist/types/dataGroups/InternationalAccount.d.ts +13 -0
  157. package/dist/types/dataGroups/InternationalAccount.d.ts.map +1 -0
  158. package/dist/types/dataGroups/Money.d.ts +9 -0
  159. package/dist/types/dataGroups/Money.d.ts.map +1 -0
  160. package/dist/types/dataGroups/RefMessage.d.ts +9 -0
  161. package/dist/types/dataGroups/RefMessage.d.ts.map +1 -0
  162. package/dist/types/dataGroups/TimeStamp.d.ts +9 -0
  163. package/dist/types/dataGroups/TimeStamp.d.ts.map +1 -0
  164. package/dist/types/decoder.d.ts +4 -0
  165. package/dist/types/decoder.d.ts.map +1 -0
  166. package/dist/types/dialog.d.ts +21 -0
  167. package/dist/types/dialog.d.ts.map +1 -0
  168. package/dist/types/encoder.d.ts +3 -0
  169. package/dist/types/encoder.d.ts.map +1 -0
  170. package/dist/types/format.d.ts +3 -0
  171. package/dist/types/format.d.ts.map +1 -0
  172. package/dist/types/httpClient.d.ts +8 -0
  173. package/dist/types/httpClient.d.ts.map +1 -0
  174. package/dist/types/httpClientNode.d.ts +8 -0
  175. package/dist/types/httpClientNode.d.ts.map +1 -0
  176. package/dist/types/index.d.ts +17 -0
  177. package/dist/types/index.d.ts.map +1 -0
  178. package/dist/types/interactions/balanceInteraction.d.ts +15 -0
  179. package/dist/types/interactions/balanceInteraction.d.ts.map +1 -0
  180. package/dist/types/interactions/customerInteraction.d.ts +41 -0
  181. package/dist/types/interactions/customerInteraction.d.ts.map +1 -0
  182. package/dist/types/interactions/initDialogInteraction.d.ts +16 -0
  183. package/dist/types/interactions/initDialogInteraction.d.ts.map +1 -0
  184. package/dist/types/interactions/statementInteraction.d.ts +17 -0
  185. package/dist/types/interactions/statementInteraction.d.ts.map +1 -0
  186. package/dist/types/interactions/tanMediaInteraction.d.ts +13 -0
  187. package/dist/types/interactions/tanMediaInteraction.d.ts.map +1 -0
  188. package/dist/types/message.d.ts +30 -0
  189. package/dist/types/message.d.ts.map +1 -0
  190. package/dist/types/mt940parser.d.ts +83 -0
  191. package/dist/types/mt940parser.d.ts.map +1 -0
  192. package/dist/types/parser.d.ts +2 -0
  193. package/dist/types/parser.d.ts.map +1 -0
  194. package/dist/types/partedSegment.d.ts +14 -0
  195. package/dist/types/partedSegment.d.ts.map +1 -0
  196. package/dist/types/segment.d.ts +11 -0
  197. package/dist/types/segment.d.ts.map +1 -0
  198. package/dist/types/segmentDefinition.d.ts +11 -0
  199. package/dist/types/segmentDefinition.d.ts.map +1 -0
  200. package/dist/types/segmentHeader.d.ts +11 -0
  201. package/dist/types/segmentHeader.d.ts.map +1 -0
  202. package/dist/types/segments/HIBPA.d.ts +27 -0
  203. package/dist/types/segments/HIBPA.d.ts.map +1 -0
  204. package/dist/types/segments/HIKAZ.d.ts +16 -0
  205. package/dist/types/segments/HIKAZ.d.ts.map +1 -0
  206. package/dist/types/segments/HIKAZS.d.ts +16 -0
  207. package/dist/types/segments/HIKAZS.d.ts.map +1 -0
  208. package/dist/types/segments/HIKIM.d.ts +17 -0
  209. package/dist/types/segments/HIKIM.d.ts.map +1 -0
  210. package/dist/types/segments/HIKOM.d.ts +27 -0
  211. package/dist/types/segments/HIKOM.d.ts.map +1 -0
  212. package/dist/types/segments/HIPINS.d.ts +23 -0
  213. package/dist/types/segments/HIPINS.d.ts.map +1 -0
  214. package/dist/types/segments/HIRMG.d.ts +22 -0
  215. package/dist/types/segments/HIRMG.d.ts.map +1 -0
  216. package/dist/types/segments/HIRMS.d.ts +17 -0
  217. package/dist/types/segments/HIRMS.d.ts.map +1 -0
  218. package/dist/types/segments/HISAL.d.ts +32 -0
  219. package/dist/types/segments/HISAL.d.ts.map +1 -0
  220. package/dist/types/segments/HISYN.d.ts +19 -0
  221. package/dist/types/segments/HISYN.d.ts.map +1 -0
  222. package/dist/types/segments/HITAB.d.ts +39 -0
  223. package/dist/types/segments/HITAB.d.ts.map +1 -0
  224. package/dist/types/segments/HITAN.d.ts +25 -0
  225. package/dist/types/segments/HITAN.d.ts.map +1 -0
  226. package/dist/types/segments/HITANS.d.ts +41 -0
  227. package/dist/types/segments/HITANS.d.ts.map +1 -0
  228. package/dist/types/segments/HIUPA.d.ts +21 -0
  229. package/dist/types/segments/HIUPA.d.ts.map +1 -0
  230. package/dist/types/segments/HIUPD.d.ts +42 -0
  231. package/dist/types/segments/HIUPD.d.ts.map +1 -0
  232. package/dist/types/segments/HKEND.d.ts +16 -0
  233. package/dist/types/segments/HKEND.d.ts.map +1 -0
  234. package/dist/types/segments/HKIDN.d.ts +22 -0
  235. package/dist/types/segments/HKIDN.d.ts.map +1 -0
  236. package/dist/types/segments/HKKAZ.d.ts +25 -0
  237. package/dist/types/segments/HKKAZ.d.ts.map +1 -0
  238. package/dist/types/segments/HKSAL.d.ts +22 -0
  239. package/dist/types/segments/HKSAL.d.ts.map +1 -0
  240. package/dist/types/segments/HKSYN.d.ts +17 -0
  241. package/dist/types/segments/HKSYN.d.ts.map +1 -0
  242. package/dist/types/segments/HKTAB.d.ts +19 -0
  243. package/dist/types/segments/HKTAB.d.ts.map +1 -0
  244. package/dist/types/segments/HKTAN.d.ts +39 -0
  245. package/dist/types/segments/HKTAN.d.ts.map +1 -0
  246. package/dist/types/segments/HKVVB.d.ts +22 -0
  247. package/dist/types/segments/HKVVB.d.ts.map +1 -0
  248. package/dist/types/segments/HNHBK.d.ts +23 -0
  249. package/dist/types/segments/HNHBK.d.ts.map +1 -0
  250. package/dist/types/segments/HNHBS.d.ts +16 -0
  251. package/dist/types/segments/HNHBS.d.ts.map +1 -0
  252. package/dist/types/segments/HNSHA.d.ts +24 -0
  253. package/dist/types/segments/HNSHA.d.ts.map +1 -0
  254. package/dist/types/segments/HNSHK.d.ts +66 -0
  255. package/dist/types/segments/HNSHK.d.ts.map +1 -0
  256. package/dist/types/segments/HNVSD.d.ts +20 -0
  257. package/dist/types/segments/HNVSD.d.ts.map +1 -0
  258. package/dist/types/segments/HNVSK.d.ts +40 -0
  259. package/dist/types/segments/HNVSK.d.ts.map +1 -0
  260. package/dist/types/segments/businessTransactionParameter.d.ts +18 -0
  261. package/dist/types/segments/businessTransactionParameter.d.ts.map +1 -0
  262. package/dist/types/segments/registry.d.ts +4 -0
  263. package/dist/types/segments/registry.d.ts.map +1 -0
  264. package/dist/types/tanMethod.d.ts +10 -0
  265. package/dist/types/tanMethod.d.ts.map +1 -0
  266. package/dist/types/tests/HIBPA.test.d.ts +2 -0
  267. package/dist/types/tests/HIBPA.test.d.ts.map +1 -0
  268. package/dist/types/tests/HIPINS.test.d.ts +2 -0
  269. package/dist/types/tests/HIPINS.test.d.ts.map +1 -0
  270. package/dist/types/tests/HIRMG.test.d.ts +2 -0
  271. package/dist/types/tests/HIRMG.test.d.ts.map +1 -0
  272. package/dist/types/tests/HITAB.test.d.ts +2 -0
  273. package/dist/types/tests/HITAB.test.d.ts.map +1 -0
  274. package/dist/types/tests/HITANS.test.d.ts +2 -0
  275. package/dist/types/tests/HITANS.test.d.ts.map +1 -0
  276. package/dist/types/tests/HIUPA.test.d.ts +2 -0
  277. package/dist/types/tests/HIUPA.test.d.ts.map +1 -0
  278. package/dist/types/tests/HIUPD.test.d.ts +2 -0
  279. package/dist/types/tests/HIUPD.test.d.ts.map +1 -0
  280. package/dist/types/tests/HKIDN.test.d.ts +2 -0
  281. package/dist/types/tests/HKIDN.test.d.ts.map +1 -0
  282. package/dist/types/tests/HKSAL.test.d.ts +2 -0
  283. package/dist/types/tests/HKSAL.test.d.ts.map +1 -0
  284. package/dist/types/tests/HKTAN.test.d.ts +2 -0
  285. package/dist/types/tests/HKTAN.test.d.ts.map +1 -0
  286. package/dist/types/tests/HNSHK.test.d.ts +2 -0
  287. package/dist/types/tests/HNSHK.test.d.ts.map +1 -0
  288. package/dist/types/tests/HNVSK.test.d.ts +2 -0
  289. package/dist/types/tests/HNVSK.test.d.ts.map +1 -0
  290. package/dist/types/tests/client.test.d.ts +2 -0
  291. package/dist/types/tests/client.test.d.ts.map +1 -0
  292. package/dist/types/tests/datatypes.test.d.ts +2 -0
  293. package/dist/types/tests/datatypes.test.d.ts.map +1 -0
  294. package/dist/types/tests/message.test.d.ts +2 -0
  295. package/dist/types/tests/message.test.d.ts.map +1 -0
  296. package/dist/types/tests/mt940parser.test.d.ts +2 -0
  297. package/dist/types/tests/mt940parser.test.d.ts.map +1 -0
  298. package/dist/types/tests/parser.test.d.ts +2 -0
  299. package/dist/types/tests/parser.test.d.ts.map +1 -0
  300. package/dist/types/unknownSegment.d.ts +14 -0
  301. package/dist/types/unknownSegment.d.ts.map +1 -0
  302. package/dist/types/upd.d.ts +8 -0
  303. package/dist/types/upd.d.ts.map +1 -0
  304. package/dist/unknownSegment.js +8 -0
  305. package/dist/upd.js +1 -0
  306. package/package.json +45 -0
@@ -0,0 +1,37 @@
1
+ import { Dat } from '../dataElements/Dat.js';
2
+ import { Numeric } from '../dataElements/Numeric.js';
3
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
4
+ import { InternationalAccountGroup } from '../dataGroups/InternationalAccount.js';
5
+ import { AccountGroup } from '../dataGroups/Account.js';
6
+ import { Identification } from '../dataElements/Identification.js';
7
+ import { DataGroup } from '../dataGroups/DataGroup.js';
8
+ import { SegmentDefinition } from '../segmentDefinition.js';
9
+ /**
10
+ * TAN media response
11
+ */
12
+ export class HITAB extends SegmentDefinition {
13
+ static Id = this.name;
14
+ version = 5;
15
+ elements = [
16
+ new Numeric('tanUsage', 1, 1, 1),
17
+ new DataGroup('mediaList', [
18
+ new AlphaNumeric('class', 1, 1, 1),
19
+ new Numeric('status', 1, 1, 1),
20
+ new Numeric('secFunc', 0, 1, 3, 5),
21
+ new Identification('cardNumber', 0, 1),
22
+ new Identification('followUpCardNumber', 0, 1),
23
+ new Numeric('cardType', 0, 1, 2),
24
+ new AccountGroup('account', 0, 1),
25
+ new Dat('validFrom', 0, 1),
26
+ new Dat('validTo', 0, 1),
27
+ new AlphaNumeric('tanListNumber', 0, 1, 20),
28
+ new AlphaNumeric('name', 0, 1, 32),
29
+ new AlphaNumeric('mobilePhoneNumberObfuscated', 0, 1, 32),
30
+ new AlphaNumeric('mobilePhoneNumber', 0, 1, 32),
31
+ new InternationalAccountGroup('smsAccount', 0, 1),
32
+ new Numeric('availableTanCount', 0, 1, 3),
33
+ new Dat('lastUseDate', 0, 1),
34
+ new Dat('activationDate', 0, 1),
35
+ ], 0, 99),
36
+ ];
37
+ }
@@ -0,0 +1,23 @@
1
+ import { Time } from '../dataElements/Time.js';
2
+ import { Dat } from '../dataElements/Dat.js';
3
+ import { Binary } from '../dataElements/Binary.js';
4
+ import { Numeric } from '../dataElements/Numeric.js';
5
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
6
+ import { DataGroup } from '../dataGroups/DataGroup.js';
7
+ import { SegmentDefinition } from '../segmentDefinition.js';
8
+ /**
9
+ * TAN response
10
+ */
11
+ export class HITAN extends SegmentDefinition {
12
+ static Id = this.name;
13
+ version = 6;
14
+ elements = [
15
+ new Numeric('tanProcess', 1, 1, 1),
16
+ new Binary('orderHash', 0, 1, 256),
17
+ new AlphaNumeric('orderReference', 0, 1, 35),
18
+ new AlphaNumeric('challenge', 0, 1, 2048),
19
+ new Binary('challengeHhdUc', 0, 1, 128),
20
+ new DataGroup('challengeValidUntil', [new Dat('date', 1, 1), new Time('time', 1, 1)], 0, 1),
21
+ new AlphaNumeric('tanMedia', 0, 1, 32),
22
+ ];
23
+ }
@@ -0,0 +1,48 @@
1
+ import { YesNo } from '../dataElements/YesNo.js';
2
+ import { Numeric } from '../dataElements/Numeric.js';
3
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
4
+ import { Identification } from '../dataElements/Identification.js';
5
+ import { DataGroup } from '../dataGroups/DataGroup.js';
6
+ import { BusinessTransactionParameter } from './businessTransactionParameter.js';
7
+ /**
8
+ * Parameters for two-step TAN methods
9
+ */
10
+ export class HITANS extends BusinessTransactionParameter {
11
+ static Id = this.name;
12
+ version = 6;
13
+ constructor() {
14
+ super([
15
+ new YesNo('oneStepAllowed', 1, 1),
16
+ new YesNo('multipleTansactions', 1, 1),
17
+ new Numeric('hashMethod', 1, 1, 1),
18
+ new Numeric('secProfile', 1, 1, 1, 1, 1),
19
+ new DataGroup('tanMethods', [
20
+ new Numeric('secFunc', 1, 1, 3, 1),
21
+ new Numeric('tanProcess', 1, 1, 1, 1),
22
+ new Identification('methodId', 1, 1, 1),
23
+ new AlphaNumeric('zkaMethod', 0, 1, 32, 4),
24
+ new AlphaNumeric('zkaVersion', 0, 1, 10, 4),
25
+ new AlphaNumeric('methodName', 1, 1, 30, 1),
26
+ new Numeric('tanMaxLen', 1, 1, 2, 1),
27
+ new Numeric('format', 1, 1, 1, 1),
28
+ new AlphaNumeric('challengeText', 1, 1, 30, 1),
29
+ new Numeric('maxChallengeLen', 1, 1, 4, 1),
30
+ new Numeric('supportedActiveTanLists', 0, 1, 1, 1, 5),
31
+ new YesNo('multipleTans', 1, 1, 1),
32
+ new YesNo('tanDelayedAllowed', 1, 1, 1, 1),
33
+ new Numeric('tanDialogOptions', 1, 1, 1, 2),
34
+ new Numeric('tanListNrRequired', 1, 1, 1, 2, 5),
35
+ new YesNo('cancellation', 1, 1, 2),
36
+ new Numeric('smsAccountRequired', 1, 1, 1, 4),
37
+ new Numeric('customerAccountRequired', 1, 1, 1, 5),
38
+ new YesNo('challengeClass', 1, 1, 2),
39
+ new YesNo('challengeAmountRequired', 1, 1, 2, 4),
40
+ new YesNo('challengeStructured', 1, 1, 4),
41
+ new AlphaNumeric('initMode', 1, 1, 2, 3),
42
+ new Numeric('tanMediaRequired', 1, 1, 1, 3),
43
+ new YesNo('hdducRequired', 1, 1, 6),
44
+ new Numeric('activeTanMedia', 0, 1, 1, 3),
45
+ ], 1, 98),
46
+ ]);
47
+ }
48
+ }
@@ -0,0 +1,18 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
3
+ import { SegmentDefinition } from '../segmentDefinition.js';
4
+ import { Identification } from '../dataElements/Identification.js';
5
+ /**
6
+ * User parameters general
7
+ */
8
+ export class HIUPA extends SegmentDefinition {
9
+ static Id = this.name;
10
+ version = 4;
11
+ elements = [
12
+ new Identification('internalUserId', 1, 1),
13
+ new Numeric('updVersion', 1, 1, 3),
14
+ new Numeric('updUsage', 1, 1, 1),
15
+ new AlphaNumeric('userName', 0, 1, 35),
16
+ new AlphaNumeric('extension', 0, 1, 2048),
17
+ ];
18
+ }
@@ -0,0 +1,34 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
3
+ import { AccountGroup } from '../dataGroups/Account.js';
4
+ import { MoneyGroup } from '../dataGroups/Money.js';
5
+ import { Currency } from '../dataElements/Currency.js';
6
+ import { Identification } from '../dataElements/Identification.js';
7
+ import { DataGroup } from '../dataGroups/DataGroup.js';
8
+ import { SegmentDefinition } from '../segmentDefinition.js';
9
+ /**
10
+ * User parameters account information
11
+ */
12
+ export class HIUPD extends SegmentDefinition {
13
+ static Id = this.name;
14
+ version = 6;
15
+ elements = [
16
+ new AccountGroup('account', 0, 1),
17
+ new AlphaNumeric('iban', 0, 1, 34),
18
+ new Identification('customerId', 1, 1),
19
+ new Numeric('accountType', 0, 1, 2),
20
+ new Currency('currency', 0, 1),
21
+ new AlphaNumeric('accountHolder1', 1, 1, 27),
22
+ new AlphaNumeric('accountHolder2', 0, 1, 27),
23
+ new AlphaNumeric('accountProduct', 0, 1, 30),
24
+ new DataGroup('accountLimit', [new AlphaNumeric('limitType', 1, 1, 1), new MoneyGroup('limitAmount', 0, 1), new Numeric('limitDays', 0, 1, 3)], 0, 1),
25
+ new DataGroup('allowedTransactions', [
26
+ new AlphaNumeric('transId', 1, 1, 6),
27
+ new Numeric('numSignatures', 1, 1, 2),
28
+ new AlphaNumeric('limitType', 0, 1, 1),
29
+ new MoneyGroup('limitAmount', 0, 1),
30
+ new Numeric('limitDays', 0, 1, 3),
31
+ ], 0, 999),
32
+ new AlphaNumeric('accountExtension', 0, 1, 2048),
33
+ ];
34
+ }
@@ -0,0 +1,11 @@
1
+ import { Identification } from '../dataElements/Identification.js';
2
+ import { SegmentDefinition } from '../segmentDefinition.js';
3
+ /**
4
+ * Dialog end
5
+ */
6
+ export class HKEND extends SegmentDefinition {
7
+ static Id = this.name;
8
+ static Version = 1;
9
+ version = HKEND.Version;
10
+ elements = [new Identification('dialogId', 1, 1)];
11
+ }
@@ -0,0 +1,18 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { BankIdentification } from '../dataGroups/BankIdentification.js';
3
+ import { Identification } from '../dataElements/Identification.js';
4
+ import { SegmentDefinition } from '../segmentDefinition.js';
5
+ /**
6
+ * Identification
7
+ */
8
+ export class HKIDN extends SegmentDefinition {
9
+ static Id = this.name;
10
+ static Version = 2;
11
+ version = HKIDN.Version;
12
+ elements = [
13
+ new BankIdentification('bank', 1, 1),
14
+ new Identification('customerId', 1, 1),
15
+ new Identification('systemId', 1, 1),
16
+ new Numeric('systemIdRequired', 1, 1, 1),
17
+ ];
18
+ }
@@ -0,0 +1,24 @@
1
+ import { Dat } from '../dataElements/Dat.js';
2
+ import { YesNo } from '../dataElements/YesNo.js';
3
+ import { Numeric } from '../dataElements/Numeric.js';
4
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
5
+ import { InternationalAccountGroup } from '../dataGroups/InternationalAccount.js';
6
+ import { AccountGroup } from '../dataGroups/Account.js';
7
+ import { SegmentDefinition } from '../segmentDefinition.js';
8
+ /**
9
+ * Request account transactions in a given period
10
+ */
11
+ export class HKKAZ extends SegmentDefinition {
12
+ static Id = this.name;
13
+ static Version = 7;
14
+ version = HKKAZ.Version;
15
+ elements = [
16
+ new AccountGroup('account', 1, 1, 1, 6),
17
+ new InternationalAccountGroup('account', 1, 1, 7),
18
+ new YesNo('allAccounts', 1, 1),
19
+ new Dat('from', 0, 1),
20
+ new Dat('to', 0, 1),
21
+ new Numeric('maxEntries', 0, 1, 4),
22
+ new AlphaNumeric('continuationMark', 0, 1, 35),
23
+ ];
24
+ }
@@ -0,0 +1,21 @@
1
+ import { YesNo } from '../dataElements/YesNo.js';
2
+ import { Numeric } from '../dataElements/Numeric.js';
3
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
4
+ import { InternationalAccountGroup } from '../dataGroups/InternationalAccount.js';
5
+ import { AccountGroup } from '../dataGroups/Account.js';
6
+ import { SegmentDefinition } from '../segmentDefinition.js';
7
+ /**
8
+ * Request Account balances
9
+ */
10
+ export class HKSAL extends SegmentDefinition {
11
+ static Id = this.name;
12
+ static Version = 8;
13
+ version = HKSAL.Version;
14
+ elements = [
15
+ new AccountGroup('account', 1, 1, 1, 6),
16
+ new InternationalAccountGroup('account', 1, 1, 7),
17
+ new YesNo('allAccounts', 1, 1),
18
+ new Numeric('maxEntries', 0, 1, 4),
19
+ new AlphaNumeric('continuationMark', 0, 1, 35),
20
+ ];
21
+ }
@@ -0,0 +1,11 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { SegmentDefinition } from '../segmentDefinition.js';
3
+ /**
4
+ * Synchonisation
5
+ */
6
+ export class HKSYN extends SegmentDefinition {
7
+ static Id = this.name;
8
+ static Version = 3;
9
+ version = HKSYN.Version;
10
+ elements = [new Numeric('mode', 1, 1, 1)];
11
+ }
@@ -0,0 +1,12 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
3
+ import { SegmentDefinition } from '../segmentDefinition.js';
4
+ /**
5
+ * Request TAN media
6
+ */
7
+ export class HKTAB extends SegmentDefinition {
8
+ static Id = this.name;
9
+ static Version = 5;
10
+ version = HKTAB.Version;
11
+ elements = [new Numeric('mediaType', 1, 1, 1), new AlphaNumeric('mediaClass', 1, 1, 1)];
12
+ }
@@ -0,0 +1,35 @@
1
+ import { YesNo } from '../dataElements/YesNo.js';
2
+ import { Binary } from '../dataElements/Binary.js';
3
+ import { Numeric } from '../dataElements/Numeric.js';
4
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
5
+ import { InternationalAccountGroup } from '../dataGroups/InternationalAccount.js';
6
+ import { DataGroup } from '../dataGroups/DataGroup.js';
7
+ import { SegmentDefinition } from '../segmentDefinition.js';
8
+ /**
9
+ * Two-Step TAN
10
+ */
11
+ export class HKTAN extends SegmentDefinition {
12
+ static Id = this.name;
13
+ static Version = 6;
14
+ version = HKTAN.Version;
15
+ elements = [
16
+ new Numeric('tanProcess', 1, 1, 1),
17
+ new AlphaNumeric('segId', 0, 1, 6),
18
+ new InternationalAccountGroup('customerAccount', 0, 1),
19
+ new Binary('orderHash', 0, 1, 256),
20
+ new AlphaNumeric('orderRef', 0, 1, 35),
21
+ new YesNo('nextTan', 0, 1),
22
+ new YesNo('cancelOrder', 0, 1),
23
+ new InternationalAccountGroup('smsAccount', 0, 1),
24
+ new Numeric('challengeClass', 0, 1, 2),
25
+ new DataGroup('challengeClassParam', [new AlphaNumeric('param', 0, 1, 999)], 0, 1),
26
+ new AlphaNumeric('tanMedia', 0, 1, 32),
27
+ new DataGroup('hhducResponse', [
28
+ new AlphaNumeric('atc', 1, 1, 5),
29
+ new Binary('appCryptoAc', 1, 1, 256),
30
+ new Binary('efIdData', 1, 1, 256),
31
+ new Binary('cvr', 1, 1, 256),
32
+ new Binary('chipTanVersion', 1, 1, 256),
33
+ ], 0, 1),
34
+ ];
35
+ }
@@ -0,0 +1,18 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
3
+ import { SegmentDefinition } from '../segmentDefinition.js';
4
+ /**
5
+ * Identification
6
+ */
7
+ export class HKVVB extends SegmentDefinition {
8
+ static Id = this.name;
9
+ static Version = 3;
10
+ version = HKVVB.Version;
11
+ elements = [
12
+ new Numeric('bpdVersion', 1, 1, 3),
13
+ new Numeric('updVersion', 1, 1, 3),
14
+ new Numeric('dialogLanguage', 1, 1),
15
+ new AlphaNumeric('productId', 1, 1, 25),
16
+ new AlphaNumeric('productVersion', 1, 1, 5),
17
+ ];
18
+ }
@@ -0,0 +1,20 @@
1
+ import { Digits } from '../dataElements/Digits.js';
2
+ import { Numeric } from '../dataElements/Numeric.js';
3
+ import { RefMessageGroup } from '../dataGroups/RefMessage.js';
4
+ import { Identification } from '../dataElements/Identification.js';
5
+ import { SegmentDefinition } from '../segmentDefinition.js';
6
+ /**
7
+ * Message header
8
+ */
9
+ export class HNHBK extends SegmentDefinition {
10
+ static Id = this.name;
11
+ static Version = 3;
12
+ version = HNHBK.Version;
13
+ elements = [
14
+ new Digits('messageLength', 1, 1, 12),
15
+ new Numeric('hbciVersion', 1, 1, 3),
16
+ new Identification('dialogId', 1, 1),
17
+ new Numeric('msgNr', 1, 1, 4),
18
+ new RefMessageGroup('refMsg', 0, 1),
19
+ ];
20
+ }
@@ -0,0 +1,11 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { SegmentDefinition } from '../segmentDefinition.js';
3
+ /**
4
+ * Message end
5
+ */
6
+ export class HNHBS extends SegmentDefinition {
7
+ static Id = this.name;
8
+ static Version = 1;
9
+ version = HNHBS.Version;
10
+ elements = [new Numeric('msgNr', 1, 1, 4)];
11
+ }
@@ -0,0 +1,17 @@
1
+ import { Binary } from '../dataElements/Binary.js';
2
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
3
+ import { DataGroup } from '../dataGroups/DataGroup.js';
4
+ import { SegmentDefinition } from '../segmentDefinition.js';
5
+ /**
6
+ * Signature end
7
+ */
8
+ export class HNSHA extends SegmentDefinition {
9
+ static Id = this.name;
10
+ static Version = 2;
11
+ version = HNSHA.Version;
12
+ elements = [
13
+ new AlphaNumeric('secControlRef', 1, 1, 14),
14
+ new Binary('valResult', 0, 1, 512),
15
+ new DataGroup('customSignature', [new AlphaNumeric('pin', 1, 1), new AlphaNumeric('tan', 0, 1)], 0, 1),
16
+ ];
17
+ }
@@ -0,0 +1,43 @@
1
+ import { Time } from '../dataElements/Time.js';
2
+ import { Dat } from '../dataElements/Dat.js';
3
+ import { Binary } from '../dataElements/Binary.js';
4
+ import { Numeric } from '../dataElements/Numeric.js';
5
+ import { Text } from '../dataElements/Text.js';
6
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
7
+ import { BankIdentification } from '../dataGroups/BankIdentification.js';
8
+ import { Identification } from '../dataElements/Identification.js';
9
+ import { DataGroup } from '../dataGroups/DataGroup.js';
10
+ import { SegmentDefinition } from '../segmentDefinition.js';
11
+ /**
12
+ * Signature Header
13
+ */
14
+ export class HNSHK extends SegmentDefinition {
15
+ static Id = this.name;
16
+ static Version = 4;
17
+ version = HNSHK.Version;
18
+ elements = [
19
+ new DataGroup('secProfile', [new AlphaNumeric('secMethod', 1, 1, 3), new Numeric('secVersion', 1, 1, 3)], 1, 1),
20
+ new Numeric('secFunc', 1, 1, 3),
21
+ new AlphaNumeric('secControlRef', 1, 1, 14),
22
+ new Numeric('secArea', 1, 1, 3),
23
+ new Numeric('secRole', 1, 1, 3),
24
+ new DataGroup('secId', [new Numeric('partyType', 1, 1, 3), new Binary('cid', 0, 1, 256), new Identification('partyId', 0, 1)], 1, 1),
25
+ new Numeric('secRefNum', 1, 1, 16),
26
+ new DataGroup('dateTime', [new Numeric('type', 1, 1, 3), new Dat('date', 0, 1), new Time('time', 0, 1)], 1, 1),
27
+ new DataGroup('hash', [
28
+ new Numeric('use', 1, 1, 3),
29
+ new Numeric('algorithm', 1, 1, 3),
30
+ new Numeric('paramName', 1, 1, 3),
31
+ new Binary('paramValue', 0, 1, 512),
32
+ ], 1, 1),
33
+ new DataGroup('signature', [new Numeric('use', 1, 1, 3), new Numeric('algorithm', 1, 1, 3), new Numeric('mode', 1, 1, 3)], 1, 1),
34
+ new DataGroup('key', [
35
+ new BankIdentification('bank', 1, 1),
36
+ new Identification('userId', 1, 1),
37
+ new AlphaNumeric('keyType', 1, 1, 1),
38
+ new Numeric('keyNr', 1, 1, 3),
39
+ new Numeric('keyVersion', 1, 1, 3),
40
+ ], 1, 1),
41
+ new DataGroup('cert', [new Numeric('type', 1, 1, 3), new Text('content', 1, 1, 4096)], 0, 1),
42
+ ];
43
+ }
@@ -0,0 +1,11 @@
1
+ import { Binary } from '../dataElements/Binary.js';
2
+ import { SegmentDefinition } from '../segmentDefinition.js';
3
+ /**
4
+ * Encrypted data
5
+ */
6
+ export class HNVSD extends SegmentDefinition {
7
+ static Id = this.name;
8
+ static Version = 1;
9
+ version = HNVSD.Version;
10
+ elements = [new Binary('encryptedData', 1, 1)];
11
+ }
@@ -0,0 +1,45 @@
1
+ import { Time } from '../dataElements/Time.js';
2
+ import { Dat } from '../dataElements/Dat.js';
3
+ import { Binary } from '../dataElements/Binary.js';
4
+ import { Numeric } from '../dataElements/Numeric.js';
5
+ import { AlphaNumeric } from '../dataElements/AlphaNumeric.js';
6
+ import { BankIdentification } from '../dataGroups/BankIdentification.js';
7
+ import { Identification } from '../dataElements/Identification.js';
8
+ import { DataGroup } from '../dataGroups/DataGroup.js';
9
+ import { SegmentDefinition } from '../segmentDefinition.js';
10
+ /**
11
+ * Encryption body
12
+ */
13
+ export class HNVSK extends SegmentDefinition {
14
+ static Id = this.name;
15
+ static Version = 3;
16
+ version = HNVSK.Version;
17
+ elements = [
18
+ new DataGroup('secProfile', [new AlphaNumeric('secMethod', 1, 1, 3), new Numeric('secVersion', 1, 1, 3)], 1, 1),
19
+ new Numeric('secFunc', 1, 1, 3),
20
+ new Numeric('secRole', 1, 1, 3),
21
+ new DataGroup('secId', [new Numeric('partyType', 1, 1, 3), new Binary('cid', 0, 1, 256), new Identification('partyID', 0, 1)], 1, 1),
22
+ new DataGroup('dateTime', [new Numeric('type', 1, 1, 3), new Dat('date', 0, 1), new Time('time', 0, 1)], 1, 1),
23
+ new DataGroup('encryption', [
24
+ new Numeric('use', 1, 1, 3),
25
+ new Numeric('mode', 1, 1, 3),
26
+ new Numeric('algorithm', 1, 1, 3),
27
+ new Binary('keyParamValue', 1, 1, 512),
28
+ new Numeric('keyParamName', 1, 1, 3),
29
+ new Numeric('initParamName', 1, 1, 3),
30
+ new Binary('initParamValue', 0, 1, 512),
31
+ ], 1, 1),
32
+ new DataGroup('key', [
33
+ new BankIdentification('bank', 1, 1),
34
+ new Identification('userId', 1, 1),
35
+ new AlphaNumeric('keyType', 1, 1, 1),
36
+ new Numeric('keyNr', 1, 1, 3),
37
+ new Numeric('keyVersion', 1, 1, 3),
38
+ ], 1, 1),
39
+ new Numeric('compressMethod', 1, 1, 3),
40
+ new DataGroup('certificate', [new Numeric('type', 1, 1, 3), new Binary('content', 1, 1, 4096)], 0, 1),
41
+ ];
42
+ setSegmentNumber(segmentNumber) {
43
+ return 0;
44
+ }
45
+ }
@@ -0,0 +1,20 @@
1
+ import { Numeric } from '../dataElements/Numeric.js';
2
+ import { DataGroup } from '../dataGroups/DataGroup.js';
3
+ import { SegmentDefinition } from '../segmentDefinition.js';
4
+ /**
5
+ * Base class for business transaction parameter segments
6
+ */
7
+ export class BusinessTransactionParameter extends SegmentDefinition {
8
+ paramElements;
9
+ elements;
10
+ constructor(paramElements, secClassMinVersion = 1) {
11
+ super();
12
+ this.paramElements = paramElements;
13
+ this.elements = [
14
+ new Numeric('maxTrans', 1, 1, 3),
15
+ new Numeric('minSigs', 1, 1, 1),
16
+ new Numeric('secClass', 1, 1, 1, secClassMinVersion),
17
+ new DataGroup('params', paramElements, 1, 1),
18
+ ];
19
+ }
20
+ }
@@ -0,0 +1,71 @@
1
+ import { HNHBK } from './HNHBK.js';
2
+ import { HNHBS } from './HNHBS.js';
3
+ import { HNVSK } from './HNVSK.js';
4
+ import { HNVSD } from './HNVSD.js';
5
+ import { HNSHK } from './HNSHK.js';
6
+ import { HNSHA } from './HNSHA.js';
7
+ import { HKIDN } from './HKIDN.js';
8
+ import { HKVVB } from './HKVVB.js';
9
+ import { HKSYN } from './HKSYN.js';
10
+ import { HKTAN } from './HKTAN.js';
11
+ import { HKTAB } from './HKTAB.js';
12
+ import { HIRMG } from './HIRMG.js';
13
+ import { HIRMS } from './HIRMS.js';
14
+ import { HIBPA } from './HIBPA.js';
15
+ import { HIKOM } from './HIKOM.js';
16
+ import { HIKIM } from './HIKIM.js';
17
+ import { HISYN } from './HISYN.js';
18
+ import { HIPINS } from './HIPINS.js';
19
+ import { HITAN } from './HITAN.js';
20
+ import { HITANS } from './HITANS.js';
21
+ import { HIUPA } from './HIUPA.js';
22
+ import { HIUPD } from './HIUPD.js';
23
+ import { HKEND } from './HKEND.js';
24
+ import { HKSAL } from './HKSAL.js';
25
+ import { HISAL } from './HISAL.js';
26
+ import { HKKAZ } from './HKKAZ.js';
27
+ import { HIKAZ } from './HIKAZ.js';
28
+ import { HIKAZS } from './HIKAZS.js';
29
+ import { HITAB } from './HITAB.js';
30
+ import { UNKNOW } from '../unknownSegment.js';
31
+ import { PARTED } from '../partedSegment.js';
32
+ const registry = new Map();
33
+ export function registerSegments() {
34
+ registerSegmentDefinition(new HNHBK());
35
+ registerSegmentDefinition(new HNHBS());
36
+ registerSegmentDefinition(new HNVSK());
37
+ registerSegmentDefinition(new HNVSD());
38
+ registerSegmentDefinition(new HNSHK());
39
+ registerSegmentDefinition(new HNSHA());
40
+ registerSegmentDefinition(new HKIDN());
41
+ registerSegmentDefinition(new HKVVB());
42
+ registerSegmentDefinition(new HKSYN());
43
+ registerSegmentDefinition(new HKTAN());
44
+ registerSegmentDefinition(new HKTAB());
45
+ registerSegmentDefinition(new HIRMG());
46
+ registerSegmentDefinition(new HIRMS());
47
+ registerSegmentDefinition(new HIBPA());
48
+ registerSegmentDefinition(new HIKOM());
49
+ registerSegmentDefinition(new HIKIM());
50
+ registerSegmentDefinition(new HISYN());
51
+ registerSegmentDefinition(new HITAB());
52
+ registerSegmentDefinition(new HIPINS());
53
+ registerSegmentDefinition(new HITAN());
54
+ registerSegmentDefinition(new HITANS());
55
+ registerSegmentDefinition(new HIUPA());
56
+ registerSegmentDefinition(new HIUPD());
57
+ registerSegmentDefinition(new HKEND());
58
+ registerSegmentDefinition(new HKSAL());
59
+ registerSegmentDefinition(new HISAL());
60
+ registerSegmentDefinition(new HKKAZ());
61
+ registerSegmentDefinition(new HIKAZ());
62
+ registerSegmentDefinition(new HIKAZS());
63
+ registerSegmentDefinition(new UNKNOW());
64
+ registerSegmentDefinition(new PARTED());
65
+ }
66
+ export function getSegmentDefinition(id) {
67
+ return registry.get(id);
68
+ }
69
+ function registerSegmentDefinition(definition) {
70
+ registry.set(definition.id, definition);
71
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,26 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { registerSegments } from '../segments/registry.js';
3
+ import { HIBPA } from '../segments/HIBPA.js';
4
+ import { decode, encode } from '../segment.js';
5
+ registerSegments();
6
+ describe('HIBPA', () => {
7
+ it('has correct id', () => {
8
+ const definition = new HIBPA();
9
+ expect(definition.id).toBe('HIBPA');
10
+ expect(HIBPA.Id).toBe('HIBPA');
11
+ });
12
+ it('decodes correctly', () => {
13
+ const text = "HIBPA:4:3:3+12+280:12030000+Deutsche Kreditbank Aktiengesellschaft+3+1:2:3+220:300'";
14
+ const segment = decode(text);
15
+ expect(segment.supportedLanguages.length).toBe(3);
16
+ expect(segment.supportedHbciVersions.length).toBe(2);
17
+ expect(segment.supportedLanguages[2]).toBe(3);
18
+ expect(segment.supportedHbciVersions[1]).toBe(300);
19
+ });
20
+ it('decode and encode roundtrip matches', () => {
21
+ HIBPA.Id;
22
+ const text = "HIBPA:4:3:3+12+280:12030000+Deutsche Kreditbank Aktiengesellschaft+3+1+300'";
23
+ const segment = decode(text);
24
+ expect(encode(segment)).toBe(text);
25
+ });
26
+ });
@@ -0,0 +1,14 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { registerSegments } from '../segments/registry.js';
3
+ import { decode, encode } from '../segment.js';
4
+ registerSegments();
5
+ describe('HIPINS', () => {
6
+ it('decode and encode roundtrip matches', () => {
7
+ const text = "HIPINS:164:1:4+1+1+0+5:38:6:USERID:CUSTID:HKCSU:J:HKPKB:N:HKPKA:J:HKSAL:J'";
8
+ const segment = decode(text);
9
+ expect(segment.params.maxPinLen).toBe(38);
10
+ expect(segment.params.transactions[3].transId).toBe('HKSAL');
11
+ expect(segment.params.transactions[3].tanRequired).toBe(true);
12
+ expect(encode(segment)).toBe(text);
13
+ });
14
+ });
@@ -0,0 +1,24 @@
1
+ import { describe, it, expect } from 'vitest';
2
+ import { registerSegments } from '../segments/registry.js';
3
+ import { decode, encode, segmentToString } from '../segment.js';
4
+ registerSegments();
5
+ describe('HIRMG', () => {
6
+ it('decodes correctly', () => {
7
+ const text = "HIRMG:3:2+0010::Nachricht entgegengenommen.+3920::Zugelassene Zwei-Schritt-Verfahren für den Benutzer.:921:922'";
8
+ const segment = decode(text);
9
+ expect(segment.answers.length).toBe(2);
10
+ expect(segment.answers[0].code).toBe(10);
11
+ expect(segment.answers[1].code).toBe(3920);
12
+ expect(segment.answers[1].params).toEqual(['921', '922']);
13
+ });
14
+ it('decode and encode roundtrip matches', () => {
15
+ const text = "HIRMG:3:2+0010::Nachricht entgegengenommen.+0100::Dialog beendet.'";
16
+ const segment = decode(text);
17
+ expect(encode(segment)).toBe(text);
18
+ });
19
+ it('decode and toString() gives correct output', () => {
20
+ const text = "HIRMG:3:2+0010::Nachricht entgegengenommen.+0100::Dialog beendet.'";
21
+ const segment = decode(text);
22
+ expect(segmentToString(segment)).toBe(' 3. HIRMG v2; [code: 10, text: Nachricht entgegengenommen.]; [code: 100, text: Dialog beendet.]');
23
+ });
24
+ });