export type CreateApiImportmanagerMasseditTypedIdArgs = {body: {data?: ({filterCriteria?: ({_constructor?: string | undefined, operator?: string | undefined, criteria?: (Array<{fieldName?: string | undefined, operator?: string | undefined, value?: Array | undefined, _constructor?: string | undefined}>) | undefined}) | undefined, massEditRecords?: (Array<{fieldName?: string | undefined, massEditOperator?: string | undefined, fieldValue?: string | undefined, precision?: number | undefined}>) | undefined}) | undefined}}; export type CreateApiImportmanagerMasseditTypedIdOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Mass Edit Imports * * POST /importmanager.massedit/{typedId} * * Also accepts auth: X-PriceFx-jwt */ export const createApiImportmanagerMasseditTypedId = async (args: CreateApiImportmanagerMasseditTypedIdArgs, options?: CreateApiImportmanagerMasseditTypedIdOptions) => { const {baseUrl = "https://companynode.pricefx.com/pricefx/companypartition", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/importmanager.massedit/${encodeURIComponent(String(args.typedId))}${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 };