@reactivehub/cli
Version:
84 lines (70 loc) • 2.63 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: 'jiraProjectId',
message: 'Enter the JIRA project ID or Key (wildcards allowed): '
}];
const CREATE_PROJECT = {
name: 'CREATE_PROJECT',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'CREATE_PROJECT' }, action)),
buildTemplate: (answers = {}) => {
const { project: payload } = _template2.default;
return (0, _extends3.default)({}, answers, {
payload
});
},
questions: () => {}
};
const UPDATE_PROJECT = {
name: 'UPDATE_PROJECT',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'UPDATE_PROJECT' }, action)),
buildTemplate: (answers = {}) => (0, _extends3.default)({}, answers, {
payload: _template2.default.project
}),
questions
};
const DELETE_PROJECT = {
name: 'DELETE_PROJECT',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'DELETE_PROJECT' }, action)),
buildTemplate: (answers = {}) => (0, _extends3.default)({}, answers),
questions
};
const SET_PROJECT_PROPERTY = {
name: 'SET_PROJECT_PROPERTY',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'SET_PROJECT_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_PROJECT_PROPERTY = {
name: 'DELETE_PROJECT_PROPERTY',
deploy: (action, eventInfo) => (0, _api.sendAction)(eventInfo, (0, _extends3.default)({ serviceAction: 'DELETE_PROJECT_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_PROJECT,
UPDATE_PROJECT,
DELETE_PROJECT,
SET_PROJECT_PROPERTY,
DELETE_PROJECT_PROPERTY
};
//# sourceMappingURL=index.js.map