@sanity/client 8.4.0 → 8.5.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.
@@ -959,7 +959,10 @@ type TranslateDocumentSync<T extends Record<string, Any$1> = Record<string, Any$
959
959
  type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync;
960
960
  /** @beta */
961
961
  type TranslateDocument<T extends Record<string, Any$1> = Record<string, Any$1>> = TranslateDocumentSync<T> | TranslateDocumentAsync;
962
- /** @public */
962
+ /**
963
+ * @public
964
+ * @inline
965
+ */
963
966
  declare class ObservableAgentsActionClient {
964
967
  #private;
965
968
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -985,7 +988,10 @@ declare class ObservableAgentsActionClient {
985
988
  _id: string;
986
989
  } : IdentifiedSanityDocumentStub & DocumentShape>;
987
990
  }
988
- /** @public */
991
+ /**
992
+ * @public
993
+ * @inline
994
+ */
989
995
  declare class AgentActionsClient {
990
996
  #private;
991
997
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -1024,7 +1030,10 @@ declare class AgentActionsClient {
1024
1030
  _id: string;
1025
1031
  } : IdentifiedSanityDocumentStub & DocumentShape>;
1026
1032
  }
1027
- /** @internal */
1033
+ /**
1034
+ * @internal
1035
+ * @inline
1036
+ */
1028
1037
  declare class ObservableAssetsClient {
1029
1038
  #private;
1030
1039
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -1059,7 +1068,10 @@ declare class ObservableAssetsClient {
1059
1068
  document: SanityAssetDocument | SanityImageAssetDocument;
1060
1069
  }>>;
1061
1070
  }
