@smithy/property-provider 4.2.12 → 4.2.14
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/README.md +10 -3
- package/package.json +6 -7
- package/dist-types/ts3.4/CredentialsProviderError.d.ts +0 -31
- package/dist-types/ts3.4/ProviderError.d.ts +0 -39
- package/dist-types/ts3.4/TokenProviderError.d.ts +0 -31
- package/dist-types/ts3.4/chain.d.ts +0 -13
- package/dist-types/ts3.4/fromStatic.d.ts +0 -5
- package/dist-types/ts3.4/index.d.ts +0 -24
- package/dist-types/ts3.4/memoize.d.ts +0 -40
package/README.md
CHANGED
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@smithy/property-provider)
|
|
4
4
|
[](https://www.npmjs.com/package/@smithy/property-provider)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
### :warning: Internal API :warning:
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> This is an internal package.
|
|
9
|
+
> That means this is used as a dependency for other, public packages, but
|
|
10
|
+
> should not be taken directly as a dependency in your application's `package.json`.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
> If you are updating the version of this package, for example to bring in a
|
|
13
|
+
> bug-fix, you should do so by updating your application lockfile with
|
|
14
|
+
> e.g. `npm up @scope/package` or equivalent command in another
|
|
15
|
+
> package manager, rather than taking a direct dependency.
|
|
16
|
+
|
|
17
|
+
---
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/property-provider",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.14",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"build": "concurrently 'yarn:build:
|
|
6
|
-
"build:cjs": "node ../../scripts/inline property-provider",
|
|
7
|
-
"build:es": "yarn g:tsc -p tsconfig.es.json",
|
|
5
|
+
"build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
|
|
6
|
+
"build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline property-provider",
|
|
8
7
|
"build:types": "yarn g:tsc -p tsconfig.types.json",
|
|
9
8
|
"build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
|
|
10
|
-
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
11
9
|
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
|
|
12
|
-
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
|
|
13
10
|
"format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
|
|
11
|
+
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
|
|
12
|
+
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
14
13
|
"test": "yarn g:vitest run",
|
|
15
14
|
"test:watch": "yarn g:vitest watch"
|
|
16
15
|
},
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"license": "Apache-2.0",
|
|
25
24
|
"sideEffects": false,
|
|
26
25
|
"dependencies": {
|
|
27
|
-
"@smithy/types": "^4.
|
|
26
|
+
"@smithy/types": "^4.14.1",
|
|
28
27
|
"tslib": "^2.6.2"
|
|
29
28
|
},
|
|
30
29
|
"engines": {
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ProviderErrorOptionsType } from "./ProviderError";
|
|
2
|
-
import { ProviderError } from "./ProviderError";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*
|
|
6
|
-
* An error representing a failure of an individual credential provider.
|
|
7
|
-
*
|
|
8
|
-
* This error class has special meaning to the {@link chain} method. If a
|
|
9
|
-
* provider in the chain is rejected with an error, the chain will only proceed
|
|
10
|
-
* to the next provider if the value of the `tryNextLink` property on the error
|
|
11
|
-
* is truthy. This allows individual providers to halt the chain and also
|
|
12
|
-
* ensures the chain will stop if an entirely unexpected error is encountered.
|
|
13
|
-
*/
|
|
14
|
-
export declare class CredentialsProviderError extends ProviderError {
|
|
15
|
-
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* @override
|
|
18
|
-
* @deprecated constructor should be given a logger.
|
|
19
|
-
*/
|
|
20
|
-
constructor(message: string);
|
|
21
|
-
/**
|
|
22
|
-
* @override
|
|
23
|
-
* @deprecated constructor should be given a logger.
|
|
24
|
-
*/
|
|
25
|
-
constructor(message: string, tryNextLink: boolean | undefined);
|
|
26
|
-
/**
|
|
27
|
-
* @override
|
|
28
|
-
* This signature is preferred for logging capability.
|
|
29
|
-
*/
|
|
30
|
-
constructor(message: string, options: ProviderErrorOptionsType);
|
|
31
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { Logger } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @public
|
|
4
|
-
*/
|
|
5
|
-
export type ProviderErrorOptionsType = {
|
|
6
|
-
tryNextLink?: boolean | undefined;
|
|
7
|
-
logger?: Logger;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* @public
|
|
11
|
-
*
|
|
12
|
-
* An error representing a failure of an individual provider.
|
|
13
|
-
*
|
|
14
|
-
* This error class has special meaning to the {@link chain} method. If a
|
|
15
|
-
* provider in the chain is rejected with an error, the chain will only proceed
|
|
16
|
-
* to the next provider if the value of the `tryNextLink` property on the error
|
|
17
|
-
* is truthy. This allows individual providers to halt the chain and also
|
|
18
|
-
* ensures the chain will stop if an entirely unexpected error is encountered.
|
|
19
|
-
*/
|
|
20
|
-
export declare class ProviderError extends Error {
|
|
21
|
-
name: string;
|
|
22
|
-
readonly tryNextLink: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated constructor should be given a logger.
|
|
25
|
-
*/
|
|
26
|
-
constructor(message: string);
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated constructor should be given a logger.
|
|
29
|
-
*/
|
|
30
|
-
constructor(message: string, tryNextLink: boolean | undefined);
|
|
31
|
-
/**
|
|
32
|
-
* This signature is preferred for logging capability.
|
|
33
|
-
*/
|
|
34
|
-
constructor(message: string, options: ProviderErrorOptionsType);
|
|
35
|
-
/**
|
|
36
|
-
* @deprecated use new operator.
|
|
37
|
-
*/
|
|
38
|
-
static from(error: Error, options?: boolean | ProviderErrorOptionsType): ProviderError;
|
|
39
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ProviderErrorOptionsType } from "./ProviderError";
|
|
2
|
-
import { ProviderError } from "./ProviderError";
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*
|
|
6
|
-
* An error representing a failure of an individual token provider.
|
|
7
|
-
*
|
|
8
|
-
* This error class has special meaning to the {@link chain} method. If a
|
|
9
|
-
* provider in the chain is rejected with an error, the chain will only proceed
|
|
10
|
-
* to the next provider if the value of the `tryNextLink` property on the error
|
|
11
|
-
* is truthy. This allows individual providers to halt the chain and also
|
|
12
|
-
* ensures the chain will stop if an entirely unexpected error is encountered.
|
|
13
|
-
*/
|
|
14
|
-
export declare class TokenProviderError extends ProviderError {
|
|
15
|
-
name: string;
|
|
16
|
-
/**
|
|
17
|
-
* @override
|
|
18
|
-
* @deprecated constructor should be given a logger.
|
|
19
|
-
*/
|
|
20
|
-
constructor(message: string);
|
|
21
|
-
/**
|
|
22
|
-
* @override
|
|
23
|
-
* @deprecated constructor should be given a logger.
|
|
24
|
-
*/
|
|
25
|
-
constructor(message: string, tryNextLink: boolean | undefined);
|
|
26
|
-
/**
|
|
27
|
-
* @override
|
|
28
|
-
* This signature is preferred for logging capability.
|
|
29
|
-
*/
|
|
30
|
-
constructor(message: string, options: ProviderErrorOptionsType);
|
|
31
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Provider } from "@smithy/types";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*
|
|
5
|
-
* Compose a single credential provider function from multiple credential
|
|
6
|
-
* providers. The first provider in the argument list will always be invoked;
|
|
7
|
-
* subsequent providers in the list will be invoked in the order in which the
|
|
8
|
-
* were received if the preceding provider did not successfully resolve.
|
|
9
|
-
*
|
|
10
|
-
* If no providers were received or no provider resolves successfully, the
|
|
11
|
-
* returned promise will be rejected.
|
|
12
|
-
*/
|
|
13
|
-
export declare const chain: <T>(...providers: Array<Provider<T>>) => Provider<T>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export * from "./CredentialsProviderError";
|
|
5
|
-
/**
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export * from "./ProviderError";
|
|
9
|
-
/**
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export * from "./TokenProviderError";
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export * from "./chain";
|
|
17
|
-
/**
|
|
18
|
-
* @internal
|
|
19
|
-
*/
|
|
20
|
-
export * from "./fromStatic";
|
|
21
|
-
/**
|
|
22
|
-
* @internal
|
|
23
|
-
*/
|
|
24
|
-
export * from "./memoize";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { MemoizedProvider, Provider } from "@smithy/types";
|
|
2
|
-
interface MemoizeOverload {
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* Decorates a provider function with either static memoization.
|
|
6
|
-
*
|
|
7
|
-
* To create a statically memoized provider, supply a provider as the only
|
|
8
|
-
* argument to this function. The provider will be invoked once, and all
|
|
9
|
-
* invocations of the provider returned by `memoize` will return the same
|
|
10
|
-
* promise object.
|
|
11
|
-
*
|
|
12
|
-
* @param provider The provider whose result should be cached indefinitely.
|
|
13
|
-
*/
|
|
14
|
-
<T>(provider: Provider<T>): MemoizedProvider<T>;
|
|
15
|
-
/**
|
|
16
|
-
* Decorates a provider function with refreshing memoization.
|
|
17
|
-
*
|
|
18
|
-
* @param provider The provider whose result should be cached.
|
|
19
|
-
* @param isExpired A function that will evaluate the resolved value and
|
|
20
|
-
* determine if it is expired. For example, when
|
|
21
|
-
* memoizing AWS credential providers, this function
|
|
22
|
-
* should return `true` when the credential's
|
|
23
|
-
* expiration is in the past (or very near future) and
|
|
24
|
-
* `false` otherwise.
|
|
25
|
-
* @param requiresRefresh A function that will evaluate the resolved value and
|
|
26
|
-
* determine if it represents static value or one that
|
|
27
|
-
* will eventually need to be refreshed. For example,
|
|
28
|
-
* AWS credentials that have no defined expiration will
|
|
29
|
-
* never need to be refreshed, so this function would
|
|
30
|
-
* return `true` if the credentials resolved by the
|
|
31
|
-
* underlying provider had an expiration and `false`
|
|
32
|
-
* otherwise.
|
|
33
|
-
*/
|
|
34
|
-
<T>(provider: Provider<T>, isExpired: (resolved: T) => boolean, requiresRefresh?: (resolved: T) => boolean): MemoizedProvider<T>;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* @internal
|
|
38
|
-
*/
|
|
39
|
-
export declare const memoize: MemoizeOverload;
|
|
40
|
-
export {};
|