@cdk8s/awscdk-resolver 0.0.690 → 0.0.692

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.
Files changed (77) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/dist-cjs/index.js +3 -3
  4. package/node_modules/@aws-sdk/client-cloudformation/dist-es/schemas/schemas_0.js +2 -2
  5. package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormation.d.ts +187 -181
  6. package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/CloudFormation.d.ts +184 -180
  7. package/node_modules/@aws-sdk/client-cloudformation/package.json +8 -8
  8. package/node_modules/@aws-sdk/core/package.json +6 -6
  9. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  10. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  11. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  12. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  13. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  14. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  15. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  16. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -3
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +3 -3
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -3
  20. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -3
  21. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -11
  22. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +2 -2
  23. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +2 -2
  24. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +2 -2
  25. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +2 -2
  26. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +13 -10
  27. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentity.d.ts +11 -5
  28. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +11 -5
  29. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSO.d.ts +9 -3
  30. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDC.d.ts +9 -3
  31. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STS.d.ts +33 -8
  32. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +22 -3
  33. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +3 -0
  34. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -0
  35. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +22 -3
  36. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/models_0.d.ts +40 -0
  37. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentity.d.ts +14 -5
  38. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/Signin.d.ts +11 -5
  39. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSO.d.ts +9 -3
  40. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDC.d.ts +9 -3
  41. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STS.d.ts +11 -5
  42. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/models_0.d.ts +6 -0
  43. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  44. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
  45. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  46. package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +1 -0
  47. package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +1 -0
  48. package/node_modules/@aws-sdk/types/package.json +2 -2
  49. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  50. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +22 -37
  51. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -4
  52. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +49 -8
  53. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +12 -7
  54. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +22 -22
  55. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +0 -15
  56. package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -1
  57. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +8 -1
  58. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +18 -3
  59. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +49 -8
  60. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +12 -7
  61. package/node_modules/@smithy/core/dist-types/submodules/cbor/parseCborBody.d.ts +3 -0
  62. package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +1 -1
  63. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/client.d.ts +11 -3
  64. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +17 -7
  65. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +2 -2
  66. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/parseCborBody.d.ts +3 -0
  67. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -1
  68. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/client.d.ts +11 -3
  69. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +21 -7
  70. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +2 -2
  71. package/node_modules/@smithy/core/package.json +2 -2
  72. package/node_modules/@smithy/types/dist-types/metrics.d.ts +8 -7
  73. package/node_modules/@smithy/types/dist-types/middleware.d.ts +5 -0
  74. package/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +8 -7
  75. package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +5 -0
  76. package/node_modules/@smithy/types/package.json +1 -1
  77. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import type { EventStreamSerde } from "@smithy/core/event-streams";
2
2
  import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
- import type { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
+ import type { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer, StaticErrorSchema } from "@smithy/types";
4
4
  import { SerdeContext } from "./SerdeContext";
5
5
  /**
6
6
  * Abstract base for HTTP-based client protocols.
@@ -43,6 +43,16 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
43
43
  protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
44
44
  protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
45
45
  protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
46
+ /**
47
+ * For a given error short name, a list of preferred namespaces, and a list of preferred registries,
48
+ * find the error's schema and class.
49
+ *
50
+ * @param name - short error shape id.
51
+ * @param namespaces - must contain '*' to allow matching against an undeclared namespace.
52
+ * @param registries - in which to look.
53
+ * @returns matched error schema and constructor, with worst case being the least-descriptive DocumentSchema and native Error.
54
+ */
55
+ protected resolveError(name: string, namespaces: string[], registries: TypeRegistry[]): [StaticErrorSchema, any, "modeled" | "synthetic" | "native"];
46
56
  /**
47
57
  * @param eventStream - the iterable provided by the caller.
48
58
  * @param requestSchema - the schema of the event stream container (struct).
@@ -74,12 +84,6 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
74
84
  * Loads eventStream capability async (for chunking).
75
85
  */
76
86
  protected loadEventStreamCapability(): Promise<EventStreamSerde>;
77
- /**
78
- * Returns a platform-specific EventStreamMarshaller.
79
- * Prefers user-injected marshaller from serdeContext (via client config),
80
- * falls back to the dynamically imported provider.
81
- */
82
- private resolveEventStreamMarshaller;
83
87
  /**
84
88
  * @returns content-type default header value for event stream events and other documents.
85
89
  */
@@ -92,4 +96,10 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
92
96
  protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
93
97
  protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[]>;
94
98
  protected getEventStreamMarshaller(): EventStreamMarshaller;
99
+ /**
100
+ * Returns a platform-specific EventStreamMarshaller.
101
+ * Prefers user-injected marshaller from serdeContext (via client config),
102
+ * falls back to the dynamically imported provider.
103
+ */
104
+ private resolveEventStreamMarshaller;
95
105
  }
