@sanity/client 7.11.2 → 7.12.1
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.browser.cjs +1 -0
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +6 -2
- package/dist/index.browser.d.ts +6 -2
- package/dist/index.browser.js +1 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +6 -2
- package/dist/stega.browser.d.ts +6 -2
- package/dist/stega.d.cts +6 -2
- package/dist/stega.d.ts +6 -2
- package/package.json +2 -3
- package/src/SanityClient.ts +2 -2
- package/src/defineCreateClient.ts +1 -0
- package/src/http/nodeMiddleware.ts +18 -1
- package/src/http/request.ts +5 -1
- package/src/types.ts +4 -0
- package/umd/sanityClient.js +1 -0
- package/umd/sanityClient.min.js +1 -1
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.
|
|
2687
|
+
var name = "@sanity/client", version = "7.12.1";
|
|
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
|