@sanity/client 6.3.0 → 6.4.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/dist/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
- package/src/http/nodeMiddleware.ts +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@sanity/eventsource": "^5.0.0",
|
|
95
|
-
"get-it": "^8.
|
|
95
|
+
"get-it": "^8.3.0",
|
|
96
96
|
"rxjs": "^7.0.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"@sanity/pkg-utils": "^2.3.9",
|
|
104
104
|
"@sanity/semantic-release-preset": "^4.1.2",
|
|
105
105
|
"@types/node": "^20.4.5",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^6.2.
|
|
107
|
-
"@typescript-eslint/parser": "^6.2.
|
|
108
|
-
"@vitest/coverage-v8": "^0.
|
|
109
|
-
"eslint": "^8.
|
|
110
|
-
"eslint-config-prettier": "^8.
|
|
106
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
107
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
108
|
+
"@vitest/coverage-v8": "^0.34.1",
|
|
109
|
+
"eslint": "^8.46.0",
|
|
110
|
+
"eslint-config-prettier": "^8.9.0",
|
|
111
111
|
"eslint-plugin-prettier": "^5.0.0",
|
|
112
112
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
113
113
|
"faucet": "^0.0.4",
|
|
@@ -117,11 +117,11 @@
|
|
|
117
117
|
"prettier": "^3.0.0",
|
|
118
118
|
"prettier-plugin-packagejson": "^2.4.5",
|
|
119
119
|
"rimraf": "^5.0.1",
|
|
120
|
-
"rollup": "^3.
|
|
120
|
+
"rollup": "^3.27.0",
|
|
121
121
|
"sse-channel": "^4.0.0",
|
|
122
122
|
"terser": "^5.19.2",
|
|
123
123
|
"typescript": "^5.1.6",
|
|
124
|
-
"vitest": "^0.
|
|
124
|
+
"vitest": "^0.34.1",
|
|
125
125
|
"vitest-github-actions-reporter": "^0.10.0"
|
|
126
126
|
},
|
|
127
127
|
"engines": {
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import {debug, headers} from 'get-it/middleware'
|
|
1
|
+
import {agent, debug, headers} from 'get-it/middleware'
|
|
2
2
|
|
|
3
3
|
import {name, version} from '../../package.json'
|
|
4
4
|
|
|
5
5
|
const middleware = [
|
|
6
6
|
debug({verbose: true, namespace: 'sanity:client'}),
|
|
7
7
|
headers({'User-Agent': `${name} ${version}`}),
|
|
8
|
+
|
|
9
|
+
// Enable keep-alive, and in addition limit the number of sockets that can be opened.
|
|
10
|
+
// This avoids opening too many connections to the server if someone tries to execute
|
|
11
|
+
// a bunch of requests in parallel. It's recommended to have a concurrency limit
|
|
12
|
+
// at a "higher limit" (i.e. you shouldn't actually execute hundreds of requests in parallel),
|
|
13
|
+
// and this is mainly to minimize the impact for the network and server.
|
|
14
|
+
//
|
|
15
|
+
// We're currently matching the same defaults as browsers:
|
|
16
|
+
// https://stackoverflow.com/questions/26003756/is-there-a-limit-practical-or-otherwise-to-the-number-of-web-sockets-a-page-op
|
|
17
|
+
agent({
|
|
18
|
+
keepAlive: true,
|
|
19
|
+
maxSockets: 30,
|
|
20
|
+
maxTotalSockets: 256,
|
|
21
|
+
}),
|
|
8
22
|
]
|
|
9
23
|
|
|
10
24
|
export default middleware
|