comprodls-sdk 2.89.0 → 2.90.0-qa

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 (41) hide show
  1. package/README.md +1 -137
  2. package/dist/comprodls-sdk.js +5937 -8432
  3. package/dist/comprodls-sdk.min.js +15 -1
  4. package/lib/comprodls.js +39 -57
  5. package/lib/config/index.js +171 -199
  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 +73 -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 +238 -896
  16. package/lib/services/authextn/index.js +50 -150
  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 +74 -85
  22. package/lib/services/pub/index.js +159 -234
  23. package/lib/services/pushX/index.js +29 -33
  24. package/lib/services/pushX/pubnubClientWrapper.js +398 -398
  25. package/lib/services/rules/index.js +14 -67
  26. package/lib/services/spaces/index.js +106 -294
  27. package/lib/services/spacesextn/index.js +4 -24
  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 +37 -98
  31. package/lib/services/xapi/index.js +6 -125
  32. package/lib/token/index.js +73 -67
  33. package/lib/token/validations.js +45 -48
  34. package/package.json +1 -2
  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
package/lib/comprodls.js CHANGED
@@ -17,17 +17,15 @@
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 Main Module
22
23
  * This module provides definition of SDK for Javascript
23
24
  ************************************************************/
24
25
  var token_manager = require('./token');
25
- var helpers = require('./helpers');
26
26
  var auth = require('./services/auth');
27
27
  var authextn = require('./services/authextn');
28
- var activity = require('./services/activity');
29
28
  var analytics = require('./services/analytics');
30
- var collab = require('./services/collab');
31
29
  var product = require('./services/product');
32
30
  var xapi = require('./services/xapi');
33
31
  var attempts = require('./services/attempts');
@@ -47,76 +45,65 @@ var taxonomy = require('./services/taxonomy');
47
45
  var rules = require('./services/rules');
48
46
  var datasyncmanager = require('./services/datasyncmanager');
49
47
 
50
-
51
- /*********************************
52
- * Setting Up Module Entry Point
53
- **********************************/
54
48
  exports.init = init;
55
49
 
56
50
  //Factory function to create and return a new SDK object/instance
57
51
  function init(environment, realm, options) {
58
- return new comproDLS(environment, realm, options);
52
+ return new comproDLS(environment, realm, options);
59
53
  };
60
54
 
61
55
  // Constructor for the SDK object
62
56
  function comproDLS(environment, realm, options) {
63
- options = options || {};
64
- environment = environment || 'production';
65
- realm = realm || 'global';
66
- /*
67
- * Instance level parameters, used across all API calls. These are set to null.
68
- * Either authWithToken or authWithCredentials must be called to set these
69
- * with valid values.
70
- */
71
-
72
- /* API Token is a JSON Object with following structure
73
- * {
74
- * "access_token" : [String]
75
- * }
76
- */
77
- this.token = null;
57
+ options = options || {};
58
+ environment = environment || 'production';
59
+ realm = realm || 'global';
60
+ /*
61
+ * Instance level parameters, used across all API calls. These are set to null.
62
+ * Either authWithToken or authWithCredentials must be called to set these
63
+ * with valid values.
64
+ *
65
+ * API Token is a JSON Object with following structure: {access_token : 'string'}
66
+ */
67
+ this.token = null;
68
+ this.orgId = null;
69
+ this.traceid = options.traceid;
78
70
 
79
- //Organization Id
80
- this.orgId = null;
81
- this.traceid = options.traceid;
82
-
83
- try {
84
- config.DEFAULT_HOSTS = config.REALM_HOSTS[realm.toUpperCase()][environment.toUpperCase()];
85
- if(!config.DEFAULT_HOSTS){ throw 'Invalid Environment'; }
86
- }
87
- catch (e){
88
- var realmObj = config.REALM_HOSTS[realm.toUpperCase()];
89
- var err;
71
+ try {
72
+ config.DEFAULT_HOSTS = config.REALM_HOSTS[realm.toUpperCase()][environment.toUpperCase()];
73
+ if(!config.DEFAULT_HOSTS){ throw 'Invalid Environment'; }
74
+ }
75
+ catch (e) {
76
+ var realmObj = config.REALM_HOSTS[realm.toUpperCase()];
77
+ var err;
90
78
 
91
- if(!realmObj) { err = new Error('Invalid Realm: ' + realm); }
92
- else if(!realmObj[environment.toUpperCase()]) {
93
- err = new Error('Invalid Environment: ' + environment);
94
- }
95
- throw err;
79
+ if(!realmObj) { err = new Error('Invalid Realm: ' + realm); }
80
+ else if(!realmObj[environment.toUpperCase()]) {
81
+ err = new Error('Invalid Environment: ' + environment);
96
82
  }
83
+ throw err;
84
+ }
97
85
 
98
- this.config = config;
99
- this.environment = environment;
86
+ this.config = config;
87
+ this.environment = environment;
100
88
 
101
- if(options.orgid && options.token) {
102
- var err = validations.authWithToken(options.orgid, options.token, {});
103
- if (err) { throw err; }
104
- else {
105
- this.token = options.token;
106
- this.orgId = options.orgid;
107
- }
108
- }
109
- // This is the case when api requires orgid but not token
110
- else if(options.orgid) {
89
+ if(options.orgid && options.token) {
90
+ var err = validations.authWithToken(options.orgid, options.token, {});
91
+ if (err) { throw err; }
92
+ else {
93
+ this.token = options.token;
111
94
  this.orgId = options.orgid;
112
95
  }
96
+ }
97
+ // This is the case when api requires orgid but not token
98
+ else if(options.orgid) {
99
+ this.orgId = options.orgid;
100
+ }
113
101
  }
114
102
 
115
103
  /****************************************
116
104
  * Setting Up SDK Public Functions/Objects
117
105
  *****************************************/
118
106
  //Token Management
119
- comproDLS.prototype.authWithCredentials = token_manager.authWithCredentials;
120
107
  comproDLS.prototype.authWithToken = token_manager.authWithToken;
121
108
  comproDLS.prototype.authWithExtUser = token_manager.authWithExtUser;
122
109
 
@@ -124,15 +111,10 @@ comproDLS.prototype.authWithExtUser = token_manager.authWithExtUser;
124
111
  comproDLS.prototype.getClassEnrolmentsStat = open_access.getClassEnrolmentsStat;
125
112
  comproDLS.prototype.getSingleInvitation = open_access.getSingleInvitation;
126
113
 
127
- //Generic API Caller / Adaptor
128
- comproDLS.prototype.request = helpers.api.genericAPICaller;
129
-
130
114
  //Custom Service Adaptors
131
115
  comproDLS.prototype.Auth = auth;
132
116
  comproDLS.prototype.AuthExtn = authextn;
133
- comproDLS.prototype.Activity = activity;
134
117
  comproDLS.prototype.Analytics = analytics;
135
- comproDLS.prototype.Collab = collab;
136
118
  comproDLS.prototype.Product = product;
137
119
  comproDLS.prototype.Xapi = xapi;
138
120
  comproDLS.prototype.Attempts = attempts;
@@ -121,203 +121,175 @@ exports.REALM_HOSTS = {
121
121
  };
122
122
 
123
123
  exports.AUTH_API_URLS = {
124
- getSettings: '/org/{orgId}/settings',
125
- getTokenAPI: '/auth/{orgId}/token',
126
- getExtUserTokenAPI: '/auth/{orgId}/ext-users/token',
127
- userInfoAPI: '/org/{orgId}/users/{userId}',
128
- pisImportAPI: '/org/{orgId}/pis_imports',
129
- getAllUsersAPI: '/org/{orgId}/users/all',
130
- updateUserRoleAPI: '/org/{orgId}/users/{userId}/update-role',
131
- getSettingsField: '/org/{orgId}/settings/{field}',
132
- getClassUsersAPI: '/org/{orgId}/class/{classId}/users',
133
- getUserClassesAPI: '/org/{orgId}/users/{userId}/classes',
134
- getUserClassesV2API: '/org/{orgid}/users/{userid}/class-enrollments',
135
- getAllJobs: '/accounts/{accountId}/ext-users/{extUserId}/jobs',
136
- getJob: '/accounts/{accountId}/ext-users/{extUserId}/jobs/{jobId}',
137
- getAllClassesAPI: '/org/{orgId}/classes',
138
- getParticularClassAPI: '/org/{orgId}/classes/{classId}',
139
- getParticularShadowClassAPI: '/org/{orgId}/shadow/classes/{extClassId}',
140
- classProductAssociation: '/org/{orgId}/classes/{classId}/associate-product/{productcode}',
141
- multiClassProductAssociations: '/org/{orgId}/classes/{classId}/associate-product/multi',
142
- classMaterialAssociation: '/org/{orgId}/classes/{classId}/associate-materials/multi',
143
- enrollUsertoClass: '/org/{orgId}/classes/{classId}/enroll-user/{userId}',
144
- enrollSelftoClass: '/org/{orgId}/classes/{classId}/enroll-self',
145
- enrollMultiUserstoClass: '/org/{orgId}/classes/{classId}/enroll-user/multi',
146
- createClass: '/org/{orgId}/classes',
147
- createMultipleClasses: '/org/{orgId}/classes/multi',
148
- specificClass: '/org/{orgId}/classes/{classId}',
149
- cloneClass: '/org/{orgId}/classes/{classId}/clone',
150
-
151
- ClassAppdata: '/org/{orgId}/classes/{classid}/appdata',
152
-
153
- generateClassCode: '/org/{orgId}/classes/{classId}/class-code/generate',
154
-
155
- // spaces related API
156
- getUserSpaces: '/accounts/{accountid}/ext-users/{extuserid}/spaces',
157
- validateSpaceCode: '/accounts/{accountid}/space-code/validate',
158
- validateClassCode: '/accounts/{accountid}/class-code/validate',
159
- joinInstituteSpace: '/accounts/{accountid}/join-institute-space',
160
- provisionSpacesToStudent: '/accounts/{accountId}/student/provision-spaces',
161
- provisionSpacesToTeacher: '/accounts/{accountId}/teacher/provision-spaces',
162
- shadowProvision: '/org/{orgId}/shadow-provision',
163
- provisionBulkSpaces: '/org/{orgId}/provision-spaces/bulk',
164
- entitleUserToProduct: '/accounts/{accountId}/entitle-user',
165
- microEntitleUserToProduct: '/accounts/{accountId}/entitle-user/micro',
166
- bulkMicroEntitleProductToUser: '/accounts/{accountId}/entitle-user/micro/bulk',
167
- enrollUserInClass: '/accounts/{accountId}/enroll-with-classcode',
168
- getExtProductAPI: '/accounts/{accountId}/products/{extProductId}',
169
- getSpaceDetails: '/accounts/{accountId}/spaces/{spacekey}',
170
- updateUserInformation: '/accounts/{accountId}/update-user-information',
171
- updateUserSpace: '/accounts/{accountid}/ext-users/{extuserid}/spaces/{spacekey}',
172
- getInvitationsByEmail: '/accounts/{accountid}/invitations-by-email',
173
- generateSpaceCode: '/accounts/{accountid}/space-code/generate',
174
- changeSpaceCode: '/accounts/{accountid}/space-code/{spacecode}/change',
175
- updateInstituteTitle: '/accounts/{accountId}/institute-spaces/{instituteSpaceCode}',
176
-
177
- //Superuser related API
178
- getAllInstitutions: '/su/accounts/{accountid}/spaces',
179
- getInstitution: '/su/accounts/{accountid}/spaces/{spacecode}',
180
- provisionSpacesToSuperAdmin: '/su/accounts/{accountid}/superadmin/provision-spaces',
181
-
182
- //Superuser related API
183
- sendInvitations: '/org/{orgId}/invitations',
184
- getMultiInvitations: '/org/{orgId}/invitations',
185
- getSingleInvitation: '/org/{orgId}/invitations/{invitationId}',
186
- revokeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/revoke',
187
- completeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/complete',
188
- resendSingleInvitation: '/org/{orgId}/invitations/{invitationid}/resend',
189
- //AssignedPath related API
190
- createAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths',
191
- deleteAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths/{assignedPathId}',
192
-
193
- //Workflows related APIs
194
- workflows: '/accounts/{accountid}/workflows',
195
- getAllWorkflowOfAUser: '/accounts/{accountid}/workflows/workflows-by-user',
196
- getAWorkflow: '/accounts/{accountid}/workflows/{workflowid}',
197
- acceptAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/accept',
198
- processAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/process',
199
- revokeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/revoke',
200
- completeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/complete',
201
-
202
- //Groups realated APIs
203
- allGroups: '/org/{orgId}/groups',
204
- aParticularGroup: '/org/{orgId}/groups/{groupId}',
205
- getAllMembersOfAGroup: '/org/{orgId}/groups/{groupId}/memberships',
206
- getAllGroupMembersByPath: '/org/{orgId}/groups/memberships',
207
- userGroupMembership: '/org/{orgId}/groups/{groupId}/enroll-user/multi',
208
- getMyAllMemberships: '/org/{orgId}/users/{userId}/groups',
209
- archiveAParticularGroup: '/org/{orgId}/groups/{groupId}/archive',
210
- unarchiveAParticularGroup: '/org/{orgId}/groups/{groupId}/unarchive',
211
-
212
- //Showcase related API's
213
- showcaseItems: '/org/{orgId}/classes/{classId}/showcase/item',
214
-
215
- //Data-Sync-Manager related APIs
216
- createDataSyncManager: '/accounts/{accountid}/data-sync-managers',
217
- dataSyncManager: '/accounts/{accountid}/data-sync-managers/{dsmid}',
218
- getAllDataSyncManagersOfAGroup: '/accounts/{accountid}/dsm-groups/{dsm_groupid}/data-sync-managers',
219
-
220
- //Gradebooks related APIs
221
- createOrGetGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks',
222
- updateOrDeleteGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}',
223
- gradebookColumns: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}/columns',
224
- getAllClassesOfAComponent: '/org/{orgId}/components/{component_code}/classes',
225
- removeAllGradebookColumnsOfCustomComponent: '/org/{orgId}/gradebook/columns/custom-components/{component_code}',
226
-
227
- // Custom Components related APIs
228
- customComponents: '/org/{orgid}/custom-components',
229
- particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
124
+ getSettings: '/org/{orgId}/settings',
125
+ getExtUserTokenAPI: '/auth/{orgId}/ext-users/token',
126
+ userInfoAPI: '/org/{orgId}/users/{userId}',
127
+ pisImportAPI: '/org/{orgId}/pis_imports',
128
+ getAllUsersAPI: '/org/{orgId}/users/all',
129
+ updateUserRoleAPI: '/org/{orgId}/users/{userId}/update-role',
130
+ getSettingsField: '/org/{orgId}/settings/{field}',
131
+ getClassUsersAPI: '/org/{orgId}/class/{classId}/users',
132
+ getUserClassesAPI: '/org/{orgId}/users/{userId}/classes',
133
+ getUserClassesV2API: '/org/{orgid}/users/{userid}/class-enrollments',
134
+ getAllJobs: '/accounts/{accountId}/ext-users/{extUserId}/jobs',
135
+ getJob: '/accounts/{accountId}/ext-users/{extUserId}/jobs/{jobId}',
136
+ getAllClassesAPI: '/org/{orgId}/classes',
137
+ getParticularClassAPI: '/org/{orgId}/classes/{classId}',
138
+ getParticularShadowClassAPI: '/org/{orgId}/shadow/classes/{extClassId}',
139
+ classProductAssociation: '/org/{orgId}/classes/{classId}/associate-product/{productcode}',
140
+ multiClassProductAssociations: '/org/{orgId}/classes/{classId}/associate-product/multi',
141
+ classMaterialAssociation: '/org/{orgId}/classes/{classId}/associate-materials/multi',
142
+ enrollUsertoClass: '/org/{orgId}/classes/{classId}/enroll-user/{userId}',
143
+ enrollSelftoClass: '/org/{orgId}/classes/{classId}/enroll-self',
144
+ enrollMultiUserstoClass: '/org/{orgId}/classes/{classId}/enroll-user/multi',
145
+ createClass: '/org/{orgId}/classes',
146
+ createMultipleClasses: '/org/{orgId}/classes/multi',
147
+ specificClass: '/org/{orgId}/classes/{classId}',
148
+ cloneClass: '/org/{orgId}/classes/{classId}/clone',
149
+
150
+ generateClassCode: '/org/{orgId}/classes/{classId}/class-code/generate',
151
+
152
+ // spaces related API
153
+ getUserSpaces: '/accounts/{accountid}/ext-users/{extuserid}/spaces',
154
+ validateSpaceCode: '/accounts/{accountid}/space-code/validate',
155
+ validateClassCode: '/accounts/{accountid}/class-code/validate',
156
+ joinInstituteSpace: '/accounts/{accountid}/join-institute-space',
157
+ provisionSpacesToStudent: '/accounts/{accountId}/student/provision-spaces',
158
+ provisionSpacesToTeacher: '/accounts/{accountId}/teacher/provision-spaces',
159
+ shadowProvision: '/org/{orgId}/shadow-provision',
160
+ provisionBulkSpaces: '/org/{orgId}/provision-spaces/bulk',
161
+ entitleUserToProduct: '/accounts/{accountId}/entitle-user',
162
+ microEntitleUserToProduct: '/accounts/{accountId}/entitle-user/micro',
163
+ bulkMicroEntitleProductToUser: '/accounts/{accountId}/entitle-user/micro/bulk',
164
+ enrollUserInClass: '/accounts/{accountId}/enroll-with-classcode',
165
+ getExtProductAPI: '/accounts/{accountId}/products/{extProductId}',
166
+ getSpaceDetails: '/accounts/{accountId}/spaces/{spacekey}',
167
+ updateUserInformation: '/accounts/{accountId}/update-user-information',
168
+ updateUserSpace: '/accounts/{accountid}/ext-users/{extuserid}/spaces/{spacekey}',
169
+ getInvitationsByEmail: '/accounts/{accountid}/invitations-by-email',
170
+ generateSpaceCode: '/accounts/{accountid}/space-code/generate',
171
+ changeSpaceCode: '/accounts/{accountid}/space-code/{spacecode}/change',
172
+ updateInstituteTitle: '/accounts/{accountId}/institute-spaces/{instituteSpaceCode}',
173
+
174
+ //Superuser related API
175
+ getAllInstitutions: '/su/accounts/{accountid}/spaces',
176
+ getInstitution: '/su/accounts/{accountid}/spaces/{spacecode}',
177
+ provisionSpacesToSuperAdmin: '/su/accounts/{accountid}/superadmin/provision-spaces',
178
+
179
+ //Superuser related API
180
+ sendInvitations: '/org/{orgId}/invitations',
181
+ getMultiInvitations: '/org/{orgId}/invitations',
182
+ getSingleInvitation: '/org/{orgId}/invitations/{invitationId}',
183
+ revokeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/revoke',
184
+ completeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/complete',
185
+ resendSingleInvitation: '/org/{orgId}/invitations/{invitationid}/resend',
186
+ //AssignedPath related API
187
+ createAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths',
188
+ deleteAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths/{assignedPathId}',
189
+
190
+ //Workflows related APIs
191
+ workflows: '/accounts/{accountid}/workflows',
192
+ getAllWorkflowOfAUser: '/accounts/{accountid}/workflows/workflows-by-user',
193
+ getAWorkflow: '/accounts/{accountid}/workflows/{workflowid}',
194
+ acceptAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/accept',
195
+ processAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/process',
196
+ revokeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/revoke',
197
+ completeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/complete',
198
+
199
+ //Groups realated APIs
200
+ allGroups: '/org/{orgId}/groups',
201
+ aParticularGroup: '/org/{orgId}/groups/{groupId}',
202
+ getAllMembersOfAGroup: '/org/{orgId}/groups/{groupId}/memberships',
203
+ getAllGroupMembersByPath: '/org/{orgId}/groups/memberships',
204
+ userGroupMembership: '/org/{orgId}/groups/{groupId}/enroll-user/multi',
205
+ getMyAllMemberships: '/org/{orgId}/users/{userId}/groups',
206
+ archiveAParticularGroup: '/org/{orgId}/groups/{groupId}/archive',
207
+ unarchiveAParticularGroup: '/org/{orgId}/groups/{groupId}/unarchive',
208
+
209
+ //Showcase related API's
210
+ showcaseItems: '/org/{orgId}/classes/{classId}/showcase/item',
211
+
212
+ //Data-Sync-Manager related APIs
213
+ createDataSyncManager: '/accounts/{accountid}/data-sync-managers',
214
+ dataSyncManager: '/accounts/{accountid}/data-sync-managers/{dsmid}',
215
+ getAllDataSyncManagersOfAGroup: '/accounts/{accountid}/dsm-groups/{dsm_groupid}/data-sync-managers',
216
+
217
+ //Gradebooks related APIs
218
+ createOrGetGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks',
219
+ updateOrDeleteGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}',
220
+ gradebookColumns: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}/columns',
221
+ getAllClassesOfAComponent: '/org/{orgId}/components/{component_code}/classes',
222
+ removeAllGradebookColumnsOfCustomComponent: '/org/{orgId}/gradebook/columns/custom-components/{component_code}',
223
+
224
+ // Custom Components related APIs
225
+ customComponents: '/org/{orgid}/custom-components',
226
+ particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
230
227
  };
