@ampless/mcp-server 0.2.0-alpha.0 → 0.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bowser-WRHMEFK3.js +2822 -0
- package/dist/chunk-3NCQATCK.js +1385 -0
- package/dist/chunk-5PA6IP7O.js +435 -0
- package/dist/{chunk-27JGNXJE.js → chunk-6OXXSXKN.js} +8 -37
- package/dist/{chunk-YDYRXGHR.js → chunk-A4YPJIDF.js} +3 -3
- package/dist/chunk-CVNCRUML.js +1355 -0
- package/dist/chunk-IKXKDSVH.js +1414 -0
- package/dist/chunk-ISXSZYT4.js +1375 -0
- package/dist/{chunk-GSC7CBT2.js → chunk-IW52OUIR.js} +117 -1025
- package/dist/chunk-QBXY5RRO.js +3559 -0
- package/dist/chunk-UMEQ5ALV.js +14 -0
- package/dist/{chunk-OLRXGK7L.js → chunk-YHHXORQ4.js} +48 -32
- package/dist/{dist-es-J7V6TEWZ.js → dist-es-3P7CNKGV.js} +15 -16
- package/dist/{dist-es-6QUIY4X7.js → dist-es-NAMW5ZZ4.js} +21 -31
- package/dist/{dist-es-MQG4P6NF.js → dist-es-OI6XP2CN.js} +9 -10
- package/dist/{dist-es-W5H6GQXM.js → dist-es-OO5RVJZO.js} +10 -11
- package/dist/{dist-es-NGSDZSP2.js → dist-es-PRQWND46.js} +4 -3
- package/dist/{dist-es-2HK4JUU7.js → dist-es-T6J3WJJK.js} +32 -36
- package/dist/{dist-es-OYHIBJO3.js → dist-es-ZP52SD4G.js} +27 -32
- package/dist/event-streams-WFL2DK34.js +43 -0
- package/dist/index.js +2061 -2633
- package/dist/{loadSso-3FWOSWL4.js → loadSso-C2Y2WOQK.js} +56 -58
- package/dist/{signin-EATRRDTG.js → signin-IY5CLTYR.js} +59 -63
- package/dist/{sso-oidc-5GRHV5HA.js → sso-oidc-KZTDOR7Y.js} +59 -63
- package/dist/{sts-IMPWC7YM.js → sts-2UABQZ6D.js} +625 -740
- package/package.json +3 -3
- package/dist/chunk-44FZZOIP.js +0 -14
- package/dist/chunk-72G5HA35.js +0 -62
- package/dist/chunk-B57O737J.js +0 -52
- package/dist/chunk-E6YHJFDU.js +0 -44
- package/dist/chunk-FCBONYCH.js +0 -6008
- package/dist/chunk-GBNV7FEX.js +0 -164
- package/dist/chunk-MQF5MXOW.js +0 -1040
- package/dist/chunk-NZ2AQICN.js +0 -29
- package/dist/chunk-YVOTBVHL.js +0 -243
- package/dist/chunk-ZB7FTU7J.js +0 -39
- package/dist/event-streams-6T3GMAVH.js +0 -253
|
@@ -1,291 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
FromStringShapeDeserializer,
|
|
4
|
-
HttpBindingProtocol,
|
|
5
|
-
HttpInterceptingShapeDeserializer,
|
|
6
|
-
HttpInterceptingShapeSerializer,
|
|
7
|
-
NoOpLogger,
|
|
8
|
-
NormalizedSchema,
|
|
9
|
-
NumericValue,
|
|
10
|
-
ProtocolLib,
|
|
11
|
-
SelectorType,
|
|
12
3
|
SerdeContextConfig,
|
|
13
4
|
SignatureV4,
|
|
14
|
-
UnionSerde
|
|
15
|
-
|
|
16
|
-
determineTimestampFormat,
|
|
17
|
-
getSmithyContext,
|
|
18
|
-
httpSigningMiddlewareOptions,
|
|
19
|
-
setFeature,
|
|
20
|
-
v4
|
|
21
|
-
} from "./chunk-FCBONYCH.js";
|
|
5
|
+
UnionSerde
|
|
6
|
+
} from "./chunk-CVNCRUML.js";
|
|
22
7
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "./chunk-MQF5MXOW.js";
|
|
28
|
-
import {
|
|
29
|
-
HttpRequest
|
|
30
|
-
} from "./chunk-72G5HA35.js";
|
|
8
|
+
FromStringShapeDeserializer,
|
|
9
|
+
NormalizedSchema,
|
|
10
|
+
getValueFromTextNode
|
|
11
|
+
} from "./chunk-QBXY5RRO.js";
|
|
31
12
|
import {
|
|
32
13
|
toUtf8
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
|
|
35
|
-
// ../../node_modules/.pnpm/@smithy+smithy-client@4.12.13/node_modules/@smithy/smithy-client/dist-es/get-value-from-text-node.js
|
|
36
|
-
var getValueFromTextNode = (obj) => {
|
|
37
|
-
const textNodeName = "#text";
|
|
38
|
-
for (const key in obj) {
|
|
39
|
-
if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) {
|
|
40
|
-
obj[key] = obj[key][textNodeName];
|
|
41
|
-
} else if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
42
|
-
obj[key] = getValueFromTextNode(obj[key]);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return obj;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/check-content-length-header.js
|
|
49
|
-
var CONTENT_LENGTH_HEADER = "content-length";
|
|
50
|
-
var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
51
|
-
function checkContentLengthHeader() {
|
|
52
|
-
return (next, context) => async (args) => {
|
|
53
|
-
const { request } = args;
|
|
54
|
-
if (HttpRequest.isInstance(request)) {
|
|
55
|
-
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
|
|
56
|
-
const message = `Are you using a Stream of unknown length as the Body of a PutObject request? Consider using Upload instead from @aws-sdk/lib-storage.`;
|
|
57
|
-
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof NoOpLogger)) {
|
|
58
|
-
context.logger.warn(message);
|
|
59
|
-
} else {
|
|
60
|
-
console.warn(message);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return next({ ...args });
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
var checkContentLengthHeaderMiddlewareOptions = {
|
|
68
|
-
step: "finalizeRequest",
|
|
69
|
-
tags: ["CHECK_CONTENT_LENGTH_HEADER"],
|
|
70
|
-
name: "getCheckContentLengthHeaderPlugin",
|
|
71
|
-
override: true
|
|
72
|
-
};
|
|
73
|
-
var getCheckContentLengthHeaderPlugin = (unused) => ({
|
|
74
|
-
applyToStack: (clientStack) => {
|
|
75
|
-
clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-endpoint-middleware.js
|
|
80
|
-
var regionRedirectEndpointMiddleware = (config) => {
|
|
81
|
-
return (next, context) => async (args) => {
|
|
82
|
-
const originalRegion = await config.region();
|
|
83
|
-
const regionProviderRef = config.region;
|
|
84
|
-
let unlock = () => {
|
|
85
|
-
};
|
|
86
|
-
if (context.__s3RegionRedirect) {
|
|
87
|
-
Object.defineProperty(config, "region", {
|
|
88
|
-
writable: false,
|
|
89
|
-
value: async () => {
|
|
90
|
-
return context.__s3RegionRedirect;
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
unlock = () => Object.defineProperty(config, "region", {
|
|
94
|
-
writable: true,
|
|
95
|
-
value: regionProviderRef
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
try {
|
|
99
|
-
const result = await next(args);
|
|
100
|
-
if (context.__s3RegionRedirect) {
|
|
101
|
-
unlock();
|
|
102
|
-
const region = await config.region();
|
|
103
|
-
if (originalRegion !== region) {
|
|
104
|
-
throw new Error("Region was not restored following S3 region redirect.");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
return result;
|
|
108
|
-
} catch (e) {
|
|
109
|
-
unlock();
|
|
110
|
-
throw e;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
var regionRedirectEndpointMiddlewareOptions = {
|
|
115
|
-
tags: ["REGION_REDIRECT", "S3"],
|
|
116
|
-
name: "regionRedirectEndpointMiddleware",
|
|
117
|
-
override: true,
|
|
118
|
-
relation: "before",
|
|
119
|
-
toMiddleware: "endpointV2Middleware"
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/region-redirect-middleware.js
|
|
123
|
-
function regionRedirectMiddleware(clientConfig) {
|
|
124
|
-
return (next, context) => async (args) => {
|
|
125
|
-
try {
|
|
126
|
-
return await next(args);
|
|
127
|
-
} catch (err) {
|
|
128
|
-
if (clientConfig.followRegionRedirects) {
|
|
129
|
-
const statusCode = err?.$metadata?.httpStatusCode;
|
|
130
|
-
const isHeadBucket = context.commandName === "HeadBucketCommand";
|
|
131
|
-
const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"];
|
|
132
|
-
if (bucketRegionHeader) {
|
|
133
|
-
if (statusCode === 301 || statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket)) {
|
|
134
|
-
try {
|
|
135
|
-
const actualRegion = bucketRegionHeader;
|
|
136
|
-
context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
|
|
137
|
-
context.__s3RegionRedirect = actualRegion;
|
|
138
|
-
} catch (e) {
|
|
139
|
-
throw new Error("Region redirect failed: " + e);
|
|
140
|
-
}
|
|
141
|
-
return next(args);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
throw err;
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
var regionRedirectMiddlewareOptions = {
|
|
150
|
-
step: "initialize",
|
|
151
|
-
tags: ["REGION_REDIRECT", "S3"],
|
|
152
|
-
name: "regionRedirectMiddleware",
|
|
153
|
-
override: true
|
|
154
|
-
};
|
|
155
|
-
var getRegionRedirectMiddlewarePlugin = (clientConfig) => ({
|
|
156
|
-
applyToStack: (clientStack) => {
|
|
157
|
-
clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
|
|
158
|
-
clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCache.js
|
|
163
|
-
var S3ExpressIdentityCache = class _S3ExpressIdentityCache {
|
|
164
|
-
data;
|
|
165
|
-
lastPurgeTime = Date.now();
|
|
166
|
-
static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4;
|
|
167
|
-
constructor(data = {}) {
|
|
168
|
-
this.data = data;
|
|
169
|
-
}
|
|
170
|
-
get(key) {
|
|
171
|
-
const entry = this.data[key];
|
|
172
|
-
if (!entry) {
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
return entry;
|
|
176
|
-
}
|
|
177
|
-
set(key, entry) {
|
|
178
|
-
this.data[key] = entry;
|
|
179
|
-
return entry;
|
|
180
|
-
}
|
|
181
|
-
delete(key) {
|
|
182
|
-
delete this.data[key];
|
|
183
|
-
}
|
|
184
|
-
async purgeExpired() {
|
|
185
|
-
const now = Date.now();
|
|
186
|
-
if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
187
|
-
return;
|
|
188
|
-
}
|
|
189
|
-
for (const key in this.data) {
|
|
190
|
-
const entry = this.data[key];
|
|
191
|
-
if (!entry.isRefreshing) {
|
|
192
|
-
const credential = await entry.identity;
|
|
193
|
-
if (credential.expiration) {
|
|
194
|
-
if (credential.expiration.getTime() < now) {
|
|
195
|
-
delete this.data[key];
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
|
|
203
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/classes/S3ExpressIdentityCacheEntry.js
|
|
204
|
-
var S3ExpressIdentityCacheEntry = class {
|
|
205
|
-
_identity;
|
|
206
|
-
isRefreshing;
|
|
207
|
-
accessed;
|
|
208
|
-
constructor(_identity, isRefreshing = false, accessed = Date.now()) {
|
|
209
|
-
this._identity = _identity;
|
|
210
|
-
this.isRefreshing = isRefreshing;
|
|
211
|
-
this.accessed = accessed;
|
|
212
|
-
}
|
|
213
|
-
get identity() {
|
|
214
|
-
this.accessed = Date.now();
|
|
215
|
-
return this._identity;
|
|
216
|
-
}
|
|
217
|
-
};
|
|
14
|
+
} from "./chunk-IKXKDSVH.js";
|
|
218
15
|
|
|
219
|
-
// ../../node_modules/.pnpm/@
|
|
220
|
-
var S3ExpressIdentityProviderImpl = class _S3ExpressIdentityProviderImpl {
|
|
221
|
-
createSessionFn;
|
|
222
|
-
cache;
|
|
223
|
-
static REFRESH_WINDOW_MS = 6e4;
|
|
224
|
-
constructor(createSessionFn, cache = new S3ExpressIdentityCache()) {
|
|
225
|
-
this.createSessionFn = createSessionFn;
|
|
226
|
-
this.cache = cache;
|
|
227
|
-
}
|
|
228
|
-
async getS3ExpressIdentity(awsIdentity, identityProperties) {
|
|
229
|
-
const key = identityProperties.Bucket;
|
|
230
|
-
const { cache } = this;
|
|
231
|
-
const entry = cache.get(key);
|
|
232
|
-
if (entry) {
|
|
233
|
-
return entry.identity.then((identity) => {
|
|
234
|
-
const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
|
|
235
|
-
if (isExpired) {
|
|
236
|
-
return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
237
|
-
}
|
|
238
|
-
const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
|
|
239
|
-
if (isExpiringSoon && !entry.isRefreshing) {
|
|
240
|
-
entry.isRefreshing = true;
|
|
241
|
-
this.getIdentity(key).then((id) => {
|
|
242
|
-
cache.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
return identity;
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
return cache.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
249
|
-
}
|
|
250
|
-
async getIdentity(key) {
|
|
251
|
-
await this.cache.purgeExpired().catch((error) => {
|
|
252
|
-
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error);
|
|
253
|
-
});
|
|
254
|
-
const session = await this.createSessionFn(key);
|
|
255
|
-
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
256
|
-
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
257
|
-
}
|
|
258
|
-
const identity = {
|
|
259
|
-
accessKeyId: session.Credentials.AccessKeyId,
|
|
260
|
-
secretAccessKey: session.Credentials.SecretAccessKey,
|
|
261
|
-
sessionToken: session.Credentials.SessionToken,
|
|
262
|
-
expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0
|
|
263
|
-
};
|
|
264
|
-
return identity;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
// ../../node_modules/.pnpm/@smithy+signature-v4@5.3.14/node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js
|
|
16
|
+
// ../../node_modules/.pnpm/@smithy+signature-v4@5.4.3/node_modules/@smithy/signature-v4/dist-es/signature-v4a-container.js
|
|
269
17
|
var signatureV4aContainer = {
|
|
270
18
|
SignatureV4a: null
|
|
271
19
|
};
|
|
272
20
|
|
|
273
|
-
// ../../node_modules/.pnpm/@aws-sdk+
|
|
274
|
-
var
|
|
275
|
-
|
|
276
|
-
var S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
|
|
277
|
-
var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
278
|
-
var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
279
|
-
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
|
|
280
|
-
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
|
|
281
|
-
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
|
|
282
|
-
environmentVariableSelector: (env) => booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, SelectorType.ENV),
|
|
283
|
-
configFileSelector: (profile) => booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, SelectorType.CONFIG),
|
|
284
|
-
default: false
|
|
21
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.27/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
|
|
22
|
+
var signatureV4CrtContainer = {
|
|
23
|
+
CrtSignerV4: null
|
|
285
24
|
};
|
|
286
25
|
|
|
287
|
-
// ../../node_modules/.pnpm/@aws-sdk+
|
|
288
|
-
var
|
|
26
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.27/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4SignWithCredentials.js
|
|
27
|
+
var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
28
|
+
var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
29
|
+
var SignatureV4SignWithCredentials = class extends SignatureV4 {
|
|
289
30
|
async signWithCredentials(requestToSign, credentials, options) {
|
|
290
31
|
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
291
32
|
requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
|
|
@@ -305,248 +46,107 @@ var SignatureV4S3Express = class extends SignatureV4 {
|
|
|
305
46
|
}
|
|
306
47
|
};
|
|
307
48
|
function getCredentialsWithoutSessionToken(credentials) {
|
|
308
|
-
|
|
49
|
+
return {
|
|
309
50
|
accessKeyId: credentials.accessKeyId,
|
|
310
51
|
secretAccessKey: credentials.secretAccessKey,
|
|
311
52
|
expiration: credentials.expiration
|
|
312
53
|
};
|
|
313
|
-
return credentialsWithoutSessionToken;
|
|
314
54
|
}
|
|
315
55
|
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
|
|
316
|
-
const id = setTimeout(() => {
|
|
317
|
-
throw new Error("SignatureV4S3Express credential override was created but not called.");
|
|
318
|
-
}, 10);
|
|
319
56
|
const currentCredentialProvider = privateAccess.credentialProvider;
|
|
320
|
-
|
|
321
|
-
clearTimeout(id);
|
|
57
|
+
privateAccess.credentialProvider = () => {
|
|
322
58
|
privateAccess.credentialProvider = currentCredentialProvider;
|
|
323
59
|
return Promise.resolve(credentialsWithoutSessionToken);
|
|
324
60
|
};
|
|
325
|
-
privateAccess.credentialProvider = overrideCredentialsProviderOnce;
|
|
326
61
|
}
|
|
327
62
|
|
|
328
|
-
// ../../node_modules/.pnpm/@aws-sdk+
|
|
329
|
-
var
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
if (isS3ExpressAuth) {
|
|
340
|
-
const requestBucket = args.input.Bucket;
|
|
341
|
-
if (requestBucket) {
|
|
342
|
-
const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
|
|
343
|
-
Bucket: requestBucket
|
|
344
|
-
});
|
|
345
|
-
context.s3ExpressIdentity = s3ExpressIdentity;
|
|
346
|
-
if (HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
|
|
347
|
-
args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
}
|
|
63
|
+
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.27/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
|
|
64
|
+
var SignatureV4MultiRegion = class {
|
|
65
|
+
sigv4aSigner;
|
|
66
|
+
sigv4Signer;
|
|
67
|
+
signerOptions;
|
|
68
|
+
static sigv4aDependency() {
|
|
69
|
+
if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
|
|
70
|
+
return "crt";
|
|
71
|
+
} else if (typeof signatureV4aContainer.SignatureV4a === "function") {
|
|
72
|
+
return "js";
|
|
351
73
|
}
|
|
352
|
-
return
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
var s3ExpressMiddlewareOptions = {
|
|
356
|
-
name: "s3ExpressMiddleware",
|
|
357
|
-
step: "build",
|
|
358
|
-
tags: ["S3", "S3_EXPRESS"],
|
|
359
|
-
override: true
|
|
360
|
-
};
|
|
361
|
-
var getS3ExpressPlugin = (options) => ({
|
|
362
|
-
applyToStack: (clientStack) => {
|
|
363
|
-
clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/signS3Express.js
|
|
368
|
-
var signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
|
|
369
|
-
const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
|
|
370
|
-
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
371
|
-
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
74
|
+
return "none";
|
|
372
75
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/s3-express/functions/s3ExpressHttpSigningMiddleware.js
|
|
377
|
-
var defaultErrorHandler = (signingProperties) => (error) => {
|
|
378
|
-
throw error;
|
|
379
|
-
};
|
|
380
|
-
var defaultSuccessHandler = (httpResponse, signingProperties) => {
|
|
381
|
-
};
|
|
382
|
-
var s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
383
|
-
if (!HttpRequest.isInstance(args.request)) {
|
|
384
|
-
return next(args);
|
|
385
|
-
}
|
|
386
|
-
const smithyContext = getSmithyContext(context);
|
|
387
|
-
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
388
|
-
if (!scheme) {
|
|
389
|
-
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
390
|
-
}
|
|
391
|
-
const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
|
|
392
|
-
let request;
|
|
393
|
-
if (context.s3ExpressIdentity) {
|
|
394
|
-
request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
|
|
395
|
-
} else {
|
|
396
|
-
request = await signer.sign(args.request, identity, signingProperties);
|
|
397
|
-
}
|
|
398
|
-
const output = await next({
|
|
399
|
-
...args,
|
|
400
|
-
request
|
|
401
|
-
}).catch((signer.errorHandler || defaultErrorHandler)(signingProperties));
|
|
402
|
-
(signer.successHandler || defaultSuccessHandler)(output.response, signingProperties);
|
|
403
|
-
return output;
|
|
404
|
-
};
|
|
405
|
-
var getS3ExpressHttpSigningPlugin = (config) => ({
|
|
406
|
-
applyToStack: (clientStack) => {
|
|
407
|
-
clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), httpSigningMiddlewareOptions);
|
|
76
|
+
constructor(options) {
|
|
77
|
+
this.sigv4Signer = new SignatureV4SignWithCredentials(options);
|
|
78
|
+
this.signerOptions = options;
|
|
408
79
|
}
|
|
409
|
-
})
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader } = input;
|
|
415
|
-
return Object.assign(input, {
|
|
416
|
-
forcePathStyle: forcePathStyle ?? false,
|
|
417
|
-
useAccelerateEndpoint: useAccelerateEndpoint ?? false,
|
|
418
|
-
disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
|
|
419
|
-
followRegionRedirects: followRegionRedirects ?? false,
|
|
420
|
-
s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
|
|
421
|
-
Bucket: key
|
|
422
|
-
}))),
|
|
423
|
-
bucketEndpoint: bucketEndpoint ?? false,
|
|
424
|
-
expectContinueHeader: expectContinueHeader ?? 2097152
|
|
425
|
-
});
|
|
426
|
-
};
|
|
427
|
-
|
|
428
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/toStream.js
|
|
429
|
-
import { Readable } from "stream";
|
|
430
|
-
function toStream(bytes) {
|
|
431
|
-
return Readable.from(Buffer.from(bytes));
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/throw-200-exceptions.js
|
|
435
|
-
var THROW_IF_EMPTY_BODY = {
|
|
436
|
-
CopyObjectCommand: true,
|
|
437
|
-
UploadPartCopyCommand: true,
|
|
438
|
-
CompleteMultipartUploadCommand: true
|
|
439
|
-
};
|
|
440
|
-
var throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => {
|
|
441
|
-
const result = await next(args);
|
|
442
|
-
const { response } = result;
|
|
443
|
-
if (!HttpResponse.isInstance(response)) {
|
|
444
|
-
return result;
|
|
445
|
-
}
|
|
446
|
-
const { statusCode, body } = response;
|
|
447
|
-
if (statusCode < 200 || statusCode >= 300) {
|
|
448
|
-
return result;
|
|
449
|
-
}
|
|
450
|
-
const bodyBytes = await collectBody(body, config);
|
|
451
|
-
response.body = toStream(bodyBytes);
|
|
452
|
-
if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
|
|
453
|
-
const err = new Error("S3 aborted request");
|
|
454
|
-
err.$metadata = {
|
|
455
|
-
httpStatusCode: 503
|
|
456
|
-
};
|
|
457
|
-
err.name = "InternalError";
|
|
458
|
-
throw err;
|
|
80
|
+
async sign(requestToSign, options = {}) {
|
|
81
|
+
if (options.signingRegion === "*") {
|
|
82
|
+
return this.getSigv4aSigner().sign(requestToSign, options);
|
|
83
|
+
}
|
|
84
|
+
return this.sigv4Signer.sign(requestToSign, options);
|
|
459
85
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
86
|
+
async signWithCredentials(requestToSign, credentials, options = {}) {
|
|
87
|
+
if (options.signingRegion === "*") {
|
|
88
|
+
const signer = this.getSigv4aSigner();
|
|
89
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
90
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
91
|
+
return signer.signWithCredentials(requestToSign, credentials, options);
|
|
92
|
+
} else {
|
|
93
|
+
throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
|
|
463
97
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
98
|
+
async presign(originalRequest, options = {}) {
|
|
99
|
+
if (options.signingRegion === "*") {
|
|
100
|
+
const signer = this.getSigv4aSigner();
|
|
101
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
102
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
103
|
+
return signer.presign(originalRequest, options);
|
|
104
|
+
} else {
|
|
105
|
+
throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return this.sigv4Signer.presign(originalRequest, options);
|
|
469
109
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
tags: ["THROW_200_EXCEPTIONS", "S3"],
|
|
476
|
-
name: "throw200ExceptionsMiddleware",
|
|
477
|
-
override: true
|
|
478
|
-
};
|
|
479
|
-
var getThrow200ExceptionsPlugin = (config) => ({
|
|
480
|
-
applyToStack: (clientStack) => {
|
|
481
|
-
clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
|
|
110
|
+
async presignWithCredentials(originalRequest, credentials, options = {}) {
|
|
111
|
+
if (options.signingRegion === "*") {
|
|
112
|
+
throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
|
|
113
|
+
}
|
|
114
|
+
return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
|
|
482
115
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
return (next, context) => async (args) => {
|
|
491
|
-
if (options.bucketEndpoint) {
|
|
492
|
-
const endpoint = context.endpointV2;
|
|
493
|
-
if (endpoint) {
|
|
494
|
-
const bucket = args.input.Bucket;
|
|
495
|
-
if (typeof bucket === "string") {
|
|
496
|
-
try {
|
|
497
|
-
const bucketEndpointUrl = new URL(bucket);
|
|
498
|
-
context.endpointV2 = {
|
|
499
|
-
...endpoint,
|
|
500
|
-
url: bucketEndpointUrl
|
|
501
|
-
};
|
|
502
|
-
} catch (e) {
|
|
503
|
-
const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
|
|
504
|
-
if (context.logger?.constructor?.name === "NoOpLogger") {
|
|
505
|
-
console.warn(warning);
|
|
506
|
-
} else {
|
|
507
|
-
context.logger?.warn?.(warning);
|
|
508
|
-
}
|
|
509
|
-
throw e;
|
|
510
|
-
}
|
|
116
|
+
getSigv4aSigner() {
|
|
117
|
+
if (!this.sigv4aSigner) {
|
|
118
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
119
|
+
const JsSigV4aSigner = signatureV4aContainer.SignatureV4a;
|
|
120
|
+
if (this.signerOptions.runtime === "node") {
|
|
121
|
+
if (!CrtSignerV4 && !JsSigV4aSigner) {
|
|
122
|
+
throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
511
123
|
}
|
|
124
|
+
if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
|
|
125
|
+
this.sigv4aSigner = new CrtSignerV4({
|
|
126
|
+
...this.signerOptions,
|
|
127
|
+
signingAlgorithm: 1
|
|
128
|
+
});
|
|
129
|
+
} else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
|
|
130
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
131
|
+
...this.signerOptions
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
|
|
138
|
+
throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");
|
|
139
|
+
}
|
|
140
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
141
|
+
...this.signerOptions
|
|
142
|
+
});
|
|
512
143
|
}
|
|
513
144
|
}
|
|
514
|
-
return
|
|
515
|
-
};
|
|
516
|
-
}
|
|
517
|
-
var bucketEndpointMiddlewareOptions = {
|
|
518
|
-
name: "bucketEndpointMiddleware",
|
|
519
|
-
override: true,
|
|
520
|
-
relation: "after",
|
|
521
|
-
toMiddleware: "endpointV2Middleware"
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/validate-bucket-name.js
|
|
525
|
-
function validateBucketNameMiddleware({ bucketEndpoint }) {
|
|
526
|
-
return (next) => async (args) => {
|
|
527
|
-
const { input: { Bucket } } = args;
|
|
528
|
-
if (!bucketEndpoint && typeof Bucket === "string" && !validate(Bucket) && Bucket.indexOf("/") >= 0) {
|
|
529
|
-
const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
|
|
530
|
-
err.name = "InvalidBucketName";
|
|
531
|
-
throw err;
|
|
532
|
-
}
|
|
533
|
-
return next({ ...args });
|
|
534
|
-
};
|
|
535
|
-
}
|
|
536
|
-
var validateBucketNameMiddlewareOptions = {
|
|
537
|
-
step: "initialize",
|
|
538
|
-
tags: ["VALIDATE_BUCKET_NAME"],
|
|
539
|
-
name: "validateBucketNameMiddleware",
|
|
540
|
-
override: true
|
|
541
|
-
};
|
|
542
|
-
var getValidateBucketNamePlugin = (options) => ({
|
|
543
|
-
applyToStack: (clientStack) => {
|
|
544
|
-
clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
|
|
545
|
-
clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
|
|
145
|
+
return this.sigv4aSigner;
|
|
546
146
|
}
|
|
547
|
-
}
|
|
147
|
+
};
|
|
548
148
|
|
|
549
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
149
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js
|
|
550
150
|
var ATTR_ESCAPE_RE = /[&<>"]/g;
|
|
551
151
|
var ATTR_ESCAPE_MAP = {
|
|
552
152
|
"&": "&",
|
|
@@ -558,7 +158,7 @@ function escapeAttribute(value) {
|
|
|
558
158
|
return value.replace(ATTR_ESCAPE_RE, (ch) => ATTR_ESCAPE_MAP[ch]);
|
|
559
159
|
}
|
|
560
160
|
|
|
561
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
161
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js
|
|
562
162
|
var ELEMENT_ESCAPE_RE = /[&"'<>\r\n\u0085\u2028]/g;
|
|
563
163
|
var ELEMENT_ESCAPE_MAP = {
|
|
564
164
|
"&": "&",
|
|
@@ -575,7 +175,7 @@ function escapeElement(value) {
|
|
|
575
175
|
return value.replace(ELEMENT_ESCAPE_RE, (ch) => ELEMENT_ESCAPE_MAP[ch]);
|
|
576
176
|
}
|
|
577
177
|
|
|
578
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
178
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js
|
|
579
179
|
var XmlText = class {
|
|
580
180
|
value;
|
|
581
181
|
constructor(value) {
|
|
@@ -586,7 +186,7 @@ var XmlText = class {
|
|
|
586
186
|
}
|
|
587
187
|
};
|
|
588
188
|
|
|
589
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
189
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js
|
|
590
190
|
var XmlNode = class _XmlNode {
|
|
591
191
|
name;
|
|
592
192
|
children;
|
|
@@ -674,7 +274,7 @@ var XmlNode = class _XmlNode {
|
|
|
674
274
|
}
|
|
675
275
|
};
|
|
676
276
|
|
|
677
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
277
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/util.js
|
|
678
278
|
var nameStartChar = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
679
279
|
var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
680
280
|
var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*";
|
|
@@ -715,13 +315,13 @@ var DANGEROUS_PROPERTY_NAMES = [
|
|
|
715
315
|
];
|
|
716
316
|
var criticalProperties = ["__proto__", "constructor", "prototype"];
|
|
717
317
|
|
|
718
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
318
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/validator.js
|
|
719
319
|
var defaultOptions = {
|
|
720
320
|
allowBooleanAttributes: false,
|
|
721
321
|
//A tag can have attributes without any value
|
|
722
322
|
unpairedTags: []
|
|
723
323
|
};
|
|
724
|
-
function
|
|
324
|
+
function validate(xmlData, options) {
|
|
725
325
|
options = Object.assign({}, defaultOptions, options);
|
|
726
326
|
const tags = [];
|
|
727
327
|
let tagFound = false;
|
|
@@ -2490,7 +2090,7 @@ var EntityDecoder = class {
|
|
|
2490
2090
|
}
|
|
2491
2091
|
};
|
|
2492
2092
|
|
|
2493
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
2093
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js
|
|
2494
2094
|
var defaultOnDangerousProperty = (name) => {
|
|
2495
2095
|
if (DANGEROUS_PROPERTY_NAMES.includes(name)) {
|
|
2496
2096
|
return "__" + name;
|
|
@@ -2624,7 +2224,7 @@ var buildOptions = function(options) {
|
|
|
2624
2224
|
return built;
|
|
2625
2225
|
};
|
|
2626
2226
|
|
|
2627
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
2227
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js
|
|
2628
2228
|
var METADATA_SYMBOL;
|
|
2629
2229
|
if (typeof Symbol !== "function") {
|
|
2630
2230
|
METADATA_SYMBOL = "@@xmlMetadata";
|
|
@@ -2658,7 +2258,7 @@ var XmlNode2 = class {
|
|
|
2658
2258
|
}
|
|
2659
2259
|
};
|
|
2660
2260
|
|
|
2661
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
2261
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js
|
|
2662
2262
|
var DocTypeReader = class {
|
|
2663
2263
|
constructor(options) {
|
|
2664
2264
|
this.suppressValidationErr = !options;
|
|
@@ -3056,7 +2656,7 @@ function handleInfinity(str, num, options) {
|
|
|
3056
2656
|
}
|
|
3057
2657
|
}
|
|
3058
2658
|
|
|
3059
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
2659
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/ignoreAttributes.js
|
|
3060
2660
|
function getIgnoreAttributesFn(ignoreAttributes) {
|
|
3061
2661
|
if (typeof ignoreAttributes === "function") {
|
|
3062
2662
|
return ignoreAttributes;
|
|
@@ -3844,7 +3444,7 @@ var Matcher = class {
|
|
|
3844
3444
|
}
|
|
3845
3445
|
};
|
|
3846
3446
|
|
|
3847
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
3447
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js
|
|
3848
3448
|
function extractRawAttributes(prefixedAttrs, options) {
|
|
3849
3449
|
if (!prefixedAttrs) return {};
|
|
3850
3450
|
const attrs = options.attributesGroupName ? prefixedAttrs[options.attributesGroupName] : prefixedAttrs;
|
|
@@ -4378,7 +3978,7 @@ function readStopNodeData(xmlData, tagName, i) {
|
|
|
4378
3978
|
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
|
|
4379
3979
|
i = closeIndex;
|
|
4380
3980
|
} else {
|
|
4381
|
-
const tagData = readTagExp(xmlData, i,
|
|
3981
|
+
const tagData = readTagExp(xmlData, i, false);
|
|
4382
3982
|
if (tagData) {
|
|
4383
3983
|
const openTagName = tagData && tagData.tagName;
|
|
4384
3984
|
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") {
|
|
@@ -4424,7 +4024,7 @@ function sanitizeName(name, options) {
|
|
|
4424
4024
|
return name;
|
|
4425
4025
|
}
|
|
4426
4026
|
|
|
4427
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
4027
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/node2json.js
|
|
4428
4028
|
var METADATA_SYMBOL2 = XmlNode2.getMetaDataSymbol();
|
|
4429
4029
|
function stripAttributePrefix(attrs, prefix) {
|
|
4430
4030
|
if (!attrs || typeof attrs !== "object") return {};
|
|
@@ -4464,6 +4064,9 @@ function compress(arr, options, matcher, readonlyMatcher) {
|
|
|
4464
4064
|
} else if (tagObj[property]) {
|
|
4465
4065
|
let val = compress(tagObj[property], options, matcher, readonlyMatcher);
|
|
4466
4066
|
const isLeaf = isLeafTag(val, options);
|
|
4067
|
+
if (Object.keys(val).length === 0 && options.alwaysCreateTextNode) {
|
|
4068
|
+
val[options.textNodeName] = "";
|
|
4069
|
+
}
|
|
4467
4070
|
if (tagObj[":@"]) {
|
|
4468
4071
|
assignAttributes(val, tagObj[":@"], readonlyMatcher, options);
|
|
4469
4072
|
} else if (Object.keys(val).length === 1 && val[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) {
|
|
@@ -4533,7 +4136,7 @@ function isLeafTag(obj, options) {
|
|
|
4533
4136
|
return false;
|
|
4534
4137
|
}
|
|
4535
4138
|
|
|
4536
|
-
// ../../node_modules/.pnpm/fast-xml-parser@5.7.
|
|
4139
|
+
// ../../node_modules/.pnpm/fast-xml-parser@5.7.3/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js
|
|
4537
4140
|
var XMLParser = class {
|
|
4538
4141
|
constructor(options) {
|
|
4539
4142
|
this.externalEntities = {};
|
|
@@ -4552,7 +4155,7 @@ var XMLParser = class {
|
|
|
4552
4155
|
}
|
|
4553
4156
|
if (validationOption) {
|
|
4554
4157
|
if (validationOption === true) validationOption = {};
|
|
4555
|
-
const result =
|
|
4158
|
+
const result = validate(xmlData, validationOption);
|
|
4556
4159
|
if (result !== true) {
|
|
4557
4160
|
throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`);
|
|
4558
4161
|
}
|
|
@@ -4593,7 +4196,7 @@ var XMLParser = class {
|
|
|
4593
4196
|
}
|
|
4594
4197
|
};
|
|
4595
4198
|
|
|
4596
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
4199
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/xml-external/nodable_entities.js
|
|
4597
4200
|
var XML2 = {
|
|
4598
4201
|
amp: "&",
|
|
4599
4202
|
apos: "'",
|
|
@@ -4919,7 +4522,7 @@ var EntityDecoderImpl = class EntityDecoderImpl2 {
|
|
|
4919
4522
|
}
|
|
4920
4523
|
};
|
|
4921
4524
|
|
|
4922
|
-
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.
|
|
4525
|
+
// ../../node_modules/.pnpm/@aws-sdk+xml-builder@3.972.24/node_modules/@aws-sdk/xml-builder/dist-es/xml-parser.js
|
|
4923
4526
|
var entityDecoder = new EntityDecoderImpl({
|
|
4924
4527
|
namedEntities: { ...XML2, ...COMMON_HTML2, ...CURRENCY2 },
|
|
4925
4528
|
numericAllowed: true,
|
|
@@ -4963,7 +4566,7 @@ function parseXML(xmlString) {
|
|
|
4963
4566
|
return parser.parse(xmlString, true);
|
|
4964
4567
|
}
|
|
4965
4568
|
|
|
4966
|
-
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.
|
|
4569
|
+
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.11/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js
|
|
4967
4570
|
var XmlShapeDeserializer = class extends SerdeContextConfig {
|
|
4968
4571
|
settings;
|
|
4969
4572
|
stringDeserializer;
|
|
@@ -5104,520 +4707,9 @@ var XmlShapeDeserializer = class extends SerdeContextConfig {
|
|
|
5104
4707
|
}
|
|
5105
4708
|
};
|
|
5106
4709
|
|
|
5107
|
-
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.7/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js
|
|
5108
|
-
var loadRestXmlErrorCode = (output, data) => {
|
|
5109
|
-
if (data?.Error?.Code !== void 0) {
|
|
5110
|
-
return data.Error.Code;
|
|
5111
|
-
}
|
|
5112
|
-
if (data?.Code !== void 0) {
|
|
5113
|
-
return data.Code;
|
|
5114
|
-
}
|
|
5115
|
-
if (output.statusCode == 404) {
|
|
5116
|
-
return "NotFound";
|
|
5117
|
-
}
|
|
5118
|
-
};
|
|
5119
|
-
|
|
5120
|
-
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.7/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js
|
|
5121
|
-
var XmlShapeSerializer = class extends SerdeContextConfig {
|
|
5122
|
-
settings;
|
|
5123
|
-
stringBuffer;
|
|
5124
|
-
byteBuffer;
|
|
5125
|
-
buffer;
|
|
5126
|
-
constructor(settings) {
|
|
5127
|
-
super();
|
|
5128
|
-
this.settings = settings;
|
|
5129
|
-
}
|
|
5130
|
-
write(schema, value) {
|
|
5131
|
-
const ns = NormalizedSchema.of(schema);
|
|
5132
|
-
if (ns.isStringSchema() && typeof value === "string") {
|
|
5133
|
-
this.stringBuffer = value;
|
|
5134
|
-
} else if (ns.isBlobSchema()) {
|
|
5135
|
-
this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
|
5136
|
-
} else {
|
|
5137
|
-
this.buffer = this.writeStruct(ns, value, void 0);
|
|
5138
|
-
const traits = ns.getMergedTraits();
|
|
5139
|
-
if (traits.httpPayload && !traits.xmlName) {
|
|
5140
|
-
this.buffer.withName(ns.getName());
|
|
5141
|
-
}
|
|
5142
|
-
}
|
|
5143
|
-
}
|
|
5144
|
-
flush() {
|
|
5145
|
-
if (this.byteBuffer !== void 0) {
|
|
5146
|
-
const bytes = this.byteBuffer;
|
|
5147
|
-
delete this.byteBuffer;
|
|
5148
|
-
return bytes;
|
|
5149
|
-
}
|
|
5150
|
-
if (this.stringBuffer !== void 0) {
|
|
5151
|
-
const str = this.stringBuffer;
|
|
5152
|
-
delete this.stringBuffer;
|
|
5153
|
-
return str;
|
|
5154
|
-
}
|
|
5155
|
-
const buffer = this.buffer;
|
|
5156
|
-
if (this.settings.xmlNamespace) {
|
|
5157
|
-
if (!buffer?.attributes?.["xmlns"]) {
|
|
5158
|
-
buffer.addAttribute("xmlns", this.settings.xmlNamespace);
|
|
5159
|
-
}
|
|
5160
|
-
}
|
|
5161
|
-
delete this.buffer;
|
|
5162
|
-
return buffer.toString();
|
|
5163
|
-
}
|
|
5164
|
-
writeStruct(ns, value, parentXmlns) {
|
|
5165
|
-
const traits = ns.getMergedTraits();
|
|
5166
|
-
const name = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName();
|
|
5167
|
-
if (!name || !ns.isStructSchema()) {
|
|
5168
|
-
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`);
|
|
5169
|
-
}
|
|
5170
|
-
const structXmlNode = XmlNode.of(name);
|
|
5171
|
-
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
|
5172
|
-
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
5173
|
-
const val = value[memberName];
|
|
5174
|
-
if (val != null || memberSchema.isIdempotencyToken()) {
|
|
5175
|
-
if (memberSchema.getMergedTraits().xmlAttribute) {
|
|
5176
|
-
structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val));
|
|
5177
|
-
continue;
|
|
5178
|
-
}
|
|
5179
|
-
if (memberSchema.isListSchema()) {
|
|
5180
|
-
this.writeList(memberSchema, val, structXmlNode, xmlns);
|
|
5181
|
-
} else if (memberSchema.isMapSchema()) {
|
|
5182
|
-
this.writeMap(memberSchema, val, structXmlNode, xmlns);
|
|
5183
|
-
} else if (memberSchema.isStructSchema()) {
|
|
5184
|
-
structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns));
|
|
5185
|
-
} else {
|
|
5186
|
-
const memberNode = XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName());
|
|
5187
|
-
this.writeSimpleInto(memberSchema, val, memberNode, xmlns);
|
|
5188
|
-
structXmlNode.addChildNode(memberNode);
|
|
5189
|
-
}
|
|
5190
|
-
}
|
|
5191
|
-
}
|
|
5192
|
-
const { $unknown } = value;
|
|
5193
|
-
if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) {
|
|
5194
|
-
const [k, v] = $unknown;
|
|
5195
|
-
const node = XmlNode.of(k);
|
|
5196
|
-
if (typeof v !== "string") {
|
|
5197
|
-
if (value instanceof XmlNode || value instanceof XmlText) {
|
|
5198
|
-
structXmlNode.addChildNode(value);
|
|
5199
|
-
} else {
|
|
5200
|
-
throw new Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`);
|
|
5201
|
-
}
|
|
5202
|
-
}
|
|
5203
|
-
this.writeSimpleInto(0, v, node, xmlns);
|
|
5204
|
-
structXmlNode.addChildNode(node);
|
|
5205
|
-
}
|
|
5206
|
-
if (xmlns) {
|
|
5207
|
-
structXmlNode.addAttribute(xmlnsAttr, xmlns);
|
|
5208
|
-
}
|
|
5209
|
-
return structXmlNode;
|
|
5210
|
-
}
|
|
5211
|
-
writeList(listMember, array, container, parentXmlns) {
|
|
5212
|
-
if (!listMember.isMemberSchema()) {
|
|
5213
|
-
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);
|
|
5214
|
-
}
|
|
5215
|
-
const listTraits = listMember.getMergedTraits();
|
|
5216
|
-
const listValueSchema = listMember.getValueSchema();
|
|
5217
|
-
const listValueTraits = listValueSchema.getMergedTraits();
|
|
5218
|
-
const sparse = !!listValueTraits.sparse;
|
|
5219
|
-
const flat = !!listTraits.xmlFlattened;
|
|
5220
|
-
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns);
|
|
5221
|
-
const writeItem = (container2, value) => {
|
|
5222
|
-
if (listValueSchema.isListSchema()) {
|
|
5223
|
-
this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns);
|
|
5224
|
-
} else if (listValueSchema.isMapSchema()) {
|
|
5225
|
-
this.writeMap(listValueSchema, value, container2, xmlns);
|
|
5226
|
-
} else if (listValueSchema.isStructSchema()) {
|
|
5227
|
-
const struct = this.writeStruct(listValueSchema, value, xmlns);
|
|
5228
|
-
container2.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"));
|
|
5229
|
-
} else {
|
|
5230
|
-
const listItemNode = XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member");
|
|
5231
|
-
this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns);
|
|
5232
|
-
container2.addChildNode(listItemNode);
|
|
5233
|
-
}
|
|
5234
|
-
};
|
|
5235
|
-
if (flat) {
|
|
5236
|
-
for (const value of array) {
|
|
5237
|
-
if (sparse || value != null) {
|
|
5238
|
-
writeItem(container, value);
|
|
5239
|
-
}
|
|
5240
|
-
}
|
|
5241
|
-
} else {
|
|
5242
|
-
const listNode = XmlNode.of(listTraits.xmlName ?? listMember.getMemberName());
|
|
5243
|
-
if (xmlns) {
|
|
5244
|
-
listNode.addAttribute(xmlnsAttr, xmlns);
|
|
5245
|
-
}
|
|
5246
|
-
for (const value of array) {
|
|
5247
|
-
if (sparse || value != null) {
|
|
5248
|
-
writeItem(listNode, value);
|
|
5249
|
-
}
|
|
5250
|
-
}
|
|
5251
|
-
container.addChildNode(listNode);
|
|
5252
|
-
}
|
|
5253
|
-
}
|
|
5254
|
-
writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) {
|
|
5255
|
-
if (!mapMember.isMemberSchema()) {
|
|
5256
|
-
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`);
|
|
5257
|
-
}
|
|
5258
|
-
const mapTraits = mapMember.getMergedTraits();
|
|
5259
|
-
const mapKeySchema = mapMember.getKeySchema();
|
|
5260
|
-
const mapKeyTraits = mapKeySchema.getMergedTraits();
|
|
5261
|
-
const keyTag = mapKeyTraits.xmlName ?? "key";
|
|
5262
|
-
const mapValueSchema = mapMember.getValueSchema();
|
|
5263
|
-
const mapValueTraits = mapValueSchema.getMergedTraits();
|
|
5264
|
-
const valueTag = mapValueTraits.xmlName ?? "value";
|
|
5265
|
-
const sparse = !!mapValueTraits.sparse;
|
|
5266
|
-
const flat = !!mapTraits.xmlFlattened;
|
|
5267
|
-
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns);
|
|
5268
|
-
const addKeyValue = (entry, key, val) => {
|
|
5269
|
-
const keyNode = XmlNode.of(keyTag, key);
|
|
5270
|
-
const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns);
|
|
5271
|
-
if (keyXmlns) {
|
|
5272
|
-
keyNode.addAttribute(keyXmlnsAttr, keyXmlns);
|
|
5273
|
-
}
|
|
5274
|
-
entry.addChildNode(keyNode);
|
|
5275
|
-
let valueNode = XmlNode.of(valueTag);
|
|
5276
|
-
if (mapValueSchema.isListSchema()) {
|
|
5277
|
-
this.writeList(mapValueSchema, val, valueNode, xmlns);
|
|
5278
|
-
} else if (mapValueSchema.isMapSchema()) {
|
|
5279
|
-
this.writeMap(mapValueSchema, val, valueNode, xmlns, true);
|
|
5280
|
-
} else if (mapValueSchema.isStructSchema()) {
|
|
5281
|
-
valueNode = this.writeStruct(mapValueSchema, val, xmlns);
|
|
5282
|
-
} else {
|
|
5283
|
-
this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns);
|
|
5284
|
-
}
|
|
5285
|
-
entry.addChildNode(valueNode);
|
|
5286
|
-
};
|
|
5287
|
-
if (flat) {
|
|
5288
|
-
for (const key in map) {
|
|
5289
|
-
const val = map[key];
|
|
5290
|
-
if (sparse || val != null) {
|
|
5291
|
-
const entry = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
|
5292
|
-
addKeyValue(entry, key, val);
|
|
5293
|
-
container.addChildNode(entry);
|
|
5294
|
-
}
|
|
5295
|
-
}
|
|
5296
|
-
} else {
|
|
5297
|
-
let mapNode;
|
|
5298
|
-
if (!containerIsMap) {
|
|
5299
|
-
mapNode = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
|
5300
|
-
if (xmlns) {
|
|
5301
|
-
mapNode.addAttribute(xmlnsAttr, xmlns);
|
|
5302
|
-
}
|
|
5303
|
-
container.addChildNode(mapNode);
|
|
5304
|
-
}
|
|
5305
|
-
for (const key in map) {
|
|
5306
|
-
const val = map[key];
|
|
5307
|
-
if (sparse || val != null) {
|
|
5308
|
-
const entry = XmlNode.of("entry");
|
|
5309
|
-
addKeyValue(entry, key, val);
|
|
5310
|
-
(containerIsMap ? container : mapNode).addChildNode(entry);
|
|
5311
|
-
}
|
|
5312
|
-
}
|
|
5313
|
-
}
|
|
5314
|
-
}
|
|
5315
|
-
writeSimple(_schema, value) {
|
|
5316
|
-
if (null === value) {
|
|
5317
|
-
throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");
|
|
5318
|
-
}
|
|
5319
|
-
const ns = NormalizedSchema.of(_schema);
|
|
5320
|
-
let nodeContents = null;
|
|
5321
|
-
if (value && typeof value === "object") {
|
|
5322
|
-
if (ns.isBlobSchema()) {
|
|
5323
|
-
nodeContents = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
5324
|
-
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
5325
|
-
const format = determineTimestampFormat(ns, this.settings);
|
|
5326
|
-
switch (format) {
|
|
5327
|
-
case 5:
|
|
5328
|
-
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
5329
|
-
break;
|
|
5330
|
-
case 6:
|
|
5331
|
-
nodeContents = dateToUtcString(value);
|
|
5332
|
-
break;
|
|
5333
|
-
case 7:
|
|
5334
|
-
nodeContents = String(value.getTime() / 1e3);
|
|
5335
|
-
break;
|
|
5336
|
-
default:
|
|
5337
|
-
console.warn("Missing timestamp format, using http date", value);
|
|
5338
|
-
nodeContents = dateToUtcString(value);
|
|
5339
|
-
break;
|
|
5340
|
-
}
|
|
5341
|
-
} else if (ns.isBigDecimalSchema() && value) {
|
|
5342
|
-
if (value instanceof NumericValue) {
|
|
5343
|
-
return value.string;
|
|
5344
|
-
}
|
|
5345
|
-
return String(value);
|
|
5346
|
-
} else if (ns.isMapSchema() || ns.isListSchema()) {
|
|
5347
|
-
throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");
|
|
5348
|
-
} else {
|
|
5349
|
-
throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`);
|
|
5350
|
-
}
|
|
5351
|
-
}
|
|
5352
|
-
if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
|
|
5353
|
-
nodeContents = String(value);
|
|
5354
|
-
}
|
|
5355
|
-
if (ns.isStringSchema()) {
|
|
5356
|
-
if (value === void 0 && ns.isIdempotencyToken()) {
|
|
5357
|
-
nodeContents = v4();
|
|
5358
|
-
} else {
|
|
5359
|
-
nodeContents = String(value);
|
|
5360
|
-
}
|
|
5361
|
-
}
|
|
5362
|
-
if (nodeContents === null) {
|
|
5363
|
-
throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`);
|
|
5364
|
-
}
|
|
5365
|
-
return nodeContents;
|
|
5366
|
-
}
|
|
5367
|
-
writeSimpleInto(_schema, value, into, parentXmlns) {
|
|
5368
|
-
const nodeContents = this.writeSimple(_schema, value);
|
|
5369
|
-
const ns = NormalizedSchema.of(_schema);
|
|
5370
|
-
const content = new XmlText(nodeContents);
|
|
5371
|
-
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
|
5372
|
-
if (xmlns) {
|
|
5373
|
-
into.addAttribute(xmlnsAttr, xmlns);
|
|
5374
|
-
}
|
|
5375
|
-
into.addChildNode(content);
|
|
5376
|
-
}
|
|
5377
|
-
getXmlnsAttribute(ns, parentXmlns) {
|
|
5378
|
-
const traits = ns.getMergedTraits();
|
|
5379
|
-
const [prefix, xmlns] = traits.xmlNamespace ?? [];
|
|
5380
|
-
if (xmlns && xmlns !== parentXmlns) {
|
|
5381
|
-
return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns];
|
|
5382
|
-
}
|
|
5383
|
-
return [void 0, void 0];
|
|
5384
|
-
}
|
|
5385
|
-
};
|
|
5386
|
-
|
|
5387
|
-
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.7/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js
|
|
5388
|
-
var XmlCodec = class extends SerdeContextConfig {
|
|
5389
|
-
settings;
|
|
5390
|
-
constructor(settings) {
|
|
5391
|
-
super();
|
|
5392
|
-
this.settings = settings;
|
|
5393
|
-
}
|
|
5394
|
-
createSerializer() {
|
|
5395
|
-
const serializer = new XmlShapeSerializer(this.settings);
|
|
5396
|
-
serializer.setSerdeContext(this.serdeContext);
|
|
5397
|
-
return serializer;
|
|
5398
|
-
}
|
|
5399
|
-
createDeserializer() {
|
|
5400
|
-
const deserializer = new XmlShapeDeserializer(this.settings);
|
|
5401
|
-
deserializer.setSerdeContext(this.serdeContext);
|
|
5402
|
-
return deserializer;
|
|
5403
|
-
}
|
|
5404
|
-
};
|
|
5405
|
-
|
|
5406
|
-
// ../../node_modules/.pnpm/@aws-sdk+core@3.974.7/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js
|
|
5407
|
-
var AwsRestXmlProtocol = class extends HttpBindingProtocol {
|
|
5408
|
-
codec;
|
|
5409
|
-
serializer;
|
|
5410
|
-
deserializer;
|
|
5411
|
-
mixin = new ProtocolLib();
|
|
5412
|
-
constructor(options) {
|
|
5413
|
-
super(options);
|
|
5414
|
-
const settings = {
|
|
5415
|
-
timestampFormat: {
|
|
5416
|
-
useTrait: true,
|
|
5417
|
-
default: 5
|
|
5418
|
-
},
|
|
5419
|
-
httpBindings: true,
|
|
5420
|
-
xmlNamespace: options.xmlNamespace,
|
|
5421
|
-
serviceNamespace: options.defaultNamespace
|
|
5422
|
-
};
|
|
5423
|
-
this.codec = new XmlCodec(settings);
|
|
5424
|
-
this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
|
|
5425
|
-
this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
|
|
5426
|
-
}
|
|
5427
|
-
getPayloadCodec() {
|
|
5428
|
-
return this.codec;
|
|
5429
|
-
}
|
|
5430
|
-
getShapeId() {
|
|
5431
|
-
return "aws.protocols#restXml";
|
|
5432
|
-
}
|
|
5433
|
-
async serializeRequest(operationSchema, input, context) {
|
|
5434
|
-
const request = await super.serializeRequest(operationSchema, input, context);
|
|
5435
|
-
const inputSchema = NormalizedSchema.of(operationSchema.input);
|
|
5436
|
-
if (!request.headers["content-type"]) {
|
|
5437
|
-
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
5438
|
-
if (contentType) {
|
|
5439
|
-
request.headers["content-type"] = contentType;
|
|
5440
|
-
}
|
|
5441
|
-
}
|
|
5442
|
-
if (typeof request.body === "string" && request.headers["content-type"] === this.getDefaultContentType() && !request.body.startsWith("<?xml ") && !this.hasUnstructuredPayloadBinding(inputSchema)) {
|
|
5443
|
-
request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
|
|
5444
|
-
}
|
|
5445
|
-
return request;
|
|
5446
|
-
}
|
|
5447
|
-
async deserializeResponse(operationSchema, context, response) {
|
|
5448
|
-
return super.deserializeResponse(operationSchema, context, response);
|
|
5449
|
-
}
|
|
5450
|
-
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
5451
|
-
const errorIdentifier = loadRestXmlErrorCode(response, dataObject) ?? "Unknown";
|
|
5452
|
-
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
5453
|
-
if (dataObject.Error && typeof dataObject.Error === "object") {
|
|
5454
|
-
for (const key of Object.keys(dataObject.Error)) {
|
|
5455
|
-
dataObject[key] = dataObject.Error[key];
|
|
5456
|
-
if (key.toLowerCase() === "message") {
|
|
5457
|
-
dataObject.message = dataObject.Error[key];
|
|
5458
|
-
}
|
|
5459
|
-
}
|
|
5460
|
-
}
|
|
5461
|
-
if (dataObject.RequestId && !metadata.requestId) {
|
|
5462
|
-
metadata.requestId = dataObject.RequestId;
|
|
5463
|
-
}
|
|
5464
|
-
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
5465
|
-
const ns = NormalizedSchema.of(errorSchema);
|
|
5466
|
-
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
5467
|
-
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
5468
|
-
const exception = new ErrorCtor(message);
|
|
5469
|
-
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
5470
|
-
const output = {};
|
|
5471
|
-
const errorDeserializer = this.codec.createDeserializer();
|
|
5472
|
-
for (const [name, member] of ns.structIterator()) {
|
|
5473
|
-
const target = member.getMergedTraits().xmlName ?? name;
|
|
5474
|
-
const value = dataObject.Error?.[target] ?? dataObject[target];
|
|
5475
|
-
output[name] = errorDeserializer.readSchema(member, value);
|
|
5476
|
-
}
|
|
5477
|
-
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
5478
|
-
$fault: ns.getMergedTraits().error,
|
|
5479
|
-
message
|
|
5480
|
-
}, output), dataObject);
|
|
5481
|
-
}
|
|
5482
|
-
getDefaultContentType() {
|
|
5483
|
-
return "application/xml";
|
|
5484
|
-
}
|
|
5485
|
-
hasUnstructuredPayloadBinding(ns) {
|
|
5486
|
-
for (const [, member] of ns.structIterator()) {
|
|
5487
|
-
if (member.getMergedTraits().httpPayload) {
|
|
5488
|
-
return !(member.isStructSchema() || member.isMapSchema() || member.isListSchema());
|
|
5489
|
-
}
|
|
5490
|
-
}
|
|
5491
|
-
return false;
|
|
5492
|
-
}
|
|
5493
|
-
};
|
|
5494
|
-
|
|
5495
|
-
// ../../node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.36/node_modules/@aws-sdk/middleware-sdk-s3/dist-es/protocol/S3RestXmlProtocol.js
|
|
5496
|
-
var S3RestXmlProtocol = class extends AwsRestXmlProtocol {
|
|
5497
|
-
async serializeRequest(operationSchema, input, context) {
|
|
5498
|
-
const request = await super.serializeRequest(operationSchema, input, context);
|
|
5499
|
-
const ns = NormalizedSchema.of(operationSchema.input);
|
|
5500
|
-
const staticStructureSchema = ns.getSchema();
|
|
5501
|
-
let bucketMemberIndex = 0;
|
|
5502
|
-
const requiredMemberCount = staticStructureSchema[6] ?? 0;
|
|
5503
|
-
if (input && typeof input === "object") {
|
|
5504
|
-
for (const [memberName, memberNs] of ns.structIterator()) {
|
|
5505
|
-
if (++bucketMemberIndex > requiredMemberCount) {
|
|
5506
|
-
break;
|
|
5507
|
-
}
|
|
5508
|
-
if (memberName === "Bucket") {
|
|
5509
|
-
if (!input.Bucket && memberNs.getMergedTraits().httpLabel) {
|
|
5510
|
-
throw new Error(`No value provided for input HTTP label: Bucket.`);
|
|
5511
|
-
}
|
|
5512
|
-
break;
|
|
5513
|
-
}
|
|
5514
|
-
}
|
|
5515
|
-
}
|
|
5516
|
-
return request;
|
|
5517
|
-
}
|
|
5518
|
-
};
|
|
5519
|
-
|
|
5520
|
-
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.24/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js
|
|
5521
|
-
var signatureV4CrtContainer = {
|
|
5522
|
-
CrtSignerV4: null
|
|
5523
|
-
};
|
|
5524
|
-
|
|
5525
|
-
// ../../node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.24/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js
|
|
5526
|
-
var SignatureV4MultiRegion = class {
|
|
5527
|
-
sigv4aSigner;
|
|
5528
|
-
sigv4Signer;
|
|
5529
|
-
signerOptions;
|
|
5530
|
-
static sigv4aDependency() {
|
|
5531
|
-
if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
|
|
5532
|
-
return "crt";
|
|
5533
|
-
} else if (typeof signatureV4aContainer.SignatureV4a === "function") {
|
|
5534
|
-
return "js";
|
|
5535
|
-
}
|
|
5536
|
-
return "none";
|
|
5537
|
-
}
|
|
5538
|
-
constructor(options) {
|
|
5539
|
-
this.sigv4Signer = new SignatureV4S3Express(options);
|
|
5540
|
-
this.signerOptions = options;
|
|
5541
|
-
}
|
|
5542
|
-
async sign(requestToSign, options = {}) {
|
|
5543
|
-
if (options.signingRegion === "*") {
|
|
5544
|
-
return this.getSigv4aSigner().sign(requestToSign, options);
|
|
5545
|
-
}
|
|
5546
|
-
return this.sigv4Signer.sign(requestToSign, options);
|
|
5547
|
-
}
|
|
5548
|
-
async signWithCredentials(requestToSign, credentials, options = {}) {
|
|
5549
|
-
if (options.signingRegion === "*") {
|
|
5550
|
-
const signer = this.getSigv4aSigner();
|
|
5551
|
-
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5552
|
-
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
5553
|
-
return signer.signWithCredentials(requestToSign, credentials, options);
|
|
5554
|
-
} else {
|
|
5555
|
-
throw new Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
5556
|
-
}
|
|
5557
|
-
}
|
|
5558
|
-
return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
|
|
5559
|
-
}
|
|
5560
|
-
async presign(originalRequest, options = {}) {
|
|
5561
|
-
if (options.signingRegion === "*") {
|
|
5562
|
-
const signer = this.getSigv4aSigner();
|
|
5563
|
-
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5564
|
-
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
5565
|
-
return signer.presign(originalRequest, options);
|
|
5566
|
-
} else {
|
|
5567
|
-
throw new Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`);
|
|
5568
|
-
}
|
|
5569
|
-
}
|
|
5570
|
-
return this.sigv4Signer.presign(originalRequest, options);
|
|
5571
|
-
}
|
|
5572
|
-
async presignWithCredentials(originalRequest, credentials, options = {}) {
|
|
5573
|
-
if (options.signingRegion === "*") {
|
|
5574
|
-
throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
|
|
5575
|
-
}
|
|
5576
|
-
return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
|
|
5577
|
-
}
|
|
5578
|
-
getSigv4aSigner() {
|
|
5579
|
-
if (!this.sigv4aSigner) {
|
|
5580
|
-
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
5581
|
-
const JsSigV4aSigner = signatureV4aContainer.SignatureV4a;
|
|
5582
|
-
if (this.signerOptions.runtime === "node") {
|
|
5583
|
-
if (!CrtSignerV4 && !JsSigV4aSigner) {
|
|
5584
|
-
throw new Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
5585
|
-
}
|
|
5586
|
-
if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
|
|
5587
|
-
this.sigv4aSigner = new CrtSignerV4({
|
|
5588
|
-
...this.signerOptions,
|
|
5589
|
-
signingAlgorithm: 1
|
|
5590
|
-
});
|
|
5591
|
-
} else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
|
|
5592
|
-
this.sigv4aSigner = new JsSigV4aSigner({
|
|
5593
|
-
...this.signerOptions
|
|
5594
|
-
});
|
|
5595
|
-
} else {
|
|
5596
|
-
throw new Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");
|
|
5597
|
-
}
|
|
5598
|
-
} else {
|
|
5599
|
-
if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
|
|
5600
|
-
throw new Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");
|
|
5601
|
-
}
|
|
5602
|
-
this.sigv4aSigner = new JsSigV4aSigner({
|
|
5603
|
-
...this.signerOptions
|
|
5604
|
-
});
|
|
5605
|
-
}
|
|
5606
|
-
}
|
|
5607
|
-
return this.sigv4aSigner;
|
|
5608
|
-
}
|
|
5609
|
-
};
|
|
5610
|
-
|
|
5611
4710
|
export {
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
getS3ExpressHttpSigningPlugin,
|
|
5617
|
-
resolveS3Config,
|
|
5618
|
-
getThrow200ExceptionsPlugin,
|
|
5619
|
-
getValidateBucketNamePlugin,
|
|
5620
|
-
XmlShapeDeserializer,
|
|
5621
|
-
S3RestXmlProtocol,
|
|
5622
|
-
SignatureV4MultiRegion
|
|
4711
|
+
SignatureV4MultiRegion,
|
|
4712
|
+
XmlText,
|
|
4713
|
+
XmlNode,
|
|
4714
|
+
XmlShapeDeserializer
|
|
5623
4715
|
};
|