Skip to main content

Module schemas

Module schemas 

Source
Expand description

/schemas and DELETE /purge/:className. Master key only, on every verb.

Upstream: src/Routers/SchemasRouter.js. Every route here is wrapped in promiseEnforceMasterKeyAccess (SchemasRouter.js:130-158), which is the same gate /serverInfo uses and which maintenance does not satisfy.

These handlers read _SCHEMA afresh rather than using the request snapshot. Upstream does the same, loadSchema({clearCache: true}) then getAllClasses({clearCache: true}) (SchemasRouter.js:18-28), and here it also keeps the server-level protectedFields option out of what a client reads back: the snapshot has that option folded into its CLP blocks, and rendering it would turn a configuration value into a database value on the next write-back.

Functionsยง

create
POST /schemas and POST /schemas/:className.
delete
DELETE /schemas/:className.
get_all
GET /schemas. {results: [...]}.
get_one
GET /schemas/:className. The schema object itself, not wrapped.
purge
DELETE /purge/:className.
update
PUT /schemas/:className: field add, field delete, CLP replace.