Object.defineProperty(exports, "__esModule", { value: true });
exports.getiyoSimpleExecute = exports.getiyoSimpleOpenEditor = void 0;
function getiyoSimpleOpenEditor(EditorAPI, properties) {
    var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
    EditorAPI.setFields([
        {
            id: 'connectionID',
            name: 'Connection',
            type: 'connection',
            connectionType: 'channel',
            value: connectionID,
        },
    ]);
    EditorAPI.onFieldChanges(function (fields) {
        var fieldObject = EditorAPI.tools.objectifyFieldsValues(fields);
        EditorAPI.saveProperties({ connectionID: fieldObject.connectionID });
    });
}
exports.getiyoSimpleOpenEditor = getiyoSimpleOpenEditor;
function getiyoSimpleExecute(ActionAPI, properties, status, functionName) {
    var connectionID = properties.connectionID != undefined ? properties.connectionID : 'none';
    if (connectionID != 'none') {
        var connection = ActionAPI.getConnection('channel', connectionID);
        if (connection) {
            var channel = connection.instance;
            return channel[functionName]();
        }
        else
            status("Connection doesn't exist", 'error');
    }
    else
        status('No connection specfied', 'error');
}
exports.getiyoSimpleExecute = getiyoSimpleExecute;
//# sourceMappingURL=simpleGetiyoActions.js.map