diff --git a/.drone.env b/.drone.env index e9e218d3980..a57fe44d076 100644 --- a/.drone.env +++ b/.drone.env @@ -1,3 +1,3 @@ # The version of OCIS to use in pipelines that test against OCIS -OCIS_COMMITID=6df93c392bee7fa2e4be21d44da6e6dfc3873e8a +OCIS_COMMITID=21797fb22d4eb5658f92dc29c33934ec90a97e4e OCIS_BRANCH=master diff --git a/changelog/unreleased/enhancement-update-libregraph b/changelog/unreleased/enhancement-update-libregraph index 6d845460264..76f1e0da967 100644 --- a/changelog/unreleased/enhancement-update-libregraph +++ b/changelog/unreleased/enhancement-update-libregraph @@ -3,3 +3,4 @@ Enhancement: Update libre-graph-api to v1.0 libre-graph-api has been updated to v1.0 https://github.com/owncloud/web/pull/8132 +https://github.com/owncloud/web/pull/8171 diff --git a/packages/web-app-files/src/mixins/spaces/actions/restore.ts b/packages/web-app-files/src/mixins/spaces/actions/restore.ts index 5f3b9b3cad3..8435acd0be5 100644 --- a/packages/web-app-files/src/mixins/spaces/actions/restore.ts +++ b/packages/web-app-files/src/mixins/spaces/actions/restore.ts @@ -56,19 +56,19 @@ export default { message, hasInput: false, onCancel: this.hideModal, - onConfirm: () => this.$_restore_restoreSpace(resources[0].id) + onConfirm: () => this.$_restore_restoreSpace(resources[0].id, resources[0].name) } this.createModal(modal) }, - $_restore_restoreSpace(id) { + $_restore_restoreSpace(id, name) { const accessToken = this.$store.getters['runtime/auth/accessToken'] const graphClient = clientService.graphAuthenticated(this.configuration.server, accessToken) return graphClient.drives .updateDrive( id, - {}, + { name }, { headers: { Restore: true diff --git a/packages/web-app-files/src/mixins/spaces/actions/setImage.ts b/packages/web-app-files/src/mixins/spaces/actions/setImage.ts index 9685f862b17..ceb4eed0a70 100644 --- a/packages/web-app-files/src/mixins/spaces/actions/setImage.ts +++ b/packages/web-app-files/src/mixins/spaces/actions/setImage.ts @@ -68,6 +68,7 @@ export default { const { data } = await graphClient.drives.updateDrive( storageId, { + name: this.space.name, special: [ { specialFolder: { diff --git a/packages/web-app-files/tests/unit/components/Spaces/QuotaModal.spec.ts b/packages/web-app-files/tests/unit/components/Spaces/QuotaModal.spec.ts index 48b5e574b64..a114d15bc2d 100644 --- a/packages/web-app-files/tests/unit/components/Spaces/QuotaModal.spec.ts +++ b/packages/web-app-files/tests/unit/components/Spaces/QuotaModal.spec.ts @@ -21,6 +21,7 @@ describe('QuotaModal', () => { graphMock.drives.updateDrive.mockImplementation(() => mockAxiosResolve({ id: '1fe58d8b-aa69-4c22-baf7-97dd57479f22', + name: 'any', quota: { remaining: 9999999836, state: 'normal', diff --git a/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts b/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts index 75b1e2c64d9..fe53a0b0e01 100644 --- a/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts +++ b/packages/web-app-files/tests/unit/components/Spaces/SpaceContextActions.spec.ts @@ -10,7 +10,7 @@ import { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] } + root: { permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } describe('SpaceContextActions', () => { diff --git a/packages/web-app-files/tests/unit/mixins/spaces/delete.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/delete.spec.ts index c9f026aa9b1..ad68ba14a60 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/delete.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/delete.spec.ts @@ -29,7 +29,7 @@ describe('delete', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() @@ -41,7 +41,7 @@ describe('delete', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }], + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }], deleted: { state: 'trashed' } } } @@ -54,7 +54,7 @@ describe('delete', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }], + permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }], deleted: { state: 'trashed' } } } diff --git a/packages/web-app-files/tests/unit/mixins/spaces/disable.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/disable.spec.ts index 5ab75ff425d..3642569f89b 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/disable.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/disable.spec.ts @@ -29,7 +29,7 @@ describe('disable', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() @@ -41,7 +41,7 @@ describe('disable', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }], + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }], deleted: { state: 'trashed' } } } @@ -54,7 +54,7 @@ describe('disable', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() diff --git a/packages/web-app-files/tests/unit/mixins/spaces/editQuota.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/editQuota.spec.ts index 0e814ee5336..d53d5f4e63f 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/editQuota.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/editQuota.spec.ts @@ -20,7 +20,7 @@ describe('editQuota', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper({ canEditSpaceQuota: true }) @@ -33,7 +33,7 @@ describe('editQuota', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper({ canEditSpaceQuota: false }) diff --git a/packages/web-app-files/tests/unit/mixins/spaces/editReadmeContent.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/editReadmeContent.spec.ts index 13669bd42f7..53b8615d843 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/editReadmeContent.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/editReadmeContent.spec.ts @@ -13,7 +13,7 @@ describe('editReadmeContent', () => { it('should be true for space managers', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] }, + root: { permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'readme' } }] } @@ -31,7 +31,7 @@ describe('editReadmeContent', () => { it('should be false when spaceReadmeData does not exist', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] } + root: { permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() @@ -44,7 +44,7 @@ describe('editReadmeContent', () => { it('should be false when the current user is a viewer', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }] } + root: { permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() diff --git a/packages/web-app-files/tests/unit/mixins/spaces/restore.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/restore.spec.ts index 35e2cb6a836..eecabc2a969 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/restore.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/restore.spec.ts @@ -29,7 +29,7 @@ describe('restore', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] } } const { wrapper } = getWrapper() @@ -41,7 +41,7 @@ describe('restore', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }], + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }], deleted: { state: 'trashed' } } } @@ -54,7 +54,7 @@ describe('restore', () => { const spaceMock = { id: '1', root: { - permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }], + permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }], deleted: { state: 'trashed' } } } diff --git a/packages/web-app-files/tests/unit/mixins/spaces/setImage.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/setImage.spec.ts index 7e712c158e5..43f9c2810ef 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/setImage.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/setImage.spec.ts @@ -34,7 +34,7 @@ describe('setImage', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'image' }, file: { mimeType: 'image/png' } }] } @@ -46,7 +46,7 @@ describe('setImage', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'image' }, file: { mimeType: 'image/png' } }] } @@ -62,7 +62,7 @@ describe('setImage', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'image' }, file: { mimeType: 'image/png' } }] } @@ -78,7 +78,7 @@ describe('setImage', () => { id: '1', quota: {}, root: { - permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }] + permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'image' }, file: { mimeType: 'image/png' } }] } diff --git a/packages/web-app-files/tests/unit/mixins/spaces/setReadme.spec.ts b/packages/web-app-files/tests/unit/mixins/spaces/setReadme.spec.ts index d86eeda569c..a56da5da6cb 100644 --- a/packages/web-app-files/tests/unit/mixins/spaces/setReadme.spec.ts +++ b/packages/web-app-files/tests/unit/mixins/spaces/setReadme.spec.ts @@ -25,7 +25,7 @@ describe('setReadme', () => { it('should be false when mimeType is not text', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] }, + root: { permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'readme' } }] } const { wrapper } = getWrapper(true, buildSpace(spaceMock)) @@ -38,7 +38,7 @@ describe('setReadme', () => { it('should be true when the mimeType is "text/plain"', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['manager'], grantedTo: [{ user: { id: 1 } }] }] }, + root: { permissions: [{ roles: ['manager'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'readme' } }] } const { wrapper } = getWrapper(true, buildSpace(spaceMock)) @@ -51,7 +51,7 @@ describe('setReadme', () => { it('should be true when when mimeType is text', () => { const spaceMock = { id: '1', - root: { permissions: [{ roles: ['viewer'], grantedTo: [{ user: { id: 1 } }] }] }, + root: { permissions: [{ roles: ['viewer'], grantedToIdentities: [{ user: { id: 1 } }] }] }, special: [{ specialFolder: { name: 'readme' } }] } const { wrapper } = getWrapper(true, buildSpace(spaceMock)) diff --git a/packages/web-app-user-management/tests/unit/views/Users.spec.ts b/packages/web-app-user-management/tests/unit/views/Users.spec.ts index 63b3da5f307..a49a897b387 100644 --- a/packages/web-app-user-management/tests/unit/views/Users.spec.ts +++ b/packages/web-app-user-management/tests/unit/views/Users.spec.ts @@ -17,7 +17,9 @@ const defaultGraphMock = () => { const defaultUser = { id: '1', memberOf: [], - drive: {} + drive: { + name: 'any' + } } const graph = mockDeep() @@ -85,7 +87,7 @@ describe('Users view', () => { roleId: '1' }) ) - graph.drives.updateDrive.mockImplementation(() => mockAxiosResolve({})) + graph.drives.updateDrive.mockImplementation(() => mockAxiosResolve({ name: 'any' })) const wrapper = getMountedWrapper({ graph }) const busStub = jest.spyOn(eventBus, 'publish') const setStub = jest.spyOn(wrapper.vm, '$set').mockImplementation(() => undefined) diff --git a/packages/web-client/src/generated/api.ts b/packages/web-client/src/generated/api.ts index ee162208b15..42a67b30e9d 100644 --- a/packages/web-client/src/generated/api.ts +++ b/packages/web-client/src/generated/api.ts @@ -4,7 +4,7 @@ * Libre Graph API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v1.0.0 + * The version of the OpenAPI document: v1.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -100,6 +100,19 @@ export interface CollectionOfDrives { */ '@odata.nextLink'?: string; } +/** + * + * @export + * @interface CollectionOfDrives1 + */ +export interface CollectionOfDrives1 { + /** + * + * @type {Array} + * @memberof CollectionOfDrives1 + */ + 'value'?: Array; +} /** * * @export @@ -210,13 +223,13 @@ export interface DirectoryObject { 'deletedDateTime'?: string; } /** - * Storage Space. Read-only. + * The drive represents a space on the storage. * @export * @interface Drive */ export interface Drive { /** - * Read-only. + * The unique idenfier for this drive. * @type {string} * @memberof Drive */ @@ -262,7 +275,7 @@ export interface Drive { * @type {string} * @memberof Drive */ - 'name'?: string; + 'name': string; /** * * @type {ItemReference} @@ -883,7 +896,7 @@ export interface Identity { * @type {string} * @memberof Identity */ - 'displayName'?: string; + 'displayName': string; /** * Unique identifier for the identity. * @type {string} @@ -915,6 +928,12 @@ export interface IdentitySet { * @memberof IdentitySet */ 'user'?: Identity; + /** + * + * @type {Identity} + * @memberof IdentitySet + */ + 'group'?: Identity; } /** * Image metadata, if the item is an image. Read-only. @@ -1121,13 +1140,13 @@ export interface PasswordChange { * @type {string} * @memberof PasswordChange */ - 'currentPassword'?: string; + 'currentPassword': string; /** * * @type {string} * @memberof PasswordChange */ - 'newPassword'?: string; + 'newPassword': string; } /** * Password Profile associated with a user @@ -1159,7 +1178,7 @@ export interface Permission { * @type {Array} * @memberof Permission */ - 'grantedTo'?: Array; + 'grantedToIdentities'?: Array; /** * * @type {Array} @@ -1508,7 +1527,7 @@ export const DrivesApiAxiosParamCreator = function (configuration?: Configuratio return { /** * - * @summary Create a new space of a specific type + * @summary Create a new drive of a specific type * @param {Drive} drive New space property values * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1585,12 +1604,10 @@ export const DrivesApiAxiosParamCreator = function (configuration?: Configuratio * * @summary Get drive by id * @param {string} driveId key: id of drive - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDrive: async (driveId: string, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'special'>, options: AxiosRequestConfig = {}): Promise => { + getDrive: async (driveId: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'driveId' is not null or undefined assertParamExists('getDrive', 'driveId', driveId) const localVarPath = `/drives/{drive-id}` @@ -1606,14 +1623,6 @@ export const DrivesApiAxiosParamCreator = function (configuration?: Configuratio const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -1627,7 +1636,7 @@ export const DrivesApiAxiosParamCreator = function (configuration?: Configuratio }, /** * - * @summary Update the space + * @summary Update the drive * @param {string} driveId key: id of drive * @param {Drive} drive New space values * @param {*} [options] Override http request option. @@ -1677,7 +1686,7 @@ export const DrivesApiFp = function(configuration?: Configuration) { return { /** * - * @summary Create a new space of a specific type + * @summary Create a new drive of a specific type * @param {Drive} drive New space property values * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1702,18 +1711,16 @@ export const DrivesApiFp = function(configuration?: Configuration) { * * @summary Get drive by id * @param {string} driveId key: id of drive - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getDrive(driveId: string, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'special'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getDrive(driveId, $select, $expand, options); + async getDrive(driveId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getDrive(driveId, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, /** * - * @summary Update the space + * @summary Update the drive * @param {string} driveId key: id of drive * @param {Drive} drive New space values * @param {*} [options] Override http request option. @@ -1735,7 +1742,7 @@ export const DrivesApiFactory = function (configuration?: Configuration, basePat return { /** * - * @summary Create a new space of a specific type + * @summary Create a new drive of a specific type * @param {Drive} drive New space property values * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1758,17 +1765,15 @@ export const DrivesApiFactory = function (configuration?: Configuration, basePat * * @summary Get drive by id * @param {string} driveId key: id of drive - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getDrive(driveId: string, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'special'>, options?: any): AxiosPromise { - return localVarFp.getDrive(driveId, $select, $expand, options).then((request) => request(axios, basePath)); + getDrive(driveId: string, options?: any): AxiosPromise { + return localVarFp.getDrive(driveId, options).then((request) => request(axios, basePath)); }, /** * - * @summary Update the space + * @summary Update the drive * @param {string} driveId key: id of drive * @param {Drive} drive New space values * @param {*} [options] Override http request option. @@ -1789,7 +1794,7 @@ export const DrivesApiFactory = function (configuration?: Configuration, basePat export class DrivesApi extends BaseAPI { /** * - * @summary Create a new space of a specific type + * @summary Create a new drive of a specific type * @param {Drive} drive New space property values * @param {*} [options] Override http request option. * @throws {RequiredError} @@ -1816,19 +1821,17 @@ export class DrivesApi extends BaseAPI { * * @summary Get drive by id * @param {string} driveId key: id of drive - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DrivesApi */ - public getDrive(driveId: string, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'special'>, options?: AxiosRequestConfig) { - return DrivesApiFp(this.configuration).getDrive(driveId, $select, $expand, options).then((request) => request(this.axios, this.basePath)); + public getDrive(driveId: string, options?: AxiosRequestConfig) { + return DrivesApiFp(this.configuration).getDrive(driveId, options).then((request) => request(this.axios, this.basePath)); } /** * - * @summary Update the space + * @summary Update the drive * @param {string} driveId key: id of drive * @param {Drive} drive New space values * @param {*} [options] Override http request option. @@ -1849,18 +1852,13 @@ export const DrivesGetDrivesApiAxiosParamCreator = function (configuration?: Con return { /** * - * @summary Get All drives - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all available drives * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listAllDrives: async ($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options: AxiosRequestConfig = {}): Promise => { + listAllDrives: async ($orderby?: string, $filter?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/drives`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -1873,14 +1871,6 @@ export const DrivesGetDrivesApiAxiosParamCreator = function (configuration?: Con const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if ($top !== undefined) { - localVarQueryParameter['$top'] = $top; - } - - if ($skip !== undefined) { - localVarQueryParameter['$skip'] = $skip; - } - if ($orderby !== undefined) { localVarQueryParameter['$orderby'] = $orderby; } @@ -1889,18 +1879,6 @@ export const DrivesGetDrivesApiAxiosParamCreator = function (configuration?: Con localVarQueryParameter['$filter'] = $filter; } - if ($count !== undefined) { - localVarQueryParameter['$count'] = $count; - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -1924,19 +1902,14 @@ export const DrivesGetDrivesApiFp = function(configuration?: Configuration) { return { /** * - * @summary Get All drives - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all available drives * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listAllDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listAllDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options); + async listAllDrives($orderby?: string, $filter?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listAllDrives($orderby, $filter, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -1951,19 +1924,14 @@ export const DrivesGetDrivesApiFactory = function (configuration?: Configuration return { /** * - * @summary Get All drives - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all available drives * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listAllDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: any): AxiosPromise { - return localVarFp.listAllDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options).then((request) => request(axios, basePath)); + listAllDrives($orderby?: string, $filter?: string, options?: any): AxiosPromise { + return localVarFp.listAllDrives($orderby, $filter, options).then((request) => request(axios, basePath)); }, }; }; @@ -1977,20 +1945,15 @@ export const DrivesGetDrivesApiFactory = function (configuration?: Configuration export class DrivesGetDrivesApi extends BaseAPI { /** * - * @summary Get All drives - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all available drives * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof DrivesGetDrivesApi */ - public listAllDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: AxiosRequestConfig) { - return DrivesGetDrivesApiFp(this.configuration).listAllDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options).then((request) => request(this.axios, this.basePath)); + public listAllDrives($orderby?: string, $filter?: string, options?: AxiosRequestConfig) { + return DrivesGetDrivesApiFp(this.configuration).listAllDrives($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); } } @@ -4775,18 +4738,13 @@ export const MeDrivesApiAxiosParamCreator = function (configuration?: Configurat return { /** * - * @summary Get drives from me - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all drives where the current user is a regular member of * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listMyDrives: async ($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options: AxiosRequestConfig = {}): Promise => { + listMyDrives: async ($orderby?: string, $filter?: string, options: AxiosRequestConfig = {}): Promise => { const localVarPath = `/me/drives`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); @@ -4799,14 +4757,6 @@ export const MeDrivesApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if ($top !== undefined) { - localVarQueryParameter['$top'] = $top; - } - - if ($skip !== undefined) { - localVarQueryParameter['$skip'] = $skip; - } - if ($orderby !== undefined) { localVarQueryParameter['$orderby'] = $orderby; } @@ -4815,18 +4765,6 @@ export const MeDrivesApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['$filter'] = $filter; } - if ($count !== undefined) { - localVarQueryParameter['$count'] = $count; - } - - if ($select) { - localVarQueryParameter['$select'] = Array.from($select).join(COLLECTION_FORMATS.csv); - } - - if ($expand) { - localVarQueryParameter['$expand'] = Array.from($expand).join(COLLECTION_FORMATS.csv); - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -4850,19 +4788,14 @@ export const MeDrivesApiFp = function(configuration?: Configuration) { return { /** * - * @summary Get drives from me - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all drives where the current user is a regular member of * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listMyDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listMyDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options); + async listMyDrives($orderby?: string, $filter?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listMyDrives($orderby, $filter, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -4877,19 +4810,14 @@ export const MeDrivesApiFactory = function (configuration?: Configuration, baseP return { /** * - * @summary Get drives from me - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all drives where the current user is a regular member of * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listMyDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: any): AxiosPromise { - return localVarFp.listMyDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options).then((request) => request(axios, basePath)); + listMyDrives($orderby?: string, $filter?: string, options?: any): AxiosPromise { + return localVarFp.listMyDrives($orderby, $filter, options).then((request) => request(axios, basePath)); }, }; }; @@ -4903,20 +4831,15 @@ export const MeDrivesApiFactory = function (configuration?: Configuration, baseP export class MeDrivesApi extends BaseAPI { /** * - * @summary Get drives from me - * @param {number} [$top] Show only the first n items - * @param {number} [$skip] Skip the first n items + * @summary Get all drives where the current user is a regular member of * @param {string} [$orderby] The $orderby system query option allows clients to request resources in either ascending order using asc or descending order using desc. * @param {string} [$filter] Filter items by property values - * @param {boolean} [$count] Include count of items - * @param {Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>} [$select] Select properties to be returned - * @param {Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>} [$expand] Expand related entities * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof MeDrivesApi */ - public listMyDrives($top?: number, $skip?: number, $orderby?: string, $filter?: string, $count?: boolean, $select?: Set<'id' | 'createdBy' | 'createdDateTime' | 'description' | 'eTag' | 'lastModifiedBy' | 'lastModifiedDateTime' | 'name' | 'parentReference' | 'webUrl' | 'driveType' | 'owner' | 'quota' | 'createdByUser' | 'lastModifiedByUser' | 'root' | 'special'>, $expand?: Set<'*' | 'root' | 'root/permissions/grantedTo/user' | 'special'>, options?: AxiosRequestConfig) { - return MeDrivesApiFp(this.configuration).listMyDrives($top, $skip, $orderby, $filter, $count, $select, $expand, options).then((request) => request(this.axios, this.basePath)); + public listMyDrives($orderby?: string, $filter?: string, options?: AxiosRequestConfig) { + return MeDrivesApiFp(this.configuration).listMyDrives($orderby, $filter, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/web-client/src/generated/base.ts b/packages/web-client/src/generated/base.ts index 4d7556b9fff..6828d4a6701 100644 --- a/packages/web-client/src/generated/base.ts +++ b/packages/web-client/src/generated/base.ts @@ -4,7 +4,7 @@ * Libre Graph API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v1.0.0 + * The version of the OpenAPI document: v1.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/web-client/src/generated/common.ts b/packages/web-client/src/generated/common.ts index 24f6e010b15..6426e0f3f03 100644 --- a/packages/web-client/src/generated/common.ts +++ b/packages/web-client/src/generated/common.ts @@ -4,7 +4,7 @@ * Libre Graph API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v1.0.0 + * The version of the OpenAPI document: v1.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/web-client/src/generated/configuration.ts b/packages/web-client/src/generated/configuration.ts index dba2c0d0f5b..592d03e1da6 100644 --- a/packages/web-client/src/generated/configuration.ts +++ b/packages/web-client/src/generated/configuration.ts @@ -4,7 +4,7 @@ * Libre Graph API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v1.0.0 + * The version of the OpenAPI document: v1.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/web-client/src/generated/index.ts b/packages/web-client/src/generated/index.ts index 89ed9b41b9e..2ea8cb510aa 100644 --- a/packages/web-client/src/generated/index.ts +++ b/packages/web-client/src/generated/index.ts @@ -4,7 +4,7 @@ * Libre Graph API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * - * The version of the OpenAPI document: v1.0.0 + * The version of the OpenAPI document: v1.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/packages/web-client/src/graph.ts b/packages/web-client/src/graph.ts index bfc8bd5dc7f..739dd6e68a2 100644 --- a/packages/web-client/src/graph.ts +++ b/packages/web-client/src/graph.ts @@ -83,7 +83,7 @@ export const graph = (baseURI: string, axiosClient: AxiosInstance): Graph => { }, drives: { listMyDrives: (orderBy?: string, filter?: string) => - meDrivesApi.listMyDrives(0, 0, orderBy, filter), + meDrivesApi.listMyDrives(orderBy, filter), getDrive: (id: string) => drivesApiFactory.getDrive(id), createDrive: (drive: Drive, options: any): AxiosPromise => drivesApiFactory.createDrive(drive, options), diff --git a/packages/web-client/src/helpers/space/functions.ts b/packages/web-client/src/helpers/space/functions.ts index f7456ea0207..8ccd85bfca1 100644 --- a/packages/web-client/src/helpers/space/functions.ts +++ b/packages/web-client/src/helpers/space/functions.ts @@ -86,7 +86,9 @@ export function buildSpace(data): SpaceResource { for (const permission of data.root.permissions) { for (const role of SpacePeopleShareRoles.list()) { if (permission.roles.includes(role.name)) { - spaceRoles[role.name].push(...permission.grantedTo.map((el) => el.user.id)) + spaceRoles[role.name].push( + ...permission.grantedToIdentities.filter((el) => !!el.user).map((el) => el.user.id) + ) } } } diff --git a/packages/web-client/tests/unit/helpers/space/functions.spec.ts b/packages/web-client/tests/unit/helpers/space/functions.spec.ts index 2f08436e926..3b5c3360792 100644 --- a/packages/web-client/tests/unit/helpers/space/functions.spec.ts +++ b/packages/web-client/tests/unit/helpers/space/functions.spec.ts @@ -12,7 +12,7 @@ describe('buildSpace', () => { ])('returns true for a viewer of the space', (data) => { const space = buildSpace({ root: { - permissions: [{ roles: data.role, grantedTo: [{ user: { id: uuid } }] }] + permissions: [{ roles: data.role, grantedToIdentities: [{ user: { id: uuid } }] }] } }) as ProjectSpaceResource expect(space.isViewer(uuid)).toBe(data.expectedResult) @@ -27,7 +27,7 @@ describe('buildSpace', () => { ])('returns true for a editor of the space', (data) => { const space = buildSpace({ root: { - permissions: [{ roles: data.role, grantedTo: [{ user: { id: uuid } }] }] + permissions: [{ roles: data.role, grantedToIdentities: [{ user: { id: uuid } }] }] } }) as ProjectSpaceResource expect(space.isEditor(uuid)).toBe(data.expectedResult) @@ -42,7 +42,7 @@ describe('buildSpace', () => { ])('returns true for a manager of the space', (data) => { const space = buildSpace({ root: { - permissions: [{ roles: data.role, grantedTo: [{ user: { id: uuid } }] }] + permissions: [{ roles: data.role, grantedToIdentities: [{ user: { id: uuid } }] }] } }) as ProjectSpaceResource expect(space.isManager(uuid)).toBe(data.expectedResult)