export type CreateApiV1HivesliceJobsArgs = {body: {organizationId?: string | undefined, slicer: 'bambu_studio' | 'orca_slicer', inputFileIds: Array, printerProfileId: string, filamentProfileId: string, processProfileId: string, transforms?: ({scale?: number | undefined, rotate?: number | undefined, rotateX?: number | undefined, rotateY?: number | undefined, arrange?: boolean | undefined, orient?: boolean | undefined, centerX?: number | undefined, centerY?: number | undefined, repetitions?: number | undefined}) | undefined}}; export type CreateApiV1HivesliceJobsOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a slice job * * POST /v1/hiveslice/jobs */ export const createApiV1HivesliceJobs = async (args: CreateApiV1HivesliceJobsArgs, options?: CreateApiV1HivesliceJobsOptions) => { const {baseUrl = "https://api.printhiv3d.com", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/hiveslice/jobs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };