feat(08-03): FavoriteLink schema + FavoritesModule (CRUD + SSRF icon discovery)
- Add FavoriteLink Prisma model (userId/tenantId/widgetId scope, iconUrl nullable, position) - IconDiscoveryService: port SSRF-protected icon discovery with redirect: 'manual', private IP / blocked-hostname checks, 4000ms timeout, 200k HTML cap (T-08-05) - FavoritesService: list/create/update/remove all scoped by userId (T-08-06 / Pitfall 3) - FavoritesController: GET /favorites?widgetId, POST, PATCH :id, DELETE :id - FavoritesModule registered in AppModule - tsc --noEmit passes for @tessera/api
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { IsInt, IsOptional, IsString, IsUrl } from 'class-validator';
|
||||
|
||||
/**
|
||||
* DTO for updating an existing FavoriteLink.
|
||||
* All fields are optional — only provided fields are updated.
|
||||
* iconUrl accepts null explicitly to clear a stored icon.
|
||||
*/
|
||||
export class UpdateFavoriteDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
title?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsUrl()
|
||||
url?: string;
|
||||
|
||||
/**
|
||||
* iconUrl can be a string (updated URL), null (clear icon), or absent (no change).
|
||||
* No strict type validation so null passes through to Prisma.
|
||||
*/
|
||||
@IsOptional()
|
||||
iconUrl?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsInt()
|
||||
position?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user