@pax2pay/model-banking 0.1.34 → 0.1.36

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,15 @@
1
+ import * as gracely from "gracely"
2
+ import * as http from "cloudly-http"
3
+ import * as rest from "cloudly-rest"
4
+ import { Rail } from "../../Rail"
5
+ export class Rails extends rest.Collection<gracely.Error> {
6
+ constructor(client: http.Client) {
7
+ super(client)
8
+ }
9
+ async create(organization: string, account: string, supplier: string): Promise<Rail | gracely.Error> {
10
+ return this.client.post<Rail>(`/api/account/${account}/rail`, supplier, {
11
+ organization: organization,
12
+ account: account,
13
+ })
14
+ }
15
+ }
@@ -1,7 +1,7 @@
1
1
  import * as gracely from "gracely"
2
2
  import * as http from "cloudly-http"
3
3
  import * as rest from "cloudly-rest"
4
- import { Account } from "../Account"
4
+ import { Account } from "../../Account"
5
5
 
6
6
  export class Accounts extends rest.Collection<gracely.Error> {
7
7
  constructor(client: http.Client) {
package/Rail/Iban.ts CHANGED
@@ -1,11 +1,18 @@
1
1
  export interface Iban {
2
2
  type: "iban"
3
3
  iban: string
4
+ holder: string
4
5
  }
5
6
  export namespace Iban {
6
7
  export const currencies = ["EUR", "GBP", "SEK", "USD"] as const
7
8
  // maybe do the Iban checksum check below?
8
9
  export function is(value: Iban | any): value is Iban {
9
- return typeof value == "object" && typeof value.iban == "string" && value.type == "iban"
10
+ return (
11
+ value &&
12
+ typeof value == "object" &&
13
+ value.type == "iban" &&
14
+ typeof value.iban == "string" &&
15
+ typeof value.holder == "string"
16
+ )
10
17
  }
11
18
  }
package/Rail/Scan.ts ADDED
@@ -0,0 +1,20 @@
1
+ //SCAN: Sort Code Account Number
2
+ export interface Scan {
3
+ type: "scan"
4
+ sort: string
5
+ account: string
6
+ holder: string
7
+ }
8
+ export namespace Scan {
9
+ export const currencies = ["GBP"] as const
10
+ export function is(value: Scan | any): value is Scan {
11
+ return (
12
+ value &&
13
+ typeof value == "object" &&
14
+ value.type == "scan" &&
15
+ typeof value.sort == "string" &&
16
+ typeof value.account == "string" &&
17
+ typeof value.holder == "string"
18
+ )
19
+ }
20
+ }
package/Rail/Type.ts CHANGED
@@ -1 +1 @@
1
- export type Type = "paxgiro" | "internal" | "iban" //| "swedish" |
1
+ export type Type = "paxgiro" | "internal" | "iban" //| "scan" | "swedish" |
@@ -1,7 +1,7 @@
1
1
  import * as gracely from "gracely";
2
2
  import * as http from "cloudly-http";
3
3
  import * as rest from "cloudly-rest";
4
- import { Account } from "../Account";
4
+ import { Account } from "../../Account";
5
5
  export declare class Accounts extends rest.Collection<gracely.Error> {
6
6
  constructor(client: http.Client);
7
7
  create(account: Account.Creatable): Promise<Account | gracely.Error>;
@@ -10,4 +10,4 @@ export class Accounts extends rest.Collection {
10
10
  return this.client.get("/api/account", options);
11
11
  }
12
12
  }
13
- //# sourceMappingURL=Accounts.js.map
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../","sources":["Client/Accounts/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,cAAc,EAAE,OAAO,CAAC,CAAA;IAC1D,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmD,cAAc,EAAE,OAAO,CAAC,CAAA;IAClG,CAAC;CACD"}
@@ -1,6 +1,7 @@
1
1
  export interface Iban {
2
2
  type: "iban";
3
3
  iban: string;
4
+ holder: string;
4
5
  }
5
6
  export declare namespace Iban {
6
7
  const currencies: readonly ["EUR", "GBP", "SEK", "USD"];
package/dist/Rail/Iban.js CHANGED
@@ -2,7 +2,11 @@ export var Iban;
2
2
  (function (Iban) {
3
3
  Iban.currencies = ["EUR", "GBP", "SEK", "USD"];
4
4
  function is(value) {
5
- return typeof value == "object" && typeof value.iban == "string" && value.type == "iban";
5
+ return (value &&
6
+ typeof value == "object" &&
7
+ value.type == "iban" &&
8
+ typeof value.iban == "string" &&
9
+ typeof value.holder == "string");
6
10
  }
7
11
  Iban.is = is;
8
12
  })(Iban || (Iban = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"Iban.js","sourceRoot":"../","sources":["Rail/Iban.ts"],"names":[],"mappings":"AAIA,MAAM,KAAW,IAAI,CAMpB;AAND,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAE/D,SAAgB,EAAE,CAAC,KAAiB;QACnC,OAAO,OAAO,KAAK,IAAI,QAAQ,IAAI,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,MAAM,CAAA;IACzF,CAAC;IAFe,OAAE,KAEjB,CAAA;AACF,CAAC,EANgB,IAAI,KAAJ,IAAI,QAMpB"}
1
+ {"version":3,"file":"Iban.js","sourceRoot":"../","sources":["Rail/Iban.ts"],"names":[],"mappings":"AAKA,MAAM,KAAW,IAAI,CAYpB;AAZD,WAAiB,IAAI;IACP,eAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAA;IAE/D,SAAgB,EAAE,CAAC,KAAiB;QACnC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,KAAK,CAAC,IAAI,IAAI,MAAM;YACpB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,OAAO,KAAK,CAAC,MAAM,IAAI,QAAQ,CAC/B,CAAA;IACF,CAAC;IARe,OAAE,KAQjB,CAAA;AACF,CAAC,EAZgB,IAAI,KAAJ,IAAI,QAYpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.34",
3
+ "version": "0.1.36",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"Accounts.js","sourceRoot":"../","sources":["Client/Accounts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA;AAGpC,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,UAAyB;IAC3D,YAAY,MAAmB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAA;IACd,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAA0B;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAU,cAAc,EAAE,OAAO,CAAC,CAAA;IAC1D,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAmD,cAAc,EAAE,OAAO,CAAC,CAAA;IAClG,CAAC;CACD"}