@@ -10,10 +10,10 @@ export declare class TypeRegistry {
10
10
  private schemas;
11
11
  private exceptions;
12
12
  static readonly registries: Map<string, TypeRegistry>;
13
- private constructor();
13
+ constructor(namespace: string, schemas?: Map<string, ISchema>, exceptions?: Map<StaticErrorSchema, any>);
14
14
  /**
15
15
  * @param namespace - specifier.
16
- * @returns the schema for that namespace, creating it if necessary.
16
+ * @returns the TypeRegistry for that namespace, creating it if necessary.
17
17
  */
18
18
  static for(namespace: string): TypeRegistry;
19
19
  /**
@@ -18,6 +18,9 @@ export declare const dateToTag: (date: Date) => {
18
18
  */
19
19
  export declare const parseCborErrorBody: (errorBody: any, context: SerdeContext) => Promise<any>;
20
20
  /**
21
+ * Trims error.__type
22
+ * "com.a.b#Error:Sender,tag" -> "com.a.b#Error"
23
+ *
21
24
  * @internal
22
25
  */
23
26
  export declare const loadSmithyRpcV2CborErrorCode: (output: HttpResponse, data: any) => string | undefined;
@@ -5,7 +5,7 @@ export { invalidFunction } from "./invalid-dependency/invalidFunction";
5
5
  export { invalidProvider } from "./invalid-dependency/invalidProvider";
6
6
  export { createWaiter } from "./util-waiter/createWaiter";
7
7
  export { waiterServiceDefaults, WaiterState, checkExceptions, WaiterConfiguration, WaiterOptions, WaiterResult } from "./util-waiter/waiter";
8
- export { Client, SmithyConfiguration, SmithyResolvedConfiguration } from "./smithy-client/client";
8
+ export { Client, SmithyClientRequestOptions, SmithyConfiguration, SmithyResolvedConfiguration } from "./smithy-client/client";
9
9
  export { Command, CommandImpl } from "./smithy-client/command";
10
10
  export { SENSITIVE_STRING } from "./smithy-client/constants";
11
11
  export { createAggregatedClient } from "./smithy-client/create-aggregated-client";
@@ -1,4 +1,12 @@
1
- import { $ClientProtocol, $ClientProtocolCtor, ClientProtocol, ClientProtocolCtor, Command, FetchHttpHandlerOptions, Client as IClient, MetadataBearer, MiddlewareStack, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
1
+ import { $ClientProtocol, $ClientProtocolCtor, ClientProtocol, ClientProtocolCtor, Command, FetchHttpHandlerOptions, Client as IClient, MetadataBearer, MetricsRecorder, MiddlewareStack, NodeHttpHandlerOptions, RequestHandler } from "@smithy/types";
2
+ /**
3
+ * Options accepted for an individual Smithy client request.
4
+ *
5
+ * @public
6
+ */
7
+ export type SmithyClientRequestOptions<HandlerOptions> = unknown extends HandlerOptions ? HandlerOptions : HandlerOptions extends unknown ? keyof HandlerOptions extends never ? HandlerOptions : HandlerOptions & {
8
+ metricsRecorder?: MetricsRecorder<unknown>;
9
+ } : never;
2
10
  /**
3
11
  * @public
4
12
  */
@@ -77,8 +85,8 @@ export declare class Client<HandlerOptions, ClientInput extends object, ClientOu
77
85
  */
78
86
  private handlers?;
79
87
  constructor(config: ResolvedClientConfiguration);
80
- send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options?: HandlerOptions): Promise<OutputType>;
88
+ send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options?: SmithyClientRequestOptions<HandlerOptions>): Promise<OutputType>;
81
89
  send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, cb: (err: any, data?: OutputType) => void): void;
