export type GetApiBapiV3RewardsCompaniesArgs = {keyword?: string | undefined, orderBy?: string | undefined, pageNo?: number | undefined, pageSize?: number | undefined, regFrom?: string | undefined, regTo?: string | undefined}; export type GetApiBapiV3RewardsCompaniesOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * 리워드 기업 목록 조회 (검색/필터/페이징) * * GET /bapi/v3/rewards/companies */ export const getApiBapiV3RewardsCompanies = async (args: GetApiBapiV3RewardsCompaniesArgs, options?: GetApiBapiV3RewardsCompaniesOptions) => { const {baseUrl = "https://api.wincl.io:443", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.keyword != null) query.append("keyword", String(args.keyword)) if (args.orderBy != null) query.append("orderBy", String(args.orderBy)) if (args.pageNo != null) query.append("pageNo", String(args.pageNo)) if (args.pageSize != null) query.append("pageSize", String(args.pageSize)) if (args.regFrom != null) query.append("regFrom", String(args.regFrom)) if (args.regTo != null) query.append("regTo", String(args.regTo)) if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/bapi/v3/rewards/companies${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() };