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
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,208 +121,181 @@ 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
- 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
- ClassAppdata: '/org/{orgId}/classes/{classid}/appdata',
151
-
152
- generateClassCode: '/org/{orgId}/classes/{classId}/class-code/generate',
153
-
154
- // spaces related API
155
- getUserSpaces: '/accounts/{accountid}/ext-users/{extuserid}/spaces',
156
- validateSpaceCode: '/accounts/{accountid}/space-code/validate',
157
- validateClassCode: '/accounts/{accountid}/class-code/validate',
158
- joinInstituteSpace: '/accounts/{accountid}/join-institute-space',
159
- provisionSpacesToStudent: '/accounts/{accountId}/student/provision-spaces',
160
- provisionSpacesToTeacher: '/accounts/{accountId}/teacher/provision-spaces',
161
- shadowProvision: '/org/{orgId}/shadow-provision',
162
- provisionBulkSpaces: '/org/{orgId}/provision-spaces/bulk',
163
- entitleUserToProduct: '/accounts/{accountId}/entitle-user',
164
- microEntitleUserToProduct: '/accounts/{accountId}/entitle-user/micro',
165
- bulkMicroEntitleProductToUser: '/accounts/{accountId}/entitle-user/micro/bulk',
166
- enrollUserInClass: '/accounts/{accountId}/enroll-with-classcode',
167
- getExtProductAPI: '/accounts/{accountId}/products/{extProductId}',
168
- getSpaceDetails: '/accounts/{accountId}/spaces/{spacekey}',
169
- updateUserInformation: '/accounts/{accountId}/update-user-information',
170
- updateUserSpace: '/accounts/{accountid}/ext-users/{extuserid}/spaces/{spacekey}',
171
- getInvitationsByEmail: '/accounts/{accountid}/invitations-by-email',
172
- generateSpaceCode: '/accounts/{accountid}/space-code/generate',
173
- changeSpaceCode: '/accounts/{accountid}/space-code/{spacecode}/change',
174
- updateInstituteTitle: '/accounts/{accountId}/institute-spaces/{instituteSpaceCode}',
175
-
176
- //Superuser related API
177
- getAllInstitutions: '/su/accounts/{accountid}/spaces',
178
- getInstitution: '/su/accounts/{accountid}/spaces/{spacecode}',
179
- provisionSpacesToSuperAdmin: '/su/accounts/{accountid}/superadmin/provision-spaces',
180
-
181
- //Superuser related API
182
- sendInvitations: '/org/{orgId}/invitations',
183
- getMultiInvitations: '/org/{orgId}/invitations',
184
- getSingleInvitation: '/org/{orgId}/invitations/{invitationId}',
185
- revokeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/revoke',
186
- completeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/complete',
187
- resendSingleInvitation: '/org/{orgId}/invitations/{invitationid}/resend',
188
- //AssignedPath related API
189
- createAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths',
190
- deleteAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths/{assignedPathId}',
191
-
192
- //Workflows related APIs
193
- workflows: '/accounts/{accountid}/workflows',
194
- getAllWorkflowOfAUser: '/accounts/{accountid}/workflows/workflows-by-user',
195
- getAWorkflow: '/accounts/{accountid}/workflows/{workflowid}',
196
- acceptAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/accept',
197
- processAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/process',
198
- revokeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/revoke',
199
- completeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/complete',
200
-
201
- //Groups realated APIs
202
- allGroups: '/org/{orgId}/groups',
203
- aParticularGroup: '/org/{orgId}/groups/{groupId}',
204
- getAllMembersOfAGroup: '/org/{orgId}/groups/{groupId}/memberships',
205
- getAllGroupMembersByPath: '/org/{orgId}/groups/memberships',
206
- userGroupMembership: '/org/{orgId}/groups/{groupId}/enroll-user/multi',
207
- getMyAllMemberships: '/org/{orgId}/users/{userId}/groups',
208
- archiveAParticularGroup: '/org/{orgId}/groups/{groupId}/archive',
209
- unarchiveAParticularGroup: '/org/{orgId}/groups/{groupId}/unarchive',
210
-
211
- //Showcase related API's
212
- showcaseItems: '/org/{orgId}/classes/{classId}/showcase/item',
213
-
214
- //Data-Sync-Manager related APIs
215
- createDataSyncManager: '/accounts/{accountid}/data-sync-managers',
216
- dataSyncManager: '/accounts/{accountid}/data-sync-managers/{dsmid}',
217
- getAllDataSyncManagersOfAGroup: '/accounts/{accountid}/dsm-groups/{dsm_groupid}/data-sync-managers',
218
-
219
- //Gradebooks related APIs
220
- createOrGetGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks',
221
- updateOrDeleteGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}',
222
- gradebookColumns: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}/columns',
223
- getAllClassesOfAComponent: '/org/{orgId}/components/{component_code}/classes',
224
- removeAllGradebookColumnsOfCustomComponent: '/org/{orgId}/gradebook/columns/custom-components/{component_code}',
225
-
226
- // Custom Components related APIs
227
- customComponents: '/org/{orgid}/custom-components',
228
- 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
+ provisionStudentInInstitutionalSpace: '/accounts/{accountid}/student/join-institute-space',
158
+ provisionSpacesToStudent: '/accounts/{accountId}/student/provision-spaces',
159
+ provisionSpacesToTeacher: '/accounts/{accountId}/teacher/provision-spaces',
160
+ shadowProvision: '/org/{orgId}/shadow-provision',
161
+ provisionBulkSpaces: '/org/{orgId}/provision-spaces/bulk',
162
+ entitleUserToProduct: '/accounts/{accountId}/entitle-user',
163
+ microEntitleUserToProduct: '/accounts/{accountId}/entitle-user/micro',
164
+ bulkMicroEntitleProductToUser: '/accounts/{accountId}/entitle-user/micro/bulk',
165
+ enrollUserInClass: '/accounts/{accountId}/enroll-with-classcode',
166
+ getExtProductAPI: '/accounts/{accountId}/products/{extProductId}',
167
+ getSpaceDetails: '/accounts/{accountId}/spaces/{spacekey}',
168
+ updateUserInformation: '/accounts/{accountId}/update-user-information',
169
+ updateUserSpace: '/accounts/{accountid}/ext-users/{extuserid}/spaces/{spacekey}',
170
+ getInvitationsByEmail: '/accounts/{accountid}/invitations-by-email',
171
+ generateSpaceCode: '/accounts/{accountid}/space-code/generate',
172
+ changeSpaceCode: '/accounts/{accountid}/space-code/{spacecode}/change',
173
+ updateInstituteTitle: '/accounts/{accountId}/institute-spaces/{instituteSpaceCode}',
174
+
175
+ //Superuser related API
176
+ getAllInstitutions: '/su/accounts/{accountid}/spaces',
177
+ getInstitution: '/su/accounts/{accountid}/spaces/{spacecode}',
178
+ provisionSpacesToSuperAdmin: '/su/accounts/{accountid}/superadmin/provision-spaces',
179
+
180
+ //Superuser related API
181
+ sendInvitations: '/org/{orgId}/invitations',
182
+ getMultiInvitations: '/org/{orgId}/invitations',
183
+ getSingleInvitation: '/org/{orgId}/invitations/{invitationId}',
184
+ revokeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/revoke',
185
+ completeSingleInvitation: '/org/{orgId}/invitations/{invitationid}/complete',
186
+ resendSingleInvitation: '/org/{orgId}/invitations/{invitationid}/resend',
187
+ //AssignedPath related API
188
+ createAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths',
189
+ deleteAssignedPath: '/org/{orgId}/classes/{classId}/assigned-paths/{assignedPathId}',
190
+
191
+ //Workflows related APIs
192
+ workflows: '/accounts/{accountid}/workflows',
193
+ getAllWorkflowOfAUser: '/accounts/{accountid}/workflows/workflows-by-user',
194
+ getAWorkflow: '/accounts/{accountid}/workflows/{workflowid}',
195
+ acceptAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/accept',
196
+ processAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/process',
197
+ revokeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/revoke',
198
+ completeAWorkflow: '/accounts/{accountid}/workflows/{workflowid}/complete',
199
+
200
+ //Groups realated APIs
201
+ allGroups: '/org/{orgId}/groups',
202
+ aParticularGroup: '/org/{orgId}/groups/{groupId}',
203
+ getAllMembersOfAGroup: '/org/{orgId}/groups/{groupId}/memberships',
204
+ getAllGroupMembersByPath: '/org/{orgId}/groups/memberships',
205
+ userGroupMembership: '/org/{orgId}/groups/{groupId}/enroll-user/multi',
206
+ getMyAllMemberships: '/org/{orgId}/users/{userId}/groups',
207
+ archiveAParticularGroup: '/org/{orgId}/groups/{groupId}/archive',
208
+ unarchiveAParticularGroup: '/org/{orgId}/groups/{groupId}/unarchive',
209
+
210
+ //Showcase related API's
211
+ showcaseItems: '/org/{orgId}/classes/{classId}/showcase/item',
212
+
213
+ //Data-Sync-Manager related APIs
214
+ createDataSyncManager: '/accounts/{accountid}/data-sync-managers',
215
+ dataSyncManager: '/accounts/{accountid}/data-sync-managers/{dsmid}',
216
+ getAllDataSyncManagersOfAGroup: '/accounts/{accountid}/dsm-groups/{dsm_groupid}/data-sync-managers',
217
+
218
+ //Gradebooks related APIs
219
+ createOrGetGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks',
220
+ updateOrDeleteGradebookMeta: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}',
221
+ gradebookColumns: '/org/{orgId}/classes/{classId}/gradebooks/{gradebook_id}/columns',
222
+ getAllClassesOfAComponent: '/org/{orgId}/components/{component_code}/classes',
223
+ removeAllGradebookColumnsOfCustomComponent: '/org/{orgId}/gradebook/columns/custom-components/{component_code}',
224
+
225
+ // Custom Components related APIs
226
+ customComponents: '/org/{orgid}/custom-components',
227
+ particularCustomComponent: '/org/{orgid}/custom-components/{custom_component_code}'
229
228
  };
