triangle-types 1.0.151 → 1.0.153
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/TenantProvision.d.ts +7 -0
- package/dist/src/types/user/TenantProvision.js +18 -1
- package/dist/src/types/user/UserComment.d.ts +1 -0
- package/dist/src/types/user/UserComment.js +4 -1
- package/package.json +1 -1
- package/src/types/user/TenantProvision.ts +24 -2
- package/src/types/user/UserComment.ts +4 -1
|
@@ -7,7 +7,14 @@ export declare class TenantProvision {
|
|
|
7
7
|
readonly provision_type_id: TenantProvisionTypeID;
|
|
8
8
|
readonly name?: string;
|
|
9
9
|
readonly value?: any;
|
|
10
|
+
readonly [x: string]: any;
|
|
10
11
|
constructor(tenant_provision: TenantProvision);
|
|
11
12
|
static is(tenant_provision: any): tenant_provision is TenantProvision;
|
|
12
13
|
}
|
|
14
|
+
export declare class TenantTagProvisionAux extends TenantProvision {
|
|
15
|
+
readonly provision_type_id: "tag";
|
|
16
|
+
readonly num_voters: number;
|
|
17
|
+
constructor(tenant_provision: TenantTagProvisionAux);
|
|
18
|
+
static is(tenant_provision: any): tenant_provision is TenantTagProvisionAux;
|
|
19
|
+
}
|
|
13
20
|
export {};
|
|
@@ -8,7 +8,6 @@ export class TenantProvision {
|
|
|
8
8
|
provision_type_id;
|
|
9
9
|
name;
|
|
10
10
|
value;
|
|
11
|
-
// readonly [x : string] : any
|
|
12
11
|
constructor(tenant_provision) {
|
|
13
12
|
if (!TenantProvision.is(tenant_provision)) {
|
|
14
13
|
throw Error("Invalid Input.");
|
|
@@ -27,3 +26,21 @@ export class TenantProvision {
|
|
|
27
26
|
(tenant_provision.name === undefined || typeof tenant_provision.name === "string"));
|
|
28
27
|
}
|
|
29
28
|
}
|
|
29
|
+
export class TenantTagProvisionAux extends TenantProvision {
|
|
30
|
+
provision_type_id;
|
|
31
|
+
num_voters;
|
|
32
|
+
// readonly [x : string] : any
|
|
33
|
+
constructor(tenant_provision) {
|
|
34
|
+
if (!TenantTagProvisionAux.is(tenant_provision)) {
|
|
35
|
+
throw Error("Invalid Input.");
|
|
36
|
+
}
|
|
37
|
+
super(tenant_provision);
|
|
38
|
+
this.provision_type_id = "tag";
|
|
39
|
+
this.num_voters = tenant_provision.num_voters;
|
|
40
|
+
}
|
|
41
|
+
static is(tenant_provision) {
|
|
42
|
+
return (TenantProvision.is(tenant_provision) &&
|
|
43
|
+
tenant_provision.provision_type_id === "tag" &&
|
|
44
|
+
typeof tenant_provision.num_voters === "number");
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -6,6 +6,7 @@ export declare class UserComment {
|
|
|
6
6
|
readonly resource_type_id: string;
|
|
7
7
|
readonly resource_id: string;
|
|
8
8
|
readonly text: string;
|
|
9
|
+
readonly is_active: boolean;
|
|
9
10
|
constructor(user_comment: UserComment);
|
|
10
11
|
static is(user_comment: any): user_comment is UserComment;
|
|
11
12
|
}
|
|
@@ -6,6 +6,7 @@ export class UserComment {
|
|
|
6
6
|
resource_type_id;
|
|
7
7
|
resource_id;
|
|
8
8
|
text;
|
|
9
|
+
is_active;
|
|
9
10
|
// readonly [x : string] : any
|
|
10
11
|
constructor(user_comment) {
|
|
11
12
|
if (!UserComment.is(user_comment)) {
|
|
@@ -18,6 +19,7 @@ export class UserComment {
|
|
|
18
19
|
this.resource_type_id = user_comment.resource_type_id;
|
|
19
20
|
this.resource_id = user_comment.resource_id;
|
|
20
21
|
this.text = user_comment.text;
|
|
22
|
+
this.is_active = user_comment.is_active;
|
|
21
23
|
}
|
|
22
24
|
static is(user_comment) {
|
|
23
25
|
return (user_comment !== undefined &&
|
|
@@ -27,6 +29,7 @@ export class UserComment {
|
|
|
27
29
|
typeof user_comment.tenant_id === "string" &&
|
|
28
30
|
typeof user_comment.resource_type_id === "string" &&
|
|
29
31
|
typeof user_comment.resource_id === "string" &&
|
|
30
|
-
typeof user_comment.text === "string"
|
|
32
|
+
typeof user_comment.text === "string" &&
|
|
33
|
+
typeof user_comment.is_active === "boolean");
|
|
31
34
|
}
|
|
32
35
|
}
|
package/package.json
CHANGED
|
@@ -6,14 +6,13 @@ export function is_tenant_provision_type_id(tenant_provision_type_id : any) : te
|
|
|
6
6
|
return tenant_provision_type_ids.includes(tenant_provision_type_id)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
export class TenantProvision {
|
|
11
10
|
readonly tenant_id : string
|
|
12
11
|
readonly provision_id : string
|
|
13
12
|
readonly provision_type_id : TenantProvisionTypeID
|
|
14
13
|
readonly name? : string
|
|
15
14
|
readonly value? : any
|
|
16
|
-
|
|
15
|
+
readonly [x : string] : any
|
|
17
16
|
|
|
18
17
|
constructor(tenant_provision : TenantProvision) {
|
|
19
18
|
if (!TenantProvision.is(tenant_provision)) {
|
|
@@ -35,4 +34,27 @@ export class TenantProvision {
|
|
|
35
34
|
(tenant_provision.name === undefined || typeof tenant_provision.name === "string")
|
|
36
35
|
)
|
|
37
36
|
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export class TenantTagProvisionAux extends TenantProvision {
|
|
40
|
+
readonly provision_type_id : "tag"
|
|
41
|
+
readonly num_voters : number
|
|
42
|
+
// readonly [x : string] : any
|
|
43
|
+
|
|
44
|
+
constructor(tenant_provision : TenantTagProvisionAux) {
|
|
45
|
+
if (!TenantTagProvisionAux.is(tenant_provision)) {
|
|
46
|
+
throw Error("Invalid Input.")
|
|
47
|
+
}
|
|
48
|
+
super(tenant_provision)
|
|
49
|
+
this.provision_type_id = "tag"
|
|
50
|
+
this.num_voters = tenant_provision.num_voters
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static is(tenant_provision : any) : tenant_provision is TenantTagProvisionAux {
|
|
54
|
+
return (
|
|
55
|
+
TenantProvision.is(tenant_provision) &&
|
|
56
|
+
tenant_provision.provision_type_id === "tag" &&
|
|
57
|
+
typeof tenant_provision.num_voters === "number"
|
|
58
|
+
)
|
|
59
|
+
}
|
|
38
60
|
}
|
|
@@ -6,6 +6,7 @@ export class UserComment {
|
|
|
6
6
|
readonly resource_type_id : string
|
|
7
7
|
readonly resource_id : string
|
|
8
8
|
readonly text : string
|
|
9
|
+
readonly is_active : boolean
|
|
9
10
|
// readonly [x : string] : any
|
|
10
11
|
|
|
11
12
|
constructor(user_comment : UserComment) {
|
|
@@ -19,6 +20,7 @@ export class UserComment {
|
|
|
19
20
|
this.resource_type_id = user_comment.resource_type_id
|
|
20
21
|
this.resource_id = user_comment.resource_id
|
|
21
22
|
this.text = user_comment.text
|
|
23
|
+
this.is_active = user_comment.is_active
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
static is(user_comment : any) : user_comment is UserComment {
|
|
@@ -30,7 +32,8 @@ export class UserComment {
|
|
|
30
32
|
typeof user_comment.tenant_id === "string" &&
|
|
31
33
|
typeof user_comment.resource_type_id === "string" &&
|
|
32
34
|
typeof user_comment.resource_id === "string" &&
|
|
33
|
-
typeof user_comment.text === "string"
|
|
35
|
+
typeof user_comment.text === "string" &&
|
|
36
|
+
typeof user_comment.is_active === "boolean"
|
|
34
37
|
)
|
|
35
38
|
}
|
|
36
39
|
}
|