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
@@ -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
- /*options = {
74
- extuserid: 'string',
75
- spaceRole: 'string', //optional
76
- spaceType: 'string', //optional
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
- /*options = {
123
- spaceCodeBody : {
124
- space_code: 'string'
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
- /*options = {
163
- classCodeBody : {
164
- class_code: 'string'
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
- /* options = {
209
- "ignore_words": ["string"] //optional, This is the array of all bad words to be ignored.
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
- /* options = {
243
- "ext_user_id": "string", //mandatory, This is the actor to change the spacecode.
244
- "ignore_words": ["string"] //optional, This is the array of all bad words to be ignored.
245
- "spacecode": "string" //mandatory, This is the spacecode that needs to be changed.
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
- ext_user_id: 'string',
285
- ext_role: 'string',
286
- space_code: 'string',
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
- // Setup request with URL and Params
306
- var requestAPI = request.post(url)
307
- .set('Content-Type', 'application/json')
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
- requestAPI.end(function(error, response) {
313
- if(error) {
314
- err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
315
- dfd.reject(err);
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 { dfd.resolve(response.body); }
318
- });
319
- } else {
320
- var err = {};
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
- return dfd.promise;
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
- /*options = {
330
- ext_user_id: 'string',
331
- ext_actor_id: 'string', (optional)
332
- ext_role: 'string',
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
- * This function is used to provision spaces to a user with ext_role as teacher.
387
- * options = {
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
- * options = {
434
- "space_title": "string", // mandatory
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
- * @param {
512
- * *ext_user_id: 'string',
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
- /*options = {
595
- ext_user_id: 'string',
596
- ext_actor_id: 'string',
597
- ext_role: 'string',
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
- /*options = {
649
- ext_user_id: 'string',
650
- ext_actor_id: 'string',
651
- productcode: 'string',
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
- /* This function calls the ComproDLS API to micro entitle user to a product.
697
- options = {
698
- "ext_user_id": "string", // Mandatory
699
- "ext_actor_id": "string", // Optional
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
- /* This function calls the ComproDLS API to micro entitle user to product.
763
- options = {
764
- "micro-entitlements": [{ // Mandatory, Min: 1
765
- "ext_user_id": "string", // Mandatory
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
- /* This function calls the ComproDLS API to revoke micro entitlement of a user.
825
- options = {
826
- "ext_user_id": "string", // Mandatory
827
- "ext_actor_id": "string", // Mandatory
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
- /*options = {
879
- ext_product_id: 'string'
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
- /*options = {
915
- spacekey: 'string'
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
- /*options = {
954
- ext_user_id: 'string',
955
- ext_role: 'string',
956
- ext_first_name: 'string',
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
- * This function calls the ComproDLS API to update user information.
1001
- * options = {
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
- * This function is used to update the visibility (hide/unhide) a particular user-space of a user.
1054
- * @param {*extuserid, *spacekey, *body: { *visibility }} options
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
- /* options = {
1100
- "email": "string", // required
1101
- "status " : "string", // optional
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
- var self = this;
1106
- // Initializing promise
1107
- var dfd = q.defer();
1108
- var err = {};
1109
- if (options && options.email) {
936
+ var self = this;
937
+ // Initializing promise
938
+ var dfd = q.defer();
939
+ var err = {};
940
+ if (options && options.email) {
1110
941
 
1111
- // Passed all validations, Contruct API url
1112
- var url = self.config.DEFAULT_HOSTS.AUTH + self.config.AUTH_API_URLS.getInvitationsByEmail;
1113
- url = helpers.api.constructAPIUrl(url, { accountid: self.accountId });
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
- var queryParam = { email: options.email };
1116
- if (options.status) { queryParam.status = options.status; }
946
+ var queryParam = { email: options.email };
947
+ if (options.status) { queryParam.status = options.status; }
1117
948
 
1118
- // Setup request with URL and Params
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
- requestAPI.end(function (error, response) {
1123
- if (error) {
1124
- err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
1125
- dfd.reject(err);
1126
- }
1127
- else { dfd.resolve(response.body); }
1128
- });
1129
- }
1130
- else {
1131
- err.message = err.description = 'email not found in request options.';
1132
- err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
1133
- dfd.reject(err);
1134
- }
1135
- return dfd.promise;
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
- * This API is used to update an institute's space title
1140
- * options = {
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;