@rocicorp/zero 1.10.0-canary.19 → 1.10.0-canary.20
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/out/replicache/src/btree/read.d.ts +12 -1
- package/out/replicache/src/btree/read.d.ts.map +1 -1
- package/out/replicache/src/btree/read.js +24 -12
- package/out/replicache/src/btree/read.js.map +1 -1
- package/out/replicache/src/db/write.js.map +1 -1
- package/out/replicache/src/kv/expo-sqlite/store.d.ts.map +1 -1
- package/out/replicache/src/kv/expo-sqlite/store.js +27 -4
- package/out/replicache/src/kv/expo-sqlite/store.js.map +1 -1
- package/out/replicache/src/kv/sqlite-store.d.ts +11 -0
- package/out/replicache/src/kv/sqlite-store.d.ts.map +1 -1
- package/out/replicache/src/kv/sqlite-store.js +43 -3
- package/out/replicache/src/kv/sqlite-store.js.map +1 -1
- package/out/replicache/src/replicache-impl.d.ts.map +1 -1
- package/out/replicache/src/replicache-impl.js +10 -0
- package/out/replicache/src/replicache-impl.js.map +1 -1
- package/out/replicache/src/transactions.d.ts.map +1 -1
- package/out/replicache/src/transactions.js +1 -1
- package/out/replicache/src/transactions.js.map +1 -1
- package/out/shared/src/error.d.ts +11 -0
- package/out/shared/src/error.d.ts.map +1 -1
- package/out/shared/src/error.js +35 -1
- package/out/shared/src/error.js.map +1 -1
- package/out/shared/src/hash.d.ts.map +1 -1
- package/out/shared/src/hash.js +105 -10
- package/out/shared/src/hash.js.map +1 -1
- package/out/shared/src/map.d.ts +7 -2
- package/out/shared/src/map.d.ts.map +1 -1
- package/out/shared/src/map.js.map +1 -1
- package/out/zero/package.js +2 -3
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/config/zero-config.d.ts +19 -2
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +86 -27
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/db/create.d.ts.map +1 -1
- package/out/zero-cache/src/db/create.js +4 -1
- package/out/zero-cache/src/db/create.js.map +1 -1
- package/out/zero-cache/src/db/index-predicate.d.ts +4 -0
- package/out/zero-cache/src/db/index-predicate.d.ts.map +1 -0
- package/out/zero-cache/src/db/index-predicate.js +46 -0
- package/out/zero-cache/src/db/index-predicate.js.map +1 -0
- package/out/zero-cache/src/db/lite-tables.d.ts +10 -2
- package/out/zero-cache/src/db/lite-tables.d.ts.map +1 -1
- package/out/zero-cache/src/db/lite-tables.js +8 -3
- package/out/zero-cache/src/db/lite-tables.js.map +1 -1
- package/out/zero-cache/src/db/specs.d.ts +41 -0
- package/out/zero-cache/src/db/specs.d.ts.map +1 -1
- package/out/zero-cache/src/db/specs.js +30 -3
- package/out/zero-cache/src/db/specs.js.map +1 -1
- package/out/zero-cache/src/server/change-streamer.d.ts.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +2 -1
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/server/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/server/replicator.js +6 -2
- package/out/zero-cache/src/server/replicator.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +11 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.js +21 -2
- package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +1 -0
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js +7 -6
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +1513 -229
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.js +2 -2
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/index-predicate.d.ts +19 -0
- package/out/zero-cache/src/services/change-source/pg/schema/index-predicate.d.ts.map +1 -0
- package/out/zero-cache/src/services/change-source/pg/schema/index-predicate.js +581 -0
- package/out/zero-cache/src/services/change-source/pg/schema/index-predicate.js.map +1 -0
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.js +15 -6
- package/out/zero-cache/src/services/change-source/pg/schema/init.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts +137 -20
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/published.js +82 -13
- package/out/zero-cache/src/services/change-source/pg/schema/published.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +128 -21
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/shard.js +5 -5
- package/out/zero-cache/src/services/change-source/pg/schema/shard.js.map +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/data.d.ts +2 -0
- package/out/zero-cache/src/services/change-source/protocol/current/data.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +3 -0
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +1 -0
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +1 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts.map +1 -1
- package/out/zero-cache/src/services/litestream/commands.js +8 -3
- package/out/zero-cache/src/services/litestream/commands.js.map +1 -1
- package/out/zero-cache/src/services/litestream/config-v5.yml +15 -1
- package/out/zero-cache/src/services/litestream/litestream-checkpointer.js +131 -0
- package/out/zero-cache/src/services/litestream/litestream-checkpointer.js.map +1 -0
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +70 -0
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +1 -0
- package/out/zero-cache/src/services/litestream/litestream-controller.js +101 -0
- package/out/zero-cache/src/services/litestream/litestream-controller.js.map +1 -0
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/change-processor.js +16 -16
- package/out/zero-cache/src/services/replicator/change-processor.js.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.js +1 -0
- package/out/zero-cache/src/services/replicator/incremental-sync.js.map +1 -1
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +27 -2
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/write-worker-client.js +3 -2
- package/out/zero-cache/src/services/replicator/write-worker-client.js.map +1 -1
- package/out/zero-cache/src/services/replicator/write-worker.js +24 -5
- package/out/zero-cache/src/services/replicator/write-worker.js.map +1 -1
- package/out/zero-cache/src/workers/replicator.d.ts +1 -0
- package/out/zero-cache/src/workers/replicator.d.ts.map +1 -1
- package/out/zero-cache/src/workers/replicator.js +4 -2
- package/out/zero-cache/src/workers/replicator.js.map +1 -1
- package/out/zero-client/src/client/connection-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/connection-manager.js +46 -0
- package/out/zero-client/src/client/connection-manager.js.map +1 -1
- package/out/zero-client/src/client/context.d.ts +15 -0
- package/out/zero-client/src/client/context.d.ts.map +1 -1
- package/out/zero-client/src/client/context.js +44 -0
- package/out/zero-client/src/client/context.js.map +1 -1
- package/out/zero-client/src/client/inspector/lazy-inspector.js +2 -2
- package/out/zero-client/src/client/inspector/lazy-inspector.js.map +1 -1
- package/out/zero-client/src/client/ivm-branch.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-client/src/client/zero-rep.d.ts.map +1 -1
- package/out/zero-client/src/client/zero-rep.js +2 -1
- package/out/zero-client/src/client/zero-rep.js.map +1 -1
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.js +60 -19
- package/out/zero-client/src/client/zero.js.map +1 -1
- package/out/zql/src/ivm/array-view.d.ts.map +1 -1
- package/out/zql/src/ivm/array-view.js +5 -3
- package/out/zql/src/ivm/array-view.js.map +1 -1
- package/out/zql/src/ivm/data.d.ts.map +1 -1
- package/out/zql/src/ivm/data.js +8 -3
- package/out/zql/src/ivm/data.js.map +1 -1
- package/out/zql/src/ivm/deferred-input.d.ts +44 -0
- package/out/zql/src/ivm/deferred-input.d.ts.map +1 -0
- package/out/zql/src/ivm/deferred-input.js +88 -0
- package/out/zql/src/ivm/deferred-input.js.map +1 -0
- package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/ivm/memory-source.js +5 -10
- package/out/zql/src/ivm/memory-source.js.map +1 -1
- package/out/zql/src/ivm/view-apply-change.js +6 -1
- package/out/zql/src/ivm/view-apply-change.js.map +1 -1
- package/out/zql/src/query/query-delegate-base.d.ts +6 -0
- package/out/zql/src/query/query-delegate-base.d.ts.map +1 -1
- package/out/zql/src/query/query-delegate-base.js +73 -10
- package/out/zql/src/query/query-delegate-base.js.map +1 -1
- package/out/zql/src/query/query-delegate.d.ts +22 -0
- package/out/zql/src/query/query-delegate.d.ts.map +1 -1
- package/out/zqlite/src/query-builder.d.ts.map +1 -1
- package/out/zqlite/src/query-builder.js +2 -1
- package/out/zqlite/src/query-builder.js.map +1 -1
- package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +1 -1
- package/out/zqlite/src/sqlite-stat-fanout.js +1 -0
- package/out/zqlite/src/sqlite-stat-fanout.js.map +1 -1
- package/out/zqlite/src/table-source.d.ts +1 -1
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js +2 -1
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +2 -3
package/out/shared/src/hash.js
CHANGED
|
@@ -1,16 +1,111 @@
|
|
|
1
|
-
import { xxHash32 } from "js-xxhash";
|
|
2
1
|
//#region ../shared/src/hash.ts
|
|
3
|
-
var h32 = (s) =>
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var h32 = (s) => {
|
|
3
|
+
digest(s, 1);
|
|
4
|
+
return digests[0];
|
|
5
|
+
};
|
|
6
|
+
var h64 = (s) => wide(s, 2);
|
|
7
|
+
var h128 = (s) => wide(s, 4);
|
|
8
|
+
var PRIME32_1 = 2654435761;
|
|
9
|
+
var PRIME32_2 = 2246822519;
|
|
10
|
+
var PRIME32_3 = 3266489917;
|
|
11
|
+
var PRIME32_4 = 668265263;
|
|
12
|
+
var PRIME32_5 = 374761393;
|
|
13
|
+
var MAX_WORDS = 4;
|
|
14
|
+
var accs = new Int32Array(MAX_WORDS);
|
|
15
|
+
var stripes = new Int32Array(MAX_WORDS * 4);
|
|
16
|
+
var digests = new Uint32Array(MAX_WORDS);
|
|
17
|
+
var encoder;
|
|
18
|
+
function round(acc, lane) {
|
|
19
|
+
const laneN0 = lane & 65535;
|
|
20
|
+
const laneN1 = lane >>> 16;
|
|
21
|
+
acc = acc + (laneN0 * PRIME32_2 + (laneN1 * PRIME32_2 << 16)) & 4294967295;
|
|
22
|
+
acc = acc << 13 | acc >>> 19;
|
|
23
|
+
return (acc & 65535) * PRIME32_1 + ((acc >>> 16) * PRIME32_1 << 16) & 4294967295;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* xxHash32 over the UTF-8 bytes of `str` under seeds `0..words-1`, leaving the
|
|
27
|
+
* digests in `digests[0..words)`.
|
|
28
|
+
*
|
|
29
|
+
* A seed only changes the initial accumulator values, so every word digests the
|
|
30
|
+
* same input lanes. This walks the bytes once, advancing all `words` sets of
|
|
31
|
+
* accumulators per lane, and UTF-8 encodes the string once. The result is
|
|
32
|
+
* identical to `words` separate `xxHash32(str, i)` calls — which is what this
|
|
33
|
+
* used to delegate to, and what `hash.test.ts` checks it still matches.
|
|
34
|
+
*/
|
|
35
|
+
function digest(str, words) {
|
|
36
|
+
const b = (encoder ??= new TextEncoder()).encode(str);
|
|
37
|
+
const len = b.length;
|
|
38
|
+
for (let w = 0; w < words; w++) accs[w] = w + PRIME32_5 & 4294967295;
|
|
39
|
+
let offset = 0;
|
|
40
|
+
if (len >= 16) {
|
|
41
|
+
for (let w = 0; w < words; w++) {
|
|
42
|
+
const base = w << 2;
|
|
43
|
+
stripes[base] = w + PRIME32_1 + PRIME32_2 & 4294967295;
|
|
44
|
+
stripes[base + 1] = w + PRIME32_2 & 4294967295;
|
|
45
|
+
stripes[base + 2] = w;
|
|
46
|
+
stripes[base + 3] = w - PRIME32_1 & 4294967295;
|
|
47
|
+
}
|
|
48
|
+
const limit = len - 16;
|
|
49
|
+
for (; offset <= limit; offset += 16) {
|
|
50
|
+
const l0 = b[offset] | b[offset + 1] << 8 | b[offset + 2] << 16 | b[offset + 3] << 24;
|
|
51
|
+
const l1 = b[offset + 4] | b[offset + 5] << 8 | b[offset + 6] << 16 | b[offset + 7] << 24;
|
|
52
|
+
const l2 = b[offset + 8] | b[offset + 9] << 8 | b[offset + 10] << 16 | b[offset + 11] << 24;
|
|
53
|
+
const l3 = b[offset + 12] | b[offset + 13] << 8 | b[offset + 14] << 16 | b[offset + 15] << 24;
|
|
54
|
+
for (let w = 0; w < words; w++) {
|
|
55
|
+
const base = w << 2;
|
|
56
|
+
stripes[base] = round(stripes[base], l0);
|
|
57
|
+
stripes[base + 1] = round(stripes[base + 1], l1);
|
|
58
|
+
stripes[base + 2] = round(stripes[base + 2], l2);
|
|
59
|
+
stripes[base + 3] = round(stripes[base + 3], l3);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
for (let w = 0; w < words; w++) {
|
|
63
|
+
const base = w << 2;
|
|
64
|
+
const s0 = stripes[base];
|
|
65
|
+
const s1 = stripes[base + 1];
|
|
66
|
+
const s2 = stripes[base + 2];
|
|
67
|
+
const s3 = stripes[base + 3];
|
|
68
|
+
accs[w] = (s0 << 1 | s0 >>> 31) + (s1 << 7 | s1 >>> 25) + (s2 << 12 | s2 >>> 20) + (s3 << 18 | s3 >>> 14) & 4294967295;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (let w = 0; w < words; w++) accs[w] = accs[w] + len & 4294967295;
|
|
72
|
+
const limit4 = len - 4;
|
|
73
|
+
for (; offset <= limit4; offset += 4) {
|
|
74
|
+
const laneN0 = b[offset] + (b[offset + 1] << 8);
|
|
75
|
+
const laneN1 = b[offset + 2] + (b[offset + 3] << 8);
|
|
76
|
+
const laneP = laneN0 * PRIME32_3 + (laneN1 * PRIME32_3 << 16);
|
|
77
|
+
for (let w = 0; w < words; w++) {
|
|
78
|
+
let acc = accs[w] + laneP & 4294967295;
|
|
79
|
+
acc = acc << 17 | acc >>> 15;
|
|
80
|
+
accs[w] = (acc & 65535) * PRIME32_4 + ((acc >>> 16) * PRIME32_4 << 16) & 4294967295;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (; offset < len; ++offset) {
|
|
84
|
+
const lane = b[offset];
|
|
85
|
+
for (let w = 0; w < words; w++) {
|
|
86
|
+
let acc = accs[w] + lane * PRIME32_5;
|
|
87
|
+
acc = acc << 11 | acc >>> 21;
|
|
88
|
+
accs[w] = (acc & 65535) * PRIME32_1 + ((acc >>> 16) * PRIME32_1 << 16) & 4294967295;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (let w = 0; w < words; w++) {
|
|
92
|
+
let acc = accs[w];
|
|
93
|
+
acc = acc ^ acc >>> 15;
|
|
94
|
+
acc = ((acc & 65535) * PRIME32_2 & 4294967295) + ((acc >>> 16) * PRIME32_2 << 16);
|
|
95
|
+
acc = acc ^ acc >>> 13;
|
|
96
|
+
acc = ((acc & 65535) * PRIME32_3 & 4294967295) + ((acc >>> 16) * PRIME32_3 << 16);
|
|
97
|
+
digests[w] = acc ^ acc >>> 16;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
6
100
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
101
|
+
* A hash wider than 32 bits, folding `words` digests together highest seed
|
|
102
|
+
* first.
|
|
9
103
|
*/
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
104
|
+
function wide(str, words) {
|
|
105
|
+
digest(str, words);
|
|
106
|
+
let result = 0n;
|
|
107
|
+
for (let w = 0; w < words; w++) result = (result << 32n) + BigInt(digests[w]);
|
|
108
|
+
return result;
|
|
14
109
|
}
|
|
15
110
|
//#endregion
|
|
16
111
|
export { h128, h32, h64 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.js","names":[],"sources":["../../../../shared/src/hash.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"hash.js","names":[],"sources":["../../../../shared/src/hash.ts"],"sourcesContent":["export const h32 = (s: string) => {\n digest(s, 1);\n return digests[0];\n};\nexport const h64 = (s: string) => wide(s, 2);\nexport const h128 = (s: string) => wide(s, 4);\n\nconst PRIME32_1 = 2654435761;\nconst PRIME32_2 = 2246822519;\nconst PRIME32_3 = 3266489917;\nconst PRIME32_4 = 668265263;\nconst PRIME32_5 = 374761393;\n\nconst MAX_WORDS = 4;\n\n// `digest` is synchronous and does not recurse, so these can be reused across\n// calls instead of allocated per call.\nconst accs = new Int32Array(MAX_WORDS);\nconst stripes = new Int32Array(MAX_WORDS * 4);\nconst digests = new Uint32Array(MAX_WORDS);\nlet encoder: TextEncoder | undefined;\n\nfunction round(acc: number, lane: number): number {\n const laneN0 = lane & 0xffff;\n const laneN1 = lane >>> 16;\n acc =\n (acc + (laneN0 * PRIME32_2 + ((laneN1 * PRIME32_2) << 16))) & 0xffffffff;\n acc = (acc << 13) | (acc >>> 19);\n return (\n ((acc & 0xffff) * PRIME32_1 + (((acc >>> 16) * PRIME32_1) << 16)) &\n 0xffffffff\n );\n}\n\n/**\n * xxHash32 over the UTF-8 bytes of `str` under seeds `0..words-1`, leaving the\n * digests in `digests[0..words)`.\n *\n * A seed only changes the initial accumulator values, so every word digests the\n * same input lanes. This walks the bytes once, advancing all `words` sets of\n * accumulators per lane, and UTF-8 encodes the string once. The result is\n * identical to `words` separate `xxHash32(str, i)` calls — which is what this\n * used to delegate to, and what `hash.test.ts` checks it still matches.\n */\nfunction digest(str: string, words: number): void {\n const b = (encoder ??= new TextEncoder()).encode(str);\n const len = b.length;\n\n for (let w = 0; w < words; w++) {\n accs[w] = (w + PRIME32_5) & 0xffffffff;\n }\n\n let offset = 0;\n\n /*\n Step 2. Process stripes\n A stripe is a contiguous segment of 16 bytes, evenly divided into 4 lanes\n of 4 bytes each, each lane updating its own accumulator. Inputs shorter\n than a stripe skip straight to step 4 with a single accumulator.\n */\n if (len >= 16) {\n for (let w = 0; w < words; w++) {\n const base = w << 2;\n stripes[base] = (w + PRIME32_1 + PRIME32_2) & 0xffffffff;\n stripes[base + 1] = (w + PRIME32_2) & 0xffffffff;\n stripes[base + 2] = w;\n stripes[base + 3] = (w - PRIME32_1) & 0xffffffff;\n }\n\n const limit = len - 16;\n for (; offset <= limit; offset += 16) {\n const l0 =\n b[offset] |\n (b[offset + 1] << 8) |\n (b[offset + 2] << 16) |\n (b[offset + 3] << 24);\n const l1 =\n b[offset + 4] |\n (b[offset + 5] << 8) |\n (b[offset + 6] << 16) |\n (b[offset + 7] << 24);\n const l2 =\n b[offset + 8] |\n (b[offset + 9] << 8) |\n (b[offset + 10] << 16) |\n (b[offset + 11] << 24);\n const l3 =\n b[offset + 12] |\n (b[offset + 13] << 8) |\n (b[offset + 14] << 16) |\n (b[offset + 15] << 24);\n for (let w = 0; w < words; w++) {\n const base = w << 2;\n stripes[base] = round(stripes[base], l0);\n stripes[base + 1] = round(stripes[base + 1], l1);\n stripes[base + 2] = round(stripes[base + 2], l2);\n stripes[base + 3] = round(stripes[base + 3], l3);\n }\n }\n\n /*\n Step 3. Accumulator convergence\n acc = (acc1 <<< 1) + (acc2 <<< 7) + (acc3 <<< 12) + (acc4 <<< 18);\n */\n for (let w = 0; w < words; w++) {\n const base = w << 2;\n const s0 = stripes[base];\n const s1 = stripes[base + 1];\n const s2 = stripes[base + 2];\n const s3 = stripes[base + 3];\n accs[w] =\n (((s0 << 1) | (s0 >>> 31)) +\n ((s1 << 7) | (s1 >>> 25)) +\n ((s2 << 12) | (s2 >>> 20)) +\n ((s3 << 18) | (s3 >>> 14))) &\n 0xffffffff;\n }\n }\n\n // Step 4. Add input length.\n for (let w = 0; w < words; w++) {\n accs[w] = (accs[w] + len) & 0xffffffff;\n }\n\n // Step 5. Consume the remaining input, 4 bytes at a time and then 1 at a time.\n const limit4 = len - 4;\n for (; offset <= limit4; offset += 4) {\n const laneN0 = b[offset] + (b[offset + 1] << 8);\n const laneN1 = b[offset + 2] + (b[offset + 3] << 8);\n const laneP = laneN0 * PRIME32_3 + ((laneN1 * PRIME32_3) << 16);\n for (let w = 0; w < words; w++) {\n let acc = (accs[w] + laneP) & 0xffffffff;\n acc = (acc << 17) | (acc >>> 15);\n accs[w] =\n ((acc & 0xffff) * PRIME32_4 + (((acc >>> 16) * PRIME32_4) << 16)) &\n 0xffffffff;\n }\n }\n\n for (; offset < len; ++offset) {\n const lane = b[offset];\n for (let w = 0; w < words; w++) {\n let acc = accs[w] + lane * PRIME32_5;\n acc = (acc << 11) | (acc >>> 21);\n accs[w] =\n ((acc & 0xffff) * PRIME32_1 + (((acc >>> 16) * PRIME32_1) << 16)) &\n 0xffffffff;\n }\n }\n\n // Step 6. Final mix (avalanche). The Uint32Array store turns any negatives\n // back into a positive number.\n for (let w = 0; w < words; w++) {\n let acc = accs[w];\n acc = acc ^ (acc >>> 15);\n acc =\n (((acc & 0xffff) * PRIME32_2) & 0xffffffff) +\n (((acc >>> 16) * PRIME32_2) << 16);\n acc = acc ^ (acc >>> 13);\n acc =\n (((acc & 0xffff) * PRIME32_3) & 0xffffffff) +\n (((acc >>> 16) * PRIME32_3) << 16);\n digests[w] = acc ^ (acc >>> 16);\n }\n}\n\n/**\n * A hash wider than 32 bits, folding `words` digests together highest seed\n * first.\n */\nfunction wide(str: string, words: number): bigint {\n digest(str, words);\n let result = 0n;\n for (let w = 0; w < words; w++) {\n result = (result << 32n) + BigInt(digests[w]);\n }\n return result;\n}\n"],"mappings":";AAAA,IAAa,OAAO,MAAc;CAChC,OAAO,GAAG,CAAC;CACX,OAAO,QAAQ;AACjB;AACA,IAAa,OAAO,MAAc,KAAK,GAAG,CAAC;AAC3C,IAAa,QAAQ,MAAc,KAAK,GAAG,CAAC;AAE5C,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,YAAY;AAElB,IAAM,YAAY;AAIlB,IAAM,OAAO,IAAI,WAAW,SAAS;AACrC,IAAM,UAAU,IAAI,WAAW,YAAY,CAAC;AAC5C,IAAM,UAAU,IAAI,YAAY,SAAS;AACzC,IAAI;AAEJ,SAAS,MAAM,KAAa,MAAsB;CAChD,MAAM,SAAS,OAAO;CACtB,MAAM,SAAS,SAAS;CACxB,MACG,OAAO,SAAS,aAAc,SAAS,aAAc,OAAQ;CAChE,MAAO,OAAO,KAAO,QAAQ;CAC7B,QACI,MAAM,SAAU,cAAe,QAAQ,MAAM,aAAc,MAC7D;AAEJ;;;;;;;;;;;AAYA,SAAS,OAAO,KAAa,OAAqB;CAChD,MAAM,KAAK,YAAY,IAAI,YAAY,GAAG,OAAO,GAAG;CACpD,MAAM,MAAM,EAAE;CAEd,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KACzB,KAAK,KAAM,IAAI,YAAa;CAG9B,IAAI,SAAS;CAQb,IAAI,OAAO,IAAI;EACb,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;GAC9B,MAAM,OAAO,KAAK;GAClB,QAAQ,QAAS,IAAI,YAAY,YAAa;GAC9C,QAAQ,OAAO,KAAM,IAAI,YAAa;GACtC,QAAQ,OAAO,KAAK;GACpB,QAAQ,OAAO,KAAM,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U,GAAG;EACpC,MAAM,SAAS,EAAE,WAAW,EAAE,SAAS,MAAM;EAC7C,MAAM,SAAS,EAAE,SAAS,MAAM,EAAE,SAAS,MAAM;EACjD,MAAM,QAAQ,SAAS,aAAc,SAAS,aAAc;EAC5D,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;GAC9B,IAAI,MAAO,KAAK,KAAK,QAAS;GAC9B,MAAO,OAAO,KAAO,QAAQ;GAC7B,KAAK,MACD,MAAM,SAAU,cAAe,QAAQ,MAAM,aAAc,MAC7D;EACJ;CACF;CAEA,OAAO,SAAS,KAAK,EAAE,QAAQ;EAC7B,MAAM,OAAO,EAAE;EACf,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;GAC9B,IAAI,MAAM,KAAK,KAAK,OAAO;GAC3B,MAAO,OAAO,KAAO,QAAQ;GAC7B,KAAK,MACD,MAAM,SAAU,cAAe,QAAQ,MAAM,aAAc,MAC7D;EACJ;CACF;CAIA,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KAAK;EAC9B,IAAI,MAAM,KAAK;EACf,MAAM,MAAO,QAAQ;EACrB,QACK,MAAM,SAAU,YAAa,gBAC7B,QAAQ,MAAM,aAAc;EACjC,MAAM,MAAO,QAAQ;EACrB,QACK,MAAM,SAAU,YAAa,gBAC7B,QAAQ,MAAM,aAAc;EACjC,QAAQ,KAAK,MAAO,QAAQ;CAC9B;AACF;;;;;AAMA,SAAS,KAAK,KAAa,OAAuB;CAChD,OAAO,KAAK,KAAK;CACjB,IAAI,SAAS;CACb,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,KACzB,UAAU,UAAU,OAAO,OAAO,QAAQ,EAAE;CAE9C,OAAO;AACT"}
|
package/out/shared/src/map.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A value that {@link Map.get} can distinguish from a missing entry. `undefined`
|
|
3
|
+
* is excluded because these helpers use `get() !== undefined` to detect absence.
|
|
4
|
+
*/
|
|
5
|
+
type Defined = {} | null;
|
|
6
|
+
declare function getOrInsertNative<K, V extends Defined>(map: Map<K, V>, key: K, defaultValue: V): V;
|
|
7
|
+
declare function getOrInsertComputedNative<K, V extends Defined>(map: Map<K, V>, key: K, compute: (key: K) => V): V;
|
|
3
8
|
export declare const getOrInsert: typeof getOrInsertNative;
|
|
4
9
|
export declare const getOrInsertComputed: typeof getOrInsertComputedNative;
|
|
5
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../../shared/src/map.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../../shared/src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,KAAK,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC;AAkDzB,iBAAS,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAC7C,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,GAAG,EAAE,CAAC,EACN,YAAY,EAAE,CAAC,GACd,CAAC,CAEH;AAED,iBAAS,yBAAyB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EACrD,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EACd,GAAG,EAAE,CAAC,EACN,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GACrB,CAAC,CAEH;AAED,eAAO,MAAM,WAAW,0BAED,CAAC;AAExB,eAAO,MAAM,mBAAmB,kCAED,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","names":[],"sources":["../../../../shared/src/map.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"map.js","names":[],"sources":["../../../../shared/src/map.ts"],"sourcesContent":["/**\n * A value that {@link Map.get} can distinguish from a missing entry. `undefined`\n * is excluded because these helpers use `get() !== undefined` to detect absence.\n */\ntype Defined = {} | null;\n\nconst nativeSupport =\n typeof (Map.prototype as unknown as MapES2026<unknown, Defined>)\n .getOrInsert === 'function';\n\ninterface MapES2026<K, V> {\n getOrInsert(key: K, defaultValue: V): V;\n getOrInsertComputed(key: K, compute: (key: K) => V): V;\n}\n\n/**\n * Returns the value for {@link key} in {@link map}. If no mapping exists,\n * inserts {@link defaultValue} and returns it.\n *\n * Mirrors the ES2026 `Map.prototype.getOrInsert` proposal.\n */\nfunction getOrInsertPolyfill<K, V extends Defined>(\n map: Map<K, V>,\n key: K,\n defaultValue: V,\n): V {\n const existing = map.get(key);\n if (existing !== undefined) {\n return existing;\n }\n map.set(key, defaultValue);\n return defaultValue;\n}\n\n/**\n * Returns the value for {@link key} in {@link map}. If no mapping exists,\n * calls {@link compute} with the key, inserts the result, and returns it.\n *\n * Mirrors the ES2026 `Map.prototype.getOrInsertComputed` proposal.\n */\nfunction getOrInsertComputedPolyfill<K, V extends Defined>(\n map: Map<K, V>,\n key: K,\n compute: (key: K) => V,\n): V {\n const existing = map.get(key);\n if (existing !== undefined) {\n return existing;\n }\n const value = compute(key);\n map.set(key, value);\n return value;\n}\n\nfunction getOrInsertNative<K, V extends Defined>(\n map: Map<K, V>,\n key: K,\n defaultValue: V,\n): V {\n return (map as unknown as MapES2026<K, V>).getOrInsert(key, defaultValue);\n}\n\nfunction getOrInsertComputedNative<K, V extends Defined>(\n map: Map<K, V>,\n key: K,\n compute: (key: K) => V,\n): V {\n return (map as unknown as MapES2026<K, V>).getOrInsertComputed(key, compute);\n}\n\nexport const getOrInsert = nativeSupport\n ? getOrInsertNative\n : getOrInsertPolyfill;\n\nexport const getOrInsertComputed = nativeSupport\n ? getOrInsertComputedNative\n : getOrInsertComputedPolyfill;\n"],"mappings":";AAMA,IAAM,gBACJ,OAAQ,IAAI,UACT,gBAAgB;;;;;;;AAarB,SAAS,oBACP,KACA,KACA,cACG;CACH,MAAM,WAAW,IAAI,IAAI,GAAG;CAC5B,IAAI,aAAa,KAAA,GACf,OAAO;CAET,IAAI,IAAI,KAAK,YAAY;CACzB,OAAO;AACT;;;;;;;AAQA,SAAS,4BACP,KACA,KACA,SACG;CACH,MAAM,WAAW,IAAI,IAAI,GAAG;CAC5B,IAAI,aAAa,KAAA,GACf,OAAO;CAET,MAAM,QAAQ,QAAQ,GAAG;CACzB,IAAI,IAAI,KAAK,KAAK;CAClB,OAAO;AACT;AAEA,SAAS,kBACP,KACA,KACA,cACG;CACH,OAAQ,IAAmC,YAAY,KAAK,YAAY;AAC1E;AAEA,SAAS,0BACP,KACA,KACA,SACG;CACH,OAAQ,IAAmC,oBAAoB,KAAK,OAAO;AAC7E;AAEA,IAAa,cAAc,gBACvB,oBACA;AAEJ,IAAa,sBAAsB,gBAC/B,4BACA"}
|
package/out/zero/package.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var package_default = {
|
|
2
2
|
name: "@rocicorp/zero",
|
|
3
|
-
version: "1.10.0-canary.
|
|
3
|
+
version: "1.10.0-canary.20",
|
|
4
4
|
description: "Zero is a web framework for serverless web development.",
|
|
5
5
|
homepage: "https://zero.rocicorp.dev",
|
|
6
6
|
bugs: { "url": "https://bugs.rocicorp.dev" },
|
|
@@ -146,13 +146,12 @@ var package_default = {
|
|
|
146
146
|
"cloudevents": "^10.0.0",
|
|
147
147
|
"command-line-args": "^6.0.1",
|
|
148
148
|
"command-line-usage": "^7.0.3",
|
|
149
|
-
"compare-utf8": "^0.2.
|
|
149
|
+
"compare-utf8": "^0.2.3",
|
|
150
150
|
"defu": "^6.1.4",
|
|
151
151
|
"eventemitter3": "^5.0.1",
|
|
152
152
|
"fastify": "^5.0.0",
|
|
153
153
|
"is-in-subnet": "^4.0.1",
|
|
154
154
|
"jose": "^5.9.3",
|
|
155
|
-
"js-xxhash": "^4.0.0",
|
|
156
155
|
"json-custom-numbers": "^3.1.1",
|
|
157
156
|
"kasi": "^1.1.0",
|
|
158
157
|
"nanoid": "^5.1.2",
|
package/out/zero/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","names":[],"sources":["../../package.json"],"sourcesContent":["{\n \"name\": \"@rocicorp/zero\",\n \"version\": \"1.10.0-canary.
|
|
1
|
+
{"version":3,"file":"package.js","names":[],"sources":["../../package.json"],"sourcesContent":["{\n \"name\": \"@rocicorp/zero\",\n \"version\": \"1.10.0-canary.20\",\n \"description\": \"Zero is a web framework for serverless web development.\",\n \"homepage\": \"https://zero.rocicorp.dev\",\n \"bugs\": {\n \"url\": \"https://bugs.rocicorp.dev\"\n },\n \"license\": \"Apache-2.0\",\n \"author\": \"Rocicorp, Inc.\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/rocicorp/mono.git\",\n \"directory\": \"packages/zero\"\n },\n \"bin\": {\n \"analyze-query\": \"./out/zero/src/analyze-query.js\",\n \"ast-to-zql\": \"./out/zero/src/ast-to-zql.js\",\n \"transform-query\": \"./out/zero/src/transform-query.js\",\n \"zero-build-schema\": \"./out/zero/src/build-schema.js\",\n \"zero-cache\": \"./out/zero/src/cli.js\",\n \"zero-cache-dev\": \"./out/zero/src/zero-cache-dev.js\",\n \"zero-deploy-permissions\": \"./out/zero/src/deploy-permissions.js\",\n \"zero-out\": \"./out/zero/src/zero-out.js\"\n },\n \"files\": [\n \"out\",\n \"!*.tsbuildinfo\"\n ],\n \"type\": \"module\",\n \"main\": \"out/zero/src/zero.js\",\n \"module\": \"out/zero/src/zero.js\",\n \"types\": \"out/zero/src/zero.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./out/zero/src/zero.d.ts\",\n \"default\": \"./out/zero/src/zero.js\"\n },\n \"./analyze\": {\n \"types\": \"./out/zero/src/analyze.d.ts\",\n \"default\": \"./out/zero/src/analyze.js\"\n },\n \"./bindings\": {\n \"types\": \"./out/zero/src/bindings.d.ts\",\n \"default\": \"./out/zero/src/bindings.js\"\n },\n \"./change-protocol/v0\": {\n \"types\": \"./out/zero/src/change-protocol/v0.d.ts\",\n \"default\": \"./out/zero/src/change-protocol/v0.js\"\n },\n \"./expo-sqlite\": {\n \"types\": \"./out/zero/src/expo-sqlite.d.ts\",\n \"default\": \"./out/zero/src/expo-sqlite.js\"\n },\n \"./op-sqlite\": {\n \"types\": \"./out/zero/src/op-sqlite.d.ts\",\n \"default\": \"./out/zero/src/op-sqlite.js\"\n },\n \"./pg\": {\n \"types\": \"./out/zero/src/pg.d.ts\",\n \"default\": \"./out/zero/src/pg.js\"\n },\n \"./react\": {\n \"types\": \"./out/zero/src/react.d.ts\",\n \"default\": \"./out/zero/src/react.js\"\n },\n \"./react-native\": {\n \"types\": \"./out/zero/src/react-native.d.ts\",\n \"default\": \"./out/zero/src/react-native.js\"\n },\n \"./server\": {\n \"types\": \"./out/zero/src/server.d.ts\",\n \"default\": \"./out/zero/src/server.js\"\n },\n \"./server/adapters/drizzle\": {\n \"types\": \"./out/zero/src/adapters/drizzle.d.ts\",\n \"default\": \"./out/zero/src/adapters/drizzle.js\"\n },\n \"./server/adapters/kysely\": {\n \"types\": \"./out/zero/src/adapters/kysely.d.ts\",\n \"default\": \"./out/zero/src/adapters/kysely.js\"\n },\n \"./server/adapters/prisma\": {\n \"types\": \"./out/zero/src/adapters/prisma.d.ts\",\n \"default\": \"./out/zero/src/adapters/prisma.js\"\n },\n \"./server/adapters/pg\": {\n \"types\": \"./out/zero/src/adapters/pg.d.ts\",\n \"default\": \"./out/zero/src/adapters/pg.js\"\n },\n \"./server/adapters/postgresjs\": {\n \"types\": \"./out/zero/src/adapters/postgresjs.d.ts\",\n \"default\": \"./out/zero/src/adapters/postgresjs.js\"\n },\n \"./solid\": {\n \"types\": \"./out/zero/src/solid.d.ts\",\n \"default\": \"./out/zero/src/solid.js\"\n },\n \"./sqlite\": {\n \"types\": \"./out/zero/src/sqlite.d.ts\",\n \"default\": \"./out/zero/src/sqlite.js\"\n },\n \"./zqlite\": {\n \"types\": \"./out/zero/src/zqlite.d.ts\",\n \"default\": \"./out/zero/src/zqlite.js\"\n }\n },\n \"scripts\": {\n \"build\": \"node --experimental-strip-types --no-warnings tool/build.ts\",\n \"build:watch\": \"node --experimental-strip-types --no-warnings tool/build.ts --watch\",\n \"check-types\": \"tsc -p tsconfig.client.json && tsc -p tsconfig.server.json\",\n \"check-types:client:watch\": \"tsc -p tsconfig.client.json --watch\",\n \"check-types:server:watch\": \"tsc -p tsconfig.server.json --watch\",\n \"format\": \"oxfmt .\",\n \"check-format\": \"oxfmt --check .\",\n \"lint\": \"oxlint --quiet --config ../../oxlint.config.ts src/\",\n \"docs\": \"node --experimental-strip-types --no-warnings tool/generate-docs.ts\",\n \"docs:server\": \"node --watch --experimental-strip-types --no-warnings tool/generate-docs.ts --server\",\n \"fmt\": \"oxfmt .\",\n \"check-fmt\": \"oxfmt --check .\"\n },\n \"dependencies\": {\n \"@badrap/valita\": \"0.3.11\",\n \"@databases/escape-identifier\": \"^1.0.3\",\n \"@databases/sql\": \"^3.3.0\",\n \"@dotenvx/dotenvx\": \"^1.39.0\",\n \"@drdgvhbh/postgres-error-codes\": \"^0.0.6\",\n \"@fastify/cors\": \"^10.0.0\",\n \"@fastify/websocket\": \"^11.0.0\",\n \"@google-cloud/precise-date\": \"^4.0.0\",\n \"@opentelemetry/api\": \"^1.9.0\",\n \"@opentelemetry/api-logs\": \"^0.218.0\",\n \"@opentelemetry/auto-instrumentations-node\": \"^0.76.0\",\n \"@opentelemetry/exporter-metrics-otlp-http\": \"^0.218.0\",\n \"@opentelemetry/resources\": \"^2.7.1\",\n \"@opentelemetry/sdk-metrics\": \"^2.7.1\",\n \"@opentelemetry/sdk-node\": \"^0.218.0\",\n \"@opentelemetry/sdk-trace-node\": \"^2.7.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.41.1\",\n \"@postgresql-typed/oids\": \"^0.2.0\",\n \"@rocicorp/lock\": \"^1.0.4\",\n \"@rocicorp/logger\": \"^6.1.0\",\n \"@rocicorp/resolver\": \"^1.0.2\",\n \"@rocicorp/zero-sqlite3\": \"^1.1.4\",\n \"@standard-schema/spec\": \"^1.0.0\",\n \"@types/basic-auth\": \"^1.1.8\",\n \"@types/ws\": \"^8.5.12\",\n \"basic-auth\": \"^2.0.1\",\n \"chalk-template\": \"^1.1.0\",\n \"chokidar\": \"^4.0.1\",\n \"cloudevents\": \"^10.0.0\",\n \"command-line-args\": \"^6.0.1\",\n \"command-line-usage\": \"^7.0.3\",\n \"compare-utf8\": \"^0.2.3\",\n \"defu\": \"^6.1.4\",\n \"eventemitter3\": \"^5.0.1\",\n \"fastify\": \"^5.0.0\",\n \"is-in-subnet\": \"^4.0.1\",\n \"jose\": \"^5.9.3\",\n \"json-custom-numbers\": \"^3.1.1\",\n \"kasi\": \"^1.1.0\",\n \"nanoid\": \"^5.1.2\",\n \"oxfmt\": \"^0.45.0\",\n \"parse-prometheus-text-format\": \"^1.1.1\",\n \"pg-format\": \"npm:pg-format-fix@^1.0.5\",\n \"postgres\": \"3.4.7\",\n \"semver\": \"^7.5.4\",\n \"url-pattern\": \"^1.0.3\",\n \"urlpattern-polyfill\": \"^10.1.0\",\n \"ws\": \"^8.18.1\"\n },\n \"devDependencies\": {\n \"@op-engineering/op-sqlite\": \">=15\",\n \"@vitest/runner\": \"^4.1.6\",\n \"analyze-query\": \"workspace:*\",\n \"ast-to-zql\": \"workspace:*\",\n \"expo-sqlite\": \">=15\",\n \"oxc-parser\": \"^0.129.0\",\n \"replicache\": \"workspace:*\",\n \"shared\": \"workspace:*\",\n \"syncpack\": \"^14.3.0\",\n \"typedoc\": \"^0.28.17\",\n \"typedoc-plugin-markdown\": \"^4.10.0\",\n \"typescript\": \"~6.0.2\",\n \"vite\": \"^8.0.13\",\n \"vitest\": \"^4.1.6\",\n \"zero-cache\": \"workspace:*\",\n \"zero-client\": \"workspace:*\",\n \"zero-pg\": \"workspace:*\",\n \"zero-react\": \"workspace:*\",\n \"zero-server\": \"workspace:*\",\n \"zero-solid\": \"workspace:*\",\n \"zqlite\": \"workspace:*\"\n },\n \"engines\": {\n \"node\": \">=22\"\n },\n \"packageManager\": \"pnpm@11.11.0\"\n}\n"],"mappings":""}
|
|
@@ -111,6 +111,10 @@ export declare const zeroOptions: {
|
|
|
111
111
|
type: v.Optional<boolean>;
|
|
112
112
|
desc: string[];
|
|
113
113
|
};
|
|
114
|
+
pgPartialIndexTriggers: {
|
|
115
|
+
type: v.Type<boolean>;
|
|
116
|
+
hidden: boolean;
|
|
117
|
+
};
|
|
114
118
|
pgStreamInboundTimeoutMs: {
|
|
115
119
|
type: v.Optional<number>;
|
|
116
120
|
desc: string[];
|
|
@@ -589,21 +593,34 @@ export declare const zeroOptions: {
|
|
|
589
593
|
};
|
|
590
594
|
minCheckpointPageCount: {
|
|
591
595
|
type: v.Optional<number>;
|
|
592
|
-
|
|
596
|
+
deprecated: string[];
|
|
597
|
+
hidden: boolean;
|
|
593
598
|
};
|
|
594
599
|
maxCheckpointPageCount: {
|
|
595
600
|
type: v.Optional<number>;
|
|
596
601
|
desc: string[];
|
|
597
602
|
};
|
|
603
|
+
forceCheckpointThresholdMB: {
|
|
604
|
+
type: v.Type<number>;
|
|
605
|
+
desc: string[];
|
|
606
|
+
};
|
|
607
|
+
maxWalSizeMB: {
|
|
608
|
+
type: v.Type<number>;
|
|
609
|
+
desc: string[];
|
|
610
|
+
};
|
|
598
611
|
incrementalBackupIntervalMinutes: {
|
|
599
612
|
type: v.Type<number>;
|
|
600
613
|
desc: string[];
|
|
601
614
|
};
|
|
615
|
+
snapshotBackupIntervalHours: {
|
|
616
|
+
type: v.Type<number>;
|
|
617
|
+
desc: string[];
|
|
618
|
+
};
|
|
602
619
|
incrementalBackupIntervalSeconds: {
|
|
603
620
|
type: v.Type<number>;
|
|
604
621
|
desc: string[];
|
|
605
622
|
};
|
|
606
|
-
|
|
623
|
+
snapshotBackupIntervalHoursV5: {
|
|
607
624
|
type: v.Type<number>;
|
|
608
625
|
desc: string[];
|
|
609
626
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zero-config.d.ts","sourceRoot":"","sources":["../../../../../zero-cache/src/config/zero-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,YAAY,EAClB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,CAAC,MAAM,+BAA+B,CAAC;AAUnD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAC,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAEhE,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C,eAAO,MAAM,UAAU;;;;;;;;;CA+CtB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;CAwBxB,CAAC;AAEF,QAAA,MAAM,cAAc;;;;;;;;;CAmBnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,cAAc,CAAC,CAAC;AAE3D,QAAA,MAAM,oBAAoB;;;;;;;;;CAczB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE5D,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DhB,CAAC;AA0HF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AAEpD,+DAA+D;AAC/D,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACpC,UAAU,EACV,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CACrD,CAAC;AAKF,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"zero-config.d.ts","sourceRoot":"","sources":["../../../../../zero-cache/src/config/zero-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAEj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|
|
278
|
+
type: valita_exports.boolean().default(false),
|
|
279
|
+
hidden: true
|
|
280
|
+
},
|
|
277
281
|
pgStreamInboundTimeoutMs: {
|
|
278
282
|
type: valita_exports.number().optional(),
|
|
279
283
|
desc: [
|
|
@@ -615,7 +619,7 @@ var zeroOptions = {
|
|
|
615
619
|
]
|
|
616
620
|
},
|
|
617
621
|
flowControlConsensusTimeoutProportion: {
|
|
618
|
-
type: valita_exports.number().default(
|
|
622
|
+
type: valita_exports.number().default(4),
|
|
619
623
|
desc: [
|
|
620
624
|
`During periodic flow control checks (every 64kb), the amount of time to wait after the majority`,
|
|
621
625
|
`of subscribers have acked, proportional to that interval, after which replication will continue`,
|
|
@@ -629,7 +633,7 @@ var zeroOptions = {
|
|
|
629
633
|
``,
|
|
630
634
|
`For example, if the majority of subscribers ack a message in 2.5ms, a padding proportion of`,
|
|
631
635
|
`1.0 instructs replication to continue after an additional 2.5ms; for a proportion of 2.0, an`,
|
|
632
|
-
`additional 5.0ms, etc. The default value of
|
|
636
|
+
`additional 5.0ms, etc. The default value of 4.0 allows for a subscriber to be 5x slower than the`,
|
|
633
637
|
`majority in the steady state, while similarly bounding the extent to which a temporarily lagging`,
|
|
634
638
|
`subscriber (e.g. due to catchup) slows down the fleet.`,
|
|
635
639
|
``,
|
|
@@ -872,26 +876,18 @@ var zeroOptions = {
|
|
|
872
876
|
checkpointThresholdMB: {
|
|
873
877
|
type: valita_exports.number().default(40),
|
|
874
878
|
desc: [
|
|
875
|
-
`The size of the WAL file at which
|
|
876
|
-
`the writes in the WAL to the main database file.
|
|
877
|
-
`
|
|
878
|
-
`may improve read performance, at the expense of creating more files to download`,
|
|
879
|
-
`when restoring the replica from the backup.`,
|
|
879
|
+
`The size of the WAL file at which litestream performs background, best-effort (PASSIVE)`,
|
|
880
|
+
`SQLite checkpoints to apply the writes in the WAL to the main database file. Checkpoints`,
|
|
881
|
+
`result in new WAL (v3) or LTS (v5) files that are then backed up asynchronously.`,
|
|
880
882
|
``,
|
|
881
|
-
`
|
|
882
|
-
`
|
|
883
|
+
`Note that these PASSIVE checkpoints are skipped if a write is in progress, so high writes rates`,
|
|
884
|
+
`can precipitate runaway wal growth. Also see {bold ZERO_LITESTREAM_FORCE_CHECKPOINT_THRESHOLD_MB}`
|
|
883
885
|
]
|
|
884
886
|
},
|
|
885
887
|
minCheckpointPageCount: {
|
|
886
888
|
type: valita_exports.number().optional(),
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
`transfers pages to the main database file without blocking writers.`,
|
|
890
|
-
`Defaults to {bold checkpointThresholdMB * 250} (since SQLite page size is 4KB).`,
|
|
891
|
-
``,
|
|
892
|
-
`This setting is only relevant when replicating with litestream v3, and is ignored`,
|
|
893
|
-
`when replicating with litestream v5.`
|
|
894
|
-
]
|
|
889
|
+
deprecated: [`Use {bold ZERO_CHECKPOINT_THRESHOLD_MB}`],
|
|
890
|
+
hidden: true
|
|
895
891
|
},
|
|
896
892
|
maxCheckpointPageCount: {
|
|
897
893
|
type: valita_exports.number().optional(),
|
|
@@ -904,6 +900,45 @@ var zeroOptions = {
|
|
|
904
900
|
`when replicating with litestream v5.`
|
|
905
901
|
]
|
|
906
902
|
},
|
|
903
|
+
forceCheckpointThresholdMB: {
|
|
904
|
+
type: valita_exports.number().default(256),
|
|
905
|
+
desc: [
|
|
906
|
+
`The size of the WAL file at which to pause writes and explicitly initiate a`,
|
|
907
|
+
`local litestream sync. This is a safeguard for the situation in which litestream's`,
|
|
908
|
+
`background checkpoints continually defer to incoming writes (i.e. high write load).`,
|
|
909
|
+
``,
|
|
910
|
+
`If the WAL size reaches the forced checkpoint threshold, writes pause for an`,
|
|
911
|
+
`an explicit litestream checkpoint, providing a flow-control mechanism to ensure timely`,
|
|
912
|
+
`backups and prevent runaway wal growth.`,
|
|
913
|
+
``,
|
|
914
|
+
`Note that these checkpoints {italic can} be skipped if litestream is performing a`,
|
|
915
|
+
`snapshot at the time (though snapshots are disabled by default). For such configurations,`,
|
|
916
|
+
`the {bold ZERO_LITESTREAM_MAX_WAL_SIZE_MB} provides an emergency break to prevent`,
|
|
917
|
+
`exceeding available disk space.`,
|
|
918
|
+
``,
|
|
919
|
+
`Set this to 0 to disable and instead rely on the litestream's default {bold truncate-page-n}`,
|
|
920
|
+
`emergency break.`,
|
|
921
|
+
``,
|
|
922
|
+
`This feature is only enabled with {bold ZERO_LITESTREAM_BACKUP_USING_V5}.`
|
|
923
|
+
]
|
|
924
|
+
},
|
|
925
|
+
maxWalSizeMB: {
|
|
926
|
+
type: valita_exports.number().default(10240),
|
|
927
|
+
desc: [
|
|
928
|
+
`A fail-safe that pauses writes once the un-checkpointed WAL reaches this size,`,
|
|
929
|
+
`resuming when litestream manages to checkpoint it. This bounds WAL growth (and`,
|
|
930
|
+
`ultimately disk usage) whenever litestream cannot checkpoint — e.g. while it holds`,
|
|
931
|
+
`the checkpoint lock for an in-progress snapshot — and serves as an alternative to`,
|
|
932
|
+
`litestream's {bold truncate-page-n} emergency checkpoint, which would otherwise block`,
|
|
933
|
+
`writes for a second "bounary" snapshot.`,
|
|
934
|
+
``,
|
|
935
|
+
`Size this generously relative to available disk; it should rarely be hit, as`,
|
|
936
|
+
`{bold ZERO_LITESTREAM_FORCE_CHECKPOINT_THRESHOLD_MB} keeps the WAL far smaller in`,
|
|
937
|
+
`normal operation. Set to {bold 0} to disable.`,
|
|
938
|
+
``,
|
|
939
|
+
`This feature is only enabled with {bold ZERO_LITESTREAM_BACKUP_USING_V5}.`
|
|
940
|
+
]
|
|
941
|
+
},
|
|
907
942
|
incrementalBackupIntervalMinutes: {
|
|
908
943
|
type: valita_exports.number().default(15),
|
|
909
944
|
desc: [
|
|
@@ -917,6 +952,20 @@ var zeroOptions = {
|
|
|
917
952
|
`frequency, use {bold ZERO_LITESTREAM_INCREMENTAL_BACKUP_INTERVAL_SECONDS}.`
|
|
918
953
|
]
|
|
919
954
|
},
|
|
955
|
+
snapshotBackupIntervalHours: {
|
|
956
|
+
type: valita_exports.number().default(12),
|
|
957
|
+
desc: [
|
|
958
|
+
`The interval between snapshot backups of the replica. Snapshot backups`,
|
|
959
|
+
`make a full copy of the database to a new litestream generation. This`,
|
|
960
|
+
`improves restore time at the expense of bandwidth. Applications with a`,
|
|
961
|
+
`large database and low write rate can increase this interval to reduce`,
|
|
962
|
+
`network usage for backups (litestream defaults to 24 hours).`,
|
|
963
|
+
``,
|
|
964
|
+
`This option only applies to litestream v3 backups and will be deprecated/removed`,
|
|
965
|
+
`once the zero-cache is transitioned to litestream v5. For configuring v5 backup`,
|
|
966
|
+
`frequency, use {bold ZERO_LITESTREAM_SNAPSHOT_BACKUP_INTERVAL_HOURS_V5}.`
|
|
967
|
+
]
|
|
968
|
+
},
|
|
920
969
|
incrementalBackupIntervalSeconds: {
|
|
921
970
|
type: valita_exports.number().default(15),
|
|
922
971
|
desc: [
|
|
@@ -932,18 +981,28 @@ var zeroOptions = {
|
|
|
932
981
|
`{bold ZERO_LITESTREAM_INCREMENTAL_BACKUP_INTERVAL_MINUTES}.`
|
|
933
982
|
]
|
|
934
983
|
},
|
|
935
|
-
|
|
936
|
-
type: valita_exports.number().default(
|
|
984
|
+
snapshotBackupIntervalHoursV5: {
|
|
985
|
+
type: valita_exports.number().default(720),
|
|
937
986
|
desc: [
|
|
938
|
-
`The interval between snapshot backups of the replica
|
|
939
|
-
`
|
|
940
|
-
|
|
941
|
-
`
|
|
942
|
-
`
|
|
987
|
+
`The interval between snapshot backups of the replica when`,
|
|
988
|
+
`{bold ZERO_LITESTREAM_BACKUP_USING_V5} is enabled.`,
|
|
989
|
+
``,
|
|
990
|
+
`By default, snapshots are effectively disabled (i.e. every 30 days)`,
|
|
991
|
+
`because v5 compaction fulfills the role that snapshots played in v3`,
|
|
992
|
+
`(i.e. because of litestream v5 compaction, restores will generally involve`,
|
|
993
|
+
`O(db-size) bytes.`,
|
|
994
|
+
``,
|
|
995
|
+
`Snapshots are disabled by default because they hold a read-lock on`,
|
|
996
|
+
`the database and prevent wal checkpoints, introducing the risk of large wal`,
|
|
997
|
+
`files for large databases with a high write rate.`,
|
|
943
998
|
``,
|
|
944
|
-
`
|
|
945
|
-
`
|
|
946
|
-
`
|
|
999
|
+
`If configuring the zero-cache to actually perform v5 snapshots, the`,
|
|
1000
|
+
`{bold ZERO_LITESTREAM_MAX_WAL_SIZE_MB} option can be used to pause replication`,
|
|
1001
|
+
`if the wal reaches a certain size and cannot be checkpointed because of an`,
|
|
1002
|
+
`in-progress snapshot.`,
|
|
1003
|
+
``,
|
|
1004
|
+
`This option only applies to litestream v5 backups. For v3 backups, use`,
|
|
1005
|
+
`{bold ZERO_LITESTREAM_SNAPSHOT_BACKUP_INTERVAL_HOURS}.`
|
|
947
1006
|
]
|
|
948
1007
|
},
|
|
949
1008
|
restoreParallelism: {
|