mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 01:50:39 +09:00
Support video issue attachments
This commit is contained in:
parent
911a1e8b0d
commit
75f88c588c
12 changed files with 262 additions and 11 deletions
|
|
@ -411,6 +411,7 @@ export type {
|
|||
DocumentTextProjection,
|
||||
DocumentTextRange,
|
||||
UpdateDocumentAnnotationThreadRequest,
|
||||
AttachmentArtifactWorkProductMetadata,
|
||||
Issue,
|
||||
IssueAssigneeAdapterOverrides,
|
||||
IssueBlockerAttention,
|
||||
|
|
@ -921,6 +922,7 @@ export {
|
|||
createIssueAttachmentMetadataSchema,
|
||||
createIssueWorkProductSchema,
|
||||
updateIssueWorkProductSchema,
|
||||
attachmentArtifactWorkProductMetadataSchema,
|
||||
issueWorkProductTypeSchema,
|
||||
issueWorkProductStatusSchema,
|
||||
issueWorkProductReviewStateSchema,
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ export type {
|
|||
IssueWorkProductProvider,
|
||||
IssueWorkProductStatus,
|
||||
IssueWorkProductReviewState,
|
||||
AttachmentArtifactWorkProductMetadata,
|
||||
} from "./work-product.js";
|
||||
export type {
|
||||
Issue,
|
||||
|
|
|
|||
|
|
@ -845,4 +845,6 @@ export interface IssueAttachment {
|
|||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
contentPath: string;
|
||||
openPath?: string;
|
||||
downloadPath?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,3 +53,13 @@ export interface IssueWorkProduct {
|
|||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
export interface AttachmentArtifactWorkProductMetadata {
|
||||
attachmentId: string;
|
||||
contentType: string;
|
||||
byteSize: number;
|
||||
contentPath: string;
|
||||
openPath: string;
|
||||
downloadPath: string;
|
||||
originalFilename?: string | null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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