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
|
@@ -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,15 +271,10 @@ 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
280
|
// Initializing promise
|
|
@@ -326,26 +312,10 @@ function joinInstituteSpace(options) {
|
|
|
326
312
|
return dfd.promise;
|
|
327
313
|
}
|
|
328
314
|
|
|
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
|
-
}*/
|
|
315
|
+
/**
|
|
316
|
+
* Wiki Link for SDK params
|
|
317
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionspacestostudentparams
|
|
318
|
+
*/
|
|
349
319
|
function provisionSpacesToStudent(options) {
|
|
350
320
|
var self = this;
|
|
351
321
|
// Initializing promise
|
|
@@ -383,15 +353,8 @@ function provisionSpacesToStudent(options) {
|
|
|
383
353
|
}
|
|
384
354
|
|
|
385
355
|
/**
|
|
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
|
-
* };
|
|
356
|
+
* Wiki Link for SDK params
|
|
357
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionspacestoteacherparams
|
|
395
358
|
*/
|
|
396
359
|
function provisionSpacesToTeacher(options) {
|
|
397
360
|
var self = this;
|
|
@@ -430,40 +393,8 @@ function provisionSpacesToTeacher(options) {
|
|
|
430
393
|
}
|
|
431
394
|
|
|
432
395
|
/**
|
|
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
|
-
*
|
|
396
|
+
* Wiki Link for SDK params
|
|
397
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#provisionbulkspacesparams
|
|
467
398
|
*/
|
|
468
399
|
function provisionBulkSpaces(options) {
|
|
469
400
|
var self = this;
|
|
@@ -508,57 +439,8 @@ function provisionBulkSpaces(options) {
|
|
|
508
439
|
}
|
|
509
440
|
|
|
510
441
|
/**
|
|
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_class_title : 'string',
|
|
528
|
-
* ext_data: {},
|
|
529
|
-
* limits: {
|
|
530
|
-
* *los: 0,
|
|
531
|
-
* *students: 0
|
|
532
|
-
* }
|
|
533
|
-
* },
|
|
534
|
-
* checkLimits: {
|
|
535
|
-
* student: 0,
|
|
536
|
-
* teacher: 0
|
|
537
|
-
* },
|
|
538
|
-
* clone_settings: {
|
|
539
|
-
* *src_ext_classid: 'string',
|
|
540
|
-
* products: boolean,
|
|
541
|
-
* bundles: boolean,
|
|
542
|
-
* assigned_paths: boolean,
|
|
543
|
-
* ext_assigned_path_id_rule: 'string' //enum: ['SRC_ID']
|
|
544
|
-
* advanced: {
|
|
545
|
-
* assigned_paths: [ //length > 0 if assigned_paths flag is true
|
|
546
|
-
* {
|
|
547
|
-
* *ext_assignedpathid: 'string',
|
|
548
|
-
* *assigned_path_id: 'string',
|
|
549
|
-
* startdate: 0,
|
|
550
|
-
* *duedate: 0
|
|
551
|
-
* },
|
|
552
|
-
* ],
|
|
553
|
-
* products: [
|
|
554
|
-
* { *productcode: 'string' },
|
|
555
|
-
* ],
|
|
556
|
-
* bundles: [
|
|
557
|
-
* { *bundlecode: 'string' },
|
|
558
|
-
* ]
|
|
559
|
-
* }
|
|
560
|
-
* }
|
|
561
|
-
* }
|
|
442
|
+
* Wiki Link for SDK params
|
|
443
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#shadowprovisionparams
|
|
562
444
|
*/
|
|
563
445
|
function shadowProvision(options) {
|
|
564
446
|
var self = this;
|
|
@@ -596,21 +478,10 @@ function shadowProvision(options) {
|
|
|
596
478
|
return dfd.promise;
|
|
597
479
|
}
|
|
598
480
|
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
ref_id: 'string', (optional)
|
|
604
|
-
productcode: 'string',
|
|
605
|
-
ext_product_id: 'string',
|
|
606
|
-
ext_product_meta: {
|
|
607
|
-
startdate: 'string',
|
|
608
|
-
enddate: 'string',
|
|
609
|
-
...
|
|
610
|
-
},
|
|
611
|
-
ext_data: {},
|
|
612
|
-
audit: boolean
|
|
613
|
-
}*/
|
|
481
|
+
/**
|
|
482
|
+
* Wiki Link for SDK params
|
|
483
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#entitleusertoproductparams
|
|
484
|
+
*/
|
|
614
485
|
function entitleUserToProduct(options) {
|
|
615
486
|
var self = this;
|
|
616
487
|
// Initializing promise
|
|
@@ -641,7 +512,7 @@ function entitleUserToProduct(options) {
|
|
|
641
512
|
} else {
|
|
642
513
|
var err = {};
|
|
643
514
|
err.description = 'Missing mandatory keys in request options. \'ext_user_id\', \'ext_role\' and ' +
|
|
644
|
-
'either of \'ext_product_id\' or \'productcode\' must be present.'
|
|
515
|
+
'either of \'ext_product_id\' or \'productcode\' must be present.';
|
|
645
516
|
err.message = err.description;
|
|
646
517
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
647
518
|
dfd.reject(err);
|
|
@@ -650,12 +521,10 @@ function entitleUserToProduct(options) {
|
|
|
650
521
|
return dfd.promise;
|
|
651
522
|
}
|
|
652
523
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
audit: 'boolean'
|
|
658
|
-
}*/
|
|
524
|
+
/**
|
|
525
|
+
* Wiki Link for SDK params
|
|
526
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#unentitleusertoproductparams
|
|
527
|
+
*/
|
|
659
528
|
function unentitleUserToProduct(options) {
|
|
660
529
|
var self = this;
|
|
661
530
|
var dfd = q.defer();
|
|
@@ -698,22 +567,10 @@ function unentitleUserToProduct(options) {
|
|
|
698
567
|
return dfd.promise;
|
|
699
568
|
}
|
|
700
569
|
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
"feature_key": "string", // Mandatory
|
|
706
|
-
"feature_id": "string", // Mandatory
|
|
707
|
-
"context": "string", // Mandatory
|
|
708
|
-
"data": {}, // Optional
|
|
709
|
-
"productcode": "string", // one of productcode and ext_product_id is mandatory
|
|
710
|
-
"ext_product_id": "string",
|
|
711
|
-
"ext_entitlement_meta": { //Optional
|
|
712
|
-
"startdate": "epoch",
|
|
713
|
-
"enddate": "epoch" //mandatory, if ext_entitlement_meta provided.
|
|
714
|
-
},
|
|
715
|
-
"audit": boolean // Optional
|
|
716
|
-
}*/
|
|
570
|
+
/**
|
|
571
|
+
* Wiki Link for SDK params
|
|
572
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#microentitleusertoproductparams
|
|
573
|
+
*/
|
|
717
574
|
function microEntitleUserToProduct(options) {
|
|
718
575
|
var self = this;
|
|
719
576
|
// Initializing promise
|
|
@@ -764,30 +621,10 @@ function microEntitleUserToProduct(options) {
|
|
|
764
621
|
return dfd.promise;
|
|
765
622
|
}
|
|
766
623
|
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
"productcode": "string",
|
|
773
|
-
"ext_product_id": "string",
|
|
774
|
-
|
|
775
|
-
"context": "string",
|
|
776
|
-
"feature_key": "string",
|
|
777
|
-
"feature_id": "string",,
|
|
778
|
-
"data": {},
|
|
779
|
-
"ext_entitlement_meta": {
|
|
780
|
-
"startdate": 0,
|
|
781
|
-
"enddate": 0
|
|
782
|
-
},
|
|
783
|
-
|
|
784
|
-
"ext_actor_id": "string", // Mandatory if 'audit' is true
|
|
785
|
-
"audit": true
|
|
786
|
-
},
|
|
787
|
-
…
|
|
788
|
-
]
|
|
789
|
-
}
|
|
790
|
-
*/
|
|
624
|
+
/**
|
|
625
|
+
* Wiki Link for SDK params
|
|
626
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#bulkmicroentitleproducttouserparams
|
|
627
|
+
*/
|
|
791
628
|
function bulkMicroEntitleProductToUser(options) {
|
|
792
629
|
var self = this;
|
|
793
630
|
// Initializing promise
|
|
@@ -817,7 +654,7 @@ function bulkMicroEntitleProductToUser(options) {
|
|
|
817
654
|
} else {
|
|
818
655
|
var err = {};
|
|
819
656
|
err.description = 'Missing mandatory keys in request options.' +
|
|
820
|
-
' \'micro-entitlements\' must be present.'
|
|
657
|
+
' \'micro-entitlements\' must be present.';
|
|
821
658
|
err.message = err.description;
|
|
822
659
|
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
823
660
|
dfd.reject(err);
|
|
@@ -826,16 +663,10 @@ function bulkMicroEntitleProductToUser(options) {
|
|
|
826
663
|
return dfd.promise;
|
|
827
664
|
}
|
|
828
665
|
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
"feature_key": "string", // Mandatory
|
|
834
|
-
"context": "string", // Mandatory
|
|
835
|
-
"productcode": "string", // one of productcode and ext_product_id is mandatory
|
|
836
|
-
"ext_product_id": "string",
|
|
837
|
-
"audit": boolean // Mandatory
|
|
838
|
-
}*/
|
|
666
|
+
/**
|
|
667
|
+
* Wiki Link for SDK params
|
|
668
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#revokemicroentitlementofauserparams
|
|
669
|
+
*/
|
|
839
670
|
function revokeMicroEntitlementOfAUser(options) {
|
|
840
671
|
var self = this;
|
|
841
672
|
// Initializing promise
|
|
@@ -880,9 +711,10 @@ function revokeMicroEntitlementOfAUser(options) {
|
|
|
880
711
|
return dfd.promise;
|
|
881
712
|
}
|
|
882
713
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
714
|
+
/**
|
|
715
|
+
* Wiki Link for SDK params
|
|
716
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getextproductparams
|
|
717
|
+
*/
|
|
886
718
|
function getExtProduct(options) {
|
|
887
719
|
var self = this;
|
|
888
720
|
// Initializing promise
|
|
@@ -916,9 +748,10 @@ function getExtProduct(options) {
|
|
|
916
748
|
return dfd.promise;
|
|
917
749
|
}
|
|
918
750
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
751
|
+
/**
|
|
752
|
+
* Wiki Link for SDK params
|
|
753
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getspacedetailsparams
|
|
754
|
+
*/
|
|
922
755
|
function getSpaceDetails(options) {
|
|
923
756
|
var self = this;
|
|
924
757
|
// Initializing promise
|
|
@@ -955,15 +788,10 @@ function getSpaceDetails(options) {
|
|
|
955
788
|
return dfd.promise;
|
|
956
789
|
}
|
|
957
790
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
ext_last_name: 'string',
|
|
963
|
-
ext_email: 'string',
|
|
964
|
-
ref_id: 'string', (optional)
|
|
965
|
-
class_code: 'string'
|
|
966
|
-
}*/
|
|
791
|
+
/**
|
|
792
|
+
* Wiki Link for SDK params
|
|
793
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#enrolluserinclassparams
|
|
794
|
+
*/
|
|
967
795
|
function enrollUserInClass(options) {
|
|
968
796
|
var self = this;
|
|
969
797
|
// Initializing promise
|
|
@@ -1002,14 +830,8 @@ function enrollUserInClass(options) {
|
|
|
1002
830
|
}
|
|
1003
831
|
|
|
1004
832
|
/**
|
|
1005
|
-
*
|
|
1006
|
-
*
|
|
1007
|
-
* "ext_user_id": "string",
|
|
1008
|
-
* "ref_id": "string", // optional
|
|
1009
|
-
* "ext_email": "string", // optional
|
|
1010
|
-
* "ext_first_name": "string", // optional
|
|
1011
|
-
* "ext_last_name": "string" // optional
|
|
1012
|
-
* };
|
|
833
|
+
* Wiki Link for SDK params
|
|
834
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateuserinformationparams
|
|
1013
835
|
*/
|
|
1014
836
|
function updateUserInformation(options) {
|
|
1015
837
|
var self = this;
|
|
@@ -1055,9 +877,8 @@ function updateUserInformation(options) {
|
|
|
1055
877
|
}
|
|
1056
878
|
|
|
1057
879
|
/**
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
* @returns {promise}
|
|
880
|
+
* Wiki Link for SDK params
|
|
881
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateuserspaceparams
|
|
1061
882
|
*/
|
|
1062
883
|
function updateUserSpace(options) {
|
|
1063
884
|
var self = this;
|
|
@@ -1101,56 +922,47 @@ function updateUserSpace(options) {
|
|
|
1101
922
|
return deferred.promise;
|
|
1102
923
|
}
|
|
1103
924
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
*/
|
|
925
|
+
/**
|
|
926
|
+
* Wiki Link for SDK params
|
|
927
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#getinvitationsbyemailparams
|
|
928
|
+
*/
|
|
1109
929
|
function getInvitationsByEmail(options) {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
930
|
+
var self = this;
|
|
931
|
+
// Initializing promise
|
|
932
|
+
var dfd = q.defer();
|
|
933
|
+
var err = {};
|
|
934
|
+
if (options && options.email) {
|
|
1115
935
|
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
936
|
+
// Passed all validations, Contruct API url
|
|
937
|
+
var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getInvitationsByEmail;
|
|
938
|
+
url = helpers.api.constructAPIUrl(url, { accountid: self.accountId });
|
|
1119
939
|
|
|
1120
|
-
|
|
1121
|
-
|
|
940
|
+
var queryParam = { email: options.email };
|
|
941
|
+
if (options.status) { queryParam.status = options.status; }
|
|
1122
942
|
|
|
1123
|
-
|
|
943
|
+
// Setup request with URL and Params
|
|
1124
944
|
var requestAPI = request.get(url).query(queryParam);
|
|
1125
945
|
if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1126
946
|
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
947
|
+
requestAPI.end(function (error, response) {
|
|
948
|
+
if (error) {
|
|
949
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
950
|
+
dfd.reject(err);
|
|
951
|
+
}
|
|
952
|
+
else { dfd.resolve(response.body); }
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
else {
|
|
956
|
+
err.message = err.description = 'email not found in request options.';
|
|
957
|
+
err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
|
|
958
|
+
dfd.reject(err);
|
|
959
|
+
}
|
|
960
|
+
return dfd.promise;
|
|
1141
961
|
}
|
|
1142
962
|
|
|
1143
963
|
/**
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1146
|
-
* space_code: "", // Mandatory, space code of institute whose title is to be updated
|
|
1147
|
-
* body : {
|
|
1148
|
-
* ext_actor_id: "", // Mandatory
|
|
1149
|
-
* data: {
|
|
1150
|
-
* space_title: ""
|
|
1151
|
-
* }
|
|
1152
|
-
* }
|
|
1153
|
-
* }
|
|
964
|
+
* Wiki Link for SDK params
|
|
965
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/18_Spaces-Adapter#updateinstitutetitleparams
|
|
1154
966
|
*/
|
|
1155
967
|
function updateInstituteTitle(options){
|
|
1156
968
|
var self = this;
|
|
@@ -30,9 +30,6 @@ var Agent = require('agentkeepalive');
|
|
|
30
30
|
var helpers = require('../../helpers');
|
|
31
31
|
var DLSError = helpers.errors.DLSError;
|
|
32
32
|
|
|
33
|
-
/*********************************
|
|
34
|
-
* Setting Up Module Entry Point
|
|
35
|
-
**********************************/
|
|
36
33
|
module.exports = spacesextn;
|
|
37
34
|
|
|
38
35
|
var keepaliveAgent = new Agent({
|
|
@@ -50,22 +47,8 @@ function spacesextn(accountId) {
|
|
|
50
47
|
}
|
|
51
48
|
|
|
52
49
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* *ext_user_id: 'string',
|
|
56
|
-
* ext_role: 'string',
|
|
57
|
-
* *products: [{
|
|
58
|
-
* *productcode: 'string',
|
|
59
|
-
* ext_entitlement_meta: {
|
|
60
|
-
* start_date: <epoch>,
|
|
61
|
-
* *end_date: <epoch>
|
|
62
|
-
* },
|
|
63
|
-
* ext_data : {},
|
|
64
|
-
* *action: 'string'
|
|
65
|
-
* }]
|
|
66
|
-
* }],
|
|
67
|
-
* *ext_actor_id: 'string'
|
|
68
|
-
* } options
|
|
50
|
+
* Wiki Link for SDK params
|
|
51
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/22_Integrations-Adapter#entitlebulkuserstoproductsparams
|
|
69
52
|
*/
|
|
70
53
|
function entitleBulkUsersToProducts(options) {
|
|
71
54
|
var self = this;
|
|
@@ -107,11 +90,8 @@ function entitleBulkUsersToProducts(options) {
|
|
|
107
90
|
}
|
|
108
91
|
|
|
109
92
|
/**
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* *workflow_type: "string",
|
|
113
|
-
* *<workflow_type>: {}
|
|
114
|
-
* } options
|
|
93
|
+
* Wiki Link for SDK params
|
|
94
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/22_Integrations-Adapter#setupuserparams
|
|
115
95
|
*/
|
|
116
96
|
function setupUser(options) {
|
|
117
97
|
var self = this;
|