@camstack/server 1.2.872 → 1.2.873

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/api/trpc/generated-cap-routers.js +7 -0
  3. package/dist/core/agent/expired-leaf-renewer.js +67 -0
  4. package/dist/core/agent/mesh-handshake-wiring.js +48 -0
  5. package/dist/manual-boot.js +6 -0
  6. package/package.json +12 -9
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  12. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  13. package/system/dist/builtins/autotrack/index.js +1 -1
  14. package/system/dist/builtins/autotrack/index.mjs +1 -1
  15. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  17. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/system/dist/builtins/camera-grid/index.js +1 -1
  20. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/system/dist/builtins/composer/composer.addon.js +4 -4
  22. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  23. package/system/dist/builtins/console-logging/index.js +1 -1
  24. package/system/dist/builtins/console-logging/index.mjs +1 -1
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  27. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  28. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  29. package/system/dist/builtins/device-manager/device-manager.addon.js +2 -2
  30. package/system/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  31. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/system/dist/builtins/keychain/index.js +4 -4
  34. package/system/dist/builtins/keychain/index.mjs +4 -4
  35. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  38. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  39. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  40. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  41. package/system/dist/builtins/loki-logging/index.js +1 -1
  42. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  45. package/system/dist/builtins/platform-probe/index.js +1 -1
  46. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  47. package/system/dist/builtins/record-entries/index.js +1 -1
  48. package/system/dist/builtins/record-entries/index.mjs +1 -1
  49. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  50. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  51. package/system/dist/builtins/snapshot/index.js +1 -1
  52. package/system/dist/builtins/snapshot/index.mjs +1 -1
  53. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  54. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  55. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  56. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  57. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  59. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/system-config/system-config.addon.js +155 -21
  62. package/system/dist/builtins/system-config/system-config.addon.mjs +435 -303
  63. package/system/dist/builtins/winston-logging/index.js +1 -1
  64. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  65. package/system/dist/{capture-engine-BYuDoU5P.mjs → capture-engine-WL-mpqRt.mjs} +1 -1
  66. package/system/dist/{capture-engine-BNeKmvyo.js → capture-engine-p0DLUXcQ.js} +1 -1
  67. package/system/dist/{composition-sources-52ZtkEBw.js → composition-sources-BuRkhqkL.js} +1 -1
  68. package/system/dist/{composition-sources-DQwbBMG1.mjs → composition-sources-Dheuv9_O.mjs} +1 -1
  69. package/system/dist/constants-Ci169fqS.mjs +27 -0
  70. package/system/dist/{constants-jwecWQuN.js → constants-D8fNaNti.js} +14 -1
  71. package/system/dist/{device-ca-Bkujp9Cx.js → device-ca-CPeChXfp.js} +1 -1
  72. package/system/dist/{device-ca-DFi1axk5.mjs → device-ca-Cu6Xu_CS.mjs} +1 -1
  73. package/system/dist/{dist-B15a2506.mjs → dist-BBWAHu-O.mjs} +29 -2
  74. package/system/dist/{dist-8pvVkKh4.js → dist-BHAE4TbZ.js} +29 -2
  75. package/system/dist/file-host-worker.js +1 -1
  76. package/system/dist/file-host-worker.mjs +1 -1
  77. package/system/dist/{hub-identity-3uLEvGsn.mjs → hub-identity-BPdwL_Qn.mjs} +1 -1
  78. package/system/dist/{hub-identity-C3ijBf-E.js → hub-identity-CfaF_M6Y.js} +1 -1
  79. package/system/dist/{hub-mdns-ciao-Ch6HwlRl.mjs → hub-mdns-ciao-1NZAZ7Mp.mjs} +2 -2
  80. package/system/dist/{hub-mdns-ciao-BUL3yLqz.js → hub-mdns-ciao-DS7-X9U_.js} +2 -2
  81. package/system/dist/index.js +10 -8
  82. package/system/dist/index.mjs +10 -10
  83. package/system/dist/kernel/index.d.ts +1 -1
  84. package/system/dist/kernel/moleculer/mesh-mtls/constants.d.ts +7 -2
  85. package/system/dist/kernel/moleculer/mesh-mtls/index.d.ts +2 -2
  86. package/system/dist/kernel/moleculer/mesh-mtls/mesh-ca.d.ts +1 -1
  87. package/system/dist/kernel/moleculer/mesh-mtls/mesh-peer-transport.d.ts +16 -0
  88. package/system/dist/kernel/moleculer/mesh-mtls/mesh-peer-verification.d.ts +30 -0
  89. package/system/dist/kernel/moleculer/mesh-mtls/tls-tcp-transporter.d.ts +24 -0
  90. package/system/dist/{legacy-integration-rows-door-BtRtvXfK.js → legacy-integration-rows-door-Bnz-aNu6.js} +1 -1
  91. package/system/dist/{legacy-integration-rows-door-ChF97F5x.mjs → legacy-integration-rows-door-CsxfaUSU.mjs} +1 -1
  92. package/system/dist/{rename-composition-block-CHIIBly8.js → rename-composition-block-CQUr1lYO.js} +1 -1
  93. package/system/dist/{rename-composition-block-DfsNTQ2H.mjs → rename-composition-block-Dxywwjac.mjs} +1 -1
  94. package/system/dist/{restore-archive-BfaE7Y65.mjs → restore-archive-CFMsgNKV.mjs} +82 -82
  95. package/system/dist/{restore-archive-8o1pcPFB.js → restore-archive-CbMms_b0.js} +1 -1
  96. package/system/dist/{wal-maintenance-DxtgYuYM.mjs → wal-maintenance-6782RP08.mjs} +0 -0
  97. package/system/dist/{wal-maintenance-Cv6MfFm9.js → wal-maintenance-DJ76u4GY.js} +0 -0
  98. package/system/package.json +1 -1
  99. package/system/dist/constants-RWobCEGs.mjs +0 -20
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ic as defineCustomActions, Il as errMsg, Is as BaseAddon, Pc as customAction, cn as ServerNameSchema, go as shortHostname, qc as hydrateSchema } from "../../dist-B15a2506.mjs";
2
+ import { Ic as defineCustomActions, Il as errMsg, Is as BaseAddon, Pc as customAction, cn as ServerNameSchema, go as shortHostname, qc as hydrateSchema } from "../../dist-BBWAHu-O.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
5
- import { B as AGENT_HTTPS_NAMES_COLLECTION, G as systemConfigRecordKinds, H as AgentHttpsNames, I as isLocalOnlyHostname, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, m as isPrivateAddress, r as isAnnouncedHubId } from "../../hub-identity-3uLEvGsn.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-RWobCEGs.mjs";
5
+ import { B as AGENT_HTTPS_NAMES_COLLECTION, G as systemConfigRecordKinds, H as AgentHttpsNames, I as isLocalOnlyHostname, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, m as isPrivateAddress, r as isAnnouncedHubId } from "../../hub-identity-BPdwL_Qn.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as MESH_LEAF_NOT_AFTER, i as MESH_CA_FIELD, l as SERVER_AUTH_OID, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-Ci169fqS.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
@@ -15,7 +15,7 @@ import os from "node:os";
15
15
  import { fileURLToPath } from "node:url";
16
16
  import { lstatSync, readdir as readdir$1, readdirSync as readdirSync$1, readlinkSync, realpathSync } from "fs";
17
17
  import "path";
18
- import As from "node:stream";
18
+ import Pe from "node:stream";
19
19
  import * as tls from "node:tls";
20
20
  import { EventEmitter } from "node:events";
21
21
  import { StringDecoder } from "node:string_decoder";
@@ -449,7 +449,7 @@ async function loadMeshCa(certPem, keyPem) {
449
449
  }
450
450
  /**
451
451
  * Issue a leaf from a CSR. CN must be present; when `expectedNodeId` is set
452
- * it must match. Validity: 30 days.
452
+ * it must match. Validity: none (`MESH_LEAF_NOT_AFTER`); `validDays` is a spec seam that forges a short one.
453
453
  */
