@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.
@@ -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,
@@ -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,
@@ -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"