comprodls-sdk 2.69.0 → 2.69.1
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/dist/comprodls-sdk.js +221 -239
- package/dist/comprodls-sdk.min.js +11 -11
- package/lib/services/authextn/index.js +44 -62
- package/package.json +1 -1
|
@@ -1015,42 +1015,33 @@ function getParticularOrgProductEntitlement(options) {
|
|
|
1015
1015
|
//Initializing promise
|
|
1016
1016
|
var deferred = q.defer();
|
|
1017
1017
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
if (options && options.productcode) {
|
|
1024
|
-
// Passed all validations, Contruct the API URL
|
|
1025
|
-
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1026
|
-
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
1027
|
-
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1028
|
-
|
|
1029
|
-
// Setup request with URL and Query Params
|
|
1030
|
-
var params = { productcode: options.productcode };
|
|
1031
|
-
var requestAPI = request.get(url).query(params);
|
|
1018
|
+
if (options && options.productcode) {
|
|
1019
|
+
// Passed all validations, Contruct the API URL
|
|
1020
|
+
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1021
|
+
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
1022
|
+
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1032
1023
|
|
|
1033
|
-
|
|
1034
|
-
|
|
1024
|
+
// Setup request with URL and Query Params
|
|
1025
|
+
var params = { productcode: options.productcode };
|
|
1026
|
+
var requestAPI = request.get(url).query(params);
|
|
1035
1027
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1028
|
+
// Setup 'traceid' in request header
|
|
1029
|
+
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1038
1030
|
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
}
|
|
1031
|
+
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
1032
|
+
if (error) {
|
|
1033
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1034
|
+
deferred.reject(error);
|
|
1035
|
+
} else {
|
|
1036
|
+
deferred.resolve(response.body);
|
|
1037
|
+
}
|
|
1038
|
+
});
|
|
1039
|
+
} else {
|
|
1040
|
+
var error = {};
|
|
1041
|
+
error.message = error.description = 'Mandatory field \'productcode\' not found '+
|
|
1042
|
+
'in request options.';
|
|
1043
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
|
|
1044
|
+
deferred.reject(error);
|
|
1054
1045
|
}
|
|
1055
1046
|
|
|
1056
1047
|
return deferred.promise;
|
|
@@ -1068,40 +1059,31 @@ function getAllOrgProductEntitlements(options) {
|
|
|
1068
1059
|
//Initializing promise
|
|
1069
1060
|
var deferred = q.defer();
|
|
1070
1061
|
|
|
1071
|
-
//
|
|
1072
|
-
var
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
} else {
|
|
1076
|
-
// Passed all validations, Contruct the API URL
|
|
1077
|
-
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1078
|
-
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
1079
|
-
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1080
|
-
|
|
1081
|
-
// Setup request with URL and Query Params
|
|
1082
|
-
var params = { productcode: options.productcode };
|
|
1062
|
+
// Contruct the API URL
|
|
1063
|
+
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
1064
|
+
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
1065
|
+
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
1083
1066
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
if (options.cursor) { params.cursor = options.cursor; }
|
|
1067
|
+
// Setup request with URL and Query Params
|
|
1068
|
+
var params = { productcode: options.productcode };
|
|
1087
1069
|
|
|
1088
|
-
|
|
1070
|
+
if (options.status) { params.status = options.status; }
|
|
1071
|
+
if (options.hasOwnProperty('expired')) { params.expired = options.expired; }
|
|
1072
|
+
if (options.cursor) { params.cursor = options.cursor; }
|
|
1089
1073
|
|
|
1090
|
-
|
|
1091
|
-
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1074
|
+
var requestAPI = request.get(url).query(params);
|
|
1092
1075
|
|
|
1093
|
-
|
|
1094
|
-
|
|
1076
|
+
// Setup 'traceid' in request header
|
|
1077
|
+
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
1095
1078
|
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
}
|
|
1079
|
+
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
1080
|
+
if (error) {
|
|
1081
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
1082
|
+
deferred.reject(error);
|
|
1083
|
+
} else {
|
|
1084
|
+
deferred.resolve(response.body);
|
|
1085
|
+
}
|
|
1086
|
+
});
|
|
1105
1087
|
|
|
1106
1088
|
return deferred.promise;
|
|
1107
1089
|
}
|