mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-29 06:15:29 -04:00
feat(commons): add DTOs
Moving the DTOs to commons so frontend and backend use the same types. Also introducing zod for validation. Co-authored-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: Erik Michelson <github@erik.michelson.eu> Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
aa87ff35b3
commit
4b5bf870f2
65 changed files with 1211 additions and 48 deletions
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2024 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export enum ProviderType {
|
||||
GUEST = 'guest',
|
||||
LOCAL = 'local',
|
||||
LDAP = 'ldap',
|
||||
OIDC = 'oidc',
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export enum GuestAccess {
|
||||
DENY = 'deny',
|
||||
READ = 'read',
|
||||
WRITE = 'write',
|
||||
CREATE = 'create',
|
||||
}
|
||||
|
||||
export function getGuestAccessOrdinal(guestAccess: GuestAccess): number {
|
||||
switch (guestAccess) {
|
||||
case GuestAccess.DENY:
|
||||
return 0;
|
||||
case GuestAccess.READ:
|
||||
return 1;
|
||||
case GuestAccess.WRITE:
|
||||
return 2;
|
||||
case GuestAccess.CREATE:
|
||||
return 3;
|
||||
default:
|
||||
throw Error('Unknown permission');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue