@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.
- package/Client/Accounts/Rails.ts +15 -0
- package/Client/{Accounts.ts → Accounts/index.ts} +1 -1
- package/Rail/Iban.ts +8 -1
- package/Rail/Scan.ts +20 -0
- package/Rail/Type.ts +1 -1
- package/dist/Client/{Accounts.d.ts → Accounts/index.d.ts} +1 -1
- package/dist/Client/{Accounts.js → Accounts/index.js} +1 -1
- package/dist/Client/Accounts/index.js.map +1 -0
- package/dist/Rail/Iban.d.ts +1 -0
- package/dist/Rail/Iban.js +5 -1
- package/dist/Rail/Iban.js.map +1 -1
- package/package.json +1 -1
- package/dist/Client/Accounts.js.map +0 -1
|
@@ -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 "
|
|
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
|
|
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 "
|
|
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>;
|
|
@@ -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"}
|
package/dist/Rail/Iban.d.ts
CHANGED
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
|
|
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 = {}));
|
package/dist/Rail/Iban.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Iban.js","sourceRoot":"../","sources":["Rail/Iban.ts"],"names":[],"mappings":"
|
|
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 +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"}
|