@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.js
CHANGED
|
@@ -978,23 +978,13 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
978
978
|
}, (Array.isArray(perspectiveOption) && perspectiveOption.length > 0 || // previewDrafts was renamed to drafts, but keep for backwards compat
|
|
979
979
|
perspectiveOption === "previewDrafts" || perspectiveOption === "drafts") && useCdn && (useCdn = !1, printCdnPreviewDraftsWarning()));
|
|
980
980
|
const variantOption = options.variant || config.variant;
|
|
981
|
-
|
|
981
|
+
typeof variantOption == "string" && (options.query = {
|
|
982
982
|
variant: variantOption,
|
|
983
983
|
...options.query
|
|
984
|
-
}), typeof variantOption == "object"
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
console.warn(
|
|
989
|
-
`The Sanity client's beta \`variant\` option currently only supports one condition. Dropped: ${formatter.format(variantConditions.slice(1).map(([subject]) => JSON.stringify(subject)))}.`
|
|
990
|
-
);
|
|
991
|
-
}
|
|
992
|
-
options.query = {
|
|
993
|
-
...Object.fromEntries(searchParams),
|
|
994
|
-
...options.query
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
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 });
|
|
984
|
+
}), typeof variantOption == "object" && (options.query = {
|
|
985
|
+
variantCondition: variantConditionsToQueryArray(variantOption),
|
|
986
|
+
...options.query
|
|
987
|
+
}), 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
988
|
}
|
|
999
989
|
const reqOptions = requestOptions(
|
|
1000
990
|
config,
|
|
@@ -1069,11 +1059,8 @@ const resourceDataBase = (config) => {
|
|
|
1069
1059
|
throw new Error(`Unsupported resource type: ${type.toString()}`);
|
|
1070
1060
|
}
|
|
1071
1061
|
};
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1074
|
-
"variantCondition",
|
|
1075
|
-
`${condition}:${value}`
|
|
1076
|
-
]);
|
|
1062
|
+
function variantConditionsToQueryArray(variantConditions) {
|
|
1063
|
+
return Object.entries(variantConditions).map(([condition, value]) => `${condition}:${value}`).toSorted();
|
|
1077
1064
|
}
|
|
1078
1065
|
function _generate(client, httpRequest, request) {
|
|
1079
1066
|
const dataset2 = hasDataset(client.config());
|
|
@@ -2879,7 +2866,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
2879
2866
|
return printNoDefaultExport(), createClient2(config);
|
|
2880
2867
|
};
|
|
2881
2868
|
}
|
|
2882
|
-
var name = "@sanity/client", version = "7.
|
|
2869
|
+
var name = "@sanity/client", version = "7.26.0";
|
|
2883
2870
|
const middleware = [
|
|
2884
2871
|
debug({ verbose: !0, namespace: "sanity:client" }),
|
|
2885
2872
|
headers({ "User-Agent": `${name} ${version}` }),
|