elections-types 1.0.47 → 1.0.49
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/Article.d.ts +1 -1
- package/dist/src/types/Article.js +3 -3
- package/dist/src/types/CandidateArticle.d.ts +1 -1
- package/dist/src/types/CandidateArticle.js +3 -3
- package/dist/src/types/FederalDonation.d.ts +29 -0
- package/dist/src/types/FederalDonation.js +82 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/types/Article.ts +3 -3
- package/src/types/CandidateArticle.ts +3 -3
- package/src/types/FederalDonation.ts +88 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./types/Committee.js";
|
|
|
8
8
|
export * from "./types/Donation.js";
|
|
9
9
|
export * from "./types/Election.js";
|
|
10
10
|
export * from "./types/ElectionsConfig.js";
|
|
11
|
+
export * from "./types/FederalDonation.js";
|
|
11
12
|
export * from "./types/FECReport.js";
|
|
12
13
|
export * from "./types/FormTypeID.js";
|
|
13
14
|
export * from "./types/State.js";
|
package/dist/src/index.js
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./types/Committee.js";
|
|
|
8
8
|
export * from "./types/Donation.js";
|
|
9
9
|
export * from "./types/Election.js";
|
|
10
10
|
export * from "./types/ElectionsConfig.js";
|
|
11
|
+
export * from "./types/FederalDonation.js";
|
|
11
12
|
export * from "./types/FECReport.js";
|
|
12
13
|
export * from "./types/FormTypeID.js";
|
|
13
14
|
export * from "./types/State.js";
|
|
@@ -7,7 +7,7 @@ export declare class Article {
|
|
|
7
7
|
readonly domain: string;
|
|
8
8
|
readonly url: string;
|
|
9
9
|
readonly fetch_time: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly relevance?: string;
|
|
11
11
|
readonly text_status?: string;
|
|
12
12
|
constructor(article: any);
|
|
13
13
|
static is(article: any): article is Article;
|
|
@@ -7,7 +7,7 @@ export class Article {
|
|
|
7
7
|
domain;
|
|
8
8
|
url;
|
|
9
9
|
fetch_time;
|
|
10
|
-
|
|
10
|
+
relevance;
|
|
11
11
|
text_status;
|
|
12
12
|
constructor(article) {
|
|
13
13
|
if (!Article.is(article)) {
|
|
@@ -21,7 +21,7 @@ export class Article {
|
|
|
21
21
|
this.domain = article.domain;
|
|
22
22
|
this.url = article.url;
|
|
23
23
|
this.fetch_time = article.fetch_time;
|
|
24
|
-
this.
|
|
24
|
+
this.relevance = article.relevance;
|
|
25
25
|
this.text_status = article.text_status;
|
|
26
26
|
}
|
|
27
27
|
static is(article) {
|
|
@@ -34,7 +34,7 @@ export class Article {
|
|
|
34
34
|
typeof article.domain === "string" &&
|
|
35
35
|
typeof article.url === "string" &&
|
|
36
36
|
typeof article.fetch_time === "string" &&
|
|
37
|
-
(article.
|
|
37
|
+
(article.relevance === undefined || typeof article.relevance === "string") &&
|
|
38
38
|
(article.text_status === undefined || typeof article.text_status === "string"));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -4,7 +4,7 @@ export declare class CandidateArticle {
|
|
|
4
4
|
readonly article_id: string;
|
|
5
5
|
readonly url: string;
|
|
6
6
|
readonly fetch_time: string;
|
|
7
|
-
readonly
|
|
7
|
+
readonly relevance?: string;
|
|
8
8
|
readonly sentiment?: string;
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
constructor(candidate_article: any);
|
|
@@ -4,7 +4,7 @@ export class CandidateArticle {
|
|
|
4
4
|
article_id;
|
|
5
5
|
url;
|
|
6
6
|
fetch_time;
|
|
7
|
-
|
|
7
|
+
relevance;
|
|
8
8
|
sentiment;
|
|
9
9
|
constructor(candidate_article) {
|
|
10
10
|
if (!CandidateArticle.is(candidate_article)) {
|
|
@@ -14,7 +14,7 @@ export class CandidateArticle {
|
|
|
14
14
|
this.article_id = candidate_article.article_id;
|
|
15
15
|
this.url = candidate_article.url;
|
|
16
16
|
this.fetch_time = candidate_article.fetch_time;
|
|
17
|
-
this.
|
|
17
|
+
this.relevance = candidate_article.relevance;
|
|
18
18
|
this.sentiment = candidate_article.sentiment;
|
|
19
19
|
}
|
|
20
20
|
static is(candidate_article) {
|
|
@@ -23,7 +23,7 @@ export class CandidateArticle {
|
|
|
23
23
|
typeof candidate_article.article_id === "string" &&
|
|
24
24
|
typeof candidate_article.url === "string" &&
|
|
25
25
|
typeof candidate_article.fetch_time === "string" &&
|
|
26
|
-
(candidate_article.
|
|
26
|
+
(candidate_article.relevance === undefined || typeof candidate_article.relevance === "string") &&
|
|
27
27
|
(candidate_article.sentiment === undefined || typeof candidate_article.sentiment === "string"));
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StateID } from "./State.js";
|
|
2
|
+
export declare class FederalDonation {
|
|
3
|
+
readonly federal_federal_donation_id: string;
|
|
4
|
+
readonly receipt_date: string;
|
|
5
|
+
readonly sub_id: string;
|
|
6
|
+
readonly committee_id: string;
|
|
7
|
+
readonly recipient_committee_id?: string;
|
|
8
|
+
readonly file_number: number;
|
|
9
|
+
readonly image_number: string;
|
|
10
|
+
readonly amount: number;
|
|
11
|
+
readonly donor_id?: string;
|
|
12
|
+
readonly donor_name: string;
|
|
13
|
+
readonly donor_prefix?: string;
|
|
14
|
+
readonly donor_first_name: string;
|
|
15
|
+
readonly donor_middle_name?: string;
|
|
16
|
+
readonly donor_last_name: string;
|
|
17
|
+
readonly donor_suffix?: string;
|
|
18
|
+
readonly donor_occupation: string;
|
|
19
|
+
readonly donor_employer: string;
|
|
20
|
+
readonly donor_address_street_1: string;
|
|
21
|
+
readonly donor_address_street_2?: string;
|
|
22
|
+
readonly donor_address_city: string;
|
|
23
|
+
readonly donor_address_state_id: StateID;
|
|
24
|
+
readonly donor_address_zip: string;
|
|
25
|
+
readonly donor_aggregate_ytd: number;
|
|
26
|
+
readonly memo_text: string;
|
|
27
|
+
constructor(federal_donation: any);
|
|
28
|
+
static is(federal_donation: any): federal_donation is FederalDonation;
|
|
29
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export class FederalDonation {
|
|
2
|
+
federal_federal_donation_id;
|
|
3
|
+
receipt_date;
|
|
4
|
+
sub_id;
|
|
5
|
+
committee_id;
|
|
6
|
+
recipient_committee_id;
|
|
7
|
+
file_number;
|
|
8
|
+
image_number;
|
|
9
|
+
amount;
|
|
10
|
+
donor_id;
|
|
11
|
+
donor_name;
|
|
12
|
+
donor_prefix;
|
|
13
|
+
donor_first_name;
|
|
14
|
+
donor_middle_name;
|
|
15
|
+
donor_last_name;
|
|
16
|
+
donor_suffix;
|
|
17
|
+
donor_occupation;
|
|
18
|
+
donor_employer;
|
|
19
|
+
donor_address_street_1;
|
|
20
|
+
donor_address_street_2;
|
|
21
|
+
donor_address_city;
|
|
22
|
+
donor_address_state_id;
|
|
23
|
+
donor_address_zip;
|
|
24
|
+
donor_aggregate_ytd;
|
|
25
|
+
memo_text;
|
|
26
|
+
constructor(federal_donation) {
|
|
27
|
+
if (!FederalDonation.is(federal_donation)) {
|
|
28
|
+
throw Error("Invalid input.");
|
|
29
|
+
}
|
|
30
|
+
this.federal_federal_donation_id = federal_donation.federal_federal_donation_id;
|
|
31
|
+
this.receipt_date = federal_donation.receipt_date;
|
|
32
|
+
this.sub_id = federal_donation.sub_id;
|
|
33
|
+
this.committee_id = federal_donation.committee_id;
|
|
34
|
+
this.recipient_committee_id = federal_donation.recipient_committee_id;
|
|
35
|
+
this.file_number = federal_donation.file_number;
|
|
36
|
+
this.image_number = federal_donation.image_number;
|
|
37
|
+
this.amount = federal_donation.amount;
|
|
38
|
+
this.donor_id = federal_donation.donor_id;
|
|
39
|
+
this.donor_name = federal_donation.donor_name;
|
|
40
|
+
this.donor_prefix = federal_donation.donor_prefix;
|
|
41
|
+
this.donor_first_name = federal_donation.donor_first_name;
|
|
42
|
+
this.donor_middle_name = federal_donation.donor_middle_name;
|
|
43
|
+
this.donor_last_name = federal_donation.donor_last_name;
|
|
44
|
+
this.donor_suffix = federal_donation.donor_suffix;
|
|
45
|
+
this.donor_occupation = federal_donation.donor_occupation;
|
|
46
|
+
this.donor_employer = federal_donation.donor_employer;
|
|
47
|
+
this.donor_address_street_1 = federal_donation.donor_address_street_1;
|
|
48
|
+
this.donor_address_street_2 = federal_donation.donor_address_street_2;
|
|
49
|
+
this.donor_address_city = federal_donation.donor_address_city;
|
|
50
|
+
this.donor_address_state_id = federal_donation.donor_address_state_id;
|
|
51
|
+
this.donor_address_zip = federal_donation.donor_address_zip;
|
|
52
|
+
this.donor_aggregate_ytd = federal_donation.donor_aggregate_ytd;
|
|
53
|
+
this.memo_text = federal_donation.memo_text;
|
|
54
|
+
}
|
|
55
|
+
static is(federal_donation) {
|
|
56
|
+
return (federal_donation !== undefined &&
|
|
57
|
+
typeof federal_donation.federal_federal_donation_id === "string" &&
|
|
58
|
+
typeof federal_donation.receipt_date === "string" &&
|
|
59
|
+
typeof federal_donation.sub_id === "string" &&
|
|
60
|
+
typeof federal_donation.committee_id === "string" &&
|
|
61
|
+
typeof federal_donation.recipient_committee_id === "string" &&
|
|
62
|
+
typeof federal_donation.file_number === "number" && !isNaN(federal_donation.file_number) &&
|
|
63
|
+
typeof federal_donation.image_number === "string" &&
|
|
64
|
+
typeof federal_donation.amount === "number" && !isNaN(federal_donation.amount) &&
|
|
65
|
+
(federal_donation.donor_id === undefined || typeof federal_donation.donor_id === "string") &&
|
|
66
|
+
typeof federal_donation.donor_name === "string" &&
|
|
67
|
+
(federal_donation.donor_prefix === undefined || typeof federal_donation.donor_prefix === "string") &&
|
|
68
|
+
typeof federal_donation.donor_first_name === "string" &&
|
|
69
|
+
(federal_donation.donor_middle_name === undefined || typeof federal_donation.donor_middle_name === "string") &&
|
|
70
|
+
typeof federal_donation.donor_last_name === "string" &&
|
|
71
|
+
(federal_donation.donor_suffix === undefined || typeof federal_donation.donor_suffix === "string") &&
|
|
72
|
+
typeof federal_donation.donor_occupation === "string" &&
|
|
73
|
+
typeof federal_donation.donor_employer === "string" &&
|
|
74
|
+
typeof federal_donation.donor_address_street_1 === "string" &&
|
|
75
|
+
(federal_donation.donor_address_street_2 === undefined || typeof federal_donation.donor_address_street_2 === "string") &&
|
|
76
|
+
typeof federal_donation.donor_address_city === "string" &&
|
|
77
|
+
typeof federal_donation.donor_address_state_id === "string" &&
|
|
78
|
+
typeof federal_donation.donor_address_zip === "string" &&
|
|
79
|
+
typeof federal_donation.donor_aggregate_ytd === "number" && !isNaN(federal_donation.donor_aggregate_ytd) &&
|
|
80
|
+
typeof federal_donation.memo_text === "string");
|
|
81
|
+
}
|
|
82
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./types/Committee"
|
|
|
8
8
|
export * from "./types/Donation"
|
|
9
9
|
export * from "./types/Election"
|
|
10
10
|
export * from "./types/ElectionsConfig"
|
|
11
|
+
export * from "./types/FederalDonation"
|
|
11
12
|
export * from "./types/FECReport"
|
|
12
13
|
export * from "./types/FormTypeID"
|
|
13
14
|
export * from "./types/State"
|
package/src/types/Article.ts
CHANGED
|
@@ -7,7 +7,7 @@ export class Article {
|
|
|
7
7
|
readonly domain : string
|
|
8
8
|
readonly url : string
|
|
9
9
|
readonly fetch_time : string
|
|
10
|
-
readonly
|
|
10
|
+
readonly relevance? : string
|
|
11
11
|
readonly text_status? : string
|
|
12
12
|
|
|
13
13
|
constructor(article : any) {
|
|
@@ -22,7 +22,7 @@ export class Article {
|
|
|
22
22
|
this.domain = article.domain
|
|
23
23
|
this.url = article.url
|
|
24
24
|
this.fetch_time = article.fetch_time
|
|
25
|
-
this.
|
|
25
|
+
this.relevance = article.relevance
|
|
26
26
|
this.text_status = article.text_status
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -37,7 +37,7 @@ export class Article {
|
|
|
37
37
|
typeof article.domain === "string" &&
|
|
38
38
|
typeof article.url === "string" &&
|
|
39
39
|
typeof article.fetch_time === "string" &&
|
|
40
|
-
(article.
|
|
40
|
+
(article.relevance === undefined || typeof article.relevance === "string") &&
|
|
41
41
|
(article.text_status === undefined || typeof article.text_status === "string")
|
|
42
42
|
)
|
|
43
43
|
}
|
|
@@ -5,7 +5,7 @@ export class CandidateArticle {
|
|
|
5
5
|
readonly article_id : string
|
|
6
6
|
readonly url : string
|
|
7
7
|
readonly fetch_time : string
|
|
8
|
-
readonly
|
|
8
|
+
readonly relevance? : string
|
|
9
9
|
readonly sentiment? : string
|
|
10
10
|
[x : string] : any
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ export class CandidateArticle {
|
|
|
17
17
|
this.article_id = candidate_article.article_id
|
|
18
18
|
this.url = candidate_article.url
|
|
19
19
|
this.fetch_time = candidate_article.fetch_time
|
|
20
|
-
this.
|
|
20
|
+
this.relevance = candidate_article.relevance
|
|
21
21
|
this.sentiment = candidate_article.sentiment
|
|
22
22
|
}
|
|
23
23
|
|
|
@@ -28,7 +28,7 @@ export class CandidateArticle {
|
|
|
28
28
|
typeof candidate_article.article_id === "string" &&
|
|
29
29
|
typeof candidate_article.url === "string" &&
|
|
30
30
|
typeof candidate_article.fetch_time === "string" &&
|
|
31
|
-
(candidate_article.
|
|
31
|
+
(candidate_article.relevance === undefined || typeof candidate_article.relevance === "string") &&
|
|
32
32
|
(candidate_article.sentiment === undefined || typeof candidate_article.sentiment === "string")
|
|
33
33
|
)
|
|
34
34
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { StateID } from "./State"
|
|
2
|
+
|
|
3
|
+
export class FederalDonation {
|
|
4
|
+
readonly federal_federal_donation_id : string
|
|
5
|
+
readonly receipt_date : string
|
|
6
|
+
readonly sub_id : string
|
|
7
|
+
readonly committee_id : string
|
|
8
|
+
readonly recipient_committee_id? : string
|
|
9
|
+
readonly file_number : number
|
|
10
|
+
readonly image_number : string
|
|
11
|
+
readonly amount : number
|
|
12
|
+
readonly donor_id? : string
|
|
13
|
+
readonly donor_name : string
|
|
14
|
+
readonly donor_prefix? : string
|
|
15
|
+
readonly donor_first_name : string
|
|
16
|
+
readonly donor_middle_name? : string
|
|
17
|
+
readonly donor_last_name : string
|
|
18
|
+
readonly donor_suffix? : string
|
|
19
|
+
readonly donor_occupation : string
|
|
20
|
+
readonly donor_employer : string
|
|
21
|
+
readonly donor_address_street_1 : string
|
|
22
|
+
readonly donor_address_street_2? : string
|
|
23
|
+
readonly donor_address_city : string
|
|
24
|
+
readonly donor_address_state_id : StateID
|
|
25
|
+
readonly donor_address_zip : string
|
|
26
|
+
readonly donor_aggregate_ytd : number
|
|
27
|
+
readonly memo_text : string
|
|
28
|
+
|
|
29
|
+
constructor(federal_donation : any) {
|
|
30
|
+
if (!FederalDonation.is(federal_donation)) {
|
|
31
|
+
throw Error("Invalid input.")
|
|
32
|
+
}
|
|
33
|
+
this.federal_federal_donation_id = federal_donation.federal_federal_donation_id
|
|
34
|
+
this.receipt_date = federal_donation.receipt_date
|
|
35
|
+
this.sub_id = federal_donation.sub_id
|
|
36
|
+
this.committee_id = federal_donation.committee_id
|
|
37
|
+
this.recipient_committee_id = federal_donation.recipient_committee_id
|
|
38
|
+
this.file_number = federal_donation.file_number
|
|
39
|
+
this.image_number = federal_donation.image_number
|
|
40
|
+
this.amount = federal_donation.amount
|
|
41
|
+
this.donor_id = federal_donation.donor_id
|
|
42
|
+
this.donor_name = federal_donation.donor_name
|
|
43
|
+
this.donor_prefix = federal_donation.donor_prefix
|
|
44
|
+
this.donor_first_name = federal_donation.donor_first_name
|
|
45
|
+
this.donor_middle_name = federal_donation.donor_middle_name
|
|
46
|
+
this.donor_last_name = federal_donation.donor_last_name
|
|
47
|
+
this.donor_suffix = federal_donation.donor_suffix
|
|
48
|
+
this.donor_occupation = federal_donation.donor_occupation
|
|
49
|
+
this.donor_employer = federal_donation.donor_employer
|
|
50
|
+
this.donor_address_street_1 = federal_donation.donor_address_street_1
|
|
51
|
+
this.donor_address_street_2 = federal_donation.donor_address_street_2
|
|
52
|
+
this.donor_address_city = federal_donation.donor_address_city
|
|
53
|
+
this.donor_address_state_id = federal_donation.donor_address_state_id
|
|
54
|
+
this.donor_address_zip = federal_donation.donor_address_zip
|
|
55
|
+
this.donor_aggregate_ytd = federal_donation.donor_aggregate_ytd
|
|
56
|
+
this.memo_text = federal_donation.memo_text
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static is(federal_donation : any) : federal_donation is FederalDonation {
|
|
60
|
+
return (
|
|
61
|
+
federal_donation !== undefined &&
|
|
62
|
+
typeof federal_donation.federal_federal_donation_id === "string" &&
|
|
63
|
+
typeof federal_donation.receipt_date === "string" &&
|
|
64
|
+
typeof federal_donation.sub_id === "string" &&
|
|
65
|
+
typeof federal_donation.committee_id === "string" &&
|
|
66
|
+
typeof federal_donation.recipient_committee_id === "string" &&
|
|
67
|
+
typeof federal_donation.file_number === "number" && !isNaN(federal_donation.file_number) &&
|
|
68
|
+
typeof federal_donation.image_number === "string" &&
|
|
69
|
+
typeof federal_donation.amount === "number" && !isNaN(federal_donation.amount) &&
|
|
70
|
+
(federal_donation.donor_id === undefined || typeof federal_donation.donor_id === "string") &&
|
|
71
|
+
typeof federal_donation.donor_name === "string" &&
|
|
72
|
+
(federal_donation.donor_prefix === undefined || typeof federal_donation.donor_prefix === "string") &&
|
|
73
|
+
typeof federal_donation.donor_first_name === "string" &&
|
|
74
|
+
(federal_donation.donor_middle_name === undefined || typeof federal_donation.donor_middle_name === "string") &&
|
|
75
|
+
typeof federal_donation.donor_last_name === "string" &&
|
|
76
|
+
(federal_donation.donor_suffix === undefined || typeof federal_donation.donor_suffix === "string") &&
|
|
77
|
+
typeof federal_donation.donor_occupation === "string" &&
|
|
78
|
+
typeof federal_donation.donor_employer === "string" &&
|
|
79
|
+
typeof federal_donation.donor_address_street_1 === "string" &&
|
|
80
|
+
(federal_donation.donor_address_street_2 === undefined || typeof federal_donation.donor_address_street_2 === "string") &&
|
|
81
|
+
typeof federal_donation.donor_address_city === "string" &&
|
|
82
|
+
typeof federal_donation.donor_address_state_id === "string" &&
|
|
83
|
+
typeof federal_donation.donor_address_zip === "string" &&
|
|
84
|
+
typeof federal_donation.donor_aggregate_ytd === "number" && !isNaN(federal_donation.donor_aggregate_ytd) &&
|
|
85
|
+
typeof federal_donation.memo_text === "string"
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
}
|