UNPKG

@vepler/schools-types

Version:

TypeScript type definitions for Vepler Schools Service

74 lines (73 loc) 1.82 kB
/** * Schools Endpoint Types * * Type definitions for the /schools API endpoint. */ import { ISchool } from '../../models/school'; import { PaginationMeta, AreaFilter, ArrayApiResponse } from '../common'; /** * Input parameters for the /schools POST endpoint */ export interface SchoolsQueryParams { /** * Page number for pagination * @minimum 1 * @default 1 */ page?: number; /** * Number of results per page * @minimum 1 * @maximum 100 * @default 20 */ limit?: number; /** * Field to sort results by * @example "name" * @example "-name" (descending order) */ sort?: string; /** * Comma-separated list of fields to include in the response * @example "name,type,rating" */ fields?: string; /** * Search for schools by name (partial match) */ name?: string; /** * Filter by Unique Reference Number */ urn?: number; /** * Filter by URL-friendly slug */ slug?: string; /** * Array of area filters to apply (point, polygon, multipolygon, bbox, or entity) * Schools matching ANY of the area filters will be included in results */ area?: AreaFilter[]; /** * Advanced filtering expression * @example "type=primary,status=open" */ filter?: string; } /** * Response data for the /schools POST endpoint * The result field directly contains the array of schools */ export type SchoolsResponseData = ISchool[]; /** * Complete response for the /schools POST endpoint * with pagination metadata alongside the array response */ export interface SchoolsResponse extends ArrayApiResponse<SchoolsResponseData> { /** * Pagination metadata for the schools response */ pagination: PaginationMeta; }