@gonvex/client 0.1.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/LICENSE +201 -0
- package/dist/browser-cache-client.d.ts +77 -0
- package/dist/browser-cache-client.js +156 -0
- package/dist/browser-cache-client.js.map +1 -0
- package/dist/browser-cache-shared-worker.d.ts +35 -0
- package/dist/browser-cache-shared-worker.js +118 -0
- package/dist/browser-cache-shared-worker.js.map +1 -0
- package/dist/browser-cache.d.ts +43 -0
- package/dist/browser-cache.js +67 -0
- package/dist/browser-cache.js.map +1 -0
- package/dist/browser-capabilities.d.ts +21 -0
- package/dist/browser-capabilities.js +31 -0
- package/dist/browser-capabilities.js.map +1 -0
- package/dist/cache-coordinator.d.ts +37 -0
- package/dist/cache-coordinator.js +109 -0
- package/dist/cache-coordinator.js.map +1 -0
- package/dist/cache.d.ts +74 -0
- package/dist/cache.js +120 -0
- package/dist/cache.js.map +1 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +422 -0
- package/dist/index.js.map +1 -0
- package/dist/persistent-cache.d.ts +41 -0
- package/dist/persistent-cache.js +103 -0
- package/dist/persistent-cache.js.map +1 -0
- package/package.json +32 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
export * from "./cache.js";
|
|
2
|
+
export * from "./cache-coordinator.js";
|
|
3
|
+
export * from "./browser-cache.js";
|
|
4
|
+
export * from "./browser-cache-client.js";
|
|
5
|
+
export * from "./browser-cache-shared-worker.js";
|
|
6
|
+
export * from "./browser-capabilities.js";
|
|
7
|
+
export * from "./persistent-cache.js";
|
|
8
|
+
export class GonvexClient {
|
|
9
|
+
url;
|
|
10
|
+
socket;
|
|
11
|
+
handlers = new Map();
|
|
12
|
+
querySubscriptions = new Map();
|
|
13
|
+
telemetryHandlers = new Set();
|
|
14
|
+
pendingMessages = [];
|
|
15
|
+
auth = {};
|
|
16
|
+
authInFlight = false;
|
|
17
|
+
telemetryEnabled = false;
|
|
18
|
+
constructor(url, auth = {}) {
|
|
19
|
+
this.url = url;
|
|
20
|
+
this.auth = auth;
|
|
21
|
+
this.telemetryEnabled = auth.telemetry === true;
|
|
22
|
+
}
|
|
23
|
+
setAuth(auth) {
|
|
24
|
+
this.auth = { ...this.auth, ...auth };
|
|
25
|
+
if (auth.telemetry !== undefined) {
|
|
26
|
+
this.telemetryEnabled = auth.telemetry === true;
|
|
27
|
+
}
|
|
28
|
+
if (this.socket?.readyState === WebSocket.OPEN) {
|
|
29
|
+
this.sendAuth();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
connect() {
|
|
33
|
+
if (this.socket && this.socket.readyState <= WebSocket.OPEN)
|
|
34
|
+
return;
|
|
35
|
+
this.socket = new WebSocket(this.url);
|
|
36
|
+
this.socket.addEventListener("open", () => this.sendAuth());
|
|
37
|
+
this.socket.addEventListener("message", (event) => {
|
|
38
|
+
let message;
|
|
39
|
+
try {
|
|
40
|
+
message = JSON.parse(String(event.data));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (message.type === "auth.result" || message.type === "auth.error") {
|
|
46
|
+
this.authInFlight = false;
|
|
47
|
+
this.flushPendingMessages();
|
|
48
|
+
}
|
|
49
|
+
const id = "id" in message ? message.id : "system";
|
|
50
|
+
this.handlers.get(id)?.(message);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
close() {
|
|
54
|
+
this.handlers.clear();
|
|
55
|
+
this.querySubscriptions.clear();
|
|
56
|
+
if (!this.socket)
|
|
57
|
+
return;
|
|
58
|
+
this.socket.close();
|
|
59
|
+
this.socket = undefined;
|
|
60
|
+
}
|
|
61
|
+
onTelemetry(handler) {
|
|
62
|
+
this.telemetryHandlers.add(handler);
|
|
63
|
+
return () => this.telemetryHandlers.delete(handler);
|
|
64
|
+
}
|
|
65
|
+
subscribeQuery(ref, args = {}, onMessage) {
|
|
66
|
+
this.connect();
|
|
67
|
+
const key = querySubscriptionKey(ref, args);
|
|
68
|
+
const existing = this.querySubscriptions.get(key);
|
|
69
|
+
if (existing) {
|
|
70
|
+
if (existing.unsubscribeTimer) {
|
|
71
|
+
clearTimeout(existing.unsubscribeTimer);
|
|
72
|
+
existing.unsubscribeTimer = undefined;
|
|
73
|
+
}
|
|
74
|
+
existing.listeners.add(onMessage);
|
|
75
|
+
// Replay the latest result/error to this late joiner. Coalesced subscriptions
|
|
76
|
+
// share a single server subscription, so the server only sends `initial` once —
|
|
77
|
+
// to the first subscriber. Without this replay, components that mount after the
|
|
78
|
+
// initial result arrives (e.g. a dialog opened later) would never receive data
|
|
79
|
+
// until the next server-side invalidation. Replaying here (not via the shared
|
|
80
|
+
// handler) keeps the cached value flowing without emitting extra telemetry/traffic.
|
|
81
|
+
const cached = existing.lastMessage;
|
|
82
|
+
if (cached) {
|
|
83
|
+
queueMicrotask(() => {
|
|
84
|
+
if (existing.listeners.has(onMessage))
|
|
85
|
+
onMessage(cached);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return () => this.unsubscribeQueryListener(key, onMessage);
|
|
89
|
+
}
|
|
90
|
+
const subscription = {
|
|
91
|
+
id: randomID(),
|
|
92
|
+
key,
|
|
93
|
+
path: ref.path,
|
|
94
|
+
args,
|
|
95
|
+
listeners: new Set([onMessage]),
|
|
96
|
+
};
|
|
97
|
+
this.querySubscriptions.set(key, subscription);
|
|
98
|
+
this.handlers.set(subscription.id, (message) => {
|
|
99
|
+
if (message.type === "query.result") {
|
|
100
|
+
subscription.lastMessage = message;
|
|
101
|
+
this.recordTelemetry({
|
|
102
|
+
type: "query",
|
|
103
|
+
id: message.id,
|
|
104
|
+
path: subscription.path,
|
|
105
|
+
reason: message.reason,
|
|
106
|
+
outcome: "ok",
|
|
107
|
+
clientReceivedAtMs: nowMs(),
|
|
108
|
+
serverTrace: message.trace,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (message.type === "query.error") {
|
|
112
|
+
subscription.lastMessage = message;
|
|
113
|
+
this.recordTelemetry({
|
|
114
|
+
type: "query",
|
|
115
|
+
id: message.id,
|
|
116
|
+
path: subscription.path,
|
|
117
|
+
outcome: "error",
|
|
118
|
+
error: message.error,
|
|
119
|
+
clientReceivedAtMs: nowMs(),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
for (const listener of Array.from(subscription.listeners)) {
|
|
123
|
+
listener(message);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
this.send({ type: "query.subscribe", id: subscription.id, path: ref.path, args });
|
|
127
|
+
return () => this.unsubscribeQueryListener(key, onMessage);
|
|
128
|
+
}
|
|
129
|
+
watchQuery(ref, args = {}) {
|
|
130
|
+
let latest;
|
|
131
|
+
let latestError;
|
|
132
|
+
const updateHandlers = new Set();
|
|
133
|
+
const unsubscribe = this.subscribeQuery(ref, args, (message) => {
|
|
134
|
+
if (message.type === "query.result") {
|
|
135
|
+
latest = message.result;
|
|
136
|
+
latestError = undefined;
|
|
137
|
+
for (const handler of updateHandlers)
|
|
138
|
+
handler();
|
|
139
|
+
}
|
|
140
|
+
if (message.type === "query.error") {
|
|
141
|
+
latestError = new Error(message.error);
|
|
142
|
+
for (const handler of updateHandlers)
|
|
143
|
+
handler();
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return {
|
|
147
|
+
localQueryResult() {
|
|
148
|
+
if (latestError)
|
|
149
|
+
throw latestError;
|
|
150
|
+
return latest;
|
|
151
|
+
},
|
|
152
|
+
onUpdate(handler) {
|
|
153
|
+
updateHandlers.add(handler);
|
|
154
|
+
return () => {
|
|
155
|
+
updateHandlers.delete(handler);
|
|
156
|
+
if (updateHandlers.size === 0)
|
|
157
|
+
unsubscribe();
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
mutation(ref, args = {}) {
|
|
163
|
+
return this.call("mutation", ref, args);
|
|
164
|
+
}
|
|
165
|
+
action(ref, args = {}) {
|
|
166
|
+
return this.call("action", ref, args);
|
|
167
|
+
}
|
|
168
|
+
query(ref, args = {}) {
|
|
169
|
+
this.connect();
|
|
170
|
+
const id = randomID();
|
|
171
|
+
return new Promise((resolve, reject) => {
|
|
172
|
+
this.handlers.set(id, (message) => {
|
|
173
|
+
if (message.type === "query.result") {
|
|
174
|
+
this.handlers.delete(id);
|
|
175
|
+
this.recordTelemetry({
|
|
176
|
+
type: "query",
|
|
177
|
+
id: message.id,
|
|
178
|
+
path: ref.path,
|
|
179
|
+
reason: message.reason,
|
|
180
|
+
outcome: "ok",
|
|
181
|
+
clientReceivedAtMs: nowMs(),
|
|
182
|
+
serverTrace: message.trace,
|
|
183
|
+
});
|
|
184
|
+
this.send({ type: "query.unsubscribe", id });
|
|
185
|
+
resolve(message.result);
|
|
186
|
+
}
|
|
187
|
+
if (message.type === "query.error") {
|
|
188
|
+
this.handlers.delete(id);
|
|
189
|
+
this.recordTelemetry({
|
|
190
|
+
type: "query",
|
|
191
|
+
id: message.id,
|
|
192
|
+
path: ref.path,
|
|
193
|
+
outcome: "error",
|
|
194
|
+
error: message.error,
|
|
195
|
+
clientReceivedAtMs: nowMs(),
|
|
196
|
+
});
|
|
197
|
+
this.send({ type: "query.unsubscribe", id });
|
|
198
|
+
reject(new Error(message.error));
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this.send({ type: "query.subscribe", id, path: ref.path, args });
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
call(kind, ref, args) {
|
|
205
|
+
this.connect();
|
|
206
|
+
const id = randomID();
|
|
207
|
+
const clientSentAtMs = nowMs();
|
|
208
|
+
return new Promise((resolve, reject) => {
|
|
209
|
+
this.handlers.set(id, (message) => {
|
|
210
|
+
if (kind === "mutation" && message.type === "mutation.result") {
|
|
211
|
+
this.handlers.delete(id);
|
|
212
|
+
this.emitTelemetryFromCall(kind, id, ref.path, "ok", clientSentAtMs, message.trace);
|
|
213
|
+
resolve(message.result);
|
|
214
|
+
}
|
|
215
|
+
if (kind === "mutation" && message.type === "mutation.error") {
|
|
216
|
+
this.handlers.delete(id);
|
|
217
|
+
this.emitTelemetryFromCall(kind, id, ref.path, "error", clientSentAtMs, message.trace, message.error);
|
|
218
|
+
reject(new Error(message.error));
|
|
219
|
+
}
|
|
220
|
+
if (kind === "action" && message.type === "action.result") {
|
|
221
|
+
this.handlers.delete(id);
|
|
222
|
+
this.emitTelemetryFromCall(kind, id, ref.path, "ok", clientSentAtMs, message.trace);
|
|
223
|
+
resolve(message.result);
|
|
224
|
+
}
|
|
225
|
+
if (kind === "action" && message.type === "action.error") {
|
|
226
|
+
this.handlers.delete(id);
|
|
227
|
+
this.emitTelemetryFromCall(kind, id, ref.path, "error", clientSentAtMs, message.trace, message.error);
|
|
228
|
+
reject(new Error(message.error));
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
if (kind === "mutation") {
|
|
232
|
+
this.send({ type: "mutation.call", id, path: ref.path, args, trace: { clientSentAtMs } });
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
this.send({ type: "action.call", id, path: ref.path, args, trace: { clientSentAtMs } });
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
unsubscribeQueryListener(key, listener) {
|
|
240
|
+
const subscription = this.querySubscriptions.get(key);
|
|
241
|
+
if (!subscription)
|
|
242
|
+
return;
|
|
243
|
+
subscription.listeners.delete(listener);
|
|
244
|
+
if (subscription.listeners.size > 0 || subscription.unsubscribeTimer)
|
|
245
|
+
return;
|
|
246
|
+
// React can briefly unmount/remount the same hook during route transitions,
|
|
247
|
+
// StrictMode, or error-boundary recovery. Holding the server subscription for
|
|
248
|
+
// one tick prevents unsubscribe/subscribe ping-pong while still cleaning up
|
|
249
|
+
// abandoned subscriptions promptly.
|
|
250
|
+
subscription.unsubscribeTimer = setTimeout(() => {
|
|
251
|
+
const latest = this.querySubscriptions.get(key);
|
|
252
|
+
if (!latest || latest.listeners.size > 0)
|
|
253
|
+
return;
|
|
254
|
+
this.querySubscriptions.delete(key);
|
|
255
|
+
this.send({ type: "query.unsubscribe", id: latest.id });
|
|
256
|
+
setTimeout(() => this.handlers.delete(latest.id), 500);
|
|
257
|
+
}, 250);
|
|
258
|
+
}
|
|
259
|
+
emitTelemetryFromCall(kind, id, path, outcome, clientSentAtMs, serverTrace, error) {
|
|
260
|
+
const clientReceivedAtMs = nowMs();
|
|
261
|
+
this.recordTelemetry({
|
|
262
|
+
type: kind,
|
|
263
|
+
id,
|
|
264
|
+
path,
|
|
265
|
+
outcome,
|
|
266
|
+
error,
|
|
267
|
+
clientSentAtMs,
|
|
268
|
+
clientReceivedAtMs,
|
|
269
|
+
clientDurationMs: clientReceivedAtMs - clientSentAtMs,
|
|
270
|
+
serverTrace,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
recordTelemetry(event) {
|
|
274
|
+
this.emitTelemetry(event);
|
|
275
|
+
if (this.telemetryEnabled) {
|
|
276
|
+
this.reportTelemetry(event);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
emitTelemetry(event) {
|
|
280
|
+
for (const handler of this.telemetryHandlers) {
|
|
281
|
+
handler(event);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
reportTelemetry(event) {
|
|
285
|
+
this.send({
|
|
286
|
+
type: "telemetry.event",
|
|
287
|
+
id: event.id,
|
|
288
|
+
kind: event.type,
|
|
289
|
+
path: event.path,
|
|
290
|
+
reason: event.reason,
|
|
291
|
+
outcome: event.outcome,
|
|
292
|
+
error: event.error,
|
|
293
|
+
clientSentAtMs: event.clientSentAtMs,
|
|
294
|
+
clientReceivedAtMs: event.clientReceivedAtMs,
|
|
295
|
+
clientDurationMs: event.clientDurationMs,
|
|
296
|
+
trace: event.serverTrace,
|
|
297
|
+
device: event.device ?? browserTelemetryInfo(),
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
sendAuth() {
|
|
301
|
+
if (!this.auth.token && !this.auth.tenant)
|
|
302
|
+
return;
|
|
303
|
+
this.authInFlight = true;
|
|
304
|
+
this.sendNow({ type: "auth", id: randomID(), token: this.auth.token, tenant: this.auth.tenant });
|
|
305
|
+
}
|
|
306
|
+
send(message) {
|
|
307
|
+
if (this.authInFlight && message.type !== "auth" && message.type !== "telemetry.event") {
|
|
308
|
+
this.pendingMessages.push(message);
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
this.sendNow(message);
|
|
312
|
+
}
|
|
313
|
+
sendNow(message) {
|
|
314
|
+
const socket = this.socket;
|
|
315
|
+
if (!socket || socket.readyState !== WebSocket.OPEN) {
|
|
316
|
+
socket?.addEventListener("open", () => {
|
|
317
|
+
if (message.type === "auth") {
|
|
318
|
+
socket.send(JSON.stringify(message));
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
this.send(message);
|
|
322
|
+
}, { once: true });
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
socket.send(JSON.stringify(message));
|
|
326
|
+
}
|
|
327
|
+
flushPendingMessages() {
|
|
328
|
+
const pending = this.pendingMessages.splice(0);
|
|
329
|
+
for (const message of pending) {
|
|
330
|
+
this.send(message);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function querySubscriptionKey(ref, args) {
|
|
335
|
+
return `${ref.path}\u0000${stableStringify(args)}`;
|
|
336
|
+
}
|
|
337
|
+
function stableStringify(value) {
|
|
338
|
+
if (value === null || typeof value !== "object")
|
|
339
|
+
return JSON.stringify(value);
|
|
340
|
+
if (Array.isArray(value))
|
|
341
|
+
return `[${value.map(stableStringify).join(",")}]`;
|
|
342
|
+
const record = value;
|
|
343
|
+
return `{${Object.keys(record)
|
|
344
|
+
.sort()
|
|
345
|
+
.map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`)
|
|
346
|
+
.join(",")}}`;
|
|
347
|
+
}
|
|
348
|
+
export class ConvexReactClient extends GonvexClient {
|
|
349
|
+
constructor(url, auth = {}) {
|
|
350
|
+
super(toWebSocketURL(url, auth.project), auth);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
function toWebSocketURL(url, project) {
|
|
354
|
+
const wsURL = url.startsWith("ws://") || url.startsWith("wss://")
|
|
355
|
+
? new URL(url)
|
|
356
|
+
: new URL(`${url.replace(/^http:/, "ws:").replace(/^https:/, "wss:").replace(/\/$/, "")}/ws`);
|
|
357
|
+
if (project && !wsURL.searchParams.has("project")) {
|
|
358
|
+
wsURL.searchParams.set("project", project);
|
|
359
|
+
}
|
|
360
|
+
return wsURL.toString();
|
|
361
|
+
}
|
|
362
|
+
function randomID() {
|
|
363
|
+
const randomUUID = globalThis.crypto?.randomUUID;
|
|
364
|
+
if (randomUUID)
|
|
365
|
+
return randomUUID.call(globalThis.crypto);
|
|
366
|
+
return `gonvex_${Date.now().toString(36)}_${Math.random().toString(36).slice(2)}`;
|
|
367
|
+
}
|
|
368
|
+
function nowMs() {
|
|
369
|
+
const performanceValue = globalThis.performance;
|
|
370
|
+
if (performanceValue
|
|
371
|
+
&& Number.isFinite(performanceValue.timeOrigin)
|
|
372
|
+
&& typeof performanceValue.now === "function") {
|
|
373
|
+
return performanceValue.timeOrigin + performanceValue.now();
|
|
374
|
+
}
|
|
375
|
+
return Date.now();
|
|
376
|
+
}
|
|
377
|
+
function browserTelemetryInfo() {
|
|
378
|
+
const navigatorValue = globalThis.navigator;
|
|
379
|
+
if (!navigatorValue)
|
|
380
|
+
return undefined;
|
|
381
|
+
const userAgent = navigatorValue.userAgent || "";
|
|
382
|
+
const connection = navigatorValue.connection || navigatorValue.mozConnection || navigatorValue.webkitConnection;
|
|
383
|
+
const viewportWidth = typeof globalThis.innerWidth === "number" ? globalThis.innerWidth : undefined;
|
|
384
|
+
const viewportHeight = typeof globalThis.innerHeight === "number" ? globalThis.innerHeight : undefined;
|
|
385
|
+
return {
|
|
386
|
+
userAgent,
|
|
387
|
+
...parseBrowser(userAgent),
|
|
388
|
+
deviceType: detectDeviceType(userAgent),
|
|
389
|
+
platform: navigatorValue.platform || "",
|
|
390
|
+
language: navigatorValue.language || "",
|
|
391
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone || "",
|
|
392
|
+
viewportWidth,
|
|
393
|
+
viewportHeight,
|
|
394
|
+
hardwareConcurrency: navigatorValue.hardwareConcurrency,
|
|
395
|
+
deviceMemory: typeof navigatorValue.deviceMemory === "number" ? navigatorValue.deviceMemory : undefined,
|
|
396
|
+
touchPoints: navigatorValue.maxTouchPoints,
|
|
397
|
+
connectionType: typeof connection?.type === "string" ? connection.type : undefined,
|
|
398
|
+
effectiveConnectionType: typeof connection?.effectiveType === "string" ? connection.effectiveType : undefined,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function parseBrowser(userAgent) {
|
|
402
|
+
const patterns = [
|
|
403
|
+
["Edge", /Edg\/([0-9.]+)/],
|
|
404
|
+
["Chrome", /Chrome\/([0-9.]+)/],
|
|
405
|
+
["Firefox", /Firefox\/([0-9.]+)/],
|
|
406
|
+
["Safari", /Version\/([0-9.]+).*Safari/],
|
|
407
|
+
];
|
|
408
|
+
for (const [browserName, pattern] of patterns) {
|
|
409
|
+
const match = userAgent.match(pattern);
|
|
410
|
+
if (match)
|
|
411
|
+
return { browserName, browserVersion: match[1] };
|
|
412
|
+
}
|
|
413
|
+
return { browserName: "", browserVersion: "" };
|
|
414
|
+
}
|
|
415
|
+
function detectDeviceType(userAgent) {
|
|
416
|
+
if (/ipad|tablet/i.test(userAgent))
|
|
417
|
+
return "tablet";
|
|
418
|
+
if (/mobi|iphone|android/i.test(userAgent))
|
|
419
|
+
return "mobile";
|
|
420
|
+
return "desktop";
|
|
421
|
+
}
|
|
422
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,c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AAC,MAAM,EAAE,gBAAgB,CAAC;QAC1B,CAAC,QAAQ,EAAE,mBAAmB,CAAC;QAC/B,CAAC,SAAS,EAAE,oBAAoB,CAAC;QACjC,CAAC,QAAQ,EAAE,4BAA4B,CAAC;KACzC,CAAC;IACF,KAAK,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE,CAAC;QAC9C,MAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACvC,IAAI,KAAK;YAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,CAAC;IACD,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAiB;IACzC,IAAI,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,QAAQ,CAAC;IACpD,IAAI,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC5D,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type CacheDBHealth, type CacheEnvironment, type CacheQueryPlan, type CacheRoutingDecision, type CacheShapeDefinition, type CacheShapeState } from "./cache.js";
|
|
2
|
+
import { CacheCoordinatorModel } from "./cache-coordinator.js";
|
|
3
|
+
import { type BrowserCacheCapabilities } from "./browser-capabilities.js";
|
|
4
|
+
export type ShapeHydrationResult = Omit<CacheShapeState, "status"> & {
|
|
5
|
+
status?: CacheShapeState["status"];
|
|
6
|
+
};
|
|
7
|
+
export type ShapeHydrator = (definition: CacheShapeDefinition) => Promise<ShapeHydrationResult>;
|
|
8
|
+
export declare class CacheMetadataStore {
|
|
9
|
+
private dbHealth;
|
|
10
|
+
private readonly definitions;
|
|
11
|
+
private readonly shapes;
|
|
12
|
+
setDBHealth(health: CacheDBHealth): void;
|
|
13
|
+
getDBHealth(): CacheDBHealth;
|
|
14
|
+
registerShape(definition: CacheShapeDefinition): void;
|
|
15
|
+
markShapeSyncing(definition: CacheShapeDefinition, scope: Pick<CacheShapeState, "projectId" | "tenantId" | "userId" | "authScope">): void;
|
|
16
|
+
updateShape(shape: CacheShapeState): void;
|
|
17
|
+
markAllShapesStale(): void;
|
|
18
|
+
environment(singleWriter: boolean): CacheEnvironment;
|
|
19
|
+
shapeStates(): {
|
|
20
|
+
id: string;
|
|
21
|
+
projectId: string;
|
|
22
|
+
tenantId: string;
|
|
23
|
+
userId: string;
|
|
24
|
+
authScope: string;
|
|
25
|
+
status: import("./cache.js").ShapeSyncStatus;
|
|
26
|
+
schemaVersion: string;
|
|
27
|
+
permissionVersion: string;
|
|
28
|
+
checkpoint?: string;
|
|
29
|
+
rowCount?: number;
|
|
30
|
+
maxRows?: number;
|
|
31
|
+
}[];
|
|
32
|
+
}
|
|
33
|
+
export declare class BrowserPersistentCache {
|
|
34
|
+
readonly metadata: CacheMetadataStore;
|
|
35
|
+
readonly coordinator: CacheCoordinatorModel;
|
|
36
|
+
constructor(metadata?: CacheMetadataStore, coordinator?: CacheCoordinatorModel);
|
|
37
|
+
decideQuerySource(query: CacheQueryPlan): CacheRoutingDecision;
|
|
38
|
+
disableIfUnsupported(capabilities?: BrowserCacheCapabilities): BrowserCacheCapabilities;
|
|
39
|
+
hydrateShapeInBackground(definition: CacheShapeDefinition, scope: Pick<CacheShapeState, "projectId" | "tenantId" | "userId" | "authScope">, hydrate: ShapeHydrator): void;
|
|
40
|
+
quarantineScope(nextScope: Pick<CacheShapeState, "projectId" | "tenantId" | "userId" | "authScope">): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { chooseQuerySource, } from "./cache.js";
|
|
2
|
+
import { CacheCoordinatorModel } from "./cache-coordinator.js";
|
|
3
|
+
import { detectBrowserCacheCapabilities } from "./browser-capabilities.js";
|
|
4
|
+
export class CacheMetadataStore {
|
|
5
|
+
dbHealth = "initializing";
|
|
6
|
+
definitions = new Map();
|
|
7
|
+
shapes = new Map();
|
|
8
|
+
setDBHealth(health) {
|
|
9
|
+
this.dbHealth = health;
|
|
10
|
+
}
|
|
11
|
+
getDBHealth() {
|
|
12
|
+
return this.dbHealth;
|
|
13
|
+
}
|
|
14
|
+
registerShape(definition) {
|
|
15
|
+
this.definitions.set(definition.id, definition);
|
|
16
|
+
}
|
|
17
|
+
markShapeSyncing(definition, scope) {
|
|
18
|
+
this.registerShape(definition);
|
|
19
|
+
this.shapes.set(definition.id, {
|
|
20
|
+
id: definition.id,
|
|
21
|
+
...scope,
|
|
22
|
+
status: "syncing",
|
|
23
|
+
schemaVersion: definition.schemaVersion,
|
|
24
|
+
permissionVersion: definition.permissionVersion,
|
|
25
|
+
maxRows: definition.maxRows,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
updateShape(shape) {
|
|
29
|
+
this.shapes.set(shape.id, { ...shape });
|
|
30
|
+
}
|
|
31
|
+
markAllShapesStale() {
|
|
32
|
+
for (const [id, shape] of this.shapes) {
|
|
33
|
+
this.shapes.set(id, { ...shape, status: "stale" });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
environment(singleWriter) {
|
|
37
|
+
return {
|
|
38
|
+
dbHealth: this.dbHealth,
|
|
39
|
+
singleWriter,
|
|
40
|
+
shapes: Object.fromEntries(this.shapes),
|
|
41
|
+
definitions: Object.fromEntries(this.definitions),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
shapeStates() {
|
|
45
|
+
return [...this.shapes.values()].map((shape) => ({ ...shape }));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class BrowserPersistentCache {
|
|
49
|
+
metadata;
|
|
50
|
+
coordinator;
|
|
51
|
+
constructor(metadata = new CacheMetadataStore(), coordinator = new CacheCoordinatorModel()) {
|
|
52
|
+
this.metadata = metadata;
|
|
53
|
+
this.coordinator = coordinator;
|
|
54
|
+
}
|
|
55
|
+
decideQuerySource(query) {
|
|
56
|
+
const route = this.coordinator.routeRequest();
|
|
57
|
+
return chooseQuerySource(query, this.metadata.environment(route.route === "active-worker"));
|
|
58
|
+
}
|
|
59
|
+
disableIfUnsupported(capabilities = detectBrowserCacheCapabilities()) {
|
|
60
|
+
if (!capabilities.supported) {
|
|
61
|
+
this.coordinator.disableUnsafeFallback();
|
|
62
|
+
}
|
|
63
|
+
return capabilities;
|
|
64
|
+
}
|
|
65
|
+
hydrateShapeInBackground(definition, scope, hydrate) {
|
|
66
|
+
this.metadata.markShapeSyncing(definition, scope);
|
|
67
|
+
void hydrate(definition).then((shape) => {
|
|
68
|
+
this.metadata.updateShape({
|
|
69
|
+
...shape,
|
|
70
|
+
id: definition.id,
|
|
71
|
+
projectId: shape.projectId,
|
|
72
|
+
tenantId: shape.tenantId,
|
|
73
|
+
userId: shape.userId,
|
|
74
|
+
authScope: shape.authScope,
|
|
75
|
+
status: shape.status ?? "ready",
|
|
76
|
+
schemaVersion: definition.schemaVersion,
|
|
77
|
+
permissionVersion: definition.permissionVersion,
|
|
78
|
+
maxRows: definition.maxRows,
|
|
79
|
+
});
|
|
80
|
+
}).catch(() => {
|
|
81
|
+
this.metadata.updateShape({
|
|
82
|
+
id: definition.id,
|
|
83
|
+
...scope,
|
|
84
|
+
status: "error",
|
|
85
|
+
schemaVersion: definition.schemaVersion,
|
|
86
|
+
permissionVersion: definition.permissionVersion,
|
|
87
|
+
maxRows: definition.maxRows,
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
quarantineScope(nextScope) {
|
|
92
|
+
for (const shape of this.metadata.shapeStates()) {
|
|
93
|
+
const scopeMatches = shape.projectId === nextScope.projectId
|
|
94
|
+
&& shape.tenantId === nextScope.tenantId
|
|
95
|
+
&& shape.userId === nextScope.userId
|
|
96
|
+
&& shape.authScope === nextScope.authScope;
|
|
97
|
+
if (!scopeMatches) {
|
|
98
|
+
this.metadata.updateShape({ ...shape, status: "stale" });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=persistent-cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistent-cache.js","sourceRoot":"","sources":["../src/persistent-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAOlB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAiC,MAAM,2BAA2B,CAAC;AAQ1G,MAAM,OAAO,kBAAkB;IACrB,QAAQ,GAAkB,cAAc,CAAC;IAChC,WAAW,GAAG,IAAI,GAAG,EAAgC,CAAC;IACtD,MAAM,GAAG,IAAI,GAAG,EAA2B,CAAC;IAE7D,WAAW,CAAC,MAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;IACzB,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED,aAAa,CAAC,UAAgC;QAC5C,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,gBAAgB,CAAC,UAAgC,EAAE,KAA+E;QAChI,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE;YAC7B,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,GAAG,KAAK;YACR,MAAM,EAAE,SAAS;YACjB,aAAa,EAAE,UAAU,CAAC,aAAa;YACvC,iBAAiB,EAAE,UAAU,CAAC,iBAAiB;YAC/C,OAAO,EAAE,UAAU,CAAC,OAAO;SAC5B,CAAC,CAAC;IACL,CAAC;IAED,WAAW,CAAC,KAAsB;QAChC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,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AAK,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS;mBACvD,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;mBACrC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;mBACjC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,SAAS,CAAC;YAC7C,IAAI,CAAC,YAAY,EAAE,CAAC;gBAClB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gonvex/client",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@gonvex/protocol": "0.1.0"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^6.0.3",
|
|
20
|
+
"vitest": "^4.1.6"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc -p tsconfig.json",
|
|
28
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
29
|
+
"test": "vitest run",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
31
|
+
}
|
|
32
|
+
}
|