refactor: versioning and migration mechanism for public data structures (#3457)

Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
Andrew Bastin
2023-11-02 18:54:16 +05:30
committed by GitHub
parent 01df1663ad
commit cbe3e14b47
16 changed files with 758 additions and 490 deletions

View File

@@ -0,0 +1,18 @@
import { z } from "zod"
import { defineVersion } from "verzod"
export const V0_SCHEMA = z.object({
id: z.optional(z.string()),
name: z.string(),
variables: z.array(
z.object({
key: z.string(),
value: z.string(),
})
)
})
export default defineVersion({
initial: true,
schema: V0_SCHEMA
})