-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (26 loc) · 874 Bytes
/
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
'use strict';
var ActionKitRequest = require('./lib/ak-request'),
entity = require('./lib/entity'),
user = require('./lib/user'),
page = require('./lib/page'),
action = require('./lib/action');
/**
* ActionKit API
*
* Creates an ActionKit API connection with provided credentials.
*
* @param {string} domain - ActionKit instance domain, i.e. "act.engagementlab.org"
* @param {string} username - ActionKit user with API access
* @param {string} password - Password for user
* @constructor
*/
function Api(domain, username, password) {
ActionKitRequest.call(this, domain, username, password);
this.User = user(this);
this.Page = page(this);
this.Action = action(this);
this.Tag = entity('tag', this);
}
Api.prototype = Object.create(ActionKitRequest.prototype);
exports = module.exports = Api;
//TODO: Improve error handling