@pax2pay/model-banking 0.0.18 → 0.0.20

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
  }
@@ -3,7 +3,7 @@ import { Balances } from "../Balances"
3
3
 
4
4
  export type Status = "pending" | "success" | "failed" //| "cancelled"
5
5
 
6
- type ChangeType = { type: "add" | "subtract"; amount: number; status: Status }
6
+ type ChangeType = { type: "add" | "subtract"; amount: number; status: Status; result: number }
7
7
  export type Change = Partial<Record<Balances.Entry, ChangeType>>
8
8
 
9
9
  export namespace Change {
@@ -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"}
@@ -5,6 +5,7 @@ type ChangeType = {
5
5
  type: "add" | "subtract";
6
6
  amount: number;
7
7
  status: Status;
8
+ result: number;
8
9
  };
9
10
  export type Change = Partial<Record<Balances.Entry, ChangeType>>;
10
11
  export declare namespace Change {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",