triangle-types 1.0.125 → 1.0.127
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 -2
- package/dist/src/index.js +2 -2
- package/dist/src/types/scout/Scout.d.ts +2 -0
- package/dist/src/types/scout/Scout.js +6 -0
- package/dist/src/types/www/WWWArticle.d.ts +10 -0
- package/dist/src/types/www/WWWArticle.js +28 -0
- package/dist/src/types/www/WWWArticleTag.d.ts +17 -0
- package/dist/src/types/www/WWWArticleTag.js +43 -0
- package/package.json +1 -1
- package/src/index.ts +2 -2
- package/src/types/scout/Scout.ts +6 -0
- package/src/types/www/WWWArticle.ts +32 -0
- package/src/types/www/WWWArticleTag.ts +54 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./types/errors/APIError.js";
|
|
2
2
|
export * from "./types/application/ApplicationStage.js";
|
|
3
|
-
export * from "./types/press/PressArticle.js";
|
|
4
|
-
export * from "./types/press/PressArticleTag.js";
|
|
5
3
|
export * from "./types/twitter/TwitterTweet.js";
|
|
6
4
|
export * from "./types/twitter/TwitterUser.js";
|
|
7
5
|
export * from "./types/twitter/TwitterUserTag.js";
|
|
6
|
+
export * from "./types/www/WWWArticle.js";
|
|
7
|
+
export * from "./types/www/WWWArticleTag.js";
|
|
8
8
|
export * from "./types/youtube/YoutubeChannel.js";
|
|
9
9
|
export * from "./types/youtube/YoutubeVideo.js";
|
|
10
10
|
export * from "./types/youtube/YoutubeVideoTag.js";
|
package/dist/src/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from "./types/errors/APIError.js";
|
|
2
2
|
export * from "./types/application/ApplicationStage.js";
|
|
3
|
-
export * from "./types/press/PressArticle.js";
|
|
4
|
-
export * from "./types/press/PressArticleTag.js";
|
|
5
3
|
export * from "./types/twitter/TwitterTweet.js";
|
|
6
4
|
export * from "./types/twitter/TwitterUser.js";
|
|
7
5
|
export * from "./types/twitter/TwitterUserTag.js";
|
|
6
|
+
export * from "./types/www/WWWArticle.js";
|
|
7
|
+
export * from "./types/www/WWWArticleTag.js";
|
|
8
8
|
export * from "./types/youtube/YoutubeChannel.js";
|
|
9
9
|
export * from "./types/youtube/YoutubeVideo.js";
|
|
10
10
|
export * from "./types/youtube/YoutubeVideoTag.js";
|
|
@@ -7,6 +7,8 @@ export class Scout {
|
|
|
7
7
|
scout_id;
|
|
8
8
|
// readonly scout_type_id : ScoutTypeID
|
|
9
9
|
name;
|
|
10
|
+
www_ballotpedia_article_id;
|
|
11
|
+
www_wikipedia_article_id;
|
|
10
12
|
s3_id_img;
|
|
11
13
|
constructor(scout) {
|
|
12
14
|
if (!Scout.is(scout)) {
|
|
@@ -15,6 +17,8 @@ export class Scout {
|
|
|
15
17
|
this.scout_id = scout.scout_id;
|
|
16
18
|
// this.scout_type_id = scout.scout_type_id
|
|
17
19
|
this.name = scout.name;
|
|
20
|
+
this.www_ballotpedia_article_id = scout.www_ballotpedia_article_id;
|
|
21
|
+
this.www_wikipedia_article_id = scout.www_wikipedia_article_id;
|
|
18
22
|
this.s3_id_img = scout.s3_id_img;
|
|
19
23
|
}
|
|
20
24
|
static is(scout) {
|
|
@@ -22,6 +26,8 @@ export class Scout {
|
|
|
22
26
|
typeof scout.scout_id === "string" &&
|
|
23
27
|
// is_scout_type_id(scout.scout_type_id) &&
|
|
24
28
|
typeof scout.name === "string" &&
|
|
29
|
+
(scout.www_ballotpedia_article_id === undefined || typeof scout.www_ballotpedia_article_id === "string") &&
|
|
30
|
+
(scout.www_wikipedia_article_id === undefined || typeof scout.www_wikipedia_article_id === "string") &&
|
|
25
31
|
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
|
|
26
32
|
}
|
|
27
33
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare class WWWArticle {
|
|
2
|
+
readonly www_article_id: string;
|
|
3
|
+
readonly url: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly date?: string;
|
|
6
|
+
readonly relevance?: string;
|
|
7
|
+
readonly s3_id?: string;
|
|
8
|
+
constructor(www_article: WWWArticle);
|
|
9
|
+
static is(www_article: any): www_article is WWWArticle;
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class WWWArticle {
|
|
2
|
+
www_article_id;
|
|
3
|
+
url;
|
|
4
|
+
title;
|
|
5
|
+
date;
|
|
6
|
+
relevance;
|
|
7
|
+
s3_id;
|
|
8
|
+
constructor(www_article) {
|
|
9
|
+
if (!WWWArticle.is(www_article)) {
|
|
10
|
+
throw Error("Invalid input.");
|
|
11
|
+
}
|
|
12
|
+
this.www_article_id = www_article.www_article_id;
|
|
13
|
+
this.url = www_article.url;
|
|
14
|
+
this.title = www_article.title;
|
|
15
|
+
this.date = www_article.date;
|
|
16
|
+
this.relevance = www_article.relevance;
|
|
17
|
+
this.s3_id = www_article.s3_id;
|
|
18
|
+
}
|
|
19
|
+
static is(www_article) {
|
|
20
|
+
return (www_article !== undefined &&
|
|
21
|
+
typeof www_article.www_article_id === "string" &&
|
|
22
|
+
typeof www_article.url === "string" &&
|
|
23
|
+
typeof www_article.title === "string" &&
|
|
24
|
+
(www_article.date === undefined || typeof www_article.date === "string") &&
|
|
25
|
+
(www_article.relevance === undefined || typeof www_article.relevance === "string") &&
|
|
26
|
+
(www_article.s3_id === undefined || typeof www_article.s3_id === "string"));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WWWArticle } from "./WWWArticle.js";
|
|
2
|
+
export declare class WWWArticleTag {
|
|
3
|
+
readonly www_article_id: string;
|
|
4
|
+
readonly tag_id: string;
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly date?: string;
|
|
7
|
+
readonly relevance?: string;
|
|
8
|
+
readonly sentiment?: string;
|
|
9
|
+
readonly [x: string]: any;
|
|
10
|
+
constructor(www_article_tag: WWWArticleTag);
|
|
11
|
+
static is(www_article_tag: any): www_article_tag is WWWArticleTag;
|
|
12
|
+
}
|
|
13
|
+
export declare class WWWArticleTagAux extends WWWArticleTag {
|
|
14
|
+
readonly www_article: WWWArticle;
|
|
15
|
+
constructor(www_article_tag: any);
|
|
16
|
+
static is(www_article_tag: any): www_article_tag is WWWArticleTagAux;
|
|
17
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { WWWArticle } from "./WWWArticle.js";
|
|
2
|
+
export class WWWArticleTag {
|
|
3
|
+
www_article_id;
|
|
4
|
+
tag_id;
|
|
5
|
+
url;
|
|
6
|
+
date;
|
|
7
|
+
relevance;
|
|
8
|
+
sentiment;
|
|
9
|
+
constructor(www_article_tag) {
|
|
10
|
+
if (!WWWArticleTag.is(www_article_tag)) {
|
|
11
|
+
throw Error("Invalid input.");
|
|
12
|
+
}
|
|
13
|
+
this.www_article_id = www_article_tag.www_article_id;
|
|
14
|
+
this.tag_id = www_article_tag.tag_id;
|
|
15
|
+
this.url = www_article_tag.url;
|
|
16
|
+
this.date = www_article_tag.date;
|
|
17
|
+
this.relevance = www_article_tag.relevance;
|
|
18
|
+
this.sentiment = www_article_tag.sentiment;
|
|
19
|
+
}
|
|
20
|
+
static is(www_article_tag) {
|
|
21
|
+
return (www_article_tag !== undefined &&
|
|
22
|
+
typeof www_article_tag.www_article_id === "string" &&
|
|
23
|
+
typeof www_article_tag.tag_id === "string" &&
|
|
24
|
+
typeof www_article_tag.url === "string" &&
|
|
25
|
+
(www_article_tag.date === undefined || typeof www_article_tag.date === "string") &&
|
|
26
|
+
(www_article_tag.relevance === undefined || typeof www_article_tag.relevance === "string") &&
|
|
27
|
+
(www_article_tag.sentiment === undefined || typeof www_article_tag.sentiment === "string"));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export class WWWArticleTagAux extends WWWArticleTag {
|
|
31
|
+
www_article;
|
|
32
|
+
constructor(www_article_tag) {
|
|
33
|
+
if (!WWWArticleTagAux.is(www_article_tag)) {
|
|
34
|
+
throw Error("Invalid input.");
|
|
35
|
+
}
|
|
36
|
+
super(www_article_tag);
|
|
37
|
+
this.www_article = www_article_tag.www_article;
|
|
38
|
+
}
|
|
39
|
+
static is(www_article_tag) {
|
|
40
|
+
return (WWWArticleTag.is(www_article_tag) &&
|
|
41
|
+
WWWArticle.is(www_article_tag.www_article));
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,11 +2,11 @@ export * from "./types/errors/APIError"
|
|
|
2
2
|
|
|
3
3
|
export * from "./types/application/ApplicationStage"
|
|
4
4
|
|
|
5
|
-
export * from "./types/press/PressArticle"
|
|
6
|
-
export * from "./types/press/PressArticleTag"
|
|
7
5
|
export * from "./types/twitter/TwitterTweet"
|
|
8
6
|
export * from "./types/twitter/TwitterUser"
|
|
9
7
|
export * from "./types/twitter/TwitterUserTag"
|
|
8
|
+
export * from "./types/www/WWWArticle"
|
|
9
|
+
export * from "./types/www/WWWArticleTag"
|
|
10
10
|
export * from "./types/youtube/YoutubeChannel"
|
|
11
11
|
export * from "./types/youtube/YoutubeVideo"
|
|
12
12
|
export * from "./types/youtube/YoutubeVideoTag"
|
package/src/types/scout/Scout.ts
CHANGED
|
@@ -13,6 +13,8 @@ export class Scout {
|
|
|
13
13
|
readonly scout_id : string
|
|
14
14
|
// readonly scout_type_id : ScoutTypeID
|
|
15
15
|
readonly name : string
|
|
16
|
+
readonly www_ballotpedia_article_id? : string
|
|
17
|
+
readonly www_wikipedia_article_id? : string
|
|
16
18
|
readonly s3_id_img? : string
|
|
17
19
|
readonly [x : string] : any
|
|
18
20
|
|
|
@@ -23,6 +25,8 @@ export class Scout {
|
|
|
23
25
|
this.scout_id = scout.scout_id
|
|
24
26
|
// this.scout_type_id = scout.scout_type_id
|
|
25
27
|
this.name = scout.name
|
|
28
|
+
this.www_ballotpedia_article_id = scout.www_ballotpedia_article_id
|
|
29
|
+
this.www_wikipedia_article_id = scout.www_wikipedia_article_id
|
|
26
30
|
this.s3_id_img = scout.s3_id_img
|
|
27
31
|
}
|
|
28
32
|
|
|
@@ -32,6 +36,8 @@ export class Scout {
|
|
|
32
36
|
typeof scout.scout_id === "string" &&
|
|
33
37
|
// is_scout_type_id(scout.scout_type_id) &&
|
|
34
38
|
typeof scout.name === "string" &&
|
|
39
|
+
(scout.www_ballotpedia_article_id === undefined || typeof scout.www_ballotpedia_article_id === "string") &&
|
|
40
|
+
(scout.www_wikipedia_article_id === undefined || typeof scout.www_wikipedia_article_id === "string") &&
|
|
35
41
|
(scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
|
|
36
42
|
)
|
|
37
43
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class WWWArticle {
|
|
2
|
+
readonly www_article_id : string
|
|
3
|
+
readonly url : string
|
|
4
|
+
readonly title : string
|
|
5
|
+
readonly date? : string
|
|
6
|
+
readonly relevance? : string
|
|
7
|
+
readonly s3_id? : string
|
|
8
|
+
|
|
9
|
+
constructor(www_article : WWWArticle) {
|
|
10
|
+
if (!WWWArticle.is(www_article)) {
|
|
11
|
+
throw Error("Invalid input.")
|
|
12
|
+
}
|
|
13
|
+
this.www_article_id = www_article.www_article_id
|
|
14
|
+
this.url = www_article.url
|
|
15
|
+
this.title = www_article.title
|
|
16
|
+
this.date = www_article.date
|
|
17
|
+
this.relevance = www_article.relevance
|
|
18
|
+
this.s3_id = www_article.s3_id
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static is(www_article : any) : www_article is WWWArticle {
|
|
22
|
+
return (
|
|
23
|
+
www_article !== undefined &&
|
|
24
|
+
typeof www_article.www_article_id === "string" &&
|
|
25
|
+
typeof www_article.url === "string" &&
|
|
26
|
+
typeof www_article.title === "string" &&
|
|
27
|
+
(www_article.date === undefined || typeof www_article.date === "string") &&
|
|
28
|
+
(www_article.relevance === undefined || typeof www_article.relevance === "string") &&
|
|
29
|
+
(www_article.s3_id === undefined || typeof www_article.s3_id === "string")
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { WWWArticle } from "./WWWArticle"
|
|
2
|
+
|
|
3
|
+
export class WWWArticleTag {
|
|
4
|
+
readonly www_article_id : string
|
|
5
|
+
readonly tag_id : string
|
|
6
|
+
readonly url : string
|
|
7
|
+
readonly date? : string
|
|
8
|
+
readonly relevance? : string
|
|
9
|
+
readonly sentiment? : string
|
|
10
|
+
readonly [x : string] : any
|
|
11
|
+
|
|
12
|
+
constructor(www_article_tag : WWWArticleTag) {
|
|
13
|
+
if (!WWWArticleTag.is(www_article_tag)) {
|
|
14
|
+
throw Error("Invalid input.")
|
|
15
|
+
}
|
|
16
|
+
this.www_article_id = www_article_tag.www_article_id
|
|
17
|
+
this.tag_id = www_article_tag.tag_id
|
|
18
|
+
this.url = www_article_tag.url
|
|
19
|
+
this.date = www_article_tag.date
|
|
20
|
+
this.relevance = www_article_tag.relevance
|
|
21
|
+
this.sentiment = www_article_tag.sentiment
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static is(www_article_tag : any) : www_article_tag is WWWArticleTag {
|
|
25
|
+
return (
|
|
26
|
+
www_article_tag !== undefined &&
|
|
27
|
+
typeof www_article_tag.www_article_id === "string" &&
|
|
28
|
+
typeof www_article_tag.tag_id === "string" &&
|
|
29
|
+
typeof www_article_tag.url === "string" &&
|
|
30
|
+
(www_article_tag.date === undefined || typeof www_article_tag.date === "string") &&
|
|
31
|
+
(www_article_tag.relevance === undefined || typeof www_article_tag.relevance === "string") &&
|
|
32
|
+
(www_article_tag.sentiment === undefined || typeof www_article_tag.sentiment === "string")
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class WWWArticleTagAux extends WWWArticleTag {
|
|
38
|
+
readonly www_article : WWWArticle
|
|
39
|
+
|
|
40
|
+
constructor(www_article_tag : any) {
|
|
41
|
+
if (!WWWArticleTagAux.is(www_article_tag)) {
|
|
42
|
+
throw Error("Invalid input.")
|
|
43
|
+
}
|
|
44
|
+
super(www_article_tag)
|
|
45
|
+
this.www_article = www_article_tag.www_article
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static is(www_article_tag : any) : www_article_tag is WWWArticleTagAux {
|
|
49
|
+
return (
|
|
50
|
+
WWWArticleTag.is(www_article_tag) &&
|
|
51
|
+
WWWArticle.is(www_article_tag.www_article)
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
}
|