Protected ReadonlyeventProtected ReadonlyeventProtected ReadonlyloggerProtected ReadonlyoptionsProtected ReadonlyresponseProtected ReadonlyroutesReadonlytoDisposed when the routing is rebuilt or the external API server stops.
ProtecteddefaultThe event streams registered on this router, in registration order.
The underlying express router, mounted at the contribution's path behind the token
verification. Full-power escape hatch: existing express routers and middlewares can
be mounted here unchanged, keeping their own request handling and response format.
Errors they do not handle themselves are reduced to the uniform error format and
unmatched paths are answered with 404 in that format, their routes are not
published in the OpenAPI document, and their build-scoped resources belong in
toDispose.
The typed routes registered on this router, in registration order.
ProtectedclientReturns the error code written for unhandled client errors: the HTTP status text,
except for plain 400s, which keep the established invalid request code.
ProtectedclientReturns the HTTP status of client errors raised below the contribution's routes, e.g. by the JSON body parsing.
ProtectedcompileCompiles the body schema into a validator returning the validation error messages, or
undefined when the body is valid. An invalid schema throws, failing the
contribution's configuration.
Dispose this object.
Registers a GET route serving server-sent events. The returned stream manages the
connected clients (see ExternalApiEventStream) and is disposed with this
router, ending all client connections so that clients reconnect against a new
configuration.
Appends the fallback handling that answers unmatched paths below the contribution with
404 and reduces unhandled route errors, including malformed JSON bodies, to the
uniform error format. Called by the external API server once the contribution is
configured, so that it runs after all contributed routes.
ProtectedisWhether the request counts as authorized, see RestRequest.authorized.
Registers a typed PATCH route, validating the request body when a body schema is declared.
Registers a typed POST route, validating the request body when a body schema is declared.
Registers a typed PUT route, validating the request body when a body schema is declared.
ProtectedregisterOptionalhandler: RestHandler<B>ProtectedrenderRenders a schema validation error to a human-readable message, e.g. text should be string.
Protectedroute
Default implementation of the ExternalApiRouter.