-
Notifications
You must be signed in to change notification settings - Fork 31
/
whmcs.js
41 lines (37 loc) · 1.77 KB
/
whmcs.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
const WhmcsHttpClient = require('./lib/whmcshttpclient');
const modules = require('./modules/index');
class WHMCS {
/**
* Creates a WHMCS object
* @param {Object} options Configuration parameters (key-value pairs)
*/
constructor(options) {
this.whmcsHttpClient = new WhmcsHttpClient(options);
this.orders = new modules.Orders(this.whmcsHttpClient);
this.billing = new modules.Billing(this.whmcsHttpClient);
this.module = new modules.Module(this.whmcsHttpClient);
this.support = new modules.Support(this.whmcsHttpClient);
this.system = new modules.System(this.whmcsHttpClient);
this.client = new modules.Client(this.whmcsHttpClient);
this.products = new modules.Products(this.whmcsHttpClient);
this.projectManagement = new modules.ProjectManagement(this.whmcsHttpClient);
this.users = new modules.Users(this.whmcsHttpClient);
this.affiliates = new modules.Affiliates(this.whmcsHttpClient);
this.authentication = new modules.Authentication(this.whmcsHttpClient);
this.domains = new modules.Domains(this.whmcsHttpClient);
this.servers = new modules.Servers(this.whmcsHttpClient);
this.tickets = new modules.Tickets(this.whmcsHttpClient);
this.service = new modules.Service(this.whmcsHttpClient);
this.addons = new modules.Addons(this.whmcsHttpClient);
}
/**
* Executes an action in WHMCS. You can use this to execute an action that is not defined in the pre-loaded modules.
* @param {String} action Command name
* @param {Object} parameters Request parameters (key-value pairs)
* @param {Function} callback Optional callback. If not set the method returns a Promise.
*/
callApi(action, parameters, callback) {
return this.whmcsHttpClient.callApi(action, parameters, callback);
};
}
module.exports = WHMCS;