@pax2pay/model-banking 0.1.52 → 0.1.54

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,55 @@
1
+ import { isoly } from "isoly"
2
+ import { isly } from "isly"
3
+
4
+ export type Entry = Succeeded | Failed
5
+
6
+ export interface Succeeded {
7
+ status: "succeeded"
8
+ type: "capture" | "cancel" | "refund"
9
+ account: string
10
+ card: string
11
+ transaction: string
12
+ amount: [isoly.Currency, number]
13
+ fee: [isoly.Currency, number]
14
+ }
15
+ export interface Failed {
16
+ status: "failed"
17
+ type?: "capture" | "cancel" | "refund"
18
+ account?: string
19
+ card?: string
20
+ transaction?: string
21
+ amount?: [isoly.Currency, number]
22
+ fee?: [isoly.Currency, number]
23
+ reason?: string
24
+ data?: any
25
+ }
26
+ export namespace Entry {
27
+ export namespace Succeeded {
28
+ export const type = isly.object<Succeeded>({
29
+ status: isly.string("succeeded"),
30
+ type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")),
31
+ account: isly.string(),
32
+ card: isly.string(),
33
+ transaction: isly.string(),
34
+ amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()),
35
+ fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()),
36
+ })
37
+ export const is = type.is
38
+ }
39
+ export namespace Failed {
40
+ export const type = isly.object<Failed>({
41
+ status: isly.string("failed"),
42
+ type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")).optional(),
43
+ account: isly.string().optional(),
44
+ card: isly.string().optional(),
45
+ transaction: isly.string().optional(),
46
+ amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()).optional(),
47
+ fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()).optional(),
48
+ reason: isly.string().optional(),
49
+ data: isly.any().optional(),
50
+ })
51
+ export const is = type.is
52
+ }
53
+ export const type = isly.union<Entry, Succeeded, Failed>(Succeeded.type, Failed.type)
54
+ export const is = type.is
55
+ }
@@ -1,40 +1,30 @@
1
- import { gracely } from "gracely"
2
1
  import { isoly } from "isoly"
3
2
  import { isly } from "isly"
4
- import { Transaction } from "../Transaction"
3
+ import { Entry as SettlementEntry } from "./Entry"
5
4
 
6
- export type Settlement = Succeeded | Failed
7
-
8
- export interface Base {
9
- id: string
10
- created: [string, isoly.DateTime]
11
- configuration: string
12
- status: string
13
- }
14
-
15
- export interface Failed extends Base {
16
- status: "failed"
17
- }
18
-
19
- export interface Succeeded extends Base {
20
- settled?: { user: string; created: isoly.DateTime; transaction: string }
21
- amount: Record<isoly.Currency, number>
22
- fee: Record<isoly.Currency, number>
23
- entries: {
24
- status: "succeeded" | "failed"
25
- type: "capture" | "cancel" | "refund"
26
- account: string
27
- card: string
28
- transaction: string
29
- amount: [isoly.Currency, number]
30
- fee: [isoly.Currency, number]
31
- }[]
32
- status: "succeeded"
33
- }
5
+ export type Settlement = Settlement.Succeeded | Settlement.Failed
34
6
 
