comprodls-sdk 2.40.0 → 2.41.2
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 +128 -2
- package/dist/comprodls-sdk.min.js +22 -22
- package/lib/config/index.js +5 -1
- package/lib/services/analytics/index.js +122 -1
- package/lib/services/auth/index.js +1 -0
- package/package.json +4 -4
package/dist/comprodls-sdk.js
CHANGED
|
@@ -415,7 +415,11 @@ exports.ANALYTICS_API_URLS = {
|
|
|
415
415
|
getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
|
|
416
416
|
getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
|
|
417
417
|
|
|
418
|
-
timeseriesAnalytics: '/progress/timeseries'
|
|
418
|
+
timeseriesAnalytics: '/progress/timeseries',
|
|
419
|
+
|
|
420
|
+
//ClassCustomComponentRecord Related APIs
|
|
421
|
+
getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
|
|
422
|
+
getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations'
|
|
419
423
|
};
|
|
420
424
|
|
|
421
425
|
exports.SISEVENTS_API_URLS = {
|
|
@@ -2003,7 +2007,11 @@ function analytics() {
|
|
|
2003
2007
|
getMyParticularAssignedPathOfClass: getMyParticularAssignedPathOfClass.bind(this),
|
|
2004
2008
|
|
|
2005
2009
|
getTimeseriesAnalytics: getTimeseriesAnalytics.bind(this),
|
|
2006
|
-
postProgressTimeseries: postProgressTimeseries.bind(this)
|
|
2010
|
+
postProgressTimeseries: postProgressTimeseries.bind(this),
|
|
2011
|
+
|
|
2012
|
+
//ClassCustomComponentRecord Related APIs
|
|
2013
|
+
getClassCustomComponentRecord: getClassCustomComponentRecord.bind(this),
|
|
2014
|
+
getClassCustomComponentUserSubmission: getClassCustomComponentUserSubmission.bind(this)
|
|
2007
2015
|
};
|
|
2008
2016
|
}
|
|
2009
2017
|
|
|
@@ -3686,6 +3694,123 @@ function postProgressTimeseries(options) {
|
|
|
3686
3694
|
}
|
|
3687
3695
|
return dfd.promise;
|
|
3688
3696
|
}
|
|
3697
|
+
|
|
3698
|
+
/* This function will get all the customcomponent analytics of each user for each item in a class.
|
|
3699
|
+
* options = {
|
|
3700
|
+
* classid: 'string', // class uuid(mandatory)
|
|
3701
|
+
* custom_component_code: 'string', // class custom component code(optional)
|
|
3702
|
+
*}
|
|
3703
|
+
*/
|
|
3704
|
+
function getClassCustomComponentRecord(options) {
|
|
3705
|
+
var self = this;
|
|
3706
|
+
|
|
3707
|
+
//Initializing DFD
|
|
3708
|
+
var dfd = q.defer(), err = {};
|
|
3709
|
+
|
|
3710
|
+
// Validations
|
|
3711
|
+
if(options && options.classid) {
|
|
3712
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
3713
|
+
if(err){ dfd.reject(err); }
|
|
3714
|
+
else {
|
|
3715
|
+
// Passed all validations, Constructing URL
|
|
3716
|
+
var url = self.config.DEFAULT_HOSTS['ANALYTICS'] + self.config.ANALYTICS_API_URLS.getClassCustomComponentRecord;
|
|
3717
|
+
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
3718
|
+
|
|
3719
|
+
// Setup Query Params
|
|
3720
|
+
var queryParams = {
|
|
3721
|
+
classid: options.classid
|
|
3722
|
+
};
|
|
3723
|
+
|
|
3724
|
+
if(options['custom_component_code']) {
|
|
3725
|
+
queryParams['custom_component_code'] = options['custom_component_code'];
|
|
3726
|
+
}
|
|
3727
|
+
|
|
3728
|
+
// Setup Request with url and params
|
|
3729
|
+
var requestAPI = request.get(url).query(queryParams);
|
|
3730
|
+
// Setup token in Authorization Header
|
|
3731
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
3732
|
+
|
|
3733
|
+
// setting up traceid
|
|
3734
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
3735
|
+
|
|
3736
|
+
// Call GET CLASS CUSTOM COMPONENT RECORD ITEM
|
|
3737
|
+
requestAPI.end(function(error, response) {
|
|
3738
|
+
if(error) {
|
|
3739
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
3740
|
+
err.message = error.response.res.text;
|
|
3741
|
+
dfd.reject(err);
|
|
3742
|
+
} else {
|
|
3743
|
+
dfd.resolve(response.body);
|
|
3744
|
+
}
|
|
3745
|
+
});
|
|
3746
|
+
}
|
|
3747
|
+
} else {
|
|
3748
|
+
err.message = err.description = 'Required parameter classid not found in request options.';
|
|
3749
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
3750
|
+
dfd.reject(err);
|
|
3751
|
+
}
|
|
3752
|
+
return dfd.promise;
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
/* This function will get submissions of user on an item of custom component.
|
|
3756
|
+
* options = {
|
|
3757
|
+
* classid: 'string', // class uuid(mandatory)
|
|
3758
|
+
* custom_component_code: 'string', // class custom component code(mandatory)
|
|
3759
|
+
* userid: 'string', // user uuid(mandatory)
|
|
3760
|
+
* item_code: 'string' // item-code of an item(mandatory)
|
|
3761
|
+
*}
|
|
3762
|
+
*/
|
|
3763
|
+
function getClassCustomComponentUserSubmission(options) {
|
|
3764
|
+
var self = this;
|
|
3765
|
+
|
|
3766
|
+
//Initializing DFD
|
|
3767
|
+
var dfd = q.defer(), err = {};
|
|
3768
|
+
|
|
3769
|
+
// Validations
|
|
3770
|
+
if(options && options.classid && options['custom_component_code'] &&
|
|
3771
|
+
options.userid && options['item_code']) {
|
|
3772
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
3773
|
+
if(err){ dfd.reject(err); }
|
|
3774
|
+
else {
|
|
3775
|
+
// Passed all validations, Constructing URL
|
|
3776
|
+
var url = self.config.DEFAULT_HOSTS['ANALYTICS'] + self.config.ANALYTICS_API_URLS.getClassCustomComponentUserSubmission;
|
|
3777
|
+
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
3778
|
+
|
|
3779
|
+
// Setup Query Params
|
|
3780
|
+
var queryParams = {
|
|
3781
|
+
classid: options.classid,
|
|
3782
|
+
userid: options.userid,
|
|
3783
|
+
'custom-component-code': options['custom-component-code'],
|
|
3784
|
+
'item-code': options['item-code']
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3787
|
+
// Setup Request with url and params
|
|
3788
|
+
var requestAPI = request.get(url).query(queryParams);
|
|
3789
|
+
// Setup token in Authorization Header
|
|
3790
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
3791
|
+
|
|
3792
|
+
// setting up traceid
|
|
3793
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
3794
|
+
|
|
3795
|
+
// Call GET CLASS CUSTOM COMPONENT SUBMISSION OF A USER ON AN ITEM
|
|
3796
|
+
requestAPI.end(function(error, response) {
|
|
3797
|
+
if(error) {
|
|
3798
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
3799
|
+
err.message = error.response.res.text;
|
|
3800
|
+
dfd.reject(err);
|
|
3801
|
+
} else {
|
|
3802
|
+
dfd.resolve(response.body);
|
|
3803
|
+
}
|
|
3804
|
+
});
|
|
3805
|
+
}
|
|
3806
|
+
} else {
|
|
3807
|
+
err.message = err.description = 'Required parameter classid or ' +
|
|
3808
|
+
'custom-component-code or ' + 'userid or ' + 'item-code not found in request options.';
|
|
3809
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
3810
|
+
dfd.reject(err);
|
|
3811
|
+
}
|
|
3812
|
+
return dfd.promise;
|
|
3813
|
+
}
|
|
3689
3814
|
|
|
3690
3815
|
},{"../../helpers":3,"agentkeepalive":38,"q":90,"superagent":133}],15:[function(require,module,exports){
|
|
3691
3816
|
/*************************************************************************
|
|
@@ -7376,6 +7501,7 @@ function getAllGradebooksMetaOfAClass (options) {
|
|
|
7376
7501
|
"bundle-codes": [],
|
|
7377
7502
|
"productcode": "string",
|
|
7378
7503
|
"custom_component_code": "string",
|
|
7504
|
+
"scoring_type": "string",
|
|
7379
7505
|
"items": [
|
|
7380
7506
|
{
|
|
7381
7507
|
"item-code": "string"
|