triangle-types 1.0.119 → 1.0.121
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/dist/src/types/user/Tenant.d.ts +0 -6
- package/dist/src/types/user/Tenant.js +0 -15
- package/dist/src/types/user/TenantProvision.d.ts +1 -0
- package/dist/src/types/user/TenantProvision.js +3 -0
- package/dist/src/types/user/User.d.ts +0 -6
- package/dist/src/types/user/User.js +16 -27
- package/package.json +1 -1
- package/src/types/user/Tenant.ts +0 -21
- package/src/types/user/TenantProvision.ts +3 -0
- package/src/types/user/User.ts +16 -31
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TenantProvision } from "./TenantProvision.js";
|
|
2
1
|
export declare class Tenant {
|
|
3
2
|
readonly tenant_id: string;
|
|
4
3
|
readonly name: string;
|
|
@@ -6,8 +5,3 @@ export declare class Tenant {
|
|
|
6
5
|
constructor(tenant: Tenant);
|
|
7
6
|
static is(tenant: any): tenant is Tenant;
|
|
8
7
|
}
|
|
9
|
-
export declare class TenantAux extends Tenant {
|
|
10
|
-
readonly provisions: TenantProvision[];
|
|
11
|
-
constructor(tenant: Tenant);
|
|
12
|
-
static is(tenant: any): tenant is TenantAux;
|
|
13
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TenantProvision } from "./TenantProvision.js";
|
|
2
1
|
export class Tenant {
|
|
3
2
|
tenant_id;
|
|
4
3
|
name;
|
|
@@ -15,17 +14,3 @@ export class Tenant {
|
|
|
15
14
|
typeof tenant.name === "string");
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
export class TenantAux extends Tenant {
|
|
19
|
-
provisions;
|
|
20
|
-
constructor(tenant) {
|
|
21
|
-
if (!TenantAux.is(tenant)) {
|
|
22
|
-
throw Error("Invalid Input.");
|
|
23
|
-
}
|
|
24
|
-
super(tenant);
|
|
25
|
-
this.provisions = tenant.provisions;
|
|
26
|
-
}
|
|
27
|
-
static is(tenant) {
|
|
28
|
-
return (Tenant.is(tenant) &&
|
|
29
|
-
Array.isArray(tenant.provisions) && tenant.provisions.every(TenantProvision.is));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -4,6 +4,7 @@ export declare function is_tenant_provision_type_id(tenant_provision_type_id: an
|
|
|
4
4
|
export declare class TenantProvision {
|
|
5
5
|
readonly tenant_id: string;
|
|
6
6
|
readonly provision_id: string;
|
|
7
|
+
readonly provision_type_id: TenantProvisionTypeID;
|
|
7
8
|
readonly value?: any;
|
|
8
9
|
constructor(tenant_provision: TenantProvision);
|
|
9
10
|
static is(tenant_provision: any): tenant_provision is TenantProvision;
|
|
@@ -5,6 +5,7 @@ export function is_tenant_provision_type_id(tenant_provision_type_id) {
|
|
|
5
5
|
export class TenantProvision {
|
|
6
6
|
tenant_id;
|
|
7
7
|
provision_id;
|
|
8
|
+
provision_type_id;
|
|
8
9
|
value;
|
|
9
10
|
// readonly [x : string] : any
|
|
10
11
|
constructor(tenant_provision) {
|
|
@@ -13,11 +14,13 @@ export class TenantProvision {
|
|
|
13
14
|
}
|
|
14
15
|
this.tenant_id = tenant_provision.tenant_id;
|
|
15
16
|
this.provision_id = tenant_provision.provision_id;
|
|
17
|
+
this.provision_type_id = tenant_provision.provision_type_id;
|
|
16
18
|
this.value = tenant_provision.value;
|
|
17
19
|
}
|
|
18
20
|
static is(tenant_provision) {
|
|
19
21
|
return (tenant_provision !== undefined &&
|
|
20
22
|
typeof tenant_provision.tenant_id === "string" &&
|
|
23
|
+
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
21
24
|
typeof tenant_provision.provision_id === "string");
|
|
22
25
|
}
|
|
23
26
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TenantAux } from "./Tenant.js";
|
|
2
1
|
export declare class User {
|
|
3
2
|
readonly user_id: string;
|
|
4
3
|
readonly email: string;
|
|
@@ -7,8 +6,3 @@ export declare class User {
|
|
|
7
6
|
constructor(user: User);
|
|
8
7
|
static is(user: any): user is User;
|
|
9
8
|
}
|
|
10
|
-
export declare class UserAux extends User {
|
|
11
|
-
readonly tenant?: TenantAux;
|
|
12
|
-
constructor(user: UserAux);
|
|
13
|
-
static is(user: any): user is UserAux;
|
|
14
|
-
}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import { TenantAux } from "./Tenant.js";
|
|
2
1
|
export class User {
|
|
3
2
|
user_id;
|
|
4
3
|
email;
|
|
5
|
-
// readonly is_admin_elections : boolean
|
|
6
|
-
// readonly is_admin_prism : boolean
|
|
7
|
-
// readonly is_admin_scout : boolean
|
|
8
|
-
// readonly is_admin_triage : boolean
|
|
9
4
|
tenant_id;
|
|
10
5
|
constructor(user) {
|
|
11
6
|
if (!User.is(user)) {
|
|
@@ -13,34 +8,28 @@ export class User {
|
|
|
13
8
|
}
|
|
14
9
|
this.user_id = user.user_id;
|
|
15
10
|
this.email = user.email;
|
|
16
|
-
// this.is_admin_elections = user.is_admin_elections
|
|
17
|
-
// this.is_admin_prism = user.is_admin_prism
|
|
18
|
-
// this.is_admin_scout = user.is_admin_scout
|
|
19
|
-
// this.is_admin_triage = user.is_admin_triage
|
|
20
11
|
this.tenant_id = user.tenant_id;
|
|
21
12
|
}
|
|
22
13
|
static is(user) {
|
|
23
14
|
return (user !== undefined &&
|
|
24
15
|
typeof user.user_id === "string" &&
|
|
25
16
|
typeof user.email === "string" &&
|
|
26
|
-
// typeof user.is_admin_elections === "boolean" &&
|
|
27
|
-
// typeof user.is_admin_prism === "boolean" &&
|
|
28
|
-
// typeof user.is_admin_scout === "boolean" &&
|
|
29
|
-
// typeof user.is_admin_triage === "boolean" &&
|
|
30
17
|
(user.tenant_id === undefined || typeof user.tenant_id === "string"));
|
|
31
18
|
}
|
|
32
19
|
}
|
|
33
|
-
export class UserAux extends User {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
20
|
+
// export class UserAux extends User {
|
|
21
|
+
// readonly tenant? : TenantAux
|
|
22
|
+
// constructor (user : UserAux) {
|
|
23
|
+
// if (!UserAux.is(user)) {
|
|
24
|
+
// throw Error("Invalid Input.")
|
|
25
|
+
// }
|
|
26
|
+
// super(user)
|
|
27
|
+
// this.tenant = user.tenant
|
|
28
|
+
// }
|
|
29
|
+
// static is(user : any) : user is UserAux {
|
|
30
|
+
// return (
|
|
31
|
+
// User.is(user) &&
|
|
32
|
+
// (user.tenant === undefined || TenantAux.is(user.tenant))
|
|
33
|
+
// )
|
|
34
|
+
// }
|
|
35
|
+
// }
|
package/package.json
CHANGED
package/src/types/user/Tenant.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TenantProvision } from "./TenantProvision"
|
|
2
|
-
|
|
3
1
|
export class Tenant {
|
|
4
2
|
readonly tenant_id : string
|
|
5
3
|
readonly name : string
|
|
@@ -20,23 +18,4 @@ export class Tenant {
|
|
|
20
18
|
typeof tenant.name === "string"
|
|
21
19
|
)
|
|
22
20
|
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export class TenantAux extends Tenant {
|
|
26
|
-
readonly provisions : TenantProvision[]
|
|
27
|
-
|
|
28
|
-
constructor(tenant : Tenant) {
|
|
29
|
-
if (!TenantAux.is(tenant)) {
|
|
30
|
-
throw Error("Invalid Input.")
|
|
31
|
-
}
|
|
32
|
-
super(tenant)
|
|
33
|
-
this.provisions = tenant.provisions
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static is(tenant : any) : tenant is TenantAux {
|
|
37
|
-
return (
|
|
38
|
-
Tenant.is(tenant) &&
|
|
39
|
-
Array.isArray(tenant.provisions) && tenant.provisions.every(TenantProvision.is)
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
21
|
}
|
|
@@ -10,6 +10,7 @@ export function is_tenant_provision_type_id(tenant_provision_type_id : any) : te
|
|
|
10
10
|
export class TenantProvision {
|
|
11
11
|
readonly tenant_id : string
|
|
12
12
|
readonly provision_id : string
|
|
13
|
+
readonly provision_type_id : TenantProvisionTypeID
|
|
13
14
|
readonly value? : any
|
|
14
15
|
// readonly [x : string] : any
|
|
15
16
|
|
|
@@ -19,6 +20,7 @@ export class TenantProvision {
|
|
|
19
20
|
}
|
|
20
21
|
this.tenant_id = tenant_provision.tenant_id
|
|
21
22
|
this.provision_id = tenant_provision.provision_id
|
|
23
|
+
this.provision_type_id = tenant_provision.provision_type_id
|
|
22
24
|
this.value = tenant_provision.value
|
|
23
25
|
}
|
|
24
26
|
|
|
@@ -26,6 +28,7 @@ export class TenantProvision {
|
|
|
26
28
|
return (
|
|
27
29
|
tenant_provision !== undefined &&
|
|
28
30
|
typeof tenant_provision.tenant_id === "string" &&
|
|
31
|
+
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
29
32
|
typeof tenant_provision.provision_id === "string"
|
|
30
33
|
)
|
|
31
34
|
}
|
package/src/types/user/User.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import { Tenant, TenantAux } from "./Tenant"
|
|
2
|
-
import { TenantProvision } from "./TenantProvision"
|
|
3
|
-
|
|
4
1
|
export class User {
|
|
5
2
|
readonly user_id : string
|
|
6
3
|
readonly email : string
|
|
7
|
-
// readonly is_admin_elections : boolean
|
|
8
|
-
// readonly is_admin_prism : boolean
|
|
9
|
-
// readonly is_admin_scout : boolean
|
|
10
|
-
// readonly is_admin_triage : boolean
|
|
11
4
|
readonly tenant_id? : string
|
|
12
5
|
readonly [x : string] : any
|
|
13
6
|
|
|
@@ -17,10 +10,6 @@ export class User {
|
|
|
17
10
|
}
|
|
18
11
|
this.user_id = user.user_id
|
|
19
12
|
this.email = user.email
|
|
20
|
-
// this.is_admin_elections = user.is_admin_elections
|
|
21
|
-
// this.is_admin_prism = user.is_admin_prism
|
|
22
|
-
// this.is_admin_scout = user.is_admin_scout
|
|
23
|
-
// this.is_admin_triage = user.is_admin_triage
|
|
24
13
|
this.tenant_id = user.tenant_id
|
|
25
14
|
}
|
|
26
15
|
|
|
@@ -29,30 +18,26 @@ export class User {
|
|
|
29
18
|
user !== undefined &&
|
|
30
19
|
typeof user.user_id === "string" &&
|
|
31
20
|
typeof user.email === "string" &&
|
|
32
|
-
// typeof user.is_admin_elections === "boolean" &&
|
|
33
|
-
// typeof user.is_admin_prism === "boolean" &&
|
|
34
|
-
// typeof user.is_admin_scout === "boolean" &&
|
|
35
|
-
// typeof user.is_admin_triage === "boolean" &&
|
|
36
21
|
(user.tenant_id === undefined || typeof user.tenant_id === "string")
|
|
37
22
|
)
|
|
38
23
|
}
|
|
39
24
|
}
|
|
40
25
|
|
|
41
|
-
export class UserAux extends User {
|
|
42
|
-
|
|
26
|
+
// export class UserAux extends User {
|
|
27
|
+
// readonly tenant? : TenantAux
|
|
43
28
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
29
|
+
// constructor (user : UserAux) {
|
|
30
|
+
// if (!UserAux.is(user)) {
|
|
31
|
+
// throw Error("Invalid Input.")
|
|
32
|
+
// }
|
|
33
|
+
// super(user)
|
|
34
|
+
// this.tenant = user.tenant
|
|
35
|
+
// }
|
|
51
36
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
37
|
+
// static is(user : any) : user is UserAux {
|
|
38
|
+
// return (
|
|
39
|
+
// User.is(user) &&
|
|
40
|
+
// (user.tenant === undefined || TenantAux.is(user.tenant))
|
|
41
|
+
// )
|
|
42
|
+
// }
|
|
43
|
+
// }
|