This is the root object of the component declaration. It can contains the following fields:

Property Name Type Required Description
title string Yes Specifies the component's title to be displayed below the component's logo
description string Yes Short description of the component
docsURL string
URL to documentation
envVars string
Environment variables
credentials object
Specifies input fields to provide Authentication with the given API.
fields object
Input field used to configure component's behaviour in a task. Each property of this object defines a name of a configuration property. The value of a field property is a Field Object which specifies how to display an input field to be used by a user to enter a value for a configuration property.
triggers object
Specifies component's triggers.
actions object
Specifies component's actions.

Example Structure of Root Object

Before diving into the specifics of each object it is useful to see the implementation in the real-life example of Sugar CRM component that is in use currently. The full description file can be accessed in our Sugar CRM GitHub repository.

The descriptor specifies several standard properties like title, description and docsURL. Then comes credentials which in this case uses a specific setup to connect with Sugar CRM. Lastly the triggers and actions parts have selection of some triggers and actions. This is not an exhaustive list of all trigger and action properties available through Sugar CRM API - only the selection.

Beginning

{
    "title": "SugarCRM 7",
    "description": "SugarCRM REST API",
    "docsUrl": "https://github.com/elasticio/sugarcrm-component",

Credentials part

    "credentials": {
        "fields":{
            "baseUrl": {
                "label": "Your SugarCRM domain",
                "required": true,
                "viewClass": "TextFieldView"
            },
            "userName": {
                "label": "Your login",
                "required": true,
                "viewClass": "TextFieldView"
            },
            "password": {
                "label": "Your password",
                "required": true,
                "viewClass": "PasswordFieldView"
            },
            "clientID": {
                "label": "Your OAuth 2.0 Consumer Key",
                "required": false,
                "viewClass": "TextFieldView"
            }
        }
    },

Triggers part

    "triggers": {
        "getAccounts": {
            "main": "./lib/triggers/getAccounts.js",
            "type": "polling",
            "title": "Query Accounts",
            "metadata": {
                "out": "./lib/schemas/getAccounts.out.json"
            }
        },
        "getContacts": {
            "main": "./lib/triggers/getContacts.js",
            "type": "polling",
            "title": "Query Contacts",
            "metadata": {
                "out": "./lib/schemas/getContacts.out.json"
            }
        },
        "getLeads": {
            "main": "./lib/triggers/getLeads.js",
            "type": "polling",
            "title": "Query Leads",
            "metadata": {
                "out": "./lib/schemas/getLeads.out.json"
            }
        },
        "getOpportunities": {
            "main": "./lib/triggers/getOpportunities.js",
            "type": "polling",
            "title": "Query Opportunities",
            "metadata": {
                "out": "./lib/schemas/getOpportunities.out.json"
            }
        },
        "getTasks": {
            "main": "./lib/triggers/getTasks.js",
            "type": "polling",
            "title": "Query Tasks",
            "metadata": {
                "out": "./lib/schemas/getTasks.out.json"
            }
        }
    },

Actions part

    "actions": {
        "createOrUpdateAccount": {
            "main": "./lib/actions/createOrUpdateAccount.js",
            "title": "Sync Account",
            "metadata": {
                "in": "./lib/schemas/createOrUpdateAccount.in.json",
                "out": "./lib/schemas/getAccounts.out.json"
            }
        },
        "createOrUpdateContact": {
            "main": "./lib/actions/createOrUpdateContact.js",
            "title": "Sync Contact",
            "metadata": {
                "in": "./lib/schemas/createOrUpdateContact.in.json",
                "out": "./lib/schemas/getContacts.out.json"
            }
        },
        "createOrUpdateLead": {
            "main": "./lib/actions/createOrUpdateLead.js",
            "title": "Sync Lead",
            "metadata": {
                "in": "./lib/schemas/createOrUpdateLead.in.json",
                "out": "./lib/schemas/getLeads.out.json"
            }
        },
        "createOrUpdateOpportunity": {
            "main": "./lib/actions/createOrUpdateOpportunity.js",
            "title": "Sync Opportunity",
            "metadata": {
                "in": "./lib/schemas/createOrUpdateOpportunity.in.json",
                "out": "./lib/schemas/getOpportunities.out.json"
            }
        },
        "createOrUpdateTask": {
            "main": "./lib/actions/createOrUpdateTask.js",
            "title": "Sync Task",
            "metadata": {
                "in": "./lib/schemas/createOrUpdateTask.in.json",
                "out": "./lib/schemas/getTasks.out.json"
            }
        }
    }
}

Any object implementation is directly connected with one or several View Class definitions, therefore it is advisable to check them as well.