@pax2pay/model-banking 0.1.505 → 0.1.507
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/Transactions/index.ts +18 -17
- package/dist/cjs/Client/Transactions/index.d.ts +8 -3
- package/dist/cjs/Client/Transactions/index.js +2 -9
- package/dist/cjs/Client/Transactions/index.js.map +1 -1
- package/dist/mjs/Client/Transactions/index.d.ts +8 -3
- package/dist/mjs/Client/Transactions/index.js +2 -9
- package/dist/mjs/Client/Transactions/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly"
|
|
|
3
3
|
import { http } from "cloudly-http"
|
|
4
4
|
import { Card } from "../../Card"
|
|
5
5
|
import { Operation } from "../../Operation"
|
|
6
|
+
import { Rail } from "../../Rail"
|
|
6
7
|
import { Rule } from "../../Rule"
|
|
7
8
|
import { Supplier } from "../../Supplier"
|
|
8
9
|
import { Transaction } from "../../Transaction"
|
|
@@ -17,24 +18,24 @@ export class Transactions {
|
|
|
17
18
|
async create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error> {
|
|
18
19
|
return this.client.post<Transaction>(`/account/${account}/transaction`, transaction)
|
|
19
20
|
}
|
|
20
|
-
async list(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
async list(
|
|
22
|
+
options?:
|
|
23
|
+
| {
|
|
24
|
+
account?: string
|
|
25
|
+
limit?: number
|
|
26
|
+
cursor?: string
|
|
27
|
+
start?: isoly.DateTime
|
|
28
|
+
end?: isoly.DateTime
|
|
29
|
+
currency?: string
|
|
30
|
+
organization?: string
|
|
31
|
+
rail?: Rail
|
|
32
|
+
type?: Transaction.Types
|
|
33
|
+
}
|
|
34
|
+
| string
|
|
35
|
+
): Promise<(Transaction[] & { cursor?: string | undefined }) | gracely.Error> {
|
|
36
|
+
const query = !options ? undefined : typeof options == "string" ? options : http.Search.stringify({ ...options })
|
|
35
37
|
return await this.client.get<Transaction[] & { cursor?: string | undefined }>(
|
|
36
|
-
|
|
37
|
-
options?.limit ? { limit: options?.limit.toString() } : {}
|
|
38
|
+
"/transaction" + (query ? "?" + query : "")
|
|
38
39
|
)
|
|
39
40
|
}
|
|
40
41
|
async fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error> {
|
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
|
|
|
3
3
|
import { http } from "cloudly-http";
|
|
4
4
|
import { Card } from "../../Card";
|
|
5
5
|
import { Operation } from "../../Operation";
|
|
6
|
+
import { Rail } from "../../Rail";
|
|
6
7
|
import { Rule } from "../../Rule";
|
|
7
8
|
import { Supplier } from "../../Supplier";
|
|
8
9
|
import { Transaction } from "../../Transaction";
|
|
@@ -16,9 +17,13 @@ export declare class Transactions {
|
|
|
16
17
|
account?: string;
|
|
17
18
|
limit?: number;
|
|
18
19
|
cursor?: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
start?: isoly.DateTime;
|
|
21
|
+
end?: isoly.DateTime;
|
|
22
|
+
currency?: string;
|
|
23
|
+
organization?: string;
|
|
24
|
+
rail?: Rail;
|
|
25
|
+
type?: Transaction.Types;
|
|
26
|
+
} | string): Promise<(Transaction[] & {
|
|
22
27
|
cursor?: string | undefined;
|
|
23
28
|
}) | gracely.Error>;
|
|
24
29
|
fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
|
|
@@ -14,15 +14,8 @@ class Transactions {
|
|
|
14
14
|
return this.client.post(`/account/${account}/transaction`, transaction);
|
|
15
15
|
}
|
|
16
16
|
async list(options) {
|
|
17
|
-
const query =
|
|
18
|
-
|
|
19
|
-
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
20
|
-
...(options?.dateRange ?? {}),
|
|
21
|
-
})
|
|
22
|
-
.map(([k, v]) => `${k}=${v}`)
|
|
23
|
-
.join("&");
|
|
24
|
-
const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`;
|
|
25
|
-
return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
|
|
17
|
+
const query = !options ? undefined : typeof options == "string" ? options : cloudly_http_1.http.Search.stringify({ ...options });
|
|
18
|
+
return await this.client.get("/transaction" + (query ? "?" + query : ""));
|
|
26
19
|
}
|
|
27
20
|
async fetch(transaction, account) {
|
|
28
21
|
return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Client/Transactions/index.ts"],"names":[],"mappings":";;;AAEA,+CAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Client/Transactions/index.ts"],"names":[],"mappings":";;;AAEA,+CAAmC;AAOnC,mCAA+B;AAE/B,MAAa,YAAY;IAEK;IADpB,KAAK,CAAO;IACrB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;QAC/C,IAAI,CAAC,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACpC,CAAC;IAED,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,CACT,OAYS;QAET,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;QACjH,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC3B,cAAc,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAC3C,CAAA;IACF,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,WAAmB,EAAE,OAAgB;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CACrB,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,gBAAgB,WAAW,EAAE,CAAC,CAAC,CAAC,gBAAgB,WAAW,EAAE,CAC1F,CAAA;IACF,CAAC;IACD,KAAK,CAAC,aAAa,CAAC,aAAqB;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,gBAAgB,aAAa,YAAY,CAAC,CAAA;IAC/E,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,aAAqB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,gBAAgB,aAAa,QAAQ,CAAC,CAAA;IAC1E,CAAC;IACD,KAAK,CAAC,UAAU,CACf,KAAsB,EACtB,OAAwF;QAExF,MAAM,KAAK,GAAG,GAAG,GAAG,mBAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAyB,0BAA0B,KAAK,EAAE,CAAC,CAAA;IAClF,CAAC;CACD;AA/CD,oCA+CC"}
|
|
@@ -3,6 +3,7 @@ import { isoly } from "isoly";
|
|
|
3
3
|
import { http } from "cloudly-http";
|
|
4
4
|
import { Card } from "../../Card";
|
|
5
5
|
import { Operation } from "../../Operation";
|
|
6
|
+
import { Rail } from "../../Rail";
|
|
6
7
|
import { Rule } from "../../Rule";
|
|
7
8
|
import { Supplier } from "../../Supplier";
|
|
8
9
|
import { Transaction } from "../../Transaction";
|
|
@@ -16,9 +17,13 @@ export declare class Transactions {
|
|
|
16
17
|
account?: string;
|
|
17
18
|
limit?: number;
|
|
18
19
|
cursor?: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
start?: isoly.DateTime;
|
|
21
|
+
end?: isoly.DateTime;
|
|
22
|
+
currency?: string;
|
|
23
|
+
organization?: string;
|
|
24
|
+
rail?: Rail;
|
|
25
|
+
type?: Transaction.Types;
|
|
26
|
+
} | string): Promise<(Transaction[] & {
|
|
22
27
|
cursor?: string | undefined;
|
|
23
28
|
}) | gracely.Error>;
|
|
24
29
|
fetch(transaction: string, account?: string): Promise<Transaction | gracely.Error>;
|
|
@@ -11,15 +11,8 @@ export class Transactions {
|
|
|
11
11
|
return this.client.post(`/account/${account}/transaction`, transaction);
|
|
12
12
|
}
|
|
13
13
|
async list(options) {
|
|
14
|
-
const query =
|
|
15
|
-
|
|
16
|
-
...(!options?.query ? {} : options?.query == "review" ? { status: "review" } : { order: options?.query }),
|
|
17
|
-
...(options?.dateRange ?? {}),
|
|
18
|
-
})
|
|
19
|
-
.map(([k, v]) => `${k}=${v}`)
|
|
20
|
-
.join("&");
|
|
21
|
-
const path = options?.account ? `/account/${options.account}/transaction` : `/transaction`;
|
|
22
|
-
return await this.client.get(path + (query && "?" + query), options?.limit ? { limit: options?.limit.toString() } : {});
|
|
14
|
+
const query = !options ? undefined : typeof options == "string" ? options : http.Search.stringify({ ...options });
|
|
15
|
+
return await this.client.get("/transaction" + (query ? "?" + query : ""));
|
|
23
16
|
}
|
|
24
17
|
async fetch(transaction, account) {
|
|
25
18
|
return this.client.get(account ? `/account/${account}/transaction/${transaction}` : `/transaction/${transaction}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../Client/Transactions/index.ts"],"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