@rocicorp/zero 0.23.2025090401 → 0.24.2025090401

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 (38) hide show
  1. package/out/{chunk-ZFOMEI7F.js → chunk-ITMUS2AZ.js} +18 -27
  2. package/out/chunk-ITMUS2AZ.js.map +7 -0
  3. package/out/{chunk-VG6XPTYD.js → chunk-J2HKCPEW.js} +2 -2
  4. package/out/react.js +1 -1
  5. package/out/solid.js +2 -2
  6. package/out/zero/package.json +1 -1
  7. package/out/zero-cache/src/custom/fetch.d.ts +2 -1
  8. package/out/zero-cache/src/custom/fetch.d.ts.map +1 -1
  9. package/out/zero-cache/src/custom/fetch.js +8 -6
  10. package/out/zero-cache/src/custom/fetch.js.map +1 -1
  11. package/out/zero-cache/src/custom-queries/transform-query.d.ts +3 -2
  12. package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +1 -1
  13. package/out/zero-cache/src/custom-queries/transform-query.js +6 -3
  14. package/out/zero-cache/src/custom-queries/transform-query.js.map +1 -1
  15. package/out/zero-cache/src/services/mutagen/pusher.d.ts +2 -3
  16. package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
  17. package/out/zero-cache/src/services/mutagen/pusher.js +25 -6
  18. package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
  19. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +1 -0
  20. package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
  21. package/out/zero-cache/src/services/view-syncer/view-syncer.js +20 -3
  22. package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
  23. package/out/zero-cache/src/workers/syncer-ws-message-handler.js +1 -1
  24. package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
  25. package/out/zero-client/src/client/options.d.ts +8 -12
  26. package/out/zero-client/src/client/options.d.ts.map +1 -1
  27. package/out/zero-client/src/client/zero.d.ts +1 -2
  28. package/out/zero-client/src/client/zero.d.ts.map +1 -1
  29. package/out/zero-protocol/src/connect.d.ts +4 -32
  30. package/out/zero-protocol/src/connect.d.ts.map +1 -1
  31. package/out/zero-protocol/src/connect.js +2 -17
  32. package/out/zero-protocol/src/connect.js.map +1 -1
  33. package/out/zero-protocol/src/up.d.ts +2 -8
  34. package/out/zero-protocol/src/up.d.ts.map +1 -1
  35. package/out/zero.js +2 -2
  36. package/package.json +1 -1
  37. package/out/chunk-ZFOMEI7F.js.map +0 -7
  38. /package/out/{chunk-VG6XPTYD.js.map → chunk-J2HKCPEW.js.map} +0 -0
@@ -5982,29 +5982,14 @@ var connectedMessageSchema = valita_exports.tuple([
5982
5982
  valita_exports.literal("connected"),
5983
5983
  connectedBodySchema
5984
5984
  ]);