230
229
 
231
230
  exports.AUTHEXTN_API_URLS = {
232
- // Grade Formats related APIs
233
- gradeFormat: '/org/{orgid}/gradeformats',
234
- particularGradeFormat: '/org/{orgid}/gradeformats/{gradeformat_id}',
235
- classGradeformatAssociation: '/org/{orgid}/classes/{classid}/associate-gradeformats/{gradeformat_id}',
236
- classGradeformats: '/org/{orgid}/classes/{classid}/gradeformats',
237
- gradeformatClasses: '/org/{orgid}/gradeformats/{gradeformat_id}/classes',
231
+ // Grade Formats related APIs
232
+ gradeFormat: '/org/{orgid}/gradeformats',
233
+ particularGradeFormat: '/org/{orgid}/gradeformats/{gradeformat_id}',
234
+ classGradeformatAssociation: '/org/{orgid}/classes/{classid}/associate-gradeformats/{gradeformat_id}',
235
+ classGradeformats: '/org/{orgid}/classes/{classid}/gradeformats',
236
+ gradeformatClasses: '/org/{orgid}/gradeformats/{gradeformat_id}/classes',
238
237
 
239
- //Space related API
240
- entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
238
+ //Space related API
239
+ entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
241
240
 
242
- // Assigned Path APIs
243
- userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
241
+ // Assigned Path APIs
242
+ userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
244
243
 
245
- // Class related APIs
246
- particularClass: '/org/{orgId}/classes/{classId}',
244
+ // Class related APIs
245
+ particularClass: '/org/{orgId}/classes/{classId}',
247
246
 
248
- // Org Entitlement related APIs
249
- orgProductEntitlement: '/org/{orgid}/org-entitlements',
250
- setupUser: '/accounts/{accountId}/user/setup'
251
-
252
- };
253
-
254
- exports.ACTIVITY_API_URLS = {
255
- newAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/start',
256
- activityDetailsAPI: '/{orgId}/products/{productId}/activities/{activityId}',
257
- existingAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}',
258
- userResponseAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}/response',
259
- submitAttemptAPI: '/{orgId}/products/{productId}/activities/{activityId}/attempts/{attemptId}/submit'
247
+ // Org Entitlement related APIs
248
+ orgProductEntitlement: '/org/{orgid}/org-entitlements',
249
+ setupUser: '/accounts/{accountId}/user/setup'
260
250
  };
261
251
 
262
252
  exports.ANALYTICS_API_URLS = {
263
- archiveUserAnalytics: '/{orgId}/archive/user/product',
264
- getOrgAnalyticsStat: '/{orgId}/organization/{type}/stat',
265
- getAnalyticProductItems: '/{orgId}/user/product/progress/items',
266
- getAnalyticProductSummary: '/{orgId}/user/product/progress/summary',
267
- getExternalDataForUserAnalyticItem: '/{orgId}/user/product/progress/items/external-data',
268
- searchUserProductAnalytics: '/{orgId}/user/product/progress/search',
269
- getAnalyticProductById: '/{orgId}/user/product/userprogress/{userProgressId}',
270
- getArchivedUserAnalytics: '/{orgId}/archive',
271
- getClassAnalytics: '/{orgId}/class/{analyticsDataType}/{type}',
272
- getClassEnrolmentsStat: '/{orgId}/class/enrolments/stat',
273
- getClassRecord: '/{orgId}/class/product/class-record',
274
- getClassRecordItemAggregations: '/{orgId}/class/product/item-aggregations',
275
- getClassProductRecentPendingSubmissions: '/{orgId}/class/product/recent-pending-submissions',
276
- getStudentsWithEvaluatedOnce: '/{orgId}/class/product/students-with-evaluations',
277
- getShowcaseRecordOfAClass: '/{orgId}/class/showcase',
278
-
279
- getGroupRecord: '/{orgId}/class/group/product/group-record',
280
- getClassGroupsRecentPendingSubmissions: '/{orgId}/class/group/product/recent-pending-submissions',
281
- getGroupsWithEvaluatedOnce: '/{orgId}/class/group/product/groups-with-evaluations',
282
-
283
- getClassRecordUserAggregations: '/{orgId}/class/product/user-aggregations',
284
- getUserClassRecentSubmissions: '/{orgId}/user/product/class/recent-submissions',
285
- appState: '/{orgId}/user/product/progress/state',
286
- getUserProductAllState: '/{orgId}/user/product/progress/state/all',
287
- updateUserProductMultiState: '/{orgId}/user/product/progress/state/multi',
288
-
289
- //AssignedPaths Related APIs
290
- getAllAssignedPathsOfClass: '/{orgId}/class/assigned-paths',
291
- getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
292
- getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
293
-
294
- timeseriesAnalytics: '/progress/timeseries',
295
-
296
- //ClassCustomComponentRecord Related APIs
297
- getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
298
- getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations',
299
-
300
- //CrossProductAggregation Related APIs
301
- getCrossProductAggregation: '/{orgId}/class/cross-product-aggregation'
302
- };
303
-
304
- exports.COLLAB_API_URLS = {
305
- postsInClassAPI: '/{orgId}/post/classes/{classId}',
306
- postsInProductAPI: '/{orgId}/post/products/{productId}',
307
- getMyFollowers: '/{orgId}/connections/me/followers',
308
- getUsersFollowedByMe: '/{orgId}/connections/me/following',
309
- connectionURL: '/{orgId}/connections/me/follow/{userId}'
253
+ getOrgAnalyticsStat: '/{orgId}/organization/{type}/stat',
254
+ getAnalyticProductItems: '/{orgId}/user/product/progress/items',
255
+ getAnalyticProductSummary: '/{orgId}/user/product/progress/summary',
256
+ getExternalDataForUserAnalyticItem: '/{orgId}/user/product/progress/items/external-data',
257
+ getClassEnrolmentsStat: '/{orgId}/class/enrolments/stat',
258
+ getClassRecord: '/{orgId}/class/product/class-record',
259
+ getClassRecordItemAggregations: '/{orgId}/class/product/item-aggregations',
260
+ getClassProductRecentPendingSubmissions: '/{orgId}/class/product/recent-pending-submissions',
261
+ getStudentsWithEvaluatedOnce: '/{orgId}/class/product/students-with-evaluations',
262
+ getShowcaseRecordOfAClass: '/{orgId}/class/showcase',
263
+
264
+ getGroupRecord: '/{orgId}/class/group/product/group-record',
265
+ getClassGroupsRecentPendingSubmissions: '/{orgId}/class/group/product/recent-pending-submissions',
266
+ getGroupsWithEvaluatedOnce: '/{orgId}/class/group/product/groups-with-evaluations',
267
+
268
+ getClassRecordUserAggregations: '/{orgId}/class/product/user-aggregations',
269
+ getUserClassRecentSubmissions: '/{orgId}/user/product/class/recent-submissions',
270
+
271
+ //AssignedPaths Related APIs
272
+ getAllAssignedPathsOfClass: '/{orgId}/class/assigned-paths',
273
+ getMyAssignedPathsOfClass: '/{orgId}/user/class/assigned-paths',
274
+ getAssignedPathAnalytics: '/{orgId}/class/assigned-paths/aggregations',
275
+
276
+ timeseriesAnalytics: '/progress/timeseries',
277
+
278
+ //ClassCustomComponentRecord Related APIs
279
+ getClassCustomComponentRecord: '/{orgId}/class/custom-component/class-record',
280
+ getClassCustomComponentUserSubmission: '/{orgId}/class/custom-component/class-record/evaluations',
281
+
282
+ //CrossProductAggregation Related APIs
283
+ getCrossProductAggregation: '/{orgId}/class/cross-product-aggregation'
310
284
  };
