@aws-cdk/integ-runner 2.204.2 → 2.204.4

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.
@@ -4766,7 +4766,7 @@ var require_semver2 = __commonJS({
4766
4766
  // ../cloud-assembly-schema/cli-version.json
4767
4767
  var require_cli_version = __commonJS({
4768
4768
  "../cloud-assembly-schema/cli-version.json"(exports2, module2) {
4769
- module2.exports = { version: "2.1135.1" };
4769
+ module2.exports = { version: "2.1137.0" };
4770
4770
  }
4771
4771
  });
4772
4772
 
@@ -39029,7 +39029,7 @@ var init_package = __esm({
39029
39029
  "../../../node_modules/@aws-sdk/nested-clients/package.json"() {
39030
39030
  package_default = {
39031
39031
  name: "@aws-sdk/nested-clients",
39032
- version: "3.997.38",
39032
+ version: "3.997.41",
39033
39033
  description: "Nested clients for AWS SDK packages.",
39034
39034
  homepage: "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/nested-clients",
39035
39035
  license: "Apache-2.0",
@@ -39129,7 +39129,7 @@ var init_package = __esm({
39129
39129
  "test:watch": "yarn g:vitest watch"
39130
39130
  },
39131
39131
  dependencies: {
39132
- "@aws-sdk/core": "^3.977.3",
39132
+ "@aws-sdk/core": "^3.977.6",
39133
39133
  "@aws-sdk/signature-v4-multi-region": "^3.996.43",
39134
39134
  "@aws-sdk/types": "^3.974.2",
39135
39135
  "@smithy/core": "^3.31.1",
@@ -40848,30 +40848,54 @@ var init_UnionSerde = __esm({
40848
40848
  }
40849
40849
  });
40850
40850
 
40851
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js
40852
+ function detectBufferParsing() {
40853
+ if (canParseBuffer === void 0) {
40854
+ try {
40855
+ if (typeof Buffer !== "function") {
40856
+ canParseBuffer = false;
40857
+ } else {
40858
+ const result2 = JSON.parse(Buffer.from([123, 125]));
40859
+ canParseBuffer = result2 !== null && typeof result2 === "object";
40860
+ }
40861
+ } catch {
40862
+ canParseBuffer = false;
40863
+ }
40864
+ }
40865
+ return canParseBuffer;
40866
+ }
40867
+ var canParseBuffer;
40868
+ var init_detectBufferParsing = __esm({
40869
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js"() {
40870
+ __name(detectBufferParsing, "detectBufferParsing");
40871
+ }
40872
+ });
40873
+
40851
40874
  // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
40852
40875
  function jsonReviver(key, value, context) {
40853
40876
  if (context?.source) {
40854
40877
  const numericString = context.source;
40855
40878
  if (typeof value === "number") {
40856
40879
  const inSafeRange = value <= Number.MAX_SAFE_INTEGER && value >= Number.MIN_SAFE_INTEGER;
40857
- if (!inSafeRange || numericString !== String(value)) {
40858
- if (inSafeRange && /[eE]/.test(numericString) && String(Number(numericString)) === String(value)) {
40880
+ if (inSafeRange) {
40881
+ if (isRepresentable(numericString, value)) {
40859
40882
  return value;
40860
40883
  }
40861
- if (isFractionalNumeric(numericString)) {
40884
+ return new NumericValue(numericString, "bigDecimal");
40885
+ } else {
40886
+ if (isFractionalBigNumeric(numericString)) {
40862
40887
  return new NumericValue(numericString, "bigDecimal");
40863
- } else {
40864
- if (/[eE]/.test(numericString)) {
40865
- return BigInt(Number(numericString));
40866
- }
40867
- return BigInt(numericString);
40868
40888
  }
40889
+ if (/[eE]/.test(numericString)) {
40890
+ return expandExponentToBigInt(numericString);
40891
+ }
40892
+ return BigInt(numericString);
40869
40893
  }
40870
40894
  }
40871
40895
  }
40872
40896
  return value;
40873
40897
  }
40874
- function isFractionalNumeric(s2) {
40898
+ function isFractionalBigNumeric(s2) {
40875
40899
  const dotIndex = s2.indexOf(".");
40876
40900
  if (dotIndex === -1) {
40877
40901
  return false;
@@ -40884,11 +40908,91 @@ function isFractionalNumeric(s2) {
40884
40908
  const exp = parseInt(s2.slice(eIndex + 1), 10);
40885
40909
  return exp < fracDigits;
40886
40910
  }
40911
+ function isRepresentable(numericString, value) {
40912
+ if (numericString === String(value)) {
40913
+ return true;
40914
+ }
40915
+ if (Object.is(value, -0)) {
40916
+ return true;
40917
+ }
40918
+ if (/[eE]/.test(numericString)) {
40919
+ return expandToDecimal(numericString) === expandToDecimal(String(value));
40920
+ }
40921
+ const normalized = numericString.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
40922
+ const canonical = String(value);
40923
+ if (normalized === canonical) {
40924
+ return true;
40925
+ }
40926
+ if (/[eE]/.test(canonical)) {
40927
+ return normalized === expandToDecimal(canonical);
40928
+ }
40929
+ return false;
40930
+ }
40931
+ function expandToDecimal(s2) {
40932
+ const negative = s2.startsWith("-");
40933
+ const abs = negative ? s2.slice(1) : s2;
40934
+ const eIndex = abs.search(/[eE]/);
40935
+ let result2;
40936
+ if (eIndex === -1) {
40937
+ result2 = abs;
40938
+ } else {
40939
+ const exp = parseInt(abs.slice(eIndex + 1), 10);
40940
+ const mantissa = abs.slice(0, eIndex);
40941
+ const dotIndex = mantissa.indexOf(".");
40942
+ let digits;
40943
+ let intLen;
40944
+ if (dotIndex === -1) {
40945
+ digits = mantissa;
40946
+ intLen = mantissa.length;
40947
+ } else {
40948
+ digits = mantissa.slice(0, dotIndex) + mantissa.slice(dotIndex + 1);
40949
+ intLen = dotIndex;
40950
+ }
40951
+ digits = digits.replace(/0+$/, "") || "0";
40952
+ const newDotPos = intLen + exp;
40953
+ if (digits === "0") {
40954
+ result2 = "0";
40955
+ } else if (newDotPos <= 0) {
40956
+ result2 = "0." + "0".repeat(-newDotPos) + digits;
40957
+ } else if (newDotPos >= digits.length) {
40958
+ result2 = digits + "0".repeat(newDotPos - digits.length);
40959
+ } else {
40960
+ result2 = digits.slice(0, newDotPos) + "." + digits.slice(newDotPos);
40961
+ }
40962
+ }
40963
+ if (result2.includes(".")) {
40964
+ result2 = result2.replace(/(\.\d*?)0+$/, "$1").replace(/\.$/, "");
40965
+ }
40966
+ return (negative ? "-" : "") + result2;
40967
+ }
40968
+ function expandExponentToBigInt(s2) {
40969
+ const eIndex = s2.search(/[eE]/);
40970
+ const exp = parseInt(s2.slice(eIndex + 1), 10);
40971
+ const negative = s2.startsWith("-");
40972
+ const mantissa = s2.slice(negative ? 1 : 0, eIndex);
40973
+ const dotIndex = mantissa.indexOf(".");
40974
+ let digits;
40975
+ let shift;
40976
+ if (dotIndex === -1) {
40977
+ digits = mantissa;
40978
+ shift = exp;
40979
+ } else {
40980
+ digits = mantissa.slice(0, dotIndex) + mantissa.slice(dotIndex + 1);
40981
+ const fracDigits = mantissa.length - dotIndex - 1;
40982
+ shift = exp - fracDigits;
40983
+ }
40984
+ digits = digits.replace(/0+$/, "") || "0";
40985
+ const result2 = BigInt(digits) * 10n ** BigInt(shift + (mantissa.replace(".", "").length - digits.length));
40986
+ return negative ? -result2 : result2;
40987
+ }
40887
40988
  var init_jsonReviver = __esm({
40888
40989
  "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js"() {
40889
40990
  init_serde();
40890
40991
  __name(jsonReviver, "jsonReviver");
40891
- __name(isFractionalNumeric, "isFractionalNumeric");
40992
+ __name(isFractionalBigNumeric, "isFractionalBigNumeric");
40993
+ __name(isRepresentable, "isRepresentable");
40994
+ __name(expandToDecimal, "expandToDecimal");
40995
+ __name(expandExponentToBigInt, "expandExponentToBigInt");
40892
40996
  }
40893
40997
  });
40894
40998
 
@@ -40950,29 +41054,6 @@ var init_common2 = __esm({
40950
41054
  }
40951
41055
  });
40952
41056
 
40953
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js
40954
- function detectBufferParsing() {
40955
- if (canParseBuffer === void 0) {
40956
- try {
40957
- if (typeof Buffer !== "function") {
40958
- canParseBuffer = false;
40959
- } else {
40960
- const result2 = JSON.parse(Buffer.from([123, 125]));
40961
- canParseBuffer = result2 !== null && typeof result2 === "object";
40962
- }
40963
- } catch {
40964
- canParseBuffer = false;
40965
- }
40966
- }
40967
- return canParseBuffer;
40968
- }
40969
- var canParseBuffer;
40970
- var init_detectBufferParsing = __esm({
40971
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js"() {
40972
- __name(detectBufferParsing, "detectBufferParsing");
40973
- }
40974
- });
40975
-
40976
41057
  // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js
40977
41058
  async function parseJsonBody(streamBody, context, schema) {
40978
41059
  let parsingInput;
@@ -41078,23 +41159,23 @@ var init_writeKey = __esm({
41078
41159
  }
41079
41160
  });
41080
41161
 
41081
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js
41082
- var JsonShapeDeserializer;
41083
- var init_JsonShapeDeserializer = __esm({
41084
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js"() {
41162
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js
41163
+ var JsonShapeDeserializer2;
41164
+ var init_JsonShapeDeserializer2 = __esm({
41165
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js"() {
41085
41166
  init_protocols();
41086
41167
  init_schema4();
41087
41168
  init_serde();
41088
- init_serde();
41089
41169
  init_ConfigurableSerdeContext();
41090
41170
  init_UnionSerde();
41171
+ init_detectBufferParsing();
41091
41172
  init_jsonReviver();
41092
41173
  init_needsReviver();
41093
41174
  init_parseJsonBody();
41094
41175
  init_writeKey();
41095
- JsonShapeDeserializer = class extends SerdeContextConfig {
41176
+ JsonShapeDeserializer2 = class extends SerdeContextConfig {
41096
41177
  static {
41097
- __name(this, "JsonShapeDeserializer");
41178
+ __name(this, "JsonShapeDeserializer2");
41098
41179
  }
41099
41180
  settings;
41100
41181
  constructor(settings) {
@@ -41103,7 +41184,22 @@ var init_JsonShapeDeserializer = __esm({
41103
41184
  }
41104
41185
  async read(schema, data) {
41105
41186
  const reviver = needsReviver(schema) ? jsonReviver : void 0;
41106
- return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
41187
+ let parsed;
41188
+ if (typeof data === "string") {
41189
+ if (data.length === 0) {
41190
+ return {};
41191
+ }
41192
+ parsed = JSON.parse(data, reviver);
41193
+ } else if (data instanceof Uint8Array && detectBufferParsing()) {
41194
+ if (data.byteLength === 0) {
41195
+ return {};
41196
+ }
41197
+ const buf2 = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
41198
+ parsed = JSON.parse(buf2, reviver);
41199
+ } else {
41200
+ parsed = await parseJsonBody(data, this.serdeContext, schema);
41201
+ }
41202
+ return this._read(schema, parsed);
41107
41203
  }
41108
41204
  readObject(schema, data) {
41109
41205
  return this._read(schema, data);
@@ -41113,62 +41209,29 @@ var init_JsonShapeDeserializer = __esm({
41113
41209
  const ns = NormalizedSchema.of(schema);
41114
41210
  if (isObject3) {
41115
41211
  if (ns.isStructSchema()) {
41116
- const record = value;
41117
- const union = ns.isUnionSchema();
41118
- const out = {};
41119
- let nameMap = void 0;
41120
- const { jsonName } = this.settings;
41121
- if (jsonName) {
41122
- nameMap = {};
41123
- }
41124
- let unionSerde;
41125
- if (union) {
41126
- unionSerde = new UnionSerde(record, out);
41127
- }
41128
- for (const [memberName, memberSchema] of ns.structIterator()) {
41129
- let fromKey = memberName;
41130
- if (jsonName) {
41131
- fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
41132
- nameMap[fromKey] = memberName;
41133
- }
41134
- if (union) {
41135
- unionSerde.mark(fromKey);
41136
- }
41137
- if (record[fromKey] != null) {
41138
- out[memberName] = this._read(memberSchema, record[fromKey]);
41139
- }
41140
- }
41141
- if (union) {
41142
- unionSerde.writeUnknown();
41143
- } else if (typeof record.__type === "string") {
41144
- for (const k6 in record) {
41145
- const v = record[k6];
41146
- const t = jsonName ? nameMap[k6] ?? k6 : k6;
41147
- if (!(t in out)) {
41148
- out[t] = v;
41149
- }
41150
- }
41151
- }
41152
- return out;
41212
+ return this._readStruct(ns, value);
41153
41213
  }
41154
41214
  if (Array.isArray(value) && ns.isListSchema()) {
41155
41215
  const listMember = ns.getValueSchema();
41156
- const out = [];
41157
- for (const item of value) {
41158
- out.push(this._read(listMember, item));
41216
+ if (this.needsTransform(listMember)) {
41217
+ for (let i6 = 0; i6 < value.length; ++i6) {
41218
+ value[i6] = this._read(listMember, value[i6]);
41219
+ }
41159
41220
  }
41160
- return out;
41221
+ return value;
41161
41222
  }
41162
41223
  if (ns.isMapSchema()) {
41163
41224
  const mapMember = ns.getValueSchema();
41164
- const out = {};
41165
- for (const _k in value) {
41166
- if (_k === "__proto__") {
41167
- writeKey(out);
41225
+ const map3 = value;
41226
+ if (this.needsTransform(mapMember)) {
41227
+ for (const k6 in map3) {
41228
+ if (k6 === "__proto__") {
41229
+ writeKey(map3);
41230
+ }
41231
+ map3[k6] = this._read(mapMember, map3[k6]);
41168
41232
  }
41169
- out[_k] = this._read(mapMember, value[_k]);
41170
41233
  }
41171
- return out;
41234
+ return map3;
41172
41235
  }
41173
41236
  }
41174
41237
  if (ns.isBlobSchema() && typeof value === "string") {
@@ -41222,292 +41285,723 @@ var init_JsonShapeDeserializer = __esm({
41222
41285
  }
41223
41286
  if (ns.isDocumentSchema()) {
41224
41287
  if (isObject3) {
41225
- const out = Array.isArray(value) ? [] : {};
41226
- for (const k6 in value) {
41227
- if (k6 === "__proto__") {
41228
- writeKey(out);
41288
+ if (Array.isArray(value)) {
41289
+ for (let i6 = 0; i6 < value.length; ++i6) {
41290
+ const v = value[i6];
41291
+ if (!(v instanceof NumericValue)) {
41292
+ value[i6] = this._read(ns, v);
41293
+ }
41229
41294
  }
41230
- const v = value[k6];
41231
- if (v instanceof NumericValue) {
41232
- out[k6] = v;
41233
- } else {
41234
- out[k6] = this._read(ns, v);
41295
+ } else {
41296
+ const doc = value;
41297
+ for (const k6 in doc) {
41298
+ if (k6 === "__proto__") {
41299
+ writeKey(doc);
41300
+ }
41301
+ const v = doc[k6];
41302
+ if (!(v instanceof NumericValue)) {
41303
+ doc[k6] = this._read(ns, v);
41304
+ }
41235
41305
  }
41236
41306
  }
41237
- return out;
41238
- } else {
41239
- return structuredClone(value);
41240
41307
  }
41241
41308
  }
41242
41309
  return value;
41243
41310
  }
41311
+ _readStruct(ns, record) {
41312
+ const union = ns.isUnionSchema();
41313
+ const out = {};
41314
+ let nameMap;
41315
+ const hasType = typeof record.__type === "string";
41316
+ const { jsonName } = this.settings;
41317
+ if (jsonName && hasType) {
41318
+ nameMap = {};
41319
+ }
41320
+ let unionSerde;
41321
+ if (union) {
41322
+ unionSerde = new UnionSerde(record, out);
41323
+ }
41324
+ for (const [memberName, memberSchema] of ns.structIterator()) {
41325
+ let fromKey = memberName;
41326
+ if (jsonName) {
41327
+ fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
41328
+ if (hasType) {
41329
+ nameMap[fromKey] = memberName;
41330
+ }
41331
+ }
41332
+ if (union) {
41333
+ unionSerde.mark(fromKey);
41334
+ }
41335
+ if (record[fromKey] != null) {
41336
+ out[memberName] = this._read(memberSchema, record[fromKey]);
41337
+ }
41338
+ }
41339
+ if (union) {
41340
+ unionSerde.writeUnknown();
41341
+ } else if (hasType) {
41342
+ for (const k6 in record) {
41343
+ const v = record[k6];
41344
+ const t = jsonName ? nameMap[k6] ?? k6 : k6;
41345
+ if (!(t in out)) {
41346
+ out[t] = v;
41347
+ }
41348
+ }
41349
+ }
41350
+ return out;
41351
+ }
41352
+ needsTransform(ns) {
41353
+ if (ns.isBlobSchema() || ns.isTimestampSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
41354
+ return true;
41355
+ }
41356
+ if (ns.isDocumentSchema() || ns.isStructSchema() || ns.isListSchema() || ns.isMapSchema()) {
41357
+ return true;
41358
+ }
41359
+ if (ns.isStringSchema() && ns.getMergedTraits().mediaType) {
41360
+ return true;
41361
+ }
41362
+ return false;
41363
+ }
41244
41364
  };
41245
41365
  }
41246
41366
  });
41247
41367
 
41248
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js
41249
- var NUMERIC_CONTROL_CHAR, JsonReplacer;
41250
- var init_jsonReplacer = __esm({
41251
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js"() {
41368
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js
41369
+ var JsonBytesStringAdapter, warned;
41370
+ var init_JsonBytesStringAdapter = __esm({
41371
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js"() {
41252
41372
  init_serde();
41253
- NUMERIC_CONTROL_CHAR = String.fromCharCode(925);
41254
- JsonReplacer = class {
41373
+ JsonBytesStringAdapter = class _JsonBytesStringAdapter extends Uint8Array {
41255
41374
  static {
41256
- __name(this, "JsonReplacer");
41375
+ __name(this, "JsonBytesStringAdapter");
41257
41376
  }
41258
- values = /* @__PURE__ */ new Map();
41259
- counter = 0;
41260
- stage = 0;
41261
- createReplacer() {
41262
- if (this.stage === 1) {
41263
- throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");
41377
+ string = null;
41378
+ static allocUnsafe(bytes) {
41379
+ if (typeof Buffer === "function") {
41380
+ const buffer = Buffer.allocUnsafe(bytes);
41381
+ return new _JsonBytesStringAdapter(buffer.buffer, buffer.byteOffset, buffer.byteLength);
41264
41382
  }
41265
- if (this.stage === 2) {
41266
- throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
41383
+ return new _JsonBytesStringAdapter(bytes);
41384
+ }
41385
+ toString() {
41386
+ return this.s();
41387
+ }
41388
+ valueOf() {
41389
+ return this.s();
41390
+ }
41391
+ includes(searchString, position) {
41392
+ if (typeof searchString === "string") {
41393
+ return this.s().includes(searchString, position);
41267
41394
  }
41268
- this.stage = 1;
41269
- return (key, value) => {
41270
- if (value instanceof NumericValue) {
41271
- const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string;
41272
- this.values.set(`"${v}"`, value.string);
41273
- return v;
41274
- }
41275
- if (typeof value === "bigint") {
41276
- const s2 = value.toString();
41277
- const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s2;
41278
- this.values.set(`"${v}"`, s2);
41279
- return v;
41280
- }
41281
- return value;
41282
- };
41395
+ return Uint8Array.prototype.includes.call(this, searchString, position);
41283
41396
  }
41284
- replaceInJson(json) {
41285
- if (this.stage === 0) {
41286
- throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");
41397
+ indexOf(searchString, position) {
41398
+ if (typeof searchString === "string") {
41399
+ return this.s().indexOf(searchString, position);
41287
41400
  }
41288
- if (this.stage === 2) {
41289
- throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
41401
+ return Uint8Array.prototype.indexOf.call(this, searchString, position);
41402
+ }
41403
+ lastIndexOf(searchString, position) {
41404
+ if (typeof searchString === "string") {
41405
+ return this.s().lastIndexOf(searchString, position);
41290
41406
  }
41291
- this.stage = 2;
41292
- if (this.counter === 0) {
41293
- return json;
41407
+ const fn = Uint8Array.prototype.lastIndexOf;
41408
+ if (position !== void 0) {
41409
+ return fn.call(this, searchString, position);
41294
41410
  }
41295
- for (const [key, value] of this.values) {
41296
- json = json.replace(key, value);
41411
+ return fn.call(this, searchString);
41412
+ }
41413
+ startsWith(searchString, position) {
41414
+ return this.s().startsWith(searchString, position);
41415
+ }
41416
+ endsWith(searchString, endPosition) {
41417
+ return this.s().endsWith(searchString, endPosition);
41418
+ }
41419
+ match(regexp) {
41420
+ return this.s().match(regexp);
41421
+ }
41422
+ replace(searchValue, replaceValue) {
41423
+ return this.s().replace(searchValue, replaceValue);
41424
+ }
41425
+ search(regexp) {
41426
+ return this.s().search(regexp);
41427
+ }
41428
+ split(separator, limit) {
41429
+ return this.s().split(separator, limit);
41430
+ }
41431
+ substring(start, end2) {
41432
+ return this.s().substring(start, end2);
41433
+ }
41434
+ trim() {
41435
+ return this.s().trim();
41436
+ }
41437
+ trimStart() {
41438
+ return this.s().trimStart();
41439
+ }
41440
+ trimEnd() {
41441
+ return this.s().trimEnd();
41442
+ }
41443
+ charAt(pos2) {
41444
+ return this.s().charAt(pos2);
41445
+ }
41446
+ charCodeAt(index) {
41447
+ return this.s().charCodeAt(index);
41448
+ }
41449
+ padStart(maxLength, fillString) {
41450
+ return this.s().padStart(maxLength, fillString);
41451
+ }
41452
+ padEnd(maxLength, fillString) {
41453
+ return this.s().padEnd(maxLength, fillString);
41454
+ }
41455
+ repeat(count) {
41456
+ return this.s().repeat(count);
41457
+ }
41458
+ toUpperCase() {
41459
+ return this.s().toUpperCase();
41460
+ }
41461
+ toLowerCase() {
41462
+ return this.s().toLowerCase();
41463
+ }
41464
+ s() {
41465
+ if (this.string == null) {
41466
+ const n3 = Date.now();
41467
+ if (n3 > warned + 6e4) {
41468
+ console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error.");
41469
+ warned = n3;
41470
+ }
41471
+ this.string = toUtf8(this);
41297
41472
  }
41298
- return json;
41473
+ return this.string;
41299
41474
  }
41300
41475
  };
41476
+ warned = 0;
41301
41477
  }
41302
41478
  });
41303
41479
 
41304
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js
41305
- var JsonShapeSerializer;
41306
- var init_JsonShapeSerializer = __esm({
41307
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js"() {
41480
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js
41481
+ function alloc(size) {
41482
+ return JsonBytesStringAdapter.allocUnsafe(size);
41483
+ }
41484
+ var encoder, OPEN_BRACE, CLOSE_BRACE, OPEN_BRACKET, CLOSE_BRACKET, QUOTE, COLON, COMMA, BACKSLASH, TRUE, FALSE, NULL, ESCAPE_TABLE, INITIAL_BUFFER_SIZE2, JsonShapeSerializer2;
41485
+ var init_JsonShapeSerializer2 = __esm({
41486
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js"() {
41308
41487
  init_protocols();
41309
41488
  init_schema4();
41310
41489
  init_serde();
41311
41490
  init_ConfigurableSerdeContext();
41312
- init_jsonReplacer();
41313
- init_writeKey();
41314
- JsonShapeSerializer = class extends SerdeContextConfig {
41491
+ init_JsonBytesStringAdapter();
41492
+ encoder = new TextEncoder();
41493
+ OPEN_BRACE = 123;
41494
+ CLOSE_BRACE = 125;
41495
+ OPEN_BRACKET = 91;
41496
+ CLOSE_BRACKET = 93;
41497
+ QUOTE = 34;
41498
+ COLON = 58;
41499
+ COMMA = 44;
41500
+ BACKSLASH = 92;
41501
+ TRUE = new Uint8Array([116, 114, 117, 101]);
41502
+ FALSE = new Uint8Array([102, 97, 108, 115, 101]);
41503
+ NULL = new Uint8Array([110, 117, 108, 108]);
41504
+ ESCAPE_TABLE = new Array(128).fill(null);
41505
+ ESCAPE_TABLE[8] = "b";
41506
+ ESCAPE_TABLE[9] = "t";
41507
+ ESCAPE_TABLE[10] = "n";
41508
+ ESCAPE_TABLE[12] = "f";
41509
+ ESCAPE_TABLE[13] = "r";
41510
+ ESCAPE_TABLE[34] = '"';
41511
+ ESCAPE_TABLE[92] = "\\";
41512
+ for (let i6 = 0; i6 < 32; i6++) {
41513
+ if (ESCAPE_TABLE[i6] === null) {
41514
+ ESCAPE_TABLE[i6] = "u00" + i6.toString(16).padStart(2, "0");
41515
+ }
41516
+ }
41517
+ INITIAL_BUFFER_SIZE2 = 2048;
41518
+ __name(alloc, "alloc");
41519
+ JsonShapeSerializer2 = class _JsonShapeSerializer2 extends SerdeContextConfig {
41315
41520
  static {
41316
- __name(this, "JsonShapeSerializer");
41521
+ __name(this, "JsonShapeSerializer2");
41317
41522
  }
41318
41523
  settings;
41319
- buffer;
41320
- useReplacer = false;
41524
+ json;
41525
+ i = 0;
41321
41526
  rootSchema;
41527
+ rawValue;
41528
+ passthrough = false;
41322
41529
  constructor(settings) {
41323
41530
  super();
41324
41531
  this.settings = settings;
41532
+ this.json = alloc(INITIAL_BUFFER_SIZE2);
41325
41533
  }
41326
41534
  write(schema, value) {
41535
+ this.i = 0;
41536
+ this.rawValue = value;
41327
41537
  this.rootSchema = NormalizedSchema.of(schema);
41328
- this.buffer = this._write(this.rootSchema, value);
41538
+ this.passthrough = this.rootSchema.isBlobSchema() || this.rootSchema.isStringSchema();
41539
+ if (!this.passthrough) {
41540
+ this.writeValue(this.rootSchema, value, void 0);
41541
+ }
41542
+ }
41543
+ writeDiscriminatedDocument(schema, value) {
41544
+ this.i = 0;
41545
+ this.rootSchema = NormalizedSchema.of(schema);
41546
+ const ns = this.rootSchema;
41547
+ if (ns.isStructSchema() && value != null && typeof value === "object") {
41548
+ this.writeValue(ns, value, void 0);
41549
+ const prefix = `"__type":"${ns.getName(true) ?? "Unknown"}",`;
41550
+ const z = prefix.length;
41551
+ this.ensure(z);
41552
+ this.json.copyWithin(1 + z, 1, this.i);
41553
+ encoder.encodeInto(prefix, this.json.subarray(1));
41554
+ this.i += z;
41555
+ } else {
41556
+ this.writeValue(ns, value, void 0);
41557
+ }
41329
41558
  }
41330
41559
  flush() {
41331
- const { rootSchema, useReplacer } = this;
41332
41560
  this.rootSchema = void 0;
41333
- this.useReplacer = false;
41334
- if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
41335
- if (!useReplacer) {
41336
- return JSON.stringify(this.buffer);
41561
+ const finalPosition = this.i;
41562
+ this.i = 0;
41563
+ const raw = this.rawValue;
41564
+ this.rawValue = void 0;
41565
+ if (finalPosition === 0) {
41566
+ return raw;
41567
+ }
41568
+ const result2 = this.json.subarray(0, finalPosition);
41569
+ this.json = alloc(INITIAL_BUFFER_SIZE2);
41570
+ return result2;
41571
+ }
41572
+ ensure(byteCount) {
41573
+ const { i: i6, json } = this;
41574
+ if (i6 + byteCount > json.length) {
41575
+ let newSize = json.length * 2;
41576
+ while (newSize < i6 + byteCount) {
41577
+ newSize *= 2;
41337
41578
  }
41338
- const replacer = new JsonReplacer();
41339
- return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
41579
+ const next = alloc(newSize);
41580
+ next.set(this.json);
41581
+ this.json = next;
41340
41582
  }
41341
- return this.buffer;
41342
41583
  }
41343
- writeDiscriminatedDocument(schema, value) {
41344
- this.write(schema, value);
41345
- if (typeof this.buffer === "object") {
41346
- this.buffer.__type = NormalizedSchema.of(schema).getName(true);
41584
+ writeAscii(s2) {
41585
+ const z = s2.length;
41586
+ this.ensure(z);
41587
+ let { i: i6, json } = this;
41588
+ for (let j6 = 0; j6 < z; ++j6) {
41589
+ json[i6] = s2.charCodeAt(j6);
41590
+ i6 += 1;
41347
41591
  }
41592
+ this.i = i6;
41348
41593
  }
41349
- _write(schema, value, container) {
41350
- const isObject3 = value !== null && typeof value === "object";
41351
- const ns = NormalizedSchema.of(schema);
41352
- if (isObject3) {
41353
- if (ns.isStructSchema()) {
41354
- const record = value;
41355
- const out = {};
41356
- const { jsonName } = this.settings;
41357
- let nameMap = void 0;
41358
- if (jsonName) {
41359
- nameMap = {};
41360
- }
41361
- let outCount = 0;
41362
- for (const [memberName, memberSchema] of ns.structIterator()) {
41363
- const serializableValue = this._write(memberSchema, record[memberName], ns);
41364
- if (serializableValue !== void 0) {
41365
- let targetKey = memberName;
41366
- if (jsonName) {
41367
- targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
41368
- nameMap[memberName] = targetKey;
41369
- }
41370
- out[targetKey] = serializableValue;
41371
- outCount++;
41594
+ writeAsciiQuoted(s2) {
41595
+ const z = s2.length;
41596
+ this.ensure(z + 4);
41597
+ let { json, i: i6 } = this;
41598
+ json[i6++] = QUOTE;
41599
+ for (let j6 = 0; j6 < z; ++j6) {
41600
+ json[i6++] = s2.charCodeAt(j6);
41601
+ }
41602
+ json[i6++] = QUOTE;
41603
+ this.i = i6;
41604
+ }
41605
+ writeJsonString(s2) {
41606
+ this.ensure(s2.length * 3 + 2);
41607
+ this.json[this.i++] = QUOTE;
41608
+ const z = s2.length;
41609
+ for (let j6 = 0; j6 < z; ++j6) {
41610
+ const c6 = s2.charCodeAt(j6);
41611
+ if (c6 > 34 && c6 < 92) {
41612
+ this.json[this.i++] = c6;
41613
+ } else if (c6 < 128) {
41614
+ const esc = ESCAPE_TABLE[c6];
41615
+ if (esc !== null) {
41616
+ this.ensure(esc.length + 1);
41617
+ this.json[this.i++] = BACKSLASH;
41618
+ for (let k6 = 0; k6 < esc.length; k6++) {
41619
+ this.json[this.i++] = esc.charCodeAt(k6);
41372
41620
  }
41621
+ } else {
41622
+ this.json[this.i++] = c6;
41373
41623
  }
41374
- if (ns.isUnionSchema() && outCount === 0) {
41375
- const { $unknown } = record;
41376
- if (Array.isArray($unknown)) {
41377
- const [k6, v] = $unknown;
41378
- if (k6 === "__proto__") {
41379
- writeKey(out);
41380
- }
41381
- out[k6] = this._write(15, v);
41382
- }
41383
- } else if (typeof record.__type === "string") {
41384
- for (const k6 in record) {
41385
- const v = record[k6];
41386
- const targetKey = jsonName ? nameMap[k6] ?? k6 : k6;
41387
- if (!(targetKey in out)) {
41388
- out[targetKey] = this._write(15, v);
41389
- }
41390
- }
41624
+ } else if (c6 >= 55296 && c6 <= 56319) {
41625
+ const next = j6 + 1 < z ? s2.charCodeAt(j6 + 1) : 0;
41626
+ if (next >= 56320 && next <= 57343) {
41627
+ this.ensure(4);
41628
+ const { written } = encoder.encodeInto(s2.substring(j6, j6 + 2), this.json.subarray(this.i));
41629
+ this.i += written;
41630
+ ++j6;
41631
+ } else {
41632
+ this.ensure(6);
41633
+ this.writeUnicodeEscape(c6);
41391
41634
  }
41392
- return out;
41635
+ } else if (c6 >= 56320 && c6 <= 57343) {
41636
+ this.ensure(6);
41637
+ this.writeUnicodeEscape(c6);
41638
+ } else {
41639
+ let { i: i6, json } = this;
41640
+ if (c6 < 2048) {
41641
+ json[i6++] = 192 | c6 >> 6;
41642
+ json[i6++] = 128 | c6 & 63;
41643
+ } else {
41644
+ json[i6++] = 224 | c6 >> 12;
41645
+ json[i6++] = 128 | c6 >> 6 & 63;
41646
+ json[i6++] = 128 | c6 & 63;
41647
+ }
41648
+ this.i = i6;
41393
41649
  }
41394
- if (Array.isArray(value) && ns.isListSchema()) {
41395
- const listMember = ns.getValueSchema();
41396
- const out = [];
41397
- const sparse = !!ns.getMergedTraits().sparse;
41398
- for (const item of value) {
41399
- if (sparse || item != null) {
41400
- out.push(this._write(listMember, item));
41650
+ }
41651
+ this.json[this.i++] = QUOTE;
41652
+ }
41653
+ writeUnicodeEscape(code) {
41654
+ let { json, i: i6 } = this;
41655
+ json[i6++] = BACKSLASH;
41656
+ json[i6++] = 117;
41657
+ const hex = code.toString(16).padStart(4, "0");
41658
+ for (let j6 = 0; j6 < 4; ++j6) {
41659
+ json[i6++] = hex.charCodeAt(j6);
41660
+ }
41661
+ this.i = i6;
41662
+ }
41663
+ static B64 = (() => {
41664
+ const chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
41665
+ const table3 = new Uint8Array(64);
41666
+ for (let i6 = 0; i6 < 64; ++i6) {
41667
+ table3[i6] = chars2.charCodeAt(i6);
41668
+ }
41669
+ return table3;
41670
+ })();
41671
+ writeBase64(data) {
41672
+ const b64Len = Math.ceil(data.length / 3) * 4;
41673
+ this.ensure(b64Len + 2);
41674
+ const json = this.json;
41675
+ const B64 = _JsonShapeSerializer2.B64;
41676
+ let i6 = this.i;
41677
+ json[i6++] = QUOTE;
41678
+ const len = data.length;
41679
+ const remainder = len % 3;
41680
+ const mainLen = len - remainder;
41681
+ for (let j6 = 0; j6 < mainLen; j6 += 3) {
41682
+ const a6 = data[j6];
41683
+ const b6 = data[j6 + 1];
41684
+ const c6 = data[j6 + 2];
41685
+ json[i6++] = B64[a6 >> 2];
41686
+ json[i6++] = B64[(a6 & 3) << 4 | b6 >> 4];
41687
+ json[i6++] = B64[(b6 & 15) << 2 | c6 >> 6];
41688
+ json[i6++] = B64[c6 & 63];
41689
+ }
41690
+ if (remainder === 2) {
41691
+ const a6 = data[mainLen];
41692
+ const b6 = data[mainLen + 1];
41693
+ json[i6++] = B64[a6 >> 2];
41694
+ json[i6++] = B64[(a6 & 3) << 4 | b6 >> 4];
41695
+ json[i6++] = B64[(b6 & 15) << 2];
41696
+ json[i6++] = 61;
41697
+ } else if (remainder === 1) {
41698
+ const a6 = data[mainLen];
41699
+ json[i6++] = B64[a6 >> 2];
41700
+ json[i6++] = B64[(a6 & 3) << 4];
41701
+ json[i6++] = 61;
41702
+ json[i6++] = 61;
41703
+ }
41704
+ json[i6++] = QUOTE;
41705
+ this.i = i6;
41706
+ }
41707
+ writeValue(schema, value, container) {
41708
+ if (value == null) {
41709
+ if (container?.isStructSchema()) {
41710
+ if (value === void 0) {
41711
+ const ns2 = NormalizedSchema.of(schema);
41712
+ if (ns2.isIdempotencyToken()) {
41713
+ this.writeAsciiQuoted(generateIdempotencyToken());
41714
+ return;
41401
41715
  }
41402
41716
  }
41403
- return out;
41717
+ return;
41404
41718
  }
41405
- if (ns.isMapSchema()) {
41406
- const mapMember = ns.getValueSchema();
41407
- const out = {};
41408
- const sparse = !!ns.getMergedTraits().sparse;
41409
- for (const _k in value) {
41410
- const _v = value[_k];
41411
- if (sparse || _v != null) {
41412
- if (_k === "__proto__") {
41413
- writeKey(out);
41414
- }
41415
- out[_k] = this._write(mapMember, _v);
41416
- }
41719
+ this.ensure(4);
41720
+ this.json.set(NULL, this.i);
41721
+ this.i += 4;
41722
+ return;
41723
+ }
41724
+ const ns = NormalizedSchema.of(schema);
41725
+ const isObject3 = typeof value === "object";
41726
+ if (ns.isStringSchema()) {
41727
+ const mediaType = ns.getMergedTraits().mediaType;
41728
+ if (mediaType) {
41729
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
41730
+ if (isJson) {
41731
+ this.writeJsonString(LazyJsonString.from(value).toString());
41732
+ return;
41417
41733
  }
41418
- return out;
41734
+ }
41735
+ }
41736
+ if (isObject3) {
41737
+ if (ns.isStructSchema()) {
41738
+ this.writeStruct(ns, value);
41739
+ return;
41740
+ }
41741
+ if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
41742
+ this.writeList(ns, value, ns.isDocumentSchema());
41743
+ return;
41744
+ }
41745
+ if (ns.isMapSchema()) {
41746
+ this.writeMap(ns, value, false);
41747
+ return;
41419
41748
  }
41420
41749
  if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
41421
- if (ns === this.rootSchema) {
41422
- return value;
41423
- }
41424
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
41750
+ this.writeBase64(value);
41751
+ return;
41425
41752
  }
41426
41753
  if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
41427
- const format28 = determineTimestampFormat(ns, this.settings);
41428
- switch (format28) {
41429
- case 5:
41430
- return value.toISOString().replace(".000Z", "Z");
41431
- case 6:
41432
- return dateToUtcString(value);
41433
- case 7:
41434
- return value.getTime() / 1e3;
41435
- default:
41436
- console.warn("Missing timestamp format, using epoch seconds", value);
41437
- return value.getTime() / 1e3;
41438
- }
41754
+ this.writeTimestamp(ns, value);
41755
+ return;
41439
41756
  }
41440
41757
  if (value instanceof NumericValue) {
41441
- this.useReplacer = true;
41758
+ this.writeAscii(value.string);
41759
+ return;
41442
41760
  }
41761
+ if (ns.isDocumentSchema()) {
41762
+ if (Array.isArray(value)) {
41763
+ this.writeList(ns, value, true);
41764
+ } else {
41765
+ this.writeMap(ns, value, true);
41766
+ }
41767
+ return;
41768
+ }
41769
+ const json = JSON.stringify(value);
41770
+ this.writeAscii(json);
41771
+ return;
41443
41772
  }
41444
- if (value === null && container?.isStructSchema()) {
41445
- return void 0;
41773
+ if (typeof value === "string") {
41774
+ if (ns.isBlobSchema()) {
41775
+ const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
41776
+ this.writeAsciiQuoted(b64);
41777
+ return;
41778
+ }
41779
+ this.writeJsonString(value);
41780
+ return;
41446
41781
  }
41447
- if (ns.isStringSchema()) {
41448
- if (typeof value === "undefined" && ns.isIdempotencyToken()) {
41449
- return generateIdempotencyToken();
41782
+ if (typeof value === "number") {
41783
+ if (Math.abs(value) === Infinity || Number.isNaN(value)) {
41784
+ this.writeAsciiQuoted(String(value));
41785
+ return;
41450
41786
  }
41451
- const mediaType = ns.getMergedTraits().mediaType;
41452
- if (value != null && mediaType) {
41453
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
41454
- if (isJson) {
41455
- return LazyJsonString.from(value);
41456
- }
41787
+ const numStr = String(value);
41788
+ this.writeAscii(numStr);
41789
+ return;
41790
+ }
41791
+ if (typeof value === "boolean") {
41792
+ this.ensure(5);
41793
+ let { i: i6, json } = this;
41794
+ if (value) {
41795
+ json.set(TRUE, i6);
41796
+ i6 += 4;
41797
+ } else {
41798
+ json.set(FALSE, i6);
41799
+ i6 += 5;
41457
41800
  }
41458
- return value;
41801
+ this.i = i6;
41802
+ return;
41459
41803
  }
41460
- if (typeof value === "number" && ns.isNumericSchema()) {
41461
- if (Math.abs(value) === Infinity || isNaN(value)) {
41462
- return String(value);
41804
+ if (typeof value === "bigint") {
41805
+ this.writeAscii(value.toString());
41806
+ return;
41807
+ }
41808
+ this.writeAscii(String(value));
41809
+ }
41810
+ writeStruct(ns, value) {
41811
+ this.ensure(2);
41812
+ this.json[this.i++] = OPEN_BRACE;
41813
+ let wroteAny = false;
41814
+ const hasType = typeof value.__type === "string";
41815
+ let writtenKeys;
41816
+ if (hasType) {
41817
+ writtenKeys = /* @__PURE__ */ new Set();
41818
+ }
41819
+ for (const [memberName, memberSchema] of ns.structIterator()) {
41820
+ const item = value[memberName];
41821
+ if (item == null && !memberSchema.isIdempotencyToken()) {
41822
+ continue;
41463
41823
  }
41464
- return value;
41824
+ if (wroteAny) {
41825
+ this.ensure(1);
41826
+ this.json[this.i++] = COMMA;
41827
+ }
41828
+ wroteAny = true;
41829
+ const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;
41830
+ if (writtenKeys) {
41831
+ writtenKeys.add(memberName);
41832
+ writtenKeys.add(targetKey);
41833
+ }
41834
+ this.writeAsciiQuoted(targetKey);
41835
+ this.json[this.i++] = COLON;
41836
+ this.writeValue(memberSchema, item, ns);
41465
41837
  }
41466
- if (typeof value === "string" && ns.isBlobSchema()) {
41467
- if (ns === this.rootSchema) {
41468
- return value;
41838
+ if (!wroteAny && ns.isUnionSchema()) {
41839
+ const { $unknown } = value;
41840
+ if (Array.isArray($unknown)) {
41841
+ const [k6, v] = $unknown;
41842
+ this.writeAsciiQuoted(k6);
41843
+ this.ensure(1);
41844
+ this.json[this.i++] = COLON;
41845
+ this.writeValue(15, v, ns);
41846
+ }
41847
+ } else if (hasType) {
41848
+ for (const k6 in value) {
41849
+ if (writtenKeys.has(k6)) {
41850
+ continue;
41851
+ }
41852
+ writtenKeys.add(k6);
41853
+ const v = value[k6];
41854
+ if (wroteAny) {
41855
+ this.ensure(1);
41856
+ this.json[this.i++] = COMMA;
41857
+ }
41858
+ wroteAny = true;
41859
+ this.writeAsciiQuoted(k6);
41860
+ this.ensure(1);
41861
+ this.json[this.i++] = COLON;
41862
+ this.writeValue(15, v, void 0);
41469
41863
  }
41470
- return (this.serdeContext?.base64Encoder ?? toBase64)(value);
41471
41864
  }
41472
- if (typeof value === "bigint") {
41473
- this.useReplacer = true;
41865
+ this.ensure(1);
41866
+ this.json[this.i++] = CLOSE_BRACE;
41867
+ }
41868
+ writeList(ns, value, isDocument) {
41869
+ const sparse = !!ns.getMergedTraits().sparse;
41870
+ const valueSchema = ns.getValueSchema();
41871
+ if (!isDocument) {
41872
+ if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
41873
+ let hasSpecials = false;
41874
+ for (let i6 = 0; i6 < value.length; ++i6) {
41875
+ const v = value[i6];
41876
+ if (Number.isNaN(v) || v === Infinity || v === -Infinity || v == null && !sparse) {
41877
+ hasSpecials = true;
41878
+ break;
41879
+ }
41880
+ }
41881
+ let json;
41882
+ if (!hasSpecials) {
41883
+ json = JSON.stringify(value);
41884
+ } else {
41885
+ const out = [];
41886
+ for (let i6 = 0; i6 < value.length; ++i6) {
41887
+ const v = value[i6];
41888
+ if (v == null && !sparse)
41889
+ continue;
41890
+ if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
41891
+ out.push(String(v));
41892
+ } else {
41893
+ out.push(v);
41894
+ }
41895
+ }
41896
+ json = JSON.stringify(out);
41897
+ }
41898
+ this.ensure(json.length * 3);
41899
+ this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
41900
+ return;
41901
+ }
41474
41902
  }
41475
- if (ns.isDocumentSchema()) {
41476
- if (isObject3) {
41477
- const out = Array.isArray(value) ? [] : {};
41903
+ this.ensure(2);
41904
+ this.json[this.i++] = OPEN_BRACKET;
41905
+ let wroteFirstItem = false;
41906
+ for (let i6 = 0; i6 < value.length; ++i6) {
41907
+ const item = value[i6];
41908
+ if (isDocument ? item === void 0 : item == null && !sparse) {
41909
+ continue;
41910
+ }
41911
+ if (wroteFirstItem) {
41912
+ this.ensure(1);
41913
+ this.json[this.i++] = COMMA;
41914
+ }
41915
+ this.writeValue(valueSchema, item, void 0);
41916
+ wroteFirstItem = true;
41917
+ }
41918
+ this.ensure(1);
41919
+ this.json[this.i++] = CLOSE_BRACKET;
41920
+ }
41921
+ writeMap(ns, value, isDocument) {
41922
+ const sparse = !!ns.getMergedTraits().sparse;
41923
+ const valueSchema = ns.getValueSchema();
41924
+ if (!isDocument) {
41925
+ if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
41926
+ let modifications;
41478
41927
  for (const k6 in value) {
41479
41928
  const v = value[k6];
41480
- if (k6 === "__proto__") {
41481
- writeKey(out);
41482
- }
41483
- if (v instanceof NumericValue) {
41484
- this.useReplacer = true;
41485
- out[k6] = v;
41486
- } else {
41487
- out[k6] = this._write(ns, v);
41929
+ if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
41930
+ (modifications ??= {})[k6] = v;
41931
+ value[k6] = String(v);
41932
+ } else if (v === null && !sparse) {
41933
+ (modifications ??= {})[k6] = null;
41934
+ value[k6] = void 0;
41488
41935
  }
41489
41936
  }
41490
- return out;
41491
- } else {
41492
- return structuredClone(value);
41937
+ const json = JSON.stringify(value);
41938
+ if (modifications) {
41939
+ Object.assign(value, modifications);
41940
+ }
41941
+ this.ensure(json.length * 3);
41942
+ this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
41943
+ return;
41944
+ }
41945
+ }
41946
+ this.ensure(2);
41947
+ this.json[this.i++] = OPEN_BRACE;
41948
+ let first = true;
41949
+ for (const k6 in value) {
41950
+ const v = value[k6];
41951
+ if (isDocument ? v === void 0 : v == null && !sparse) {
41952
+ continue;
41953
+ }
41954
+ if (!first) {
41955
+ this.ensure(1);
41956
+ this.json[this.i++] = COMMA;
41957
+ }
41958
+ first = false;
41959
+ this.writeJsonString(k6);
41960
+ this.ensure(1);
41961
+ this.json[this.i++] = COLON;
41962
+ this.writeValue(valueSchema, v, void 0);
41963
+ }
41964
+ this.ensure(1);
41965
+ this.json[this.i++] = CLOSE_BRACE;
41966
+ }
41967
+ writeTimestamp(ns, value) {
41968
+ const format28 = determineTimestampFormat(ns, this.settings);
41969
+ switch (format28) {
41970
+ case 5: {
41971
+ const iso = value.toISOString().replace(".000Z", "Z");
41972
+ this.writeAsciiQuoted(iso);
41973
+ return;
41974
+ }
41975
+ case 6: {
41976
+ this.writeAsciiQuoted(dateToUtcString(value));
41977
+ return;
41978
+ }
41979
+ case 7: {
41980
+ const epochSecs = String(value.getTime() / 1e3);
41981
+ this.writeAscii(epochSecs);
41982
+ return;
41983
+ }
41984
+ default: {
41985
+ const epochSecs = String(value.getTime() / 1e3);
41986
+ this.writeAscii(epochSecs);
41987
+ return;
41493
41988
  }
41494
41989
  }
41495
- return value;
41496
41990
  }
41497
41991
  };
41498
41992
  }
41499
41993
  });
41500
41994
 
41501
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js
41502
- var JsonCodec;
41503
- var init_JsonCodec = __esm({
41504
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js"() {
41995
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js
41996
+ var JsonCodec2;
41997
+ var init_JsonCodec2 = __esm({
41998
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js"() {
41505
41999
  init_ConfigurableSerdeContext();
41506
- init_JsonShapeDeserializer();
41507
- init_JsonShapeSerializer();
41508
- JsonCodec = class extends SerdeContextConfig {
42000
+ init_JsonShapeDeserializer2();
42001
+ init_JsonShapeSerializer2();
42002
+ JsonCodec2 = class extends SerdeContextConfig {
41509
42003
  static {
41510
- __name(this, "JsonCodec");
42004
+ __name(this, "JsonCodec2");
41511
42005
  }
41512
42006
  settings;
41513
42007
  constructor(settings) {
@@ -41515,12 +42009,12 @@ var init_JsonCodec = __esm({
41515
42009
  this.settings = settings;
41516
42010
  }
41517
42011
  createSerializer() {
41518
- const serializer = new JsonShapeSerializer(this.settings);
42012
+ const serializer = new JsonShapeSerializer2(this.settings);
41519
42013
  serializer.setSerdeContext(this.serdeContext);
41520
42014
  return serializer;
41521
42015
  }
41522
42016
  createDeserializer() {
41523
- const deserializer = new JsonShapeDeserializer(this.settings);
42017
+ const deserializer = new JsonShapeDeserializer2(this.settings);
41524
42018
  deserializer.setSerdeContext(this.serdeContext);
41525
42019
  return deserializer;
41526
42020
  }
@@ -41535,7 +42029,7 @@ var init_AwsJsonRpcProtocol = __esm({
41535
42029
  init_protocols();
41536
42030
  init_schema4();
41537
42031
  init_ProtocolLib();
41538
- init_JsonCodec();
42032
+ init_JsonCodec2();
41539
42033
  init_parseJsonBody();
41540
42034
  AwsJsonRpcProtocol = class extends RpcProtocol {
41541
42035
  static {
@@ -41553,7 +42047,7 @@ var init_AwsJsonRpcProtocol = __esm({
41553
42047
  errorTypeRegistries: errorTypeRegistries6
41554
42048
  });
41555
42049
  this.serviceTarget = serviceTarget;
41556
- this.codec = jsonCodec ?? new JsonCodec({
42050
+ this.codec = jsonCodec ?? new JsonCodec2({
41557
42051
  timestampFormat: {
41558
42052
  useTrait: true,
41559
42053
  default: 7
@@ -41683,7 +42177,7 @@ var init_AwsRestJsonProtocol = __esm({
41683
42177
  init_protocols();
41684
42178
  init_schema4();
41685
42179
  init_ProtocolLib();
41686
- init_JsonCodec();
42180
+ init_JsonCodec2();
41687
42181
  init_parseJsonBody();
41688
42182
  AwsRestJsonProtocol = class extends HttpBindingProtocol {
41689
42183
  static {
@@ -41693,7 +42187,7 @@ var init_AwsRestJsonProtocol = __esm({
41693
42187
  deserializer;
41694
42188
  codec;
41695
42189
  mixin = new ProtocolLib();
41696
- constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries6 }) {
42190
+ constructor({ defaultNamespace, errorTypeRegistries: errorTypeRegistries6, jsonCodec }) {
41697
42191
  super({
41698
42192
  defaultNamespace,
41699
42193
  errorTypeRegistries: errorTypeRegistries6
@@ -41706,7 +42200,7 @@ var init_AwsRestJsonProtocol = __esm({
41706
42200
  httpBindings: true,
41707
42201
  jsonName: true
41708
42202
  };
41709
- this.codec = new JsonCodec(settings);
42203
+ this.codec = jsonCodec ?? new JsonCodec2(settings);
41710
42204
  this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
41711
42205
  this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
41712
42206
  }
@@ -41771,24 +42265,23 @@ var init_AwsRestJsonProtocol = __esm({
41771
42265
  }
41772
42266
  });
41773
42267
 
41774
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js
41775
- var JsonShapeDeserializer2;
41776
- var init_JsonShapeDeserializer2 = __esm({
41777
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js"() {
42268
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js
42269
+ var JsonShapeDeserializer;
42270
+ var init_JsonShapeDeserializer = __esm({
42271
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeDeserializer.js"() {
41778
42272
  init_protocols();
41779
42273
  init_schema4();
41780
42274
  init_serde();
41781
42275
  init_serde();
41782
42276
  init_ConfigurableSerdeContext();
41783
42277
  init_UnionSerde();
41784
- init_detectBufferParsing();
41785
42278
  init_jsonReviver();
41786
42279
  init_needsReviver();
41787
42280
  init_parseJsonBody();
41788
42281
  init_writeKey();
41789
- JsonShapeDeserializer2 = class extends SerdeContextConfig {
42282
+ JsonShapeDeserializer = class extends SerdeContextConfig {
41790
42283
  static {
41791
- __name(this, "JsonShapeDeserializer2");
42284
+ __name(this, "JsonShapeDeserializer");
41792
42285
  }
41793
42286
  settings;
41794
42287
  constructor(settings) {
@@ -41797,16 +42290,7 @@ var init_JsonShapeDeserializer2 = __esm({
41797
42290
  }
41798
42291
  async read(schema, data) {
41799
42292
  const reviver = needsReviver(schema) ? jsonReviver : void 0;
41800
- let parsed;
41801
- if (typeof data === "string") {
41802
- parsed = JSON.parse(data, reviver);
41803
- } else if (data instanceof Uint8Array && detectBufferParsing()) {
41804
- const buf2 = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
41805
- parsed = JSON.parse(buf2, reviver);
41806
- } else {
41807
- parsed = await parseJsonBody(data, this.serdeContext);
41808
- }
41809
- return this._read(schema, parsed);
42293
+ return this._read(schema, typeof data === "string" ? JSON.parse(data, reviver) : await parseJsonBody(data, this.serdeContext, schema));
41810
42294
  }
41811
42295
  readObject(schema, data) {
41812
42296
  return this._read(schema, data);
@@ -41816,25 +42300,62 @@ var init_JsonShapeDeserializer2 = __esm({
41816
42300
  const ns = NormalizedSchema.of(schema);
41817
42301
  if (isObject3) {
41818
42302
  if (ns.isStructSchema()) {
41819
- return this._readStruct(ns, value);
42303
+ const record = value;
42304
+ const union = ns.isUnionSchema();
42305
+ const out = {};
42306
+ let nameMap = void 0;
42307
+ const { jsonName } = this.settings;
42308
+ if (jsonName) {
42309
+ nameMap = {};
42310
+ }
42311
+ let unionSerde;
42312
+ if (union) {
42313
+ unionSerde = new UnionSerde(record, out);
42314
+ }
42315
+ for (const [memberName, memberSchema] of ns.structIterator()) {
42316
+ let fromKey = memberName;
42317
+ if (jsonName) {
42318
+ fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
42319
+ nameMap[fromKey] = memberName;
42320
+ }
42321
+ if (union) {
42322
+ unionSerde.mark(fromKey);
42323
+ }
42324
+ if (record[fromKey] != null) {
42325
+ out[memberName] = this._read(memberSchema, record[fromKey]);
42326
+ }
42327
+ }
42328
+ if (union) {
42329
+ unionSerde.writeUnknown();
42330
+ } else if (typeof record.__type === "string") {
42331
+ for (const k6 in record) {
42332
+ const v = record[k6];
42333
+ const t = jsonName ? nameMap[k6] ?? k6 : k6;
42334
+ if (!(t in out)) {
42335
+ out[t] = v;
42336
+ }
42337
+ }
42338
+ }
42339
+ return out;
41820
42340
  }
41821
42341
  if (Array.isArray(value) && ns.isListSchema()) {
41822
42342
  const listMember = ns.getValueSchema();
41823
- for (let i6 = 0; i6 < value.length; ++i6) {
41824
- value[i6] = this._read(listMember, value[i6]);
42343
+ const out = [];
42344
+ for (const item of value) {
42345
+ out.push(this._read(listMember, item));
41825
42346
  }
41826
- return value;
42347
+ return out;
41827
42348
  }
41828
42349
  if (ns.isMapSchema()) {
41829
42350
  const mapMember = ns.getValueSchema();
41830
- const map3 = value;
41831
- for (const k6 in map3) {
41832
- if (k6 === "__proto__") {
41833
- writeKey(map3);
42351
+ const out = {};
42352
+ for (const _k in value) {
42353
+ if (_k === "__proto__") {
42354
+ writeKey(out);
41834
42355
  }
41835
- map3[k6] = this._read(mapMember, map3[k6]);
42356
+ out[_k] = this._read(mapMember, value[_k]);
41836
42357
  }
41837
- return map3;
42358
+ return out;
41838
42359
  }
41839
42360
  }
41840
42361
  if (ns.isBlobSchema() && typeof value === "string") {
@@ -41888,577 +42409,295 @@ var init_JsonShapeDeserializer2 = __esm({
41888
42409
  }
41889
42410
  if (ns.isDocumentSchema()) {
41890
42411
  if (isObject3) {
41891
- if (Array.isArray(value)) {
41892
- for (let i6 = 0; i6 < value.length; ++i6) {
41893
- const v = value[i6];
41894
- if (!(v instanceof NumericValue)) {
41895
- value[i6] = this._read(ns, v);
41896
- }
42412
+ const out = Array.isArray(value) ? [] : {};
42413
+ for (const k6 in value) {
42414
+ if (k6 === "__proto__") {
42415
+ writeKey(out);
41897
42416
  }
41898
- } else {
41899
- const doc = value;
41900
- for (const k6 in doc) {
41901
- if (k6 === "__proto__") {
41902
- writeKey(doc);
41903
- }
41904
- const v = doc[k6];
41905
- if (!(v instanceof NumericValue)) {
41906
- doc[k6] = this._read(ns, v);
41907
- }
42417
+ const v = value[k6];
42418
+ if (v instanceof NumericValue) {
42419
+ out[k6] = v;
42420
+ } else {
42421
+ out[k6] = this._read(ns, v);
41908
42422
  }
41909
42423
  }
41910
- return value;
42424
+ return out;
41911
42425
  } else {
41912
- return value;
42426
+ return structuredClone(value);
41913
42427
  }
41914
42428
  }
41915
42429
  return value;
41916
42430
  }
41917
- _readStruct(ns, record) {
41918
- const union = ns.isUnionSchema();
41919
- const out = {};
41920
- let nameMap = void 0;
41921
- const { jsonName } = this.settings;
41922
- if (jsonName) {
41923
- nameMap = {};
42431
+ };
42432
+ }
42433
+ });
42434
+
42435
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js
42436
+ var NUMERIC_CONTROL_CHAR, JsonReplacer;
42437
+ var init_jsonReplacer = __esm({
42438
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js"() {
42439
+ init_serde();
42440
+ NUMERIC_CONTROL_CHAR = String.fromCharCode(925);
42441
+ JsonReplacer = class {
42442
+ static {
42443
+ __name(this, "JsonReplacer");
42444
+ }
42445
+ values = /* @__PURE__ */ new Map();
42446
+ counter = 0;
42447
+ stage = 0;
42448
+ createReplacer() {
42449
+ if (this.stage === 1) {
42450
+ throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");
41924
42451
  }
41925
- let unionSerde;
41926
- if (union) {
41927
- unionSerde = new UnionSerde(record, out);
42452
+ if (this.stage === 2) {
42453
+ throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
41928
42454
  }
41929
- for (const [memberName, memberSchema] of ns.structIterator()) {
41930
- let fromKey = memberName;
41931
- if (jsonName) {
41932
- fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
41933
- nameMap[fromKey] = memberName;
41934
- }
41935
- if (union) {
41936
- unionSerde.mark(fromKey);
42455
+ this.stage = 1;
42456
+ return (key, value) => {
42457
+ if (value instanceof NumericValue) {
42458
+ const v = `${NUMERIC_CONTROL_CHAR + "nv" + this.counter++}_` + value.string;
42459
+ this.values.set(`"${v}"`, value.string);
42460
+ return v;
41937
42461
  }
41938
- if (record[fromKey] != null) {
41939
- out[memberName] = this._read(memberSchema, record[fromKey]);
42462
+ if (typeof value === "bigint") {
42463
+ const s2 = value.toString();
42464
+ const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s2;
42465
+ this.values.set(`"${v}"`, s2);
42466
+ return v;
41940
42467
  }
42468
+ return value;
42469
+ };
42470
+ }
42471
+ replaceInJson(json) {
42472
+ if (this.stage === 0) {
42473
+ throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");
41941
42474
  }
41942
- if (union) {
41943
- unionSerde.writeUnknown();
41944
- } else if (typeof record.__type === "string") {
41945
- for (const k6 in record) {
41946
- const v = record[k6];
41947
- const t = jsonName ? nameMap[k6] ?? k6 : k6;
41948
- if (!(t in out)) {
41949
- out[t] = v;
41950
- }
41951
- }
42475
+ if (this.stage === 2) {
42476
+ throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
41952
42477
  }
41953
- return out;
42478
+ this.stage = 2;
42479
+ if (this.counter === 0) {
42480
+ return json;
42481
+ }
42482
+ for (const [key, value] of this.values) {
42483
+ json = json.replace(key, value);
42484
+ }
42485
+ return json;
41954
42486
  }
41955
42487
  };
41956
42488
  }
41957
42489
  });
41958
42490
 
41959
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js
41960
- function alloc(size) {
41961
- return typeof Buffer !== "undefined" ? Buffer.allocUnsafe(size) : new Uint8Array(size);
41962
- }
41963
- var encoder, OPEN_BRACE, CLOSE_BRACE, OPEN_BRACKET, CLOSE_BRACKET, QUOTE, COLON, COMMA, BACKSLASH, TRUE, FALSE, NULL, ESCAPE_TABLE, INITIAL_BUFFER_SIZE2, JsonShapeSerializer2;
41964
- var init_JsonShapeSerializer2 = __esm({
41965
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js"() {
42491
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js
42492
+ var JsonShapeSerializer;
42493
+ var init_JsonShapeSerializer = __esm({
42494
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonShapeSerializer.js"() {
41966
42495
  init_protocols();
41967
42496
  init_schema4();
41968
42497
  init_serde();
41969
42498
  init_ConfigurableSerdeContext();
42499
+ init_jsonReplacer();
41970
42500
  init_writeKey();
41971
- encoder = new TextEncoder();
41972
- OPEN_BRACE = 123;
41973
- CLOSE_BRACE = 125;
41974
- OPEN_BRACKET = 91;
41975
- CLOSE_BRACKET = 93;
41976
- QUOTE = 34;
41977
- COLON = 58;
41978
- COMMA = 44;
41979
- BACKSLASH = 92;
41980
- TRUE = new Uint8Array([116, 114, 117, 101]);
41981
- FALSE = new Uint8Array([102, 97, 108, 115, 101]);
41982
- NULL = new Uint8Array([110, 117, 108, 108]);
41983
- ESCAPE_TABLE = new Array(128).fill(null);
41984
- ESCAPE_TABLE[8] = "b";
41985
- ESCAPE_TABLE[9] = "t";
41986
- ESCAPE_TABLE[10] = "n";
41987
- ESCAPE_TABLE[12] = "f";
41988
- ESCAPE_TABLE[13] = "r";
41989
- ESCAPE_TABLE[34] = '"';
41990
- ESCAPE_TABLE[92] = "\\";
41991
- for (let i6 = 0; i6 < 32; i6++) {
41992
- if (ESCAPE_TABLE[i6] === null) {
41993
- ESCAPE_TABLE[i6] = "u00" + i6.toString(16).padStart(2, "0");
41994
- }
41995
- }
41996
- INITIAL_BUFFER_SIZE2 = 2048;
41997
- __name(alloc, "alloc");
41998
- JsonShapeSerializer2 = class _JsonShapeSerializer2 extends SerdeContextConfig {
42501
+ JsonShapeSerializer = class extends SerdeContextConfig {
41999
42502
  static {
42000
- __name(this, "JsonShapeSerializer2");
42503
+ __name(this, "JsonShapeSerializer");
42001
42504
  }
42002
42505
  settings;
42003
- json;
42004
- i = 0;
42506
+ buffer;
42507
+ useReplacer = false;
42005
42508
  rootSchema;
42006
- rawValue;
42007
- passthrough = false;
42008
42509
  constructor(settings) {
42009
42510
  super();
42010
42511
  this.settings = settings;
42011
- this.json = alloc(INITIAL_BUFFER_SIZE2);
42012
42512
  }
42013
42513
  write(schema, value) {
42014
- this.i = 0;
42015
- this.rawValue = value;
42016
42514
  this.rootSchema = NormalizedSchema.of(schema);
42017
- this.passthrough = !this.rootSchema.isStructSchema() && !this.rootSchema.isDocumentSchema() && (this.rootSchema.isBlobSchema() || this.rootSchema.isStringSchema());
42018
- if (!this.passthrough) {
42019
- this.writeValue(this.rootSchema, value, void 0);
42020
- }
42021
- }
42022
- writeDiscriminatedDocument(schema, value) {
42023
- this.i = 0;
42024
- this.rootSchema = NormalizedSchema.of(schema);
42025
- const ns = this.rootSchema;
42026
- if (ns.isStructSchema() && value != null && typeof value === "object") {
42027
- this.ensure(2);
42028
- this.json[this.i++] = OPEN_BRACE;
42029
- this.writeAsciiQuoted("__type");
42030
- this.json[this.i++] = COLON;
42031
- this.writeAsciiQuoted(ns.getName(true) ?? "Unknown");
42032
- let wroteAny = true;
42033
- const { jsonName } = this.settings;
42034
- for (const [memberName, memberSchema] of ns.structIterator()) {
42035
- const item = value[memberName];
42036
- if (item == null && !memberSchema.isIdempotencyToken()) {
42037
- continue;
42038
- }
42039
- if (wroteAny) {
42040
- this.ensure(1);
42041
- this.json[this.i++] = COMMA;
42042
- }
42043
- const targetKey = jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;
42044
- this.writeAsciiQuoted(targetKey);
42045
- this.json[this.i++] = COLON;
42046
- this.writeValue(memberSchema, item, ns);
42047
- wroteAny = true;
42048
- }
42049
- this.ensure(1);
42050
- this.json[this.i++] = CLOSE_BRACE;
42051
- } else {
42052
- this.writeValue(ns, value, void 0);
42053
- }
42515
+ this.buffer = this._write(this.rootSchema, value);
42054
42516
  }
42055
42517
  flush() {
42518
+ const { rootSchema, useReplacer } = this;
42056
42519
  this.rootSchema = void 0;
42057
- const finalPosition = this.i;
42058
- this.i = 0;
42059
- const raw = this.rawValue;
42060
- this.rawValue = void 0;
42061
- if (finalPosition === 0) {
42062
- return raw;
42063
- }
42064
- const result2 = this.json.subarray(0, finalPosition);
42065
- this.json = alloc(INITIAL_BUFFER_SIZE2);
42066
- return result2;
42067
- }
42068
- ensure(byteCount) {
42069
- const { i: i6, json } = this;
42070
- if (i6 + byteCount > json.length) {
42071
- let newSize = json.length * 2;
42072
- while (newSize < i6 + byteCount) {
42073
- newSize *= 2;
42520
+ this.useReplacer = false;
42521
+ if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
42522
+ if (!useReplacer) {
42523
+ return JSON.stringify(this.buffer);
42074
42524
  }
42075
- const next = alloc(newSize);
42076
- next.set(this.json);
42077
- this.json = next;
42078
- }
42079
- }
42080
- writeAscii(s2) {
42081
- const z = s2.length;
42082
- this.ensure(z);
42083
- let { i: i6, json } = this;
42084
- for (let j6 = 0; j6 < z; ++j6) {
42085
- json[i6] = s2.charCodeAt(j6);
42086
- i6 += 1;
42525
+ const replacer = new JsonReplacer();
42526
+ return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
42087
42527
  }
42088
- this.i = i6;
42528
+ return this.buffer;
42089
42529
  }
42090
- writeAsciiQuoted(s2) {
42091
- const z = s2.length;
42092
- this.ensure(z + 4);
42093
- let { json, i: i6 } = this;
42094
- json[i6++] = QUOTE;
42095
- for (let j6 = 0; j6 < z; ++j6) {
42096
- json[i6++] = s2.charCodeAt(j6);
42530
+ writeDiscriminatedDocument(schema, value) {
42531
+ this.write(schema, value);
42532
+ if (typeof this.buffer === "object") {
42533
+ this.buffer.__type = NormalizedSchema.of(schema).getName(true);
42097
42534
  }
42098
- json[i6++] = QUOTE;
42099
- this.i = i6;
42100
42535
  }
42101
- writeJsonString(s2) {
42102
- this.ensure(s2.length * 2 + 2);
42103
- this.json[this.i++] = QUOTE;
42104
- const z = s2.length;
42105
- for (let j6 = 0; j6 < z; ++j6) {
42106
- const c6 = s2.charCodeAt(j6);
42107
- if (c6 > 34 && c6 < 92) {
42108
- this.json[this.i++] = c6;
42109
- } else if (c6 < 128) {
42110
- const esc = ESCAPE_TABLE[c6];
42111
- if (esc !== null) {
42112
- this.ensure(esc.length + 1);
42113
- this.json[this.i++] = BACKSLASH;
42114
- for (let k6 = 0; k6 < esc.length; k6++) {
42115
- this.json[this.i++] = esc.charCodeAt(k6);
42116
- }
42117
- } else {
42118
- this.json[this.i++] = c6;
42119
- }
42120
- } else if (c6 >= 55296 && c6 <= 56319) {
42121
- const next = j6 + 1 < z ? s2.charCodeAt(j6 + 1) : 0;
42122
- if (next >= 56320 && next <= 57343) {
42123
- this.ensure(4);
42124
- const { written } = encoder.encodeInto(s2.substring(j6, j6 + 2), this.json.subarray(this.i));
42125
- this.i += written;
42126
- j6++;
42127
- } else {
42128
- this.ensure(6);
42129
- this.writeUnicodeEscape(c6);
42536
+ _write(schema, value, container) {
42537
+ const isObject3 = value !== null && typeof value === "object";
42538
+ const ns = NormalizedSchema.of(schema);
42539
+ if (isObject3) {
42540
+ if (ns.isStructSchema()) {
42541
+ const record = value;
42542
+ const out = {};
42543
+ const { jsonName } = this.settings;
42544
+ let nameMap = void 0;
42545
+ if (jsonName) {
42546
+ nameMap = {};
42130
42547
  }
42131
- } else if (c6 >= 56320 && c6 <= 57343) {
42132
- this.ensure(6);
42133
- this.writeUnicodeEscape(c6);
42134
- } else {
42135
- let { i: i6, json } = this;
42136
- if (c6 < 2048) {
42137
- json[i6++] = 192 | c6 >> 6;
42138
- json[i6++] = 128 | c6 & 63;
42139
- } else {
42140
- json[i6++] = 224 | c6 >> 12;
42141
- json[i6++] = 128 | c6 >> 6 & 63;
42142
- json[i6++] = 128 | c6 & 63;
42548
+ let outCount = 0;
42549
+ for (const [memberName, memberSchema] of ns.structIterator()) {
42550
+ const serializableValue = this._write(memberSchema, record[memberName], ns);
42551
+ if (serializableValue !== void 0) {
42552
+ let targetKey = memberName;
42553
+ if (jsonName) {
42554
+ targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
42555
+ nameMap[memberName] = targetKey;
42556
+ }
42557
+ out[targetKey] = serializableValue;
42558
+ outCount++;
42559
+ }
42143
42560
  }
42144
- this.i = i6;
42145
- }
42146
- }
42147
- this.json[this.i++] = QUOTE;
42148
- }
42149
- writeUnicodeEscape(code) {
42150
- let { json, i: i6 } = this;
42151
- json[i6++] = BACKSLASH;
42152
- json[i6++] = 117;
42153
- const hex = code.toString(16).padStart(4, "0");
42154
- for (let j6 = 0; j6 < 4; ++j6) {
42155
- json[i6++] = hex.charCodeAt(j6);
42156
- }
42157
- this.i = i6;
42158
- }
42159
- static B64 = (() => {
42160
- const chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
42161
- const table3 = new Uint8Array(64);
42162
- for (let i6 = 0; i6 < 64; i6++)
42163
- table3[i6] = chars2.charCodeAt(i6);
42164
- return table3;
42165
- })();
42166
- writeBase64(data) {
42167
- const b64Len = Math.ceil(data.length / 3) * 4;
42168
- this.ensure(b64Len + 2);
42169
- const json = this.json;
42170
- const B64 = _JsonShapeSerializer2.B64;
42171
- let i6 = this.i;
42172
- json[i6++] = QUOTE;
42173
- const len = data.length;
42174
- const remainder = len % 3;
42175
- const mainLen = len - remainder;
42176
- for (let j6 = 0; j6 < mainLen; j6 += 3) {
42177
- const a6 = data[j6];
42178
- const b6 = data[j6 + 1];
42179
- const c6 = data[j6 + 2];
42180
- json[i6++] = B64[a6 >> 2];
42181
- json[i6++] = B64[(a6 & 3) << 4 | b6 >> 4];
42182
- json[i6++] = B64[(b6 & 15) << 2 | c6 >> 6];
42183
- json[i6++] = B64[c6 & 63];
42184
- }
42185
- if (remainder === 2) {
42186
- const a6 = data[mainLen];
42187
- const b6 = data[mainLen + 1];
42188
- json[i6++] = B64[a6 >> 2];
42189
- json[i6++] = B64[(a6 & 3) << 4 | b6 >> 4];
42190
- json[i6++] = B64[(b6 & 15) << 2];
42191
- json[i6++] = 61;
42192
- } else if (remainder === 1) {
42193
- const a6 = data[mainLen];
42194
- json[i6++] = B64[a6 >> 2];
42195
- json[i6++] = B64[(a6 & 3) << 4];
42196
- json[i6++] = 61;
42197
- json[i6++] = 61;
42198
- }
42199
- json[i6++] = QUOTE;
42200
- this.i = i6;
42201
- }
42202
- writeValue(schema, value, container) {
42203
- if (value == null) {
42204
- if (container?.isStructSchema()) {
42205
- if (value === void 0) {
42206
- const ns2 = NormalizedSchema.of(schema);
42207
- if (ns2.isIdempotencyToken()) {
42208
- this.writeAsciiQuoted(generateIdempotencyToken());
42209
- return;
42561
+ if (ns.isUnionSchema() && outCount === 0) {
42562
+ const { $unknown } = record;
42563
+ if (Array.isArray($unknown)) {
42564
+ const [k6, v] = $unknown;
42565
+ if (k6 === "__proto__") {
42566
+ writeKey(out);
42567
+ }
42568
+ out[k6] = this._write(15, v);
42569
+ }
42570
+ } else if (typeof record.__type === "string") {
42571
+ for (const k6 in record) {
42572
+ const v = record[k6];
42573
+ const targetKey = jsonName ? nameMap[k6] ?? k6 : k6;
42574
+ if (!(targetKey in out)) {
42575
+ out[targetKey] = this._write(15, v);
42576
+ }
42210
42577
  }
42211
42578
  }
42212
- return;
42579
+ return out;
42213
42580
  }
42214
- this.ensure(4);
42215
- this.json.set(NULL, this.i);
42216
- this.i += 4;
42217
- return;
42218
- }
42219
- const ns = NormalizedSchema.of(schema);
42220
- const isObject3 = typeof value === "object";
42221
- if (ns.isStringSchema()) {
42222
- const mediaType = ns.getMergedTraits().mediaType;
42223
- if (mediaType) {
42224
- const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
42225
- if (isJson) {
42226
- this.writeJsonString(LazyJsonString.from(value).toString());
42227
- return;
42581
+ if (Array.isArray(value) && ns.isListSchema()) {
42582
+ const listMember = ns.getValueSchema();
42583
+ const out = [];
42584
+ const sparse = !!ns.getMergedTraits().sparse;
42585
+ for (const item of value) {
42586
+ if (sparse || item != null) {
42587
+ out.push(this._write(listMember, item));
42588
+ }
42228
42589
  }
42229
- }
42230
- }
42231
- if (isObject3) {
42232
- if (ns.isStructSchema()) {
42233
- this.writeStruct(ns, value);
42234
- return;
42235
- }
42236
- if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
42237
- this.writeList(ns, value, ns.isDocumentSchema());
42238
- return;
42590
+ return out;
42239
42591
  }
42240
42592
  if (ns.isMapSchema()) {
42241
- this.writeMap(ns, value, false);
42242
- return;
42593
+ const mapMember = ns.getValueSchema();
42594
+ const out = {};
42595
+ const sparse = !!ns.getMergedTraits().sparse;
42596
+ for (const _k in value) {
42597
+ const _v = value[_k];
42598
+ if (sparse || _v != null) {
42599
+ if (_k === "__proto__") {
42600
+ writeKey(out);
42601
+ }
42602
+ out[_k] = this._write(mapMember, _v);
42603
+ }
42604
+ }
42605
+ return out;
42243
42606
  }
42244
- if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
42245
- this.writeBase64(value);
42246
- return;
42607
+ if (value instanceof Uint8Array && ns.isBlobSchema()) {
42608
+ if (ns === this.rootSchema) {
42609
+ return value;
42610
+ }
42611
+ return (this.serdeContext?.base64Encoder ?? toBase64)(value);
42247
42612
  }
42248
42613
  if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
42249
- this.writeTimestamp(ns, value);
42250
- return;
42614
+ const format28 = determineTimestampFormat(ns, this.settings);
42615
+ switch (format28) {
42616
+ case 5:
42617
+ return value.toISOString().replace(".000Z", "Z");
42618
+ case 6:
42619
+ return dateToUtcString(value);
42620
+ case 7:
42621
+ return value.getTime() / 1e3;
42622
+ default:
42623
+ console.warn("Missing timestamp format, using epoch seconds", value);
42624
+ return value.getTime() / 1e3;
42625
+ }
42251
42626
  }
42252
42627
  if (value instanceof NumericValue) {
42253
- this.writeAscii(value.string);
42254
- return;
42255
- }
42256
- if (ns.isDocumentSchema()) {
42257
- if (Array.isArray(value)) {
42258
- this.writeList(ns, value, true);
42259
- } else {
42260
- this.writeMap(ns, value, true);
42261
- }
42262
- return;
42628
+ this.useReplacer = true;
42263
42629
  }
42264
- const json = JSON.stringify(value);
42265
- this.writeAscii(json);
42266
- return;
42267
42630
  }
42268
- if (typeof value === "string") {
42269
- if (ns.isBlobSchema()) {
42270
- const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
42271
- this.writeAsciiQuoted(b64);
42272
- return;
42631
+ if (value === null && container?.isStructSchema()) {
42632
+ return void 0;
42633
+ }
42634
+ if (ns.isStringSchema()) {
42635
+ if (typeof value === "undefined" && ns.isIdempotencyToken()) {
42636
+ return generateIdempotencyToken();
42273
42637
  }
42274
- this.writeJsonString(value);
42275
- return;
42638
+ const mediaType = ns.getMergedTraits().mediaType;
42639
+ if (value != null && mediaType) {
42640
+ const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
42641
+ if (isJson) {
42642
+ return LazyJsonString.from(value);
42643
+ }
42644
+ }
42645
+ return value;
42276
42646
  }
42277
42647
  if (typeof value === "number") {
42278
- if (ns.isNumericSchema() && (Math.abs(value) === Infinity || isNaN(value))) {
42279
- this.writeAsciiQuoted(String(value));
42280
- return;
42648
+ if (Math.abs(value) === Infinity || isNaN(value)) {
42649
+ return String(value);
42281
42650
  }
42282
- const numStr = String(value);
42283
- this.writeAscii(numStr);
42284
- return;
42651
+ return value;
42285
42652
  }
42286
- if (typeof value === "boolean") {
42287
- this.ensure(5);
42288
- if (value) {
42289
- this.json.set(TRUE, this.i);
42290
- this.i += 4;
42291
- } else {
42292
- this.json.set(FALSE, this.i);
42293
- this.i += 5;
42653
+ if (typeof value === "string" && ns.isBlobSchema()) {
42654
+ if (ns === this.rootSchema) {
42655
+ return value;
42294
42656
  }
42295
- return;
42657
+ return (this.serdeContext?.base64Encoder ?? toBase64)(value);
42296
42658
  }
42297
42659
  if (typeof value === "bigint") {
42298
- this.writeAscii(value.toString());
42299
- return;
42300
- }
42301
- this.writeAscii(String(value));
42302
- }
42303
- writeStruct(ns, value) {
42304
- this.ensure(2);
42305
- this.json[this.i++] = OPEN_BRACE;
42306
- let first = true;
42307
- let wroteAny = false;
42308
- const hasType = typeof value.__type === "string";
42309
- let writtenKeys;
42310
- if (hasType) {
42311
- writtenKeys = /* @__PURE__ */ new Set();
42312
- }
42313
- for (const [memberName, memberSchema] of ns.structIterator()) {
42314
- const item = value[memberName];
42315
- if (item == null && !memberSchema.isIdempotencyToken())
42316
- continue;
42317
- if (!first) {
42318
- this.ensure(1);
42319
- this.json[this.i++] = COMMA;
42320
- }
42321
- first = false;
42322
- wroteAny = true;
42323
- const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;
42324
- if (writtenKeys) {
42325
- writtenKeys.add(memberName);
42326
- writtenKeys.add(targetKey);
42327
- }
42328
- this.writeAsciiQuoted(targetKey);
42329
- this.json[this.i++] = COLON;
42330
- this.writeValue(memberSchema, item, ns);
42660
+ this.useReplacer = true;
42331
42661
  }
42332
- if (!wroteAny && ns.isUnionSchema()) {
42333
- const { $unknown } = value;
42334
- if (Array.isArray($unknown)) {
42335
- const [k6, v] = $unknown;
42336
- this.writeAsciiQuoted(k6);
42337
- this.ensure(1);
42338
- this.json[this.i++] = COLON;
42339
- this.writeValue(15, v, ns);
42340
- }
42341
- } else if (hasType) {
42342
- for (const k6 in value) {
42343
- const targetKey = this.settings.jsonName ? writtenKeys.has(k6) ? k6 : k6 : k6;
42344
- if (writtenKeys.has(targetKey))
42345
- continue;
42346
- writtenKeys.add(targetKey);
42347
- const v = value[k6];
42348
- if (!first) {
42349
- this.ensure(1);
42350
- this.json[this.i++] = COMMA;
42662
+ if (ns.isDocumentSchema()) {
42663
+ if (isObject3) {
42664
+ if (value instanceof Uint8Array) {
42665
+ return (this.serdeContext?.base64Encoder ?? toBase64)(value);
42351
42666
  }
42352
- first = false;
42353
- this.writeAsciiQuoted(targetKey);
42354
- this.ensure(1);
42355
- this.json[this.i++] = COLON;
42356
- this.writeValue(15, v, void 0);
42357
- }
42358
- }
42359
- this.ensure(1);
42360
- this.json[this.i++] = CLOSE_BRACE;
42361
- }
42362
- writeList(ns, value, isDocument) {
42363
- this.ensure(2);
42364
- this.json[this.i++] = OPEN_BRACKET;
42365
- const sparse = !!ns.getMergedTraits().sparse;
42366
- const valueSchema = ns.getValueSchema();
42367
- for (let i6 = 0; i6 < value.length; ++i6) {
42368
- const item = value[i6];
42369
- if (isDocument ? item === void 0 : item == null && !sparse) {
42370
- continue;
42371
- }
42372
- if (i6 !== 0) {
42373
- this.ensure(1);
42374
- this.json[this.i++] = COMMA;
42375
- }
42376
- this.writeValue(valueSchema, item, void 0);
42377
- }
42378
- this.ensure(1);
42379
- this.json[this.i++] = CLOSE_BRACKET;
42380
- }
42381
- writeMap(ns, value, isDocument) {
42382
- const sparse = !!ns.getMergedTraits().sparse;
42383
- const valueSchema = ns.getValueSchema();
42384
- if (!isDocument) {
42385
- if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
42386
- let input = value;
42387
- if (sparse) {
42388
- input = {};
42389
- for (const k6 in value) {
42390
- if (k6 === "__proto__") {
42391
- writeKey(input);
42392
- }
42393
- input[k6] = value[k6] ?? null;
42667
+ const out = Array.isArray(value) ? [] : {};
42668
+ for (const k6 in value) {
42669
+ const v = value[k6];
42670
+ if (k6 === "__proto__") {
42671
+ writeKey(out);
42672
+ }
42673
+ if (v instanceof NumericValue) {
42674
+ this.useReplacer = true;
42675
+ out[k6] = v;
42676
+ } else {
42677
+ out[k6] = this._write(ns, v);
42394
42678
  }
42395
42679
  }
42396
- const json = JSON.stringify(input);
42397
- this.ensure(json.length * 3);
42398
- const { written } = encoder.encodeInto(json, this.json.subarray(this.i));
42399
- this.i += written;
42400
- return;
42401
- }
42402
- }
42403
- this.ensure(2);
42404
- this.json[this.i++] = OPEN_BRACE;
42405
- let first = true;
42406
- for (const k6 in value) {
42407
- const v = value[k6];
42408
- if (isDocument ? v === void 0 : v == null && !sparse) {
42409
- continue;
42410
- }
42411
- if (!first) {
42412
- this.ensure(1);
42413
- this.json[this.i++] = COMMA;
42414
- }
42415
- first = false;
42416
- this.writeJsonString(k6);
42417
- this.ensure(1);
42418
- this.json[this.i++] = COLON;
42419
- this.writeValue(valueSchema, v, void 0);
42420
- }
42421
- this.ensure(1);
42422
- this.json[this.i++] = CLOSE_BRACE;
42423
- }
42424
- writeTimestamp(ns, value) {
42425
- const format28 = determineTimestampFormat(ns, this.settings);
42426
- switch (format28) {
42427
- case 5: {
42428
- const iso = value.toISOString().replace(".000Z", "Z");
42429
- this.writeAsciiQuoted(iso);
42430
- return;
42431
- }
42432
- case 6: {
42433
- this.writeAsciiQuoted(dateToUtcString(value));
42434
- return;
42435
- }
42436
- case 7: {
42437
- const epochSecs = String(value.getTime() / 1e3);
42438
- this.writeAscii(epochSecs);
42439
- return;
42440
- }
42441
- default: {
42442
- const epochSecs = String(value.getTime() / 1e3);
42443
- this.writeAscii(epochSecs);
42444
- return;
42680
+ return out;
42681
+ } else {
42682
+ return structuredClone(value);
42445
42683
  }
42446
42684
  }
42685
+ return value;
42447
42686
  }
42448
42687
  };
42449
42688
  }
42450
42689
  });
42451
42690
 
42452
- // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js
42453
- var JsonCodec2;
42454
- var init_JsonCodec2 = __esm({
42455
- "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js"() {
42691
+ // ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js
42692
+ var JsonCodec;
42693
+ var init_JsonCodec = __esm({
42694
+ "../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v1/JsonCodec.js"() {
42456
42695
  init_ConfigurableSerdeContext();
42457
- init_JsonShapeDeserializer2();
42458
- init_JsonShapeSerializer2();
42459
- JsonCodec2 = class extends SerdeContextConfig {
42696
+ init_JsonShapeDeserializer();
42697
+ init_JsonShapeSerializer();
42698
+ JsonCodec = class extends SerdeContextConfig {
42460
42699
  static {
42461
- __name(this, "JsonCodec2");
42700
+ __name(this, "JsonCodec");
42462
42701
  }
42463
42702
  settings;
42464
42703
  constructor(settings) {
@@ -42466,12 +42705,12 @@ var init_JsonCodec2 = __esm({
42466
42705
  this.settings = settings;
42467
42706
  }
42468
42707
  createSerializer() {
42469
- const serializer = new JsonShapeSerializer2(this.settings);
42708
+ const serializer = new JsonShapeSerializer(this.settings);
42470
42709
  serializer.setSerdeContext(this.serdeContext);
42471
42710
  return serializer;
42472
42711
  }
42473
42712
  createDeserializer() {
42474
- const deserializer = new JsonShapeDeserializer2(this.settings);
42713
+ const deserializer = new JsonShapeDeserializer(this.settings);
42475
42714
  deserializer.setSerdeContext(this.serdeContext);
42476
42715
  return deserializer;
42477
42716
  }
@@ -48241,7 +48480,7 @@ var init_signin = __esm({
48241
48480
  var require_dist_cjs11 = __commonJS({
48242
48481
  "../../../node_modules/@aws-sdk/credential-provider-login/dist-cjs/index.js"(exports2) {
48243
48482
  var { setCredentialFeature: setCredentialFeature2 } = (init_client3(), __toCommonJS(client_exports2));
48244
- var { CredentialsProviderError: CredentialsProviderError2, readFile: readFile5, parseKnownFiles: parseKnownFiles2, getProfileName: getProfileName2 } = (init_config2(), __toCommonJS(config_exports));
48483
+ var { CredentialsProviderError: CredentialsProviderError2, parseKnownFiles: parseKnownFiles2, getProfileName: getProfileName2 } = (init_config2(), __toCommonJS(config_exports));
48245
48484
  var { HttpRequest: HttpRequest2 } = (init_protocols(), __toCommonJS(protocols_exports));
48246
48485
  var { createHash: createHash8, createPrivateKey, createPublicKey, sign: sign3 } = require("node:crypto");
48247
48486
  var { promises: promises3 } = require("node:fs");
@@ -48272,13 +48511,7 @@ var require_dist_cjs11 = __commonJS({
48272
48511
  if (timeUntilExpiry <= _LoginCredentialsFetcher.REFRESH_THRESHOLD) {
48273
48512
  return this.refresh(token);
48274
48513
  }
48275
- return {
48276
- accessKeyId: accessToken.accessKeyId,
48277
- secretAccessKey: accessToken.secretAccessKey,
48278
- sessionToken: accessToken.sessionToken,
48279
- accountId: accessToken.accountId,
48280
- expiration: new Date(accessToken.expiresAt)
48281
- };
48514
+ return this.toCredentials(token.accessToken);
48282
48515
  }
48283
48516
  get logger() {
48284
48517
  return this.init?.logger;
@@ -48286,7 +48519,25 @@ var require_dist_cjs11 = __commonJS({
48286
48519
  get loginSession() {
48287
48520
  return this.profileData.login_session;
48288
48521
  }
48522
+ toCredentials(token) {
48523
+ return {
48524
+ accessKeyId: token.accessKeyId,
48525
+ secretAccessKey: token.secretAccessKey,
48526
+ sessionToken: token.sessionToken,
48527
+ accountId: token.accountId,
48528
+ expiration: new Date(token.expiresAt)
48529
+ };
48530
+ }
48289
48531
  async refresh(token) {
48532
+ const diskToken = await this.loadToken().catch(() => token);
48533
+ const now = Date.now();
48534
+ const diskExpiry = new Date(diskToken.accessToken.expiresAt).getTime();
48535
+ const tokenExpiry = new Date(token.accessToken.expiresAt).getTime();
48536
+ const freshToken = diskExpiry <= now && tokenExpiry > now ? token : diskToken;
48537
+ const freshExpiry = new Date(freshToken.accessToken.expiresAt).getTime();
48538
+ if (freshExpiry - Date.now() > _LoginCredentialsFetcher.REFRESH_THRESHOLD) {
48539
+ return this.toCredentials(freshToken.accessToken);
48540
+ }
48290
48541
  const { SigninClient: SigninClient2, CreateOAuth2TokenCommand: CreateOAuth2TokenCommand2 } = (init_signin(), __toCommonJS(signin_exports));
48291
48542
  const { logger: logger3, userAgentAppId } = this.callerClientConfig ?? {};
48292
48543
  const isH22 = /* @__PURE__ */ __name((requestHandler2) => {
@@ -48308,8 +48559,8 @@ var require_dist_cjs11 = __commonJS({
48308
48559
  this.createDPoPInterceptor(client.middlewareStack);
48309
48560
  const commandInput = {
48310
48561
  tokenInput: {
48311
- clientId: token.clientId,
48312
- refreshToken: token.refreshToken,
48562
+ clientId: freshToken.clientId,
48563
+ refreshToken: freshToken.refreshToken,
48313
48564
  grantType: "refresh_token"
48314
48565
  }
48315
48566
  };
@@ -48326,9 +48577,9 @@ var require_dist_cjs11 = __commonJS({
48326
48577
  const expiresInMs = (expiresIn ?? 900) * 1e3;
48327
48578
  const expiration = new Date(Date.now() + expiresInMs);
48328
48579
  const updatedToken = {
48329
- ...token,
48580
+ ...freshToken,
48330
48581
  accessToken: {
48331
- ...token.accessToken,
48582
+ ...freshToken.accessToken,
48332
48583
  accessKeyId,
48333
48584
  secretAccessKey,
48334
48585
  sessionToken,
@@ -48337,14 +48588,7 @@ var require_dist_cjs11 = __commonJS({
48337
48588
  refreshToken
48338
48589
  };
48339
48590
  await this.saveToken(updatedToken);
48340
- const newAccessToken = updatedToken.accessToken;
48341
- return {
48342
- accessKeyId: newAccessToken.accessKeyId,
48343
- secretAccessKey: newAccessToken.secretAccessKey,
48344
- sessionToken: newAccessToken.sessionToken,
48345
- accountId: newAccessToken.accountId,
48346
- expiration
48347
- };
48591
+ return this.toCredentials(updatedToken.accessToken);
48348
48592
  } catch (error4) {
48349
48593
  if (error4.name === "AccessDeniedException") {
48350
48594
  const errorType = error4.error;
@@ -48362,7 +48606,15 @@ var require_dist_cjs11 = __commonJS({
48362
48606
  default:
48363
48607
  message2 = `Failed to refresh token: ${String(error4)}. Please re-authenticate using \`aws login\``;
48364
48608
  }
48365
- throw new CredentialsProviderError2(message2, { logger: this.logger, tryNextLink: false });
48609
+ throw new CredentialsProviderError2(message2, {
48610
+ logger: this.logger,
48611
+ tryNextLink: false
48612
+ });
48613
+ }
48614
+ const tokenExpiry2 = new Date(freshToken.accessToken.expiresAt).getTime();
48615
+ if (tokenExpiry2 > Date.now()) {
48616
+ this.logger?.warn?.(`Failed to refresh token: ${String(error4)}. Using existing token until expiry.`);
48617
+ return this.toCredentials(freshToken.accessToken);
48366
48618
  }
48367
48619
  throw new CredentialsProviderError2(`Failed to refresh token: ${String(error4)}. Please re-authenticate using aws login`, { logger: this.logger });
48368
48620
  }
@@ -48370,12 +48622,7 @@ var require_dist_cjs11 = __commonJS({
48370
48622
  async loadToken() {
48371
48623
  const tokenFilePath = this.getTokenFilePath();
48372
48624
  try {
48373
- let tokenData;
48374
- try {
48375
- tokenData = await readFile5(tokenFilePath, { ignoreCache: this.init?.ignoreCache });
48376
- } catch {
48377
- tokenData = await promises3.readFile(tokenFilePath, "utf8");
48378
- }
48625
+ const tokenData = await promises3.readFile(tokenFilePath, "utf8");
48379
48626
  const token = JSON.parse(tokenData);
48380
48627
  const missingFields = ["accessToken", "clientId", "refreshToken", "dpopKey"].filter((k6) => !token[k6]);
48381
48628
  if (!token.accessToken?.accountId) {
@@ -81683,10 +81930,10 @@ ${pair.comment}` : item.comment;
81683
81930
  }
81684
81931
  }
81685
81932
  __name(warnFileDeprecation, "warnFileDeprecation");
81686
- var warned = {};
81933
+ var warned2 = {};
81687
81934
  function warnOptionDeprecation(name, alternative) {
81688
- if (!warned[name] && shouldWarn(true)) {
81689
- warned[name] = true;
81935
+ if (!warned2[name] && shouldWarn(true)) {
81936
+ warned2[name] = true;
81690
81937
  let msg = `The option '${name}' will be removed in a future release`;
81691
81938
  msg += alternative ? `, use '${alternative}' instead.` : ".";
81692
81939
  warn2(msg, "DeprecationWarning");
@@ -274394,28 +274641,30 @@ async function createChangeSetAndCleanup(ioHelper, options) {
274394
274641
  Capabilities: ["CAPABILITY_IAM", "CAPABILITY_NAMED_IAM", "CAPABILITY_AUTO_EXPAND"]
274395
274642
  });
274396
274643
  await ioHelper.defaults.debug((0, import_node_util3.format)("Initiated creation of changeset: %s; waiting for it to finish creating...", changeSet.Id));
274397
- const createdChangeSet = await new ChangeSetDescriber({
274398
- cfn: options.cfn,
274399
- ioHelper,
274400
- stackNameOrArn: changeSet.StackId ?? options.stack.stackName,
274401
- changeSetNameOrArn: changeSet.Id ?? options.changeSetName
274402
- }).waitAndThrowOnProblem({
274403
- diagnoser: options.diagnoser
274404
- });
274405
- await cleanupOldChangeset(
274406
- options.cfn,
274407
- ioHelper,
274408
- changeSet.Id ?? options.changeSetName,
274409
- changeSet.StackId ?? options.stack.stackName
274410
- );
274411
- if (!options.exists) {
274412
- await ioHelper.defaults.debug((0, import_node_util3.format)("Deleting empty stack created by diff changeset: %s", changeSet.StackId ?? options.stack.stackName));
274413
- await options.cfn.deleteStack({
274414
- StackName: changeSet.StackId ?? options.stack.stackName,
274415
- ClientRequestToken: (0, import_node_crypto9.randomUUID)()
274644
+ const changeSetId = changeSet.Id ?? options.changeSetName;
274645
+ const stackId = changeSet.StackId ?? options.stack.stackName;
274646
+ try {
274647
+ return await new ChangeSetDescriber({
274648
+ cfn: options.cfn,
274649
+ ioHelper,
274650
+ stackNameOrArn: stackId,
274651
+ changeSetNameOrArn: changeSetId
274652
+ }).waitAndThrowOnProblem({
274653
+ diagnoser: options.diagnoser
274416
274654
  });
274655
+ } catch (e6) {
274656
+ await ioHelper.defaults.warn((0, import_node_util3.format)("Change set %s failed: %s", changeSetId, e6));
274657
+ throw e6;
274658
+ } finally {
274659
+ await cleanupOldChangeset(options.cfn, ioHelper, changeSetId, stackId);
274660
+ if (!options.exists) {
274661
+ await ioHelper.defaults.debug((0, import_node_util3.format)("Deleting empty stack created by diff changeset: %s", stackId));
274662
+ await options.cfn.deleteStack({
274663
+ StackName: stackId,
274664
+ ClientRequestToken: (0, import_node_crypto9.randomUUID)()
274665
+ });
274666
+ }
274417
274667
  }
274418
- return createdChangeSet;
274419
274668
  }
274420
274669
  async function createValidationChangeSet(ioHelper, options) {
274421
274670
  const { cfn, bodyParameter, exists, stackExistedBefore, executionRoleArn, diagnoser } = await prepareChangeSetEnv(ioHelper, options);
@@ -293607,6 +293856,15 @@ async function canSkipDeploy(deployStackOptions, cloudFormationStack, parameterC
293607
293856
  await ioHelper.defaults.debug(`${deployName}: stack is in a failure state`);
293608
293857
  return false;
293609
293858
  }
293859
+ const hotswapCache = await readHotswapTemplateCache(
293860
+ deployStackOptions.stack.assembly.directory,
293861
+ deployStackOptions.stack.stackName,
293862
+ deployStackOptions.stack.template
293863
+ );
293864
+ if (hotswapCache && (0, import_cloudformation_diff.diffTemplate)(hotswapCache.deployedRootTemplate, deployStackOptions.stack.template).differenceCount > 0) {
293865
+ await ioHelper.defaults.debug(`${deployName}: template has changed in relation to last successful hotswap deployment`);
293866
+ return false;
293867
+ }
293610
293868
  return true;
293611
293869
  }
293612
293870
  function compareTags(a6, b6) {
@@ -293633,12 +293891,13 @@ function hasReplacement(report) {
293633
293891
  return a6 === "ReplaceAndDelete" || a6 === "ReplaceAndRetain" || a6 === "ReplaceAndSnapshot";
293634
293892
  });
293635
293893
  }
293636
- var import_node_crypto10, import_node_util5, import_chalk17, FullCloudFormationDeployment;
293894
+ var import_node_crypto10, import_node_util5, import_cloudformation_diff, import_chalk17, FullCloudFormationDeployment;
293637
293895
  var init_deploy_stack = __esm({
293638
293896
  "../toolkit-lib/lib/api/deployments/deploy-stack.ts"() {
293639
293897
  "use strict";
293640
293898
  import_node_crypto10 = require("node:crypto");
293641
293899
  import_node_util5 = require("node:util");
293900
+ import_cloudformation_diff = __toESM(require_lib10());
293642
293901
  import_chalk17 = __toESM(require_source());
293643
293902
  init_asset_manifest_builder();
293644
293903
  init_asset_publishing();
@@ -293743,10 +294002,12 @@ var init_deploy_stack = __esm({
293743
294002
  };
293744
294003
  }
293745
294004
  if (!execute) {
293746
- await this.ioHelper.defaults.info((0, import_node_util5.format)(
293747
- "Changeset %s created and waiting in review for manual execution (--no-execute)",
293748
- changeSetDescription.ChangeSetId
293749
- ));
294005
+ if (!this.options.willExecuteChangeSet) {
294006
+ await this.ioHelper.defaults.info((0, import_node_util5.format)(
294007
+ "Changeset %s created and waiting in review for manual execution (--no-execute)",
294008
+ changeSetDescription.ChangeSetId
294009
+ ));
294010
+ }
293750
294011
  return {
293751
294012
  type: "did-deploy-stack",
293752
294013
  noOp: false,
@@ -294120,6 +294381,7 @@ var init_deployments = __esm({
294120
294381
  envResources: env2.resources,
294121
294382
  tags: options.tags,
294122
294383
  deploymentMethod: options.deploymentMethod,
294384
+ willExecuteChangeSet: options.willExecuteChangeSet,
294123
294385
  forceDeployment: options.forceDeployment,
294124
294386
  parameters: options.parameters,
294125
294387
  usePreviousParameters: options.usePreviousParameters,
@@ -294154,7 +294416,7 @@ var init_deployments = __esm({
294154
294416
  if (result2.type !== "did-deploy-stack") {
294155
294417
  return void 0;
294156
294418
  }
294157
- if (result2.noOp && options.cleanupOnNoOp) {
294419
+ if (result2.noOp && options.willExecuteChangeSet) {
294158
294420
  const changeSetName = options.deploymentMethod.changeSetName ?? DEFAULT_DEPLOY_CHANGE_SET_NAME;
294159
294421
  await this.cleanupChangeSet(options.stack, changeSetName, options.stackEventPollingInterval);
294160
294422
  }
@@ -294538,12 +294800,12 @@ function obscureDiff(diff) {
294538
294800
  });
294539
294801
  }
294540
294802
  }
294541
- var import_node_util6, import_cloudformation_diff, import_chalk19, DiffFormatter;
294803
+ var import_node_util6, import_cloudformation_diff2, import_chalk19, DiffFormatter;
294542
294804
  var init_diff_formatter = __esm({
294543
294805
  "../toolkit-lib/lib/api/diff/diff-formatter.ts"() {
294544
294806
  "use strict";
294545
294807
  import_node_util6 = require("node:util");
294546
- import_cloudformation_diff = __toESM(require_lib10());
294808
+ import_cloudformation_diff2 = __toESM(require_lib10());
294547
294809
  import_chalk19 = __toESM(require_source());
294548
294810
  init_payloads();
294549
294811
  init_logical_id_map();
@@ -294580,7 +294842,7 @@ var init_diff_formatter = __esm({
294580
294842
  */
294581
294843
  computeDiff(stackName, oldTemplate, newTemplate, changeSet, mappings) {
294582
294844
  if (!this.cache.has(stackName)) {
294583
- const templateDiff = (0, import_cloudformation_diff.fullDiff)(oldTemplate, newTemplate, changeSet, this.isImport);
294845
+ const templateDiff = (0, import_cloudformation_diff2.fullDiff)(oldTemplate, newTemplate, changeSet, this.isImport);
294584
294846
  const setMove = /* @__PURE__ */ __name((change, direction, location) => {
294585
294847
  if (location != null) {
294586
294848
  const [sourceStackName, sourceLogicalId] = location.split(".");
@@ -294634,8 +294896,8 @@ var init_diff_formatter = __esm({
294634
294896
  }
294635
294897
  let activeDiff = diff;
294636
294898
  if (diff.differenceCount && !options.strict) {
294637
- const mangledNewTemplate = JSON.parse((0, import_cloudformation_diff.mangleLikeCloudFormation)(JSON.stringify(newTemplate)));
294638
- const mangledDiff = (0, import_cloudformation_diff.fullDiff)(oldTemplate, mangledNewTemplate, changeSet);
294899
+ const mangledNewTemplate = JSON.parse((0, import_cloudformation_diff2.mangleLikeCloudFormation)(JSON.stringify(newTemplate)));
294900
+ const mangledDiff = (0, import_cloudformation_diff2.fullDiff)(oldTemplate, mangledNewTemplate, changeSet);
294639
294901
  filteredChangesCount = Math.max(0, diff.differenceCount - mangledDiff.differenceCount);
294640
294902
  if (filteredChangesCount > 0) {
294641
294903
  activeDiff = mangledDiff;
@@ -294648,7 +294910,7 @@ var init_diff_formatter = __esm({
294648
294910
  const metadataWasFiltered = diffWasNonEmpty && activeDiff.isEmpty;
294649
294911
  if (!activeDiff.isEmpty) {
294650
294912
  numStacksWithChanges++;
294651
- (0, import_cloudformation_diff.formatDifferences)(stream, activeDiff, {
294913
+ (0, import_cloudformation_diff2.formatDifferences)(stream, activeDiff, {
294652
294914
  ...logicalIdMapFromTemplate(oldTemplate),
294653
294915
  ...logicalIdMapFromTemplate(newTemplate),
294654
294916
  ...logicalIdMap
@@ -294705,7 +294967,7 @@ var init_diff_formatter = __esm({
294705
294967
  `));
294706
294968
  }
294707
294969
  try {
294708
- (0, import_cloudformation_diff.formatSecurityChanges)(stream, diff, {
294970
+ (0, import_cloudformation_diff2.formatSecurityChanges)(stream, diff, {
294709
294971
  ...logicalIdMapFromTemplate(newTemplate),
294710
294972
  ...logicalIdMap
294711
294973
  });
@@ -295428,9 +295690,6 @@ function stripReferences(value, exports2) {
295428
295690
  if ("Fn::GetAtt" in value) {
295429
295691
  return { __cloud_ref__: "Fn::GetAtt" };
295430
295692
  }
295431
- if ("DependsOn" in value) {
295432
- return { __cloud_ref__: "DependsOn" };
295433
- }
295434
295693
  if ("Fn::ImportValue" in value) {
295435
295694
  const exp = exports2[value["Fn::ImportValue"]];
295436
295695
  if (exp != null) {
@@ -295448,6 +295707,9 @@ function stripReferences(value, exports2) {
295448
295707
  }
295449
295708
  const result2 = {};
295450
295709
  for (const [k6, v] of Object.entries(value)) {
295710
+ if (k6 === "DependsOn") {
295711
+ continue;
295712
+ }
295451
295713
  result2[k6] = stripReferences(v, exports2);
295452
295714
  }
295453
295715
  return result2;
@@ -295808,13 +296070,13 @@ async function listStacks(sdkProvider, environment) {
295808
296070
  }
295809
296071
  function formatEnvironmentSectionHeader2(environment) {
295810
296072
  const env2 = `aws://${environment.account}/${environment.region}`;
295811
- return formatToStream((stream) => (0, import_cloudformation_diff2.formatEnvironmentSectionHeader)(stream, env2));
296073
+ return formatToStream((stream) => (0, import_cloudformation_diff3.formatEnvironmentSectionHeader)(stream, env2));
295812
296074
  }
295813
296075
  function formatTypedMappings2(mappings) {
295814
- return formatToStream((stream) => (0, import_cloudformation_diff2.formatTypedMappings)(stream, mappings));
296076
+ return formatToStream((stream) => (0, import_cloudformation_diff3.formatTypedMappings)(stream, mappings));
295815
296077
  }
295816
296078
  function formatAmbiguousMappings2(paths) {
295817
- return formatToStream((stream) => (0, import_cloudformation_diff2.formatAmbiguousMappings)(stream, paths));
296079
+ return formatToStream((stream) => (0, import_cloudformation_diff3.formatAmbiguousMappings)(stream, paths));
295818
296080
  }
295819
296081
  function formatToStream(cb) {
295820
296082
  const stream = new StringWriteStream();
@@ -295849,11 +296111,11 @@ async function groupStacks(sdkProvider, localStacks, additionalStackNames) {
295849
296111
  }
295850
296112
  return groups;
295851
296113
  }
295852
- var import_cloudformation_diff2;
296114
+ var import_cloudformation_diff3;
295853
296115
  var init_refactoring = __esm({
295854
296116
  "../toolkit-lib/lib/api/refactoring/index.ts"() {
295855
296117
  "use strict";
295856
- import_cloudformation_diff2 = __toESM(require_lib10());
296118
+ import_cloudformation_diff3 = __toESM(require_lib10());
295857
296119
  init_util4();
295858
296120
  init_plugin2();
295859
296121
  init_streams();
@@ -297806,12 +298068,12 @@ var init_tags2 = __esm({
297806
298068
  });
297807
298069
 
297808
298070
  // ../toolkit-lib/lib/api/drift/drift-formatter.ts
297809
- var import_node_util7, import_cloudformation_diff3, import_client_cloudformation7, import_chalk25, DriftFormatter, ADDITION3, CONTEXT2, UPDATE3, REMOVAL3;
298071
+ var import_node_util7, import_cloudformation_diff4, import_client_cloudformation7, import_chalk25, DriftFormatter, ADDITION3, CONTEXT2, UPDATE3, REMOVAL3;
297810
298072
  var init_drift_formatter = __esm({
297811
298073
  "../toolkit-lib/lib/api/drift/drift-formatter.ts"() {
297812
298074
  "use strict";
297813
298075
  import_node_util7 = require("node:util");
297814
- import_cloudformation_diff3 = __toESM(require_lib10());
298076
+ import_cloudformation_diff4 = __toESM(require_lib10());
297815
298077
  import_client_cloudformation7 = __toESM(require_dist_cjs28());
297816
298078
  import_chalk25 = __toESM(require_source());
297817
298079
  init_logical_id_map();
@@ -297917,7 +298179,7 @@ ${actualDrifts.length} resource${actualDrifts.length === 1 ? "" : "s"} ${actualD
297917
298179
  for (let i6 = 0; i6 < propDiffs.length; i6++) {
297918
298180
  const diff = propDiffs[i6];
297919
298181
  if (!diff.PropertyPath) continue;
297920
- const difference2 = new import_cloudformation_diff3.Difference(diff.ExpectedValue, diff.ActualValue);
298182
+ const difference2 = new import_cloudformation_diff4.Difference(diff.ExpectedValue, diff.ActualValue);
297921
298183
  modified += this.formatTreeDiff(diff.PropertyPath, difference2, i6 === propDiffs.length - 1);
297922
298184
  }
297923
298185
  }
@@ -299686,7 +299948,7 @@ var init_toolkit = __esm({
299686
299948
  const prepareResult = isChangeSetDeployment(options.deploymentMethod) ? await deployments.prepareStack({
299687
299949
  ...sharedDeployOptions,
299688
299950
  deploymentMethod: options.deploymentMethod,
299689
- cleanupOnNoOp: isExecutingChangeSetDeployment(options.deploymentMethod)
299951
+ willExecuteChangeSet: isExecutingChangeSetDeployment(options.deploymentMethod)
299690
299952
  }) : void 0;
299691
299953
  if (!prepareResult?.noOp) {
299692
299954
  const diffChangeSet = isExecuteChangeSetDeployment(options.deploymentMethod) ? (await deployments.describeChangeSet(stack, options.deploymentMethod.changeSetName, prepareResult?.stackArn)).changeSet : prepareResult?.changeSet;
@@ -300772,7 +301034,7 @@ var require_lru_cache = __commonJS({
300772
301034
  }
300773
301035
  }
300774
301036
  };
300775
- var warned = /* @__PURE__ */ new Set();
301037
+ var warned2 = /* @__PURE__ */ new Set();
300776
301038
  var deprecatedOption = /* @__PURE__ */ __name((opt, instead) => {
300777
301039
  const code = `LRU_CACHE_OPTION_${opt}`;
300778
301040
  if (shouldWarn(code)) {
@@ -300798,9 +301060,9 @@ var require_lru_cache = __commonJS({
300798
301060
  var emitWarning = /* @__PURE__ */ __name((...a6) => {
300799
301061
  typeof process === "object" && process && typeof process.emitWarning === "function" ? process.emitWarning(...a6) : console.error(...a6);
300800
301062
  }, "emitWarning");
300801
- var shouldWarn = /* @__PURE__ */ __name((code) => !warned.has(code), "shouldWarn");
301063
+ var shouldWarn = /* @__PURE__ */ __name((code) => !warned2.has(code), "shouldWarn");
300802
301064
  var warn2 = /* @__PURE__ */ __name((code, what, instead, fn) => {
300803
- warned.add(code);
301065
+ warned2.add(code);
300804
301066
  const msg = `The ${what} is deprecated. Please use ${instead} instead.`;
300805
301067
  emitWarning(msg, "DeprecationWarning", code, fn);
300806
301068
  }, "warn");
@@ -300960,7 +301222,7 @@ var require_lru_cache = __commonJS({
300960
301222
  if (!this.ttlAutopurge && !this.max && !this.maxSize) {
300961
301223
  const code = "LRU_CACHE_UNBOUNDED";
300962
301224
  if (shouldWarn(code)) {
300963
- warned.add(code);
301225
+ warned2.add(code);
300964
301226
  const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
300965
301227
  emitWarning(msg, "UnboundedCacheWarning", code, _LRUCache);
300966
301228
  }
@@ -302284,10 +302546,10 @@ var require_browser = __commonJS({
302284
302546
  exports2.useColors = useColors;
302285
302547
  exports2.storage = localstorage();
302286
302548
  exports2.destroy = /* @__PURE__ */ (() => {
302287
- let warned = false;
302549
+ let warned2 = false;
302288
302550
  return () => {
302289
- if (!warned) {
302290
- warned = true;
302551
+ if (!warned2) {
302552
+ warned2 = true;
302291
302553
  console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
302292
302554
  }
302293
302555
  };
@@ -331536,14 +331798,14 @@ These resources are no longer managed by CloudFormation but still exist and may
331536
331798
  });
331537
331799
 
331538
331800
  // lib/runner/snapshot-test-runner.ts
331539
- var path42, import_stream, import_string_decoder, import_cloudformation_diff4, IntegSnapshotRunner, StringWritable;
331801
+ var path42, import_stream, import_string_decoder, import_cloudformation_diff5, IntegSnapshotRunner, StringWritable;
331540
331802
  var init_snapshot_test_runner = __esm({
331541
331803
  "lib/runner/snapshot-test-runner.ts"() {
331542
331804
  "use strict";
331543
331805
  path42 = __toESM(require("path"));
331544
331806
  import_stream = require("stream");
331545
331807
  import_string_decoder = require("string_decoder");
331546
- import_cloudformation_diff4 = __toESM(require_lib10());
331808
+ import_cloudformation_diff5 = __toESM(require_lib10());
331547
331809
  init_cdk_test_app();
331548
331810
  init_common4();
331549
331811
  IntegSnapshotRunner = class {
@@ -331668,7 +331930,7 @@ var init_snapshot_test_runner = __esm({
331668
331930
  actualTemplate = this.canonicalizeTemplate(actualTemplate, actual[stackId].assets);
331669
331931
  expectedTemplate = this.canonicalizeTemplate(expectedTemplate, expected[stackId].assets);
331670
331932
  }
331671
- const templateDiff = (0, import_cloudformation_diff4.fullDiff)(expectedTemplate, actualTemplate);
331933
+ const templateDiff = (0, import_cloudformation_diff5.fullDiff)(expectedTemplate, actualTemplate);
331672
331934
  if (!templateDiff.isEmpty) {
331673
331935
  const allowedDestroyTypes = await this.getAllowedDestroyTypesForStack(actualApp, stackId) ?? [];
331674
331936
  templateDiff.resources.forEachDifference((logicalId, change) => {
@@ -331678,16 +331940,16 @@ var init_snapshot_test_runner = __esm({
331678
331940
  }
331679
331941
  if (change.isRemoval) {
331680
331942
  destructiveChanges.push({
331681
- impact: import_cloudformation_diff4.ResourceImpact.WILL_DESTROY,
331943
+ impact: import_cloudformation_diff5.ResourceImpact.WILL_DESTROY,
331682
331944
  logicalId,
331683
331945
  stackName: templateId
331684
331946
  });
331685
331947
  } else {
331686
331948
  switch (change.changeImpact) {
331687
- case import_cloudformation_diff4.ResourceImpact.MAY_REPLACE:
331688
- case import_cloudformation_diff4.ResourceImpact.WILL_ORPHAN:
331689
- case import_cloudformation_diff4.ResourceImpact.WILL_DESTROY:
331690
- case import_cloudformation_diff4.ResourceImpact.WILL_REPLACE:
331949
+ case import_cloudformation_diff5.ResourceImpact.MAY_REPLACE:
331950
+ case import_cloudformation_diff5.ResourceImpact.WILL_ORPHAN:
331951
+ case import_cloudformation_diff5.ResourceImpact.WILL_DESTROY:
331952
+ case import_cloudformation_diff5.ResourceImpact.WILL_REPLACE:
331691
331953
  destructiveChanges.push({
331692
331954
  impact: change.changeImpact,
331693
331955
  logicalId,
@@ -331698,7 +331960,7 @@ var init_snapshot_test_runner = __esm({
331698
331960
  }
331699
331961
  });
331700
331962
  const writable = new StringWritable({});
331701
- (0, import_cloudformation_diff4.formatDifferences)(writable, templateDiff);
331963
+ (0, import_cloudformation_diff5.formatDifferences)(writable, templateDiff);
331702
331964
  failures.push({
331703
331965
  reason: "SNAPSHOT_FAILED" /* SNAPSHOT_FAILED */,
331704
331966
  message: writable.data,