@sanity/client 6.21.0 → 6.21.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "6.21.0",
3
+ "version": "6.21.2",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -118,39 +118,39 @@
118
118
  },
119
119
  "dependencies": {
120
120
  "@sanity/eventsource": "^5.0.2",
121
- "get-it": "^8.6.3",
121
+ "get-it": "^8.6.4",
122
122
  "rxjs": "^7.0.0"
123
123
  },
124
124
  "devDependencies": {
125
- "@edge-runtime/types": "^3.0.0",
126
- "@edge-runtime/vm": "^4.0.0",
125
+ "@edge-runtime/types": "^3.0.1",
126
+ "@edge-runtime/vm": "^4.0.1",
127
127
  "@rollup/plugin-commonjs": "^26.0.1",
128
128
  "@rollup/plugin-node-resolve": "^15.2.3",
129
- "@sanity/pkg-utils": "^6.9.3",
129
+ "@sanity/pkg-utils": "^6.10.9",
130
130
  "@types/json-diff": "^1.0.3",
131
131
  "@types/node": "^20.8.8",
132
- "@typescript-eslint/eslint-plugin": "^7.13.1",
133
- "@typescript-eslint/parser": "^7.13.1",
132
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
133
+ "@typescript-eslint/parser": "^7.18.0",
134
134
  "@vercel/stega": "0.1.2",
135
- "@vitest/coverage-v8": "1.6.0",
135
+ "@vitest/coverage-v8": "2.0.5",
136
136
  "eslint": "^8.57.0",
137
137
  "eslint-config-prettier": "^9.1.0",
138
- "eslint-plugin-prettier": "^5.1.3",
139
- "eslint-plugin-simple-import-sort": "^12.1.0",
138
+ "eslint-plugin-prettier": "^5.2.1",
139
+ "eslint-plugin-simple-import-sort": "^12.1.1",
140
140
  "faucet": "^0.0.4",
141
141
  "happy-dom": "^12.10.3",
142
142
  "json-diff": "^1.0.6",
143
- "ls-engines": "^0.9.2",
144
- "next": "^14.2.4",
143
+ "ls-engines": "^0.9.3",
144
+ "next": "^14.2.5",
145
145
  "nock": "^13.5.4",
146
- "prettier": "^3.3.2",
147
- "prettier-plugin-packagejson": "^2.5.0",
146
+ "prettier": "^3.3.3",
147
+ "prettier-plugin-packagejson": "^2.5.1",
148
148
  "rimraf": "^5.0.7",
149
- "rollup": "^4.18.0",
149
+ "rollup": "^4.20.0",
150
150
  "sse-channel": "^4.0.0",
151
- "terser": "^5.31.1",
152
- "typescript": "5.4.5",
153
- "vitest": "1.6.0",
151
+ "terser": "^5.31.5",
152
+ "typescript": "5.5.3",
153
+ "vitest": "2.0.5",
154
154
  "vitest-github-actions-reporter": "0.11.1"
155
155
  },
156
156
  "engines": {
@@ -11,7 +11,7 @@ export const encodeQueryString = ({
11
11
  }) => {
12
12
  const searchParams = new URLSearchParams()
13
13
  // We generally want tag at the start of the query string
14
- const {tag, returnQuery, ...opts} = options
14
+ const {tag, includeMutations, returnQuery, ...opts} = options
15
15
  // We're using `append` instead of `set` to support React Native: https://github.com/facebook/react-native/blob/1982c4722fcc51aa87e34cf562672ee4aff540f1/packages/react-native/Libraries/Blob/URL.js#L86-L88
16
16
  if (tag) searchParams.append('tag', tag)
17
17
  searchParams.append('query', query)
@@ -29,5 +29,8 @@ export const encodeQueryString = ({
29
29
  // `returnQuery` is default `true`, so needs an explicit `false` handling
30
30
  if (returnQuery === false) searchParams.append('returnQuery', 'false')
31
31
 
32
+ // `includeMutations` is default `true`, so needs an explicit `false` handling
33
+ if (includeMutations === false) searchParams.append('includeMutations', 'false')
34
+
32
35
  return `?${searchParams}`
33
36
  }
@@ -15,6 +15,7 @@ const MAX_URL_LENGTH = 16000 - 1200
15
15
  const possibleOptions = [
16
16
  'includePreviousRevision',
17
17
  'includeResult',
18
+ 'includeMutations',
18
19
  'visibility',
19
20
  'effectFormat',
20
21
  'tag',
package/src/types.ts CHANGED
@@ -874,6 +874,13 @@ export interface ListenOptions {
874
874
  */
875
875
  includeResult?: boolean
876
876
 
877
+ /**
878
+ * Whether or not to include the mutations that was performed.
879
+ * If you do not need the mutations, set this to `false` to reduce bandwidth usage.
880
+ * @defaultValue `true`
881
+ */
882
+ includeMutations?: boolean
883
+
877
884
  /**
878
885
  * Whether or not to include the document as it looked before the mutation event.
879
886
  * The previous revision will be available on the `.previous` property of the events,