export type ArtifactFamily = 'anaconda_project' | 'anaconda_env' | 'cve' | 'conda' | 'python' | 'cran' | 'notebook' | 'docker' | 'sbom'; export type UpdateApiChannelsChannelNameArtifactsArtifactFamilyArgs = {channel_name: string, artifact_family: ArtifactFamily}; export type UpdateApiChannelsChannelNameArtifactsArtifactFamilyOptions = {baseUrl?: string | undefined, jwt?: string | undefined, fetch?: typeof fetch | undefined}; /** * Refreshes the index for specific artifact family in the channel * * PUT /channels/{channel_name}/artifacts/{artifact_family} * * Also accepts auth: user_token */ export const updateApiChannelsChannelNameArtifactsArtifactFamily = async (args: UpdateApiChannelsChannelNameArtifactsArtifactFamilyArgs, options?: UpdateApiChannelsChannelNameArtifactsArtifactFamilyOptions) => { const {baseUrl = "https://api.anaconda.cloud/api", fetch: fetchFn = fetch, jwt} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (jwt !== undefined) headers.set('authorization', `Bearer ${jwt}`) const url = `${baseUrl.replace(/\/+$/, '')}/channels/${encodeURIComponent(String(args.channel_name))}/artifacts/${encodeURIComponent(String(args.artifact_family))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };