@rocicorp/zero 0.4.2024103000 → 0.5.2024103100

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 (56) hide show
  1. package/out/{chunk-4UHYW2B5.js → chunk-TBA526RR.js} +26 -34
  2. package/out/chunk-TBA526RR.js.map +7 -0
  3. package/out/react.js.map +2 -2
  4. package/out/shared/src/iterables.d.ts.map +1 -1
  5. package/out/shared/src/iterables.js +0 -5
  6. package/out/shared/src/iterables.js.map +1 -1
  7. package/out/solid.js +1 -1
  8. package/out/zero-cache/src/config/zero-config.d.ts +38 -38
  9. package/out/zero-cache/src/db/statements.d.ts +1 -1
  10. package/out/zero-cache/src/services/replicator/incremental-sync.js +1 -1
  11. package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +5 -5
  12. package/out/zero-cache/src/types/lite.d.ts.map +1 -1
  13. package/out/zero-cache/src/types/lite.js +5 -0
  14. package/out/zero-cache/src/types/lite.js.map +1 -1
  15. package/out/zero-protocol/src/ast.d.ts +2 -2
  16. package/out/zero-protocol/src/ast.d.ts.map +1 -1
  17. package/out/zero-protocol/src/ast.js +2 -1
  18. package/out/zero-protocol/src/ast.js.map +1 -1
  19. package/out/zero-protocol/src/change-desired-queries.d.ts +2 -2
  20. package/out/zero-protocol/src/connect.d.ts +2 -2
  21. package/out/zero-protocol/src/data.d.ts +2 -2
  22. package/out/zero-protocol/src/data.d.ts.map +1 -1
  23. package/out/zero-protocol/src/data.js +2 -1
  24. package/out/zero-protocol/src/data.js.map +1 -1
  25. package/out/zero-protocol/src/down.d.ts +3 -3
  26. package/out/zero-protocol/src/poke.d.ts +6 -6
  27. package/out/zero-protocol/src/push.d.ts +21 -21
  28. package/out/zero-protocol/src/queries-patch.d.ts +3 -3
  29. package/out/zero-protocol/src/row-patch.d.ts +2 -2
  30. package/out/zero-protocol/src/up.d.ts +5 -5
  31. package/out/zero-react/src/use-query.d.ts.map +1 -1
  32. package/out/zero.js +1 -1
  33. package/out/zql/src/zql/ivm/fan-in.d.ts +4 -2
  34. package/out/zql/src/zql/ivm/fan-in.d.ts.map +1 -1
  35. package/out/zql/src/zql/ivm/fan-in.js +8 -5
  36. package/out/zql/src/zql/ivm/fan-in.js.map +1 -1
  37. package/out/zql/src/zql/ivm/fan-out.d.ts +2 -2
  38. package/out/zql/src/zql/ivm/fan-out.d.ts.map +1 -1
  39. package/out/zql/src/zql/ivm/fan-out.js +3 -5
  40. package/out/zql/src/zql/ivm/fan-out.js.map +1 -1
  41. package/out/zql/src/zql/ivm/filter.d.ts +1 -2
  42. package/out/zql/src/zql/ivm/filter.d.ts.map +1 -1
  43. package/out/zql/src/zql/ivm/filter.js +8 -5
  44. package/out/zql/src/zql/ivm/filter.js.map +1 -1
  45. package/out/zql/src/zql/ivm/memory-source.d.ts +2 -2
  46. package/out/zql/src/zql/ivm/schema.d.ts +1 -1
  47. package/out/zql/src/zql/ivm/schema.d.ts.map +1 -1
  48. package/out/zql/src/zql/ivm/take.d.ts.map +1 -1
  49. package/out/zql/src/zql/ivm/take.js.map +1 -1
  50. package/out/zqlite/src/db.d.ts +1 -1
  51. package/out/zqlite/src/db.js +1 -1
  52. package/out/zqlite/src/table-source.d.ts.map +1 -1
  53. package/out/zqlite/src/table-source.js +44 -23
  54. package/out/zqlite/src/table-source.js.map +1 -1
  55. package/package.json +2 -2
  56. package/out/chunk-4UHYW2B5.js.map +0 -7
@@ -1351,10 +1351,6 @@ function* mergeIterables(iterables, comparator, distinct = false) {
1351
1351
  lastYielded = min[0];
1352
1352
  yield min[0];
1353
1353
  }
