@sanity/client 6.2.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 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.2.0";
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, {
@@ -1468,12 +1481,10 @@ class ObservableProjectsClient {
1468
1481
  __privateSet$2(this, _client$1, client);
1469
1482
  __privateSet$2(this, _httpRequest$2, httpRequest);
1470
1483
  }
1471
- /**
1472
- * Fetch a list of projects the authenticated user has access to
1473
- */
1474
- list() {
1484
+ list(options) {
1485
+ const uri = (options == null ? void 0 : options.includeMembers) === false ? "/projects?includeMembers=false" : "/projects";
1475
1486
  return _request(__privateGet$2(this, _client$1), __privateGet$2(this, _httpRequest$2), {
1476
- uri: "/projects"
1487
+ uri
1477
1488
  });
1478
1489
  }
1479
1490
  /**
@@ -1496,12 +1507,10 @@ class ProjectsClient {
1496
1507
  __privateSet$2(this, _client2$1, client);
1497
1508
  __privateSet$2(this, _httpRequest2$2, httpRequest);
1498
1509
  }
1499
- /**
1500
- * Fetch a list of projects the authenticated user has access to
1501
- */
1502
- list() {
1510
+ list(options) {
1511
+ const uri = (options == null ? void 0 : options.includeMembers) === false ? "/projects?includeMembers=false" : "/projects";
1503
1512
  return rxjs.lastValueFrom(_request(__privateGet$2(this, _client2$1), __privateGet$2(this, _httpRequest2$2), {
1504
- uri: "/projects"
1513
+ uri
1505
1514
  }));
1506
1515
  }
1507
1516
  /**