@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.
- package/README.md +5 -377
- package/dist/browserUpload-CQgx9YYo.js +86 -0
- package/dist/browserUpload-CQgx9YYo.js.map +1 -0
- package/dist/browserUpload-icWlVP15.js +86 -0
- package/dist/browserUpload-icWlVP15.js.map +1 -0
- package/dist/config-a8VajuEY.js +126 -0
- package/dist/config-a8VajuEY.js.map +1 -0
- package/dist/csm.d.ts +122 -335
- package/dist/csm.js +79 -91
- package/dist/csm.js.map +1 -1
- package/dist/dist-C9ExSk2R.js +73 -0
- package/dist/dist-C9ExSk2R.js.map +1 -0
- package/dist/dist-Z8cIRxoB.js +69 -0
- package/dist/dist-Z8cIRxoB.js.map +1 -0
- package/dist/index.d.ts +107 -6723
- package/dist/index.js +2822 -2847
- package/dist/index.js.map +1 -1
- package/dist/{index.d.cts → index.node.d.ts} +4291 -5328
- package/dist/index.node.js +3131 -0
- package/dist/index.node.js.map +1 -0
- package/dist/isRecord-Kfmt-nk-.js +7 -0
- package/dist/isRecord-Kfmt-nk-.js.map +1 -0
- package/dist/media-library.d.ts +9 -100
- package/dist/media-library.js +36 -14
- package/dist/media-library.js.map +1 -1
- package/dist/request-CJxcN16k.js +372 -0
- package/dist/request-CJxcN16k.js.map +1 -0
- package/dist/request-k7VS_NnC.js +354 -0
- package/dist/request-k7VS_NnC.js.map +1 -0
- package/dist/resolveEditInfo-sq7yF78q.js +325 -0
- package/dist/resolveEditInfo-sq7yF78q.js.map +1 -0
- package/dist/rolldown-runtime-vyAXikos.js +9 -0
- package/dist/stega.d.ts +78 -7137
- package/dist/stega.js +27 -20
- package/dist/stega.js.map +1 -1
- package/dist/stegaClean-C18wLWau.js +21 -0
- package/dist/stegaClean-C18wLWau.js.map +1 -0
- package/dist/stegaEncodeSourceMap-B2fGArSf.js +163 -0
- package/dist/stegaEncodeSourceMap-B2fGArSf.js.map +1 -0
- package/dist/stegaEncodeSourceMap-DkoIlutY.js +367 -0
- package/dist/stegaEncodeSourceMap-DkoIlutY.js.map +1 -0
- package/dist/{index.browser.d.cts → types-CUxZSgB2.d.ts} +3956 -5256
- package/dist/types-CfGzbXrl.d.ts +108 -0
- package/package.json +64 -141
- package/src/SanityClient.ts +82 -117
- package/src/agent/actions/AgentActionsClient.ts +12 -12
- package/src/agent/actions/commonTypes.ts +2 -1
- package/src/agent/actions/generate.ts +26 -6
- package/src/agent/actions/patch.ts +27 -7
- package/src/agent/actions/prompt.ts +19 -5
- package/src/agent/actions/transform.ts +23 -5
- package/src/agent/actions/translate.ts +23 -5
- package/src/assets/AssetsClient.ts +71 -23
- package/src/csm/applySourceDocuments.ts +3 -1
- package/src/csm/createEditUrl.ts +1 -1
- package/src/csm/draftUtils.ts +0 -1
- package/src/csm/index.ts +2 -2
- package/src/csm/studioPath.ts +2 -1
- package/src/csm/types.ts +8 -2
- package/src/data/dataMethods.ts +801 -349
- package/src/data/eventsource.ts +13 -10
- package/src/data/listen.ts +18 -23
- package/src/data/live.ts +44 -27
- package/src/data/resolveEventSourceFetch.ts +96 -0
- package/src/datasets/DatasetsClient.ts +58 -41
- package/src/defineCreateClient.ts +35 -23
- package/src/http/browserMiddleware.ts +7 -1
- package/src/http/browserUpload.ts +162 -0
- package/src/http/errors.ts +60 -6
- package/src/http/nodeMiddleware.ts +94 -30
- package/src/http/request.ts +310 -87
- package/src/http/requestOptions.ts +131 -15
- package/src/{index.browser.ts → index.node.ts} +9 -4
- package/src/index.ts +4 -3
- package/src/mediaLibrary/MediaLibraryVideoClient.ts +26 -11
- package/src/projects/ProjectsClient.ts +18 -16
- package/src/releases/ReleasesClient.ts +38 -33
- package/src/stega/index.ts +1 -2
- package/src/stega/stegaEncodeSourceMap.ts +5 -0
- package/src/stega/types.ts +2 -2
- package/src/types.ts +148 -105
- package/src/users/UsersClient.ts +10 -14
- package/src/util/shareReplayLatest.ts +1 -1
- package/src/warnings.ts +6 -1
- package/dist/_chunks-cjs/config.cjs +0 -206
- package/dist/_chunks-cjs/config.cjs.map +0 -1
- package/dist/_chunks-cjs/isRecord.cjs +0 -6
- package/dist/_chunks-cjs/isRecord.cjs.map +0 -1
- package/dist/_chunks-cjs/resolveEditInfo.cjs +0 -334
- package/dist/_chunks-cjs/resolveEditInfo.cjs.map +0 -1
- package/dist/_chunks-cjs/stegaClean.cjs +0 -46
- package/dist/_chunks-cjs/stegaClean.cjs.map +0 -1
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs +0 -388
- package/dist/_chunks-cjs/stegaEncodeSourceMap.cjs.map +0 -1
- package/dist/_chunks-es/config.js +0 -207
- package/dist/_chunks-es/config.js.map +0 -1
- package/dist/_chunks-es/isRecord.js +0 -7
- package/dist/_chunks-es/isRecord.js.map +0 -1
- package/dist/_chunks-es/resolveEditInfo.js +0 -335
- package/dist/_chunks-es/resolveEditInfo.js.map +0 -1
- package/dist/_chunks-es/stegaClean.js +0 -47
- package/dist/_chunks-es/stegaClean.js.map +0 -1
- package/dist/_chunks-es/stegaEncodeSourceMap.js +0 -389
- package/dist/_chunks-es/stegaEncodeSourceMap.js.map +0 -1
- package/dist/csm.cjs +0 -99
- package/dist/csm.cjs.map +0 -1
- package/dist/csm.d.cts +0 -391
- package/dist/index.browser.cjs +0 -3106
- package/dist/index.browser.cjs.map +0 -1
- package/dist/index.browser.d.ts +0 -6802
- package/dist/index.browser.js +0 -3082
- package/dist/index.browser.js.map +0 -1
- package/dist/index.cjs +0 -2946
- package/dist/index.cjs.map +0 -1
- package/dist/media-library.cjs +0 -20
- package/dist/media-library.cjs.map +0 -1
- package/dist/media-library.d.cts +0 -117
- package/dist/stega.browser.cjs +0 -29
- package/dist/stega.browser.cjs.map +0 -1
- package/dist/stega.browser.d.cts +0 -7200
- package/dist/stega.browser.d.ts +0 -7200
- package/dist/stega.browser.js +0 -24
- package/dist/stega.browser.js.map +0 -1
- package/dist/stega.cjs +0 -29
- package/dist/stega.cjs.map +0 -1
- package/dist/stega.d.cts +0 -7200
- package/src/data/eventsourcePolyfill.ts +0 -7
- package/umd/.gitkeep +0 -1
- package/umd/sanityClient.js +0 -6543
- package/umd/sanityClient.min.js +0 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
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
|
|
45
|
+
const url = buildVideoPlaybackInfoUrl(instanceId, effectiveLibraryId)
|
|
46
46
|
const queryParams = buildQueryParams(options)
|
|
47
47
|
|
|
48
|
-
return
|
|
48
|
+
return _requestObservable<VideoPlaybackInfo>(this.#client, this.#httpRequest, {
|
|
49
49
|
method: 'GET',
|
|
50
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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 {
|
|
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
|
|
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
|
|
55
|
-
|
|
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
|
|
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
|
|
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
|
|
105
|
-
|
|
106
|
-
|
|
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
|
|
118
|
-
|
|
119
|
-
)
|
|
119
|
+
return _request<SanityProject>(this.#client, this.#httpRequest, {
|
|
120
|
+
url: `/projects/${projectId}`,
|
|
121
|
+
})
|
|
120
122
|
}
|
|
121
123
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
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
|
|
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']>}
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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']>}
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
688
|
+
return _getReleaseDocuments(this.#client, this.#httpRequest, releaseId, options)
|
|
684
689
|
}
|
|
685
690
|
}
|
package/src/stega/index.ts
CHANGED
|
@@ -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,
|
package/src/stega/types.ts
CHANGED
|
@@ -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
|
-
|
|
22
|
+
| RawQueryResponse<unknown>
|
|
23
|
+
| Pick<RawQueryResponse<unknown>, 'result' | 'resultSourceMap'>
|
|
24
24
|
|
|
25
25
|
/** @public */
|
|
26
26
|
export interface StegaConfig {
|