elections-types 1.0.52 → 1.0.54
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
CHANGED
|
@@ -5,7 +5,6 @@ export * from "./types/CandidateArticle.js";
|
|
|
5
5
|
export * from "./types/CandidateTweet.js";
|
|
6
6
|
export * from "./types/CandidateVideo.js";
|
|
7
7
|
export * from "./types/Committee.js";
|
|
8
|
-
export * from "./types/Donation.js";
|
|
9
8
|
export * from "./types/Election.js";
|
|
10
9
|
export * from "./types/ElectionsConfig.js";
|
|
11
10
|
export * from "./types/FederalDonation.js";
|
package/dist/src/index.js
CHANGED
|
@@ -5,7 +5,6 @@ export * from "./types/CandidateArticle.js";
|
|
|
5
5
|
export * from "./types/CandidateTweet.js";
|
|
6
6
|
export * from "./types/CandidateVideo.js";
|
|
7
7
|
export * from "./types/Committee.js";
|
|
8
|
-
export * from "./types/Donation.js";
|
|
9
8
|
export * from "./types/Election.js";
|
|
10
9
|
export * from "./types/ElectionsConfig.js";
|
|
11
10
|
export * from "./types/FederalDonation.js";
|
|
@@ -28,7 +28,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
28
28
|
dynamodb_videos: string;
|
|
29
29
|
dynamodb_candidate_videos: string;
|
|
30
30
|
dynamodb_fec_reports: string;
|
|
31
|
-
|
|
31
|
+
dynamodb_federal_donations: string;
|
|
32
32
|
dynamodb_fetch_history: string;
|
|
33
33
|
s3_bucket: string;
|
|
34
34
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -5,7 +5,6 @@ export * from "./types/CandidateArticle"
|
|
|
5
5
|
export * from "./types/CandidateTweet"
|
|
6
6
|
export * from "./types/CandidateVideo"
|
|
7
7
|
export * from "./types/Committee"
|
|
8
|
-
export * from "./types/Donation"
|
|
9
8
|
export * from "./types/Election"
|
|
10
9
|
export * from "./types/ElectionsConfig"
|
|
11
10
|
export * from "./types/FederalDonation"
|
|
@@ -30,7 +30,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
|
|
|
30
30
|
dynamodb_videos : string,
|
|
31
31
|
dynamodb_candidate_videos : string,
|
|
32
32
|
dynamodb_fec_reports : string,
|
|
33
|
-
|
|
33
|
+
dynamodb_federal_donations : string,
|
|
34
34
|
dynamodb_fetch_history : string,
|
|
35
35
|
s3_bucket : string
|
|
36
36
|
}
|
package/src/types/Donation.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { StateID } from "./State"
|
|
2
|
-
|
|
3
|
-
export class Donation {
|
|
4
|
-
readonly committee_id : string
|
|
5
|
-
readonly donation_id : string
|
|
6
|
-
readonly receipt_date : string
|
|
7
|
-
readonly sub_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
|
-
|
|
28
|
-
constructor(donation : any) {
|
|
29
|
-
if (!Donation.is(donation)) {
|
|
30
|
-
throw Error("Invalid input.")
|
|
31
|
-
}
|
|
32
|
-
this.committee_id = donation.committee_id
|
|
33
|
-
this.donation_id = donation.donation_id
|
|
34
|
-
this.receipt_date = donation.receipt_date
|
|
35
|
-
this.sub_id = donation.sub_id
|
|
36
|
-
this.file_number = donation.file_number
|
|
37
|
-
this.image_number = donation.image_number
|
|
38
|
-
this.amount = donation.amount
|
|
39
|
-
this.donor_id = donation.donor_id
|
|
40
|
-
this.donor_name = donation.donor_name
|
|
41
|
-
this.donor_prefix = donation.donor_prefix
|
|
42
|
-
this.donor_first_name = donation.donor_first_name
|
|
43
|
-
this.donor_middle_name = donation.donor_middle_name
|
|
44
|
-
this.donor_last_name = donation.donor_last_name
|
|
45
|
-
this.donor_suffix = donation.donor_suffix
|
|
46
|
-
this.donor_occupation = donation.donor_occupation
|
|
47
|
-
this.donor_employer = donation.donor_employer
|
|
48
|
-
this.donor_address_street_1 = donation.donor_address_street_1
|
|
49
|
-
this.donor_address_street_2 = donation.donor_address_street_2
|
|
50
|
-
this.donor_address_city = donation.donor_address_city
|
|
51
|
-
this.donor_address_state_id = donation.donor_address_state_id
|
|
52
|
-
this.donor_address_zip = donation.donor_address_zip
|
|
53
|
-
this.donor_aggregate_ytd = donation.donor_aggregate_ytd
|
|
54
|
-
this.memo_text = donation.memo_text
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static is(donation : any) : donation is Donation {
|
|
58
|
-
return (
|
|
59
|
-
donation !== undefined &&
|
|
60
|
-
typeof donation.committee_id === "string" &&
|
|
61
|
-
typeof donation.donation_id === "string" &&
|
|
62
|
-
typeof donation.receipt_date === "string" &&
|
|
63
|
-
typeof donation.sub_id === "string" &&
|
|
64
|
-
typeof donation.file_number === "number" && !isNaN(donation.file_number) &&
|
|
65
|
-
typeof donation.image_number === "string" &&
|
|
66
|
-
typeof donation.amount === "number" && !isNaN(donation.amount) &&
|
|
67
|
-
(donation.donor_id === undefined || typeof donation.donor_id === "string") &&
|
|
68
|
-
typeof donation.donor_name === "string" &&
|
|
69
|
-
(donation.donor_prefix === undefined || typeof donation.donor_prefix === "string") &&
|
|
70
|
-
typeof donation.donor_first_name === "string" &&
|
|
71
|
-
(donation.donor_middle_name === undefined || typeof donation.donor_middle_name === "string") &&
|
|
72
|
-
typeof donation.donor_last_name === "string" &&
|
|
73
|
-
(donation.donor_suffix === undefined || typeof donation.donor_suffix === "string") &&
|
|
74
|
-
typeof donation.donor_occupation === "string" &&
|
|
75
|
-
typeof donation.donor_employer === "string" &&
|
|
76
|
-
typeof donation.donor_address_street_1 === "string" &&
|
|
77
|
-
(donation.donor_address_street_2 === undefined || typeof donation.donor_address_street_2 === "string") &&
|
|
78
|
-
typeof donation.donor_address_city === "string" &&
|
|
79
|
-
typeof donation.donor_address_state_id === "string" &&
|
|
80
|
-
typeof donation.donor_address_zip === "string" &&
|
|
81
|
-
typeof donation.donor_aggregate_ytd === "number" && !isNaN(donation.donor_aggregate_ytd) &&
|
|
82
|
-
typeof donation.memo_text === "string"
|
|
83
|
-
)
|
|
84
|
-
}
|
|
85
|
-
}
|