propublica-nonprofit-explorer-sdk
Version:
SDK for ProPublica Nonprofit Explorer API
137 lines (136 loc) • 4.77 kB
TypeScript
import { z } from 'zod';
export declare const SearchRequestSchema: z.ZodObject<{
q: z.ZodOptional<z.ZodString>;
page: z.ZodOptional<z.ZodNumber>;
'state[id]': z.ZodOptional<z.ZodEnum<{
readonly ALABAMA: "AL";
readonly ALASKA: "AK";
readonly ARIZONA: "AZ";
readonly ARKANSAS: "AR";
readonly CALIFORNIA: "CA";
readonly COLORADO: "CO";
readonly CONNECTICUT: "CT";
readonly DELAWARE: "DE";
readonly FLORIDA: "FL";
readonly GEORGIA: "GA";
readonly HAWAII: "HI";
readonly IDAHO: "ID";
readonly ILLINOIS: "IL";
readonly INDIANA: "IN";
readonly IOWA: "IA";
readonly KANSAS: "KS";
readonly KENTUCKY: "KY";
readonly LOUISIANA: "LA";
readonly MAINE: "ME";
readonly MARYLAND: "MD";
readonly MASSACHUSETTS: "MA";
readonly MICHIGAN: "MI";
readonly MINNESOTA: "MN";
readonly MISSISSIPPI: "MS";
readonly MISSOURI: "MO";
readonly MONTANA: "MT";
readonly NEBRASKA: "NE";
readonly NEVADA: "NV";
readonly NEW_HAMPSHIRE: "NH";
readonly NEW_JERSEY: "NJ";
readonly NEW_MEXICO: "NM";
readonly NEW_YORK: "NY";
readonly NORTH_CAROLINA: "NC";
readonly NORTH_DAKOTA: "ND";
readonly OHIO: "OH";
readonly OKLAHOMA: "OK";
readonly OREGON: "OR";
readonly PENNSYLVANIA: "PA";
readonly RHODE_ISLAND: "RI";
readonly SOUTH_CAROLINA: "SC";
readonly SOUTH_DAKOTA: "SD";
readonly TENNESSEE: "TN";
readonly TEXAS: "TX";
readonly UTAH: "UT";
readonly VERMONT: "VT";
readonly VIRGINIA: "VA";
readonly WASHINGTON: "WA";
readonly WEST_VIRGINIA: "WV";
readonly WISCONSIN: "WI";
readonly WYOMING: "WY";
}>>;
'ntee[id]': z.ZodOptional<z.ZodEnum<{
readonly ARTS_CULTURE_HUMANITIES: 1;
readonly EDUCATION: 2;
readonly ENVIRONMENT_ANIMAL_WELFARE: 3;
readonly HEALTH: 4;
readonly HUMAN_SERVICES: 5;
readonly INTERNATIONAL_FOREIGN_AFFAIRS: 6;
readonly PUBLIC_SOCIETAL_BENEFIT: 7;
readonly RELIGION_RELATED: 8;
readonly MUTUAL_MEMBERSHIP_BENEFIT: 9;
readonly UNKNOWN_UNCLASSIFIED: 10;
}>>;
'c_code[id]': z.ZodOptional<z.ZodEnum<{
readonly '501(c)(2)': 2;
readonly '501(c)(3)': 3;
readonly '501(c)(4)': 4;
readonly '501(c)(5)': 5;
readonly '501(c)(6)': 6;
readonly '501(c)(7)': 7;
readonly '501(c)(8)': 8;
readonly '501(c)(9)': 9;
readonly '501(c)(10)': 10;
readonly '501(c)(11)': 11;
readonly '501(c)(12)': 12;
readonly '501(c)(13)': 13;
readonly '501(c)(14)': 14;
readonly '501(c)(15)': 15;
readonly '501(c)(16)': 16;
readonly '501(c)(17)': 17;
readonly '501(c)(18)': 18;
readonly '501(c)(19)': 19;
readonly '501(c)(21)': 21;
readonly '501(c)(22)': 22;
readonly '501(c)(23)': 23;
readonly '501(c)(25)': 25;
readonly '501(c)(26)': 26;
readonly '501(c)(27)': 27;
readonly '501(c)(28)': 28;
readonly '4947(a)(1)': 92;
}>>;
}, z.core.$strip>;
/**
* Search request parameters
*/
export type ISearchRequest = z.infer<typeof SearchRequestSchema>;
export declare const SearchResponseSchema: z.ZodObject<{
total_results: z.ZodNumber;
num_pages: z.ZodNumber;
cur_page: z.ZodNumber;
per_page: z.ZodNumber;
page_offset: z.ZodNumber;
search_query: z.ZodNullable<z.ZodString>;
selected_state: z.ZodNullable<z.ZodString>;
selected_ntee: z.ZodNullable<z.ZodString>;
selected_code: z.ZodNullable<z.ZodString>;
data_source: z.ZodString;
api_version: z.ZodNumber;
organizations: z.ZodArray<z.ZodObject<{
ein: z.ZodNumber;
strein: z.ZodString;
name: z.ZodString;
sub_name: z.ZodNullable<z.ZodString>;
city: z.ZodString;
state: z.ZodString;
ntee_code: z.ZodNullable<z.ZodString>;
raw_ntee_code: z.ZodNullable<z.ZodString>;
subseccd: z.ZodNumber;
has_subseccd: z.ZodBoolean;
have_filings: z.ZodNullable<z.ZodBoolean>;
have_extracts: z.ZodNullable<z.ZodBoolean>;
have_pdfs: z.ZodNullable<z.ZodBoolean>;
score: z.ZodNumber;
}, z.core.$strip>>;
}, z.core.$strip>;
/**
* Search response object
*/
export type ISearchResponse = z.infer<typeof SearchResponseSchema>;
export declare function validateSearchResponse(response: ISearchResponse): ISearchResponse;
export declare function validateSearchRequest(request: unknown): z.infer<typeof SearchRequestSchema>;