@crvouga/mockingbird-service-twilio 3.9.0 → 3.10.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.
- package/CHANGELOG.md +11 -0
- package/dist/{chunk-IKI3TLRI.js → chunk-FMUGDEKU.js} +21 -12
- package/dist/chunk-FMUGDEKU.js.map +7 -0
- package/dist/{chunk-S653NKEC.js → chunk-IB5AKVGU.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-IKI3TLRI.js.map +0 -7
- /package/dist/{chunk-S653NKEC.js.map → chunk-IB5AKVGU.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-twilio
|
|
2
2
|
|
|
3
|
+
## 3.10.0 (2026-10-24)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add buffered SQL durability ([288bdcc](https://github.com/crvouga/mockingbird/commit/288bdcca84582787a54c4fdf9e803db9aac0b8d7))
|
|
8
|
+
- add efficient browser durability ([a8be579](https://github.com/crvouga/mockingbird/commit/a8be5799a883ddf6f731208e06f399410de4661a))
|
|
9
|
+
|
|
10
|
+
### Dependencies
|
|
11
|
+
|
|
12
|
+
- `@crvouga/mockingbird-service-sqlite`
|
|
13
|
+
|
|
3
14
|
## 3.9.0 (2026-10-21)
|
|
4
15
|
|
|
5
16
|
### 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
3864
|
+
var PACKAGE_VERSION = true ? "3.10.0" : 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-
|
|
10506
|
+
//# sourceMappingURL=chunk-FMUGDEKU.js.map
|