@pax2pay/model-banking 0.1.5 → 0.1.6

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.
@@ -17,9 +17,9 @@ export namespace Creatable {
17
17
  typeof value == "object" &&
18
18
  typeof value.name == "string" &&
19
19
  Realm.is(value.realm) &&
20
+ Supplier.is(value.supplier) &&
20
21
  Array.isArray(value.currencies) &&
21
22
  value.currencies.every(isoly.Currency.is) &&
22
- Supplier.is(value.supplier) &&
23
23
  (value.type == "safeguarded" || value.type == "other")
24
24
  )
25
25
  }
@@ -0,0 +1,31 @@
1
+ import * as isoly from "isoly"
2
+ import { Rail } from "../../Rail"
3
+ import { Supplier } from "../../Supplier"
4
+ import { Balance } from "../Balance"
5
+
6
+ export interface Fetchable {
7
+ name: string
8
+ supplier: Supplier
9
+ reference: string
10
+ currencies: isoly.Currency[]
11
+ type: "safeguarded" | "other"
12
+ rail: Rail[]
13
+ balance: Balance
14
+ }
15
+
16
+ export namespace Fetchable {
17
+ export function is(value: Fetchable | any): value is Fetchable {
18
+ return (
19
+ value &&
20
+ typeof value == "object" &&
21
+ typeof value.name == "string" &&
22
+ Supplier.is(value.supplier) &&
23
+ typeof value.reference == "string" &&
24
+ Array.isArray(value.currencies) &&
25
+ value.currencies.every(isoly.Currency.is) &&
26
+ (value.type == "safeguarded" || value.type == "other") &&
27
+ Array.isArray(value.rail) &&
28
+ value.rail.every(Rail.is)
29
+ )
30
+ }
31
+ }
@@ -0,0 +1,26 @@
1
+ import * as cryptly from "cryptly"
2
+ import * as isoly from "isoly"
3
+ import { Realm } from "../../Realm"
4
+ import { Supplier } from "../../Supplier"
5
+
6
+ export interface Storable {
7
+ id: cryptly.Identifier
8
+ created: isoly.DateTime
9
+ realm: Realm
10
+ supplier: Supplier
11
+ reference: string
12
+ }
13
+
14
+ export namespace Storable {
15
+ export function is(value: Storable | any): value is Storable {
16
+ return (
17
+ value &&
18
+ typeof value == "object" &&
19
+ cryptly.Identifier.is(value.id, 8) &&
20
+ isoly.DateTime.is(value.created) &&
21
+ Realm.is(value.realm) &&
22
+ Supplier.is(value.supplier) &&
23
+ typeof value.reference == "string"
24
+ )
25
+ }
26
+ }
@@ -1,13 +1,22 @@
1
1
  import * as cryptly from "cryptly"
2
2
  import * as isoly from "isoly"
3
3
  import { Rail } from "../../Rail"
4
+ import { Realm } from "../../Realm"
5
+ import { Supplier } from "../../Supplier"
4
6
  import { Balance } from "../Balance"
5
7
  import { Creatable as AccountCreatable } from "./Creatable"
8
+ import { Fetchable as AccountFetchable } from "./Fetchable"
9
+ import { Storable as AccountStorable } from "./Storable"
6
10
 