311
285
 
312
286
  exports.PRODUCT_API_URLS = {
313
- getProductAPI: '/accounts/{accountId}/products/{productCode}',
314
- getEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements',
315
- getMicroEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements/micro',
316
- getAllBundles: '/accounts/{accountId}/bundles',
317
- getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}',
318
- getAllProductFamilies: '/accounts/{accountId}/families',
319
- getSingleProductFamily: '/accounts/{accountId}/families/{familyCode}'
287
+ getProductAPI: '/accounts/{accountId}/products/{productCode}',
288
+ getEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements',
289
+ getMicroEntitlementsOfAUser: '/accounts/{accountId}/ext-users/{extUserId}/entitlements/micro',
290
+ getAllBundles: '/accounts/{accountId}/bundles',
291
+ getSingleBundle: '/accounts/{accountId}/bundles/{bundleCode}',
292
+ getAllProductFamilies: '/accounts/{accountId}/families',
293
+ getSingleProductFamily: '/accounts/{accountId}/families/{familyCode}'
320
294
  };
321
295
 
322
296
  exports.XAPI_API_URLS = {
323
297
  postMultiStatements: '/{orgId}/statements/multi',
324
- postExternalMultiStatements: '/{orgId}/external/statements/multi',
325
- resetUserProductProgress: '/accounts/{accountId}/progress/user/product/reset'
298
+ postExternalMultiStatements: '/{orgId}/external/statements/multi'
326
299
  };
