1 | var HttpClient = require('./lib/http-client');
|
2 | var events = require('events');
|
3 | var inherits = require('inherits');
|
4 | var StreamAPI = require('./lib/stream_api');
|
5 | var _ = require('lodash');
|
6 | var Logger = require('./lib/logger');
|
7 |
|
8 | function Klic(options){
|
9 | options = options || {};
|
10 | this.base_url = options.url || "https://api.2klic.io";
|
11 | this.apiVersion = options.apiVersion || "1.0";
|
12 | this.auth = options.auth || {};
|
13 |
|
14 | this.logger = new Logger((options.log_level >= 0) ? options.log_level : 6);
|
15 |
|
16 | this.http = new HttpClient(this.base_url, {app_key: options.app_key, unsafe: options.unsafe, logger: this.logger, api_version: this.api_version, app_type: options.app_type });
|
17 |
|
18 |
|
19 | this.alarm = require("./lib/methods/alarm/alarm")({ platform: this });
|
20 | this.zones = require("./lib/methods/alarm/zones")({ platform: this });
|
21 |
|
22 | this.noc = require("./lib/methods/noc/noc")({ platform: this });
|
23 | this.cameras = require("./lib/methods/cameras")({ platform: this });
|
24 | this.streams = require("./lib/methods/streams")({ platform: this });
|
25 | this.devices = require("./lib/methods/devices")({ platform: this });
|
26 | this.zwave = require("./lib/methods/zwave")({ platform: this });
|
27 | this.events = require("./lib/methods/events")({ platform: this });
|
28 | this.locations = require("./lib/methods/locations")({ platform: this });
|
29 | this.scenarios = require("./lib/methods/scenarios")({ platform: this });
|
30 | this.models = require("./lib/methods/models")({ platform: this });
|
31 | this.notifications = require("./lib/methods/notifications")({ platform: this });
|
32 | this.translations = require("./lib/methods/translations")({ platform: this });
|
33 | this.user = require("./lib/methods/user")({ platform: this });
|
34 | this.templates = require("./lib/methods/templates")({ platform: this });
|
35 | this.system = require("./lib/methods/system")({ platform: this });
|
36 | this.access = require("./lib/methods/access/access")({ platform: this });
|
37 | }
|
38 |
|
39 | inherits(Klic, events.EventEmitter);
|
40 |
|
41 | Klic.prototype.authenticate = require('./lib/methods/authenticate');
|
42 | Klic.prototype.register = require('./lib/methods/register');
|
43 |
|
44 | module.exports = Klic;
|