triangle-types 1.0.153 → 1.0.155
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/federal_elections/FederalElectionF2File.d.ts +1 -0
- package/dist/src/types/federal_elections/FederalElectionF2File.js +4 -1
- package/dist/src/types/lal/LALFile.d.ts +10 -0
- package/dist/src/types/lal/LALFile.js +26 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/federal_elections/FederalElectionF2File.ts +4 -1
- package/src/types/lal/LALFile.ts +31 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
|
|
|
46
46
|
export * from "./types/federal_rules/FederalRuleSection.js";
|
|
47
47
|
export * from "./types/fragments/Fragment.js";
|
|
48
48
|
export * from "./types/fragments/FragmentVector.js";
|
|
49
|
+
export * from "./types/lal/LALFile.js";
|
|
49
50
|
export * from "./types/legistar/LegistarAgency.js";
|
|
50
51
|
export * from "./types/legistar/LegistarDocument.js";
|
|
51
52
|
export * from "./types/prism/Prism.js";
|
package/dist/src/index.js
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
|
|
|
46
46
|
export * from "./types/federal_rules/FederalRuleSection.js";
|
|
47
47
|
export * from "./types/fragments/Fragment.js";
|
|
48
48
|
export * from "./types/fragments/FragmentVector.js";
|
|
49
|
+
export * from "./types/lal/LALFile.js";
|
|
49
50
|
export * from "./types/legistar/LegistarAgency.js";
|
|
50
51
|
export * from "./types/legistar/LegistarDocument.js";
|
|
51
52
|
export * from "./types/prism/Prism.js";
|
|
@@ -10,6 +10,7 @@ export declare class FederalElectionF2File extends FederalElectionFile {
|
|
|
10
10
|
readonly federal_election_id: string;
|
|
11
11
|
readonly party_id?: string;
|
|
12
12
|
readonly report_date: string;
|
|
13
|
+
readonly federal_election_committee_id?: string;
|
|
13
14
|
constructor(federal_election_file: any);
|
|
14
15
|
static is(federal_election_file: any): federal_election_file is FederalElectionF2File;
|
|
15
16
|
}
|
|
@@ -10,6 +10,7 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
10
10
|
federal_election_id;
|
|
11
11
|
party_id;
|
|
12
12
|
report_date;
|
|
13
|
+
federal_election_committee_id;
|
|
13
14
|
constructor(federal_election_file) {
|
|
14
15
|
if (!FederalElectionF2File.is(federal_election_file)) {
|
|
15
16
|
throw Error("Invalid input.");
|
|
@@ -23,6 +24,7 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
23
24
|
this.federal_election_id = federal_election_file.federal_election_id;
|
|
24
25
|
this.party_id = federal_election_file.party_id;
|
|
25
26
|
this.report_date = federal_election_file.report_date;
|
|
27
|
+
this.federal_election_committee_id = federal_election_file.federal_election_committee_id;
|
|
26
28
|
}
|
|
27
29
|
static is(federal_election_file) {
|
|
28
30
|
return (FederalElectionFile.is(federal_election_file) &&
|
|
@@ -34,6 +36,7 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
34
36
|
(federal_election_file.district_id === undefined || typeof federal_election_file.district_id === "number") &&
|
|
35
37
|
typeof federal_election_file.federal_election_id === "string" &&
|
|
36
38
|
(federal_election_file.party_id === undefined || typeof federal_election_file.party_id === "string") &&
|
|
37
|
-
typeof federal_election_file.report_date === "string"
|
|
39
|
+
typeof federal_election_file.report_date === "string" &&
|
|
40
|
+
(federal_election_file.federal_election_committee_id === undefined || typeof federal_election_file.federal_election_committee_id === "string"));
|
|
38
41
|
}
|
|
39
42
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StateID } from "../regions/State.js";
|
|
2
|
+
export declare class LALFile {
|
|
3
|
+
readonly lal_file_id: string;
|
|
4
|
+
readonly state_id: StateID;
|
|
5
|
+
readonly date: string;
|
|
6
|
+
readonly s3_id_zip: string;
|
|
7
|
+
readonly s3_id?: string;
|
|
8
|
+
constructor(lal_file: any);
|
|
9
|
+
static is(lal_file: any): lal_file is LALFile;
|
|
10
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { is_state_id } from "../regions/State.js";
|
|
2
|
+
export class LALFile {
|
|
3
|
+
lal_file_id;
|
|
4
|
+
state_id;
|
|
5
|
+
date;
|
|
6
|
+
s3_id_zip;
|
|
7
|
+
s3_id;
|
|
8
|
+
constructor(lal_file) {
|
|
9
|
+
if (!LALFile.is(lal_file)) {
|
|
10
|
+
throw Error("Invalid input.");
|
|
11
|
+
}
|
|
12
|
+
this.lal_file_id = lal_file.lal_file_id;
|
|
13
|
+
this.state_id = lal_file.state_id;
|
|
14
|
+
this.date = lal_file.date;
|
|
15
|
+
this.s3_id_zip = lal_file.s3_id_zip;
|
|
16
|
+
this.s3_id = lal_file.s3_id;
|
|
17
|
+
}
|
|
18
|
+
static is(lal_file) {
|
|
19
|
+
return (lal_file !== undefined &&
|
|
20
|
+
typeof lal_file.lal_file_id === "string" &&
|
|
21
|
+
is_state_id(lal_file.state_id) &&
|
|
22
|
+
typeof lal_file.date === "string" &&
|
|
23
|
+
typeof lal_file.s3_id_zip === "string" &&
|
|
24
|
+
(lal_file.s3_id === undefined || typeof lal_file.s3_id === "string"));
|
|
25
|
+
}
|
|
26
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -56,6 +56,8 @@ export * from "./types/federal_rules/FederalRuleSection"
|
|
|
56
56
|
export * from "./types/fragments/Fragment"
|
|
57
57
|
export * from "./types/fragments/FragmentVector"
|
|
58
58
|
|
|
59
|
+
export * from "./types/lal/LALFile"
|
|
60
|
+
|
|
59
61
|
export * from "./types/legistar/LegistarAgency"
|
|
60
62
|
export * from "./types/legistar/LegistarDocument"
|
|
61
63
|
|
|
@@ -11,6 +11,7 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
11
11
|
readonly federal_election_id : string
|
|
12
12
|
readonly party_id? : string
|
|
13
13
|
readonly report_date : string
|
|
14
|
+
readonly federal_election_committee_id? : string
|
|
14
15
|
|
|
15
16
|
constructor(federal_election_file : any) {
|
|
16
17
|
if (!FederalElectionF2File.is(federal_election_file)) {
|
|
@@ -25,6 +26,7 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
25
26
|
this.federal_election_id = federal_election_file.federal_election_id
|
|
26
27
|
this.party_id = federal_election_file.party_id
|
|
27
28
|
this.report_date = federal_election_file.report_date
|
|
29
|
+
this.federal_election_committee_id = federal_election_file.federal_election_committee_id
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
static is(federal_election_file : any) : federal_election_file is FederalElectionF2File {
|
|
@@ -38,7 +40,8 @@ export class FederalElectionF2File extends FederalElectionFile {
|
|
|
38
40
|
(federal_election_file.district_id === undefined || typeof federal_election_file.district_id === "number") &&
|
|
39
41
|
typeof federal_election_file.federal_election_id === "string" &&
|
|
40
42
|
(federal_election_file.party_id === undefined || typeof federal_election_file.party_id === "string") &&
|
|
41
|
-
typeof federal_election_file.report_date === "string"
|
|
43
|
+
typeof federal_election_file.report_date === "string" &&
|
|
44
|
+
(federal_election_file.federal_election_committee_id === undefined || typeof federal_election_file.federal_election_committee_id === "string")
|
|
42
45
|
)
|
|
43
46
|
}
|
|
44
47
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { is_state_id, StateID } from "../regions/State"
|
|
2
|
+
|
|
3
|
+
export class LALFile {
|
|
4
|
+
readonly lal_file_id : string
|
|
5
|
+
readonly state_id : StateID
|
|
6
|
+
readonly date : string
|
|
7
|
+
readonly s3_id_zip : string
|
|
8
|
+
readonly s3_id? : string
|
|
9
|
+
|
|
10
|
+
constructor(lal_file : any) {
|
|
11
|
+
if (!LALFile.is(lal_file)) {
|
|
12
|
+
throw Error("Invalid input.")
|
|
13
|
+
}
|
|
14
|
+
this.lal_file_id = lal_file.lal_file_id
|
|
15
|
+
this.state_id = lal_file.state_id
|
|
16
|
+
this.date = lal_file.date
|
|
17
|
+
this.s3_id_zip = lal_file.s3_id_zip
|
|
18
|
+
this.s3_id = lal_file.s3_id
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static is(lal_file : any) : lal_file is LALFile {
|
|
22
|
+
return (
|
|
23
|
+
lal_file !== undefined &&
|
|
24
|
+
typeof lal_file.lal_file_id === "string" &&
|
|
25
|
+
is_state_id(lal_file.state_id) &&
|
|
26
|
+
typeof lal_file.date === "string" &&
|
|
27
|
+
typeof lal_file.s3_id_zip === "string" &&
|
|
28
|
+
(lal_file.s3_id === undefined || typeof lal_file.s3_id === "string")
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|