@sanity/client 7.26.2 → 8.0.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.
Files changed (130) hide show
  1. package/README.md +5 -377
  2. package/dist/browserUpload-CQgx9YYo.js +86 -0
  3. package/dist/browserUpload-CQgx9YYo.js.map +1 -0
  4. package/dist/browserUpload-icWlVP15.js +86 -0
  5. package/dist/browserUpload-icWlVP15.js.map +1 -0
  6. package/dist/config-a8VajuEY.js +126 -0
  7. package/dist/config-a8VajuEY.js.map +1 -0
  8. package/dist/csm.d.ts +122 -335
  9. package/dist/csm.js +79 -91
  10. package/dist/csm.js.map +1 -1
  11. package/dist/dist-C9ExSk2R.js +73 -0
  12. package/dist/dist-C9ExSk2R.js.map +1 -0
  13. package/dist/dist-Z8cIRxoB.js +69 -0
  14. package/dist/dist-Z8cIRxoB.js.map +1 -0
  15. package/dist/index.d.ts +107 -6723
  16. package/dist/index.js +2822 -2847
  17. package/dist/index.js.map +1 -1
  18. package/dist/{index.d.cts → index.node.d.ts} +4291 -5328
  19. package/dist/index.node.js +3131 -0
  20. package/dist/index.node.js.map +1 -0
  21. package/dist/isRecord-Kfmt-nk-.js +7 -0
  22. package/dist/isRecord-Kfmt-nk-.js.map +1 -0
  23. package/dist/media-library.d.ts +9 -100
  24. package/dist/media-library.js +36 -14
  25. package/dist/media-library.js.map +1 -1
  26. package/dist/request-CJxcN16k.js +372 -0
  27. package/dist/request-CJxcN16k.js.map +1 -0
  28. package/dist/request-k7VS_NnC.js +354 -0
  29. package/dist/request-k7VS_NnC.js.map +1 -0
  30. package/dist/resolveEditInfo-sq7yF78q.js +325 -0
  31. package/dist/resolveEditInfo-sq7yF78q.js.map +1 -0
  32. package/dist/rolldown-runtime-vyAXikos.js +9 -0
  33. package/dist/stega.d.ts +78 -7137
  34. package/dist/stega.js +27 -20
  35. package/dist/stega.js.map +1 -1
  36. package/dist/stegaClean-C18wLWau.js +21 -0
  37. package/dist/stegaClean-C18wLWau.js.map +1 -0
  38. package/dist/stegaEncodeSourceMap-B2fGArSf.js +163 -0
  39. package/dist/stegaEncodeSourceMap-B2fGArSf.js.map +1 -0
  40. package/dist/stegaEncodeSourceMap-DkoIlutY.js +367 -0
  41. package/dist/stegaEncodeSourceMap-DkoIlutY.js.map +1 -0
  42. package/dist/{index.browser.d.cts → types-CUxZSgB2.d.ts} +3956 -5256
  43. package/dist/types-CfGzbXrl.d.ts +108 -0
  44. package/package.json +64 -141
  45. package/src/SanityClient.ts +82 -117
  46. package/src/agent/actions/AgentActionsClient.ts +12 -12
  47. package/src/agent/actions/commonTypes.ts +2 -1
  48. package/src/agent/actions/generate.ts +26 -6
  49. package/src/agent/actions/patch.ts +27 -7
  50. package/src/agent/actions/prompt.ts +19 -5
  51. package/src/agent/actions/transform.ts +23 -5
  52. package/src/agent/actions/translate.ts +23 -5
  53. package/src/assets/AssetsClient.ts +71 -23
  54. package/src/csm/applySourceDocuments.ts +3 -1
  55. package/src/csm/createEditUrl.ts +1 -1
  56. package/src/csm/draftUtils.ts +0 -1
  57. package/src/csm/index.ts +2 -2
  58. package/src/csm/studioPath.ts +2 -1
  59. package/src/csm/types.ts +8 -2
  60. package/src/data/dataMethods.ts +801 -349
  61. package/src/data/eventsource.ts +13 -10
  62. package/src/data/listen.ts +18 -23
  63. package/src/data/live.ts +44 -27
  64. package/src/data/resolveEventSourceFetch.ts +96 -0
  65. package/src/datasets/DatasetsClient.ts +58 -41
  66. package/src/defineCreateClient.ts +35 -23
  67. package/src/http/browserMiddleware.ts +7 -1
  68. package/src/http/browserUpload.ts +162 -0
  69. package/src/http/errors.ts +60 -6
  70. package/src/http/nodeMiddleware.ts +94 -30
  71. package/src/http/request.ts +310 -87
  72. package/src/http/requestOptions.ts +131 -15
  73. package/src/{index.browser.ts → index.node.ts} +9 -4
  74. package/src/index.ts +4 -3
  75. package/src/mediaLibrary/MediaLibraryVideoClient.ts +26 -11
  76. package/src/projects/ProjectsClient.ts +18 -16
  77. package/src/releases/ReleasesClient.ts +38 -33
  78. package/src/stega/index.ts +1 -2
  79. package/src/stega/stegaEncodeSourceMap.ts +5 -0
  80. package/src/stega/types.ts +2 -2
  81. package/src/types.ts +148 -105
  82. package/src/users/UsersClient.ts +10 -14
  83. package/src/util/shareReplayLatest.ts +1 -1
  84. package/src/warnings.ts +6 -1
  85. package/dist/_chunks-cjs/config.cjs +0 -206
  86. package/dist/_chunks-cjs/config.cjs.map +0 -1
  87. package/dist/_chunks-cjs/isRecord.cjs +0 -6
  88. package/dist/_chunks-cjs/isRecord.cjs.map +0 -1
  89. package/dist/_chunks-cjs/resolveEditInfo.cjs +0 -334
  90. package/dist/_chunks-cjs/resolveEditInfo.cjs.map +0 -1
  91. package/dist/_chunks-cjs/stegaClean.cjs +0 -46
  92. package/dist/_chunks-cjs/stegaClean.cjs.map +0 -1
  93. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +0 -388
  94. package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +0 -1
  95. package/dist/_chunks-es/config.js +0 -207
  96. package/dist/_chunks-es/config.js.map +0 -1
  97. package/dist/_chunks-es/isRecord.js +0 -7
  98. package/dist/_chunks-es/isRecord.js.map +0 -1
  99. package/dist/_chunks-es/resolveEditInfo.js +0 -335
  100. package/dist/_chunks-es/resolveEditInfo.js.map +0 -1
  101. package/dist/_chunks-es/stegaClean.js +0 -47
  102. package/dist/_chunks-es/stegaClean.js.map +0 -1
  103. package/dist/_chunks-es/stegaEncodeSourceMap.js +0 -389
  104. package/dist/_chunks-es/stegaEncodeSourceMap.js.map +0 -1
  105. package/dist/csm.cjs +0 -99
  106. package/dist/csm.cjs.map +0 -1
  107. package/dist/csm.d.cts +0 -391
  108. package/dist/index.browser.cjs +0 -3106
  109. package/dist/index.browser.cjs.map +0 -1
  110. package/dist/index.browser.d.ts +0 -6802
  111. package/dist/index.browser.js +0 -3082
  112. package/dist/index.browser.js.map +0 -1
  113. package/dist/index.cjs +0 -2946
  114. package/dist/index.cjs.map +0 -1
  115. package/dist/media-library.cjs +0 -20
  116. package/dist/media-library.cjs.map +0 -1
  117. package/dist/media-library.d.cts +0 -117
  118. package/dist/stega.browser.cjs +0 -29
  119. package/dist/stega.browser.cjs.map +0 -1
  120. package/dist/stega.browser.d.cts +0 -7200
  121. package/dist/stega.browser.d.ts +0 -7200
  122. package/dist/stega.browser.js +0 -24
  123. package/dist/stega.browser.js.map +0 -1
  124. package/dist/stega.cjs +0 -29
  125. package/dist/stega.cjs.map +0 -1
  126. package/dist/stega.d.cts +0 -7200
  127. package/src/data/eventsourcePolyfill.ts +0 -7
  128. package/umd/.gitkeep +0 -1
  129. package/umd/sanityClient.js +0 -6543
  130. package/umd/sanityClient.min.js +0 -6
