@pax2pay/model-banking 0.0.28 → 0.0.29
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.
|
@@ -12,8 +12,23 @@ export class Transactions extends rest.Collection<gracely.Error> {
|
|
|
12
12
|
async create(account: string, transaction: Transaction.Creatable): Promise<Transaction | gracely.Error> {
|
|
13
13
|
return this.client.post<Transaction>(`/account/${account}/transaction`, transaction)
|
|
14
14
|
}
|
|
15
|
-
async list(
|
|
16
|
-
|
|
15
|
+
async list(
|
|
16
|
+
account?: string,
|
|
17
|
+
currency?: string,
|
|
18
|
+
start?: string,
|
|
19
|
+
end?: string
|
|
20
|
+
): Promise<Transaction[] | gracely.Error> {
|
|
21
|
+
const search =
|
|
22
|
+
currency && start && end
|
|
23
|
+
? `?currency=${currency}&start=${start}&end=${end}`
|
|
24
|
+
: currency && start
|
|
25
|
+
? `?currency=${currency}&start=${start}`
|
|
26
|
+
: currency && end
|
|
27
|
+
? `?currency=${currency}&end=${end}`
|
|
28
|
+
: currency
|
|
29
|
+
? `?currency=${currency}`
|
|
30
|
+
: ""
|
|
31
|
+
const path = account ? `/account/${account}/transaction` : `/transaction${search}`
|
|
17
32
|
return this.client.get<Transaction[]>(path)
|
|
18
33
|
}
|
|
19
34
|
}
|
|
@@ -7,5 +7,5 @@ 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): Promise<Transaction[] | gracely.Error>;
|
|
10
|
+
list(account?: string, currency?: string, start?: string, end?: string): Promise<Transaction[] | gracely.Error>;
|
|
11
11
|
}
|
|
@@ -8,8 +8,17 @@ 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
|
|
11
|
+
async list(account, currency, start, end) {
|
|
12
|
+
const search = currency && start && end
|
|
13
|
+
? `?currency=${currency}&start=${start}&end=${end}`
|
|
14
|
+
: currency && start
|
|
15
|
+
? `?currency=${currency}&start=${start}`
|
|
16
|
+
: currency && end
|
|
17
|
+
? `?currency=${currency}&end=${end}`
|
|
18
|
+
: currency
|
|
19
|
+
? `?currency=${currency}`
|
|
20
|
+
: "";
|
|
21
|
+
const path = account ? `/account/${account}/transaction` : `/transaction${search}`;
|
|
13
22
|
return this.client.get(path);
|
|
14
23
|
}
|
|
15
24
|
}
|
|
@@ -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,
|
|
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,GAA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