231
228
 
232
229
  exports.AUTHEXTN_API_URLS = {
233
- // Grade Formats related APIs
234
- gradeFormat: '/org/{orgid}/gradeformats',
235
- particularGradeFormat: '/org/{orgid}/gradeformats/{gradeformat_id}',
236
- classGradeformatAssociation: '/org/{orgid}/classes/{classid}/associate-gradeformats/{gradeformat_id}',
237
- classGradeformats: '/org/{orgid}/classes/{classid}/gradeformats',
238
- gradeformatClasses: '/org/{orgid}/gradeformats/{gradeformat_id}/classes',
230
+ // Grade Formats related APIs
231
+ gradeFormat: '/org/{orgid}/gradeformats',
232
+ particularGradeFormat: '/org/{orgid}/gradeformats/{gradeformat_id}',
233
+ classGradeformatAssociation: '/org/{orgid}/classes/{classid}/associate-gradeformats/{gradeformat_id}',
234
+ classGradeformats: '/org/{orgid}/classes/{classid}/gradeformats',
235
+ gradeformatClasses: '/org/{orgid}/gradeformats/{gradeformat_id}/classes',
239
236
 
240
- //Space related API
241
- entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
237
+ //Space related API
238
+ entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
242
239
 
243
- // Assigned Path APIs
244
- userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
240
+ // Assigned Path APIs
241
+ userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
245
242
 
246
- // Class related APIs
247
- particularClass: '/org/{orgId}/classes/{classId}',
243
+ // Class related APIs
244
+ particularClass: '/org/{orgId}/classes/{classId}',
248
245
 
249
- // Org Entitlement related APIs
250
- orgProductEntitlement: '/org/{orgid}/org-entitlements',
251
- setupUser: '/accounts/{accountId}/user/setup'
252
-
253
- };
254
-
255
- exports.ACTIVITY_API_URLS = {
256
- newAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/start',
257
- activityDetailsAPI: '/{orgId}/products/{productId}/activities/{activityId}',
258
- existingAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}',
259
- userResponseAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}/response',
260
- submitAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}/submit'
246
+ // Org Entitlement related APIs
247
+ orgProductEntitlement: '/org/{orgid}/org-entitlements',
248
+ setupUser: '/accounts/{accountId}/user/setup'
261
249
  };
