UNPKG

@commercelayer/sdk-utils

Version:
28 lines (25 loc) 1.3 kB
import { Resource, ListableResourceType, QueryParamsList, ListResponse, ResourceUpdate, UpdatableResourceType, ApiError, DeletableResourceType } from '@commercelayer/sdk'; type AllParams = Omit<QueryParamsList, 'pageSize' | 'pageNumber' | 'sort'>; declare const retrieveAll: <R extends Resource>(resourceType: ListableResourceType, params?: AllParams & { limit?: number; }) => Promise<ListResponse<R>>; type UpdateResult = { total: number; processed: number; errors: number; resources: Record<string, { success: boolean; error?: ApiError; errorMessage?: string; }>; }; declare const updateAll: <U extends Omit<ResourceUpdate, "id">>(resourceType: UpdatableResourceType, resource: U, params?: AllParams) => Promise<UpdateResult>; type DeleteResult = UpdateResult; declare const deleteAll: (resourceType: DeletableResourceType, params?: AllParams) => Promise<DeleteResult>; declare const all: { retrieveAll: <R extends Resource>(resourceType: ListableResourceType, params?: AllParams & { limit?: number; }) => Promise<ListResponse<R>>; updateAll: <U extends Omit<ResourceUpdate, "id">>(resourceType: UpdatableResourceType, resource: U, params?: AllParams) => Promise<UpdateResult>; }; export { all, deleteAll, retrieveAll, updateAll };