export type DocumentDTO = {acceptorId?: number | undefined, content?: string | undefined, contentContentType?: string | undefined, description?: string | undefined, documentIdentifier?: string | undefined, documentKey?: string | undefined, documentStatus?: ('CONFIRMED' | 'REJECTED') | undefined, documentType: 'LOGO' | 'MENU' | 'PHOTO' | 'PHOTO_BUILDING' | 'DOCUMENT' | 'BANNER' | 'BANNER_LANDING' | 'BANNER_LANDING_DESKTOP' | 'ID_NATIONAL_CODE' | 'ID_IDENTITY_NUMBER' | 'ID_BUSINESS_LICENSE' | 'ID_SHEBA_CONFIRMATION' | 'ID_POSTAL_CODE' | 'ID_APG_CONTRACT' | 'ID_POS_CONTRACT' | 'ID_ACCEPTOR_CONFIRMATION' | 'ID_OTHERS', id?: number | undefined, lastModifiedDate?: string | undefined, makePublic?: boolean | undefined, paymentToolId?: number | undefined, statusDescription?: string | undefined, uploadedOn?: string | undefined, validFrom?: string | undefined, validTo?: string | undefined}; export type UpdateApiApiDocumentsArgs = {body: DocumentDTO}; export type UpdateApiApiDocumentsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateDocument * * PUT /api/documents */ export const updateApiApiDocuments = async (args: UpdateApiApiDocumentsArgs, options: UpdateApiApiDocumentsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/documents${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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() };