35
7
  export namespace Settlement {
36
- export const type = isly.union<Settlement, Succeeded, Failed>(
37
- isly.object<Succeeded>({
8
+ export interface Base {
9
+ id: string
10
+ created: [string, isoly.DateTime]
11
+ configuration: string
12
+ status: string
13
+ }
14
+ export interface Succeeded extends Base {
15
+ settled?: { user: string; created: isoly.DateTime; transaction: string }
16
+ amount: Partial<Record<isoly.Currency, number>>
17
+ fee: Partial<Record<isoly.Currency, number>>
18
+ entries: SettlementEntry[]
19
+ status: "succeeded"
20
+ }
21
+ export interface Failed extends Base {
22
+ status: "failed"
23
+ reason: string
24
+ }
25
+
26
+ export namespace Succeeded {
27
+ export const type = isly.object<Succeeded>({
38
28
  id: isly.string(),
39
29
  created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
40
30
  configuration: isly.string(),
@@ -47,35 +37,24 @@ export namespace Settlement {
47
37
  .optional(),
48
38
  amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
49
39
  fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
50
- entries: isly
51
- .object<{
52
- status: "succeeded" | "failed"
53
- type: "capture" | "cancel" | "refund"
54
- account: string
55
- card: string
56
- transaction: string
57
- amount: [isoly.Currency, number]
58
- fee: [isoly.Currency, number]
59
- }>({
60
- status: isly.string(),
61
- type: isly.string(),
62
- account: isly.string(),
63
- card: isly.string(),
64
- transaction: isly.string(),
65
- amount: isly.tuple(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
66
- fee: isly.tuple(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
67
- })
68
- .array(),
40
+ entries: SettlementEntry.type.array(),
69
41
  status: isly.string("succeeded"),
70
- }),
71
- isly.object<Failed>({
42
+ })
43
+ export const is = type.is
44
+ }
45
+ export namespace Failed {
46
+ export const type = isly.object<Failed>({
72
47
  id: isly.string(),
73
48
  created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
74
49
  configuration: isly.string(),
75
50
  status: isly.string("failed"),
51
+ reason: isly.string(),
76
52
  })
77
- )
53
+ export const is = type.is
54
+ }
55
+ export const type = isly.union<Settlement, Succeeded, Failed>(Succeeded.type, Failed.type)
78
56
  export const is = type.is
79
57
  export const flaw = type.flaw
80
- export type Result = (Transaction | (gracely.Error & { id: string }))[]
58
+ export const Entry = SettlementEntry
59
+ export type Entry = SettlementEntry
81
60
  }
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly"
2
+ import { isly } from "isly"
2
3
  import { Realm } from "../../Realm"
3
4
  import { Supplier } from "../../Supplier"
4
5
 
@@ -7,20 +8,17 @@ export interface Creatable {
7
8
  realm: Realm
8
9
  supplier: Supplier
9
10
  currencies: isoly.Currency[]
10
- type: "safeguarded" | "other"
11
+ type: "safeguarded" | "other" | "external"
11
12
  }
12
13
 
13
14
  export namespace Creatable {
14
- export function is(value: Creatable | any): value is Creatable {
15
- return (
16
- value &&
17
- typeof value == "object" &&
18
- typeof value.name == "string" &&
19
- Realm.is(value.realm) &&
20
- Supplier.is(value.supplier) &&
21
- Array.isArray(value.currencies) &&
22
- value.currencies.every(isoly.Currency.is) &&
23
- (value.type == "safeguarded" || value.type == "other")
24
- )
25
- }
15
+ export const type = isly.object<Creatable>({
16
+ name: isly.string(),
17
+ realm: isly.fromIs("realm", Realm.is),
18
+ supplier: isly.fromIs("supplier", Supplier.is),
19
+ currencies: isly.fromIs("Account.Creatable.currencies", isoly.Currency.is).array(),
20
+ type: isly.string(["safeguarded", "other", "external"]),
21
+ })
22
+ export const is = type.is
23
+ export const flaw = type.flaw
26
24
  }
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly"
2
+ import { isly } from "isly"
2
3
  import { Rail } from "../../Rail"
3
4
  import { Supplier } from "../../Supplier"
4
5
  import { Balance } from "../Balance"
@@ -8,24 +9,21 @@ export interface Fetchable {
8
9
  supplier: Supplier
9
10
  reference: string
10
11
  currencies: isoly.Currency[]
11
- type: "safeguarded" | "other"
12
+ type: "safeguarded" | "other" | "external"
12
13
  rail: Rail[]
13
14
  balance: Balance
14
15
  }
15
16
 
16
17
  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
- }
18
+ export const type = isly.object<Fetchable>({
19
+ name: isly.string(),
20
+ supplier: isly.fromIs("supplier", Supplier.is),
21
+ reference: isly.string(),
22
+ currencies: isly.fromIs("Account.Fetchable.currencies", isoly.Currency.is).array(),
23
+ type: isly.string(["safeguarded", "other", "external"]),
24
+ rail: isly.fromIs("Account.Fetchable.rail", Rail.is).array(),
25
+ balance: isly.fromIs("Account.Fetchable.rail", Balance.is),
26
+ })
27
+ export const is = type.is
28
+ export const flaw = type.flaw
31
29
  }
@@ -1,5 +1,6 @@
1
1
  import * as cryptly from "cryptly"
2
2
  import { isoly } from "isoly"
3
+ import { isly } from "isly"
3
4
  import { Realm } from "../../Realm"
4
5
  import { Supplier } from "../../Supplier"
5
6
 
@@ -12,15 +13,13 @@ export interface Storable {
12
13
  }
13
14
 
14
15
  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
- }
16
+ export const type = isly.object<Storable>({
17
+ id: isly.string(),
18
+ created: isly.fromIs("Treasury.Account.Storable", isoly.DateTime.is),
19
+ realm: isly.fromIs("realm", Realm.is),
20
+ supplier: isly.fromIs("supplier", Supplier.is),
21
+ reference: isly.string(),
22
+ })
23
+ export const is = type.is
24
+ export const flaw = type.flaw
26
25
  }
@@ -1,5 +1,6 @@
1
1
  import * as cryptly from "cryptly"
2
2
  import { isoly } from "isoly"
3
+ import { isly } from "isly"
3
4
  import { Rail } from "../../Rail"
4
5
  import { Realm } from "../../Realm"
5
6
  import { Supplier } from "../../Supplier"
@@ -16,29 +17,26 @@ export interface Account {
16
17
  supplier: Supplier
17
18
  reference: string
18
19
  currencies: isoly.Currency[]
19
- type: "safeguarded" | "other"
20
+ type: "safeguarded" | "other" | "external"
20
21
  rail: Rail[]
21
22
  balance: Balance
22
23
  }
23
24
 
24
25
  export namespace Account {
25
- export function is(value: Account | any): value is Account {
26
- return (
27
- value &&
28
- typeof value == "object" &&
29
- cryptly.Identifier.is(value.id, 8) &&
30
- isoly.DateTime.is(value.created) &&
31
- typeof value.name == "string" &&
32
- Realm.is(value.realm) &&
33
- Supplier.is(value.supplier) &&
34
- typeof value.reference == "string" &&
35
- Array.isArray(value.currencies) &&
36
- value.currencies.every(isoly.Currency.is) &&
37
- (value.type == "safeguarded" || value.type == "other") &&
38
- Array.isArray(value.rail) &&
39
- value.rail.every(Rail.is)
40
- )
41
- }
26
+ export const type = isly.object<Account>({
27
+ id: isly.string(),
28
+ created: isly.fromIs("Treasury.Account.Created", isoly.DateTime.is),
29
+ name: isly.string(),
30
+ realm: isly.fromIs("realm", Realm.is),
31
+ supplier: isly.fromIs("supplier", Supplier.is),
32
+ reference: isly.string(),
33
+ currencies: isly.fromIs("Treasury.Account.currencies", isoly.Currency.is).array(),
34
+ type: isly.string(["safeguarded", "other", "external"]),
35
+ rail: isly.fromIs("Treasury.Account.rail", Rail.is).array(),
36
+ balance: isly.fromIs("Treasury.Account.rail", Balance.is),
37
+ })
38
+ export const is = type.is
39
+ export const flaw = type.flaw
42
40
  export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
43
41
  return cryptly.Identifier.is(value, 8)
44
42
  }
@@ -0,0 +1,35 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export type Entry = Succeeded | Failed;
4
+ export interface Succeeded {
5
+ status: "succeeded";
6
+ type: "capture" | "cancel" | "refund";
7
+ account: string;
8
+ card: string;
9
+ transaction: string;
10
+ amount: [isoly.Currency, number];
11
+ fee: [isoly.Currency, number];
12
+ }
13
+ export interface Failed {
14
+ status: "failed";
15
+ type?: "capture" | "cancel" | "refund";
16
+ account?: string;
17
+ card?: string;
18
+ transaction?: string;
19
+ amount?: [isoly.Currency, number];
20
+ fee?: [isoly.Currency, number];
21
+ reason?: string;
22
+ data?: any;
23
+ }
24
+ export declare namespace Entry {
25
+ namespace Succeeded {
26
+ const type: isly.object.ExtendableType<Succeeded>;
27
+ const is: isly.Type.IsFunction<Succeeded>;
28
+ }
29
+ namespace Failed {
30
+ const type: isly.object.ExtendableType<Failed>;
31
+ const is: isly.Type.IsFunction<Failed>;
32
+ }
33
+ const type: isly.Type<Entry>;
34
+ const is: isly.Type.IsFunction<Entry>;
35
+ }
@@ -0,0 +1,36 @@
1
+ import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
+ export var Entry;
4
+ (function (Entry) {
5
+ let Succeeded;
6
+ (function (Succeeded) {
7
+ Succeeded.type = isly.object({
8
+ status: isly.string("succeeded"),
9
+ type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")),
10
+ account: isly.string(),
11
+ card: isly.string(),
12
+ transaction: isly.string(),
13
+ amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()),
14
+ fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()),
15
+ });
16
+ Succeeded.is = Succeeded.type.is;
17
+ })(Succeeded = Entry.Succeeded || (Entry.Succeeded = {}));
18
+ let Failed;
19
+ (function (Failed) {
20
+ Failed.type = isly.object({
21
+ status: isly.string("failed"),
22
+ type: isly.union(isly.string("capture"), isly.string("cancel"), isly.string("refund")).optional(),
23
+ account: isly.string().optional(),
24
+ card: isly.string().optional(),
25
+ transaction: isly.string().optional(),
26
+ amount: isly.tuple(isly.fromIs("Entry.amount", isoly.Currency.is), isly.number()).optional(),
27
+ fee: isly.tuple(isly.fromIs("Entry.fee", isoly.Currency.is), isly.number()).optional(),
28
+ reason: isly.string().optional(),
29
+ data: isly.any().optional(),
30
+ });
31
+ Failed.is = Failed.type.is;
32
+ })(Failed = Entry.Failed || (Entry.Failed = {}));
33
+ Entry.type = isly.union(Succeeded.type, Failed.type);
34
+ Entry.is = Entry.type.is;
35
+ })(Entry || (Entry = {}));
36
+ //# sourceMappingURL=Entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Entry.js","sourceRoot":"../","sources":["Settlement/Entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAwB3B,MAAM,KAAW,KAAK,CA6BrB;AA7BD,WAAiB,KAAK;IACrB,IAAiB,S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,QAAQ,EAAE;YACjC,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAC9B,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YACrC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;YAC5F,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;YACtF,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAChC,IAAI,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;SAC3B,CAAC,CAAA;QACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EAbgB,MAAM,GAAN,YAAM,KAAN,YAAM,QAatB;IACY,UAAI,GAAG,IAAI,CAAC,KAAK,CAA2B,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IACxE,QAAE,GAAG,MAAA,IAAI,CAAC,EAAE,CAAA;AAC1B,CAAC,EA7BgB,KAAK,KAAL,KAAK,QA6BrB"}
@@ -1,41 +1,40 @@
1
- import { gracely } from "gracely";
2
1
  import { isoly } from "isoly";
