@reactivehub/cli
Version:
74 lines (61 loc) • 2.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _api = require('../../../services/api');
var _template = require('./template');
var _template2 = _interopRequireDefault(_template);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
const questions = () => [{
type: 'input',
name: 'jiraUserId',
message: 'Enter the JIRA user ID (wildcards allowed): '
}];
const CREATE_USER = {
name: 'CREATE_USER',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'CREATE_USER' }, action)),
buildTemplate: (answers = {}) => {
const { project: payload } = _template2.default;
return (0, _extends3.default)({}, answers, {
payload
});
},
questions: () => {}
};
const DELETE_USER = {
name: 'DELETE_USER',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'DELETE_USER' }, action)),
buildTemplate: (answers = {}) => (0, _extends3.default)({}, answers),
questions
};
const SET_USER_PROPERTY = {
name: 'SET_USER_PROPERTY',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'SET_USER_PROPERTY' }, action)),
buildTemplate: (answers = {}) => (0, _extends3.default)({}, answers, {
payload: _template2.default.property
}),
questions: questions().concat([{
type: 'input',
name: 'jiraPropertyKey',
message: 'Enter the JIRA property key (wildcards allowed): '
}])
};
const DELETE_USER_PROPERTY = {
name: 'DELETE_USER_PROPERTY',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'DELETE_USER_PROPERTY' }, action)),
buildTemplate: (answers = {}) => (0, _extends3.default)({}, answers),
questions: questions().concat([{
type: 'input',
name: 'jiraPropertyKey',
message: 'Enter the JIRA property key (wildcards allowed): '
}])
};
exports.default = {
CREATE_USER,
DELETE_USER,
SET_USER_PROPERTY,
DELETE_USER_PROPERTY
};
//# sourceMappingURL=index.js.map