@sanity/client 8.6.1 → 8.7.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 +8 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.node.d.ts +64 -1
- package/dist/index.node.js +1 -1
- package/dist/index.node.js.map +1 -1
- package/dist/media-library.d.ts +1 -1
- package/dist/{types-B1XLvey7.d.ts → types-Do7-A3K9.d.ts} +65 -2
- package/package.json +4 -4
- package/src/types.ts +69 -0
package/dist/media-library.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _r as
|
|
1
|
+
import { _r as VideoRenditionInfoPublic, br as VideoSubtitleInfoPublic, gr as VideoRenditionInfo, hr as VideoPlaybackTokens, lr as VideoPlaybackInfo, mr as VideoPlaybackInfoSigned, vr as VideoRenditionInfoSigned, xr as VideoSubtitleInfoSigned, yr as VideoSubtitleInfo } from "./types-Do7-A3K9.js";
|
|
2
2
|
/**
|
|
3
3
|
* Check if the entire playback info response requires signed URLs
|
|
4
4
|
* @public
|
|
@@ -9776,6 +9776,50 @@ declare global {
|
|
|
9776
9776
|
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
9777
9777
|
*/
|
|
9778
9778
|
interface SanityQueries {}
|
|
9779
|
+
/**
|
|
9780
|
+
* Schema types, keyed first by resource and then read as a union. Empty by default; a
|
|
9781
|
+
* multi-resource `sanity typegen` run registers one entry per configured resource:
|
|
9782
|
+
* ```ts
|
|
9783
|
+
* declare global {
|
|
9784
|
+
* interface SanitySchemasByResource {
|
|
9785
|
+
* 'ppsg7ml5.test': Author | Movie | Slug
|
|
9786
|
+
* }
|
|
9787
|
+
* }
|
|
9788
|
+
* ```
|
|
9789
|
+
* A resource key is the same string the SDK uses for its runtime cache: `projectId.dataset`
|
|
9790
|
+
* for a dataset, with no prefix. Consumers select one document type out of the union by its
|
|
9791
|
+
* `_type`, so the union may include object types that are not documents.
|
|
9792
|
+
*/
|
|
9793
|
+
interface SanitySchemasByResource {}
|
|
9794
|
+
/**
|
|
9795
|
+
* Query result types, keyed by resource and then by GROQ query string. Empty by default; a
|
|
9796
|
+
* multi-resource `sanity typegen` run registers the queries it finds per resource:
|
|
9797
|
+
* ```ts
|
|
9798
|
+
* declare global {
|
|
9799
|
+
* interface SanityQueriesByResource {
|
|
9800
|
+
* 'ppsg7ml5.test': {'*[_type == "post"]': PostsQueryResult}
|
|
9801
|
+
* }
|
|
9802
|
+
* }
|
|
9803
|
+
* ```
|
|
9804
|
+
* The flat `SanityQueries` registry stays as it is. It cannot express two datasets whose
|
|
9805
|
+
* schemas give the same query text different result types, which is what this adds.
|
|
9806
|
+
*/
|
|
9807
|
+
interface SanityQueriesByResource {}
|
|
9808
|
+
/**
|
|
9809
|
+
* Projection result types, keyed by resource, then document type, then projection string.
|
|
9810
|
+
* Empty by default:
|
|
9811
|
+
* ```ts
|
|
9812
|
+
* declare global {
|
|
9813
|
+
* interface SanityProjectionsByResource {
|
|
9814
|
+
* 'ppsg7ml5.test': {author: {'{name}': {name: string | null}}}
|
|
9815
|
+
* }
|
|
9816
|
+
* }
|
|
9817
|
+
* ```
|
|
9818
|
+
* A projection applies to a document the caller identifies by handle, so the same projection
|
|
9819
|
+
* text resolves differently per document type as well as per resource. That is why there is a
|
|
9820
|
+
* document-type level here and not in `SanityQueriesByResource`.
|
|
9821
|
+
*/
|
|
9822
|
+
interface SanityProjectionsByResource {}
|
|
9779
9823
|
}
|
|
9780
9824
|
/**
|
|
9781
9825
|
* The query registry as seen from `@sanity/client`. Inherits every query registered on the global
|
|
@@ -9798,6 +9842,25 @@ declare global {
|
|
|
9798
9842
|
* @public
|
|
9799
9843
|
*/
|
|
9800
9844
|
interface SanityQueries extends globalThis.SanityQueries {}
|
|
9845
|
+
/**
|
|
9846
|
+
* The schema registry as seen from `@sanity/client`. Inherits every resource registered on the
|
|
9847
|
+
* global `SanitySchemasByResource`, and also accepts a module augmentation, the same way
|
|
9848
|
+
* {@link SanityQueries} does.
|
|
9849
|
+
* @public
|
|
9850
|
+
*/
|
|
9851
|
+
interface SanitySchemasByResource extends globalThis.SanitySchemasByResource {}
|
|
9852
|
+
/**
|
|
9853
|
+
* The per-resource query registry as seen from `@sanity/client`. Inherits every resource
|
|
9854
|
+
* registered on the global `SanityQueriesByResource`, and also accepts a module augmentation.
|
|
9855
|
+
* @public
|
|
9856
|
+
*/
|
|
9857
|
+
interface SanityQueriesByResource extends globalThis.SanityQueriesByResource {}
|
|
9858
|
+
/**
|
|
9859
|
+
* The projection registry as seen from `@sanity/client`. Inherits every resource registered on
|
|
9860
|
+
* the global `SanityProjectionsByResource`, and also accepts a module augmentation.
|
|
9861
|
+
* @public
|
|
9862
|
+
*/
|
|
9863
|
+
interface SanityProjectionsByResource extends globalThis.SanityProjectionsByResource {}
|
|
9801
9864
|
/** @public */
|
|
9802
9865
|
type ClientReturn$1<GroqString extends string, Fallback = Any$1> = GroqString extends keyof SanityQueries ? SanityQueries[GroqString] : Fallback;
|
|
9803
9866
|
/**
|
|
@@ -10015,5 +10078,5 @@ interface MediaLibraryAssetDocument {
|
|
|
10015
10078
|
parent?: SanityReference | null;
|
|
10016
10079
|
rootDirectory?: Any$1;
|
|
10017
10080
|
}
|
|
10018
|
-
export { DisconnectEvent as $,
|
|
10019
|
-
//# sourceMappingURL=types-
|
|
10081
|
+
export { DisconnectEvent as $, UnpublishVersionAction as $n, ObservableCollaborationCommentsClient as $r, QueryWithoutParams as $t, ContentSourceMapMappings as A, AgentActionParam as Ai, SanityQueries as An, SanityClient$1 as Ar, MediaLibraryAssetVersion as At, CreateVersionAction as B, StoryboardTransformOptions as Bn, DatasetsClient as Br, MutationSelection as Bt, ContentSourceMap$1 as C, TransformTarget as Ci, SanityDocument$1 as Cn, WelcomeEvent as Cr, LiveEventGoAway as Ct, ContentSourceMapDocuments$1 as D, PatchDocument as Di, SanityProject as Dn, GenerateTargetDocument as Dr, LiveEventWelcome as Dt, ContentSourceMapDocumentValueSource as E, PromptRequest as Ei, SanityImagePalette as En, GenerateTarget as Er, LiveEventRestart as Et, ContentSourceMapValueMapping as F, ConstantAgentActionParam as Fi, ScheduleReleaseAction as Fn, MediaLibraryVideoClient as Fr, Mutation as Ft, DatasetResponse as G, TransactionFirstDocumentIdMutationOptions as Gn, PatchBuilder as Gr, PatchOperations as Gt, DatasetAclMode as H, ThumbnailTransformOptions as Hn, BaseTransaction as Hr, OpenEvent as Ht, CreateAction as I, DocumentAgentActionParam as Ii, SingleActionResult as In, ObservableMediaLibraryVideoClient as Ir, MutationError as It, DeleteReleaseAction as J, UnarchiveReleaseAction as Jn, ObservablePatch as Jr, PublishReleaseAction as Jt, DatasetsResponse as K, TransactionFirstDocumentMutationOptions as Kn, Transaction as Kr, PatchSelection as Kt, CreateReleaseAction as L, FieldAgentActionParam as Li, SingleMutationResult as Ln, InvokeFunctionEvent as Lr, MutationErrorItem as Lt, ContentSourceMapRemoteDocument as M, AgentActionPath as Mi, SanityReference as Mn, UsersClient as Mr, MediaLibraryVideoPlaybackTransformations as Mt, ContentSourceMapSource as N, AgentActionPathSegment as Ni, SanitySchemasByResource as Nn, ObservableProjectsClient as Nr, MultipleActionResult as Nt, ContentSourceMapLiteralSource as O, PatchOperation as Oi, SanityProjectMember as On, GenerateTargetInclude as Or, MediaLibraryAssetDocument as Ot, ContentSourceMapUnknownSource as P, AgentActionTarget as Pi, SanityUser as Pn, ProjectsClient as Pr, MultipleMutationResult as Pt, DiscardVersionAction as Q, UnpublishVariantAction as Qn, CollaborationCommentsClient as Qr, QueryParseError as Qt, CreateVariantAction as R, GroqAgentActionParam as Ri, StackablePerspective as Rn, InvokeFunctionOptions as Rr, MutationEvent as Rt, ClientVariantConditions as S, TransformOperation as Si, SanityAssetDocument as Sn, WelcomeBackEvent as Sr, LiveEvent as St, ContentSourceMapDocumentBase as T, TransformTargetInclude as Ti, SanityImageAssetDocument as Tn, GenerateOperation as Tr, LiveEventReconnect as Tt, DatasetCreateOptions as U, TransactionAllDocumentIdsMutationOptions as Un, ObservablePatchBuilder as Ur, PartialExcept as Ut, CurrentSanityUser as V, SyncTag as Vn, ObservableDatasetsClient as Vr, MutationSelectionQueryParams as Vt, DatasetEditOptions as W, TransactionAllDocumentsMutationOptions as Wn, ObservableTransaction as Wr, PatchMutationOperation as Wt, DeleteVariantDefinitionAction as X, UnfilteredResponseWithoutQuery as Xn, LiveClient as Xr, QueryOptions as Xt, DeleteVariantAction as Y, UnfilteredResponseQueryOptions as Yn, Patch as Yr, PublishVariantAction as Yt, DiscardAction as Z, UnpublishAction as Zn, types_d_exports as Zr, QueryParams as Zt, ChannelErrorEvent as _, TranslateDocument as _i, Requester as _n, VideoRenditionInfoPublic as _r, InsertPatch as _t, AllDocumentsMutationOptions as a, CollaborationCommentRange as ai, ReleaseCardinality as an, UploadResponseEvent as ar, EditableReleaseDocument as at, ClientReturn$1 as b, ImageDescriptionOperation as bi, ResumableListenEventNames as bn, VideoSubtitleInfoPublic as br, ListenOptions as bt, Any$1 as c, CollaborationCommentStatus as ci, ReleaseState as cn, VersionAction as cr, ErrorProps as ct, AssetMetadataType as d, CollaborationCommentsListenOptions as di, ReplaceVersionAction as dn, VideoPlaybackInfoItemPublic as dr, FirstDocumentMutationOptions as dt, CollaborationCommentCreate as ei, RawQueryResponse$1 as en, UnscheduleReleaseAction as er, EXPERIMENTAL_API_WARNING as et, AttributeSet as f, CollaborationCommentsRequestOptions as fi, RequestHandler as fn, VideoPlaybackInfoItemSigned as fr, FitMode as ft, BaseMutationOptions as g, ObservableAssetsClient as gi, RequestUrlOptions as gn, VideoRenditionInfo as gr, InitializedClientConfig$1 as gt, BaseActionOptions as h, AssetsClient as hi, RequestOptions$1 as hn, VideoPlaybackTokens as hr, ImportReleaseAction as ht, AllDocumentIdsMutationOptions as i, CollaborationCommentPortableTextBlock as ii, ReleaseAction as in, UploadProgressEvent as ir, EditVariantDefinitionAction as it, ContentSourceMapPaths as j, AgentActionParams as ji, SanityQueriesByResource as jn, ObservableUsersClient as jr, MediaLibraryPlaybackInfoOptions as jt, ContentSourceMapMapping as k, PatchTarget as ki, SanityProjectionsByResource as kn, ObservableSanityClient$1 as kr, MediaLibraryAssetInstanceIdentifier as kt, ApiError as l, CollaborationCommentTarget as li, ReleaseType as ln, VideoPlaybackInfo as lr, FilteredResponseQueryOptions as lt, AuthProviderResponse as m, _listen as mi, RequestObservableOptions as mn, VideoPlaybackInfoSigned as mr, IdentifiedSanityDocumentStub as mt, ActionError as n, CollaborationCommentFieldValue as ni, RawRequestOptions as nn, UploadClientConfig as nr, EditReleaseAction as nt, AnimatedImageFormat as o, CollaborationCommentReactionShortName as oi, ReleaseDocument as on, VariantAction as or, EmbeddingsSettings as ot, AuthProvider as p, CollaborationCommentsWriteOptions as pi, RequestHandlerOptions as pn, VideoPlaybackInfoPublic as pr, HttpRequest as pt, DeleteAction as q, TransactionMutationOptions as qn, BasePatch as qr, PublishAction as qt, ActionErrorItem as r, CollaborationCommentMessage as ri, ReconnectEvent as rn, UploadEvent as rr, EditVariantAction as rt, AnimatedTransformOptions as s, CollaborationCommentSelection as si, ReleaseId as sn, VariantDefinitionAction as sr, EmbeddingsSettingsBody as st, Action as t, CollaborationCommentDocument as ti, RawQuerylessQueryResponse as tn, UploadBody as tr, EditAction as tt, ArchiveReleaseAction as u, CollaborationCommentUpdate as ui, ReplaceDraftAction as un, VideoPlaybackInfoItem as ur, FirstDocumentIdMutationOptions as ut, ClientConfig$1 as v, TranslateTarget as vi, ResetEvent as vn, VideoRenditionInfoSigned as vr, ListenEvent as vt, ContentSourceMapDocument as w, TransformTargetDocument as wi, SanityDocumentStub as wn, GenerateInstruction as wr, LiveEventMessage as wt, ClientVariant as x, TransformDocument as xi, ResumableListenOptions as xn, VideoSubtitleInfoSigned as xr, ListenParams as xt, ClientPerspective$1 as y, TranslateTargetInclude as yi, ResponseQueryOptions as yn, VideoSubtitleInfo as yr, ListenEventName as yt, CreateVariantDefinitionAction as z, StillImageFormat as zn, InvokeFunctionRequest as zr, MutationOperation as zt };
|
|
10082
|
+
//# sourceMappingURL=types-Do7-A3K9.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"./package.json": "./package.json"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"eventsource": "^5.1.
|
|
53
|
-
"get-it": "^9.5.
|
|
54
|
-
"obug": "^
|
|
52
|
+
"eventsource": "^5.1.2",
|
|
53
|
+
"get-it": "^9.5.7",
|
|
54
|
+
"obug": "^3.0.0",
|
|
55
55
|
"rxjs": "^7.8.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
package/src/types.ts
CHANGED
|
@@ -2298,6 +2298,53 @@ declare global {
|
|
|
2298
2298
|
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
2299
2299
|
*/
|
|
2300
2300
|
interface SanityQueries {}
|
|
2301
|
+
|
|
2302
|
+
/**
|
|
2303
|
+
* Schema types, keyed first by resource and then read as a union. Empty by default; a
|
|
2304
|
+
* multi-resource `sanity typegen` run registers one entry per configured resource:
|
|
2305
|
+
* ```ts
|
|
2306
|
+
* declare global {
|
|
2307
|
+
* interface SanitySchemasByResource {
|
|
2308
|
+
* 'ppsg7ml5.test': Author | Movie | Slug
|
|
2309
|
+
* }
|
|
2310
|
+
* }
|
|
2311
|
+
* ```
|
|
2312
|
+
* A resource key is the same string the SDK uses for its runtime cache: `projectId.dataset`
|
|
2313
|
+
* for a dataset, with no prefix. Consumers select one document type out of the union by its
|
|
2314
|
+
* `_type`, so the union may include object types that are not documents.
|
|
2315
|
+
*/
|
|
2316
|
+
interface SanitySchemasByResource {}
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Query result types, keyed by resource and then by GROQ query string. Empty by default; a
|
|
2320
|
+
* multi-resource `sanity typegen` run registers the queries it finds per resource:
|
|
2321
|
+
* ```ts
|
|
2322
|
+
* declare global {
|
|
2323
|
+
* interface SanityQueriesByResource {
|
|
2324
|
+
* 'ppsg7ml5.test': {'*[_type == "post"]': PostsQueryResult}
|
|
2325
|
+
* }
|
|
2326
|
+
* }
|
|
2327
|
+
* ```
|
|
2328
|
+
* The flat `SanityQueries` registry stays as it is. It cannot express two datasets whose
|
|
2329
|
+
* schemas give the same query text different result types, which is what this adds.
|
|
2330
|
+
*/
|
|
2331
|
+
interface SanityQueriesByResource {}
|
|
2332
|
+
|
|
2333
|
+
/**
|
|
2334
|
+
* Projection result types, keyed by resource, then document type, then projection string.
|
|
2335
|
+
* Empty by default:
|
|
2336
|
+
* ```ts
|
|
2337
|
+
* declare global {
|
|
2338
|
+
* interface SanityProjectionsByResource {
|
|
2339
|
+
* 'ppsg7ml5.test': {author: {'{name}': {name: string | null}}}
|
|
2340
|
+
* }
|
|
2341
|
+
* }
|
|
2342
|
+
* ```
|
|
2343
|
+
* A projection applies to a document the caller identifies by handle, so the same projection
|
|
2344
|
+
* text resolves differently per document type as well as per resource. That is why there is a
|
|
2345
|
+
* document-type level here and not in `SanityQueriesByResource`.
|
|
2346
|
+
*/
|
|
2347
|
+
interface SanityProjectionsByResource {}
|
|
2301
2348
|
}
|
|
2302
2349
|
|
|
2303
2350
|
/**
|
|
@@ -2322,6 +2369,28 @@ declare global {
|
|
|
2322
2369
|
*/
|
|
2323
2370
|
export interface SanityQueries extends globalThis.SanityQueries {}
|
|
2324
2371
|
|
|
2372
|
+
/**
|
|
2373
|
+
* The schema registry as seen from `@sanity/client`. Inherits every resource registered on the
|
|
2374
|
+
* global `SanitySchemasByResource`, and also accepts a module augmentation, the same way
|
|
2375
|
+
* {@link SanityQueries} does.
|
|
2376
|
+
* @public
|
|
2377
|
+
*/
|
|
2378
|
+
export interface SanitySchemasByResource extends globalThis.SanitySchemasByResource {}
|
|
2379
|
+
|
|
2380
|
+
/**
|
|
2381
|
+
* The per-resource query registry as seen from `@sanity/client`. Inherits every resource
|
|
2382
|
+
* registered on the global `SanityQueriesByResource`, and also accepts a module augmentation.
|
|
2383
|
+
* @public
|
|
2384
|
+
*/
|
|
2385
|
+
export interface SanityQueriesByResource extends globalThis.SanityQueriesByResource {}
|
|
2386
|
+
|
|
2387
|
+
/**
|
|
2388
|
+
* The projection registry as seen from `@sanity/client`. Inherits every resource registered on
|
|
2389
|
+
* the global `SanityProjectionsByResource`, and also accepts a module augmentation.
|
|
2390
|
+
* @public
|
|
2391
|
+
*/
|
|
2392
|
+
export interface SanityProjectionsByResource extends globalThis.SanityProjectionsByResource {}
|
|
2393
|
+
|
|
2325
2394
|
/** @public */
|
|
2326
2395
|
export type ClientReturn<
|
|
2327
2396
|
GroqString extends string,
|