@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/dist/index.cjs
CHANGED
|
@@ -8,12 +8,25 @@ var getIt = require('get-it');
|
|
|
8
8
|
var rxjs = require('rxjs');
|
|
9
9
|
var operators = require('rxjs/operators');
|
|
10
10
|
var name = "@sanity/client";
|
|
11
|
-
var version = "6.
|
|
11
|
+
var version = "6.4.0";
|
|
12
12
|
const middleware = [middleware$1.debug({
|
|
13
13
|
verbose: true,
|
|
14
14
|
namespace: "sanity:client"
|
|
15
15
|
}), middleware$1.headers({
|
|
16
16
|
"User-Agent": "".concat(name, " ").concat(version)
|
|
17
|
+
}),
|
|
18
|
+
// Enable keep-alive, and in addition limit the number of sockets that can be opened.
|
|
19
|
+
// This avoids opening too many connections to the server if someone tries to execute
|
|
20
|
+
// a bunch of requests in parallel. It's recommended to have a concurrency limit
|
|
21
|
+
// at a "higher limit" (i.e. you shouldn't actually execute hundreds of requests in parallel),
|
|
22
|
+
// and this is mainly to minimize the impact for the network and server.
|
|
23
|
+
//
|
|
24
|
+
// We're currently matching the same defaults as browsers:
|
|
25
|
+
// https://stackoverflow.com/questions/26003756/is-there-a-limit-practical-or-otherwise-to-the-number-of-web-sockets-a-page-op
|
|
26
|
+
middleware$1.agent({
|
|
27
|
+
keepAlive: true,
|
|
28
|
+
maxSockets: 30,
|
|
29
|
+
maxTotalSockets: 256
|
|
17
30
|
})];
|
|
18
31
|
var __defProp$3 = Object.defineProperty;
|
|
19
32
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, {
|