@lark-apaas/fullstack-nestjs-core 1.1.34-alpha.2 → 1.1.34-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1370,8 +1370,8 @@ var require_node = __commonJS({
1370
1370
  }
1371
1371
  break;
1372
1372
  case "FILE":
1373
- var fs2 = __require("fs");
1374
- stream2 = new fs2.SyncWriteStream(fd2, {
1373
+ var fs3 = __require("fs");
1374
+ stream2 = new fs3.SyncWriteStream(fd2, {
1375
1375
  autoClose: false
1376
1376
  });
1377
1377
  stream2._type = "fs";
@@ -1589,9 +1589,9 @@ var require_safer = __commonJS({
1589
1589
  }
1590
1590
  });
1591
1591
 
1592
- // ../../../node_modules/iconv-lite/lib/bom-handling.js
1592
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/lib/bom-handling.js
1593
1593
  var require_bom_handling = __commonJS({
1594
- "../../../node_modules/iconv-lite/lib/bom-handling.js"(exports) {
1594
+ "../../../node_modules/body-parser/node_modules/iconv-lite/lib/bom-handling.js"(exports) {
1595
1595
  "use strict";
1596
1596
  var BOMChar = "\uFEFF";
1597
1597
  exports.PrependBOM = PrependBOMWrapper;
@@ -1633,9 +1633,9 @@ var require_bom_handling = __commonJS({
1633
1633
  }
1634
1634
  });
1635
1635
 
1636
- // ../../../node_modules/iconv-lite/encodings/internal.js
1636
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/internal.js
1637
1637
  var require_internal = __commonJS({
1638
- "../../../node_modules/iconv-lite/encodings/internal.js"(exports, module) {
1638
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/internal.js"(exports, module) {
1639
1639
  "use strict";
1640
1640
  var Buffer2 = require_safer().Buffer;
1641
1641
  module.exports = {
@@ -1792,9 +1792,9 @@ var require_internal = __commonJS({
1792
1792
  }
1793
1793
  });
1794
1794
 
1795
- // ../../../node_modules/iconv-lite/encodings/utf16.js
1795
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/utf16.js
1796
1796
  var require_utf16 = __commonJS({
1797
- "../../../node_modules/iconv-lite/encodings/utf16.js"(exports) {
1797
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/utf16.js"(exports) {
1798
1798
  "use strict";
1799
1799
  var Buffer2 = require_safer().Buffer;
1800
1800
  exports.utf16be = Utf16BECodec;
@@ -1908,9 +1908,9 @@ var require_utf16 = __commonJS({
1908
1908
  }
1909
1909
  });
1910
1910
 
1911
- // ../../../node_modules/iconv-lite/encodings/utf7.js
1911
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/utf7.js
1912
1912
  var require_utf7 = __commonJS({
1913
- "../../../node_modules/iconv-lite/encodings/utf7.js"(exports) {
1913
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/utf7.js"(exports) {
1914
1914
  "use strict";
1915
1915
  var Buffer2 = require_safer().Buffer;
1916
1916
  exports.utf7 = Utf7Codec;
@@ -2109,9 +2109,9 @@ var require_utf7 = __commonJS({
2109
2109
  }
2110
2110
  });
2111
2111
 
2112
- // ../../../node_modules/iconv-lite/encodings/sbcs-codec.js
2112
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-codec.js
2113
2113
  var require_sbcs_codec = __commonJS({
2114
- "../../../node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
2114
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-codec.js"(exports) {
2115
2115
  "use strict";
2116
2116
  var Buffer2 = require_safer().Buffer;
2117
2117
  exports._sbcs = SBCSCodec;
@@ -2163,9 +2163,9 @@ var require_sbcs_codec = __commonJS({
2163
2163
  }
2164
2164
  });
2165
2165
 
2166
- // ../../../node_modules/iconv-lite/encodings/sbcs-data.js
2166
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js
2167
2167
  var require_sbcs_data = __commonJS({
2168
- "../../../node_modules/iconv-lite/encodings/sbcs-data.js"(exports, module) {
2168
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data.js"(exports, module) {
2169
2169
  "use strict";
2170
2170
  module.exports = {
2171
2171
  // Not supported by iconv, not sure why.
@@ -2312,9 +2312,9 @@ var require_sbcs_data = __commonJS({
2312
2312
  }
2313
2313
  });
2314
2314
 
2315
- // ../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js
2315
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data-generated.js
2316
2316
  var require_sbcs_data_generated = __commonJS({
2317
- "../../../node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports, module) {
2317
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/sbcs-data-generated.js"(exports, module) {
2318
2318
  "use strict";
2319
2319
  module.exports = {
2320
2320
  "437": "cp437",
@@ -2767,9 +2767,9 @@ var require_sbcs_data_generated = __commonJS({
2767
2767
  }
2768
2768
  });
2769
2769
 
2770
- // ../../../node_modules/iconv-lite/encodings/dbcs-codec.js
2770
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js
2771
2771
  var require_dbcs_codec = __commonJS({
2772
- "../../../node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
2772
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-codec.js"(exports) {
2773
2773
  "use strict";
2774
2774
  var Buffer2 = require_safer().Buffer;
2775
2775
  exports._dbcs = DBCSCodec;
@@ -3114,9 +3114,9 @@ var require_dbcs_codec = __commonJS({
3114
3114
  }
3115
3115
  });
3116
3116
 
3117
- // ../../../node_modules/iconv-lite/encodings/tables/shiftjis.json
3117
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/shiftjis.json
3118
3118
  var require_shiftjis = __commonJS({
3119
- "../../../node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports, module) {
3119
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/shiftjis.json"(exports, module) {
3120
3120
  module.exports = [
3121
3121
  ["0", "\0", 128],
3122
3122
  ["a1", "\uFF61", 62],
@@ -3245,9 +3245,9 @@ var require_shiftjis = __commonJS({
3245
3245
  }
3246
3246
  });
3247
3247
 
3248
- // ../../../node_modules/iconv-lite/encodings/tables/eucjp.json
3248
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/eucjp.json
3249
3249
  var require_eucjp = __commonJS({
3250
- "../../../node_modules/iconv-lite/encodings/tables/eucjp.json"(exports, module) {
3250
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/eucjp.json"(exports, module) {
3251
3251
  module.exports = [
3252
3252
  ["0", "\0", 127],
3253
3253
  ["8ea1", "\uFF61", 62],
@@ -3433,9 +3433,9 @@ var require_eucjp = __commonJS({
3433
3433
  }
3434
3434
  });
3435
3435
 
3436
- // ../../../node_modules/iconv-lite/encodings/tables/cp936.json
3436
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp936.json
3437
3437
  var require_cp936 = __commonJS({
3438
- "../../../node_modules/iconv-lite/encodings/tables/cp936.json"(exports, module) {
3438
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp936.json"(exports, module) {
3439
3439
  module.exports = [
3440
3440
  ["0", "\0", 127, "\u20AC"],
3441
3441
  ["8140", "\u4E02\u4E04\u4E05\u4E06\u4E0F\u4E12\u4E17\u4E1F\u4E20\u4E21\u4E23\u4E26\u4E29\u4E2E\u4E2F\u4E31\u4E33\u4E35\u4E37\u4E3C\u4E40\u4E41\u4E42\u4E44\u4E46\u4E4A\u4E51\u4E55\u4E57\u4E5A\u4E5B\u4E62\u4E63\u4E64\u4E65\u4E67\u4E68\u4E6A", 5, "\u4E72\u4E74", 9, "\u4E7F", 6, "\u4E87\u4E8A"],
@@ -3703,9 +3703,9 @@ var require_cp936 = __commonJS({
3703
3703
  }
3704
3704
  });
3705
3705
 
3706
- // ../../../node_modules/iconv-lite/encodings/tables/gbk-added.json
3706
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gbk-added.json
3707
3707
  var require_gbk_added = __commonJS({
3708
- "../../../node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports, module) {
3708
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gbk-added.json"(exports, module) {
3709
3709
  module.exports = [
3710
3710
  ["a140", "\uE4C6", 62],
3711
3711
  ["a180", "\uE505", 32],
@@ -3764,16 +3764,16 @@ var require_gbk_added = __commonJS({
3764
3764
  }
3765
3765
  });
3766
3766
 
3767
- // ../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
3767
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json
3768
3768
  var require_gb18030_ranges = __commonJS({
3769
- "../../../node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports, module) {
3769
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json"(exports, module) {
3770
3770
  module.exports = { uChars: [128, 165, 169, 178, 184, 216, 226, 235, 238, 244, 248, 251, 253, 258, 276, 284, 300, 325, 329, 334, 364, 463, 465, 467, 469, 471, 473, 475, 477, 506, 594, 610, 712, 716, 730, 930, 938, 962, 970, 1026, 1104, 1106, 8209, 8215, 8218, 8222, 8231, 8241, 8244, 8246, 8252, 8365, 8452, 8454, 8458, 8471, 8482, 8556, 8570, 8596, 8602, 8713, 8720, 8722, 8726, 8731, 8737, 8740, 8742, 8748, 8751, 8760, 8766, 8777, 8781, 8787, 8802, 8808, 8816, 8854, 8858, 8870, 8896, 8979, 9322, 9372, 9548, 9588, 9616, 9622, 9634, 9652, 9662, 9672, 9676, 9680, 9702, 9735, 9738, 9793, 9795, 11906, 11909, 11913, 11917, 11928, 11944, 11947, 11951, 11956, 11960, 11964, 11979, 12284, 12292, 12312, 12319, 12330, 12351, 12436, 12447, 12535, 12543, 12586, 12842, 12850, 12964, 13200, 13215, 13218, 13253, 13263, 13267, 13270, 13384, 13428, 13727, 13839, 13851, 14617, 14703, 14801, 14816, 14964, 15183, 15471, 15585, 16471, 16736, 17208, 17325, 17330, 17374, 17623, 17997, 18018, 18212, 18218, 18301, 18318, 18760, 18811, 18814, 18820, 18823, 18844, 18848, 18872, 19576, 19620, 19738, 19887, 40870, 59244, 59336, 59367, 59413, 59417, 59423, 59431, 59437, 59443, 59452, 59460, 59478, 59493, 63789, 63866, 63894, 63976, 63986, 64016, 64018, 64021, 64025, 64034, 64037, 64042, 65074, 65093, 65107, 65112, 65127, 65132, 65375, 65510, 65536], gbChars: [0, 36, 38, 45, 50, 81, 89, 95, 96, 100, 103, 104, 105, 109, 126, 133, 148, 172, 175, 179, 208, 306, 307, 308, 309, 310, 311, 312, 313, 341, 428, 443, 544, 545, 558, 741, 742, 749, 750, 805, 819, 820, 7922, 7924, 7925, 7927, 7934, 7943, 7944, 7945, 7950, 8062, 8148, 8149, 8152, 8164, 8174, 8236, 8240, 8262, 8264, 8374, 8380, 8381, 8384, 8388, 8390, 8392, 8393, 8394, 8396, 8401, 8406, 8416, 8419, 8424, 8437, 8439, 8445, 8482, 8485, 8496, 8521, 8603, 8936, 8946, 9046, 9050, 9063, 9066, 9076, 9092, 9100, 9108, 9111, 9113, 9131, 9162, 9164, 9218, 9219, 11329, 11331, 11334, 11336, 11346, 11361, 11363, 11366, 11370, 11372, 11375, 11389, 11682, 11686, 11687, 11692, 11694, 11714, 11716, 11723, 11725, 11730, 11736, 11982, 11989, 12102, 12336, 12348, 12350, 12384, 12393, 12395, 12397, 12510, 12553, 12851, 12962, 12973, 13738, 13823, 13919, 13933, 14080, 14298, 14585, 14698, 15583, 15847, 16318, 16434, 16438, 16481, 16729, 17102, 17122, 17315, 17320, 17402, 17418, 17859, 17909, 17911, 17915, 17916, 17936, 17939, 17961, 18664, 18703, 18814, 18962, 19043, 33469, 33470, 33471, 33484, 33485, 33490, 33497, 33501, 33505, 33513, 33520, 33536, 33550, 37845, 37921, 37948, 38029, 38038, 38064, 38065, 38066, 38069, 38075, 38076, 38078, 39108, 39109, 39113, 39114, 39115, 39116, 39265, 39394, 189e3] };
3771
3771
  }
3772
3772
  });
3773
3773
 
3774
- // ../../../node_modules/iconv-lite/encodings/tables/cp949.json
3774
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp949.json
3775
3775
  var require_cp949 = __commonJS({
3776
- "../../../node_modules/iconv-lite/encodings/tables/cp949.json"(exports, module) {
3776
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp949.json"(exports, module) {
3777
3777
  module.exports = [
3778
3778
  ["0", "\0", 127],
3779
3779
  ["8141", "\uAC02\uAC03\uAC05\uAC06\uAC0B", 4, "\uAC18\uAC1E\uAC1F\uAC21\uAC22\uAC23\uAC25", 6, "\uAC2E\uAC32\uAC33\uAC34"],
@@ -4050,9 +4050,9 @@ var require_cp949 = __commonJS({
4050
4050
  }
4051
4051
  });
4052
4052
 
4053
- // ../../../node_modules/iconv-lite/encodings/tables/cp950.json
4053
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp950.json
4054
4054
  var require_cp950 = __commonJS({
4055
- "../../../node_modules/iconv-lite/encodings/tables/cp950.json"(exports, module) {
4055
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/cp950.json"(exports, module) {
4056
4056
  module.exports = [
4057
4057
  ["0", "\0", 127],
4058
4058
  ["a140", "\u3000\uFF0C\u3001\u3002\uFF0E\u2027\uFF1B\uFF1A\uFF1F\uFF01\uFE30\u2026\u2025\uFE50\uFE51\uFE52\xB7\uFE54\uFE55\uFE56\uFE57\uFF5C\u2013\uFE31\u2014\uFE33\u2574\uFE34\uFE4F\uFF08\uFF09\uFE35\uFE36\uFF5B\uFF5D\uFE37\uFE38\u3014\u3015\uFE39\uFE3A\u3010\u3011\uFE3B\uFE3C\u300A\u300B\uFE3D\uFE3E\u3008\u3009\uFE3F\uFE40\u300C\u300D\uFE41\uFE42\u300E\u300F\uFE43\uFE44\uFE59\uFE5A"],
@@ -4233,9 +4233,9 @@ var require_cp950 = __commonJS({
4233
4233
  }
4234
4234
  });
4235
4235
 
4236
- // ../../../node_modules/iconv-lite/encodings/tables/big5-added.json
4236
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/big5-added.json
4237
4237
  var require_big5_added = __commonJS({
4238
- "../../../node_modules/iconv-lite/encodings/tables/big5-added.json"(exports, module) {
4238
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/tables/big5-added.json"(exports, module) {
4239
4239
  module.exports = [
4240
4240
  ["8740", "\u43F0\u4C32\u4603\u45A6\u4578\u{27267}\u4D77\u45B3\u{27CB1}\u4CE2\u{27CC5}\u3B95\u4736\u4744\u4C47\u4C40\u{242BF}\u{23617}\u{27352}\u{26E8B}\u{270D2}\u4C57\u{2A351}\u474F\u45DA\u4C85\u{27C6C}\u4D07\u4AA4\u46A1\u{26B23}\u7225\u{25A54}\u{21A63}\u{23E06}\u{23F61}\u664D\u56FB"],
4241
4241
  ["8767", "\u7D95\u591D\u{28BB9}\u3DF4\u9734\u{27BEF}\u5BDB\u{21D5E}\u5AA4\u3625\u{29EB0}\u5AD1\u5BB7\u5CFC\u676E\u8593\u{29945}\u7461\u749D\u3875\u{21D53}\u{2369E}\u{26021}\u3EEC"],
@@ -4361,9 +4361,9 @@ var require_big5_added = __commonJS({
4361
4361
  }
4362
4362
  });
4363
4363
 
4364
- // ../../../node_modules/iconv-lite/encodings/dbcs-data.js
4364
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js
4365
4365
  var require_dbcs_data = __commonJS({
4366
- "../../../node_modules/iconv-lite/encodings/dbcs-data.js"(exports, module) {
4366
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/dbcs-data.js"(exports, module) {
4367
4367
  "use strict";
4368
4368
  module.exports = {
4369
4369
  // == Japanese/ShiftJIS ====================================================
@@ -4553,9 +4553,9 @@ var require_dbcs_data = __commonJS({
4553
4553
  }
4554
4554
  });
4555
4555
 
4556
- // ../../../node_modules/iconv-lite/encodings/index.js
4556
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/encodings/index.js
4557
4557
  var require_encodings = __commonJS({
4558
- "../../../node_modules/iconv-lite/encodings/index.js"(exports, module) {
4558
+ "../../../node_modules/body-parser/node_modules/iconv-lite/encodings/index.js"(exports, module) {
4559
4559
  "use strict";
4560
4560
  var modules = [
4561
4561
  require_internal(),
@@ -4577,9 +4577,9 @@ var require_encodings = __commonJS({
4577
4577
  }
4578
4578
  });
4579
4579
 
4580
- // ../../../node_modules/iconv-lite/lib/streams.js
4580
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/lib/streams.js
4581
4581
  var require_streams = __commonJS({
4582
- "../../../node_modules/iconv-lite/lib/streams.js"(exports, module) {
4582
+ "../../../node_modules/body-parser/node_modules/iconv-lite/lib/streams.js"(exports, module) {
4583
4583
  "use strict";
4584
4584
  var Buffer2 = __require("buffer").Buffer;
4585
4585
  var Transform = __require("stream").Transform;
@@ -4682,9 +4682,9 @@ var require_streams = __commonJS({
4682
4682
  }
4683
4683
  });
4684
4684
 
4685
- // ../../../node_modules/iconv-lite/lib/extend-node.js
4685
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/lib/extend-node.js
4686
4686
  var require_extend_node = __commonJS({
4687
- "../../../node_modules/iconv-lite/lib/extend-node.js"(exports, module) {
4687
+ "../../../node_modules/body-parser/node_modules/iconv-lite/lib/extend-node.js"(exports, module) {
4688
4688
  "use strict";
4689
4689
  var Buffer2 = __require("buffer").Buffer;
4690
4690
  module.exports = function(iconv) {
@@ -4835,9 +4835,9 @@ var require_extend_node = __commonJS({
4835
4835
  }
4836
4836
  });
4837
4837
 
4838
- // ../../../node_modules/iconv-lite/lib/index.js
4838
+ // ../../../node_modules/body-parser/node_modules/iconv-lite/lib/index.js
4839
4839
  var require_lib = __commonJS({
4840
- "../../../node_modules/iconv-lite/lib/index.js"(exports, module) {
4840
+ "../../../node_modules/body-parser/node_modules/iconv-lite/lib/index.js"(exports, module) {
4841
4841
  "use strict";
4842
4842
  var Buffer2 = require_safer().Buffer;
4843
4843
  var bomHandling = require_bom_handling();
@@ -16501,9 +16501,9 @@ var require_side_channel = __commonJS({
16501
16501
  }
16502
16502
  });
16503
16503
 
16504
- // ../../../node_modules/qs/lib/formats.js
16504
+ // ../../../node_modules/body-parser/node_modules/qs/lib/formats.js
16505
16505
  var require_formats = __commonJS({
16506
- "../../../node_modules/qs/lib/formats.js"(exports, module) {
16506
+ "../../../node_modules/body-parser/node_modules/qs/lib/formats.js"(exports, module) {
16507
16507
  "use strict";
16508
16508
  var replace = String.prototype.replace;
16509
16509
  var percentTwenties = /%20/g;
@@ -16527,9 +16527,9 @@ var require_formats = __commonJS({
16527
16527
  }
16528
16528
  });
16529
16529
 
16530
- // ../../../node_modules/qs/lib/utils.js
16530
+ // ../../../node_modules/body-parser/node_modules/qs/lib/utils.js
16531
16531
  var require_utils = __commonJS({
16532
- "../../../node_modules/qs/lib/utils.js"(exports, module) {
16532
+ "../../../node_modules/body-parser/node_modules/qs/lib/utils.js"(exports, module) {
16533
16533
  "use strict";
16534
16534
  var formats = require_formats();
16535
16535
  var getSideChannel = require_side_channel();
@@ -16552,7 +16552,7 @@ var require_utils = __commonJS({
16552
16552
  var hexTable = (function() {
16553
16553
  var array = [];
16554
16554
  for (var i = 0; i < 256; ++i) {
16555
- array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
16555
+ array[array.length] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
16556
16556
  }
16557
16557
  return array;
16558
16558
  })();
@@ -16564,7 +16564,7 @@ var require_utils = __commonJS({
16564
16564
  var compacted = [];
16565
16565
  for (var j = 0; j < obj.length; ++j) {
16566
16566
  if (typeof obj[j] !== "undefined") {
16567
- compacted.push(obj[j]);
16567
+ compacted[compacted.length] = obj[j];
16568
16568
  }
16569
16569
  }
16570
16570
  item.obj[item.prop] = compacted;
@@ -16588,7 +16588,11 @@ var require_utils = __commonJS({
16588
16588
  }
16589
16589
  if (typeof source !== "object" && typeof source !== "function") {
16590
16590
  if (isArray(target)) {
16591
- target.push(source);
16591
+ var nextIndex = target.length;
16592
+ if (options && typeof options.arrayLimit === "number" && nextIndex > options.arrayLimit) {
16593
+ return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
16594
+ }
16595
+ target[nextIndex] = source;
16592
16596
  } else if (target && typeof target === "object") {
16593
16597
  if (isOverflow(target)) {
16594
16598
  var newIndex = getMaxIndex(target) + 1;
@@ -16620,9 +16624,13 @@ var require_utils = __commonJS({
16620
16624
  }
16621
16625
  return markOverflow(result, getMaxIndex(source) + 1);
16622
16626
  }
16623
- return [
16627
+ var combined = [
16624
16628
  target
16625
16629
  ].concat(source);
16630
+ if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) {
16631
+ return markOverflow(arrayToObject(combined, options), combined.length - 1);
16632
+ }
16633
+ return combined;
16626
16634
  }
16627
16635
  var mergeTarget = target;
16628
16636
  if (isArray(target) && !isArray(source)) {
@@ -16635,7 +16643,7 @@ var require_utils = __commonJS({
16635
16643
  if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
16636
16644
  target[i] = merge2(targetItem, item, options);
16637
16645
  } else {
16638
- target.push(item);
16646
+ target[target.length] = item;
16639
16647
  }
16640
16648
  } else {
16641
16649
  target[i] = item;
@@ -16650,6 +16658,15 @@ var require_utils = __commonJS({
16650
16658
  } else {
16651
16659
  acc[key] = value;
16652
16660
  }
16661
+ if (isOverflow(source) && !isOverflow(acc)) {
16662
+ markOverflow(acc, getMaxIndex(source));
16663
+ }
16664
+ if (isOverflow(acc)) {
16665
+ var keyNum = parseInt(key, 10);
16666
+ if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
16667
+ setMaxIndex(acc, keyNum);
16668
+ }
16669
+ }
16653
16670
  return acc;
16654
16671
  }, mergeTarget);
16655
16672
  }, "merge");
@@ -16734,11 +16751,11 @@ var require_utils = __commonJS({
16734
16751
  var key = keys[j];
16735
16752
  var val = obj[key];
16736
16753
  if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
16737
- queue.push({
16754
+ queue[queue.length] = {
16738
16755
  obj,
16739
16756
  prop: key
16740
- });
16741
- refs.push(val);
16757
+ };
16758
+ refs[refs.length] = val;
16742
16759
  }
16743
16760
  }
16744
16761
  }
@@ -16773,7 +16790,7 @@ var require_utils = __commonJS({
16773
16790
  if (isArray(val)) {
16774
16791
  var mapped = [];
16775
16792
  for (var i = 0; i < val.length; i += 1) {
16776
- mapped.push(fn(val[i]));
16793
+ mapped[mapped.length] = fn(val[i]);
16777
16794
  }
16778
16795
  return mapped;
16779
16796
  }
@@ -16789,15 +16806,16 @@ var require_utils = __commonJS({
16789
16806
  isBuffer,
16790
16807
  isOverflow,
16791
16808
  isRegExp,
16809
+ markOverflow,
16792
16810
  maybeMap,
16793
16811
  merge
16794
16812
  };
16795
16813
  }
16796
16814
  });
16797
16815
 
16798
- // ../../../node_modules/qs/lib/stringify.js
16816
+ // ../../../node_modules/body-parser/node_modules/qs/lib/stringify.js
16799
16817
  var require_stringify = __commonJS({
16800
- "../../../node_modules/qs/lib/stringify.js"(exports, module) {
16818
+ "../../../node_modules/body-parser/node_modules/qs/lib/stringify.js"(exports, module) {
16801
16819
  "use strict";
16802
16820
  var getSideChannel = require_side_channel();
16803
16821
  var utils = require_utils();
@@ -17050,9 +17068,9 @@ var require_stringify = __commonJS({
17050
17068
  }
17051
17069
  });
17052
17070
 
17053
- // ../../../node_modules/qs/lib/parse.js
17071
+ // ../../../node_modules/body-parser/node_modules/qs/lib/parse.js
17054
17072
  var require_parse = __commonJS({
17055
- "../../../node_modules/qs/lib/parse.js"(exports, module) {
17073
+ "../../../node_modules/body-parser/node_modules/qs/lib/parse.js"(exports, module) {
17056
17074
  "use strict";
17057
17075
  var utils = require_utils();
17058
17076
  var has = Object.prototype.hasOwnProperty;
@@ -17151,6 +17169,12 @@ var require_parse = __commonJS({
17151
17169
  val
17152
17170
  ] : val;
17153
17171
  }
17172
+ if (options.comma && isArray(val) && val.length > options.arrayLimit) {
17173
+ if (options.throwOnLimitExceeded) {
17174
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
17175
+ }
17176
+ val = utils.combine([], val, options.arrayLimit, options.plainObjects);
17177
+ }
17154
17178
  if (key !== null) {
17155
17179
  var existing = has.call(obj, key);
17156
17180
  if (existing && options.duplicates === "combine") {
@@ -17185,13 +17209,19 @@ var require_parse = __commonJS({
17185
17209
  var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
17186
17210
  var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
17187
17211
  var index = parseInt(decodedRoot, 10);
17212
+ var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
17188
17213
  if (!options.parseArrays && decodedRoot === "") {
17189
17214
  obj = {
17190
17215
  0: leaf
17191
17216
  };
17192
- } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays && index <= options.arrayLimit) {
17217
+ } else if (isValidArrayIndex && index < options.arrayLimit) {
17193
17218
  obj = [];
17194
17219
  obj[index] = leaf;
17220
+ } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
17221
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
17222
+ } else if (isValidArrayIndex) {
17223
+ obj[index] = leaf;
17224
+ utils.markOverflow(obj, index);
17195
17225
  } else if (decodedRoot !== "__proto__") {
17196
17226
  obj[decodedRoot] = leaf;
17197
17227
  }
@@ -17223,7 +17253,7 @@ var require_parse = __commonJS({
17223
17253
  return;
17224
17254
  }
17225
17255
  }
17226
- keys.push(parent);
17256
+ keys[keys.length] = parent;
17227
17257
  }
17228
17258
  var i = 0;
17229
17259
  while ((segment = child.exec(key)) !== null && i < options.depth) {
@@ -17234,13 +17264,13 @@ var require_parse = __commonJS({
17234
17264
  return;
17235
17265
  }
17236
17266
  }
17237
- keys.push(segment[1]);
17267
+ keys[keys.length] = segment[1];
17238
17268
  }
17239
17269
  if (segment) {
17240
17270
  if (options.strictDepth === true) {
17241
17271
  throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
17242
17272
  }
17243
- keys.push("[" + key.slice(segment.index) + "]");
17273
+ keys[keys.length] = "[" + key.slice(segment.index) + "]";
17244
17274
  }
17245
17275
  return keys;
17246
17276
  }, "splitKeyIntoSegments");
@@ -17329,9 +17359,9 @@ var require_parse = __commonJS({
17329
17359
  }
17330
17360
  });
17331
17361
 
17332
- // ../../../node_modules/qs/lib/index.js
17362
+ // ../../../node_modules/body-parser/node_modules/qs/lib/index.js
17333
17363
  var require_lib2 = __commonJS({
17334
- "../../../node_modules/qs/lib/index.js"(exports, module) {
17364
+ "../../../node_modules/body-parser/node_modules/qs/lib/index.js"(exports, module) {
17335
17365
  "use strict";
17336
17366
  var stringify = require_stringify();
17337
17367
  var parse = require_parse();
@@ -18038,8 +18068,8 @@ var require_node2 = __commonJS({
18038
18068
  }
18039
18069
  break;
18040
18070
  case "FILE":
18041
- var fs2 = __require("fs");
18042
- stream2 = new fs2.SyncWriteStream(fd2, {
18071
+ var fs3 = __require("fs");
18072
+ stream2 = new fs3.SyncWriteStream(fd2, {
18043
18073
  autoClose: false
18044
18074
  });
18045
18075
  stream2._type = "fs";
@@ -18808,8 +18838,8 @@ var require_node3 = __commonJS({
18808
18838
  }
18809
18839
  break;
18810
18840
  case "FILE":
18811
- var fs2 = __require("fs");
18812
- stream2 = new fs2.SyncWriteStream(fd2, {
18841
+ var fs3 = __require("fs");
18842
+ stream2 = new fs3.SyncWriteStream(fd2, {
18813
18843
  autoClose: false
18814
18844
  });
18815
18845
  stream2._type = "fs";
@@ -19696,13 +19726,886 @@ var require_init = __commonJS({
19696
19726
  }
19697
19727
  });
19698
19728
 
19729
+ // ../../../node_modules/express/node_modules/qs/lib/formats.js
19730
+ var require_formats2 = __commonJS({
19731
+ "../../../node_modules/express/node_modules/qs/lib/formats.js"(exports, module) {
19732
+ "use strict";
19733
+ var replace = String.prototype.replace;
19734
+ var percentTwenties = /%20/g;
19735
+ var Format = {
19736
+ RFC1738: "RFC1738",
19737
+ RFC3986: "RFC3986"
19738
+ };
19739
+ module.exports = {
19740
+ "default": Format.RFC3986,
19741
+ formatters: {
19742
+ RFC1738: /* @__PURE__ */ __name(function(value) {
19743
+ return replace.call(value, percentTwenties, "+");
19744
+ }, "RFC1738"),
19745
+ RFC3986: /* @__PURE__ */ __name(function(value) {
19746
+ return String(value);
19747
+ }, "RFC3986")
19748
+ },
19749
+ RFC1738: Format.RFC1738,
19750
+ RFC3986: Format.RFC3986
19751
+ };
19752
+ }
19753
+ });
19754
+
19755
+ // ../../../node_modules/express/node_modules/qs/lib/utils.js
19756
+ var require_utils2 = __commonJS({
19757
+ "../../../node_modules/express/node_modules/qs/lib/utils.js"(exports, module) {
19758
+ "use strict";
19759
+ var formats = require_formats2();
19760
+ var getSideChannel = require_side_channel();
19761
+ var has = Object.prototype.hasOwnProperty;
19762
+ var isArray = Array.isArray;
19763
+ var overflowChannel = getSideChannel();
19764
+ var markOverflow = /* @__PURE__ */ __name(function markOverflow2(obj, maxIndex) {
19765
+ overflowChannel.set(obj, maxIndex);
19766
+ return obj;
19767
+ }, "markOverflow");
19768
+ var isOverflow = /* @__PURE__ */ __name(function isOverflow2(obj) {
19769
+ return overflowChannel.has(obj);
19770
+ }, "isOverflow");
19771
+ var getMaxIndex = /* @__PURE__ */ __name(function getMaxIndex2(obj) {
19772
+ return overflowChannel.get(obj);
19773
+ }, "getMaxIndex");
19774
+ var setMaxIndex = /* @__PURE__ */ __name(function setMaxIndex2(obj, maxIndex) {
19775
+ overflowChannel.set(obj, maxIndex);
19776
+ }, "setMaxIndex");
19777
+ var hexTable = (function() {
19778
+ var array = [];
19779
+ for (var i = 0; i < 256; ++i) {
19780
+ array[array.length] = "%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase();
19781
+ }
19782
+ return array;
19783
+ })();
19784
+ var compactQueue = /* @__PURE__ */ __name(function compactQueue2(queue) {
19785
+ while (queue.length > 1) {
19786
+ var item = queue.pop();
19787
+ var obj = item.obj[item.prop];
19788
+ if (isArray(obj)) {
19789
+ var compacted = [];
19790
+ for (var j = 0; j < obj.length; ++j) {
19791
+ if (typeof obj[j] !== "undefined") {
19792
+ compacted[compacted.length] = obj[j];
19793
+ }
19794
+ }
19795
+ item.obj[item.prop] = compacted;
19796
+ }
19797
+ }
19798
+ }, "compactQueue");
19799
+ var arrayToObject = /* @__PURE__ */ __name(function arrayToObject2(source, options) {
19800
+ var obj = options && options.plainObjects ? {
19801
+ __proto__: null
19802
+ } : {};
19803
+ for (var i = 0; i < source.length; ++i) {
19804
+ if (typeof source[i] !== "undefined") {
19805
+ obj[i] = source[i];
19806
+ }
19807
+ }
19808
+ return obj;
19809
+ }, "arrayToObject");
19810
+ var merge = /* @__PURE__ */ __name(function merge2(target, source, options) {
19811
+ if (!source) {
19812
+ return target;
19813
+ }
19814
+ if (typeof source !== "object" && typeof source !== "function") {
19815
+ if (isArray(target)) {
19816
+ var nextIndex = target.length;
19817
+ if (options && typeof options.arrayLimit === "number" && nextIndex > options.arrayLimit) {
19818
+ return markOverflow(arrayToObject(target.concat(source), options), nextIndex);
19819
+ }
19820
+ target[nextIndex] = source;
19821
+ } else if (target && typeof target === "object") {
19822
+ if (isOverflow(target)) {
19823
+ var newIndex = getMaxIndex(target) + 1;
19824
+ target[newIndex] = source;
19825
+ setMaxIndex(target, newIndex);
19826
+ } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
19827
+ target[source] = true;
19828
+ }
19829
+ } else {
19830
+ return [
19831
+ target,
19832
+ source
19833
+ ];
19834
+ }
19835
+ return target;
19836
+ }
19837
+ if (!target || typeof target !== "object") {
19838
+ if (isOverflow(source)) {
19839
+ var sourceKeys = Object.keys(source);
19840
+ var result = options && options.plainObjects ? {
19841
+ __proto__: null,
19842
+ 0: target
19843
+ } : {
19844
+ 0: target
19845
+ };
19846
+ for (var m = 0; m < sourceKeys.length; m++) {
19847
+ var oldKey = parseInt(sourceKeys[m], 10);
19848
+ result[oldKey + 1] = source[sourceKeys[m]];
19849
+ }
19850
+ return markOverflow(result, getMaxIndex(source) + 1);
19851
+ }
19852
+ var combined = [
19853
+ target
19854
+ ].concat(source);
19855
+ if (options && typeof options.arrayLimit === "number" && combined.length > options.arrayLimit) {
19856
+ return markOverflow(arrayToObject(combined, options), combined.length - 1);
19857
+ }
19858
+ return combined;
19859
+ }
19860
+ var mergeTarget = target;
19861
+ if (isArray(target) && !isArray(source)) {
19862
+ mergeTarget = arrayToObject(target, options);
19863
+ }
19864
+ if (isArray(target) && isArray(source)) {
19865
+ source.forEach(function(item, i) {
19866
+ if (has.call(target, i)) {
19867
+ var targetItem = target[i];
19868
+ if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
19869
+ target[i] = merge2(targetItem, item, options);
19870
+ } else {
19871
+ target[target.length] = item;
19872
+ }
19873
+ } else {
19874
+ target[i] = item;
19875
+ }
19876
+ });
19877
+ return target;
19878
+ }
19879
+ return Object.keys(source).reduce(function(acc, key) {
19880
+ var value = source[key];
19881
+ if (has.call(acc, key)) {
19882
+ acc[key] = merge2(acc[key], value, options);
19883
+ } else {
19884
+ acc[key] = value;
19885
+ }
19886
+ if (isOverflow(source) && !isOverflow(acc)) {
19887
+ markOverflow(acc, getMaxIndex(source));
19888
+ }
19889
+ if (isOverflow(acc)) {
19890
+ var keyNum = parseInt(key, 10);
19891
+ if (String(keyNum) === key && keyNum >= 0 && keyNum > getMaxIndex(acc)) {
19892
+ setMaxIndex(acc, keyNum);
19893
+ }
19894
+ }
19895
+ return acc;
19896
+ }, mergeTarget);
19897
+ }, "merge");
19898
+ var assign = /* @__PURE__ */ __name(function assignSingleSource(target, source) {
19899
+ return Object.keys(source).reduce(function(acc, key) {
19900
+ acc[key] = source[key];
19901
+ return acc;
19902
+ }, target);
19903
+ }, "assignSingleSource");
19904
+ var decode = /* @__PURE__ */ __name(function(str, defaultDecoder, charset) {
19905
+ var strWithoutPlus = str.replace(/\+/g, " ");
19906
+ if (charset === "iso-8859-1") {
19907
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
19908
+ }
19909
+ try {
19910
+ return decodeURIComponent(strWithoutPlus);
19911
+ } catch (e) {
19912
+ return strWithoutPlus;
19913
+ }
19914
+ }, "decode");
19915
+ var limit = 1024;
19916
+ var encode = /* @__PURE__ */ __name(function encode2(str, defaultEncoder, charset, kind, format) {
19917
+ if (str.length === 0) {
19918
+ return str;
19919
+ }
19920
+ var string = str;
19921
+ if (typeof str === "symbol") {
19922
+ string = Symbol.prototype.toString.call(str);
19923
+ } else if (typeof str !== "string") {
19924
+ string = String(str);
19925
+ }
19926
+ if (charset === "iso-8859-1") {
19927
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
19928
+ return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
19929
+ });
19930
+ }
19931
+ var out = "";
19932
+ for (var j = 0; j < string.length; j += limit) {
19933
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
19934
+ var arr = [];
19935
+ for (var i = 0; i < segment.length; ++i) {
19936
+ var c = segment.charCodeAt(i);
19937
+ if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats.RFC1738 && (c === 40 || c === 41)) {
19938
+ arr[arr.length] = segment.charAt(i);
19939
+ continue;
19940
+ }
19941
+ if (c < 128) {
19942
+ arr[arr.length] = hexTable[c];
19943
+ continue;
19944
+ }
19945
+ if (c < 2048) {
19946
+ arr[arr.length] = hexTable[192 | c >> 6] + hexTable[128 | c & 63];
19947
+ continue;
19948
+ }
19949
+ if (c < 55296 || c >= 57344) {
19950
+ arr[arr.length] = hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
19951
+ continue;
19952
+ }
19953
+ i += 1;
19954
+ c = 65536 + ((c & 1023) << 10 | segment.charCodeAt(i) & 1023);
19955
+ arr[arr.length] = hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
19956
+ }
19957
+ out += arr.join("");
19958
+ }
19959
+ return out;
19960
+ }, "encode");
19961
+ var compact = /* @__PURE__ */ __name(function compact2(value) {
19962
+ var queue = [
19963
+ {
19964
+ obj: {
19965
+ o: value
19966
+ },
19967
+ prop: "o"
19968
+ }
19969
+ ];
19970
+ var refs = [];
19971
+ for (var i = 0; i < queue.length; ++i) {
19972
+ var item = queue[i];
19973
+ var obj = item.obj[item.prop];
19974
+ var keys = Object.keys(obj);
19975
+ for (var j = 0; j < keys.length; ++j) {
19976
+ var key = keys[j];
19977
+ var val = obj[key];
19978
+ if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
19979
+ queue[queue.length] = {
19980
+ obj,
19981
+ prop: key
19982
+ };
19983
+ refs[refs.length] = val;
19984
+ }
19985
+ }
19986
+ }
19987
+ compactQueue(queue);
19988
+ return value;
19989
+ }, "compact");
19990
+ var isRegExp = /* @__PURE__ */ __name(function isRegExp2(obj) {
19991
+ return Object.prototype.toString.call(obj) === "[object RegExp]";
19992
+ }, "isRegExp");
19993
+ var isBuffer = /* @__PURE__ */ __name(function isBuffer2(obj) {
19994
+ if (!obj || typeof obj !== "object") {
19995
+ return false;
19996
+ }
19997
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
19998
+ }, "isBuffer");
19999
+ var combine = /* @__PURE__ */ __name(function combine2(a, b, arrayLimit, plainObjects) {
20000
+ if (isOverflow(a)) {
20001
+ var newIndex = getMaxIndex(a) + 1;
20002
+ a[newIndex] = b;
20003
+ setMaxIndex(a, newIndex);
20004
+ return a;
20005
+ }
20006
+ var result = [].concat(a, b);
20007
+ if (result.length > arrayLimit) {
20008
+ return markOverflow(arrayToObject(result, {
20009
+ plainObjects
20010
+ }), result.length - 1);
20011
+ }
20012
+ return result;
20013
+ }, "combine");
20014
+ var maybeMap = /* @__PURE__ */ __name(function maybeMap2(val, fn) {
20015
+ if (isArray(val)) {
20016
+ var mapped = [];
20017
+ for (var i = 0; i < val.length; i += 1) {
20018
+ mapped[mapped.length] = fn(val[i]);
20019
+ }
20020
+ return mapped;
20021
+ }
20022
+ return fn(val);
20023
+ }, "maybeMap");
20024
+ module.exports = {
20025
+ arrayToObject,
20026
+ assign,
20027
+ combine,
20028
+ compact,
20029
+ decode,
20030
+ encode,
20031
+ isBuffer,
20032
+ isOverflow,
20033
+ isRegExp,
20034
+ markOverflow,
20035
+ maybeMap,
20036
+ merge
20037
+ };
20038
+ }
20039
+ });
20040
+
20041
+ // ../../../node_modules/express/node_modules/qs/lib/stringify.js
20042
+ var require_stringify2 = __commonJS({
20043
+ "../../../node_modules/express/node_modules/qs/lib/stringify.js"(exports, module) {
20044
+ "use strict";
20045
+ var getSideChannel = require_side_channel();
20046
+ var utils = require_utils2();
20047
+ var formats = require_formats2();
20048
+ var has = Object.prototype.hasOwnProperty;
20049
+ var arrayPrefixGenerators = {
20050
+ brackets: /* @__PURE__ */ __name(function brackets(prefix) {
20051
+ return prefix + "[]";
20052
+ }, "brackets"),
20053
+ comma: "comma",
20054
+ indices: /* @__PURE__ */ __name(function indices(prefix, key) {
20055
+ return prefix + "[" + key + "]";
20056
+ }, "indices"),
20057
+ repeat: /* @__PURE__ */ __name(function repeat(prefix) {
20058
+ return prefix;
20059
+ }, "repeat")
20060
+ };
20061
+ var isArray = Array.isArray;
20062
+ var push = Array.prototype.push;
20063
+ var pushToArray = /* @__PURE__ */ __name(function(arr, valueOrArray) {
20064
+ push.apply(arr, isArray(valueOrArray) ? valueOrArray : [
20065
+ valueOrArray
20066
+ ]);
20067
+ }, "pushToArray");
20068
+ var toISO = Date.prototype.toISOString;
20069
+ var defaultFormat = formats["default"];
20070
+ var defaults = {
20071
+ addQueryPrefix: false,
20072
+ allowDots: false,
20073
+ allowEmptyArrays: false,
20074
+ arrayFormat: "indices",
20075
+ charset: "utf-8",
20076
+ charsetSentinel: false,
20077
+ commaRoundTrip: false,
20078
+ delimiter: "&",
20079
+ encode: true,
20080
+ encodeDotInKeys: false,
20081
+ encoder: utils.encode,
20082
+ encodeValuesOnly: false,
20083
+ filter: void 0,
20084
+ format: defaultFormat,
20085
+ formatter: formats.formatters[defaultFormat],
20086
+ // deprecated
20087
+ indices: false,
20088
+ serializeDate: /* @__PURE__ */ __name(function serializeDate(date) {
20089
+ return toISO.call(date);
20090
+ }, "serializeDate"),
20091
+ skipNulls: false,
20092
+ strictNullHandling: false
20093
+ };
20094
+ var isNonNullishPrimitive = /* @__PURE__ */ __name(function isNonNullishPrimitive2(v) {
20095
+ return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
20096
+ }, "isNonNullishPrimitive");
20097
+ var sentinel = {};
20098
+ var stringify = /* @__PURE__ */ __name(function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) {
20099
+ var obj = object;
20100
+ var tmpSc = sideChannel;
20101
+ var step = 0;
20102
+ var findFlag = false;
20103
+ while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
20104
+ var pos = tmpSc.get(object);
20105
+ step += 1;
20106
+ if (typeof pos !== "undefined") {
20107
+ if (pos === step) {
20108
+ throw new RangeError("Cyclic object value");
20109
+ } else {
20110
+ findFlag = true;
20111
+ }
20112
+ }
20113
+ if (typeof tmpSc.get(sentinel) === "undefined") {
20114
+ step = 0;
20115
+ }
20116
+ }
20117
+ if (typeof filter === "function") {
20118
+ obj = filter(prefix, obj);
20119
+ } else if (obj instanceof Date) {
20120
+ obj = serializeDate(obj);
20121
+ } else if (generateArrayPrefix === "comma" && isArray(obj)) {
20122
+ obj = utils.maybeMap(obj, function(value2) {
20123
+ if (value2 instanceof Date) {
20124
+ return serializeDate(value2);
20125
+ }
20126
+ return value2;
20127
+ });
20128
+ }
20129
+ if (obj === null) {
20130
+ if (strictNullHandling) {
20131
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
20132
+ }
20133
+ obj = "";
20134
+ }
20135
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
20136
+ if (encoder) {
20137
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format);
20138
+ return [
20139
+ formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))
20140
+ ];
20141
+ }
20142
+ return [
20143
+ formatter(prefix) + "=" + formatter(String(obj))
20144
+ ];
20145
+ }
20146
+ var values = [];
20147
+ if (typeof obj === "undefined") {
20148
+ return values;
20149
+ }
20150
+ var objKeys;
20151
+ if (generateArrayPrefix === "comma" && isArray(obj)) {
20152
+ if (encodeValuesOnly && encoder) {
20153
+ obj = utils.maybeMap(obj, encoder);
20154
+ }
20155
+ objKeys = [
20156
+ {
20157
+ value: obj.length > 0 ? obj.join(",") || null : void 0
20158
+ }
20159
+ ];
20160
+ } else if (isArray(filter)) {
20161
+ objKeys = filter;
20162
+ } else {
20163
+ var keys = Object.keys(obj);
20164
+ objKeys = sort ? keys.sort(sort) : keys;
20165
+ }
20166
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, "%2E") : String(prefix);
20167
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix;
20168
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
20169
+ return adjustedPrefix + "[]";
20170
+ }
20171
+ for (var j = 0; j < objKeys.length; ++j) {
20172
+ var key = objKeys[j];
20173
+ var value = typeof key === "object" && key && typeof key.value !== "undefined" ? key.value : obj[key];
20174
+ if (skipNulls && value === null) {
20175
+ continue;
20176
+ }
20177
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, "%2E") : String(key);
20178
+ var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]");
20179
+ sideChannel.set(object, step);
20180
+ var valueSideChannel = getSideChannel();
20181
+ valueSideChannel.set(sentinel, sideChannel);
20182
+ pushToArray(values, stringify2(value, keyPrefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder, filter, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, valueSideChannel));
20183
+ }
20184
+ return values;
20185
+ }, "stringify");
20186
+ var normalizeStringifyOptions = /* @__PURE__ */ __name(function normalizeStringifyOptions2(opts) {
20187
+ if (!opts) {
20188
+ return defaults;
20189
+ }
20190
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
20191
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
20192
+ }
20193
+ if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") {
20194
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
20195
+ }
20196
+ if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
20197
+ throw new TypeError("Encoder has to be a function.");
20198
+ }
20199
+ var charset = opts.charset || defaults.charset;
20200
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
20201
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
20202
+ }
20203
+ var format = formats["default"];
20204
+ if (typeof opts.format !== "undefined") {
20205
+ if (!has.call(formats.formatters, opts.format)) {
20206
+ throw new TypeError("Unknown format option provided.");
20207
+ }
20208
+ format = opts.format;
20209
+ }
20210
+ var formatter = formats.formatters[format];
20211
+ var filter = defaults.filter;
20212
+ if (typeof opts.filter === "function" || isArray(opts.filter)) {
20213
+ filter = opts.filter;
20214
+ }
20215
+ var arrayFormat;
20216
+ if (opts.arrayFormat in arrayPrefixGenerators) {
20217
+ arrayFormat = opts.arrayFormat;
20218
+ } else if ("indices" in opts) {
20219
+ arrayFormat = opts.indices ? "indices" : "repeat";
20220
+ } else {
20221
+ arrayFormat = defaults.arrayFormat;
20222
+ }
20223
+ if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
20224
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
20225
+ }
20226
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
20227
+ return {
20228
+ addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
20229
+ allowDots,
20230
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
20231
+ arrayFormat,
20232
+ charset,
20233
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
20234
+ commaRoundTrip: !!opts.commaRoundTrip,
20235
+ delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
20236
+ encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
20237
+ encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
20238
+ encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
20239
+ encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
20240
+ filter,
20241
+ format,
20242
+ formatter,
20243
+ serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
20244
+ skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
20245
+ sort: typeof opts.sort === "function" ? opts.sort : null,
20246
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
20247
+ };
20248
+ }, "normalizeStringifyOptions");
20249
+ module.exports = function(object, opts) {
20250
+ var obj = object;
20251
+ var options = normalizeStringifyOptions(opts);
20252
+ var objKeys;
20253
+ var filter;
20254
+ if (typeof options.filter === "function") {
20255
+ filter = options.filter;
20256
+ obj = filter("", obj);
20257
+ } else if (isArray(options.filter)) {
20258
+ filter = options.filter;
20259
+ objKeys = filter;
20260
+ }
20261
+ var keys = [];
20262
+ if (typeof obj !== "object" || obj === null) {
20263
+ return "";
20264
+ }
20265
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
20266
+ var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip;
20267
+ if (!objKeys) {
20268
+ objKeys = Object.keys(obj);
20269
+ }
20270
+ if (options.sort) {
20271
+ objKeys.sort(options.sort);
20272
+ }
20273
+ var sideChannel = getSideChannel();
20274
+ for (var i = 0; i < objKeys.length; ++i) {
20275
+ var key = objKeys[i];
20276
+ var value = obj[key];
20277
+ if (options.skipNulls && value === null) {
20278
+ continue;
20279
+ }
20280
+ pushToArray(keys, stringify(value, key, generateArrayPrefix, commaRoundTrip, options.allowEmptyArrays, options.strictNullHandling, options.skipNulls, options.encodeDotInKeys, options.encode ? options.encoder : null, options.filter, options.sort, options.allowDots, options.serializeDate, options.format, options.formatter, options.encodeValuesOnly, options.charset, sideChannel));
20281
+ }
20282
+ var joined = keys.join(options.delimiter);
20283
+ var prefix = options.addQueryPrefix === true ? "?" : "";
20284
+ if (options.charsetSentinel) {
20285
+ if (options.charset === "iso-8859-1") {
20286
+ prefix += "utf8=%26%2310003%3B&";
20287
+ } else {
20288
+ prefix += "utf8=%E2%9C%93&";
20289
+ }
20290
+ }
20291
+ return joined.length > 0 ? prefix + joined : "";
20292
+ };
20293
+ }
20294
+ });
20295
+
20296
+ // ../../../node_modules/express/node_modules/qs/lib/parse.js
20297
+ var require_parse2 = __commonJS({
20298
+ "../../../node_modules/express/node_modules/qs/lib/parse.js"(exports, module) {
20299
+ "use strict";
20300
+ var utils = require_utils2();
20301
+ var has = Object.prototype.hasOwnProperty;
20302
+ var isArray = Array.isArray;
20303
+ var defaults = {
20304
+ allowDots: false,
20305
+ allowEmptyArrays: false,
20306
+ allowPrototypes: false,
20307
+ allowSparse: false,
20308
+ arrayLimit: 20,
20309
+ charset: "utf-8",
20310
+ charsetSentinel: false,
20311
+ comma: false,
20312
+ decodeDotInKeys: false,
20313
+ decoder: utils.decode,
20314
+ delimiter: "&",
20315
+ depth: 5,
20316
+ duplicates: "combine",
20317
+ ignoreQueryPrefix: false,
20318
+ interpretNumericEntities: false,
20319
+ parameterLimit: 1e3,
20320
+ parseArrays: true,
20321
+ plainObjects: false,
20322
+ strictDepth: false,
20323
+ strictNullHandling: false,
20324
+ throwOnLimitExceeded: false
20325
+ };
20326
+ var interpretNumericEntities = /* @__PURE__ */ __name(function(str) {
20327
+ return str.replace(/&#(\d+);/g, function($0, numberStr) {
20328
+ return String.fromCharCode(parseInt(numberStr, 10));
20329
+ });
20330
+ }, "interpretNumericEntities");
20331
+ var parseArrayValue = /* @__PURE__ */ __name(function(val, options, currentArrayLength) {
20332
+ if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) {
20333
+ return val.split(",");
20334
+ }
20335
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
20336
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
20337
+ }
20338
+ return val;
20339
+ }, "parseArrayValue");
20340
+ var isoSentinel = "utf8=%26%2310003%3B";
20341
+ var charsetSentinel = "utf8=%E2%9C%93";
20342
+ var parseValues = /* @__PURE__ */ __name(function parseQueryStringValues(str, options) {
20343
+ var obj = {
20344
+ __proto__: null
20345
+ };
20346
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
20347
+ cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
20348
+ var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
20349
+ var parts = cleanStr.split(options.delimiter, options.throwOnLimitExceeded ? limit + 1 : limit);
20350
+ if (options.throwOnLimitExceeded && parts.length > limit) {
20351
+ throw new RangeError("Parameter limit exceeded. Only " + limit + " parameter" + (limit === 1 ? "" : "s") + " allowed.");
20352
+ }
20353
+ var skipIndex = -1;
20354
+ var i;
20355
+ var charset = options.charset;
20356
+ if (options.charsetSentinel) {
20357
+ for (i = 0; i < parts.length; ++i) {
20358
+ if (parts[i].indexOf("utf8=") === 0) {
20359
+ if (parts[i] === charsetSentinel) {
20360
+ charset = "utf-8";
20361
+ } else if (parts[i] === isoSentinel) {
20362
+ charset = "iso-8859-1";
20363
+ }
20364
+ skipIndex = i;
20365
+ i = parts.length;
20366
+ }
20367
+ }
20368
+ }
20369
+ for (i = 0; i < parts.length; ++i) {
20370
+ if (i === skipIndex) {
20371
+ continue;
20372
+ }
20373
+ var part = parts[i];
20374
+ var bracketEqualsPos = part.indexOf("]=");
20375
+ var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1;
20376
+ var key;
20377
+ var val;
20378
+ if (pos === -1) {
20379
+ key = options.decoder(part, defaults.decoder, charset, "key");
20380
+ val = options.strictNullHandling ? null : "";
20381
+ } else {
20382
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
20383
+ if (key !== null) {
20384
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
20385
+ return options.decoder(encodedVal, defaults.decoder, charset, "value");
20386
+ });
20387
+ }
20388
+ }
20389
+ if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
20390
+ val = interpretNumericEntities(String(val));
20391
+ }
20392
+ if (part.indexOf("[]=") > -1) {
20393
+ val = isArray(val) ? [
20394
+ val
20395
+ ] : val;
20396
+ }
20397
+ if (options.comma && isArray(val) && val.length > options.arrayLimit) {
20398
+ if (options.throwOnLimitExceeded) {
20399
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
20400
+ }
20401
+ val = utils.combine([], val, options.arrayLimit, options.plainObjects);
20402
+ }
20403
+ if (key !== null) {
20404
+ var existing = has.call(obj, key);
20405
+ if (existing && options.duplicates === "combine") {
20406
+ obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
20407
+ } else if (!existing || options.duplicates === "last") {
20408
+ obj[key] = val;
20409
+ }
20410
+ }
20411
+ }
20412
+ return obj;
20413
+ }, "parseQueryStringValues");
20414
+ var parseObject = /* @__PURE__ */ __name(function(chain, val, options, valuesParsed) {
20415
+ var currentArrayLength = 0;
20416
+ if (chain.length > 0 && chain[chain.length - 1] === "[]") {
20417
+ var parentKey = chain.slice(0, -1).join("");
20418
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
20419
+ }
20420
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
20421
+ for (var i = chain.length - 1; i >= 0; --i) {
20422
+ var obj;
20423
+ var root = chain[i];
20424
+ if (root === "[]" && options.parseArrays) {
20425
+ if (utils.isOverflow(leaf)) {
20426
+ obj = leaf;
20427
+ } else {
20428
+ obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
20429
+ }
20430
+ } else {
20431
+ obj = options.plainObjects ? {
20432
+ __proto__: null
20433
+ } : {};
20434
+ var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
20435
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot;
20436
+ var index = parseInt(decodedRoot, 10);
20437
+ var isValidArrayIndex = !isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && options.parseArrays;
20438
+ if (!options.parseArrays && decodedRoot === "") {
20439
+ obj = {
20440
+ 0: leaf
20441
+ };
20442
+ } else if (isValidArrayIndex && index < options.arrayLimit) {
20443
+ obj = [];
20444
+ obj[index] = leaf;
20445
+ } else if (isValidArrayIndex && options.throwOnLimitExceeded) {
20446
+ throw new RangeError("Array limit exceeded. Only " + options.arrayLimit + " element" + (options.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
20447
+ } else if (isValidArrayIndex) {
20448
+ obj[index] = leaf;
20449
+ utils.markOverflow(obj, index);
20450
+ } else if (decodedRoot !== "__proto__") {
20451
+ obj[decodedRoot] = leaf;
20452
+ }
20453
+ }
20454
+ leaf = obj;
20455
+ }
20456
+ return leaf;
20457
+ }, "parseObject");
20458
+ var splitKeyIntoSegments = /* @__PURE__ */ __name(function splitKeyIntoSegments2(givenKey, options) {
20459
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
20460
+ if (options.depth <= 0) {
20461
+ if (!options.plainObjects && has.call(Object.prototype, key)) {
20462
+ if (!options.allowPrototypes) {
20463
+ return;
20464
+ }
20465
+ }
20466
+ return [
20467
+ key
20468
+ ];
20469
+ }
20470
+ var brackets = /(\[[^[\]]*])/;
20471
+ var child = /(\[[^[\]]*])/g;
20472
+ var segment = brackets.exec(key);
20473
+ var parent = segment ? key.slice(0, segment.index) : key;
20474
+ var keys = [];
20475
+ if (parent) {
20476
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
20477
+ if (!options.allowPrototypes) {
20478
+ return;
20479
+ }
20480
+ }
20481
+ keys[keys.length] = parent;
20482
+ }
20483
+ var i = 0;
20484
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
20485
+ i += 1;
20486
+ var segmentContent = segment[1].slice(1, -1);
20487
+ if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
20488
+ if (!options.allowPrototypes) {
20489
+ return;
20490
+ }
20491
+ }
20492
+ keys[keys.length] = segment[1];
20493
+ }
20494
+ if (segment) {
20495
+ if (options.strictDepth === true) {
20496
+ throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
20497
+ }
20498
+ keys[keys.length] = "[" + key.slice(segment.index) + "]";
20499
+ }
20500
+ return keys;
20501
+ }, "splitKeyIntoSegments");
20502
+ var parseKeys = /* @__PURE__ */ __name(function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
20503
+ if (!givenKey) {
20504
+ return;
20505
+ }
20506
+ var keys = splitKeyIntoSegments(givenKey, options);
20507
+ if (!keys) {
20508
+ return;
20509
+ }
20510
+ return parseObject(keys, val, options, valuesParsed);
20511
+ }, "parseQueryStringKeys");
20512
+ var normalizeParseOptions = /* @__PURE__ */ __name(function normalizeParseOptions2(opts) {
20513
+ if (!opts) {
20514
+ return defaults;
20515
+ }
20516
+ if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") {
20517
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
20518
+ }
20519
+ if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") {
20520
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
20521
+ }
20522
+ if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") {
20523
+ throw new TypeError("Decoder has to be a function.");
20524
+ }
20525
+ if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
20526
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
20527
+ }
20528
+ if (typeof opts.throwOnLimitExceeded !== "undefined" && typeof opts.throwOnLimitExceeded !== "boolean") {
20529
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
20530
+ }
20531
+ var charset = typeof opts.charset === "undefined" ? defaults.charset : opts.charset;
20532
+ var duplicates = typeof opts.duplicates === "undefined" ? defaults.duplicates : opts.duplicates;
20533
+ if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") {
20534
+ throw new TypeError("The duplicates option must be either combine, first, or last");
20535
+ }
20536
+ var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
20537
+ return {
20538
+ allowDots,
20539
+ allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
20540
+ allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults.allowPrototypes,
20541
+ allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults.allowSparse,
20542
+ arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults.arrayLimit,
20543
+ charset,
20544
+ charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
20545
+ comma: typeof opts.comma === "boolean" ? opts.comma : defaults.comma,
20546
+ decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
20547
+ decoder: typeof opts.decoder === "function" ? opts.decoder : defaults.decoder,
20548
+ delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
20549
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
20550
+ depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults.depth,
20551
+ duplicates,
20552
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
20553
+ interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
20554
+ parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
20555
+ parseArrays: opts.parseArrays !== false,
20556
+ plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
20557
+ strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
20558
+ strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling,
20559
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === "boolean" ? opts.throwOnLimitExceeded : false
20560
+ };
20561
+ }, "normalizeParseOptions");
20562
+ module.exports = function(str, opts) {
20563
+ var options = normalizeParseOptions(opts);
20564
+ if (str === "" || str === null || typeof str === "undefined") {
20565
+ return options.plainObjects ? {
20566
+ __proto__: null
20567
+ } : {};
20568
+ }
20569
+ var tempObj = typeof str === "string" ? parseValues(str, options) : str;
20570
+ var obj = options.plainObjects ? {
20571
+ __proto__: null
20572
+ } : {};
20573
+ var keys = Object.keys(tempObj);
20574
+ for (var i = 0; i < keys.length; ++i) {
20575
+ var key = keys[i];
20576
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === "string");
20577
+ obj = utils.merge(obj, newObj, options);
20578
+ }
20579
+ if (options.allowSparse === true) {
20580
+ return obj;
20581
+ }
20582
+ return utils.compact(obj);
20583
+ };
20584
+ }
20585
+ });
20586
+
20587
+ // ../../../node_modules/express/node_modules/qs/lib/index.js
20588
+ var require_lib3 = __commonJS({
20589
+ "../../../node_modules/express/node_modules/qs/lib/index.js"(exports, module) {
20590
+ "use strict";
20591
+ var stringify = require_stringify2();
20592
+ var parse = require_parse2();
20593
+ var formats = require_formats2();
20594
+ module.exports = {
20595
+ formats,
20596
+ parse,
20597
+ stringify
20598
+ };
20599
+ }
20600
+ });
20601
+
19699
20602
  // ../../../node_modules/express/lib/middleware/query.js
19700
20603
  var require_query = __commonJS({
19701
20604
  "../../../node_modules/express/lib/middleware/query.js"(exports, module) {
19702
20605
  "use strict";
19703
20606
  var merge = require_utils_merge();
19704
20607
  var parseUrl = require_parseurl();
19705
- var qs = require_lib2();
20608
+ var qs = require_lib3();
19706
20609
  module.exports = /* @__PURE__ */ __name(function query(options) {
19707
20610
  var opts = merge({}, options);
19708
20611
  var queryparse = qs.parse;
@@ -19730,11 +20633,11 @@ var require_view = __commonJS({
19730
20633
  "use strict";
19731
20634
  var debug = require_src3()("express:view");
19732
20635
  var path2 = __require("path");
19733
- var fs2 = __require("fs");
19734
- var dirname = path2.dirname;
20636
+ var fs3 = __require("fs");
20637
+ var dirname2 = path2.dirname;
19735
20638
  var basename = path2.basename;
19736
20639
  var extname2 = path2.extname;
19737
- var join2 = path2.join;
20640
+ var join5 = path2.join;
19738
20641
  var resolve2 = path2.resolve;
19739
20642
  module.exports = View;
19740
20643
  function View(name, options) {
@@ -19771,7 +20674,7 @@ var require_view = __commonJS({
19771
20674
  for (var i = 0; i < roots.length && !path3; i++) {
19772
20675
  var root = roots[i];
19773
20676
  var loc = resolve2(root, name);
19774
- var dir = dirname(loc);
20677
+ var dir = dirname2(loc);
19775
20678
  var file = basename(loc);
19776
20679
  path3 = this.resolve(dir, file);
19777
20680
  }
@@ -19783,12 +20686,12 @@ var require_view = __commonJS({
19783
20686
  }, "render");
19784
20687
  View.prototype.resolve = /* @__PURE__ */ __name(function resolve3(dir, file) {
19785
20688
  var ext = this.ext;
19786
- var path3 = join2(dir, file);
20689
+ var path3 = join5(dir, file);
19787
20690
  var stat = tryStat(path3);
19788
20691
  if (stat && stat.isFile()) {
19789
20692
  return path3;
19790
20693
  }
19791
- path3 = join2(dir, basename(file, ext), "index" + ext);
20694
+ path3 = join5(dir, basename(file, ext), "index" + ext);
19792
20695
  stat = tryStat(path3);
19793
20696
  if (stat && stat.isFile()) {
19794
20697
  return path3;
@@ -19797,7 +20700,7 @@ var require_view = __commonJS({
19797
20700
  function tryStat(path3) {
19798
20701
  debug('stat "%s"', path3);
19799
20702
  try {
19800
- return fs2.statSync(path3);
20703
+ return fs3.statSync(path3);
19801
20704
  } catch (e) {
19802
20705
  return void 0;
19803
20706
  }
@@ -20446,8 +21349,8 @@ var require_node4 = __commonJS({
20446
21349
  }
20447
21350
  break;
20448
21351
  case "FILE":
20449
- var fs2 = __require("fs");
20450
- stream2 = new fs2.SyncWriteStream(fd2, {
21352
+ var fs3 = __require("fs");
21353
+ stream2 = new fs3.SyncWriteStream(fd2, {
20451
21354
  autoClose: false
20452
21355
  });
20453
21356
  stream2._type = "fs";
@@ -20633,7 +21536,7 @@ var require_mime = __commonJS({
20633
21536
  "../../../node_modules/mime/mime.js"(exports, module) {
20634
21537
  "use strict";
20635
21538
  var path2 = __require("path");
20636
- var fs2 = __require("fs");
21539
+ var fs3 = __require("fs");
20637
21540
  function Mime() {
20638
21541
  this.types = /* @__PURE__ */ Object.create(null);
20639
21542
  this.extensions = /* @__PURE__ */ Object.create(null);
@@ -20655,7 +21558,7 @@ var require_mime = __commonJS({
20655
21558
  };
20656
21559
  Mime.prototype.load = function(file) {
20657
21560
  this._loading = file;
20658
- var map = {}, content = fs2.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
21561
+ var map = {}, content = fs3.readFileSync(file, "ascii"), lines = content.split(/[\r\n]+/);
20659
21562
  lines.forEach(function(line) {
20660
21563
  var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/);
20661
21564
  map[fields.shift()] = fields;
@@ -20900,7 +21803,7 @@ var require_send = __commonJS({
20900
21803
  var escapeHtml = require_escape_html();
20901
21804
  var etag = require_etag();
20902
21805
  var fresh = require_fresh();
20903
- var fs2 = __require("fs");
21806
+ var fs3 = __require("fs");
20904
21807
  var mime = require_mime();
20905
21808
  var ms = require_ms5();
20906
21809
  var onFinished = require_on_finished();
@@ -20910,7 +21813,7 @@ var require_send = __commonJS({
20910
21813
  var Stream = __require("stream");
20911
21814
  var util = __require("util");
20912
21815
  var extname2 = path2.extname;
20913
- var join2 = path2.join;
21816
+ var join5 = path2.join;
20914
21817
  var normalize2 = path2.normalize;
20915
21818
  var resolve2 = path2.resolve;
20916
21819
  var sep = path2.sep;
@@ -21127,7 +22030,7 @@ var require_send = __commonJS({
21127
22030
  return res;
21128
22031
  }
21129
22032
  parts = path3.split(sep);
21130
- path3 = normalize2(join2(root, path3));
22033
+ path3 = normalize2(join5(root, path3));
21131
22034
  } else {
21132
22035
  if (UP_PATH_REGEXP.test(path3)) {
21133
22036
  debug('malicious path "%s"', path3);
@@ -21233,7 +22136,7 @@ var require_send = __commonJS({
21233
22136
  var i = 0;
21234
22137
  var self = this;
21235
22138
  debug('stat "%s"', path3);
21236
- fs2.stat(path3, /* @__PURE__ */ __name(function onstat(err, stat) {
22139
+ fs3.stat(path3, /* @__PURE__ */ __name(function onstat(err, stat) {
21237
22140
  if (err && err.code === "ENOENT" && !extname2(path3) && path3[path3.length - 1] !== sep) {
21238
22141
  return next(err);
21239
22142
  }
@@ -21248,7 +22151,7 @@ var require_send = __commonJS({
21248
22151
  }
21249
22152
  var p = path3 + "." + self._extensions[i++];
21250
22153
  debug('stat "%s"', p);
21251
- fs2.stat(p, function(err2, stat) {
22154
+ fs3.stat(p, function(err2, stat) {
21252
22155
  if (err2) return next(err2);
21253
22156
  if (stat.isDirectory()) return next();
21254
22157
  self.emit("file", p, stat);
@@ -21265,9 +22168,9 @@ var require_send = __commonJS({
21265
22168
  if (err) return self.onStatError(err);
21266
22169
  return self.error(404);
21267
22170
  }
21268
- var p = join2(path3, self._index[i]);
22171
+ var p = join5(path3, self._index[i]);
21269
22172
  debug('stat "%s"', p);
21270
- fs2.stat(p, function(err2, stat) {
22173
+ fs3.stat(p, function(err2, stat) {
21271
22174
  if (err2) return next(err2);
21272
22175
  if (stat.isDirectory()) return next();
21273
22176
  self.emit("file", p, stat);
@@ -21280,7 +22183,7 @@ var require_send = __commonJS({
21280
22183
  SendStream.prototype.stream = /* @__PURE__ */ __name(function stream(path3, options) {
21281
22184
  var self = this;
21282
22185
  var res = this.res;
21283
- var stream2 = fs2.createReadStream(path3, options);
22186
+ var stream2 = fs3.createReadStream(path3, options);
21284
22187
  this.emit("stream", stream2);
21285
22188
  stream2.pipe(res);
21286
22189
  function cleanup() {
@@ -21504,9 +22407,9 @@ var require_forwarded = __commonJS({
21504
22407
  }
21505
22408
  });
21506
22409
 
21507
- // ../../../node_modules/ipaddr.js/lib/ipaddr.js
22410
+ // ../../../node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js
21508
22411
  var require_ipaddr = __commonJS({
21509
- "../../../node_modules/ipaddr.js/lib/ipaddr.js"(exports, module) {
22412
+ "../../../node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js"(exports, module) {
21510
22413
  "use strict";
21511
22414
  (function() {
21512
22415
  var expandIPv6, ipaddr, ipv4Part, ipv4Regexes, ipv6Part, ipv6Regexes, matchCIDR, root, zoneIndex;
@@ -22618,7 +23521,7 @@ var require_proxy_addr = __commonJS({
22618
23521
  });
22619
23522
 
22620
23523
  // ../../../node_modules/express/lib/utils.js
22621
- var require_utils2 = __commonJS({
23524
+ var require_utils3 = __commonJS({
22622
23525
  "../../../node_modules/express/lib/utils.js"(exports) {
22623
23526
  "use strict";
22624
23527
  var Buffer2 = require_safe_buffer().Buffer;
@@ -22629,7 +23532,7 @@ var require_utils2 = __commonJS({
22629
23532
  var mime = require_send().mime;
22630
23533
  var etag = require_etag();
22631
23534
  var proxyaddr = require_proxy_addr();
22632
- var qs = require_lib2();
23535
+ var qs = require_lib3();
22633
23536
  var querystring = __require("querystring");
22634
23537
  exports.etag = createETagGenerator({
22635
23538
  weak: false
@@ -22775,9 +23678,9 @@ var require_application = __commonJS({
22775
23678
  var debug = require_src3()("express:application");
22776
23679
  var View = require_view();
22777
23680
  var http = __require("http");
22778
- var compileETag = require_utils2().compileETag;
22779
- var compileQueryParser = require_utils2().compileQueryParser;
22780
- var compileTrust = require_utils2().compileTrust;
23681
+ var compileETag = require_utils3().compileETag;
23682
+ var compileQueryParser = require_utils3().compileQueryParser;
23683
+ var compileTrust = require_utils3().compileTrust;
22781
23684
  var deprecate = require_depd()("express");
22782
23685
  var flatten = require_array_flatten();
22783
23686
  var merge = require_utils_merge();
@@ -32754,15 +33657,15 @@ var require_response = __commonJS({
32754
33657
  var encodeUrl = require_encodeurl();
32755
33658
  var escapeHtml = require_escape_html();
32756
33659
  var http = __require("http");
32757
- var isAbsolute = require_utils2().isAbsolute;
33660
+ var isAbsolute = require_utils3().isAbsolute;
32758
33661
  var onFinished = require_on_finished();
32759
33662
  var path2 = __require("path");
32760
33663
  var statuses = require_statuses();
32761
33664
  var merge = require_utils_merge();
32762
33665
  var sign = require_cookie_signature().sign;
32763
- var normalizeType = require_utils2().normalizeType;
32764
- var normalizeTypes = require_utils2().normalizeTypes;
32765
- var setCharset = require_utils2().setCharset;
33666
+ var normalizeType = require_utils3().normalizeType;
33667
+ var normalizeTypes = require_utils3().normalizeTypes;
33668
+ var setCharset = require_utils3().setCharset;
32766
33669
  var cookie = require_cookie();
32767
33670
  var send = require_send();
32768
33671
  var extname2 = path2.extname;
@@ -33498,7 +34401,7 @@ var require_express2 = __commonJS({
33498
34401
  });
33499
34402
 
33500
34403
  // src/modules/platform/module.ts
33501
- import { Global, Module as Module2, ValidationPipe } from "@nestjs/common";
34404
+ import { Global, Module as Module3, ValidationPipe } from "@nestjs/common";
33502
34405
  import { APP_INTERCEPTOR, APP_PIPE } from "@nestjs/core";
33503
34406
  import { CommonModule, OBSERVABLE_SERVICE as OBSERVABLE_SERVICE2, HTTP_CLIENT_FACTORY } from "@lark-apaas/nestjs-common";
33504
34407
  import { ConfigModule, ConfigService } from "@nestjs/config";
@@ -33508,7 +34411,7 @@ import { LoggerModule, AppLogger as AppLogger2, LoggerContextMiddleware } from "
33508
34411
  import { DataPaasModule, SqlExecutionContextMiddleware } from "@lark-apaas/nestjs-datapaas";
33509
34412
  import { AuthNPaasModule } from "@lark-apaas/nestjs-authnpaas";
33510
34413
  import { AutomationModule } from "@lark-apaas/nestjs-trigger";
33511
- import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT3 } from "@lark-apaas/nestjs-common";
34414
+ import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT4 } from "@lark-apaas/nestjs-common";
33512
34415
  import { CapabilityModule } from "@lark-apaas/nestjs-capability";
33513
34416
 
33514
34417
  // src/middlewares/user-context/index.ts
@@ -33866,7 +34769,7 @@ __name(apiResponseInterceptor, "apiResponseInterceptor");
33866
34769
 
33867
34770
  // src/middlewares/request-context/index.ts
33868
34771
  import { Injectable as Injectable5 } from "@nestjs/common";
33869
- import { RequestContextService } from "@lark-apaas/nestjs-common";
34772
+ import { RequestContextService, stripBasePath } from "@lark-apaas/nestjs-common";
33870
34773
  function _ts_decorate5(decorators, target, key, desc) {
33871
34774
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33872
34775
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -33890,6 +34793,8 @@ var RequestContextMiddleware = class {
33890
34793
  const path2 = req.originalUrl ?? req.url;
33891
34794
  const userContext = req.userContext ?? {};
33892
34795
  const ttEnv = req.headers["x-tt-env"];
34796
+ const rawPageRoute = req.get("X-Page-Route");
34797
+ const pageRoute = stripBasePath(rawPageRoute, process.env.CLIENT_BASE_PATH) ?? void 0;
33893
34798
  const refererPath = req.headers["rpc-persist-apaas-observability-referer-path"];
33894
34799
  const observabilityApi = req.headers["rpc-persist-apaas-observability-api"];
33895
34800
  this.requestContext.run({
@@ -33900,6 +34805,7 @@ var RequestContextMiddleware = class {
33900
34805
  appId: userContext.appId,
33901
34806
  isSystemAccount: userContext.isSystemAccount,
33902
34807
  ttEnv,
34808
+ pageRoute,
33903
34809
  refererPath,
33904
34810
  observabilityApi
33905
34811
  }, () => next());
@@ -34896,7 +35802,47 @@ StaticModule = _ts_decorate11([
34896
35802
  })
34897
35803
  ], StaticModule);
34898
35804
 
34899
- // src/modules/platform/module.ts
35805
+ // src/modules/html-hot-update/html-hot-update.module.ts
35806
+ import { Module as Module2 } from "@nestjs/common";
35807
+
35808
+ // src/modules/html-hot-update/html-hot-update.controller.ts
35809
+ import { Controller as Controller2, Post, Body, HttpCode, HttpStatus as HttpStatus2, Logger as Logger6 } from "@nestjs/common";
35810
+ import { ApiExcludeController as ApiExcludeController2 } from "@nestjs/swagger";
35811
+
35812
+ // src/modules/html-hot-update/html-hot-update.service.ts
35813
+ import { Injectable as Injectable10, Logger as Logger5, Inject as Inject3 } from "@nestjs/common";
35814
+ import { promises as fs2 } from "fs";
35815
+ import { existsSync as existsSync2 } from "fs";
35816
+ import { createHash as createHash2 } from "crypto";
35817
+ import { dirname, join as join3 } from "path";
35818
+ import { PLATFORM_HTTP_CLIENT as PLATFORM_HTTP_CLIENT3 } from "@lark-apaas/nestjs-common";
35819
+
35820
+ // src/modules/html-hot-update/html-hot-update.state.ts
35821
+ import { join as join2 } from "path";
35822
+ var hotUpdateHtmlDir = "/tmp/html-hot-update";
35823
+ var activeHtmlVersion = "";
35824
+ function getHotUpdateHtmlDir() {
35825
+ return hotUpdateHtmlDir;
35826
+ }
35827
+ __name(getHotUpdateHtmlDir, "getHotUpdateHtmlDir");
35828
+ function getHotUpdateVersionsDir() {
35829
+ return join2(hotUpdateHtmlDir, "versions");
35830
+ }
35831
+ __name(getHotUpdateVersionsDir, "getHotUpdateVersionsDir");
35832
+ function getHotUpdateVersionDir(version) {
35833
+ return join2(getHotUpdateVersionsDir(), version);
35834
+ }
35835
+ __name(getHotUpdateVersionDir, "getHotUpdateVersionDir");
35836
+ function getActiveHtmlVersion() {
35837
+ return activeHtmlVersion;
35838
+ }
35839
+ __name(getActiveHtmlVersion, "getActiveHtmlVersion");
35840
+ function setActiveHtmlVersion(version) {
35841
+ activeHtmlVersion = version;
35842
+ }
35843
+ __name(setActiveHtmlVersion, "setActiveHtmlVersion");
35844
+
35845
+ // src/modules/html-hot-update/html-hot-update.service.ts
34900
35846
  function _ts_decorate12(decorators, target, key, desc) {
34901
35847
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34902
35848
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -34904,6 +35850,426 @@ function _ts_decorate12(decorators, target, key, desc) {
34904
35850
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34905
35851
  }
34906
35852
  __name(_ts_decorate12, "_ts_decorate");
35853
+ function _ts_metadata8(k, v) {
35854
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
35855
+ }
35856
+ __name(_ts_metadata8, "_ts_metadata");
35857
+ function _ts_param4(paramIndex, decorator) {
35858
+ return function(target, key) {
35859
+ decorator(target, key, paramIndex);
35860
+ };
35861
+ }
35862
+ __name(_ts_param4, "_ts_param");
35863
+ var Mutex = class Mutex2 {
35864
+ static {
35865
+ __name(this, "Mutex");
35866
+ }
35867
+ locked = false;
35868
+ waiting = [];
35869
+ async acquire() {
35870
+ if (!this.locked) {
35871
+ this.locked = true;
35872
+ return;
35873
+ }
35874
+ return new Promise((resolve2) => {
35875
+ this.waiting.push(() => {
35876
+ this.locked = true;
35877
+ resolve2();
35878
+ });
35879
+ });
35880
+ }
35881
+ release() {
35882
+ if (this.waiting.length > 0) {
35883
+ const next = this.waiting.shift();
35884
+ next();
35885
+ } else {
35886
+ this.locked = false;
35887
+ }
35888
+ }
35889
+ };
35890
+ var HtmlHotUpdateService = class _HtmlHotUpdateService {
35891
+ static {
35892
+ __name(this, "HtmlHotUpdateService");
35893
+ }
35894
+ httpClient;
35895
+ logger = new Logger5(_HtmlHotUpdateService.name);
35896
+ fileLock = new Mutex();
35897
+ hotUpdateDir = getHotUpdateHtmlDir();
35898
+ hotUpdateVersionsDir = getHotUpdateVersionsDir();
35899
+ originalHtmlDir = join3(process.cwd(), "dist", "client");
35900
+ constructor(httpClient) {
35901
+ this.httpClient = httpClient;
35902
+ }
35903
+ async onModuleInit() {
35904
+ const appID = this.getAppID();
35905
+ if (!appID) {
35906
+ this.logger.warn("Skip HTML hot update on startup: appID not found");
35907
+ return;
35908
+ }
35909
+ try {
35910
+ const result = await this.updateFromRemote(appID);
35911
+ this.logger.log(`Startup HTML update complete: ${result.updatedFiles.length} updated, ${result.failedFiles.length} failed`);
35912
+ } catch (error) {
35913
+ this.logger.warn(`Startup HTML update failed (degraded to bundled HTML): ${error instanceof Error ? error.message : String(error)}, appID=${appID}`);
35914
+ }
35915
+ }
35916
+ resolveHtmlPath(fileName) {
35917
+ const activeVersion = getActiveHtmlVersion();
35918
+ if (activeVersion) {
35919
+ const hotPath = join3(getHotUpdateVersionDir(activeVersion), fileName);
35920
+ if (existsSync2(hotPath)) {
35921
+ return hotPath;
35922
+ }
35923
+ }
35924
+ return join3(this.originalHtmlDir, fileName);
35925
+ }
35926
+ getViewsDirs() {
35927
+ const activeVersion = getActiveHtmlVersion();
35928
+ if (!activeVersion) {
35929
+ return [
35930
+ this.originalHtmlDir
35931
+ ];
35932
+ }
35933
+ const activeVersionDir = getHotUpdateVersionDir(activeVersion);
35934
+ return existsSync2(activeVersionDir) ? [
35935
+ activeVersionDir,
35936
+ this.originalHtmlDir
35937
+ ] : [
35938
+ this.originalHtmlDir
35939
+ ];
35940
+ }
35941
+ getActiveVersion() {
35942
+ return getActiveHtmlVersion();
35943
+ }
35944
+ computeVersion(fileMap) {
35945
+ const hash = createHash2("sha256");
35946
+ for (const filePath of Object.keys(fileMap).sort()) {
35947
+ hash.update(filePath);
35948
+ hash.update("\0");
35949
+ hash.update(fileMap[filePath]);
35950
+ hash.update("\0");
35951
+ }
35952
+ return hash.digest("hex").slice(0, 16);
35953
+ }
35954
+ normalizeFilePath(filePath) {
35955
+ const normalized = filePath.replace(/\\/g, "/").replace(/^\/+/, "");
35956
+ if (!normalized || normalized === "." || normalized.split("/").some((part) => part === ".." || part === "")) {
35957
+ throw new Error(`Invalid html file path: ${filePath}`);
35958
+ }
35959
+ return normalized;
35960
+ }
35961
+ async updateFromRemote(appID, commitID) {
35962
+ const fileMap = await this.fetchLatestHtmlFiles(appID, commitID);
35963
+ return this.writeHtmlFiles(fileMap);
35964
+ }
35965
+ async writeHtmlFiles(fileMap) {
35966
+ const result = {
35967
+ updatedFiles: [],
35968
+ failedFiles: []
35969
+ };
35970
+ const entries = Object.entries(fileMap);
35971
+ if (entries.length === 0) {
35972
+ return result;
35973
+ }
35974
+ const version = this.computeVersion(fileMap);
35975
+ const versionDir = getHotUpdateVersionDir(version);
35976
+ const currentVersion = getActiveHtmlVersion();
35977
+ if (currentVersion === version && existsSync2(versionDir)) {
35978
+ this.logger.log(`HTML hot update skipped: version ${version} already active`);
35979
+ return result;
35980
+ }
35981
+ const stagingDir = join3(this.hotUpdateDir, "staging", `${version}-${process.pid}-${Date.now()}`);
35982
+ await this.fileLock.acquire();
35983
+ try {
35984
+ if (getActiveHtmlVersion() === version && existsSync2(versionDir)) {
35985
+ this.logger.log(`HTML hot update skipped after lock: version ${version} already active`);
35986
+ return result;
35987
+ }
35988
+ await fs2.mkdir(stagingDir, {
35989
+ recursive: true
35990
+ });
35991
+ for (const [rawFilePath, content] of entries) {
35992
+ try {
35993
+ const filePath = this.normalizeFilePath(rawFilePath);
35994
+ const localPath = join3(stagingDir, filePath);
35995
+ await fs2.mkdir(dirname(localPath), {
35996
+ recursive: true
35997
+ });
35998
+ await fs2.writeFile(localPath, content, "utf-8");
35999
+ result.updatedFiles.push(filePath);
36000
+ } catch (error) {
36001
+ const reason = error instanceof Error ? error.message : String(error);
36002
+ result.failedFiles.push({
36003
+ filePath: rawFilePath,
36004
+ reason
36005
+ });
36006
+ this.logger.warn(`Failed to write HTML file ${rawFilePath}: ${reason}`);
36007
+ }
36008
+ }
36009
+ if (result.updatedFiles.length === 0) {
36010
+ await fs2.rm(stagingDir, {
36011
+ recursive: true,
36012
+ force: true
36013
+ });
36014
+ return result;
36015
+ }
36016
+ await this.promoteVersionDirectory(stagingDir, versionDir);
36017
+ setActiveHtmlVersion(version);
36018
+ await this.cleanupOldVersions(version);
36019
+ this.logger.log(`HTML hot update activated: version=${version}, files=${result.updatedFiles.length}`);
36020
+ } finally {
36021
+ await fs2.rm(stagingDir, {
36022
+ recursive: true,
36023
+ force: true
36024
+ }).catch(() => void 0);
36025
+ this.fileLock.release();
36026
+ }
36027
+ return result;
36028
+ }
36029
+ async promoteVersionDirectory(stagingDir, versionDir) {
36030
+ await fs2.mkdir(this.hotUpdateVersionsDir, {
36031
+ recursive: true
36032
+ });
36033
+ try {
36034
+ await fs2.rename(stagingDir, versionDir);
36035
+ } catch (error) {
36036
+ const err = error;
36037
+ if (err.code !== "EEXIST") {
36038
+ throw error;
36039
+ }
36040
+ }
36041
+ }
36042
+ async cleanupOldVersions(activeVersion) {
36043
+ let versions = [];
36044
+ try {
36045
+ versions = await fs2.readdir(this.hotUpdateVersionsDir);
36046
+ } catch {
36047
+ return;
36048
+ }
36049
+ await Promise.all(versions.filter((version) => version !== activeVersion).map((version) => fs2.rm(getHotUpdateVersionDir(version), {
36050
+ recursive: true,
36051
+ force: true
36052
+ })));
36053
+ }
36054
+ async fetchLatestHtmlFiles(appID, commitID) {
36055
+ const url = `/v1/app/${appID}/pipeline/frontend/latest_artifact/html_files`;
36056
+ const body = {};
36057
+ if (commitID) {
36058
+ body.commitID = commitID;
36059
+ }
36060
+ const response = await this.httpClient.post(url, body, {
36061
+ timeout: 3e3
36062
+ });
36063
+ if (!response.ok) {
36064
+ throw new Error(`GetLatestArtifactHtmlFiles failed: ${response.status} ${response.statusText}`);
36065
+ }
36066
+ const rawText = await response.text();
36067
+ let resp;
36068
+ try {
36069
+ resp = JSON.parse(rawText);
36070
+ } catch {
36071
+ throw new Error("GetLatestArtifactHtmlFiles: invalid JSON response");
36072
+ }
36073
+ if (resp.status_code !== "0") {
36074
+ throw new Error(`GetLatestArtifactHtmlFiles error: status_code=${resp.status_code}`);
36075
+ }
36076
+ const fileMap = resp.data?.fileMap;
36077
+ if (!fileMap || Object.keys(fileMap).length === 0) {
36078
+ throw new Error("GetLatestArtifactHtmlFiles returned empty fileMap");
36079
+ }
36080
+ return fileMap;
36081
+ }
36082
+ getAppID() {
36083
+ const basePath = process.env.CLIENT_BASE_PATH || "";
36084
+ const patterns = [
36085
+ /\/app\/([^/]+)/,
36086
+ /\/spark\/b\/([^/]+)/
36087
+ ];
36088
+ for (const pattern of patterns) {
36089
+ const match = basePath.match(pattern);
36090
+ if (match?.[1]) {
36091
+ return match[1];
36092
+ }
36093
+ }
36094
+ return "";
36095
+ }
36096
+ };
36097
+ HtmlHotUpdateService = _ts_decorate12([
36098
+ Injectable10(),
36099
+ _ts_param4(0, Inject3(PLATFORM_HTTP_CLIENT3)),
36100
+ _ts_metadata8("design:type", Function),
36101
+ _ts_metadata8("design:paramtypes", [
36102
+ typeof PlatformHttpClient === "undefined" ? Object : PlatformHttpClient
36103
+ ])
36104
+ ], HtmlHotUpdateService);
36105
+
36106
+ // src/modules/html-hot-update/html-hot-update.controller.ts
36107
+ function _ts_decorate13(decorators, target, key, desc) {
36108
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36109
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36110
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
36111
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
36112
+ }
36113
+ __name(_ts_decorate13, "_ts_decorate");
36114
+ function _ts_metadata9(k, v) {
36115
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
36116
+ }
36117
+ __name(_ts_metadata9, "_ts_metadata");
36118
+ function _ts_param5(paramIndex, decorator) {
36119
+ return function(target, key) {
36120
+ decorator(target, key, paramIndex);
36121
+ };
36122
+ }
36123
+ __name(_ts_param5, "_ts_param");
36124
+ var UpdateHtmlFilesDto = class UpdateHtmlFilesDto2 {
36125
+ static {
36126
+ __name(this, "UpdateHtmlFilesDto");
36127
+ }
36128
+ commitID;
36129
+ appID;
36130
+ };
36131
+ var HtmlHotUpdateController = class _HtmlHotUpdateController {
36132
+ static {
36133
+ __name(this, "HtmlHotUpdateController");
36134
+ }
36135
+ htmlHotUpdateService;
36136
+ logger = new Logger6(_HtmlHotUpdateController.name);
36137
+ constructor(htmlHotUpdateService) {
36138
+ this.htmlHotUpdateService = htmlHotUpdateService;
36139
+ }
36140
+ /**
36141
+ * POST /__innerapi__/update_html_files
36142
+ *
36143
+ * 请求体: { commitID: string, appID: string }
36144
+ * 响应:
36145
+ * 成功: { code: 0, msg: "success" }
36146
+ * 失败: { code: -1, msg: "update html failed: <error>" }
36147
+ */
36148
+ async updateHtmlFiles(body) {
36149
+ const { commitID, appID } = body;
36150
+ if (!commitID || !appID) {
36151
+ return {
36152
+ code: -1,
36153
+ msg: "commitID and appID are required"
36154
+ };
36155
+ }
36156
+ try {
36157
+ const result = await this.htmlHotUpdateService.updateFromRemote(appID, commitID);
36158
+ if (result.updatedFiles.length === 0 && result.failedFiles.length > 0) {
36159
+ return {
36160
+ code: -1,
36161
+ msg: `update html failed: all ${result.failedFiles.length} files failed to write`
36162
+ };
36163
+ }
36164
+ return {
36165
+ code: 0,
36166
+ msg: "success"
36167
+ };
36168
+ } catch (error) {
36169
+ const errorMsg = error instanceof Error ? error.message : String(error);
36170
+ this.logger.error(`Update html failed: ${errorMsg}`);
36171
+ return {
36172
+ code: -1,
36173
+ msg: `update html failed: ${errorMsg}`
36174
+ };
36175
+ }
36176
+ }
36177
+ };
36178
+ _ts_decorate13([
36179
+ Post("update_html_files"),
36180
+ HttpCode(HttpStatus2.OK),
36181
+ _ts_param5(0, Body()),
36182
+ _ts_metadata9("design:type", Function),
36183
+ _ts_metadata9("design:paramtypes", [
36184
+ typeof UpdateHtmlFilesDto === "undefined" ? Object : UpdateHtmlFilesDto
36185
+ ]),
36186
+ _ts_metadata9("design:returntype", Promise)
36187
+ ], HtmlHotUpdateController.prototype, "updateHtmlFiles", null);
36188
+ HtmlHotUpdateController = _ts_decorate13([
36189
+ ApiExcludeController2(),
36190
+ Controller2("__innerapi__"),
36191
+ _ts_metadata9("design:type", Function),
36192
+ _ts_metadata9("design:paramtypes", [
36193
+ typeof HtmlHotUpdateService === "undefined" ? Object : HtmlHotUpdateService
36194
+ ])
36195
+ ], HtmlHotUpdateController);
36196
+
36197
+ // src/modules/html-hot-update/html-hot-update.module.ts
36198
+ function _ts_decorate14(decorators, target, key, desc) {
36199
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36200
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36201
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
36202
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
36203
+ }
36204
+ __name(_ts_decorate14, "_ts_decorate");
36205
+ var HtmlHotUpdateModule = class {
36206
+ static {
36207
+ __name(this, "HtmlHotUpdateModule");
36208
+ }
36209
+ };
36210
+ HtmlHotUpdateModule = _ts_decorate14([
36211
+ Module2({
36212
+ controllers: [
36213
+ HtmlHotUpdateController
36214
+ ],
36215
+ providers: [
36216
+ HtmlHotUpdateService
36217
+ ],
36218
+ exports: [
36219
+ HtmlHotUpdateService
36220
+ ]
36221
+ })
36222
+ ], HtmlHotUpdateModule);
36223
+
36224
+ // src/middlewares/html-hot-update-view/index.ts
36225
+ import { Injectable as Injectable11 } from "@nestjs/common";
36226
+ import { existsSync as existsSync3 } from "fs";
36227
+ import { join as join4 } from "path";
36228
+ function _ts_decorate15(decorators, target, key, desc) {
36229
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36230
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36231
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
36232
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
36233
+ }
36234
+ __name(_ts_decorate15, "_ts_decorate");
36235
+ var HtmlHotUpdateViewMiddleware = class {
36236
+ static {
36237
+ __name(this, "HtmlHotUpdateViewMiddleware");
36238
+ }
36239
+ use(_req, res, next) {
36240
+ if (process.env.NODE_ENV !== "production") {
36241
+ return next();
36242
+ }
36243
+ const originalRender = res.render.bind(res);
36244
+ res.render = (view, options, callback) => {
36245
+ let renderOptions = options;
36246
+ let renderCallback = callback;
36247
+ if (typeof renderOptions === "function") {
36248
+ renderCallback = renderOptions;
36249
+ renderOptions = void 0;
36250
+ }
36251
+ const activeVersion = getActiveHtmlVersion();
36252
+ const hotPath = activeVersion ? join4(getHotUpdateVersionDir(activeVersion), `${view}.html`) : "";
36253
+ if (hotPath && existsSync3(hotPath)) {
36254
+ return originalRender(hotPath, renderOptions, renderCallback);
36255
+ }
36256
+ return originalRender(view, renderOptions, renderCallback);
36257
+ };
36258
+ next();
36259
+ }
36260
+ };
36261
+ HtmlHotUpdateViewMiddleware = _ts_decorate15([
36262
+ Injectable11()
36263
+ ], HtmlHotUpdateViewMiddleware);
36264
+
36265
+ // src/modules/platform/module.ts
36266
+ function _ts_decorate16(decorators, target, key, desc) {
36267
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36268
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
36269
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
36270
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
36271
+ }
36272
+ __name(_ts_decorate16, "_ts_decorate");
34907
36273
  var PLATFORM_MODULE_OPTIONS = /* @__PURE__ */ Symbol("PLATFORM_MODULE_OPTIONS");
34908
36274
  var PlatformModule = class _PlatformModule {
34909
36275
  static {
@@ -34974,6 +36340,11 @@ var PlatformModule = class _PlatformModule {
34974
36340
  // 开发环境由 Vite/Rspack dev server 的中间件处理 /static/* 请求
34975
36341
  ...process.env.NODE_ENV === "development" ? [] : [
34976
36342
  StaticModule
36343
+ ],
36344
+ // HTML 热更新模块(仅生产环境启用)
36345
+ // 提供 innerapi 供 tce 服务触发 HTML 热更新,冷启动时也会尝试拉取最新 HTML
36346
+ ...process.env.NODE_ENV === "development" ? [] : [
36347
+ HtmlHotUpdateModule
34977
36348
  ]
34978
36349
  ],
34979
36350
  providers: [
@@ -34996,7 +36367,7 @@ var PlatformModule = class _PlatformModule {
34996
36367
  },
34997
36368
  PlatformHttpClientService,
34998
36369
  {
34999
- provide: PLATFORM_HTTP_CLIENT3,
36370
+ provide: PLATFORM_HTTP_CLIENT4,
35000
36371
  useFactory: /* @__PURE__ */ __name((svc) => svc.instance, "useFactory"),
35001
36372
  inject: [
35002
36373
  PlatformHttpClientService
@@ -35023,7 +36394,7 @@ var PlatformModule = class _PlatformModule {
35023
36394
  LoggerModule,
35024
36395
  CommonModule,
35025
36396
  OBSERVABLE_SERVICE2,
35026
- PLATFORM_HTTP_CLIENT3,
36397
+ PLATFORM_HTTP_CLIENT4,
35027
36398
  HTTP_CLIENT_FACTORY,
35028
36399
  PlatformHttpClientService,
35029
36400
  CapabilityModule,
@@ -35043,7 +36414,7 @@ var PlatformModule = class _PlatformModule {
35043
36414
  consumer.apply(UserContextMiddleware, RequestContextMiddleware, LoggerContextMiddleware, ObservableTraceMiddleware, ...DISABLE_DATAPASS ? [] : [
35044
36415
  SqlExecutionContextMiddleware
35045
36416
  ]).forRoutes("/*");
35046
- consumer.apply(CsrfTokenMiddleware, ViewContextMiddleware).exclude("/api/(.*)", "/static/(.*)").forRoutes("*");
36417
+ consumer.apply(CsrfTokenMiddleware, ViewContextMiddleware, HtmlHotUpdateViewMiddleware).exclude("/api/(.*)", "/static/(.*)").forRoutes("*");
35047
36418
  if (options.enableCsrf !== false) {
35048
36419
  const csrfRoutes = options.csrfRoutes || "/api/*";
35049
36420
  if (Array.isArray(csrfRoutes)) {
@@ -35056,9 +36427,9 @@ var PlatformModule = class _PlatformModule {
35056
36427
  }
35057
36428
  }
35058
36429
  };
35059
- PlatformModule = _ts_decorate12([
36430
+ PlatformModule = _ts_decorate16([
35060
36431
  Global(),
35061
- Module2({})
36432
+ Module3({})
35062
36433
  ], PlatformModule);
35063
36434
 
35064
36435
  // src/setup.ts
@@ -35147,15 +36518,20 @@ export * from "@lark-apaas/nestjs-observable";
35147
36518
  export * from "@lark-apaas/nestjs-trigger";
35148
36519
  export * from "@lark-apaas/file-service";
35149
36520
  import { AutoTrace } from "@lark-apaas/nestjs-common";
35150
- import { CanRole } from "@lark-apaas/nestjs-authzpaas";
36521
+ import { CanRole, Can, AuthorizationSDK, PERMISSION_RESOLVER_TOKEN } from "@lark-apaas/nestjs-authzpaas";
35151
36522
  export {
36523
+ AuthorizationSDK,
35152
36524
  AutoTrace,
36525
+ Can,
35153
36526
  CanRole,
35154
36527
  CsrfMiddleware,
35155
36528
  CsrfTokenMiddleware,
35156
36529
  DevToolsModule,
35157
36530
  DevToolsV2Module2 as DevToolsV2Module,
35158
36531
  FileService,
36532
+ HtmlHotUpdateModule,
36533
+ HtmlHotUpdateService,
36534
+ PERMISSION_RESOLVER_TOKEN,
35159
36535
  PlatformHttpClientService,
35160
36536
  PlatformModule,
35161
36537
  StaticModule,