5985
- var userQueryMutateParamsSchema = valita_exports.object({
5986
- /**
5987
- * A client driven URL to send queries or mutations to.
5988
- * This URL must match one of the URLs set in the zero config.
5989
- *
5990
- * E.g., Given the following environment variable:
5991
- * ZERO_GET_QUERIES_URL=[https://*.example.com/query]
5992
- *
5993
- * Then this URL could be:
5994
- * https://myapp.example.com/query
5995
- */
5996
- url: valita_exports.string().optional(),
5997
- // The query string to use for query or mutation calls.
5998
- queryParams: valita_exports.record(valita_exports.string()).optional()
5999
- });
6000
5985
  var initConnectionBodySchema = valita_exports.object({
6001
5986
  desiredQueriesPatch: upQueriesPatchSchema,
6002
5987
  clientSchema: clientSchemaSchema.optional(),
6003
5988
  deleted: deleteClientsBodySchema.optional(),
6004
5989
  // parameters to configure the mutate endpoint
6005
- userPushParams: userQueryMutateParamsSchema.optional(),
5990
+ userPushURL: valita_exports.string().optional(),
6006
5991
  // parameters to configure the query endpoint
6007
- userQueryParams: userQueryMutateParamsSchema.optional(),
5992
+ userQueryURL: valita_exports.string().optional(),
6008
5993
  /**
6009
5994
  * `activeClients` is an optional array of client IDs that are currently active
6010
5995
  * in the client group. This is used to inform the server about the clients
@@ -8680,7 +8665,7 @@ function makeMessage(message, context, logLevel) {
8680
8665
  }
8681
8666
 
8682
8667
  // ../zero-client/src/client/version.ts
8683
- var version2 = "0.23.2025090401";
8668
+ var version2 = "0.24.2025090401";
8684
8669
 
8685
8670
  // ../zero-client/src/client/log-options.ts
8686
8671
  var LevelFilterLogSink = class {
@@ -10371,6 +10356,12 @@ var Zero = class _Zero {
10371
10356
  this.#schema = schema;
10372
10357
  const { clientSchema, hash } = clientSchemaFrom(schema);
10373
10358
  this.#clientSchema = clientSchema;
10359
+ const nameKey = JSON.stringify({
10360
+ storageKey: this.storageKey,
10361
+ mutateUrl: options.mutateURL ?? "",
10362
+ queryUrl: options.getQueriesURL ?? ""
10363
+ });
10364
+ const hashedKey = h64(nameKey).toString(36);
10374
10365
  const replicacheOptions = {
10375
10366
  // The schema stored in IDB is dependent upon both the ClientSchema
10376
10367
  // and the AST schema (i.e. PROTOCOL_VERSION).
@@ -10378,7 +10369,7 @@ var Zero = class _Zero {
10378
10369
  logLevel: logOptions.logLevel,
10379
10370
  logSinks: [logOptions.logSink],
10380
10371
  mutators: replicacheMutators,
10381
- name: `zero-${userID}-${this.storageKey}`,
10372
+ name: `zero-${userID}-${hashedKey}`,
10382
10373
  pusher: (req, reqID) => this.#pusher(req, reqID),
10383
10374
  puller: (req, reqID) => this.#puller(req, reqID),
10384
10375
  pushDelay: 0,
@@ -10895,8 +10886,8 @@ var Zero = class _Zero {
10895
10886
  // The clientSchema only needs to be sent for the very first request.
10896
10887
  // Henceforth it is stored with the CVR and verified automatically.
10897
10888
  ...this.#connectCookie === null ? { clientSchema } : {},
10898
- userPushParams: this.#options.mutate ?? this.#options.push,
10899
- userQueryParams: this.#options.query
10889
+ userPushURL: this.#options.mutateURL,
10890
+ userQueryURL: this.#options.getQueriesURL
10900
10891
  }
10901
10892
  ]);
10902
10893
  this.#deletedClients = void 0;
@@ -10972,8 +10963,8 @@ var Zero = class _Zero {
10972
10963
  wsid,
10973
10964
  this.#options.logLevel === "debug",
10974
10965
  lc,
10975
- this.#options.mutate ?? this.#options.push,
10976
- this.#options.query,
10966
+ this.#options.mutateURL,
10967
+ this.#options.getQueriesURL,
10977
10968
  this.#options.maxHeaderLength,
10978
10969
  additionalConnectParams,
10979
10970
  await this.#activeClientsManager
@@ -11488,7 +11479,7 @@ var OnlineManager = class extends Subscribable {
11488
11479
  return this.#online;
11489
11480
  }
11490
11481
  };
11491
- async function createSocket(rep, queryManager, deleteClientsManager, socketOrigin, baseCookie, clientID, clientGroupID, clientSchema, userID, auth, lmid, wsid, debugPerf, lc, userPushParams, userQueryParams, maxHeaderLength = 1024 * 8, additionalConnectParams, activeClientsManager) {
11482
+ async function createSocket(rep, queryManager, deleteClientsManager, socketOrigin, baseCookie, clientID, clientGroupID, clientSchema, userID, auth, lmid, wsid, debugPerf, lc, userPushURL, userQueryURL, maxHeaderLength = 1024 * 8, additionalConnectParams, activeClientsManager) {
11492
11483
  const url = new URL(
11493
11484
  appendPath(socketOrigin, `/sync/v${PROTOCOL_VERSION}/connect`)
11494
11485
  );
@@ -11527,8 +11518,8 @@ async function createSocket(rep, queryManager, deleteClientsManager, socketOrigi
11527
11518
  // The clientSchema only needs to be sent for the very first request.
11528
11519
  // Henceforth it is stored with the CVR and verified automatically.
11529
11520
  ...baseCookie === null ? { clientSchema } : {},
11530
- userPushParams,
11531
- userQueryParams,
11521
+ userPushURL,
11522
+ userQueryURL,
11532
11523
  activeClients: [...activeClients]
11533
11524
  }
11534
11525
  ],
@@ -11621,4 +11612,4 @@ export {
11621
11612
  update_needed_reason_type_enum_exports,
11622
11613
  Zero
11623
11614
  };
11624
- //# sourceMappingURL=chunk-ZFOMEI7F.js.map
11615
+ //# sourceMappingURL=chunk-ITMUS2AZ.js.map