@sanity/client 7.26.1 → 7.27.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 +48 -1
- package/dist/_chunks-cjs/resolveEditInfo.cjs +4 -4
- package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +3 -3
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
- package/dist/_chunks-es/resolveEditInfo.js +4 -4
- package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +3 -3
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
- package/dist/csm.cjs.map +1 -1
- package/dist/csm.d.cts +5 -17
- package/dist/csm.d.ts +5 -17
- package/dist/csm.js.map +1 -1
- package/dist/index.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +70 -65
- package/dist/index.browser.d.ts +70 -65
- package/dist/index.browser.js +1 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -60
- package/dist/index.d.ts +69 -60
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/media-library.d.cts +24 -0
- package/dist/media-library.d.ts +24 -0
- package/dist/stega.browser.d.cts +49 -71
- package/dist/stega.browser.d.ts +69 -71
- package/dist/stega.d.cts +49 -71
- package/dist/stega.d.ts +69 -71
- package/package.json +36 -33
- package/src/agent/actions/commonTypes.ts +1 -2
- package/src/agent/actions/generate.ts +3 -6
- package/src/agent/actions/patch.ts +3 -6
- package/src/agent/actions/prompt.ts +1 -2
- package/src/agent/actions/transform.ts +1 -2
- package/src/agent/actions/translate.ts +1 -2
- package/src/csm/applySourceDocuments.ts +1 -3
- package/src/csm/types.ts +1 -3
- package/src/data/listen.ts +1 -2
- package/src/releases/ReleasesClient.ts +2 -4
- package/src/stega/types.ts +1 -2
- package/src/types.ts +50 -40
- package/umd/sanityClient.js +21 -14
- package/umd/sanityClient.min.js +2 -2
package/dist/media-library.d.cts
CHANGED
|
@@ -115,3 +115,27 @@ export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
export {}
|
|
118
|
+
|
|
119
|
+
declare global {
|
|
120
|
+
interface File {}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare global {
|
|
124
|
+
/**
|
|
125
|
+
* Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
|
|
126
|
+
* the queries it finds:
|
|
127
|
+
* ```ts
|
|
128
|
+
* declare global {
|
|
129
|
+
* interface SanityQueries {
|
|
130
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
131
|
+
* }
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
* `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
|
|
135
|
+
*
|
|
136
|
+
* The registry is a global rather than a module augmentation of `@sanity/client` so that it
|
|
137
|
+
* does not depend on module resolution: it resolves the same whether `@sanity/client` is a
|
|
138
|
+
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
139
|
+
*/
|
|
140
|
+
interface SanityQueries {}
|
|
141
|
+
}
|
package/dist/media-library.d.ts
CHANGED
|
@@ -115,3 +115,27 @@ export declare interface VideoSubtitleInfoSigned extends VideoSubtitleInfoPublic
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
export {}
|
|
118
|
+
|
|
119
|
+
declare global {
|
|
120
|
+
interface File {}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
declare global {
|
|
124
|
+
/**
|
|
125
|
+
* Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
|
|
126
|
+
* the queries it finds:
|
|
127
|
+
* ```ts
|
|
128
|
+
* declare global {
|
|
129
|
+
* interface SanityQueries {
|
|
130
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
131
|
+
* }
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
* `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
|
|
135
|
+
*
|
|
136
|
+
* The registry is a global rather than a module augmentation of `@sanity/client` so that it
|
|
137
|
+
* does not depend on module resolution: it resolves the same whether `@sanity/client` is a
|
|
138
|
+
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
139
|
+
*/
|
|
140
|
+
interface SanityQueries {}
|
|
141
|
+
}
|
package/dist/stega.browser.d.cts
CHANGED
|
@@ -417,14 +417,7 @@ export declare interface ArchiveReleaseAction {
|
|
|
417
417
|
|
|
418
418
|
/** @public */
|
|
419
419
|
export declare type AssetMetadataType =
|
|
420
|
-
| '
|
|
421
|
-
| 'exif'
|
|
422
|
-
| 'image'
|
|
423
|
-
| 'palette'
|
|
424
|
-
| 'lqip'
|
|
425
|
-
| 'blurhash'
|
|
426
|
-
| 'thumbhash'
|
|
427
|
-
| 'none'
|
|
420
|
+
'location' | 'exif' | 'image' | 'palette' | 'lqip' | 'blurhash' | 'thumbhash' | 'none'
|
|
428
421
|
|
|
429
422
|
/** @internal */
|
|
430
423
|
export declare class AssetsClient {
|
|
@@ -866,17 +859,13 @@ export declare class ClientError extends Error {
|
|
|
866
859
|
|
|
867
860
|
/** @public */
|
|
868
861
|
export declare type ClientPerspective =
|
|
869
|
-
|
|
|
870
|
-
| 'published'
|
|
871
|
-
| 'drafts'
|
|
872
|
-
| 'raw'
|
|
873
|
-
| StackablePerspective[]
|
|
862
|
+
DeprecatedPreviewDrafts | 'published' | 'drafts' | 'raw' | StackablePerspective[]
|
|
874
863
|
|
|
875
864
|
/** @public */
|
|
876
865
|
export declare type ClientReturn<
|
|
877
866
|
GroqString extends string,
|
|
878
867
|
Fallback = Any,
|
|
879
|
-
> = GroqString extends keyof
|
|
868
|
+
> = GroqString extends keyof SanityQueries_2 ? SanityQueries_2[GroqString] : Fallback
|
|
880
869
|
|
|
881
870
|
/**
|
|
882
871
|
* Drop-in replacement for `ClientReturn` that brands the result strings as `StegaString`, for use
|
|
@@ -1041,14 +1030,12 @@ declare interface ContentSourceMapDocumentBase_2 {
|
|
|
1041
1030
|
|
|
1042
1031
|
/** @public */
|
|
1043
1032
|
export declare type ContentSourceMapDocuments = (
|
|
1044
|
-
|
|
|
1045
|
-
| ContentSourceMapRemoteDocument
|
|
1033
|
+
ContentSourceMapDocument | ContentSourceMapRemoteDocument
|
|
1046
1034
|
)[]
|
|
1047
1035
|
|
|
1048
1036
|
/** @public */
|
|
1049
1037
|
declare type ContentSourceMapDocuments_2 = (
|
|
1050
|
-
|
|
|
1051
|
-
| ContentSourceMapRemoteDocument_2
|
|
1038
|
+
ContentSourceMapDocument_2 | ContentSourceMapRemoteDocument_2
|
|
1052
1039
|
)[]
|
|
1053
1040
|
|
|
1054
1041
|
/**
|
|
@@ -1101,9 +1088,7 @@ declare type ContentSourceMapMappings_2 = Record<string, ContentSourceMapMapping
|
|
|
1101
1088
|
|
|
1102
1089
|
/** @alpha */
|
|
1103
1090
|
export declare type ContentSourceMapParsedPath = (
|
|
1104
|
-
|
|
|
1105
|
-
| number
|
|
1106
|
-
| ContentSourceMapParsedPathKeyedSegment
|
|
1091
|
+
string | number | ContentSourceMapParsedPathKeyedSegment
|
|
1107
1092
|
)[]
|
|
1108
1093
|
|
|
1109
1094
|
/** @alpha */
|
|
@@ -1120,8 +1105,7 @@ declare type ContentSourceMapPaths_2 = string[]
|
|
|
1120
1105
|
|
|
1121
1106
|
/** @public */
|
|
1122
1107
|
export declare type ContentSourceMapQueryResponse =
|
|
1123
|
-
| RawQueryResponse<unknown>
|
|
1124
|
-
| Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
|
|
1108
|
+
RawQueryResponse<unknown> | Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
|
|
1125
1109
|
|
|
1126
1110
|
/** @public */
|
|
1127
1111
|
export declare interface ContentSourceMapRemoteDocument extends ContentSourceMapDocumentBase {
|
|
@@ -1775,8 +1759,7 @@ export declare function formatQueryParseError(
|
|
|
1775
1759
|
|
|
1776
1760
|
/** @beta */
|
|
1777
1761
|
declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1778
|
-
|
|
|
1779
|
-
| GenerateTargetDocumentRequest<T>
|
|
1762
|
+
GenerateExistingDocumentRequest | GenerateTargetDocumentRequest<T>
|
|
1780
1763
|
) &
|
|
1781
1764
|
GenerateRequestBase &
|
|
1782
1765
|
AgentActionAsync
|
|
@@ -1795,8 +1778,7 @@ declare interface GenerateExistingDocumentRequest {
|
|
|
1795
1778
|
|
|
1796
1779
|
/** @beta */
|
|
1797
1780
|
export declare type GenerateInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1798
|
-
|
|
|
1799
|
-
| GenerateAsyncInstruction<T>
|
|
1781
|
+
GenerateSyncInstruction<T> | GenerateAsyncInstruction<T>
|
|
1800
1782
|
|
|
1801
1783
|
/** @beta */
|
|
1802
1784
|
export declare type GenerateOperation = 'set' | 'append' | 'mixed'
|
|
@@ -1927,8 +1909,7 @@ declare interface GenerateRequestBase extends AgentActionRequestBase {
|
|
|
1927
1909
|
|
|
1928
1910
|
/** @beta */
|
|
1929
1911
|
declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1930
|
-
|
|
|
1931
|
-
| GenerateTargetDocumentRequest<T>
|
|
1912
|
+
GenerateExistingDocumentRequest | GenerateTargetDocumentRequest<T>
|
|
1932
1913
|
) &
|
|
1933
1914
|
GenerateRequestBase &
|
|
1934
1915
|
AgentActionSync
|
|
@@ -2275,12 +2256,7 @@ export declare function _listen<
|
|
|
2275
2256
|
|
|
2276
2257
|
/** @public */
|
|
2277
2258
|
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2278
|
-
|
|
2279
|
-
| ReconnectEvent
|
|
2280
|
-
| WelcomeBackEvent
|
|
2281
|
-
| ResetEvent
|
|
2282
|
-
| WelcomeEvent
|
|
2283
|
-
| OpenEvent
|
|
2259
|
+
MutationEvent<R> | ReconnectEvent | WelcomeBackEvent | ResetEvent | WelcomeEvent | OpenEvent
|
|
2284
2260
|
|
|
2285
2261
|
/**
|
|
2286
2262
|
* Maps a ListenOptions object and returns the Listen events opted for, e.g:
|
|
@@ -2420,11 +2396,7 @@ export declare class LiveClient {
|
|
|
2420
2396
|
|
|
2421
2397
|
/** @public */
|
|
2422
2398
|
export declare type LiveEvent =
|
|
2423
|
-
|
|
|
2424
|
-
| LiveEventReconnect
|
|
2425
|
-
| LiveEventMessage
|
|
2426
|
-
| LiveEventWelcome
|
|
2427
|
-
| LiveEventGoAway
|
|
2399
|
+
LiveEventRestart | LiveEventReconnect | LiveEventMessage | LiveEventWelcome | LiveEventGoAway
|
|
2428
2400
|
|
|
2429
2401
|
/**
|
|
2430
2402
|
* The `id` field is the position at which the connection was rejected or closed.
|
|
@@ -2486,8 +2458,7 @@ declare type Logger_2 =
|
|
|
2486
2458
|
declare type MapListenEventNamesToListenEvents<
|
|
2487
2459
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2488
2460
|
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2489
|
-
|
|
|
2490
|
-
| ListenEventName
|
|
2461
|
+
ResumableListenEventNames | ListenEventName
|
|
2491
2462
|
)[],
|
|
2492
2463
|
> = Events extends (infer E)[]
|
|
2493
2464
|
? E extends 'welcome'
|
|
@@ -4214,21 +4185,18 @@ export declare type PatchBuilder = (patch: Patch) => Patch
|
|
|
4214
4185
|
|
|
4215
4186
|
/** @beta */
|
|
4216
4187
|
export declare type PatchDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
4217
|
-
|
|
|
4218
|
-
| PatchDocumentAsync<T>
|
|
4188
|
+
PatchDocumentSync<T> | PatchDocumentAsync<T>
|
|
4219
4189
|
|
|
4220
4190
|
/** @beta */
|
|
4221
4191
|
declare type PatchDocumentAsync<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4222
|
-
|
|
|
4223
|
-
| PatchTargetDocumentRequest<T>
|
|
4192
|
+
PatchExistingDocumentRequest | PatchTargetDocumentRequest<T>
|
|
4224
4193
|
) &
|
|
4225
4194
|
PatchRequestBase &
|
|
4226
4195
|
AgentActionAsync
|
|
4227
4196
|
|
|
4228
4197
|
/** @beta */
|
|
4229
4198
|
declare type PatchDocumentSync<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4230
|
-
|
|
|
4231
|
-
| PatchTargetDocumentRequest<T>
|
|
4199
|
+
PatchExistingDocumentRequest | PatchTargetDocumentRequest<T>
|
|
4232
4200
|
) &
|
|
4233
4201
|
PatchRequestBase &
|
|
4234
4202
|
AgentActionSync
|
|
@@ -4394,8 +4362,7 @@ declare interface PromptJsonResponse<T extends Record<string, Any> = Record<stri
|
|
|
4394
4362
|
|
|
4395
4363
|
/** @beta */
|
|
4396
4364
|
export declare type PromptRequest<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4397
|
-
|
|
|
4398
|
-
| PromptJsonResponse<T>
|
|
4365
|
+
PromptTextResponse | PromptJsonResponse<T>
|
|
4399
4366
|
) &
|
|
4400
4367
|
PromptRequestBase
|
|
4401
4368
|
|
|
@@ -4540,9 +4507,7 @@ export declare interface PublishReleaseAction {
|
|
|
4540
4507
|
|
|
4541
4508
|
/** @public */
|
|
4542
4509
|
export declare type QueryOptions =
|
|
4543
|
-
|
|
|
4544
|
-
| UnfilteredResponseQueryOptions
|
|
4545
|
-
| UnfilteredResponseWithoutQuery
|
|
4510
|
+
FilteredResponseQueryOptions | UnfilteredResponseQueryOptions | UnfilteredResponseWithoutQuery
|
|
4546
4511
|
|
|
4547
4512
|
/** @public */
|
|
4548
4513
|
export declare interface QueryParams {
|
|
@@ -5185,8 +5150,10 @@ export declare type ResumableListenEventNames =
|
|
|
5185
5150
|
| 'reset'
|
|
5186
5151
|
|
|
5187
5152
|
/** @public */
|
|
5188
|
-
export declare interface ResumableListenOptions
|
|
5189
|
-
|
|
5153
|
+
export declare interface ResumableListenOptions extends Omit<
|
|
5154
|
+
ListenOptions,
|
|
5155
|
+
'events' | 'enableResume'
|
|
5156
|
+
> {
|
|
5190
5157
|
/**
|
|
5191
5158
|
* If this is enabled, the client will normally resume events upon reconnect
|
|
5192
5159
|
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
@@ -6112,8 +6079,28 @@ export declare interface SanityProjectMember {
|
|
|
6112
6079
|
isCurrentUser: boolean
|
|
6113
6080
|
}
|
|
6114
6081
|
|
|
6115
|
-
/**
|
|
6116
|
-
|
|
6082
|
+
/**
|
|
6083
|
+
* The query registry as seen from `@sanity/client`. Inherits every query registered on the global
|
|
6084
|
+
* `SanityQueries` interface, and still accepts the older module augmentation form:
|
|
6085
|
+
* ```ts
|
|
6086
|
+
* declare module '@sanity/client' {
|
|
6087
|
+
* interface SanityQueries {
|
|
6088
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
6089
|
+
* }
|
|
6090
|
+
* }
|
|
6091
|
+
* ```
|
|
6092
|
+
* `@sanity/client` releases that predate the global registry only read this interface, so a
|
|
6093
|
+
* generated file that registers queries globally can bridge them with an augmentation that adds
|
|
6094
|
+
* the global as a base type. It is harmless on releases that already inherit it:
|
|
6095
|
+
* ```ts
|
|
6096
|
+
* declare module '@sanity/client' {
|
|
6097
|
+
* interface SanityQueries extends globalThis.SanityQueries {}
|
|
6098
|
+
* }
|
|
6099
|
+
* ```
|
|
6100
|
+
* @public
|
|
6101
|
+
*/
|
|
6102
|
+
declare interface SanityQueries_2 extends globalThis.SanityQueries {}
|
|
6103
|
+
export {SanityQueries_2 as SanityQueries}
|
|
6117
6104
|
|
|
6118
6105
|
/** @internal */
|
|
6119
6106
|
export declare interface SanityReference {
|
|
@@ -6428,10 +6415,7 @@ export declare type StudioBaseRoute = {
|
|
|
6428
6415
|
|
|
6429
6416
|
/** @alpha */
|
|
6430
6417
|
export declare type StudioBaseUrl =
|
|
6431
|
-
|
|
|
6432
|
-
| `${string}.sanity.studio`
|
|
6433
|
-
| `https://${string}`
|
|
6434
|
-
| string
|
|
6418
|
+
`/${string}` | `${string}.sanity.studio` | `https://${string}` | string
|
|
6435
6419
|
|
|
6436
6420
|
/** @alpha */
|
|
6437
6421
|
export declare type StudioUrl = StudioBaseUrl | StudioBaseRoute
|
|
@@ -6555,8 +6539,7 @@ export declare type TransactionMutationOptions =
|
|
|
6555
6539
|
|
|
6556
6540
|
/** @beta */
|
|
6557
6541
|
export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
6558
|
-
|
|
6559
|
-
| TransformDocumentAsync
|
|
6542
|
+
TransformDocumentSync<T> | TransformDocumentAsync
|
|
6560
6543
|
|
|
6561
6544
|
/** @beta */
|
|
6562
6545
|
declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
|
|
@@ -6820,8 +6803,7 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
|
|
|
6820
6803
|
|
|
6821
6804
|
/** @beta */
|
|
6822
6805
|
export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
6823
|
-
|
|
6824
|
-
| TranslateDocumentAsync
|
|
6806
|
+
TranslateDocumentSync<T> | TranslateDocumentAsync
|
|
6825
6807
|
|
|
6826
6808
|
/** @beta */
|
|
6827
6809
|
declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
|
|
@@ -7106,10 +7088,7 @@ export declare const vercelStegaCleanAll: typeof stegaClean
|
|
|
7106
7088
|
|
|
7107
7089
|
/** @public */
|
|
7108
7090
|
export declare type VersionAction =
|
|
7109
|
-
|
|
|
7110
|
-
| DiscardVersionAction
|
|
7111
|
-
| ReplaceVersionAction
|
|
7112
|
-
| UnpublishVersionAction
|
|
7091
|
+
CreateVersionAction | DiscardVersionAction | ReplaceVersionAction | UnpublishVersionAction
|
|
7113
7092
|
|
|
7114
7093
|
/** @public */
|
|
7115
7094
|
export declare interface VideoPlaybackInfo<
|
|
@@ -7134,8 +7113,7 @@ export declare interface VideoPlaybackInfo<
|
|
|
7134
7113
|
|
|
7135
7114
|
/** @public */
|
|
7136
7115
|
export declare type VideoPlaybackInfoItem =
|
|
7137
|
-
|
|
|
7138
|
-
| VideoPlaybackInfoItemSigned
|
|
7116
|
+
VideoPlaybackInfoItemPublic | VideoPlaybackInfoItemSigned
|
|
7139
7117
|
|
|
7140
7118
|
/** @public */
|
|
7141
7119
|
export declare interface VideoPlaybackInfoItemPublic {
|
package/dist/stega.browser.d.ts
CHANGED
|
@@ -417,14 +417,7 @@ export declare interface ArchiveReleaseAction {
|
|
|
417
417
|
|
|
418
418
|
/** @public */
|
|
419
419
|
export declare type AssetMetadataType =
|
|
420
|
-
| '
|
|
421
|
-
| 'exif'
|
|
422
|
-
| 'image'
|
|
423
|
-
| 'palette'
|
|
424
|
-
| 'lqip'
|
|
425
|
-
| 'blurhash'
|
|
426
|
-
| 'thumbhash'
|
|
427
|
-
| 'none'
|
|
420
|
+
'location' | 'exif' | 'image' | 'palette' | 'lqip' | 'blurhash' | 'thumbhash' | 'none'
|
|
428
421
|
|
|
429
422
|
/** @internal */
|
|
430
423
|
export declare class AssetsClient {
|
|
@@ -866,17 +859,13 @@ export declare class ClientError extends Error {
|
|
|
866
859
|
|
|
867
860
|
/** @public */
|
|
868
861
|
export declare type ClientPerspective =
|
|
869
|
-
|
|
|
870
|
-
| 'published'
|
|
871
|
-
| 'drafts'
|
|
872
|
-
| 'raw'
|
|
873
|
-
| StackablePerspective[]
|
|
862
|
+
DeprecatedPreviewDrafts | 'published' | 'drafts' | 'raw' | StackablePerspective[]
|
|
874
863
|
|
|
875
864
|
/** @public */
|
|
876
865
|
export declare type ClientReturn<
|
|
877
866
|
GroqString extends string,
|
|
878
867
|
Fallback = Any,
|
|
879
|
-
> = GroqString extends keyof
|
|
868
|
+
> = GroqString extends keyof SanityQueries_2 ? SanityQueries_2[GroqString] : Fallback
|
|
880
869
|
|
|
881
870
|
/**
|
|
882
871
|
* Drop-in replacement for `ClientReturn` that brands the result strings as `StegaString`, for use
|
|
@@ -1041,14 +1030,12 @@ declare interface ContentSourceMapDocumentBase_2 {
|
|
|
1041
1030
|
|
|
1042
1031
|
/** @public */
|
|
1043
1032
|
export declare type ContentSourceMapDocuments = (
|
|
1044
|
-
|
|
|
1045
|
-
| ContentSourceMapRemoteDocument
|
|
1033
|
+
ContentSourceMapDocument | ContentSourceMapRemoteDocument
|
|
1046
1034
|
)[]
|
|
1047
1035
|
|
|
1048
1036
|
/** @public */
|
|
1049
1037
|
declare type ContentSourceMapDocuments_2 = (
|
|
1050
|
-
|
|
|
1051
|
-
| ContentSourceMapRemoteDocument_2
|
|
1038
|
+
ContentSourceMapDocument_2 | ContentSourceMapRemoteDocument_2
|
|
1052
1039
|
)[]
|
|
1053
1040
|
|
|
1054
1041
|
/**
|
|
@@ -1101,9 +1088,7 @@ declare type ContentSourceMapMappings_2 = Record<string, ContentSourceMapMapping
|
|
|
1101
1088
|
|
|
1102
1089
|
/** @alpha */
|
|
1103
1090
|
export declare type ContentSourceMapParsedPath = (
|
|
1104
|
-
|
|
|
1105
|
-
| number
|
|
1106
|
-
| ContentSourceMapParsedPathKeyedSegment
|
|
1091
|
+
string | number | ContentSourceMapParsedPathKeyedSegment
|
|
1107
1092
|
)[]
|
|
1108
1093
|
|
|
1109
1094
|
/** @alpha */
|
|
@@ -1120,8 +1105,7 @@ declare type ContentSourceMapPaths_2 = string[]
|
|
|
1120
1105
|
|
|
1121
1106
|
/** @public */
|
|
1122
1107
|
export declare type ContentSourceMapQueryResponse =
|
|
1123
|
-
| RawQueryResponse<unknown>
|
|
1124
|
-
| Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
|
|
1108
|
+
RawQueryResponse<unknown> | Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
|
|
1125
1109
|
|
|
1126
1110
|
/** @public */
|
|
1127
1111
|
export declare interface ContentSourceMapRemoteDocument extends ContentSourceMapDocumentBase {
|
|
@@ -1775,8 +1759,7 @@ export declare function formatQueryParseError(
|
|
|
1775
1759
|
|
|
1776
1760
|
/** @beta */
|
|
1777
1761
|
declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1778
|
-
|
|
|
1779
|
-
| GenerateTargetDocumentRequest<T>
|
|
1762
|
+
GenerateExistingDocumentRequest | GenerateTargetDocumentRequest<T>
|
|
1780
1763
|
) &
|
|
1781
1764
|
GenerateRequestBase &
|
|
1782
1765
|
AgentActionAsync
|
|
@@ -1795,8 +1778,7 @@ declare interface GenerateExistingDocumentRequest {
|
|
|
1795
1778
|
|
|
1796
1779
|
/** @beta */
|
|
1797
1780
|
export declare type GenerateInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1798
|
-
|
|
|
1799
|
-
| GenerateAsyncInstruction<T>
|
|
1781
|
+
GenerateSyncInstruction<T> | GenerateAsyncInstruction<T>
|
|
1800
1782
|
|
|
1801
1783
|
/** @beta */
|
|
1802
1784
|
export declare type GenerateOperation = 'set' | 'append' | 'mixed'
|
|
@@ -1927,8 +1909,7 @@ declare interface GenerateRequestBase extends AgentActionRequestBase {
|
|
|
1927
1909
|
|
|
1928
1910
|
/** @beta */
|
|
1929
1911
|
declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1930
|
-
|
|
|
1931
|
-
| GenerateTargetDocumentRequest<T>
|
|
1912
|
+
GenerateExistingDocumentRequest | GenerateTargetDocumentRequest<T>
|
|
1932
1913
|
) &
|
|
1933
1914
|
GenerateRequestBase &
|
|
1934
1915
|
AgentActionSync
|
|
@@ -2275,12 +2256,7 @@ export declare function _listen<
|
|
|
2275
2256
|
|
|
2276
2257
|
/** @public */
|
|
2277
2258
|
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2278
|
-
|
|
2279
|
-
| ReconnectEvent
|
|
2280
|
-
| WelcomeBackEvent
|
|
2281
|
-
| ResetEvent
|
|
2282
|
-
| WelcomeEvent
|
|
2283
|
-
| OpenEvent
|
|
2259
|
+
MutationEvent<R> | ReconnectEvent | WelcomeBackEvent | ResetEvent | WelcomeEvent | OpenEvent
|
|
2284
2260
|
|
|
2285
2261
|
/**
|
|
2286
2262
|
* Maps a ListenOptions object and returns the Listen events opted for, e.g:
|
|
@@ -2420,11 +2396,7 @@ export declare class LiveClient {
|
|
|
2420
2396
|
|
|
2421
2397
|
/** @public */
|
|
2422
2398
|
export declare type LiveEvent =
|
|
2423
|
-
|
|
|
2424
|
-
| LiveEventReconnect
|
|
2425
|
-
| LiveEventMessage
|
|
2426
|
-
| LiveEventWelcome
|
|
2427
|
-
| LiveEventGoAway
|
|
2399
|
+
LiveEventRestart | LiveEventReconnect | LiveEventMessage | LiveEventWelcome | LiveEventGoAway
|
|
2428
2400
|
|
|
2429
2401
|
/**
|
|
2430
2402
|
* The `id` field is the position at which the connection was rejected or closed.
|
|
@@ -2486,8 +2458,7 @@ declare type Logger_2 =
|
|
|
2486
2458
|
declare type MapListenEventNamesToListenEvents<
|
|
2487
2459
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2488
2460
|
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2489
|
-
|
|
|
2490
|
-
| ListenEventName
|
|
2461
|
+
ResumableListenEventNames | ListenEventName
|
|
2491
2462
|
)[],
|
|
2492
2463
|
> = Events extends (infer E)[]
|
|
2493
2464
|
? E extends 'welcome'
|
|
@@ -4214,21 +4185,18 @@ export declare type PatchBuilder = (patch: Patch) => Patch
|
|
|
4214
4185
|
|
|
4215
4186
|
/** @beta */
|
|
4216
4187
|
export declare type PatchDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
4217
|
-
|
|
|
4218
|
-
| PatchDocumentAsync<T>
|
|
4188
|
+
PatchDocumentSync<T> | PatchDocumentAsync<T>
|
|
4219
4189
|
|
|
4220
4190
|
/** @beta */
|
|
4221
4191
|
declare type PatchDocumentAsync<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4222
|
-
|
|
|
4223
|
-
| PatchTargetDocumentRequest<T>
|
|
4192
|
+
PatchExistingDocumentRequest | PatchTargetDocumentRequest<T>
|
|
4224
4193
|
) &
|
|
4225
4194
|
PatchRequestBase &
|
|
4226
4195
|
AgentActionAsync
|
|
4227
4196
|
|
|
4228
4197
|
/** @beta */
|
|
4229
4198
|
declare type PatchDocumentSync<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4230
|
-
|
|
|
4231
|
-
| PatchTargetDocumentRequest<T>
|
|
4199
|
+
PatchExistingDocumentRequest | PatchTargetDocumentRequest<T>
|
|
4232
4200
|
) &
|
|
4233
4201
|
PatchRequestBase &
|
|
4234
4202
|
AgentActionSync
|
|
@@ -4394,8 +4362,7 @@ declare interface PromptJsonResponse<T extends Record<string, Any> = Record<stri
|
|
|
4394
4362
|
|
|
4395
4363
|
/** @beta */
|
|
4396
4364
|
export declare type PromptRequest<T extends Record<string, Any> = Record<string, Any>> = (
|
|
4397
|
-
|
|
|
4398
|
-
| PromptJsonResponse<T>
|
|
4365
|
+
PromptTextResponse | PromptJsonResponse<T>
|
|
4399
4366
|
) &
|
|
4400
4367
|
PromptRequestBase
|
|
4401
4368
|
|
|
@@ -4540,9 +4507,7 @@ export declare interface PublishReleaseAction {
|
|
|
4540
4507
|
|
|
4541
4508
|
/** @public */
|
|
4542
4509
|
export declare type QueryOptions =
|
|
4543
|
-
|
|
|
4544
|
-
| UnfilteredResponseQueryOptions
|
|
4545
|
-
| UnfilteredResponseWithoutQuery
|
|
4510
|
+
FilteredResponseQueryOptions | UnfilteredResponseQueryOptions | UnfilteredResponseWithoutQuery
|
|
4546
4511
|
|
|
4547
4512
|
/** @public */
|
|
4548
4513
|
export declare interface QueryParams {
|
|
@@ -5185,8 +5150,10 @@ export declare type ResumableListenEventNames =
|
|
|
5185
5150
|
| 'reset'
|
|
5186
5151
|
|
|
5187
5152
|
/** @public */
|
|
5188
|
-
export declare interface ResumableListenOptions
|
|
5189
|
-
|
|
5153
|
+
export declare interface ResumableListenOptions extends Omit<
|
|
5154
|
+
ListenOptions,
|
|
5155
|
+
'events' | 'enableResume'
|
|
5156
|
+
> {
|
|
5190
5157
|
/**
|
|
5191
5158
|
* If this is enabled, the client will normally resume events upon reconnect
|
|
5192
5159
|
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
@@ -6112,8 +6079,28 @@ export declare interface SanityProjectMember {
|
|
|
6112
6079
|
isCurrentUser: boolean
|
|
6113
6080
|
}
|
|
6114
6081
|
|
|
6115
|
-
/**
|
|
6116
|
-
|
|
6082
|
+
/**
|
|
6083
|
+
* The query registry as seen from `@sanity/client`. Inherits every query registered on the global
|
|
6084
|
+
* `SanityQueries` interface, and still accepts the older module augmentation form:
|
|
6085
|
+
* ```ts
|
|
6086
|
+
* declare module '@sanity/client' {
|
|
6087
|
+
* interface SanityQueries {
|
|
6088
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
6089
|
+
* }
|
|
6090
|
+
* }
|
|
6091
|
+
* ```
|
|
6092
|
+
* `@sanity/client` releases that predate the global registry only read this interface, so a
|
|
6093
|
+
* generated file that registers queries globally can bridge them with an augmentation that adds
|
|
6094
|
+
* the global as a base type. It is harmless on releases that already inherit it:
|
|
6095
|
+
* ```ts
|
|
6096
|
+
* declare module '@sanity/client' {
|
|
6097
|
+
* interface SanityQueries extends globalThis.SanityQueries {}
|
|
6098
|
+
* }
|
|
6099
|
+
* ```
|
|
6100
|
+
* @public
|
|
6101
|
+
*/
|
|
6102
|
+
declare interface SanityQueries_2 extends globalThis.SanityQueries {}
|
|
6103
|
+
export {SanityQueries_2 as SanityQueries}
|
|
6117
6104
|
|
|
6118
6105
|
/** @internal */
|
|
6119
6106
|
export declare interface SanityReference {
|
|
@@ -6428,10 +6415,7 @@ export declare type StudioBaseRoute = {
|
|
|
6428
6415
|
|
|
6429
6416
|
/** @alpha */
|
|
6430
6417
|
export declare type StudioBaseUrl =
|
|
6431
|
-
|
|
|
6432
|
-
| `${string}.sanity.studio`
|
|
6433
|
-
| `https://${string}`
|
|
6434
|
-
| string
|
|
6418
|
+
`/${string}` | `${string}.sanity.studio` | `https://${string}` | string
|
|
6435
6419
|
|
|
6436
6420
|
/** @alpha */
|
|
6437
6421
|
export declare type StudioUrl = StudioBaseUrl | StudioBaseRoute
|
|
@@ -6555,8 +6539,7 @@ export declare type TransactionMutationOptions =
|
|
|
6555
6539
|
|
|
6556
6540
|
/** @beta */
|
|
6557
6541
|
export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
6558
|
-
|
|
6559
|
-
| TransformDocumentAsync
|
|
6542
|
+
TransformDocumentSync<T> | TransformDocumentAsync
|
|
6560
6543
|
|
|
6561
6544
|
/** @beta */
|
|
6562
6545
|
declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
|
|
@@ -6820,8 +6803,7 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
|
|
|
6820
6803
|
|
|
6821
6804
|
/** @beta */
|
|
6822
6805
|
export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
6823
|
-
|
|
6824
|
-
| TranslateDocumentAsync
|
|
6806
|
+
TranslateDocumentSync<T> | TranslateDocumentAsync
|
|
6825
6807
|
|
|
6826
6808
|
/** @beta */
|
|
6827
6809
|
declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
|
|
@@ -7106,10 +7088,7 @@ export declare const vercelStegaCleanAll: typeof stegaClean
|
|
|
7106
7088
|
|
|
7107
7089
|
/** @public */
|
|
7108
7090
|
export declare type VersionAction =
|
|
7109
|
-
|
|
|
7110
|
-
| DiscardVersionAction
|
|
7111
|
-
| ReplaceVersionAction
|
|
7112
|
-
| UnpublishVersionAction
|
|
7091
|
+
CreateVersionAction | DiscardVersionAction | ReplaceVersionAction | UnpublishVersionAction
|
|
7113
7092
|
|
|
7114
7093
|
/** @public */
|
|
7115
7094
|
export declare interface VideoPlaybackInfo<
|
|
@@ -7134,8 +7113,7 @@ export declare interface VideoPlaybackInfo<
|
|
|
7134
7113
|
|
|
7135
7114
|
/** @public */
|
|
7136
7115
|
export declare type VideoPlaybackInfoItem =
|
|
7137
|
-
|
|
|
7138
|
-
| VideoPlaybackInfoItemSigned
|
|
7116
|
+
VideoPlaybackInfoItemPublic | VideoPlaybackInfoItemSigned
|
|
7139
7117
|
|
|
7140
7118
|
/** @public */
|
|
7141
7119
|
export declare interface VideoPlaybackInfoItemPublic {
|
|
@@ -7240,3 +7218,23 @@ export declare type WelcomeEvent = {
|
|
|
7240
7218
|
}
|
|
7241
7219
|
|
|
7242
7220
|
export {}
|
|
7221
|
+
|
|
7222
|
+
declare global {
|
|
7223
|
+
/**
|
|
7224
|
+
* Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
|
|
7225
|
+
* the queries it finds:
|
|
7226
|
+
* ```ts
|
|
7227
|
+
* declare global {
|
|
7228
|
+
* interface SanityQueries {
|
|
7229
|
+
* '*[_type == "post"]': PostsQueryResult
|
|
7230
|
+
* }
|
|
7231
|
+
* }
|
|
7232
|
+
* ```
|
|
7233
|
+
* `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
|
|
7234
|
+
*
|
|
7235
|
+
* The registry is a global rather than a module augmentation of `@sanity/client` so that it
|
|
7236
|
+
* does not depend on module resolution: it resolves the same whether `@sanity/client` is a
|
|
7237
|
+
* direct dependency, how many copies of it are installed, and from every subpath export.
|
|
7238
|
+
*/
|
|
7239
|
+
interface SanityQueries {}
|
|
7240
|
+
}
|