@pax2pay/model-banking 0.1.81 → 0.1.83
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/Account/Creatable.ts +5 -11
- package/Account/index.ts +14 -25
- package/Client/Accounts/index.ts +2 -2
- package/Organization/Creatable.ts +2 -13
- package/dist/Account/Creatable.d.ts +4 -2
- package/dist/Account/Creatable.js +4 -11
- package/dist/Account/Creatable.js.map +1 -1
- package/dist/Account/index.d.ts +7 -10
- package/dist/Account/index.js +11 -24
- package/dist/Account/index.js.map +1 -1
- package/dist/Client/Accounts/index.d.ts +1 -1
- package/dist/Client/Accounts/index.js.map +1 -1
- package/dist/Organization/Creatable.d.ts +2 -1
- package/dist/Organization/Creatable.js +2 -12
- package/dist/Organization/Creatable.js.map +1 -1
- package/package.json +1 -1
package/Account/Creatable.ts
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
+
import { isly } from "isly"
|
|
2
|
+
|
|
1
3
|
export interface Creatable {
|
|
2
4
|
name: string
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
export namespace Creatable {
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export function isPartial(value: Partial<Creatable> | any): value is Partial<Creatable> {
|
|
10
|
-
return (
|
|
11
|
-
value &&
|
|
12
|
-
typeof value == "object" &&
|
|
13
|
-
Object.entries(value).length > 0 &&
|
|
14
|
-
Object.entries(value).every(([k, v]) => k == "name" && typeof v == "string")
|
|
15
|
-
)
|
|
16
|
-
}
|
|
8
|
+
export const type = isly.object<Creatable>({ name: isly.string() })
|
|
9
|
+
export const is = type.is
|
|
10
|
+
export const flaw = type.flaw
|
|
17
11
|
}
|
package/Account/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cryptly } from "cryptly"
|
|
2
2
|
import { isoly } from "isoly"
|
|
3
|
+
import { isly } from "isly"
|
|
3
4
|
import { Balances } from "../Balances"
|
|
4
5
|
import { Rail } from "../Rail"
|
|
5
6
|
import { Creatable as AccountCreatable } from "./Creatable"
|
|
@@ -7,37 +8,25 @@ import { Creatable as AccountCreatable } from "./Creatable"
|
|
|
7
8
|
export interface Account extends Account.Creatable {
|
|
8
9
|
readonly id: cryptly.Identifier
|
|
9
10
|
readonly created: isoly.DateTime
|
|
11
|
+
readonly balances: Balances
|
|
12
|
+
readonly rails: Rail[]
|
|
13
|
+
//readonly rules: Rule[]
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
export namespace Account {
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
Account.Creatable.is({ ...account }) && cryptly.Identifier.is(account.id, 8) && isoly.DateTime.is(account.created)
|
|
23
|
-
)
|
|
24
|
-
}
|
|
17
|
+
export const type = isly.object<Account>({
|
|
18
|
+
name: isly.string(),
|
|
19
|
+
id: isly.string(),
|
|
20
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
21
|
+
balances: isly.fromIs("Balances", Balances.is),
|
|
22
|
+
rails: isly.fromIs("Rail", Rail.is).array(),
|
|
23
|
+
})
|
|
24
|
+
export const is = type.is
|
|
25
|
+
export const flaw = type.flaw
|
|
25
26
|
export function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier {
|
|
26
27
|
return cryptly.Identifier.is(value, 8)
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
export type Creatable = AccountCreatable
|
|
30
31
|
export const Creatable = AccountCreatable
|
|
31
|
-
export type Info = Account & { rails: Rail[]; balances: Balances }
|
|
32
|
-
export namespace Info {
|
|
33
|
-
export function is(value: Info | any): value is Info {
|
|
34
|
-
return (
|
|
35
|
-
typeof value == "object" &&
|
|
36
|
-
Account.is({ ...value }) &&
|
|
37
|
-
Array.isArray(value.rails) &&
|
|
38
|
-
value.rails.every((r: any) => Rail.is(r)) &&
|
|
39
|
-
Balances.is(value.balances)
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
32
|
}
|
package/Client/Accounts/index.ts
CHANGED
|
@@ -15,7 +15,7 @@ export class Accounts extends rest.Collection<gracely.Error> {
|
|
|
15
15
|
async list(options?: {
|
|
16
16
|
limit?: string
|
|
17
17
|
cursor?: string
|
|
18
|
-
}): Promise<(Account
|
|
19
|
-
return this.client.get<Account
|
|
18
|
+
}): Promise<(Account[] & { cursor?: string | undefined }) | gracely.Error> {
|
|
19
|
+
return this.client.get<Account[] & { cursor?: string | undefined }>("/api/account", options)
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -17,17 +17,6 @@ export namespace Creatable {
|
|
|
17
17
|
rules: isly.fromIs<Rule>("Rule", Rule.is).array(),
|
|
18
18
|
contact: Contact.type.optional(),
|
|
19
19
|
})
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
value &&
|
|
23
|
-
typeof value == "object" &&
|
|
24
|
-
typeof value.name == "string" &&
|
|
25
|
-
typeof value.address == "string" &&
|
|
26
|
-
Realm.is(value.realm) &&
|
|
27
|
-
value.rules &&
|
|
28
|
-
typeof value.rules == "object" &&
|
|
29
|
-
Array.isArray(value.rules) &&
|
|
30
|
-
value.rules.every(Rule.is)
|
|
31
|
-
)
|
|
32
|
-
}
|
|
20
|
+
export const is = type.is
|
|
21
|
+
export const flaw = type.flaw
|
|
33
22
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
1
2
|
export interface Creatable {
|
|
2
3
|
name: string;
|
|
3
4
|
}
|
|
4
5
|
export declare namespace Creatable {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const type: isly.object.ExtendableType<Creatable>;
|
|
7
|
+
const is: isly.Type.IsFunction<Creatable>;
|
|
8
|
+
const flaw: isly.Type.FlawFunction;
|
|
7
9
|
}
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
+
import { isly } from "isly";
|
|
1
2
|
export var Creatable;
|
|
2
3
|
(function (Creatable) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Creatable.is = is;
|
|
7
|
-
function isPartial(value) {
|
|
8
|
-
return (value &&
|
|
9
|
-
typeof value == "object" &&
|
|
10
|
-
Object.entries(value).length > 0 &&
|
|
11
|
-
Object.entries(value).every(([k, v]) => k == "name" && typeof v == "string"));
|
|
12
|
-
}
|
|
13
|
-
Creatable.isPartial = isPartial;
|
|
4
|
+
Creatable.type = isly.object({ name: isly.string() });
|
|
5
|
+
Creatable.is = Creatable.type.is;
|
|
6
|
+
Creatable.flaw = Creatable.type.flaw;
|
|
14
7
|
})(Creatable || (Creatable = {}));
|
|
15
8
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Account/Creatable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Account/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAM3B,MAAM,KAAW,SAAS,CAIzB;AAJD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACtD,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EAJgB,SAAS,KAAT,SAAS,QAIzB"}
|
package/dist/Account/index.d.ts
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cryptly } from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
|
+
import { isly } from "isly";
|
|
3
4
|
import { Balances } from "../Balances";
|
|
4
5
|
import { Rail } from "../Rail";
|
|
5
6
|
import { Creatable as AccountCreatable } from "./Creatable";
|
|
6
7
|
export interface Account extends Account.Creatable {
|
|
7
8
|
readonly id: cryptly.Identifier;
|
|
8
9
|
readonly created: isoly.DateTime;
|
|
10
|
+
readonly balances: Balances;
|
|
11
|
+
readonly rails: Rail[];
|
|
9
12
|
}
|
|
10
13
|
export declare namespace Account {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
const type: isly.object.ExtendableType<Account>;
|
|
15
|
+
const is: isly.Type.IsFunction<Account>;
|
|
16
|
+
const flaw: isly.Type.FlawFunction;
|
|
13
17
|
function isIdentifier(value: cryptly.Identifier | any): value is cryptly.Identifier;
|
|
14
18
|
type Creatable = AccountCreatable;
|
|
15
19
|
const Creatable: typeof AccountCreatable;
|
|
16
|
-
type Info = Account & {
|
|
17
|
-
rails: Rail[];
|
|
18
|
-
balances: Balances;
|
|
19
|
-
};
|
|
20
|
-
namespace Info {
|
|
21
|
-
function is(value: Info | any): value is Info;
|
|
22
|
-
}
|
|
23
20
|
}
|
package/dist/Account/index.js
CHANGED
|
@@ -1,37 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { cryptly } from "cryptly";
|
|
2
2
|
import { isoly } from "isoly";
|
|
3
|
+
import { isly } from "isly";
|
|
3
4
|
import { Balances } from "../Balances";
|
|
4
5
|
import { Rail } from "../Rail";
|
|
5
6
|
import { Creatable as AccountCreatable } from "./Creatable";
|
|
6
7
|
export var Account;
|
|
7
8
|
(function (Account) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
Account.
|
|
16
|
-
|
|
17
|
-
return (Account.Creatable.is({ ...account }) && cryptly.Identifier.is(account.id, 8) && isoly.DateTime.is(account.created));
|
|
18
|
-
}
|
|
19
|
-
Account.is = is;
|
|
9
|
+
Account.type = isly.object({
|
|
10
|
+
name: isly.string(),
|
|
11
|
+
id: isly.string(),
|
|
12
|
+
created: isly.fromIs("isoly.DateTime", isoly.DateTime.is),
|
|
13
|
+
balances: isly.fromIs("Balances", Balances.is),
|
|
14
|
+
rails: isly.fromIs("Rail", Rail.is).array(),
|
|
15
|
+
});
|
|
16
|
+
Account.is = Account.type.is;
|
|
17
|
+
Account.flaw = Account.type.flaw;
|
|
20
18
|
function isIdentifier(value) {
|
|
21
19
|
return cryptly.Identifier.is(value, 8);
|
|
22
20
|
}
|
|
23
21
|
Account.isIdentifier = isIdentifier;
|
|
24
22
|
Account.Creatable = AccountCreatable;
|
|
25
|
-
let Info;
|
|
26
|
-
(function (Info) {
|
|
27
|
-
function is(value) {
|
|
28
|
-
return (typeof value == "object" &&
|
|
29
|
-
Account.is({ ...value }) &&
|
|
30
|
-
Array.isArray(value.rails) &&
|
|
31
|
-
value.rails.every((r) => Rail.is(r)) &&
|
|
32
|
-
Balances.is(value.balances));
|
|
33
|
-
}
|
|
34
|
-
Info.is = is;
|
|
35
|
-
})(Info = Account.Info || (Account.Info = {}));
|
|
36
23
|
})(Account || (Account = {}));
|
|
37
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Account/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../","sources":["Account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAU3D,MAAM,KAAW,OAAO,CAgBvB;AAhBD,WAAiB,OAAO;IACV,YAAI,GAAG,IAAI,CAAC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AK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,
|
|
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,cAAc,EAAE,OAAO,CAAC,CAAA;IAC1D,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,OAGV;QACA,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA8C,cAAc,EAAE,OAAO,CAAC,CAAA;IAC7F,CAAC;CACD"}
|
|
@@ -10,5 +10,6 @@ export interface Creatable {
|
|
|
10
10
|
}
|
|
11
11
|
export declare namespace Creatable {
|
|
12
12
|
const type: isly.object.ExtendableType<Creatable>;
|
|
13
|
-
|
|
13
|
+
const is: isly.Type.IsFunction<Creatable>;
|
|
14
|
+
const flaw: isly.Type.FlawFunction;
|
|
14
15
|
}
|
|
@@ -10,17 +10,7 @@ export var Creatable;
|
|
|
10
10
|
rules: isly.fromIs("Rule", Rule.is).array(),
|
|
11
11
|
contact: Contact.type.optional(),
|
|
12
12
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
typeof value == "object" &&
|
|
16
|
-
typeof value.name == "string" &&
|
|
17
|
-
typeof value.address == "string" &&
|
|
18
|
-
Realm.is(value.realm) &&
|
|
19
|
-
value.rules &&
|
|
20
|
-
typeof value.rules == "object" &&
|
|
21
|
-
Array.isArray(value.rules) &&
|
|
22
|
-
value.rules.every(Rule.is));
|
|
23
|
-
}
|
|
24
|
-
Creatable.is = is;
|
|
13
|
+
Creatable.is = Creatable.type.is;
|
|
14
|
+
Creatable.flaw = Creatable.type.flaw;
|
|
25
15
|
})(Creatable || (Creatable = {}));
|
|
26
16
|
//# sourceMappingURL=Creatable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAS7B,MAAM,KAAW,SAAS,
|
|
1
|
+
{"version":3,"file":"Creatable.js","sourceRoot":"../","sources":["Organization/Creatable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAS7B,MAAM,KAAW,SAAS,CASzB;AATD,WAAiB,SAAS;IACZ,cAAI,GAAG,IAAI,CAAC,MAAM,CAAY;QAC1C,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;QACnB,KAAK,EAAE,KAAK,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAO,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE;QACjD,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAA;IACW,YAAE,GAAG,UAAA,IAAI,CAAC,EAAE,CAAA;IACZ,cAAI,GAAG,UAAA,IAAI,CAAC,IAAI,CAAA;AAC9B,CAAC,EATgB,SAAS,KAAT,SAAS,QASzB"}
|