🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@smithy/types

Package Overview
Dependencies
Maintainers
2
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/types - npm Package Compare versions

Comparing version
4.15.1
to
4.16.0
+1
dist-es/metrics.js
export {};
/**
* Outcome of a request, recorded by the framework via {@link MetricsRecorder.recordRequestOutcome}.
*
* @public
*/
export type RequestOutcome = "Success" | "Fault";
/**
* Unit attached to a recorded metric value. The vocabulary follows the
* CloudWatch unit names so backends that emit to CloudWatch can pass it
* through, but it carries no backend-specific semantics — a recorder is free
* to map or ignore it.
*
* @public
*/
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";
/**
* Backend-agnostic recorder for per-request metrics. The framework drives the
* lifecycle and records request-level metrics through this interface; user
* handlers record their own business metrics through the same methods. Concrete
* recorders (e.g. an EMF recorder, or a future OpenTelemetry recorder) translate
* these abstract calls into their own primitives.
*
* @typeParam Native - the concrete backend handle returned by
* {@link MetricsRecorder.getMetrics}, e.g. an OpenTelemetry `Meter`. The
* parameter is required so that native access is always typed rather than
* erased to `unknown`.
*
* @public
*/
export interface MetricsRecorder<Native> {
/**
* Open the recorder for the current request. Called by the framework once at
* the start of request handling.
*/
begin(): void;
/**
* Close the recorder for the current request. Called by the framework once at
* the end of request handling; this is where an implementation typically
* flushes its event.
*/
end(): void;
/**
* Records the outcome and duration of a request. The concrete backend decides
* how to express this.
*/
recordRequestOutcome(outcome: RequestOutcome, durationMs: number): void;
/**
* Records a count. Values should be non-negative for cross-backend portability.
*/
addCount(name: string, value: number): void;
/**
* Records a duration in milliseconds.
*/
addTime(name: string, value: number): void;
/**
* Records a level — a sampled value that should average meaningfully across
* calls (e.g. queue depth, batch size).
*/
addLevel(name: string, value: number, unit?: MetricUnit): void;
/**
* Records a discrete data point where percentiles matter (e.g. per-call
* latency, item size).
*/
addMetric(name: string, value: number, unit?: MetricUnit): void;
/**
* Records a unitless ratio (e.g. cache hit rate, throttle rate).
*/
addRatio(name: string, value: number): void;
/**
* Attaches a property to the request's metrics. A nullish or empty value
* removes the property.
*/
setProperty(name: string, value: string | null | undefined): void;
/**
* Returns the recorder's native backend handle, so callers can reach
* library-specific features the abstract methods do not expose (e.g. an
* OpenTelemetry `Meter`).
*/
getMetrics(): Native;
}
/**
* Creates a per-request {@link MetricsRecorder}. Created once at startup and
* passed to the service handler; the framework calls {@link MetricsRecorderFactory.create}
* once per request to obtain a scoped recorder.
*
* @typeParam Native - the native backend handle exposed by recorders this
* factory produces. See {@link MetricsRecorder}.
*
* @public
*/
export interface MetricsRecorderFactory<Native> {
create(): MetricsRecorder<Native>;
}
+2
-6

@@ -1,6 +0,2 @@

export * from "./auth";
export * from "./HttpApiKeyAuth";
export * from "./HttpAuthScheme";
export * from "./HttpAuthSchemeProvider";
export * from "./HttpSigner";
export * from "./IdentityProviderConfig";
export { HttpAuthLocation } from "./auth";
export { HttpApiKeyAuthLocation } from "./HttpApiKeyAuth";

@@ -1,3 +0,1 @@

export * from "./config";
export * from "./manager";
export * from "./pool";
export {};

@@ -1,5 +0,1 @@

export * from "./EndpointRuleObject";
export * from "./ErrorRuleObject";
export * from "./RuleSetObject";
export * from "./shared";
export * from "./TreeRuleObject";
export {};

@@ -1,3 +0,2 @@

