@sanity/client 6.2.0-fetch.0 → 6.2.0-fetch.1

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.d.ts CHANGED
@@ -315,6 +315,10 @@ export declare interface ClientConfig {
315
315
  * Adds a `resultSourceMap` key to the API response, with the type `ContentSourceMap`
316
316
  */
317
317
  resultSourceMap?: boolean
318
+ /**
319
+ * Experimental, opts-in to using native `fetch` as transport in order to make full use of React Server Components
320
+ */
321
+ fetch?: RequestFetchOptions | boolean
318
322
  }
319
323
 
320
324
  /** @public */
@@ -1537,6 +1541,15 @@ export declare type ReconnectEvent = {
1537
1541
  /** @public */
1538
1542
  export declare const requester: Requester
1539
1543
 
1544
+ /**
1545
+ * Options for the native `fetch` feature, used by the Next.js app-router
1546
+ * @public
1547
+ */
1548
+ export declare interface RequestFetchOptions<T = 'next'> {
1549
+ cache?: RequestInit['cache']
1550
+ next?: T extends keyof RequestInit ? RequestInit[T] : never
1551
+ }
1552
+
1540
1553
  /** @internal */
1541
1554
  export declare interface RequestObservableOptions extends Omit<RequestOptions, 'url'> {
1542
1555
  url?: string
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ export { adapter as unstable__adapter, environment as unstable__environment } fr
4
4
  import { Observable, lastValueFrom } from 'rxjs';
5
5
  import { map, filter } from 'rxjs/operators';
6
6
  var name = "@sanity/client";
7
- var version = "6.2.0-fetch.0";
7
+ var version = "6.2.0-fetch.1";
8
8
  const middleware = [debug({
9
9
  verbose: true,
10
10
  namespace: "sanity:client"
@@ -163,7 +163,8 @@ function requestOptions(config) {
163
163
  timeout: typeof timeout === "undefined" ? 5 * 60 * 1e3 : timeout,
164
164
  proxy: overrides.proxy || config.proxy,
165
165
  json: true,
166
- withCredentials
166
+ withCredentials,
167
+ fetch: overrides.fetch || config.fetch
167
168
  });
168
169
  }
169
170
  function getSelection(sel) {