262
250
 
263
251
  exports.ANALYTICS_API_URLS = {
264
- archiveUserAnalytics: '/{orgId}/archive/user/product',
265
- getOrgAnalyticsStat: '/{orgId}/organization/{type}/stat',
266
- getAnalyticProductItems: '/{orgId}/user/product/progress/items',
267
- getAnalyticProductSummary: '/{orgId}/user/product/progress/summary',
268
- getExternalDataForUserAnalyticItem: '/{orgId}/user/product/progress/items/external-data',
269
- searchUserProductAnalytics: '/{orgId}/user/product/progress/search',
270
- getAnalyticProductById: '/{orgId}/user/product/userprogress/{userProgressId}',
271
- getArchivedUserAnalytics: '/{orgId}/archive',
272
- getClassAnalytics: '/{orgId}/class/{analyticsDataType}/{type}',
273
- getClassEnrolmentsStat: '/{orgId}/class/enrolments/stat',
274
- getClassRecord: '/{orgId}/class/product/class-record',
275
- getClassRecordItemAggregations: '/{orgId}/class/product/item-aggregations',
276
- getClassProductRecentPendingSubmissions: '/{orgId}/class/product/recent-pending-submissions',
277
- getStudentsWithEvaluatedOnce: '/{orgId}/class/product/students-with-evaluations',
278
- getShowcaseRecordOfAClass: '/{orgId}/class/showcase',
279
-
280
- getGroupRecord: '/{orgId}/class/group/product/group-record',
281
- getClassGroupsRecentPendingSubmissions: '/{orgId}/class/group/product/recent-pending-submissions',
282
- getGroupsWithEvaluatedOnce: '/{orgId}/class/group/product/groups-with-evaluations',
283
-
284
- getClassRecordUserAggregations: '/{orgId}/class/product/user-aggregations',
285
- getUserClassRecentSubmissions: '/{orgId}/user/product/class/recent-submissions',
286
- appState: '/{orgId}/user/product/progress/state',
287
- getUserProductAllState: '/{orgId}/user/product/progress/state/all',
288
- updateUserProductMultiState: '/{orgId}/user/product/progress/state/multi',
289
-
290
- //AssignedPaths Related APIs
291
- getAllAssignedPathsOfClass: '/{orgId}/class/assigned-paths',
292
- getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
293
- getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
294
-
295
- timeseriesAnalytics: '/progress/timeseries',
296
-
297
- //ClassCustomComponentRecord Related APIs
298
- getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
299
- getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations',
300
-
301
- //CrossProductAggregation Related APIs
302
- getCrossProductAggregation: '/{orgId}/class/cross-product-aggregation'
303
- };
304
-
305
- exports.COLLAB_API_URLS = {
306
- postsInClassAPI: '/{orgId}/post/classes/{classId}',
307
- postsInProductAPI: '/{orgId}/post/products/{productId}',
308
- getMyFollowers: '/{orgId}/connections/me/followers',
309
- getUsersFollowedByMe: '/{orgId}/connections/me/following',
310
- connectionURL: '/{orgId}/connections/me/follow/{userId}'
252
+ getOrgAnalyticsStat: '/{orgId}/organization/{type}/stat',
253
+ getAnalyticProductItems: '/{orgId}/user/product/progress/items',
254
+ getAnalyticProductSummary: '/{orgId}/user/product/progress/summary',
255
+ getExternalDataForUserAnalyticItem: '/{orgId}/user/product/progress/items/external-data',
256
+ getClassEnrolmentsStat: '/{orgId}/class/enrolments/stat',
257
+ getClassRecord: '/{orgId}/class/product/class-record',
258
+ getClassRecordItemAggregations: '/{orgId}/class/product/item-aggregations',
259
+ getClassProductRecentPendingSubmissions: '/{orgId}/class/product/recent-pending-submissions',
260
+ getStudentsWithEvaluatedOnce: '/{orgId}/class/product/students-with-evaluations',
261
+ getShowcaseRecordOfAClass: '/{orgId}/class/showcase',
262
+
263
+ getGroupRecord: '/{orgId}/class/group/product/group-record',
264
+ getClassGroupsRecentPendingSubmissions: '/{orgId}/class/group/product/recent-pending-submissions',
265
+ getGroupsWithEvaluatedOnce: '/{orgId}/class/group/product/groups-with-evaluations',
266
+
267
+ getClassRecordUserAggregations: '/{orgId}/class/product/user-aggregations',
268
+ getUserClassRecentSubmissions: '/{orgId}/user/product/class/recent-submissions',
269
+
270
+ //AssignedPaths Related APIs
271
+ getAllAssignedPathsOfClass: '/{orgId}/class/assigned-paths',
272
+ getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
273
+ getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
274
+
275
+ timeseriesAnalytics: '/progress/timeseries',
276
+
277
+ //ClassCustomComponentRecord Related APIs
278
+ getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
279
+ getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations',
280
+
281
+ //CrossProductAggregation Related APIs
282
+ getCrossProductAggregation: '/{orgId}/class/cross-product-aggregation'
311
283
  };
