triangle-types 1.0.9 → 1.0.11

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.
@@ -29,6 +29,7 @@ export * from "./types/federal_lobby/FederalLobbyDocument.js";
29
29
  export * from "./types/federal_lobby/FederalLobbyDocumentInterest.js";
30
30
  export * from "./types/federal_congress/FederalCongressBill.js";
31
31
  export * from "./types/federal_congress/FederalCongressBillDocument.js";
32
+ export * from "./types/federal_congress/FederalCongressMember.js";
32
33
  export * from "./types/federal_register/FederalRegisterAgency.js";
33
34
  export * from "./types/federal_register/FederalRegisterDocument.js";
34
35
  export * from "./types/federal_dockets/FederalDocketAgency.js";
package/dist/src/index.js CHANGED
@@ -29,6 +29,7 @@ export * from "./types/federal_lobby/FederalLobbyDocument.js";
29
29
  export * from "./types/federal_lobby/FederalLobbyDocumentInterest.js";
30
30
  export * from "./types/federal_congress/FederalCongressBill.js";
31
31
  export * from "./types/federal_congress/FederalCongressBillDocument.js";
32
+ export * from "./types/federal_congress/FederalCongressMember.js";
32
33
  export * from "./types/federal_register/FederalRegisterAgency.js";
33
34
  export * from "./types/federal_register/FederalRegisterDocument.js";
34
35
  export * from "./types/federal_dockets/FederalDocketAgency.js";