@@ -1,6 +1,6 @@
1
- import {lastValueFrom, type Observable} from 'rxjs'
1
+ import {type Observable} from 'rxjs'
2
2
 
3
- import {_request} from '../data/dataMethods'
3
+ import {_request, _requestObservable} from '../data/dataMethods'
4
4
  import type {ObservableSanityClient, SanityClient} from '../SanityClient'
5
5
  import type {
6
6
  HttpRequest,
@@ -42,12 +42,12 @@ export class ObservableMediaLibraryVideoClient {
42
42
  )
43
43
  }
44
44
 
45
- const uri = buildVideoPlaybackInfoUrl(instanceId, effectiveLibraryId)
45
+ const url = buildVideoPlaybackInfoUrl(instanceId, effectiveLibraryId)
46
46
  const queryParams = buildQueryParams(options)
47
47
 
48
- return _request<VideoPlaybackInfo>(this.#client, this.#httpRequest, {
48
+ return _requestObservable<VideoPlaybackInfo>(this.#client, this.#httpRequest, {
49
49
  method: 'GET',
50
- uri,
50
+ url,
51
51
  query: queryParams,
52
52
  })
53
53
  }
@@ -72,12 +72,27 @@ export class MediaLibraryVideoClient {
72
72
  assetIdentifier: MediaLibraryAssetInstanceIdentifier,
73
73
  options: MediaLibraryPlaybackInfoOptions = {},
74
74
  ): Promise<VideoPlaybackInfo> {
75
- return lastValueFrom(
76
- new ObservableMediaLibraryVideoClient(
77
- this.#client.observable,
78
- this.#httpRequest,
79
- ).getPlaybackInfo(assetIdentifier, options),
80
- )
75
+ const config = this.#client.config()
76
+ const resource = config.resource || config['~experimental_resource']
77
+ const configMediaLibraryId = resource?.id
78
+
79
+ const {instanceId, libraryId} = parseAssetInstanceId(assetIdentifier)
80
+ const effectiveLibraryId = libraryId || configMediaLibraryId
81
+
82
+ if (!effectiveLibraryId) {
83
+ throw new Error(
84
+ 'Could not determine Media Library ID - you need to provide a valid Media Library ID in the client config or a Media Library GDR',
85
+ )
86
+ }
87
+
88
+ const url = buildVideoPlaybackInfoUrl(instanceId, effectiveLibraryId)
89
+ const queryParams = buildQueryParams(options)
90
+
91
+ return _request<VideoPlaybackInfo>(this.#client, this.#httpRequest, {
92
+ method: 'GET',
93
+ url,
94
+ query: queryParams,
95
+ })
81
96
  }