3
2
  import { isly } from "isly";
4
- import { Transaction } from "../Transaction";
5
- export type Settlement = Succeeded | Failed;
6
- export interface Base {
7
- id: string;
8
- created: [string, isoly.DateTime];
9
- configuration: string;
10
- status: string;
11
- }
12
- export interface Failed extends Base {
13
- status: "failed";
14
- }
15
- export interface Succeeded extends Base {
16
- settled?: {
17
- user: string;
18
- created: isoly.DateTime;
19
- transaction: string;
20
- };
21
- amount: Record<isoly.Currency, number>;
22
- fee: Record<isoly.Currency, number>;
23
- entries: {
24
- status: "succeeded" | "failed";
25
- type: "capture" | "cancel" | "refund";
26
- account: string;
27
- card: string;
28
- transaction: string;
29
- amount: [isoly.Currency, number];
30
- fee: [isoly.Currency, number];
31
- }[];
32
- status: "succeeded";
33
- }
3
+ import { Entry as SettlementEntry } from "./Entry";
4
+ export type Settlement = Settlement.Succeeded | Settlement.Failed;
34
5
  export declare namespace Settlement {
6
+ interface Base {
7
+ id: string;
8
+ created: [string, isoly.DateTime];
9
+ configuration: string;
10
+ status: string;
11
+ }
12
+ interface Succeeded extends Base {
13
+ settled?: {
14
+ user: string;
15
+ created: isoly.DateTime;
16
+ transaction: string;
17
+ };
18
+ amount: Partial<Record<isoly.Currency, number>>;
19
+ fee: Partial<Record<isoly.Currency, number>>;
20
+ entries: SettlementEntry[];
21
+ status: "succeeded";
22
+ }
23
+ interface Failed extends Base {
24
+ status: "failed";
25
+ reason: string;
26
+ }
27
+ namespace Succeeded {
28
+ const type: isly.object.ExtendableType<Succeeded>;
29
+ const is: isly.Type.IsFunction<Succeeded>;
30
+ }
31
+ namespace Failed {
32
+ const type: isly.object.ExtendableType<Failed>;
33
+ const is: isly.Type.IsFunction<Failed>;
34
+ }
35
35
  const type: isly.Type<Settlement>;
36
36
  const is: isly.Type.IsFunction<Settlement>;
37
37
  const flaw: isly.Type.FlawFunction;
38
- type Result = (Transaction | (gracely.Error & {
39
- id: string;
40
- }))[];
38
+ const Entry: typeof SettlementEntry;
39
+ type Entry = SettlementEntry;
41
40
  }
