export type ImageDeleteWS = {productRefId: string, uploadType: 'PROFILE_LOGO' | 'MYAPPS_LOGO' | 'LISTING_LOGO' | 'LISTING_AND_MYAPPS_LOGO' | 'OVERVIEW' | 'SCREENSHOT' | 'FEATURE', locale: string, pathToDelete: string}; export type CreateApiProductsV1ResourcesImageDeleteArgs = {body: ImageDeleteWS}; export type CreateApiProductsV1ResourcesImageDeleteOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete image from product * * POST /products/v1/resources/image/delete */ export const createApiProductsV1ResourcesImageDelete = async (args: CreateApiProductsV1ResourcesImageDeleteArgs, options?: CreateApiProductsV1ResourcesImageDeleteOptions) => { const {baseUrl = "https://marketplace.appdirect.com/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/products/v1/resources/image/delete${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };