@sanity/client 6.2.0-fetch.6 → 6.2.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.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare class AssetsClient {
54
54
  upload(
55
55
  assetType: 'file',
56
56
  body: UploadBody,
57
- options?: UploadClientConfig
57
+ options?: UploadClientConfig,
58
58
  ): Promise<SanityAssetDocument>
59
59
  /**
60
60
  * Uploads an image asset to the configured dataset
@@ -66,7 +66,7 @@ export declare class AssetsClient {
66
66
  upload(
67
67
  assetType: 'image',
68
68
  body: UploadBody,
69
- options?: UploadClientConfig
69
+ options?: UploadClientConfig,
70
70
  ): Promise<SanityImageAssetDocument>
71
71
  /**
72
72
  * Uploads a file or an image asset to the configured dataset
@@ -78,7 +78,7 @@ export declare class AssetsClient {
78
78
  upload(
79
79
  assetType: 'file' | 'image',
80
80
  body: UploadBody,
81
- options?: UploadClientConfig
81
+ options?: UploadClientConfig,
82
82
  ): Promise<SanityAssetDocument | SanityImageAssetDocument>
83
83
  }
84
84
 
@@ -227,7 +227,7 @@ export declare class BaseTransaction {
227
227
  * @param doc - Document to create if it does not already exist. Requires `_id` and `_type` properties.
228
228
  */
229
229
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
230
- doc: IdentifiedSanityDocumentStub<R>
230
+ doc: IdentifiedSanityDocumentStub<R>,
231
231
  ): this
232
232
  /**
233
233
  * Creates a new Sanity document, or replaces an existing one if the same `_id` is already used.
@@ -236,7 +236,7 @@ export declare class BaseTransaction {
236
236
  * @param doc - Document to create or replace. Requires `_id` and `_type` properties.
237
237
  */
238
238
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
239
- doc: IdentifiedSanityDocumentStub<R>
239
+ doc: IdentifiedSanityDocumentStub<R>,
240
240
  ): this
241
241
  /**
242
242
  * Deletes the document with the given document ID
@@ -444,7 +444,7 @@ export declare class DatasetsClient {
444
444
  name: string,
445
445
  options?: {
446
446
  aclMode?: DatasetAclMode
447
- }
447
+ },
448
448
  ): Promise<DatasetResponse>
449
449
  /**
450
450
  * Edit a dataset with the given name
@@ -456,7 +456,7 @@ export declare class DatasetsClient {
456
456
  name: string,
457
457
  options?: {
458
458
  aclMode?: DatasetAclMode
459
- }
459
+ },
460
460
  ): Promise<DatasetResponse>
461
461
  /**
462
462
  * Delete a dataset with the given name
@@ -528,7 +528,7 @@ export declare type HttpRequestEvent<T = unknown> = ResponseEvent<T> | ProgressE
528
528
 
529
529
  /** @public */
530
530
  export declare type IdentifiedSanityDocumentStub<
