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