@ -2,11 +2,11 @@
* SPDX - FileCopyrightText : 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX - License - Identifier : AGPL - 3.0 - or - later
* /
import type { ContentsWithRoot } from '@nextcloud/files'
import type { ContentsWithRoot , File , Folder } from '@nextcloud/files'
import type { FileStat , ResponseDataDetailed } from 'webdav'
import { CancelablePromise } from 'cancelable-promise'
import { File, Folder , davGetDefaultPropfind, davResultToNode , davRootPath } from '@nextcloud/files'
import { davGetDefaultPropfind, davResultToNode , davRootPath } from '@nextcloud/files'
import { client } from './WebdavClient.ts'
import logger from '../logger.ts'
@ -14,14 +14,7 @@ import logger from '../logger.ts'
* Slim wrapper over ` @nextcloud/files ` ` davResultToNode ` to allow using the function with ` Array.map `
* @param node The node returned by the webdav library
* /
export const resultToNode = ( node : FileStat ) : File | Folder = > {
// TODO remove this hack with nextcloud-files v3.7
// just needed because of a bug in the webdav client
if ( node . props ? . displayname !== undefined ) {
node . props . displayname = String ( node . props . displayname )
}
return davResultToNode ( node )
}
export const resultToNode = ( node : FileStat ) : File | Folder = > davResultToNode ( node )
export const getContents = ( path = '/' ) : CancelablePromise < ContentsWithRoot > = > {
const controller = new AbortController ( )