454
454
  async function issueMeshLeafFromCsr(ca, csrPem, opts = {}) {
455
455
  const csr = new Pkcs10CertificateRequest(csrPem);
@@ -459,9 +459,8 @@ async function issueMeshLeafFromCsr(ca, csrPem, opts = {}) {
459
459
  if (opts.allowReserved !== true && !isValidAgentNodeId(cn)) throw new Error(`CSR CN '${cn}' is not an id an agent may carry`);
460
460
  if (opts.expectedNodeId !== void 0 && opts.expectedNodeId !== cn) throw new Error(`CSR CN '${cn}' does not match the token nodeId '${opts.expectedNodeId}'`);
461
461
  const now = opts.now ?? /* @__PURE__ */ new Date();
462
- const validDays = opts.validDays ?? 30;
463
462
  const serialNumber = freshSerial();
464
- const notAfter = new Date(now.getTime() + validDays * MS_PER_DAY);
463
+ const notAfter = opts.validDays === void 0 ? new Date(MESH_LEAF_NOT_AFTER) : new Date(now.getTime() + opts.validDays * MS_PER_DAY);
465
464
  const extensions = [
466
465
  new BasicConstraintsExtension(false, void 0, true),
467
466
  new KeyUsagesExtension(KeyUsageFlags.digitalSignature, true),
@@ -1499,6 +1498,18 @@ function emitProcessNodeRegistered(nodeId, addonIds) {
1499
1498
  listener(nodeId, addonIds);
1500
1499
  } catch {}
1501
1500
  }
1501
+ var REPORTER_SLOT = Symbol.for("camstack.cluster.mesh-handshake-reporter");
1502
+ function setProcessMeshHandshakeReporter(reporter) {
1503
+ if (reporter === null) Reflect.deleteProperty(globalThis, REPORTER_SLOT);
1504
+ else Reflect.set(globalThis, REPORTER_SLOT, reporter);
1505
+ }
1506
+ function isHandshakeReporter(value) {
1507
+ return value !== null && typeof value === "object" && typeof Reflect.get(value, "warn") === "function";
1508
+ }
1509
+ function getProcessMeshHandshakeReporter() {
1510
+ const value = Reflect.get(globalThis, REPORTER_SLOT);
1511
+ return isHandshakeReporter(value) ? value : null;
1512
+ }
1502
1513
  //#endregion
1503
1514
  //#region src/kernel/moleculer/mesh-mtls/mesh-tls-enabler.ts
1504
1515
  var SLOT = Symbol.for("camstack.mesh.tls-enabler");
@@ -21487,8 +21498,8 @@ var require_kleur = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21487
21498
  var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21488
21499
  var kleur = require_kleur();
21489
21500
  var os$17 = __require("os");
21490
- var path$39 = __require("path");
21491
- var fs$19 = __require("fs");
21501
+ var path$40 = __require("path");
21502
+ var fs$20 = __require("fs");
21492
21503
  var { TimeoutError } = require_errors$2();
21493
21504
  var lut = [];
21494
21505
  for (let i = 0; i < 256; i++) lut[i] = (i < 16 ? "0" : "") + i.toString(16);
@@ -21779,9 +21790,9 @@ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
21779
21790
  * @param {String} p - directory path
21780
21791
  */
21781
21792
  makeDirs(p) {
21782
- p.split(path$39.sep).reduce((prevPath, folder) => {
21783
- const currentPath = path$39.join(prevPath, folder, path$39.sep);
21784
- if (!fs$19.existsSync(currentPath)) fs$19.mkdirSync(currentPath);
21793
+ p.split(path$40.sep).reduce((prevPath, folder) => {
21794
+ const currentPath = path$40.join(prevPath, folder, path$40.sep);
21795
+ if (!fs$20.existsSync(currentPath)) fs$20.mkdirSync(currentPath);
21785
21796
  return currentPath;
21786
21797
  }, "");
21787
21798
  },
@@ -23006,8 +23017,8 @@ var require_csv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23006
23017
  var BaseReporter = require_base$8();
23007
23018
  var { makeDirs } = require_utils$3();
23008
23019
  var _ = require_lodash();
23009
- var path$38 = __require("path");
23010
- var fs$18 = __require("fs");
23020
+ var path$39 = __require("path");
23021
+ var fs$19 = __require("fs");
23011
23022
  var METRIC = require_constants$6();
23012
23023
  var MODE_METRIC = "metric";
23013
23024
  var MODE_LABEL = "label";
@@ -23060,7 +23071,7 @@ var require_csv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23060
23071
  this.timer = setInterval(() => this.flush(), this.opts.interval * 1e3);
23061
23072
  this.timer.unref();
23062
23073
  }
23063
- this.folder = path$38.resolve(this.opts.folder);
23074
+ this.folder = path$39.resolve(this.opts.folder);
23064
23075
  makeDirs(this.folder);
23065
23076
  }
23066
23077
  /**
@@ -23085,10 +23096,10 @@ var require_csv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23085
23096
  const metricName = this.formatMetricName(metric.name);
23086
23097
  if (this.opts.filenameFormatter) return this.opts.filenameFormatter.call(this, metricName, metric, item);
23087
23098
  switch (this.opts.mode) {
23088
- case MODE_METRIC: return path$38.join(this.folder, `${metricName}.csv`);
23099
+ case MODE_METRIC: return path$39.join(this.folder, `${metricName}.csv`);
23089
23100
  case MODE_LABEL: {
23090
23101
  const labelStr = this.labelsToStr(item.labels);
23091
- return path$38.join(this.folder, metricName, `${metricName}${labelStr ? "--" + labelStr : ""}.csv`);
23102
+ return path$39.join(this.folder, metricName, `${metricName}${labelStr ? "--" + labelStr : ""}.csv`);
23092
23103
  }
23093
23104
  }
23094
23105
  }
@@ -23109,7 +23120,7 @@ var require_csv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23109
23120
  metric.values.forEach((item) => {
23110
23121
  if (!this.lastChanges.has([metric.name, this.labelsToStr(item.labels)].join("|"))) return;
23111
23122
  const filename = this.getFilename(metric, item);
23112
- makeDirs(path$38.dirname(filename));
23123
+ makeDirs(path$39.dirname(filename));
23113
23124
  const metricName = this.formatMetricName(metric.name);
23114
23125
  let headers = ["Timestamp", "Metric"];
23115
23126
  let data = [item.timestamp, metricName];
@@ -23166,8 +23177,8 @@ var require_csv = /* @__PURE__ */ __commonJSMin(((exports, module) => {
23166
23177
  */
23167
23178
  writeRow(filename, headers, fields) {
23168
23179
  try {
23169
- if (!fs$18.existsSync(filename)) fs$18.writeFileSync(filename, headers.join(this.opts.delimiter) + this.opts.rowDelimiter);
23170
- fs$18.appendFileSync(filename, fields.join(this.opts.delimiter) + this.opts.rowDelimiter);
23180
+ if (!fs$19.existsSync(filename)) fs$19.writeFileSync(filename, headers.join(this.opts.delimiter) + this.opts.rowDelimiter);
23181
+ fs$19.appendFileSync(filename, fields.join(this.opts.delimiter) + this.opts.rowDelimiter);
23171
23182
  } catch (err) {
23172
23183
  /* istanbul ignore next */
23173
23184
  this.logger.error(`Unable to write metrics values to the '${filename}' file. Error: ${err.message}`, fields, err);
@@ -26239,7 +26250,7 @@ var require_latency = /* @__PURE__ */ __commonJSMin(((exports, module) => {
26239
26250
  //#region ../../node_modules/lru-cache/dist/commonjs/node/index.min.js
26240
26251
  var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
26241
26252
  var j = (c, t) => () => (t || c((t = { exports: {} }).exports, t), t.exports);
26242
- var I$2 = j((O) => {
26253
+ var I$1 = j((O) => {
26243
26254
  "use strict";
26244
26255
  Object.defineProperty(O, "__esModule", { value: !0 });
26245
26256
  O.tracing = O.metrics = void 0;
@@ -26255,7 +26266,7 @@ var require_index_min = /* @__PURE__ */ __commonJSMin(((exports) => {
26255
26266
  });
26256
26267
  Object.defineProperty(exports, "__esModule", { value: !0 });
26257
26268
  exports.LRUCache = void 0;
26258
- var g = I$2(), N = P(), C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers, k = /* @__PURE__ */ new Set(), G = typeof process == "object" && process ? process : {}, V = (c, t, e, i) => {
26269
+ var g = I$1(), N = P(), C = () => g.metrics.hasSubscribers || g.tracing.hasSubscribers, k = /* @__PURE__ */ new Set(), G = typeof process == "object" && process ? process : {}, V = (c, t, e, i) => {
26259
26270
  typeof G.emitWarning == "function" ? G.emitWarning(c, t, e, i) : console.error(`[${e}] ${t}: ${c}`);
26260
26271
  }, q = (c) => !k.has(c);
26261
26272
  var T = (c) => !!c && c === Math.floor(c) && c > 0 && isFinite(c), H = (c) => T(c) ? c <= Math.pow(2, 8) ? Uint8Array : c <= Math.pow(2, 16) ? Uint16Array : c <= Math.pow(2, 32) ? Uint32Array : c <= Number.MAX_SAFE_INTEGER ? W : null : null, W = class extends Array {
@@ -31199,7 +31210,7 @@ var require_process$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31199
31210
  //#endregion
31200
31211
  //#region ../../node_modules/detect-libc/lib/filesystem.js
31201
31212
  var require_filesystem = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31202
- var fs$17 = __require("fs");
31213
+ var fs$18 = __require("fs");
31203
31214
  var LDD_PATH = "/usr/bin/ldd";
31204
31215
  var SELF_PATH = "/proc/self/exe";
31205
31216
  var MAX_LENGTH = 2048;
@@ -31210,10 +31221,10 @@ var require_filesystem = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31210
31221
  * @returns {Buffer}
31211
31222
  */
31212
31223
  var readFileSync = (path) => {
31213
- const fd = fs$17.openSync(path, "r");
31224
+ const fd = fs$18.openSync(path, "r");
31214
31225
  const buffer = Buffer.alloc(MAX_LENGTH);
31215
- const bytesRead = fs$17.readSync(fd, buffer, 0, MAX_LENGTH, 0);
31216
- fs$17.close(fd, () => {});
31226
+ const bytesRead = fs$18.readSync(fd, buffer, 0, MAX_LENGTH, 0);
31227
+ fs$18.close(fd, () => {});
31217
31228
  return buffer.subarray(0, bytesRead);
31218
31229
  };
31219
31230
  /**
@@ -31223,13 +31234,13 @@ var require_filesystem = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31223
31234
  * @returns {Promise<Buffer>}
31224
31235
  */
31225
31236
  var readFile = (path) => new Promise((resolve, reject) => {
31226
- fs$17.open(path, "r", (err, fd) => {
31237
+ fs$18.open(path, "r", (err, fd) => {
31227
31238
  if (err) reject(err);
31228
31239
  else {
31229
31240
  const buffer = Buffer.alloc(MAX_LENGTH);
31230
- fs$17.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
31241
+ fs$18.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
31231
31242
  resolve(buffer.subarray(0, bytesRead));
31232
- fs$17.close(fd, () => {});
31243
+ fs$18.close(fd, () => {});
31233
31244
  });
31234
31245
  }
31235
31246
  });
@@ -31482,8 +31493,8 @@ var require_detect_libc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31482
31493
  //#endregion
31483
31494
  //#region ../../node_modules/node-gyp-build-optional-packages/index.js
31484
31495
  var require_node_gyp_build_optional_packages = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31485
- var fs$16 = __require("fs");
31486
- var path$37 = __require("path");
31496
+ var fs$17 = __require("fs");
31497
+ var path$38 = __require("path");
31487
31498
  var url$2 = __require("url");
31488
31499
  var vars = process.config && process.config.variables || {};
31489
31500
  var prebuildsOnly = !!process.env.PREBUILDS_ONLY;
@@ -31502,27 +31513,27 @@ var require_node_gyp_build_optional_packages = /* @__PURE__ */ __commonJSMin(((e
31502
31513
  else return __require(load.path(dir));
31503
31514
  }
31504
31515
  load.path = function(dir) {
31505
- dir = path$37.resolve(dir || ".");
31516
+ dir = path$38.resolve(dir || ".");
31506
31517
  var packageName = "";
31507
31518
  try {
31508
- if (typeof __webpack_require__ === "function") packageName = __non_webpack_require__(path$37.join(dir, "package.json")).name;
31509
- else packageName = __require(path$37.join(dir, "package.json")).name;
31519
+ if (typeof __webpack_require__ === "function") packageName = __non_webpack_require__(path$38.join(dir, "package.json")).name;
31520
+ else packageName = __require(path$38.join(dir, "package.json")).name;
31510
31521
  var varName = packageName.toUpperCase().replace(/-/g, "_") + "_PREBUILD";
31511
31522
  if (process.env[varName]) dir = process.env[varName];
31512
31523
  } catch (err) {}
31513
31524
  if (!prebuildsOnly) {
31514
- var release = getFirst(path$37.join(dir, "build/Release"), matchBuild);
31525
+ var release = getFirst(path$38.join(dir, "build/Release"), matchBuild);
31515
31526
  if (release) return release;
31516
- var debug = getFirst(path$37.join(dir, "build/Debug"), matchBuild);
31527
+ var debug = getFirst(path$38.join(dir, "build/Debug"), matchBuild);
31517
31528
  if (debug) return debug;
31518
31529
  }
31519
31530
  var prebuild = resolve(dir);
31520
31531
  if (prebuild) return prebuild;
31521
- var nearby = resolve(path$37.dirname(process.execPath));
31532
+ var nearby = resolve(path$38.dirname(process.execPath));
31522
31533
  if (nearby) return nearby;
31523
31534
  var platformPackage = (packageName[0] == "@" ? "" : "@" + packageName + "/") + packageName + "-" + platform + "-" + arch;
31524
31535
  try {
31525
- return resolveFile(path$37.dirname(__require("module").createRequire(url$2.pathToFileURL(path$37.join(dir, "package.json"))).resolve(platformPackage)));
31536
+ return resolveFile(path$38.dirname(__require("module").createRequire(url$2.pathToFileURL(path$38.join(dir, "package.json"))).resolve(platformPackage)));
31526
31537
  } catch (error) {}
31527
31538
  var target = [
31528
31539
  "platform=" + platform,
@@ -31538,25 +31549,25 @@ var require_node_gyp_build_optional_packages = /* @__PURE__ */ __commonJSMin(((e
31538
31549
  ].filter(Boolean).join(" ");
31539
31550
  throw new Error("No native build was found for " + target + "\n attempted loading from: " + dir + " and package: " + platformPackage + "\n");
31540
31551
  function resolve(dir) {
31541
- var tuple = readdirSync(path$37.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
31552
+ var tuple = readdirSync(path$38.join(dir, "prebuilds")).map(parseTuple).filter(matchTuple(platform, arch)).sort(compareTuples)[0];
31542
31553
  if (!tuple) return;
31543
- return resolveFile(path$37.join(dir, "prebuilds", tuple.name));
31554
+ return resolveFile(path$38.join(dir, "prebuilds", tuple.name));
31544
31555
  }
31545
31556
  function resolveFile(prebuilds) {
31546
31557
  var winner = readdirSync(prebuilds).map(parseTags).filter(matchTags(runtime, abi)).sort(compareTags(runtime))[0];
31547
- if (winner) return path$37.join(prebuilds, winner.file);
31558
+ if (winner) return path$38.join(prebuilds, winner.file);
31548
31559
  }
31549
31560
  };
31550
31561
  function readdirSync(dir) {
31551
31562
  try {
31552
- return fs$16.readdirSync(dir);
31563
+ return fs$17.readdirSync(dir);
31553
31564
  } catch (err) {
31554
31565
  return [];
31555
31566
  }
31556
31567
  }
31557
31568
  function getFirst(dir, filter) {
31558
31569
  var files = readdirSync(dir).filter(filter);
31559
- return files[0] && path$37.join(dir, files[0]);
31570
+ return files[0] && path$38.join(dir, files[0]);
31560
31571
  }
31561
31572
  function matchBuild(name) {
31562
31573
  return /\.node$/.test(name);
@@ -37028,8 +37039,8 @@ var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37028
37039
  var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37029
37040
  var FormattedLogger = require_formatted();
37030
37041
  var _ = require_lodash();
37031
- var fs$15 = __require("fs/promises");
37032
- var path$36 = __require("path");
37042
+ var fs$16 = __require("fs/promises");
37043
+ var path$37 = __require("path");
37033
37044
  var os$11 = __require("os");
37034
37045
  var { makeDirs } = require_utils$3();
37035
37046
  /**
@@ -37075,7 +37086,7 @@ var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37075
37086
  */
37076
37087
  init(loggerFactory) {
37077
37088
  super.init(loggerFactory);
37078
- this.logFolder = path$36.resolve(this.render(this.opts.folder, {
37089
+ this.logFolder = path$37.resolve(this.render(this.opts.folder, {
37079
37090
  nodeID: this.broker.nodeID,
37080
37091
  namespace: this.broker.namespace
37081
37092
  }));
@@ -37100,7 +37111,7 @@ var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37100
37111
  */
37101
37112
  getFilename() {
37102
37113
  const date = (/* @__PURE__ */ new Date()).toISOString().substring(0, 10);
37103
- return path$36.join(this.logFolder, this.render(this.opts.filename, {
37114
+ return path$37.join(this.logFolder, this.render(this.opts.filename, {
37104
37115
  date,
37105
37116
  nodeID: this.broker.nodeID,
37106
37117
  namespace: this.broker.namespace
@@ -37132,7 +37143,7 @@ var require_file$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37132
37143
  const rows = Array.from(this.queue);
37133
37144
  this.queue.length = 0;
37134
37145
  const buf = rows.join(this.opts.eol) + this.opts.eol;
37135
- return fs$15.appendFile(filename, buf).catch((err) => {
37146
+ return fs$16.appendFile(filename, buf).catch((err) => {
37136
37147
  /* istanbul ignore next */
37137
37148
  console.debug("Unable to write log file:", filename, err);
37138
37149
  });
@@ -37481,7 +37492,7 @@ var require_layouts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37481
37492
  var dateFormat = require_lib$5();
37482
37493
  var os$10 = __require("os");
37483
37494
  var util$3 = __require("util");
37484
- var path$35 = __require("path");
37495
+ var path$36 = __require("path");
37485
37496
  var styles = {
37486
37497
  bold: [1, 22],
37487
37498
  italic: [3, 23],
@@ -37647,8 +37658,8 @@ var require_layouts = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37647
37658
  let filename = loggingEvent.fileName || "";
37648
37659
  if (specifier) {
37649
37660
  const fileDepth = parseInt(specifier, 10);
37650
- const fileList = filename.split(path$35.sep);
37651
- if (fileList.length > fileDepth) filename = fileList.slice(-fileDepth).join(path$35.sep);
37661
+ const fileList = filename.split(path$36.sep);
37662
+ if (fileList.length > fileDepth) filename = fileList.slice(-fileDepth).join(path$36.sep);
37652
37663
  }
37653
37664
  return filename;
37654
37665
  }
@@ -38650,7 +38661,7 @@ var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38650
38661
  //#endregion
38651
38662
  //#region ../../node_modules/graceful-fs/graceful-fs.js
38652
38663
  var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38653
- var fs$14 = __require("fs");
38664
+ var fs$15 = __require("fs");
38654
38665
  var polyfills = require_polyfills();
38655
38666
  var legacy = require_legacy_streams();
38656
38667
  var clone = require_clone();
@@ -38679,36 +38690,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38679
38690
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
38680
38691
  console.error(m);
38681
38692
  };
38682
- if (!fs$14[gracefulQueue]) {
38683
- publishQueue(fs$14, global[gracefulQueue] || []);
38684
- fs$14.close = (function(fs$close) {
38693
+ if (!fs$15[gracefulQueue]) {
38694
+ publishQueue(fs$15, global[gracefulQueue] || []);
38695
+ fs$15.close = (function(fs$close) {
38685
38696
  function close(fd, cb) {
38686
- return fs$close.call(fs$14, fd, function(err) {
38697
+ return fs$close.call(fs$15, fd, function(err) {
38687
38698
  if (!err) resetQueue();
38688
38699
  if (typeof cb === "function") cb.apply(this, arguments);
38689
38700
  });
38690
38701
  }
38691
38702
  Object.defineProperty(close, previousSymbol, { value: fs$close });
38692
38703
  return close;
38693
- })(fs$14.close);
38694
- fs$14.closeSync = (function(fs$closeSync) {
38704
+ })(fs$15.close);
38705
+ fs$15.closeSync = (function(fs$closeSync) {
38695
38706
  function closeSync(fd) {
38696
- fs$closeSync.apply(fs$14, arguments);
38707
+ fs$closeSync.apply(fs$15, arguments);
38697
38708
  resetQueue();
38698
38709
  }
38699
38710
  Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
38700
38711
  return closeSync;
38701
- })(fs$14.closeSync);
38712
+ })(fs$15.closeSync);
38702
38713
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
38703
- debug(fs$14[gracefulQueue]);
38704
- __require("assert").equal(fs$14[gracefulQueue].length, 0);
38714
+ debug(fs$15[gracefulQueue]);
38715
+ __require("assert").equal(fs$15[gracefulQueue].length, 0);
38705
38716
  });
38706
38717
  }
38707
- if (!global[gracefulQueue]) publishQueue(global, fs$14[gracefulQueue]);
38708
- module.exports = patch(clone(fs$14));
38709
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$14.__patched) {
38710
- module.exports = patch(fs$14);
38711
- fs$14.__patched = true;
38718
+ if (!global[gracefulQueue]) publishQueue(global, fs$15[gracefulQueue]);
38719
+ module.exports = patch(clone(fs$15));
38720
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$15.__patched) {
38721
+ module.exports = patch(fs$15);
38722
+ fs$15.__patched = true;
38712
38723
  }
38713
38724
  function patch(fs) {
38714
38725
  polyfills(fs);
@@ -38963,23 +38974,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38963
38974
  }
38964
38975
  function enqueue(elem) {
38965
38976
  debug("ENQUEUE", elem[0].name, elem[1]);
38966
- fs$14[gracefulQueue].push(elem);
38977
+ fs$15[gracefulQueue].push(elem);
38967
38978
  retry();
38968
38979
  }
38969
38980
  var retryTimer;
38970
38981
  function resetQueue() {
38971
38982
  var now = Date.now();
38972
- for (var i = 0; i < fs$14[gracefulQueue].length; ++i) if (fs$14[gracefulQueue][i].length > 2) {
38973
- fs$14[gracefulQueue][i][3] = now;
38974
- fs$14[gracefulQueue][i][4] = now;
38983
+ for (var i = 0; i < fs$15[gracefulQueue].length; ++i) if (fs$15[gracefulQueue][i].length > 2) {
38984
+ fs$15[gracefulQueue][i][3] = now;
38985
+ fs$15[gracefulQueue][i][4] = now;
38975
38986
  }
38976
38987
  retry();
38977
38988
  }
38978
38989
  function retry() {
38979
38990
  clearTimeout(retryTimer);
38980
38991
  retryTimer = void 0;
38981
- if (fs$14[gracefulQueue].length === 0) return;
38982
- var elem = fs$14[gracefulQueue].shift();
38992
+ if (fs$15[gracefulQueue].length === 0) return;
38993
+ var elem = fs$15[gracefulQueue].shift();
38983
38994
  var fn = elem[0];
38984
38995
  var args = elem[1];
38985
38996
  var err = elem[2];
@@ -38998,7 +39009,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
38998
39009
  if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
38999
39010
  debug("RETRY", fn.name, args);
39000
39011
  fn.apply(null, args.concat([startTime]));
39001
- } else fs$14[gracefulQueue].push(elem);
39012
+ } else fs$15[gracefulQueue].push(elem);
39002
39013
  }
39003
39014
  if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
39004
39015
  }
@@ -39086,9 +39097,9 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
39086
39097
  //#endregion
39087
39098
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/mkdirs/win32.js
39088
39099
  var require_win32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39089
- var path$34 = __require("path");
39100
+ var path$35 = __require("path");
39090
39101
  function getRootPath(p) {
39091
- p = path$34.normalize(path$34.resolve(p)).split(path$34.sep);
39102
+ p = path$35.normalize(path$35.resolve(p)).split(path$35.sep);
39092
39103
  if (p.length > 0) return p[0];
39093
39104
  return null;
39094
39105
  }
@@ -39107,7 +39118,7 @@ var require_win32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39107
39118
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/mkdirs/mkdirs.js
39108
39119
  var require_mkdirs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39109
39120
  var fs = require_graceful_fs();
39110
- var path$33 = __require("path");
39121
+ var path$34 = __require("path");
39111
39122
  var invalidWin32Path = require_win32().invalidWin32Path;
39112
39123
  var o777 = parseInt("0777", 8);
39113
39124
  function mkdirs(p, opts, callback, made) {
@@ -39125,7 +39136,7 @@ var require_mkdirs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39125
39136
  if (mode === void 0) mode = o777 & ~process.umask();
39126
39137
  if (!made) made = null;
39127
39138
  callback = callback || function() {};
39128
- p = path$33.resolve(p);
39139
+ p = path$34.resolve(p);
39129
39140
  xfs.mkdir(p, mode, (er) => {
39130
39141
  if (!er) {
39131
39142
  made = made || p;
@@ -39133,8 +39144,8 @@ var require_mkdirs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39133
39144
  }
39134
39145
  switch (er.code) {
39135
39146
  case "ENOENT":
39136
- if (path$33.dirname(p) === p) return callback(er);
39137
- mkdirs(path$33.dirname(p), opts, (er, made) => {
39147
+ if (path$34.dirname(p) === p) return callback(er);
39148
+ mkdirs(path$34.dirname(p), opts, (er, made) => {
39138
39149
  if (er) callback(er, made);
39139
39150
  else mkdirs(p, opts, callback, made);
39140
39151
  });
@@ -39154,7 +39165,7 @@ var require_mkdirs$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39154
39165
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js
39155
39166
  var require_mkdirs_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39156
39167
  var fs = require_graceful_fs();
39157
- var path$32 = __require("path");
39168
+ var path$33 = __require("path");
39158
39169
  var invalidWin32Path = require_win32().invalidWin32Path;
39159
39170
  var o777 = parseInt("0777", 8);
39160
39171
  function mkdirsSync(p, opts, made) {
@@ -39168,14 +39179,14 @@ var require_mkdirs_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39168
39179
  }
39169
39180
  if (mode === void 0) mode = o777 & ~process.umask();
39170
39181
  if (!made) made = null;
39171
- p = path$32.resolve(p);
39182
+ p = path$33.resolve(p);
39172
39183
  try {
39173
39184
  xfs.mkdirSync(p, mode);
39174
39185
  made = made || p;
39175
39186
  } catch (err0) {
39176
39187
  if (err0.code === "ENOENT") {
39177
- if (path$32.dirname(p) === p) throw err0;
39178
- made = mkdirsSync(path$32.dirname(p), opts, made);
39188
+ if (path$33.dirname(p) === p) throw err0;
39189
+ made = mkdirsSync(path$33.dirname(p), opts, made);
39179
39190
  mkdirsSync(p, opts, made);
39180
39191
  } else {
39181
39192
  let stat;
@@ -39211,10 +39222,10 @@ var require_mkdirs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39211
39222
  var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39212
39223
  var fs = require_graceful_fs();
39213
39224
  var os$9 = __require("os");
39214
- var path$31 = __require("path");
39225
+ var path$32 = __require("path");
39215
39226
  function hasMillisResSync() {
39216
- let tmpfile = path$31.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
39217
- tmpfile = path$31.join(os$9.tmpdir(), tmpfile);
39227
+ let tmpfile = path$32.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
39228
+ tmpfile = path$32.join(os$9.tmpdir(), tmpfile);
39218
39229
  const d = /* @__PURE__ */ new Date(1435410243862);
39219
39230
  fs.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
39220
39231
  const fd = fs.openSync(tmpfile, "r+");
@@ -39223,8 +39234,8 @@ var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39223
39234
  return fs.statSync(tmpfile).mtime > 1435410243e3;
39224
39235
  }
39225
39236
  function hasMillisRes(callback) {
39226
- let tmpfile = path$31.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
39227
- tmpfile = path$31.join(os$9.tmpdir(), tmpfile);
39237
+ let tmpfile = path$32.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
39238
+ tmpfile = path$32.join(os$9.tmpdir(), tmpfile);
39228
39239
  const d = /* @__PURE__ */ new Date(1435410243862);
39229
39240
  fs.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
39230
39241
  if (err) return callback(err);
@@ -39275,7 +39286,7 @@ var require_utimes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39275
39286
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/util/stat.js
39276
39287
  var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39277
39288
  var fs = require_graceful_fs();
39278
- var path$30 = __require("path");
39289
+ var path$31 = __require("path");
39279
39290
  var NODE_VERSION_MAJOR_WITH_BIGINT = 10;
39280
39291
  var NODE_VERSION_MINOR_WITH_BIGINT = 5;
39281
39292
  var NODE_VERSION_PATCH_WITH_BIGINT = 0;
@@ -39368,9 +39379,9 @@ var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39368
39379
  };
39369
39380
  }
39370
39381
  function checkParentPaths(src, srcStat, dest, funcName, cb) {
39371
- const srcParent = path$30.resolve(path$30.dirname(src));
39372
- const destParent = path$30.resolve(path$30.dirname(dest));
39373
- if (destParent === srcParent || destParent === path$30.parse(destParent).root) return cb();
39382
+ const srcParent = path$31.resolve(path$31.dirname(src));
39383
+ const destParent = path$31.resolve(path$31.dirname(dest));
39384
+ if (destParent === srcParent || destParent === path$31.parse(destParent).root) return cb();
39374
39385
  if (nodeSupportsBigInt()) fs.stat(destParent, { bigint: true }, (err, destStat) => {
39375
39386
  if (err) {
39376
39387
  if (err.code === "ENOENT") return cb();
@@ -39389,9 +39400,9 @@ var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39389
39400
  });
39390
39401
  }
39391
39402
  function checkParentPathsSync(src, srcStat, dest, funcName) {
39392
- const srcParent = path$30.resolve(path$30.dirname(src));
39393
- const destParent = path$30.resolve(path$30.dirname(dest));
39394
- if (destParent === srcParent || destParent === path$30.parse(destParent).root) return;
39403
+ const srcParent = path$31.resolve(path$31.dirname(src));
39404
+ const destParent = path$31.resolve(path$31.dirname(dest));
39405
+ if (destParent === srcParent || destParent === path$31.parse(destParent).root) return;
39395
39406
  let destStat;
39396
39407
  try {
39397
39408
  if (nodeSupportsBigInt()) destStat = fs.statSync(destParent, { bigint: true });
@@ -39404,8 +39415,8 @@ var require_stat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39404
39415
  return checkParentPathsSync(src, srcStat, destParent, funcName);
39405
39416
  }
39406
39417
  function isSrcSubdir(src, dest) {
39407
- const srcArr = path$30.resolve(src).split(path$30.sep).filter((i) => i);
39408
- const destArr = path$30.resolve(dest).split(path$30.sep).filter((i) => i);
39418
+ const srcArr = path$31.resolve(src).split(path$31.sep).filter((i) => i);
39419
+ const destArr = path$31.resolve(dest).split(path$31.sep).filter((i) => i);
39409
39420
  return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
39410
39421
  }
39411
39422
  function errMsg(src, dest, funcName) {
@@ -39435,7 +39446,7 @@ var require_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39435
39446
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/copy-sync/copy-sync.js
39436
39447
  var require_copy_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39437
39448
  var fs = require_graceful_fs();
39438
- var path$29 = __require("path");
39449
+ var path$30 = __require("path");
39439
39450
  var mkdirpSync = require_mkdirs().mkdirsSync;
39440
39451
  var utimesSync = require_utimes().utimesMillisSync;
39441
39452
  var stat = require_stat();
@@ -39452,7 +39463,7 @@ var require_copy_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39452
39463
  }
39453
39464
  function handleFilterAndCopy(destStat, src, dest, opts) {
39454
39465
  if (opts.filter && !opts.filter(src, dest)) return;
39455
- const destParent = path$29.dirname(dest);
39466
+ const destParent = path$30.dirname(dest);
39456
39467
  if (!fs.existsSync(destParent)) mkdirpSync(destParent);
39457
39468
  return startCopy(destStat, src, dest, opts);
39458
39469
  }
@@ -39514,14 +39525,14 @@ var require_copy_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39514
39525
  fs.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts));
39515
39526
  }
39516
39527
  function copyDirItem(item, src, dest, opts) {
39517
- const srcItem = path$29.join(src, item);
39518
- const destItem = path$29.join(dest, item);
39528
+ const srcItem = path$30.join(src, item);
39529
+ const destItem = path$30.join(dest, item);
39519
39530
  const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy");
39520
39531
  return startCopy(destStat, srcItem, destItem, opts);
39521
39532
  }
39522
39533
  function onLink(destStat, src, dest, opts) {
39523
39534
  let resolvedSrc = fs.readlinkSync(src);
39524
- if (opts.dereference) resolvedSrc = path$29.resolve(process.cwd(), resolvedSrc);
39535
+ if (opts.dereference) resolvedSrc = path$30.resolve(process.cwd(), resolvedSrc);
39525
39536
  if (!destStat) return fs.symlinkSync(resolvedSrc, dest);
39526
39537
  else {
39527
39538
  let resolvedDest;
@@ -39531,7 +39542,7 @@ var require_copy_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39531
39542
  if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlinkSync(resolvedSrc, dest);
39532
39543
  throw err;
39533
39544
  }
39534
- if (opts.dereference) resolvedDest = path$29.resolve(process.cwd(), resolvedDest);
39545
+ if (opts.dereference) resolvedDest = path$30.resolve(process.cwd(), resolvedDest);
39535
39546
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
39536
39547
  if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
39537
39548
  return copyLink(resolvedSrc, dest);
@@ -39565,7 +39576,7 @@ var require_path_exists = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39565
39576
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/copy/copy.js
39566
39577
  var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39567
39578
  var fs = require_graceful_fs();
39568
- var path$28 = __require("path");
39579
+ var path$29 = __require("path");
39569
39580
  var mkdirp = require_mkdirs().mkdirs;
39570
39581
  var pathExists = require_path_exists().pathExists;
39571
39582
  var utimes = require_utimes().utimesMillis;
@@ -39592,7 +39603,7 @@ var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39592
39603
  });
39593
39604
  }
39594
39605
  function checkParentDir(destStat, src, dest, opts, cb) {
39595
- const destParent = path$28.dirname(dest);
39606
+ const destParent = path$29.dirname(dest);
39596
39607
  pathExists(destParent, (err, dirExists) => {
39597
39608
  if (err) return cb(err);
39598
39609
  if (dirExists) return startCopy(destStat, src, dest, opts, cb);
@@ -39679,8 +39690,8 @@ var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39679
39690
  return copyDirItem(items, item, src, dest, opts, cb);
39680
39691
  }
39681
39692
  function copyDirItem(items, item, src, dest, opts, cb) {
39682
- const srcItem = path$28.join(src, item);
39683
- const destItem = path$28.join(dest, item);
39693
+ const srcItem = path$29.join(src, item);
39694
+ const destItem = path$29.join(dest, item);
39684
39695
  stat.checkPaths(srcItem, destItem, "copy", (err, stats) => {
39685
39696
  if (err) return cb(err);
39686
39697
  const { destStat } = stats;
@@ -39693,14 +39704,14 @@ var require_copy$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39693
39704
  function onLink(destStat, src, dest, opts, cb) {
39694
39705
  fs.readlink(src, (err, resolvedSrc) => {
39695
39706
  if (err) return cb(err);
39696
- if (opts.dereference) resolvedSrc = path$28.resolve(process.cwd(), resolvedSrc);
39707
+ if (opts.dereference) resolvedSrc = path$29.resolve(process.cwd(), resolvedSrc);
39697
39708
  if (!destStat) return fs.symlink(resolvedSrc, dest, cb);
39698
39709
  else fs.readlink(dest, (err, resolvedDest) => {
39699
39710
  if (err) {
39700
39711
  if (err.code === "EINVAL" || err.code === "UNKNOWN") return fs.symlink(resolvedSrc, dest, cb);
39701
39712
  return cb(err);
39702
39713
  }
39703
- if (opts.dereference) resolvedDest = path$28.resolve(process.cwd(), resolvedDest);
39714
+ if (opts.dereference) resolvedDest = path$29.resolve(process.cwd(), resolvedDest);
39704
39715
  if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) return cb(/* @__PURE__ */ new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
39705
39716
  if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) return cb(/* @__PURE__ */ new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
39706
39717
  return copyLink(resolvedSrc, dest, cb);
@@ -39725,7 +39736,7 @@ var require_copy = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39725
39736
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/remove/rimraf.js
39726
39737
  var require_rimraf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39727
39738
  var fs = require_graceful_fs();
39728
- var path$27 = __require("path");
39739
+ var path$28 = __require("path");
39729
39740
  var assert$2 = __require("assert");
39730
39741
  var isWindows = process.platform === "win32";
39731
39742
  function defaults(options) {
@@ -39840,7 +39851,7 @@ var require_rimraf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39840
39851
  let errState;
39841
39852
  if (n === 0) return options.rmdir(p, cb);
39842
39853
  files.forEach((f) => {
39843
- rimraf(path$27.join(p, f), options, (er) => {
39854
+ rimraf(path$28.join(p, f), options, (er) => {
39844
39855
  if (errState) return;
39845
39856
  if (er) return cb(errState = er);
39846
39857
  if (--n === 0) options.rmdir(p, cb);
@@ -39887,7 +39898,7 @@ var require_rimraf = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39887
39898
  function rmkidsSync(p, options) {
39888
39899
  assert$2(p);
39889
39900
  assert$2(options);
39890
- options.readdirSync(p).forEach((f) => rimrafSync(path$27.join(p, f), options));
39901
+ options.readdirSync(p).forEach((f) => rimrafSync(path$28.join(p, f), options));
39891
39902
  if (isWindows) {
39892
39903
  const startTime = Date.now();
39893
39904
  do
@@ -39915,14 +39926,14 @@ var require_remove = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39915
39926
  var require_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39916
39927
  var u = require_universalify().fromCallback;
39917
39928
  var fs = require_graceful_fs();
39918
- var path$26 = __require("path");
39929
+ var path$27 = __require("path");
39919
39930
  var mkdir = require_mkdirs();
39920
39931
  var remove = require_remove();
39921
39932
  var emptyDir = u(function emptyDir(dir, callback) {
39922
39933
  callback = callback || function() {};
39923
39934
  fs.readdir(dir, (err, items) => {
39924
39935
  if (err) return mkdir.mkdirs(dir, callback);
39925
- items = items.map((item) => path$26.join(dir, item));
39936
+ items = items.map((item) => path$27.join(dir, item));
39926
39937
  deleteItem();
39927
39938
  function deleteItem() {
39928
39939
  const item = items.pop();
@@ -39942,7 +39953,7 @@ var require_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39942
39953
  return mkdir.mkdirsSync(dir);
39943
39954
  }
39944
39955
  items.forEach((item) => {
39945
- item = path$26.join(dir, item);
39956
+ item = path$27.join(dir, item);
39946
39957
  remove.removeSync(item);
39947
39958
  });
39948
39959
  }
@@ -39957,7 +39968,7 @@ var require_empty = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39957
39968
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/ensure/file.js
39958
39969
  var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39959
39970
  var u = require_universalify().fromCallback;
39960
- var path$25 = __require("path");
39971
+ var path$26 = __require("path");
39961
39972
  var fs = require_graceful_fs();
39962
39973
  var mkdir = require_mkdirs();
39963
39974
  var pathExists = require_path_exists().pathExists;
@@ -39970,7 +39981,7 @@ var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39970
39981
  }
39971
39982
  fs.stat(file, (err, stats) => {
39972
39983
  if (!err && stats.isFile()) return callback();
39973
- const dir = path$25.dirname(file);
39984
+ const dir = path$26.dirname(file);
39974
39985
  pathExists(dir, (err, dirExists) => {
39975
39986
  if (err) return callback(err);
39976
39987
  if (dirExists) return makeFile();
@@ -39987,7 +39998,7 @@ var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
39987
39998
  stats = fs.statSync(file);
39988
39999
  } catch (e) {}
39989
40000
  if (stats && stats.isFile()) return;
39990
- const dir = path$25.dirname(file);
40001
+ const dir = path$26.dirname(file);
39991
40002
  if (!fs.existsSync(dir)) mkdir.mkdirsSync(dir);
39992
40003
  fs.writeFileSync(file, "");
39993
40004
  }
@@ -40000,7 +40011,7 @@ var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40000
40011
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/ensure/link.js
40001
40012
  var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40002
40013
  var u = require_universalify().fromCallback;
40003
- var path$24 = __require("path");
40014
+ var path$25 = __require("path");
40004
40015
  var fs = require_graceful_fs();
40005
40016
  var mkdir = require_mkdirs();
40006
40017
  var pathExists = require_path_exists().pathExists;
@@ -40019,7 +40030,7 @@ var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40019
40030
  err.message = err.message.replace("lstat", "ensureLink");
40020
40031
  return callback(err);
40021
40032
  }
40022
- const dir = path$24.dirname(dstpath);
40033
+ const dir = path$25.dirname(dstpath);
40023
40034
  pathExists(dir, (err, dirExists) => {
40024
40035
  if (err) return callback(err);
40025
40036
  if (dirExists) return makeLink(srcpath, dstpath);
@@ -40039,7 +40050,7 @@ var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40039
40050
  err.message = err.message.replace("lstat", "ensureLink");
40040
40051
  throw err;
40041
40052
  }
40042
- const dir = path$24.dirname(dstpath);
40053
+ const dir = path$25.dirname(dstpath);
40043
40054
  if (fs.existsSync(dir)) return fs.linkSync(srcpath, dstpath);
40044
40055
  mkdir.mkdirsSync(dir);
40045
40056
  return fs.linkSync(srcpath, dstpath);
@@ -40052,7 +40063,7 @@ var require_link = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40052
40063
  //#endregion
40053
40064
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/ensure/symlink-paths.js
40054
40065
  var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40055
- var path$23 = __require("path");
40066
+ var path$24 = __require("path");
40056
40067
  var fs = require_graceful_fs();
40057
40068
  var pathExists = require_path_exists().pathExists;
40058
40069
  /**
@@ -40077,7 +40088,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40077
40088
  * the ability to pass in `relative to current working direcotry` paths.
40078
40089
  */
40079
40090
  function symlinkPaths(srcpath, dstpath, callback) {
40080
- if (path$23.isAbsolute(srcpath)) return fs.lstat(srcpath, (err) => {
40091
+ if (path$24.isAbsolute(srcpath)) return fs.lstat(srcpath, (err) => {
40081
40092
  if (err) {
40082
40093
  err.message = err.message.replace("lstat", "ensureSymlink");
40083
40094
  return callback(err);
@@ -40088,8 +40099,8 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40088
40099
  });
40089
40100
  });
40090
40101
  else {
40091
- const dstdir = path$23.dirname(dstpath);
40092
- const relativeToDst = path$23.join(dstdir, srcpath);
40102
+ const dstdir = path$24.dirname(dstpath);
40103
+ const relativeToDst = path$24.join(dstdir, srcpath);
40093
40104
  return pathExists(relativeToDst, (err, exists) => {
40094
40105
  if (err) return callback(err);
40095
40106
  if (exists) return callback(null, {
@@ -40103,7 +40114,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40103
40114
  }
40104
40115
  return callback(null, {
40105
40116
  "toCwd": srcpath,
40106
- "toDst": path$23.relative(dstdir, srcpath)
40117
+ "toDst": path$24.relative(dstdir, srcpath)
40107
40118
  });
40108
40119
  });
40109
40120
  });
@@ -40111,7 +40122,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40111
40122
  }
40112
40123
  function symlinkPathsSync(srcpath, dstpath) {
40113
40124
  let exists;
40114
- if (path$23.isAbsolute(srcpath)) {
40125
+ if (path$24.isAbsolute(srcpath)) {
40115
40126
  exists = fs.existsSync(srcpath);
40116
40127
  if (!exists) throw new Error("absolute srcpath does not exist");
40117
40128
  return {
@@ -40119,8 +40130,8 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40119
40130
  "toDst": srcpath
40120
40131
  };
40121
40132
  } else {
40122
- const dstdir = path$23.dirname(dstpath);
40123
- const relativeToDst = path$23.join(dstdir, srcpath);
40133
+ const dstdir = path$24.dirname(dstpath);
40134
+ const relativeToDst = path$24.join(dstdir, srcpath);
40124
40135
  exists = fs.existsSync(relativeToDst);
40125
40136
  if (exists) return {
40126
40137
  "toCwd": relativeToDst,
@@ -40131,7 +40142,7 @@ var require_symlink_paths = /* @__PURE__ */ __commonJSMin(((exports, module) =>
40131
40142
  if (!exists) throw new Error("relative srcpath does not exist");
40132
40143
  return {
40133
40144
  "toCwd": srcpath,
40134
- "toDst": path$23.relative(dstdir, srcpath)
40145
+ "toDst": path$24.relative(dstdir, srcpath)
40135
40146
  };
40136
40147
  }
40137
40148
  }
@@ -40174,7 +40185,7 @@ var require_symlink_type = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40174
40185
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/ensure/symlink.js
40175
40186
  var require_symlink = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40176
40187
  var u = require_universalify().fromCallback;
40177
- var path$22 = __require("path");
40188
+ var path$23 = __require("path");
40178
40189
  var fs = require_graceful_fs();
40179
40190
  var _mkdirs = require_mkdirs();
40180
40191
  var mkdirs = _mkdirs.mkdirs;
@@ -40197,7 +40208,7 @@ var require_symlink = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40197
40208
  srcpath = relative.toDst;
40198
40209
  symlinkType(relative.toCwd, type, (err, type) => {
40199
40210
  if (err) return callback(err);
40200
- const dir = path$22.dirname(dstpath);
40211
+ const dir = path$23.dirname(dstpath);
40201
40212
  pathExists(dir, (err, dirExists) => {
40202
40213
  if (err) return callback(err);
40203
40214
  if (dirExists) return fs.symlink(srcpath, dstpath, type, callback);
@@ -40215,7 +40226,7 @@ var require_symlink = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40215
40226
  const relative = symlinkPathsSync(srcpath, dstpath);
40216
40227
  srcpath = relative.toDst;
40217
40228
  type = symlinkTypeSync(relative.toCwd, type);
40218
- const dir = path$22.dirname(dstpath);
40229
+ const dir = path$23.dirname(dstpath);
40219
40230
  if (fs.existsSync(dir)) return fs.symlinkSync(srcpath, dstpath, type);
40220
40231
  mkdirsSync(dir);
40221
40232
  return fs.symlinkSync(srcpath, dstpath, type);
@@ -40355,7 +40366,7 @@ var require_jsonfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40355
40366
  //#endregion
40356
40367
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/json/output-json.js
40357
40368
  var require_output_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40358
- var path$21 = __require("path");
40369
+ var path$22 = __require("path");
40359
40370
  var mkdir = require_mkdirs();
40360
40371
  var pathExists = require_path_exists().pathExists;
40361
40372
  var jsonFile = require_jsonfile();
@@ -40364,7 +40375,7 @@ var require_output_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40364
40375
  callback = options;
40365
40376
  options = {};
40366
40377
  }
40367
- const dir = path$21.dirname(file);
40378
+ const dir = path$22.dirname(file);
40368
40379
  pathExists(dir, (err, itDoes) => {
40369
40380
  if (err) return callback(err);
40370
40381
  if (itDoes) return jsonFile.writeJson(file, data, options, callback);
@@ -40380,11 +40391,11 @@ var require_output_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40380
40391
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/json/output-json-sync.js
40381
40392
  var require_output_json_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40382
40393
  var fs = require_graceful_fs();
40383
- var path$20 = __require("path");
40394
+ var path$21 = __require("path");
40384
40395
  var mkdir = require_mkdirs();
40385
40396
  var jsonFile = require_jsonfile();
40386
40397
  function outputJsonSync(file, data, options) {
40387
- const dir = path$20.dirname(file);
40398
+ const dir = path$21.dirname(file);
40388
40399
  if (!fs.existsSync(dir)) mkdir.mkdirsSync(dir);
40389
40400
  jsonFile.writeJsonSync(file, data, options);
40390
40401
  }
@@ -40409,7 +40420,7 @@ var require_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40409
40420
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/move-sync/move-sync.js
40410
40421
  var require_move_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40411
40422
  var fs = require_graceful_fs();
40412
- var path$19 = __require("path");
40423
+ var path$20 = __require("path");
40413
40424
  var copySync = require_copy_sync().copySync;
40414
40425
  var removeSync = require_remove().removeSync;
40415
40426
  var mkdirpSync = require_mkdirs().mkdirpSync;
@@ -40419,7 +40430,7 @@ var require_move_sync$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40419
40430
  const overwrite = opts.overwrite || opts.clobber || false;
40420
40431
  const { srcStat } = stat.checkPathsSync(src, dest, "move");
40421
40432
  stat.checkParentPathsSync(src, srcStat, dest, "move");
40422
- mkdirpSync(path$19.dirname(dest));
40433
+ mkdirpSync(path$20.dirname(dest));
40423
40434
  return doRename(src, dest, overwrite);
40424
40435
  }
40425
40436
  function doRename(src, dest, overwrite) {
@@ -40456,7 +40467,7 @@ var require_move_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40456
40467
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/move/move.js
40457
40468
  var require_move$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40458
40469
  var fs = require_graceful_fs();
40459
- var path$18 = __require("path");
40470
+ var path$19 = __require("path");
40460
40471
  var copy = require_copy().copy;
40461
40472
  var remove = require_remove().remove;
40462
40473
  var mkdirp = require_mkdirs().mkdirp;
@@ -40473,7 +40484,7 @@ var require_move$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40473
40484
  const { srcStat } = stats;
40474
40485
  stat.checkParentPaths(src, srcStat, dest, "move", (err) => {
40475
40486
  if (err) return cb(err);
40476
- mkdirp(path$18.dirname(dest), (err) => {
40487
+ mkdirp(path$19.dirname(dest), (err) => {
40477
40488
  if (err) return cb(err);
40478
40489
  return doRename(src, dest, overwrite, cb);
40479
40490
  });
@@ -40520,7 +40531,7 @@ var require_move = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40520
40531
  var require_output = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40521
40532
  var u = require_universalify().fromCallback;
40522
40533
  var fs = require_graceful_fs();
40523
- var path$17 = __require("path");
40534
+ var path$18 = __require("path");
40524
40535
  var mkdir = require_mkdirs();
40525
40536
  var pathExists = require_path_exists().pathExists;
40526
40537
  function outputFile(file, data, encoding, callback) {
@@ -40528,7 +40539,7 @@ var require_output = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40528
40539
  callback = encoding;
40529
40540
  encoding = "utf8";
40530
40541
  }
40531
- const dir = path$17.dirname(file);
40542
+ const dir = path$18.dirname(file);
40532
40543
  pathExists(dir, (err, itDoes) => {
40533
40544
  if (err) return callback(err);
40534
40545
  if (itDoes) return fs.writeFile(file, data, encoding, callback);
@@ -40539,7 +40550,7 @@ var require_output = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40539
40550
  });
40540
40551
  }
40541
40552
  function outputFileSync(file, ...args) {
40542
- const dir = path$17.dirname(file);
40553
+ const dir = path$18.dirname(file);
40543
40554
  if (fs.existsSync(dir)) return fs.writeFileSync(file, ...args);
40544
40555
  mkdir.mkdirsSync(dir);
40545
40556
  fs.writeFileSync(file, ...args);
@@ -40553,9 +40564,9 @@ var require_output = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40553
40564
  //#region ../../node_modules/streamroller/node_modules/fs-extra/lib/index.js
40554
40565
  var require_lib$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40555
40566
  module.exports = Object.assign({}, require_fs(), require_copy_sync(), require_copy(), require_empty(), require_ensure(), require_json(), require_mkdirs(), require_move_sync(), require_move(), require_output(), require_path_exists(), require_remove());
40556
- var fs$13 = __require("fs");
40557
- if (Object.getOwnPropertyDescriptor(fs$13, "promises")) Object.defineProperty(module.exports, "promises", { get() {
40558
- return fs$13.promises;
40567
+ var fs$14 = __require("fs");
40568
+ if (Object.getOwnPropertyDescriptor(fs$14, "promises")) Object.defineProperty(module.exports, "promises", { get() {
40569
+ return fs$14.promises;
40559
40570
  } });
40560
40571
  }));
40561
40572
  //#endregion
@@ -40720,11 +40731,11 @@ var require_lib$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40720
40731
  //#region ../../node_modules/streamroller/lib/fileNameFormatter.js
40721
40732
  var require_fileNameFormatter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40722
40733
  var debug = require_src()("streamroller:fileNameFormatter");
40723
- var path$16 = __require("path");
40734
+ var path$17 = __require("path");
40724
40735
  var FILENAME_SEP = ".";
40725
40736
  var ZIP_EXT = ".gz";
40726
40737
  module.exports = ({ file, keepFileExt, needsIndex, alwaysIncludeDate, compress }) => {
40727
- const dirAndName = path$16.join(file.dir, file.name);
40738
+ const dirAndName = path$17.join(file.dir, file.name);
40728
40739
  const ext = (f) => f + file.ext;
40729
40740
  const index = (f, i, d) => (needsIndex || !d) && i ? f + FILENAME_SEP + i : f;
40730
40741
  const date = (f, i, d) => {
@@ -40869,7 +40880,7 @@ var require_moveAndMaybeCompressFile = /* @__PURE__ */ __commonJSMin(((exports,
40869
40880
  var require_RollingFileWriteStream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
40870
40881
  var debug = require_src()("streamroller:RollingFileWriteStream");
40871
40882
  var fs = require_lib$4();
40872
- var path$15 = __require("path");
40883
+ var path$16 = __require("path");
40873
40884
  var newNow = require_now();
40874
40885
  var format = require_lib$3();
40875
40886
  var { Writable: Writable$1 } = __require("stream");
@@ -40900,8 +40911,8 @@ var require_RollingFileWriteStream = /* @__PURE__ */ __commonJSMin(((exports, mo
40900
40911
  debug(`constructor: creating RollingFileWriteStream. path=${filePath}`);
40901
40912
  super(options);
40902
40913
  this.options = this._parseOption(options);
40903
- this.fileObject = path$15.parse(filePath);
40904
- if (this.fileObject.dir === "") this.fileObject = path$15.parse(path$15.join(process.cwd(), filePath));
40914
+ this.fileObject = path$16.parse(filePath);
40915
+ if (this.fileObject.dir === "") this.fileObject = path$16.parse(path$16.join(process.cwd(), filePath));
40905
40916
  this.fileFormatter = fileNameFormatter({
40906
40917
  file: this.fileObject,
40907
40918
  alwaysIncludeDate: this.options.alwaysIncludePattern,
@@ -41038,7 +41049,7 @@ var require_RollingFileWriteStream = /* @__PURE__ */ __commonJSMin(((exports, mo
41038
41049
  const existingFileDetails = await this._getExistingFiles();
41039
41050
  debug(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${existingFileDetails.length}`);
41040
41051
  debug("_clean: existing files are: ", existingFileDetails);
41041
- if (this._tooManyFiles(existingFileDetails.length)) await deleteFiles(existingFileDetails.slice(0, existingFileDetails.length - this.options.numToKeep - 1).map((f) => path$15.format({
41052
+ if (this._tooManyFiles(existingFileDetails.length)) await deleteFiles(existingFileDetails.slice(0, existingFileDetails.length - this.options.numToKeep - 1).map((f) => path$16.format({
41042
41053
  dir: this.fileObject.dir,
41043
41054
  base: f.filename
41044
41055
  })));
@@ -41112,7 +41123,7 @@ var require_lib$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41112
41123
  //#region ../../node_modules/log4js/lib/appenders/file.js
41113
41124
  var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41114
41125
  var debug = require_src()("log4js:file");
41115
- var path$14 = __require("path");
41126
+ var path$15 = __require("path");
41116
41127
  var streams = require_lib$2();
41117
41128
  var eol$2 = __require("os").EOL;
41118
41129
  function openTheStream(file, fileSize, numFiles, options) {
@@ -41139,7 +41150,7 @@ var require_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41139
41150
  * @param timezoneOffset - optional timezone offset in minutes (default system local)
41140
41151
  */
41141
41152
  function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {
41142
- file = path$14.normalize(file);
41153
+ file = path$15.normalize(file);
41143
41154
  numBackups = numBackups === void 0 ? 5 : numBackups;
41144
41155
  numBackups = numBackups === 0 ? 1 : numBackups;
41145
41156
  debug("Creating file appender (", file, ", ", logSize, ", ", numBackups, ", ", options, ", ", timezoneOffset, ")");
@@ -41218,13 +41229,13 @@ var require_dateFile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41218
41229
  //#region ../../node_modules/log4js/lib/appenders/fileSync.js
41219
41230
  var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41220
41231
  var debug = require_src()("log4js:fileSync");
41221
- var path$13 = __require("path");
41222
- var fs$12 = __require("fs");
41232
+ var path$14 = __require("path");
41233
+ var fs$13 = __require("fs");
41223
41234
  var eol = __require("os").EOL || "\n";
41224
41235
  function touchFile(file, options) {
41225
- if (fs$12.existsSync(file)) return;
41226
- const id = fs$12.openSync(file, options.flags, options.mode);
41227
- fs$12.closeSync(id);
41236
+ if (fs$13.existsSync(file)) return;
41237
+ const id = fs$13.openSync(file, options.flags, options.mode);
41238
+ fs$13.closeSync(id);
41228
41239
  }
41229
41240
  var RollingFileSync = class {
41230
41241
  constructor(filename, size, backups, options) {
@@ -41241,7 +41252,7 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41241
41252
  function currentFileSize(file) {
41242
41253
  let fileSize = 0;
41243
41254
  try {
41244
- fileSize = fs$12.statSync(file).size;
41255
+ fileSize = fs$13.statSync(file).size;
41245
41256
  } catch (e) {
41246
41257
  touchFile(file, options);
41247
41258
  }
@@ -41255,12 +41266,12 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41255
41266
  }
41256
41267
  roll(filename) {
41257
41268
  const that = this;
41258
- const nameMatcher = new RegExp(`^${path$13.basename(filename)}`);
41269
+ const nameMatcher = new RegExp(`^${path$14.basename(filename)}`);
41259
41270
  function justTheseFiles(item) {
41260
41271
  return nameMatcher.test(item);
41261
41272
  }
41262
41273
  function index(filename_) {
41263
- return parseInt(filename_.substring(`${path$13.basename(filename)}.`.length), 10) || 0;
41274
+ return parseInt(filename_.substring(`${path$14.basename(filename)}.`.length), 10) || 0;
41264
41275
  }
41265
41276
  function byIndex(a, b) {
41266
41277
  if (index(a) > index(b)) return 1;
@@ -41272,15 +41283,15 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41272
41283
  debug(`Index of ${fileToRename} is ${idx}`);
41273
41284
  if (idx < that.backups) {
41274
41285
  try {
41275
- fs$12.unlinkSync(`${filename}.${idx + 1}`);
41286
+ fs$13.unlinkSync(`${filename}.${idx + 1}`);
41276
41287
  } catch (e) {}
41277
41288
  debug(`Renaming ${fileToRename} -> ${filename}.${idx + 1}`);
41278
- fs$12.renameSync(path$13.join(path$13.dirname(filename), fileToRename), `${filename}.${idx + 1}`);
41289
+ fs$13.renameSync(path$14.join(path$14.dirname(filename), fileToRename), `${filename}.${idx + 1}`);
41279
41290
  }
41280
41291
  }
41281
41292
  function renameTheFiles() {
41282
41293
  debug("Renaming the old files");
41283
- fs$12.readdirSync(path$13.dirname(filename)).filter(justTheseFiles).sort(byIndex).reverse().forEach(increaseFileIndex);
41294
+ fs$13.readdirSync(path$14.dirname(filename)).filter(justTheseFiles).sort(byIndex).reverse().forEach(increaseFileIndex);
41284
41295
  }
41285
41296
  debug("Rolling, rolling, rolling");
41286
41297
  renameTheFiles();
@@ -41290,7 +41301,7 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41290
41301
  function writeTheChunk() {
41291
41302
  debug("writing the chunk to the file");
41292
41303
  that.currentSize += chunk.length;
41293
- fs$12.appendFileSync(that.filename, chunk);
41304
+ fs$13.appendFileSync(that.filename, chunk);
41294
41305
  }
41295
41306
  debug("in write");
41296
41307
  if (this.shouldRoll()) {
@@ -41316,7 +41327,7 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41316
41327
  */
41317
41328
  function fileAppender(file, layout, logSize, numBackups, timezoneOffset, options) {
41318
41329
  debug("fileSync appender created");
41319
- file = path$13.normalize(file);
41330
+ file = path$14.normalize(file);
41320
41331
  numBackups = numBackups === void 0 ? 5 : numBackups;
41321
41332
  numBackups = numBackups === 0 ? 1 : numBackups;
41322
41333
  function openTheStream(filePath, fileSize, numFiles) {
@@ -41325,7 +41336,7 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41325
41336
  else stream = ((f) => {
41326
41337
  touchFile(f, options);
41327
41338
  return { write(data) {
41328
- fs$12.appendFileSync(f, data);
41339
+ fs$13.appendFileSync(f, data);
41329
41340
  } };
41330
41341
  })(filePath);
41331
41342
  return stream;
@@ -41350,7 +41361,7 @@ var require_fileSync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41350
41361
  //#endregion
41351
41362
  //#region ../../node_modules/log4js/lib/appenders/index.js
41352
41363
  var require_appenders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41353
- var path$12 = __require("path");
41364
+ var path$13 = __require("path");
41354
41365
  var debug = require_src()("log4js:appenders");
41355
41366
  var configuration = require_configuration();
41356
41367
  var clustering = require_clustering();
@@ -41377,7 +41388,7 @@ var require_appenders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41377
41388
  return;
41378
41389
  }
41379
41390
  };
41380
- var loadAppenderModule = (type, config) => coreAppenders.get(type) || tryLoading(`./${type}`, config) || tryLoading(type, config) || __require.main && tryLoading(path$12.join(path$12.dirname(__require.main.filename), type), config) || tryLoading(path$12.join(process.cwd(), type), config);
41391
+ var loadAppenderModule = (type, config) => coreAppenders.get(type) || tryLoading(`./${type}`, config) || tryLoading(type, config) || __require.main && tryLoading(path$13.join(path$13.dirname(__require.main.filename), type), config) || tryLoading(path$13.join(process.cwd(), type), config);
41381
41392
  var appendersLoading = /* @__PURE__ */ new Set();
41382
41393
  var getAppender = (name, config) => {
41383
41394
  if (appenders.has(name)) return appenders.get(name);
@@ -41924,7 +41935,7 @@ var require_log4js$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41924
41935
  * Website: http://log4js.berlios.de
41925
41936
  */
41926
41937
  var debug = require_src()("log4js:main");
41927
- var fs$11 = __require("fs");
41938
+ var fs$12 = __require("fs");
41928
41939
  var deepClone = require_rfdc()({ proto: true });
41929
41940
  var configuration = require_configuration();
41930
41941
  var layouts = require_layouts();
@@ -41945,7 +41956,7 @@ var require_log4js$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
41945
41956
  function loadConfigurationFile(filename) {
41946
41957
  debug(`Loading configuration from ${filename}`);
41947
41958
  try {
41948
- return JSON.parse(fs$11.readFileSync(filename, "utf8"));
41959
+ return JSON.parse(fs$12.readFileSync(filename, "utf8"));
41949
41960
  } catch (e) {
41950
41961
  throw new Error(`Problem reading config from file "${filename}". Error was ${e.message}`, e);
41951
41962
  }
@@ -43033,10 +43044,10 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43033
43044
  //#endregion
43034
43045
  //#region ../../node_modules/sonic-boom/index.js
43035
43046
  var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43036
- var fs$10 = __require("fs");
43047
+ var fs$11 = __require("fs");
43037
43048
  var EventEmitter$8 = __require("events");
43038
43049
  var inherits = __require("util").inherits;
43039
- var path$11 = __require("path");
43050
+ var path$12 = __require("path");
43040
43051
  var sleep = require_atomic_sleep();
43041
43052
  var assert$1 = __require("assert");
43042
43053
  var BUSY_WRITE_TIMEOUT = 100;
@@ -43076,17 +43087,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43076
43087
  const flags = sonic.append ? "a" : "w";
43077
43088
  const mode = sonic.mode;
43078
43089
  if (sonic.sync) try {
43079
- if (sonic.mkdir) fs$10.mkdirSync(path$11.dirname(file), { recursive: true });
43080
- fileOpened(null, fs$10.openSync(file, flags, mode));
43090
+ if (sonic.mkdir) fs$11.mkdirSync(path$12.dirname(file), { recursive: true });
43091
+ fileOpened(null, fs$11.openSync(file, flags, mode));
43081
43092
  } catch (err) {
43082
43093
  fileOpened(err);
43083
43094
  throw err;
43084
43095
  }
43085
- else if (sonic.mkdir) fs$10.mkdir(path$11.dirname(file), { recursive: true }, (err) => {
43096
+ else if (sonic.mkdir) fs$11.mkdir(path$12.dirname(file), { recursive: true }, (err) => {
43086
43097
  if (err) return fileOpened(err);
43087
- fs$10.open(file, flags, mode, fileOpened);
43098
+ fs$11.open(file, flags, mode, fileOpened);
43088
43099
  });
43089
- else fs$10.open(file, flags, mode, fileOpened);
43100
+ else fs$11.open(file, flags, mode, fileOpened);
43090
43101
  }
43091
43102
  function SonicBoom(opts) {
43092
43103
  if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
@@ -43124,8 +43135,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43124
43135
  this.flush = flushBuffer;
43125
43136
  this.flushSync = flushBufferSync;
43126
43137
  this._actualWrite = actualWriteBuffer;
43127
- fsWriteSync = () => fs$10.writeSync(this.fd, this._writingBuf);
43128
- fsWrite = () => fs$10.write(this.fd, this._writingBuf, this.release);
43138
+ fsWriteSync = () => fs$11.writeSync(this.fd, this._writingBuf);
43139
+ fsWrite = () => fs$11.write(this.fd, this._writingBuf, this.release);
43129
43140
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
43130
43141
  this._writingBuf = "";
43131
43142
  this.write = write;
@@ -43133,12 +43144,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43133
43144
  this.flushSync = flushSync;
43134
43145
  this._actualWrite = actualWrite;
43135
43146
  fsWriteSync = () => {
43136
- if (Buffer.isBuffer(this._writingBuf)) return fs$10.writeSync(this.fd, this._writingBuf);
43137
- return fs$10.writeSync(this.fd, this._writingBuf, "utf8");
43147
+ if (Buffer.isBuffer(this._writingBuf)) return fs$11.writeSync(this.fd, this._writingBuf);
43148
+ return fs$11.writeSync(this.fd, this._writingBuf, "utf8");
43138
43149
  };
43139
43150
  fsWrite = () => {
43140
- if (Buffer.isBuffer(this._writingBuf)) return fs$10.write(this.fd, this._writingBuf, this.release);
43141
- return fs$10.write(this.fd, this._writingBuf, "utf8", this.release);
43151
+ if (Buffer.isBuffer(this._writingBuf)) return fs$11.write(this.fd, this._writingBuf, this.release);
43152
+ return fs$11.write(this.fd, this._writingBuf, "utf8", this.release);
43142
43153
  };
43143
43154
  } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
43144
43155
  if (typeof fd === "number") {
@@ -43183,7 +43194,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43183
43194
  return;
43184
43195
  }
43185
43196
  }
43186
- if (this._fsync) fs$10.fsyncSync(this.fd);
43197
+ if (this._fsync) fs$11.fsyncSync(this.fd);
43187
43198
  const len = this._len;
43188
43199
  if (this._reopening) {
43189
43200
  this._writing = false;
@@ -43280,7 +43291,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43280
43291
  this._flushPending = true;
43281
43292
  const onDrain = () => {
43282
43293
  if (!this._fsync) try {
43283
- fs$10.fsync(this.fd, (err) => {
43294
+ fs$11.fsync(this.fd, (err) => {
43284
43295
  this._flushPending = false;
43285
43296
  cb(err);
43286
43297
  });
@@ -43357,7 +43368,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43357
43368
  if (this._writing) return;
43358
43369
  const fd = this.fd;
43359
43370
  this.once("ready", () => {
43360
- if (fd !== this.fd) fs$10.close(fd, (err) => {
43371
+ if (fd !== this.fd) fs$11.close(fd, (err) => {
43361
43372
  if (err) return this.emit("error", err);
43362
43373
  });
43363
43374
  });
@@ -43388,7 +43399,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43388
43399
  while (this._bufs.length || buf.length) {
43389
43400
  if (buf.length <= 0) buf = this._bufs[0];
43390
43401
  try {
43391
- const n = Buffer.isBuffer(buf) ? fs$10.writeSync(this.fd, buf) : fs$10.writeSync(this.fd, buf, "utf8");
43402
+ const n = Buffer.isBuffer(buf) ? fs$11.writeSync(this.fd, buf) : fs$11.writeSync(this.fd, buf, "utf8");
43392
43403
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
43393
43404
  buf = releasedBufObj.writingBuf;
43394
43405
  this._len = releasedBufObj.len;
@@ -43399,7 +43410,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43399
43410
  }
43400
43411
  }
43401
43412
  try {
43402
- fs$10.fsyncSync(this.fd);
43413
+ fs$11.fsyncSync(this.fd);
43403
43414
  } catch {}
43404
43415
  }
43405
43416
  function flushBufferSync() {
@@ -43413,7 +43424,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43413
43424
  while (this._bufs.length || buf.length) {
43414
43425
  if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
43415
43426
  try {
43416
- const n = fs$10.writeSync(this.fd, buf);
43427
+ const n = fs$11.writeSync(this.fd, buf);
43417
43428
  buf = buf.subarray(n);
43418
43429
  this._len = Math.max(this._len - n, 0);
43419
43430
  if (buf.length <= 0) {
@@ -43435,24 +43446,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43435
43446
  this._writing = true;
43436
43447
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
43437
43448
  if (this.sync) try {
43438
- release(null, Buffer.isBuffer(this._writingBuf) ? fs$10.writeSync(this.fd, this._writingBuf) : fs$10.writeSync(this.fd, this._writingBuf, "utf8"));
43449
+ release(null, Buffer.isBuffer(this._writingBuf) ? fs$11.writeSync(this.fd, this._writingBuf) : fs$11.writeSync(this.fd, this._writingBuf, "utf8"));
43439
43450
  } catch (err) {
43440
43451
  release(err);
43441
43452
  }
43442
- else fs$10.write(this.fd, this._writingBuf, release);
43453
+ else fs$11.write(this.fd, this._writingBuf, release);
43443
43454
  }
43444
43455
  function actualWriteBuffer() {
43445
43456
  const release = this.release;
43446
43457
  this._writing = true;
43447
43458
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
43448
43459
  if (this.sync) try {
43449
- release(null, fs$10.writeSync(this.fd, this._writingBuf));
43460
+ release(null, fs$11.writeSync(this.fd, this._writingBuf));
43450
43461
  } catch (err) {
43451
43462
  release(err);
43452
43463
  }
43453
43464
  else {
43454
43465
  if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
43455
- fs$10.write(this.fd, this._writingBuf, release);
43466
+ fs$11.write(this.fd, this._writingBuf, release);
43456
43467
  }
43457
43468
  }
43458
43469
  function actualClose(sonic) {
@@ -43466,10 +43477,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
43466
43477
  sonic._lens = [];
43467
43478
  assert$1(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
43468
43479
  try {
43469
- fs$10.fsync(sonic.fd, closeWrapped);
43480
+ fs$11.fsync(sonic.fd, closeWrapped);
43470
43481
  } catch {}
43471
43482
  function closeWrapped() {
43472
- if (sonic.fd !== 1 && sonic.fd !== 2) fs$10.close(sonic.fd, done);
43483
+ if (sonic.fd !== 1 && sonic.fd !== 2) fs$11.close(sonic.fd, done);
43473
43484
  else done();
43474
43485
  }
43475
43486
  function done(err) {
@@ -72266,7 +72277,7 @@ var require_tcp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72266
72277
  var Transporter = require_base$1();
72267
72278
  var _ = require_lodash();
72268
72279
  var { isObject, isString } = require_utils$3();
72269
- var fs$9 = __require("fs");
72280
+ var fs$10 = __require("fs");
72270
72281
  var kleur = require_kleur();
72271
72282
  var Node = require_node();
72272
72283
  var P = require_packets();
@@ -72413,7 +72424,7 @@ var require_tcp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72413
72424
  if (isString(str) && str.startsWith("file://")) {
72414
72425
  const fName = str.replace("file://", "");
72415
72426
  this.logger.debug(`Load nodes list from file '${fName}'...`);
72416
- let content = fs$9.readFileSync(fName);
72427
+ let content = fs$10.readFileSync(fName);
72417
72428
  if (content && content.length > 0) {
72418
72429
  const str = content.toString().trim();
72419
72430
  if (str.startsWith("{") || str.startsWith("[")) return JSON.parse(str);
@@ -74903,15 +74914,15 @@ var require_ttl = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74903
74914
  //#region ../../node_modules/recursive-watch/index.js
74904
74915
  var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74905
74916
  var os$5 = __require("os");
74906
- var fs$8 = __require("fs");
74907
- var path$10 = __require("path");
74917
+ var fs$9 = __require("fs");
74918
+ var path$11 = __require("path");
74908
74919
  var Cache = require_ttl();
74909
74920
  var watchDirectory = os$5.platform() === "linux" ? watchFallback : watchRecursive;
74910
74921
  module.exports = watch;
74911
74922
  function watch(name, onchange) {
74912
74923
  var clear = null;
74913
74924
  var stopped = false;
74914
- fs$8.lstat(name, function(_, st) {
74925
+ fs$9.lstat(name, function(_, st) {
74915
74926
  if (!st || stopped) {
74916
74927
  stopped = true;
74917
74928
  return;
@@ -74927,8 +74938,8 @@ var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) =
74927
74938
  function watchFile(filename, onchange) {
74928
74939
  var prev = null;
74929
74940
  var prevTime = 0;
74930
- var w = fs$8.watch(filename, function() {
74931
- fs$8.lstat(filename, function(_, st) {
74941
+ var w = fs$9.watch(filename, function() {
74942
+ fs$9.lstat(filename, function(_, st) {
74932
74943
  var now = Date.now();
74933
74944
  if (now - prevTime > 2e3 || !same(st, prev)) onchange(filename);
74934
74945
  prevTime = now;
@@ -74940,9 +74951,9 @@ var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) =
74940
74951
  };
74941
74952
  }
74942
74953
  function watchRecursive(directory, onchange) {
74943
- var w = fs$8.watch(directory, { recursive: true }, function(change, filename) {
74954
+ var w = fs$9.watch(directory, { recursive: true }, function(change, filename) {
74944
74955
  if (!filename) return;
74945
- onchange(path$10.join(directory, filename));
74956
+ onchange(path$11.join(directory, filename));
74946
74957
  });
74947
74958
  return function() {
74948
74959
  w.close();
@@ -74970,7 +74981,7 @@ var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) =
74970
74981
  }
74971
74982
  function update() {
74972
74983
  var filename = queued[0];
74973
- fs$8.lstat(filename, function(err, st) {
74984
+ fs$9.lstat(filename, function(err, st) {
74974
74985
  var w = watching[filename];
74975
74986
  if (err && w) {
74976
74987
  w.close();
@@ -74979,30 +74990,30 @@ var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) =
74979
74990
  var prevSt = prevs.get(filename);
74980
74991
  if (!prevSt || !same(st, prevSt)) onchange(filename);
74981
74992
  prevs.put(filename, st);
74982
- visit(path$10.relative(directory, filename), function() {
74993
+ visit(path$11.relative(directory, filename), function() {
74983
74994
  queued.shift();
74984
74995
  if (queued.length) update();
74985
74996
  });
74986
74997
  });
74987
74998
  }
74988
74999
  function visit(next, cb) {
74989
- var dir = path$10.join(directory, next);
74990
- fs$8.lstat(dir, function(err, st) {
75000
+ var dir = path$11.join(directory, next);
75001
+ fs$9.lstat(dir, function(err, st) {
74991
75002
  if (err || !st.isDirectory()) return cb();
74992
75003
  if (watching[dir]) return cb();
74993
75004
  if (loaded) emit(dir);
74994
- var w = fs$8.watch(dir, function(change, filename) {
74995
- filename = path$10.join(next, filename);
74996
- emit(path$10.join(directory, filename));
75005
+ var w = fs$9.watch(dir, function(change, filename) {
75006
+ filename = path$11.join(next, filename);
75007
+ emit(path$11.join(directory, filename));
74997
75008
  });
74998
75009
  w.on("error", noop);
74999
75010
  watching[dir] = w;
75000
- fs$8.readdir(dir, function(err, list) {
75011
+ fs$9.readdir(dir, function(err, list) {
75001
75012
  if (err) return cb(err);
75002
75013
  loop();
75003
75014
  function loop() {
75004
75015
  if (!list.length) return cb();
75005
- visit(path$10.join(next, list.shift()), loop);
75016
+ visit(path$11.join(next, list.shift()), loop);
75006
75017
  }
75007
75018
  });
75008
75019
  });
@@ -75017,9 +75028,9 @@ var require_recursive_watch = /* @__PURE__ */ __commonJSMin(((exports, module) =
75017
75028
  //#endregion
75018
75029
  //#region ../../node_modules/moleculer/src/middlewares/hot-reload.js
75019
75030
  var require_hot_reload = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75020
- var fs$7 = __require("fs");
75031
+ var fs$8 = __require("fs");
75021
75032
  var kleur = require_kleur();
75022
- var path$9 = __require("path");
75033
+ var path$10 = __require("path");
75023
75034
  var watch = require_recursive_watch();
75024
75035
  var _ = require_lodash();
75025
75036
  var { clearRequireCache, makeDirs, isFunction, isString, uniq } = require_utils$3();
@@ -75031,10 +75042,10 @@ var require_hot_reload = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75031
75042
  let hotReloadModules = [];
75032
75043
  let extraFiles = null;
75033
75044
  function hotReloadService(service) {
75034
- const relPath = path$9.relative(process.cwd(), service.__filename);
75045
+ const relPath = path$10.relative(process.cwd(), service.__filename);
75035
75046
  broker.logger.info(`Hot reload '${service.name}' service...`, kleur.grey(relPath));
75036
75047
  return broker.destroyService(service).then(() => {
75037
- if (fs$7.existsSync(service.__filename)) try {
75048
+ if (fs$8.existsSync(service.__filename)) try {
75038
75049
  return broker.loadService(service.__filename);
75039
75050
  } catch (err) {
75040
75051
  broker.logger.error(`Failed to load service '${service.__filename}'`, err);
@@ -75066,7 +75077,7 @@ var require_hot_reload = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75066
75077
  });
75067
75078
  broker.logger.info(kleur.bgMagenta().white().bold(`Reload ${needToReloadDedup.length} service(s)`));
75068
75079
  needToReloadDedup.forEach((svc) => {
75069
- if (typeof svc == "string") if (fs$7.existsSync(svc)) return broker.loadService(svc);
75080
+ if (typeof svc == "string") if (fs$8.existsSync(svc)) return broker.loadService(svc);
75070
75081
  else return;
75071
75082
  return hotReloadService(svc);
75072
75083
  });
@@ -75076,19 +75087,19 @@ var require_hot_reload = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75076
75087
  broker.logger.debug("");
75077
75088
  broker.logger.debug(kleur.yellow().bold("Watching the following project files:"));
75078
75089
  projectFiles.forEach((watchItem, fName) => {
75079
- if (!fs$7.existsSync(fName)) projectFiles.delete(fName);
75090
+ if (!fs$8.existsSync(fName)) projectFiles.delete(fName);
75080
75091
  });
75081
75092
  projectFiles.forEach((watchItem, fName) => {
75082
- const relPath = path$9.relative(process.cwd(), fName);
75093
+ const relPath = path$10.relative(process.cwd(), fName);
75083
75094
  if (watchItem.brokerRestart) broker.logger.debug(` ${relPath}:`, kleur.grey("restart broker."));
75084
75095
  else if (watchItem.allServices) broker.logger.debug(` ${relPath}:`, kleur.grey("reload all services."));
75085
75096
  else if (watchItem.services.length > 0) {
75086
75097
  broker.logger.debug(` ${relPath}:`, kleur.grey(`reload ${watchItem.services.length} service(s) & ${watchItem.others.length} other(s).`));
75087
75098
  watchItem.services.forEach((svcFullname) => broker.logger.debug(kleur.grey(` ${svcFullname}`)));
75088
- watchItem.others.forEach((filename) => broker.logger.debug(kleur.grey(` ${path$9.relative(process.cwd(), filename)}`)));
75099
+ watchItem.others.forEach((filename) => broker.logger.debug(kleur.grey(` ${path$10.relative(process.cwd(), filename)}`)));
75089
75100
  }
75090
- watchItem.watcher = fs$7.watch(fName, (eventType) => {
75091
- const relPath = path$9.relative(process.cwd(), fName);
75101
+ watchItem.watcher = fs$8.watch(fName, (eventType) => {
75102
+ const relPath = path$10.relative(process.cwd(), fName);
75092
75103
  broker.logger.info(kleur.magenta().bold(`The '${relPath}' file is changed. (Event: ${eventType})`));
75093
75104
  clearRequireCache(fName);
75094
75105
  if (watchItem.others.length > 0) watchItem.others.forEach((f) => clearRequireCache(f));
@@ -75206,16 +75217,16 @@ var require_hot_reload = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75206
75217
  broker.logger.debug(kleur.yellow().bold("Watching the following folder(s):"));
75207
75218
  folders.forEach((folder) => {
75208
75219
  makeDirs(folder);
75209
- broker.logger.debug(` ${path$9.relative(process.cwd(), folder)}/`);
75220
+ broker.logger.debug(` ${path$10.relative(process.cwd(), folder)}/`);
75210
75221
  folderWatchers.push({
75211
75222
  path: folder,
75212
75223
  watcher: watch(folder, (filename) => {
75213
75224
  if (filename.endsWith(".service.js") || filename.endsWith(".service.ts")) {
75214
- broker.logger.debug(`There is changes in '${folder}' folder: `, path$9.basename(filename));
75225
+ broker.logger.debug(`There is changes in '${folder}' folder: `, path$10.basename(filename));
75215
75226
  const isLoaded = broker.services.some((svc) => svc.__filename == filename);
75216
- const fileExists = fs$7.existsSync(filename);
75227
+ const fileExists = fs$8.existsSync(filename);
75217
75228
  if (!isLoaded && fileExists) {
75218
- broker.logger.debug("Loading new file: ", path$9.basename(filename));
75229
+ broker.logger.debug("Loading new file: ", path$10.basename(filename));
75219
75230
  needToLoad.add(filename);
75220
75231
  loadServices();
75221
75232
  }
@@ -75391,8 +75402,8 @@ var require_compression = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75391
75402
  var require_transit_logger = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75392
75403
  var _ = require_lodash();
75393
75404
  var kleur = require_kleur();
75394
- var fs$6 = __require("fs");
75395
- var path$8 = __require("path");
75405
+ var fs$7 = __require("fs");
75406
+ var path$9 = __require("path");
75396
75407
  var { makeDirs, safetyObject } = require_utils$3();
75397
75408
  module.exports = function TransitLoggerMiddleware(opts) {
75398
75409
  opts = _.defaultsDeep(opts, {
@@ -75417,7 +75428,7 @@ var require_transit_logger = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75417
75428
  } catch {
75418
75429
  data = JSON.stringify(safetyObject(payload), payload instanceof Error ? Object.getOwnPropertyNames(payload) : null, 4);
75419
75430
  }
75420
- fs$6.writeFile(path$8.join(targetFolder, filename), data, () => {});
75431
+ fs$7.writeFile(path$9.join(targetFolder, filename), data, () => {});
75421
75432
  }
75422
75433
  const coloringSend = opts.colors && opts.colors.send ? opts.colors.send.split(".").reduce((a, b) => a[b] || a()[b], kleur) : (s) => s;
75423
75434
  const coloringReceive = opts.colors && opts.colors.receive ? opts.colors.receive.split(".").reduce((a, b) => a[b] || a()[b], kleur) : (s) => s;
@@ -75428,7 +75439,7 @@ var require_transit_logger = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75428
75439
  logger = opts.logger || broker.getLogger("debug");
75429
75440
  nodeID = broker.nodeID;
75430
75441
  if (opts.folder) {
75431
- targetFolder = path$8.join(opts.folder, nodeID);
75442
+ targetFolder = path$9.join(opts.folder, nodeID);
75432
75443
  makeDirs(targetFolder);
75433
75444
  }
75434
75445
  logFn = opts.logLevel ? logger[opts.logLevel] : null;
@@ -75465,8 +75476,8 @@ var require_transit_logger = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75465
75476
  var require_action_logger = /* @__PURE__ */ __commonJSMin(((exports, module) => {
75466
75477
  var _ = require_lodash();
75467
75478
  var kleur = require_kleur();
75468
- var fs$5 = __require("fs");
75469
- var path$7 = __require("path");
75479
+ var fs$6 = __require("fs");
75480
+ var path$8 = __require("path");
75470
75481
  var { makeDirs, match, isObject, safetyObject } = require_utils$3();
75471
75482
  module.exports = function ActionLoggerMiddleware(opts) {
75472
75483
  opts = _.defaultsDeep(opts, {
@@ -75495,7 +75506,7 @@ var require_action_logger = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75495
75506
  } catch {
75496
75507
  data = JSON.stringify(safetyObject(payload), payload instanceof Error ? Object.getOwnPropertyNames(payload) : null, 4);
75497
75508
  }
75498
- fs$5.writeFile(path$7.join(targetFolder, filename), data, () => {});
75509
+ fs$6.writeFile(path$8.join(targetFolder, filename), data, () => {});
75499
75510
  }
75500
75511
  function isWhiteListed(actionName) {
75501
75512
  return !!opts.whitelist.find((pattern) => match(actionName, pattern));
@@ -75510,7 +75521,7 @@ var require_action_logger = /* @__PURE__ */ __commonJSMin(((exports, module) =>
75510
75521
  logger = opts.logger || broker.getLogger("debug");
75511
75522
  nodeID = broker.nodeID;
75512
75523
  if (opts.folder) {
75513
- targetFolder = path$7.join(opts.folder, nodeID);
75524
+ targetFolder = path$8.join(opts.folder, nodeID);
75514
75525
  makeDirs(targetFolder);
75515
75526
  }
75516
75527
  logFn = opts.logLevel ? logger[opts.logLevel] : null;
@@ -78712,7 +78723,7 @@ var require_service_broker = /* @__PURE__ */ __commonJSMin(((exports, module) =>
78712
78723
  var EventEmitter2 = require_eventemitter2().EventEmitter2;
78713
78724
  var _ = require_lodash();
78714
78725
  var { globSync } = require_index_min$1();
78715
- var path$6 = __require("path");
78726
+ var path$7 = __require("path");
78716
78727
  var { format } = __require("util");
78717
78728
  var Transit = require_transit();
78718
78729
  var Registry = require_registry();
@@ -79261,7 +79272,7 @@ var require_service_broker = /* @__PURE__ */ __commonJSMin(((exports, module) =>
79261
79272
  loadServices(folder = "./services", fileMask = "**/*.service.js") {
79262
79273
  this.logger.debug(`Search services in '${folder}/${fileMask}'...`);
79263
79274
  let serviceFiles;
79264
- if (Array.isArray(fileMask)) serviceFiles = fileMask.map((f) => path$6.join(folder, f));
79275
+ if (Array.isArray(fileMask)) serviceFiles = fileMask.map((f) => path$7.join(folder, f));
79265
79276
  else serviceFiles = globSync(folder + "/" + fileMask);
79266
79277
  if (serviceFiles) serviceFiles.forEach((filename) => this.loadService(filename));
79267
79278
  return serviceFiles.length;
@@ -79277,8 +79288,8 @@ var require_service_broker = /* @__PURE__ */ __commonJSMin(((exports, module) =>
79277
79288
  loadService(filePath) {
79278
79289
  let fName, schema;
79279
79290
  try {
79280
- fName = __require.resolve(path$6.resolve(filePath));
79281
- this.logger.debug(`Load service '${path$6.basename(fName)}'...`);
79291
+ fName = __require.resolve(path$7.resolve(filePath));
79292
+ this.logger.debug(`Load service '${path$7.basename(fName)}'...`);
79282
79293
  const r = __require(fName);
79283
79294
  schema = r.default != null ? r.default : r;
79284
79295
  let svc;
@@ -82261,7 +82272,7 @@ var require_leven = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82261
82272
  //#region ../../node_modules/args/lib/utils.js
82262
82273
  var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82263
82274
  var { spawn } = __require("child_process");
82264
- var path$5 = __require("path");
82275
+ var path$6 = __require("path");
82265
82276
  var camelcase = require_camelcase();
82266
82277
  var leven = require_leven();
82267
82278
  function similarityBestMatch(mainString, targetStrings) {
@@ -82422,10 +82433,10 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82422
82433
  break;
82423
82434
  }
82424
82435
  if (process.platform === "win32") {
82425
- const binaryExt = path$5.extname(this.binary);
82436
+ const binaryExt = path$6.extname(this.binary);
82426
82437
  const mainModule = process.env.APPVEYOR ? "_fixture" : process.mainModule.filename;
82427
82438
  full = `${mainModule}-${subCommand}`;
82428
- if (path$5.extname(this.binary)) full = `${mainModule.replace(binaryExt, "")}-${subCommand}${binaryExt}`;
82439
+ if (path$6.extname(this.binary)) full = `${mainModule.replace(binaryExt, "")}-${subCommand}${binaryExt}`;
82429
82440
  args.unshift(full);
82430
82441
  this.child = spawn(process.execPath, args, { stdio: "inherit" });
82431
82442
  } else this.child = spawn(full, args, { stdio: "inherit" });
@@ -82618,7 +82629,7 @@ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82618
82629
  //#endregion
82619
82630
  //#region ../../node_modules/args/lib/parse.js
82620
82631
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82621
- var path$4 = __require("path");
82632
+ var path$5 = __require("path");
82622
82633
  var parser = require_lib$1();
82623
82634
  module.exports = function(argv, options) {
82624
82635
  Object.assign(this.config, options);
@@ -82633,7 +82644,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82633
82644
  }
82634
82645
  else this.printSubColor = this.printSubColor[this.config.subColor];
82635
82646
  this.raw = parser(argv.slice(1), this.config.mri || this.config.minimist);
82636
- this.binary = path$4.basename(this.raw._[0]);
82647
+ this.binary = path$5.basename(this.raw._[0]);
82637
82648
  if (this.config.version) this.checkVersion();
82638
82649
  if (this.config.help) this.checkHelp();
82639
82650
  const subCommand = this.raw._[1];
@@ -82718,8 +82729,8 @@ var require_help = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82718
82729
  //#endregion
82719
82730
  //#region ../../node_modules/args/lib/version.js
82720
82731
  var require_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82721
- var fs$4 = __require("fs");
82722
- var path$3 = __require("path");
82732
+ var fs$5 = __require("fs");
82733
+ var path$4 = __require("path");
82723
82734
  /**
82724
82735
  * Retrieves the main module package.json information.
82725
82736
  *
@@ -82730,13 +82741,13 @@ var require_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82730
82741
  * An object containing the package.json contents or NULL if it could not be found.
82731
82742
  */
82732
82743
  function findPackage(directory) {
82733
- const file = path$3.resolve(directory, "package.json");
82734
- if (fs$4.existsSync(file) && fs$4.statSync(file).isFile()) return __require(file);
82735
- const parent = path$3.resolve(directory, "..");
82744
+ const file = path$4.resolve(directory, "package.json");
82745
+ if (fs$5.existsSync(file) && fs$5.statSync(file).isFile()) return __require(file);
82746
+ const parent = path$4.resolve(directory, "..");
82736
82747
  return parent === directory ? null : findPackage(parent);
82737
82748
  }
82738
82749
  module.exports = function() {
82739
- const pkg = findPackage(path$3.dirname(process.mainModule.filename));
82750
+ const pkg = findPackage(path$4.dirname(process.mainModule.filename));
82740
82751
  const version = pkg && pkg.version || "-/-";
82741
82752
  console.log(version);
82742
82753
  if (this.config.exit && this.config.exit.version) process.exit();
@@ -82793,8 +82804,8 @@ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82793
82804
  //#endregion
82794
82805
  //#region ../../node_modules/dotenv/lib/main.js
82795
82806
  var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82796
- var fs$3 = __require("fs");
82797
- var path$2 = __require("path");
82807
+ var fs$4 = __require("fs");
82808
+ var path$3 = __require("path");
82798
82809
  var os$3 = __require("os");
82799
82810
  var crypto = __require("crypto");
82800
82811
  var TIPS = [
@@ -82921,14 +82932,14 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82921
82932
  function _vaultPath(options) {
82922
82933
  let possibleVaultPath = null;
82923
82934
  if (options && options.path && options.path.length > 0) if (Array.isArray(options.path)) {
82924
- for (const filepath of options.path) if (fs$3.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
82935
+ for (const filepath of options.path) if (fs$4.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
82925
82936
  } else possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
82926
- else possibleVaultPath = path$2.resolve(process.cwd(), ".env.vault");
82927
- if (fs$3.existsSync(possibleVaultPath)) return possibleVaultPath;
82937
+ else possibleVaultPath = path$3.resolve(process.cwd(), ".env.vault");
82938
+ if (fs$4.existsSync(possibleVaultPath)) return possibleVaultPath;
82928
82939
  return null;
82929
82940
  }
82930
82941
  function _resolveHome(envPath) {
82931
- return envPath[0] === "~" ? path$2.join(os$3.homedir(), envPath.slice(1)) : envPath;
82942
+ return envPath[0] === "~" ? path$3.join(os$3.homedir(), envPath.slice(1)) : envPath;
82932
82943
  }
82933
82944
  function _configVault(options) {
82934
82945
  const debug = parseBoolean(process.env.DOTENV_CONFIG_DEBUG || options && options.debug);
@@ -82941,7 +82952,7 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82941
82952
  return { parsed };
82942
82953
  }
82943
82954
  function configDotenv(options) {
82944
- const dotenvPath = path$2.resolve(process.cwd(), ".env");
82955
+ const dotenvPath = path$3.resolve(process.cwd(), ".env");
82945
82956
  let encoding = "utf8";
82946
82957
  let processEnv = process.env;
82947
82958
  if (options && options.processEnv != null) processEnv = options.processEnv;
@@ -82958,7 +82969,7 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82958
82969
  let lastError;
82959
82970
  const parsedAll = {};
82960
82971
  for (const path of optionPaths) try {
82961
- const parsed = DotenvModule.parse(fs$3.readFileSync(path, { encoding }));
82972
+ const parsed = DotenvModule.parse(fs$4.readFileSync(path, { encoding }));
82962
82973
  DotenvModule.populate(parsedAll, parsed, options);
82963
82974
  } catch (e) {
82964
82975
  if (debug) _debug(`failed to load ${path} ${e.message}`);
@@ -82971,7 +82982,7 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
82971
82982
  const keysCount = Object.keys(populated).length;
82972
82983
  const shortPaths = [];
82973
82984
  for (const filePath of optionPaths) try {
82974
- const relative = path$2.relative(process.cwd(), filePath);
82985
+ const relative = path$3.relative(process.cwd(), filePath);
82975
82986
  shortPaths.push(relative);
82976
82987
  } catch (e) {
82977
82988
  if (debug) _debug(`failed to load ${filePath} ${e.message}`);
@@ -83070,8 +83081,8 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83070
83081
  */
83071
83082
  var ServiceBroker = require_service_broker();
83072
83083
  var utils = require_utils$3();
83073
- var fs$2 = __require("fs");
83074
- var path$1 = __require("path");
83084
+ var fs$3 = __require("fs");
83085
+ var path$2 = __require("path");
83075
83086
  var { globSync } = require_index_min$1();
83076
83087
  var inspect = __require("util").inspect;
83077
83088
  var _ = require_lodash();
@@ -83199,17 +83210,17 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83199
83210
  let filePath;
83200
83211
  const configPath = process.env["MOLECULER_CONFIG"] || this.flags.config;
83201
83212
  if (configPath != null) {
83202
- if (path$1.isAbsolute(configPath)) filePath = this.tryConfigPath(configPath);
83213
+ if (path$2.isAbsolute(configPath)) filePath = this.tryConfigPath(configPath);
83203
83214
  else {
83204
- filePath = this.tryConfigPath(path$1.resolve(process.cwd(), configPath));
83215
+ filePath = this.tryConfigPath(path$2.resolve(process.cwd(), configPath));
83205
83216
  if (filePath == null) filePath = this.tryConfigPath(configPath, true);
83206
83217
  }
83207
83218
  if (filePath == null) return Promise.reject(/* @__PURE__ */ new Error(`Config file not found: ${configPath}`));
83208
83219
  }
83209
- if (filePath == null) filePath = this.tryConfigPath(path$1.resolve(process.cwd(), "moleculer.config.js"));
83210
- if (filePath == null) filePath = this.tryConfigPath(path$1.resolve(process.cwd(), "moleculer.config.json"));
83220
+ if (filePath == null) filePath = this.tryConfigPath(path$2.resolve(process.cwd(), "moleculer.config.js"));
83221
+ if (filePath == null) filePath = this.tryConfigPath(path$2.resolve(process.cwd(), "moleculer.config.json"));
83211
83222
  if (filePath == null) return Promise.resolve({});
83212
- const ext = path$1.extname(filePath);
83223
+ const ext = path$2.extname(filePath);
83213
83224
  switch (ext) {
83214
83225
  case ".json":
83215
83226
  case ".js":
@@ -83295,7 +83306,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83295
83306
  */
83296
83307
  isDirectory(p) {
83297
83308
  try {
83298
- return fs$2.lstatSync(p).isDirectory();
83309
+ return fs$3.lstatSync(p).isDirectory();
83299
83310
  } catch {}
83300
83311
  return false;
83301
83312
  }
@@ -83307,7 +83318,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83307
83318
  */
83308
83319
  isServiceFile(p) {
83309
83320
  try {
83310
- return !fs$2.lstatSync(p).isDirectory();
83321
+ return !fs$3.lstatSync(p).isDirectory();
83311
83322
  } catch {}
83312
83323
  return false;
83313
83324
  }
@@ -83332,7 +83343,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83332
83343
  this.watchFolders.length = 0;
83333
83344
  const fileMask = this.flags.mask || "**/*.service.js";
83334
83345
  const serviceDir = process.env.SERVICEDIR || "";
83335
- const svcDir = path$1.isAbsolute(serviceDir) ? serviceDir : path$1.resolve(process.cwd(), serviceDir);
83346
+ const svcDir = path$2.isAbsolute(serviceDir) ? serviceDir : path$2.resolve(process.cwd(), serviceDir);
83336
83347
  let patterns = this.servicePaths;
83337
83348
  if (process.env.SERVICES || process.env.SERVICEDIR) {
83338
83349
  if (this.isDirectory(svcDir) && !process.env.SERVICES) {
@@ -83348,7 +83359,7 @@ var require_runner = /* @__PURE__ */ __commonJSMin(((exports, module) => {
83348
83359
  if (p.startsWith("npm:")) this.loadNpmModule(p.slice(4));
83349
83360
  else {
83350
83361
  let files;
83351
- const svcPath = path$1.isAbsolute(p) ? p : path$1.resolve(svcDir, p);
83362
+ const svcPath = path$2.isAbsolute(p) ? p : path$2.resolve(svcDir, p);
83352
83363
  if (this.isDirectory(svcPath)) {
83353
83364
  if (this.config.hotReload) this.watchFolders.push(svcPath);
83354
83365
  files = globSync(svcPath + "/" + fileMask, { absolute: true });
@@ -83520,12 +83531,12 @@ var Gt = (n, t, e) => {
83520
83531
  }
83521
83532
  return h;
83522
83533
  };
83523
- var fe = "\0SLASH" + Math.random() + "\0", ue = "\0OPEN" + Math.random() + "\0", qt = "\0CLOSE" + Math.random() + "\0", de = "\0COMMA" + Math.random() + "\0", pe = "\0PERIOD" + Math.random() + "\0", is = new RegExp(fe, "g"), rs = new RegExp(ue, "g"), ns = new RegExp(qt, "g"), os$1 = new RegExp(de, "g"), hs = new RegExp(pe, "g"), as = /\\\\/g, ls = /\\{/g, cs = /\\}/g, fs$1 = /\\,/g, us = /\\./g, ds = 1e5;
83534
+ var fe = "\0SLASH" + Math.random() + "\0", ue = "\0OPEN" + Math.random() + "\0", qt = "\0CLOSE" + Math.random() + "\0", de = "\0COMMA" + Math.random() + "\0", pe = "\0PERIOD" + Math.random() + "\0", is = new RegExp(fe, "g"), rs = new RegExp(ue, "g"), ns = new RegExp(qt, "g"), os$1 = new RegExp(de, "g"), hs = new RegExp(pe, "g"), as = /\\\\/g, ls = /\\{/g, cs = /\\}/g, fs$2 = /\\,/g, us = /\\./g, ds = 1e5;
83524
83535
  function Ht(n) {
83525
83536
  return isNaN(n) ? n.charCodeAt(0) : parseInt(n, 10);
83526
83537
  }
83527
83538
  function ps(n) {
83528
- return n.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs$1, de).replace(us, pe);
83539
+ return n.replace(as, fe).replace(ls, ue).replace(cs, qt).replace(fs$2, de).replace(us, pe);
83529
83540
  }
83530
83541
  function ms(n) {
83531
83542
  return n.replace(is, "\\").replace(rs, "{").replace(ns, "}").replace(os$1, ",").replace(hs, ".");
@@ -83699,7 +83710,7 @@ var xs = new Set([
83699
83710
  "+",
83700
83711
  "*",
83701
83712
  "@"
83702
- ]), be = (n) => xs.has(n), vs = "(?!(?:^|/)\\.\\.?(?:$|/))", Ct = "(?!\\.)", Cs = new Set(["[", "."]), Ts = new Set(["..", "."]), As$1 = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Kt = "[^/]", Se = Kt + "*?", Ee = Kt + "+?", Q = class n {
83713
+ ]), be = (n) => xs.has(n), vs = "(?!(?:^|/)\\.\\.?(?:$|/))", Ct = "(?!\\.)", Cs = new Set(["[", "."]), Ts = new Set(["..", "."]), As = /* @__PURE__ */ new Set("().*{}+?[]^$\\!"), ks = (n) => n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), Kt = "[^/]", Se = Kt + "*?", Ee = Kt + "+?", Q = class n {
83703
83714
  type;
83704
83715
  #t;
83705
83716
  #s;
@@ -83906,7 +83917,7 @@ var xs = new Set([
83906
83917
  for (let a = 0; a < t.length; a++) {
83907
83918
  let l = t.charAt(a);
83908
83919
  if (i) {
83909
- i = !1, r += (As$1.has(l) ? "\\" : "") + l;
83920
+ i = !1, r += (As.has(l) ? "\\" : "") + l;
83910
83921
  continue;
83911
83922
  }
83912
83923
  if (l === "*") {
@@ -84890,7 +84901,7 @@ var q = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n), De = (n) => q(n
84890
84901
  var Ne = typeof process == "object" && process ? process : {
84891
84902
  stdout: null,
84892
84903
  stderr: null
84893
- }, oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof As || hi(n) || ai(n)), hi = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.pipe == "function" && n.pipe !== As.Writable.prototype.pipe, ai = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.write == "function" && typeof n.end == "function", G = Symbol("EOF"), H = Symbol("maybeEmitEnd"), K = Symbol("emittedEnd"), kt = Symbol("emittingEnd"), ut = Symbol("emittedError"), Rt = Symbol("closed"), _e = Symbol("read"), Ot = Symbol("flush"), Le = Symbol("flushChunk"), P = Symbol("encoding"), et = Symbol("decoder"), v = Symbol("flowing"), dt = Symbol("paused"), st = Symbol("resume"), C = Symbol("buffer"), F = Symbol("pipes"), T = Symbol("bufferLength"), Yt = Symbol("bufferPush"), Ft = Symbol("bufferShift"), k = Symbol("objectMode"), x = Symbol("destroyed"), Xt = Symbol("error"), Jt = Symbol("emitData"), We = Symbol("emitEnd"), Zt = Symbol("emitEnd2"), B = Symbol("async"), Qt = Symbol("abort"), Dt = Symbol("aborted"), pt = Symbol("signal"), Y = Symbol("dataListeners"), M = Symbol("discarded"), mt = (n) => Promise.resolve().then(n), li = (n) => n(), ci = (n) => n === "end" || n === "finish" || n === "prefinish", fi = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, ui = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), Mt = class {
84904
+ }, oi = (n) => !!n && typeof n == "object" && (n instanceof V || n instanceof Pe || hi(n) || ai(n)), hi = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.pipe == "function" && n.pipe !== Pe.Writable.prototype.pipe, ai = (n) => !!n && typeof n == "object" && n instanceof EventEmitter && typeof n.write == "function" && typeof n.end == "function", G = Symbol("EOF"), H = Symbol("maybeEmitEnd"), K = Symbol("emittedEnd"), kt = Symbol("emittingEnd"), ut = Symbol("emittedError"), Rt = Symbol("closed"), _e = Symbol("read"), Ot = Symbol("flush"), Le = Symbol("flushChunk"), P = Symbol("encoding"), et = Symbol("decoder"), v = Symbol("flowing"), dt = Symbol("paused"), st = Symbol("resume"), C = Symbol("buffer"), F = Symbol("pipes"), T = Symbol("bufferLength"), Yt = Symbol("bufferPush"), Ft = Symbol("bufferShift"), k = Symbol("objectMode"), x = Symbol("destroyed"), Xt = Symbol("error"), Jt = Symbol("emitData"), We = Symbol("emitEnd"), Zt = Symbol("emitEnd2"), B = Symbol("async"), Qt = Symbol("abort"), Dt = Symbol("aborted"), pt = Symbol("signal"), Y = Symbol("dataListeners"), M = Symbol("discarded"), mt = (n) => Promise.resolve().then(n), li = (n) => n(), ci = (n) => n === "end" || n === "finish" || n === "prefinish", fi = (n) => n instanceof ArrayBuffer || !!n && typeof n == "object" && n.constructor && n.constructor.name === "ArrayBuffer" && n.byteLength >= 0, ui = (n) => !Buffer.isBuffer(n) && ArrayBuffer.isView(n), Mt = class {
84894
84905
  src;
84895
84906
  dest;
84896
84907
  opts;
@@ -86448,7 +86459,7 @@ var Li = (n, t) => typeof n == "string" ? new ot([n], t) : Array.isArray(n) ? ne
86448
86459
  return this.path.isUnknown() && this.path.lstatSync(), this.walkCBSync(this.path, this.patterns, () => this.results.end()), this.results;
86449
86460
  }
86450
86461
  };
86451
- var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", I$1 = class {
86462
+ var Pi = typeof process == "object" && process && typeof process.platform == "string" ? process.platform : "linux", I = class {
86452
86463
  absolute;
86453
86464
  cwd;
86454
86465
  root;
@@ -86573,22 +86584,22 @@ var le = (n, t = {}) => {
86573
86584
  return !1;
86574
86585
  };
86575
86586
  function Bt(n, t = {}) {
86576
- return new I$1(n, t).streamSync();
86587
+ return new I(n, t).streamSync();
86577
86588
  }
86578
86589
  function Qe(n, t = {}) {
86579
- return new I$1(n, t).stream();
86590
+ return new I(n, t).stream();
86580
86591
  }
86581
86592
  function ts(n, t = {}) {
86582
- return new I$1(n, t).walkSync();
86593
+ return new I(n, t).walkSync();
86583
86594
  }
86584
86595
  async function Je(n, t = {}) {
86585
- return new I$1(n, t).walk();
86596
+ return new I(n, t).walk();
86586
86597
  }
86587
86598
  function Ut(n, t = {}) {
86588
- return new I$1(n, t).iterateSync();
86599
+ return new I(n, t).iterateSync();
86589
86600
  }
86590
86601
  function es(n, t = {}) {
86591
- return new I$1(n, t).iterate();
86602
+ return new I(n, t).iterate();
86592
86603
  }
86593
86604
  var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(es, { sync: Ut }), Ui = Object.assign(ts, {
86594
86605
  stream: Bt,
@@ -86605,7 +86616,7 @@ var ji = Bt, Ii = Object.assign(Qe, { sync: Bt }), zi = Ut, Bi = Object.assign(e
86605
86616
  iterate: Bi,
86606
86617
  globIterateSync: Ut,
86607
86618
  iterateSync: zi,
86608
- Glob: I$1,
86619
+ Glob: I,
86609
86620
  hasMagic: le,
86610
86621
  escape: tt,
86611
86622
  unescape: W
@@ -86733,6 +86744,63 @@ import_moleculer.default.Utils;
86733
86744
  import_moleculer.default.Validator;
86734
86745
  import_moleculer.default.Validators;
86735
86746
  //#endregion
86747
+ //#region src/kernel/moleculer/mesh-mtls/mesh-peer-verification.ts
86748
+ /**
86749
+ * The hub's judgement of a mesh peer's leaf (#558, amends D857).
86750
+ *
86751
+ * Node verifies the chain and the clock in one step and reports a single error, so an expired leaf
86752
+ * and a forged one both fail the handshake. The listener therefore keeps verification ON but lets
86753
+ * the handshake finish (`rejectUnauthorized: false` reports `authorized` / `authorizationError`),
86754
+ * and decides here, explicitly: a peer is admitted when it is authorized, or - on the hub only -
86755
+ * when its sole failure is `CERT_HAS_EXPIRED` AND an independent check proves the leaf is signed by
86756
+ * the mesh CA, is a client-auth end entity, has started, and is not on the CRL. Revocation stays the
86757
+ * kill switch.
86758
+ */
86759
+ function chainsToCa(leaf, ca, now) {
86760
+ if (now < Date.parse(ca.validFrom) || now > Date.parse(ca.validTo)) return false;
86761
+ if (!leaf.checkIssued(ca)) return false;
86762
+ if (!leaf.verify(ca.publicKey)) return false;
86763
+ if (leaf.ca) return false;
86764
+ return (leaf.keyUsage ?? []).includes(CLIENT_AUTH_OID);
86765
+ }
86766
+ function refused(reason, nodeId, detail) {
86767
+ return {
86768
+ admit: false,
86769
+ reason,
86770
+ nodeId,
86771
+ detail
86772
+ };
86773
+ }
86774
+ function judgeMeshPeerLeaf(input) {
86775
+ if (input.leafDer === void 0) return refused("no-certificate", null, "no client certificate");
86776
+ let leaf;
86777
+ let ca;
86778
+ try {
86779
+ leaf = new X509Certificate(input.leafDer);
86780
+ ca = new X509Certificate(input.caCertPem);
86781
+ } catch {
86782
+ return refused("not-chained", null, "unparseable certificate");
86783
+ }
86784
+ const nodeId = subjectCn(leaf.subject);
86785
+ if (nodeId === null || nodeId.length === 0) return refused("cn-mismatch", null, "leaf has no CN");
86786
+ const timeOnly = !input.authorized && input.authorizationError === "CERT_HAS_EXPIRED";
86787
+ if (!input.authorized && !timeOnly) return refused(input.authorizationError === "CERT_NOT_YET_VALID" ? "not-yet-valid" : "not-chained", nodeId, input.authorizationError ?? "unverified");
86788
+ if (timeOnly) {
86789
+ if (!chainsToCa(leaf, ca, input.now)) return refused("not-chained", nodeId, "expired and not signed by the mesh CA");
86790
+ if (input.now < Date.parse(leaf.validFrom)) return refused("not-yet-valid", nodeId, "leaf not valid yet");
86791
+ }
86792
+ const serial = leaf.serialNumber;
86793
+ if (input.crl.isRevoked(serial)) return refused("revoked", nodeId, `serial ${serial} is revoked`);
86794
+ if (timeOnly && !input.admitExpired) return refused("expired", nodeId, "leaf expired");
86795
+ return {
86796
+ admit: true,
86797
+ nodeId,
86798
+ serial,
86799
+ expired: timeOnly,
86800
+ notAfter: Date.parse(leaf.validTo)
86801
+ };
86802
+ }
86803
+ //#endregion
86736
86804
  //#region src/kernel/moleculer/mesh-mtls/tls-tcp-transporter.ts
86737
86805
  /**
86738
86806
  * Moleculer TCP transporter with a mutual-TLS listener (D826, D848).
@@ -86850,6 +86918,8 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
86850
86918
  tlsServer = null;
86851
86919
  meshTls;
86852
86920
  crl;
86921
+ handshakeReporter;
86922
+ refusalLoggedAt = /* @__PURE__ */ new Map();
86853
86923
  revokedPeerLoggedAt = /* @__PURE__ */ new Map();
86854
86924
  tlsSockets = /* @__PURE__ */ new Set();
86855
86925
  /** Node id (certificate CN) → serial of every peer that completed a mutual-TLS handshake. */
@@ -86872,6 +86942,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
86872
86942
  super({ ...opts });
86873
86943
  this.meshTls = opts.meshTls ?? null;
86874
86944
  this.crl = opts.crl ?? processMeshCrl();
86945
+ this.handshakeReporter = opts.handshakeReporter;
86875
86946
  this.hubTlsOnly = opts.hubTlsOnly === true;
86876
86947
  this.hubOnlyPeers = opts.hubOnlyPeers === true;
86877
86948
  this.hubNodeId = opts.hubNodeId ?? DEFAULT_HUB_NODE_ID;
@@ -87110,9 +87181,42 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
87110
87181
  if (last !== void 0 && at - last < REVOKED_PEER_LOG_INTERVAL_MS) return;
87111
87182
  if (this.revokedPeerLoggedAt.size >= 256) this.revokedPeerLoggedAt.clear();
87112
87183
  this.revokedPeerLoggedAt.set(nodeId, at);
87113
- this.logger.warn(`Mesh TLS peer presented a revoked certificate - ${action}`, {
87114
- tags: { nodeId },
87115
- meta: { reason: "revoked" }
87184
+ this.reportWarn(`Mesh TLS peer presented a revoked certificate - ${action}`, nodeId, "revoked");
87185
+ }
87186
+ reporter() {
87187
+ return this.handshakeReporter ?? getProcessMeshHandshakeReporter();
87188
+ }
87189
+ /** A WARN that survives the transport log pin: the reporter when there is one, else the logger. */
87190
+ reportWarn(message, nodeId, reason, meta = {}) {
87191
+ const extras = {
87192
+ ...nodeId !== null ? { tags: { nodeId } } : {},
87193
+ meta: {
87194
+ reason,
87195
+ ...meta
87196
+ }
87197
+ };
87198
+ const reporter = this.reporter();
87199
+ if (reporter !== null) reporter.warn(message, extras);
87200
+ else this.logger.warn(message, extras);
87201
+ }
87202
+ /**
87203
+ * A refusal, once per window. Only `expired` carries a node id that was proven (the chain to the
87204
+ * mesh CA was checked); every other refusal is of a peer nobody vouched for, whose CN is whatever
87205
+ * it wrote. Those are keyed by remote address, and the claimed CN goes in `meta`, never in
87206
+ * `tags.nodeId` - a peer must not mint a log tag or a rate-limit key per CN.
87207
+ */
87208
+ noteRefusedPeer(claimedCn, reason, detail, remoteAddress) {
87209
+ const proven = reason === "expired" && claimedCn !== null;
87210
+ const origin = remoteAddress?.replace(/^::ffff:/, "") ?? "unknown";
87211
+ const key = proven ? `node:${claimedCn}:${reason}` : `addr:${origin}:${reason}`;
87212
+ const at = Date.now();
87213
+ const last = this.refusalLoggedAt.get(key);
87214
+ if (last !== void 0 && at - last < REVOKED_PEER_LOG_INTERVAL_MS) return;
87215
+ if (this.refusalLoggedAt.size >= 256) this.refusalLoggedAt.clear();
87216
+ this.refusalLoggedAt.set(key, at);
87217
+ this.reportWarn(`Mesh TLS handshake refused (${reason}): ${detail}`, proven ? claimedCn : null, reason, proven ? { remoteAddress: origin } : {
87218
+ remoteAddress: origin,
87219
+ ...claimedCn !== null ? { claimedNodeId: claimedCn } : {}
87116
87220
  });
87117
87221
  }
87118
87222
  /** Close sockets whose peer serial was just revoked. */
@@ -87228,11 +87332,11 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
87228
87332
  cert: material.certPem,
87229
87333
  ca: [material.caCertPem],
87230
87334
  requestCert: true,
87231
- rejectUnauthorized: true,
87335
+ rejectUnauthorized: false,
87232
87336
  minVersion: "TLSv1.3"
87233
87337
  }, (socket) => this.onTlsClientConnected(socket));
87234
- server.on("tlsClientError", (err) => {
87235
- this.logger.debug("Mesh TLS handshake failed", err);
87338
+ server.on("tlsClientError", (err, failed) => {
87339
+ this.noteRefusedPeer(null, "handshake-failed", `TLS handshake failed: ${err.message}`, failed.remoteAddress);
87236
87340
  });
87237
87341
  server.on("error", (err) => {
87238
87342
  this.logger.error("Mesh TLS server error.", err);
@@ -87252,20 +87356,41 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
87252
87356
  });
87253
87357
  });
87254
87358
  }
87359
+ /**
87360
+ * The hub let a peer in on a leaf that only expired: say so, and hand the node to the renewal,
87361
+ * which swaps it for the no-expiry leaf. The WARN is not rate limited - it is a recovery event.
87362
+ */
87363
+ admitExpiredLeaf(nodeId, serial, notAfter) {
87364
+ this.reportWarn(`Mesh leaf of node '${nodeId}' expired ${new Date(notAfter).toISOString()} - admitted for recovery, renewing it`, nodeId, "expired");
87365
+ this.reporter()?.expiredLeafAdmitted?.({
87366
+ nodeId,
87367
+ serial,
87368
+ notAfter
87369
+ });
87370
+ }
87255
87371
  onTlsClientConnected(socket) {
87256
- const identity = peerIdentity(socket);
87257
- if (identity === null) {
87258
- this.logger.warn("Mesh TLS client rejected — no peer certificate CN");
87259
- socket.destroy();
87260
- return;
87261
- }
87262
- if (this.crl.isRevoked(identity.serial)) {
87263
- this.noteRevokedPeer(identity.cn, "rejecting its connection");
87372
+ const presented = socket.getPeerCertificate(true);
87373
+ const verdict = judgeMeshPeerLeaf({
87374
+ leafDer: presented != null && typeof presented === "object" && Buffer.isBuffer(presented.raw) ? presented.raw : void 0,
87375
+ authorized: socket.authorized,
87376
+ authorizationError: authorizationCodeOf(socket.authorizationError),
87377
+ caCertPem: (this.meshTls ?? { caCertPem: "" }).caCertPem,
87378
+ crl: this.crl,
87379
+ admitExpired: this.hubTlsOnly,
87380
+ now: Date.now()
87381
+ });
87382
+ if (!verdict.admit) {
87383
+ if (verdict.reason === "revoked") this.noteRevokedPeer(verdict.nodeId ?? "unknown", "rejecting its connection");
87384
+ else this.noteRefusedPeer(verdict.nodeId, verdict.reason, verdict.detail, socket.remoteAddress);
87264
87385
  socket.destroy();
87265
87386
  return;
87266
87387
  }
87388
+ const identity = {
87389
+ cn: verdict.nodeId,
87390
+ serial: verdict.serial
87391
+ };
87267
87392
  if (this.hubOnlyPeers && identity.cn !== this.hubNodeId) {
87268
- this.logger.warn(`Mesh TLS client rejected — an enrolled agent accepts only '${this.hubNodeId}', not CN=${identity.cn} (D848)`);
87393
+ this.noteRefusedPeer(identity.cn, "cn-mismatch", `an enrolled agent accepts only '${this.hubNodeId}' (D848)`, socket.remoteAddress);
87269
87394
  socket.destroy();
87270
87395
  return;
87271
87396
  }
@@ -87274,6 +87399,7 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
87274
87399
  this.tlsSockets.add(socket);
87275
87400
  this.tlsPeers.set(identity.cn, identity.serial);
87276
87401
  this.rememberPeerLeaf(identity.cn, socket);
87402
+ if (verdict.expired) this.admitExpiredLeaf(identity.cn, identity.serial, verdict.notAfter);
87277
87403
  const reader = this.reader;
87278
87404
  socket.on("close", () => {
87279
87405
  this.tlsSockets.delete(socket);
@@ -87299,6 +87425,12 @@ var TlsTcpTransporter = class extends TcpTransporterBase {
87299
87425
  });
87300
87426
  }
87301
87427
  };
87428
+ /** Node types the server-side `authorizationError` as an Error but sets the OpenSSL code name. */
87429
+ function authorizationCodeOf(error) {
87430
+ if (typeof error === "string") return error;
87431
+ if (error instanceof Error) return error.message;
87432
+ return null;
87433
+ }
87302
87434
  function isTlsSocket(socket) {
87303
87435
  return typeof socket.getPeerCertificate === "function" && typeof socket.encrypted === "boolean" && socket.encrypted === true;
87304
87436
  }
@@ -89309,4 +89441,4 @@ function parseMintUnlockInput(input) {
89309
89441
  };
89310
89442
  }
89311
89443
  //#endregion
89312
- export { caFingerprint as $, emitProcessNodeRegistered as A, setProcessMeshTlsListenerState as B, verifyMembershipAnswer as C, parseOriginList as Ct, ServiceBroker as D, parseCidrList as Dt, Errors as E, normalizeIp as Et, setProcessMeshPeerTransportLookup as F, describeMeshLeaf as G, MESH_NODE_CERTIFICATES_COLUMNS as H, renewMeshCertificate as I, MeshCrl as J, getProcessMeshCertificateRegistry as K, revokeMeshCertificate as L, getProcessPeerLeaf as M, isProcessVerifiedMeshPeer as N, setProcessMeshTlsEnabler as O, readCidrSetting as Ot, onProcessNodeRegistered as P, requireProcessMeshCa as Q, getProcessMeshTlsListenerState as R, signMembershipProof as S, SYSTEM_CONFIG_CLUSTER_SECTION_ID, normalizeOrigin as St, SystemConfigAddon, SystemConfigAddon as default, TlsTcpTransporter as T, createCidrMatcher as Tt, MeshCertificateRegistry as U, MESH_NODE_CERTIFICATES_COLLECTION as V, RENEWAL_ABANDONED as W, MeshCaKeeper as X, processMeshCrl as Y, getProcessMeshCaState as Z, keyFingerprintShort as _, parseAgentDashboardOrigins as _t, dialableHubHost as a, isValidAgentNodeId as at, MEMBERSHIP_PATHS as b, OPAQUE_ORIGIN as bt, PAIRING_MAX_CODE_ATTEMPTS as c, loadMeshCa as ct, PAIRING_PIN_DIGITS as d, AGENT_UI_UNLOCK_TYP as dt, caFingerprintCompact as et, PAIRING_PROTOCOL as f, AGENT_UI_UNLOCK_USE as ft, describeCsr as g, mintAgentUiUnlockTicket as gt, computePairingSas as h, isAllowedAgentDashboardReturnTo as ht, AgentPairing as i, generateMeshKeyPair as it, getProcessNodeMeshTransport as j, dropProcessPeer as k, PAIRING_MAX_SESSIONS as l, AGENT_DASHBOARD_ORIGINS_FIELD as lt, computePairingCommitment as m, UnlockTicketJtiStore as mt, HubPairing as n, exportMeshPrivateKeyPem as nt, hubHostFromMeshAddress as o, issueMeshLeafForNode as ot, PAIRING_TTL_MS as p, AGENT_UI_UNLOCK_VERSION as pt, setProcessMeshCertificateRegistry as q, PairingHttpError as r, generateMeshCa as rt, PAIRING_CODE_DIGITS as s, issueMeshLeafFromCsr as st, systemConfigMeshActions as t, createMeshCsrPem as tt, PAIRING_PATHS as u, AGENT_UI_UNLOCK_TTL_MS as ut, signPairingProof as v, verifyAgentUiUnlockTicket as vt, MESH_TLS_PORT_HELLO_FIELD as w, readOriginSetting as wt, MembershipResponder as x, isInsecureOrigin as xt, verifyPairingProof as y, InvalidCorsOriginError as yt, openMeshTlsWhenRevocationsLoaded as z };
89444
+ export { getProcessMeshCaState as $, emitProcessNodeRegistered as A, readCidrSetting as At, getProcessMeshTlsListenerState as B, verifyMembershipAnswer as C, isInsecureOrigin as Ct, ServiceBroker as D, createCidrMatcher as Dt, Errors as E, readOriginSetting as Et, onProcessNodeRegistered as F, MeshCertificateRegistry as G, setProcessMeshTlsListenerState as H, setProcessMeshHandshakeReporter as I, getProcessMeshCertificateRegistry as J, RENEWAL_ABANDONED as K, setProcessMeshPeerTransportLookup as L, getProcessNodeMeshTransport as M, getProcessPeerLeaf as N, setProcessMeshTlsEnabler as O, normalizeIp as Ot, isProcessVerifiedMeshPeer as P, MeshCaKeeper as Q, renewMeshCertificate as R, signMembershipProof as S, SYSTEM_CONFIG_CLUSTER_SECTION_ID, OPAQUE_ORIGIN as St, SystemConfigAddon, SystemConfigAddon as default, TlsTcpTransporter as T, parseOriginList as Tt, MESH_NODE_CERTIFICATES_COLLECTION as U, openMeshTlsWhenRevocationsLoaded as V, MESH_NODE_CERTIFICATES_COLUMNS as W, MeshCrl as X, setProcessMeshCertificateRegistry as Y, processMeshCrl as Z, keyFingerprintShort as _, isAllowedAgentDashboardReturnTo as _t, dialableHubHost as a, generateMeshCa as at, MEMBERSHIP_PATHS as b, verifyAgentUiUnlockTicket as bt, PAIRING_MAX_CODE_ATTEMPTS as c, issueMeshLeafForNode as ct, PAIRING_PIN_DIGITS as d, AGENT_DASHBOARD_ORIGINS_FIELD as dt, requireProcessMeshCa as et, PAIRING_PROTOCOL as f, AGENT_UI_UNLOCK_TTL_MS as ft, describeCsr as g, UnlockTicketJtiStore as gt, computePairingSas as h, AGENT_UI_UNLOCK_VERSION as ht, AgentPairing as i, exportMeshPrivateKeyPem as it, getProcessMeshHandshakeReporter as j, dropProcessPeer as k, parseCidrList as kt, PAIRING_MAX_SESSIONS as l, issueMeshLeafFromCsr as lt, computePairingCommitment as m, AGENT_UI_UNLOCK_USE as mt, HubPairing as n, caFingerprintCompact as nt, hubHostFromMeshAddress as o, generateMeshKeyPair as ot, PAIRING_TTL_MS as p, AGENT_UI_UNLOCK_TYP as pt, describeMeshLeaf as q, PairingHttpError as r, createMeshCsrPem as rt, PAIRING_CODE_DIGITS as s, isValidAgentNodeId as st, systemConfigMeshActions as t, caFingerprint as tt, PAIRING_PATHS as u, loadMeshCa as ut, signPairingProof as v, mintAgentUiUnlockTicket as vt, MESH_TLS_PORT_HELLO_FIELD as w, normalizeOrigin as wt, MembershipResponder as x, InvalidCorsOriginError as xt, verifyPairingProof as y, parseAgentDashboardOrigins as yt, revokeMeshCertificate as z };