1354
- } catch (e) {
1355
- for (const it of iterators) {
1356
- it.throw?.(e);
1357
- }
1358
1354
  } finally {
1359
1355
  for (const it of iterators) {
1360
1356
  it.return?.();
@@ -9364,6 +9360,10 @@ function defined(arr) {
9364
9360
  return defined2;
9365
9361
  }
9366
9362
 
9363
+ // ../zero-protocol/src/data.ts
9364
+ var valueSchema = valita_exports.union(jsonSchema, valita_exports.undefined());
9365
+ var rowSchema = valita_exports.record(valueSchema);
9366
+
9367
9367
  // ../zero-protocol/src/ast.ts
9368
9368
  var selectorSchema = valita_exports.string();
9369
9369
  var orderingElementSchema = readonly(
@@ -9445,9 +9445,7 @@ var astSchema = valita_exports.object({
9445
9445
  limit: valita_exports.number().optional(),
9446
9446
  orderBy: orderingSchema.optional(),
9447
9447
  start: valita_exports.object({
9448
- row: valita_exports.record(
9449
- valita_exports.union(valita_exports.string(), valita_exports.number(), valita_exports.boolean(), valita_exports.null(), valita_exports.undefined())
9450
- ),
9448
+ row: rowSchema,
9451
9449
  exclusive: valita_exports.boolean()
9452
9450
  }).optional()
9453
9451
  });
@@ -9605,8 +9603,14 @@ var FanIn = class {
9605
9603
  getSchema() {
9606
9604
  return this.#inputs[0].getSchema();
9607
9605
  }
9608
- *fetch(req) {
9609
- const iterables = this.#inputs.map((input) => input.fetch(req));
9606
+ fetch(req) {
9607
+ return this.#fetchOrCleanup((input) => input.fetch(req));
9608
+ }
9609
+ cleanup(req) {
9610
+ return this.#fetchOrCleanup((input) => input.cleanup(req));
9611
+ }
9612
+ *#fetchOrCleanup(streamProvider) {
9613
+ const iterables = this.#inputs.map((input) => streamProvider(input));
9610
9614
  for (const node of mergeIterables(
9611
9615
  iterables,
9612
9616
  (l, r) => must(this.#schema).compareRows(l.row, r.row),
@@ -9615,9 +9619,6 @@ var FanIn = class {
9615
9619
  yield node;
9616
9620
  }
9617
9621
  }
9618
- cleanup(req) {
9619
- return this.fetch(req);
9620
- }
9621
9622
  push(change) {
9622
9623
  this.#fanOut.onFanInReceivedPush();
9623
9624
  this.#output?.push(change);
@@ -9653,13 +9654,11 @@ var FanOut = class {
9653
9654
  getSchema() {
9654
9655
  return this.#input.getSchema();
9655
9656
  }
9656
- *fetch(req) {
9657
- for (const node of this.#input.fetch(req)) {
9658
- yield node;
9659
- }
9657
+ fetch(req) {
9658
+ return this.#input.fetch(req);
9660
9659
  }
9661
9660
  cleanup(req) {
9662
- return this.fetch(req);
9661
+ return this.#input.cleanup(req);
9663
9662
  }
9664
9663
  onFanInReceivedPush() {
9665
9664
  this.#fanInReceivedPush = true;
@@ -9721,16 +9720,19 @@ var Filter = class {
9721
9720
  getSchema() {
9722
9721
  return this.#input.getSchema();
9723
9722
  }
9724
- *fetch(req) {
9725
- for (const node of this.#input.fetch(req)) {
9723
+ fetch(req) {
9724
+ return this.#filter(this.#input.fetch(req));
9725
+ }
9726
+ cleanup(req) {
9727
+ return this.#filter(this.#input.cleanup(req));
9728
+ }
9729
+ *#filter(stream) {
9730
+ for (const node of stream) {
9726
9731
  if (this.#mode === "push-only" || this.#predicate(node.row)) {
9727
9732
  yield node;
9728
9733
  }
9729
9734
  }
9730
9735
  }
9731
- cleanup(req) {
9732
- return this.fetch(req);
9733
- }
9734
9736
  push(change) {
9735
9737
  assert(this.#output, "Output not set");
9736
9738
  switch (change.type) {
@@ -11511,16 +11513,6 @@ var errorMessageSchema = valita_exports.tuple([
11511
11513
  valita_exports.string()
11512
11514
  ]);
11513
11515
 
11514
- // ../zero-protocol/src/data.ts
11515
- var valueSchema = valita_exports.union(
11516
- valita_exports.null(),
11517
- valita_exports.boolean(),
11518
- valita_exports.number(),
11519
- valita_exports.string(),
11520
- valita_exports.undefined()
11521
- );
11522
- var rowSchema = valita_exports.record(valueSchema);
11523
-
11524
11516
  // ../zero-protocol/src/primary-key.ts
11525
11517
  var primaryKeySchema = readonly(
11526
11518
  valita_exports.tuple([valita_exports.string()]).concat(valita_exports.array(valita_exports.string()))
@@ -14486,7 +14478,7 @@ function makeMessage(message, context, logLevel) {
14486
14478
  }
14487
14479
 
14488
14480
  // ../zero-client/src/client/version.ts
14489
- var version2 = "0.4.2024103000+b2617e";
14481
+ var version2 = "0.5.2024103100+3e74e2";
14490
14482
 
14491
14483
  // ../zero-client/src/client/log-options.ts
14492
14484
  var LevelFilterLogSink = class {
@@ -16480,4 +16472,4 @@ export {
16480
16472
  createSchema,
16481
16473
  Zero
16482
16474
  };
16483
- //# sourceMappingURL=chunk-4UHYW2B5.js.map
16475
+ //# sourceMappingURL=chunk-TBA526RR.js.map