comprodls-sdk 2.90.2 → 2.91.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 +2917 -6291
  3. package/dist/comprodls-sdk.min.js +1 -1
  4. package/lib/comprodls.js +39 -57
  5. package/lib/config/index.js +172 -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 +106 -289
  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
@@ -17,6 +17,7 @@
17
17
  * is strictly forbidden unless prior written permission is obtained
18
18
  * from Compro Technologies Pvt. Ltd..
19
19
  ***************************************************************************/
20
+
20
21
  /***********************************************************
21
22
  * comproDLS SDK Open Access Manager Module
22
23
  * Provides Open Access functions for the SDK
@@ -26,13 +27,12 @@ var request = require('superagent');
26
27
  var helpers = require('../helpers');
27
28
  var DLSError = helpers.errors.DLSError;
28
29
 
29
- /*************************************
30
- * Setting up Exports/Public functions
31
- *************************************/
32
-
33
- // These functions need to be moved to the corresponding adapter
34
- // They were created here since these functions requires the orgid but not token, But the initialiation function required both token and orgid to be initialized, Now we have improved the initialization function for orgid.
35
-
30
+ /**
31
+ * These functions need to be moved to the corresponding adapter
32
+ * They were created here since these functions requires the orgid but not token,
33
+ * But the initialiation function required both token and orgid to be initialized,
34
+ * Now we have improved the initialization function for orgid.
35
+ */
36
36
  exports.getClassEnrolmentsStat = getClassEnrolmentsStat;
37
37
  exports.getSingleInvitation = getSingleInvitation;
38
38
 
@@ -41,11 +41,9 @@ exports.getSingleInvitation = getSingleInvitation;
41
41
  **********************************/
42
42
 
43
43
  /**
44
- * options = {
45
- * classid: 'string',
46
- * role: 'string
47
- * }
48
- **/
44
+ * Wiki Link for SDK params
45
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/17_Open-Access-SDK-Functions#getclassenrolmentsstatorganizationid-options
46
+ */
49
47
  function getClassEnrolmentsStat(organizationId, options) {
50
48
  var self = this;
51
49
  //Initializing promise
@@ -76,46 +74,43 @@ function getClassEnrolmentsStat(organizationId, options) {
76
74
  return dfd.promise;
77
75
  }
78
76
 
79
- /* options = {
80
- "context_id": "string", //class id to be invited -required
81
- "invitationid" : "string", //unique invitation id which is to be fetched -required
82
- "context" : "string", //context for invitation e.g. class_enrollment -required
83
- };
84
- */
77
+ /**
78
+ * Wiki Link for SDK params
79
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/17_Open-Access-SDK-Functions#getsingleinvitationorganizationid-params
80
+ */
85
81
  function getSingleInvitation(organizationId, options) {
86
- var self = this;
87
- var err = {};
88
- // Initializing promise
89
- var dfd = q.defer();
90
- if (organizationId && options && options.context_id && options.context &&
91
- options.invitationid) {
92
- // Passed all validations, Contruct API url
93
- var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getSingleInvitation;
94
- //Contruct path parameters
95
- url = helpers.api.constructAPIUrl(url,
96
- { orgId: organizationId, invitationId: options.invitationid });
97
- var queryParam = { context: options.context, context_id: options.context_id };
98
-
99
- // Setup request with URL and Params
100
- var requestAPI = request.get(url).query(queryParam);
101
- if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
102
-
103
- requestAPI.end(function (error, response) {
104
- if (error) {
105
- err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
106
- dfd.reject(err);
107
- }
108
- else {
109
- dfd.resolve(response.body);
110
- }
111
- });
112
- }
113
- else {
114
- err.message = err.description = 'organizationId or context_id or context '+
115
- 'or invitationid not found in request options.';
116
- err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
117
- dfd.reject(err);
118
- }
119
- return dfd.promise;
120
- }
82
+ var self = this;
83
+ var err = {};
84
+ // Initializing promise
85
+ var dfd = q.defer();
86
+ if (organizationId && options && options.context_id && options.context &&
87
+ options.invitationid) {
88
+ // Passed all validations, Contruct API url
89
+ var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getSingleInvitation;
90
+ //Contruct path parameters
91
+ url = helpers.api.constructAPIUrl(url,
92
+ { orgId: organizationId, invitationId: options.invitationid });
93
+ var queryParam = { context: options.context, context_id: options.context_id };
121
94
 
95
+ // Setup request with URL and Params
96
+ var requestAPI = request.get(url).query(queryParam);
97
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
98
+
99
+ requestAPI.end(function (error, response) {
100
+ if (error) {
101
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
102
+ dfd.reject(err);
103
+ }
104
+ else {
105
+ dfd.resolve(response.body);
106
+ }
107
+ });
108
+ }
109
+ else {
110
+ err.message = err.description = 'organizationId or context_id or context '+
111
+ 'or invitationid not found in request options.';
112
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
113
+ dfd.reject(err);
114
+ }
115
+ return dfd.promise;
116
+ }