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.
- package/README.md +1 -137
- package/dist/comprodls-sdk.js +5937 -8432
- package/dist/comprodls-sdk.min.js +15 -1
- package/lib/comprodls.js +39 -57
- package/lib/config/index.js +171 -199
- package/lib/helpers/index.js +3 -2
- package/lib/helpers/lib/api/converter.js +1 -2
- package/lib/helpers/lib/api/index.js +19 -94
- package/lib/helpers/lib/errors.js +73 -80
- package/lib/helpers/lib/requestLayer.js +154 -0
- package/lib/helpers/lib/validator.js +65 -52
- package/lib/open_access/index.js +48 -53
- package/lib/services/analytics/index.js +286 -1014
- package/lib/services/attempts/index.js +38 -88
- package/lib/services/auth/index.js +238 -896
- package/lib/services/authextn/index.js +50 -150
- package/lib/services/datasyncmanager/index.js +10 -45
- package/lib/services/drive/index.js +20 -83
- package/lib/services/integrations/index.js +51 -126
- package/lib/services/invitations/index.js +20 -61
- package/lib/services/product/index.js +74 -85
- package/lib/services/pub/index.js +159 -234
- package/lib/services/pushX/index.js +29 -33
- package/lib/services/pushX/pubnubClientWrapper.js +398 -398
- package/lib/services/rules/index.js +14 -67
- package/lib/services/spaces/index.js +106 -294
- package/lib/services/spacesextn/index.js +4 -24
- package/lib/services/superuser/index.js +21 -36
- package/lib/services/taxonomy/index.js +27 -57
- package/lib/services/workflows/index.js +37 -98
- package/lib/services/xapi/index.js +6 -125
- package/lib/token/index.js +73 -67
- package/lib/token/validations.js +45 -48
- package/package.json +1 -2
- package/lib/helpers/lib/api/validations.js +0 -73
- package/lib/helpers/lib/utils.js +0 -24
- package/lib/services/activity/activity.js +0 -209
- package/lib/services/activity/attempt.js +0 -431
- package/lib/services/activity/index.js +0 -28
- package/lib/services/auth/classProduct.js +0 -37
- 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
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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
|
-
|
|
99
|
-
|
|
86
|
+
this.config = config;
|
|
87
|
+
this.environment = environment;
|
|
100
88
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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;
|
package/lib/config/index.js
CHANGED
|
@@ -121,203 +121,175 @@ exports.REALM_HOSTS = {
|
|
|
121
121
|
};
|
|
122
122
|
|
|
123
123
|
exports.AUTH_API_URLS = {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
241
|
-
|
|
237
|
+
//Space related API
|
|
238
|
+
entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
|
|
242
239
|
|
|
243
|
-
|
|
244
|
-
|
|
240
|
+
// Assigned Path APIs
|
|
241
|
+
userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
|
|
245
242
|
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
// Class related APIs
|
|
244
|
+
particularClass: '/org/{orgId}/classes/{classId}',
|
|
248
245
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
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
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
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 = {
|
package/lib/helpers/index.js
CHANGED
|
@@ -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.
|
|
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
|
}
|