531
- T extends Record<string, Any> = Record<string, Any>
531
+ T extends Record<string, Any> = Record<string, Any>,
532
532
  > = {
533
533
  [P in keyof T]: T[P]
534
534
  } & {
@@ -581,7 +581,7 @@ export declare type InsertPatch =
581
581
  export declare function _listen<R extends Record<string, Any> = Record<string, Any>>(
582
582
  this: SanityClient | ObservableSanityClient,
583
583
  query: string,
584
- params?: QueryParams
584
+ params?: QueryParams,
585
585
  ): Observable<MutationEvent_2<R>>
586
586
 
587
587
  /**
@@ -596,7 +596,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
596
596
  this: SanityClient | ObservableSanityClient,
597
597
  query: string,
598
598
  params?: QueryParams,
599
- options?: ListenOptions
599
+ options?: ListenOptions,
600
600
  ): Observable<ListenEvent<R>>
601
601
 
602
602
  /** @public */
@@ -715,7 +715,7 @@ export declare class ObservableAssetsClient {
715
715
  upload(
716
716
  assetType: 'file',
717
717
  body: UploadBody,
718
- options?: UploadClientConfig
718
+ options?: UploadClientConfig,
719
719
  ): Observable<
720
720
  HttpRequestEvent<{
721
721
  document: SanityAssetDocument
@@ -731,7 +731,7 @@ export declare class ObservableAssetsClient {
731
731
  upload(
732
732
  assetType: 'image',
733
733
  body: UploadBody,
734
- options?: UploadClientConfig
734
+ options?: UploadClientConfig,
735
735
  ): Observable<
736
736
  HttpRequestEvent<{
737
737
  document: SanityImageAssetDocument
@@ -747,7 +747,7 @@ export declare class ObservableAssetsClient {
747
747
  upload(
748
748
  assetType: 'file' | 'image',
749
749
  body: UploadBody,
750
- options?: UploadClientConfig
750
+ options?: UploadClientConfig,
751
751
  ): Observable<
752
752
  HttpRequestEvent<{
753
753
  document: SanityAssetDocument | SanityImageAssetDocument
@@ -769,7 +769,7 @@ export declare class ObservableDatasetsClient {
769
769
  name: string,
770
770
  options?: {
771
771
  aclMode?: DatasetAclMode
772
- }
772
+ },
773
773
  ): Observable<DatasetResponse>
774
774
  /**
775
775
  * Edit a dataset with the given name
@@ -781,7 +781,7 @@ export declare class ObservableDatasetsClient {
781
781
  name: string,
782
782
  options?: {
783
783
  aclMode?: DatasetAclMode
784
- }
784
+ },
785
785
  ): Observable<DatasetResponse>
786
786
  /**
787
787
  * Delete a dataset with the given name
@@ -803,7 +803,7 @@ export declare class ObservablePatch extends BasePatch {
803
803
  constructor(
804
804
  selection: PatchSelection,
805
805
  operations?: PatchOperations,
806
- client?: ObservableSanityClient
806
+ client?: ObservableSanityClient,
807
807
  )
808
808
  /**
809
809
  * Clones the patch
@@ -815,7 +815,7 @@ export declare class ObservablePatch extends BasePatch {
815
815
  * @param options - Options for the mutation operation
816
816
  */
817
817
  commit<R extends Record<string, Any> = Record<string, Any>>(
818
- options: FirstDocumentMutationOptions
818
+ options: FirstDocumentMutationOptions,
819
819
  ): Observable<SanityDocument<R>>
820
820
  /**
821
821
  * Commit the patch, returning an observable that produces an array of the mutated documents
@@ -823,7 +823,7 @@ export declare class ObservablePatch extends BasePatch {
823
823
  * @param options - Options for the mutation operation
824
824
  */
825
825
  commit<R extends Record<string, Any> = Record<string, Any>>(
826
- options: AllDocumentsMutationOptions
826
+ options: AllDocumentsMutationOptions,
827
827
  ): Observable<SanityDocument<R>[]>
828
828
  /**
829
829
  * Commit the patch, returning an observable that produces a mutation result object
@@ -843,7 +843,7 @@ export declare class ObservablePatch extends BasePatch {
843
843
  * @param options - Options for the mutation operation
844
844
  */
845
845
  commit<R extends Record<string, Any> = Record<string, Any>>(
846
- options?: BaseMutationOptions
846
+ options?: BaseMutationOptions,
847
847
  ): Observable<SanityDocument<R>>
848
848
  }
849
849
 
@@ -919,7 +919,7 @@ export declare class ObservableSanityClient {
919
919
  fetch<R = Any, Q = QueryParams>(
920
920
  query: string,
921
921
  params: Q | undefined,
922
- options: FilteredResponseQueryOptions
922
+ options: FilteredResponseQueryOptions,
923
923
  ): Observable<R>
924
924
  /**
925
925
  * Perform a GROQ-query against the configured dataset.
@@ -931,7 +931,7 @@ export declare class ObservableSanityClient {
931
931
  fetch<R = Any, Q = QueryParams>(
932
932
  query: string,
933
933
  params: Q | undefined,
934
- options: UnfilteredResponseQueryOptions
934
+ options: UnfilteredResponseQueryOptions,
935
935
  ): Observable<RawQueryResponse<R>>
936
936
  /**
937
937
  * Fetch a single document with the given ID.
@@ -943,7 +943,7 @@ export declare class ObservableSanityClient {
943
943
  id: string,
944
944
  options?: {
945
945
  tag?: string
946
- }
946
+ },
947
947
  ): Observable<SanityDocument<R> | undefined>
948
948
  /**
949
949
  * Fetch multiple documents in one request.
@@ -958,7 +958,7 @@ export declare class ObservableSanityClient {
958
958
  ids: string[],
959
959
  options?: {
960
960
  tag?: string
961
- }
961
+ },
962
962
  ): Observable<(SanityDocument<R> | null)[]>
963
963
  /**
964
964
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -969,7 +969,7 @@ export declare class ObservableSanityClient {
969
969
  */
970
970
  create<R extends Record<string, Any> = Record<string, Any>>(
971
971
  document: SanityDocumentStub<R>,
972
- options: FirstDocumentMutationOptions
972
+ options: FirstDocumentMutationOptions,
973
973
  ): Observable<SanityDocument<R>>
974
974
  /**
975
975
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -980,7 +980,7 @@ export declare class ObservableSanityClient {
980
980
  */
981
981
  create<R extends Record<string, Any> = Record<string, Any>>(
982
982
  document: SanityDocumentStub<R>,
983
- options: AllDocumentsMutationOptions
983
+ options: AllDocumentsMutationOptions,
984
984
  ): Observable<SanityDocument<R>[]>
985
985
  /**
986
986
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -991,7 +991,7 @@ export declare class ObservableSanityClient {
991
991
  */
992
992
  create<R extends Record<string, Any> = Record<string, Any>>(
993
993
  document: SanityDocumentStub<R>,
994
- options: FirstDocumentIdMutationOptions
994
+ options: FirstDocumentIdMutationOptions,
995
995
  ): Observable<SingleMutationResult>
996
996
  /**
997
997
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1002,7 +1002,7 @@ export declare class ObservableSanityClient {
1002
1002
  */
1003
1003
  create<R extends Record<string, Any> = Record<string, Any>>(
1004
1004
  document: SanityDocumentStub<R>,
1005
- options: AllDocumentIdsMutationOptions
1005
+ options: AllDocumentIdsMutationOptions,
1006
1006
  ): Observable<MultipleMutationResult>
1007
1007
  /**
1008
1008
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1013,7 +1013,7 @@ export declare class ObservableSanityClient {
1013
1013
  */
1014
1014
  create<R extends Record<string, Any> = Record<string, Any>>(
1015
1015
  document: SanityDocumentStub<R>,
1016
- options?: BaseMutationOptions
1016
+ options?: BaseMutationOptions,
1017
1017
  ): Observable<SanityDocument<R>>
1018
1018
  /**
1019
1019
  * Create a document if no document with the same ID already exists.
@@ -1024,7 +1024,7 @@ export declare class ObservableSanityClient {
1024
1024
  */
1025
1025
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1026
1026
  document: IdentifiedSanityDocumentStub<R>,
1027
- options: FirstDocumentMutationOptions
1027
+ options: FirstDocumentMutationOptions,
1028
1028
  ): Observable<SanityDocument<R>>
1029
1029
  /**
1030
1030
  * Create a document if no document with the same ID already exists.
@@ -1035,7 +1035,7 @@ export declare class ObservableSanityClient {
1035
1035
  */
1036
1036
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1037
1037
  document: IdentifiedSanityDocumentStub<R>,
1038
- options: AllDocumentsMutationOptions
1038
+ options: AllDocumentsMutationOptions,
1039
1039
  ): Observable<SanityDocument<R>[]>
1040
1040
  /**
1041
1041
  * Create a document if no document with the same ID already exists.
@@ -1046,7 +1046,7 @@ export declare class ObservableSanityClient {
1046
1046
  */
1047
1047
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1048
1048
  document: IdentifiedSanityDocumentStub<R>,
1049
- options: FirstDocumentIdMutationOptions
1049
+ options: FirstDocumentIdMutationOptions,
1050
1050
  ): Observable<SingleMutationResult>
1051
1051
  /**
1052
1052
  * Create a document if no document with the same ID already exists.
@@ -1057,7 +1057,7 @@ export declare class ObservableSanityClient {
1057
1057
  */
1058
1058
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1059
1059
  document: IdentifiedSanityDocumentStub<R>,
1060
- options: AllDocumentIdsMutationOptions
1060
+ options: AllDocumentIdsMutationOptions,
1061
1061
  ): Observable<MultipleMutationResult>
1062
1062
  /**
1063
1063
  * Create a document if no document with the same ID already exists.
@@ -1068,7 +1068,7 @@ export declare class ObservableSanityClient {
1068
1068
  */
1069
1069
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1070
1070
  document: IdentifiedSanityDocumentStub<R>,
1071
- options?: BaseMutationOptions
1071
+ options?: BaseMutationOptions,
1072
1072
  ): Observable<SanityDocument<R>>
1073
1073
  /**
1074
1074
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1079,7 +1079,7 @@ export declare class ObservableSanityClient {
1079
1079
  */
1080
1080
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1081
1081
  document: IdentifiedSanityDocumentStub<R>,
1082
- options: FirstDocumentMutationOptions
1082
+ options: FirstDocumentMutationOptions,
1083
1083
  ): Observable<SanityDocument<R>>
