elections-types 1.0.57 → 1.0.59

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.
@@ -9,6 +9,6 @@ export declare class Article {
9
9
  readonly fetch_time: string;
10
10
  readonly relevance?: string;
11
11
  readonly text_status?: string;
12
- constructor(article: any);
12
+ constructor(article: Article);
13
13
  static is(article: any): article is Article;
14
14
  }
@@ -30,7 +30,7 @@ export declare class Candidate {
30
30
  readonly ballotpedia_data?: Record<string, any>;
31
31
  readonly activity_index?: ActivityIndex;
32
32
  [x: string]: any;
33
- constructor(candidate: any);
33
+ constructor(candidate: Candidate);
34
34
  static is(candidate: any): candidate is Candidate;
35
35
  }
36
36
  export declare class CandidateAux extends Candidate {
@@ -7,7 +7,7 @@ export declare class CandidateArticle {
7
7
  readonly relevance?: string;
8
8
  readonly sentiment?: string;
9
9
  [x: string]: any;
10
- constructor(candidate_article: any);
10
+ constructor(candidate_article: CandidateArticle);
11
11
  static is(candidate_article: any): candidate_article is CandidateArticle;
12
12
  }
13
13
  export declare class CandidateArticleAux extends CandidateArticle {
@@ -7,7 +7,7 @@ export declare class CandidateTweet {
7
7
  readonly relevance?: string;
8
8
  readonly sentiment?: string;
9
9
  readonly [x: string]: any;
10
- constructor(candidate_tweet: any);
10
+ constructor(candidate_tweet: CandidateTweet);
11
11
  static is(candidate_tweet: any): candidate_tweet is CandidateTweet;
12
12
  }
13
13
  export declare class CandidateTweetAux extends CandidateTweet {
@@ -6,7 +6,7 @@ export declare class CandidateVideo {
6
6
  readonly fetch_time: string;
7
7
  readonly relevance?: string;
8
8
  readonly [x: string]: any;
9
- constructor(candidate_video: any);
9
+ constructor(candidate_video: CandidateVideo);
10
10
  static is(candidate_video: any): candidate_video is CandidateVideo;
11
11
  }
12
12
  export declare class CandidateVideoAux extends CandidateVideo {
@@ -18,7 +18,7 @@ export declare class Committee {
18
18
  readonly candidate_ids?: string[];
19
19
  readonly election_ids?: string[];
20
20
  readonly [x: string]: any;
21
- constructor(committee: any);
21
+ constructor(committee: Committee);
22
22
  static is(committee: any): committee is Committee;
23
23
  }
24
24
  export declare class CommitteeAux extends Committee {
@@ -12,10 +12,9 @@ export declare class Election {
12
12
  readonly office_id: OfficeID;
13
13
  readonly state_id: StateID;
14
14
  readonly district?: number;
15
- readonly candidate_ids?: string[];
16
15
  readonly committee_ids?: string[];
17
16
  readonly [x: string]: any;
18
- constructor(election: any);
17
+ constructor(election: Election);
19
18
  static is(election: any): election is Election;
20
19
  }
21
20
  export declare class ElectionAux extends Election {
@@ -25,7 +25,6 @@ export class Election {
25
25
  office_id;
26
26
  state_id;
27
27
  district;
28
- candidate_ids;
29
28
  committee_ids;
30
29
  constructor(election) {
31
30
  if (!Election.is(election)) {
@@ -36,7 +35,6 @@ export class Election {
36
35
  this.office_id = election.office_id;
37
36
  this.state_id = election.state_id;
38
37
  this.district = election.district;
39
- this.candidate_ids = election.candidate_ids;
40
38
  this.committee_ids = election.committee_ids;
41
39
  }
42
40
  static is(election) {
@@ -46,7 +44,6 @@ export class Election {
46
44
  is_office_id(election.office_id) &&
47
45
  is_state_id(election.state_id) &&
48
46
  (election.district === undefined || typeof election.district === "number") &&
49
- (election.candidate_ids === undefined || Array.isArray(election.candidate_ids) && election.candidate_ids.every((candidate_id) => typeof candidate_id === "string")) &&
50
47
  (election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id) => typeof committee_id === "string")));
51
48
  }
52
49
  }
@@ -16,6 +16,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
16
16
  cognito_client_secret: string;
17
17
  secret_key: string;
18
18
  super_gov_api_keys: string[];
19
+ gov_api_keys: string[];
19
20
  dynamodb_elections: string;
20
21
  dynamodb_candidates: string;
21
22
  dynamodb_committees: string;
@@ -24,6 +24,6 @@ export declare class FederalDonation {
24
24
  readonly donor_address_zip: string;
25
25
  readonly donor_aggregate_ytd: number;
26
26
  readonly memo_text: string;
27
- constructor(federal_donation: any);
27
+ constructor(federal_donation: FederalDonation);
28
28
  static is(federal_donation: any): federal_donation is FederalDonation;
29
29
  }
@@ -7,6 +7,6 @@ export declare class Tweet {
7
7
  readonly quote?: string;
8
8
  readonly html: string;
9
9
  readonly text: string;
10
- constructor(tweet: any);
10
+ constructor(tweet: Tweet);
11
11
  static is(tweet: any): tweet is Tweet;
12
12
  }
@@ -5,6 +5,6 @@ export declare class User {
5
5
  readonly premium: boolean;
6
6
  readonly email: string;
7
7
  readonly email_settings: Record<LongFormTypeID | "NEWS", number>;
8
- constructor(user: any);
8
+ constructor(user: User);
9
9
  static is(user: any): user is User;
10
10
  }
@@ -4,6 +4,6 @@ export declare class UserElection {
4
4
  readonly election_id: ElectionID;
5
5
  readonly candidate_display: Record<string, number>;
6
6
  readonly notify: boolean;
7
- constructor(user_election: any);
7
+ constructor(user_election: UserElection);
8
8
  static is(user_election: any): user_election is UserElection;
9
9
  }
@@ -9,6 +9,6 @@ export declare class Video {
9
9
  readonly tags?: string[];
10
10
  readonly duration?: number;
11
11
  readonly fetch_time: string;
12
- constructor(video: any);
12
+ constructor(video: Video);
13
13
  static is(video: any): video is Video;
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -10,7 +10,7 @@ export class Article {
10
10
  readonly relevance? : string
11
11
  readonly text_status? : string
12
12
 
13
- constructor(article : any) {
13
+ constructor(article : Article) {
14
14
  if (!Article.is(article)) {
15
15
  throw Error("Invalid input.")
16
16
  }
@@ -52,7 +52,7 @@ export class Candidate {
52
52
  [x : string] : any
53
53
 
54
54
 
55
- constructor(candidate : any) {
55
+ constructor(candidate : Candidate) {
56
56
  if (!Candidate.is(candidate)) {
57
57
  throw Error("Invalid input.")
58
58
  }
@@ -9,7 +9,7 @@ export class CandidateArticle {
9
9
  readonly sentiment? : string
10
10
  [x : string] : any
11
11
 
12
- constructor(candidate_article : any) {
12
+ constructor(candidate_article : CandidateArticle) {
13
13
  if (!CandidateArticle.is(candidate_article)) {
14
14
  throw Error("Invalid input.")
15
15
  }
@@ -9,7 +9,7 @@ export class CandidateTweet {
9
9
  readonly sentiment? : string
10
10
  readonly [x : string] : any
11
11
 
12
- constructor(candidate_tweet : any) {
12
+ constructor(candidate_tweet : CandidateTweet) {
13
13
  if (!CandidateTweet.is(candidate_tweet)) {
14
14
  throw Error("Invalid input.")
15
15
  }
@@ -8,7 +8,7 @@ export class CandidateVideo {
8
8
  readonly relevance? : string
9
9
  readonly [x : string] : any
10
10
 
11
- constructor(candidate_video : any) {
11
+ constructor(candidate_video : CandidateVideo) {
12
12
  if (!CandidateVideo.is(candidate_video)) {
13
13
  throw Error("Invalid input.")
14
14
  }
@@ -25,7 +25,7 @@ export class Committee {
25
25
  readonly election_ids? : string[]
26
26
  readonly [x : string] : any
27
27
 
28
- constructor(committee : any) {
28
+ constructor(committee : Committee) {
29
29
  if (!Committee.is(committee)) {
30
30
  throw Error("Invalid input.")
31
31
  }
@@ -36,11 +36,10 @@ export class Election {
36
36
  readonly office_id : OfficeID
37
37
  readonly state_id : StateID
38
38
  readonly district? : number
39
- readonly candidate_ids? : string[]
40
39
  readonly committee_ids? : string[]
41
40
  readonly [x : string] : any
42
41
 
43
- constructor(election : any) {
42
+ constructor(election : Election) {
44
43
  if (!Election.is(election)) {
45
44
  throw Error("Invalid input.")
46
45
  }
@@ -49,7 +48,6 @@ export class Election {
49
48
  this.office_id = election.office_id
50
49
  this.state_id = election.state_id
51
50
  this.district = election.district
52
- this.candidate_ids = election.candidate_ids
53
51
  this.committee_ids = election.committee_ids
54
52
  }
55
53
 
@@ -61,7 +59,6 @@ export class Election {
61
59
  is_office_id(election.office_id) &&
62
60
  is_state_id(election.state_id) &&
63
61
  (election.district === undefined || typeof election.district === "number") &&
64
- (election.candidate_ids === undefined || Array.isArray(election.candidate_ids) && election.candidate_ids.every((candidate_id : any) => typeof candidate_id === "string")) &&
65
62
  (election.committee_ids === undefined || Array.isArray(election.committee_ids) && election.committee_ids.every((committee_id : any) => typeof committee_id === "string"))
66
63
  )
67
64
  }
@@ -18,6 +18,7 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
18
18
  secret_key : string,
19
19
  // admin_key : string,
20
20
  super_gov_api_keys : string[],
21
+ gov_api_keys : string[],
21
22
  dynamodb_elections : string,
22
23
  dynamodb_candidates : string,
23
24
  dynamodb_committees : string,
@@ -26,7 +26,7 @@ export class FederalDonation {
26
26
  readonly donor_aggregate_ytd : number
27
27
  readonly memo_text : string
28
28
 
29
- constructor(federal_donation : any) {
29
+ constructor(federal_donation : FederalDonation) {
30
30
  if (!FederalDonation.is(federal_donation)) {
31
31
  throw Error("Invalid input.")
32
32
  }
@@ -8,7 +8,7 @@ export class Tweet {
8
8
  readonly html : string
9
9
  readonly text : string
10
10
 
11
- constructor(tweet : any) {
11
+ constructor(tweet : Tweet) {
12
12
  if (!Tweet.is(tweet)) {
13
13
  throw Error("Invalid input.")
14
14
  }
package/src/types/User.ts CHANGED
@@ -8,7 +8,7 @@ export class User {
8
8
  readonly email_settings : Record<LongFormTypeID | "NEWS", number>
9
9
  // readonly [x : string] : any
10
10
 
11
- constructor(user : any) {
11
+ constructor(user : User) {
12
12
  if (!User.is(user)) {
13
13
  throw Error("Invalid Input.")
14
14
  }
@@ -9,7 +9,7 @@ export class UserElection {
9
9
 
10
10
  // readonly [x : string] : any
11
11
 
12
- constructor(user_election : any) {
12
+ constructor(user_election : UserElection) {
13
13
  if (!UserElection.is(user_election)) {
14
14
  throw Error("Invalid Input.")
15
15
  }
@@ -10,7 +10,7 @@ export class Video {
10
10
  readonly duration? : number
11
11
  readonly fetch_time : string
12
12
 
13
- constructor(video : any) {
13
+ constructor(video : Video) {
14
14
  if (!Video.is(video)) {
15
15
  throw Error("Invalid input.")
16
16
  }