deepspace 0.4.4 → 0.4.5

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/worker.js CHANGED
@@ -3175,13 +3175,13 @@ var YjsRoom = class extends BaseRoom {
3175
3175
  onMessage(ws, user, message) {
3176
3176
  }
3177
3177
  onBinaryMessage(ws, user, data) {
3178
- const bytes2 = new Uint8Array(data);
3179
- const decoder = createDecoder(bytes2);
3178
+ const bytes = new Uint8Array(data);
3179
+ const decoder = createDecoder(bytes);
3180
3180
  const messageType = readVarUint(decoder);
3181
3181
  if (messageType === MSG_SYNC) {
3182
- this.handleSync(ws, decoder, bytes2);
3182
+ this.handleSync(ws, decoder, bytes);
3183
3183
  } else if (messageType === MSG_AWARENESS) {
3184
- this.handleAwareness(ws, decoder, bytes2);
3184
+ this.handleAwareness(ws, decoder, bytes);
3185
3185
  }
3186
3186
  }
3187
3187
  onDisconnect(ws, user) {
@@ -4386,319 +4386,6 @@ function cronMatches(parsed, timezone, date) {
4386
4386
  return parsed.minute.has(minute) && parsed.hour.has(hour) && parsed.dayOfMonth.has(dayOfMonth) && parsed.month.has(month) && parsed.dayOfWeek.has(dayOfWeek);
4387
4387
  }
4388
4388
 
4389
- // src/server/rooms/secrets-room.ts
4390
- var INTERNAL_HEADER = "x-deepspace-internal";
4391
- var INTERNAL_VALUE = "app-secrets";
4392
- var VERSION = "app-secret-v1";
4393
- var NAME_INFO = "deepspace app secret name v1";
4394
- var VALUE_INFO = "deepspace app secret value v1";
4395
- var HMAC_INFO = "deepspace app secret lookup v1";
4396
- var STORE_ID = "default";
4397
- var SecretsRoom = class extends BaseRoom {
4398
- initialized = false;
4399
- onMessage(_ws, _user, _message) {
4400
- }
4401
- async fetch(request) {
4402
- this.ensureInitialized();
4403
- return super.fetch(request);
4404
- }
4405
- async onRequest(request) {
4406
- if (request.headers.get(INTERNAL_HEADER) !== INTERNAL_VALUE) {
4407
- return json({ error: "Not found" }, 404);
4408
- }
4409
- const url = new URL(request.url);
4410
- try {
4411
- if (request.method === "GET" && url.pathname.endsWith("/list")) {
4412
- return json({ version: this.storeVersion(), secrets: await this.list() });
4413
- }
4414
- if (request.method === "GET" && url.pathname.endsWith("/pull")) {
4415
- return json({ version: this.storeVersion(), secrets: await this.pull() });
4416
- }
4417
- if (request.method === "GET" && url.pathname.endsWith("/version")) {
4418
- return json({ version: this.storeVersion() });
4419
- }
4420
- if (request.method === "PATCH" && url.pathname.endsWith("/patch")) {
4421
- const body = await request.json();
4422
- const result = await this.patch(body);
4423
- return json(result);
4424
- }
4425
- if (request.method === "PUT" && url.pathname.endsWith("/replace")) {
4426
- const body = await request.json();
4427
- const result = await this.replace(body);
4428
- return json(result);
4429
- }
4430
- } catch (err) {
4431
- const message = err instanceof Error ? err.message : String(err);
4432
- const status = message.includes("conflict") ? 409 : 500;
4433
- return json({ error: message }, status);
4434
- }
4435
- return json({ error: "Not found" }, 404);
4436
- }
4437
- async list() {
4438
- const rows = this.sql.exec(
4439
- `SELECT name_encrypted, version, updated_by, created_at, updated_at
4440
- FROM app_secrets_store ORDER BY updated_at DESC`
4441
- ).toArray();
4442
- const out = [];
4443
- for (const row of rows) {
4444
- out.push({
4445
- name: await decryptText(this.requireKey(), row.name_encrypted, NAME_INFO),
4446
- version: row.version,
4447
- createdAt: row.created_at,
4448
- updatedAt: row.updated_at,
4449
- updatedBy: row.updated_by
4450
- });
4451
- }
4452
- return out.sort((a, b) => a.name.localeCompare(b.name));
4453
- }
4454
- async pull() {
4455
- const rows = this.sql.exec(
4456
- `SELECT name_hash, name_encrypted, value_encrypted, version, updated_by, created_at, updated_at
4457
- FROM app_secrets_store`
4458
- ).toArray();
4459
- const out = {};
4460
- for (const row of rows) {
4461
- const name = await decryptText(this.requireKey(), row.name_encrypted, NAME_INFO);
4462
- out[name] = await decryptText(this.requireKey(), row.value_encrypted, VALUE_INFO);
4463
- }
4464
- return out;
4465
- }
4466
- async patch(body) {
4467
- const now = (/* @__PURE__ */ new Date()).toISOString();
4468
- const actor = body.updatedBy ?? null;
4469
- const key = this.requireKey();
4470
- const setEntries = Object.entries(body.set ?? {});
4471
- const deleteNames = body.delete ?? [];
4472
- for (const name of [...setEntries.map(([name2]) => name2), ...deleteNames]) {
4473
- validateSecretName(name);
4474
- }
4475
- const writes = [];
4476
- for (const [name, value] of setEntries) {
4477
- const nameHash = await hashName(key, name);
4478
- const existing = this.sql.exec(
4479
- `SELECT version, created_at FROM app_secrets_store WHERE name_hash = ?`,
4480
- nameHash
4481
- ).toArray()[0];
4482
- writes.push({
4483
- nameHash,
4484
- nameEncrypted: await encryptText(key, name, NAME_INFO),
4485
- valueEncrypted: await encryptText(key, value, VALUE_INFO),
4486
- version: (existing?.version ?? 0) + 1,
4487
- createdAt: existing?.created_at ?? now
4488
- });
4489
- }
4490
- const deletes = [];
4491
- for (const name of deleteNames) {
4492
- deletes.push(await hashName(key, name));
4493
- }
4494
- this.transaction(() => {
4495
- for (const write of writes) {
4496
- this.sql.exec(
4497
- `INSERT OR REPLACE INTO app_secrets_store
4498
- (name_hash, name_encrypted, value_encrypted, version, updated_by, created_at, updated_at)
4499
- VALUES (?, ?, ?, ?, ?, ?, ?)`,
4500
- write.nameHash,
4501
- write.nameEncrypted,
4502
- write.valueEncrypted,
4503
- write.version,
4504
- actor,
4505
- write.createdAt,
4506
- now
4507
- );
4508
- }
4509
- for (const nameHash of deletes) {
4510
- this.sql.exec(`DELETE FROM app_secrets_store WHERE name_hash = ?`, nameHash);
4511
- }
4512
- this.bumpStoreVersion(now);
4513
- });
4514
- return { version: this.storeVersion(), secrets: await this.list() };
4515
- }
4516
- async replace(body) {
4517
- const next = body.secrets ?? {};
4518
- for (const name of Object.keys(next)) validateSecretName(name);
4519
- const now = (/* @__PURE__ */ new Date()).toISOString();
4520
- const actor = body.updatedBy ?? null;
4521
- const key = this.requireKey();
4522
- const writes = [];
4523
- for (const [name, value] of Object.entries(next)) {
4524
- writes.push({
4525
- nameHash: await hashName(key, name),
4526
- nameEncrypted: await encryptText(key, name, NAME_INFO),
4527
- valueEncrypted: await encryptText(key, value, VALUE_INFO)
4528
- });
4529
- }
4530
- this.transaction(() => {
4531
- this.sql.exec(`DELETE FROM app_secrets_store`);
4532
- for (const write of writes) {
4533
- this.sql.exec(
4534
- `INSERT INTO app_secrets_store
4535
- (name_hash, name_encrypted, value_encrypted, version, updated_by, created_at, updated_at)
4536
- VALUES (?, ?, ?, 1, ?, ?, ?)`,
4537
- write.nameHash,
4538
- write.nameEncrypted,
4539
- write.valueEncrypted,
4540
- actor,
4541
- now,
4542
- now
4543
- );
4544
- }
4545
- this.bumpStoreVersion(now);
4546
- });
4547
- return { version: this.storeVersion(), secrets: await this.list() };
4548
- }
4549
- transaction(run) {
4550
- this.state.storage.transactionSync(run);
4551
- }
4552
- migrateLegacyProductionSecrets() {
4553
- const legacyExists = this.sql.exec(`SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'app_secrets'`).toArray().length > 0;
4554
- if (!legacyExists) return;
4555
- const currentCount = this.sql.exec(`SELECT COUNT(*) AS count FROM app_secrets_store`).toArray()[0];
4556
- if ((currentCount?.count ?? 0) > 0) return;
4557
- this.sql.exec(`
4558
- INSERT OR IGNORE INTO app_secrets_store
4559
- (name_hash, name_encrypted, value_encrypted, version, updated_by, created_at, updated_at)
4560
- SELECT name_hash, name_encrypted, value_encrypted, version, updated_by, created_at, updated_at
4561
- FROM app_secrets
4562
- WHERE env = 'production'
4563
- `);
4564
- const legacyVersionExists = this.sql.exec(`SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'app_secret_env_versions'`).toArray().length > 0;
4565
- const legacyVersion = legacyVersionExists ? this.sql.exec(`SELECT version, updated_at FROM app_secret_env_versions WHERE env = 'production'`).toArray()[0] : void 0;
4566
- if (legacyVersion) {
4567
- this.sql.exec(
4568
- `INSERT OR REPLACE INTO app_secret_store_versions (id, version, updated_at) VALUES (?, ?, ?)`,
4569
- STORE_ID,
4570
- legacyVersion.version,
4571
- legacyVersion.updated_at
4572
- );
4573
- }
4574
- const migratedCount = this.sql.exec(`SELECT COUNT(*) AS count FROM app_secrets_store`).toArray()[0];
4575
- if (!legacyVersion && (migratedCount?.count ?? 0) > 0) {
4576
- this.sql.exec(
4577
- `INSERT OR REPLACE INTO app_secret_store_versions (id, version, updated_at) VALUES (?, ?, ?)`,
4578
- STORE_ID,
4579
- 1,
4580
- (/* @__PURE__ */ new Date()).toISOString()
4581
- );
4582
- }
4583
- }
4584
- ensureInitialized() {
4585
- if (this.initialized) return;
4586
- this.initialized = true;
4587
- this.sql.exec(`
4588
- CREATE TABLE IF NOT EXISTS app_secrets_store (
4589
- name_hash TEXT NOT NULL,
4590
- name_encrypted TEXT NOT NULL,
4591
- value_encrypted TEXT NOT NULL,
4592
- version INTEGER NOT NULL,
4593
- updated_by TEXT,
4594
- created_at TEXT NOT NULL,
4595
- updated_at TEXT NOT NULL,
4596
- PRIMARY KEY (name_hash)
4597
- )
4598
- `);
4599
- this.sql.exec(`
4600
- CREATE TABLE IF NOT EXISTS app_secret_store_versions (
4601
- id TEXT PRIMARY KEY,
4602
- version INTEGER NOT NULL,
4603
- updated_at TEXT NOT NULL
4604
- )
4605
- `);
4606
- this.migrateLegacyProductionSecrets();
4607
- }
4608
- requireKey() {
4609
- if (!this.env.APP_SECRETS_KEY) {
4610
- throw new Error("APP_SECRETS_KEY binding is missing");
4611
- }
4612
- return this.env.APP_SECRETS_KEY;
4613
- }
4614
- storeVersion() {
4615
- const row = this.sql.exec(
4616
- `SELECT version FROM app_secret_store_versions WHERE id = ?`,
4617
- STORE_ID
4618
- ).toArray()[0];
4619
- return row?.version ?? 0;
4620
- }
4621
- bumpStoreVersion(now) {
4622
- const next = this.storeVersion() + 1;
4623
- this.sql.exec(
4624
- `INSERT OR REPLACE INTO app_secret_store_versions (id, version, updated_at) VALUES (?, ?, ?)`,
4625
- STORE_ID,
4626
- next,
4627
- now
4628
- );
4629
- }
4630
- };
4631
- function validateSecretName(name) {
4632
- if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(name)) {
4633
- throw new Error(`Invalid secret name "${name}"`);
4634
- }
4635
- }
4636
- function json(body, status = 200) {
4637
- return new Response(JSON.stringify(body), {
4638
- status,
4639
- headers: { "Content-Type": "application/json" }
4640
- });
4641
- }
4642
- async function encryptText(root, plaintext, info) {
4643
- const salt = crypto.getRandomValues(new Uint8Array(16));
4644
- const iv = crypto.getRandomValues(new Uint8Array(12));
4645
- const key = await aesKey(root, salt, info);
4646
- const ciphertext = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, new TextEncoder().encode(plaintext));
4647
- return [VERSION, b64(salt), b64(iv), b64(new Uint8Array(ciphertext))].join(":");
4648
- }
4649
- async function decryptText(root, encoded, info) {
4650
- const [version, saltB64, ivB64, bodyB64] = encoded.split(":");
4651
- if (version !== VERSION || !saltB64 || !ivB64 || !bodyB64) {
4652
- throw new Error("Corrupt app secret ciphertext");
4653
- }
4654
- const key = await aesKey(root, unb64(saltB64), info);
4655
- const plaintext = await crypto.subtle.decrypt(
4656
- { name: "AES-GCM", iv: bytes(unb64(ivB64)) },
4657
- key,
4658
- bytes(unb64(bodyB64))
4659
- );
4660
- return new TextDecoder().decode(plaintext);
4661
- }
4662
- async function hashName(root, name) {
4663
- const key = await hmacKey(root, HMAC_INFO);
4664
- const sig = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(`production:${name}`));
4665
- return Array.from(new Uint8Array(sig)).map((b) => b.toString(16).padStart(2, "0")).join("");
4666
- }
4667
- async function aesKey(root, salt, info) {
4668
- const base = await crypto.subtle.importKey("raw", new TextEncoder().encode(root), "HKDF", false, ["deriveKey"]);
4669
- return crypto.subtle.deriveKey(
4670
- { name: "HKDF", hash: "SHA-256", salt: bytes(salt), info: new TextEncoder().encode(info) },
4671
- base,
4672
- { name: "AES-GCM", length: 256 },
4673
- false,
4674
- ["encrypt", "decrypt"]
4675
- );
4676
- }
4677
- async function hmacKey(root, info) {
4678
- const base = await crypto.subtle.importKey("raw", new TextEncoder().encode(root), "HKDF", false, ["deriveKey"]);
4679
- return crypto.subtle.deriveKey(
4680
- { name: "HKDF", hash: "SHA-256", salt: bytes(new Uint8Array(16)), info: new TextEncoder().encode(info) },
4681
- base,
4682
- { name: "HMAC", hash: "SHA-256", length: 256 },
4683
- false,
4684
- ["sign"]
4685
- );
4686
- }
4687
- function b64(bytes2) {
4688
- let s = "";
4689
- for (const b of bytes2) s += String.fromCharCode(b);
4690
- return btoa(s);
4691
- }
4692
- function unb64(value) {
4693
- const s = atob(value);
4694
- const out = new Uint8Array(s.length);
4695
- for (let i = 0; i < s.length; i++) out[i] = s.charCodeAt(i);
4696
- return out;
4697
- }
4698
- function bytes(input) {
4699
- return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
4700
- }
4701
-
4702
4389
  // src/server/rooms/job-room.ts
