@pax2pay/model-banking 0.1.127 → 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/Client/Treasury.ts +2 -2
- package/Report/Cell.ts +5 -0
- package/Report/Delimiter.ts +1 -0
- package/Report/Row.ts +11 -0
- package/Report/index.ts +22 -0
- package/dist/Client/Treasury.js +3 -2
- package/dist/Client/Treasury.js.map +1 -1
- package/dist/Report/Cell.d.ts +3 -0
- package/dist/Report/Cell.js +8 -0
- package/dist/Report/Cell.js.map +1 -0
- package/dist/Report/Delimiter.d.ts +1 -0
- package/dist/Report/Delimiter.js +2 -0
- package/dist/Report/Delimiter.js.map +1 -0
- package/dist/Report/Row.d.ts +4 -0
- package/dist/Report/Row.js +9 -0
- package/dist/Report/Row.js.map +1 -0
- package/dist/Report/index.d.ts +12 -0
- package/dist/Report/index.js +18 -0
- package/dist/Report/index.js.map +1 -0
- package/dist/pax2pay.d.ts +1 -0
- package/dist/pax2pay.js +1 -0
- package/dist/pax2pay.js.map +1 -1
- package/package.json +1 -1
- package/pax2pay.ts +1 -0
package/Client/Treasury.ts
CHANGED
|
@@ -14,8 +14,8 @@ export class Treasury extends rest.Collection<gracely.Error> {
|
|
|
14
14
|
return this.client.patch(`/treasury/${currency}/fiat`, changes)
|
|
15
15
|
}
|
|
16
16
|
async fetch(hour?: isoly.DateTime): Promise<TreasuryModel | gracely.Error> {
|
|
17
|
-
const
|
|
18
|
-
return this.client.get<TreasuryModel>(`/treasury${
|
|
17
|
+
const path = hour ? `/${isoly.DateTime.truncate(hour, "hours")}` : ""
|
|
18
|
+
return this.client.get<TreasuryModel>(`/treasury${path}`)
|
|
19
19
|
}
|
|
20
20
|
async listTransactions(accountId: string): Promise<TreasuryModel.Transaction[] | gracely.Error> {
|
|
21
21
|
return this.client.get<TreasuryModel.Transaction[]>(`/treasury/account/${accountId}/transaction`)
|
package/Report/Cell.ts
ADDED
|
@@ -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
|
+
}
|
package/Report/index.ts
ADDED
|
@@ -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
|
+
}
|
package/dist/Client/Treasury.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isoly } from "isoly";
|
|
1
2
|
import * as rest from "cloudly-rest";
|
|
2
3
|
export class Treasury extends rest.Collection {
|
|
3
4
|
constructor(client) {
|
|
@@ -7,8 +8,8 @@ export class Treasury extends rest.Collection {
|
|
|
7
8
|
return this.client.patch(`/treasury/${currency}/fiat`, changes);
|
|
8
9
|
}
|
|
9
10
|
async fetch(hour) {
|
|
10
|
-
const
|
|
11
|
-
return this.client.get(`/treasury${
|
|
11
|
+
const path = hour ? `/${isoly.DateTime.truncate(hour, "hours")}` : "";
|
|
12
|
+
return this.client.get(`/treasury${path}`);
|
|
12
13
|
}
|
|
13
14
|
async listTransactions(accountId) {
|
|
14
15
|
return this.client.get(`/treasury/account/${accountId}/transaction`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Client/Treasury.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Treasury.js","sourceRoot":"../","sources":["Client/Treasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAIpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAwB,EAAE,OAAiB;QACvD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,QAAQ,OAAO,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,IAAqB;QAChC,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,YAAY,IAAI,EAAE,CAAC,CAAA;IAC1D,CAAC;IACD,KAAK,CAAC,gBAAgB,CAAC,SAAiB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8B,qBAAqB,SAAS,cAAc,CAAC,CAAA;IAClG,CAAC;CACD"}
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"Delimiter.js","sourceRoot":"../","sources":["Report/Delimiter.ts"],"names":[],"mappings":""}
|
|
@@ -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,IA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