export type GetApiLeadsforgeEnrichmentJobsArgs = {offset?: number | undefined, limit?: number | undefined, status?: string | undefined, type?: string | undefined, clientRequestID?: string | undefined, from?: string | undefined, to?: string | undefined}; export type GetApiLeadsforgeEnrichmentJobsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List enrichment jobs with optional filtering. * * GET /leadsforge/enrichment/jobs */ export const getApiLeadsforgeEnrichmentJobs = async (args: GetApiLeadsforgeEnrichmentJobsArgs, options?: GetApiLeadsforgeEnrichmentJobsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.offset != null) query.append("offset", String(args.offset)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.status != null) query.append("status", String(args.status)) if (args.type != null) query.append("type", String(args.type)) if (args.clientRequestID != null) query.append("clientRequestID", String(args.clientRequestID)) if (args.from != null) query.append("from", String(args.from)) if (args.to != null) query.append("to", String(args.to)) const url = `${baseUrl.replace(/\/+$/, '')}/leadsforge/enrichment/jobs${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 };