@crvouga/mockingbird-service-eventbridge 1.9.0 → 1.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,18 @@
1
1
  # Changelog — @crvouga/mockingbird-service-eventbridge
2
2
 
3
+ ## 1.10.1 (2026-11-02)
4
+
5
+ ### Fixes and improvements
6
+
7
+ - schedule packages whose tasks read another package's files ([7df459d](https://github.com/crvouga/mockingbird/commit/7df459d96132b4f84fa3553b1f907871c7e4f739))
8
+
9
+ ## 1.10.0 (2026-10-24)
10
+
11
+ ### Features
12
+
13
+ - add buffered SQL durability ([288bdcc](https://github.com/crvouga/mockingbird/commit/288bdcca84582787a54c4fdf9e803db9aac0b8d7))
14
+ - add efficient browser durability ([a8be579](https://github.com/crvouga/mockingbird/commit/a8be5799a883ddf6f731208e06f399410de4661a))
15
+
3
16
  ## 1.9.0 (2026-10-21)
4
17
 
5
18
  ### Features
@@ -10,7 +10,7 @@ import {
10
10
  parseFaultHeader,
11
11
  resolveAdminPrefix,
12
12
  restoreClock
13
- } from "./chunk-WB62GFDZ.js";
13
+ } from "./chunk-IFGXXTHW.js";
14
14
 
15
15
  // ../../adapters/node/dist/cli.js
16
16
  import { readFile as readFile5 } from "node:fs/promises";
@@ -3058,7 +3058,7 @@ async function preflightFleet(config, options) {
3058
3058
  break;
3059
3059
  }
3060
3060
  }
3061
- targets.set(name, { ...target, packageVersion: packageVersion ?? "1.9.0" });
3061
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "1.10.1" });
3062
3062
  } catch (error) {
3063
3063
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3064
3064
  }
@@ -5020,4 +5020,4 @@ export {
5020
5020
  createServer3 as createServer2,
5021
5021
  serveTarget
5022
5022
  };
5023
- //# sourceMappingURL=chunk-OOOK2W36.js.map
5023
+ //# sourceMappingURL=chunk-A7IBS5SS.js.map
@@ -4477,15 +4477,24 @@ var Collection = class {
4477
4477
  sqlite;
4478
4478
  namespace;
4479
4479
  collectionName;
4480
+ statements = /* @__PURE__ */ new Map();
4481
+ prepare(sql) {
4482
+ let statement = this.statements.get(sql);
4483
+ if (!statement) {
4484
+ statement = this.sqlite.prepare(sql);
4485
+ this.statements.set(sql, statement);
4486
+ }
4487
+ return statement;
4488
+ }
4480
4489
  constructor(sqlite, namespace, collectionName) {
4481
4490
  this.sqlite = sqlite;
4482
4491
  this.namespace = namespace;
4483
4492
  this.collectionName = collectionName;
4484
4493
  }
4485
4494
  bumpCollectionSeq() {
4486
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
4495
+ const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
4487
4496
  const next = (row?.value ?? 0) + 1;
4488
- this.sqlite.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
4497
+ this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
4489
4498
  ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
4490
4499
  return next;
4491
4500
  }
@@ -4493,13 +4502,13 @@ var Collection = class {
4493
4502
  return this.sqlite.transaction(() => this.bumpCollectionSeq());
4494
4503
  }
4495
4504
  get(id) {
4496
- const row = this.sqlite.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4505
+ const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4497
4506
  if (!row)
4498
4507
  return void 0;
4499
4508
  return JSON.parse(row.value).value;
4500
4509
  }
4501
4510
  has(id) {
4502
- const row = this.sqlite.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4511
+ const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4503
4512
  return row !== void 0;
4504
4513
  }
4505
4514
  /** Insert a new record, assigning it the next sequence number. */
@@ -4507,7 +4516,7 @@ var Collection = class {
4507
4516
  return this.sqlite.transaction(() => {
4508
4517
  const seq = this.bumpCollectionSeq();
4509
4518
  const stored = { seq, value };
4510
- this.sqlite.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
4519
+ this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
4511
4520
  VALUES (?, ?, ?, ?, ?)
4512
4521
  ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
4513
4522
  return stored;
@@ -4516,25 +4525,25 @@ var Collection = class {
4516
4525
  /** Replace an existing record's value, keeping its position. */
4517
4526
  update(id, value) {
4518
4527
  return this.sqlite.transaction(() => {
4519
- const row = this.sqlite.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4528
+ const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
4520
4529
  if (!row)
4521
4530
  return void 0;
4522
4531
  const stored = { seq: row.seq, value };
4523
- this.sqlite.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
4532
+ this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
4524
4533
  return stored;
4525
4534
  });
4526
4535
  }
4527
4536
  delete(id) {
4528
- const result = this.sqlite.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
4537
+ const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
4529
4538
  return result.changes > 0;
4530
4539
  }
4531
4540
  /** How many records the collection holds, without reading them. */
4532
4541
  count() {
4533
- const row = this.sqlite.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
4542
+ const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
4534
4543
  return Number(row?.n ?? 0);
4535
4544
  }
4536
4545
  list(options = {}) {
4537
- const rows = this.sqlite.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
4546
+ const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
4538
4547
  const out = [];
4539
4548
  for (const row of rows) {
4540
4549
  const stored = JSON.parse(row.value);
@@ -8151,7 +8160,7 @@ var stateAdminRoutes = (routes) => {
8151
8160
  };
8152
8161
 
8153
8162
  // ../core/dist/version.js
8154
- var PACKAGE_VERSION = true ? "1.9.0" : UNRELEASED_VERSION;
8163
+ var PACKAGE_VERSION = true ? "1.10.1" : UNRELEASED_VERSION;
8155
8164
 
8156
8165
  // ../core/dist/webhooks.js
8157
8166
  var json4 = (status, body) => new Response(JSON.stringify(body), {
@@ -9777,4 +9786,4 @@ export {
9777
9786
  EVENTBRIDGE_NAMESPACE,
9778
9787
  EventBridgeAPI
9779
9788
  };
9780
- //# sourceMappingURL=chunk-WB62GFDZ.js.map
9789
+ //# sourceMappingURL=chunk-IFGXXTHW.js.map