Design Hub developer guide - registry plugins

    Design Hub's registry plugins are a collection of API endpoints that facilitate integrating the application into an organization's substance registry and related workflows:

    As described below in the specification, the 2 approaches follow the same concepts, and internally are managed by the same service, so outgoing call arguments are the same regardless of the technical choice, and your plugin's configuration will have identical behaviour in the application regardless of the API.

    NodeJS module API

    Registry plugins are NodeJS modules, denoted by their filename: *.registry.js and location in the services directory as configured during installation.

    A registry plugin exports the following properties:

    Name Type Required Description
    name string yes Unique identifier of the plugin, used by Design Hub for identification and internal communication. If multiple plugins use the same identifier, the last one to be loaded overrides the others.
    label string yes Human readable name of the plugin, used by Design Hub to display GUI elements related to this plugin.
    checkCompound async function no Called when a user attempts to share a compound. This function may return drawing quality issues regarding the 2D structure of the compound.

    Arguments:
    structure (string) An MRV formatted chemical structure
    this includes domain for the current call

    Return value: Promise of an object. The object must include an array of strings under the issues key. Each string corresponds to one drawing quality issue, e.g.: Unspecified stereo centers.
    getID async function no Called when a user attempts to share a compound, and then periodically depending on configuration, until a substance ID is found for the compound. This function may return a single identifier for a compound from a small molecule registration system. To control the periodicity of function calls, please see the schedulerPlan option in the Configuration guide

    Arguments:
    structure (string) MRV formatted chemical structure
    this includes domain and user

    Return value: Promise of an optional string. The string must contain the substance ID for the chemical structure. Empty string (or null, undefined) are treated as successful queries without a hit.
    getMatches async function no Called when a user attempts to share a compound, and then periodically depending on configuration, until substances matches are found for the compound. This function can return one or more objects describing matching compounds from a small molecule registration system. To control the periodicity function calls, please see the schedulerPlan option in the Configuration guide

    Arguments:
    queryObject (object) a plain object with a structure (string) attribute of MRV formatted chemical structure
    this includes domain and user

    Return value: Promise of a list of substance matches. Each substance match must contain: id (string), structure (string) and data (object)
    domains array of strings yes List of domains where this plugin may be used, when authentication is enabled in Design Hub. Use * to allow any domain.

    Note: you may use _development authentication type to test aspects of your plugin specific to a domain. This authentication type accepts any username, password combination, where the 2 field string match.

    REST API

    To be added.