@jpstroud/opencivicdata-types 0.2.5

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/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2026 Joshua Pelton-Stroud
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted, provided that the above
5
+ copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # open-civic-data-types
2
+
3
+ Typescript definitions for working with APIs that employ [Open Civic Data](https://open-civic-data.readthedocs.io/en/latest/index.html) schemas, as implemented by [OpenStates.org](https://v3.openstates.org/docs#/).
@@ -0,0 +1,22 @@
1
+ export type SingletonResponse<T> = T;
2
+ export type PaginatedResponse<T> = {
3
+ results: T[];
4
+ pagination: {
5
+ per_page: number;
6
+ page: number;
7
+ max_page: number;
8
+ total_items: number;
9
+ };
10
+ };
11
+ export type ErrorResponse = {
12
+ detail: string | {
13
+ loc: [];
14
+ msg: string;
15
+ type: string;
16
+ ctx?: {
17
+ enum_values: string[];
18
+ };
19
+ }[];
20
+ };
21
+ export type ApiResponse<T> = SingletonResponse<T> | PaginatedResponse<T> | ErrorResponse;
22
+ //# sourceMappingURL=api-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-response.d.ts","sourceRoot":"","sources":["../src/api-response.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC;AAErC,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EACF,MAAM,GACN;QACE,GAAG,EAAE,EAAE,CAAC;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,CAAC,EAAE;YACJ,WAAW,EAAE,MAAM,EAAE,CAAC;SACvB,CAAC;KACH,EAAE,CAAC;CACT,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,IACrB,iBAAiB,CAAC,CAAC,CAAC,GACpB,iBAAiB,CAAC,CAAC,CAAC,GACpB,aAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/dist/bill.d.ts ADDED
@@ -0,0 +1,78 @@
1
+ import { Document, Extras, Identifier, Link } from "./common.js";
2
+ import { JurisdictionStub } from "./jurisdiction.js";
3
+ import { OrganizationStub } from "./organization.js";
4
+ import { PersonStub } from "./person.js";
5
+ export type BillStub = {
6
+ id: string;
7
+ session: string;
8
+ identifier: string;
9
+ title: string;
10
+ };
11
+ export interface Bill {
12
+ jurisdiction: JurisdictionStub;
13
+ from_organization: OrganizationStub;
14
+ classification: string[];
15
+ subject: unknown[];
16
+ extras: Extras;
17
+ created_at: string;
18
+ updated_at: string;
19
+ openstates_url: string;
20
+ first_action_date: string;
21
+ latest_action_date: string;
22
+ latest_action_description: string;
23
+ latest_passage_date: string;
24
+ related_bills?: {
25
+ identifier: string;
26
+ legislative_session: string;
27
+ relation_type: string;
28
+ }[];
29
+ abstracts?: {
30
+ abstract: string;
31
+ note: string;
32
+ }[];
33
+ other_titles?: unknown[];
34
+ other_identifiers?: Identifier[];
35
+ sponsorships?: {
36
+ id: string;
37
+ name: string;
38
+ entity_type: "person" | "organization";
39
+ primary: boolean;
40
+ classification: string;
41
+ person?: PersonStub;
42
+ organization?: OrganizationStub;
43
+ }[];
44
+ actions: {
45
+ id: string;
46
+ organization: OrganizationStub;
47
+ description: string;
48
+ date: string;
49
+ classification: string[];
50
+ order: number;
51
+ related_entities?: {
52
+ name: string;
53
+ entity_type: string;
54
+ organization?: OrganizationStub;
55
+ person?: PersonStub;
56
+ }[];
57
+ }[];
58
+ sources?: Link[];
59
+ versions?: Document[];
60
+ documents?: Document[];
61
+ votes?: {
62
+ id: string;
63
+ motion_text: string;
64
+ motion_classification: string[];
65
+ start_date: string;
66
+ result: string;
67
+ identifier: string;
68
+ extras: Extras;
69
+ organization: OrganizationStub;
70
+ votes: {
71
+ id: string;
72
+ option: string;
73
+ voter_name: string;
74
+ voter: PersonStub;
75
+ }[];
76
+ }[];
77
+ }
78
+ //# sourceMappingURL=bill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bill.d.ts","sourceRoot":"","sources":["../src/bill.ts"],"names":[],"mappings":"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"}
package/dist/bill.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Extras, Link } from "./common.js";
2
+ import { PersonStub } from "./person.js";
3
+ export type CommitteeStub = {
4
+ id: string;
5
+ name: string;
6
+ classification: "committee" | "subcommittee";
7
+ parent_id: string;
8
+ extras: Extras;
9
+ };
10
+ export interface Committee extends CommitteeStub {
11
+ memberships?: {
12
+ person_name: string;
13
+ role: string;
14
+ person: PersonStub;
15
+ };
16
+ links?: Link[];
17
+ sources?: Link[];
18
+ }
19
+ //# sourceMappingURL=committee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"committee.d.ts","sourceRoot":"","sources":["../src/committee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,WAAW,GAAG,cAAc,CAAC;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,WAAW,CAAC,EAAE;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,UAAU,CAAC;KACpB,CAAC;IACF,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;CAClB"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ export type Link = {
2
+ url: string;
3
+ note: string;
4
+ };
5
+ export type Identifier = {
6
+ identifier: string;
7
+ scheme: string;
8
+ };
9
+ export type Extras = {
10
+ [key: string]: string;
11
+ };
12
+ export type Role = {
13
+ title: string;
14
+ org_classification: string;
15
+ district: string;
16
+ division_id: string;
17
+ };
18
+ export type Document = {
19
+ id: string;
20
+ note: string;
21
+ date: string;
22
+ classification: string;
23
+ links: Link[];
24
+ };
25
+ export interface Media extends Document {
26
+ offset: number;
27
+ }
28
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,KAAM,SAAQ,QAAQ;IACrC,MAAM,EAAE,MAAM,CAAC;CAChB"}
package/dist/common.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ import { BillStub } from "./bill.js";
2
+ import { Document, Extras, Link, Media } from "./common.js";
3
+ import { JurisdictionStub } from "./jurisdiction.js";
4
+ import { OrganizationStub } from "./organization.js";
5
+ import { PersonStub } from "./person.js";
6
+ import { VoteEventStub } from "./vote_event.js";
7
+ export type EventStub = {
8
+ id: string;
9
+ name: string;
10
+ jurisdiction: JurisdictionStub;
11
+ description: string;
12
+ classification: "event";
13
+ start_date: string;
14
+ end_date: string;
15
+ all_day: boolean;
16
+ status: string;
17
+ upstream_id: string;
18
+ deleted: boolean;
19
+ location: {
20
+ name: string;
21
+ url: string;
22
+ };
23
+ };
24
+ export interface Event extends EventStub {
25
+ links?: Link[];
26
+ sources?: Link[];
27
+ media?: Document[];
28
+ documents?: Document[];
29
+ participants?: {
30
+ note: string;
31
+ name: string;
32
+ entity_type: "person" | "organization";
33
+ person?: PersonStub;
34
+ organization?: OrganizationStub;
35
+ }[];
36
+ agenda?: {
37
+ description: string;
38
+ classification: string[];
39
+ order: number;
40
+ subjects: unknown[];
41
+ notes: unknown[];
42
+ extras: Extras;
43
+ related_entities: {
44
+ note: string;
45
+ name: string;
46
+ entity_type: "person" | "organization" | "bill" | "vote";
47
+ person?: PersonStub;
48
+ organization?: OrganizationStub;
49
+ bill?: BillStub;
50
+ vote?: VoteEventStub;
51
+ }[];
52
+ media: Media[];
53
+ }[];
54
+ }
55
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../src/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,gBAAgB,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,KAAM,SAAQ,SAAS;IACtC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,YAAY,CAAC,EAAE;QACb,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,QAAQ,GAAG,cAAc,CAAC;QACvC,MAAM,CAAC,EAAE,UAAU,CAAC;QACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;KACjC,EAAE,CAAC;IACJ,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,KAAK,EAAE,OAAO,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,QAAQ,GAAG,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;YACzD,MAAM,CAAC,EAAE,UAAU,CAAC;YACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;YAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;YAChB,IAAI,CAAC,EAAE,aAAa,CAAC;SACtB,EAAE,CAAC;QACJ,KAAK,EAAE,KAAK,EAAE,CAAC;KAChB,EAAE,CAAC;CACL"}
package/dist/event.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export * from "./api-response.js";
2
+ export * from "./bill.js";
3
+ export * from "./committee.js";
4
+ export * from "./common.js";
5
+ export * from "./event.js";
6
+ export * from "./jurisdiction.js";
7
+ export * from "./legislative_session.js";
8
+ export * from "./organization.js";
9
+ export * from "./person.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { LegislativeSession } from "./legislative_session.js";
2
+ import { Organization } from "./organization.js";
3
+ export type JurisdictionStub = {
4
+ id: string;
5
+ name: string;
6
+ classification: "country" | "state" | "municipality";
7
+ };
8
+ export interface Jurisdiction extends JurisdictionStub {
9
+ division_id?: string;
10
+ url?: string;
11
+ latest_bill_update?: string;
12
+ latest_people_update?: string;
13
+ organizations?: Organization[];
14
+ legislative_sessions?: LegislativeSession[];
15
+ latest_runs?: {
16
+ success: boolean;
17
+ start_time: string;
18
+ end_time: string;
19
+ }[];
20
+ }
21
+ //# sourceMappingURL=jurisdiction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jurisdiction.d.ts","sourceRoot":"","sources":["../src/jurisdiction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;CACtD,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;KAClB,EAAE,CAAC;CACL"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ export type LegislativeSession = {
2
+ identifier: string;
3
+ name: string;
4
+ classification: string;
5
+ start_date: string;
6
+ end_date: string;
7
+ downloads: {
8
+ url: string;
9
+ data_type: string;
10
+ created_at: string;
11
+ updated_at: string;
12
+ }[];
13
+ };
14
+ //# sourceMappingURL=legislative_session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legislative_session.d.ts","sourceRoot":"","sources":["../src/legislative_session.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,EAAE,CAAC;CACL,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ export type OrganizationStub = {
2
+ id: string;
3
+ name: string;
4
+ classification: string;
5
+ };
6
+ export interface Organization extends OrganizationStub {
7
+ districts?: {
8
+ label: string;
9
+ role: string;
10
+ division_id: string;
11
+ maximum_memberships: number;
12
+ }[];
13
+ }
14
+ //# sourceMappingURL=organization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../src/organization.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,mBAAmB,EAAE,MAAM,CAAC;KAC7B,EAAE,CAAC;CACL"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import { Extras, Identifier, Link, Role } from "./common.js";
2
+ import { JurisdictionStub } from "./jurisdiction.js";
3
+ export type PersonStub = {
4
+ id: string;
5
+ name: string;
6
+ party: string;
7
+ current_role: Role;
8
+ };
9
+ export interface Person extends PersonStub {
10
+ jurisdiction: JurisdictionStub;
11
+ given_name: string;
12
+ family_name: string;
13
+ image: string;
14
+ email: string;
15
+ gender: string;
16
+ birth_date: string;
17
+ death_date: string;
18
+ extras: Extras;
19
+ created_at: string;
20
+ updated_at: string;
21
+ openstates_url: string;
22
+ other_idenifiers?: Identifier[];
23
+ other_names?: {
24
+ name: string;
25
+ note: string;
26
+ }[];
27
+ links?: Link[];
28
+ sources?: Link[];
29
+ offices?: {
30
+ name: string;
31
+ fax: string;
32
+ voice: string;
33
+ address: string;
34
+ classification: string;
35
+ }[];
36
+ }
37
+ //# sourceMappingURL=person.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../src/person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,IAAI,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,MAAO,SAAQ,UAAU;IACxC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,UAAU,EAAE,CAAC;IAChC,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;IACjB,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACL"}
package/dist/person.js ADDED
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Extras, Link } from "./common.js";
2
+ import { OrganizationStub } from "./organization.js";
3
+ import { PersonStub } from "./person.js";
4
+ export type VoteEventStub = {
5
+ id: string;
6
+ motion_text: string;
7
+ };
8
+ export interface VoteEvent extends VoteEventStub {
9
+ motion_classification?: string[];
10
+ start_date: string;
11
+ result: string;
12
+ identifier: string;
13
+ extras: Extras;
14
+ organization: OrganizationStub;
15
+ votes: {
16
+ id: string;
17
+ option: string;
18
+ voter_name: string;
19
+ voter: PersonStub;
20
+ }[];
21
+ counts: {
22
+ option: string;
23
+ value: number;
24
+ }[];
25
+ sources: Link[];
26
+ }
27
+ //# sourceMappingURL=vote_event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote_event.d.ts","sourceRoot":"","sources":["../src/vote_event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC9C,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,gBAAgB,CAAC;IAC/B,KAAK,EAAE;QACL,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,UAAU,CAAC;KACnB,EAAE,CAAC;IACJ,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,OAAO,EAAE,IAAI,EAAE,CAAC;CACjB"}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@jpstroud/opencivicdata-types",
3
+ "version": "0.2.5",
4
+ "description": "TypeScript definitions for Open Civic Data schemas",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "private": false,
25
+ "keywords": [
26
+ "ocd",
27
+ "types",
28
+ "opencivicdata",
29
+ "openstates"
30
+ ],
31
+ "author": "JPStroud",
32
+ "license": "ISC",
33
+ "devDependencies": {
34
+ "@semantic-release/changelog": "^6.0.3",
35
+ "@semantic-release/git": "^10.0.1",
36
+ "semantic-release": "^25.0.2"
37
+ }
38
+ }