elections-types 1.0.53 → 1.0.55
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";
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export declare const form_type_ids: readonly ["F1", "F2", "F3", "F24"];
|
|
2
2
|
export type FormTypeID = typeof form_type_ids[number];
|
|
3
3
|
export declare function is_form_type_id(form_type_id: any): form_type_id is FormTypeID;
|
|
4
|
+
export declare const amendment_type_ids: readonly ["N", "A", "T"];
|
|
5
|
+
export type AmendmentTypeID = typeof amendment_type_ids[number];
|
|
6
|
+
export declare function is_amendment_type_id(amendment_type_id: any): amendment_type_id is AmendmentTypeID;
|
|
4
7
|
export declare const long_form_type_ids: readonly ["F1N", "F1A", "F1T", "F2N", "F2A", "F2T", "F3N", "F3A", "F3T", "F24N", "F24A"];
|
|
5
8
|
export type LongFormTypeID = typeof long_form_type_ids[number];
|
|
6
9
|
export declare function is_long_form_type_id(long_form_type_id: any): long_form_type_id is LongFormTypeID;
|
|
@@ -2,6 +2,10 @@ export const form_type_ids = ["F1", "F2", "F3", "F24"];
|
|
|
2
2
|
export function is_form_type_id(form_type_id) {
|
|
3
3
|
return form_type_ids.includes(form_type_id);
|
|
4
4
|
}
|
|
5
|
+
export const amendment_type_ids = ["N", "A", "T"];
|
|
6
|
+
export function is_amendment_type_id(amendment_type_id) {
|
|
7
|
+
return amendment_type_ids.includes(amendment_type_id);
|
|
8
|
+
}
|
|
5
9
|
export const long_form_type_ids = [
|
|
6
10
|
"F1N", "F1A", "F1T",
|
|
7
11
|
"F2N", "F2A", "F2T",
|
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"
|
package/src/types/FormTypeID.ts
CHANGED
|
@@ -6,6 +6,14 @@ export function is_form_type_id(form_type_id : any) : form_type_id is FormTypeID
|
|
|
6
6
|
return form_type_ids.includes(form_type_id)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
export const amendment_type_ids = ["N", "A", "T"] as const
|
|
10
|
+
|
|
11
|
+
export type AmendmentTypeID = typeof amendment_type_ids[number]
|
|
12
|
+
|
|
13
|
+
export function is_amendment_type_id(amendment_type_id : any) : amendment_type_id is AmendmentTypeID {
|
|
14
|
+
return amendment_type_ids.includes(amendment_type_id)
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
export const long_form_type_ids = [
|
|
10
18
|
"F1N", "F1A", "F1T",
|
|
11
19
|
"F2N", "F2A", "F2T",
|
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
|
-
}
|