@@ -0,0 +1,17 @@
1
+ import { StateID } from "../State.js";
2
+ export declare class FederalCongressMember {
3
+ readonly federal_congress_member_id: string;
4
+ readonly name: string;
5
+ readonly name_reverse: string;
6
+ readonly name_prefix?: string;
7
+ readonly name_first: string;
8
+ readonly name_last: string;
9
+ readonly birth_year: number;
10
+ readonly state_id: StateID;
11
+ readonly district?: number;
12
+ readonly is_incumbent: boolean;
13
+ readonly url?: string;
14
+ readonly url_image?: string;
15
+ constructor(federal_congress_member: any);
16
+ static is(federal_congress_member: any): federal_congress_member is FederalCongressMember;
17
+ }
@@ -0,0 +1,47 @@
1
+ import { is_state_id } from "../State.js";
2
+ export class FederalCongressMember {
3
+ federal_congress_member_id;
4
+ name;
5
+ name_reverse;
6
+ name_prefix;
7
+ name_first;
8
+ name_last;
9
+ birth_year;
10
+ state_id;
11
+ district;
12
+ is_incumbent;
13
+ url;
14
+ url_image;
15
+ constructor(federal_congress_member) {
16
+ if (!FederalCongressMember.is(federal_congress_member)) {
17
+ throw Error("Invalid input.");
18
+ }
19
+ this.federal_congress_member_id = federal_congress_member.federal_congress_member_id;
20
+ this.name = federal_congress_member.name;
21
+ this.name_reverse = federal_congress_member.name_reverse;
22
+ this.name_prefix = federal_congress_member.name_prefix;
23
+ this.name_first = federal_congress_member.name_first;
24
+ this.name_last = federal_congress_member.name_last;
25
+ this.birth_year = federal_congress_member.birth_year;
26
+ this.state_id = federal_congress_member.state_id;
27
+ this.is_incumbent = federal_congress_member.is_incumbent;
28
+ this.district = federal_congress_member.district;
29
+ this.url = federal_congress_member.url;
30
+ this.url_image = federal_congress_member.url_image;
31
+ }
32
+ static is(federal_congress_member) {
33
+ return (federal_congress_member !== undefined &&
34
+ typeof federal_congress_member.federal_congress_member_id === "string" &&
35
+ typeof federal_congress_member.name === "string" &&
36
+ typeof federal_congress_member.name_reverse === "string" &&
37
+ (federal_congress_member.name_prefix === undefined || typeof federal_congress_member.name_prefix === "string") &&
38
+ typeof federal_congress_member.name_first === "string" &&
39
+ typeof federal_congress_member.name_last === "string" &&
40
+ typeof federal_congress_member.birth_year === "number" && !isNaN(federal_congress_member.birth_year) &&
41
+ is_state_id(federal_congress_member.state_id) &&
42
+ (federal_congress_member.district === undefined || typeof federal_congress_member.district === "number") &&
43
+ typeof federal_congress_member.is_incumbent === "boolean" &&
44
+ (federal_congress_member.url === undefined || typeof federal_congress_member.url === "string") &&
45
+ (federal_congress_member.url_image === undefined || typeof federal_congress_member.url_image === "string"));
46
+ }
47
+ }
@@ -0,0 +1,9 @@
1
+ export declare class Scout {
2
+ readonly scout_id: string;
3
+ readonly office_id: string;
4
+ readonly number: string;
5
+ readonly name: string;
6
+ readonly [x: string]: any;
7
+ constructor(scout: any);
8
+ static is(scout: any): scout is Scout;
9
+ }
@@ -0,0 +1,22 @@
1
+ export class Scout {
2
+ scout_id;
3
+ office_id;
4
+ number;
5
+ name;
6
+ constructor(scout) {
7
+ if (!Scout.is(scout)) {
8
+ throw Error("Invalid input.");
9
+ }
10
+ this.office_id = scout.office_id;
11
+ this.number = scout.number;
12
+ this.scout_id = scout.scout_id;
13
+ this.name = scout.name;
14
+ }
15
+ static is(scout) {
16
+ return (scout !== undefined &&
17
+ typeof scout.office_id === "string" &&
18
+ typeof scout.number === "string" &&
19
+ typeof scout.scout_id === "string" &&
20
+ typeof scout.name === "string");
21
+ }
22
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare class UserScout {
2
+ readonly user_scout_id: string;
3
+ readonly user_id: string;
4
+ readonly scout_id: string;
5
+ readonly [x: string]: any;
6
+ constructor(user_scout: any);
7
+ static is(user_scout: any): user_scout is UserScout;
8
+ }
@@ -0,0 +1,19 @@
1
+ export class UserScout {
2
+ user_scout_id;
3
+ user_id;
4
+ scout_id;
5
+ constructor(user_scout) {
6
+ if (!UserScout.is(user_scout)) {
7
+ throw Error("Invalid input.");
8
+ }
9
+ this.user_scout_id = user_scout.user_scout_id;
10
+ this.user_id = user_scout.user_id;
11
+ this.scout_id = user_scout.scout_id;
12
+ }
13
+ static is(user_scout) {
14
+ return (user_scout !== undefined &&
15
+ typeof user_scout.user_scout_id === "string" &&
16
+ typeof user_scout.user_id === "string" &&
17
+ typeof user_scout.scout_id === "string");
18
+ }
19
+ }
@@ -0,0 +1,10 @@
1
+ export declare class UserScoutConversation {
2
+ readonly user_scout_conversation_id: string;
3
+ readonly user_id: string;
4
+ readonly scout_id: string;
5
+ readonly conversation_id: string;
6
+ readonly user_scout_id: string;
7
+ readonly [x: string]: any;
8
+ constructor(user_scout_conversation: any);
9
+ static is(user_scout_conversation: any): user_scout_conversation is UserScoutConversation;
10
+ }
@@ -0,0 +1,25 @@
1
+ export class UserScoutConversation {
2
+ user_scout_conversation_id;
3
+ user_id;
4
+ scout_id;
5
+ conversation_id;
6
+ user_scout_id;
7
+ constructor(user_scout_conversation) {
8
+ if (!UserScoutConversation.is(user_scout_conversation)) {
9
+ throw Error("Invalid input.");
10
+ }
11
+ this.user_scout_conversation_id = user_scout_conversation.user_scout_conversation_id;
12
+ this.user_id = user_scout_conversation.user_id;
13
+ this.scout_id = user_scout_conversation.scout_id;
14
+ this.conversation_id = user_scout_conversation.conversation_id;
15
+ this.user_scout_id = user_scout_conversation.user_scout_id;
16
+ }
17
+ static is(user_scout_conversation) {
18
+ return (user_scout_conversation !== undefined &&
19
+ typeof user_scout_conversation.user_scout_conversation_id === "string" &&
20
+ typeof user_scout_conversation.user_id === "string" &&
21
+ typeof user_scout_conversation.scout_id === "string" &&
22
+ typeof user_scout_conversation.conversation_id === "string" &&
23
+ typeof user_scout_conversation.user_scout_id === "string");
24
+ }
25
+ }
@@ -0,0 +1,15 @@
1
+ export declare class UserScoutConversationMessage {
2
+ readonly user_scout_conversation_message_id: string;
3
+ readonly user_id: string;
4
+ readonly scout_id: string;
5
+ readonly conversation_id: string;
6
+ readonly message_id: string;
7
+ readonly user_scout_id: string;
8
+ readonly user_scout_conversation_id: string;
9
+ readonly time: string;
10
+ readonly role: "USER" | "SCOUT";
11
+ readonly system_prompt?: string;
12
+ readonly text: string;
13
+ constructor(user_scout_conversation_message: any);
14
+ static is(user_scout_conversation_message: any): user_scout_conversation_message is UserScoutConversationMessage;
15
+ }
@@ -0,0 +1,43 @@
1
+ export class UserScoutConversationMessage {
2
+ user_scout_conversation_message_id;
3
+ user_id;
4
+ scout_id;
5
+ conversation_id;
6
+ message_id;
7
+ user_scout_id;
8
+ user_scout_conversation_id;
9
+ time;
10
+ role;
11
+ system_prompt;
12
+ text;
13
+ constructor(user_scout_conversation_message) {
14
+ if (!UserScoutConversationMessage.is(user_scout_conversation_message)) {
15
+ throw Error("Invalid input.");
16
+ }
17
+ this.user_scout_conversation_message_id = user_scout_conversation_message.user_scout_conversation_message_id;
18
+ this.user_id = user_scout_conversation_message.user_id;
19
+ this.scout_id = user_scout_conversation_message.scout_id;
20
+ this.conversation_id = user_scout_conversation_message.conversation_id;
21
+ this.message_id = user_scout_conversation_message.message_id;
22
+ this.user_scout_id = user_scout_conversation_message.user_scout_id;
23
+ this.user_scout_conversation_id = user_scout_conversation_message.user_scout_conversation_id;
24
+ this.time = user_scout_conversation_message.time;
25
+ this.role = user_scout_conversation_message.role;
26
+ this.system_prompt = user_scout_conversation_message.system_prompt;
27
+ this.text = user_scout_conversation_message.text;
28
+ }
29
+ static is(user_scout_conversation_message) {
30
+ return (user_scout_conversation_message !== undefined &&
31
+ typeof user_scout_conversation_message.user_scout_conversation_message_id === "string" &&
32
+ typeof user_scout_conversation_message.user_id === "string" &&
33
+ typeof user_scout_conversation_message.scout_id === "string" &&
34
+ typeof user_scout_conversation_message.conversation_id === "string" &&
35
+ typeof user_scout_conversation_message.message_id === "string" &&
36
+ typeof user_scout_conversation_message.user_scout_id === "string" &&
37
+ typeof user_scout_conversation_message.user_scout_conversation_id === "string" &&
38
+ typeof user_scout_conversation_message.time === "string" &&
39
+ ["USER", "SCOUT"].includes(user_scout_conversation_message.role) &&
40
+ (user_scout_conversation_message.system_prompt === undefined || typeof user_scout_conversation_message.system_prompt === "string") &&
41
+ typeof user_scout_conversation_message.text === "string");
42
+ }
43
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export * from "./types/federal_lobby/FederalLobbyDocumentInterest"
33
33
 
34
34
  export * from "./types/federal_congress/FederalCongressBill"
35
35
  export * from "./types/federal_congress/FederalCongressBillDocument"
36
+ export * from "./types/federal_congress/FederalCongressMember"
36
37
 
37
38
  export * from "./types/federal_register/FederalRegisterAgency"
38
39
  export * from "./types/federal_register/FederalRegisterDocument"
@@ -0,0 +1,54 @@
1
+ import { is_state_id, StateID } from "../State"
2
+
3
+ export class FederalCongressMember {
4
+ readonly federal_congress_member_id : string
5
+ readonly name : string
6
+ readonly name_reverse : string
7
+ readonly name_prefix? : string
8
+ readonly name_first : string
9
+ readonly name_last : string
10
+ readonly birth_year : number
11
+ readonly state_id : StateID
12
+ readonly district? : number
13
+ readonly is_incumbent : boolean
14
+ readonly url? : string
15
+ readonly url_image? : string
16
+
17
+
18
+ constructor(federal_congress_member : any) {
19
+ if (!FederalCongressMember.is(federal_congress_member)) {
20
+ throw Error("Invalid input.")
21
+ }
22
+ this.federal_congress_member_id = federal_congress_member.federal_congress_member_id
23
+ this.name = federal_congress_member.name
24
+ this.name_reverse = federal_congress_member.name_reverse
25
+ this.name_prefix = federal_congress_member.name_prefix
26
+ this.name_first = federal_congress_member.name_first
27
+ this.name_last = federal_congress_member.name_last
28
+ this.birth_year = federal_congress_member.birth_year
29
+ this.state_id = federal_congress_member.state_id
30
+ this.is_incumbent = federal_congress_member.is_incumbent
31
+ this.district = federal_congress_member.district
32
+ this.url = federal_congress_member.url
33
+ this.url_image = federal_congress_member.url_image
34
+ }
35
+
36
+ static is(federal_congress_member : any) : federal_congress_member is FederalCongressMember {
37
+ return (
38
+ federal_congress_member !== undefined &&
39
+ typeof federal_congress_member.federal_congress_member_id === "string" &&
40
+ typeof federal_congress_member.name === "string" &&
41
+ typeof federal_congress_member.name_reverse === "string" &&
42
+ (federal_congress_member.name_prefix === undefined || typeof federal_congress_member.name_prefix === "string") &&
43
+ typeof federal_congress_member.name_first === "string" &&
44
+ typeof federal_congress_member.name_last === "string" &&
45
+ typeof federal_congress_member.birth_year === "number" && !isNaN(federal_congress_member.birth_year) &&
46
+ is_state_id(federal_congress_member.state_id) &&
47
+ (federal_congress_member.district === undefined || typeof federal_congress_member.district === "number") &&
48
+ typeof federal_congress_member.is_incumbent === "boolean" &&
49
+ (federal_congress_member.url === undefined || typeof federal_congress_member.url === "string") &&
50
+ (federal_congress_member.url_image === undefined || typeof federal_congress_member.url_image === "string")
51
+ )
52
+ }
53
+
54
+ }
@@ -0,0 +1,27 @@
1
+ export class Scout {
2
+ readonly scout_id : string
3
+ readonly office_id : string
4
+ readonly number : string
5
+ readonly name : string
6
+ readonly [x : string] : any
7
+
8
+ constructor(scout : any) {
9
+ if (!Scout.is(scout)) {
10
+ throw Error("Invalid input.")
11
+ }
12
+ this.office_id = scout.office_id
13
+ this.number = scout.number
14
+ this.scout_id = scout.scout_id
15
+ this.name = scout.name
16
+ }
17
+
18
+ static is(scout : any) : scout is Scout {
19
+ return (
20
+ scout !== undefined &&
21
+ typeof scout.office_id === "string" &&
22
+ typeof scout.number === "string" &&
23
+ typeof scout.scout_id === "string" &&
24
+ typeof scout.name === "string"
25
+ )
26
+ }
27
+ }
File without changes
@@ -0,0 +1,24 @@
1
+ export class UserScout {
2
+ readonly user_scout_id : string
3
+ readonly user_id : string
4
+ readonly scout_id : string
5
+ readonly [x : string] : any
6
+
7
+ constructor(user_scout : any) {
8
+ if (!UserScout.is(user_scout)) {
9
+ throw Error("Invalid input.")
10
+ }
11
+ this.user_scout_id = user_scout.user_scout_id
12
+ this.user_id = user_scout.user_id
13
+ this.scout_id = user_scout.scout_id
14
+ }
15
+
16
+ static is(user_scout : any) : user_scout is UserScout {
17
+ return (
18
+ user_scout !== undefined &&
19
+ typeof user_scout.user_scout_id === "string" &&
20
+ typeof user_scout.user_id === "string" &&
21
+ typeof user_scout.scout_id === "string"
22
+ )
23
+ }
24
+ }
@@ -0,0 +1,30 @@
1
+ export class UserScoutConversation {
2
+ readonly user_scout_conversation_id : string
3
+ readonly user_id : string
4
+ readonly scout_id : string
5
+ readonly conversation_id : string
6
+ readonly user_scout_id : string
7
+ readonly [x : string] : any
8
+
9
+ constructor(user_scout_conversation : any) {
10
+ if (!UserScoutConversation.is(user_scout_conversation)) {
11
+ throw Error("Invalid input.")
12
+ }
13
+ this.user_scout_conversation_id = user_scout_conversation.user_scout_conversation_id
14
+ this.user_id = user_scout_conversation.user_id
15
+ this.scout_id = user_scout_conversation.scout_id
16
+ this.conversation_id = user_scout_conversation.conversation_id
17
+ this.user_scout_id = user_scout_conversation.user_scout_id
18
+ }
19
+
20
+ static is(user_scout_conversation : any) : user_scout_conversation is UserScoutConversation {
21
+ return (
22
+ user_scout_conversation !== undefined &&
23
+ typeof user_scout_conversation.user_scout_conversation_id === "string" &&
24
+ typeof user_scout_conversation.user_id === "string" &&
25
+ typeof user_scout_conversation.scout_id === "string" &&
26
+ typeof user_scout_conversation.conversation_id === "string" &&
27
+ typeof user_scout_conversation.user_scout_id === "string"
28
+ )
29
+ }
30
+ }
@@ -0,0 +1,47 @@
1
+ export class UserScoutConversationMessage {
2
+ readonly user_scout_conversation_message_id : string
3
+ readonly user_id : string
4
+ readonly scout_id : string
5
+ readonly conversation_id : string
6
+ readonly message_id : string
7
+ readonly user_scout_id : string
8
+ readonly user_scout_conversation_id : string
9
+ readonly time : string
10
+ readonly role : "USER" | "SCOUT"
11
+ readonly system_prompt? : string
12
+ readonly text : string
13
+
14
+ constructor(user_scout_conversation_message : any) {
15
+ if (!UserScoutConversationMessage.is(user_scout_conversation_message)) {
16
+ throw Error("Invalid input.")
17
+ }
18
+ this.user_scout_conversation_message_id = user_scout_conversation_message.user_scout_conversation_message_id
19
+ this.user_id = user_scout_conversation_message.user_id
20
+ this.scout_id = user_scout_conversation_message.scout_id
21
+ this.conversation_id = user_scout_conversation_message.conversation_id
22
+ this.message_id = user_scout_conversation_message.message_id
23
+ this.user_scout_id = user_scout_conversation_message.user_scout_id
24
+ this.user_scout_conversation_id = user_scout_conversation_message.user_scout_conversation_id
25
+ this.time = user_scout_conversation_message.time
26
+ this.role = user_scout_conversation_message.role
27
+ this.system_prompt = user_scout_conversation_message.system_prompt
28
+ this.text = user_scout_conversation_message.text
29
+ }
30
+
31
+ static is(user_scout_conversation_message : any) : user_scout_conversation_message is UserScoutConversationMessage {
32
+ return (
33
+ user_scout_conversation_message !== undefined &&
34
+ typeof user_scout_conversation_message.user_scout_conversation_message_id === "string" &&
35
+ typeof user_scout_conversation_message.user_id === "string" &&
36
+ typeof user_scout_conversation_message.scout_id === "string" &&
37
+ typeof user_scout_conversation_message.conversation_id === "string" &&
38
+ typeof user_scout_conversation_message.message_id === "string" &&
39
+ typeof user_scout_conversation_message.user_scout_id === "string" &&
40
+ typeof user_scout_conversation_message.user_scout_conversation_id === "string" &&
41
+ typeof user_scout_conversation_message.time === "string" &&
42
+ ["USER", "SCOUT"].includes(user_scout_conversation_message.role) &&
43
+ (user_scout_conversation_message.system_prompt === undefined || typeof user_scout_conversation_message.system_prompt === "string") &&
44
+ typeof user_scout_conversation_message.text === "string"
45
+ )
46
+ }
47
+ }