1084
1084
  /**
1085
1085
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1090,7 +1090,7 @@ export declare class ObservableSanityClient {
1090
1090
  */
1091
1091
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1092
1092
  document: IdentifiedSanityDocumentStub<R>,
1093
- options: AllDocumentsMutationOptions
1093
+ options: AllDocumentsMutationOptions,
1094
1094
  ): Observable<SanityDocument<R>[]>
1095
1095
  /**
1096
1096
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1101,7 +1101,7 @@ export declare class ObservableSanityClient {
1101
1101
  */
1102
1102
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1103
1103
  document: IdentifiedSanityDocumentStub<R>,
1104
- options: FirstDocumentIdMutationOptions
1104
+ options: FirstDocumentIdMutationOptions,
1105
1105
  ): Observable<SingleMutationResult>
1106
1106
  /**
1107
1107
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1112,7 +1112,7 @@ export declare class ObservableSanityClient {
1112
1112
  */
1113
1113
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1114
1114
  document: IdentifiedSanityDocumentStub<R>,
1115
- options: AllDocumentIdsMutationOptions
1115
+ options: AllDocumentIdsMutationOptions,
1116
1116
  ): Observable<MultipleMutationResult>
1117
1117
  /**
1118
1118
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1123,7 +1123,7 @@ export declare class ObservableSanityClient {
1123
1123
  */
1124
1124
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1125
1125
  document: IdentifiedSanityDocumentStub<R>,
1126
- options?: BaseMutationOptions
1126
+ options?: BaseMutationOptions,
1127
1127
  ): Observable<SanityDocument<R>>
