export type RegistSheetNoDTO = {userId?: string | undefined, tcCode?: string | undefined, sheetNo?: string | undefined, tag?: string | undefined, mallCode?: string | undefined, mallName?: string | undefined}; export type RegistSheetNoRequestDTO = {snfCode?: string | undefined, rows?: Array | undefined}; export type CreateApiIntfSnfRegistSheetNoArgs = {body: RegistSheetNoRequestDTO}; export type CreateApiIntfSnfRegistSheetNoOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * SNF 운송장 자동등록 * * POST /intf/snf/registSheetNo */ export const createApiIntfSnfRegistSheetNo = async (args: CreateApiIntfSnfRegistSheetNoArgs, options: CreateApiIntfSnfRegistSheetNoOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (ApiKey !== undefined) headers.set("Authorization", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/intf/snf/registSheetNo${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() };