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,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Request = exports.RequestConfig = void 0;
4
+ const segments_1 = require("./segments");
5
+ const constants_1 = require("./constants");
6
+ /**
7
+ * Properties used to constructe a `Request`.
8
+ */
9
+ class RequestConfig {
10
+ constructor() {
11
+ /**
12
+ * A list of allowed TAN methods as configured by the server.
13
+ */
14
+ this.tanMethods = [];
15
+ /**
16
+ * All segments that should be transmitted in the HNVSD segment of the request.
17
+ */
18
+ this.segments = [];
19
+ }
20
+ }
21
+ exports.RequestConfig = RequestConfig;
22
+ /**
23
+ * A single request holding multiple segments.
24
+ * Will likely embedded in a dialog.
25
+ */
26
+ class Request extends RequestConfig {
27
+ constructor(config) {
28
+ super();
29
+ Object.assign(this, config);
30
+ // Generate `this.secRef`.
31
+ this.secRef = Math.floor(1000000 + Math.random() * 8999999);
32
+ }
33
+ /**
34
+ * Determines if a TAN method with a "999" security function is available.
35
+ * This determines whether profile version 2 can be used.
36
+ */
37
+ get hasNo999SecurityFunction() {
38
+ return this.tanMethods.length > 0 && !this.tanMethods.some((method) => method.securityFunction === "999");
39
+ }
40
+ /**
41
+ * Use security profile version 2 if the server supports it.
42
+ * Will be `1` or `2`, depending on the server's capabilities.
43
+ */
44
+ get profileVersion() {
45
+ return this.hasNo999SecurityFunction ? 2 : 1;
46
+ }
47
+ /**
48
+ * Determines the security function to use. Will default to the first one if the "999" security function is
49
+ * unavailable.
50
+ */
51
+ get securityFunction() {
52
+ return this.hasNo999SecurityFunction ? this.tanMethods[0].securityFunction : "999";
53
+ }
54
+ /**
55
+ * Returns the total number of segments in this request, including all header meta segments.
56
+ */
57
+ get segmentCount() {
58
+ // Add `3` because of:
59
+ // - Not zero-based (0)
60
+ // - HNHBK (1)
61
+ // - HNSHK (2)
62
+ return this.segments.length + 3;
63
+ }
64
+ /**
65
+ * An array of all segments, including the HNVSD segment wrapping the user payload segments.
66
+ */
67
+ get fullSegments() {
68
+ const { dialogId, secRef, blz, name, systemId, profileVersion, segmentCount, msgNo, pin, tan, securityFunction, } = this;
69
+ const segmentsWithoutHeader = [
70
+ new segments_1.HNVSK({ segNo: 998, blz, name, systemId, profileVersion }),
71
+ new segments_1.HNVSD({
72
+ segNo: 999,
73
+ segments: [
74
+ new segments_1.HNSHK({ segNo: 2, secRef, blz, name, systemId, profileVersion, securityFunction }),
75
+ ...this.segments,
76
+ new segments_1.HNSHA({ segNo: segmentCount, secRef, pin, tan }),
77
+ ],
78
+ }),
79
+ // Add `1` to the index because of HNSHA.
80
+ new segments_1.HNHBS({ segNo: segmentCount + 1, msgNo }),
81
+ ];
82
+ let length = segmentsWithoutHeader.reduce((result, segment) => result + String(segment).length, 0) +
83
+ constants_1.HEADER_LENGTH +
84
+ dialogId.length +
85
+ String(msgNo).length;
86
+ return [new segments_1.HNHBK({ segNo: 1, msgLength: length, dialogId, msgNo }), ...segmentsWithoutHeader];
87
+ }
88
+ /**
89
+ * Generate a textual representation for debug purposes.
90
+ */
91
+ get debugString() {
92
+ return this.segments.map((segment) => segment.debugString).join("\n");
93
+ }
94
+ /**
95
+ * Serialize the whole request into a string that can be sent to the server.
96
+ */
97
+ toString() {
98
+ return this.fullSegments.map((segment) => String(segment)).join("");
99
+ }
100
+ }
101
+ exports.Request = Request;
102
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../src/request.ts"],"names":[],"mappings":";;;AAAA,yCAA+E;AAE/E,2CAA4C;AAE5C;;GAEG;AACH,MAAa,aAAa;IAA1B;QAgCI;;WAEG;QACI,eAAU,GAAgB,EAAE,CAAC;QACpC;;WAEG;QACI,aAAQ,GAAmB,EAAE,CAAC;IACzC,CAAC;CAAA;AAxCD,sCAwCC;AAED;;;GAGG;AACH,MAAa,OAAQ,SAAQ,aAAa;IAQtC,YAAY,MAA8B;QACtC,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC5B,0BAA0B;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;OAGG;IACH,IAAY,wBAAwB;QAChC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,KAAK,KAAK,CAAC,CAAC;IAC9G,CAAC;IAED;;;OAGG;IACH,IAAY,cAAc;QACtB,OAAO,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAED;;;OAGG;IACH,IA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AAC,MAAM,EAAE,CAAC,CAAC;YACrF,yBAAa;YACb,QAAQ,CAAC,MAAM;YACf,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC;QACzB,OAAO,CAAC,IAAI,gBAAK,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,qBAAqB,CAAC,CAAC;IACnG,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1E,CAAC;IAED;;OAEG;IACI,QAAQ;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACxE,CAAC;CACJ;AArGD,0BAqGC"}
@@ -0,0 +1,104 @@
1
+ import { Segment, HIRMS, HIRMG } from "./segments";
2
+ import { Constructable } from "./types";
3
+ import { ReturnValue } from "./return-value";
4
+ import { Request } from "./request";
5
+ import { TanMethod } from "./tan-method";
6
+ /**
7
+ * A wrapper class for on-demand parsing a response received from the server.
8
+ */
9
+ export declare class Response {
10
+ /**
11
+ * A list of all segments with all data groups with all data elements.
12
+ */
13
+ private segmentStrings;
14
+ constructor(data: string);
15
+ /**
16
+ * Find all segments with the specified segment class.
17
+ *
18
+ * @param segmentClass A segment's class. The response should be searched for all segments with a matching type.
19
+ *
20
+ * @return An array of all matching segments. Can be empty if no segements matched the specified type.
21
+ */
22
+ findSegments<T extends Segment<any>>(segmentClass: Constructable<T>): T[];
23
+ /**
24
+ * Find the first segment with the specified segment class.
25
+ *
26
+ * @param segmentClass A segment's class. The response should be searched for a segments with a matching type.
27
+ *
28
+ * @return The deserialized matching segment. Can be `undefined` if no segement matched the specified type.
29
+ */
30
+ findSegment<T extends Segment<any>>(segmentClass: Constructable<T>): T;
31
+ /**
32
+ * Will be true if the request this response references was a success and no errors were found.
33
+ * Responses containing warnings will always be treated as being successfully.
34
+ */
35
+ get success(): boolean;
36
+ /**
37
+ * An array with all error messages received from the server.
38
+ */
39
+ get errors(): string[];
40
+ /**
41
+ * Shorthand for extracting the dialog's id from the HNHBK segment.
42
+ * If no HNHBK segment was found, an error will be thrown.
43
+ */
44
+ get dialogId(): string;
45
+ /**
46
+ * Shorthand for retrieving the bank's name from the HIBPA segment.
47
+ * Will return `undefined` if no HIBPA segment was found.
48
+ */
49
+ get bankName(): string;
50
+ /**
51
+ * Shorthand for extracting the system's id from the HISYN segment.
52
+ * If no HISYN segment was found, an error will be thrown.
53
+ */
54
+ get systemId(): string;
55
+ /**
56
+ * Will return a set of return values from either only HIRMG or HIRMS segments or both.
57
+ * A return value is a set of a return code identifying it as well as a human readable message.
58
+ *
59
+ * @param segmentClasses Either HIRMG, HIRMS or both. Denotes which segment's return values should be processed.
60
+ *
61
+ * @return A map of (code -> return value).
62
+ */
63
+ returnValues(...segmentClasses: Constructable<HIRMG | HIRMS>[]): Map<string, ReturnValue>;
64
+ /**
65
+ * Will assemble a list of all supported TAN methods.
66
+ */
67
+ get supportedTanMethods(): TanMethod[];
68
+ /**
69
+ * Will assemble a list of all supported SEPA pain-message formats.
70
+ */
71
+ get painFormats(): string[];
72
+ /**
73
+ * Segments can reference each other.
74
+ * Will find the segment of the specified class referencing the specified segment.
75
+ *
76
+ * @param segmentClass Ignore all sections except for segments of this type.
77
+ * @param segment Find the segment in the current message that references the segment specified in this parameter.
78
+ *
79
+ * @return All segments of the specified type that reference the provided segment. Might be an empty array.
80
+ */
81
+ findSegmentForReference<T extends Segment<any>>(segmentClass: Constructable<T>, segment: Segment<any>): T;
82
+ /**
83
+ * Returns touchdowns contained in this message. Touchdowns are used for listing statements if the statement list
84
+ * needed to be split into multiple requests.
85
+ * The touchdowns are used for identifying from what request the list of statement was continued in this response.
86
+ *
87
+ * @param request The request for which the touchdown should be found.
88
+ *
89
+ * @return A map of (segment type -> touchdown identifier).
90
+ */
91
+ getTouchdowns(request: Request): Map<string, string>;
92
+ /**
93
+ * Will return the maximum version for the specified segment type in this message.
94
+ *
95
+ * @param segment The class of segments for which the maximum version should be found.
96
+ *
97
+ * @return The maximum version of the specified segment class version, or `0` if no segment was found.
98
+ */
99
+ segmentMaxVersion(segment: Constructable<Segment<any>>): number;
100
+ /**
101
+ * Generate a textual representation for debug purposes.
102
+ */
103
+ get debugString(): string;
104
+ }
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Response = void 0;
4
+ const segments_1 = require("./segments");
5
+ const utils_1 = require("./utils");
6
+ /**
7
+ * A wrapper class for on-demand parsing a response received from the server.
8
+ */
9
+ class Response {
10
+ constructor(data) {
11
+ this.segmentStrings = (0, utils_1.parse)(data);
12
+ const hnvsd = this.findSegment(segments_1.HNVSD);
13
+ if (hnvsd) {
14
+ this.segmentStrings.push(...hnvsd.rawSegments);
15
+ }
16
+ }
17
+ /**
18
+ * Find all segments with the specified segment class.
19
+ *
20
+ * @param segmentClass A segment's class. The response should be searched for all segments with a matching type.
21
+ *
22
+ * @return An array of all matching segments. Can be empty if no segements matched the specified type.
23
+ */
24
+ findSegments(segmentClass) {
25
+ const matchingStrings = this.segmentStrings.filter((str) => str[0][0] === segmentClass.name);
26
+ return matchingStrings.map((segmentString) => {
27
+ const segment = new segmentClass(segmentString);
28
+ if (segment.type !== segmentClass.name) {
29
+ throw new Error(`Consistency check failed. Deserializing ${segmentClass.name} returned ${segment.type}.`);
30
+ }
31
+ return segment;
32
+ });
33
+ }
34
+ /**
35
+ * Find the first segment with the specified segment class.
36
+ *
37
+ * @param segmentClass A segment's class. The response should be searched for a segments with a matching type.
38
+ *
39
+ * @return The deserialized matching segment. Can be `undefined` if no segement matched the specified type.
40
+ */
41
+ findSegment(segmentClass) {
42
+ const segments = this.findSegments(segmentClass);
43
+ return segments[0];
44
+ }
45
+ /**
46
+ * Will be true if the request this response references was a success and no errors were found.
47
+ * Responses containing warnings will always be treated as being successfully.
48
+ */
49
+ get success() {
50
+ return !Array.from(this.returnValues().values()).some((value) => value.error);
51
+ }
52
+ /**
53
+ * An array with all error messages received from the server.
54
+ */
55
+ get errors() {
56
+ return Array.from(this.returnValues().values())
57
+ .filter((value) => value.error)
58
+ .map((value) => `${value.code} ${value.message}`);
59
+ }
60
+ /**
61
+ * Shorthand for extracting the dialog's id from the HNHBK segment.
62
+ * If no HNHBK segment was found, an error will be thrown.
63
+ */
64
+ get dialogId() {
65
+ const segment = this.findSegment(segments_1.HNHBK);
66
+ if (!segment) {
67
+ throw new Error('Invalid response. Missing "HNHBK" segment.');
68
+ }
69
+ return segment.dialogId;
70
+ }
71
+ /**
72
+ * Shorthand for retrieving the bank's name from the HIBPA segment.
73
+ * Will return `undefined` if no HIBPA segment was found.
74
+ */
75
+ get bankName() {
76
+ const segment = this.findSegment(segments_1.HIBPA);
77
+ if (segment) {
78
+ return segment.bankName;
79
+ }
80
+ return undefined;
81
+ }
82
+ /**
83
+ * Shorthand for extracting the system's id from the HISYN segment.
84
+ * If no HISYN segment was found, an error will be thrown.
85
+ */
86
+ get systemId() {
87
+ const segment = this.findSegment(segments_1.HISYN);
88
+ if (!segment) {
89
+ throw new Error("Invalid response. Could not find system id.");
90
+ }
91
+ return segment.systemId;
92
+ }
93
+ /**
94
+ * Will return a set of return values from either only HIRMG or HIRMS segments or both.
95
+ * A return value is a set of a return code identifying it as well as a human readable message.
96
+ *
97
+ * @param segmentClasses Either HIRMG, HIRMS or both. Denotes which segment's return values should be processed.
98
+ *
99
+ * @return A map of (code -> return value).
100
+ */
101
+ returnValues(...segmentClasses) {
102
+ const classes = segmentClasses.length === 0 ? [segments_1.HIRMG, segments_1.HIRMS] : segmentClasses;
103
+ return classes.reduce((result, currentClass) => {
104
+ const segment = this.findSegment(currentClass);
105
+ if (!segment) {
106
+ return result;
107
+ }
108
+ segment.returnValues.forEach((value, key) => result.set(key, value));
109
+ return result;
110
+ }, new Map());
111
+ }
112
+ /**
113
+ * Will assemble a list of all supported TAN methods.
114
+ */
115
+ get supportedTanMethods() {
116
+ const hirms = this.findSegments(segments_1.HIRMS).find((segment) => segment.returnValues.has("3920"));
117
+ const securityFunctions = hirms.returnValues.get("3920").parameters;
118
+ const tanSegments = this.findSegments(segments_1.HITANS);
119
+ return tanSegments.reduce((result, segment) => {
120
+ segment.tanMethods.forEach((tanMethod) => {
121
+ if (securityFunctions.includes(tanMethod.securityFunction)) {
122
+ result.push(tanMethod);
123
+ }
124
+ });
125
+ return result;
126
+ }, []);
127
+ }
128
+ /**
129
+ * Will assemble a list of all supported SEPA pain-message formats.
130
+ */
131
+ get painFormats() {
132
+ return this.findSegment(segments_1.HISPAS).painFormats;
133
+ }
134
+ /**
135
+ * Segments can reference each other.
136
+ * Will find the segment of the specified class referencing the specified segment.
137
+ *
138
+ * @param segmentClass Ignore all sections except for segments of this type.
139
+ * @param segment Find the segment in the current message that references the segment specified in this parameter.
140
+ *
141
+ * @return All segments of the specified type that reference the provided segment. Might be an empty array.
142
+ */
143
+ findSegmentForReference(segmentClass, segment) {
144
+ return this.findSegments(segmentClass).find((current) => current.reference === segment.segNo);
145
+ }
146
+ /**
147
+ * Returns touchdowns contained in this message. Touchdowns are used for listing statements if the statement list
148
+ * needed to be split into multiple requests.
149
+ * The touchdowns are used for identifying from what request the list of statement was continued in this response.
150
+ *
151
+ * @param request The request for which the touchdown should be found.
152
+ *
153
+ * @return A map of (segment type -> touchdown identifier).
154
+ */
155
+ getTouchdowns(request) {
156
+ return request.segments.reduce((result, requestSegment) => {
157
+ const segment = this.findSegmentForReference(segments_1.HIRMS, requestSegment);
158
+ if (segment) {
159
+ const returnValue = segment.returnValues.get("3040");
160
+ if (returnValue) {
161
+ result.set(requestSegment.type, returnValue.parameters[0]);
162
+ }
163
+ }
164
+ return result;
165
+ }, new Map());
166
+ }
167
+ /**
168
+ * Will return the maximum version for the specified segment type in this message.
169
+ *
170
+ * @param segment The class of segments for which the maximum version should be found.
171
+ *
172
+ * @return The maximum version of the specified segment class version, or `0` if no segment was found.
173
+ */
174
+ segmentMaxVersion(segment) {
175
+ return this.findSegments(segment).reduce((max, current) => (current.version > max ? current.version : max), 0);
176
+ }
177
+ /**
178
+ * Generate a textual representation for debug purposes.
179
+ */
180
+ get debugString() {
181
+ return this.segmentStrings
182
+ .map((segmentString) => {
183
+ const split = segmentString;
184
+ return (`Type: ${split[0][0]}\n` +
185
+ `Version: ${split[0][2]}\n` +
186
+ `Segment Number: ${split[0][1]}\n` +
187
+ `Referencing: ${split[0].length <= 3 ? "None" : split[0][3]}\n` +
188
+ `----\n` +
189
+ split.slice(1).reduce((result, group, index) => {
190
+ return result + `DG ${index}: ${Array.isArray(group) ? group.join(", ") : group}\n`;
191
+ }, ""));
192
+ })
193
+ .join("\n");
194
+ }
195
+ }
196
+ exports.Response = Response;
197
+ //# sourceMappingURL=response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":";;;AAAA,yCAA+F;AAI/F,mCAAgC;AAGhC;;GAEG;AACH,MAAa,QAAQ;IAMjB,YAAY,IAAY;QACpB,IAAI,CAAC,cAAc,GAAG,IAAA,aAAK,EAAC,IAAI,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,gBAAK,CAAC,CAAC;QACtC,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACI,YAAY,CAAyB,YAA8B;QACtE,MAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC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,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;oBAC3C,OAAO,MAAM,GAAG,MAAM,KAAK,KAAK,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;gBACxF,CAAC,EAAE,EAAE,CAAC,CACT,CAAC;QACN,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;CACJ;AAjND,4BAiNC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Wraps a return value used in the HIRMG and HIRMS segments.
3
+ */
4
+ export declare class ReturnValue {
5
+ /**
6
+ * The return value's code.
7
+ * Identifies the purpose of the return value and also specifies whether it's a notification of succes,
8
+ * a warning or an error.
9
+ */
10
+ code: string;
11
+ /**
12
+ * A human readable message.
13
+ */
14
+ message: string;
15
+ /**
16
+ * Arbitrary parameters.
17
+ */
18
+ parameters: string[];
19
+ /**
20
+ * A return value might reference a set of certain segments of a referenced request, for example if it
21
+ * was a warning or an error in a HIRMS segment.
22
+ */
23
+ references: number[];
24
+ constructor(props: Partial<ReturnValue>);
25
+ /**
26
+ * Will be `true` if the return value was a successful one (code starts with "0").
27
+ */
28
+ get success(): boolean;
29
+ /**
30
+ * Will be `true` if the return value was warning (code starts with "3").
31
+ */
32
+ get warning(): boolean;
33
+ /**
34
+ * Will be `true` if the return value was an error (code starts with "9").
35
+ */
36
+ get error(): boolean;
37
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReturnValue = void 0;
4
+ /**
5
+ * Wraps a return value used in the HIRMG and HIRMS segments.
6
+ */
7
+ class ReturnValue {
8
+ constructor(props) {
9
+ Object.assign(this, props);
10
+ }
11
+ /**
12
+ * Will be `true` if the return value was a successful one (code starts with "0").
13
+ */
14
+ get success() {
15
+ return String(this.code).startsWith("0");
16
+ }
17
+ /**
18
+ * Will be `true` if the return value was warning (code starts with "3").
19
+ */
20
+ get warning() {
21
+ return String(this.code).startsWith("3");
22
+ }
23
+ /**
24
+ * Will be `true` if the return value was an error (code starts with "9").
25
+ */
26
+ get error() {
27
+ return String(this.code).startsWith("9");
28
+ }
29
+ }
30
+ exports.ReturnValue = ReturnValue;
31
+ //# sourceMappingURL=return-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"return-value.js","sourceRoot":"","sources":["../src/return-value.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,WAAW;IAqBpB,YAAY,KAA2B;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD;;OAEG;IACH,IAAW,OAAO;QACd,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;IACD;;OAEG;IACH,IAAW,KAAK;QACZ,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACJ;AA3CD,kCA2CC"}
@@ -0,0 +1,22 @@
1
+ export declare class HIBPAProps {
2
+ segNo: number;
3
+ bpdVersion: number;
4
+ countryCode: number;
5
+ blz: string;
6
+ bankName: string;
7
+ transactionTypeCount: number;
8
+ supportedLanguages: number[];
9
+ supportedHbciVersions: number[];
10
+ }
11
+ declare const HIBPA_base: import("..").Constructable<HIBPAProps & import("./segment").Segment<HIBPAProps>>;
12
+ /**
13
+ * HIBPA (Bankparameter allgemein)
14
+ * Section D.2
15
+ */
16
+ export declare class HIBPA extends HIBPA_base {
17
+ type: string;
18
+ protected defaults(): void;
19
+ protected serialize(): string[][];
20
+ protected deserialize(input: string[][]): void;
21
+ }
22
+ export {};
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HIBPA = exports.HIBPAProps = void 0;
4
+ const parse_1 = require("../parse");
5
+ const segment_1 = require("./segment");
6
+ class HIBPAProps {
7
+ }
8
+ exports.HIBPAProps = HIBPAProps;
9
+ /**
10
+ * HIBPA (Bankparameter allgemein)
11
+ * Section D.2
12
+ */
13
+ class HIBPA extends (0, segment_1.SegmentClass)(HIBPAProps) {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.type = "HIBPA";
17
+ }
18
+ defaults() {
19
+ this.version = 3;
20
+ }
21
+ serialize() {
22
+ throw new Error("Not implemented.");
23
+ }
24
+ deserialize(input) {
25
+ const [[bpdVersion], [countryCode, blz], [bankName], [transactionTypeCount], supportedLanguages, supportedHbciVersions,] = input;
26
+ this.bpdVersion = parse_1.Parse.num(bpdVersion);
27
+ this.countryCode = parse_1.Parse.num(countryCode);
28
+ this.blz = blz;
29
+ this.bankName = bankName;
30
+ this.transactionTypeCount = parse_1.Parse.num(transactionTypeCount);
31
+ this.supportedLanguages = supportedLanguages.map(parse_1.Parse.num);
32
+ this.supportedHbciVersions = supportedHbciVersions.map(parse_1.Parse.num);
33
+ }
34
+ }
35
+ exports.HIBPA = HIBPA;
36
+ //# sourceMappingURL=hibpa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hibpa.js","sourceRoot":"","sources":["../../src/segments/hibpa.ts"],"names":[],"mappings":";;;AAAA,oCAAiC;AACjC,uCAAyC;AAEzC,MAAa,UAAU;CAStB;AATD,gCASC;AAED;;;GAGG;AACH,MAAa,KAAM,SAAQ,IAAA,sBAAY,EAAC,UAAU,CAAC;IAAnD;;QACW,SAAI,GAAG,OAAO,CAAC;IA2B1B,CAAC;IAzBa,QAAQ;QACd,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAES,SAAS;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAES,WAAW,CAAC,KAAiB;QACnC,MAAM,CACF,CAAC,UAAU,CAAC,EACZ,CAAC,WAAW,EAAE,GAAG,CAAC,EAClB,CAAC,QAAQ,CAAC,EACV,CAAC,oBAAoB,CAAC,EACtB,kBAAkB,EAClB,qBAAqB,EACxB,GAAG,KAAK,CAAC;QACV,IAAI,CAAC,UAAU,GAAG,aAAK,CAAC,GAAG,CAAC,UAAoB,CAAC,CAAC;QAClD,IAAI,CAAC,WAAW,GAAG,aAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC1C,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,QAAQ,GAAG,QAAkB,CAAC;QACnC,IAAI,CAAC,oBAAoB,GAAG,aAAK,CAAC,GAAG,CAAC,oBAA8B,CAAC,CAAC;QACtE,IAAI,CAAC,kBAAkB,GAAG,kBAAkB,CAAC,GAAG,CAAC,aAAK,CAAC,GAAG,CAAC,CAAC;QAC5D,IAAI,CAAC,qBAAqB,GAAG,qBAAqB,CAAC,GAAG,CAAC,aAAK,CAAC,GAAG,CAAC,CAAC;IACtE,CAAC;CACJ;AA5BD,sBA4BC"}
@@ -0,0 +1,14 @@
1
+ export declare class HICCSProps {
2
+ segNo: number;
3
+ taskId?: string;
4
+ }
5
+ declare const HICCS_base: import("..").Constructable<HICCSProps & import("./segment").Segment<HICCSProps>>;
6
+ /**
7
+ * HICCS (SEPA credit transfer acknowledgement)
8
+ */
9
+ export declare class HICCS extends HICCS_base {
10
+ type: string;
11
+ protected serialize(): string[][];
12
+ protected deserialize(input: string[][]): void;
13
+ }
14
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HICCS = exports.HICCSProps = void 0;
4
+ const segment_1 = require("./segment");
5
+ class HICCSProps {
6
+ }
7
+ exports.HICCSProps = HICCSProps;
8
+ /**
9
+ * HICCS (SEPA credit transfer acknowledgement)
10
+ */
11
+ class HICCS extends (0, segment_1.SegmentClass)(HICCSProps) {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.type = "HICCS";
15
+ }
16
+ serialize() {
17
+ throw new Error("Not implemented.");
18
+ }
19
+ deserialize(input) {
20
+ if (input.length === 0) {
21
+ return;
22
+ }
23
+ const [[taskId = ""] = []] = input;
24
+ this.taskId = taskId || undefined;
25
+ }
26
+ }
27
+ exports.HICCS = HICCS;
28
+ //# sourceMappingURL=hiccs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hiccs.js","sourceRoot":"","sources":["../../src/segments/hiccs.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAEzC,MAAa,UAAU;CAGtB;AAHD,gCAGC;AAED;;GAEG;AACH,MAAa,KAAM,SAAQ,IAAA,sBAAY,EAAC,UAAU,CAAC;IAAnD;;QACW,SAAI,GAAG,OAAO,CAAC;IAa1B,CAAC;IAXa,SAAS;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAES,WAAW,CAAC,KAAiB;QACnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO;QACX,CAAC;QACD,MAAM,CAAC,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,KAAK,CAAC;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,SAAS,CAAC;IACtC,CAAC;CACJ;AAdD,sBAcC"}
@@ -0,0 +1,13 @@
1
+ export declare class HICCSSProps {
2
+ segNo: number;
3
+ }
4
+ declare const HICCSS_base: import("..").Constructable<HICCSSProps & import("./segment").Segment<HICCSSProps>>;
5
+ /**
6
+ * HICCSS (SEPA credit transfer parameters)
7
+ */
8
+ export declare class HICCSS extends HICCSS_base {
9
+ type: string;
10
+ protected serialize(): string[][];
11
+ protected deserialize(): void;
12
+ }
13
+ export {};
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HICCSS = exports.HICCSSProps = void 0;
4
+ const segment_1 = require("./segment");
5
+ class HICCSSProps {
6
+ }
7
+ exports.HICCSSProps = HICCSSProps;
8
+ /**
9
+ * HICCSS (SEPA credit transfer parameters)
10
+ */
11
+ class HICCSS extends (0, segment_1.SegmentClass)(HICCSSProps) {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.type = "HICCSS";
15
+ }
16
+ serialize() {
17
+ throw new Error("Not implemented.");
18
+ }
19
+ deserialize() {
20
+ return;
21
+ }
22
+ }
23
+ exports.HICCSS = HICCSS;
24
+ //# sourceMappingURL=hiccss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hiccss.js","sourceRoot":"","sources":["../../src/segments/hiccss.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAEzC,MAAa,WAAW;CAEvB;AAFD,kCAEC;AAED;;GAEG;AACH,MAAa,MAAO,SAAQ,IAAA,sBAAY,EAAC,WAAW,CAAC;IAArD;;QACW,SAAI,GAAG,QAAQ,CAAC;IAS3B,CAAC;IAPa,SAAS;QACf,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;IAES,WAAW;QACjB,OAAO;IACX,CAAC;CACJ;AAVD,wBAUC"}
@@ -0,0 +1,17 @@
1
+ import { StandingOrder } from "../types";
2
+ export declare class HICDBProps {
3
+ segNo: number;
4
+ standingOrder: StandingOrder;
5
+ }
6
+ declare const HICDB_base: import("../types").Constructable<HICDBProps & import("./segment").Segment<HICDBProps>>;
7
+ /**
8
+ * HICDB (SEPA-Dauerauftragsbestand rückmelden)
9
+ * Section C.10.2.3.4
10
+ */
11
+ export declare class HICDB extends HICDB_base {
12
+ type: string;
13
+ protected serialize(): string[][];
14
+ protected deserialize(input: string[][]): void;
15
+ private isDocument;
16
+ }
17
+ export {};