@sanity/client 7.26.0 → 7.26.2

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/_chunks-cjs/resolveEditInfo.cjs +4 -4
  3. package/dist/_chunks-cjs/resolveEditInfo.cjs.map +1 -1
  4. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +3 -3
  5. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +1 -1
  6. package/dist/_chunks-es/resolveEditInfo.js +4 -4
  7. package/dist/_chunks-es/resolveEditInfo.js.map +1 -1
  8. package/dist/_chunks-es/stegaEncodeSourceMap.js +3 -3
  9. package/dist/_chunks-es/stegaEncodeSourceMap.js.map +1 -1
  10. package/dist/csm.cjs.map +1 -1
  11. package/dist/csm.d.cts +5 -17
  12. package/dist/csm.d.ts +5 -17
  13. package/dist/csm.js.map +1 -1
  14. package/dist/index.browser.cjs +1 -1
  15. package/dist/index.browser.cjs.map +1 -1
  16. package/dist/index.browser.d.cts +23 -62
  17. package/dist/index.browser.d.ts +23 -62
  18. package/dist/index.browser.js +1 -1
  19. package/dist/index.browser.js.map +1 -1
  20. package/dist/index.cjs +3 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +22 -57
  23. package/dist/index.d.ts +22 -57
  24. package/dist/index.js +3 -4
  25. package/dist/index.js.map +1 -1
  26. package/dist/stega.browser.cjs.map +1 -1
  27. package/dist/stega.browser.d.cts +29 -69
  28. package/dist/stega.browser.d.ts +29 -69
  29. package/dist/stega.browser.js.map +1 -1
  30. package/dist/stega.cjs.map +1 -1
  31. package/dist/stega.d.cts +29 -69
  32. package/dist/stega.d.ts +29 -69
  33. package/dist/stega.js.map +1 -1
  34. package/package.json +31 -31
  35. package/src/agent/actions/commonTypes.ts +1 -2
  36. package/src/agent/actions/generate.ts +3 -6
  37. package/src/agent/actions/patch.ts +3 -6
  38. package/src/agent/actions/prompt.ts +1 -2
  39. package/src/agent/actions/transform.ts +1 -2
  40. package/src/agent/actions/translate.ts +1 -2
  41. package/src/csm/applySourceDocuments.ts +1 -3
  42. package/src/csm/types.ts +1 -3
  43. package/src/data/listen.ts +1 -2
  44. package/src/releases/ReleasesClient.ts +2 -4
  45. package/src/stega/stegaBrand.ts +3 -1
  46. package/src/stega/types.ts +1 -2
  47. package/src/types.ts +9 -38
  48. package/umd/sanityClient.js +21 -14
  49. package/umd/sanityClient.min.js +2 -2
