UNPKG

propublica-nonprofit-explorer-sdk

Version:
228 lines (227 loc) 8.32 kB
import { z } from 'zod'; import { ISearchResponse } from './search'; 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; }, "strip", z.ZodTypeAny, { name: string; state: string; ein: number; subseccd: number; city: string; ntee_code: string | null; have_extracts: boolean | null; have_pdfs: boolean | null; strein: string; sub_name: string | null; raw_ntee_code: string | null; has_subseccd: boolean; have_filings: boolean | null; score: number; }, { name: string; state: string; ein: number; subseccd: number; city: string; ntee_code: string | null; have_extracts: boolean | null; have_pdfs: boolean | null; strein: string; sub_name: string | null; raw_ntee_code: string | null; has_subseccd: boolean; have_filings: boolean | null; score: number; }>, "many">; }, "strip", z.ZodTypeAny, { data_source: string; api_version: number; total_results: number; num_pages: number; cur_page: number; per_page: number; page_offset: number; search_query: string | null; selected_state: string | null; selected_ntee: string | null; selected_code: string | null; organizations: { name: string; state: string; ein: number; subseccd: number; city: string; ntee_code: string | null; have_extracts: boolean | null; have_pdfs: boolean | null; strein: string; sub_name: string | null; raw_ntee_code: string | null; has_subseccd: boolean; have_filings: boolean | null; score: number; }[]; }, { data_source: string; api_version: number; total_results: number; num_pages: number; cur_page: number; per_page: number; page_offset: number; search_query: string | null; selected_state: string | null; selected_ntee: string | null; selected_code: string | null; organizations: { name: string; state: string; ein: number; subseccd: number; city: string; ntee_code: string | null; have_extracts: boolean | null; have_pdfs: boolean | null; strein: string; sub_name: string | null; raw_ntee_code: string | null; has_subseccd: boolean; have_filings: boolean | null; score: number; }[]; }>; export declare const SearchRequestSchema: z.ZodObject<{ q: z.ZodOptional<z.ZodString>; page: z.ZodOptional<z.ZodNumber>; 'state[id]': z.ZodOptional<z.ZodNativeEnum<{ 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.ZodNativeEnum<{ 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.ZodNativeEnum<{ 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; }>>; }, "strip", z.ZodTypeAny, { page?: number | undefined; q?: string | undefined; 'state[id]'?: "AL" | "AK" | "AZ" | "AR" | "CA" | "CO" | "CT" | "DE" | "FL" | "GA" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VA" | "WA" | "WV" | "WI" | "WY" | undefined; 'ntee[id]'?: 2 | 1 | 3 | 4 | 8 | 5 | 6 | 10 | 7 | 9 | undefined; 'c_code[id]'?: 2 | 3 | 4 | 8 | 16 | 5 | 6 | 10 | 7 | 12 | 11 | 14 | 9 | 13 | 15 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 92 | undefined; }, { page?: number | undefined; q?: string | undefined; 'state[id]'?: "AL" | "AK" | "AZ" | "AR" | "CA" | "CO" | "CT" | "DE" | "FL" | "GA" | "HI" | "ID" | "IL" | "IN" | "IA" | "KS" | "KY" | "LA" | "ME" | "MD" | "MA" | "MI" | "MN" | "MS" | "MO" | "MT" | "NE" | "NV" | "NH" | "NJ" | "NM" | "NY" | "NC" | "ND" | "OH" | "OK" | "OR" | "PA" | "RI" | "SC" | "SD" | "TN" | "TX" | "UT" | "VT" | "VA" | "WA" | "WV" | "WI" | "WY" | undefined; 'ntee[id]'?: 2 | 1 | 3 | 4 | 8 | 5 | 6 | 10 | 7 | 9 | undefined; 'c_code[id]'?: 2 | 3 | 4 | 8 | 16 | 5 | 6 | 10 | 7 | 12 | 11 | 14 | 9 | 13 | 15 | 17 | 18 | 19 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 92 | undefined; }>; export declare function validateSearchResponse(response: ISearchResponse): ISearchResponse; export declare function validateSearchRequest(request: unknown): z.infer<typeof SearchRequestSchema>;