Implemented Collections, reworked SecureIds to prevent duplication across records, renamed files to be consistently plural.

This commit is contained in:
jd
2026-02-21 15:25:37 +00:00
parent c276ee4e17
commit 59d2819750
37 changed files with 608 additions and 139 deletions

17
src/routes/collections.ts Normal file
View File

@@ -0,0 +1,17 @@
import { guard } from '../utilities/guard';
import { Claims } from '../orm/claims';
import collections from '../endpoints/collections';
export default {
'/api/collection': {
POST: guard(collections.create, [Claims.ADMIN, Claims.COLLECTIONS.CREATE]),
},
'/api/collection/:id': {
GET: guard(collections.get, [Claims.ADMIN, Claims.COLLECTIONS.UNOWNED.READ, Claims.COLLECTIONS.OWNED.READ]),
// PATCH: guard(collections.update, [Claims.ADMIN, Claims.PLAYERS.OTHER.UPDATE, Claims.PLAYERS.SELF.UPDATE]),
// DELETE: guard(collections.drop, [Claims.ADMIN, Claims.PLAYERS.OTHER.DELETE, Claims.PLAYERS.SELF.DELETE]),
},
'/api/collection/list': {
GET: guard(collections.list, [Claims.ADMIN, Claims.COLLECTIONS.OWNED.LIST]),
},
};