feat: 初始化项目
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
/**
|
||||
* 浏览器扩展与 API 共享的采集载荷最小契约。
|
||||
* 领域字段会随采集模块实现逐步补全,不能在扩展侧绕过此契约直接构造 API 请求。
|
||||
*/
|
||||
export const collectedProductPayloadSchema = z.object({
|
||||
source: z.object({
|
||||
platform: z.enum(['ozon', '1688', 'taobao', 'tmall']),
|
||||
itemKey: z.string().min(1),
|
||||
canonicalUrl: z.url(),
|
||||
collectedAt: z.iso.datetime(),
|
||||
parserVersion: z.string().min(1),
|
||||
}),
|
||||
common: z.object({
|
||||
title: z.string().min(1).optional(),
|
||||
}),
|
||||
variantAxes: z.array(z.unknown()),
|
||||
variants: z.array(z.unknown()),
|
||||
assets: z.array(z.unknown()),
|
||||
evidence: z.array(z.unknown()),
|
||||
});
|
||||
|
||||
export type CollectedProductPayload = z.infer<typeof collectedProductPayloadSchema>;
|
||||
Reference in New Issue
Block a user