82
97
  }
83
98
 
@@ -1,6 +1,6 @@
1
- import {lastValueFrom, type Observable} from 'rxjs'
1
+ import {type Observable} from 'rxjs'
2
2
 
3
- import {_request} from '../data/dataMethods'
3
+ import {_request, _requestObservable} from '../data/dataMethods'
4
4
  import type {ObservableSanityClient, SanityClient} from '../SanityClient'
5
5
  import type {HttpRequest, SanityProject} from '../types'
6
6
 
@@ -37,7 +37,7 @@ export class ObservableProjectsClient {
37
37
  options?: T,
38
38
  ): Observable<Omit<SanityProject, OmittedProjectFields<T>>[]> {
39
39
  const query: Record<string, string> = {}
40
- const uri = '/projects'
40
+ const url = '/projects'
41
41
  if (options?.includeMembers === false) {
42
42
  query.includeMembers = 'false'
43
43
  }
@@ -51,9 +51,10 @@ export class ObservableProjectsClient {
51
51
  query.onlyExplicitMembership = 'true'
52
52
  }
53
53
 
54
- return _request<SanityProject[]>(this.#client, this.#httpRequest, {uri, query}) as Observable<
55
- Omit<SanityProject, OmittedProjectFields<T>>[]
56
- >
54
+ return _requestObservable<SanityProject[]>(this.#client, this.#httpRequest, {
55
+ url,
56
+ query,
57
+ }) as Observable<Omit<SanityProject, OmittedProjectFields<T>>[]>
57
58
  }
58
59
 
59
60
  /**
@@ -62,7 +63,9 @@ export class ObservableProjectsClient {
62
63
  * @param projectId - ID of the project to fetch
63
64
  */
64
65
  getById(projectId: string): Observable<SanityProject> {
65
- return _request<SanityProject>(this.#client, this.#httpRequest, {uri: `/projects/${projectId}`})
66
+ return _requestObservable<SanityProject>(this.#client, this.#httpRequest, {
67
+ url: `/projects/${projectId}`,
68
+ })
66
69
  }
67
70
  }
68
71
 
