cimpress-fulfiller-identity
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -21,6 +21,10 @@ 'use strict'; | ||
var FulfillerIdentityClient = function () { | ||
function FulfillerIdentityClient(authorization, options) { | ||
function FulfillerIdentityClient(authorization, clientOptions) { | ||
_classCallCheck(this, FulfillerIdentityClient); | ||
var awsXRay = options && options.AWSXRay ? options.AWSXRay : AWSXRayMock; | ||
var options = clientOptions || {}; | ||
var awsXRay = options.AWSXRay ? options.AWSXRay : AWSXRayMock; | ||
var retries = parseInt(options.retries, 10); | ||
var retryDelayInMs = parseInt(options.retryDelayInMs, 10); | ||
if (typeof authorization === "undefined") { | ||
@@ -41,9 +45,9 @@ this.authorizer = { getAuthorization: function getAuthorization() { | ||
} | ||
this.baseUrl = options && options.url ? options.url : "https://fulfilleridentity.trdlnk.cimpress.io"; | ||
this.baseUrl = options.url ? options.url : "https://fulfilleridentity.trdlnk.cimpress.io"; | ||
this.xrayPRoxy = new XRayProxy(this.authorizer, awsXRay); | ||
axiosRetry(axios, { | ||
retries: options.retries && options.retries >= 0 ? options.retries : 3, | ||
retries: retries >= 0 ? retries : 3, | ||
retryDelay: function retryDelay(retryCount) { | ||
return options.retryDelayInMs && options.retryDelayInMs >= 0 ? options.retryDelayInMs : 1000; | ||
return retryDelayInMs >= 0 ? retryDelayInMs : 1000; | ||
} | ||
@@ -50,0 +54,0 @@ }); |
{ | ||
"name": "cimpress-fulfiller-identity", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Thin client library for Cimpress' Fulfiller Identity service", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -15,4 +15,8 @@ const axios = require('axios'); | ||
constructor(authorization, options) { | ||
const awsXRay = (options && options.AWSXRay) ? options.AWSXRay : AWSXRayMock; | ||
constructor(authorization, clientOptions) { | ||
const options = clientOptions || {}; | ||
const awsXRay = options.AWSXRay ? options.AWSXRay : AWSXRayMock; | ||
const retries = parseInt(options.retries, 10); | ||
const retryDelayInMs = parseInt(options.retryDelayInMs, 10); | ||
if (typeof authorization === "undefined") { | ||
@@ -27,8 +31,8 @@ this.authorizer = { getAuthorization: () => Promise.resolve("") }; | ||
} | ||
this.baseUrl = (options && options.url) ? options.url : "https://fulfilleridentity.trdlnk.cimpress.io"; | ||
this.baseUrl = options.url ? options.url : "https://fulfilleridentity.trdlnk.cimpress.io"; | ||
this.xrayPRoxy = new XRayProxy(this.authorizer, awsXRay); | ||
axiosRetry(axios, { | ||
retries: options.retries && options.retries >= 0 ? options.retries : 3, | ||
retryDelay: retryCount => options.retryDelayInMs && options.retryDelayInMs >= 0 ? options.retryDelayInMs : 1000 | ||
retries: retries >= 0 ? retries : 3, | ||
retryDelay: retryCount => retryDelayInMs >= 0 ? retryDelayInMs : 1000 | ||
}); | ||
@@ -35,0 +39,0 @@ } |
55453
1081