-
Notifications
You must be signed in to change notification settings - Fork 580
/
runtimeConfig.ts
43 lines (41 loc) · 2.02 KB
/
runtimeConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import packageInfo from "./package.json";
import { decorateDefaultCredentialProvider } from "@aws-sdk/client-sts";
import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS } from "@aws-sdk/config-resolver";
import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node";
import { eventStreamSerdeProvider } from "@aws-sdk/eventstream-serde-node";
import { Hash } from "@aws-sdk/hash-node";
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@aws-sdk/middleware-retry";
import { loadConfig as loadNodeConfig } from "@aws-sdk/node-config-provider";
import { NodeHttp2Handler, streamCollector } from "@aws-sdk/node-http-handler";
import { fromBase64, toBase64 } from "@aws-sdk/util-base64-node";
import { calculateBodyLength } from "@aws-sdk/util-body-length-node";
import { defaultUserAgent } from "@aws-sdk/util-user-agent-node";
import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-node";
import { ClientDefaults } from "./TranscribeStreamingClient";
import { ClientSharedValues } from "./runtimeConfig.shared";
/**
* @internal
*/
export const ClientDefaultValues: Required<ClientDefaults> = {
...ClientSharedValues,
runtime: "node",
base64Decoder: fromBase64,
base64Encoder: toBase64,
bodyLengthChecker: calculateBodyLength,
credentialDefaultProvider: decorateDefaultCredentialProvider(credentialDefaultProvider),
defaultUserAgentProvider: defaultUserAgent({
serviceId: ClientSharedValues.serviceId,
clientVersion: packageInfo.version,
}),
eventStreamPayloadHandlerProvider,
eventStreamSerdeProvider,
maxAttempts: loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
region: loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS),
requestHandler: new NodeHttp2Handler(),
retryModeProvider: loadNodeConfig(NODE_RETRY_MODE_CONFIG_OPTIONS),
sha256: Hash.bind(null, "sha256"),
streamCollector,
utf8Decoder: fromUtf8,
utf8Encoder: toUtf8,
};