comprodls-sdk 2.90.3-development → 2.92.0-thor

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.
Files changed (42) hide show
  1. package/README.md +1 -137
  2. package/dist/comprodls-sdk.js +2834 -6201
  3. package/dist/comprodls-sdk.min.js +1 -1
  4. package/lib/comprodls.js +39 -57
  5. package/lib/config/index.js +173 -198
  6. package/lib/helpers/index.js +3 -2
  7. package/lib/helpers/lib/api/converter.js +1 -2
  8. package/lib/helpers/lib/api/index.js +19 -94
  9. package/lib/helpers/lib/errors.js +75 -80
  10. package/lib/helpers/lib/requestLayer.js +154 -0
  11. package/lib/helpers/lib/validator.js +65 -52
  12. package/lib/open_access/index.js +48 -53
  13. package/lib/services/analytics/index.js +286 -1014
  14. package/lib/services/attempts/index.js +38 -88
  15. package/lib/services/auth/index.js +324 -806
  16. package/lib/services/authextn/index.js +85 -247
  17. package/lib/services/datasyncmanager/index.js +10 -45
  18. package/lib/services/drive/index.js +20 -83
  19. package/lib/services/integrations/index.js +51 -126
  20. package/lib/services/invitations/index.js +20 -61
  21. package/lib/services/product/index.js +82 -85
  22. package/lib/services/pub/index.js +167 -235
  23. package/lib/services/pushX/index.js +195 -142
  24. package/lib/services/pushX/pubnubClientWrapper.js +399 -172
  25. package/lib/services/rules/index.js +14 -67
  26. package/lib/services/spaces/index.js +141 -318
  27. package/lib/services/spacesextn/index.js +44 -20
  28. package/lib/services/superuser/index.js +21 -36
  29. package/lib/services/taxonomy/index.js +27 -57
  30. package/lib/services/workflows/index.js +38 -97
  31. package/lib/services/xapi/index.js +7 -168
  32. package/lib/token/index.js +73 -67
  33. package/lib/token/validations.js +45 -48
  34. package/package.json +2 -3
  35. package/lib/helpers/lib/api/validations.js +0 -73
  36. package/lib/helpers/lib/utils.js +0 -24
  37. package/lib/services/activity/activity.js +0 -209
  38. package/lib/services/activity/attempt.js +0 -431
  39. package/lib/services/activity/index.js +0 -28
  40. package/lib/services/auth/classProduct.js +0 -37
  41. package/lib/services/collab/index.js +0 -468
  42. package/test.js +0 -38
@@ -32,9 +32,6 @@ var converter = require('../../helpers/lib/api/converter');
32
32
 
33
33
  var DLSError = helpers.errors.DLSError;
34
34
 
35
- /*********************************
36
- * Setting Up Module Entry Point
37
- **********************************/
38
35
  module.exports = auth;
39
36
 