export * from "./defaultClientConfiguration";
export * from "./defaultExtensionConfiguration";
export { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "./defaultClientConfiguration";
export { AlgorithmId } from "./checksum";

@@ -1,4 +0,1 @@

export * from "./apiKeyIdentity";
export * from "./awsCredentialIdentity";
export * from "./identity";
export * from "./tokenIdentity";
export {};

@@ -1,43 +0,7 @@

export * from "./abort";
export * from "./auth";
export * from "./blob/blob-payload-input-types";
export * from "./checksum";
export * from "./client";
export * from "./command";
export * from "./connection";
export * from "./crypto";
export * from "./encode";
export * from "./endpoint";
export * from "./endpoints";
export * from "./eventStream";
export * from "./extensions";
export * from "./feature-ids";
export * from "./http";
export * from "./http/httpHandlerInitialization";
export * from "./identity";
export * from "./logger";
export * from "./middleware";
export * from "./pagination";
export * from "./profile";
export * from "./response";
export * from "./retry";
export * from "./schema/schema";
export * from "./schema/traits";
export * from "./schema/schema-deprecated";
export * from "./schema/sentinels";
export * from "./schema/static-schemas";
export * from "./serde";
export * from "./shapes";
export * from "./signature";
export * from "./stream";
export * from "./streaming-payload/streaming-blob-common-types";
export * from "./streaming-payload/streaming-blob-payload-input-types";
export * from "./streaming-payload/streaming-blob-payload-output-types";
export * from "./transfer";
export * from "./transform/client-payload-blob-type-narrow";
export * from "./transform/mutable";
export * from "./transform/no-undefined";
export * from "./transform/type-transform";
export * from "./uri";
export * from "./util";
export * from "./waiter";
export { HttpApiKeyAuthLocation, HttpAuthLocation } from "./auth";
export { EndpointURLScheme } from "./endpoint";
export { AlgorithmId, getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "./extensions";
export { FieldPosition } from "./http";
export { SMITHY_CONTEXT_KEY } from "./middleware";
export { IniSectionType } from "./profile";
export { RequestHandlerProtocol } from "./transfer";

@@ -5,3 +5,3 @@ import type { AbortHandler } from "./abort-handler";

*/
export { AbortHandler };
export type { AbortHandler };
/**

@@ -8,0 +8,0 @@ * Holders of an AbortSignal object may query if the associated operation has

@@ -1,6 +0,7 @@

export * from "./auth";
export * from "./HttpApiKeyAuth";
export * from "./HttpAuthScheme";
export * from "./HttpAuthSchemeProvider";
export * from "./HttpSigner";
export * from "./IdentityProviderConfig";
export { HttpAuthLocation } from "./auth";
export type { AuthScheme, HttpAuthDefinition } from "./auth";
export { HttpApiKeyAuthLocation } from "./HttpApiKeyAuth";
export type { HttpAuthOption, HttpAuthScheme, HttpAuthSchemeId, SelectedHttpAuthScheme } from "./HttpAuthScheme";
export type { HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider, } from "./HttpAuthSchemeProvider";
export type { ErrorHandler, HttpSigner, SuccessHandler } from "./HttpSigner";
export type { IdentityProviderConfig } from "./IdentityProviderConfig";

@@ -1,3 +0,3 @@

export * from "./config";
export * from "./manager";
export * from "./pool";
export type { ConnectConfiguration } from "./config";
export type { ConnectionManager, ConnectionManagerConfiguration } from "./manager";
export type { CacheKey, ConnectionPool } from "./pool";

@@ -1,5 +0,5 @@

export * from "./EndpointRuleObject";
export * from "./ErrorRuleObject";
export * from "./RuleSetObject";
export * from "./shared";
export * from "./TreeRuleObject";
export type { EndpointObject, EndpointObjectHeaders, EndpointObjectProperties, EndpointRuleObject, } from "./EndpointRuleObject";
export type { ErrorRuleObject } from "./ErrorRuleObject";
export type { DeprecatedObject, ParameterObject, RuleSetObject } from "./RuleSetObject";
export type { ConditionObject, EndpointParams, EndpointResolverOptions, EvaluateOptions, Expression, FunctionArgv, FunctionObject, FunctionReturn, ReferenceObject, ReferenceRecord, } from "./shared";
export type { RuleSetRules, TreeRuleObject } from "./TreeRuleObject";

@@ -1,4 +0,6 @@

export * from "./defaultClientConfiguration";
export * from "./defaultExtensionConfiguration";
export { AlgorithmId, ChecksumAlgorithm, ChecksumConfiguration } from "./checksum";
export { RetryStrategyConfiguration } from "./retry";
export { getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "./defaultClientConfiguration";
export type { DefaultClientConfiguration } from "./defaultClientConfiguration";
export type { DefaultExtensionConfiguration } from "./defaultExtensionConfiguration";
export { AlgorithmId } from "./checksum";
export type { ChecksumAlgorithm, ChecksumConfiguration } from "./checksum";
export type { RetryStrategyConfiguration } from "./retry";

@@ -1,4 +0,4 @@

export * from "./apiKeyIdentity";
export * from "./awsCredentialIdentity";
export * from "./identity";
export * from "./tokenIdentity";
export type { ApiKeyIdentity, ApiKeyIdentityProvider } from "./apiKeyIdentity";
export type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from "./awsCredentialIdentity";
export type { Identity, IdentityProvider } from "./identity";
export type { TokenIdentity, TokenIdentityProvider } from "./tokenIdentity";

@@ -1,44 +0,52 @@

export * from "./abort";
export * from "./auth";
export * from "./blob/blob-payload-input-types";
export * from "./checksum";
export * from "./client";
export * from "./command";
export * from "./connection";
export * from "./crypto";
export * from "./encode";
export * from "./endpoint";
export * from "./endpoints";
export type { AbortController, AbortHandler, AbortSignal } from "./abort";
export { HttpApiKeyAuthLocation, HttpAuthLocation } from "./auth";
export type { AuthScheme, ErrorHandler, HttpAuthDefinition, HttpAuthOption, HttpAuthScheme, HttpAuthSchemeId, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider, HttpSigner, IdentityProviderConfig, SelectedHttpAuthScheme, SuccessHandler, } from "./auth";
export type { BlobPayloadInputTypes, BlobTypes, BrowserRuntimeBlobTypes, NodeJsRuntimeBlobTypes, } from "./blob/blob-payload-input-types";
export type { Checksum, ChecksumConstructor } from "./checksum";
export type { CheckOptionalClientConfig, Client, InvokeFunction, InvokeMethod, InvokeMethodOptionalArgs, } from "./client";
export type { Command, CommandIO, GetOutputType } from "./command";
export type { CacheKey, ConnectConfiguration, ConnectionManager, ConnectionManagerConfiguration, ConnectionPool, } from "./connection";
export type { Hash, HashConstructor, SourceData, StreamHasher, randomValues } from "./crypto";
export type { AvailableMessage, AvailableMessages, MessageDecoder, MessageEncoder } from "./encode";
export { EndpointURLScheme } from "./endpoint";
export type { EndpointARN, EndpointObjectProperty, EndpointParameters, EndpointPartition, EndpointURL, EndpointV2, } from "./endpoint";
export type { ConditionObject, DeprecatedObject, EndpointObject, EndpointObjectHeaders, EndpointObjectProperties, EndpointParams, EndpointResolverOptions, EndpointRuleObject, ErrorRuleObject, EvaluateOptions, Expression, FunctionArgv, FunctionObject, FunctionReturn, ParameterObject, ReferenceObject, ReferenceRecord, RuleSetObject, RuleSetRules, TreeRuleObject, } from "./endpoints";
export type { EndpointParameterInstructions, BuiltInParamInstruction, ClientContextParamInstruction, StaticContextParamInstruction, ContextParamInstruction, OperationContextParamInstruction, } from "./endpoints/EndpointParameterInstructions";
export * from "./eventStream";
export * from "./extensions";
export * from "./feature-ids";
export * from "./http";
export * from "./http/httpHandlerInitialization";
export * from "./identity";
export * from "./logger";
export * from "./middleware";
export * from "./pagination";
export * from "./profile";
export * from "./response";
export * from "./retry";
export * from "./schema/schema";
export * from "./schema/traits";
export * from "./schema/schema-deprecated";
export * from "./schema/sentinels";
export * from "./schema/static-schemas";
export * from "./serde";
export * from "./shapes";
export * from "./signature";
export * from "./stream";
export * from "./streaming-payload/streaming-blob-common-types";
export * from "./streaming-payload/streaming-blob-payload-input-types";
export * from "./streaming-payload/streaming-blob-payload-output-types";
export * from "./transfer";
export * from "./transform/client-payload-blob-type-narrow";
export * from "./transform/mutable";
export * from "./transform/no-undefined";
export * from "./transform/type-transform";
export * from "./uri";
export * from "./util";
export * from "./waiter";
export type { BinaryHeaderValue, BooleanHeaderValue, ByteHeaderValue, EventStreamMarshaller, EventStreamMarshallerDeserFn, EventStreamMarshallerSerFn, EventStreamPayloadHandler, EventStreamPayloadHandlerProvider, EventStreamRequestSigner, EventStreamSerdeContext, EventStreamSerdeProvider, EventStreamSignerProvider, HeaderValue, Int64, IntegerHeaderValue, LongHeaderValue, Message, MessageHeaderValue, MessageHeaders, ShortHeaderValue, StringHeaderValue, TimestampHeaderValue, UuidHeaderValue, } from "./eventStream";
export { AlgorithmId, getDefaultClientConfiguration, resolveDefaultRuntimeConfig } from "./extensions";
export type { ChecksumAlgorithm, ChecksumConfiguration, DefaultClientConfiguration, DefaultExtensionConfiguration, RetryStrategyConfiguration, } from "./extensions";
export type { SmithyFeatures } from "./feature-ids";
export { FieldPosition } from "./http";
export type { Endpoint, FieldOptions, HeaderBag, HttpHandlerOptions, HttpMessage, HttpRequest, HttpResponse, QueryParameterBag, } from "./http";
export type { FetchHttpHandlerOptions, NodeHttpHandlerOptions, RequestHandlerParams, } from "./http/httpHandlerInitialization";
export type { ApiKeyIdentity, ApiKeyIdentityProvider, AwsCredentialIdentity, AwsCredentialIdentityProvider, Identity, IdentityProvider, TokenIdentity, TokenIdentityProvider, } from "./identity";
export type { Logger } from "./logger";
export { SMITHY_CONTEXT_KEY } from "./middleware";
export type { AbsoluteLocation, BuildHandler, BuildHandlerArguments, BuildHandlerOptions, BuildHandlerOutput, BuildMiddleware, DeserializeHandler, DeserializeHandlerArguments, DeserializeHandlerOptions, DeserializeHandlerOutput, DeserializeMiddleware, FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput, FinalizeRequestHandlerOptions, FinalizeRequestMiddleware, Handler, HandlerExecutionContext, HandlerOptions, InitializeHandler, InitializeHandlerArguments, InitializeHandlerOptions, InitializeHandlerOutput, InitializeMiddleware, MiddlewareStack, MiddlewareType, Pluggable, Priority, Relation, RelativeLocation, RelativeMiddlewareOptions, SerializeHandler, SerializeHandlerArguments, SerializeHandlerOptions, SerializeHandlerOutput, SerializeMiddleware, Step, Terminalware, } from "./middleware";
export type { PaginationConfiguration, Paginator } from "./pagination";
export { IniSectionType } from "./profile";
export type { IniSection, ParsedIniData, Profile, SharedConfigFiles } from "./profile";
export type { MetadataBearer, ResponseMetadata } from "./response";
export type { ExponentialBackoffJitterType, ExponentialBackoffStrategyOptions, RetryBackoffStrategy, RetryErrorInfo, RetryErrorType, RetryStrategyOptions, RetryStrategyV2, RetryToken, StandardRetryBackoffStrategy, StandardRetryToken, } from "./retry";
export type { $ClientProtocol, $ClientProtocolCtor, $Codec, $MemberSchema, $OperationSchema, $Schema, $SchemaRef, $ShapeDeserializer, $ShapeSerializer, BlobSchemas, CodecSettings, ConfigurableSerdeContext, NormalizedSchema, SchemaTraits, SchemaTraitsObject, SimpleSchema, TimestampSchemas, UnitSchema, } from "./schema/schema";
export type { HttpLabelBitMask, HttpPayloadBitMask, HttpQueryParamsBitMask, HttpResponseCodeBitMask, IdempotencyTokenBitMask, IdempotentBitMask, SensitiveBitMask, TraitBitVector, } from "./schema/traits";
export type { ClientProtocol, ClientProtocolCtor, Codec, ListSchema, MapSchema, MemberSchema, OperationSchema, Schema, SchemaRef, ShapeDeserializer, ShapeSerializer, StructureSchema, TraitsSchema, } from "./schema/schema-deprecated";
export type { BigDecimalSchema, BigIntegerSchema, BlobSchema, BooleanSchema, DocumentSchema, ListSchemaModifier, MapSchemaModifier, NumericSchema, StreamingBlobSchema, StringSchema, TimestampDateTimeSchema, TimestampDefaultSchema, TimestampEpochSecondsSchema, TimestampHttpDateSchema, } from "./schema/sentinels";
export type { ShapeName, ShapeNamespace, StaticErrorSchema, StaticListSchema, StaticMapSchema, StaticOperationSchema, StaticSchema, StaticSchemaIdError, StaticSchemaIdList, StaticSchemaIdMap, StaticSchemaIdOperation, StaticSchemaIdSimple, StaticSchemaIdStruct, StaticSchemaIdUnion, StaticSimpleSchema, StaticStructureSchema, StaticUnionSchema, } from "./schema/static-schemas";
export type { EndpointBearer, RequestSerializer, ResponseDeserializer, SdkStream, SdkStreamMixin, SdkStreamMixinInjector, SdkStreamSerdeContext, SerdeContext, SerdeFunctions, StreamCollector, WithSdkStreamMixin, } from "./serde";
export type { DocumentType, RetryableTrait, SdkError, SmithyException } from "./shapes";
export type { DateInput, EventSigner, EventSigningArguments, EventStreamRequestScopedCredentials, FormattedEvent, MessageSigner, MessageSigningArguments, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SignableMessage, SignedMessage, SigningArguments, StringSigner, } from "./signature";
export type { GetAwsChunkedEncodingStream, GetAwsChunkedEncodingStreamOptions } from "./stream";
export type { BrowserRuntimeStreamingBlobTypes, NodeJsRuntimeStreamingBlobTypes, StreamingBlobTypes, } from "./streaming-payload/streaming-blob-common-types";
export type { BrowserRuntimeStreamingBlobPayloadInputTypes, NodeJsRuntimeStreamingBlobPayloadInputTypes, StreamingBlobPayloadInputTypes, } from "./streaming-payload/streaming-blob-payload-input-types";
export type { BrowserRuntimeStreamingBlobPayloadOutputTypes, NodeJsRuntimeStreamingBlobPayloadOutputTypes, StreamingBlobPayloadOutputTypes, } from "./streaming-payload/streaming-blob-payload-output-types";
export { RequestHandlerProtocol } from "./transfer";
export type { RequestContext, RequestHandler, RequestHandlerMetadata, RequestHandlerOutput } from "./transfer";
export type { BrowserClient, BrowserXhrClient, NarrowPayloadBlobOutputType, NarrowPayloadBlobTypes, NodeJsClient, NodeJsHttp2Client, } from "./transform/client-payload-blob-type-narrow";
export type { Mutable } from "./transform/mutable";
export type { AssertiveClient, NoUndefined, RecursiveRequired, UncheckedClient } from "./transform/no-undefined";
export type { Transform } from "./transform/type-transform";
export type { URI } from "./uri";
export type { BodyLengthCalculator, Decoder, Encoder, Exact, MemoizedProvider, OptionalParameter, Provider, RegionInfo, RegionInfoProvider, RegionInfoProviderOptions, RetryStrategy, UrlParser, UserAgent, UserAgentPair, } from "./util";
export type { WaiterConfiguration } from "./waiter";
export type { MetricsRecorder, MetricsRecorderFactory, MetricUnit, RequestOutcome } from "./metrics";
{
"name": "@smithy/types",
"version": "4.15.1",
"version": "4.16.0",
"scripts": {

@@ -5,0 +5,0 @@ "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",