@sanity/client 6.21.0 → 6.21.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/README.md +2 -0
- package/dist/index.browser.cjs +3 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +6 -0
- package/dist/index.browser.d.ts +6 -0
- package/dist/index.browser.js +3 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/data/encodeQueryString.ts +4 -1
- package/src/data/listen.ts +1 -0
- package/src/types.ts +7 -0
- package/umd/sanityClient.js +3 -2
- package/umd/sanityClient.min.js +1 -1
package/dist/index.browser.d.cts
CHANGED
|
@@ -859,6 +859,12 @@ export declare interface ListenOptions {
|
|
|
859
859
|
* @defaultValue `true`
|
|
860
860
|
*/
|
|
861
861
|
includeResult?: boolean
|
|
862
|
+
/**
|
|
863
|
+
* Whether or not to include the mutations that was performed.
|
|
864
|
+
* If you do not need the mutations, set this to `false` to reduce bandwidth usage.
|
|
865
|
+
* @defaultValue `true`
|
|
866
|
+
*/
|
|
867
|
+
includeMutations?: boolean
|
|
862
868
|
/**
|
|
863
869
|
* Whether or not to include the document as it looked before the mutation event.
|
|
864
870
|
* The previous revision will be available on the `.previous` property of the events,
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -859,6 +859,12 @@ export declare interface ListenOptions {
|
|
|
859
859
|
* @defaultValue `true`
|
|
860
860
|
*/
|
|
861
861
|
includeResult?: boolean
|
|
862
|
+
/**
|
|
863
|
+
* Whether or not to include the mutations that was performed.
|
|
864
|
+
* If you do not need the mutations, set this to `false` to reduce bandwidth usage.
|
|
865
|
+
* @defaultValue `true`
|
|
866
|
+
*/
|
|
867
|
+
includeMutations?: boolean
|
|
862
868
|
/**
|
|
863
869
|
* Whether or not to include the document as it looked before the mutation event.
|
|
864
870
|
* The previous revision will be available on the `.previous` property of the events,
|
package/dist/index.browser.js
CHANGED
|
@@ -594,13 +594,13 @@ const encodeQueryString = ({
|
|
|
594
594
|
params = {},
|
|
595
595
|
options = {}
|
|
596
596
|
}) => {
|
|
597
|
-
const searchParams = new URLSearchParams(), { tag, returnQuery, ...opts } = options;
|
|
597
|
+
const searchParams = new URLSearchParams(), { tag, includeMutations, returnQuery, ...opts } = options;
|
|
598
598
|
tag && searchParams.append("tag", tag), searchParams.append("query", query);
|
|
599
599
|
for (const [key, value] of Object.entries(params))
|
|
600
600
|
searchParams.append(`$${key}`, JSON.stringify(value));
|
|
601
601
|
for (const [key, value] of Object.entries(opts))
|
|
602
602
|
value && searchParams.append(key, `${value}`);
|
|
603
|
-
return returnQuery === !1 && searchParams.append("returnQuery", "false"), `?${searchParams}`;
|
|
603
|
+
return returnQuery === !1 && searchParams.append("returnQuery", "false"), includeMutations === !1 && searchParams.append("includeMutations", "false"), `?${searchParams}`;
|
|
604
604
|
}, excludeFalsey = (param, defValue) => param === !1 ? void 0 : typeof param > "u" ? defValue : param, getMutationQuery = (options = {}) => ({
|
|
605
605
|
dryRun: options.dryRun,
|
|
606
606
|
returnIds: !0,
|
|
@@ -859,6 +859,7 @@ var defaults = (obj, defaults2) => Object.keys(defaults2).concat(Object.keys(obj
|
|
|
859
859
|
const pick = (obj, props) => props.reduce((selection, prop) => (typeof obj[prop] > "u" || (selection[prop] = obj[prop]), selection), {}), MAX_URL_LENGTH = 14800, possibleOptions = [
|
|
860
860
|
"includePreviousRevision",
|
|
861
861
|
"includeResult",
|
|
862
|
+
"includeMutations",
|
|
862
863
|
"visibility",
|
|
863
864
|
"effectFormat",
|
|
864
865
|
"tag"
|