doersiq-types 2.0.0

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.
Files changed (72) hide show
  1. package/dist/src/Bot.d.ts +28 -0
  2. package/dist/src/Bot.js +73 -0
  3. package/dist/src/BotDocument.d.ts +14 -0
  4. package/dist/src/BotDocument.js +38 -0
  5. package/dist/src/Conversation.d.ts +16 -0
  6. package/dist/src/Conversation.js +42 -0
  7. package/dist/src/DoersAPIError.d.ts +4 -0
  8. package/dist/src/DoersAPIError.js +18 -0
  9. package/dist/src/Jurisdiction.d.ts +22 -0
  10. package/dist/src/Jurisdiction.js +53 -0
  11. package/dist/src/JurisdictionDocument.d.ts +15 -0
  12. package/dist/src/JurisdictionDocument.js +44 -0
  13. package/dist/src/Message.d.ts +29 -0
  14. package/dist/src/Message.js +79 -0
  15. package/dist/src/OfficeClass.d.ts +17 -0
  16. package/dist/src/OfficeClass.js +131 -0
  17. package/dist/src/Party.d.ts +10 -0
  18. package/dist/src/Party.js +26 -0
  19. package/dist/src/Sources.d.ts +38 -0
  20. package/dist/src/Sources.js +105 -0
  21. package/dist/src/State.d.ts +10 -0
  22. package/dist/src/State.js +256 -0
  23. package/dist/src/Tweet.d.ts +11 -0
  24. package/dist/src/Tweet.js +32 -0
  25. package/dist/src/User.d.ts +15 -0
  26. package/dist/src/User.js +39 -0
  27. package/dist/src/index.d.ts +13 -0
  28. package/dist/src/index.js +13 -0
  29. package/dist/src/types/Bot.d.ts +29 -0
  30. package/dist/src/types/Bot.js +76 -0
  31. package/dist/src/types/BotDocument.d.ts +14 -0
  32. package/dist/src/types/BotDocument.js +38 -0
  33. package/dist/src/types/Conversation.d.ts +18 -0
  34. package/dist/src/types/Conversation.js +48 -0
  35. package/dist/src/types/DoersAPIError.d.ts +4 -0
  36. package/dist/src/types/DoersAPIError.js +19 -0
  37. package/dist/src/types/Jurisdiction.d.ts +24 -0
  38. package/dist/src/types/Jurisdiction.js +57 -0
  39. package/dist/src/types/JurisdictionDocument.d.ts +15 -0
  40. package/dist/src/types/JurisdictionDocument.js +44 -0
  41. package/dist/src/types/Message.d.ts +31 -0
  42. package/dist/src/types/Message.js +85 -0
  43. package/dist/src/types/OfficeClass.d.ts +17 -0
  44. package/dist/src/types/OfficeClass.js +132 -0
  45. package/dist/src/types/Party.d.ts +10 -0
  46. package/dist/src/types/Party.js +26 -0
  47. package/dist/src/types/Sources.d.ts +38 -0
  48. package/dist/src/types/Sources.js +105 -0
  49. package/dist/src/types/State.d.ts +11 -0
  50. package/dist/src/types/State.js +306 -0
  51. package/dist/src/types/Tweet.d.ts +12 -0
  52. package/dist/src/types/Tweet.js +34 -0
  53. package/dist/src/types/User.d.ts +16 -0
  54. package/dist/src/types/User.js +42 -0
  55. package/eslint.config.ts +13 -0
  56. package/jest.config.js +20 -0
  57. package/package.json +31 -0
  58. package/src/index.ts +13 -0
  59. package/src/types/Bot.ts +87 -0
  60. package/src/types/BotDocument.ts +43 -0
  61. package/src/types/Conversation.ts +59 -0
  62. package/src/types/DoersAPIError.ts +21 -0
  63. package/src/types/Jurisdiction.ts +62 -0
  64. package/src/types/JurisdictionDocument.ts +48 -0
  65. package/src/types/Message.ts +100 -0
  66. package/src/types/OfficeClass.ts +150 -0
  67. package/src/types/Party.ts +36 -0
  68. package/src/types/Sources.ts +125 -0
  69. package/src/types/State.ts +317 -0
  70. package/src/types/Tweet.ts +38 -0
  71. package/src/types/User.ts +53 -0
  72. package/tsconfig.json +34 -0
