@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.
@@ -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.httpHandler = handler;
936
+ runtimeConfig.requestHandler = handler;
934
937
  },
935
938
  httpHandler() {
936
- return runtimeConfig.httpHandler;
939
+ return runtimeConfig.requestHandler;
937
940
  },
938
941
  updateHttpClientConfig(key, value) {
939
- runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
942
+ runtimeConfig.requestHandler?.updateHttpClientConfig(key, value);
940
943
  },
941
944
  httpHandlerConfigs() {
942
- return runtimeConfig.httpHandler.httpHandlerConfigs();
945
+ return runtimeConfig.requestHandler.httpHandlerConfigs();
943
946
  },
944
947
  };
945
948
  };
946
949
  const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
947
950
  return {
948
- httpHandler: httpHandlerExtensionConfiguration.httpHandler(),
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.httpHandler = handler;
7
+ runtimeConfig.requestHandler = handler;
5
8
  },
6
9
  httpHandler() {
7
- return runtimeConfig.httpHandler;
10
+ return runtimeConfig.requestHandler;
8
11
  },
9
12
  updateHttpClientConfig(key, value) {
10
- runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
13
+ runtimeConfig.requestHandler?.updateHttpClientConfig(key, value);
11
14
  },
12
15
  httpHandlerConfigs() {
13
- return runtimeConfig.httpHandler.httpHandlerConfigs();
16
+ return runtimeConfig.requestHandler.httpHandlerConfigs();
14
17
  },
15
18
  };
16
19
  };
17
20
  export const resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
18
21
  return {
19
- httpHandler: httpHandlerExtensionConfiguration.httpHandler(),
22
+ requestHandler: httpHandlerExtensionConfiguration.httpHandler(),
20
23
  };
21
24
  };
@@ -1,8 +1,6 @@
1
1
  import { Schema } from "./Schema";
2
2
  export class ListSchema extends Schema {
3
3
  static symbol = Symbol.for("@smithy/lis");
4
- name;
5
- traits;
6
4
  valueSchema;
7
5
  symbol = ListSchema.symbol;
8
6
  }
@@ -1,8 +1,6 @@
1
1
  import { Schema } from "./Schema";
2
2
  export class MapSchema extends Schema {
3
3
  static symbol = Symbol.for("@smithy/map");
4
- name;
5
- traits;
6
4
  keySchema;
7
5
  valueSchema;
8
6
  symbol = MapSchema.symbol;
@@ -1,8 +1,6 @@
1
1
  import { Schema } from "./Schema";
2
2
  export class OperationSchema extends Schema {
3
3
  static symbol = Symbol.for("@smithy/ope");
4
- name;
5
- traits;
6
4
  input;
7
5
  output;
8
6
  symbol = OperationSchema.symbol;
@@ -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(), {
@@ -1,8 +1,6 @@
1
1
  import { Schema } from "./Schema";
2
2
  export class StructureSchema extends Schema {
3
3
  static symbol = Symbol.for("@smithy/str");
4
- name;
5
- traits;
6
4
  memberNames;
7
5
  memberList;
8
6
  symbol = StructureSchema.symbol;
@@ -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
- httpHandler: HttpHandler<HandlerConfig>;
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 object = {}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig>) => {
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
- httpHandler: HttpHandler<HandlerConfig>;
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 object = {}>(runtimeConfig: HttpHandlerExtensionConfigType<HandlerConfig>) => {
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.31.1",
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.16.1",
235
+ "@smithy/types": "^4.17.0",
240
236
  "tslib": "^2.6.2"
241
237
  },
242
238
  "devDependencies": {