comprodls-sdk 2.55.1 → 2.56.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 +120 -28
- package/dist/comprodls-sdk.min.js +15 -15
- package/lib/config/index.js +4 -1
- package/lib/services/analytics/index.js +70 -2
- package/lib/services/drive/index.js +2 -0
- package/lib/services/spaces/index.js +44 -25
- package/package.json +1 -1
package/dist/comprodls-sdk.js
CHANGED
|
@@ -437,7 +437,10 @@ exports.ANALYTICS_API_URLS = {
|
|
|
437
437
|
|
|
438
438
|
//ClassCustomComponentRecord Related APIs
|
|
439
439
|
getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
|
|
440
|
-
getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations'
|
|
440
|
+
getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations',
|
|
441
|
+
|
|
442
|
+
//CrossProductAggregation Related APIs
|
|
443
|
+
getCrossProductAggregation: '/{orgId}/class/cross-product-aggregation'
|
|
441
444
|
};
|
|
442
445
|
|
|
443
446
|
exports.COLLAB_API_URLS = {
|
|
@@ -2026,7 +2029,10 @@ function analytics() {
|
|
|
2026
2029
|
|
|
2027
2030
|
//ClassCustomComponentRecord Related APIs
|
|
2028
2031
|
getClassCustomComponentRecord: getClassCustomComponentRecord.bind(this),
|
|
2029
|
-
getClassCustomComponentUserSubmission: getClassCustomComponentUserSubmission.bind(this)
|
|
2032
|
+
getClassCustomComponentUserSubmission: getClassCustomComponentUserSubmission.bind(this),
|
|
2033
|
+
|
|
2034
|
+
//CrossProductAggregation Related APIs
|
|
2035
|
+
getCrossProductAggregation: getCrossProductAggregation.bind(this)
|
|
2030
2036
|
};
|
|
2031
2037
|
}
|
|
2032
2038
|
|
|
@@ -3420,6 +3426,9 @@ function getQuestionProgressByLearningObjective(questionsArray) {
|
|
|
3420
3426
|
|
|
3421
3427
|
/* options = {
|
|
3422
3428
|
"classid": "string", // required
|
|
3429
|
+
"status_active": <boolean>,
|
|
3430
|
+
"status_not_started": <boolean>,
|
|
3431
|
+
"status_expired": <boolean>
|
|
3423
3432
|
};
|
|
3424
3433
|
*/
|
|
3425
3434
|
function getAllAssignedPathsOfClass(options) {
|
|
@@ -3435,7 +3444,12 @@ function getAllAssignedPathsOfClass(options) {
|
|
|
3435
3444
|
var url = self.config.DEFAULT_HOSTS.ANALYTICS + self.config.ANALYTICS_API_URLS.getAllAssignedPathsOfClass;
|
|
3436
3445
|
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
3437
3446
|
|
|
3438
|
-
var queryParams = {
|
|
3447
|
+
var queryParams = {
|
|
3448
|
+
classid: options.classid,
|
|
3449
|
+
status_not_started: options.status_not_started,
|
|
3450
|
+
status_active: options.status_active,
|
|
3451
|
+
status_expired: options.status_expired
|
|
3452
|
+
};
|
|
3439
3453
|
|
|
3440
3454
|
// Setup request with URL and Params
|
|
3441
3455
|
var requestAPI = request.get(url).query(queryParams);
|
|
@@ -3519,6 +3533,9 @@ function getAssignedPathAnalytics(options) {
|
|
|
3519
3533
|
/* options = {
|
|
3520
3534
|
"classid": "string", // required
|
|
3521
3535
|
"userid" : "string", // required
|
|
3536
|
+
"status_active": <boolean>,
|
|
3537
|
+
"status_not_started": <boolean>,
|
|
3538
|
+
"status_expired": <boolean>,
|
|
3522
3539
|
"progress" : "true/false",
|
|
3523
3540
|
"group" : "true/false"
|
|
3524
3541
|
};
|
|
@@ -3539,6 +3556,9 @@ function getMyAssignedPathsOfClass(options) {
|
|
|
3539
3556
|
if(options.progress) { queryParams.progress = options.progress; }
|
|
3540
3557
|
if(options.group) { queryParams.group = options.group; }
|
|
3541
3558
|
if(options.expiredView) { queryParams.expiredView = options.expiredView; }
|
|
3559
|
+
if(options.status_not_started) { queryParams.status_not_started = options.status_not_started; }
|
|
3560
|
+
if(options.status_active) { queryParams.status_active = options.status_active; }
|
|
3561
|
+
if(options.status_expired) { queryParams.status_expired = options.status_expired; }
|
|
3542
3562
|
|
|
3543
3563
|
// Setup request with URL and Params
|
|
3544
3564
|
var requestAPI = request.get(url).query(queryParams);
|
|
@@ -3833,6 +3853,57 @@ function postProgressTimeseries(options) {
|
|
|
3833
3853
|
}
|
|
3834
3854
|
return dfd.promise;
|
|
3835
3855
|
}
|
|
3856
|
+
|
|
3857
|
+
/* This function will get cross product aggregation record for a class. This function can also return cross product
|
|
3858
|
+
* aggregation record for a particular userid(optional).
|
|
3859
|
+
* options = {
|
|
3860
|
+
* classid: 'string', // class uuid(mandatory)
|
|
3861
|
+
* userid: 'string' // user uuid (optional)
|
|
3862
|
+
*}
|
|
3863
|
+
*/
|
|
3864
|
+
function getCrossProductAggregation(options) {
|
|
3865
|
+
var self = this;
|
|
3866
|
+
|
|
3867
|
+
//Initializing DFD
|
|
3868
|
+
var dfd = q.defer(), err = {};
|
|
3869
|
+
|
|
3870
|
+
// Validations
|
|
3871
|
+
if(options && options.classid) {
|
|
3872
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
3873
|
+
if(err){ dfd.reject(err); }
|
|
3874
|
+
else {
|
|
3875
|
+
// Passed all validations, Constructing URL
|
|
3876
|
+
var url = self.config.DEFAULT_HOSTS['ANALYTICS'] + self.config.ANALYTICS_API_URLS.getCrossProductAggregation;
|
|
3877
|
+
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
3878
|
+
|
|
3879
|
+
// Setup Query Params
|
|
3880
|
+
var queryParams = { classid: options.classid };
|
|
3881
|
+
|
|
3882
|
+
if(options.userid) { queryParams.userid = options.userid };
|
|
3883
|
+
|
|
3884
|
+
// Setup Request with url and params
|
|
3885
|
+
var requestAPI = request.get(url).query(queryParams);
|
|
3886
|
+
// Setup token in Authorization Header
|
|
3887
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
3888
|
+
|
|
3889
|
+
// setting up traceid
|
|
3890
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
3891
|
+
|
|
3892
|
+
// Call GET CROSS PRODUCT AGGREGATION RECORD FOR A CLASS
|
|
3893
|
+
requestAPI.end(function(error, response) {
|
|
3894
|
+
if(error) {
|
|
3895
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
3896
|
+
dfd.reject(err);
|
|
3897
|
+
} else { dfd.resolve(response.body); }
|
|
3898
|
+
});
|
|
3899
|
+
}
|
|
3900
|
+
} else {
|
|
3901
|
+
err.message = err.description = 'Required parameter classid not found in request options.';
|
|
3902
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
3903
|
+
dfd.reject(err);
|
|
3904
|
+
}
|
|
3905
|
+
return dfd.promise;
|
|
3906
|
+
}
|
|
3836
3907
|
|
|
3837
3908
|
},{"../../helpers":3,"agentkeepalive":36,"q":46,"superagent":49}],15:[function(require,module,exports){
|
|
3838
3909
|
/*************************************************************************
|
|
@@ -10082,6 +10153,7 @@ function getAllDocumentsInAFolder(options) {
|
|
|
10082
10153
|
classid: 'string',
|
|
10083
10154
|
productcode: 'string', // mandatory
|
|
10084
10155
|
dls_user_id: 'string', // mandatory
|
|
10156
|
+
collaborator_id: 'string' // optional; mandatory if some OTHER user is updating this document.
|
|
10085
10157
|
entities: [ // mandatory (Min length 1)
|
|
10086
10158
|
{
|
|
10087
10159
|
item_code: 'string',
|
|
@@ -10141,6 +10213,7 @@ function createMultipleDocuments(options) {
|
|
|
10141
10213
|
accountid: 'string', // mandatory
|
|
10142
10214
|
extuserid: 'string', // mandatory
|
|
10143
10215
|
body: { // mandatory
|
|
10216
|
+
collaborator_id: 'string' // optional; mandatory if some OTHER user is updating this document.
|
|
10144
10217
|
entities: [ // mandatory (Min length 1)
|
|
10145
10218
|
{
|
|
10146
10219
|
folderid: 'string', // mandatory
|
|
@@ -13472,27 +13545,44 @@ function provisionBulkSpaces(options) {
|
|
|
13472
13545
|
}
|
|
13473
13546
|
|
|
13474
13547
|
/**
|
|
13475
|
-
*
|
|
13476
|
-
*
|
|
13477
|
-
*
|
|
13478
|
-
*
|
|
13479
|
-
*
|
|
13480
|
-
*
|
|
13481
|
-
*
|
|
13482
|
-
*
|
|
13483
|
-
*
|
|
13484
|
-
*
|
|
13485
|
-
*
|
|
13486
|
-
*
|
|
13487
|
-
*
|
|
13488
|
-
*
|
|
13489
|
-
*
|
|
13490
|
-
*
|
|
13491
|
-
*
|
|
13492
|
-
*
|
|
13548
|
+
* @param {
|
|
13549
|
+
* *ext_user_id: 'string',
|
|
13550
|
+
* *ext_role": 'string',
|
|
13551
|
+
* ext_first_name: 'string',
|
|
13552
|
+
* ext_last_name: 'string',
|
|
13553
|
+
* ext_email: 'string',
|
|
13554
|
+
* address: {
|
|
13555
|
+
* country:'string'
|
|
13556
|
+
* },
|
|
13557
|
+
* ref_id: 'string',
|
|
13558
|
+
* ext_classid : 'string',
|
|
13559
|
+
* ext_class_meta : {
|
|
13560
|
+
* *title: 'string',
|
|
13561
|
+
* *startdate: <epoch>,
|
|
13562
|
+
* *enddate: <epoch>,
|
|
13563
|
+
* description: 'string',
|
|
13564
|
+
* ext_data: {}
|
|
13565
|
+
* }
|
|
13566
|
+
* clone_settings: {
|
|
13567
|
+
* *src_ext_classid: 'string',
|
|
13568
|
+
* products: boolean,
|
|
13569
|
+
* assigned_paths: boolean,
|
|
13570
|
+
* advanced: {
|
|
13571
|
+
* assigned_paths: [ //length > 0 if assigned_paths flag is true
|
|
13572
|
+
* {
|
|
13573
|
+
* *ext_assignedpathid: 'string',
|
|
13574
|
+
* *assigned_path_id: 'string',
|
|
13575
|
+
* startdate: 0,
|
|
13576
|
+
* *duedate: 0
|
|
13577
|
+
* },
|
|
13578
|
+
* ],
|
|
13579
|
+
* products: [
|
|
13580
|
+
* { *productcode: 'string' },
|
|
13581
|
+
* ]
|
|
13582
|
+
* }
|
|
13493
13583
|
* }
|
|
13494
13584
|
* }
|
|
13495
|
-
|
|
13585
|
+
*/
|
|
13496
13586
|
function shadowProvision(options) {
|
|
13497
13587
|
var self = this;
|
|
13498
13588
|
//Initializing promise
|
|
@@ -13510,12 +13600,14 @@ function shadowProvision(options) {
|
|
|
13510
13600
|
.send(options);
|
|
13511
13601
|
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
13512
13602
|
|
|
13513
|
-
requestAPI
|
|
13514
|
-
|
|
13515
|
-
|
|
13516
|
-
|
|
13517
|
-
|
|
13518
|
-
|
|
13603
|
+
requestAPI
|
|
13604
|
+
.agent(keepaliveAgent)
|
|
13605
|
+
.end(function (err, response) {
|
|
13606
|
+
if (err) {
|
|
13607
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
|
|
13608
|
+
dfd.reject(err);
|
|
13609
|
+
}
|
|
13610
|
+
else { dfd.resolve(response.body); }
|
|
13519
13611
|
});
|
|
13520
13612
|
}
|
|
13521
13613
|
else {
|