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,18 @@
1
+ export declare class HNSHAProps {
2
+ segNo: number;
3
+ secRef: number;
4
+ pin: string;
5
+ tan: string;
6
+ }
7
+ declare const HNSHA_base: import("..").Constructable<HNSHAProps & import("./segment").Segment<HNSHAProps>>;
8
+ /**
9
+ * HNSHA (Signaturabschluss)
10
+ * Section B.5.2
11
+ */
12
+ export declare class HNSHA extends HNSHA_base {
13
+ type: string;
14
+ protected defaults(): void;
15
+ protected serialize(): (string | string[])[];
16
+ protected deserialize(): void;
17
+ }
18
+ export {};
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HNSHA = exports.HNSHAProps = void 0;
4
+ const segment_1 = require("./segment");
5
+ const format_1 = require("../format");
6
+ class HNSHAProps {
7
+ }
8
+ exports.HNSHAProps = HNSHAProps;
9
+ /**
10
+ * HNSHA (Signaturabschluss)
11
+ * Section B.5.2
12
+ */
13
+ class HNSHA extends (0, segment_1.SegmentClass)(HNSHAProps) {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.type = "HNSHA";
17
+ }
18
+ defaults() {
19
+ this.version = 2;
20
+ }
21
+ serialize() {
22
+ const { secRef, pin, tan } = this;
23
+ return [format_1.Format.num(secRef), format_1.Format.empty(), tan ? [pin, tan] : pin];
24
+ }
25
+ deserialize() {
26
+ throw new Error("Not implemented.");
27
+ }
28
+ }
29
+ exports.HNSHA = HNSHA;
30
+ //# sourceMappingURL=hnsha.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hnsha.js","sourceRoot":"","sources":["../../src/segments/hnsha.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AACzC,sCAAmC;AAEnC,MAAa,UAAU;CAKtB;AALD,gCAKC;AAED;;;GAGG;AACH,MAAa,KAAM,SAAQ,IAAA,sBAAY,EAAC,UAAU,CAAC;IAAnD;;QACW,SAAI,GAAG,OAAO,CAAC;IAc1B,CAAC;IAZa,QAAQ;QACd,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAES,SAAS;QACf,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAClC,OAAO,CAAC,eAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,eAAM,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxE,CAAC;IAES,WAAW;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;CACJ;AAfD,sBAeC"}
@@ -0,0 +1,21 @@
1
+ export declare class HNSHKProps {
2
+ segNo: number;
3
+ secRef: number;
4
+ blz: string;
5
+ name: string;
6
+ systemId: string;
7
+ profileVersion: number;
8
+ securityFunction?: string;
9
+ }
10
+ declare const HNSHK_base: import("..").Constructable<HNSHKProps & import("./segment").Segment<HNSHKProps>>;
11
+ /**
12
+ * HNSHK (Signaturkopf)
13
+ * Section B.5.1
14
+ */
15
+ export declare class HNSHK extends HNSHK_base {
16
+ type: string;
17
+ protected defaults(): void;
18
+ protected serialize(): (string | string[])[];
19
+ protected deserialize(): void;
20
+ }
21
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HNSHK = exports.HNSHKProps = void 0;
4
+ const segment_1 = require("./segment");
5
+ const format_1 = require("../format");
6
+ const constants_1 = require("../constants");
7
+ class HNSHKProps {
8
+ }
9
+ exports.HNSHKProps = HNSHKProps;
10
+ /**
11
+ * HNSHK (Signaturkopf)
12
+ * Section B.5.1
13
+ */
14
+ class HNSHK extends (0, segment_1.SegmentClass)(HNSHKProps) {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.type = "HNSHK";
18
+ }
19
+ defaults() {
20
+ this.version = 4;
21
+ this.securityFunction = constants_1.SECURITY_FUNCTION;
22
+ }
23
+ serialize() {
24
+ const { secRef, blz, name, systemId, profileVersion, securityFunction } = this;
25
+ return [
26
+ ["PIN", format_1.Format.num(profileVersion)],
27
+ securityFunction,
28
+ format_1.Format.num(secRef),
29
+ format_1.Format.num(constants_1.SECURITY_BOUNDARY),
30
+ format_1.Format.num(constants_1.SECURITY_SUPPLIER_ROLE),
31
+ [format_1.Format.num(1), format_1.Format.empty(), systemId],
32
+ format_1.Format.num(1),
33
+ [format_1.Format.num(1), format_1.Format.date(), format_1.Format.time()],
34
+ [format_1.Format.num(1), format_1.Format.num(999), format_1.Format.num(1)],
35
+ [format_1.Format.num(6), format_1.Format.num(10), format_1.Format.num(16)],
36
+ [format_1.Format.num(constants_1.COUNTRY_CODE), blz, name, "S", format_1.Format.num(0), format_1.Format.num(0)],
37
+ ];
38
+ }
39
+ deserialize() {
40
+ throw new Error("Not implemented.");
41
+ }
42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,GAAG,CAAC,CAAC,CAAC,EAAE,eAAM,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,eAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAC/C,CAAC,eAAM,CAAC,GAAG,CAAC,wBAAY,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,eAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,eAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SAC3E,CAAC;IACN,CAAC;IAES,WAAW;QACjB,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACxC,CAAC;CACJ;AA5BD,sBA4BC"}
@@ -0,0 +1,25 @@
1
+ import { Segment } from "./segment";
2
+ export declare class HNVSDProps {
3
+ segNo: number;
4
+ /**
5
+ * Only populated by constructor.
6
+ * Deserializing ignores this property.
7
+ */
8
+ segments: Segment<any>[];
9
+ /**
10
+ * Populated when deserializing.
11
+ */
12
+ rawSegments: string[][][];
13
+ }
14
+ declare const HNVSD_base: import("..").Constructable<HNVSDProps & Segment<HNVSDProps>>;
15
+ /**
16
+ * HNVSD (Verschlüsselte Daten)
17
+ * Section B.5.4
18
+ */
19
+ export declare class HNVSD extends HNVSD_base {
20
+ type: string;
21
+ protected defaults(): void;
22
+ protected serialize(): string[];
23
+ protected deserialize(input: string[][]): void;
24
+ }
25
+ export {};
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HNVSD = exports.HNVSDProps = void 0;
4
+ const format_1 = require("../format");
5
+ const utils_1 = require("../utils");
6
+ const segment_1 = require("./segment");
7
+ class HNVSDProps {
8
+ }
9
+ exports.HNVSDProps = HNVSDProps;
10
+ /**
11
+ * HNVSD (Verschlüsselte Daten)
12
+ * Section B.5.4
13
+ */
14
+ class HNVSD extends (0, segment_1.SegmentClass)(HNVSDProps) {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.type = "HNVSD";
18
+ }
19
+ defaults() {
20
+ this.version = 1;
21
+ }
22
+ serialize() {
23
+ return [format_1.Format.stringWithLength(this.segments.map((segment) => String(segment)).join(""))];
24
+ }
25
+ deserialize(input) {
26
+ const [[content]] = input;
27
+ this.rawSegments = (0, utils_1.parse)(content);
28
+ }
29
+ }
30
+ exports.HNVSD = HNVSD;
31
+ //# sourceMappingURL=hnvsd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hnvsd.js","sourceRoot":"","sources":["../../src/segments/hnvsd.ts"],"names":[],"mappings":";;;AAAA,sCAAmC;AACnC,oCAAiC;AACjC,uCAAkD;AAElD,MAAa,UAAU;CAYtB;AAZD,gCAYC;AAED;;;GAGG;AACH,MAAa,KAAM,SAAQ,IAAA,sBAAY,EAAC,UAAU,CAAC;IAAnD;;QACW,SAAI,GAAG,OAAO,CAAC;IAc1B,CAAC;IAZa,QAAQ;QACd,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACrB,CAAC;IAES,SAAS;QACf,OAAO,CAAC,eAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAES,WAAW,CAAC,KAAiB;QACnC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,WAAW,GAAG,IAAA,aAAK,EAAC,OAAO,CAAC,CAAC;IACtC,CAAC;CACJ;AAfD,sBAeC"}
@@ -0,0 +1,15 @@
1
+ export declare class HNVSKProps {
2
+ segNo: number;
3
+ blz: string;
4
+ name: string;
5
+ systemId: string;
6
+ profileVersion: number;
7
+ }
8
+ declare const HNVSK_base: import("..").Constructable<HNVSKProps & import("./segment").Segment<HNVSKProps>>;
9
+ export declare class HNVSK extends HNVSK_base {
10
+ type: string;
11
+ protected defaults(): void;
12
+ protected serialize(): (string | string[])[];
13
+ protected deserialize(input: string[][]): void;
14
+ }
15
+ export {};
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HNVSK = exports.HNVSKProps = void 0;
4
+ const format_1 = require("../format");
5
+ const parse_1 = require("../parse");
6
+ const segment_1 = require("./segment");
7
+ const constants_1 = require("../constants");
8
+ class HNVSKProps {
9
+ }
10
+ exports.HNVSKProps = HNVSKProps;
11
+ class HNVSK extends (0, segment_1.SegmentClass)(HNVSKProps) {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.type = "HNVSK";
15
+ }
16
+ defaults() {
17
+ this.version = 3;
18
+ }
19
+ serialize() {
20
+ const { blz, name, systemId, profileVersion } = this;
21
+ return [
22
+ ["PIN", format_1.Format.num(profileVersion)],
23
+ format_1.Format.num(998),
24
+ format_1.Format.num(constants_1.SECURITY_SUPPLIER_ROLE),
25
+ [format_1.Format.num(1), format_1.Format.empty(), systemId],
26
+ [format_1.Format.num(1), format_1.Format.date(), format_1.Format.time()],
27
+ [
28
+ format_1.Format.num(2),
29
+ format_1.Format.num(2),
30
+ format_1.Format.num(13),
31
+ format_1.Format.stringWithLength("00000000"),
32
+ format_1.Format.num(5),
33
+ format_1.Format.num(1),
34
+ ],
35
+ [format_1.Format.num(constants_1.COUNTRY_CODE), blz, name, "S", format_1.Format.num(0), format_1.Format.num(0)],
36
+ format_1.Format.num(constants_1.COMPRESSION_NONE),
37
+ ];
38
+ }
39
+ deserialize(input) {
40
+ const [[profile, profileVersion]] = input;
41
+ if (profile !== "PIN") {
42
+ throw new Error(`Unsupported profile: ${profile}`);
43
+ }
44
+ this.profileVersion = parse_1.Parse.num(profileVersion);
45
+ this.systemId = input[3][2];
46
+ this.name = input[6][2];
47
+ this.blz = input[6][1];
48
+ }
49
+ }
50
+ exports.HNVSK = HNVSK;
51
+ //# sourceMappingURL=hnvsk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hnvs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C,CAAC;YACxE,eAAM,CAAC,GAAG,CAAC,4BAAgB,CAAC;SAC/B,CAAC;IACN,CAAC;IAES,WAAW,CAAC,KAAiB;QACnC,MAAM,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,GAAG,KAAK,CAAC;QAC1C,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,aAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;CACJ;AAtCD,sBAsCC"}
@@ -0,0 +1,40 @@
1
+ export * from "./hibpa";
2
+ export * from "./hicdb";
3
+ export * from "./hicdbs";
4
+ export * from "./hiccs";
5
+ export * from "./hiccss";
6
+ export * from "./hidse";
7
+ export * from "./hidses";
8
+ export * from "./hiwpd";
9
+ export * from "./hiwpds";
10
+ export * from "./hkdse";
11
+ export * from "./hikaz";
12
+ export * from "./hikazs";
13
+ export * from "./hkccs";
14
+ export * from "./hirmg";
15
+ export * from "./hirms";
16
+ export * from "./hisal";
17
+ export * from "./hisals";
18
+ export * from "./hispa";
19
+ export * from "./hispas";
20
+ export * from "./hisyn";
21
+ export * from "./hitans";
22
+ export * from "./hkcdb";
23
+ export * from "./hkend";
24
+ export * from "./hkidn";
25
+ export * from "./hkkaz";
26
+ export * from "./hkwpd";
27
+ export * from "./hksal";
28
+ export * from "./hkspa";
29
+ export * from "./hksyn";
30
+ export * from "./hktab";
31
+ export * from "./hktan";
32
+ export * from "./hkvvb";
33
+ export * from "./hnhbk";
34
+ export * from "./hnhbs";
35
+ export * from "./hnsha";
36
+ export * from "./hnshk";
37
+ export * from "./hnvsd";
38
+ export * from "./hnvsk";
39
+ export * from "./hiupd";
40
+ export * from "./segment";
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./hibpa"), exports);
18
+ __exportStar(require("./hicdb"), exports);
19
+ __exportStar(require("./hicdbs"), exports);
20
+ __exportStar(require("./hiccs"), exports);
21
+ __exportStar(require("./hiccss"), exports);
22
+ __exportStar(require("./hidse"), exports);
23
+ __exportStar(require("./hidses"), exports);
24
+ __exportStar(require("./hiwpd"), exports);
25
+ __exportStar(require("./hiwpds"), exports);
26
+ __exportStar(require("./hkdse"), exports);
27
+ __exportStar(require("./hikaz"), exports);
28
+ __exportStar(require("./hikazs"), exports);
29
+ __exportStar(require("./hkccs"), exports);
30
+ __exportStar(require("./hirmg"), exports);
31
+ __exportStar(require("./hirms"), exports);
32
+ __exportStar(require("./hisal"), exports);
33
+ __exportStar(require("./hisals"), exports);
34
+ __exportStar(require("./hispa"), exports);
35
+ __exportStar(require("./hispas"), exports);
36
+ __exportStar(require("./hisyn"), exports);
37
+ __exportStar(require("./hitans"), exports);
38
+ __exportStar(require("./hkcdb"), exports);
39
+ __exportStar(require("./hkend"), exports);
40
+ __exportStar(require("./hkidn"), exports);
41
+ __exportStar(require("./hkkaz"), exports);
42
+ __exportStar(require("./hkwpd"), exports);
43
+ __exportStar(require("./hksal"), exports);
44
+ __exportStar(require("./hkspa"), exports);
45
+ __exportStar(require("./hksyn"), exports);
46
+ __exportStar(require("./hktab"), exports);
47
+ __exportStar(require("./hktan"), exports);
48
+ __exportStar(require("./hkvvb"), exports);
49
+ __exportStar(require("./hnhbk"), exports);
50
+ __exportStar(require("./hnhbs"), exports);
51
+ __exportStar(require("./hnsha"), exports);
52
+ __exportStar(require("./hnshk"), exports);
53
+ __exportStar(require("./hnvsd"), exports);
54
+ __exportStar(require("./hnvsk"), exports);
55
+ __exportStar(require("./hiupd"), exports);
56
+ __exportStar(require("./segment"), exports);
57
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/segments/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,4CAA0B"}
@@ -0,0 +1,60 @@
1
+ import { Constructable } from "../types";
2
+ /**
3
+ * Properties passed to a segment.
4
+ * These properties will be used to serialize a segment and are generated when
5
+ * deserializing it.
6
+ */
7
+ export interface SegmentProps {
8
+ segNo: number;
9
+ }
10
+ /**
11
+ * A segment of a message.
12
+ * Each message sent to the server or received from it will consist of multiple segments.
13
+ * Each segment itself is versionized and has a segment type.
14
+ * Segments within a message are numbered.
15
+ */
16
+ export declare abstract class Segment<TProps extends SegmentProps> {
17
+ /**
18
+ * This segment's type.
19
+ */
20
+ abstract type: string;
21
+ /**
22
+ * The version of this segment.
23
+ */
24
+ version: number;
25
+ /**
26
+ * The segments are numbered within a message.
27
+ * This represents the segment's message.
28
+ */
29
+ segNo: number;
30
+ /**
31
+ * Segments can reference other segments.
32
+ * This is the referenced segment's number.
33
+ */
34
+ reference?: number;
35
+ constructor(arg: string | string[][] | TProps);
36
+ /**
37
+ * Serialize this segment into an array of data groups (which is an array of data elements).
38
+ */
39
+ protected abstract serialize(): (string | string[])[];
40
+ /**
41
+ * Deerialize a segment from an array of data groups (which is an array of data elements).
42
+ */
43
+ protected abstract deserialize(input: string[][]): void;
44
+ /**
45
+ * Segments can override this function to provide defaults for their properties.
46
+ */
47
+ protected defaults(): void;
48
+ /**
49
+ * Serialize the segment into a string that can be used for serializing a request.
50
+ */
51
+ toString(): string;
52
+ /**
53
+ * Generate a textual representation for debug purposes.
54
+ */
55
+ get debugString(): string | string[];
56
+ }
57
+ /**
58
+ * Create a base class for segments, inheriting from `Segment` and the segment's props.
59
+ */
60
+ export declare function SegmentClass<TProps extends SegmentProps>(propsClass: Constructable<TProps>): Constructable<TProps & Segment<TProps>>;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Segment = void 0;
4
+ exports.SegmentClass = SegmentClass;
5
+ const parse_1 = require("../parse");
6
+ const utils_1 = require("../utils");
7
+ /**
8
+ * A segment of a message.
9
+ * Each message sent to the server or received from it will consist of multiple segments.
10
+ * Each segment itself is versionized and has a segment type.
11
+ * Segments within a message are numbered.
12
+ */
13
+ class Segment {
14
+ constructor(arg) {
15
+ this.defaults();
16
+ if (typeof arg === "object" && !Array.isArray(arg)) {
17
+ Object.assign(this, arg);
18
+ }
19
+ else {
20
+ const splitted = typeof arg === "string" ? (0, utils_1.parse)(arg)[0] : arg;
21
+ this.segNo = parse_1.Parse.num(splitted[0][1]);
22
+ this.version = parse_1.Parse.num(splitted[0][2]);
23
+ if (splitted[0].length > 3) {
24
+ this.reference = parse_1.Parse.num(splitted[0][3]);
25
+ }
26
+ this.deserialize(splitted.slice(1));
27
+ }
28
+ }
29
+ /**
30
+ * Segments can override this function to provide defaults for their properties.
31
+ */
32
+ defaults() {
33
+ return;
34
+ }
35
+ /**
36
+ * Serialize the segment into a string that can be used for serializing a request.
37
+ */
38
+ toString() {
39
+ const header = `${this.type}:${this.segNo}:${this.version}`;
40
+ const body = this.serialize()
41
+ .map((data) => (Array.isArray(data) ? data.join(":") : data))
42
+ .join("+");
43
+ return `${header}+${body}'`;
44
+ }
45
+ /**
46
+ * Generate a textual representation for debug purposes.
47
+ */
48
+ get debugString() {
49
+ const info = `Type: ${this.type}\n` +
50
+ `Version: ${this.version}\n` +
51
+ `Segment Number: ${this.segNo}\n` +
52
+ `Referencing: ${this.reference === undefined ? "None" : this.reference}\n` +
53
+ `----\n`;
54
+ return this.serialize().reduce((result, group, index) => {
55
+ return `${result}DG ${index}: ${Array.isArray(group) ? group.join(", ") : group}\n`;
56
+ }, info);
57
+ }
58
+ }
59
+ exports.Segment = Segment;
60
+ /**
61
+ * Create a base class for segments, inheriting from `Segment` and the segment's props.
62
+ */
63
+ function SegmentClass(propsClass) {
64
+ class TempSegment extends Segment {
65
+ }
66
+ const mutableClass = TempSegment;
67
+ Object.getOwnPropertyNames(propsClass.prototype)
68
+ .filter((name) => name !== "constructor")
69
+ .forEach((name) => {
70
+ mutableClass.prototype[name] = propsClass.prototype[name];
71
+ });
72
+ return mutableClass;
73
+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IAAI,KAAK,aAAa,CAAC;SACxC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACd,YAAY,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;IAEP,OAAO,YAAY,CAAC;AACxB,CAAC"}
@@ -0,0 +1,36 @@
1
+ export declare const tanMethodArgumentMap: Map<number, string[]>;
2
+ export declare class TanMethod {
3
+ allowedFormat?: string;
4
+ cancellable?: boolean;
5
+ challengeClassRequired?: boolean;
6
+ challengeValueRequired?: boolean;
7
+ challengeStructured?: boolean;
8
+ decoupledAutoConfirmationAllowed?: boolean;
9
+ decoupledManualConfirmationAllowed?: boolean;
10
+ decoupledMaxStatusRequests?: number;
11
+ decoupledWaitBeforeFirstStatusRequest?: number;
12
+ decoupledWaitBetweenStatusRequests?: number;
13
+ descriptionRequired?: string;
14
+ hhdUcRequired?: boolean;
15
+ initializationMode?: string;
16
+ maxLengthInput?: number;
17
+ maxLengthReturnvalue?: number;
18
+ multiple?: boolean;
19
+ name?: string;
20
+ activeTanMedia?: number;
21
+ numberOfSupportedLists?: number;
22
+ principalAccountRequired?: boolean;
23
+ securityFunction?: string;
24
+ smsChargeAccountRequired?: boolean;
25
+ supportedMediaNumber?: number;
26
+ tanListNumberRequired?: boolean;
27
+ tanDialogOptions?: string;
28
+ tanProcess?: string;
29
+ tanTimeDialogAssociation?: string;
30
+ techId?: string;
31
+ textReturnvalue?: string;
32
+ zkaId?: string;
33
+ zkaVersion?: string;
34
+ version?: number;
35
+ constructor(version: number, config?: string[]);
36
+ }