312
284
 
313
285
  exports.PRODUCT_API_URLS = {
314
- getProductAPI: '/accounts/{accountId}/products/{productCode}',
315
- getEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements',
316
- getMicroEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements/micro',
317
- getAllBundles: '/accounts/{accountId}/bundles',
318
- getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}',
319
- getAllProductFamilies: '/accounts/{accountId}/families',
320
- getSingleProductFamily: '/accounts/{accountId}/families/{familyCode}'
286
+ getProductAPI: '/accounts/{accountId}/products/{productCode}',
287
+ getEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements',
288
+ getMicroEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements/micro',
289
+ getAllBundles: '/accounts/{accountId}/bundles',
290
+ getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}',
291
+ getAllProductFamilies: '/accounts/{accountId}/families',
292
+ getSingleProductFamily: '/accounts/{accountId}/families/{familyCode}'
321
293
  };
322
294
 
323
295
  exports.XAPI_API_URLS = {
@@ -335,24 +307,24 @@ exports.ATTEMPTS_API_URLS = {
335
307
  };
336
308
 
337
309
  exports.PUB_API_URLS = {
338
- promoteAPI: '/{orgId}/products/{productcode}/promote',
339
- registerProductAPI: '/{orgId}/products/register',
340
- ingestByCodeAPI: '/{orgId}/products/{productcode}/ingest',
341
- createBundle: '/{orgid}/stage/{stage}/bundles',
342
- updateBundle: '/{orgid}/stage/{stage}/bundles/{bundleCode}',
343
- getAllBundles: '/{orgid}/bundles',
344
- getSingleBundle: '/{orgid}/bundles/{bundleCode}',
345
- createProductFamily: '/{orgid}/stage/{stage}/families',
346
- updateProductFamily: '/{orgid}/stage/{stage}/families/{familyCode}',
347
- getSingleProductFamily: '/{orgid}/families/{familyCode}',
348
- getAllProductFamilies: '/{orgid}/families'
310
+ promoteAPI: '/{orgId}/products/{productcode}/promote',
311
+ registerProductAPI: '/{orgId}/products/register',
312
+ ingestByCodeAPI: '/{orgId}/products/{productcode}/ingest',
313
+ createBundle: '/{orgid}/stage/{stage}/bundles',
314
+ updateBundle: '/{orgid}/stage/{stage}/bundles/{bundleCode}',
315
+ getAllBundles: '/{orgid}/bundles',
316
+ getSingleBundle: '/{orgid}/bundles/{bundleCode}',
317
+ createProductFamily: '/{orgid}/stage/{stage}/families',
318
+ updateProductFamily: '/{orgid}/stage/{stage}/families/{familyCode}',
319
+ getSingleProductFamily: '/{orgid}/families/{familyCode}',
320
+ getAllProductFamilies: '/{orgid}/families'
349
321
  };
350
322
 
351
323
  exports.PUSHX_API_URLS = {
352
- grantByUserOrgId: '/orgs/{orgId}/grants',
353
- grantByAccountId: '/accounts/{accountId}/grants',
354
- grantV2: '/ver/v2/grants',
355
- getPushedEvents: '/accounts/{accountId}/pushed-events/channels'
324
+ grantByUserOrgId: '/orgs/{orgId}/grants',
325
+ grantByAccountId: '/accounts/{accountId}/grants',
326
+ grantV2: '/ver/v2/grants',
327
+ getPushedEvents: '/accounts/{accountId}/pushed-events/channels'
356
328
  };
357
329
 
358
330
  exports.INTEGRATIONS_API_URLS = {
@@ -17,14 +17,15 @@
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 Helpers Module
22
23
  * This module provides definition of helper functions for SDK.
23
24
  ************************************************************/
25
+
24
26
  /****************************************************
25
27
  * Setting up Exports/Public functions and variables
26
28
  *****************************************************/
27
29
  exports.api = require('./lib/api');
28
30
  exports.errors = require('./lib/errors');
29
- exports.utils = require('./lib/utils');
30
- exports.validations = require('./lib/validator');
31
+ exports.validations = require('./lib/validator');
@@ -78,7 +78,6 @@ function __convertClassResponse(options) {
78
78
  return response;
79
79
  }
80
80
 
81
-
82
81
  /**
83
82
  * This function converts enrollment entities to generate SDK response.
84
83
  * @param { *data: [enrollmentEntities] } options
@@ -93,7 +92,7 @@ function __convertClassResponse(options) {
93
92
  lastName = enrollment.last_name;
94
93
  if(firstName || lastName) {
95
94
  enrollment.name = firstName ? firstName : '';
96
-
95
+
97
96
  if(lastName) {
98
97
  enrollment.name += firstName ? (' ' + lastName) : lastName;
99
98
  }