feat(media): scaffold mvp1 media and portfolio foundation
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export * from "./media"
|
||||
export * from "./rbac"
|
||||
|
||||
export const postStatusSchema = z.enum(["draft", "published"])
|
||||
|
||||
39
packages/content/src/media.ts
Normal file
39
packages/content/src/media.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const mediaAssetTypeSchema = z.enum([
|
||||
"artwork",
|
||||
"banner",
|
||||
"promotion",
|
||||
"video",
|
||||
"gif",
|
||||
"generic",
|
||||
])
|
||||
|
||||
export const artworkRenditionSlotSchema = z.enum(["thumbnail", "card", "full", "custom"])
|
||||
|
||||
export const createMediaAssetInputSchema = z.object({
|
||||
type: mediaAssetTypeSchema,
|
||||
title: z.string().min(1).max(180),
|
||||
description: z.string().max(5000).optional(),
|
||||
altText: z.string().max(1000).optional(),
|
||||
source: z.string().max(500).optional(),
|
||||
copyright: z.string().max(500).optional(),
|
||||
author: z.string().max(180).optional(),
|
||||
tags: z.array(z.string().min(1).max(100)).default([]),
|
||||
})
|
||||
|
||||
export const createArtworkInputSchema = z.object({
|
||||
title: z.string().min(1).max(180),
|
||||
slug: z.string().min(1).max(180),
|
||||
description: z.string().max(5000).optional(),
|
||||
medium: z.string().max(180).optional(),
|
||||
dimensions: z.string().max(180).optional(),
|
||||
year: z.number().int().min(1000).max(9999).optional(),
|
||||
framing: z.string().max(180).optional(),
|
||||
availability: z.string().max(180).optional(),
|
||||
})
|
||||
|
||||
export type MediaAssetType = z.infer<typeof mediaAssetTypeSchema>
|
||||
export type ArtworkRenditionSlot = z.infer<typeof artworkRenditionSlotSchema>
|
||||
export type CreateMediaAssetInput = z.infer<typeof createMediaAssetInputSchema>
|
||||
export type CreateArtworkInput = z.infer<typeof createArtworkInputSchema>
|
||||
Reference in New Issue
Block a user