triangle-types 1.0.132 → 1.0.134
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 -1
- package/dist/src/index.js +1 -1
- package/dist/src/types/federal_elections/FederalElectionF1File.d.ts +0 -2
- package/dist/src/types/federal_elections/FederalElectionF1File.js +3 -4
- package/dist/src/types/prism/TenantVoterTarget.d.ts +11 -0
- package/dist/src/types/prism/TenantVoterTarget.js +48 -0
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/types/federal_elections/FederalElectionF1File.ts +3 -3
- package/src/types/prism/TenantVoterTarget.ts +52 -0
- package/src/types/prism/UserPrism.ts +0 -23
package/dist/src/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export * from "./types/prism/PrismFeature.js";
|
|
|
52
52
|
export * from "./types/prism/PrismSubPrism.js";
|
|
53
53
|
export * from "./types/prism/PrismSegment.js";
|
|
54
54
|
export * from "./types/prism/PrismTarget.js";
|
|
55
|
-
export * from "./types/prism/
|
|
55
|
+
export * from "./types/prism/TenantVoterTarget.js";
|
|
56
56
|
export * from "./types/prism/UserPrismSegment.js";
|
|
57
57
|
export * from "./types/prism/Voter.js";
|
|
58
58
|
export * from "./types/prism/VoterFeature.js";
|
package/dist/src/index.js
CHANGED
|
@@ -52,7 +52,7 @@ export * from "./types/prism/PrismFeature.js";
|
|
|
52
52
|
export * from "./types/prism/PrismSubPrism.js";
|
|
53
53
|
export * from "./types/prism/PrismSegment.js";
|
|
54
54
|
export * from "./types/prism/PrismTarget.js";
|
|
55
|
-
export * from "./types/prism/
|
|
55
|
+
export * from "./types/prism/TenantVoterTarget.js";
|
|
56
56
|
export * from "./types/prism/UserPrismSegment.js";
|
|
57
57
|
export * from "./types/prism/Voter.js";
|
|
58
58
|
export * from "./types/prism/VoterFeature.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FederalElectionCommitteeDesignation } from "./FederalElectionCommittee.js";
|
|
2
|
-
import { FederalElectionID } from "./FederalElection.js";
|
|
3
2
|
import { FederalElectionFile } from "./FederalElectionFile.js";
|
|
4
3
|
export declare class FederalElectionF1File extends FederalElectionFile {
|
|
5
4
|
readonly federal_election_committee_id: string;
|
|
@@ -7,7 +6,6 @@ export declare class FederalElectionF1File extends FederalElectionFile {
|
|
|
7
6
|
readonly url?: string;
|
|
8
7
|
readonly report_date: string;
|
|
9
8
|
readonly designation: FederalElectionCommitteeDesignation;
|
|
10
|
-
readonly federal_election_id?: FederalElectionID;
|
|
11
9
|
readonly federal_election_candidate_id?: string;
|
|
12
10
|
readonly jfp_federal_election_committee_ids?: string[];
|
|
13
11
|
readonly jfr_federal_election_committee_ids: string[];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { is_federal_election_committee_designation } from "./FederalElectionCommittee.js";
|
|
2
|
-
import { is_federal_election_id } from "./FederalElection.js";
|
|
3
2
|
import { FederalElectionFile } from "./FederalElectionFile.js";
|
|
4
3
|
export class FederalElectionF1File extends FederalElectionFile {
|
|
5
4
|
federal_election_committee_id;
|
|
@@ -7,7 +6,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
7
6
|
url;
|
|
8
7
|
report_date;
|
|
9
8
|
designation;
|
|
10
|
-
federal_election_id
|
|
9
|
+
// readonly federal_election_id? : FederalElectionID
|
|
11
10
|
federal_election_candidate_id;
|
|
12
11
|
jfp_federal_election_committee_ids;
|
|
13
12
|
jfr_federal_election_committee_ids;
|
|
@@ -23,7 +22,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
23
22
|
this.url = federal_election_file.url;
|
|
24
23
|
this.report_date = federal_election_file.report_date;
|
|
25
24
|
this.designation = federal_election_file.designation;
|
|
26
|
-
this.federal_election_id = federal_election_file.federal_election_id
|
|
25
|
+
// this.federal_election_id = federal_election_file.federal_election_id
|
|
27
26
|
this.federal_election_candidate_id = federal_election_file.federal_election_candidate_id;
|
|
28
27
|
this.jfp_federal_election_committee_ids = federal_election_file.jfp_federal_election_committee_ids;
|
|
29
28
|
this.jfr_federal_election_committee_ids = federal_election_file.jfr_federal_election_committee_ids;
|
|
@@ -38,7 +37,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
38
37
|
(federal_election_file.url === undefined || typeof federal_election_file.url === "string") &&
|
|
39
38
|
typeof federal_election_file.report_date === "string" &&
|
|
40
39
|
is_federal_election_committee_designation(federal_election_file.designation) &&
|
|
41
|
-
(federal_election_file.federal_election_id === undefined || is_federal_election_id(federal_election_file.federal_election_id)) &&
|
|
40
|
+
// (federal_election_file.federal_election_id === undefined || is_federal_election_id(federal_election_file.federal_election_id)) &&
|
|
42
41
|
(federal_election_file.federal_election_candidate_id === undefined || typeof federal_election_file.federal_election_candidate_id === "string") &&
|
|
43
42
|
(federal_election_file.jfp_federal_election_committee_ids === undefined || Array.isArray(federal_election_file.jfp_federal_election_committee_ids) && federal_election_file.jfp_federal_election_committee_ids.every((federal_election_committee_id) => typeof federal_election_committee_id === "string")) &&
|
|
44
43
|
(Array.isArray(federal_election_file.jfr_federal_election_committee_ids) && federal_election_file.jfr_federal_election_committee_ids.every((federal_election_committee_id) => typeof federal_election_committee_id === "string")) &&
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StateID } from "../regions/State.js";
|
|
2
|
+
export declare class TenantVoterTarget {
|
|
3
|
+
readonly tenant_voter_target_id: string;
|
|
4
|
+
readonly tenant_id: string;
|
|
5
|
+
readonly voter_id: string;
|
|
6
|
+
readonly target_id: string;
|
|
7
|
+
readonly value: number;
|
|
8
|
+
readonly state_id: StateID;
|
|
9
|
+
constructor(tenant_voter_target: any);
|
|
10
|
+
static is(tenant_voter_target: any): tenant_voter_target is TenantVoterTarget;
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { is_state_id } from "../regions/State.js";
|
|
2
|
+
export class TenantVoterTarget {
|
|
3
|
+
tenant_voter_target_id;
|
|
4
|
+
tenant_id;
|
|
5
|
+
voter_id;
|
|
6
|
+
target_id;
|
|
7
|
+
value;
|
|
8
|
+
state_id;
|
|
9
|
+
// readonly federal_congress_district_id? : string
|
|
10
|
+
// readonly state_legislature_house_district_id? : string
|
|
11
|
+
// readonly state_legislature_senate_district_id? : string
|
|
12
|
+
// readonly county_id? : string
|
|
13
|
+
// readonly school_district_id? : string
|
|
14
|
+
// readonly party_type_id : VoterPartyTypeID
|
|
15
|
+
constructor(tenant_voter_target) {
|
|
16
|
+
if (!TenantVoterTarget.is(tenant_voter_target)) {
|
|
17
|
+
throw Error("Invalid input.");
|
|
18
|
+
}
|
|
19
|
+
this.tenant_voter_target_id = tenant_voter_target.tenant_voter_target_id;
|
|
20
|
+
this.tenant_id = tenant_voter_target.tenant_id;
|
|
21
|
+
this.voter_id = tenant_voter_target.voter_id;
|
|
22
|
+
this.target_id = tenant_voter_target.target_id;
|
|
23
|
+
this.value = tenant_voter_target.value;
|
|
24
|
+
this.state_id = tenant_voter_target.state_id;
|
|
25
|
+
// this.federal_congress_district_id = tenant_voter_target.federal_congress_district_id
|
|
26
|
+
// this.state_legislature_house_district_id = tenant_voter_target.state_legislature_house_district_id
|
|
27
|
+
// this.state_legislature_senate_district_id = tenant_voter_target.state_legislature_senate_district_id
|
|
28
|
+
// this.county_id = tenant_voter_target.county_id
|
|
29
|
+
// this.school_district_id = tenant_voter_target.school_district_id
|
|
30
|
+
// this.party_type_id = tenant_voter_target.party_type_id
|
|
31
|
+
}
|
|
32
|
+
static is(tenant_voter_target) {
|
|
33
|
+
return (tenant_voter_target !== undefined &&
|
|
34
|
+
typeof tenant_voter_target.tenant_voter_target_id === "string" &&
|
|
35
|
+
typeof tenant_voter_target.tenant_id === "string" &&
|
|
36
|
+
typeof tenant_voter_target.voter_id === "string" &&
|
|
37
|
+
typeof tenant_voter_target.target_id === "string" &&
|
|
38
|
+
typeof tenant_voter_target.value === "number" &&
|
|
39
|
+
is_state_id(tenant_voter_target.state_id) // &&
|
|
40
|
+
// (tenant_voter_target.federal_congress_district_id === undefined || typeof tenant_voter_target.federal_congress_district_id === "string") &&
|
|
41
|
+
// (tenant_voter_target.state_legislature_house_district_id === undefined || typeof tenant_voter_target.state_legislature_house_district_id === "string") &&
|
|
42
|
+
// (tenant_voter_target.state_legislature_senate_district_id === undefined || typeof tenant_voter_target.state_legislature_senate_district_id === "string") &&
|
|
43
|
+
// (tenant_voter_target.county_id === undefined || typeof tenant_voter_target.county_id === "string") &&
|
|
44
|
+
// (tenant_voter_target.school_district_id === undefined || typeof tenant_voter_target.school_district_id === "string") &&
|
|
45
|
+
// is_voter_party_type_id(tenant_voter_target.party_type_id)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -63,7 +63,7 @@ export * from "./types/prism/PrismFeature"
|
|
|
63
63
|
export * from "./types/prism/PrismSubPrism"
|
|
64
64
|
export * from "./types/prism/PrismSegment"
|
|
65
65
|
export * from "./types/prism/PrismTarget"
|
|
66
|
-
export * from "./types/prism/
|
|
66
|
+
export * from "./types/prism/TenantVoterTarget"
|
|
67
67
|
export * from "./types/prism/UserPrismSegment"
|
|
68
68
|
export * from "./types/prism/Voter"
|
|
69
69
|
export * from "./types/prism/VoterFeature"
|
|
@@ -8,7 +8,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
8
8
|
readonly url? : string
|
|
9
9
|
readonly report_date : string
|
|
10
10
|
readonly designation : FederalElectionCommitteeDesignation
|
|
11
|
-
readonly federal_election_id? : FederalElectionID
|
|
11
|
+
// readonly federal_election_id? : FederalElectionID
|
|
12
12
|
readonly federal_election_candidate_id? : string
|
|
13
13
|
readonly jfp_federal_election_committee_ids? : string[]
|
|
14
14
|
readonly jfr_federal_election_committee_ids : string[]
|
|
@@ -25,7 +25,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
25
25
|
this.url = federal_election_file.url
|
|
26
26
|
this.report_date = federal_election_file.report_date
|
|
27
27
|
this.designation = federal_election_file.designation
|
|
28
|
-
this.federal_election_id = federal_election_file.federal_election_id
|
|
28
|
+
// this.federal_election_id = federal_election_file.federal_election_id
|
|
29
29
|
this.federal_election_candidate_id = federal_election_file.federal_election_candidate_id
|
|
30
30
|
this.jfp_federal_election_committee_ids = federal_election_file.jfp_federal_election_committee_ids
|
|
31
31
|
this.jfr_federal_election_committee_ids = federal_election_file.jfr_federal_election_committee_ids
|
|
@@ -42,7 +42,7 @@ export class FederalElectionF1File extends FederalElectionFile {
|
|
|
42
42
|
(federal_election_file.url === undefined || typeof federal_election_file.url === "string") &&
|
|
43
43
|
typeof federal_election_file.report_date === "string" &&
|
|
44
44
|
is_federal_election_committee_designation(federal_election_file.designation) &&
|
|
45
|
-
(federal_election_file.federal_election_id === undefined || is_federal_election_id(federal_election_file.federal_election_id)) &&
|
|
45
|
+
// (federal_election_file.federal_election_id === undefined || is_federal_election_id(federal_election_file.federal_election_id)) &&
|
|
46
46
|
(federal_election_file.federal_election_candidate_id === undefined || typeof federal_election_file.federal_election_candidate_id === "string") &&
|
|
47
47
|
(federal_election_file.jfp_federal_election_committee_ids === undefined || Array.isArray(federal_election_file.jfp_federal_election_committee_ids) && federal_election_file.jfp_federal_election_committee_ids.every((federal_election_committee_id : any) => typeof federal_election_committee_id === "string")) &&
|
|
48
48
|
(Array.isArray(federal_election_file.jfr_federal_election_committee_ids) && federal_election_file.jfr_federal_election_committee_ids.every((federal_election_committee_id : any) => typeof federal_election_committee_id === "string")) &&
|
|
@@ -0,0 +1,52 @@
|
|
|
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 state_id : StateID
|
|
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.state_id = tenant_voter_target.state_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
|
+
is_state_id(tenant_voter_target.state_id)// &&
|
|
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
|
+
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export class UserPrism {
|
|
2
|
-
readonly user_prism_id : string
|
|
3
|
-
readonly user_id : string
|
|
4
|
-
readonly prism_id : string
|
|
5
|
-
|
|
6
|
-
constructor(user_prism : any) {
|
|
7
|
-
if (!UserPrism.is(user_prism)) {
|
|
8
|
-
throw Error("Invalid input.")
|
|
9
|
-
}
|
|
10
|
-
this.user_prism_id = user_prism.user_prism_id
|
|
11
|
-
this.user_id = user_prism.user_id
|
|
12
|
-
this.prism_id = user_prism.prism_id
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
static is(user_prism : any) : user_prism is UserPrism {
|
|
16
|
-
return (
|
|
17
|
-
user_prism !== undefined &&
|
|
18
|
-
typeof user_prism.user_prism_id === "string" &&
|
|
19
|
-
typeof user_prism.user_id === "string" &&
|
|
20
|
-
typeof user_prism.prism_id === "string"
|
|
21
|
-
)
|
|
22
|
-
}
|
|
23
|
-
}
|