ProtectedappProtecteddataProtectedfeedbackDefault feedback handler implementation. Simply logs feedback and returns success. Override by calling setFeedbackHandler() with a custom implementation.
ProtectedmetadataProtectedoptionsProtectedpoolProtectedreadProtectedregistryProtectedrouterOptional metadata provider override. Server bootstrap is process-wide so this typically
uses the global default; callers may set instance.Provider = providerToUse for tests
or multi-tenant overrides.
ProtectedauthProtectedAuthentication middleware that calls the checkAPIKey method. This middleware is automatically applied to /api/v1/components routes when requireAuth is true.
ProtectedcheckProtectedCheck if the API key in the request is valid. By default, this method always returns true (no authentication).
Override this method to implement custom authentication logic. Common patterns include:
The Express request object
Promise
ProtectedgenerateGenerate SHA-256 hash of component specification
The component specification JSON string
SHA-256 hash as hex string
ProtectedgetProtectedHandler for GET /api/v1/components/:namespace/:name Get a specific component by namespace and name. Optionally specify a version with ?version=x.x.x query parameter. Optionally specify a hash with ?hash=abc123 to enable caching (returns 304 if unchanged).
ProtectedgetProtectedGet the base filter for component queries. By default, this returns components where SourceRegistryID IS NULL (local components only).
Override this method to customize which components are served by the registry.
The SQL filter string to apply to all component queries
ProtectedgetProtectedHandler for GET /api/v1/health Returns the health status of the registry server.
ProtectedgetProtectedHelper method to get the latest version of each component from a list. Components are grouped by namespace/name and the highest version is selected.
Array of components potentially containing multiple versions
Array of components with only the latest version of each
ProtectedgetProtectedHandler for GET /api/v1/registry Returns basic information about the registry.
ProtectedlistProtectedHandler for GET /api/v1/components Lists all published components in the registry, showing only the latest version of each.
ProtectedloadProtectedLoad the registry metadata from the database. This is called automatically if a registryId is provided in the configuration.
ProtectedsearchProtectedHandler for GET /api/v1/components/search Search for components by query string and optional type filter.
Set a custom feedback handler. This allows external code (e.g., Skip) to override feedback handling logic.
Custom feedback handler implementation
ProtectedsetupProtectedSet up the database connection using MemberJunction's SQL Server provider. Follows the same pattern as MJServer for consistency.
ProtectedsetupProtectedSet up Express middleware. Override this method to add custom middleware or modify the middleware stack.
ProtectedsetupProtectedSet up the API routes. Override this method to add custom routes or modify existing ones.
Start the Express server on the configured port.
Must be called after initialize().
Promise that resolves when the server is listening
ProtectedsubmitProtectedHandler for POST /api/v1/feedback Submit feedback for a component.
Base class for the Component Registry API Server. This class provides a complete implementation of the Component Registry API v1 specification.
To customize the server behavior, extend this class and override the appropriate methods. Common customization points include:
checkAPIKey()to implement custom authenticationgetComponentFilter()to customize which components are servedExample