1128
1128
  /**
1129
1129
  * Deletes a document with the given document ID.
@@ -1134,7 +1134,7 @@ export declare class ObservableSanityClient {
1134
1134
  */
1135
1135
  delete<R extends Record<string, Any> = Record<string, Any>>(
1136
1136
  id: string,
1137
- options: FirstDocumentMutationOptions
1137
+ options: FirstDocumentMutationOptions,
1138
1138
  ): Observable<SanityDocument<R>>
1139
1139
  /**
1140
1140
  * Deletes a document with the given document ID.
@@ -1145,7 +1145,7 @@ export declare class ObservableSanityClient {
1145
1145
  */
1146
1146
  delete<R extends Record<string, Any> = Record<string, Any>>(
1147
1147
  id: string,
1148
- options: AllDocumentsMutationOptions
1148
+ options: AllDocumentsMutationOptions,
1149
1149
  ): Observable<SanityDocument<R>[]>
1150
1150
  /**
1151
1151
  * Deletes a document with the given document ID.
@@ -1172,7 +1172,7 @@ export declare class ObservableSanityClient {
1172
1172
  */
1173
1173
  delete<R extends Record<string, Any> = Record<string, Any>>(
1174
1174
  id: string,
1175
- options?: BaseMutationOptions
1175
+ options?: BaseMutationOptions,
1176
1176
  ): Observable<SanityDocument<R>>
1177
1177
  /**
1178
1178
  * Deletes one or more documents matching the given query or document ID.
@@ -1183,7 +1183,7 @@ export declare class ObservableSanityClient {
1183
1183
  */
1184
1184
  delete<R extends Record<string, Any> = Record<string, Any>>(
1185
1185
  selection: MutationSelection,
1186
- options: FirstDocumentMutationOptions
1186
+ options: FirstDocumentMutationOptions,
1187
1187
  ): Observable<SanityDocument<R>>
1188
1188
  /**
1189
1189
  * Deletes one or more documents matching the given query or document ID.
@@ -1194,7 +1194,7 @@ export declare class ObservableSanityClient {
1194
1194
  */
1195
1195
  delete<R extends Record<string, Any> = Record<string, Any>>(
1196
1196
  selection: MutationSelection,
1197
- options: AllDocumentsMutationOptions
1197
+ options: AllDocumentsMutationOptions,
1198
1198
  ): Observable<SanityDocument<R>[]>
1199
1199
  /**
1200
1200
  * Deletes one or more documents matching the given query or document ID.
@@ -1205,7 +1205,7 @@ export declare class ObservableSanityClient {
1205
1205
  */
1206
1206
  delete(
1207
1207
  selection: MutationSelection,
1208
- options: FirstDocumentIdMutationOptions
1208
+ options: FirstDocumentIdMutationOptions,
1209
1209
  ): Observable<SingleMutationResult>
1210
1210
  /**
1211
1211
  * Deletes one or more documents matching the given query or document ID.
@@ -1216,7 +1216,7 @@ export declare class ObservableSanityClient {
1216
1216
  */
1217
1217
  delete(
1218
1218
  selection: MutationSelection,
1219
- options: AllDocumentIdsMutationOptions
1219
+ options: AllDocumentIdsMutationOptions,
1220
1220
  ): Observable<MultipleMutationResult>
1221
1221
  /**
1222
1222
  * Deletes one or more documents matching the given query or document ID.
@@ -1227,7 +1227,7 @@ export declare class ObservableSanityClient {
1227
1227
  */
1228
1228
  delete<R extends Record<string, Any> = Record<string, Any>>(
1229
1229
  selection: MutationSelection,
1230
- options?: BaseMutationOptions
1230
+ options?: BaseMutationOptions,
1231
1231
  ): Observable<SanityDocument<R>>
1232
1232
  /**
1233
1233
  * Perform mutation operations against the configured dataset
@@ -1238,7 +1238,7 @@ export declare class ObservableSanityClient {
1238
1238
  */
1239
1239
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1240
1240
  operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
1241
- options: FirstDocumentMutationOptions
1241
+ options: FirstDocumentMutationOptions,
1242
1242
  ): Observable<SanityDocument<R>>
1243
1243
  /**
1244
1244
  * Perform mutation operations against the configured dataset.
@@ -1249,7 +1249,7 @@ export declare class ObservableSanityClient {
1249
1249
  */
1250
1250
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1251
1251
  operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
1252
- options: AllDocumentsMutationOptions
1252
+ options: AllDocumentsMutationOptions,
1253
1253
  ): Observable<SanityDocument<R>[]>
1254
1254
  /**
1255
1255
  * Perform mutation operations against the configured dataset
@@ -1260,7 +1260,7 @@ export declare class ObservableSanityClient {
1260
1260
  */
1261
1261
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1262
1262
  operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
1263
- options: FirstDocumentIdMutationOptions
1263
+ options: FirstDocumentIdMutationOptions,
1264
1264
  ): Observable<SingleMutationResult>
