triangle-types 1.0.38 → 1.0.40

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.
@@ -41,6 +41,8 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
41
41
  export * from "./types/federal_rules/FederalRuleSection.js";
42
42
  export * from "./types/fragments/Fragment.js";
43
43
  export * from "./types/fragments/FragmentVector.js";
44
+ export * from "./types/legistar/LegistarAgency.js";
45
+ export * from "./types/legistar/LegistarDocument.js";
44
46
  export * from "./types/scout/Scout.js";
45
47
  export * from "./types/scout/ScoutDocument.js";
46
48
  export * from "./types/scout/ScoutSubScout.js";
package/dist/src/index.js CHANGED
@@ -41,6 +41,8 @@ export * from "./types/federal_rules/FederalRuleTitle.js";
41
41
  export * from "./types/federal_rules/FederalRuleSection.js";
42
42
  export * from "./types/fragments/Fragment.js";
43
43
  export * from "./types/fragments/FragmentVector.js";
44
+ export * from "./types/legistar/LegistarAgency.js";
45
+ export * from "./types/legistar/LegistarDocument.js";
44
46
  export * from "./types/scout/Scout.js";
45
47
  export * from "./types/scout/ScoutDocument.js";
46
48
  export * from "./types/scout/ScoutSubScout.js";
@@ -1,3 +1,8 @@
1
+ import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
2
+ import { LegistarDocument } from "../legistar/LegistarDocument.js";
3
+ import { PressArticleTag } from "../press/PressArticleTag.js";
4
+ import { ScoutDocument } from "../scout/ScoutDocument.js";
5
+ import { TwitterTweet } from "../twitter/TwitterTweet.js";
1
6
  declare const fragment_type_ids: readonly ["LINE", "CHAR"];
2
7
  export type FragmentTypeID = typeof fragment_type_ids[number];
3
8
  export declare function is_fragment_type_id(fragment_type_id: any): fragment_type_id is FragmentTypeID;
@@ -17,6 +22,15 @@ export declare class Fragment {
17
22
  constructor(fragment: Fragment);
18
23
  static is(fragment: any): fragment is Fragment;
19
24
  }
25
+ export declare class FragmentAux extends Fragment {
26
+ readonly federal_congress_bill_document?: FederalCongressBillDocument;
27
+ readonly legistar_document?: LegistarDocument;
28
+ readonly press_article_tag?: PressArticleTag;
29
+ readonly scout_document?: ScoutDocument;
30
+ readonly twitter_tweet?: TwitterTweet;
31
+ constructor(fragment: FragmentAux);
32
+ static is(fragment: any): fragment is FragmentAux;
33
+ }
20
34
  export declare class FederalCongressBillDocumentFragment extends Fragment {
21
35
  readonly document_type_id: "federal_congress_bill_document";
22
36
  readonly federal_congress_bill_document_id: string;
@@ -42,10 +56,20 @@ export declare class ScoutDocumentFragment extends Fragment {
42
56
  constructor(fragment: ScoutDocumentFragment);
43
57
  static is(fragment: any): fragment is ScoutDocumentFragment;
44
58
  }
59
+ export declare class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
60
+ readonly scout_document: ScoutDocument;
61
+ constructor(fragment: ScoutDocumentFragmentAux);
62
+ static is(fragment: any): fragment is ScoutDocumentFragmentAux;
63
+ }
45
64
  export declare class TwitterTweetFragment extends Fragment {
46
65
  readonly document_type_id: "twitter_tweet";
47
66
  readonly twitter_tweet_id: string;
48
67
  constructor(fragment: TwitterTweetFragment);
49
68
  static is(fragment: any): fragment is TwitterTweetFragment;
50
69
  }
70
+ export declare class TwitterTweetFragmentAux extends TwitterTweetFragment {
71
+ readonly twitter_tweet: TwitterTweet;
72
+ constructor(fragment: TwitterTweetFragmentAux);
73
+ static is(fragment: any): fragment is TwitterTweetFragmentAux;
74
+ }
51
75
  export {};
@@ -1,3 +1,8 @@
1
+ import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
2
+ import { LegistarDocument } from "../legistar/LegistarDocument.js";
3
+ import { PressArticleTag } from "../press/PressArticleTag.js";
4
+ import { ScoutDocument } from "../scout/ScoutDocument.js";
5
+ import { TwitterTweet } from "../twitter/TwitterTweet.js";
1
6
  const fragment_type_ids = ["LINE", "CHAR"];
