triangle-types 1.0.197 → 1.0.199
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/types/federal_elections/FederalElectionCandidate.d.ts +4 -0
- package/dist/src/types/federal_elections/FederalElectionCandidate.js +12 -0
- package/dist/src/types/twitter/TwitterUser.d.ts +1 -0
- package/dist/src/types/twitter/TwitterUser.js +4 -1
- package/dist/src/types/youtube/YoutubeChannel.d.ts +1 -0
- package/dist/src/types/youtube/YoutubeChannel.js +4 -1
- package/package.json +1 -1
- package/src/types/federal_elections/FederalElectionCandidate.ts +12 -0
- package/src/types/twitter/TwitterUser.ts +4 -1
- package/src/types/youtube/YoutubeChannel.ts +4 -1
|
@@ -5,6 +5,10 @@ import { FederalElectionF3File } from "./FederalElectionF3File.js";
|
|
|
5
5
|
import { StateID } from "../regions/State.js";
|
|
6
6
|
export declare class FederalElectionCandidate {
|
|
7
7
|
readonly federal_election_candidate_id: string;
|
|
8
|
+
readonly name_prefix?: string;
|
|
9
|
+
readonly name_first: string;
|
|
10
|
+
readonly name_middle?: string;
|
|
11
|
+
readonly name_last: string;
|
|
8
12
|
readonly name: string;
|
|
9
13
|
readonly federal_election_office_id: FederalElectionOfficeID;
|
|
10
14
|
readonly state_id?: StateID;
|
|
@@ -26,6 +26,10 @@ import { is_state_id } from "../regions/State.js";
|
|
|
26
26
|
// }
|
|
27
27
|
export class FederalElectionCandidate {
|
|
28
28
|
federal_election_candidate_id;
|
|
29
|
+
name_prefix;
|
|
30
|
+
name_first;
|
|
31
|
+
name_middle;
|
|
32
|
+
name_last;
|
|
29
33
|
name;
|
|
30
34
|
federal_election_office_id;
|
|
31
35
|
state_id;
|
|
@@ -39,6 +43,10 @@ export class FederalElectionCandidate {
|
|
|
39
43
|
throw Error("Invalid input.");
|
|
40
44
|
}
|
|
41
45
|
this.federal_election_candidate_id = federal_election_candidate.federal_election_candidate_id;
|
|
46
|
+
this.name_prefix = federal_election_candidate.name_prefix;
|
|
47
|
+
this.name_first = federal_election_candidate.name_first;
|
|
48
|
+
this.name_middle = federal_election_candidate.name_middle;
|
|
49
|
+
this.name_last = federal_election_candidate.name_last;
|
|
42
50
|
this.name = federal_election_candidate.name;
|
|
43
51
|
this.federal_election_office_id = federal_election_candidate.federal_election_office_id;
|
|
44
52
|
this.state_id = federal_election_candidate.state_id;
|
|
@@ -51,6 +59,10 @@ export class FederalElectionCandidate {
|
|
|
51
59
|
static is(federal_election_candidate) {
|
|
52
60
|
return (federal_election_candidate !== undefined &&
|
|
53
61
|
typeof federal_election_candidate.federal_election_candidate_id === "string" &&
|
|
62
|
+
(federal_election_candidate.name_prefix === undefined || typeof federal_election_candidate.name_prefix === "string") &&
|
|
63
|
+
typeof federal_election_candidate.name_first === "string" &&
|
|
64
|
+
(federal_election_candidate.name_middle === undefined || typeof federal_election_candidate.name_middle === "string") &&
|
|
65
|
+
typeof federal_election_candidate.name_last === "string" &&
|
|
54
66
|
typeof federal_election_candidate.name === "string" &&
|
|
55
67
|
is_federal_election_office_id(federal_election_candidate.federal_election_office_id) &&
|
|
56
68
|
(federal_election_candidate.state_id === undefined || is_state_id(federal_election_candidate.state_id)) &&
|
|
@@ -12,6 +12,7 @@ export declare class TwitterUser {
|
|
|
12
12
|
readonly subscription_type_id: string;
|
|
13
13
|
readonly verification_type_id: string;
|
|
14
14
|
readonly entities?: string;
|
|
15
|
+
readonly scout_id?: string;
|
|
15
16
|
constructor(twitter_user: TwitterUser);
|
|
16
17
|
static is(twitter_user: any): twitter_user is TwitterUser;
|
|
17
18
|
}
|
|
@@ -12,6 +12,7 @@ export class TwitterUser {
|
|
|
12
12
|
subscription_type_id;
|
|
13
13
|
verification_type_id;
|
|
14
14
|
entities;
|
|
15
|
+
scout_id;
|
|
15
16
|
constructor(twitter_user) {
|
|
16
17
|
if (!TwitterUser.is(twitter_user)) {
|
|
17
18
|
throw Error("Invalid input.");
|
|
@@ -29,6 +30,7 @@ export class TwitterUser {
|
|
|
29
30
|
this.subscription_type_id = twitter_user.subscription_type_id;
|
|
30
31
|
this.verification_type_id = twitter_user.verification_type_id;
|
|
31
32
|
this.entities = twitter_user.entities;
|
|
33
|
+
this.scout_id = twitter_user.scout_id;
|
|
32
34
|
}
|
|
33
35
|
static is(twitter_user) {
|
|
34
36
|
return (twitter_user !== undefined &&
|
|
@@ -44,6 +46,7 @@ export class TwitterUser {
|
|
|
44
46
|
typeof twitter_user.is_parody === "boolean" &&
|
|
45
47
|
typeof twitter_user.subscription_type_id === "string" &&
|
|
46
48
|
typeof twitter_user.verification_type_id === "string" &&
|
|
47
|
-
(twitter_user.entities === undefined || typeof twitter_user.entities === "string")
|
|
49
|
+
(twitter_user.entities === undefined || typeof twitter_user.entities === "string") &&
|
|
50
|
+
(twitter_user.scout_id === undefined || typeof twitter_user.scout_id === "string"));
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
export class YoutubeChannel {
|
|
2
2
|
youtube_channel_id;
|
|
3
3
|
name;
|
|
4
|
+
scout_id;
|
|
4
5
|
constructor(youtube_channel) {
|
|
5
6
|
if (!YoutubeChannel.is(youtube_channel)) {
|
|
6
7
|
throw Error("Invalid input.");
|
|
7
8
|
}
|
|
8
9
|
this.youtube_channel_id = youtube_channel.youtube_channel_id;
|
|
9
10
|
this.name = youtube_channel.name;
|
|
11
|
+
this.scout_id = youtube_channel.scout_id;
|
|
10
12
|
}
|
|
11
13
|
static is(youtube_channel) {
|
|
12
14
|
return (youtube_channel !== undefined &&
|
|
13
15
|
typeof youtube_channel.youtube_channel_id === "string" &&
|
|
14
|
-
typeof youtube_channel.name === "string"
|
|
16
|
+
typeof youtube_channel.name === "string" &&
|
|
17
|
+
(youtube_channel.scout_id === undefined || typeof youtube_channel.scout_id === "string"));
|
|
15
18
|
}
|
|
16
19
|
}
|
package/package.json
CHANGED
|
@@ -30,6 +30,10 @@ import { is_state_id, StateID } from "../regions/State"
|
|
|
30
30
|
|
|
31
31
|
export class FederalElectionCandidate {
|
|
32
32
|
readonly federal_election_candidate_id : string
|
|
33
|
+
readonly name_prefix? : string
|
|
34
|
+
readonly name_first : string
|
|
35
|
+
readonly name_middle? : string
|
|
36
|
+
readonly name_last : string
|
|
33
37
|
readonly name : string
|
|
34
38
|
readonly federal_election_office_id : FederalElectionOfficeID
|
|
35
39
|
readonly state_id? : StateID
|
|
@@ -46,6 +50,10 @@ export class FederalElectionCandidate {
|
|
|
46
50
|
throw Error("Invalid input.")
|
|
47
51
|
}
|
|
48
52
|
this.federal_election_candidate_id = federal_election_candidate.federal_election_candidate_id
|
|
53
|
+
this.name_prefix = federal_election_candidate.name_prefix
|
|
54
|
+
this.name_first = federal_election_candidate.name_first
|
|
55
|
+
this.name_middle = federal_election_candidate.name_middle
|
|
56
|
+
this.name_last = federal_election_candidate.name_last
|
|
49
57
|
this.name = federal_election_candidate.name
|
|
50
58
|
this.federal_election_office_id = federal_election_candidate.federal_election_office_id
|
|
51
59
|
this.state_id = federal_election_candidate.state_id
|
|
@@ -60,6 +68,10 @@ export class FederalElectionCandidate {
|
|
|
60
68
|
return (
|
|
61
69
|
federal_election_candidate !== undefined &&
|
|
62
70
|
typeof federal_election_candidate.federal_election_candidate_id === "string" &&
|
|
71
|
+
(federal_election_candidate.name_prefix === undefined || typeof federal_election_candidate.name_prefix === "string") &&
|
|
72
|
+
typeof federal_election_candidate.name_first === "string" &&
|
|
73
|
+
(federal_election_candidate.name_middle === undefined || typeof federal_election_candidate.name_middle === "string") &&
|
|
74
|
+
typeof federal_election_candidate.name_last === "string" &&
|
|
63
75
|
typeof federal_election_candidate.name === "string" &&
|
|
64
76
|
is_federal_election_office_id(federal_election_candidate.federal_election_office_id) &&
|
|
65
77
|
(federal_election_candidate.state_id === undefined || is_state_id(federal_election_candidate.state_id)) &&
|
|
@@ -12,6 +12,7 @@ export class TwitterUser {
|
|
|
12
12
|
readonly subscription_type_id : string
|
|
13
13
|
readonly verification_type_id : string
|
|
14
14
|
readonly entities? : string
|
|
15
|
+
readonly scout_id? : string
|
|
15
16
|
|
|
16
17
|
constructor(twitter_user : TwitterUser) {
|
|
17
18
|
if (!TwitterUser.is(twitter_user)) {
|
|
@@ -30,6 +31,7 @@ export class TwitterUser {
|
|
|
30
31
|
this.subscription_type_id = twitter_user.subscription_type_id
|
|
31
32
|
this.verification_type_id = twitter_user.verification_type_id
|
|
32
33
|
this.entities = twitter_user.entities
|
|
34
|
+
this.scout_id = twitter_user.scout_id
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
static is(twitter_user : any) : twitter_user is TwitterUser {
|
|
@@ -47,7 +49,8 @@ export class TwitterUser {
|
|
|
47
49
|
typeof twitter_user.is_parody === "boolean" &&
|
|
48
50
|
typeof twitter_user.subscription_type_id === "string" &&
|
|
49
51
|
typeof twitter_user.verification_type_id === "string" &&
|
|
50
|
-
(twitter_user.entities === undefined || typeof twitter_user.entities === "string")
|
|
52
|
+
(twitter_user.entities === undefined || typeof twitter_user.entities === "string") &&
|
|
53
|
+
(twitter_user.scout_id === undefined || typeof twitter_user.scout_id === "string")
|
|
51
54
|
)
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export class YoutubeChannel {
|
|
2
2
|
readonly youtube_channel_id : string
|
|
3
3
|
readonly name : string
|
|
4
|
+
readonly scout_id? : string
|
|
4
5
|
|
|
5
6
|
constructor(youtube_channel : YoutubeChannel) {
|
|
6
7
|
if (!YoutubeChannel.is(youtube_channel)) {
|
|
@@ -8,13 +9,15 @@ export class YoutubeChannel {
|
|
|
8
9
|
}
|
|
9
10
|
this.youtube_channel_id = youtube_channel.youtube_channel_id
|
|
10
11
|
this.name = youtube_channel.name
|
|
12
|
+
this.scout_id = youtube_channel.scout_id
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
static is(youtube_channel : any) : youtube_channel is YoutubeChannel {
|
|
14
16
|
return (
|
|
15
17
|
youtube_channel !== undefined &&
|
|
16
18
|
typeof youtube_channel.youtube_channel_id === "string" &&
|
|
17
|
-
typeof youtube_channel.name === "string"
|
|
19
|
+
typeof youtube_channel.name === "string" &&
|
|
20
|
+
(youtube_channel.scout_id === undefined || typeof youtube_channel.scout_id === "string")
|
|
18
21
|
)
|
|
19
22
|
}
|
|
20
23
|
}
|