export type CreateApiApiBundlePublisherPublishArgs = {type?: string | undefined, callback?: string | undefined, FORCE_PUSH?: boolean | undefined, filterkey?: string | undefined}; export type CreateApiApiBundlePublisherPublishOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * POST /api/bundlePublisher/publish */ export const createApiApiBundlePublisherPublish = async (args: CreateApiApiBundlePublisherPublishArgs, options: CreateApiApiBundlePublisherPublishOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.type != null) query.append("type", String(args.type)) if (args.callback != null) query.append("callback", String(args.callback)) if (args.FORCE_PUSH != null) query.append("FORCE_PUSH", String(args.FORCE_PUSH)) if (args.filterkey != null) query.append("filterkey", String(args.filterkey)) const url = `${baseUrl.replace(/\/+$/, '')}/api/bundlePublisher/publish${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 (await res.json()) as unknown };