@sanity/client 7.5.0 → 7.6.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.
@@ -1871,7 +1871,7 @@ export declare type IdentifiedSanityDocumentStub<
1871
1871
  * @see #TransformOperation
1872
1872
  * @beta
1873
1873
  */
1874
- export declare interface ImageDescriptionOperation {
1874
+ export declare type ImageDescriptionOperation = {
1875
1875
  type: 'image-description'
1876
1876
  /**
1877
1877
  * When omitted, parent image value will be inferred from the arget path.
@@ -1882,7 +1882,32 @@ export declare interface ImageDescriptionOperation {
1882
1882
  * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1883
1883
  */
1884
1884
  sourcePath?: AgentActionPath
1885
- }
1885
+ } & (
1886
+ | {
1887
+ /**
1888
+ * When omitted, parent image value will be inferred from the target path.
1889
+ *
1890
+ * When specified, the `sourcePath` should be a path to an image (or image asset) field:
1891
+ * - `['image']`
1892
+ * - `['wrapper', 'mainImage']`
1893
+ * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1894
+ *
1895
+ * Incompatible with `imageUrl`
1896
+ *
1897
+ */
1898
+ sourcePath?: AgentActionPath
1899
+ imageUrl?: never
1900
+ }
1901
+ | {
1902
+ /**
1903
+ * When specified, the image source to be described will be fetched from the URL.
1904
+ *
1905
+ * Incompatible with `sourcePath`
1906
+ */
1907
+ imageUrl?: `https://${string}`
1908
+ sourcePath?: never
1909
+ }
1910
+ )
1886
1911
 
1887
1912
  /** @public */
