@mavogel/awscdk-rootmail 0.1.6 → 0.1.7

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 (122) hide show
  1. package/.jsii +2 -2
  2. package/lib/rootmail.js +1 -1
  3. package/lib/ses-receive.js +1 -1
  4. package/node_modules/@aws-sdk/checksums/package.json +5 -5
  5. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-cjs/index.js +3 -3
  6. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-es/schemas/schemas_0.js +2 -2
  7. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/CloudWatchLogs.d.ts +243 -237
  8. package/node_modules/@aws-sdk/client-cloudwatch-logs/dist-types/ts3.4/CloudWatchLogs.d.ts +240 -236
  9. package/node_modules/@aws-sdk/client-cloudwatch-logs/package.json +8 -8
  10. package/node_modules/@aws-sdk/client-route-53/dist-cjs/index.js +3 -3
  11. package/node_modules/@aws-sdk/client-route-53/dist-es/schemas/schemas_0.js +2 -2
  12. package/node_modules/@aws-sdk/client-route-53/dist-types/Route53.d.ts +149 -143
  13. package/node_modules/@aws-sdk/client-route-53/dist-types/ts3.4/Route53.d.ts +146 -142
  14. package/node_modules/@aws-sdk/client-route-53/package.json +9 -9
  15. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +3 -3
  16. package/node_modules/@aws-sdk/client-s3/dist-es/schemas/schemas_0.js +2 -2
  17. package/node_modules/@aws-sdk/client-s3/dist-types/S3.d.ts +231 -225
  18. package/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3.d.ts +228 -224
  19. package/node_modules/@aws-sdk/client-s3/package.json +12 -12
  20. package/node_modules/@aws-sdk/client-ses/dist-cjs/index.js +3 -3
  21. package/node_modules/@aws-sdk/client-ses/dist-es/schemas/schemas_0.js +2 -2
  22. package/node_modules/@aws-sdk/client-ses/dist-types/SES.d.ts +149 -143
  23. package/node_modules/@aws-sdk/client-ses/dist-types/ts3.4/SES.d.ts +146 -142
  24. package/node_modules/@aws-sdk/client-ses/package.json +8 -8
  25. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +3 -3
  26. package/node_modules/@aws-sdk/client-ssm/dist-es/schemas/schemas_0.js +2 -2
  27. package/node_modules/@aws-sdk/client-ssm/dist-types/SSM.d.ts +311 -305
  28. package/node_modules/@aws-sdk/client-ssm/dist-types/ts3.4/SSM.d.ts +308 -304
  29. package/node_modules/@aws-sdk/client-ssm/package.json +8 -8
  30. package/node_modules/@aws-sdk/core/package.json +6 -6
  31. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  32. package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
  33. package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
  34. package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
  35. package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
  36. package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
  37. package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
  38. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
  39. package/node_modules/@aws-sdk/middleware-sdk-route53/package.json +3 -3
  40. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/submodules/s3/index.js +2 -1
  41. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/submodules/s3/middleware-region-redirect/region-redirect-middleware.js +2 -0
  42. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +6 -6
  43. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +3 -3
  44. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +3 -3
  45. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +3 -3
  46. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +3 -3
  47. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +14 -11
  48. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/schemas/schemas_0.js +2 -2
  49. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/schemas/schemas_0.js +2 -2
  50. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/schemas/schemas_0.js +2 -2
  51. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/schemas/schemas_0.js +2 -2
  52. package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/schemas/schemas_0.js +13 -10
  53. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentity.d.ts +11 -5
  54. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +11 -5
  55. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSO.d.ts +9 -3
  56. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDC.d.ts +9 -3
  57. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STS.d.ts +33 -8
  58. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +22 -3
  59. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleCommand.d.ts +3 -0
  60. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -0
  61. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +22 -3
  62. package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/models/models_0.d.ts +40 -0
  63. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentity.d.ts +14 -5
  64. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/Signin.d.ts +11 -5
  65. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSO.d.ts +9 -3
  66. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDC.d.ts +9 -3
  67. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STS.d.ts +11 -5
  68. package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/models/models_0.d.ts +6 -0
  69. package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
  70. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
  71. package/node_modules/@aws-sdk/token-providers/package.json +6 -6
  72. package/node_modules/@aws-sdk/types/dist-types/feature-ids.d.ts +1 -0
  73. package/node_modules/@aws-sdk/types/dist-types/ts3.4/feature-ids.d.ts +1 -0
  74. package/node_modules/@aws-sdk/types/package.json +2 -2
  75. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  76. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +22 -37
  77. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +26 -4
  78. package/node_modules/@smithy/core/dist-cjs/submodules/errors/index.js +20 -0
  79. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +49 -8
  80. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +11 -10
  81. package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +11 -10
  82. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +12 -7
  83. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -0
  84. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +25 -8
  85. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -0
  86. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +22 -22
  87. package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +0 -15
  88. package/node_modules/@smithy/core/dist-es/submodules/client/index.js +1 -1
  89. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/command.js +8 -1
  90. package/node_modules/@smithy/core/dist-es/submodules/client/smithy-client/exceptions.js +18 -3
  91. package/node_modules/@smithy/core/dist-es/submodules/errors/errors.js +18 -0
  92. package/node_modules/@smithy/core/dist-es/submodules/errors/index.js +1 -0
  93. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +49 -8
  94. package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/service-error-classification.js +11 -10
  95. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +12 -7
  96. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.browser.js +2 -0
  97. package/node_modules/@smithy/core/dist-es/submodules/serde/util-stream/getAwsChunkedEncodingStream.js +23 -8
  98. package/node_modules/@smithy/core/dist-types/submodules/cbor/parseCborBody.d.ts +3 -0
  99. package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +1 -1
  100. package/node_modules/@smithy/core/dist-types/submodules/client/smithy-client/client.d.ts +11 -3
  101. package/node_modules/@smithy/core/dist-types/submodules/errors/errors.d.ts +44 -0
  102. package/node_modules/@smithy/core/dist-types/submodules/errors/index.d.ts +1 -0
  103. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +17 -7
  104. package/node_modules/@smithy/core/dist-types/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  105. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +2 -2
  106. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/parseCborBody.d.ts +3 -0
  107. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/index.d.ts +1 -1
  108. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/client/smithy-client/client.d.ts +11 -3
  109. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/errors.d.ts +44 -0
  110. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/errors/index.d.ts +1 -0
  111. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +21 -7
  112. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/retry/service-error-classification/service-error-classification.d.ts +4 -0
  113. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +2 -2
  114. package/node_modules/@smithy/core/errors.d.ts +5 -0
  115. package/node_modules/@smithy/core/errors.js +5 -0
  116. package/node_modules/@smithy/core/package.json +11 -2
  117. package/node_modules/@smithy/types/dist-types/metrics.d.ts +8 -7
  118. package/node_modules/@smithy/types/dist-types/middleware.d.ts +5 -0
  119. package/node_modules/@smithy/types/dist-types/ts3.4/metrics.d.ts +8 -7
  120. package/node_modules/@smithy/types/dist-types/ts3.4/middleware.d.ts +5 -0
  121. package/node_modules/@smithy/types/package.json +1 -1
  122. package/package.json +1 -1
