fints-lib 0.6.0 → 0.7.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 (197) hide show
  1. package/README_advanced_usage.md +70 -0
  2. package/dist/client.d.ts +89 -0
  3. package/dist/client.js +473 -0
  4. package/dist/client.js.map +1 -0
  5. package/dist/constants.d.ts +15 -0
  6. package/dist/constants.js +19 -0
  7. package/dist/constants.js.map +1 -0
  8. package/dist/dialog.d.ts +111 -0
  9. package/dist/dialog.js +187 -0
  10. package/dist/dialog.js.map +1 -0
  11. package/dist/error-codes.d.ts +39 -0
  12. package/dist/error-codes.js +228 -0
  13. package/dist/error-codes.js.map +1 -0
  14. package/dist/errors/fints-error.d.ts +55 -0
  15. package/dist/errors/fints-error.js +131 -0
  16. package/dist/errors/fints-error.js.map +1 -0
  17. package/dist/errors/response-error.d.ts +6 -0
  18. package/dist/errors/response-error.js +20 -0
  19. package/dist/errors/response-error.js.map +1 -0
  20. package/dist/errors/tan-required-error.d.ts +40 -0
  21. package/dist/errors/tan-required-error.js +54 -0
  22. package/dist/errors/tan-required-error.js.map +1 -0
  23. package/dist/format.d.ts +81 -0
  24. package/dist/format.js +112 -0
  25. package/dist/format.js.map +1 -0
  26. package/dist/http-connection.d.ts +36 -0
  27. package/dist/http-connection.js +109 -0
  28. package/dist/http-connection.js.map +1 -0
  29. package/dist/index.d.ts +23 -0
  30. package/dist/index.js +40 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/logger.d.ts +4 -0
  33. package/dist/logger.js +13 -0
  34. package/dist/logger.js.map +1 -0
  35. package/dist/mt535.d.ts +19 -0
  36. package/dist/mt535.js +153 -0
  37. package/dist/mt535.js.map +1 -0
  38. package/dist/mt940-86-structured.d.ts +47 -0
  39. package/dist/mt940-86-structured.js +213 -0
  40. package/dist/mt940-86-structured.js.map +1 -0
  41. package/dist/pain-formats.d.ts +50 -0
  42. package/dist/pain-formats.js +7 -0
  43. package/dist/pain-formats.js.map +1 -0
  44. package/dist/pain.d.ts +21 -0
  45. package/dist/pain.js +315 -0
  46. package/dist/pain.js.map +1 -0
  47. package/dist/parse.d.ts +46 -0
  48. package/dist/parse.js +97 -0
  49. package/dist/parse.js.map +1 -0
  50. package/dist/pin-tan-client.d.ts +47 -0
  51. package/dist/pin-tan-client.js +35 -0
  52. package/dist/pin-tan-client.js.map +1 -0
  53. package/dist/request.d.ts +90 -0
  54. package/dist/request.js +102 -0
  55. package/dist/request.js.map +1 -0
  56. package/dist/response.d.ts +104 -0
  57. package/dist/response.js +197 -0
  58. package/dist/response.js.map +1 -0
  59. package/dist/return-value.d.ts +37 -0
  60. package/dist/return-value.js +31 -0
  61. package/dist/return-value.js.map +1 -0
  62. package/dist/segments/hibpa.d.ts +22 -0
  63. package/dist/segments/hibpa.js +36 -0
  64. package/dist/segments/hibpa.js.map +1 -0
  65. package/dist/segments/hiccs.d.ts +14 -0
  66. package/dist/segments/hiccs.js +28 -0
  67. package/dist/segments/hiccs.js.map +1 -0
  68. package/dist/segments/hiccss.d.ts +13 -0
  69. package/dist/segments/hiccss.js +24 -0
  70. package/dist/segments/hiccss.js.map +1 -0
  71. package/dist/segments/hicdb.d.ts +17 -0
  72. package/dist/segments/hicdb.js +62 -0
  73. package/dist/segments/hicdb.js.map +1 -0
  74. package/dist/segments/hicdbs.d.ts +16 -0
  75. package/dist/segments/hicdbs.js +28 -0
  76. package/dist/segments/hicdbs.js.map +1 -0
  77. package/dist/segments/hidse.d.ts +14 -0
  78. package/dist/segments/hidse.js +28 -0
  79. package/dist/segments/hidse.js.map +1 -0
  80. package/dist/segments/hidses.d.ts +13 -0
  81. package/dist/segments/hidses.js +24 -0
  82. package/dist/segments/hidses.js.map +1 -0
  83. package/dist/segments/hikaz.d.ts +16 -0
  84. package/dist/segments/hikaz.js +31 -0
  85. package/dist/segments/hikaz.js.map +1 -0
  86. package/dist/segments/hikazs.d.ts +16 -0
  87. package/dist/segments/hikazs.js +28 -0
  88. package/dist/segments/hikazs.js.map +1 -0
  89. package/dist/segments/hirmg.d.ts +17 -0
  90. package/dist/segments/hirmg.js +39 -0
  91. package/dist/segments/hirmg.js.map +1 -0
  92. package/dist/segments/hirms.d.ts +16 -0
  93. package/dist/segments/hirms.js +37 -0
  94. package/dist/segments/hirms.js.map +1 -0
  95. package/dist/segments/hisal.d.ts +22 -0
  96. package/dist/segments/hisal.js +33 -0
  97. package/dist/segments/hisal.js.map +1 -0
  98. package/dist/segments/hisals.d.ts +16 -0
  99. package/dist/segments/hisals.js +28 -0
  100. package/dist/segments/hisals.js.map +1 -0
  101. package/dist/segments/hispa.d.ts +16 -0
  102. package/dist/segments/hispa.js +31 -0
  103. package/dist/segments/hispa.js.map +1 -0
  104. package/dist/segments/hispas.d.ts +14 -0
  105. package/dist/segments/hispas.js +28 -0
  106. package/dist/segments/hispas.js.map +1 -0
  107. package/dist/segments/hisyn.d.ts +15 -0
  108. package/dist/segments/hisyn.js +26 -0
  109. package/dist/segments/hisyn.js.map +1 -0
  110. package/dist/segments/hitan.d.ts +18 -0
  111. package/dist/segments/hitan.js +66 -0
  112. package/dist/segments/hitan.js.map +1 -0
  113. package/dist/segments/hitans.d.ts +18 -0
  114. package/dist/segments/hitans.js +46 -0
  115. package/dist/segments/hitans.js.map +1 -0
  116. package/dist/segments/hiupd.d.ts +16 -0
  117. package/dist/segments/hiupd.js +34 -0
  118. package/dist/segments/hiupd.js.map +1 -0
  119. package/dist/segments/hiwpd.d.ts +15 -0
  120. package/dist/segments/hiwpd.js +26 -0
  121. package/dist/segments/hiwpd.js.map +1 -0
  122. package/dist/segments/hiwpds.d.ts +16 -0
  123. package/dist/segments/hiwpds.js +32 -0
  124. package/dist/segments/hiwpds.js.map +1 -0
  125. package/dist/segments/hkccs.d.ts +18 -0
  126. package/dist/segments/hkccs.js +32 -0
  127. package/dist/segments/hkccs.js.map +1 -0
  128. package/dist/segments/hkcdb.d.ts +19 -0
  129. package/dist/segments/hkcdb.js +30 -0
  130. package/dist/segments/hkcdb.js.map +1 -0
  131. package/dist/segments/hkdse.d.ts +18 -0
  132. package/dist/segments/hkdse.js +27 -0
  133. package/dist/segments/hkdse.js.map +1 -0
  134. package/dist/segments/hkend.d.ts +12 -0
  135. package/dist/segments/hkend.js +24 -0
  136. package/dist/segments/hkend.js.map +1 -0
  137. package/dist/segments/hkidn.d.ts +19 -0
  138. package/dist/segments/hkidn.js +33 -0
  139. package/dist/segments/hkidn.js.map +1 -0
  140. package/dist/segments/hkkaz.d.ts +20 -0
  141. package/dist/segments/hkkaz.js +42 -0
  142. package/dist/segments/hkkaz.js.map +1 -0
  143. package/dist/segments/hksal.d.ts +18 -0
  144. package/dist/segments/hksal.js +35 -0
  145. package/dist/segments/hksal.js.map +1 -0
  146. package/dist/segments/hkspa.d.ts +18 -0
  147. package/dist/segments/hkspa.js +31 -0
  148. package/dist/segments/hkspa.js.map +1 -0
  149. package/dist/segments/hksyn.d.ts +16 -0
  150. package/dist/segments/hksyn.js +31 -0
  151. package/dist/segments/hksyn.js.map +1 -0
  152. package/dist/segments/hktab.d.ts +17 -0
  153. package/dist/segments/hktab.js +31 -0
  154. package/dist/segments/hktab.js.map +1 -0
  155. package/dist/segments/hktan.d.ts +19 -0
  156. package/dist/segments/hktan.js +66 -0
  157. package/dist/segments/hktan.js.map +1 -0
  158. package/dist/segments/hkvvb.d.ts +17 -0
  159. package/dist/segments/hkvvb.js +39 -0
  160. package/dist/segments/hkvvb.js.map +1 -0
  161. package/dist/segments/hkwpd.d.ts +21 -0
  162. package/dist/segments/hkwpd.js +39 -0
  163. package/dist/segments/hkwpd.js.map +1 -0
  164. package/dist/segments/hnhbk.d.ts +22 -0
  165. package/dist/segments/hnhbk.js +54 -0
  166. package/dist/segments/hnhbk.js.map +1 -0
  167. package/dist/segments/hnhbs.d.ts +16 -0
  168. package/dist/segments/hnhbs.js +29 -0
  169. package/dist/segments/hnhbs.js.map +1 -0
  170. package/dist/segments/hnsha.d.ts +18 -0
  171. package/dist/segments/hnsha.js +30 -0
  172. package/dist/segments/hnsha.js.map +1 -0
  173. package/dist/segments/hnshk.d.ts +21 -0
  174. package/dist/segments/hnshk.js +44 -0
  175. package/dist/segments/hnshk.js.map +1 -0
  176. package/dist/segments/hnvsd.d.ts +25 -0
  177. package/dist/segments/hnvsd.js +31 -0
  178. package/dist/segments/hnvsd.js.map +1 -0
  179. package/dist/segments/hnvsk.d.ts +15 -0
  180. package/dist/segments/hnvsk.js +51 -0
  181. package/dist/segments/hnvsk.js.map +1 -0
  182. package/dist/segments/index.d.ts +40 -0
  183. package/dist/segments/index.js +57 -0
  184. package/dist/segments/index.js.map +1 -0
  185. package/dist/segments/segment.d.ts +60 -0
  186. package/dist/segments/segment.js +74 -0
  187. package/dist/segments/segment.js.map +1 -0
  188. package/dist/tan-method.d.ts +36 -0
  189. package/dist/tan-method.js +224 -0
  190. package/dist/tan-method.js.map +1 -0
  191. package/dist/types.d.ts +386 -0
  192. package/dist/types.js +3 -0
  193. package/dist/types.js.map +1 -0
  194. package/dist/utils.d.ts +55 -0
  195. package/dist/utils.js +178 -0
  196. package/dist/utils.js.map +1 -0
  197. package/package.json +1 -1
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TanMethod = exports.tanMethodArgumentMap = void 0;
4
+ const parse_1 = require("./parse");
5
+ exports.tanMethodArgumentMap = new Map();
6
+ exports.tanMethodArgumentMap.set(1, [
7
+ "securityFunction",
8
+ "tanProcess",
9
+ "techId",
10
+ "name",
11
+ "maxLengthInput",
12
+ "allowedFormat",
13
+ "textReturnvalue",
14
+ "maxLengthReturnvalue",
15
+ "numberOfSupportedLists",
16
+ "multiple",
17
+ "tanTimeDialogAssociation",
18
+ ]);
19
+ exports.tanMethodArgumentMap.set(2, [
20
+ "securityFunction",
21
+ "tanProcess",
22
+ "techId",
23
+ "name",
24
+ "maxLengthInput",
25
+ "allowedFormat",
26
+ "textReturnvalue",
27
+ "maxLengthReturnvalue",
28
+ "numberOfSupportedLists",
29
+ "multiple",
30
+ "tanTimeDialogAssociation",
31
+ "tanListNumberRequired",
32
+ "cancellable",
33
+ "challengeClassRequired",
34
+ "challengeValueRequired",
35
+ ]);
36
+ exports.tanMethodArgumentMap.set(3, [
37
+ "securityFunction",
38
+ "tanProcess",
39
+ "techId",
40
+ "name",
41
+ "maxLengthInput",
42
+ "allowedFormat",
43
+ "textReturnvalue",
44
+ "maxLengthReturnvalue",
45
+ "numberOfSupportedLists",
46
+ "multiple",
47
+ "tanTimeDialogAssociation",
48
+ "tanListNumberRequired",
49
+ "cancellable",
50
+ "challengeClassRequired",
51
+ "challengeValueRequired",
52
+ "initializationMode",
53
+ "descriptionRequired",
54
+ "supportedMediaNumber",
55
+ ]);
56
+ exports.tanMethodArgumentMap.set(4, [
57
+ "securityFunction",
58
+ "tanProcess",
59
+ "techId",
60
+ "zkaId",
61
+ "zkaVersion",
62
+ "name",
63
+ "maxLengthInput",
64
+ "allowedFormat",
65
+ "textReturnvalue",
66
+ "maxLengthReturnvalue",
67
+ "numberOfSupportedLists",
68
+ "multiple",
69
+ "tanTimeDialogAssociation",
70
+ "tanListNumberRequired",
71
+ "cancellable",
72
+ "smsChargeAccountRequired",
73
+ "challengeClassRequired",
74
+ "challengeValueRequired",
75
+ "challengeStructured",
76
+ "initializationMode",
77
+ "descriptionRequired",
78
+ "supportedMediaNumber",
79
+ ]);
80
+ exports.tanMethodArgumentMap.set(5, [
81
+ "securityFunction",
82
+ "tanProcess",
83
+ "techId",
84
+ "zkaId",
85
+ "zkaVersion",
86
+ "name",
87
+ "maxLengthInput",
88
+ "allowedFormat",
89
+ "textReturnvalue",
90
+ "maxLengthReturnvalue",
91
+ "numberOfSupportedLists",
92
+ "multiple",
93
+ "tanTimeDialogAssociation",
94
+ "tanListNumberRequired",
95
+ "cancellable",
96
+ "smsChargeAccountRequired",
97
+ "principalAccountRequired",
98
+ "challengeClassRequired",
99
+ "challengeValueRequired",
100
+ "initializationMode",
101
+ "descriptionRequired",
102
+ "supportedMediaNumber",
103
+ ]);
104
+ exports.tanMethodArgumentMap.set(6, [
105
+ "securityFunction",
106
+ "tanProcess",
107
+ "techId",
108
+ "zkaId",
109
+ "zkaVersion",
110
+ "name",
111
+ "maxLengthInput",
112
+ "allowedFormat",
113
+ "textReturnvalue",
114
+ "maxLengthReturnvalue",
115
+ "multiple",
116
+ "tanTimeDialogAssociation",
117
+ "cancellable",
118
+ "smsChargeAccountRequired",
119
+ "principalAccountRequired",
120
+ "challengeClassRequired",
121
+ "challengeStructured",
122
+ "initializationMode",
123
+ "descriptionRequired",
124
+ "hhdUcRequired",
125
+ "supportedMediaNumber",
126
+ ]);
127
+ exports.tanMethodArgumentMap.set(7, [
128
+ "securityFunction",
129
+ "tanProcess",
130
+ "techId",
131
+ "zkaId",
132
+ "zkaVersion",
133
+ "name",
134
+ "maxLengthInput",
135
+ "allowedFormat",
136
+ "textReturnvalue",
137
+ "maxLengthReturnvalue",
138
+ "numberOfSupportedLists",
139
+ "multiple",
140
+ "tanTimeDialogAssociation",
141
+ "tanDialogOptions",
142
+ "tanListNumberRequired",
143
+ "cancellable",
144
+ "smsChargeAccountRequired",
145
+ "principalAccountRequired",
146
+ "challengeClassRequired",
147
+ "challengeValueRequired",
148
+ "challengeStructured",
149
+ "initializationMode",
150
+ "supportedMediaNumber",
151
+ "hhdUcRequired",
152
+ "activeTanMedia",
153
+ "decoupledMaxStatusRequests",
154
+ "decoupledWaitBeforeFirstStatusRequest",
155
+ "decoupledWaitBetweenStatusRequests",
156
+ "decoupledManualConfirmationAllowed",
157
+ "decoupledAutoConfirmationAllowed",
158
+ ]);
159
+ class TanMethod {
160
+ constructor(version, config) {
161
+ this.version = version;
162
+ const argumentList = exports.tanMethodArgumentMap.get(version) || [];
163
+ const map = argumentList.reduce((result, argumentName, index) => {
164
+ if (config && typeof config[index] !== "undefined") {
165
+ result.set(argumentName, config[index]);
166
+ }
167
+ return result;
168
+ }, new Map());
169
+ this.allowedFormat = map.get("allowedFormat");
170
+ this.cancellable = parse_1.Parse.bool(map.get("cancellable"));
171
+ this.challengeClassRequired = parse_1.Parse.bool(map.get("challengeClassRequired"));
172
+ this.challengeValueRequired = parse_1.Parse.bool(map.get("challengeValueRequired"));
173
+ this.challengeStructured = parse_1.Parse.bool(map.get("challengeStructured"));
174
+ const decoupledAuto = map.get("decoupledAutoConfirmationAllowed");
175
+ if (typeof decoupledAuto !== "undefined") {
176
+ this.decoupledAutoConfirmationAllowed = parse_1.Parse.bool(decoupledAuto);
177
+ }
178
+ const decoupledManual = map.get("decoupledManualConfirmationAllowed");
179
+ if (typeof decoupledManual !== "undefined") {
180
+ this.decoupledManualConfirmationAllowed = parse_1.Parse.bool(decoupledManual);
181
+ }
182
+ const decoupledMax = map.get("decoupledMaxStatusRequests");
183
+ if (typeof decoupledMax !== "undefined") {
184
+ this.decoupledMaxStatusRequests = parse_1.Parse.num(decoupledMax);
185
+ }
186
+ const decoupledWaitFirst = map.get("decoupledWaitBeforeFirstStatusRequest");
187
+ if (typeof decoupledWaitFirst !== "undefined") {
188
+ this.decoupledWaitBeforeFirstStatusRequest = parse_1.Parse.num(decoupledWaitFirst);
189
+ }
190
+ const decoupledWaitBetween = map.get("decoupledWaitBetweenStatusRequests");
191
+ if (typeof decoupledWaitBetween !== "undefined") {
192
+ this.decoupledWaitBetweenStatusRequests = parse_1.Parse.num(decoupledWaitBetween);
193
+ }
194
+ this.descriptionRequired = map.get("descriptionRequired");
195
+ this.hhdUcRequired = parse_1.Parse.bool(map.get("hhdUcRequired"));
196
+ this.initializationMode = map.get("initializationMode");
197
+ this.maxLengthInput = parse_1.Parse.num(map.get("maxLengthInput"));
198
+ this.maxLengthReturnvalue = parse_1.Parse.num(map.get("maxLengthReturnvalue"));
199
+ this.multiple = parse_1.Parse.bool(map.get("multiple"));
200
+ this.name = map.get("name");
201
+ const activeTanMedia = map.get("activeTanMedia");
202
+ if (typeof activeTanMedia !== "undefined") {
203
+ this.activeTanMedia = parse_1.Parse.num(activeTanMedia);
204
+ }
205
+ this.numberOfSupportedLists = parse_1.Parse.num(map.get("numberOfSupportedLists"));
206
+ this.principalAccountRequired = map.get("principalAccountRequired") === "2";
207
+ this.securityFunction = map.get("securityFunction");
208
+ this.smsChargeAccountRequired = map.get("smsChargeAccountRequired") === "1";
209
+ this.supportedMediaNumber = parse_1.Parse.num(map.get("supportedMediaNumber"));
210
+ this.tanListNumberRequired = parse_1.Parse.bool(map.get("tanListNumberRequired"));
211
+ this.tanProcess = map.get("tanProcess");
212
+ const tanDialogOptions = map.get("tanDialogOptions");
213
+ if (typeof tanDialogOptions !== "undefined") {
214
+ this.tanDialogOptions = tanDialogOptions;
215
+ }
216
+ this.tanTimeDialogAssociation = map.get("tanTimeDialogAssociation");
217
+ this.techId = map.get("techId");
218
+ this.textReturnvalue = map.get("textReturnvalue");
219
+ this.zkaId = map.get("zkaId");
220
+ this.zkaVersion = map.get("zkaVersion");
221
+ }
222
+ }
223
+ exports.TanMethod = TanMethod;
224
+ //# sourceMappingURL=tan-method.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tan-method.js","sourceRoot":"","sources":["../src/tan-method.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAEnB,QAAA,oBAAoB,GAAG,IAAI,GAAG,EAAoB,CAAC;AAEhE,4BAAoB,CAAC,GAAG,CAAC,CAAC,EAAE;IACxB,kBAAkB;IAClB,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,wBAAwB;IACxB,UAAU;IACV,0BAA0B;CAC7B,CAAC,CAAC;AAEH,4BAAoB,CAAC,GAAG,CAAC,CAAC,EAAE;IACxB,kBAAkB;IAClB,YAAY;IACZ,QAAQ;IACR,MAAM;IACN,gBAAgB;IAChB,eAAe;IACf,iBAAiB;IACjB,sBAAsB;IACtB,wBAAwB;IACxB,UAAU;IACV,0BAA0B;IAC1B,uBAAuB;IACvB,aAAa;IACb,wBAAwB;IACxB,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AA0B,CAAC,KAAK,GAAG,CAAC;QAC5E,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACpD,IAAI,CAAC,wBAAwB,GAAG,GAAG,CAAC,GAAG,CAAC,0BAA0B,CAAC,KAAK,GAAG,CAAC;QAC5E,IAAI,CAAC,oBAAoB,GAAG,aAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,qBAAqB,GAAG,aAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACxC,MAAM,gBAAgB,GAAG,GAAG,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QACrD,IAAI,OAAO,gBAAgB,KAAK,WAAW,EAAE,CAAC;YAC1C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QAC7C,CAAC;QACD,IAAI,CAAC,wBAAwB,GAAG,GAAG,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,GAAG,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC5C,CAAC;CACJ;AAhGD,8BAgGC"}
@@ -0,0 +1,386 @@
1
+ import { Statement as MT940Statement, Transaction as MT940Transaction } from "mt940-js";
2
+ import { Request } from "./request";
3
+ import { Response } from "./response";
4
+ export interface Constructable<T> {
5
+ new (...args: any[]): T;
6
+ }
7
+ /**
8
+ * A payment reference as wrapped in a structured description in the 86 section of the MT 940 format.
9
+ * Most properties will likely be `undefined` if no matching tags were found.
10
+ */
11
+ export interface PaymentReference {
12
+ /**
13
+ * The unprocessed, raw payment reference as a string.
14
+ */
15
+ raw: string;
16
+ /**
17
+ * The principal's IBAN (IBAN+ tag).
18
+ */
19
+ iban?: string;
20
+ /**
21
+ * The principal's BIC (BIC+ tag).
22
+ */
23
+ bic?: string;
24
+ /**
25
+ * End to end reference of the transaction (EREF+ tag).
26
+ */
27
+ endToEndRef?: string;
28
+ /**
29
+ * Customer reference (KREF+).
30
+ */
31
+ customerRef?: string;
32
+ /**
33
+ * Mandate reference (MREF+). Specified if the transaction was a debit.
34
+ */
35
+ mandateRef?: string;
36
+ /**
37
+ * Creditor identification (CRED+). Specified if the transaction was a debit.
38
+ */
39
+ creditorId?: string;
40
+ /**
41
+ * Original amount of turnover (OAMT+). Specified if the transaction was a return.
42
+ */
43
+ originalTurnover?: string;
44
+ /**
45
+ * Interest compensation (COAM+). Specified if the transaction was a return.
46
+ */
47
+ interestCompensation?: string;
48
+ /**
49
+ * Specified if the principal of the transaction was diverging (ABWA+).
50
+ */
51
+ divergingPrincipal?: string;
52
+ /**
53
+ * Bank identification reference (BREF+).
54
+ */
55
+ bank?: string;
56
+ /**
57
+ * Return reference (RREF+). Specified if the transaction was a return.
58
+ */
59
+ back?: string;
60
+ /**
61
+ * The originator's id (DEBT+).
62
+ */
63
+ originatorId?: string;
64
+ /**
65
+ * The transaction's date (DATUM).
66
+ */
67
+ date?: Date;
68
+ /**
69
+ * The tan associated with the transaction (TAN).
70
+ */
71
+ tan?: {
72
+ num: number;
73
+ value: string;
74
+ };
75
+ /**
76
+ * The principal's specified payment reference (description text of the transaction) (SVWZ+).
77
+ */
78
+ text?: string;
79
+ /** Purpose code */
80
+ purpose?: string;
81
+ }
82
+ /**
83
+ * A parsed structure from the description in the 86 section of a MT940 list of s
84
+ */
85
+ export interface StructuredDescription {
86
+ /**
87
+ * Payment reference. Can be a parsed structure using tags or only contain the textual representation in the
88
+ * property named `raw`.
89
+ */
90
+ reference: PaymentReference;
91
+ /**
92
+ * The name of the principal or benefitiary.
93
+ */
94
+ name: string;
95
+ /**
96
+ * The IBAN of the principal or benefitiary.
97
+ */
98
+ iban: string;
99
+ /**
100
+ * The textual, not parsed representation of the description.
101
+ */
102
+ text: string;
103
+ /**
104
+ * The BIC of the principal or benefitiary.
105
+ */
106
+ bic: string;
107
+ /**
108
+ * The prima nota associated with this transaction.
109
+ * Used by some german banks. See: https://de.wikipedia.org/wiki/Primanota
110
+ */
111
+ primaNota: string;
112
+ }
113
+ /**
114
+ * An unparsed raw sub section from the structured 86 section.
115
+ */
116
+ export interface Section {
117
+ /**
118
+ * The section's code.
119
+ */
120
+ code: number;
121
+ /**
122
+ * The section's raw content.
123
+ */
124
+ content: string;
125
+ }
126
+ /**
127
+ * A single SEPA account.
128
+ */
129
+ export interface SEPAAccount {
130
+ /**
131
+ * The account's IBAN.
132
+ */
133
+ iban: string;
134
+ /**
135
+ * The account's BIC.
136
+ */
137
+ bic: string;
138
+ /**
139
+ * The account's internal account number used together with the BLZ before SEPA.
140
+ */
141
+ accountNumber: string;
142
+ /**
143
+ * An optional sub account identification.
144
+ */
145
+ subAccount?: string;
146
+ /**
147
+ * The account's BLZ used together with the account number before SEPA.
148
+ */
149
+ blz: string;
150
+ /**
151
+ * Name of the account owner if known
152
+ */
153
+ accountOwnerName?: string;
154
+ accountName?: string;
155
+ limitValue?: number;
156
+ }
157
+ /**
158
+ * A single SEPA account.
159
+ */
160
+ export interface SEPAAccountHiupd {
161
+ accountNumber: string;
162
+ iban: string;
163
+ accountOwnerName1: string;
164
+ accountName: string;
165
+ limitValue: string;
166
+ }
167
+ /**
168
+ * A single standing order.
169
+ */
170
+ export interface StandingOrder {
171
+ /**
172
+ * The next time this standing order will trigger a transaction.
173
+ */
174
+ nextOrderDate: Date;
175
+ /**
176
+ * Unit of the order-interval.
177
+ */
178
+ timeUnit: string;
179
+ /**
180
+ * Interval of repeating transactions.
181
+ */
182
+ interval: number;
183
+ /**
184
+ * Day in month when transaction is triggered.
185
+ */
186
+ orderDay?: number;
187
+ /**
188
+ * The last time this standing order will trigger a transaction.
189
+ */
190
+ lastOrderDate?: Date;
191
+ /**
192
+ * Creation date of this standing order.
193
+ */
194
+ creationDate: Date;
195
+ /**
196
+ * The debitor.
197
+ */
198
+ debitor: PartyIdentification;
199
+ /**
200
+ * The creditor.
201
+ */
202
+ creditor: PartyIdentification;
203
+ /**
204
+ * The amount of every transaction.
205
+ */
206
+ amount: number;
207
+ /**
208
+ * The payment purpose (text of the transaction).
209
+ */
210
+ paymentPurpose: string;
211
+ }
212
+ export type DirectDebitScheme = "CORE" | "B2B" | "COR1";
213
+ export type DirectDebitSequenceType = "OOFF" | "FRST" | "RCUR" | "FNAL";
214
+ export interface DirectDebitParty {
215
+ name: string;
216
+ iban: string;
217
+ bic?: string;
218
+ }
219
+ export interface DirectDebitRequest {
220
+ creditorName: string;
221
+ creditorId: string;
222
+ debtor: DirectDebitParty;
223
+ amount: number;
224
+ currency?: string;
225
+ endToEndId?: string;
226
+ remittanceInformation?: string;
227
+ purposeCode?: string;
228
+ mandateId: string;
229
+ mandateSignatureDate: Date;
230
+ requestedCollectionDate: Date;
231
+ sequenceType?: DirectDebitSequenceType;
232
+ localInstrument?: DirectDebitScheme;
233
+ batchBooking?: boolean;
234
+ messageId?: string;
235
+ paymentInformationId?: string;
236
+ creationDateTime?: Date;
237
+ }
238
+ export interface DirectDebitSubmission {
239
+ taskId?: string;
240
+ messageId: string;
241
+ paymentInformationId: string;
242
+ endToEndId: string;
243
+ painDescriptor: string;
244
+ xml: string;
245
+ }
246
+ export interface CreditTransferParty {
247
+ name: string;
248
+ iban: string;
249
+ bic?: string;
250
+ }
251
+ export interface CreditTransferRequest {
252
+ debtorName: string;
253
+ creditor: CreditTransferParty;
254
+ amount: number;
255
+ currency?: string;
256
+ endToEndId?: string;
257
+ remittanceInformation?: string;
258
+ purposeCode?: string;
259
+ executionDate?: Date;
260
+ batchBooking?: boolean;
261
+ messageId?: string;
262
+ paymentInformationId?: string;
263
+ creationDateTime?: Date;
264
+ }
265
+ export interface CreditTransferSubmission {
266
+ taskId?: string;
267
+ messageId: string;
268
+ paymentInformationId: string;
269
+ endToEndId: string;
270
+ painDescriptor: string;
271
+ xml: string;
272
+ }
273
+ /**
274
+ * Represents a creditor or debitor identification object.
275
+ */
276
+ export interface PartyIdentification {
277
+ /**
278
+ * Name of the party.
279
+ */
280
+ name: string;
281
+ /**
282
+ * IBAN of the party.
283
+ */
284
+ iban: string;
285
+ /**
286
+ * BIC of the party.
287
+ */
288
+ bic: string;
289
+ }
290
+ /**
291
+ * An augmented version of the `mt940-js` `Transaction` with an added parsed
292
+ * version of structured 86 fields.
293
+ */
294
+ export interface Transaction extends MT940Transaction {
295
+ descriptionStructured?: StructuredDescription;
296
+ }
297
+ /**
298
+ * An augmented version of the `mt940-js` `Statement` with an added parsed
299
+ * version of structured 86 fields on each transaction.
300
+ */
301
+ export interface Statement extends MT940Statement {
302
+ transactions: Transaction[];
303
+ }
304
+ /**
305
+ * Represents the balance for a single SEPA account.
306
+ */
307
+ export interface Balance {
308
+ /**
309
+ * The SEPA account, this balance belongs to.
310
+ */
311
+ account: SEPAAccount;
312
+ /**
313
+ * The product name of this account.
314
+ */
315
+ productName: string;
316
+ /**
317
+ * The currency of this account.
318
+ */
319
+ currency: string;
320
+ /**
321
+ * Balance which is already booked of this account.
322
+ */
323
+ bookedBalance: number;
324
+ /**
325
+ * Balance of pending transactions of this account.
326
+ */
327
+ pendingBalance: number;
328
+ /**
329
+ * Available credit limit of this account.
330
+ */
331
+ creditLimit: number;
332
+ /**
333
+ * Balance which is accessible for this account.
334
+ */
335
+ availableBalance: number;
336
+ }
337
+ /**
338
+ * Represents a single security or holding entry returned by the bank.
339
+ */
340
+ export interface Holding {
341
+ /**
342
+ * International Securities Identification Number of the holding.
343
+ */
344
+ isin?: string;
345
+ /**
346
+ * Human readable name of the holding.
347
+ */
348
+ name?: string;
349
+ /**
350
+ * Latest market price transmitted by the bank.
351
+ */
352
+ marketPrice?: number;
353
+ /**
354
+ * Currency in which all monetary values are denominated.
355
+ */
356
+ currency?: string;
357
+ /**
358
+ * Date of the valuation.
359
+ */
360
+ valuationDate?: Date;
361
+ /**
362
+ * Number of units held.
363
+ */
364
+ pieces?: number;
365
+ /**
366
+ * Total value of the position.
367
+ */
368
+ totalValue?: number;
369
+ /**
370
+ * Acquisition price communicated by the institute.
371
+ */
372
+ acquisitionPrice?: number;
373
+ }
374
+ /**
375
+ * A connection used in the client to contact the server.
376
+ */
377
+ export interface Connection {
378
+ /**
379
+ * Send a request to the server and return the response received.
380
+ *
381
+ * @param request Request to send to the server.
382
+ *
383
+ * @return The response received from the server.
384
+ */
385
+ send(request: Request): Promise<Response>;
386
+ }
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Base 64 encode a string for use with fints. Fints uses ISO-8859-1 encoding which will be the encoding used
3
+ * in the base 64 data.
4
+ *
5
+ * @param input The string to encode.
6
+ *
7
+ * @return The encoded string.
8
+ */
9
+ export declare function encodeBase64(input: string): string;
10
+ /**
11
+ * Decode a base 64 encoded string received from a fints server.
12
+ * Fints uses ISO-8859-1 encoding which will be converted into UTF-8.
13
+ *
14
+ * @param input The string to decode.
15
+ *
16
+ * @return The decoded string.
17
+ */
18
+ export declare function decodeBase64(input: string): string;
19
+ /**
20
+ * Parse a full fints message into a set of segments containing a set of data groups containing a set of
21
+ * data elements.
22
+ * Can be parsed further by using segment classes.
23
+ * Bit strings with length will be resolved here.
24
+ *
25
+ * @param input The string to parse.
26
+ *
27
+ * @return Set of segments.
28
+ */
29
+ export declare function parse(input: string): string[][][];
30
+ /**
31
+ * Fill up the string with the specified character from the left.
32
+ *
33
+ * @param str String to pad.
34
+ * @param count Limit to which the string should be padded.
35
+ * @param character Character to pad the string with. Defaults to "0".
36
+ *
37
+ * @return The padded string.
38
+ */
39
+ export declare function leftPad(str: string, count: number, character?: string): string;
40
+ /**
41
+ * Escape a string into fints representation.
42
+ *
43
+ * @param content The string to escape.
44
+ *
45
+ * @return The escaped string.
46
+ */
47
+ export declare function escapeFinTS(content: string): string;
48
+ /**
49
+ * Unescape a string from fints representation.
50
+ *
51
+ * @param content The string to unescape.
52
+ *
53
+ * @return The unescaped string.
54
+ */
55
+ export declare function unescapeFinTS(content: string): string;