triangle-types 1.0.124 → 1.0.126

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.
@@ -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";
@@ -1,9 +1,9 @@
1
- import { DocumentTypeID } from "../fragments/Fragment.js";
2
1
  export declare class Scout {
3
2
  readonly scout_id: string;
4
3
  readonly name: string;
4
+ readonly www_ballotpedia_article_id?: string;
5
+ readonly www_wikipedia_article_id?: string;
5
6
  readonly s3_id_img?: string;
6
- readonly document_type_ids: DocumentTypeID[];
7
7
  readonly [x: string]: any;
8
8
  constructor(scout: any);
9
9
  static is(scout: any): scout is Scout;
@@ -1,4 +1,3 @@
1
- import { is_document_type_id } from "../fragments/Fragment.js";
2
1
  // const scout_type_ids = ["I", "O"] as const
3
2
  // export type ScoutTypeID = typeof scout_type_ids[number]
4
3
  // export function is_scout_type_id(scout_type_id : any) : scout_type_id is ScoutTypeID {
@@ -8,8 +7,9 @@ export class Scout {
8
7
  scout_id;
9
8
  // readonly scout_type_id : ScoutTypeID
10
9
  name;
10
+ www_ballotpedia_article_id;
11
+ www_wikipedia_article_id;
11
12
  s3_id_img;
12
- document_type_ids;
13
13
  constructor(scout) {
14
14
  if (!Scout.is(scout)) {
15
15
  throw Error("Invalid input.");
@@ -17,16 +17,18 @@ export class Scout {
17
17
  this.scout_id = scout.scout_id;
18
18
  // this.scout_type_id = scout.scout_type_id
19
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;
20
22
  this.s3_id_img = scout.s3_id_img;
21
- this.document_type_ids = scout.document_type_ids;
22
23
  }
23
24
  static is(scout) {
24
25
  return (scout !== undefined &&
25
26
  typeof scout.scout_id === "string" &&
26
27
  // is_scout_type_id(scout.scout_type_id) &&
27
28
  typeof scout.name === "string" &&
28
- (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string") &&
29
- Array.isArray(scout.document_type_ids) && scout.document_type_ids.every(is_document_type_id));
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") &&
31
+ (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
30
32
  }
31
33
  }
32
34
  export class ScoutAux extends Scout {
@@ -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 publish_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
+ publish_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.publish_date = www_article.publish_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
+ typeof www_article.publish_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 publish_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
+ publish_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.publish_date = www_article_tag.publish_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
+ typeof www_article_tag.publish_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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.124",
3
+ "version": "1.0.126",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
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"
@@ -13,8 +13,9 @@ 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
- readonly document_type_ids : DocumentTypeID[]
18
19
  readonly [x : string] : any
19
20
 
20
21
  constructor(scout : any) {
@@ -24,8 +25,9 @@ export class Scout {
24
25
  this.scout_id = scout.scout_id
25
26
  // this.scout_type_id = scout.scout_type_id
26
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
27
30
  this.s3_id_img = scout.s3_id_img
28
- this.document_type_ids = scout.document_type_ids
29
31
  }
30
32
 
31
33
  static is(scout : any) : scout is Scout {
@@ -34,8 +36,9 @@ export class Scout {
34
36
  typeof scout.scout_id === "string" &&
35
37
  // is_scout_type_id(scout.scout_type_id) &&
36
38
  typeof scout.name === "string" &&
37
- (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string") &&
38
- Array.isArray(scout.document_type_ids) && scout.document_type_ids.every(is_document_type_id)
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") &&
41
+ (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
39
42
  )
40
43
  }
41
44
  }
@@ -0,0 +1,32 @@
1
+ export class WWWArticle {
2
+ readonly www_article_id : string
3
+ readonly url : string
4
+ readonly title : string
5
+ readonly publish_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.publish_date = www_article.publish_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
+ typeof www_article.publish_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 publish_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.publish_date = www_article_tag.publish_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
+ typeof www_article_tag.publish_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
+ }