Phase 1: version branching + public share links
Add parentVersionId/branchLabel to versions, enabling git-style branching. New /tree and /promote endpoints; VersionGraph (SVG) component as toggle next to the existing list view. Upload dropzone accepts a parent for branch uploads. Add public share links: new share_links table, /api/v1/share router with authenticated CRUD and a public /public/:token endpoint serving signed stream/waveform URLs. Comments now allow guests (nullable userId, guestName) so artists can leave timestamped feedback without an account. New /listen/:token standalone page with password gate, optional download, and guest comment form. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -24,9 +24,27 @@ export const createVersionSchema = z.object({
|
||||
originalFileName: z.string().min(1),
|
||||
mimeType: z.string().min(1),
|
||||
fileSize: z.number().int().positive(),
|
||||
parentVersionId: z.string().uuid().optional(),
|
||||
branchLabel: z.string().max(100).optional(),
|
||||
});
|
||||
|
||||
export const createShareLinkSchema = z.object({
|
||||
expiresAt: z.string().datetime().optional(),
|
||||
allowComments: z.boolean().optional(),
|
||||
allowDownload: z.boolean().optional(),
|
||||
password: z.string().min(1).max(255).optional(),
|
||||
});
|
||||
|
||||
export const guestCommentSchema = z.object({
|
||||
body: z.string().min(1).max(5000),
|
||||
timestampSeconds: z.number().nonnegative().optional(),
|
||||
parentId: z.string().uuid().optional(),
|
||||
guestName: z.string().min(1).max(100),
|
||||
});
|
||||
|
||||
export type CreateTrackInput = z.infer<typeof createTrackSchema>;
|
||||
export type UpdateTrackInput = z.infer<typeof updateTrackSchema>;
|
||||
export type RequestUploadUrlInput = z.infer<typeof requestUploadUrlSchema>;
|
||||
export type CreateVersionInput = z.infer<typeof createVersionSchema>;
|
||||
export type CreateShareLinkInput = z.infer<typeof createShareLinkSchema>;
|
||||
export type GuestCommentInput = z.infer<typeof guestCommentSchema>;
|
||||
|
||||
Reference in New Issue
Block a user