@smithy/core 3.32.0 → 3.33.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/CHANGELOG.md +1504 -0
- package/dist-cjs/submodules/protocols/index.js +8 -5
- package/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +8 -5
- package/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
- package/dist-types/ts3.4/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +7 -2
- package/package.json +1 -5
|
@@ -928,24 +928,27 @@ class Fields {
|
|
|
928
928
|
}
|
|
929
929
|
|
|
930
930
|
const getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
931
|
+
if (runtimeConfig.logger && runtimeConfig.logger.constructor?.name !== "NoOpLogger") {
|
|
932
|
+
runtimeConfig.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"), runtimeConfig.logger);
|
|
933
|
+
}
|
|
931
934
|
return {
|
|
932
935
|
setHttpHandler(handler) {
|
|
933
|
-
runtimeConfig.
|
|
936
|
+
runtimeConfig.requestHandler = handler;
|
|
934
937
|
},
|
|
935
938
|
httpHandler() {
|
|
936
|
-
return runtimeConfig.
|
|
939
|
+
return runtimeConfig.requestHandler;
|
|
937
940
|
},
|
|
938
941
|
updateHttpClientConfig(key, value) {
|
|
939
|
-
runtimeConfig.
|
|
942
|
+
runtimeConfig.requestHandler?.updateHttpClientConfig(key, value);
|
|
940
943
|
},
|
|
941
944
|
httpHandlerConfigs() {
|
|
942
|
-
return runtimeConfig.
|
|
945
|
+
return runtimeConfig.requestHandler.httpHandlerConfigs();
|
|
943
946
|
},
|
|
944
947
|
};
|
|
945
948
|
};
|
|
946
949
|
const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
|
|
947
950
|
return {
|
|
948
|
-
|
|
951
|
+
requestHandler: httpHandlerExtensionConfiguration.httpHandler(),
|
|
949
952
|
};
|
|
950
953
|
};
|
|
951
954
|
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
export const getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
if (runtimeConfig.logger && runtimeConfig.logger.constructor?.name !== "NoOpLogger") {
|
|
3
|
+
runtimeConfig.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"), runtimeConfig.logger);
|
|
4
|
+
}
|
|
2
5
|
return {
|
|
3
6
|
setHttpHandler(handler) {
|
|
4
|
-
runtimeConfig.
|
|
7
|
+
runtimeConfig.requestHandler = handler;
|
|
5
8
|
},
|
|
6
9
|
httpHandler() {
|
|
7
|
-
return runtimeConfig.
|
|
10
|
+
return runtimeConfig.requestHandler;
|
|
8
11
|
},
|
|
9
12
|
updateHttpClientConfig(key, value) {
|
|
10
|
-
runtimeConfig.
|
|
13
|
+
runtimeConfig.requestHandler?.updateHttpClientConfig(key, value);
|
|
11
14
|
},
|
|
12
15
|
httpHandlerConfigs() {
|
|
13
|
-
return runtimeConfig.
|
|
16
|
+
return runtimeConfig.requestHandler.httpHandlerConfigs();
|
|
14
17
|
},
|
|
15
18
|
};
|
|
16
19
|
};
|
|
17
20
|
export const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
|
|
18
21
|
return {
|
|
19
|
-
|
|
22
|
+
requestHandler: httpHandlerExtensionConfiguration.httpHandler(),
|
|
20
23
|
};
|
|
21
24
|
};
|
package/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Logger } from "@smithy/types";
|
|
1
2
|
import type { HttpHandler } from "../httpHandler";
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
@@ -12,14 +13,18 @@ export interface HttpHandlerExtensionConfiguration<HandlerConfig extends object
|
|
|
12
13
|
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export type HttpHandlerExtensionConfigType<HandlerConfig extends object = {}> = Partial<{
|
|
15
|
-
|
|
16
|
+
requestHandler: HttpHandler<HandlerConfig>;
|
|
16
17
|
}>;
|
|
17
18
|
/**
|
|
18
19
|
* Helper function to resolve default extension configuration from runtime config
|
|
19
20
|
*
|
|
20
21
|
* @internal
|
|
21
22
|
*/
|
|
22
|
-
export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extends
|
|
23
|
+
export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extends {
|
|
24
|
+
logger?: Logger;
|
|
25
|
+
}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig> & {
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
}) => {
|
|
23
28
|
setHttpHandler(handler: HttpHandler<HandlerConfig>): void;
|
|
24
29
|
httpHandler(): HttpHandler<HandlerConfig>;
|
|
25
30
|
updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Logger } from "@smithy/types";
|
|
1
2
|
import { HttpHandler } from "../httpHandler";
|
|
2
3
|
/**
|
|
3
4
|
* @internal
|
|
@@ -12,14 +13,18 @@ export interface HttpHandlerExtensionConfiguration<HandlerConfig extends object
|
|
|
12
13
|
* @internal
|
|
13
14
|
*/
|
|
14
15
|
export type HttpHandlerExtensionConfigType<HandlerConfig extends object = {}> = Partial<{
|
|
15
|
-
|
|
16
|
+
requestHandler: HttpHandler<HandlerConfig>;
|
|
16
17
|
}>;
|
|
17
18
|
/**
|
|
18
19
|
* Helper function to resolve default extension configuration from runtime config
|
|
19
20
|
*
|
|
20
21
|
* @internal
|
|
21
22
|
*/
|
|
22
|
-
export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extends
|
|
23
|
+
export declare const getHttpHandlerExtensionConfiguration: <HandlerConfig extends {
|
|
24
|
+
logger?: Logger;
|
|
25
|
+
}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig> & {
|
|
26
|
+
logger?: Logger;
|
|
27
|
+
}) => {
|
|
23
28
|
setHttpHandler(handler: HttpHandler<HandlerConfig>): void;
|
|
24
29
|
httpHandler(): HttpHandler<HandlerConfig>;
|
|
25
30
|
updateHttpClientConfig(key: keyof HandlerConfig, value: HandlerConfig[typeof key]): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.33.0",
|
|
4
4
|
"homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -214,9 +214,6 @@
|
|
|
214
214
|
"require": "./dist-cjs/submodules/transport/index.js"
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
|
-
"publishConfig": {
|
|
218
|
-
"directory": ".release/package"
|
|
219
|
-
},
|
|
220
217
|
"scripts": {
|
|
221
218
|
"benchmark:cbor": "node ./scripts/cbor-perf.mjs",
|
|
222
219
|
"benchmark:checksum": "node ./scripts/checksum-perf.mjs",
|
|
@@ -229,7 +226,6 @@
|
|
|
229
226
|
"extract:docs": "api-extractor run --local",
|
|
230
227
|
"lint": "node ../../scripts/validation/submodules-linter.js",
|
|
231
228
|
"prebuild": "yarn lint",
|
|
232
|
-
"stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
233
229
|
"test": "yarn g:vitest run",
|
|
234
230
|
"test:watch": "yarn g:vitest watch",
|
|
235
231
|
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
|