@sanity/client 7.11.2 → 7.12.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/dist/index.cjs CHANGED
@@ -2672,6 +2672,7 @@ function defineCreateClientExports(envMiddleware, ClassConstructor) {
2672
2672
  maxRedirects: 0,
2673
2673
  maxRetries: config2.maxRetries,
2674
2674
  retryDelay: config2.retryDelay,
2675
+ lineage: config2.lineage,
2675
2676
  ...options
2676
2677
  }),
2677
2678
  config2
@@ -2683,10 +2684,19 @@ function defineDeprecatedCreateClient(createClient2) {
2683
2684
  return config.printNoDefaultExport(), createClient2(config$1);
2684
2685
  };
2685
2686
  }
2686
- var name = "@sanity/client", version = "7.11.2";
2687
+ var name = "@sanity/client", version = "7.12.0";
2687
2688
  const middleware = [
2688
2689
  middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
2689
2690
  middleware$1.headers({ "User-Agent": `${name} ${version}` }),
2691
+ // Lineage is used for recursion control/tracing and can be passed either through
2692
+ // client constructor or through environent variable.
2693
+ // Not used in browser environments.
2694
+ {
2695
+ processOptions(opts) {
2696
+ const lineage = typeof process < "u" && process.env.X_SANITY_LINEAGE || opts.lineage;
2697
+ return lineage && (opts.headers = opts.headers || {}, opts.headers["x-sanity-lineage"] = lineage), opts;
2698
+ }
2699
+ },
2690
2700
  // Enable keep-alive, and in addition limit the number of sockets that can be opened.
2691
2701
  // This avoids opening too many connections to the server if someone tries to execute
2692
2702
  // a bunch of requests in parallel. It's recommended to have a concurrency limit