orez 0.5.16 → 0.5.18

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.
Files changed (44) hide show
  1. package/README.md +4 -0
  2. package/dist/cf-do/worker.d.ts.map +1 -1
  3. package/dist/cf-do/worker.js +89 -14
  4. package/dist/cf-do/worker.js.map +1 -1
  5. package/dist/sync-browser-host/generated/sqlite3-browser.wasm +0 -0
  6. package/dist/sync-browser-host/generated/sync_wasm.js +921 -0
  7. package/dist/sync-browser-host/generated/sync_wasm_bg.wasm +0 -0
  8. package/dist/sync-browser-host/host.d.ts +8 -0
  9. package/dist/sync-browser-host/host.d.ts.map +1 -0
  10. package/dist/sync-browser-host/host.js +435 -0
  11. package/dist/sync-browser-host/host.js.map +1 -0
  12. package/dist/sync-browser-host/idb-snapshot.d.ts +10 -0
  13. package/dist/sync-browser-host/idb-snapshot.d.ts.map +1 -0
  14. package/dist/sync-browser-host/idb-snapshot.js +109 -0
  15. package/dist/sync-browser-host/idb-snapshot.js.map +1 -0
  16. package/dist/sync-browser-host/index.d.ts +4 -0
  17. package/dist/sync-browser-host/index.d.ts.map +1 -0
  18. package/dist/sync-browser-host/index.js +4 -0
  19. package/dist/sync-browser-host/index.js.map +1 -0
  20. package/dist/sync-browser-host/message-port.d.ts +6 -0
  21. package/dist/sync-browser-host/message-port.d.ts.map +1 -0
  22. package/dist/sync-browser-host/message-port.js +182 -0
  23. package/dist/sync-browser-host/message-port.js.map +1 -0
  24. package/dist/sync-browser-host/sqlite-adapter.d.ts +66 -0
  25. package/dist/sync-browser-host/sqlite-adapter.d.ts.map +1 -0
  26. package/dist/sync-browser-host/sqlite-adapter.js +135 -0
  27. package/dist/sync-browser-host/sqlite-adapter.js.map +1 -0
  28. package/dist/sync-browser-host/types.d.ts +88 -0
  29. package/dist/sync-browser-host/types.d.ts.map +1 -0
  30. package/dist/sync-browser-host/types.js +12 -0
  31. package/dist/sync-browser-host/types.js.map +1 -0
  32. package/dist/test-setup.d.ts +2 -0
  33. package/dist/test-setup.d.ts.map +1 -0
  34. package/dist/test-setup.js +35 -0
  35. package/dist/test-setup.js.map +1 -0
  36. package/dist/zero-http/test-harness.d.ts +2 -6
  37. package/dist/zero-http/test-harness.d.ts.map +1 -1
  38. package/dist/zero-http/test-harness.js +4 -2
  39. package/dist/zero-http/test-harness.js.map +1 -1
  40. package/dist/zero-http/transport.d.ts +30 -4
  41. package/dist/zero-http/transport.d.ts.map +1 -1
  42. package/dist/zero-http/transport.js +411 -44
  43. package/dist/zero-http/transport.js.map +1 -1
  44. package/package.json +15 -5
@@ -1,9 +1,35 @@
1
- export declare function installZeroHttpTransport(opts: {
2
- origin: string;
3
- fetch?: typeof fetch;
4
- }): {
1
+ export type QueryTransform = (name: string, args: readonly unknown[]) => unknown;
2
+ export type HttpPullTransport = {
5
3
  pull(): Promise<void>;
4
+ flush(): Promise<void>;
6
5
  readonly connections: number;
7
6
  uninstall(): void;
8
7
  };
8
+ export type HttpPullTransportOptions = {
9
+ appID?: string;
10
+ shardNum?: number;
11
+ origin: string;
12
+ pushOrigin?: string;
13
+ fetch?: typeof fetch;
14
+ pullIntervalMs?: number;
15
+ /**
16
+ * opens a notification-only socket to <origin>/wake and pulls immediately on
17
+ * any wake, demoting interval polling to a safety net. true preserves the
18
+ * bare unauthenticated URL. for an authenticated host, pass getToken: each
19
+ * socket attempt calls it afresh and appends the result as wakeToken because
20
+ * browser WebSockets cannot send headers. consumers should implement
21
+ * getToken by calling an authenticated edge route that mints a short-lived,
22
+ * namespace-scoped signed token; the consumer's authorizeWake callback must
23
+ * verify that token. mint failures leave this advisory channel down and retry
24
+ * with backoff; pulls remain the source of correctness.
25
+ */
26
+ wake?: boolean | {
27
+ getToken(): Promise<string>;
28
+ };
29
+ queryTransform?: QueryTransform;
30
+ queryForward?: boolean;
31
+ };
32
+ export declare function installHttpPullTransport(opts: HttpPullTransportOptions): HttpPullTransport;
33
+ export declare function ensureHttpPullTransport(opts: HttpPullTransportOptions): HttpPullTransport;
34
+ export declare function flushHttpPullTransports(): Promise<void>;
9
35
  //# sourceMappingURL=transport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/zero-http/transport.ts"],"names":[],"mappings":"AA0CA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB,GAAG;IACF,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,SAAS,IAAI,IAAI,CAAA;CAClB,CAgDA"}
1
+ {"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/zero-http/transport.ts"],"names":[],"mappings":"AA6CA,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,OAAO,EAAE,KAAK,OAAO,CAAA;AAyChF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAKrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,SAAS,IAAI,IAAI,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IAGrC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IAId,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;IAGpB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,CAAA;IAIhD,cAAc,CAAC,EAAE,cAAc,CAAA;IAI/B,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,wBAAwB,GAC7B,iBAAiB,CA2EnB;AAOD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,wBAAwB,GAC7B,iBAAiB,CAOnB;AAED,wBAAsB,uBAAuB,kBAI5C"}