@pax2pay/model-banking 0.1.280 → 0.1.281

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,16 @@
1
+ import { gracely } from "gracely"
2
+ import { http } from "cloudly-http"
3
+ import { Rule } from "../../Rule"
4
+
5
+ export class Rules {
6
+ constructor(private readonly client: http.Client) {}
7
+ async create(account: string, rule: Rule): Promise<Rule | gracely.Error> {
8
+ return this.client.post<Rule>(`/account/${account}/rule`, rule)
9
+ }
10
+ async replace(account: string, rule: Rule): Promise<Rule | gracely.Error> {
11
+ return this.client.put<Rule>(`/account/${account}/rule/${rule.code}`, rule)
12
+ }
13
+ async remove(account: string, code: string): Promise<Rule | gracely.Error> {
14
+ return this.client.delete<Rule>(`/account/${account}/rule/${code}`)
15
+ }
16
+ }
@@ -3,9 +3,12 @@ import { http } from "cloudly-http"
3
3
  import * as rest from "cloudly-rest"
4
4
  import { Account } from "../../Account"
5
5
  import { Rails } from "./Rails"
6
+ import { Rules } from "./Rules"
6
7
 
7
8
  export class Accounts extends rest.Collection<gracely.Error> {
8
9
  readonly Rails = new Rails(this.client)
10
+
11
+ readonly rules = new Rules(this.client)
9
12
  constructor(client: http.Client) {
10
13
  super(client)
11
14
  }
@@ -1,14 +1,21 @@
1
1
  import { gracely } from "gracely"
2
2
  import { http } from "cloudly-http"
3
- import * as rest from "cloudly-rest"
4
3
  import { Rule } from "../../Rule"
5
4
 
6
- export class Rules extends rest.Collection<gracely.Error> {
7
- constructor(client: http.Client) {
8
- super(client)
5
+ export class Rules {
6
+ constructor(private readonly client: http.Client) {}
7
+ async create(organization: string, rule: Rule): Promise<Rule | gracely.Error> {
8
+ return this.client.post<Rule>(`/organization/rule`, rule, {
9
+ organization,
10
+ })
11
+ }
12
+ async replace(organization: string, rule: Rule): Promise<Rule | gracely.Error> {
13
+ return this.client.put<Rule>(`/organization/rule/${rule.code}`, rule, {
14
+ organization,
15
+ })
9
16
  }
10
- async replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error> {
11
- return this.client.put<Rule[]>(`/organization/rule`, rules, {
17
+ async remove(organization: string, code: string): Promise<Rule | gracely.Error> {
18
+ return this.client.delete<Rule>(`/organization/rule/${code}`, {
12
19
  organization,
13
20
  })
14
21
  }
package/Client/Rules.ts CHANGED
@@ -1,16 +1,19 @@
1
1
  import { gracely } from "gracely"
2
2
  import { http } from "cloudly-http"
3
- import * as rest from "cloudly-rest"
4
3
  import { Rule } from "../Rule"
5
4
 
6
- export class Rules extends rest.Collection<gracely.Error> {
7
- constructor(client: http.Client) {
8
- super(client)
9
- }
10
- async replace(rule: Rule[]): Promise<Rule[] | gracely.Error> {
11
- return this.client.put<Rule[]>(`/rule`, rule)
5
+ export class Rules {
6
+ constructor(private readonly client: http.Client) {}
7
+ async create(rule: Rule): Promise<Rule | gracely.Error> {
8
+ return this.client.post<Rule>(`/rule`, rule)
12
9
  }
13
10
  async list(): Promise<Rule[] | gracely.Error> {
14
11
  return this.client.get<Rule[]>(`/rule`)
15
12
  }
13
+ async replace(rule: Rule): Promise<Rule | gracely.Error> {
14
+ return this.client.put<Rule>(`/rule/${rule.code}`, rule)
15
+ }
16
+ async remove(code: string): Promise<Rule | gracely.Error> {
17
+ return this.client.delete<Rule>(`/rule/${code}`)
18
+ }
16
19
  }
@@ -0,0 +1,10 @@
1
+ import { gracely } from "gracely";
2
+ import { http } from "cloudly-http";
3
+ import { Rule } from "../../Rule";
4
+ export declare class Rules {
5
+ private readonly client;
6
+ constructor(client: http.Client);
7
+ create(account: string, rule: Rule): Promise<Rule | gracely.Error>;
8
+ replace(account: string, rule: Rule): Promise<Rule | gracely.Error>;
9
+ remove(account: string, code: string): Promise<Rule | gracely.Error>;
10
+ }
@@ -0,0 +1,15 @@
1
+ export class Rules {
2
+ constructor(client) {
3
+ this.client = client;
4
+ }
5
+ async create(account, rule) {
6
+ return this.client.post(`/account/${account}/rule`, rule);
7
+ }
8
+ async replace(account, rule) {
9
+ return this.client.put(`/account/${account}/rule/${rule.code}`, rule);
10
+ }
11
+ async remove(account, code) {
12
+ return this.client.delete(`/account/${account}/rule/${code}`);
13
+ }
14
+ }
15
+ //# sourceMappingURL=Rules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Accounts/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAU;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,YAAY,OAAO,OAAO,EAAE,IAAI,CAAC,CAAA;IAChE,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,OAAe,EAAE,IAAU;QACxC,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,YAAY,OAAO,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IAC5E,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAe,EAAE,IAAY;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,YAAY,OAAO,SAAS,IAAI,EAAE,CAAC,CAAA;IACpE,CAAC;CACD"}
@@ -3,8 +3,10 @@ import { http } from "cloudly-http";
3
3
  import * as rest from "cloudly-rest";
4
4
  import { Account } from "../../Account";
5
5
  import { Rails } from "./Rails";
6
+ import { Rules } from "./Rules";
6
7
  export declare class Accounts extends rest.Collection<gracely.Error> {
7
8
  readonly Rails: Rails;
9
+ readonly rules: Rules;
8
10
  constructor(client: http.Client);
9
11
  create(account: Account.Creatable): Promise<Account | gracely.Error>;
10
12
  list(options?: {
@@ -1,9 +1,11 @@
1
1
  import * as rest from "cloudly-rest";
2
2
  import { Rails } from "./Rails";
3
+ import { Rules } from "./Rules";
3
4
  export class Accounts extends rest.Collection {
4
5
  constructor(client) {
5
6
  super(client);
6
7
  this.Rails = new Rails(this.client);
8
+ this.rules = new Rules(this.client);
7
9
  }
8
10
  async create(account) {
9
11
  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;AAE/B,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAE3D,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,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,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,8 +1,10 @@
1
1
  import { gracely } from "gracely";
2
2
  import { http } from "cloudly-http";
3
- import * as rest from "cloudly-rest";
4
3
  import { Rule } from "../../Rule";
5
- export declare class Rules extends rest.Collection<gracely.Error> {
4
+ export declare class Rules {
5
+ private readonly client;
6
6
  constructor(client: http.Client);
7
- replace(organization: string, rules: Rule[]): Promise<Rule[] | gracely.Error>;
7
+ create(organization: string, rule: Rule): Promise<Rule | gracely.Error>;
8
+ replace(organization: string, rule: Rule): Promise<Rule | gracely.Error>;
9
+ remove(organization: string, code: string): Promise<Rule | gracely.Error>;
8
10
  }
@@ -1,10 +1,19 @@
1
- import * as rest from "cloudly-rest";
2
- export class Rules extends rest.Collection {
1
+ export class Rules {
3
2
  constructor(client) {
4
- super(client);
3
+ this.client = client;
5
4
  }
6
- async replace(organization, rules) {
7
- return this.client.put(`/organization/rule`, rules, {
5
+ async create(organization, rule) {
6
+ return this.client.post(`/organization/rule`, rule, {
7
+ organization,
8
+ });
9
+ }
10
+ async replace(organization, rule) {
11
+ return this.client.put(`/organization/rule/${rule.code}`, rule, {
12
+ organization,
13
+ });
14
+ }
15
+ async remove(organization, code) {
16
+ return this.client.delete(`/organization/rule/${code}`, {
8
17
  organization,
9
18
  });
10
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,KAAa;QAChD,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,oBAAoB,EAAE,KAAK,EAAE;YAC3D,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;CACD"}
1
+ {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Organizations/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,YAAoB,EAAE,IAAU;QAC5C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,oBAAoB,EAAE,IAAI,EAAE;YACzD,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,YAAoB,EAAE,IAAU;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,sBAAsB,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE;YACrE,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,YAAoB,EAAE,IAAY;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,sBAAsB,IAAI,EAAE,EAAE;YAC7D,YAAY;SACZ,CAAC,CAAA;IACH,CAAC;CACD"}
@@ -1,9 +1,11 @@
1
1
  import { gracely } from "gracely";
2
2
  import { http } from "cloudly-http";
3
- import * as rest from "cloudly-rest";
4
3
  import { Rule } from "../Rule";
5
- export declare class Rules extends rest.Collection<gracely.Error> {
4
+ export declare class Rules {
5
+ private readonly client;
6
6
  constructor(client: http.Client);
7
- replace(rule: Rule[]): Promise<Rule[] | gracely.Error>;
7
+ create(rule: Rule): Promise<Rule | gracely.Error>;
8
8
  list(): Promise<Rule[] | gracely.Error>;
9
+ replace(rule: Rule): Promise<Rule | gracely.Error>;
10
+ remove(code: string): Promise<Rule | gracely.Error>;
9
11
  }
@@ -1,13 +1,18 @@
1
- import * as rest from "cloudly-rest";
2
- export class Rules extends rest.Collection {
1
+ export class Rules {
3
2
  constructor(client) {
4
- super(client);
3
+ this.client = client;
5
4
  }
6
- async replace(rule) {
7
- return this.client.put(`/rule`, rule);
5
+ async create(rule) {
6
+ return this.client.post(`/rule`, rule);
8
7
  }
9
8
  async list() {
10
9
  return this.client.get(`/rule`);
11
10
  }
11
+ async replace(rule) {
12
+ return this.client.put(`/rule/${rule.code}`, rule);
13
+ }
14
+ async remove(code) {
15
+ return this.client.delete(`/rule/${code}`);
16
+ }
12
17
  }
13
18
  //# sourceMappingURL=Rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Rules.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,KAAM,SAAQ,IAAI,CAAC,UAAyB;IACxD,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,EAAE,IAAI,CAAC,CAAA;IAC9C,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,CAAC,CAAA;IACxC,CAAC;CACD"}
1
+ {"version":3,"file":"Rules.js","sourceRoot":"../","sources":["Client/Rules.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,KAAK;IACjB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IACpD,KAAK,CAAC,MAAM,CAAC,IAAU;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAO,OAAO,EAAE,IAAI,CAAC,CAAA;IAC7C,CAAC;IACD,KAAK,CAAC,IAAI;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAS,OAAO,CAAC,CAAA;IACxC,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,IAAU;QACvB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAO,SAAS,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,CAAA;IACzD,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAO,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.280",
3
+ "version": "0.1.281",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",