export type GetApiApplicationDetailedSearchArgs = {Authorization: string, merchantBranches: Array, terms?: Array | undefined, statuses?: (Array<'IN_PROGRESS' | 'CANCEL' | 'SUCCESS'>) | undefined, states?: (Array<'CREATED' | 'IDENTIFIED' | 'IDENTIFICATION_BLOCKED' | 'FACEMATCH_PENDING' | 'FACEMATCH_FAILED' | 'FACEMATCH_BLOCKED' | 'DENIAL_BY_STOP_FACTOR' | 'DENIAL_BY_SHOP' | 'DENIAL_BY_CUSTOMER' | 'DENIAL_BY_SCORING' | 'DENIAL_BY_DISTRIBUTION' | 'CONFIRMED' | 'ACCEPTED' | 'AGREED' | 'TIMEOUT' | 'REQUEST_FAILED' | 'SIGNED' | 'SIGNED_FINISHED' | 'SIGNING_FAILED' | 'FINISHED' | 'FINALIZATION_BLOCKED' | 'OFFER_CHOSEN'>) | undefined, createdAfter?: number | undefined, createdBefore?: number | undefined, startFrom?: number | undefined, totalCount?: number | undefined}; export type GetApiApplicationDetailedSearchOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /application/detailed/search */ export const getApiApplicationDetailedSearch = async (args: GetApiApplicationDetailedSearchArgs, options?: GetApiApplicationDetailedSearchOptions) => { const {baseUrl = "https://api.velox.am", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) for (const item of args.merchantBranches ?? []) query.append("merchantBranches", String(item)) for (const item of args.terms ?? []) query.append("terms", String(item)) for (const item of args.statuses ?? []) query.append("statuses", String(item)) for (const item of args.states ?? []) query.append("states", String(item)) if (args.createdAfter != null) query.append("createdAfter", String(args.createdAfter)) if (args.createdBefore != null) query.append("createdBefore", String(args.createdBefore)) if (args.startFrom != null) query.append("startFrom", String(args.startFrom)) if (args.totalCount != null) query.append("totalCount", String(args.totalCount)) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/application/detailed/search${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() };