@aws-sdk/client-sesv2 3.1075.0 → 3.1076.0

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.
@@ -14,7 +14,7 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
14
14
  requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
15
15
  retryMode: string | import("@smithy/types").Provider<string>;
16
16
  sha256: import("@smithy/types").HashConstructor;
17
- streamCollector: import("@smithy/types").StreamCollector;
17
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
18
18
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
19
19
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
20
20
  cacheMiddleware?: boolean | undefined;
@@ -16,7 +16,7 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
16
16
  retryMode: string | import("@smithy/types").Provider<string>;
17
17
  sha256: import("@smithy/types").HashConstructor;
18
18
  sigv4aSigningRegionSet: string[] | import("@smithy/types").Provider<string[] | undefined>;
19
- streamCollector: import("@smithy/types").StreamCollector;
19
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
20
20
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
21
21
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
22
22
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
15
15
  apiVersion: string;
16
16
  urlParser: import("@smithy/types").UrlParser;
17
17
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
18
- streamCollector: import("@smithy/types").StreamCollector;
18
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
19
19
  base64Decoder: import("@smithy/types").Decoder;
20
20
  base64Encoder: (_input: Uint8Array | string) => string;
21
21
  utf8Decoder: import("@smithy/types").Decoder;
@@ -21,7 +21,13 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
21
21
  | RequestHandler;
22
22
  retryMode: string | import("@smithy/types").Provider<string>;
23
23
  sha256: import("@smithy/types").HashConstructor;
24
- streamCollector: import("@smithy/types").StreamCollector;
24
+ streamCollector: (
25
+ stream:
26
+ | import("stream").Readable
27
+ | import("stream/web").ReadableStream
28
+ | ReadableStream
29
+ | Blob
30
+ ) => Promise<Uint8Array>;
25
31
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
26
32
  (boolean | import("@smithy/types").Provider<boolean | undefined>);
27
33
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
@@ -25,7 +25,13 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
25
25
  sigv4aSigningRegionSet:
26
26
  | string[]
27
27
  | import("@smithy/types").Provider<string[] | undefined>;
28
- streamCollector: import("@smithy/types").StreamCollector;
28
+ streamCollector: (
29
+ stream:
30
+ | import("stream").Readable
31
+ | import("stream/web").ReadableStream
32
+ | ReadableStream
33
+ | Blob
34
+ ) => Promise<Uint8Array>;
29
35
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
30
36
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
31
37
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -20,7 +20,13 @@ export declare const getRuntimeConfig: (config: SESv2ClientConfig) => {
20
20
  apiVersion: string;
21
21
  urlParser: import("@smithy/types").UrlParser;
22
22
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
23
- streamCollector: import("@smithy/types").StreamCollector;
23
+ streamCollector: (
24
+ stream:
25
+ | import("stream").Readable
26
+ | import("stream/web").ReadableStream
27
+ | ReadableStream
28
+ | Blob
29
+ ) => Promise<Uint8Array>;
24
30
  base64Decoder: import("@smithy/types").Decoder;
25
31
  base64Encoder: (_input: Uint8Array | string) => string;
26
32
  utf8Decoder: import("@smithy/types").Decoder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sesv2",
3
3
  "description": "AWS SDK for JavaScript Sesv2 Client for Node.js, Browser and React Native",
4
- "version": "3.1075.0",
4
+ "version": "3.1076.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline",
@@ -21,14 +21,14 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "5.2.0",
23
23
  "@aws-crypto/sha256-js": "5.2.0",
24
- "@aws-sdk/core": "^3.974.23",
25
- "@aws-sdk/credential-provider-node": "^3.972.58",
26
- "@aws-sdk/signature-v4-multi-region": "^3.996.35",
27
- "@aws-sdk/types": "^3.973.13",
28
- "@smithy/core": "^3.24.6",
29
- "@smithy/fetch-http-handler": "^5.4.6",
30
- "@smithy/node-http-handler": "^4.7.6",
31
- "@smithy/types": "^4.14.3",
24
+ "@aws-sdk/core": "^3.974.24",
25
+ "@aws-sdk/credential-provider-node": "^3.972.59",
26
+ "@aws-sdk/signature-v4-multi-region": "^3.996.36",
27
+ "@aws-sdk/types": "^3.973.14",
28
+ "@smithy/core": "^3.27.0",
29
+ "@smithy/fetch-http-handler": "^5.6.0",
30
+ "@smithy/node-http-handler": "^4.9.0",
31
+ "@smithy/types": "^4.15.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
@@ -1,122 +0,0 @@
1
- const { resolveAwsSdkSigV4AConfig, resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
3
- const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
4
- const { resolveParams } = require("@smithy/core/endpoints");
5
- const { defaultEndpointResolver } = require("../endpoint/endpointResolver");
6
- const createEndpointRuleSetHttpAuthSchemeParametersProvider = (defaultHttpAuthSchemeParametersProvider) => async (config, context, input) => {
7
- if (!input) {
8
- throw new Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");
9
- }
10
- const defaultParameters = await defaultHttpAuthSchemeParametersProvider(config, context, input);
11
- const instructionsFn = getSmithyContext(context)?.commandInstance?.constructor
12
- ?.getEndpointParameterInstructions;
13
- if (!instructionsFn) {
14
- throw new Error(`getEndpointParameterInstructions() is not defined on '${context.commandName}'`);
15
- }
16
- const endpointParameters = await resolveParams(input, { getEndpointParameterInstructions: instructionsFn }, config);
17
- return Object.assign(defaultParameters, endpointParameters);
18
- };
19
- const _defaultSESv2HttpAuthSchemeParametersProvider = async (config, context, input) => {
20
- return {
21
- operation: getSmithyContext(context).operation,
22
- region: await normalizeProvider(config.region)() || (() => {
23
- throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
24
- })(),
25
- };
26
- };
27
- exports.defaultSESv2HttpAuthSchemeParametersProvider = createEndpointRuleSetHttpAuthSchemeParametersProvider(_defaultSESv2HttpAuthSchemeParametersProvider);
28
- function createAwsAuthSigv4HttpAuthOption(authParameters) {
29
- return {
30
- schemeId: "aws.auth#sigv4",
31
- signingProperties: {
32
- name: "ses",
33
- region: authParameters.region,
34
- },
35
- propertiesExtractor: (config, context) => ({
36
- signingProperties: {
37
- config,
38
- context,
39
- },
40
- }),
41
- };
42
- }
43
- function createAwsAuthSigv4aHttpAuthOption(authParameters) {
44
- return {
45
- schemeId: "aws.auth#sigv4a",
46
- signingProperties: {
47
- name: "ses",
48
- region: authParameters.region,
49
- },
50
- propertiesExtractor: (config, context) => ({
51
- signingProperties: {
52
- config,
53
- context,
54
- },
55
- }),
56
- };
57
- }
58
- const createEndpointRuleSetHttpAuthSchemeProvider = (defaultEndpointResolver, defaultHttpAuthSchemeResolver, createHttpAuthOptionFunctions) => {
59
- const endpointRuleSetHttpAuthSchemeProvider = (authParameters) => {
60
- const endpoint = defaultEndpointResolver(authParameters);
61
- const authSchemes = endpoint.properties?.authSchemes;
62
- if (!authSchemes) {
63
- return defaultHttpAuthSchemeResolver(authParameters);
64
- }
65
- const options = [];
66
- for (const scheme of authSchemes) {
67
- const { name: resolvedName, properties = {}, ...rest } = scheme;
68
- const name = resolvedName.toLowerCase();
69
- if (resolvedName !== name) {
70
- console.warn(`HttpAuthScheme has been normalized with lowercasing: '${resolvedName}' to '${name}'`);
71
- }
72
- let schemeId;
73
- if (name === "sigv4a") {
74
- schemeId = "aws.auth#sigv4a";
75
- const sigv4Present = authSchemes.find((s) => {
76
- const name = s.name.toLowerCase();
77
- return name !== "sigv4a" && name.startsWith("sigv4");
78
- });
79
- if (SignatureV4MultiRegion.sigv4aDependency() === "none" && sigv4Present) {
80
- continue;
81
- }
82
- }
83
- else if (name.startsWith("sigv4")) {
84
- schemeId = "aws.auth#sigv4";
85
- }
86
- else {
87
- throw new Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${name}'`);
88
- }
89
- const createOption = createHttpAuthOptionFunctions[schemeId];
90
- if (!createOption) {
91
- throw new Error(`Could not find HttpAuthOption create function for '${schemeId}'`);
92
- }
93
- const option = createOption(authParameters);
94
- option.schemeId = schemeId;
95
- option.signingProperties = { ...(option.signingProperties || {}), ...rest, ...properties };
96
- options.push(option);
97
- }
98
- return options;
99
- };
100
- return endpointRuleSetHttpAuthSchemeProvider;
101
- };
102
- const _defaultSESv2HttpAuthSchemeProvider = (authParameters) => {
103
- const options = [];
104
- switch (authParameters.operation) {
105
- default: {
106
- options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
107
- options.push(createAwsAuthSigv4aHttpAuthOption(authParameters));
108
- }
109
- }
110
- return options;
111
- };
112
- exports.defaultSESv2HttpAuthSchemeProvider = createEndpointRuleSetHttpAuthSchemeProvider(defaultEndpointResolver, _defaultSESv2HttpAuthSchemeProvider, {
113
- "aws.auth#sigv4": createAwsAuthSigv4HttpAuthOption,
114
- "aws.auth#sigv4a": createAwsAuthSigv4aHttpAuthOption,
115
- });
116
- exports.resolveHttpAuthSchemeConfig = (config) => {
117
- const config_0 = resolveAwsSdkSigV4Config(config);
118
- const config_1 = resolveAwsSdkSigV4AConfig(config_0);
119
- return Object.assign(config_1, {
120
- authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
121
- });
122
- };
@@ -1,61 +0,0 @@
1
- const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
2
- const m = "ref";
3
- const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = { [m]: "EndpointId" }, h = { [m]: "Endpoint" }, i = { [m]: d }, j = { "authSchemes": [{ "name": "sigv4a", "signingName": "ses", "signingRegionSet": ["*"] }] }, k = {}, l = [{ [m]: "Region" }];
4
- const _data = {
5
- conditions: [
6
- [c, l],
7
- ["aws.partition", l, d],
8
- [c, [g]],
9
- ["isValidHostLabel", [g, b]],
10
- [c, [h]],
11
- [e, [{ [m]: "UseFIPS" }, b]],
12
- [e, [{ [m]: "UseDualStack" }, b]],
13
- [e, [{ fn: f, argv: [i, "supportsDualStack"] }, b]],
14
- [e, [{ fn: f, argv: [i, "supportsFIPS"] }, b]]
15
- ],
16
- results: [
17
- [a],
18
- [h, j],
19
- ["https://{EndpointId}.endpoints.email.global.{PartitionResult#dualStackDnsSuffix}", j],
20
- [a, "DualStack is enabled but this partition does not support DualStack"],
21
- ["https://{EndpointId}.endpoints.email.{PartitionResult#dnsSuffix}", j],
22
- [a, "Invalid Configuration: FIPS is not supported with multi-region endpoints"],
23
- [a, "EndpointId must be a valid host label"],
24
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
25
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
26
- [h, k],
27
- ["https://email-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
28
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
29
- ["https://email-fips.{Region}.{PartitionResult#dnsSuffix}", k],
30
- [a, "FIPS is enabled but this partition does not support FIPS"],
31
- ["https://email.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
32
- ["https://email.{Region}.{PartitionResult#dnsSuffix}", k],
33
- [a, "Invalid Configuration: Missing Region"]
34
- ]
35
- };
36
- const root = 2;
37
- const r = 100_000_000;
38
- const nodes = new Int32Array([
39
- -1, 1, -1,
40
- 0, 3, 4,
41
- 1, 5, 4,
42
- 4, 14, r + 16,
43
- 2, 16, 6,
44
- 4, 14, 7,
45
- 5, 10, 8,
46
- 6, 9, r + 15,
47
- 7, r + 14, r + 3,
48
- 6, 12, 11,
49
- 8, r + 12, r + 13,
50
- 7, 13, r + 11,
51
- 8, r + 10, r + 11,
52
- 5, r + 7, 15,
53
- 6, r + 8, r + 9,
54
- 3, 17, r + 6,
55
- 4, 21, 18,
56
- 5, r + 5, 19,
57
- 6, 20, r + 4,
58
- 7, r + 2, r + 3,
59
- 5, r + 5, r + 1,
60
- ]);
61
- exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
@@ -1,14 +0,0 @@
1
- const { awsEndpointFunctions } = require("@aws-sdk/core/client");
2
- const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
3
- const { bdd } = require("./bdd");
4
- const cache = new EndpointCache({
5
- size: 50,
6
- params: ["Endpoint", "EndpointId", "Region", "UseDualStack", "UseFIPS"],
7
- });
8
- exports.defaultEndpointResolver = (endpointParams, context = {}) => {
9
- return cache.get(endpointParams, () => decideEndpoint(bdd, {
10
- endpointParams: endpointParams,
11
- logger: context.logger,
12
- }));
13
- };
14
- customEndpointFunctions.aws = awsEndpointFunctions;
@@ -1,8 +0,0 @@
1
- const { ServiceException: __ServiceException } = require("@smithy/core/client");
2
- exports.__ServiceException = __ServiceException;
3
- exports.SESv2ServiceException = class SESv2ServiceException extends __ServiceException {
4
- constructor(options) {
5
- super(options);
6
- Object.setPrototypeOf(this, SESv2ServiceException.prototype);
7
- }
8
- };
@@ -1,157 +0,0 @@
1
- const { SESv2ServiceException: __BaseException } = require("./SESv2ServiceException");
2
- exports.AccountSuspendedException = class AccountSuspendedException extends __BaseException {
3
- name = "AccountSuspendedException";
4
- $fault = "client";
5
- constructor(opts) {
6
- super({
7
- name: "AccountSuspendedException",
8
- $fault: "client",
9
- ...opts,
10
- });
11
- Object.setPrototypeOf(this, AccountSuspendedException.prototype);
12
- }
13
- };
14
- exports.AlreadyExistsException = class AlreadyExistsException extends __BaseException {
15
- name = "AlreadyExistsException";
16
- $fault = "client";
17
- constructor(opts) {
18
- super({
19
- name: "AlreadyExistsException",
20
- $fault: "client",
21
- ...opts,
22
- });
23
- Object.setPrototypeOf(this, AlreadyExistsException.prototype);
24
- }
25
- };
26
- exports.BadRequestException = class BadRequestException extends __BaseException {
27
- name = "BadRequestException";
28
- $fault = "client";
29
- constructor(opts) {
30
- super({
31
- name: "BadRequestException",
32
- $fault: "client",
33
- ...opts,
34
- });
35
- Object.setPrototypeOf(this, BadRequestException.prototype);
36
- }
37
- };
38
- exports.InternalServiceErrorException = class InternalServiceErrorException extends __BaseException {
39
- name = "InternalServiceErrorException";
40
- $fault = "server";
41
- constructor(opts) {
42
- super({
43
- name: "InternalServiceErrorException",
44
- $fault: "server",
45
- ...opts,
46
- });
47
- Object.setPrototypeOf(this, InternalServiceErrorException.prototype);
48
- }
49
- };
50
- exports.NotFoundException = class NotFoundException extends __BaseException {
51
- name = "NotFoundException";
52
- $fault = "client";
53
- constructor(opts) {
54
- super({
55
- name: "NotFoundException",
56
- $fault: "client",
57
- ...opts,
58
- });
59
- Object.setPrototypeOf(this, NotFoundException.prototype);
60
- }
61
- };
62
- exports.TooManyRequestsException = class TooManyRequestsException extends __BaseException {
63
- name = "TooManyRequestsException";
64
- $fault = "client";
65
- constructor(opts) {
66
- super({
67
- name: "TooManyRequestsException",
68
- $fault: "client",
69
- ...opts,
70
- });
71
- Object.setPrototypeOf(this, TooManyRequestsException.prototype);
72
- }
73
- };
74
- exports.ConcurrentModificationException = class ConcurrentModificationException extends __BaseException {
75
- name = "ConcurrentModificationException";
76
- $fault = "server";
77
- constructor(opts) {
78
- super({
79
- name: "ConcurrentModificationException",
80
- $fault: "server",
81
- ...opts,
82
- });
83
- Object.setPrototypeOf(this, ConcurrentModificationException.prototype);
84
- }
85
- };
86
- exports.ConflictException = class ConflictException extends __BaseException {
87
- name = "ConflictException";
88
- $fault = "client";
89
- constructor(opts) {
90
- super({
91
- name: "ConflictException",
92
- $fault: "client",
93
- ...opts,
94
- });
95
- Object.setPrototypeOf(this, ConflictException.prototype);
96
- }
97
- };
98
- exports.LimitExceededException = class LimitExceededException extends __BaseException {
99
- name = "LimitExceededException";
100
- $fault = "client";
101
- constructor(opts) {
102
- super({
103
- name: "LimitExceededException",
104
- $fault: "client",
105
- ...opts,
106
- });
107
- Object.setPrototypeOf(this, LimitExceededException.prototype);
108
- }
109
- };
110
- exports.MailFromDomainNotVerifiedException = class MailFromDomainNotVerifiedException extends __BaseException {
111
- name = "MailFromDomainNotVerifiedException";
112
- $fault = "client";
113
- constructor(opts) {
114
- super({
115
- name: "MailFromDomainNotVerifiedException",
116
- $fault: "client",
117
- ...opts,
118
- });
119
- Object.setPrototypeOf(this, MailFromDomainNotVerifiedException.prototype);
120
- }
121
- };
122
- exports.MessageRejected = class MessageRejected extends __BaseException {
123
- name = "MessageRejected";
124
- $fault = "client";
125
- constructor(opts) {
126
- super({
127
- name: "MessageRejected",
128
- $fault: "client",
129
- ...opts,
130
- });
131
- Object.setPrototypeOf(this, MessageRejected.prototype);
132
- }
133
- };
134
- exports.SendingPausedException = class SendingPausedException extends __BaseException {
135
- name = "SendingPausedException";
136
- $fault = "client";
137
- constructor(opts) {
138
- super({
139
- name: "SendingPausedException",
140
- $fault: "client",
141
- ...opts,
142
- });
143
- Object.setPrototypeOf(this, SendingPausedException.prototype);
144
- }
145
- };
146
- exports.InvalidNextTokenException = class InvalidNextTokenException extends __BaseException {
147
- name = "InvalidNextTokenException";
148
- $fault = "client";
149
- constructor(opts) {
150
- super({
151
- name: "InvalidNextTokenException",
152
- $fault: "client",
153
- ...opts,
154
- });
155
- Object.setPrototypeOf(this, InvalidNextTokenException.prototype);
156
- }
157
- };
@@ -1,32 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { Sha256 } = require("@aws-crypto/sha256-browser");
3
- const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
4
- const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
5
- const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
6
- const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
7
- const { calculateBodyLength } = require("@smithy/core/serde");
8
- const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
9
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
10
- const getRuntimeConfig = (config) => {
11
- const defaultsMode = resolveDefaultsModeConfig(config);
12
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
13
- const clientSharedValues = getSharedRuntimeConfig(config);
14
- return {
15
- ...clientSharedValues,
16
- ...config,
17
- runtime: "browser",
18
- defaultsMode,
19
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
20
- credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
21
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
22
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
23
- region: config?.region ?? invalidProvider("Region is missing"),
24
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
25
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
26
- sha256: config?.sha256 ?? Sha256,
27
- streamCollector: config?.streamCollector ?? streamCollector,
28
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
29
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
30
- };
31
- };
32
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,46 +0,0 @@
1
- const packageInfo = require("../package.json");
2
- const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
3
- const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_SIGV4A_CONFIG_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
4
- const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
5
- const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
6
- const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
7
- const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
8
- const { calculateBodyLength, Hash } = require("@smithy/core/serde");
9
- const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
10
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
11
- const getRuntimeConfig = (config) => {
12
- emitWarningIfUnsupportedVersion(process.version);
13
- const defaultsMode = resolveDefaultsModeConfig(config);
14
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
15
- const clientSharedValues = getSharedRuntimeConfig(config);
16
- awsCheckVersion(process.version);
17
- const loaderConfig = {
18
- profile: config?.profile,
19
- logger: clientSharedValues.logger,
20
- };
21
- return {
22
- ...clientSharedValues,
23
- ...config,
24
- runtime: "node",
25
- defaultsMode,
26
- authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
27
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
28
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
29
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
30
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
31
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
32
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
33
- retryMode: config?.retryMode ??
34
- loadNodeConfig({
35
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
36
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
37
- }, config),
38
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
39
- sigv4aSigningRegionSet: config?.sigv4aSigningRegionSet ?? loadNodeConfig(NODE_SIGV4A_CONFIG_OPTIONS, loaderConfig),
40
- streamCollector: config?.streamCollector ?? streamCollector,
41
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
42
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
43
- userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
44
- };
45
- };
46
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,12 +0,0 @@
1
- const { Sha256 } = require("@aws-crypto/sha256-js");
2
- const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
3
- const getRuntimeConfig = (config) => {
4
- const browserDefaults = getBrowserRuntimeConfig(config);
5
- return {
6
- ...browserDefaults,
7
- ...config,
8
- runtime: "react-native",
9
- sha256: config?.sha256 ?? Sha256,
10
- };
11
- };
12
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,45 +0,0 @@
1
- const { AwsSdkSigV4ASigner, AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
3
- const { SignatureV4MultiRegion } = require("@aws-sdk/signature-v4-multi-region");
4
- const { NoOpLogger } = require("@smithy/core/client");
5
- const { parseUrl } = require("@smithy/core/protocols");
6
- const { fromBase64, fromUtf8, toBase64, toUtf8 } = require("@smithy/core/serde");
7
- const { defaultSESv2HttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
8
- const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
9
- const { errorTypeRegistries } = require("./schemas/schemas_0");
10
- exports.getRuntimeConfig = (config) => {
11
- return {
12
- apiVersion: "2019-09-27",
13
- base64Decoder: config?.base64Decoder ?? fromBase64,
14
- base64Encoder: config?.base64Encoder ?? toBase64,
15
- disableHostPrefix: config?.disableHostPrefix ?? false,
16
- endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
17
- extensions: config?.extensions ?? [],
18
- httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSESv2HttpAuthSchemeProvider,
19
- httpAuthSchemes: config?.httpAuthSchemes ?? [
20
- {
21
- schemeId: "aws.auth#sigv4",
22
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
23
- signer: new AwsSdkSigV4Signer(),
24
- },
25
- {
26
- schemeId: "aws.auth#sigv4a",
27
- identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4a"),
28
- signer: new AwsSdkSigV4ASigner(),
29
- },
30
- ],
31
- logger: config?.logger ?? new NoOpLogger(),
32
- protocol: config?.protocol ?? AwsRestJsonProtocol,
33
- protocolSettings: config?.protocolSettings ?? {
34
- defaultNamespace: "com.amazonaws.sesv2",
35
- errorTypeRegistries,
36
- version: "2019-09-27",
37
- serviceTarget: "SimpleEmailService_v2",
38
- },
39
- serviceId: config?.serviceId ?? "SESv2",
40
- signerConstructor: config?.signerConstructor ?? SignatureV4MultiRegion,
41
- urlParser: config?.urlParser ?? parseUrl,
42
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
43
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
44
- };
45
- };