Creates a new CapabilityRegistry
The Core capability definition that will always be registered
Integration options including logger
Execute transformers for the pre-serialization hook
The transformer execution context containing hook type and context data
The context data to transform
Optionalhook?: "pre-serialization"The lifecycle hook to execute transformers for
A Promise resolving to the transformed data
Execute transformers for the post-serialization hook
The transformer execution context containing hook type and context data
The context data to transform
Optionalhook?: "post-serialization"The lifecycle hook to execute transformers for
A Promise resolving to the transformed data
Execute validators for the specified hook type
Validates the provided context data against all registered validation plugins for the specified hook type.
The validation execution context containing hook type and context data
A ValidationResult indicating whether the validation was successful or failed with errors
Get a registered capability by URI
The URI of the capability to get
The capability definition, or undefined if not registered
Get all registered capabilities
An array of all registered capability definitions
Get the invocation factory collection for a specific data type
The JMAP data type to get factories for
The invocation factory collection for the data type, or undefined if not registered
Get a specific invocation request factory by data type and method name
The JMAP data type
The JMAP method name
The invocation request factory function, or undefined if not found
Get a specific invocation response factory by data type and method name
The JMAP data type
The JMAP method name
The invocation response factory function, or undefined if not found
Get all registered transformation plugins for a specific hook
The lifecycle hook to get transformers for
An array of transformation plugins for the specified hook
Get all registered validation plugins for a specific hook
The lifecycle hook to get validators for
An array of validation plugins for the specified hook
Check if a capability is registered
The URI of the capability to check
true if the capability is registered, false otherwise
Register a capability with the registry
The capability definition to register
true if the capability was registered, false if it was already registered
Validate account capability data against registered capability schemas.
The accounts object from the parsed JMAP session
An array of validation failures (empty if all account capabilities are valid)
Validate a single capability definition's schemas against session data without requiring the capability to be registered.
The capability definition to validate
The server capabilities from the session
The accounts from the session
An object containing arrays of server and account capability validation failures
Validate server capability data against registered capability schemas.
The server capabilities object from the parsed JMAP session
An array of validation failures (empty if all capabilities are valid)
Registry for managing JMAP capabilities
The registry stores capability definitions and provides methods to register, unregister, and query capabilities. The Core capability is always registered and cannot be unregistered.