@sanity/client 6.1.2 → 6.1.3
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 +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
- package/src/data/dataMethods.ts +1 -1
- package/src/types.ts +8 -1
- package/umd/sanityClient.js +69 -69
- package/umd/sanityClient.min.js +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -283,7 +283,7 @@ export declare interface ClientConfig {
|
|
|
283
283
|
/** @defaultValue true */
|
|
284
284
|
useCdn?: boolean
|
|
285
285
|
token?: string
|
|
286
|
-
perspective?:
|
|
286
|
+
perspective?: ClientPerspective
|
|
287
287
|
apiHost?: string
|
|
288
288
|
apiVersion?: string
|
|
289
289
|
proxy?: string
|
|
@@ -326,6 +326,9 @@ export declare class ClientError extends Error {
|
|
|
326
326
|
constructor(res: Any)
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
/** @public */
|
|
330
|
+
export declare type ClientPerspective = 'previewDrafts' | 'published' | 'raw'
|
|
331
|
+
|
|
329
332
|
/** @public */
|
|
330
333
|
export declare interface ContentSourceMap {
|
|
331
334
|
mappings: ContentSourceMapMappings
|
|
@@ -2059,6 +2062,10 @@ export declare type SanityDocument<T extends Record<string, Any> = Record<string
|
|
|
2059
2062
|
_type: string
|
|
2060
2063
|
_createdAt: string
|
|
2061
2064
|
_updatedAt: string
|
|
2065
|
+
/**
|
|
2066
|
+
* Present when `perspective` is set to `previewDrafts`
|
|
2067
|
+
*/
|
|
2068
|
+
_originalId?: string
|
|
2062
2069
|
}
|
|
2063
2070
|
|
|
2064
2071
|
/** @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.1.
|
|
7
|
+
var version = "6.1.3";
|
|
8
8
|
const middleware = [debug({
|
|
9
9
|
verbose: true,
|
|
10
10
|
namespace: "sanity:client"
|
|
@@ -845,7 +845,7 @@ function _requestObservable(client, httpRequest, options) {
|
|
|
845
845
|
...options.query
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
|
-
if (typeof config.perspective === "string" && config.perspective !== "
|
|
848
|
+
if (typeof config.perspective === "string" && config.perspective !== "raw") {
|
|
849
849
|
options.query = {
|
|
850
850
|
perspective: config.perspective,
|
|
851
851
|
...options.query
|