@layerzerolabs/vm-tooling 0.2.22 → 0.2.23

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 (180) hide show
  1. package/LICENSE +23 -0
  2. package/dist/4JD7YXQE.js +47 -0
  3. package/dist/4JD7YXQE.js.map +1 -0
  4. package/dist/{BEHAXLXQ.js → 5FQEEZQ7.js} +4 -4
  5. package/dist/{BEHAXLXQ.js.map → 5FQEEZQ7.js.map} +1 -1
  6. package/dist/C75WADM5.js +15 -0
  7. package/dist/C75WADM5.js.map +1 -0
  8. package/dist/{EP2ZMEJO.js → GNUGNPEQ.js} +47 -13
  9. package/dist/GNUGNPEQ.js.map +1 -0
  10. package/dist/{UGOYXDC2.js → I4UV4L75.js} +9 -15
  11. package/dist/I4UV4L75.js.map +1 -0
  12. package/dist/ICMHRFCX.cjs +78 -0
  13. package/dist/ICMHRFCX.cjs.map +1 -0
  14. package/dist/{OMZA67EH.js → J2675KOZ.js} +5 -5
  15. package/dist/J2675KOZ.js.map +1 -0
  16. package/dist/{Y7XA7YWK.cjs → M7FR43QL.cjs} +5 -5
  17. package/dist/M7FR43QL.cjs.map +1 -0
  18. package/dist/{GG2ZAAIE.cjs → UHRRIDQ3.cjs} +6 -6
  19. package/dist/{GG2ZAAIE.cjs.map → UHRRIDQ3.cjs.map} +1 -1
  20. package/dist/{VH4UXRKG.cjs → VAGPJO44.cjs} +49 -15
  21. package/dist/VAGPJO44.cjs.map +1 -0
  22. package/dist/{GEZ3XVTG.cjs → X53USKD4.cjs} +10 -16
  23. package/dist/X53USKD4.cjs.map +1 -0
  24. package/dist/Y6ZP4DWX.cjs +49 -0
  25. package/dist/Y6ZP4DWX.cjs.map +1 -0
  26. package/dist/YI63OKDP.js +53 -0
  27. package/dist/YI63OKDP.js.map +1 -0
  28. package/dist/Z55JUIO3.cjs +17 -0
  29. package/dist/Z55JUIO3.cjs.map +1 -0
  30. package/dist/cli.cjs +5 -5
  31. package/dist/cli.js +4 -4
  32. package/dist/config.cjs +8 -12
  33. package/dist/config.d.ts +6 -4
  34. package/dist/config.d.ts.map +1 -1
  35. package/dist/config.js +1 -1
  36. package/dist/core/index.cjs +4 -4
  37. package/dist/core/index.js +3 -3
  38. package/dist/core/tool-executor.cjs +4 -4
  39. package/dist/core/tool-executor.d.ts.map +1 -1
  40. package/dist/core/tool-executor.js +3 -3
  41. package/dist/github/index.cjs +5 -16
  42. package/dist/github/index.d.ts.map +1 -1
  43. package/dist/github/index.js +4 -15
  44. package/dist/github/matrix.cjs +4 -15
  45. package/dist/github/matrix.d.ts +13 -3
  46. package/dist/github/matrix.d.ts.map +1 -1
  47. package/dist/github/matrix.js +3 -14
  48. package/dist/index.cjs +15 -22
  49. package/dist/index.cjs.map +1 -1
  50. package/dist/index.d.ts +2 -1
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +7 -18
  53. package/dist/index.js.map +1 -1
  54. package/dist/test.cjs +4 -4
  55. package/dist/test.d.ts +1 -1
  56. package/dist/test.d.ts.map +1 -1
  57. package/dist/test.js +3 -3
  58. package/dist/utils/docker.cjs +6 -6
  59. package/dist/utils/docker.d.ts +2 -2
  60. package/dist/utils/docker.d.ts.map +1 -1
  61. package/dist/utils/docker.js +2 -2
  62. package/package.json +10 -5
  63. package/dist/3NXVR3DC.cjs +0 -18
  64. package/dist/3NXVR3DC.cjs.map +0 -1
  65. package/dist/3TIEGVTO.cjs +0 -431
  66. package/dist/3TIEGVTO.cjs.map +0 -1
  67. package/dist/3V7HWCTZ.js +0 -190
  68. package/dist/3V7HWCTZ.js.map +0 -1
  69. package/dist/3YN24Z7J.js +0 -261
  70. package/dist/3YN24Z7J.js.map +0 -1
  71. package/dist/427QOV7V.js +0 -348
  72. package/dist/427QOV7V.js.map +0 -1
  73. package/dist/4DNHANRV.cjs +0 -39
  74. package/dist/4DNHANRV.cjs.map +0 -1
  75. package/dist/5IOOBAVX.cjs +0 -832
  76. package/dist/5IOOBAVX.cjs.map +0 -1
  77. package/dist/5QZDX45Q.js +0 -1975
  78. package/dist/5QZDX45Q.js.map +0 -1
  79. package/dist/634Q3MUX.cjs +0 -1128
  80. package/dist/634Q3MUX.cjs.map +0 -1
  81. package/dist/77LS3AZK.cjs +0 -1977
  82. package/dist/77LS3AZK.cjs.map +0 -1
  83. package/dist/7AUJV34E.cjs +0 -144
  84. package/dist/7AUJV34E.cjs.map +0 -1
  85. package/dist/7HA6JSWY.cjs +0 -103
  86. package/dist/7HA6JSWY.cjs.map +0 -1
  87. package/dist/7JWBGU62.js +0 -141
  88. package/dist/7JWBGU62.js.map +0 -1
  89. package/dist/7O5SJUXT.cjs +0 -354
  90. package/dist/7O5SJUXT.cjs.map +0 -1
  91. package/dist/7R4LC2OX.js +0 -3246
  92. package/dist/7R4LC2OX.js.map +0 -1
  93. package/dist/DDKMZ6EE.js +0 -6
  94. package/dist/DDKMZ6EE.js.map +0 -1
  95. package/dist/DS4LZJHX.cjs +0 -252
  96. package/dist/DS4LZJHX.cjs.map +0 -1
  97. package/dist/EP2ZMEJO.js.map +0 -1
  98. package/dist/ERGNNQ6N.js +0 -16
  99. package/dist/ERGNNQ6N.js.map +0 -1
  100. package/dist/EXBTG2GQ.js +0 -4823
  101. package/dist/EXBTG2GQ.js.map +0 -1
  102. package/dist/FBKCEQT5.cjs +0 -263
  103. package/dist/FBKCEQT5.cjs.map +0 -1
  104. package/dist/FC7UGQEI.cjs +0 -19
  105. package/dist/FC7UGQEI.cjs.map +0 -1
  106. package/dist/FDH37YWR.cjs +0 -52
  107. package/dist/FDH37YWR.cjs.map +0 -1
  108. package/dist/FQPOYRQJ.cjs +0 -59
  109. package/dist/FQPOYRQJ.cjs.map +0 -1
  110. package/dist/GEZ3XVTG.cjs.map +0 -1
  111. package/dist/GHQS37WK.js +0 -251
  112. package/dist/GHQS37WK.js.map +0 -1
  113. package/dist/GVS7FGYI.cjs +0 -49
  114. package/dist/GVS7FGYI.cjs.map +0 -1
  115. package/dist/HVDH52K5.cjs +0 -3273
  116. package/dist/HVDH52K5.cjs.map +0 -1
  117. package/dist/HVR3WYCV.js +0 -70
  118. package/dist/HVR3WYCV.js.map +0 -1
  119. package/dist/I24EDDRD.cjs +0 -30
  120. package/dist/I24EDDRD.cjs.map +0 -1
  121. package/dist/IYIFH7LC.js +0 -29
  122. package/dist/IYIFH7LC.js.map +0 -1
  123. package/dist/J2A64VZU.js +0 -143
  124. package/dist/J2A64VZU.js.map +0 -1
  125. package/dist/JXS7ZGGU.js +0 -350
  126. package/dist/JXS7ZGGU.js.map +0 -1
  127. package/dist/MDE37STN.cjs +0 -146
  128. package/dist/MDE37STN.cjs.map +0 -1
  129. package/dist/OBHJ2FSI.cjs +0 -103
  130. package/dist/OBHJ2FSI.cjs.map +0 -1
  131. package/dist/OLCI6QQA.cjs +0 -73
  132. package/dist/OLCI6QQA.cjs.map +0 -1
  133. package/dist/OMZA67EH.js.map +0 -1
  134. package/dist/PFRT6NBP.js +0 -30
  135. package/dist/PFRT6NBP.js.map +0 -1
  136. package/dist/PQ4H7UWU.js +0 -51
  137. package/dist/PQ4H7UWU.js.map +0 -1
  138. package/dist/Q5L3QIKZ.cjs +0 -825
  139. package/dist/Q5L3QIKZ.cjs.map +0 -1
  140. package/dist/QDUIE3K3.js +0 -829
  141. package/dist/QDUIE3K3.js.map +0 -1
  142. package/dist/QEUMSA6O.cjs +0 -260
  143. package/dist/QEUMSA6O.cjs.map +0 -1
  144. package/dist/QHFDWPE3.js +0 -28
  145. package/dist/QHFDWPE3.js.map +0 -1
  146. package/dist/TQHAG73D.js +0 -46
  147. package/dist/TQHAG73D.js.map +0 -1
  148. package/dist/UFZOOGMQ.js +0 -46
  149. package/dist/UFZOOGMQ.js.map +0 -1
  150. package/dist/UGOYXDC2.js.map +0 -1
  151. package/dist/UOMNLT53.cjs +0 -33
  152. package/dist/UOMNLT53.cjs.map +0 -1
  153. package/dist/UUMDUUBJ.cjs +0 -194
  154. package/dist/UUMDUUBJ.cjs.map +0 -1
  155. package/dist/VEHBRPVG.js +0 -175
  156. package/dist/VEHBRPVG.js.map +0 -1
  157. package/dist/VH4UXRKG.cjs.map +0 -1
  158. package/dist/VM366GYK.js +0 -101
  159. package/dist/VM366GYK.js.map +0 -1
  160. package/dist/W3F4RJVY.js +0 -1103
  161. package/dist/W3F4RJVY.js.map +0 -1
  162. package/dist/W4QDYLOA.js +0 -17
  163. package/dist/W4QDYLOA.js.map +0 -1
  164. package/dist/WSDEGNMI.cjs +0 -56
  165. package/dist/WSDEGNMI.cjs.map +0 -1
  166. package/dist/WSES6SE2.js +0 -420
  167. package/dist/WSES6SE2.js.map +0 -1
  168. package/dist/XCUEIITH.js +0 -101
  169. package/dist/XCUEIITH.js.map +0 -1
  170. package/dist/XVWZAEKK.js +0 -807
  171. package/dist/XVWZAEKK.js.map +0 -1
  172. package/dist/Y7XA7YWK.cjs.map +0 -1
  173. package/dist/YHGTF22I.cjs +0 -4881
  174. package/dist/YHGTF22I.cjs.map +0 -1
  175. package/dist/Z7SRDY43.js +0 -250
  176. package/dist/Z7SRDY43.js.map +0 -1
  177. package/dist/ZGCH6KFP.cjs +0 -354
  178. package/dist/ZGCH6KFP.cjs.map +0 -1
  179. package/dist/ZTSEHGET.cjs +0 -182
  180. package/dist/ZTSEHGET.cjs.map +0 -1
