Skip to main content

Advanced

Use @web-ts-toolkit/access-router/advanced when you need the lower-level contract surface.

What It Exports​

  • validation helpers and schemas from validation/*
  • enums such as Codes, StatusCodes, CustomHeaders, and FilterOperator
  • symbols such as MIDDLEWARE, DATA_MIDDLEWARE, CORE, PERMISSIONS, and PERMISSION_KEYS
  • the full interface/type surface from interfaces/*

Runtime-context functions are internal and are not exported here. Use root exports createAccessRuntime, AccessRuntime and defaultRuntime for runtime ownership, or the root default acl API for default-runtime router creation. /advanced exports neither runtime instances nor router-creation helpers.

Common Validation Imports​

import {
parseBody,
parsePathParam,
parseQuery,
requestSchemas,
readByIdBodySchema,
} from '@web-ts-toolkit/access-router/advanced';

Use these helpers in custom routes when you want the same request validation behavior as the built-in endpoints.

Example​

router.router.post('/custom/:id', async (req) => {
const id = parsePathParam(req.params.id, 'id');
const query = parseQuery(requestSchemas.readQuery, req.query);
const body = parseBody(readByIdBodySchema, req.body);

return { id, query, body };
});