1888
1913
  export declare interface InitializedClientConfig extends ClientConfig {
@@ -5811,6 +5836,11 @@ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string
5811
5836
  * - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
5812
5837
  * - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
5813
5838
  *
5839
+ * ### Targeting images outside the document (URL)
5840
+ * If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
5841
+ *
5842
+ * Example:
5843
+ * - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
5814
5844
  * @beta
5815
5845
  */
5816
5846
  export declare type TransformOperation = 'set' | ImageDescriptionOperation
@@ -1871,7 +1871,7 @@ export declare type IdentifiedSanityDocumentStub<
1871
1871
  * @see #TransformOperation
1872
1872
  * @beta
1873
1873
  */
1874
- export declare interface ImageDescriptionOperation {
1874
+ export declare type ImageDescriptionOperation = {
1875
1875
  type: 'image-description'
1876
1876
  /**
1877
1877
  * When omitted, parent image value will be inferred from the arget path.
@@ -1882,7 +1882,32 @@ export declare interface ImageDescriptionOperation {
1882
1882
  * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1883
1883
  */
1884
1884
  sourcePath?: AgentActionPath
1885
- }
1885
+ } & (
1886
+ | {
1887
+ /**
1888
+ * When omitted, parent image value will be inferred from the target path.
1889
+ *
1890
+ * When specified, the `sourcePath` should be a path to an image (or image asset) field:
1891
+ * - `['image']`
1892
+ * - `['wrapper', 'mainImage']`
1893
+ * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1894
+ *
1895
+ * Incompatible with `imageUrl`
1896
+ *
1897
+ */
1898
+ sourcePath?: AgentActionPath
1899
+ imageUrl?: never
1900
+ }
1901
+ | {
1902
+ /**
1903
+ * When specified, the image source to be described will be fetched from the URL.
1904
+ *
1905
+ * Incompatible with `sourcePath`
1906
+ */
1907
+ imageUrl?: `https://${string}`
1908
+ sourcePath?: never
1909
+ }
1910
+ )
1886
1911
 
1887
1912
  /** @public */
1888
1913
  export declare interface InitializedClientConfig extends ClientConfig {
@@ -5811,6 +5836,11 @@ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string
5811
5836
  * - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
5812
5837
  * - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
5813
5838
  *
5839
+ * ### Targeting images outside the document (URL)
5840
+ * If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
5841
+ *
5842
+ * Example:
5843
+ * - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
5814
5844
  * @beta
5815
5845
  */
5816
5846
  export declare type TransformOperation = 'set' | ImageDescriptionOperation
package/dist/stega.d.cts CHANGED
@@ -1871,7 +1871,7 @@ export declare type IdentifiedSanityDocumentStub<
1871
1871
  * @see #TransformOperation
1872
1872
  * @beta
1873
1873
  */
1874
- export declare interface ImageDescriptionOperation {
1874
+ export declare type ImageDescriptionOperation = {
1875
1875
  type: 'image-description'
1876
1876
  /**
1877
1877
  * When omitted, parent image value will be inferred from the arget path.
@@ -1882,7 +1882,32 @@ export declare interface ImageDescriptionOperation {
1882
1882
  * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1883
1883
  */
1884
1884
  sourcePath?: AgentActionPath
1885
- }
1885
+ } & (
1886
+ | {
1887
+ /**
1888
+ * When omitted, parent image value will be inferred from the target path.
1889
+ *
1890
+ * When specified, the `sourcePath` should be a path to an image (or image asset) field:
1891
+ * - `['image']`
1892
+ * - `['wrapper', 'mainImage']`
1893
+ * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1894
+ *
1895
+ * Incompatible with `imageUrl`
1896
+ *
1897
+ */
1898
+ sourcePath?: AgentActionPath
1899
+ imageUrl?: never
1900
+ }
1901
+ | {
1902
+ /**
1903
+ * When specified, the image source to be described will be fetched from the URL.
1904
+ *
1905
+ * Incompatible with `sourcePath`
1906
+ */
1907
+ imageUrl?: `https://${string}`
1908
+ sourcePath?: never
1909
+ }
1910
+ )
1886
1911
 
1887
1912
  /** @public */
1888
1913
  export declare interface InitializedClientConfig extends ClientConfig {
@@ -5811,6 +5836,11 @@ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string
5811
5836
  * - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
5812
5837
  * - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
5813
5838
  *
5839
+ * ### Targeting images outside the document (URL)
5840
+ * If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
5841
+ *
5842
+ * Example:
5843
+ * - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
5814
5844
  * @beta
5815
5845
  */
5816
5846
  export declare type TransformOperation = 'set' | ImageDescriptionOperation
package/dist/stega.d.ts CHANGED
@@ -1871,7 +1871,7 @@ export declare type IdentifiedSanityDocumentStub<
1871
1871
  * @see #TransformOperation
1872
1872
  * @beta
1873
1873
  */
1874
- export declare interface ImageDescriptionOperation {
1874
+ export declare type ImageDescriptionOperation = {
1875
1875
  type: 'image-description'
1876
1876
  /**
1877
1877
  * When omitted, parent image value will be inferred from the arget path.
@@ -1882,7 +1882,32 @@ export declare interface ImageDescriptionOperation {
1882
1882
  * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1883
1883
  */
1884
1884
  sourcePath?: AgentActionPath
1885
- }
1885
+ } & (
1886
+ | {
1887
+ /**
1888
+ * When omitted, parent image value will be inferred from the target path.
1889
+ *
1890
+ * When specified, the `sourcePath` should be a path to an image (or image asset) field:
1891
+ * - `['image']`
1892
+ * - `['wrapper', 'mainImage']`
1893
+ * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
1894
+ *
1895
+ * Incompatible with `imageUrl`
1896
+ *
1897
+ */
1898
+ sourcePath?: AgentActionPath
1899
+ imageUrl?: never
1900
+ }
1901
+ | {
1902
+ /**
1903
+ * When specified, the image source to be described will be fetched from the URL.
1904
+ *
1905
+ * Incompatible with `sourcePath`
1906
+ */
1907
+ imageUrl?: `https://${string}`
1908
+ sourcePath?: never
1909
+ }
1910
+ )
1886
1911
 
1887
1912
  /** @public */
1888
1913
  export declare interface InitializedClientConfig extends ClientConfig {
@@ -5811,6 +5836,11 @@ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string
5811
5836
  * - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
5812
5837
  * - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
5813
5838
  *
5839
+ * ### Targeting images outside the document (URL)
5840
+ * If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
5841
+ *
5842
+ * Example:
5843
+ * - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
5814
5844
  * @beta
5815
5845
  */
5816
5846
  export declare type TransformOperation = 'set' | ImageDescriptionOperation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",
@@ -180,7 +180,7 @@ export type TransformTargetDocument =
180
180
  * @see #TransformOperation
181
181
  * @beta
182
182
  */
183
- export interface ImageDescriptionOperation {
183
+ export type ImageDescriptionOperation = {
184
184
  type: 'image-description'
185
185
  /**
186
186
  * When omitted, parent image value will be inferred from the arget path.
@@ -191,7 +191,32 @@ export interface ImageDescriptionOperation {
191
191
  * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
192
192
  */
193
193
  sourcePath?: AgentActionPath
194
- }
194
+ } & (
195
+ | {
196
+ /**
197
+ * When omitted, parent image value will be inferred from the target path.
198
+ *
199
+ * When specified, the `sourcePath` should be a path to an image (or image asset) field:
200
+ * - `['image']`
201
+ * - `['wrapper', 'mainImage']`
202
+ * - `['heroImage', 'asset'] // the asset segment is optional, but supported`
203
+ *
204
+ * Incompatible with `imageUrl`
205
+ *
206
+ */
207
+ sourcePath?: AgentActionPath
208
+ imageUrl?: never
209
+ }
210
+ | {
211
+ /**
212
+ * When specified, the image source to be described will be fetched from the URL.
213
+ *
214
+ * Incompatible with `sourcePath`
215
+ */
216
+ imageUrl?: `https://${string}`
217
+ sourcePath?: never
218
+ }
219
+ )
195
220
 
196
221
  /**
197
222
  *
@@ -222,6 +247,11 @@ export interface ImageDescriptionOperation {
222
247
  * - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
223
248
  * - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
224
249
  *
250
+ * ### Targeting images outside the document (URL)
251
+ * If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
252
+ *
253
+ * Example:
254
+ * - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
225
255
  * @beta
226
256
  */
227
257
  export type TransformOperation = 'set' | ImageDescriptionOperation