@smithy/core 3.31.1 → 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-cjs/submodules/schema/index.js +0 -10
- package/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js +8 -5
- package/dist-es/submodules/schema/schemas/ListSchema.js +0 -2
- package/dist-es/submodules/schema/schemas/MapSchema.js +0 -2
- package/dist-es/submodules/schema/schemas/OperationSchema.js +0 -2
- package/dist-es/submodules/schema/schemas/SimpleSchema.js +0 -2
- package/dist-es/submodules/schema/schemas/StructureSchema.js +0 -2
- 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 +2 -6
|
@@ -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
|
|
|
@@ -140,8 +140,6 @@ class Schema {
|
|
|
140
140
|
|
|
141
141
|
class ListSchema extends Schema {
|
|
142
142
|
static symbol = Symbol.for("@smithy/lis");
|
|
143
|
-
name;
|
|
144
|
-
traits;
|
|
145
143
|
valueSchema;
|
|
146
144
|
symbol = ListSchema.symbol;
|
|
147
145
|
}
|
|
@@ -154,8 +152,6 @@ const list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSch
|
|
|
154
152
|
|
|
155
153
|
class MapSchema extends Schema {
|
|
156
154
|
static symbol = Symbol.for("@smithy/map");
|
|
157
|
-
name;
|
|
158
|
-
traits;
|
|
159
155
|
keySchema;
|
|
160
156
|
valueSchema;
|
|
161
157
|
symbol = MapSchema.symbol;
|
|
@@ -170,8 +166,6 @@ const map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(n
|
|
|
170
166
|
|
|
171
167
|
class OperationSchema extends Schema {
|
|
172
168
|
static symbol = Symbol.for("@smithy/ope");
|
|
173
|
-
name;
|
|
174
|
-
traits;
|
|
175
169
|
input;
|
|
176
170
|
output;
|
|
177
171
|
symbol = OperationSchema.symbol;
|
|
@@ -186,8 +180,6 @@ const op = (namespace, name, traits, input, output) => Schema.assign(new Operati
|
|
|
186
180
|
|
|
187
181
|
class StructureSchema extends Schema {
|
|
188
182
|
static symbol = Symbol.for("@smithy/str");
|
|
189
|
-
name;
|
|
190
|
-
traits;
|
|
191
183
|
memberNames;
|
|
192
184
|
memberList;
|
|
193
185
|
symbol = StructureSchema.symbol;
|
|
@@ -545,9 +537,7 @@ const isStaticSchema = (sc) => Array.isArray(sc) && sc.length >= 5;
|
|
|
545
537
|
|
|
546
538
|
class SimpleSchema extends Schema {
|
|
547
539
|
static symbol = Symbol.for("@smithy/sim");
|
|
548
|
-
name;
|
|
549
540
|
schemaRef;
|
|
550
|
-
traits;
|
|
551
541
|
symbol = SimpleSchema.symbol;
|
|
552
542
|
}
|
|
553
543
|
const sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
|
|
@@ -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
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { Schema } from "./Schema";
|
|
2
2
|
export class SimpleSchema extends Schema {
|
|
3
3
|
static symbol = Symbol.for("@smithy/sim");
|
|
4
|
-
name;
|
|
5
4
|
schemaRef;
|
|
6
|
-
traits;
|
|
7
5
|
symbol = SimpleSchema.symbol;
|
|
8
6
|
}
|
|
9
7
|
export const sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
|
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,14 +226,13 @@
|
|
|
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",
|
|
236
232
|
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
|
|
237
233
|
},
|
|
238
234
|
"dependencies": {
|
|
239
|
-
"@smithy/types": "^4.
|
|
235
|
+
"@smithy/types": "^4.17.0",
|
|
240
236
|
"tslib": "^2.6.2"
|
|
241
237
|
},
|
|
242
238
|
"devDependencies": {
|