@jjrawlins/cdk-diff-pr-github-action 1.9.25 → 1.9.27
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/.jsii +5 -5
- package/cdkdiffprgithubaction/go.mod +1 -1
- package/cdkdiffprgithubaction/jsii/jsii.go +2 -2
- package/cdkdiffprgithubaction/version +1 -1
- package/lib/CdkDiffIamTemplate.js +2 -2
- package/lib/CdkDiffIamTemplateStackSet.js +2 -2
- package/lib/CdkDiffStackWorkflow.js +1 -1
- package/lib/CdkDriftDetectionWorkflow.js +1 -1
- package/lib/CdkDriftIamTemplate.js +2 -2
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/CloudFormation.js +8 -8
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForChangeSetCreateComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackCreateComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackDeleteComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackExists.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackImportComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackRefactorCreateComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackRefactorExecuteComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackRollbackComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForStackUpdateComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-es/waiters/waitForTypeRegistrationComplete.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormation.d.ts +90 -90
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/CloudFormationClient.d.ts +93 -93
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/index.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/models/models_0.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeAccountLimitsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeChangeSetPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeEventsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeStackEventsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeStackResourceDriftsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/DescribeStacksPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListChangeSetsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListExportsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListGeneratedTemplatesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListImportsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListResourceScanRelatedResourcesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListResourceScanResourcesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListResourceScansPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackInstancesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackRefactorActionsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackRefactorsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackResourcesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackSetOperationResultsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackSetOperationsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStackSetsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListStacksPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListTypeRegistrationsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListTypeVersionsPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/pagination/ListTypesPaginator.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/CloudFormationClient.d.ts +2 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForChangeSetCreateComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackCreateComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackDeleteComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackExists.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackImportComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackRefactorCreateComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackRefactorExecuteComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackRollbackComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForStackUpdateComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/dist-types/waiters/waitForTypeRegistrationComplete.d.ts +3 -3
- package/node_modules/@aws-sdk/client-cloudformation/package.json +15 -15
- package/node_modules/@aws-sdk/core/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
- package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +10 -10
- package/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js +1 -1
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +4 -4
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentity.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/cognito-identity/CognitoIdentityClient.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/Signin.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/signin/SigninClient.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSO.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso/SSOClient.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDC.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sso-oidc/SSOOIDCClient.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STS.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-es/submodules/sts/STSClient.js +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentity.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/CognitoIdentityClient.d.ts +3 -4
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/cognito-identity/index.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/Signin.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/SigninClient.d.ts +3 -4
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/signin/index.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSO.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/SSOClient.d.ts +3 -4
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso/index.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDC.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/SSOOIDCClient.d.ts +3 -4
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sso-oidc/index.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STS.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/STSClient.d.ts +3 -4
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/auth/httpAuthSchemeProvider.d.ts +1 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/submodules/sts/index.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/CognitoIdentityClient.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/cognito-identity/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/SigninClient.d.ts +2 -5
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/signin/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/SSOClient.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/SSOOIDCClient.d.ts +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sso-oidc/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/STSClient.d.ts +2 -5
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/auth/httpAuthExtensionConfiguration.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/dist-types/ts3.4/submodules/sts/auth/httpAuthSchemeProvider.d.ts +1 -1
- package/node_modules/@aws-sdk/nested-clients/package.json +13 -13
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/core/README.md +12 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +8 -17
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -8
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +7 -9
- package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +1 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +1 -1
- package/node_modules/@smithy/core/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/README.md +10 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +3 -3
- package/node_modules/@smithy/middleware-retry/README.md +13 -0
- package/node_modules/@smithy/middleware-retry/package.json +3 -3
- package/node_modules/@smithy/middleware-serde/README.md +13 -0
- package/node_modules/@smithy/middleware-serde/package.json +2 -2
- package/node_modules/@smithy/node-http-handler/package.json +2 -2
- package/node_modules/@smithy/smithy-client/README.md +10 -3
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-browser/README.md +10 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/README.md +10 -3
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-cjs/index.js +9 -7
- package/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +9 -7
- package/node_modules/@smithy/util-retry/dist-types/DefaultRateLimiter.d.ts +71 -1
- package/node_modules/@smithy/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts +71 -1
- package/node_modules/@smithy/util-retry/package.json +1 -1
- package/node_modules/@smithy/util-stream/package.json +2 -2
- package/node_modules/@smithy/util-waiter/README.md +10 -3
- package/node_modules/@smithy/util-waiter/package.json +2 -2
- package/node_modules/lodash/README.md +2 -2
- package/node_modules/lodash/_baseOrderBy.js +1 -1
- package/node_modules/lodash/_baseUnset.js +7 -20
- package/node_modules/lodash/_setCacheHas.js +1 -1
- package/node_modules/lodash/compact.js +1 -1
- package/node_modules/lodash/core.js +3 -3
- package/node_modules/lodash/core.min.js +26 -25
- package/node_modules/lodash/fromPairs.js +3 -1
- package/node_modules/lodash/lodash.js +38 -27
- package/node_modules/lodash/lodash.min.js +125 -129
- package/node_modules/lodash/package.json +4 -2
- package/node_modules/lodash/random.js +9 -0
- package/node_modules/lodash/template.js +16 -4
- package/node_modules/lodash/templateSettings.js +4 -0
- package/package.json +4 -4
- package/node_modules/@smithy/abort-controller/LICENSE +0 -201
- package/node_modules/@smithy/abort-controller/README.md +0 -4
- package/node_modules/@smithy/abort-controller/dist-cjs/index.js +0 -32
- package/node_modules/@smithy/abort-controller/dist-es/AbortController.js +0 -7
- package/node_modules/@smithy/abort-controller/dist-es/AbortSignal.js +0 -20
- package/node_modules/@smithy/abort-controller/dist-es/index.js +0 -2
- package/node_modules/@smithy/abort-controller/dist-types/AbortController.d.ts +0 -16
- package/node_modules/@smithy/abort-controller/dist-types/AbortSignal.d.ts +0 -21
- package/node_modules/@smithy/abort-controller/dist-types/index.d.ts +0 -9
- package/node_modules/@smithy/abort-controller/dist-types/ts3.4/AbortController.d.ts +0 -16
- package/node_modules/@smithy/abort-controller/dist-types/ts3.4/AbortSignal.d.ts +0 -21
- package/node_modules/@smithy/abort-controller/dist-types/ts3.4/index.d.ts +0 -9
- package/node_modules/@smithy/abort-controller/package.json +0 -63
|
@@ -17,8 +17,8 @@ class DefaultRateLimiter {
|
|
|
17
17
|
minFillRate;
|
|
18
18
|
scaleConstant;
|
|
19
19
|
smooth;
|
|
20
|
-
currentCapacity = 0;
|
|
21
20
|
enabled = false;
|
|
21
|
+
availableTokens = 0;
|
|
22
22
|
lastMaxRate = 0;
|
|
23
23
|
measuredTxRate = 0;
|
|
24
24
|
requestCount = 0;
|
|
@@ -51,11 +51,11 @@ class DefaultRateLimiter {
|
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
this.refillTokenBucket();
|
|
54
|
-
if (amount > this.
|
|
55
|
-
const delay = ((amount - this.
|
|
54
|
+
if (amount > this.availableTokens) {
|
|
55
|
+
const delay = ((amount - this.availableTokens) / this.fillRate) * 1000;
|
|
56
56
|
await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
57
57
|
}
|
|
58
|
-
this.
|
|
58
|
+
this.availableTokens = this.availableTokens - amount;
|
|
59
59
|
}
|
|
60
60
|
refillTokenBucket() {
|
|
61
61
|
const timestamp = this.getCurrentTimeInSeconds();
|
|
@@ -64,13 +64,15 @@ class DefaultRateLimiter {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
|
|
67
|
-
this.
|
|
67
|
+
this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);
|
|
68
68
|
this.lastTimestamp = timestamp;
|
|
69
69
|
}
|
|
70
70
|
updateClientSendingRate(response) {
|
|
71
71
|
let calculatedRate;
|
|
72
72
|
this.updateMeasuredRate();
|
|
73
|
-
|
|
73
|
+
const retryErrorInfo = response;
|
|
74
|
+
const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || serviceErrorClassification.isThrottlingError(retryErrorInfo?.error ?? response);
|
|
75
|
+
if (isThrottling) {
|
|
74
76
|
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
|
|
75
77
|
this.lastMaxRate = rateToUse;
|
|
76
78
|
this.calculateTimeWindow();
|
|
@@ -101,7 +103,7 @@ class DefaultRateLimiter {
|
|
|
101
103
|
this.refillTokenBucket();
|
|
102
104
|
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
103
105
|
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
104
|
-
this.
|
|
106
|
+
this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);
|
|
105
107
|
}
|
|
106
108
|
updateMeasuredRate() {
|
|
107
109
|
const t = this.getCurrentTimeInSeconds();
|
|
@@ -6,8 +6,8 @@ export class DefaultRateLimiter {
|
|
|
6
6
|
minFillRate;
|
|
7
7
|
scaleConstant;
|
|
8
8
|
smooth;
|
|
9
|
-
currentCapacity = 0;
|
|
10
9
|
enabled = false;
|
|
10
|
+
availableTokens = 0;
|
|
11
11
|
lastMaxRate = 0;
|
|
12
12
|
measuredTxRate = 0;
|
|
13
13
|
requestCount = 0;
|
|
@@ -40,11 +40,11 @@ export class DefaultRateLimiter {
|
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
this.refillTokenBucket();
|
|
43
|
-
if (amount > this.
|
|
44
|
-
const delay = ((amount - this.
|
|
43
|
+
if (amount > this.availableTokens) {
|
|
44
|
+
const delay = ((amount - this.availableTokens) / this.fillRate) * 1000;
|
|
45
45
|
await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
46
46
|
}
|
|
47
|
-
this.
|
|
47
|
+
this.availableTokens = this.availableTokens - amount;
|
|
48
48
|
}
|
|
49
49
|
refillTokenBucket() {
|
|
50
50
|
const timestamp = this.getCurrentTimeInSeconds();
|
|
@@ -53,13 +53,15 @@ export class DefaultRateLimiter {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
|
|
56
|
-
this.
|
|
56
|
+
this.availableTokens = Math.min(this.maxCapacity, this.availableTokens + fillAmount);
|
|
57
57
|
this.lastTimestamp = timestamp;
|
|
58
58
|
}
|
|
59
59
|
updateClientSendingRate(response) {
|
|
60
60
|
let calculatedRate;
|
|
61
61
|
this.updateMeasuredRate();
|
|
62
|
-
|
|
62
|
+
const retryErrorInfo = response;
|
|
63
|
+
const isThrottling = retryErrorInfo?.errorType === "THROTTLING" || isThrottlingError(retryErrorInfo?.error ?? response);
|
|
64
|
+
if (isThrottling) {
|
|
63
65
|
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
|
|
64
66
|
this.lastMaxRate = rateToUse;
|
|
65
67
|
this.calculateTimeWindow();
|
|
@@ -90,7 +92,7 @@ export class DefaultRateLimiter {
|
|
|
90
92
|
this.refillTokenBucket();
|
|
91
93
|
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
92
94
|
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
93
|
-
this.
|
|
95
|
+
this.availableTokens = Math.min(this.availableTokens, this.maxCapacity);
|
|
94
96
|
}
|
|
95
97
|
updateMeasuredRate() {
|
|
96
98
|
const t = this.getCurrentTimeInSeconds();
|
|
@@ -3,10 +3,30 @@ import type { RateLimiter } from "./types";
|
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
export interface DefaultRateLimiterOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Coefficient for controlling how aggressively the rate decreases on throttle.
|
|
8
|
+
* @defaultValue 0.7
|
|
9
|
+
*/
|
|
6
10
|
beta?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Minimum token bucket capacity in adaptive-tokens.
|
|
13
|
+
* @defaultValue 1
|
|
14
|
+
*/
|
|
7
15
|
minCapacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum fill rate in adaptive-tokens per second.
|
|
18
|
+
* @defaultValue 0.5
|
|
19
|
+
*/
|
|
8
20
|
minFillRate?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Scale constant used in the cubic rate calculation.
|
|
23
|
+
* @defaultValue 0.4
|
|
24
|
+
*/
|
|
9
25
|
scaleConstant?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Smoothing factor for the exponential moving average of the measured send rate.
|
|
28
|
+
* @defaultValue 0.8
|
|
29
|
+
*/
|
|
10
30
|
smooth?: number;
|
|
11
31
|
}
|
|
12
32
|
/**
|
|
@@ -22,16 +42,51 @@ export declare class DefaultRateLimiter implements RateLimiter {
|
|
|
22
42
|
private minFillRate;
|
|
23
43
|
private scaleConstant;
|
|
24
44
|
private smooth;
|
|
25
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Whether adaptive retry rate limiting is active.
|
|
47
|
+
* Remains `false` until a throttling error is detected.
|
|
48
|
+
*/
|
|
26
49
|
private enabled;
|
|
50
|
+
/**
|
|
51
|
+
* Current number of available adaptive-tokens. When exhausted, requests wait based on fill rate.
|
|
52
|
+
*/
|
|
53
|
+
private availableTokens;
|
|
54
|
+
/**
|
|
55
|
+
* The most recent maximum fill rate in adaptive-tokens per second, recorded at the last throttle event.
|
|
56
|
+
*/
|
|
27
57
|
private lastMaxRate;
|
|
58
|
+
/**
|
|
59
|
+
* Smoothed measured send rate in requests per second.
|
|
60
|
+
*/
|
|
28
61
|
private measuredTxRate;
|
|
62
|
+
/**
|
|
63
|
+
* Number of requests observed in the current measurement time bucket.
|
|
64
|
+
*/
|
|
29
65
|
private requestCount;
|
|
66
|
+
/**
|
|
67
|
+
* Current token bucket fill rate in adaptive-tokens per second. Defaults to {@link minFillRate}.
|
|
68
|
+
*/
|
|
30
69
|
private fillRate;
|
|
70
|
+
/**
|
|
71
|
+
* Timestamp in seconds of the most recent throttle event.
|
|
72
|
+
*/
|
|
31
73
|
private lastThrottleTime;
|
|
74
|
+
/**
|
|
75
|
+
* Timestamp in seconds of the last token bucket refill.
|
|
76
|
+
*/
|
|
32
77
|
private lastTimestamp;
|
|
78
|
+
/**
|
|
79
|
+
* The time bucket (in seconds) used for measuring the send rate.
|
|
80
|
+
*/
|
|
33
81
|
private lastTxRateBucket;
|
|
82
|
+
/**
|
|
83
|
+
* Maximum token bucket capacity in adaptive-tokens. Defaults to {@link minCapacity}.
|
|
84
|
+
* Updated in {@link updateTokenBucketRate} to match the new fill rate, floored by {@link minCapacity}.
|
|
85
|
+
*/
|
|
34
86
|
private maxCapacity;
|
|
87
|
+
/**
|
|
88
|
+
* Calculated time window in seconds used in the cubic rate recovery function.
|
|
89
|
+
*/
|
|
35
90
|
private timeWindow;
|
|
36
91
|
constructor(options?: DefaultRateLimiterOptions);
|
|
37
92
|
private getCurrentTimeInSeconds;
|
|
@@ -40,9 +95,24 @@ export declare class DefaultRateLimiter implements RateLimiter {
|
|
|
40
95
|
private refillTokenBucket;
|
|
41
96
|
updateClientSendingRate(response: any): void;
|
|
42
97
|
private calculateTimeWindow;
|
|
98
|
+
/**
|
|
99
|
+
* Returns a new fill rate in adaptive-tokens per second by reducing
|
|
100
|
+
* the given rate by a factor of {@link beta}.
|
|
101
|
+
*/
|
|
43
102
|
private cubicThrottle;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a new fill rate in adaptive-tokens per second using a CUBIC
|
|
105
|
+
* congestion control curve. The rate recovers toward {@link lastMaxRate},
|
|
106
|
+
* then continues growing beyond it. The caller caps the result at
|
|
107
|
+
* `2 * measuredTxRate`.
|
|
108
|
+
*/
|
|
44
109
|
private cubicSuccess;
|
|
45
110
|
private enableTokenBucket;
|
|
111
|
+
/**
|
|
112
|
+
* Set a new fill rate for adaptive-tokens.
|
|
113
|
+
* The max capacity is updated to allow for one second of time to approximately
|
|
114
|
+
* refill the adaptive-token capacity.
|
|
115
|
+
*/
|
|
46
116
|
private updateTokenBucketRate;
|
|
47
117
|
private updateMeasuredRate;
|
|
48
118
|
private getPrecise;
|
|
@@ -3,10 +3,30 @@ import { RateLimiter } from "./types";
|
|
|
3
3
|
* @public
|
|
4
4
|
*/
|
|
5
5
|
export interface DefaultRateLimiterOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Coefficient for controlling how aggressively the rate decreases on throttle.
|
|
8
|
+
* @defaultValue 0.7
|
|
9
|
+
*/
|
|
6
10
|
beta?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Minimum token bucket capacity in adaptive-tokens.
|
|
13
|
+
* @defaultValue 1
|
|
14
|
+
*/
|
|
7
15
|
minCapacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Minimum fill rate in adaptive-tokens per second.
|
|
18
|
+
* @defaultValue 0.5
|
|
19
|
+
*/
|
|
8
20
|
minFillRate?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Scale constant used in the cubic rate calculation.
|
|
23
|
+
* @defaultValue 0.4
|
|
24
|
+
*/
|
|
9
25
|
scaleConstant?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Smoothing factor for the exponential moving average of the measured send rate.
|
|
28
|
+
* @defaultValue 0.8
|
|
29
|
+
*/
|
|
10
30
|
smooth?: number;
|
|
11
31
|
}
|
|
12
32
|
/**
|
|
@@ -22,16 +42,51 @@ export declare class DefaultRateLimiter implements RateLimiter {
|
|
|
22
42
|
private minFillRate;
|
|
23
43
|
private scaleConstant;
|
|
24
44
|
private smooth;
|
|
25
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Whether adaptive retry rate limiting is active.
|
|
47
|
+
* Remains `false` until a throttling error is detected.
|
|
48
|
+
*/
|
|
26
49
|
private enabled;
|
|
50
|
+
/**
|
|
51
|
+
* Current number of available adaptive-tokens. When exhausted, requests wait based on fill rate.
|
|
52
|
+
*/
|
|
53
|
+
private availableTokens;
|
|
54
|
+
/**
|
|
55
|
+
* The most recent maximum fill rate in adaptive-tokens per second, recorded at the last throttle event.
|
|
56
|
+
*/
|
|
27
57
|
private lastMaxRate;
|
|
58
|
+
/**
|
|
59
|
+
* Smoothed measured send rate in requests per second.
|
|
60
|
+
*/
|
|
28
61
|
private measuredTxRate;
|
|
62
|
+
/**
|
|
63
|
+
* Number of requests observed in the current measurement time bucket.
|
|
64
|
+
*/
|
|
29
65
|
private requestCount;
|
|
66
|
+
/**
|
|
67
|
+
* Current token bucket fill rate in adaptive-tokens per second. Defaults to {@link minFillRate}.
|
|
68
|
+
*/
|
|
30
69
|
private fillRate;
|
|
70
|
+
/**
|
|
71
|
+
* Timestamp in seconds of the most recent throttle event.
|
|
72
|
+
*/
|
|
31
73
|
private lastThrottleTime;
|
|
74
|
+
/**
|
|
75
|
+
* Timestamp in seconds of the last token bucket refill.
|
|
76
|
+
*/
|
|
32
77
|
private lastTimestamp;
|
|
78
|
+
/**
|
|
79
|
+
* The time bucket (in seconds) used for measuring the send rate.
|
|
80
|
+
*/
|
|
33
81
|
private lastTxRateBucket;
|
|
82
|
+
/**
|
|
83
|
+
* Maximum token bucket capacity in adaptive-tokens. Defaults to {@link minCapacity}.
|
|
84
|
+
* Updated in {@link updateTokenBucketRate} to match the new fill rate, floored by {@link minCapacity}.
|
|
85
|
+
*/
|
|
34
86
|
private maxCapacity;
|
|
87
|
+
/**
|
|
88
|
+
* Calculated time window in seconds used in the cubic rate recovery function.
|
|
89
|
+
*/
|
|
35
90
|
private timeWindow;
|
|
36
91
|
constructor(options?: DefaultRateLimiterOptions);
|
|
37
92
|
private getCurrentTimeInSeconds;
|
|
@@ -40,9 +95,24 @@ export declare class DefaultRateLimiter implements RateLimiter {
|
|
|
40
95
|
private refillTokenBucket;
|
|
41
96
|
updateClientSendingRate(response: any): void;
|
|
42
97
|
private calculateTimeWindow;
|
|
98
|
+
/**
|
|
99
|
+
* Returns a new fill rate in adaptive-tokens per second by reducing
|
|
100
|
+
* the given rate by a factor of {@link beta}.
|
|
101
|
+
*/
|
|
43
102
|
private cubicThrottle;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a new fill rate in adaptive-tokens per second using a CUBIC
|
|
105
|
+
* congestion control curve. The rate recovers toward {@link lastMaxRate},
|
|
106
|
+
* then continues growing beyond it. The caller caps the result at
|
|
107
|
+
* `2 * measuredTxRate`.
|
|
108
|
+
*/
|
|
44
109
|
private cubicSuccess;
|
|
45
110
|
private enableTokenBucket;
|
|
111
|
+
/**
|
|
112
|
+
* Set a new fill rate for adaptive-tokens.
|
|
113
|
+
* The max capacity is updated to allow for one second of time to approximately
|
|
114
|
+
* refill the adaptive-token capacity.
|
|
115
|
+
*/
|
|
46
116
|
private updateTokenBucketRate;
|
|
47
117
|
private updateMeasuredRate;
|
|
48
118
|
private getPrecise;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-stream",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.21",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline util-stream",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@smithy/fetch-http-handler": "^5.3.15",
|
|
33
|
-
"@smithy/node-http-handler": "^4.5.
|
|
33
|
+
"@smithy/node-http-handler": "^4.5.1",
|
|
34
34
|
"@smithy/types": "^4.13.1",
|
|
35
35
|
"@smithy/util-base64": "^4.3.2",
|
|
36
36
|
"@smithy/util-buffer-from": "^4.2.2",
|
|
@@ -3,8 +3,15 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@smithy/util-waiter)
|
|
4
4
|
[](https://www.npmjs.com/package/@smithy/util-waiter)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
### :warning: Internal API :warning:
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> This is an internal package.
|
|
9
|
+
> That means this is used as a dependency for other, public packages, but
|
|
10
|
+
> should not be taken directly as a dependency in your application's `package.json`.
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
> If you are updating the version of this package, for example to bring in a
|
|
13
|
+
> bug-fix, you should do so by updating your application lockfile with
|
|
14
|
+
> e.g. `npm up @scope/package` or equivalent command in another
|
|
15
|
+
> package manager, rather than taking a direct dependency.
|
|
16
|
+
|
|
17
|
+
---
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/util-waiter",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.14",
|
|
4
4
|
"description": "Shared utilities for client waiters for the AWS SDK",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@smithy/abort-controller": "^4.2.12",
|
|
7
6
|
"@smithy/types": "^4.13.1",
|
|
8
7
|
"tslib": "^2.6.2"
|
|
9
8
|
},
|
|
@@ -49,6 +48,7 @@
|
|
|
49
48
|
"directory": "packages/util-waiter"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
51
|
+
"@smithy/abort-controller": "^4.2.12",
|
|
52
52
|
"concurrently": "7.0.0",
|
|
53
53
|
"downlevel-dts": "0.10.1",
|
|
54
54
|
"premove": "4.0.0",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# lodash v4.
|
|
1
|
+
# lodash v4.18.1
|
|
2
2
|
|
|
3
3
|
The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules.
|
|
4
4
|
|
|
@@ -28,7 +28,7 @@ var at = require('lodash/at');
|
|
|
28
28
|
var curryN = require('lodash/fp/curryN');
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
See the [package source](https://github.com/lodash/lodash/tree/4.
|
|
31
|
+
See the [package source](https://github.com/lodash/lodash/tree/4.18.1-npm) for more details.
|
|
32
32
|
|
|
33
33
|
**Note:**<br>
|
|
34
34
|
Install [n_](https://www.npmjs.com/package/n_) for Lodash use in the Node.js < 6 REPL.
|
|
@@ -20,7 +20,9 @@ var hasOwnProperty = objectProto.hasOwnProperty;
|
|
|
20
20
|
function baseUnset(object, path) {
|
|
21
21
|
path = castPath(path, object);
|
|
22
22
|
|
|
23
|
-
// Prevent prototype pollution
|
|
23
|
+
// Prevent prototype pollution:
|
|
24
|
+
// https://github.com/lodash/lodash/security/advisories/GHSA-xxjr-mmjv-4gpg
|
|
25
|
+
// https://github.com/lodash/lodash/security/advisories/GHSA-f23m-r3pf-42rh
|
|
24
26
|
var index = -1,
|
|
25
27
|
length = path.length;
|
|
26
28
|
|
|
@@ -28,32 +30,17 @@ function baseUnset(object, path) {
|
|
|
28
30
|
return true;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
var isRootPrimitive = object == null || (typeof object !== 'object' && typeof object !== 'function');
|
|
32
|
-
|
|
33
33
|
while (++index < length) {
|
|
34
|
-
var key = path[index];
|
|
35
|
-
|
|
36
|
-
// skip non-string keys (e.g., Symbols, numbers)
|
|
37
|
-
if (typeof key !== 'string') {
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
34
|
+
var key = toKey(path[index]);
|
|
40
35
|
|
|
41
36
|
// Always block "__proto__" anywhere in the path if it's not expected
|
|
42
37
|
if (key === '__proto__' && !hasOwnProperty.call(object, '__proto__')) {
|
|
43
38
|
return false;
|
|
44
39
|
}
|
|
45
40
|
|
|
46
|
-
// Block
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
typeof path[index + 1] === 'string' &&
|
|
50
|
-
path[index + 1] === 'prototype') {
|
|
51
|
-
|
|
52
|
-
// Allow ONLY when the path starts at a primitive root, e.g., _.unset(0, 'constructor.prototype.a')
|
|
53
|
-
if (isRootPrimitive && index === 0) {
|
|
54
|
-
continue;
|
|
55
|
-
}
|
|
56
|
-
|
|
41
|
+
// Block constructor/prototype as non-terminal traversal keys to prevent
|
|
42
|
+
// escaping the object graph into built-in constructors and prototypes.
|
|
43
|
+
if ((key === 'constructor' || key === 'prototype') && index < length - 1) {
|
|
57
44
|
return false;
|
|
58
45
|
}
|
|
59
46
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @name has
|
|
6
6
|
* @memberOf SetCache
|
|
7
7
|
* @param {*} value The value to search for.
|
|
8
|
-
* @returns {
|
|
8
|
+
* @returns {boolean} Returns `true` if `value` is found, else `false`.
|
|
9
9
|
*/
|
|
10
10
|
function setCacheHas(value) {
|
|
11
11
|
return this.__data__.has(value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Lodash (Custom Build) <https://lodash.com/>
|
|
4
|
-
* Build: `lodash core -o ./
|
|
4
|
+
* Build: `lodash core --repo lodash/lodash#4.18.1 -o ./core.js`
|
|
5
5
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
6
6
|
* Released under MIT license <https://lodash.com/license>
|
|
7
7
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
var undefined;
|
|
14
14
|
|
|
15
15
|
/** Used as the semantic version number. */
|
|
16
|
-
var VERSION = '4.
|
|
16
|
+
var VERSION = '4.18.1';
|
|
17
17
|
|
|
18
18
|
/** Error message constants. */
|
|
19
19
|
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
@@ -1477,7 +1477,7 @@
|
|
|
1477
1477
|
|
|
1478
1478
|
/**
|
|
1479
1479
|
* Creates an array with all falsey values removed. The values `false`, `null`,
|
|
1480
|
-
* `0`, `""`, `undefined`, and `NaN` are
|
|
1480
|
+
* `0`, `-0`, `0n`, `""`, `undefined`, and `NaN` are falsy.
|
|
1481
1481
|
*
|
|
1482
1482
|
* @static
|
|
1483
1483
|
* @memberOf _
|