@crvouga/mockingbird-service-twilio 3.9.0 → 3.10.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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog — @crvouga/mockingbird-service-twilio
2
2
 
3
+ ## 3.10.1 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - reopen IndexedDB durability connection after the browser force-closes it ([d0b45aa](https://github.com/crvouga/mockingbird/commit/d0b45aa1d12a55967e72b8ddc6573f5998c377ce))
8
+ - schedule packages whose tasks read another package's files ([7df459d](https://github.com/crvouga/mockingbird/commit/7df459d96132b4f84fa3553b1f907871c7e4f739))
9
+
10
+ ## 3.10.0 (2026-10-24)
11
+
12
+ ### Features
13
+
14
+ - add buffered SQL durability ([288bdcc](https://github.com/crvouga/mockingbird/commit/288bdcca84582787a54c4fdf9e803db9aac0b8d7))
15
+ - add efficient browser durability ([a8be579](https://github.com/crvouga/mockingbird/commit/a8be5799a883ddf6f731208e06f399410de4661a))
16
+
3
17
  ## 3.9.0 (2026-10-21)
4
18
 
5
19
  ### Features
@@ -458,15 +458,24 @@ var Collection = class {
458
458
  sqlite;
459
459
  namespace;
460
460
  collectionName;
461
+ statements = /* @__PURE__ */ new Map();
462
+ prepare(sql) {
463
+ let statement = this.statements.get(sql);
464
+ if (!statement) {
465
+ statement = this.sqlite.prepare(sql);
466
+ this.statements.set(sql, statement);
467
+ }
468
+ return statement;
469
+ }
461
470
  constructor(sqlite, namespace, collectionName) {
462
471
  this.sqlite = sqlite;
463
472
  this.namespace = namespace;
464
473
  this.collectionName = collectionName;
465
474
  }
466
475
  bumpCollectionSeq() {
467
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
476
+ const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
468
477
  const next = (row?.value ?? 0) + 1;
469
- this.sqlite.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
478
+ this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
470
479
  ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
471
480
  return next;
472
481
  }
@@ -474,13 +483,13 @@ var Collection = class {
474
483
  return this.sqlite.transaction(() => this.bumpCollectionSeq());
475
484
  }
476
485
  get(id) {
477
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
486
+ const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
478
487
  if (!row)
479
488
  return void 0;
480
489
  return JSON.parse(row.value).value;
481
490
  }
482
491
  has(id) {
483
- const row = this.sqlite.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
492
+ const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
484
493
  return row !== void 0;
485
494
  }
486
495
  /** Insert a new record, assigning it the next sequence number. */
@@ -488,7 +497,7 @@ var Collection = class {
488
497
  return this.sqlite.transaction(() => {
489
498
  const seq = this.bumpCollectionSeq();
490
499
  const stored = { seq, value };
491
- this.sqlite.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
500
+ this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
492
501
  VALUES (?, ?, ?, ?, ?)
493
502
  ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
494
503
  return stored;
@@ -497,25 +506,25 @@ var Collection = class {
497
506
  /** Replace an existing record's value, keeping its position. */
498
507
  update(id, value) {
499
508
  return this.sqlite.transaction(() => {
500
- const row = this.sqlite.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
509
+ const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
501
510
  if (!row)
502
511
  return void 0;
503
512
  const stored = { seq: row.seq, value };
504
- this.sqlite.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
513
+ this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
505
514
  return stored;
506
515
  });
507
516
  }
508
517
  delete(id) {
509
- const result = this.sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
518
+ const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
510
519
  return result.changes > 0;
511
520
  }
512
521
  /** How many records the collection holds, without reading them. */
513
522
  count() {
514
- const row = this.sqlite.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
523
+ const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
515
524
  return Number(row?.n ?? 0);
516
525
  }
517
526
  list(options = {}) {
518
- const rows = this.sqlite.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
527
+ const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
519
528
  const out = [];
520
529
  for (const row of rows) {
521
530
  const stored = JSON.parse(row.value);
@@ -3852,7 +3861,7 @@ var stateAdminRoutes = (routes) => {
3852
3861
  };
3853
3862
 
3854
3863
  // ../core/dist/version.js
3855
- var PACKAGE_VERSION = true ? "3.9.0" : UNRELEASED_VERSION;
3864
+ var PACKAGE_VERSION = true ? "3.10.1" : UNRELEASED_VERSION;
3856
3865
 
3857
3866
  // ../core/dist/signing.js
3858
3867
  var encoder = new TextEncoder();
@@ -10494,4 +10503,4 @@ export {
10494
10503
  * Copyright (c) 2021 - present, Yusuke Wada and Hono contributors
10495
10504
  * MIT license: see THIRD_PARTY_NOTICES.md in the repository and npm packages.
10496
10505
  */
10497
- //# sourceMappingURL=chunk-IKI3TLRI.js.map
10506
+ //# sourceMappingURL=chunk-FMUGDEKU.js.map