@crvouga/mockingbird-service-stripe 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-PM7FGGXP.js → chunk-A53GCLZN.js} +3 -3
- package/dist/{chunk-A2FQVZQW.js → chunk-DKA7ZDNT.js} +3 -3
- package/dist/{chunk-4XKRIJAN.js → chunk-HVSAON3H.js} +2 -2
- package/dist/{chunk-IKHJFW6E.js → chunk-P7O2SR42.js} +21 -12
- package/dist/chunk-P7O2SR42.js.map +7 -0
- package/dist/cli.js +4 -4
- package/dist/fleet.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -2
- package/dist/server.d.ts +2 -0
- package/dist/server.js +4 -4
- package/package.json +2 -2
- package/dist/chunk-IKHJFW6E.js.map +0 -7
- /package/dist/{chunk-PM7FGGXP.js.map → chunk-A53GCLZN.js.map} +0 -0
- /package/dist/{chunk-A2FQVZQW.js.map → chunk-DKA7ZDNT.js.map} +0 -0
- /package/dist/{chunk-4XKRIJAN.js.map → chunk-HVSAON3H.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-stripe
|
|
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
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRuntime,
|
|
3
3
|
validateAccounts
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-HVSAON3H.js";
|
|
5
5
|
import {
|
|
6
6
|
listen
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DKA7ZDNT.js";
|
|
8
8
|
|
|
9
9
|
// src/server.ts
|
|
10
10
|
import { readFileSync } from "node:fs";
|
|
@@ -87,4 +87,4 @@ export {
|
|
|
87
87
|
createServer,
|
|
88
88
|
serveTarget
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-A53GCLZN.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveAdminPrefix,
|
|
10
10
|
restoreClock,
|
|
11
11
|
signV4
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-P7O2SR42.js";
|
|
13
13
|
|
|
14
14
|
// ../../adapters/node/dist/fleet-archive.js
|
|
15
15
|
import { createHash } from "node:crypto";
|
|
@@ -3873,7 +3873,7 @@ async function preflightFleet(config, options) {
|
|
|
3873
3873
|
break;
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
|
-
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.
|
|
3876
|
+
targets.set(name, { ...target, packageVersion: packageVersion ?? "3.10.0" });
|
|
3877
3877
|
} catch (error) {
|
|
3878
3878
|
throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
3879
3879
|
}
|
|
@@ -6668,4 +6668,4 @@ export {
|
|
|
6668
6668
|
withFleetRun,
|
|
6669
6669
|
NamespacePool
|
|
6670
6670
|
};
|
|
6671
|
-
//# sourceMappingURL=chunk-
|
|
6671
|
+
//# sourceMappingURL=chunk-DKA7ZDNT.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
requestBaseUrl,
|
|
18
18
|
resolveSchema,
|
|
19
19
|
signers
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-P7O2SR42.js";
|
|
21
21
|
|
|
22
22
|
// src/account.ts
|
|
23
23
|
var accountOfKey = (key) => `acct_${opaqueToken(key, 8)}`;
|
|
@@ -15855,4 +15855,4 @@ export {
|
|
|
15855
15855
|
createRuntime2 as createRuntime,
|
|
15856
15856
|
StripeAPI
|
|
15857
15857
|
};
|
|
15858
|
-
//# sourceMappingURL=chunk-
|
|
15858
|
+
//# sourceMappingURL=chunk-HVSAON3H.js.map
|
|
@@ -236,15 +236,24 @@ var Collection = class {
|
|
|
236
236
|
sqlite;
|
|
237
237
|
namespace;
|
|
238
238
|
collectionName;
|
|
239
|
+
statements = /* @__PURE__ */ new Map();
|
|
240
|
+
prepare(sql) {
|
|
241
|
+
let statement = this.statements.get(sql);
|
|
242
|
+
if (!statement) {
|
|
243
|
+
statement = this.sqlite.prepare(sql);
|
|
244
|
+
this.statements.set(sql, statement);
|
|
245
|
+
}
|
|
246
|
+
return statement;
|
|
247
|
+
}
|
|
239
248
|
constructor(sqlite, namespace, collectionName) {
|
|
240
249
|
this.sqlite = sqlite;
|
|
241
250
|
this.namespace = namespace;
|
|
242
251
|
this.collectionName = collectionName;
|
|
243
252
|
}
|
|
244
253
|
bumpCollectionSeq() {
|
|
245
|
-
const row = this.
|
|
254
|
+
const row = this.prepare("SELECT value FROM mockingbird_sequences WHERE namespace = ? AND name = ? AND kind = 'collection'").get(this.namespace, this.collectionName);
|
|
246
255
|
const next = (row?.value ?? 0) + 1;
|
|
247
|
-
this.
|
|
256
|
+
this.prepare(`INSERT INTO mockingbird_sequences (namespace, name, kind, value) VALUES (?, ?, 'collection', ?)
|
|
248
257
|
ON CONFLICT(namespace, name, kind) DO UPDATE SET value = excluded.value`).run(this.namespace, this.collectionName, next);
|
|
249
258
|
return next;
|
|
250
259
|
}
|
|
@@ -252,13 +261,13 @@ var Collection = class {
|
|
|
252
261
|
return this.sqlite.transaction(() => this.bumpCollectionSeq());
|
|
253
262
|
}
|
|
254
263
|
get(id) {
|
|
255
|
-
const row = this.
|
|
264
|
+
const row = this.prepare("SELECT value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
256
265
|
if (!row)
|
|
257
266
|
return void 0;
|
|
258
267
|
return JSON.parse(row.value).value;
|
|
259
268
|
}
|
|
260
269
|
has(id) {
|
|
261
|
-
const row = this.
|
|
270
|
+
const row = this.prepare("SELECT 1 AS ok FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
262
271
|
return row !== void 0;
|
|
263
272
|
}
|
|
264
273
|
/** Insert a new record, assigning it the next sequence number. */
|
|
@@ -266,7 +275,7 @@ var Collection = class {
|
|
|
266
275
|
return this.sqlite.transaction(() => {
|
|
267
276
|
const seq = this.bumpCollectionSeq();
|
|
268
277
|
const stored = { seq, value };
|
|
269
|
-
this.
|
|
278
|
+
this.prepare(`INSERT INTO mockingbird_records (namespace, collection, id, seq, value)
|
|
270
279
|
VALUES (?, ?, ?, ?, ?)
|
|
271
280
|
ON CONFLICT(namespace, collection, id) DO UPDATE SET seq = excluded.seq, value = excluded.value`).run(this.namespace, this.collectionName, id, seq, JSON.stringify(stored));
|
|
272
281
|
return stored;
|
|
@@ -275,25 +284,25 @@ var Collection = class {
|
|
|
275
284
|
/** Replace an existing record's value, keeping its position. */
|
|
276
285
|
update(id, value) {
|
|
277
286
|
return this.sqlite.transaction(() => {
|
|
278
|
-
const row = this.
|
|
287
|
+
const row = this.prepare("SELECT seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").get(this.namespace, this.collectionName, id);
|
|
279
288
|
if (!row)
|
|
280
289
|
return void 0;
|
|
281
290
|
const stored = { seq: row.seq, value };
|
|
282
|
-
this.
|
|
291
|
+
this.prepare("UPDATE mockingbird_records SET value = ? WHERE namespace = ? AND collection = ? AND id = ?").run(JSON.stringify(stored), this.namespace, this.collectionName, id);
|
|
283
292
|
return stored;
|
|
284
293
|
});
|
|
285
294
|
}
|
|
286
295
|
delete(id) {
|
|
287
|
-
const result = this.
|
|
296
|
+
const result = this.prepare("DELETE FROM mockingbird_records WHERE namespace = ? AND collection = ? AND id = ?").run(this.namespace, this.collectionName, id);
|
|
288
297
|
return result.changes > 0;
|
|
289
298
|
}
|
|
290
299
|
/** How many records the collection holds, without reading them. */
|
|
291
300
|
count() {
|
|
292
|
-
const row = this.
|
|
301
|
+
const row = this.prepare("SELECT COUNT(*) AS n FROM mockingbird_records WHERE namespace = ? AND collection = ?").get(this.namespace, this.collectionName);
|
|
293
302
|
return Number(row?.n ?? 0);
|
|
294
303
|
}
|
|
295
304
|
list(options = {}) {
|
|
296
|
-
const rows = this.
|
|
305
|
+
const rows = this.prepare("SELECT id, seq, value FROM mockingbird_records WHERE namespace = ? AND collection = ?").all(this.namespace, this.collectionName);
|
|
297
306
|
const out = [];
|
|
298
307
|
for (const row of rows) {
|
|
299
308
|
const stored = JSON.parse(row.value);
|
|
@@ -3854,7 +3863,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3854
3863
|
};
|
|
3855
3864
|
|
|
3856
3865
|
// ../core/dist/version.js
|
|
3857
|
-
var PACKAGE_VERSION = true ? "3.
|
|
3866
|
+
var PACKAGE_VERSION = true ? "3.10.0" : UNRELEASED_VERSION;
|
|
3858
3867
|
|
|
3859
3868
|
// ../core/dist/signing.js
|
|
3860
3869
|
var encoder = new TextEncoder();
|
|
@@ -5817,4 +5826,4 @@ export {
|
|
|
5817
5826
|
createRuntime,
|
|
5818
5827
|
signV4
|
|
5819
5828
|
};
|
|
5820
|
-
//# sourceMappingURL=chunk-
|
|
5829
|
+
//# sourceMappingURL=chunk-P7O2SR42.js.map
|