convex 1.43.0-alpha.0 → 1.43.0

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 (54) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/browser.bundle.js +1 -1
  3. package/dist/browser.bundle.js.map +1 -1
  4. package/dist/cjs/cli/lib/localDeployment/run.js +1 -1
  5. package/dist/cjs/cli/lib/localDeployment/run.js.map +2 -2
  6. package/dist/cjs/cli/lib/utils/sentry.js +2 -0
  7. package/dist/cjs/cli/lib/utils/sentry.js.map +2 -2
  8. package/dist/cjs/index.js +1 -1
  9. package/dist/cjs/index.js.map +1 -1
  10. package/dist/cjs/server/database.js.map +1 -1
  11. package/dist/cjs/server/log.js +1 -2
  12. package/dist/cjs/server/log.js.map +2 -2
  13. package/dist/cjs/server/logVars.js +1 -4
  14. package/dist/cjs/server/logVars.js.map +2 -2
  15. package/dist/cjs-types/cli/lib/utils/sentry.d.ts +1 -0
  16. package/dist/cjs-types/cli/lib/utils/sentry.d.ts.map +1 -1
  17. package/dist/cjs-types/index.d.ts +1 -1
  18. package/dist/cjs-types/index.d.ts.map +1 -1
  19. package/dist/cjs-types/server/database.d.ts +14 -0
  20. package/dist/cjs-types/server/database.d.ts.map +1 -1
  21. package/dist/cjs-types/server/log.d.ts.map +1 -1
  22. package/dist/cjs-types/server/logVars.d.ts +0 -6
  23. package/dist/cjs-types/server/logVars.d.ts.map +1 -1
  24. package/dist/cli.bundle.cjs +245 -180
  25. package/dist/cli.bundle.cjs.map +4 -4
  26. package/dist/esm/cli/lib/localDeployment/run.js +2 -2
  27. package/dist/esm/cli/lib/localDeployment/run.js.map +2 -2
  28. package/dist/esm/cli/lib/utils/sentry.js +1 -0
  29. package/dist/esm/cli/lib/utils/sentry.js.map +2 -2
  30. package/dist/esm/index.js +1 -1
  31. package/dist/esm/index.js.map +1 -1
  32. package/dist/esm/server/log.js +2 -3
  33. package/dist/esm/server/log.js.map +2 -2
  34. package/dist/esm/server/logVars.js +1 -3
  35. package/dist/esm/server/logVars.js.map +2 -2
  36. package/dist/esm-types/cli/lib/utils/sentry.d.ts +1 -0
  37. package/dist/esm-types/cli/lib/utils/sentry.d.ts.map +1 -1
  38. package/dist/esm-types/index.d.ts +1 -1
  39. package/dist/esm-types/index.d.ts.map +1 -1
  40. package/dist/esm-types/server/database.d.ts +14 -0
  41. package/dist/esm-types/server/database.d.ts.map +1 -1
  42. package/dist/esm-types/server/log.d.ts.map +1 -1
  43. package/dist/esm-types/server/logVars.d.ts +0 -6
  44. package/dist/esm-types/server/logVars.d.ts.map +1 -1
  45. package/dist/react.bundle.js +1 -1
  46. package/dist/react.bundle.js.map +1 -1
  47. package/package.json +2 -3
  48. package/src/cli/lib/localDeployment/run.ts +2 -2
  49. package/src/cli/lib/utils/sentry.ts +3 -0
  50. package/src/index.ts +1 -1
  51. package/src/server/audit_logging.test.ts +1 -1
  52. package/src/server/database.ts +0 -2
  53. package/src/server/log.ts +1 -4
  54. package/src/server/logVars.ts +0 -7
@@ -47526,7 +47526,7 @@ var version;
47526
47526
  var init_index = __esm({
47527
47527
  "src/index.ts"() {
47528
47528
  "use strict";
47529
- version = "1.43.0-alpha.0";
47529
+ version = "1.43.0";
47530
47530
  }
47531
47531
  });
47532
47532
 
@@ -50917,9 +50917,9 @@ var init_serve = __esm({
50917
50917
  }
50918
50918
  });
50919
50919
 
