UNPKG

@open-tender/utils

Version:

A library of utils for use with Open Tender applications that utilize our cloud-based Order API.

52 lines (51 loc) 1.9 kB
import { CheckoutError, CheckoutErrorParams, CheckoutErrorMessages, RequestError, RequestErrorMessage } from '@open-tender/types'; export declare const handleRespError: (err: RequestError) => { title: string; detail: string | undefined; messages: [string, string][]; errors: { [x: string]: any; }; err: RequestError; }; export declare const processError: (msg: string | null) => string; export declare const handleFormErrorsNested: (params: Record<string, string | null | RequestErrorMessage>) => CheckoutErrorMessages; export declare const makeFormErrorsNested: (error: RequestError) => CheckoutErrorMessages; export declare const handleFormErrors: (params: Record<string, string | null>) => Record<string, string>; export declare const makeFormErrors: (error: RequestError) => Record<string, string>; export declare const handleCheckoutError: (error: CheckoutError) => CheckoutErrorMessages; export declare const makeCheckError: (params: CheckoutErrorParams) => CheckoutError; export declare const errMessages: { unknown: string; forbidden: string; expiredToken: string; notAllowed: string; duplicates: string; errorsBelow: string; emptyField: string; invalidAmount: string; invalidEmail: string; invalidEmails: string; notInteger: string; positiveInteger: string; invalidTime: string; invalidDate: string; invalidNumber: string; invalidHex: string; invalidZip: string; invalidPhone: string; invalidPassword: string; invalidToken: string; requiredField: string; invalidFilename: string; notExist: string; serverError: string; invalidHours: string; revenueCenterClosed: string; serviceTypeNotAvailable: string; notInZone: string; missingAddress: string; orderNotFound: string; distanceSurcharge: string; missingAddressDeliveryZone: string; };