export type AdminInsertProductRequest = {env_desc?: string | undefined, env_icon?: string | undefined, env_ttl?: string | undefined, id_proj?: number | undefined, img_bg_prod?: string | undefined, img_mobile_bg_prod?: string | undefined, img_thumbnail_prod?: string | undefined, minimum_buy_vol?: number | undefined, productDetailImageUrls?: Array | undefined, productNameEn?: string | undefined, productNameKr?: string | undefined, productStoryEn?: string | undefined, productStoryKo?: string | undefined, unit_price?: number | undefined, vol?: number | undefined}; export type CreateApiBapiV1ProductArgs = {body: AdminInsertProductRequest}; export type CreateApiBapiV1ProductOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * product 등록 * * POST /bapi/v1/product */ export const createApiBapiV1Product = async (args: CreateApiBapiV1ProductArgs, options?: CreateApiBapiV1ProductOptions) => { const {baseUrl = "https://api.wincl.io:443", 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(/\/+$/, '')}/bapi/v1/product${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() };