82
- send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options: HandlerOptions, cb: (err: any, data?: OutputType) => void): void;
90
+ send<InputType extends ClientInput, OutputType extends ClientOutput>(command: Command<ClientInput, InputType, ClientOutput, OutputType, SmithyResolvedConfiguration<HandlerOptions>>, options: SmithyClientRequestOptions<HandlerOptions>, cb: (err: any, data?: OutputType) => void): void;
83
91
  destroy(): void;
84
92
  }
@@ -1,6 +1,6 @@
1
1
  import { EventStreamSerde } from "@smithy/core/event-streams";
2
2
  import { NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
3
- import { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
3
+ import { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, EventStreamMarshaller, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer, StaticErrorSchema } from "@smithy/types";
4
4
  import { SerdeContext } from "./SerdeContext";
5
5
  /**
6
6
  * Abstract base for HTTP-based client protocols.
@@ -43,6 +43,20 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
43
43
  protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
44
44
  protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
45
45
  protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
46
+ /**
47
+ * For a given error short name, a list of preferred namespaces, and a list of preferred registries,
48
+ * find the error's schema and class.
49
+ *
50
+ * @param name - short error shape id.
51
+ * @param namespaces - must contain '*' to allow matching against an undeclared namespace.
52
+ * @param registries - in which to look.
53
+ * @returns matched error schema and constructor, with worst case being the least-descriptive DocumentSchema and native Error.
54
+ */
55
+ protected resolveError(name: string, namespaces: string[], registries: TypeRegistry[]): [
56
+ StaticErrorSchema,
57
+ any,
58
+ "modeled" | "synthetic" | "native"
59
+ ];
46
60
  /**
47
61
  * @param eventStream - the iterable provided by the caller.
48
62
  * @param requestSchema - the schema of the event stream container (struct).
@@ -74,12 +88,6 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
74
88
  * Loads eventStream capability async (for chunking).
75
89
  */
76
90
  protected loadEventStreamCapability(): Promise<EventStreamSerde>;
77
- /**
78
- * Returns a platform-specific EventStreamMarshaller.
79
- * Prefers user-injected marshaller from serdeContext (via client config),
80
- * falls back to the dynamically imported provider.
81
- */
82
- private resolveEventStreamMarshaller;
83
91
  /**
84
92
  * @returns content-type default header value for event stream events and other documents.
85
93
  */
@@ -92,4 +100,10 @@ export declare abstract class HttpProtocol extends SerdeContext implements Clien
92
100
  protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
93
101
  protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any): Promise<string[]>;
94
102
  protected getEventStreamMarshaller(): EventStreamMarshaller;
103
+ /**
104
+ * Returns a platform-specific EventStreamMarshaller.
105
+ * Prefers user-injected marshaller from serdeContext (via client config),
106
+ * falls back to the dynamically imported provider.
107
+ */
108
+ private resolveEventStreamMarshaller;
95
109
  }
@@ -10,10 +10,10 @@ export declare class TypeRegistry {
10
10
  private schemas;
11
11
  private exceptions;
12
12
  static readonly registries: Map<string, TypeRegistry>;
13
- private constructor();
13
+ constructor(namespace: string, schemas?: Map<string, ISchema>, exceptions?: Map<StaticErrorSchema, any>);
14
14
  /**
15
15
  * @param namespace - specifier.
16
- * @returns the schema for that namespace, creating it if necessary.
16
+ * @returns the TypeRegistry for that namespace, creating it if necessary.
17
17
  */
18
18
  static for(namespace: string): TypeRegistry;
19
19
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.34.1",
3
+ "version": "3.35.0",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -241,7 +241,7 @@
241
241
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
242
242
  },