1265
1265
  /**
1266
1266
  * Perform mutation operations against the configured dataset
@@ -1271,7 +1271,7 @@ export declare class ObservableSanityClient {
1271
1271
  */
1272
1272
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1273
1273
  operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
1274
- options: AllDocumentIdsMutationOptions
1274
+ options: AllDocumentIdsMutationOptions,
1275
1275
  ): Observable<MultipleMutationResult>
1276
1276
  /**
1277
1277
  * Perform mutation operations against the configured dataset
@@ -1282,7 +1282,7 @@ export declare class ObservableSanityClient {
1282
1282
  */
1283
1283
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1284
1284
  operations: Mutation<R>[] | ObservablePatch | ObservableTransaction,
1285
- options?: BaseMutationOptions
1285
+ options?: BaseMutationOptions,
1286
1286
  ): Observable<SanityDocument<R>>
1287
1287
  /**
1288
1288
  * Create a new buildable patch of operations to perform
@@ -1297,7 +1297,7 @@ export declare class ObservableSanityClient {
1297
1297
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
1298
1298
  */
1299
1299
  transaction<R extends Record<string, Any> = Record<string, Any>>(
1300
- operations?: Mutation<R>[]
1300
+ operations?: Mutation<R>[],
1301
1301
  ): ObservableTransaction
1302
1302
  /**
1303
1303
  * DEPRECATED: Perform an HTTP request against the Sanity API
@@ -1336,7 +1336,7 @@ export declare class ObservableTransaction extends BaseTransaction {
1336
1336
  * @param options - Options for the mutation operation
1337
1337
  */
1338
1338
  commit<R extends Record<string, Any>>(
1339
- options: TransactionFirstDocumentMutationOptions
1339
+ options: TransactionFirstDocumentMutationOptions,
1340
1340
  ): Observable<SanityDocument<R>>
1341
1341
  /**
1342
1342
  * Commit the transaction, returning an observable that produces an array of the mutated documents
@@ -1344,7 +1344,7 @@ export declare class ObservableTransaction extends BaseTransaction {
1344
1344
  * @param options - Options for the mutation operation
1345
1345
  */
1346
1346
  commit<R extends Record<string, Any>>(
1347
- options: TransactionAllDocumentsMutationOptions
1347
+ options: TransactionAllDocumentsMutationOptions,
1348
1348
  ): Observable<SanityDocument<R>[]>
1349
1349
  /**
1350
1350
  * Commit the transaction, returning an observable that produces a mutation result object
@@ -1391,7 +1391,7 @@ export declare class ObservableUsersClient {
1391
1391
  * @param id - User ID of the user to fetch. If `me` is provided, a minimal response including the users role is returned.
1392
1392
  */
1393
1393
  getById<T extends 'me' | string>(
1394
- id: T
1394
+ id: T,
1395
1395
  ): Observable<T extends 'me' ? CurrentSanityUser : SanityUser>
1396
1396
  }
1397
1397
 
@@ -1409,7 +1409,7 @@ export declare class Patch extends BasePatch {
1409
1409
  * @param options - Options for the mutation operation
1410
1410
  */
1411
1411
  commit<R extends Record<string, Any> = Record<string, Any>>(
1412
- options: FirstDocumentMutationOptions
1412
+ options: FirstDocumentMutationOptions,
1413
1413
  ): Promise<SanityDocument<R>>
1414
1414
  /**
1415
1415
  * Commit the patch, returning a promise that resolves to an array of the mutated documents
@@ -1417,7 +1417,7 @@ export declare class Patch extends BasePatch {
1417
1417
  * @param options - Options for the mutation operation
1418
1418
  */
1419
1419
  commit<R extends Record<string, Any> = Record<string, Any>>(
1420
- options: AllDocumentsMutationOptions
1420
+ options: AllDocumentsMutationOptions,
1421
1421
  ): Promise<SanityDocument<R>[]>
1422
1422
  /**
1423
1423
  * Commit the patch, returning a promise that resolves to a mutation result object
@@ -1437,7 +1437,7 @@ export declare class Patch extends BasePatch {
1437
1437
  * @param options - Options for the mutation operation
1438
1438
  */
1439
1439
  commit<R extends Record<string, Any> = Record<string, Any>>(
1440
- options?: BaseMutationOptions
1440
+ options?: BaseMutationOptions,
1441
1441
  ): Promise<SanityDocument<R>>
1442
1442
  }
1443
1443
 
