@pax2pay/model-banking 0.0.35 → 0.0.36
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,21 +14,19 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
14
14
|
}
|
|
15
15
|
async list(
|
|
16
16
|
account?: string,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
search?: {
|
|
18
|
+
currency?: string
|
|
19
|
+
status?: string
|
|
20
|
+
start?: string
|
|
21
|
+
end?: string
|
|
22
|
+
}
|
|
20
23
|
): Promise<Transaction[] | gracely.Error> {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
? `?currency=${currency}&end=${end}`
|
|
28
|
-
: currency
|
|
29
|
-
? `?currency=${currency}`
|
|
30
|
-
: ""
|
|
31
|
-
const path = account ? `/account/${account}/transaction` : `/transaction${search}`
|
|
24
|
+
const query = search
|
|
25
|
+
? Object.entries(search)
|
|
26
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
27
|
+
.reduce((prev, curr, i) => `${prev}${i == 0 ? "?" : "&"}${curr}`, "")
|
|
28
|
+
: ""
|
|
29
|
+
const path = account ? `/account/${account}/transaction` : `/transaction${query}`
|
|
32
30
|
return this.client.get<Transaction[]>(path)
|
|
33
31
|
}
|
|
34
32
|
}
|
|
@@ -7,5 +7,10 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
|
|
|
7
7
|
readonly Notes: Notes;
|
|
8
8
|
constructor(client: http.Client);
|
|
9
9
|
create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error>;
|
|
10
|
-
list(account?: string,
|
|
10
|
+
list(account?: string, search?: {
|
|
11
|
+
currency?: string;
|
|
12
|
+
status?: string;
|
|
13
|
+
start?: string;
|
|
14
|
+
end?: string;
|
|
15
|
+
}): Promise<Transaction[] | gracely.Error>;
|
|
11
16
|
}
|
|
@@ -8,17 +8,13 @@ export class Transactions extends rest.Collection {
|
|
|
8
8
|
async create(account, transaction) {
|
|
9
9
|
return this.client.post(`/account/${account}/transaction`, transaction);
|
|
10
10
|
}
|
|
11
|
-
async list(account,
|
|
12
|
-
const
|
|
13
|
-
?
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
: currency
|
|
19
|
-
? `?currency=${currency}`
|
|
20
|
-
: "";
|
|
21
|
-
const path = account ? `/account/${account}/transaction` : `/transaction${search}`;
|
|
11
|
+
async list(account, search) {
|
|
12
|
+
const query = search
|
|
13
|
+
? Object.entries(search)
|
|
14
|
+
.map(([k, v]) => `${k}=${v}`)
|
|
15
|
+
.reduce((prev, curr, i) => `${prev}${i == 0 ? "?" : "&"}${curr}`, "")
|
|
16
|
+
: "";
|
|
17
|
+
const path = account ? `/account/${account}/transaction` : `/transaction${query}`;
|
|
22
18
|
return this.client.get(path);
|
|
23
19
|
}
|
|
24
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,CACT,OAAgB,EAChB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":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