@sanity/client 6.1.1 → 6.1.3-perspective.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/README.md +159 -0
- 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 -3
- 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 -3
- package/umd/sanityClient.js +69 -69
- package/umd/sanityClient.min.js +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -283,7 +283,8 @@ export declare interface ClientConfig {
|
|
|
283
283
|
/** @defaultValue true */
|
|
284
284
|
useCdn?: boolean
|
|
285
285
|
token?: string
|
|
286
|
-
|
|
286
|
+
/** @defaultValue 'raw' */
|
|
287
|
+
perspective?: 'previewDrafts' | 'published' | 'raw'
|
|
287
288
|
apiHost?: string
|
|
288
289
|
apiVersion?: string
|
|
289
290
|
proxy?: string
|
|
@@ -1498,10 +1499,10 @@ export declare type QueryParams = {
|
|
|
1498
1499
|
|
|
1499
1500
|
/** @public */
|
|
1500
1501
|
export declare interface RawQueryResponse<R> {
|
|
1501
|
-
|
|
1502
|
+
query: string
|
|
1502
1503
|
ms: number
|
|
1503
1504
|
result: R
|
|
1504
|
-
resultSourceMap
|
|
1505
|
+
resultSourceMap?: ContentSourceMap
|
|
1505
1506
|
}
|
|
1506
1507
|
|
|
1507
1508
|
/** @internal */
|
|
@@ -2059,6 +2060,10 @@ export declare type SanityDocument<T extends Record<string, Any> = Record<string
|
|
|
2059
2060
|
_type: string
|
|
2060
2061
|
_createdAt: string
|
|
2061
2062
|
_updatedAt: string
|
|
2063
|
+
/**
|
|
2064
|
+
* Present when `perspective` is set to `previewDrafts`
|
|
2065
|
+
*/
|
|
2066
|
+
_originalId?: string
|
|
2062
2067
|
}
|
|
2063
2068
|
|
|
2064
2069
|
/** @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-perspective.0";
|
|
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
|