@sanity/client 6.0.1 → 6.1.0-scope.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.browser.cjs +6 -0
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +6 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/data/dataMethods.ts +4 -0
- package/src/types.ts +9 -0
- package/umd/sanityClient.js +6 -0
- package/umd/sanityClient.min.js +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -310,7 +310,15 @@ export declare interface ClientConfig {
|
|
|
310
310
|
* @deprecated Don't use
|
|
311
311
|
*/
|
|
312
312
|
requester?: Requester
|
|
313
|
+
/**
|
|
314
|
+
* Adds a `resultSourceMap` key to the API response, with the type `ContentSourceMap`
|
|
315
|
+
*/
|
|
313
316
|
resultSourceMap?: boolean
|
|
317
|
+
/**
|
|
318
|
+
* Experimental, requires apiHost: 'https://api.sanity.work'.
|
|
319
|
+
* @alpha
|
|
320
|
+
*/
|
|
321
|
+
scope?: 'published' | 'previewDrafts'
|
|
314
322
|
}
|
|
315
323
|
|
|
316
324
|
/** @public */
|
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.0.
|
|
7
|
+
var version = "6.1.0-scope.0";
|
|
8
8
|
const middleware = [debug({
|
|
9
9
|
verbose: true,
|
|
10
10
|
namespace: "sanity:client"
|
|
@@ -843,6 +843,12 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
843
843
|
...options.query
|
|
844
844
|
};
|
|
845
845
|
}
|
|
846
|
+
if (config.scope) {
|
|
847
|
+
options.query = {
|
|
848
|
+
scope: config.scope,
|
|
849
|
+
...options.query
|
|
850
|
+
};
|
|
851
|
+
}
|
|
846
852
|
const reqOptions = requestOptions(config, Object.assign({}, options, {
|
|
847
853
|
url: _getUrl(client, uri, useCdn)
|
|
848
854
|
}));
|