@middy/appconfig 7.0.2 → 7.1.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/README.md +2 -2
- package/index.d.ts +4 -2
- package/index.js +7 -7
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://github.com/middyjs/middy/actions/workflows/test-unit.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-unit.yml/badge.svg" alt="GitHub Actions unit test status"></a>
|
|
7
7
|
<a href="https://github.com/middyjs/middy/actions/workflows/test-dast.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-dast.yml/badge.svg" alt="GitHub Actions dast test status"></a>
|
|
8
|
-
<a href="https://github.com/middyjs/middy/actions/workflows/test-perf.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-
|
|
8
|
+
<a href="https://github.com/middyjs/middy/actions/workflows/test-perf.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-perf.yml/badge.svg" alt="GitHub Actions perf test status"></a>
|
|
9
9
|
<a href="https://github.com/middyjs/middy/actions/workflows/test-sast.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-sast.yml/badge.svg" alt="GitHub Actions SAST test status"></a>
|
|
10
10
|
<a href="https://github.com/middyjs/middy/actions/workflows/test-lint.yml"><img src="https://github.com/middyjs/middy/actions/workflows/test-lint.yml/badge.svg" alt="GitHub Actions lint test status"></a>
|
|
11
11
|
<br/>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
## License
|
|
34
34
|
|
|
35
|
-
Licensed under [MIT License](LICENSE). Copyright (c) 2017-
|
|
35
|
+
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2026 [will Farrell](https://github.com/willfarrell), [Luciano Mammino](https://github.com/lmammino), and [Middy contributors](https://github.com/middyjs/middy/graphs/contributors).
|
|
36
36
|
|
|
37
37
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
|
|
38
38
|
<img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
1
3
|
import type {
|
|
2
4
|
AppConfigDataClient,
|
|
3
5
|
AppConfigDataClientConfig,
|
|
@@ -10,8 +12,8 @@ import type { Context as LambdaContext } from "aws-lambda";
|
|
|
10
12
|
export type ParamType<T> = StartConfigurationSessionRequest & {
|
|
11
13
|
__returnType?: T;
|
|
12
14
|
};
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
+
export declare function appConfigParam<T>(
|
|
16
|
+
name: StartConfigurationSessionRequest,
|
|
15
17
|
): ParamType<T>;
|
|
16
18
|
|
|
17
19
|
export interface AppConfigOptions<AwsAppConfigClient = AppConfigDataClient>
|
package/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
// Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
1
3
|
import {
|
|
2
4
|
AppConfigDataClient,
|
|
3
5
|
GetLatestConfigurationCommand,
|
|
@@ -33,8 +35,8 @@ const appConfigMiddleware = (opts = {}) => {
|
|
|
33
35
|
...defaults,
|
|
34
36
|
...opts,
|
|
35
37
|
};
|
|
36
|
-
const configurationTokenCache =
|
|
37
|
-
const configurationCache =
|
|
38
|
+
const configurationTokenCache = Object.create(null);
|
|
39
|
+
const configurationCache = Object.create(null);
|
|
38
40
|
|
|
39
41
|
function fetchLatestConfigurationRequest(configToken, internalKey) {
|
|
40
42
|
const command = new GetLatestConfigurationCommand({
|
|
@@ -51,7 +53,7 @@ const appConfigMiddleware = (opts = {}) => {
|
|
|
51
53
|
return configurationCache[internalKey];
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
let value =
|
|
56
|
+
let value = new TextDecoder().decode(configResp.Configuration);
|
|
55
57
|
if (contentTypePattern.test(configResp.ContentType)) {
|
|
56
58
|
value = jsonSafeParse(value);
|
|
57
59
|
}
|
|
@@ -122,8 +124,6 @@ const appConfigMiddleware = (opts = {}) => {
|
|
|
122
124
|
export default appConfigMiddleware;
|
|
123
125
|
|
|
124
126
|
// used for TS type inference (see index.d.ts)
|
|
125
|
-
export function
|
|
126
|
-
return
|
|
127
|
+
export function appConfigParam(name) {
|
|
128
|
+
return name;
|
|
127
129
|
}
|
|
128
|
-
|
|
129
|
-
// # sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/appconfig",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "AppConfig middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
13
|
"module": "./index.js",
|
|
14
|
+
"sideEffects": false,
|
|
14
15
|
"exports": {
|
|
15
16
|
".": {
|
|
16
17
|
"import": {
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"@aws-sdk/client-appconfigdata": "^3.0.0"
|
|
66
67
|
},
|
|
67
68
|
"peerDependenciesMeta": {
|
|
68
|
-
"@aws-sdk/client-
|
|
69
|
+
"@aws-sdk/client-appconfigdata": {
|
|
69
70
|
"optional": true
|
|
70
71
|
}
|
|
71
72
|
},
|