UNPKG

architect-sdk

Version:

Essentialz Architect SDK

18 lines (17 loc) 1.01 kB
import { HttpClientInterface } from '../http'; import { ArchitectResourceFetchOptions, ArchitectResourceService, InnerType } from './types'; import { TokenManagerInterface } from '../auth/token'; export declare class ResourceService<T> implements ArchitectResourceService<T> { protected readonly resourceName: string; protected httpClient: HttpClientInterface; protected tokenManager: TokenManagerInterface; constructor(resourceName: string, httpClient: HttpClientInterface, tokenManager: TokenManagerInterface); getAll(options?: ArchitectResourceFetchOptions): Promise<InnerType<T>[]>; search(query: Record<string, any> | string, options?: ArchitectResourceFetchOptions): Promise<InnerType<T>[]>; get(id: string): Promise<InnerType<T>>; create(body: Record<string, any>): Promise<InnerType<T>>; update(id: string, body: Record<string, any>): Promise<InnerType<T>>; delete(id: string): Promise<any>; protected getResourceUrl(id?: string): string; private getInit; }