triangle-types 1.0.225 → 1.0.227
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/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/types/tag/Tag.d.ts +7 -0
- package/dist/src/types/tag/Tag.js +19 -0
- package/dist/src/types/user/TenantProvision.d.ts +2 -4
- package/dist/src/types/user/TenantProvision.js +4 -9
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/tag/Tag.ts +23 -0
- package/src/types/user/TenantProvision.ts +4 -9
package/dist/src/index.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ export * from "./types/state_permits/TN/TNStatePermit.js";
|
|
|
100
100
|
export * from "./types/state_permits/TN/TNStatePermitDocument.js";
|
|
101
101
|
export * from "./types/state_permits/WI/WIStatePermit.js";
|
|
102
102
|
export * from "./types/state_permits/WI/WIStatePermitDocument.js";
|
|
103
|
+
export * from "./types/tag/Tag.js";
|
|
103
104
|
export * from "./types/user/Tenant.js";
|
|
104
105
|
export * from "./types/user/TenantDocument.js";
|
|
105
106
|
export * from "./types/user/TenantDocumentFragment.js";
|
package/dist/src/index.js
CHANGED
|
@@ -100,6 +100,7 @@ export * from "./types/state_permits/TN/TNStatePermit.js";
|
|
|
100
100
|
export * from "./types/state_permits/TN/TNStatePermitDocument.js";
|
|
101
101
|
export * from "./types/state_permits/WI/WIStatePermit.js";
|
|
102
102
|
export * from "./types/state_permits/WI/WIStatePermitDocument.js";
|
|
103
|
+
export * from "./types/tag/Tag.js";
|
|
103
104
|
export * from "./types/user/Tenant.js";
|
|
104
105
|
export * from "./types/user/TenantDocument.js";
|
|
105
106
|
export * from "./types/user/TenantDocumentFragment.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Tag {
|
|
2
|
+
tag_id;
|
|
3
|
+
resource_type_id;
|
|
4
|
+
name;
|
|
5
|
+
constructor(tag) {
|
|
6
|
+
if (!Tag.is(tag)) {
|
|
7
|
+
throw Error("Invalid input.");
|
|
8
|
+
}
|
|
9
|
+
this.tag_id = tag.tag_id;
|
|
10
|
+
this.resource_type_id = tag.resource_type_id;
|
|
11
|
+
this.name = tag.name;
|
|
12
|
+
}
|
|
13
|
+
static is(tag) {
|
|
14
|
+
return (tag !== undefined &&
|
|
15
|
+
typeof tag.tag_id === "string" &&
|
|
16
|
+
typeof tag.resource_type_id === "string" &&
|
|
17
|
+
(tag.name === undefined || typeof tag.voter_id === "string"));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
declare const tenant_provision_type_ids: readonly ["
|
|
1
|
+
declare const tenant_provision_type_ids: readonly ["role", "scout", "prism", "tag", "target"];
|
|
2
2
|
export type TenantProvisionTypeID = typeof tenant_provision_type_ids[number];
|
|
3
3
|
export declare function is_tenant_provision_type_id(tenant_provision_type_id: any): tenant_provision_type_id is TenantProvisionTypeID;
|
|
4
4
|
export declare class TenantProvision {
|
|
5
5
|
readonly tenant_id: string;
|
|
6
|
-
readonly provision_id: string;
|
|
7
6
|
readonly provision_type_id: TenantProvisionTypeID;
|
|
8
|
-
readonly
|
|
9
|
-
readonly value?: any;
|
|
7
|
+
readonly provision_id: string;
|
|
10
8
|
readonly [x: string]: any;
|
|
11
9
|
constructor(tenant_provision: TenantProvision);
|
|
12
10
|
static is(tenant_provision: any): tenant_provision is TenantProvision;
|
|
@@ -1,29 +1,24 @@
|
|
|
1
|
-
const tenant_provision_type_ids = ["
|
|
1
|
+
const tenant_provision_type_ids = ["role", "scout", "prism", "tag", "target"];
|
|
2
2
|
export function is_tenant_provision_type_id(tenant_provision_type_id) {
|
|
3
3
|
return tenant_provision_type_ids.includes(tenant_provision_type_id);
|
|
4
4
|
}
|
|
5
5
|
export class TenantProvision {
|
|
6
6
|
tenant_id;
|
|
7
|
-
provision_id;
|
|
8
7
|
provision_type_id;
|
|
9
|
-
|
|
10
|
-
value;
|
|
8
|
+
provision_id;
|
|
11
9
|
constructor(tenant_provision) {
|
|
12
10
|
if (!TenantProvision.is(tenant_provision)) {
|
|
13
11
|
throw Error("Invalid Input.");
|
|
14
12
|
}
|
|
15
13
|
this.tenant_id = tenant_provision.tenant_id;
|
|
16
|
-
this.provision_id = tenant_provision.provision_id;
|
|
17
14
|
this.provision_type_id = tenant_provision.provision_type_id;
|
|
18
|
-
this.
|
|
19
|
-
this.value = tenant_provision.value;
|
|
15
|
+
this.provision_id = tenant_provision.provision_id;
|
|
20
16
|
}
|
|
21
17
|
static is(tenant_provision) {
|
|
22
18
|
return (tenant_provision !== undefined &&
|
|
23
19
|
typeof tenant_provision.tenant_id === "string" &&
|
|
24
|
-
typeof tenant_provision.provision_id === "string" &&
|
|
25
20
|
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
26
|
-
|
|
21
|
+
typeof tenant_provision.provision_id === "string");
|
|
27
22
|
}
|
|
28
23
|
}
|
|
29
24
|
export class TenantTagProvisionAux extends TenantProvision {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -123,6 +123,8 @@ export * from "./types/state_permits/TN/TNStatePermitDocument"
|
|
|
123
123
|
export * from "./types/state_permits/WI/WIStatePermit"
|
|
124
124
|
export * from "./types/state_permits/WI/WIStatePermitDocument"
|
|
125
125
|
|
|
126
|
+
export * from "./types/tag/Tag"
|
|
127
|
+
|
|
126
128
|
export * from "./types/user/Tenant"
|
|
127
129
|
export * from "./types/user/TenantDocument"
|
|
128
130
|
export * from "./types/user/TenantDocumentFragment"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class Tag {
|
|
2
|
+
readonly tag_id : string
|
|
3
|
+
readonly resource_type_id : string
|
|
4
|
+
readonly name? : string
|
|
5
|
+
|
|
6
|
+
constructor(tag : any) {
|
|
7
|
+
if (!Tag.is(tag)) {
|
|
8
|
+
throw Error("Invalid input.")
|
|
9
|
+
}
|
|
10
|
+
this.tag_id = tag.tag_id
|
|
11
|
+
this.resource_type_id = tag.resource_type_id
|
|
12
|
+
this.name = tag.name
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static is(tag : any) : tag is Tag {
|
|
16
|
+
return (
|
|
17
|
+
tag !== undefined &&
|
|
18
|
+
typeof tag.tag_id === "string" &&
|
|
19
|
+
typeof tag.resource_type_id === "string" &&
|
|
20
|
+
(tag.name === undefined || typeof tag.voter_id === "string")
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tenant_provision_type_ids = ["
|
|
1
|
+
const tenant_provision_type_ids = ["role", "scout", "prism", "tag", "target"] as const
|
|
2
2
|
|
|
3
3
|
export type TenantProvisionTypeID = typeof tenant_provision_type_ids[number]
|
|
4
4
|
|
|
@@ -8,10 +8,8 @@ export function is_tenant_provision_type_id(tenant_provision_type_id : any) : te
|
|
|
8
8
|
|
|
9
9
|
export class TenantProvision {
|
|
10
10
|
readonly tenant_id : string
|
|
11
|
-
readonly provision_id : string
|
|
12
11
|
readonly provision_type_id : TenantProvisionTypeID
|
|
13
|
-
readonly
|
|
14
|
-
readonly value? : any
|
|
12
|
+
readonly provision_id : string
|
|
15
13
|
readonly [x : string] : any
|
|
16
14
|
|
|
17
15
|
constructor(tenant_provision : TenantProvision) {
|
|
@@ -19,19 +17,16 @@ export class TenantProvision {
|
|
|
19
17
|
throw Error("Invalid Input.")
|
|
20
18
|
}
|
|
21
19
|
this.tenant_id = tenant_provision.tenant_id
|
|
22
|
-
this.provision_id = tenant_provision.provision_id
|
|
23
20
|
this.provision_type_id = tenant_provision.provision_type_id
|
|
24
|
-
this.
|
|
25
|
-
this.value = tenant_provision.value
|
|
21
|
+
this.provision_id = tenant_provision.provision_id
|
|
26
22
|
}
|
|
27
23
|
|
|
28
24
|
static is(tenant_provision : any) : tenant_provision is TenantProvision {
|
|
29
25
|
return (
|
|
30
26
|
tenant_provision !== undefined &&
|
|
31
27
|
typeof tenant_provision.tenant_id === "string" &&
|
|
32
|
-
typeof tenant_provision.provision_id === "string" &&
|
|
33
28
|
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
34
|
-
|
|
29
|
+
typeof tenant_provision.provision_id === "string"
|
|
35
30
|
)
|
|
36
31
|
}
|
|
37
32
|
}
|