mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00

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>
22 lines
816 B
TypeScript
22 lines
816 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2025 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { z } from 'zod'
|
|
|
|
export const ServerVersionSchema = z
|
|
.object({
|
|
major: z.number().positive().describe('The major version of the server'),
|
|
minor: z.number().positive().describe('The minor version of the server'),
|
|
patch: z.number().positive().describe('The patch version of the server'),
|
|
preRelease: z
|
|
.string()
|
|
.optional()
|
|
.describe('The pre release text of the server'),
|
|
commit: z.string().optional().describe('The commit of the server'),
|
|
fullString: z.string().describe('The full version string of the server'),
|
|
})
|
|
.describe('The version of the HedgeDoc server.')
|
|
|
|
export type ServerVersionDto = z.infer<typeof ServerVersionSchema>
|