mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-28 15:51:29 +08:00
310e4950b3
Replace pnpm workspace monorepo (packages/server, packages/web, packages/shared) with a flat single-package layout following Hono's pages-stack pattern. Switch from pnpm to npm and from Workers+Assets to CF Pages Functions deployment model. - Move source: packages/server/src/ → server/, packages/web/src/ → src/, packages/shared/src/ → shared/ - Add functions/api/[[route]].ts as CF Pages Functions entry (replaces entry-cloudflare.ts) - Update 22 import paths: server uses relative, web uses @shared/@server aliases - Merge three package.json into one, switch to npm - Update wrangler.toml: remove main/assets (Pages auto-detects functions/ dir) - Add per-directory tsconfig.json for VS Code type resolution - Simplify Dockerfile for flat layout - Fix react-pdf CSS import path (dist/esm/ → dist/) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
import { z } from 'zod'
|
|
|
|
export const createStorageSchema = z.object({
|
|
title: z.string().min(1),
|
|
mode: z.enum(['private', 'public']),
|
|
bucket: z.string().min(1),
|
|
endpoint: z.string().url(),
|
|
region: z.string().default('auto'),
|
|
accessKey: z.string().min(1),
|
|
secretKey: z.string().min(1),
|
|
filePath: z.string().default('$UID/$RAW_NAME'),
|
|
customHost: z.string().optional(),
|
|
capacity: z.number().int().min(0).default(0),
|
|
})
|
|
|
|
export const updateStorageSchema = z.object({
|
|
title: z.string().min(1).optional(),
|
|
mode: z.enum(['private', 'public']).optional(),
|
|
bucket: z.string().min(1).optional(),
|
|
endpoint: z.string().url().optional(),
|
|
region: z.string().optional(),
|
|
accessKey: z.string().min(1).optional(),
|
|
secretKey: z.string().min(1).optional(),
|
|
filePath: z.string().optional(),
|
|
customHost: z.string().optional(),
|
|
capacity: z.number().int().min(0).optional(),
|
|
status: z.enum(['active', 'disabled']).optional(),
|
|
})
|
|
|
|
export type CreateStorageInput = z.infer<typeof createStorageSchema>
|
|
export type UpdateStorageInput = z.infer<typeof updateStorageSchema>
|