@@ -88,7 +91,7 @@ export class ProjectsClient {
88
91
  options?: T,
89
92
  ): Promise<Omit<SanityProject, OmittedProjectFields<T>>[]> {
90
93
  const query: Record<string, string> = {}
91
- const uri = '/projects'
94
+ const url = '/projects'
92
95
  if (options?.includeMembers === false) {
93
96
  query.includeMembers = 'false'
94
97
  }
@@ -101,11 +104,10 @@ export class ProjectsClient {
101
104
  if (options?.onlyExplicitMembership) {
102
105
  query.onlyExplicitMembership = 'true'
103
106
  }
104
- return lastValueFrom(
105
- _request<SanityProject[]>(this.#client, this.#httpRequest, {uri, query}) as Observable<
106
- Omit<SanityProject, OmittedProjectFields<T>>[]
107
- >,
108
- )
107
+ return _request<SanityProject[]>(this.#client, this.#httpRequest, {
108
+ url,
109
+ query,
110
+ }) as Promise<Omit<SanityProject, OmittedProjectFields<T>>[]>
109
111
  }
110
112
 
111
113
  /**
@@ -114,8 +116,8 @@ export class ProjectsClient {
114
116
  * @param projectId - ID of the project to fetch
115
117
  */
116
118
  getById(projectId: string): Promise<SanityProject> {
117
- return lastValueFrom(
118
- _request<SanityProject>(this.#client, this.#httpRequest, {uri: `/projects/${projectId}`}),
119
- )
119
+ return _request<SanityProject>(this.#client, this.#httpRequest, {
120
+ url: `/projects/${projectId}`,
121
+ })
120
122
  }
121
123
  }
@@ -1,6 +1,13 @@
1
- import {lastValueFrom, map, Observable} from 'rxjs'
2
-
3
- import {_action, _getDocument, _getReleaseDocuments} from '../data/dataMethods'
1
+ import {map, Observable} from 'rxjs'
2
+
3
+ import {
4
+ _action,
5
+ _actionObservable,
6
+ _getDocument,
7
+ _getDocumentObservable,
8
+ _getReleaseDocuments,
9
+ _getReleaseDocumentsObservable,
10
+ } from '../data/dataMethods'
4
11
  import type {ObservableSanityClient, SanityClient} from '../SanityClient'
