comprodls-sdk 2.42.3 → 2.43.0
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 +976 -247
- package/dist/comprodls-sdk.min.js +22 -22
- package/lib/comprodls.js +2 -0
- package/lib/config/index.js +16 -0
- package/lib/services/auth/index.js +108 -108
- package/lib/services/authextn/index.js +709 -0
- package/package.json +1 -1
package/lib/comprodls.js
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
var token_manager = require('./token');
|
|
25
25
|
var helpers = require('./helpers');
|
|
26
26
|
var auth = require('./services/auth');
|
|
27
|
+
var authextn = require('./services/authextn');
|
|
27
28
|
var activity = require('./services/activity');
|
|
28
29
|
var analytics = require('./services/analytics');
|
|
29
30
|
var collab = require('./services/collab');
|
|
@@ -130,6 +131,7 @@ comproDLS.prototype.request = helpers.api.genericAPICaller;
|
|
|
130
131
|
|
|
131
132
|
//Custom Service Adaptors
|
|
132
133
|
comproDLS.prototype.Auth = auth;
|
|
134
|
+
comproDLS.prototype.AuthExtn = authextn;
|
|
133
135
|
comproDLS.prototype.Activity = activity;
|
|
134
136
|
comproDLS.prototype.Analytics = analytics;
|
|
135
137
|
comproDLS.prototype.Collab = collab;
|
package/lib/config/index.js
CHANGED
|
@@ -32,6 +32,7 @@ exports.REALM_HOSTS = {
|
|
|
32
32
|
PROD1: {
|
|
33
33
|
PUB: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-pub',
|
|
34
34
|
AUTH: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-auth',
|
|
35
|
+
AUTHEXTN: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
35
36
|
PUSHX: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
36
37
|
XAPI: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
37
38
|
ATTEMPTS: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -45,6 +46,7 @@ exports.REALM_HOSTS = {
|
|
|
45
46
|
THOR: {
|
|
46
47
|
PUB: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-pub',
|
|
47
48
|
AUTH: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-auth',
|
|
49
|
+
AUTHEXTN: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
48
50
|
PUSHX: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
49
51
|
XAPI: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
50
52
|
ATTEMPTS: 'http://dls-asgard-thor-1453383019.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -58,6 +60,7 @@ exports.REALM_HOSTS = {
|
|
|
58
60
|
ALPHA: {
|
|
59
61
|
PUB: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-pub',
|
|
60
62
|
AUTH: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-auth',
|
|
63
|
+
AUTHEXTN: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
61
64
|
PUSHX: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
62
65
|
XAPI: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
63
66
|
ATTEMPTS: 'http://dls-cup-alpha-2093819659.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -69,6 +72,7 @@ exports.REALM_HOSTS = {
|
|
|
69
72
|
PROD1: {
|
|
70
73
|
PUB: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-pub',
|
|
71
74
|
AUTH: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-auth',
|
|
75
|
+
AUTHEXTN: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
72
76
|
PUSHX: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
73
77
|
XAPI: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
74
78
|
ATTEMPTS: 'http://internal-dls-cup-prod1-284466545.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -80,6 +84,7 @@ exports.REALM_HOSTS = {
|
|
|
80
84
|
QA: {
|
|
81
85
|
PUB: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-pub',
|
|
82
86
|
AUTH: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-auth',
|
|
87
|
+
AUTHEXTN: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
83
88
|
PUSHX: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
84
89
|
XAPI: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
85
90
|
ATTEMPTS: 'http://internal-dls-cup-qa-41690511.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -91,6 +96,7 @@ exports.REALM_HOSTS = {
|
|
|
91
96
|
HFX: {
|
|
92
97
|
PUB: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-pub',
|
|
93
98
|
AUTH: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-auth',
|
|
99
|
+
AUTHEXTN: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
94
100
|
PUSHX: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
95
101
|
XAPI: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
96
102
|
ATTEMPTS: 'http://internal-dls-cup-hfx-908523553.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -102,6 +108,7 @@ exports.REALM_HOSTS = {
|
|
|
102
108
|
REL: {
|
|
103
109
|
PUB: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-pub',
|
|
104
110
|
AUTH: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-auth',
|
|
111
|
+
AUTHEXTN: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-authextn',
|
|
105
112
|
PUSHX: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-pushx',
|
|
106
113
|
XAPI: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-xapi',
|
|
107
114
|
ATTEMPTS: 'http://internal-dls-cup-rel-1458752944.us-west-2.elb.amazonaws.com/lb-attempts',
|
|
@@ -220,6 +227,15 @@ exports.AUTH_API_URLS = {
|
|
|
220
227
|
particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
|
|
221
228
|
};
|
|
222
229
|
|
|
230
|
+
exports.AUTHEXTN_API_URLS = {
|
|
231
|
+
// Grade Formats related APIs
|
|
232
|
+
gradeFormat: '/org/{orgid}/gradeformats',
|
|
233
|
+
particularGradeFormat: '/org/{orgid}/gradeformats/{gradeformat_id}',
|
|
234
|
+
classGradeformatAssociation: '/org/{orgid}/classes/{classid}/associate-gradeformats/{gradeformat_id}',
|
|
235
|
+
classGradeformats: '/org/{orgid}/classes/{classid}/gradeformats',
|
|
236
|
+
gradeformatClasses: '/org/{orgid}/gradeformats/{gradeformat_id}/classes'
|
|
237
|
+
};
|
|
238
|
+
|
|
223
239
|
exports.ACTIVITY_API_URLS = {
|
|
224
240
|
newAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/start',
|
|
225
241
|
activityDetailsAPI: '/{orgId}/products/{productId}/activities/{activityId}',
|
|
@@ -33,7 +33,7 @@ var converter = require('../../helpers/lib/api/converter');
|
|
|
33
33
|
var DLSError = helpers.errors.DLSError;
|
|
34
34
|
|
|
35
35
|
/*********************************
|
|
36
|
-
* Setting Up Module Entry Point
|
|
36
|
+
* Setting Up Module Entry Point
|
|
37
37
|
**********************************/
|
|
38
38
|
module.exports = auth;
|
|
39
39
|
|
|
@@ -762,7 +762,7 @@ function getClassUsers(options) {
|
|
|
762
762
|
// upFile: '' // path to csv file to be uploaded
|
|
763
763
|
//}
|
|
764
764
|
function pisImport(options) {
|
|
765
|
-
|
|
765
|
+
var self = this;
|
|
766
766
|
// Initializing promise
|
|
767
767
|
var dfd = q.defer();
|
|
768
768
|
// Validations
|
|
@@ -772,7 +772,7 @@ function pisImport(options) {
|
|
|
772
772
|
// Passed all validations, Construct API url
|
|
773
773
|
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
774
774
|
self.config.AUTH_API_URLS.pisImportAPI;
|
|
775
|
-
url = helpers.api.constructAPIUrl(url, {
|
|
775
|
+
url = helpers.api.constructAPIUrl(url, {'orgId' : self.orgId});
|
|
776
776
|
// Contruct parameters
|
|
777
777
|
var params = {};
|
|
778
778
|
var upfile;
|
|
@@ -807,7 +807,7 @@ function pisImport(options) {
|
|
|
807
807
|
// field: '' // apps / lti / sis / pis / product[ANY ONE]
|
|
808
808
|
//}
|
|
809
809
|
function getOrgSettings(options) {
|
|
810
|
-
|
|
810
|
+
var self = this;
|
|
811
811
|
// Initializing promise
|
|
812
812
|
var dfd = q.defer();
|
|
813
813
|
// Validations
|
|
@@ -852,7 +852,7 @@ function getOrgSettings(options) {
|
|
|
852
852
|
// body: {} // the top level settings field to be updated.
|
|
853
853
|
//}
|
|
854
854
|
function updateOrgSettings(options) {
|
|
855
|
-
|
|
855
|
+
var self = this;
|
|
856
856
|
// Initializing promise
|
|
857
857
|
var dfd = q.defer();
|
|
858
858
|
// Validations
|
|
@@ -948,7 +948,7 @@ function getAllJobs(options) {
|
|
|
948
948
|
// Passed all validations, Contruct API url
|
|
949
949
|
var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getAllJobs;
|
|
950
950
|
url = helpers.api.constructAPIUrl(url, { accountId : options.accountId, extUserId: options.extUserId });
|
|
951
|
-
|
|
951
|
+
|
|
952
952
|
var params = {};
|
|
953
953
|
if(options.jobType) { params.jobType = options.jobType; }
|
|
954
954
|
if(options.details) { params.details = options.details; }
|
|
@@ -1249,7 +1249,7 @@ function getParticularShadowClass(options) {
|
|
|
1249
1249
|
if(err) {
|
|
1250
1250
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1251
1251
|
dfd.reject(err);
|
|
1252
|
-
}
|
|
1252
|
+
}
|
|
1253
1253
|
else {
|
|
1254
1254
|
dfd.resolve(response.body);
|
|
1255
1255
|
}
|
|
@@ -1432,21 +1432,21 @@ function getClassAppdata(options) {
|
|
|
1432
1432
|
orgId: self.orgId, classid: options.classid
|
|
1433
1433
|
});
|
|
1434
1434
|
//Setup request with URL
|
|
1435
|
-
|
|
1435
|
+
var requestAPI = request.get(url);
|
|
1436
1436
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1437
1437
|
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1438
|
+
//Setup token in Authorization header
|
|
1439
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1440
|
+
|
|
1441
|
+
//Call Class Appdata Api
|
|
1442
|
+
requestAPI.end(function(err, response) {
|
|
1443
|
+
if(err) {
|
|
1444
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1445
|
+
dfd.reject(err);
|
|
1446
|
+
} else {
|
|
1447
|
+
dfd.resolve(response.body);
|
|
1448
|
+
}
|
|
1449
|
+
});
|
|
1450
1450
|
} else {
|
|
1451
1451
|
err = {};
|
|
1452
1452
|
err.message = err.description = 'classid not found in request options.';
|
|
@@ -1555,26 +1555,26 @@ function deleteClassAppdata(options) {
|
|
|
1555
1555
|
//};
|
|
1556
1556
|
function enrollUsertoClass(options) {
|
|
1557
1557
|
var self = this;
|
|
1558
|
-
|
|
1558
|
+
var err = {};
|
|
1559
1559
|
//Initializing promise
|
|
1560
1560
|
var dfd = q.defer();
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1561
|
+
if(options && options.classid && options.userid) {
|
|
1562
|
+
//Validations
|
|
1563
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1564
|
+
if(err) {
|
|
1565
|
+
dfd.reject(err);
|
|
1566
|
+
} else {
|
|
1567
|
+
//Passed all validations, Construct API url
|
|
1568
|
+
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
1569
1569
|
self.config.AUTH_API_URLS.enrollUsertoClass;
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1570
|
+
url = helpers.api.constructAPIUrl(url, {
|
|
1571
|
+
orgId: self.orgId,
|
|
1572
|
+
classId: options.classid,
|
|
1573
1573
|
userId: options.userid
|
|
1574
|
-
|
|
1574
|
+
});
|
|
1575
1575
|
|
|
1576
|
-
|
|
1577
|
-
|
|
1576
|
+
//Contruct parameters
|
|
1577
|
+
var params = {};
|
|
1578
1578
|
|
|
1579
1579
|
//Setup request with URL and Params
|
|
1580
1580
|
var requestAPI = request.post(url)
|
|
@@ -1583,24 +1583,24 @@ function enrollUsertoClass(options) {
|
|
|
1583
1583
|
.query(params);
|
|
1584
1584
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1585
1585
|
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1586
|
+
//Setup token in Authorization header
|
|
1587
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1588
|
+
|
|
1589
|
+
//Call GET Product by it's code Api
|
|
1590
|
+
requestAPI.end(function(err, response) {
|
|
1591
|
+
if(err) {
|
|
1592
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1593
|
+
dfd.reject(err);
|
|
1594
|
+
} else {
|
|
1595
|
+
dfd.resolve(response.body);
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
} else {
|
|
1600
|
+
err.message = err.description = 'Mandatory parameter classid or userid not found in request options';
|
|
1601
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
1602
|
+
dfd.reject(err);
|
|
1603
|
+
}
|
|
1604
1604
|
return dfd.promise;
|
|
1605
1605
|
}
|
|
1606
1606
|
|
|
@@ -1776,49 +1776,49 @@ function unEnrollMultiUserstoClass(options) {
|
|
|
1776
1776
|
//};
|
|
1777
1777
|
function unEnrollUsertoClass(options) {
|
|
1778
1778
|
var self = this;
|
|
1779
|
-
|
|
1779
|
+
var err = {};
|
|
1780
1780
|
//Initializing promise
|
|
1781
1781
|
var dfd = q.defer();
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1782
|
+
if(options && options.classid && options.userid) {
|
|
1783
|
+
//Validations
|
|
1784
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1785
|
+
if(err) {
|
|
1786
|
+
dfd.reject(err);
|
|
1787
|
+
} else {
|
|
1788
|
+
//Passed all validations, Construct API url
|
|
1789
|
+
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
1790
1790
|
self.config.AUTH_API_URLS.enrollUsertoClass;
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1791
|
+
url = helpers.api.constructAPIUrl(url, {
|
|
1792
|
+
orgId: self.orgId,
|
|
1793
|
+
classId: options.classid,
|
|
1794
1794
|
userId: options.userid
|
|
1795
|
-
|
|
1795
|
+
});
|
|
1796
1796
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1797
|
+
//Contruct parameters
|
|
1798
|
+
var params = {};
|
|
1799
1799
|
|
|
1800
1800
|
//Setup request with URL and Params
|
|
1801
1801
|
var requestAPI = request.delete(url).query(params);
|
|
1802
1802
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1803
1803
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1804
|
+
//Setup token in Authorization header
|
|
1805
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1806
|
+
|
|
1807
|
+
//Call GET Product by it's code Api
|
|
1808
|
+
requestAPI.end(function(err, response) {
|
|
1809
|
+
if(err) {
|
|
1810
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1811
|
+
dfd.reject(err);
|
|
1812
|
+
} else {
|
|
1813
|
+
dfd.resolve(response.body);
|
|
1814
|
+
}
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1817
|
+
} else {
|
|
1818
|
+
err.message = err.description = 'Mandatory parameter classid or userid not found in request options';
|
|
1819
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
1820
|
+
dfd.reject(err);
|
|
1821
|
+
}
|
|
1822
1822
|
return dfd.promise;
|
|
1823
1823
|
}
|
|
1824
1824
|
|
|
@@ -2250,8 +2250,8 @@ function deleteAssignedPath(options) {
|
|
|
2250
2250
|
options = {
|
|
2251
2251
|
classid: 'string' //mandatory
|
|
2252
2252
|
assignedpathid: 'string' //mandatory
|
|
2253
|
-
data:
|
|
2254
|
-
{
|
|
2253
|
+
data:
|
|
2254
|
+
{
|
|
2255
2255
|
title: 'string' //optional
|
|
2256
2256
|
startdate: 'string' //optional
|
|
2257
2257
|
duedate: 'string' //optional
|
|
@@ -2273,7 +2273,7 @@ function updateAssignedPath(options) {
|
|
|
2273
2273
|
// Setup request with URL and Params
|
|
2274
2274
|
var requestAPI = request.put(url);
|
|
2275
2275
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
2276
|
-
|
|
2276
|
+
if(options.data) { requestAPI.send(options.data); }
|
|
2277
2277
|
|
|
2278
2278
|
//Setup token in Authorization header
|
|
2279
2279
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
@@ -2551,10 +2551,10 @@ function getAllMembersOfAGroup(options) {
|
|
|
2551
2551
|
orgId: self.orgId,
|
|
2552
2552
|
groupId: options.groupId
|
|
2553
2553
|
});
|
|
2554
|
-
|
|
2554
|
+
|
|
2555
2555
|
// Setup request with URL and Param
|
|
2556
|
-
if(options.cursor){ params.cursor = options.cursor };
|
|
2557
|
-
|
|
2556
|
+
if(options.cursor){ params.cursor = options.cursor; };
|
|
2557
|
+
|
|
2558
2558
|
var requestAPI = request.get(url)
|
|
2559
2559
|
.set('Content-Type', 'application/json')
|
|
2560
2560
|
.set('Accept', 'application/json')
|
|
@@ -2563,7 +2563,7 @@ function getAllMembersOfAGroup(options) {
|
|
|
2563
2563
|
|
|
2564
2564
|
//Setup token in Authorization header
|
|
2565
2565
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2566
|
-
|
|
2566
|
+
|
|
2567
2567
|
requestAPI.end(function(error, response) {
|
|
2568
2568
|
if(error) {
|
|
2569
2569
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
@@ -2602,11 +2602,11 @@ function getAllGroupMembersByPath(options) {
|
|
|
2602
2602
|
url = helpers.api.constructAPIUrl(url, {
|
|
2603
2603
|
orgId: self.orgId
|
|
2604
2604
|
});
|
|
2605
|
-
|
|
2605
|
+
|
|
2606
2606
|
// Setup request with URL and Params
|
|
2607
2607
|
params.path = options.path;
|
|
2608
|
-
if(options.cursor){ params.cursor = options.cursor };
|
|
2609
|
-
|
|
2608
|
+
if(options.cursor){ params.cursor = options.cursor; };
|
|
2609
|
+
|
|
2610
2610
|
var requestAPI = request.get(url)
|
|
2611
2611
|
.set('Content-Type', 'application/json')
|
|
2612
2612
|
.set('Accept', 'application/json')
|
|
@@ -2615,7 +2615,7 @@ function getAllGroupMembersByPath(options) {
|
|
|
2615
2615
|
|
|
2616
2616
|
//Setup token in Authorization header
|
|
2617
2617
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2618
|
-
|
|
2618
|
+
|
|
2619
2619
|
requestAPI.end(function(error, response) {
|
|
2620
2620
|
if(error) {
|
|
2621
2621
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
@@ -2666,10 +2666,10 @@ function createMultiUserGroupMembership(options) {
|
|
|
2666
2666
|
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
2667
2667
|
self.config.AUTH_API_URLS.userGroupMembership;
|
|
2668
2668
|
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, groupId: options.groupId });
|
|
2669
|
-
|
|
2669
|
+
|
|
2670
2670
|
// Setup request with URL and Params
|
|
2671
2671
|
params = options.body;
|
|
2672
|
-
|
|
2672
|
+
|
|
2673
2673
|
var requestAPI = request.post(url)
|
|
2674
2674
|
.set('Content-Type', 'application/json')
|
|
2675
2675
|
.set('Accept', 'application/json')
|
|
@@ -2677,7 +2677,7 @@ function createMultiUserGroupMembership(options) {
|
|
|
2677
2677
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
2678
2678
|
//Setup token in Authorization header
|
|
2679
2679
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2680
|
-
|
|
2680
|
+
|
|
2681
2681
|
requestAPI.end(function(error, response) {
|
|
2682
2682
|
if(error) {
|
|
2683
2683
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
@@ -2688,7 +2688,7 @@ function createMultiUserGroupMembership(options) {
|
|
|
2688
2688
|
} else {
|
|
2689
2689
|
err = {};
|
|
2690
2690
|
err.message = err.description = 'Mandatory param - groupId or body or body.users(min. 1 user) ' +
|
|
2691
|
-
'not found in request options.'
|
|
2691
|
+
'not found in request options.';
|
|
2692
2692
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
2693
2693
|
dfd.reject(err);
|
|
2694
2694
|
}
|
|
@@ -2723,7 +2723,7 @@ function deleteMultiUserGroupMembership(options) {
|
|
|
2723
2723
|
orgId: self.orgId,
|
|
2724
2724
|
groupId: options.groupId
|
|
2725
2725
|
});
|
|
2726
|
-
|
|
2726
|
+
|
|
2727
2727
|
// Setup request with URL and Params
|
|
2728
2728
|
params = options.body;
|
|
2729
2729
|
var requestAPI = request.delete(url)
|
|
@@ -2744,7 +2744,7 @@ function deleteMultiUserGroupMembership(options) {
|
|
|
2744
2744
|
} else {
|
|
2745
2745
|
err = {};
|
|
2746
2746
|
err.message = err.description = 'Mandatory param - groupId or body or body.users(min. 1 user) ' +
|
|
2747
|
-
'not found in request options.'
|
|
2747
|
+
'not found in request options.';
|
|
2748
2748
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
2749
2749
|
dfd.reject(err);
|
|
2750
2750
|
}
|
|
@@ -2871,11 +2871,11 @@ function getMyAllMemberships(options) {
|
|
|
2871
2871
|
orgId: self.orgId,
|
|
2872
2872
|
userId: options.userId
|
|
2873
2873
|
});
|
|
2874
|
-
|
|
2874
|
+
|
|
2875
2875
|
// Setup request with URL and Params
|
|
2876
2876
|
params.path = options.path;
|
|
2877
|
-
if(options.cursor){ params.cursor = options.cursor };
|
|
2878
|
-
|
|
2877
|
+
if(options.cursor){ params.cursor = options.cursor; };
|
|
2878
|
+
|
|
2879
2879
|
var requestAPI = request.get(url)
|
|
2880
2880
|
.set('Content-Type', 'application/json')
|
|
2881
2881
|
.set('Accept', 'application/json')
|
|
@@ -2884,7 +2884,7 @@ function getMyAllMemberships(options) {
|
|
|
2884
2884
|
|
|
2885
2885
|
//Setup token in Authorization header
|
|
2886
2886
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2887
|
-
|
|
2887
|
+
|
|
2888
2888
|
requestAPI.end(function(error, response) {
|
|
2889
2889
|
if(error) {
|
|
2890
2890
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
@@ -4048,7 +4048,7 @@ function getAllCustomComponents(options) {
|
|
|
4048
4048
|
|
|
4049
4049
|
// Setup request with URL and Params
|
|
4050
4050
|
var params = {};
|
|
4051
|
-
if (options.cursor) { params.cursor = options.cursor; }
|
|
4051
|
+
if (options && options.cursor) { params.cursor = options.cursor; }
|
|
4052
4052
|
|
|
4053
4053
|
var requestAPI = request.get(url).query(params);
|
|
4054
4054
|
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|