comprodls-sdk 2.69.0 → 2.70.0
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
CHANGED
|
@@ -9740,42 +9740,33 @@ function getParticularOrgProductEntitlement(options) {
|
|
|
9740
9740
|
//Initializing promise
|
|
9741
9741
|
var deferred = q.defer();
|
|
9742
9742
|
|
|
9743
|
-
|
|
9744
|
-
|
|
9745
|
-
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
if (options && options.productcode) {
|
|
9749
|
-
// Passed all validations, Contruct the API URL
|
|
9750
|
-
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
9751
|
-
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
9752
|
-
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
9753
|
-
|
|
9754
|
-
// Setup request with URL and Query Params
|
|
9755
|
-
var params = { productcode: options.productcode };
|
|
9756
|
-
var requestAPI = request.get(url).query(params);
|
|
9743
|
+
if (options && options.productcode) {
|
|
9744
|
+
// Passed all validations, Contruct the API URL
|
|
9745
|
+
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
9746
|
+
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
9747
|
+
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
9757
9748
|
|
|
9758
|
-
|
|
9759
|
-
|
|
9749
|
+
// Setup request with URL and Query Params
|
|
9750
|
+
var params = { productcode: options.productcode };
|
|
9751
|
+
var requestAPI = request.get(url).query(params);
|
|
9760
9752
|
|
|
9761
|
-
|
|
9762
|
-
|
|
9753
|
+
// Setup 'traceid' in request header
|
|
9754
|
+
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
9763
9755
|
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
}
|
|
9756
|
+
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
9757
|
+
if (error) {
|
|
9758
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
9759
|
+
deferred.reject(error);
|
|
9760
|
+
} else {
|
|
9761
|
+
deferred.resolve(response.body);
|
|
9762
|
+
}
|
|
9763
|
+
});
|
|
9764
|
+
} else {
|
|
9765
|
+
var error = {};
|
|
9766
|
+
error.message = error.description = 'Mandatory field \'productcode\' not found '+
|
|
9767
|
+
'in request options.';
|
|
9768
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, error);
|
|
9769
|
+
deferred.reject(error);
|
|
9779
9770
|
}
|
|
9780
9771
|
|
|
9781
9772
|
return deferred.promise;
|
|
@@ -9793,40 +9784,31 @@ function getAllOrgProductEntitlements(options) {
|
|
|
9793
9784
|
//Initializing promise
|
|
9794
9785
|
var deferred = q.defer();
|
|
9795
9786
|
|
|
9796
|
-
//
|
|
9797
|
-
var
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
} else {
|
|
9801
|
-
// Passed all validations, Contruct the API URL
|
|
9802
|
-
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
9803
|
-
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
9804
|
-
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
9787
|
+
// Contruct the API URL
|
|
9788
|
+
var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
|
|
9789
|
+
self.config.AUTHEXTN_API_URLS.orgProductEntitlement;
|
|
9790
|
+
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId });
|
|
9805
9791
|
|
|
9806
|
-
|
|
9807
|
-
|
|
9792
|
+
// Setup request with URL and Query Params
|
|
9793
|
+
var params = { productcode: options.productcode };
|
|
9808
9794
|
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9795
|
+
if (options.status) { params.status = options.status; }
|
|
9796
|
+
if (options.hasOwnProperty('expired')) { params.expired = options.expired; }
|
|
9797
|
+
if (options.cursor) { params.cursor = options.cursor; }
|
|
9812
9798
|
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
// Setup 'traceid' in request header
|
|
9816
|
-
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
9799
|
+
var requestAPI = request.get(url).query(params);
|
|
9817
9800
|
|
|
9818
|
-
|
|
9819
|
-
|
|
9801
|
+
// Setup 'traceid' in request header
|
|
9802
|
+
if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
|
|
9820
9803
|
|
|
9821
|
-
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9828
|
-
|
|
9829
|
-
}
|
|
9804
|
+
requestAPI.agent(keepaliveAgent).end(function (error, response) {
|
|
9805
|
+
if (error) {
|
|
9806
|
+
error = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
|
|
9807
|
+
deferred.reject(error);
|
|
9808
|
+
} else {
|
|
9809
|
+
deferred.resolve(response.body);
|
|
9810
|
+
}
|
|
9811
|
+
});
|
|
9830
9812
|
|
|
9831
9813
|
return deferred.promise;
|
|
9832
9814
|
}
|
|
@@ -12028,9 +12010,10 @@ function getMicroEntitlementsForAUser(options) {
|
|
|
12028
12010
|
|
|
12029
12011
|
}
|
|
12030
12012
|
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
//
|
|
12013
|
+
/* options= {
|
|
12014
|
+
stage: "string", //optional, stage number or version
|
|
12015
|
+
target_role: "string" // optional
|
|
12016
|
+
} */
|
|
12034
12017
|
function getAllBundles(options) {
|
|
12035
12018
|
var self = this;
|
|
12036
12019
|
var dfd = q.defer();
|
|
@@ -12041,7 +12024,14 @@ function getAllBundles(options) {
|
|
|
12041
12024
|
url = helpers.api.constructAPIUrl(url, { accountId : self.accountId });
|
|
12042
12025
|
//Contruct parameters
|
|
12043
12026
|
var params = {};
|
|
12044
|
-
if(options
|
|
12027
|
+
if(options) {
|
|
12028
|
+
if(options.stage){
|
|
12029
|
+
params.stage = options.stage;
|
|
12030
|
+
}
|
|
12031
|
+
if(options.target_role){
|
|
12032
|
+
params.target_role = options.target_role;
|
|
12033
|
+
}
|
|
12034
|
+
}
|
|
12045
12035
|
|
|
12046
12036
|
//Setup request with URL and Post data
|
|
12047
12037
|
var requestAPI = request.get(url).query(params);
|
|
@@ -12516,10 +12506,10 @@ function updateBundle(options) {
|
|
|
12516
12506
|
return dfd.promise;
|
|
12517
12507
|
}
|
|
12518
12508
|
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
//
|
|
12522
|
-
|
|
12509
|
+
/* options= {
|
|
12510
|
+
stage: "string", //optional, stage number or version
|
|
12511
|
+
target_role: "string" // optional
|
|
12512
|
+
} */
|
|
12523
12513
|
function getAllBundles(options) {
|
|
12524
12514
|
var self = this;
|
|
12525
12515
|
//Initializing promise
|
|
@@ -12531,7 +12521,14 @@ function getAllBundles(options) {
|
|
|
12531
12521
|
url = helpers.api.constructAPIUrl(url, { orgid: self.orgId, });
|
|
12532
12522
|
//Contruct parameters
|
|
12533
12523
|
var params = {};
|
|
12534
|
-
if(options
|
|
12524
|
+
if(options) {
|
|
12525
|
+
if(options.stage){
|
|
12526
|
+
params.stage = options.stage;
|
|
12527
|
+
}
|
|
12528
|
+
if(options.target_role){
|
|
12529
|
+
params.target_role = options.target_role;
|
|
12530
|
+
}
|
|
12531
|
+
}
|
|
12535
12532
|
|
|
12536
12533
|
//Setup request with URL and Post data
|
|
12537
12534
|
var requestAPI = request.get(url).query(params);
|