@pax2pay/model-banking 0.1.289 → 0.1.290

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.
@@ -0,0 +1,13 @@
1
+ import { gracely } from "gracely"
2
+ import { http } from "cloudly-http"
3
+ import { Rail } from "../../Rail"
4
+
5
+ export class Counterparts {
6
+ constructor(private readonly client: http.Client) {}
7
+ async replace(account: string, code: string, address: Rail.Address): Promise<Rail.Address | gracely.Error> {
8
+ return this.client.put<Rail.Address>(`/account/${account}/counterpart/${code}`, address)
9
+ }
10
+ async remove(account: string, code: string): Promise<Rail.Address | gracely.Error> {
11
+ return this.client.delete<Rail.Address>(`/account/${account}/counterpart/${code}`)
12
+ }
13
+ }
@@ -2,13 +2,15 @@ import { gracely } from "gracely"
2
2
  import { http } from "cloudly-http"
3
3
  import * as rest from "cloudly-rest"
4
4
  import { Account } from "../../Account"
5
+ import { Counterparts } from "./Counterparts"
5
6
  import { Rails } from "./Rails"
6
7
  import { Rules } from "./Rules"
7
8
 
8
9
  export class Accounts extends rest.Collection<gracely.Error> {
9
10
  readonly Rails = new Rails(this.client)
10
-
11
11
  readonly rules = new Rules(this.client)
12
+ readonly counterparts = new Counterparts(this.client)
13
+
12
14
  constructor(client: http.Client) {
13
15
  super(client)
14
16
  }
@@ -0,0 +1,9 @@
1
+ import { gracely } from "gracely";
2
+ import { http } from "cloudly-http";
3
+ import { Rail } from "../../Rail";
4
+ export declare class Counterparts {
5
+ private readonly client;
6
+ constructor(client: http.Client);
7
+ replace(account: string, code: string, address: Rail.Address): Promise<Rail.Address | gracely.Error>;
8
+ remove(account: string, code: string): Promise<Rail.Address | gracely.Error>;
9
+ }
@@ -0,0 +1,12 @@
1
+ export class Counterparts {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async replace(account, code, address) {
6
+ return this.client.put(`/account/${account}/counterpart/${code}`, address);
7
+ }
8
+ async remove(account, code) {
9
+ return this.client.delete(`/account/${account}/counterpart/${code}`);
10
+ }
11
+ }
12
+ //# sourceMappingURL=Counterparts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Counterparts.js","sourceRoot":"../","sources":["Client/Accounts/Counterparts.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,YAAY;IACxB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAY,EAAE,OAAqB;QACjE,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,YAAY,OAAO,gBAAgB,IAAI,EAAE,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAe,YAAY,OAAO,gBAAgB,IAAI,EAAE,CAAC,CAAA;IACnF,CAAC;CACD"}
@@ -2,11 +2,13 @@ import { gracely } from "gracely";
2
2
  import { http } from "cloudly-http";
3
3
  import * as rest from "cloudly-rest";
4
4
  import { Account } from "../../Account";
5
+ import { Counterparts } from "./Counterparts";
5
6
  import { Rails } from "./Rails";
6
7
  import { Rules } from "./Rules";
7
8
  export declare class Accounts extends rest.Collection<gracely.Error> {
8
9
  readonly Rails: Rails;
9
10
  readonly rules: Rules;
11
+ readonly counterparts: Counterparts;
10
12
  constructor(client: http.Client);
11
13
  create(account: Account.Creatable): Promise<Account | gracely.Error>;
12
14
  list(options?: {
@@ -1,4 +1,5 @@
1
1
  import * as rest from "cloudly-rest";
2
+ import { Counterparts } from "./Counterparts";
2
3
  import { Rails } from "./Rails";
3
4
  import { Rules } from "./Rules";
4
5
  export class Accounts extends rest.Collection {
@@ -6,6 +7,7 @@ export class Accounts extends rest.Collection {
6
7
  super(client);
7
8
  this.Rails = new Rails(this.client);
8
9
  this.rules = new Rules(this.client);
10
+ this.counterparts = new Counterparts(this.client);
9
11
  }
10
12
  async create(account) {
11
13
  return this.client.post("/account", account);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAI3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QAJL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAE9B,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAGvC,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,UAAU,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAK3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;QALL,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,UAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9B,iBAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAIrD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,UAAU,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,UAAU,EAAE,OAAO,CAAC,CAAA;IACzF,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.289",
3
+ "version": "0.1.290",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",