Categories file dumps and playlists by topic, in two sets apart, one of each CategoryKind, and give each topic its own page. This module types them for the server and the client, with the bodies that create and change them. Those who hold category:manage manage both sets on /manage. The client lists them in its CategoriesProvider.

Functions

f
isCategoryKind(value: unknown): value is CategoryKind

Checks whether value is one of the CATEGORY_KINDS, for the category validator and the rows the category service reads.

Interfaces

I
Category

Returned by the category routes. A dump category's feed lives at /<slug> on the client, a playlist category's at /playlists/<slug>, and a dump or playlist names its categories by id in categoryIds.

I
CreateCategoryRequest

Passed to POST /api/categories. The slug must be free within its kind, and a dump category's not reserved by a route.

I
UpdateCategoryRequest

Passed to PUT /api/categories/:id. A field left out keeps its value, and the kind is kept.

Type Aliases

Variables

v
CATEGORY_KINDS: "dump" | "playlist"[]

Lists what a category files: a dump category files dumps, a playlist category playlists. Each kind is a set of its own, whose slugs and names are unique within it.