@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/README.md +5 -3
- package/dist/_chunks-cjs/resolveEditInfo.cjs +1 -1
- package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +8 -10
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
- package/dist/_chunks-es/resolveEditInfo.js +1 -1
- package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +8 -10
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
- package/dist/index.browser.cjs +175 -209
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +6 -2
- package/dist/index.browser.d.ts +6 -2
- package/dist/index.browser.js +175 -210
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +176 -210
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +176 -211
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/data/encodeQueryString.ts +4 -1
- package/src/data/listen.ts +1 -0
- package/src/types.ts +7 -0
- package/umd/sanityClient.js +194 -965
- package/umd/sanityClient.min.js +2 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "6.21.
|
|
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.
|
|
121
|
+
"get-it": "^8.6.4",
|
|
122
122
|
"rxjs": "^7.0.0"
|
|
123
123
|
},
|
|
124
124
|
"devDependencies": {
|
|
125
|
-
"@edge-runtime/types": "^3.0.
|
|
126
|
-
"@edge-runtime/vm": "^4.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
|
|
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.
|
|
133
|
-
"@typescript-eslint/parser": "^7.
|
|
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": "
|
|
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
|
|
139
|
-
"eslint-plugin-simple-import-sort": "^12.1.
|
|
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.
|
|
144
|
-
"next": "^14.2.
|
|
143
|
+
"ls-engines": "^0.9.3",
|
|
144
|
+
"next": "^14.2.5",
|
|
145
145
|
"nock": "^13.5.4",
|
|
146
|
-
"prettier": "^3.3.
|
|
147
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
146
|
+
"prettier": "^3.3.3",
|
|
147
|
+
"prettier-plugin-packagejson": "^2.5.1",
|
|
148
148
|
"rimraf": "^5.0.7",
|
|
149
|
-
"rollup": "^4.
|
|
149
|
+
"rollup": "^4.20.0",
|
|
150
150
|
"sse-channel": "^4.0.0",
|
|
151
|
-
"terser": "^5.31.
|
|
152
|
-
"typescript": "5.
|
|
153
|
-
"vitest": "
|
|
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
|
}
|
package/src/data/listen.ts
CHANGED
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,
|