export type CreateApiV1CreatorPlaylistsIdRefreshArgs = {id: string}; export type CreateApiV1CreatorPlaylistsIdRefreshOptions = {baseUrl: string, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/creator/playlists/{id}/refresh */ export const createApiV1CreatorPlaylistsIdRefresh = async (args: CreateApiV1CreatorPlaylistsIdRefreshArgs, options: CreateApiV1CreatorPlaylistsIdRefreshOptions) => { const {baseUrl, fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/creator/playlists/${encodeURIComponent(String(args.id))}/refresh${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 };