@pax2pay/model-banking 0.1.128 → 0.1.129

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.
package/Report/Cell.ts ADDED
@@ -0,0 +1,5 @@
1
+ export namespace Cell {
2
+ export function toCsv(value: number | string | undefined | null): string {
3
+ return `"${value ?? ""}"`
4
+ }
5
+ }
@@ -0,0 +1 @@
1
+ export type Delimiter = "|" | ","
package/Report/Row.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { Cell } from "./Cell"
2
+ import { Delimiter } from "./Delimiter"
3
+ export namespace Row {
4
+ export function toCsv(
5
+ values: (number | string | undefined | null)[],
6
+ delimiter: Delimiter,
7
+ prefix?: number | string | null
8
+ ): string {
9
+ return [...(prefix ? [prefix] : []), ...values].map(v => Cell.toCsv(v)).join(delimiter)
10
+ }
11
+ }
@@ -0,0 +1,22 @@
1
+ import { Cell as ReportCell } from "./Cell"
2
+ import { Delimiter } from "./Delimiter"
3
+ import { Row as ReportRow } from "./Row"
4
+
5
+ export namespace Report {
6
+ export function toCsv(
7
+ header: string[],
8
+ rows: (number | string | undefined | null)[],
9
+ delimiter: Delimiter,
10
+ prefix?: number | string | null
11
+ ): string {
12
+ return [Row.toCsv(header, delimiter), ...(prefix ? rows.map(r => Cell.toCsv(prefix) + delimiter + r) : rows)].join(
13
+ "\n"
14
+ )
15
+ }
16
+ export namespace Cell {
17
+ export const toCsv = ReportCell.toCsv
18
+ }
19
+ export namespace Row {
20
+ export const toCsv = ReportRow.toCsv
21
+ }
22
+ }
@@ -0,0 +1,3 @@
1
+ export declare namespace Cell {
2
+ function toCsv(value: number | string | undefined | null): string;
3
+ }
@@ -0,0 +1,8 @@
1
+ export var Cell;
2
+ (function (Cell) {
3
+ function toCsv(value) {
4
+ return `"${value ?? ""}"`;
5
+ }
6
+ Cell.toCsv = toCsv;
7
+ })(Cell || (Cell = {}));
8
+ //# sourceMappingURL=Cell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cell.js","sourceRoot":"../","sources":["Report/Cell.ts"],"names":[],"mappings":"AAAA,MAAM,KAAW,IAAI,CAIpB;AAJD,WAAiB,IAAI;IACpB,SAAgB,KAAK,CAAC,KAAyC;QAC9D,OAAO,IAAI,KAAK,IAAI,EAAE,GAAG,CAAA;IAC1B,CAAC;IAFe,UAAK,QAEpB,CAAA;AACF,CAAC,EAJgB,IAAI,KAAJ,IAAI,QAIpB"}
@@ -0,0 +1 @@
1
+ export type Delimiter = "|" | ",";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Delimiter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Delimiter.js","sourceRoot":"../","sources":["Report/Delimiter.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ import { Delimiter } from "./Delimiter";
2
+ export declare namespace Row {
3
+ function toCsv(values: (number | string | undefined | null)[], delimiter: Delimiter, prefix?: number | string | null): string;
4
+ }
@@ -0,0 +1,9 @@
1
+ import { Cell } from "./Cell";
2
+ export var Row;
3
+ (function (Row) {
4
+ function toCsv(values, delimiter, prefix) {
5
+ return [...(prefix ? [prefix] : []), ...values].map(v => Cell.toCsv(v)).join(delimiter);
6
+ }
7
+ Row.toCsv = toCsv;
8
+ })(Row || (Row = {}));
9
+ //# sourceMappingURL=Row.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Row.js","sourceRoot":"../","sources":["Report/Row.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,MAAM,KAAW,GAAG,CAQnB;AARD,WAAiB,GAAG;IACnB,SAAgB,KAAK,CACpB,MAA8C,EAC9C,SAAoB,EACpB,MAA+B;QAE/B,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACxF,CAAC;IANe,SAAK,QAMpB,CAAA;AACF,CAAC,EARgB,GAAG,KAAH,GAAG,QAQnB"}
@@ -0,0 +1,12 @@
1
+ import { Cell as ReportCell } from "./Cell";
2
+ import { Delimiter } from "./Delimiter";
3
+ import { Row as ReportRow } from "./Row";
4
+ export declare namespace Report {
5
+ function toCsv(header: string[], rows: (number | string | undefined | null)[], delimiter: Delimiter, prefix?: number | string | null): string;
6
+ namespace Cell {
7
+ const toCsv: typeof ReportCell.toCsv;
8
+ }
9
+ namespace Row {
10
+ const toCsv: typeof ReportRow.toCsv;
11
+ }
12
+ }
@@ -0,0 +1,18 @@
1
+ import { Cell as ReportCell } from "./Cell";
2
+ import { Row as ReportRow } from "./Row";
3
+ export var Report;
4
+ (function (Report) {
5
+ function toCsv(header, rows, delimiter, prefix) {
6
+ return [Row.toCsv(header, delimiter), ...(prefix ? rows.map(r => Cell.toCsv(prefix) + delimiter + r) : rows)].join("\n");
7
+ }
8
+ Report.toCsv = toCsv;
9
+ let Cell;
10
+ (function (Cell) {
11
+ Cell.toCsv = ReportCell.toCsv;
12
+ })(Cell = Report.Cell || (Report.Cell = {}));
13
+ let Row;
14
+ (function (Row) {
15
+ Row.toCsv = ReportRow.toCsv;
16
+ })(Row = Report.Row || (Report.Row = {}));
17
+ })(Report || (Report = {}));
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Report/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,QAAQ,CAAA;AAE3C,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,MAAM,KAAW,MAAM,CAiBtB;AAjBD,WAAiB,MAAM;IACtB,SAAgB,KAAK,CACpB,MAAgB,EAChB,IAA4C,EAC5C,SAAoB,EACpB,MAA+B;QAE/B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CACjH,IAAI,CACJ,CAAA;IACF,CAAC;IATe,YAAK,QASpB,CAAA;IACD,IAAiB,IAAI,CAEpB;IAFD,WAAiB,IAAI;QACP,UAAK,GAAG,UAAU,CAAC,KAAK,CAAA;IACtC,CAAC,EAFgB,IAAI,GAAJ,WAAI,KAAJ,WAAI,QAEpB;IACD,IAAiB,GAAG,CAEnB;IAFD,WAAiB,GAAG;QACN,SAAK,GAAG,SAAS,CAAC,KAAK,CAAA;IACrC,CAAC,EAFgB,GAAG,GAAH,UAAG,KAAH,UAAG,QAEnB;AACF,CAAC,EAjBgB,MAAM,KAAN,MAAM,QAiBtB"}
package/dist/pax2pay.d.ts CHANGED
@@ -18,3 +18,4 @@ export { Authorization } from "./Authorization";
18
18
  export { Identifier } from "./Identifier";
19
19
  export { Amount } from "./Amount";
20
20
  export { Amounts } from "./Amounts";
21
+ export { Report } from "./Report";
package/dist/pax2pay.js CHANGED
@@ -18,4 +18,5 @@ export { Authorization } from "./Authorization";
18
18
  export { Identifier } from "./Identifier";
19
19
  export { Amount } from "./Amount";
20
20
  export { Amounts } from "./Amounts";
21
+ export { Report } from "./Report";
21
22
  //# sourceMappingURL=pax2pay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pax2pay.js","sourceRoot":"../","sources":["pax2pay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,QAAQ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ACvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.128",
3
+ "version": "0.1.129",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
package/pax2pay.ts CHANGED
@@ -18,3 +18,4 @@ export { Authorization } from "./Authorization"
18
18
  export { Identifier } from "./Identifier"
19
19
  export { Amount } from "./Amount"
20
20
  export { Amounts } from "./Amounts"
21
+ export { Report } from "./Report"