Files
speckle-server/packages/server/modules/workspaces/errors/workspace.ts
T
Kristaps Fabians Geikins ede566eed9 feat(server): serverInvites refactor + workspace invites CRUD & GQL API (#2530)
* prep for new resources algo

* typescriptifying stuff

* minor types fix

* migrate to resources col

* repo & creation updated, WIP processing/retrieval

* WIP invite processing

* finished finalization refactor

* project invite management

* transformed all invites services

* fixed up projects & core serverinvites resolvers

* test fixes

* WIP workspace create GQL & test

* basic invite creation test works

* a buncha working tests

* more tests

* cancelation tests

* minor invite use refactor

* invite retrieval tasks

* invite use() works as expected

* filtering out broken invites

* enabled invite retrieval by token irregardless of who is it for

* minor adjustments

* tests fix

* test config improvements

* test env adjustment

* extra test case

* making resource access limits harder to ignore

* linter fixes

* eventBus type cleanup

* better generic names

* refactored serverinvites resource migration

* fix(server): better error message in project invite edge case
2024-07-29 14:37:54 +03:00

35 lines
1.1 KiB
TypeScript

import { BaseError } from '@/modules/shared/errors/base'
export class WorkspaceAdminRequiredError extends BaseError {
static defaultMessage = 'Cannot remove last admin from a workspace'
static code = 'WORKSPACE_ADMIN_REQUIRED_ERROR'
static statusCode = 400
}
export class WorkspaceInvalidRoleError extends BaseError {
static defaultMessage = 'Invalid workspace role provided'
static code = 'WORKSPACE_INVALID_ROLE_ERROR'
}
export class WorkspaceQueryError extends BaseError {
static defaultMessage = 'Unexpected error during query operation'
static code = 'WORKSPACE_QUERY_ERROR'
}
export class WorkspacesNotAuthorizedError extends BaseError {
static defaultMessage = 'You are not authorized'
static code = 'WORKSPACES_NOT_AUTHORIZED_ERROR'
static statusCode = 401
}
export class WorkspacesNotYetImplementedError extends BaseError {
static defaultMessage = 'Not yet implemented'
static code = 'WORKSPACES_NOT_YET_IMPLEMENTED_ERROR'
}
export class WorkspaceNotFoundError extends BaseError {
static defaultMessage = 'Workspace not found'
static code = 'WORKSPACE_NOT_FOUND_ERROR'
static statusCode = 404
}