@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "6.21.2",
3
+ "version": "6.21.3-canary.0",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -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
  }
@@ -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 = {uri: _getDataUrl(client, 'doc', id), json: true, tag: opts.tag}
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 = {uri: _getDataUrl(client, 'doc', ids.join(',')), json: true, tag: opts.tag}
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
  }