@sanity/client 6.24.0 → 6.24.2-canary.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/_chunks-cjs/resolveEditInfo.cjs +1 -2
- package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaClean.cjs +1 -2
- package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +1 -2
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
- package/dist/_chunks-es/resolveEditInfo.js +1 -2
- package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
- package/dist/_chunks-es/stegaClean.js +1 -2
- package/dist/_chunks-es/stegaClean.js.map +1 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +1 -2
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
- package/dist/csm.cjs +1 -2
- package/dist/csm.cjs.map +1 -1
- package/dist/csm.d.cts +99 -34
- package/dist/csm.d.ts +99 -34
- package/dist/csm.js +1 -2
- package/dist/csm.js.map +1 -1
- package/dist/index.browser.cjs +4 -4
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +6 -5
- package/dist/index.browser.d.ts +6 -5
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +3312 -98
- package/dist/stega.browser.d.ts +3312 -98
- package/dist/stega.d.cts +3312 -98
- package/dist/stega.d.ts +3312 -98
- package/package.json +16 -16
- package/src/config.ts +3 -1
- package/src/csm/types.ts +1 -1
- package/src/http/request.ts +1 -1
- package/src/index.browser.ts +1 -1
- package/src/index.ts +1 -1
- package/src/stega/stegaEncodeSourceMap.ts +5 -1
- package/src/util/pick.ts +1 -1
- package/src/warnings.ts +1 -1
- package/umd/sanityClient.js +102 -117
- package/umd/sanityClient.min.js +2 -2
package/dist/index.browser.cjs
CHANGED
|
@@ -116,8 +116,7 @@ function defineHttpRequest(envMiddleware2) {
|
|
|
116
116
|
]);
|
|
117
117
|
}
|
|
118
118
|
function shouldRetry(err, attempt, options) {
|
|
119
|
-
if (options.maxRetries === 0)
|
|
120
|
-
return !1;
|
|
119
|
+
if (options.maxRetries === 0) return !1;
|
|
121
120
|
const isSafe = options.method === "GET" || options.method === "HEAD", isQuery = (options.uri || options.url).startsWith("/data/query"), isRetriableResponse = err.response && (err.response.statusCode === 429 || err.response.statusCode === 502 || err.response.statusCode === 503);
|
|
122
121
|
return (isSafe || isQuery) && isRetriableResponse ? !0 : middleware.retry.shouldRetry(err, attempt, options);
|
|
123
122
|
}
|
|
@@ -207,7 +206,7 @@ function validateApiVersion(apiVersion) {
|
|
|
207
206
|
if (!(/^\d{4}-\d{2}-\d{2}$/.test(apiVersion) && apiDate instanceof Date && apiDate.getTime() > 0))
|
|
208
207
|
throw new Error("Invalid API version string, expected `1` or date in format `YYYY-MM-DD`");
|
|
209
208
|
}
|
|
210
|
-
|
|
209
|
+
function validateApiPerspective(perspective) {
|
|
211
210
|
if (Array.isArray(perspective)) {
|
|
212
211
|
for (const perspectiveValue of perspective)
|
|
213
212
|
if (perspectiveValue !== "published" && perspectiveValue !== "drafts" && !(typeof perspectiveValue == "string" && perspectiveValue.startsWith("r") && perspectiveValue !== "raw"))
|
|
@@ -227,7 +226,8 @@ const validateApiPerspective = function(perspective) {
|
|
|
227
226
|
"Invalid API perspective string, expected `published`, `previewDrafts` or `raw`"
|
|
228
227
|
);
|
|
229
228
|
}
|
|
230
|
-
}
|
|
229
|
+
}
|
|
230
|
+
const initConfig = (config, prevConfig) => {
|
|
231
231
|
const specifiedConfig = {
|
|
232
232
|
...prevConfig,
|
|
233
233
|
...config,
|