-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
executable file
·104 lines (88 loc) · 3.02 KB
/
index.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#! /usr/bin/env node
process.on("SIGPIPE", process.exit);
process.noDeprecation = true;
const colors = require("colors");
const program = require("commander-plus");
const pkg = require("./package.json");
// auto-complete
//const complete = require("./common/Autocomplete");
const Message = require("./common/Message");
const Preferences = require("./common/Preferences");
const Account = require("./routes/Account");
const Company = require("./routes/Company");
const Organization = require("./routes/Organization");
const Site = require("./routes/Site");
const System = require("./routes/System");
const Phone = require("./routes/Phone");
const Status = require("./routes/Status");
const User = require("./routes/User");
const Free = require("./routes/Free");
const Mass = require("./routes/Mass");
const Advanced = require("./routes/Advanced");
const Offers = require("./routes/Offers");
const Invoices = require("./routes/Invoice");
const Application = require("./routes/Application");
const Developer = require("./routes/Developer");
const Internal = require("./routes/Internal");
const Network = require("./routes/Network");
const Channels = require("./routes/Channels");
const BotsService = require("./routes/BotsService");
start = function() {
// auto-complete
//complete.initialize();
// Set max listeners
program.setMaxListeners(100);
// Initialize the program
program.version(pkg.version);
// Loads prefs
let prefs = new Preferences();
// Initialize the routes
let account = new Account(program, prefs);
let user = new User(program, prefs);
let company = new Company(program, prefs);
let site = new Site(program, prefs);
let system = new System(program, prefs);
let phone = new Phone(program, prefs);
let organization = new Organization(program, prefs);
let status = new Status(program, prefs);
let free = new Free(program, prefs);
let masspro = new Mass(program, prefs);
let advanced = new Advanced(program, prefs);
let offers = new Offers(program, prefs);
let invoices = new Invoices(program, prefs);
let applications = new Application(program, prefs);
let developers = new Developer(program, prefs);
let internal = new Internal(program, prefs);
let network = new Network(program, prefs);
let channels = new Channels(program, prefs);
let botsservice = new BotsService(program, prefs);
// Start the routes
account.start();
user.start();
company.start();
free.start();
site.start();
system.start();
phone.start();
organization.start();
offers.start();
masspro.start();
invoices.start();
advanced.start();
status.start();
applications.start();
developers.start();
internal.start();
network.start();
channels.start();
botsservice.start();
program.command("*").action(function() {
Message.welcome();
Message.version(pkg.version);
Message.lineFeed();
Message.notFound();
});
// Parse commands
program.parse(process.argv);
};
start();