@@ -0,0 +1,38 @@
1
+ import { Tweet } from "./Tweet.js";
2
+ export class BotDocument {
3
+ bot_id;
4
+ document_id;
5
+ type;
6
+ s3_filename;
7
+ url;
8
+ username;
9
+ vector_keys;
10
+ tweet;
11
+ text;
12
+ constructor(bot_document) {
13
+ if (!BotDocument.is(bot_document)) {
14
+ throw Error("Invalid input.");
15
+ }
16
+ this.bot_id = bot_document.bot_id;
17
+ this.document_id = bot_document.document_id;
18
+ this.type = bot_document.type;
19
+ this.s3_filename = bot_document.s3_filename;
20
+ this.url = bot_document.url;
21
+ this.username = bot_document.username;
22
+ this.vector_keys = bot_document.vector_keys;
23
+ this.tweet = bot_document.tweet;
24
+ this.text = bot_document.text;
25
+ }
26
+ static is(bot_document) {
27
+ return (bot_document !== undefined &&
28
+ typeof bot_document.bot_id === "string" &&
29
+ typeof bot_document.document_id === "string" &&
30
+ typeof bot_document.type === "string" &&
31
+ (bot_document.s3_filename === undefined || typeof bot_document.s3_filename === "string") &&
32
+ (bot_document.url === undefined || typeof bot_document.url === "string") &&
33
+ (bot_document.username === undefined || typeof bot_document.username === "string") &&
34
+ (bot_document.vector_keys === undefined || Array.isArray(bot_document.vector_keys) && bot_document.vector_keys.every((vector_key) => typeof vector_key === "string")) &&
35
+ (bot_document.tweet === undefined || Tweet.is(bot_document.tweet)) &&
36
+ (bot_document.text === undefined || typeof bot_document.text === "string"));
37
+ }
38
+ }
@@ -0,0 +1,18 @@
1
+ import { Message } from "./Message.js";
2
+ export declare class Conversation {
3
+ readonly user_id: string;
4
+ readonly conversation_id: string;
5
+ readonly bot_id: string;
6
+ readonly time: string;
7
+ readonly mode: "email" | "general";
8
+ readonly topics?: string[];
9
+ readonly [x: string]: any;
10
+ constructor(conversation: any);
11
+ static is(conversation: any): conversation is Conversation;
12
+ }
13
+ export declare class ConversationAux extends Conversation {
14
+ readonly messages: Message[];
15
+ readonly max_action_time: string;
16
+ constructor(conversation: any);
17
+ static is(conversation: any): conversation is ConversationAux;
18
+ }
@@ -0,0 +1,48 @@
1
+ import { Message } from "./Message.js";
2
+ export class Conversation {
3
+ user_id;
4
+ conversation_id;
5
+ bot_id;
6
+ time;
7
+ mode;
8
+ topics;
9
+ constructor(conversation) {
10
+ if (!Conversation.is(conversation)) {
11
+ throw Error("Invalid input.");
12
+ }
13
+ this.user_id = conversation.user_id;
14
+ this.conversation_id = conversation.conversation_id;
15
+ this.bot_id = conversation.bot_id;
16
+ this.time = conversation.time;
17
+ this.mode = conversation.mode;
18
+ this.topics = conversation.topics;
19
+ }
20
+ static is(conversation) {
21
+ return (conversation !== undefined &&
22
+ typeof conversation.user_id === "string" &&
23
+ typeof conversation.conversation_id === "string" &&
24
+ typeof conversation.bot_id === "string" &&
25
+ typeof conversation.time === "string" &&
26
+ ["email", "general"].includes(conversation.mode) &&
27
+ (conversation.topics === undefined || Array.isArray(conversation.topics) &&
28
+ conversation.topics.every((topic) => typeof topic === "string")));
29
+ }
30
+ }
31
+ export class ConversationAux extends Conversation {
32
+ messages;
33
+ max_action_time;
34
+ constructor(conversation) {
35
+ if (!ConversationAux.is(conversation)) {
36
+ throw Error("Invalid input.");
37
+ }
38
+ super(conversation);
39
+ this.messages = conversation.messages;
40
+ this.max_action_time = conversation.max_action_time;
41
+ }
42
+ static is(conversation) {
43
+ return (Conversation.is(conversation) &&
44
+ Array.isArray(conversation.messages) &&
45
+ conversation.messages.every(Message.is) &&
46
+ typeof conversation.max_action_time === "string");
47
+ }
48
+ }
@@ -0,0 +1,4 @@
1
+ export declare class DoersAPIError extends Error {
2
+ status: number;
3
+ constructor(status: number, message?: string);
4
+ }
@@ -0,0 +1,19 @@
1
+ const default_messages_by_status = {
2
+ 400: "Bad Request",
3
+ 401: "Unauthorized",
4
+ 403: "Forbidden",
5
+ 404: "Not Found",
6
+ 405: "Method Not Allowed",
7
+ 500: "Internal Server Error",
8
+ 504: "Gateway Timeout",
9
+ 600: "Failed to Parse Output"
10
+ };
11
+ export class DoersAPIError extends Error {
12
+ status;
13
+ constructor(status, message) {
14
+ const default_message = default_messages_by_status[status];
15
+ super(message !== undefined ? message : default_message !== undefined ? default_message : "Error");
16
+ this.name = "DoersAPIError";
17
+ this.status = status;
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ export declare enum JurisdictionLevel {
2
+ OTHER = 0,
3
+ NATION = 1,
4
+ STATE = 2,
5
+ COUNTY = 3,
6
+ CITY = 4,
7
+ SCHOOL = 5
8
+ }
9
+ export declare function is_jurisdiction_level(jurisdiction_level: any): jurisdiction_level is JurisdictionLevel;
10
+ export declare class Jurisdiction {
11
+ readonly jurisdiction_id: number;
12
+ readonly name: string;
13
+ readonly path: number[];
14
+ readonly sub_jurisdiction_ids: number[];
15
+ readonly super_jurisdiction_id?: number;
16
+ readonly level: JurisdictionLevel;
17
+ readonly state_jurisdiction_id?: number;
18
+ readonly county_jurisdiction_id?: number;
19
+ readonly city_jurisdiction_id?: number;
20
+ readonly school_jurisdiction_id?: number;
21
+ readonly geographic: boolean;
22
+ constructor(jurisdiction: any);
23
+ static is(jurisdiction: any): jurisdiction is Jurisdiction;
24
+ }
@@ -0,0 +1,57 @@
1
+ export var JurisdictionLevel;
2
+ (function (JurisdictionLevel) {
3
+ JurisdictionLevel[JurisdictionLevel["OTHER"] = 0] = "OTHER";
4
+ JurisdictionLevel[JurisdictionLevel["NATION"] = 1] = "NATION";
5
+ JurisdictionLevel[JurisdictionLevel["STATE"] = 2] = "STATE";
6
+ JurisdictionLevel[JurisdictionLevel["COUNTY"] = 3] = "COUNTY";
7
+ JurisdictionLevel[JurisdictionLevel["CITY"] = 4] = "CITY";
8
+ JurisdictionLevel[JurisdictionLevel["SCHOOL"] = 5] = "SCHOOL";
9
+ })(JurisdictionLevel || (JurisdictionLevel = {}));
10
+ export function is_jurisdiction_level(jurisdiction_level) {
11
+ return [0, 1, 2, 3, 4, 5].includes(jurisdiction_level);
12
+ }
13
+ export class Jurisdiction {
14
+ jurisdiction_id;
15
+ name;
16
+ path;
17
+ sub_jurisdiction_ids;
18
+ super_jurisdiction_id;
19
+ level;
20
+ state_jurisdiction_id;
21
+ county_jurisdiction_id;
22
+ city_jurisdiction_id;
23
+ school_jurisdiction_id;
24
+ geographic;
25
+ constructor(jurisdiction) {
26
+ if (!Jurisdiction.is(jurisdiction)) {
27
+ throw Error("Invalid input.");
28
+ }
29
+ this.jurisdiction_id = jurisdiction.jurisdiction_id;
30
+ this.name = jurisdiction.name;
31
+ this.path = jurisdiction.path;
32
+ this.sub_jurisdiction_ids = jurisdiction.sub_jurisdiction_ids;
33
+ this.super_jurisdiction_id = jurisdiction.super_jurisdiction_id;
34
+ this.level = jurisdiction.level;
35
+ this.state_jurisdiction_id = jurisdiction.state_jurisdiction_id;
36
+ this.county_jurisdiction_id = jurisdiction.county_jurisdiction_id;
37
+ this.city_jurisdiction_id = jurisdiction.city_jurisdiction_id;
38
+ this.school_jurisdiction_id = jurisdiction.school_jurisdiction_id;
39
+ this.geographic = jurisdiction.geographic;
40
+ }
41
+ static is(jurisdiction) {
42
+ return (jurisdiction !== undefined &&
43
+ typeof jurisdiction.jurisdiction_id === "number" &&
44
+ typeof jurisdiction.name === "string" &&
45
+ Array.isArray(jurisdiction.path) &&
46
+ jurisdiction.path.every((jurisdiction_id) => typeof jurisdiction_id === "number") &&
47
+ Array.isArray(jurisdiction.sub_jurisdiction_ids) &&
48
+ jurisdiction.sub_jurisdiction_ids.every((jurisdiction_id) => typeof jurisdiction_id === "number") &&
49
+ is_jurisdiction_level(jurisdiction.level) &&
50
+ typeof jurisdiction.geographic === "boolean" &&
51
+ (jurisdiction.super_jurisdiction_id === undefined || typeof jurisdiction.super_jurisdiction_id === "number") &&
52
+ (jurisdiction.state_jurisdiction_id === undefined || typeof jurisdiction.state_jurisdiction_id === "number") &&
53
+ (jurisdiction.county_jurisdiction_id === undefined || typeof jurisdiction.county_jurisdiction_id === "number") &&
54
+ (jurisdiction.city_jurisdiction_id === undefined || typeof jurisdiction.city_jurisdiction_id === "number") &&
55
+ (jurisdiction.school_jurisdiction_id === undefined || typeof jurisdiction.school_jurisdiction_id === "number"));
56
+ }
57
+ }
@@ -0,0 +1,15 @@
1
+ export declare class JurisdictionDocument {
2
+ readonly jurisdiction_id: number;
3
+ readonly document_id: string;
4
+ readonly media_id: string;
5
+ readonly origin: string;
6
+ readonly s3_filename?: string;
7
+ readonly time?: string;
8
+ readonly title: string;
9
+ readonly type: string;
10
+ readonly url: string;
11
+ readonly vector_keys?: string[];
12
+ readonly location?: string;
13
+ constructor(jurisdiction_document: any);
14
+ static is(jurisdiction_document: any): jurisdiction_document is JurisdictionDocument;
15
+ }
@@ -0,0 +1,44 @@
1
+ export class JurisdictionDocument {
2
+ jurisdiction_id;
3
+ document_id;
4
+ media_id;
5
+ origin;
6
+ s3_filename;
7
+ time;
8
+ title;
9
+ type;
10
+ url;
11
+ vector_keys;
12
+ location;
13
+ constructor(jurisdiction_document) {
14
+ if (!JurisdictionDocument.is(jurisdiction_document)) {
15
+ throw Error("Invalid input.");
16
+ }
17
+ this.jurisdiction_id = jurisdiction_document.jurisdiction_id;
18
+ this.document_id = jurisdiction_document.document_id;
19
+ this.media_id = jurisdiction_document.media_id;
20
+ this.origin = jurisdiction_document.origin;
21
+ this.s3_filename = jurisdiction_document.s3_filename;
22
+ this.time = jurisdiction_document.time;
23
+ this.title = jurisdiction_document.title;
24
+ this.type = jurisdiction_document.type;
25
+ this.url = jurisdiction_document.url;
26
+ this.vector_keys = jurisdiction_document.vector_keys;
27
+ this.location = jurisdiction_document.location;
28
+ }
29
+ static is(jurisdiction_document) {
30
+ return (jurisdiction_document !== undefined &&
31
+ typeof jurisdiction_document.jurisdiction_id === "number" &&
32
+ typeof jurisdiction_document.document_id === "string" &&
33
+ typeof jurisdiction_document.media_id === "string" &&
34
+ typeof jurisdiction_document.origin === "string" &&
35
+ (jurisdiction_document.s3_filename === undefined || typeof jurisdiction_document.s3_filename === "string") &&
36
+ (jurisdiction_document.time === undefined || typeof jurisdiction_document.time === "string") &&
37
+ typeof jurisdiction_document.title === "string" &&
38
+ typeof jurisdiction_document.type === "string" &&
39
+ typeof jurisdiction_document.url === "string" &&
40
+ (jurisdiction_document.vector_keys === undefined || Array.isArray(jurisdiction_document.vector_keys) &&
41
+ jurisdiction_document.vector_keys.every((vector_key) => typeof vector_key === "string")) &&
42
+ (jurisdiction_document.location === undefined || typeof jurisdiction_document.location === "string"));
43
+ }
44
+ }
@@ -0,0 +1,31 @@
1
+ import { Sources } from "./Sources.js";
2
+ export declare class Fragment {
3
+ readonly text: string;
4
+ readonly sources: Sources;
5
+ constructor(fragment: any);
6
+ static is(fragment: any): fragment is Fragment;
7
+ }
8
+ export declare class Post {
9
+ text: string;
10
+ s3_image_filename?: string;
11
+ s3_image_url?: string;
12
+ constructor(post: any);
13
+ static is(post: any): post is Post;
14
+ }
15
+ export declare class Message {
16
+ readonly user_id: string;
17
+ readonly message_id: string;
18
+ readonly bot_id: string;
19
+ readonly conversation_id: string;
20
+ readonly time: string;
21
+ readonly mode: "email" | "general";
22
+ readonly role: "user" | "bot";
23
+ readonly system_prompt?: string;
24
+ readonly grok_text?: string;
25
+ readonly fragments?: Fragment[];
26
+ readonly sources?: Sources;
27
+ readonly text: string;
28
+ readonly posts?: Post[];
29
+ constructor(message: any);
30
+ static is(message: any): message is Message;
31
+ }
@@ -0,0 +1,85 @@
1
+ import { Sources } from "./Sources.js";
2
+ export class Fragment {
3
+ text;
4
+ sources;
5
+ constructor(fragment) {
6
+ if (!Fragment.is(fragment)) {
7
+ throw Error("Invalid input.");
8
+ }
9
+ this.text = fragment.text;
10
+ this.sources = fragment.sources;
11
+ }
12
+ static is(fragment) {
13
+ return (fragment !== undefined &&
14
+ typeof fragment.text === "string" &&
15
+ Sources.is(fragment.sources));
16
+ }
17
+ }
18
+ export class Post {
19
+ text;
20
+ s3_image_filename;
21
+ s3_image_url;
22
+ constructor(post) {
23
+ if (!Post.is(post)) {
24
+ throw Error("Invalid input.");
25
+ }
26
+ this.text = post.text;
27
+ this.s3_image_filename = post.s3_image_filename;
28
+ this.s3_image_url = post.s3_image_url;
29
+ }
30
+ static is(post) {
31
+ return (post !== undefined &&
32
+ typeof post.text === "string" &&
33
+ (post.s3_image_filename === undefined || typeof post.s3_image_filename === "string") &&
34
+ (post.s3_image_url === undefined || typeof post.s3_image_url === "string"));
35
+ }
36
+ }
37
+ export class Message {
38
+ user_id;
39
+ message_id;
40
+ bot_id;
41
+ conversation_id;
42
+ time;
43
+ mode;
44
+ role;
45
+ system_prompt;
46
+ grok_text;
47
+ fragments;
48
+ sources;
49
+ text;
50
+ posts;
51
+ constructor(message) {
52
+ if (!Message.is(message)) {
53
+ throw Error("Invalid input.");
54
+ }
55
+ this.user_id = message.user_id;
56
+ this.message_id = message.message_id;
57
+ this.bot_id = message.bot_id;
58
+ this.conversation_id = message.conversation_id;
59
+ this.time = message.time;
60
+ this.mode = message.mode;
61
+ this.role = message.role;
62
+ this.system_prompt = message.system_prompt;
63
+ this.grok_text = message.grok_text;
64
+ this.fragments = message.fragments;
65
+ this.sources = message.sources;
66
+ this.text = message.text;
67
+ this.posts = message.posts;
68
+ }
69
+ static is(message) {
70
+ return (message !== undefined &&
71
+ typeof message.user_id === "string" &&
72
+ typeof message.message_id === "string" &&
73
+ typeof message.bot_id === "string" &&
74
+ typeof message.conversation_id === "string" &&
75
+ typeof message.time === "string" &&
76
+ ["email", "general"].includes(message.mode) &&
77
+ ["user", "bot"].includes(message.role) &&
78
+ (message.system_prompt === undefined || typeof message.system_prompt === "string") &&
79
+ (message.grok_text === undefined || typeof message.grok_text === "string") &&
80
+ (message.fragments === undefined || Array.isArray(message.fragments) && message.fragments.every(Fragment.is)) &&
81
+ (message.sources === undefined || Sources.is(message.sources)) &&
82
+ typeof message.text === "string" &&
83
+ (message.posts === undefined || Array.isArray(message.posts) && message.posts.every(Post.is)));
84
+ }
85
+ }
@@ -0,0 +1,17 @@
1
+ import { JurisdictionLevel } from "./Jurisdiction.js";
2
+ declare const office_class_ids: readonly ["ORG", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
3
+ export type OfficeClassID = typeof office_class_ids[number];
4
+ export declare function is_office_class_id(office_class_id: any): office_class_id is OfficeClassID;
5
+ export interface OfficeClass {
6
+ office_class_id: OfficeClassID;
7
+ name: string;
8
+ type: "candidate" | "organization";
9
+ office_id_template: string;
10
+ jurisdiction_level?: JurisdictionLevel;
11
+ jurisdictions_mutable: Boolean;
12
+ require_district: Boolean;
13
+ require_initial_jurisdiction: Boolean;
14
+ office_names?: string[];
15
+ }
16
+ export declare const office_classes_by_office_class_id: Record<OfficeClassID, OfficeClass>;
17
+ export {};
@@ -0,0 +1,132 @@
1
+ import { JurisdictionLevel } from "./Jurisdiction.js";
2
+ const office_class_ids = ["ORG", "USH", "USS", "STG", "STH", "STS", "STB", "COG", "CIG", "LOB"];
3
+ export function is_office_class_id(office_class_id) {
4
+ return office_class_ids.includes(office_class_id);
5
+ }
6
+ export const office_classes_by_office_class_id = {
7
+ "ORG": {
8
+ office_class_id: "ORG",
9
+ name: "Organization",
10
+ type: "organization",
11
+ office_id_template: "O-[state_id]",
12
+ jurisdictions_mutable: true,
13
+ require_district: false,
14
+ require_initial_jurisdiction: false
15
+ },
16
+ "USH": {
17
+ office_class_id: "USH",
18
+ name: "U.S. House",
19
+ type: "candidate",
20
+ office_id_template: "H-[state_id]",
21
+ jurisdictions_mutable: true,
22
+ require_district: true,
23
+ require_initial_jurisdiction: false
24
+ },
25
+ "USS": {
26
+ office_class_id: "USS",
27
+ name: "U.S. Senate",
28
+ type: "candidate",
29
+ office_id_template: "S-[state_id]",
30
+ jurisdiction_level: JurisdictionLevel.STATE,
31
+ jurisdictions_mutable: false,
32
+ require_district: false,
33
+ require_initial_jurisdiction: false
34
+ },
35
+ "STG": {
36
+ office_class_id: "STG",
37
+ name: "State (Executive) Government",
38
+ type: "candidate",
39
+ office_id_template: "[state_id]-G",
40
+ jurisdiction_level: JurisdictionLevel.STATE,
41
+ jurisdictions_mutable: false,
42
+ require_district: false,
43
+ require_initial_jurisdiction: false,
44
+ office_names: [
45
+ "Governor",
46
+ "Lieutenant Governor",
47
+ "Secretary of State",
48
+ "Treasurer",
49
+ "Auditor",
50
+ "Attorney General"
51
+ ]
52
+ },
53
+ "STH": {
54
+ office_class_id: "STH",
55
+ name: "State House",
56
+ type: "candidate",
57
+ office_id_template: "[state_id]-H",
58
+ jurisdictions_mutable: true,
59
+ require_district: true,
60
+ require_initial_jurisdiction: false
61
+ },
62
+ "STS": {
63
+ office_class_id: "STS",
64
+ name: "State Senate",
65
+ type: "candidate",
66
+ office_id_template: "[state_id]-S",
67
+ jurisdictions_mutable: true,
68
+ require_district: true,
69
+ require_initial_jurisdiction: false
70
+ },
71
+ "STB": {
72
+ office_class_id: "STB",
73
+ name: "State School Board",
74
+ type: "candidate",
75
+ office_id_template: "[state_id]-B",
76
+ jurisdiction_level: JurisdictionLevel.SCHOOL,
77
+ jurisdictions_mutable: true,
78
+ require_district: true,
79
+ require_initial_jurisdiction: true,
80
+ office_names: [
81
+ "Board Member"
82
+ ]
83
+ },
84
+ "COG": {
85
+ office_class_id: "COG",
86
+ name: "County Government",
87
+ type: "candidate",
88
+ office_id_template: "[state_id]-C",
89
+ jurisdiction_level: JurisdictionLevel.COUNTY,
90
+ jurisdictions_mutable: true,
91
+ require_district: false,
92
+ require_initial_jurisdiction: true,
93
+ office_names: [
94
+ "Mayor",
95
+ "Councillor",
96
+ "Commissioner",
97
+ "Clerk",
98
+ "Recorder",
99
+ "Auditor",
100
+ "Surveyor",
101
+ "District Attorney",
102
+ "Sheriff"
103
+ ]
104
+ },
105
+ "CIG": {
106
+ office_class_id: "CIG",
107
+ name: "City Government",
108
+ type: "candidate",
109
+ office_id_template: "[state_id]-M",
110
+ jurisdiction_level: JurisdictionLevel.CITY,
111
+ jurisdictions_mutable: true,
112
+ require_district: false,
113
+ require_initial_jurisdiction: true,
114
+ office_names: [
115
+ "Mayor",
116
+ "Councillor"
117
+ ]
118
+ },
119
+ "LOB": {
120
+ office_class_id: "LOB",
121
+ name: "Local School Board",
122
+ type: "candidate",
123
+ office_id_template: "[state_id]-E",
124
+ jurisdiction_level: JurisdictionLevel.SCHOOL,
125
+ jurisdictions_mutable: true,
126
+ require_district: false,
127
+ require_initial_jurisdiction: true,
128
+ office_names: [
129
+ "Board Member"
130
+ ]
131
+ }
132
+ };
@@ -0,0 +1,10 @@
1
+ declare const party_ids: readonly ["DEM", "REP", "NON", "ETC"];
2
+ export type PartyID = typeof party_ids[number];
3
+ export declare function is_party_id(party_id: any): party_id is PartyID;
4
+ export interface Party {
5
+ party_id: PartyID;
6
+ name: string;
7
+ adjective: string;
8
+ }
9
+ export declare const parties_by_party_id: Record<PartyID, Party>;
10
+ export {};
@@ -0,0 +1,26 @@
1
+ const party_ids = ["DEM", "REP", "NON", "ETC"];
2
+ export function is_party_id(party_id) {
3
+ return party_ids.includes(party_id);
4
+ }
5
+ export const parties_by_party_id = {
6
+ DEM: {
7
+ party_id: "DEM",
8
+ name: "Democratic Party",
9
+ adjective: "Democratic"
10
+ },
11
+ REP: {
12
+ party_id: "REP",
13
+ name: "Republican Party",
14
+ adjective: "Republican"
15
+ },
16
+ ETC: {
17
+ party_id: "ETC",
18
+ name: "Other Party",
19
+ adjective: "Third-Party"
20
+ },
21
+ NON: {
22
+ party_id: "NON",
23
+ name: "Nonpartisan",
24
+ adjective: "Nonpartisan"
25
+ }
26
+ };
@@ -0,0 +1,38 @@
1
+ import { BotDocument } from "./BotDocument.js";
2
+ import { JurisdictionDocument } from "./JurisdictionDocument.js";
3
+ export declare class BotDocumentSource {
4
+ readonly chunk_text: string;
5
+ readonly description: string;
6
+ readonly label: string;
7
+ readonly type: string;
8
+ readonly vector_key: string;
9
+ readonly document: BotDocument;
10
+ constructor(bot_document_source: any);
11
+ static is(bot_document_source: any): bot_document_source is BotDocumentSource;
12
+ }
13
+ export declare class JurisdictionDocumentSource {
14
+ readonly chunk_text: string;
15
+ readonly description: string;
16
+ readonly label: string;
17
+ readonly type: string;
18
+ readonly vector_key: string;
19
+ readonly document: JurisdictionDocument;
20
+ constructor(jurisdiction_document_source: any);
21
+ static is(jurisdiction_document_source: any): jurisdiction_document_source is JurisdictionDocumentSource;
22
+ }
23
+ export declare class GrokSource {
24
+ readonly title: string;
25
+ readonly url: string;
26
+ readonly start_index: number;
27
+ readonly end_index: number;
28
+ readonly type: string;
29
+ constructor(grok_source: any);
30
+ static is(grok_source: any): grok_source is GrokSource;
31
+ }
32
+ export declare class Sources {
33
+ readonly B: BotDocumentSource[];
34
+ readonly J: JurisdictionDocumentSource[];
35
+ readonly G: GrokSource[];
36
+ constructor(sources: any);
37
+ static is(sources: any): sources is Sources;
38
+ }