package/dist/stega.d.cts CHANGED
@@ -417,14 +417,7 @@ export declare interface ArchiveReleaseAction {
417
417
 
418
418
  /** @public */
419
419
  export declare type AssetMetadataType =
420
- | 'location'
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,11 +859,7 @@ export declare class ClientError extends Error {
866
859
 
867
860
  /** @public */
868
861
  export declare type ClientPerspective =
869
- | DeprecatedPreviewDrafts
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<
@@ -1041,14 +1030,12 @@ declare interface ContentSourceMapDocumentBase_2 {
1041
1030
 
1042
1031
  /** @public */
1043
1032
  export declare type ContentSourceMapDocuments = (
1044
- | ContentSourceMapDocument
1045
- | ContentSourceMapRemoteDocument
1033
+ ContentSourceMapDocument | ContentSourceMapRemoteDocument
1046
1034
  )[]
1047
1035
 
1048
1036
  /** @public */
1049
1037
  declare type ContentSourceMapDocuments_2 = (
1050
- | ContentSourceMapDocument_2
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
- | string
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
- | GenerateExistingDocumentRequest
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
- | GenerateSyncInstruction<T>
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
- | GenerateExistingDocumentRequest
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
- | MutationEvent<R>
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
- | LiveEventRestart
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
- | ResumableListenEventNames
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
- | PatchDocumentSync<T>
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
- | PatchExistingDocumentRequest
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
- | PatchExistingDocumentRequest
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
- | PromptTextResponse
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
- | FilteredResponseQueryOptions
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
- extends Omit<ListenOptions, 'events' | 'enableResume'> {
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
@@ -6213,6 +6180,8 @@ export declare function stegaBrand<Result>(result: Result): StegaBranded<Result>
6213
6180
  * - Portable Text internals: the encoder only visits `children` of `_type: 'block'` objects and
6214
6181
  * `text` of `_type: 'span'` objects, so properties like `style`, `listItem` and `marks` stay
6215
6182
  * plain
6183
+ * - symbol-keyed properties (like TypeGen's `internalGroqTypeReferenceTo` reference marker): JSON
6184
+ * can't contain symbol keys, so they only exist in the type system and are never encoded
6216
6185
  *
6217
6186
  * Every other string is assumed to be "poisoned", even if the runtime `filter` happens to skip it
6218
6187
  * (URLs, dates, keys ending in `Id`, denylisted keys). Being conservative is safe: the worst case
@@ -6234,7 +6203,7 @@ export declare type StegaBranded<
6234
6203
  readonly ' stegaBrand': string
6235
6204
  }
6236
6205
  ? T
6237
- : Key extends `_${string}` | 'slug'
6206
+ : Key extends `_${string}` | 'slug' | symbol
6238
6207
  ? T
6239
6208
  : Key extends 'current'
6240
6209
  ? ParentKey extends 'slug'
@@ -6426,10 +6395,7 @@ export declare type StudioBaseRoute = {
6426
6395
 
6427
6396
  /** @alpha */
6428
6397
  export declare type StudioBaseUrl =
6429
- | `/${string}`
6430
- | `${string}.sanity.studio`
6431
- | `https://${string}`
6432
- | string
6398
+ `/${string}` | `${string}.sanity.studio` | `https://${string}` | string
6433
6399
 
6434
6400
  /** @alpha */
6435
6401
  export declare type StudioUrl = StudioBaseUrl | StudioBaseRoute
@@ -6553,8 +6519,7 @@ export declare type TransactionMutationOptions =
6553
6519
 
6554
6520
  /** @beta */
6555
6521
  export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
6556
- | TransformDocumentSync<T>
6557
- | TransformDocumentAsync
6522
+ TransformDocumentSync<T> | TransformDocumentAsync
6558
6523
 
6559
6524
  /** @beta */
6560
6525
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
@@ -6818,8 +6783,7 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
6818
6783
 
6819
6784
  /** @beta */
6820
6785
  export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
6821
- | TranslateDocumentSync<T>
6822
- | TranslateDocumentAsync
6786
+ TranslateDocumentSync<T> | TranslateDocumentAsync
6823
6787
 
6824
6788
  /** @beta */
6825
6789
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
@@ -7104,10 +7068,7 @@ export declare const vercelStegaCleanAll: typeof stegaClean
7104
7068
 
7105
7069
  /** @public */
7106
7070
  export declare type VersionAction =
7107
- | CreateVersionAction
7108
- | DiscardVersionAction
7109
- | ReplaceVersionAction
7110
- | UnpublishVersionAction
7071
+ CreateVersionAction | DiscardVersionAction | ReplaceVersionAction | UnpublishVersionAction
7111
7072
 
7112
7073
  /** @public */
7113
7074
  export declare interface VideoPlaybackInfo<
@@ -7132,8 +7093,7 @@ export declare interface VideoPlaybackInfo<
7132
7093
 
7133
7094
  /** @public */
7134
7095
  export declare type VideoPlaybackInfoItem =
7135
- | VideoPlaybackInfoItemPublic
7136
- | VideoPlaybackInfoItemSigned
7096
+ VideoPlaybackInfoItemPublic | VideoPlaybackInfoItemSigned
7137
7097
 
7138
7098
  /** @public */
7139
7099
  export declare interface VideoPlaybackInfoItemPublic {
package/dist/stega.d.ts CHANGED
@@ -417,14 +417,7 @@ export declare interface ArchiveReleaseAction {
417
417
 
418
418
  /** @public */
419
419
  export declare type AssetMetadataType =
420
- | 'location'
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,11 +859,7 @@ export declare class ClientError extends Error {
866
859
 
867
860
  /** @public */
868
861
  export declare type ClientPerspective =
869
- | DeprecatedPreviewDrafts
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<
@@ -1041,14 +1030,12 @@ declare interface ContentSourceMapDocumentBase_2 {
1041
1030
 
1042
1031
  /** @public */
1043
1032
  export declare type ContentSourceMapDocuments = (
1044
- | ContentSourceMapDocument
1045
- | ContentSourceMapRemoteDocument
1033
+ ContentSourceMapDocument | ContentSourceMapRemoteDocument
1046
1034
  )[]
1047
1035
 
1048
1036
  /** @public */
1049
1037
  declare type ContentSourceMapDocuments_2 = (
1050
- | ContentSourceMapDocument_2
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
- | string
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
- | GenerateExistingDocumentRequest
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
- | GenerateSyncInstruction<T>
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
- | GenerateExistingDocumentRequest
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
- | MutationEvent<R>
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
- | LiveEventRestart
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
- | ResumableListenEventNames
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
- | PatchDocumentSync<T>
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
- | PatchExistingDocumentRequest
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
- | PatchExistingDocumentRequest
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
- | PromptTextResponse
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
- | FilteredResponseQueryOptions
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
- extends Omit<ListenOptions, 'events' | 'enableResume'> {
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
@@ -6213,6 +6180,8 @@ export declare function stegaBrand<Result>(result: Result): StegaBranded<Result>
6213
6180
  * - Portable Text internals: the encoder only visits `children` of `_type: 'block'` objects and
6214
6181
  * `text` of `_type: 'span'` objects, so properties like `style`, `listItem` and `marks` stay
6215
6182
  * plain
6183
+ * - symbol-keyed properties (like TypeGen's `internalGroqTypeReferenceTo` reference marker): JSON
6184
+ * can't contain symbol keys, so they only exist in the type system and are never encoded
6216
6185
  *
6217
6186
  * Every other string is assumed to be "poisoned", even if the runtime `filter` happens to skip it
6218
6187
  * (URLs, dates, keys ending in `Id`, denylisted keys). Being conservative is safe: the worst case
@@ -6234,7 +6203,7 @@ export declare type StegaBranded<
6234
6203
  readonly ' stegaBrand': string
6235
6204
  }
6236
6205
  ? T
6237
- : Key extends `_${string}` | 'slug'
6206
+ : Key extends `_${string}` | 'slug' | symbol
6238
6207
  ? T
6239
6208
  : Key extends 'current'
6240
6209
  ? ParentKey extends 'slug'
@@ -6426,10 +6395,7 @@ export declare type StudioBaseRoute = {
6426
6395
 
6427
6396
  /** @alpha */
6428
6397
  export declare type StudioBaseUrl =
6429
- | `/${string}`
6430
- | `${string}.sanity.studio`
6431
- | `https://${string}`
6432
- | string
6398
+ `/${string}` | `${string}.sanity.studio` | `https://${string}` | string
6433
6399
 
6434
6400
  /** @alpha */
6435
6401
  export declare type StudioUrl = StudioBaseUrl | StudioBaseRoute
@@ -6553,8 +6519,7 @@ export declare type TransactionMutationOptions =
6553
6519
 
6554
6520
  /** @beta */
6555
6521
  export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
6556
- | TransformDocumentSync<T>
6557
- | TransformDocumentAsync
6522
+ TransformDocumentSync<T> | TransformDocumentAsync
6558
6523
 
6559
6524
  /** @beta */
6560
6525
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
@@ -6818,8 +6783,7 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
6818
6783
 
6819
6784
  /** @beta */
6820
6785
  export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
6821
- | TranslateDocumentSync<T>
6822
- | TranslateDocumentAsync
6786
+ TranslateDocumentSync<T> | TranslateDocumentAsync
6823
6787
 
6824
6788
  /** @beta */
6825
6789
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
@@ -7104,10 +7068,7 @@ export declare const vercelStegaCleanAll: typeof stegaClean
7104
7068
 
7105
7069
  /** @public */
7106
7070
  export declare type VersionAction =
7107
- | CreateVersionAction
7108
- | DiscardVersionAction
7109
- | ReplaceVersionAction
7110
- | UnpublishVersionAction
7071
+ CreateVersionAction | DiscardVersionAction | ReplaceVersionAction | UnpublishVersionAction
7111
7072
 
7112
7073
  /** @public */
7113
7074
  export declare interface VideoPlaybackInfo<
@@ -7132,8 +7093,7 @@ export declare interface VideoPlaybackInfo<
7132
7093
 
7133
7094
  /** @public */
7134
7095
  export declare type VideoPlaybackInfoItem =
7135
- | VideoPlaybackInfoItemPublic
7136
- | VideoPlaybackInfoItemSigned
7096
+ VideoPlaybackInfoItemPublic | VideoPlaybackInfoItemSigned
7137
7097
 
7138
7098
  /** @public */
7139
7099
  export declare interface VideoPlaybackInfoItemPublic {
package/dist/stega.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"stega.js","sources":["../src/stega/stegaBrand.ts","../src/stega/index.ts"],"sourcesContent":["import type {Any, ClientReturn} from '@sanity/client'\n\n/**\n * A string that might contain stega-encoded data, and is unsafe to compare against string literals\n * until it's been cleaned with `stegaClean()`.\n *\n * The type intersects a template literal that has a human readable suffix, with a brand property\n * that holds the original string type:\n * - The suffix makes TypeScript report \"This comparison appears to be unintentional\" (TS2367) when\n * the string is compared to a literal (`===`, `switch` cases), and makes it unassignable to\n * literal unions like `'left' | 'right'`, while keeping it assignable to `string` so rendering,\n * interpolation and string methods keep working. The suffix is a type-level fiction, the runtime\n * value never ends with that text.\n * - The brand property preserves the original type so `stegaClean()` can recover it exactly. It's\n * a string-keyed property rather than a `unique symbol` so that branded types stay structurally\n * compatible across duplicated copies of `@sanity/client` in `node_modules`. It only exists in\n * the type system and is never present at runtime.\n *\n * @beta\n */\nexport type StegaString<T extends string = string> =\n `${T} (may contain hidden stega characters)` & {\n readonly ' stegaBrand': T\n }\n\n/**\n * Deeply brands the string properties of a query result as `StegaString`, marking them as\n * potentially containing stega-encoded data.\n *\n * String properties that the stega encoder is guaranteed to never encode keep their plain type:\n * - keys starting with `_` (`_id`, `_type`, `_createdAt`, `_updatedAt`, `_key`, `_ref`, `_rev` and\n * so on), which also preserves discriminated union narrowing on `_type`\n * - `slug.current` patterns: a `current` key directly under a `slug` key, as well as string valued\n * `slug` keys (covering `\"slug\": slug.current` projections)\n * - Portable Text internals: the encoder only visits `children` of `_type: 'block'` objects and\n * `text` of `_type: 'span'` objects, so properties like `style`, `listItem` and `marks` stay\n * plain\n *\n * Every other string is assumed to be \"poisoned\", even if the runtime `filter` happens to skip it\n * (URLs, dates, keys ending in `Id`, denylisted keys). Being conservative is safe: the worst case\n * is a redundant `stegaClean()` call, whereas under-branding would hide real bugs.\n *\n * The `Key` and `ParentKey` type parameters track the key the current value is found under, and\n * the key of the object containing it, they're only used internally during recursion.\n *\n * @beta\n */\nexport type StegaBranded<\n T,\n Key extends PropertyKey = number,\n ParentKey extends PropertyKey = number,\n> = 0 extends 1 & T\n ? T\n : T extends string\n ? T extends {readonly ' stegaBrand': string}\n ? T\n : Key extends `_${string}` | 'slug'\n ? T\n : Key extends 'current'\n ? ParentKey extends 'slug'\n ? T\n : StegaString<T>\n : StegaString<T>\n : T extends number | bigint | boolean | null | undefined\n ? T\n : T extends Date | RegExp | ((...args: never[]) => unknown)\n ? T\n : T extends readonly unknown[]\n ? {[Index in keyof T]: StegaBranded<T[Index], number, number>}\n : T extends {_type: 'block'}\n ? {[K in keyof T]: K extends 'children' ? StegaBranded<T[K], K, Key> : T[K]}\n : T extends {_type: 'span'}\n ? {[K in keyof T]: K extends 'text' ? StegaBranded<T[K], K, Key> : T[K]}\n : T extends object\n ? {[K in keyof T]: StegaBranded<T[K], K, Key>}\n : T\n\n/**\n * Drop-in replacement for `ClientReturn` that brands the result strings as `StegaString`, for use\n * as the first generic of `client.fetch` when stega is enabled:\n * ```ts\n * import {createClient} from '@sanity/client'\n * import type {ClientReturnStega} from '@sanity/client/stega'\n *\n * const query = '*[_type == \"post\"][0]'\n * const post = await client.fetch<ClientReturnStega<typeof query>>(query)\n * ```\n * When the query is registered in the `SanityQueries` interface (for example by `sanity typegen`),\n * the result type is looked up and deeply branded with `StegaBranded`. Otherwise it falls back to\n * `Fallback`, which defaults to `any`, just like `ClientReturn`.\n *\n * @beta\n */\nexport type ClientReturnStega<GroqString extends string, Fallback = Any> = StegaBranded<\n ClientReturn<GroqString, Fallback>\n>\n\n/**\n * Marks strings in an already fetched query result as potentially containing stega-encoded data,\n * by re-typing them as `StegaString`. Comparing branded strings to string literals is a type error\n * until they're cleaned with `stegaClean()`, which recovers the original type.\n *\n * This is an identity function, it only changes the type of the input, not its value.\n * Prefer passing `ClientReturnStega` as the first generic to `client.fetch` when possible, and use\n * this function for data that has already been fetched.\n *\n * @beta\n */\nexport function stegaBrand<Result>(result: Result): StegaBranded<Result> {\n return result as StegaBranded<Result>\n}\n","export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {type ClientReturnStega, stegaBrand, type StegaBranded, type StegaString} from './stegaBrand'\nexport {stegaClean, type StegaCleaned, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AA4GO,SAAS,WAAmB,QAAsC;AACvE,SAAO;AACT;AC5FO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAMlE,MAAM,YAAYA,aAMZ,eAAeC;"}
1
+ {"version":3,"file":"stega.js","sources":["../src/stega/stegaBrand.ts","../src/stega/index.ts"],"sourcesContent":["import type {Any, ClientReturn} from '@sanity/client'\n\n/**\n * A string that might contain stega-encoded data, and is unsafe to compare against string literals\n * until it's been cleaned with `stegaClean()`.\n *\n * The type intersects a template literal that has a human readable suffix, with a brand property\n * that holds the original string type:\n * - The suffix makes TypeScript report \"This comparison appears to be unintentional\" (TS2367) when\n * the string is compared to a literal (`===`, `switch` cases), and makes it unassignable to\n * literal unions like `'left' | 'right'`, while keeping it assignable to `string` so rendering,\n * interpolation and string methods keep working. The suffix is a type-level fiction, the runtime\n * value never ends with that text.\n * - The brand property preserves the original type so `stegaClean()` can recover it exactly. It's\n * a string-keyed property rather than a `unique symbol` so that branded types stay structurally\n * compatible across duplicated copies of `@sanity/client` in `node_modules`. It only exists in\n * the type system and is never present at runtime.\n *\n * @beta\n */\nexport type StegaString<T extends string = string> =\n `${T} (may contain hidden stega characters)` & {\n readonly ' stegaBrand': T\n }\n\n/**\n * Deeply brands the string properties of a query result as `StegaString`, marking them as\n * potentially containing stega-encoded data.\n *\n * String properties that the stega encoder is guaranteed to never encode keep their plain type:\n * - keys starting with `_` (`_id`, `_type`, `_createdAt`, `_updatedAt`, `_key`, `_ref`, `_rev` and\n * so on), which also preserves discriminated union narrowing on `_type`\n * - `slug.current` patterns: a `current` key directly under a `slug` key, as well as string valued\n * `slug` keys (covering `\"slug\": slug.current` projections)\n * - Portable Text internals: the encoder only visits `children` of `_type: 'block'` objects and\n * `text` of `_type: 'span'` objects, so properties like `style`, `listItem` and `marks` stay\n * plain\n * - symbol-keyed properties (like TypeGen's `internalGroqTypeReferenceTo` reference marker): JSON\n * can't contain symbol keys, so they only exist in the type system and are never encoded\n *\n * Every other string is assumed to be \"poisoned\", even if the runtime `filter` happens to skip it\n * (URLs, dates, keys ending in `Id`, denylisted keys). Being conservative is safe: the worst case\n * is a redundant `stegaClean()` call, whereas under-branding would hide real bugs.\n *\n * The `Key` and `ParentKey` type parameters track the key the current value is found under, and\n * the key of the object containing it, they're only used internally during recursion.\n *\n * @beta\n */\nexport type StegaBranded<\n T,\n Key extends PropertyKey = number,\n ParentKey extends PropertyKey = number,\n> = 0 extends 1 & T\n ? T\n : T extends string\n ? T extends {readonly ' stegaBrand': string}\n ? T\n : Key extends `_${string}` | 'slug' | symbol\n ? T\n : Key extends 'current'\n ? ParentKey extends 'slug'\n ? T\n : StegaString<T>\n : StegaString<T>\n : T extends number | bigint | boolean | null | undefined\n ? T\n : T extends Date | RegExp | ((...args: never[]) => unknown)\n ? T\n : T extends readonly unknown[]\n ? {[Index in keyof T]: StegaBranded<T[Index], number, number>}\n : T extends {_type: 'block'}\n ? {[K in keyof T]: K extends 'children' ? StegaBranded<T[K], K, Key> : T[K]}\n : T extends {_type: 'span'}\n ? {[K in keyof T]: K extends 'text' ? StegaBranded<T[K], K, Key> : T[K]}\n : T extends object\n ? {[K in keyof T]: StegaBranded<T[K], K, Key>}\n : T\n\n/**\n * Drop-in replacement for `ClientReturn` that brands the result strings as `StegaString`, for use\n * as the first generic of `client.fetch` when stega is enabled:\n * ```ts\n * import {createClient} from '@sanity/client'\n * import type {ClientReturnStega} from '@sanity/client/stega'\n *\n * const query = '*[_type == \"post\"][0]'\n * const post = await client.fetch<ClientReturnStega<typeof query>>(query)\n * ```\n * When the query is registered in the `SanityQueries` interface (for example by `sanity typegen`),\n * the result type is looked up and deeply branded with `StegaBranded`. Otherwise it falls back to\n * `Fallback`, which defaults to `any`, just like `ClientReturn`.\n *\n * @beta\n */\nexport type ClientReturnStega<GroqString extends string, Fallback = Any> = StegaBranded<\n ClientReturn<GroqString, Fallback>\n>\n\n/**\n * Marks strings in an already fetched query result as potentially containing stega-encoded data,\n * by re-typing them as `StegaString`. Comparing branded strings to string literals is a type error\n * until they're cleaned with `stegaClean()`, which recovers the original type.\n *\n * This is an identity function, it only changes the type of the input, not its value.\n * Prefer passing `ClientReturnStega` as the first generic to `client.fetch` when possible, and use\n * this function for data that has already been fetched.\n *\n * @beta\n */\nexport function stegaBrand<Result>(result: Result): StegaBranded<Result> {\n return result as StegaBranded<Result>\n}\n","export * from '@sanity/client'\nimport {\n createClient as originalCreateClient,\n ObservableSanityClient,\n requester as originalRequester,\n SanityClient,\n} from '@sanity/client'\n\nexport {encodeIntoResult} from './encodeIntoResult'\nexport {type ClientReturnStega, stegaBrand, type StegaBranded, type StegaString} from './stegaBrand'\nexport {stegaClean, type StegaCleaned, vercelStegaCleanAll} from './stegaClean'\nexport {stegaEncodeSourceMap} from './stegaEncodeSourceMap'\nexport * from './types'\n\n/**\n * @deprecated -- Use `import {SanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class SanityStegaClient extends SanityClient {}\n\n/**\n * @deprecated -- Use `import {ObservableSanityClient} from '@sanity/client'` instead\n * @public\n */\nexport class ObservableSanityStegaClient extends ObservableSanityClient {}\n\n/**\n * @deprecated -- Use `import {requester} from '@sanity/client'` instead\n * @public\n */\nexport const requester = originalRequester\n\n/**\n * @deprecated -- Use `import {createClient} from '@sanity/client'` instead\n * @public\n */\nexport const createClient = originalCreateClient\n"],"names":["originalRequester","originalCreateClient"],"mappings":";;;;AA8GO,SAAS,WAAmB,QAAsC;AACvE,SAAO;AACT;AC9FO,MAAM,0BAA0B,aAAa;AAAC;AAM9C,MAAM,oCAAoC,uBAAuB;AAAC;AAMlE,MAAM,YAAYA,aAMZ,eAAeC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "7.26.0",
3
+ "version": "7.26.2",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -130,49 +130,49 @@
130
130
  },
131
131
  "dependencies": {
132
132
  "@sanity/eventsource": "^5.0.4",
133
- "get-it": "^8.8.0",
134
- "nanoid": "^3.3.11",
135
- "rxjs": "^7.0.0"
133
+ "get-it": "^8.8.3",
134
+ "nanoid": "^3.3.17",
135
+ "rxjs": "^7.8.2"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@edge-runtime/types": "^4.0.0",
139
139
  "@edge-runtime/vm": "^5.0.0",
140
- "@eslint/eslintrc": "^3.3.1",
141
- "@eslint/js": "^9.24.0",
142
- "@rollup/plugin-commonjs": "^28.0.3",
143
- "@rollup/plugin-node-resolve": "^16.0.1",
140
+ "@eslint/eslintrc": "^3.3.6",
141
+ "@eslint/js": "^9.39.5",
142
+ "@rollup/plugin-commonjs": "^28.0.9",
143
+ "@rollup/plugin-node-resolve": "^16.0.3",
144
144
  "@sanity/client-latest": "npm:@sanity/client@latest",
145
- "@sanity/pkg-utils": "^7.2.2",
145
+ "@sanity/pkg-utils": "^7.11.9",
146
146
  "@types/json-diff": "^1.0.3",
147
- "@types/node": "^22.9.0",
148
- "@types/react": "^19.2.17",
149
- "@typescript-eslint/eslint-plugin": "^8.29.1",
150
- "@typescript-eslint/parser": "^8.29.1",
147
+ "@types/node": "^22.20.1",
148
+ "@types/react": "^19.2.18",
149
+ "@typescript-eslint/eslint-plugin": "^8.65.0",
150
+ "@typescript-eslint/parser": "^8.65.0",
151
151
  "@vercel/stega": "1.1.0",
152
- "@vitest/coverage-v8": "3.1.1",
153
- "eslint": "^9.24.0",
154
- "eslint-config-prettier": "^10.1.1",
152
+ "@vitest/coverage-v8": "3.2.6",
153
+ "eslint": "^9.39.5",
154
+ "eslint-config-prettier": "^10.1.8",
155
155
  "eslint-formatter-compact": "^8.40.0",
156
- "eslint-plugin-prettier": "^5.2.6",
156
+ "eslint-plugin-prettier": "^5.5.6",
157
157
  "eslint-plugin-simple-import-sort": "^12.1.1",
158
- "eslint-plugin-tsdoc": "^0.4.0",
159
- "eslint-plugin-unused-imports": "^4.1.4",
160
- "globals": "^16.0.0",
158
+ "eslint-plugin-tsdoc": "^0.5.2",
159
+ "eslint-plugin-unused-imports": "^4.4.1",
160
+ "globals": "^16.5.0",
161
161
  "happy-dom": "^12.10.3",
162
162
  "json-diff": "^1.0.6",
163
- "ls-engines": "^0.9.3",
164
- "msw": "^2.7.3",
165
- "next": "15.5.8",
163
+ "ls-engines": "^0.10.1",
164
+ "msw": "^2.15.0",
165
+ "next": "15.5.22",
166
166
  "nock": "^13.5.6",
167
- "pkg-pr-new": "^0.0.60",
168
- "prettier": "^3.5.3",
169
- "prettier-plugin-packagejson": "^2.5.10",
167
+ "pkg-pr-new": "^0.0.86",
168
+ "prettier": "^3.9.6",
169
+ "prettier-plugin-packagejson": "^2.5.22",
170
170
  "rimraf": "^5.0.7",
171
- "rollup": "^4.39.0",
172
- "sse-channel": "^4.0.0",
173
- "terser": "^5.39.0",
174
- "typescript": "5.8.3",
175
- "vitest": "3.1.1"
171
+ "rollup": "^4.62.4",
172
+ "sse-channel": "^4.0.2",
173
+ "terser": "^5.49.0",
174
+ "typescript": "5.9.3",
175
+ "vitest": "3.2.6"
176
176
  },
177
177
  "packageManager": "npm@11.4.1",
178
178
  "engines": {
@@ -135,8 +135,7 @@ export interface GroqAgentActionParam {
135
135
 
136
136
  /** @beta */
137
137
  export type AgentActionTypeConfig =
138
- | {include: string[]; exclude?: never}
139
- | {exclude: string[]; include?: never}
138
+ {include: string[]; exclude?: never} | {exclude: string[]; include?: never}
140
139
 
141
140
  /** @beta */
142
141
  export type AgentActionPathSegment = string | {_key: string}