2
7
  export function is_fragment_type_id(fragment_type_id) {
3
8
  return fragment_type_ids.includes(fragment_type_id);
@@ -40,6 +45,32 @@ export class Fragment {
40
45
  typeof fragment.text === "string");
41
46
  }
42
47
  }
48
+ export class FragmentAux extends Fragment {
49
+ federal_congress_bill_document;
50
+ legistar_document;
51
+ press_article_tag;
52
+ scout_document;
53
+ twitter_tweet;
54
+ constructor(fragment) {
55
+ if (!FragmentAux.is(fragment)) {
56
+ throw Error("Invalid input.");
57
+ }
58
+ super(fragment);
59
+ this.federal_congress_bill_document = fragment.federal_congress_bill_document;
60
+ this.legistar_document = fragment.legistar_document;
61
+ this.press_article_tag = fragment.press_article_tag;
62
+ this.scout_document = fragment.scout_document;
63
+ this.twitter_tweet = fragment.twitter_tweet;
64
+ }
65
+ static is(fragment) {
66
+ return (Fragment.is(fragment) &&
67
+ FederalCongressBillDocument.is(fragment.federal_congress_bill_document) &&
68
+ LegistarDocument.is(fragment.legistar_document) &&
69
+ PressArticleTag.is(fragment.press_article_tag) &&
70
+ ScoutDocument.is(fragment.scout_document) &&
71
+ TwitterTweet.is(fragment.twitter_tweet));
72
+ }
73
+ }
43
74
  export class FederalCongressBillDocumentFragment extends Fragment {
44
75
  document_type_id;
45
76
  federal_congress_bill_document_id;
@@ -94,6 +125,22 @@ export class PressArticleTagFragment extends Fragment {
94
125
  typeof fragment.tag_id === "string");
95
126
  }
96
127
  }
128
+ // export class PressArticleTagFragmentAux extends PressArticleTagFragment {
129
+ // readonly press_article_ : PressArticleTagAux
130
+ // constructor(fragment : PressArticleTagFragmentAux) {
131
+ // if (!PressArticleTagFragmentAux.is(fragment)) {
132
+ // throw Error("Invalid input.")
133
+ // }
134
+ // super(fragment)
135
+ // this.scout_document = fragment.scout_document
136
+ // }
137
+ // static is(fragment : any) : fragment is PressArticleTagFragmentAux {
138
+ // return (
139
+ // Fragment.is(fragment) &&
140
+ // ScoutDocument.is(fragment.scout_document)
141
+ // )
142
+ // }
143
+ // }
97
144
  export class ScoutDocumentFragment extends Fragment {
98
145
  document_type_id;
99
146
  scout_document_id;
@@ -111,6 +158,20 @@ export class ScoutDocumentFragment extends Fragment {
111
158
  typeof fragment.scout_document_id === "string");
112
159
  }
113
160
  }
161
+ export class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
162
+ scout_document;
163
+ constructor(fragment) {
164
+ if (!ScoutDocumentFragmentAux.is(fragment)) {
165
+ throw Error("Invalid input.");
166
+ }
167
+ super(fragment);
168
+ this.scout_document = fragment.scout_document;
169
+ }
170
+ static is(fragment) {
171
+ return (Fragment.is(fragment) &&
172
+ ScoutDocument.is(fragment.scout_document));
173
+ }
174
+ }
114
175
  export class TwitterTweetFragment extends Fragment {
115
176
  document_type_id;
116
177
  twitter_tweet_id;
@@ -128,3 +189,17 @@ export class TwitterTweetFragment extends Fragment {
128
189
  typeof fragment.twitter_tweet_id === "string");
129
190
  }
130
191
  }
