export type UpsertProductPosMapping = {blaze_asset_id?: string | undefined, blaze_product_id?: string | undefined, blaze_retailer_id?: string | undefined, dutchie_product_id?: number | undefined, dutchie_retailer_id?: string | undefined, product_id: string, treez_photo_url?: string | undefined, treez_product_id?: string | undefined, treez_retailer_id?: number | undefined}; export type CreateApiPublicV1ProductPosMappingsArgs = {body: UpsertProductPosMapping}; export type CreateApiPublicV1ProductPosMappingsOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create or update a product POS mapping * * POST /public/v1/product-pos-mappings */ export const createApiPublicV1ProductPosMappings = async (args: CreateApiPublicV1ProductPosMappingsArgs, options?: CreateApiPublicV1ProductPosMappingsOptions) => { const {baseUrl = "https://app.distru.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/product-pos-mappings${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 res.blob() };