attachment-ref.ts 579 B

1234567891011121314151617
  1. import { z } from "zod";
  2. import { attachmentSourceKindSchema } from "../attachment-source.js";
  3. /** 仅承载已提交内容引用与展示元信息;内容本体不进入 command/topic frame。 */
  4. export const attachmentRefSchema = z
  5. .object({
  6. ref: z.string(),
  7. fileName: z.string(),
  8. mime: z.string(),
  9. bytes: z.number(),
  10. sourceKind: attachmentSourceKindSchema.optional(),
  11. messageCount: z.number().int().nonnegative().optional(),
  12. previewRef: z.string().optional(),
  13. })
  14. .strict();
  15. export type AttachmentRef = z.infer<typeof attachmentRefSchema>;