diff --git a/src/infra/authorization/authorization-api-client/.openapi-generator-ignore b/src/infra/authorization/authorization-api-client/.openapi-generator-ignore index a32205e7..a08667f7 100644 --- a/src/infra/authorization/authorization-api-client/.openapi-generator-ignore +++ b/src/infra/authorization/authorization-api-client/.openapi-generator-ignore @@ -34,4 +34,4 @@ models/* !models/api-validation-error.ts !models/authorization-body-params.ts !models/authorization-context-params.ts -!models/authorized-reponse.ts +!models/authorized-response.ts diff --git a/src/infra/authorization/authorization-api-client/.openapi-generator/FILES b/src/infra/authorization/authorization-api-client/.openapi-generator/FILES index 38162f8b..b616464e 100644 --- a/src/infra/authorization/authorization-api-client/.openapi-generator/FILES +++ b/src/infra/authorization/authorization-api-client/.openapi-generator/FILES @@ -4,5 +4,5 @@ index.ts models/api-validation-error.ts models/authorization-body-params.ts models/authorization-context-params.ts -models/authorized-reponse.ts +models/authorized-response.ts runtime.ts diff --git a/src/infra/authorization/authorization-api-client/apis/authorization-api.ts b/src/infra/authorization/authorization-api-client/apis/authorization-api.ts index 924ef9af..b7fc3f96 100644 --- a/src/infra/authorization/authorization-api-client/apis/authorization-api.ts +++ b/src/infra/authorization/authorization-api-client/apis/authorization-api.ts @@ -17,15 +17,15 @@ import * as runtime from '../runtime.js'; import type { ApiValidationError, AuthorizationBodyParams, - AuthorizedReponse, + AuthorizedResponse, } from '../models/index.js'; import { ApiValidationErrorFromJSON, ApiValidationErrorToJSON, AuthorizationBodyParamsFromJSON, AuthorizationBodyParamsToJSON, - AuthorizedReponseFromJSON, - AuthorizedReponseToJSON, + AuthorizedResponseFromJSON, + AuthorizedResponseToJSON, } from '../models/index.js'; export interface AuthorizationReferenceControllerAuthorizeByReferenceRequest { @@ -47,12 +47,12 @@ export interface AuthorizationApiInterface { * @throws {RequiredError} * @memberof AuthorizationApiInterface */ - authorizationReferenceControllerAuthorizeByReferenceRaw(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; + authorizationReferenceControllerAuthorizeByReferenceRaw(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise>; /** * Checks if user is authorized to perform the given operation. */ - authorizationReferenceControllerAuthorizeByReference(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; + authorizationReferenceControllerAuthorizeByReference(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise; } @@ -64,7 +64,7 @@ export class AuthorizationApi extends runtime.BaseAPI implements AuthorizationAp /** * Checks if user is authorized to perform the given operation. */ - async authorizationReferenceControllerAuthorizeByReferenceRaw(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + async authorizationReferenceControllerAuthorizeByReferenceRaw(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { if (requestParameters['authorizationBodyParams'] == null) { throw new runtime.RequiredError( 'authorizationBodyParams', @@ -94,13 +94,13 @@ export class AuthorizationApi extends runtime.BaseAPI implements AuthorizationAp body: AuthorizationBodyParamsToJSON(requestParameters['authorizationBodyParams']), }, initOverrides); - return new runtime.JSONApiResponse(response, (jsonValue) => AuthorizedReponseFromJSON(jsonValue)); + return new runtime.JSONApiResponse(response, (jsonValue) => AuthorizedResponseFromJSON(jsonValue)); } /** * Checks if user is authorized to perform the given operation. */ - async authorizationReferenceControllerAuthorizeByReference(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + async authorizationReferenceControllerAuthorizeByReference(requestParameters: AuthorizationReferenceControllerAuthorizeByReferenceRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { const response = await this.authorizationReferenceControllerAuthorizeByReferenceRaw(requestParameters, initOverrides); return await response.value(); } diff --git a/src/infra/authorization/authorization-api-client/models/authorization-context-params.ts b/src/infra/authorization/authorization-api-client/models/authorization-context-params.ts index 7a0daee3..c97dcaa4 100644 --- a/src/infra/authorization/authorization-api-client/models/authorization-context-params.ts +++ b/src/infra/authorization/authorization-api-client/models/authorization-context-params.ts @@ -55,9 +55,17 @@ export const AuthorizationContextParamsRequiredPermissions = { ADMIN_EDIT: 'ADMIN_EDIT', ADMIN_VIEW: 'ADMIN_VIEW', BASE_VIEW: 'BASE_VIEW', + BOARD_VIEW: 'BOARD_VIEW', + BOARD_EDIT: 'BOARD_EDIT', + BOARD_SHARE_BOARD: 'BOARD_SHARE_BOARD', + BOARD_MANAGE_VIDEOCONFERENCE: 'BOARD_MANAGE_VIDEOCONFERENCE', + BOARD_MANAGE_READERS_CAN_EDIT: 'BOARD_MANAGE_READERS_CAN_EDIT', + BOARD_MANAGE: 'BOARD_MANAGE', + BOARD_RELOCATE_CONTENT: 'BOARD_RELOCATE_CONTENT', CALENDAR_CREATE: 'CALENDAR_CREATE', CALENDAR_EDIT: 'CALENDAR_EDIT', CALENDAR_VIEW: 'CALENDAR_VIEW', + CAN_EXECUTE_INSTANCE_OPERATIONS: 'CAN_EXECUTE_INSTANCE_OPERATIONS', CHANGE_TEAM_ROLES: 'CHANGE_TEAM_ROLES', CLASS_CREATE: 'CLASS_CREATE', CLASS_EDIT: 'CLASS_EDIT', @@ -118,14 +126,17 @@ export const AuthorizationContextParamsRequiredPermissions = { IMPORT_USER_UPDATE: 'IMPORT_USER_UPDATE', IMPORT_USER_VIEW: 'IMPORT_USER_VIEW', INSTANCE_VIEW: 'INSTANCE_VIEW', + INSTANCE_EDIT: 'INSTANCE_EDIT', INVITE_ADMINISTRATORS: 'INVITE_ADMINISTRATORS', - INVITE_EXPERTS: 'INVITE_EXPERTS', + INVITE_EXTERNAL_PERSONS: 'INVITE_EXTERNAL_PERSONS', JOIN_MEETING: 'JOIN_MEETING', LEAVE_TEAM: 'LEAVE_TEAM', LERNSTORE_VIEW: 'LERNSTORE_VIEW', LESSONS_CREATE: 'LESSONS_CREATE', LESSONS_VIEW: 'LESSONS_VIEW', LINK_CREATE: 'LINK_CREATE', + MEDIA_SCHOOL_LICENSE_ADMIN: 'MEDIA_SCHOOL_LICENSE_ADMIN', + MEDIA_SOURCE_ADMIN: 'MEDIA_SOURCE_ADMIN', NEWS_CREATE: 'NEWS_CREATE', NEWS_EDIT: 'NEWS_EDIT', NEWS_VIEW: 'NEWS_VIEW', @@ -148,10 +159,24 @@ export const AuthorizationContextParamsRequiredPermissions = { ROLE_CREATE: 'ROLE_CREATE', ROLE_EDIT: 'ROLE_EDIT', ROLE_VIEW: 'ROLE_VIEW', + ROOM_EDIT_CONTENT: 'ROOM_EDIT_CONTENT', + ROOM_EDIT_ROOM: 'ROOM_EDIT_ROOM', + ROOM_LIST_CONTENT: 'ROOM_LIST_CONTENT', + ROOM_DELETE_ROOM: 'ROOM_DELETE_ROOM', + ROOM_LEAVE_ROOM: 'ROOM_LEAVE_ROOM', + ROOM_COPY_ROOM: 'ROOM_COPY_ROOM', + ROOM_SHARE_ROOM: 'ROOM_SHARE_ROOM', + ROOM_ADD_MEMBERS: 'ROOM_ADD_MEMBERS', + ROOM_REMOVE_MEMBERS: 'ROOM_REMOVE_MEMBERS', + ROOM_CHANGE_ROLES: 'ROOM_CHANGE_ROLES', + ROOM_CHANGE_OWNER: 'ROOM_CHANGE_OWNER', + ROOM_MANAGE_INVITATIONLINKS: 'ROOM_MANAGE_INVITATIONLINKS', + ROOM_LIST_DRAFTS: 'ROOM_LIST_DRAFTS', + ROOM_MANAGE_VIDEOCONFERENCES: 'ROOM_MANAGE_VIDEOCONFERENCES', + SCHOOL_ADMINISTRATE_ROOMS: 'SCHOOL_ADMINISTRATE_ROOMS', SCHOOL_CHAT_MANAGE: 'SCHOOL_CHAT_MANAGE', SCHOOL_CREATE: 'SCHOOL_CREATE', SCHOOL_EDIT: 'SCHOOL_EDIT', - SCHOOL_EDIT_ALL: 'SCHOOL_EDIT_ALL', SCHOOL_LOGO_MANAGE: 'SCHOOL_LOGO_MANAGE', SCHOOL_NEWS_EDIT: 'SCHOOL_NEWS_EDIT', SCHOOL_PERMISSION_CHANGE: 'SCHOOL_PERMISSION_CHANGE', @@ -160,6 +185,14 @@ export const AuthorizationContextParamsRequiredPermissions = { SCHOOL_SYSTEM_EDIT: 'SCHOOL_SYSTEM_EDIT', SCHOOL_SYSTEM_VIEW: 'SCHOOL_SYSTEM_VIEW', SCHOOL_TOOL_ADMIN: 'SCHOOL_TOOL_ADMIN', + SCHOOL_VIEW: 'SCHOOL_VIEW', + SCHOOL_BECOME_ROOMOWNER: 'SCHOOL_BECOME_ROOMOWNER', + SCHOOL_CREATE_ROOM: 'SCHOOL_CREATE_ROOM', + SCHOOL_EDIT_ROOM: 'SCHOOL_EDIT_ROOM', + SCHOOL_DELETE_ROOM: 'SCHOOL_DELETE_ROOM', + SCHOOL_LIST_DISCOVERABLE_TEACHERS: 'SCHOOL_LIST_DISCOVERABLE_TEACHERS', + SCHOOL_LIST_ROOM_MEMBERS: 'SCHOOL_LIST_ROOM_MEMBERS', + SCHOOL_MANAGE_ROOM_INVITATIONLINKS: 'SCHOOL_MANAGE_ROOM_INVITATIONLINKS', SCOPE_PERMISSIONS_VIEW: 'SCOPE_PERMISSIONS_VIEW', START_MEETING: 'START_MEETING', STUDENT_CREATE: 'STUDENT_CREATE', @@ -196,7 +229,6 @@ export const AuthorizationContextParamsRequiredPermissions = { TOPIC_EDIT: 'TOPIC_EDIT', TOPIC_VIEW: 'TOPIC_VIEW', UPLOAD_FILES: 'UPLOAD_FILES', - USE_LIBREOFFICE: 'USE_LIBREOFFICE', USE_ROCKETCHAT: 'USE_ROCKETCHAT', USERGROUP_CREATE: 'USERGROUP_CREATE', USERGROUP_EDIT: 'USERGROUP_EDIT', diff --git a/src/infra/authorization/authorization-api-client/models/authorized-reponse.ts b/src/infra/authorization/authorization-api-client/models/authorized-response.ts similarity index 58% rename from src/infra/authorization/authorization-api-client/models/authorized-reponse.ts rename to src/infra/authorization/authorization-api-client/models/authorized-response.ts index b0efb4a0..ecc6011f 100644 --- a/src/infra/authorization/authorization-api-client/models/authorized-reponse.ts +++ b/src/infra/authorization/authorization-api-client/models/authorized-response.ts @@ -16,37 +16,37 @@ import { mapValues } from '../runtime.js'; /** * * @export - * @interface AuthorizedReponse + * @interface AuthorizedResponse */ -export interface AuthorizedReponse { +export interface AuthorizedResponse { /** * * @type {string} - * @memberof AuthorizedReponse + * @memberof AuthorizedResponse */ userId: string; /** * * @type {boolean} - * @memberof AuthorizedReponse + * @memberof AuthorizedResponse */ isAuthorized: boolean; } /** - * Check if a given object implements the AuthorizedReponse interface. + * Check if a given object implements the AuthorizedResponse interface. */ -export function instanceOfAuthorizedReponse(value: object): value is AuthorizedReponse { +export function instanceOfAuthorizedResponse(value: object): value is AuthorizedResponse { if (!('userId' in value) || value['userId'] === undefined) return false; if (!('isAuthorized' in value) || value['isAuthorized'] === undefined) return false; return true; } -export function AuthorizedReponseFromJSON(json: any): AuthorizedReponse { - return AuthorizedReponseFromJSONTyped(json, false); +export function AuthorizedResponseFromJSON(json: any): AuthorizedResponse { + return AuthorizedResponseFromJSONTyped(json, false); } -export function AuthorizedReponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthorizedReponse { +export function AuthorizedResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthorizedResponse { if (json == null) { return json; } @@ -57,11 +57,11 @@ export function AuthorizedReponseFromJSONTyped(json: any, ignoreDiscriminator: b }; } - export function AuthorizedReponseToJSON(json: any): AuthorizedReponse { - return AuthorizedReponseToJSONTyped(json, false); + export function AuthorizedResponseToJSON(json: any): AuthorizedResponse { + return AuthorizedResponseToJSONTyped(json, false); } - export function AuthorizedReponseToJSONTyped(value?: AuthorizedReponse | null, ignoreDiscriminator: boolean = false): any { + export function AuthorizedResponseToJSONTyped(value?: AuthorizedResponse | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } diff --git a/src/infra/authorization/authorization-api-client/models/index.ts b/src/infra/authorization/authorization-api-client/models/index.ts index 967c7957..c1b8ff3a 100644 --- a/src/infra/authorization/authorization-api-client/models/index.ts +++ b/src/infra/authorization/authorization-api-client/models/index.ts @@ -3,4 +3,4 @@ export * from './api-validation-error.js'; export * from './authorization-body-params.js'; export * from './authorization-context-params.js'; -export * from './authorized-reponse.js'; +export * from './authorized-response.js'; diff --git a/src/infra/authorization/authorization.service.spec.ts b/src/infra/authorization/authorization.service.spec.ts index fa3c89ec..8041d17e 100644 --- a/src/infra/authorization/authorization.service.spec.ts +++ b/src/infra/authorization/authorization.service.spec.ts @@ -3,7 +3,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { HttpRequest } from 'uWebSockets.js'; import { WebSocketCloseCode } from '../../shared/type/websocket-close-code.js'; import { Logger } from '../logger/index.js'; -import { AuthorizationApi, AuthorizedReponse } from './authorization-api-client/index.js'; +import { AuthorizationApi, AuthorizedResponse } from './authorization-api-client/index.js'; import { AuthorizationService } from './authorization.service.js'; describe(AuthorizationService.name, () => { @@ -51,7 +51,7 @@ describe(AuthorizationService.name, () => { const setup = () => { const { req } = setupRequest(); - const response = createMock({ + const response = createMock({ isAuthorized: true, userId: '123', }); @@ -75,7 +75,7 @@ describe(AuthorizationService.name, () => { const setup = () => { const { req } = setupRequest(); - const response = createMock({ + const response = createMock({ isAuthorized: false, userId: '123', });