@pax2pay/model-banking 0.1.450 → 0.1.452
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.
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly"
|
|
|
3
3
|
import { http } from "cloudly-http"
|
|
4
4
|
import * as rest from "cloudly-rest"
|
|
5
5
|
import { Card } from "../../Card"
|
|
6
|
+
import { Operation } from "../../Operation"
|
|
6
7
|
import { Supplier } from "../../Supplier"
|
|
7
8
|
import { Transaction } from "../../Transaction"
|
|
8
9
|
import { Notes } from "./Notes"
|
|
@@ -26,7 +27,6 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
26
27
|
...(options?.cursor ? { cursor: options.cursor } : {}),
|
|
27
28
|
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
28
29
|
...(options?.dateRange ?? {}),
|
|
29
|
-
detailed: "true",
|
|
30
30
|
})
|
|
31
31
|
.map(([k, v]) => `${k}=${v}`)
|
|
32
32
|
.join("&")
|
|
@@ -38,11 +38,12 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
38
38
|
}
|
|
39
39
|
async fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error> {
|
|
40
40
|
return this.client.get<Transaction>(
|
|
41
|
-
account
|
|
42
|
-
? `/account/${account}/transaction/${transaction}?detailed=true`
|
|
43
|
-
: `/transaction/${transaction}?detailed=true`
|
|
41
|
+
account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`
|
|
44
42
|
)
|
|
45
43
|
}
|
|
44
|
+
async getOperations(transactionId: string): Promise<Operation[] | gracely.Error> {
|
|
45
|
+
return this.client.get<Operation[]>(`/transaction/${transactionId}/operations`)
|
|
46
|
+
}
|
|
46
47
|
async statistics(
|
|
47
48
|
range: isoly.DateRange,
|
|
48
49
|
queries?: { cursor?: string; scheme?: Card.Scheme; supplier?: Supplier; limit?: number }
|
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
|
|
|
3
3
|
import { http } from "cloudly-http";
|
|
4
4
|
import * as rest from "cloudly-rest";
|
|
5
5
|
import { Card } from "../../Card";
|
|
6
|
+
import { Operation } from "../../Operation";
|
|
6
7
|
import { Supplier } from "../../Supplier";
|
|
7
8
|
import { Transaction } from "../../Transaction";
|
|
8
9
|
import { Notes } from "./Notes";
|
|
@@ -20,6 +21,7 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
|
|
|
20
21
|
cursor?: string | undefined;
|
|
21
22
|
}) | gracely.Error>;
|
|
22
23
|
fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
|
|
24
|
+
getOperations(transactionId: string): Promise<Operation[] | gracely.Error>;
|
|
23
25
|
statistics(range: isoly.DateRange, queries?: {
|
|
24
26
|
cursor?: string;
|
|
25
27
|
scheme?: Card.Scheme;
|
|
@@ -14,7 +14,6 @@ export class Transactions extends rest.Collection {
|
|
|
14
14
|
...(options?.cursor ? { cursor: options.cursor } : {}),
|
|
15
15
|
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
16
16
|
...(options?.dateRange ?? {}),
|
|
17
|
-
detailed: "true",
|
|
18
17
|
})
|
|
19
18
|
.map(([k, v]) => `${k}=${v}`)
|
|
20
19
|
.join("&");
|
|
@@ -22,9 +21,10 @@ export class Transactions extends rest.Collection {
|
|
|
22
21
|
return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
|
|
23
22
|
}
|
|
24
23
|
async fetch(transaction, account) {
|
|
25
|
-
return this.client.get(account
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
|
|
25
|
+
}
|
|
26
|
+
async getOperations(transactionId) {
|
|
27
|
+
return this.client.get(`/transaction/${transactionId}/operations`);
|
|
28
28
|
}
|
|
29
29
|
async statistics(range, queries) {
|
|
30
30
|
const query = "?" + http.Search.stringify({ ...queries, ...range });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAKpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,WAAkC;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAc,YAAY,OAAO,cAAc,EAAE,WAAW,CAAC,CAAA;IACrF,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAMV;QACA,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC;YAC5B,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACtD,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YACzG,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CA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