@pax2pay/model-banking 0.0.46 → 0.0.47
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.
|
@@ -14,18 +14,21 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
14
14
|
}
|
|
15
15
|
async list(options?: {
|
|
16
16
|
account?: string
|
|
17
|
+
limit?: number
|
|
18
|
+
cursor?: string
|
|
17
19
|
status?: "review" | "created" | "approved" | "rejected" | "processing" | "finalized"
|
|
18
20
|
currency?: string
|
|
21
|
+
direction?: "inbound" | "outbound"
|
|
22
|
+
rail?: "internal"
|
|
19
23
|
start?: string
|
|
20
24
|
end?: string
|
|
21
|
-
limit?: number
|
|
22
|
-
cursor?: string
|
|
23
25
|
}): Promise<Transaction[] | gracely.Error> {
|
|
24
|
-
|
|
25
|
-
query
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const searchOptions = options && (({ account, limit, cursor, ...search }) => search)(options)
|
|
27
|
+
const query = searchOptions
|
|
28
|
+
? Object.entries(searchOptions)
|
|
29
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
30
|
+
.reduce((prev, curr, i) => `${prev}${i == 0 ? "?" : "&"}${curr}`, "")
|
|
31
|
+
: ""
|
|
29
32
|
const path = options && options.account ? `/account/${options.account}/transaction${query}` : `/transaction${query}`
|
|
30
33
|
return this.client.get<Transaction[]>(path) //{ limit: options?.limit ? options.limit.toString() : undefined, cursor: options?.cursor, }
|
|
31
34
|
}
|
|
@@ -9,11 +9,13 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
|
|
|
9
9
|
create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error>;
|
|
10
10
|
list(options?: {
|
|
11
11
|
account?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
cursor?: string;
|
|
12
14
|
status?: "review" | "created" | "approved" | "rejected" | "processing" | "finalized";
|
|
13
15
|
currency?: string;
|
|
16
|
+
direction?: "inbound" | "outbound";
|
|
17
|
+
rail?: "internal";
|
|
14
18
|
start?: string;
|
|
15
19
|
end?: string;
|
|
16
|
-
limit?: number;
|
|
17
|
-
cursor?: string;
|
|
18
20
|
}): Promise<Transaction[] | gracely.Error>;
|
|
19
21
|
}
|
|
@@ -9,11 +9,12 @@ export class Transactions extends rest.Collection {
|
|
|
9
9
|
return this.client.post(`/account/${account}/transaction`, transaction);
|
|
10
10
|
}
|
|
11
11
|
async list(options) {
|
|
12
|
-
|
|
13
|
-
query
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const searchOptions = options && (({ account, limit, cursor, ...search }) => search)(options);
|
|
13
|
+
const query = searchOptions
|
|
14
|
+
? Object.entries(searchOptions)
|
|
15
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
16
|
+
.reduce((prev, curr, i) => `${prev}${i == 0 ? "?" : "&"}${curr}`, "")
|
|
17
|
+
: "";
|
|
17
18
|
const path = options && options.account ? `/account/${options.account}/transaction${query}` : `/transaction${query}`;
|
|
18
19
|
return this.client.get(path);
|
|
19
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Transactions/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,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,
|
|
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