@aws-sdk/property-provider
Advanced tools
Comparing version 3.54.1 to 3.55.0
@@ -6,2 +6,19 @@ # Change Log | ||
# [3.55.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.1...v3.55.0) (2022-03-21) | ||
### Bug Fixes | ||
* **property-provider:** copy error properties to ProviderError in from() ([#3440](https://github.com/aws/aws-sdk-js-v3/issues/3440)) ([4377e44](https://github.com/aws/aws-sdk-js-v3/commit/4377e4488ce4ae3746dd34349ab3d95d5780fa91)) | ||
* **property-provider:** manually adjust the prototype of *ProviderError ([#3445](https://github.com/aws/aws-sdk-js-v3/issues/3445)) ([134f769](https://github.com/aws/aws-sdk-js-v3/commit/134f7693b339a791379e12873632458c892f375b)) | ||
### Features | ||
* **property-provider:** memoize() supports force refresh ([#3413](https://github.com/aws/aws-sdk-js-v3/issues/3413)) ([a79f962](https://github.com/aws/aws-sdk-js-v3/commit/a79f962873ff11a3d6f98199224155bd2ddc0b1e)) | ||
## [3.54.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.54.0...v3.54.1) (2022-03-15) | ||
@@ -8,0 +25,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./CredentialsProviderError"), exports); | ||
tslib_1.__exportStar(require("./ProviderError"), exports); | ||
@@ -5,0 +6,0 @@ tslib_1.__exportStar(require("./chain"), exports); |
@@ -8,2 +8,3 @@ "use strict"; | ||
let hasResult; | ||
let isConstant = false; | ||
const coalesceProvider = async () => { | ||
@@ -16,2 +17,3 @@ if (!pending) { | ||
hasResult = true; | ||
isConstant = false; | ||
} | ||
@@ -24,4 +26,4 @@ finally { | ||
if (isExpired === undefined) { | ||
return async () => { | ||
if (!hasResult) { | ||
return async (options) => { | ||
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { | ||
resolved = await coalesceProvider(); | ||
@@ -32,5 +34,4 @@ } | ||
} | ||
let isConstant = false; | ||
return async () => { | ||
if (!hasResult) { | ||
return async (options) => { | ||
if (!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh)) { | ||
resolved = await coalesceProvider(); | ||
@@ -37,0 +38,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CredentialsProviderError = exports.ProviderError = void 0; | ||
exports.ProviderError = void 0; | ||
class ProviderError extends Error { | ||
@@ -8,30 +8,9 @@ constructor(message, tryNextLink = true) { | ||
this.tryNextLink = tryNextLink; | ||
this.name = "ProviderError"; | ||
Object.setPrototypeOf(this, ProviderError.prototype); | ||
} | ||
static from(error, tryNextLink = true) { | ||
Object.defineProperty(error, "tryNextLink", { | ||
value: tryNextLink, | ||
configurable: false, | ||
enumerable: false, | ||
writable: false, | ||
}); | ||
return error; | ||
return Object.assign(new this(error.message, tryNextLink), error); | ||
} | ||
} | ||
exports.ProviderError = ProviderError; | ||
class CredentialsProviderError extends Error { | ||
constructor(message, tryNextLink = true) { | ||
super(message); | ||
this.tryNextLink = tryNextLink; | ||
this.name = "CredentialsProviderError"; | ||
} | ||
static from(error, tryNextLink = true) { | ||
Object.defineProperty(error, "tryNextLink", { | ||
value: tryNextLink, | ||
configurable: false, | ||
enumerable: false, | ||
writable: false, | ||
}); | ||
return error; | ||
} | ||
} | ||
exports.CredentialsProviderError = CredentialsProviderError; |
@@ -0,1 +1,2 @@ | ||
export * from "./CredentialsProviderError"; | ||
export * from "./ProviderError"; | ||
@@ -2,0 +3,0 @@ export * from "./chain"; |
@@ -6,2 +6,3 @@ import { __awaiter, __generator } from "tslib"; | ||
var hasResult; | ||
var isConstant = false; | ||
var coalesceProvider = function () { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -21,2 +22,3 @@ return __generator(this, function (_a) { | ||
hasResult = true; | ||
isConstant = false; | ||
return [3, 4]; | ||
@@ -31,7 +33,7 @@ case 3: | ||
if (isExpired === undefined) { | ||
return function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return function (options) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!!hasResult) return [3, 2]; | ||
if (!(!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh))) return [3, 2]; | ||
return [4, coalesceProvider()]; | ||
@@ -46,8 +48,7 @@ case 1: | ||
} | ||
var isConstant = false; | ||
return function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return function (options) { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!!hasResult) return [3, 2]; | ||
if (!(!hasResult || (options === null || options === void 0 ? void 0 : options.forceRefresh))) return [3, 2]; | ||
return [4, coalesceProvider()]; | ||
@@ -54,0 +55,0 @@ case 1: |
@@ -8,2 +8,4 @@ import { __extends } from "tslib"; | ||
_this.tryNextLink = tryNextLink; | ||
_this.name = "ProviderError"; | ||
Object.setPrototypeOf(_this, ProviderError.prototype); | ||
return _this; | ||
@@ -13,9 +15,3 @@ } | ||
if (tryNextLink === void 0) { tryNextLink = true; } | ||
Object.defineProperty(error, "tryNextLink", { | ||
value: tryNextLink, | ||
configurable: false, | ||
enumerable: false, | ||
writable: false, | ||
}); | ||
return error; | ||
return Object.assign(new this(error.message, tryNextLink), error); | ||
}; | ||
@@ -25,23 +21,1 @@ return ProviderError; | ||
export { ProviderError }; | ||
var CredentialsProviderError = (function (_super) { | ||
__extends(CredentialsProviderError, _super); | ||
function CredentialsProviderError(message, tryNextLink) { | ||
if (tryNextLink === void 0) { tryNextLink = true; } | ||
var _this = _super.call(this, message) || this; | ||
_this.tryNextLink = tryNextLink; | ||
_this.name = "CredentialsProviderError"; | ||
return _this; | ||
} | ||
CredentialsProviderError.from = function (error, tryNextLink) { | ||
if (tryNextLink === void 0) { tryNextLink = true; } | ||
Object.defineProperty(error, "tryNextLink", { | ||
value: tryNextLink, | ||
configurable: false, | ||
enumerable: false, | ||
writable: false, | ||
}); | ||
return error; | ||
}; | ||
return CredentialsProviderError; | ||
}(Error)); | ||
export { CredentialsProviderError }; |
@@ -0,1 +1,2 @@ | ||
export * from "./CredentialsProviderError"; | ||
export * from "./ProviderError"; | ||
@@ -2,0 +3,0 @@ export * from "./chain"; |
@@ -1,2 +0,2 @@ | ||
import { Provider } from "@aws-sdk/types"; | ||
import { MemoizedProvider, Provider } from "@aws-sdk/types"; | ||
interface MemoizeOverload { | ||
@@ -14,3 +14,3 @@ /** | ||
*/ | ||
<T>(provider: Provider<T>): Provider<T>; | ||
<T>(provider: Provider<T>): MemoizedProvider<T>; | ||
/** | ||
@@ -35,5 +35,5 @@ * Decorates a provider function with refreshing memoization. | ||
*/ | ||
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): Provider<T>; | ||
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): MemoizedProvider<T>; | ||
} | ||
export declare const memoize: MemoizeOverload; | ||
export {}; |
/** | ||
* An error representing a failure of an individual credential provider. | ||
* An error representing a failure of an individual provider. | ||
* | ||
@@ -9,24 +9,8 @@ * This error class has special meaning to the {@link chain} method. If a | ||
* ensures the chain will stop if an entirely unexpected error is encountered. | ||
* | ||
* @deprecated | ||
*/ | ||
export declare class ProviderError extends Error { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): ProviderError; | ||
} | ||
/** | ||
* An error representing a failure of an individual credential provider. | ||
* | ||
* This error class has special meaning to the {@link chain} method. If a | ||
* provider in the chain is rejected with an error, the chain will only proceed | ||
* to the next provider if the value of the `tryNextLink` property on the error | ||
* is truthy. This allows individual providers to halt the chain and also | ||
* ensures the chain will stop if an entirely unexpected error is encountered. | ||
*/ | ||
export declare class CredentialsProviderError extends Error { | ||
readonly tryNextLink: boolean; | ||
readonly name = "CredentialsProviderError"; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): CredentialsProviderError; | ||
} |
@@ -0,1 +1,2 @@ | ||
export * from "./CredentialsProviderError"; | ||
export * from "./ProviderError"; | ||
@@ -2,0 +3,0 @@ export * from "./chain"; |
@@ -1,9 +0,9 @@ | ||
import { Provider } from "@aws-sdk/types"; | ||
import { MemoizedProvider, Provider } from "@aws-sdk/types"; | ||
interface MemoizeOverload { | ||
<T>(provider: Provider<T>): Provider<T>; | ||
<T>(provider: Provider<T>): MemoizedProvider<T>; | ||
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): Provider<T>; | ||
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): MemoizedProvider<T>; | ||
} | ||
export declare const memoize: MemoizeOverload; | ||
export {}; |
export declare class ProviderError extends Error { | ||
readonly tryNextLink: boolean; | ||
name: string; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): ProviderError; | ||
} | ||
export declare class CredentialsProviderError extends Error { | ||
readonly tryNextLink: boolean; | ||
readonly name = "CredentialsProviderError"; | ||
constructor(message: string, tryNextLink?: boolean); | ||
static from(error: Error, tryNextLink?: boolean): CredentialsProviderError; | ||
} |
{ | ||
"name": "@aws-sdk/property-provider", | ||
"version": "3.54.1", | ||
"version": "3.55.0", | ||
"scripts": { | ||
@@ -22,4 +22,4 @@ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'", | ||
"dependencies": { | ||
"@aws-sdk/types": "3.54.1", | ||
"tslib": "^2.3.0" | ||
"@aws-sdk/types": "3.55.0", | ||
"tslib": "^2.3.1" | ||
}, | ||
@@ -51,4 +51,4 @@ "engines": { | ||
"typedoc": "0.19.2", | ||
"typescript": "~4.3.5" | ||
"typescript": "~4.6.2" | ||
} | ||
} |
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
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
57683
28
370
+ Added@aws-sdk/types@3.55.0(transitive)
- Removed@aws-sdk/types@3.54.1(transitive)
Updated@aws-sdk/types@3.55.0
Updatedtslib@^2.3.1