@@ -1,39 +1,42 @@
1
1
  import { isoly } from "isoly";
2
2
  import { isly } from "isly";
3
+ import { Entry as SettlementEntry } from "./Entry";
3
4
  export var Settlement;
4
5
  (function (Settlement) {
5
- Settlement.type = isly.union(isly.object({
6
- id: isly.string(),
7
- created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
8
- configuration: isly.string(),
9
- settled: isly
10
- .object({
11
- user: isly.string(),
12
- created: isly.fromIs("Settlement.settled.created", isoly.DateTime.is),
13
- transaction: isly.string(),
14
- })
15
- .optional(),
16
- amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
17
- fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
18
- entries: isly
19
- .object({
20
- status: isly.string(),
21
- type: isly.string(),
22
- account: isly.string(),
23
- card: isly.string(),
24
- transaction: isly.string(),
25
- amount: isly.tuple(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
26
- fee: isly.tuple(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
27
- })
28
- .array(),
29
- status: isly.string("succeeded"),
30
- }), isly.object({
31
- id: isly.string(),
32
- created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
33
- configuration: isly.string(),
34
- status: isly.string("failed"),
35
- }));
6
+ let Succeeded;
7
+ (function (Succeeded) {
8
+ Succeeded.type = isly.object({
9
+ id: isly.string(),
10
+ created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
11
+ configuration: isly.string(),
12
+ settled: isly
13
+ .object({
14
+ user: isly.string(),
15
+ created: isly.fromIs("Settlement.settled.created", isoly.DateTime.is),
16
+ transaction: isly.string(),
17
+ })
18
+ .optional(),
19
+ amount: isly.record(isly.fromIs("Settlement.entries.amount", isoly.Currency.is), isly.number()),
20
+ fee: isly.record(isly.fromIs("Settlement.entries.fee", isoly.Currency.is), isly.number()),
21
+ entries: SettlementEntry.type.array(),
22
+ status: isly.string("succeeded"),
23
+ });
24
+ Succeeded.is = Succeeded.type.is;
25
+ })(Succeeded = Settlement.Succeeded || (Settlement.Succeeded = {}));
26
+ let Failed;
27
+ (function (Failed) {
28
+ Failed.type = isly.object({
29
+ id: isly.string(),
30
+ created: isly.tuple(isly.string(), isly.fromIs("Settlement.created", isoly.DateTime.is)),
31
+ configuration: isly.string(),
32
+ status: isly.string("failed"),
33
+ reason: isly.string(),
34
+ });
35
+ Failed.is = Failed.type.is;
36
+ })(Failed = Settlement.Failed || (Settlement.Failed = {}));
37
+ Settlement.type = isly.union(Succeeded.type, Failed.type);
36
38
  Settlement.is = Settlement.type.is;
37
39
  Settlement.flaw = Settlement.type.flaw;
40
+ Settlement.Entry = SettlementEntry;
38
41
  })(Settlement || (Settlement = {}));
39
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../","sources":["Settlement/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAgC3B,MAAM,KAAW,UAAU,CA8C1B;AA9CD,WAAiB,UAAU;IACb,eAAI,GAAG,IAAI,CAAC,KAAK,CAC7B,IAAI,CAAC,MAAM,CAAY;QACtB,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;QACjB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACxF,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE;QAC5B,OAAO,EAAE,IAAI;aACX,MAAM,CAAiE;YACvE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;YACnB,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrE,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE;SAC1B,CAAC;aACD,QAAQ,EAAE;QACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,2BAA2B,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;QAC/F,GAAG,EAAE,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ACzF,OAAO,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;SAChC,CAAC,CAAA;QACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EAlBgB,SAAS,GAAT,oBAAS,KAAT,oBAAS,QAkBzB;IACD,IAAiB,MAAM,CAStB;IATD,WAAiB,MAAM;QACT,WAAI,GAAG,IAAI,CAAC,MAAM,CAAS;YACvC,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;YACxF,aAAa,EAAE,IAAI,CAAC,MAAM,EAAE;YAC5B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SACrB,CAAC,CAAA;QACW,SAAE,GAAG,OAAA,IAAI,CAAC,EAAE,CAAA;IAC1B,CAAC,EATgB,MAAM,GAAN,iBAAM,KAAN,iBAAM,QAStB;IACY,eAAI,GAAG,IAAI,CAAC,KAAK,CAAgC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAA;IAC7E,aAAE,GAAG,WAAA,IAAI,CAAC,EAAE,CAAA;IACZ,eAAI,GAAG,WAAA,IAAI,CAAC,IAAI,CAAA;IAChB,gBAAK,GAAG,eAAe,CAAA;AAErC,CAAC,EArDgB,UAAU,KAAV,UAAU,QAqD1B"}
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly";
2
+ import { isly } from "isly";
2
3
  import { Realm } from "../../Realm";
3
4
  import { Supplier } from "../../Supplier";
4
5
  export interface Creatable {
@@ -6,8 +7,10 @@ export interface Creatable {
6
7
  realm: Realm;
7
8
  supplier: Supplier;
8
9
  currencies: isoly.Currency[];
9
- type: "safeguarded" | "other";
10
+ type: "safeguarded" | "other" | "external";
10
11
  }
11
12
  export declare namespace Creatable {
12
- function is(value: Creatable | any): value is Creatable;
13
+ const type: isly.object.ExtendableType<Creatable>;
14
+ const is: isly.Type.IsFunction<Creatable>;
15
+ const flaw: isly.Type.FlawFunction;
13
16
  }
@@ -1,18 +1,17 @@
1
1
  import { isoly } from "isoly";
2
+ import { isly } from "isly";
2
3
  import { Realm } from "../../Realm";
3
4
  import { Supplier } from "../../Supplier";
4
5
  export var Creatable;
5
6
  (function (Creatable) {
6
- function is(value) {
7
- return (value &&
8
- typeof value == "object" &&
9
- typeof value.name == "string" &&
10
- Realm.is(value.realm) &&
11
- Supplier.is(value.supplier) &&
12
- Array.isArray(value.currencies) &&
13
- value.currencies.every(isoly.Currency.is) &&
14
- (value.type == "safeguarded" || value.type == "other"));
15
- }
16
- Creatable.is = is;
7
+ Creatable.type = isly.object({
8
+ name: isly.string(),
9
+ realm: isly.fromIs("realm", Realm.is),
10
+ supplier: isly.fromIs("supplier", Supplier.is),
11
+ currencies: isly.fromIs("Account.Creatable.currencies", isoly.Currency.is).array(),
12
+ type: isly.string(["safeguarded", "other", "external"]),
13
+ });
14
+ Creatable.is = Creatable.type.is;
15
+ Creatable.flaw = Creatable.type.flaw;
17
16
  })(Creatable || (Creatable = {}));
18
17
  //# sourceMappingURL=Creatable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Treasury/Account/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,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;YAC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,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;KACvD,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAVgB,SAAS,KAAT,SAAS,QAUzB"}
@@ -1,4 +1,5 @@
1
1
  import { isoly } from "isoly";
2
+ import { isly } from "isly";
2
3
  import { Rail } from "../../Rail";
3
4
  import { Supplier } from "../../Supplier";
4
5
  import { Balance } from "../Balance";
@@ -7,10 +8,12 @@ export interface Fetchable {
7
8
  supplier: Supplier;
8
9
  reference: string;
9
10
  currencies: isoly.Currency[];
10
- type: "safeguarded" | "other";
11
+ type: "safeguarded" | "other" | "external";
11
12
  rail: Rail[];
12
13
  balance: Balance;
13
14
  }
14
15
  export declare namespace Fetchable {
15
- function is(value: Fetchable | any): value is Fetchable;
16
+ const type: isly.object.ExtendableType<Fetchable>;
17
+ const is: isly.Type.IsFunction<Fetchable>;
18
+ const flaw: isly.Type.FlawFunction;
16
19
  }
@@ -1,20 +1,20 @@
1
1
  import { isoly } from "isoly";
2
+ import { isly } from "isly";
2
3
  import { Rail } from "../../Rail";
3
4
  import { Supplier } from "../../Supplier";
5
+ import { Balance } from "../Balance";
4
6
  export var Fetchable;
5
7
  (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;
8
+ Fetchable.type = isly.object({
9
+ name: isly.string(),
10
+ supplier: isly.fromIs("supplier", Supplier.is),
11
+ reference: isly.string(),
12
+ currencies: isly.fromIs("Account.Fetchable.currencies", isoly.Currency.is).array(),
13
+ type: isly.string(["safeguarded", "other", "external"]),
14
+ rail: isly.fromIs("Account.Fetchable.rail", Rail.is).array(),
15
+ balance: isly.fromIs("Account.Fetchable.rail", Balance.is),
16
+ });
17
+ Fetchable.is = Fetchable.type.is;
18
+ Fetchable.flaw = Fetchable.type.flaw;
19
19
  })(Fetchable || (Fetchable = {}));
20
20
  //# sourceMappingURL=Fetchable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Fetchable.js","sourceRoot":"../","sources":["Treasury/Account/Fetchable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,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"}
1
+ {"version":3,"file":"Fetchable.js","sourceRoot":"../","sources":["Treasury/Account/Fetchable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAYpC,MAAM,KAAW,SAAS,CAYzB;AAZD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;QAC9C,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE;QACxB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,8BAA8B,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QAClF,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACvD,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,wBAAwB,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QAC5D,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,wBAAwB,EAAE,OAAO,CAAC,EAAE,CAAC;KAC1D,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAZgB,SAAS,KAAT,SAAS,QAYzB"}
@@ -1,5 +1,6 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import { isoly } from "isoly";
3
+ import { isly } from "isly";
3
4
  import { Realm } from "../../Realm";
4
5
  import { Supplier } from "../../Supplier";
5
6
  export interface Storable {
@@ -10,5 +11,7 @@ export interface Storable {
10
11
  reference: string;
11
12
  }
12
13
  export declare namespace Storable {
13
- function is(value: Storable | any): value is Storable;
14
+ const type: isly.object.ExtendableType<Storable>;
15
+ const is: isly.Type.IsFunction<Storable>;
16
+ const flaw: isly.Type.FlawFunction;
14
17
  }
@@ -1,18 +1,17 @@
1
- import * as cryptly from "cryptly";
2
1
  import { isoly } from "isoly";
2
+ import { isly } from "isly";
3
3
  import { Realm } from "../../Realm";
4
4
  import { Supplier } from "../../Supplier";
5
5
  export var Storable;
6
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;
7
+ Storable.type = isly.object({
8
+ id: isly.string(),
9
+ created: isly.fromIs("Treasury.Account.Storable", isoly.DateTime.is),
10
+ realm: isly.fromIs("realm", Realm.is),
11
+ supplier: isly.fromIs("supplier", Supplier.is),
12
+ reference: isly.string(),
13
+ });
14
+ Storable.is = Storable.type.is;
15
+ Storable.flaw = Storable.type.flaw;
17
16
  })(Storable || (Storable = {}));
18
17
  //# sourceMappingURL=Storable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Storable.js","sourceRoot":"../","sources":["Treasury/Account/Storable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,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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AAQ,QAUxB"}
@@ -1,5 +1,6 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import { isoly } from "isoly";
3
+ import { isly } from "isly";
3
4
  import { Rail } from "../../Rail";
4
5
  import { Realm } from "../../Realm";
5
6
  import { Supplier } from "../../Supplier";
@@ -15,12 +16,14 @@ export interface Account {
15
16
  supplier: Supplier;
16
17
  reference: string;
17
18
  currencies: isoly.Currency[];
18
- type: "safeguarded" | "other";
19
+ type: "safeguarded" | "other" | "external";
19
20
  rail: Rail[];
20
21
  balance: Balance;
21
22
  }
22
23
  export declare namespace Account {
23
- function is(value: Account | any): value is Account;
24
+ const type: isly.object.ExtendableType<Account>;
25
+ const is: isly.Type.IsFunction<Account>;
26
+ const flaw: isly.Type.FlawFunction;
24
27
  function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
25
28
  type Creatable = AccountCreatable;
26
29
  const Creatable: typeof AccountCreatable;
@@ -1,29 +1,29 @@
1
1
  import * as cryptly from "cryptly";
2
2
  import { isoly } from "isoly";
3
+ import { isly } from "isly";
3
4
  import { Rail } from "../../Rail";
4
5
  import { Realm } from "../../Realm";
5
6
  import { Supplier } from "../../Supplier";
7
+ import { Balance } from "../Balance";
6
8
  import { Creatable as AccountCreatable } from "./Creatable";
7
9
  import { Fetchable as AccountFetchable } from "./Fetchable";
8
10
  import { Storable as AccountStorable } from "./Storable";
9
11
  export var Account;
10
12
  (function (Account) {
11
- function is(value) {
12
- return (value &&
13
- typeof value == "object" &&
14
- cryptly.Identifier.is(value.id, 8) &&
15
- isoly.DateTime.is(value.created) &&
16
- typeof value.name == "string" &&
17
- Realm.is(value.realm) &&
18
- Supplier.is(value.supplier) &&
19
- typeof value.reference == "string" &&
20
- Array.isArray(value.currencies) &&
21
- value.currencies.every(isoly.Currency.is) &&
22
- (value.type == "safeguarded" || value.type == "other") &&
23
- Array.isArray(value.rail) &&
24
- value.rail.every(Rail.is));
25
- }
26
- Account.is = is;
13
+ Account.type = isly.object({
14
+ id: isly.string(),
15
+ created: isly.fromIs("Treasury.Account.Created", isoly.DateTime.is),
16
+ name: isly.string(),
17
+ realm: isly.fromIs("realm", Realm.is),
18
+ supplier: isly.fromIs("supplier", Supplier.is),
19
+ reference: isly.string(),
20
+ currencies: isly.fromIs("Treasury.Account.currencies", isoly.Currency.is).array(),
21
+ type: isly.string(["safeguarded", "other", "external"]),
22
+ rail: isly.fromIs("Treasury.Account.rail", Rail.is).array(),
23
+ balance: isly.fromIs("Treasury.Account.rail", Balance.is),
24
+ });
25
+ Account.is = Account.type.is;
26
+ Account.flaw = Account.type.flaw;
27
27
  function isIdentifier(value) {
28
28
  return cryptly.Identifier.is(value, 8);
29
29
  }
@@ -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,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,YAAY,CAAA;AAexD,MAAM,KAAW,OAAO,CA4BvB;AA5BD,WAAiB,OAAO;IACvB,SAAgB,EAAE,CAAC,KAAoB;QACtC,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,OAAO,KA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AC,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,EAzBgB,OAAO,KAAP,OAAO,QAyBvB"}
@@ -14,6 +14,6 @@ export declare namespace Treasury {
14
14
  const Storable: typeof import("./Account/Storable").Storable;
15
15
  type Fetchable = TreasuryAccount.Fetchable;
16
16
  const Fetchable: typeof import("./Account/Fetchable").Fetchable;
17
- const is: typeof TreasuryAccount.is;
17
+ const is: import("isly/dist/Type").Type.IsFunction<TreasuryAccount>;
18
18
  }
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pax2pay/model-banking",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "description": "Library containing data model types and functions for the Pax2Pay Banking API.",
5
5
  "author": "Pax2Pay Ltd",
6
6
  "license": "MIT",