327
300
 
328
301
  exports.ATTEMPTS_API_URLS = {
@@ -335,22 +308,24 @@ exports.ATTEMPTS_API_URLS = {
335
308
  };
336
309
 
337
310
  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'
311
+ promoteAPI: '/{orgId}/products/{productcode}/promote',
312
+ registerProductAPI: '/{orgId}/products/register',
313
+ ingestByCodeAPI: '/{orgId}/products/{productcode}/ingest',
314
+ createBundle: '/{orgid}/stage/{stage}/bundles',
315
+ updateBundle: '/{orgid}/stage/{stage}/bundles/{bundleCode}',
316
+ getAllBundles: '/{orgid}/bundles',
317
+ getSingleBundle: '/{orgid}/bundles/{bundleCode}',
318
+ createProductFamily: '/{orgid}/stage/{stage}/families',
319
+ updateProductFamily: '/{orgid}/stage/{stage}/families/{familyCode}',
320
+ getSingleProductFamily: '/{orgid}/families/{familyCode}',
321
+ getAllProductFamilies: '/{orgid}/families'
349
322
  };
350
323
 
351
324
  exports.PUSHX_API_URLS = {
352
- grantByUserOrgId: '/orgs/{orgId}/grants',
353
- grantByAccountId: '/accounts/{accountId}/grants'
325
+ grantByUserOrgId: '/orgs/{orgId}/grants',
326
+ grantByAccountId: '/accounts/{accountId}/grants',
327
+ grantV2: '/ver/v2/grants',
328
+ getPushedEvents: '/accounts/{accountId}/pushed-events/channels'
354
329
  };
355
330
 
356
331
  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
  }