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.
- package/README.md +1 -137
- package/dist/comprodls-sdk.js +2834 -6201
- package/dist/comprodls-sdk.min.js +1 -1
- package/lib/comprodls.js +39 -57
- package/lib/config/index.js +173 -198
- 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 +75 -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 +324 -806
- package/lib/services/authextn/index.js +85 -247
- 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 +82 -85
- package/lib/services/pub/index.js +167 -235
- package/lib/services/pushX/index.js +195 -142
- package/lib/services/pushX/pubnubClientWrapper.js +399 -172
- package/lib/services/rules/index.js +14 -67
- package/lib/services/spaces/index.js +141 -318
- package/lib/services/spacesextn/index.js +44 -20
- package/lib/services/superuser/index.js +21 -36
- package/lib/services/taxonomy/index.js +27 -57
- package/lib/services/workflows/index.js +38 -97
- package/lib/services/xapi/index.js +7 -168
- package/lib/token/index.js +73 -67
- package/lib/token/validations.js +45 -48
- package/package.json +2 -3
- 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/test.js +0 -38
|
@@ -31,9 +31,6 @@ var helpers = require('../../helpers');
|
|
|
31
31
|
|
|
32
32
|
var DLSError = helpers.errors.DLSError;
|
|
33
33
|
|
|
34
|
-
/*********************************
|
|
35
|
-
* Setting Up Module Entry Point
|
|
36
|
-
**********************************/
|
|
37
34
|
module.exports = spaces;
|
|
38
35
|
|
|
39
36
|
var keepaliveAgent = new Agent({
|
|
@@ -70,14 +67,10 @@ function spaces(accountId) {
|
|
|
70
67
|
};
|
|
71
68
|
}
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
spaceOrgContext: 'string', //optional
|
|
78
|
-
details: boolean, //optional
|
|
79
|
-
cursor: 'string' //optional
|
|
80
|
-
}*/
|
|
70
|
+
/**
|
|
71
|
+
* Wiki Link for SDK params
|
|
72
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getuserspacesparams
|
|
73
|
+
*/
|
|
81
74
|
function getUserSpaces(options) {
|
|
82
75
|
var self = this;
|
|
83
76
|
// Initializing promise
|
|
@@ -119,11 +112,10 @@ function getUserSpaces(options) {
|
|
|
119
112
|
return dfd.promise;
|
|
120
113
|
}
|
|
121
114
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}*/
|
|
115
|
+
/**
|
|
116
|
+
* Wiki Link for SDK params
|
|
117
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#validatespacecodeparams
|
|
118
|
+
*/
|
|
127
119
|
function validateSpaceCode(options) {
|
|
128
120
|
var self = this;
|
|
129
121
|
// Initializing promise
|
|
@@ -159,12 +151,10 @@ function validateSpaceCode(options) {
|
|
|
159
151
|
return dfd.promise;
|
|
160
152
|
}
|
|
161
153
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
details: boolean // optional
|
|
167
|
-
}*/
|
|
154
|
+
/**
|
|
155
|
+
* Wiki Link for SDK params
|
|
156
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#validateclasscodeparams
|
|
157
|
+
*/
|
|
168
158
|
function validateClassCode(options) {
|
|
169
159
|
var self = this;
|
|
170
160
|
// Initializing promise
|
|
@@ -205,9 +195,11 @@ function validateClassCode(options) {
|
|
|
205
195
|
|
|
206
196
|
return dfd.promise;
|
|
207
197
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Wiki Link for SDK params
|
|
201
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#generatespacecodeparams
|
|
202
|
+
*/
|
|
211
203
|
function generateSpaceCode(options) {
|
|
212
204
|
var self = this;
|
|
213
205
|
|
|
@@ -220,7 +212,7 @@ function generateSpaceCode(options) {
|
|
|
220
212
|
url = helpers.api.constructAPIUrl(url, { accountid : self.accountId });
|
|
221
213
|
|
|
222
214
|
var bodyParams = {};
|
|
223
|
-
if(options.ignore_words) { bodyParams.ignore_words = options.ignore_words }
|
|
215
|
+
if(options.ignore_words) { bodyParams.ignore_words = options.ignore_words; }
|
|
224
216
|
// Setup request with URL and Params
|
|
225
217
|
var requestAPI = request.post(url)
|
|
226
218
|
.set('Content-Type', 'application/json')
|
|
@@ -239,11 +231,10 @@ function generateSpaceCode(options) {
|
|
|
239
231
|
return dfd.promise;
|
|
240
232
|
}
|
|
241
233
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}*/
|
|
234
|
+
/**
|
|
235
|
+
* Wiki Link for SDK params
|
|
236
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#changespacecodeparams
|
|
237
|
+
*/
|
|
247
238
|
function changeSpaceCode(options) {
|
|
248
239
|
var self = this;
|
|
249
240
|
// Initializing promise
|
|
@@ -255,7 +246,7 @@ function changeSpaceCode(options) {
|
|
|
255
246
|
self.config.AUTH_API_URLS.changeSpaceCode;
|
|
256
247
|
url = helpers.api.constructAPIUrl(url, { accountid : self.accountId, spacecode: options.spacecode });
|
|
257
248
|
var bodyParams = { ext_user_id: options.ext_user_id };
|
|
258
|
-
if(options.ignore_words) { bodyParams.ignore_words = options.ignore_words }
|
|
249
|
+
if(options.ignore_words) { bodyParams.ignore_words = options.ignore_words; }
|
|
259
250
|
// Setup request with URL and Params
|
|
260
251
|
var requestAPI = request.put(url)
|
|
261
252
|
.set('Content-Type', 'application/json')
|
|
@@ -280,72 +271,57 @@ function changeSpaceCode(options) {
|
|
|
280
271
|
return dfd.promise;
|
|
281
272
|
}
|
|
282
273
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
ext_email: 'string', //optional
|
|
288
|
-
ext_first_name: 'string', //optional
|
|
289
|
-
ext_last_name: 'string, //optional
|
|
290
|
-
ref_id: 'string' //optional
|
|
291
|
-
*/
|
|
274
|
+
/**
|
|
275
|
+
* Wiki Link for SDK params
|
|
276
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#joininstitutespaceparams
|
|
277
|
+
*/
|
|
292
278
|
function joinInstituteSpace(options) {
|
|
293
279
|
var self = this;
|
|
294
|
-
// Initializing promise
|
|
295
|
-
var dfd = q.defer();
|
|
296
|
-
|
|
297
|
-
if(options && options.ext_user_id &&
|
|
298
|
-
options.ext_role && options.space_code)
|
|
299
|
-
{
|
|
300
|
-
// Passed all validations, Contruct API url
|
|
301
|
-
var url = self.config.DEFAULT_HOSTS.AUTH +
|
|
302
|
-
self.config.AUTH_API_URLS.joinInstituteSpace;
|
|
303
|
-
url = helpers.api.constructAPIUrl(url, { accountid : self.accountId });
|
|
304
280
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
.set('Accept', 'application/json')
|
|
309
|
-
.send(options);
|
|
310
|
-
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
281
|
+
return new Promise(function(resolve, reject) {
|
|
282
|
+
if (options && options.ext_user_id && options.ext_role) {
|
|
283
|
+
// Passed all validations, Contruct API url
|
|
311
284
|
|
|
312
|
-
|
|
313
|
-
if(
|
|
314
|
-
|
|
315
|
-
|
|
285
|
+
var url;
|
|
286
|
+
if (options.ext_role === 'student') {
|
|
287
|
+
url = self.config.DEFAULT_HOSTS.AUTH +
|
|
288
|
+
self.config.AUTH_API_URLS.provisionStudentInInstitutionalSpace;
|
|
316
289
|
}
|
|
317
|
-
else {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
err.message = err.description = 'ext_user_id or ext_role or space_code not found in request options.';
|
|
322
|
-
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
323
|
-
dfd.reject(err);
|
|
324
|
-
}
|
|
290
|
+
else {
|
|
291
|
+
url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.joinInstituteSpace;
|
|
292
|
+
}
|
|
293
|
+
url = helpers.api.constructAPIUrl(url, { accountid : self.accountId });
|
|
325
294
|
|
|
326
|
-
|
|
295
|
+
// Setup request with URL and Params
|
|
296
|
+
var requestAPI = request.post(url)
|
|
297
|
+
.set('Content-Type', 'application/json')
|
|
298
|
+
.set('Accept', 'application/json');
|
|
299
|
+
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
300
|
+
|
|
301
|
+
requestAPI
|
|
302
|
+
.send(options)
|
|
303
|
+
.agent(keepaliveAgent)
|
|
304
|
+
.end(function(error, response) {
|
|
305
|
+
if (error) {
|
|
306
|
+
var err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
307
|
+
reject(err);
|
|
308
|
+
}
|
|
309
|
+
else { resolve(response.body); }
|
|
310
|
+
});
|
|
311
|
+
} else {
|
|
312
|
+
var err = {};
|
|
313
|
+
err.message = err.description = 'ext_user_id or ext_role not found' +
|
|
314
|
+
' in request options.';
|
|
315
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
316
|
+
reject(err);
|
|
317
|
+
}
|
|
318
|
+
});
|
|
327
319
|
}
|
|
328
320
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
ext_first_name: 'string',
|
|
334
|
-
ext_last_name: 'string',
|
|
335
|
-
ext_email: 'string',
|
|
336
|
-
ref_id: 'string', (optional)
|
|
337
|
-
class_code: 'string' (optional)
|
|
338
|
-
products: [{
|
|
339
|
-
productcode: 'string',
|
|
340
|
-
ext_product_id: 'string',
|
|
341
|
-
ext_product_meta: {
|
|
342
|
-
startdate: 'string',
|
|
343
|
-
enddate: 'string',
|
|
344
|
-
...
|
|
345
|
-
},
|
|
346
|
-
ext_data: {}
|
|
347
|
-
}]
|
|
348
|
-
}*/
|
|
321
|
+
/**
|
|
322
|
+
* Wiki Link for SDK params
|
|
323
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionspacestostudentparams
|
|
324
|
+
*/
|
|
349
325
|
function provisionSpacesToStudent(options) {
|
|
350
326
|
var self = this;
|
|
351
327
|
// Initializing promise
|
|
@@ -383,15 +359,8 @@ function provisionSpacesToStudent(options) {
|
|
|
383
359
|
}
|
|
384
360
|
|
|
385
361
|
/**
|
|
386
|
-
*
|
|
387
|
-
*
|
|
388
|
-
* ext_user_id: "string",
|
|
389
|
-
* ext_role: "string",
|
|
390
|
-
* ext_first_name: "string",
|
|
391
|
-
* ext_last_name: "string",
|
|
392
|
-
* ext_email: "string",
|
|
393
|
-
* ref_id: "string"
|
|
394
|
-
* };
|
|
362
|
+
* Wiki Link for SDK params
|
|
363
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionspacestoteacherparams
|
|
395
364
|
*/
|
|
396
365
|
function provisionSpacesToTeacher(options) {
|
|
397
366
|
var self = this;
|
|
@@ -430,40 +399,8 @@ function provisionSpacesToTeacher(options) {
|
|
|
430
399
|
}
|
|
431
400
|
|
|
432
401
|
/**
|
|
433
|
-
*
|
|
434
|
-
|
|
435
|
-
"ext_data": {} //optional, external data(e.g. jobdata etc.)
|
|
436
|
-
"users": [ // mandatory, min: 1, max: 200
|
|
437
|
-
{
|
|
438
|
-
"ext_user_id": "string", // mandatory (it must be unique within users array)
|
|
439
|
-
"ext_parent_id": "string",
|
|
440
|
-
"ext_username": "string",
|
|
441
|
-
"ext_role": "student", // mandatory
|
|
442
|
-
"ext_email": "string",
|
|
443
|
-
"ext_first_name": "string", // mandatory
|
|
444
|
-
"ext_last_name": "string", // mandatory
|
|
445
|
-
"address": "string",
|
|
446
|
-
"rowId": "string", // mandatory (it must be unique within users array)
|
|
447
|
-
"classes": [ // optional, min: 1, max: 3
|
|
448
|
-
{
|
|
449
|
-
"classid": "string", // either of classid or class_code them must be
|
|
450
|
-
"class_code": "string" // present, classid is preferred
|
|
451
|
-
}
|
|
452
|
-
],
|
|
453
|
-
"products": [ // optional, min: 1
|
|
454
|
-
{
|
|
455
|
-
"productcode": "string", // mandatory
|
|
456
|
-
"ext_product_meta": {
|
|
457
|
-
"startdate": "epoch",
|
|
458
|
-
"enddate": "epoch" // mandatory
|
|
459
|
-
}
|
|
460
|
-
"ext_data" : {} // optional, external data (e.g., ref_id, ...)
|
|
461
|
-
}
|
|
462
|
-
]
|
|
463
|
-
}
|
|
464
|
-
]
|
|
465
|
-
}
|
|
466
|
-
*
|
|
402
|
+
* Wiki Link for SDK params
|
|
403
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionbulkspacesparams
|
|
467
404
|
*/
|
|
468
405
|
function provisionBulkSpaces(options) {
|
|
469
406
|
var self = this;
|
|
@@ -508,52 +445,8 @@ function provisionBulkSpaces(options) {
|
|
|
508
445
|
}
|
|
509
446
|
|
|
510
447
|
/**
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
* *ext_role": 'string',
|
|
514
|
-
* ext_first_name: 'string',
|
|
515
|
-
* ext_last_name: 'string',
|
|
516
|
-
* ext_email: 'string',
|
|
517
|
-
* address: {
|
|
518
|
-
* country:'string'
|
|
519
|
-
* },
|
|
520
|
-
* ref_id: 'string',
|
|
521
|
-
* ext_classid : 'string',
|
|
522
|
-
* ext_class_meta : {
|
|
523
|
-
* *title: 'string',
|
|
524
|
-
* *startdate: <epoch>,
|
|
525
|
-
* *enddate: <epoch>,
|
|
526
|
-
* description: 'string',
|
|
527
|
-
* ext_data: {},
|
|
528
|
-
* limits: {
|
|
529
|
-
* *los: 0,
|
|
530
|
-
* *students: 0
|
|
531
|
-
* }
|
|
532
|
-
* },
|
|
533
|
-
* checkLimits: {
|
|
534
|
-
* student: 0,
|
|
535
|
-
* teacher: 0
|
|
536
|
-
* },
|
|
537
|
-
* clone_settings: {
|
|
538
|
-
* *src_ext_classid: 'string',
|
|
539
|
-
* products: boolean,
|
|
540
|
-
* assigned_paths: boolean,
|
|
541
|
-
* ext_assigned_path_id_rule: 'string' //enum: ['SRC_ID']
|
|
542
|
-
* advanced: {
|
|
543
|
-
* assigned_paths: [ //length > 0 if assigned_paths flag is true
|
|
544
|
-
* {
|
|
545
|
-
* *ext_assignedpathid: 'string',
|
|
546
|
-
* *assigned_path_id: 'string',
|
|
547
|
-
* startdate: 0,
|
|
548
|
-
* *duedate: 0
|
|
549
|
-
* },
|
|
550
|
-
* ],
|
|
551
|
-
* products: [
|
|
552
|
-
* { *productcode: 'string' },
|
|
553
|
-
* ]
|
|
554
|
-
* }
|
|
555
|
-
* }
|
|
556
|
-
* }
|
|
448
|
+
* Wiki Link for SDK params
|
|
449
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#shadowprovisionparams
|
|
557
450
|
*/
|
|
558
451
|
function shadowProvision(options) {
|
|
559
452
|
var self = this;
|
|
@@ -591,21 +484,10 @@ function shadowProvision(options) {
|
|
|
591
484
|
return dfd.promise;
|
|
592
485
|
}
|
|
593
486
|
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
ref_id: 'string', (optional)
|
|
599
|
-
productcode: 'string',
|
|
600
|
-
ext_product_id: 'string',
|
|
601
|
-
ext_product_meta: {
|
|
602
|
-
startdate: 'string',
|
|
603
|
-
enddate: 'string',
|
|
604
|
-
...
|
|
605
|
-
},
|
|
606
|
-
ext_data: {},
|
|
607
|
-
audit: boolean
|
|
608
|
-
}*/
|
|
487
|
+
/**
|
|
488
|
+
* Wiki Link for SDK params
|
|
489
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#entitleusertoproductparams
|
|
490
|
+
*/
|
|
609
491
|
function entitleUserToProduct(options) {
|
|
610
492
|
var self = this;
|
|
611
493
|
// Initializing promise
|
|
@@ -636,7 +518,7 @@ function entitleUserToProduct(options) {
|
|
|
636
518
|
} else {
|
|
637
519
|
var err = {};
|
|
638
520
|
err.description = 'Missing mandatory keys in request options. \'ext_user_id\', \'ext_role\' and ' +
|
|
639
|
-
'either of \'ext_product_id\' or \'productcode\' must be present.'
|
|
521
|
+
'either of \'ext_product_id\' or \'productcode\' must be present.';
|
|
640
522
|
err.message = err.description;
|
|
641
523
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
642
524
|
dfd.reject(err);
|
|
@@ -645,12 +527,10 @@ function entitleUserToProduct(options) {
|
|
|
645
527
|
return dfd.promise;
|
|
646
528
|
}
|
|
647
529
|
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
audit: 'boolean'
|
|
653
|
-
}*/
|
|
530
|
+
/**
|
|
531
|
+
* Wiki Link for SDK params
|
|
532
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#unentitleusertoproductparams
|
|
533
|
+
*/
|
|
654
534
|
function unentitleUserToProduct(options) {
|
|
655
535
|
var self = this;
|
|
656
536
|
var dfd = q.defer();
|
|
@@ -693,22 +573,10 @@ function unentitleUserToProduct(options) {
|
|
|
693
573
|
return dfd.promise;
|
|
694
574
|
}
|
|
695
575
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
"feature_key": "string", // Mandatory
|
|
701
|
-
"feature_id": "string", // Mandatory
|
|
702
|
-
"context": "string", // Mandatory
|
|
703
|
-
"data": {}, // Optional
|
|
704
|
-
"productcode": "string", // one of productcode and ext_product_id is mandatory
|
|
705
|
-
"ext_product_id": "string",
|
|
706
|
-
"ext_entitlement_meta": { //Optional
|
|
707
|
-
"startdate": "epoch",
|
|
708
|
-
"enddate": "epoch" //mandatory, if ext_entitlement_meta provided.
|
|
709
|
-
},
|
|
710
|
-
"audit": boolean // Optional
|
|
711
|
-
}*/
|
|
576
|
+
/**
|
|
577
|
+
* Wiki Link for SDK params
|
|
578
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#microentitleusertoproductparams
|
|
579
|
+
*/
|
|
712
580
|
function microEntitleUserToProduct(options) {
|
|
713
581
|
var self = this;
|
|
714
582
|
// Initializing promise
|
|
@@ -759,30 +627,10 @@ function microEntitleUserToProduct(options) {
|
|
|
759
627
|
return dfd.promise;
|
|
760
628
|
}
|
|
761
629
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
"productcode": "string",
|
|
768
|
-
"ext_product_id": "string",
|
|
769
|
-
|
|
770
|
-
"context": "string",
|
|
771
|
-
"feature_key": "string",
|
|
772
|
-
"feature_id": "string",,
|
|
773
|
-
"data": {},
|
|
774
|
-
"ext_entitlement_meta": {
|
|
775
|
-
"startdate": 0,
|
|
776
|
-
"enddate": 0
|
|
777
|
-
},
|
|
778
|
-
|
|
779
|
-
"ext_actor_id": "string", // Mandatory if 'audit' is true
|
|
780
|
-
"audit": true
|
|
781
|
-
},
|
|
782
|
-
…
|
|
783
|
-
]
|
|
784
|
-
}
|
|
785
|
-
*/
|
|
630
|
+
/**
|
|
631
|
+
* Wiki Link for SDK params
|
|
632
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#bulkmicroentitleproducttouserparams
|
|
633
|
+
*/
|
|
786
634
|
function bulkMicroEntitleProductToUser(options) {
|
|
787
635
|
var self = this;
|
|
788
636
|
// Initializing promise
|
|
@@ -812,7 +660,7 @@ function bulkMicroEntitleProductToUser(options) {
|
|
|
812
660
|
} else {
|
|
813
661
|
var err = {};
|
|
814
662
|
err.description = 'Missing mandatory keys in request options.' +
|
|
815
|
-
' \'micro-entitlements\' must be present.'
|
|
663
|
+
' \'micro-entitlements\' must be present.';
|
|
816
664
|
err.message = err.description;
|
|
817
665
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
818
666
|
dfd.reject(err);
|
|
@@ -821,16 +669,10 @@ function bulkMicroEntitleProductToUser(options) {
|
|
|
821
669
|
return dfd.promise;
|
|
822
670
|
}
|
|
823
671
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
"feature_key": "string", // Mandatory
|
|
829
|
-
"context": "string", // Mandatory
|
|
830
|
-
"productcode": "string", // one of productcode and ext_product_id is mandatory
|
|
831
|
-
"ext_product_id": "string",
|
|
832
|
-
"audit": boolean // Mandatory
|
|
833
|
-
}*/
|
|
672
|
+
/**
|
|
673
|
+
* Wiki Link for SDK params
|
|
674
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#revokemicroentitlementofauserparams
|
|
675
|
+
*/
|
|
834
676
|
function revokeMicroEntitlementOfAUser(options) {
|
|
835
677
|
var self = this;
|
|
836
678
|
// Initializing promise
|
|
@@ -875,9 +717,10 @@ function revokeMicroEntitlementOfAUser(options) {
|
|
|
875
717
|
return dfd.promise;
|
|
876
718
|
}
|
|
877
719
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
720
|
+
/**
|
|
721
|
+
* Wiki Link for SDK params
|
|
722
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getextproductparams
|
|
723
|
+
*/
|
|
881
724
|
function getExtProduct(options) {
|
|
882
725
|
var self = this;
|
|
883
726
|
// Initializing promise
|
|
@@ -911,9 +754,10 @@ function getExtProduct(options) {
|
|
|
911
754
|
return dfd.promise;
|
|
912
755
|
}
|
|
913
756
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
757
|
+
/**
|
|
758
|
+
* Wiki Link for SDK params
|
|
759
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getspacedetailsparams
|
|
760
|
+
*/
|
|
917
761
|
function getSpaceDetails(options) {
|
|
918
762
|
var self = this;
|
|
919
763
|
// Initializing promise
|
|
@@ -950,15 +794,10 @@ function getSpaceDetails(options) {
|
|
|
950
794
|
return dfd.promise;
|
|
951
795
|
}
|
|
952
796
|
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
ext_last_name: 'string',
|
|
958
|
-
ext_email: 'string',
|
|
959
|
-
ref_id: 'string', (optional)
|
|
960
|
-
class_code: 'string'
|
|
961
|
-
}*/
|
|
797
|
+
/**
|
|
798
|
+
* Wiki Link for SDK params
|
|
799
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#enrolluserinclassparams
|
|
800
|
+
*/
|
|
962
801
|
function enrollUserInClass(options) {
|
|
963
802
|
var self = this;
|
|
964
803
|
// Initializing promise
|
|
@@ -997,14 +836,8 @@ function enrollUserInClass(options) {
|
|
|
997
836
|
}
|
|
998
837
|
|
|
999
838
|
/**
|
|
1000
|
-
*
|
|
1001
|
-
*
|
|
1002
|
-
* "ext_user_id": "string",
|
|
1003
|
-
* "ref_id": "string", // optional
|
|
1004
|
-
* "ext_email": "string", // optional
|
|
1005
|
-
* "ext_first_name": "string", // optional
|
|
1006
|
-
* "ext_last_name": "string" // optional
|
|
1007
|
-
* };
|
|
839
|
+
* Wiki Link for SDK params
|
|
840
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateuserinformationparams
|
|
1008
841
|
*/
|
|
1009
842
|
function updateUserInformation(options) {
|
|
1010
843
|
var self = this;
|
|
@@ -1050,9 +883,8 @@ function updateUserInformation(options) {
|
|
|
1050
883
|
}
|
|
1051
884
|
|
|
1052
885
|
/**
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
* @returns {promise}
|
|
886
|
+
* Wiki Link for SDK params
|
|
887
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateuserspaceparams
|
|
1056
888
|
*/
|
|
1057
889
|
function updateUserSpace(options) {
|
|
1058
890
|
var self = this;
|
|
@@ -1096,56 +928,47 @@ function updateUserSpace(options) {
|
|
|
1096
928
|
return deferred.promise;
|
|
1097
929
|
}
|
|
1098
930
|
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
*/
|
|
931
|
+
/**
|
|
932
|
+
* Wiki Link for SDK params
|
|
933
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getinvitationsbyemailparams
|
|
934
|
+
*/
|
|
1104
935
|
function getInvitationsByEmail(options) {
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
936
|
+
var self = this;
|
|
937
|
+
// Initializing promise
|
|
938
|
+
var dfd = q.defer();
|
|
939
|
+
var err = {};
|
|
940
|
+
if (options && options.email) {
|
|
1110
941
|
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
942
|
+
// Passed all validations, Contruct API url
|
|
943
|
+
var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getInvitationsByEmail;
|
|
944
|
+
url = helpers.api.constructAPIUrl(url, { accountid: self.accountId });
|
|
1114
945
|
|
|
1115
|
-
|
|
1116
|
-
|
|
946
|
+
var queryParam = { email: options.email };
|
|
947
|
+
if (options.status) { queryParam.status = options.status; }
|
|
1117
948
|
|
|
1118
|
-
|
|
949
|
+
// Setup request with URL and Params
|
|
1119
950
|
var requestAPI = request.get(url).query(queryParam);
|
|
1120
951
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1121
952
|
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
953
|
+
requestAPI.end(function (error, response) {
|
|
954
|
+
if (error) {
|
|
955
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
956
|
+
dfd.reject(err);
|
|
957
|
+
}
|
|
958
|
+
else { dfd.resolve(response.body); }
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
else {
|
|
962
|
+
err.message = err.description = 'email not found in request options.';
|
|
963
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
964
|
+
dfd.reject(err);
|
|
965
|
+
}
|
|
966
|
+
return dfd.promise;
|
|
1136
967
|
}
|
|
1137
968
|
|
|
1138
969
|
/**
|
|
1139
|
-
*
|
|
1140
|
-
*
|
|
1141
|
-
* space_code: "", // Mandatory, space code of institute whose title is to be updated
|
|
1142
|
-
* body : {
|
|
1143
|
-
* ext_actor_id: "", // Mandatory
|
|
1144
|
-
* data: {
|
|
1145
|
-
* space_title: ""
|
|
1146
|
-
* }
|
|
1147
|
-
* }
|
|
1148
|
-
* }
|
|
970
|
+
* Wiki Link for SDK params
|
|
971
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateinstitutetitleparams
|
|
1149
972
|
*/
|
|
1150
973
|
function updateInstituteTitle(options){
|
|
1151
974
|
var self = this;
|