-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnections.js
35 lines (28 loc) · 1.32 KB
/
connections.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const CrudCommand = require('../lib/command/crud-command')
const ConnectionController = require('../lib/controller/connections/connection-controller')
const ConnectionServiceProvider = require('../lib/controller/connections/connection-service-provider')
const ConnectionInquirer = require('../lib/controller/connections/connection-inquirer')
const OptionType = require('../lib/enums').OptionType
class ConnectionsCommand extends CrudCommand {
async init() {
this.controller = new ConnectionController()
this.inquirer = new ConnectionInquirer()
}
async handleOption(option, conn) {
switch (option) {
case OptionType.Test: {
await new ConnectionServiceProvider(conn).test()
break
}
case OptionType.Sync: {
await new ConnectionServiceProvider(conn).sync()
break
}
}
}
}
ConnectionsCommand.description = `Create, Read, Update, Delete, Test and Sync connections
A connection is a form of integration which enhances and/or aids existing functionalities of Pochta. Connections are built for manipulating root setting or adding features which don't belong to Pochta's core functionalities.
Currently, only Redmine (version 4.0+) connection is supported. Adding this connection will sync contacts and user profile with your account.
`
module.exports = ConnectionsCommand