export type TaskEntityDTO = {entityId?: string | undefined, filename?: string | undefined, backupDate?: number | undefined, folderid?: string | undefined, parentId?: string | undefined, isDeleted?: string | undefined, entityType?: ('FOLDER' | 'DOCUMENT' | 'QUERY' | 'MD_FOLDER' | 'MD_FILE' | 'SEMI_FOLDER') | undefined, itemId?: number | undefined}; export type RestoreDTO = {taskId: string, account: string, source: 'GMAIL' | 'GDOC' | 'GDRIVETEAM' | 'SFC' | 'GOOGLEAPPS' | 'GCALENDAR' | 'GTASK' | 'GCONTACTS' | 'YMAIL' | 'GACCOUNTS' | 'GSITES' | 'SDB' | 'O365MAIL' | 'O365CONTACTS' | 'DDB' | 'MS365' | 'O365CALENDAR' | 'O365TASKS' | 'SHAREPOINT' | 'SHAREPOINT_MULTI' | 'ONEDRIVE' | 'IMAP' | 'BOX' | 'PUBLICWORDPRESS' | 'DROPBOX' | 'MS365GROUPS' | 'MS365GROUP_CONVERSATIONS' | 'MS365GROUP_CALENDAR' | 'MS365GROUP_SITE' | 'MS365GROUP_META' | 'O365NOTES' | 'MS365TEAM_CHANNELS' | 'MS365TEAM_APPS' | 'MSTEAMS' | 'MSGROUPS' | 'INTERNAL' | 'DYNAMICS365' | 'ENTRAID', date: number, includeDeleted?: boolean | undefined, includeLegalHold?: boolean | undefined, extid?: string | undefined, entities?: Array | undefined, accCred?: string | undefined, targetDomain?: string | undefined, targetRegion?: ('US_EST' | 'US_EST_OHIO' | 'US_WEST_OREGON' | 'US_WEST_CAL' | 'EU' | 'EU_FRANKFURT' | 'ASIA_HONG_KONG' | 'ASIA_MUMBAI' | 'ASIA_SEOUL' | 'ASIA_SINGAPORE' | 'ASIA_SIDNEY' | 'ASIA_TOKYO' | 'SOUTH_AMERICA' | 'AFRICA_CAPE_TOWN' | 'ASIA_CHINA' | 'CANADA' | 'LONDON' | 'EU_PARIS' | 'EU_STOCKHOLM' | 'EU_ZURICH') | undefined, targetAccount?: string | undefined, endpointURI?: string | undefined, inPlace?: boolean | undefined, sandbox?: boolean | undefined, includeMetadata?: number | undefined, startInactiveUsers?: boolean | undefined, disableTriggers?: boolean | undefined, restoreOption?: string | undefined, destinationExtId?: string | undefined}; export type CreateApiV1RecoveryRestoreArgs = {body: RestoreDTO}; export type CreateApiV1RecoveryRestoreOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * createRestore * * POST /v1/recovery/restore */ export const createApiV1RecoveryRestore = async (args: CreateApiV1RecoveryRestoreArgs, options?: CreateApiV1RecoveryRestoreOptions) => { const {baseUrl = "https://api.cloudally.com", 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(/\/+$/, '')}/v1/recovery/restore${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() };