Option determining how certain default configuration options are resolved in the SDK. It can be one of the value listed below:
"standard":
The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios
Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK
"in-region":
The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region
Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK
"cross-region":
The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region
Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK
"mobile":
The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications
Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK
"auto":
The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.
Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query EC2 Instance Metadata service, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application
"legacy":
The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode
A document type represents an untyped JSON-like value.
Not all protocols support document types, and the serialization format of a
document type is protocol specific. All JSON protocols SHOULD support
document types and they SHOULD serialize document types inline as normal
JSON values.
A mapping of header names to string values. Multiple values for the same
header should be represented as a single string with values separated by
, .
Keys should be considered case insensitive, even if this is not enforced by a
particular implementation. For example, given the following HeaderBag, where
keys differ only in case:
{
'x-amz-date': '2000-01-01T00:00:00Z',
'X-Amz-Date': '2001-01-01T00:00:00Z'
}
The SDK may at any point during processing remove one of the object
properties in favor of the other. The headers may or may not be combined, and
the SDK will not deterministically select which header candidate to use.
The hash of partition with the information specific to that partition.
The information includes the list of regions belonging to that partition,
and the hostname to be used for the partition.
A mapping of query parameter names to strings or arrays of strings, with the
second being used when a parameter contains a list of values. Value can be set
to null when query is not in key-value pairs shape
Because of https://github.com/microsoft/tslib/issues/95,
TS 'extends' shim doesn't support extending native types like String.
So here we create StringWrapper that duplicate everything from String
class including its prototype chain. So we can extend from here.
Const THROTTLING_RETRY_DELAY_BASE
THROTTLING_RETRY_DELAY_BASE:500 = 500
The retry delay base (in milliseconds) to use when a throttling error is
encountered.
Const TIMEOUT_RETRY_COST
TIMEOUT_RETRY_COST:10 = 10
The total amount of retry tokens to be decremented from retry token balance
when a throttling error is encountered.
Creates a credential provider that will attempt to find credentials from the
following sources (listed in order of precedence):
Environment variables exposed via process.env
SSO credentials from token cache
Web identity token credentials
Shared credentials and config ini files
The EC2/ECS Instance Metadata Service
The default credential provider will invoke one provider at a time and only
continue to the next if no credentials have been located. For example, if
the process finds values defined via the AWS_ACCESS_KEY_ID and
AWS_SECRET_ACCESS_KEY environment variables, the files at
~/.aws/credentials and ~/.aws/config will not be read, nor will any
messages be sent to the Instance Metadata Service.
param
Configuration that is passed to each individual
provider
see
fromEnv The function used to source credentials from
environment variables
see
fromSSO The function used to source credentials from
resolved SSO token cache
see
fromTokenFile The function used to source credentials from
token file
see
fromIni The function used to source credentials from INI
files
see
fromProcess The function used to sources credentials from
credential_process in INI files
see
fromInstanceMetadata The function used to source credentials from the
EC2 Instance Metadata Service
see
fromContainerMetadata The function used to source credentials from the
ECS Container Metadata Service
Default provider to the user agent in browsers. It's a best effort to infer
the device information. It uses bowser library to detect the browser and version
Asserts a value is a boolean and returns it.
Casts strings and numbers with a warning if there is evidence that they were
intended to be booleans.
param
A value that is expected to be a boolean.
returns
The value if it's a boolean, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): boolean | undefined
Parameters
value: any
Returns boolean | undefined
Const expectByte
expectByte:(value: any) => number | undefined
Asserts a value is an 8-bit integer and returns it.
param
A value that is expected to be an integer.
returns
The value if it's an integer, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectFloat32
expectFloat32:(value: any) => number | undefined
Asserts a value is a 32-bit float and returns it.
param
A value that is expected to be a 32-bit float.
returns
The value if it's a float, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectInt
expectInt:(value: any) => number | undefined
deprecated
Use expectLong
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectInt32
expectInt32:(value: any) => number | undefined
Asserts a value is a 32-bit integer and returns it.
param
A value that is expected to be an integer.
returns
The value if it's an integer, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectLong
expectLong:(value: any) => number | undefined
Asserts a value is an integer and returns it.
param
A value that is expected to be an integer.
returns
The value if it's an integer, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectNonNull
expectNonNull: <T>(value: T | null | undefined, location?: string | undefined) => T
Asserts a value is not null or undefined and returns it, or throws an error.
param
A value that is expected to be defined
param
The location where we're expecting to find a defined object (optional)
returns
The value if it's not undefined, otherwise throws an error
Type declaration
<T>(value: T | null | undefined, location?: string | undefined): T
Type parameters
T
Parameters
value: T | null | undefined
Optional location: string | undefined
Returns T
Const expectNumber
expectNumber:(value: any) => number | undefined
Asserts a value is a number and returns it.
Casts strings with a warning if the string is a parseable number.
This is to unblock slight API definition/implementation inconsistencies.
param
A value that is expected to be a number.
returns
The value if it's a number, undefined if it's null/undefined,
otherwise an error is thrown.
Asserts a value is an JSON-like object and returns it. This is expected to be used
with values parsed from JSON (arrays, objects, numbers, strings, booleans).
param
A value that is expected to be an object
returns
The value if it's an object, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): Record<string, any> | undefined
Parameters
value: any
Returns Record<string, any> | undefined
Const expectShort
expectShort:(value: any) => number | undefined
Asserts a value is a 16-bit integer and returns it.
param
A value that is expected to be an integer.
returns
The value if it's an integer, undefined if it's null/undefined,
otherwise an error is thrown.
Type declaration
(value: any): number | undefined
Parameters
value: any
Returns number | undefined
Const expectString
expectString:(value: any) => string | undefined
Asserts a value is a string and returns it.
Numbers and boolean will be cast to strings with a warning.
param
A value that is expected to be a string.
returns
The value if it's a string, undefined if it's null/undefined,
otherwise an error is thrown.
limitedParseDouble:(value: string | number) => number | undefined
Asserts a value is a number and returns it. If the value is a string
representation of a non-numeric number type (NaN, Infinity, -Infinity),
the value will be parsed. Any other string value will result in an exception
being thrown. Null or undefined will be returned as undefined. Any other
type will result in an exception being thrown.
param
A number or string representation of a non-numeric float.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const limitedParseFloat
limitedParseFloat:(value: string | number) => number | undefined
deprecated
Use limitedParseDouble
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const limitedParseFloat32
limitedParseFloat32:(value: string | number) => number | undefined
Asserts a value is a 32-bit float and returns it. If the value is a string
representation of a non-numeric number type (NaN, Infinity, -Infinity),
the value will be parsed. Any other string value will result in an exception
being thrown. Null or undefined will be returned as undefined. Any other
type will result in an exception being thrown.
param
A number or string representation of a non-numeric float.
returns
The value as a number, or undefined if it's null/undefined.
Give an input string, strictly parses a boolean value.
param
The boolean string to parse.
returns
true for "true", false for "false", otherwise an error is thrown.
Type declaration
(value: string): boolean
Parameters
value: string
Returns boolean
Const parseEpochTimestamp
parseEpochTimestamp:(value: unknown) => Date | undefined
Parses a value into a Date. Returns undefined if the input is null or
undefined, throws an error if the input is not a number or a parseable string.
Input strings must be an integer or floating point number. Fractional seconds are supported.
param
the value to parse
returns
a Date or undefined
Type declaration
(value: unknown): Date | undefined
Parameters
value: unknown
Returns Date | undefined
Const parseRfc3339DateTime
parseRfc3339DateTime:(value: unknown) => Date | undefined
Parses a value into a Date. Returns undefined if the input is null or
undefined, throws an error if the input is not a string that can be parsed
as an RFC 3339 date.
Input strings must conform to RFC3339 section 5.6, and cannot have a UTC
offset. Fractional precision is supported.
{@see https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
param
the value to parse
returns
a Date or undefined
Type declaration
(value: unknown): Date | undefined
Parameters
value: unknown
Returns Date | undefined
Const parseRfc7231DateTime
parseRfc7231DateTime:(value: unknown) => Date | undefined
Parses a value into a Date. Returns undefined if the input is null or
undefined, throws an error if the input is not a string that can be parsed
as an RFC 7231 IMF-fixdate or obs-date.
Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.
{@see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}
Evaluates a single string argument value as a region, and matches the
string value to an AWS partition.
The matcher MUST always return a successful object describing the partition
that the region has been determined to be a part of.
endpoints rulesets use @aws-sdk/middleware-endpoint resolveEndpointConfig.
All generated clients should migrate to Endpoints 2.0 endpointRuleSet traits.
Set STS client constructor to stsClientCtor config parameter. It is used
for role assumers for STS client internally. See clients/client-sts/defaultStsRoleAssumers.ts
and clients/client-sts/STSClient.ts.
strictParseByte:(value: string | number) => number | undefined
Parses a value into an 8-bit integer. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by parseFloat
and the result will be asserted to be an integer. If the parsed value is not
an integer, or the raw value is any type other than a string or number, an
exception will be thrown.
param
A number or string representation of an 8-bit integer.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseDouble
strictParseDouble:(value: string | number) => number | undefined
Parses a value into a double. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by the standard
parseFloat with one exception: NaN may only be explicitly set as the string
"NaN", any implicit Nan values will result in an error being thrown. If any
other type is provided, an exception will be thrown.
param
A number or string representation of a double.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseFloat
strictParseFloat:(value: string | number) => number | undefined
deprecated
Use strictParseDouble
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseFloat32
strictParseFloat32:(value: string | number) => number | undefined
Parses a value into a float. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by the standard
parseFloat with one exception: NaN may only be explicitly set as the string
"NaN", any implicit Nan values will result in an error being thrown. If any
other type is provided, an exception will be thrown.
param
A number or string representation of a float.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseInt
strictParseInt:(value: string | number) => number | undefined
deprecated
Use strictParseLong
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseInt32
strictParseInt32:(value: string | number) => number | undefined
Parses a value into a 32-bit integer. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by parseFloat
and the result will be asserted to be an integer. If the parsed value is not
an integer, or the raw value is any type other than a string or number, an
exception will be thrown.
param
A number or string representation of a 32-bit integer.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseLong
strictParseLong:(value: string | number) => number | undefined
Parses a value into an integer. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by parseFloat
and the result will be asserted to be an integer. If the parsed value is not
an integer, or the raw value is any type other than a string or number, an
exception will be thrown.
param
A number or string representation of an integer.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const strictParseShort
strictParseShort:(value: string | number) => number | undefined
Parses a value into a 16-bit integer. If the value is null or undefined, undefined
will be returned. If the value is a string, it will be parsed by parseFloat
and the result will be asserted to be an integer. If the parsed value is not
an integer, or the raw value is any type other than a string or number, an
exception will be thrown.
param
A number or string representation of a 16-bit integer.
returns
The value as a number, or undefined if it's null/undefined.
Type declaration
(value: string | number): number | undefined
Parameters
value: string | number
Returns number | undefined
Const t
t:"argv" = "argv"
Const toBase64
toBase64:(input: Uint8Array) => string
Converts a Uint8Array of binary data to a base-64 encoded string using
Node.JS's buffer module.
custom user agent from customUserAgent client config;
handler execution context set by internal SDK components;
The built user agent will be set to x-amz-user-agent header for ALL the
runtimes.
Please note that any override to the user-agent or x-amz-user-agent header
in the HTTP request is discouraged. Please use customUserAgent client
config or middleware setting the userAgent context to generate desired user
agent.
Prior to ECMAScript 2018, the format of the return value
varied according to the platform. The most common return
value was an RFC-1123 formatted date stamp, which is a
slightly updated version of RFC-822 date stamps.
Use {@AwsCredentialIdentityProvider}