7
- export interface Account extends Account.Creatable {
11
+ export interface Account {
8
12
  id: cryptly.Identifier
9
13
  created: isoly.DateTime
14
+ name: string
15
+ realm: Realm
16
+ supplier: Supplier
10
17
  reference: string
18
+ currencies: isoly.Currency[]
19
+ type: "safeguarded" | "other"
11
20
  rail: Rail[]
12
21
  balance: Balance
13
22
  }
@@ -15,10 +24,17 @@ export interface Account extends Account.Creatable {
15
24
  export namespace Account {
16
25
  export function is(value: Account | any): value is Account {
17
26
  return (
18
- Creatable.is({ ...value }) &&
27
+ value &&
28
+ typeof value == "object" &&
19
29
  cryptly.Identifier.is(value.id, 8) &&
20
30
  isoly.DateTime.is(value.created) &&
31
+ typeof value.name == "string" &&
32
+ Realm.is(value.realm) &&
33
+ Supplier.is(value.supplier) &&
21
34
  typeof value.reference == "string" &&
35
+ Array.isArray(value.currencies) &&
36
+ value.currencies.every(isoly.Currency.is) &&
37
+ (value.type == "safeguarded" || value.type == "other") &&
22
38
  Array.isArray(value.rail) &&
23
39
  value.rail.every(Rail.is)
24
40
  )
@@ -29,4 +45,8 @@ export namespace Account {
29
45
 
30
46
  export type Creatable = AccountCreatable
31
47
  export const Creatable = AccountCreatable
48
+ export type Storable = AccountStorable
49
+ export const Storable = AccountStorable
50
+ export type Fetchable = AccountFetchable
51
+ export const Fetchable = AccountFetchable
32
52
  }
@@ -8,9 +8,9 @@ export var Creatable;
8
8
  typeof value == "object" &&
9
9
  typeof value.name == "string" &&
10
10
  Realm.is(value.realm) &&
11
+ Supplier.is(value.supplier) &&
11
12
  Array.isArray(value.currencies) &&
12
13
  value.currencies.every(isoly.Currency.is) &&
13
- Supplier.is(value.supplier) &&
14
14
  (value.type == "safeguarded" || value.type == "other"));
15
15
  }
16
16
  Creatable.is = is;
@@ -1 +1 @@
1
- {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Treasury/Account/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAUzC,MAAM,KAAW,SAAS,CAazB;AAbD,WAAiB,SAAS;IACzB,SAAgB,EAAE,CAAC,KAAsB;QACxC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;YACrB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;YAC/B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3B,CAAC,KAAK,CAAC,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,CACtD,CAAA;IACF,CAAC;IAXe,YAAE,KAWjB,CAAA;AACF,CAAC,EAbgB,SAAS,KAAT,SAAS,QAazB"}
1
+ {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Treasury/Account/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAUzC,MAAM,KAAW,SAAS,CAazB;AAbD,WAAiB,SAAS;IACzB,SAAgB,EAAE,CAAC,KAAsB;QACxC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;YACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;YAC/B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,CAAC,KAAK,CAAC,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,CACtD,CAAA;IACF,CAAC;IAXe,YAAE,KAWjB,CAAA;AACF,CAAC,EAbgB,SAAS,KAAT,SAAS,QAazB"}
@@ -0,0 +1,16 @@
1
+ import * as isoly from "isoly";
2
+ import { Rail } from "../../Rail";
3
+ import { Supplier } from "../../Supplier";
4
+ import { Balance } from "../Balance";
5
+ export interface Fetchable {
6
+ name: string;
7
+ supplier: Supplier;
8
+ reference: string;
9
+ currencies: isoly.Currency[];
10
+ type: "safeguarded" | "other";
11
+ rail: Rail[];
12
+ balance: Balance;
13
+ }
14
+ export declare namespace Fetchable {
15
+ function is(value: Fetchable | any): value is Fetchable;
16
+ }
@@ -0,0 +1,20 @@
1
+ import * as isoly from "isoly";
2
+ import { Rail } from "../../Rail";
3
+ import { Supplier } from "../../Supplier";
4
+ export var Fetchable;
5
+ (function (Fetchable) {
6
+ function is(value) {
7
+ return (value &&
8
+ typeof value == "object" &&
9
+ typeof value.name == "string" &&
10
+ Supplier.is(value.supplier) &&
11
+ typeof value.reference == "string" &&
12
+ Array.isArray(value.currencies) &&
13
+ value.currencies.every(isoly.Currency.is) &&
14
+ (value.type == "safeguarded" || value.type == "other") &&
15
+ Array.isArray(value.rail) &&
16
+ value.rail.every(Rail.is));
17
+ }
18
+ Fetchable.is = is;
19
+ })(Fetchable || (Fetchable = {}));
20
+ //# sourceMappingURL=Fetchable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Fetchable.js","sourceRoot":"../","sources":["Treasury/Account/Fetchable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAazC,MAAM,KAAW,SAAS,CAezB;AAfD,WAAiB,SAAS;IACzB,SAAgB,EAAE,CAAC,KAAsB;QACxC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,KAAK,CAAC,IAAI,IAAI,QAAQ;YAC7B,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3B,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ;YAClC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;YAC/B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,CAAC,KAAK,CAAC,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;YACtD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CACzB,CAAA;IACF,CAAC;IAbe,YAAE,KAajB,CAAA;AACF,CAAC,EAfgB,SAAS,KAAT,SAAS,QAezB"}
@@ -0,0 +1,14 @@
1
+ import * as cryptly from "cryptly";
2
+ import * as isoly from "isoly";
3
+ import { Realm } from "../../Realm";
4
+ import { Supplier } from "../../Supplier";
5
+ export interface Storable {
6
+ id: cryptly.Identifier;
7
+ created: isoly.DateTime;
8
+ realm: Realm;
9
+ supplier: Supplier;
10
+ reference: string;
11
+ }
12
+ export declare namespace Storable {
13
+ function is(value: Storable | any): value is Storable;
14
+ }
@@ -0,0 +1,18 @@
1
+ import * as cryptly from "cryptly";
2
+ import * as isoly from "isoly";
3
+ import { Realm } from "../../Realm";
4
+ import { Supplier } from "../../Supplier";
5
+ export var Storable;
6
+ (function (Storable) {
7
+ function is(value) {
8
+ return (value &&
9
+ typeof value == "object" &&
10
+ cryptly.Identifier.is(value.id, 8) &&
11
+ isoly.DateTime.is(value.created) &&
12
+ Realm.is(value.realm) &&
13
+ Supplier.is(value.supplier) &&
14
+ typeof value.reference == "string");
15
+ }
16
+ Storable.is = is;
17
+ })(Storable || (Storable = {}));
18
+ //# sourceMappingURL=Storable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Storable.js","sourceRoot":"../","sources":["Treasury/Account/Storable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAUzC,MAAM,KAAW,QAAQ,CAYxB;AAZD,WAAiB,QAAQ;IACxB,SAAgB,EAAE,CAAC,KAAqB;QACvC,OAAO,CACN,KAAK;YACL,OAAO,KAAK,IAAI,QAAQ;YACxB,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;YAChC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;YACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3B,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ,CAClC,CAAA;IACF,CAAC;IAVe,WAAE,KAUjB,CAAA;AACF,CAAC,EAZgB,QAAQ,KAAR,QAAQ,QAYxB"}
@@ -1,12 +1,21 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import * as isoly from "isoly";
3
3
  import { Rail } from "../../Rail";
4
+ import { Realm } from "../../Realm";
5
+ import { Supplier } from "../../Supplier";
4
6
  import { Balance } from "../Balance";
5
7
  import { Creatable as AccountCreatable } from "./Creatable";
6
- export interface Account extends Account.Creatable {
8
+ import { Fetchable as AccountFetchable } from "./Fetchable";
9
+ import { Storable as AccountStorable } from "./Storable";
10
+ export interface Account {
7
11
  id: cryptly.Identifier;
8
12
  created: isoly.DateTime;
13
+ name: string;
14
+ realm: Realm;
15
+ supplier: Supplier;
9
16
  reference: string;
17
+ currencies: isoly.Currency[];
18
+ type: "safeguarded" | "other";
10
19
  rail: Rail[];
11
20
  balance: Balance;
12
21
  }
@@ -15,4 +24,8 @@ export declare namespace Account {
15
24
  function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
16
25
  type Creatable = AccountCreatable;
17
26
  const Creatable: typeof AccountCreatable;
27
+ type Storable = AccountStorable;
28
+ const Storable: typeof AccountStorable;
29
+ type Fetchable = AccountFetchable;
30
+ const Fetchable: typeof AccountFetchable;
18
31
  }
@@ -1,14 +1,25 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import * as isoly from "isoly";
3
3
  import { Rail } from "../../Rail";
4
+ import { Realm } from "../../Realm";
5
+ import { Supplier } from "../../Supplier";
4
6
  import { Creatable as AccountCreatable } from "./Creatable";
7
+ import { Fetchable as AccountFetchable } from "./Fetchable";
8
+ import { Storable as AccountStorable } from "./Storable";
5
9
  export var Account;
6
10
  (function (Account) {
7
11
  function is(value) {
8
- return (Account.Creatable.is({ ...value }) &&
12
+ return (value &&
13
+ typeof value == "object" &&
9
14
  cryptly.Identifier.is(value.id, 8) &&
10
15
  isoly.DateTime.is(value.created) &&
16
+ typeof value.name == "string" &&
17
+ Realm.is(value.realm) &&
18
+ Supplier.is(value.supplier) &&
11
19
  typeof value.reference == "string" &&
20
+ Array.isArray(value.currencies) &&
21
+ value.currencies.every(isoly.Currency.is) &&
22
+ (value.type == "safeguarded" || value.type == "other") &&
12
23
  Array.isArray(value.rail) &&
13
24
  value.rail.every(Rail.is));
14
25
  }
@@ -18,5 +29,7 @@ export var Account;
18
29
  }
19
30
  Account.isIdentifier = isIdentifier;
20
31
  Account.Creatable = AccountCreatable;
32
+ Account.Storable = AccountStorable;
33
+ Account.Fetchable = AccountFetchable;
21
34
  })(Account || (Account = {}));
22
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Treasury/Account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAU3D,MAAM,KAAW,OAAO,CAiBvB;AAjBD,WAAiB,OAAO;IACvB,SAAgB,EAAE,CAAC,KAAoB;QACtC,OAAO,CACN,QAAA,SAAS,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;YAC1B,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAClC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;YAChC,OAAO,KAAK,CAAC,SAAS,IAAI,QAAQ;YAClC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CACzB,CAAA;IACF,CAAC;IATe,UAAE,KASjB,CAAA;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,CAAC,KAAK,CAAC,UAAU,CAAC;YAC/B,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzC,CAAC,KAAK,CAAC,IAAI,IAAI,aAAa,IAAI,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;YACtD,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CACzB,CAAA;IACF,CAAC;IAhBe,UAAE,KAgBjB,CAAA;IACD,SAAgB,YAAY,CAAC,KAA+B;QAC3D,OAAO,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACvC,CAAC;IAFe,oBAAY,eAE3B,CAAA;IAGY,iBAAS,GAAG,gBAAgB,CAAA;IAE5B,gBAAQ,GAAG,eAAe,CAAA;IAE1B,iBAAS,GAAG,gBAAgB,CAAA;AAC1C,CAAC,EA5BgB,OAAO,KAAP,OAAO,QA4BvB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",