triangle-types 1.0.257 → 1.0.259

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.
@@ -6,9 +6,10 @@ export * from "./types/ballotpedia/BallotpediaPerson.js";
6
6
  export * from "./types/twitter/TwitterTweet.js";
7
7
  export * from "./types/twitter/TwitterUser.js";
8
8
  export * from "./types/twitter/TwitterUserTag.js";
9
- export * from "./types/web/WebArticle.js";
10
- export * from "./types/web/WebArticleFragment.js";
11
- export * from "./types/web/WebArticleTag.js";
9
+ export * from "./types/web/WebDocument.js";
10
+ export * from "./types/web/WebDocumentFragment.js";
11
+ export * from "./types/web/WebDocumentTag.js";
12
+ export * from "./types/web/WebDomain.js";
12
13
  export * from "./types/youtube/YoutubeChannel.js";
13
14
  export * from "./types/youtube/YoutubeVideo.js";
14
15
  export * from "./types/youtube/YoutubeVideoTag.js";
package/dist/src/index.js CHANGED
@@ -6,9 +6,10 @@ export * from "./types/ballotpedia/BallotpediaPerson.js";
6
6
  export * from "./types/twitter/TwitterTweet.js";
7
7
  export * from "./types/twitter/TwitterUser.js";
8
8
  export * from "./types/twitter/TwitterUserTag.js";
9
- export * from "./types/web/WebArticle.js";
10
- export * from "./types/web/WebArticleFragment.js";
11
- export * from "./types/web/WebArticleTag.js";
9
+ export * from "./types/web/WebDocument.js";
10
+ export * from "./types/web/WebDocumentFragment.js";
11
+ export * from "./types/web/WebDocumentTag.js";
12
+ export * from "./types/web/WebDomain.js";
12
13
  export * from "./types/youtube/YoutubeChannel.js";
13
14
  export * from "./types/youtube/YoutubeVideo.js";
14
15
  export * from "./types/youtube/YoutubeVideoTag.js";
@@ -1,12 +1,12 @@
1
1
  import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
2
2
  import { LegistarDocument } from "../legistar/LegistarDocument.js";
3
- import { WebArticleTag } from "../web/WebArticleTag.js";
3
+ import { WebDocumentTag } from "../web/WebDocumentTag.js";
4
4
  import { ScoutDocument } from "../scout/ScoutDocument.js";
5
5
  import { TwitterTweet } from "../twitter/TwitterTweet.js";
6
6
  declare const fragment_type_ids: readonly ["LINE", "CHAR"];
7
7
  export type FragmentTypeID = typeof fragment_type_ids[number];
8
8
  export declare function is_fragment_type_id(fragment_type_id: any): fragment_type_id is FragmentTypeID;
9
- declare const document_type_ids: readonly ["federal_congress_bill_document", "legistar_document", "web_article_tag", "scout_document", "twitter_tweet"];
9
+ declare const document_type_ids: readonly ["federal_congress_bill_document", "legistar_document", "web_document_tag", "scout_document", "twitter_tweet"];
10
10
  export type DocumentTypeID = typeof document_type_ids[number];
11
11
  export declare function is_document_type_id(document_type_id: any): document_type_id is DocumentTypeID;
