export type ApplicationDenialRequest = {applicationUuId: string, state: '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', reason: 'SUSPICIOUS_CUSTOMER' | 'NON_COMPETITIVE_OFFER' | 'OTHER' | 'INSUFFICIENT_CONDITIONS' | 'CHANGE_INTENTION' | 'UNFAVORABLE_CREDIT_CONDITIONS', otherReasonMessage?: string | undefined}; export type CreateApiApplicationDenyArgs = {body: ApplicationDenialRequest}; export type CreateApiApplicationDenyOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /application/deny */ export const createApiApplicationDeny = async (args: CreateApiApplicationDenyArgs, options?: CreateApiApplicationDenyOptions) => { const {baseUrl = "https://api.velox.am", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/application/deny${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() };