UNPKG

@studyportals/sp-hs-misc

Version:

Miscellaneous code used in HouseStark's projects

26 lines (25 loc) 1.09 kB
/** * Implements the necessary functionality to query the ServiceLayer. */ export interface IServiceLayerClient { /** * Carries out an uncached GET request to the specified path, relative to * the ServiceLayer's base URL, and normalizes the output so that * if an object that indexes the entities by ID is provided, the entities * are extracted into an array and if an array is provided, the received * array is returned. * * @param path The path that is to be queried, relative to the ServiceLayer's base URL. */ get(path: string): Promise<any[]>; /** * Carries out a cached GET request to the specified path, relative to * the ServiceLayer's base URL, and normalizes the output so that * if an object that indexes the entities by ID is provided, the entities * are extracted into an array and if an array is provided, the received * array is returned. * * @param path The path that is to be queried, relative to the ServiceLayer's base URL. */ getCached(path: string): Promise<any[]>; }