50920
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js
50920
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/constants.js
50921
50921
  var require_constants3 = __commonJS({
50922
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/constants.js"(exports2, module2) {
50922
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/constants.js"(exports2, module2) {
50923
50923
  module2.exports = {
50924
50924
  /* The local file header */
50925
50925
  LOCHDR: 30,
@@ -51136,9 +51136,9 @@ var require_constants3 = __commonJS({
51136
51136
  }
51137
51137
  });
51138
51138
 
51139
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js
51139
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/errors.js
51140
51140
  var require_errors2 = __commonJS({
51141
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/errors.js"(exports2) {
51141
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/errors.js"(exports2) {
51142
51142
  var errors2 = {
51143
51143
  /* Header error messages */
51144
51144
  INVALID_LOC: "Invalid LOC header (bad signature)",
@@ -51196,9 +51196,9 @@ var require_errors2 = __commonJS({
51196
51196
  }
51197
51197
  });
51198
51198
 
51199
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js
51199
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/utils.js
51200
51200
  var require_utils5 = __commonJS({
51201
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/utils.js"(exports2, module2) {
51201
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/utils.js"(exports2, module2) {
51202
51202
  var fsystem = require("fs");
51203
51203
  var pth = require("path");
51204
51204
  var Constants = require_constants3();
@@ -51236,7 +51236,11 @@ var require_utils5 = __commonJS({
51236
51236
  try {
51237
51237
  stat = self2.fs.statSync(resolvedPath);
51238
51238
  } catch (e) {
51239
- self2.fs.mkdirSync(resolvedPath);
51239
+ if (e.message && e.message.startsWith("ENOENT")) {
51240
+ self2.fs.mkdirSync(resolvedPath);
51241
+ } else {
51242
+ throw e;
51243
+ }
51240
51244
  }
51241
51245
  if (stat && stat.isFile()) throw Errors.FILE_IN_THE_WAY(`"${resolvedPath}"`);
51242
51246
  });
@@ -51282,37 +51286,40 @@ var require_utils5 = __commonJS({
51282
51286
  self2.fs.exists(path39, function(exist) {
51283
51287
  if (exist && !overwrite) return callback(false);
51284
51288
  self2.fs.stat(path39, function(err, stat) {
51285
- if (exist && stat.isDirectory()) {
51289
+ if (exist && stat && stat.isDirectory()) {
51286
51290
  return callback(false);
51287
51291
  }
51288
51292
  var folder = pth.dirname(path39);
51289
51293
  self2.fs.exists(folder, function(exists) {
51290
- if (!exists) self2.makeDir(folder);
51294
+ if (!exists) {
51295
+ try {
51296
+ self2.makeDir(folder);
51297
+ } catch (e) {
51298
+ return callback(false);
51299
+ }
51300
+ }
51301
+ const writeToFd = function(fd) {
51302
+ self2.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
51303
+ self2.fs.close(fd, function() {
51304
+ if (writeErr) return callback(false);
51305
+ self2.fs.chmod(path39, attr || 438, function() {
51306
+ callback(true);
51307
+ });
51308
+ });
51309
+ });
51310
+ };
51291
51311
  self2.fs.open(path39, "w", 438, function(err2, fd) {
51292
51312
  if (err2) {
51293
51313
  self2.fs.chmod(path39, 438, function() {
51294
- self2.fs.open(path39, "w", 438, function(err3, fd2) {
51295
- self2.fs.write(fd2, content, 0, content.length, 0, function() {
51296
- self2.fs.close(fd2, function() {
51297
- self2.fs.chmod(path39, attr || 438, function() {
51298
- callback(true);
51299
- });
51300
- });
51301
- });
51314
+ self2.fs.open(path39, "w", 438, function(retryErr, fd2) {
51315
+ if (retryErr || !fd2) return callback(false);
51316
+ writeToFd(fd2);
51302
51317
  });
51303
51318
  });
51304
51319
  } else if (fd) {
51305
- self2.fs.write(fd, content, 0, content.length, 0, function() {
51306
- self2.fs.close(fd, function() {
51307
- self2.fs.chmod(path39, attr || 438, function() {
51308
- callback(true);
51309
- });
51310
- });
51311
- });
51320
+ writeToFd(fd);
51312
51321
  } else {
51313
- self2.fs.chmod(path39, attr || 438, function() {
51314
- callback(true);
51315
- });
51322
+ callback(false);
51316
51323
  }
51317
51324
  });
51318
51325
  });
@@ -51321,7 +51328,7 @@ var require_utils5 = __commonJS({
51321
51328
  };
51322
51329
  Utils.prototype.findFiles = function(path39) {
51323
51330
  const self2 = this;
51324
- function findSync(dir, pattern, recursive) {
51331
+ function findSync(dir, pattern, recursive, visited) {
51325
51332
  if (typeof pattern === "boolean") {
51326
51333
  recursive = pattern;
51327
51334
  pattern = void 0;
@@ -51333,37 +51340,64 @@ var require_utils5 = __commonJS({
51333
51340
  if (!pattern || pattern.test(path40)) {
51334
51341
  files.push(pth.normalize(path40) + (stat.isDirectory() ? self2.sep : ""));
51335
51342
  }
51336
- if (stat.isDirectory() && recursive) files = files.concat(findSync(path40, pattern, recursive));
51343
+ if (stat.isDirectory() && recursive) {
51344
+ const realDir = self2.fs.realpathSync(path40);
51345
+ if (!visited.has(realDir)) {
51346
+ visited.add(realDir);
51347
+ files = files.concat(findSync(path40, pattern, recursive, visited));
51348
+ }
51349
+ }
51337
51350
  });
51338
51351
  return files;
51339
51352
  }
51340
- return findSync(path39, void 0, true);
51353
+ return findSync(path39, void 0, true, /* @__PURE__ */ new Set([self2.fs.realpathSync(path39)]));
51341
51354
  };
51342
51355
  Utils.prototype.findFilesAsync = function(dir, cb) {
51343
51356
  const self2 = this;
51344
- let results = [];
51345
- self2.fs.readdir(dir, function(err, list2) {
51346
- if (err) return cb(err);
51347
- let list_length = list2.length;
51348
- if (!list_length) return cb(null, results);
51349
- list2.forEach(function(file) {
51350
- file = pth.join(dir, file);
51351
- self2.fs.stat(file, function(err2, stat) {
51352
- if (err2) return cb(err2);
51353
- if (stat) {
51357
+ const results = [];
51358
+ let finished = false;
51359
+ const finish = function(err) {
51360
+ if (finished) return;
51361
+ finished = true;
51362
+ cb(err, err ? void 0 : results);
51363
+ };
51364
+ const walk = function(dir2, visited, done) {
51365
+ self2.fs.readdir(dir2, function(err, list2) {
51366
+ if (err) return done(err);
51367
+ let pending = list2.length;
51368
+ if (!pending) return done();
51369
+ list2.forEach(function(name) {
51370
+ const file = pth.join(dir2, name);
51371
+ self2.fs.stat(file, function(err2, stat) {
51372
+ if (err2) return done(err2);
51373
+ if (!stat) {
51374
+ if (!--pending) done();
51375
+ return;
51376
+ }
51354
51377
  results.push(pth.normalize(file) + (stat.isDirectory() ? self2.sep : ""));
51355
- if (stat.isDirectory()) {
51356
- self2.findFilesAsync(file, function(err3, res) {
51357
- if (err3) return cb(err3);
51358
- results = results.concat(res);
51359
- if (!--list_length) cb(null, results);
51360
- });
51361
- } else {
51362
- if (!--list_length) cb(null, results);
51378
+ if (!stat.isDirectory()) {
51379
+ if (!--pending) done();
51380
+ return;
51363
51381
  }
51364
- }
51382
+ self2.fs.realpath(file, function(err3, realDir) {
51383
+ if (err3) return done(err3);
51384
+ if (visited.has(realDir)) {
51385
+ if (!--pending) done();
51386
+ return;
51387
+ }
51388
+ visited.add(realDir);
51389
+ walk(file, visited, function(err4) {
51390
+ if (err4) return done(err4);
51391
+ if (!--pending) done();
51392
+ });
51393
+ });
51394
+ });
51365
51395
  });
51366
51396
  });
51397
+ };
51398
+ self2.fs.realpath(dir, function(err, realDir) {
51399
+ if (err) return finish(err);
51400
+ walk(dir, /* @__PURE__ */ new Set([realDir]), finish);
51367
51401
  });
51368
51402
  };
51369
51403
  Utils.prototype.getAttributes = function() {
@@ -51417,7 +51451,7 @@ var require_utils5 = __commonJS({
51417
51451
  var parts = name.split("/");
51418
51452
  for (var i = 0, l = parts.length; i < l; i++) {
51419
51453
  var path39 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
51420
- if (path39.indexOf(prefix) === 0) {
51454
+ if (path39 === prefix || path39.startsWith(prefix + pth.sep)) {
51421
51455
  return path39;
51422
51456
  }
51423
51457
  }
@@ -51433,9 +51467,15 @@ var require_utils5 = __commonJS({
51433
51467
  }
51434
51468
  };
51435
51469
  Utils.readBigUInt64LE = function(buffer, index) {
51436
- var slice = Buffer.from(buffer.slice(index, index + 8));
51437
- slice.swap64();
51438
- return parseInt(`0x${slice.toString("hex")}`);
51470
+ const lo = buffer.readUInt32LE(index);
51471
+ const hi = buffer.readUInt32LE(index + 4);
51472
+ return hi * 4294967296 + lo;
51473
+ };
51474
+ Utils.writeBigUInt64LE = function(buffer, value, index) {
51475
+ const lo = value >>> 0;
51476
+ const hi = Math.floor(value / 4294967296) >>> 0;
51477
+ buffer.writeUInt32LE(lo, index);
51478
+ buffer.writeUInt32LE(hi, index + 4);
51439
51479
  };
51440
51480
  Utils.fromDOS2Date = function(val) {
51441
51481
  return new Date((val >> 25 & 127) + 1980, Math.max((val >> 21 & 15) - 1, 0), Math.max(val >> 16 & 31, 1), val >> 11 & 31, val >> 5 & 63, (val & 31) << 1);
@@ -51454,9 +51494,9 @@ var require_utils5 = __commonJS({
51454
51494
  }
51455
51495
  });
51456
51496
 
51457
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js
51497
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/fattr.js
51458
51498
  var require_fattr = __commonJS({
51459
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/fattr.js"(exports2, module2) {
51499
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/fattr.js"(exports2, module2) {
51460
51500
  var pth = require("path");
51461
51501
  module2.exports = function(path39, { fs: fs13 }) {
51462
51502
  var _path = path39 || "", _obj = newAttr(), _stat = null;
@@ -51523,9 +51563,9 @@ var require_fattr = __commonJS({
51523
51563
  }
51524
51564
  });
51525
51565
 
51526
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js
51566
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/decoder.js
51527
51567
  var require_decoder = __commonJS({
51528
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/decoder.js"(exports2, module2) {
51568
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/decoder.js"(exports2, module2) {
51529
51569
  module2.exports = {
51530
51570
  efs: true,
51531
51571
  encode: (data2) => Buffer.from(data2, "utf8"),
@@ -51534,9 +51574,9 @@ var require_decoder = __commonJS({
51534
51574
  }
51535
51575
  });
51536
51576
 
51537
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js
51577
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/index.js
51538
51578
  var require_util = __commonJS({
51539
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/util/index.js"(exports2, module2) {
51579
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/util/index.js"(exports2, module2) {
51540
51580
  module2.exports = require_utils5();
51541
51581
  module2.exports.Constants = require_constants3();
51542
51582
  module2.exports.Errors = require_errors2();
@@ -51545,9 +51585,9 @@ var require_util = __commonJS({
51545
51585
  }
51546
51586
  });
51547
51587
 
51548
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js
51588
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/entryHeader.js
51549
51589
  var require_entryHeader = __commonJS({
51550
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/entryHeader.js"(exports2, module2) {
51590
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/entryHeader.js"(exports2, module2) {
51551
51591
  var Utils = require_util();
51552
51592
  var Constants = Utils.Constants;
51553
51593
  module2.exports = function() {
@@ -51607,6 +51647,7 @@ var require_entryHeader = __commonJS({
51607
51647
  switch (val) {
51608
51648
  case Constants.STORED:
51609
51649
  this.version = 10;
51650
+ break;
51610
51651
  case Constants.DEFLATED:
51611
51652
  default:
51612
51653
  this.version = 20;
@@ -51617,6 +51658,7 @@ var require_entryHeader = __commonJS({
51617
51658
  return Utils.fromDOS2Date(this.timeval);
51618
51659
  },
51619
51660
  set time(val) {
51661
+ val = new Date(val);
51620
51662
  this.timeval = Utils.fromDate2DOS(val);
51621
51663
  },
51622
51664
  get timeval() {
@@ -51717,6 +51759,7 @@ var require_entryHeader = __commonJS({
51717
51759
  }
51718
51760
  _localHeader.version = data2.readUInt16LE(Constants.LOCVER);
51719
51761
  _localHeader.flags = data2.readUInt16LE(Constants.LOCFLG);
51762
+ _localHeader.flags_desc = (_localHeader.flags & Constants.FLG_DESC) > 0;
51720
51763
  _localHeader.method = data2.readUInt16LE(Constants.LOCHOW);
51721
51764
  _localHeader.time = data2.readUInt32LE(Constants.LOCTIM);
51722
51765
  _localHeader.crc = data2.readUInt32LE(Constants.LOCCRC);
@@ -51752,7 +51795,7 @@ var require_entryHeader = __commonJS({
51752
51795
  var data2 = Buffer.alloc(Constants.LOCHDR);
51753
51796
  data2.writeUInt32LE(Constants.LOCSIG, 0);
51754
51797
  data2.writeUInt16LE(_version, Constants.LOCVER);
51755
- data2.writeUInt16LE(_flags, Constants.LOCFLG);
51798
+ data2.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.LOCFLG);
51756
51799
  data2.writeUInt16LE(_method, Constants.LOCHOW);
51757
51800
  data2.writeUInt32LE(_time, Constants.LOCTIM);
51758
51801
  data2.writeUInt32LE(_crc, Constants.LOCCRC);
@@ -51767,7 +51810,7 @@ var require_entryHeader = __commonJS({
51767
51810
  data2.writeUInt32LE(Constants.CENSIG, 0);
51768
51811
  data2.writeUInt16LE(_verMade, Constants.CENVEM);
51769
51812
  data2.writeUInt16LE(_version, Constants.CENVER);
51770
- data2.writeUInt16LE(_flags, Constants.CENFLG);
51813
+ data2.writeUInt16LE(_flags & ~Constants.FLG_DESC, Constants.CENFLG);
51771
51814
  data2.writeUInt16LE(_method, Constants.CENHOW);
51772
51815
  data2.writeUInt32LE(_time, Constants.CENTIM);
51773
51816
  data2.writeUInt32LE(_crc, Constants.CENCRC);
@@ -51813,13 +51856,14 @@ var require_entryHeader = __commonJS({
51813
51856
  }
51814
51857
  });
51815
51858
 
51816
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js
51859
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/mainHeader.js
51817
51860
  var require_mainHeader = __commonJS({
51818
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/mainHeader.js"(exports2, module2) {
51861
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/mainHeader.js"(exports2, module2) {
51819
51862
  var Utils = require_util();
51820
51863
  var Constants = Utils.Constants;
51821
51864
  module2.exports = function() {
51822
51865
  var _volumeEntries = 0, _totalEntries = 0, _size3 = 0, _offset = 0, _commentLength = 0;
51866
+ const needsZip64 = () => _volumeEntries > Constants.EF_ZIP64_OR_16 || _totalEntries > Constants.EF_ZIP64_OR_16 || _size3 > Constants.EF_ZIP64_OR_32 || _offset > Constants.EF_ZIP64_OR_32;
51823
51867
  return {
51824
51868
  get diskEntries() {
51825
51869
  return _volumeEntries;
@@ -51852,7 +51896,7 @@ var require_mainHeader = __commonJS({
51852
51896
  _commentLength = val;
51853
51897
  },
51854
51898
  get mainHeaderSize() {
51855
- return Constants.ENDHDR + _commentLength;
51899
+ return (needsZip64() ? Constants.ZIP64HDR + Constants.END64HDR : 0) + Constants.ENDHDR + _commentLength;
51856
51900
  },
51857
51901
  loadFromBinary: function(data2) {
51858
51902
  if ((data2.length !== Constants.ENDHDR || data2.readUInt32LE(0) !== Constants.ENDSIG) && (data2.length < Constants.ZIP64HDR || data2.readUInt32LE(0) !== Constants.ZIP64SIG)) {
@@ -51867,21 +51911,51 @@ var require_mainHeader = __commonJS({
51867
51911
  } else {
51868
51912
  _volumeEntries = Utils.readBigUInt64LE(data2, Constants.ZIP64SUB);
51869
51913
  _totalEntries = Utils.readBigUInt64LE(data2, Constants.ZIP64TOT);
51870
- _size3 = Utils.readBigUInt64LE(data2, Constants.ZIP64SIZE);
51914
+ _size3 = Utils.readBigUInt64LE(data2, Constants.ZIP64SIZB);
51871
51915
  _offset = Utils.readBigUInt64LE(data2, Constants.ZIP64OFF);
51872
51916
  _commentLength = 0;
51873
51917
  }
51874
51918
  },
51875
51919
  toBinary: function() {
51876
- var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
51877
- b.writeUInt32LE(Constants.ENDSIG, 0);
51878
- b.writeUInt32LE(0, 4);
51879
- b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
51880
- b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
51881
- b.writeUInt32LE(_size3, Constants.ENDSIZ);
51882
- b.writeUInt32LE(_offset, Constants.ENDOFF);
51883
- b.writeUInt16LE(_commentLength, Constants.ENDCOM);
51884
- b.fill(" ", Constants.ENDHDR);
51920
+ if (!needsZip64()) {
51921
+ var b = Buffer.alloc(Constants.ENDHDR + _commentLength);
51922
+ b.writeUInt32LE(Constants.ENDSIG, 0);
51923
+ b.writeUInt32LE(0, 4);
51924
+ b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
51925
+ b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
51926
+ b.writeUInt32LE(_size3, Constants.ENDSIZ);
51927
+ b.writeUInt32LE(_offset, Constants.ENDOFF);
51928
+ b.writeUInt16LE(_commentLength, Constants.ENDCOM);
51929
+ b.fill(" ", Constants.ENDHDR);
51930
+ return b;
51931
+ }
51932
+ var b = Buffer.alloc(this.mainHeaderSize);
51933
+ let offset = 0;
51934
+ b.writeUInt32LE(Constants.ZIP64SIG, offset);
51935
+ Utils.writeBigUInt64LE(b, Constants.ZIP64HDR - Constants.ZIP64LEAD, offset + Constants.ZIP64SIZE);
51936
+ b.writeUInt16LE(45, offset + Constants.ZIP64VEM);
51937
+ b.writeUInt16LE(45, offset + Constants.ZIP64VER);
51938
+ b.writeUInt32LE(0, offset + Constants.ZIP64DSK);
51939
+ b.writeUInt32LE(0, offset + Constants.ZIP64DSKDIR);
51940
+ Utils.writeBigUInt64LE(b, _volumeEntries, offset + Constants.ZIP64SUB);
51941
+ Utils.writeBigUInt64LE(b, _totalEntries, offset + Constants.ZIP64TOT);
51942
+ Utils.writeBigUInt64LE(b, _size3, offset + Constants.ZIP64SIZB);
51943
+ Utils.writeBigUInt64LE(b, _offset, offset + Constants.ZIP64OFF);
51944
+ const zip64EndOffset = _offset + _size3;
51945
+ offset += Constants.ZIP64HDR;
51946
+ b.writeUInt32LE(Constants.END64SIG, offset);
51947
+ b.writeUInt32LE(0, offset + Constants.END64START);
51948
+ Utils.writeBigUInt64LE(b, zip64EndOffset, offset + Constants.END64OFF);
51949
+ b.writeUInt32LE(1, offset + Constants.END64NUMDISKS);
51950
+ offset += Constants.END64HDR;
51951
+ b.writeUInt32LE(Constants.ENDSIG, offset);
51952
+ b.writeUInt32LE(0, offset + 4);
51953
+ b.writeUInt16LE(Math.min(_volumeEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDSUB);
51954
+ b.writeUInt16LE(Math.min(_totalEntries, Constants.EF_ZIP64_OR_16), offset + Constants.ENDTOT);
51955
+ b.writeUInt32LE(Math.min(_size3, Constants.EF_ZIP64_OR_32), offset + Constants.ENDSIZ);
51956
+ b.writeUInt32LE(Math.min(_offset, Constants.EF_ZIP64_OR_32), offset + Constants.ENDOFF);
51957
+ b.writeUInt16LE(_commentLength, offset + Constants.ENDCOM);
51958
+ b.fill(" ", offset + Constants.ENDHDR);
51885
51959
  return b;
51886
51960
  },
51887
51961
  toJSON: function() {
@@ -51906,17 +51980,17 @@ var require_mainHeader = __commonJS({
51906
51980
  }
51907
51981
  });
51908
51982
 
51909
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js
51983
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/index.js
51910
51984
  var require_headers = __commonJS({
51911
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/headers/index.js"(exports2) {
51985
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/headers/index.js"(exports2) {
51912
51986
  exports2.EntryHeader = require_entryHeader();
51913
51987
  exports2.MainHeader = require_mainHeader();
51914
51988
  }
51915
51989
  });
51916
51990
 
51917
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js
51991
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/deflater.js
51918
51992
  var require_deflater = __commonJS({
51919
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/deflater.js"(exports2, module2) {
51993
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/deflater.js"(exports2, module2) {
51920
51994
  module2.exports = function(inbuf) {
51921
51995
  var zlib2 = require("zlib");
51922
51996
  var opts = { chunkSize: (parseInt(inbuf.length / 1024) + 1) * 1024 };
@@ -51947,10 +52021,11 @@ var require_deflater = __commonJS({
51947
52021
  }
51948
52022
  });
51949
52023
 
51950
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js
52024
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/inflater.js
51951
52025
  var require_inflater = __commonJS({
51952
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/inflater.js"(exports2, module2) {
51953
- var version4 = +(process.versions ? process.versions.node : "").split(".")[0] || 0;
52026
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/inflater.js"(exports2, module2) {
52027
+ var _a2;
52028
+ var version4 = +(((_a2 = process == null ? void 0 : process.versions) == null ? void 0 : _a2.node) ?? "").split(".")[0] || 0;
51954
52029
  module2.exports = function(inbuf, expectedLength) {
51955
52030
  var zlib2 = require("zlib");
51956
52031
  const option = version4 >= 15 && expectedLength > 0 ? { maxOutputLength: expectedLength } : {};
@@ -51981,9 +52056,9 @@ var require_inflater = __commonJS({
51981
52056
  }
51982
52057
  });
51983
52058
 
51984
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js
52059
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/zipcrypto.js
51985
52060
  var require_zipcrypto = __commonJS({
51986
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/zipcrypto.js"(exports2, module2) {
52061
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/zipcrypto.js"(exports2, module2) {
51987
52062
  "use strict";
51988
52063
  var { randomFillSync } = require("crypto");
51989
52064
  var Errors = require_errors2();
@@ -52097,18 +52172,18 @@ var require_zipcrypto = __commonJS({
52097
52172
  }
52098
52173
  });
52099
52174
 
52100
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js
52175
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/index.js
52101
52176
  var require_methods = __commonJS({
52102
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/methods/index.js"(exports2) {
52177
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/methods/index.js"(exports2) {
52103
52178
  exports2.Deflater = require_deflater();
52104
52179
  exports2.Inflater = require_inflater();
52105
52180
  exports2.ZipCrypto = require_zipcrypto();
52106
52181
  }
52107
52182
  });
52108
52183
 
52109
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js
52184
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/zipEntry.js
52110
52185
  var require_zipEntry = __commonJS({
52111
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipEntry.js"(exports2, module2) {
52186
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/zipEntry.js"(exports2, module2) {
52112
52187
  var Utils = require_util();
52113
52188
  var Headers2 = require_headers();
52114
52189
  var Constants = Utils.Constants;
@@ -52126,35 +52201,8 @@ var require_zipEntry = __commonJS({
52126
52201
  return input.slice(_centralHeader.realDataOffset, _centralHeader.realDataOffset + _centralHeader.compressedSize);
52127
52202
  }
52128
52203
  function crc32OK(data2) {
52129
- if (!_centralHeader.flags_desc) {
52130
- if (Utils.crc32(data2) !== _centralHeader.localHeader.crc) {
52131
- return false;
52132
- }
52133
- } else {
52134
- const descriptor = {};
52135
- const dataEndOffset = _centralHeader.realDataOffset + _centralHeader.compressedSize;
52136
- if (input.readUInt32LE(dataEndOffset) == Constants.LOCSIG || input.readUInt32LE(dataEndOffset) == Constants.CENSIG) {
52137
- throw Utils.Errors.DESCRIPTOR_NOT_EXIST();
52138
- }
52139
- if (input.readUInt32LE(dataEndOffset) == Constants.EXTSIG) {
52140
- descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC);
52141
- descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ);
52142
- descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN);
52143
- } else if (input.readUInt16LE(dataEndOffset + 12) === 19280) {
52144
- descriptor.crc = input.readUInt32LE(dataEndOffset + Constants.EXTCRC - 4);
52145
- descriptor.compressedSize = input.readUInt32LE(dataEndOffset + Constants.EXTSIZ - 4);
52146
- descriptor.size = input.readUInt32LE(dataEndOffset + Constants.EXTLEN - 4);
52147
- } else {
52148
- throw Utils.Errors.DESCRIPTOR_UNKNOWN();
52149
- }
52150
- if (descriptor.compressedSize !== _centralHeader.compressedSize || descriptor.size !== _centralHeader.size || descriptor.crc !== _centralHeader.crc) {
52151
- throw Utils.Errors.DESCRIPTOR_FAULTY();
52152
- }
52153
- if (Utils.crc32(data2) !== descriptor.crc) {
52154
- return false;
52155
- }
52156
- }
52157
- return true;
52204
+ const expectedCrc = _centralHeader.flags_desc || _centralHeader.localHeader.flags_desc ? _centralHeader.crc : _centralHeader.localHeader.crc;
52205
+ return Utils.crc32(data2) === expectedCrc;
52158
52206
  }
52159
52207
  function decompress(async, callback, pass) {
52160
52208
  if (typeof callback === "undefined" && typeof async === "string") {
@@ -52178,9 +52226,10 @@ var require_zipEntry = __commonJS({
52178
52226
  }
52179
52227
  compressedData = Methods.ZipCrypto.decrypt(compressedData, _centralHeader, pass);
52180
52228
  }
52181
- var data2 = Buffer.alloc(_centralHeader.size);
52229
+ var data2;
52182
52230
  switch (_centralHeader.method) {
52183
52231
  case Utils.Constants.STORED:
52232
+ data2 = Buffer.alloc(compressedData.length);
52184
52233
  compressedData.copy(data2);
52185
52234
  if (!crc32OK(data2)) {
52186
52235
  if (async && callback) callback(data2, Utils.Errors.BAD_CRC());
@@ -52192,15 +52241,13 @@ var require_zipEntry = __commonJS({
52192
52241
  case Utils.Constants.DEFLATED:
52193
52242
  var inflater = new Methods.Inflater(compressedData, _centralHeader.size);
52194
52243
  if (!async) {
52195
- const result = inflater.inflate(data2);
52196
- result.copy(data2, 0);
52244
+ data2 = inflater.inflate();
52197
52245
  if (!crc32OK(data2)) {
52198
52246
  throw Utils.Errors.BAD_CRC(`"${decoder.decode(_entryName)}"`);
52199
52247
  }
52200
52248
  return data2;
52201
52249
  } else {
52202
52250
  inflater.inflateAsync(function(result) {
52203
- result.copy(result, 0);
52204
52251
  if (callback) {
52205
52252
  if (!crc32OK(result)) {
52206
52253
  callback(result, Utils.Errors.BAD_CRC());
@@ -52255,7 +52302,7 @@ var require_zipEntry = __commonJS({
52255
52302
  }
52256
52303
  }
52257
52304
  function readUInt64LE(buffer, offset) {
52258
- return (buffer.readUInt32LE(offset + 4) << 4) + buffer.readUInt32LE(offset);
52305
+ return Utils.readBigUInt64LE(buffer, offset);
52259
52306
  }
52260
52307
  function parseExtra(data2) {
52261
52308
  try {
@@ -52340,8 +52387,8 @@ var require_zipEntry = __commonJS({
52340
52387
  if (_comment.length > 65535) throw Utils.Errors.COMMENT_TOO_LONG();
52341
52388
  },
52342
52389
  get name() {
52343
- var n = decoder.decode(_entryName);
52344
- return _isDirectory ? n.substr(n.length - 1).split("/").pop() : n.split("/").pop();
52390
+ const n = decoder.decode(_entryName);
52391
+ return _isDirectory ? n.replace(/[/\\]$/, "").split("/").pop() : n.split("/").pop();
52345
52392
  },
52346
52393
  get isDirectory() {
52347
52394
  return _isDirectory;
@@ -52437,14 +52484,14 @@ var require_zipEntry = __commonJS({
52437
52484
  }
52438
52485
  });
52439
52486
 
52440
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js
52487
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/zipFile.js
52441
52488
  var require_zipFile = __commonJS({
52442
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/zipFile.js"(exports2, module2) {
52489
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/zipFile.js"(exports2, module2) {
52443
52490
  var ZipEntry = require_zipEntry();
52444
52491
  var Headers2 = require_headers();
52445
52492
  var Utils = require_util();
52446
52493
  module2.exports = function(inBuffer, options) {
52447
- var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers2.MainHeader(), loadedEntries = false;
52494
+ var entryList = [], entryTable = /* @__PURE__ */ Object.create(null), _comment = Buffer.alloc(0), mainHeader = new Headers2.MainHeader(), loadedEntries = false;
52448
52495
  var password = null;
52449
52496
  const temporary = /* @__PURE__ */ new Set();
52450
52497
  const opts = options;
@@ -52479,7 +52526,7 @@ var require_zipFile = __commonJS({
52479
52526
  }
52480
52527
  function readEntries() {
52481
52528
  loadedEntries = true;
52482
- entryTable = {};
52529
+ entryTable = /* @__PURE__ */ Object.create(null);
52483
52530
  if (mainHeader.diskEntries > (inBuffer.length - mainHeader.offset) / Utils.Constants.CENHDR) {
52484
52531
  throw Utils.Errors.DISK_ENTRY_TOO_LARGE();
52485
52532
  }
@@ -52532,7 +52579,7 @@ var require_zipFile = __commonJS({
52532
52579
  }
52533
52580
  function sortEntries() {
52534
52581
  if (entryList.length > 1 && !noSort) {
52535
- entryList.sort((a, b) => a.entryName.toLowerCase().localeCompare(b.entryName.toLowerCase()));
52582
+ entryList = entryList.map((entry) => ({ entry, key: entry.entryName.toLowerCase() })).sort((a, b) => a.key.localeCompare(b.key)).map((pair) => pair.entry);
52536
52583
  }
52537
52584
  }
52538
52585
  return {
@@ -52709,7 +52756,7 @@ var require_zipFile = __commonJS({
52709
52756
  }
52710
52757
  const mh = mainHeader.toBinary();
52711
52758
  if (_comment) {
52712
- _comment.copy(mh, Utils.Constants.ENDHDR);
52759
+ _comment.copy(mh, mh.length - _comment.length);
52713
52760
  }
52714
52761
  mh.copy(outBuffer, dindex);
52715
52762
  inBuffer = outBuffer;
@@ -52765,7 +52812,7 @@ var require_zipFile = __commonJS({
52765
52812
  });
52766
52813
  const mh = mainHeader.toBinary();
52767
52814
  if (_comment) {
52768
- _comment.copy(mh, Utils.Constants.ENDHDR);
52815
+ _comment.copy(mh, mh.length - _comment.length);
52769
52816
  }
52770
52817
  mh.copy(outBuffer, dindex);
52771
52818
  inBuffer = outBuffer;
@@ -52783,9 +52830,9 @@ var require_zipFile = __commonJS({
52783
52830
  }
52784
52831
  });
52785
52832
 
52786
- // ../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js
52833
+ // ../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/adm-zip.js
52787
52834
  var require_adm_zip = __commonJS({
52788
- "../node_modules/.pnpm/adm-zip@0.5.16/node_modules/adm-zip/adm-zip.js"(exports2, module2) {
52835
+ "../node_modules/.pnpm/adm-zip@0.6.0/node_modules/adm-zip/adm-zip.js"(exports2, module2) {
52789
52836
  var Utils = require_util();
52790
52837
  var pth = require("path");
52791
52838
  var ZipEntry = require_zipEntry();
@@ -52820,6 +52867,9 @@ var require_adm_zip = __commonJS({
52820
52867
  }
52821
52868
  Object.assign(opts, options);
52822
52869
  const filetools = new Utils(opts);
52870
+ const applyDirAttributes = (dirEntries) => {
52871
+ dirEntries.filter((d) => d.attr).sort((a, b) => b.path.length - a.path.length).forEach((d) => filetools.fs.chmodSync(d.path, d.attr));
52872
+ };
52823
52873
  if (typeof opts.decoder !== "object" || typeof opts.decoder.encode !== "function" || typeof opts.decoder.decode !== "function") {
52824
52874
  opts.decoder = Utils.decoder;
52825
52875
  }
@@ -52847,7 +52897,7 @@ var require_adm_zip = __commonJS({
52847
52897
  }
52848
52898
  function fixPath(zipPath) {
52849
52899
  const { join, normalize, sep } = pth.posix;
52850
- return join(".", normalize(sep + zipPath.split("\\").join(sep) + sep));
52900
+ return join(pth.isAbsolute(zipPath) ? "/" : ".", normalize(sep + zipPath.split("\\").join(sep) + sep));
52851
52901
  }
52852
52902
  function filenameFilter(filterfn) {
52853
52903
  if (filterfn instanceof RegExp) {
@@ -52950,6 +53000,7 @@ var require_adm_zip = __commonJS({
52950
53000
  * Remove the entry from the file or the entry and all it's nested directories and files if the given entry is a directory
52951
53001
  *
52952
53002
  * @param {ZipEntry|string} entry
53003
+ * @param {boolean} withsubfolders
52953
53004
  * @returns {void}
52954
53005
  */
52955
53006
  deleteFile: function(entry, withsubfolders = true) {
@@ -53032,17 +53083,17 @@ var require_adm_zip = __commonJS({
53032
53083
  * @param {string} [zipName] Optional name for the file
53033
53084
  * @param {string} [comment] Optional file comment
53034
53085
  */
53035
- addLocalFile: function(localPath2, zipPath, zipName, comment) {
53036
- if (filetools.fs.existsSync(localPath2)) {
53086
+ addLocalFile: function(localPath, zipPath, zipName, comment) {
53087
+ if (filetools.fs.existsSync(localPath)) {
53037
53088
  zipPath = zipPath ? fixPath(zipPath) : "";
53038
- const p = pth.win32.basename(pth.win32.normalize(localPath2));
53089
+ const p = pth.win32.basename(pth.win32.normalize(localPath));
53039
53090
  zipPath += zipName ? zipName : p;
53040
- const _attr = filetools.fs.statSync(localPath2);
53041
- const data2 = _attr.isFile() ? filetools.fs.readFileSync(localPath2) : Buffer.alloc(0);
53091
+ const _attr = filetools.fs.statSync(localPath);
53092
+ const data2 = _attr.isFile() ? filetools.fs.readFileSync(localPath) : Buffer.alloc(0);
53042
53093
  if (_attr.isDirectory()) zipPath += filetools.sep;
53043
53094
  this.addFile(zipPath, data2, comment, _attr);
53044
53095
  } else {
53045
- throw Utils.Errors.FILE_NOT_FOUND(localPath2);
53096
+ throw Utils.Errors.FILE_NOT_FOUND(localPath);
53046
53097
  }
53047
53098
  },
53048
53099
  /**
@@ -53064,17 +53115,17 @@ var require_adm_zip = __commonJS({
53064
53115
  */
53065
53116
  addLocalFileAsync: function(options2, callback) {
53066
53117
  options2 = typeof options2 === "object" ? options2 : { localPath: options2 };
53067
- const localPath2 = pth.resolve(options2.localPath);
53118
+ const localPath = pth.resolve(options2.localPath);
53068
53119
  const { comment } = options2;
53069
53120
  let { zipPath, zipName } = options2;
53070
53121
  const self2 = this;
53071
- filetools.fs.stat(localPath2, function(err, stats) {
53122
+ filetools.fs.stat(localPath, function(err, stats) {
53072
53123
  if (err) return callback(err, false);
53073
53124
  zipPath = zipPath ? fixPath(zipPath) : "";
53074
- const p = pth.win32.basename(pth.win32.normalize(localPath2));
53125
+ const p = pth.win32.basename(pth.win32.normalize(localPath));
53075
53126
  zipPath += zipName ? zipName : p;
53076
53127
  if (stats.isFile()) {
53077
- filetools.fs.readFile(localPath2, function(err2, data2) {
53128
+ filetools.fs.readFile(localPath, function(err2, data2) {
53078
53129
  if (err2) return callback(err2, false);
53079
53130
  self2.addFile(zipPath, data2, comment, stats);
53080
53131
  return setImmediate(callback, void 0, true);
@@ -53093,23 +53144,23 @@ var require_adm_zip = __commonJS({
53093
53144
  * @param {string} [zipPath] - optional path inside zip
53094
53145
  * @param {(RegExp|function)} [filter] - optional RegExp or Function if files match will be included.
53095
53146
  */
53096
- addLocalFolder: function(localPath2, zipPath, filter) {
53147
+ addLocalFolder: function(localPath, zipPath, filter) {
53097
53148
  filter = filenameFilter(filter);
53098
53149
  zipPath = zipPath ? fixPath(zipPath) : "";
53099
- localPath2 = pth.normalize(localPath2);
53100
- if (filetools.fs.existsSync(localPath2)) {
53101
- const items = filetools.findFiles(localPath2);
53150
+ localPath = pth.normalize(localPath);
53151
+ if (filetools.fs.existsSync(localPath)) {
53152
+ const items = filetools.findFiles(localPath);
53102
53153
  const self2 = this;
53103
53154
  if (items.length) {
53104
53155
  for (const filepath of items) {
53105
- const p = pth.join(zipPath, relativePath(localPath2, filepath));
53156
+ const p = pth.join(zipPath, relativePath(localPath, filepath));
53106
53157
  if (filter(p)) {
53107
53158
  self2.addLocalFile(filepath, pth.dirname(p));
53108
53159
  }
53109
53160
  }
53110
53161
  }
53111
53162
  } else {
53112
- throw Utils.Errors.FILE_NOT_FOUND(localPath2);
53163
+ throw Utils.Errors.FILE_NOT_FOUND(localPath);
53113
53164
  }
53114
53165
  },
53115
53166
  /**
@@ -53120,24 +53171,24 @@ var require_adm_zip = __commonJS({
53120
53171
  * @param {RegExp|function} [filter] optional RegExp or Function if files match will
53121
53172
  * be included.
53122
53173
  */
53123
- addLocalFolderAsync: function(localPath2, callback, zipPath, filter) {
53174
+ addLocalFolderAsync: function(localPath, callback, zipPath, filter) {
53124
53175
  filter = filenameFilter(filter);
53125
53176
  zipPath = zipPath ? fixPath(zipPath) : "";
53126
- localPath2 = pth.normalize(localPath2);
53177
+ localPath = pth.normalize(localPath);
53127
53178
  var self2 = this;
53128
- filetools.fs.open(localPath2, "r", function(err) {
53179
+ filetools.fs.open(localPath, "r", function(err) {
53129
53180
  if (err && err.code === "ENOENT") {
53130
- callback(void 0, Utils.Errors.FILE_NOT_FOUND(localPath2));
53181
+ callback(void 0, Utils.Errors.FILE_NOT_FOUND(localPath));
53131
53182
  } else if (err) {
53132
53183
  callback(void 0, err);
53133
53184
  } else {
53134
- var items = filetools.findFiles(localPath2);
53185
+ var items = filetools.findFiles(localPath);
53135
53186
  var i = -1;
53136
53187
  var next = function() {
53137
53188
  i += 1;
53138
53189
  if (i < items.length) {
53139
53190
  var filepath = items[i];
53140
- var p = relativePath(localPath2, filepath).split("\\").join("/");
53191
+ var p = relativePath(localPath, filepath).split("\\").join("/");
53141
53192
  p = p.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, "");
53142
53193
  if (filter(p)) {
53143
53194
  filetools.fs.stat(filepath, function(er0, stats) {
@@ -53183,7 +53234,7 @@ var require_adm_zip = __commonJS({
53183
53234
  addLocalFolderAsync2: function(options2, callback) {
53184
53235
  const self2 = this;
53185
53236
  options2 = typeof options2 === "object" ? options2 : { localPath: options2 };
53186
- localPath = pth.resolve(fixPath(options2.localPath));
53237
+ const localPath = pth.resolve(fixPath(options2.localPath));
53187
53238
  let { zipPath, filter, namefix } = options2;
53188
53239
  if (filter instanceof RegExp) {
53189
53240
  filter = /* @__PURE__ */ (function(rx) {
@@ -53197,7 +53248,7 @@ var require_adm_zip = __commonJS({
53197
53248
  };
53198
53249
  }
53199
53250
  zipPath = zipPath ? fixPath(zipPath) : "";
53200
- if (namefix == "latin1") {
53251
+ if (namefix === "latin1") {
53201
53252
  namefix = (str) => str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[^\x20-\x7E]/g, "");
53202
53253
  }
53203
53254
  if (typeof namefix !== "function") namefix = (str) => str;
@@ -53241,9 +53292,9 @@ var require_adm_zip = __commonJS({
53241
53292
  * @param {RegExp|function} [props.filter] - optional RegExp or Function if files match will be included.
53242
53293
  * @param {function|string} [props.namefix] - optional function to help fix filename
53243
53294
  */
53244
- addLocalFolderPromise: function(localPath2, props) {
53295
+ addLocalFolderPromise: function(localPath, props) {
53245
53296
  return new Promise((resolve2, reject) => {
53246
- this.addLocalFolderAsync2(Object.assign({ localPath: localPath2 }, props), (err, done) => {
53297
+ this.addLocalFolderAsync2(Object.assign({ localPath }, props), (err, done) => {
53247
53298
  if (err) reject(err);
53248
53299
  if (done) resolve2(this);
53249
53300
  });
@@ -53335,7 +53386,7 @@ var require_adm_zip = __commonJS({
53335
53386
  throw Utils.Errors.NO_ENTRY();
53336
53387
  }
53337
53388
  var entryName = canonical(item.entryName);
53338
- var target3 = sanitize(targetPath, outFileName && !item.isDirectory ? outFileName : maintainEntryPath ? entryName : pth.basename(entryName));
53389
+ var target3 = sanitize(targetPath, outFileName && !item.isDirectory ? canonical(outFileName) : maintainEntryPath ? entryName : pth.basename(entryName));
53339
53390
  if (item.isDirectory) {
53340
53391
  var children = _zip.getEntryChildren(item);
53341
53392
  children.forEach(function(child) {
@@ -53344,8 +53395,8 @@ var require_adm_zip = __commonJS({
53344
53395
  if (!content2) {
53345
53396
  throw Utils.Errors.CANT_EXTRACT_FILE();
53346
53397
  }
53347
- var name = canonical(child.entryName);
53348
- var childName = sanitize(targetPath, maintainEntryPath ? name : pth.basename(name));
53398
+ var name = canonical(maintainEntryPath ? child.entryName : child.entryName.substring(item.entryName.length));
53399
+ var childName = sanitize(targetPath, name);
53349
53400
  const fileAttr2 = keepOriginalPermission ? child.header.fileAttr : void 0;
53350
53401
  filetools.writeFileTo(childName, content2, overwrite, fileAttr2);
53351
53402
  });
@@ -53368,12 +53419,12 @@ var require_adm_zip = __commonJS({
53368
53419
  if (!_zip) {
53369
53420
  return false;
53370
53421
  }
53371
- for (var entry in _zip.entries) {
53422
+ for (var entry of _zip.entries) {
53372
53423
  try {
53373
53424
  if (entry.isDirectory) {
53374
53425
  continue;
53375
53426
  }
53376
- var content = _zip.entries[entry].getData(pass);
53427
+ var content = entry.getData(pass);
53377
53428
  if (!content) {
53378
53429
  return false;
53379
53430
  }
@@ -53398,10 +53449,12 @@ var require_adm_zip = __commonJS({
53398
53449
  pass = get_Str(keepOriginalPermission, pass);
53399
53450
  overwrite = get_Bool(false, overwrite);
53400
53451
  if (!_zip) throw Utils.Errors.NO_ZIP();
53452
+ const dirEntries = [];
53401
53453
  _zip.entries.forEach(function(entry) {
53402
53454
  var entryName = sanitize(targetPath, canonical(entry.entryName));
53403
53455
  if (entry.isDirectory) {
53404
53456
  filetools.makeDir(entryName);
53457
+ if (keepOriginalPermission) dirEntries.push({ path: entryName, attr: entry.header.fileAttr });
53405
53458
  return;
53406
53459
  }
53407
53460
  var content = entry.getData(pass);
@@ -53413,9 +53466,9 @@ var require_adm_zip = __commonJS({
53413
53466
  try {
53414
53467
  filetools.fs.utimesSync(entryName, entry.header.time, entry.header.time);
53415
53468
  } catch (err) {
53416
- throw Utils.Errors.CANT_EXTRACT_FILE();
53417
53469
  }
53418
53470
  });
53471
+ applyDirAttributes(dirEntries);
53419
53472
  },
53420
53473
  /**
53421
53474
  * Asynchronous extractAllTo
@@ -53458,17 +53511,32 @@ var require_adm_zip = __commonJS({
53458
53511
  fileEntries.push(e);
53459
53512
  }
53460
53513
  });
53514
+ const deferredDirAttr = [];
53461
53515
  for (const entry of dirEntries) {
53462
53516
  const dirPath = getPath(entry);
53463
53517
  const dirAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
53464
53518
  try {
53465
53519
  filetools.makeDir(dirPath);
53466
- if (dirAttr) filetools.fs.chmodSync(dirPath, dirAttr);
53467
- filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time);
53468
53520
  } catch (er) {
53469
53521
  callback(getError("Unable to create folder", dirPath));
53522
+ continue;
53523
+ }
53524
+ if (dirAttr) deferredDirAttr.push({ path: dirPath, attr: dirAttr });
53525
+ try {
53526
+ filetools.fs.utimesSync(dirPath, entry.header.time, entry.header.time);
53527
+ } catch (er) {
53470
53528
  }
53471
53529
  }
53530
+ const done = (err) => {
53531
+ if (!err) {
53532
+ try {
53533
+ applyDirAttributes(deferredDirAttr);
53534
+ } catch (er) {
53535
+ return callback(getError("Unable to set folder permissions", er.path || ""));
53536
+ }
53537
+ }
53538
+ callback(err);
53539
+ };
53472
53540
  fileEntries.reverse().reduce(function(next, entry) {
53473
53541
  return function(err) {
53474
53542
  if (err) {
@@ -53485,21 +53553,17 @@ var require_adm_zip = __commonJS({
53485
53553
  const fileAttr = keepOriginalPermission ? entry.header.fileAttr : void 0;
53486
53554
  filetools.writeFileToAsync(filePath, content, overwrite, fileAttr, function(succ) {
53487
53555
  if (!succ) {
53488
- next(getError("Unable to write file", filePath));
53556
+ return next(getError("Unable to write file", filePath));
53489
53557
  }
53490
- filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function(err_2) {
53491
- if (err_2) {
53492
- next(getError("Unable to set times", filePath));
53493
- } else {
53494
- next();
53495
- }
53558
+ filetools.fs.utimes(filePath, entry.header.time, entry.header.time, function() {
53559
+ next();
53496
53560
  });
53497
53561
  });
53498
53562
  }
53499
53563
  });
53500
53564
  }
53501
53565
  };
53502
- }, callback)();
53566
+ }, done)();
53503
53567
  },
53504
53568
  /**
53505
53569
  * Writes the newly created zip file to disk at the specified location or if a zip was opened and no ``targetFileName`` is provided, it will overwrite the opened zip
@@ -53947,7 +54011,7 @@ async function runLocalBackend(ctx, args) {
53947
54011
  stdio: "ignore",
53948
54012
  env: {
53949
54013
  ...process.env,
53950
- SENTRY_DSN
54014
+ SENTRY_DSN: LOCAL_BACKEND_SENTRY_DSN
53951
54015
  }
53952
54016
  }).on("exit", (code2) => {
53953
54017
  const why = code2 === null ? "from signal" : `with code ${code2}`;
@@ -66098,7 +66162,7 @@ function initSentry() {
66098
66162
  });
66099
66163
  }
66100
66164
  }
66101
- var import_tracing, Sentry2, import_util6, SENTRY_DSN;
66165
+ var import_tracing, Sentry2, import_util6, SENTRY_DSN, LOCAL_BACKEND_SENTRY_DSN;
66102
66166
  var init_sentry = __esm({
66103
66167
  "src/cli/lib/utils/sentry.ts"() {
66104
66168
  "use strict";
@@ -66108,6 +66172,7 @@ var init_sentry = __esm({
66108
66172
  init_index();
66109
66173
  import_util6 = require("util");
66110
66174
  SENTRY_DSN = "https://f9fa0306e3d540079cf40ce8c2ad9644@o1192621.ingest.sentry.io/6390839";
66175
+ LOCAL_BACKEND_SENTRY_DSN = "https://1c77542933b4002e48934a351c84dd38@o1192621.ingest.us.sentry.io/4511826465587200";
66111
66176
  }
66112
66177
  });
66113
66178