@@ -1658,7 +1658,7 @@ export declare class SanityClient {
1658
1658
  fetch<R = Any, Q = QueryParams>(
1659
1659
  query: string,
1660
1660
  params: Q | undefined,
1661
- options: FilteredResponseQueryOptions
1661
+ options: FilteredResponseQueryOptions,
1662
1662
  ): Promise<R>
1663
1663
  /**
1664
1664
  * Perform a GROQ-query against the configured dataset.
@@ -1670,7 +1670,7 @@ export declare class SanityClient {
1670
1670
  fetch<R = Any, Q = QueryParams>(
1671
1671
  query: string,
1672
1672
  params: Q | undefined,
1673
- options: UnfilteredResponseQueryOptions
1673
+ options: UnfilteredResponseQueryOptions,
1674
1674
  ): Promise<RawQueryResponse<R>>
1675
1675
  /**
1676
1676
  * Fetch a single document with the given ID.
@@ -1682,7 +1682,7 @@ export declare class SanityClient {
1682
1682
  id: string,
1683
1683
  options?: {
1684
1684
  tag?: string
1685
- }
1685
+ },
1686
1686
  ): Promise<SanityDocument<R> | undefined>
1687
1687
  /**
1688
1688
  * Fetch multiple documents in one request.
@@ -1697,7 +1697,7 @@ export declare class SanityClient {
1697
1697
  ids: string[],
1698
1698
  options?: {
1699
1699
  tag?: string
1700
- }
1700
+ },
1701
1701
  ): Promise<(SanityDocument<R> | null)[]>
1702
1702
  /**
1703
1703
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1708,7 +1708,7 @@ export declare class SanityClient {
1708
1708
  */
1709
1709
  create<R extends Record<string, Any> = Record<string, Any>>(
1710
1710
  document: SanityDocumentStub<R>,
1711
- options: FirstDocumentMutationOptions
1711
+ options: FirstDocumentMutationOptions,
1712
1712
  ): Promise<SanityDocument<R>>
1713
1713
  /**
1714
1714
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1719,7 +1719,7 @@ export declare class SanityClient {
1719
1719
  */
1720
1720
  create<R extends Record<string, Any> = Record<string, Any>>(
1721
1721
  document: SanityDocumentStub<R>,
1722
- options: AllDocumentsMutationOptions
1722
+ options: AllDocumentsMutationOptions,
1723
1723
  ): Promise<SanityDocument<R>[]>
1724
1724
  /**
1725
1725
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1730,7 +1730,7 @@ export declare class SanityClient {
1730
1730
  */
1731
1731
  create<R extends Record<string, Any> = Record<string, Any>>(
1732
1732
  document: SanityDocumentStub<R>,
1733
- options: FirstDocumentIdMutationOptions
1733
+ options: FirstDocumentIdMutationOptions,
1734
1734
  ): Promise<SingleMutationResult>
1735
1735
  /**
1736
1736
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1741,7 +1741,7 @@ export declare class SanityClient {
1741
1741
  */
1742
1742
  create<R extends Record<string, Any> = Record<string, Any>>(
1743
1743
  document: SanityDocumentStub<R>,
1744
- options: AllDocumentIdsMutationOptions
1744
+ options: AllDocumentIdsMutationOptions,
1745
1745
  ): Promise<MultipleMutationResult>
1746
1746
  /**
1747
1747
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
@@ -1752,7 +1752,7 @@ export declare class SanityClient {
1752
1752
  */
1753
1753
  create<R extends Record<string, Any> = Record<string, Any>>(
1754
1754
  document: SanityDocumentStub<R>,
1755
- options?: BaseMutationOptions
1755
+ options?: BaseMutationOptions,
1756
1756
  ): Promise<SanityDocument<R>>
1757
1757
  /**
1758
1758
  * Create a document if no document with the same ID already exists.
@@ -1763,7 +1763,7 @@ export declare class SanityClient {
1763
1763
  */
1764
1764
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1765
1765
  document: IdentifiedSanityDocumentStub<R>,
1766
- options: FirstDocumentMutationOptions
1766
+ options: FirstDocumentMutationOptions,
1767
1767
  ): Promise<SanityDocument<R>>
1768
1768
  /**
1769
1769
  * Create a document if no document with the same ID already exists.
@@ -1774,7 +1774,7 @@ export declare class SanityClient {
1774
1774
  */
1775
1775
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1776
1776
  document: IdentifiedSanityDocumentStub<R>,
1777
- options: AllDocumentsMutationOptions
1777
+ options: AllDocumentsMutationOptions,
1778
1778
  ): Promise<SanityDocument<R>[]>
1779
1779
  /**
1780
1780
  * Create a document if no document with the same ID already exists.
@@ -1785,7 +1785,7 @@ export declare class SanityClient {
1785
1785
  */
1786
1786
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1787
1787
  document: IdentifiedSanityDocumentStub<R>,
1788
- options: FirstDocumentIdMutationOptions
1788
+ options: FirstDocumentIdMutationOptions,
1789
1789
  ): Promise<SingleMutationResult>
1790
1790
  /**
1791
1791
  * Create a document if no document with the same ID already exists.
@@ -1796,7 +1796,7 @@ export declare class SanityClient {
1796
1796
  */
1797
1797
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1798
1798
  document: IdentifiedSanityDocumentStub<R>,
1799
- options: AllDocumentIdsMutationOptions
1799
+ options: AllDocumentIdsMutationOptions,
1800
1800
  ): Promise<MultipleMutationResult>
1801
1801
  /**
1802
1802
  * Create a document if no document with the same ID already exists.
@@ -1807,7 +1807,7 @@ export declare class SanityClient {
1807
1807
  */
