@sanity/client 7.2.2 → 7.3.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/README.md +4 -0
- package/dist/index.browser.cjs +3 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +12 -0
- package/dist/index.browser.d.ts +12 -0
- package/dist/index.browser.js +3 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +12 -0
- package/dist/stega.browser.d.ts +12 -0
- package/dist/stega.d.cts +12 -0
- package/dist/stega.d.ts +12 -0
- package/package.json +1 -1
- package/src/http/requestOptions.ts +4 -0
- package/src/types.ts +14 -0
- package/umd/sanityClient.js +3 -1
- package/umd/sanityClient.min.js +1 -1
package/dist/index.cjs
CHANGED
|
@@ -568,7 +568,9 @@ class ObservableTransaction extends BaseTransaction {
|
|
|
568
568
|
}
|
|
569
569
|
const projectHeader = "X-Sanity-Project-ID";
|
|
570
570
|
function requestOptions(config2, overrides = {}) {
|
|
571
|
-
const headers = {}
|
|
571
|
+
const headers = {};
|
|
572
|
+
config2.headers && Object.assign(headers, config2.headers);
|
|
573
|
+
const token = overrides.token || config2.token;
|
|
572
574
|
token && (headers.Authorization = `Bearer ${token}`), !overrides.useGlobalApi && !config2.useProjectHostname && config2.projectId && (headers[projectHeader] = config2.projectId);
|
|
573
575
|
const withCredentials = !!(typeof overrides.withCredentials > "u" ? config2.withCredentials : overrides.withCredentials), timeout = typeof overrides.timeout > "u" ? config2.timeout : overrides.timeout;
|
|
574
576
|
return Object.assign({}, overrides, {
|
|
@@ -2401,7 +2403,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2401
2403
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2402
2404
|
};
|
|
2403
2405
|
}
|
|
2404
|
-
var name = "@sanity/client", version = "7.
|
|
2406
|
+
var name = "@sanity/client", version = "7.3.0";
|
|
2405
2407
|
const middleware = [
|
|
2406
2408
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2407
2409
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|