@sanity/client 6.5.1-canary.0 → 6.7.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.d.ts CHANGED
@@ -320,7 +320,7 @@ export declare interface ClientConfig {
320
320
  /**
321
321
  * Adds a `resultSourceMap` key to the API response, with the type `ContentSourceMap`
322
322
  */
323
- resultSourceMap?: boolean
323
+ resultSourceMap?: boolean | 'withKeyArraySelector'
324
324
  /**
325
325
  *@deprecated set `cache` and `next` options on `client.fetch` instead
326
326
  */
@@ -347,8 +347,15 @@ export declare interface ContentSourceMap {
347
347
  }
348
348
 
349
349
  /** @public */
350
- export declare interface ContentSourceMapDocument {
350
+ export declare interface ContentSourceMapDocument extends ContentSourceMapDocumentBase {
351
+ _projectId?: undefined
352
+ _dataset?: undefined
353
+ }
354
+
355
+ /** @public */
356
+ export declare interface ContentSourceMapDocumentBase {
351
357
  _id: string
358
+ _type: string
352
359
  }
353
360
 
354
361
  /** @public */
@@ -385,7 +392,7 @@ export declare type ContentSourceMapMappings = Record<string, ContentSourceMapMa
385
392
  export declare type ContentSourceMapPaths = string[]
386
393
 
387
394
  /** @public */
388
- export declare interface ContentSourceMapRemoteDocument extends ContentSourceMapDocument {
395
+ export declare interface ContentSourceMapRemoteDocument extends ContentSourceMapDocumentBase {
389
396
  _projectId: string
390
397
  _dataset: string
391
398
  }
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.5.1-canary.0";
7
+ var version = "6.7.0";
8
8
  const middleware = [debug({
9
9
  verbose: true,
10
10
  namespace: "sanity:client"
@@ -988,9 +988,10 @@ function _requestObservable(client, httpRequest, options) {
988
988
  };
989
989
  }
990
990
  if (["GET", "HEAD", "POST"].indexOf(options.method || "GET") >= 0 && uri.indexOf("/data/query/") === 0) {
991
- if ((_a = options.resultSourceMap) != null ? _a : config.resultSourceMap) {
991
+ const resultSourceMap = (_a = options.resultSourceMap) != null ? _a : config.resultSourceMap;
992
+ if (resultSourceMap !== void 0 && resultSourceMap !== false) {
992
993
  options.query = {
993
- resultSourceMap: true,
994
+ resultSourceMap,
994
995
  ...options.query
995
996
  };
996
997
  }