triangle-types 1.0.39 → 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.
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/types/fragments/Fragment.d.ts +12 -0
- package/dist/src/types/fragments/Fragment.js +29 -0
- package/dist/src/types/legistar/LegistarAgency.d.ts +8 -0
- package/dist/src/types/legistar/LegistarAgency.js +22 -0
- package/dist/src/types/legistar/LegistarDocument.d.ts +16 -0
- package/dist/src/types/legistar/LegistarDocument.js +46 -0
- package/package.json +1 -1
- package/src/index.ts +3 -0
- package/src/types/fragments/Fragment.ts +34 -1
- package/src/types/legistar/LegistarAgency.ts +26 -0
- package/src/types/legistar/LegistarDocument.ts +50 -0
package/dist/src/index.d.ts
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";
|
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,6 @@
|
|
|
1
|
+
import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
|
|
2
|
+
import { LegistarDocument } from "../legistar/LegistarDocument.js";
|
|
3
|
+
import { PressArticleTag } from "../press/PressArticleTag.js";
|
|
1
4
|
import { ScoutDocument } from "../scout/ScoutDocument.js";
|
|
2
5
|
import { TwitterTweet } from "../twitter/TwitterTweet.js";
|
|
3
6
|
declare const fragment_type_ids: readonly ["LINE", "CHAR"];
|
|
@@ -19,6 +22,15 @@ export declare class Fragment {
|
|
|
19
22
|
constructor(fragment: Fragment);
|
|
20
23
|
static is(fragment: any): fragment is Fragment;
|
|
21
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
|
+
}
|
|
22
34
|
export declare class FederalCongressBillDocumentFragment extends Fragment {
|
|
23
35
|
readonly document_type_id: "federal_congress_bill_document";
|
|
24
36
|
readonly federal_congress_bill_document_id: string;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument.js";
|
|
2
|
+
import { LegistarDocument } from "../legistar/LegistarDocument.js";
|
|
3
|
+
import { PressArticleTag } from "../press/PressArticleTag.js";
|
|
1
4
|
import { ScoutDocument } from "../scout/ScoutDocument.js";
|
|
2
5
|
import { TwitterTweet } from "../twitter/TwitterTweet.js";
|
|
3
6
|
const fragment_type_ids = ["LINE", "CHAR"];
|
|
@@ -42,6 +45,32 @@ export class Fragment {
|
|
|
42
45
|
typeof fragment.text === "string");
|
|
43
46
|
}
|
|
44
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
|
+
}
|
|
45
74
|
export class FederalCongressBillDocumentFragment extends Fragment {
|
|
46
75
|
document_type_id;
|
|
47
76
|
federal_congress_bill_document_id;
|
|
@@ -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
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,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FederalCongressBillDocument } from "../federal_congress/FederalCongressBillDocument"
|
|
2
|
+
import { LegistarDocument } from "../legistar/LegistarDocument"
|
|
3
|
+
import { PressArticleTag, PressArticleTagAux } from "../press/PressArticleTag"
|
|
2
4
|
import { ScoutDocument } from "../scout/ScoutDocument"
|
|
3
5
|
import { TwitterTweet } from "../twitter/TwitterTweet"
|
|
4
6
|
|
|
@@ -58,6 +60,37 @@ export class Fragment {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
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
|
+
|
|
61
94
|
export class FederalCongressBillDocumentFragment extends Fragment {
|
|
62
95
|
readonly document_type_id : "federal_congress_bill_document"
|
|
63
96
|
readonly federal_congress_bill_document_id : string
|
|
@@ -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
|
+
}
|