4703
4390
  var RUNNING_STALE_MS = 16 * 60 * 1e3;
4704
4391
  var DEFAULT_RETENTION_MS = 24 * 60 * 60 * 1e3;
@@ -5316,7 +5003,6 @@ var RESERVED_BINDING_NAMES = /* @__PURE__ */ new Set([
5316
5003
  "AUTH_WORKER_URL",
5317
5004
  "APP_IDENTITY_TOKEN",
5318
5005
  "APP_OWNER_JWT",
5319
- "APP_SECRETS_KEY",
5320
5006
  "USAGE_EVENTS"
5321
5007
  ]);
5322
5008
  function validateBindingManifest(manifest) {
@@ -7244,8 +6930,8 @@ import { importSPKI, jwtVerify } from "jose";
7244
6930
 
7245
6931
  // src/server/auth/utils.ts
7246
6932
  var BASE64_URL_REGEX = /^[A-Za-z0-9-_]+$/;
7247
- function bufferToHex(bytes2) {
7248
- const view = bytes2 instanceof Uint8Array ? bytes2 : new Uint8Array(bytes2);
6933
+ function bufferToHex(bytes) {
6934
+ const view = bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes);
7249
6935
  let hex = "";
7250
6936
  for (const byte of view) {
7251
6937
  hex += byte.toString(16).padStart(2, "0");
@@ -7268,9 +6954,9 @@ function decodeJwtPayload(token) {
7268
6954
  if (!BASE64_URL_REGEX.test(payloadSegment)) return void 0;
7269
6955
  try {
7270
6956
  const normalized = payloadSegment.replace(/-/g, "+").replace(/_/g, "/").padEnd(Math.ceil(payloadSegment.length / 4) * 4, "=");
7271
- const bytes2 = base64ToUint8Array(normalized);
7272
- const json2 = new TextDecoder().decode(bytes2);
7273
- const payload = JSON.parse(json2);
6957
+ const bytes = base64ToUint8Array(normalized);
6958
+ const json = new TextDecoder().decode(bytes);
6959
+ const payload = JSON.parse(json);
7274
6960
  return {
7275
6961
  iss: payload.iss ?? null,
7276
6962
  aud: payload.aud ?? null,
@@ -7493,176 +7179,6 @@ async function generateAppleClientSecret(apple) {
7493
7179
  cachedAppleSecret = { keyId: apple.keyId, token, expiresAt };
7494
7180
  return token;
7495
7181
  }
7496
-
7497
- // src/server/secrets.ts
7498
- var DEFAULT_REFRESH_INTERVAL_MS = 24 * 60 * 60 * 1e3;
7499
- function createSecrets(env, options = {}) {
7500
- const refreshIntervalMs = options.refreshIntervalMs ?? DEFAULT_REFRESH_INTERVAL_MS;
7501
- const now = options.now ?? (() => Date.now());
7502
- const cache = /* @__PURE__ */ new Map();
7503
- let loadedAll = null;
7504
- let loadedVersion = 0;
7505
- let lastCheckedAt = 0;
7506
- function stub() {
7507
- if (!env.SECRETS_ROOMS) throw new Error("SECRETS_ROOMS binding is missing");
7508
- if (!env.APP_SECRETS_KEY) throw new Error("APP_SECRETS_KEY binding is missing");
7509
- const id = env.SECRETS_ROOMS.idFromName("app-secrets");
7510
- return env.SECRETS_ROOMS.get(id);
7511
- }
7512
- async function fetchJson(path) {
7513
- const res = await stub().fetch(`https://app-secrets/${path}`, {
7514
- headers: { "x-deepspace-internal": "app-secrets" }
7515
- });
7516
- const body = await res.json().catch(() => ({}));
7517
- if (!res.ok) throw new Error(body.error ?? `App secrets unavailable (${res.status})`);
7518
- return body;
7519
- }
7520
- async function pullAll() {
7521
- const body = await fetchJson("pull");
7522
- const version = typeof body.version === "number" ? body.version : 0;
7523
- cache.clear();
7524
- for (const [name, value] of Object.entries(body.secrets ?? {})) {
7525
- cache.set(name, value);
7526
- }
7527
- loadedVersion = version;
7528
- lastCheckedAt = now();
7529
- return version;
7530
- }
7531
- async function loadAll() {
7532
- await pullAll();
7533
- }
7534
- async function ensureLoaded() {
7535
- if (!loadedAll) {
7536
- loadedAll = loadAll().catch((err) => {
7537
- loadedAll = null;
7538
- throw err;
7539
- });
7540
- }
7541
- await loadedAll;
7542
- }
7543
- async function maybeCheckForUpdates() {
7544
- if (!loadedAll) return;
7545
- if (refreshIntervalMs < 0) return;
7546
- if (now() - lastCheckedAt < refreshIntervalMs) return;
7547
- try {
7548
- await client.checkForUpdates();
7549
- } catch {
7550
- }
7551
- }
7552
- function localDevValue(name) {
7553
- const value = env[name];
7554
- return env.APP_SECRETS_LOCAL_FALLBACK === "true" && typeof value === "string" ? value : void 0;
7555
- }
7556
- const client = {
7557
- async get(name) {
7558
- const local = localDevValue(name);
7559
- if (local !== void 0) return local;
7560
- if (!cache.has(name)) await ensureLoaded();
7561
- else await maybeCheckForUpdates();
7562
- return cache.get(name);
7563
- },
7564
- async require(name) {
7565
- const value = await this.get(name);
7566
- if (value === void 0) throw new Error(`Missing app secret "${name}"`);
7567
- return value;
7568
- },
7569
- async getMany(names) {
7570
- const out = {};
7571
- for (const name of names) out[name] = await this.get(name);
7572
- return out;
7573
- },
7574
- async preload(names) {
7575
- if (env.APP_SECRETS_LOCAL_FALLBACK === "true") {
7576
- const missing = [];
7577
- for (const name of names) {
7578
- const local = localDevValue(name);
7579
- if (local !== void 0) cache.set(name, local);
7580
- else missing.push(name);
7581
- }
7582
- if (missing.length === 0) {
7583
- await maybeCheckForUpdates();
7584
- return;
7585
- }
7586
- }
7587
- await ensureLoaded();
7588
- await maybeCheckForUpdates();
7589
- },
7590
- async refresh(refreshOptions = {}) {
7591
- if (refreshOptions.force || !loadedAll) {
7592
- const previous = loadedVersion;
7593
- const version = await pullAll();
7594
- loadedAll = Promise.resolve();
7595
- return { changed: version !== previous, version };
7596
- }
7597
- return this.checkForUpdates();
7598
- },
7599
- async checkForUpdates() {
7600
- await ensureLoaded();
7601
- const body = await fetchJson("version");
7602
- const version = typeof body.version === "number" ? body.version : 0;
7603
- lastCheckedAt = now();
7604
- if (version === loadedVersion) return { changed: false, version };
7605
- const pulledVersion = await pullAll();
7606
- return { changed: true, version: pulledVersion };
7607
- },
7608
- invalidate() {
7609
- cache.clear();
7610
- loadedAll = null;
7611
- loadedVersion = 0;
7612
- lastCheckedAt = 0;
7613
- },
7614
- async withFreshSecrets(operation, retryOptions = {}) {
7615
- let first;
7616
- try {
7617
- first = await operation({ secrets: client, attempt: 1, refreshed: false });
7618
- } catch (err) {
7619
- if (!shouldRefreshOnError(err)) throw err;
7620
- const refresh = await refreshAfterFailure(err);
7621
- if (!refresh.changed && !retryOptions.retryWhenUnchanged) throw err;
7622
- return operation({ secrets: client, attempt: 2, refreshed: refresh.changed });
7623
- }
7624
- if (first instanceof Response && shouldRefreshOnStatus(first.status)) {
7625
- const refresh = await refreshAfterFailure(first);
7626
- if (refresh.changed || retryOptions.retryWhenUnchanged) {
7627
- return operation({ secrets: client, attempt: 2, refreshed: refresh.changed });
7628
- }
7629
- }
7630
- return first;
7631
- }
7632
- };
7633
- async function refreshAfterFailure(original) {
7634
- try {
7635
- return await client.refresh({ force: true });
7636
- } catch (err) {
7637
- const originalMessage = describeFailure(original);
7638
- const refreshMessage = err instanceof Error ? err.message : String(err);
7639
- throw new Error(`Secret refresh failed after API failure (${originalMessage}): ${refreshMessage}`);
7640
- }
7641
- }
7642
- return client;
7643
- }
7644
- function shouldRefreshOnError(error) {
7645
- const status = statusFromError(error);
7646
- return status !== void 0 && shouldRefreshOnStatus(status);
7647
- }
7648
- function shouldRefreshOnStatus(status) {
7649
- return status === 401 || status === 403;
7650
- }
7651
- function statusFromError(error) {
7652
- if (!error || typeof error !== "object") return void 0;
7653
- const record = error;
7654
- if (typeof record.status === "number") return record.status;
7655
- if (typeof record.statusCode === "number") return record.statusCode;
7656
- if (typeof record.response?.status === "number") return record.response.status;
7657
- return void 0;
7658
- }
7659
- function describeFailure(value) {
7660
- if (value instanceof Response) return `HTTP ${value.status}`;
7661
- if (value instanceof Error) return value.message;
7662
- const status = statusFromError(value);
7663
- if (status) return `HTTP ${status}`;
7664
- return String(value);
7665
- }
7666
7182
  export {
7667
7183
  AI_CHATS_SCHEMA,
7668
7184
  AI_MESSAGES_SCHEMA,
@@ -7710,7 +7226,6 @@ export {
7710
7226
  SYSTEM_COLLECTIONS,
7711
7227
  SYSTEM_MANAGED_COLUMNS,
7712
7228
  SchemaRegistry,
7713
- SecretsRoom,
7714
7229
  USERS_COLUMNS,
7715
7230
  VOTING_SCHEMAS,
7716
7231
  WORKSPACE_SCHEMAS,
@@ -7745,7 +7260,6 @@ export {
7745
7260
  createDeepSpaceAuth,
7746
7261
  createEncoder,
7747
7262
  createScopedR2Handler,
7748
- createSecrets,
7749
7263
  dataToColumnValues,
7750
7264
  decodeJwtPayload,
7751
7265
  deleteChatCascade,