feat: add share link service, API routes, and short URL redirect

Create share.service.ts with token generation (128-bit base64url),
CRUD operations, validation, and visibility transition side effects.
Add share endpoints under /api/setups/:id/shares, shared access at
/api/shared/:token, and /s/:token short URL redirect.

Plan: 32-02 (Setup Sharing System - Share Link Backend)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 17:59:39 +02:00
parent 7a696f39a5
commit da159d10b8
6 changed files with 507 additions and 1 deletions

View File

@@ -96,6 +96,12 @@ export const updateSetupSchema = z.object({
visibility: z.enum(["private", "link", "public"]).optional(),
});
export const createShareLinkSchema = z.object({
expiresInDays: z
.union([z.literal(7), z.literal(14), z.literal(30), z.null()])
.default(14),
});
export const syncSetupItemsSchema = z.object({
itemIds: z.array(z.number().int().positive()),
});