UNPKG

1.16 kBTypeScriptView Raw
1import { AbsoluteLocation, BuildHandler, BuildHandlerOptions, HandlerExecutionContext, MetadataBearer, Pluggable } from "@smithy/types";
2import { UserAgentResolvedConfig } from "./configurations";
3/**
4 * Build user agent header sections from:
5 * 1. runtime-specific default user agent provider;
6 * 2. custom user agent from `customUserAgent` client config;
7 * 3. handler execution context set by internal SDK components;
8 * The built user agent will be set to `x-amz-user-agent` header for ALL the
9 * runtimes.
10 * Please note that any override to the `user-agent` or `x-amz-user-agent` header
11 * in the HTTP request is discouraged. Please use `customUserAgent` client
12 * config or middleware setting the `userAgent` context to generate desired user
13 * agent.
14 */
15export declare const userAgentMiddleware: (options: UserAgentResolvedConfig) => <Output extends MetadataBearer>(next: BuildHandler<any, any>, context: HandlerExecutionContext) => BuildHandler<any, any>;
16export declare const getUserAgentMiddlewareOptions: BuildHandlerOptions & AbsoluteLocation;
17export declare const getUserAgentPlugin: (config: UserAgentResolvedConfig) => Pluggable<any, any>;