@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/index.d.cts
CHANGED
|
@@ -1096,6 +1096,20 @@ export declare interface CurrentSanityUser {
|
|
|
1096
1096
|
/** @public */
|
|
1097
1097
|
export declare type DatasetAclMode = 'public' | 'private' | 'custom'
|
|
1098
1098
|
|
|
1099
|
+
/** @public */
|
|
1100
|
+
export declare type DatasetCreateOptions = {
|
|
1101
|
+
aclMode?: DatasetAclMode
|
|
1102
|
+
embeddings?: {
|
|
1103
|
+
enabled: boolean
|
|
1104
|
+
projection?: string
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/** @public */
|
|
1109
|
+
export declare type DatasetEditOptions = {
|
|
1110
|
+
aclMode?: DatasetAclMode
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1099
1113
|
/** @public */
|
|
1100
1114
|
export declare type DatasetResponse = {
|
|
1101
1115
|
datasetName: string
|
|
@@ -1110,26 +1124,16 @@ export declare class DatasetsClient {
|
|
|
1110
1124
|
* Create a new dataset with the given name
|
|
1111
1125
|
*
|
|
1112
1126
|
* @param name - Name of the dataset to create
|
|
1113
|
-
* @param options - Options for the dataset
|
|
1127
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1114
1128
|
*/
|
|
1115
|
-
create(
|
|
1116
|
-
name: string,
|
|
1117
|
-
options?: {
|
|
1118
|
-
aclMode?: DatasetAclMode
|
|
1119
|
-
},
|
|
1120
|
-
): Promise<DatasetResponse>
|
|
1129
|
+
create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
|
|
1121
1130
|
/**
|
|
1122
1131
|
* Edit a dataset with the given name
|
|
1123
1132
|
*
|
|
1124
1133
|
* @param name - Name of the dataset to edit
|
|
1125
1134
|
* @param options - New options for the dataset
|
|
1126
1135
|
*/
|
|
1127
|
-
edit(
|
|
1128
|
-
name: string,
|
|
1129
|
-
options?: {
|
|
1130
|
-
aclMode?: DatasetAclMode
|
|
1131
|
-
},
|
|
1132
|
-
): Promise<DatasetResponse>
|
|
1136
|
+
edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
|
|
1133
1137
|
/**
|
|
1134
1138
|
* Delete a dataset with the given name
|
|
1135
1139
|
*
|
|
@@ -1142,6 +1146,19 @@ export declare class DatasetsClient {
|
|
|
1142
1146
|
* Fetch a list of datasets for the configured project
|
|
1143
1147
|
*/
|
|
1144
1148
|
list(): Promise<DatasetsResponse>
|
|
1149
|
+
/**
|
|
1150
|
+
* Get embeddings settings for a dataset
|
|
1151
|
+
*
|
|
1152
|
+
* @param name - Name of the dataset
|
|
1153
|
+
*/
|
|
1154
|
+
getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
|
|
1155
|
+
/**
|
|
1156
|
+
* Edit embeddings settings for a dataset
|
|
1157
|
+
*
|
|
1158
|
+
* @param name - Name of the dataset
|
|
1159
|
+
* @param settings - Embeddings settings to apply
|
|
1160
|
+
*/
|
|
1161
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
|
|
1145
1162
|
}
|
|
1146
1163
|
|
|
1147
1164
|
/** @public */
|
|
@@ -1347,6 +1364,19 @@ export declare interface EditReleaseAction {
|
|
|
1347
1364
|
patch: PatchOperations
|
|
1348
1365
|
}
|
|
1349
1366
|
|
|
1367
|
+
/** @public */
|
|
1368
|
+
export declare type EmbeddingsSettings = {
|
|
1369
|
+
enabled: boolean
|
|
1370
|
+
projection?: string
|
|
1371
|
+
status: string
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/** @public */
|
|
1375
|
+
export declare type EmbeddingsSettingsBody = {
|
|
1376
|
+
enabled: boolean
|
|
1377
|
+
projection?: string
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1350
1380
|
/** @public */
|
|
1351
1381
|
export declare interface ErrorProps {
|
|
1352
1382
|
message: string
|
|
@@ -1987,7 +2017,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
|
|
|
1987
2017
|
*/
|
|
1988
2018
|
export declare function _listen<
|
|
1989
2019
|
R extends Record<string, Any> = Record<string, Any>,
|
|
1990
|
-
Opts extends ListenOptions = ListenOptions,
|
|
2020
|
+
Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
|
|
1991
2021
|
>(
|
|
1992
2022
|
this: SanityClient | ObservableSanityClient,
|
|
1993
2023
|
query: string,
|
|
@@ -1996,9 +2026,11 @@ export declare function _listen<
|
|
|
1996
2026
|
): Observable<ListenEventFromOptions<R, Opts>>
|
|
1997
2027
|
|
|
1998
2028
|
/** @public */
|
|
1999
|
-
export declare type ListenEvent<R extends Record<string, Any>> =
|
|
2029
|
+
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2000
2030
|
| MutationEvent<R>
|
|
2001
2031
|
| ReconnectEvent
|
|
2032
|
+
| WelcomeBackEvent
|
|
2033
|
+
| ResetEvent
|
|
2002
2034
|
| WelcomeEvent
|
|
2003
2035
|
| OpenEvent
|
|
2004
2036
|
|
|
@@ -2013,9 +2045,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
|
|
|
2013
2045
|
*/
|
|
2014
2046
|
declare type ListenEventFromOptions<
|
|
2015
2047
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2016
|
-
Opts extends ListenOptions | undefined = undefined,
|
|
2017
|
-
> = Opts extends ListenOptions
|
|
2018
|
-
? Opts['events'] extends ListenEventName[]
|
|
2048
|
+
Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
|
|
2049
|
+
> = Opts extends ListenOptions | ResumableListenOptions
|
|
2050
|
+
? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
|
|
2019
2051
|
? MapListenEventNamesToListenEvents<R, Opts['events']>
|
|
2020
2052
|
: ListenEvent<R>
|
|
2021
2053
|
: MutationEvent<R>
|
|
@@ -2068,7 +2100,7 @@ export declare interface ListenOptions {
|
|
|
2068
2100
|
visibility?: 'transaction' | 'query'
|
|
2069
2101
|
/**
|
|
2070
2102
|
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
2071
|
-
*
|
|
2103
|
+
* Note: `welcomeback` and `reset` events requires `enableResume: true`
|
|
2072
2104
|
* @defaultValue `['mutation']`
|
|
2073
2105
|
*/
|
|
2074
2106
|
events?: ListenEventName[]
|
|
@@ -2088,6 +2120,13 @@ export declare interface ListenOptions {
|
|
|
2088
2120
|
* @defaultValue `undefined`
|
|
2089
2121
|
*/
|
|
2090
2122
|
tag?: string
|
|
2123
|
+
/**
|
|
2124
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
2125
|
+
* 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.
|
|
2126
|
+
* @beta
|
|
2127
|
+
* @defaultValue `false`
|
|
2128
|
+
*/
|
|
2129
|
+
enableResume?: boolean
|
|
2091
2130
|
}
|
|
2092
2131
|
|
|
2093
2132
|
/** @public */
|
|
@@ -2178,7 +2217,10 @@ export declare type Logger =
|
|
|
2178
2217
|
*/
|
|
2179
2218
|
declare type MapListenEventNamesToListenEvents<
|
|
2180
2219
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2181
|
-
Events extends ListenEventName[] =
|
|
2220
|
+
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2221
|
+
| ResumableListenEventNames
|
|
2222
|
+
| ListenEventName
|
|
2223
|
+
)[],
|
|
2182
2224
|
> = Events extends (infer E)[]
|
|
2183
2225
|
? E extends 'welcome'
|
|
2184
2226
|
? WelcomeEvent
|
|
@@ -2186,9 +2228,13 @@ declare type MapListenEventNamesToListenEvents<
|
|
|
2186
2228
|
? MutationEvent<R>
|
|
2187
2229
|
: E extends 'reconnect'
|
|
2188
2230
|
? ReconnectEvent
|
|
2189
|
-
: E extends '
|
|
2190
|
-
?
|
|
2191
|
-
:
|
|
2231
|
+
: E extends 'welcomeback'
|
|
2232
|
+
? WelcomeBackEvent
|
|
2233
|
+
: E extends 'reset'
|
|
2234
|
+
? ResetEvent
|
|
2235
|
+
: E extends 'open'
|
|
2236
|
+
? OpenEvent
|
|
2237
|
+
: never
|
|
2192
2238
|
: never
|
|
2193
2239
|
|
|
2194
2240
|
/** @public */
|
|
@@ -2529,26 +2575,16 @@ export declare class ObservableDatasetsClient {
|
|
|
2529
2575
|
* Create a new dataset with the given name
|
|
2530
2576
|
*
|
|
2531
2577
|
* @param name - Name of the dataset to create
|
|
2532
|
-
* @param options - Options for the dataset
|
|
2578
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
2533
2579
|
*/
|
|
2534
|
-
create(
|
|
2535
|
-
name: string,
|
|
2536
|
-
options?: {
|
|
2537
|
-
aclMode?: DatasetAclMode
|
|
2538
|
-
},
|
|
2539
|
-
): Observable<DatasetResponse>
|
|
2580
|
+
create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
|
|
2540
2581
|
/**
|
|
2541
2582
|
* Edit a dataset with the given name
|
|
2542
2583
|
*
|
|
2543
2584
|
* @param name - Name of the dataset to edit
|
|
2544
2585
|
* @param options - New options for the dataset
|
|
2545
2586
|
*/
|
|
2546
|
-
edit(
|
|
2547
|
-
name: string,
|
|
2548
|
-
options?: {
|
|
2549
|
-
aclMode?: DatasetAclMode
|
|
2550
|
-
},
|
|
2551
|
-
): Observable<DatasetResponse>
|
|
2587
|
+
edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
|
|
2552
2588
|
/**
|
|
2553
2589
|
* Delete a dataset with the given name
|
|
2554
2590
|
*
|
|
@@ -2561,6 +2597,19 @@ export declare class ObservableDatasetsClient {
|
|
|
2561
2597
|
* Fetch a list of datasets for the configured project
|
|
2562
2598
|
*/
|
|
2563
2599
|
list(): Observable<DatasetsResponse>
|
|
2600
|
+
/**
|
|
2601
|
+
* Get embeddings settings for a dataset
|
|
2602
|
+
*
|
|
2603
|
+
* @param name - Name of the dataset
|
|
2604
|
+
*/
|
|
2605
|
+
getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
|
|
2606
|
+
/**
|
|
2607
|
+
* Edit embeddings settings for a dataset
|
|
2608
|
+
*
|
|
2609
|
+
* @param name - Name of the dataset
|
|
2610
|
+
* @param settings - Embeddings settings to apply
|
|
2611
|
+
*/
|
|
2612
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
|
|
2564
2613
|
}
|
|
2565
2614
|
|
|
2566
2615
|
/** @internal */
|
|
@@ -4730,6 +4779,19 @@ export declare interface RequestOptions {
|
|
|
4730
4779
|
signal?: AbortSignal
|
|
4731
4780
|
}
|
|
4732
4781
|
|
|
4782
|
+
/**
|
|
4783
|
+
* The listener can't be resumed or otherwise need to reset its local state
|
|
4784
|
+
*
|
|
4785
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
4786
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
4787
|
+
* the same way they would otherwise treat a `reset` event.
|
|
4788
|
+
*
|
|
4789
|
+
* @public
|
|
4790
|
+
*/
|
|
4791
|
+
export declare type ResetEvent = {
|
|
4792
|
+
type: 'reset'
|
|
4793
|
+
}
|
|
4794
|
+
|
|
4733
4795
|
export {ResolveStudioUrl}
|
|
4734
4796
|
|
|
4735
4797
|
/** @public */
|
|
@@ -4762,6 +4824,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
|
|
|
4762
4824
|
cacheMode?: 'noStale'
|
|
4763
4825
|
}
|
|
4764
4826
|
|
|
4827
|
+
/** @public */
|
|
4828
|
+
export declare type ResumableListenEventNames =
|
|
4829
|
+
| ListenEventName
|
|
4830
|
+
/** The listener has reconnected and successfully resumed from where it left off */
|
|
4831
|
+
| 'welcomeback'
|
|
4832
|
+
/** The listener can't be resumed or otherwise need to reset its local state */
|
|
4833
|
+
| 'reset'
|
|
4834
|
+
|
|
4835
|
+
/** @public */
|
|
4836
|
+
export declare interface ResumableListenOptions
|
|
4837
|
+
extends Omit<ListenOptions, 'events' | 'enableResume'> {
|
|
4838
|
+
/**
|
|
4839
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
4840
|
+
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
4841
|
+
* @beta
|
|
4842
|
+
* @defaultValue `false`
|
|
4843
|
+
*/
|
|
4844
|
+
enableResume: true
|
|
4845
|
+
/**
|
|
4846
|
+
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
4847
|
+
*
|
|
4848
|
+
* @defaultValue `['mutation']`
|
|
4849
|
+
*/
|
|
4850
|
+
events?: ResumableListenEventNames[]
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4765
4853
|
/** @internal */
|
|
4766
4854
|
export declare interface SanityAssetDocument extends SanityDocument {
|
|
4767
4855
|
url: string
|
|
@@ -6490,8 +6578,33 @@ export declare interface VideoPlaybackTokens {
|
|
|
6490
6578
|
}
|
|
6491
6579
|
|
|
6492
6580
|
/**
|
|
6493
|
-
*
|
|
6494
|
-
*
|
|
6581
|
+
* Emitted when the listener reconnects and successfully resumes from
|
|
6582
|
+
* its previous position.
|
|
6583
|
+
*
|
|
6584
|
+
* Even if the listener is created with `enableResume: true`, resume support
|
|
6585
|
+
* may not be available. In that case, a reconnect will emit `welcome`
|
|
6586
|
+
* instead of `welcomeback`.
|
|
6587
|
+
*
|
|
6588
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
6589
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
6590
|
+
* the same way they would otherwise treat a `reset` event.
|
|
6591
|
+
*
|
|
6592
|
+
* @public
|
|
6593
|
+
*/
|
|
6594
|
+
export declare type WelcomeBackEvent = {
|
|
6595
|
+
type: 'welcomeback'
|
|
6596
|
+
listenerName: string
|
|
6597
|
+
}
|
|
6598
|
+
|
|
6599
|
+
/**
|
|
6600
|
+
* Emitted when the listener connection has been successfully established
|
|
6601
|
+
* and is ready to receive events.
|
|
6602
|
+
*
|
|
6603
|
+
* If the listener was created with `enableResume: true` and resume support
|
|
6604
|
+
* is available, the `welcome` event will only be emitted on the initial
|
|
6605
|
+
* connection. On subsequent reconnects, a `welcomeback` event will be
|
|
6606
|
+
* emitted instead, followed by any events that were missed while the
|
|
6607
|
+
* connection was disconnected.
|
|
6495
6608
|
*
|
|
6496
6609
|
* @public
|
|
6497
6610
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -1096,6 +1096,20 @@ export declare interface CurrentSanityUser {
|
|
|
1096
1096
|
/** @public */
|
|
1097
1097
|
export declare type DatasetAclMode = 'public' | 'private' | 'custom'
|
|
1098
1098
|
|
|
1099
|
+
/** @public */
|
|
1100
|
+
export declare type DatasetCreateOptions = {
|
|
1101
|
+
aclMode?: DatasetAclMode
|
|
1102
|
+
embeddings?: {
|
|
1103
|
+
enabled: boolean
|
|
1104
|
+
projection?: string
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
/** @public */
|
|
1109
|
+
export declare type DatasetEditOptions = {
|
|
1110
|
+
aclMode?: DatasetAclMode
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1099
1113
|
/** @public */
|
|
1100
1114
|
export declare type DatasetResponse = {
|
|
1101
1115
|
datasetName: string
|
|
@@ -1110,26 +1124,16 @@ export declare class DatasetsClient {
|
|
|
1110
1124
|
* Create a new dataset with the given name
|
|
1111
1125
|
*
|
|
1112
1126
|
* @param name - Name of the dataset to create
|
|
1113
|
-
* @param options - Options for the dataset
|
|
1127
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
1114
1128
|
*/
|
|
1115
|
-
create(
|
|
1116
|
-
name: string,
|
|
1117
|
-
options?: {
|
|
1118
|
-
aclMode?: DatasetAclMode
|
|
1119
|
-
},
|
|
1120
|
-
): Promise<DatasetResponse>
|
|
1129
|
+
create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
|
|
1121
1130
|
/**
|
|
1122
1131
|
* Edit a dataset with the given name
|
|
1123
1132
|
*
|
|
1124
1133
|
* @param name - Name of the dataset to edit
|
|
1125
1134
|
* @param options - New options for the dataset
|
|
1126
1135
|
*/
|
|
1127
|
-
edit(
|
|
1128
|
-
name: string,
|
|
1129
|
-
options?: {
|
|
1130
|
-
aclMode?: DatasetAclMode
|
|
1131
|
-
},
|
|
1132
|
-
): Promise<DatasetResponse>
|
|
1136
|
+
edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
|
|
1133
1137
|
/**
|
|
1134
1138
|
* Delete a dataset with the given name
|
|
1135
1139
|
*
|
|
@@ -1142,6 +1146,19 @@ export declare class DatasetsClient {
|
|
|
1142
1146
|
* Fetch a list of datasets for the configured project
|
|
1143
1147
|
*/
|
|
1144
1148
|
list(): Promise<DatasetsResponse>
|
|
1149
|
+
/**
|
|
1150
|
+
* Get embeddings settings for a dataset
|
|
1151
|
+
*
|
|
1152
|
+
* @param name - Name of the dataset
|
|
1153
|
+
*/
|
|
1154
|
+
getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
|
|
1155
|
+
/**
|
|
1156
|
+
* Edit embeddings settings for a dataset
|
|
1157
|
+
*
|
|
1158
|
+
* @param name - Name of the dataset
|
|
1159
|
+
* @param settings - Embeddings settings to apply
|
|
1160
|
+
*/
|
|
1161
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
|
|
1145
1162
|
}
|
|
1146
1163
|
|
|
1147
1164
|
/** @public */
|
|
@@ -1347,6 +1364,19 @@ export declare interface EditReleaseAction {
|
|
|
1347
1364
|
patch: PatchOperations
|
|
1348
1365
|
}
|
|
1349
1366
|
|
|
1367
|
+
/** @public */
|
|
1368
|
+
export declare type EmbeddingsSettings = {
|
|
1369
|
+
enabled: boolean
|
|
1370
|
+
projection?: string
|
|
1371
|
+
status: string
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
/** @public */
|
|
1375
|
+
export declare type EmbeddingsSettingsBody = {
|
|
1376
|
+
enabled: boolean
|
|
1377
|
+
projection?: string
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1350
1380
|
/** @public */
|
|
1351
1381
|
export declare interface ErrorProps {
|
|
1352
1382
|
message: string
|
|
@@ -1987,7 +2017,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
|
|
|
1987
2017
|
*/
|
|
1988
2018
|
export declare function _listen<
|
|
1989
2019
|
R extends Record<string, Any> = Record<string, Any>,
|
|
1990
|
-
Opts extends ListenOptions = ListenOptions,
|
|
2020
|
+
Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
|
|
1991
2021
|
>(
|
|
1992
2022
|
this: SanityClient | ObservableSanityClient,
|
|
1993
2023
|
query: string,
|
|
@@ -1996,9 +2026,11 @@ export declare function _listen<
|
|
|
1996
2026
|
): Observable<ListenEventFromOptions<R, Opts>>
|
|
1997
2027
|
|
|
1998
2028
|
/** @public */
|
|
1999
|
-
export declare type ListenEvent<R extends Record<string, Any>> =
|
|
2029
|
+
export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
|
|
2000
2030
|
| MutationEvent<R>
|
|
2001
2031
|
| ReconnectEvent
|
|
2032
|
+
| WelcomeBackEvent
|
|
2033
|
+
| ResetEvent
|
|
2002
2034
|
| WelcomeEvent
|
|
2003
2035
|
| OpenEvent
|
|
2004
2036
|
|
|
@@ -2013,9 +2045,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
|
|
|
2013
2045
|
*/
|
|
2014
2046
|
declare type ListenEventFromOptions<
|
|
2015
2047
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2016
|
-
Opts extends ListenOptions | undefined = undefined,
|
|
2017
|
-
> = Opts extends ListenOptions
|
|
2018
|
-
? Opts['events'] extends ListenEventName[]
|
|
2048
|
+
Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
|
|
2049
|
+
> = Opts extends ListenOptions | ResumableListenOptions
|
|
2050
|
+
? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
|
|
2019
2051
|
? MapListenEventNamesToListenEvents<R, Opts['events']>
|
|
2020
2052
|
: ListenEvent<R>
|
|
2021
2053
|
: MutationEvent<R>
|
|
@@ -2068,7 +2100,7 @@ export declare interface ListenOptions {
|
|
|
2068
2100
|
visibility?: 'transaction' | 'query'
|
|
2069
2101
|
/**
|
|
2070
2102
|
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
2071
|
-
*
|
|
2103
|
+
* Note: `welcomeback` and `reset` events requires `enableResume: true`
|
|
2072
2104
|
* @defaultValue `['mutation']`
|
|
2073
2105
|
*/
|
|
2074
2106
|
events?: ListenEventName[]
|
|
@@ -2088,6 +2120,13 @@ export declare interface ListenOptions {
|
|
|
2088
2120
|
* @defaultValue `undefined`
|
|
2089
2121
|
*/
|
|
2090
2122
|
tag?: string
|
|
2123
|
+
/**
|
|
2124
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
2125
|
+
* 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.
|
|
2126
|
+
* @beta
|
|
2127
|
+
* @defaultValue `false`
|
|
2128
|
+
*/
|
|
2129
|
+
enableResume?: boolean
|
|
2091
2130
|
}
|
|
2092
2131
|
|
|
2093
2132
|
/** @public */
|
|
@@ -2178,7 +2217,10 @@ export declare type Logger =
|
|
|
2178
2217
|
*/
|
|
2179
2218
|
declare type MapListenEventNamesToListenEvents<
|
|
2180
2219
|
R extends Record<string, Any> = Record<string, Any>,
|
|
2181
|
-
Events extends ListenEventName[] =
|
|
2220
|
+
Events extends (ResumableListenEventNames | ListenEventName)[] = (
|
|
2221
|
+
| ResumableListenEventNames
|
|
2222
|
+
| ListenEventName
|
|
2223
|
+
)[],
|
|
2182
2224
|
> = Events extends (infer E)[]
|
|
2183
2225
|
? E extends 'welcome'
|
|
2184
2226
|
? WelcomeEvent
|
|
@@ -2186,9 +2228,13 @@ declare type MapListenEventNamesToListenEvents<
|
|
|
2186
2228
|
? MutationEvent<R>
|
|
2187
2229
|
: E extends 'reconnect'
|
|
2188
2230
|
? ReconnectEvent
|
|
2189
|
-
: E extends '
|
|
2190
|
-
?
|
|
2191
|
-
:
|
|
2231
|
+
: E extends 'welcomeback'
|
|
2232
|
+
? WelcomeBackEvent
|
|
2233
|
+
: E extends 'reset'
|
|
2234
|
+
? ResetEvent
|
|
2235
|
+
: E extends 'open'
|
|
2236
|
+
? OpenEvent
|
|
2237
|
+
: never
|
|
2192
2238
|
: never
|
|
2193
2239
|
|
|
2194
2240
|
/** @public */
|
|
@@ -2529,26 +2575,16 @@ export declare class ObservableDatasetsClient {
|
|
|
2529
2575
|
* Create a new dataset with the given name
|
|
2530
2576
|
*
|
|
2531
2577
|
* @param name - Name of the dataset to create
|
|
2532
|
-
* @param options - Options for the dataset
|
|
2578
|
+
* @param options - Options for the dataset, including optional embeddings configuration
|
|
2533
2579
|
*/
|
|
2534
|
-
create(
|
|
2535
|
-
name: string,
|
|
2536
|
-
options?: {
|
|
2537
|
-
aclMode?: DatasetAclMode
|
|
2538
|
-
},
|
|
2539
|
-
): Observable<DatasetResponse>
|
|
2580
|
+
create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
|
|
2540
2581
|
/**
|
|
2541
2582
|
* Edit a dataset with the given name
|
|
2542
2583
|
*
|
|
2543
2584
|
* @param name - Name of the dataset to edit
|
|
2544
2585
|
* @param options - New options for the dataset
|
|
2545
2586
|
*/
|
|
2546
|
-
edit(
|
|
2547
|
-
name: string,
|
|
2548
|
-
options?: {
|
|
2549
|
-
aclMode?: DatasetAclMode
|
|
2550
|
-
},
|
|
2551
|
-
): Observable<DatasetResponse>
|
|
2587
|
+
edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
|
|
2552
2588
|
/**
|
|
2553
2589
|
* Delete a dataset with the given name
|
|
2554
2590
|
*
|
|
@@ -2561,6 +2597,19 @@ export declare class ObservableDatasetsClient {
|
|
|
2561
2597
|
* Fetch a list of datasets for the configured project
|
|
2562
2598
|
*/
|
|
2563
2599
|
list(): Observable<DatasetsResponse>
|
|
2600
|
+
/**
|
|
2601
|
+
* Get embeddings settings for a dataset
|
|
2602
|
+
*
|
|
2603
|
+
* @param name - Name of the dataset
|
|
2604
|
+
*/
|
|
2605
|
+
getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
|
|
2606
|
+
/**
|
|
2607
|
+
* Edit embeddings settings for a dataset
|
|
2608
|
+
*
|
|
2609
|
+
* @param name - Name of the dataset
|
|
2610
|
+
* @param settings - Embeddings settings to apply
|
|
2611
|
+
*/
|
|
2612
|
+
editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
|
|
2564
2613
|
}
|
|
2565
2614
|
|
|
2566
2615
|
/** @internal */
|
|
@@ -4730,6 +4779,19 @@ export declare interface RequestOptions {
|
|
|
4730
4779
|
signal?: AbortSignal
|
|
4731
4780
|
}
|
|
4732
4781
|
|
|
4782
|
+
/**
|
|
4783
|
+
* The listener can't be resumed or otherwise need to reset its local state
|
|
4784
|
+
*
|
|
4785
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
4786
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
4787
|
+
* the same way they would otherwise treat a `reset` event.
|
|
4788
|
+
*
|
|
4789
|
+
* @public
|
|
4790
|
+
*/
|
|
4791
|
+
export declare type ResetEvent = {
|
|
4792
|
+
type: 'reset'
|
|
4793
|
+
}
|
|
4794
|
+
|
|
4733
4795
|
export {ResolveStudioUrl}
|
|
4734
4796
|
|
|
4735
4797
|
/** @public */
|
|
@@ -4762,6 +4824,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
|
|
|
4762
4824
|
cacheMode?: 'noStale'
|
|
4763
4825
|
}
|
|
4764
4826
|
|
|
4827
|
+
/** @public */
|
|
4828
|
+
export declare type ResumableListenEventNames =
|
|
4829
|
+
| ListenEventName
|
|
4830
|
+
/** The listener has reconnected and successfully resumed from where it left off */
|
|
4831
|
+
| 'welcomeback'
|
|
4832
|
+
/** The listener can't be resumed or otherwise need to reset its local state */
|
|
4833
|
+
| 'reset'
|
|
4834
|
+
|
|
4835
|
+
/** @public */
|
|
4836
|
+
export declare interface ResumableListenOptions
|
|
4837
|
+
extends Omit<ListenOptions, 'events' | 'enableResume'> {
|
|
4838
|
+
/**
|
|
4839
|
+
* If this is enabled, the client will normally resume events upon reconnect
|
|
4840
|
+
* Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
|
|
4841
|
+
* @beta
|
|
4842
|
+
* @defaultValue `false`
|
|
4843
|
+
*/
|
|
4844
|
+
enableResume: true
|
|
4845
|
+
/**
|
|
4846
|
+
* Array of event names to include in the observable. By default, only mutation events are included.
|
|
4847
|
+
*
|
|
4848
|
+
* @defaultValue `['mutation']`
|
|
4849
|
+
*/
|
|
4850
|
+
events?: ResumableListenEventNames[]
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4765
4853
|
/** @internal */
|
|
4766
4854
|
export declare interface SanityAssetDocument extends SanityDocument {
|
|
4767
4855
|
url: string
|
|
@@ -6490,8 +6578,33 @@ export declare interface VideoPlaybackTokens {
|
|
|
6490
6578
|
}
|
|
6491
6579
|
|
|
6492
6580
|
/**
|
|
6493
|
-
*
|
|
6494
|
-
*
|
|
6581
|
+
* Emitted when the listener reconnects and successfully resumes from
|
|
6582
|
+
* its previous position.
|
|
6583
|
+
*
|
|
6584
|
+
* Even if the listener is created with `enableResume: true`, resume support
|
|
6585
|
+
* may not be available. In that case, a reconnect will emit `welcome`
|
|
6586
|
+
* instead of `welcomeback`.
|
|
6587
|
+
*
|
|
6588
|
+
* If resumability is unavailable, even listeners created with `enableResume: true` may still
|
|
6589
|
+
* emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
|
|
6590
|
+
* the same way they would otherwise treat a `reset` event.
|
|
6591
|
+
*
|
|
6592
|
+
* @public
|
|
6593
|
+
*/
|
|
6594
|
+
export declare type WelcomeBackEvent = {
|
|
6595
|
+
type: 'welcomeback'
|
|
6596
|
+
listenerName: string
|
|
6597
|
+
}
|
|
6598
|
+
|
|
6599
|
+
/**
|
|
6600
|
+
* Emitted when the listener connection has been successfully established
|
|
6601
|
+
* and is ready to receive events.
|
|
6602
|
+
*
|
|
6603
|
+
* If the listener was created with `enableResume: true` and resume support
|
|
6604
|
+
* is available, the `welcome` event will only be emitted on the initial
|
|
6605
|
+
* connection. On subsequent reconnects, a `welcomeback` event will be
|
|
6606
|
+
* emitted instead, followed by any events that were missed while the
|
|
6607
|
+
* connection was disconnected.
|
|
6495
6608
|
*
|
|
6496
6609
|
* @public
|
|
6497
6610
|
*/
|