@adastradev/serverless-discovery-sdk
Advanced tools
Comparing version 2.2.7 to 2.2.8-beta.1668461008616
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DiscoveryServiceApi = void 0; | ||
var apigClientFactory = require('@adastradev/aws-api-gateway-client').default; // tslint:disable-line | ||
var retryOptions = { | ||
retries: 20, | ||
retryDelay: function () { return 1500; }, | ||
retryCondition: function (error) { | ||
return (!error.response || (error.response.status >= 500 && error.response.status <= 599)); | ||
} | ||
}; | ||
var DiscoveryServiceApi = /** @class */ (function () { | ||
function DiscoveryServiceApi(serviceEndpointUri, region, credentials) { | ||
if (credentials.type === 'None') { | ||
this.apigClient = apigClientFactory.newClient({ | ||
accessKey: '', | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: '' | ||
}); | ||
this.apigClient = apigClientFactory.newClient(__assign({ accessKey: '', invokeUrl: serviceEndpointUri, region: region, secretKey: '' }, retryOptions)); | ||
} | ||
else if (credentials.type === 'IAM') { | ||
var iamCreds = credentials; | ||
this.apigClient = apigClientFactory.newClient({ | ||
accessKey: iamCreds.accessKeyId, | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: iamCreds.secretAccessKey | ||
}); | ||
this.apigClient = apigClientFactory.newClient(__assign({ accessKey: iamCreds.accessKeyId, invokeUrl: serviceEndpointUri, region: region, secretKey: iamCreds.secretAccessKey }, retryOptions)); | ||
} | ||
@@ -31,8 +39,3 @@ else if (credentials.type === 'BearerToken') { | ||
}; | ||
this.apigClient = apigClientFactory.newClient({ | ||
accessKey: '', | ||
invokeUrl: serviceEndpointUri, | ||
region: region, | ||
secretKey: '' | ||
}); | ||
this.apigClient = apigClientFactory.newClient(__assign({ accessKey: '', invokeUrl: serviceEndpointUri, region: region, secretKey: '' }, retryOptions)); | ||
} | ||
@@ -39,0 +42,0 @@ else { |
{ | ||
"name": "@adastradev/serverless-discovery-sdk", | ||
"version": "2.2.7", | ||
"version": "2.2.8-beta.1668461008616", | ||
"description": "Serverless Service Discovery API", | ||
@@ -30,5 +30,5 @@ "main": "dist/index.js", | ||
"jest": "^26.6.3", | ||
"ts-jest": "^26.4.4", | ||
"snyk": "^1.437.4", | ||
"tmp": "^0.2.1", | ||
"ts-jest": "^26.4.4", | ||
"ts-node": "^9.1.1", | ||
@@ -35,0 +35,0 @@ "tslint": "^6.1.3", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20630
308
2