UNPKG

congress-dot-gov

Version:
974 lines (971 loc) 113 kB
import { z } from 'zod/v4'; import { z as z$1 } from 'zod'; var ActivityName = /* @__PURE__ */ ((ActivityName2) => { ActivityName2["REFERRED_TO"] = "Referred to"; ActivityName2["RE_REFERRED_TO"] = "Re-Referred to"; ActivityName2["HEARINGS_BY"] = "Hearings by"; ActivityName2["MARKUP_BY"] = "Markup by"; ActivityName2["REPORTED_BY"] = "Reported by"; ActivityName2["REPORTED_ORIGINAL_MEASURE"] = "Reported original measure"; ActivityName2["COMMITTED_TO"] = "Committed to"; ActivityName2["RE_COMMITTED_TO"] = "Re-Committed to"; ActivityName2["LEGISLATIVE_INTEREST"] = "Legislative Interest"; ActivityName2["DISCHARGED_FROM"] = "Discharged From"; return ActivityName2; })(ActivityName || {}); var ActivityNameTypo = /* @__PURE__ */ ((ActivityNameTypo2) => { ActivityNameTypo2["REFERRED_TO_CAPITALIZED"] = "Referred To"; return ActivityNameTypo2; })(ActivityNameTypo || {}); var IdentifiedBy = /* @__PURE__ */ ((IdentifiedBy2) => { IdentifiedBy2["HOUSE"] = "House"; IdentifiedBy2["SENATE"] = "Senate"; IdentifiedBy2["CRS"] = "CRS"; return IdentifiedBy2; })(IdentifiedBy || {}); var HouseAmendmentType = /* @__PURE__ */ ((HouseAmendmentType2) => { HouseAmendmentType2["HAMDT"] = "HAMDT"; return HouseAmendmentType2; })(HouseAmendmentType || {}); var SenateAmendmentType = /* @__PURE__ */ ((SenateAmendmentType2) => { SenateAmendmentType2["SAMDT"] = "SAMDT"; SenateAmendmentType2["SUAMDT"] = "SUAMDT"; return SenateAmendmentType2; })(SenateAmendmentType || {}); var AmendmentType = /* @__PURE__ */ ((AmendmentType2) => { AmendmentType2["HAMDT"] = "HAMDT"; AmendmentType2["SAMDT"] = "SAMDT"; AmendmentType2["SUAMDT"] = "SUAMDT"; return AmendmentType2; })(AmendmentType || {}); var CongressChamber = /* @__PURE__ */ ((CongressChamber2) => { CongressChamber2["HOUSE"] = "House of Representatives"; CongressChamber2["SENATE"] = "Senate"; return CongressChamber2; })(CongressChamber || {}); var Chamber = /* @__PURE__ */ ((Chamber2) => { Chamber2["HOUSE"] = "House"; Chamber2["SENATE"] = "Senate"; Chamber2["JOINT"] = "Joint"; Chamber2["NO_CHAMBER"] = "NoChamber"; return Chamber2; })(Chamber || {}); var Session = /* @__PURE__ */ ((Session2) => { Session2["REGULAR"] = "R"; Session2["SPECIAL"] = "S"; return Session2; })(Session || {}); var ChamberCode = /* @__PURE__ */ ((ChamberCode2) => { ChamberCode2["HOUSE"] = "H"; ChamberCode2["SENATE"] = "S"; return ChamberCode2; })(ChamberCode || {}); var HouseBillType = /* @__PURE__ */ ((HouseBillType2) => { HouseBillType2["HR"] = "HR"; HouseBillType2["HJRES"] = "HJRES"; HouseBillType2["HCONRES"] = "HCONRES"; HouseBillType2["HRES"] = "HRES"; return HouseBillType2; })(HouseBillType || {}); var SenateBillType = /* @__PURE__ */ ((SenateBillType2) => { SenateBillType2["S"] = "S"; SenateBillType2["SJRES"] = "SJRES"; SenateBillType2["SCONRES"] = "SCONRES"; SenateBillType2["SRES"] = "SRES"; return SenateBillType2; })(SenateBillType || {}); var ActionType = /* @__PURE__ */ ((ActionType2) => { ActionType2["COMMITTEE"] = "Committee"; ActionType2["FLOOR"] = "Floor"; ActionType2["INTRO_REFERRAL"] = "IntroReferral"; ActionType2["RESOLVING_DIFFERENCES"] = "ResolvingDifferences"; ActionType2["NOT_USED"] = "NotUsed"; return ActionType2; })(ActionType || {}); var BillActionType = /* @__PURE__ */ ((BillActionType2) => { BillActionType2["COMMITTEE"] = "Committee"; BillActionType2["CALENDARS"] = "Calendars"; BillActionType2["FLOOR"] = "Floor"; BillActionType2["BECAME_LAW"] = "BecameLaw"; BillActionType2["INTRO_REFERRAL"] = "IntroReferral"; BillActionType2["PRESIDENT"] = "President"; BillActionType2["RESOLVING_DIFFERENCES"] = "ResolvingDifferences"; BillActionType2["DISCHARGE"] = "Discharge"; BillActionType2["NOT_USED"] = "NotUsed"; BillActionType2["VETO"] = "Veto"; return BillActionType2; })(BillActionType || {}); var AmendmentTextType = /* @__PURE__ */ ((AmendmentTextType2) => { AmendmentTextType2["SUBMITTED"] = "Submitted"; AmendmentTextType2["MODIFIED"] = "Modified"; return AmendmentTextType2; })(AmendmentTextType || {}); var BillType = /* @__PURE__ */ ((BillType2) => { BillType2["S"] = "S"; BillType2["SJRES"] = "SJRES"; BillType2["SCONRES"] = "SCONRES"; BillType2["SRES"] = "SRES"; BillType2["HR"] = "HR"; BillType2["HJRES"] = "HJRES"; BillType2["HCONRES"] = "HCONRES"; BillType2["HRES"] = "HRES"; return BillType2; })(BillType || {}); var MemberType = /* @__PURE__ */ ((MemberType2) => { MemberType2["REPRESENTATIVE"] = "Representative"; MemberType2["RESIDENT_COMMISSIONER"] = "Resident Commissioner"; MemberType2["DELEGATE"] = "Delegate"; MemberType2["SENATOR"] = "Senator"; return MemberType2; })(MemberType || {}); var PartyName = /* @__PURE__ */ ((PartyName2) => { PartyName2["DEMOCRATIC"] = "Democratic"; PartyName2["INDEPENDENT"] = "Independent"; PartyName2["INDEPENDENT_DEMOCRAT"] = "Independent Democrat"; PartyName2["LIBERTARIAN"] = "Libertarian"; PartyName2["REPUBLICAN"] = "Republican"; return PartyName2; })(PartyName || {}); var PartyCode = /* @__PURE__ */ ((PartyCode2) => { PartyCode2["DEMOCRATIC"] = "D"; PartyCode2["INDEPENDENT"] = "I"; PartyCode2["INDEPENDENT_DEMOCRAT"] = "ID"; PartyCode2["LIBERTARIAN"] = "L"; PartyCode2["REPUBLICAN"] = "R"; return PartyCode2; })(PartyCode || {}); var OnBehalfOfSponsorAction = /* @__PURE__ */ ((OnBehalfOfSponsorAction2) => { OnBehalfOfSponsorAction2["SUBMITTED_ON_BEHALF_OF"] = "Submitted on behalf of"; OnBehalfOfSponsorAction2["PROPOSED_ON_BEHALF_OF"] = "Proposed on behalf of"; return OnBehalfOfSponsorAction2; })(OnBehalfOfSponsorAction || {}); var VoteType = /* @__PURE__ */ ((VoteType2) => { VoteType2["RECORDED_VOTE_2_3"] = "2/3 Recorded Vote"; VoteType2["YEA_AND_NAY_2_3"] = "2/3 Yea-And-Nay"; VoteType2["RECORDED_VOTE_3_5"] = "3/5 Recorded Vote"; VoteType2["YEA_AND_NAY_3_5"] = "3/5 Yea-And-Nay"; VoteType2["QUORUM"] = "Quorum"; VoteType2["RECORDED_VOTE"] = "Recorded Vote"; VoteType2["YEA_AND_NAY"] = "Yea-and-Nay"; return VoteType2; })(VoteType || {}); var VoteResult = /* @__PURE__ */ ((VoteResult2) => { VoteResult2["PASSED"] = "Passed"; VoteResult2["FAILED"] = "Failed"; VoteResult2["AGREED_TO"] = "Agreed to"; return VoteResult2; })(VoteResult || {}); var VoteQuestion = /* @__PURE__ */ ((VoteQuestion2) => { VoteQuestion2["ON_AGREEING_TO_AMENDMENT"] = "On Agreeing to the Amendment"; VoteQuestion2["ON_AGREEING_TO_RESOLUTION"] = "On Agreeing to the Resolution"; VoteQuestion2["ON_AGREEING_TO_RESOLUTION_AS_AMENDED"] = "On Agreeing to the Resolution, as Amended"; VoteQuestion2["ON_MOTION_TO_RECOMMIT"] = "On Motion to Recommit"; VoteQuestion2["ON_MOTION_TO_RECONSIDER"] = "On Motion to Reconsider"; VoteQuestion2["ON_MOTION_TO_SUSPEND_RULES_AND_AGREE"] = "On Motion to Suspend the Rules and Agree"; VoteQuestion2["ON_MOTION_TO_SUSPEND_RULES_AND_AGREE_AS_AMENDED"] = "On Motion to Suspend the Rules and Agree, as Amended"; VoteQuestion2["ON_MOTION_TO_SUSPEND_RULES_AND_CONCUR_IN_THE_SENATE_AMENDMENT"] = "On Motion to Suspend the Rules and Concur in the Senate Amendment"; VoteQuestion2["ON_MOTION_TO_SUSPEND_RULES_AND_PASS"] = "On Motion to Suspend the Rules and Pass"; VoteQuestion2["ON_MOTION_TO_SUSPEND_RULES_AND_PASS_AS_AMENDED"] = "On Motion to Suspend the Rules and Pass, as Amended"; VoteQuestion2["ON_MOTION_TO_TABLE"] = "On Motion to Table"; VoteQuestion2["ON_ORDERING_THE_PREVIOUS_QUESTION"] = "On Ordering the Previous Question"; VoteQuestion2["ON_PASSAGE"] = "On Passage"; return VoteQuestion2; })(VoteQuestion || {}); var CommitteeType = /* @__PURE__ */ ((CommitteeType2) => { CommitteeType2["COMMISSION_OR_CAUCUS"] = "Commission or Caucus"; CommitteeType2["JOINT"] = "Joint"; CommitteeType2["OTHER"] = "Other"; CommitteeType2["SELECT"] = "Select"; CommitteeType2["SPECIAL"] = "Special"; CommitteeType2["STANDING"] = "Standing"; CommitteeType2["SUBCOMMITTEE"] = "Subcommittee"; CommitteeType2["TASK_FORCE"] = "Task Force"; return CommitteeType2; })(CommitteeType || {}); var CommitteeReportType = /* @__PURE__ */ ((CommitteeReportType2) => { CommitteeReportType2["HRPT"] = "HRPT"; CommitteeReportType2["SRPT"] = "SRPT"; CommitteeReportType2["ERPT"] = "ERPT"; return CommitteeReportType2; })(CommitteeReportType || {}); var CommitteeReportReportType = /* @__PURE__ */ ((CommitteeReportReportType2) => { CommitteeReportReportType2["SRPT"] = "S.Rept"; CommitteeReportReportType2["HRPT"] = "H.Rept"; CommitteeReportReportType2["ERPT"] = "Ex.Rept"; CommitteeReportReportType2["HRPT_DOT"] = "H.Rept."; return CommitteeReportReportType2; })(CommitteeReportReportType || {}); var CommitteeReportFormat = /* @__PURE__ */ ((CommitteeReportFormat2) => { CommitteeReportFormat2["FORMATTED_TEXT"] = "Formatted Text"; CommitteeReportFormat2["PDF"] = "PDF"; CommitteeReportFormat2["FORMATTED_XML"] = "Formatted XML"; CommitteeReportFormat2["GENERATED_HTML"] = "Generated HTML"; return CommitteeReportFormat2; })(CommitteeReportFormat || {}); var CommunicationTypeName = /* @__PURE__ */ ((CommunicationTypeName2) => { CommunicationTypeName2["EXECUTIVE_COMMUNICATION"] = "Executive Communication"; CommunicationTypeName2["PRESIDENTIAL_MESSAGE"] = "Presidential Message"; CommunicationTypeName2["PETITION"] = "Petition"; CommunicationTypeName2["MEMORIAL"] = "Memorial"; CommunicationTypeName2["PEPETITION_OR_MEMORIAL"] = "Petition or Memorial"; return CommunicationTypeName2; })(CommunicationTypeName || {}); var CommunicationTypeCode = /* @__PURE__ */ ((CommunicationTypeCode2) => { CommunicationTypeCode2["EXECUTIVE_COMMUNICATION"] = "EC"; CommunicationTypeCode2["PRESIDENTIAL_MESSAGE"] = "PM"; CommunicationTypeCode2["PETITION"] = "PT"; CommunicationTypeCode2["MEMORIAL"] = "ML"; CommunicationTypeCode2["PEPETITION_OR_MEMORIAL"] = "POM"; return CommunicationTypeCode2; })(CommunicationTypeCode || {}); var SourceSystemCode = /* @__PURE__ */ ((SourceSystemCode2) => { SourceSystemCode2["SENATE"] = "0"; SourceSystemCode2["HOUSE_COMMITTEE_ACTIONS"] = "1"; SourceSystemCode2["HOUSE_FLOOR_ACTIONS"] = "2"; SourceSystemCode2["LIBRARY_OF_CONGRESS"] = "9"; return SourceSystemCode2; })(SourceSystemCode || {}); var SourceSystemName = /* @__PURE__ */ ((SourceSystemName2) => { SourceSystemName2["SENATE"] = "Senate"; SourceSystemName2["HOUSE_COMMITTEE_ACTIONS"] = "House committee actions"; SourceSystemName2["HOUSE_FLOOR_ACTIONS"] = "House floor actions"; SourceSystemName2["LIBRARY_OF_CONGRESS"] = "Library of Congress"; return SourceSystemName2; })(SourceSystemName || {}); var LawType = /* @__PURE__ */ ((LawType2) => { LawType2["PUBLIC_LAW"] = "Public Law"; LawType2["PRIVATE_LAW"] = "Private Law"; return LawType2; })(LawType || {}); var StateName = /* @__PURE__ */ ((StateName2) => { StateName2["ALABAMA"] = "Alabama"; StateName2["ALASKA"] = "Alaska"; StateName2["ARIZONA"] = "Arizona"; StateName2["ARKANSAS"] = "Arkansas"; StateName2["CALIFORNIA"] = "California"; StateName2["COLORADO"] = "Colorado"; StateName2["CONNECTICUT"] = "Connecticut"; StateName2["DELAWARE"] = "Delaware"; StateName2["DISTRICT_OF_COLUMBIA"] = "District of Columbia"; StateName2["FLORIDA"] = "Florida"; StateName2["GEORGIA"] = "Georgia"; StateName2["HAWAII"] = "Hawaii"; StateName2["IDAHO"] = "Idaho"; StateName2["ILLINOIS"] = "Illinois"; StateName2["INDIANA"] = "Indiana"; StateName2["IOWA"] = "Iowa"; StateName2["KANSAS"] = "Kansas"; StateName2["KENTUCKY"] = "Kentucky"; StateName2["LOUISIANA"] = "Louisiana"; StateName2["MAINE"] = "Maine"; StateName2["MARYLAND"] = "Maryland"; StateName2["MASSACHUSETTS"] = "Massachusetts"; StateName2["MICHIGAN"] = "Michigan"; StateName2["MINNESOTA"] = "Minnesota"; StateName2["MISSISSIPPI"] = "Mississippi"; StateName2["MISSOURI"] = "Missouri"; StateName2["MONTANA"] = "Montana"; StateName2["NEBRASKA"] = "Nebraska"; StateName2["NEVADA"] = "Nevada"; StateName2["NEW_HAMPSHIRE"] = "New Hampshire"; StateName2["NEW_JERSEY"] = "New Jersey"; StateName2["NEW_MEXICO"] = "New Mexico"; StateName2["NEW_YORK"] = "New York"; StateName2["NORTH_CAROLINA"] = "North Carolina"; StateName2["NORTH_DAKOTA"] = "North Dakota"; StateName2["OHIO"] = "Ohio"; StateName2["OKLAHOMA"] = "Oklahoma"; StateName2["OREGON"] = "Oregon"; StateName2["PENNSYLVANIA"] = "Pennsylvania"; StateName2["RHODE_ISLAND"] = "Rhode Island"; StateName2["SOUTH_CAROLINA"] = "South Carolina"; StateName2["SOUTH_DAKOTA"] = "South Dakota"; StateName2["TENNESSEE"] = "Tennessee"; StateName2["TEXAS"] = "Texas"; StateName2["UTAH"] = "Utah"; StateName2["VERMONT"] = "Vermont"; StateName2["VIRGINIA"] = "Virginia"; StateName2["WASHINGTON"] = "Washington"; StateName2["WEST_VIRGINIA"] = "West Virginia"; StateName2["WISCONSIN"] = "Wisconsin"; StateName2["WYOMING"] = "Wyoming"; return StateName2; })(StateName || {}); var StateCode = /* @__PURE__ */ ((StateCode2) => { StateCode2["ALABAMA"] = "AL"; StateCode2["ALASKA"] = "AK"; StateCode2["ARIZONA"] = "AZ"; StateCode2["ARKANSAS"] = "AR"; StateCode2["CALIFORNIA"] = "CA"; StateCode2["COLORADO"] = "CO"; StateCode2["CONNECTICUT"] = "CT"; StateCode2["DELAWARE"] = "DE"; StateCode2["DISTRICT_OF_COLUMBIA"] = "DC"; StateCode2["FLORIDA"] = "FL"; StateCode2["GEORGIA"] = "GA"; StateCode2["HAWAII"] = "HI"; StateCode2["IDAHO"] = "ID"; StateCode2["ILLINOIS"] = "IL"; StateCode2["INDIANA"] = "IN"; StateCode2["IOWA"] = "IA"; StateCode2["KANSAS"] = "KS"; StateCode2["KENTUCKY"] = "KY"; StateCode2["LOUISIANA"] = "LA"; StateCode2["MAINE"] = "ME"; StateCode2["MARYLAND"] = "MD"; StateCode2["MASSACHUSETTS"] = "MA"; StateCode2["MICHIGAN"] = "MI"; StateCode2["MINNESOTA"] = "MN"; StateCode2["MISSISSIPPI"] = "MS"; StateCode2["MISSOURI"] = "MO"; StateCode2["MONTANA"] = "MT"; StateCode2["NEBRASKA"] = "NE"; StateCode2["NEVADA"] = "NV"; StateCode2["NEW_HAMPSHIRE"] = "NH"; StateCode2["NEW_JERSEY"] = "NJ"; StateCode2["NEW_MEXICO"] = "NM"; StateCode2["NEW_YORK"] = "NY"; StateCode2["NORTH_CAROLINA"] = "NC"; StateCode2["NORTH_DAKOTA"] = "ND"; StateCode2["OHIO"] = "OH"; StateCode2["OKLAHOMA"] = "OK"; StateCode2["OREGON"] = "OR"; StateCode2["PENNSYLVANIA"] = "PA"; StateCode2["RHODE_ISLAND"] = "RI"; StateCode2["SOUTH_CAROLINA"] = "SC"; StateCode2["SOUTH_DAKOTA"] = "SD"; StateCode2["TENNESSEE"] = "TN"; StateCode2["TEXAS"] = "TX"; StateCode2["UTAH"] = "UT"; StateCode2["VERMONT"] = "VT"; StateCode2["VIRGINIA"] = "VA"; StateCode2["WASHINGTON"] = "WA"; StateCode2["WEST_VIRGINIA"] = "WV"; StateCode2["WISCONSIN"] = "WI"; StateCode2["WYOMING"] = "WY"; return StateCode2; })(StateCode || {}); const BillSummarySchema = z.strictObject({ /** The congress during which a bill or resolution was introduced or submitted. * View the [field values list of Congresses](https://www.congress.gov/help/field-values/congresses) on Congress.gov. * Read more [about Congresses](https://www.congress.gov/help/legislative-glossary#glossary_congress) on Congress.gov. */ congress: z.number(), /** The latest action taken on the bill or resolution */ latestAction: z.strictObject({ /** The date of the latest action taken on the bill or resolution. */ actionDate: z.string(), /** The time of the latest action taken on the bill or resolution. Certain actions taken by the House contain this element. */ actionTime: z.string().optional(), /** The text of the latest action taken on the bill or resolution. */ text: z.string() }), /**The assigned bill or resolution number. */ number: z.string(), /**The chamber of origin where a bill or resolution was introduced or submitted. Possible values are "House" and "Senate". */ originChamber: z.enum(Chamber), /** The code for the chamber of origin where the bill or resolution was introduced or submitted. Possible values are "H" and "S". */ originChamberCode: z.enum(ChamberCode), /** The display title for the bill or resolution on Congress.gov. */ title: z.string(), /** The type of bill or resolution. Possible values are "HR", "S", "HJRES", "SJRES", "HCONRES", "SCONRES", "HRES", and "SRES". */ type: z.enum(BillType), /** The date of update on Congress.gov. This update date does not include updates to bill text. The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDate: z.string(), /** The date of update on Congress.gov, including if the update was to bill text.The is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDateIncludingText: z.string(), /** A referrer URL to the bill or resolution item in the API. */ url: z.url() }); const BaseBillSchema = z.strictObject({ /** Actions on the bill or resolution. */ actions: z.strictObject({ /** The number of actions on the bill or resolution. The <count> includes actions from the House, Senate, and Library of Congress. */ count: z.number(), /** A referrer URL to the actions level of the bill API. */ url: z.url() }), /** Committee reports associated with the bill or resolution. */ committeeReports: z.array( z.strictObject({ /** The committee report citation. */ citation: z.string(), /** A referrer URL to the committee report item in the API. */ url: z.url() }) ).optional(), /** Committees or subcommittees with activity associated with the bill or resolution. */ committees: z.strictObject({ /** The number of committees with activity associated with the bill or resolution. */ count: z.number(), /** A referrer URL to the committees level of the bill API. */ url: z.url() }), /** The congress during which a bill or resolution was introduced or submitted. * View the [field values list of Congresses](https://www.congress.gov/help/field-values/congresses) on Congress.gov. * Read more [about Congresses](https://www.congress.gov/help/legislative-glossary#glossary_congress) on Congress.gov. */ congress: z.number(), /** Text extracted from the Congressional Record to accompany House Bills (HR) and House Joint Resolutions (HJRES) that cites the power granted to Congress by the Constitution to enact the proposed law, as required by Clause 7 of House Rule XII. Read more about constitutional authority statements on the House Rules Committee website. */ constitutionalAuthorityStatementText: z.string(), /** The date the bill or resolution was submitted or introduced. */ introducedDate: z.string(), /** Latest action taken by the House, Senate, or the President on the bill or resolution. */ latestAction: z.strictObject({ /** The date of the latest action taken on the bill or resolution. */ actionDate: z.string(), /** The time of the latest action taken on the bill or resolution. Certain actions taken by the House contain this element. */ actionTime: z.string().optional(), /** The text of the latest action taken on the bill or resolution. */ text: z.string() }), /** Public or private law data for the bill or joint resolution */ laws: z.array( z.strictObject({ /** The law number, as assigned by the National Archives and Records Administration (NARA). */ number: z.string(), /** The type of law. * Possible values are "Public Law" or "Private Law". * */ type: z.enum(LawType) }) ).optional(), /** The assigned bill or resolution number. */ number: z.string(), /** The chamber of origin where a bill or resolution was introduced or submitted. Possible values are "House" and "Senate". */ originChamber: z.enum(Chamber), /** **Not Documented** */ originChamberCode: z.enum(ChamberCode), /** The policy area term of the bill or resolution. Every bill and resolution is assigned one policy area term out of a controlled field values list available on Congress.gov. * Read more about policy area terms on Congress.gov. */ policyArea: z.strictObject({ /** The policy area term assigned to the bill or resolution by CRS. */ name: z.string() }), /** Related bills to the bill or resolution, as assigned by CRS, the House, and the Senate. */ relatedBills: z.strictObject({ /** The number of related bills assigned to the bill or resolution. */ count: z.number(), /** A referrer URL to the related bills level of the bill API. */ url: z.url() }), /** The sponsor of the bill or resolution. */ sponsors: z.array( z.strictObject({ /** The unique identifier for the bill or resolution sponsor, as assigned in the Biographical Directory of the United States Congress, 1774-Present. View a field values list of Bioguide identifiers for current and former members in Congress.gov. */ bioguideId: z.string(), /** The congressional district that the bill or resolution sponsor represents. Note that this element will be "0" for states, territories, or districts where there is only one congressional district. */ district: z.number(), /** The first name of the bill or resolution sponsor. */ firstName: z.string(), /** The display name of the bill or resolution sponsor. */ fullName: z.string(), /** Flag indicating if the bill or resolution was introduced at the request of the President or another entity. Possible values are "Y" or "N". */ isByRequest: z.union([z.literal("Y"), z.literal("N")]), /** The last name of the bill or resolution sponsor. */ lastName: z.string(), /** The middle name or initial of the bill or resolution sponsor. */ middleName: z.string().optional(), /** The party code of the bill or resolution sponsor. */ party: z.enum(PartyCode), /** A two-letter abbreviation for the state, territory, or district represented by the bill or resolution sponsor. */ state: z.enum(StateCode).optional(), /** A referrer URL to the member item in the API. */ url: z.url() }) ), /** Legislative subject terms assigned to the bill or resolution by CRS. */ subjects: z.strictObject({ /** The number of legislative subject terms assigned to the bill or resolution by CRS. */ count: z.number(), /** A referrer URL to the subjects level of the bill API. */ url: z.url() }), /** Bill summaries, written by CRS legislative analysts, on the bill or resolution. */ summaries: z.strictObject({ /** The number of bill summaries on the bill or resolution. */ count: z.number(), /** A referrer URL to the summaries level of the bill API. */ url: z.url() }), /** Text versions of the bill or resolution. */ textVersions: z.strictObject({ /** The number of texts for the bill or resolution. */ count: z.number(), /** A referrer URL to the text level of the bill API. */ url: z.url() }), /** The display title for the bill or resolution on Congress.gov. */ title: z.string(), /** Titles associated with the bill or resolution. */ titles: z.strictObject({ /** The number of titles associated with the bill or resolution. This number may include measure short titles, level short titles, and official titles from the House, Senate, and the Government Publishing Office (GPO). */ count: z.number(), /** A referrer URL to the titles level of the bill API */ url: z.url() }), /** The type of bill or resolution. Possible values are "HR", "S", "HJRES", "SJRES", "HCONRES", "SCONRES", "HRES", and "SRES". */ type: z.enum(BillType), /** The date of update on Congress.gov. This update date does not include updates to bill text. The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDate: z.string(), /** The date of update on Congress.gov, including if the update was to bill text.The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDateIncludingText: z.string() }); const BillSchema = BaseBillSchema.extend({ /** Amendments to the bill or resolution. */ amendments: z.strictObject({ /** The number of amendments to the bill or resolution. */ count: z.number(), /** A referrer URL to the amendments level of the bill API. */ url: z.url() }), /** Container for Congressional Budget Office (CBO) cost estimates associated with a bill or resolution. Read [about CBO](https://www.congress.gov/help/legislative-glossary#glossary_cbo) on Congress.gov. */ cboCostEstimates: z.array( z.strictObject({ /** The description of the CBO cost estimate. */ description: z.string(), /**The date the CBO cost estimate was published. */ pubDate: z.string(), /** The title of the CBO cost estimate. */ title: z.string(), /** The URL for the CBO cost estimate on [CBO.gov](https://www.cbo.gov/). */ url: z.url() }) ), /** Any cosponsors of the bill or resolution */ cosponsors: z.strictObject({ /** The current number of cosponsors of the bill or resolution, not including any withdrawn cosponsors. */ count: z.number(), /** The total number of cosponsors of the bill or resolution, including any withdrawn cosponsors. */ countIncludingWithdrawnCosponsors: z.number(), /** A referrer URL to the cosponsors level of the bill API. */ url: z.url() }), /** notes attached to the bill or resolution on Congress.gov. The note may contain supplemental information about the bill or resolution that users may find helpful. Read more [about notes](https://www.congress.gov/help/legislative-glossary#glossary_notes) on Congress.gov. */ notes: z.string().optional() }); const BillActionSchema = z.strictObject({ /** An action code associated with the action taken on a bill or resolution. The `actionCode` element will be present only for actions where the `sourceSystem` is 2 (House) or 9 (Library of Congress). [Action Codes](https://www.congress.gov/help/field-values/action-codes) is an authoritative list of values where the `sourceSystem` is 9 (Library of Congress). An authoritative list of action codes where the `sourceSystem` is 2 (House) does not exist. Various code sets are used by multiple systems in the House, Senate, and Library of Congress by legislative clerks and data editors for functions independent of this data set. As new codes and systems were developed, there was no coordinated effort to retroactively apply new codes to old records. Many codes are concatenated with other codes or elements or utilize free text. Codes in one set may be redundant with a different code in another code set. Additionally, some codes may have been used and re-used over the years for different purposes further complicating the ability to create an authoritative list. View the original code set of [U.S. Congress legislative status steps.](http://www.loc.gov/pictures/resource/ppmsca.33996/) */ actionCode: z.string().optional(), /** The date of the action taken on a bill or resolution. (e.g. 2022-03-08) */ actionDate: z.string(), /** The time of the action taken on a bill or resolution. Certain actions taken by the House contain this element. */ actionTime: z.string().optional(), /** Committees associated with the action */ committees: z.array( z.strictObject({ /** The name of the committee or subcommittee associated with the action. */ name: z.string(), /** A code associated with the committee or subcommittee used to match items in Congress.gov with the committee or subcommittee. */ systemCode: z.string(), /** A referrer URL to the committee or subcommittee item in the API. Documentation for the committee endpoint is available [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/CommitteeEndpoint.md). */ url: z.url() }) ).optional(), /** recorded (roll call) votes associated with the action. Read more about [roll call votes](https://www.congress.gov/help/legislative-glossary#glossary_rollcallvote) on Congress.gov. * More information can also be found at the [Roll Call Votes by the U.S. Congress](https://www.congress.gov/roll-call-votes) and [Votes in the House and Senate](https://www.congress.gov/help/votes-in-the-house-and-senate) pages on Congress.gov. */ recordedVotes: z.array( z.strictObject({ /** The chamber during which the recorded (roll call) vote took place. (e.g. 117) */ chamber: z.enum(Chamber), /** The congress during which the recorded (roll call) vote took place. */ congress: z.number(), /** The date of the recorded (roll call) vote. (e.g. 2022-03-08T22:45:05Z) */ date: z.string(), /** The recorded (roll call) vote number. (e.g. 70) */ rollNumber: z.number(), /** The session of congress during which the recorded (roll call) vote took place. (e.g. 2) */ sessionNumber: z.union([z.literal(1), z.literal(2)]), /** */ url: z.url() }) ).optional(), /** The source system where the action was entered */ sourceSystem: z.strictObject({ /** A code for the source system that entered the action. Possible values are "0", "1", "2", or "9". "0" is for Senate, "1" and "2" are for House, and "9" is Library of Congress. */ code: z.union([z.literal(0), z.literal(1), z.literal(2), z.literal(9)]).optional(), /** The name of the source system that entered the action. Possible values are "Senate", "House committee actions", "House floor actions", and "Library of Congress". */ name: z.enum(SourceSystemName) }), /** The text of the action taken on a bill or resolution. */ text: z.string(), /** A short name representing legislative process stages or categories of more detailed actions. Most types condense actions into sets. Some types are used for data processing and do not represent House or Senate legislative process activities. Possible values are "Committee", "Calendars", "Floor", "BecameLaw", "IntroReferral", "President", "ResolvingDifferences", "Discharge", "NotUsed", and "Veto". */ type: z.enum(BillActionType) }); const BillAmendmentSchema = z.strictObject({ /** The congress during which a bill or resolution was introduced or submitted. * View the [field values list of Congresses](https://www.congress.gov/help/field-values/congresses) on Congress.gov. * Read more [about Congresses](https://www.congress.gov/help/legislative-glossary#glossary_congress) on Congress.gov. */ congress: z.number(), /** The amendment's description. Only House amendments will have this element populated. */ description: z.string(), /** The amendment's purpose. House amendments and proposed Senate amendments may have this element populated. */ purpose: z.string().optional(), /** The latest action taken on the bill or resolution. */ latestAction: z.strictObject({ /** The date of the latest action taken on the bill or resolution. (e.g. 2022-04-06) */ actionDate: z.string(), /** The time of the latest action taken on the bill or resolution. Certain actions taken by the House contain this element. */ actionTime: z.string().optional(), /** The text of the latest action taken on the bill or resolution. (e.g. Became Public Law No: 117-108.) */ text: z.string() }), /** The assigned amendment number. (e.g. 173) */ number: z.string(), /** The type of amendment. (e.g. HAMDT) * Possible values are "HAMDT", "SAMDT", and "SUAMDT". Note that the "SUAMDT" type value is only available for the 97th and 98th Congresses. */ type: z.enum(AmendmentType), /** The date of update on Congress.gov. */ updateDate: z.string(), /** A referrer URL to the amendment item in the API. Documentation for the amendment endpoint is available [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/AmendmentEndpoint.md). (e.g. https://api.congress.gov/v3/amendment/117/hamdt/173) */ url: z.url() }); const BillCommitteeSchema = z.strictObject({ /** Committee or subcommittee activities on a bill or resolution. Read more [about committee-related activity](https://www.congress.gov/help/legislative-glossary#glossary_committeerelatedactivity) on Congress.gov. */ activities: z.array( z.strictObject({ /** The date of the committee or subcommittee activity. (e.g. 2021-05-11T18:05:45Z) */ date: z.string(), /** The name of the committee or subcommittee activity. * Possible values are "Referred to", "Re-Referred to", "Hearings by", "Markup by", "Reported by", "Reported original measure", "Committed to", "Re-Committed to", and "Legislative Interest". (e.g. Referred to) * This field may be returned as "Referred To" instead of "Referred to". * Also returns undocumented values "Discharged From" */ name: z.enum({ ...ActivityName, ...ActivityNameTypo }) }) ), /** The chamber where the committee or subcommittee operates. * Possible values are "House", "Senate", or "Joint". (e.g. House) */ chamber: z.enum(Chamber), /** The name of the committee associated with the bill or resolution. (e.g. Energy and Commerce Committee) */ name: z.string(), /** Unique ID value for the committee (e.g. hsif00) */ systemCode: z.string(), /** The type or status of the committee or subcommittee. * Possible values are "Standing", "Select", "Special", "Joint", "Task Force", "Other", "Subcommittee", or "Commission or Caucus". * (e.g. Standing) */ type: z.enum(CommitteeType), /** A referrer URL to the committee or subcommittee item in the committee API. * Documentation for the committee endpoint is available [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/CommitteeEndpoint.md). * (e.g. https://api.congress.gov/v3/committee/house/hsif00) */ url: z.url(), /** Subcommittees associated with the bill or resolution. */ subcommittees: z.array( z.strictObject({ /** The name of the subcommittee associated with the bill or resolution. */ name: z.string(), /** Unique ID value for the committee. (e.g. hsif00) */ systemCode: z.string(), /** A referrer URL to the committee or subcommittee item in the committee API. * Documentation for the committee endpoint is available [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/CommitteeEndpoint.md). * (e.g. https://api.congress.gov/v3/committee/house/hsif00) */ url: z.url(), /** Committee or subcommittee activities on a bill or resolution. Read more [about committee-related activity](https://www.congress.gov/help/legislative-glossary#glossary_committeerelatedactivity) on Congress.gov. */ activities: z.array( z.strictObject({ /** The date of the committee or subcommittee activity. (e.g. 2021-05-11T18:05:45Z) */ date: z.string(), /** The name of the committee or subcommittee activity. * Possible values are "Referred to", "Re-Referred to", "Hearings by", "Markup by", "Reported by", "Reported original measure", "Committed to", "Re-Committed to", and "Legislative Interest". (e.g. Referred to) */ name: z.string() }) ) }) ).optional() }); const BillCommitteeStandardizeSchema = BillCommitteeSchema.extend({ activities: z.array( z.strictObject({ date: z.string(), name: z.preprocess( (val) => { if (val === ActivityNameTypo.REFERRED_TO_CAPITALIZED) { return ActivityName.REFERRED_TO; } console.log(val); return val; }, z.enum(ActivityName) ) }) ) }); const BillCosponsorSchema = z.strictObject({ /** The unique identifier for the bill or resolution cosponsor, as assigned in the [Biographical Directory of the United States Congress, 1774-Present](http://bioguide.congress.gov/). * View a [field values list of Bioguide identifiers](https://www.congress.gov/help/field-values/member-bioguide-ids) for current and former members in Congress.gov. (e.g. C001078) */ bioguideId: z.string(), /** The congressional district that the bill or resolution cosponsor represents. Note that this element will be "0" for states, territories, or districts where there is only one congressional district. */ district: z.number(), /** The first name of the bill or resolution cosponsor. (e.g. Gerald) */ firstName: z.string(), /** The display name for the bill or resolution cosponsor. (e.g. Rep. Connolly, Gerald E. [D-VA-11]) */ fullName: z.string(), /** A designation that the member is an original or additional cosponsor of the bill or resolution. * If the member cosponsored the bill or resolution on the date of its introduction or submission, then this value will be "True". If the member cosponsored the bill or resolution after its date of introduction or submission, then this value will be "False". * Possible values are "True" or "False" (e.g. True) */ isOriginalCosponsor: z.boolean(), /** The last name of the bill or resolution cosponsor. (e.g. Connolly) */ lastName: z.string(), /** The middle name or initial of the bill or resolution cosponsor. (e.g. E.) */ middleName: z.string().optional(), /** The party code of the bill or resolution cosponsor. * Possible values are "D", "R", "I", "ID", and "L". (e.g. D) */ party: z.enum(PartyCode), /** The date the cosponsor withdrew their cosponsorship of the bill or resolution. */ sponsorshipDate: z.string(), /** A two-letter abbreviation for the state, territory, or district represented by the bill or resolution cosponsor. (e.g. VA) */ state: z.enum(StateCode).optional(), /** A referrer URL to the member item in the API. Documentation for the member endpoint is available [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/MemberEndpoint.md). (e.g. https://api.congress.gov/v3/member/C001078) */ url: z.url() }); const RelatedBillSchema = z.strictObject({ /** The congress during which a bill or resolution was introduced or submitted. * View the [field values list of Congresses](https://www.congress.gov/help/field-values/congresses) on Congress.gov. * Read more [about Congresses](https://www.congress.gov/help/legislative-glossary#glossary_congress) on Congress.gov. */ congress: z.number(), /** Latest action taken on the bill or resolution. */ latestAction: z.strictObject({ /** The date of the latest action taken on the bill or resolution. (e.g. 2021-05-19) */ actionDate: z.string(), /** The time of the latest action taken on the bill or resolution. Certain actions taken by the House contain this element. */ actionTime: z.string().optional(), /** The text of the latest action taken on the bill or resolution. (e.g. Read twice and referred to the Committee on Homeland Security and Governmental Affairs.) */ text: z.string() }), /** The assigned bill or resolution number for the related bill. (e.g. 1720) */ number: z.number(), /** The details on the type of relationship added by the House, Senate, or CRS */ relationshipDetails: z.array( z.strictObject({ /** The entity responsible for identifying the relationship. * Possible values are "House", "Senate", and "CRS". */ identifiedBy: z.enum(IdentifiedBy), /** The type of relationship, as designated by the House, Senate, or CRS. (e.g. Related bill) */ type: z.string() }) ), /** The display title for the related bill or resolution on Congress.gov. (e.g. Postal Service Reform Act of 2021) */ title: z.string(), /** The type of related bill or resolution. * Possible values are "HR", "S", "HJRES", "SJRES", "HCONRES", "SCONRES", "HRES", and "SRES". */ type: z.enum(BillType), /** A referrer URL to the bill item in the API. (e.g. https://api.congress.gov/v3/bill/117/s/1720) */ url: z.url() }); const BillSubjectSchema = z.strictObject({ /** Legislative subject terms attached to a bill or resolution. */ legislativeSubjects: z.array( z.strictObject({ /** The name of the legislative subject term attached to a bill or resolution. (e.g. Congressional oversight) */ name: z.string(), /** The date of update on Congress.gov. */ updateDate: z.string() }) ), /** Policy area term attached to a bill or resolution. Each bill or resolution will have only one policy area term taken from [this list of terms](https://www.congress.gov/help/field-values/policy-area) on Congress.gov. * Note that prior to the 101st Congress (1989), terms outside of the controlled list may be used as a policy area term for a bill or resolution. * Projects are underway to standardize the terms used during those congresses. * */ policyArea: z.strictObject({ /** The name of the policy area term attached to a bill or resolution. */ name: z.string(), /** The update date for the bill subject on Congress.gov. This may be the date the subject was published or re-published. The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDate: z.string().optional() }) }); const BillSummaryVersionSchema = z.strictObject({ /** The date of action associated with the bill summary. */ actionDate: z.string(), /** The description of the action associated with the bill summary. */ actionDesc: z.string(), /** The text of the bill summary. */ text: z.string(), /** The update date for the bill summary on Congress.gov. This may be the date the summary was published or re-published. The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDate: z.string(), /** The internal code used by CRS to tag its summaries according to the action associated with the summary. Click [here](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/BillEndpoint.md#bill-summary-version-codes-action-descriptions-and-chamber) for a list of codes. Note that the version codes have varied over time. */ versionCode: z.string() }); const BillTextSchema = z.strictObject({ /** The date associated with the text version. This date is associated with the date of action, not the printing date. */ date: z.string().nullable(), /** Formats of the text version. */ formats: z.array( z.strictObject({ /** The type of bill text version format. Possible values are "Formatted Text", "PDF", and "Formatted XML". Note that not all format types are available for all text versions. (e.g. Formatted XML) */ type: z.string(), /** The URL for the text version format in Congress.gov. */ url: z.url() }) ), /** The bill text version type. */ type: z.string() }); const BillTitleSchema = z.strictObject({ /** The text of the title associated with the bill or resolution. (e.g. Postal service Reform Act of 2022) */ title: z.string(), /** A short description of the type of title associated with the bill or resolution. (e.g. Short Title(s) as Passed House) */ titleType: z.string(), /** The title code for the title type. Please note that Congress.gov is transitioning from a legacy process that involved manual curation to an automated process that associates titles with bill text versions. As a result, certain title types can be duplicated. Please refer to [this list](https://github.com/LibraryOfCongress/api.congress.gov/blob/main/Documentation/BillEndpoint.md#common-title-type-version-codes-and-descriptions) of common title types. (e.g., 45) */ titleTypeCode: z.number(), /** The update date for the bill title on Congress.gov. This may be the date the title was published or re-published. The `updateDate` is the date of the last update received for the legislative entity . It’s not a date corresponding to the legislative date or legislative action date. */ updateDate: z.string(), /** The file extension code for the bill text version associated with the title. This element will not populate for all titles (e.g. a display title will never have an associated bill text version). (e.g. EH) */ billTextVersionCode: z.string().optional(), /** The name of the bill text version associated with the title. This element is not populated for all titles (e.g. a display title will never have an associated bill text version). (e.g. Engrossed in House) */ billTextVersionName: z.string().optional(), /** The chamber code associated with the title. This element is not populated for all titles (e.g. a display title will never have an associated chamber). * Possible values are "H" and "S". (e.g. H) * */ chamberCode: z.enum(ChamberCode).optional(), /** The name of the chamber associated with the title. This element is not populated for all titles (e.g. a display title will never have an associated chamber). * Possible values are "House" and "Senate". (e.g. House) */ chamberName: z.enum(Chamber).optional() }); const LawSummarySchema = BillSummarySchema.extend({ /** Public or private law data for the bill or joint resolution */ laws: z.array( z.strictObject({ /** The law number, as assigned by the National Archives and Records Administration (NARA). */ number: z.string(), /** The type of law. * Possible values are "Public Law" or "Private Law". * */ type: z.enum(LawType) }) ).optional() }); const LawSchema = BaseBillSchema.extend({ /** Public or private law data for the bill or joint resolution */ laws: z.array( z.strictObject({ /** The law number, as assigned by the National Archives and Records Administration (NARA). */ number: z.string(), /** The type of law. * Possible values are "Public Law" or "Private Law". * */ type: z.enum(LawType) }) ).optional() }); const AmendmentSummaryBaseSchema = z.strictObject({ /** The congress during which an amendment was submitted or offered. (e.g. 117) */ congress: z.number(), latestAction: z.strictObject({ /** The date of the latest action taken on the amendment. (e.g. 2021-08-08) */ actionDate: z.iso.date(), /** The text of the latest action taken on the amendment. (e.g. Amendment SA 2137 agreed to in Senate by Yea-Nay Vote. 69 - 28. Record Vote Number: 312.) */ text: z.string(), /** The time of the latest action taken on the amendment. * Certain actions taken by the House contain this element. */ actionTime: z.iso.time().optional() }).optional(), /** The assigned amendment number. (e.g. 2137) */ number: z.string(), /** The amendment's purpose. (e.g. In the nature of a substitute.) * House amendments and proposed Senate amendments may have this element populated. */ purpose: z.string().optional(), /** The type of amendment. (e.g. SAMDT) * Possible values are "HAMDT", "SAMDT", and "SUAMDT". * Note that the "SUAMDT" type value is only available for the 97th and 98th Congresses. */ type: z.enum(AmendmentType), /** The referrer URL to the amendment item in the API. */ url: z.url(), /** The date of update in Congress.gov. (e.g., 2022-06-30T03:50:22Z) */ updateDate: z.iso.datetime() }); const amendmentTypeEnum = z.enum(AmendmentType); const AmendmentSummarySchema = z.discriminatedUnion("type", [ z.object({ ...AmendmentSummaryBaseSchema.shape, /** The amendment's description. Only House amendments will have this element populated. */ description: z.string(), type: amendmentTypeEnum.extract([AmendmentType.HAMDT]) }), z.strictObject({ ...AmendmentSummaryBaseSchema.shape, type: amendmentTypeEnum.extract([AmendmentType.SAMDT]) }), z.strictObject({ ...AmendmentSummaryBaseSchema.shape, type: amendmentTypeEnum.extract([AmendmentType.SUAMDT]) }) ]); const AmendmentDetailBaseSchema = z.strictObject({ ...AmendmentSummaryBaseSchema.shape, /** the latest action taken on the amendment */ latestAction: z.strictObject({ /** The date of the latest action taken on the amendment. (e.g. 2021-08-08) */ actionDate: z.iso.date(), /** The text of the latest action taken on the amendment. (e.g. Amendment SA 2137 agreed to in Senate by Yea-Nay Vote. 69 - 28. Record Vote Number: 312.) */ text: z.string(), /** The time of the latest action taken on the amendment. * Certain actions taken by the House contain this element. */ actionTime: z.iso.time().optional(), /** ** Not documented** */ links: z.array( z.strictObject({ url: z.string(), name: z.string() }) ) }).optional(), /** */ actions: z.strictObject({ /** The number of actions on the amendment. A count element may include actions from the House, Senate, and Library of Congress. */ count: z.number(), /** A referrer URL to the actions level of the amendment */ url: z.url() }), /** The sponsor of the amendment. */ sponsors: z.array( z.strictObject({ /** The unique identifier for the amendment's sponsor, as assigned in the [Biographical Directory of the United States Congress, 1774-Present](https://bioguide.congress.gov/). * View a [field values list of Bioguide identifiers](https://www.congress.gov/help/field-values/member-bioguide-ids) for current and former members in Congress.gov. */ bioguideId: