-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
38 lines (28 loc) · 1.05 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
'use strict';
// Move to titaniumifier!
process.execPath || (process.execPath = '/path/to/node');
var Promise = require('bluebird');
var request = require('./lib/request');
var liferay = exports;
liferay.Promise = Promise;
liferay.request = request;
liferay.errors = require('./lib/errors');
liferay.identify = require('./lib/identify');
liferay.camelcase = require('./lib/camelcase');
liferay.base = require('./lib/connectors/base');
liferay.v61 = require('./lib/connectors/liferay61');
liferay.v62 = require('./lib/connectors/liferay62');
liferay.v70 = require('./lib/connectors/liferay70');
liferay.connectors = [
liferay.v61, liferay.v62, liferay.v70
];
liferay.guest = function (portalURL, auth, callback) {
return liferay.identify(portalURL, null).then(function (connector) {
return connector.guest(portalURL);
}).nodeify(callback);
};
liferay.authenticate = function (portalURL, auth, callback) {
return liferay.identify(portalURL, auth).then(function (connector) {
return connector.authenticate(portalURL, auth);
}).nodeify(callback);
};