export type CreateApiV1ShopsShopIdWhitelistArgs = {body: {value: string, type: 'email' | 'email_domain' | 'discord_id' | 'country_code' | 'city' | 'ip' | 'ip_range' | 'isp' | 'asn' | 'user_agent', reason?: (string | null) | undefined, payment_method_ids?: (Array) | undefined, enabled?: boolean | undefined, active_from?: (string | null) | undefined, active_to?: (string | null) | undefined}}; export type CreateApiV1ShopsShopIdWhitelistOptions = {baseUrl?: string | undefined, defaultValue?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create Whitelist Entry * * POST /v1/shops/{shopId}/whitelist */ export const createApiV1ShopsShopIdWhitelist = async (args: CreateApiV1ShopsShopIdWhitelistArgs, options?: CreateApiV1ShopsShopIdWhitelistOptions) => { const {baseUrl = "https://api.sellauth.com", fetch: fetchFn = fetch, defaultValue} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (defaultValue !== undefined) headers.set('authorization', `Bearer ${defaultValue}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/shops/${encodeURIComponent(String(args.shopId))}/whitelist${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 undefined };