@@ -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
  }
@@ -19,6 +19,10 @@ export declare const isThrottlingError: (error: SdkError) => boolean;
19
19
  * included here because there is an error scenario with unknown root
20
20
  * cause where the NodeHttpHandler does not decorate the Error with
21
21
  * the name "TimeoutError" to be checked by the TRANSIENT_ERROR_CODES condition.
22
+ *
23
+ * Errors named "AbortError" are considered terminal. AbortSignal.timeout()
24
+ * produces an underlying cause which would otherwise be considered retryable as
25
+ * a TimeoutError.
22
26
  */
23
27
  export declare const isTransientError: (error: SdkError, depth?: number) => boolean;
24
28
  export declare const isServerError: (error: SdkError) => boolean;
@@ -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
  /**
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit:
3
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
4
+ */
5
+ export * from "./dist-types/submodules/errors/index";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Do not edit:
3
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
4
+ */
5
+ module.exports = require("./dist-cjs/submodules/errors/index.js");
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.33.3",
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": {
@@ -24,6 +24,8 @@
24
24
  "./config.js",
25
25
  "./endpoints.d.ts",
26
26
  "./endpoints.js",
27
+ "./errors.d.ts",
28
+ "./errors.js",
27
29
  "./event-streams.d.ts",
28
30
  "./event-streams.js",
29
31
  "./protocols.d.ts",
@@ -212,6 +214,13 @@
212
214
  "node": "./dist-cjs/submodules/transport/index.js",
213
215
  "import": "./dist-es/submodules/transport/index.js",
214
216
  "require": "./dist-cjs/submodules/transport/index.js"
217
+ },
218
+ "./errors": {
219
+ "types": "./dist-types/submodules/errors/index.d.ts",
220
+ "module": "./dist-es/submodules/errors/index.js",
221
+ "node": "./dist-cjs/submodules/errors/index.js",
222
+ "import": "./dist-es/submodules/errors/index.js",
223
+ "require": "./dist-cjs/submodules/errors/index.js"
215
224
  }
216
225
  },
217
226
  "scripts": {
@@ -232,7 +241,7 @@
232
241
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
233
242
  },
234
243
  "dependencies": {
235
- "@smithy/types": "^4.17.2",
244
+ "@smithy/types": "^4.19.0",
236
245
  "tslib": "^2.6.2"
237
246
  },
238
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
@@ -119,7 +119,7 @@
119
119
  "publishConfig": {
120
120
  "access": "public"
121
121
  },
122
- "version": "0.1.6",
122
+ "version": "0.1.7",
123
123
  "jest": {
124
124
  "coverageProvider": "v8",
125
125
  "testMatch": [