triangle-types 1.0.52 → 1.0.53

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.
@@ -3,7 +3,7 @@ export type FederalCongressBillTypeID = typeof federal_congress_bill_type_ids[nu
3
3
  export declare function is_federal_congress_bill_type_id(federal_congress_bill_type_id: any): federal_congress_bill_type_id is FederalCongressBillTypeID;
4
4
  export declare class FederalCongressBill {
5
5
  readonly federal_congress_bill_id: string;
6
- readonly congress_id: number;
6
+ readonly federal_congress_id: number;
7
7
  readonly bill_type_id: FederalCongressBillTypeID;
8
8
  readonly number: number;
9
9
  readonly bill_id: string;
@@ -4,7 +4,7 @@ export function is_federal_congress_bill_type_id(federal_congress_bill_type_id)
4
4
  }
5
5
  export class FederalCongressBill {
6
6
  federal_congress_bill_id;
7
- congress_id;
7
+ federal_congress_id;
8
8
  bill_type_id;
9
9
  number;
10
10
  bill_id;
@@ -18,7 +18,7 @@ export class FederalCongressBill {
18
18
  throw Error("Invalid input.");
19
19
  }
20
20
  this.federal_congress_bill_id = federal_congress_bill.federal_congress_bill_id;
21
- this.congress_id = federal_congress_bill.congress_id;
21
+ this.federal_congress_id = federal_congress_bill.federal_congress_id;
22
22
  this.bill_type_id = federal_congress_bill.bill_type_id;
23
23
  this.number = federal_congress_bill.number;
24
24
  this.bill_id = federal_congress_bill.bill_id;
@@ -31,7 +31,7 @@ export class FederalCongressBill {
31
31
  static is(federal_congress_bill) {
32
32
  return (federal_congress_bill !== undefined &&
33
33
  typeof federal_congress_bill.federal_congress_bill_id === "string" &&
34
- typeof federal_congress_bill.congress_id === "number" &&
34
+ typeof federal_congress_bill.federal_congress_id === "number" &&
35
35
  is_federal_congress_bill_type_id(federal_congress_bill.bill_type_id) &&
36
36
  typeof federal_congress_bill.number === "number" &&
37
37
  typeof federal_congress_bill.bill_id === "string" &&
@@ -6,7 +6,7 @@ export declare class FederalCongressBillDocument {
6
6
  readonly federal_congress_bill_document_id: string;
7
7
  readonly federal_congress_bill_id: string;
8
8
  readonly document_id: string;
9
- readonly congress_id: number;
9
+ readonly federal_congress_id: number;
10
10
  readonly bill_id: string;
11
11
  readonly bill_type_id: FederalCongressBillTypeID;
12
12
  readonly number: number;
@@ -8,7 +8,7 @@ export class FederalCongressBillDocument {
8
8
  federal_congress_bill_document_id;
9
9
  federal_congress_bill_id;
10
10
  document_id;
11
- congress_id;
11
+ federal_congress_id;
12
12
  bill_id;
13
13
  bill_type_id;
14
14
  number;
@@ -22,7 +22,7 @@ export class FederalCongressBillDocument {
22
22
  }
23
23
  this.federal_congress_bill_document_id = federal_congress_bill_document.federal_congress_bill_document_id;
24
24
  this.federal_congress_bill_id = federal_congress_bill_document.federal_congress_bill_id;
25
- this.congress_id = federal_congress_bill_document.congress_id;
25
+ this.federal_congress_id = federal_congress_bill_document.federal_congress_id;
26
26
  this.bill_id = federal_congress_bill_document.bill_id;
27
27
  this.bill_type_id = federal_congress_bill_document.bill_type_id;
28
28
  this.number = federal_congress_bill_document.number;
@@ -36,7 +36,7 @@ export class FederalCongressBillDocument {
36
36
  return (federal_congress_bill_document !== undefined &&
37
37
  typeof federal_congress_bill_document.federal_congress_bill_document_id === "string" &&
38
38
  typeof federal_congress_bill_document.federal_congress_bill_id === "string" &&
39
- typeof federal_congress_bill_document.congress_id === "number" &&
39
+ typeof federal_congress_bill_document.federal_congress_id === "number" &&
40
40
  typeof federal_congress_bill_document.bill_id === "string" &&
41
41
  typeof federal_congress_bill_document.bill_type_id === "string" &&
42
42
  typeof federal_congress_bill_document.number === "number" &&
@@ -0,0 +1,10 @@
1
+ import { StateID } from "../State.js";
2
+ export declare class FederalCongressDistrict {
3
+ readonly federal_congress_district_id: string;
4
+ readonly congress_id: number;
5
+ readonly chamber_id: string;
6
+ readonly state_id: StateID;
7
+ readonly district_id: number;
8
+ constructor(federal_congress_district: any);
9
+ static is(federal_congress_district: any): federal_congress_district is FederalCongressDistrict;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { is_state_id } from "../State.js";
2
+ export class FederalCongressDistrict {
3
+ federal_congress_district_id;
4
+ congress_id;
5
+ chamber_id;
6
+ state_id;
7
+ district_id;
8
+ constructor(federal_congress_district) {
9
+ if (!FederalCongressDistrict.is(federal_congress_district)) {
10
+ throw Error("Invalid input.");
11
+ }
12
+ this.federal_congress_district_id = federal_congress_district.federal_congress_district_id;
13
+ this.congress_id = federal_congress_district.congress_id;
14
+ this.chamber_id = federal_congress_district.chamber_id;
15
+ this.state_id = federal_congress_district.state_id;
16
+ this.district_id = federal_congress_district.district_id;
17
+ }
18
+ static is(federal_congress_district) {
19
+ return (federal_congress_district !== undefined &&
20
+ typeof federal_congress_district.federal_congress_district_id === "string" &&
21
+ typeof federal_congress_district.congress_id === "string" &&
22
+ typeof federal_congress_district.chamber_id === "string" &&
23
+ is_state_id(federal_congress_district.state_id) &&
24
+ typeof federal_congress_district === "number");
25
+ }
26
+ }
@@ -23,9 +23,9 @@ export declare class Voter {
23
23
  readonly address_mail_city?: string;
24
24
  readonly address_mail_state_id: string;
25
25
  readonly address_mail_zip?: string;
26
- readonly federal_house_district: number;
27
- readonly state_house_district: number;
28
- readonly state_senate_district: number;
26
+ readonly federal_house_district_id: string;
27
+ readonly state_house_district_id: string;
28
+ readonly state_senate_district_id: string;
29
29
  readonly occupation_group?: string;
30
30
  readonly occupation_description?: string;
31
31
  readonly phone_home?: string;
@@ -23,9 +23,9 @@ export class Voter {
23
23
  address_mail_city;
24
24
  address_mail_state_id;
25
25
  address_mail_zip;
26
- federal_house_district;
27
- state_house_district;
28
- state_senate_district;
26
+ federal_house_district_id;
27
+ state_house_district_id;
28
+ state_senate_district_id;
29
29
  occupation_group;
30
30
  occupation_description;
31
31
  phone_home;
@@ -64,9 +64,9 @@ export class Voter {
64
64
  this.address_mail_city = voter.address_mail_city;
65
65
  this.address_mail_state_id = voter.address_mail_state_id;
66
66
  this.address_mail_zip = voter.address_mail_zip;
67
- this.federal_house_district = voter.federal_house_district;
68
- this.state_house_district = voter.state_house_district;
69
- this.state_senate_district = voter.state_senate_district;
67
+ this.federal_house_district_id = voter.federal_house_district_id;
68
+ this.state_house_district_id = voter.state_house_district_id;
69
+ this.state_senate_district_id = voter.state_senate_district_id;
70
70
  this.occupation_group = voter.occupation_group;
71
71
  this.occupation_description = voter.occupation_description;
72
72
  this.phone_home = voter.phone_home;
@@ -104,9 +104,9 @@ export class Voter {
104
104
  (voter.address_mail_city === undefined || typeof voter.address_mail_city === "string") &&
105
105
  typeof voter.address_mail_state_id === "string" &&
106
106
  (voter.address_mail_zip === undefined || typeof voter.address_mail_zip === "string") &&
107
- typeof voter.federal_house_district === "number" && !isNaN(voter.federal_house_district) &&
108
- typeof voter.state_house_district === "number" && !isNaN(voter.state_house_district) &&
109
- typeof voter.state_senate_district === "number" && !isNaN(voter.state_senate_district) &&
107
+ typeof voter.federal_house_district_id === "string" &&
108
+ typeof voter.state_house_district_id === "string" &&
109
+ typeof voter.state_senate_district_id === "string" &&
110
110
  (voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
111
111
  (voter.occupation_description === undefined || typeof voter.occupation_description === "string") &&
112
112
  (voter.phone_home === undefined || typeof voter.phone_home === "string") &&
@@ -0,0 +1,10 @@
1
+ import { StateID } from "../State.js";
2
+ export declare class StateLegislatureDistrict {
3
+ readonly state_legislature_district_id: string;
4
+ readonly legislature_id: number;
5
+ readonly state_id: StateID;
6
+ readonly chamber_id: string;
7
+ readonly district_id: number;
8
+ constructor(state_legislature_district: any);
9
+ static is(state_legislature_district: any): state_legislature_district is StateLegislatureDistrict;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { is_state_id } from "../State.js";
2
+ export class StateLegislatureDistrict {
3
+ state_legislature_district_id;
4
+ legislature_id;
5
+ state_id;
6
+ chamber_id;
7
+ district_id;
8
+ constructor(state_legislature_district) {
9
+ if (!StateLegislatureDistrict.is(state_legislature_district)) {
10
+ throw Error("Invalid input.");
11
+ }
12
+ this.state_legislature_district_id = state_legislature_district.state_legislature_district_id;
13
+ this.legislature_id = state_legislature_district.legislature_id;
14
+ this.state_id = state_legislature_district.state_id;
15
+ this.chamber_id = state_legislature_district.chamber_id;
16
+ this.district_id = state_legislature_district.district_id;
17
+ }
18
+ static is(state_legislature_district) {
19
+ return (state_legislature_district !== undefined &&
20
+ typeof state_legislature_district.state_legislature_district_id === "string" &&
21
+ typeof state_legislature_district.legislature_id === "string" &&
22
+ is_state_id(state_legislature_district.state_id) &&
23
+ typeof state_legislature_district.chamber_id === "string" &&
24
+ typeof state_legislature_district === "number");
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -8,7 +8,7 @@ export function is_federal_congress_bill_type_id(federal_congress_bill_type_id :
8
8
 
9
9
  export class FederalCongressBill {
10
10
  readonly federal_congress_bill_id : string
11
- readonly congress_id : number
11
+ readonly federal_congress_id : number
12
12
  readonly bill_type_id : FederalCongressBillTypeID
13
13
  readonly number : number
14
14
  readonly bill_id : string
@@ -23,7 +23,7 @@ export class FederalCongressBill {
23
23
  throw Error("Invalid input.")
24
24
  }
25
25
  this.federal_congress_bill_id = federal_congress_bill.federal_congress_bill_id
26
- this.congress_id = federal_congress_bill.congress_id
26
+ this.federal_congress_id = federal_congress_bill.federal_congress_id
27
27
  this.bill_type_id = federal_congress_bill.bill_type_id
28
28
  this.number = federal_congress_bill.number
29
29
  this.bill_id = federal_congress_bill.bill_id
@@ -38,7 +38,7 @@ export class FederalCongressBill {
38
38
  return (
39
39
  federal_congress_bill !== undefined &&
40
40
  typeof federal_congress_bill.federal_congress_bill_id === "string" &&
41
- typeof federal_congress_bill.congress_id === "number" &&
41
+ typeof federal_congress_bill.federal_congress_id === "number" &&
42
42
  is_federal_congress_bill_type_id(federal_congress_bill.bill_type_id) &&
43
43
  typeof federal_congress_bill.number === "number" &&
44
44
  typeof federal_congress_bill.bill_id === "string" &&
@@ -14,7 +14,7 @@ export class FederalCongressBillDocument {
14
14
  readonly federal_congress_bill_document_id : string
15
15
  readonly federal_congress_bill_id : string
16
16
  readonly document_id : string
17
- readonly congress_id : number
17
+ readonly federal_congress_id : number
18
18
  readonly bill_id : string
19
19
  readonly bill_type_id : FederalCongressBillTypeID
20
20
  readonly number : number
@@ -29,7 +29,7 @@ export class FederalCongressBillDocument {
29
29
  }
30
30
  this.federal_congress_bill_document_id = federal_congress_bill_document.federal_congress_bill_document_id
31
31
  this.federal_congress_bill_id = federal_congress_bill_document.federal_congress_bill_id
32
- this.congress_id = federal_congress_bill_document.congress_id
32
+ this.federal_congress_id = federal_congress_bill_document.federal_congress_id
33
33
  this.bill_id = federal_congress_bill_document.bill_id
34
34
  this.bill_type_id = federal_congress_bill_document.bill_type_id
35
35
  this.number = federal_congress_bill_document.number
@@ -45,7 +45,7 @@ export class FederalCongressBillDocument {
45
45
  federal_congress_bill_document !== undefined &&
46
46
  typeof federal_congress_bill_document.federal_congress_bill_document_id === "string" &&
47
47
  typeof federal_congress_bill_document.federal_congress_bill_id === "string" &&
48
- typeof federal_congress_bill_document.congress_id === "number" &&
48
+ typeof federal_congress_bill_document.federal_congress_id === "number" &&
49
49
  typeof federal_congress_bill_document.bill_id === "string" &&
50
50
  typeof federal_congress_bill_document.bill_type_id === "string" &&
51
51
  typeof federal_congress_bill_document.number === "number" &&
@@ -0,0 +1,33 @@
1
+ import { is_state_id, StateID } from "../State"
2
+
3
+ export class FederalCongressDistrict {
4
+ readonly federal_congress_district_id : string
5
+ readonly congress_id : number
6
+ readonly chamber_id : string
7
+ readonly state_id : StateID
8
+ readonly district_id : number
9
+
10
+
11
+ constructor(federal_congress_district : any) {
12
+ if (!FederalCongressDistrict.is(federal_congress_district)) {
13
+ throw Error("Invalid input.")
14
+ }
15
+ this.federal_congress_district_id = federal_congress_district.federal_congress_district_id
16
+ this.congress_id = federal_congress_district.congress_id
17
+ this.chamber_id = federal_congress_district.chamber_id
18
+ this.state_id = federal_congress_district.state_id
19
+ this.district_id = federal_congress_district.district_id
20
+ }
21
+
22
+ static is(federal_congress_district : any) : federal_congress_district is FederalCongressDistrict {
23
+ return (
24
+ federal_congress_district !== undefined &&
25
+ typeof federal_congress_district.federal_congress_district_id === "string" &&
26
+ typeof federal_congress_district.congress_id === "string" &&
27
+ typeof federal_congress_district.chamber_id === "string" &&
28
+ is_state_id(federal_congress_district.state_id) &&
29
+ typeof federal_congress_district === "number"
30
+ )
31
+ }
32
+
33
+ }
@@ -24,9 +24,9 @@ export class Voter {
24
24
  readonly address_mail_city? : string
25
25
  readonly address_mail_state_id : string
26
26
  readonly address_mail_zip? : string
27
- readonly federal_house_district : number
28
- readonly state_house_district : number
29
- readonly state_senate_district : number
27
+ readonly federal_house_district_id : string
28
+ readonly state_house_district_id : string
29
+ readonly state_senate_district_id : string
30
30
  readonly occupation_group? : string
31
31
  readonly occupation_description? : string
32
32
  readonly phone_home? : string
@@ -67,9 +67,9 @@ export class Voter {
67
67
  this.address_mail_city = voter.address_mail_city
68
68
  this.address_mail_state_id = voter.address_mail_state_id
69
69
  this.address_mail_zip = voter.address_mail_zip
70
- this.federal_house_district = voter.federal_house_district
71
- this.state_house_district = voter.state_house_district
72
- this.state_senate_district = voter.state_senate_district
70
+ this.federal_house_district_id = voter.federal_house_district_id
71
+ this.state_house_district_id = voter.state_house_district_id
72
+ this.state_senate_district_id = voter.state_senate_district_id
73
73
  this.occupation_group = voter.occupation_group
74
74
  this.occupation_description = voter.occupation_description
75
75
  this.phone_home = voter.phone_home
@@ -109,9 +109,9 @@ export class Voter {
109
109
  (voter.address_mail_city === undefined || typeof voter.address_mail_city === "string") &&
110
110
  typeof voter.address_mail_state_id === "string" &&
111
111
  (voter.address_mail_zip === undefined || typeof voter.address_mail_zip === "string") &&
112
- typeof voter.federal_house_district === "number" && !isNaN(voter.federal_house_district) &&
113
- typeof voter.state_house_district === "number" && !isNaN(voter.state_house_district) &&
114
- typeof voter.state_senate_district === "number" && !isNaN(voter.state_senate_district) &&
112
+ typeof voter.federal_house_district_id === "string" &&
113
+ typeof voter.state_house_district_id === "string" &&
114
+ typeof voter.state_senate_district_id === "string" &&
115
115
  (voter.occupation_group === undefined || typeof voter.occupation_group === "string") &&
116
116
  (voter.occupation_description === undefined || typeof voter.occupation_description === "string") &&
117
117
  (voter.phone_home === undefined || typeof voter.phone_home === "string") &&
@@ -0,0 +1,33 @@
1
+ import { is_state_id, StateID } from "../State"
2
+
3
+ export class StateLegislatureDistrict {
4
+ readonly state_legislature_district_id : string
5
+ readonly legislature_id : number
6
+ readonly state_id : StateID
7
+ readonly chamber_id : string
8
+ readonly district_id : number
9
+
10
+
11
+ constructor(state_legislature_district : any) {
12
+ if (!StateLegislatureDistrict.is(state_legislature_district)) {
13
+ throw Error("Invalid input.")
14
+ }
15
+ this.state_legislature_district_id = state_legislature_district.state_legislature_district_id
16
+ this.legislature_id = state_legislature_district.legislature_id
17
+ this.state_id = state_legislature_district.state_id
18
+ this.chamber_id = state_legislature_district.chamber_id
19
+ this.district_id = state_legislature_district.district_id
20
+ }
21
+
22
+ static is(state_legislature_district : any) : state_legislature_district is StateLegislatureDistrict {
23
+ return (
24
+ state_legislature_district !== undefined &&
25
+ typeof state_legislature_district.state_legislature_district_id === "string" &&
26
+ typeof state_legislature_district.legislature_id === "string" &&
27
+ is_state_id(state_legislature_district.state_id) &&
28
+ typeof state_legislature_district.chamber_id === "string" &&
29
+ typeof state_legislature_district === "number"
30
+ )
31
+ }
32
+
33
+ }