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