export type CreateApiApiV1MarketplaceSlugEndUserScreenshotArgs = {slug: string, body: BodyInit}; export type CreateApiApiV1MarketplaceSlugEndUserScreenshotOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Adds a document to a content section for a community app. * * POST /api/v1/marketplace/{slug}/end-user/screenshot */ export const createApiApiV1MarketplaceSlugEndUserScreenshot = async (args: CreateApiApiV1MarketplaceSlugEndUserScreenshotArgs, options: CreateApiApiV1MarketplaceSlugEndUserScreenshotOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/marketplace/${encodeURIComponent(String(args.slug))}/end-user/screenshot${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };