@stacksjs/actions 0.70.22 → 0.70.25
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/chunk-2gh7kgpc.js +3 -0
- package/dist/chunk-2kaj93p5.js +3 -0
- package/dist/chunk-2qchdrf9.js +3 -0
- package/dist/chunk-3086k7zk.js +184 -0
- package/dist/chunk-3beht8ja.js +130 -0
- package/dist/chunk-60qjz7zb.js +3 -0
- package/dist/chunk-67y94dzt.js +658 -0
- package/dist/chunk-6x1m5rkr.js +17 -0
- package/dist/chunk-7bpdkc40.js +714 -0
- package/dist/chunk-96b7fcmd.js +3 -0
- package/dist/chunk-aw6d8zr3.js +7 -0
- package/dist/chunk-c8qt2xst.js +3 -0
- package/dist/chunk-d4srk6ma.js +3 -0
- package/dist/chunk-e9tcbk71.js +1 -0
- package/dist/chunk-gt77jmb5.js +46 -0
- package/dist/chunk-h93n2j40.js +95 -0
- package/dist/chunk-jd1yzkq5.js +3 -0
- package/dist/chunk-kzhgexj4.js +3 -0
- package/dist/chunk-n1y0gpv6.js +3 -0
- package/dist/chunk-n2fd1d0m.js +3 -0
- package/dist/chunk-n2x7v39b.js +5 -0
- package/dist/chunk-rdajkt2s.js +88 -0
- package/dist/chunk-s735m9mg.js +1 -0
- package/dist/chunk-schcaf73.js +3 -0
- package/dist/chunk-tc935b45.js +93 -0
- package/dist/chunk-v0wnrnaa.js +7 -0
- package/dist/chunk-w418anbq.js +5 -0
- package/dist/chunk-wnrgcx3d.js +114 -0
- package/dist/chunk-wv5yb5wb.js +101 -0
- package/dist/chunk-x471rxrn.js +7 -0
- package/dist/chunk-xg9xscqz.js +1 -0
- package/dist/src/action.d.ts +60 -0
- package/dist/src/action.js +2 -0
- package/dist/src/actions.d.ts +2 -0
- package/dist/src/actions.js +2 -0
- package/dist/src/add.d.ts +6 -0
- package/dist/src/add.js +2 -0
- package/dist/src/ai/request-model-access.d.ts +1 -0
- package/dist/src/ai/request-model-access.js +2 -0
- package/dist/src/auth/client.d.ts +1 -0
- package/dist/src/auth/client.js +3 -0
- package/dist/src/auth/prune.d.ts +1 -0
- package/dist/src/auth/prune.js +2 -0
- package/dist/src/auth/setup.d.ts +1 -0
- package/dist/src/auth/setup.js +148 -0
- package/dist/src/auth/token.d.ts +1 -0
- package/dist/src/auth/token.js +2 -0
- package/dist/src/build/cli.d.ts +1 -0
- package/dist/src/build/cli.js +2 -0
- package/dist/src/build/component-libs.d.ts +1 -0
- package/dist/src/build/component-libs.js +2 -0
- package/dist/src/build/core.d.ts +1 -0
- package/dist/src/build/core.js +2 -0
- package/dist/src/build/desktop.d.ts +1 -0
- package/dist/src/build/desktop.js +2 -0
- package/dist/src/build/docs.d.ts +1 -0
- package/dist/src/build/docs.js +2 -0
- package/dist/src/build/server.d.ts +1 -0
- package/dist/src/build/server.js +2 -0
- package/dist/src/build/stacks.d.ts +1 -0
- package/dist/src/build/stacks.js +2 -0
- package/dist/src/build/views.d.ts +1 -0
- package/dist/src/build/views.js +2 -0
- package/dist/{build.d.ts → src/build.d.ts} +1 -2
- package/dist/src/build.js +2 -0
- package/dist/src/bump.d.ts +1 -0
- package/dist/src/bump.js +2 -0
- package/dist/src/cdn/invalidate-cache.d.ts +1 -0
- package/dist/src/cdn/invalidate-cache.js +1 -0
- package/dist/src/changelog.d.ts +1 -0
- package/dist/src/changelog.js +2 -0
- package/dist/src/check/ports.d.ts +1 -0
- package/dist/src/check/ports.js +2 -0
- package/dist/src/clean.d.ts +1 -0
- package/dist/src/clean.js +2 -0
- package/dist/{commit.d.ts → src/commit.d.ts} +1 -2
- package/dist/src/commit.js +2 -0
- package/dist/src/copy-types.d.ts +1 -0
- package/dist/src/copy-types.js +3 -0
- package/dist/src/database/seed.d.ts +1 -0
- package/dist/src/database/seed.js +2 -0
- package/dist/src/deploy/create-receipt-rule.d.ts +1 -0
- package/dist/src/deploy/create-receipt-rule.js +2 -0
- package/dist/src/deploy/index.d.ts +1 -0
- package/dist/src/deploy/index.js +307 -0
- package/dist/src/dev/api.d.ts +1 -0
- package/dist/src/dev/api.js +6 -0
- package/dist/src/dev/components.d.ts +1 -0
- package/dist/src/dev/components.js +2 -0
- package/dist/src/dev/dashboard-globals.d.ts +4 -0
- package/dist/src/dev/dashboard-globals.js +3 -0
- package/dist/src/dev/dashboard-utils.d.ts +126 -0
- package/dist/src/dev/dashboard-utils.js +2 -0
- package/dist/src/dev/dashboard.d.ts +12 -0
- package/dist/src/dev/dashboard.js +8 -0
- package/dist/src/dev/desktop.d.ts +1 -0
- package/dist/src/dev/desktop.js +2 -0
- package/dist/src/dev/docs.d.ts +1 -0
- package/dist/src/dev/docs.js +2 -0
- package/dist/src/dev/index.d.ts +10 -0
- package/dist/src/dev/index.js +2 -0
- package/dist/src/dev/system-tray.d.ts +1 -0
- package/dist/src/dev/system-tray.js +2 -0
- package/dist/src/dev/views.d.ts +1 -0
- package/dist/src/dev/views.js +2 -0
- package/dist/src/discover-packages.d.ts +18 -0
- package/dist/src/discover-packages.js +2 -0
- package/dist/src/domains/add.d.ts +1 -0
- package/dist/src/domains/add.js +2 -0
- package/dist/src/domains/purchase.d.ts +1 -0
- package/dist/src/domains/purchase.js +2 -0
- package/dist/src/domains/remove.d.ts +1 -0
- package/dist/src/domains/remove.js +2 -0
- package/dist/{examples.d.ts → src/examples.d.ts} +1 -2
- package/dist/src/examples.js +2 -0
- package/dist/src/find-projects.d.ts +1 -0
- package/dist/src/find-projects.js +2 -0
- package/dist/src/fresh.d.ts +1 -0
- package/dist/src/fresh.js +2 -0
- package/dist/src/generate/action-types.d.ts +1 -0
- package/dist/src/generate/action-types.js +8 -0
- package/dist/src/generate/component-meta.d.ts +1 -0
- package/dist/src/generate/component-meta.js +3 -0
- package/dist/src/generate/custom-cli-file.d.ts +1 -0
- package/dist/src/generate/custom-cli-file.js +4 -0
- package/dist/src/generate/env-files.d.ts +1 -0
- package/dist/src/generate/env-files.js +26 -0
- package/dist/src/generate/ide-helpers.d.ts +1 -0
- package/dist/src/generate/ide-helpers.js +3 -0
- package/dist/src/generate/index.d.ts +36 -0
- package/dist/src/generate/index.js +2 -0
- package/dist/src/generate/lib-entries.d.ts +1 -0
- package/dist/src/generate/lib-entries.js +3 -0
- package/dist/src/generate/pantry-file.d.ts +1 -0
- package/dist/src/generate/pantry-file.js +2 -0
- package/dist/src/generate/symlink-core.d.ts +1 -0
- package/dist/src/generate/symlink-core.js +2 -0
- package/dist/src/generate/types.d.ts +1 -0
- package/dist/src/generate/types.js +2 -0
- package/dist/src/generate/vscode-custom-data.d.ts +1 -0
- package/dist/src/generate/vscode-custom-data.js +3 -0
- package/dist/src/generate/web-types.d.ts +1 -0
- package/dist/src/generate/web-types.js +1 -0
- package/dist/src/helpers/component-meta.d.ts +26 -0
- package/dist/src/helpers/component-meta.js +2 -0
- package/dist/src/helpers/index.d.ts +4 -0
- package/dist/src/helpers/index.js +2 -0
- package/dist/{lib-entries.d.ts → src/helpers/lib-entries.d.ts} +9 -5
- package/dist/src/helpers/lib-entries.js +2 -0
- package/dist/src/helpers/package-json.d.ts +2 -0
- package/dist/src/helpers/package-json.js +43 -0
- package/dist/src/helpers/utils.d.ts +23 -0
- package/dist/src/helpers/utils.js +2 -0
- package/dist/{vscode-custom-data.d.ts → src/helpers/vscode-custom-data.d.ts} +1 -1
- package/dist/src/helpers/vscode-custom-data.js +2 -0
- package/dist/src/index.d.ts +42 -0
- package/dist/src/index.js +2 -0
- package/dist/src/key-generate.d.ts +1 -0
- package/dist/src/key-generate.js +2 -0
- package/dist/src/lint/fix.d.ts +1 -0
- package/dist/src/lint/fix.js +4 -0
- package/dist/src/lint/index.d.ts +1 -0
- package/dist/src/lint/index.js +2 -0
- package/dist/src/make-command.d.ts +10 -0
- package/dist/src/make-command.js +2 -0
- package/dist/src/make-job.d.ts +5 -0
- package/dist/src/make-job.js +2 -0
- package/dist/src/make-policy.d.ts +10 -0
- package/dist/src/make-policy.js +2 -0
- package/dist/src/make-resource.d.ts +10 -0
- package/dist/src/make-resource.js +2 -0
- package/dist/{make.d.ts → src/make.d.ts} +11 -9
- package/dist/src/make.js +2 -0
- package/dist/src/migrate/database.d.ts +1 -0
- package/dist/src/migrate/database.js +2 -0
- package/dist/src/migrate/fresh.d.ts +1 -0
- package/dist/src/migrate/fresh.js +2 -0
- package/dist/src/orm/base.d.ts +1 -0
- package/dist/src/orm/base.js +2 -0
- package/dist/src/orm/test.d.ts +1 -0
- package/dist/src/orm/test.js +1 -0
- package/dist/src/prepublish.d.ts +1 -0
- package/dist/src/prepublish.js +2 -0
- package/dist/src/queue/clear.d.ts +1 -0
- package/dist/src/queue/clear.js +2 -0
- package/dist/src/queue/failed.d.ts +1 -0
- package/dist/src/queue/failed.js +5 -0
- package/dist/src/queue/flush.d.ts +1 -0
- package/dist/src/queue/flush.js +3 -0
- package/dist/src/queue/inspect.d.ts +1 -0
- package/dist/src/queue/inspect.js +8 -0
- package/dist/src/queue/monitor.d.ts +1 -0
- package/dist/src/queue/monitor.js +7 -0
- package/dist/src/queue/retry.d.ts +1 -0
- package/dist/src/queue/retry.js +2 -0
- package/dist/src/queue/schedule-list.d.ts +1 -0
- package/dist/src/queue/schedule-list.js +5 -0
- package/dist/src/queue/schedule.d.ts +1 -0
- package/dist/src/queue/schedule.js +2 -0
- package/dist/src/queue/status.d.ts +1 -0
- package/dist/src/queue/status.js +5 -0
- package/dist/src/queue/table.d.ts +1 -0
- package/dist/src/queue/table.js +2 -0
- package/dist/src/queue/work.d.ts +1 -0
- package/dist/src/queue/work.js +2 -0
- package/dist/src/release.d.ts +1 -0
- package/dist/src/release.js +3 -0
- package/dist/src/route/list.d.ts +1 -0
- package/dist/src/route/list.js +3 -0
- package/dist/src/run-action.d.ts +2 -0
- package/dist/src/run-action.js +2 -0
- package/dist/src/saas/setup.d.ts +1 -0
- package/dist/src/saas/setup.js +2 -0
- package/dist/src/scaffold-crud.d.ts +25 -0
- package/dist/src/scaffold-crud.js +2 -0
- package/dist/src/schedule/run.d.ts +1 -0
- package/dist/src/schedule/run.js +2 -0
- package/dist/src/search/flush.d.ts +1 -0
- package/dist/src/search/flush.js +2 -0
- package/dist/src/search/import.d.ts +1 -0
- package/dist/src/search/import.js +2 -0
- package/dist/src/search/settings-list.d.ts +1 -0
- package/dist/src/search/settings-list.js +2 -0
- package/dist/src/search/settings.d.ts +1 -0
- package/dist/src/search/settings.js +2 -0
- package/dist/src/serve/api.d.ts +1 -0
- package/dist/src/serve/api.js +2 -0
- package/dist/src/setup/index.d.ts +1 -0
- package/dist/src/setup/index.js +2 -0
- package/dist/src/setup/ssl.d.ts +38 -0
- package/dist/src/setup/ssl.js +2 -0
- package/dist/src/stacks.d.ts +4 -0
- package/dist/src/stacks.js +2 -0
- package/dist/src/templates.d.ts +8 -0
- package/dist/src/templates.js +2 -0
- package/dist/src/test/feature.d.ts +1 -0
- package/dist/src/test/feature.js +2 -0
- package/dist/src/test/index.d.ts +1 -0
- package/dist/src/test/index.js +2 -0
- package/dist/src/test/ui.d.ts +1 -0
- package/dist/src/test/ui.js +2 -0
- package/dist/src/test/unit.d.ts +1 -0
- package/dist/src/test/unit.js +2 -0
- package/dist/src/typecheck.d.ts +1 -0
- package/dist/src/typecheck.js +2 -0
- package/dist/{types.d.ts → src/types.d.ts} +1 -2
- package/dist/src/types.js +2 -0
- package/dist/src/upgrade/binary.d.ts +1 -0
- package/dist/src/upgrade/binary.js +2 -0
- package/dist/src/upgrade/bun.d.ts +1 -0
- package/dist/src/upgrade/bun.js +1 -0
- package/dist/src/upgrade/dependencies.d.ts +1 -0
- package/dist/src/upgrade/dependencies.js +2 -0
- package/dist/src/upgrade/framework-utils.d.ts +102 -0
- package/dist/src/upgrade/framework-utils.js +2 -0
- package/dist/src/upgrade/framework.d.ts +1 -0
- package/dist/src/upgrade/framework.js +7 -0
- package/dist/src/upgrade/index.d.ts +1 -0
- package/dist/src/upgrade/index.js +2 -0
- package/dist/src/upgrade/shell.d.ts +1 -0
- package/dist/src/upgrade/shell.js +5 -0
- package/dist/src/upgrade.d.ts +7 -0
- package/dist/src/upgrade.js +2 -0
- package/package.json +39 -23
- package/dist/action-types.d.ts +0 -9
- package/dist/action.d.ts +0 -64
- package/dist/actions.d.ts +0 -2
- package/dist/add.d.ts +0 -5
- package/dist/add.js +0 -33
- package/dist/api.d.ts +0 -1
- package/dist/binary.d.ts +0 -2
- package/dist/build/component-libs.js +0 -9
- package/dist/build/core.js +0 -23
- package/dist/build/stacks.js +0 -8
- package/dist/build.js +0 -108
- package/dist/bump.d.ts +0 -2
- package/dist/bump.js +0 -17
- package/dist/changelog.d.ts +0 -2
- package/dist/changelog.js +0 -17
- package/dist/chunk-0m948f1p.js +0 -2177
- package/dist/chunk-23btgw5e.js +0 -1402
- package/dist/chunk-2dvnt46s.js +0 -7657
- package/dist/chunk-3y8t4qyf.js +0 -72
- package/dist/chunk-494jp8d5.js +0 -54
- package/dist/chunk-5wdfth6e.js +0 -901
- package/dist/chunk-8qsrwjam.js +0 -92
- package/dist/chunk-90y2wmyz.js +0 -2376
- package/dist/chunk-92e6scf8.js +0 -379
- package/dist/chunk-9v6qtbez.js +0 -45
- package/dist/chunk-a13x0e43.js +0 -1180
- package/dist/chunk-atahpwz7.js +0 -5762
- package/dist/chunk-bz3nmjmp.js +0 -212
- package/dist/chunk-ddw2jq8f.js +0 -179250
- package/dist/chunk-frw3va9v.js +0 -69
- package/dist/chunk-hqmjfnnn.js +0 -105
- package/dist/chunk-jq06qn43.js +0 -410
- package/dist/chunk-mbvdyeyw.js +0 -50
- package/dist/chunk-mdj7x1vs.js +0 -790
- package/dist/chunk-mdqphqep.js +0 -438
- package/dist/chunk-ny592jcd.js +0 -133
- package/dist/chunk-p0c688mg.js +0 -729
- package/dist/chunk-q9dmga3k.js +0 -11
- package/dist/chunk-qhh0v93n.js +0 -73
- package/dist/chunk-qka5w6cv.js +0 -1282
- package/dist/chunk-qkm8e752.js +0 -51
- package/dist/chunk-rbsehxzg.js +0 -65
- package/dist/chunk-rfdmx5yh.js +0 -170
- package/dist/chunk-s3xxrvrk.js +0 -311
- package/dist/chunk-w6fdq4hk.js +0 -14425
- package/dist/chunk-wkwtsvym.js +0 -477
- package/dist/chunk-y08qabyb.js +0 -3821
- package/dist/chunk-yyvh669b.js +0 -197
- package/dist/chunk-ze46550n.js +0 -0
- package/dist/chunk-zhrbz0qv.js +0 -661
- package/dist/chunk-zzerxbrm.js +0 -107
- package/dist/clean.js +0 -6
- package/dist/commit.js +0 -22
- package/dist/component-meta.d.ts +0 -15
- package/dist/components.d.ts +0 -3
- package/dist/copy-types.d.ts +0 -1
- package/dist/copy-types.js +0 -14
- package/dist/core.d.ts +0 -1
- package/dist/create-receipt-rule.d.ts +0 -4
- package/dist/database/seed.js +0 -30
- package/dist/database.d.ts +0 -2
- package/dist/deploy/index.js +0 -48
- package/dist/dev/components.js +0 -11
- package/dist/dev/docs.js +0 -7
- package/dist/dev/index.js +0 -58
- package/dist/env-files.d.ts +0 -9
- package/dist/examples.js +0 -46
- package/dist/feature.d.ts +0 -2
- package/dist/find-projects.d.ts +0 -1
- package/dist/fix.d.ts +0 -1
- package/dist/flush.d.ts +0 -2
- package/dist/fresh.d.ts +0 -1
- package/dist/fresh.js +0 -21
- package/dist/generate/component-meta.js +0 -17
- package/dist/generate/ide-helpers.js +0 -18
- package/dist/generate/index.js +0 -216
- package/dist/generate/lib-entries.js +0 -30
- package/dist/generate/vscode-custom-data.js +0 -17
- package/dist/helpers/component-meta.js +0 -204227
- package/dist/helpers/lib-entries.js +0 -122
- package/dist/helpers/package-json.js +0 -96
- package/dist/helpers/utils.js +0 -76
- package/dist/helpers/vscode-custom-data.js +0 -43
- package/dist/import.d.ts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -172
- package/dist/key-generate.js +0 -15
- package/dist/lint/fix.js +0 -18
- package/dist/lint/index.js +0 -5
- package/dist/list.d.ts +0 -1
- package/dist/make.js +0 -349
- package/dist/package-json.d.ts +0 -92
- package/dist/pkgx-file.d.ts +0 -8
- package/dist/ports.d.ts +0 -2
- package/dist/prepublish.d.ts +0 -1
- package/dist/prepublish.js +0 -17
- package/dist/purchase.d.ts +0 -6
- package/dist/release.js +0 -49
- package/dist/remove.d.ts +0 -6
- package/dist/request-model-access.d.ts +0 -1
- package/dist/run.d.ts +0 -1
- package/dist/settings-list.d.ts +0 -2
- package/dist/settings.d.ts +0 -1
- package/dist/setup.d.ts +0 -1
- package/dist/shell.d.ts +0 -2
- package/dist/table.d.ts +0 -1
- package/dist/test/feature.js +0 -14
- package/dist/test/index.js +0 -14
- package/dist/test/ui.js +0 -6
- package/dist/test/unit.js +0 -14
- package/dist/typecheck.js +0 -6
- package/dist/types.js +0 -23
- package/dist/unit.d.ts +0 -2
- package/dist/upgrade/dependencies.js +0 -8
- package/dist/upgrade/index.js +0 -22
- package/dist/upgrade.d.ts +0 -5
- package/dist/upgrade.js +0 -50
- package/dist/utils.d.ts +0 -75
- package/dist/work.d.ts +0 -3
- /package/dist/{upgrade/framework.js → chunk-cdk2r2jd.js} +0 -0
package/dist/chunk-0m948f1p.js
DELETED
|
@@ -1,2177 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
loadConfig,
|
|
3
|
-
parseUrl
|
|
4
|
-
} from "./chunk-hqmjfnnn.js";
|
|
5
|
-
import {
|
|
6
|
-
CONFIG_PREFIX_SEPARATOR
|
|
7
|
-
} from "./chunk-yyvh669b.js";
|
|
8
|
-
import {
|
|
9
|
-
NoOpLogger
|
|
10
|
-
} from "./chunk-23btgw5e.js";
|
|
11
|
-
import {
|
|
12
|
-
EndpointURLScheme,
|
|
13
|
-
SMITHY_CONTEXT_KEY
|
|
14
|
-
} from "./chunk-mbvdyeyw.js";
|
|
15
|
-
import {
|
|
16
|
-
memoize
|
|
17
|
-
} from "./chunk-zzerxbrm.js";
|
|
18
|
-
import {
|
|
19
|
-
require_dist,
|
|
20
|
-
require_dist_cjs2 as require_dist_cjs4,
|
|
21
|
-
require_dist_cjs5
|
|
22
|
-
} from "./chunk-atahpwz7.js";
|
|
23
|
-
import {
|
|
24
|
-
require_dist_cjs1 as require_dist_cjs,
|
|
25
|
-
require_dist_cjs3 as require_dist_cjs2,
|
|
26
|
-
require_dist_cjs4 as require_dist_cjs3
|
|
27
|
-
} from "./chunk-90y2wmyz.js";
|
|
28
|
-
import {
|
|
29
|
-
__require,
|
|
30
|
-
__toESM
|
|
31
|
-
} from "./chunk-9v6qtbez.js";
|
|
32
|
-
|
|
33
|
-
// ../../../../node_modules/@aws-sdk/middleware-host-header/dist-es/index.js
|
|
34
|
-
var import_protocol_http = __toESM(require_dist_cjs(), 1);
|
|
35
|
-
function resolveHostHeaderConfig(input) {
|
|
36
|
-
return input;
|
|
37
|
-
}
|
|
38
|
-
var hostHeaderMiddleware = (options) => (next) => async (args) => {
|
|
39
|
-
if (!import_protocol_http.HttpRequest.isInstance(args.request))
|
|
40
|
-
return next(args);
|
|
41
|
-
const { request } = args;
|
|
42
|
-
const { handlerProtocol = "" } = options.requestHandler.metadata || {};
|
|
43
|
-
if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
|
|
44
|
-
delete request.headers["host"];
|
|
45
|
-
request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
|
|
46
|
-
} else if (!request.headers["host"]) {
|
|
47
|
-
let host = request.hostname;
|
|
48
|
-
if (request.port != null)
|
|
49
|
-
host += `:${request.port}`;
|
|
50
|
-
request.headers["host"] = host;
|
|
51
|
-
}
|
|
52
|
-
return next(args);
|
|
53
|
-
};
|
|
54
|
-
var hostHeaderMiddlewareOptions = {
|
|
55
|
-
name: "hostHeaderMiddleware",
|
|
56
|
-
step: "build",
|
|
57
|
-
priority: "low",
|
|
58
|
-
tags: ["HOST"],
|
|
59
|
-
override: true
|
|
60
|
-
};
|
|
61
|
-
var getHostHeaderPlugin = (options) => ({
|
|
62
|
-
applyToStack: (clientStack) => {
|
|
63
|
-
clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// ../../../../node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
|
|
68
|
-
var loggerMiddleware = () => (next, context) => async (args) => {
|
|
69
|
-
try {
|
|
70
|
-
const response = await next(args);
|
|
71
|
-
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
|
|
72
|
-
const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
73
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
74
|
-
const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
|
|
75
|
-
const { $metadata, ...outputWithoutMetadata } = response.output;
|
|
76
|
-
logger?.info?.({
|
|
77
|
-
clientName,
|
|
78
|
-
commandName,
|
|
79
|
-
input: inputFilterSensitiveLog(args.input),
|
|
80
|
-
output: outputFilterSensitiveLog(outputWithoutMetadata),
|
|
81
|
-
metadata: $metadata
|
|
82
|
-
});
|
|
83
|
-
return response;
|
|
84
|
-
} catch (error) {
|
|
85
|
-
const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
|
|
86
|
-
const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
|
|
87
|
-
const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
|
|
88
|
-
logger?.error?.({
|
|
89
|
-
clientName,
|
|
90
|
-
commandName,
|
|
91
|
-
input: inputFilterSensitiveLog(args.input),
|
|
92
|
-
error,
|
|
93
|
-
metadata: error.$metadata
|
|
94
|
-
});
|
|
95
|
-
throw error;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var loggerMiddlewareOptions = {
|
|
99
|
-
name: "loggerMiddleware",
|
|
100
|
-
tags: ["LOGGER"],
|
|
101
|
-
step: "initialize",
|
|
102
|
-
override: true
|
|
103
|
-
};
|
|
104
|
-
var getLoggerPlugin = (options) => ({
|
|
105
|
-
applyToStack: (clientStack) => {
|
|
106
|
-
clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
// ../../../../node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js
|
|
110
|
-
var import_protocol_http2 = __toESM(require_dist_cjs(), 1);
|
|
111
|
-
var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
|
|
112
|
-
var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
|
|
113
|
-
var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
|
|
114
|
-
var recursionDetectionMiddleware = (options) => (next) => async (args) => {
|
|
115
|
-
const { request } = args;
|
|
116
|
-
if (!import_protocol_http2.HttpRequest.isInstance(request) || options.runtime !== "node") {
|
|
117
|
-
return next(args);
|
|
118
|
-
}
|
|
119
|
-
const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME;
|
|
120
|
-
if (request.headers.hasOwnProperty(traceIdHeader)) {
|
|
121
|
-
return next(args);
|
|
122
|
-
}
|
|
123
|
-
const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
|
|
124
|
-
const traceId = process.env[ENV_TRACE_ID];
|
|
125
|
-
const nonEmptyString = (str) => typeof str === "string" && str.length > 0;
|
|
126
|
-
if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
|
|
127
|
-
request.headers[TRACE_ID_HEADER_NAME] = traceId;
|
|
128
|
-
}
|
|
129
|
-
return next({
|
|
130
|
-
...args,
|
|
131
|
-
request
|
|
132
|
-
});
|
|
133
|
-
};
|
|
134
|
-
var addRecursionDetectionMiddlewareOptions = {
|
|
135
|
-
step: "build",
|
|
136
|
-
tags: ["RECURSION_DETECTION"],
|
|
137
|
-
name: "recursionDetectionMiddleware",
|
|
138
|
-
override: true,
|
|
139
|
-
priority: "low"
|
|
140
|
-
};
|
|
141
|
-
var getRecursionDetectionPlugin = (options) => ({
|
|
142
|
-
applyToStack: (clientStack) => {
|
|
143
|
-
clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
|
|
148
|
-
var import_core = __toESM(require_dist_cjs4(), 1);
|
|
149
|
-
var DEFAULT_UA_APP_ID = undefined;
|
|
150
|
-
function isValidUserAgentAppId(appId) {
|
|
151
|
-
if (appId === undefined) {
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
return typeof appId === "string" && appId.length <= 50;
|
|
155
|
-
}
|
|
156
|
-
function resolveUserAgentConfig(input) {
|
|
157
|
-
const normalizedAppIdProvider = import_core.normalizeProvider(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
|
|
158
|
-
const { customUserAgent } = input;
|
|
159
|
-
return Object.assign(input, {
|
|
160
|
-
customUserAgent: typeof customUserAgent === "string" ? [[customUserAgent]] : customUserAgent,
|
|
161
|
-
userAgentAppId: async () => {
|
|
162
|
-
const appId = await normalizedAppIdProvider();
|
|
163
|
-
if (!isValidUserAgentAppId(appId)) {
|
|
164
|
-
const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
|
|
165
|
-
if (typeof appId !== "string") {
|
|
166
|
-
logger?.warn("userAgentAppId must be a string or undefined.");
|
|
167
|
-
} else if (appId.length > 50) {
|
|
168
|
-
logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return appId;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
|
|
177
|
-
class EndpointCache {
|
|
178
|
-
constructor({ size, params }) {
|
|
179
|
-
this.data = new Map;
|
|
180
|
-
this.parameters = [];
|
|
181
|
-
this.capacity = size ?? 50;
|
|
182
|
-
if (params) {
|
|
183
|
-
this.parameters = params;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
get(endpointParams, resolver) {
|
|
187
|
-
const key = this.hash(endpointParams);
|
|
188
|
-
if (key === false) {
|
|
189
|
-
return resolver();
|
|
190
|
-
}
|
|
191
|
-
if (!this.data.has(key)) {
|
|
192
|
-
if (this.data.size > this.capacity + 10) {
|
|
193
|
-
const keys = this.data.keys();
|
|
194
|
-
let i = 0;
|
|
195
|
-
while (true) {
|
|
196
|
-
const { value, done } = keys.next();
|
|
197
|
-
this.data.delete(value);
|
|
198
|
-
if (done || ++i > 10) {
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
this.data.set(key, resolver());
|
|
204
|
-
}
|
|
205
|
-
return this.data.get(key);
|
|
206
|
-
}
|
|
207
|
-
size() {
|
|
208
|
-
return this.data.size;
|
|
209
|
-
}
|
|
210
|
-
hash(endpointParams) {
|
|
211
|
-
let buffer = "";
|
|
212
|
-
const { parameters } = this;
|
|
213
|
-
if (parameters.length === 0) {
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
for (const param of parameters) {
|
|
217
|
-
const val = String(endpointParams[param] ?? "");
|
|
218
|
-
if (val.includes("|;")) {
|
|
219
|
-
return false;
|
|
220
|
-
}
|
|
221
|
-
buffer += val + "|;";
|
|
222
|
-
}
|
|
223
|
-
return buffer;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js
|
|
227
|
-
var IP_V4_REGEX = new RegExp(`^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$`);
|
|
228
|
-
var isIpAddress = (value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]");
|
|
229
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js
|
|
230
|
-
var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
|
|
231
|
-
var isValidHostLabel = (value, allowSubDomains = false) => {
|
|
232
|
-
if (!allowSubDomains) {
|
|
233
|
-
return VALID_HOST_LABEL_REGEX.test(value);
|
|
234
|
-
}
|
|
235
|
-
const labels = value.split(".");
|
|
236
|
-
for (const label of labels) {
|
|
237
|
-
if (!isValidHostLabel(label)) {
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return true;
|
|
242
|
-
};
|
|
243
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js
|
|
244
|
-
var customEndpointFunctions = {};
|
|
245
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js
|
|
246
|
-
var debugId = "endpoints";
|
|
247
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js
|
|
248
|
-
function toDebugString(input) {
|
|
249
|
-
if (typeof input !== "object" || input == null) {
|
|
250
|
-
return input;
|
|
251
|
-
}
|
|
252
|
-
if ("ref" in input) {
|
|
253
|
-
return `$${toDebugString(input.ref)}`;
|
|
254
|
-
}
|
|
255
|
-
if ("fn" in input) {
|
|
256
|
-
return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
|
|
257
|
-
}
|
|
258
|
-
return JSON.stringify(input, null, 2);
|
|
259
|
-
}
|
|
260
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js
|
|
261
|
-
class EndpointError extends Error {
|
|
262
|
-
constructor(message) {
|
|
263
|
-
super(message);
|
|
264
|
-
this.name = "EndpointError";
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js
|
|
268
|
-
var booleanEquals = (value1, value2) => value1 === value2;
|
|
269
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js
|
|
270
|
-
var getAttrPathList = (path) => {
|
|
271
|
-
const parts = path.split(".");
|
|
272
|
-
const pathList = [];
|
|
273
|
-
for (const part of parts) {
|
|
274
|
-
const squareBracketIndex = part.indexOf("[");
|
|
275
|
-
if (squareBracketIndex !== -1) {
|
|
276
|
-
if (part.indexOf("]") !== part.length - 1) {
|
|
277
|
-
throw new EndpointError(`Path: '${path}' does not end with ']'`);
|
|
278
|
-
}
|
|
279
|
-
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
280
|
-
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
281
|
-
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
|
|
282
|
-
}
|
|
283
|
-
if (squareBracketIndex !== 0) {
|
|
284
|
-
pathList.push(part.slice(0, squareBracketIndex));
|
|
285
|
-
}
|
|
286
|
-
pathList.push(arrayIndex);
|
|
287
|
-
} else {
|
|
288
|
-
pathList.push(part);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
return pathList;
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js
|
|
295
|
-
var getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
|
|
296
|
-
if (typeof acc !== "object") {
|
|
297
|
-
throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
|
|
298
|
-
} else if (Array.isArray(acc)) {
|
|
299
|
-
return acc[parseInt(index)];
|
|
300
|
-
}
|
|
301
|
-
return acc[index];
|
|
302
|
-
}, value);
|
|
303
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js
|
|
304
|
-
var isSet = (value) => value != null;
|
|
305
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/not.js
|
|
306
|
-
var not = (value) => !value;
|
|
307
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js
|
|
308
|
-
var DEFAULT_PORTS = {
|
|
309
|
-
[EndpointURLScheme.HTTP]: 80,
|
|
310
|
-
[EndpointURLScheme.HTTPS]: 443
|
|
311
|
-
};
|
|
312
|
-
var parseURL = (value) => {
|
|
313
|
-
const whatwgURL = (() => {
|
|
314
|
-
try {
|
|
315
|
-
if (value instanceof URL) {
|
|
316
|
-
return value;
|
|
317
|
-
}
|
|
318
|
-
if (typeof value === "object" && "hostname" in value) {
|
|
319
|
-
const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
|
|
320
|
-
const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
|
|
321
|
-
url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&");
|
|
322
|
-
return url;
|
|
323
|
-
}
|
|
324
|
-
return new URL(value);
|
|
325
|
-
} catch (error) {
|
|
326
|
-
return null;
|
|
327
|
-
}
|
|
328
|
-
})();
|
|
329
|
-
if (!whatwgURL) {
|
|
330
|
-
console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
|
|
331
|
-
return null;
|
|
332
|
-
}
|
|
333
|
-
const urlString = whatwgURL.href;
|
|
334
|
-
const { host, hostname, pathname, protocol, search } = whatwgURL;
|
|
335
|
-
if (search) {
|
|
336
|
-
return null;
|
|
337
|
-
}
|
|
338
|
-
const scheme = protocol.slice(0, -1);
|
|
339
|
-
if (!Object.values(EndpointURLScheme).includes(scheme)) {
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
const isIp = isIpAddress(hostname);
|
|
343
|
-
const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
|
|
344
|
-
const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
|
|
345
|
-
return {
|
|
346
|
-
scheme,
|
|
347
|
-
authority,
|
|
348
|
-
path: pathname,
|
|
349
|
-
normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
|
|
350
|
-
isIp
|
|
351
|
-
};
|
|
352
|
-
};
|
|
353
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js
|
|
354
|
-
var stringEquals = (value1, value2) => value1 === value2;
|
|
355
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/substring.js
|
|
356
|
-
var substring = (input, start, stop, reverse) => {
|
|
357
|
-
if (start >= stop || input.length < stop) {
|
|
358
|
-
return null;
|
|
359
|
-
}
|
|
360
|
-
if (!reverse) {
|
|
361
|
-
return input.substring(start, stop);
|
|
362
|
-
}
|
|
363
|
-
return input.substring(input.length - stop, input.length - start);
|
|
364
|
-
};
|
|
365
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js
|
|
366
|
-
var uriEncode = (value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
367
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js
|
|
368
|
-
var endpointFunctions = {
|
|
369
|
-
booleanEquals,
|
|
370
|
-
getAttr,
|
|
371
|
-
isSet,
|
|
372
|
-
isValidHostLabel,
|
|
373
|
-
not,
|
|
374
|
-
parseURL,
|
|
375
|
-
stringEquals,
|
|
376
|
-
substring,
|
|
377
|
-
uriEncode
|
|
378
|
-
};
|
|
379
|
-
|
|
380
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js
|
|
381
|
-
var evaluateTemplate = (template, options) => {
|
|
382
|
-
const evaluatedTemplateArr = [];
|
|
383
|
-
const templateContext = {
|
|
384
|
-
...options.endpointParams,
|
|
385
|
-
...options.referenceRecord
|
|
386
|
-
};
|
|
387
|
-
let currentIndex = 0;
|
|
388
|
-
while (currentIndex < template.length) {
|
|
389
|
-
const openingBraceIndex = template.indexOf("{", currentIndex);
|
|
390
|
-
if (openingBraceIndex === -1) {
|
|
391
|
-
evaluatedTemplateArr.push(template.slice(currentIndex));
|
|
392
|
-
break;
|
|
393
|
-
}
|
|
394
|
-
evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
|
|
395
|
-
const closingBraceIndex = template.indexOf("}", openingBraceIndex);
|
|
396
|
-
if (closingBraceIndex === -1) {
|
|
397
|
-
evaluatedTemplateArr.push(template.slice(openingBraceIndex));
|
|
398
|
-
break;
|
|
399
|
-
}
|
|
400
|
-
if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
|
|
401
|
-
evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
|
|
402
|
-
currentIndex = closingBraceIndex + 2;
|
|
403
|
-
}
|
|
404
|
-
const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
|
|
405
|
-
if (parameterName.includes("#")) {
|
|
406
|
-
const [refName, attrName] = parameterName.split("#");
|
|
407
|
-
evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
|
|
408
|
-
} else {
|
|
409
|
-
evaluatedTemplateArr.push(templateContext[parameterName]);
|
|
410
|
-
}
|
|
411
|
-
currentIndex = closingBraceIndex + 1;
|
|
412
|
-
}
|
|
413
|
-
return evaluatedTemplateArr.join("");
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js
|
|
417
|
-
var getReferenceValue = ({ ref }, options) => {
|
|
418
|
-
const referenceRecord = {
|
|
419
|
-
...options.endpointParams,
|
|
420
|
-
...options.referenceRecord
|
|
421
|
-
};
|
|
422
|
-
return referenceRecord[ref];
|
|
423
|
-
};
|
|
424
|
-
|
|
425
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
|
|
426
|
-
var evaluateExpression = (obj, keyName, options) => {
|
|
427
|
-
if (typeof obj === "string") {
|
|
428
|
-
return evaluateTemplate(obj, options);
|
|
429
|
-
} else if (obj["fn"]) {
|
|
430
|
-
return callFunction(obj, options);
|
|
431
|
-
} else if (obj["ref"]) {
|
|
432
|
-
return getReferenceValue(obj, options);
|
|
433
|
-
}
|
|
434
|
-
throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js
|
|
438
|
-
var callFunction = ({ fn, argv }, options) => {
|
|
439
|
-
const evaluatedArgs = argv.map((arg) => ["boolean", "number"].includes(typeof arg) ? arg : evaluateExpression(arg, "arg", options));
|
|
440
|
-
const fnSegments = fn.split(".");
|
|
441
|
-
if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
|
|
442
|
-
return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
|
|
443
|
-
}
|
|
444
|
-
return endpointFunctions[fn](...evaluatedArgs);
|
|
445
|
-
};
|
|
446
|
-
|
|
447
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js
|
|
448
|
-
var evaluateCondition = ({ assign, ...fnArgs }, options) => {
|
|
449
|
-
if (assign && assign in options.referenceRecord) {
|
|
450
|
-
throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
|
|
451
|
-
}
|
|
452
|
-
const value = callFunction(fnArgs, options);
|
|
453
|
-
options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
|
|
454
|
-
return {
|
|
455
|
-
result: value === "" ? true : !!value,
|
|
456
|
-
...assign != null && { toAssign: { name: assign, value } }
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
|
-
|
|
460
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js
|
|
461
|
-
var evaluateConditions = (conditions = [], options) => {
|
|
462
|
-
const conditionsReferenceRecord = {};
|
|
463
|
-
for (const condition of conditions) {
|
|
464
|
-
const { result, toAssign } = evaluateCondition(condition, {
|
|
465
|
-
...options,
|
|
466
|
-
referenceRecord: {
|
|
467
|
-
...options.referenceRecord,
|
|
468
|
-
...conditionsReferenceRecord
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
if (!result) {
|
|
472
|
-
return { result };
|
|
473
|
-
}
|
|
474
|
-
if (toAssign) {
|
|
475
|
-
conditionsReferenceRecord[toAssign.name] = toAssign.value;
|
|
476
|
-
options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
return { result: true, referenceRecord: conditionsReferenceRecord };
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js
|
|
483
|
-
var getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
|
|
484
|
-
...acc,
|
|
485
|
-
[headerKey]: headerVal.map((headerValEntry) => {
|
|
486
|
-
const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
|
|
487
|
-
if (typeof processedExpr !== "string") {
|
|
488
|
-
throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
|
|
489
|
-
}
|
|
490
|
-
return processedExpr;
|
|
491
|
-
})
|
|
492
|
-
}), {});
|
|
493
|
-
|
|
494
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperty.js
|
|
495
|
-
var getEndpointProperty = (property, options) => {
|
|
496
|
-
if (Array.isArray(property)) {
|
|
497
|
-
return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
|
|
498
|
-
}
|
|
499
|
-
switch (typeof property) {
|
|
500
|
-
case "string":
|
|
501
|
-
return evaluateTemplate(property, options);
|
|
502
|
-
case "object":
|
|
503
|
-
if (property === null) {
|
|
504
|
-
throw new EndpointError(`Unexpected endpoint property: ${property}`);
|
|
505
|
-
}
|
|
506
|
-
return getEndpointProperties(property, options);
|
|
507
|
-
case "boolean":
|
|
508
|
-
return property;
|
|
509
|
-
default:
|
|
510
|
-
throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
|
|
511
|
-
}
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js
|
|
515
|
-
var getEndpointProperties = (properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
|
|
516
|
-
...acc,
|
|
517
|
-
[propertyKey]: getEndpointProperty(propertyVal, options)
|
|
518
|
-
}), {});
|
|
519
|
-
|
|
520
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js
|
|
521
|
-
var getEndpointUrl = (endpointUrl, options) => {
|
|
522
|
-
const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
|
|
523
|
-
if (typeof expression === "string") {
|
|
524
|
-
try {
|
|
525
|
-
return new URL(expression);
|
|
526
|
-
} catch (error) {
|
|
527
|
-
console.error(`Failed to construct URL with ${expression}`, error);
|
|
528
|
-
throw error;
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
|
|
532
|
-
};
|
|
533
|
-
|
|
534
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js
|
|
535
|
-
var evaluateEndpointRule = (endpointRule, options) => {
|
|
536
|
-
const { conditions, endpoint } = endpointRule;
|
|
537
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
538
|
-
if (!result) {
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
const endpointRuleOptions = {
|
|
542
|
-
...options,
|
|
543
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
544
|
-
};
|
|
545
|
-
const { url, properties, headers } = endpoint;
|
|
546
|
-
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
547
|
-
return {
|
|
548
|
-
...headers != null && {
|
|
549
|
-
headers: getEndpointHeaders(headers, endpointRuleOptions)
|
|
550
|
-
},
|
|
551
|
-
...properties != null && {
|
|
552
|
-
properties: getEndpointProperties(properties, endpointRuleOptions)
|
|
553
|
-
},
|
|
554
|
-
url: getEndpointUrl(url, endpointRuleOptions)
|
|
555
|
-
};
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js
|
|
559
|
-
var evaluateErrorRule = (errorRule, options) => {
|
|
560
|
-
const { conditions, error } = errorRule;
|
|
561
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
562
|
-
if (!result) {
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
throw new EndpointError(evaluateExpression(error, "Error", {
|
|
566
|
-
...options,
|
|
567
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
568
|
-
}));
|
|
569
|
-
};
|
|
570
|
-
|
|
571
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTreeRule.js
|
|
572
|
-
var evaluateTreeRule = (treeRule, options) => {
|
|
573
|
-
const { conditions, rules } = treeRule;
|
|
574
|
-
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
575
|
-
if (!result) {
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
return evaluateRules(rules, {
|
|
579
|
-
...options,
|
|
580
|
-
referenceRecord: { ...options.referenceRecord, ...referenceRecord }
|
|
581
|
-
});
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js
|
|
585
|
-
var evaluateRules = (rules, options) => {
|
|
586
|
-
for (const rule of rules) {
|
|
587
|
-
if (rule.type === "endpoint") {
|
|
588
|
-
const endpointOrUndefined = evaluateEndpointRule(rule, options);
|
|
589
|
-
if (endpointOrUndefined) {
|
|
590
|
-
return endpointOrUndefined;
|
|
591
|
-
}
|
|
592
|
-
} else if (rule.type === "error") {
|
|
593
|
-
evaluateErrorRule(rule, options);
|
|
594
|
-
} else if (rule.type === "tree") {
|
|
595
|
-
const endpointOrUndefined = evaluateTreeRule(rule, options);
|
|
596
|
-
if (endpointOrUndefined) {
|
|
597
|
-
return endpointOrUndefined;
|
|
598
|
-
}
|
|
599
|
-
} else {
|
|
600
|
-
throw new EndpointError(`Unknown endpoint rule: ${rule}`);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
throw new EndpointError(`Rules evaluation failed`);
|
|
604
|
-
};
|
|
605
|
-
// ../../../../node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js
|
|
606
|
-
var resolveEndpoint = (ruleSetObject, options) => {
|
|
607
|
-
const { endpointParams, logger } = options;
|
|
608
|
-
const { parameters, rules } = ruleSetObject;
|
|
609
|
-
options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
|
|
610
|
-
const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [k, v.default]);
|
|
611
|
-
if (paramsWithDefault.length > 0) {
|
|
612
|
-
for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
|
|
613
|
-
endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
const requiredParams = Object.entries(parameters).filter(([, v]) => v.required).map(([k]) => k);
|
|
617
|
-
for (const requiredParam of requiredParams) {
|
|
618
|
-
if (endpointParams[requiredParam] == null) {
|
|
619
|
-
throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
|
|
623
|
-
options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
|
|
624
|
-
return endpoint;
|
|
625
|
-
};
|
|
626
|
-
// ../../../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
|
|
627
|
-
var isVirtualHostableS3Bucket = (value, allowSubDomains = false) => {
|
|
628
|
-
if (allowSubDomains) {
|
|
629
|
-
for (const label of value.split(".")) {
|
|
630
|
-
if (!isVirtualHostableS3Bucket(label)) {
|
|
631
|
-
return false;
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
return true;
|
|
635
|
-
}
|
|
636
|
-
if (!isValidHostLabel(value)) {
|
|
637
|
-
return false;
|
|
638
|
-
}
|
|
639
|
-
if (value.length < 3 || value.length > 63) {
|
|
640
|
-
return false;
|
|
641
|
-
}
|
|
642
|
-
if (value !== value.toLowerCase()) {
|
|
643
|
-
return false;
|
|
644
|
-
}
|
|
645
|
-
if (isIpAddress(value)) {
|
|
646
|
-
return false;
|
|
647
|
-
}
|
|
648
|
-
return true;
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
// ../../../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
|
|
652
|
-
var ARN_DELIMITER = ":";
|
|
653
|
-
var RESOURCE_DELIMITER = "/";
|
|
654
|
-
var parseArn = (value) => {
|
|
655
|
-
const segments = value.split(ARN_DELIMITER);
|
|
656
|
-
if (segments.length < 6)
|
|
657
|
-
return null;
|
|
658
|
-
const [arn, partition, service, region, accountId, ...resourcePath] = segments;
|
|
659
|
-
if (arn !== "arn" || partition === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "")
|
|
660
|
-
return null;
|
|
661
|
-
const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
|
|
662
|
-
return {
|
|
663
|
-
partition,
|
|
664
|
-
service,
|
|
665
|
-
region,
|
|
666
|
-
accountId,
|
|
667
|
-
resourceId
|
|
668
|
-
};
|
|
669
|
-
};
|
|
670
|
-
// ../../../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
|
|
671
|
-
var partitions_default = {
|
|
672
|
-
partitions: [{
|
|
673
|
-
id: "aws",
|
|
674
|
-
outputs: {
|
|
675
|
-
dnsSuffix: "amazonaws.com",
|
|
676
|
-
dualStackDnsSuffix: "api.aws",
|
|
677
|
-
implicitGlobalRegion: "us-east-1",
|
|
678
|
-
name: "aws",
|
|
679
|
-
supportsDualStack: true,
|
|
680
|
-
supportsFIPS: true
|
|
681
|
-
},
|
|
682
|
-
regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
|
|
683
|
-
regions: {
|
|
684
|
-
"af-south-1": {
|
|
685
|
-
description: "Africa (Cape Town)"
|
|
686
|
-
},
|
|
687
|
-
"ap-east-1": {
|
|
688
|
-
description: "Asia Pacific (Hong Kong)"
|
|
689
|
-
},
|
|
690
|
-
"ap-northeast-1": {
|
|
691
|
-
description: "Asia Pacific (Tokyo)"
|
|
692
|
-
},
|
|
693
|
-
"ap-northeast-2": {
|
|
694
|
-
description: "Asia Pacific (Seoul)"
|
|
695
|
-
},
|
|
696
|
-
"ap-northeast-3": {
|
|
697
|
-
description: "Asia Pacific (Osaka)"
|
|
698
|
-
},
|
|
699
|
-
"ap-south-1": {
|
|
700
|
-
description: "Asia Pacific (Mumbai)"
|
|
701
|
-
},
|
|
702
|
-
"ap-south-2": {
|
|
703
|
-
description: "Asia Pacific (Hyderabad)"
|
|
704
|
-
},
|
|
705
|
-
"ap-southeast-1": {
|
|
706
|
-
description: "Asia Pacific (Singapore)"
|
|
707
|
-
},
|
|
708
|
-
"ap-southeast-2": {
|
|
709
|
-
description: "Asia Pacific (Sydney)"
|
|
710
|
-
},
|
|
711
|
-
"ap-southeast-3": {
|
|
712
|
-
description: "Asia Pacific (Jakarta)"
|
|
713
|
-
},
|
|
714
|
-
"ap-southeast-4": {
|
|
715
|
-
description: "Asia Pacific (Melbourne)"
|
|
716
|
-
},
|
|
717
|
-
"ap-southeast-5": {
|
|
718
|
-
description: "Asia Pacific (Malaysia)"
|
|
719
|
-
},
|
|
720
|
-
"ap-southeast-7": {
|
|
721
|
-
description: "Asia Pacific (Thailand)"
|
|
722
|
-
},
|
|
723
|
-
"aws-global": {
|
|
724
|
-
description: "AWS Standard global region"
|
|
725
|
-
},
|
|
726
|
-
"ca-central-1": {
|
|
727
|
-
description: "Canada (Central)"
|
|
728
|
-
},
|
|
729
|
-
"ca-west-1": {
|
|
730
|
-
description: "Canada West (Calgary)"
|
|
731
|
-
},
|
|
732
|
-
"eu-central-1": {
|
|
733
|
-
description: "Europe (Frankfurt)"
|
|
734
|
-
},
|
|
735
|
-
"eu-central-2": {
|
|
736
|
-
description: "Europe (Zurich)"
|
|
737
|
-
},
|
|
738
|
-
"eu-north-1": {
|
|
739
|
-
description: "Europe (Stockholm)"
|
|
740
|
-
},
|
|
741
|
-
"eu-south-1": {
|
|
742
|
-
description: "Europe (Milan)"
|
|
743
|
-
},
|
|
744
|
-
"eu-south-2": {
|
|
745
|
-
description: "Europe (Spain)"
|
|
746
|
-
},
|
|
747
|
-
"eu-west-1": {
|
|
748
|
-
description: "Europe (Ireland)"
|
|
749
|
-
},
|
|
750
|
-
"eu-west-2": {
|
|
751
|
-
description: "Europe (London)"
|
|
752
|
-
},
|
|
753
|
-
"eu-west-3": {
|
|
754
|
-
description: "Europe (Paris)"
|
|
755
|
-
},
|
|
756
|
-
"il-central-1": {
|
|
757
|
-
description: "Israel (Tel Aviv)"
|
|
758
|
-
},
|
|
759
|
-
"me-central-1": {
|
|
760
|
-
description: "Middle East (UAE)"
|
|
761
|
-
},
|
|
762
|
-
"me-south-1": {
|
|
763
|
-
description: "Middle East (Bahrain)"
|
|
764
|
-
},
|
|
765
|
-
"mx-central-1": {
|
|
766
|
-
description: "Mexico (Central)"
|
|
767
|
-
},
|
|
768
|
-
"sa-east-1": {
|
|
769
|
-
description: "South America (Sao Paulo)"
|
|
770
|
-
},
|
|
771
|
-
"us-east-1": {
|
|
772
|
-
description: "US East (N. Virginia)"
|
|
773
|
-
},
|
|
774
|
-
"us-east-2": {
|
|
775
|
-
description: "US East (Ohio)"
|
|
776
|
-
},
|
|
777
|
-
"us-west-1": {
|
|
778
|
-
description: "US West (N. California)"
|
|
779
|
-
},
|
|
780
|
-
"us-west-2": {
|
|
781
|
-
description: "US West (Oregon)"
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}, {
|
|
785
|
-
id: "aws-cn",
|
|
786
|
-
outputs: {
|
|
787
|
-
dnsSuffix: "amazonaws.com.cn",
|
|
788
|
-
dualStackDnsSuffix: "api.amazonwebservices.com.cn",
|
|
789
|
-
implicitGlobalRegion: "cn-northwest-1",
|
|
790
|
-
name: "aws-cn",
|
|
791
|
-
supportsDualStack: true,
|
|
792
|
-
supportsFIPS: true
|
|
793
|
-
},
|
|
794
|
-
regionRegex: "^cn\\-\\w+\\-\\d+$",
|
|
795
|
-
regions: {
|
|
796
|
-
"aws-cn-global": {
|
|
797
|
-
description: "AWS China global region"
|
|
798
|
-
},
|
|
799
|
-
"cn-north-1": {
|
|
800
|
-
description: "China (Beijing)"
|
|
801
|
-
},
|
|
802
|
-
"cn-northwest-1": {
|
|
803
|
-
description: "China (Ningxia)"
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
}, {
|
|
807
|
-
id: "aws-us-gov",
|
|
808
|
-
outputs: {
|
|
809
|
-
dnsSuffix: "amazonaws.com",
|
|
810
|
-
dualStackDnsSuffix: "api.aws",
|
|
811
|
-
implicitGlobalRegion: "us-gov-west-1",
|
|
812
|
-
name: "aws-us-gov",
|
|
813
|
-
supportsDualStack: true,
|
|
814
|
-
supportsFIPS: true
|
|
815
|
-
},
|
|
816
|
-
regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
|
|
817
|
-
regions: {
|
|
818
|
-
"aws-us-gov-global": {
|
|
819
|
-
description: "AWS GovCloud (US) global region"
|
|
820
|
-
},
|
|
821
|
-
"us-gov-east-1": {
|
|
822
|
-
description: "AWS GovCloud (US-East)"
|
|
823
|
-
},
|
|
824
|
-
"us-gov-west-1": {
|
|
825
|
-
description: "AWS GovCloud (US-West)"
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
}, {
|
|
829
|
-
id: "aws-iso",
|
|
830
|
-
outputs: {
|
|
831
|
-
dnsSuffix: "c2s.ic.gov",
|
|
832
|
-
dualStackDnsSuffix: "c2s.ic.gov",
|
|
833
|
-
implicitGlobalRegion: "us-iso-east-1",
|
|
834
|
-
name: "aws-iso",
|
|
835
|
-
supportsDualStack: false,
|
|
836
|
-
supportsFIPS: true
|
|
837
|
-
},
|
|
838
|
-
regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
|
|
839
|
-
regions: {
|
|
840
|
-
"aws-iso-global": {
|
|
841
|
-
description: "AWS ISO (US) global region"
|
|
842
|
-
},
|
|
843
|
-
"us-iso-east-1": {
|
|
844
|
-
description: "US ISO East"
|
|
845
|
-
},
|
|
846
|
-
"us-iso-west-1": {
|
|
847
|
-
description: "US ISO WEST"
|
|
848
|
-
}
|
|
849
|
-
}
|
|
850
|
-
}, {
|
|
851
|
-
id: "aws-iso-b",
|
|
852
|
-
outputs: {
|
|
853
|
-
dnsSuffix: "sc2s.sgov.gov",
|
|
854
|
-
dualStackDnsSuffix: "sc2s.sgov.gov",
|
|
855
|
-
implicitGlobalRegion: "us-isob-east-1",
|
|
856
|
-
name: "aws-iso-b",
|
|
857
|
-
supportsDualStack: false,
|
|
858
|
-
supportsFIPS: true
|
|
859
|
-
},
|
|
860
|
-
regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
|
|
861
|
-
regions: {
|
|
862
|
-
"aws-iso-b-global": {
|
|
863
|
-
description: "AWS ISOB (US) global region"
|
|
864
|
-
},
|
|
865
|
-
"us-isob-east-1": {
|
|
866
|
-
description: "US ISOB East (Ohio)"
|
|
867
|
-
}
|
|
868
|
-
}
|
|
869
|
-
}, {
|
|
870
|
-
id: "aws-iso-e",
|
|
871
|
-
outputs: {
|
|
872
|
-
dnsSuffix: "cloud.adc-e.uk",
|
|
873
|
-
dualStackDnsSuffix: "cloud.adc-e.uk",
|
|
874
|
-
implicitGlobalRegion: "eu-isoe-west-1",
|
|
875
|
-
name: "aws-iso-e",
|
|
876
|
-
supportsDualStack: false,
|
|
877
|
-
supportsFIPS: true
|
|
878
|
-
},
|
|
879
|
-
regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
|
|
880
|
-
regions: {
|
|
881
|
-
"eu-isoe-west-1": {
|
|
882
|
-
description: "EU ISOE West"
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
}, {
|
|
886
|
-
id: "aws-iso-f",
|
|
887
|
-
outputs: {
|
|
888
|
-
dnsSuffix: "csp.hci.ic.gov",
|
|
889
|
-
dualStackDnsSuffix: "csp.hci.ic.gov",
|
|
890
|
-
implicitGlobalRegion: "us-isof-south-1",
|
|
891
|
-
name: "aws-iso-f",
|
|
892
|
-
supportsDualStack: false,
|
|
893
|
-
supportsFIPS: true
|
|
894
|
-
},
|
|
895
|
-
regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
|
|
896
|
-
regions: {
|
|
897
|
-
"aws-iso-f-global": {
|
|
898
|
-
description: "AWS ISOF global region"
|
|
899
|
-
},
|
|
900
|
-
"us-isof-east-1": {
|
|
901
|
-
description: "US ISOF EAST"
|
|
902
|
-
},
|
|
903
|
-
"us-isof-south-1": {
|
|
904
|
-
description: "US ISOF SOUTH"
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
}],
|
|
908
|
-
version: "1.1"
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
// ../../../../node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
|
|
912
|
-
var selectedPartitionsInfo = partitions_default;
|
|
913
|
-
var selectedUserAgentPrefix = "";
|
|
914
|
-
var partition = (value) => {
|
|
915
|
-
const { partitions } = selectedPartitionsInfo;
|
|
916
|
-
for (const partition2 of partitions) {
|
|
917
|
-
const { regions, outputs } = partition2;
|
|
918
|
-
for (const [region, regionData] of Object.entries(regions)) {
|
|
919
|
-
if (region === value) {
|
|
920
|
-
return {
|
|
921
|
-
...outputs,
|
|
922
|
-
...regionData
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
for (const partition2 of partitions) {
|
|
928
|
-
const { regionRegex, outputs } = partition2;
|
|
929
|
-
if (new RegExp(regionRegex).test(value)) {
|
|
930
|
-
return {
|
|
931
|
-
...outputs
|
|
932
|
-
};
|
|
933
|
-
}
|
|
934
|
-
}
|
|
935
|
-
const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
|
|
936
|
-
if (!DEFAULT_PARTITION) {
|
|
937
|
-
throw new Error("Provided region was not found in the partition array or regex," + " and default partition with id 'aws' doesn't exist.");
|
|
938
|
-
}
|
|
939
|
-
return {
|
|
940
|
-
...DEFAULT_PARTITION.outputs
|
|
941
|
-
};
|
|
942
|
-
};
|
|
943
|
-
var getUserAgentPrefix = () => selectedUserAgentPrefix;
|
|
944
|
-
|
|
945
|
-
// ../../../../node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
|
|
946
|
-
var awsEndpointFunctions = {
|
|
947
|
-
isVirtualHostableS3Bucket,
|
|
948
|
-
parseArn,
|
|
949
|
-
partition
|
|
950
|
-
};
|
|
951
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
952
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
|
|
953
|
-
var import_protocol_http3 = __toESM(require_dist_cjs(), 1);
|
|
954
|
-
|
|
955
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
|
|
956
|
-
var import_core2 = __toESM(require_dist_cjs5(), 1);
|
|
957
|
-
var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
|
|
958
|
-
async function checkFeatures(context, config, args) {
|
|
959
|
-
const request = args.request;
|
|
960
|
-
if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
|
|
961
|
-
import_core2.setFeature(context, "PROTOCOL_RPC_V2_CBOR", "M");
|
|
962
|
-
}
|
|
963
|
-
if (typeof config.retryStrategy === "function") {
|
|
964
|
-
const retryStrategy = await config.retryStrategy();
|
|
965
|
-
if (typeof retryStrategy.acquireInitialRetryToken === "function") {
|
|
966
|
-
if (retryStrategy.constructor?.name?.includes("Adaptive")) {
|
|
967
|
-
import_core2.setFeature(context, "RETRY_MODE_ADAPTIVE", "F");
|
|
968
|
-
} else {
|
|
969
|
-
import_core2.setFeature(context, "RETRY_MODE_STANDARD", "E");
|
|
970
|
-
}
|
|
971
|
-
} else {
|
|
972
|
-
import_core2.setFeature(context, "RETRY_MODE_LEGACY", "D");
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
if (typeof config.accountIdEndpointMode === "function") {
|
|
976
|
-
const endpointV2 = context.endpointV2;
|
|
977
|
-
if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
|
|
978
|
-
import_core2.setFeature(context, "ACCOUNT_ID_ENDPOINT", "O");
|
|
979
|
-
}
|
|
980
|
-
switch (await config.accountIdEndpointMode?.()) {
|
|
981
|
-
case "disabled":
|
|
982
|
-
import_core2.setFeature(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
|
|
983
|
-
break;
|
|
984
|
-
case "preferred":
|
|
985
|
-
import_core2.setFeature(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
|
|
986
|
-
break;
|
|
987
|
-
case "required":
|
|
988
|
-
import_core2.setFeature(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
}
|
|
992
|
-
const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
|
|
993
|
-
if (identity?.$source) {
|
|
994
|
-
const credentials = identity;
|
|
995
|
-
if (credentials.accountId) {
|
|
996
|
-
import_core2.setFeature(context, "RESOLVED_ACCOUNT_ID", "T");
|
|
997
|
-
}
|
|
998
|
-
for (const [key, value] of Object.entries(credentials.$source ?? {})) {
|
|
999
|
-
import_core2.setFeature(context, key, value);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
|
|
1005
|
-
var USER_AGENT = "user-agent";
|
|
1006
|
-
var X_AMZ_USER_AGENT = "x-amz-user-agent";
|
|
1007
|
-
var SPACE = " ";
|
|
1008
|
-
var UA_NAME_SEPARATOR = "/";
|
|
1009
|
-
var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
|
|
1010
|
-
var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
|
|
1011
|
-
var UA_ESCAPE_CHAR = "-";
|
|
1012
|
-
|
|
1013
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
|
|
1014
|
-
var BYTE_LIMIT = 1024;
|
|
1015
|
-
function encodeFeatures(features) {
|
|
1016
|
-
let buffer = "";
|
|
1017
|
-
for (const key in features) {
|
|
1018
|
-
const val = features[key];
|
|
1019
|
-
if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
|
|
1020
|
-
if (buffer.length) {
|
|
1021
|
-
buffer += "," + val;
|
|
1022
|
-
} else {
|
|
1023
|
-
buffer += val;
|
|
1024
|
-
}
|
|
1025
|
-
continue;
|
|
1026
|
-
}
|
|
1027
|
-
break;
|
|
1028
|
-
}
|
|
1029
|
-
return buffer;
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
// ../../../../node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
|
|
1033
|
-
var userAgentMiddleware = (options) => (next, context) => async (args) => {
|
|
1034
|
-
const { request } = args;
|
|
1035
|
-
if (!import_protocol_http3.HttpRequest.isInstance(request)) {
|
|
1036
|
-
return next(args);
|
|
1037
|
-
}
|
|
1038
|
-
const { headers } = request;
|
|
1039
|
-
const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
|
|
1040
|
-
const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
|
|
1041
|
-
await checkFeatures(context, options, args);
|
|
1042
|
-
const awsContext = context;
|
|
1043
|
-
defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
|
|
1044
|
-
const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
|
|
1045
|
-
const appId = await options.userAgentAppId();
|
|
1046
|
-
if (appId) {
|
|
1047
|
-
defaultUserAgent.push(escapeUserAgent([`app/${appId}`]));
|
|
1048
|
-
}
|
|
1049
|
-
const prefix = getUserAgentPrefix();
|
|
1050
|
-
const sdkUserAgentValue = (prefix ? [prefix] : []).concat([...defaultUserAgent, ...userAgent, ...customUserAgent]).join(SPACE);
|
|
1051
|
-
const normalUAValue = [
|
|
1052
|
-
...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
|
|
1053
|
-
...customUserAgent
|
|
1054
|
-
].join(SPACE);
|
|
1055
|
-
if (options.runtime !== "browser") {
|
|
1056
|
-
if (normalUAValue) {
|
|
1057
|
-
headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
|
|
1058
|
-
}
|
|
1059
|
-
headers[USER_AGENT] = sdkUserAgentValue;
|
|
1060
|
-
} else {
|
|
1061
|
-
headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
|
|
1062
|
-
}
|
|
1063
|
-
return next({
|
|
1064
|
-
...args,
|
|
1065
|
-
request
|
|
1066
|
-
});
|
|
1067
|
-
};
|
|
1068
|
-
var escapeUserAgent = (userAgentPair) => {
|
|
1069
|
-
const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
|
|
1070
|
-
const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
|
|
1071
|
-
const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
|
|
1072
|
-
const prefix = name.substring(0, prefixSeparatorIndex);
|
|
1073
|
-
let uaName = name.substring(prefixSeparatorIndex + 1);
|
|
1074
|
-
if (prefix === "api") {
|
|
1075
|
-
uaName = uaName.toLowerCase();
|
|
1076
|
-
}
|
|
1077
|
-
return [prefix, uaName, version].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
|
|
1078
|
-
switch (index) {
|
|
1079
|
-
case 0:
|
|
1080
|
-
return item;
|
|
1081
|
-
case 1:
|
|
1082
|
-
return `${acc}/${item}`;
|
|
1083
|
-
default:
|
|
1084
|
-
return `${acc}#${item}`;
|
|
1085
|
-
}
|
|
1086
|
-
}, "");
|
|
1087
|
-
};
|
|
1088
|
-
var getUserAgentMiddlewareOptions = {
|
|
1089
|
-
name: "getUserAgentMiddleware",
|
|
1090
|
-
step: "build",
|
|
1091
|
-
priority: "low",
|
|
1092
|
-
tags: ["SET_USER_AGENT", "USER_AGENT"],
|
|
1093
|
-
override: true
|
|
1094
|
-
};
|
|
1095
|
-
var getUserAgentPlugin = (config) => ({
|
|
1096
|
-
applyToStack: (clientStack) => {
|
|
1097
|
-
clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
|
|
1098
|
-
}
|
|
1099
|
-
});
|
|
1100
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js
|
|
1101
|
-
var isFipsRegion = (region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips"));
|
|
1102
|
-
|
|
1103
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js
|
|
1104
|
-
var getRealRegion = (region) => isFipsRegion(region) ? ["fips-aws-global", "aws-fips"].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region;
|
|
1105
|
-
|
|
1106
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js
|
|
1107
|
-
var resolveRegionConfig = (input) => {
|
|
1108
|
-
const { region, useFipsEndpoint } = input;
|
|
1109
|
-
if (!region) {
|
|
1110
|
-
throw new Error("Region is missing");
|
|
1111
|
-
}
|
|
1112
|
-
return Object.assign(input, {
|
|
1113
|
-
region: async () => {
|
|
1114
|
-
if (typeof region === "string") {
|
|
1115
|
-
return getRealRegion(region);
|
|
1116
|
-
}
|
|
1117
|
-
const providedRegion = await region();
|
|
1118
|
-
return getRealRegion(providedRegion);
|
|
1119
|
-
},
|
|
1120
|
-
useFipsEndpoint: async () => {
|
|
1121
|
-
const providedRegion = typeof region === "string" ? region : await region();
|
|
1122
|
-
if (isFipsRegion(providedRegion)) {
|
|
1123
|
-
return true;
|
|
1124
|
-
}
|
|
1125
|
-
return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
|
|
1126
|
-
}
|
|
1127
|
-
});
|
|
1128
|
-
};
|
|
1129
|
-
|
|
1130
|
-
// ../../../../node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js
|
|
1131
|
-
var booleanSelector = (obj, key, type) => {
|
|
1132
|
-
if (!(key in obj))
|
|
1133
|
-
return;
|
|
1134
|
-
if (obj[key] === "true")
|
|
1135
|
-
return true;
|
|
1136
|
-
if (obj[key] === "false")
|
|
1137
|
-
return false;
|
|
1138
|
-
throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
|
|
1139
|
-
};
|
|
1140
|
-
// ../../../../node_modules/@smithy/util-config-provider/dist-es/types.js
|
|
1141
|
-
var SelectorType;
|
|
1142
|
-
(function(SelectorType2) {
|
|
1143
|
-
SelectorType2["ENV"] = "env";
|
|
1144
|
-
SelectorType2["CONFIG"] = "shared config entry";
|
|
1145
|
-
})(SelectorType || (SelectorType = {}));
|
|
1146
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
|
|
1147
|
-
var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
|
|
1148
|
-
var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
|
|
1149
|
-
var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
|
|
1150
|
-
environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV),
|
|
1151
|
-
configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG),
|
|
1152
|
-
default: false
|
|
1153
|
-
};
|
|
1154
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
|
|
1155
|
-
var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
|
|
1156
|
-
var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
|
|
1157
|
-
var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
|
|
1158
|
-
environmentVariableSelector: (env) => booleanSelector(env, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV),
|
|
1159
|
-
configFileSelector: (profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG),
|
|
1160
|
-
default: false
|
|
1161
|
-
};
|
|
1162
|
-
// ../../../../node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js
|
|
1163
|
-
var getSmithyContext = (context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {});
|
|
1164
|
-
// ../../../../node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js
|
|
1165
|
-
var normalizeProvider2 = (input) => {
|
|
1166
|
-
if (typeof input === "function")
|
|
1167
|
-
return input;
|
|
1168
|
-
const promisified = Promise.resolve(input);
|
|
1169
|
-
return () => promisified;
|
|
1170
|
-
};
|
|
1171
|
-
// ../../../../node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js
|
|
1172
|
-
var REGION_ENV_NAME = "AWS_REGION";
|
|
1173
|
-
var REGION_INI_NAME = "region";
|
|
1174
|
-
var NODE_REGION_CONFIG_OPTIONS = {
|
|
1175
|
-
environmentVariableSelector: (env) => env[REGION_ENV_NAME],
|
|
1176
|
-
configFileSelector: (profile) => profile[REGION_INI_NAME],
|
|
1177
|
-
default: () => {
|
|
1178
|
-
throw new Error("Region is missing");
|
|
1179
|
-
}
|
|
1180
|
-
};
|
|
1181
|
-
var NODE_REGION_CONFIG_FILE_OPTIONS = {
|
|
1182
|
-
preferredFile: "credentials"
|
|
1183
|
-
};
|
|
1184
|
-
// ../../../../node_modules/@smithy/middleware-content-length/dist-es/index.js
|
|
1185
|
-
var import_protocol_http4 = __toESM(require_dist_cjs(), 1);
|
|
1186
|
-
var CONTENT_LENGTH_HEADER = "content-length";
|
|
1187
|
-
function contentLengthMiddleware(bodyLengthChecker) {
|
|
1188
|
-
return (next) => async (args) => {
|
|
1189
|
-
const request = args.request;
|
|
1190
|
-
if (import_protocol_http4.HttpRequest.isInstance(request)) {
|
|
1191
|
-
const { body, headers } = request;
|
|
1192
|
-
if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) {
|
|
1193
|
-
try {
|
|
1194
|
-
const length = bodyLengthChecker(body);
|
|
1195
|
-
request.headers = {
|
|
1196
|
-
...request.headers,
|
|
1197
|
-
[CONTENT_LENGTH_HEADER]: String(length)
|
|
1198
|
-
};
|
|
1199
|
-
} catch (error) {}
|
|
1200
|
-
}
|
|
1201
|
-
}
|
|
1202
|
-
return next({
|
|
1203
|
-
...args,
|
|
1204
|
-
request
|
|
1205
|
-
});
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
var contentLengthMiddlewareOptions = {
|
|
1209
|
-
step: "build",
|
|
1210
|
-
tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
|
|
1211
|
-
name: "contentLengthMiddleware",
|
|
1212
|
-
override: true
|
|
1213
|
-
};
|
|
1214
|
-
var getContentLengthPlugin = (options) => ({
|
|
1215
|
-
applyToStack: (clientStack) => {
|
|
1216
|
-
clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
|
|
1217
|
-
}
|
|
1218
|
-
});
|
|
1219
|
-
|
|
1220
|
-
// ../../../../node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js
|
|
1221
|
-
var deserializerMiddleware = (options, deserializer) => (next, context) => async (args) => {
|
|
1222
|
-
const { response } = await next(args);
|
|
1223
|
-
try {
|
|
1224
|
-
const parsed = await deserializer(response, options);
|
|
1225
|
-
return {
|
|
1226
|
-
response,
|
|
1227
|
-
output: parsed
|
|
1228
|
-
};
|
|
1229
|
-
} catch (error) {
|
|
1230
|
-
Object.defineProperty(error, "$response", {
|
|
1231
|
-
value: response
|
|
1232
|
-
});
|
|
1233
|
-
if (!("$metadata" in error)) {
|
|
1234
|
-
const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
|
|
1235
|
-
try {
|
|
1236
|
-
error.message += `
|
|
1237
|
-
` + hint;
|
|
1238
|
-
} catch (e) {
|
|
1239
|
-
if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
|
|
1240
|
-
console.warn(hint);
|
|
1241
|
-
} else {
|
|
1242
|
-
context.logger?.warn?.(hint);
|
|
1243
|
-
}
|
|
1244
|
-
}
|
|
1245
|
-
if (typeof error.$responseBodyText !== "undefined") {
|
|
1246
|
-
if (error.$response) {
|
|
1247
|
-
error.$response.body = error.$responseBodyText;
|
|
1248
|
-
}
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
throw error;
|
|
1252
|
-
}
|
|
1253
|
-
};
|
|
1254
|
-
|
|
1255
|
-
// ../../../../node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js
|
|
1256
|
-
var serializerMiddleware = (options, serializer) => (next, context) => async (args) => {
|
|
1257
|
-
const endpoint = context.endpointV2?.url && options.urlParser ? async () => options.urlParser(context.endpointV2.url) : options.endpoint;
|
|
1258
|
-
if (!endpoint) {
|
|
1259
|
-
throw new Error("No valid endpoint provider available.");
|
|
1260
|
-
}
|
|
1261
|
-
const request = await serializer(args.input, { ...options, endpoint });
|
|
1262
|
-
return next({
|
|
1263
|
-
...args,
|
|
1264
|
-
request
|
|
1265
|
-
});
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
// ../../../../node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js
|
|
1269
|
-
var deserializerMiddlewareOption = {
|
|
1270
|
-
name: "deserializerMiddleware",
|
|
1271
|
-
step: "deserialize",
|
|
1272
|
-
tags: ["DESERIALIZER"],
|
|
1273
|
-
override: true
|
|
1274
|
-
};
|
|
1275
|
-
var serializerMiddlewareOption = {
|
|
1276
|
-
name: "serializerMiddleware",
|
|
1277
|
-
step: "serialize",
|
|
1278
|
-
tags: ["SERIALIZER"],
|
|
1279
|
-
override: true
|
|
1280
|
-
};
|
|
1281
|
-
function getSerdePlugin(config2, serializer, deserializer) {
|
|
1282
|
-
return {
|
|
1283
|
-
applyToStack: (commandStack) => {
|
|
1284
|
-
commandStack.add(deserializerMiddleware(config2, deserializer), deserializerMiddlewareOption);
|
|
1285
|
-
commandStack.add(serializerMiddleware(config2, serializer), serializerMiddlewareOption);
|
|
1286
|
-
}
|
|
1287
|
-
};
|
|
1288
|
-
}
|
|
1289
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
|
|
1290
|
-
var import_core3 = __toESM(require_dist_cjs4(), 1);
|
|
1291
|
-
|
|
1292
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js
|
|
1293
|
-
var resolveParamsForS3 = async (endpointParams) => {
|
|
1294
|
-
const bucket = endpointParams?.Bucket || "";
|
|
1295
|
-
if (typeof endpointParams.Bucket === "string") {
|
|
1296
|
-
endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
|
|
1297
|
-
}
|
|
1298
|
-
if (isArnBucketName(bucket)) {
|
|
1299
|
-
if (endpointParams.ForcePathStyle === true) {
|
|
1300
|
-
throw new Error("Path-style addressing cannot be used with ARN buckets");
|
|
1301
|
-
}
|
|
1302
|
-
} else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
|
|
1303
|
-
endpointParams.ForcePathStyle = true;
|
|
1304
|
-
}
|
|
1305
|
-
if (endpointParams.DisableMultiRegionAccessPoints) {
|
|
1306
|
-
endpointParams.disableMultiRegionAccessPoints = true;
|
|
1307
|
-
endpointParams.DisableMRAP = true;
|
|
1308
|
-
}
|
|
1309
|
-
return endpointParams;
|
|
1310
|
-
};
|
|
1311
|
-
var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
|
|
1312
|
-
var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
|
|
1313
|
-
var DOTS_PATTERN = /\.\./;
|
|
1314
|
-
var isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName);
|
|
1315
|
-
var isArnBucketName = (bucketName) => {
|
|
1316
|
-
const [arn, partition3, service, , , bucket] = bucketName.split(":");
|
|
1317
|
-
const isArn = arn === "arn" && bucketName.split(":").length >= 6;
|
|
1318
|
-
const isValidArn = Boolean(isArn && partition3 && service && bucket);
|
|
1319
|
-
if (isArn && !isValidArn) {
|
|
1320
|
-
throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
|
|
1321
|
-
}
|
|
1322
|
-
return isValidArn;
|
|
1323
|
-
};
|
|
1324
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js
|
|
1325
|
-
var createConfigValueProvider = (configKey, canonicalEndpointParamKey, config2) => {
|
|
1326
|
-
const configProvider = async () => {
|
|
1327
|
-
const configValue = config2[configKey] ?? config2[canonicalEndpointParamKey];
|
|
1328
|
-
if (typeof configValue === "function") {
|
|
1329
|
-
return configValue();
|
|
1330
|
-
}
|
|
1331
|
-
return configValue;
|
|
1332
|
-
};
|
|
1333
|
-
if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
|
|
1334
|
-
return async () => {
|
|
1335
|
-
const credentials = typeof config2.credentials === "function" ? await config2.credentials() : config2.credentials;
|
|
1336
|
-
const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
|
|
1337
|
-
return configValue;
|
|
1338
|
-
};
|
|
1339
|
-
}
|
|
1340
|
-
if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
|
|
1341
|
-
return async () => {
|
|
1342
|
-
const credentials = typeof config2.credentials === "function" ? await config2.credentials() : config2.credentials;
|
|
1343
|
-
const configValue = credentials?.accountId ?? credentials?.AccountId;
|
|
1344
|
-
return configValue;
|
|
1345
|
-
};
|
|
1346
|
-
}
|
|
1347
|
-
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
|
1348
|
-
return async () => {
|
|
1349
|
-
const endpoint = await configProvider();
|
|
1350
|
-
if (endpoint && typeof endpoint === "object") {
|
|
1351
|
-
if ("url" in endpoint) {
|
|
1352
|
-
return endpoint.url.href;
|
|
1353
|
-
}
|
|
1354
|
-
if ("hostname" in endpoint) {
|
|
1355
|
-
const { protocol, hostname, port, path } = endpoint;
|
|
1356
|
-
return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
|
|
1357
|
-
}
|
|
1358
|
-
}
|
|
1359
|
-
return endpoint;
|
|
1360
|
-
};
|
|
1361
|
-
}
|
|
1362
|
-
return configProvider;
|
|
1363
|
-
};
|
|
1364
|
-
|
|
1365
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js
|
|
1366
|
-
var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
|
|
1367
|
-
var CONFIG_ENDPOINT_URL = "endpoint_url";
|
|
1368
|
-
var getEndpointUrlConfig = (serviceId) => ({
|
|
1369
|
-
environmentVariableSelector: (env) => {
|
|
1370
|
-
const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
|
|
1371
|
-
const serviceEndpointUrl = env[[ENV_ENDPOINT_URL, ...serviceSuffixParts].join("_")];
|
|
1372
|
-
if (serviceEndpointUrl)
|
|
1373
|
-
return serviceEndpointUrl;
|
|
1374
|
-
const endpointUrl = env[ENV_ENDPOINT_URL];
|
|
1375
|
-
if (endpointUrl)
|
|
1376
|
-
return endpointUrl;
|
|
1377
|
-
return;
|
|
1378
|
-
},
|
|
1379
|
-
configFileSelector: (profile, config2) => {
|
|
1380
|
-
if (config2 && profile.services) {
|
|
1381
|
-
const servicesSection = config2[["services", profile.services].join(CONFIG_PREFIX_SEPARATOR)];
|
|
1382
|
-
if (servicesSection) {
|
|
1383
|
-
const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
|
|
1384
|
-
const endpointUrl2 = servicesSection[[servicePrefixParts.join("_"), CONFIG_ENDPOINT_URL].join(CONFIG_PREFIX_SEPARATOR)];
|
|
1385
|
-
if (endpointUrl2)
|
|
1386
|
-
return endpointUrl2;
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
const endpointUrl = profile[CONFIG_ENDPOINT_URL];
|
|
1390
|
-
if (endpointUrl)
|
|
1391
|
-
return endpointUrl;
|
|
1392
|
-
return;
|
|
1393
|
-
},
|
|
1394
|
-
default: undefined
|
|
1395
|
-
});
|
|
1396
|
-
|
|
1397
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js
|
|
1398
|
-
var getEndpointFromConfig = async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))();
|
|
1399
|
-
|
|
1400
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js
|
|
1401
|
-
var toEndpointV1 = (endpoint) => {
|
|
1402
|
-
if (typeof endpoint === "object") {
|
|
1403
|
-
if ("url" in endpoint) {
|
|
1404
|
-
return parseUrl(endpoint.url);
|
|
1405
|
-
}
|
|
1406
|
-
return endpoint;
|
|
1407
|
-
}
|
|
1408
|
-
return parseUrl(endpoint);
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js
|
|
1412
|
-
var getEndpointFromInstructions = async (commandInput, instructionsSupplier, clientConfig, context) => {
|
|
1413
|
-
if (!clientConfig.endpoint) {
|
|
1414
|
-
let endpointFromConfig;
|
|
1415
|
-
if (clientConfig.serviceConfiguredEndpoint) {
|
|
1416
|
-
endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
|
|
1417
|
-
} else {
|
|
1418
|
-
endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
|
|
1419
|
-
}
|
|
1420
|
-
if (endpointFromConfig) {
|
|
1421
|
-
clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
|
|
1422
|
-
}
|
|
1423
|
-
}
|
|
1424
|
-
const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
|
|
1425
|
-
if (typeof clientConfig.endpointProvider !== "function") {
|
|
1426
|
-
throw new Error("config.endpointProvider is not set.");
|
|
1427
|
-
}
|
|
1428
|
-
const endpoint = clientConfig.endpointProvider(endpointParams, context);
|
|
1429
|
-
return endpoint;
|
|
1430
|
-
};
|
|
1431
|
-
var resolveParams = async (commandInput, instructionsSupplier, clientConfig) => {
|
|
1432
|
-
const endpointParams = {};
|
|
1433
|
-
const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
|
|
1434
|
-
for (const [name, instruction] of Object.entries(instructions)) {
|
|
1435
|
-
switch (instruction.type) {
|
|
1436
|
-
case "staticContextParams":
|
|
1437
|
-
endpointParams[name] = instruction.value;
|
|
1438
|
-
break;
|
|
1439
|
-
case "contextParams":
|
|
1440
|
-
endpointParams[name] = commandInput[instruction.name];
|
|
1441
|
-
break;
|
|
1442
|
-
case "clientContextParams":
|
|
1443
|
-
case "builtInParams":
|
|
1444
|
-
endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();
|
|
1445
|
-
break;
|
|
1446
|
-
case "operationContextParams":
|
|
1447
|
-
endpointParams[name] = instruction.get(commandInput);
|
|
1448
|
-
break;
|
|
1449
|
-
default:
|
|
1450
|
-
throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
|
|
1451
|
-
}
|
|
1452
|
-
}
|
|
1453
|
-
if (Object.keys(instructions).length === 0) {
|
|
1454
|
-
Object.assign(endpointParams, clientConfig);
|
|
1455
|
-
}
|
|
1456
|
-
if (String(clientConfig.serviceId).toLowerCase() === "s3") {
|
|
1457
|
-
await resolveParamsForS3(endpointParams);
|
|
1458
|
-
}
|
|
1459
|
-
return endpointParams;
|
|
1460
|
-
};
|
|
1461
|
-
|
|
1462
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
|
|
1463
|
-
var endpointMiddleware = ({ config: config2, instructions }) => {
|
|
1464
|
-
return (next, context) => async (args) => {
|
|
1465
|
-
if (config2.endpoint) {
|
|
1466
|
-
import_core3.setFeature(context, "ENDPOINT_OVERRIDE", "N");
|
|
1467
|
-
}
|
|
1468
|
-
const endpoint = await getEndpointFromInstructions(args.input, {
|
|
1469
|
-
getEndpointParameterInstructions() {
|
|
1470
|
-
return instructions;
|
|
1471
|
-
}
|
|
1472
|
-
}, { ...config2 }, context);
|
|
1473
|
-
context.endpointV2 = endpoint;
|
|
1474
|
-
context.authSchemes = endpoint.properties?.authSchemes;
|
|
1475
|
-
const authScheme = context.authSchemes?.[0];
|
|
1476
|
-
if (authScheme) {
|
|
1477
|
-
context["signing_region"] = authScheme.signingRegion;
|
|
1478
|
-
context["signing_service"] = authScheme.signingName;
|
|
1479
|
-
const smithyContext = getSmithyContext(context);
|
|
1480
|
-
const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
|
|
1481
|
-
if (httpAuthOption) {
|
|
1482
|
-
httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
|
|
1483
|
-
signing_region: authScheme.signingRegion,
|
|
1484
|
-
signingRegion: authScheme.signingRegion,
|
|
1485
|
-
signing_service: authScheme.signingName,
|
|
1486
|
-
signingName: authScheme.signingName,
|
|
1487
|
-
signingRegionSet: authScheme.signingRegionSet
|
|
1488
|
-
}, authScheme.properties);
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
return next({
|
|
1492
|
-
...args
|
|
1493
|
-
});
|
|
1494
|
-
};
|
|
1495
|
-
};
|
|
1496
|
-
|
|
1497
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js
|
|
1498
|
-
var endpointMiddlewareOptions = {
|
|
1499
|
-
step: "serialize",
|
|
1500
|
-
tags: ["ENDPOINT_PARAMETERS", "ENDPOINT_V2", "ENDPOINT"],
|
|
1501
|
-
name: "endpointV2Middleware",
|
|
1502
|
-
override: true,
|
|
1503
|
-
relation: "before",
|
|
1504
|
-
toMiddleware: serializerMiddlewareOption.name
|
|
1505
|
-
};
|
|
1506
|
-
var getEndpointPlugin = (config2, instructions) => ({
|
|
1507
|
-
applyToStack: (clientStack) => {
|
|
1508
|
-
clientStack.addRelativeTo(endpointMiddleware({
|
|
1509
|
-
config: config2,
|
|
1510
|
-
instructions
|
|
1511
|
-
}), endpointMiddlewareOptions);
|
|
1512
|
-
}
|
|
1513
|
-
});
|
|
1514
|
-
|
|
1515
|
-
// ../../../../node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js
|
|
1516
|
-
var resolveEndpointConfig = (input) => {
|
|
1517
|
-
const tls = input.tls ?? true;
|
|
1518
|
-
const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
|
|
1519
|
-
const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider2(endpoint)()) : undefined;
|
|
1520
|
-
const isCustomEndpoint = !!endpoint;
|
|
1521
|
-
const resolvedConfig = Object.assign(input, {
|
|
1522
|
-
endpoint: customEndpointProvider,
|
|
1523
|
-
tls,
|
|
1524
|
-
isCustomEndpoint,
|
|
1525
|
-
useDualstackEndpoint: normalizeProvider2(useDualstackEndpoint ?? false),
|
|
1526
|
-
useFipsEndpoint: normalizeProvider2(useFipsEndpoint ?? false)
|
|
1527
|
-
});
|
|
1528
|
-
let configuredEndpointPromise = undefined;
|
|
1529
|
-
resolvedConfig.serviceConfiguredEndpoint = async () => {
|
|
1530
|
-
if (input.serviceId && !configuredEndpointPromise) {
|
|
1531
|
-
configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
|
|
1532
|
-
}
|
|
1533
|
-
return configuredEndpointPromise;
|
|
1534
|
-
};
|
|
1535
|
-
return resolvedConfig;
|
|
1536
|
-
};
|
|
1537
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/config.js
|
|
1538
|
-
var RETRY_MODES;
|
|
1539
|
-
(function(RETRY_MODES2) {
|
|
1540
|
-
RETRY_MODES2["STANDARD"] = "standard";
|
|
1541
|
-
RETRY_MODES2["ADAPTIVE"] = "adaptive";
|
|
1542
|
-
})(RETRY_MODES || (RETRY_MODES = {}));
|
|
1543
|
-
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
1544
|
-
var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
|
|
1545
|
-
|
|
1546
|
-
// ../../../../node_modules/@smithy/service-error-classification/dist-es/constants.js
|
|
1547
|
-
var THROTTLING_ERROR_CODES = [
|
|
1548
|
-
"BandwidthLimitExceeded",
|
|
1549
|
-
"EC2ThrottledException",
|
|
1550
|
-
"LimitExceededException",
|
|
1551
|
-
"PriorRequestNotComplete",
|
|
1552
|
-
"ProvisionedThroughputExceededException",
|
|
1553
|
-
"RequestLimitExceeded",
|
|
1554
|
-
"RequestThrottled",
|
|
1555
|
-
"RequestThrottledException",
|
|
1556
|
-
"SlowDown",
|
|
1557
|
-
"ThrottledException",
|
|
1558
|
-
"Throttling",
|
|
1559
|
-
"ThrottlingException",
|
|
1560
|
-
"TooManyRequestsException",
|
|
1561
|
-
"TransactionInProgressException"
|
|
1562
|
-
];
|
|
1563
|
-
var TRANSIENT_ERROR_CODES = ["TimeoutError", "RequestTimeout", "RequestTimeoutException"];
|
|
1564
|
-
var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];
|
|
1565
|
-
var NODEJS_TIMEOUT_ERROR_CODES = ["ECONNRESET", "ECONNREFUSED", "EPIPE", "ETIMEDOUT"];
|
|
1566
|
-
|
|
1567
|
-
// ../../../../node_modules/@smithy/service-error-classification/dist-es/index.js
|
|
1568
|
-
var isClockSkewCorrectedError = (error) => error.$metadata?.clockSkewCorrected;
|
|
1569
|
-
var isThrottlingError = (error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true;
|
|
1570
|
-
var isTransientError = (error, depth = 0) => isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || error.cause !== undefined && depth <= 10 && isTransientError(error.cause, depth + 1);
|
|
1571
|
-
var isServerError = (error) => {
|
|
1572
|
-
if (error.$metadata?.httpStatusCode !== undefined) {
|
|
1573
|
-
const statusCode = error.$metadata.httpStatusCode;
|
|
1574
|
-
if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
|
|
1575
|
-
return true;
|
|
1576
|
-
}
|
|
1577
|
-
return false;
|
|
1578
|
-
}
|
|
1579
|
-
return false;
|
|
1580
|
-
};
|
|
1581
|
-
|
|
1582
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js
|
|
1583
|
-
class DefaultRateLimiter {
|
|
1584
|
-
constructor(options) {
|
|
1585
|
-
this.currentCapacity = 0;
|
|
1586
|
-
this.enabled = false;
|
|
1587
|
-
this.lastMaxRate = 0;
|
|
1588
|
-
this.measuredTxRate = 0;
|
|
1589
|
-
this.requestCount = 0;
|
|
1590
|
-
this.lastTimestamp = 0;
|
|
1591
|
-
this.timeWindow = 0;
|
|
1592
|
-
this.beta = options?.beta ?? 0.7;
|
|
1593
|
-
this.minCapacity = options?.minCapacity ?? 1;
|
|
1594
|
-
this.minFillRate = options?.minFillRate ?? 0.5;
|
|
1595
|
-
this.scaleConstant = options?.scaleConstant ?? 0.4;
|
|
1596
|
-
this.smooth = options?.smooth ?? 0.8;
|
|
1597
|
-
const currentTimeInSeconds = this.getCurrentTimeInSeconds();
|
|
1598
|
-
this.lastThrottleTime = currentTimeInSeconds;
|
|
1599
|
-
this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
|
|
1600
|
-
this.fillRate = this.minFillRate;
|
|
1601
|
-
this.maxCapacity = this.minCapacity;
|
|
1602
|
-
}
|
|
1603
|
-
getCurrentTimeInSeconds() {
|
|
1604
|
-
return Date.now() / 1000;
|
|
1605
|
-
}
|
|
1606
|
-
async getSendToken() {
|
|
1607
|
-
return this.acquireTokenBucket(1);
|
|
1608
|
-
}
|
|
1609
|
-
async acquireTokenBucket(amount) {
|
|
1610
|
-
if (!this.enabled) {
|
|
1611
|
-
return;
|
|
1612
|
-
}
|
|
1613
|
-
this.refillTokenBucket();
|
|
1614
|
-
if (amount > this.currentCapacity) {
|
|
1615
|
-
const delay = (amount - this.currentCapacity) / this.fillRate * 1000;
|
|
1616
|
-
await new Promise((resolve) => DefaultRateLimiter.setTimeoutFn(resolve, delay));
|
|
1617
|
-
}
|
|
1618
|
-
this.currentCapacity = this.currentCapacity - amount;
|
|
1619
|
-
}
|
|
1620
|
-
refillTokenBucket() {
|
|
1621
|
-
const timestamp = this.getCurrentTimeInSeconds();
|
|
1622
|
-
if (!this.lastTimestamp) {
|
|
1623
|
-
this.lastTimestamp = timestamp;
|
|
1624
|
-
return;
|
|
1625
|
-
}
|
|
1626
|
-
const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
|
|
1627
|
-
this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
|
|
1628
|
-
this.lastTimestamp = timestamp;
|
|
1629
|
-
}
|
|
1630
|
-
updateClientSendingRate(response) {
|
|
1631
|
-
let calculatedRate;
|
|
1632
|
-
this.updateMeasuredRate();
|
|
1633
|
-
if (isThrottlingError(response)) {
|
|
1634
|
-
const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
|
|
1635
|
-
this.lastMaxRate = rateToUse;
|
|
1636
|
-
this.calculateTimeWindow();
|
|
1637
|
-
this.lastThrottleTime = this.getCurrentTimeInSeconds();
|
|
1638
|
-
calculatedRate = this.cubicThrottle(rateToUse);
|
|
1639
|
-
this.enableTokenBucket();
|
|
1640
|
-
} else {
|
|
1641
|
-
this.calculateTimeWindow();
|
|
1642
|
-
calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
|
|
1643
|
-
}
|
|
1644
|
-
const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
|
|
1645
|
-
this.updateTokenBucketRate(newRate);
|
|
1646
|
-
}
|
|
1647
|
-
calculateTimeWindow() {
|
|
1648
|
-
this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
|
|
1649
|
-
}
|
|
1650
|
-
cubicThrottle(rateToUse) {
|
|
1651
|
-
return this.getPrecise(rateToUse * this.beta);
|
|
1652
|
-
}
|
|
1653
|
-
cubicSuccess(timestamp) {
|
|
1654
|
-
return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
|
|
1655
|
-
}
|
|
1656
|
-
enableTokenBucket() {
|
|
1657
|
-
this.enabled = true;
|
|
1658
|
-
}
|
|
1659
|
-
updateTokenBucketRate(newRate) {
|
|
1660
|
-
this.refillTokenBucket();
|
|
1661
|
-
this.fillRate = Math.max(newRate, this.minFillRate);
|
|
1662
|
-
this.maxCapacity = Math.max(newRate, this.minCapacity);
|
|
1663
|
-
this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
|
|
1664
|
-
}
|
|
1665
|
-
updateMeasuredRate() {
|
|
1666
|
-
const t = this.getCurrentTimeInSeconds();
|
|
1667
|
-
const timeBucket = Math.floor(t * 2) / 2;
|
|
1668
|
-
this.requestCount++;
|
|
1669
|
-
if (timeBucket > this.lastTxRateBucket) {
|
|
1670
|
-
const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
|
|
1671
|
-
this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
|
|
1672
|
-
this.requestCount = 0;
|
|
1673
|
-
this.lastTxRateBucket = timeBucket;
|
|
1674
|
-
}
|
|
1675
|
-
}
|
|
1676
|
-
getPrecise(num) {
|
|
1677
|
-
return parseFloat(num.toFixed(8));
|
|
1678
|
-
}
|
|
1679
|
-
}
|
|
1680
|
-
DefaultRateLimiter.setTimeoutFn = setTimeout;
|
|
1681
|
-
|
|
1682
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/constants.js
|
|
1683
|
-
var DEFAULT_RETRY_DELAY_BASE = 100;
|
|
1684
|
-
var MAXIMUM_RETRY_DELAY = 20 * 1000;
|
|
1685
|
-
var THROTTLING_RETRY_DELAY_BASE = 500;
|
|
1686
|
-
var INITIAL_RETRY_TOKENS = 500;
|
|
1687
|
-
var RETRY_COST = 5;
|
|
1688
|
-
var TIMEOUT_RETRY_COST = 10;
|
|
1689
|
-
var NO_RETRY_INCREMENT = 1;
|
|
1690
|
-
var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
|
|
1691
|
-
var REQUEST_HEADER = "amz-sdk-request";
|
|
1692
|
-
|
|
1693
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js
|
|
1694
|
-
var getDefaultRetryBackoffStrategy = () => {
|
|
1695
|
-
let delayBase = DEFAULT_RETRY_DELAY_BASE;
|
|
1696
|
-
const computeNextBackoffDelay = (attempts) => {
|
|
1697
|
-
return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
|
|
1698
|
-
};
|
|
1699
|
-
const setDelayBase = (delay) => {
|
|
1700
|
-
delayBase = delay;
|
|
1701
|
-
};
|
|
1702
|
-
return {
|
|
1703
|
-
computeNextBackoffDelay,
|
|
1704
|
-
setDelayBase
|
|
1705
|
-
};
|
|
1706
|
-
};
|
|
1707
|
-
|
|
1708
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js
|
|
1709
|
-
var createDefaultRetryToken = ({ retryDelay, retryCount, retryCost }) => {
|
|
1710
|
-
const getRetryCount = () => retryCount;
|
|
1711
|
-
const getRetryDelay = () => Math.min(MAXIMUM_RETRY_DELAY, retryDelay);
|
|
1712
|
-
const getRetryCost = () => retryCost;
|
|
1713
|
-
return {
|
|
1714
|
-
getRetryCount,
|
|
1715
|
-
getRetryDelay,
|
|
1716
|
-
getRetryCost
|
|
1717
|
-
};
|
|
1718
|
-
};
|
|
1719
|
-
|
|
1720
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js
|
|
1721
|
-
class StandardRetryStrategy {
|
|
1722
|
-
constructor(maxAttempts) {
|
|
1723
|
-
this.maxAttempts = maxAttempts;
|
|
1724
|
-
this.mode = RETRY_MODES.STANDARD;
|
|
1725
|
-
this.capacity = INITIAL_RETRY_TOKENS;
|
|
1726
|
-
this.retryBackoffStrategy = getDefaultRetryBackoffStrategy();
|
|
1727
|
-
this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
|
|
1728
|
-
}
|
|
1729
|
-
async acquireInitialRetryToken(retryTokenScope) {
|
|
1730
|
-
return createDefaultRetryToken({
|
|
1731
|
-
retryDelay: DEFAULT_RETRY_DELAY_BASE,
|
|
1732
|
-
retryCount: 0
|
|
1733
|
-
});
|
|
1734
|
-
}
|
|
1735
|
-
async refreshRetryTokenForRetry(token, errorInfo) {
|
|
1736
|
-
const maxAttempts = await this.getMaxAttempts();
|
|
1737
|
-
if (this.shouldRetry(token, errorInfo, maxAttempts)) {
|
|
1738
|
-
const errorType = errorInfo.errorType;
|
|
1739
|
-
this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
|
|
1740
|
-
const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
|
|
1741
|
-
const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType;
|
|
1742
|
-
const capacityCost = this.getCapacityCost(errorType);
|
|
1743
|
-
this.capacity -= capacityCost;
|
|
1744
|
-
return createDefaultRetryToken({
|
|
1745
|
-
retryDelay,
|
|
1746
|
-
retryCount: token.getRetryCount() + 1,
|
|
1747
|
-
retryCost: capacityCost
|
|
1748
|
-
});
|
|
1749
|
-
}
|
|
1750
|
-
throw new Error("No retry token available");
|
|
1751
|
-
}
|
|
1752
|
-
recordSuccess(token) {
|
|
1753
|
-
this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
|
|
1754
|
-
}
|
|
1755
|
-
getCapacity() {
|
|
1756
|
-
return this.capacity;
|
|
1757
|
-
}
|
|
1758
|
-
async getMaxAttempts() {
|
|
1759
|
-
try {
|
|
1760
|
-
return await this.maxAttemptsProvider();
|
|
1761
|
-
} catch (error) {
|
|
1762
|
-
console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
|
|
1763
|
-
return DEFAULT_MAX_ATTEMPTS;
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
|
|
1767
|
-
const attempts = tokenToRenew.getRetryCount() + 1;
|
|
1768
|
-
return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType);
|
|
1769
|
-
}
|
|
1770
|
-
getCapacityCost(errorType) {
|
|
1771
|
-
return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
|
|
1772
|
-
}
|
|
1773
|
-
isRetryableError(errorType) {
|
|
1774
|
-
return errorType === "THROTTLING" || errorType === "TRANSIENT";
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
// ../../../../node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js
|
|
1779
|
-
class AdaptiveRetryStrategy {
|
|
1780
|
-
constructor(maxAttemptsProvider, options) {
|
|
1781
|
-
this.maxAttemptsProvider = maxAttemptsProvider;
|
|
1782
|
-
this.mode = RETRY_MODES.ADAPTIVE;
|
|
1783
|
-
const { rateLimiter } = options ?? {};
|
|
1784
|
-
this.rateLimiter = rateLimiter ?? new DefaultRateLimiter;
|
|
1785
|
-
this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
|
|
1786
|
-
}
|
|
1787
|
-
async acquireInitialRetryToken(retryTokenScope) {
|
|
1788
|
-
await this.rateLimiter.getSendToken();
|
|
1789
|
-
return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
|
|
1790
|
-
}
|
|
1791
|
-
async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
|
|
1792
|
-
this.rateLimiter.updateClientSendingRate(errorInfo);
|
|
1793
|
-
return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
|
|
1794
|
-
}
|
|
1795
|
-
recordSuccess(token) {
|
|
1796
|
-
this.rateLimiter.updateClientSendingRate({});
|
|
1797
|
-
this.standardRetryStrategy.recordSuccess(token);
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/configurations.js
|
|
1801
|
-
var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
|
|
1802
|
-
var CONFIG_MAX_ATTEMPTS = "max_attempts";
|
|
1803
|
-
var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
|
|
1804
|
-
environmentVariableSelector: (env) => {
|
|
1805
|
-
const value = env[ENV_MAX_ATTEMPTS];
|
|
1806
|
-
if (!value)
|
|
1807
|
-
return;
|
|
1808
|
-
const maxAttempt = parseInt(value);
|
|
1809
|
-
if (Number.isNaN(maxAttempt)) {
|
|
1810
|
-
throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
|
|
1811
|
-
}
|
|
1812
|
-
return maxAttempt;
|
|
1813
|
-
},
|
|
1814
|
-
configFileSelector: (profile) => {
|
|
1815
|
-
const value = profile[CONFIG_MAX_ATTEMPTS];
|
|
1816
|
-
if (!value)
|
|
1817
|
-
return;
|
|
1818
|
-
const maxAttempt = parseInt(value);
|
|
1819
|
-
if (Number.isNaN(maxAttempt)) {
|
|
1820
|
-
throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
|
|
1821
|
-
}
|
|
1822
|
-
return maxAttempt;
|
|
1823
|
-
},
|
|
1824
|
-
default: DEFAULT_MAX_ATTEMPTS
|
|
1825
|
-
};
|
|
1826
|
-
var resolveRetryConfig = (input) => {
|
|
1827
|
-
const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
|
|
1828
|
-
const maxAttempts = normalizeProvider2(_maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
|
|
1829
|
-
return Object.assign(input, {
|
|
1830
|
-
maxAttempts,
|
|
1831
|
-
retryStrategy: async () => {
|
|
1832
|
-
if (retryStrategy) {
|
|
1833
|
-
return retryStrategy;
|
|
1834
|
-
}
|
|
1835
|
-
const retryMode = await normalizeProvider2(_retryMode)();
|
|
1836
|
-
if (retryMode === RETRY_MODES.ADAPTIVE) {
|
|
1837
|
-
return new AdaptiveRetryStrategy(maxAttempts);
|
|
1838
|
-
}
|
|
1839
|
-
return new StandardRetryStrategy(maxAttempts);
|
|
1840
|
-
}
|
|
1841
|
-
});
|
|
1842
|
-
};
|
|
1843
|
-
var ENV_RETRY_MODE = "AWS_RETRY_MODE";
|
|
1844
|
-
var CONFIG_RETRY_MODE = "retry_mode";
|
|
1845
|
-
var NODE_RETRY_MODE_CONFIG_OPTIONS = {
|
|
1846
|
-
environmentVariableSelector: (env) => env[ENV_RETRY_MODE],
|
|
1847
|
-
configFileSelector: (profile) => profile[CONFIG_RETRY_MODE],
|
|
1848
|
-
default: DEFAULT_RETRY_MODE
|
|
1849
|
-
};
|
|
1850
|
-
|
|
1851
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
|
|
1852
|
-
var import_protocol_http5 = __toESM(require_dist_cjs(), 1);
|
|
1853
|
-
|
|
1854
|
-
// ../../../../node_modules/uuid/wrapper.mjs
|
|
1855
|
-
var import_dist = __toESM(require_dist(), 1);
|
|
1856
|
-
var v1 = import_dist.default.v1;
|
|
1857
|
-
var v3 = import_dist.default.v3;
|
|
1858
|
-
var v4 = import_dist.default.v4;
|
|
1859
|
-
var v5 = import_dist.default.v5;
|
|
1860
|
-
var NIL = import_dist.default.NIL;
|
|
1861
|
-
var version = import_dist.default.version;
|
|
1862
|
-
var validate = import_dist.default.validate;
|
|
1863
|
-
var stringify = import_dist.default.stringify;
|
|
1864
|
-
var parse = import_dist.default.parse;
|
|
1865
|
-
|
|
1866
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js
|
|
1867
|
-
import { Readable } from "node:stream";
|
|
1868
|
-
var isStreamingPayload = (request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream;
|
|
1869
|
-
|
|
1870
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/util.js
|
|
1871
|
-
var asSdkError = (error) => {
|
|
1872
|
-
if (error instanceof Error)
|
|
1873
|
-
return error;
|
|
1874
|
-
if (error instanceof Object)
|
|
1875
|
-
return Object.assign(new Error, error);
|
|
1876
|
-
if (typeof error === "string")
|
|
1877
|
-
return new Error(error);
|
|
1878
|
-
return new Error(`AWS SDK error wrapper for ${error}`);
|
|
1879
|
-
};
|
|
1880
|
-
|
|
1881
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
|
|
1882
|
-
var retryMiddleware = (options) => (next, context) => async (args) => {
|
|
1883
|
-
let retryStrategy = await options.retryStrategy();
|
|
1884
|
-
const maxAttempts = await options.maxAttempts();
|
|
1885
|
-
if (isRetryStrategyV2(retryStrategy)) {
|
|
1886
|
-
retryStrategy = retryStrategy;
|
|
1887
|
-
let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
|
|
1888
|
-
let lastError = new Error;
|
|
1889
|
-
let attempts = 0;
|
|
1890
|
-
let totalRetryDelay = 0;
|
|
1891
|
-
const { request } = args;
|
|
1892
|
-
const isRequest = import_protocol_http5.HttpRequest.isInstance(request);
|
|
1893
|
-
if (isRequest) {
|
|
1894
|
-
request.headers[INVOCATION_ID_HEADER] = v4();
|
|
1895
|
-
}
|
|
1896
|
-
while (true) {
|
|
1897
|
-
try {
|
|
1898
|
-
if (isRequest) {
|
|
1899
|
-
request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
|
|
1900
|
-
}
|
|
1901
|
-
const { response, output } = await next(args);
|
|
1902
|
-
retryStrategy.recordSuccess(retryToken);
|
|
1903
|
-
output.$metadata.attempts = attempts + 1;
|
|
1904
|
-
output.$metadata.totalRetryDelay = totalRetryDelay;
|
|
1905
|
-
return { response, output };
|
|
1906
|
-
} catch (e) {
|
|
1907
|
-
const retryErrorInfo = getRetryErrorInfo(e);
|
|
1908
|
-
lastError = asSdkError(e);
|
|
1909
|
-
if (isRequest && isStreamingPayload(request)) {
|
|
1910
|
-
(context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
|
|
1911
|
-
throw lastError;
|
|
1912
|
-
}
|
|
1913
|
-
try {
|
|
1914
|
-
retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
|
|
1915
|
-
} catch (refreshError) {
|
|
1916
|
-
if (!lastError.$metadata) {
|
|
1917
|
-
lastError.$metadata = {};
|
|
1918
|
-
}
|
|
1919
|
-
lastError.$metadata.attempts = attempts + 1;
|
|
1920
|
-
lastError.$metadata.totalRetryDelay = totalRetryDelay;
|
|
1921
|
-
throw lastError;
|
|
1922
|
-
}
|
|
1923
|
-
attempts = retryToken.getRetryCount();
|
|
1924
|
-
const delay = retryToken.getRetryDelay();
|
|
1925
|
-
totalRetryDelay += delay;
|
|
1926
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
} else {
|
|
1930
|
-
retryStrategy = retryStrategy;
|
|
1931
|
-
if (retryStrategy?.mode)
|
|
1932
|
-
context.userAgent = [...context.userAgent || [], ["cfg/retry-mode", retryStrategy.mode]];
|
|
1933
|
-
return retryStrategy.retry(next, args);
|
|
1934
|
-
}
|
|
1935
|
-
};
|
|
1936
|
-
var isRetryStrategyV2 = (retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined";
|
|
1937
|
-
var getRetryErrorInfo = (error) => {
|
|
1938
|
-
const errorInfo = {
|
|
1939
|
-
error,
|
|
1940
|
-
errorType: getRetryErrorType(error)
|
|
1941
|
-
};
|
|
1942
|
-
const retryAfterHint = getRetryAfterHint(error.$response);
|
|
1943
|
-
if (retryAfterHint) {
|
|
1944
|
-
errorInfo.retryAfterHint = retryAfterHint;
|
|
1945
|
-
}
|
|
1946
|
-
return errorInfo;
|
|
1947
|
-
};
|
|
1948
|
-
var getRetryErrorType = (error) => {
|
|
1949
|
-
if (isThrottlingError(error))
|
|
1950
|
-
return "THROTTLING";
|
|
1951
|
-
if (isTransientError(error))
|
|
1952
|
-
return "TRANSIENT";
|
|
1953
|
-
if (isServerError(error))
|
|
1954
|
-
return "SERVER_ERROR";
|
|
1955
|
-
return "CLIENT_ERROR";
|
|
1956
|
-
};
|
|
1957
|
-
var retryMiddlewareOptions = {
|
|
1958
|
-
name: "retryMiddleware",
|
|
1959
|
-
tags: ["RETRY"],
|
|
1960
|
-
step: "finalizeRequest",
|
|
1961
|
-
priority: "high",
|
|
1962
|
-
override: true
|
|
1963
|
-
};
|
|
1964
|
-
var getRetryPlugin = (options) => ({
|
|
1965
|
-
applyToStack: (clientStack) => {
|
|
1966
|
-
clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
|
|
1967
|
-
}
|
|
1968
|
-
});
|
|
1969
|
-
var getRetryAfterHint = (response) => {
|
|
1970
|
-
if (!import_protocol_http5.HttpResponse.isInstance(response))
|
|
1971
|
-
return;
|
|
1972
|
-
const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
|
|
1973
|
-
if (!retryAfterHeaderName)
|
|
1974
|
-
return;
|
|
1975
|
-
const retryAfter = response.headers[retryAfterHeaderName];
|
|
1976
|
-
const retryAfterSeconds = Number(retryAfter);
|
|
1977
|
-
if (!Number.isNaN(retryAfterSeconds))
|
|
1978
|
-
return new Date(retryAfterSeconds * 1000);
|
|
1979
|
-
const retryAfterDate = new Date(retryAfter);
|
|
1980
|
-
return retryAfterDate;
|
|
1981
|
-
};
|
|
1982
|
-
|
|
1983
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/StandardRetryStrategy.js
|
|
1984
|
-
var import_protocol_http6 = __toESM(require_dist_cjs(), 1);
|
|
1985
|
-
// ../../../../node_modules/@smithy/middleware-retry/dist-es/omitRetryHeadersMiddleware.js
|
|
1986
|
-
var import_protocol_http7 = __toESM(require_dist_cjs(), 1);
|
|
1987
|
-
// ../../../../node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
|
|
1988
|
-
import { platform, release } from "node:os";
|
|
1989
|
-
import { env, versions } from "node:process";
|
|
1990
|
-
|
|
1991
|
-
// ../../../../node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js
|
|
1992
|
-
var crtAvailability = {
|
|
1993
|
-
isCrtAvailable: false
|
|
1994
|
-
};
|
|
1995
|
-
|
|
1996
|
-
// ../../../../node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
|
|
1997
|
-
var isCrtAvailable = () => {
|
|
1998
|
-
if (crtAvailability.isCrtAvailable) {
|
|
1999
|
-
return ["md/crt-avail"];
|
|
2000
|
-
}
|
|
2001
|
-
return null;
|
|
2002
|
-
};
|
|
2003
|
-
|
|
2004
|
-
// ../../../../node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
|
|
2005
|
-
var createDefaultUserAgentProvider = ({ serviceId, clientVersion }) => {
|
|
2006
|
-
return async (config3) => {
|
|
2007
|
-
const sections = [
|
|
2008
|
-
["aws-sdk-js", clientVersion],
|
|
2009
|
-
["ua", "2.1"],
|
|
2010
|
-
[`os/${platform()}`, release()],
|
|
2011
|
-
["lang/js"],
|
|
2012
|
-
["md/nodejs", `${versions.node}`]
|
|
2013
|
-
];
|
|
2014
|
-
const crtAvailable = isCrtAvailable();
|
|
2015
|
-
if (crtAvailable) {
|
|
2016
|
-
sections.push(crtAvailable);
|
|
2017
|
-
}
|
|
2018
|
-
if (serviceId) {
|
|
2019
|
-
sections.push([`api/${serviceId}`, clientVersion]);
|
|
2020
|
-
}
|
|
2021
|
-
if (env.AWS_EXECUTION_ENV) {
|
|
2022
|
-
sections.push([`exec-env/${env.AWS_EXECUTION_ENV}`]);
|
|
2023
|
-
}
|
|
2024
|
-
const appId = await config3?.userAgentAppId?.();
|
|
2025
|
-
const resolvedUserAgent = appId ? [...sections, [`app/${appId}`]] : [...sections];
|
|
2026
|
-
return resolvedUserAgent;
|
|
2027
|
-
};
|
|
2028
|
-
};
|
|
2029
|
-
|
|
2030
|
-
// ../../../../node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js
|
|
2031
|
-
var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
|
|
2032
|
-
var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
|
|
2033
|
-
var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
|
|
2034
|
-
var NODE_APP_ID_CONFIG_OPTIONS = {
|
|
2035
|
-
environmentVariableSelector: (env2) => env2[UA_APP_ID_ENV_NAME],
|
|
2036
|
-
configFileSelector: (profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED],
|
|
2037
|
-
default: DEFAULT_UA_APP_ID
|
|
2038
|
-
};
|
|
2039
|
-
// ../../../../node_modules/@smithy/hash-node/dist-es/index.js
|
|
2040
|
-
var import_util_buffer_from = __toESM(require_dist_cjs2(), 1);
|
|
2041
|
-
var import_util_utf8 = __toESM(require_dist_cjs3(), 1);
|
|
2042
|
-
import { Buffer as Buffer2 } from "node:buffer";
|
|
2043
|
-
import { createHash, createHmac } from "node:crypto";
|
|
2044
|
-
|
|
2045
|
-
class Hash {
|
|
2046
|
-
constructor(algorithmIdentifier, secret) {
|
|
2047
|
-
this.algorithmIdentifier = algorithmIdentifier;
|
|
2048
|
-
this.secret = secret;
|
|
2049
|
-
this.reset();
|
|
2050
|
-
}
|
|
2051
|
-
update(toHash, encoding) {
|
|
2052
|
-
this.hash.update(import_util_utf8.toUint8Array(castSourceData(toHash, encoding)));
|
|
2053
|
-
}
|
|
2054
|
-
digest() {
|
|
2055
|
-
return Promise.resolve(this.hash.digest());
|
|
2056
|
-
}
|
|
2057
|
-
reset() {
|
|
2058
|
-
this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier);
|
|
2059
|
-
}
|
|
2060
|
-
}
|
|
2061
|
-
function castSourceData(toCast, encoding) {
|
|
2062
|
-
if (Buffer2.isBuffer(toCast)) {
|
|
2063
|
-
return toCast;
|
|
2064
|
-
}
|
|
2065
|
-
if (typeof toCast === "string") {
|
|
2066
|
-
return import_util_buffer_from.fromString(toCast, encoding);
|
|
2067
|
-
}
|
|
2068
|
-
if (ArrayBuffer.isView(toCast)) {
|
|
2069
|
-
return import_util_buffer_from.fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
|
|
2070
|
-
}
|
|
2071
|
-
return import_util_buffer_from.fromArrayBuffer(toCast);
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
// ../../../../node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js
|
|
2075
|
-
import { fstatSync, lstatSync } from "node:fs";
|
|
2076
|
-
var calculateBodyLength = (body) => {
|
|
2077
|
-
if (!body) {
|
|
2078
|
-
return 0;
|
|
2079
|
-
}
|
|
2080
|
-
if (typeof body === "string") {
|
|
2081
|
-
return Buffer.byteLength(body);
|
|
2082
|
-
} else if (typeof body.byteLength === "number") {
|
|
2083
|
-
return body.byteLength;
|
|
2084
|
-
} else if (typeof body.size === "number") {
|
|
2085
|
-
return body.size;
|
|
2086
|
-
} else if (typeof body.start === "number" && typeof body.end === "number") {
|
|
2087
|
-
return body.end + 1 - body.start;
|
|
2088
|
-
} else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
|
|
2089
|
-
return lstatSync(body.path).size;
|
|
2090
|
-
} else if (typeof body.fd === "number") {
|
|
2091
|
-
return fstatSync(body.fd).size;
|
|
2092
|
-
}
|
|
2093
|
-
throw new Error(`Body Length computation failed for ${body}`);
|
|
2094
|
-
};
|
|
2095
|
-
// ../../../../node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
|
|
2096
|
-
var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
|
|
2097
|
-
var AWS_REGION_ENV = "AWS_REGION";
|
|
2098
|
-
var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
|
|
2099
|
-
var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
|
|
2100
|
-
var DEFAULTS_MODE_OPTIONS = ["in-region", "cross-region", "mobile", "standard", "legacy"];
|
|
2101
|
-
var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
|
|
2102
|
-
|
|
2103
|
-
// ../../../../node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js
|
|
2104
|
-
var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
|
|
2105
|
-
var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
|
|
2106
|
-
var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
|
|
2107
|
-
environmentVariableSelector: (env2) => {
|
|
2108
|
-
return env2[AWS_DEFAULTS_MODE_ENV];
|
|
2109
|
-
},
|
|
2110
|
-
configFileSelector: (profile) => {
|
|
2111
|
-
return profile[AWS_DEFAULTS_MODE_CONFIG];
|
|
2112
|
-
},
|
|
2113
|
-
default: "legacy"
|
|
2114
|
-
};
|
|
2115
|
-
|
|
2116
|
-
// ../../../../node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js
|
|
2117
|
-
var resolveDefaultsModeConfig = ({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
|
|
2118
|
-
const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
|
|
2119
|
-
switch (mode?.toLowerCase()) {
|
|
2120
|
-
case "auto":
|
|
2121
|
-
return resolveNodeDefaultsModeAuto(region);
|
|
2122
|
-
case "in-region":
|
|
2123
|
-
case "cross-region":
|
|
2124
|
-
case "mobile":
|
|
2125
|
-
case "standard":
|
|
2126
|
-
case "legacy":
|
|
2127
|
-
return Promise.resolve(mode?.toLocaleLowerCase());
|
|
2128
|
-
case undefined:
|
|
2129
|
-
return Promise.resolve("legacy");
|
|
2130
|
-
default:
|
|
2131
|
-
throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
|
|
2132
|
-
}
|
|
2133
|
-
});
|
|
2134
|
-
var resolveNodeDefaultsModeAuto = async (clientRegion) => {
|
|
2135
|
-
if (clientRegion) {
|
|
2136
|
-
const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
|
|
2137
|
-
const inferredRegion = await inferPhysicalRegion();
|
|
2138
|
-
if (!inferredRegion) {
|
|
2139
|
-
return "standard";
|
|
2140
|
-
}
|
|
2141
|
-
if (resolvedRegion === inferredRegion) {
|
|
2142
|
-
return "in-region";
|
|
2143
|
-
} else {
|
|
2144
|
-
return "cross-region";
|
|
2145
|
-
}
|
|
2146
|
-
}
|
|
2147
|
-
return "standard";
|
|
2148
|
-
};
|
|
2149
|
-
var inferPhysicalRegion = async () => {
|
|
2150
|
-
if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
|
|
2151
|
-
return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
|
|
2152
|
-
}
|
|
2153
|
-
if (!process.env[ENV_IMDS_DISABLED]) {
|
|
2154
|
-
try {
|
|
2155
|
-
const { getInstanceMetadataEndpoint, httpRequest } = await import("./chunk-92e6scf8.js");
|
|
2156
|
-
const endpoint = await getInstanceMetadataEndpoint();
|
|
2157
|
-
return (await httpRequest({ ...endpoint, path: IMDS_REGION_PATH })).toString();
|
|
2158
|
-
} catch (e) {}
|
|
2159
|
-
}
|
|
2160
|
-
};
|
|
2161
|
-
// ../../../../node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
|
|
2162
|
-
var getAwsRegionExtensionConfiguration = (runtimeConfig) => {
|
|
2163
|
-
return {
|
|
2164
|
-
setRegion(region) {
|
|
2165
|
-
runtimeConfig.region = region;
|
|
2166
|
-
},
|
|
2167
|
-
region() {
|
|
2168
|
-
return runtimeConfig.region;
|
|
2169
|
-
}
|
|
2170
|
-
};
|
|
2171
|
-
};
|
|
2172
|
-
var resolveAwsRegionExtensionConfiguration = (awsRegionExtensionConfiguration) => {
|
|
2173
|
-
return {
|
|
2174
|
-
region: awsRegionExtensionConfiguration.region()
|
|
2175
|
-
};
|
|
2176
|
-
};
|
|
2177
|
-
export { resolveHostHeaderConfig, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin, resolveUserAgentConfig, EndpointCache, customEndpointFunctions, resolveEndpoint, awsEndpointFunctions, getUserAgentPlugin, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, getSmithyContext, normalizeProvider2 as normalizeProvider, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig, getContentLengthPlugin, getSerdePlugin, getEndpointPlugin, resolveEndpointConfig, DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, NODE_RETRY_MODE_CONFIG_OPTIONS, getRetryPlugin, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, Hash, calculateBodyLength, resolveDefaultsModeConfig, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration };
|