@lark-apaas/fullstack-nestjs-core 1.1.24-alpha.25 → 1.1.24-alpha.26

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.cjs CHANGED
@@ -966,9 +966,9 @@ var require_http_errors = __commonJS({
966
966
  }
967
967
  });
968
968
 
969
- // ../../../node_modules/body-parser/node_modules/ms/index.js
969
+ // ../../../node_modules/express/node_modules/ms/index.js
970
970
  var require_ms = __commonJS({
971
- "../../../node_modules/body-parser/node_modules/ms/index.js"(exports2, module2) {
971
+ "../../../node_modules/express/node_modules/ms/index.js"(exports2, module2) {
972
972
  "use strict";
973
973
  var s = 1e3;
974
974
  var m = s * 60;
@@ -1069,9 +1069,9 @@ var require_ms = __commonJS({
1069
1069
  }
1070
1070
  });
1071
1071
 
1072
- // ../../../node_modules/body-parser/node_modules/debug/src/debug.js
1072
+ // ../../../node_modules/express/node_modules/debug/src/debug.js
1073
1073
  var require_debug = __commonJS({
1074
- "../../../node_modules/body-parser/node_modules/debug/src/debug.js"(exports2, module2) {
1074
+ "../../../node_modules/express/node_modules/debug/src/debug.js"(exports2, module2) {
1075
1075
  "use strict";
1076
1076
  exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug;
1077
1077
  exports2.coerce = coerce;
@@ -1182,9 +1182,9 @@ var require_debug = __commonJS({
1182
1182
  }
1183
1183
  });
1184
1184
 
1185
- // ../../../node_modules/body-parser/node_modules/debug/src/browser.js
1185
+ // ../../../node_modules/express/node_modules/debug/src/browser.js
1186
1186
  var require_browser = __commonJS({
1187
- "../../../node_modules/body-parser/node_modules/debug/src/browser.js"(exports2, module2) {
1187
+ "../../../node_modules/express/node_modules/debug/src/browser.js"(exports2, module2) {
1188
1188
  "use strict";
1189
1189
  exports2 = module2.exports = require_debug();
1190
1190
  exports2.log = log;
@@ -1275,9 +1275,9 @@ var require_browser = __commonJS({
1275
1275
  }
1276
1276
  });
1277
1277
 
1278
- // ../../../node_modules/body-parser/node_modules/debug/src/node.js
1278
+ // ../../../node_modules/express/node_modules/debug/src/node.js
1279
1279
  var require_node = __commonJS({
1280
- "../../../node_modules/body-parser/node_modules/debug/src/node.js"(exports2, module2) {
1280
+ "../../../node_modules/express/node_modules/debug/src/node.js"(exports2, module2) {
1281
1281
  "use strict";
1282
1282
  var tty = require("tty");
1283
1283
  var util = require("util");
@@ -1412,9 +1412,9 @@ var require_node = __commonJS({
1412
1412
  }
1413
1413
  });
1414
1414
 
1415
- // ../../../node_modules/body-parser/node_modules/debug/src/index.js
1415
+ // ../../../node_modules/express/node_modules/debug/src/index.js
1416
1416
  var require_src = __commonJS({
1417
- "../../../node_modules/body-parser/node_modules/debug/src/index.js"(exports2, module2) {
1417
+ "../../../node_modules/express/node_modules/debug/src/index.js"(exports2, module2) {
1418
1418
  "use strict";
1419
1419
  if (typeof process !== "undefined" && process.type === "renderer") {
1420
1420
  module2.exports = require_browser();
@@ -4975,9 +4975,9 @@ var require_unpipe = __commonJS({
4975
4975
  }
4976
4976
  });
4977
4977
 
4978
- // ../../../node_modules/body-parser/node_modules/raw-body/index.js
4978
+ // ../../../node_modules/express/node_modules/raw-body/index.js
4979
4979
  var require_raw_body = __commonJS({
4980
- "../../../node_modules/body-parser/node_modules/raw-body/index.js"(exports2, module2) {
4980
+ "../../../node_modules/express/node_modules/raw-body/index.js"(exports2, module2) {
4981
4981
  "use strict";
4982
4982
  var asyncHooks = tryRequireAsyncHooks();
4983
4983
  var bytes = require_bytes();
@@ -5362,9 +5362,9 @@ var require_on_finished = __commonJS({
5362
5362
  }
5363
5363
  });
5364
5364
 
5365
- // ../../../node_modules/body-parser/lib/read.js
5365
+ // ../../../node_modules/express/node_modules/body-parser/lib/read.js
5366
5366
  var require_read = __commonJS({
5367
- "../../../node_modules/body-parser/lib/read.js"(exports2, module2) {
5367
+ "../../../node_modules/express/node_modules/body-parser/lib/read.js"(exports2, module2) {
5368
5368
  "use strict";
5369
5369
  var createError = require_http_errors();
5370
5370
  var destroy = require_destroy();
@@ -14369,9 +14369,9 @@ var require_type_is = __commonJS({
14369
14369
  }
14370
14370
  });
14371
14371
 
14372
- // ../../../node_modules/body-parser/lib/types/json.js
14372
+ // ../../../node_modules/express/node_modules/body-parser/lib/types/json.js
14373
14373
  var require_json = __commonJS({
14374
- "../../../node_modules/body-parser/lib/types/json.js"(exports2, module2) {
14374
+ "../../../node_modules/express/node_modules/body-parser/lib/types/json.js"(exports2, module2) {
14375
14375
  "use strict";
14376
14376
  var bytes = require_bytes();
14377
14377
  var contentType = require_content_type();
@@ -14510,9 +14510,9 @@ var require_json = __commonJS({
14510
14510
  }
14511
14511
  });
14512
14512
 
14513
- // ../../../node_modules/body-parser/lib/types/raw.js
14513
+ // ../../../node_modules/express/node_modules/body-parser/lib/types/raw.js
14514
14514
  var require_raw = __commonJS({
14515
- "../../../node_modules/body-parser/lib/types/raw.js"(exports2, module2) {
14515
+ "../../../node_modules/express/node_modules/body-parser/lib/types/raw.js"(exports2, module2) {
14516
14516
  "use strict";
14517
14517
  var bytes = require_bytes();
14518
14518
  var debug = require_src()("body-parser:raw");
@@ -14569,9 +14569,9 @@ var require_raw = __commonJS({
14569
14569
  }
14570
14570
  });
14571
14571
 
14572
- // ../../../node_modules/body-parser/lib/types/text.js
14572
+ // ../../../node_modules/express/node_modules/body-parser/lib/types/text.js
14573
14573
  var require_text = __commonJS({
14574
- "../../../node_modules/body-parser/lib/types/text.js"(exports2, module2) {
14574
+ "../../../node_modules/express/node_modules/body-parser/lib/types/text.js"(exports2, module2) {
14575
14575
  "use strict";
14576
14576
  var bytes = require_bytes();
14577
14577
  var contentType = require_content_type();
@@ -16533,23 +16533,8 @@ var require_utils = __commonJS({
16533
16533
  "../../../node_modules/qs/lib/utils.js"(exports2, module2) {
16534
16534
  "use strict";
16535
16535
  var formats = require_formats();
16536
- var getSideChannel = require_side_channel();
16537
16536
  var has = Object.prototype.hasOwnProperty;
16538
16537
  var isArray = Array.isArray;
16539
- var overflowChannel = getSideChannel();
16540
- var markOverflow = /* @__PURE__ */ __name(function markOverflow2(obj, maxIndex) {
16541
- overflowChannel.set(obj, maxIndex);
16542
- return obj;
16543
- }, "markOverflow");
16544
- var isOverflow = /* @__PURE__ */ __name(function isOverflow2(obj) {
16545
- return overflowChannel.has(obj);
16546
- }, "isOverflow");
16547
- var getMaxIndex = /* @__PURE__ */ __name(function getMaxIndex2(obj) {
16548
- return overflowChannel.get(obj);
16549
- }, "getMaxIndex");
16550
- var setMaxIndex = /* @__PURE__ */ __name(function setMaxIndex2(obj, maxIndex) {
16551
- overflowChannel.set(obj, maxIndex);
16552
- }, "setMaxIndex");
16553
16538
  var hexTable = (function() {
16554
16539
  var array = [];
16555
16540
  for (var i = 0; i < 256; ++i) {
@@ -16591,11 +16576,7 @@ var require_utils = __commonJS({
16591
16576
  if (isArray(target)) {
16592
16577
  target.push(source);
16593
16578
  } else if (target && typeof target === "object") {
16594
- if (isOverflow(target)) {
16595
- var newIndex = getMaxIndex(target) + 1;
16596
- target[newIndex] = source;
16597
- setMaxIndex(target, newIndex);
16598
- } else if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
16579
+ if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) {
16599
16580
  target[source] = true;
16600
16581
  }
16601
16582
  } else {
@@ -16607,20 +16588,6 @@ var require_utils = __commonJS({
16607
16588
  return target;
16608
16589
  }
16609
16590
  if (!target || typeof target !== "object") {
16610
- if (isOverflow(source)) {
16611
- var sourceKeys = Object.keys(source);
16612
- var result = options && options.plainObjects ? {
16613
- __proto__: null,
16614
- 0: target
16615
- } : {
16616
- 0: target
16617
- };
16618
- for (var m = 0; m < sourceKeys.length; m++) {
16619
- var oldKey = parseInt(sourceKeys[m], 10);
16620
- result[oldKey + 1] = source[sourceKeys[m]];
16621
- }
16622
- return markOverflow(result, getMaxIndex(source) + 1);
16623
- }
16624
16591
  return [
16625
16592
  target
16626
16593
  ].concat(source);
@@ -16755,20 +16722,8 @@ var require_utils = __commonJS({
16755
16722
  }
16756
16723
  return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
16757
16724
  }, "isBuffer");
16758
- var combine = /* @__PURE__ */ __name(function combine2(a, b, arrayLimit, plainObjects) {
16759
- if (isOverflow(a)) {
16760
- var newIndex = getMaxIndex(a) + 1;
16761
- a[newIndex] = b;
16762
- setMaxIndex(a, newIndex);
16763
- return a;
16764
- }
16765
- var result = [].concat(a, b);
16766
- if (result.length > arrayLimit) {
16767
- return markOverflow(arrayToObject(result, {
16768
- plainObjects
16769
- }), result.length - 1);
16770
- }
16771
- return result;
16725
+ var combine = /* @__PURE__ */ __name(function combine2(a, b) {
16726
+ return [].concat(a, b);
16772
16727
  }, "combine");
16773
16728
  var maybeMap = /* @__PURE__ */ __name(function maybeMap2(val, fn) {
16774
16729
  if (isArray(val)) {
@@ -16788,7 +16743,6 @@ var require_utils = __commonJS({
16788
16743
  decode,
16789
16744
  encode,
16790
16745
  isBuffer,
16791
- isOverflow,
16792
16746
  isRegExp,
16793
16747
  maybeMap,
16794
16748
  merge
@@ -17138,11 +17092,9 @@ var require_parse = __commonJS({
17138
17092
  val = options.strictNullHandling ? null : "";
17139
17093
  } else {
17140
17094
  key = options.decoder(part.slice(0, pos), defaults.decoder, charset, "key");
17141
- if (key !== null) {
17142
- val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
17143
- return options.decoder(encodedVal, defaults.decoder, charset, "value");
17144
- });
17145
- }
17095
+ val = utils.maybeMap(parseArrayValue(part.slice(pos + 1), options, isArray(obj[key]) ? obj[key].length : 0), function(encodedVal) {
17096
+ return options.decoder(encodedVal, defaults.decoder, charset, "value");
17097
+ });
17146
17098
  }
17147
17099
  if (val && options.interpretNumericEntities && charset === "iso-8859-1") {
17148
17100
  val = interpretNumericEntities(String(val));
@@ -17152,13 +17104,11 @@ var require_parse = __commonJS({
17152
17104
  val
17153
17105
  ] : val;
17154
17106
  }
17155
- if (key !== null) {
17156
- var existing = has.call(obj, key);
17157
- if (existing && options.duplicates === "combine") {
17158
- obj[key] = utils.combine(obj[key], val, options.arrayLimit, options.plainObjects);
17159
- } else if (!existing || options.duplicates === "last") {
17160
- obj[key] = val;
17161
- }
17107
+ var existing = has.call(obj, key);
17108
+ if (existing && options.duplicates === "combine") {
17109
+ obj[key] = utils.combine(obj[key], val);
17110
+ } else if (!existing || options.duplicates === "last") {
17111
+ obj[key] = val;
17162
17112
  }
17163
17113
  }
17164
17114
  return obj;
@@ -17174,11 +17124,7 @@ var require_parse = __commonJS({
17174
17124
  var obj;
17175
17125
  var root = chain[i];
17176
17126
  if (root === "[]" && options.parseArrays) {
17177
- if (utils.isOverflow(leaf)) {
17178
- obj = leaf;
17179
- } else {
17180
- obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf, options.arrayLimit, options.plainObjects);
17181
- }
17127
+ obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : utils.combine([], leaf);
17182
17128
  } else {
17183
17129
  obj = options.plainObjects ? {
17184
17130
  __proto__: null
@@ -17201,21 +17147,14 @@ var require_parse = __commonJS({
17201
17147
  }
17202
17148
  return leaf;
17203
17149
  }, "parseObject");
17204
- var splitKeyIntoSegments = /* @__PURE__ */ __name(function splitKeyIntoSegments2(givenKey, options) {
17205
- var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
17206
- if (options.depth <= 0) {
17207
- if (!options.plainObjects && has.call(Object.prototype, key)) {
17208
- if (!options.allowPrototypes) {
17209
- return;
17210
- }
17211
- }
17212
- return [
17213
- key
17214
- ];
17150
+ var parseKeys = /* @__PURE__ */ __name(function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
17151
+ if (!givenKey) {
17152
+ return;
17215
17153
  }
17154
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey;
17216
17155
  var brackets = /(\[[^[\]]*])/;
17217
17156
  var child = /(\[[^[\]]*])/g;
17218
- var segment = brackets.exec(key);
17157
+ var segment = options.depth > 0 && brackets.exec(key);
17219
17158
  var parent = segment ? key.slice(0, segment.index) : key;
17220
17159
  var keys = [];
17221
17160
  if (parent) {
@@ -17227,10 +17166,9 @@ var require_parse = __commonJS({
17227
17166
  keys.push(parent);
17228
17167
  }
17229
17168
  var i = 0;
17230
- while ((segment = child.exec(key)) !== null && i < options.depth) {
17169
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
17231
17170
  i += 1;
17232
- var segmentContent = segment[1].slice(1, -1);
17233
- if (!options.plainObjects && has.call(Object.prototype, segmentContent)) {
17171
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
17234
17172
  if (!options.allowPrototypes) {
17235
17173
  return;
17236
17174
  }
@@ -17243,16 +17181,6 @@ var require_parse = __commonJS({
17243
17181
  }
17244
17182
  keys.push("[" + key.slice(segment.index) + "]");
17245
17183
  }
17246
- return keys;
17247
- }, "splitKeyIntoSegments");
17248
- var parseKeys = /* @__PURE__ */ __name(function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
17249
- if (!givenKey) {
17250
- return;
17251
- }
17252
- var keys = splitKeyIntoSegments(givenKey, options);
17253
- if (!keys) {
17254
- return;
17255
- }
17256
17184
  return parseObject(keys, val, options, valuesParsed);
17257
17185
  }, "parseQueryStringKeys");
17258
17186
  var normalizeParseOptions = /* @__PURE__ */ __name(function normalizeParseOptions2(opts) {
@@ -17345,9 +17273,9 @@ var require_lib2 = __commonJS({
17345
17273
  }
17346
17274
  });
17347
17275
 
17348
- // ../../../node_modules/body-parser/lib/types/urlencoded.js
17276
+ // ../../../node_modules/express/node_modules/body-parser/lib/types/urlencoded.js
17349
17277
  var require_urlencoded = __commonJS({
17350
- "../../../node_modules/body-parser/lib/types/urlencoded.js"(exports2, module2) {
17278
+ "../../../node_modules/express/node_modules/body-parser/lib/types/urlencoded.js"(exports2, module2) {
17351
17279
  "use strict";
17352
17280
  var bytes = require_bytes();
17353
17281
  var contentType = require_content_type();
@@ -17528,9 +17456,9 @@ var require_urlencoded = __commonJS({
17528
17456
  }
17529
17457
  });
17530
17458
 
17531
- // ../../../node_modules/body-parser/index.js
17459
+ // ../../../node_modules/express/node_modules/body-parser/index.js
17532
17460
  var require_body_parser = __commonJS({
17533
- "../../../node_modules/body-parser/index.js"(exports2, module2) {
17461
+ "../../../node_modules/express/node_modules/body-parser/index.js"(exports2, module2) {
17534
17462
  "use strict";
17535
17463
  var deprecate = require_depd()("body-parser");
17536
17464
  var parsers = /* @__PURE__ */ Object.create(null);
@@ -18404,464 +18332,6 @@ var require_finalhandler = __commonJS({
18404
18332
  }
18405
18333
  });
18406
18334
 
18407
- // ../../../node_modules/express/node_modules/ms/index.js
18408
- var require_ms3 = __commonJS({
18409
- "../../../node_modules/express/node_modules/ms/index.js"(exports2, module2) {
18410
- "use strict";
18411
- var s = 1e3;
18412
- var m = s * 60;
18413
- var h = m * 60;
18414
- var d = h * 24;
18415
- var y = d * 365.25;
18416
- module2.exports = function(val, options) {
18417
- options = options || {};
18418
- var type = typeof val;
18419
- if (type === "string" && val.length > 0) {
18420
- return parse(val);
18421
- } else if (type === "number" && isNaN(val) === false) {
18422
- return options.long ? fmtLong(val) : fmtShort(val);
18423
- }
18424
- throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val));
18425
- };
18426
- function parse(str) {
18427
- str = String(str);
18428
- if (str.length > 100) {
18429
- return;
18430
- }
18431
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
18432
- if (!match) {
18433
- return;
18434
- }
18435
- var n = parseFloat(match[1]);
18436
- var type = (match[2] || "ms").toLowerCase();
18437
- switch (type) {
18438
- case "years":
18439
- case "year":
18440
- case "yrs":
18441
- case "yr":
18442
- case "y":
18443
- return n * y;
18444
- case "days":
18445
- case "day":
18446
- case "d":
18447
- return n * d;
18448
- case "hours":
18449
- case "hour":
18450
- case "hrs":
18451
- case "hr":
18452
- case "h":
18453
- return n * h;
18454
- case "minutes":
18455
- case "minute":
18456
- case "mins":
18457
- case "min":
18458
- case "m":
18459
- return n * m;
18460
- case "seconds":
18461
- case "second":
18462
- case "secs":
18463
- case "sec":
18464
- case "s":
18465
- return n * s;
18466
- case "milliseconds":
18467
- case "millisecond":
18468
- case "msecs":
18469
- case "msec":
18470
- case "ms":
18471
- return n;
18472
- default:
18473
- return void 0;
18474
- }
18475
- }
18476
- __name(parse, "parse");
18477
- function fmtShort(ms) {
18478
- if (ms >= d) {
18479
- return Math.round(ms / d) + "d";
18480
- }
18481
- if (ms >= h) {
18482
- return Math.round(ms / h) + "h";
18483
- }
18484
- if (ms >= m) {
18485
- return Math.round(ms / m) + "m";
18486
- }
18487
- if (ms >= s) {
18488
- return Math.round(ms / s) + "s";
18489
- }
18490
- return ms + "ms";
18491
- }
18492
- __name(fmtShort, "fmtShort");
18493
- function fmtLong(ms) {
18494
- return plural(ms, d, "day") || plural(ms, h, "hour") || plural(ms, m, "minute") || plural(ms, s, "second") || ms + " ms";
18495
- }
18496
- __name(fmtLong, "fmtLong");
18497
- function plural(ms, n, name) {
18498
- if (ms < n) {
18499
- return;
18500
- }
18501
- if (ms < n * 1.5) {
18502
- return Math.floor(ms / n) + " " + name;
18503
- }
18504
- return Math.ceil(ms / n) + " " + name + "s";
18505
- }
18506
- __name(plural, "plural");
18507
- }
18508
- });
18509
-
18510
- // ../../../node_modules/express/node_modules/debug/src/debug.js
18511
- var require_debug3 = __commonJS({
18512
- "../../../node_modules/express/node_modules/debug/src/debug.js"(exports2, module2) {
18513
- "use strict";
18514
- exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug;
18515
- exports2.coerce = coerce;
18516
- exports2.disable = disable;
18517
- exports2.enable = enable;
18518
- exports2.enabled = enabled;
18519
- exports2.humanize = require_ms3();
18520
- exports2.names = [];
18521
- exports2.skips = [];
18522
- exports2.formatters = {};
18523
- var prevTime;
18524
- function selectColor(namespace) {
18525
- var hash = 0, i;
18526
- for (i in namespace) {
18527
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
18528
- hash |= 0;
18529
- }
18530
- return exports2.colors[Math.abs(hash) % exports2.colors.length];
18531
- }
18532
- __name(selectColor, "selectColor");
18533
- function createDebug(namespace) {
18534
- function debug() {
18535
- if (!debug.enabled) return;
18536
- var self = debug;
18537
- var curr = +/* @__PURE__ */ new Date();
18538
- var ms = curr - (prevTime || curr);
18539
- self.diff = ms;
18540
- self.prev = prevTime;
18541
- self.curr = curr;
18542
- prevTime = curr;
18543
- var args = new Array(arguments.length);
18544
- for (var i = 0; i < args.length; i++) {
18545
- args[i] = arguments[i];
18546
- }
18547
- args[0] = exports2.coerce(args[0]);
18548
- if ("string" !== typeof args[0]) {
18549
- args.unshift("%O");
18550
- }
18551
- var index = 0;
18552
- args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
18553
- if (match === "%%") return match;
18554
- index++;
18555
- var formatter = exports2.formatters[format];
18556
- if ("function" === typeof formatter) {
18557
- var val = args[index];
18558
- match = formatter.call(self, val);
18559
- args.splice(index, 1);
18560
- index--;
18561
- }
18562
- return match;
18563
- });
18564
- exports2.formatArgs.call(self, args);
18565
- var logFn = debug.log || exports2.log || console.log.bind(console);
18566
- logFn.apply(self, args);
18567
- }
18568
- __name(debug, "debug");
18569
- debug.namespace = namespace;
18570
- debug.enabled = exports2.enabled(namespace);
18571
- debug.useColors = exports2.useColors();
18572
- debug.color = selectColor(namespace);
18573
- if ("function" === typeof exports2.init) {
18574
- exports2.init(debug);
18575
- }
18576
- return debug;
18577
- }
18578
- __name(createDebug, "createDebug");
18579
- function enable(namespaces) {
18580
- exports2.save(namespaces);
18581
- exports2.names = [];
18582
- exports2.skips = [];
18583
- var split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
18584
- var len = split.length;
18585
- for (var i = 0; i < len; i++) {
18586
- if (!split[i]) continue;
18587
- namespaces = split[i].replace(/\*/g, ".*?");
18588
- if (namespaces[0] === "-") {
18589
- exports2.skips.push(new RegExp("^" + namespaces.substr(1) + "$"));
18590
- } else {
18591
- exports2.names.push(new RegExp("^" + namespaces + "$"));
18592
- }
18593
- }
18594
- }
18595
- __name(enable, "enable");
18596
- function disable() {
18597
- exports2.enable("");
18598
- }
18599
- __name(disable, "disable");
18600
- function enabled(name) {
18601
- var i, len;
18602
- for (i = 0, len = exports2.skips.length; i < len; i++) {
18603
- if (exports2.skips[i].test(name)) {
18604
- return false;
18605
- }
18606
- }
18607
- for (i = 0, len = exports2.names.length; i < len; i++) {
18608
- if (exports2.names[i].test(name)) {
18609
- return true;
18610
- }
18611
- }
18612
- return false;
18613
- }
18614
- __name(enabled, "enabled");
18615
- function coerce(val) {
18616
- if (val instanceof Error) return val.stack || val.message;
18617
- return val;
18618
- }
18619
- __name(coerce, "coerce");
18620
- }
18621
- });
18622
-
18623
- // ../../../node_modules/express/node_modules/debug/src/browser.js
18624
- var require_browser3 = __commonJS({
18625
- "../../../node_modules/express/node_modules/debug/src/browser.js"(exports2, module2) {
18626
- "use strict";
18627
- exports2 = module2.exports = require_debug3();
18628
- exports2.log = log;
18629
- exports2.formatArgs = formatArgs;
18630
- exports2.save = save;
18631
- exports2.load = load;
18632
- exports2.useColors = useColors;
18633
- exports2.storage = "undefined" != typeof chrome && "undefined" != typeof chrome.storage ? chrome.storage.local : localstorage();
18634
- exports2.colors = [
18635
- "lightseagreen",
18636
- "forestgreen",
18637
- "goldenrod",
18638
- "dodgerblue",
18639
- "darkorchid",
18640
- "crimson"
18641
- ];
18642
- function useColors() {
18643
- if (typeof window !== "undefined" && window.process && window.process.type === "renderer") {
18644
- return true;
18645
- }
18646
- return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
18647
- typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
18648
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
18649
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
18650
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
18651
- }
18652
- __name(useColors, "useColors");
18653
- exports2.formatters.j = function(v) {
18654
- try {
18655
- return JSON.stringify(v);
18656
- } catch (err) {
18657
- return "[UnexpectedJSONParseError]: " + err.message;
18658
- }
18659
- };
18660
- function formatArgs(args) {
18661
- var useColors2 = this.useColors;
18662
- args[0] = (useColors2 ? "%c" : "") + this.namespace + (useColors2 ? " %c" : " ") + args[0] + (useColors2 ? "%c " : " ") + "+" + exports2.humanize(this.diff);
18663
- if (!useColors2) return;
18664
- var c = "color: " + this.color;
18665
- args.splice(1, 0, c, "color: inherit");
18666
- var index = 0;
18667
- var lastC = 0;
18668
- args[0].replace(/%[a-zA-Z%]/g, function(match) {
18669
- if ("%%" === match) return;
18670
- index++;
18671
- if ("%c" === match) {
18672
- lastC = index;
18673
- }
18674
- });
18675
- args.splice(lastC, 0, c);
18676
- }
18677
- __name(formatArgs, "formatArgs");
18678
- function log() {
18679
- return "object" === typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments);
18680
- }
18681
- __name(log, "log");
18682
- function save(namespaces) {
18683
- try {
18684
- if (null == namespaces) {
18685
- exports2.storage.removeItem("debug");
18686
- } else {
18687
- exports2.storage.debug = namespaces;
18688
- }
18689
- } catch (e) {
18690
- }
18691
- }
18692
- __name(save, "save");
18693
- function load() {
18694
- var r;
18695
- try {
18696
- r = exports2.storage.debug;
18697
- } catch (e) {
18698
- }
18699
- if (!r && typeof process !== "undefined" && "env" in process) {
18700
- r = process.env.DEBUG;
18701
- }
18702
- return r;
18703
- }
18704
- __name(load, "load");
18705
- exports2.enable(load());
18706
- function localstorage() {
18707
- try {
18708
- return window.localStorage;
18709
- } catch (e) {
18710
- }
18711
- }
18712
- __name(localstorage, "localstorage");
18713
- }
18714
- });
18715
-
18716
- // ../../../node_modules/express/node_modules/debug/src/node.js
18717
- var require_node3 = __commonJS({
18718
- "../../../node_modules/express/node_modules/debug/src/node.js"(exports2, module2) {
18719
- "use strict";
18720
- var tty = require("tty");
18721
- var util = require("util");
18722
- exports2 = module2.exports = require_debug3();
18723
- exports2.init = init;
18724
- exports2.log = log;
18725
- exports2.formatArgs = formatArgs;
18726
- exports2.save = save;
18727
- exports2.load = load;
18728
- exports2.useColors = useColors;
18729
- exports2.colors = [
18730
- 6,
18731
- 2,
18732
- 3,
18733
- 4,
18734
- 5,
18735
- 1
18736
- ];
18737
- exports2.inspectOpts = Object.keys(process.env).filter(function(key) {
18738
- return /^debug_/i.test(key);
18739
- }).reduce(function(obj, key) {
18740
- var prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, function(_, k) {
18741
- return k.toUpperCase();
18742
- });
18743
- var val = process.env[key];
18744
- if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
18745
- else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
18746
- else if (val === "null") val = null;
18747
- else val = Number(val);
18748
- obj[prop] = val;
18749
- return obj;
18750
- }, {});
18751
- var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
18752
- if (1 !== fd && 2 !== fd) {
18753
- util.deprecate(function() {
18754
- }, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
18755
- }
18756
- var stream = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
18757
- function useColors() {
18758
- return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(fd);
18759
- }
18760
- __name(useColors, "useColors");
18761
- exports2.formatters.o = function(v) {
18762
- this.inspectOpts.colors = this.useColors;
18763
- return util.inspect(v, this.inspectOpts).split("\n").map(function(str) {
18764
- return str.trim();
18765
- }).join(" ");
18766
- };
18767
- exports2.formatters.O = function(v) {
18768
- this.inspectOpts.colors = this.useColors;
18769
- return util.inspect(v, this.inspectOpts);
18770
- };
18771
- function formatArgs(args) {
18772
- var name = this.namespace;
18773
- var useColors2 = this.useColors;
18774
- if (useColors2) {
18775
- var c = this.color;
18776
- var prefix = " \x1B[3" + c + ";1m" + name + " \x1B[0m";
18777
- args[0] = prefix + args[0].split("\n").join("\n" + prefix);
18778
- args.push("\x1B[3" + c + "m+" + exports2.humanize(this.diff) + "\x1B[0m");
18779
- } else {
18780
- args[0] = (/* @__PURE__ */ new Date()).toUTCString() + " " + name + " " + args[0];
18781
- }
18782
- }
18783
- __name(formatArgs, "formatArgs");
18784
- function log() {
18785
- return stream.write(util.format.apply(util, arguments) + "\n");
18786
- }
18787
- __name(log, "log");
18788
- function save(namespaces) {
18789
- if (null == namespaces) {
18790
- delete process.env.DEBUG;
18791
- } else {
18792
- process.env.DEBUG = namespaces;
18793
- }
18794
- }
18795
- __name(save, "save");
18796
- function load() {
18797
- return process.env.DEBUG;
18798
- }
18799
- __name(load, "load");
18800
- function createWritableStdioStream(fd2) {
18801
- var stream2;
18802
- var tty_wrap = process.binding("tty_wrap");
18803
- switch (tty_wrap.guessHandleType(fd2)) {
18804
- case "TTY":
18805
- stream2 = new tty.WriteStream(fd2);
18806
- stream2._type = "tty";
18807
- if (stream2._handle && stream2._handle.unref) {
18808
- stream2._handle.unref();
18809
- }
18810
- break;
18811
- case "FILE":
18812
- var fs2 = require("fs");
18813
- stream2 = new fs2.SyncWriteStream(fd2, {
18814
- autoClose: false
18815
- });
18816
- stream2._type = "fs";
18817
- break;
18818
- case "PIPE":
18819
- case "TCP":
18820
- var net = require("net");
18821
- stream2 = new net.Socket({
18822
- fd: fd2,
18823
- readable: false,
18824
- writable: true
18825
- });
18826
- stream2.readable = false;
18827
- stream2.read = null;
18828
- stream2._type = "pipe";
18829
- if (stream2._handle && stream2._handle.unref) {
18830
- stream2._handle.unref();
18831
- }
18832
- break;
18833
- default:
18834
- throw new Error("Implement me. Unknown stream file type!");
18835
- }
18836
- stream2.fd = fd2;
18837
- stream2._isStdio = true;
18838
- return stream2;
18839
- }
18840
- __name(createWritableStdioStream, "createWritableStdioStream");
18841
- function init(debug) {
18842
- debug.inspectOpts = {};
18843
- var keys = Object.keys(exports2.inspectOpts);
18844
- for (var i = 0; i < keys.length; i++) {
18845
- debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
18846
- }
18847
- }
18848
- __name(init, "init");
18849
- exports2.enable(load());
18850
- }
18851
- });
18852
-
18853
- // ../../../node_modules/express/node_modules/debug/src/index.js
18854
- var require_src3 = __commonJS({
18855
- "../../../node_modules/express/node_modules/debug/src/index.js"(exports2, module2) {
18856
- "use strict";
18857
- if (typeof process !== "undefined" && process.type === "renderer") {
18858
- module2.exports = require_browser3();
18859
- } else {
18860
- module2.exports = require_node3();
18861
- }
18862
- }
18863
- });
18864
-
18865
18335
  // ../../../node_modules/array-flatten/array-flatten.js
18866
18336
  var require_array_flatten = __commonJS({
18867
18337
  "../../../node_modules/array-flatten/array-flatten.js"(exports2, module2) {
@@ -19011,7 +18481,7 @@ var require_layer = __commonJS({
19011
18481
  "../../../node_modules/express/lib/router/layer.js"(exports2, module2) {
19012
18482
  "use strict";
19013
18483
  var pathRegexp = require_path_to_regexp();
19014
- var debug = require_src3()("express:router:layer");
18484
+ var debug = require_src()("express:router:layer");
19015
18485
  var hasOwnProperty = Object.prototype.hasOwnProperty;
19016
18486
  module2.exports = Layer;
19017
18487
  function Layer(path2, options, fn) {
@@ -19155,7 +18625,7 @@ var require_methods = __commonJS({
19155
18625
  var require_route = __commonJS({
19156
18626
  "../../../node_modules/express/lib/router/route.js"(exports2, module2) {
19157
18627
  "use strict";
19158
- var debug = require_src3()("express:router:route");
18628
+ var debug = require_src()("express:router:route");
19159
18629
  var flatten = require_array_flatten();
19160
18630
  var Layer = require_layer();
19161
18631
  var methods = require_methods();
@@ -19288,7 +18758,7 @@ var require_router = __commonJS({
19288
18758
  var Layer = require_layer();
19289
18759
  var methods = require_methods();
19290
18760
  var mixin = require_utils_merge();
19291
- var debug = require_src3()("express:router");
18761
+ var debug = require_src()("express:router");
19292
18762
  var deprecate = require_depd()("express");
19293
18763
  var flatten = require_array_flatten();
19294
18764
  var parseUrl = require_parseurl();
@@ -19729,7 +19199,7 @@ var require_query = __commonJS({
19729
19199
  var require_view = __commonJS({
19730
19200
  "../../../node_modules/express/lib/view.js"(exports2, module2) {
19731
19201
  "use strict";
19732
- var debug = require_src3()("express:view");
19202
+ var debug = require_src()("express:view");
19733
19203
  var path2 = require("path");
19734
19204
  var fs2 = require("fs");
19735
19205
  var dirname = path2.dirname;
@@ -19868,9 +19338,9 @@ var require_safe_buffer = __commonJS({
19868
19338
  }
19869
19339
  });
19870
19340
 
19871
- // ../../../node_modules/express/node_modules/content-disposition/index.js
19341
+ // ../../../node_modules/content-disposition/index.js
19872
19342
  var require_content_disposition = __commonJS({
19873
- "../../../node_modules/express/node_modules/content-disposition/index.js"(exports2, module2) {
19343
+ "../../../node_modules/content-disposition/index.js"(exports2, module2) {
19874
19344
  "use strict";
19875
19345
  module2.exports = contentDisposition;
19876
19346
  module2.exports.parse = parse;
@@ -20043,7 +19513,7 @@ var require_content_disposition = __commonJS({
20043
19513
  });
20044
19514
 
20045
19515
  // ../../../node_modules/send/node_modules/debug/node_modules/ms/index.js
20046
- var require_ms4 = __commonJS({
19516
+ var require_ms3 = __commonJS({
20047
19517
  "../../../node_modules/send/node_modules/debug/node_modules/ms/index.js"(exports2, module2) {
20048
19518
  "use strict";
20049
19519
  var s = 1e3;
@@ -20146,7 +19616,7 @@ var require_ms4 = __commonJS({
20146
19616
  });
20147
19617
 
20148
19618
  // ../../../node_modules/send/node_modules/debug/src/debug.js
20149
- var require_debug4 = __commonJS({
19619
+ var require_debug3 = __commonJS({
20150
19620
  "../../../node_modules/send/node_modules/debug/src/debug.js"(exports2, module2) {
20151
19621
  "use strict";
20152
19622
  exports2 = module2.exports = createDebug.debug = createDebug["default"] = createDebug;
@@ -20154,7 +19624,7 @@ var require_debug4 = __commonJS({
20154
19624
  exports2.disable = disable;
20155
19625
  exports2.enable = enable;
20156
19626
  exports2.enabled = enabled;
20157
- exports2.humanize = require_ms4();
19627
+ exports2.humanize = require_ms3();
20158
19628
  exports2.names = [];
20159
19629
  exports2.skips = [];
20160
19630
  exports2.formatters = {};
@@ -20259,10 +19729,10 @@ var require_debug4 = __commonJS({
20259
19729
  });
20260
19730
 
20261
19731
  // ../../../node_modules/send/node_modules/debug/src/browser.js
20262
- var require_browser4 = __commonJS({
19732
+ var require_browser3 = __commonJS({
20263
19733
  "../../../node_modules/send/node_modules/debug/src/browser.js"(exports2, module2) {
20264
19734
  "use strict";
20265
- exports2 = module2.exports = require_debug4();
19735
+ exports2 = module2.exports = require_debug3();
20266
19736
  exports2.log = log;
20267
19737
  exports2.formatArgs = formatArgs;
20268
19738
  exports2.save = save;
@@ -20352,12 +19822,12 @@ var require_browser4 = __commonJS({
20352
19822
  });
20353
19823
 
20354
19824
  // ../../../node_modules/send/node_modules/debug/src/node.js
20355
- var require_node4 = __commonJS({
19825
+ var require_node3 = __commonJS({
20356
19826
  "../../../node_modules/send/node_modules/debug/src/node.js"(exports2, module2) {
20357
19827
  "use strict";
20358
19828
  var tty = require("tty");
20359
19829
  var util = require("util");
20360
- exports2 = module2.exports = require_debug4();
19830
+ exports2 = module2.exports = require_debug3();
20361
19831
  exports2.init = init;
20362
19832
  exports2.log = log;
20363
19833
  exports2.formatArgs = formatArgs;
@@ -20489,13 +19959,13 @@ var require_node4 = __commonJS({
20489
19959
  });
20490
19960
 
20491
19961
  // ../../../node_modules/send/node_modules/debug/src/index.js
20492
- var require_src4 = __commonJS({
19962
+ var require_src3 = __commonJS({
20493
19963
  "../../../node_modules/send/node_modules/debug/src/index.js"(exports2, module2) {
20494
19964
  "use strict";
20495
19965
  if (typeof process !== "undefined" && process.type === "renderer") {
20496
- module2.exports = require_browser4();
19966
+ module2.exports = require_browser3();
20497
19967
  } else {
20498
- module2.exports = require_node4();
19968
+ module2.exports = require_node3();
20499
19969
  }
20500
19970
  }
20501
19971
  });
@@ -20686,7 +20156,7 @@ var require_mime = __commonJS({
20686
20156
  });
20687
20157
 
20688
20158
  // ../../../node_modules/ms/index.js
20689
- var require_ms5 = __commonJS({
20159
+ var require_ms4 = __commonJS({
20690
20160
  "../../../node_modules/ms/index.js"(exports2, module2) {
20691
20161
  "use strict";
20692
20162
  var s = 1e3;
@@ -20894,7 +20364,7 @@ var require_send = __commonJS({
20894
20364
  "../../../node_modules/send/index.js"(exports2, module2) {
20895
20365
  "use strict";
20896
20366
  var createError = require_http_errors();
20897
- var debug = require_src4()("send");
20367
+ var debug = require_src3()("send");
20898
20368
  var deprecate = require_depd()("send");
20899
20369
  var destroy = require_destroy();
20900
20370
  var encodeUrl = require_encodeurl();
@@ -20903,7 +20373,7 @@ var require_send = __commonJS({
20903
20373
  var fresh = require_fresh();
20904
20374
  var fs2 = require("fs");
20905
20375
  var mime = require_mime();
20906
- var ms = require_ms5();
20376
+ var ms = require_ms4();
20907
20377
  var onFinished = require_on_finished();
20908
20378
  var parseRange = require_range_parser();
20909
20379
  var path2 = require("path");
@@ -22773,7 +22243,7 @@ var require_application = __commonJS({
22773
22243
  var methods = require_methods();
22774
22244
  var middleware = require_init();
22775
22245
  var query = require_query();
22776
- var debug = require_src3()("express:application");
22246
+ var debug = require_src()("express:application");
22777
22247
  var View = require_view();
22778
22248
  var http = require("http");
22779
22249
  var compileETag = require_utils2().compileETag;
@@ -32472,9 +31942,9 @@ var require_request = __commonJS({
32472
31942
  }
32473
31943
  });
32474
31944
 
32475
- // ../../../node_modules/cookie-signature/index.js
31945
+ // ../../../node_modules/express/node_modules/cookie-signature/index.js
32476
31946
  var require_cookie_signature = __commonJS({
32477
- "../../../node_modules/cookie-signature/index.js"(exports2) {
31947
+ "../../../node_modules/express/node_modules/cookie-signature/index.js"(exports2) {
32478
31948
  "use strict";
32479
31949
  var crypto3 = require("crypto");
32480
31950
  exports2.sign = function(val, secret) {
@@ -33508,6 +32978,7 @@ __export(index_exports, {
33508
32978
  DevToolsModule: () => import_nestjs_openapi_devtools2.DevToolsModule,
33509
32979
  DevToolsV2Module: () => import_nestjs_openapi_devtools2.DevToolsV2Module,
33510
32980
  FileService: () => FileService,
32981
+ LegacyPathRedirectMiddleware: () => LegacyPathRedirectMiddleware,
33511
32982
  PlatformHttpClientService: () => PlatformHttpClientService,
33512
32983
  PlatformModule: () => PlatformModule,
33513
32984
  StaticModule: () => StaticModule,
@@ -33518,7 +32989,7 @@ __export(index_exports, {
33518
32989
  module.exports = __toCommonJS(index_exports);
33519
32990
 
33520
32991
  // src/modules/platform/module.ts
33521
- var import_common12 = require("@nestjs/common");
32992
+ var import_common13 = require("@nestjs/common");
33522
32993
  var import_core2 = require("@nestjs/core");
33523
32994
  var import_nestjs_common5 = require("@lark-apaas/nestjs-common");
33524
32995
  var import_config2 = require("@nestjs/config");
@@ -34099,10 +33570,8 @@ FrameworkDebugMiddleware = _ts_decorate7([
34099
33570
  ])
34100
33571
  ], FrameworkDebugMiddleware);
34101
33572
 
34102
- // src/services/platform-http-client.service.ts
33573
+ // src/middlewares/legacy-path-redirect/index.ts
34103
33574
  var import_common8 = require("@nestjs/common");
34104
- var import_http_client = require("@lark-apaas/http-client");
34105
- var import_nestjs_common3 = require("@lark-apaas/nestjs-common");
34106
33575
  function _ts_decorate8(decorators, target, key, desc) {
34107
33576
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34108
33577
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -34110,6 +33579,50 @@ function _ts_decorate8(decorators, target, key, desc) {
34110
33579
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34111
33580
  }
34112
33581
  __name(_ts_decorate8, "_ts_decorate");
33582
+ var OLD_PATH_PREFIX = {
33583
+ preview: "/af/p",
33584
+ runtime: "/spark/faas"
33585
+ };
33586
+ var LegacyPathRedirectMiddleware = class {
33587
+ static {
33588
+ __name(this, "LegacyPathRedirectMiddleware");
33589
+ }
33590
+ use(req, res, next) {
33591
+ const basePath = process.env.CLIENT_BASE_PATH ?? "";
33592
+ if (!/^\/app\/[^/]/.test(basePath)) {
33593
+ return next();
33594
+ }
33595
+ if (req.path.startsWith("/api")) {
33596
+ return next();
33597
+ }
33598
+ const { appId, env } = req.userContext ?? {};
33599
+ if (!appId || !env) {
33600
+ return next();
33601
+ }
33602
+ const oldPrefix = `${OLD_PATH_PREFIX[env]}/${appId}`;
33603
+ if (!req.path.startsWith(oldPrefix)) {
33604
+ return next();
33605
+ }
33606
+ const pathSuffix = req.path.slice(oldPrefix.length) || "/";
33607
+ const querySuffix = req.originalUrl.slice(req.path.length);
33608
+ return res.redirect(302, `${basePath}${pathSuffix}${querySuffix}`);
33609
+ }
33610
+ };
33611
+ LegacyPathRedirectMiddleware = _ts_decorate8([
33612
+ (0, import_common8.Injectable)()
33613
+ ], LegacyPathRedirectMiddleware);
33614
+
33615
+ // src/services/platform-http-client.service.ts
33616
+ var import_common9 = require("@nestjs/common");
33617
+ var import_http_client = require("@lark-apaas/http-client");
33618
+ var import_nestjs_common3 = require("@lark-apaas/nestjs-common");
33619
+ function _ts_decorate9(decorators, target, key, desc) {
33620
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
33621
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
33622
+ 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;
33623
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
33624
+ }
33625
+ __name(_ts_decorate9, "_ts_decorate");
34113
33626
  function _ts_metadata5(k, v) {
34114
33627
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34115
33628
  }
@@ -34148,7 +33661,7 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
34148
33661
  requestContext;
34149
33662
  client;
34150
33663
  protectedClient;
34151
- logger = new import_common8.Logger(_PlatformHttpClientService.name);
33664
+ logger = new import_common9.Logger(_PlatformHttpClientService.name);
34152
33665
  constructor(requestContext) {
34153
33666
  this.requestContext = requestContext;
34154
33667
  const baseConfig = {
@@ -34304,8 +33817,8 @@ var PlatformHttpClientService = class _PlatformHttpClientService {
34304
33817
  });
34305
33818
  }
34306
33819
  };
34307
- PlatformHttpClientService = _ts_decorate8([
34308
- (0, import_common8.Injectable)(),
33820
+ PlatformHttpClientService = _ts_decorate9([
33821
+ (0, import_common9.Injectable)(),
34309
33822
  _ts_metadata5("design:type", Function),
34310
33823
  _ts_metadata5("design:paramtypes", [
34311
33824
  typeof import_nestjs_common3.RequestContextService === "undefined" ? Object : import_nestjs_common3.RequestContextService
@@ -34316,16 +33829,16 @@ PlatformHttpClientService = _ts_decorate8([
34316
33829
  var DISABLE_DATAPASS = process.env.FORCE_FRAMEWORK_DISABLE_DATAPASS === "true";
34317
33830
 
34318
33831
  // src/services/file.service.ts
34319
- var import_common9 = require("@nestjs/common");
33832
+ var import_common10 = require("@nestjs/common");
34320
33833
  var import_nestjs_common4 = require("@lark-apaas/nestjs-common");
34321
33834
  var import_file_service = require("@lark-apaas/file-service");
34322
- function _ts_decorate9(decorators, target, key, desc) {
33835
+ function _ts_decorate10(decorators, target, key, desc) {
34323
33836
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34324
33837
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34325
33838
  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;
34326
33839
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34327
33840
  }
34328
- __name(_ts_decorate9, "_ts_decorate");
33841
+ __name(_ts_decorate10, "_ts_decorate");
34329
33842
  function _ts_metadata6(k, v) {
34330
33843
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34331
33844
  }
@@ -34350,7 +33863,7 @@ var FileService = class {
34350
33863
  this.httpClient = httpClient;
34351
33864
  this.observable = observable;
34352
33865
  this.fileServiceCore = new import_file_service.FileService(this.httpClient);
34353
- this.nestLogger = new import_common9.Logger("file");
33866
+ this.nestLogger = new import_common10.Logger("file");
34354
33867
  }
34355
33868
  /**
34356
33869
  * 返回一个绑定了指定 bucket 的代理对象
@@ -34690,10 +34203,10 @@ var FileService = class {
34690
34203
  }
34691
34204
  }
34692
34205
  };
34693
- FileService = _ts_decorate9([
34694
- (0, import_common9.Injectable)(),
34695
- _ts_param2(1, (0, import_common9.Inject)(import_nestjs_common4.PLATFORM_HTTP_CLIENT)),
34696
- _ts_param2(2, (0, import_common9.Inject)(import_nestjs_common4.OBSERVABLE_SERVICE)),
34206
+ FileService = _ts_decorate10([
34207
+ (0, import_common10.Injectable)(),
34208
+ _ts_param2(1, (0, import_common10.Inject)(import_nestjs_common4.PLATFORM_HTTP_CLIENT)),
34209
+ _ts_param2(2, (0, import_common10.Inject)(import_nestjs_common4.OBSERVABLE_SERVICE)),
34697
34210
  _ts_metadata6("design:type", Function),
34698
34211
  _ts_metadata6("design:paramtypes", [
34699
34212
  typeof import_nestjs_common4.RequestContextService === "undefined" ? Object : import_nestjs_common4.RequestContextService,
@@ -34706,21 +34219,21 @@ FileService = _ts_decorate9([
34706
34219
  var import_nestjs_authzpaas = require("@lark-apaas/nestjs-authzpaas");
34707
34220
 
34708
34221
  // src/modules/static/static.module.ts
34709
- var import_common11 = require("@nestjs/common");
34222
+ var import_common12 = require("@nestjs/common");
34710
34223
 
34711
34224
  // src/modules/static/static.controller.ts
34712
- var import_common10 = require("@nestjs/common");
34225
+ var import_common11 = require("@nestjs/common");
34713
34226
  var import_swagger = require("@nestjs/swagger");
34714
34227
  var fs = __toESM(require("fs"), 1);
34715
34228
  var path = __toESM(require("path"), 1);
34716
34229
  var crypto2 = __toESM(require("crypto"), 1);
34717
- function _ts_decorate10(decorators, target, key, desc) {
34230
+ function _ts_decorate11(decorators, target, key, desc) {
34718
34231
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34719
34232
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34720
34233
  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;
34721
34234
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34722
34235
  }
34723
- __name(_ts_decorate10, "_ts_decorate");
34236
+ __name(_ts_decorate11, "_ts_decorate");
34724
34237
  function _ts_metadata7(k, v) {
34725
34238
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
34726
34239
  }
@@ -34788,7 +34301,7 @@ var StaticController = class _StaticController {
34788
34301
  static {
34789
34302
  __name(this, "StaticController");
34790
34303
  }
34791
- logger = new import_common10.Logger(_StaticController.name);
34304
+ logger = new import_common11.Logger(_StaticController.name);
34792
34305
  staticDir;
34793
34306
  constructor() {
34794
34307
  this.staticDir = path.resolve(process.cwd(), "../shared/static");
@@ -34809,7 +34322,7 @@ var StaticController = class _StaticController {
34809
34322
  try {
34810
34323
  const relativePath = params["0"] || params["*"] || "";
34811
34324
  if (!relativePath) {
34812
- res.status(import_common10.HttpStatus.BAD_REQUEST).json({
34325
+ res.status(import_common11.HttpStatus.BAD_REQUEST).json({
34813
34326
  error: "Bad Request",
34814
34327
  message: "File path is required"
34815
34328
  });
@@ -34819,14 +34332,14 @@ var StaticController = class _StaticController {
34819
34332
  const normalizedPath = path.normalize(filePath);
34820
34333
  if (!normalizedPath.startsWith(this.staticDir)) {
34821
34334
  this.logger.warn(`Path traversal attempt detected: ${relativePath}`);
34822
- res.status(import_common10.HttpStatus.FORBIDDEN).json({
34335
+ res.status(import_common11.HttpStatus.FORBIDDEN).json({
34823
34336
  error: "Forbidden",
34824
34337
  message: "Access denied"
34825
34338
  });
34826
34339
  return;
34827
34340
  }
34828
34341
  if (!fs.existsSync(normalizedPath)) {
34829
- res.status(import_common10.HttpStatus.NOT_FOUND).json({
34342
+ res.status(import_common11.HttpStatus.NOT_FOUND).json({
34830
34343
  error: "Not Found",
34831
34344
  message: "File not found"
34832
34345
  });
@@ -34834,7 +34347,7 @@ var StaticController = class _StaticController {
34834
34347
  }
34835
34348
  const stat = fs.statSync(normalizedPath);
34836
34349
  if (stat.isDirectory()) {
34837
- res.status(import_common10.HttpStatus.FORBIDDEN).json({
34350
+ res.status(import_common11.HttpStatus.FORBIDDEN).json({
34838
34351
  error: "Forbidden",
34839
34352
  message: "Directory listing not allowed"
34840
34353
  });
@@ -34844,7 +34357,7 @@ var StaticController = class _StaticController {
34844
34357
  const etag = generateETag(stat);
34845
34358
  const ifNoneMatch = req.headers["if-none-match"];
34846
34359
  if (ifNoneMatch === etag) {
34847
- res.status(import_common10.HttpStatus.NOT_MODIFIED).end();
34360
+ res.status(import_common11.HttpStatus.NOT_MODIFIED).end();
34848
34361
  return;
34849
34362
  }
34850
34363
  res.setHeader("Content-Type", mimeType);
@@ -34855,7 +34368,7 @@ var StaticController = class _StaticController {
34855
34368
  stream.on("error", (error) => {
34856
34369
  this.logger.error(`Error streaming file: ${relativePath}`, error);
34857
34370
  if (!res.headersSent) {
34858
- res.status(import_common10.HttpStatus.INTERNAL_SERVER_ERROR).json({
34371
+ res.status(import_common11.HttpStatus.INTERNAL_SERVER_ERROR).json({
34859
34372
  error: "Internal Server Error",
34860
34373
  message: "Failed to read file"
34861
34374
  });
@@ -34865,7 +34378,7 @@ var StaticController = class _StaticController {
34865
34378
  } catch (error) {
34866
34379
  this.logger.error("Error serving static file", error);
34867
34380
  if (!res.headersSent) {
34868
- res.status(import_common10.HttpStatus.INTERNAL_SERVER_ERROR).json({
34381
+ res.status(import_common11.HttpStatus.INTERNAL_SERVER_ERROR).json({
34869
34382
  error: "Internal Server Error",
34870
34383
  message: "An unexpected error occurred"
34871
34384
  });
@@ -34873,11 +34386,11 @@ var StaticController = class _StaticController {
34873
34386
  }
34874
34387
  }
34875
34388
  };
34876
- _ts_decorate10([
34877
- (0, import_common10.Get)("*"),
34878
- _ts_param3(0, (0, import_common10.Param)()),
34879
- _ts_param3(1, (0, import_common10.Req)()),
34880
- _ts_param3(2, (0, import_common10.Res)()),
34389
+ _ts_decorate11([
34390
+ (0, import_common11.Get)("*"),
34391
+ _ts_param3(0, (0, import_common11.Param)()),
34392
+ _ts_param3(1, (0, import_common11.Req)()),
34393
+ _ts_param3(2, (0, import_common11.Res)()),
34881
34394
  _ts_metadata7("design:type", Function),
34882
34395
  _ts_metadata7("design:paramtypes", [
34883
34396
  typeof Record === "undefined" ? Object : Record,
@@ -34886,28 +34399,28 @@ _ts_decorate10([
34886
34399
  ]),
34887
34400
  _ts_metadata7("design:returntype", void 0)
34888
34401
  ], StaticController.prototype, "serveFile", null);
34889
- StaticController = _ts_decorate10([
34402
+ StaticController = _ts_decorate11([
34890
34403
  (0, import_swagger.ApiExcludeController)(),
34891
- (0, import_common10.Controller)("static"),
34404
+ (0, import_common11.Controller)("static"),
34892
34405
  _ts_metadata7("design:type", Function),
34893
34406
  _ts_metadata7("design:paramtypes", [])
34894
34407
  ], StaticController);
34895
34408
 
34896
34409
  // src/modules/static/static.module.ts
34897
- function _ts_decorate11(decorators, target, key, desc) {
34410
+ function _ts_decorate12(decorators, target, key, desc) {
34898
34411
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34899
34412
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34900
34413
  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;
34901
34414
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34902
34415
  }
34903
- __name(_ts_decorate11, "_ts_decorate");
34416
+ __name(_ts_decorate12, "_ts_decorate");
34904
34417
  var StaticModule = class {
34905
34418
  static {
34906
34419
  __name(this, "StaticModule");
34907
34420
  }
34908
34421
  };
34909
- StaticModule = _ts_decorate11([
34910
- (0, import_common11.Module)({
34422
+ StaticModule = _ts_decorate12([
34423
+ (0, import_common12.Module)({
34911
34424
  controllers: [
34912
34425
  StaticController
34913
34426
  ]
@@ -34915,13 +34428,13 @@ StaticModule = _ts_decorate11([
34915
34428
  ], StaticModule);
34916
34429
 
34917
34430
  // src/modules/platform/module.ts
34918
- function _ts_decorate12(decorators, target, key, desc) {
34431
+ function _ts_decorate13(decorators, target, key, desc) {
34919
34432
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
34920
34433
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
34921
34434
  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;
34922
34435
  return c > 3 && r && Object.defineProperty(target, key, r), r;
34923
34436
  }
34924
- __name(_ts_decorate12, "_ts_decorate");
34437
+ __name(_ts_decorate13, "_ts_decorate");
34925
34438
  var PLATFORM_MODULE_OPTIONS = /* @__PURE__ */ Symbol("PLATFORM_MODULE_OPTIONS");
34926
34439
  var PlatformModule = class _PlatformModule {
34927
34440
  static {
@@ -35001,7 +34514,7 @@ var PlatformModule = class _PlatformModule {
35001
34514
  },
35002
34515
  {
35003
34516
  provide: import_core2.APP_PIPE,
35004
- useValue: new import_common12.ValidationPipe({
34517
+ useValue: new import_common13.ValidationPipe({
35005
34518
  transform: true,
35006
34519
  transformOptions: {
35007
34520
  enableImplicitConversion: true
@@ -35061,6 +34574,7 @@ var PlatformModule = class _PlatformModule {
35061
34574
  consumer.apply(UserContextMiddleware, RequestContextMiddleware, import_nestjs_logger2.LoggerContextMiddleware, import_nestjs_observable.ObservableTraceMiddleware, ...DISABLE_DATAPASS ? [] : [
35062
34575
  import_nestjs_datapaas.SqlExecutionContextMiddleware
35063
34576
  ]).forRoutes("/*");
34577
+ consumer.apply(LegacyPathRedirectMiddleware).forRoutes("/*");
35064
34578
  consumer.apply(CsrfTokenMiddleware, ViewContextMiddleware).exclude("/api/(.*)", "/static/(.*)").forRoutes("*");
35065
34579
  if (options.enableCsrf !== false) {
35066
34580
  const csrfRoutes = options.csrfRoutes || "/api/*";
@@ -35074,9 +34588,9 @@ var PlatformModule = class _PlatformModule {
35074
34588
  }
35075
34589
  }
35076
34590
  };
35077
- PlatformModule = _ts_decorate12([
35078
- (0, import_common12.Global)(),
35079
- (0, import_common12.Module)({})
34591
+ PlatformModule = _ts_decorate13([
34592
+ (0, import_common13.Global)(),
34593
+ (0, import_common13.Module)({})
35080
34594
  ], PlatformModule);
35081
34595
 
35082
34596
  // src/setup.ts
@@ -35137,6 +34651,7 @@ var import_nestjs_authzpaas2 = require("@lark-apaas/nestjs-authzpaas");
35137
34651
  DevToolsModule,
35138
34652
  DevToolsV2Module,
35139
34653
  FileService,
34654
+ LegacyPathRedirectMiddleware,
35140
34655
  PlatformHttpClientService,
35141
34656
  PlatformModule,
35142
34657
  StaticModule,