@sanity/client 7.24.0 → 7.26.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 +42 -1
- package/dist/_chunks-cjs/stegaClean.cjs.map +1 -1
- package/dist/_chunks-es/stegaClean.js.map +1 -1
- package/dist/index.browser.cjs +7 -20
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +7 -20
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +8 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -21
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.cjs +4 -0
- package/dist/stega.browser.cjs.map +1 -1
- package/dist/stega.browser.d.cts +150 -1
- package/dist/stega.browser.d.ts +150 -1
- package/dist/stega.browser.js +4 -0
- package/dist/stega.browser.js.map +1 -1
- package/dist/stega.cjs +4 -0
- package/dist/stega.cjs.map +1 -1
- package/dist/stega.d.cts +150 -1
- package/dist/stega.d.ts +150 -1
- package/dist/stega.js +4 -0
- package/dist/stega.js.map +1 -1
- package/package.json +2 -1
- package/src/data/dataMethods.ts +16 -30
- package/src/stega/index.ts +2 -1
- package/src/stega/stegaBrand.ts +111 -0
- package/src/stega/stegaClean.ts +23 -2
- package/umd/sanityClient.js +7 -20
- package/umd/sanityClient.min.js +1 -1
package/dist/index.cjs
CHANGED
|
@@ -992,23 +992,13 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
992
992
|
}, (Array.isArray(perspectiveOption) && perspectiveOption.length > 0 || // previewDrafts was renamed to drafts, but keep for backwards compat
|
|
993
993
|
perspectiveOption === "previewDrafts" || perspectiveOption === "drafts") && useCdn && (useCdn = !1, config.printCdnPreviewDraftsWarning()));
|
|
994
994
|
const variantOption = options.variant || config$1.variant;
|
|
995
|
-
|
|
995
|
+
typeof variantOption == "string" && (options.query = {
|
|
996
996
|
variant: variantOption,
|
|
997
997
|
...options.query
|
|
998
|
-
}), typeof variantOption == "object"
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
console.warn(
|
|
1003
|
-
`The Sanity client's beta \`variant\` option currently only supports one condition. Dropped: ${formatter.format(variantConditions.slice(1).map(([subject]) => JSON.stringify(subject)))}.`
|
|
1004
|
-
);
|
|
1005
|
-
}
|
|
1006
|
-
options.query = {
|
|
1007
|
-
...Object.fromEntries(searchParams),
|
|
1008
|
-
...options.query
|
|
1009
|
-
};
|
|
1010
|
-
}
|
|
1011
|
-
options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
|
|
998
|
+
}), typeof variantOption == "object" && (options.query = {
|
|
999
|
+
variantCondition: variantConditionsToQueryArray(variantOption),
|
|
1000
|
+
...options.query
|
|
1001
|
+
}), options.lastLiveEventId && (options.query = { ...options.query, lastLiveEventId: options.lastLiveEventId }), options.returnQuery === !1 && (options.query = { returnQuery: "false", ...options.query }), useCdn && options.cacheMode == "noStale" && (options.query = { cacheMode: "noStale", ...options.query });
|
|
1012
1002
|
}
|
|
1013
1003
|
const reqOptions = requestOptions(
|
|
1014
1004
|
config$1,
|
|
@@ -1083,11 +1073,8 @@ const resourceDataBase = (config2) => {
|
|
|
1083
1073
|
throw new Error(`Unsupported resource type: ${type.toString()}`);
|
|
1084
1074
|
}
|
|
1085
1075
|
};
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1088
|
-
"variantCondition",
|
|
1089
|
-
`${condition}:${value}`
|
|
1090
|
-
]);
|
|
1076
|
+
function variantConditionsToQueryArray(variantConditions) {
|
|
1077
|
+
return Object.entries(variantConditions).map(([condition, value]) => `${condition}:${value}`).toSorted();
|
|
1091
1078
|
}
|
|
1092
1079
|
function _generate(client, httpRequest, request) {
|
|
1093
1080
|
const dataset = config.hasDataset(client.config());
|
|
@@ -2893,7 +2880,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2893
2880
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
2894
2881
|
};
|
|
2895
2882
|
}
|
|
2896
|
-
var name = "@sanity/client", version = "7.
|
|
2883
|
+
var name = "@sanity/client", version = "7.26.0";
|
|
2897
2884
|
const middleware = [
|
|
2898
2885
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2899
2886
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|