@pax2pay/model-banking 0.0.17 → 0.0.19

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.
@@ -7,7 +7,8 @@ export class Operations extends rest.Collection<gracely.Error> {
7
7
  constructor(client: http.Client) {
8
8
  super(client)
9
9
  }
10
- async list(realm: string): Promise<Operation[] | gracely.Error> {
11
- return this.client.get<Operation[]>(`/operation/${realm}`)
10
+ async list(realm: string, start?: string, end?: string): Promise<Operation[] | gracely.Error> {
11
+ const search = start && end ? `?start=${start}&end=${end}` : start ? `?start=${start}` : end ? `?end=${end}` : ""
12
+ return this.client.get<Operation[]>(`/operation/${realm}${search}`)
12
13
  }
13
14
  }
@@ -12,7 +12,8 @@ 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(account: string): Promise<Transaction[] | gracely.Error> {
16
- return this.client.get<Transaction[]>(`/account/${account}/transaction`)
15
+ async list(account?: string): Promise<Transaction[] | gracely.Error> {
16
+ const path = account ? `/account/${account}/transaction` : "/transaction"
17
+ return this.client.get<Transaction[]>(path)
17
18
  }
18
19
  }
@@ -4,5 +4,5 @@ import * as rest from "cloudly-rest";
4
4
  import { Operation } from "../Operation";
5
5
  export declare class Operations extends rest.Collection<gracely.Error> {
6
6
  constructor(client: http.Client);
7
- list(realm: string): Promise<Operation[] | gracely.Error>;
7
+ list(realm: string, start?: string, end?: string): Promise<Operation[] | gracely.Error>;
8
8
  }
@@ -3,8 +3,9 @@ export class Operations extends rest.Collection {
3
3
  constructor(client) {
4
4
  super(client);
5
5
  }
6
- async list(realm) {
7
- return this.client.get(`/operation/${realm}`);
6
+ async list(realm, start, end) {
7
+ const search = start && end ? `?start=${start}&end=${end}` : start ? `?start=${start}` : end ? `?end=${end}` : "";
8
+ return this.client.get(`/operation/${realm}${search}`);
8
9
  }
9
10
  }
10
11
  //# sourceMappingURL=Operations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Operations.js","sourceRoot":"../","sources":["Client/Operations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,UAAyB;IAC7D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAa;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,cAAc,KAAK,EAAE,CAAC,CAAA;IAC3D,CAAC;CACD"}
1
+ {"version":3,"file":"Operations.js","sourceRoot":"../","sources":["Client/Operations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,UAAW,SAAQ,IAAI,CAAC,UAAyB;IAC7D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAa,EAAE,KAAc,EAAE,GAAY;QACrD,MAAM,MAAM,GAAG,KAAK,IAAI,GAAG,CAAC,CAAC,CAAC,UAAU,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QACjH,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAc,cAAc,KAAK,GAAG,MAAM,EAAE,CAAC,CAAA;IACpE,CAAC;CACD"}
@@ -7,5 +7,5 @@ export declare class Transactions extends rest.Collection<gracely.Error> {
7
7
  readonly comments: Comments;
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): Promise<Transaction[] | gracely.Error>;
11
11
  }
@@ -9,7 +9,8 @@ export class Transactions extends rest.Collection {
9
9
  return this.client.post(`/account/${account}/transaction`, transaction);
10
10
  }
11
11
  async list(account) {
12
- return this.client.get(`/account/${account}/transaction`);
12
+ const path = account ? `/account/${account}/transaction` : "/transaction";
13
+ return this.client.get(path);
13
14
  }
14
15
  }
15
16
  //# sourceMappingURL=Transactions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Transactions.js","sourceRoot":"../","sources":["Client/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,aAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAG7C,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,OAAe;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,YAAY,OAAO,cAAc,CAAC,CAAA;IACzE,CAAC;CACD"}
1
+ {"version":3,"file":"Transactions.js","sourceRoot":"../","sources":["Client/Transactions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,OAAO,YAAa,SAAQ,IAAI,CAAC,UAAyB;IAE/D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAFL,aAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAG7C,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,OAAgB;QAC1B,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,YAAY,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAA;QACzE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAgB,IAAI,CAAC,CAAA;IAC5C,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",