elections-types 1.1.20 → 1.1.22
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 +2 -4
- package/dist/src/index.js +2 -4
- package/dist/src/types/PressArticle.d.ts +13 -0
- package/dist/src/types/PressArticle.js +37 -0
- package/dist/src/types/PressArticleTag.d.ts +15 -0
- package/dist/src/types/PressArticleTag.js +37 -0
- package/package.json +1 -1
- package/src/index.ts +2 -4
- package/src/types/PressArticle.ts +41 -0
- package/src/types/PressArticleTag.ts +48 -0
- package/src/types/Article.ts +0 -44
- package/src/types/CandidateArticle.ts +0 -54
- package/src/types/CandidateTweet.ts +0 -54
- package/src/types/CandidateVideo.ts +0 -51
package/dist/src/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export * from "./types/APIError.js";
|
|
2
|
-
export * from "./types/Article.js";
|
|
3
|
-
export * from "./types/CandidateArticle.js";
|
|
4
|
-
export * from "./types/CandidateTweet.js";
|
|
5
|
-
export * from "./types/CandidateVideo.js";
|
|
6
2
|
export * from "./types/FederalElection.js";
|
|
7
3
|
export * from "./types/ElectionsConfig.js";
|
|
8
4
|
export * from "./types/FederalElectionCommittee.js";
|
|
@@ -17,6 +13,8 @@ export * from "./types/FederalElectionF3File.js";
|
|
|
17
13
|
export * from "./types/FederalElectionF24File.js";
|
|
18
14
|
export * from "./types/FormTypeID.js";
|
|
19
15
|
export * from "./types/State.js";
|
|
16
|
+
export * from "./types/PressArticle.js";
|
|
17
|
+
export * from "./types/PressArticleTag.js";
|
|
20
18
|
export * from "./types/Tweet.js";
|
|
21
19
|
export * from "./types/TwitterUser.js";
|
|
22
20
|
export * from "./types/TwitterUserTag.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export * from "./types/APIError.js";
|
|
2
|
-
export * from "./types/Article.js";
|
|
3
|
-
export * from "./types/CandidateArticle.js";
|
|
4
|
-
export * from "./types/CandidateTweet.js";
|
|
5
|
-
export * from "./types/CandidateVideo.js";
|
|
6
2
|
export * from "./types/FederalElection.js";
|
|
7
3
|
export * from "./types/ElectionsConfig.js";
|
|
8
4
|
export * from "./types/FederalElectionCommittee.js";
|
|
@@ -17,6 +13,8 @@ export * from "./types/FederalElectionF3File.js";
|
|
|
17
13
|
export * from "./types/FederalElectionF24File.js";
|
|
18
14
|
export * from "./types/FormTypeID.js";
|
|
19
15
|
export * from "./types/State.js";
|
|
16
|
+
export * from "./types/PressArticle.js";
|
|
17
|
+
export * from "./types/PressArticleTag.js";
|
|
20
18
|
export * from "./types/Tweet.js";
|
|
21
19
|
export * from "./types/TwitterUser.js";
|
|
22
20
|
export * from "./types/TwitterUserTag.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class PressArticle {
|
|
2
|
+
readonly press_article_id: string;
|
|
3
|
+
readonly publish_date: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly publisher?: string;
|
|
6
|
+
readonly domain: string;
|
|
7
|
+
readonly url: string;
|
|
8
|
+
readonly fetch_time: string;
|
|
9
|
+
readonly relevance?: string;
|
|
10
|
+
readonly s3_id?: string;
|
|
11
|
+
constructor(press_article: PressArticle);
|
|
12
|
+
static is(press_article: any): press_article is PressArticle;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export class PressArticle {
|
|
2
|
+
press_article_id;
|
|
3
|
+
publish_date;
|
|
4
|
+
title;
|
|
5
|
+
publisher;
|
|
6
|
+
domain;
|
|
7
|
+
url;
|
|
8
|
+
fetch_time;
|
|
9
|
+
relevance;
|
|
10
|
+
s3_id;
|
|
11
|
+
constructor(press_article) {
|
|
12
|
+
if (!PressArticle.is(press_article)) {
|
|
13
|
+
throw Error("Invalid input.");
|
|
14
|
+
}
|
|
15
|
+
this.press_article_id = press_article.press_article_id;
|
|
16
|
+
this.publish_date = press_article.publish_date;
|
|
17
|
+
this.title = press_article.title;
|
|
18
|
+
this.publisher = press_article.publisher;
|
|
19
|
+
this.domain = press_article.domain;
|
|
20
|
+
this.url = press_article.url;
|
|
21
|
+
this.fetch_time = press_article.fetch_time;
|
|
22
|
+
this.relevance = press_article.relevance;
|
|
23
|
+
this.s3_id = press_article.s3_id;
|
|
24
|
+
}
|
|
25
|
+
static is(press_article) {
|
|
26
|
+
return (press_article !== undefined &&
|
|
27
|
+
typeof press_article.press_article_id === "string" &&
|
|
28
|
+
typeof press_article.publish_date === "string" &&
|
|
29
|
+
typeof press_article.title === "string" &&
|
|
30
|
+
(press_article.publisher === undefined || typeof press_article.publisher === "string") &&
|
|
31
|
+
typeof press_article.domain === "string" &&
|
|
32
|
+
typeof press_article.url === "string" &&
|
|
33
|
+
typeof press_article.fetch_time === "string" &&
|
|
34
|
+
(press_article.relevance === undefined || typeof press_article.relevance === "string") &&
|
|
35
|
+
(press_article.s3_id === undefined || typeof press_article.s3_id === "string"));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PressArticle } from "./PressArticle.js";
|
|
2
|
+
export declare class PressArticleTag {
|
|
3
|
+
readonly press_article_id: string;
|
|
4
|
+
readonly tag_id: string;
|
|
5
|
+
readonly publish_date: string;
|
|
6
|
+
readonly relevance?: string;
|
|
7
|
+
readonly [x: string]: any;
|
|
8
|
+
constructor(press_article_tag: PressArticleTag);
|
|
9
|
+
static is(press_article_tag: any): press_article_tag is PressArticleTag;
|
|
10
|
+
}
|
|
11
|
+
export declare class PressArticleTagAux extends PressArticleTag {
|
|
12
|
+
readonly press_article: PressArticle;
|
|
13
|
+
constructor(press_article_tag: any);
|
|
14
|
+
static is(press_article_tag: any): press_article_tag is PressArticleTagAux;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { PressArticle } from "./PressArticle.js";
|
|
2
|
+
export class PressArticleTag {
|
|
3
|
+
press_article_id;
|
|
4
|
+
tag_id;
|
|
5
|
+
publish_date;
|
|
6
|
+
relevance;
|
|
7
|
+
constructor(press_article_tag) {
|
|
8
|
+
if (!PressArticleTag.is(press_article_tag)) {
|
|
9
|
+
throw Error("Invalid input.");
|
|
10
|
+
}
|
|
11
|
+
this.press_article_id = press_article_tag.press_article_id;
|
|
12
|
+
this.tag_id = press_article_tag.tag_id;
|
|
13
|
+
this.publish_date = press_article_tag.publish_date;
|
|
14
|
+
this.relevance = press_article_tag.relevance;
|
|
15
|
+
}
|
|
16
|
+
static is(press_article_tag) {
|
|
17
|
+
return (press_article_tag !== undefined &&
|
|
18
|
+
typeof press_article_tag.press_article_id === "string" &&
|
|
19
|
+
typeof press_article_tag.tag_id === "string" &&
|
|
20
|
+
typeof press_article_tag.publish_date === "string" &&
|
|
21
|
+
(press_article_tag.relevance === undefined || typeof press_article_tag.relevance === "string"));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export class PressArticleTagAux extends PressArticleTag {
|
|
25
|
+
press_article;
|
|
26
|
+
constructor(press_article_tag) {
|
|
27
|
+
if (!PressArticleTagAux.is(press_article_tag)) {
|
|
28
|
+
throw Error("Invalid input.");
|
|
29
|
+
}
|
|
30
|
+
super(press_article_tag);
|
|
31
|
+
this.press_article = press_article_tag.press_article;
|
|
32
|
+
}
|
|
33
|
+
static is(press_article_tag) {
|
|
34
|
+
return (PressArticleTag.is(press_article_tag) &&
|
|
35
|
+
PressArticle.is(press_article_tag.press_article));
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
export * from "./types/APIError"
|
|
2
|
-
export * from "./types/Article"
|
|
3
|
-
export * from "./types/CandidateArticle"
|
|
4
|
-
export * from "./types/CandidateTweet"
|
|
5
|
-
export * from "./types/CandidateVideo"
|
|
6
2
|
export * from "./types/FederalElection"
|
|
7
3
|
export * from "./types/ElectionsConfig"
|
|
8
4
|
export * from "./types/FederalElectionCommittee"
|
|
@@ -17,6 +13,8 @@ export * from "./types/FederalElectionF3File"
|
|
|
17
13
|
export * from "./types/FederalElectionF24File"
|
|
18
14
|
export * from "./types/FormTypeID"
|
|
19
15
|
export * from "./types/State"
|
|
16
|
+
export * from "./types/PressArticle"
|
|
17
|
+
export * from "./types/PressArticleTag"
|
|
20
18
|
export * from "./types/Tweet"
|
|
21
19
|
export * from "./types/TwitterUser"
|
|
22
20
|
export * from "./types/TwitterUserTag"
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class PressArticle {
|
|
2
|
+
readonly press_article_id : string
|
|
3
|
+
readonly publish_date : string
|
|
4
|
+
readonly title : string
|
|
5
|
+
readonly publisher? : string
|
|
6
|
+
readonly domain : string
|
|
7
|
+
readonly url : string
|
|
8
|
+
readonly fetch_time : string
|
|
9
|
+
readonly relevance? : string
|
|
10
|
+
readonly s3_id? : string
|
|
11
|
+
|
|
12
|
+
constructor(press_article : PressArticle) {
|
|
13
|
+
if (!PressArticle.is(press_article)) {
|
|
14
|
+
throw Error("Invalid input.")
|
|
15
|
+
}
|
|
16
|
+
this.press_article_id = press_article.press_article_id
|
|
17
|
+
this.publish_date = press_article.publish_date
|
|
18
|
+
this.title = press_article.title
|
|
19
|
+
this.publisher = press_article.publisher
|
|
20
|
+
this.domain = press_article.domain
|
|
21
|
+
this.url = press_article.url
|
|
22
|
+
this.fetch_time = press_article.fetch_time
|
|
23
|
+
this.relevance = press_article.relevance
|
|
24
|
+
this.s3_id = press_article.s3_id
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static is(press_article : any) : press_article is PressArticle {
|
|
28
|
+
return (
|
|
29
|
+
press_article !== undefined &&
|
|
30
|
+
typeof press_article.press_article_id === "string" &&
|
|
31
|
+
typeof press_article.publish_date === "string" &&
|
|
32
|
+
typeof press_article.title === "string" &&
|
|
33
|
+
(press_article.publisher === undefined || typeof press_article.publisher === "string") &&
|
|
34
|
+
typeof press_article.domain === "string" &&
|
|
35
|
+
typeof press_article.url === "string" &&
|
|
36
|
+
typeof press_article.fetch_time === "string" &&
|
|
37
|
+
(press_article.relevance === undefined || typeof press_article.relevance === "string") &&
|
|
38
|
+
(press_article.s3_id === undefined || typeof press_article.s3_id === "string")
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { PressArticle } from "./PressArticle"
|
|
2
|
+
|
|
3
|
+
export class PressArticleTag {
|
|
4
|
+
readonly press_article_id : string
|
|
5
|
+
readonly tag_id : string
|
|
6
|
+
readonly publish_date : string
|
|
7
|
+
readonly relevance? : string
|
|
8
|
+
readonly [x : string] : any
|
|
9
|
+
|
|
10
|
+
constructor(press_article_tag : PressArticleTag) {
|
|
11
|
+
if (!PressArticleTag.is(press_article_tag)) {
|
|
12
|
+
throw Error("Invalid input.")
|
|
13
|
+
}
|
|
14
|
+
this.press_article_id = press_article_tag.press_article_id
|
|
15
|
+
this.tag_id = press_article_tag.tag_id
|
|
16
|
+
this.publish_date = press_article_tag.publish_date
|
|
17
|
+
this.relevance = press_article_tag.relevance
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static is(press_article_tag : any) : press_article_tag is PressArticleTag {
|
|
21
|
+
return (
|
|
22
|
+
press_article_tag !== undefined &&
|
|
23
|
+
typeof press_article_tag.press_article_id === "string" &&
|
|
24
|
+
typeof press_article_tag.tag_id === "string" &&
|
|
25
|
+
typeof press_article_tag.publish_date === "string" &&
|
|
26
|
+
(press_article_tag.relevance === undefined || typeof press_article_tag.relevance === "string")
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class PressArticleTagAux extends PressArticleTag {
|
|
32
|
+
readonly press_article : PressArticle
|
|
33
|
+
|
|
34
|
+
constructor(press_article_tag : any) {
|
|
35
|
+
if (!PressArticleTagAux.is(press_article_tag)) {
|
|
36
|
+
throw Error("Invalid input.")
|
|
37
|
+
}
|
|
38
|
+
super(press_article_tag)
|
|
39
|
+
this.press_article = press_article_tag.press_article
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static is(press_article_tag : any) : press_article_tag is PressArticleTagAux {
|
|
43
|
+
return (
|
|
44
|
+
PressArticleTag.is(press_article_tag) &&
|
|
45
|
+
PressArticle.is(press_article_tag.press_article)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
}
|
package/src/types/Article.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export class Article {
|
|
2
|
-
readonly article_id : string
|
|
3
|
-
readonly publish_date : string
|
|
4
|
-
readonly hash : string
|
|
5
|
-
readonly title : string
|
|
6
|
-
readonly publisher? : string
|
|
7
|
-
readonly domain : string
|
|
8
|
-
readonly url : string
|
|
9
|
-
readonly fetch_time : string
|
|
10
|
-
readonly relevance? : string
|
|
11
|
-
readonly text_status? : string
|
|
12
|
-
|
|
13
|
-
constructor(article : Article) {
|
|
14
|
-
if (!Article.is(article)) {
|
|
15
|
-
throw Error("Invalid input.")
|
|
16
|
-
}
|
|
17
|
-
this.article_id = article.article_id
|
|
18
|
-
this.publish_date = article.publish_date
|
|
19
|
-
this.hash = article.hash
|
|
20
|
-
this.title = article.title
|
|
21
|
-
this.publisher = article.publisher
|
|
22
|
-
this.domain = article.domain
|
|
23
|
-
this.url = article.url
|
|
24
|
-
this.fetch_time = article.fetch_time
|
|
25
|
-
this.relevance = article.relevance
|
|
26
|
-
this.text_status = article.text_status
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static is(article : any) : article is Article {
|
|
30
|
-
return (
|
|
31
|
-
article !== undefined &&
|
|
32
|
-
typeof article.article_id === "string" &&
|
|
33
|
-
typeof article.publish_date === "string" &&
|
|
34
|
-
typeof article.hash === "string" &&
|
|
35
|
-
typeof article.title === "string" &&
|
|
36
|
-
(article.publisher === undefined || typeof article.publisher === "string") &&
|
|
37
|
-
typeof article.domain === "string" &&
|
|
38
|
-
typeof article.url === "string" &&
|
|
39
|
-
typeof article.fetch_time === "string" &&
|
|
40
|
-
(article.relevance === undefined || typeof article.relevance === "string") &&
|
|
41
|
-
(article.text_status === undefined || typeof article.text_status === "string")
|
|
42
|
-
)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Article } from "./Article"
|
|
2
|
-
|
|
3
|
-
export class CandidateArticle {
|
|
4
|
-
readonly candidate_id : string
|
|
5
|
-
readonly article_id : string
|
|
6
|
-
readonly url : string
|
|
7
|
-
readonly fetch_time : string
|
|
8
|
-
readonly relevance? : string
|
|
9
|
-
readonly sentiment? : string
|
|
10
|
-
[x : string] : any
|
|
11
|
-
|
|
12
|
-
constructor(candidate_article : CandidateArticle) {
|
|
13
|
-
if (!CandidateArticle.is(candidate_article)) {
|
|
14
|
-
throw Error("Invalid input.")
|
|
15
|
-
}
|
|
16
|
-
this.candidate_id = candidate_article.candidate_id
|
|
17
|
-
this.article_id = candidate_article.article_id
|
|
18
|
-
this.url = candidate_article.url
|
|
19
|
-
this.fetch_time = candidate_article.fetch_time
|
|
20
|
-
this.relevance = candidate_article.relevance
|
|
21
|
-
this.sentiment = candidate_article.sentiment
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static is(candidate_article : any) : candidate_article is CandidateArticle {
|
|
25
|
-
return (
|
|
26
|
-
candidate_article !== undefined &&
|
|
27
|
-
typeof candidate_article.candidate_id === "string" &&
|
|
28
|
-
typeof candidate_article.article_id === "string" &&
|
|
29
|
-
typeof candidate_article.url === "string" &&
|
|
30
|
-
typeof candidate_article.fetch_time === "string" &&
|
|
31
|
-
(candidate_article.relevance === undefined || typeof candidate_article.relevance === "string") &&
|
|
32
|
-
(candidate_article.sentiment === undefined || typeof candidate_article.sentiment === "string")
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class CandidateArticleAux extends CandidateArticle {
|
|
38
|
-
readonly article : Article
|
|
39
|
-
|
|
40
|
-
constructor(candidate_article : any) {
|
|
41
|
-
if (!CandidateArticleAux.is(candidate_article)) {
|
|
42
|
-
throw Error("Invalid input.")
|
|
43
|
-
}
|
|
44
|
-
super(candidate_article)
|
|
45
|
-
this.article = candidate_article.article
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static is(candidate_article : any) : candidate_article is CandidateArticleAux {
|
|
49
|
-
return (
|
|
50
|
-
CandidateArticle.is(candidate_article) &&
|
|
51
|
-
Article.is(candidate_article.article)
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Tweet } from "./Tweet"
|
|
2
|
-
|
|
3
|
-
export class CandidateTweet {
|
|
4
|
-
readonly candidate_id : string
|
|
5
|
-
readonly tweet_id : string
|
|
6
|
-
readonly url : string
|
|
7
|
-
readonly fetch_time : string
|
|
8
|
-
readonly relevance? : string
|
|
9
|
-
readonly sentiment? : string
|
|
10
|
-
readonly [x : string] : any
|
|
11
|
-
|
|
12
|
-
constructor(candidate_tweet : CandidateTweet) {
|
|
13
|
-
if (!CandidateTweet.is(candidate_tweet)) {
|
|
14
|
-
throw Error("Invalid input.")
|
|
15
|
-
}
|
|
16
|
-
this.candidate_id = candidate_tweet.candidate_id
|
|
17
|
-
this.tweet_id = candidate_tweet.tweet_id
|
|
18
|
-
this.url = candidate_tweet.url
|
|
19
|
-
this.fetch_time = candidate_tweet.fetch_time
|
|
20
|
-
this.relevance = candidate_tweet.relevance
|
|
21
|
-
this.sentiment = candidate_tweet.sentiment
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
static is(candidate_tweet : any) : candidate_tweet is CandidateTweet {
|
|
25
|
-
return (
|
|
26
|
-
candidate_tweet !== undefined &&
|
|
27
|
-
typeof candidate_tweet.candidate_id === "string" &&
|
|
28
|
-
typeof candidate_tweet.tweet_id === "string" &&
|
|
29
|
-
typeof candidate_tweet.url === "string" &&
|
|
30
|
-
typeof candidate_tweet.fetch_time === "string" &&
|
|
31
|
-
(candidate_tweet.relevance === undefined || typeof candidate_tweet.relevance === "string") &&
|
|
32
|
-
(candidate_tweet.sentiment === undefined || typeof candidate_tweet.sentiment === "string")
|
|
33
|
-
)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export class CandidateTweetAux extends CandidateTweet {
|
|
38
|
-
readonly tweet : Tweet
|
|
39
|
-
|
|
40
|
-
constructor(candidate_tweet : any) {
|
|
41
|
-
if (!CandidateTweetAux.is(candidate_tweet)) {
|
|
42
|
-
throw Error("Invalid input.")
|
|
43
|
-
}
|
|
44
|
-
super(candidate_tweet)
|
|
45
|
-
this.tweet = candidate_tweet.tweet
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static is(candidate_tweet : any) : candidate_tweet is CandidateTweetAux {
|
|
49
|
-
return (
|
|
50
|
-
CandidateTweet.is(candidate_tweet) &&
|
|
51
|
-
Tweet.is(candidate_tweet.tweet)
|
|
52
|
-
)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Video } from "./Video"
|
|
2
|
-
|
|
3
|
-
export class CandidateVideo {
|
|
4
|
-
readonly candidate_id : string
|
|
5
|
-
readonly video_id : string
|
|
6
|
-
readonly title : string
|
|
7
|
-
readonly fetch_time : string
|
|
8
|
-
readonly relevance? : string
|
|
9
|
-
readonly [x : string] : any
|
|
10
|
-
|
|
11
|
-
constructor(candidate_video : CandidateVideo) {
|
|
12
|
-
if (!CandidateVideo.is(candidate_video)) {
|
|
13
|
-
throw Error("Invalid input.")
|
|
14
|
-
}
|
|
15
|
-
this.candidate_id = candidate_video.candidate_id
|
|
16
|
-
this.video_id = candidate_video.video_id
|
|
17
|
-
this.title = candidate_video.title
|
|
18
|
-
this.fetch_time = candidate_video.fetch_time
|
|
19
|
-
this.relevance = candidate_video.relevance
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static is(candidate_video : any) : candidate_video is CandidateVideo {
|
|
23
|
-
return (
|
|
24
|
-
candidate_video !== undefined &&
|
|
25
|
-
typeof candidate_video.candidate_id === "string" &&
|
|
26
|
-
typeof candidate_video.video_id === "string" &&
|
|
27
|
-
typeof candidate_video.title === "string" &&
|
|
28
|
-
typeof candidate_video.fetch_time === "string" &&
|
|
29
|
-
(candidate_video.relevance === undefined || typeof candidate_video.relevance === "string")
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export class CandidateVideoAux extends CandidateVideo {
|
|
35
|
-
readonly video : Video
|
|
36
|
-
|
|
37
|
-
constructor(candidate_video : any) {
|
|
38
|
-
if (!CandidateVideoAux.is(candidate_video)) {
|
|
39
|
-
throw Error("Invalid input.")
|
|
40
|
-
}
|
|
41
|
-
super(candidate_video)
|
|
42
|
-
this.video = candidate_video.video
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
static is(candidate_video : any) : candidate_video is CandidateVideoAux {
|
|
46
|
-
return (
|
|
47
|
-
CandidateVideo.is(candidate_video) &&
|
|
48
|
-
Video.is(candidate_video.video)
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
}
|