export type DeleteApiV1FilesMissingStoragesStorageIdArgs = {'App-ID': string, 'Auth-Token': string, storage_id: string, remove_assets?: boolean | undefined}; export type DeleteApiV1FilesMissingStoragesStorageIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete all missing files from storage * * DELETE /v1/files/missing/storages/{storage_id}/ */ export const deleteApiV1FilesMissingStoragesStorageId = async (args: DeleteApiV1FilesMissingStoragesStorageIdArgs, options: DeleteApiV1FilesMissingStoragesStorageIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.remove_assets != null) query.append("remove_assets", String(args.remove_assets)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/files/missing/storages/${encodeURIComponent(String(args.storage_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };