export type DeleteApiAliasCatalogSkusSkuIdStocksIdArgs = {alias: string, skuId: number, id: number}; export type DeleteApiAliasCatalogSkusSkuIdStocksIdOptions = {baseUrl?: string | undefined, ApiToken?: string | undefined, ApiSecretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Excluir estoque de um SKU * * DELETE /{alias}/catalog/skus/{skuId}/stocks/{id} */ export const deleteApiAliasCatalogSkusSkuIdStocksId = async (args: DeleteApiAliasCatalogSkusSkuIdStocksIdArgs, options?: DeleteApiAliasCatalogSkusSkuIdStocksIdOptions) => { const {baseUrl = "https://api.dooki.com.br/v2", fetch: fetchFn = fetch, ApiToken, ApiSecretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiToken !== undefined) headers.set("User-Token", ApiToken) if (ApiSecretKey !== undefined) headers.set("User-Secret-Key", ApiSecretKey) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.alias))}/catalog/skus/${encodeURIComponent(String(args.skuId))}/stocks/${encodeURIComponent(String(args.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 };