1808
1808
  createIfNotExists<R extends Record<string, Any> = Record<string, Any>>(
1809
1809
  document: IdentifiedSanityDocumentStub<R>,
1810
- options?: BaseMutationOptions
1810
+ options?: BaseMutationOptions,
1811
1811
  ): Promise<SanityDocument<R>>
1812
1812
  /**
1813
1813
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1818,7 +1818,7 @@ export declare class SanityClient {
1818
1818
  */
1819
1819
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1820
1820
  document: IdentifiedSanityDocumentStub<R>,
1821
- options: FirstDocumentMutationOptions
1821
+ options: FirstDocumentMutationOptions,
1822
1822
  ): Promise<SanityDocument<R>>
1823
1823
  /**
1824
1824
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1829,7 +1829,7 @@ export declare class SanityClient {
1829
1829
  */
1830
1830
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1831
1831
  document: IdentifiedSanityDocumentStub<R>,
1832
- options: AllDocumentsMutationOptions
1832
+ options: AllDocumentsMutationOptions,
1833
1833
  ): Promise<SanityDocument<R>[]>
1834
1834
  /**
1835
1835
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1840,7 +1840,7 @@ export declare class SanityClient {
1840
1840
  */
1841
1841
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1842
1842
  document: IdentifiedSanityDocumentStub<R>,
1843
- options: FirstDocumentIdMutationOptions
1843
+ options: FirstDocumentIdMutationOptions,
1844
1844
  ): Promise<SingleMutationResult>
1845
1845
  /**
1846
1846
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1851,7 +1851,7 @@ export declare class SanityClient {
1851
1851
  */
1852
1852
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1853
1853
  document: IdentifiedSanityDocumentStub<R>,
1854
- options: AllDocumentIdsMutationOptions
1854
+ options: AllDocumentIdsMutationOptions,
1855
1855
  ): Promise<MultipleMutationResult>
1856
1856
  /**
1857
1857
  * Create a document if it does not exist, or replace a document with the same document ID
@@ -1862,7 +1862,7 @@ export declare class SanityClient {
1862
1862
  */
1863
1863
  createOrReplace<R extends Record<string, Any> = Record<string, Any>>(
1864
1864
  document: IdentifiedSanityDocumentStub<R>,
1865
- options?: BaseMutationOptions
1865
+ options?: BaseMutationOptions,
1866
1866
  ): Promise<SanityDocument<R>>
1867
1867
  /**
1868
1868
  * Deletes a document with the given document ID.
@@ -1873,7 +1873,7 @@ export declare class SanityClient {
1873
1873
  */
1874
1874
  delete<R extends Record<string, Any> = Record<string, Any>>(
1875
1875
  id: string,
1876
- options: FirstDocumentMutationOptions
1876
+ options: FirstDocumentMutationOptions,
1877
1877
  ): Promise<SanityDocument<R>>
1878
1878
  /**
1879
1879
  * Deletes a document with the given document ID.
@@ -1884,7 +1884,7 @@ export declare class SanityClient {
1884
1884
  */
1885
1885
  delete<R extends Record<string, Any> = Record<string, Any>>(
1886
1886
  id: string,
1887
- options: AllDocumentsMutationOptions
1887
+ options: AllDocumentsMutationOptions,
1888
1888
  ): Promise<SanityDocument<R>[]>
1889
1889
  /**
1890
1890
  * Deletes a document with the given document ID.
@@ -1911,7 +1911,7 @@ export declare class SanityClient {
1911
1911
  */
1912
1912
  delete<R extends Record<string, Any> = Record<string, Any>>(
1913
1913
  id: string,
1914
- options?: BaseMutationOptions
1914
+ options?: BaseMutationOptions,
1915
1915
  ): Promise<SanityDocument<R>>
1916
1916
  /**
1917
1917
  * Deletes one or more documents matching the given query or document ID.
@@ -1922,7 +1922,7 @@ export declare class SanityClient {
1922
1922
  */
1923
1923
  delete<R extends Record<string, Any> = Record<string, Any>>(
1924
1924
  selection: MutationSelection,
1925
- options: FirstDocumentMutationOptions
1925
+ options: FirstDocumentMutationOptions,
1926
1926
  ): Promise<SanityDocument<R>>
1927
1927
  /**
1928
1928
  * Deletes one or more documents matching the given query or document ID.
@@ -1933,7 +1933,7 @@ export declare class SanityClient {
1933
1933
  */
1934
1934
  delete<R extends Record<string, Any> = Record<string, Any>>(
1935
1935
  selection: MutationSelection,
1936
- options: AllDocumentsMutationOptions
1936
+ options: AllDocumentsMutationOptions,
1937
1937
  ): Promise<SanityDocument<R>[]>
1938
1938
  /**
1939
1939
  * Deletes one or more documents matching the given query or document ID.
@@ -1944,7 +1944,7 @@ export declare class SanityClient {
1944
1944
  */
