Design Hub developer guide - company support plugins

    Design Hub's company supports plugins are a collection of API endpoints that facilitate integrating the application into an organization's project management, authorization and enterprise resource planning systems. As such it handles concepts other than the rest of the plugin types. The mechanism of handling their functionality reuses the overall plugin system however, so there are 2 technical approaches to defining and loading plugins:

    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

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

    A company support 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.
    getProjects async function no Called automatically during initialization and then on a preset schedule to obtain an overall list of projects to be used by the application.

    Arguments: none

    Return value: Promise of array of objects. Each object corresponds to a project. The objects in the array should contain name and label attributes for a project. Label will be used on the GUI.
    getUserProjects async function no Called automatically during the successful authentication of a user, to obtain project assignments. The function must return a Promise of the results. The results are stored in the application database and used for authorization.

    Arguments:
    user (object) A javascript object describing the calling user
    this includes domain for the current call

    Return value: Promise of array of objects. Each object corresponds to a project. The objects in the array should contain name and label attributes for a project.
    getUserGroups async function no Called automatically during the successful authentication of a user, to obtain group memberships. The function must return a Promise of the results. The results are stored in the application database and used for authorization.

    Arguments:
    user (object) A javascript object describing the calling user
    this includes domain for the current call

    Return value: Promise of array of string. Each string corresponds to a group's name.
    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.

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

    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.
    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.