export type CreateApiApiV1IndexSeedLargeArgs = {count: string}; export type CreateApiApiV1IndexSeedLargeOptions = {baseUrl: string, LocalUserJWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * 🛡️ Seed the index with millions of mock music files. * * POST /api/v1/index/seed/large */ export const createApiApiV1IndexSeedLarge = async (args: CreateApiApiV1IndexSeedLargeArgs, options: CreateApiApiV1IndexSeedLargeOptions) => { const {baseUrl, fetch: fetchFn = fetch, LocalUserJWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.count != null) query.append("count", String(args.count)) if (LocalUserJWT !== undefined) headers.set('authorization', `Bearer ${LocalUserJWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/index/seed/large${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 };