@sanity/client 6.21.2 → 6.21.3-canary.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/_chunks-cjs/resolveEditInfo.cjs +1 -1
- package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +10 -8
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
- package/dist/_chunks-es/resolveEditInfo.js +1 -1
- package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +10 -8
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
- package/dist/index.browser.cjs +219 -174
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +12 -0
- package/dist/index.browser.d.ts +12 -0
- package/dist/index.browser.js +220 -174
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +220 -175
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +221 -175
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/SanityClient.ts +2 -2
- package/src/data/dataMethods.ts +14 -4
- package/src/types.ts +8 -0
- package/umd/sanityClient.js +980 -193
- package/umd/sanityClient.min.js +8 -2
package/package.json
CHANGED
package/src/SanityClient.ts
CHANGED
|
@@ -900,7 +900,7 @@ export class SanityClient {
|
|
|
900
900
|
*/
|
|
901
901
|
getDocument<R extends Record<string, Any> = Record<string, Any>>(
|
|
902
902
|
id: string,
|
|
903
|
-
options?: {tag?: string},
|
|
903
|
+
options?: {signal?: AbortSignal; tag?: string},
|
|
904
904
|
): Promise<SanityDocument<R> | undefined> {
|
|
905
905
|
return lastValueFrom(dataMethods._getDocument<R>(this, this.#httpRequest, id, options))
|
|
906
906
|
}
|
|
@@ -916,7 +916,7 @@ export class SanityClient {
|
|
|
916
916
|
*/
|
|
917
917
|
getDocuments<R extends Record<string, Any> = Record<string, Any>>(
|
|
918
918
|
ids: string[],
|
|
919
|
-
options?: {tag?: string},
|
|
919
|
+
options?: {signal?: AbortSignal; tag?: string},
|
|
920
920
|
): Promise<(SanityDocument<R> | null)[]> {
|
|
921
921
|
return lastValueFrom(dataMethods._getDocuments<R>(this, this.#httpRequest, ids, options))
|
|
922
922
|
}
|
package/src/data/dataMethods.ts
CHANGED
|
@@ -129,9 +129,14 @@ export function _getDocument<R extends Record<string, Any>>(
|
|
|
129
129
|
client: ObservableSanityClient | SanityClient,
|
|
130
130
|
httpRequest: HttpRequest,
|
|
131
131
|
id: string,
|
|
132
|
-
opts: {tag?: string} = {},
|
|
132
|
+
opts: {signal?: AbortSignal; tag?: string} = {},
|
|
133
133
|
): Observable<SanityDocument<R> | undefined> {
|
|
134
|
-
const options = {
|
|
134
|
+
const options = {
|
|
135
|
+
uri: _getDataUrl(client, 'doc', id),
|
|
136
|
+
json: true,
|
|
137
|
+
tag: opts.tag,
|
|
138
|
+
signal: opts.signal,
|
|
139
|
+
}
|
|
135
140
|
return _requestObservable<SanityDocument<R> | undefined>(client, httpRequest, options).pipe(
|
|
136
141
|
filter(isResponse),
|
|
137
142
|
map((event) => event.body.documents && event.body.documents[0]),
|
|
@@ -143,9 +148,14 @@ export function _getDocuments<R extends Record<string, Any>>(
|
|
|
143
148
|
client: ObservableSanityClient | SanityClient,
|
|
144
149
|
httpRequest: HttpRequest,
|
|
145
150
|
ids: string[],
|
|
146
|
-
opts: {tag?: string} = {},
|
|
151
|
+
opts: {signal?: AbortSignal; tag?: string} = {},
|
|
147
152
|
): Observable<(SanityDocument<R> | null)[]> {
|
|
148
|
-
const options = {
|
|
153
|
+
const options = {
|
|
154
|
+
uri: _getDataUrl(client, 'doc', ids.join(',')),
|
|
155
|
+
json: true,
|
|
156
|
+
tag: opts.tag,
|
|
157
|
+
signal: opts.signal,
|
|
158
|
+
}
|
|
149
159
|
return _requestObservable<(SanityDocument<R> | null)[]>(client, httpRequest, options).pipe(
|
|
150
160
|
filter(isResponse),
|
|
151
161
|
map((event: Any) => {
|
package/src/types.ts
CHANGED
|
@@ -372,6 +372,10 @@ export interface SanityProjectMember {
|
|
|
372
372
|
export interface SanityProject {
|
|
373
373
|
id: string
|
|
374
374
|
displayName: string
|
|
375
|
+
/**
|
|
376
|
+
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
|
|
377
|
+
* @see https://www.sanity.io/help/studio-host-user-applications
|
|
378
|
+
*/
|
|
375
379
|
studioHost: string | null
|
|
376
380
|
organizationId: string | null
|
|
377
381
|
isBlocked: boolean
|
|
@@ -384,6 +388,10 @@ export interface SanityProject {
|
|
|
384
388
|
metadata: {
|
|
385
389
|
cliInitializedAt?: string
|
|
386
390
|
color?: string
|
|
391
|
+
/**
|
|
392
|
+
* @deprecated Use the `/user-applications` endpoint instead, which lists all deployed studios/applications
|
|
393
|
+
* @see https://www.sanity.io/help/studio-host-user-applications
|
|
394
|
+
*/
|
|
387
395
|
externalStudioHost?: string
|
|
388
396
|
}
|
|
389
397
|
}
|