REST endpoints for accessing and managing the user’s photo gallery
packages/cloud/src/routes/gallery.routes.ts:19-37
validateGlassesAuth
GalleryPhoto.findByUserId()
with email from decoded tokenParameter | Type | Description |
---|---|---|
photoId | string | The ID of the photo to delete (in URL) |
packages/cloud/src/routes/gallery.routes.ts:44-88
uploads
directory (if exists)decodedToken.email
while the DELETE endpoint uses decodedToken.userId
. This should be standardized to use the same field.Code | Description |
---|---|
401 | Unauthorized - invalid glasses token |
403 | Forbidden - user doesn’t own the photo |
404 | Photo not found |
500 | Internal server error |
_id
: Unique photo identifieruserId
: Owner’s user IDuserEmail
: Owner’s email addressfilename
: Generated filenameuploadedAt
: Upload timestampsize
: File size in bytesmimeType
: Image MIME typemetadata
: Additional photo metadata including:
requestId
: The original photo request IDorigin
: Source of the photo (e.g., “app”)packageName
: App that requested the photoGalleryPhoto
modeluploads
directory