1062
- /** @internal */
1071
+ /**
1072
+ * @internal
1073
+ * @inline
1074
+ */
1063
1075
  declare class AssetsClient {
1064
1076
  #private;
1065
1077
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -4873,6 +4885,7 @@ declare class ObservableContextClient {
4873
4885
  }
4874
4886
  /**
4875
4887
  * @public
4888
+ * @inline
4876
4889
  */
4877
4890
  declare class LiveClient {
4878
4891
  #private;
@@ -5250,7 +5263,10 @@ declare class ObservableTransaction extends BaseTransaction {
5250
5263
  */
5251
5264
  patch(patch: ObservablePatch): this;
5252
5265
  }
5253
- /** @internal */
5266
+ /**
5267
+ * @internal
5268
+ * @inline
5269
+ */
5254
5270
  declare class ObservableDatasetsClient {
5255
5271
  #private;
5256
5272
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -5294,7 +5310,10 @@ declare class ObservableDatasetsClient {
5294
5310
  */
5295
5311
  editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>;
5296
5312
  }
5297
- /** @internal */
5313
+ /**
5314
+ * @internal
5315
+ * @inline
5316
+ */
5298
5317
  declare class DatasetsClient {
5299
5318
  #private;
5300
5319
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -5434,7 +5453,10 @@ declare class FunctionsClient {
5434
5453
  }): Promise<R>;
5435
5454
  invoke<R = unknown>(functionName: string, request?: InvokeFunctionRequest, options?: InvokeFunctionOptions): Promise<R | undefined>;
5436
5455
  }
5437
- /** @internal */
5456
+ /**
5457
+ * @internal
5458
+ * @inline
5459
+ */
5438
5460
  declare class ObservableMediaLibraryVideoClient {
5439
5461
  #private;
5440
5462
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -5446,7 +5468,10 @@ declare class ObservableMediaLibraryVideoClient {
5446
5468
  */
5447
5469
  getPlaybackInfo(assetIdentifier: MediaLibraryAssetInstanceIdentifier, options?: MediaLibraryPlaybackInfoOptions): Observable<VideoPlaybackInfo>;
5448
5470
  }
5449
- /** @internal */
5471
+ /**
5472
+ * @internal
5473
+ * @inline
5474
+ */
5450
5475
  declare class MediaLibraryVideoClient {
5451
5476
  #private;
5452
5477
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -5469,7 +5494,10 @@ type OmittedProjectFields<T extends ListOptions | undefined> = (T extends {
5469
5494
  } ? 'members' : never) | (T extends {
5470
5495
  includeFeatures: false;
5471
5496
  } ? 'features' : never);
5472
- /** @internal */
5497
+ /**
5498
+ * @internal
5499
+ * @inline
5500
+ */
5473
5501
  declare class ObservableProjectsClient {
5474
5502
  #private;
5475
5503
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -5490,7 +5518,10 @@ declare class ObservableProjectsClient {
5490
5518
  */
5491
5519
  getById(projectId: string): Observable<SanityProject>;
5492
5520
  }
5493
- /** @internal */
5521
+ /**
5522
+ * @internal
5523
+ * @inline
5524
+ */
5494
5525
  declare class ProjectsClient {
5495
5526
  #private;
5496
5527
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -5511,7 +5542,10 @@ declare class ProjectsClient {
5511
5542
  */
5512
5543
  getById(projectId: string): Promise<SanityProject>;
5513
5544
  }
5514
- /** @public */
5545
+ /**
5546
+ * @public
5547
+ * @inline
5548
+ */
5515
5549
  declare class ObservableReleasesClient {
5516
5550
  #private;
5517
5551
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -5756,7 +5790,10 @@ declare class ObservableReleasesClient {
5756
5790
  releaseId: string;
5757
5791
  }, options?: BaseMutationOptions): Observable<RawQueryResponse$1<SanityDocument$1[]>>;
5758
5792
  }
5759
- /** @public */
5793
+ /**
5794
+ * @public
5795
+ * @inline
5796
+ */
5760
5797
  declare class ReleasesClient {
5761
5798
  #private;
5762
5799
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -5992,7 +6029,10 @@ declare class ReleasesClient {
5992
6029
  releaseId: string;
5993
6030
  }, options?: BaseMutationOptions): Promise<RawQueryResponse$1<SanityDocument$1[]>>;
5994
6031
  }
5995
- /** @public */
6032
+ /**
6033
+ * @public
6034
+ * @inline
6035
+ */
5996
6036
  declare class ObservableUsersClient {
5997
6037
  #private;
5998
6038
  constructor(client: ObservableSanityClient$1, httpRequest: HttpRequest);
@@ -6003,7 +6043,10 @@ declare class ObservableUsersClient {
6003
6043
  */
6004
6044
  getById<T extends string>(id: T): Observable<T extends 'me' ? CurrentSanityUser : SanityUser>;
6005
6045
  }
6006
- /** @public */
6046
+ /**
6047
+ * @public
6048
+ * @inline
6049
+ */
6007
6050
  declare class UsersClient {
6008
6051
  #private;
6009
6052
  constructor(client: SanityClient$1, httpRequest: HttpRequest);
@@ -6017,15 +6060,52 @@ declare class UsersClient {
6017
6060
  /** @public */
6018
6061
  declare class ObservableSanityClient$1 {
6019
6062
  #private;
6063
+ /**
6064
+ * Upload, fetch and delete assets (images and files) in the configured dataset
6065
+ *
6066
+ * @category Assets
6067
+ */
6020
6068
  assets: ObservableAssetsClient;
6069
+ /**
6070
+ * Create, list, edit and delete datasets in the configured project
6071
+ *
6072
+ * @category Projects & Datasets
6073
+ */
6021
6074
  datasets: ObservableDatasetsClient;
6075
+ /**
6076
+ * Subscribe to live content updates through the Live Content API
6077
+ *
6078
+ * @category Real-time
6079
+ */
6022
6080
  live: LiveClient;
6081
+ /**
6082
+ * Interact with Media Library assets
6083
+ *
6084
+ * @category Assets
6085
+ */
6023
6086
  mediaLibrary: {
6087
+ /** Upload and manage Media Library video assets */
6024
6088
  video: ObservableMediaLibraryVideoClient;
6025
6089
  };
6090
+ /**
6091
+ * Fetch information about the projects the authenticated user has access to
6092
+ *
6093
+ * @category Projects & Datasets
6094
+ */
6026
6095
  projects: ObservableProjectsClient;
6096
+ /**
6097
+ * Fetch information about users in the configured project
6098
+ *
6099
+ * @category Projects & Datasets
6100
+ */
6027
6101
  users: ObservableUsersClient;
6102
+ /**
6103
+ * Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
6104
+ *
6105
+ * @category Agent Actions
6106
+ */
6028
6107
  agent: {
6108
+ /** Run individual Agent Action operations */
6029
6109
  action: ObservableAgentsActionClient;
6030
6110
  };
6031
6111
  collaboration: {
@@ -6033,20 +6113,31 @@ declare class ObservableSanityClient$1 {
6033
6113
  comments: ObservableCollaborationCommentsClient;
6034
6114
  };
6035
6115
  functions: ObservableFunctionsClient;
6116
+ /**
6117
+ * Create and manage content releases and their scheduled publishing
6118
+ *
6119
+ * @category Releases
6120
+ */
6036
6121
  releases: ObservableReleasesClient;
6037
6122
  /** @beta */
6038
6123
  context: ObservableContextClient;
6039
6124
  /**
6040
- * Instance properties
6125
+ * Listen to document changes matching a GROQ query, delivered as server-sent events
6126
+ *
6127
+ * @category Real-time
6041
6128
  */
6042
6129
  listen: typeof _listen;
6043
6130
  constructor(httpRequest: HttpRequest, config?: ClientConfig$1);
6044
6131
  /**
6045
6132
  * Clone the client - returns a new instance
6133
+ *
6134
+ * @category Configuration
6046
6135
  */
6047
6136
  clone(): ObservableSanityClient$1;
6048
6137
  /**
6049
6138
  * Returns the current client configuration
6139
+ *
6140
+ * @category Configuration
6050
6141
  */
6051
6142
  config(): InitializedClientConfig$1;
6052
6143
  /**
@@ -6056,12 +6147,16 @@ declare class ObservableSanityClient$1 {
6056
6147
  /**
6057
6148
  * Clone the client with a new (partial) configuration.
6058
6149
  *
6150
+ * @category Configuration
6151
+ *
6059
6152
  * @param newConfig - New client configuration properties, shallowly merged with existing configuration
6060
6153
  */
6061
6154
  withConfig(newConfig?: Partial<ClientConfig$1>): ObservableSanityClient$1;
6062
6155
  /**
6063
6156
  * Perform a GROQ-query against the configured dataset.
6064
6157
  *
6158
+ * @category Querying
6159
+ *
6065
6160
  * @param query - GROQ-query to perform
6066
6161
  */
6067
6162
  fetch<R = Any$1, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Observable<ClientReturn$1<G, R>>;
@@ -6092,6 +6187,8 @@ declare class ObservableSanityClient$1 {
6092
6187
  /**
6093
6188
  * Fetch a single document with the given ID.
6094
6189
  *
6190
+ * @category Querying
6191
+ *
6095
6192
  * @param id - Document ID to fetch
6096
6193
  * @param options - Request options
6097
6194
  */
@@ -6119,6 +6216,8 @@ declare class ObservableSanityClient$1 {
6119
6216
  * The order/position of documents is preserved based on the original array of IDs.
6120
6217
  * If any of the documents are missing, they will be replaced by a `null` entry in the returned array
6121
6218
  *
6219
+ * @category Querying
6220
+ *
6122
6221
  * @param ids - Document IDs to fetch
6123
6222
  * @param options - Request options
6124
6223
  */
@@ -6129,6 +6228,8 @@ declare class ObservableSanityClient$1 {
6129
6228
  * Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
6130
6229
  * Returns a set of the IDs that exist.
6131
6230
  *
6231
+ * @category Querying
6232
+ *
6132
6233
  * @param ids - Document IDs to check
6133
6234
  * @param options - Request options
6134
6235
  */
@@ -6140,6 +6241,8 @@ declare class ObservableSanityClient$1 {
6140
6241
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
6141
6242
  * Returns an observable that resolves to the created document.
6142
6243
  *
6244
+ * @category Mutations
6245
+ *
6143
6246
  * @param document - Document to create
6144
6247
  * @param options - Mutation options
6145
6248
  */
@@ -6180,6 +6283,8 @@ declare class ObservableSanityClient$1 {
6180
6283
  * Create a document if no document with the same ID already exists.
6181
6284
  * Returns an observable that resolves to the created document.
6182
6285
  *
6286
+ * @category Mutations
6287
+ *
6183
6288
  * @param document - Document to create
6184
6289
  * @param options - Mutation options
6185
6290
  */
@@ -6220,6 +6325,8 @@ declare class ObservableSanityClient$1 {
6220
6325
  * Create a document if it does not exist, or replace a document with the same document ID
6221
6326
  * Returns an observable that resolves to the created document.
6222
6327
  *
6328
+ * @category Mutations
6329
+ *
6223
6330
  * @param document - Document to either create or replace
6224
6331
  * @param options - Mutation options
6225
6332
  */
@@ -6344,6 +6451,8 @@ declare class ObservableSanityClient$1 {
6344
6451
  * Deletes a document with the given document ID.
6345
6452
  * Returns an observable that resolves to the deleted document.
6346
6453
  *
6454
+ * @category Mutations
6455
+ *
6347
6456
  * @param id - Document ID to delete
6348
6457
  * @param options - Options for the mutation
6349
6458
  */
@@ -6429,6 +6538,8 @@ declare class ObservableSanityClient$1 {
6429
6538
  * * Discarding a version with no `releaseId` will discard the draft version of the published document.
6430
6539
  * * If the draft or release version does not exist, any error will throw.
6431
6540
  *
6541
+ * @category Versions
6542
+ *
6432
6543
  * @param params - Version action parameters:
6433
6544
  * - `releaseId` - The ID of the release to discard the document from.
6434
6545
  * - `publishedId` - The published ID of the document to discard.
@@ -6464,6 +6575,8 @@ declare class ObservableSanityClient$1 {
6464
6575
  * * Replacing a version with no `releaseId` will replace the draft version of the published document.
6465
6576
  * * At least one of the **version** or **published** documents must exist.
6466
6577
  *
6578
+ * @category Versions
6579
+ *
6467
6580
  * @param params - Version action parameters:
6468
6581
  * - `document` - The new document to replace the version with.
6469
6582
  * - `releaseId` - The ID of the release where the document version is replaced.
@@ -6536,6 +6649,8 @@ declare class ObservableSanityClient$1 {
6536
6649
  * @remarks
6537
6650
  * * If the published document does not exist, an error will be thrown.
6538
6651
  *
6652
+ * @category Versions
6653
+ *
6539
6654
  * @param params - Version action parameters:
6540
6655
  * - `releaseId` - The ID of the release to unpublish the document from.
6541
6656
  * - `publishedId` - The published ID of the document to unpublish.
@@ -6556,6 +6671,8 @@ declare class ObservableSanityClient$1 {
6556
6671
  * Perform mutation operations against the configured dataset
6557
6672
  * Returns an observable that resolves to the first mutated document.
6558
6673
  *
6674
+ * @category Mutations
6675
+ *
6559
6676
  * @param operations - Mutation operations to execute
6560
6677
  * @param options - Mutation options
6561
6678
  */
@@ -6595,6 +6712,8 @@ declare class ObservableSanityClient$1 {
6595
6712
  /**
6596
6713
  * Create a new buildable patch of operations to perform
6597
6714
  *
6715
+ * @category Mutations
6716
+ *
6598
6717
  * @param documentId - Document ID to patch
6599
6718
  * @param operations - Optional object of patch operations to initialize the patch instance with
6600
6719
  * @returns Patch instance - call `.commit()` to perform the operations defined
@@ -6619,12 +6738,16 @@ declare class ObservableSanityClient$1 {
6619
6738
  /**
6620
6739
  * Create a new transaction of mutations
6621
6740
  *
6741
+ * @category Mutations
6742
+ *
6622
6743
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
6623
6744
  */
6624
6745
  transaction<R extends Record<string, Any$1> = Record<string, Any$1>>(operations?: Mutation<R>[]): ObservableTransaction;
6625
6746
  /**
6626
6747
  * Perform action operations against the configured dataset
6627
6748
  *
6749
+ * @category Mutations
6750
+ *
6628
6751
  * @param operations - Action operation(s) to execute
6629
6752
  * @param options - Action options
6630
6753
  */
@@ -6632,12 +6755,16 @@ declare class ObservableSanityClient$1 {
6632
6755
  /**
6633
6756
  * Perform an HTTP request against the Sanity API
6634
6757
  *
6758
+ * @category HTTP
6759
+ *
6635
6760
  * @param options - Request options
6636
6761
  */
6637
6762
  request<R = Any$1>(options: RawRequestOptions): Observable<R>;
6638
6763
  /**
6639
6764
  * Get a Sanity API URL for the URI provided
6640
6765
  *
6766
+ * @category HTTP
6767
+ *
6641
6768
  * @param uri - URI/path to build URL for
6642
6769
  * @param canUseCdn - Whether or not to allow using the API CDN for this route
6643
6770
  */
@@ -6645,6 +6772,8 @@ declare class ObservableSanityClient$1 {
6645
6772
  /**
6646
6773
  * Get a Sanity API URL for the data operation and path provided
6647
6774
  *
6775
+ * @category HTTP
6776
+ *
6648
6777
  * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
6649
6778
  * @param path - Path to append after the operation
6650
6779
  */
@@ -6653,15 +6782,52 @@ declare class ObservableSanityClient$1 {
6653
6782
  /** @public */
6654
6783
  declare class SanityClient$1 {
6655
6784
  #private;
6785
+ /**
6786
+ * Upload, fetch and delete assets (images and files) in the configured dataset
6787
+ *
6788
+ * @category Assets
6789
+ */
6656
6790
  assets: AssetsClient;
6791
+ /**
6792
+ * Create, list, edit and delete datasets in the configured project
6793
+ *
6794
+ * @category Projects & Datasets
6795
+ */
6657
6796
  datasets: DatasetsClient;
6797
+ /**
6798
+ * Subscribe to live content updates through the Live Content API
6799
+ *
6800
+ * @category Real-time
6801
+ */
6658
6802
  live: LiveClient;
6803
+ /**
6804
+ * Interact with Media Library assets
6805
+ *
6806
+ * @category Assets
6807
+ */
6659
6808
  mediaLibrary: {
6809
+ /** Upload and manage Media Library video assets */
6660
6810
  video: MediaLibraryVideoClient;
6661
6811
  };
6812
+ /**
6813
+ * Fetch information about the projects the authenticated user has access to
6814
+ *
6815
+ * @category Projects & Datasets
6816
+ */
6662
6817
  projects: ProjectsClient;
6818
+ /**
6819
+ * Fetch information about users in the configured project
6820
+ *
6821
+ * @category Projects & Datasets
6822
+ */
6663
6823
  users: UsersClient;
6824
+ /**
6825
+ * Run Agent Actions - AI-powered operations to generate, transform, translate, prompt and patch documents
6826
+ *
6827
+ * @category Agent Actions
6828
+ */
6664
6829
  agent: {
6830
+ /** Run individual Agent Action operations */
6665
6831
  action: AgentActionsClient;
6666
6832
  };
6667
6833
  collaboration: {
@@ -6669,24 +6835,37 @@ declare class SanityClient$1 {
6669
6835
  comments: CollaborationCommentsClient;
6670
6836
  };
6671
6837
  functions: FunctionsClient;
6838
+ /**
6839
+ * Create and manage content releases and their scheduled publishing
6840
+ *
6841
+ * @category Releases
6842
+ */
6672
6843
  releases: ReleasesClient;
6673
6844
  /** @beta */
6674
6845
  context: ContextClient;
6675
6846
  /**
6676
6847
  * Observable version of the Sanity client, with the same configuration as the promise-based one
6848
+ *
6849
+ * @category Configuration
6677
6850
  */
6678
6851
  observable: ObservableSanityClient$1;
6679
6852
  /**
6680
- * Instance properties
6853
+ * Listen to document changes matching a GROQ query, delivered as server-sent events
6854
+ *
6855
+ * @category Real-time
6681
6856
  */
6682
6857
  listen: typeof _listen;
6683
6858
  constructor(httpRequest: HttpRequest, config?: ClientConfig$1);
6684
6859
  /**
6685
6860
  * Clone the client - returns a new instance
6861
+ *
6862
+ * @category Configuration
6686
6863
  */
6687
6864
  clone(): SanityClient$1;
6688
6865
  /**
6689
6866
  * Returns the current client configuration
6867
+ *
6868
+ * @category Configuration
6690
6869
  */
6691
6870
  config(): InitializedClientConfig$1;
6692
6871
  /**
@@ -6696,12 +6875,16 @@ declare class SanityClient$1 {
6696
6875
  /**
6697
6876
  * Clone the client with a new (partial) configuration.
6698
6877
  *
6878
+ * @category Configuration
6879
+ *
6699
6880
  * @param newConfig - New client configuration properties, shallowly merged with existing configuration
6700
6881
  */
6701
6882
  withConfig(newConfig?: Partial<ClientConfig$1>): SanityClient$1;
6702
6883
  /**
6703
6884
  * Perform a GROQ-query against the configured dataset.
6704
6885
  *
6886
+ * @category Querying
6887
+ *
6705
6888
  * @param query - GROQ-query to perform
6706
6889
  */
6707
6890
  fetch<R = Any$1, Q extends QueryWithoutParams = QueryWithoutParams, const G extends string = string>(query: G, params?: Q | QueryWithoutParams): Promise<ClientReturn$1<G, R>>;
@@ -6732,6 +6915,8 @@ declare class SanityClient$1 {
6732
6915
  /**
6733
6916
  * Fetch a single document with the given ID.
6734
6917
  *
6918
+ * @category Querying
6919
+ *
6735
6920
  * @param id - Document ID to fetch
6736
6921
  * @param options - Request options
6737
6922
  */
@@ -6759,6 +6944,8 @@ declare class SanityClient$1 {
6759
6944
  * The order/position of documents is preserved based on the original array of IDs.
6760
6945
  * If any of the documents are missing, they will be replaced by a `null` entry in the returned array
6761
6946
  *
6947
+ * @category Querying
6948
+ *
6762
6949
  * @param ids - Document IDs to fetch
6763
6950
  * @param options - Request options
6764
6951
  */
@@ -6770,6 +6957,8 @@ declare class SanityClient$1 {
6770
6957
  * Convenient and bandwidth efficient method of checking wether a set of document IDs exists.
6771
6958
  * Returns a set of the IDs that exist.
6772
6959
  *
6960
+ * @category Querying
6961
+ *
6773
6962
  * @param ids - Document IDs to check
6774
6963
  * @param options - Request options
6775
6964
  */
@@ -6781,6 +6970,8 @@ declare class SanityClient$1 {
6781
6970
  * Create a document. Requires a `_type` property. If no `_id` is provided, it will be generated by the database.
6782
6971
  * Returns a promise that resolves to the created document.
6783
6972
  *
6973
+ * @category Mutations
6974
+ *
6784
6975
  * @param document - Document to create
6785
6976
  * @param options - Mutation options
6786
6977
  */
@@ -6821,6 +7012,8 @@ declare class SanityClient$1 {
6821
7012
  * Create a document if no document with the same ID already exists.
6822
7013
  * Returns a promise that resolves to the created document.
6823
7014
  *
7015
+ * @category Mutations
7016
+ *
6824
7017
  * @param document - Document to create
6825
7018
  * @param options - Mutation options
6826
7019
  */
@@ -6861,6 +7054,8 @@ declare class SanityClient$1 {
6861
7054
  * Create a document if it does not exist, or replace a document with the same document ID
6862
7055
  * Returns a promise that resolves to the created document.
6863
7056
  *
7057
+ * @category Mutations
7058
+ *
6864
7059
  * @param document - Document to either create or replace
6865
7060
  * @param options - Mutation options
6866
7061
  */
@@ -6973,6 +7168,8 @@ declare class SanityClient$1 {
6973
7168
  * Deletes a document with the given document ID.
6974
7169
  * Returns a promise that resolves to the deleted document.
6975
7170
  *
7171
+ * @category Mutations
7172
+ *
6976
7173
  * @param id - Document ID to delete
6977
7174
  * @param options - Options for the mutation
6978
7175
  */
@@ -7058,6 +7255,8 @@ declare class SanityClient$1 {
7058
7255
  * * Discarding a version with no `releaseId` will discard the draft version of the published document.
7059
7256
  * * If the draft or release version does not exist, any error will throw.
7060
7257
  *
7258
+ * @category Versions
7259
+ *
7061
7260
  * @param params - Version action parameters:
7062
7261
  * - `releaseId` - The ID of the release to discard the document from.
7063
7262
  * - `publishedId` - The published ID of the document to discard.
@@ -7093,6 +7292,8 @@ declare class SanityClient$1 {
7093
7292
  * * Replacing a version with no `releaseId` will replace the draft version of the published document.
7094
7293
  * * At least one of the **version** or **published** documents must exist.
7095
7294
  *
7295
+ * @category Versions
7296
+ *
7096
7297
  * @param params - Version action parameters:
7097
7298
  * - `document` - The new document to replace the version with.
7098
7299
  * - `releaseId` - The ID of the release where the document version is replaced.
@@ -7165,6 +7366,8 @@ declare class SanityClient$1 {
7165
7366
  * @remarks
7166
7367
  * * If the published document does not exist, an error will be thrown.
7167
7368
  *
7369
+ * @category Versions
7370
+ *
7168
7371
  * @param params - Version action parameters:
7169
7372
  * - `releaseId` - The ID of the release to unpublish the document from.
7170
7373
  * - `publishedId` - The published ID of the document to unpublish.
@@ -7185,6 +7388,8 @@ declare class SanityClient$1 {
7185
7388
  * Perform mutation operations against the configured dataset
7186
7389
  * Returns a promise that resolves to the first mutated document.
7187
7390
  *
7391
+ * @category Mutations
7392
+ *
7188
7393
  * @param operations - Mutation operations to execute
7189
7394
  * @param options - Mutation options
7190
7395
  */
@@ -7224,6 +7429,8 @@ declare class SanityClient$1 {
7224
7429
  /**
7225
7430
  * Create a new buildable patch of operations to perform
7226
7431
  *
7432
+ * @category Mutations
7433
+ *
7227
7434
  * @param documentId - Document ID to patch
7228
7435
  * @param operations - Optional object of patch operations to initialize the patch instance with
7229
7436
  * @returns Patch instance - call `.commit()` to perform the operations defined
@@ -7248,6 +7455,8 @@ declare class SanityClient$1 {
7248
7455
  /**
7249
7456
  * Create a new transaction of mutations
7250
7457
  *
7458
+ * @category Mutations
7459
+ *
7251
7460
  * @param operations - Optional array of mutation operations to initialize the transaction instance with
7252
7461
  */
7253
7462
  transaction<R extends Record<string, Any$1> = Record<string, Any$1>>(operations?: Mutation<R>[]): Transaction;
@@ -7255,6 +7464,8 @@ declare class SanityClient$1 {
7255
7464
  * Perform action operations against the configured dataset
7256
7465
  * Returns a promise that resolves to the transaction result
7257
7466
  *
7467
+ * @category Mutations
7468
+ *
7258
7469
  * @param operations - Action operation(s) to execute
7259
7470
  * @param options - Action options
7260
7471
  */
@@ -7263,6 +7474,8 @@ declare class SanityClient$1 {
7263
7474
  * Perform a request against the Sanity API
7264
7475
  * NOTE: Only use this for Sanity API endpoints, not for your own APIs!
7265
7476
  *
7477
+ * @category HTTP
7478
+ *
7266
7479
  * @param options - Request options
7267
7480
  * @returns Promise resolving to the response body
7268
7481
  */
@@ -7281,6 +7494,8 @@ declare class SanityClient$1 {
7281
7494
  /**
7282
7495
  * Get a Sanity API URL for the URI provided
7283
7496
  *
7497
+ * @category HTTP
7498
+ *
7284
7499
  * @param uri - URI/path to build URL for
7285
7500
  * @param canUseCdn - Whether or not to allow using the API CDN for this route
7286
7501
  */
@@ -7288,6 +7503,8 @@ declare class SanityClient$1 {
7288
7503
  /**
7289
7504
  * Get a Sanity API URL for the data operation and path provided
7290
7505
  *
7506
+ * @category HTTP
7507
+ *
7291
7508
  * @param operation - Data operation (eg `query`, `mutate`, `listen` or similar)
7292
7509
  * @param path - Path to append after the operation
7293
7510
  */
@@ -8086,7 +8303,7 @@ type DatasetAclMode = 'public' | 'private' | 'custom';
8086
8303
  /** @public */
8087
8304
  type DatasetCreateOptions = {
8088
8305
  aclMode?: DatasetAclMode;
8089
- description?: string;
8306
+ description?: string | null;
8090
8307
  embeddings?: {
8091
8308
  enabled: boolean;
8092
8309
  projection?: string;
@@ -8095,7 +8312,7 @@ type DatasetCreateOptions = {
8095
8312
  /** @public */
8096
8313
  type DatasetEditOptions = {
8097
8314
  aclMode?: DatasetAclMode;
8098
- description?: string;
8315
+ description?: string | null;
8099
8316
  };
8100
8317
  /** @public */
8101
8318
  type EmbeddingsSettings = {
@@ -8112,13 +8329,13 @@ type EmbeddingsSettingsBody = {
8112
8329
  type DatasetResponse = {
8113
8330
  datasetName: string;
8114
8331
  aclMode: DatasetAclMode;
8115
- description: string;
8332
+ description: string | null;
8116
8333
  };
8117
8334
  /** @public */
8118
8335
  type DatasetsResponse = {
8119
8336
  name: string;
8120
8337
  aclMode: DatasetAclMode;
8121
- description: string;
8338
+ description?: string;
8122
8339
  createdAt: string;
8123
8340
  createdByUserId: string;
8124
8341
  addonFor: string | null;
@@ -9494,8 +9711,46 @@ interface LiveEventGoAway {
9494
9711
  }
9495
9712
  /** @public */
9496
9713
  type LiveEvent = LiveEventRestart | LiveEventReconnect | LiveEventMessage | LiveEventWelcome | LiveEventGoAway;
9497
- /** @public */
9498
- interface SanityQueries {}
9714
+ declare global {
9715
+ /**
9716
+ * Query result types, keyed by GROQ query string. Empty by default, `sanity typegen` registers
9717
+ * the queries it finds:
9718
+ * ```ts
9719
+ * declare global {
9720
+ * interface SanityQueries {
9721
+ * '*[_type == "post"]': PostsQueryResult
9722
+ * }
9723
+ * }
9724
+ * ```
9725
+ * `client.fetch(query)` and `ClientReturn<typeof query>` then resolve to the registered type.
9726
+ *
9727
+ * The registry is a global rather than a module augmentation of `@sanity/client` so that it
9728
+ * does not depend on module resolution: it resolves the same whether `@sanity/client` is a
9729
+ * direct dependency, how many copies of it are installed, and from every subpath export.
9730
+ */
9731
+ interface SanityQueries {}
9732
+ }
9733
+ /**
9734
+ * The query registry as seen from `@sanity/client`. Inherits every query registered on the global
9735
+ * `SanityQueries` interface, and still accepts the older module augmentation form:
9736
+ * ```ts
9737
+ * declare module '@sanity/client' {
9738
+ * interface SanityQueries {
9739
+ * '*[_type == "post"]': PostsQueryResult
9740
+ * }
9741
+ * }
9742
+ * ```
9743
+ * `@sanity/client` releases that predate the global registry only read this interface, so a
9744
+ * generated file that registers queries globally can bridge them with an augmentation that adds
9745
+ * the global as a base type. It is harmless on releases that already inherit it:
9746
+ * ```ts
9747
+ * declare module '@sanity/client' {
9748
+ * interface SanityQueries extends globalThis.SanityQueries {}
9749
+ * }
9750
+ * ```
9751
+ * @public
9752
+ */
9753
+ interface SanityQueries extends globalThis.SanityQueries {}
9499
9754
  /** @public */
9500
9755
  type ClientReturn$1<GroqString extends string, Fallback = Any$1> = GroqString extends keyof SanityQueries ? SanityQueries[GroqString] : Fallback;
9501
9756
  /**
@@ -9714,4 +9969,4 @@ interface MediaLibraryAssetDocument {
9714
9969
  rootDirectory?: Any$1;
9715
9970
  }
9716
9971
  export { DisconnectEvent as $, UploadClientConfig as $n, CollaborationCommentFieldValue as $r, QueryWithoutParams as $t, ContentSourceMapMappings as A, AgentActionPathSegment as Ai, SanityReference as An, ObservableProjectsClient as Ar, MediaLibraryAssetVersion as At, CreateVersionAction as B, TransactionAllDocumentIdsMutationOptions as Bn, ObservablePatchBuilder as Br, MutationSelection as Bt, ContentSourceMap$1 as C, PromptRequest as Ci, SanityDocument$1 as Cn, GenerateTarget as Cr, LiveEventGoAway as Ct, ContentSourceMapDocuments$1 as D, AgentActionParam as Di, SanityProject as Dn, SanityClient$1 as Dr, LiveEventWelcome as Dt, ContentSourceMapDocumentValueSource as E, PatchTarget as Ei, SanityImagePalette as En, ObservableSanityClient$1 as Er, LiveEventRestart as Et, ContentSourceMapValueMapping as F, GroqAgentActionParam as Fi, StackablePerspective as Fn, InvokeFunctionOptions as Fr, Mutation as Ft, DatasetResponse as G, UnarchiveReleaseAction as Gn, ObservablePatch as Gr, PatchOperations as Gt, DatasetAclMode as H, TransactionFirstDocumentIdMutationOptions as Hn, PatchBuilder as Hr, OpenEvent as Ht, CreateAction as I, StillImageFormat as In, InvokeFunctionRequest as Ir, MutationError as It, DeleteReleaseAction as J, UnpublishAction as Jn, types_d_exports as Jr, PublishReleaseAction as Jt, DatasetsResponse as K, UnfilteredResponseQueryOptions as Kn, Patch as Kr, PatchSelection as Kt, CreateReleaseAction as L, StoryboardTransformOptions as Ln, DatasetsClient as Lr, MutationErrorItem as Lt, ContentSourceMapRemoteDocument as M, ConstantAgentActionParam as Mi, ScheduleReleaseAction as Mn, MediaLibraryVideoClient as Mr, MediaLibraryVideoPlaybackTransformations as Mt, ContentSourceMapSource as N, DocumentAgentActionParam as Ni, SingleActionResult as Nn, ObservableMediaLibraryVideoClient as Nr, MultipleActionResult as Nt, ContentSourceMapLiteralSource as O, AgentActionParams as Oi, SanityProjectMember as On, ObservableUsersClient as Or, MediaLibraryAssetDocument as Ot, ContentSourceMapUnknownSource as P, FieldAgentActionParam as Pi, SingleMutationResult as Pn, InvokeFunctionEvent as Pr, MultipleMutationResult as Pt, DiscardVersionAction as Q, UploadBody as Qn, CollaborationCommentDocument as Qr, QueryParseError as Qt, CreateVariantAction as R, SyncTag as Rn, ObservableDatasetsClient as Rr, MutationEvent as Rt, ClientVariantConditions as S, TransformTargetInclude as Si, SanityAssetDocument as Sn, GenerateOperation as Sr, LiveEvent as St, ContentSourceMapDocumentBase as T, PatchOperation as Ti, SanityImageAssetDocument as Tn, GenerateTargetInclude as Tr, LiveEventReconnect as Tt, DatasetCreateOptions as U, TransactionFirstDocumentMutationOptions as Un, Transaction as Ur, PartialExcept as Ut, CurrentSanityUser as V, TransactionAllDocumentsMutationOptions as Vn, ObservableTransaction as Vr, MutationSelectionQueryParams as Vt, DatasetEditOptions as W, TransactionMutationOptions as Wn, BasePatch as Wr, PatchMutationOperation as Wt, DeleteVariantDefinitionAction as X, UnpublishVersionAction as Xn, ObservableCollaborationCommentsClient as Xr, QueryOptions as Xt, DeleteVariantAction as Y, UnpublishVariantAction as Yn, CollaborationCommentsClient as Yr, PublishVariantAction as Yt, DiscardAction as Z, UnscheduleReleaseAction as Zn, CollaborationCommentCreate as Zr, QueryParams as Zt, ChannelErrorEvent as _, ImageDescriptionOperation as _i, Requester as _n, VideoSubtitleInfoPublic as _r, InsertPatch as _t, AllDocumentsMutationOptions as a, CollaborationCommentStatus as ai, ReleaseCardinality as an, VersionAction as ar, EditableReleaseDocument as at, ClientReturn$1 as b, TransformTarget as bi, ResumableListenEventNames as bn, WelcomeEvent as br, ListenOptions as bt, Any$1 as c, CollaborationCommentsListenOptions as ci, ReleaseState as cn, VideoPlaybackInfoItemPublic as cr, ErrorProps as ct, AssetMetadataType as d, _listen as di, ReplaceVersionAction as dn, VideoPlaybackInfoSigned as dr, FirstDocumentMutationOptions as dt, CollaborationCommentMessage as ei, RawQueryResponse$1 as en, UploadEvent as er, EXPERIMENTAL_API_WARNING as et, AttributeSet as f, AssetsClient as fi, RequestHandler as fn, VideoPlaybackTokens as fr, FitMode as ft, BaseMutationOptions as g, TranslateTargetInclude as gi, RequestUrlOptions as gn, VideoSubtitleInfo as gr, InitializedClientConfig$1 as gt, BaseActionOptions as h, TranslateTarget as hi, RequestOptions$1 as hn, VideoRenditionInfoSigned as hr, ImportReleaseAction as ht, AllDocumentIdsMutationOptions as i, CollaborationCommentSelection as ii, ReleaseAction as in, VariantDefinitionAction as ir, EditVariantDefinitionAction as it, ContentSourceMapPaths as j, AgentActionTarget as ji, SanityUser as jn, ProjectsClient as jr, MediaLibraryPlaybackInfoOptions as jt, ContentSourceMapMapping as k, AgentActionPath as ki, SanityQueries as kn, UsersClient as kr, MediaLibraryAssetInstanceIdentifier as kt, ApiError as l, CollaborationCommentsRequestOptions as li, ReleaseType as ln, VideoPlaybackInfoItemSigned as lr, FilteredResponseQueryOptions as lt, AuthProviderResponse as m, TranslateDocument as mi, RequestObservableOptions as mn, VideoRenditionInfoPublic as mr, IdentifiedSanityDocumentStub as mt, ActionError as n, CollaborationCommentRange as ni, RawRequestOptions as nn, UploadResponseEvent as nr, EditReleaseAction as nt, AnimatedImageFormat as o, CollaborationCommentTarget as oi, ReleaseDocument as on, VideoPlaybackInfo as or, EmbeddingsSettings as ot, AuthProvider as p, ObservableAssetsClient as pi, RequestHandlerOptions as pn, VideoRenditionInfo as pr, HttpRequest as pt, DeleteAction as q, UnfilteredResponseWithoutQuery as qn, LiveClient as qr, PublishAction as qt, ActionErrorItem as r, CollaborationCommentReactionShortName as ri, ReconnectEvent as rn, VariantAction as rr, EditVariantAction as rt, AnimatedTransformOptions as s, CollaborationCommentUpdate as si, ReleaseId as sn, VideoPlaybackInfoItem as sr, EmbeddingsSettingsBody as st, Action as t, CollaborationCommentPortableTextBlock as ti, RawQuerylessQueryResponse as tn, UploadProgressEvent as tr, EditAction as tt, ArchiveReleaseAction as u, CollaborationCommentsWriteOptions as ui, ReplaceDraftAction as un, VideoPlaybackInfoPublic as ur, FirstDocumentIdMutationOptions as ut, ClientConfig$1 as v, TransformDocument as vi, ResetEvent as vn, VideoSubtitleInfoSigned as vr, ListenEvent as vt, ContentSourceMapDocument as w, PatchDocument as wi, SanityDocumentStub as wn, GenerateTargetDocument as wr, LiveEventMessage as wt, ClientVariant as x, TransformTargetDocument as xi, ResumableListenOptions as xn, GenerateInstruction as xr, ListenParams as xt, ClientPerspective$1 as y, TransformOperation as yi, ResponseQueryOptions as yn, WelcomeBackEvent as yr, ListenEventName as yt, CreateVariantDefinitionAction as z, ThumbnailTransformOptions as zn, BaseTransaction as zr, MutationOperation as zt };
9717
- //# sourceMappingURL=types-DiPF0ENT.d.ts.map
9972
+ //# sourceMappingURL=types-CtHEe8SF.d.ts.map