@lark-apaas/fullstack-nestjs-core 1.1.68 → 1.1.69

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
@@ -14779,7 +14779,7 @@ var require_object_inspect = __commonJS({
14779
14779
  } else if (indexOf(seen, obj) >= 0) {
14780
14780
  return "[Circular]";
14781
14781
  }
14782
- function inspect(value, from, noIndent) {
14782
+ function inspect2(value, from, noIndent) {
14783
14783
  if (from) {
14784
14784
  seen = $arrSlice.call(seen);
14785
14785
  seen.push(from);
@@ -14795,10 +14795,10 @@ var require_object_inspect = __commonJS({
14795
14795
  }
14796
14796
  return inspect_(value, opts, depth + 1, seen);
14797
14797
  }
14798
- __name(inspect, "inspect");
14798
+ __name(inspect2, "inspect");
14799
14799
  if (typeof obj === "function" && !isRegExp(obj)) {
14800
14800
  var name = nameOf(obj);
14801
- var keys = arrObjKeys(obj, inspect);
14801
+ var keys = arrObjKeys(obj, inspect2);
14802
14802
  return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
14803
14803
  }
14804
14804
  if (isSymbol(obj)) {
@@ -14822,16 +14822,16 @@ var require_object_inspect = __commonJS({
14822
14822
  if (obj.length === 0) {
14823
14823
  return "[]";
14824
14824
  }
14825
- var xs = arrObjKeys(obj, inspect);
14825
+ var xs = arrObjKeys(obj, inspect2);
14826
14826
  if (indent && !singleLineValues(xs)) {
14827
14827
  return "[" + indentedJoin(xs, indent) + "]";
14828
14828
  }
14829
14829
  return "[ " + $join.call(xs, ", ") + " ]";
14830
14830
  }
14831
14831
  if (isError(obj)) {
14832
- var parts = arrObjKeys(obj, inspect);
14832
+ var parts = arrObjKeys(obj, inspect2);
14833
14833
  if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
14834
- return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
14834
+ return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }";
14835
14835
  }
14836
14836
  if (parts.length === 0) {
14837
14837
  return "[" + String(obj) + "]";
@@ -14851,7 +14851,7 @@ var require_object_inspect = __commonJS({
14851
14851
  var mapParts = [];
14852
14852
  if (mapForEach) {
14853
14853
  mapForEach.call(obj, function(value, key) {
14854
- mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
14854
+ mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value, obj));
14855
14855
  });
14856
14856
  }
14857
14857
  return collectionOf("Map", mapSize.call(obj), mapParts, indent);
@@ -14860,7 +14860,7 @@ var require_object_inspect = __commonJS({
14860
14860
  var setParts = [];
14861
14861
  if (setForEach) {
14862
14862
  setForEach.call(obj, function(value) {
14863
- setParts.push(inspect(value, obj));
14863
+ setParts.push(inspect2(value, obj));
14864
14864
  });
14865
14865
  }
14866
14866
  return collectionOf("Set", setSize.call(obj), setParts, indent);
@@ -14875,16 +14875,16 @@ var require_object_inspect = __commonJS({
14875
14875
  return weakCollectionOf("WeakRef");
14876
14876
  }
14877
14877
  if (isNumber(obj)) {
14878
- return markBoxed(inspect(Number(obj)));
14878
+ return markBoxed(inspect2(Number(obj)));
14879
14879
  }
14880
14880
  if (isBigInt(obj)) {
14881
- return markBoxed(inspect(bigIntValueOf.call(obj)));
14881
+ return markBoxed(inspect2(bigIntValueOf.call(obj)));
14882
14882
  }
14883
14883
  if (isBoolean(obj)) {
14884
14884
  return markBoxed(booleanValueOf.call(obj));
14885
14885
  }
14886
14886
  if (isString(obj)) {
14887
- return markBoxed(inspect(String(obj)));
14887
+ return markBoxed(inspect2(String(obj)));
14888
14888
  }
14889
14889
  if (typeof window !== "undefined" && obj === window) {
14890
14890
  return "{ [object Window] }";
@@ -14893,7 +14893,7 @@ var require_object_inspect = __commonJS({
14893
14893
  return "{ [object globalThis] }";
14894
14894
  }
14895
14895
  if (!isDate(obj) && !isRegExp(obj)) {
14896
- var ys = arrObjKeys(obj, inspect);
14896
+ var ys = arrObjKeys(obj, inspect2);
14897
14897
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
14898
14898
  var protoTag = obj instanceof Object ? "" : "null prototype";
14899
14899
  var stringTag = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
@@ -15177,13 +15177,13 @@ var require_object_inspect = __commonJS({
15177
15177
  return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
15178
15178
  }
15179
15179
  __name(indentedJoin, "indentedJoin");
15180
- function arrObjKeys(obj, inspect) {
15180
+ function arrObjKeys(obj, inspect2) {
15181
15181
  var isArr = isArray(obj);
15182
15182
  var xs = [];
15183
15183
  if (isArr) {
15184
15184
  xs.length = obj.length;
15185
15185
  for (var i = 0; i < obj.length; i++) {
15186
- xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
15186
+ xs[i] = has(obj, i) ? inspect2(obj[i], obj) : "";
15187
15187
  }
15188
15188
  }
15189
15189
  var syms = typeof gOPS === "function" ? gOPS(obj) : [];
@@ -15204,15 +15204,15 @@ var require_object_inspect = __commonJS({
15204
15204
  if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
15205
15205
  continue;
15206
15206
  } else if ($test.call(/[^\w$]/, key)) {
15207
- xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
15207
+ xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj));
15208
15208
  } else {
15209
- xs.push(key + ": " + inspect(obj[key], obj));
15209
+ xs.push(key + ": " + inspect2(obj[key], obj));
15210
15210
  }
15211
15211
  }
15212
15212
  if (typeof gOPS === "function") {
15213
15213
  for (var j = 0; j < syms.length; j++) {
15214
15214
  if (isEnumerable.call(obj, syms[j])) {
15215
- xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
15215
+ xs.push("[" + inspect2(syms[j]) + "]: " + inspect2(obj[syms[j]], obj));
15216
15216
  }
15217
15217
  }
15218
15218
  }
@@ -15226,7 +15226,7 @@ var require_object_inspect = __commonJS({
15226
15226
  var require_side_channel_list = __commonJS({
15227
15227
  "../../../node_modules/side-channel-list/index.js"(exports2, module2) {
15228
15228
  "use strict";
15229
- var inspect = require_object_inspect();
15229
+ var inspect2 = require_object_inspect();
15230
15230
  var $TypeError = require_type();
15231
15231
  var listGetNode = /* @__PURE__ */ __name(function(list, key, isDelete) {
15232
15232
  var prev = list;
@@ -15279,7 +15279,7 @@ var require_side_channel_list = __commonJS({
15279
15279
  var channel = {
15280
15280
  assert: /* @__PURE__ */ __name(function(key) {
15281
15281
  if (!channel.has(key)) {
15282
- throw new $TypeError("Side channel does not contain " + inspect(key));
15282
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
15283
15283
  }
15284
15284
  }, "assert"),
15285
15285
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16340,7 +16340,7 @@ var require_side_channel_map = __commonJS({
16340
16340
  "use strict";
16341
16341
  var GetIntrinsic = require_get_intrinsic();
16342
16342
  var callBound = require_call_bound();
16343
- var inspect = require_object_inspect();
16343
+ var inspect2 = require_object_inspect();
16344
16344
  var $TypeError = require_type();
16345
16345
  var $Map = GetIntrinsic("%Map%", true);
16346
16346
  var $mapGet = callBound("Map.prototype.get", true);
@@ -16354,7 +16354,7 @@ var require_side_channel_map = __commonJS({
16354
16354
  var channel = {
16355
16355
  assert: /* @__PURE__ */ __name(function(key) {
16356
16356
  if (!channel.has(key)) {
16357
- throw new $TypeError("Side channel does not contain " + inspect(key));
16357
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16358
16358
  }
16359
16359
  }, "assert"),
16360
16360
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16396,7 +16396,7 @@ var require_side_channel_weakmap = __commonJS({
16396
16396
  "use strict";
16397
16397
  var GetIntrinsic = require_get_intrinsic();
16398
16398
  var callBound = require_call_bound();
16399
- var inspect = require_object_inspect();
16399
+ var inspect2 = require_object_inspect();
16400
16400
  var getSideChannelMap = require_side_channel_map();
16401
16401
  var $TypeError = require_type();
16402
16402
  var $WeakMap = GetIntrinsic("%WeakMap%", true);
@@ -16412,7 +16412,7 @@ var require_side_channel_weakmap = __commonJS({
16412
16412
  var channel = {
16413
16413
  assert: /* @__PURE__ */ __name(function(key) {
16414
16414
  if (!channel.has(key)) {
16415
- throw new $TypeError("Side channel does not contain " + inspect(key));
16415
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16416
16416
  }
16417
16417
  }, "assert"),
16418
16418
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16468,7 +16468,7 @@ var require_side_channel = __commonJS({
16468
16468
  "../../../node_modules/side-channel/index.js"(exports2, module2) {
16469
16469
  "use strict";
16470
16470
  var $TypeError = require_type();
16471
- var inspect = require_object_inspect();
16471
+ var inspect2 = require_object_inspect();
16472
16472
  var getSideChannelList = require_side_channel_list();
16473
16473
  var getSideChannelMap = require_side_channel_map();
16474
16474
  var getSideChannelWeakMap = require_side_channel_weakmap();
@@ -16478,7 +16478,7 @@ var require_side_channel = __commonJS({
16478
16478
  var channel = {
16479
16479
  assert: /* @__PURE__ */ __name(function(key) {
16480
16480
  if (!channel.has(key)) {
16481
- throw new $TypeError("Side channel does not contain " + inspect(key));
16481
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16482
16482
  }
16483
16483
  }, "assert"),
16484
16484
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -34949,9 +34949,9 @@ var HttpInterceptorService = class {
34949
34949
  }
34950
34950
  httpService;
34951
34951
  logger;
34952
- constructor(httpService, logger) {
34952
+ constructor(httpService, logger2) {
34953
34953
  this.httpService = httpService;
34954
- this.logger = logger;
34954
+ this.logger = logger2;
34955
34955
  }
34956
34956
  /**
34957
34957
  * 模块初始化时配置拦截器
@@ -36747,6 +36747,47 @@ function createPublicAssetsMiddleware() {
36747
36747
  }
36748
36748
  __name(createPublicAssetsMiddleware, "createPublicAssetsMiddleware");
36749
36749
 
36750
+ // src/process-guard.ts
36751
+ var import_node_util = require("util");
36752
+ var import_common17 = require("@nestjs/common");
36753
+ var logger = new import_common17.Logger("ProcessGuard");
36754
+ function formatReason(reason) {
36755
+ try {
36756
+ if (reason instanceof Error) {
36757
+ return reason.stack ?? reason.message;
36758
+ }
36759
+ return (0, import_node_util.inspect)(reason, {
36760
+ depth: 3,
36761
+ breakLength: Infinity
36762
+ });
36763
+ } catch {
36764
+ return "<unprintable reason>";
36765
+ }
36766
+ }
36767
+ __name(formatReason, "formatReason");
36768
+ function report(title, reason) {
36769
+ try {
36770
+ logger.error(title, formatReason(reason));
36771
+ } catch {
36772
+ }
36773
+ }
36774
+ __name(report, "report");
36775
+ var onUnhandledRejection = /* @__PURE__ */ __name((reason) => {
36776
+ report("Unhandled promise rejection", reason);
36777
+ }, "onUnhandledRejection");
36778
+ var onUncaughtException = /* @__PURE__ */ __name((error) => {
36779
+ report("Uncaught exception", error);
36780
+ }, "onUncaughtException");
36781
+ function installProcessGuard() {
36782
+ if (!process.listeners("unhandledRejection").includes(onUnhandledRejection)) {
36783
+ process.on("unhandledRejection", onUnhandledRejection);
36784
+ }
36785
+ if (!process.listeners("uncaughtException").includes(onUncaughtException)) {
36786
+ process.on("uncaughtException", onUncaughtException);
36787
+ }
36788
+ }
36789
+ __name(installProcessGuard, "installProcessGuard");
36790
+
36750
36791
  // src/setup.ts
36751
36792
  var DEFAULT_BODY_LIMIT = "1mb";
36752
36793
  var defaultPerms = {
@@ -36756,6 +36797,9 @@ async function configureApp(app, perms = defaultPerms) {
36756
36797
  const bodyLimit = perms.bodyLimit ?? process.env.BODY_SIZE_LIMIT ?? DEFAULT_BODY_LIMIT;
36757
36798
  app.useLogger(app.get(import_nestjs_logger3.AppLogger));
36758
36799
  app.flushLogs();
36800
+ if (process.env.NODE_ENV === "production") {
36801
+ installProcessGuard();
36802
+ }
36759
36803
  app.use((0, import_express.json)({
36760
36804
  limit: bodyLimit
36761
36805
  }));
package/dist/index.js CHANGED
@@ -14778,7 +14778,7 @@ var require_object_inspect = __commonJS({
14778
14778
  } else if (indexOf(seen, obj) >= 0) {
14779
14779
  return "[Circular]";
14780
14780
  }
14781
- function inspect(value, from, noIndent) {
14781
+ function inspect2(value, from, noIndent) {
14782
14782
  if (from) {
14783
14783
  seen = $arrSlice.call(seen);
14784
14784
  seen.push(from);
@@ -14794,10 +14794,10 @@ var require_object_inspect = __commonJS({
14794
14794
  }
14795
14795
  return inspect_(value, opts, depth + 1, seen);
14796
14796
  }
14797
- __name(inspect, "inspect");
14797
+ __name(inspect2, "inspect");
14798
14798
  if (typeof obj === "function" && !isRegExp(obj)) {
14799
14799
  var name = nameOf(obj);
14800
- var keys = arrObjKeys(obj, inspect);
14800
+ var keys = arrObjKeys(obj, inspect2);
14801
14801
  return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
14802
14802
  }
14803
14803
  if (isSymbol(obj)) {
@@ -14821,16 +14821,16 @@ var require_object_inspect = __commonJS({
14821
14821
  if (obj.length === 0) {
14822
14822
  return "[]";
14823
14823
  }
14824
- var xs = arrObjKeys(obj, inspect);
14824
+ var xs = arrObjKeys(obj, inspect2);
14825
14825
  if (indent && !singleLineValues(xs)) {
14826
14826
  return "[" + indentedJoin(xs, indent) + "]";
14827
14827
  }
14828
14828
  return "[ " + $join.call(xs, ", ") + " ]";
14829
14829
  }
14830
14830
  if (isError(obj)) {
14831
- var parts = arrObjKeys(obj, inspect);
14831
+ var parts = arrObjKeys(obj, inspect2);
14832
14832
  if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
14833
- return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect(obj.cause), parts), ", ") + " }";
14833
+ return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }";
14834
14834
  }
14835
14835
  if (parts.length === 0) {
14836
14836
  return "[" + String(obj) + "]";
@@ -14850,7 +14850,7 @@ var require_object_inspect = __commonJS({
14850
14850
  var mapParts = [];
14851
14851
  if (mapForEach) {
14852
14852
  mapForEach.call(obj, function(value, key) {
14853
- mapParts.push(inspect(key, obj, true) + " => " + inspect(value, obj));
14853
+ mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value, obj));
14854
14854
  });
14855
14855
  }
14856
14856
  return collectionOf("Map", mapSize.call(obj), mapParts, indent);
@@ -14859,7 +14859,7 @@ var require_object_inspect = __commonJS({
14859
14859
  var setParts = [];
14860
14860
  if (setForEach) {
14861
14861
  setForEach.call(obj, function(value) {
14862
- setParts.push(inspect(value, obj));
14862
+ setParts.push(inspect2(value, obj));
14863
14863
  });
14864
14864
  }
14865
14865
  return collectionOf("Set", setSize.call(obj), setParts, indent);
@@ -14874,16 +14874,16 @@ var require_object_inspect = __commonJS({
14874
14874
  return weakCollectionOf("WeakRef");
14875
14875
  }
14876
14876
  if (isNumber(obj)) {
14877
- return markBoxed(inspect(Number(obj)));
14877
+ return markBoxed(inspect2(Number(obj)));
14878
14878
  }
14879
14879
  if (isBigInt(obj)) {
14880
- return markBoxed(inspect(bigIntValueOf.call(obj)));
14880
+ return markBoxed(inspect2(bigIntValueOf.call(obj)));
14881
14881
  }
14882
14882
  if (isBoolean(obj)) {
14883
14883
  return markBoxed(booleanValueOf.call(obj));
14884
14884
  }
14885
14885
  if (isString(obj)) {
14886
- return markBoxed(inspect(String(obj)));
14886
+ return markBoxed(inspect2(String(obj)));
14887
14887
  }
14888
14888
  if (typeof window !== "undefined" && obj === window) {
14889
14889
  return "{ [object Window] }";
@@ -14892,7 +14892,7 @@ var require_object_inspect = __commonJS({
14892
14892
  return "{ [object globalThis] }";
14893
14893
  }
14894
14894
  if (!isDate(obj) && !isRegExp(obj)) {
14895
- var ys = arrObjKeys(obj, inspect);
14895
+ var ys = arrObjKeys(obj, inspect2);
14896
14896
  var isPlainObject2 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
14897
14897
  var protoTag = obj instanceof Object ? "" : "null prototype";
14898
14898
  var stringTag = !isPlainObject2 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
@@ -15176,13 +15176,13 @@ var require_object_inspect = __commonJS({
15176
15176
  return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
15177
15177
  }
15178
15178
  __name(indentedJoin, "indentedJoin");
15179
- function arrObjKeys(obj, inspect) {
15179
+ function arrObjKeys(obj, inspect2) {
15180
15180
  var isArr = isArray(obj);
15181
15181
  var xs = [];
15182
15182
  if (isArr) {
15183
15183
  xs.length = obj.length;
15184
15184
  for (var i = 0; i < obj.length; i++) {
15185
- xs[i] = has(obj, i) ? inspect(obj[i], obj) : "";
15185
+ xs[i] = has(obj, i) ? inspect2(obj[i], obj) : "";
15186
15186
  }
15187
15187
  }
15188
15188
  var syms = typeof gOPS === "function" ? gOPS(obj) : [];
@@ -15203,15 +15203,15 @@ var require_object_inspect = __commonJS({
15203
15203
  if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
15204
15204
  continue;
15205
15205
  } else if ($test.call(/[^\w$]/, key)) {
15206
- xs.push(inspect(key, obj) + ": " + inspect(obj[key], obj));
15206
+ xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj));
15207
15207
  } else {
15208
- xs.push(key + ": " + inspect(obj[key], obj));
15208
+ xs.push(key + ": " + inspect2(obj[key], obj));
15209
15209
  }
15210
15210
  }
15211
15211
  if (typeof gOPS === "function") {
15212
15212
  for (var j = 0; j < syms.length; j++) {
15213
15213
  if (isEnumerable.call(obj, syms[j])) {
15214
- xs.push("[" + inspect(syms[j]) + "]: " + inspect(obj[syms[j]], obj));
15214
+ xs.push("[" + inspect2(syms[j]) + "]: " + inspect2(obj[syms[j]], obj));
15215
15215
  }
15216
15216
  }
15217
15217
  }
@@ -15225,7 +15225,7 @@ var require_object_inspect = __commonJS({
15225
15225
  var require_side_channel_list = __commonJS({
15226
15226
  "../../../node_modules/side-channel-list/index.js"(exports, module) {
15227
15227
  "use strict";
15228
- var inspect = require_object_inspect();
15228
+ var inspect2 = require_object_inspect();
15229
15229
  var $TypeError = require_type();
15230
15230
  var listGetNode = /* @__PURE__ */ __name(function(list, key, isDelete) {
15231
15231
  var prev = list;
@@ -15278,7 +15278,7 @@ var require_side_channel_list = __commonJS({
15278
15278
  var channel = {
15279
15279
  assert: /* @__PURE__ */ __name(function(key) {
15280
15280
  if (!channel.has(key)) {
15281
- throw new $TypeError("Side channel does not contain " + inspect(key));
15281
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
15282
15282
  }
15283
15283
  }, "assert"),
15284
15284
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16339,7 +16339,7 @@ var require_side_channel_map = __commonJS({
16339
16339
  "use strict";
16340
16340
  var GetIntrinsic = require_get_intrinsic();
16341
16341
  var callBound = require_call_bound();
16342
- var inspect = require_object_inspect();
16342
+ var inspect2 = require_object_inspect();
16343
16343
  var $TypeError = require_type();
16344
16344
  var $Map = GetIntrinsic("%Map%", true);
16345
16345
  var $mapGet = callBound("Map.prototype.get", true);
@@ -16353,7 +16353,7 @@ var require_side_channel_map = __commonJS({
16353
16353
  var channel = {
16354
16354
  assert: /* @__PURE__ */ __name(function(key) {
16355
16355
  if (!channel.has(key)) {
16356
- throw new $TypeError("Side channel does not contain " + inspect(key));
16356
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16357
16357
  }
16358
16358
  }, "assert"),
16359
16359
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16395,7 +16395,7 @@ var require_side_channel_weakmap = __commonJS({
16395
16395
  "use strict";
16396
16396
  var GetIntrinsic = require_get_intrinsic();
16397
16397
  var callBound = require_call_bound();
16398
- var inspect = require_object_inspect();
16398
+ var inspect2 = require_object_inspect();
16399
16399
  var getSideChannelMap = require_side_channel_map();
16400
16400
  var $TypeError = require_type();
16401
16401
  var $WeakMap = GetIntrinsic("%WeakMap%", true);
@@ -16411,7 +16411,7 @@ var require_side_channel_weakmap = __commonJS({
16411
16411
  var channel = {
16412
16412
  assert: /* @__PURE__ */ __name(function(key) {
16413
16413
  if (!channel.has(key)) {
16414
- throw new $TypeError("Side channel does not contain " + inspect(key));
16414
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16415
16415
  }
16416
16416
  }, "assert"),
16417
16417
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -16467,7 +16467,7 @@ var require_side_channel = __commonJS({
16467
16467
  "../../../node_modules/side-channel/index.js"(exports, module) {
16468
16468
  "use strict";
16469
16469
  var $TypeError = require_type();
16470
- var inspect = require_object_inspect();
16470
+ var inspect2 = require_object_inspect();
16471
16471
  var getSideChannelList = require_side_channel_list();
16472
16472
  var getSideChannelMap = require_side_channel_map();
16473
16473
  var getSideChannelWeakMap = require_side_channel_weakmap();
@@ -16477,7 +16477,7 @@ var require_side_channel = __commonJS({
16477
16477
  var channel = {
16478
16478
  assert: /* @__PURE__ */ __name(function(key) {
16479
16479
  if (!channel.has(key)) {
16480
- throw new $TypeError("Side channel does not contain " + inspect(key));
16480
+ throw new $TypeError("Side channel does not contain " + inspect2(key));
16481
16481
  }
16482
16482
  }, "assert"),
16483
16483
  "delete": /* @__PURE__ */ __name(function(key) {
@@ -34917,9 +34917,9 @@ var HttpInterceptorService = class {
34917
34917
  }
34918
34918
  httpService;
34919
34919
  logger;
34920
- constructor(httpService, logger) {
34920
+ constructor(httpService, logger2) {
34921
34921
  this.httpService = httpService;
34922
- this.logger = logger;
34922
+ this.logger = logger2;
34923
34923
  }
34924
34924
  /**
34925
34925
  * 模块初始化时配置拦截器
@@ -36715,6 +36715,47 @@ function createPublicAssetsMiddleware() {
36715
36715
  }
36716
36716
  __name(createPublicAssetsMiddleware, "createPublicAssetsMiddleware");
36717
36717
 
36718
+ // src/process-guard.ts
36719
+ import { inspect } from "util";
36720
+ import { Logger as Logger7 } from "@nestjs/common";
36721
+ var logger = new Logger7("ProcessGuard");
36722
+ function formatReason(reason) {
36723
+ try {
36724
+ if (reason instanceof Error) {
36725
+ return reason.stack ?? reason.message;
36726
+ }
36727
+ return inspect(reason, {
36728
+ depth: 3,
36729
+ breakLength: Infinity
36730
+ });
36731
+ } catch {
36732
+ return "<unprintable reason>";
36733
+ }
36734
+ }
36735
+ __name(formatReason, "formatReason");
36736
+ function report(title, reason) {
36737
+ try {
36738
+ logger.error(title, formatReason(reason));
36739
+ } catch {
36740
+ }
36741
+ }
36742
+ __name(report, "report");
36743
+ var onUnhandledRejection = /* @__PURE__ */ __name((reason) => {
36744
+ report("Unhandled promise rejection", reason);
36745
+ }, "onUnhandledRejection");
36746
+ var onUncaughtException = /* @__PURE__ */ __name((error) => {
36747
+ report("Uncaught exception", error);
36748
+ }, "onUncaughtException");
36749
+ function installProcessGuard() {
36750
+ if (!process.listeners("unhandledRejection").includes(onUnhandledRejection)) {
36751
+ process.on("unhandledRejection", onUnhandledRejection);
36752
+ }
36753
+ if (!process.listeners("uncaughtException").includes(onUncaughtException)) {
36754
+ process.on("uncaughtException", onUncaughtException);
36755
+ }
36756
+ }
36757
+ __name(installProcessGuard, "installProcessGuard");
36758
+
36718
36759
  // src/setup.ts
36719
36760
  var DEFAULT_BODY_LIMIT = "1mb";
36720
36761
  var defaultPerms = {
@@ -36724,6 +36765,9 @@ async function configureApp(app, perms = defaultPerms) {
36724
36765
  const bodyLimit = perms.bodyLimit ?? process.env.BODY_SIZE_LIMIT ?? DEFAULT_BODY_LIMIT;
36725
36766
  app.useLogger(app.get(AppLogger3));
36726
36767
  app.flushLogs();
36768
+ if (process.env.NODE_ENV === "production") {
36769
+ installProcessGuard();
36770
+ }
36727
36771
  app.use((0, import_express.json)({
36728
36772
  limit: bodyLimit
36729
36773
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-nestjs-core",
3
- "version": "1.1.68",
3
+ "version": "1.1.69",
4
4
  "description": "FullStack Nestjs Core",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,18 +39,18 @@
39
39
  "prepublishOnly": "npm run build"
40
40
  },
41
41
  "dependencies": {
42
- "@lark-apaas/cache-service": "^0.1.2",
42
+ "@lark-apaas/cache-service": "^0.1.3",
43
43
  "@lark-apaas/file-service": "^0.1.2",
44
44
  "@lark-apaas/http-client": "^0.1.9",
45
45
  "@lark-apaas/nestjs-authnpaas": "^1.0.9",
46
46
  "@lark-apaas/nestjs-authzpaas": "^0.1.16",
47
47
  "@lark-apaas/nestjs-capability": "^0.1.14",
48
48
  "@lark-apaas/nestjs-common": "^0.1.9",
49
- "@lark-apaas/nestjs-datapaas": "^1.0.21",
49
+ "@lark-apaas/nestjs-datapaas": "^1.0.23",
50
50
  "@lark-apaas/nestjs-http-forwarder": "^0.1.3",
51
- "@lark-apaas/nestjs-logger": "^1.0.18",
51
+ "@lark-apaas/nestjs-logger": "^1.0.19",
52
52
  "@lark-apaas/nestjs-mcp": "^0.1.2",
53
- "@lark-apaas/nestjs-observable": "^0.0.12",
53
+ "@lark-apaas/nestjs-observable": "^0.0.13",
54
54
  "@lark-apaas/nestjs-openapi-devtools": "^1.0.10",
55
55
  "@lark-apaas/nestjs-trigger": "^0.0.3",
56
56
  "@nestjs/axios": "^4.0.1",