243
243
  "dependencies": {
244
- "@smithy/types": "^4.18.0",
244
+ "@smithy/types": "^4.19.0",
245
245
  "tslib": "^2.6.2"
246
246
  },
247
247
  "devDependencies": {
@@ -15,10 +15,11 @@ export type RequestOutcome = "Success" | "Fault";
15
15
  export type MetricUnit = "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" | "Kilobytes" | "Megabytes" | "Gigabytes" | "Terabytes" | "Bits" | "Kilobits" | "Megabits" | "Gigabits" | "Terabits" | "Percent" | "Count" | "None" | "Bytes/Second" | "Kilobytes/Second" | "Megabytes/Second" | "Gigabytes/Second" | "Terabytes/Second" | "Bits/Second" | "Kilobits/Second" | "Megabits/Second" | "Gigabits/Second" | "Terabits/Second" | "Count/Second";
16
16
  /**
17
17
  * Backend-agnostic recorder for per-request metrics. The framework drives the
18
- * lifecycle and records request-level metrics through this interface; user
19
- * handlers record their own business metrics through the same methods. Concrete
20
- * recorders (e.g. an EMF recorder, or a future OpenTelemetry recorder) translate
21
- * these abstract calls into their own primitives.
18
+ * lifecycle of recorders obtained from a factory and records request-level
19
+ * metrics through this interface; user handlers record their own business
20
+ * metrics through the same methods. Concrete recorders (e.g. an EMF recorder,
21
+ * or a future OpenTelemetry recorder) translate these abstract calls into their
22
+ * own primitives.
22
23
  *
23
24
  * @typeParam Native - the concrete backend handle returned by
24
25
  * {@link MetricsRecorder.getMetrics}, e.g. an OpenTelemetry `Meter`. The
@@ -30,13 +31,13 @@ export type MetricUnit = "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" |
30
31
  export interface MetricsRecorder<Native> {
31
32
  /**
32
33
  * Open the recorder for the current request. Called by the framework once at
33
- * the start of request handling.
34
+ * the start of request handling when it owns the recorder.
34
35
  */
35
36
  begin(): void;
36
37
  /**
37
38
  * Close the recorder for the current request. Called by the framework once at
38
- * the end of request handling; this is where an implementation typically
39
- * flushes its event.
39
+ * the end of request handling when it owns the recorder; this is where an
40
+ * implementation typically flushes its event.
40
41
  */
41
42
  end(): void;
42
43
  /**
@@ -4,6 +4,7 @@ import type { Command } from "./command";
4
4
  import type { EndpointV2 } from "./endpoint";
5
5
  import type { SmithyFeatures } from "./feature-ids";
6
6
  import type { Logger } from "./logger";
7
+ import type { MetricsRecorder } from "./metrics";
7
8
  import type { UserAgent } from "./util";
8
9
  /**
9
10
  * @public
@@ -505,6 +506,10 @@ export interface HandlerExecutionContext {
505
506
  commandInstance?: Command<any, any, any, any, any>;
506
507
  selectedHttpAuthScheme?: SelectedHttpAuthScheme;
507
508
  features?: SmithyFeatures;
509
+ /**
510
+ * Transferred from request options to the Smithy context.
511
+ */
512
+ metricsRecorder?: MetricsRecorder<unknown>;
508
513
  /**
509
514
  * @deprecated
510
515
  * Do not assign arbitrary members to the Smithy Context,
@@ -15,10 +15,11 @@ export type RequestOutcome = "Success" | "Fault";
15
15
  export type MetricUnit = "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" | "Kilobytes" | "Megabytes" | "Gigabytes" | "Terabytes" | "Bits" | "Kilobits" | "Megabits" | "Gigabits" | "Terabits" | "Percent" | "Count" | "None" | "Bytes/Second" | "Kilobytes/Second" | "Megabytes/Second" | "Gigabytes/Second" | "Terabytes/Second" | "Bits/Second" | "Kilobits/Second" | "Megabits/Second" | "Gigabits/Second" | "Terabits/Second" | "Count/Second";
16
16
  /**
17
17
  * Backend-agnostic recorder for per-request metrics. The framework drives the
18
- * lifecycle and records request-level metrics through this interface; user
19
- * handlers record their own business metrics through the same methods. Concrete
20
- * recorders (e.g. an EMF recorder, or a future OpenTelemetry recorder) translate
21
- * these abstract calls into their own primitives.
18
+ * lifecycle of recorders obtained from a factory and records request-level
19
+ * metrics through this interface; user handlers record their own business
20
+ * metrics through the same methods. Concrete recorders (e.g. an EMF recorder,
21
+ * or a future OpenTelemetry recorder) translate these abstract calls into their
22
+ * own primitives.
22
23
  *
23
24
  * @typeParam Native - the concrete backend handle returned by
24
25
  * {@link MetricsRecorder.getMetrics}, e.g. an OpenTelemetry `Meter`. The
@@ -30,13 +31,13 @@ export type MetricUnit = "Seconds" | "Microseconds" | "Milliseconds" | "Bytes" |
30
31
  export interface MetricsRecorder<Native> {
31
32
  /**
32
33
  * Open the recorder for the current request. Called by the framework once at
33
- * the start of request handling.
34
+ * the start of request handling when it owns the recorder.
34
35
  */
35
36
  begin(): void;
36
37
  /**
37
38
  * Close the recorder for the current request. Called by the framework once at
38
- * the end of request handling; this is where an implementation typically
39
- * flushes its event.
39
+ * the end of request handling when it owns the recorder; this is where an
40
+ * implementation typically flushes its event.
40
41
  */
41
42
  end(): void;
42
43
  /**
@@ -4,6 +4,7 @@ import { Command } from "./command";
4
4
  import { EndpointV2 } from "./endpoint";
5
5
  import { SmithyFeatures } from "./feature-ids";
6
6
  import { Logger } from "./logger";
7
+ import { MetricsRecorder } from "./metrics";
7
8
  import { UserAgent } from "./util";
8
9
  /**
9
10
  * @public
@@ -505,6 +506,10 @@ export interface HandlerExecutionContext {
505
506
  commandInstance?: Command<any, any, any, any, any>;
506
507
  selectedHttpAuthScheme?: SelectedHttpAuthScheme;
507
508
  features?: SmithyFeatures;
509
+ /**
510
+ * Transferred from request options to the Smithy context.
511
+ */
512
+ metricsRecorder?: MetricsRecorder<unknown>;
508
513
  /**
509
514
  * @deprecated
510
515
  * Do not assign arbitrary members to the Smithy Context,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/types",
3
- "version": "4.18.0",
3
+ "version": "4.19.0",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/types",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
package/package.json CHANGED
@@ -43,7 +43,7 @@
43
43
  "organization": false
44
44
  },
45
45
  "devDependencies": {
46
- "@cdk8s/projen-common": "0.1.29",
46
+ "@cdk8s/projen-common": "0.1.30",
47
47
  "@stylistic/eslint-plugin": "^2",
48
48
  "@types/fs-extra": "^11.0.4",
49
49
  "@types/jest": "^27",
@@ -67,7 +67,7 @@
67
67
  "jsii-docgen": "^10.5.0",
68
68
  "jsii-pacmak": "^1.140.0",
69
69
  "jsii-rosetta": "^5",
70
- "projen": "^0.103.25",
70
+ "projen": "^0.103.26",
71
71
  "ts-jest": "^27",
72
72
  "ts-node": "^10.9.2",
73
73
  "typescript": "^5.9.3"
@@ -78,7 +78,7 @@
78
78
  "constructs": "^10.3.0"
79
79
  },
80
80
  "dependencies": {
81
- "@aws-sdk/client-cloudformation": "^3.1136.0"
81
+ "@aws-sdk/client-cloudformation": "^3.1138.0"
82
82
  },
83
83
  "bundledDependencies": [
84
84
  "@aws-sdk/client-cloudformation"
@@ -92,7 +92,7 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "version": "0.0.690",
95
+ "version": "0.0.692",
96
96
  "jest": {
97
97
  "coverageProvider": "v8",
98
98
  "testMatch": [