elections-types 1.0.56 → 1.0.58
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/Candidate.d.ts +1 -1
- package/dist/src/types/Candidate.js +4 -3
- package/dist/src/types/Committee.d.ts +1 -1
- package/dist/src/types/Committee.js +3 -3
- package/dist/src/types/ElectionsConfig.d.ts +2 -1
- package/package.json +1 -1
- package/src/types/Candidate.ts +4 -3
- package/src/types/Committee.ts +3 -3
- package/src/types/ElectionsConfig.ts +2 -1
|
@@ -19,7 +19,7 @@ export declare class Candidate {
|
|
|
19
19
|
readonly party_id?: string;
|
|
20
20
|
readonly active?: boolean;
|
|
21
21
|
readonly status?: string;
|
|
22
|
-
readonly
|
|
22
|
+
readonly fec_file_id?: number;
|
|
23
23
|
readonly committee_ids?: string[];
|
|
24
24
|
readonly principal_committee_ids?: string[];
|
|
25
25
|
readonly authorized_committee_ids?: string[];
|
|
@@ -31,7 +31,7 @@ export class Candidate {
|
|
|
31
31
|
party_id;
|
|
32
32
|
active;
|
|
33
33
|
status;
|
|
34
|
-
|
|
34
|
+
fec_file_id;
|
|
35
35
|
committee_ids;
|
|
36
36
|
principal_committee_ids;
|
|
37
37
|
authorized_committee_ids;
|
|
@@ -54,7 +54,7 @@ export class Candidate {
|
|
|
54
54
|
this.party_id = candidate.party_id;
|
|
55
55
|
this.active = candidate.active;
|
|
56
56
|
this.status = candidate.status;
|
|
57
|
-
this.
|
|
57
|
+
this.fec_file_id = candidate.fec_file_id;
|
|
58
58
|
this.committee_ids = candidate.committee_ids;
|
|
59
59
|
this.principal_committee_ids = candidate.principal_committee_ids;
|
|
60
60
|
this.authorized_committee_ids = candidate.authorized_committee_ids;
|
|
@@ -76,7 +76,7 @@ export class Candidate {
|
|
|
76
76
|
(candidate.party_id === undefined || typeof candidate.party_id === "string") &&
|
|
77
77
|
(candidate.active === undefined || typeof candidate.active === "boolean") &&
|
|
78
78
|
(candidate.status === undefined || typeof candidate.status === "string") &&
|
|
79
|
-
(candidate.
|
|
79
|
+
(candidate.fec_file_id === undefined || typeof candidate.fec_file_id === "number" && !isNaN(candidate.fec_file_id)) &&
|
|
80
80
|
(candidate.committee_ids === undefined || Array.isArray(candidate.committee_ids) && candidate.committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
81
81
|
(candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
82
82
|
(candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id) => typeof committee_id === "string")) &&
|
|
@@ -91,6 +91,7 @@ export class Candidate {
|
|
|
91
91
|
export class CandidateAux extends Candidate {
|
|
92
92
|
committees;
|
|
93
93
|
fec_reports;
|
|
94
|
+
// readonly fec_f3_files : FEC
|
|
94
95
|
constructor(candidate) {
|
|
95
96
|
if (!CandidateAux.is(candidate)) {
|
|
96
97
|
throw Error("Invalid input.");
|
|
@@ -8,7 +8,7 @@ export declare class Committee {
|
|
|
8
8
|
readonly name: string;
|
|
9
9
|
readonly url?: string;
|
|
10
10
|
readonly designation?: CommitteeDesignation;
|
|
11
|
-
readonly
|
|
11
|
+
readonly fec_file_id?: number;
|
|
12
12
|
readonly principal_committee_ids?: string[];
|
|
13
13
|
readonly authorized_committee_ids?: string[];
|
|
14
14
|
readonly sponsor_committee_ids?: string[];
|
|
@@ -9,7 +9,7 @@ export class Committee {
|
|
|
9
9
|
name;
|
|
10
10
|
url;
|
|
11
11
|
designation;
|
|
12
|
-
|
|
12
|
+
fec_file_id;
|
|
13
13
|
principal_committee_ids;
|
|
14
14
|
authorized_committee_ids;
|
|
15
15
|
sponsor_committee_ids;
|
|
@@ -26,7 +26,7 @@ export class Committee {
|
|
|
26
26
|
this.name = committee.name;
|
|
27
27
|
this.url = committee.url;
|
|
28
28
|
this.designation = committee.designation;
|
|
29
|
-
this.
|
|
29
|
+
this.fec_file_id = committee.fec_file_id;
|
|
30
30
|
this.principal_committee_ids = committee.principal_committee_ids;
|
|
31
31
|
this.authorized_committee_ids = committee.authorized_committee_ids;
|
|
32
32
|
this.sponsor_committee_ids = committee.sponsor_committee_ids;
|
|
@@ -42,7 +42,7 @@ export class Committee {
|
|
|
42
42
|
typeof committee.name === "string" &&
|
|
43
43
|
(committee.url === undefined || typeof committee.url === "string") &&
|
|
44
44
|
(committee.designation === undefined || is_committee_designation(committee.designation)) &&
|
|
45
|
-
(committee.
|
|
45
|
+
(committee.fec_file_id === undefined || typeof committee.fec_file_id === "number" && !isNaN(committee.fec_file_id)) &&
|
|
46
46
|
(committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
47
47
|
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
48
48
|
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id) => typeof committee_id === "string")) &&
|
|
@@ -16,6 +16,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
16
16
|
cognito_client_secret: string;
|
|
17
17
|
secret_key: string;
|
|
18
18
|
super_gov_api_keys: string[];
|
|
19
|
+
gov_api_keys: string[];
|
|
19
20
|
dynamodb_elections: string;
|
|
20
21
|
dynamodb_candidates: string;
|
|
21
22
|
dynamodb_committees: string;
|
|
@@ -27,7 +28,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
27
28
|
dynamodb_candidate_tweets: string;
|
|
28
29
|
dynamodb_videos: string;
|
|
29
30
|
dynamodb_candidate_videos: string;
|
|
30
|
-
|
|
31
|
+
dynamodb_fec_files: string;
|
|
31
32
|
dynamodb_federal_donations: string;
|
|
32
33
|
dynamodb_fetch_history: string;
|
|
33
34
|
s3_bucket: string;
|
package/package.json
CHANGED
package/src/types/Candidate.ts
CHANGED
|
@@ -37,7 +37,7 @@ export class Candidate {
|
|
|
37
37
|
readonly party_id? : string
|
|
38
38
|
readonly active? : boolean
|
|
39
39
|
readonly status? : string
|
|
40
|
-
readonly
|
|
40
|
+
readonly fec_file_id? : number
|
|
41
41
|
readonly committee_ids? : string[]
|
|
42
42
|
readonly principal_committee_ids? : string[]
|
|
43
43
|
readonly authorized_committee_ids? : string[]
|
|
@@ -65,7 +65,7 @@ export class Candidate {
|
|
|
65
65
|
this.party_id = candidate.party_id
|
|
66
66
|
this.active = candidate.active
|
|
67
67
|
this.status = candidate.status
|
|
68
|
-
this.
|
|
68
|
+
this.fec_file_id = candidate.fec_file_id
|
|
69
69
|
this.committee_ids = candidate.committee_ids
|
|
70
70
|
this.principal_committee_ids = candidate.principal_committee_ids
|
|
71
71
|
this.authorized_committee_ids = candidate.authorized_committee_ids
|
|
@@ -89,7 +89,7 @@ export class Candidate {
|
|
|
89
89
|
(candidate.party_id === undefined || typeof candidate.party_id === "string") &&
|
|
90
90
|
(candidate.active === undefined || typeof candidate.active === "boolean") &&
|
|
91
91
|
(candidate.status === undefined || typeof candidate.status === "string") &&
|
|
92
|
-
(candidate.
|
|
92
|
+
(candidate.fec_file_id === undefined || typeof candidate.fec_file_id === "number" && !isNaN(candidate.fec_file_id)) &&
|
|
93
93
|
(candidate.committee_ids === undefined || Array.isArray(candidate.committee_ids) && candidate.committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
94
94
|
(candidate.principal_committee_ids === undefined || Array.isArray(candidate.principal_committee_ids) && candidate.principal_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
95
95
|
(candidate.authorized_committee_ids === undefined || Array.isArray(candidate.authorized_committee_ids) && candidate.authorized_committee_ids.map((committee_id : any) => typeof committee_id === "string")) &&
|
|
@@ -106,6 +106,7 @@ export class Candidate {
|
|
|
106
106
|
export class CandidateAux extends Candidate {
|
|
107
107
|
readonly committees : CommitteeAux[]
|
|
108
108
|
readonly fec_reports : FECReport[]
|
|
109
|
+
// readonly fec_f3_files : FEC
|
|
109
110
|
|
|
110
111
|
constructor(candidate : any) {
|
|
111
112
|
if (!CandidateAux.is(candidate)) {
|
package/src/types/Committee.ts
CHANGED
|
@@ -14,7 +14,7 @@ export class Committee {
|
|
|
14
14
|
readonly name : string
|
|
15
15
|
readonly url? : string
|
|
16
16
|
readonly designation? : CommitteeDesignation
|
|
17
|
-
readonly
|
|
17
|
+
readonly fec_file_id? : number
|
|
18
18
|
readonly principal_committee_ids? : string[]
|
|
19
19
|
readonly authorized_committee_ids? : string[]
|
|
20
20
|
readonly sponsor_committee_ids? : string[]
|
|
@@ -33,7 +33,7 @@ export class Committee {
|
|
|
33
33
|
this.name = committee.name
|
|
34
34
|
this.url = committee.url
|
|
35
35
|
this.designation = committee.designation
|
|
36
|
-
this.
|
|
36
|
+
this.fec_file_id = committee.fec_file_id
|
|
37
37
|
this.principal_committee_ids = committee.principal_committee_ids
|
|
38
38
|
this.authorized_committee_ids = committee.authorized_committee_ids
|
|
39
39
|
this.sponsor_committee_ids = committee.sponsor_committee_ids
|
|
@@ -51,7 +51,7 @@ export class Committee {
|
|
|
51
51
|
typeof committee.name === "string" &&
|
|
52
52
|
(committee.url === undefined || typeof committee.url === "string") &&
|
|
53
53
|
(committee.designation === undefined || is_committee_designation(committee.designation)) &&
|
|
54
|
-
(committee.
|
|
54
|
+
(committee.fec_file_id === undefined || typeof committee.fec_file_id === "number" && !isNaN(committee.fec_file_id)) &&
|
|
55
55
|
(committee.principal_committee_ids === undefined || Array.isArray(committee.principal_committee_ids) && committee.principal_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
56
56
|
(committee.authorized_committee_ids === undefined || Array.isArray(committee.authorized_committee_ids) && committee.authorized_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
57
57
|
(committee.sponsor_committee_ids === undefined || Array.isArray(committee.sponsor_committee_ids) && committee.sponsor_committee_ids.every((committee_id : any) => typeof committee_id === "string")) &&
|
|
@@ -18,6 +18,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
18
18
|
secret_key : string,
|
|
19
19
|
// admin_key : string,
|
|
20
20
|
super_gov_api_keys : string[],
|
|
21
|
+
gov_api_keys : string[],
|
|
21
22
|
dynamodb_elections : string,
|
|
22
23
|
dynamodb_candidates : string,
|
|
23
24
|
dynamodb_committees : string,
|
|
@@ -29,7 +30,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
29
30
|
dynamodb_candidate_tweets : string,
|
|
30
31
|
dynamodb_videos : string,
|
|
31
32
|
dynamodb_candidate_videos : string,
|
|
32
|
-
|
|
33
|
+
dynamodb_fec_files : string,
|
|
33
34
|
dynamodb_federal_donations : string,
|
|
34
35
|
dynamodb_fetch_history : string,
|
|
35
36
|
s3_bucket : string
|