export type GetApiIntfSnfSyncUserArgs = {snfCode: string, limit?: number | undefined, lastTimestamp?: number | undefined}; export type GetApiIntfSnfSyncUserOptions = {baseUrl: string, ApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * SNF 사용자 동기화 대상 목록 조회 * * GET /intf/snf/syncUser */ export const getApiIntfSnfSyncUser = async (args: GetApiIntfSnfSyncUserArgs, options: GetApiIntfSnfSyncUserOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.snfCode != null) query.append("snfCode", String(args.snfCode)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.lastTimestamp != null) query.append("lastTimestamp", String(args.lastTimestamp)) if (ApiKey !== undefined) headers.set("Authorization", ApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/intf/snf/syncUser${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() };