elections-types 1.1.24 → 1.1.25

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.
@@ -18,21 +18,5 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
18
18
  super_gov_api_keys: string[];
19
19
  gov_api_keys: string[];
20
20
  lobby_api_key: string;
21
- dynamodb_federal_elections: string;
22
- dynamodb_federal_election_candidates: string;
23
- dynamodb_federal_election_committees: string;
24
- dynamodb_federal_election_candidate_committees: string;
25
- dynamodb_federal_election_file_expenditures: string;
26
- dynamodb_users: string;
27
- dynamodb_user_federal_elections: string;
28
- dynamodb_articles: string;
29
- dynamodb_candidate_articles: string;
30
- dynamodb_tweets: string;
31
- dynamodb_candidate_tweets: string;
32
- dynamodb_videos: string;
33
- dynamodb_candidate_videos: string;
34
- dynamodb_federal_election_files: string;
35
- dynamodb_federal_election_donations: string;
36
- dynamodb_fetch_history: string;
37
21
  s3_bucket: string;
38
22
  }
@@ -1 +1,20 @@
1
- export {};
1
+ export declare class TwitterTweet {
2
+ readonly twitter_tweet_id: string;
3
+ readonly twitter_user_id: string;
4
+ readonly supreme_twitter_tweet_id: string;
5
+ readonly draft_twitter_tweet_ids: string[];
6
+ readonly community_ids: string[];
7
+ readonly is_sensitive: boolean;
8
+ readonly is_sponsored: boolean;
9
+ readonly lang_id: string;
10
+ readonly references_json: string;
11
+ readonly geo_json?: string;
12
+ readonly text: string;
13
+ readonly content_json?: string;
14
+ readonly media_json?: string;
15
+ readonly attachments_json?: string;
16
+ readonly entities_json?: string;
17
+ readonly reply_settings_type_id: string;
18
+ constructor(twitter_tweet: TwitterTweet);
19
+ static is(twitter_tweet: any): twitter_tweet is TwitterTweet;
20
+ }
@@ -1,31 +1,58 @@
1
- // export class TwitterTweet {
2
- // readonly twitter_tweet_id : string
3
- // readonly twitter_user_id : string
4
- // readonly supreme_twitter_tweet_id : string
5
- // readonly super_reply_twitter_tweet_ids : string[]
6
- // readonly super_quote_twitter_tweet_id? : string
7
- // readonly super_retweet_twitter_tweet_id? : string
8
- // readonly draft_twitter_tweet_ids : string[]
9
- // readonly is_sensitive : boolean
10
- // readonly is_sponsored : boolean
11
- // readonly lang_id : string
12
- // readonly text : string
13
- // readonly content : string
14
- // readonly entities : string
15
- // readonly replies_type_id : string
16
- export {};
17
- // constructor(twitter_tweet : TwitterTweet) {
18
- // if (!TwitterTweet.is(twitter_tweet)) {
19
- // throw Error("Invalid input.")
20
- // }
21
- // this.twitter_tweet_id = twitter_tweet.twitter_tweet_id
22
- // this.twitter_user_id = twitter_tweet.twitter_user_id
23
- // }
24
- // static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
25
- // return (
26
- // twitter_tweet !== undefined &&
27
- // typeof twitter_tweet.twitter_tweet_id === "string" &&
28
- // typeof twitter_tweet.twitter_user_id === "string"
29
- // )
30
- // }
31
- // }
1
+ export class TwitterTweet {
2
+ twitter_tweet_id;
3
+ twitter_user_id;
4
+ supreme_twitter_tweet_id;
5
+ draft_twitter_tweet_ids;
6
+ community_ids;
7
+ is_sensitive;
8
+ is_sponsored;
9
+ lang_id;
10
+ references_json;
11
+ geo_json;
12
+ text;
13
+ content_json;
14
+ media_json;
15
+ attachments_json;
16
+ entities_json;
17
+ reply_settings_type_id;
18
+ constructor(twitter_tweet) {
19
+ if (!TwitterTweet.is(twitter_tweet)) {
20
+ throw Error("Invalid input.");
21
+ }
22
+ this.twitter_tweet_id = twitter_tweet.twitter_tweet_id;
23
+ this.twitter_user_id = twitter_tweet.twitter_user_id;
24
+ this.supreme_twitter_tweet_id = twitter_tweet.supreme_twitter_tweet_id;
25
+ this.draft_twitter_tweet_ids = twitter_tweet.draft_twitter_tweet_ids;
26
+ this.community_ids = twitter_tweet.community_ids;
27
+ this.is_sensitive = twitter_tweet.is_sensitive;
28
+ this.is_sponsored = twitter_tweet.is_sponsored;
29
+ this.lang_id = twitter_tweet.lang_id;
30
+ this.references_json = twitter_tweet.references_json;
31
+ this.geo_json = twitter_tweet.geo_json;
32
+ this.text = twitter_tweet.text;
33
+ this.content_json = twitter_tweet.content_json;
34
+ this.media_json = twitter_tweet.media_json;
35
+ this.attachments_json = twitter_tweet.attachments_json;
36
+ this.entities_json = twitter_tweet.entities_json;
37
+ this.reply_settings_type_id = twitter_tweet.reply_settings_type_id;
38
+ }
39
+ static is(twitter_tweet) {
40
+ return (twitter_tweet !== undefined &&
41
+ typeof twitter_tweet.twitter_tweet_id === "string" &&
42
+ typeof twitter_tweet.twitter_user_id === "string" &&
43
+ typeof twitter_tweet.supreme_twitter_tweet_id === "string" &&
44
+ Array.isArray(twitter_tweet.draft_twitter_tweet_ids) && twitter_tweet.draft_twitter_tweet_ids.every((draft_twitter_tweet_id) => typeof draft_twitter_tweet_id === "string") &&
45
+ Array.isArray(twitter_tweet.community_ids) && twitter_tweet.community_id.every((community_id) => typeof community_id === "string") &&
46
+ typeof twitter_tweet.is_sensitive === "boolean" &&
47
+ typeof twitter_tweet.is_sponsored === "boolean" &&
48
+ typeof twitter_tweet.lang_id === "string" &&
49
+ typeof twitter_tweet.references_json === "string" &&
50
+ (twitter_tweet.geo_json === undefined || typeof twitter_tweet.geo_json === "string") &&
51
+ typeof twitter_tweet.text === "string" &&
52
+ (twitter_tweet.content_json === undefined || typeof twitter_tweet.content_json === "string") &&
53
+ (twitter_tweet.media_json === undefined || typeof twitter_tweet.media_json === "string") &&
54
+ (twitter_tweet.attachments_json === undefined || typeof twitter_tweet.attachments_json === "string") &&
55
+ (twitter_tweet.entities_json === undefined || typeof twitter_tweet.entities_json === "string") &&
56
+ typeof twitter_tweet.reply_settings_type_id === "string");
57
+ }
58
+ }
@@ -11,7 +11,7 @@ export declare class TwitterUser {
11
11
  readonly is_parody: boolean;
12
12
  readonly subscription_type_id: string;
13
13
  readonly verification_type_id: string;
14
- readonly entities: string | undefined;
14
+ readonly entities?: string;
15
15
  constructor(twitter_user: TwitterUser);
16
16
  static is(twitter_user: any): twitter_user is TwitterUser;
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elections-types",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -20,21 +20,5 @@ export interface ElectionsConfig extends ElectionsUtilsConfig {
20
20
  super_gov_api_keys : string[],
21
21
  gov_api_keys : string[],
22
22
  lobby_api_key : string,
23
- dynamodb_federal_elections : string,
24
- dynamodb_federal_election_candidates : string,
25
- dynamodb_federal_election_committees : string,
26
- dynamodb_federal_election_candidate_committees : string,
27
- dynamodb_federal_election_file_expenditures : string,
28
- dynamodb_users : string,
29
- dynamodb_user_federal_elections : string,
30
- dynamodb_articles : string,
31
- dynamodb_candidate_articles : string,
32
- dynamodb_tweets : string,
33
- dynamodb_candidate_tweets : string,
34
- dynamodb_videos : string,
35
- dynamodb_candidate_videos : string,
36
- dynamodb_federal_election_files : string,
37
- dynamodb_federal_election_donations : string,
38
- dynamodb_fetch_history : string,
39
23
  s3_bucket : string
40
24
  }