192
+ export class TwitterTweetFragmentAux extends TwitterTweetFragment {
193
+ twitter_tweet;
194
+ constructor(fragment) {
195
+ if (!TwitterTweetFragmentAux.is(fragment)) {
196
+ throw Error("Invalid input.");
197
+ }
198
+ super(fragment);
199
+ this.twitter_tweet = fragment.twitter_tweet;
200
+ }
201
+ static is(fragment) {
202
+ return (Fragment.is(fragment) &&
203
+ TwitterTweet.is(fragment.twitter_tweet));
204
+ }
205
+ }
@@ -0,0 +1,8 @@
1
+ export declare class LegistarAgency {
2
+ readonly legistar_agency_id: string;
3
+ readonly legistar_client_id: string;
4
+ readonly agency_id: number;
5
+ readonly name: string;
6
+ constructor(legistar_agency: any);
7
+ static is(legistar_agency: any): legistar_agency is LegistarAgency;
8
+ }
@@ -0,0 +1,22 @@
1
+ export class LegistarAgency {
2
+ legistar_agency_id;
3
+ legistar_client_id;
4
+ agency_id;
5
+ name;
6
+ constructor(legistar_agency) {
7
+ if (!LegistarAgency.is(legistar_agency)) {
8
+ throw Error("Invalid input.");
9
+ }
10
+ this.legistar_agency_id = legistar_agency.legistar_agency_id;
11
+ this.legistar_client_id = legistar_agency.legistar_client_id;
12
+ this.agency_id = legistar_agency.agency_id;
13
+ this.name = legistar_agency.name;
14
+ }
15
+ static is(legistar_agency) {
16
+ return (legistar_agency !== undefined &&
17
+ typeof legistar_agency.legistar_agency_id === "string" &&
18
+ typeof legistar_agency.legistar_client_id === "string" &&
19
+ typeof legistar_agency.agency_id === "number" &&
20
+ typeof legistar_agency.name === "string");
21
+ }
22
+ }
@@ -0,0 +1,16 @@
1
+ export declare class LegistarDocument {
2
+ readonly legistar_document_id: string;
3
+ readonly legistar_client_id: string;
4
+ readonly agency_id: number;
5
+ readonly document_id: number;
6
+ readonly legistar_agency_id: string;
7
+ readonly location?: string;
8
+ readonly date: string;
9
+ readonly url?: string;
10
+ readonly url_video?: string;
11
+ readonly url_agenda?: string;
12
+ readonly url_minutes?: String;
13
+ readonly s3_id_txt?: string;
14
+ constructor(legistar_document: any);
15
+ static is(legistar_document: any): legistar_document is LegistarDocument;
16
+ }
@@ -0,0 +1,46 @@
1
+ export class LegistarDocument {
2
+ legistar_document_id;
3
+ legistar_client_id;
4
+ agency_id;
5
+ document_id;
6
+ legistar_agency_id;
7
+ location;
8
+ date;
9
+ url;
10
+ url_video;
11
+ url_agenda;
12
+ url_minutes;
13
+ s3_id_txt;
14
+ constructor(legistar_document) {
15
+ if (!LegistarDocument.is(legistar_document)) {
16
+ throw Error("Invalid input.");
17
+ }
18
+ this.legistar_document_id = legistar_document.legistar_document_id;
19
+ this.legistar_client_id = legistar_document.legistar_client_id;
20
+ this.agency_id = legistar_document.agency_id;
21
+ this.document_id = legistar_document.document_id;
22
+ this.legistar_agency_id = legistar_document.legistar_agency_id;
23
+ this.location = legistar_document.location;
24
+ this.date = legistar_document.date;
25
+ this.url = legistar_document.url;
26
+ this.url_video = legistar_document.url_video;
27
+ this.url_agenda = legistar_document.url_agenda;
28
+ this.url_minutes = legistar_document.url_minutes;
29
+ this.s3_id_txt = legistar_document.s3_id_txt;
30
+ }
31
+ static is(legistar_document) {
32
+ return (legistar_document !== undefined &&
33
+ typeof legistar_document.legistar_document_id === "string" &&
34
+ typeof legistar_document.legistar_client_id === "string" &&
35
+ typeof legistar_document.agency_id === "number" &&
36
+ typeof legistar_document.document_id === "number" &&
37
+ typeof legistar_document.legistar_agency_id === "string" &&
38
+ (legistar_document.location === undefined || typeof legistar_document.location === "string") &&
39
+ typeof legistar_document.date === "string" &&
40
+ (legistar_document.url === undefined || typeof legistar_document.url === "string") &&
41
+ (legistar_document.url_video === undefined || typeof legistar_document.url_video === "string") &&
42
+ (legistar_document.url_agenda === undefined || typeof legistar_document.url_agenda === "string") &&
43
+ (legistar_document.url_minutes === undefined || typeof legistar_document.url_minutes === "string") &&
44
+ (legistar_document.s3_id_txt === undefined || typeof legistar_document.s3_id_txt === "string"));
45
+ }
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.38",
3
+ "version": "1.0.40",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -50,6 +50,9 @@ export * from "./types/federal_rules/FederalRuleSection"
50
50
  export * from "./types/fragments/Fragment"
51
51
  export * from "./types/fragments/FragmentVector"
52
52
 
53
+ export * from "./types/legistar/LegistarAgency"
54
+ export * from "./types/legistar/LegistarDocument"
55
+
53
56
  export * from "./types/scout/Scout"
54
57
  export * from "./types/scout/ScoutDocument"
55
58
  export * from "./types/scout/ScoutSubScout"
@@ -1,3 +1,9 @@
1
+ import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument"
2
+ import { LegistarDocument } from "../legistar/LegistarDocument"
3
+ import { PressArticleTag, PressArticleTagAux } from "../press/PressArticleTag"
4
+ import { ScoutDocument } from "../scout/ScoutDocument"
5
+ import { TwitterTweet } from "../twitter/TwitterTweet"
6
+
1
7
  const fragment_type_ids = ["LINE", "CHAR"] as const
2
8
 
3
9
  export type FragmentTypeID = typeof fragment_type_ids[number]
@@ -54,6 +60,37 @@ export class Fragment {
54
60
  }
55
61
  }
