@weft-framework/server 0.0.1 → 0.0.3
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/dist/regions.js +4 -4
- package/dist/shared.js +2 -2
- package/dist/storage.js +1 -1
- package/package.json +3 -3
package/dist/regions.js
CHANGED
|
@@ -184,7 +184,7 @@ export class Regions {
|
|
|
184
184
|
if (what === "snapshot" && req.method === "GET") {
|
|
185
185
|
const models = {};
|
|
186
186
|
for (const [name, m] of this.#models) {
|
|
187
|
-
models[name] = m.
|
|
187
|
+
models[name] = m.syncDriver().select([]).filter((row) => Regions.#reaches(m.regionsOf(row, undefined), from));
|
|
188
188
|
}
|
|
189
189
|
return json({ epoch: this.#epoch, seq: this.#seq, models });
|
|
190
190
|
}
|
|
@@ -264,7 +264,7 @@ export class Regions {
|
|
|
264
264
|
}
|
|
265
265
|
#readOnly() {
|
|
266
266
|
for (const m of this.#models.values()) {
|
|
267
|
-
const d = m.
|
|
267
|
+
const d = m.syncDriver();
|
|
268
268
|
for (const op of ["insert", "update", "delete"]) {
|
|
269
269
|
const real = d[op].bind(d);
|
|
270
270
|
d[op] = (...args) => {
|
|
@@ -304,7 +304,7 @@ export class Regions {
|
|
|
304
304
|
try {
|
|
305
305
|
for (const [name, m] of this.#models) {
|
|
306
306
|
const rows = snap.models[name] ?? [];
|
|
307
|
-
const d = m.
|
|
307
|
+
const d = m.syncDriver();
|
|
308
308
|
for (const old of d.select([]))
|
|
309
309
|
d.delete(old[m.key]);
|
|
310
310
|
for (const row of rows)
|
|
@@ -332,7 +332,7 @@ export class Regions {
|
|
|
332
332
|
m.publishAll();
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
|
-
const d = m.
|
|
335
|
+
const d = m.syncDriver();
|
|
336
336
|
const before = d.select([], e.key).find((r) => r[m.key] === e.key || String(r[m.key]) === String(e.key));
|
|
337
337
|
this.#applying = true;
|
|
338
338
|
try {
|
package/dist/shared.js
CHANGED
|
@@ -42,7 +42,7 @@ function readable(d, actor) {
|
|
|
42
42
|
const rule = d.model.fieldReads.find(([f]) => f === d.field)?.[1];
|
|
43
43
|
if (!rule)
|
|
44
44
|
return true;
|
|
45
|
-
const raw = d.model.
|
|
45
|
+
const raw = d.model.syncDriver().select([], d.key).find((r) => sameKey(r[d.model.key], d.key));
|
|
46
46
|
try {
|
|
47
47
|
return raw !== undefined && rule(actor, raw) === true;
|
|
48
48
|
}
|
|
@@ -51,7 +51,7 @@ function readable(d, actor) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function stored(d) {
|
|
54
|
-
const row = d.model.
|
|
54
|
+
const row = d.model.syncDriver().select([], d.key).find((r) => sameKey(r[d.model.key], d.key));
|
|
55
55
|
if (!row)
|
|
56
56
|
return undefined;
|
|
57
57
|
const v = row[d.field];
|
package/dist/storage.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weft-framework/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Weft server: live pages over WebSocket/SSE with signed sessions, CSRF, rate limiting and a strict CSP, on the Fetch API (Bun, Node, edge).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"weft",
|
|
@@ -173,8 +173,8 @@
|
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
175
|
"dependencies": {
|
|
176
|
-
"@weft-framework/data": "0.0.
|
|
177
|
-
"@weft-framework/runtime": "0.0.
|
|
176
|
+
"@weft-framework/data": "0.0.3",
|
|
177
|
+
"@weft-framework/runtime": "0.0.3",
|
|
178
178
|
"@xmldom/xmldom": "0.8.15",
|
|
179
179
|
"xml-crypto": "6.4.0"
|
|
180
180
|
},
|