comprodls-sdk 2.39.0 → 2.41.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 +4211 -4071
- package/dist/comprodls-sdk.min.js +22 -19
- package/lib/config/index.js +7 -3
- package/lib/services/analytics/index.js +122 -1
- package/lib/services/auth/index.js +4 -3
- package/package.json +4 -4
package/lib/config/index.js
CHANGED
|
@@ -213,11 +213,11 @@ exports.AUTH_API_URLS = {
|
|
|
213
213
|
updateOrDeleteGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}',
|
|
214
214
|
gradebookColumns: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}/columns',
|
|
215
215
|
getAllClassesOfAComponent: '/org/{orgId}/components/{component_code}/classes',
|
|
216
|
-
|
|
216
|
+
removeAllGradebookColumnsOfCustomComponent: '/org/{orgId}/gradebook/columns/custom-components/{component_code}',
|
|
217
217
|
|
|
218
218
|
// Custom Components related APIs
|
|
219
219
|
customComponents: '/org/{orgid}/custom-components',
|
|
220
|
-
particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
|
|
220
|
+
particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
|
|
221
221
|
};
|
|
222
222
|
|
|
223
223
|
exports.ACTIVITY_API_URLS = {
|
|
@@ -260,7 +260,11 @@ exports.ANALYTICS_API_URLS = {
|
|
|
260
260
|
getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
|
|
261
261
|
getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
|
|
262
262
|
|
|
263
|
-
timeseriesAnalytics: '/progress/timeseries'
|
|
263
|
+
timeseriesAnalytics: '/progress/timeseries',
|
|
264
|
+
|
|
265
|
+
//ClassCustomComponentRecord Related APIs
|
|
266
|
+
getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
|
|
267
|
+
getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations'
|
|
264
268
|
};
|
|
265
269
|
|
|
266
270
|
exports.SISEVENTS_API_URLS = {
|
|
@@ -86,7 +86,11 @@ function analytics() {
|
|
|
86
86
|
getMyParticularAssignedPathOfClass: getMyParticularAssignedPathOfClass.bind(this),
|
|
87
87
|
|
|
88
88
|
getTimeseriesAnalytics: getTimeseriesAnalytics.bind(this),
|
|
89
|
-
postProgressTimeseries: postProgressTimeseries.bind(this)
|
|
89
|
+
postProgressTimeseries: postProgressTimeseries.bind(this),
|
|
90
|
+
|
|
91
|
+
//ClassCustomComponentRecord Related APIs
|
|
92
|
+
getClassCustomComponentRecord: getClassCustomComponentRecord.bind(this),
|
|
93
|
+
getClassCustomComponentUserSubmission: getClassCustomComponentUserSubmission.bind(this)
|
|
90
94
|
};
|
|
91
95
|
}
|
|
92
96
|
|
|
@@ -1769,3 +1773,120 @@ function postProgressTimeseries(options) {
|
|
|
1769
1773
|
}
|
|
1770
1774
|
return dfd.promise;
|
|
1771
1775
|
}
|
|
1776
|
+
|
|
1777
|
+
/* This function will get all the customcomponent analytics of each user for each item in a class.
|
|
1778
|
+
* options = {
|
|
1779
|
+
* classid: 'string', // class uuid(mandatory)
|
|
1780
|
+
* custom-component-code: 'string', // class custom component code(optional)
|
|
1781
|
+
*}
|
|
1782
|
+
*/
|
|
1783
|
+
function getClassCustomComponentRecord(options) {
|
|
1784
|
+
var self = this;
|
|
1785
|
+
|
|
1786
|
+
//Initializing DFD
|
|
1787
|
+
var dfd = q.defer(), err = {};
|
|
1788
|
+
|
|
1789
|
+
// Validations
|
|
1790
|
+
if(options && options.classid) {
|
|
1791
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1792
|
+
if(err){ dfd.reject(err); }
|
|
1793
|
+
else {
|
|
1794
|
+
// Passed all validations, Constructing URL
|
|
1795
|
+
var url = self.config.DEFAULT_HOSTS['ANALYTICS'] + self.config.ANALYTICS_API_URLS.getClassCustomComponentRecord;
|
|
1796
|
+
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
1797
|
+
|
|
1798
|
+
// Setup Query Params
|
|
1799
|
+
var queryParams = {
|
|
1800
|
+
classid: options.classid
|
|
1801
|
+
};
|
|
1802
|
+
|
|
1803
|
+
if(options['custom-component-code']) {
|
|
1804
|
+
queryParams['custom-component-code'] = options['custom-component-code'];
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
// Setup Request with url and params
|
|
1808
|
+
var requestAPI = request.get(url).query(queryParams);
|
|
1809
|
+
// Setup token in Authorization Header
|
|
1810
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1811
|
+
|
|
1812
|
+
// setting up traceid
|
|
1813
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1814
|
+
|
|
1815
|
+
// Call GET CLASS CUSTOM COMPONENT RECORD ITEM
|
|
1816
|
+
requestAPI.end(function(error, response) {
|
|
1817
|
+
if(error) {
|
|
1818
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1819
|
+
err.message = error.response.res.text;
|
|
1820
|
+
dfd.reject(err);
|
|
1821
|
+
} else {
|
|
1822
|
+
dfd.resolve(response.body);
|
|
1823
|
+
}
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
} else {
|
|
1827
|
+
err.message = err.description = 'Required parameter classid not found in request options.';
|
|
1828
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
1829
|
+
dfd.reject(err);
|
|
1830
|
+
}
|
|
1831
|
+
return dfd.promise;
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1834
|
+
/* This function will get submissions of user on an item of custom component.
|
|
1835
|
+
* options = {
|
|
1836
|
+
* classid: 'string', // class uuid(mandatory)
|
|
1837
|
+
* custom-component-code: 'string', // class custom component code(mandatory)
|
|
1838
|
+
* userid: 'string', // user uuid(mandatory)
|
|
1839
|
+
* item-code: 'string' // item-code of an item(mandatory)
|
|
1840
|
+
*}
|
|
1841
|
+
*/
|
|
1842
|
+
function getClassCustomComponentUserSubmission(options) {
|
|
1843
|
+
var self = this;
|
|
1844
|
+
|
|
1845
|
+
//Initializing DFD
|
|
1846
|
+
var dfd = q.defer(), err = {};
|
|
1847
|
+
|
|
1848
|
+
// Validations
|
|
1849
|
+
if(options && options.classid && options['custom-component-code'] &&
|
|
1850
|
+
options.userid && options['item-code']) {
|
|
1851
|
+
err = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1852
|
+
if(err){ dfd.reject(err); }
|
|
1853
|
+
else {
|
|
1854
|
+
// Passed all validations, Constructing URL
|
|
1855
|
+
var url = self.config.DEFAULT_HOSTS['ANALYTICS'] + self.config.ANALYTICS_API_URLS.getClassCustomComponentUserSubmission;
|
|
1856
|
+
url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
|
|
1857
|
+
|
|
1858
|
+
// Setup Query Params
|
|
1859
|
+
var queryParams = {
|
|
1860
|
+
classid: options.classid,
|
|
1861
|
+
userid: options.userid,
|
|
1862
|
+
'custom-component-code': options['custom-component-code'],
|
|
1863
|
+
'item-code': options['item-code']
|
|
1864
|
+
};
|
|
1865
|
+
|
|
1866
|
+
// Setup Request with url and params
|
|
1867
|
+
var requestAPI = request.get(url).query(queryParams);
|
|
1868
|
+
// Setup token in Authorization Header
|
|
1869
|
+
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1870
|
+
|
|
1871
|
+
// setting up traceid
|
|
1872
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1873
|
+
|
|
1874
|
+
// Call GET CLASS CUSTOM COMPONENT SUBMISSION OF A USER ON AN ITEM
|
|
1875
|
+
requestAPI.end(function(error, response) {
|
|
1876
|
+
if(error) {
|
|
1877
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1878
|
+
err.message = error.response.res.text;
|
|
1879
|
+
dfd.reject(err);
|
|
1880
|
+
} else {
|
|
1881
|
+
dfd.resolve(response.body);
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
}
|
|
1885
|
+
} else {
|
|
1886
|
+
err.message = err.description = 'Required parameter classid or ' +
|
|
1887
|
+
'custom-component-code or ' + 'userid or ' + 'item-code not found in request options.';
|
|
1888
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
1889
|
+
dfd.reject(err);
|
|
1890
|
+
}
|
|
1891
|
+
return dfd.promise;
|
|
1892
|
+
}
|
|
@@ -117,7 +117,7 @@ function auth() {
|
|
|
117
117
|
getParticularColumnOfAGradebook: getParticularColumnOfAGradebook.bind(this),
|
|
118
118
|
getAllColumnsOfAGradebook: getAllColumnsOfAGradebook.bind(this),
|
|
119
119
|
getAllClassesOfAComponent: getAllClassesOfAComponent.bind(this),
|
|
120
|
-
|
|
120
|
+
removeAllGradebookColumnsOfCustomComponent: removeAllGradebookColumnsOfCustomComponent.bind(this),
|
|
121
121
|
|
|
122
122
|
// Custom Components related APIs
|
|
123
123
|
createCustomComponent: createCustomComponent.bind(this),
|
|
@@ -3342,6 +3342,7 @@ function getAllGradebooksMetaOfAClass (options) {
|
|
|
3342
3342
|
"bundle-codes": [],
|
|
3343
3343
|
"productcode": "string",
|
|
3344
3344
|
"custom_component_code": "string",
|
|
3345
|
+
"scoring_type": "string",
|
|
3345
3346
|
"items": [
|
|
3346
3347
|
{
|
|
3347
3348
|
"item-code": "string"
|
|
@@ -3714,7 +3715,7 @@ function getAllClassesOfAComponent (options) {
|
|
|
3714
3715
|
component_code: "string" //mandatory
|
|
3715
3716
|
}
|
|
3716
3717
|
*/
|
|
3717
|
-
function
|
|
3718
|
+
function removeAllGradebookColumnsOfCustomComponent (options) {
|
|
3718
3719
|
// Initializing promise
|
|
3719
3720
|
var deferred = q.defer();
|
|
3720
3721
|
var self = this;
|
|
@@ -3728,7 +3729,7 @@ function removeAllGradebookColumnsOfAComponent (options) {
|
|
|
3728
3729
|
if (options && options.component_code) {
|
|
3729
3730
|
// Passed all validations, Contruct API url
|
|
3730
3731
|
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
3731
|
-
self.config.AUTH_API_URLS.
|
|
3732
|
+
self.config.AUTH_API_URLS.removeAllGradebookColumnsOfCustomComponent;
|
|
3732
3733
|
|
|
3733
3734
|
url = helpers.api.constructAPIUrl(url, {
|
|
3734
3735
|
orgId: self.orgId,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comprodls-sdk",
|
|
3
3
|
"description": "comproDLS SDK for JavaScript",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.41.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Compro Technologies Private Limited",
|
|
7
7
|
"url": "http://www.comprotechnologies.com/"
|
|
@@ -12,16 +12,16 @@
|
|
|
12
12
|
"node": ">= 0.8.0"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
+
"agentkeepalive": "4.2.0",
|
|
15
16
|
"extend": "^2.0.0",
|
|
17
|
+
"pubnub": "7.0.1",
|
|
16
18
|
"q": "~1.4.1",
|
|
17
19
|
"socket.io-client": "1.4.5",
|
|
18
20
|
"string-template": "^1.0.0",
|
|
19
21
|
"superagent": "~1.7.2",
|
|
20
22
|
"tincanjs": "^0.50.0",
|
|
21
23
|
"underscore": "1.8.3",
|
|
22
|
-
"validate.js": "^0.9.0"
|
|
23
|
-
"pubnub": "7.0.1",
|
|
24
|
-
"agentkeepalive": "4.2.0"
|
|
24
|
+
"validate.js": "^0.9.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"grunt": "^0.4.5",
|