56
62
 
63
+ export class FragmentAux extends Fragment {
64
+ readonly federal_congress_bill_document? : FederalCongressBillDocument
65
+ readonly legistar_document? : LegistarDocument
66
+ readonly press_article_tag? : PressArticleTag
67
+ readonly scout_document? : ScoutDocument
68
+ readonly twitter_tweet? : TwitterTweet
69
+
70
+ constructor(fragment : FragmentAux) {
71
+ if (!FragmentAux.is(fragment)) {
72
+ throw Error("Invalid input.")
73
+ }
74
+ super(fragment)
75
+ this.federal_congress_bill_document = fragment.federal_congress_bill_document
76
+ this.legistar_document = fragment.legistar_document
77
+ this.press_article_tag = fragment.press_article_tag
78
+ this.scout_document = fragment.scout_document
79
+ this.twitter_tweet = fragment.twitter_tweet
80
+ }
81
+
82
+ static is(fragment : any) : fragment is FragmentAux {
83
+ return (
84
+ Fragment.is(fragment) &&
85
+ FederalCongressBillDocument.is(fragment.federal_congress_bill_document) &&
86
+ LegistarDocument.is(fragment.legistar_document) &&
87
+ PressArticleTag.is(fragment.press_article_tag) &&
88
+ ScoutDocument.is(fragment.scout_document) &&
89
+ TwitterTweet.is(fragment.twitter_tweet)
90
+ )
91
+ }
92
+ }
93
+
57
94
  export class FederalCongressBillDocumentFragment extends Fragment {
58
95
  readonly document_type_id : "federal_congress_bill_document"
59
96
  readonly federal_congress_bill_document_id : string
@@ -123,6 +160,25 @@ export class PressArticleTagFragment extends Fragment {
123
160
  }
124
161
  }
125
162
 
163
+ // export class PressArticleTagFragmentAux extends PressArticleTagFragment {
164
+ // readonly press_article_ : PressArticleTagAux
165
+
166
+ // constructor(fragment : PressArticleTagFragmentAux) {
167
+ // if (!PressArticleTagFragmentAux.is(fragment)) {
168
+ // throw Error("Invalid input.")
169
+ // }
170
+ // super(fragment)
171
+ // this.scout_document = fragment.scout_document
172
+ // }
173
+
174
+ // static is(fragment : any) : fragment is PressArticleTagFragmentAux {
175
+ // return (
176
+ // Fragment.is(fragment) &&
177
+ // ScoutDocument.is(fragment.scout_document)
178
+ // )
179
+ // }
180
+ // }
181
+
126
182
  export class ScoutDocumentFragment extends Fragment {
127
183
  readonly document_type_id : "scout_document"
128
184
  readonly scout_document_id : string
@@ -145,6 +201,25 @@ export class ScoutDocumentFragment extends Fragment {
145
201
  }
146
202
  }
147
203
 
204
+ export class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
205
+ readonly scout_document : ScoutDocument
206
+
207
+ constructor(fragment : ScoutDocumentFragmentAux) {
208
+ if (!ScoutDocumentFragmentAux.is(fragment)) {
209
+ throw Error("Invalid input.")
210
+ }
211
+ super(fragment)
212
+ this.scout_document = fragment.scout_document
213
+ }
214
+
215
+ static is(fragment : any) : fragment is ScoutDocumentFragmentAux {
216
+ return (
217
+ Fragment.is(fragment) &&
218
+ ScoutDocument.is(fragment.scout_document)
219
+ )
220
+ }
221
+ }
222
+
148
223
  export class TwitterTweetFragment extends Fragment {
149
224
  readonly document_type_id : "twitter_tweet"
150
225
  readonly twitter_tweet_id : string
@@ -165,4 +240,23 @@ export class TwitterTweetFragment extends Fragment {
165
240
  typeof fragment.twitter_tweet_id === "string"
166
241
  )
167
242
  }