@@ -1,32 +1,63 @@
1
- // export class TwitterTweet {
2
- // readonly twitter_tweet_id : string
3
- // readonly twitter_user_id : string
4
- // readonly supreme_twitter_tweet_id : string
5
- // readonly super_reply_twitter_tweet_ids : string[]
6
- // readonly super_quote_twitter_tweet_id? : string
7
- // readonly super_retweet_twitter_tweet_id? : string
8
- // readonly draft_twitter_tweet_ids : string[]
9
- // readonly is_sensitive : boolean
10
- // readonly is_sponsored : boolean
11
- // readonly lang_id : string
12
- // readonly text : string
13
- // readonly content : string
14
- // readonly entities : string
15
- // readonly replies_type_id : string
1
+ export class TwitterTweet {
2
+ readonly twitter_tweet_id : string
3
+ readonly twitter_user_id : string
4
+ readonly supreme_twitter_tweet_id : string
5
+ readonly draft_twitter_tweet_ids : string[]
6
+ readonly community_ids : string[]
7
+ readonly is_sensitive : boolean
8
+ readonly is_sponsored : boolean
9
+ readonly lang_id : string
10
+ readonly references_json : string
11
+ readonly geo_json? : string
12
+ readonly text : string
13
+ readonly content_json? : string
14
+ readonly media_json? : string
15
+ readonly attachments_json? : string
16
+ readonly entities_json? : string
17
+ readonly reply_settings_type_id : string
16
18
 
17
- // constructor(twitter_tweet : TwitterTweet) {
18
- // if (!TwitterTweet.is(twitter_tweet)) {
19
- // throw Error("Invalid input.")
20
- // }
21
- // this.twitter_tweet_id = twitter_tweet.twitter_tweet_id
22
- // this.twitter_user_id = twitter_tweet.twitter_user_id
23
- // }
19
+ constructor(twitter_tweet : TwitterTweet) {
20
+ if (!TwitterTweet.is(twitter_tweet)) {
21
+ throw Error("Invalid input.")
22
+ }
23
+ this.twitter_tweet_id = twitter_tweet.twitter_tweet_id
24
+ this.twitter_user_id = twitter_tweet.twitter_user_id
25
+ this.supreme_twitter_tweet_id = twitter_tweet.supreme_twitter_tweet_id
26
+ this.draft_twitter_tweet_ids = twitter_tweet.draft_twitter_tweet_ids
27
+ this.community_ids = twitter_tweet.community_ids
28
+ this.is_sensitive = twitter_tweet.is_sensitive
29
+ this.is_sponsored = twitter_tweet.is_sponsored
30
+ this.lang_id = twitter_tweet.lang_id
31
+ this.references_json = twitter_tweet.references_json
32
+ this.geo_json = twitter_tweet.geo_json
33
+ this.text = twitter_tweet.text
34
+ this.content_json = twitter_tweet.content_json
35
+ this.media_json = twitter_tweet.media_json
36
+ this.attachments_json = twitter_tweet.attachments_json
37
+ this.entities_json = twitter_tweet.entities_json
38
+ this.reply_settings_type_id = twitter_tweet.reply_settings_type_id
39
+ }
24
40
 
25
- // static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
26
- // return (
27
- // twitter_tweet !== undefined &&
28
- // typeof twitter_tweet.twitter_tweet_id === "string" &&
29
- // typeof twitter_tweet.twitter_user_id === "string"
30
- // )
31
- // }
32
- // }
41
+ static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
42
+ return (
43
+ twitter_tweet !== undefined &&
44
+ typeof twitter_tweet.twitter_tweet_id === "string" &&
45
+ typeof twitter_tweet.twitter_user_id === "string" &&
46
+ typeof twitter_tweet.supreme_twitter_tweet_id === "string" &&
47
+ Array.isArray(twitter_tweet.draft_twitter_tweet_ids) && twitter_tweet.draft_twitter_tweet_ids.every((draft_twitter_tweet_id : any) => typeof draft_twitter_tweet_id === "string") &&
48
+ Array.isArray(twitter_tweet.community_ids) && twitter_tweet.community_id.every((community_id : any) => typeof community_id === "string") &&
49
+ typeof twitter_tweet.is_sensitive === "boolean" &&
50
+ typeof twitter_tweet.is_sponsored === "boolean" &&
51
+ typeof twitter_tweet.lang_id === "string" &&
52
+ typeof twitter_tweet.references_json === "string" &&
53
+ (twitter_tweet.geo_json === undefined || typeof twitter_tweet.geo_json === "string") &&
54
+ typeof twitter_tweet.text === "string" &&
55
+ (twitter_tweet.content_json === undefined || typeof twitter_tweet.content_json === "string") &&
56
+ (twitter_tweet.media_json === undefined || typeof twitter_tweet.media_json === "string") &&
57
+ (twitter_tweet.attachments_json === undefined || typeof twitter_tweet.attachments_json === "string") &&
58
+ (twitter_tweet.entities_json === undefined || typeof twitter_tweet.entities_json === "string") &&
59
+ typeof twitter_tweet.reply_settings_type_id === "string"
60
+
61
+ )
62
+ }
63
+ }
@@ -11,7 +11,7 @@ export class TwitterUser {
11
11
  readonly is_parody : boolean
12
12
  readonly subscription_type_id : string
13
13
  readonly verification_type_id : string
14
- readonly entities : string | undefined
14
+ readonly entities? : string
15
15
 
16
16
  constructor(twitter_user : TwitterUser) {
17
17
  if (!TwitterUser.is(twitter_user)) {