@threadbase-sh/streamer 1.18.6 → 1.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1512,14 +1512,19 @@ var POOL_SIZE_MULTIPLIER = 128;
1512
1512
  var pool;
1513
1513
  var poolOffset;
1514
1514
  var fillPool = (bytes) => {
1515
- if (bytes < 0 || bytes > 1024) throw new RangeError("Wrong ID size");
1516
- if (!pool || pool.length < bytes) {
1517
- pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
1518
- import_crypto3.default.randomFillSync(pool);
1519
- poolOffset = 0;
1520
- } else if (poolOffset + bytes > pool.length) {
1521
- import_crypto3.default.randomFillSync(pool);
1522
- poolOffset = 0;
1515
+ if (bytes < 0) throw new RangeError("Wrong ID size");
1516
+ try {
1517
+ if (!pool || pool.length < bytes) {
1518
+ pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
1519
+ import_crypto3.default.randomFillSync(pool);
1520
+ poolOffset = 0;
1521
+ } else if (poolOffset + bytes > pool.length) {
1522
+ import_crypto3.default.randomFillSync(pool);
1523
+ poolOffset = 0;
1524
+ }
1525
+ } catch (e) {
1526
+ pool = void 0;
1527
+ throw e;
1523
1528
  }
1524
1529
  poolOffset += bytes;
1525
1530
  };
@@ -2193,6 +2198,7 @@ var createHonoApp = (deps, upgradeWebSocket) => {
2193
2198
  const start = Date.now();
2194
2199
  const ua = c.req.header("user-agent") ?? "";
2195
2200
  await next();
2201
+ if (!deps.logMenubarRequests && c.req.header("x-client") === "menubar") return;
2196
2202
  const ms = Date.now() - start;
2197
2203
  httpLog.info(`[req] ${c.req.method} ${c.req.path} \u2192 ${c.res.status} ${ms}ms`, {
2198
2204
  method: c.req.method,
@@ -4352,6 +4358,7 @@ var StreamerServer = class {
4352
4358
  cacheReady = false;
4353
4359
  apiKey;
4354
4360
  localNoAuth;
4361
+ logMenubarRequests;
4355
4362
  verbose;
4356
4363
  scanProfiles;
4357
4364
  dbPool = null;
@@ -4396,6 +4403,7 @@ var StreamerServer = class {
4396
4403
  this.sessionStatusBus.setMaxListeners(0);
4397
4404
  this.apiKey = config.apiKey;
4398
4405
  this.localNoAuth = config.localNoAuth ?? false;
4406
+ this.logMenubarRequests = config.logMenubarRequests ?? false;
4399
4407
  this.verbose = config.verbose ?? false;
4400
4408
  this.disableDb = config.disableDb ?? false;
4401
4409
  this.scanProfiles = config.scanProfiles;
@@ -4575,6 +4583,7 @@ var StreamerServer = class {
4575
4583
  const apiDeps = {
4576
4584
  apiKey: this.apiKey,
4577
4585
  localNoAuth: this.localNoAuth,
4586
+ logMenubarRequests: this.logMenubarRequests,
4578
4587
  publicUrl: this.publicUrl,
4579
4588
  browseRoot: this.browseRoot,
4580
4589
  ptyManager: this.ptyManager,