comprodls-sdk 2.102.1-qa → 2.104.0-qa.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/comprodls-sdk.js +23 -23
- package/dist/comprodls-sdk.min.js +1 -1
- package/lib/services/superuser/index.js +22 -22
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ var q = require('q');
|
|
|
27
27
|
var request = require('superagent');
|
|
28
28
|
|
|
29
29
|
var helpers = require('../../helpers');
|
|
30
|
+
var requestLayer = require('../../helpers/lib/requestLayer');
|
|
30
31
|
|
|
31
32
|
var DLSError = helpers.errors.DLSError;
|
|
32
33
|
|
|
@@ -48,34 +49,33 @@ function superuser(accountId) {
|
|
|
48
49
|
*/
|
|
49
50
|
function getAllInstitutions(options) {
|
|
50
51
|
var self = this;
|
|
51
|
-
// Initializing promise
|
|
52
|
-
var dfd = q.defer();
|
|
53
52
|
|
|
54
|
-
var url =
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
var url = helpers.api.constructAPIUrl(
|
|
54
|
+
self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getAllInstitutions,
|
|
55
|
+
{ accountid : self.accountId }
|
|
56
|
+
);
|
|
57
57
|
|
|
58
58
|
var params = {};
|
|
59
|
-
if(options) {
|
|
60
|
-
if(options.lookup) { params.lookup = options.lookup; }
|
|
61
|
-
if(options.
|
|
62
|
-
if(options.
|
|
59
|
+
if (options) {
|
|
60
|
+
if (options.lookup) { params.lookup = options.lookup; }
|
|
61
|
+
if (options.country) { params.country = options.country; }
|
|
62
|
+
if (options.cursor) { params.cursor = options.cursor; }
|
|
63
|
+
if (options.start) { params.start = options.start; }
|
|
64
|
+
if (options.end) { params.end = options.end; }
|
|
63
65
|
}
|
|
64
66
|
|
|
65
|
-
//
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
67
|
+
// Prepare request parameters & execute request
|
|
68
|
+
var reqOptions = {
|
|
69
|
+
params: params,
|
|
70
|
+
headers: { traceid: self.traceid }
|
|
71
|
+
};
|
|
72
|
+
return requestLayer.get(url, reqOptions)
|
|
73
|
+
.then(function (response) {
|
|
74
|
+
return response.body;
|
|
75
|
+
})
|
|
76
|
+
.catch(function (err) {
|
|
77
|
+
throw new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
76
78
|
});
|
|
77
|
-
|
|
78
|
-
return dfd.promise;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/**
|
package/package.json
CHANGED