koishi-plugin-echo-cave 1.32.0 → 1.32.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/lib/index.cjs +2945 -92
- package/package.json +2 -2
package/lib/index.cjs
CHANGED
|
@@ -469,7 +469,7 @@ var require_fromBase64 = __commonJS({
|
|
|
469
469
|
exports2.fromBase64 = void 0;
|
|
470
470
|
var util_buffer_from_1 = require_dist_cjs5();
|
|
471
471
|
var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
472
|
-
var
|
|
472
|
+
var fromBase6411 = (input) => {
|
|
473
473
|
if (input.length * 3 % 4 !== 0) {
|
|
474
474
|
throw new TypeError(`Incorrect padding on base64 string.`);
|
|
475
475
|
}
|
|
@@ -479,7 +479,7 @@ var require_fromBase64 = __commonJS({
|
|
|
479
479
|
const buffer = (0, util_buffer_from_1.fromString)(input, "base64");
|
|
480
480
|
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
481
481
|
};
|
|
482
|
-
exports2.fromBase64 =
|
|
482
|
+
exports2.fromBase64 = fromBase6411;
|
|
483
483
|
}
|
|
484
484
|
});
|
|
485
485
|
|
|
@@ -501,7 +501,7 @@ var require_dist_cjs6 = __commonJS({
|
|
|
501
501
|
}
|
|
502
502
|
return new Uint8Array(data2);
|
|
503
503
|
};
|
|
504
|
-
var
|
|
504
|
+
var toUtf813 = (input) => {
|
|
505
505
|
if (typeof input === "string") {
|
|
506
506
|
return input;
|
|
507
507
|
}
|
|
@@ -512,7 +512,7 @@ var require_dist_cjs6 = __commonJS({
|
|
|
512
512
|
};
|
|
513
513
|
exports2.fromUtf8 = fromUtf88;
|
|
514
514
|
exports2.toUint8Array = toUint8Array2;
|
|
515
|
-
exports2.toUtf8 =
|
|
515
|
+
exports2.toUtf8 = toUtf813;
|
|
516
516
|
}
|
|
517
517
|
});
|
|
518
518
|
|
|
@@ -524,7 +524,7 @@ var require_toBase64 = __commonJS({
|
|
|
524
524
|
exports2.toBase64 = void 0;
|
|
525
525
|
var util_buffer_from_1 = require_dist_cjs5();
|
|
526
526
|
var util_utf8_1 = require_dist_cjs6();
|
|
527
|
-
var
|
|
527
|
+
var toBase6412 = (_input) => {
|
|
528
528
|
let input;
|
|
529
529
|
if (typeof _input === "string") {
|
|
530
530
|
input = (0, util_utf8_1.fromUtf8)(_input);
|
|
@@ -536,7 +536,7 @@ var require_toBase64 = __commonJS({
|
|
|
536
536
|
}
|
|
537
537
|
return (0, util_buffer_from_1.fromArrayBuffer)(input.buffer, input.byteOffset, input.byteLength).toString("base64");
|
|
538
538
|
};
|
|
539
|
-
exports2.toBase64 =
|
|
539
|
+
exports2.toBase64 = toBase6412;
|
|
540
540
|
}
|
|
541
541
|
});
|
|
542
542
|
|
|
@@ -544,21 +544,21 @@ var require_toBase64 = __commonJS({
|
|
|
544
544
|
var require_dist_cjs7 = __commonJS({
|
|
545
545
|
"node_modules/.pnpm/@smithy+util-base64@4.3.2/node_modules/@smithy/util-base64/dist-cjs/index.js"(exports2) {
|
|
546
546
|
"use strict";
|
|
547
|
-
var
|
|
548
|
-
var
|
|
549
|
-
Object.prototype.hasOwnProperty.call(
|
|
547
|
+
var fromBase6411 = require_fromBase64();
|
|
548
|
+
var toBase6412 = require_toBase64();
|
|
549
|
+
Object.prototype.hasOwnProperty.call(fromBase6411, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", {
|
|
550
550
|
enumerable: true,
|
|
551
|
-
value:
|
|
551
|
+
value: fromBase6411["__proto__"]
|
|
552
552
|
});
|
|
553
|
-
Object.keys(
|
|
554
|
-
if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] =
|
|
553
|
+
Object.keys(fromBase6411).forEach(function(k5) {
|
|
554
|
+
if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = fromBase6411[k5];
|
|
555
555
|
});
|
|
556
|
-
Object.prototype.hasOwnProperty.call(
|
|
556
|
+
Object.prototype.hasOwnProperty.call(toBase6412, "__proto__") && !Object.prototype.hasOwnProperty.call(exports2, "__proto__") && Object.defineProperty(exports2, "__proto__", {
|
|
557
557
|
enumerable: true,
|
|
558
|
-
value:
|
|
558
|
+
value: toBase6412["__proto__"]
|
|
559
559
|
});
|
|
560
|
-
Object.keys(
|
|
561
|
-
if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] =
|
|
560
|
+
Object.keys(toBase6412).forEach(function(k5) {
|
|
561
|
+
if (k5 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k5)) exports2[k5] = toBase6412[k5];
|
|
562
562
|
});
|
|
563
563
|
}
|
|
564
564
|
});
|
|
@@ -2759,20 +2759,20 @@ function __importStar(mod) {
|
|
|
2759
2759
|
function __importDefault(mod) {
|
|
2760
2760
|
return mod && mod.__esModule ? mod : { default: mod };
|
|
2761
2761
|
}
|
|
2762
|
-
function __classPrivateFieldGet(receiver,
|
|
2762
|
+
function __classPrivateFieldGet(receiver, state3, kind, f5) {
|
|
2763
2763
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a getter");
|
|
2764
|
-
if (typeof
|
|
2765
|
-
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value :
|
|
2764
|
+
if (typeof state3 === "function" ? receiver !== state3 || !f5 : !state3.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2765
|
+
return kind === "m" ? f5 : kind === "a" ? f5.call(receiver) : f5 ? f5.value : state3.get(receiver);
|
|
2766
2766
|
}
|
|
2767
|
-
function __classPrivateFieldSet(receiver,
|
|
2767
|
+
function __classPrivateFieldSet(receiver, state3, value, kind, f5) {
|
|
2768
2768
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2769
2769
|
if (kind === "a" && !f5) throw new TypeError("Private accessor was defined without a setter");
|
|
2770
|
-
if (typeof
|
|
2771
|
-
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value :
|
|
2770
|
+
if (typeof state3 === "function" ? receiver !== state3 || !f5 : !state3.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2771
|
+
return kind === "a" ? f5.call(receiver, value) : f5 ? f5.value = value : state3.set(receiver, value), value;
|
|
2772
2772
|
}
|
|
2773
|
-
function __classPrivateFieldIn(
|
|
2773
|
+
function __classPrivateFieldIn(state3, receiver) {
|
|
2774
2774
|
if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") throw new TypeError("Cannot use 'in' operator on non-object");
|
|
2775
|
-
return typeof
|
|
2775
|
+
return typeof state3 === "function" ? receiver === state3 : state3.has(receiver);
|
|
2776
2776
|
}
|
|
2777
2777
|
function __addDisposableResource(env, value, async) {
|
|
2778
2778
|
if (value !== null && value !== void 0) {
|
|
@@ -3022,7 +3022,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
3022
3022
|
__export2(src_exports, {
|
|
3023
3023
|
fromUtf8: () => fromUtf88,
|
|
3024
3024
|
toUint8Array: () => toUint8Array2,
|
|
3025
|
-
toUtf8: () =>
|
|
3025
|
+
toUtf8: () => toUtf813
|
|
3026
3026
|
});
|
|
3027
3027
|
module2.exports = __toCommonJS2(src_exports);
|
|
3028
3028
|
var import_util_buffer_from = require_dist_cjs15();
|
|
@@ -3039,7 +3039,7 @@ var require_dist_cjs16 = __commonJS({
|
|
|
3039
3039
|
}
|
|
3040
3040
|
return new Uint8Array(data2);
|
|
3041
3041
|
}, "toUint8Array");
|
|
3042
|
-
var
|
|
3042
|
+
var toUtf813 = /* @__PURE__ */ __name((input) => {
|
|
3043
3043
|
if (typeof input === "string") {
|
|
3044
3044
|
return input;
|
|
3045
3045
|
}
|
|
@@ -8154,7 +8154,7 @@ var require_dist_cjs27 = __commonJS({
|
|
|
8154
8154
|
return false;
|
|
8155
8155
|
}
|
|
8156
8156
|
};
|
|
8157
|
-
var
|
|
8157
|
+
var decorateServiceException3 = (exception, additions = {}) => {
|
|
8158
8158
|
Object.entries(additions).filter(([, v5]) => v5 !== void 0).forEach(([k5, v5]) => {
|
|
8159
8159
|
if (exception[k5] == void 0 || exception[k5] === "") {
|
|
8160
8160
|
exception[k5] = v5;
|
|
@@ -8173,7 +8173,7 @@ var require_dist_cjs27 = __commonJS({
|
|
|
8173
8173
|
$fault: "client",
|
|
8174
8174
|
$metadata
|
|
8175
8175
|
});
|
|
8176
|
-
throw
|
|
8176
|
+
throw decorateServiceException3(response, parsedBody);
|
|
8177
8177
|
};
|
|
8178
8178
|
var withBaseException = (ExceptionCtor) => {
|
|
8179
8179
|
return ({ output, parsedBody, errorCode }) => {
|
|
@@ -8213,7 +8213,7 @@ var require_dist_cjs27 = __commonJS({
|
|
|
8213
8213
|
}
|
|
8214
8214
|
};
|
|
8215
8215
|
var warningEmitted = false;
|
|
8216
|
-
var
|
|
8216
|
+
var emitWarningIfUnsupportedVersion7 = (version) => {
|
|
8217
8217
|
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
|
|
8218
8218
|
warningEmitted = true;
|
|
8219
8219
|
}
|
|
@@ -8287,13 +8287,13 @@ var require_dist_cjs27 = __commonJS({
|
|
|
8287
8287
|
return Object.assign(resolveChecksumRuntimeConfig(config), resolveRetryRuntimeConfig(config));
|
|
8288
8288
|
};
|
|
8289
8289
|
var getArrayIfSingleItem = (mayBeArray) => Array.isArray(mayBeArray) ? mayBeArray : [mayBeArray];
|
|
8290
|
-
var
|
|
8290
|
+
var getValueFromTextNode5 = (obj) => {
|
|
8291
8291
|
const textNodeName = "#text";
|
|
8292
8292
|
for (const key in obj) {
|
|
8293
8293
|
if (obj.hasOwnProperty(key) && obj[key][textNodeName] !== void 0) {
|
|
8294
8294
|
obj[key] = obj[key][textNodeName];
|
|
8295
8295
|
} else if (typeof obj[key] === "object" && obj[key] !== null) {
|
|
8296
|
-
obj[key] =
|
|
8296
|
+
obj[key] = getValueFromTextNode5(obj[key]);
|
|
8297
8297
|
}
|
|
8298
8298
|
}
|
|
8299
8299
|
return obj;
|
|
@@ -8443,12 +8443,12 @@ var require_dist_cjs27 = __commonJS({
|
|
|
8443
8443
|
exports2._json = _json;
|
|
8444
8444
|
exports2.convertMap = convertMap;
|
|
8445
8445
|
exports2.createAggregatedClient = createAggregatedClient5;
|
|
8446
|
-
exports2.decorateServiceException =
|
|
8447
|
-
exports2.emitWarningIfUnsupportedVersion =
|
|
8446
|
+
exports2.decorateServiceException = decorateServiceException3;
|
|
8447
|
+
exports2.emitWarningIfUnsupportedVersion = emitWarningIfUnsupportedVersion7;
|
|
8448
8448
|
exports2.getArrayIfSingleItem = getArrayIfSingleItem;
|
|
8449
8449
|
exports2.getDefaultClientConfiguration = getDefaultClientConfiguration;
|
|
8450
8450
|
exports2.getDefaultExtensionConfiguration = getDefaultExtensionConfiguration5;
|
|
8451
|
-
exports2.getValueFromTextNode =
|
|
8451
|
+
exports2.getValueFromTextNode = getValueFromTextNode5;
|
|
8452
8452
|
exports2.isSerializableHeaderValue = isSerializableHeaderValue;
|
|
8453
8453
|
exports2.loadConfigsForDefaultMode = loadConfigsForDefaultMode5;
|
|
8454
8454
|
exports2.map = map2;
|
|
@@ -9183,7 +9183,7 @@ var init_parseCborBody = __esm({
|
|
|
9183
9183
|
});
|
|
9184
9184
|
};
|
|
9185
9185
|
loadSmithyRpcV2CborErrorCode = (output, data2) => {
|
|
9186
|
-
const
|
|
9186
|
+
const sanitizeErrorCode2 = (rawValue) => {
|
|
9187
9187
|
let cleanValue = rawValue;
|
|
9188
9188
|
if (typeof cleanValue === "number") {
|
|
9189
9189
|
cleanValue = cleanValue.toString();
|
|
@@ -9200,11 +9200,11 @@ var init_parseCborBody = __esm({
|
|
|
9200
9200
|
return cleanValue;
|
|
9201
9201
|
};
|
|
9202
9202
|
if (data2["__type"] !== void 0) {
|
|
9203
|
-
return
|
|
9203
|
+
return sanitizeErrorCode2(data2["__type"]);
|
|
9204
9204
|
}
|
|
9205
9205
|
const codeKey = Object.keys(data2).find((key) => key.toLowerCase() === "code");
|
|
9206
9206
|
if (codeKey && data2[codeKey] !== void 0) {
|
|
9207
|
-
return
|
|
9207
|
+
return sanitizeErrorCode2(data2[codeKey]);
|
|
9208
9208
|
}
|
|
9209
9209
|
};
|
|
9210
9210
|
}
|
|
@@ -9881,8 +9881,8 @@ var init_parseJsonBody = __esm({
|
|
|
9881
9881
|
return value;
|
|
9882
9882
|
};
|
|
9883
9883
|
loadRestJsonErrorCode = (output, data2) => {
|
|
9884
|
-
const
|
|
9885
|
-
const
|
|
9884
|
+
const findKey2 = (object, key) => Object.keys(object).find((k5) => k5.toLowerCase() === key.toLowerCase());
|
|
9885
|
+
const sanitizeErrorCode2 = (rawValue) => {
|
|
9886
9886
|
let cleanValue = rawValue;
|
|
9887
9887
|
if (typeof cleanValue === "number") {
|
|
9888
9888
|
cleanValue = cleanValue.toString();
|
|
@@ -9898,17 +9898,17 @@ var init_parseJsonBody = __esm({
|
|
|
9898
9898
|
}
|
|
9899
9899
|
return cleanValue;
|
|
9900
9900
|
};
|
|
9901
|
-
const headerKey =
|
|
9901
|
+
const headerKey = findKey2(output.headers, "x-amzn-errortype");
|
|
9902
9902
|
if (headerKey !== void 0) {
|
|
9903
|
-
return
|
|
9903
|
+
return sanitizeErrorCode2(output.headers[headerKey]);
|
|
9904
9904
|
}
|
|
9905
9905
|
if (data2 && typeof data2 === "object") {
|
|
9906
|
-
const codeKey =
|
|
9906
|
+
const codeKey = findKey2(data2, "code");
|
|
9907
9907
|
if (codeKey && data2[codeKey] !== void 0) {
|
|
9908
|
-
return
|
|
9908
|
+
return sanitizeErrorCode2(data2[codeKey]);
|
|
9909
9909
|
}
|
|
9910
9910
|
if (data2["__type"] !== void 0) {
|
|
9911
|
-
return
|
|
9911
|
+
return sanitizeErrorCode2(data2["__type"]);
|
|
9912
9912
|
}
|
|
9913
9913
|
}
|
|
9914
9914
|
};
|
|
@@ -11875,7 +11875,7 @@ var require_xml_parser = __commonJS({
|
|
|
11875
11875
|
"node_modules/.pnpm/@aws-sdk+xml-builder@3.972.18/node_modules/@aws-sdk/xml-builder/dist-cjs/xml-parser.js"(exports2) {
|
|
11876
11876
|
"use strict";
|
|
11877
11877
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11878
|
-
exports2.parseXML =
|
|
11878
|
+
exports2.parseXML = parseXML5;
|
|
11879
11879
|
var fast_xml_parser_1 = require_fxp();
|
|
11880
11880
|
var parser = new fast_xml_parser_1.XMLParser({
|
|
11881
11881
|
attributeNamePrefix: "",
|
|
@@ -11893,7 +11893,7 @@ var require_xml_parser = __commonJS({
|
|
|
11893
11893
|
});
|
|
11894
11894
|
parser.addEntity("#xD", "\r");
|
|
11895
11895
|
parser.addEntity("#10", "\n");
|
|
11896
|
-
function
|
|
11896
|
+
function parseXML5(xmlString) {
|
|
11897
11897
|
return parser.parse(xmlString, true);
|
|
11898
11898
|
}
|
|
11899
11899
|
}
|
|
@@ -11929,7 +11929,7 @@ var require_dist_cjs29 = __commonJS({
|
|
|
11929
11929
|
function escapeElement(value) {
|
|
11930
11930
|
return value.replace(ELEMENT_ESCAPE_RE, (ch) => ELEMENT_ESCAPE_MAP[ch]);
|
|
11931
11931
|
}
|
|
11932
|
-
var
|
|
11932
|
+
var XmlText3 = class {
|
|
11933
11933
|
value;
|
|
11934
11934
|
constructor(value) {
|
|
11935
11935
|
this.value = value;
|
|
@@ -11938,14 +11938,14 @@ var require_dist_cjs29 = __commonJS({
|
|
|
11938
11938
|
return escapeElement("" + this.value);
|
|
11939
11939
|
}
|
|
11940
11940
|
};
|
|
11941
|
-
var
|
|
11941
|
+
var XmlNode3 = class _XmlNode {
|
|
11942
11942
|
name;
|
|
11943
11943
|
children;
|
|
11944
11944
|
attributes = {};
|
|
11945
11945
|
static of(name2, childText, withName) {
|
|
11946
11946
|
const node = new _XmlNode(name2);
|
|
11947
11947
|
if (childText !== void 0) {
|
|
11948
|
-
node.addChildNode(new
|
|
11948
|
+
node.addChildNode(new XmlText3(childText));
|
|
11949
11949
|
}
|
|
11950
11950
|
if (withName !== void 0) {
|
|
11951
11951
|
node.withName(withName);
|
|
@@ -12025,8 +12025,8 @@ var require_dist_cjs29 = __commonJS({
|
|
|
12025
12025
|
}
|
|
12026
12026
|
};
|
|
12027
12027
|
exports2.parseXML = xmlParser.parseXML;
|
|
12028
|
-
exports2.XmlNode =
|
|
12029
|
-
exports2.XmlText =
|
|
12028
|
+
exports2.XmlNode = XmlNode3;
|
|
12029
|
+
exports2.XmlText = XmlText3;
|
|
12030
12030
|
}
|
|
12031
12031
|
});
|
|
12032
12032
|
|
|
@@ -14534,7 +14534,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
14534
14534
|
[bodyCopy, body] = await utilStream.splitStream(sourceBody);
|
|
14535
14535
|
}
|
|
14536
14536
|
response.body = body;
|
|
14537
|
-
const bodyBytes = await
|
|
14537
|
+
const bodyBytes = await collectBody4(bodyCopy, {
|
|
14538
14538
|
streamCollector: async (stream) => {
|
|
14539
14539
|
return utilStream.headStream(stream, MAX_BYTES_TO_INSPECT);
|
|
14540
14540
|
}
|
|
@@ -14553,7 +14553,7 @@ var require_dist_cjs32 = __commonJS({
|
|
|
14553
14553
|
}
|
|
14554
14554
|
return result;
|
|
14555
14555
|
};
|
|
14556
|
-
var
|
|
14556
|
+
var collectBody4 = (streamBody = new Uint8Array(), context) => {
|
|
14557
14557
|
if (streamBody instanceof Uint8Array) {
|
|
14558
14558
|
return Promise.resolve(streamBody);
|
|
14559
14559
|
}
|
|
@@ -30199,8 +30199,8 @@ var require_dist_cjs64 = __commonJS({
|
|
|
30199
30199
|
var HeaderMarshaller = class {
|
|
30200
30200
|
toUtf8;
|
|
30201
30201
|
fromUtf8;
|
|
30202
|
-
constructor(
|
|
30203
|
-
this.toUtf8 =
|
|
30202
|
+
constructor(toUtf813, fromUtf88) {
|
|
30203
|
+
this.toUtf8 = toUtf813;
|
|
30204
30204
|
this.fromUtf8 = fromUtf88;
|
|
30205
30205
|
}
|
|
30206
30206
|
format(headers) {
|
|
@@ -30411,8 +30411,8 @@ var require_dist_cjs64 = __commonJS({
|
|
|
30411
30411
|
headerMarshaller;
|
|
30412
30412
|
messageBuffer;
|
|
30413
30413
|
isEndOfStream;
|
|
30414
|
-
constructor(
|
|
30415
|
-
this.headerMarshaller = new HeaderMarshaller(
|
|
30414
|
+
constructor(toUtf813, fromUtf88) {
|
|
30415
|
+
this.headerMarshaller = new HeaderMarshaller(toUtf813, fromUtf88);
|
|
30416
30416
|
this.messageBuffer = [];
|
|
30417
30417
|
this.isEndOfStream = false;
|
|
30418
30418
|
}
|
|
@@ -30613,7 +30613,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
30613
30613
|
[Symbol.asyncIterator]: iterator
|
|
30614
30614
|
};
|
|
30615
30615
|
}
|
|
30616
|
-
function getMessageUnmarshaller(deserializer,
|
|
30616
|
+
function getMessageUnmarshaller(deserializer, toUtf813) {
|
|
30617
30617
|
return async function(message) {
|
|
30618
30618
|
const { value: messageType } = message.headers[":message-type"];
|
|
30619
30619
|
if (messageType === "error") {
|
|
@@ -30625,7 +30625,7 @@ var require_dist_cjs65 = __commonJS({
|
|
|
30625
30625
|
const exception = { [code]: message };
|
|
30626
30626
|
const deserializedException = await deserializer(exception);
|
|
30627
30627
|
if (deserializedException.$unknown) {
|
|
30628
|
-
const error2 = new Error(
|
|
30628
|
+
const error2 = new Error(toUtf813(message.body));
|
|
30629
30629
|
error2.name = code;
|
|
30630
30630
|
throw error2;
|
|
30631
30631
|
}
|
|
@@ -31093,14 +31093,14 @@ var require_dist_cjs70 = __commonJS({
|
|
|
31093
31093
|
var randomInRange = (min, max) => min + Math.random() * (max - min);
|
|
31094
31094
|
var runPolling = async ({ minDelay, maxDelay, maxWaitTime, abortController, client, abortSignal }, input, acceptorChecks) => {
|
|
31095
31095
|
const observedResponses = {};
|
|
31096
|
-
const { state:
|
|
31096
|
+
const { state: state3, reason } = await acceptorChecks(client, input);
|
|
31097
31097
|
if (reason) {
|
|
31098
31098
|
const message = createMessageFromResponse(reason);
|
|
31099
31099
|
observedResponses[message] |= 0;
|
|
31100
31100
|
observedResponses[message] += 1;
|
|
31101
31101
|
}
|
|
31102
|
-
if (
|
|
31103
|
-
return { state:
|
|
31102
|
+
if (state3 !== exports2.WaiterState.RETRY) {
|
|
31103
|
+
return { state: state3, reason, observedResponses };
|
|
31104
31104
|
}
|
|
31105
31105
|
let currentAttempt = 1;
|
|
31106
31106
|
const waitUntil = Date.now() + maxWaitTime * 1e3;
|
|
@@ -31117,14 +31117,14 @@ var require_dist_cjs70 = __commonJS({
|
|
|
31117
31117
|
return { state: exports2.WaiterState.TIMEOUT, observedResponses };
|
|
31118
31118
|
}
|
|
31119
31119
|
await sleep(delay);
|
|
31120
|
-
const { state:
|
|
31120
|
+
const { state: state4, reason: reason2 } = await acceptorChecks(client, input);
|
|
31121
31121
|
if (reason2) {
|
|
31122
31122
|
const message = createMessageFromResponse(reason2);
|
|
31123
31123
|
observedResponses[message] |= 0;
|
|
31124
31124
|
observedResponses[message] += 1;
|
|
31125
31125
|
}
|
|
31126
|
-
if (
|
|
31127
|
-
return { state:
|
|
31126
|
+
if (state4 !== exports2.WaiterState.RETRY) {
|
|
31127
|
+
return { state: state4, reason: reason2, observedResponses };
|
|
31128
31128
|
}
|
|
31129
31129
|
currentAttempt += 1;
|
|
31130
31130
|
}
|
|
@@ -33427,14 +33427,2867 @@ var require_dist_cjs72 = __commonJS({
|
|
|
33427
33427
|
}
|
|
33428
33428
|
});
|
|
33429
33429
|
|
|
33430
|
-
// node_modules/.pnpm/@aws-sdk+
|
|
33431
|
-
var
|
|
33432
|
-
|
|
33430
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js
|
|
33431
|
+
var import_smithy_client37, ProtocolLib2;
|
|
33432
|
+
var init_ProtocolLib2 = __esm({
|
|
33433
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ProtocolLib.js"() {
|
|
33434
|
+
init_schema();
|
|
33435
|
+
import_smithy_client37 = __toESM(require_dist_cjs27());
|
|
33436
|
+
ProtocolLib2 = class {
|
|
33437
|
+
queryCompat;
|
|
33438
|
+
errorRegistry;
|
|
33439
|
+
constructor(queryCompat = false) {
|
|
33440
|
+
this.queryCompat = queryCompat;
|
|
33441
|
+
}
|
|
33442
|
+
resolveRestContentType(defaultContentType, inputSchema) {
|
|
33443
|
+
const members = inputSchema.getMemberSchemas();
|
|
33444
|
+
const httpPayloadMember = Object.values(members).find((m5) => {
|
|
33445
|
+
return !!m5.getMergedTraits().httpPayload;
|
|
33446
|
+
});
|
|
33447
|
+
if (httpPayloadMember) {
|
|
33448
|
+
const mediaType = httpPayloadMember.getMergedTraits().mediaType;
|
|
33449
|
+
if (mediaType) {
|
|
33450
|
+
return mediaType;
|
|
33451
|
+
} else if (httpPayloadMember.isStringSchema()) {
|
|
33452
|
+
return "text/plain";
|
|
33453
|
+
} else if (httpPayloadMember.isBlobSchema()) {
|
|
33454
|
+
return "application/octet-stream";
|
|
33455
|
+
} else {
|
|
33456
|
+
return defaultContentType;
|
|
33457
|
+
}
|
|
33458
|
+
} else if (!inputSchema.isUnitSchema()) {
|
|
33459
|
+
const hasBody = Object.values(members).find((m5) => {
|
|
33460
|
+
const { httpQuery, httpQueryParams, httpHeader, httpLabel, httpPrefixHeaders } = m5.getMergedTraits();
|
|
33461
|
+
const noPrefixHeaders = httpPrefixHeaders === void 0;
|
|
33462
|
+
return !httpQuery && !httpQueryParams && !httpHeader && !httpLabel && noPrefixHeaders;
|
|
33463
|
+
});
|
|
33464
|
+
if (hasBody) {
|
|
33465
|
+
return defaultContentType;
|
|
33466
|
+
}
|
|
33467
|
+
}
|
|
33468
|
+
}
|
|
33469
|
+
async getErrorSchemaOrThrowBaseException(errorIdentifier, defaultNamespace, response, dataObject, metadata, getErrorSchema) {
|
|
33470
|
+
let errorName = errorIdentifier;
|
|
33471
|
+
if (errorIdentifier.includes("#")) {
|
|
33472
|
+
[, errorName] = errorIdentifier.split("#");
|
|
33473
|
+
}
|
|
33474
|
+
const errorMetadata = {
|
|
33475
|
+
$metadata: metadata,
|
|
33476
|
+
$fault: response.statusCode < 500 ? "client" : "server"
|
|
33477
|
+
};
|
|
33478
|
+
if (!this.errorRegistry) {
|
|
33479
|
+
throw new Error("@aws-sdk/core/protocols - error handler not initialized.");
|
|
33480
|
+
}
|
|
33481
|
+
try {
|
|
33482
|
+
const errorSchema = getErrorSchema?.(this.errorRegistry, errorName) ?? this.errorRegistry.getSchema(errorIdentifier);
|
|
33483
|
+
return { errorSchema, errorMetadata };
|
|
33484
|
+
} catch (e5) {
|
|
33485
|
+
dataObject.message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
33486
|
+
const synthetic = this.errorRegistry;
|
|
33487
|
+
const baseExceptionSchema = synthetic.getBaseException();
|
|
33488
|
+
if (baseExceptionSchema) {
|
|
33489
|
+
const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema) ?? Error;
|
|
33490
|
+
throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);
|
|
33491
|
+
}
|
|
33492
|
+
const d5 = dataObject;
|
|
33493
|
+
const message = d5?.message ?? d5?.Message ?? d5?.Error?.Message ?? d5?.Error?.message;
|
|
33494
|
+
throw this.decorateServiceException(Object.assign(new Error(message), {
|
|
33495
|
+
name: errorName
|
|
33496
|
+
}, errorMetadata), dataObject);
|
|
33497
|
+
}
|
|
33498
|
+
}
|
|
33499
|
+
compose(composite, errorIdentifier, defaultNamespace) {
|
|
33500
|
+
let namespace = defaultNamespace;
|
|
33501
|
+
if (errorIdentifier.includes("#")) {
|
|
33502
|
+
[namespace] = errorIdentifier.split("#");
|
|
33503
|
+
}
|
|
33504
|
+
const staticRegistry = TypeRegistry.for(namespace);
|
|
33505
|
+
const defaultSyntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + defaultNamespace);
|
|
33506
|
+
composite.copyFrom(staticRegistry);
|
|
33507
|
+
composite.copyFrom(defaultSyntheticRegistry);
|
|
33508
|
+
this.errorRegistry = composite;
|
|
33509
|
+
}
|
|
33510
|
+
decorateServiceException(exception, additions = {}) {
|
|
33511
|
+
if (this.queryCompat) {
|
|
33512
|
+
const msg = exception.Message ?? additions.Message;
|
|
33513
|
+
const error2 = (0, import_smithy_client37.decorateServiceException)(exception, additions);
|
|
33514
|
+
if (msg) {
|
|
33515
|
+
error2.message = msg;
|
|
33516
|
+
}
|
|
33517
|
+
const errorObj = error2.Error ?? {};
|
|
33518
|
+
errorObj.Type = error2.Error?.Type;
|
|
33519
|
+
errorObj.Code = error2.Error?.Code;
|
|
33520
|
+
errorObj.Message = error2.Error?.message ?? error2.Error?.Message ?? msg;
|
|
33521
|
+
error2.Error = errorObj;
|
|
33522
|
+
const reqId = error2.$metadata.requestId;
|
|
33523
|
+
if (reqId) {
|
|
33524
|
+
error2.RequestId = reqId;
|
|
33525
|
+
}
|
|
33526
|
+
return error2;
|
|
33527
|
+
}
|
|
33528
|
+
return (0, import_smithy_client37.decorateServiceException)(exception, additions);
|
|
33529
|
+
}
|
|
33530
|
+
setQueryCompatError(output, response) {
|
|
33531
|
+
const queryErrorHeader = response.headers?.["x-amzn-query-error"];
|
|
33532
|
+
if (output !== void 0 && queryErrorHeader != null) {
|
|
33533
|
+
const [Code, Type] = queryErrorHeader.split(";");
|
|
33534
|
+
const keys = Object.keys(output);
|
|
33535
|
+
const Error2 = {
|
|
33536
|
+
Code,
|
|
33537
|
+
Type
|
|
33538
|
+
};
|
|
33539
|
+
output.Code = Code;
|
|
33540
|
+
output.Type = Type;
|
|
33541
|
+
for (let i5 = 0; i5 < keys.length; i5++) {
|
|
33542
|
+
const k5 = keys[i5];
|
|
33543
|
+
Error2[k5 === "message" ? "Message" : k5] = output[k5];
|
|
33544
|
+
}
|
|
33545
|
+
delete Error2.__type;
|
|
33546
|
+
output.Error = Error2;
|
|
33547
|
+
}
|
|
33548
|
+
}
|
|
33549
|
+
queryCompatOutput(queryCompatErrorData, errorData) {
|
|
33550
|
+
if (queryCompatErrorData.Error) {
|
|
33551
|
+
errorData.Error = queryCompatErrorData.Error;
|
|
33552
|
+
}
|
|
33553
|
+
if (queryCompatErrorData.Type) {
|
|
33554
|
+
errorData.Type = queryCompatErrorData.Type;
|
|
33555
|
+
}
|
|
33556
|
+
if (queryCompatErrorData.Code) {
|
|
33557
|
+
errorData.Code = queryCompatErrorData.Code;
|
|
33558
|
+
}
|
|
33559
|
+
}
|
|
33560
|
+
findQueryCompatibleError(registry, errorName) {
|
|
33561
|
+
try {
|
|
33562
|
+
return registry.getSchema(errorName);
|
|
33563
|
+
} catch (e5) {
|
|
33564
|
+
return registry.find((schema) => NormalizedSchema.of(schema).getMergedTraits().awsQueryError?.[0] === errorName);
|
|
33565
|
+
}
|
|
33566
|
+
}
|
|
33567
|
+
};
|
|
33568
|
+
}
|
|
33569
|
+
});
|
|
33570
|
+
|
|
33571
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js
|
|
33572
|
+
var AwsSmithyRpcV2CborProtocol2;
|
|
33573
|
+
var init_AwsSmithyRpcV2CborProtocol2 = __esm({
|
|
33574
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/cbor/AwsSmithyRpcV2CborProtocol.js"() {
|
|
33575
|
+
init_cbor2();
|
|
33576
|
+
init_schema();
|
|
33577
|
+
init_ProtocolLib2();
|
|
33578
|
+
AwsSmithyRpcV2CborProtocol2 = class extends SmithyRpcV2CborProtocol {
|
|
33579
|
+
awsQueryCompatible;
|
|
33580
|
+
mixin;
|
|
33581
|
+
constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, awsQueryCompatible }) {
|
|
33582
|
+
super({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 });
|
|
33583
|
+
this.awsQueryCompatible = !!awsQueryCompatible;
|
|
33584
|
+
this.mixin = new ProtocolLib2(this.awsQueryCompatible);
|
|
33585
|
+
}
|
|
33586
|
+
async serializeRequest(operationSchema, input, context) {
|
|
33587
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
33588
|
+
if (this.awsQueryCompatible) {
|
|
33589
|
+
request.headers["x-amzn-query-mode"] = "true";
|
|
33590
|
+
}
|
|
33591
|
+
return request;
|
|
33592
|
+
}
|
|
33593
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
33594
|
+
if (this.awsQueryCompatible) {
|
|
33595
|
+
this.mixin.setQueryCompatError(dataObject, response);
|
|
33596
|
+
}
|
|
33597
|
+
const errorName = (() => {
|
|
33598
|
+
const compatHeader = response.headers["x-amzn-query-error"];
|
|
33599
|
+
if (compatHeader && this.awsQueryCompatible) {
|
|
33600
|
+
return compatHeader.split(";")[0];
|
|
33601
|
+
}
|
|
33602
|
+
return loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
|
|
33603
|
+
})();
|
|
33604
|
+
this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
|
|
33605
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0);
|
|
33606
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
33607
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
33608
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
33609
|
+
const exception = new ErrorCtor(message);
|
|
33610
|
+
const output = {};
|
|
33611
|
+
for (const [name2, member2] of ns.structIterator()) {
|
|
33612
|
+
if (dataObject[name2] != null) {
|
|
33613
|
+
output[name2] = this.deserializer.readValue(member2, dataObject[name2]);
|
|
33614
|
+
}
|
|
33615
|
+
}
|
|
33616
|
+
if (this.awsQueryCompatible) {
|
|
33617
|
+
this.mixin.queryCompatOutput(dataObject, output);
|
|
33618
|
+
}
|
|
33619
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
33620
|
+
$fault: ns.getMergedTraits().error,
|
|
33621
|
+
message
|
|
33622
|
+
}, output), dataObject);
|
|
33623
|
+
}
|
|
33624
|
+
};
|
|
33625
|
+
}
|
|
33626
|
+
});
|
|
33627
|
+
|
|
33628
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js
|
|
33629
|
+
var _toStr2, _toBool2, _toNum2;
|
|
33630
|
+
var init_coercing_serializers2 = __esm({
|
|
33631
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/coercing-serializers.js"() {
|
|
33632
|
+
_toStr2 = (val) => {
|
|
33633
|
+
if (val == null) {
|
|
33634
|
+
return val;
|
|
33635
|
+
}
|
|
33636
|
+
if (typeof val === "number" || typeof val === "bigint") {
|
|
33637
|
+
const warning = new Error(`Received number ${val} where a string was expected.`);
|
|
33638
|
+
warning.name = "Warning";
|
|
33639
|
+
console.warn(warning);
|
|
33640
|
+
return String(val);
|
|
33641
|
+
}
|
|
33642
|
+
if (typeof val === "boolean") {
|
|
33643
|
+
const warning = new Error(`Received boolean ${val} where a string was expected.`);
|
|
33644
|
+
warning.name = "Warning";
|
|
33645
|
+
console.warn(warning);
|
|
33646
|
+
return String(val);
|
|
33647
|
+
}
|
|
33648
|
+
return val;
|
|
33649
|
+
};
|
|
33650
|
+
_toBool2 = (val) => {
|
|
33651
|
+
if (val == null) {
|
|
33652
|
+
return val;
|
|
33653
|
+
}
|
|
33654
|
+
if (typeof val === "number") {
|
|
33655
|
+
}
|
|
33656
|
+
if (typeof val === "string") {
|
|
33657
|
+
const lowercase = val.toLowerCase();
|
|
33658
|
+
if (val !== "" && lowercase !== "false" && lowercase !== "true") {
|
|
33659
|
+
const warning = new Error(`Received string "${val}" where a boolean was expected.`);
|
|
33660
|
+
warning.name = "Warning";
|
|
33661
|
+
console.warn(warning);
|
|
33662
|
+
}
|
|
33663
|
+
return val !== "" && lowercase !== "false";
|
|
33664
|
+
}
|
|
33665
|
+
return val;
|
|
33666
|
+
};
|
|
33667
|
+
_toNum2 = (val) => {
|
|
33668
|
+
if (val == null) {
|
|
33669
|
+
return val;
|
|
33670
|
+
}
|
|
33671
|
+
if (typeof val === "boolean") {
|
|
33672
|
+
}
|
|
33673
|
+
if (typeof val === "string") {
|
|
33674
|
+
const num = Number(val);
|
|
33675
|
+
if (num.toString() !== val) {
|
|
33676
|
+
const warning = new Error(`Received string "${val}" where a number was expected.`);
|
|
33677
|
+
warning.name = "Warning";
|
|
33678
|
+
console.warn(warning);
|
|
33679
|
+
return val;
|
|
33680
|
+
}
|
|
33681
|
+
return num;
|
|
33682
|
+
}
|
|
33683
|
+
return val;
|
|
33684
|
+
};
|
|
33685
|
+
}
|
|
33686
|
+
});
|
|
33687
|
+
|
|
33688
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js
|
|
33689
|
+
var SerdeContextConfig2;
|
|
33690
|
+
var init_ConfigurableSerdeContext2 = __esm({
|
|
33691
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js"() {
|
|
33692
|
+
SerdeContextConfig2 = class {
|
|
33693
|
+
serdeContext;
|
|
33694
|
+
setSerdeContext(serdeContext) {
|
|
33695
|
+
this.serdeContext = serdeContext;
|
|
33696
|
+
}
|
|
33697
|
+
};
|
|
33698
|
+
}
|
|
33699
|
+
});
|
|
33700
|
+
|
|
33701
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js
|
|
33702
|
+
var UnionSerde2;
|
|
33703
|
+
var init_UnionSerde2 = __esm({
|
|
33704
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/UnionSerde.js"() {
|
|
33705
|
+
UnionSerde2 = class {
|
|
33706
|
+
from;
|
|
33707
|
+
to;
|
|
33708
|
+
keys;
|
|
33709
|
+
constructor(from, to) {
|
|
33710
|
+
this.from = from;
|
|
33711
|
+
this.to = to;
|
|
33712
|
+
const keys = Object.keys(this.from);
|
|
33713
|
+
const set = new Set(keys);
|
|
33714
|
+
set.delete("__type");
|
|
33715
|
+
this.keys = set;
|
|
33716
|
+
}
|
|
33717
|
+
mark(key) {
|
|
33718
|
+
this.keys.delete(key);
|
|
33719
|
+
}
|
|
33720
|
+
hasUnknown() {
|
|
33721
|
+
return this.keys.size === 1 && Object.keys(this.to).length === 0;
|
|
33722
|
+
}
|
|
33723
|
+
writeUnknown() {
|
|
33724
|
+
if (this.hasUnknown()) {
|
|
33725
|
+
const k5 = this.keys.values().next().value;
|
|
33726
|
+
const v5 = this.from[k5];
|
|
33727
|
+
this.to.$unknown = [k5, v5];
|
|
33728
|
+
}
|
|
33729
|
+
}
|
|
33730
|
+
};
|
|
33731
|
+
}
|
|
33732
|
+
});
|
|
33733
|
+
|
|
33734
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
|
|
33735
|
+
function jsonReviver2(key, value, context) {
|
|
33736
|
+
if (context?.source) {
|
|
33737
|
+
const numericString = context.source;
|
|
33738
|
+
if (typeof value === "number") {
|
|
33739
|
+
if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) {
|
|
33740
|
+
const isFractional = numericString.includes(".");
|
|
33741
|
+
if (isFractional) {
|
|
33742
|
+
return new NumericValue(numericString, "bigDecimal");
|
|
33743
|
+
} else {
|
|
33744
|
+
return BigInt(numericString);
|
|
33745
|
+
}
|
|
33746
|
+
}
|
|
33747
|
+
}
|
|
33748
|
+
}
|
|
33749
|
+
return value;
|
|
33750
|
+
}
|
|
33751
|
+
var init_jsonReviver2 = __esm({
|
|
33752
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js"() {
|
|
33753
|
+
init_serde();
|
|
33754
|
+
}
|
|
33755
|
+
});
|
|
33756
|
+
|
|
33757
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
|
|
33758
|
+
var import_smithy_client38, import_util_utf812, collectBodyString2;
|
|
33759
|
+
var init_common2 = __esm({
|
|
33760
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js"() {
|
|
33761
|
+
import_smithy_client38 = __toESM(require_dist_cjs27());
|
|
33762
|
+
import_util_utf812 = __toESM(require_dist_cjs6());
|
|
33763
|
+
collectBodyString2 = (streamBody, context) => (0, import_smithy_client38.collectBody)(streamBody, context).then((body) => (context?.utf8Encoder ?? import_util_utf812.toUtf8)(body));
|
|
33764
|
+
}
|
|
33765
|
+
});
|
|
33766
|
+
|
|
33767
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js
|
|
33768
|
+
var parseJsonBody2, parseJsonErrorBody2, findKey, sanitizeErrorCode, loadRestJsonErrorCode2;
|
|
33769
|
+
var init_parseJsonBody2 = __esm({
|
|
33770
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js"() {
|
|
33771
|
+
init_common2();
|
|
33772
|
+
parseJsonBody2 = (streamBody, context) => collectBodyString2(streamBody, context).then((encoded) => {
|
|
33773
|
+
if (encoded.length) {
|
|
33774
|
+
try {
|
|
33775
|
+
return JSON.parse(encoded);
|
|
33776
|
+
} catch (e5) {
|
|
33777
|
+
if (e5?.name === "SyntaxError") {
|
|
33778
|
+
Object.defineProperty(e5, "$responseBodyText", {
|
|
33779
|
+
value: encoded
|
|
33780
|
+
});
|
|
33781
|
+
}
|
|
33782
|
+
throw e5;
|
|
33783
|
+
}
|
|
33784
|
+
}
|
|
33785
|
+
return {};
|
|
33786
|
+
});
|
|
33787
|
+
parseJsonErrorBody2 = async (errorBody, context) => {
|
|
33788
|
+
const value = await parseJsonBody2(errorBody, context);
|
|
33789
|
+
value.message = value.message ?? value.Message;
|
|
33790
|
+
return value;
|
|
33791
|
+
};
|
|
33792
|
+
findKey = (object, key) => Object.keys(object).find((k5) => k5.toLowerCase() === key.toLowerCase());
|
|
33793
|
+
sanitizeErrorCode = (rawValue) => {
|
|
33794
|
+
let cleanValue = rawValue;
|
|
33795
|
+
if (typeof cleanValue === "number") {
|
|
33796
|
+
cleanValue = cleanValue.toString();
|
|
33797
|
+
}
|
|
33798
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
33799
|
+
cleanValue = cleanValue.split(",")[0];
|
|
33800
|
+
}
|
|
33801
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
33802
|
+
cleanValue = cleanValue.split(":")[0];
|
|
33803
|
+
}
|
|
33804
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
33805
|
+
cleanValue = cleanValue.split("#")[1];
|
|
33806
|
+
}
|
|
33807
|
+
return cleanValue;
|
|
33808
|
+
};
|
|
33809
|
+
loadRestJsonErrorCode2 = (output, data2) => {
|
|
33810
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
33811
|
+
if (headerKey !== void 0) {
|
|
33812
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
33813
|
+
}
|
|
33814
|
+
if (data2 && typeof data2 === "object") {
|
|
33815
|
+
const codeKey = findKey(data2, "code");
|
|
33816
|
+
if (codeKey && data2[codeKey] !== void 0) {
|
|
33817
|
+
return sanitizeErrorCode(data2[codeKey]);
|
|
33818
|
+
}
|
|
33819
|
+
if (data2["__type"] !== void 0) {
|
|
33820
|
+
return sanitizeErrorCode(data2["__type"]);
|
|
33821
|
+
}
|
|
33822
|
+
}
|
|
33823
|
+
};
|
|
33824
|
+
}
|
|
33825
|
+
});
|
|
33826
|
+
|
|
33827
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js
|
|
33828
|
+
var import_util_base6412, JsonShapeDeserializer2;
|
|
33829
|
+
var init_JsonShapeDeserializer2 = __esm({
|
|
33830
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js"() {
|
|
33831
|
+
init_protocols();
|
|
33832
|
+
init_schema();
|
|
33833
|
+
init_serde();
|
|
33834
|
+
import_util_base6412 = __toESM(require_dist_cjs7());
|
|
33835
|
+
init_ConfigurableSerdeContext2();
|
|
33836
|
+
init_UnionSerde2();
|
|
33837
|
+
init_jsonReviver2();
|
|
33838
|
+
init_parseJsonBody2();
|
|
33839
|
+
JsonShapeDeserializer2 = class extends SerdeContextConfig2 {
|
|
33840
|
+
settings;
|
|
33841
|
+
constructor(settings) {
|
|
33842
|
+
super();
|
|
33843
|
+
this.settings = settings;
|
|
33844
|
+
}
|
|
33845
|
+
async read(schema, data2) {
|
|
33846
|
+
return this._read(schema, typeof data2 === "string" ? JSON.parse(data2, jsonReviver2) : await parseJsonBody2(data2, this.serdeContext));
|
|
33847
|
+
}
|
|
33848
|
+
readObject(schema, data2) {
|
|
33849
|
+
return this._read(schema, data2);
|
|
33850
|
+
}
|
|
33851
|
+
_read(schema, value) {
|
|
33852
|
+
const isObject = value !== null && typeof value === "object";
|
|
33853
|
+
const ns = NormalizedSchema.of(schema);
|
|
33854
|
+
if (isObject) {
|
|
33855
|
+
if (ns.isStructSchema()) {
|
|
33856
|
+
const record = value;
|
|
33857
|
+
const union = ns.isUnionSchema();
|
|
33858
|
+
const out = {};
|
|
33859
|
+
let nameMap = void 0;
|
|
33860
|
+
const { jsonName } = this.settings;
|
|
33861
|
+
if (jsonName) {
|
|
33862
|
+
nameMap = {};
|
|
33863
|
+
}
|
|
33864
|
+
let unionSerde;
|
|
33865
|
+
if (union) {
|
|
33866
|
+
unionSerde = new UnionSerde2(record, out);
|
|
33867
|
+
}
|
|
33868
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
33869
|
+
let fromKey = memberName;
|
|
33870
|
+
if (jsonName) {
|
|
33871
|
+
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
33872
|
+
nameMap[fromKey] = memberName;
|
|
33873
|
+
}
|
|
33874
|
+
if (union) {
|
|
33875
|
+
unionSerde.mark(fromKey);
|
|
33876
|
+
}
|
|
33877
|
+
if (record[fromKey] != null) {
|
|
33878
|
+
out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
33879
|
+
}
|
|
33880
|
+
}
|
|
33881
|
+
if (union) {
|
|
33882
|
+
unionSerde.writeUnknown();
|
|
33883
|
+
} else if (typeof record.__type === "string") {
|
|
33884
|
+
for (const [k5, v5] of Object.entries(record)) {
|
|
33885
|
+
const t5 = jsonName ? nameMap[k5] ?? k5 : k5;
|
|
33886
|
+
if (!(t5 in out)) {
|
|
33887
|
+
out[t5] = v5;
|
|
33888
|
+
}
|
|
33889
|
+
}
|
|
33890
|
+
}
|
|
33891
|
+
return out;
|
|
33892
|
+
}
|
|
33893
|
+
if (Array.isArray(value) && ns.isListSchema()) {
|
|
33894
|
+
const listMember = ns.getValueSchema();
|
|
33895
|
+
const out = [];
|
|
33896
|
+
for (const item of value) {
|
|
33897
|
+
out.push(this._read(listMember, item));
|
|
33898
|
+
}
|
|
33899
|
+
return out;
|
|
33900
|
+
}
|
|
33901
|
+
if (ns.isMapSchema()) {
|
|
33902
|
+
const mapMember = ns.getValueSchema();
|
|
33903
|
+
const out = {};
|
|
33904
|
+
for (const [_k, _v] of Object.entries(value)) {
|
|
33905
|
+
out[_k] = this._read(mapMember, _v);
|
|
33906
|
+
}
|
|
33907
|
+
return out;
|
|
33908
|
+
}
|
|
33909
|
+
}
|
|
33910
|
+
if (ns.isBlobSchema() && typeof value === "string") {
|
|
33911
|
+
return (0, import_util_base6412.fromBase64)(value);
|
|
33912
|
+
}
|
|
33913
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
33914
|
+
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
|
|
33915
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
33916
|
+
if (isJson) {
|
|
33917
|
+
return LazyJsonString.from(value);
|
|
33918
|
+
}
|
|
33919
|
+
return value;
|
|
33920
|
+
}
|
|
33921
|
+
if (ns.isTimestampSchema() && value != null) {
|
|
33922
|
+
const format2 = determineTimestampFormat(ns, this.settings);
|
|
33923
|
+
switch (format2) {
|
|
33924
|
+
case 5:
|
|
33925
|
+
return parseRfc3339DateTimeWithOffset(value);
|
|
33926
|
+
case 6:
|
|
33927
|
+
return parseRfc7231DateTime(value);
|
|
33928
|
+
case 7:
|
|
33929
|
+
return parseEpochTimestamp(value);
|
|
33930
|
+
default:
|
|
33931
|
+
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
|
|
33932
|
+
return new Date(value);
|
|
33933
|
+
}
|
|
33934
|
+
}
|
|
33935
|
+
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) {
|
|
33936
|
+
return BigInt(value);
|
|
33937
|
+
}
|
|
33938
|
+
if (ns.isBigDecimalSchema() && value != void 0) {
|
|
33939
|
+
if (value instanceof NumericValue) {
|
|
33940
|
+
return value;
|
|
33941
|
+
}
|
|
33942
|
+
const untyped = value;
|
|
33943
|
+
if (untyped.type === "bigDecimal" && "string" in untyped) {
|
|
33944
|
+
return new NumericValue(untyped.string, untyped.type);
|
|
33945
|
+
}
|
|
33946
|
+
return new NumericValue(String(value), "bigDecimal");
|
|
33947
|
+
}
|
|
33948
|
+
if (ns.isNumericSchema() && typeof value === "string") {
|
|
33949
|
+
switch (value) {
|
|
33950
|
+
case "Infinity":
|
|
33951
|
+
return Infinity;
|
|
33952
|
+
case "-Infinity":
|
|
33953
|
+
return -Infinity;
|
|
33954
|
+
case "NaN":
|
|
33955
|
+
return NaN;
|
|
33956
|
+
}
|
|
33957
|
+
return value;
|
|
33958
|
+
}
|
|
33959
|
+
if (ns.isDocumentSchema()) {
|
|
33960
|
+
if (isObject) {
|
|
33961
|
+
const out = Array.isArray(value) ? [] : {};
|
|
33962
|
+
for (const [k5, v5] of Object.entries(value)) {
|
|
33963
|
+
if (v5 instanceof NumericValue) {
|
|
33964
|
+
out[k5] = v5;
|
|
33965
|
+
} else {
|
|
33966
|
+
out[k5] = this._read(ns, v5);
|
|
33967
|
+
}
|
|
33968
|
+
}
|
|
33969
|
+
return out;
|
|
33970
|
+
} else {
|
|
33971
|
+
return structuredClone(value);
|
|
33972
|
+
}
|
|
33973
|
+
}
|
|
33974
|
+
return value;
|
|
33975
|
+
}
|
|
33976
|
+
};
|
|
33977
|
+
}
|
|
33978
|
+
});
|
|
33979
|
+
|
|
33980
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js
|
|
33981
|
+
var NUMERIC_CONTROL_CHAR2, JsonReplacer2;
|
|
33982
|
+
var init_jsonReplacer2 = __esm({
|
|
33983
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js"() {
|
|
33984
|
+
init_serde();
|
|
33985
|
+
NUMERIC_CONTROL_CHAR2 = String.fromCharCode(925);
|
|
33986
|
+
JsonReplacer2 = class {
|
|
33987
|
+
values = /* @__PURE__ */ new Map();
|
|
33988
|
+
counter = 0;
|
|
33989
|
+
stage = 0;
|
|
33990
|
+
createReplacer() {
|
|
33991
|
+
if (this.stage === 1) {
|
|
33992
|
+
throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");
|
|
33993
|
+
}
|
|
33994
|
+
if (this.stage === 2) {
|
|
33995
|
+
throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
|
|
33996
|
+
}
|
|
33997
|
+
this.stage = 1;
|
|
33998
|
+
return (key, value) => {
|
|
33999
|
+
if (value instanceof NumericValue) {
|
|
34000
|
+
const v5 = `${NUMERIC_CONTROL_CHAR2 + "nv" + this.counter++}_` + value.string;
|
|
34001
|
+
this.values.set(`"${v5}"`, value.string);
|
|
34002
|
+
return v5;
|
|
34003
|
+
}
|
|
34004
|
+
if (typeof value === "bigint") {
|
|
34005
|
+
const s5 = value.toString();
|
|
34006
|
+
const v5 = `${NUMERIC_CONTROL_CHAR2 + "b" + this.counter++}_` + s5;
|
|
34007
|
+
this.values.set(`"${v5}"`, s5);
|
|
34008
|
+
return v5;
|
|
34009
|
+
}
|
|
34010
|
+
return value;
|
|
34011
|
+
};
|
|
34012
|
+
}
|
|
34013
|
+
replaceInJson(json) {
|
|
34014
|
+
if (this.stage === 0) {
|
|
34015
|
+
throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");
|
|
34016
|
+
}
|
|
34017
|
+
if (this.stage === 2) {
|
|
34018
|
+
throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
|
|
34019
|
+
}
|
|
34020
|
+
this.stage = 2;
|
|
34021
|
+
if (this.counter === 0) {
|
|
34022
|
+
return json;
|
|
34023
|
+
}
|
|
34024
|
+
for (const [key, value] of this.values) {
|
|
34025
|
+
json = json.replace(key, value);
|
|
34026
|
+
}
|
|
34027
|
+
return json;
|
|
34028
|
+
}
|
|
34029
|
+
};
|
|
34030
|
+
}
|
|
34031
|
+
});
|
|
34032
|
+
|
|
34033
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js
|
|
34034
|
+
var import_util_base6413, JsonShapeSerializer2;
|
|
34035
|
+
var init_JsonShapeSerializer2 = __esm({
|
|
34036
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js"() {
|
|
34037
|
+
init_protocols();
|
|
34038
|
+
init_schema();
|
|
34039
|
+
init_serde();
|
|
34040
|
+
import_util_base6413 = __toESM(require_dist_cjs7());
|
|
34041
|
+
init_ConfigurableSerdeContext2();
|
|
34042
|
+
init_jsonReplacer2();
|
|
34043
|
+
JsonShapeSerializer2 = class extends SerdeContextConfig2 {
|
|
34044
|
+
settings;
|
|
34045
|
+
buffer;
|
|
34046
|
+
useReplacer = false;
|
|
34047
|
+
rootSchema;
|
|
34048
|
+
constructor(settings) {
|
|
34049
|
+
super();
|
|
34050
|
+
this.settings = settings;
|
|
34051
|
+
}
|
|
34052
|
+
write(schema, value) {
|
|
34053
|
+
this.rootSchema = NormalizedSchema.of(schema);
|
|
34054
|
+
this.buffer = this._write(this.rootSchema, value);
|
|
34055
|
+
}
|
|
34056
|
+
flush() {
|
|
34057
|
+
const { rootSchema, useReplacer } = this;
|
|
34058
|
+
this.rootSchema = void 0;
|
|
34059
|
+
this.useReplacer = false;
|
|
34060
|
+
if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
|
|
34061
|
+
if (!useReplacer) {
|
|
34062
|
+
return JSON.stringify(this.buffer);
|
|
34063
|
+
}
|
|
34064
|
+
const replacer = new JsonReplacer2();
|
|
34065
|
+
return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
|
|
34066
|
+
}
|
|
34067
|
+
return this.buffer;
|
|
34068
|
+
}
|
|
34069
|
+
writeDiscriminatedDocument(schema, value) {
|
|
34070
|
+
this.write(schema, value);
|
|
34071
|
+
if (typeof this.buffer === "object") {
|
|
34072
|
+
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
|
|
34073
|
+
}
|
|
34074
|
+
}
|
|
34075
|
+
_write(schema, value, container) {
|
|
34076
|
+
const isObject = value !== null && typeof value === "object";
|
|
34077
|
+
const ns = NormalizedSchema.of(schema);
|
|
34078
|
+
if (isObject) {
|
|
34079
|
+
if (ns.isStructSchema()) {
|
|
34080
|
+
const record = value;
|
|
34081
|
+
const out = {};
|
|
34082
|
+
const { jsonName } = this.settings;
|
|
34083
|
+
let nameMap = void 0;
|
|
34084
|
+
if (jsonName) {
|
|
34085
|
+
nameMap = {};
|
|
34086
|
+
}
|
|
34087
|
+
let outCount = 0;
|
|
34088
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
34089
|
+
const serializableValue = this._write(memberSchema, record[memberName], ns);
|
|
34090
|
+
if (serializableValue !== void 0) {
|
|
34091
|
+
let targetKey = memberName;
|
|
34092
|
+
if (jsonName) {
|
|
34093
|
+
targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
|
|
34094
|
+
nameMap[memberName] = targetKey;
|
|
34095
|
+
}
|
|
34096
|
+
out[targetKey] = serializableValue;
|
|
34097
|
+
outCount++;
|
|
34098
|
+
}
|
|
34099
|
+
}
|
|
34100
|
+
if (ns.isUnionSchema() && outCount === 0) {
|
|
34101
|
+
const { $unknown } = record;
|
|
34102
|
+
if (Array.isArray($unknown)) {
|
|
34103
|
+
const [k5, v5] = $unknown;
|
|
34104
|
+
out[k5] = this._write(15, v5);
|
|
34105
|
+
}
|
|
34106
|
+
} else if (typeof record.__type === "string") {
|
|
34107
|
+
for (const [k5, v5] of Object.entries(record)) {
|
|
34108
|
+
const targetKey = jsonName ? nameMap[k5] ?? k5 : k5;
|
|
34109
|
+
if (!(targetKey in out)) {
|
|
34110
|
+
out[targetKey] = this._write(15, v5);
|
|
34111
|
+
}
|
|
34112
|
+
}
|
|
34113
|
+
}
|
|
34114
|
+
return out;
|
|
34115
|
+
}
|
|
34116
|
+
if (Array.isArray(value) && ns.isListSchema()) {
|
|
34117
|
+
const listMember = ns.getValueSchema();
|
|
34118
|
+
const out = [];
|
|
34119
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
34120
|
+
for (const item of value) {
|
|
34121
|
+
if (sparse || item != null) {
|
|
34122
|
+
out.push(this._write(listMember, item));
|
|
34123
|
+
}
|
|
34124
|
+
}
|
|
34125
|
+
return out;
|
|
34126
|
+
}
|
|
34127
|
+
if (ns.isMapSchema()) {
|
|
34128
|
+
const mapMember = ns.getValueSchema();
|
|
34129
|
+
const out = {};
|
|
34130
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
34131
|
+
for (const [_k, _v] of Object.entries(value)) {
|
|
34132
|
+
if (sparse || _v != null) {
|
|
34133
|
+
out[_k] = this._write(mapMember, _v);
|
|
34134
|
+
}
|
|
34135
|
+
}
|
|
34136
|
+
return out;
|
|
34137
|
+
}
|
|
34138
|
+
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
|
|
34139
|
+
if (ns === this.rootSchema) {
|
|
34140
|
+
return value;
|
|
34141
|
+
}
|
|
34142
|
+
return (this.serdeContext?.base64Encoder ?? import_util_base6413.toBase64)(value);
|
|
34143
|
+
}
|
|
34144
|
+
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
34145
|
+
const format2 = determineTimestampFormat(ns, this.settings);
|
|
34146
|
+
switch (format2) {
|
|
34147
|
+
case 5:
|
|
34148
|
+
return value.toISOString().replace(".000Z", "Z");
|
|
34149
|
+
case 6:
|
|
34150
|
+
return dateToUtcString(value);
|
|
34151
|
+
case 7:
|
|
34152
|
+
return value.getTime() / 1e3;
|
|
34153
|
+
default:
|
|
34154
|
+
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
34155
|
+
return value.getTime() / 1e3;
|
|
34156
|
+
}
|
|
34157
|
+
}
|
|
34158
|
+
if (value instanceof NumericValue) {
|
|
34159
|
+
this.useReplacer = true;
|
|
34160
|
+
}
|
|
34161
|
+
}
|
|
34162
|
+
if (value === null && container?.isStructSchema()) {
|
|
34163
|
+
return void 0;
|
|
34164
|
+
}
|
|
34165
|
+
if (ns.isStringSchema()) {
|
|
34166
|
+
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
|
|
34167
|
+
return (0, import_uuid.v4)();
|
|
34168
|
+
}
|
|
34169
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
34170
|
+
if (value != null && mediaType) {
|
|
34171
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
34172
|
+
if (isJson) {
|
|
34173
|
+
return LazyJsonString.from(value);
|
|
34174
|
+
}
|
|
34175
|
+
}
|
|
34176
|
+
return value;
|
|
34177
|
+
}
|
|
34178
|
+
if (typeof value === "number" && ns.isNumericSchema()) {
|
|
34179
|
+
if (Math.abs(value) === Infinity || isNaN(value)) {
|
|
34180
|
+
return String(value);
|
|
34181
|
+
}
|
|
34182
|
+
return value;
|
|
34183
|
+
}
|
|
34184
|
+
if (typeof value === "string" && ns.isBlobSchema()) {
|
|
34185
|
+
if (ns === this.rootSchema) {
|
|
34186
|
+
return value;
|
|
34187
|
+
}
|
|
34188
|
+
return (this.serdeContext?.base64Encoder ?? import_util_base6413.toBase64)(value);
|
|
34189
|
+
}
|
|
34190
|
+
if (typeof value === "bigint") {
|
|
34191
|
+
this.useReplacer = true;
|
|
34192
|
+
}
|
|
34193
|
+
if (ns.isDocumentSchema()) {
|
|
34194
|
+
if (isObject) {
|
|
34195
|
+
const out = Array.isArray(value) ? [] : {};
|
|
34196
|
+
for (const [k5, v5] of Object.entries(value)) {
|
|
34197
|
+
if (v5 instanceof NumericValue) {
|
|
34198
|
+
this.useReplacer = true;
|
|
34199
|
+
out[k5] = v5;
|
|
34200
|
+
} else {
|
|
34201
|
+
out[k5] = this._write(ns, v5);
|
|
34202
|
+
}
|
|
34203
|
+
}
|
|
34204
|
+
return out;
|
|
34205
|
+
} else {
|
|
34206
|
+
return structuredClone(value);
|
|
34207
|
+
}
|
|
34208
|
+
}
|
|
34209
|
+
return value;
|
|
34210
|
+
}
|
|
34211
|
+
};
|
|
34212
|
+
}
|
|
34213
|
+
});
|
|
34214
|
+
|
|
34215
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js
|
|
34216
|
+
var JsonCodec2;
|
|
34217
|
+
var init_JsonCodec2 = __esm({
|
|
34218
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js"() {
|
|
34219
|
+
init_ConfigurableSerdeContext2();
|
|
34220
|
+
init_JsonShapeDeserializer2();
|
|
34221
|
+
init_JsonShapeSerializer2();
|
|
34222
|
+
JsonCodec2 = class extends SerdeContextConfig2 {
|
|
34223
|
+
settings;
|
|
34224
|
+
constructor(settings) {
|
|
34225
|
+
super();
|
|
34226
|
+
this.settings = settings;
|
|
34227
|
+
}
|
|
34228
|
+
createSerializer() {
|
|
34229
|
+
const serializer = new JsonShapeSerializer2(this.settings);
|
|
34230
|
+
serializer.setSerdeContext(this.serdeContext);
|
|
34231
|
+
return serializer;
|
|
34232
|
+
}
|
|
34233
|
+
createDeserializer() {
|
|
34234
|
+
const deserializer = new JsonShapeDeserializer2(this.settings);
|
|
34235
|
+
deserializer.setSerdeContext(this.serdeContext);
|
|
34236
|
+
return deserializer;
|
|
34237
|
+
}
|
|
34238
|
+
};
|
|
34239
|
+
}
|
|
34240
|
+
});
|
|
34241
|
+
|
|
34242
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js
|
|
34243
|
+
var AwsJsonRpcProtocol2;
|
|
34244
|
+
var init_AwsJsonRpcProtocol2 = __esm({
|
|
34245
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js"() {
|
|
34246
|
+
init_protocols();
|
|
34247
|
+
init_schema();
|
|
34248
|
+
init_ProtocolLib2();
|
|
34249
|
+
init_JsonCodec2();
|
|
34250
|
+
init_parseJsonBody2();
|
|
34251
|
+
AwsJsonRpcProtocol2 = class extends RpcProtocol {
|
|
34252
|
+
serializer;
|
|
34253
|
+
deserializer;
|
|
34254
|
+
serviceTarget;
|
|
34255
|
+
codec;
|
|
34256
|
+
mixin;
|
|
34257
|
+
awsQueryCompatible;
|
|
34258
|
+
constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) {
|
|
34259
|
+
super({
|
|
34260
|
+
defaultNamespace,
|
|
34261
|
+
errorTypeRegistries: errorTypeRegistries5
|
|
34262
|
+
});
|
|
34263
|
+
this.serviceTarget = serviceTarget;
|
|
34264
|
+
this.codec = jsonCodec ?? new JsonCodec2({
|
|
34265
|
+
timestampFormat: {
|
|
34266
|
+
useTrait: true,
|
|
34267
|
+
default: 7
|
|
34268
|
+
},
|
|
34269
|
+
jsonName: false
|
|
34270
|
+
});
|
|
34271
|
+
this.serializer = this.codec.createSerializer();
|
|
34272
|
+
this.deserializer = this.codec.createDeserializer();
|
|
34273
|
+
this.awsQueryCompatible = !!awsQueryCompatible;
|
|
34274
|
+
this.mixin = new ProtocolLib2(this.awsQueryCompatible);
|
|
34275
|
+
}
|
|
34276
|
+
async serializeRequest(operationSchema, input, context) {
|
|
34277
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
34278
|
+
if (!request.path.endsWith("/")) {
|
|
34279
|
+
request.path += "/";
|
|
34280
|
+
}
|
|
34281
|
+
request.headers["content-type"] = `application/x-amz-json-${this.getJsonRpcVersion()}`;
|
|
34282
|
+
request.headers["x-amz-target"] = `${this.serviceTarget}.${operationSchema.name}`;
|
|
34283
|
+
if (this.awsQueryCompatible) {
|
|
34284
|
+
request.headers["x-amzn-query-mode"] = "true";
|
|
34285
|
+
}
|
|
34286
|
+
if (deref(operationSchema.input) === "unit" || !request.body) {
|
|
34287
|
+
request.body = "{}";
|
|
34288
|
+
}
|
|
34289
|
+
return request;
|
|
34290
|
+
}
|
|
34291
|
+
getPayloadCodec() {
|
|
34292
|
+
return this.codec;
|
|
34293
|
+
}
|
|
34294
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
34295
|
+
if (this.awsQueryCompatible) {
|
|
34296
|
+
this.mixin.setQueryCompatError(dataObject, response);
|
|
34297
|
+
}
|
|
34298
|
+
const errorIdentifier = loadRestJsonErrorCode2(response, dataObject) ?? "Unknown";
|
|
34299
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
34300
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0);
|
|
34301
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
34302
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
34303
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
34304
|
+
const exception = new ErrorCtor(message);
|
|
34305
|
+
const output = {};
|
|
34306
|
+
const errorDeserializer = this.codec.createDeserializer();
|
|
34307
|
+
for (const [name2, member2] of ns.structIterator()) {
|
|
34308
|
+
if (dataObject[name2] != null) {
|
|
34309
|
+
output[name2] = errorDeserializer.readObject(member2, dataObject[name2]);
|
|
34310
|
+
}
|
|
34311
|
+
}
|
|
34312
|
+
if (this.awsQueryCompatible) {
|
|
34313
|
+
this.mixin.queryCompatOutput(dataObject, output);
|
|
34314
|
+
}
|
|
34315
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
34316
|
+
$fault: ns.getMergedTraits().error,
|
|
34317
|
+
message
|
|
34318
|
+
}, output), dataObject);
|
|
34319
|
+
}
|
|
34320
|
+
};
|
|
34321
|
+
}
|
|
34322
|
+
});
|
|
34323
|
+
|
|
34324
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js
|
|
34325
|
+
var AwsJson1_0Protocol2;
|
|
34326
|
+
var init_AwsJson1_0Protocol2 = __esm({
|
|
34327
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js"() {
|
|
34328
|
+
init_AwsJsonRpcProtocol2();
|
|
34329
|
+
AwsJson1_0Protocol2 = class extends AwsJsonRpcProtocol2 {
|
|
34330
|
+
constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) {
|
|
34331
|
+
super({
|
|
34332
|
+
defaultNamespace,
|
|
34333
|
+
errorTypeRegistries: errorTypeRegistries5,
|
|
34334
|
+
serviceTarget,
|
|
34335
|
+
awsQueryCompatible,
|
|
34336
|
+
jsonCodec
|
|
34337
|
+
});
|
|
34338
|
+
}
|
|
34339
|
+
getShapeId() {
|
|
34340
|
+
return "aws.protocols#awsJson1_0";
|
|
34341
|
+
}
|
|
34342
|
+
getJsonRpcVersion() {
|
|
34343
|
+
return "1.0";
|
|
34344
|
+
}
|
|
34345
|
+
getDefaultContentType() {
|
|
34346
|
+
return "application/x-amz-json-1.0";
|
|
34347
|
+
}
|
|
34348
|
+
};
|
|
34349
|
+
}
|
|
34350
|
+
});
|
|
34351
|
+
|
|
34352
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js
|
|
34353
|
+
var AwsJson1_1Protocol2;
|
|
34354
|
+
var init_AwsJson1_1Protocol2 = __esm({
|
|
34355
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js"() {
|
|
34356
|
+
init_AwsJsonRpcProtocol2();
|
|
34357
|
+
AwsJson1_1Protocol2 = class extends AwsJsonRpcProtocol2 {
|
|
34358
|
+
constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5, serviceTarget, awsQueryCompatible, jsonCodec }) {
|
|
34359
|
+
super({
|
|
34360
|
+
defaultNamespace,
|
|
34361
|
+
errorTypeRegistries: errorTypeRegistries5,
|
|
34362
|
+
serviceTarget,
|
|
34363
|
+
awsQueryCompatible,
|
|
34364
|
+
jsonCodec
|
|
34365
|
+
});
|
|
34366
|
+
}
|
|
34367
|
+
getShapeId() {
|
|
34368
|
+
return "aws.protocols#awsJson1_1";
|
|
34369
|
+
}
|
|
34370
|
+
getJsonRpcVersion() {
|
|
34371
|
+
return "1.1";
|
|
34372
|
+
}
|
|
34373
|
+
getDefaultContentType() {
|
|
34374
|
+
return "application/x-amz-json-1.1";
|
|
34375
|
+
}
|
|
34376
|
+
};
|
|
34377
|
+
}
|
|
34378
|
+
});
|
|
34379
|
+
|
|
34380
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js
|
|
34381
|
+
var AwsRestJsonProtocol2;
|
|
34382
|
+
var init_AwsRestJsonProtocol2 = __esm({
|
|
34383
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js"() {
|
|
34384
|
+
init_protocols();
|
|
34385
|
+
init_schema();
|
|
34386
|
+
init_ProtocolLib2();
|
|
34387
|
+
init_JsonCodec2();
|
|
34388
|
+
init_parseJsonBody2();
|
|
34389
|
+
AwsRestJsonProtocol2 = class extends HttpBindingProtocol {
|
|
34390
|
+
serializer;
|
|
34391
|
+
deserializer;
|
|
34392
|
+
codec;
|
|
34393
|
+
mixin = new ProtocolLib2();
|
|
34394
|
+
constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries5 }) {
|
|
34395
|
+
super({
|
|
34396
|
+
defaultNamespace,
|
|
34397
|
+
errorTypeRegistries: errorTypeRegistries5
|
|
34398
|
+
});
|
|
34399
|
+
const settings = {
|
|
34400
|
+
timestampFormat: {
|
|
34401
|
+
useTrait: true,
|
|
34402
|
+
default: 7
|
|
34403
|
+
},
|
|
34404
|
+
httpBindings: true,
|
|
34405
|
+
jsonName: true
|
|
34406
|
+
};
|
|
34407
|
+
this.codec = new JsonCodec2(settings);
|
|
34408
|
+
this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
|
|
34409
|
+
this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
|
|
34410
|
+
}
|
|
34411
|
+
getShapeId() {
|
|
34412
|
+
return "aws.protocols#restJson1";
|
|
34413
|
+
}
|
|
34414
|
+
getPayloadCodec() {
|
|
34415
|
+
return this.codec;
|
|
34416
|
+
}
|
|
34417
|
+
setSerdeContext(serdeContext) {
|
|
34418
|
+
this.codec.setSerdeContext(serdeContext);
|
|
34419
|
+
super.setSerdeContext(serdeContext);
|
|
34420
|
+
}
|
|
34421
|
+
async serializeRequest(operationSchema, input, context) {
|
|
34422
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
34423
|
+
const inputSchema = NormalizedSchema.of(operationSchema.input);
|
|
34424
|
+
if (!request.headers["content-type"]) {
|
|
34425
|
+
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
34426
|
+
if (contentType) {
|
|
34427
|
+
request.headers["content-type"] = contentType;
|
|
34428
|
+
}
|
|
34429
|
+
}
|
|
34430
|
+
if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) {
|
|
34431
|
+
request.body = "{}";
|
|
34432
|
+
}
|
|
34433
|
+
return request;
|
|
34434
|
+
}
|
|
34435
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
34436
|
+
const output = await super.deserializeResponse(operationSchema, context, response);
|
|
34437
|
+
const outputSchema = NormalizedSchema.of(operationSchema.output);
|
|
34438
|
+
for (const [name2, member2] of outputSchema.structIterator()) {
|
|
34439
|
+
if (member2.getMemberTraits().httpPayload && !(name2 in output)) {
|
|
34440
|
+
output[name2] = null;
|
|
34441
|
+
}
|
|
34442
|
+
}
|
|
34443
|
+
return output;
|
|
34444
|
+
}
|
|
34445
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
34446
|
+
const errorIdentifier = loadRestJsonErrorCode2(response, dataObject) ?? "Unknown";
|
|
34447
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
34448
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
34449
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
34450
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
34451
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
34452
|
+
const exception = new ErrorCtor(message);
|
|
34453
|
+
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
34454
|
+
const output = {};
|
|
34455
|
+
const errorDeserializer = this.codec.createDeserializer();
|
|
34456
|
+
for (const [name2, member2] of ns.structIterator()) {
|
|
34457
|
+
const target = member2.getMergedTraits().jsonName ?? name2;
|
|
34458
|
+
output[name2] = errorDeserializer.readObject(member2, dataObject[target]);
|
|
34459
|
+
}
|
|
34460
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
34461
|
+
$fault: ns.getMergedTraits().error,
|
|
34462
|
+
message
|
|
34463
|
+
}, output), dataObject);
|
|
34464
|
+
}
|
|
34465
|
+
getDefaultContentType() {
|
|
34466
|
+
return "application/json";
|
|
34467
|
+
}
|
|
34468
|
+
};
|
|
34469
|
+
}
|
|
34470
|
+
});
|
|
34471
|
+
|
|
34472
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js
|
|
34473
|
+
var import_smithy_client39, awsExpectUnion2;
|
|
34474
|
+
var init_awsExpectUnion2 = __esm({
|
|
34475
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/awsExpectUnion.js"() {
|
|
34476
|
+
import_smithy_client39 = __toESM(require_dist_cjs27());
|
|
34477
|
+
awsExpectUnion2 = (value) => {
|
|
34478
|
+
if (value == null) {
|
|
34479
|
+
return void 0;
|
|
34480
|
+
}
|
|
34481
|
+
if (typeof value === "object" && "__type" in value) {
|
|
34482
|
+
delete value.__type;
|
|
34483
|
+
}
|
|
34484
|
+
return (0, import_smithy_client39.expectUnion)(value);
|
|
34485
|
+
};
|
|
34486
|
+
}
|
|
34487
|
+
});
|
|
34488
|
+
|
|
34489
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js
|
|
34490
|
+
var import_xml_builder4, import_smithy_client40, import_util_utf813, XmlShapeDeserializer2;
|
|
34491
|
+
var init_XmlShapeDeserializer2 = __esm({
|
|
34492
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js"() {
|
|
34493
|
+
import_xml_builder4 = __toESM(require_dist_cjs29());
|
|
34494
|
+
init_protocols();
|
|
34495
|
+
init_schema();
|
|
34496
|
+
import_smithy_client40 = __toESM(require_dist_cjs27());
|
|
34497
|
+
import_util_utf813 = __toESM(require_dist_cjs6());
|
|
34498
|
+
init_ConfigurableSerdeContext2();
|
|
34499
|
+
init_UnionSerde2();
|
|
34500
|
+
XmlShapeDeserializer2 = class extends SerdeContextConfig2 {
|
|
34501
|
+
settings;
|
|
34502
|
+
stringDeserializer;
|
|
34503
|
+
constructor(settings) {
|
|
34504
|
+
super();
|
|
34505
|
+
this.settings = settings;
|
|
34506
|
+
this.stringDeserializer = new FromStringShapeDeserializer(settings);
|
|
34507
|
+
}
|
|
34508
|
+
setSerdeContext(serdeContext) {
|
|
34509
|
+
this.serdeContext = serdeContext;
|
|
34510
|
+
this.stringDeserializer.setSerdeContext(serdeContext);
|
|
34511
|
+
}
|
|
34512
|
+
read(schema, bytes, key) {
|
|
34513
|
+
const ns = NormalizedSchema.of(schema);
|
|
34514
|
+
const memberSchemas = ns.getMemberSchemas();
|
|
34515
|
+
const isEventPayload = ns.isStructSchema() && ns.isMemberSchema() && !!Object.values(memberSchemas).find((memberNs) => {
|
|
34516
|
+
return !!memberNs.getMemberTraits().eventPayload;
|
|
34517
|
+
});
|
|
34518
|
+
if (isEventPayload) {
|
|
34519
|
+
const output = {};
|
|
34520
|
+
const memberName = Object.keys(memberSchemas)[0];
|
|
34521
|
+
const eventMemberSchema = memberSchemas[memberName];
|
|
34522
|
+
if (eventMemberSchema.isBlobSchema()) {
|
|
34523
|
+
output[memberName] = bytes;
|
|
34524
|
+
} else {
|
|
34525
|
+
output[memberName] = this.read(memberSchemas[memberName], bytes);
|
|
34526
|
+
}
|
|
34527
|
+
return output;
|
|
34528
|
+
}
|
|
34529
|
+
const xmlString = (this.serdeContext?.utf8Encoder ?? import_util_utf813.toUtf8)(bytes);
|
|
34530
|
+
const parsedObject = this.parseXml(xmlString);
|
|
34531
|
+
return this.readSchema(schema, key ? parsedObject[key] : parsedObject);
|
|
34532
|
+
}
|
|
34533
|
+
readSchema(_schema, value) {
|
|
34534
|
+
const ns = NormalizedSchema.of(_schema);
|
|
34535
|
+
if (ns.isUnitSchema()) {
|
|
34536
|
+
return;
|
|
34537
|
+
}
|
|
34538
|
+
const traits = ns.getMergedTraits();
|
|
34539
|
+
if (ns.isListSchema() && !Array.isArray(value)) {
|
|
34540
|
+
return this.readSchema(ns, [value]);
|
|
34541
|
+
}
|
|
34542
|
+
if (value == null) {
|
|
34543
|
+
return value;
|
|
34544
|
+
}
|
|
34545
|
+
if (typeof value === "object") {
|
|
34546
|
+
const flat = !!traits.xmlFlattened;
|
|
34547
|
+
if (ns.isListSchema()) {
|
|
34548
|
+
const listValue = ns.getValueSchema();
|
|
34549
|
+
const buffer2 = [];
|
|
34550
|
+
const sourceKey = listValue.getMergedTraits().xmlName ?? "member";
|
|
34551
|
+
const source = flat ? value : (value[0] ?? value)[sourceKey];
|
|
34552
|
+
if (source == null) {
|
|
34553
|
+
return buffer2;
|
|
34554
|
+
}
|
|
34555
|
+
const sourceArray = Array.isArray(source) ? source : [source];
|
|
34556
|
+
for (const v5 of sourceArray) {
|
|
34557
|
+
buffer2.push(this.readSchema(listValue, v5));
|
|
34558
|
+
}
|
|
34559
|
+
return buffer2;
|
|
34560
|
+
}
|
|
34561
|
+
const buffer = {};
|
|
34562
|
+
if (ns.isMapSchema()) {
|
|
34563
|
+
const keyNs = ns.getKeySchema();
|
|
34564
|
+
const memberNs = ns.getValueSchema();
|
|
34565
|
+
let entries;
|
|
34566
|
+
if (flat) {
|
|
34567
|
+
entries = Array.isArray(value) ? value : [value];
|
|
34568
|
+
} else {
|
|
34569
|
+
entries = Array.isArray(value.entry) ? value.entry : [value.entry];
|
|
34570
|
+
}
|
|
34571
|
+
const keyProperty = keyNs.getMergedTraits().xmlName ?? "key";
|
|
34572
|
+
const valueProperty = memberNs.getMergedTraits().xmlName ?? "value";
|
|
34573
|
+
for (const entry of entries) {
|
|
34574
|
+
const key = entry[keyProperty];
|
|
34575
|
+
const value2 = entry[valueProperty];
|
|
34576
|
+
buffer[key] = this.readSchema(memberNs, value2);
|
|
34577
|
+
}
|
|
34578
|
+
return buffer;
|
|
34579
|
+
}
|
|
34580
|
+
if (ns.isStructSchema()) {
|
|
34581
|
+
const union = ns.isUnionSchema();
|
|
34582
|
+
let unionSerde;
|
|
34583
|
+
if (union) {
|
|
34584
|
+
unionSerde = new UnionSerde2(value, buffer);
|
|
34585
|
+
}
|
|
34586
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
34587
|
+
const memberTraits = memberSchema.getMergedTraits();
|
|
34588
|
+
const xmlObjectKey = !memberTraits.httpPayload ? memberSchema.getMemberTraits().xmlName ?? memberName : memberTraits.xmlName ?? memberSchema.getName();
|
|
34589
|
+
if (union) {
|
|
34590
|
+
unionSerde.mark(xmlObjectKey);
|
|
34591
|
+
}
|
|
34592
|
+
if (value[xmlObjectKey] != null) {
|
|
34593
|
+
buffer[memberName] = this.readSchema(memberSchema, value[xmlObjectKey]);
|
|
34594
|
+
}
|
|
34595
|
+
}
|
|
34596
|
+
if (union) {
|
|
34597
|
+
unionSerde.writeUnknown();
|
|
34598
|
+
}
|
|
34599
|
+
return buffer;
|
|
34600
|
+
}
|
|
34601
|
+
if (ns.isDocumentSchema()) {
|
|
34602
|
+
return value;
|
|
34603
|
+
}
|
|
34604
|
+
throw new Error(`@aws-sdk/core/protocols - xml deserializer unhandled schema type for ${ns.getName(true)}`);
|
|
34605
|
+
}
|
|
34606
|
+
if (ns.isListSchema()) {
|
|
34607
|
+
return [];
|
|
34608
|
+
}
|
|
34609
|
+
if (ns.isMapSchema() || ns.isStructSchema()) {
|
|
34610
|
+
return {};
|
|
34611
|
+
}
|
|
34612
|
+
return this.stringDeserializer.read(ns, value);
|
|
34613
|
+
}
|
|
34614
|
+
parseXml(xml) {
|
|
34615
|
+
if (xml.length) {
|
|
34616
|
+
let parsedObj;
|
|
34617
|
+
try {
|
|
34618
|
+
parsedObj = (0, import_xml_builder4.parseXML)(xml);
|
|
34619
|
+
} catch (e5) {
|
|
34620
|
+
if (e5 && typeof e5 === "object") {
|
|
34621
|
+
Object.defineProperty(e5, "$responseBodyText", {
|
|
34622
|
+
value: xml
|
|
34623
|
+
});
|
|
34624
|
+
}
|
|
34625
|
+
throw e5;
|
|
34626
|
+
}
|
|
34627
|
+
const textNodeName = "#text";
|
|
34628
|
+
const key = Object.keys(parsedObj)[0];
|
|
34629
|
+
const parsedObjToReturn = parsedObj[key];
|
|
34630
|
+
if (parsedObjToReturn[textNodeName]) {
|
|
34631
|
+
parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
|
|
34632
|
+
delete parsedObjToReturn[textNodeName];
|
|
34633
|
+
}
|
|
34634
|
+
return (0, import_smithy_client40.getValueFromTextNode)(parsedObjToReturn);
|
|
34635
|
+
}
|
|
34636
|
+
return {};
|
|
34637
|
+
}
|
|
34638
|
+
};
|
|
34639
|
+
}
|
|
34640
|
+
});
|
|
34641
|
+
|
|
34642
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js
|
|
34643
|
+
var import_smithy_client41, import_util_base6414, QueryShapeSerializer2;
|
|
34644
|
+
var init_QueryShapeSerializer2 = __esm({
|
|
34645
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js"() {
|
|
34646
|
+
init_protocols();
|
|
34647
|
+
init_schema();
|
|
34648
|
+
init_serde();
|
|
34649
|
+
import_smithy_client41 = __toESM(require_dist_cjs27());
|
|
34650
|
+
import_util_base6414 = __toESM(require_dist_cjs7());
|
|
34651
|
+
init_ConfigurableSerdeContext2();
|
|
34652
|
+
QueryShapeSerializer2 = class extends SerdeContextConfig2 {
|
|
34653
|
+
settings;
|
|
34654
|
+
buffer;
|
|
34655
|
+
constructor(settings) {
|
|
34656
|
+
super();
|
|
34657
|
+
this.settings = settings;
|
|
34658
|
+
}
|
|
34659
|
+
write(schema, value, prefix = "") {
|
|
34660
|
+
if (this.buffer === void 0) {
|
|
34661
|
+
this.buffer = "";
|
|
34662
|
+
}
|
|
34663
|
+
const ns = NormalizedSchema.of(schema);
|
|
34664
|
+
if (prefix && !prefix.endsWith(".")) {
|
|
34665
|
+
prefix += ".";
|
|
34666
|
+
}
|
|
34667
|
+
if (ns.isBlobSchema()) {
|
|
34668
|
+
if (typeof value === "string" || value instanceof Uint8Array) {
|
|
34669
|
+
this.writeKey(prefix);
|
|
34670
|
+
this.writeValue((this.serdeContext?.base64Encoder ?? import_util_base6414.toBase64)(value));
|
|
34671
|
+
}
|
|
34672
|
+
} else if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isStringSchema()) {
|
|
34673
|
+
if (value != null) {
|
|
34674
|
+
this.writeKey(prefix);
|
|
34675
|
+
this.writeValue(String(value));
|
|
34676
|
+
} else if (ns.isIdempotencyToken()) {
|
|
34677
|
+
this.writeKey(prefix);
|
|
34678
|
+
this.writeValue((0, import_uuid.v4)());
|
|
34679
|
+
}
|
|
34680
|
+
} else if (ns.isBigIntegerSchema()) {
|
|
34681
|
+
if (value != null) {
|
|
34682
|
+
this.writeKey(prefix);
|
|
34683
|
+
this.writeValue(String(value));
|
|
34684
|
+
}
|
|
34685
|
+
} else if (ns.isBigDecimalSchema()) {
|
|
34686
|
+
if (value != null) {
|
|
34687
|
+
this.writeKey(prefix);
|
|
34688
|
+
this.writeValue(value instanceof NumericValue ? value.string : String(value));
|
|
34689
|
+
}
|
|
34690
|
+
} else if (ns.isTimestampSchema()) {
|
|
34691
|
+
if (value instanceof Date) {
|
|
34692
|
+
this.writeKey(prefix);
|
|
34693
|
+
const format2 = determineTimestampFormat(ns, this.settings);
|
|
34694
|
+
switch (format2) {
|
|
34695
|
+
case 5:
|
|
34696
|
+
this.writeValue(value.toISOString().replace(".000Z", "Z"));
|
|
34697
|
+
break;
|
|
34698
|
+
case 6:
|
|
34699
|
+
this.writeValue((0, import_smithy_client41.dateToUtcString)(value));
|
|
34700
|
+
break;
|
|
34701
|
+
case 7:
|
|
34702
|
+
this.writeValue(String(value.getTime() / 1e3));
|
|
34703
|
+
break;
|
|
34704
|
+
}
|
|
34705
|
+
}
|
|
34706
|
+
} else if (ns.isDocumentSchema()) {
|
|
34707
|
+
if (Array.isArray(value)) {
|
|
34708
|
+
this.write(64 | 15, value, prefix);
|
|
34709
|
+
} else if (value instanceof Date) {
|
|
34710
|
+
this.write(4, value, prefix);
|
|
34711
|
+
} else if (value instanceof Uint8Array) {
|
|
34712
|
+
this.write(21, value, prefix);
|
|
34713
|
+
} else if (value && typeof value === "object") {
|
|
34714
|
+
this.write(128 | 15, value, prefix);
|
|
34715
|
+
} else {
|
|
34716
|
+
this.writeKey(prefix);
|
|
34717
|
+
this.writeValue(String(value));
|
|
34718
|
+
}
|
|
34719
|
+
} else if (ns.isListSchema()) {
|
|
34720
|
+
if (Array.isArray(value)) {
|
|
34721
|
+
if (value.length === 0) {
|
|
34722
|
+
if (this.settings.serializeEmptyLists) {
|
|
34723
|
+
this.writeKey(prefix);
|
|
34724
|
+
this.writeValue("");
|
|
34725
|
+
}
|
|
34726
|
+
} else {
|
|
34727
|
+
const member2 = ns.getValueSchema();
|
|
34728
|
+
const flat = this.settings.flattenLists || ns.getMergedTraits().xmlFlattened;
|
|
34729
|
+
let i5 = 1;
|
|
34730
|
+
for (const item of value) {
|
|
34731
|
+
if (item == null) {
|
|
34732
|
+
continue;
|
|
34733
|
+
}
|
|
34734
|
+
const traits = member2.getMergedTraits();
|
|
34735
|
+
const suffix = this.getKey("member", traits.xmlName, traits.ec2QueryName);
|
|
34736
|
+
const key = flat ? `${prefix}${i5}` : `${prefix}${suffix}.${i5}`;
|
|
34737
|
+
this.write(member2, item, key);
|
|
34738
|
+
++i5;
|
|
34739
|
+
}
|
|
34740
|
+
}
|
|
34741
|
+
}
|
|
34742
|
+
} else if (ns.isMapSchema()) {
|
|
34743
|
+
if (value && typeof value === "object") {
|
|
34744
|
+
const keySchema = ns.getKeySchema();
|
|
34745
|
+
const memberSchema = ns.getValueSchema();
|
|
34746
|
+
const flat = ns.getMergedTraits().xmlFlattened;
|
|
34747
|
+
let i5 = 1;
|
|
34748
|
+
for (const [k5, v5] of Object.entries(value)) {
|
|
34749
|
+
if (v5 == null) {
|
|
34750
|
+
continue;
|
|
34751
|
+
}
|
|
34752
|
+
const keyTraits = keySchema.getMergedTraits();
|
|
34753
|
+
const keySuffix = this.getKey("key", keyTraits.xmlName, keyTraits.ec2QueryName);
|
|
34754
|
+
const key = flat ? `${prefix}${i5}.${keySuffix}` : `${prefix}entry.${i5}.${keySuffix}`;
|
|
34755
|
+
const valTraits = memberSchema.getMergedTraits();
|
|
34756
|
+
const valueSuffix = this.getKey("value", valTraits.xmlName, valTraits.ec2QueryName);
|
|
34757
|
+
const valueKey = flat ? `${prefix}${i5}.${valueSuffix}` : `${prefix}entry.${i5}.${valueSuffix}`;
|
|
34758
|
+
this.write(keySchema, k5, key);
|
|
34759
|
+
this.write(memberSchema, v5, valueKey);
|
|
34760
|
+
++i5;
|
|
34761
|
+
}
|
|
34762
|
+
}
|
|
34763
|
+
} else if (ns.isStructSchema()) {
|
|
34764
|
+
if (value && typeof value === "object") {
|
|
34765
|
+
let didWriteMember = false;
|
|
34766
|
+
for (const [memberName, member2] of ns.structIterator()) {
|
|
34767
|
+
if (value[memberName] == null && !member2.isIdempotencyToken()) {
|
|
34768
|
+
continue;
|
|
34769
|
+
}
|
|
34770
|
+
const traits = member2.getMergedTraits();
|
|
34771
|
+
const suffix = this.getKey(memberName, traits.xmlName, traits.ec2QueryName, "struct");
|
|
34772
|
+
const key = `${prefix}${suffix}`;
|
|
34773
|
+
this.write(member2, value[memberName], key);
|
|
34774
|
+
didWriteMember = true;
|
|
34775
|
+
}
|
|
34776
|
+
if (!didWriteMember && ns.isUnionSchema()) {
|
|
34777
|
+
const { $unknown } = value;
|
|
34778
|
+
if (Array.isArray($unknown)) {
|
|
34779
|
+
const [k5, v5] = $unknown;
|
|
34780
|
+
const key = `${prefix}${k5}`;
|
|
34781
|
+
this.write(15, v5, key);
|
|
34782
|
+
}
|
|
34783
|
+
}
|
|
34784
|
+
}
|
|
34785
|
+
} else if (ns.isUnitSchema()) {
|
|
34786
|
+
} else {
|
|
34787
|
+
throw new Error(`@aws-sdk/core/protocols - QuerySerializer unrecognized schema type ${ns.getName(true)}`);
|
|
34788
|
+
}
|
|
34789
|
+
}
|
|
34790
|
+
flush() {
|
|
34791
|
+
if (this.buffer === void 0) {
|
|
34792
|
+
throw new Error("@aws-sdk/core/protocols - QuerySerializer cannot flush with nothing written to buffer.");
|
|
34793
|
+
}
|
|
34794
|
+
const str = this.buffer;
|
|
34795
|
+
delete this.buffer;
|
|
34796
|
+
return str;
|
|
34797
|
+
}
|
|
34798
|
+
getKey(memberName, xmlName, ec2QueryName, keySource) {
|
|
34799
|
+
const { ec2, capitalizeKeys } = this.settings;
|
|
34800
|
+
if (ec2 && ec2QueryName) {
|
|
34801
|
+
return ec2QueryName;
|
|
34802
|
+
}
|
|
34803
|
+
const key = xmlName ?? memberName;
|
|
34804
|
+
if (capitalizeKeys && keySource === "struct") {
|
|
34805
|
+
return key[0].toUpperCase() + key.slice(1);
|
|
34806
|
+
}
|
|
34807
|
+
return key;
|
|
34808
|
+
}
|
|
34809
|
+
writeKey(key) {
|
|
34810
|
+
if (key.endsWith(".")) {
|
|
34811
|
+
key = key.slice(0, key.length - 1);
|
|
34812
|
+
}
|
|
34813
|
+
this.buffer += `&${extendedEncodeURIComponent(key)}=`;
|
|
34814
|
+
}
|
|
34815
|
+
writeValue(value) {
|
|
34816
|
+
this.buffer += extendedEncodeURIComponent(value);
|
|
34817
|
+
}
|
|
34818
|
+
};
|
|
34819
|
+
}
|
|
34820
|
+
});
|
|
34821
|
+
|
|
34822
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js
|
|
34823
|
+
var AwsQueryProtocol2;
|
|
34824
|
+
var init_AwsQueryProtocol2 = __esm({
|
|
34825
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js"() {
|
|
34826
|
+
init_protocols();
|
|
34827
|
+
init_schema();
|
|
34828
|
+
init_ProtocolLib2();
|
|
34829
|
+
init_XmlShapeDeserializer2();
|
|
34830
|
+
init_QueryShapeSerializer2();
|
|
34831
|
+
AwsQueryProtocol2 = class extends RpcProtocol {
|
|
34832
|
+
options;
|
|
34833
|
+
serializer;
|
|
34834
|
+
deserializer;
|
|
34835
|
+
mixin = new ProtocolLib2();
|
|
34836
|
+
constructor(options) {
|
|
34837
|
+
super({
|
|
34838
|
+
defaultNamespace: options.defaultNamespace,
|
|
34839
|
+
errorTypeRegistries: options.errorTypeRegistries
|
|
34840
|
+
});
|
|
34841
|
+
this.options = options;
|
|
34842
|
+
const settings = {
|
|
34843
|
+
timestampFormat: {
|
|
34844
|
+
useTrait: true,
|
|
34845
|
+
default: 5
|
|
34846
|
+
},
|
|
34847
|
+
httpBindings: false,
|
|
34848
|
+
xmlNamespace: options.xmlNamespace,
|
|
34849
|
+
serviceNamespace: options.defaultNamespace,
|
|
34850
|
+
serializeEmptyLists: true
|
|
34851
|
+
};
|
|
34852
|
+
this.serializer = new QueryShapeSerializer2(settings);
|
|
34853
|
+
this.deserializer = new XmlShapeDeserializer2(settings);
|
|
34854
|
+
}
|
|
34855
|
+
getShapeId() {
|
|
34856
|
+
return "aws.protocols#awsQuery";
|
|
34857
|
+
}
|
|
34858
|
+
setSerdeContext(serdeContext) {
|
|
34859
|
+
this.serializer.setSerdeContext(serdeContext);
|
|
34860
|
+
this.deserializer.setSerdeContext(serdeContext);
|
|
34861
|
+
}
|
|
34862
|
+
getPayloadCodec() {
|
|
34863
|
+
throw new Error("AWSQuery protocol has no payload codec.");
|
|
34864
|
+
}
|
|
34865
|
+
async serializeRequest(operationSchema, input, context) {
|
|
34866
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
34867
|
+
if (!request.path.endsWith("/")) {
|
|
34868
|
+
request.path += "/";
|
|
34869
|
+
}
|
|
34870
|
+
request.headers["content-type"] = "application/x-www-form-urlencoded";
|
|
34871
|
+
if (deref(operationSchema.input) === "unit" || !request.body) {
|
|
34872
|
+
request.body = "";
|
|
34873
|
+
}
|
|
34874
|
+
const action = operationSchema.name.split("#")[1] ?? operationSchema.name;
|
|
34875
|
+
request.body = `Action=${action}&Version=${this.options.version}` + request.body;
|
|
34876
|
+
if (request.body.endsWith("&")) {
|
|
34877
|
+
request.body = request.body.slice(-1);
|
|
34878
|
+
}
|
|
34879
|
+
return request;
|
|
34880
|
+
}
|
|
34881
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
34882
|
+
const deserializer = this.deserializer;
|
|
34883
|
+
const ns = NormalizedSchema.of(operationSchema.output);
|
|
34884
|
+
const dataObject = {};
|
|
34885
|
+
if (response.statusCode >= 300) {
|
|
34886
|
+
const bytes2 = await collectBody(response.body, context);
|
|
34887
|
+
if (bytes2.byteLength > 0) {
|
|
34888
|
+
Object.assign(dataObject, await deserializer.read(15, bytes2));
|
|
34889
|
+
}
|
|
34890
|
+
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
34891
|
+
}
|
|
34892
|
+
for (const header in response.headers) {
|
|
34893
|
+
const value = response.headers[header];
|
|
34894
|
+
delete response.headers[header];
|
|
34895
|
+
response.headers[header.toLowerCase()] = value;
|
|
34896
|
+
}
|
|
34897
|
+
const shortName = operationSchema.name.split("#")[1] ?? operationSchema.name;
|
|
34898
|
+
const awsQueryResultKey = ns.isStructSchema() && this.useNestedResult() ? shortName + "Result" : void 0;
|
|
34899
|
+
const bytes = await collectBody(response.body, context);
|
|
34900
|
+
if (bytes.byteLength > 0) {
|
|
34901
|
+
Object.assign(dataObject, await deserializer.read(ns, bytes, awsQueryResultKey));
|
|
34902
|
+
}
|
|
34903
|
+
dataObject.$metadata = this.deserializeMetadata(response);
|
|
34904
|
+
return dataObject;
|
|
34905
|
+
}
|
|
34906
|
+
useNestedResult() {
|
|
34907
|
+
return true;
|
|
34908
|
+
}
|
|
34909
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
34910
|
+
const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
|
|
34911
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
34912
|
+
const errorData = this.loadQueryError(dataObject) ?? {};
|
|
34913
|
+
const message = this.loadQueryErrorMessage(dataObject);
|
|
34914
|
+
errorData.message = message;
|
|
34915
|
+
errorData.Error = {
|
|
34916
|
+
Type: errorData.Type,
|
|
34917
|
+
Code: errorData.Code,
|
|
34918
|
+
Message: message
|
|
34919
|
+
};
|
|
34920
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
|
|
34921
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
34922
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
34923
|
+
const exception = new ErrorCtor(message);
|
|
34924
|
+
const output = {
|
|
34925
|
+
Type: errorData.Error.Type,
|
|
34926
|
+
Code: errorData.Error.Code,
|
|
34927
|
+
Error: errorData.Error
|
|
34928
|
+
};
|
|
34929
|
+
for (const [name2, member2] of ns.structIterator()) {
|
|
34930
|
+
const target = member2.getMergedTraits().xmlName ?? name2;
|
|
34931
|
+
const value = errorData[target] ?? dataObject[target];
|
|
34932
|
+
output[name2] = this.deserializer.readSchema(member2, value);
|
|
34933
|
+
}
|
|
34934
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
34935
|
+
$fault: ns.getMergedTraits().error,
|
|
34936
|
+
message
|
|
34937
|
+
}, output), dataObject);
|
|
34938
|
+
}
|
|
34939
|
+
loadQueryErrorCode(output, data2) {
|
|
34940
|
+
const code = (data2.Errors?.[0]?.Error ?? data2.Errors?.Error ?? data2.Error)?.Code;
|
|
34941
|
+
if (code !== void 0) {
|
|
34942
|
+
return code;
|
|
34943
|
+
}
|
|
34944
|
+
if (output.statusCode == 404) {
|
|
34945
|
+
return "NotFound";
|
|
34946
|
+
}
|
|
34947
|
+
}
|
|
34948
|
+
loadQueryError(data2) {
|
|
34949
|
+
return data2.Errors?.[0]?.Error ?? data2.Errors?.Error ?? data2.Error;
|
|
34950
|
+
}
|
|
34951
|
+
loadQueryErrorMessage(data2) {
|
|
34952
|
+
const errorData = this.loadQueryError(data2);
|
|
34953
|
+
return errorData?.message ?? errorData?.Message ?? data2.message ?? data2.Message ?? "Unknown";
|
|
34954
|
+
}
|
|
34955
|
+
getDefaultContentType() {
|
|
34956
|
+
return "application/x-www-form-urlencoded";
|
|
34957
|
+
}
|
|
34958
|
+
};
|
|
34959
|
+
}
|
|
34960
|
+
});
|
|
34961
|
+
|
|
34962
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js
|
|
34963
|
+
var AwsEc2QueryProtocol2;
|
|
34964
|
+
var init_AwsEc2QueryProtocol2 = __esm({
|
|
34965
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js"() {
|
|
34966
|
+
init_AwsQueryProtocol2();
|
|
34967
|
+
AwsEc2QueryProtocol2 = class extends AwsQueryProtocol2 {
|
|
34968
|
+
options;
|
|
34969
|
+
constructor(options) {
|
|
34970
|
+
super(options);
|
|
34971
|
+
this.options = options;
|
|
34972
|
+
const ec2Settings = {
|
|
34973
|
+
capitalizeKeys: true,
|
|
34974
|
+
flattenLists: true,
|
|
34975
|
+
serializeEmptyLists: false,
|
|
34976
|
+
ec2: true
|
|
34977
|
+
};
|
|
34978
|
+
Object.assign(this.serializer.settings, ec2Settings);
|
|
34979
|
+
}
|
|
34980
|
+
getShapeId() {
|
|
34981
|
+
return "aws.protocols#ec2Query";
|
|
34982
|
+
}
|
|
34983
|
+
useNestedResult() {
|
|
34984
|
+
return false;
|
|
34985
|
+
}
|
|
34986
|
+
};
|
|
34987
|
+
}
|
|
34988
|
+
});
|
|
34989
|
+
|
|
34990
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js
|
|
34991
|
+
var init_QuerySerializerSettings2 = __esm({
|
|
34992
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QuerySerializerSettings.js"() {
|
|
34993
|
+
}
|
|
34994
|
+
});
|
|
34995
|
+
|
|
34996
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js
|
|
34997
|
+
var import_xml_builder5, import_smithy_client42, parseXmlBody2, parseXmlErrorBody2, loadRestXmlErrorCode2;
|
|
34998
|
+
var init_parseXmlBody2 = __esm({
|
|
34999
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/parseXmlBody.js"() {
|
|
35000
|
+
import_xml_builder5 = __toESM(require_dist_cjs29());
|
|
35001
|
+
import_smithy_client42 = __toESM(require_dist_cjs27());
|
|
35002
|
+
init_common2();
|
|
35003
|
+
parseXmlBody2 = (streamBody, context) => collectBodyString2(streamBody, context).then((encoded) => {
|
|
35004
|
+
if (encoded.length) {
|
|
35005
|
+
let parsedObj;
|
|
35006
|
+
try {
|
|
35007
|
+
parsedObj = (0, import_xml_builder5.parseXML)(encoded);
|
|
35008
|
+
} catch (e5) {
|
|
35009
|
+
if (e5 && typeof e5 === "object") {
|
|
35010
|
+
Object.defineProperty(e5, "$responseBodyText", {
|
|
35011
|
+
value: encoded
|
|
35012
|
+
});
|
|
35013
|
+
}
|
|
35014
|
+
throw e5;
|
|
35015
|
+
}
|
|
35016
|
+
const textNodeName = "#text";
|
|
35017
|
+
const key = Object.keys(parsedObj)[0];
|
|
35018
|
+
const parsedObjToReturn = parsedObj[key];
|
|
35019
|
+
if (parsedObjToReturn[textNodeName]) {
|
|
35020
|
+
parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
|
|
35021
|
+
delete parsedObjToReturn[textNodeName];
|
|
35022
|
+
}
|
|
35023
|
+
return (0, import_smithy_client42.getValueFromTextNode)(parsedObjToReturn);
|
|
35024
|
+
}
|
|
35025
|
+
return {};
|
|
35026
|
+
});
|
|
35027
|
+
parseXmlErrorBody2 = async (errorBody, context) => {
|
|
35028
|
+
const value = await parseXmlBody2(errorBody, context);
|
|
35029
|
+
if (value.Error) {
|
|
35030
|
+
value.Error.message = value.Error.message ?? value.Error.Message;
|
|
35031
|
+
}
|
|
35032
|
+
return value;
|
|
35033
|
+
};
|
|
35034
|
+
loadRestXmlErrorCode2 = (output, data2) => {
|
|
35035
|
+
if (data2?.Error?.Code !== void 0) {
|
|
35036
|
+
return data2.Error.Code;
|
|
35037
|
+
}
|
|
35038
|
+
if (data2?.Code !== void 0) {
|
|
35039
|
+
return data2.Code;
|
|
35040
|
+
}
|
|
35041
|
+
if (output.statusCode == 404) {
|
|
35042
|
+
return "NotFound";
|
|
35043
|
+
}
|
|
35044
|
+
};
|
|
35045
|
+
}
|
|
35046
|
+
});
|
|
35047
|
+
|
|
35048
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js
|
|
35049
|
+
var import_xml_builder6, import_smithy_client43, import_util_base6415, XmlShapeSerializer2;
|
|
35050
|
+
var init_XmlShapeSerializer2 = __esm({
|
|
35051
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js"() {
|
|
35052
|
+
import_xml_builder6 = __toESM(require_dist_cjs29());
|
|
35053
|
+
init_protocols();
|
|
35054
|
+
init_schema();
|
|
35055
|
+
init_serde();
|
|
35056
|
+
import_smithy_client43 = __toESM(require_dist_cjs27());
|
|
35057
|
+
import_util_base6415 = __toESM(require_dist_cjs7());
|
|
35058
|
+
init_ConfigurableSerdeContext2();
|
|
35059
|
+
XmlShapeSerializer2 = class extends SerdeContextConfig2 {
|
|
35060
|
+
settings;
|
|
35061
|
+
stringBuffer;
|
|
35062
|
+
byteBuffer;
|
|
35063
|
+
buffer;
|
|
35064
|
+
constructor(settings) {
|
|
35065
|
+
super();
|
|
35066
|
+
this.settings = settings;
|
|
35067
|
+
}
|
|
35068
|
+
write(schema, value) {
|
|
35069
|
+
const ns = NormalizedSchema.of(schema);
|
|
35070
|
+
if (ns.isStringSchema() && typeof value === "string") {
|
|
35071
|
+
this.stringBuffer = value;
|
|
35072
|
+
} else if (ns.isBlobSchema()) {
|
|
35073
|
+
this.byteBuffer = "byteLength" in value ? value : (this.serdeContext?.base64Decoder ?? import_util_base6415.fromBase64)(value);
|
|
35074
|
+
} else {
|
|
35075
|
+
this.buffer = this.writeStruct(ns, value, void 0);
|
|
35076
|
+
const traits = ns.getMergedTraits();
|
|
35077
|
+
if (traits.httpPayload && !traits.xmlName) {
|
|
35078
|
+
this.buffer.withName(ns.getName());
|
|
35079
|
+
}
|
|
35080
|
+
}
|
|
35081
|
+
}
|
|
35082
|
+
flush() {
|
|
35083
|
+
if (this.byteBuffer !== void 0) {
|
|
35084
|
+
const bytes = this.byteBuffer;
|
|
35085
|
+
delete this.byteBuffer;
|
|
35086
|
+
return bytes;
|
|
35087
|
+
}
|
|
35088
|
+
if (this.stringBuffer !== void 0) {
|
|
35089
|
+
const str = this.stringBuffer;
|
|
35090
|
+
delete this.stringBuffer;
|
|
35091
|
+
return str;
|
|
35092
|
+
}
|
|
35093
|
+
const buffer = this.buffer;
|
|
35094
|
+
if (this.settings.xmlNamespace) {
|
|
35095
|
+
if (!buffer?.attributes?.["xmlns"]) {
|
|
35096
|
+
buffer.addAttribute("xmlns", this.settings.xmlNamespace);
|
|
35097
|
+
}
|
|
35098
|
+
}
|
|
35099
|
+
delete this.buffer;
|
|
35100
|
+
return buffer.toString();
|
|
35101
|
+
}
|
|
35102
|
+
writeStruct(ns, value, parentXmlns) {
|
|
35103
|
+
const traits = ns.getMergedTraits();
|
|
35104
|
+
const name2 = ns.isMemberSchema() && !traits.httpPayload ? ns.getMemberTraits().xmlName ?? ns.getMemberName() : traits.xmlName ?? ns.getName();
|
|
35105
|
+
if (!name2 || !ns.isStructSchema()) {
|
|
35106
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`);
|
|
35107
|
+
}
|
|
35108
|
+
const structXmlNode = import_xml_builder6.XmlNode.of(name2);
|
|
35109
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
|
35110
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
35111
|
+
const val = value[memberName];
|
|
35112
|
+
if (val != null || memberSchema.isIdempotencyToken()) {
|
|
35113
|
+
if (memberSchema.getMergedTraits().xmlAttribute) {
|
|
35114
|
+
structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val));
|
|
35115
|
+
continue;
|
|
35116
|
+
}
|
|
35117
|
+
if (memberSchema.isListSchema()) {
|
|
35118
|
+
this.writeList(memberSchema, val, structXmlNode, xmlns);
|
|
35119
|
+
} else if (memberSchema.isMapSchema()) {
|
|
35120
|
+
this.writeMap(memberSchema, val, structXmlNode, xmlns);
|
|
35121
|
+
} else if (memberSchema.isStructSchema()) {
|
|
35122
|
+
structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns));
|
|
35123
|
+
} else {
|
|
35124
|
+
const memberNode = import_xml_builder6.XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName());
|
|
35125
|
+
this.writeSimpleInto(memberSchema, val, memberNode, xmlns);
|
|
35126
|
+
structXmlNode.addChildNode(memberNode);
|
|
35127
|
+
}
|
|
35128
|
+
}
|
|
35129
|
+
}
|
|
35130
|
+
const { $unknown } = value;
|
|
35131
|
+
if ($unknown && ns.isUnionSchema() && Array.isArray($unknown) && Object.keys(value).length === 1) {
|
|
35132
|
+
const [k5, v5] = $unknown;
|
|
35133
|
+
const node = import_xml_builder6.XmlNode.of(k5);
|
|
35134
|
+
if (typeof v5 !== "string") {
|
|
35135
|
+
if (value instanceof import_xml_builder6.XmlNode || value instanceof import_xml_builder6.XmlText) {
|
|
35136
|
+
structXmlNode.addChildNode(value);
|
|
35137
|
+
} else {
|
|
35138
|
+
throw new Error(`@aws-sdk - $unknown union member in XML requires value of type string, @aws-sdk/xml-builder::XmlNode or XmlText.`);
|
|
35139
|
+
}
|
|
35140
|
+
}
|
|
35141
|
+
this.writeSimpleInto(0, v5, node, xmlns);
|
|
35142
|
+
structXmlNode.addChildNode(node);
|
|
35143
|
+
}
|
|
35144
|
+
if (xmlns) {
|
|
35145
|
+
structXmlNode.addAttribute(xmlnsAttr, xmlns);
|
|
35146
|
+
}
|
|
35147
|
+
return structXmlNode;
|
|
35148
|
+
}
|
|
35149
|
+
writeList(listMember, array, container, parentXmlns) {
|
|
35150
|
+
if (!listMember.isMemberSchema()) {
|
|
35151
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);
|
|
35152
|
+
}
|
|
35153
|
+
const listTraits = listMember.getMergedTraits();
|
|
35154
|
+
const listValueSchema = listMember.getValueSchema();
|
|
35155
|
+
const listValueTraits = listValueSchema.getMergedTraits();
|
|
35156
|
+
const sparse = !!listValueTraits.sparse;
|
|
35157
|
+
const flat = !!listTraits.xmlFlattened;
|
|
35158
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns);
|
|
35159
|
+
const writeItem = (container2, value) => {
|
|
35160
|
+
if (listValueSchema.isListSchema()) {
|
|
35161
|
+
this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container2, xmlns);
|
|
35162
|
+
} else if (listValueSchema.isMapSchema()) {
|
|
35163
|
+
this.writeMap(listValueSchema, value, container2, xmlns);
|
|
35164
|
+
} else if (listValueSchema.isStructSchema()) {
|
|
35165
|
+
const struct2 = this.writeStruct(listValueSchema, value, xmlns);
|
|
35166
|
+
container2.addChildNode(struct2.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"));
|
|
35167
|
+
} else {
|
|
35168
|
+
const listItemNode = import_xml_builder6.XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member");
|
|
35169
|
+
this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns);
|
|
35170
|
+
container2.addChildNode(listItemNode);
|
|
35171
|
+
}
|
|
35172
|
+
};
|
|
35173
|
+
if (flat) {
|
|
35174
|
+
for (const value of array) {
|
|
35175
|
+
if (sparse || value != null) {
|
|
35176
|
+
writeItem(container, value);
|
|
35177
|
+
}
|
|
35178
|
+
}
|
|
35179
|
+
} else {
|
|
35180
|
+
const listNode = import_xml_builder6.XmlNode.of(listTraits.xmlName ?? listMember.getMemberName());
|
|
35181
|
+
if (xmlns) {
|
|
35182
|
+
listNode.addAttribute(xmlnsAttr, xmlns);
|
|
35183
|
+
}
|
|
35184
|
+
for (const value of array) {
|
|
35185
|
+
if (sparse || value != null) {
|
|
35186
|
+
writeItem(listNode, value);
|
|
35187
|
+
}
|
|
35188
|
+
}
|
|
35189
|
+
container.addChildNode(listNode);
|
|
35190
|
+
}
|
|
35191
|
+
}
|
|
35192
|
+
writeMap(mapMember, map2, container, parentXmlns, containerIsMap = false) {
|
|
35193
|
+
if (!mapMember.isMemberSchema()) {
|
|
35194
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`);
|
|
35195
|
+
}
|
|
35196
|
+
const mapTraits = mapMember.getMergedTraits();
|
|
35197
|
+
const mapKeySchema = mapMember.getKeySchema();
|
|
35198
|
+
const mapKeyTraits = mapKeySchema.getMergedTraits();
|
|
35199
|
+
const keyTag = mapKeyTraits.xmlName ?? "key";
|
|
35200
|
+
const mapValueSchema = mapMember.getValueSchema();
|
|
35201
|
+
const mapValueTraits = mapValueSchema.getMergedTraits();
|
|
35202
|
+
const valueTag = mapValueTraits.xmlName ?? "value";
|
|
35203
|
+
const sparse = !!mapValueTraits.sparse;
|
|
35204
|
+
const flat = !!mapTraits.xmlFlattened;
|
|
35205
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns);
|
|
35206
|
+
const addKeyValue = (entry, key, val) => {
|
|
35207
|
+
const keyNode = import_xml_builder6.XmlNode.of(keyTag, key);
|
|
35208
|
+
const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns);
|
|
35209
|
+
if (keyXmlns) {
|
|
35210
|
+
keyNode.addAttribute(keyXmlnsAttr, keyXmlns);
|
|
35211
|
+
}
|
|
35212
|
+
entry.addChildNode(keyNode);
|
|
35213
|
+
let valueNode = import_xml_builder6.XmlNode.of(valueTag);
|
|
35214
|
+
if (mapValueSchema.isListSchema()) {
|
|
35215
|
+
this.writeList(mapValueSchema, val, valueNode, xmlns);
|
|
35216
|
+
} else if (mapValueSchema.isMapSchema()) {
|
|
35217
|
+
this.writeMap(mapValueSchema, val, valueNode, xmlns, true);
|
|
35218
|
+
} else if (mapValueSchema.isStructSchema()) {
|
|
35219
|
+
valueNode = this.writeStruct(mapValueSchema, val, xmlns);
|
|
35220
|
+
} else {
|
|
35221
|
+
this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns);
|
|
35222
|
+
}
|
|
35223
|
+
entry.addChildNode(valueNode);
|
|
35224
|
+
};
|
|
35225
|
+
if (flat) {
|
|
35226
|
+
for (const [key, val] of Object.entries(map2)) {
|
|
35227
|
+
if (sparse || val != null) {
|
|
35228
|
+
const entry = import_xml_builder6.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
|
35229
|
+
addKeyValue(entry, key, val);
|
|
35230
|
+
container.addChildNode(entry);
|
|
35231
|
+
}
|
|
35232
|
+
}
|
|
35233
|
+
} else {
|
|
35234
|
+
let mapNode;
|
|
35235
|
+
if (!containerIsMap) {
|
|
35236
|
+
mapNode = import_xml_builder6.XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
|
35237
|
+
if (xmlns) {
|
|
35238
|
+
mapNode.addAttribute(xmlnsAttr, xmlns);
|
|
35239
|
+
}
|
|
35240
|
+
container.addChildNode(mapNode);
|
|
35241
|
+
}
|
|
35242
|
+
for (const [key, val] of Object.entries(map2)) {
|
|
35243
|
+
if (sparse || val != null) {
|
|
35244
|
+
const entry = import_xml_builder6.XmlNode.of("entry");
|
|
35245
|
+
addKeyValue(entry, key, val);
|
|
35246
|
+
(containerIsMap ? container : mapNode).addChildNode(entry);
|
|
35247
|
+
}
|
|
35248
|
+
}
|
|
35249
|
+
}
|
|
35250
|
+
}
|
|
35251
|
+
writeSimple(_schema, value) {
|
|
35252
|
+
if (null === value) {
|
|
35253
|
+
throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");
|
|
35254
|
+
}
|
|
35255
|
+
const ns = NormalizedSchema.of(_schema);
|
|
35256
|
+
let nodeContents = null;
|
|
35257
|
+
if (value && typeof value === "object") {
|
|
35258
|
+
if (ns.isBlobSchema()) {
|
|
35259
|
+
nodeContents = (this.serdeContext?.base64Encoder ?? import_util_base6415.toBase64)(value);
|
|
35260
|
+
} else if (ns.isTimestampSchema() && value instanceof Date) {
|
|
35261
|
+
const format2 = determineTimestampFormat(ns, this.settings);
|
|
35262
|
+
switch (format2) {
|
|
35263
|
+
case 5:
|
|
35264
|
+
nodeContents = value.toISOString().replace(".000Z", "Z");
|
|
35265
|
+
break;
|
|
35266
|
+
case 6:
|
|
35267
|
+
nodeContents = (0, import_smithy_client43.dateToUtcString)(value);
|
|
35268
|
+
break;
|
|
35269
|
+
case 7:
|
|
35270
|
+
nodeContents = String(value.getTime() / 1e3);
|
|
35271
|
+
break;
|
|
35272
|
+
default:
|
|
35273
|
+
console.warn("Missing timestamp format, using http date", value);
|
|
35274
|
+
nodeContents = (0, import_smithy_client43.dateToUtcString)(value);
|
|
35275
|
+
break;
|
|
35276
|
+
}
|
|
35277
|
+
} else if (ns.isBigDecimalSchema() && value) {
|
|
35278
|
+
if (value instanceof NumericValue) {
|
|
35279
|
+
return value.string;
|
|
35280
|
+
}
|
|
35281
|
+
return String(value);
|
|
35282
|
+
} else if (ns.isMapSchema() || ns.isListSchema()) {
|
|
35283
|
+
throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");
|
|
35284
|
+
} else {
|
|
35285
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`);
|
|
35286
|
+
}
|
|
35287
|
+
}
|
|
35288
|
+
if (ns.isBooleanSchema() || ns.isNumericSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
|
|
35289
|
+
nodeContents = String(value);
|
|
35290
|
+
}
|
|
35291
|
+
if (ns.isStringSchema()) {
|
|
35292
|
+
if (value === void 0 && ns.isIdempotencyToken()) {
|
|
35293
|
+
nodeContents = (0, import_uuid.v4)();
|
|
35294
|
+
} else {
|
|
35295
|
+
nodeContents = String(value);
|
|
35296
|
+
}
|
|
35297
|
+
}
|
|
35298
|
+
if (nodeContents === null) {
|
|
35299
|
+
throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`);
|
|
35300
|
+
}
|
|
35301
|
+
return nodeContents;
|
|
35302
|
+
}
|
|
35303
|
+
writeSimpleInto(_schema, value, into, parentXmlns) {
|
|
35304
|
+
const nodeContents = this.writeSimple(_schema, value);
|
|
35305
|
+
const ns = NormalizedSchema.of(_schema);
|
|
35306
|
+
const content = new import_xml_builder6.XmlText(nodeContents);
|
|
35307
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
|
35308
|
+
if (xmlns) {
|
|
35309
|
+
into.addAttribute(xmlnsAttr, xmlns);
|
|
35310
|
+
}
|
|
35311
|
+
into.addChildNode(content);
|
|
35312
|
+
}
|
|
35313
|
+
getXmlnsAttribute(ns, parentXmlns) {
|
|
35314
|
+
const traits = ns.getMergedTraits();
|
|
35315
|
+
const [prefix, xmlns] = traits.xmlNamespace ?? [];
|
|
35316
|
+
if (xmlns && xmlns !== parentXmlns) {
|
|
35317
|
+
return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns];
|
|
35318
|
+
}
|
|
35319
|
+
return [void 0, void 0];
|
|
35320
|
+
}
|
|
35321
|
+
};
|
|
35322
|
+
}
|
|
35323
|
+
});
|
|
35324
|
+
|
|
35325
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js
|
|
35326
|
+
var XmlCodec2;
|
|
35327
|
+
var init_XmlCodec2 = __esm({
|
|
35328
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js"() {
|
|
35329
|
+
init_ConfigurableSerdeContext2();
|
|
35330
|
+
init_XmlShapeDeserializer2();
|
|
35331
|
+
init_XmlShapeSerializer2();
|
|
35332
|
+
XmlCodec2 = class extends SerdeContextConfig2 {
|
|
35333
|
+
settings;
|
|
35334
|
+
constructor(settings) {
|
|
35335
|
+
super();
|
|
35336
|
+
this.settings = settings;
|
|
35337
|
+
}
|
|
35338
|
+
createSerializer() {
|
|
35339
|
+
const serializer = new XmlShapeSerializer2(this.settings);
|
|
35340
|
+
serializer.setSerdeContext(this.serdeContext);
|
|
35341
|
+
return serializer;
|
|
35342
|
+
}
|
|
35343
|
+
createDeserializer() {
|
|
35344
|
+
const deserializer = new XmlShapeDeserializer2(this.settings);
|
|
35345
|
+
deserializer.setSerdeContext(this.serdeContext);
|
|
35346
|
+
return deserializer;
|
|
35347
|
+
}
|
|
35348
|
+
};
|
|
35349
|
+
}
|
|
35350
|
+
});
|
|
35351
|
+
|
|
35352
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js
|
|
35353
|
+
var AwsRestXmlProtocol2;
|
|
35354
|
+
var init_AwsRestXmlProtocol2 = __esm({
|
|
35355
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js"() {
|
|
35356
|
+
init_protocols();
|
|
35357
|
+
init_schema();
|
|
35358
|
+
init_ProtocolLib2();
|
|
35359
|
+
init_parseXmlBody2();
|
|
35360
|
+
init_XmlCodec2();
|
|
35361
|
+
AwsRestXmlProtocol2 = class extends HttpBindingProtocol {
|
|
35362
|
+
codec;
|
|
35363
|
+
serializer;
|
|
35364
|
+
deserializer;
|
|
35365
|
+
mixin = new ProtocolLib2();
|
|
35366
|
+
constructor(options) {
|
|
35367
|
+
super(options);
|
|
35368
|
+
const settings = {
|
|
35369
|
+
timestampFormat: {
|
|
35370
|
+
useTrait: true,
|
|
35371
|
+
default: 5
|
|
35372
|
+
},
|
|
35373
|
+
httpBindings: true,
|
|
35374
|
+
xmlNamespace: options.xmlNamespace,
|
|
35375
|
+
serviceNamespace: options.defaultNamespace
|
|
35376
|
+
};
|
|
35377
|
+
this.codec = new XmlCodec2(settings);
|
|
35378
|
+
this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
|
|
35379
|
+
this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
|
|
35380
|
+
this.compositeErrorRegistry;
|
|
35381
|
+
}
|
|
35382
|
+
getPayloadCodec() {
|
|
35383
|
+
return this.codec;
|
|
35384
|
+
}
|
|
35385
|
+
getShapeId() {
|
|
35386
|
+
return "aws.protocols#restXml";
|
|
35387
|
+
}
|
|
35388
|
+
async serializeRequest(operationSchema, input, context) {
|
|
35389
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
35390
|
+
const inputSchema = NormalizedSchema.of(operationSchema.input);
|
|
35391
|
+
if (!request.headers["content-type"]) {
|
|
35392
|
+
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
35393
|
+
if (contentType) {
|
|
35394
|
+
request.headers["content-type"] = contentType;
|
|
35395
|
+
}
|
|
35396
|
+
}
|
|
35397
|
+
if (typeof request.body === "string" && request.headers["content-type"] === this.getDefaultContentType() && !request.body.startsWith("<?xml ") && !this.hasUnstructuredPayloadBinding(inputSchema)) {
|
|
35398
|
+
request.body = '<?xml version="1.0" encoding="UTF-8"?>' + request.body;
|
|
35399
|
+
}
|
|
35400
|
+
return request;
|
|
35401
|
+
}
|
|
35402
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
35403
|
+
return super.deserializeResponse(operationSchema, context, response);
|
|
35404
|
+
}
|
|
35405
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
35406
|
+
const errorIdentifier = loadRestXmlErrorCode2(response, dataObject) ?? "Unknown";
|
|
35407
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
35408
|
+
if (dataObject.Error && typeof dataObject.Error === "object") {
|
|
35409
|
+
for (const key of Object.keys(dataObject.Error)) {
|
|
35410
|
+
dataObject[key] = dataObject.Error[key];
|
|
35411
|
+
if (key.toLowerCase() === "message") {
|
|
35412
|
+
dataObject.message = dataObject.Error[key];
|
|
35413
|
+
}
|
|
35414
|
+
}
|
|
35415
|
+
}
|
|
35416
|
+
if (dataObject.RequestId && !metadata.requestId) {
|
|
35417
|
+
metadata.requestId = dataObject.RequestId;
|
|
35418
|
+
}
|
|
35419
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
35420
|
+
const ns = NormalizedSchema.of(errorSchema);
|
|
35421
|
+
const message = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
35422
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
35423
|
+
const exception = new ErrorCtor(message);
|
|
35424
|
+
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
35425
|
+
const output = {};
|
|
35426
|
+
const errorDeserializer = this.codec.createDeserializer();
|
|
35427
|
+
for (const [name2, member2] of ns.structIterator()) {
|
|
35428
|
+
const target = member2.getMergedTraits().xmlName ?? name2;
|
|
35429
|
+
const value = dataObject.Error?.[target] ?? dataObject[target];
|
|
35430
|
+
output[name2] = errorDeserializer.readSchema(member2, value);
|
|
35431
|
+
}
|
|
35432
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
35433
|
+
$fault: ns.getMergedTraits().error,
|
|
35434
|
+
message
|
|
35435
|
+
}, output), dataObject);
|
|
35436
|
+
}
|
|
35437
|
+
getDefaultContentType() {
|
|
35438
|
+
return "application/xml";
|
|
35439
|
+
}
|
|
35440
|
+
hasUnstructuredPayloadBinding(ns) {
|
|
35441
|
+
for (const [, member2] of ns.structIterator()) {
|
|
35442
|
+
if (member2.getMergedTraits().httpPayload) {
|
|
35443
|
+
return !(member2.isStructSchema() || member2.isMapSchema() || member2.isListSchema());
|
|
35444
|
+
}
|
|
35445
|
+
}
|
|
35446
|
+
return false;
|
|
35447
|
+
}
|
|
35448
|
+
};
|
|
35449
|
+
}
|
|
35450
|
+
});
|
|
35451
|
+
|
|
35452
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js
|
|
35453
|
+
var protocols_exports3 = {};
|
|
35454
|
+
__export(protocols_exports3, {
|
|
35455
|
+
AwsEc2QueryProtocol: () => AwsEc2QueryProtocol2,
|
|
35456
|
+
AwsJson1_0Protocol: () => AwsJson1_0Protocol2,
|
|
35457
|
+
AwsJson1_1Protocol: () => AwsJson1_1Protocol2,
|
|
35458
|
+
AwsJsonRpcProtocol: () => AwsJsonRpcProtocol2,
|
|
35459
|
+
AwsQueryProtocol: () => AwsQueryProtocol2,
|
|
35460
|
+
AwsRestJsonProtocol: () => AwsRestJsonProtocol2,
|
|
35461
|
+
AwsRestXmlProtocol: () => AwsRestXmlProtocol2,
|
|
35462
|
+
AwsSmithyRpcV2CborProtocol: () => AwsSmithyRpcV2CborProtocol2,
|
|
35463
|
+
JsonCodec: () => JsonCodec2,
|
|
35464
|
+
JsonShapeDeserializer: () => JsonShapeDeserializer2,
|
|
35465
|
+
JsonShapeSerializer: () => JsonShapeSerializer2,
|
|
35466
|
+
QueryShapeSerializer: () => QueryShapeSerializer2,
|
|
35467
|
+
XmlCodec: () => XmlCodec2,
|
|
35468
|
+
XmlShapeDeserializer: () => XmlShapeDeserializer2,
|
|
35469
|
+
XmlShapeSerializer: () => XmlShapeSerializer2,
|
|
35470
|
+
_toBool: () => _toBool2,
|
|
35471
|
+
_toNum: () => _toNum2,
|
|
35472
|
+
_toStr: () => _toStr2,
|
|
35473
|
+
awsExpectUnion: () => awsExpectUnion2,
|
|
35474
|
+
loadRestJsonErrorCode: () => loadRestJsonErrorCode2,
|
|
35475
|
+
loadRestXmlErrorCode: () => loadRestXmlErrorCode2,
|
|
35476
|
+
parseJsonBody: () => parseJsonBody2,
|
|
35477
|
+
parseJsonErrorBody: () => parseJsonErrorBody2,
|
|
35478
|
+
parseXmlBody: () => parseXmlBody2,
|
|
35479
|
+
parseXmlErrorBody: () => parseXmlErrorBody2
|
|
35480
|
+
});
|
|
35481
|
+
var init_protocols3 = __esm({
|
|
35482
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js"() {
|
|
35483
|
+
init_AwsSmithyRpcV2CborProtocol2();
|
|
35484
|
+
init_coercing_serializers2();
|
|
35485
|
+
init_AwsJson1_0Protocol2();
|
|
35486
|
+
init_AwsJson1_1Protocol2();
|
|
35487
|
+
init_AwsJsonRpcProtocol2();
|
|
35488
|
+
init_AwsRestJsonProtocol2();
|
|
35489
|
+
init_JsonCodec2();
|
|
35490
|
+
init_JsonShapeDeserializer2();
|
|
35491
|
+
init_JsonShapeSerializer2();
|
|
35492
|
+
init_awsExpectUnion2();
|
|
35493
|
+
init_parseJsonBody2();
|
|
35494
|
+
init_AwsEc2QueryProtocol2();
|
|
35495
|
+
init_AwsQueryProtocol2();
|
|
35496
|
+
init_QuerySerializerSettings2();
|
|
35497
|
+
init_QueryShapeSerializer2();
|
|
35498
|
+
init_AwsRestXmlProtocol2();
|
|
35499
|
+
init_XmlCodec2();
|
|
35500
|
+
init_XmlShapeDeserializer2();
|
|
35501
|
+
init_XmlShapeSerializer2();
|
|
35502
|
+
init_parseXmlBody2();
|
|
35503
|
+
}
|
|
35504
|
+
});
|
|
35505
|
+
|
|
35506
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js
|
|
35507
|
+
var state2, emitWarningIfUnsupportedVersion6;
|
|
35508
|
+
var init_emitWarningIfUnsupportedVersion2 = __esm({
|
|
35509
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/emitWarningIfUnsupportedVersion.js"() {
|
|
35510
|
+
state2 = {
|
|
35511
|
+
warningEmitted: false
|
|
35512
|
+
};
|
|
35513
|
+
emitWarningIfUnsupportedVersion6 = (version) => {
|
|
35514
|
+
if (version && !state2.warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 20) {
|
|
35515
|
+
state2.warningEmitted = true;
|
|
35516
|
+
process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
35517
|
+
no longer support Node.js ${version} in January 2026.
|
|
35518
|
+
|
|
35519
|
+
To continue receiving updates to AWS services, bug fixes, and security
|
|
35520
|
+
updates please upgrade to a supported Node.js LTS version.
|
|
35521
|
+
|
|
35522
|
+
More information can be found at: https://a.co/c895JFp`);
|
|
35523
|
+
}
|
|
35524
|
+
};
|
|
35525
|
+
}
|
|
35526
|
+
});
|
|
35527
|
+
|
|
35528
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js
|
|
35529
|
+
var longPollMiddleware2, longPollMiddlewareOptions2, getLongPollPlugin2;
|
|
35530
|
+
var init_longPollMiddleware2 = __esm({
|
|
35531
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/longPollMiddleware.js"() {
|
|
35532
|
+
longPollMiddleware2 = () => (next, context) => async (args) => {
|
|
35533
|
+
context.__retryLongPoll = true;
|
|
35534
|
+
return next(args);
|
|
35535
|
+
};
|
|
35536
|
+
longPollMiddlewareOptions2 = {
|
|
35537
|
+
name: "longPollMiddleware",
|
|
35538
|
+
tags: ["RETRY"],
|
|
35539
|
+
step: "initialize",
|
|
35540
|
+
override: true
|
|
35541
|
+
};
|
|
35542
|
+
getLongPollPlugin2 = (options) => ({
|
|
35543
|
+
applyToStack: (clientStack) => {
|
|
35544
|
+
clientStack.add(longPollMiddleware2(), longPollMiddlewareOptions2);
|
|
35545
|
+
}
|
|
35546
|
+
});
|
|
35547
|
+
}
|
|
35548
|
+
});
|
|
35549
|
+
|
|
35550
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js
|
|
35551
|
+
function setCredentialFeature2(credentials, feature, value) {
|
|
35552
|
+
if (!credentials.$source) {
|
|
35553
|
+
credentials.$source = {};
|
|
35554
|
+
}
|
|
35555
|
+
credentials.$source[feature] = value;
|
|
35556
|
+
return credentials;
|
|
35557
|
+
}
|
|
35558
|
+
var init_setCredentialFeature2 = __esm({
|
|
35559
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setCredentialFeature.js"() {
|
|
35560
|
+
}
|
|
35561
|
+
});
|
|
35562
|
+
|
|
35563
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js
|
|
35564
|
+
function setFeature3(context, feature, value) {
|
|
35565
|
+
if (!context.__aws_sdk_context) {
|
|
35566
|
+
context.__aws_sdk_context = {
|
|
35567
|
+
features: {}
|
|
35568
|
+
};
|
|
35569
|
+
} else if (!context.__aws_sdk_context.features) {
|
|
35570
|
+
context.__aws_sdk_context.features = {};
|
|
35571
|
+
}
|
|
35572
|
+
context.__aws_sdk_context.features[feature] = value;
|
|
35573
|
+
}
|
|
35574
|
+
var init_setFeature3 = __esm({
|
|
35575
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setFeature.js"() {
|
|
35576
|
+
}
|
|
35577
|
+
});
|
|
35578
|
+
|
|
35579
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js
|
|
35580
|
+
function setTokenFeature2(token, feature, value) {
|
|
35581
|
+
if (!token.$source) {
|
|
35582
|
+
token.$source = {};
|
|
35583
|
+
}
|
|
35584
|
+
token.$source[feature] = value;
|
|
35585
|
+
return token;
|
|
35586
|
+
}
|
|
35587
|
+
var init_setTokenFeature2 = __esm({
|
|
35588
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/setTokenFeature.js"() {
|
|
35589
|
+
}
|
|
35590
|
+
});
|
|
35591
|
+
|
|
35592
|
+
// node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js
|
|
35593
|
+
var client_exports2 = {};
|
|
35594
|
+
__export(client_exports2, {
|
|
35595
|
+
emitWarningIfUnsupportedVersion: () => emitWarningIfUnsupportedVersion6,
|
|
35596
|
+
getLongPollPlugin: () => getLongPollPlugin2,
|
|
35597
|
+
setCredentialFeature: () => setCredentialFeature2,
|
|
35598
|
+
setFeature: () => setFeature3,
|
|
35599
|
+
setTokenFeature: () => setTokenFeature2,
|
|
35600
|
+
state: () => state2
|
|
35601
|
+
});
|
|
35602
|
+
var init_client2 = __esm({
|
|
35603
|
+
"node_modules/.pnpm/@aws-sdk+core@3.974.1/node_modules/@aws-sdk/core/dist-es/submodules/client/index.js"() {
|
|
35604
|
+
init_emitWarningIfUnsupportedVersion2();
|
|
35605
|
+
init_longPollMiddleware2();
|
|
35606
|
+
init_setCredentialFeature2();
|
|
35607
|
+
init_setFeature3();
|
|
35608
|
+
init_setTokenFeature2();
|
|
35609
|
+
}
|
|
35610
|
+
});
|
|
35611
|
+
|
|
35612
|
+
// node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.30/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js
|
|
35613
|
+
var require_dist_cjs73 = __commonJS({
|
|
35614
|
+
"node_modules/.pnpm/@aws-sdk+middleware-sdk-s3@3.972.30/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js"(exports2) {
|
|
35615
|
+
"use strict";
|
|
35616
|
+
var protocolHttp = require_dist_cjs2();
|
|
35617
|
+
var smithyClient = require_dist_cjs27();
|
|
35618
|
+
var utilStream = require_dist_cjs13();
|
|
35619
|
+
var utilArnParser = require_dist_cjs28();
|
|
35620
|
+
var protocols = (init_protocols3(), __toCommonJS(protocols_exports3));
|
|
35621
|
+
var schema = (init_schema(), __toCommonJS(schema_exports));
|
|
35622
|
+
var signatureV4 = require_dist_cjs30();
|
|
35623
|
+
var utilConfigProvider = require_dist_cjs31();
|
|
35624
|
+
var client = (init_client2(), __toCommonJS(client_exports2));
|
|
35625
|
+
var core = (init_dist_es(), __toCommonJS(dist_es_exports));
|
|
35626
|
+
var utilMiddleware = require_dist_cjs18();
|
|
35627
|
+
var CONTENT_LENGTH_HEADER = "content-length";
|
|
35628
|
+
var DECODED_CONTENT_LENGTH_HEADER = "x-amz-decoded-content-length";
|
|
35629
|
+
function checkContentLengthHeader() {
|
|
35630
|
+
return (next, context) => async (args) => {
|
|
35631
|
+
const { request } = args;
|
|
35632
|
+
if (protocolHttp.HttpRequest.isInstance(request)) {
|
|
35633
|
+
if (!(CONTENT_LENGTH_HEADER in request.headers) && !(DECODED_CONTENT_LENGTH_HEADER in request.headers)) {
|
|
35634
|
+
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.`;
|
|
35635
|
+
if (typeof context?.logger?.warn === "function" && !(context.logger instanceof smithyClient.NoOpLogger)) {
|
|
35636
|
+
context.logger.warn(message);
|
|
35637
|
+
} else {
|
|
35638
|
+
console.warn(message);
|
|
35639
|
+
}
|
|
35640
|
+
}
|
|
35641
|
+
}
|
|
35642
|
+
return next({ ...args });
|
|
35643
|
+
};
|
|
35644
|
+
}
|
|
35645
|
+
var checkContentLengthHeaderMiddlewareOptions = {
|
|
35646
|
+
step: "finalizeRequest",
|
|
35647
|
+
tags: ["CHECK_CONTENT_LENGTH_HEADER"],
|
|
35648
|
+
name: "getCheckContentLengthHeaderPlugin",
|
|
35649
|
+
override: true
|
|
35650
|
+
};
|
|
35651
|
+
var getCheckContentLengthHeaderPlugin = (unused) => ({
|
|
35652
|
+
applyToStack: (clientStack) => {
|
|
35653
|
+
clientStack.add(checkContentLengthHeader(), checkContentLengthHeaderMiddlewareOptions);
|
|
35654
|
+
}
|
|
35655
|
+
});
|
|
35656
|
+
var regionRedirectEndpointMiddleware = (config) => {
|
|
35657
|
+
return (next, context) => async (args) => {
|
|
35658
|
+
const originalRegion = await config.region();
|
|
35659
|
+
const regionProviderRef = config.region;
|
|
35660
|
+
let unlock = () => {
|
|
35661
|
+
};
|
|
35662
|
+
if (context.__s3RegionRedirect) {
|
|
35663
|
+
Object.defineProperty(config, "region", {
|
|
35664
|
+
writable: false,
|
|
35665
|
+
value: async () => {
|
|
35666
|
+
return context.__s3RegionRedirect;
|
|
35667
|
+
}
|
|
35668
|
+
});
|
|
35669
|
+
unlock = () => Object.defineProperty(config, "region", {
|
|
35670
|
+
writable: true,
|
|
35671
|
+
value: regionProviderRef
|
|
35672
|
+
});
|
|
35673
|
+
}
|
|
35674
|
+
try {
|
|
35675
|
+
const result = await next(args);
|
|
35676
|
+
if (context.__s3RegionRedirect) {
|
|
35677
|
+
unlock();
|
|
35678
|
+
const region = await config.region();
|
|
35679
|
+
if (originalRegion !== region) {
|
|
35680
|
+
throw new Error("Region was not restored following S3 region redirect.");
|
|
35681
|
+
}
|
|
35682
|
+
}
|
|
35683
|
+
return result;
|
|
35684
|
+
} catch (e5) {
|
|
35685
|
+
unlock();
|
|
35686
|
+
throw e5;
|
|
35687
|
+
}
|
|
35688
|
+
};
|
|
35689
|
+
};
|
|
35690
|
+
var regionRedirectEndpointMiddlewareOptions = {
|
|
35691
|
+
tags: ["REGION_REDIRECT", "S3"],
|
|
35692
|
+
name: "regionRedirectEndpointMiddleware",
|
|
35693
|
+
override: true,
|
|
35694
|
+
relation: "before",
|
|
35695
|
+
toMiddleware: "endpointV2Middleware"
|
|
35696
|
+
};
|
|
35697
|
+
function regionRedirectMiddleware(clientConfig) {
|
|
35698
|
+
return (next, context) => async (args) => {
|
|
35699
|
+
try {
|
|
35700
|
+
return await next(args);
|
|
35701
|
+
} catch (err) {
|
|
35702
|
+
if (clientConfig.followRegionRedirects) {
|
|
35703
|
+
const statusCode = err?.$metadata?.httpStatusCode;
|
|
35704
|
+
const isHeadBucket = context.commandName === "HeadBucketCommand";
|
|
35705
|
+
const bucketRegionHeader = err?.$response?.headers?.["x-amz-bucket-region"];
|
|
35706
|
+
if (bucketRegionHeader) {
|
|
35707
|
+
if (statusCode === 301 || statusCode === 400 && (err?.name === "IllegalLocationConstraintException" || isHeadBucket)) {
|
|
35708
|
+
try {
|
|
35709
|
+
const actualRegion = bucketRegionHeader;
|
|
35710
|
+
context.logger?.debug(`Redirecting from ${await clientConfig.region()} to ${actualRegion}`);
|
|
35711
|
+
context.__s3RegionRedirect = actualRegion;
|
|
35712
|
+
} catch (e5) {
|
|
35713
|
+
throw new Error("Region redirect failed: " + e5);
|
|
35714
|
+
}
|
|
35715
|
+
return next(args);
|
|
35716
|
+
}
|
|
35717
|
+
}
|
|
35718
|
+
}
|
|
35719
|
+
throw err;
|
|
35720
|
+
}
|
|
35721
|
+
};
|
|
35722
|
+
}
|
|
35723
|
+
var regionRedirectMiddlewareOptions = {
|
|
35724
|
+
step: "initialize",
|
|
35725
|
+
tags: ["REGION_REDIRECT", "S3"],
|
|
35726
|
+
name: "regionRedirectMiddleware",
|
|
35727
|
+
override: true
|
|
35728
|
+
};
|
|
35729
|
+
var getRegionRedirectMiddlewarePlugin = (clientConfig) => ({
|
|
35730
|
+
applyToStack: (clientStack) => {
|
|
35731
|
+
clientStack.add(regionRedirectMiddleware(clientConfig), regionRedirectMiddlewareOptions);
|
|
35732
|
+
clientStack.addRelativeTo(regionRedirectEndpointMiddleware(clientConfig), regionRedirectEndpointMiddlewareOptions);
|
|
35733
|
+
}
|
|
35734
|
+
});
|
|
35735
|
+
var s3ExpiresMiddleware = (config) => {
|
|
35736
|
+
return (next, context) => async (args) => {
|
|
35737
|
+
const result = await next(args);
|
|
35738
|
+
const { response } = result;
|
|
35739
|
+
if (protocolHttp.HttpResponse.isInstance(response)) {
|
|
35740
|
+
if (response.headers.expires) {
|
|
35741
|
+
response.headers.expiresstring = response.headers.expires;
|
|
35742
|
+
try {
|
|
35743
|
+
smithyClient.parseRfc7231DateTime(response.headers.expires);
|
|
35744
|
+
} catch (e5) {
|
|
35745
|
+
context.logger?.warn(`AWS SDK Warning for ${context.clientName}::${context.commandName} response parsing (${response.headers.expires}): ${e5}`);
|
|
35746
|
+
delete response.headers.expires;
|
|
35747
|
+
}
|
|
35748
|
+
}
|
|
35749
|
+
}
|
|
35750
|
+
return result;
|
|
35751
|
+
};
|
|
35752
|
+
};
|
|
35753
|
+
var s3ExpiresMiddlewareOptions = {
|
|
35754
|
+
tags: ["S3"],
|
|
35755
|
+
name: "s3ExpiresMiddleware",
|
|
35756
|
+
override: true,
|
|
35757
|
+
relation: "after",
|
|
35758
|
+
toMiddleware: "deserializerMiddleware"
|
|
35759
|
+
};
|
|
35760
|
+
var getS3ExpiresMiddlewarePlugin = (clientConfig) => ({
|
|
35761
|
+
applyToStack: (clientStack) => {
|
|
35762
|
+
clientStack.addRelativeTo(s3ExpiresMiddleware(), s3ExpiresMiddlewareOptions);
|
|
35763
|
+
}
|
|
35764
|
+
});
|
|
35765
|
+
var S3ExpressIdentityCache = class _S3ExpressIdentityCache {
|
|
35766
|
+
data;
|
|
35767
|
+
lastPurgeTime = Date.now();
|
|
35768
|
+
static EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS = 3e4;
|
|
35769
|
+
constructor(data2 = {}) {
|
|
35770
|
+
this.data = data2;
|
|
35771
|
+
}
|
|
35772
|
+
get(key) {
|
|
35773
|
+
const entry = this.data[key];
|
|
35774
|
+
if (!entry) {
|
|
35775
|
+
return;
|
|
35776
|
+
}
|
|
35777
|
+
return entry;
|
|
35778
|
+
}
|
|
35779
|
+
set(key, entry) {
|
|
35780
|
+
this.data[key] = entry;
|
|
35781
|
+
return entry;
|
|
35782
|
+
}
|
|
35783
|
+
delete(key) {
|
|
35784
|
+
delete this.data[key];
|
|
35785
|
+
}
|
|
35786
|
+
async purgeExpired() {
|
|
35787
|
+
const now = Date.now();
|
|
35788
|
+
if (this.lastPurgeTime + _S3ExpressIdentityCache.EXPIRED_CREDENTIAL_PURGE_INTERVAL_MS > now) {
|
|
35789
|
+
return;
|
|
35790
|
+
}
|
|
35791
|
+
for (const key in this.data) {
|
|
35792
|
+
const entry = this.data[key];
|
|
35793
|
+
if (!entry.isRefreshing) {
|
|
35794
|
+
const credential = await entry.identity;
|
|
35795
|
+
if (credential.expiration) {
|
|
35796
|
+
if (credential.expiration.getTime() < now) {
|
|
35797
|
+
delete this.data[key];
|
|
35798
|
+
}
|
|
35799
|
+
}
|
|
35800
|
+
}
|
|
35801
|
+
}
|
|
35802
|
+
}
|
|
35803
|
+
};
|
|
35804
|
+
var S3ExpressIdentityCacheEntry = class {
|
|
35805
|
+
_identity;
|
|
35806
|
+
isRefreshing;
|
|
35807
|
+
accessed;
|
|
35808
|
+
constructor(_identity, isRefreshing = false, accessed = Date.now()) {
|
|
35809
|
+
this._identity = _identity;
|
|
35810
|
+
this.isRefreshing = isRefreshing;
|
|
35811
|
+
this.accessed = accessed;
|
|
35812
|
+
}
|
|
35813
|
+
get identity() {
|
|
35814
|
+
this.accessed = Date.now();
|
|
35815
|
+
return this._identity;
|
|
35816
|
+
}
|
|
35817
|
+
};
|
|
35818
|
+
var S3ExpressIdentityProviderImpl = class _S3ExpressIdentityProviderImpl {
|
|
35819
|
+
createSessionFn;
|
|
35820
|
+
cache;
|
|
35821
|
+
static REFRESH_WINDOW_MS = 6e4;
|
|
35822
|
+
constructor(createSessionFn, cache5 = new S3ExpressIdentityCache()) {
|
|
35823
|
+
this.createSessionFn = createSessionFn;
|
|
35824
|
+
this.cache = cache5;
|
|
35825
|
+
}
|
|
35826
|
+
async getS3ExpressIdentity(awsIdentity, identityProperties) {
|
|
35827
|
+
const key = identityProperties.Bucket;
|
|
35828
|
+
const { cache: cache5 } = this;
|
|
35829
|
+
const entry = cache5.get(key);
|
|
35830
|
+
if (entry) {
|
|
35831
|
+
return entry.identity.then((identity) => {
|
|
35832
|
+
const isExpired = (identity.expiration?.getTime() ?? 0) < Date.now();
|
|
35833
|
+
if (isExpired) {
|
|
35834
|
+
return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
35835
|
+
}
|
|
35836
|
+
const isExpiringSoon = (identity.expiration?.getTime() ?? 0) < Date.now() + _S3ExpressIdentityProviderImpl.REFRESH_WINDOW_MS;
|
|
35837
|
+
if (isExpiringSoon && !entry.isRefreshing) {
|
|
35838
|
+
entry.isRefreshing = true;
|
|
35839
|
+
this.getIdentity(key).then((id) => {
|
|
35840
|
+
cache5.set(key, new S3ExpressIdentityCacheEntry(Promise.resolve(id)));
|
|
35841
|
+
});
|
|
35842
|
+
}
|
|
35843
|
+
return identity;
|
|
35844
|
+
});
|
|
35845
|
+
}
|
|
35846
|
+
return cache5.set(key, new S3ExpressIdentityCacheEntry(this.getIdentity(key))).identity;
|
|
35847
|
+
}
|
|
35848
|
+
async getIdentity(key) {
|
|
35849
|
+
await this.cache.purgeExpired().catch((error2) => {
|
|
35850
|
+
console.warn("Error while clearing expired entries in S3ExpressIdentityCache: \n" + error2);
|
|
35851
|
+
});
|
|
35852
|
+
const session = await this.createSessionFn(key);
|
|
35853
|
+
if (!session.Credentials?.AccessKeyId || !session.Credentials?.SecretAccessKey) {
|
|
35854
|
+
throw new Error("s3#createSession response credential missing AccessKeyId or SecretAccessKey.");
|
|
35855
|
+
}
|
|
35856
|
+
const identity = {
|
|
35857
|
+
accessKeyId: session.Credentials.AccessKeyId,
|
|
35858
|
+
secretAccessKey: session.Credentials.SecretAccessKey,
|
|
35859
|
+
sessionToken: session.Credentials.SessionToken,
|
|
35860
|
+
expiration: session.Credentials.Expiration ? new Date(session.Credentials.Expiration) : void 0
|
|
35861
|
+
};
|
|
35862
|
+
return identity;
|
|
35863
|
+
}
|
|
35864
|
+
};
|
|
35865
|
+
var S3_EXPRESS_BUCKET_TYPE = "Directory";
|
|
35866
|
+
var S3_EXPRESS_BACKEND = "S3Express";
|
|
35867
|
+
var S3_EXPRESS_AUTH_SCHEME = "sigv4-s3express";
|
|
35868
|
+
var SESSION_TOKEN_QUERY_PARAM = "X-Amz-S3session-Token";
|
|
35869
|
+
var SESSION_TOKEN_HEADER = SESSION_TOKEN_QUERY_PARAM.toLowerCase();
|
|
35870
|
+
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME = "AWS_S3_DISABLE_EXPRESS_SESSION_AUTH";
|
|
35871
|
+
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME = "s3_disable_express_session_auth";
|
|
35872
|
+
var NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = {
|
|
35873
|
+
environmentVariableSelector: (env) => utilConfigProvider.booleanSelector(env, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_ENV_NAME, utilConfigProvider.SelectorType.ENV),
|
|
35874
|
+
configFileSelector: (profile) => utilConfigProvider.booleanSelector(profile, NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_INI_NAME, utilConfigProvider.SelectorType.CONFIG),
|
|
35875
|
+
default: false
|
|
35876
|
+
};
|
|
35877
|
+
var SignatureV4S3Express = class extends signatureV4.SignatureV4 {
|
|
35878
|
+
async signWithCredentials(requestToSign, credentials, options) {
|
|
35879
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
35880
|
+
requestToSign.headers[SESSION_TOKEN_HEADER] = credentials.sessionToken;
|
|
35881
|
+
const privateAccess = this;
|
|
35882
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
35883
|
+
return privateAccess.signRequest(requestToSign, options ?? {});
|
|
35884
|
+
}
|
|
35885
|
+
async presignWithCredentials(requestToSign, credentials, options) {
|
|
35886
|
+
const credentialsWithoutSessionToken = getCredentialsWithoutSessionToken(credentials);
|
|
35887
|
+
delete requestToSign.headers[SESSION_TOKEN_HEADER];
|
|
35888
|
+
requestToSign.headers[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
35889
|
+
requestToSign.query = requestToSign.query ?? {};
|
|
35890
|
+
requestToSign.query[SESSION_TOKEN_QUERY_PARAM] = credentials.sessionToken;
|
|
35891
|
+
const privateAccess = this;
|
|
35892
|
+
setSingleOverride(privateAccess, credentialsWithoutSessionToken);
|
|
35893
|
+
return this.presign(requestToSign, options);
|
|
35894
|
+
}
|
|
35895
|
+
};
|
|
35896
|
+
function getCredentialsWithoutSessionToken(credentials) {
|
|
35897
|
+
const credentialsWithoutSessionToken = {
|
|
35898
|
+
accessKeyId: credentials.accessKeyId,
|
|
35899
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
35900
|
+
expiration: credentials.expiration
|
|
35901
|
+
};
|
|
35902
|
+
return credentialsWithoutSessionToken;
|
|
35903
|
+
}
|
|
35904
|
+
function setSingleOverride(privateAccess, credentialsWithoutSessionToken) {
|
|
35905
|
+
const id = setTimeout(() => {
|
|
35906
|
+
throw new Error("SignatureV4S3Express credential override was created but not called.");
|
|
35907
|
+
}, 10);
|
|
35908
|
+
const currentCredentialProvider = privateAccess.credentialProvider;
|
|
35909
|
+
const overrideCredentialsProviderOnce = () => {
|
|
35910
|
+
clearTimeout(id);
|
|
35911
|
+
privateAccess.credentialProvider = currentCredentialProvider;
|
|
35912
|
+
return Promise.resolve(credentialsWithoutSessionToken);
|
|
35913
|
+
};
|
|
35914
|
+
privateAccess.credentialProvider = overrideCredentialsProviderOnce;
|
|
35915
|
+
}
|
|
35916
|
+
var s3ExpressMiddleware = (options) => {
|
|
35917
|
+
return (next, context) => async (args) => {
|
|
35918
|
+
if (context.endpointV2) {
|
|
35919
|
+
const endpoint = context.endpointV2;
|
|
35920
|
+
const isS3ExpressAuth = endpoint.properties?.authSchemes?.[0]?.name === S3_EXPRESS_AUTH_SCHEME;
|
|
35921
|
+
const isS3ExpressBucket = endpoint.properties?.backend === S3_EXPRESS_BACKEND || endpoint.properties?.bucketType === S3_EXPRESS_BUCKET_TYPE;
|
|
35922
|
+
if (isS3ExpressBucket) {
|
|
35923
|
+
client.setFeature(context, "S3_EXPRESS_BUCKET", "J");
|
|
35924
|
+
context.isS3ExpressBucket = true;
|
|
35925
|
+
}
|
|
35926
|
+
if (isS3ExpressAuth) {
|
|
35927
|
+
const requestBucket = args.input.Bucket;
|
|
35928
|
+
if (requestBucket) {
|
|
35929
|
+
const s3ExpressIdentity = await options.s3ExpressIdentityProvider.getS3ExpressIdentity(await options.credentials(), {
|
|
35930
|
+
Bucket: requestBucket
|
|
35931
|
+
});
|
|
35932
|
+
context.s3ExpressIdentity = s3ExpressIdentity;
|
|
35933
|
+
if (protocolHttp.HttpRequest.isInstance(args.request) && s3ExpressIdentity.sessionToken) {
|
|
35934
|
+
args.request.headers[SESSION_TOKEN_HEADER] = s3ExpressIdentity.sessionToken;
|
|
35935
|
+
}
|
|
35936
|
+
}
|
|
35937
|
+
}
|
|
35938
|
+
}
|
|
35939
|
+
return next(args);
|
|
35940
|
+
};
|
|
35941
|
+
};
|
|
35942
|
+
var s3ExpressMiddlewareOptions = {
|
|
35943
|
+
name: "s3ExpressMiddleware",
|
|
35944
|
+
step: "build",
|
|
35945
|
+
tags: ["S3", "S3_EXPRESS"],
|
|
35946
|
+
override: true
|
|
35947
|
+
};
|
|
35948
|
+
var getS3ExpressPlugin = (options) => ({
|
|
35949
|
+
applyToStack: (clientStack) => {
|
|
35950
|
+
clientStack.add(s3ExpressMiddleware(options), s3ExpressMiddlewareOptions);
|
|
35951
|
+
}
|
|
35952
|
+
});
|
|
35953
|
+
var signS3Express = async (s3ExpressIdentity, signingOptions, request, sigV4MultiRegionSigner) => {
|
|
35954
|
+
const signedRequest = await sigV4MultiRegionSigner.signWithCredentials(request, s3ExpressIdentity, {});
|
|
35955
|
+
if (signedRequest.headers["X-Amz-Security-Token"] || signedRequest.headers["x-amz-security-token"]) {
|
|
35956
|
+
throw new Error("X-Amz-Security-Token must not be set for s3-express requests.");
|
|
35957
|
+
}
|
|
35958
|
+
return signedRequest;
|
|
35959
|
+
};
|
|
35960
|
+
var defaultErrorHandler2 = (signingProperties) => (error2) => {
|
|
35961
|
+
throw error2;
|
|
35962
|
+
};
|
|
35963
|
+
var defaultSuccessHandler2 = (httpResponse, signingProperties) => {
|
|
35964
|
+
};
|
|
35965
|
+
var s3ExpressHttpSigningMiddlewareOptions = core.httpSigningMiddlewareOptions;
|
|
35966
|
+
var s3ExpressHttpSigningMiddleware = (config) => (next, context) => async (args) => {
|
|
35967
|
+
if (!protocolHttp.HttpRequest.isInstance(args.request)) {
|
|
35968
|
+
return next(args);
|
|
35969
|
+
}
|
|
35970
|
+
const smithyContext = utilMiddleware.getSmithyContext(context);
|
|
35971
|
+
const scheme = smithyContext.selectedHttpAuthScheme;
|
|
35972
|
+
if (!scheme) {
|
|
35973
|
+
throw new Error(`No HttpAuthScheme was selected: unable to sign request`);
|
|
35974
|
+
}
|
|
35975
|
+
const { httpAuthOption: { signingProperties = {} }, identity, signer } = scheme;
|
|
35976
|
+
let request;
|
|
35977
|
+
if (context.s3ExpressIdentity) {
|
|
35978
|
+
request = await signS3Express(context.s3ExpressIdentity, signingProperties, args.request, await config.signer());
|
|
35979
|
+
} else {
|
|
35980
|
+
request = await signer.sign(args.request, identity, signingProperties);
|
|
35981
|
+
}
|
|
35982
|
+
const output = await next({
|
|
35983
|
+
...args,
|
|
35984
|
+
request
|
|
35985
|
+
}).catch((signer.errorHandler || defaultErrorHandler2)(signingProperties));
|
|
35986
|
+
(signer.successHandler || defaultSuccessHandler2)(output.response, signingProperties);
|
|
35987
|
+
return output;
|
|
35988
|
+
};
|
|
35989
|
+
var getS3ExpressHttpSigningPlugin = (config) => ({
|
|
35990
|
+
applyToStack: (clientStack) => {
|
|
35991
|
+
clientStack.addRelativeTo(s3ExpressHttpSigningMiddleware(config), core.httpSigningMiddlewareOptions);
|
|
35992
|
+
}
|
|
35993
|
+
});
|
|
35994
|
+
var resolveS3Config = (input, { session }) => {
|
|
35995
|
+
const [s3ClientProvider, CreateSessionCommandCtor] = session;
|
|
35996
|
+
const { forcePathStyle, useAccelerateEndpoint, disableMultiregionAccessPoints, followRegionRedirects, s3ExpressIdentityProvider, bucketEndpoint, expectContinueHeader } = input;
|
|
35997
|
+
return Object.assign(input, {
|
|
35998
|
+
forcePathStyle: forcePathStyle ?? false,
|
|
35999
|
+
useAccelerateEndpoint: useAccelerateEndpoint ?? false,
|
|
36000
|
+
disableMultiregionAccessPoints: disableMultiregionAccessPoints ?? false,
|
|
36001
|
+
followRegionRedirects: followRegionRedirects ?? false,
|
|
36002
|
+
s3ExpressIdentityProvider: s3ExpressIdentityProvider ?? new S3ExpressIdentityProviderImpl(async (key) => s3ClientProvider().send(new CreateSessionCommandCtor({
|
|
36003
|
+
Bucket: key
|
|
36004
|
+
}))),
|
|
36005
|
+
bucketEndpoint: bucketEndpoint ?? false,
|
|
36006
|
+
expectContinueHeader: expectContinueHeader ?? 2097152
|
|
36007
|
+
});
|
|
36008
|
+
};
|
|
36009
|
+
var THROW_IF_EMPTY_BODY = {
|
|
36010
|
+
CopyObjectCommand: true,
|
|
36011
|
+
UploadPartCopyCommand: true,
|
|
36012
|
+
CompleteMultipartUploadCommand: true
|
|
36013
|
+
};
|
|
36014
|
+
var MAX_BYTES_TO_INSPECT = 3e3;
|
|
36015
|
+
var throw200ExceptionsMiddleware = (config) => (next, context) => async (args) => {
|
|
36016
|
+
const result = await next(args);
|
|
36017
|
+
const { response } = result;
|
|
36018
|
+
if (!protocolHttp.HttpResponse.isInstance(response)) {
|
|
36019
|
+
return result;
|
|
36020
|
+
}
|
|
36021
|
+
const { statusCode, body: sourceBody } = response;
|
|
36022
|
+
if (statusCode < 200 || statusCode >= 300) {
|
|
36023
|
+
return result;
|
|
36024
|
+
}
|
|
36025
|
+
const isSplittableStream = typeof sourceBody?.stream === "function" || typeof sourceBody?.pipe === "function" || typeof sourceBody?.tee === "function";
|
|
36026
|
+
if (!isSplittableStream) {
|
|
36027
|
+
return result;
|
|
36028
|
+
}
|
|
36029
|
+
let bodyCopy = sourceBody;
|
|
36030
|
+
let body = sourceBody;
|
|
36031
|
+
if (sourceBody && typeof sourceBody === "object" && !(sourceBody instanceof Uint8Array)) {
|
|
36032
|
+
[bodyCopy, body] = await utilStream.splitStream(sourceBody);
|
|
36033
|
+
}
|
|
36034
|
+
response.body = body;
|
|
36035
|
+
const bodyBytes = await collectBody4(bodyCopy, {
|
|
36036
|
+
streamCollector: async (stream) => {
|
|
36037
|
+
return utilStream.headStream(stream, MAX_BYTES_TO_INSPECT);
|
|
36038
|
+
}
|
|
36039
|
+
});
|
|
36040
|
+
if (typeof bodyCopy?.destroy === "function") {
|
|
36041
|
+
bodyCopy.destroy();
|
|
36042
|
+
}
|
|
36043
|
+
const bodyStringTail = config.utf8Encoder(bodyBytes.subarray(bodyBytes.length - 16));
|
|
36044
|
+
if (bodyBytes.length === 0 && THROW_IF_EMPTY_BODY[context.commandName]) {
|
|
36045
|
+
const err = new Error("S3 aborted request");
|
|
36046
|
+
err.name = "InternalError";
|
|
36047
|
+
throw err;
|
|
36048
|
+
}
|
|
36049
|
+
if (bodyStringTail && bodyStringTail.endsWith("</Error>")) {
|
|
36050
|
+
response.statusCode = 400;
|
|
36051
|
+
}
|
|
36052
|
+
return result;
|
|
36053
|
+
};
|
|
36054
|
+
var collectBody4 = (streamBody = new Uint8Array(), context) => {
|
|
36055
|
+
if (streamBody instanceof Uint8Array) {
|
|
36056
|
+
return Promise.resolve(streamBody);
|
|
36057
|
+
}
|
|
36058
|
+
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
36059
|
+
};
|
|
36060
|
+
var throw200ExceptionsMiddlewareOptions = {
|
|
36061
|
+
relation: "after",
|
|
36062
|
+
toMiddleware: "deserializerMiddleware",
|
|
36063
|
+
tags: ["THROW_200_EXCEPTIONS", "S3"],
|
|
36064
|
+
name: "throw200ExceptionsMiddleware",
|
|
36065
|
+
override: true
|
|
36066
|
+
};
|
|
36067
|
+
var getThrow200ExceptionsPlugin = (config) => ({
|
|
36068
|
+
applyToStack: (clientStack) => {
|
|
36069
|
+
clientStack.addRelativeTo(throw200ExceptionsMiddleware(config), throw200ExceptionsMiddlewareOptions);
|
|
36070
|
+
}
|
|
36071
|
+
});
|
|
36072
|
+
function bucketEndpointMiddleware(options) {
|
|
36073
|
+
return (next, context) => async (args) => {
|
|
36074
|
+
if (options.bucketEndpoint) {
|
|
36075
|
+
const endpoint = context.endpointV2;
|
|
36076
|
+
if (endpoint) {
|
|
36077
|
+
const bucket = args.input.Bucket;
|
|
36078
|
+
if (typeof bucket === "string") {
|
|
36079
|
+
try {
|
|
36080
|
+
const bucketEndpointUrl = new URL(bucket);
|
|
36081
|
+
context.endpointV2 = {
|
|
36082
|
+
...endpoint,
|
|
36083
|
+
url: bucketEndpointUrl
|
|
36084
|
+
};
|
|
36085
|
+
} catch (e5) {
|
|
36086
|
+
const warning = `@aws-sdk/middleware-sdk-s3: bucketEndpoint=true was set but Bucket=${bucket} could not be parsed as URL.`;
|
|
36087
|
+
if (context.logger?.constructor?.name === "NoOpLogger") {
|
|
36088
|
+
console.warn(warning);
|
|
36089
|
+
} else {
|
|
36090
|
+
context.logger?.warn?.(warning);
|
|
36091
|
+
}
|
|
36092
|
+
throw e5;
|
|
36093
|
+
}
|
|
36094
|
+
}
|
|
36095
|
+
}
|
|
36096
|
+
}
|
|
36097
|
+
return next(args);
|
|
36098
|
+
};
|
|
36099
|
+
}
|
|
36100
|
+
var bucketEndpointMiddlewareOptions = {
|
|
36101
|
+
name: "bucketEndpointMiddleware",
|
|
36102
|
+
override: true,
|
|
36103
|
+
relation: "after",
|
|
36104
|
+
toMiddleware: "endpointV2Middleware"
|
|
36105
|
+
};
|
|
36106
|
+
function validateBucketNameMiddleware({ bucketEndpoint }) {
|
|
36107
|
+
return (next) => async (args) => {
|
|
36108
|
+
const { input: { Bucket } } = args;
|
|
36109
|
+
if (!bucketEndpoint && typeof Bucket === "string" && !utilArnParser.validate(Bucket) && Bucket.indexOf("/") >= 0) {
|
|
36110
|
+
const err = new Error(`Bucket name shouldn't contain '/', received '${Bucket}'`);
|
|
36111
|
+
err.name = "InvalidBucketName";
|
|
36112
|
+
throw err;
|
|
36113
|
+
}
|
|
36114
|
+
return next({ ...args });
|
|
36115
|
+
};
|
|
36116
|
+
}
|
|
36117
|
+
var validateBucketNameMiddlewareOptions = {
|
|
36118
|
+
step: "initialize",
|
|
36119
|
+
tags: ["VALIDATE_BUCKET_NAME"],
|
|
36120
|
+
name: "validateBucketNameMiddleware",
|
|
36121
|
+
override: true
|
|
36122
|
+
};
|
|
36123
|
+
var getValidateBucketNamePlugin = (options) => ({
|
|
36124
|
+
applyToStack: (clientStack) => {
|
|
36125
|
+
clientStack.add(validateBucketNameMiddleware(options), validateBucketNameMiddlewareOptions);
|
|
36126
|
+
clientStack.addRelativeTo(bucketEndpointMiddleware(options), bucketEndpointMiddlewareOptions);
|
|
36127
|
+
}
|
|
36128
|
+
});
|
|
36129
|
+
var S3RestXmlProtocol = class extends protocols.AwsRestXmlProtocol {
|
|
36130
|
+
async serializeRequest(operationSchema, input, context) {
|
|
36131
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
36132
|
+
const ns = schema.NormalizedSchema.of(operationSchema.input);
|
|
36133
|
+
const staticStructureSchema = ns.getSchema();
|
|
36134
|
+
let bucketMemberIndex = 0;
|
|
36135
|
+
const requiredMemberCount = staticStructureSchema[6] ?? 0;
|
|
36136
|
+
if (input && typeof input === "object") {
|
|
36137
|
+
for (const [memberName, memberNs] of ns.structIterator()) {
|
|
36138
|
+
if (++bucketMemberIndex > requiredMemberCount) {
|
|
36139
|
+
break;
|
|
36140
|
+
}
|
|
36141
|
+
if (memberName === "Bucket") {
|
|
36142
|
+
if (!input.Bucket && memberNs.getMergedTraits().httpLabel) {
|
|
36143
|
+
throw new Error(`No value provided for input HTTP label: Bucket.`);
|
|
36144
|
+
}
|
|
36145
|
+
break;
|
|
36146
|
+
}
|
|
36147
|
+
}
|
|
36148
|
+
}
|
|
36149
|
+
return request;
|
|
36150
|
+
}
|
|
36151
|
+
};
|
|
36152
|
+
exports2.NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS = NODE_DISABLE_S3_EXPRESS_SESSION_AUTH_OPTIONS;
|
|
36153
|
+
exports2.S3ExpressIdentityCache = S3ExpressIdentityCache;
|
|
36154
|
+
exports2.S3ExpressIdentityCacheEntry = S3ExpressIdentityCacheEntry;
|
|
36155
|
+
exports2.S3ExpressIdentityProviderImpl = S3ExpressIdentityProviderImpl;
|
|
36156
|
+
exports2.S3RestXmlProtocol = S3RestXmlProtocol;
|
|
36157
|
+
exports2.SignatureV4S3Express = SignatureV4S3Express;
|
|
36158
|
+
exports2.checkContentLengthHeader = checkContentLengthHeader;
|
|
36159
|
+
exports2.checkContentLengthHeaderMiddlewareOptions = checkContentLengthHeaderMiddlewareOptions;
|
|
36160
|
+
exports2.getCheckContentLengthHeaderPlugin = getCheckContentLengthHeaderPlugin;
|
|
36161
|
+
exports2.getRegionRedirectMiddlewarePlugin = getRegionRedirectMiddlewarePlugin;
|
|
36162
|
+
exports2.getS3ExpiresMiddlewarePlugin = getS3ExpiresMiddlewarePlugin;
|
|
36163
|
+
exports2.getS3ExpressHttpSigningPlugin = getS3ExpressHttpSigningPlugin;
|
|
36164
|
+
exports2.getS3ExpressPlugin = getS3ExpressPlugin;
|
|
36165
|
+
exports2.getThrow200ExceptionsPlugin = getThrow200ExceptionsPlugin;
|
|
36166
|
+
exports2.getValidateBucketNamePlugin = getValidateBucketNamePlugin;
|
|
36167
|
+
exports2.regionRedirectEndpointMiddleware = regionRedirectEndpointMiddleware;
|
|
36168
|
+
exports2.regionRedirectEndpointMiddlewareOptions = regionRedirectEndpointMiddlewareOptions;
|
|
36169
|
+
exports2.regionRedirectMiddleware = regionRedirectMiddleware;
|
|
36170
|
+
exports2.regionRedirectMiddlewareOptions = regionRedirectMiddlewareOptions;
|
|
36171
|
+
exports2.resolveS3Config = resolveS3Config;
|
|
36172
|
+
exports2.s3ExpiresMiddleware = s3ExpiresMiddleware;
|
|
36173
|
+
exports2.s3ExpiresMiddlewareOptions = s3ExpiresMiddlewareOptions;
|
|
36174
|
+
exports2.s3ExpressHttpSigningMiddleware = s3ExpressHttpSigningMiddleware;
|
|
36175
|
+
exports2.s3ExpressHttpSigningMiddlewareOptions = s3ExpressHttpSigningMiddlewareOptions;
|
|
36176
|
+
exports2.s3ExpressMiddleware = s3ExpressMiddleware;
|
|
36177
|
+
exports2.s3ExpressMiddlewareOptions = s3ExpressMiddlewareOptions;
|
|
36178
|
+
exports2.throw200ExceptionsMiddleware = throw200ExceptionsMiddleware;
|
|
36179
|
+
exports2.throw200ExceptionsMiddlewareOptions = throw200ExceptionsMiddlewareOptions;
|
|
36180
|
+
exports2.validateBucketNameMiddleware = validateBucketNameMiddleware;
|
|
36181
|
+
exports2.validateBucketNameMiddlewareOptions = validateBucketNameMiddlewareOptions;
|
|
36182
|
+
}
|
|
36183
|
+
});
|
|
36184
|
+
|
|
36185
|
+
// node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.18/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js
|
|
36186
|
+
var require_dist_cjs74 = __commonJS({
|
|
36187
|
+
"node_modules/.pnpm/@aws-sdk+signature-v4-multi-region@3.996.18/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js"(exports2) {
|
|
36188
|
+
"use strict";
|
|
36189
|
+
var middlewareSdkS3 = require_dist_cjs73();
|
|
36190
|
+
var signatureV4 = require_dist_cjs30();
|
|
36191
|
+
var signatureV4CrtContainer = {
|
|
36192
|
+
CrtSignerV4: null
|
|
36193
|
+
};
|
|
36194
|
+
var SignatureV4MultiRegion = class {
|
|
36195
|
+
sigv4aSigner;
|
|
36196
|
+
sigv4Signer;
|
|
36197
|
+
signerOptions;
|
|
36198
|
+
static sigv4aDependency() {
|
|
36199
|
+
if (typeof signatureV4CrtContainer.CrtSignerV4 === "function") {
|
|
36200
|
+
return "crt";
|
|
36201
|
+
} else if (typeof signatureV4.signatureV4aContainer.SignatureV4a === "function") {
|
|
36202
|
+
return "js";
|
|
36203
|
+
}
|
|
36204
|
+
return "none";
|
|
36205
|
+
}
|
|
36206
|
+
constructor(options) {
|
|
36207
|
+
this.sigv4Signer = new middlewareSdkS3.SignatureV4S3Express(options);
|
|
36208
|
+
this.signerOptions = options;
|
|
36209
|
+
}
|
|
36210
|
+
async sign(requestToSign, options = {}) {
|
|
36211
|
+
if (options.signingRegion === "*") {
|
|
36212
|
+
return this.getSigv4aSigner().sign(requestToSign, options);
|
|
36213
|
+
}
|
|
36214
|
+
return this.sigv4Signer.sign(requestToSign, options);
|
|
36215
|
+
}
|
|
36216
|
+
async signWithCredentials(requestToSign, credentials, options = {}) {
|
|
36217
|
+
if (options.signingRegion === "*") {
|
|
36218
|
+
const signer = this.getSigv4aSigner();
|
|
36219
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
36220
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
36221
|
+
return signer.signWithCredentials(requestToSign, credentials, options);
|
|
36222
|
+
} else {
|
|
36223
|
+
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`);
|
|
36224
|
+
}
|
|
36225
|
+
}
|
|
36226
|
+
return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
|
|
36227
|
+
}
|
|
36228
|
+
async presign(originalRequest, options = {}) {
|
|
36229
|
+
if (options.signingRegion === "*") {
|
|
36230
|
+
const signer = this.getSigv4aSigner();
|
|
36231
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
36232
|
+
if (CrtSignerV4 && signer instanceof CrtSignerV4) {
|
|
36233
|
+
return signer.presign(originalRequest, options);
|
|
36234
|
+
} else {
|
|
36235
|
+
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`);
|
|
36236
|
+
}
|
|
36237
|
+
}
|
|
36238
|
+
return this.sigv4Signer.presign(originalRequest, options);
|
|
36239
|
+
}
|
|
36240
|
+
async presignWithCredentials(originalRequest, credentials, options = {}) {
|
|
36241
|
+
if (options.signingRegion === "*") {
|
|
36242
|
+
throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
|
|
36243
|
+
}
|
|
36244
|
+
return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
|
|
36245
|
+
}
|
|
36246
|
+
getSigv4aSigner() {
|
|
36247
|
+
if (!this.sigv4aSigner) {
|
|
36248
|
+
const CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
|
|
36249
|
+
const JsSigV4aSigner = signatureV4.signatureV4aContainer.SignatureV4a;
|
|
36250
|
+
if (this.signerOptions.runtime === "node") {
|
|
36251
|
+
if (!CrtSignerV4 && !JsSigV4aSigner) {
|
|
36252
|
+
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");
|
|
36253
|
+
}
|
|
36254
|
+
if (CrtSignerV4 && typeof CrtSignerV4 === "function") {
|
|
36255
|
+
this.sigv4aSigner = new CrtSignerV4({
|
|
36256
|
+
...this.signerOptions,
|
|
36257
|
+
signingAlgorithm: 1
|
|
36258
|
+
});
|
|
36259
|
+
} else if (JsSigV4aSigner && typeof JsSigV4aSigner === "function") {
|
|
36260
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
36261
|
+
...this.signerOptions
|
|
36262
|
+
});
|
|
36263
|
+
} else {
|
|
36264
|
+
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");
|
|
36265
|
+
}
|
|
36266
|
+
} else {
|
|
36267
|
+
if (!JsSigV4aSigner || typeof JsSigV4aSigner !== "function") {
|
|
36268
|
+
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");
|
|
36269
|
+
}
|
|
36270
|
+
this.sigv4aSigner = new JsSigV4aSigner({
|
|
36271
|
+
...this.signerOptions
|
|
36272
|
+
});
|
|
36273
|
+
}
|
|
36274
|
+
}
|
|
36275
|
+
return this.sigv4aSigner;
|
|
36276
|
+
}
|
|
36277
|
+
};
|
|
36278
|
+
exports2.SignatureV4MultiRegion = SignatureV4MultiRegion;
|
|
36279
|
+
exports2.signatureV4CrtContainer = signatureV4CrtContainer;
|
|
36280
|
+
}
|
|
36281
|
+
});
|
|
36282
|
+
|
|
36283
|
+
// node_modules/.pnpm/@aws-sdk+s3-request-presigner@3.1032.0/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/index.js
|
|
36284
|
+
var require_dist_cjs75 = __commonJS({
|
|
36285
|
+
"node_modules/.pnpm/@aws-sdk+s3-request-presigner@3.1032.0/node_modules/@aws-sdk/s3-request-presigner/dist-cjs/index.js"(exports2) {
|
|
33433
36286
|
"use strict";
|
|
33434
36287
|
var utilFormatUrl = require_dist_cjs72();
|
|
33435
36288
|
var middlewareEndpoint = require_dist_cjs45();
|
|
33436
36289
|
var protocolHttp = require_dist_cjs2();
|
|
33437
|
-
var signatureV4MultiRegion =
|
|
36290
|
+
var signatureV4MultiRegion = require_dist_cjs74();
|
|
33438
36291
|
var UNSIGNED_PAYLOAD = "UNSIGNED-PAYLOAD";
|
|
33439
36292
|
var SHA256_HEADER = "X-Amz-Content-Sha256";
|
|
33440
36293
|
var S3RequestPresigner = class {
|
|
@@ -33688,7 +36541,7 @@ async function checkUsersInGroup(ctx, session, userIds) {
|
|
|
33688
36541
|
// src/utils/media/media-helper.ts
|
|
33689
36542
|
var import_axios = __toESM(require("axios"), 1);
|
|
33690
36543
|
var import_client_s3 = __toESM(require_dist_cjs71(), 1);
|
|
33691
|
-
var import_s3_request_presigner = __toESM(
|
|
36544
|
+
var import_s3_request_presigner = __toESM(require_dist_cjs75(), 1);
|
|
33692
36545
|
var import_node_crypto = require("node:crypto");
|
|
33693
36546
|
var import_node_fs = require("node:fs");
|
|
33694
36547
|
var import_node_path = __toESM(require("node:path"), 1);
|
|
@@ -34279,9 +37132,9 @@ function isLegacyLocalMediaRef(ctx, fileRef, type) {
|
|
|
34279
37132
|
const filePath = isFileUri(fileRef) ? fromFileUri(fileRef) : fileRef;
|
|
34280
37133
|
return isPathInsideDir(filePath, getLegacyMediaDir(ctx, type));
|
|
34281
37134
|
}
|
|
34282
|
-
async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, targetMode, transferMode, cfg,
|
|
37135
|
+
async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, targetMode, transferMode, cfg, state3, stats, hooks) {
|
|
34283
37136
|
const cacheKey = createTransferCacheKey(fileRef, targetChannelId, targetMode, transferMode);
|
|
34284
|
-
const cachedPlan =
|
|
37137
|
+
const cachedPlan = state3.transferPlans.get(cacheKey);
|
|
34285
37138
|
if (cachedPlan) {
|
|
34286
37139
|
return cachedPlan;
|
|
34287
37140
|
}
|
|
@@ -34313,7 +37166,7 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34313
37166
|
} else {
|
|
34314
37167
|
stats.mediaCopied += 1;
|
|
34315
37168
|
}
|
|
34316
|
-
|
|
37169
|
+
state3.transferPlans.set(cacheKey, plan2);
|
|
34317
37170
|
return plan2;
|
|
34318
37171
|
}
|
|
34319
37172
|
const loaded = await loadMediaBuffer(ctx, fileRef, cfg);
|
|
@@ -34344,7 +37197,7 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34344
37197
|
} else {
|
|
34345
37198
|
stats.mediaCopied += 1;
|
|
34346
37199
|
}
|
|
34347
|
-
|
|
37200
|
+
state3.transferPlans.set(cacheKey, plan);
|
|
34348
37201
|
return plan;
|
|
34349
37202
|
}
|
|
34350
37203
|
try {
|
|
@@ -34384,7 +37237,7 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34384
37237
|
} else {
|
|
34385
37238
|
stats.mediaCopied += 1;
|
|
34386
37239
|
}
|
|
34387
|
-
|
|
37240
|
+
state3.transferPlans.set(cacheKey, plan2);
|
|
34388
37241
|
return plan2;
|
|
34389
37242
|
}
|
|
34390
37243
|
const loaded = await loadMediaBuffer(ctx, fileRef, cfg);
|
|
@@ -34422,7 +37275,7 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34422
37275
|
stats.mediaDeleted += 1;
|
|
34423
37276
|
stats.mediaMoved += 1;
|
|
34424
37277
|
}
|
|
34425
|
-
|
|
37278
|
+
state3.transferPlans.set(cacheKey, plan);
|
|
34426
37279
|
stats.mediaUploaded += 1;
|
|
34427
37280
|
await hooks?.onS3Upload?.(type, nextRef);
|
|
34428
37281
|
return plan;
|
|
@@ -34433,7 +37286,7 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34433
37286
|
);
|
|
34434
37287
|
if (fallbackMode === "original-link") {
|
|
34435
37288
|
const plan = { nextRef: fileRef };
|
|
34436
|
-
|
|
37289
|
+
state3.transferPlans.set(cacheKey, plan);
|
|
34437
37290
|
return plan;
|
|
34438
37291
|
}
|
|
34439
37292
|
const fallbackPlan = await transferMediaRefToChannel(
|
|
@@ -34444,11 +37297,11 @@ async function transferMediaRefToChannel(ctx, fileRef, type, targetChannelId, ta
|
|
|
34444
37297
|
"local",
|
|
34445
37298
|
transferMode,
|
|
34446
37299
|
cfg,
|
|
34447
|
-
|
|
37300
|
+
state3,
|
|
34448
37301
|
stats,
|
|
34449
37302
|
hooks
|
|
34450
37303
|
);
|
|
34451
|
-
|
|
37304
|
+
state3.transferPlans.set(cacheKey, fallbackPlan);
|
|
34452
37305
|
return fallbackPlan;
|
|
34453
37306
|
}
|
|
34454
37307
|
}
|
|
@@ -34598,7 +37451,7 @@ async function inspectCaveMediaRefs(ctx, shouldInclude) {
|
|
|
34598
37451
|
scannedRecords
|
|
34599
37452
|
};
|
|
34600
37453
|
}
|
|
34601
|
-
async function rewriteMessageMediaStorage(ctx, content, targetChannelId, targetMode, transferMode, cfg,
|
|
37454
|
+
async function rewriteMessageMediaStorage(ctx, content, targetChannelId, targetMode, transferMode, cfg, state3, stats, shouldRewrite, hooks) {
|
|
34602
37455
|
const planSet = /* @__PURE__ */ new Set();
|
|
34603
37456
|
const rewritten = await mutateMessageContent(ctx, content, async (element, type) => {
|
|
34604
37457
|
const currentRef = getElementFileRef(ctx, element, type);
|
|
@@ -34619,7 +37472,7 @@ async function rewriteMessageMediaStorage(ctx, content, targetChannelId, targetM
|
|
|
34619
37472
|
targetMode,
|
|
34620
37473
|
transferMode,
|
|
34621
37474
|
cfg,
|
|
34622
|
-
|
|
37475
|
+
state3,
|
|
34623
37476
|
stats,
|
|
34624
37477
|
hooks
|
|
34625
37478
|
);
|
|
@@ -34824,8 +37677,8 @@ async function ensureMediaSaveProgress(progressOptions) {
|
|
|
34824
37677
|
if (!progressOptions || progressOptions.state.progressMessageIds?.length) {
|
|
34825
37678
|
return;
|
|
34826
37679
|
}
|
|
34827
|
-
const { session, state:
|
|
34828
|
-
|
|
37680
|
+
const { session, state: state3 } = progressOptions;
|
|
37681
|
+
state3.progressMessageIds = await session.send(
|
|
34829
37682
|
session.text("commands.cave.echo.messages.mediaSaving")
|
|
34830
37683
|
);
|
|
34831
37684
|
}
|
|
@@ -34986,7 +37839,7 @@ async function deleteMediaFilesFromMessage(ctx, content, cfg) {
|
|
|
34986
37839
|
async function migrateLocalMediaToV2(ctx, cfg, createHooks) {
|
|
34987
37840
|
const caves = await getAllCaves(ctx);
|
|
34988
37841
|
const stats = createEmptyStats();
|
|
34989
|
-
const
|
|
37842
|
+
const state3 = {
|
|
34990
37843
|
transferPlans: /* @__PURE__ */ new Map()
|
|
34991
37844
|
};
|
|
34992
37845
|
const failedRecordIds = [];
|
|
@@ -35002,7 +37855,7 @@ async function migrateLocalMediaToV2(ctx, cfg, createHooks) {
|
|
|
35002
37855
|
"local",
|
|
35003
37856
|
"move",
|
|
35004
37857
|
cfg,
|
|
35005
|
-
|
|
37858
|
+
state3,
|
|
35006
37859
|
stats,
|
|
35007
37860
|
(fileRef, type) => isLegacyLocalMediaRef(ctx, fileRef, type),
|
|
35008
37861
|
hooks
|
|
@@ -35040,7 +37893,7 @@ async function migrateLocalMediaToV2(ctx, cfg, createHooks) {
|
|
|
35040
37893
|
async function migrateLocalMediaToS3(ctx, cfg, keepLocal, createHooks) {
|
|
35041
37894
|
const caves = await getAllCaves(ctx);
|
|
35042
37895
|
const stats = createEmptyStats();
|
|
35043
|
-
const
|
|
37896
|
+
const state3 = {
|
|
35044
37897
|
transferPlans: /* @__PURE__ */ new Map()
|
|
35045
37898
|
};
|
|
35046
37899
|
const failedRecordIds = [];
|
|
@@ -35056,7 +37909,7 @@ async function migrateLocalMediaToS3(ctx, cfg, keepLocal, createHooks) {
|
|
|
35056
37909
|
"s3",
|
|
35057
37910
|
keepLocal ? "copy" : "move",
|
|
35058
37911
|
cfg,
|
|
35059
|
-
|
|
37912
|
+
state3,
|
|
35060
37913
|
stats,
|
|
35061
37914
|
(fileRef, type) => isFileUri(fileRef) || isLegacyLocalMediaRef(ctx, fileRef, type),
|
|
35062
37915
|
hooks
|
|
@@ -35097,7 +37950,7 @@ async function mergeChannelCaves(ctx, cfg, sourceChannelId, targetChannelId, kee
|
|
|
35097
37950
|
const targetMode = getStorageMode(cfg);
|
|
35098
37951
|
const transferMode = keepSource ? "copy" : "move";
|
|
35099
37952
|
const stats = createEmptyStats();
|
|
35100
|
-
const
|
|
37953
|
+
const state3 = {
|
|
35101
37954
|
transferPlans: /* @__PURE__ */ new Map()
|
|
35102
37955
|
};
|
|
35103
37956
|
const failedRecordIds = [];
|
|
@@ -35114,7 +37967,7 @@ async function mergeChannelCaves(ctx, cfg, sourceChannelId, targetChannelId, kee
|
|
|
35114
37967
|
targetMode,
|
|
35115
37968
|
transferMode,
|
|
35116
37969
|
cfg,
|
|
35117
|
-
|
|
37970
|
+
state3,
|
|
35118
37971
|
stats,
|
|
35119
37972
|
void 0,
|
|
35120
37973
|
hooks
|
|
@@ -36283,11 +39136,11 @@ async function addCave(ctx, session, cfg, userIds) {
|
|
|
36283
39136
|
}
|
|
36284
39137
|
async function processMediaWithOptionalProgress(session, cfg, hasMedia, action) {
|
|
36285
39138
|
const shouldShowProgress = cfg.mediaStorage === "s3" && hasMedia;
|
|
36286
|
-
const
|
|
39139
|
+
const state3 = {};
|
|
36287
39140
|
try {
|
|
36288
|
-
return await action(shouldShowProgress ? { session, state:
|
|
39141
|
+
return await action(shouldShowProgress ? { session, state: state3 } : void 0);
|
|
36289
39142
|
} finally {
|
|
36290
|
-
await tryDeleteProgressMessages(session,
|
|
39143
|
+
await tryDeleteProgressMessages(session, state3.progressMessageIds);
|
|
36291
39144
|
}
|
|
36292
39145
|
}
|
|
36293
39146
|
async function tryDeleteProgressMessages(session, messageIds) {
|