cursedbelt-server 4.40.2 → 4.40.3

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.
@@ -165,7 +165,7 @@ export function createIncidentStore(db) {
165
165
  },
166
166
  acknowledge(fp, now = Date.now()) {
167
167
  const row = selectOne.get(fp);
168
- if (!row || row.state !== "open")
168
+ if (row?.state !== "open")
169
169
  return false;
170
170
  db.prepare(`UPDATE ${INCIDENTS_TABLE} SET state = 'acknowledged', acknowledged_at = ?
171
171
  WHERE fingerprint = ?`).run(now, fp);
@@ -26,7 +26,7 @@ const isLevel = (v) => v === 'read' || v === 'write';
26
26
  * ```
27
27
  */
28
28
  export function mountShareRoutes(
29
- // biome-ignore lint/suspicious/noExplicitAny: the caller's Hono env is theirs, and this
29
+ // `any` on purpose: the caller's Hono env is theirs, and this
30
30
  // module reads nothing off it — narrowing it would force every app to name its own Env
31
31
  // here for no gain.
32
32
  app, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cursedbelt-server",
3
- "version": "4.40.2",
3
+ "version": "4.40.3",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "description": "The app-facing Bun/Hono server tier of the cursedbelt split — storage, sharing, activity, guard, sync. React-free; cursedbelt-core below it.",
@@ -25,7 +25,8 @@
25
25
  "verify": "bun run gate",
26
26
  "prepublishOnly": "bun run gate --force",
27
27
  "test:pg": "bun run scripts/testPg.ts",
28
- "gate": "bun run scripts/paths.ts --only gate.ts"
28
+ "gate": "bun run scripts/paths.ts --only gate.ts",
29
+ "lint": "biome check --error-on-warnings ."
29
30
  },
30
31
  "files": [
31
32
  "dist",
@@ -352,7 +353,7 @@
352
353
  "dependencies": {
353
354
  "argon2id": "1.0.1",
354
355
  "cursedbelt-core": "^2.1.1",
355
- "cursedops": ">=0.8.1 <0.12.0",
356
+ "cursedops": ">=0.8.1 <0.13.0",
356
357
  "cwip": "^4.6.0",
357
358
  "jose": "^6.2.3"
358
359
  },
@@ -387,7 +388,7 @@
387
388
  }
388
389
  },
389
390
  "devDependencies": {
390
- "@biomejs/biome": "^2.5.0",
391
+ "@biomejs/biome": "^2.5.14",
391
392
  "@happy-dom/global-registrator": "^20.10.6",
392
393
  "@node-rs/argon2": "^2.0.2",
393
394
  "@types/bun": "^1.3.14",
@@ -408,6 +409,9 @@
408
409
  {
409
410
  "script": "paths"
410
411
  },
412
+ {
413
+ "script": "lint"
414
+ },
411
415
  {
412
416
  "script": "typecheck"
413
417
  },
@@ -208,7 +208,6 @@ describe("what a message may not contain or travel down", () => {
208
208
  store.reconcile("ingest", [
209
209
  {
210
210
  ...stuckIngest(),
211
- // biome-ignore lint/suspicious/noExplicitAny: the point of the test is the wrong type
212
211
  facts: { failed: 42, firstFile: "Mom's 60th birthday.mov" as any },
213
212
  },
214
213
  ]),
@@ -316,7 +316,7 @@ export function createIncidentStore(db: Database): IncidentStore {
316
316
 
317
317
  acknowledge(fp, now = Date.now()) {
318
318
  const row = selectOne.get(fp) as Row | null;
319
- if (!row || row.state !== "open") return false;
319
+ if (row?.state !== "open") return false;
320
320
  db.prepare(
321
321
  `UPDATE ${INCIDENTS_TABLE} SET state = 'acknowledged', acknowledged_at = ?
322
322
  WHERE fingerprint = ?`,
@@ -11,7 +11,6 @@ import {
11
11
  MASTER_LOCK_STATE_HEADER,
12
12
  type MasterLockKdfParams,
13
13
  deriveMasterLockVerifier,
14
- newMasterLockKdfParams,
15
14
  } from "cursedbelt-core/master-lock";
16
15
  import { createMasterLockGuard } from "./guard.js";
17
16
  import { MasterLock } from "./masterLock.js";
@@ -107,7 +107,9 @@ describe("🔴 two devices in flight together (task 2138)", () => {
107
107
  let pending: string | null = null;
108
108
  const lock = new MasterLock({
109
109
  store: record,
110
- state: { read: () => seen, write: (json) => void (pending = json) },
110
+ state: { read: () => seen, write: (json) => {
111
+ pending = json;
112
+ } },
111
113
  seedJson: SEED,
112
114
  });
113
115
  return { lock, settle: () => pending !== null && createKvMasterLockStore(kv, MASTER_LOCK_STATE_KEY).write(pending) };
@@ -126,7 +126,7 @@ const isLevel = (v: unknown): v is ShareLevel => v === 'read' || v === 'write';
126
126
  * ```
127
127
  */
128
128
  export function mountShareRoutes<V extends ShareRouterViewer>(
129
- // biome-ignore lint/suspicious/noExplicitAny: the caller's Hono env is theirs, and this
129
+ // `any` on purpose: the caller's Hono env is theirs, and this
130
130
  // module reads nothing off it — narrowing it would force every app to name its own Env
131
131
  // here for no gain.
132
132
  app: Hono<any>,
@@ -17,8 +17,6 @@ import { bytesStream } from 'cursedbelt-core/testing';
17
17
  const CTX: MediaCtx = { userId: 'u1', tenantId: 't1' };
18
18
  const OWNER = CTX.userId;
19
19
  const stream = bytesStream;
20
- const drain = async (s: ReadableStream<Uint8Array>): Promise<Uint8Array> =>
21
- new Uint8Array(await new Response(s).arrayBuffer());
22
20
 
23
21
  let db: Database;
24
22
  let root: string;