package/dist/EXBTG2GQ.js DELETED
@@ -1,4823 +0,0 @@
1
- import { memoize, loadConfig, parseUrl } from './3V7HWCTZ.js';
2
- import { CONFIG_PREFIX_SEPARATOR } from './GHQS37WK.js';
3
- import { fromBase64, toBase64, HttpRequest, fromHex, toHex, escapeUri, HttpResponse } from './XVWZAEKK.js';
4
- import { fromUtf8, toUtf8, fromString, fromArrayBuffer, isArrayBuffer } from './TQHAG73D.js';
5
- import { setCredentialFeature } from './ERGNNQ6N.js';
6
- import { init_esm_shims, __name } from './6AHA7PAZ.js';
7
- import crypto2, { createHmac, createHash } from 'crypto';
8
- import { Readable } from 'stream';
9
- import { platform, release } from 'os';
10
- import { versions, env } from 'process';
11
- import { Buffer as Buffer$1 } from 'buffer';
12
- import { ReadStream, lstatSync, fstatSync } from 'fs';
13
-
14
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/client.js
15
- init_esm_shims();
16
-
17
- // ../../node_modules/.pnpm/@smithy+middleware-stack@4.2.5/node_modules/@smithy/middleware-stack/dist-es/MiddlewareStack.js
18
- init_esm_shims();
19
- var getAllAliases = /* @__PURE__ */ __name((name, aliases) => {
20
- const _aliases = [];
21
- if (name) {
22
- _aliases.push(name);
23
- }
24
- if (aliases) {
25
- for (const alias of aliases) {
26
- _aliases.push(alias);
27
- }
28
- }
29
- return _aliases;
30
- }, "getAllAliases");
31
- var getMiddlewareNameWithAliases = /* @__PURE__ */ __name((name, aliases) => {
32
- return `${name || "anonymous"}${aliases && aliases.length > 0 ? ` (a.k.a. ${aliases.join(",")})` : ""}`;
33
- }, "getMiddlewareNameWithAliases");
34
- var constructStack = /* @__PURE__ */ __name(() => {
35
- let absoluteEntries = [];
36
- let relativeEntries = [];
37
- let identifyOnResolve = false;
38
- const entriesNameSet = /* @__PURE__ */ new Set();
39
- const sort = /* @__PURE__ */ __name((entries) => entries.sort((a, b) => stepWeights[b.step] - stepWeights[a.step] || priorityWeights[b.priority || "normal"] - priorityWeights[a.priority || "normal"]), "sort");
40
- const removeByName = /* @__PURE__ */ __name((toRemove) => {
41
- let isRemoved = false;
42
- const filterCb = /* @__PURE__ */ __name((entry) => {
43
- const aliases = getAllAliases(entry.name, entry.aliases);
44
- if (aliases.includes(toRemove)) {
45
- isRemoved = true;
46
- for (const alias of aliases) {
47
- entriesNameSet.delete(alias);
48
- }
49
- return false;
50
- }
51
- return true;
52
- }, "filterCb");
53
- absoluteEntries = absoluteEntries.filter(filterCb);
54
- relativeEntries = relativeEntries.filter(filterCb);
55
- return isRemoved;
56
- }, "removeByName");
57
- const removeByReference = /* @__PURE__ */ __name((toRemove) => {
58
- let isRemoved = false;
59
- const filterCb = /* @__PURE__ */ __name((entry) => {
60
- if (entry.middleware === toRemove) {
61
- isRemoved = true;
62
- for (const alias of getAllAliases(entry.name, entry.aliases)) {
63
- entriesNameSet.delete(alias);
64
- }
65
- return false;
66
- }
67
- return true;
68
- }, "filterCb");
69
- absoluteEntries = absoluteEntries.filter(filterCb);
70
- relativeEntries = relativeEntries.filter(filterCb);
71
- return isRemoved;
72
- }, "removeByReference");
73
- const cloneTo = /* @__PURE__ */ __name((toStack) => {
74
- absoluteEntries.forEach((entry) => {
75
- toStack.add(entry.middleware, {
76
- ...entry
77
- });
78
- });
79
- relativeEntries.forEach((entry) => {
80
- toStack.addRelativeTo(entry.middleware, {
81
- ...entry
82
- });
83
- });
84
- toStack.identifyOnResolve?.(stack.identifyOnResolve());
85
- return toStack;
86
- }, "cloneTo");
87
- const expandRelativeMiddlewareList = /* @__PURE__ */ __name((from) => {
88
- const expandedMiddlewareList = [];
89
- from.before.forEach((entry) => {
90
- if (entry.before.length === 0 && entry.after.length === 0) {
91
- expandedMiddlewareList.push(entry);
92
- } else {
93
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
94
- }
95
- });
96
- expandedMiddlewareList.push(from);
97
- from.after.reverse().forEach((entry) => {
98
- if (entry.before.length === 0 && entry.after.length === 0) {
99
- expandedMiddlewareList.push(entry);
100
- } else {
101
- expandedMiddlewareList.push(...expandRelativeMiddlewareList(entry));
102
- }
103
- });
104
- return expandedMiddlewareList;
105
- }, "expandRelativeMiddlewareList");
106
- const getMiddlewareList = /* @__PURE__ */ __name((debug = false) => {
107
- const normalizedAbsoluteEntries = [];
108
- const normalizedRelativeEntries = [];
109
- const normalizedEntriesNameMap = {};
110
- absoluteEntries.forEach((entry) => {
111
- const normalizedEntry = {
112
- ...entry,
113
- before: [],
114
- after: []
115
- };
116
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
117
- normalizedEntriesNameMap[alias] = normalizedEntry;
118
- }
119
- normalizedAbsoluteEntries.push(normalizedEntry);
120
- });
121
- relativeEntries.forEach((entry) => {
122
- const normalizedEntry = {
123
- ...entry,
124
- before: [],
125
- after: []
126
- };
127
- for (const alias of getAllAliases(normalizedEntry.name, normalizedEntry.aliases)) {
128
- normalizedEntriesNameMap[alias] = normalizedEntry;
129
- }
130
- normalizedRelativeEntries.push(normalizedEntry);
131
- });
132
- normalizedRelativeEntries.forEach((entry) => {
133
- if (entry.toMiddleware) {
134
- const toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];
135
- if (toMiddleware === void 0) {
136
- if (debug) {
137
- return;
138
- }
139
- throw new Error(`${entry.toMiddleware} is not found when adding ${getMiddlewareNameWithAliases(entry.name, entry.aliases)} middleware ${entry.relation} ${entry.toMiddleware}`);
140
- }
141
- if (entry.relation === "after") {
142
- toMiddleware.after.push(entry);
143
- }
144
- if (entry.relation === "before") {
145
- toMiddleware.before.push(entry);
146
- }
147
- }
148
- });
149
- const mainChain = sort(normalizedAbsoluteEntries).map(expandRelativeMiddlewareList).reduce((wholeList, expandedMiddlewareList) => {
150
- wholeList.push(...expandedMiddlewareList);
151
- return wholeList;
152
- }, []);
153
- return mainChain;
154
- }, "getMiddlewareList");
155
- const stack = {
156
- add: /* @__PURE__ */ __name((middleware, options = {}) => {
157
- const { name, override, aliases: _aliases } = options;
158
- const entry = {
159
- step: "initialize",
160
- priority: "normal",
161
- middleware,
162
- ...options
163
- };
164
- const aliases = getAllAliases(name, _aliases);
165
- if (aliases.length > 0) {
166
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
167
- if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
168
- for (const alias of aliases) {
169
- const toOverrideIndex = absoluteEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
170
- if (toOverrideIndex === -1) {
171
- continue;
172
- }
173
- const toOverride = absoluteEntries[toOverrideIndex];
174
- if (toOverride.step !== entry.step || entry.priority !== toOverride.priority) {
175
- throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware with ${toOverride.priority} priority in ${toOverride.step} step cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware with ${entry.priority} priority in ${entry.step} step.`);
176
- }
177
- absoluteEntries.splice(toOverrideIndex, 1);
178
- }
179
- }
180
- for (const alias of aliases) {
181
- entriesNameSet.add(alias);
182
- }
183
- }
184
- absoluteEntries.push(entry);
185
- }, "add"),
186
- addRelativeTo: /* @__PURE__ */ __name((middleware, options) => {
187
- const { name, override, aliases: _aliases } = options;
188
- const entry = {
189
- middleware,
190
- ...options
191
- };
192
- const aliases = getAllAliases(name, _aliases);
193
- if (aliases.length > 0) {
194
- if (aliases.some((alias) => entriesNameSet.has(alias))) {
195
- if (!override) throw new Error(`Duplicate middleware name '${getMiddlewareNameWithAliases(name, _aliases)}'`);
196
- for (const alias of aliases) {
197
- const toOverrideIndex = relativeEntries.findIndex((entry2) => entry2.name === alias || entry2.aliases?.some((a) => a === alias));
198
- if (toOverrideIndex === -1) {
199
- continue;
200
- }
201
- const toOverride = relativeEntries[toOverrideIndex];
202
- if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {
203
- throw new Error(`"${getMiddlewareNameWithAliases(toOverride.name, toOverride.aliases)}" middleware ${toOverride.relation} "${toOverride.toMiddleware}" middleware cannot be overridden by "${getMiddlewareNameWithAliases(name, _aliases)}" middleware ${entry.relation} "${entry.toMiddleware}" middleware.`);
204
- }
205
- relativeEntries.splice(toOverrideIndex, 1);
206
- }
207
- }
208
- for (const alias of aliases) {
209
- entriesNameSet.add(alias);
210
- }
211
- }
212
- relativeEntries.push(entry);
213
- }, "addRelativeTo"),
214
- clone: /* @__PURE__ */ __name(() => cloneTo(constructStack()), "clone"),
215
- use: /* @__PURE__ */ __name((plugin) => {
216
- plugin.applyToStack(stack);
217
- }, "use"),
218
- remove: /* @__PURE__ */ __name((toRemove) => {
219
- if (typeof toRemove === "string") return removeByName(toRemove);
220
- else return removeByReference(toRemove);
221
- }, "remove"),
222
- removeByTag: /* @__PURE__ */ __name((toRemove) => {
223
- let isRemoved = false;
224
- const filterCb = /* @__PURE__ */ __name((entry) => {
225
- const { tags, name, aliases: _aliases } = entry;
226
- if (tags && tags.includes(toRemove)) {
227
- const aliases = getAllAliases(name, _aliases);
228
- for (const alias of aliases) {
229
- entriesNameSet.delete(alias);
230
- }
231
- isRemoved = true;
232
- return false;
233
- }
234
- return true;
235
- }, "filterCb");
236
- absoluteEntries = absoluteEntries.filter(filterCb);
237
- relativeEntries = relativeEntries.filter(filterCb);
238
- return isRemoved;
239
- }, "removeByTag"),
240
- concat: /* @__PURE__ */ __name((from) => {
241
- const cloned = cloneTo(constructStack());
242
- cloned.use(from);
243
- cloned.identifyOnResolve(identifyOnResolve || cloned.identifyOnResolve() || (from.identifyOnResolve?.() ?? false));
244
- return cloned;
245
- }, "concat"),
246
- applyToStack: cloneTo,
247
- identify: /* @__PURE__ */ __name(() => {
248
- return getMiddlewareList(true).map((mw) => {
249
- const step = mw.step ?? mw.relation + " " + mw.toMiddleware;
250
- return getMiddlewareNameWithAliases(mw.name, mw.aliases) + " - " + step;
251
- });
252
- }, "identify"),
253
- identifyOnResolve(toggle) {
254
- if (typeof toggle === "boolean") identifyOnResolve = toggle;
255
- return identifyOnResolve;
256
- },
257
- resolve: /* @__PURE__ */ __name((handler, context) => {
258
- for (const middleware of getMiddlewareList().map((entry) => entry.middleware).reverse()) {
259
- handler = middleware(handler, context);
260
- }
261
- if (identifyOnResolve) {
262
- console.log(stack.identify());
263
- }
264
- return handler;
265
- }, "resolve")
266
- };
267
- return stack;
268
- }, "constructStack");
269
- var stepWeights = {
270
- initialize: 5,
271
- serialize: 4,
272
- build: 3,
273
- finalizeRequest: 2,
274
- deserialize: 1
275
- };
276
- var priorityWeights = {
277
- high: 3,
278
- normal: 2,
279
- low: 1
280
- };
281
-
282
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/client.js
283
- var Client = class {
284
- static {
285
- __name(this, "Client");
286
- }
287
- config;
288
- middlewareStack = constructStack();
289
- initConfig;
290
- handlers;
291
- constructor(config) {
292
- this.config = config;
293
- }
294
- send(command, optionsOrCb, cb) {
295
- const options = typeof optionsOrCb !== "function" ? optionsOrCb : void 0;
296
- const callback = typeof optionsOrCb === "function" ? optionsOrCb : cb;
297
- const useHandlerCache = options === void 0 && this.config.cacheMiddleware === true;
298
- let handler;
299
- if (useHandlerCache) {
300
- if (!this.handlers) {
301
- this.handlers = /* @__PURE__ */ new WeakMap();
302
- }
303
- const handlers = this.handlers;
304
- if (handlers.has(command.constructor)) {
305
- handler = handlers.get(command.constructor);
306
- } else {
307
- handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
308
- handlers.set(command.constructor, handler);
309
- }
310
- } else {
311
- delete this.handlers;
312
- handler = command.resolveMiddleware(this.middlewareStack, this.config, options);
313
- }
314
- if (callback) {
315
- handler(command).then((result) => callback(null, result.output), (err) => callback(err)).catch(() => {
316
- });
317
- } else {
318
- return handler(command).then((result) => result.output);
319
- }
320
- }
321
- destroy() {
322
- this.config?.requestHandler?.destroy?.();
323
- delete this.handlers;
324
- }
325
- };
326
-
327
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/command.js
328
- init_esm_shims();
329
-
330
- // ../../node_modules/.pnpm/@smithy+types@4.9.0/node_modules/@smithy/types/dist-es/endpoint.js
331
- init_esm_shims();
332
- var EndpointURLScheme;
333
- (function(EndpointURLScheme2) {
334
- EndpointURLScheme2["HTTP"] = "http";
335
- EndpointURLScheme2["HTTPS"] = "https";
336
- })(EndpointURLScheme || (EndpointURLScheme = {}));
337
-
338
- // ../../node_modules/.pnpm/@smithy+types@4.9.0/node_modules/@smithy/types/dist-es/extensions/index.js
339
- init_esm_shims();
340
-
341
- // ../../node_modules/.pnpm/@smithy+types@4.9.0/node_modules/@smithy/types/dist-es/extensions/checksum.js
342
- init_esm_shims();
343
- var AlgorithmId;
344
- (function(AlgorithmId2) {
345
- AlgorithmId2["MD5"] = "md5";
346
- AlgorithmId2["CRC32"] = "crc32";
347
- AlgorithmId2["CRC32C"] = "crc32c";
348
- AlgorithmId2["SHA1"] = "sha1";
349
- AlgorithmId2["SHA256"] = "sha256";
350
- })(AlgorithmId || (AlgorithmId = {}));
351
-
352
- // ../../node_modules/.pnpm/@smithy+types@4.9.0/node_modules/@smithy/types/dist-es/middleware.js
353
- init_esm_shims();
354
- var SMITHY_CONTEXT_KEY = "__smithy_context";
355
-
356
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js
357
- init_esm_shims();
358
-
359
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/schema/deref.js
360
- init_esm_shims();
361
- var deref = /* @__PURE__ */ __name((schemaRef) => {
362
- if (typeof schemaRef === "function") {
363
- return schemaRef();
364
- }
365
- return schemaRef;
366
- }, "deref");
367
-
368
- // ../../node_modules/.pnpm/@smithy+protocol-http@5.3.5/node_modules/@smithy/protocol-http/dist-es/extensions/httpExtensionConfiguration.js
369
- init_esm_shims();
370
- var getHttpHandlerExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
371
- return {
372
- setHttpHandler(handler) {
373
- runtimeConfig.httpHandler = handler;
374
- },
375
- httpHandler() {
376
- return runtimeConfig.httpHandler;
377
- },
378
- updateHttpClientConfig(key, value) {
379
- runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
380
- },
381
- httpHandlerConfigs() {
382
- return runtimeConfig.httpHandler.httpHandlerConfigs();
383
- }
384
- };
385
- }, "getHttpHandlerExtensionConfiguration");
386
- var resolveHttpHandlerRuntimeConfig = /* @__PURE__ */ __name((httpHandlerExtensionConfiguration) => {
387
- return {
388
- httpHandler: httpHandlerExtensionConfiguration.httpHandler()
389
- };
390
- }, "resolveHttpHandlerRuntimeConfig");
391
-
392
- // ../../node_modules/.pnpm/@smithy+util-middleware@4.2.5/node_modules/@smithy/util-middleware/dist-es/getSmithyContext.js
393
- init_esm_shims();
394
- var getSmithyContext = /* @__PURE__ */ __name((context) => context[SMITHY_CONTEXT_KEY] || (context[SMITHY_CONTEXT_KEY] = {}), "getSmithyContext");
395
-
396
- // ../../node_modules/.pnpm/@smithy+util-middleware@4.2.5/node_modules/@smithy/util-middleware/dist-es/normalizeProvider.js
397
- init_esm_shims();
398
- var normalizeProvider = /* @__PURE__ */ __name((input) => {
399
- if (typeof input === "function") return input;
400
- const promisified = Promise.resolve(input);
401
- return () => promisified;
402
- }, "normalizeProvider");
403
-
404
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
405
- init_esm_shims();
406
-
407
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js
408
- init_esm_shims();
409
- function translateTraits(indicator) {
410
- if (typeof indicator === "object") {
411
- return indicator;
412
- }
413
- indicator = indicator | 0;
414
- const traits = {};
415
- let i = 0;
416
- for (const trait of [
417
- "httpLabel",
418
- "idempotent",
419
- "idempotencyToken",
420
- "sensitive",
421
- "httpPayload",
422
- "httpResponseCode",
423
- "httpQueryParams"
424
- ]) {
425
- if ((indicator >> i++ & 1) === 1) {
426
- traits[trait] = 1;
427
- }
428
- }
429
- return traits;
430
- }
431
- __name(translateTraits, "translateTraits");
432
-
433
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js
434
- var NormalizedSchema = class _NormalizedSchema {
435
- static {
436
- __name(this, "NormalizedSchema");
437
- }
438
- ref;
439
- memberName;
440
- static symbol = Symbol.for("@smithy/nor");
441
- symbol = _NormalizedSchema.symbol;
442
- name;
443
- schema;
444
- _isMemberSchema;
445
- traits;
446
- memberTraits;
447
- normalizedTraits;
448
- constructor(ref, memberName) {
449
- this.ref = ref;
450
- this.memberName = memberName;
451
- const traitStack = [];
452
- let _ref = ref;
453
- let schema = ref;
454
- this._isMemberSchema = false;
455
- while (isMemberSchema(_ref)) {
456
- traitStack.push(_ref[1]);
457
- _ref = _ref[0];
458
- schema = deref(_ref);
459
- this._isMemberSchema = true;
460
- }
461
- if (traitStack.length > 0) {
462
- this.memberTraits = {};
463
- for (let i = traitStack.length - 1; i >= 0; --i) {
464
- const traitSet = traitStack[i];
465
- Object.assign(this.memberTraits, translateTraits(traitSet));
466
- }
467
- } else {
468
- this.memberTraits = 0;
469
- }
470
- if (schema instanceof _NormalizedSchema) {
471
- const computedMemberTraits = this.memberTraits;
472
- Object.assign(this, schema);
473
- this.memberTraits = Object.assign({}, computedMemberTraits, schema.getMemberTraits(), this.getMemberTraits());
474
- this.normalizedTraits = void 0;
475
- this.memberName = memberName ?? schema.memberName;
476
- return;
477
- }
478
- this.schema = deref(schema);
479
- if (isStaticSchema(this.schema)) {
480
- this.name = `${this.schema[1]}#${this.schema[2]}`;
481
- this.traits = this.schema[3];
482
- } else {
483
- this.name = this.memberName ?? String(schema);
484
- this.traits = 0;
485
- }
486
- if (this._isMemberSchema && !memberName) {
487
- throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
488
- }
489
- }
490
- static [Symbol.hasInstance](lhs) {
491
- const isPrototype = this.prototype.isPrototypeOf(lhs);
492
- if (!isPrototype && typeof lhs === "object" && lhs !== null) {
493
- const ns = lhs;
494
- return ns.symbol === this.symbol;
495
- }
496
- return isPrototype;
497
- }
498
- static of(ref) {
499
- const sc = deref(ref);
500
- if (sc instanceof _NormalizedSchema) {
501
- return sc;
502
- }
503
- if (isMemberSchema(sc)) {
504
- const [ns, traits] = sc;
505
- if (ns instanceof _NormalizedSchema) {
506
- Object.assign(ns.getMergedTraits(), translateTraits(traits));
507
- return ns;
508
- }
509
- throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
510
- }
511
- return new _NormalizedSchema(sc);
512
- }
513
- getSchema() {
514
- const sc = this.schema;
515
- if (sc[0] === 0) {
516
- return sc[4];
517
- }
518
- return sc;
519
- }
520
- getName(withNamespace = false) {
521
- const { name } = this;
522
- const short = !withNamespace && name && name.includes("#");
523
- return short ? name.split("#")[1] : name || void 0;
524
- }
525
- getMemberName() {
526
- return this.memberName;
527
- }
528
- isMemberSchema() {
529
- return this._isMemberSchema;
530
- }
531
- isListSchema() {
532
- const sc = this.getSchema();
533
- return typeof sc === "number" ? sc >= 64 && sc < 128 : sc[0] === 1;
534
- }
535
- isMapSchema() {
536
- const sc = this.getSchema();
537
- return typeof sc === "number" ? sc >= 128 && sc <= 255 : sc[0] === 2;
538
- }
539
- isStructSchema() {
540
- const sc = this.getSchema();
541
- return sc[0] === 3 || sc[0] === -3;
542
- }
543
- isBlobSchema() {
544
- const sc = this.getSchema();
545
- return sc === 21 || sc === 42;
546
- }
547
- isTimestampSchema() {
548
- const sc = this.getSchema();
549
- return typeof sc === "number" && sc >= 4 && sc <= 7;
550
- }
551
- isUnitSchema() {
552
- return this.getSchema() === "unit";
553
- }
554
- isDocumentSchema() {
555
- return this.getSchema() === 15;
556
- }
557
- isStringSchema() {
558
- return this.getSchema() === 0;
559
- }
560
- isBooleanSchema() {
561
- return this.getSchema() === 2;
562
- }
563
- isNumericSchema() {
564
- return this.getSchema() === 1;
565
- }
566
- isBigIntegerSchema() {
567
- return this.getSchema() === 17;
568
- }
569
- isBigDecimalSchema() {
570
- return this.getSchema() === 19;
571
- }
572
- isStreaming() {
573
- const { streaming } = this.getMergedTraits();
574
- return !!streaming || this.getSchema() === 42;
575
- }
576
- isIdempotencyToken() {
577
- const match = /* @__PURE__ */ __name((traits2) => (traits2 & 4) === 4 || !!traits2?.idempotencyToken, "match");
578
- const { normalizedTraits, traits, memberTraits } = this;
579
- return match(normalizedTraits) || match(traits) || match(memberTraits);
580
- }
581
- getMergedTraits() {
582
- return this.normalizedTraits ?? (this.normalizedTraits = {
583
- ...this.getOwnTraits(),
584
- ...this.getMemberTraits()
585
- });
586
- }
587
- getMemberTraits() {
588
- return translateTraits(this.memberTraits);
589
- }
590
- getOwnTraits() {
591
- return translateTraits(this.traits);
592
- }
593
- getKeySchema() {
594
- const [isDoc, isMap] = [
595
- this.isDocumentSchema(),
596
- this.isMapSchema()
597
- ];
598
- if (!isDoc && !isMap) {
599
- throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
600
- }
601
- const schema = this.getSchema();
602
- const memberSchema = isDoc ? 15 : schema[4] ?? 0;
603
- return member([
604
- memberSchema,
605
- 0
606
- ], "key");
607
- }
608
- getValueSchema() {
609
- const sc = this.getSchema();
610
- const [isDoc, isMap, isList] = [
611
- this.isDocumentSchema(),
612
- this.isMapSchema(),
613
- this.isListSchema()
614
- ];
615
- const memberSchema = typeof sc === "number" ? 63 & sc : sc && typeof sc === "object" && (isMap || isList) ? sc[3 + sc[0]] : isDoc ? 15 : void 0;
616
- if (memberSchema != null) {
617
- return member([
618
- memberSchema,
619
- 0
620
- ], isMap ? "value" : "member");
621
- }
622
- throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
623
- }
624
- getMemberSchema(memberName) {
625
- const struct = this.getSchema();
626
- if (this.isStructSchema() && struct[4].includes(memberName)) {
627
- const i = struct[4].indexOf(memberName);
628
- const memberSchema = struct[5][i];
629
- return member(isMemberSchema(memberSchema) ? memberSchema : [
630
- memberSchema,
631
- 0
632
- ], memberName);
633
- }
634
- if (this.isDocumentSchema()) {
635
- return member([
636
- 15,
637
- 0
638
- ], memberName);
639
- }
640
- throw new Error(`@smithy/core/schema - ${this.getName(true)} has no no member=${memberName}.`);
641
- }
642
- getMemberSchemas() {
643
- const buffer = {};
644
- try {
645
- for (const [k, v] of this.structIterator()) {
646
- buffer[k] = v;
647
- }
648
- } catch (ignored) {
649
- }
650
- return buffer;
651
- }
652
- getEventStreamMember() {
653
- if (this.isStructSchema()) {
654
- for (const [memberName, memberSchema] of this.structIterator()) {
655
- if (memberSchema.isStreaming() && memberSchema.isStructSchema()) {
656
- return memberName;
657
- }
658
- }
659
- }
660
- return "";
661
- }
662
- *structIterator() {
663
- if (this.isUnitSchema()) {
664
- return;
665
- }
666
- if (!this.isStructSchema()) {
667
- throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
668
- }
669
- const struct = this.getSchema();
670
- for (let i = 0; i < struct[4].length; ++i) {
671
- yield [
672
- struct[4][i],
673
- member([
674
- struct[5][i],
675
- 0
676
- ], struct[4][i])
677
- ];
678
- }
679
- }
680
- };
681
- function member(memberSchema, memberName) {
682
- if (memberSchema instanceof NormalizedSchema) {
683
- return Object.assign(memberSchema, {
684
- memberName,
685
- _isMemberSchema: true
686
- });
687
- }
688
- const internalCtorAccess = NormalizedSchema;
689
- return new internalCtorAccess(memberSchema, memberName);
690
- }
691
- __name(member, "member");
692
- var isMemberSchema = /* @__PURE__ */ __name((sc) => Array.isArray(sc) && sc.length === 2, "isMemberSchema");
693
- var isStaticSchema = /* @__PURE__ */ __name((sc) => Array.isArray(sc) && sc.length >= 5, "isStaticSchema");
694
-
695
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/schemaLogFilter.js
696
- var SENSITIVE_STRING = "***SensitiveInformation***";
697
- function schemaLogFilter(schema, data) {
698
- if (data == null) {
699
- return data;
700
- }
701
- const ns = NormalizedSchema.of(schema);
702
- if (ns.getMergedTraits().sensitive) {
703
- return SENSITIVE_STRING;
704
- }
705
- if (ns.isListSchema()) {
706
- const isSensitive = !!ns.getValueSchema().getMergedTraits().sensitive;
707
- if (isSensitive) {
708
- return SENSITIVE_STRING;
709
- }
710
- } else if (ns.isMapSchema()) {
711
- const isSensitive = !!ns.getKeySchema().getMergedTraits().sensitive || !!ns.getValueSchema().getMergedTraits().sensitive;
712
- if (isSensitive) {
713
- return SENSITIVE_STRING;
714
- }
715
- } else if (ns.isStructSchema() && typeof data === "object") {
716
- const object = data;
717
- const newObject = {};
718
- for (const [member2, memberNs] of ns.structIterator()) {
719
- if (object[member2] != null) {
720
- newObject[member2] = schemaLogFilter(memberNs, object[member2]);
721
- }
722
- }
723
- return newObject;
724
- }
725
- return data;
726
- }
727
- __name(schemaLogFilter, "schemaLogFilter");
728
-
729
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/command.js
730
- var Command = class {
731
- static {
732
- __name(this, "Command");
733
- }
734
- middlewareStack = constructStack();
735
- schema;
736
- static classBuilder() {
737
- return new ClassBuilder();
738
- }
739
- resolveMiddlewareWithContext(clientStack, configuration, options, { middlewareFn, clientName, commandName, inputFilterSensitiveLog, outputFilterSensitiveLog, smithyContext, additionalContext, CommandCtor }) {
740
- for (const mw of middlewareFn.bind(this)(CommandCtor, clientStack, configuration, options)) {
741
- this.middlewareStack.use(mw);
742
- }
743
- const stack = clientStack.concat(this.middlewareStack);
744
- const { logger } = configuration;
745
- const handlerExecutionContext = {
746
- logger,
747
- clientName,
748
- commandName,
749
- inputFilterSensitiveLog,
750
- outputFilterSensitiveLog,
751
- [SMITHY_CONTEXT_KEY]: {
752
- commandInstance: this,
753
- ...smithyContext
754
- },
755
- ...additionalContext
756
- };
757
- const { requestHandler } = configuration;
758
- return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
759
- }
760
- };
761
- var ClassBuilder = class ClassBuilder2 {
762
- static {
763
- __name(this, "ClassBuilder");
764
- }
765
- _init = /* @__PURE__ */ __name(() => {
766
- }, "_init");
767
- _ep = {};
768
- _middlewareFn = /* @__PURE__ */ __name(() => [], "_middlewareFn");
769
- _commandName = "";
770
- _clientName = "";
771
- _additionalContext = {};
772
- _smithyContext = {};
773
- _inputFilterSensitiveLog = void 0;
774
- _outputFilterSensitiveLog = void 0;
775
- _serializer = null;
776
- _deserializer = null;
777
- _operationSchema;
778
- init(cb) {
779
- this._init = cb;
780
- }
781
- ep(endpointParameterInstructions) {
782
- this._ep = endpointParameterInstructions;
783
- return this;
784
- }
785
- m(middlewareSupplier) {
786
- this._middlewareFn = middlewareSupplier;
787
- return this;
788
- }
789
- s(service, operation, smithyContext = {}) {
790
- this._smithyContext = {
791
- service,
792
- operation,
793
- ...smithyContext
794
- };
795
- return this;
796
- }
797
- c(additionalContext = {}) {
798
- this._additionalContext = additionalContext;
799
- return this;
800
- }
801
- n(clientName, commandName) {
802
- this._clientName = clientName;
803
- this._commandName = commandName;
804
- return this;
805
- }
806
- f(inputFilter = (_) => _, outputFilter = (_) => _) {
807
- this._inputFilterSensitiveLog = inputFilter;
808
- this._outputFilterSensitiveLog = outputFilter;
809
- return this;
810
- }
811
- ser(serializer) {
812
- this._serializer = serializer;
813
- return this;
814
- }
815
- de(deserializer) {
816
- this._deserializer = deserializer;
817
- return this;
818
- }
819
- sc(operation) {
820
- this._operationSchema = operation;
821
- this._smithyContext.operationSchema = operation;
822
- return this;
823
- }
824
- build() {
825
- const closure = this;
826
- let CommandRef;
827
- return CommandRef = class extends Command {
828
- static {
829
- __name(this, "CommandRef");
830
- }
831
- input;
832
- static getEndpointParameterInstructions() {
833
- return closure._ep;
834
- }
835
- constructor(...[input]) {
836
- super();
837
- this.input = input ?? {};
838
- closure._init(this);
839
- this.schema = closure._operationSchema;
840
- }
841
- resolveMiddleware(stack, configuration, options) {
842
- const op = closure._operationSchema;
843
- const input = op?.[4] ?? op?.input;
844
- const output = op?.[5] ?? op?.output;
845
- return this.resolveMiddlewareWithContext(stack, configuration, options, {
846
- CommandCtor: CommandRef,
847
- middlewareFn: closure._middlewareFn,
848
- clientName: closure._clientName,
849
- commandName: closure._commandName,
850
- inputFilterSensitiveLog: closure._inputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, input) : (_) => _),
851
- outputFilterSensitiveLog: closure._outputFilterSensitiveLog ?? (op ? schemaLogFilter.bind(null, output) : (_) => _),
852
- smithyContext: closure._smithyContext,
853
- additionalContext: closure._additionalContext
854
- });
855
- }
856
- serialize = closure._serializer;
857
- deserialize = closure._deserializer;
858
- };
859
- }
860
- };
861
-
862
- // ../../node_modules/.pnpm/@aws-sdk+middleware-host-header@3.873.0/node_modules/@aws-sdk/middleware-host-header/dist-es/index.js
863
- init_esm_shims();
864
- function resolveHostHeaderConfig(input) {
865
- return input;
866
- }
867
- __name(resolveHostHeaderConfig, "resolveHostHeaderConfig");
868
- var hostHeaderMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
869
- if (!HttpRequest.isInstance(args.request)) return next(args);
870
- const { request } = args;
871
- const { handlerProtocol = "" } = options.requestHandler.metadata || {};
872
- if (handlerProtocol.indexOf("h2") >= 0 && !request.headers[":authority"]) {
873
- delete request.headers["host"];
874
- request.headers[":authority"] = request.hostname + (request.port ? ":" + request.port : "");
875
- } else if (!request.headers["host"]) {
876
- let host = request.hostname;
877
- if (request.port != null) host += `:${request.port}`;
878
- request.headers["host"] = host;
879
- }
880
- return next(args);
881
- }, "hostHeaderMiddleware");
882
- var hostHeaderMiddlewareOptions = {
883
- name: "hostHeaderMiddleware",
884
- step: "build",
885
- priority: "low",
886
- tags: [
887
- "HOST"
888
- ],
889
- override: true
890
- };
891
- var getHostHeaderPlugin = /* @__PURE__ */ __name((options) => ({
892
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
893
- clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);
894
- }, "applyToStack")
895
- }), "getHostHeaderPlugin");
896
-
897
- // ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.876.0/node_modules/@aws-sdk/middleware-logger/dist-es/loggerMiddleware.js
898
- init_esm_shims();
899
- var loggerMiddleware = /* @__PURE__ */ __name(() => (next, context) => async (args) => {
900
- try {
901
- const response = await next(args);
902
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
903
- const { overrideInputFilterSensitiveLog, overrideOutputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
904
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
905
- const outputFilterSensitiveLog = overrideOutputFilterSensitiveLog ?? context.outputFilterSensitiveLog;
906
- const { $metadata, ...outputWithoutMetadata } = response.output;
907
- logger?.info?.({
908
- clientName,
909
- commandName,
910
- input: inputFilterSensitiveLog(args.input),
911
- output: outputFilterSensitiveLog(outputWithoutMetadata),
912
- metadata: $metadata
913
- });
914
- return response;
915
- } catch (error) {
916
- const { clientName, commandName, logger, dynamoDbDocumentClientOptions = {} } = context;
917
- const { overrideInputFilterSensitiveLog } = dynamoDbDocumentClientOptions;
918
- const inputFilterSensitiveLog = overrideInputFilterSensitiveLog ?? context.inputFilterSensitiveLog;
919
- logger?.error?.({
920
- clientName,
921
- commandName,
922
- input: inputFilterSensitiveLog(args.input),
923
- error,
924
- metadata: error.$metadata
925
- });
926
- throw error;
927
- }
928
- }, "loggerMiddleware");
929
- var loggerMiddlewareOptions = {
930
- name: "loggerMiddleware",
931
- tags: [
932
- "LOGGER"
933
- ],
934
- step: "initialize",
935
- override: true
936
- };
937
- var getLoggerPlugin = /* @__PURE__ */ __name((options) => ({
938
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
939
- clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);
940
- }, "applyToStack")
941
- }), "getLoggerPlugin");
942
-
943
- // ../../node_modules/.pnpm/@aws-sdk+middleware-logger@3.876.0/node_modules/@aws-sdk/middleware-logger/dist-es/index.js
944
- init_esm_shims();
945
-
946
- // ../../node_modules/.pnpm/@aws-sdk+middleware-recursion-detection@3.873.0/node_modules/@aws-sdk/middleware-recursion-detection/dist-es/index.js
947
- init_esm_shims();
948
- var TRACE_ID_HEADER_NAME = "X-Amzn-Trace-Id";
949
- var ENV_LAMBDA_FUNCTION_NAME = "AWS_LAMBDA_FUNCTION_NAME";
950
- var ENV_TRACE_ID = "_X_AMZN_TRACE_ID";
951
- var recursionDetectionMiddleware = /* @__PURE__ */ __name((options) => (next) => async (args) => {
952
- const { request } = args;
953
- if (!HttpRequest.isInstance(request) || options.runtime !== "node") {
954
- return next(args);
955
- }
956
- const traceIdHeader = Object.keys(request.headers ?? {}).find((h) => h.toLowerCase() === TRACE_ID_HEADER_NAME.toLowerCase()) ?? TRACE_ID_HEADER_NAME;
957
- if (request.headers.hasOwnProperty(traceIdHeader)) {
958
- return next(args);
959
- }
960
- const functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];
961
- const traceId = process.env[ENV_TRACE_ID];
962
- const nonEmptyString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0, "nonEmptyString");
963
- if (nonEmptyString(functionName) && nonEmptyString(traceId)) {
964
- request.headers[TRACE_ID_HEADER_NAME] = traceId;
965
- }
966
- return next({
967
- ...args,
968
- request
969
- });
970
- }, "recursionDetectionMiddleware");
971
- var addRecursionDetectionMiddlewareOptions = {
972
- step: "build",
973
- tags: [
974
- "RECURSION_DETECTION"
975
- ],
976
- name: "recursionDetectionMiddleware",
977
- override: true,
978
- priority: "low"
979
- };
980
- var getRecursionDetectionPlugin = /* @__PURE__ */ __name((options) => ({
981
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
982
- clientStack.add(recursionDetectionMiddleware(options), addRecursionDetectionMiddlewareOptions);
983
- }, "applyToStack")
984
- }), "getRecursionDetectionPlugin");
985
-
986
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
987
- init_esm_shims();
988
-
989
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
990
- init_esm_shims();
991
-
992
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/resolveAuthOptions.js
993
- init_esm_shims();
994
- var resolveAuthOptions = /* @__PURE__ */ __name((candidateAuthOptions, authSchemePreference) => {
995
- if (!authSchemePreference || authSchemePreference.length === 0) {
996
- return candidateAuthOptions;
997
- }
998
- const preferredAuthOptions = [];
999
- for (const preferredSchemeName of authSchemePreference) {
1000
- for (const candidateAuthOption of candidateAuthOptions) {
1001
- const candidateAuthSchemeName = candidateAuthOption.schemeId.split("#")[1];
1002
- if (candidateAuthSchemeName === preferredSchemeName) {
1003
- preferredAuthOptions.push(candidateAuthOption);
1004
- }
1005
- }
1006
- }
1007
- for (const candidateAuthOption of candidateAuthOptions) {
1008
- if (!preferredAuthOptions.find(({ schemeId }) => schemeId === candidateAuthOption.schemeId)) {
1009
- preferredAuthOptions.push(candidateAuthOption);
1010
- }
1011
- }
1012
- return preferredAuthOptions;
1013
- }, "resolveAuthOptions");
1014
-
1015
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js
1016
- function convertHttpAuthSchemesToMap(httpAuthSchemes) {
1017
- const map = /* @__PURE__ */ new Map();
1018
- for (const scheme of httpAuthSchemes) {
1019
- map.set(scheme.schemeId, scheme);
1020
- }
1021
- return map;
1022
- }
1023
- __name(convertHttpAuthSchemesToMap, "convertHttpAuthSchemesToMap");
1024
- var httpAuthSchemeMiddleware = /* @__PURE__ */ __name((config, mwOptions) => (next, context) => async (args) => {
1025
- const options = config.httpAuthSchemeProvider(await mwOptions.httpAuthSchemeParametersProvider(config, context, args.input));
1026
- const authSchemePreference = config.authSchemePreference ? await config.authSchemePreference() : [];
1027
- const resolvedOptions = resolveAuthOptions(options, authSchemePreference);
1028
- const authSchemes = convertHttpAuthSchemesToMap(config.httpAuthSchemes);
1029
- const smithyContext = getSmithyContext(context);
1030
- const failureReasons = [];
1031
- for (const option of resolvedOptions) {
1032
- const scheme = authSchemes.get(option.schemeId);
1033
- if (!scheme) {
1034
- failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` was not enabled for this service.`);
1035
- continue;
1036
- }
1037
- const identityProvider = scheme.identityProvider(await mwOptions.identityProviderConfigProvider(config));
1038
- if (!identityProvider) {
1039
- failureReasons.push(`HttpAuthScheme \`${option.schemeId}\` did not have an IdentityProvider configured.`);
1040
- continue;
1041
- }
1042
- const { identityProperties = {}, signingProperties = {} } = option.propertiesExtractor?.(config, context) || {};
1043
- option.identityProperties = Object.assign(option.identityProperties || {}, identityProperties);
1044
- option.signingProperties = Object.assign(option.signingProperties || {}, signingProperties);
1045
- smithyContext.selectedHttpAuthScheme = {
1046
- httpAuthOption: option,
1047
- identity: await identityProvider(option.identityProperties),
1048
- signer: scheme.signer
1049
- };
1050
- break;
1051
- }
1052
- if (!smithyContext.selectedHttpAuthScheme) {
1053
- throw new Error(failureReasons.join("\n"));
1054
- }
1055
- return next(args);
1056
- }, "httpAuthSchemeMiddleware");
1057
-
1058
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js
1059
- var httpAuthSchemeEndpointRuleSetMiddlewareOptions = {
1060
- step: "serialize",
1061
- tags: [
1062
- "HTTP_AUTH_SCHEME"
1063
- ],
1064
- name: "httpAuthSchemeMiddleware",
1065
- override: true,
1066
- relation: "before",
1067
- toMiddleware: "endpointV2Middleware"
1068
- };
1069
- var getHttpAuthSchemeEndpointRuleSetPlugin = /* @__PURE__ */ __name((config, { httpAuthSchemeParametersProvider, identityProviderConfigProvider }) => ({
1070
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
1071
- clientStack.addRelativeTo(httpAuthSchemeMiddleware(config, {
1072
- httpAuthSchemeParametersProvider,
1073
- identityProviderConfigProvider
1074
- }), httpAuthSchemeEndpointRuleSetMiddlewareOptions);
1075
- }, "applyToStack")
1076
- }), "getHttpAuthSchemeEndpointRuleSetPlugin");
1077
-
1078
- // ../../node_modules/.pnpm/@smithy+middleware-serde@4.2.6/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js
1079
- init_esm_shims();
1080
-
1081
- // ../../node_modules/.pnpm/@smithy+middleware-serde@4.2.6/node_modules/@smithy/middleware-serde/dist-es/deserializerMiddleware.js
1082
- init_esm_shims();
1083
- var deserializerMiddleware = /* @__PURE__ */ __name((options, deserializer) => (next, context) => async (args) => {
1084
- const { response } = await next(args);
1085
- try {
1086
- const parsed = await deserializer(response, options);
1087
- return {
1088
- response,
1089
- output: parsed
1090
- };
1091
- } catch (error) {
1092
- Object.defineProperty(error, "$response", {
1093
- value: response,
1094
- enumerable: false,
1095
- writable: false,
1096
- configurable: false
1097
- });
1098
- if (!("$metadata" in error)) {
1099
- const hint = `Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`;
1100
- try {
1101
- error.message += "\n " + hint;
1102
- } catch (e) {
1103
- if (!context.logger || context.logger?.constructor?.name === "NoOpLogger") {
1104
- console.warn(hint);
1105
- } else {
1106
- context.logger?.warn?.(hint);
1107
- }
1108
- }
1109
- if (typeof error.$responseBodyText !== "undefined") {
1110
- if (error.$response) {
1111
- error.$response.body = error.$responseBodyText;
1112
- }
1113
- }
1114
- try {
1115
- if (HttpResponse.isInstance(response)) {
1116
- const { headers = {} } = response;
1117
- const headerEntries = Object.entries(headers);
1118
- error.$metadata = {
1119
- httpStatusCode: response.statusCode,
1120
- requestId: findHeader(/^x-[\w-]+-request-?id$/, headerEntries),
1121
- extendedRequestId: findHeader(/^x-[\w-]+-id-2$/, headerEntries),
1122
- cfId: findHeader(/^x-[\w-]+-cf-id$/, headerEntries)
1123
- };
1124
- }
1125
- } catch (e) {
1126
- }
1127
- }
1128
- throw error;
1129
- }
1130
- }, "deserializerMiddleware");
1131
- var findHeader = /* @__PURE__ */ __name((pattern, headers) => {
1132
- return (headers.find(([k]) => {
1133
- return k.match(pattern);
1134
- }) || [
1135
- void 0,
1136
- void 0
1137
- ])[1];
1138
- }, "findHeader");
1139
-
1140
- // ../../node_modules/.pnpm/@smithy+middleware-serde@4.2.6/node_modules/@smithy/middleware-serde/dist-es/serializerMiddleware.js
1141
- init_esm_shims();
1142
- var serializerMiddleware = /* @__PURE__ */ __name((options, serializer) => (next, context) => async (args) => {
1143
- const endpointConfig = options;
1144
- const endpoint = context.endpointV2?.url && endpointConfig.urlParser ? async () => endpointConfig.urlParser(context.endpointV2.url) : endpointConfig.endpoint;
1145
- if (!endpoint) {
1146
- throw new Error("No valid endpoint provider available.");
1147
- }
1148
- const request = await serializer(args.input, {
1149
- ...options,
1150
- endpoint
1151
- });
1152
- return next({
1153
- ...args,
1154
- request
1155
- });
1156
- }, "serializerMiddleware");
1157
-
1158
- // ../../node_modules/.pnpm/@smithy+middleware-serde@4.2.6/node_modules/@smithy/middleware-serde/dist-es/serdePlugin.js
1159
- var deserializerMiddlewareOption = {
1160
- name: "deserializerMiddleware",
1161
- step: "deserialize",
1162
- tags: [
1163
- "DESERIALIZER"
1164
- ],
1165
- override: true
1166
- };
1167
- var serializerMiddlewareOption = {
1168
- name: "serializerMiddleware",
1169
- step: "serialize",
1170
- tags: [
1171
- "SERIALIZER"
1172
- ],
1173
- override: true
1174
- };
1175
- function getSerdePlugin(config, serializer, deserializer) {
1176
- return {
1177
- applyToStack: /* @__PURE__ */ __name((commandStack) => {
1178
- commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);
1179
- commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);
1180
- }, "applyToStack")
1181
- };
1182
- }
1183
- __name(getSerdePlugin, "getSerdePlugin");
1184
-
1185
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js
1186
- init_esm_shims();
1187
-
1188
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-signing/httpSigningMiddleware.js
1189
- init_esm_shims();
1190
- var defaultErrorHandler = /* @__PURE__ */ __name((signingProperties) => (error) => {
1191
- throw error;
1192
- }, "defaultErrorHandler");
1193
- var defaultSuccessHandler = /* @__PURE__ */ __name((httpResponse, signingProperties) => {
1194
- }, "defaultSuccessHandler");
1195
- var httpSigningMiddleware = /* @__PURE__ */ __name((config) => (next, context) => async (args) => {
1196
- if (!HttpRequest.isInstance(args.request)) {
1197
- return next(args);
1198
- }
1199
- const smithyContext = getSmithyContext(context);
1200
- const scheme = smithyContext.selectedHttpAuthScheme;
1201
- if (!scheme) {
1202
- throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
1203
- }
1204
- const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
1205
- const output = await next({
1206
- ...args,
1207
- request: await signer.sign(args.request, identity, signingProperties)
1208
- }).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
1209
- (signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
1210
- return output;
1211
- }, "httpSigningMiddleware");
1212
-
1213
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/middleware-http-signing/getHttpSigningMiddleware.js
1214
- var httpSigningMiddlewareOptions = {
1215
- step: "finalizeRequest",
1216
- tags: [
1217
- "HTTP_SIGNING"
1218
- ],
1219
- name: "httpSigningMiddleware",
1220
- aliases: [
1221
- "apiKeyMiddleware",
1222
- "tokenMiddleware",
1223
- "awsAuthMiddleware"
1224
- ],
1225
- override: true,
1226
- relation: "after",
1227
- toMiddleware: "retryMiddleware"
1228
- };
1229
- var getHttpSigningPlugin = /* @__PURE__ */ __name((config) => ({
1230
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
1231
- clientStack.addRelativeTo(httpSigningMiddleware(config), httpSigningMiddlewareOptions);
1232
- }, "applyToStack")
1233
- }), "getHttpSigningPlugin");
1234
-
1235
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/util-identity-and-auth/DefaultIdentityProviderConfig.js
1236
- init_esm_shims();
1237
- var DefaultIdentityProviderConfig = class {
1238
- static {
1239
- __name(this, "DefaultIdentityProviderConfig");
1240
- }
1241
- authSchemes = /* @__PURE__ */ new Map();
1242
- constructor(config) {
1243
- for (const [key, value] of Object.entries(config)) {
1244
- if (value !== void 0) {
1245
- this.authSchemes.set(key, value);
1246
- }
1247
- }
1248
- }
1249
- getIdentityProvider(schemeId) {
1250
- return this.authSchemes.get(schemeId);
1251
- }
1252
- };
1253
-
1254
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
1255
- init_esm_shims();
1256
-
1257
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/normalizeProvider.js
1258
- init_esm_shims();
1259
- var normalizeProvider2 = /* @__PURE__ */ __name((input) => {
1260
- if (typeof input === "function") return input;
1261
- const promisified = Promise.resolve(input);
1262
- return () => promisified;
1263
- }, "normalizeProvider");
1264
-
1265
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
1266
- init_esm_shims();
1267
-
1268
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.6/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
1269
- init_esm_shims();
1270
-
1271
- // ../../node_modules/.pnpm/@smithy+util-utf8@4.2.0/node_modules/@smithy/util-utf8/dist-es/toUint8Array.js
1272
- init_esm_shims();
1273
- var toUint8Array = /* @__PURE__ */ __name((data) => {
1274
- if (typeof data === "string") {
1275
- return fromUtf8(data);
1276
- }
1277
- if (ArrayBuffer.isView(data)) {
1278
- return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
1279
- }
1280
- return new Uint8Array(data);
1281
- }, "toUint8Array");
1282
-
1283
- // ../../node_modules/.pnpm/@smithy+util-stream@4.5.6/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js
1284
- var Uint8ArrayBlobAdapter = class _Uint8ArrayBlobAdapter extends Uint8Array {
1285
- static {
1286
- __name(this, "Uint8ArrayBlobAdapter");
1287
- }
1288
- static fromString(source, encoding = "utf-8") {
1289
- if (typeof source === "string") {
1290
- if (encoding === "base64") {
1291
- return _Uint8ArrayBlobAdapter.mutate(fromBase64(source));
1292
- }
1293
- return _Uint8ArrayBlobAdapter.mutate(fromUtf8(source));
1294
- }
1295
- throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
1296
- }
1297
- static mutate(source) {
1298
- Object.setPrototypeOf(source, _Uint8ArrayBlobAdapter.prototype);
1299
- return source;
1300
- }
1301
- transformToString(encoding = "utf-8") {
1302
- if (encoding === "base64") {
1303
- return toBase64(this);
1304
- }
1305
- return toUtf8(this);
1306
- }
1307
- };
1308
-
1309
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
1310
- var collectBody = /* @__PURE__ */ __name(async (streamBody = new Uint8Array(), context) => {
1311
- if (streamBody instanceof Uint8Array) {
1312
- return Uint8ArrayBlobAdapter.mutate(streamBody);
1313
- }
1314
- if (!streamBody) {
1315
- return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
1316
- }
1317
- const fromContext = context.streamCollector(streamBody);
1318
- return Uint8ArrayBlobAdapter.mutate(await fromContext);
1319
- }, "collectBody");
1320
-
1321
- // ../../node_modules/.pnpm/@smithy+uuid@1.1.0/node_modules/@smithy/uuid/dist-es/v4.js
1322
- init_esm_shims();
1323
-
1324
- // ../../node_modules/.pnpm/@smithy+uuid@1.1.0/node_modules/@smithy/uuid/dist-es/randomUUID.js
1325
- init_esm_shims();
1326
- var randomUUID = crypto2.randomUUID.bind(crypto2);
1327
-
1328
- // ../../node_modules/.pnpm/@smithy+uuid@1.1.0/node_modules/@smithy/uuid/dist-es/v4.js
1329
- var decimalToHex = Array.from({
1330
- length: 256
1331
- }, (_, i) => i.toString(16).padStart(2, "0"));
1332
- var v4 = /* @__PURE__ */ __name(() => {
1333
- if (randomUUID) {
1334
- return randomUUID();
1335
- }
1336
- const rnds = new Uint8Array(16);
1337
- crypto.getRandomValues(rnds);
1338
- rnds[6] = rnds[6] & 15 | 64;
1339
- rnds[8] = rnds[8] & 63 | 128;
1340
- return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]];
1341
- }, "v4");
1342
-
1343
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/setFeature.js
1344
- init_esm_shims();
1345
- function setFeature(context, feature, value) {
1346
- if (!context.__smithy_context) {
1347
- context.__smithy_context = {
1348
- features: {}
1349
- };
1350
- } else if (!context.__smithy_context.features) {
1351
- context.__smithy_context.features = {};
1352
- }
1353
- context.__smithy_context.features[feature] = value;
1354
- }
1355
- __name(setFeature, "setFeature");
1356
-
1357
- // ../../node_modules/.pnpm/@smithy+core@3.18.5/node_modules/@smithy/core/dist-es/util-identity-and-auth/memoizeIdentityProvider.js
1358
- init_esm_shims();
1359
- var createIsIdentityExpiredFunction = /* @__PURE__ */ __name((expirationMs) => /* @__PURE__ */ __name(function isIdentityExpired2(identity) {
1360
- return doesIdentityRequireRefresh(identity) && identity.expiration.getTime() - Date.now() < expirationMs;
1361
- }, "isIdentityExpired"), "createIsIdentityExpiredFunction");
1362
- var EXPIRATION_MS = 3e5;
1363
- var isIdentityExpired = createIsIdentityExpiredFunction(EXPIRATION_MS);
1364
- var doesIdentityRequireRefresh = /* @__PURE__ */ __name((identity) => identity.expiration !== void 0, "doesIdentityRequireRefresh");
1365
- var memoizeIdentityProvider = /* @__PURE__ */ __name((provider, isExpired, requiresRefresh) => {
1366
- if (provider === void 0) {
1367
- return void 0;
1368
- }
1369
- const normalizedProvider = typeof provider !== "function" ? async () => Promise.resolve(provider) : provider;
1370
- let resolved;
1371
- let pending;
1372
- let hasResult;
1373
- let isConstant = false;
1374
- const coalesceProvider = /* @__PURE__ */ __name(async (options) => {
1375
- if (!pending) {
1376
- pending = normalizedProvider(options);
1377
- }
1378
- try {
1379
- resolved = await pending;
1380
- hasResult = true;
1381
- isConstant = false;
1382
- } finally {
1383
- pending = void 0;
1384
- }
1385
- return resolved;
1386
- }, "coalesceProvider");
1387
- if (isExpired === void 0) {
1388
- return async (options) => {
1389
- if (!hasResult || options?.forceRefresh) {
1390
- resolved = await coalesceProvider(options);
1391
- }
1392
- return resolved;
1393
- };
1394
- }
1395
- return async (options) => {
1396
- if (!hasResult || options?.forceRefresh) {
1397
- resolved = await coalesceProvider(options);
1398
- }
1399
- if (isConstant) {
1400
- return resolved;
1401
- }
1402
- if (!requiresRefresh(resolved)) {
1403
- isConstant = true;
1404
- return resolved;
1405
- }
1406
- if (isExpired(resolved)) {
1407
- await coalesceProvider(options);
1408
- return resolved;
1409
- }
1410
- return resolved;
1411
- };
1412
- }, "memoizeIdentityProvider");
1413
-
1414
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/configurations.js
1415
- var DEFAULT_UA_APP_ID = void 0;
1416
- function isValidUserAgentAppId(appId) {
1417
- if (appId === void 0) {
1418
- return true;
1419
- }
1420
- return typeof appId === "string" && appId.length <= 50;
1421
- }
1422
- __name(isValidUserAgentAppId, "isValidUserAgentAppId");
1423
- function resolveUserAgentConfig(input) {
1424
- const normalizedAppIdProvider = normalizeProvider2(input.userAgentAppId ?? DEFAULT_UA_APP_ID);
1425
- const { customUserAgent } = input;
1426
- return Object.assign(input, {
1427
- customUserAgent: typeof customUserAgent === "string" ? [
1428
- [
1429
- customUserAgent
1430
- ]
1431
- ] : customUserAgent,
1432
- userAgentAppId: /* @__PURE__ */ __name(async () => {
1433
- const appId = await normalizedAppIdProvider();
1434
- if (!isValidUserAgentAppId(appId)) {
1435
- const logger = input.logger?.constructor?.name === "NoOpLogger" || !input.logger ? console : input.logger;
1436
- if (typeof appId !== "string") {
1437
- logger?.warn("userAgentAppId must be a string or undefined.");
1438
- } else if (appId.length > 50) {
1439
- logger?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.");
1440
- }
1441
- }
1442
- return appId;
1443
- }, "userAgentAppId")
1444
- });
1445
- }
1446
- __name(resolveUserAgentConfig, "resolveUserAgentConfig");
1447
-
1448
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/exceptions.js
1449
- init_esm_shims();
1450
- var ServiceException = class _ServiceException extends Error {
1451
- static {
1452
- __name(this, "ServiceException");
1453
- }
1454
- $fault;
1455
- $response;
1456
- $retryable;
1457
- $metadata;
1458
- constructor(options) {
1459
- super(options.message);
1460
- Object.setPrototypeOf(this, Object.getPrototypeOf(this).constructor.prototype);
1461
- this.name = options.name;
1462
- this.$fault = options.$fault;
1463
- this.$metadata = options.$metadata;
1464
- }
1465
- static isInstance(value) {
1466
- if (!value) return false;
1467
- const candidate = value;
1468
- return _ServiceException.prototype.isPrototypeOf(candidate) || Boolean(candidate.$fault) && Boolean(candidate.$metadata) && (candidate.$fault === "client" || candidate.$fault === "server");
1469
- }
1470
- static [Symbol.hasInstance](instance) {
1471
- if (!instance) return false;
1472
- const candidate = instance;
1473
- if (this === _ServiceException) {
1474
- return _ServiceException.isInstance(instance);
1475
- }
1476
- if (_ServiceException.isInstance(instance)) {
1477
- if (candidate.name && this.name) {
1478
- return this.prototype.isPrototypeOf(instance) || candidate.name === this.name;
1479
- }
1480
- return this.prototype.isPrototypeOf(instance);
1481
- }
1482
- return false;
1483
- }
1484
- };
1485
- var decorateServiceException = /* @__PURE__ */ __name((exception, additions = {}) => {
1486
- Object.entries(additions).filter(([, v]) => v !== void 0).forEach(([k, v]) => {
1487
- if (exception[k] == void 0 || exception[k] === "") {
1488
- exception[k] = v;
1489
- }
1490
- });
1491
- const message = exception.message || exception.Message || "UnknownError";
1492
- exception.message = message;
1493
- delete exception.Message;
1494
- return exception;
1495
- }, "decorateServiceException");
1496
-
1497
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
1498
- init_esm_shims();
1499
-
1500
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/index.js
1501
- init_esm_shims();
1502
-
1503
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
1504
- init_esm_shims();
1505
-
1506
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js
1507
- init_esm_shims();
1508
- var EndpointCache = class {
1509
- static {
1510
- __name(this, "EndpointCache");
1511
- }
1512
- capacity;
1513
- data = /* @__PURE__ */ new Map();
1514
- parameters = [];
1515
- constructor({ size, params }) {
1516
- this.capacity = size ?? 50;
1517
- if (params) {
1518
- this.parameters = params;
1519
- }
1520
- }
1521
- get(endpointParams, resolver) {
1522
- const key = this.hash(endpointParams);
1523
- if (key === false) {
1524
- return resolver();
1525
- }
1526
- if (!this.data.has(key)) {
1527
- if (this.data.size > this.capacity + 10) {
1528
- const keys = this.data.keys();
1529
- let i = 0;
1530
- while (true) {
1531
- const { value, done } = keys.next();
1532
- this.data.delete(value);
1533
- if (done || ++i > 10) {
1534
- break;
1535
- }
1536
- }
1537
- }
1538
- this.data.set(key, resolver());
1539
- }
1540
- return this.data.get(key);
1541
- }
1542
- size() {
1543
- return this.data.size;
1544
- }
1545
- hash(endpointParams) {
1546
- let buffer = "";
1547
- const { parameters } = this;
1548
- if (parameters.length === 0) {
1549
- return false;
1550
- }
1551
- for (const param of parameters) {
1552
- const val = String(endpointParams[param] ?? "");
1553
- if (val.includes("|;")) {
1554
- return false;
1555
- }
1556
- buffer += val + "|;";
1557
- }
1558
- return buffer;
1559
- }
1560
- };
1561
-
1562
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/isIpAddress.js
1563
- init_esm_shims();
1564
- 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}$`);
1565
- var isIpAddress = /* @__PURE__ */ __name((value) => IP_V4_REGEX.test(value) || value.startsWith("[") && value.endsWith("]"), "isIpAddress");
1566
-
1567
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/isValidHostLabel.js
1568
- init_esm_shims();
1569
- var VALID_HOST_LABEL_REGEX = new RegExp(`^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$`);
1570
- var isValidHostLabel = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
1571
- if (!allowSubDomains) {
1572
- return VALID_HOST_LABEL_REGEX.test(value);
1573
- }
1574
- const labels = value.split(".");
1575
- for (const label of labels) {
1576
- if (!isValidHostLabel(label)) {
1577
- return false;
1578
- }
1579
- }
1580
- return true;
1581
- }, "isValidHostLabel");
1582
-
1583
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/customEndpointFunctions.js
1584
- init_esm_shims();
1585
- var customEndpointFunctions = {};
1586
-
1587
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js
1588
- init_esm_shims();
1589
-
1590
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/debug/debugId.js
1591
- init_esm_shims();
1592
- var debugId = "endpoints";
1593
-
1594
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/debug/toDebugString.js
1595
- init_esm_shims();
1596
- function toDebugString(input) {
1597
- if (typeof input !== "object" || input == null) {
1598
- return input;
1599
- }
1600
- if ("ref" in input) {
1601
- return `$${toDebugString(input.ref)}`;
1602
- }
1603
- if ("fn" in input) {
1604
- return `${input.fn}(${(input.argv || []).map(toDebugString).join(", ")})`;
1605
- }
1606
- return JSON.stringify(input, null, 2);
1607
- }
1608
- __name(toDebugString, "toDebugString");
1609
-
1610
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/types/EndpointError.js
1611
- init_esm_shims();
1612
- var EndpointError = class extends Error {
1613
- static {
1614
- __name(this, "EndpointError");
1615
- }
1616
- constructor(message) {
1617
- super(message);
1618
- this.name = "EndpointError";
1619
- }
1620
- };
1621
-
1622
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js
1623
- init_esm_shims();
1624
-
1625
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js
1626
- init_esm_shims();
1627
-
1628
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js
1629
- init_esm_shims();
1630
-
1631
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/callFunction.js
1632
- init_esm_shims();
1633
-
1634
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
1635
- init_esm_shims();
1636
-
1637
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js
1638
- init_esm_shims();
1639
-
1640
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/booleanEquals.js
1641
- init_esm_shims();
1642
- var booleanEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "booleanEquals");
1643
-
1644
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js
1645
- init_esm_shims();
1646
-
1647
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/getAttrPathList.js
1648
- init_esm_shims();
1649
- var getAttrPathList = /* @__PURE__ */ __name((path) => {
1650
- const parts = path.split(".");
1651
- const pathList = [];
1652
- for (const part of parts) {
1653
- const squareBracketIndex = part.indexOf("[");
1654
- if (squareBracketIndex !== -1) {
1655
- if (part.indexOf("]") !== part.length - 1) {
1656
- throw new EndpointError(`Path: '${path}' does not end with ']'`);
1657
- }
1658
- const arrayIndex = part.slice(squareBracketIndex + 1, -1);
1659
- if (Number.isNaN(parseInt(arrayIndex))) {
1660
- throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
1661
- }
1662
- if (squareBracketIndex !== 0) {
1663
- pathList.push(part.slice(0, squareBracketIndex));
1664
- }
1665
- pathList.push(arrayIndex);
1666
- } else {
1667
- pathList.push(part);
1668
- }
1669
- }
1670
- return pathList;
1671
- }, "getAttrPathList");
1672
-
1673
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js
1674
- var getAttr = /* @__PURE__ */ __name((value, path) => getAttrPathList(path).reduce((acc, index) => {
1675
- if (typeof acc !== "object") {
1676
- throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
1677
- } else if (Array.isArray(acc)) {
1678
- return acc[parseInt(index)];
1679
- }
1680
- return acc[index];
1681
- }, value), "getAttr");
1682
-
1683
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/isSet.js
1684
- init_esm_shims();
1685
- var isSet = /* @__PURE__ */ __name((value) => value != null, "isSet");
1686
-
1687
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/not.js
1688
- init_esm_shims();
1689
- var not = /* @__PURE__ */ __name((value) => !value, "not");
1690
-
1691
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/parseURL.js
1692
- init_esm_shims();
1693
- var DEFAULT_PORTS = {
1694
- [EndpointURLScheme.HTTP]: 80,
1695
- [EndpointURLScheme.HTTPS]: 443
1696
- };
1697
- var parseURL = /* @__PURE__ */ __name((value) => {
1698
- const whatwgURL = (() => {
1699
- try {
1700
- if (value instanceof URL) {
1701
- return value;
1702
- }
1703
- if (typeof value === "object" && "hostname" in value) {
1704
- const { hostname: hostname2, port, protocol: protocol2 = "", path = "", query = {} } = value;
1705
- const url = new URL(`${protocol2}//${hostname2}${port ? `:${port}` : ""}${path}`);
1706
- url.search = Object.entries(query).map(([k, v]) => `${k}=${v}`).join("&");
1707
- return url;
1708
- }
1709
- return new URL(value);
1710
- } catch (error) {
1711
- return null;
1712
- }
1713
- })();
1714
- if (!whatwgURL) {
1715
- console.error(`Unable to parse ${JSON.stringify(value)} as a whatwg URL.`);
1716
- return null;
1717
- }
1718
- const urlString = whatwgURL.href;
1719
- const { host, hostname, pathname, protocol, search } = whatwgURL;
1720
- if (search) {
1721
- return null;
1722
- }
1723
- const scheme = protocol.slice(0, -1);
1724
- if (!Object.values(EndpointURLScheme).includes(scheme)) {
1725
- return null;
1726
- }
1727
- const isIp = isIpAddress(hostname);
1728
- const inputContainsDefaultPort = urlString.includes(`${host}:${DEFAULT_PORTS[scheme]}`) || typeof value === "string" && value.includes(`${host}:${DEFAULT_PORTS[scheme]}`);
1729
- const authority = `${host}${inputContainsDefaultPort ? `:${DEFAULT_PORTS[scheme]}` : ``}`;
1730
- return {
1731
- scheme,
1732
- authority,
1733
- path: pathname,
1734
- normalizedPath: pathname.endsWith("/") ? pathname : `${pathname}/`,
1735
- isIp
1736
- };
1737
- }, "parseURL");
1738
-
1739
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/stringEquals.js
1740
- init_esm_shims();
1741
- var stringEquals = /* @__PURE__ */ __name((value1, value2) => value1 === value2, "stringEquals");
1742
-
1743
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/substring.js
1744
- init_esm_shims();
1745
- var substring = /* @__PURE__ */ __name((input, start, stop, reverse) => {
1746
- if (start >= stop || input.length < stop) {
1747
- return null;
1748
- }
1749
- if (!reverse) {
1750
- return input.substring(start, stop);
1751
- }
1752
- return input.substring(input.length - stop, input.length - start);
1753
- }, "substring");
1754
-
1755
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/lib/uriEncode.js
1756
- init_esm_shims();
1757
- var uriEncode = /* @__PURE__ */ __name((value) => encodeURIComponent(value).replace(/[!*'()]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`), "uriEncode");
1758
-
1759
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/endpointFunctions.js
1760
- var endpointFunctions = {
1761
- booleanEquals,
1762
- getAttr,
1763
- isSet,
1764
- isValidHostLabel,
1765
- not,
1766
- parseURL,
1767
- stringEquals,
1768
- substring,
1769
- uriEncode
1770
- };
1771
-
1772
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateTemplate.js
1773
- init_esm_shims();
1774
- var evaluateTemplate = /* @__PURE__ */ __name((template, options) => {
1775
- const evaluatedTemplateArr = [];
1776
- const templateContext = {
1777
- ...options.endpointParams,
1778
- ...options.referenceRecord
1779
- };
1780
- let currentIndex = 0;
1781
- while (currentIndex < template.length) {
1782
- const openingBraceIndex = template.indexOf("{", currentIndex);
1783
- if (openingBraceIndex === -1) {
1784
- evaluatedTemplateArr.push(template.slice(currentIndex));
1785
- break;
1786
- }
1787
- evaluatedTemplateArr.push(template.slice(currentIndex, openingBraceIndex));
1788
- const closingBraceIndex = template.indexOf("}", openingBraceIndex);
1789
- if (closingBraceIndex === -1) {
1790
- evaluatedTemplateArr.push(template.slice(openingBraceIndex));
1791
- break;
1792
- }
1793
- if (template[openingBraceIndex + 1] === "{" && template[closingBraceIndex + 1] === "}") {
1794
- evaluatedTemplateArr.push(template.slice(openingBraceIndex + 1, closingBraceIndex));
1795
- currentIndex = closingBraceIndex + 2;
1796
- }
1797
- const parameterName = template.substring(openingBraceIndex + 1, closingBraceIndex);
1798
- if (parameterName.includes("#")) {
1799
- const [refName, attrName] = parameterName.split("#");
1800
- evaluatedTemplateArr.push(getAttr(templateContext[refName], attrName));
1801
- } else {
1802
- evaluatedTemplateArr.push(templateContext[parameterName]);
1803
- }
1804
- currentIndex = closingBraceIndex + 1;
1805
- }
1806
- return evaluatedTemplateArr.join("");
1807
- }, "evaluateTemplate");
1808
-
1809
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/getReferenceValue.js
1810
- init_esm_shims();
1811
- var getReferenceValue = /* @__PURE__ */ __name(({ ref }, options) => {
1812
- const referenceRecord = {
1813
- ...options.endpointParams,
1814
- ...options.referenceRecord
1815
- };
1816
- return referenceRecord[ref];
1817
- }, "getReferenceValue");
1818
-
1819
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateExpression.js
1820
- var evaluateExpression = /* @__PURE__ */ __name((obj, keyName, options) => {
1821
- if (typeof obj === "string") {
1822
- return evaluateTemplate(obj, options);
1823
- } else if (obj["fn"]) {
1824
- return group.callFunction(obj, options);
1825
- } else if (obj["ref"]) {
1826
- return getReferenceValue(obj, options);
1827
- }
1828
- throw new EndpointError(`'${keyName}': ${String(obj)} is not a string, function or reference.`);
1829
- }, "evaluateExpression");
1830
- var callFunction = /* @__PURE__ */ __name(({ fn, argv }, options) => {
1831
- const evaluatedArgs = argv.map((arg) => [
1832
- "boolean",
1833
- "number"
1834
- ].includes(typeof arg) ? arg : group.evaluateExpression(arg, "arg", options));
1835
- const fnSegments = fn.split(".");
1836
- if (fnSegments[0] in customEndpointFunctions && fnSegments[1] != null) {
1837
- return customEndpointFunctions[fnSegments[0]][fnSegments[1]](...evaluatedArgs);
1838
- }
1839
- return endpointFunctions[fn](...evaluatedArgs);
1840
- }, "callFunction");
1841
- var group = {
1842
- evaluateExpression,
1843
- callFunction
1844
- };
1845
-
1846
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateCondition.js
1847
- var evaluateCondition = /* @__PURE__ */ __name(({ assign, ...fnArgs }, options) => {
1848
- if (assign && assign in options.referenceRecord) {
1849
- throw new EndpointError(`'${assign}' is already defined in Reference Record.`);
1850
- }
1851
- const value = callFunction(fnArgs, options);
1852
- options.logger?.debug?.(`${debugId} evaluateCondition: ${toDebugString(fnArgs)} = ${toDebugString(value)}`);
1853
- return {
1854
- result: value === "" ? true : !!value,
1855
- ...assign != null && {
1856
- toAssign: {
1857
- name: assign,
1858
- value
1859
- }
1860
- }
1861
- };
1862
- }, "evaluateCondition");
1863
-
1864
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateConditions.js
1865
- var evaluateConditions = /* @__PURE__ */ __name((conditions = [], options) => {
1866
- const conditionsReferenceRecord = {};
1867
- for (const condition of conditions) {
1868
- const { result, toAssign } = evaluateCondition(condition, {
1869
- ...options,
1870
- referenceRecord: {
1871
- ...options.referenceRecord,
1872
- ...conditionsReferenceRecord
1873
- }
1874
- });
1875
- if (!result) {
1876
- return {
1877
- result
1878
- };
1879
- }
1880
- if (toAssign) {
1881
- conditionsReferenceRecord[toAssign.name] = toAssign.value;
1882
- options.logger?.debug?.(`${debugId} assign: ${toAssign.name} := ${toDebugString(toAssign.value)}`);
1883
- }
1884
- }
1885
- return {
1886
- result: true,
1887
- referenceRecord: conditionsReferenceRecord
1888
- };
1889
- }, "evaluateConditions");
1890
-
1891
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js
1892
- init_esm_shims();
1893
-
1894
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js
1895
- init_esm_shims();
1896
- var getEndpointHeaders = /* @__PURE__ */ __name((headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
1897
- ...acc,
1898
- [headerKey]: headerVal.map((headerValEntry) => {
1899
- const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
1900
- if (typeof processedExpr !== "string") {
1901
- throw new EndpointError(`Header '${headerKey}' value '${processedExpr}' is not a string`);
1902
- }
1903
- return processedExpr;
1904
- })
1905
- }), {}), "getEndpointHeaders");
1906
-
1907
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointProperties.js
1908
- init_esm_shims();
1909
- var getEndpointProperties = /* @__PURE__ */ __name((properties, options) => Object.entries(properties).reduce((acc, [propertyKey, propertyVal]) => ({
1910
- ...acc,
1911
- [propertyKey]: group2.getEndpointProperty(propertyVal, options)
1912
- }), {}), "getEndpointProperties");
1913
- var getEndpointProperty = /* @__PURE__ */ __name((property, options) => {
1914
- if (Array.isArray(property)) {
1915
- return property.map((propertyEntry) => getEndpointProperty(propertyEntry, options));
1916
- }
1917
- switch (typeof property) {
1918
- case "string":
1919
- return evaluateTemplate(property, options);
1920
- case "object":
1921
- if (property === null) {
1922
- throw new EndpointError(`Unexpected endpoint property: ${property}`);
1923
- }
1924
- return group2.getEndpointProperties(property, options);
1925
- case "boolean":
1926
- return property;
1927
- default:
1928
- throw new EndpointError(`Unexpected endpoint property type: ${typeof property}`);
1929
- }
1930
- }, "getEndpointProperty");
1931
- var group2 = {
1932
- getEndpointProperty,
1933
- getEndpointProperties
1934
- };
1935
-
1936
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointUrl.js
1937
- init_esm_shims();
1938
- var getEndpointUrl = /* @__PURE__ */ __name((endpointUrl, options) => {
1939
- const expression = evaluateExpression(endpointUrl, "Endpoint URL", options);
1940
- if (typeof expression === "string") {
1941
- try {
1942
- return new URL(expression);
1943
- } catch (error) {
1944
- console.error(`Failed to construct URL with ${expression}`, error);
1945
- throw error;
1946
- }
1947
- }
1948
- throw new EndpointError(`Endpoint URL must be a string, got ${typeof expression}`);
1949
- }, "getEndpointUrl");
1950
-
1951
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateEndpointRule.js
1952
- var evaluateEndpointRule = /* @__PURE__ */ __name((endpointRule, options) => {
1953
- const { conditions, endpoint } = endpointRule;
1954
- const { result, referenceRecord } = evaluateConditions(conditions, options);
1955
- if (!result) {
1956
- return;
1957
- }
1958
- const endpointRuleOptions = {
1959
- ...options,
1960
- referenceRecord: {
1961
- ...options.referenceRecord,
1962
- ...referenceRecord
1963
- }
1964
- };
1965
- const { url, properties, headers } = endpoint;
1966
- options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
1967
- return {
1968
- ...headers != void 0 && {
1969
- headers: getEndpointHeaders(headers, endpointRuleOptions)
1970
- },
1971
- ...properties != void 0 && {
1972
- properties: getEndpointProperties(properties, endpointRuleOptions)
1973
- },
1974
- url: getEndpointUrl(url, endpointRuleOptions)
1975
- };
1976
- }, "evaluateEndpointRule");
1977
-
1978
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateErrorRule.js
1979
- init_esm_shims();
1980
- var evaluateErrorRule = /* @__PURE__ */ __name((errorRule, options) => {
1981
- const { conditions, error } = errorRule;
1982
- const { result, referenceRecord } = evaluateConditions(conditions, options);
1983
- if (!result) {
1984
- return;
1985
- }
1986
- throw new EndpointError(evaluateExpression(error, "Error", {
1987
- ...options,
1988
- referenceRecord: {
1989
- ...options.referenceRecord,
1990
- ...referenceRecord
1991
- }
1992
- }));
1993
- }, "evaluateErrorRule");
1994
-
1995
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/utils/evaluateRules.js
1996
- var evaluateRules = /* @__PURE__ */ __name((rules, options) => {
1997
- for (const rule of rules) {
1998
- if (rule.type === "endpoint") {
1999
- const endpointOrUndefined = evaluateEndpointRule(rule, options);
2000
- if (endpointOrUndefined) {
2001
- return endpointOrUndefined;
2002
- }
2003
- } else if (rule.type === "error") {
2004
- evaluateErrorRule(rule, options);
2005
- } else if (rule.type === "tree") {
2006
- const endpointOrUndefined = group3.evaluateTreeRule(rule, options);
2007
- if (endpointOrUndefined) {
2008
- return endpointOrUndefined;
2009
- }
2010
- } else {
2011
- throw new EndpointError(`Unknown endpoint rule: ${rule}`);
2012
- }
2013
- }
2014
- throw new EndpointError(`Rules evaluation failed`);
2015
- }, "evaluateRules");
2016
- var evaluateTreeRule = /* @__PURE__ */ __name((treeRule, options) => {
2017
- const { conditions, rules } = treeRule;
2018
- const { result, referenceRecord } = evaluateConditions(conditions, options);
2019
- if (!result) {
2020
- return;
2021
- }
2022
- return group3.evaluateRules(rules, {
2023
- ...options,
2024
- referenceRecord: {
2025
- ...options.referenceRecord,
2026
- ...referenceRecord
2027
- }
2028
- });
2029
- }, "evaluateTreeRule");
2030
- var group3 = {
2031
- evaluateRules,
2032
- evaluateTreeRule
2033
- };
2034
-
2035
- // ../../node_modules/.pnpm/@smithy+util-endpoints@3.2.5/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js
2036
- var resolveEndpoint = /* @__PURE__ */ __name((ruleSetObject, options) => {
2037
- const { endpointParams, logger } = options;
2038
- const { parameters, rules } = ruleSetObject;
2039
- options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
2040
- const paramsWithDefault = Object.entries(parameters).filter(([, v]) => v.default != null).map(([k, v]) => [
2041
- k,
2042
- v.default
2043
- ]);
2044
- if (paramsWithDefault.length > 0) {
2045
- for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
2046
- endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
2047
- }
2048
- }
2049
- const requiredParams = Object.entries(parameters).filter(([, v]) => v.required).map(([k]) => k);
2050
- for (const requiredParam of requiredParams) {
2051
- if (endpointParams[requiredParam] == null) {
2052
- throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
2053
- }
2054
- }
2055
- const endpoint = evaluateRules(rules, {
2056
- endpointParams,
2057
- logger,
2058
- referenceRecord: {}
2059
- });
2060
- options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
2061
- return endpoint;
2062
- }, "resolveEndpoint");
2063
-
2064
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
2065
- init_esm_shims();
2066
-
2067
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js
2068
- init_esm_shims();
2069
-
2070
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js
2071
- var isVirtualHostableS3Bucket = /* @__PURE__ */ __name((value, allowSubDomains = false) => {
2072
- if (allowSubDomains) {
2073
- for (const label of value.split(".")) {
2074
- if (!isVirtualHostableS3Bucket(label)) {
2075
- return false;
2076
- }
2077
- }
2078
- return true;
2079
- }
2080
- if (!isValidHostLabel(value)) {
2081
- return false;
2082
- }
2083
- if (value.length < 3 || value.length > 63) {
2084
- return false;
2085
- }
2086
- if (value !== value.toLowerCase()) {
2087
- return false;
2088
- }
2089
- if (isIpAddress(value)) {
2090
- return false;
2091
- }
2092
- return true;
2093
- }, "isVirtualHostableS3Bucket");
2094
-
2095
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js
2096
- init_esm_shims();
2097
- var ARN_DELIMITER = ":";
2098
- var RESOURCE_DELIMITER = "/";
2099
- var parseArn = /* @__PURE__ */ __name((value) => {
2100
- const segments = value.split(ARN_DELIMITER);
2101
- if (segments.length < 6) return null;
2102
- const [arn, partition2, service, region, accountId, ...resourcePath] = segments;
2103
- if (arn !== "arn" || partition2 === "" || service === "" || resourcePath.join(ARN_DELIMITER) === "") return null;
2104
- const resourceId = resourcePath.map((resource) => resource.split(RESOURCE_DELIMITER)).flat();
2105
- return {
2106
- partition: partition2,
2107
- service,
2108
- region,
2109
- accountId,
2110
- resourceId
2111
- };
2112
- }, "parseArn");
2113
-
2114
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
2115
- init_esm_shims();
2116
-
2117
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json
2118
- var partitions_default = {
2119
- partitions: [{
2120
- id: "aws",
2121
- outputs: {
2122
- dnsSuffix: "amazonaws.com",
2123
- dualStackDnsSuffix: "api.aws",
2124
- implicitGlobalRegion: "us-east-1",
2125
- name: "aws",
2126
- supportsDualStack: true,
2127
- supportsFIPS: true
2128
- },
2129
- regionRegex: "^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",
2130
- regions: {
2131
- "af-south-1": {
2132
- description: "Africa (Cape Town)"
2133
- },
2134
- "ap-east-1": {
2135
- description: "Asia Pacific (Hong Kong)"
2136
- },
2137
- "ap-east-2": {
2138
- description: "Asia Pacific (Taipei)"
2139
- },
2140
- "ap-northeast-1": {
2141
- description: "Asia Pacific (Tokyo)"
2142
- },
2143
- "ap-northeast-2": {
2144
- description: "Asia Pacific (Seoul)"
2145
- },
2146
- "ap-northeast-3": {
2147
- description: "Asia Pacific (Osaka)"
2148
- },
2149
- "ap-south-1": {
2150
- description: "Asia Pacific (Mumbai)"
2151
- },
2152
- "ap-south-2": {
2153
- description: "Asia Pacific (Hyderabad)"
2154
- },
2155
- "ap-southeast-1": {
2156
- description: "Asia Pacific (Singapore)"
2157
- },
2158
- "ap-southeast-2": {
2159
- description: "Asia Pacific (Sydney)"
2160
- },
2161
- "ap-southeast-3": {
2162
- description: "Asia Pacific (Jakarta)"
2163
- },
2164
- "ap-southeast-4": {
2165
- description: "Asia Pacific (Melbourne)"
2166
- },
2167
- "ap-southeast-5": {
2168
- description: "Asia Pacific (Malaysia)"
2169
- },
2170
- "ap-southeast-6": {
2171
- description: "Asia Pacific (New Zealand)"
2172
- },
2173
- "ap-southeast-7": {
2174
- description: "Asia Pacific (Thailand)"
2175
- },
2176
- "aws-global": {
2177
- description: "aws global region"
2178
- },
2179
- "ca-central-1": {
2180
- description: "Canada (Central)"
2181
- },
2182
- "ca-west-1": {
2183
- description: "Canada West (Calgary)"
2184
- },
2185
- "eu-central-1": {
2186
- description: "Europe (Frankfurt)"
2187
- },
2188
- "eu-central-2": {
2189
- description: "Europe (Zurich)"
2190
- },
2191
- "eu-north-1": {
2192
- description: "Europe (Stockholm)"
2193
- },
2194
- "eu-south-1": {
2195
- description: "Europe (Milan)"
2196
- },
2197
- "eu-south-2": {
2198
- description: "Europe (Spain)"
2199
- },
2200
- "eu-west-1": {
2201
- description: "Europe (Ireland)"
2202
- },
2203
- "eu-west-2": {
2204
- description: "Europe (London)"
2205
- },
2206
- "eu-west-3": {
2207
- description: "Europe (Paris)"
2208
- },
2209
- "il-central-1": {
2210
- description: "Israel (Tel Aviv)"
2211
- },
2212
- "me-central-1": {
2213
- description: "Middle East (UAE)"
2214
- },
2215
- "me-south-1": {
2216
- description: "Middle East (Bahrain)"
2217
- },
2218
- "mx-central-1": {
2219
- description: "Mexico (Central)"
2220
- },
2221
- "sa-east-1": {
2222
- description: "South America (Sao Paulo)"
2223
- },
2224
- "us-east-1": {
2225
- description: "US East (N. Virginia)"
2226
- },
2227
- "us-east-2": {
2228
- description: "US East (Ohio)"
2229
- },
2230
- "us-west-1": {
2231
- description: "US West (N. California)"
2232
- },
2233
- "us-west-2": {
2234
- description: "US West (Oregon)"
2235
- }
2236
- }
2237
- }, {
2238
- id: "aws-cn",
2239
- outputs: {
2240
- dnsSuffix: "amazonaws.com.cn",
2241
- dualStackDnsSuffix: "api.amazonwebservices.com.cn",
2242
- implicitGlobalRegion: "cn-northwest-1",
2243
- name: "aws-cn",
2244
- supportsDualStack: true,
2245
- supportsFIPS: true
2246
- },
2247
- regionRegex: "^cn\\-\\w+\\-\\d+$",
2248
- regions: {
2249
- "aws-cn-global": {
2250
- description: "aws-cn global region"
2251
- },
2252
- "cn-north-1": {
2253
- description: "China (Beijing)"
2254
- },
2255
- "cn-northwest-1": {
2256
- description: "China (Ningxia)"
2257
- }
2258
- }
2259
- }, {
2260
- id: "aws-eusc",
2261
- outputs: {
2262
- dnsSuffix: "amazonaws.eu",
2263
- dualStackDnsSuffix: "api.amazonwebservices.eu",
2264
- implicitGlobalRegion: "eusc-de-east-1",
2265
- name: "aws-eusc",
2266
- supportsDualStack: true,
2267
- supportsFIPS: true
2268
- },
2269
- regionRegex: "^eusc\\-(de)\\-\\w+\\-\\d+$",
2270
- regions: {
2271
- "eusc-de-east-1": {
2272
- description: "EU (Germany)"
2273
- }
2274
- }
2275
- }, {
2276
- id: "aws-iso",
2277
- outputs: {
2278
- dnsSuffix: "c2s.ic.gov",
2279
- dualStackDnsSuffix: "api.aws.ic.gov",
2280
- implicitGlobalRegion: "us-iso-east-1",
2281
- name: "aws-iso",
2282
- supportsDualStack: false,
2283
- supportsFIPS: true
2284
- },
2285
- regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
2286
- regions: {
2287
- "aws-iso-global": {
2288
- description: "aws-iso global region"
2289
- },
2290
- "us-iso-east-1": {
2291
- description: "US ISO East"
2292
- },
2293
- "us-iso-west-1": {
2294
- description: "US ISO WEST"
2295
- }
2296
- }
2297
- }, {
2298
- id: "aws-iso-b",
2299
- outputs: {
2300
- dnsSuffix: "sc2s.sgov.gov",
2301
- dualStackDnsSuffix: "api.aws.scloud",
2302
- implicitGlobalRegion: "us-isob-east-1",
2303
- name: "aws-iso-b",
2304
- supportsDualStack: false,
2305
- supportsFIPS: true
2306
- },
2307
- regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
2308
- regions: {
2309
- "aws-iso-b-global": {
2310
- description: "aws-iso-b global region"
2311
- },
2312
- "us-isob-east-1": {
2313
- description: "US ISOB East (Ohio)"
2314
- }
2315
- }
2316
- }, {
2317
- id: "aws-iso-e",
2318
- outputs: {
2319
- dnsSuffix: "cloud.adc-e.uk",
2320
- dualStackDnsSuffix: "api.cloud-aws.adc-e.uk",
2321
- implicitGlobalRegion: "eu-isoe-west-1",
2322
- name: "aws-iso-e",
2323
- supportsDualStack: false,
2324
- supportsFIPS: true
2325
- },
2326
- regionRegex: "^eu\\-isoe\\-\\w+\\-\\d+$",
2327
- regions: {
2328
- "aws-iso-e-global": {
2329
- description: "aws-iso-e global region"
2330
- },
2331
- "eu-isoe-west-1": {
2332
- description: "EU ISOE West"
2333
- }
2334
- }
2335
- }, {
2336
- id: "aws-iso-f",
2337
- outputs: {
2338
- dnsSuffix: "csp.hci.ic.gov",
2339
- dualStackDnsSuffix: "api.aws.hci.ic.gov",
2340
- implicitGlobalRegion: "us-isof-south-1",
2341
- name: "aws-iso-f",
2342
- supportsDualStack: false,
2343
- supportsFIPS: true
2344
- },
2345
- regionRegex: "^us\\-isof\\-\\w+\\-\\d+$",
2346
- regions: {
2347
- "aws-iso-f-global": {
2348
- description: "aws-iso-f global region"
2349
- },
2350
- "us-isof-east-1": {
2351
- description: "US ISOF EAST"
2352
- },
2353
- "us-isof-south-1": {
2354
- description: "US ISOF SOUTH"
2355
- }
2356
- }
2357
- }, {
2358
- id: "aws-us-gov",
2359
- outputs: {
2360
- dnsSuffix: "amazonaws.com",
2361
- dualStackDnsSuffix: "api.aws",
2362
- implicitGlobalRegion: "us-gov-west-1",
2363
- name: "aws-us-gov",
2364
- supportsDualStack: true,
2365
- supportsFIPS: true
2366
- },
2367
- regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
2368
- regions: {
2369
- "aws-us-gov-global": {
2370
- description: "aws-us-gov global region"
2371
- },
2372
- "us-gov-east-1": {
2373
- description: "AWS GovCloud (US-East)"
2374
- },
2375
- "us-gov-west-1": {
2376
- description: "AWS GovCloud (US-West)"
2377
- }
2378
- }
2379
- }]};
2380
-
2381
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js
2382
- var selectedPartitionsInfo = partitions_default;
2383
- var selectedUserAgentPrefix = "";
2384
- var partition = /* @__PURE__ */ __name((value) => {
2385
- const { partitions } = selectedPartitionsInfo;
2386
- for (const partition2 of partitions) {
2387
- const { regions, outputs } = partition2;
2388
- for (const [region, regionData] of Object.entries(regions)) {
2389
- if (region === value) {
2390
- return {
2391
- ...outputs,
2392
- ...regionData
2393
- };
2394
- }
2395
- }
2396
- }
2397
- for (const partition2 of partitions) {
2398
- const { regionRegex, outputs } = partition2;
2399
- if (new RegExp(regionRegex).test(value)) {
2400
- return {
2401
- ...outputs
2402
- };
2403
- }
2404
- }
2405
- const DEFAULT_PARTITION = partitions.find((partition2) => partition2.id === "aws");
2406
- if (!DEFAULT_PARTITION) {
2407
- throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");
2408
- }
2409
- return {
2410
- ...DEFAULT_PARTITION.outputs
2411
- };
2412
- }, "partition");
2413
- var getUserAgentPrefix = /* @__PURE__ */ __name(() => selectedUserAgentPrefix, "getUserAgentPrefix");
2414
-
2415
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js
2416
- var awsEndpointFunctions = {
2417
- isVirtualHostableS3Bucket,
2418
- parseArn,
2419
- partition
2420
- };
2421
- customEndpointFunctions.aws = awsEndpointFunctions;
2422
-
2423
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js
2424
- init_esm_shims();
2425
-
2426
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js
2427
- init_esm_shims();
2428
-
2429
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js
2430
- init_esm_shims();
2431
-
2432
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js
2433
- init_esm_shims();
2434
-
2435
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js
2436
- init_esm_shims();
2437
-
2438
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js
2439
- init_esm_shims();
2440
-
2441
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js
2442
- init_esm_shims();
2443
-
2444
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js
2445
- init_esm_shims();
2446
-
2447
- // ../../node_modules/.pnpm/@aws-sdk+util-endpoints@3.879.0/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js
2448
- init_esm_shims();
2449
-
2450
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
2451
- init_esm_shims();
2452
-
2453
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
2454
- init_esm_shims();
2455
- var state = {
2456
- warningEmitted: false
2457
- };
2458
- var emitWarningIfUnsupportedVersion = /* @__PURE__ */ __name((version) => {
2459
- if (version && !state.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
2460
- state.warningEmitted = true;
2461
- process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
2462
- no longer support Node.js 16.x on January 6, 2025.
2463
-
2464
- To continue receiving updates to AWS services, bug fixes, and security
2465
- updates please upgrade to a supported Node.js LTS version.
2466
-
2467
- More information can be found at: https://a.co/74kJMmI`);
2468
- }
2469
- }, "emitWarningIfUnsupportedVersion");
2470
-
2471
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
2472
- init_esm_shims();
2473
- function setFeature2(context, feature, value) {
2474
- if (!context.__aws_sdk_context) {
2475
- context.__aws_sdk_context = {
2476
- features: {}
2477
- };
2478
- } else if (!context.__aws_sdk_context.features) {
2479
- context.__aws_sdk_context.features = {};
2480
- }
2481
- context.__aws_sdk_context.features[feature] = value;
2482
- }
2483
- __name(setFeature2, "setFeature");
2484
-
2485
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/index.js
2486
- init_esm_shims();
2487
-
2488
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
2489
- init_esm_shims();
2490
-
2491
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getDateHeader.js
2492
- init_esm_shims();
2493
- var getDateHeader = /* @__PURE__ */ __name((response) => HttpResponse.isInstance(response) ? response.headers?.date ?? response.headers?.Date : void 0, "getDateHeader");
2494
-
2495
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getSkewCorrectedDate.js
2496
- init_esm_shims();
2497
- var getSkewCorrectedDate = /* @__PURE__ */ __name((systemClockOffset) => new Date(Date.now() + systemClockOffset), "getSkewCorrectedDate");
2498
-
2499
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js
2500
- init_esm_shims();
2501
-
2502
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/isClockSkewed.js
2503
- init_esm_shims();
2504
- var isClockSkewed = /* @__PURE__ */ __name((clockTime, systemClockOffset) => Math.abs(getSkewCorrectedDate(systemClockOffset).getTime() - clockTime) >= 3e5, "isClockSkewed");
2505
-
2506
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getUpdatedSystemClockOffset.js
2507
- var getUpdatedSystemClockOffset = /* @__PURE__ */ __name((clockTime, currentSystemClockOffset) => {
2508
- const clockTimeInMs = Date.parse(clockTime);
2509
- if (isClockSkewed(clockTimeInMs, currentSystemClockOffset)) {
2510
- return clockTimeInMs - Date.now();
2511
- }
2512
- return currentSystemClockOffset;
2513
- }, "getUpdatedSystemClockOffset");
2514
-
2515
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.js
2516
- var throwSigningPropertyError = /* @__PURE__ */ __name((name, property) => {
2517
- if (!property) {
2518
- throw new Error(`Property \`${name}\` is not resolved for AWS SDK SigV4Auth`);
2519
- }
2520
- return property;
2521
- }, "throwSigningPropertyError");
2522
- var validateSigningProperties = /* @__PURE__ */ __name(async (signingProperties) => {
2523
- const context = throwSigningPropertyError("context", signingProperties.context);
2524
- const config = throwSigningPropertyError("config", signingProperties.config);
2525
- const authScheme = context.endpointV2?.properties?.authSchemes?.[0];
2526
- const signerFunction = throwSigningPropertyError("signer", config.signer);
2527
- const signer = await signerFunction(authScheme);
2528
- const signingRegion = signingProperties?.signingRegion;
2529
- const signingRegionSet = signingProperties?.signingRegionSet;
2530
- const signingName = signingProperties?.signingName;
2531
- return {
2532
- config,
2533
- signer,
2534
- signingRegion,
2535
- signingRegionSet,
2536
- signingName
2537
- };
2538
- }, "validateSigningProperties");
2539
- var AwsSdkSigV4Signer = class {
2540
- static {
2541
- __name(this, "AwsSdkSigV4Signer");
2542
- }
2543
- async sign(httpRequest, identity, signingProperties) {
2544
- if (!HttpRequest.isInstance(httpRequest)) {
2545
- throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");
2546
- }
2547
- const validatedProps = await validateSigningProperties(signingProperties);
2548
- const { config, signer } = validatedProps;
2549
- let { signingRegion, signingName } = validatedProps;
2550
- const handlerExecutionContext = signingProperties.context;
2551
- if (handlerExecutionContext?.authSchemes?.length ?? 0 > 1) {
2552
- const [first, second] = handlerExecutionContext.authSchemes;
2553
- if (first?.name === "sigv4a" && second?.name === "sigv4") {
2554
- signingRegion = second?.signingRegion ?? signingRegion;
2555
- signingName = second?.signingName ?? signingName;
2556
- }
2557
- }
2558
- const signedRequest = await signer.sign(httpRequest, {
2559
- signingDate: getSkewCorrectedDate(config.systemClockOffset),
2560
- signingRegion,
2561
- signingService: signingName
2562
- });
2563
- return signedRequest;
2564
- }
2565
- errorHandler(signingProperties) {
2566
- return (error) => {
2567
- const serverTime = error.ServerTime ?? getDateHeader(error.$response);
2568
- if (serverTime) {
2569
- const config = throwSigningPropertyError("config", signingProperties.config);
2570
- const initialSystemClockOffset = config.systemClockOffset;
2571
- config.systemClockOffset = getUpdatedSystemClockOffset(serverTime, config.systemClockOffset);
2572
- const clockSkewCorrected = config.systemClockOffset !== initialSystemClockOffset;
2573
- if (clockSkewCorrected && error.$metadata) {
2574
- error.$metadata.clockSkewCorrected = true;
2575
- }
2576
- }
2577
- throw error;
2578
- };
2579
- }
2580
- successHandler(httpResponse, signingProperties) {
2581
- const dateHeader = getDateHeader(httpResponse);
2582
- if (dateHeader) {
2583
- const config = throwSigningPropertyError("config", signingProperties.config);
2584
- config.systemClockOffset = getUpdatedSystemClockOffset(dateHeader, config.systemClockOffset);
2585
- }
2586
- }
2587
- };
2588
-
2589
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js
2590
- init_esm_shims();
2591
-
2592
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getArrayForCommaSeparatedString.js
2593
- init_esm_shims();
2594
- var getArrayForCommaSeparatedString = /* @__PURE__ */ __name((str) => typeof str === "string" && str.length > 0 ? str.split(",").map((item) => item.trim()) : [], "getArrayForCommaSeparatedString");
2595
-
2596
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/utils/getBearerTokenEnvKey.js
2597
- init_esm_shims();
2598
- var getBearerTokenEnvKey = /* @__PURE__ */ __name((signingName) => `AWS_BEARER_TOKEN_${signingName.replace(/[\s-]/g, "_").toUpperCase()}`, "getBearerTokenEnvKey");
2599
-
2600
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/NODE_AUTH_SCHEME_PREFERENCE_OPTIONS.js
2601
- var NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY = "AWS_AUTH_SCHEME_PREFERENCE";
2602
- var NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY = "auth_scheme_preference";
2603
- var NODE_AUTH_SCHEME_PREFERENCE_OPTIONS = {
2604
- environmentVariableSelector: /* @__PURE__ */ __name((env2, options) => {
2605
- if (options?.signingName) {
2606
- const bearerTokenKey = getBearerTokenEnvKey(options.signingName);
2607
- if (bearerTokenKey in env2) return [
2608
- "httpBearerAuth"
2609
- ];
2610
- }
2611
- if (!(NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY in env2)) return void 0;
2612
- return getArrayForCommaSeparatedString(env2[NODE_AUTH_SCHEME_PREFERENCE_ENV_KEY]);
2613
- }, "environmentVariableSelector"),
2614
- configFileSelector: /* @__PURE__ */ __name((profile) => {
2615
- if (!(NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY in profile)) return void 0;
2616
- return getArrayForCommaSeparatedString(profile[NODE_AUTH_SCHEME_PREFERENCE_CONFIG_KEY]);
2617
- }, "configFileSelector"),
2618
- default: []
2619
- };
2620
-
2621
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js
2622
- init_esm_shims();
2623
-
2624
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js
2625
- init_esm_shims();
2626
-
2627
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/constants.js
2628
- init_esm_shims();
2629
- var ALGORITHM_QUERY_PARAM = "X-Amz-Algorithm";
2630
- var CREDENTIAL_QUERY_PARAM = "X-Amz-Credential";
2631
- var AMZ_DATE_QUERY_PARAM = "X-Amz-Date";
2632
- var SIGNED_HEADERS_QUERY_PARAM = "X-Amz-SignedHeaders";
2633
- var EXPIRES_QUERY_PARAM = "X-Amz-Expires";
2634
- var SIGNATURE_QUERY_PARAM = "X-Amz-Signature";
2635
- var TOKEN_QUERY_PARAM = "X-Amz-Security-Token";
2636
- var AUTH_HEADER = "authorization";
2637
- var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();
2638
- var DATE_HEADER = "date";
2639
- var GENERATED_HEADERS = [
2640
- AUTH_HEADER,
2641
- AMZ_DATE_HEADER,
2642
- DATE_HEADER
2643
- ];
2644
- var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();
2645
- var SHA256_HEADER = "x-amz-content-sha256";
2646
- var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();
2647
- var ALWAYS_UNSIGNABLE_HEADERS = {
2648
- authorization: true,
2649
- "cache-control": true,
2650
- connection: true,
2651
- expect: true,
2652
- from: true,
2653
- "keep-alive": true,
2654
- "max-forwards": true,
2655
- pragma: true,
2656
- referer: true,
2657
- te: true,
2658
- trailer: true,
2659
- "transfer-encoding": true,
2660
- upgrade: true,
2661
- "user-agent": true,
2662
- "x-amzn-trace-id": true
2663
- };
2664
- var PROXY_HEADER_PATTERN = /^proxy-/;
2665
- var SEC_HEADER_PATTERN = /^sec-/;
2666
- var ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256";
2667
- var EVENT_ALGORITHM_IDENTIFIER = "AWS4-HMAC-SHA256-PAYLOAD";
2668
- var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
2669
- var MAX_CACHE_SIZE = 50;
2670
- var KEY_TYPE_IDENTIFIER = "aws4_request";
2671
- var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;
2672
-
2673
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/credentialDerivation.js
2674
- init_esm_shims();
2675
- var signingKeyCache = {};
2676
- var cacheQueue = [];
2677
- var createScope = /* @__PURE__ */ __name((shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`, "createScope");
2678
- var getSigningKey = /* @__PURE__ */ __name(async (sha256Constructor, credentials, shortDate, region, service) => {
2679
- const credsHash = await hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
2680
- const cacheKey = `${shortDate}:${region}:${service}:${toHex(credsHash)}:${credentials.sessionToken}`;
2681
- if (cacheKey in signingKeyCache) {
2682
- return signingKeyCache[cacheKey];
2683
- }
2684
- cacheQueue.push(cacheKey);
2685
- while (cacheQueue.length > MAX_CACHE_SIZE) {
2686
- delete signingKeyCache[cacheQueue.shift()];
2687
- }
2688
- let key = `AWS4${credentials.secretAccessKey}`;
2689
- for (const signable of [
2690
- shortDate,
2691
- region,
2692
- service,
2693
- KEY_TYPE_IDENTIFIER
2694
- ]) {
2695
- key = await hmac(sha256Constructor, key, signable);
2696
- }
2697
- return signingKeyCache[cacheKey] = key;
2698
- }, "getSigningKey");
2699
- var hmac = /* @__PURE__ */ __name((ctor, secret, data) => {
2700
- const hash = new ctor(secret);
2701
- hash.update(toUint8Array(data));
2702
- return hash.digest();
2703
- }, "hmac");
2704
-
2705
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/getCanonicalHeaders.js
2706
- init_esm_shims();
2707
- var getCanonicalHeaders = /* @__PURE__ */ __name(({ headers }, unsignableHeaders, signableHeaders) => {
2708
- const canonical = {};
2709
- for (const headerName of Object.keys(headers).sort()) {
2710
- if (headers[headerName] == void 0) {
2711
- continue;
2712
- }
2713
- const canonicalHeaderName = headerName.toLowerCase();
2714
- if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || unsignableHeaders?.has(canonicalHeaderName) || PROXY_HEADER_PATTERN.test(canonicalHeaderName) || SEC_HEADER_PATTERN.test(canonicalHeaderName)) {
2715
- if (!signableHeaders || signableHeaders && !signableHeaders.has(canonicalHeaderName)) {
2716
- continue;
2717
- }
2718
- }
2719
- canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\s+/g, " ");
2720
- }
2721
- return canonical;
2722
- }, "getCanonicalHeaders");
2723
-
2724
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/getPayloadHash.js
2725
- init_esm_shims();
2726
- var getPayloadHash = /* @__PURE__ */ __name(async ({ headers, body }, hashConstructor) => {
2727
- for (const headerName of Object.keys(headers)) {
2728
- if (headerName.toLowerCase() === SHA256_HEADER) {
2729
- return headers[headerName];
2730
- }
2731
- }
2732
- if (body == void 0) {
2733
- return "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
2734
- } else if (typeof body === "string" || ArrayBuffer.isView(body) || isArrayBuffer(body)) {
2735
- const hashCtor = new hashConstructor();
2736
- hashCtor.update(toUint8Array(body));
2737
- return toHex(await hashCtor.digest());
2738
- }
2739
- return UNSIGNED_PAYLOAD;
2740
- }, "getPayloadHash");
2741
-
2742
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/HeaderFormatter.js
2743
- init_esm_shims();
2744
- var HeaderFormatter = class {
2745
- static {
2746
- __name(this, "HeaderFormatter");
2747
- }
2748
- format(headers) {
2749
- const chunks = [];
2750
- for (const headerName of Object.keys(headers)) {
2751
- const bytes = fromUtf8(headerName);
2752
- chunks.push(Uint8Array.from([
2753
- bytes.byteLength
2754
- ]), bytes, this.formatHeaderValue(headers[headerName]));
2755
- }
2756
- const out = new Uint8Array(chunks.reduce((carry, bytes) => carry + bytes.byteLength, 0));
2757
- let position = 0;
2758
- for (const chunk of chunks) {
2759
- out.set(chunk, position);
2760
- position += chunk.byteLength;
2761
- }
2762
- return out;
2763
- }
2764
- formatHeaderValue(header) {
2765
- switch (header.type) {
2766
- case "boolean":
2767
- return Uint8Array.from([
2768
- header.value ? 0 : 1
2769
- ]);
2770
- case "byte":
2771
- return Uint8Array.from([
2772
- 2,
2773
- header.value
2774
- ]);
2775
- case "short":
2776
- const shortView = new DataView(new ArrayBuffer(3));
2777
- shortView.setUint8(0, 3);
2778
- shortView.setInt16(1, header.value, false);
2779
- return new Uint8Array(shortView.buffer);
2780
- case "integer":
2781
- const intView = new DataView(new ArrayBuffer(5));
2782
- intView.setUint8(0, 4);
2783
- intView.setInt32(1, header.value, false);
2784
- return new Uint8Array(intView.buffer);
2785
- case "long":
2786
- const longBytes = new Uint8Array(9);
2787
- longBytes[0] = 5;
2788
- longBytes.set(header.value.bytes, 1);
2789
- return longBytes;
2790
- case "binary":
2791
- const binView = new DataView(new ArrayBuffer(3 + header.value.byteLength));
2792
- binView.setUint8(0, 6);
2793
- binView.setUint16(1, header.value.byteLength, false);
2794
- const binBytes = new Uint8Array(binView.buffer);
2795
- binBytes.set(header.value, 3);
2796
- return binBytes;
2797
- case "string":
2798
- const utf8Bytes = fromUtf8(header.value);
2799
- const strView = new DataView(new ArrayBuffer(3 + utf8Bytes.byteLength));
2800
- strView.setUint8(0, 7);
2801
- strView.setUint16(1, utf8Bytes.byteLength, false);
2802
- const strBytes = new Uint8Array(strView.buffer);
2803
- strBytes.set(utf8Bytes, 3);
2804
- return strBytes;
2805
- case "timestamp":
2806
- const tsBytes = new Uint8Array(9);
2807
- tsBytes[0] = 8;
2808
- tsBytes.set(Int64.fromNumber(header.value.valueOf()).bytes, 1);
2809
- return tsBytes;
2810
- case "uuid":
2811
- if (!UUID_PATTERN.test(header.value)) {
2812
- throw new Error(`Invalid UUID received: ${header.value}`);
2813
- }
2814
- const uuidBytes = new Uint8Array(17);
2815
- uuidBytes[0] = 9;
2816
- uuidBytes.set(fromHex(header.value.replace(/\-/g, "")), 1);
2817
- return uuidBytes;
2818
- }
2819
- }
2820
- };
2821
- var HEADER_VALUE_TYPE;
2822
- (function(HEADER_VALUE_TYPE2) {
2823
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolTrue"] = 0] = "boolTrue";
2824
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["boolFalse"] = 1] = "boolFalse";
2825
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byte"] = 2] = "byte";
2826
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["short"] = 3] = "short";
2827
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["integer"] = 4] = "integer";
2828
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["long"] = 5] = "long";
2829
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["byteArray"] = 6] = "byteArray";
2830
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["string"] = 7] = "string";
2831
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["timestamp"] = 8] = "timestamp";
2832
- HEADER_VALUE_TYPE2[HEADER_VALUE_TYPE2["uuid"] = 9] = "uuid";
2833
- })(HEADER_VALUE_TYPE || (HEADER_VALUE_TYPE = {}));
2834
- var UUID_PATTERN = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;
2835
- var Int64 = class _Int64 {
2836
- static {
2837
- __name(this, "Int64");
2838
- }
2839
- bytes;
2840
- constructor(bytes) {
2841
- this.bytes = bytes;
2842
- if (bytes.byteLength !== 8) {
2843
- throw new Error("Int64 buffers must be exactly 8 bytes");
2844
- }
2845
- }
2846
- static fromNumber(number) {
2847
- if (number > 9223372036854776e3 || number < -9223372036854776e3) {
2848
- throw new Error(`${number} is too large (or, if negative, too small) to represent as an Int64`);
2849
- }
2850
- const bytes = new Uint8Array(8);
2851
- for (let i = 7, remaining = Math.abs(Math.round(number)); i > -1 && remaining > 0; i--, remaining /= 256) {
2852
- bytes[i] = remaining;
2853
- }
2854
- if (number < 0) {
2855
- negate(bytes);
2856
- }
2857
- return new _Int64(bytes);
2858
- }
2859
- valueOf() {
2860
- const bytes = this.bytes.slice(0);
2861
- const negative = bytes[0] & 128;
2862
- if (negative) {
2863
- negate(bytes);
2864
- }
2865
- return parseInt(toHex(bytes), 16) * (negative ? -1 : 1);
2866
- }
2867
- toString() {
2868
- return String(this.valueOf());
2869
- }
2870
- };
2871
- function negate(bytes) {
2872
- for (let i = 0; i < 8; i++) {
2873
- bytes[i] ^= 255;
2874
- }
2875
- for (let i = 7; i > -1; i--) {
2876
- bytes[i]++;
2877
- if (bytes[i] !== 0) break;
2878
- }
2879
- }
2880
- __name(negate, "negate");
2881
-
2882
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/headerUtil.js
2883
- init_esm_shims();
2884
- var hasHeader = /* @__PURE__ */ __name((soughtHeader, headers) => {
2885
- soughtHeader = soughtHeader.toLowerCase();
2886
- for (const headerName of Object.keys(headers)) {
2887
- if (soughtHeader === headerName.toLowerCase()) {
2888
- return true;
2889
- }
2890
- }
2891
- return false;
2892
- }, "hasHeader");
2893
-
2894
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/moveHeadersToQuery.js
2895
- init_esm_shims();
2896
- var moveHeadersToQuery = /* @__PURE__ */ __name((request, options = {}) => {
2897
- const { headers, query = {} } = HttpRequest.clone(request);
2898
- for (const name of Object.keys(headers)) {
2899
- const lname = name.toLowerCase();
2900
- if (lname.slice(0, 6) === "x-amz-" && !options.unhoistableHeaders?.has(lname) || options.hoistableHeaders?.has(lname)) {
2901
- query[name] = headers[name];
2902
- delete headers[name];
2903
- }
2904
- }
2905
- return {
2906
- ...request,
2907
- headers,
2908
- query
2909
- };
2910
- }, "moveHeadersToQuery");
2911
-
2912
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/prepareRequest.js
2913
- init_esm_shims();
2914
- var prepareRequest = /* @__PURE__ */ __name((request) => {
2915
- request = HttpRequest.clone(request);
2916
- for (const headerName of Object.keys(request.headers)) {
2917
- if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {
2918
- delete request.headers[headerName];
2919
- }
2920
- }
2921
- return request;
2922
- }, "prepareRequest");
2923
-
2924
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js
2925
- init_esm_shims();
2926
-
2927
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/getCanonicalQuery.js
2928
- init_esm_shims();
2929
- var getCanonicalQuery = /* @__PURE__ */ __name(({ query = {} }) => {
2930
- const keys = [];
2931
- const serialized = {};
2932
- for (const key of Object.keys(query)) {
2933
- if (key.toLowerCase() === SIGNATURE_HEADER) {
2934
- continue;
2935
- }
2936
- const encodedKey = escapeUri(key);
2937
- keys.push(encodedKey);
2938
- const value = query[key];
2939
- if (typeof value === "string") {
2940
- serialized[encodedKey] = `${encodedKey}=${escapeUri(value)}`;
2941
- } else if (Array.isArray(value)) {
2942
- serialized[encodedKey] = value.slice(0).reduce((encoded, value2) => encoded.concat([
2943
- `${encodedKey}=${escapeUri(value2)}`
2944
- ]), []).sort().join("&");
2945
- }
2946
- }
2947
- return keys.sort().map((key) => serialized[key]).filter((serialized2) => serialized2).join("&");
2948
- }, "getCanonicalQuery");
2949
-
2950
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/utilDate.js
2951
- init_esm_shims();
2952
- var iso8601 = /* @__PURE__ */ __name((time) => toDate(time).toISOString().replace(/\.\d{3}Z$/, "Z"), "iso8601");
2953
- var toDate = /* @__PURE__ */ __name((time) => {
2954
- if (typeof time === "number") {
2955
- return new Date(time * 1e3);
2956
- }
2957
- if (typeof time === "string") {
2958
- if (Number(time)) {
2959
- return new Date(Number(time) * 1e3);
2960
- }
2961
- return new Date(time);
2962
- }
2963
- return time;
2964
- }, "toDate");
2965
-
2966
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/SignatureV4Base.js
2967
- var SignatureV4Base = class {
2968
- static {
2969
- __name(this, "SignatureV4Base");
2970
- }
2971
- service;
2972
- regionProvider;
2973
- credentialProvider;
2974
- sha256;
2975
- uriEscapePath;
2976
- applyChecksum;
2977
- constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
2978
- this.service = service;
2979
- this.sha256 = sha256;
2980
- this.uriEscapePath = uriEscapePath;
2981
- this.applyChecksum = typeof applyChecksum === "boolean" ? applyChecksum : true;
2982
- this.regionProvider = normalizeProvider(region);
2983
- this.credentialProvider = normalizeProvider(credentials);
2984
- }
2985
- createCanonicalRequest(request, canonicalHeaders, payloadHash) {
2986
- const sortedHeaders = Object.keys(canonicalHeaders).sort();
2987
- return `${request.method}
2988
- ${this.getCanonicalPath(request)}
2989
- ${getCanonicalQuery(request)}
2990
- ${sortedHeaders.map((name) => `${name}:${canonicalHeaders[name]}`).join("\n")}
2991
-
2992
- ${sortedHeaders.join(";")}
2993
- ${payloadHash}`;
2994
- }
2995
- async createStringToSign(longDate, credentialScope, canonicalRequest, algorithmIdentifier) {
2996
- const hash = new this.sha256();
2997
- hash.update(toUint8Array(canonicalRequest));
2998
- const hashedRequest = await hash.digest();
2999
- return `${algorithmIdentifier}
3000
- ${longDate}
3001
- ${credentialScope}
3002
- ${toHex(hashedRequest)}`;
3003
- }
3004
- getCanonicalPath({ path }) {
3005
- if (this.uriEscapePath) {
3006
- const normalizedPathSegments = [];
3007
- for (const pathSegment of path.split("/")) {
3008
- if (pathSegment?.length === 0) continue;
3009
- if (pathSegment === ".") continue;
3010
- if (pathSegment === "..") {
3011
- normalizedPathSegments.pop();
3012
- } else {
3013
- normalizedPathSegments.push(pathSegment);
3014
- }
3015
- }
3016
- const normalizedPath = `${path?.startsWith("/") ? "/" : ""}${normalizedPathSegments.join("/")}${normalizedPathSegments.length > 0 && path?.endsWith("/") ? "/" : ""}`;
3017
- const doubleEncoded = escapeUri(normalizedPath);
3018
- return doubleEncoded.replace(/%2F/g, "/");
3019
- }
3020
- return path;
3021
- }
3022
- validateResolvedCredentials(credentials) {
3023
- if (typeof credentials !== "object" || typeof credentials.accessKeyId !== "string" || typeof credentials.secretAccessKey !== "string") {
3024
- throw new Error("Resolved credential object is not valid");
3025
- }
3026
- }
3027
- formatDate(now) {
3028
- const longDate = iso8601(now).replace(/[\-:]/g, "");
3029
- return {
3030
- longDate,
3031
- shortDate: longDate.slice(0, 8)
3032
- };
3033
- }
3034
- getCanonicalHeaderList(headers) {
3035
- return Object.keys(headers).sort().join(";");
3036
- }
3037
- };
3038
-
3039
- // ../../node_modules/.pnpm/@smithy+signature-v4@5.3.5/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js
3040
- var SignatureV4 = class extends SignatureV4Base {
3041
- static {
3042
- __name(this, "SignatureV4");
3043
- }
3044
- headerFormatter = new HeaderFormatter();
3045
- constructor({ applyChecksum, credentials, region, service, sha256, uriEscapePath = true }) {
3046
- super({
3047
- applyChecksum,
3048
- credentials,
3049
- region,
3050
- service,
3051
- sha256,
3052
- uriEscapePath
3053
- });
3054
- }
3055
- async presign(originalRequest, options = {}) {
3056
- const { signingDate = /* @__PURE__ */ new Date(), expiresIn = 3600, unsignableHeaders, unhoistableHeaders, signableHeaders, hoistableHeaders, signingRegion, signingService } = options;
3057
- const credentials = await this.credentialProvider();
3058
- this.validateResolvedCredentials(credentials);
3059
- const region = signingRegion ?? await this.regionProvider();
3060
- const { longDate, shortDate } = this.formatDate(signingDate);
3061
- if (expiresIn > MAX_PRESIGNED_TTL) {
3062
- return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");
3063
- }
3064
- const scope = createScope(shortDate, region, signingService ?? this.service);
3065
- const request = moveHeadersToQuery(prepareRequest(originalRequest), {
3066
- unhoistableHeaders,
3067
- hoistableHeaders
3068
- });
3069
- if (credentials.sessionToken) {
3070
- request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;
3071
- }
3072
- request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;
3073
- request.query[CREDENTIAL_QUERY_PARAM] = `${credentials.accessKeyId}/${scope}`;
3074
- request.query[AMZ_DATE_QUERY_PARAM] = longDate;
3075
- request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);
3076
- const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
3077
- request.query[SIGNED_HEADERS_QUERY_PARAM] = this.getCanonicalHeaderList(canonicalHeaders);
3078
- request.query[SIGNATURE_QUERY_PARAM] = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, await getPayloadHash(originalRequest, this.sha256)));
3079
- return request;
3080
- }
3081
- async sign(toSign, options) {
3082
- if (typeof toSign === "string") {
3083
- return this.signString(toSign, options);
3084
- } else if (toSign.headers && toSign.payload) {
3085
- return this.signEvent(toSign, options);
3086
- } else if (toSign.message) {
3087
- return this.signMessage(toSign, options);
3088
- } else {
3089
- return this.signRequest(toSign, options);
3090
- }
3091
- }
3092
- async signEvent({ headers, payload }, { signingDate = /* @__PURE__ */ new Date(), priorSignature, signingRegion, signingService }) {
3093
- const region = signingRegion ?? await this.regionProvider();
3094
- const { shortDate, longDate } = this.formatDate(signingDate);
3095
- const scope = createScope(shortDate, region, signingService ?? this.service);
3096
- const hashedPayload = await getPayloadHash({
3097
- headers: {},
3098
- body: payload
3099
- }, this.sha256);
3100
- const hash = new this.sha256();
3101
- hash.update(headers);
3102
- const hashedHeaders = toHex(await hash.digest());
3103
- const stringToSign = [
3104
- EVENT_ALGORITHM_IDENTIFIER,
3105
- longDate,
3106
- scope,
3107
- priorSignature,
3108
- hashedHeaders,
3109
- hashedPayload
3110
- ].join("\n");
3111
- return this.signString(stringToSign, {
3112
- signingDate,
3113
- signingRegion: region,
3114
- signingService
3115
- });
3116
- }
3117
- async signMessage(signableMessage, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService }) {
3118
- const promise = this.signEvent({
3119
- headers: this.headerFormatter.format(signableMessage.message.headers),
3120
- payload: signableMessage.message.body
3121
- }, {
3122
- signingDate,
3123
- signingRegion,
3124
- signingService,
3125
- priorSignature: signableMessage.priorSignature
3126
- });
3127
- return promise.then((signature) => {
3128
- return {
3129
- message: signableMessage.message,
3130
- signature
3131
- };
3132
- });
3133
- }
3134
- async signString(stringToSign, { signingDate = /* @__PURE__ */ new Date(), signingRegion, signingService } = {}) {
3135
- const credentials = await this.credentialProvider();
3136
- this.validateResolvedCredentials(credentials);
3137
- const region = signingRegion ?? await this.regionProvider();
3138
- const { shortDate } = this.formatDate(signingDate);
3139
- const hash = new this.sha256(await this.getSigningKey(credentials, region, shortDate, signingService));
3140
- hash.update(toUint8Array(stringToSign));
3141
- return toHex(await hash.digest());
3142
- }
3143
- async signRequest(requestToSign, { signingDate = /* @__PURE__ */ new Date(), signableHeaders, unsignableHeaders, signingRegion, signingService } = {}) {
3144
- const credentials = await this.credentialProvider();
3145
- this.validateResolvedCredentials(credentials);
3146
- const region = signingRegion ?? await this.regionProvider();
3147
- const request = prepareRequest(requestToSign);
3148
- const { longDate, shortDate } = this.formatDate(signingDate);
3149
- const scope = createScope(shortDate, region, signingService ?? this.service);
3150
- request.headers[AMZ_DATE_HEADER] = longDate;
3151
- if (credentials.sessionToken) {
3152
- request.headers[TOKEN_HEADER] = credentials.sessionToken;
3153
- }
3154
- const payloadHash = await getPayloadHash(request, this.sha256);
3155
- if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {
3156
- request.headers[SHA256_HEADER] = payloadHash;
3157
- }
3158
- const canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);
3159
- const signature = await this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash));
3160
- request.headers[AUTH_HEADER] = `${ALGORITHM_IDENTIFIER} Credential=${credentials.accessKeyId}/${scope}, SignedHeaders=${this.getCanonicalHeaderList(canonicalHeaders)}, Signature=${signature}`;
3161
- return request;
3162
- }
3163
- async getSignature(longDate, credentialScope, keyPromise, canonicalRequest) {
3164
- const stringToSign = await this.createStringToSign(longDate, credentialScope, canonicalRequest, ALGORITHM_IDENTIFIER);
3165
- const hash = new this.sha256(await keyPromise);
3166
- hash.update(toUint8Array(stringToSign));
3167
- return toHex(await hash.digest());
3168
- }
3169
- getSigningKey(credentials, region, shortDate, service) {
3170
- return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);
3171
- }
3172
- };
3173
-
3174
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.js
3175
- var resolveAwsSdkSigV4Config = /* @__PURE__ */ __name((config) => {
3176
- let inputCredentials = config.credentials;
3177
- let isUserSupplied = !!config.credentials;
3178
- let resolvedCredentials = void 0;
3179
- Object.defineProperty(config, "credentials", {
3180
- set(credentials) {
3181
- if (credentials && credentials !== inputCredentials && credentials !== resolvedCredentials) {
3182
- isUserSupplied = true;
3183
- }
3184
- inputCredentials = credentials;
3185
- const memoizedProvider = normalizeCredentialProvider(config, {
3186
- credentials: inputCredentials,
3187
- credentialDefaultProvider: config.credentialDefaultProvider
3188
- });
3189
- const boundProvider = bindCallerConfig(config, memoizedProvider);
3190
- if (isUserSupplied && !boundProvider.attributed) {
3191
- resolvedCredentials = /* @__PURE__ */ __name(async (options) => boundProvider(options).then((creds) => setCredentialFeature(creds, "CREDENTIALS_CODE", "e")), "resolvedCredentials");
3192
- resolvedCredentials.memoized = boundProvider.memoized;
3193
- resolvedCredentials.configBound = boundProvider.configBound;
3194
- resolvedCredentials.attributed = true;
3195
- } else {
3196
- resolvedCredentials = boundProvider;
3197
- }
3198
- },
3199
- get() {
3200
- return resolvedCredentials;
3201
- },
3202
- enumerable: true,
3203
- configurable: true
3204
- });
3205
- config.credentials = inputCredentials;
3206
- const { signingEscapePath = true, systemClockOffset = config.systemClockOffset || 0, sha256 } = config;
3207
- let signer;
3208
- if (config.signer) {
3209
- signer = normalizeProvider2(config.signer);
3210
- } else if (config.regionInfoProvider) {
3211
- signer = /* @__PURE__ */ __name(() => normalizeProvider2(config.region)().then(async (region) => [
3212
- await config.regionInfoProvider(region, {
3213
- useFipsEndpoint: await config.useFipsEndpoint(),
3214
- useDualstackEndpoint: await config.useDualstackEndpoint()
3215
- }) || {},
3216
- region
3217
- ]).then(([regionInfo, region]) => {
3218
- const { signingRegion, signingService } = regionInfo;
3219
- config.signingRegion = config.signingRegion || signingRegion || region;
3220
- config.signingName = config.signingName || signingService || config.serviceId;
3221
- const params = {
3222
- ...config,
3223
- credentials: config.credentials,
3224
- region: config.signingRegion,
3225
- service: config.signingName,
3226
- sha256,
3227
- uriEscapePath: signingEscapePath
3228
- };
3229
- const SignerCtor = config.signerConstructor || SignatureV4;
3230
- return new SignerCtor(params);
3231
- }), "signer");
3232
- } else {
3233
- signer = /* @__PURE__ */ __name(async (authScheme) => {
3234
- authScheme = Object.assign({}, {
3235
- name: "sigv4",
3236
- signingName: config.signingName || config.defaultSigningName,
3237
- signingRegion: await normalizeProvider2(config.region)(),
3238
- properties: {}
3239
- }, authScheme);
3240
- const signingRegion = authScheme.signingRegion;
3241
- const signingService = authScheme.signingName;
3242
- config.signingRegion = config.signingRegion || signingRegion;
3243
- config.signingName = config.signingName || signingService || config.serviceId;
3244
- const params = {
3245
- ...config,
3246
- credentials: config.credentials,
3247
- region: config.signingRegion,
3248
- service: config.signingName,
3249
- sha256,
3250
- uriEscapePath: signingEscapePath
3251
- };
3252
- const SignerCtor = config.signerConstructor || SignatureV4;
3253
- return new SignerCtor(params);
3254
- }, "signer");
3255
- }
3256
- const resolvedConfig = Object.assign(config, {
3257
- systemClockOffset,
3258
- signingEscapePath,
3259
- signer
3260
- });
3261
- return resolvedConfig;
3262
- }, "resolveAwsSdkSigV4Config");
3263
- function normalizeCredentialProvider(config, { credentials, credentialDefaultProvider }) {
3264
- let credentialsProvider;
3265
- if (credentials) {
3266
- if (!credentials?.memoized) {
3267
- credentialsProvider = memoizeIdentityProvider(credentials, isIdentityExpired, doesIdentityRequireRefresh);
3268
- } else {
3269
- credentialsProvider = credentials;
3270
- }
3271
- } else {
3272
- if (credentialDefaultProvider) {
3273
- credentialsProvider = normalizeProvider2(credentialDefaultProvider(Object.assign({}, config, {
3274
- parentClientConfig: config
3275
- })));
3276
- } else {
3277
- credentialsProvider = /* @__PURE__ */ __name(async () => {
3278
- throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.");
3279
- }, "credentialsProvider");
3280
- }
3281
- }
3282
- credentialsProvider.memoized = true;
3283
- return credentialsProvider;
3284
- }
3285
- __name(normalizeCredentialProvider, "normalizeCredentialProvider");
3286
- function bindCallerConfig(config, credentialsProvider) {
3287
- if (credentialsProvider.configBound) {
3288
- return credentialsProvider;
3289
- }
3290
- const fn = /* @__PURE__ */ __name(async (options) => credentialsProvider({
3291
- ...options,
3292
- callerClientConfig: config
3293
- }), "fn");
3294
- fn.memoized = credentialsProvider.memoized;
3295
- fn.configBound = true;
3296
- return fn;
3297
- }
3298
- __name(bindCallerConfig, "bindCallerConfig");
3299
-
3300
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
3301
- init_esm_shims();
3302
-
3303
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/collect-stream-body.js
3304
- init_esm_shims();
3305
-
3306
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/default-error-handler.js
3307
- init_esm_shims();
3308
- var throwDefaultError = /* @__PURE__ */ __name(({ output, parsedBody, exceptionCtor, errorCode }) => {
3309
- const $metadata = deserializeMetadata(output);
3310
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : void 0;
3311
- const response = new exceptionCtor({
3312
- name: parsedBody?.code || parsedBody?.Code || errorCode || statusCode || "UnknownError",
3313
- $fault: "client",
3314
- $metadata
3315
- });
3316
- throw decorateServiceException(response, parsedBody);
3317
- }, "throwDefaultError");
3318
- var withBaseException = /* @__PURE__ */ __name((ExceptionCtor) => {
3319
- return ({ output, parsedBody, errorCode }) => {
3320
- throwDefaultError({
3321
- output,
3322
- parsedBody,
3323
- exceptionCtor: ExceptionCtor,
3324
- errorCode
3325
- });
3326
- };
3327
- }, "withBaseException");
3328
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
3329
- httpStatusCode: output.statusCode,
3330
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
3331
- extendedRequestId: output.headers["x-amz-id-2"],
3332
- cfId: output.headers["x-amz-cf-id"]
3333
- }), "deserializeMetadata");
3334
-
3335
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/defaults-mode.js
3336
- init_esm_shims();
3337
- var loadConfigsForDefaultMode = /* @__PURE__ */ __name((mode) => {
3338
- switch (mode) {
3339
- case "standard":
3340
- return {
3341
- retryMode: "standard",
3342
- connectionTimeout: 3100
3343
- };
3344
- case "in-region":
3345
- return {
3346
- retryMode: "standard",
3347
- connectionTimeout: 1100
3348
- };
3349
- case "cross-region":
3350
- return {
3351
- retryMode: "standard",
3352
- connectionTimeout: 3100
3353
- };
3354
- case "mobile":
3355
- return {
3356
- retryMode: "standard",
3357
- connectionTimeout: 3e4
3358
- };
3359
- default:
3360
- return {};
3361
- }
3362
- }, "loadConfigsForDefaultMode");
3363
-
3364
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/emitWarningIfUnsupportedVersion.js
3365
- init_esm_shims();
3366
- var warningEmitted = false;
3367
- var emitWarningIfUnsupportedVersion2 = /* @__PURE__ */ __name((version) => {
3368
- if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
3369
- warningEmitted = true;
3370
- }
3371
- }, "emitWarningIfUnsupportedVersion");
3372
-
3373
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
3374
- init_esm_shims();
3375
-
3376
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/extensions/checksum.js
3377
- init_esm_shims();
3378
- var getChecksumConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
3379
- const checksumAlgorithms = [];
3380
- for (const id in AlgorithmId) {
3381
- const algorithmId = AlgorithmId[id];
3382
- if (runtimeConfig[algorithmId] === void 0) {
3383
- continue;
3384
- }
3385
- checksumAlgorithms.push({
3386
- algorithmId: /* @__PURE__ */ __name(() => algorithmId, "algorithmId"),
3387
- checksumConstructor: /* @__PURE__ */ __name(() => runtimeConfig[algorithmId], "checksumConstructor")
3388
- });
3389
- }
3390
- return {
3391
- addChecksumAlgorithm(algo) {
3392
- checksumAlgorithms.push(algo);
3393
- },
3394
- checksumAlgorithms() {
3395
- return checksumAlgorithms;
3396
- }
3397
- };
3398
- }, "getChecksumConfiguration");
3399
- var resolveChecksumRuntimeConfig = /* @__PURE__ */ __name((clientConfig) => {
3400
- const runtimeConfig = {};
3401
- clientConfig.checksumAlgorithms().forEach((checksumAlgorithm) => {
3402
- runtimeConfig[checksumAlgorithm.algorithmId()] = checksumAlgorithm.checksumConstructor();
3403
- });
3404
- return runtimeConfig;
3405
- }, "resolveChecksumRuntimeConfig");
3406
-
3407
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/extensions/retry.js
3408
- init_esm_shims();
3409
- var getRetryConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
3410
- return {
3411
- setRetryStrategy(retryStrategy) {
3412
- runtimeConfig.retryStrategy = retryStrategy;
3413
- },
3414
- retryStrategy() {
3415
- return runtimeConfig.retryStrategy;
3416
- }
3417
- };
3418
- }, "getRetryConfiguration");
3419
- var resolveRetryRuntimeConfig = /* @__PURE__ */ __name((retryStrategyConfiguration) => {
3420
- const runtimeConfig = {};
3421
- runtimeConfig.retryStrategy = retryStrategyConfiguration.retryStrategy();
3422
- return runtimeConfig;
3423
- }, "resolveRetryRuntimeConfig");
3424
-
3425
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/extensions/defaultExtensionConfiguration.js
3426
- var getDefaultExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
3427
- return Object.assign(getChecksumConfiguration(runtimeConfig), getRetryConfiguration(runtimeConfig));
3428
- }, "getDefaultExtensionConfiguration");
3429
- var resolveDefaultRuntimeConfig = /* @__PURE__ */ __name((config) => {
3430
- return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
3431
- }, "resolveDefaultRuntimeConfig");
3432
-
3433
- // ../../node_modules/.pnpm/@smithy+smithy-client@4.9.8/node_modules/@smithy/smithy-client/dist-es/NoOpLogger.js
3434
- init_esm_shims();
3435
- var NoOpLogger = class {
3436
- static {
3437
- __name(this, "NoOpLogger");
3438
- }
3439
- trace() {
3440
- }
3441
- debug() {
3442
- }
3443
- info() {
3444
- }
3445
- warn() {
3446
- }
3447
- error() {
3448
- }
3449
- };
3450
-
3451
- // ../../node_modules/.pnpm/@aws-sdk+core@3.879.0/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
3452
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? toUtf8)(body)), "collectBodyString");
3453
-
3454
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/check-features.js
3455
- var ACCOUNT_ID_ENDPOINT_REGEX = /\d{12}\.ddb/;
3456
- async function checkFeatures(context, config, args) {
3457
- const request = args.request;
3458
- if (request?.headers?.["smithy-protocol"] === "rpc-v2-cbor") {
3459
- setFeature2(context, "PROTOCOL_RPC_V2_CBOR", "M");
3460
- }
3461
- if (typeof config.retryStrategy === "function") {
3462
- const retryStrategy = await config.retryStrategy();
3463
- if (typeof retryStrategy.acquireInitialRetryToken === "function") {
3464
- if (retryStrategy.constructor?.name?.includes("Adaptive")) {
3465
- setFeature2(context, "RETRY_MODE_ADAPTIVE", "F");
3466
- } else {
3467
- setFeature2(context, "RETRY_MODE_STANDARD", "E");
3468
- }
3469
- } else {
3470
- setFeature2(context, "RETRY_MODE_LEGACY", "D");
3471
- }
3472
- }
3473
- if (typeof config.accountIdEndpointMode === "function") {
3474
- const endpointV2 = context.endpointV2;
3475
- if (String(endpointV2?.url?.hostname).match(ACCOUNT_ID_ENDPOINT_REGEX)) {
3476
- setFeature2(context, "ACCOUNT_ID_ENDPOINT", "O");
3477
- }
3478
- switch (await config.accountIdEndpointMode?.()) {
3479
- case "disabled":
3480
- setFeature2(context, "ACCOUNT_ID_MODE_DISABLED", "Q");
3481
- break;
3482
- case "preferred":
3483
- setFeature2(context, "ACCOUNT_ID_MODE_PREFERRED", "P");
3484
- break;
3485
- case "required":
3486
- setFeature2(context, "ACCOUNT_ID_MODE_REQUIRED", "R");
3487
- break;
3488
- }
3489
- }
3490
- const identity = context.__smithy_context?.selectedHttpAuthScheme?.identity;
3491
- if (identity?.$source) {
3492
- const credentials = identity;
3493
- if (credentials.accountId) {
3494
- setFeature2(context, "RESOLVED_ACCOUNT_ID", "T");
3495
- }
3496
- for (const [key, value] of Object.entries(credentials.$source ?? {})) {
3497
- setFeature2(context, key, value);
3498
- }
3499
- }
3500
- }
3501
- __name(checkFeatures, "checkFeatures");
3502
-
3503
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/constants.js
3504
- init_esm_shims();
3505
- var USER_AGENT = "user-agent";
3506
- var X_AMZ_USER_AGENT = "x-amz-user-agent";
3507
- var SPACE = " ";
3508
- var UA_NAME_SEPARATOR = "/";
3509
- var UA_NAME_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g;
3510
- var UA_VALUE_ESCAPE_REGEX = /[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g;
3511
- var UA_ESCAPE_CHAR = "-";
3512
-
3513
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/encode-features.js
3514
- init_esm_shims();
3515
- var BYTE_LIMIT = 1024;
3516
- function encodeFeatures(features) {
3517
- let buffer = "";
3518
- for (const key in features) {
3519
- const val = features[key];
3520
- if (buffer.length + val.length + 1 <= BYTE_LIMIT) {
3521
- if (buffer.length) {
3522
- buffer += "," + val;
3523
- } else {
3524
- buffer += val;
3525
- }
3526
- continue;
3527
- }
3528
- break;
3529
- }
3530
- return buffer;
3531
- }
3532
- __name(encodeFeatures, "encodeFeatures");
3533
-
3534
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/user-agent-middleware.js
3535
- var userAgentMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
3536
- const { request } = args;
3537
- if (!HttpRequest.isInstance(request)) {
3538
- return next(args);
3539
- }
3540
- const { headers } = request;
3541
- const userAgent = context?.userAgent?.map(escapeUserAgent) || [];
3542
- const defaultUserAgent = (await options.defaultUserAgentProvider()).map(escapeUserAgent);
3543
- await checkFeatures(context, options, args);
3544
- const awsContext = context;
3545
- defaultUserAgent.push(`m/${encodeFeatures(Object.assign({}, context.__smithy_context?.features, awsContext.__aws_sdk_context?.features))}`);
3546
- const customUserAgent = options?.customUserAgent?.map(escapeUserAgent) || [];
3547
- const appId = await options.userAgentAppId();
3548
- if (appId) {
3549
- defaultUserAgent.push(escapeUserAgent([
3550
- `app/${appId}`
3551
- ]));
3552
- }
3553
- const prefix = getUserAgentPrefix();
3554
- const sdkUserAgentValue = (prefix ? [
3555
- prefix
3556
- ] : []).concat([
3557
- ...defaultUserAgent,
3558
- ...userAgent,
3559
- ...customUserAgent
3560
- ]).join(SPACE);
3561
- const normalUAValue = [
3562
- ...defaultUserAgent.filter((section) => section.startsWith("aws-sdk-")),
3563
- ...customUserAgent
3564
- ].join(SPACE);
3565
- if (options.runtime !== "browser") {
3566
- if (normalUAValue) {
3567
- headers[X_AMZ_USER_AGENT] = headers[X_AMZ_USER_AGENT] ? `${headers[USER_AGENT]} ${normalUAValue}` : normalUAValue;
3568
- }
3569
- headers[USER_AGENT] = sdkUserAgentValue;
3570
- } else {
3571
- headers[X_AMZ_USER_AGENT] = sdkUserAgentValue;
3572
- }
3573
- return next({
3574
- ...args,
3575
- request
3576
- });
3577
- }, "userAgentMiddleware");
3578
- var escapeUserAgent = /* @__PURE__ */ __name((userAgentPair) => {
3579
- const name = userAgentPair[0].split(UA_NAME_SEPARATOR).map((part) => part.replace(UA_NAME_ESCAPE_REGEX, UA_ESCAPE_CHAR)).join(UA_NAME_SEPARATOR);
3580
- const version = userAgentPair[1]?.replace(UA_VALUE_ESCAPE_REGEX, UA_ESCAPE_CHAR);
3581
- const prefixSeparatorIndex = name.indexOf(UA_NAME_SEPARATOR);
3582
- const prefix = name.substring(0, prefixSeparatorIndex);
3583
- let uaName = name.substring(prefixSeparatorIndex + 1);
3584
- if (prefix === "api") {
3585
- uaName = uaName.toLowerCase();
3586
- }
3587
- return [
3588
- prefix,
3589
- uaName,
3590
- version
3591
- ].filter((item) => item && item.length > 0).reduce((acc, item, index) => {
3592
- switch (index) {
3593
- case 0:
3594
- return item;
3595
- case 1:
3596
- return `${acc}/${item}`;
3597
- default:
3598
- return `${acc}#${item}`;
3599
- }
3600
- }, "");
3601
- }, "escapeUserAgent");
3602
- var getUserAgentMiddlewareOptions = {
3603
- name: "getUserAgentMiddleware",
3604
- step: "build",
3605
- priority: "low",
3606
- tags: [
3607
- "SET_USER_AGENT",
3608
- "USER_AGENT"
3609
- ],
3610
- override: true
3611
- };
3612
- var getUserAgentPlugin = /* @__PURE__ */ __name((config) => ({
3613
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
3614
- clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);
3615
- }, "applyToStack")
3616
- }), "getUserAgentPlugin");
3617
-
3618
- // ../../node_modules/.pnpm/@aws-sdk+middleware-user-agent@3.879.0/node_modules/@aws-sdk/middleware-user-agent/dist-es/index.js
3619
- init_esm_shims();
3620
-
3621
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js
3622
- init_esm_shims();
3623
-
3624
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/checkRegion.js
3625
- init_esm_shims();
3626
- var validRegions = /* @__PURE__ */ new Set();
3627
- var checkRegion = /* @__PURE__ */ __name((region, check = isValidHostLabel) => {
3628
- if (!validRegions.has(region) && !check(region)) {
3629
- if (region === "*") {
3630
- console.warn(`@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.`);
3631
- } else {
3632
- throw new Error(`Region not accepted: region="${region}" is not a valid hostname component.`);
3633
- }
3634
- } else {
3635
- validRegions.add(region);
3636
- }
3637
- }, "checkRegion");
3638
-
3639
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js
3640
- init_esm_shims();
3641
-
3642
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/isFipsRegion.js
3643
- init_esm_shims();
3644
- var isFipsRegion = /* @__PURE__ */ __name((region) => typeof region === "string" && (region.startsWith("fips-") || region.endsWith("-fips")), "isFipsRegion");
3645
-
3646
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/getRealRegion.js
3647
- var getRealRegion = /* @__PURE__ */ __name((region) => isFipsRegion(region) ? [
3648
- "fips-aws-global",
3649
- "aws-fips"
3650
- ].includes(region) ? "us-east-1" : region.replace(/fips-(dkr-|prod-)?|-fips/, "") : region, "getRealRegion");
3651
-
3652
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/resolveRegionConfig.js
3653
- var resolveRegionConfig = /* @__PURE__ */ __name((input) => {
3654
- const { region, useFipsEndpoint } = input;
3655
- if (!region) {
3656
- throw new Error("Region is missing");
3657
- }
3658
- return Object.assign(input, {
3659
- region: /* @__PURE__ */ __name(async () => {
3660
- const providedRegion = typeof region === "function" ? await region() : region;
3661
- const realRegion = getRealRegion(providedRegion);
3662
- checkRegion(realRegion);
3663
- return realRegion;
3664
- }, "region"),
3665
- useFipsEndpoint: /* @__PURE__ */ __name(async () => {
3666
- const providedRegion = typeof region === "string" ? region : await region();
3667
- if (isFipsRegion(providedRegion)) {
3668
- return true;
3669
- }
3670
- return typeof useFipsEndpoint !== "function" ? Promise.resolve(!!useFipsEndpoint) : useFipsEndpoint();
3671
- }, "useFipsEndpoint")
3672
- });
3673
- }, "resolveRegionConfig");
3674
-
3675
- // ../../node_modules/.pnpm/@smithy+middleware-content-length@4.2.5/node_modules/@smithy/middleware-content-length/dist-es/index.js
3676
- init_esm_shims();
3677
- var CONTENT_LENGTH_HEADER = "content-length";
3678
- function contentLengthMiddleware(bodyLengthChecker) {
3679
- return (next) => async (args) => {
3680
- const request = args.request;
3681
- if (HttpRequest.isInstance(request)) {
3682
- const { body, headers } = request;
3683
- if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) {
3684
- try {
3685
- const length = bodyLengthChecker(body);
3686
- request.headers = {
3687
- ...request.headers,
3688
- [CONTENT_LENGTH_HEADER]: String(length)
3689
- };
3690
- } catch (error) {
3691
- }
3692
- }
3693
- }
3694
- return next({
3695
- ...args,
3696
- request
3697
- });
3698
- };
3699
- }
3700
- __name(contentLengthMiddleware, "contentLengthMiddleware");
3701
- var contentLengthMiddlewareOptions = {
3702
- step: "build",
3703
- tags: [
3704
- "SET_CONTENT_LENGTH",
3705
- "CONTENT_LENGTH"
3706
- ],
3707
- name: "contentLengthMiddleware",
3708
- override: true
3709
- };
3710
- var getContentLengthPlugin = /* @__PURE__ */ __name((options) => ({
3711
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
3712
- clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
3713
- }, "applyToStack")
3714
- }), "getContentLengthPlugin");
3715
-
3716
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js
3717
- init_esm_shims();
3718
-
3719
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
3720
- init_esm_shims();
3721
-
3722
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js
3723
- init_esm_shims();
3724
-
3725
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/service-customizations/s3.js
3726
- init_esm_shims();
3727
- var resolveParamsForS3 = /* @__PURE__ */ __name(async (endpointParams) => {
3728
- const bucket = endpointParams?.Bucket || "";
3729
- if (typeof endpointParams.Bucket === "string") {
3730
- endpointParams.Bucket = bucket.replace(/#/g, encodeURIComponent("#")).replace(/\?/g, encodeURIComponent("?"));
3731
- }
3732
- if (isArnBucketName(bucket)) {
3733
- if (endpointParams.ForcePathStyle === true) {
3734
- throw new Error("Path-style addressing cannot be used with ARN buckets");
3735
- }
3736
- } else if (!isDnsCompatibleBucketName(bucket) || bucket.indexOf(".") !== -1 && !String(endpointParams.Endpoint).startsWith("http:") || bucket.toLowerCase() !== bucket || bucket.length < 3) {
3737
- endpointParams.ForcePathStyle = true;
3738
- }
3739
- if (endpointParams.DisableMultiRegionAccessPoints) {
3740
- endpointParams.disableMultiRegionAccessPoints = true;
3741
- endpointParams.DisableMRAP = true;
3742
- }
3743
- return endpointParams;
3744
- }, "resolveParamsForS3");
3745
- var DOMAIN_PATTERN = /^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/;
3746
- var IP_ADDRESS_PATTERN = /(\d+\.){3}\d+/;
3747
- var DOTS_PATTERN = /\.\./;
3748
- var isDnsCompatibleBucketName = /* @__PURE__ */ __name((bucketName) => DOMAIN_PATTERN.test(bucketName) && !IP_ADDRESS_PATTERN.test(bucketName) && !DOTS_PATTERN.test(bucketName), "isDnsCompatibleBucketName");
3749
- var isArnBucketName = /* @__PURE__ */ __name((bucketName) => {
3750
- const [arn, partition2, service, , , bucket] = bucketName.split(":");
3751
- const isArn = arn === "arn" && bucketName.split(":").length >= 6;
3752
- const isValidArn = Boolean(isArn && partition2 && service && bucket);
3753
- if (isArn && !isValidArn) {
3754
- throw new Error(`Invalid ARN: ${bucketName} was an invalid ARN.`);
3755
- }
3756
- return isValidArn;
3757
- }, "isArnBucketName");
3758
-
3759
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js
3760
- init_esm_shims();
3761
- var createConfigValueProvider = /* @__PURE__ */ __name((configKey, canonicalEndpointParamKey, config) => {
3762
- const configProvider = /* @__PURE__ */ __name(async () => {
3763
- const configValue = config[configKey] ?? config[canonicalEndpointParamKey];
3764
- if (typeof configValue === "function") {
3765
- return configValue();
3766
- }
3767
- return configValue;
3768
- }, "configProvider");
3769
- if (configKey === "credentialScope" || canonicalEndpointParamKey === "CredentialScope") {
3770
- return async () => {
3771
- const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
3772
- const configValue = credentials?.credentialScope ?? credentials?.CredentialScope;
3773
- return configValue;
3774
- };
3775
- }
3776
- if (configKey === "accountId" || canonicalEndpointParamKey === "AccountId") {
3777
- return async () => {
3778
- const credentials = typeof config.credentials === "function" ? await config.credentials() : config.credentials;
3779
- const configValue = credentials?.accountId ?? credentials?.AccountId;
3780
- return configValue;
3781
- };
3782
- }
3783
- if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
3784
- return async () => {
3785
- if (config.isCustomEndpoint === false) {
3786
- return void 0;
3787
- }
3788
- const endpoint = await configProvider();
3789
- if (endpoint && typeof endpoint === "object") {
3790
- if ("url" in endpoint) {
3791
- return endpoint.url.href;
3792
- }
3793
- if ("hostname" in endpoint) {
3794
- const { protocol, hostname, port, path } = endpoint;
3795
- return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
3796
- }
3797
- }
3798
- return endpoint;
3799
- };
3800
- }
3801
- return configProvider;
3802
- }, "createConfigValueProvider");
3803
-
3804
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js
3805
- init_esm_shims();
3806
-
3807
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointUrlConfig.js
3808
- init_esm_shims();
3809
- var ENV_ENDPOINT_URL = "AWS_ENDPOINT_URL";
3810
- var CONFIG_ENDPOINT_URL = "endpoint_url";
3811
- var getEndpointUrlConfig = /* @__PURE__ */ __name((serviceId) => ({
3812
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => {
3813
- const serviceSuffixParts = serviceId.split(" ").map((w) => w.toUpperCase());
3814
- const serviceEndpointUrl = env2[[
3815
- ENV_ENDPOINT_URL,
3816
- ...serviceSuffixParts
3817
- ].join("_")];
3818
- if (serviceEndpointUrl) return serviceEndpointUrl;
3819
- const endpointUrl = env2[ENV_ENDPOINT_URL];
3820
- if (endpointUrl) return endpointUrl;
3821
- return void 0;
3822
- }, "environmentVariableSelector"),
3823
- configFileSelector: /* @__PURE__ */ __name((profile, config) => {
3824
- if (config && profile.services) {
3825
- const servicesSection = config[[
3826
- "services",
3827
- profile.services
3828
- ].join(CONFIG_PREFIX_SEPARATOR)];
3829
- if (servicesSection) {
3830
- const servicePrefixParts = serviceId.split(" ").map((w) => w.toLowerCase());
3831
- const endpointUrl2 = servicesSection[[
3832
- servicePrefixParts.join("_"),
3833
- CONFIG_ENDPOINT_URL
3834
- ].join(CONFIG_PREFIX_SEPARATOR)];
3835
- if (endpointUrl2) return endpointUrl2;
3836
- }
3837
- }
3838
- const endpointUrl = profile[CONFIG_ENDPOINT_URL];
3839
- if (endpointUrl) return endpointUrl;
3840
- return void 0;
3841
- }, "configFileSelector"),
3842
- default: void 0
3843
- }), "getEndpointUrlConfig");
3844
-
3845
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js
3846
- var getEndpointFromConfig = /* @__PURE__ */ __name(async (serviceId) => loadConfig(getEndpointUrlConfig(serviceId ?? ""))(), "getEndpointFromConfig");
3847
-
3848
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/toEndpointV1.js
3849
- init_esm_shims();
3850
- var toEndpointV1 = /* @__PURE__ */ __name((endpoint) => {
3851
- if (typeof endpoint === "object") {
3852
- if ("url" in endpoint) {
3853
- return parseUrl(endpoint.url);
3854
- }
3855
- return endpoint;
3856
- }
3857
- return parseUrl(endpoint);
3858
- }, "toEndpointV1");
3859
-
3860
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js
3861
- var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => {
3862
- if (!clientConfig.isCustomEndpoint) {
3863
- let endpointFromConfig;
3864
- if (clientConfig.serviceConfiguredEndpoint) {
3865
- endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
3866
- } else {
3867
- endpointFromConfig = await getEndpointFromConfig(clientConfig.serviceId);
3868
- }
3869
- if (endpointFromConfig) {
3870
- clientConfig.endpoint = () => Promise.resolve(toEndpointV1(endpointFromConfig));
3871
- clientConfig.isCustomEndpoint = true;
3872
- }
3873
- }
3874
- const endpointParams = await resolveParams(commandInput, instructionsSupplier, clientConfig);
3875
- if (typeof clientConfig.endpointProvider !== "function") {
3876
- throw new Error("config.endpointProvider is not set.");
3877
- }
3878
- const endpoint = clientConfig.endpointProvider(endpointParams, context);
3879
- return endpoint;
3880
- }, "getEndpointFromInstructions");
3881
- var resolveParams = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig) => {
3882
- const endpointParams = {};
3883
- const instructions = instructionsSupplier?.getEndpointParameterInstructions?.() || {};
3884
- for (const [name, instruction] of Object.entries(instructions)) {
3885
- switch (instruction.type) {
3886
- case "staticContextParams":
3887
- endpointParams[name] = instruction.value;
3888
- break;
3889
- case "contextParams":
3890
- endpointParams[name] = commandInput[instruction.name];
3891
- break;
3892
- case "clientContextParams":
3893
- case "builtInParams":
3894
- endpointParams[name] = await createConfigValueProvider(instruction.name, name, clientConfig)();
3895
- break;
3896
- case "operationContextParams":
3897
- endpointParams[name] = instruction.get(commandInput);
3898
- break;
3899
- default:
3900
- throw new Error("Unrecognized endpoint parameter instruction: " + JSON.stringify(instruction));
3901
- }
3902
- }
3903
- if (Object.keys(instructions).length === 0) {
3904
- Object.assign(endpointParams, clientConfig);
3905
- }
3906
- if (String(clientConfig.serviceId).toLowerCase() === "s3") {
3907
- await resolveParamsForS3(endpointParams);
3908
- }
3909
- return endpointParams;
3910
- }, "resolveParams");
3911
-
3912
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js
3913
- var endpointMiddleware = /* @__PURE__ */ __name(({ config, instructions }) => {
3914
- return (next, context) => async (args) => {
3915
- if (config.isCustomEndpoint) {
3916
- setFeature(context, "ENDPOINT_OVERRIDE", "N");
3917
- }
3918
- const endpoint = await getEndpointFromInstructions(args.input, {
3919
- getEndpointParameterInstructions() {
3920
- return instructions;
3921
- }
3922
- }, {
3923
- ...config
3924
- }, context);
3925
- context.endpointV2 = endpoint;
3926
- context.authSchemes = endpoint.properties?.authSchemes;
3927
- const authScheme = context.authSchemes?.[0];
3928
- if (authScheme) {
3929
- context["signing_region"] = authScheme.signingRegion;
3930
- context["signing_service"] = authScheme.signingName;
3931
- const smithyContext = getSmithyContext(context);
3932
- const httpAuthOption = smithyContext?.selectedHttpAuthScheme?.httpAuthOption;
3933
- if (httpAuthOption) {
3934
- httpAuthOption.signingProperties = Object.assign(httpAuthOption.signingProperties || {}, {
3935
- signing_region: authScheme.signingRegion,
3936
- signingRegion: authScheme.signingRegion,
3937
- signing_service: authScheme.signingName,
3938
- signingName: authScheme.signingName,
3939
- signingRegionSet: authScheme.signingRegionSet
3940
- }, authScheme.properties);
3941
- }
3942
- }
3943
- return next({
3944
- ...args
3945
- });
3946
- };
3947
- }, "endpointMiddleware");
3948
-
3949
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/getEndpointPlugin.js
3950
- var endpointMiddlewareOptions = {
3951
- step: "serialize",
3952
- tags: [
3953
- "ENDPOINT_PARAMETERS",
3954
- "ENDPOINT_V2",
3955
- "ENDPOINT"
3956
- ],
3957
- name: "endpointV2Middleware",
3958
- override: true,
3959
- relation: "before",
3960
- toMiddleware: serializerMiddlewareOption.name
3961
- };
3962
- var getEndpointPlugin = /* @__PURE__ */ __name((config, instructions) => ({
3963
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
3964
- clientStack.addRelativeTo(endpointMiddleware({
3965
- config,
3966
- instructions
3967
- }), endpointMiddlewareOptions);
3968
- }, "applyToStack")
3969
- }), "getEndpointPlugin");
3970
-
3971
- // ../../node_modules/.pnpm/@smithy+middleware-endpoint@4.3.12/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js
3972
- init_esm_shims();
3973
- var resolveEndpointConfig = /* @__PURE__ */ __name((input) => {
3974
- const tls = input.tls ?? true;
3975
- const { endpoint, useDualstackEndpoint, useFipsEndpoint } = input;
3976
- const customEndpointProvider = endpoint != null ? async () => toEndpointV1(await normalizeProvider(endpoint)()) : void 0;
3977
- const isCustomEndpoint = !!endpoint;
3978
- const resolvedConfig = Object.assign(input, {
3979
- endpoint: customEndpointProvider,
3980
- tls,
3981
- isCustomEndpoint,
3982
- useDualstackEndpoint: normalizeProvider(useDualstackEndpoint ?? false),
3983
- useFipsEndpoint: normalizeProvider(useFipsEndpoint ?? false)
3984
- });
3985
- let configuredEndpointPromise = void 0;
3986
- resolvedConfig.serviceConfiguredEndpoint = async () => {
3987
- if (input.serviceId && !configuredEndpointPromise) {
3988
- configuredEndpointPromise = getEndpointFromConfig(input.serviceId);
3989
- }
3990
- return configuredEndpointPromise;
3991
- };
3992
- return resolvedConfig;
3993
- }, "resolveEndpointConfig");
3994
-
3995
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/configurations.js
3996
- init_esm_shims();
3997
-
3998
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js
3999
- init_esm_shims();
4000
-
4001
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/config.js
4002
- init_esm_shims();
4003
- var RETRY_MODES;
4004
- (function(RETRY_MODES2) {
4005
- RETRY_MODES2["STANDARD"] = "standard";
4006
- RETRY_MODES2["ADAPTIVE"] = "adaptive";
4007
- })(RETRY_MODES || (RETRY_MODES = {}));
4008
- var DEFAULT_MAX_ATTEMPTS = 3;
4009
- var DEFAULT_RETRY_MODE = RETRY_MODES.STANDARD;
4010
-
4011
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js
4012
- init_esm_shims();
4013
-
4014
- // ../../node_modules/.pnpm/@smithy+service-error-classification@4.2.5/node_modules/@smithy/service-error-classification/dist-es/index.js
4015
- init_esm_shims();
4016
-
4017
- // ../../node_modules/.pnpm/@smithy+service-error-classification@4.2.5/node_modules/@smithy/service-error-classification/dist-es/constants.js
4018
- init_esm_shims();
4019
- var THROTTLING_ERROR_CODES = [
4020
- "BandwidthLimitExceeded",
4021
- "EC2ThrottledException",
4022
- "LimitExceededException",
4023
- "PriorRequestNotComplete",
4024
- "ProvisionedThroughputExceededException",
4025
- "RequestLimitExceeded",
4026
- "RequestThrottled",
4027
- "RequestThrottledException",
4028
- "SlowDown",
4029
- "ThrottledException",
4030
- "Throttling",
4031
- "ThrottlingException",
4032
- "TooManyRequestsException",
4033
- "TransactionInProgressException"
4034
- ];
4035
- var TRANSIENT_ERROR_CODES = [
4036
- "TimeoutError",
4037
- "RequestTimeout",
4038
- "RequestTimeoutException"
4039
- ];
4040
- var TRANSIENT_ERROR_STATUS_CODES = [
4041
- 500,
4042
- 502,
4043
- 503,
4044
- 504
4045
- ];
4046
- var NODEJS_TIMEOUT_ERROR_CODES = [
4047
- "ECONNRESET",
4048
- "ECONNREFUSED",
4049
- "EPIPE",
4050
- "ETIMEDOUT"
4051
- ];
4052
- var NODEJS_NETWORK_ERROR_CODES = [
4053
- "EHOSTUNREACH",
4054
- "ENETUNREACH",
4055
- "ENOTFOUND"
4056
- ];
4057
-
4058
- // ../../node_modules/.pnpm/@smithy+service-error-classification@4.2.5/node_modules/@smithy/service-error-classification/dist-es/index.js
4059
- var isRetryableByTrait = /* @__PURE__ */ __name((error) => error?.$retryable !== void 0, "isRetryableByTrait");
4060
- var isClockSkewCorrectedError = /* @__PURE__ */ __name((error) => error.$metadata?.clockSkewCorrected, "isClockSkewCorrectedError");
4061
- var isBrowserNetworkError = /* @__PURE__ */ __name((error) => {
4062
- const errorMessages = /* @__PURE__ */ new Set([
4063
- "Failed to fetch",
4064
- "NetworkError when attempting to fetch resource",
4065
- "The Internet connection appears to be offline",
4066
- "Load failed",
4067
- "Network request failed"
4068
- ]);
4069
- const isValid = error && error instanceof TypeError;
4070
- if (!isValid) {
4071
- return false;
4072
- }
4073
- return errorMessages.has(error.message);
4074
- }, "isBrowserNetworkError");
4075
- var isThrottlingError = /* @__PURE__ */ __name((error) => error.$metadata?.httpStatusCode === 429 || THROTTLING_ERROR_CODES.includes(error.name) || error.$retryable?.throttling == true, "isThrottlingError");
4076
- var isTransientError = /* @__PURE__ */ __name((error, depth = 0) => isRetryableByTrait(error) || isClockSkewCorrectedError(error) || TRANSIENT_ERROR_CODES.includes(error.name) || NODEJS_TIMEOUT_ERROR_CODES.includes(error?.code || "") || NODEJS_NETWORK_ERROR_CODES.includes(error?.code || "") || TRANSIENT_ERROR_STATUS_CODES.includes(error.$metadata?.httpStatusCode || 0) || isBrowserNetworkError(error) || error.cause !== void 0 && depth <= 10 && isTransientError(error.cause, depth + 1), "isTransientError");
4077
- var isServerError = /* @__PURE__ */ __name((error) => {
4078
- if (error.$metadata?.httpStatusCode !== void 0) {
4079
- const statusCode = error.$metadata.httpStatusCode;
4080
- if (500 <= statusCode && statusCode <= 599 && !isTransientError(error)) {
4081
- return true;
4082
- }
4083
- return false;
4084
- }
4085
- return false;
4086
- }, "isServerError");
4087
-
4088
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js
4089
- var DefaultRateLimiter = class _DefaultRateLimiter {
4090
- static {
4091
- __name(this, "DefaultRateLimiter");
4092
- }
4093
- static setTimeoutFn = setTimeout;
4094
- beta;
4095
- minCapacity;
4096
- minFillRate;
4097
- scaleConstant;
4098
- smooth;
4099
- currentCapacity = 0;
4100
- enabled = false;
4101
- lastMaxRate = 0;
4102
- measuredTxRate = 0;
4103
- requestCount = 0;
4104
- fillRate;
4105
- lastThrottleTime;
4106
- lastTimestamp = 0;
4107
- lastTxRateBucket;
4108
- maxCapacity;
4109
- timeWindow = 0;
4110
- constructor(options) {
4111
- this.beta = options?.beta ?? 0.7;
4112
- this.minCapacity = options?.minCapacity ?? 1;
4113
- this.minFillRate = options?.minFillRate ?? 0.5;
4114
- this.scaleConstant = options?.scaleConstant ?? 0.4;
4115
- this.smooth = options?.smooth ?? 0.8;
4116
- const currentTimeInSeconds = this.getCurrentTimeInSeconds();
4117
- this.lastThrottleTime = currentTimeInSeconds;
4118
- this.lastTxRateBucket = Math.floor(this.getCurrentTimeInSeconds());
4119
- this.fillRate = this.minFillRate;
4120
- this.maxCapacity = this.minCapacity;
4121
- }
4122
- getCurrentTimeInSeconds() {
4123
- return Date.now() / 1e3;
4124
- }
4125
- async getSendToken() {
4126
- return this.acquireTokenBucket(1);
4127
- }
4128
- async acquireTokenBucket(amount) {
4129
- if (!this.enabled) {
4130
- return;
4131
- }
4132
- this.refillTokenBucket();
4133
- if (amount > this.currentCapacity) {
4134
- const delay = (amount - this.currentCapacity) / this.fillRate * 1e3;
4135
- await new Promise((resolve) => _DefaultRateLimiter.setTimeoutFn(resolve, delay));
4136
- }
4137
- this.currentCapacity = this.currentCapacity - amount;
4138
- }
4139
- refillTokenBucket() {
4140
- const timestamp = this.getCurrentTimeInSeconds();
4141
- if (!this.lastTimestamp) {
4142
- this.lastTimestamp = timestamp;
4143
- return;
4144
- }
4145
- const fillAmount = (timestamp - this.lastTimestamp) * this.fillRate;
4146
- this.currentCapacity = Math.min(this.maxCapacity, this.currentCapacity + fillAmount);
4147
- this.lastTimestamp = timestamp;
4148
- }
4149
- updateClientSendingRate(response) {
4150
- let calculatedRate;
4151
- this.updateMeasuredRate();
4152
- if (isThrottlingError(response)) {
4153
- const rateToUse = !this.enabled ? this.measuredTxRate : Math.min(this.measuredTxRate, this.fillRate);
4154
- this.lastMaxRate = rateToUse;
4155
- this.calculateTimeWindow();
4156
- this.lastThrottleTime = this.getCurrentTimeInSeconds();
4157
- calculatedRate = this.cubicThrottle(rateToUse);
4158
- this.enableTokenBucket();
4159
- } else {
4160
- this.calculateTimeWindow();
4161
- calculatedRate = this.cubicSuccess(this.getCurrentTimeInSeconds());
4162
- }
4163
- const newRate = Math.min(calculatedRate, 2 * this.measuredTxRate);
4164
- this.updateTokenBucketRate(newRate);
4165
- }
4166
- calculateTimeWindow() {
4167
- this.timeWindow = this.getPrecise(Math.pow(this.lastMaxRate * (1 - this.beta) / this.scaleConstant, 1 / 3));
4168
- }
4169
- cubicThrottle(rateToUse) {
4170
- return this.getPrecise(rateToUse * this.beta);
4171
- }
4172
- cubicSuccess(timestamp) {
4173
- return this.getPrecise(this.scaleConstant * Math.pow(timestamp - this.lastThrottleTime - this.timeWindow, 3) + this.lastMaxRate);
4174
- }
4175
- enableTokenBucket() {
4176
- this.enabled = true;
4177
- }
4178
- updateTokenBucketRate(newRate) {
4179
- this.refillTokenBucket();
4180
- this.fillRate = Math.max(newRate, this.minFillRate);
4181
- this.maxCapacity = Math.max(newRate, this.minCapacity);
4182
- this.currentCapacity = Math.min(this.currentCapacity, this.maxCapacity);
4183
- }
4184
- updateMeasuredRate() {
4185
- const t = this.getCurrentTimeInSeconds();
4186
- const timeBucket = Math.floor(t * 2) / 2;
4187
- this.requestCount++;
4188
- if (timeBucket > this.lastTxRateBucket) {
4189
- const currentRate = this.requestCount / (timeBucket - this.lastTxRateBucket);
4190
- this.measuredTxRate = this.getPrecise(currentRate * this.smooth + this.measuredTxRate * (1 - this.smooth));
4191
- this.requestCount = 0;
4192
- this.lastTxRateBucket = timeBucket;
4193
- }
4194
- }
4195
- getPrecise(num) {
4196
- return parseFloat(num.toFixed(8));
4197
- }
4198
- };
4199
-
4200
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js
4201
- init_esm_shims();
4202
-
4203
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/constants.js
4204
- init_esm_shims();
4205
- var DEFAULT_RETRY_DELAY_BASE = 100;
4206
- var MAXIMUM_RETRY_DELAY = 20 * 1e3;
4207
- var THROTTLING_RETRY_DELAY_BASE = 500;
4208
- var INITIAL_RETRY_TOKENS = 500;
4209
- var RETRY_COST = 5;
4210
- var TIMEOUT_RETRY_COST = 10;
4211
- var NO_RETRY_INCREMENT = 1;
4212
- var INVOCATION_ID_HEADER = "amz-sdk-invocation-id";
4213
- var REQUEST_HEADER = "amz-sdk-request";
4214
-
4215
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js
4216
- init_esm_shims();
4217
- var getDefaultRetryBackoffStrategy = /* @__PURE__ */ __name(() => {
4218
- let delayBase = DEFAULT_RETRY_DELAY_BASE;
4219
- const computeNextBackoffDelay = /* @__PURE__ */ __name((attempts) => {
4220
- return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * 2 ** attempts * delayBase));
4221
- }, "computeNextBackoffDelay");
4222
- const setDelayBase = /* @__PURE__ */ __name((delay) => {
4223
- delayBase = delay;
4224
- }, "setDelayBase");
4225
- return {
4226
- computeNextBackoffDelay,
4227
- setDelayBase
4228
- };
4229
- }, "getDefaultRetryBackoffStrategy");
4230
-
4231
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js
4232
- init_esm_shims();
4233
- var createDefaultRetryToken = /* @__PURE__ */ __name(({ retryDelay, retryCount, retryCost }) => {
4234
- const getRetryCount = /* @__PURE__ */ __name(() => retryCount, "getRetryCount");
4235
- const getRetryDelay = /* @__PURE__ */ __name(() => Math.min(MAXIMUM_RETRY_DELAY, retryDelay), "getRetryDelay");
4236
- const getRetryCost = /* @__PURE__ */ __name(() => retryCost, "getRetryCost");
4237
- return {
4238
- getRetryCount,
4239
- getRetryDelay,
4240
- getRetryCost
4241
- };
4242
- }, "createDefaultRetryToken");
4243
-
4244
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js
4245
- var StandardRetryStrategy = class {
4246
- static {
4247
- __name(this, "StandardRetryStrategy");
4248
- }
4249
- maxAttempts;
4250
- mode = RETRY_MODES.STANDARD;
4251
- capacity = INITIAL_RETRY_TOKENS;
4252
- retryBackoffStrategy = getDefaultRetryBackoffStrategy();
4253
- maxAttemptsProvider;
4254
- constructor(maxAttempts) {
4255
- this.maxAttempts = maxAttempts;
4256
- this.maxAttemptsProvider = typeof maxAttempts === "function" ? maxAttempts : async () => maxAttempts;
4257
- }
4258
- async acquireInitialRetryToken(retryTokenScope) {
4259
- return createDefaultRetryToken({
4260
- retryDelay: DEFAULT_RETRY_DELAY_BASE,
4261
- retryCount: 0
4262
- });
4263
- }
4264
- async refreshRetryTokenForRetry(token, errorInfo) {
4265
- const maxAttempts = await this.getMaxAttempts();
4266
- if (this.shouldRetry(token, errorInfo, maxAttempts)) {
4267
- const errorType = errorInfo.errorType;
4268
- this.retryBackoffStrategy.setDelayBase(errorType === "THROTTLING" ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE);
4269
- const delayFromErrorType = this.retryBackoffStrategy.computeNextBackoffDelay(token.getRetryCount());
4270
- const retryDelay = errorInfo.retryAfterHint ? Math.max(errorInfo.retryAfterHint.getTime() - Date.now() || 0, delayFromErrorType) : delayFromErrorType;
4271
- const capacityCost = this.getCapacityCost(errorType);
4272
- this.capacity -= capacityCost;
4273
- return createDefaultRetryToken({
4274
- retryDelay,
4275
- retryCount: token.getRetryCount() + 1,
4276
- retryCost: capacityCost
4277
- });
4278
- }
4279
- throw new Error("No retry token available");
4280
- }
4281
- recordSuccess(token) {
4282
- this.capacity = Math.max(INITIAL_RETRY_TOKENS, this.capacity + (token.getRetryCost() ?? NO_RETRY_INCREMENT));
4283
- }
4284
- getCapacity() {
4285
- return this.capacity;
4286
- }
4287
- async getMaxAttempts() {
4288
- try {
4289
- return await this.maxAttemptsProvider();
4290
- } catch (error) {
4291
- console.warn(`Max attempts provider could not resolve. Using default of ${DEFAULT_MAX_ATTEMPTS}`);
4292
- return DEFAULT_MAX_ATTEMPTS;
4293
- }
4294
- }
4295
- shouldRetry(tokenToRenew, errorInfo, maxAttempts) {
4296
- const attempts = tokenToRenew.getRetryCount() + 1;
4297
- return attempts < maxAttempts && this.capacity >= this.getCapacityCost(errorInfo.errorType) && this.isRetryableError(errorInfo.errorType);
4298
- }
4299
- getCapacityCost(errorType) {
4300
- return errorType === "TRANSIENT" ? TIMEOUT_RETRY_COST : RETRY_COST;
4301
- }
4302
- isRetryableError(errorType) {
4303
- return errorType === "THROTTLING" || errorType === "TRANSIENT";
4304
- }
4305
- };
4306
-
4307
- // ../../node_modules/.pnpm/@smithy+util-retry@4.2.5/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js
4308
- var AdaptiveRetryStrategy = class {
4309
- static {
4310
- __name(this, "AdaptiveRetryStrategy");
4311
- }
4312
- maxAttemptsProvider;
4313
- rateLimiter;
4314
- standardRetryStrategy;
4315
- mode = RETRY_MODES.ADAPTIVE;
4316
- constructor(maxAttemptsProvider, options) {
4317
- this.maxAttemptsProvider = maxAttemptsProvider;
4318
- const { rateLimiter } = options ?? {};
4319
- this.rateLimiter = rateLimiter ?? new DefaultRateLimiter();
4320
- this.standardRetryStrategy = new StandardRetryStrategy(maxAttemptsProvider);
4321
- }
4322
- async acquireInitialRetryToken(retryTokenScope) {
4323
- await this.rateLimiter.getSendToken();
4324
- return this.standardRetryStrategy.acquireInitialRetryToken(retryTokenScope);
4325
- }
4326
- async refreshRetryTokenForRetry(tokenToRenew, errorInfo) {
4327
- this.rateLimiter.updateClientSendingRate(errorInfo);
4328
- return this.standardRetryStrategy.refreshRetryTokenForRetry(tokenToRenew, errorInfo);
4329
- }
4330
- recordSuccess(token) {
4331
- this.rateLimiter.updateClientSendingRate({});
4332
- this.standardRetryStrategy.recordSuccess(token);
4333
- }
4334
- };
4335
-
4336
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/configurations.js
4337
- var ENV_MAX_ATTEMPTS = "AWS_MAX_ATTEMPTS";
4338
- var CONFIG_MAX_ATTEMPTS = "max_attempts";
4339
- var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {
4340
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => {
4341
- const value = env2[ENV_MAX_ATTEMPTS];
4342
- if (!value) return void 0;
4343
- const maxAttempt = parseInt(value);
4344
- if (Number.isNaN(maxAttempt)) {
4345
- throw new Error(`Environment variable ${ENV_MAX_ATTEMPTS} mast be a number, got "${value}"`);
4346
- }
4347
- return maxAttempt;
4348
- }, "environmentVariableSelector"),
4349
- configFileSelector: /* @__PURE__ */ __name((profile) => {
4350
- const value = profile[CONFIG_MAX_ATTEMPTS];
4351
- if (!value) return void 0;
4352
- const maxAttempt = parseInt(value);
4353
- if (Number.isNaN(maxAttempt)) {
4354
- throw new Error(`Shared config file entry ${CONFIG_MAX_ATTEMPTS} mast be a number, got "${value}"`);
4355
- }
4356
- return maxAttempt;
4357
- }, "configFileSelector"),
4358
- default: DEFAULT_MAX_ATTEMPTS
4359
- };
4360
- var resolveRetryConfig = /* @__PURE__ */ __name((input) => {
4361
- const { retryStrategy, retryMode: _retryMode, maxAttempts: _maxAttempts } = input;
4362
- const maxAttempts = normalizeProvider(_maxAttempts ?? DEFAULT_MAX_ATTEMPTS);
4363
- return Object.assign(input, {
4364
- maxAttempts,
4365
- retryStrategy: /* @__PURE__ */ __name(async () => {
4366
- if (retryStrategy) {
4367
- return retryStrategy;
4368
- }
4369
- const retryMode = await normalizeProvider(_retryMode)();
4370
- if (retryMode === RETRY_MODES.ADAPTIVE) {
4371
- return new AdaptiveRetryStrategy(maxAttempts);
4372
- }
4373
- return new StandardRetryStrategy(maxAttempts);
4374
- }, "retryStrategy")
4375
- });
4376
- }, "resolveRetryConfig");
4377
- var ENV_RETRY_MODE = "AWS_RETRY_MODE";
4378
- var CONFIG_RETRY_MODE = "retry_mode";
4379
- var NODE_RETRY_MODE_CONFIG_OPTIONS = {
4380
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => env2[ENV_RETRY_MODE], "environmentVariableSelector"),
4381
- configFileSelector: /* @__PURE__ */ __name((profile) => profile[CONFIG_RETRY_MODE], "configFileSelector"),
4382
- default: DEFAULT_RETRY_MODE
4383
- };
4384
-
4385
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
4386
- init_esm_shims();
4387
-
4388
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/isStreamingPayload/isStreamingPayload.js
4389
- init_esm_shims();
4390
- var isStreamingPayload = /* @__PURE__ */ __name((request) => request?.body instanceof Readable || typeof ReadableStream !== "undefined" && request?.body instanceof ReadableStream, "isStreamingPayload");
4391
-
4392
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/util.js
4393
- init_esm_shims();
4394
- var asSdkError = /* @__PURE__ */ __name((error) => {
4395
- if (error instanceof Error) return error;
4396
- if (error instanceof Object) return Object.assign(new Error(), error);
4397
- if (typeof error === "string") return new Error(error);
4398
- return new Error(`AWS SDK error wrapper for ${error}`);
4399
- }, "asSdkError");
4400
-
4401
- // ../../node_modules/.pnpm/@smithy+middleware-retry@4.4.12/node_modules/@smithy/middleware-retry/dist-es/retryMiddleware.js
4402
- var retryMiddleware = /* @__PURE__ */ __name((options) => (next, context) => async (args) => {
4403
- let retryStrategy = await options.retryStrategy();
4404
- const maxAttempts = await options.maxAttempts();
4405
- if (isRetryStrategyV2(retryStrategy)) {
4406
- retryStrategy = retryStrategy;
4407
- let retryToken = await retryStrategy.acquireInitialRetryToken(context["partition_id"]);
4408
- let lastError = new Error();
4409
- let attempts = 0;
4410
- let totalRetryDelay = 0;
4411
- const { request } = args;
4412
- const isRequest = HttpRequest.isInstance(request);
4413
- if (isRequest) {
4414
- request.headers[INVOCATION_ID_HEADER] = v4();
4415
- }
4416
- while (true) {
4417
- try {
4418
- if (isRequest) {
4419
- request.headers[REQUEST_HEADER] = `attempt=${attempts + 1}; max=${maxAttempts}`;
4420
- }
4421
- const { response, output } = await next(args);
4422
- retryStrategy.recordSuccess(retryToken);
4423
- output.$metadata.attempts = attempts + 1;
4424
- output.$metadata.totalRetryDelay = totalRetryDelay;
4425
- return {
4426
- response,
4427
- output
4428
- };
4429
- } catch (e) {
4430
- const retryErrorInfo = getRetryErrorInfo(e);
4431
- lastError = asSdkError(e);
4432
- if (isRequest && isStreamingPayload(request)) {
4433
- (context.logger instanceof NoOpLogger ? console : context.logger)?.warn("An error was encountered in a non-retryable streaming request.");
4434
- throw lastError;
4435
- }
4436
- try {
4437
- retryToken = await retryStrategy.refreshRetryTokenForRetry(retryToken, retryErrorInfo);
4438
- } catch (refreshError) {
4439
- if (!lastError.$metadata) {
4440
- lastError.$metadata = {};
4441
- }
4442
- lastError.$metadata.attempts = attempts + 1;
4443
- lastError.$metadata.totalRetryDelay = totalRetryDelay;
4444
- throw lastError;
4445
- }
4446
- attempts = retryToken.getRetryCount();
4447
- const delay = retryToken.getRetryDelay();
4448
- totalRetryDelay += delay;
4449
- await new Promise((resolve) => setTimeout(resolve, delay));
4450
- }
4451
- }
4452
- } else {
4453
- retryStrategy = retryStrategy;
4454
- if (retryStrategy?.mode) context.userAgent = [
4455
- ...context.userAgent || [],
4456
- [
4457
- "cfg/retry-mode",
4458
- retryStrategy.mode
4459
- ]
4460
- ];
4461
- return retryStrategy.retry(next, args);
4462
- }
4463
- }, "retryMiddleware");
4464
- var isRetryStrategyV2 = /* @__PURE__ */ __name((retryStrategy) => typeof retryStrategy.acquireInitialRetryToken !== "undefined" && typeof retryStrategy.refreshRetryTokenForRetry !== "undefined" && typeof retryStrategy.recordSuccess !== "undefined", "isRetryStrategyV2");
4465
- var getRetryErrorInfo = /* @__PURE__ */ __name((error) => {
4466
- const errorInfo = {
4467
- error,
4468
- errorType: getRetryErrorType(error)
4469
- };
4470
- const retryAfterHint = getRetryAfterHint(error.$response);
4471
- if (retryAfterHint) {
4472
- errorInfo.retryAfterHint = retryAfterHint;
4473
- }
4474
- return errorInfo;
4475
- }, "getRetryErrorInfo");
4476
- var getRetryErrorType = /* @__PURE__ */ __name((error) => {
4477
- if (isThrottlingError(error)) return "THROTTLING";
4478
- if (isTransientError(error)) return "TRANSIENT";
4479
- if (isServerError(error)) return "SERVER_ERROR";
4480
- return "CLIENT_ERROR";
4481
- }, "getRetryErrorType");
4482
- var retryMiddlewareOptions = {
4483
- name: "retryMiddleware",
4484
- tags: [
4485
- "RETRY"
4486
- ],
4487
- step: "finalizeRequest",
4488
- priority: "high",
4489
- override: true
4490
- };
4491
- var getRetryPlugin = /* @__PURE__ */ __name((options) => ({
4492
- applyToStack: /* @__PURE__ */ __name((clientStack) => {
4493
- clientStack.add(retryMiddleware(options), retryMiddlewareOptions);
4494
- }, "applyToStack")
4495
- }), "getRetryPlugin");
4496
- var getRetryAfterHint = /* @__PURE__ */ __name((response) => {
4497
- if (!HttpResponse.isInstance(response)) return;
4498
- const retryAfterHeaderName = Object.keys(response.headers).find((key) => key.toLowerCase() === "retry-after");
4499
- if (!retryAfterHeaderName) return;
4500
- const retryAfter = response.headers[retryAfterHeaderName];
4501
- const retryAfterSeconds = Number(retryAfter);
4502
- if (!Number.isNaN(retryAfterSeconds)) return new Date(retryAfterSeconds * 1e3);
4503
- const retryAfterDate = new Date(retryAfter);
4504
- return retryAfterDate;
4505
- }, "getRetryAfterHint");
4506
-
4507
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
4508
- init_esm_shims();
4509
-
4510
- // ../../node_modules/.pnpm/@smithy+util-config-provider@4.2.0/node_modules/@smithy/util-config-provider/dist-es/booleanSelector.js
4511
- init_esm_shims();
4512
- var booleanSelector = /* @__PURE__ */ __name((obj, key, type) => {
4513
- if (!(key in obj)) return void 0;
4514
- if (obj[key] === "true") return true;
4515
- if (obj[key] === "false") return false;
4516
- throw new Error(`Cannot load ${type} "${key}". Expected "true" or "false", got ${obj[key]}.`);
4517
- }, "booleanSelector");
4518
-
4519
- // ../../node_modules/.pnpm/@smithy+util-config-provider@4.2.0/node_modules/@smithy/util-config-provider/dist-es/types.js
4520
- init_esm_shims();
4521
- var SelectorType;
4522
- (function(SelectorType2) {
4523
- SelectorType2["ENV"] = "env";
4524
- SelectorType2["CONFIG"] = "shared config entry";
4525
- })(SelectorType || (SelectorType = {}));
4526
-
4527
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseDualstackEndpointConfigOptions.js
4528
- var ENV_USE_DUALSTACK_ENDPOINT = "AWS_USE_DUALSTACK_ENDPOINT";
4529
- var CONFIG_USE_DUALSTACK_ENDPOINT = "use_dualstack_endpoint";
4530
- var NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {
4531
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => booleanSelector(env2, ENV_USE_DUALSTACK_ENDPOINT, SelectorType.ENV), "environmentVariableSelector"),
4532
- configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, CONFIG_USE_DUALSTACK_ENDPOINT, SelectorType.CONFIG), "configFileSelector"),
4533
- default: false
4534
- };
4535
-
4536
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/endpointsConfig/NodeUseFipsEndpointConfigOptions.js
4537
- init_esm_shims();
4538
- var ENV_USE_FIPS_ENDPOINT = "AWS_USE_FIPS_ENDPOINT";
4539
- var CONFIG_USE_FIPS_ENDPOINT = "use_fips_endpoint";
4540
- var NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {
4541
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => booleanSelector(env2, ENV_USE_FIPS_ENDPOINT, SelectorType.ENV), "environmentVariableSelector"),
4542
- configFileSelector: /* @__PURE__ */ __name((profile) => booleanSelector(profile, CONFIG_USE_FIPS_ENDPOINT, SelectorType.CONFIG), "configFileSelector"),
4543
- default: false
4544
- };
4545
-
4546
- // ../../node_modules/.pnpm/@smithy+config-resolver@4.4.3/node_modules/@smithy/config-resolver/dist-es/regionConfig/config.js
4547
- init_esm_shims();
4548
- var REGION_ENV_NAME = "AWS_REGION";
4549
- var REGION_INI_NAME = "region";
4550
- var NODE_REGION_CONFIG_OPTIONS = {
4551
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => env2[REGION_ENV_NAME], "environmentVariableSelector"),
4552
- configFileSelector: /* @__PURE__ */ __name((profile) => profile[REGION_INI_NAME], "configFileSelector"),
4553
- default: /* @__PURE__ */ __name(() => {
4554
- throw new Error("Region is missing");
4555
- }, "default")
4556
- };
4557
- var NODE_REGION_CONFIG_FILE_OPTIONS = {
4558
- preferredFile: "credentials"
4559
- };
4560
-
4561
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
4562
- init_esm_shims();
4563
-
4564
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
4565
- init_esm_shims();
4566
-
4567
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/crt-availability.js
4568
- init_esm_shims();
4569
-
4570
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/is-crt-available.js
4571
- var isCrtAvailable = /* @__PURE__ */ __name(() => {
4572
- return null;
4573
- }, "isCrtAvailable");
4574
-
4575
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/defaultUserAgent.js
4576
- var createDefaultUserAgentProvider = /* @__PURE__ */ __name(({ serviceId, clientVersion }) => {
4577
- return async (config) => {
4578
- const sections = [
4579
- [
4580
- "aws-sdk-js",
4581
- clientVersion
4582
- ],
4583
- [
4584
- "ua",
4585
- "2.1"
4586
- ],
4587
- [
4588
- `os/${platform()}`,
4589
- release()
4590
- ],
4591
- [
4592
- "lang/js"
4593
- ],
4594
- [
4595
- "md/nodejs",
4596
- `${versions.node}`
4597
- ]
4598
- ];
4599
- const crtAvailable = isCrtAvailable();
4600
- if (crtAvailable) {
4601
- sections.push(crtAvailable);
4602
- }
4603
- if (serviceId) {
4604
- sections.push([
4605
- `api/${serviceId}`,
4606
- clientVersion
4607
- ]);
4608
- }
4609
- if (env.AWS_EXECUTION_ENV) {
4610
- sections.push([
4611
- `exec-env/${env.AWS_EXECUTION_ENV}`
4612
- ]);
4613
- }
4614
- const appId = await config?.userAgentAppId?.();
4615
- const resolvedUserAgent = appId ? [
4616
- ...sections,
4617
- [
4618
- `app/${appId}`
4619
- ]
4620
- ] : [
4621
- ...sections
4622
- ];
4623
- return resolvedUserAgent;
4624
- };
4625
- }, "createDefaultUserAgentProvider");
4626
-
4627
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/nodeAppIdConfigOptions.js
4628
- init_esm_shims();
4629
- var UA_APP_ID_ENV_NAME = "AWS_SDK_UA_APP_ID";
4630
- var UA_APP_ID_INI_NAME = "sdk_ua_app_id";
4631
- var UA_APP_ID_INI_NAME_DEPRECATED = "sdk-ua-app-id";
4632
- var NODE_APP_ID_CONFIG_OPTIONS = {
4633
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => env2[UA_APP_ID_ENV_NAME], "environmentVariableSelector"),
4634
- configFileSelector: /* @__PURE__ */ __name((profile) => profile[UA_APP_ID_INI_NAME] ?? profile[UA_APP_ID_INI_NAME_DEPRECATED], "configFileSelector"),
4635
- default: DEFAULT_UA_APP_ID
4636
- };
4637
-
4638
- // ../../node_modules/.pnpm/@aws-sdk+util-user-agent-node@3.879.0/node_modules/@aws-sdk/util-user-agent-node/dist-es/index.js
4639
- init_esm_shims();
4640
-
4641
- // ../../node_modules/.pnpm/@smithy+hash-node@4.2.5/node_modules/@smithy/hash-node/dist-es/index.js
4642
- init_esm_shims();
4643
- var Hash = class {
4644
- static {
4645
- __name(this, "Hash");
4646
- }
4647
- algorithmIdentifier;
4648
- secret;
4649
- hash;
4650
- constructor(algorithmIdentifier, secret) {
4651
- this.algorithmIdentifier = algorithmIdentifier;
4652
- this.secret = secret;
4653
- this.reset();
4654
- }
4655
- update(toHash, encoding) {
4656
- this.hash.update(toUint8Array(castSourceData(toHash, encoding)));
4657
- }
4658
- digest() {
4659
- return Promise.resolve(this.hash.digest());
4660
- }
4661
- reset() {
4662
- this.hash = this.secret ? createHmac(this.algorithmIdentifier, castSourceData(this.secret)) : createHash(this.algorithmIdentifier);
4663
- }
4664
- };
4665
- function castSourceData(toCast, encoding) {
4666
- if (Buffer$1.isBuffer(toCast)) {
4667
- return toCast;
4668
- }
4669
- if (typeof toCast === "string") {
4670
- return fromString(toCast, encoding);
4671
- }
4672
- if (ArrayBuffer.isView(toCast)) {
4673
- return fromArrayBuffer(toCast.buffer, toCast.byteOffset, toCast.byteLength);
4674
- }
4675
- return fromArrayBuffer(toCast);
4676
- }
4677
- __name(castSourceData, "castSourceData");
4678
-
4679
- // ../../node_modules/.pnpm/@smithy+util-body-length-node@4.2.1/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js
4680
- init_esm_shims();
4681
- var calculateBodyLength = /* @__PURE__ */ __name((body) => {
4682
- if (!body) {
4683
- return 0;
4684
- }
4685
- if (typeof body === "string") {
4686
- return Buffer.byteLength(body);
4687
- } else if (typeof body.byteLength === "number") {
4688
- return body.byteLength;
4689
- } else if (typeof body.size === "number") {
4690
- return body.size;
4691
- } else if (typeof body.start === "number" && typeof body.end === "number") {
4692
- return body.end + 1 - body.start;
4693
- } else if (body instanceof ReadStream) {
4694
- if (body.path != null) {
4695
- return lstatSync(body.path).size;
4696
- } else if (typeof body.fd === "number") {
4697
- return fstatSync(body.fd).size;
4698
- }
4699
- }
4700
- throw new Error(`Body Length computation failed for ${body}`);
4701
- }, "calculateBodyLength");
4702
-
4703
- // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@4.2.14/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js
4704
- init_esm_shims();
4705
-
4706
- // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@4.2.14/node_modules/@smithy/util-defaults-mode-node/dist-es/constants.js
4707
- init_esm_shims();
4708
- var AWS_EXECUTION_ENV = "AWS_EXECUTION_ENV";
4709
- var AWS_REGION_ENV = "AWS_REGION";
4710
- var AWS_DEFAULT_REGION_ENV = "AWS_DEFAULT_REGION";
4711
- var ENV_IMDS_DISABLED = "AWS_EC2_METADATA_DISABLED";
4712
- var DEFAULTS_MODE_OPTIONS = [
4713
- "in-region",
4714
- "cross-region",
4715
- "mobile",
4716
- "standard",
4717
- "legacy"
4718
- ];
4719
- var IMDS_REGION_PATH = "/latest/meta-data/placement/region";
4720
-
4721
- // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@4.2.14/node_modules/@smithy/util-defaults-mode-node/dist-es/defaultsModeConfig.js
4722
- init_esm_shims();
4723
- var AWS_DEFAULTS_MODE_ENV = "AWS_DEFAULTS_MODE";
4724
- var AWS_DEFAULTS_MODE_CONFIG = "defaults_mode";
4725
- var NODE_DEFAULTS_MODE_CONFIG_OPTIONS = {
4726
- environmentVariableSelector: /* @__PURE__ */ __name((env2) => {
4727
- return env2[AWS_DEFAULTS_MODE_ENV];
4728
- }, "environmentVariableSelector"),
4729
- configFileSelector: /* @__PURE__ */ __name((profile) => {
4730
- return profile[AWS_DEFAULTS_MODE_CONFIG];
4731
- }, "configFileSelector"),
4732
- default: "legacy"
4733
- };
4734
-
4735
- // ../../node_modules/.pnpm/@smithy+util-defaults-mode-node@4.2.14/node_modules/@smithy/util-defaults-mode-node/dist-es/resolveDefaultsModeConfig.js
4736
- var resolveDefaultsModeConfig = /* @__PURE__ */ __name(({ region = loadConfig(NODE_REGION_CONFIG_OPTIONS), defaultsMode = loadConfig(NODE_DEFAULTS_MODE_CONFIG_OPTIONS) } = {}) => memoize(async () => {
4737
- const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
4738
- switch (mode?.toLowerCase()) {
4739
- case "auto":
4740
- return resolveNodeDefaultsModeAuto(region);
4741
- case "in-region":
4742
- case "cross-region":
4743
- case "mobile":
4744
- case "standard":
4745
- case "legacy":
4746
- return Promise.resolve(mode?.toLocaleLowerCase());
4747
- case void 0:
4748
- return Promise.resolve("legacy");
4749
- default:
4750
- throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
4751
- }
4752
- }), "resolveDefaultsModeConfig");
4753
- var resolveNodeDefaultsModeAuto = /* @__PURE__ */ __name(async (clientRegion) => {
4754
- if (clientRegion) {
4755
- const resolvedRegion = typeof clientRegion === "function" ? await clientRegion() : clientRegion;
4756
- const inferredRegion = await inferPhysicalRegion();
4757
- if (!inferredRegion) {
4758
- return "standard";
4759
- }
4760
- if (resolvedRegion === inferredRegion) {
4761
- return "in-region";
4762
- } else {
4763
- return "cross-region";
4764
- }
4765
- }
4766
- return "standard";
4767
- }, "resolveNodeDefaultsModeAuto");
4768
- var inferPhysicalRegion = /* @__PURE__ */ __name(async () => {
4769
- if (process.env[AWS_EXECUTION_ENV] && (process.env[AWS_REGION_ENV] || process.env[AWS_DEFAULT_REGION_ENV])) {
4770
- return process.env[AWS_REGION_ENV] ?? process.env[AWS_DEFAULT_REGION_ENV];
4771
- }
4772
- if (!process.env[ENV_IMDS_DISABLED]) {
4773
- try {
4774
- const { getInstanceMetadataEndpoint, httpRequest } = await import('./WSES6SE2.js');
4775
- const endpoint = await getInstanceMetadataEndpoint();
4776
- return (await httpRequest({
4777
- ...endpoint,
4778
- path: IMDS_REGION_PATH
4779
- })).toString();
4780
- } catch (e) {
4781
- }
4782
- }
4783
- }, "inferPhysicalRegion");
4784
-
4785
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/extensions/index.js
4786
- init_esm_shims();
4787
- var getAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
4788
- return {
4789
- setRegion(region) {
4790
- runtimeConfig.region = region;
4791
- },
4792
- region() {
4793
- return runtimeConfig.region;
4794
- }
4795
- };
4796
- }, "getAwsRegionExtensionConfiguration");
4797
- var resolveAwsRegionExtensionConfiguration = /* @__PURE__ */ __name((awsRegionExtensionConfiguration) => {
4798
- return {
4799
- region: awsRegionExtensionConfiguration.region()
4800
- };
4801
- }, "resolveAwsRegionExtensionConfiguration");
4802
-
4803
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/index.js
4804
- init_esm_shims();
4805
-
4806
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/index.js
4807
- init_esm_shims();
4808
-
4809
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/config.js
4810
- init_esm_shims();
4811
-
4812
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/resolveRegionConfig.js
4813
- init_esm_shims();
4814
-
4815
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/getRealRegion.js
4816
- init_esm_shims();
4817
-
4818
- // ../../node_modules/.pnpm/@aws-sdk+region-config-resolver@3.873.0/node_modules/@aws-sdk/region-config-resolver/dist-es/regionConfig/isFipsRegion.js
4819
- init_esm_shims();
4820
-
4821
- export { AwsSdkSigV4Signer, Client, Command, DEFAULT_RETRY_MODE, DefaultIdentityProviderConfig, EndpointCache, Hash, NODE_APP_ID_CONFIG_OPTIONS, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NoOpLogger, ServiceException, awsEndpointFunctions, calculateBodyLength, collectBodyString, createDefaultUserAgentProvider, customEndpointFunctions, decorateServiceException, emitWarningIfUnsupportedVersion, emitWarningIfUnsupportedVersion2, getAwsRegionExtensionConfiguration, getContentLengthPlugin, getDefaultExtensionConfiguration, getEndpointPlugin, getHostHeaderPlugin, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpHandlerExtensionConfiguration, getHttpSigningPlugin, getLoggerPlugin, getRecursionDetectionPlugin, getRetryPlugin, getSerdePlugin, getSmithyContext, getUserAgentPlugin, loadConfigsForDefaultMode, normalizeProvider, resolveAwsRegionExtensionConfiguration, resolveAwsSdkSigV4Config, resolveDefaultRuntimeConfig, resolveDefaultsModeConfig, resolveEndpoint, resolveEndpointConfig, resolveHostHeaderConfig, resolveHttpHandlerRuntimeConfig, resolveRegionConfig, resolveRetryConfig, resolveUserAgentConfig, withBaseException };
4822
- //# sourceMappingURL=EXBTG2GQ.js.map
4823
- //# sourceMappingURL=EXBTG2GQ.js.map