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.
@@ -1015,42 +1015,33 @@ function getParticularOrgProductEntitlement(options) {
1015
1015
  //Initializing promise
1016
1016
  var deferred = q.defer();
1017
1017
 
1018
- //Validations
1019
- var error = helpers.validations.isAuthenticated(self.orgId, self.token);
1020
- if (error) {
1021
- deferred.reject(error);
1022
- } else {
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
- // Setup 'traceid' in request header
1034
- if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
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
- // Setup 'token' in Authorization header
1037
- requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1028
+ // Setup 'traceid' in request header
1029
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1038
1030
 
1039
- requestAPI.agent(keepaliveAgent).end(function (error, response) {
1040
- if (error) {
1041
- error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
1042
- deferred.reject(error);
1043
- } else {
1044
- deferred.resolve(response.body);
1045
- }
1046
- });
1047
- } else {
1048
- error = {};
1049
- error.message = error.description = 'Mandatory field \'productcode\' not found '+
1050
- 'in request options.';
1051
- error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
1052
- deferred.reject(error);
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
- //Validations
1072
- var error = helpers.validations.isAuthenticated(self.orgId, self.token);
1073
- if (error) {
1074
- deferred.reject(error);
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
- if (options.status) { params.status = options.status; }
1085
- if (options.hasOwnProperty('expired')) { params.expired = options.expired; }
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
- var requestAPI = request.get(url).query(params);
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
- // Setup 'traceid' in request header
1091
- if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1074
+ var requestAPI = request.get(url).query(params);
1092
1075
 
1093
- // Setup 'token' in Authorization header
1094
- requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
1076
+ // Setup 'traceid' in request header
1077
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
1095
1078
 
1096
- requestAPI.agent(keepaliveAgent).end(function (error, response) {
1097
- if (error) {
1098
- error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
1099
- deferred.reject(error);
1100
- } else {
1101
- deferred.resolve(response.body);
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "comprodls-sdk",
3
3
  "description": "comproDLS SDK for JavaScript",
4
- "version": "2.69.0",
4
+ "version": "2.69.1",
5
5
  "author": {
6
6
  "name": "Compro Technologies Private Limited",
7
7
  "url": "http://www.comprotechnologies.com/"