comprodls-sdk 2.56.0 → 2.58.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 +796 -542
- package/dist/comprodls-sdk.min.js +15 -15
- package/lib/config/index.js +3 -0
- package/lib/services/analytics/index.js +17 -5
- package/lib/services/auth/index.js +52 -17
- package/lib/services/spaces/index.js +27 -19
- package/package.json +1 -1
package/lib/config/index.js
CHANGED
|
@@ -40,6 +40,9 @@ exports.REALM_HOSTS = {
|
|
|
40
40
|
ANALYTICS: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-analytics',
|
|
41
41
|
INTEGRATION: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-integrations',
|
|
42
42
|
DRIVE: 'http://internal-dls-global-prod1-1755536919.us-west-2.elb.amazonaws.com/lb-drive'
|
|
43
|
+
},
|
|
44
|
+
DEVELOPMENT: {
|
|
45
|
+
ANALYTICS: 'http://localhost:4000'
|
|
43
46
|
}
|
|
44
47
|
},
|
|
45
48
|
ASGARD: {
|
|
@@ -1489,7 +1489,9 @@ function getQuestionProgressByLearningObjective(questionsArray) {
|
|
|
1489
1489
|
"classid": "string", // required
|
|
1490
1490
|
"status_active": <boolean>,
|
|
1491
1491
|
"status_not_started": <boolean>,
|
|
1492
|
-
"status_expired": <boolean
|
|
1492
|
+
"status_expired": <boolean>,
|
|
1493
|
+
"limit": integer, // Number of entities to be fetched
|
|
1494
|
+
"cursor": "string" // cursor to get next set of assignments
|
|
1493
1495
|
};
|
|
1494
1496
|
*/
|
|
1495
1497
|
function getAllAssignedPathsOfClass(options) {
|
|
@@ -1509,7 +1511,9 @@ function getAllAssignedPathsOfClass(options) {
|
|
|
1509
1511
|
classid: options.classid,
|
|
1510
1512
|
status_not_started: options.status_not_started,
|
|
1511
1513
|
status_active: options.status_active,
|
|
1512
|
-
status_expired: options.status_expired
|
|
1514
|
+
status_expired: options.status_expired,
|
|
1515
|
+
limit: options.limit,
|
|
1516
|
+
cursor: options.cursor
|
|
1513
1517
|
};
|
|
1514
1518
|
|
|
1515
1519
|
// Setup request with URL and Params
|
|
@@ -1521,7 +1525,9 @@ function getAllAssignedPathsOfClass(options) {
|
|
|
1521
1525
|
// setting up traceid
|
|
1522
1526
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1523
1527
|
|
|
1524
|
-
requestAPI
|
|
1528
|
+
requestAPI
|
|
1529
|
+
.agent(keepaliveAgent)
|
|
1530
|
+
.end(function (error, response) {
|
|
1525
1531
|
if(error) {
|
|
1526
1532
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1527
1533
|
dfd.reject(err);
|
|
@@ -1598,7 +1604,9 @@ function getAssignedPathAnalytics(options) {
|
|
|
1598
1604
|
"status_not_started": <boolean>,
|
|
1599
1605
|
"status_expired": <boolean>,
|
|
1600
1606
|
"progress" : "true/false",
|
|
1601
|
-
"group" : "true/false"
|
|
1607
|
+
"group" : "true/false",
|
|
1608
|
+
"limit": integer, // Number of entities to be fetched
|
|
1609
|
+
"cursor": "string" // cursor to get next set of assignments
|
|
1602
1610
|
};
|
|
1603
1611
|
*/
|
|
1604
1612
|
function getMyAssignedPathsOfClass(options) {
|
|
@@ -1620,6 +1628,8 @@ function getMyAssignedPathsOfClass(options) {
|
|
|
1620
1628
|
if(options.status_not_started) { queryParams.status_not_started = options.status_not_started; }
|
|
1621
1629
|
if(options.status_active) { queryParams.status_active = options.status_active; }
|
|
1622
1630
|
if(options.status_expired) { queryParams.status_expired = options.status_expired; }
|
|
1631
|
+
if(options.limit) { queryParams.limit = options.limit; }
|
|
1632
|
+
if(options.cursor) { queryParams.cursor = options.cursor; }
|
|
1623
1633
|
|
|
1624
1634
|
// Setup request with URL and Params
|
|
1625
1635
|
var requestAPI = request.get(url).query(queryParams);
|
|
@@ -1629,7 +1639,9 @@ function getMyAssignedPathsOfClass(options) {
|
|
|
1629
1639
|
// setting up traceid
|
|
1630
1640
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1631
1641
|
|
|
1632
|
-
requestAPI
|
|
1642
|
+
requestAPI
|
|
1643
|
+
.agent(keepaliveAgent)
|
|
1644
|
+
.end(function (error, response) {
|
|
1633
1645
|
if(error) {
|
|
1634
1646
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1635
1647
|
dfd.reject(err);
|
|
@@ -682,7 +682,9 @@ function getUserClasses(options) {
|
|
|
682
682
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
683
683
|
|
|
684
684
|
// Call GET ALL USER Api
|
|
685
|
-
requestAPI
|
|
685
|
+
requestAPI
|
|
686
|
+
.agent(keepaliveAgent)
|
|
687
|
+
.end(function(err, response) {
|
|
686
688
|
if(err) {
|
|
687
689
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
688
690
|
dfd.reject(err);
|
|
@@ -1182,7 +1184,9 @@ function getAllClasses(options) {
|
|
|
1182
1184
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1183
1185
|
|
|
1184
1186
|
//Call GET ALL USER Api
|
|
1185
|
-
requestAPI
|
|
1187
|
+
requestAPI
|
|
1188
|
+
.agent(keepaliveAgent)
|
|
1189
|
+
.end(function(err, response) {
|
|
1186
1190
|
if(err) {
|
|
1187
1191
|
var esErrOptions = { type: helpers.errors.ERROR_TYPES.API_ERROR, err: err };
|
|
1188
1192
|
var error = converter.convertElasticsearchErrResponse(esErrOptions);
|
|
@@ -1227,6 +1231,10 @@ function getAllClasses(options) {
|
|
|
1227
1231
|
teacherCount: classEntity.teacherCount
|
|
1228
1232
|
};
|
|
1229
1233
|
|
|
1234
|
+
if(classEntity.limits){
|
|
1235
|
+
classObj.limits = classEntity.limits;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1230
1238
|
/**
|
|
1231
1239
|
* Add class-tag association specific fields
|
|
1232
1240
|
*/
|
|
@@ -1663,7 +1671,9 @@ function enrollUsertoClass(options) {
|
|
|
1663
1671
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1664
1672
|
|
|
1665
1673
|
//Call GET Product by it's code Api
|
|
1666
|
-
requestAPI
|
|
1674
|
+
requestAPI
|
|
1675
|
+
.agent(keepaliveAgent)
|
|
1676
|
+
.end(function(err, response) {
|
|
1667
1677
|
if(err) {
|
|
1668
1678
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1669
1679
|
dfd.reject(err);
|
|
@@ -1716,7 +1726,9 @@ function enrollSelftoClass(options) {
|
|
|
1716
1726
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1717
1727
|
|
|
1718
1728
|
//Call GET Product by it's code Api
|
|
1719
|
-
requestAPI
|
|
1729
|
+
requestAPI
|
|
1730
|
+
.agent(keepaliveAgent)
|
|
1731
|
+
.end(function(err, response) {
|
|
1720
1732
|
if(err) {
|
|
1721
1733
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1722
1734
|
dfd.reject(err);
|
|
@@ -1772,7 +1784,9 @@ function enrollMultiUserstoClass(options) {
|
|
|
1772
1784
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1773
1785
|
|
|
1774
1786
|
//Call GET Product by it's code Api
|
|
1775
|
-
requestAPI
|
|
1787
|
+
requestAPI
|
|
1788
|
+
.agent(keepaliveAgent)
|
|
1789
|
+
.end(function(err, response) {
|
|
1776
1790
|
if(err) {
|
|
1777
1791
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1778
1792
|
dfd.reject(err);
|
|
@@ -1917,6 +1931,7 @@ function encodeURLParameter(options) {
|
|
|
1917
1931
|
* ext_data: {} // Optional
|
|
1918
1932
|
* analyticsharingmodel: '' // Optional - Valid values: ['NOINHERIT_SYNCBACK']
|
|
1919
1933
|
* analytics_score_aggregation_type: '' // Optional - Valid values: ['best'/'first'/'last']
|
|
1934
|
+
* limits: {"los": number, "students": number} // Optional field
|
|
1920
1935
|
* }
|
|
1921
1936
|
*/
|
|
1922
1937
|
function createClass(options) {
|
|
@@ -1954,7 +1969,9 @@ function createClass(options) {
|
|
|
1954
1969
|
//Setup token in Authorization header
|
|
1955
1970
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1956
1971
|
|
|
1957
|
-
requestAPI
|
|
1972
|
+
requestAPI
|
|
1973
|
+
.agent(keepaliveAgent)
|
|
1974
|
+
.end(function(err, response) {
|
|
1958
1975
|
if(err) {
|
|
1959
1976
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
1960
1977
|
dfd.reject(err);
|
|
@@ -1981,6 +1998,7 @@ function createClass(options) {
|
|
|
1981
1998
|
// description: '', //Optional field
|
|
1982
1999
|
// ext_data: '' //Optional field
|
|
1983
2000
|
// analytics_score_aggregation_type: '' // Optional - Valid values: ['best'/'first'/'last']
|
|
2001
|
+
// limits: {"los": number, "students": number} // Optional field
|
|
1984
2002
|
//}
|
|
1985
2003
|
function updateClass(options) {
|
|
1986
2004
|
var self = this;
|
|
@@ -2006,7 +2024,9 @@ function updateClass(options) {
|
|
|
2006
2024
|
//Setup token in Authorization header
|
|
2007
2025
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2008
2026
|
|
|
2009
|
-
requestAPI
|
|
2027
|
+
requestAPI
|
|
2028
|
+
.agent(keepaliveAgent)
|
|
2029
|
+
.end(function(err, response) {
|
|
2010
2030
|
if(err) {
|
|
2011
2031
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
2012
2032
|
dfd.reject(err);
|
|
@@ -2040,6 +2060,7 @@ function updateClass(options) {
|
|
|
2040
2060
|
"model": "STRICT",
|
|
2041
2061
|
"analyticsharingmodel":"NOINHERIT_SYNCBACK" // optional
|
|
2042
2062
|
"analytics_score_aggregation_type":"first/best/last" // optional
|
|
2063
|
+
limits: {los: number, students: number} // Optional field
|
|
2043
2064
|
"owner": {
|
|
2044
2065
|
"userid": "string" //Mandatory if model is 'STRICT'
|
|
2045
2066
|
},
|
|
@@ -2084,6 +2105,7 @@ function updateClass(options) {
|
|
|
2084
2105
|
"analyticsharingmodel": true,
|
|
2085
2106
|
"analytics_score_aggregation_type": true,
|
|
2086
2107
|
"ext_data": true,
|
|
2108
|
+
"limits": true,
|
|
2087
2109
|
"advanced": {
|
|
2088
2110
|
"students": [
|
|
2089
2111
|
{
|
|
@@ -2117,7 +2139,8 @@ function updateClass(options) {
|
|
|
2117
2139
|
],
|
|
2118
2140
|
"products": [ { "productcode": "string" } ],
|
|
2119
2141
|
"analyticsharingmodel": "string" // Valid values: ['NOINHERIT_SYNCBACK']
|
|
2120
|
-
"analytics_score_aggregation_type": "string" // Valid values: ['best', 'first', 'last']
|
|
2142
|
+
"analytics_score_aggregation_type": "string", // Valid values: ['best', 'first', 'last']
|
|
2143
|
+
"limits": {los: number, students: number} // Optional field
|
|
2121
2144
|
}
|
|
2122
2145
|
}
|
|
2123
2146
|
}
|
|
@@ -2150,7 +2173,9 @@ function createMultipleClasses(options) {
|
|
|
2150
2173
|
//Setup token in Authorization header
|
|
2151
2174
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2152
2175
|
|
|
2153
|
-
requestAPI
|
|
2176
|
+
requestAPI
|
|
2177
|
+
.agent(keepaliveAgent)
|
|
2178
|
+
.end(function (err, response) {
|
|
2154
2179
|
if (err) {
|
|
2155
2180
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
2156
2181
|
dfd.reject(err);
|
|
@@ -2327,12 +2352,18 @@ function deleteAssignedPath(options) {
|
|
|
2327
2352
|
options = {
|
|
2328
2353
|
classid: 'string' //mandatory
|
|
2329
2354
|
assignedpathid: 'string' //mandatory
|
|
2330
|
-
data:
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2355
|
+
data: {
|
|
2356
|
+
title: 'string' //optional
|
|
2357
|
+
startdate: 'string' //optional
|
|
2358
|
+
duedate: 'string' //optional
|
|
2359
|
+
items: [ //optional
|
|
2360
|
+
{
|
|
2361
|
+
item-code: 'string', //mandatory
|
|
2362
|
+
item_type: 'string', //mandatory, ['dls-internal','external']
|
|
2363
|
+
dls_product_code: 'string' //mandatory only if item_type is 'dls-internal'
|
|
2364
|
+
}
|
|
2365
|
+
]
|
|
2366
|
+
}
|
|
2336
2367
|
}
|
|
2337
2368
|
*/
|
|
2338
2369
|
function updateAssignedPath(options) {
|
|
@@ -2355,7 +2386,9 @@ function updateAssignedPath(options) {
|
|
|
2355
2386
|
//Setup token in Authorization header
|
|
2356
2387
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
2357
2388
|
|
|
2358
|
-
requestAPI
|
|
2389
|
+
requestAPI
|
|
2390
|
+
.agent(keepaliveAgent)
|
|
2391
|
+
.end(function (error, response) {
|
|
2359
2392
|
if(error) {
|
|
2360
2393
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
2361
2394
|
dfd.reject(err);
|
|
@@ -3117,7 +3150,9 @@ function cloneClass(options) {
|
|
|
3117
3150
|
//Setup token in Authorization header
|
|
3118
3151
|
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
3119
3152
|
|
|
3120
|
-
requestAPI
|
|
3153
|
+
requestAPI
|
|
3154
|
+
.agent(keepaliveAgent)
|
|
3155
|
+
.end(function(err, response) {
|
|
3121
3156
|
if(err) {
|
|
3122
3157
|
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
3123
3158
|
dfd.reject(err);
|
|
@@ -524,26 +524,34 @@ function provisionBulkSpaces(options) {
|
|
|
524
524
|
* *startdate: <epoch>,
|
|
525
525
|
* *enddate: <epoch>,
|
|
526
526
|
* description: 'string',
|
|
527
|
-
* ext_data: {}
|
|
527
|
+
* ext_data: {},
|
|
528
|
+
* limits: {
|
|
529
|
+
* *los: 0,
|
|
530
|
+
* *students: 0
|
|
531
|
+
* }
|
|
532
|
+
* },
|
|
533
|
+
* checkLimits: {
|
|
534
|
+
* student: 0,
|
|
535
|
+
* teacher: 0
|
|
536
|
+
* },
|
|
537
|
+
* clone_settings: {
|
|
538
|
+
* *src_ext_classid: 'string',
|
|
539
|
+
* products: boolean,
|
|
540
|
+
* assigned_paths: boolean,
|
|
541
|
+
* advanced: {
|
|
542
|
+
* assigned_paths: [ //length > 0 if assigned_paths flag is true
|
|
543
|
+
* {
|
|
544
|
+
* *ext_assignedpathid: 'string',
|
|
545
|
+
* *assigned_path_id: 'string',
|
|
546
|
+
* startdate: 0,
|
|
547
|
+
* *duedate: 0
|
|
548
|
+
* },
|
|
549
|
+
* ],
|
|
550
|
+
* products: [
|
|
551
|
+
* { *productcode: 'string' },
|
|
552
|
+
* ]
|
|
553
|
+
* }
|
|
528
554
|
* }
|
|
529
|
-
* clone_settings: {
|
|
530
|
-
* *src_ext_classid: 'string',
|
|
531
|
-
* products: boolean,
|
|
532
|
-
* assigned_paths: boolean,
|
|
533
|
-
* advanced: {
|
|
534
|
-
* assigned_paths: [ //length > 0 if assigned_paths flag is true
|
|
535
|
-
* {
|
|
536
|
-
* *ext_assignedpathid: 'string',
|
|
537
|
-
* *assigned_path_id: 'string',
|
|
538
|
-
* startdate: 0,
|
|
539
|
-
* *duedate: 0
|
|
540
|
-
* },
|
|
541
|
-
* ],
|
|
542
|
-
* products: [
|
|
543
|
-
* { *productcode: 'string' },
|
|
544
|
-
* ]
|
|
545
|
-
* }
|
|
546
|
-
* }
|
|
547
555
|
* }
|
|
548
556
|
*/
|
|
549
557
|
function shadowProvision(options) {
|