@crvouga/mockingbird-service-oura 1.9.0 → 1.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-4GDFCOTS.js → chunk-AA2A4F3M.js} +3 -3
- package/dist/{chunk-SQDKIXXY.js → chunk-N7W5X5YP.js} +21 -12
- package/dist/chunk-N7W5X5YP.js.map +7 -0
- 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-SQDKIXXY.js.map +0 -7
- /package/dist/{chunk-4GDFCOTS.js.map → chunk-AA2A4F3M.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-oura
|
|
2
2
|
|
|
3
|
+
## 1.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
|
## 1.9.0 (2026-10-21)
|
|
4
15
|
|
|
5
16
|
### Features
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseFaultHeader,
|
|
10
10
|
resolveAdminPrefix,
|
|
11
11
|
restoreClock
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-N7W5X5YP.js";
|
|
13
13
|
|
|
14
14
|
// ../../adapters/node/dist/cli.js
|
|
15
15
|
import { readFile as readFile5 } from "node:fs/promises";
|
|
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
|
|
|
3057
3057
|
break;
|
|
3058
3058
|
}
|
|
3059
3059
|
}
|
|
3060
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "1.
|
|
3060
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "1.10.0" });
|
|
3061
3061
|
} catch (error) {
|
|
3062
3062
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3063
3063
|
}
|
|
@@ -5011,4 +5011,4 @@ export {
|
|
|
5011
5011
|
createServer2 as createServer,
|
|
5012
5012
|
serveTarget
|
|
5013
5013
|
};
|
|
5014
|
-
//# sourceMappingURL=chunk-
|
|
5014
|
+
//# sourceMappingURL=chunk-AA2A4F3M.js.map
|
|
@@ -331,15 +331,24 @@ var Collection = class {
|
|
|
331
331
|
sqlite;
|
|
332
332
|
namespace;
|
|
333
333
|
collectionName;
|
|
334
|
+
statements = /* @__PURE__ */ new Map();
|
|
335
|
+
prepare(sql) {
|
|
336
|
+
let statement = this.statements.get(sql);
|
|
337
|
+
if (!statement) {
|
|
338
|
+
statement = this.sqlite.prepare(sql);
|
|
339
|
+
this.statements.set(sql, statement);
|
|
340
|
+
}
|
|
341
|
+
return statement;
|
|
342
|
+
}
|
|
334
343
|
constructor(sqlite, namespace, collectionName) {
|
|
335
344
|
this.sqlite = sqlite;
|
|
336
345
|
this.namespace = namespace;
|
|
337
346
|
this.collectionName = collectionName;
|
|
338
347
|
}
|
|
339
348
|
bumpCollectionSeq() {
|
|
340
|
-
const row = this.
|
|
349
|
+
const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
|
|
341
350
|
const next = (row?.value ?? 0) + 1;
|
|
342
|
-
this.
|
|
351
|
+
this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
|
|
343
352
|
ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
|
|
344
353
|
return next;
|
|
345
354
|
}
|
|
@@ -347,13 +356,13 @@ var Collection = class {
|
|
|
347
356
|
return this.sqlite.transaction(() => this.bumpCollectionSeq());
|
|
348
357
|
}
|
|
349
358
|
get(id) {
|
|
350
|
-
const row = this.
|
|
359
|
+
const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
351
360
|
if (!row)
|
|
352
361
|
return void 0;
|
|
353
362
|
return JSON.parse(row.value).value;
|
|
354
363
|
}
|
|
355
364
|
has(id) {
|
|
356
|
-
const row = this.
|
|
365
|
+
const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
357
366
|
return row !== void 0;
|
|
358
367
|
}
|
|
359
368
|
/** Insert a new record, assigning it the next sequence number. */
|
|
@@ -361,7 +370,7 @@ var Collection = class {
|
|
|
361
370
|
return this.sqlite.transaction(() => {
|
|
362
371
|
const seq = this.bumpCollectionSeq();
|
|
363
372
|
const stored = { seq, value };
|
|
364
|
-
this.
|
|
373
|
+
this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
|
|
365
374
|
VALUES (?, ?, ?, ?, ?)
|
|
366
375
|
ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
|
|
367
376
|
return stored;
|
|
@@ -370,25 +379,25 @@ var Collection = class {
|
|
|
370
379
|
/** Replace an existing record's value, keeping its position. */
|
|
371
380
|
update(id, value) {
|
|
372
381
|
return this.sqlite.transaction(() => {
|
|
373
|
-
const row = this.
|
|
382
|
+
const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
374
383
|
if (!row)
|
|
375
384
|
return void 0;
|
|
376
385
|
const stored = { seq: row.seq, value };
|
|
377
|
-
this.
|
|
386
|
+
this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
|
|
378
387
|
return stored;
|
|
379
388
|
});
|
|
380
389
|
}
|
|
381
390
|
delete(id) {
|
|
382
|
-
const result = this.
|
|
391
|
+
const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
|
|
383
392
|
return result.changes > 0;
|
|
384
393
|
}
|
|
385
394
|
/** How many records the collection holds, without reading them. */
|
|
386
395
|
count() {
|
|
387
|
-
const row = this.
|
|
396
|
+
const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
|
|
388
397
|
return Number(row?.n ?? 0);
|
|
389
398
|
}
|
|
390
399
|
list(options = {}) {
|
|
391
|
-
const rows = this.
|
|
400
|
+
const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
|
|
392
401
|
const out = [];
|
|
393
402
|
for (const row of rows) {
|
|
394
403
|
const stored = JSON.parse(row.value);
|
|
@@ -3759,7 +3768,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3759
3768
|
};
|
|
3760
3769
|
|
|
3761
3770
|
// ../core/dist/version.js
|
|
3762
|
-
var PACKAGE_VERSION = true ? "1.
|
|
3771
|
+
var PACKAGE_VERSION = true ? "1.10.0" : UNRELEASED_VERSION;
|
|
3763
3772
|
|
|
3764
3773
|
// ../core/dist/webhooks.js
|
|
3765
3774
|
var json4 = (status, body) => new Response(JSON.stringify(body), {
|
|
@@ -5377,4 +5386,4 @@ export {
|
|
|
5377
5386
|
KNOWN_SCOPES,
|
|
5378
5387
|
OuraAPI
|
|
5379
5388
|
};
|
|
5380
|
-
//# sourceMappingURL=chunk-
|
|
5389
|
+
//# sourceMappingURL=chunk-N7W5X5YP.js.map
|