@sanity/client 7.14.1 → 7.16.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/dist/index.browser.cjs +61 -2
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +151 -38
- package/dist/index.browser.d.ts +151 -38
- package/dist/index.browser.js +61 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +62 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +151 -38
- package/dist/index.d.ts +151 -38
- package/dist/index.js +62 -3
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +151 -38
- package/dist/stega.browser.d.ts +151 -38
- package/dist/stega.d.cts +151 -38
- package/dist/stega.d.ts +151 -38
- package/package.json +1 -1
- package/src/data/listen.ts +21 -9
- package/src/datasets/DatasetsClient.ts +93 -8
- package/src/types.ts +105 -4
- package/umd/sanityClient.js +61 -2
- package/umd/sanityClient.min.js +2 -2
package/dist/stega.d.cts
CHANGED
|
@@ -1190,6 +1190,20 @@ export declare interface CurrentSanityUser {
|
|
|
1190
1190
|
/** @public */
|
|
1191
1191
|
export declare type DatasetAclMode = 'public' | 'private' | 'custom'
|
|
1192
1192
|
|
|
1193
|
+
/** @public */
|
|
1194
|
+
export declare type DatasetCreateOptions = {
|
|
1195
|
+
aclMode?: DatasetAclMode
|
|
1196
|
+
embeddings?: {
|
|
1197
|
+
enabled: boolean
|
|
1198
|
+
projection?: string
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/** @public */
|
|
1203
|
+
export declare type DatasetEditOptions = {
|
|
1204
|
+
aclMode?: DatasetAclMode
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1193
1207
|
/** @public */
|
|
1194
1208
|
export declare type DatasetResponse = {
|
|
1195
1209
|
datasetName: string
|
|
@@ -1204,26 +1218,16 @@ export declare class DatasetsClient {
|
|
|
1204
1218
|
* Create a new dataset with the given name
|
|
1205
1219
|
*
|
|
1206
1220
|
* @param name - Name of the dataset to create
|
|
1207
|
-
* @param options - Options for the dataset
|
|
1221
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1208
1222
|
*/
|
|
1209
|
-
create(
|
|
1210
|
-
name: string,
|
|
1211
|
-
options?: {
|
|
1212
|
-
aclMode?: DatasetAclMode
|
|
1213
|
-
},
|
|
1214
|
-
): Promise<DatasetResponse>
|
|
1223
|
+
create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
|
|
1215
1224
|
/**
|
|
1216
1225
|
* Edit a dataset with the given name
|
|
1217
1226
|
*
|
|
1218
1227
|
* @param name - Name of the dataset to edit
|
|
1219
1228
|
* @param options - New options for the dataset
|
|
1220
1229
|
*/
|
|
1221
|
-
edit(
|
|
1222
|
-
name: string,
|
|
1223
|
-
options?: {
|
|
1224
|
-
aclMode?: DatasetAclMode
|
|
1225
|
-
},
|
|
1226
|
-
): Promise<DatasetResponse>
|
|
1230
|
+
edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
|
|
1227
1231
|
/**
|
|
1228
1232
|
* Delete a dataset with the given name
|
|
1229
1233
|
*
|
|
@@ -1236,6 +1240,19 @@ export declare class DatasetsClient {
|
|
|
1236
1240
|
* Fetch a list of datasets for the configured project
|
|
1237
1241
|
*/
|
|
1238
1242
|
list(): Promise<DatasetsResponse>
|
|
1243
|
+
/**
|
|
1244
|
+
* Get embeddings settings for a dataset
|
|
1245
|
+
*
|
|
1246
|
+
* @param name - Name of the dataset
|
|
1247
|
+
*/
|
|
1248
|
+
getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
|
|
1249
|
+
/**
|
|
1250
|
+
* Edit embeddings settings for a dataset
|
|
1251
|
+
*
|
|
1252
|
+
* @param name - Name of the dataset
|
|
1253
|
+
* @param settings - Embeddings settings to apply
|
|
1254
|
+
*/
|
|
1255
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
|
|
1239
1256
|
}
|
|
1240
1257
|
|
|
1241
1258
|
/** @public */
|
|
@@ -1434,6 +1451,19 @@ export declare interface EditReleaseAction {
|
|
|
1434
1451
|
patch: PatchOperations
|
|
1435
1452
|
}
|
|
1436
1453
|
|
|
1454
|
+
/** @public */
|
|
1455
|
+
export declare type EmbeddingsSettings = {
|
|
1456
|
+
enabled: boolean
|
|
1457
|
+
projection?: string
|
|
1458
|
+
status: string
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/** @public */
|
|
1462
|
+
export declare type EmbeddingsSettingsBody = {
|
|
1463
|
+
enabled: boolean
|
|
1464
|
+
projection?: string
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1437
1467
|
/**
|
|
1438
1468
|
* @internal
|
|
1439
1469
|
*/
|
|
@@ -2152,7 +2182,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
|
|
|
2152
2182
|
*/
|
|
2153
2183
|
export declare function _listen<
|
|
2154
2184
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2155
|
-
Opts extends ListenOptions = ListenOptions,
|
|
2185
|
+
Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
|
|
2156
2186
|
>(
|
|
2157
2187
|
this: SanityClient | ObservableSanityClient,
|
|
2158
2188
|
query: string,
|
|
@@ -2161,9 +2191,11 @@ export declare function _listen<
|
|
|
2161
2191
|
): Observable<ListenEventFromOptions<R, Opts>>
|
|
2162
2192
|
|
|
2163
2193
|
/** @public */
|
|
2164
|
-
export declare type ListenEvent<R extends Record<string, Any>> =
|
|
2194
|
+
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2165
2195
|
| MutationEvent<R>
|
|
2166
2196
|
| ReconnectEvent
|
|
2197
|
+
| WelcomeBackEvent
|
|
2198
|
+
| ResetEvent
|
|
2167
2199
|
| WelcomeEvent
|
|
2168
2200
|
| OpenEvent
|
|
2169
2201
|
|
|
@@ -2178,9 +2210,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
|
|
|
2178
2210
|
*/
|
|
2179
2211
|
declare type ListenEventFromOptions<
|
|
2180
2212
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2181
|
-
Opts extends ListenOptions | undefined = undefined,
|
|
2182
|
-
> = Opts extends ListenOptions
|
|
2183
|
-
? Opts['events'] extends ListenEventName[]
|
|
2213
|
+
Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
|
|
2214
|
+
> = Opts extends ListenOptions | ResumableListenOptions
|
|
2215
|
+
? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
|
|
2184
2216
|
? MapListenEventNamesToListenEvents<R, Opts['events']>
|
|
2185
2217
|
: ListenEvent<R>
|
|
2186
2218
|
: MutationEvent<R>
|
|
@@ -2233,7 +2265,7 @@ export declare interface ListenOptions {
|
|
|
2233
2265
|
visibility?: 'transaction' | 'query'
|
|
2234
2266
|
/**
|
|
2235
2267
|
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
2236
|
-
*
|
|
2268
|
+
* Note: `welcomeback` and `reset` events requires `enableResume: true`
|
|
2237
2269
|
* @defaultValue `['mutation']`
|
|
2238
2270
|
*/
|
|
2239
2271
|
events?: ListenEventName[]
|
|
@@ -2253,6 +2285,13 @@ export declare interface ListenOptions {
|
|
|
2253
2285
|
* @defaultValue `undefined`
|
|
2254
2286
|
*/
|
|
2255
2287
|
tag?: string
|
|
2288
|
+
/**
|
|
2289
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
2290
|
+
* When if enabling this, you should also add the `reset` to the events array and handle the case where the backend is unable to resume.
|
|
2291
|
+
* @beta
|
|
2292
|
+
* @defaultValue `false`
|
|
2293
|
+
*/
|
|
2294
|
+
enableResume?: boolean
|
|
2256
2295
|
}
|
|
2257
2296
|
|
|
2258
2297
|
/** @public */
|
|
@@ -2350,7 +2389,10 @@ declare type Logger_2 =
|
|
|
2350
2389
|
*/
|
|
2351
2390
|
declare type MapListenEventNamesToListenEvents<
|
|
2352
2391
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2353
|
-
Events extends ListenEventName[] =
|
|
2392
|
+
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2393
|
+
| ResumableListenEventNames
|
|
2394
|
+
| ListenEventName
|
|
2395
|
+
)[],
|
|
2354
2396
|
> = Events extends (infer E)[]
|
|
2355
2397
|
? E extends 'welcome'
|
|
2356
2398
|
? WelcomeEvent
|
|
@@ -2358,9 +2400,13 @@ declare type MapListenEventNamesToListenEvents<
|
|
|
2358
2400
|
? MutationEvent<R>
|
|
2359
2401
|
: E extends 'reconnect'
|
|
2360
2402
|
? ReconnectEvent
|
|
2361
|
-
: E extends '
|
|
2362
|
-
?
|
|
2363
|
-
:
|
|
2403
|
+
: E extends 'welcomeback'
|
|
2404
|
+
? WelcomeBackEvent
|
|
2405
|
+
: E extends 'reset'
|
|
2406
|
+
? ResetEvent
|
|
2407
|
+
: E extends 'open'
|
|
2408
|
+
? OpenEvent
|
|
2409
|
+
: never
|
|
2364
2410
|
: never
|
|
2365
2411
|
|
|
2366
2412
|
/** @public */
|
|
@@ -2701,26 +2747,16 @@ export declare class ObservableDatasetsClient {
|
|
|
2701
2747
|
* Create a new dataset with the given name
|
|
2702
2748
|
*
|
|
2703
2749
|
* @param name - Name of the dataset to create
|
|
2704
|
-
* @param options - Options for the dataset
|
|
2750
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
2705
2751
|
*/
|
|
2706
|
-
create(
|
|
2707
|
-
name: string,
|
|
2708
|
-
options?: {
|
|
2709
|
-
aclMode?: DatasetAclMode
|
|
2710
|
-
},
|
|
2711
|
-
): Observable<DatasetResponse>
|
|
2752
|
+
create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
|
|
2712
2753
|
/**
|
|
2713
2754
|
* Edit a dataset with the given name
|
|
2714
2755
|
*
|
|
2715
2756
|
* @param name - Name of the dataset to edit
|
|
2716
2757
|
* @param options - New options for the dataset
|
|
2717
2758
|
*/
|
|
2718
|
-
edit(
|
|
2719
|
-
name: string,
|
|
2720
|
-
options?: {
|
|
2721
|
-
aclMode?: DatasetAclMode
|
|
2722
|
-
},
|
|
2723
|
-
): Observable<DatasetResponse>
|
|
2759
|
+
edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
|
|
2724
2760
|
/**
|
|
2725
2761
|
* Delete a dataset with the given name
|
|
2726
2762
|
*
|
|
@@ -2733,6 +2769,19 @@ export declare class ObservableDatasetsClient {
|
|
|
2733
2769
|
* Fetch a list of datasets for the configured project
|
|
2734
2770
|
*/
|
|
2735
2771
|
list(): Observable<DatasetsResponse>
|
|
2772
|
+
/**
|
|
2773
|
+
* Get embeddings settings for a dataset
|
|
2774
|
+
*
|
|
2775
|
+
* @param name - Name of the dataset
|
|
2776
|
+
*/
|
|
2777
|
+
getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
|
|
2778
|
+
/**
|
|
2779
|
+
* Edit embeddings settings for a dataset
|
|
2780
|
+
*
|
|
2781
|
+
* @param name - Name of the dataset
|
|
2782
|
+
* @param settings - Embeddings settings to apply
|
|
2783
|
+
*/
|
|
2784
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
|
|
2736
2785
|
}
|
|
2737
2786
|
|
|
2738
2787
|
/** @internal */
|
|
@@ -4911,6 +4960,19 @@ export declare interface RequestOptions {
|
|
|
4911
4960
|
signal?: AbortSignal
|
|
4912
4961
|
}
|
|
4913
4962
|
|
|
4963
|
+
/**
|
|
4964
|
+
* The listener can't be resumed or otherwise need to reset its local state
|
|
4965
|
+
*
|
|
4966
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
4967
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
4968
|
+
* the same way they would otherwise treat a `reset` event.
|
|
4969
|
+
*
|
|
4970
|
+
* @public
|
|
4971
|
+
*/
|
|
4972
|
+
export declare type ResetEvent = {
|
|
4973
|
+
type: 'reset'
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4914
4976
|
/** @alpha */
|
|
4915
4977
|
export declare type ResolveStudioUrl = (
|
|
4916
4978
|
sourceDocument: ContentSourceMapDocuments_2[number],
|
|
@@ -4946,6 +5008,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
|
|
|
4946
5008
|
cacheMode?: 'noStale'
|
|
4947
5009
|
}
|
|
4948
5010
|
|
|
5011
|
+
/** @public */
|
|
5012
|
+
export declare type ResumableListenEventNames =
|
|
5013
|
+
| ListenEventName
|
|
5014
|
+
/** The listener has reconnected and successfully resumed from where it left off */
|
|
5015
|
+
| 'welcomeback'
|
|
5016
|
+
/** The listener can't be resumed or otherwise need to reset its local state */
|
|
5017
|
+
| 'reset'
|
|
5018
|
+
|
|
5019
|
+
/** @public */
|
|
5020
|
+
export declare interface ResumableListenOptions
|
|
5021
|
+
extends Omit<ListenOptions, 'events' | 'enableResume'> {
|
|
5022
|
+
/**
|
|
5023
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
5024
|
+
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
5025
|
+
* @beta
|
|
5026
|
+
* @defaultValue `false`
|
|
5027
|
+
*/
|
|
5028
|
+
enableResume: true
|
|
5029
|
+
/**
|
|
5030
|
+
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
5031
|
+
*
|
|
5032
|
+
* @defaultValue `['mutation']`
|
|
5033
|
+
*/
|
|
5034
|
+
events?: ResumableListenEventNames[]
|
|
5035
|
+
}
|
|
5036
|
+
|
|
4949
5037
|
/** @internal */
|
|
4950
5038
|
export declare interface SanityAssetDocument extends SanityDocument {
|
|
4951
5039
|
url: string
|
|
@@ -6751,8 +6839,33 @@ export declare interface VideoPlaybackTokens {
|
|
|
6751
6839
|
}
|
|
6752
6840
|
|
|
6753
6841
|
/**
|
|
6754
|
-
*
|
|
6755
|
-
*
|
|
6842
|
+
* Emitted when the listener reconnects and successfully resumes from
|
|
6843
|
+
* its previous position.
|
|
6844
|
+
*
|
|
6845
|
+
* Even if the listener is created with `enableResume: true`, resume support
|
|
6846
|
+
* may not be available. In that case, a reconnect will emit `welcome`
|
|
6847
|
+
* instead of `welcomeback`.
|
|
6848
|
+
*
|
|
6849
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
6850
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
6851
|
+
* the same way they would otherwise treat a `reset` event.
|
|
6852
|
+
*
|
|
6853
|
+
* @public
|
|
6854
|
+
*/
|
|
6855
|
+
export declare type WelcomeBackEvent = {
|
|
6856
|
+
type: 'welcomeback'
|
|
6857
|
+
listenerName: string
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
/**
|
|
6861
|
+
* Emitted when the listener connection has been successfully established
|
|
6862
|
+
* and is ready to receive events.
|
|
6863
|
+
*
|
|
6864
|
+
* If the listener was created with `enableResume: true` and resume support
|
|
6865
|
+
* is available, the `welcome` event will only be emitted on the initial
|
|
6866
|
+
* connection. On subsequent reconnects, a `welcomeback` event will be
|
|
6867
|
+
* emitted instead, followed by any events that were missed while the
|
|
6868
|
+
* connection was disconnected.
|
|
6756
6869
|
*
|
|
6757
6870
|
* @public
|
|
6758
6871
|
*/
|
package/dist/stega.d.ts
CHANGED
|
@@ -1190,6 +1190,20 @@ export declare interface CurrentSanityUser {
|
|
|
1190
1190
|
/** @public */
|
|
1191
1191
|
export declare type DatasetAclMode = 'public' | 'private' | 'custom'
|
|
1192
1192
|
|
|
1193
|
+
/** @public */
|
|
1194
|
+
export declare type DatasetCreateOptions = {
|
|
1195
|
+
aclMode?: DatasetAclMode
|
|
1196
|
+
embeddings?: {
|
|
1197
|
+
enabled: boolean
|
|
1198
|
+
projection?: string
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
/** @public */
|
|
1203
|
+
export declare type DatasetEditOptions = {
|
|
1204
|
+
aclMode?: DatasetAclMode
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1193
1207
|
/** @public */
|
|
1194
1208
|
export declare type DatasetResponse = {
|
|
1195
1209
|
datasetName: string
|
|
@@ -1204,26 +1218,16 @@ export declare class DatasetsClient {
|
|
|
1204
1218
|
* Create a new dataset with the given name
|
|
1205
1219
|
*
|
|
1206
1220
|
* @param name - Name of the dataset to create
|
|
1207
|
-
* @param options - Options for the dataset
|
|
1221
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1208
1222
|
*/
|
|
1209
|
-
create(
|
|
1210
|
-
name: string,
|
|
1211
|
-
options?: {
|
|
1212
|
-
aclMode?: DatasetAclMode
|
|
1213
|
-
},
|
|
1214
|
-
): Promise<DatasetResponse>
|
|
1223
|
+
create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
|
|
1215
1224
|
/**
|
|
1216
1225
|
* Edit a dataset with the given name
|
|
1217
1226
|
*
|
|
1218
1227
|
* @param name - Name of the dataset to edit
|
|
1219
1228
|
* @param options - New options for the dataset
|
|
1220
1229
|
*/
|
|
1221
|
-
edit(
|
|
1222
|
-
name: string,
|
|
1223
|
-
options?: {
|
|
1224
|
-
aclMode?: DatasetAclMode
|
|
1225
|
-
},
|
|
1226
|
-
): Promise<DatasetResponse>
|
|
1230
|
+
edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
|
|
1227
1231
|
/**
|
|
1228
1232
|
* Delete a dataset with the given name
|
|
1229
1233
|
*
|
|
@@ -1236,6 +1240,19 @@ export declare class DatasetsClient {
|
|
|
1236
1240
|
* Fetch a list of datasets for the configured project
|
|
1237
1241
|
*/
|
|
1238
1242
|
list(): Promise<DatasetsResponse>
|
|
1243
|
+
/**
|
|
1244
|
+
* Get embeddings settings for a dataset
|
|
1245
|
+
*
|
|
1246
|
+
* @param name - Name of the dataset
|
|
1247
|
+
*/
|
|
1248
|
+
getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
|
|
1249
|
+
/**
|
|
1250
|
+
* Edit embeddings settings for a dataset
|
|
1251
|
+
*
|
|
1252
|
+
* @param name - Name of the dataset
|
|
1253
|
+
* @param settings - Embeddings settings to apply
|
|
1254
|
+
*/
|
|
1255
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
|
|
1239
1256
|
}
|
|
1240
1257
|
|
|
1241
1258
|
/** @public */
|
|
@@ -1434,6 +1451,19 @@ export declare interface EditReleaseAction {
|
|
|
1434
1451
|
patch: PatchOperations
|
|
1435
1452
|
}
|
|
1436
1453
|
|
|
1454
|
+
/** @public */
|
|
1455
|
+
export declare type EmbeddingsSettings = {
|
|
1456
|
+
enabled: boolean
|
|
1457
|
+
projection?: string
|
|
1458
|
+
status: string
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/** @public */
|
|
1462
|
+
export declare type EmbeddingsSettingsBody = {
|
|
1463
|
+
enabled: boolean
|
|
1464
|
+
projection?: string
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1437
1467
|
/**
|
|
1438
1468
|
* @internal
|
|
1439
1469
|
*/
|
|
@@ -2152,7 +2182,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
|
|
|
2152
2182
|
*/
|
|
2153
2183
|
export declare function _listen<
|
|
2154
2184
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2155
|
-
Opts extends ListenOptions = ListenOptions,
|
|
2185
|
+
Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
|
|
2156
2186
|
>(
|
|
2157
2187
|
this: SanityClient | ObservableSanityClient,
|
|
2158
2188
|
query: string,
|
|
@@ -2161,9 +2191,11 @@ export declare function _listen<
|
|
|
2161
2191
|
): Observable<ListenEventFromOptions<R, Opts>>
|
|
2162
2192
|
|
|
2163
2193
|
/** @public */
|
|
2164
|
-
export declare type ListenEvent<R extends Record<string, Any>> =
|
|
2194
|
+
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2165
2195
|
| MutationEvent<R>
|
|
2166
2196
|
| ReconnectEvent
|
|
2197
|
+
| WelcomeBackEvent
|
|
2198
|
+
| ResetEvent
|
|
2167
2199
|
| WelcomeEvent
|
|
2168
2200
|
| OpenEvent
|
|
2169
2201
|
|
|
@@ -2178,9 +2210,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
|
|
|
2178
2210
|
*/
|
|
2179
2211
|
declare type ListenEventFromOptions<
|
|
2180
2212
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2181
|
-
Opts extends ListenOptions | undefined = undefined,
|
|
2182
|
-
> = Opts extends ListenOptions
|
|
2183
|
-
? Opts['events'] extends ListenEventName[]
|
|
2213
|
+
Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
|
|
2214
|
+
> = Opts extends ListenOptions | ResumableListenOptions
|
|
2215
|
+
? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
|
|
2184
2216
|
? MapListenEventNamesToListenEvents<R, Opts['events']>
|
|
2185
2217
|
: ListenEvent<R>
|
|
2186
2218
|
: MutationEvent<R>
|
|
@@ -2233,7 +2265,7 @@ export declare interface ListenOptions {
|
|
|
2233
2265
|
visibility?: 'transaction' | 'query'
|
|
2234
2266
|
/**
|
|
2235
2267
|
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
2236
|
-
*
|
|
2268
|
+
* Note: `welcomeback` and `reset` events requires `enableResume: true`
|
|
2237
2269
|
* @defaultValue `['mutation']`
|
|
2238
2270
|
*/
|
|
2239
2271
|
events?: ListenEventName[]
|
|
@@ -2253,6 +2285,13 @@ export declare interface ListenOptions {
|
|
|
2253
2285
|
* @defaultValue `undefined`
|
|
2254
2286
|
*/
|
|
2255
2287
|
tag?: string
|
|
2288
|
+
/**
|
|
2289
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
2290
|
+
* When if enabling this, you should also add the `reset` to the events array and handle the case where the backend is unable to resume.
|
|
2291
|
+
* @beta
|
|
2292
|
+
* @defaultValue `false`
|
|
2293
|
+
*/
|
|
2294
|
+
enableResume?: boolean
|
|
2256
2295
|
}
|
|
2257
2296
|
|
|
2258
2297
|
/** @public */
|
|
@@ -2350,7 +2389,10 @@ declare type Logger_2 =
|
|
|
2350
2389
|
*/
|
|
2351
2390
|
declare type MapListenEventNamesToListenEvents<
|
|
2352
2391
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2353
|
-
Events extends ListenEventName[] =
|
|
2392
|
+
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2393
|
+
| ResumableListenEventNames
|
|
2394
|
+
| ListenEventName
|
|
2395
|
+
)[],
|
|
2354
2396
|
> = Events extends (infer E)[]
|
|
2355
2397
|
? E extends 'welcome'
|
|
2356
2398
|
? WelcomeEvent
|
|
@@ -2358,9 +2400,13 @@ declare type MapListenEventNamesToListenEvents<
|
|
|
2358
2400
|
? MutationEvent<R>
|
|
2359
2401
|
: E extends 'reconnect'
|
|
2360
2402
|
? ReconnectEvent
|
|
2361
|
-
: E extends '
|
|
2362
|
-
?
|
|
2363
|
-
:
|
|
2403
|
+
: E extends 'welcomeback'
|
|
2404
|
+
? WelcomeBackEvent
|
|
2405
|
+
: E extends 'reset'
|
|
2406
|
+
? ResetEvent
|
|
2407
|
+
: E extends 'open'
|
|
2408
|
+
? OpenEvent
|
|
2409
|
+
: never
|
|
2364
2410
|
: never
|
|
2365
2411
|
|
|
2366
2412
|
/** @public */
|
|
@@ -2701,26 +2747,16 @@ export declare class ObservableDatasetsClient {
|
|
|
2701
2747
|
* Create a new dataset with the given name
|
|
2702
2748
|
*
|
|
2703
2749
|
* @param name - Name of the dataset to create
|
|
2704
|
-
* @param options - Options for the dataset
|
|
2750
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
2705
2751
|
*/
|
|
2706
|
-
create(
|
|
2707
|
-
name: string,
|
|
2708
|
-
options?: {
|
|
2709
|
-
aclMode?: DatasetAclMode
|
|
2710
|
-
},
|
|
2711
|
-
): Observable<DatasetResponse>
|
|
2752
|
+
create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
|
|
2712
2753
|
/**
|
|
2713
2754
|
* Edit a dataset with the given name
|
|
2714
2755
|
*
|
|
2715
2756
|
* @param name - Name of the dataset to edit
|
|
2716
2757
|
* @param options - New options for the dataset
|
|
2717
2758
|
*/
|
|
2718
|
-
edit(
|
|
2719
|
-
name: string,
|
|
2720
|
-
options?: {
|
|
2721
|
-
aclMode?: DatasetAclMode
|
|
2722
|
-
},
|
|
2723
|
-
): Observable<DatasetResponse>
|
|
2759
|
+
edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
|
|
2724
2760
|
/**
|
|
2725
2761
|
* Delete a dataset with the given name
|
|
2726
2762
|
*
|
|
@@ -2733,6 +2769,19 @@ export declare class ObservableDatasetsClient {
|
|
|
2733
2769
|
* Fetch a list of datasets for the configured project
|
|
2734
2770
|
*/
|
|
2735
2771
|
list(): Observable<DatasetsResponse>
|
|
2772
|
+
/**
|
|
2773
|
+
* Get embeddings settings for a dataset
|
|
2774
|
+
*
|
|
2775
|
+
* @param name - Name of the dataset
|
|
2776
|
+
*/
|
|
2777
|
+
getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
|
|
2778
|
+
/**
|
|
2779
|
+
* Edit embeddings settings for a dataset
|
|
2780
|
+
*
|
|
2781
|
+
* @param name - Name of the dataset
|
|
2782
|
+
* @param settings - Embeddings settings to apply
|
|
2783
|
+
*/
|
|
2784
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
|
|
2736
2785
|
}
|
|
2737
2786
|
|
|
2738
2787
|
/** @internal */
|
|
@@ -4911,6 +4960,19 @@ export declare interface RequestOptions {
|
|
|
4911
4960
|
signal?: AbortSignal
|
|
4912
4961
|
}
|
|
4913
4962
|
|
|
4963
|
+
/**
|
|
4964
|
+
* The listener can't be resumed or otherwise need to reset its local state
|
|
4965
|
+
*
|
|
4966
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
4967
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
4968
|
+
* the same way they would otherwise treat a `reset` event.
|
|
4969
|
+
*
|
|
4970
|
+
* @public
|
|
4971
|
+
*/
|
|
4972
|
+
export declare type ResetEvent = {
|
|
4973
|
+
type: 'reset'
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4914
4976
|
/** @alpha */
|
|
4915
4977
|
export declare type ResolveStudioUrl = (
|
|
4916
4978
|
sourceDocument: ContentSourceMapDocuments_2[number],
|
|
@@ -4946,6 +5008,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
|
|
|
4946
5008
|
cacheMode?: 'noStale'
|
|
4947
5009
|
}
|
|
4948
5010
|
|
|
5011
|
+
/** @public */
|
|
5012
|
+
export declare type ResumableListenEventNames =
|
|
5013
|
+
| ListenEventName
|
|
5014
|
+
/** The listener has reconnected and successfully resumed from where it left off */
|
|
5015
|
+
| 'welcomeback'
|
|
5016
|
+
/** The listener can't be resumed or otherwise need to reset its local state */
|
|
5017
|
+
| 'reset'
|
|
5018
|
+
|
|
5019
|
+
/** @public */
|
|
5020
|
+
export declare interface ResumableListenOptions
|
|
5021
|
+
extends Omit<ListenOptions, 'events' | 'enableResume'> {
|
|
5022
|
+
/**
|
|
5023
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
5024
|
+
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
5025
|
+
* @beta
|
|
5026
|
+
* @defaultValue `false`
|
|
5027
|
+
*/
|
|
5028
|
+
enableResume: true
|
|
5029
|
+
/**
|
|
5030
|
+
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
5031
|
+
*
|
|
5032
|
+
* @defaultValue `['mutation']`
|
|
5033
|
+
*/
|
|
5034
|
+
events?: ResumableListenEventNames[]
|
|
5035
|
+
}
|
|
5036
|
+
|
|
4949
5037
|
/** @internal */
|
|
4950
5038
|
export declare interface SanityAssetDocument extends SanityDocument {
|
|
4951
5039
|
url: string
|
|
@@ -6751,8 +6839,33 @@ export declare interface VideoPlaybackTokens {
|
|
|
6751
6839
|
}
|
|
6752
6840
|
|
|
6753
6841
|
/**
|
|
6754
|
-
*
|
|
6755
|
-
*
|
|
6842
|
+
* Emitted when the listener reconnects and successfully resumes from
|
|
6843
|
+
* its previous position.
|
|
6844
|
+
*
|
|
6845
|
+
* Even if the listener is created with `enableResume: true`, resume support
|
|
6846
|
+
* may not be available. In that case, a reconnect will emit `welcome`
|
|
6847
|
+
* instead of `welcomeback`.
|
|
6848
|
+
*
|
|
6849
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
6850
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
6851
|
+
* the same way they would otherwise treat a `reset` event.
|
|
6852
|
+
*
|
|
6853
|
+
* @public
|
|
6854
|
+
*/
|
|
6855
|
+
export declare type WelcomeBackEvent = {
|
|
6856
|
+
type: 'welcomeback'
|
|
6857
|
+
listenerName: string
|
|
6858
|
+
}
|
|
6859
|
+
|
|
6860
|
+
/**
|
|
6861
|
+
* Emitted when the listener connection has been successfully established
|
|
6862
|
+
* and is ready to receive events.
|
|
6863
|
+
*
|
|
6864
|
+
* If the listener was created with `enableResume: true` and resume support
|
|
6865
|
+
* is available, the `welcome` event will only be emitted on the initial
|
|
6866
|
+
* connection. On subsequent reconnects, a `welcomeback` event will be
|
|
6867
|
+
* emitted instead, followed by any events that were missed while the
|
|
6868
|
+
* connection was disconnected.
|
|
6756
6869
|
*
|
|
6757
6870
|
* @public
|
|
6758
6871
|
*/
|