243
+ }
244
+
245
+ export class TwitterTweetFragmentAux extends TwitterTweetFragment {
246
+ readonly twitter_tweet : TwitterTweet
247
+
248
+ constructor(fragment : TwitterTweetFragmentAux) {
249
+ if (!TwitterTweetFragmentAux.is(fragment)) {
250
+ throw Error("Invalid input.")
251
+ }
252
+ super(fragment)
253
+ this.twitter_tweet = fragment.twitter_tweet
254
+ }
255
+
256
+ static is(fragment : any) : fragment is TwitterTweetFragmentAux {
257
+ return (
258
+ Fragment.is(fragment) &&
259
+ TwitterTweet.is(fragment.twitter_tweet)
260
+ )
261
+ }
168
262
  }
@@ -0,0 +1,26 @@
1
+ export class LegistarAgency {
2
+ readonly legistar_agency_id : string
3
+ readonly legistar_client_id : string
4
+ readonly agency_id : number
5
+ readonly name : string
6
+
7
+ constructor(legistar_agency : any) {
8
+ if (!LegistarAgency.is(legistar_agency)) {
9
+ throw Error("Invalid input.")
10
+ }
11
+ this.legistar_agency_id = legistar_agency.legistar_agency_id
12
+ this.legistar_client_id = legistar_agency.legistar_client_id
13
+ this.agency_id = legistar_agency.agency_id
14
+ this.name = legistar_agency.name
15
+ }
16
+
17
+ static is(legistar_agency : any) : legistar_agency is LegistarAgency {
18
+ return (
19
+ legistar_agency !== undefined &&
20
+ typeof legistar_agency.legistar_agency_id === "string" &&
21
+ typeof legistar_agency.legistar_client_id === "string" &&
22
+ typeof legistar_agency.agency_id === "number" &&
23
+ typeof legistar_agency.name === "string"
24
+ )
25
+ }
26
+ }
@@ -0,0 +1,50 @@
1
+ export class LegistarDocument {
2
+ readonly legistar_document_id : string
3
+ readonly legistar_client_id : string
4
+ readonly agency_id : number
5
+ readonly document_id : number
6
+ readonly legistar_agency_id : string
7
+ readonly location? : string
8
+ readonly date : string
9
+ readonly url? : string
10
+ readonly url_video? : string
11
+ readonly url_agenda? : string
12
+ readonly url_minutes? : String
13
+ readonly s3_id_txt? : string
14
+
15
+ constructor(legistar_document : any) {
16
+ if (!LegistarDocument.is(legistar_document)) {
17
+ throw Error("Invalid input.")
18
+ }
19
+ this.legistar_document_id = legistar_document.legistar_document_id
20
+ this.legistar_client_id = legistar_document.legistar_client_id
21
+ this.agency_id = legistar_document.agency_id
22
+ this.document_id = legistar_document.document_id
23
+ this.legistar_agency_id = legistar_document.legistar_agency_id
24
+ this.location = legistar_document.location
25
+ this.date = legistar_document.date
26
+ this.url = legistar_document.url
27
+ this.url_video = legistar_document.url_video
28
+ this.url_agenda = legistar_document.url_agenda
29
+ this.url_minutes = legistar_document.url_minutes
30
+ this.s3_id_txt = legistar_document.s3_id_txt
31
+ }
32
+
33
+ static is(legistar_document : any) : legistar_document is LegistarDocument {
34
+ return (
35
+ legistar_document !== undefined &&
36
+ typeof legistar_document.legistar_document_id === "string" &&
37
+ typeof legistar_document.legistar_client_id === "string" &&
38
+ typeof legistar_document.agency_id === "number" &&
39
+ typeof legistar_document.document_id === "number" &&
40
+ typeof legistar_document.legistar_agency_id === "string" &&
41
+ (legistar_document.location === undefined || typeof legistar_document.location === "string") &&
42
+ typeof legistar_document.date === "string" &&
43
+ (legistar_document.url === undefined || typeof legistar_document.url === "string") &&
44
+ (legistar_document.url_video === undefined || typeof legistar_document.url_video === "string") &&
45
+ (legistar_document.url_agenda === undefined || typeof legistar_document.url_agenda === "string") &&
46
+ (legistar_document.url_minutes === undefined || typeof legistar_document.url_minutes === "string") &&
47
+ (legistar_document.s3_id_txt === undefined || typeof legistar_document.s3_id_txt === "string")
48
+ )
49
+ }
50
+ }