export type GetApiApiCareersJobPostingsArgs = {jobTitle?: ({op?: ('contains' | 'does_not_contain' | 'starts_with' | 'ends_with' | 'is' | 'is_not' | 'is_empty' | 'is_not_empty') | undefined, q?: string | undefined}) | undefined, page?: number | undefined, limit?: number | undefined, order?: ('asc' | 'desc') | undefined, orderBy?: ('id' | 'updatedAt') | undefined}; export type GetApiApiCareersJobPostingsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * GET /api/careers/job-postings */ export const getApiApiCareersJobPostings = async (args: GetApiApiCareersJobPostingsArgs, options: GetApiApiCareersJobPostingsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.jobTitle != null) query.append("jobTitle", JSON.stringify(args.jobTitle)) if (args.page != null) query.append("page", String(args.page)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.order != null) query.append("order", String(args.order)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) const url = `${baseUrl.replace(/\/+$/, '')}/api/careers/job-postings${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };