@crvouga/mockingbird-service-junction 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 +13 -0
- package/dist/{chunk-VHKUGUXZ.js → chunk-ES5GJACF.js} +3 -3
- package/dist/{chunk-ES4WU54W.js → chunk-GOEPHSRP.js} +21 -12
- package/dist/chunk-GOEPHSRP.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/dist/chunk-ES4WU54W.js.map +0 -7
- /package/dist/{chunk-VHKUGUXZ.js.map → chunk-ES5GJACF.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-junction
|
|
2
2
|
|
|
3
|
+
## 3.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
|
+
## 3.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
|
## 3.9.0 (2026-10-21)
|
|
4
17
|
|
|
5
18
|
### Features
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
pullCorpus,
|
|
14
14
|
resolveAdminPrefix,
|
|
15
15
|
restoreClock
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GOEPHSRP.js";
|
|
17
17
|
import {
|
|
18
18
|
defaultCorpus
|
|
19
19
|
} from "./chunk-2FZJPMTR.js";
|
|
@@ -3070,7 +3070,7 @@ async function preflightFleet(config, options) {
|
|
|
3070
3070
|
break;
|
|
3071
3071
|
}
|
|
3072
3072
|
}
|
|
3073
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.
|
|
3073
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.1" });
|
|
3074
3074
|
} catch (error) {
|
|
3075
3075
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3076
3076
|
}
|
|
@@ -5264,4 +5264,4 @@ export {
|
|
|
5264
5264
|
createServer2 as createServer,
|
|
5265
5265
|
serveTarget
|
|
5266
5266
|
};
|
|
5267
|
-
//# sourceMappingURL=chunk-
|
|
5267
|
+
//# sourceMappingURL=chunk-ES5GJACF.js.map
|
|
@@ -335,15 +335,24 @@ var Collection = class {
|
|
|
335
335
|
sqlite;
|
|
336
336
|
namespace;
|
|
337
337
|
collectionName;
|
|
338
|
+
statements = /* @__PURE__ */ new Map();
|
|
339
|
+
prepare(sql) {
|
|
340
|
+
let statement = this.statements.get(sql);
|
|
341
|
+
if (!statement) {
|
|
342
|
+
statement = this.sqlite.prepare(sql);
|
|
343
|
+
this.statements.set(sql, statement);
|
|
344
|
+
}
|
|
345
|
+
return statement;
|
|
346
|
+
}
|
|
338
347
|
constructor(sqlite, namespace, collectionName) {
|
|
339
348
|
this.sqlite = sqlite;
|
|
340
349
|
this.namespace = namespace;
|
|
341
350
|
this.collectionName = collectionName;
|
|
342
351
|
}
|
|
343
352
|
bumpCollectionSeq() {
|
|
344
|
-
const row = this.
|
|
353
|
+
const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
|
|
345
354
|
const next = (row?.value ?? 0) + 1;
|
|
346
|
-
this.
|
|
355
|
+
this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
|
|
347
356
|
ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
|
|
348
357
|
return next;
|
|
349
358
|
}
|
|
@@ -351,13 +360,13 @@ var Collection = class {
|
|
|
351
360
|
return this.sqlite.transaction(() => this.bumpCollectionSeq());
|
|
352
361
|
}
|
|
353
362
|
get(id) {
|
|
354
|
-
const row = this.
|
|
363
|
+
const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
355
364
|
if (!row)
|
|
356
365
|
return void 0;
|
|
357
366
|
return JSON.parse(row.value).value;
|
|
358
367
|
}
|
|
359
368
|
has(id) {
|
|
360
|
-
const row = this.
|
|
369
|
+
const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
361
370
|
return row !== void 0;
|
|
362
371
|
}
|
|
363
372
|
/** Insert a new record, assigning it the next sequence number. */
|
|
@@ -365,7 +374,7 @@ var Collection = class {
|
|
|
365
374
|
return this.sqlite.transaction(() => {
|
|
366
375
|
const seq = this.bumpCollectionSeq();
|
|
367
376
|
const stored = { seq, value };
|
|
368
|
-
this.
|
|
377
|
+
this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
|
|
369
378
|
VALUES (?, ?, ?, ?, ?)
|
|
370
379
|
ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
|
|
371
380
|
return stored;
|
|
@@ -374,25 +383,25 @@ var Collection = class {
|
|
|
374
383
|
/** Replace an existing record's value, keeping its position. */
|
|
375
384
|
update(id, value) {
|
|
376
385
|
return this.sqlite.transaction(() => {
|
|
377
|
-
const row = this.
|
|
386
|
+
const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
378
387
|
if (!row)
|
|
379
388
|
return void 0;
|
|
380
389
|
const stored = { seq: row.seq, value };
|
|
381
|
-
this.
|
|
390
|
+
this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
|
|
382
391
|
return stored;
|
|
383
392
|
});
|
|
384
393
|
}
|
|
385
394
|
delete(id) {
|
|
386
|
-
const result = this.
|
|
395
|
+
const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
|
|
387
396
|
return result.changes > 0;
|
|
388
397
|
}
|
|
389
398
|
/** How many records the collection holds, without reading them. */
|
|
390
399
|
count() {
|
|
391
|
-
const row = this.
|
|
400
|
+
const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
|
|
392
401
|
return Number(row?.n ?? 0);
|
|
393
402
|
}
|
|
394
403
|
list(options = {}) {
|
|
395
|
-
const rows = this.
|
|
404
|
+
const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
|
|
396
405
|
const out = [];
|
|
397
406
|
for (const row of rows) {
|
|
398
407
|
const stored = JSON.parse(row.value);
|
|
@@ -3760,7 +3769,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3760
3769
|
};
|
|
3761
3770
|
|
|
3762
3771
|
// ../core/dist/version.js
|
|
3763
|
-
var PACKAGE_VERSION = true ? "3.
|
|
3772
|
+
var PACKAGE_VERSION = true ? "3.10.1" : UNRELEASED_VERSION;
|
|
3764
3773
|
|
|
3765
3774
|
// ../core/dist/webhooks.js
|
|
3766
3775
|
var json4 = (status, body) => new Response(JSON.stringify(body), {
|
|
@@ -13894,4 +13903,4 @@ export {
|
|
|
13894
13903
|
JunctionAPI,
|
|
13895
13904
|
LabAccountConflict
|
|
13896
13905
|
};
|
|
13897
|
-
//# sourceMappingURL=chunk-
|
|
13906
|
+
//# sourceMappingURL=chunk-GOEPHSRP.js.map
|