1945
1945
  delete(
1946
1946
  selection: MutationSelection,
1947
- options: FirstDocumentIdMutationOptions
1947
+ options: FirstDocumentIdMutationOptions,
1948
1948
  ): Promise<SingleMutationResult>
1949
1949
  /**
1950
1950
  * Deletes one or more documents matching the given query or document ID.
@@ -1955,7 +1955,7 @@ export declare class SanityClient {
1955
1955
  */
1956
1956
  delete(
1957
1957
  selection: MutationSelection,
1958
- options: AllDocumentIdsMutationOptions
1958
+ options: AllDocumentIdsMutationOptions,
1959
1959
  ): Promise<MultipleMutationResult>
1960
1960
  /**
1961
1961
  * Deletes one or more documents matching the given query or document ID.
@@ -1966,7 +1966,7 @@ export declare class SanityClient {
1966
1966
  */
1967
1967
  delete<R extends Record<string, Any> = Record<string, Any>>(
1968
1968
  selection: MutationSelection,
1969
- options?: BaseMutationOptions
1969
+ options?: BaseMutationOptions,
1970
1970
  ): Promise<SanityDocument<R>>
1971
1971
  /**
1972
1972
  * Perform mutation operations against the configured dataset
@@ -1977,7 +1977,7 @@ export declare class SanityClient {
1977
1977
  */
1978
1978
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1979
1979
  operations: Mutation<R>[] | Patch | Transaction,
1980
- options: FirstDocumentMutationOptions
1980
+ options: FirstDocumentMutationOptions,
1981
1981
  ): Promise<SanityDocument<R>>
1982
1982
  /**
1983
1983
  * Perform mutation operations against the configured dataset.
@@ -1988,7 +1988,7 @@ export declare class SanityClient {
1988
1988
  */
1989
1989
  mutate<R extends Record<string, Any> = Record<string, Any>>(
1990
1990
  operations: Mutation<R>[] | Patch | Transaction,
1991
- options: AllDocumentsMutationOptions
1991
+ options: AllDocumentsMutationOptions,
1992
1992
  ): Promise<SanityDocument<R>[]>
1993
1993
  /**
1994
1994
  * Perform mutation operations against the configured dataset
@@ -1999,7 +1999,7 @@ export declare class SanityClient {
1999
1999
  */
2000
2000
  mutate<R extends Record<string, Any> = Record<string, Any>>(
2001
2001
  operations: Mutation<R>[] | Patch | Transaction,
2002
- options: FirstDocumentIdMutationOptions
2002
+ options: FirstDocumentIdMutationOptions,
2003
2003
  ): Promise<SingleMutationResult>
2004
2004
  /**
2005
2005
  * Perform mutation operations against the configured dataset
@@ -2010,7 +2010,7 @@ export declare class SanityClient {
2010
2010
  */
2011
2011
  mutate<R extends Record<string, Any>>(
2012
2012
  operations: Mutation<R>[] | Patch | Transaction,
2013
- options: AllDocumentIdsMutationOptions
2013
+ options: AllDocumentIdsMutationOptions,
2014
2014
  ): Promise<MultipleMutationResult>
2015
2015
  /**
2016
2016
  * Perform mutation operations against the configured dataset
@@ -2021,7 +2021,7 @@ export declare class SanityClient {
2021
2021
  */
2022
2022
  mutate<R extends Record<string, Any> = Record<string, Any>>(
2023
2023
  operations: Mutation<R>[] | Patch | Transaction,
2024
- options?: BaseMutationOptions
2024
+ options?: BaseMutationOptions,
2025
2025
  ): Promise<SanityDocument<R>>
2026
2026
  /**
2027
2027
  * Create a new buildable patch of operations to perform
@@ -2036,7 +2036,7 @@ export declare class SanityClient {
2036
2036
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
2037
2037
  */
2038
2038
  transaction<R extends Record<string, Any> = Record<string, Any>>(
2039
- operations?: Mutation<R>[]
2039
+ operations?: Mutation<R>[],
2040
2040
  ): Transaction
2041
2041
  /**
2042
2042
  * Perform a request against the Sanity API
@@ -2217,7 +2217,7 @@ export declare class Transaction extends BaseTransaction {
2217
2217
  * @param options - Options for the mutation operation
2218
2218
  */
2219
2219
  commit<R extends Record<string, Any>>(
2220
- options: TransactionFirstDocumentMutationOptions
2220
+ options: TransactionFirstDocumentMutationOptions,
2221
2221
  ): Promise<SanityDocument<R>>
2222
2222
  /**
2223
2223
  * Commit the transaction, returning a promise that resolves to an array of the mutated documents
@@ -2225,7 +2225,7 @@ export declare class Transaction extends BaseTransaction {
2225
2225
  * @param options - Options for the mutation operation
2226
2226
  */
2227
2227
  commit<R extends Record<string, Any>>(
2228
- options: TransactionAllDocumentsMutationOptions
2228
+ options: TransactionAllDocumentsMutationOptions,
2229
2229
  ): Promise<SanityDocument<R>[]>
2230
2230
  /**
2231
2231
  * Commit the transaction, returning a promise that resolves to a mutation result object