@withpotter/gallery — module reference
HTTP routes this module mounts, plus its internal use-cases, entities, and repositories. The exhaustive request/response contract is the engine’s OpenAPI document at /docs; the layered structure below follows the package internal architecture.
HTTP routes
Gallery /gallery
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /gallery | Yes | Get all gallery items |
GET | /gallery/:id | Yes | Get a gallery item by ID |
GET | /gallery/categories | Yes | Get all categories with counts |
GET | /gallery/public | — | Get public gallery items for website |
GET | /gallery/public/before-after | — | Get before/after comparison items |
GET | /gallery/public/featured | — | Get featured gallery items |
GET | /gallery/stats | Yes | Get gallery statistics |
GET | /gallery/tags | Yes | Get all tags |
POST | /gallery | Yes | Create a new gallery item |
POST | /gallery/bulk | Yes | Create multiple gallery items |
POST | /gallery/move-category | Yes | Move items to a category |
POST | /gallery/reorder | Yes | Reorder gallery items |
POST | /gallery/set-status | Yes | Set status for multiple items |
PUT | /gallery/:id | Yes | Update a gallery item |
PUT | /gallery/:id/toggle-featured | Yes | Toggle featured status |
DELETE | /gallery/:id | Yes | Delete a gallery item |
DELETE | /gallery/bulk | Yes | Delete multiple items |
Internals
Use-cases
Application operations. Each is a single-purpose class with one execute() method.
| Use-case | Signature |
|---|---|
BulkCreateGalleryItemsUseCase | execute(tenantId: string, dtos: CreateGalleryItemDto[]) |
BulkDeleteGalleryItemsUseCase | execute(tenantId: string, ids: string[]) |
CreateGalleryItemUseCase | execute(tenantId: string, dto: CreateGalleryItemDto) |
DeleteGalleryItemUseCase | execute(tenantId: string, itemId: string) |
GetBeforeAfterItemsUseCase | execute(tenantId: string, limit: number = 10) |
GetFeaturedItemsUseCase | execute(tenantId: string, limit: number = 10) |
GetGalleryCategoriesUseCase | execute(tenantId: string) |
GetGalleryItemUseCase | execute(tenantId: string, itemId: string) |
GetGalleryStatsUseCase | execute(tenantId: string) |
GetGalleryTagsUseCase | execute(tenantId: string) |
GetPublicGalleryUseCase | execute(tenantId: string, options?: { category?: string; featured?: boolean; limit?: number }) |
ListGalleryItemsUseCase | execute(tenantId: string, query: ListGalleryItemsQuery) |
MoveToCategoryUseCase | execute(tenantId: string, ids: string[], category: string | null) |
ReorderGalleryItemsUseCase | execute(tenantId: string, dto: ReorderItemsDto) |
SetGalleryStatusUseCase | execute(tenantId: string, ids: string[], status: GalleryItemStatus) |
ToggleFeaturedUseCase | execute(tenantId: string, itemId: string) |
UpdateGalleryItemUseCase | execute(tenantId: string, itemId: string, dto: UpdateGalleryItemDto) |
Entities
Sequelize models owned by this module.
GalleryItem — table gallery_items
| Field | Type |
|---|---|
id | string |
tenantId | string |
tenant | Tenant |
title | string | null |
description | string | null |
altText | string | null |
type | GalleryItemType |
url | string |
thumbnailUrl | string | null |
mimeType | string | null |
fileSize | number | null |
width | number | null |
height | number | null |
category | string | null |
tags | string[] |
status | GalleryItemStatus |
sortOrder | number |
featured | boolean |
beforeImageUrl | string | null |
isBeforeAfter | boolean |
metadata | Record<string, unknown> | null |
createdAt | Date |
updatedAt | Date |
Repositories
Data-access classes wrapping the entities.
GalleryRepository
createForTenant · createManyForTenant · findAllForTenant · findByTenant · findByTenantOrFail · updateForTenant · deleteForTenant · deleteManyForTenant · reorder · moveToCategory · setStatus · toggleFeatured · getCategories · getAllTags · getStats · getFeaturedItems · getBeforeAfterItems
Generated from the module’s source. Routes are relative to the engine root
(default http://localhost:3001). For full request/response schemas use the live
OpenAPI document.