export type CreateApiV6FilesFileIdExpireArgs = {fileId: string}; export type CreateApiV6FilesFileIdExpireOptions = {baseUrl?: string | undefined, HEADER?: string | undefined, fetch?: typeof fetch | undefined}; /** * Expire a file asset * * POST /v6/files/{fileId}/expire * * Also accepts auth: QUERY, COOKIE */ export const createApiV6FilesFileIdExpire = async (args: CreateApiV6FilesFileIdExpireArgs, options?: CreateApiV6FilesFileIdExpireOptions) => { const {baseUrl = "https://api.extole.io", fetch: fetchFn = fetch, HEADER} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HEADER !== undefined) headers.set("Authorization", HEADER) const url = `${baseUrl.replace(/\/+$/, '')}/v6/files/${encodeURIComponent(String(args.fileId))}/expire${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };