comprodls-sdk 2.90.3-development → 2.91.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 +2917 -6291
- package/dist/comprodls-sdk.min.js +1 -1
- package/lib/comprodls.js +39 -57
- package/lib/config/index.js +172 -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 +106 -289
- 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
|
@@ -30,9 +30,6 @@ var Agent = require('agentkeepalive');
|
|
|
30
30
|
|
|
31
31
|
var DLSError = helpers.errors.DLSError;
|
|
32
32
|
|
|
33
|
-
/*********************************
|
|
34
|
-
* Setting Up Module Entry Point
|
|
35
|
-
**********************************/
|
|
36
33
|
module.exports = authextn;
|
|
37
34
|
|
|
38
35
|
var keepaliveAgent = new Agent({
|
|
@@ -41,8 +38,7 @@ var keepaliveAgent = new Agent({
|
|
|
41
38
|
});
|
|
42
39
|
|
|
43
40
|
//AuthExtn Adaptor Contsructor
|
|
44
|
-
function authextn(
|
|
45
|
-
this.accountId = accountId;
|
|
41
|
+
function authextn() {
|
|
46
42
|
return {
|
|
47
43
|
// Gradeformat related APIs
|
|
48
44
|
createGradeformat: createGradeformat.bind(this),
|
|
@@ -68,9 +64,7 @@ function authextn(accountId) {
|
|
|
68
64
|
createOrgProductEntitlement: createOrgProductEntitlement.bind(this),
|
|
69
65
|
updateOrgProductEntitlement: updateOrgProductEntitlement.bind(this),
|
|
70
66
|
getParticularOrgProductEntitlement: getParticularOrgProductEntitlement.bind(this),
|
|
71
|
-
getAllOrgProductEntitlements: getAllOrgProductEntitlements.bind(this)
|
|
72
|
-
setupUser: setupUser.bind(this)
|
|
73
|
-
|
|
67
|
+
getAllOrgProductEntitlements: getAllOrgProductEntitlements.bind(this)
|
|
74
68
|
};
|
|
75
69
|
}
|
|
76
70
|
|
|
@@ -78,21 +72,10 @@ function authextn(accountId) {
|
|
|
78
72
|
* Public Function definitions
|
|
79
73
|
**********************************/
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
grades:[ { //mandatory
|
|
86
|
-
id: "string",
|
|
87
|
-
title: "string",
|
|
88
|
-
min_threshold: "string",
|
|
89
|
-
max_threshold: "string",
|
|
90
|
-
target: boolean
|
|
91
|
-
}, ...]
|
|
92
|
-
data: {}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
*/
|
|
75
|
+
/**
|
|
76
|
+
* Wiki Link for SDK params
|
|
77
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#creategradeformatparams
|
|
78
|
+
*/
|
|
96
79
|
function createGradeformat(options) {
|
|
97
80
|
var self = this;
|
|
98
81
|
// Initializing promise
|
|
@@ -139,21 +122,10 @@ function createGradeformat(options) {
|
|
|
139
122
|
return dfd.promise;
|
|
140
123
|
}
|
|
141
124
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
grades: [ {
|
|
147
|
-
id: "string",
|
|
148
|
-
title: "string",
|
|
149
|
-
min_threshold: "string",
|
|
150
|
-
max_threshold: "string",
|
|
151
|
-
target: boolean
|
|
152
|
-
}, ...]
|
|
153
|
-
data: {...}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
*/
|
|
125
|
+
/**
|
|
126
|
+
* Wiki Link for SDK params
|
|
127
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#updategradeformatparams
|
|
128
|
+
*/
|
|
157
129
|
function updateGradeformat(options) {
|
|
158
130
|
// Initializing promise
|
|
159
131
|
var deferred = q.defer();
|
|
@@ -214,11 +186,10 @@ function updateGradeformat(options) {
|
|
|
214
186
|
return deferred.promise;
|
|
215
187
|
}
|
|
216
188
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
*/
|
|
189
|
+
/**
|
|
190
|
+
* Wiki Link for SDK params
|
|
191
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#deletegradeformatparams
|
|
192
|
+
*/
|
|
222
193
|
function deleteGradeformat(options) {
|
|
223
194
|
var self = this;
|
|
224
195
|
var dfd = q.defer();
|
|
@@ -264,11 +235,10 @@ function deleteGradeformat(options) {
|
|
|
264
235
|
return dfd.promise;
|
|
265
236
|
}
|
|
266
237
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
*/
|
|
238
|
+
/**
|
|
239
|
+
* Wiki Link for SDK params
|
|
240
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getparticulargradeformatparams
|
|
241
|
+
*/
|
|
272
242
|
function getParticularGradeformat (options) {
|
|
273
243
|
// Initializing promise
|
|
274
244
|
var deferred = q.defer();
|
|
@@ -316,11 +286,10 @@ function getParticularGradeformat (options) {
|
|
|
316
286
|
return deferred.promise;
|
|
317
287
|
}
|
|
318
288
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
*/
|
|
289
|
+
/**
|
|
290
|
+
* Wiki Link for SDK params
|
|
291
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getallgradeformatsparams
|
|
292
|
+
*/
|
|
324
293
|
function getAllGradeformats (options) {
|
|
325
294
|
// Initializing promise
|
|
326
295
|
var deferred = q.defer();
|
|
@@ -366,20 +335,8 @@ function getAllGradeformats (options) {
|
|
|
366
335
|
}
|
|
367
336
|
|
|
368
337
|
/**
|
|
369
|
-
*
|
|
370
|
-
*
|
|
371
|
-
* *gradeformat_id: 'string',
|
|
372
|
-
* *body: {
|
|
373
|
-
* *grades: [{
|
|
374
|
-
* id: 'string',
|
|
375
|
-
* title: 'string',
|
|
376
|
-
* min_threshold: 'string',
|
|
377
|
-
* max_threshold: 'string',
|
|
378
|
-
* target: <boolean>
|
|
379
|
-
* }],
|
|
380
|
-
* data: {}
|
|
381
|
-
* }
|
|
382
|
-
* } options
|
|
338
|
+
* Wiki Link for SDK params
|
|
339
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#associategradeformattoclassparams
|
|
383
340
|
*/
|
|
384
341
|
function associateGradeformatToClass(options) {
|
|
385
342
|
var self = this;
|
|
@@ -435,10 +392,8 @@ function associateGradeformatToClass(options) {
|
|
|
435
392
|
}
|
|
436
393
|
|
|
437
394
|
/**
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
* *gradeformat_id: 'string'
|
|
441
|
-
* } options
|
|
395
|
+
* Wiki Link for SDK params
|
|
396
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#unassociategradeformatfromclassparams
|
|
442
397
|
*/
|
|
443
398
|
function unassociateGradeformatFromClass(options) {
|
|
444
399
|
var self = this;
|
|
@@ -490,20 +445,8 @@ function unassociateGradeformatFromClass(options) {
|
|
|
490
445
|
}
|
|
491
446
|
|
|
492
447
|
/**
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
* *gradeformat_id: 'string',
|
|
496
|
-
* *body: {
|
|
497
|
-
* grades: [{
|
|
498
|
-
* id: 'string',
|
|
499
|
-
* title: 'string',
|
|
500
|
-
* min_threshold: 'string',
|
|
501
|
-
* max_threshold: 'string',
|
|
502
|
-
* target: <boolean>
|
|
503
|
-
* }],
|
|
504
|
-
* data: {}
|
|
505
|
-
* }
|
|
506
|
-
* } options
|
|
448
|
+
* Wiki Link for SDK params
|
|
449
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#updateclassgradeformatassociationparams
|
|
507
450
|
*/
|
|
508
451
|
function updateClassGradeformatAssociation(options) {
|
|
509
452
|
var self = this;
|
|
@@ -559,10 +502,8 @@ function updateClassGradeformatAssociation(options) {
|
|
|
559
502
|
}
|
|
560
503
|
|
|
561
504
|
/**
|
|
562
|
-
*
|
|
563
|
-
*
|
|
564
|
-
* *gradeformat_id: 'string'
|
|
565
|
-
* } options
|
|
505
|
+
* Wiki Link for SDK params
|
|
506
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getparticulargradeformatofaclassparams
|
|
566
507
|
*/
|
|
567
508
|
function getParticularGradeformatOfAClass(options) {
|
|
568
509
|
var self = this;
|
|
@@ -613,10 +554,8 @@ function getParticularGradeformatOfAClass(options) {
|
|
|
613
554
|
}
|
|
614
555
|
|
|
615
556
|
/**
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
* cursor: 'string'
|
|
619
|
-
* } options
|
|
557
|
+
* Wiki Link for SDK params
|
|
558
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getallgradeformatsofaclassparams
|
|
620
559
|
*/
|
|
621
560
|
function getAllGradeformatsOfAClass(options) {
|
|
622
561
|
var self = this;
|
|
@@ -669,10 +608,8 @@ function getAllGradeformatsOfAClass(options) {
|
|
|
669
608
|
}
|
|
670
609
|
|
|
671
610
|
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
* cursor: 'string'
|
|
675
|
-
* } options
|
|
611
|
+
* Wiki Link for SDK params
|
|
612
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getclassesofagradeformatparams
|
|
676
613
|
*/
|
|
677
614
|
function getClassesOfAGradeformat(options) {
|
|
678
615
|
var self = this;
|
|
@@ -725,18 +662,10 @@ function getClassesOfAGradeformat(options) {
|
|
|
725
662
|
return deferred.promise;
|
|
726
663
|
}
|
|
727
664
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
body : [ // min:1 , max: 50
|
|
733
|
-
{
|
|
734
|
-
extUserId: "string", //Mandatory
|
|
735
|
-
}.
|
|
736
|
-
....
|
|
737
|
-
]
|
|
738
|
-
}
|
|
739
|
-
*/
|
|
665
|
+
/**
|
|
666
|
+
* Wiki Link for SDK params
|
|
667
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#createuserassignedpathenrollmentsparams
|
|
668
|
+
*/
|
|
740
669
|
function createUserAssignedPathEnrollments(options) {
|
|
741
670
|
var self = this;
|
|
742
671
|
// Initializing promise
|
|
@@ -786,18 +715,10 @@ function createUserAssignedPathEnrollments(options) {
|
|
|
786
715
|
return dfd.promise;
|
|
787
716
|
}
|
|
788
717
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
body : [ // min:1 , max: 50
|
|
794
|
-
{
|
|
795
|
-
extUserId: "string", //Mandatory
|
|
796
|
-
},
|
|
797
|
-
...
|
|
798
|
-
]
|
|
799
|
-
}
|
|
800
|
-
*/
|
|
718
|
+
/**
|
|
719
|
+
* Wiki Link for SDK params
|
|
720
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#deleteuserassignedpathenrollmentsparams
|
|
721
|
+
*/
|
|
801
722
|
function deleteUserAssignedPathEnrollments(options) {
|
|
802
723
|
var self = this;
|
|
803
724
|
// Initializing promise
|
|
@@ -848,11 +769,8 @@ function deleteUserAssignedPathEnrollments(options) {
|
|
|
848
769
|
}
|
|
849
770
|
|
|
850
771
|
/**
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
* productDetails: <Boolean>, // optional
|
|
854
|
-
* bundleDetails: <Boolean> // optional
|
|
855
|
-
* } options
|
|
772
|
+
* Wiki Link for SDK params
|
|
773
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getparticularclassv2params
|
|
856
774
|
*/
|
|
857
775
|
function getParticularClassV2(options) {
|
|
858
776
|
var self = this;
|
|
@@ -899,15 +817,8 @@ function getParticularClassV2(options) {
|
|
|
899
817
|
}
|
|
900
818
|
|
|
901
819
|
/**
|
|
902
|
-
*
|
|
903
|
-
*
|
|
904
|
-
* status: "string" // ['active', 'revoked'] - default: 'active'
|
|
905
|
-
* expired: <boolean>, // default: false
|
|
906
|
-
* startdate: <epoch>,
|
|
907
|
-
* enddate: <epoch>,
|
|
908
|
-
* audit: <boolean> // [true] - default: true
|
|
909
|
-
* ext_data: {...},
|
|
910
|
-
* } options
|
|
820
|
+
* Wiki Link for SDK params
|
|
821
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#createorgproductentitlementparams
|
|
911
822
|
*/
|
|
912
823
|
function createOrgProductEntitlement(options) {
|
|
913
824
|
var self = this;
|
|
@@ -953,15 +864,8 @@ function createOrgProductEntitlement(options) {
|
|
|
953
864
|
}
|
|
954
865
|
|
|
955
866
|
/**
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
* status: "string" // ['active', 'revoked']
|
|
959
|
-
* expired: <boolean>,
|
|
960
|
-
* startdate: <epoch>,
|
|
961
|
-
* enddate: <epoch>,
|
|
962
|
-
* audit: <boolean> // [true] - default: true
|
|
963
|
-
* ext_data: {...},
|
|
964
|
-
* } options
|
|
867
|
+
* Wiki Link for SDK params
|
|
868
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#updateorgproductentitlementparams
|
|
965
869
|
*/
|
|
966
870
|
function updateOrgProductEntitlement(options) {
|
|
967
871
|
var self = this;
|
|
@@ -1009,73 +913,15 @@ function updateOrgProductEntitlement(options) {
|
|
|
1009
913
|
}
|
|
1010
914
|
|
|
1011
915
|
/**
|
|
1012
|
-
*
|
|
1013
|
-
*
|
|
1014
|
-
* } options
|
|
916
|
+
* Wiki Link for SDK params
|
|
917
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getparticularorgproductentitlementparams
|
|
1015
918
|
*/
|
|
1016
919
|
function getParticularOrgProductEntitlement(options) {
|
|
1017
920
|
var self = this;
|
|
1018
921
|
//Initializing promise
|
|
1019
922
|
var deferred = q.defer();
|
|
1020
923
|
|
|
1021
|
-
|
|
1022
|
-
var error = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1023
|
-
if (error) {
|
|
1024
|
-
deferred.reject(error);
|
|
1025
|
-
} else {
|
|
1026
|
-
if (options && options.productcode) {
|
|
1027
|
-
// Passed all validations, Contruct the API URL
|
|
1028
|
-
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1029
|
-
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
1030
|
-
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1031
|
-
|
|
1032
|
-
// Setup request with URL and Query Params
|
|
1033
|
-
var params = { productcode: options.productcode };
|
|
1034
|
-
var requestAPI = request.get(url).query(params);
|
|
1035
|
-
|
|
1036
|
-
// Setup 'traceid' in request header
|
|
1037
|
-
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1038
|
-
|
|
1039
|
-
// Setup 'token' in Authorization header
|
|
1040
|
-
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1041
|
-
|
|
1042
|
-
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
1043
|
-
if (error) {
|
|
1044
|
-
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1045
|
-
deferred.reject(error);
|
|
1046
|
-
} else {
|
|
1047
|
-
deferred.resolve(response.body);
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
} else {
|
|
1051
|
-
error = {};
|
|
1052
|
-
error.message = error.description = 'Mandatory field \'productcode\' not found '+
|
|
1053
|
-
'in request options.';
|
|
1054
|
-
error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
|
|
1055
|
-
deferred.reject(error);
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
return deferred.promise;
|
|
1060
|
-
}
|
|
1061
|
-
|
|
1062
|
-
/**
|
|
1063
|
-
* @param {
|
|
1064
|
-
* status: "string" // ['active', 'revoked']
|
|
1065
|
-
* expired: <boolean>,
|
|
1066
|
-
* cursor: <epoch>
|
|
1067
|
-
* } options
|
|
1068
|
-
*/
|
|
1069
|
-
function getAllOrgProductEntitlements(options) {
|
|
1070
|
-
var self = this;
|
|
1071
|
-
//Initializing promise
|
|
1072
|
-
var deferred = q.defer();
|
|
1073
|
-
|
|
1074
|
-
//Validations
|
|
1075
|
-
var error = helpers.validations.isAuthenticated(self.orgId, self.token);
|
|
1076
|
-
if (error) {
|
|
1077
|
-
deferred.reject(error);
|
|
1078
|
-
} else {
|
|
924
|
+
if (options && options.productcode) {
|
|
1079
925
|
// Passed all validations, Contruct the API URL
|
|
1080
926
|
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1081
927
|
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
@@ -1083,19 +929,11 @@ function getAllOrgProductEntitlements(options) {
|
|
|
1083
929
|
|
|
1084
930
|
// Setup request with URL and Query Params
|
|
1085
931
|
var params = { productcode: options.productcode };
|
|
1086
|
-
|
|
1087
|
-
if (options.status) { params.status = options.status; }
|
|
1088
|
-
if (options.hasOwnProperty('expired')) { params.expired = options.expired; }
|
|
1089
|
-
if (options.cursor) { params.cursor = options.cursor; }
|
|
1090
|
-
|
|
1091
932
|
var requestAPI = request.get(url).query(params);
|
|
1092
933
|
|
|
1093
934
|
// Setup 'traceid' in request header
|
|
1094
935
|
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1095
936
|
|
|
1096
|
-
// Setup 'token' in Authorization header
|
|
1097
|
-
requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
|
|
1098
|
-
|
|
1099
937
|
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
1100
938
|
if (error) {
|
|
1101
939
|
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
@@ -1104,51 +942,51 @@ function getAllOrgProductEntitlements(options) {
|
|
|
1104
942
|
deferred.resolve(response.body);
|
|
1105
943
|
}
|
|
1106
944
|
});
|
|
945
|
+
} else {
|
|
946
|
+
var error = {};
|
|
947
|
+
error.message = error.description = 'Mandatory field \'productcode\' not found '+
|
|
948
|
+
'in request options.';
|
|
949
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
|
|
950
|
+
deferred.reject(error);
|
|
1107
951
|
}
|
|
1108
952
|
|
|
1109
953
|
return deferred.promise;
|
|
1110
954
|
}
|
|
1111
955
|
|
|
1112
956
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
* } options
|
|
1118
|
-
*/
|
|
1119
|
-
function setupUser(options) {
|
|
957
|
+
* Wiki Link for SDK params
|
|
958
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/28_AUTHEXTN-Adapter#getallorgproductentitlementsparams
|
|
959
|
+
*/
|
|
960
|
+
function getAllOrgProductEntitlements(options) {
|
|
1120
961
|
var self = this;
|
|
1121
962
|
//Initializing promise
|
|
1122
963
|
var deferred = q.defer();
|
|
1123
964
|
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
965
|
+
// Contruct the API URL
|
|
966
|
+
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
967
|
+
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
968
|
+
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1128
969
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
.set('Accept', 'application/json')
|
|
1132
|
-
.send(options);
|
|
970
|
+
// Setup request with URL and Query Params
|
|
971
|
+
var params = { productcode: options.productcode };
|
|
1133
972
|
|
|
1134
|
-
|
|
973
|
+
if (options.status) { params.status = options.status; }
|
|
974
|
+
if (options.hasOwnProperty('expired')) { params.expired = options.expired; }
|
|
975
|
+
if (options.cursor) { params.cursor = options.cursor; }
|
|
1135
976
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
}
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
deferred.reject(err);
|
|
1152
|
-
}
|
|
1153
|
-
return deferred.promise;
|
|
977
|
+
var requestAPI = request.get(url).query(params);
|
|
978
|
+
|
|
979
|
+
// Setup 'traceid' in request header
|
|
980
|
+
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
981
|
+
|
|
982
|
+
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
983
|
+
if (error) {
|
|
984
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
985
|
+
deferred.reject(error);
|
|
986
|
+
} else {
|
|
987
|
+
deferred.resolve(response.body);
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
|
|
991
|
+
return deferred.promise;
|
|
1154
992
|
}
|
|
@@ -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 = datasyncmanager;
|
|
37
34
|
|
|
38
35
|
var keepaliveAgent = new Agent({
|
|
@@ -53,22 +50,8 @@ function datasyncmanager(accountId) {
|
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* "*dsmid": "string",
|
|
59
|
-
* "dsm_groupid": "string",
|
|
60
|
-
* "rules_orgs": [{"*id": "string"}, ...],
|
|
61
|
-
* "rules_products": [{
|
|
62
|
-
* "*productcode": "string",
|
|
63
|
-
* "*ext_entitlement_meta": { "start_date", "*end_date" },
|
|
64
|
-
* "*target_roles": [role]
|
|
65
|
-
* }],
|
|
66
|
-
* "*category": "entitlement_sync",
|
|
67
|
-
* "*type": "managed",
|
|
68
|
-
* "*ext_user_id": "string",
|
|
69
|
-
* "data": {},
|
|
70
|
-
* "*audit": true
|
|
71
|
-
* }
|
|
53
|
+
* Wiki Link for SDK params
|
|
54
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/27_DATASYNCMANAGER-Adapter#createdatasyncmanagerparams
|
|
72
55
|
*/
|
|
73
56
|
function createDataSyncManager(options) {
|
|
74
57
|
var self = this;
|
|
@@ -109,20 +92,8 @@ function createDataSyncManager(options) {
|
|
|
109
92
|
}
|
|
110
93
|
|
|
111
94
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* "*body": {
|
|
115
|
-
* "rules_orgs": [{ "*id": "orgid" }, ...],
|
|
116
|
-
* "*rules_products": [{
|
|
117
|
-
* "*productcode": "<productcode-1>",
|
|
118
|
-
* "*ext_entitlement_meta": { "start_date", "*end_date" },
|
|
119
|
-
* "target_roles": ["role"],
|
|
120
|
-
* }],
|
|
121
|
-
* "*ext_user_id": "ext_actor_id",
|
|
122
|
-
* "data": {},
|
|
123
|
-
* "*audit": <boolean>
|
|
124
|
-
* }
|
|
125
|
-
* }
|
|
95
|
+
* Wiki Link for SDK params
|
|
96
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/27_DATASYNCMANAGER-Adapter#updatedatasyncmanagerparams
|
|
126
97
|
*/
|
|
127
98
|
function updateDataSyncManager(options) {
|
|
128
99
|
// Initializing promise
|
|
@@ -171,12 +142,8 @@ function updateDataSyncManager(options) {
|
|
|
171
142
|
}
|
|
172
143
|
|
|
173
144
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
* "*body": {
|
|
177
|
-
* "*ext_user_id": "string",
|
|
178
|
-
* "*audit": true
|
|
179
|
-
* }
|
|
145
|
+
* Wiki Link for SDK params
|
|
146
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/27_DATASYNCMANAGER-Adapter#deletedatasyncmanagerparams
|
|
180
147
|
*/
|
|
181
148
|
function deleteDataSyncManager(options) {
|
|
182
149
|
var self = this;
|
|
@@ -216,9 +183,8 @@ function deleteDataSyncManager(options) {
|
|
|
216
183
|
}
|
|
217
184
|
|
|
218
185
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* }
|
|
186
|
+
* Wiki Link for SDK params
|
|
187
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/27_DATASYNCMANAGER-Adapter#getparticulardatasyncmanagerparams
|
|
222
188
|
*/
|
|
223
189
|
function getParticularDataSyncManager(options) {
|
|
224
190
|
// Initializing promise
|
|
@@ -263,9 +229,8 @@ function getParticularDataSyncManager(options) {
|
|
|
263
229
|
}
|
|
264
230
|
|
|
265
231
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* }
|
|
232
|
+
* Wiki Link for SDK params
|
|
233
|
+
* https://github.com/comprodls/comprodls-sdk-js/wiki/27_DATASYNCMANAGER-Adapter#getalldatasyncmanagersofagroupparams
|
|
269
234
|
*/
|
|
270
235
|
function getAllDataSyncManagersOfAGroup(options) {
|
|
271
236
|
// Initializing promise
|