eile mit weile : components

This commit is contained in:
Code 2025-01-30 18:28:49 +01:00
parent aeb81068ff
commit 684a18bc81
3 changed files with 1050 additions and 60 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -2,6 +2,31 @@ import * as path from 'path'
import * as fs from 'fs'
import { z } from "zod";
export const ExifSchema = z.object({
file: z.any(), // Assuming File is another schema or any type
jfif: z.any(), // Assuming Jfif is another schema or any type
exif: z.any(), // Assuming Exif2 is another schema or any type
gps: z.any() // Assuming Gps is another schema or any type
});
export const ImageMetaSchema = z.object({
format: z.string(),
width: z.number(),
height: z.number(),
space: z.string(),
channels: z.number(),
depth: z.string(),
density: z.number(),
chromaSubsampling: z.string(),
isProgressive: z.boolean(),
resolutionUnit: z.string(),
hasProfile: z.boolean(),
hasAlpha: z.boolean(),
orientation: z.number(),
exif: z.any() // Assuming Exif is another schema or any type
});
export const CADMetaSchema = z.object({
url: z.string(),
name: z.string(),
@ -9,14 +34,25 @@ export const CADMetaSchema = z.object({
model: z.string(),
html: z.string()
});
export const AssetImageSchema = z.object({
name: z.string().optional(),
url: z.string(),
thumb: z.string().optional(),
responsive: z.string().optional(),
meta: z.any().optional(),
keywords: z.array(z.string()).optional(),
description: z.string().optional(),
alt: z.string().optional(),
title: z.string().optional(),
height: z.number().optional(),
width: z.number().optional()
});
// Author schema
export const AuthorSchema = z.object({
name: z.string(),
url: z.string(),
});
// Content schema
export const ContentSchema = z.object({
body: z.string().optional(),
features: z.string().optional(),
@ -25,21 +61,18 @@ export const ContentSchema = z.object({
license: z.string().optional()
});
// Assets schema
export const AssetsSchema = z.object({
gallery: z.array(z.string()).optional(),
renderings: z.array(z.string()).optional(),
components: z.array(z.string()).optional()
gallery: z.array(AssetImageSchema).optional(),
renderings: z.array(AssetImageSchema).optional(),
components: z.array(AssetImageSchema).optional()
});
// Production schema
export const ProductionSchema = z.object({
"fusion-folder": z.string(),
"nc-folder": z.string(),
cam: z.array(AuthorSchema),
cam: z.array(AuthorSchema)
});
// Component config schema
export const ComponentConfigSchema = z.object({
// shop
@ -58,7 +91,7 @@ export const ComponentConfigSchema = z.object({
alternatives: z.array(z.string()).optional(),
flags: z.number().optional(),
image: z.string().optional(),
image: AssetImageSchema.optional(),
name: z.string(),
// public