@qqbrowser/openclaw-qbot 0.10.13 → 0.10.15
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.
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +6 -6
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-cjs/index.js +1 -0
- package/node_modules/@aws-sdk/client-bedrock-runtime/dist-es/models/enums.js +1 -0
- package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +13 -13
- package/node_modules/@aws-sdk/core/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-login/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +12 -1
- package/node_modules/@aws-sdk/credential-provider-node/dist-es/runtime/memoize-chain.js +12 -1
- package/node_modules/@aws-sdk/credential-provider-node/package.json +11 -11
- package/node_modules/@aws-sdk/credential-provider-process/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
- package/node_modules/@aws-sdk/eventstream-handler-node/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-eventstream/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-websocket/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +8 -8
- package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +4 -4
- package/node_modules/@aws-sdk/token-providers/package.json +6 -6
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
- package/node_modules/@clack/core/dist/index.mjs +7 -7
- package/node_modules/@clack/core/package.json +2 -1
- package/node_modules/@clack/prompts/dist/index.mjs +38 -38
- package/node_modules/@clack/prompts/package.json +2 -2
- package/node_modules/@nodable/entities/package.json +1 -1
- package/node_modules/@nodable/entities/src/EntityDecoder.js +1 -1
- package/node_modules/@nodable/entities/src/entities.js +0 -18
- package/node_modules/@slack/bolt/dist/App.js +8 -12
- package/node_modules/@slack/bolt/dist/context/index.js +7 -7
- package/node_modules/@slack/bolt/dist/index.js +16 -16
- package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.js +2 -0
- package/node_modules/@slack/bolt/dist/receivers/ExpressReceiver.js +8 -1
- package/node_modules/@slack/bolt/dist/receivers/HTTPReceiver.js +4 -2
- package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.js +1 -1
- package/node_modules/@slack/bolt/dist/receivers/verify-request.js +3 -0
- package/node_modules/@slack/bolt/dist/receivers/verify-signing-secret.js +12 -0
- package/node_modules/@slack/bolt/dist/types/actions/index.js +1 -1
- package/node_modules/@slack/bolt/dist/types/index.js +3 -3
- package/node_modules/@slack/bolt/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/index.js +3 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +3 -11
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +9 -40
- package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +9 -40
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +12 -142
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.browser.js +39 -22
- package/node_modules/@smithy/core/dist-cjs/submodules/retry/index.js +39 -22
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +7 -9
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +184 -0
- package/node_modules/@smithy/core/dist-es/index.js +6 -6
- package/node_modules/@smithy/core/dist-es/submodules/client/index.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.browser.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +5 -5
- package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/configurations.js +19 -6
- package/node_modules/@smithy/core/dist-es/submodules/retry/middleware-retry/retryMiddleware.js +4 -5
- package/node_modules/@smithy/core/dist-es/submodules/retry/service-error-classification/constants.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/ConfiguredRetryStrategy.js +4 -5
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/DefaultRetryToken.js +3 -0
- package/node_modules/@smithy/core/dist-es/submodules/retry/util-retry/StandardRetryStrategy.js +9 -5
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +3 -4
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +1 -2
- package/node_modules/@smithy/core/dist-es/submodules/serde/middleware-serde/deserializerMiddleware.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/transport/index.js +9 -0
- package/node_modules/@smithy/core/dist-es/submodules/{protocols/url-parser → transport}/parseUrl.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/{endpoints → transport}/toEndpointV1.js +1 -1
- package/node_modules/@smithy/core/package.json +20 -11
- package/node_modules/@smithy/core/transport.js +5 -0
- package/node_modules/@smithy/credential-provider-imds/dist-cjs/index.js +14 -13
- package/node_modules/@smithy/credential-provider-imds/dist-es/fromContainerMetadata.js +14 -13
- package/node_modules/@smithy/credential-provider-imds/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +4 -4
- package/node_modules/@smithy/signature-v4/package.json +3 -3
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/eventsource-parser/dist/index.cjs +21 -10
- package/node_modules/eventsource-parser/dist/index.d.cts +33 -10
- package/node_modules/eventsource-parser/dist/index.js +21 -10
- package/node_modules/eventsource-parser/dist/stream.cjs +4 -3
- package/node_modules/eventsource-parser/dist/stream.d.cts +16 -3
- package/node_modules/eventsource-parser/dist/stream.js +4 -3
- package/node_modules/eventsource-parser/package.json +8 -8
- package/node_modules/hasown/package.json +4 -5
- package/node_modules/lru-cache/package.json +1 -1
- package/node_modules/protobufjs/dist/light/protobuf.js +7 -5
- package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.js +3 -3
- package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
- package/node_modules/protobufjs/dist/protobuf.js +7 -5
- package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
- package/node_modules/protobufjs/package.json +1 -1
- package/node_modules/protobufjs/src/converter.js +4 -2
- package/node_modules/protobufjs/src/roots.js +1 -1
- package/node_modules/thread-stream/.claude/settings.local.json +15 -0
- package/node_modules/thread-stream/CLAUDE.md +64 -0
- package/node_modules/thread-stream/index.js +41 -13
- package/node_modules/thread-stream/lib/indexes.js +3 -1
- package/node_modules/thread-stream/lib/worker.js +20 -8
- package/node_modules/thread-stream/package.json +1 -1
- package/node_modules/undici/lib/global.js +10 -1
- package/node_modules/undici/package.json +1 -1
- package/package.json +1 -1
- package/skills/qqbrowser-playbook/SKILL.md +262 -234
- package/skills/qqbrowser-skill/SKILL.md +330 -234
- package/node_modules/@smithy/core/dist-cjs/getSmithyContext.js +0 -6
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -21
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +0 -21
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +0 -46
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/index.js +0 -6
- package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/resolveAuthOptions.js +0 -24
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/getHttpSigningMiddleware.js +0 -19
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/httpSigningMiddleware.js +0 -27
- package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/index.js +0 -5
- package/node_modules/@smithy/core/dist-cjs/normalizeProvider.js +0 -10
- package/node_modules/@smithy/core/dist-cjs/pagination/createPaginator.js +0 -44
- package/node_modules/@smithy/core/dist-cjs/request-builder/requestBuilder.js +0 -5
- package/node_modules/@smithy/core/dist-cjs/setFeature.js +0 -14
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +0 -18
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +0 -38
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +0 -15
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/index.js +0 -6
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/noAuth.js +0 -9
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/index.js +0 -6
- package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/memoizeIdentityProvider.js +0 -61
- package/node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js +0 -1
- package/node_modules/@smithy/core/dist-es/submodules/client/util-middleware/getSmithyContext.js +0 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/TestVectors.fixture.js +0 -146
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/vectorTypes.fixture.js +0 -1
- package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/index.js +0 -2
- package/node_modules/@smithy/node-http-handler/dist-es/readable.mock.js +0 -21
- package/node_modules/@smithy/node-http-handler/dist-es/server.mock.js +0 -88
- package/node_modules/@smithy/node-http-handler/dist-es/stream-collector/readable.mock.js +0 -21
- package/node_modules/@smithy/signature-v4/dist-es/suite.fixture.js +0 -399
- /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemePlugin.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/httpAuthSchemeMiddleware.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/index.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/resolveAuthOptions.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/getHttpSigningMiddleware.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/httpSigningMiddleware.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/index.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{pagination → legacy-root-exports/pagination}/createPaginator.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/DefaultIdentityProviderConfig.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpApiKeyAuth.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpBearerAuth.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/index.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/noAuth.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/index.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/memoizeIdentityProvider.js +0 -0
- /package/node_modules/@smithy/core/dist-es/{getSmithyContext.js → submodules/transport/getSmithyContext.js} +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/httpRequest.js +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/httpResponse.js +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{endpoints/util-endpoints/lib → transport}/isValidHostLabel.js +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/isValidHostname.js +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{client/util-middleware → transport}/normalizeProvider.js +0 -0
- /package/node_modules/@smithy/core/dist-es/submodules/{protocols/querystring-parser → transport}/parseQueryString.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var config = require('@smithy/core/config');
|
|
4
|
-
var
|
|
4
|
+
var transport = require('@smithy/core/transport');
|
|
5
5
|
var client = require('@smithy/core/client');
|
|
6
6
|
var types = require('@smithy/types');
|
|
7
7
|
|
|
@@ -125,23 +125,6 @@ const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config,
|
|
|
125
125
|
return configProvider;
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
-
const toEndpointV1 = (endpoint) => {
|
|
129
|
-
if (typeof endpoint === "object") {
|
|
130
|
-
if ("url" in endpoint) {
|
|
131
|
-
const v1Endpoint = protocols.parseUrl(endpoint.url);
|
|
132
|
-
if (endpoint.headers) {
|
|
133
|
-
v1Endpoint.headers = {};
|
|
134
|
-
for (const name in endpoint.headers) {
|
|
135
|
-
v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
return v1Endpoint;
|
|
139
|
-
}
|
|
140
|
-
return endpoint;
|
|
141
|
-
}
|
|
142
|
-
return protocols.parseUrl(endpoint);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
128
|
function bindGetEndpointFromInstructions(getEndpointFromConfig) {
|
|
146
129
|
return async (commandInput, instructionsSupplier, clientConfig, context) => {
|
|
147
130
|
if (!clientConfig.isCustomEndpoint) {
|
|
@@ -153,7 +136,7 @@ function bindGetEndpointFromInstructions(getEndpointFromConfig) {
|
|
|
153
136
|
endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
|
|
154
137
|
}
|
|
155
138
|
if (endpointFromConfig) {
|
|
156
|
-
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
|
139
|
+
clientConfig.endpoint = () => Promise.resolve(transport.toEndpointV1(endpointFromConfig));
|
|
157
140
|
clientConfig.isCustomEndpoint = true;
|
|
158
141
|
}
|
|
159
142
|
}
|
|
@@ -277,14 +260,14 @@ function bindResolveEndpointConfig(getEndpointFromConfig) {
|
|
|
277
260
|
return (input) => {
|
|
278
261
|
const tls = input.tls ?? true;
|
|
279
262
|
const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
|
|
280
|
-
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await
|
|
263
|
+
const customEndpointProvider = endpoint != null ? async () => transport.toEndpointV1(await transport.normalizeProvider(endpoint)()) : undefined;
|
|
281
264
|
const isCustomEndpoint = !!endpoint;
|
|
282
265
|
const resolvedConfig = Object.assign(input, {
|
|
283
266
|
endpoint: customEndpointProvider,
|
|
284
267
|
tls,
|
|
285
268
|
isCustomEndpoint,
|
|
286
|
-
useDualstackEndpoint:
|
|
287
|
-
useFipsEndpoint:
|
|
269
|
+
useDualstackEndpoint: transport.normalizeProvider(useDualstackEndpoint ?? false),
|
|
270
|
+
useFipsEndpoint: transport.normalizeProvider(useFipsEndpoint ?? false),
|
|
288
271
|
});
|
|
289
272
|
let configuredEndpointPromise = undefined;
|
|
290
273
|
resolvedConfig.serviceConfiguredEndpoint = async () => {
|
|
@@ -437,20 +420,6 @@ const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
|
437
420
|
|
|
438
421
|
const isSet = (value) => value != null;
|
|
439
422
|
|
|
440
|
-
const VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
441
|
-
const isValidHostLabel = (value, allowSubDomains = false) => {
|
|
442
|
-
if (!allowSubDomains) {
|
|
443
|
-
return VALID_HOST_LABEL_REGEX.test(value);
|
|
444
|
-
}
|
|
445
|
-
const labels = value.split(".");
|
|
446
|
-
for (const label of labels) {
|
|
447
|
-
if (!isValidHostLabel(label)) {
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
return true;
|
|
452
|
-
};
|
|
453
|
-
|
|
454
423
|
function ite(condition, trueValue, falseValue) {
|
|
455
424
|
return condition ? trueValue : falseValue;
|
|
456
425
|
}
|
|
@@ -543,7 +512,7 @@ const endpointFunctions = {
|
|
|
543
512
|
coalesce,
|
|
544
513
|
getAttr,
|
|
545
514
|
isSet,
|
|
546
|
-
isValidHostLabel,
|
|
515
|
+
isValidHostLabel: transport.isValidHostLabel,
|
|
547
516
|
ite,
|
|
548
517
|
not,
|
|
549
518
|
parseURL,
|
|
@@ -873,6 +842,9 @@ const resolveEndpointConfig = bindResolveEndpointConfig(getEndpointFromConfig);
|
|
|
873
842
|
const endpointMiddleware = bindEndpointMiddleware(getEndpointFromConfig);
|
|
874
843
|
const getEndpointPlugin = bindGetEndpointPlugin(getEndpointFromConfig);
|
|
875
844
|
|
|
845
|
+
exports.isValidHostLabel = transport.isValidHostLabel;
|
|
846
|
+
exports.middlewareEndpointToEndpointV1 = transport.toEndpointV1;
|
|
847
|
+
exports.toEndpointV1 = transport.toEndpointV1;
|
|
876
848
|
exports.BinaryDecisionDiagram = BinaryDecisionDiagram;
|
|
877
849
|
exports.EndpointCache = EndpointCache;
|
|
878
850
|
exports.EndpointError = EndpointError;
|
|
@@ -883,10 +855,7 @@ exports.endpointMiddlewareOptions = endpointMiddlewareOptions;
|
|
|
883
855
|
exports.getEndpointFromInstructions = getEndpointFromInstructions;
|
|
884
856
|
exports.getEndpointPlugin = getEndpointPlugin;
|
|
885
857
|
exports.isIpAddress = isIpAddress;
|
|
886
|
-
exports.isValidHostLabel = isValidHostLabel;
|
|
887
|
-
exports.middlewareEndpointToEndpointV1 = toEndpointV1;
|
|
888
858
|
exports.resolveEndpoint = resolveEndpoint;
|
|
889
859
|
exports.resolveEndpointConfig = resolveEndpointConfig;
|
|
890
860
|
exports.resolveEndpointRequiredConfig = resolveEndpointRequiredConfig;
|
|
891
861
|
exports.resolveParams = resolveParams;
|
|
892
|
-
exports.toEndpointV1 = toEndpointV1;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var serde = require('@smithy/core/serde');
|
|
4
4
|
var schema = require('@smithy/core/schema');
|
|
5
|
+
var transport = require('@smithy/core/transport');
|
|
5
6
|
var types = require('@smithy/types');
|
|
6
7
|
|
|
7
8
|
const collectBody = async (streamBody = new Uint8Array(), context) => {
|
|
@@ -28,90 +29,6 @@ class SerdeContext {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
class HttpRequest {
|
|
32
|
-
method;
|
|
33
|
-
protocol;
|
|
34
|
-
hostname;
|
|
35
|
-
port;
|
|
36
|
-
path;
|
|
37
|
-
query;
|
|
38
|
-
headers;
|
|
39
|
-
username;
|
|
40
|
-
password;
|
|
41
|
-
fragment;
|
|
42
|
-
body;
|
|
43
|
-
constructor(options) {
|
|
44
|
-
this.method = options.method || "GET";
|
|
45
|
-
this.hostname = options.hostname || "localhost";
|
|
46
|
-
this.port = options.port;
|
|
47
|
-
this.query = options.query || {};
|
|
48
|
-
this.headers = options.headers || {};
|
|
49
|
-
this.body = options.body;
|
|
50
|
-
this.protocol = options.protocol
|
|
51
|
-
? options.protocol.slice(-1) !== ":"
|
|
52
|
-
? `${options.protocol}:`
|
|
53
|
-
: options.protocol
|
|
54
|
-
: "https:";
|
|
55
|
-
this.path = options.path ? (options.path.charAt(0) !== "/" ? `/${options.path}` : options.path) : "/";
|
|
56
|
-
this.username = options.username;
|
|
57
|
-
this.password = options.password;
|
|
58
|
-
this.fragment = options.fragment;
|
|
59
|
-
}
|
|
60
|
-
static clone(request) {
|
|
61
|
-
const cloned = new HttpRequest({
|
|
62
|
-
...request,
|
|
63
|
-
headers: { ...request.headers },
|
|
64
|
-
});
|
|
65
|
-
if (cloned.query) {
|
|
66
|
-
cloned.query = cloneQuery(cloned.query);
|
|
67
|
-
}
|
|
68
|
-
return cloned;
|
|
69
|
-
}
|
|
70
|
-
static isInstance(request) {
|
|
71
|
-
if (!request) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
const req = request;
|
|
75
|
-
return ("method" in req &&
|
|
76
|
-
"protocol" in req &&
|
|
77
|
-
"hostname" in req &&
|
|
78
|
-
"path" in req &&
|
|
79
|
-
typeof req["query"] === "object" &&
|
|
80
|
-
typeof req["headers"] === "object");
|
|
81
|
-
}
|
|
82
|
-
clone() {
|
|
83
|
-
return HttpRequest.clone(this);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function cloneQuery(query) {
|
|
87
|
-
return Object.keys(query).reduce((carry, paramName) => {
|
|
88
|
-
const param = query[paramName];
|
|
89
|
-
return {
|
|
90
|
-
...carry,
|
|
91
|
-
[paramName]: Array.isArray(param) ? [...param] : param,
|
|
92
|
-
};
|
|
93
|
-
}, {});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
class HttpResponse {
|
|
97
|
-
statusCode;
|
|
98
|
-
reason;
|
|
99
|
-
headers;
|
|
100
|
-
body;
|
|
101
|
-
constructor(options) {
|
|
102
|
-
this.statusCode = options.statusCode;
|
|
103
|
-
this.reason = options.reason;
|
|
104
|
-
this.headers = options.headers || {};
|
|
105
|
-
this.body = options.body;
|
|
106
|
-
}
|
|
107
|
-
static isInstance(response) {
|
|
108
|
-
if (!response)
|
|
109
|
-
return false;
|
|
110
|
-
const resp = response;
|
|
111
|
-
return typeof resp.statusCode === "number" && typeof resp.headers === "object";
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
32
|
class HttpProtocol extends SerdeContext {
|
|
116
33
|
options;
|
|
117
34
|
compositeErrorRegistry;
|
|
@@ -124,10 +41,10 @@ class HttpProtocol extends SerdeContext {
|
|
|
124
41
|
}
|
|
125
42
|
}
|
|
126
43
|
getRequestType() {
|
|
127
|
-
return HttpRequest;
|
|
44
|
+
return transport.HttpRequest;
|
|
128
45
|
}
|
|
129
46
|
getResponseType() {
|
|
130
|
-
return HttpResponse;
|
|
47
|
+
return transport.HttpResponse;
|
|
131
48
|
}
|
|
132
49
|
setSerdeContext(serdeContext) {
|
|
133
50
|
this.serdeContext = serdeContext;
|
|
@@ -259,7 +176,7 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
259
176
|
const payloadMemberSchemas = [];
|
|
260
177
|
let hasNonHttpBindingMember = false;
|
|
261
178
|
let payload;
|
|
262
|
-
const request = new HttpRequest({
|
|
179
|
+
const request = new transport.HttpRequest({
|
|
263
180
|
protocol: "",
|
|
264
181
|
hostname: "",
|
|
265
182
|
port: undefined,
|
|
@@ -542,7 +459,7 @@ class RpcProtocol extends HttpProtocol {
|
|
|
542
459
|
const schema$1 = ns.getSchema();
|
|
543
460
|
let payload;
|
|
544
461
|
const input = _input && typeof _input === "object" ? _input : {};
|
|
545
|
-
const request = new HttpRequest({
|
|
462
|
+
const request = new transport.HttpRequest({
|
|
546
463
|
protocol: "",
|
|
547
464
|
hostname: "",
|
|
548
465
|
port: undefined,
|
|
@@ -663,7 +580,7 @@ class RequestBuilder {
|
|
|
663
580
|
for (const resolvePath of this.resolvePathStack) {
|
|
664
581
|
resolvePath(this.path);
|
|
665
582
|
}
|
|
666
|
-
return new HttpRequest({
|
|
583
|
+
return new transport.HttpRequest({
|
|
667
584
|
protocol,
|
|
668
585
|
hostname: this.hostname || hostname,
|
|
669
586
|
port,
|
|
@@ -994,11 +911,6 @@ class Fields {
|
|
|
994
911
|
}
|
|
995
912
|
}
|
|
996
913
|
|
|
997
|
-
function isValidHostname(hostname) {
|
|
998
|
-
const hostPattern = /^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/;
|
|
999
|
-
return hostPattern.test(hostname);
|
|
1000
|
-
}
|
|
1001
|
-
|
|
1002
914
|
const getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
1003
915
|
return {
|
|
1004
916
|
setHttpHandler(handler) {
|
|
@@ -1025,7 +937,7 @@ const CONTENT_LENGTH_HEADER = "content-length";
|
|
|
1025
937
|
function contentLengthMiddleware(bodyLengthChecker) {
|
|
1026
938
|
return (next) => async (args) => {
|
|
1027
939
|
const request = args.request;
|
|
1028
|
-
if (HttpRequest.isInstance(request)) {
|
|
940
|
+
if (transport.HttpRequest.isInstance(request)) {
|
|
1029
941
|
const { body, headers } = request;
|
|
1030
942
|
if (body &&
|
|
1031
943
|
Object.keys(headers)
|
|
@@ -1086,48 +998,11 @@ function buildQueryString(query) {
|
|
|
1086
998
|
return parts.join("&");
|
|
1087
999
|
}
|
|
1088
1000
|
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
let [key, value = null] = pair.split("=");
|
|
1095
|
-
key = decodeURIComponent(key);
|
|
1096
|
-
if (value) {
|
|
1097
|
-
value = decodeURIComponent(value);
|
|
1098
|
-
}
|
|
1099
|
-
if (!(key in query)) {
|
|
1100
|
-
query[key] = value;
|
|
1101
|
-
}
|
|
1102
|
-
else if (Array.isArray(query[key])) {
|
|
1103
|
-
query[key].push(value);
|
|
1104
|
-
}
|
|
1105
|
-
else {
|
|
1106
|
-
query[key] = [query[key], value];
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
return query;
|
|
1111
|
-
}
|
|
1112
|
-
|
|
1113
|
-
const parseUrl = (url) => {
|
|
1114
|
-
if (typeof url === "string") {
|
|
1115
|
-
return parseUrl(new URL(url));
|
|
1116
|
-
}
|
|
1117
|
-
const { hostname, pathname, port, protocol, search } = url;
|
|
1118
|
-
let query;
|
|
1119
|
-
if (search) {
|
|
1120
|
-
query = parseQueryString(search);
|
|
1121
|
-
}
|
|
1122
|
-
return {
|
|
1123
|
-
hostname,
|
|
1124
|
-
port: port ? parseInt(port) : undefined,
|
|
1125
|
-
protocol,
|
|
1126
|
-
path: pathname,
|
|
1127
|
-
query,
|
|
1128
|
-
};
|
|
1129
|
-
};
|
|
1130
|
-
|
|
1001
|
+
exports.HttpRequest = transport.HttpRequest;
|
|
1002
|
+
exports.HttpResponse = transport.HttpResponse;
|
|
1003
|
+
exports.isValidHostname = transport.isValidHostname;
|
|
1004
|
+
exports.parseQueryString = transport.parseQueryString;
|
|
1005
|
+
exports.parseUrl = transport.parseUrl;
|
|
1131
1006
|
exports.Field = Field;
|
|
1132
1007
|
exports.Fields = Fields;
|
|
1133
1008
|
exports.FromStringShapeDeserializer = FromStringShapeDeserializer;
|
|
@@ -1135,8 +1010,6 @@ exports.HttpBindingProtocol = HttpBindingProtocol;
|
|
|
1135
1010
|
exports.HttpInterceptingShapeDeserializer = HttpInterceptingShapeDeserializer;
|
|
1136
1011
|
exports.HttpInterceptingShapeSerializer = HttpInterceptingShapeSerializer;
|
|
1137
1012
|
exports.HttpProtocol = HttpProtocol;
|
|
1138
|
-
exports.HttpRequest = HttpRequest;
|
|
1139
|
-
exports.HttpResponse = HttpResponse;
|
|
1140
1013
|
exports.RequestBuilder = RequestBuilder;
|
|
1141
1014
|
exports.RpcProtocol = RpcProtocol;
|
|
1142
1015
|
exports.SerdeContext = SerdeContext;
|
|
@@ -1151,9 +1024,6 @@ exports.escapeUriPath = escapeUriPath;
|
|
|
1151
1024
|
exports.extendedEncodeURIComponent = extendedEncodeURIComponent;
|
|
1152
1025
|
exports.getContentLengthPlugin = getContentLengthPlugin;
|
|
1153
1026
|
exports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration;
|
|
1154
|
-
exports.isValidHostname = isValidHostname;
|
|
1155
|
-
exports.parseQueryString = parseQueryString;
|
|
1156
|
-
exports.parseUrl = parseUrl;
|
|
1157
1027
|
exports.requestBuilder = requestBuilder;
|
|
1158
1028
|
exports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig;
|
|
1159
1029
|
exports.resolvedPath = resolvedPath;
|
|
@@ -33,7 +33,7 @@ const THROTTLING_ERROR_CODES = [
|
|
|
33
33
|
const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
34
34
|
const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
35
35
|
const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
36
|
-
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
36
|
+
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
|
|
37
37
|
|
|
38
38
|
const isRetryableByTrait = (error) => error?.$retryable !== undefined;
|
|
39
39
|
const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);
|
|
@@ -184,9 +184,6 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
184
184
|
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
185
185
|
}
|
|
186
186
|
catch (refreshError) {
|
|
187
|
-
if (typeof refreshError.$backoff === "number") {
|
|
188
|
-
await cooldown(refreshError.$backoff);
|
|
189
|
-
}
|
|
190
187
|
if (!lastError.$metadata) {
|
|
191
188
|
lastError.$metadata = {};
|
|
192
189
|
}
|
|
@@ -196,8 +193,10 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
196
193
|
}
|
|
197
194
|
attempts = retryToken.getRetryCount();
|
|
198
195
|
const delay = retryToken.getRetryDelay();
|
|
199
|
-
totalRetryDelay += delay;
|
|
200
|
-
|
|
196
|
+
totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
|
|
197
|
+
if (delay > 0) {
|
|
198
|
+
await cooldown(delay);
|
|
199
|
+
}
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
}
|
|
@@ -398,6 +397,9 @@ class DefaultRetryToken {
|
|
|
398
397
|
count;
|
|
399
398
|
cost;
|
|
400
399
|
longPoll;
|
|
400
|
+
$retryLog = {
|
|
401
|
+
acquisitionDelay: 0,
|
|
402
|
+
};
|
|
401
403
|
constructor(delay, count, cost, longPoll) {
|
|
402
404
|
this.delay = delay;
|
|
403
405
|
this.count = count;
|
|
@@ -433,8 +435,8 @@ const refusal = {
|
|
|
433
435
|
};
|
|
434
436
|
let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
435
437
|
mode = exports.RETRY_MODES.STANDARD;
|
|
436
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
437
438
|
retryBackoffStrategy;
|
|
439
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
438
440
|
maxAttemptsProvider;
|
|
439
441
|
baseDelay;
|
|
440
442
|
constructor(arg1) {
|
|
@@ -470,14 +472,18 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
470
472
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
471
473
|
}
|
|
472
474
|
if (!shouldRetry) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
475
|
+
const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
476
|
+
if (longPollBackoff > 0) {
|
|
477
|
+
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
478
|
+
}
|
|
476
479
|
}
|
|
477
480
|
else {
|
|
478
481
|
const capacityCost = this.getCapacityCost(errorType);
|
|
479
482
|
this.capacity -= capacityCost;
|
|
480
|
-
|
|
483
|
+
const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
|
|
484
|
+
await new Promise((r) => setTimeout(r, retryDelay));
|
|
485
|
+
nextToken.$retryLog.acquisitionDelay = retryDelay;
|
|
486
|
+
return nextToken;
|
|
481
487
|
}
|
|
482
488
|
}
|
|
483
489
|
throw new Error("No retry token available");
|
|
@@ -559,11 +565,10 @@ class ConfiguredRetryStrategy extends StandardRetryStrategy$1 {
|
|
|
559
565
|
else {
|
|
560
566
|
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
561
567
|
}
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
return token;
|
|
568
|
+
this.retryBackoffStrategy.computeNextBackoffDelay = (completedAttempt) => {
|
|
569
|
+
const nextAttempt = completedAttempt + 1;
|
|
570
|
+
return this.computeNextBackoffDelay(nextAttempt);
|
|
571
|
+
};
|
|
567
572
|
}
|
|
568
573
|
}
|
|
569
574
|
|
|
@@ -710,17 +715,29 @@ class AdaptiveRetryStrategy extends StandardRetryStrategy {
|
|
|
710
715
|
}
|
|
711
716
|
}
|
|
712
717
|
|
|
713
|
-
const resolveRetryConfig = (input) => {
|
|
718
|
+
const resolveRetryConfig = (input, defaults) => {
|
|
714
719
|
const { retryStrategy, retryMode } = input;
|
|
715
|
-
const
|
|
720
|
+
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
721
|
+
const maxAttemptsProvider = client.normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
716
722
|
let controller = retryStrategy
|
|
717
723
|
? Promise.resolve(retryStrategy)
|
|
718
724
|
: undefined;
|
|
719
|
-
const getDefault = async () =>
|
|
720
|
-
|
|
721
|
-
|
|
725
|
+
const getDefault = async () => {
|
|
726
|
+
const maxAttempts = await maxAttemptsProvider();
|
|
727
|
+
const adaptive = (await client.normalizeProvider(retryMode)()) === exports.RETRY_MODES.ADAPTIVE;
|
|
728
|
+
if (adaptive) {
|
|
729
|
+
return new AdaptiveRetryStrategy$1(maxAttemptsProvider, {
|
|
730
|
+
maxAttempts,
|
|
731
|
+
baseDelay: defaultBaseDelay,
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
return new StandardRetryStrategy$1({
|
|
735
|
+
maxAttempts,
|
|
736
|
+
baseDelay: defaultBaseDelay,
|
|
737
|
+
});
|
|
738
|
+
};
|
|
722
739
|
return Object.assign(input, {
|
|
723
|
-
maxAttempts,
|
|
740
|
+
maxAttempts: maxAttemptsProvider,
|
|
724
741
|
retryStrategy: () => (controller ??= getDefault()),
|
|
725
742
|
});
|
|
726
743
|
};
|
|
@@ -35,7 +35,7 @@ const THROTTLING_ERROR_CODES = [
|
|
|
35
35
|
const TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
36
36
|
const TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
37
37
|
const NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
38
|
-
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND"];
|
|
38
|
+
const NODEJS_NETWORK_ERROR_CODES = ["EHOSTUNREACH", "ENETUNREACH", "ENOTFOUND", "EAI_AGAIN"];
|
|
39
39
|
|
|
40
40
|
const isRetryableByTrait = (error) => error?.$retryable !== undefined;
|
|
41
41
|
const isClockSkewError = (error) => CLOCK_SKEW_ERROR_CODES.includes(error.name);
|
|
@@ -186,9 +186,6 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
186
186
|
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
187
187
|
}
|
|
188
188
|
catch (refreshError) {
|
|
189
|
-
if (typeof refreshError.$backoff === "number") {
|
|
190
|
-
await cooldown(refreshError.$backoff);
|
|
191
|
-
}
|
|
192
189
|
if (!lastError.$metadata) {
|
|
193
190
|
lastError.$metadata = {};
|
|
194
191
|
}
|
|
@@ -198,8 +195,10 @@ function bindRetryMiddleware(isStreamingPayload) {
|
|
|
198
195
|
}
|
|
199
196
|
attempts = retryToken.getRetryCount();
|
|
200
197
|
const delay = retryToken.getRetryDelay();
|
|
201
|
-
totalRetryDelay += delay;
|
|
202
|
-
|
|
198
|
+
totalRetryDelay += (retryToken?.$retryLog?.acquisitionDelay ?? 0) + delay;
|
|
199
|
+
if (delay > 0) {
|
|
200
|
+
await cooldown(delay);
|
|
201
|
+
}
|
|
203
202
|
}
|
|
204
203
|
}
|
|
205
204
|
}
|
|
@@ -400,6 +399,9 @@ class DefaultRetryToken {
|
|
|
400
399
|
count;
|
|
401
400
|
cost;
|
|
402
401
|
longPoll;
|
|
402
|
+
$retryLog = {
|
|
403
|
+
acquisitionDelay: 0,
|
|
404
|
+
};
|
|
403
405
|
constructor(delay, count, cost, longPoll) {
|
|
404
406
|
this.delay = delay;
|
|
405
407
|
this.count = count;
|
|
@@ -435,8 +437,8 @@ const refusal = {
|
|
|
435
437
|
};
|
|
436
438
|
let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
437
439
|
mode = exports.RETRY_MODES.STANDARD;
|
|
438
|
-
capacity = INITIAL_RETRY_TOKENS;
|
|
439
440
|
retryBackoffStrategy;
|
|
441
|
+
capacity = INITIAL_RETRY_TOKENS;
|
|
440
442
|
maxAttemptsProvider;
|
|
441
443
|
baseDelay;
|
|
442
444
|
constructor(arg1) {
|
|
@@ -472,14 +474,18 @@ let StandardRetryStrategy$1 = class StandardRetryStrategy {
|
|
|
472
474
|
retryDelay = Math.max(delayFromErrorType, Math.min(errorInfo.retryAfterHint.getTime() - Date.now(), delayFromErrorType + 5_000));
|
|
473
475
|
}
|
|
474
476
|
if (!shouldRetry) {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
477
|
+
const longPollBackoff = Retry.v2026 && retryCode === refusal.capacity && isLongPoll ? retryDelay : 0;
|
|
478
|
+
if (longPollBackoff > 0) {
|
|
479
|
+
await new Promise((r) => setTimeout(r, longPollBackoff));
|
|
480
|
+
}
|
|
478
481
|
}
|
|
479
482
|
else {
|
|
480
483
|
const capacityCost = this.getCapacityCost(errorType);
|
|
481
484
|
this.capacity -= capacityCost;
|
|
482
|
-
|
|
485
|
+
const nextToken = new DefaultRetryToken(0, token.getRetryCount() + 1, capacityCost, token.isLongPoll?.() ?? false);
|
|
486
|
+
await new Promise((r) => setTimeout(r, retryDelay));
|
|
487
|
+
nextToken.$retryLog.acquisitionDelay = retryDelay;
|
|
488
|
+
return nextToken;
|
|
483
489
|
}
|
|
484
490
|
}
|
|
485
491
|
throw new Error("No retry token available");
|
|
@@ -561,11 +567,10 @@ class ConfiguredRetryStrategy extends StandardRetryStrategy$1 {
|
|
|
561
567
|
else {
|
|
562
568
|
this.computeNextBackoffDelay = computeNextBackoffDelay;
|
|
563
569
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
return token;
|
|
570
|
+
this.retryBackoffStrategy.computeNextBackoffDelay = (completedAttempt) => {
|
|
571
|
+
const nextAttempt = completedAttempt + 1;
|
|
572
|
+
return this.computeNextBackoffDelay(nextAttempt);
|
|
573
|
+
};
|
|
569
574
|
}
|
|
570
575
|
}
|
|
571
576
|
|
|
@@ -737,17 +742,29 @@ const NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
|
737
742
|
},
|
|
738
743
|
default: DEFAULT_MAX_ATTEMPTS,
|
|
739
744
|
};
|
|
740
|
-
const resolveRetryConfig = (input) => {
|
|
745
|
+
const resolveRetryConfig = (input, defaults) => {
|
|
741
746
|
const { retryStrategy, retryMode } = input;
|
|
742
|
-
const
|
|
747
|
+
const { defaultMaxAttempts = DEFAULT_MAX_ATTEMPTS, defaultBaseDelay = Retry.delay() } = defaults ?? {};
|
|
748
|
+
const maxAttemptsProvider = client.normalizeProvider(input.maxAttempts ?? defaultMaxAttempts);
|
|
743
749
|
let controller = retryStrategy
|
|
744
750
|
? Promise.resolve(retryStrategy)
|
|
745
751
|
: undefined;
|
|
746
|
-
const getDefault = async () =>
|
|
747
|
-
|
|
748
|
-
|
|
752
|
+
const getDefault = async () => {
|
|
753
|
+
const maxAttempts = await maxAttemptsProvider();
|
|
754
|
+
const adaptive = (await client.normalizeProvider(retryMode)()) === exports.RETRY_MODES.ADAPTIVE;
|
|
755
|
+
if (adaptive) {
|
|
756
|
+
return new AdaptiveRetryStrategy$1(maxAttemptsProvider, {
|
|
757
|
+
maxAttempts,
|
|
758
|
+
baseDelay: defaultBaseDelay,
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
return new StandardRetryStrategy$1({
|
|
762
|
+
maxAttempts,
|
|
763
|
+
baseDelay: defaultBaseDelay,
|
|
764
|
+
});
|
|
765
|
+
};
|
|
749
766
|
return Object.assign(input, {
|
|
750
|
-
maxAttempts,
|
|
767
|
+
maxAttempts: maxAttemptsProvider,
|
|
751
768
|
retryStrategy: () => (controller ??= getDefault()),
|
|
752
769
|
});
|
|
753
770
|
};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var protocols = require('@smithy/core/protocols');
|
|
5
|
-
var endpoints = require('@smithy/core/endpoints');
|
|
3
|
+
var transport = require('@smithy/core/transport');
|
|
6
4
|
|
|
7
5
|
const deref = (schemaRef) => {
|
|
8
6
|
if (typeof schemaRef === "function") {
|
|
@@ -21,7 +19,7 @@ const operation = (namespace, name, traits, input, output) => ({
|
|
|
21
19
|
|
|
22
20
|
const schemaDeserializationMiddleware = (config) => (next, context) => async (args) => {
|
|
23
21
|
const { response } = await next(args);
|
|
24
|
-
const { operationSchema } =
|
|
22
|
+
const { operationSchema } = transport.getSmithyContext(context);
|
|
25
23
|
const [, ns, n, t, i, o] = operationSchema ?? [];
|
|
26
24
|
try {
|
|
27
25
|
const parsed = await config.protocol.deserializeResponse(operation(ns, n, t, i, o), {
|
|
@@ -59,11 +57,11 @@ const schemaDeserializationMiddleware = (config) => (next, context) => async (ar
|
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
59
|
try {
|
|
62
|
-
if (
|
|
63
|
-
const { headers = {} } = response;
|
|
60
|
+
if (transport.HttpResponse.isInstance(response)) {
|
|
61
|
+
const { headers = {}, statusCode } = response;
|
|
64
62
|
const headerEntries = Object.entries(headers);
|
|
65
63
|
error.$metadata = {
|
|
66
|
-
httpStatusCode:
|
|
64
|
+
httpStatusCode: statusCode,
|
|
67
65
|
requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
|
|
68
66
|
extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
|
|
69
67
|
cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries),
|
|
@@ -83,10 +81,10 @@ const findHeader = (pattern, headers) => {
|
|
|
83
81
|
};
|
|
84
82
|
|
|
85
83
|
const schemaSerializationMiddleware = (config) => (next, context) => async (args) => {
|
|
86
|
-
const { operationSchema } =
|
|
84
|
+
const { operationSchema } = transport.getSmithyContext(context);
|
|
87
85
|
const [, ns, n, t, i, o] = operationSchema ?? [];
|
|
88
86
|
const endpoint = context.endpointV2
|
|
89
|
-
? async () =>
|
|
87
|
+
? async () => transport.toEndpointV1(context.endpointV2)
|
|
90
88
|
: config.endpoint;
|
|
91
89
|
const request = await config.protocol.serializeRequest(operation(ns, n, t, i, o), args.input, {
|
|
92
90
|
...config,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var transport = require('@smithy/core/transport');
|
|
4
4
|
var endpoints = require('@smithy/core/endpoints');
|
|
5
5
|
|
|
6
6
|
const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
|
|
@@ -912,7 +912,7 @@ const deserializerMiddleware = (options, deserializer) => (next, context) => asy
|
|
|
912
912
|
}
|
|
913
913
|
}
|
|
914
914
|
try {
|
|
915
|
-
if (
|
|
915
|
+
if (transport.HttpResponse.isInstance(response)) {
|
|
916
916
|
const { headers = {} } = response;
|
|
917
917
|
const headerEntries = Object.entries(headers);
|
|
918
918
|
error.$metadata = {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var node_crypto = require('node:crypto');
|
|
4
4
|
var node_fs = require('node:fs');
|
|
5
|
-
var
|
|
5
|
+
var transport = require('@smithy/core/transport');
|
|
6
6
|
var endpoints = require('@smithy/core/endpoints');
|
|
7
7
|
var node_stream = require('node:stream');
|
|
8
8
|
|
|
@@ -877,7 +877,7 @@ const deserializerMiddleware = (options, deserializer) => (next, context) => asy
|
|
|
877
877
|
}
|
|
878
878
|
}
|
|
879
879
|
try {
|
|
880
|
-
if (
|
|
880
|
+
if (transport.HttpResponse.isInstance(response)) {
|
|
881
881
|
const { headers = {} } = response;
|
|
882
882
|
const headerEntries = Object.entries(headers);
|
|
883
883
|
error.$metadata = {
|