add metadata to config-yaml
This commit is contained in:
parent
974890223c
commit
e76fda0975
1 changed files with 10 additions and 0 deletions
|
|
@ -48,10 +48,20 @@ export const blockItemWrapperSchema = <T extends z.AnyZodObject>(schema: T) =>
|
|||
export const blockOrSchema = <T extends z.AnyZodObject>(schema: T) =>
|
||||
z.union([schema, blockItemWrapperSchema(schema)]);
|
||||
|
||||
export const commonMetadataSchema = z.object({
|
||||
tags: z.string().optional(),
|
||||
sourceCodeUrl: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
author: z.string().optional(),
|
||||
license: z.string().optional(),
|
||||
iconUrl: z.string().optional(),
|
||||
});
|
||||
|
||||
export const baseConfigYamlSchema = z.object({
|
||||
name: z.string(),
|
||||
version: z.string(),
|
||||
schema: z.string().optional(),
|
||||
metadata: z.record(z.string()).and(commonMetadataSchema.partial()).optional(),
|
||||
});
|
||||
|
||||
export const configYamlSchema = baseConfigYamlSchema.extend({
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue