mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
Support video issue attachments
This commit is contained in:
parent
911a1e8b0d
commit
75f88c588c
12 changed files with 262 additions and 11 deletions
|
|
@ -282,6 +282,7 @@ export {
|
|||
export {
|
||||
createIssueWorkProductSchema,
|
||||
updateIssueWorkProductSchema,
|
||||
attachmentArtifactWorkProductMetadataSchema,
|
||||
issueWorkProductTypeSchema,
|
||||
issueWorkProductStatusSchema,
|
||||
issueWorkProductReviewStateSchema,
|
||||
|
|
|
|||
19
packages/shared/src/validators/work-product.test.ts
Normal file
19
packages/shared/src/validators/work-product.test.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { attachmentArtifactWorkProductMetadataSchema } from "./work-product.js";
|
||||
|
||||
describe("attachmentArtifactWorkProductMetadataSchema", () => {
|
||||
it("accepts the attachment-backed artifact metadata contract", () => {
|
||||
const parsed = attachmentArtifactWorkProductMetadataSchema.parse({
|
||||
attachmentId: "11111111-1111-4111-8111-111111111111",
|
||||
contentType: "video/mp4",
|
||||
byteSize: 1234,
|
||||
contentPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content",
|
||||
openPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content",
|
||||
downloadPath: "/api/attachments/11111111-1111-4111-8111-111111111111/content?download=1",
|
||||
originalFilename: "demo.mp4",
|
||||
});
|
||||
|
||||
expect(parsed.contentType).toBe("video/mp4");
|
||||
expect(parsed.downloadPath).toContain("download=1");
|
||||
});
|
||||
});
|
||||
|
|
@ -29,6 +29,18 @@ export const issueWorkProductReviewStateSchema = z.enum([
|
|||
"changes_requested",
|
||||
]);
|
||||
|
||||
export const attachmentArtifactWorkProductMetadataSchema = z.object({
|
||||
attachmentId: z.string().uuid(),
|
||||
contentType: z.string().min(1),
|
||||
byteSize: z.number().int().nonnegative(),
|
||||
contentPath: z.string().min(1),
|
||||
openPath: z.string().min(1),
|
||||
downloadPath: z.string().min(1),
|
||||
originalFilename: z.string().optional().nullable(),
|
||||
});
|
||||
|
||||
export type AttachmentArtifactWorkProductMetadata = z.infer<typeof attachmentArtifactWorkProductMetadataSchema>;
|
||||
|
||||
export const createIssueWorkProductSchema = z.object({
|
||||
projectId: z.string().uuid().optional().nullable(),
|
||||
executionWorkspaceId: z.string().uuid().optional().nullable(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue