export type GetApiXmlCustomerSubdomainLuccaXmlArgs = {customer_subdomain: string}; export type GetApiXmlCustomerSubdomainLuccaXmlOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * List active job offers * * GET /xml/{customer_subdomain}/lucca.xml */ export const getApiXmlCustomerSubdomainLuccaXml = async (args: GetApiXmlCustomerSubdomainLuccaXmlArgs, options?: GetApiXmlCustomerSubdomainLuccaXmlOptions) => { const {baseUrl = "https://example.ilucca.net", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/xml") const url = `${baseUrl.replace(/\/+$/, '')}/xml/${encodeURIComponent(String(args.customer_subdomain))}/lucca.xml${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 res.blob() };