diff --git a/packages/web-app-files/src/HandleUpload.ts b/packages/web-app-files/src/HandleUpload.ts index ada14dd4729..c86b1704a59 100644 --- a/packages/web-app-files/src/HandleUpload.ts +++ b/packages/web-app-files/src/HandleUpload.ts @@ -16,6 +16,7 @@ import { locationPublicLink } from 'web-pkg/src/router/public' import { locationSpacesGeneric } from 'web-pkg/src/router/spaces' import { isPersonalSpaceResource, isShareSpaceResource } from 'web-client/src/helpers' import { ClientService } from 'web-pkg/types' +import { queryItemAsString } from 'web-pkg/src/composables' export interface HandleUploadOptions { clientService: ClientService @@ -112,8 +113,12 @@ export class HandleUpload extends BasePlugin { if (!this.currentFolder && unref(this.route)?.params?.token) { // public file drop - const publicLinkToken = unref(this.route).params.token - let endpoint = this.clientService.owncloudSdk.publicFiles.getFileUrl(publicLinkToken) + '/' + const publicLinkToken = queryItemAsString(unref(this.route).params.token) + let endpoint = urlJoin( + this.clientService.webdav.getPublicFileUrl(this.space, publicLinkToken), + { trailingSlash: true } + ) + for (const file of files) { if (!this._uppy.getPlugin('Tus')) { endpoint = urlJoin(endpoint, encodeURIComponent(file.name)) diff --git a/packages/web-app-files/src/components/SideBar/Versions/FileVersions.vue b/packages/web-app-files/src/components/SideBar/Versions/FileVersions.vue index beabe462f61..6a4d70ac70d 100644 --- a/packages/web-app-files/src/components/SideBar/Versions/FileVersions.vue +++ b/packages/web-app-files/src/components/SideBar/Versions/FileVersions.vue @@ -63,16 +63,19 @@ import { isShareSpaceResource, Resource, SpaceResource } from 'web-client/src/he import { SharePermissions } from 'web-client/src/helpers/share' import { useDownloadFile } from 'web-pkg/src/composables/download/useDownloadFile' import { formatDateFromJSDate } from 'web-pkg/src/helpers' +import { useClientService } from 'web-pkg/src/composables' export default defineComponent({ name: 'FileVersions', setup() { + const clientService = useClientService() const loading = ref(false) return { ...useDownloadFile(), space: inject>('space'), resource: inject>('resource'), + clientService, loading } }, @@ -118,8 +121,12 @@ export default defineComponent({ this.loading = false }, async revertVersion(file) { - const { fileId, id, path } = this.resource - await this.$client.fileVersions.restoreFileVersion(fileId, this.currentVersionId(file), path) + const { id } = this.resource + await this.clientService.webdav.restoreFileVersion( + this.space, + this.resource, + this.currentVersionId(file) + ) const resource = await (this.$clientService.webdav as WebDAV).getFileInfo( this.space, this.resource diff --git a/packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts b/packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts index a8bf29ea2ec..ffb9fe22bdf 100644 --- a/packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts +++ b/packages/web-app-files/src/composables/actions/spaces/useSpaceActionsUploadImage.ts @@ -1,6 +1,6 @@ import { computed, unref, VNodeRef } from 'vue' import { Store } from 'vuex' -import { SpaceResource } from 'web-client/src' +import { Resource, SpaceResource } from 'web-client/src' import { Drive } from 'web-client/src/generated' import { useClientService, @@ -57,22 +57,24 @@ export const useSpaceActionsUploadImage = ({ } return loadingService.addTask(() => { - return clientService.owncloudSdk.files - .putFileContents(`/spaces/${selectedSpace.id}/.space/${file.name}`, file, { + return clientService.webdav + .putFileContents(selectedSpace, { + path: `/.space/${file.name}`, + content: file, headers: extraHeaders, overwrite: true }) - .then((image) => { + .then(({ fileId }: Resource) => { return graphClient.drives .updateDrive( - selectedSpace.id as string, + selectedSpace.id.toString(), { special: [ { specialFolder: { name: 'image' }, - id: image['OC-FileId'] + id: fileId } ] } as Drive, @@ -80,7 +82,7 @@ export const useSpaceActionsUploadImage = ({ ) .then(({ data }) => { store.commit('runtime/spaces/UPDATE_SPACE_FIELD', { - id: selectedSpace.id as string, + id: selectedSpace.id.toString(), field: 'spaceImageData', value: data.special.find((special) => special.specialFolder.name === 'image') }) diff --git a/packages/web-app-files/src/search/sdk/list.ts b/packages/web-app-files/src/search/sdk/list.ts index a773f644ca1..79dc15477a5 100644 --- a/packages/web-app-files/src/search/sdk/list.ts +++ b/packages/web-app-files/src/search/sdk/list.ts @@ -1,24 +1,15 @@ import { SearchList, SearchResult } from 'web-app-search/src/types' import ListComponent from '../../components/Search/List.vue' import { ClientService } from 'web-pkg/src/services' -import { - ProjectSpaceResource, - buildResource, - isProjectSpaceResource, - Resource -} from 'web-client/src/helpers' +import { ProjectSpaceResource, isProjectSpaceResource } from 'web-client/src/helpers' import { Component, computed, Ref, unref } from 'vue' -import { DavProperties, DavProperty } from 'web-client/src/webdav/constants' +import { DavProperties } from 'web-client/src/webdav/constants' import { Store } from 'vuex' import { ConfigurationManager } from 'web-pkg/src' import { urlJoin } from 'web-client/src/utils' export const searchLimit = 200 -export interface SearchResource extends Resource { - highlights: string -} - export default class List implements SearchList { public readonly component: Component private readonly store: Store @@ -60,30 +51,27 @@ export default class List implements SearchList { } } - const { range, results } = await this.clientService.owncloudSdk.files.search( - term, + const { resources, totalResults } = await this.clientService.webdav.search(term, { searchLimit, - DavProperties.Default, + davProperties: DavProperties.Default, useSpacesEndpoint - ) + }) return { - totalResults: range ? parseInt(range?.split('/')[1]) : null, - values: results.map((result) => { - const projectSpace = this.getProjectSpace(result.fileInfo[DavProperty.FileParent]) - const resource = { - ...(projectSpace ? projectSpace : buildResource(result)), - highlights: result.fileInfo[DavProperty.Highlights] || '' - } as SearchResource + totalResults, + values: resources.map((resource) => { + const matchingSpace = this.getProjectSpace(resource.parentFolderId) + const data = matchingSpace ? matchingSpace : resource // info: in oc10 we have no storageId in resources. All resources are mounted into the personal space. - if (!resource.storageId) { - resource.storageId = this.store.getters.user.id + if (!data.storageId) { + data.storageId = this.store.getters.user.id } - if (this.configurationManager.options.routing.fullShareOwnerPaths && resource.shareRoot) { - resource.path = urlJoin(resource.shareRoot, resource.path) + if (this.configurationManager.options.routing.fullShareOwnerPaths && data.shareRoot) { + data.path = urlJoin(data.shareRoot, data.path) } - return { id: resource.id, data: resource } + + return { id: data.id, data } }) } } diff --git a/packages/web-app-files/src/search/sdk/preview.ts b/packages/web-app-files/src/search/sdk/preview.ts index 5a58a7b1ace..87af69d114a 100644 --- a/packages/web-app-files/src/search/sdk/preview.ts +++ b/packages/web-app-files/src/search/sdk/preview.ts @@ -1,11 +1,11 @@ import { SearchPreview, SearchResult } from 'web-app-search/src/types' import PreviewComponent from '../../components/Search/Preview.vue' import { ClientService } from 'web-pkg/src/services' -import { ProjectSpaceResource, buildResource, isProjectSpaceResource } from 'web-client/src/helpers' +import { ProjectSpaceResource, isProjectSpaceResource } from 'web-client/src/helpers' import { Cache } from 'web-pkg/src/helpers/cache' import { Component, computed, Ref, unref } from 'vue' import { Router } from 'vue-router' -import { DavProperties, DavProperty } from 'web-client/src/webdav/constants' +import { DavProperties } from 'web-client/src/webdav/constants' import { Store } from 'vuex' import { ConfigurationManager } from 'web-pkg/src' import { urlJoin } from 'web-client/src/utils' @@ -64,35 +64,34 @@ export default class Preview implements SearchPreview { const areHiddenFilesShown = this.store.state.Files?.areHiddenFilesShown const useSpacesEndpoint = this.store.getters.capabilities?.spaces?.enabled === true - const { range, results } = await this.clientService.owncloudSdk.files.search( - term, - previewSearchLimit, // todo: add configuration option, other places need that too... needs consolidation - DavProperties.Default, + const { resources, totalResults } = await this.clientService.webdav.search(term, { + searchLimit: previewSearchLimit, + davProperties: DavProperties.Default, useSpacesEndpoint - ) - const resources = results.reduce((acc, result) => { - const projectSpace = this.getProjectSpace(result.fileInfo[DavProperty.FileParent]) - const resource = projectSpace ? projectSpace : buildResource(result) - // info: in oc10 we have no storageId in resources. All resources are mounted into the personal space. - if (!resource.storageId) { - resource.storageId = this.store.getters.user.id - } + }) - if (this.configurationManager.options.routing.fullShareOwnerPaths && resource.shareRoot) { - resource.path = urlJoin(resource.shareRoot, resource.path) - } + return { + totalResults, + values: resources + .map((resource) => { + const matchingSpace = this.getProjectSpace(resource.parentFolderId) + const data = matchingSpace ? matchingSpace : resource - // filter results if hidden files shouldn't be shown due to settings - if (!resource.name.startsWith('.') || areHiddenFilesShown) { - acc.push({ id: resource.id, data: { ...resource } }) - } + // info: in oc10 we have no storageId in resources. All resources are mounted into the personal space. + if (!data.storageId) { + data.storageId = this.store.getters.user.id + } + if (this.configurationManager.options.routing.fullShareOwnerPaths && data.shareRoot) { + data.path = urlJoin(data.shareRoot, data.path) + } - return acc - }, []) - return this.cache.set(term, { - totalResults: range ? parseInt(range?.split('/')[1]) : null, - values: resources - }) + return { id: data.id, data } + }) + .filter(({ data }) => { + // filter results if hidden files shouldn't be shown due to settings + return !data.name.startsWith('.') || areHiddenFilesShown + }) + } } public get available(): boolean { diff --git a/packages/web-app-files/src/views/FilesDrop.vue b/packages/web-app-files/src/views/FilesDrop.vue index d1bd91ae530..fd41ec95199 100644 --- a/packages/web-app-files/src/views/FilesDrop.vue +++ b/packages/web-app-files/src/views/FilesDrop.vue @@ -36,7 +36,6 @@ diff --git a/packages/web-pkg/src/composables/actions/files/useFileActionsEmptyTrashBin.ts b/packages/web-pkg/src/composables/actions/files/useFileActionsEmptyTrashBin.ts index 3e4630b6eeb..21732e13b1f 100644 --- a/packages/web-pkg/src/composables/actions/files/useFileActionsEmptyTrashBin.ts +++ b/packages/web-pkg/src/composables/actions/files/useFileActionsEmptyTrashBin.ts @@ -1,11 +1,7 @@ import { Store } from 'vuex' import { isLocationTrashActive } from '../../../router' -import { - buildWebDavSpacesTrashPath, - SpaceResource, - isProjectSpaceResource, - buildWebDavFilesTrashPath -} from 'web-client/src/helpers' +import { SpaceResource } from 'web-client/src/helpers' +import { isProjectSpaceResource } from 'web-client/src/helpers' import { computed, unref } from 'vue' import { useCapabilityFilesPermanentDeletion, @@ -28,12 +24,8 @@ export const useFileActionsEmptyTrashBin = ({ store }: { store?: Store } = const hasPermanentDeletion = useCapabilityFilesPermanentDeletion() const emptyTrashBin = ({ space }: { space: SpaceResource }) => { - const path = unref(hasShareJail) - ? buildWebDavSpacesTrashPath(space.id) - : buildWebDavFilesTrashPath(store.getters.user.id) - - return clientService.owncloudSdk.fileTrash - .clearTrashBin(path) + return clientService.webdav + .clearTrashBin(space, { hasShareJail: unref(hasShareJail), user: store.getters.user }) .then(() => { store.dispatch('showMessage', { title: $gettext('All deleted files were removed') diff --git a/packages/web-pkg/src/composables/actions/files/useFileActionsSetReadme.ts b/packages/web-pkg/src/composables/actions/files/useFileActionsSetReadme.ts index 728a002d268..18f24f779fb 100644 --- a/packages/web-pkg/src/composables/actions/files/useFileActionsSetReadme.ts +++ b/packages/web-pkg/src/composables/actions/files/useFileActionsSetReadme.ts @@ -14,8 +14,8 @@ export const useFileActionsSetReadme = ({ store }: { store?: Store } = {}) const handler = async ({ space, resources }: FileActionOptions) => { try { - const { owncloudSdk, graphAuthenticated, webdav } = clientService - const fileContent = await owncloudSdk.files.getFileContents(resources[0].webDavPath) + const { graphAuthenticated, webdav } = clientService + const fileContent = (await webdav.getFileContents(space, { path: resources[0].path })).body try { await webdav.getFileInfo(space, { path: '.space' }) @@ -23,7 +23,10 @@ export const useFileActionsSetReadme = ({ store }: { store?: Store } = {}) await webdav.createFolder(space, { path: '.space' }) } - await owncloudSdk.files.putFileContents(`/spaces/${space.id}/.space/readme.md`, fileContent) + await webdav.putFileContents(space, { + path: `/.space/readme.md`, + content: fileContent + }) const file = await webdav.getFileInfo(space, { path: '.space/readme.md' }) const { data: updatedDriveData } = await graphAuthenticated.drives.updateDrive( diff --git a/packages/web-pkg/src/composables/actions/helpers/useFileActionsDeleteResources.ts b/packages/web-pkg/src/composables/actions/helpers/useFileActionsDeleteResources.ts index 404aa14d4e0..825a6db2ec9 100644 --- a/packages/web-pkg/src/composables/actions/helpers/useFileActionsDeleteResources.ts +++ b/packages/web-pkg/src/composables/actions/helpers/useFileActionsDeleteResources.ts @@ -1,12 +1,7 @@ import { Store } from 'vuex' import { cloneStateObject } from '../../../helpers/store' import { isSameResource } from '../../../helpers/resource' -import { - buildWebDavFilesTrashPath, - buildWebDavSpacesTrashPath, - Resource, - SpaceResource -} from 'web-client/src/helpers' +import { Resource, SpaceResource } from 'web-client/src/helpers' import PQueue from 'p-queue' import { isLocationSpacesActive } from '../../../router' import { dirname } from 'path' @@ -111,13 +106,13 @@ export const useFileActionsDeleteResources = ({ store }: { store?: Store }) ) }) - const trashbin_deleteOp = (space, resource) => { - const path = unref(hasShareJail) - ? buildWebDavSpacesTrashPath(space.id) - : buildWebDavFilesTrashPath(store.getters.user.id) - - return owncloudSdk.fileTrash - .clearTrashBin(path, resource.id) + const trashbin_deleteOp = (space: SpaceResource, resource: Resource) => { + return clientService.webdav + .clearTrashBin(space, { + hasShareJail: unref(hasShareJail), + id: resource.id, + user: store.getters.user + }) .then(() => { store.dispatch('Files/removeFilesFromTrashbin', [resource]) const translated = $gettext( diff --git a/packages/web-pkg/tests/unit/components/Spaces/ReadmeContentModal.spec.ts b/packages/web-pkg/tests/unit/components/Spaces/ReadmeContentModal.spec.ts index d4598affdc3..7eb98d8c8fb 100644 --- a/packages/web-pkg/tests/unit/components/Spaces/ReadmeContentModal.spec.ts +++ b/packages/web-pkg/tests/unit/components/Spaces/ReadmeContentModal.spec.ts @@ -1,6 +1,5 @@ import ReadmeContentModal from 'web-pkg/src/components/Spaces/ReadmeContentModal.vue' -import { mockDeep } from 'jest-mock-extended' -import { OwnCloudSdk } from 'web-client/src/types' +import { mock } from 'jest-mock-extended' import { createStore, defaultPlugins, @@ -9,35 +8,41 @@ import { defaultComponentMocks, defaultStubs } from 'web-test-helpers' - -afterEach(() => jest.clearAllMocks()) +import { GetFileContentsResponse } from 'web-client/src/webdav/getFileContents' +import { Resource } from 'web-client/src' describe('ReadmeContentModal', () => { describe('method "editReadme"', () => { it('should show message on success', async () => { - const { wrapper } = getWrapper() - const showMessageStub = jest.spyOn(wrapper.vm, 'showMessage') + const { wrapper, storeOptions } = getWrapper() await wrapper.vm.editReadme() - - expect(showMessageStub).toHaveBeenCalledTimes(1) + expect(storeOptions.actions.showMessage).toHaveBeenCalledTimes(1) }) it('should show message on error', async () => { jest.spyOn(console, 'error').mockImplementation(() => undefined) - const { wrapper } = getWrapper(false) - const showErrorMessageStub = jest.spyOn(wrapper.vm, 'showErrorMessage') + const { wrapper, storeOptions } = getWrapper(false) await wrapper.vm.editReadme() - - expect(showErrorMessageStub).toHaveBeenCalledTimes(1) + expect(storeOptions.actions.showErrorMessage).toHaveBeenCalledTimes(1) }) }) }) function getWrapper(resolvePutFileContents = true) { - const clientMock = mockDeep() const storeOptions = defaultStoreMockOptions const store = createStore(storeOptions) + + const mocks = defaultComponentMocks() + const { $clientService: clientService } = mocks + clientService.webdav.getFileContents.mockResolvedValue(mock()) + if (resolvePutFileContents) { + clientService.webdav.putFileContents.mockResolvedValue(mock()) + } else { + clientService.webdav.putFileContents.mockRejectedValue(new Error('')) + } + return { + storeOptions, wrapper: mount(ReadmeContentModal, { props: { cancel: jest.fn(), @@ -52,24 +57,8 @@ function getWrapper(resolvePutFileContents = true) { global: { plugins: [...defaultPlugins(), store], stubs: { ...defaultStubs, portal: true, 'oc-modal': true }, - mocks: { - ...defaultComponentMocks(), - $client: { - ...clientMock, - files: { - ...clientMock.files, - putFileContents: jest.fn().mockImplementation(() => { - if (resolvePutFileContents) { - return Promise.resolve('readme') - } - return Promise.reject(new Error('')) - }), - getFileContents: jest.fn().mockImplementation(() => { - return Promise.resolve('readme') - }) - } - } - } + mocks, + provide: mocks } }) } diff --git a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsEmptyTrashBin.spec.ts b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsEmptyTrashBin.spec.ts index ddfcd2b590a..0ee75efcfba 100644 --- a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsEmptyTrashBin.spec.ts +++ b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsEmptyTrashBin.spec.ts @@ -110,12 +110,11 @@ function getWrapper({ space: mock({ driveType, isEditor: () => false, isManager: () => false }) } - mocks.$clientService.owncloudSdk.fileTrash.clearTrashBin.mockImplementation(() => { - if (resolveClearTrashBin) { - return Promise.resolve({}) - } - return Promise.reject(new Error('')) - }) + if (resolveClearTrashBin) { + mocks.$clientService.webdav.clearTrashBin.mockResolvedValue() + } else { + mocks.$clientService.webdav.clearTrashBin.mockRejectedValue(new Error('')) + } const storeOptions = { ...defaultStoreMockOptions, diff --git a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsRestore.spec.ts b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsRestore.spec.ts index 03994bdbe1c..02a910df96b 100644 --- a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsRestore.spec.ts +++ b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsRestore.spec.ts @@ -197,12 +197,6 @@ function getWrapper({ return Promise.reject(new Error('')) }) mocks.$clientService.owncloudSdk.users.getUser.mockImplementation(() => ({ quota: {} })) - mocks.$clientService.owncloudSdk.fileTrash.restore.mockImplementation(() => { - if (resolveRestore) { - return Promise.resolve({}) - } - return Promise.reject(new Error('')) - }) const storeOptions = { ...defaultStoreMockOptions, diff --git a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetImage.spec.ts b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetImage.spec.ts index 15adb96fe3b..74fe4b0ec99 100644 --- a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetImage.spec.ts +++ b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetImage.spec.ts @@ -134,23 +134,6 @@ describe('setImage', () => { } }) }) - - /* FIXME: Reintroduce with latest copyMove bugfix - it('should not copy the image if source and destination path are the same', async () => { - mockAxios.request.mockImplementationOnce(() => { - return Promise.resolve({ data: { special: [{ specialFolder: { name: 'image' } }] } }) - }) - getWrapper() - await wrapper.vm.$_setSpaceImage_trigger({ - resources: [ - { - webDavPath: '/spaces/1fe58d8b-aa69-4c22-baf7-97dd57479f22/.space/image.png', - name: 'image.png' - } - ] - }) - expect(wrapper.vm.$client.files.copy).toBeCalledTimes(0) - }) */ }) }) diff --git a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetReadme.spec.ts b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetReadme.spec.ts index 38dd191722c..9675ae4c8ab 100644 --- a/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetReadme.spec.ts +++ b/packages/web-pkg/tests/unit/composables/actions/files/useFileActionsSetReadme.spec.ts @@ -1,7 +1,6 @@ import { useFileActionsSetReadme } from 'web-pkg/src/composables/actions/files/useFileActionsSetReadme' -import { buildSpace, SpaceResource } from 'web-client/src/helpers' -import { mock, mockDeep } from 'jest-mock-extended' -import { OwnCloudSdk } from 'web-client/src/types' +import { buildSpace, FileResource, SpaceResource } from 'web-client/src/helpers' +import { mock } from 'jest-mock-extended' import { createStore, defaultStoreMockOptions, @@ -11,6 +10,7 @@ import { mockAxiosResolve } from 'web-test-helpers' import { nextTick, unref } from 'vue' +import { GetFileContentsResponse } from 'web-client/src/webdav/getFileContents' describe('setReadme', () => { describe('isEnabled property', () => { @@ -147,23 +147,20 @@ function getWrapper({ options: { storeOptions: typeof defaultStoreMockOptions } ) => void }) { - const clientMock = mockDeep() - const mocks = { ...defaultComponentMocks({ currentRoute: mock({ name: 'files-spaces-generic' }) }), space } - mocks.$clientService.owncloudSdk.files.getFileContents.mockImplementation(() => { - if (resolveGetFileContents) { - return Promise.resolve('readme') - } - return Promise.reject(new Error('')) - }) + if (resolveGetFileContents) { + mocks.$clientService.webdav.getFileContents.mockResolvedValue(mock()) + } else { + mocks.$clientService.webdav.getFileContents.mockRejectedValue(new Error('')) + } - mocks.$clientService.owncloudSdk.files.putFileContents.mockImplementation(() => - Promise.resolve({ ETag: '60c7243c2e7f1' }) + mocks.$clientService.webdav.putFileContents.mockResolvedValue( + mock({ etag: '60c7243c2e7f1' }) ) mocks.$clientService.webdav.getFileInfo.mockImplementation(() => diff --git a/packages/web-runtime/src/pages/resolvePrivateLink.vue b/packages/web-runtime/src/pages/resolvePrivateLink.vue index c6f31809c82..78eed1430ae 100644 --- a/packages/web-runtime/src/pages/resolvePrivateLink.vue +++ b/packages/web-runtime/src/pages/resolvePrivateLink.vue @@ -105,7 +105,7 @@ export default defineComponent({ let matchingSpace = getMatchingSpace(id) let resourceIsNestedInShare = false if (matchingSpace) { - path = yield clientService.owncloudSdk.files.getPathForFileId(id) + path = yield clientService.webdav.getPathForFileId(id) resource.value = yield clientService.webdav.getFileInfo(matchingSpace, { path }) } else { // no matching space found => the file doesn't lie in own spaces => it's a share.