40
37
  var keepaliveAgent = new Agent({
@@ -62,7 +59,6 @@ function auth() {
62
59
  unEnrollUsertoClass: unEnrollUsertoClass.bind(this),
63
60
 
64
61
  getOrgSettings: getOrgSettings.bind(this),
65
- updateOrgSettings: updateOrgSettings.bind(this),
66
62
  generateClassCode: generateClassCode.bind(this),
67
63
 
68
64
  getAllJobs: getAllJobs.bind(this),
@@ -79,15 +75,11 @@ function auth() {
79
75
  createClassProductAssociation: createClassProductAssociation.bind(this),
80
76
  removeClassProductAssociation: removeClassProductAssociation.bind(this),
81
77
  createMultiClassProductAssociations: createMultiClassProductAssociations.bind(this),
78
+ associateMaterialsWithClass: associateMaterialsWithClass.bind(this),
79
+ unassociateMaterialsWithClass: unassociateMaterialsWithClass.bind(this),
82
80
  addItemsToShowcaseOfAClass: addItemsToShowcaseOfAClass.bind(this),
83
81
  deleteItemsFromShowcaseOfAClass: deleteItemsFromShowcaseOfAClass.bind(this),
84
82
 
85
- getClassAppdata: getClassAppdata.bind(this),
86
- putClassAppdata: putClassAppdata.bind(this),
87
- deleteClassAppdata: deleteClassAppdata.bind(this),
88
-
89
- encodeURLParameter: encodeURLParameter.bind(this),
90
-
91
83
  createAssignedPath: createAssignedPath.bind(this),
92
84
  deleteAssignedPath: deleteAssignedPath.bind(this),
93
85
  updateAssignedPath: updateAssignedPath.bind(this),
@@ -133,17 +125,11 @@ function auth() {
133
125
  * Public Function definitions
134
126
  **********************************/
135
127
 
136
- //options = {
137
- // userid: 'uuid or username', //optional.
138
- //}
128
+ /**
129
+ * Wiki Link for SDK params
130
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getuserprofileparams
131
+ */
139
132
  function getUserProfile(options) {
140
- /* Reference to comproDLS SDK object , contains the following properties
141
- * 1. self.orgId [String] : organization Id
142
- * 2. self.token [Object] : DLS token. It has following structure
143
- * {
144
- * "access_token" : [String]
145
- * }
146
- */
147
133
  var self = this;
148
134
  // Initializing promise
149
135
  var dfd = q.defer();
@@ -185,11 +171,9 @@ function getUserProfile(options) {
185
171
  }
186
172
 
187
173
  /**
188
- * options = {
189
- * userid : "" // dls user id, mandatory
190
- * }
174
+ * Wiki Link for SDK params
175
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deleteuserprofileparams
191
176
  */
192
-
193
177
  function deleteUserProfile(options) {
194
178
  var self = this;
195
179
  var dfd = q.defer();
@@ -231,17 +215,10 @@ function deleteUserProfile(options) {
231
215
  return dfd.promise;
232
216
  }
233
217
 
234
- //options = {
235
- // search: 'search string', //optional.
236
- // lookup: 'string', // Search query (',' separated key value pairs), e.g. key1:val1,key2:val2,key3:val3
237
- // lookup-operator: 'AND'/'OR', // Operator to use while lookup. Current Possible Value - AND, OR
238
- // cursor: 'cursor', //optional, cursor to get next set of groups.
239
- // limit: number, //optional, limit the number of Users to fetch at a time.
240
- // role: 'string' //optional, to search Users by Role
241
- // sortField: ['first_name', 'last_name', 'ext_email', 'created', 'roles', ... (other fields of response entity)]
242
- // Sort the result according to given field. By default is 'last_name’, followed by ‘first_name’ in asc order.
243
- // sortOrder: ['desc', 'asc'] //optional, By default is 'desc’.
244
- //}
218
+ /**
219
+ * Wiki Link for SDK params
220
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallusersparams
221
+ */
245
222
  function getAllUsers(options) {
246
223
  var self = this;
247
224
  // Initializing promise
@@ -373,20 +350,10 @@ function getAllUsers(options) {
373
350
  }
374
351
 
375
352
  /**
376
- * This function is used to fetch all the users of a particular org.
377
- * Params:
378
- * {
379
- * role: 'string' // Optional
380
- * lookup: 'string', // Optional. Search query (',' separated key-value pairs)
381
- * lookup-operator: 'string', // Optional. Default - 'OR'. Permitted values - [OR]
382
- * sortField: 'string', // Default - 'last_name'.
383
- * sortOrder: 'string', // Default - 'desc'. Permitted values - [desc, asc]
384
- * limit: number, // Optional. Default - 10
385
- * cursor: '<cursor>' // Optional
386
- * }
387
- * @param {*} options
353
+ * Wiki Link for SDK params
354
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallusersv2params
388
355
  */
389
- function getAllUsersV2(options) {
356
+ function getAllUsersV2(options) {
390
357
  var self = this;
391
358
 
392
359
  // Initializing promise
@@ -584,11 +551,10 @@ function getAllUsersV2(options) {
584
551
  return deferred.promise;
585
552
  }
586
553
 
587
- //options = {
588
- // userid: 'dlsUserId', //mandatory
589
- // target_role: 'string', //mandatory
590
- // ext_data: { email_template_id: string } //optional
591
- //}
554
+ /**
555
+ * Wiki Link for SDK params
556
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updateuserroleparams
557
+ */
592
558
  function updateUserRole(options) {
593
559
  var self = this;
594
560
 
@@ -631,18 +597,10 @@ function updateUserRole(options) {
631
597
  return dfd.promise;
632
598
  }
633
599
 
634
- //options = {
635
- // userid: 'uuid or username', //optional.
636
- // search: 'search string', //optional.
637
- // details: true/false, //optional, includes products & assignments information of class.
638
- // sortField: ['startdate', 'enddate', 'title'] //optional, By default is 'title’.
639
- // sortOrder: ['desc', 'asc'] //optional, By default is 'desc’.
640
- // enrollmentType: ['creator', 'teacher', 'student'] //optional, bydefault send all classes.
641
- // teacherId: 'string' //optional, get classes of a particular teacher only.
642
- // cursor: 'cursor' //optional, cursor to get next set of classes
643
- // limit: integer //optional, Number of entities to fetch at once
644
- // bundleDetails: true/false //optional
645
- //}
600
+ /**
601
+ * Wiki Link for SDK params
602
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getuserclassesparams
603
+ */
646
604
  function getUserClasses(options) {
647
605
  var self = this;
648
606
  // Initializing promise
@@ -696,18 +654,8 @@ function getUserClasses(options) {
696
654
  }
697
655
 
698
656
  /**
699
- * @param {
700
- * userid: 'uuid or username', // Mandatory
701
- * shadow: true/false, // Optional, filter shadow enrollments
702
- * hidden: true/false, // Optional, filter hidden enrollments
703
- * status_active: true/false, // Optional, filter for status_active enrollments
704
- * status_ended: true/false, // Optional, filter for status_ended enrollments
705
- * status_expired: true/false, // Optional, filter for status_expired enrollments
706
- * details: true/false, // Optional, includes products & meta information of classes
707
- * bundleDetails: true/false // Optional, includes products, bundles & meta information of classes
708
- * limit: integer, // Optional, Number of entities to be fetched
709
- * cursor: 'cursor' // Optional, cursor to get next set of enrollments
710
- * } options
657
+ * Wiki Link for SDK params
658
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getuserclassesv2params
711
659
  */
712
660
  function getUserClassesV2(options) {
713
661
  var self = this, orgId = self.orgId, token = self.token;
@@ -770,14 +718,8 @@ function getUserClassesV2(options) {
770
718
  }
771
719
 
772
720
  /**
773
- * options = {
774
- * classid: 'classid',
775
- * search: 'string', // (optional) Search Query
776
- * cursor: 'string', // (optional) Cursor string to fetch next set of Users
777
- * limit: 'integer' // (optional) Number of users to fetch at a time.
778
- * sortField: 'string' // (optional) Sort the result according to given field. By default is 'email’.
779
- * sortOrder: 'string' // (optional) Sort the result according to given order. By default is 'desc’.
780
- * }
721
+ * Wiki Link for SDK params
722
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getclassusersparams
781
723
  */
782
724
  function getClassUsers(options) {
783
725
  var self = this;
@@ -785,23 +727,18 @@ function getClassUsers(options) {
785
727
  var dfd = q.defer();
786
728
  // Validations
787
729
  var err = helpers.validations.isAuthenticated(self.orgId, self.token);
788
- if(err) { dfd.reject(err); }
730
+ if (err) { dfd.reject(err); }
789
731
  else {
790
- if(options && options.classid) {
732
+ if (options && options.classid) {
791
733
  // Passed all validations, Construct API url
792
- var url = self.config.DEFAULT_HOSTS.AUTH +
793
- self.config.AUTH_API_URLS.getClassUsersAPI;
734
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getClassUsersAPI;
794
735
  url = helpers.api.constructAPIUrl(url, {
795
736
  orgId: self.orgId, classId: options.classid
796
737
  });
797
738
 
798
739
  // Setup params
799
740
  var params = {};
800
- if(options.search) { params.search = options.search; }
801
- if(options.cursor) { params.cursor = options.cursor; }
802
- if(options.limit) { params.limit = options.limit; }
803
- if(options.sortField) { params.sortField = options.sortField; }
804
- if(options.sortOrder) { params.sortOrder = options.sortOrder; }
741
+ if (options.cursor) { params.cursor = options.cursor; }
805
742
 
806
743
  // Setup request with URL and Params
807
744
  var requestAPI = request.get(url).query(params);
@@ -814,12 +751,12 @@ function getClassUsers(options) {
814
751
  requestAPI
815
752
  .agent(keepaliveAgent)
816
753
  .end(function(err, response) {
817
- if(err) {
754
+ if (err) {
818
755
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
819
756
  dfd.reject(err);
820
757
  }
821
758
  else {
822
- response.body.entities = converter.convertEnrollmetsResponse({data: response.body.entities}) ;
759
+ response.body.entities = converter.convertEnrollmetsResponse({data: response.body.entities});
823
760
  dfd.resolve(response.body);
824
761
  }
825
762
  });
@@ -833,11 +770,10 @@ function getClassUsers(options) {
833
770
  return dfd.promise;
834
771
  }
835
772
 
836
- //options = {
837
- // extension: 'csv',
838
- // import_type: 'users'/'groups'/'user-group-enrollment',
839
- // upFile: '' // path to csv file to be uploaded
840
- //}
773
+ /**
774
+ * Wiki Link for SDK params
775
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#pisimportparams
776
+ */
841
777
  function pisImport(options) {
842
778
  var self = this;
843
779
  // Initializing promise
@@ -880,9 +816,10 @@ function pisImport(options) {
880
816
  return dfd.promise;
881
817
  }
882
818
 
883
- //options = {
884
- // field: '' // apps / lti / sis / pis / product[ANY ONE]
885
- //}
819
+ /**
820
+ * Wiki Link for SDK params
821
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getorgsettingsparams
822
+ */
886
823
  function getOrgSettings(options) {
887
824
  var self = this;
888
825
  // Initializing promise
@@ -925,49 +862,10 @@ function getOrgSettings(options) {
925
862
  return dfd.promise;
926
863
  }
927
864
 
928
- //options = {
929
- // body: {} // the top level settings field to be updated.
930
- //}
931
- function updateOrgSettings(options) {
932
- var self = this;
933
- // Initializing promise
934
- var dfd = q.defer();
935
- // Validations
936
- var err = helpers.validations.isAuthenticated(self.orgId, self.token);
937
- if(err) { dfd.reject(err); }
938
- else {
939
- // Passed all validations, Construct API url
940
- var url = self.config.DEFAULT_HOSTS.AUTH +
941
- self.config.AUTH_API_URLS.getSettings;
942
- url = helpers.api.constructAPIUrl(url, {orgId: self.orgId});
943
- // Setup request with URL and Params
944
- var requestAPI = request.put(url);
945
- if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
946
-
947
- if(options.body) {
948
- if(options.body.sis && (! options.body.sis.productid)) {
949
- options.body.sis.productid = [];
950
- }
951
- requestAPI.send(options.body);
952
- }
953
- // Setup token in Authorization header
954
- requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
955
-
956
- // Call SIS IMPORT Api
957
- requestAPI.end(function(err, response) {
958
- if(err) {
959
- err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
960
- dfd.reject(err);
961
- }
962
- else { dfd.resolve(response.body); }
963
- });
964
- }
965
- return dfd.promise;
966
- }
967
-
968
- //options = {
969
- // classid: "string"
970
- //}
865
+ /**
866
+ * Wiki Link for SDK params
867
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#generateclasscodeparams
868
+ */
971
869
  function generateClassCode(options) {
972
870
  var self = this, err;
973
871
  // Initializing promise
@@ -1009,12 +907,8 @@ function generateClassCode(options) {
1009
907
  }
1010
908
 
1011
909
  /**
1012
- * {
1013
- accountId: 'string' //mandatory
1014
- extUserId: 'string', //mandatory
1015
- jobType: 'string' //optional queryParam, Use this param to get All Jobs of a particular jobType.
1016
- details: boolean //optional queryParam, Use this param to add extension data in response of each job.
1017
- }
910
+ * Wiki Link for SDK params
911
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getalljobsparams
1018
912
  */
1019
913
  function getAllJobs(options) {
1020
914
  var self = this;
@@ -1052,12 +946,8 @@ function getAllJobs(options) {
1052
946
  }
1053
947
 
1054
948
  /**
1055
- * options = {
1056
- accountId: 'string', //mandatory
1057
- extUserId: 'string', //mandatory
1058
- jobId: 'string', //mandatory
1059
- jobType: 'string' //mandatory
1060
- }
949
+ * Wiki Link for SDK params
950
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getjobparams
1061
951
  */
1062
952
  function getJob(options) {
1063
953
  var self = this;
@@ -1092,20 +982,9 @@ function getJob(options) {
1092
982
  return dfd.promise;
1093
983
  }
1094
984
 
1095
-
1096
985
  /**
1097
- * @param {*} options {
1098
- * search: 'search string', // Optional
1099
- * sortField: ['startdate', 'enddate', 'title', 'created', 'tagname_1'] // Optional
1100
- * // Default: 'created’.
1101
- * sortOrder: ['desc', 'asc'] // Optional, Default: 'desc’.
1102
- * cursor: 'cursor' // Optional, cursor to get next set of groups.
1103
- * limit: integer, // Optional, limit number of Classes in response.
1104
- * lookup: 'string', // Optional, Exact query search (',' separated key value pairs).
1105
- * // E.g. key1:val1,key2:val2
1106
- * lookup-operator: ['OR', 'AND'] // Optional
1107
- * }
1108
- * @returns {entities: [{}, {}, ...], count: <integer>, cursor: <string>}
986
+ * Wiki Link for SDK params
987
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallclassesparams
1109
988
  */
1110
989
  function getAllClasses(options) {
1111
990
  var self = this;
@@ -1260,10 +1139,10 @@ function getAllClasses(options) {
1260
1139
  return dfd.promise;
1261
1140
  }
1262
1141
 
1263
-
1264
- //options = {
1265
- // classId: 'class uuid'
1266
- //}
1142
+ /**
1143
+ * Wiki Link for SDK params
1144
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getparticularclassparams
1145
+ */
1267
1146
  function getParticularClass(options) {
1268
1147
  var self = this;
1269
1148
 
@@ -1306,9 +1185,10 @@ function getParticularClass(options) {
1306
1185
  return dfd.promise;
1307
1186
  }
1308
1187
 
1309
- //options = {
1310
- // ext_classid: 'ext classid' //mandatory
1311
- //}
1188
+ /**
1189
+ * Wiki Link for SDK params
1190
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getparticularshadowclassparams
1191
+ */
1312
1192
  function getParticularShadowClass(options) {
1313
1193
  var self = this;
1314
1194
 
@@ -1351,10 +1231,10 @@ function getParticularShadowClass(options) {
1351
1231
  return dfd.promise;
1352
1232
  }
1353
1233
 
1354
- //options = {
1355
- // classId: 'class uuid',
1356
- // productcode: 'productcode'
1357
- //}
1234
+ /**
1235
+ * Wiki Link for SDK params
1236
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createclassproductassociationparams
1237
+ */
1358
1238
  function createClassProductAssociation(options) {
1359
1239
  var self = this;
1360
1240
  // Initializing promise
@@ -1397,11 +1277,11 @@ function createClassProductAssociation(options) {
1397
1277
  return dfd.promise;
1398
1278
  }
1399
1279
 
1400
- //options = {
1401
- // classId: 'class uuid',
1402
- // productcode: 'product code'
1403
- //}
1404
- function removeClassProductAssociation(options) {
1280
+ /**
1281
+ * Wiki Link for SDK params
1282
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#associatematerialswithclassparams
1283
+ */
1284
+ function associateMaterialsWithClass(options) {
1405
1285
  var self = this;
1406
1286
  // Initializing promise
1407
1287
  var dfd = q.defer();
@@ -1409,25 +1289,24 @@ function removeClassProductAssociation(options) {
1409
1289
  var err = helpers.validations.isAuthenticated(self.orgId, self.token);
1410
1290
  if(err) { dfd.reject(err); }
1411
1291
  else {
1412
- if(options && options.classId && options.productcode) {
1292
+ if(options && options.classId && options.body && (options.body.productcodes
1293
+ || options.body.bundlecodes)) {
1413
1294
  // Passed all validations, Contruct API url
1414
1295
  var url = self.config.DEFAULT_HOSTS.AUTH +
1415
- self.config.AUTH_API_URLS.classProductAssociation;
1296
+ self.config.AUTH_API_URLS.classMaterialAssociation;
1416
1297
  url = helpers.api.constructAPIUrl(url, {
1417
- orgId: self.orgId, classId: options.classId, productcode: options.productcode
1298
+ orgId: self.orgId, classId: options.classId
1418
1299
  });
1419
-
1420
- // Contruct parameters
1421
- var params = {};
1422
-
1423
1300
  // Setup request with URL and Params
1424
- var requestAPI = request.delete(url).query(params);
1301
+ var requestAPI = request.post(url)
1302
+ .set('Content-Type', 'application/json')
1303
+ .set('Accept', 'application/json');
1425
1304
  if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1426
1305
 
1427
1306
  // Setup token in Authorization header
1428
1307
  requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1429
1308
 
1430
- requestAPI.end(function(err, response) {
1309
+ requestAPI.agent(keepaliveAgent).end(function(err, response) {
1431
1310
  if(err) {
1432
1311
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
1433
1312
  dfd.reject(err);
@@ -1436,7 +1315,8 @@ function removeClassProductAssociation(options) {
1436
1315
  });
1437
1316
  } else {
1438
1317
  err = {};
1439
- err.message = err.description = 'classId or productcode not found in request options.';
1318
+ err.message = err.description = 'classId or productcodes or bundlecodes not found in'
1319
+ + 'request options.';
1440
1320
  err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
1441
1321
  dfd.reject(err);
1442
1322
  }
@@ -1445,111 +1325,10 @@ function removeClassProductAssociation(options) {
1445
1325
  }
1446
1326
 
1447
1327
  /**
1448
- * This function creates multiple class-product associations.
1449
- * @param options {
1450
- * *classId : <string>,
1451
- * *productcodes : [<string>] // Min: 1, Max: 50
1452
- * }
1453
- * Note: Fields marked with '*' are mandatory.
1328
+ * Wiki Link for SDK params
1329
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#unassociatematerialswithclassparams
1454
1330
  */
1455
- function createMultiClassProductAssociations(options) {
1456
- var deferred = q.defer();
1457
- var self = this;
1458
- var error = helpers.validations.isAuthenticated(self.orgId, self.token);
1459
-
1460
- if (error) {
1461
- deferred.reject(error);
1462
- } else if (options && options.classId && options.productcodes) {
1463
- // Passed all validations, Contruct API url
1464
- var defaultHostPath = self.config.DEFAULT_HOSTS.AUTH;
1465
- var bulkCPAssociationAPIPath = self.config.AUTH_API_URLS.multiClassProductAssociations;
1466
-
1467
- var url = defaultHostPath + bulkCPAssociationAPIPath;
1468
- var bodyParams = { productcodes: options.productcodes };
1469
-
1470
- url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, classId: options.classId });
1471
-
1472
- // Setup request with URL and Params
1473
- var requestAPI = request.post(url)
1474
- .set('Content-Type', 'application/json')
1475
- .set('Accept', 'application/json')
1476
- .send(bodyParams);
1477
-
1478
- if (self.traceid) {
1479
- requestAPI.set('X-Amzn-Trace-Id', self.traceid);
1480
- }
1481
-
1482
- // Setup token in Authorization header
1483
- requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1484
-
1485
- requestAPI.end(function(err, response) {
1486
- if (err) {
1487
- error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
1488
- deferred.reject(error);
1489
- } else {
1490
- deferred.resolve(response.body);
1491
- }
1492
- });
1493
- } else {
1494
- error = {};
1495
- error.message = error.description = 'Missing mandaotry fields \'classId\' or \'productcodes\' in request.';
1496
- error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
1497
- deferred.reject(error);
1498
- }
1499
-
1500
- return deferred.promise;
1501
- }
1502
-
1503
- /*options = {
1504
- classid: 'string'
1505
- }*/
1506
- function getClassAppdata(options) {
1507
- var self = this;
1508
- // Initializing promise
1509
- var dfd = q.defer();
1510
- // Validations
1511
- var err = helpers.validations.isAuthenticated(self.orgId, self.token);
1512
- if(err) { dfd.reject(err); }
1513
- else {
1514
- if(options && options.classid) {
1515
- // Passed all validations, Contruct API url
1516
- var url = self.config.DEFAULT_HOSTS.AUTH +
1517
- self.config.AUTH_API_URLS.ClassAppdata;
1518
- url = helpers.api.constructAPIUrl(url, {
1519
- orgId: self.orgId, classid: options.classid
1520
- });
1521
- //Setup request with URL
1522
- var requestAPI = request.get(url);
1523
- if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1524
-
1525
- //Setup token in Authorization header
1526
- requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1527
-
1528
- //Call Class Appdata Api
1529
- requestAPI.end(function(err, response) {
1530
- if(err) {
1531
- err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
1532
- dfd.reject(err);
1533
- } else {
1534
- dfd.resolve(response.body);
1535
- }
1536
- });
1537
- } else {
1538
- err = {};
1539
- err.message = err.description = 'classid not found in request options.';
1540
- err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
1541
- dfd.reject(err);
1542
- }
1543
- }
1544
- return dfd.promise;
1545
- }
1546
-
1547
- /*options = {
1548
- classid: 'string',
1549
- appdata: {}
1550
- }*/
1551
-
1552
- function putClassAppdata(options) {
1331
+ function unassociateMaterialsWithClass(options) {
1553
1332
  var self = this;
1554
1333
  // Initializing promise
1555
1334
  var dfd = q.defer();
@@ -1557,25 +1336,24 @@ function putClassAppdata(options) {
1557
1336
  var err = helpers.validations.isAuthenticated(self.orgId, self.token);
1558
1337
  if(err) { dfd.reject(err); }
1559
1338
  else {
1560
- if(options && options.classid && options.appdata) {
1339
+ if(options && options.classId && options.body &&
1340
+ (options.body.productcodes || options.body.bundlecodes)) {
1561
1341
  // Passed all validations, Contruct API url
1562
- var url = self.config.DEFAULT_HOSTS.AUTH +
1563
- self.config.AUTH_API_URLS.ClassAppdata;
1342
+ var url= self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.classMaterialAssociation;
1564
1343
  url = helpers.api.constructAPIUrl(url, {
1565
- orgId: self.orgId, classid: options.classid
1344
+ orgId: self.orgId, classId: options.classId
1566
1345
  });
1567
-
1568
1346
  // Setup request with URL and Params
1569
- var requestAPI = request.put(url)
1347
+ var requestAPI = request.delete(url)
1570
1348
  .set('Content-Type', 'application/json')
1571
- .set('Accept', 'application/json')
1572
- .send(options.appdata);
1349
+ .set('Accept', 'application/json');
1350
+
1573
1351
  if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1574
1352
 
1575
1353
  // Setup token in Authorization header
1576
1354
  requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1577
1355
 
1578
- requestAPI.end(function(err, response) {
1356
+ requestAPI.agent(keepaliveAgent).end(function(err, response) {
1579
1357
  if(err) {
1580
1358
  err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
1581
1359
  dfd.reject(err);
@@ -1584,7 +1362,9 @@ function putClassAppdata(options) {
1584
1362
  });
1585
1363
  } else {
1586
1364
  err = {};
1587
- err.message = err.description = 'classid or appdata not found in request options.';
1365
+ const msg = 'classId or productcodes or bundlecodes not found in request options.';
1366
+ err.message = msg;
1367
+ err.description = msg;
1588
1368
  err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
1589
1369
  dfd.reject(err);
1590
1370
  }
@@ -1592,11 +1372,11 @@ function putClassAppdata(options) {
1592
1372
  return dfd.promise;
1593
1373
  }
1594
1374
 
1595
- /*options = {
1596
- classid: 'string'
1597
- }*/
1598
-
1599
- function deleteClassAppdata(options) {
1375
+ /**
1376
+ * Wiki Link for SDK params
1377
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#removeclassproductassociationparams
1378
+ */
1379
+ function removeClassProductAssociation(options) {
1600
1380
  var self = this;
1601
1381
  // Initializing promise
1602
1382
  var dfd = q.defer();
@@ -1604,16 +1384,19 @@ function deleteClassAppdata(options) {
1604
1384
  var err = helpers.validations.isAuthenticated(self.orgId, self.token);
1605
1385
  if(err) { dfd.reject(err); }
1606
1386
  else {
1607
- if(options && options.classid) {
1387
+ if(options && options.classId && options.productcode) {
1608
1388
  // Passed all validations, Contruct API url
1609
1389
  var url = self.config.DEFAULT_HOSTS.AUTH +
1610
- self.config.AUTH_API_URLS.ClassAppdata;
1390
+ self.config.AUTH_API_URLS.classProductAssociation;
1611
1391
  url = helpers.api.constructAPIUrl(url, {
1612
- orgId: self.orgId, classid: options.classid
1392
+ orgId: self.orgId, classId: options.classId, productcode: options.productcode
1613
1393
  });
1614
1394
 
1395
+ // Contruct parameters
1396
+ var params = {};
1397
+
1615
1398
  // Setup request with URL and Params
1616
- var requestAPI = request.delete(url);
1399
+ var requestAPI = request.delete(url).query(params);
1617
1400
  if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1618
1401
 
1619
1402
  // Setup token in Authorization header
@@ -1628,7 +1411,7 @@ function deleteClassAppdata(options) {
1628
1411
  });
1629
1412
  } else {
1630
1413
  err = {};
1631
- err.message = err.description = 'classid not found in request options.';
1414
+ err.message = err.description = 'classId or productcode not found in request options.';
1632
1415
  err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
1633
1416
  dfd.reject(err);
1634
1417
  }
@@ -1636,10 +1419,62 @@ function deleteClassAppdata(options) {
1636
1419
  return dfd.promise;
1637
1420
  }
1638
1421
 
1639
- //options = {
1640
- // classid: '', //Class Id
1641
- // userid: '', //User Id
1642
- //};
1422
+ /**
1423
+ * Wiki Link for SDK params
1424
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createmulticlassproductassociationsparams
1425
+ */
1426
+ function createMultiClassProductAssociations(options) {
1427
+ var deferred = q.defer();
1428
+ var self = this;
1429
+ var error = helpers.validations.isAuthenticated(self.orgId, self.token);
1430
+
1431
+ if (error) {
1432
+ deferred.reject(error);
1433
+ } else if (options && options.classId && options.productcodes) {
1434
+ // Passed all validations, Contruct API url
1435
+ var defaultHostPath = self.config.DEFAULT_HOSTS.AUTH;
1436
+ var bulkCPAssociationAPIPath = self.config.AUTH_API_URLS.multiClassProductAssociations;
1437
+
1438
+ var url = defaultHostPath + bulkCPAssociationAPIPath;
1439
+ var bodyParams = { productcodes: options.productcodes };
1440
+
1441
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId, classId: options.classId });
1442
+
1443
+ // Setup request with URL and Params
1444
+ var requestAPI = request.post(url)
1445
+ .set('Content-Type', 'application/json')
1446
+ .set('Accept', 'application/json')
1447
+ .send(bodyParams);
1448
+
1449
+ if (self.traceid) {
1450
+ requestAPI.set('X-Amzn-Trace-Id', self.traceid);
1451
+ }
1452
+
1453
+ // Setup token in Authorization header
1454
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1455
+
1456
+ requestAPI.end(function(err, response) {
1457
+ if (err) {
1458
+ error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, err);
1459
+ deferred.reject(error);
1460
+ } else {
1461
+ deferred.resolve(response.body);
1462
+ }
1463
+ });
1464
+ } else {
1465
+ error = {};
1466
+ error.message = error.description = 'Missing mandaotry fields \'classId\' or \'productcodes\' in request.';
1467
+ error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
1468
+ deferred.reject(error);
1469
+ }
1470
+
1471
+ return deferred.promise;
1472
+ }
1473
+
1474
+ /**
1475
+ * Wiki Link for SDK params
1476
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#enrollusertoclassparams
1477
+ */
1643
1478
  function enrollUsertoClass(options) {
1644
1479
  var self = this;
1645
1480
  var err = {};
@@ -1693,10 +1528,10 @@ function enrollUsertoClass(options) {
1693
1528
  return dfd.promise;
1694
1529
  }
1695
1530
 
1696
- //options = {
1697
- // classid: '', //Class Id
1698
- // classrole: ''
1699
- //};
1531
+ /**
1532
+ * Wiki Link for SDK params
1533
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#enrollselftoclassparams
1534
+ */
1700
1535
  function enrollSelftoClass(options) {
1701
1536
  var self = this;
1702
1537
  var err = {};
@@ -1749,10 +1584,10 @@ function enrollSelftoClass(options) {
1749
1584
  return dfd.promise;
1750
1585
  }
1751
1586
 
1752
- //options = {
1753
- // classid: '', //Class Id
1754
- // users: ['dls-userid1', 'dls-userid-2'] //Users Id
1755
- //};
1587
+ /**
1588
+ * Wiki Link for SDK params
1589
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#enrollmultiuserstoclassparams
1590
+ */
1756
1591
  function enrollMultiUserstoClass(options) {
1757
1592
  var self = this;
1758
1593
  var err = {};
@@ -1807,10 +1642,10 @@ function enrollMultiUserstoClass(options) {
1807
1642
  return dfd.promise;
1808
1643
  }
1809
1644
 
1810
- //options = {
1811
- // classid: '', //Class Id
1812
- // users: ['dls-userid1', 'dls-userid-2'] //Users Id
1813
- //};
1645
+ /**
1646
+ * Wiki Link for SDK params
1647
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#unenrollmultiuserstoclassparams
1648
+ */
1814
1649
  function unEnrollMultiUserstoClass(options) {
1815
1650
  var self = this;
1816
1651
  var err = {};
@@ -1863,10 +1698,10 @@ function unEnrollMultiUserstoClass(options) {
1863
1698
  return dfd.promise;
1864
1699
  }
1865
1700
 
1866
- //options = {
1867
- // classid: '', //Class Id
1868
- // userid: '', //User Id
1869
- //};
1701
+ /**
1702
+ * Wiki Link for SDK params
1703
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#unenrollusertoclassparams
1704
+ */
1870
1705
  function unEnrollUsertoClass(options) {
1871
1706
  var self = this;
1872
1707
  var err = {};
@@ -1915,27 +1750,9 @@ function unEnrollUsertoClass(options) {
1915
1750
  return dfd.promise;
1916
1751
  }
1917
1752
 
1918
- //options = ['parameter1', 'parameter2']
1919
- function encodeURLParameter(options) {
1920
- var response = {};
1921
- for(var param in options) {
1922
- response[options[param]] = encodeURIComponent(options[param]);
1923
- }
1924
- return response;
1925
- }
1926
-
1927
1753
  /**
1928
- * options = {
1929
- * title: 'class title',
1930
- * startdate: 'Epoch(Unix) timestamp in milliseconds',
1931
- * enddate: 'Epoch(Unix) timestamp in milliseconds',
1932
- * description: '', // Optional field
1933
- * class_ownership: 'STRICT' / 'NO_OWNER', // Default - STRICT, Optional field
1934
- * ext_data: {} // Optional
1935
- * analyticsharingmodel: '' // Optional - Valid values: ['NOINHERIT_SYNCBACK']
1936
- * analytics_score_aggregation_type: '' // Optional - Valid values: ['best'/'first'/'last']
1937
- * limits: {"los": number, "students": number} // Optional field
1938
- * }
1754
+ * Wiki Link for SDK params
1755
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createclassparams
1939
1756
  */
1940
1757
  function createClass(options) {
1941
1758
  var self = this;
@@ -1994,16 +1811,10 @@ function createClass(options) {
1994
1811
  return dfd.promise;
1995
1812
  }
1996
1813
 
1997
- //options = {
1998
- // classid: 'class id',
1999
- // title: 'class title', //Optional field
2000
- // startdate: 'Epoch(Unix) timestamp in milliseconds', //Optional field
2001
- // enddate: 'Epoch(Unix) timestamp in milliseconds', //Optional field
2002
- // description: '', //Optional field
2003
- // ext_data: '' //Optional field
2004
- // analytics_score_aggregation_type: '' // Optional - Valid values: ['best'/'first'/'last']
2005
- // limits: {"los": number, "students": number} // Optional field
2006
- //}
1814
+ /**
1815
+ * Wiki Link for SDK params
1816
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updateclassparams
1817
+ */
2007
1818
  function updateClass(options) {
2008
1819
  var self = this;
2009
1820
 
@@ -2048,108 +1859,9 @@ function updateClass(options) {
2048
1859
  return dfd.promise;
2049
1860
  }
2050
1861
 
2051
- /** options =
2052
- *{
2053
- "space_title": "string",
2054
- "skip_email_to_actor": true/false, // optional, default false
2055
- "ext_data": {}, // optional,
2056
- "classes": [
2057
- {
2058
- "title": "class tiltle",
2059
- "startdate": 'Epoch(Unix) timestamp in milliseconds',
2060
- "enddate": 'Epoch(Unix) timestamp in milliseconds',
2061
- "rowId": 'string with max limit 3 characters,
2062
- "description": "string",
2063
- "ext_data": {}, // optional
2064
- "model": "STRICT",
2065
- "analyticsharingmodel":"NOINHERIT_SYNCBACK" // optional
2066
- "analytics_score_aggregation_type":"first/best/last" // optional
2067
- limits: {los: number, students: number} // Optional field
2068
- "owner": {
2069
- "userid": "string" //Mandatory if model is 'STRICT'
2070
- },
2071
- "teachers": [
2072
- {
2073
- "userid": "string",
2074
- "email": "string"
2075
- "first_name": "string"
2076
- "last_name": "string"
2077
- "userid": "string" // optional
2078
- "ext_user_id": "string" // optional
2079
- "dls_org_status": "string" // optional
2080
- "ext_account_status": "string" // optional
2081
- ],
2082
- "products": [ // optional
2083
- {
2084
- "productcode": "string", //mandatory
2085
- "title": ""
2086
- },
2087
- {
2088
- "productcode": "string", //mandatory
2089
- "title": ""
2090
- }
2091
- ]
2092
- }
2093
- ],
2094
- "clone_classes": [
2095
- {
2096
- "title": "string",
2097
- "startdate": 0,
2098
- "enddate": 0,
2099
- "instructor": "string",
2100
- "rowId": "string",
2101
- "classid": "string",
2102
- "clone_settings": {
2103
- "students": true,
2104
- "teachers": true,
2105
- "products": true,
2106
- "groups": true,
2107
- "assigned_paths": true,
2108
- "tags": true,
2109
- "analyticsharingmodel": true,
2110
- "analytics_score_aggregation_type": true,
2111
- "ext_data": true,
2112
- "limits": true,
2113
- "advanced": {
2114
- "students": [
2115
- {
2116
- "ext_user_id": "string",
2117
- "invite-students": <boolean>,
2118
- "first_name": "string",
2119
- "last_name": "string",
2120
- "email": "string",
2121
- "dls_org_status": "string",
2122
- "ext_account_status": "string"
2123
- }
2124
- ],
2125
- "teachers": [
2126
- {
2127
- "ext_user_id": "string",
2128
- "invite-teachers": <boolean>,
2129
- "first_name": "string",
2130
- "last_name": "string",
2131
- "email": "string",
2132
- "dls_org_status": "string",
2133
- "ext_account_status": "string"
2134
- }
2135
- ]
2136
- "groups": [ { "groupid": "string" } ],
2137
- "assigned_paths": [
2138
- {
2139
- "assigned_path_id": "string",
2140
- "startdate": 0,
2141
- "duedate": 0
2142
- }
2143
- ],
2144
- "products": [ { "productcode": "string" } ],
2145
- "analyticsharingmodel": "string" // Valid values: ['NOINHERIT_SYNCBACK']
2146
- "analytics_score_aggregation_type": "string", // Valid values: ['best', 'first', 'last']
2147
- "limits": {los: number, students: number} // Optional field
2148
- }
2149
- }
2150
- }
2151
- ]
2152
- }
1862
+ /**
1863
+ * Wiki Link for SDK params
1864
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createmultipleclassesparams
2153
1865
  */
2154
1866
  function createMultipleClasses(options) {
2155
1867
  var self = this;
@@ -2199,9 +1911,8 @@ function createMultipleClasses(options) {
2199
1911
  }
2200
1912
 
2201
1913
  /**
2202
- * @param {*classid: <string>,
2203
- * *body:{ audit: <boolean> }
2204
- * } options
1914
+ * Wiki Link for SDK params
1915
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deleteclassparams
2205
1916
  */
2206
1917
  function deleteClass(options) {
2207
1918
  var self = this;
@@ -2241,32 +1952,10 @@ function deleteClass(options) {
2241
1952
  return dfd.promise;
2242
1953
  }
2243
1954
 
2244
- /*
2245
- options = {
2246
- "classid": "classid", //mandatory
2247
- "data": {
2248
- "title": "assigned path title", //mandatory
2249
- "scope": "string", //optional, default=global , ['global', 'users']
2250
- "ext_assignedpathid": 'string', //optional
2251
- "duedate": "epoch due date", //mandatory
2252
- "startdate": "epoch start date", //optional
2253
- "shared_progress": true, //optional, default=true
2254
- "path_type": ‘flat’, //optional, default=flat , ['flat', 'hierarchical']
2255
- "rules": {}, //optional
2256
- "items": [ //mandatory
2257
- {
2258
- "item-code": "required_item-code", //mandatory
2259
- "item_type": "required_item-type", //mandatory, ['dls-internal','external']
2260
- "dls_product_code": "product_code" //mandatory only if item_type is 'dls-internal'
2261
- }
2262
- ],
2263
- "context": {
2264
- "bundle-code": "string",
2265
- "space_key": "string"
2266
- }
2267
- }
2268
- }
2269
- */
1955
+ /**
1956
+ * Wiki Link for SDK params
1957
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createassignedpathparams
1958
+ */
2270
1959
  function createAssignedPath(options) {
2271
1960
  var self = this;
2272
1961
  var dfd = q.defer();
@@ -2309,12 +1998,10 @@ function createAssignedPath(options) {
2309
1998
  return dfd.promise;
2310
1999
  }
2311
2000
 
2312
- /*
2313
- options = {
2314
- classid: 'string' //mandatory
2315
- assignedpathid: 'string' //mandatory
2316
- }
2317
- */
2001
+ /**
2002
+ * Wiki Link for SDK params
2003
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deleteassignedpathparams
2004
+ */
2318
2005
  function deleteAssignedPath(options) {
2319
2006
  var self = this;
2320
2007
  var dfd = q.defer();
@@ -2353,25 +2040,10 @@ function deleteAssignedPath(options) {
2353
2040
  return dfd.promise;
2354
2041
  }
2355
2042
 
2356
- /*
2357
- options = {
2358
- classid: 'string' //mandatory
2359
- assignedpathid: 'string' //mandatory
2360
- data: {
2361
- title: 'string' //optional
2362
- scope: 'string' //optional, ['global', 'users']
2363
- startdate: 'string' //optional
2364
- duedate: 'string' //optional
2365
- items: [ //optional
2366
- {
2367
- item-code: 'string', //mandatory
2368
- item_type: 'string', //mandatory, ['dls-internal','external']
2369
- dls_product_code: 'string' //mandatory only if item_type is 'dls-internal'
2370
- }
2371
- ]
2372
- }
2373
- }
2374
- */
2043
+ /**
2044
+ * Wiki Link for SDK params
2045
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updateassignedpathparams
2046
+ */
2375
2047
  function updateAssignedPath(options) {
2376
2048
  var self = this;
2377
2049
  var dfd = q.defer();
@@ -2414,12 +2086,8 @@ function updateAssignedPath(options) {
2414
2086
  }
2415
2087
 
2416
2088
  /**
2417
- * options={
2418
- "title": "string", //mandatory
2419
- "startdate": 0, //mandatory
2420
- "enddate": 0, //mandatory
2421
- "path": "string"
2422
- }
2089
+ * Wiki Link for SDK params
2090
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#creategroupparams
2423
2091
  */
2424
2092
  function createGroup(options) {
2425
2093
  var self = this;
@@ -2463,11 +2131,10 @@ function createGroup(options) {
2463
2131
  return dfd.promise;
2464
2132
  }
2465
2133
 
2466
- /* options = {
2467
- "path": "string" //mandatory, Path of the group(this path group will also be returned,
2468
- "cursor": "string"
2469
- };
2470
- */
2134
+ /**
2135
+ * Wiki Link for SDK params
2136
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallgroupsbypathparams
2137
+ */
2471
2138
  function getAllGroupsByPath(options) {
2472
2139
  var self = this;
2473
2140
  // Initializing promise
@@ -2509,10 +2176,10 @@ function getAllGroupsByPath(options) {
2509
2176
  return dfd.promise;
2510
2177
  }
2511
2178
 
2512
- /* options = {
2513
- "groupId": "string" //mandatory
2514
- };
2515
- */
2179
+ /**
2180
+ * Wiki Link for SDK params
2181
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getagroupparams
2182
+ */
2516
2183
  function getAGroup(options) {
2517
2184
  var self = this;
2518
2185
  // Initializing promise
@@ -2551,15 +2218,10 @@ function getAGroup(options) {
2551
2218
  return dfd.promise;
2552
2219
  }
2553
2220
 
2554
- /* options = {
2555
- "groupId": "string" //mandatory
2556
- "body": {
2557
- "title": "string"
2558
- "startdate": "string",
2559
- "enddate":"string"
2560
- }
2561
- };
2562
- */
2221
+ /**
2222
+ * Wiki Link for SDK params
2223
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updategroupparams
2224
+ */
2563
2225
  function updateGroup(options) {
2564
2226
  var self = this;
2565
2227
  // Initializing promise
@@ -2602,10 +2264,10 @@ function updateGroup(options) {
2602
2264
  return dfd.promise;
2603
2265
  }
2604
2266
 
2605
- /* options = {
2606
- "groupId": "string" //mandatory
2607
- };
2608
- */
2267
+ /**
2268
+ * Wiki Link for SDK params
2269
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deletegroupparams
2270
+ */
2609
2271
  function deleteGroup(options) {
2610
2272
  var self = this;
2611
2273
  // Initializing promise
@@ -2645,12 +2307,10 @@ function deleteGroup(options) {
2645
2307
  return dfd.promise;
2646
2308
  }
2647
2309
 
2648
- /*
2649
- options = {
2650
- groupId: "string", //mandatory
2651
- cursor: "cursor"
2652
- }
2653
- */
2310
+ /**
2311
+ * Wiki Link for SDK params
2312
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallmembersofagroupparams
2313
+ */
2654
2314
  function getAllMembersOfAGroup(options) {
2655
2315
  var self = this;
2656
2316
  // Initializing promise
@@ -2697,12 +2357,10 @@ function getAllMembersOfAGroup(options) {
2697
2357
  return dfd.promise;
2698
2358
  }
2699
2359
 
2700
- /*
2701
- options = {
2702
- path: "string", //mandatory
2703
- cursor: "string"
2704
- }
2705
- */
2360
+ /**
2361
+ * Wiki Link for SDK params
2362
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallgroupmembersbypathparams
2363
+ */
2706
2364
  function getAllGroupMembersByPath(options) {
2707
2365
  var self = this;
2708
2366
  // Initializing promise
@@ -2749,25 +2407,10 @@ function getAllGroupMembersByPath(options) {
2749
2407
  return dfd.promise;
2750
2408
  }
2751
2409
 
2752
- /*
2753
- options = {
2754
-
2755
- groupId: "string", //mandatory
2756
- body: {
2757
- users: [
2758
- {
2759
- id: "string", // User’s external id - mandatory
2760
- dls_user_id: "string", // User’s dls id - mandatory
2761
- email: "string", //mandatory
2762
- first_name: "string", //mandatory
2763
- last_name: "string", //mandatory
2764
- name: "string", //mandatory
2765
- role: "string" //mandatory
2766
- }
2767
- ]
2768
- }
2769
- }
2770
- */
2410
+ /**
2411
+ * Wiki Link for SDK params
2412
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createmultiusergroupmembershipparams
2413
+ */
2771
2414
  function createMultiUserGroupMembership(options) {
2772
2415
  var self = this;
2773
2416
  // Initializing promise
@@ -2812,17 +2455,10 @@ function createMultiUserGroupMembership(options) {
2812
2455
  return dfd.promise;
2813
2456
  }
2814
2457
 
2815
- /*
2816
- options = {
2817
- "groupId": "string", //mandatory
2818
- "body": { //mandatory
2819
- users: [ //mandatory
2820
- {
2821
- id: "string" // User’s external id - mandatory
2822
- }
2823
- ]
2824
- }
2825
- */
2458
+ /**
2459
+ * Wiki Link for SDK params
2460
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deletemultiusergroupmembershipparams
2461
+ */
2826
2462
  function deleteMultiUserGroupMembership(options) {
2827
2463
  var self = this;
2828
2464
  // Initializing promise
@@ -2868,10 +2504,10 @@ function deleteMultiUserGroupMembership(options) {
2868
2504
  return dfd.promise;
2869
2505
  }
2870
2506
 
2871
- /* options= {
2872
- "groupId": "string", //mandatory
2873
- };
2874
- */
2507
+ /**
2508
+ * Wiki Link for SDK params
2509
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#archivegroupparams
2510
+ */
2875
2511
  function archiveGroup(options) {
2876
2512
  var self = this;
2877
2513
  // Initializing promise
@@ -2916,10 +2552,10 @@ function archiveGroup(options) {
2916
2552
  return dfd.promise;
2917
2553
  }
2918
2554
 
2919
- /* options= {
2920
- "groupId": "string", //mandatory
2921
- };
2922
- */
2555
+ /**
2556
+ * Wiki Link for SDK params
2557
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#unarchivegroupparams
2558
+ */
2923
2559
  function unarchiveGroup(options) {
2924
2560
  var self = this;
2925
2561
  // Initializing promise
@@ -2964,13 +2600,10 @@ function unarchiveGroup(options) {
2964
2600
  return dfd.promise;
2965
2601
  }
2966
2602
 
2967
- /*
2968
- options = {
2969
- userId: "string", //mandatory
2970
- path: "string", //mandatory
2971
- cursor: "string", // optional
2972
- }
2973
- */
2603
+ /**
2604
+ * Wiki Link for SDK params
2605
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getmyallmembershipsparams
2606
+ */
2974
2607
  function getMyAllMemberships(options) {
2975
2608
  var self = this;
2976
2609
  // Initializing promise
@@ -3018,22 +2651,10 @@ function getMyAllMemberships(options) {
3018
2651
  return dfd.promise;
3019
2652
  }
3020
2653
 
3021
- /*
3022
- options = {
3023
- classId: "string", //mandatory
3024
- body : {
3025
- items : //mandatory, Min: 1, Max: 200
3026
- [{
3027
- "productcode": "string",
3028
- "item-code": "string",
3029
- "link-statementid": "string",
3030
- "groupid": "string",
3031
- “type”: “dls-internal”, //mandatory
3032
- "data": { ... }
3033
- }]
3034
- }
3035
- }
3036
- */
2654
+ /**
2655
+ * Wiki Link for SDK params
2656
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#additemstoshowcaseofaclassparams
2657
+ */
3037
2658
  function addItemsToShowcaseOfAClass(options){
3038
2659
  var self = this;
3039
2660
  // Initializing promise
@@ -3074,14 +2695,10 @@ function addItemsToShowcaseOfAClass(options){
3074
2695
  return dfd.promise;
3075
2696
  }
3076
2697
 
3077
- /*
3078
- options = {
3079
- classId: "string", //mandatory
3080
- body : {
3081
- items : [ "id1", "id2", "id3", ... ] //mandatory
3082
- }
3083
- }
3084
- */
2698
+ /**
2699
+ * Wiki Link for SDK params
2700
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deleteitemsfromshowcaseofaclassparams
2701
+ */
3085
2702
  function deleteItemsFromShowcaseOfAClass(options){
3086
2703
  var self = this;
3087
2704
  // Initializing promise
@@ -3123,14 +2740,8 @@ function deleteItemsFromShowcaseOfAClass(options){
3123
2740
  }
3124
2741
 
3125
2742
  /**
3126
- * options = {
3127
- * classid: 'class id of the class',
3128
- * title: 'title of clone class',
3129
- * startdate: 'Epoch(Unix) timestamp in milliseconds',
3130
- * enddate: 'Epoch(Unix) timestamp in milliseconds',
3131
- * instructor: 'user who clones the class',
3132
- * clone_setting: {}, // Optional field
3133
- * }
2743
+ * Wiki Link for SDK params
2744
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#cloneclassparams
3134
2745
  */
3135
2746
  function cloneClass(options) {
3136
2747
  var self = this;
@@ -3176,16 +2787,10 @@ function cloneClass(options) {
3176
2787
  return dfd.promise;
3177
2788
  }
3178
2789
 
3179
- /*
3180
- options = {
3181
- classid: "string", //mandatory
3182
- body : {
3183
- gradebook_id: "string", //mandatory
3184
- title: "string", //mandatory
3185
- data: {}
3186
- }
3187
- }
3188
- */
2790
+ /**
2791
+ * Wiki Link for SDK params
2792
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#creategradebookmetaparams
2793
+ */
3189
2794
  function createGradebookMeta(options) {
3190
2795
  var self = this;
3191
2796
  // Initializing promise
@@ -3233,16 +2838,10 @@ function createGradebookMeta(options) {
3233
2838
  return dfd.promise;
3234
2839
  }
3235
2840
 
3236
- /*
3237
- options = {
3238
- classid: "string", //mandatory
3239
- gradebook_id: "string", //mandatory
3240
- body : { //mandatory
3241
- title: "string",
3242
- data: {}
3243
- }
3244
- }
3245
- */
2841
+ /**
2842
+ * Wiki Link for SDK params
2843
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updategradebookmetaparams
2844
+ */
3246
2845
  function updateGradebookMeta(options) {
3247
2846
  // Initializing promise
3248
2847
  var deferred = q.defer();
@@ -3303,12 +2902,10 @@ function updateGradebookMeta(options) {
3303
2902
  return deferred.promise;
3304
2903
  }
3305
2904
 
3306
- /*
3307
- options = {
3308
- classid: "string", //mandatory
3309
- gradebook_id: "string" //mandatory
3310
- }
3311
- */
2905
+ /**
2906
+ * Wiki Link for SDK params
2907
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deletegradebookmetaparams
2908
+ */
3312
2909
  function deleteGradebookMeta(options) {
3313
2910
  var self = this;
3314
2911
  var dfd = q.defer();
@@ -3354,12 +2951,10 @@ function deleteGradebookMeta(options) {
3354
2951
  return dfd.promise;
3355
2952
  }
3356
2953
 
3357
- /*
3358
- options = {
3359
- classid: "string", //mandatory
3360
- gradebook_id: "string" //mandatory
3361
- }
3362
- */
2954
+ /**
2955
+ * Wiki Link for SDK params
2956
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getparticulargradebookmetaofaclassparams
2957
+ */
3363
2958
  function getParticularGradebookMetaOfAClass(options) {
3364
2959
  // Initializing promise
3365
2960
  var deferred = q.defer();
@@ -3417,12 +3012,10 @@ function getParticularGradebookMetaOfAClass(options) {
3417
3012
  return deferred.promise;
3418
3013
  }
3419
3014
 
3420
- /*
3421
- options = {
3422
- classid: "string", //mandatory
3423
- cursor: "string"
3424
- }
3425
- */
3015
+ /**
3016
+ * Wiki Link for SDK params
3017
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallgradebooksmetaofaclassparams
3018
+ */
3426
3019
  function getAllGradebooksMetaOfAClass (options) {
3427
3020
  // Initializing promise
3428
3021
  var deferred = q.defer();
@@ -3474,32 +3067,10 @@ function getAllGradebooksMetaOfAClass (options) {
3474
3067
  return deferred.promise;
3475
3068
  }
3476
3069
 
3477
- /*
3478
- options = {
3479
- classid: "string", //mandatory
3480
- gradebook_id: "string", //mandatory
3481
- body : {
3482
- "columns": [
3483
- {
3484
- "column_id": "string", // Mandatory
3485
- "title": "string",
3486
- "type": "product / custom",
3487
- "weightage": "string",
3488
- "bundle-codes": [],
3489
- "productcode": "string",
3490
- "custom_component_code": "string",
3491
- "scoring_type": "string",
3492
- "items": [
3493
- {
3494
- "item-code": "string"
3495
- }
3496
- ],
3497
- "data": {...}
3498
- }
3499
- ]
3500
- }
3501
- }
3502
- */
3070
+ /**
3071
+ * Wiki Link for SDK params
3072
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#addgradebookcolumnsparams
3073
+ */
3503
3074
  function addGradebookColumns(options) {
3504
3075
  var self = this;
3505
3076
  // Initializing promise
@@ -3546,27 +3117,10 @@ function addGradebookColumns(options) {
3546
3117
  return dfd.promise;
3547
3118
  }
3548
3119
 
3549
- /*
3550
- options = {
3551
- classid: "string", //mandatory
3552
- gradebook_id: "string", //mandatory
3553
- body : {
3554
- "columns": [
3555
- {
3556
- "title": "string",
3557
- "weightage": "string",
3558
- "items": [
3559
- {
3560
- "item-code": "string"
3561
- }
3562
- ],
3563
- "data": {...}
3564
- },
3565
- {...}
3566
- ]
3567
- }
3568
- }
3569
- */
3120
+ /**
3121
+ * Wiki Link for SDK params
3122
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updatemultiplegradebookcolumnsparams
3123
+ */
3570
3124
  function updateMultipleGradebookColumns(options) {
3571
3125
  // Initializing promise
3572
3126
  var deferred = q.defer();
@@ -3622,19 +3176,10 @@ function updateMultipleGradebookColumns(options) {
3622
3176
  return deferred.promise;
3623
3177
  }
3624
3178
 
3625
- /*
3626
- options = {
3627
- classid: "string", //mandatory
3628
- gradebook_id: "string", //mandatory
3629
- body : {
3630
- "columns": [
3631
- {
3632
- "column_id": "string", // Mandatory
3633
- }
3634
- ]
3635
- }
3636
- }
3637
- */
3179
+ /**
3180
+ * Wiki Link for SDK params
3181
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#removegradebookcolumnsparams
3182
+ */
3638
3183
  function removeGradebookColumns(options) {
3639
3184
  var self = this;
3640
3185
  var dfd = q.defer();
@@ -3682,13 +3227,10 @@ function removeGradebookColumns(options) {
3682
3227
  return dfd.promise;
3683
3228
  }
3684
3229
 
3685
- /*
3686
- options = {
3687
- classid: "string", //mandatory
3688
- gradebook_id: "string", //mandatory
3689
- column_id: "string" //mandatory
3690
- }
3691
- */
3230
+ /**
3231
+ * Wiki Link for SDK params
3232
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getparticularcolumnofagradebookparams
3233
+ */
3692
3234
  function getParticularColumnOfAGradebook (options) {
3693
3235
  // Initializing promise
3694
3236
  var deferred = q.defer();
@@ -3737,13 +3279,10 @@ function getParticularColumnOfAGradebook (options) {
3737
3279
  return deferred.promise;
3738
3280
  }
3739
3281
 
3740
- /*
3741
- options = {
3742
- classid: "string", //mandatory
3743
- gradebook_id: "string", //mandatory
3744
- cursor: "string" //optional
3745
- }
3746
- */
3282
+ /**
3283
+ * Wiki Link for SDK params
3284
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallcolumnsofagradebookparams
3285
+ */
3747
3286
  function getAllColumnsOfAGradebook (options) {
3748
3287
  // Initializing promise
3749
3288
  var deferred = q.defer();
@@ -3797,12 +3336,10 @@ function getAllColumnsOfAGradebook (options) {
3797
3336
  return deferred.promise;
3798
3337
  }
3799
3338
 
3800
- /*
3801
- options = {
3802
- component_code: "string", //mandatory
3803
- cursor: "string" //optional
3804
- }
3805
- */
3339
+ /**
3340
+ * Wiki Link for SDK params
3341
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallclassesofacomponentparams
3342
+ */
3806
3343
  function getAllClassesOfAComponent (options) {
3807
3344
  // Initializing promise
3808
3345
  var deferred = q.defer();
@@ -3856,11 +3393,10 @@ function getAllClassesOfAComponent (options) {
3856
3393
  return deferred.promise;
3857
3394
  }
3858
3395
 
3859
- /*
3860
- options = {
3861
- component_code: "string" //mandatory
3862
- }
3863
- */
3396
+ /**
3397
+ * Wiki Link for SDK params
3398
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#removeallgradebookcolumnsofcustomcomponentparams
3399
+ */
3864
3400
  function removeAllGradebookColumnsOfCustomComponent (options) {
3865
3401
  // Initializing promise
3866
3402
  var deferred = q.defer();
@@ -3916,18 +3452,10 @@ function removeAllGradebookColumnsOfCustomComponent (options) {
3916
3452
  return deferred.promise;
3917
3453
  }
3918
3454
 
3919
- /*
3920
- options = {
3921
- body : {
3922
- custom_component_code: "string", // Mandatory
3923
- title: "string", // Mandatory
3924
- custom_component_type: "string", // Mandatory
3925
- scoring_type: "string",
3926
- items: [{...}],
3927
- data: {...}
3928
- }
3929
- }
3930
- */
3455
+ /**
3456
+ * Wiki Link for SDK params
3457
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#createcustomcomponentparams
3458
+ */
3931
3459
  function createCustomComponent(options) {
3932
3460
  var self = this;
3933
3461
 
@@ -3974,17 +3502,10 @@ function createCustomComponent(options) {
3974
3502
  return deferred.promise;
3975
3503
  }
3976
3504
 
3977
- /*
3978
- options = {
3979
- custom_component_code: "string", // Mandatory
3980
- body : {
3981
- title: "string",
3982
- custom_component_type: "string",
3983
- items: [{...}],
3984
- data: {...}
3985
- }
3986
- }
3987
- */
3505
+ /**
3506
+ * Wiki Link for SDK params
3507
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#updatecustomcomponentparams
3508
+ */
3988
3509
  function updateCustomComponent(options) {
3989
3510
  var self = this;
3990
3511
 
@@ -4041,11 +3562,10 @@ function updateCustomComponent(options) {
4041
3562
  return deferred.promise;
4042
3563
  }
4043
3564
 
4044
- /*
4045
- options = {
4046
- custom_component_code: "string", // Mandatory
4047
- }
4048
- */
3565
+ /**
3566
+ * Wiki Link for SDK params
3567
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#deletecustomcomponentparams
3568
+ */
4049
3569
  function deleteCustomComponent(options) {
4050
3570
  var self = this;
4051
3571
 
@@ -4092,11 +3612,10 @@ function deleteCustomComponent(options) {
4092
3612
  return deferred.promise;
4093
3613
  }
4094
3614
 
4095
- /*
4096
- options = {
4097
- custom_component_code: "string", // Mandatory
4098
- }
4099
- */
3615
+ /**
3616
+ * Wiki Link for SDK params
3617
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getparticularcustomcomponentparams
3618
+ */
4100
3619
  function getParticularCustomComponent(options) {
4101
3620
  var self = this;
4102
3621
 
@@ -4144,11 +3663,10 @@ function getParticularCustomComponent(options) {
4144
3663
  return deferred.promise;
4145
3664
  }
4146
3665
 
4147
- /*
4148
- options = {
4149
- cursor: "string"
4150
- }
4151
- */
3666
+ /**
3667
+ * Wiki Link for SDK params
3668
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getallcustomcomponentsparams
3669
+ */
4152
3670
  function getAllCustomComponents(options) {
4153
3671
  var self = this;
4154
3672