12
12
  export declare class Fragment {
@@ -25,7 +25,7 @@ export declare class Fragment {
25
25
  export declare class FragmentAux extends Fragment {
26
26
  readonly federal_congress_bill_document?: FederalCongressBillDocument;
27
27
  readonly legistar_document?: LegistarDocument;
28
- readonly web_article_tag?: WebArticleTag;
28
+ readonly web_document_tag?: WebDocumentTag;
29
29
  readonly scout_document?: ScoutDocument;
30
30
  readonly twitter_tweet?: TwitterTweet;
31
31
  constructor(fragment: FragmentAux);
@@ -43,12 +43,12 @@ export declare class LegistarDocumentFragment extends Fragment {
43
43
  constructor(fragment: LegistarDocumentFragment);
44
44
  static is(fragment: any): fragment is LegistarDocumentFragment;
45
45
  }
46
- export declare class WebArticleTagFragment extends Fragment {
47
- readonly document_type_id: "web_article_tag";
48
- readonly web_article_id: string;
46
+ export declare class WebDocumentTagFragment extends Fragment {
47
+ readonly document_type_id: "web_document_tag";
48
+ readonly web_document_id: string;
49
49
  readonly tag_id: string;
50
- constructor(fragment: WebArticleTagFragment);
51
- static is(fragment: any): fragment is WebArticleTagFragment;
50
+ constructor(fragment: WebDocumentTagFragment);
51
+ static is(fragment: any): fragment is WebDocumentTagFragment;
52
52
  }
53
53
  export declare class ScoutDocumentFragment extends Fragment {
54
54
  readonly document_type_id: "scout_document";
@@ -1,13 +1,13 @@
1
1
  import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
2
2
  import { LegistarDocument } from "../legistar/LegistarDocument.js";
3
- import { WebArticleTag } from "../web/WebArticleTag.js";
3
+ import { WebDocumentTag } from "../web/WebDocumentTag.js";
4
4
  import { ScoutDocument } from "../scout/ScoutDocument.js";
5
5
  import { TwitterTweet } from "../twitter/TwitterTweet.js";
6
6
  const fragment_type_ids = ["LINE", "CHAR"];
7
7
  export function is_fragment_type_id(fragment_type_id) {
8
8
  return fragment_type_ids.includes(fragment_type_id);
9
9
  }
10
- const document_type_ids = ["federal_congress_bill_document", "legistar_document", "web_article_tag", "scout_document", "twitter_tweet"];
10
+ const document_type_ids = ["federal_congress_bill_document", "legistar_document", "web_document_tag", "scout_document", "twitter_tweet"];
11
11
  export function is_document_type_id(document_type_id) {
12
12
  return document_type_ids.includes(document_type_id);
13
13
  }
@@ -48,7 +48,7 @@ export class Fragment {
48
48
  export class FragmentAux extends Fragment {
49
49
  federal_congress_bill_document;
50
50
  legistar_document;
51
- web_article_tag;
51
+ web_document_tag;
52
52
  scout_document;
53
53
  twitter_tweet;
54
54
  constructor(fragment) {
@@ -58,7 +58,7 @@ export class FragmentAux extends Fragment {
58
58
  super(fragment);
59
59
  this.federal_congress_bill_document = fragment.federal_congress_bill_document;
60
60
  this.legistar_document = fragment.legistar_document;
61
- this.web_article_tag = fragment.web_article_tag;
61
+ this.web_document_tag = fragment.web_document_tag;
62
62
  this.scout_document = fragment.scout_document;
63
63
  this.twitter_tweet = fragment.twitter_tweet;
64
64
  }
@@ -66,7 +66,7 @@ export class FragmentAux extends Fragment {
66
66
  return (Fragment.is(fragment) &&
67
67
  (fragment.federal_congress_bill_document === undefined || FederalCongressBillDocument.is(fragment.federal_congress_bill_document)) &&
68
68
  (fragment.legistar_document === undefined || LegistarDocument.is(fragment.legistar_document)) &&
69
- (fragment.web_article_tag === undefined || WebArticleTag.is(fragment.web_article_tag)) &&
69
+ (fragment.web_document_tag === undefined || WebDocumentTag.is(fragment.web_document_tag)) &&
70
70
  (fragment.scout_document === undefined || ScoutDocument.is(fragment.scout_document)) &&
71
71
  (fragment.twitter_tweet === undefined || TwitterTweet.is(fragment.twitter_tweet)));
72
72
  }
@@ -105,36 +105,36 @@ export class LegistarDocumentFragment extends Fragment {
105
105
  typeof fragment.legistar_document_id === "string");
106
106
  }
107
107
  }
108
- export class WebArticleTagFragment extends Fragment {
108
+ export class WebDocumentTagFragment extends Fragment {
109
109
  document_type_id;
110
- web_article_id;
110
+ web_document_id;
111
111
  tag_id;
112
112
  constructor(fragment) {
113
- if (!WebArticleTagFragment.is(fragment)) {
113
+ if (!WebDocumentTagFragment.is(fragment)) {
114
114
  throw Error("Invalid input.");
115
115
  }
116
116
  super(fragment);
117
117
  this.document_type_id = fragment.document_type_id;
118
- this.web_article_id = fragment.web_article_id;
118
+ this.web_document_id = fragment.web_document_id;
119
119
  this.tag_id = fragment.tag_id;
120
120
  }
121
121
  static is(fragment) {
122
122
  return (Fragment.is(fragment) &&
123
- fragment.document_type_id === "web_article_tag" &&
124
- typeof fragment.web_article_id === "string" &&
123
+ fragment.document_type_id === "web_document_tag" &&
124
+ typeof fragment.web_document_id === "string" &&
125
125
  typeof fragment.tag_id === "string");
126
126
  }
127
127
  }
128
- // export class WebArticleTagFragmentAux extends WebArticleTagFragment {
129
- // readonly web_article_ : WebArticleTagAux
130
- // constructor(fragment : WebArticleTagFragmentAux) {
131
- // if (!WebArticleTagFragmentAux.is(fragment)) {
128
+ // export class WebDocumentTagFragmentAux extends WebDocumentTagFragment {
129
+ // readonly web_document_ : WebDocumentTagAux
130
+ // constructor(fragment : WebDocumentTagFragmentAux) {
131
+ // if (!WebDocumentTagFragmentAux.is(fragment)) {
132
132
  // throw Error("Invalid input.")
133
133
  // }
134
134
  // super(fragment)
135
135
  // this.scout_document = fragment.scout_document
136
136
  // }
137
- // static is(fragment : any) : fragment is WebArticleTagFragmentAux {
137
+ // static is(fragment : any) : fragment is WebDocumentTagFragmentAux {
138
138
  // return (
139
139
  // Fragment.is(fragment) &&
140
140
  // ScoutDocument.is(fragment.scout_document)
@@ -4,7 +4,7 @@ export class Scout {
4
4
  scout_id;
5
5
  name;
6
6
  ballotpedia_person_id;
7
- // readonly wikipedia_article_id? : string
7
+ // readonly wikipedia_document_id? : string
8
8
  s3_id_img;
9
9
  constructor(scout) {
10
10
  if (!Scout.is(scout)) {
@@ -13,7 +13,7 @@ export class Scout {
13
13
  this.scout_id = scout.scout_id;
14
14
  this.name = scout.name;
15
15
  this.ballotpedia_person_id = scout.ballotpedia_person_id;
16
- // this.wikipedia_article_id = scout.wikipedia_article_id
16
+ // this.wikipedia_document_id = scout.wikipedia_document_id
17
17
  this.s3_id_img = scout.s3_id_img;
18
18
  }
19
19
  static is(scout) {
@@ -21,7 +21,7 @@ export class Scout {
21
21
  typeof scout.scout_id === "string" &&
22
22
  typeof scout.name === "string" &&
23
23
  typeof scout.ballotpedia_person_id === "number" &&
24
- // (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
24
+ // (scout.wikipedia_document_id === undefined || typeof scout.wikipedia_document_id === "string") &&
25
25
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string"));
26
26
  }
27
27
  }
@@ -0,0 +1,13 @@
1
+ export declare class WebDocument {
2
+ readonly web_document_id: string;
3
+ readonly web_domain_id: string;
4
+ readonly url: string;
5
+ readonly title: string;
6
+ readonly description: string;
7
+ readonly time: string;
8
+ readonly snippets: string[];
9
+ readonly s3_id_html?: string;
10
+ readonly s3_id_txt?: string;
11
+ constructor(web_document: WebDocument);
12
+ static is(web_document: any): web_document is WebDocument;
13
+ }
@@ -0,0 +1,37 @@
1
+ export class WebDocument {
2
+ web_document_id;
3
+ web_domain_id;
4
+ url;
5
+ title;
6
+ description;
7
+ time;
8
+ snippets;
9
+ s3_id_html;
10
+ s3_id_txt;
11
+ constructor(web_document) {
12
+ if (!WebDocument.is(web_document)) {
13
+ throw Error("Invalid input.");
14
+ }
15
+ this.web_document_id = web_document.web_document_id;
16
+ this.web_domain_id = web_document.web_domain_id;
17
+ this.url = web_document.url;
18
+ this.title = web_document.title;
19
+ this.description = web_document.description;
20
+ this.time = web_document.time;
21
+ this.snippets = web_document.snippets;
22
+ this.s3_id_html = web_document.s3_id_html;
23
+ this.s3_id_txt = web_document.s3_id_txt;
24
+ }
25
+ static is(web_document) {
26
+ return (web_document !== undefined &&
27
+ typeof web_document.web_document_id === "string" &&
28
+ typeof web_document.web_domain_id === "string" &&
29
+ typeof web_document.url === "string" &&
30
+ typeof web_document.title === "string" &&
31
+ typeof web_document.description === "string" &&
32
+ typeof web_document.time === "string" &&
33
+ Array.isArray(web_document.snippets) && web_document.snippets.every((snippet) => typeof snippet === "string") &&
34
+ (web_document.s3_id_html === undefined || typeof web_document.s3_id_html === "string") &&
35
+ (web_document.s3_id_txt === undefined || typeof web_document.s3_id_txt === "string"));
36
+ }
37
+ }
@@ -0,0 +1,15 @@
1
+ import { FragmentTypeID } from "../fragments/Fragment.js";
2
+ export declare class WebDocumentFragment {
3
+ readonly web_document_id: string;
4
+ readonly fragment_id: string;
5
+ readonly fragment_type_id: FragmentTypeID;
6
+ readonly max_size: number;
7
+ readonly min_index: number;
8
+ readonly max_index: number;
9
+ readonly title: string;
10
+ readonly text: string;
11
+ readonly vector?: number[];
12
+ readonly [x: string]: any;
13
+ constructor(web_document_fragment: WebDocumentFragment);
14
+ static is(web_document_fragment: any): web_document_fragment is WebDocumentFragment;
15
+ }
@@ -0,0 +1,38 @@
1
+ import { is_fragment_type_id } from "../fragments/Fragment.js";
2
+ export class WebDocumentFragment {
3
+ web_document_id;
4
+ fragment_id;
5
+ fragment_type_id;
6
+ max_size;
7
+ min_index;
8
+ max_index;
9
+ title;
10
+ text;
11
+ vector;
12
+ constructor(web_document_fragment) {
13
+ if (!WebDocumentFragment.is(web_document_fragment)) {
14
+ throw Error("Invalid input.");
15
+ }
16
+ this.web_document_id = web_document_fragment.web_document_id;
17
+ this.fragment_id = web_document_fragment.fragment_id;
18
+ this.fragment_type_id = web_document_fragment.fragment_type_id;
19
+ this.max_size = web_document_fragment.max_size;
20
+ this.min_index = web_document_fragment.min_index;
21
+ this.max_index = web_document_fragment.max_index;
22
+ this.title = web_document_fragment.title;
23
+ this.text = web_document_fragment.text;
24
+ this.vector = web_document_fragment.vector;
25
+ }
26
+ static is(web_document_fragment) {
27
+ return (web_document_fragment !== undefined &&
28
+ typeof web_document_fragment.web_document_id === "string" &&
29
+ typeof web_document_fragment.fragment_id === "string" &&
30
+ is_fragment_type_id(web_document_fragment.fragment_type_id) &&
31
+ typeof web_document_fragment.max_size === "number" &&
32
+ typeof web_document_fragment.min_index === "number" &&
33
+ typeof web_document_fragment.max_index === "number" &&
34
+ typeof web_document_fragment.title === "string" &&
35
+ typeof web_document_fragment.text === "string" &&
36
+ (web_document_fragment.vector === undefined || Array.isArray(web_document_fragment.vector) && web_document_fragment.vector.every((coordinate) => typeof coordinate === "number")));
37
+ }
38
+ }
@@ -0,0 +1,16 @@
1
+ import { WebDocument } from "./WebDocument.js";
2
+ export declare class WebDocumentTag {
3
+ readonly web_document_id: string;
4
+ readonly tag_id: string;
5
+ readonly time: string;
6
+ readonly is_relevant?: boolean;
7
+ readonly sentiment_id?: string;
8
+ readonly [x: string]: any;
9
+ constructor(web_document_tag: WebDocumentTag);
10
+ static is(web_document_tag: any): web_document_tag is WebDocumentTag;
11
+ }
12
+ export declare class WebDocumentTagAux extends WebDocumentTag {
13
+ readonly web_document: WebDocument;
14
+ constructor(web_document_tag: any);
15
+ static is(web_document_tag: any): web_document_tag is WebDocumentTagAux;
16
+ }
@@ -0,0 +1,40 @@
1
+ import { WebDocument } from "./WebDocument.js";
2
+ export class WebDocumentTag {
3
+ web_document_id;
4
+ tag_id;
5
+ time;
6
+ is_relevant;
7
+ sentiment_id;
8
+ constructor(web_document_tag) {
9
+ if (!WebDocumentTag.is(web_document_tag)) {
10
+ throw Error("Invalid input.");
11
+ }
12
+ this.web_document_id = web_document_tag.web_document_id;
13
+ this.tag_id = web_document_tag.tag_id;
14
+ this.time = web_document_tag.time;
15
+ this.is_relevant = web_document_tag.is_relevant;
16
+ this.sentiment_id = web_document_tag.sentiment_id;
17
+ }
18
+ static is(web_document_tag) {
19
+ return (web_document_tag !== undefined &&
20
+ typeof web_document_tag.web_document_id === "string" &&
21
+ typeof web_document_tag.tag_id === "string" &&
22
+ typeof web_document_tag.time === "string" &&
23
+ (web_document_tag.is_relevant === undefined || typeof web_document_tag.is_relevant === "boolean") &&
24
+ (web_document_tag.sentiment_id === undefined || typeof web_document_tag.sentiment_id === "string"));
25
+ }
26
+ }
27
+ export class WebDocumentTagAux extends WebDocumentTag {
28
+ web_document;
29
+ constructor(web_document_tag) {
30
+ if (!WebDocumentTagAux.is(web_document_tag)) {
31
+ throw Error("Invalid input.");
32
+ }
33
+ super(web_document_tag);
34
+ this.web_document = web_document_tag.web_document;
35
+ }
36
+ static is(web_document_tag) {
37
+ return (WebDocumentTag.is(web_document_tag) &&
38
+ WebDocument.is(web_document_tag.web_document));
39
+ }
40
+ }
@@ -0,0 +1,6 @@
1
+ export declare class WebDomain {
2
+ readonly web_domain_id: string;
3
+ readonly name: string;
4
+ constructor(web_domain: WebDomain);
5
+ static is(web_domain: any): web_domain is WebDomain;
6
+ }
@@ -0,0 +1,16 @@
1
+ export class WebDomain {
2
+ web_domain_id;
3
+ name;
4
+ constructor(web_domain) {
5
+ if (!WebDomain.is(web_domain)) {
6
+ throw Error("Invalid input.");
7
+ }
8
+ this.web_domain_id = web_domain.web_domain_id;
9
+ this.name = web_domain.name;
10
+ }
11
+ static is(web_domain) {
12
+ return (web_domain !== undefined &&
13
+ typeof web_domain.web_domain_id === "string" &&
14
+ typeof web_domain.name === "string");
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.257",
3
+ "version": "1.0.259",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -9,9 +9,10 @@ export * from "./types/ballotpedia/BallotpediaPerson"
9
9
  export * from "./types/twitter/TwitterTweet"
10
10
  export * from "./types/twitter/TwitterUser"
11
11
  export * from "./types/twitter/TwitterUserTag"
12
- export * from "./types/web/WebArticle"
13
- export * from "./types/web/WebArticleFragment"
14
- export * from "./types/web/WebArticleTag"
12
+ export * from "./types/web/WebDocument"
13
+ export * from "./types/web/WebDocumentFragment"
14
+ export * from "./types/web/WebDocumentTag"
15
+ export * from "./types/web/WebDomain"
15
16
  export * from "./types/youtube/YoutubeChannel"
16
17
  export * from "./types/youtube/YoutubeVideo"
17
18
  export * from "./types/youtube/YoutubeVideoTag"
@@ -1,6 +1,6 @@
1
1
  import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument"
2
2
  import { LegistarDocument } from "../legistar/LegistarDocument"
3
- import { WebArticleTag } from "../web/WebArticleTag"
3
+ import { WebDocumentTag } from "../web/WebDocumentTag"
4
4
  import { ScoutDocument } from "../scout/ScoutDocument"
5
5
  import { TwitterTweet } from "../twitter/TwitterTweet"
6
6
 
@@ -12,7 +12,7 @@ export function is_fragment_type_id(fragment_type_id : any) : fragment_type_id i
12
12
  return fragment_type_ids.includes(fragment_type_id)
13
13
  }
14
14
 
15
- const document_type_ids = ["federal_congress_bill_document", "legistar_document", "web_article_tag", "scout_document", "twitter_tweet"] as const
15
+ const document_type_ids = ["federal_congress_bill_document", "legistar_document", "web_document_tag", "scout_document", "twitter_tweet"] as const
16
16
 
17
17
  export type DocumentTypeID = typeof document_type_ids[number]
18
18
 
@@ -63,7 +63,7 @@ export class Fragment {
63
63
  export class FragmentAux extends Fragment {
64
64
  readonly federal_congress_bill_document? : FederalCongressBillDocument
65
65
  readonly legistar_document? : LegistarDocument
66
- readonly web_article_tag? : WebArticleTag
66
+ readonly web_document_tag? : WebDocumentTag
67
67
  readonly scout_document? : ScoutDocument
68
68
  readonly twitter_tweet? : TwitterTweet
69
69
 
@@ -74,7 +74,7 @@ export class FragmentAux extends Fragment {
74
74
  super(fragment)
75
75
  this.federal_congress_bill_document = fragment.federal_congress_bill_document
76
76
  this.legistar_document = fragment.legistar_document
77
- this.web_article_tag = fragment.web_article_tag
77
+ this.web_document_tag = fragment.web_document_tag
78
78
  this.scout_document = fragment.scout_document
79
79
  this.twitter_tweet = fragment.twitter_tweet
80
80
  }
@@ -84,7 +84,7 @@ export class FragmentAux extends Fragment {
84
84
  Fragment.is(fragment) &&
85
85
  (fragment.federal_congress_bill_document === undefined || FederalCongressBillDocument.is(fragment.federal_congress_bill_document)) &&
86
86
  (fragment.legistar_document === undefined || LegistarDocument.is(fragment.legistar_document)) &&
87
- (fragment.web_article_tag === undefined || WebArticleTag.is(fragment.web_article_tag)) &&
87
+ (fragment.web_document_tag === undefined || WebDocumentTag.is(fragment.web_document_tag)) &&
88
88
  (fragment.scout_document === undefined || ScoutDocument.is(fragment.scout_document)) &&
89
89
  (fragment.twitter_tweet === undefined || TwitterTweet.is(fragment.twitter_tweet))
90
90
  )
@@ -135,43 +135,43 @@ export class LegistarDocumentFragment extends Fragment {
135
135
  }
136
136
  }
137
137
 
138
- export class WebArticleTagFragment extends Fragment {
139
- readonly document_type_id : "web_article_tag"
140
- readonly web_article_id : string
138
+ export class WebDocumentTagFragment extends Fragment {
139
+ readonly document_type_id : "web_document_tag"
140
+ readonly web_document_id : string
141
141
  readonly tag_id : string
142
142
 
143
- constructor(fragment : WebArticleTagFragment) {
144
- if (!WebArticleTagFragment.is(fragment)) {
143
+ constructor(fragment : WebDocumentTagFragment) {
144
+ if (!WebDocumentTagFragment.is(fragment)) {
145
145
  throw Error("Invalid input.")
146
146
  }
147
147
  super(fragment)
148
148
  this.document_type_id = fragment.document_type_id
149
- this.web_article_id = fragment.web_article_id
149
+ this.web_document_id = fragment.web_document_id
150
150
  this.tag_id = fragment.tag_id
151
151
  }
152
152
 
153
- static is(fragment : any) : fragment is WebArticleTagFragment {
153
+ static is(fragment : any) : fragment is WebDocumentTagFragment {
154
154
  return (
155
155
  Fragment.is(fragment) &&
156
- fragment.document_type_id === "web_article_tag" &&
157
- typeof fragment.web_article_id === "string" &&
156
+ fragment.document_type_id === "web_document_tag" &&
157
+ typeof fragment.web_document_id === "string" &&
158
158
  typeof fragment.tag_id === "string"
159
159
  )
160
160
  }
161
161
  }
162
162
 
163
- // export class WebArticleTagFragmentAux extends WebArticleTagFragment {
164
- // readonly web_article_ : WebArticleTagAux
163
+ // export class WebDocumentTagFragmentAux extends WebDocumentTagFragment {
164
+ // readonly web_document_ : WebDocumentTagAux
165
165
 
166
- // constructor(fragment : WebArticleTagFragmentAux) {
167
- // if (!WebArticleTagFragmentAux.is(fragment)) {
166
+ // constructor(fragment : WebDocumentTagFragmentAux) {
167
+ // if (!WebDocumentTagFragmentAux.is(fragment)) {
168
168
  // throw Error("Invalid input.")
169
169
  // }
170
170
  // super(fragment)
171
171
  // this.scout_document = fragment.scout_document
172
172
  // }
173
173
 
174
- // static is(fragment : any) : fragment is WebArticleTagFragmentAux {
174
+ // static is(fragment : any) : fragment is WebDocumentTagFragmentAux {
175
175
  // return (
176
176
  // Fragment.is(fragment) &&
177
177
  // ScoutDocument.is(fragment.scout_document)
@@ -5,7 +5,7 @@ export class Scout {
5
5
  readonly scout_id : string
6
6
  readonly name : string
7
7
  readonly ballotpedia_person_id : number
8
- // readonly wikipedia_article_id? : string
8
+ // readonly wikipedia_document_id? : string
9
9
  readonly s3_id_img? : string
10
10
  readonly [x : string] : any
11
11
 
@@ -16,7 +16,7 @@ export class Scout {
16
16
  this.scout_id = scout.scout_id
17
17
  this.name = scout.name
18
18
  this.ballotpedia_person_id = scout.ballotpedia_person_id
19
- // this.wikipedia_article_id = scout.wikipedia_article_id
19
+ // this.wikipedia_document_id = scout.wikipedia_document_id
20
20
  this.s3_id_img = scout.s3_id_img
21
21
  }
22
22
 
@@ -26,7 +26,7 @@ export class Scout {
26
26
  typeof scout.scout_id === "string" &&
27
27
  typeof scout.name === "string" &&
28
28
  typeof scout.ballotpedia_person_id === "number" &&
29
- // (scout.wikipedia_article_id === undefined || typeof scout.wikipedia_article_id === "string") &&
29
+ // (scout.wikipedia_document_id === undefined || typeof scout.wikipedia_document_id === "string") &&
30
30
  (scout.s3_id_img === undefined || typeof scout.s3_id_img === "string")
31
31
  )
32
32
  }
@@ -0,0 +1,41 @@
1
+ export class WebDocument {
2
+ readonly web_document_id : string
3
+ readonly web_domain_id : string
4
+ readonly url : string
5
+ readonly title : string
6
+ readonly description : string
7
+ readonly time : string
8
+ readonly snippets : string[]
9
+ readonly s3_id_html? : string
10
+ readonly s3_id_txt? : string
11
+
12
+ constructor(web_document : WebDocument) {
13
+ if (!WebDocument.is(web_document)) {
14
+ throw Error("Invalid input.")
15
+ }
16
+ this.web_document_id = web_document.web_document_id
17
+ this.web_domain_id = web_document.web_domain_id
18
+ this.url = web_document.url
19
+ this.title = web_document.title
20
+ this.description = web_document.description
21
+ this.time = web_document.time
22
+ this.snippets = web_document.snippets
23
+ this.s3_id_html = web_document.s3_id_html
24
+ this.s3_id_txt = web_document.s3_id_txt
25
+ }
26
+
27
+ static is(web_document : any) : web_document is WebDocument {
28
+ return (
29
+ web_document !== undefined &&
30
+ typeof web_document.web_document_id === "string" &&
31
+ typeof web_document.web_domain_id === "string" &&
32
+ typeof web_document.url === "string" &&
33
+ typeof web_document.title === "string" &&
34
+ typeof web_document.description === "string" &&
35
+ typeof web_document.time === "string" &&
36
+ Array.isArray(web_document.snippets) && web_document.snippets.every((snippet : any) => typeof snippet === "string") &&
37
+ (web_document.s3_id_html === undefined || typeof web_document.s3_id_html === "string") &&
38
+ (web_document.s3_id_txt === undefined || typeof web_document.s3_id_txt === "string")
39
+ )
40
+ }
41
+ }
@@ -0,0 +1,44 @@
1
+ import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
2
+
3
+ export class WebDocumentFragment {
4
+ readonly web_document_id : string
5
+ readonly fragment_id : string
6
+ readonly fragment_type_id : FragmentTypeID
7
+ readonly max_size : number
8
+ readonly min_index : number
9
+ readonly max_index : number
10
+ readonly title : string
11
+ readonly text : string
12
+ readonly vector? : number[]
13
+ readonly [x : string] : any
14
+
15
+ constructor(web_document_fragment : WebDocumentFragment) {
16
+ if (!WebDocumentFragment.is(web_document_fragment)) {
17
+ throw Error("Invalid input.")
18
+ }
19
+ this.web_document_id = web_document_fragment.web_document_id
20
+ this.fragment_id = web_document_fragment.fragment_id
21
+ this.fragment_type_id = web_document_fragment.fragment_type_id
22
+ this.max_size = web_document_fragment.max_size
23
+ this.min_index = web_document_fragment.min_index
24
+ this.max_index = web_document_fragment.max_index
25
+ this.title = web_document_fragment.title
26
+ this.text = web_document_fragment.text
27
+ this.vector = web_document_fragment.vector
28
+ }
29
+
30
+ static is(web_document_fragment : any) : web_document_fragment is WebDocumentFragment {
31
+ return (
32
+ web_document_fragment !== undefined &&
33
+ typeof web_document_fragment.web_document_id === "string" &&
34
+ typeof web_document_fragment.fragment_id === "string" &&
35
+ is_fragment_type_id(web_document_fragment.fragment_type_id) &&
36
+ typeof web_document_fragment.max_size === "number" &&
37
+ typeof web_document_fragment.min_index === "number" &&
38
+ typeof web_document_fragment.max_index === "number" &&
39
+ typeof web_document_fragment.title === "string" &&
40
+ typeof web_document_fragment.text === "string" &&
41
+ (web_document_fragment.vector === undefined || Array.isArray(web_document_fragment.vector) && web_document_fragment.vector.every((coordinate : any) => typeof coordinate === "number"))
42
+ )
43
+ }
44
+ }
@@ -0,0 +1,51 @@
1
+ import { WebDocument } from "./WebDocument"
2
+
3
+ export class WebDocumentTag {
4
+ readonly web_document_id : string
5
+ readonly tag_id : string
6
+ readonly time : string
7
+ readonly is_relevant? : boolean
8
+ readonly sentiment_id? : string
9
+ readonly [x : string] : any
10
+
11
+ constructor(web_document_tag : WebDocumentTag) {
12
+ if (!WebDocumentTag.is(web_document_tag)) {
13
+ throw Error("Invalid input.")
14
+ }
15
+ this.web_document_id = web_document_tag.web_document_id
16
+ this.tag_id = web_document_tag.tag_id
17
+ this.time = web_document_tag.time
18
+ this.is_relevant = web_document_tag.is_relevant
19
+ this.sentiment_id = web_document_tag.sentiment_id
20
+ }
21
+
22
+ static is(web_document_tag : any) : web_document_tag is WebDocumentTag {
23
+ return (
24
+ web_document_tag !== undefined &&
25
+ typeof web_document_tag.web_document_id === "string" &&
26
+ typeof web_document_tag.tag_id === "string" &&
27
+ typeof web_document_tag.time === "string" &&
28
+ (web_document_tag.is_relevant === undefined || typeof web_document_tag.is_relevant === "boolean") &&
29
+ (web_document_tag.sentiment_id === undefined || typeof web_document_tag.sentiment_id === "string")
30
+ )
31
+ }
32
+ }
33
+
34
+ export class WebDocumentTagAux extends WebDocumentTag {
35
+ readonly web_document : WebDocument
36
+
37
+ constructor(web_document_tag : any) {
38
+ if (!WebDocumentTagAux.is(web_document_tag)) {
39
+ throw Error("Invalid input.")
40
+ }
41
+ super(web_document_tag)
42
+ this.web_document = web_document_tag.web_document
43
+ }
44
+
45
+ static is(web_document_tag : any) : web_document_tag is WebDocumentTagAux {
46
+ return (
47
+ WebDocumentTag.is(web_document_tag) &&
48
+ WebDocument.is(web_document_tag.web_document)
49
+ )
50
+ }
51
+ }
@@ -0,0 +1,20 @@
1
+ export class WebDomain {
2
+ readonly web_domain_id : string
3
+ readonly name : string
4
+
5
+ constructor(web_domain : WebDomain) {
6
+ if (!WebDomain.is(web_domain)) {
7
+ throw Error("Invalid input.")
8
+ }
9
+ this.web_domain_id = web_domain.web_domain_id
10
+ this.name = web_domain.name
11
+ }
12
+
13
+ static is(web_domain : any) : web_domain is WebDomain {
14
+ return (
15
+ web_domain !== undefined &&
16
+ typeof web_domain.web_domain_id === "string" &&
17
+ typeof web_domain.name === "string"
18
+ )
19
+ }
20
+ }
@@ -1,35 +0,0 @@
1
- export class WebArticle {
2
- readonly web_article_id : string
3
- readonly url : string
4
- readonly domain : string
5
- readonly title : string
6
- readonly date : string
7
- readonly s3_id_html? : string
8
- readonly s3_id_txt? : string
9
-
10
- constructor(web_article : WebArticle) {
11
- if (!WebArticle.is(web_article)) {
12
- throw Error("Invalid input.")
13
- }
14
- this.web_article_id = web_article.web_article_id
15
- this.url = web_article.url
16
- this.domain = web_article.domain
17
- this.title = web_article.title
18
- this.date = web_article.date
19
- this.s3_id_html = web_article.s3_id_html
20
- this.s3_id_txt = web_article.s3_id_txt
21
- }
22
-
23
- static is(web_article : any) : web_article is WebArticle {
24
- return (
25
- web_article !== undefined &&
26
- typeof web_article.web_article_id === "string" &&
27
- typeof web_article.url === "string" &&
28
- typeof web_article.domain === "string" &&
29
- typeof web_article.title === "string" &&
30
- typeof web_article.date === "string" &&
31
- (web_article.s3_id_html === undefined || typeof web_article.s3_id_html === "string") &&
32
- (web_article.s3_id_txt === undefined || typeof web_article.s3_id_txt === "string")
33
- )
34
- }
35
- }
@@ -1,44 +0,0 @@
1
- import { FragmentTypeID, is_fragment_type_id } from "../fragments/Fragment"
2
-
3
- export class WebArticleFragment {
4
- readonly web_article_id : string
5
- readonly fragment_id : string
6
- readonly fragment_type_id : FragmentTypeID
7
- readonly max_size : number
8
- readonly min_index : number
9
- readonly max_index : number
10
- readonly title : string
11
- readonly text : string
12
- readonly vector? : number[]
13
- readonly [x : string] : any
14
-
15
- constructor(web_article_fragment : WebArticleFragment) {
16
- if (!WebArticleFragment.is(web_article_fragment)) {
17
- throw Error("Invalid input.")
18
- }
19
- this.web_article_id = web_article_fragment.web_article_id
20
- this.fragment_id = web_article_fragment.fragment_id
21
- this.fragment_type_id = web_article_fragment.fragment_type_id
22
- this.max_size = web_article_fragment.max_size
23
- this.min_index = web_article_fragment.min_index
24
- this.max_index = web_article_fragment.max_index
25
- this.title = web_article_fragment.title
26
- this.text = web_article_fragment.text
27
- this.vector = web_article_fragment.vector
28
- }
29
-
30
- static is(web_article_fragment : any) : web_article_fragment is WebArticleFragment {
31
- return (
32
- web_article_fragment !== undefined &&
33
- typeof web_article_fragment.web_article_id === "string" &&
34
- typeof web_article_fragment.fragment_id === "string" &&
35
- is_fragment_type_id(web_article_fragment.fragment_type_id) &&
36
- typeof web_article_fragment.max_size === "number" &&
37
- typeof web_article_fragment.min_index === "number" &&
38
- typeof web_article_fragment.max_index === "number" &&
39
- typeof web_article_fragment.title === "string" &&
40
- typeof web_article_fragment.text === "string" &&
41
- (web_article_fragment.vector === undefined || Array.isArray(web_article_fragment.vector) && web_article_fragment.vector.every((coordinate : any) => typeof coordinate === "number"))
42
- )
43
- }
44
- }
@@ -1,51 +0,0 @@
1
- import { WebArticle } from "./WebArticle"
2
-
3
- export class WebArticleTag {
4
- readonly web_article_id : string
5
- readonly tag_id : string
6
- readonly date : string
7
- readonly is_relevant? : boolean
8
- readonly sentiment_id? : string
9
- readonly [x : string] : any
10
-
11
- constructor(web_article_tag : WebArticleTag) {
12
- if (!WebArticleTag.is(web_article_tag)) {
13
- throw Error("Invalid input.")
14
- }
15
- this.web_article_id = web_article_tag.web_article_id
16
- this.tag_id = web_article_tag.tag_id
17
- this.date = web_article_tag.date
18
- this.is_relevant = web_article_tag.is_relevant
19
- this.sentiment_id = web_article_tag.sentiment_id
20
- }
21
-
22
- static is(web_article_tag : any) : web_article_tag is WebArticleTag {
23
- return (
24
- web_article_tag !== undefined &&
25
- typeof web_article_tag.web_article_id === "string" &&
26
- typeof web_article_tag.tag_id === "string" &&
27
- typeof web_article_tag.date === "string" &&
28
- (web_article_tag.is_relevant === undefined || typeof web_article_tag.is_relevant === "boolean") &&
29
- (web_article_tag.sentiment_id === undefined || typeof web_article_tag.sentiment_id === "string")
30
- )
31
- }
32
- }
33
-
34
- export class WebArticleTagAux extends WebArticleTag {
35
- readonly web_article : WebArticle
36
-
37
- constructor(web_article_tag : any) {
38
- if (!WebArticleTagAux.is(web_article_tag)) {
39
- throw Error("Invalid input.")
40
- }
41
- super(web_article_tag)
42
- this.web_article = web_article_tag.web_article
43
- }
44
-
45
- static is(web_article_tag : any) : web_article_tag is WebArticleTagAux {
46
- return (
47
- WebArticleTag.is(web_article_tag) &&
48
- WebArticle.is(web_article_tag.web_article)
49
- )
50
- }
51
- }