triangle-types 1.0.140 → 1.0.142
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 +2 -1
- package/dist/src/index.js +2 -1
- package/dist/src/types/prism/Target.d.ts +7 -0
- package/dist/src/types/prism/Target.js +19 -0
- package/dist/src/types/prism/TenantVoterTag.d.ts +11 -0
- package/dist/src/types/prism/TenantVoterTag.js +30 -0
- package/dist/src/types/user/TenantProvision.d.ts +2 -1
- package/dist/src/types/user/TenantProvision.js +5 -2
- package/package.json +1 -1
- package/src/index.ts +2 -1
- package/src/types/prism/Target.ts +23 -0
- package/src/types/prism/TenantVoterTag.ts +36 -0
- package/src/types/user/TenantProvision.ts +5 -2
- package/src/types/prism/TenantVoterTarget.ts +0 -52
package/dist/src/index.d.ts
CHANGED
|
@@ -53,7 +53,8 @@ export * from "./types/prism/PrismFeature.js";
|
|
|
53
53
|
export * from "./types/prism/PrismSubPrism.js";
|
|
54
54
|
export * from "./types/prism/PrismSegment.js";
|
|
55
55
|
export * from "./types/prism/PrismTarget.js";
|
|
56
|
-
export * from "./types/prism/
|
|
56
|
+
export * from "./types/prism/Target.js";
|
|
57
|
+
export * from "./types/prism/TenantVoterTag.js";
|
|
57
58
|
export * from "./types/prism/UserPrismSegment.js";
|
|
58
59
|
export * from "./types/prism/Voter.js";
|
|
59
60
|
export * from "./types/prism/VoterFeature.js";
|
package/dist/src/index.js
CHANGED
|
@@ -53,7 +53,8 @@ export * from "./types/prism/PrismFeature.js";
|
|
|
53
53
|
export * from "./types/prism/PrismSubPrism.js";
|
|
54
54
|
export * from "./types/prism/PrismSegment.js";
|
|
55
55
|
export * from "./types/prism/PrismTarget.js";
|
|
56
|
-
export * from "./types/prism/
|
|
56
|
+
export * from "./types/prism/Target.js";
|
|
57
|
+
export * from "./types/prism/TenantVoterTag.js";
|
|
57
58
|
export * from "./types/prism/UserPrismSegment.js";
|
|
58
59
|
export * from "./types/prism/Voter.js";
|
|
59
60
|
export * from "./types/prism/VoterFeature.js";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export class Target {
|
|
2
|
+
target_id;
|
|
3
|
+
name;
|
|
4
|
+
description;
|
|
5
|
+
constructor(target) {
|
|
6
|
+
if (!Target.is(target)) {
|
|
7
|
+
throw Error("Invalid input.");
|
|
8
|
+
}
|
|
9
|
+
this.target_id = target.target_id;
|
|
10
|
+
this.name = target.name;
|
|
11
|
+
this.description = target.description;
|
|
12
|
+
}
|
|
13
|
+
static is(target) {
|
|
14
|
+
return (target !== undefined &&
|
|
15
|
+
typeof target.target_id === "string" &&
|
|
16
|
+
typeof target.name === "string" &&
|
|
17
|
+
typeof target.description === "string");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class TenantVoterTag {
|
|
2
|
+
readonly tenant_voter_tag_id: string;
|
|
3
|
+
readonly tenant_id: string;
|
|
4
|
+
readonly voter_id: string;
|
|
5
|
+
readonly tag_id: string;
|
|
6
|
+
readonly target_id?: string;
|
|
7
|
+
readonly user_id: string;
|
|
8
|
+
readonly time: string;
|
|
9
|
+
constructor(tenant_voter_tag: any);
|
|
10
|
+
static is(tenant_voter_tag: any): tenant_voter_tag is TenantVoterTag;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class TenantVoterTag {
|
|
2
|
+
tenant_voter_tag_id;
|
|
3
|
+
tenant_id;
|
|
4
|
+
voter_id;
|
|
5
|
+
tag_id;
|
|
6
|
+
target_id;
|
|
7
|
+
user_id;
|
|
8
|
+
time;
|
|
9
|
+
constructor(tenant_voter_tag) {
|
|
10
|
+
if (!TenantVoterTag.is(tenant_voter_tag)) {
|
|
11
|
+
throw Error("Invalid input.");
|
|
12
|
+
}
|
|
13
|
+
this.tenant_voter_tag_id = tenant_voter_tag.tenant_voter_tag_id;
|
|
14
|
+
this.tenant_id = tenant_voter_tag.tenant_id;
|
|
15
|
+
this.voter_id = tenant_voter_tag.voter_id;
|
|
16
|
+
this.tag_id = tenant_voter_tag.tag_id;
|
|
17
|
+
this.user_id = tenant_voter_tag.user_id;
|
|
18
|
+
this.time = tenant_voter_tag.time;
|
|
19
|
+
}
|
|
20
|
+
static is(tenant_voter_tag) {
|
|
21
|
+
return (tenant_voter_tag !== undefined &&
|
|
22
|
+
typeof tenant_voter_tag.tenant_voter_tag_id === "string" &&
|
|
23
|
+
typeof tenant_voter_tag.tenant_id === "string" &&
|
|
24
|
+
typeof tenant_voter_tag.voter_id === "string" &&
|
|
25
|
+
typeof tenant_voter_tag.tag_id === "string" &&
|
|
26
|
+
(tenant_voter_tag.target_id === undefined || typeof tenant_voter_tag === "string") &&
|
|
27
|
+
typeof tenant_voter_tag.user_id === "string" &&
|
|
28
|
+
typeof tenant_voter_tag.time === "string");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
declare const tenant_provision_type_ids: readonly ["supreme_admin", "scout", "prism"];
|
|
1
|
+
declare const tenant_provision_type_ids: readonly ["supreme_admin", "scout", "prism", "tag"];
|
|
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
6
|
readonly provision_id: string;
|
|
7
7
|
readonly provision_type_id: TenantProvisionTypeID;
|
|
8
|
+
readonly name?: string;
|
|
8
9
|
readonly value?: any;
|
|
9
10
|
constructor(tenant_provision: TenantProvision);
|
|
10
11
|
static is(tenant_provision: any): tenant_provision is TenantProvision;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tenant_provision_type_ids = ["supreme_admin", "scout", "prism"];
|
|
1
|
+
const tenant_provision_type_ids = ["supreme_admin", "scout", "prism", "tag"];
|
|
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
|
}
|
|
@@ -6,6 +6,7 @@ export class TenantProvision {
|
|
|
6
6
|
tenant_id;
|
|
7
7
|
provision_id;
|
|
8
8
|
provision_type_id;
|
|
9
|
+
name;
|
|
9
10
|
value;
|
|
10
11
|
// readonly [x : string] : any
|
|
11
12
|
constructor(tenant_provision) {
|
|
@@ -14,13 +15,15 @@ export class TenantProvision {
|
|
|
14
15
|
}
|
|
15
16
|
this.tenant_id = tenant_provision.tenant_id;
|
|
16
17
|
this.provision_id = tenant_provision.provision_id;
|
|
18
|
+
this.name = tenant_provision.name;
|
|
17
19
|
this.provision_type_id = tenant_provision.provision_type_id;
|
|
18
20
|
this.value = tenant_provision.value;
|
|
19
21
|
}
|
|
20
22
|
static is(tenant_provision) {
|
|
21
23
|
return (tenant_provision !== undefined &&
|
|
22
24
|
typeof tenant_provision.tenant_id === "string" &&
|
|
25
|
+
typeof tenant_provision.provision_id === "string" &&
|
|
23
26
|
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
24
|
-
typeof tenant_provision.
|
|
27
|
+
(tenant_provision === undefined || typeof tenant_provision.name === "string"));
|
|
25
28
|
}
|
|
26
29
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -64,7 +64,8 @@ export * from "./types/prism/PrismFeature"
|
|
|
64
64
|
export * from "./types/prism/PrismSubPrism"
|
|
65
65
|
export * from "./types/prism/PrismSegment"
|
|
66
66
|
export * from "./types/prism/PrismTarget"
|
|
67
|
-
export * from "./types/prism/
|
|
67
|
+
export * from "./types/prism/Target"
|
|
68
|
+
export * from "./types/prism/TenantVoterTag"
|
|
68
69
|
export * from "./types/prism/UserPrismSegment"
|
|
69
70
|
export * from "./types/prism/Voter"
|
|
70
71
|
export * from "./types/prism/VoterFeature"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export class Target {
|
|
2
|
+
readonly target_id : string
|
|
3
|
+
readonly name : string
|
|
4
|
+
readonly description : string
|
|
5
|
+
|
|
6
|
+
constructor(target : any) {
|
|
7
|
+
if (!Target.is(target)) {
|
|
8
|
+
throw Error("Invalid input.")
|
|
9
|
+
}
|
|
10
|
+
this.target_id = target.target_id
|
|
11
|
+
this.name = target.name
|
|
12
|
+
this.description = target.description
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
static is(target : any) : target is Target {
|
|
16
|
+
return (
|
|
17
|
+
target !== undefined &&
|
|
18
|
+
typeof target.target_id === "string" &&
|
|
19
|
+
typeof target.name === "string" &&
|
|
20
|
+
typeof target.description === "string"
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { is_state_id, StateID } from "../regions/State"
|
|
2
|
+
|
|
3
|
+
export class TenantVoterTag {
|
|
4
|
+
readonly tenant_voter_tag_id : string
|
|
5
|
+
readonly tenant_id : string
|
|
6
|
+
readonly voter_id : string
|
|
7
|
+
readonly tag_id : string
|
|
8
|
+
readonly target_id? : string
|
|
9
|
+
readonly user_id : string
|
|
10
|
+
readonly time : string
|
|
11
|
+
|
|
12
|
+
constructor(tenant_voter_tag : any) {
|
|
13
|
+
if (!TenantVoterTag.is(tenant_voter_tag)) {
|
|
14
|
+
throw Error("Invalid input.")
|
|
15
|
+
}
|
|
16
|
+
this.tenant_voter_tag_id = tenant_voter_tag.tenant_voter_tag_id
|
|
17
|
+
this.tenant_id = tenant_voter_tag.tenant_id
|
|
18
|
+
this.voter_id = tenant_voter_tag.voter_id
|
|
19
|
+
this.tag_id = tenant_voter_tag.tag_id
|
|
20
|
+
this.user_id = tenant_voter_tag.user_id
|
|
21
|
+
this.time = tenant_voter_tag.time
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static is(tenant_voter_tag : any) : tenant_voter_tag is TenantVoterTag {
|
|
25
|
+
return (
|
|
26
|
+
tenant_voter_tag !== undefined &&
|
|
27
|
+
typeof tenant_voter_tag.tenant_voter_tag_id === "string" &&
|
|
28
|
+
typeof tenant_voter_tag.tenant_id === "string" &&
|
|
29
|
+
typeof tenant_voter_tag.voter_id === "string" &&
|
|
30
|
+
typeof tenant_voter_tag.tag_id === "string" &&
|
|
31
|
+
(tenant_voter_tag.target_id === undefined || typeof tenant_voter_tag === "string") &&
|
|
32
|
+
typeof tenant_voter_tag.user_id === "string" &&
|
|
33
|
+
typeof tenant_voter_tag.time === "string"
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const tenant_provision_type_ids = ["supreme_admin", "scout", "prism"] as const
|
|
1
|
+
const tenant_provision_type_ids = ["supreme_admin", "scout", "prism", "tag"] as const
|
|
2
2
|
|
|
3
3
|
export type TenantProvisionTypeID = typeof tenant_provision_type_ids[number]
|
|
4
4
|
|
|
@@ -11,6 +11,7 @@ export class TenantProvision {
|
|
|
11
11
|
readonly tenant_id : string
|
|
12
12
|
readonly provision_id : string
|
|
13
13
|
readonly provision_type_id : TenantProvisionTypeID
|
|
14
|
+
readonly name? : string
|
|
14
15
|
readonly value? : any
|
|
15
16
|
// readonly [x : string] : any
|
|
16
17
|
|
|
@@ -20,6 +21,7 @@ export class TenantProvision {
|
|
|
20
21
|
}
|
|
21
22
|
this.tenant_id = tenant_provision.tenant_id
|
|
22
23
|
this.provision_id = tenant_provision.provision_id
|
|
24
|
+
this.name = tenant_provision.name
|
|
23
25
|
this.provision_type_id = tenant_provision.provision_type_id
|
|
24
26
|
this.value = tenant_provision.value
|
|
25
27
|
}
|
|
@@ -28,8 +30,9 @@ export class TenantProvision {
|
|
|
28
30
|
return (
|
|
29
31
|
tenant_provision !== undefined &&
|
|
30
32
|
typeof tenant_provision.tenant_id === "string" &&
|
|
33
|
+
typeof tenant_provision.provision_id === "string" &&
|
|
31
34
|
is_tenant_provision_type_id(tenant_provision.provision_type_id) &&
|
|
32
|
-
typeof tenant_provision.
|
|
35
|
+
(tenant_provision === undefined || typeof tenant_provision.name === "string")
|
|
33
36
|
)
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { is_state_id, StateID } from "../regions/State"
|
|
2
|
-
|
|
3
|
-
export class TenantVoterTarget {
|
|
4
|
-
readonly tenant_voter_target_id : string
|
|
5
|
-
readonly tenant_id : string
|
|
6
|
-
readonly voter_id : string
|
|
7
|
-
readonly target_id : string
|
|
8
|
-
readonly value : number
|
|
9
|
-
readonly user_id : string
|
|
10
|
-
// readonly federal_congress_district_id? : string
|
|
11
|
-
// readonly state_legislature_house_district_id? : string
|
|
12
|
-
// readonly state_legislature_senate_district_id? : string
|
|
13
|
-
// readonly county_id? : string
|
|
14
|
-
// readonly school_district_id? : string
|
|
15
|
-
// readonly party_type_id : VoterPartyTypeID
|
|
16
|
-
|
|
17
|
-
constructor(tenant_voter_target : any) {
|
|
18
|
-
if (!TenantVoterTarget.is(tenant_voter_target)) {
|
|
19
|
-
throw Error("Invalid input.")
|
|
20
|
-
}
|
|
21
|
-
this.tenant_voter_target_id = tenant_voter_target.tenant_voter_target_id
|
|
22
|
-
this.tenant_id = tenant_voter_target.tenant_id
|
|
23
|
-
this.voter_id = tenant_voter_target.voter_id
|
|
24
|
-
this.target_id = tenant_voter_target.target_id
|
|
25
|
-
this.value = tenant_voter_target.value
|
|
26
|
-
this.user_id = tenant_voter_target.user_id
|
|
27
|
-
// this.federal_congress_district_id = tenant_voter_target.federal_congress_district_id
|
|
28
|
-
// this.state_legislature_house_district_id = tenant_voter_target.state_legislature_house_district_id
|
|
29
|
-
// this.state_legislature_senate_district_id = tenant_voter_target.state_legislature_senate_district_id
|
|
30
|
-
// this.county_id = tenant_voter_target.county_id
|
|
31
|
-
// this.school_district_id = tenant_voter_target.school_district_id
|
|
32
|
-
// this.party_type_id = tenant_voter_target.party_type_id
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static is(tenant_voter_target : any) : tenant_voter_target is TenantVoterTarget {
|
|
36
|
-
return (
|
|
37
|
-
tenant_voter_target !== undefined &&
|
|
38
|
-
typeof tenant_voter_target.tenant_voter_target_id === "string" &&
|
|
39
|
-
typeof tenant_voter_target.tenant_id === "string" &&
|
|
40
|
-
typeof tenant_voter_target.voter_id === "string" &&
|
|
41
|
-
typeof tenant_voter_target.target_id === "string" &&
|
|
42
|
-
typeof tenant_voter_target.value === "number" &&
|
|
43
|
-
typeof tenant_voter_target.user_id === "string"// &&
|
|
44
|
-
// (tenant_voter_target.federal_congress_district_id === undefined || typeof tenant_voter_target.federal_congress_district_id === "string") &&
|
|
45
|
-
// (tenant_voter_target.state_legislature_house_district_id === undefined || typeof tenant_voter_target.state_legislature_house_district_id === "string") &&
|
|
46
|
-
// (tenant_voter_target.state_legislature_senate_district_id === undefined || typeof tenant_voter_target.state_legislature_senate_district_id === "string") &&
|
|
47
|
-
// (tenant_voter_target.county_id === undefined || typeof tenant_voter_target.county_id === "string") &&
|
|
48
|
-
// (tenant_voter_target.school_district_id === undefined || typeof tenant_voter_target.school_district_id === "string") &&
|
|
49
|
-
// is_voter_party_type_id(tenant_voter_target.party_type_id)
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
}
|