5
12
  import type {
6
13
  ArchiveReleaseAction,
@@ -61,7 +68,7 @@ export class ObservableReleasesClient {
61
68
  {releaseId}: {releaseId: string},
62
69
  options?: {signal?: AbortSignal; tag?: string},
63
70
  ): Observable<ReleaseDocument | undefined> {
64
- return _getDocument<ReleaseDocument>(
71
+ return _getDocumentObservable<ReleaseDocument>(
65
72
  this.#client,
66
73
  this.#httpRequest,
67
74
  `_.releases.${releaseId}`,
@@ -133,13 +140,14 @@ export class ObservableReleasesClient {
133
140
  ): Observable<SingleActionResult & {releaseId: string; metadata: ReleaseDocument['metadata']}>
134
141
  create(
135
142
  releaseOrOptions?:
136
- {releaseId?: string; metadata?: Partial<ReleaseDocument['metadata']>} | BaseActionOptions,
143
+ | {releaseId?: string; metadata?: Partial<ReleaseDocument['metadata']>}
144
+ | BaseActionOptions,
137
145
  maybeOptions?: BaseActionOptions,
138
146
  ): Observable<SingleActionResult & {releaseId: string; metadata: ReleaseDocument['metadata']}> {
139
147
  const {action, options} = createRelease(releaseOrOptions, maybeOptions)
140
148
  const {releaseId, metadata} = action
141
149
 
142
- return _action(this.#client, this.#httpRequest, action, options).pipe(
150
+ return _actionObservable(this.#client, this.#httpRequest, action, options).pipe(
143
151
  map((actionResult) => ({
144
152
  ...actionResult,
145
153
  releaseId,
@@ -171,7 +179,7 @@ export class ObservableReleasesClient {
171
179
  patch,
172
180
  }
173
181
 
174
- return _action(this.#client, this.#httpRequest, editAction, options)
182
+ return _actionObservable(this.#client, this.#httpRequest, editAction, options)
175
183
  }
176
184
 
177
185
  /**
@@ -201,7 +209,7 @@ export class ObservableReleasesClient {
201
209
  releaseId,
202
210
  }
203
211
 
204
- return _action(this.#client, this.#httpRequest, publishAction, options)
212
+ return _actionObservable(this.#client, this.#httpRequest, publishAction, options)
205
213
  }
206
214
 
207
215
  /**
@@ -228,7 +236,7 @@ export class ObservableReleasesClient {
228
236
  releaseId,
229
237
  }
230
238
 
231
- return _action(this.#client, this.#httpRequest, archiveAction, options)
239
+ return _actionObservable(this.#client, this.#httpRequest, archiveAction, options)
232
240
  }
233
241
 
234
242
  /**
@@ -253,7 +261,7 @@ export class ObservableReleasesClient {
253
261
  releaseId,
254
262
  }
255
263
 
256
- return _action(this.#client, this.#httpRequest, unarchiveAction, options)
264
+ return _actionObservable(this.#client, this.#httpRequest, unarchiveAction, options)
257
265
  }
258
266
 
259
267
  /**
@@ -282,7 +290,7 @@ export class ObservableReleasesClient {
282
290
  publishAt,
283
291
  }
284
292
 
285
- return _action(this.#client, this.#httpRequest, scheduleAction, options)
293
+ return _actionObservable(this.#client, this.#httpRequest, scheduleAction, options)
286
294
  }
287
295
 
288
296
  /**
@@ -309,7 +317,7 @@ export class ObservableReleasesClient {
309
317
  releaseId,
310
318
  }
311
319
 
312
- return _action(this.#client, this.#httpRequest, unscheduleAction, options)
320
+ return _actionObservable(this.#client, this.#httpRequest, unscheduleAction, options)
313
321
  }
314
322
 
315
323
  /**
@@ -334,7 +342,7 @@ export class ObservableReleasesClient {
334
342
  releaseId,
335
343
  }
336
344
 
337
- return _action(this.#client, this.#httpRequest, deleteAction, options)
345
+ return _actionObservable(this.#client, this.#httpRequest, deleteAction, options)
338
346
  }
339
347
 
340
348
  /**
@@ -353,7 +361,7 @@ export class ObservableReleasesClient {
353
361
  {releaseId}: {releaseId: string},
354
362
  options?: BaseMutationOptions,
355
363
  ): Observable<RawQueryResponse<SanityDocument[]>> {
356
- return _getReleaseDocuments(this.#client, this.#httpRequest, releaseId, options)
364
+ return _getReleaseDocumentsObservable(this.#client, this.#httpRequest, releaseId, options)
357
365
  }
358
366
  }
359
367
 
@@ -396,13 +404,11 @@ export class ReleasesClient {
396
404
  {releaseId}: {releaseId: string},
397
405
  options?: {signal?: AbortSignal; tag?: string},
398
406
  ): Promise<ReleaseDocument | undefined> {
399
- return lastValueFrom(
400
- _getDocument<ReleaseDocument>(
401
- this.#client,
402
- this.#httpRequest,
403
- `_.releases.${releaseId}`,
404
- options,
405
- ),
407
+ return _getDocument<ReleaseDocument>(
408
+ this.#client,
409
+ this.#httpRequest,
410
+ `_.releases.${releaseId}`,
411
+ options,
406
412
  )
407
413
  }
408
414
 
@@ -462,15 +468,14 @@ export class ReleasesClient {
462
468
  ): Promise<SingleActionResult & {releaseId: string; metadata: ReleaseDocument['metadata']}>
463
469
  async create(
464
470
  releaseOrOptions?:
465
- {releaseId?: string; metadata?: Partial<ReleaseDocument['metadata']>} | BaseActionOptions,
471
+ | {releaseId?: string; metadata?: Partial<ReleaseDocument['metadata']>}
472
+ | BaseActionOptions,
466
473
  maybeOptions?: BaseActionOptions,
467
474
  ): Promise<SingleActionResult & {releaseId: string; metadata: ReleaseDocument['metadata']}> {
468
475
  const {action, options} = createRelease(releaseOrOptions, maybeOptions)
469
476
  const {releaseId, metadata} = action
470
477
 
471
- const actionResult = await lastValueFrom(
472
- _action(this.#client, this.#httpRequest, action, options),
473
- )
478
+ const actionResult = await _action(this.#client, this.#httpRequest, action, options)
474
479
 
475
480
  return {...actionResult, releaseId, metadata}
476
481
  }
@@ -498,7 +503,7 @@ export class ReleasesClient {
498
503
  patch,
499
504
  }
500
505
 
501
- return lastValueFrom(_action(this.#client, this.#httpRequest, editAction, options))
506
+ return _action(this.#client, this.#httpRequest, editAction, options)
502
507
  }
503
508
 
504
509
  /**
@@ -528,7 +533,7 @@ export class ReleasesClient {
528
533
  releaseId,
529
534
  }
530
535
 
531
- return lastValueFrom(_action(this.#client, this.#httpRequest, publishAction, options))
536
+ return _action(this.#client, this.#httpRequest, publishAction, options)
532
537
  }
533
538
 
534
539
  /**
@@ -555,7 +560,7 @@ export class ReleasesClient {
555
560
  releaseId,
556
561
  }
557
562
 
558
- return lastValueFrom(_action(this.#client, this.#httpRequest, archiveAction, options))
563
+ return _action(this.#client, this.#httpRequest, archiveAction, options)
559
564
  }
560
565
 
561
566
  /**
@@ -580,7 +585,7 @@ export class ReleasesClient {
580
585
  releaseId,
581
586
  }
582
587
 
583
- return lastValueFrom(_action(this.#client, this.#httpRequest, unarchiveAction, options))
588
+ return _action(this.#client, this.#httpRequest, unarchiveAction, options)
584
589
  }
585
590
 
586
591
  /**
@@ -609,7 +614,7 @@ export class ReleasesClient {
609
614
  publishAt,
610
615
  }
611
616
 
612
- return lastValueFrom(_action(this.#client, this.#httpRequest, scheduleAction, options))
617
+ return _action(this.#client, this.#httpRequest, scheduleAction, options)
613
618
  }
614
619
 
615
620
  /**
@@ -636,7 +641,7 @@ export class ReleasesClient {
636
641
  releaseId,
637
642
  }
638
643
 
639
- return lastValueFrom(_action(this.#client, this.#httpRequest, unscheduleAction, options))
644
+ return _action(this.#client, this.#httpRequest, unscheduleAction, options)
640
645
  }
641
646
 
642
647
  /**
@@ -661,7 +666,7 @@ export class ReleasesClient {
661
666
  releaseId,
662
667
  }
663
668
 
664
- return lastValueFrom(_action(this.#client, this.#httpRequest, deleteAction, options))
669
+ return _action(this.#client, this.#httpRequest, deleteAction, options)
665
670
  }
666
671
 
667
672
  /**
@@ -680,6 +685,6 @@ export class ReleasesClient {
680
685
  {releaseId}: {releaseId: string},
681
686
  options?: BaseMutationOptions,
682
687
  ): Promise<RawQueryResponse<SanityDocument[]>> {
683
- return lastValueFrom(_getReleaseDocuments(this.#client, this.#httpRequest, releaseId, options))
688
+ return _getReleaseDocuments(this.#client, this.#httpRequest, releaseId, options)
684
689
  }
685
690
  }
@@ -6,10 +6,9 @@ import {
6
6
  SanityClient,
7
7
  } from '@sanity/client'
8
8
 
9
- export {encodeIntoResult} from './encodeIntoResult'
10
9
  export {type ClientReturnStega, stegaBrand, type StegaBranded, type StegaString} from './stegaBrand'
11
10
  export {stegaClean, type StegaCleaned, vercelStegaCleanAll} from './stegaClean'
12
- export {stegaEncodeSourceMap} from './stegaEncodeSourceMap'
11
+ export {encodeIntoResult, stegaEncodeSourceMap} from './stegaEncodeSourceMap'
13
12
  export * from './types'
14
13
 
15
14
  /**
@@ -5,6 +5,11 @@ import {jsonPathToStudioPath} from '../csm/jsonPath'
5
5
  import {resolveStudioBaseRoute} from '../csm/resolveEditInfo'
6
6
  import {reKeySegment, toString as studioPathToString} from '../csm/studioPath'
7
7
  import {encodeIntoResult} from './encodeIntoResult'
8
+ // Re-export so `encodeIntoResult` is a genuine export of this module - which
9
+ // forms its own output chunk via the dynamic import in `dataMethods`. Without
10
+ // this, rolldown absorbs `encodeIntoResult` into the chunk but omits it from
11
+ // the chunk's exports, breaking `@sanity/client/stega`'s re-export of it.
12
+ export {encodeIntoResult} from './encodeIntoResult'
8
13
  import {filterDefault} from './filterDefault'
9
14
  import {
10
15
  type ContentSourceMap,
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-empty-object-type */
2
1
  import type {ClientConfig, InitializedClientConfig, RawQueryResponse} from '@sanity/client'
3
2
  import type {
4
3
  ContentSourceMap,
@@ -20,7 +19,8 @@ export type {ContentSourceMap, ResolveStudioUrl}
20
19
 
21
20
  /** @public */
22
21
  export type ContentSourceMapQueryResponse =
23
- RawQueryResponse<unknown> | Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
22
+ | RawQueryResponse<unknown>
23
+ | Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
24
24
 
25
25
  /** @public */
26
26
  export interface StegaConfig {