@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

MethodPathAuthDescription
GET/galleryYesGet all gallery items
GET/gallery/:idYesGet a gallery item by ID
GET/gallery/categoriesYesGet all categories with counts
GET/gallery/publicGet public gallery items for website
GET/gallery/public/before-afterGet before/after comparison items
GET/gallery/public/featuredGet featured gallery items
GET/gallery/statsYesGet gallery statistics
GET/gallery/tagsYesGet all tags
POST/galleryYesCreate a new gallery item
POST/gallery/bulkYesCreate multiple gallery items
POST/gallery/move-categoryYesMove items to a category
POST/gallery/reorderYesReorder gallery items
POST/gallery/set-statusYesSet status for multiple items
PUT/gallery/:idYesUpdate a gallery item
PUT/gallery/:id/toggle-featuredYesToggle featured status
DELETE/gallery/:idYesDelete a gallery item
DELETE/gallery/bulkYesDelete multiple items

Internals

Use-cases

Application operations. Each is a single-purpose class with one execute() method.

Use-caseSignature
BulkCreateGalleryItemsUseCaseexecute(tenantId: string, dtos: CreateGalleryItemDto[])
BulkDeleteGalleryItemsUseCaseexecute(tenantId: string, ids: string[])
CreateGalleryItemUseCaseexecute(tenantId: string, dto: CreateGalleryItemDto)
DeleteGalleryItemUseCaseexecute(tenantId: string, itemId: string)
GetBeforeAfterItemsUseCaseexecute(tenantId: string, limit: number = 10)
GetFeaturedItemsUseCaseexecute(tenantId: string, limit: number = 10)
GetGalleryCategoriesUseCaseexecute(tenantId: string)
GetGalleryItemUseCaseexecute(tenantId: string, itemId: string)
GetGalleryStatsUseCaseexecute(tenantId: string)
GetGalleryTagsUseCaseexecute(tenantId: string)
GetPublicGalleryUseCaseexecute(tenantId: string, options?: { category?: string; featured?: boolean; limit?: number })
ListGalleryItemsUseCaseexecute(tenantId: string, query: ListGalleryItemsQuery)
MoveToCategoryUseCaseexecute(tenantId: string, ids: string[], category: string | null)
ReorderGalleryItemsUseCaseexecute(tenantId: string, dto: ReorderItemsDto)
SetGalleryStatusUseCaseexecute(tenantId: string, ids: string[], status: GalleryItemStatus)
ToggleFeaturedUseCaseexecute(tenantId: string, itemId: string)
UpdateGalleryItemUseCaseexecute(tenantId: string, itemId: string, dto: UpdateGalleryItemDto)

Entities

Sequelize models owned by this module.

FieldType
idstring
tenantIdstring
tenantTenant
titlestring | null
descriptionstring | null
altTextstring | null
typeGalleryItemType
urlstring
thumbnailUrlstring | null
mimeTypestring | null
fileSizenumber | null
widthnumber | null
heightnumber | null
categorystring | null
tagsstring[]
statusGalleryItemStatus
sortOrdernumber
featuredboolean
beforeImageUrlstring | null
isBeforeAfterboolean
metadataRecord<string, unknown> | null
createdAtDate
updatedAtDate

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.