@sanity/client 6.29.0-generate.2 → 6.29.0-generate.3

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.
@@ -65,24 +65,45 @@ export declare type AgentActionPathSegment =
65
65
  declare class AgentActionsClient {
66
66
  #private
67
67
  constructor(client: SanityClient, httpRequest: HttpRequest)
68
- generate(request: GenerateAsyncInstruction): Promise<{
69
- _id: string
70
- }>
68
+ /**
69
+ * Run an instruction to generate content in a target document.
70
+ * @param request instruction request
71
+ */
71
72
  generate<DocumentShape extends Record<string, Any>>(
72
- request: GenerateSyncInstruction<DocumentShape>,
73
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
74
- transform(request: TransformDocumentAsync): Promise<{
75
- _id: string
76
- }>
73
+ request: GenerateInstruction<DocumentShape>,
74
+ ): Promise<
75
+ (typeof request)['async'] extends true
76
+ ? {
77
+ _id: string
78
+ }
79
+ : IdentifiedSanityDocumentStub & DocumentShape
80
+ >
81
+ /**
82
+ * Transform a target document based on a source.
83
+ * @param request translation request
84
+ */
77
85
  transform<DocumentShape extends Record<string, Any>>(
78
- request: TransformDocumentSync,
79
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
80
- translate(request: TranslateDocumentAsync): Promise<{
81
- _id: string
82
- }>
86
+ request: TransformDocument<DocumentShape>,
87
+ ): Promise<
88
+ (typeof request)['async'] extends true
89
+ ? {
90
+ _id: string
91
+ }
92
+ : IdentifiedSanityDocumentStub & DocumentShape
93
+ >
94
+ /**
95
+ * Translate a target document based on a source.
96
+ * @param request translation request
97
+ */
83
98
  translate<DocumentShape extends Record<string, Any>>(
84
- request: TranslateDocumentSync,
85
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
99
+ request: TranslateDocument<DocumentShape>,
100
+ ): Promise<
101
+ (typeof request)['async'] extends true
102
+ ? {
103
+ _id: string
104
+ }
105
+ : IdentifiedSanityDocumentStub & DocumentShape
106
+ >
86
107
  }
87
108
 
88
109
  /**
@@ -1762,24 +1783,45 @@ export declare type MutationSelectionQueryParams = {
1762
1783
  declare class ObservableAgentsActionClient {
1763
1784
  #private
1764
1785
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
1765
- generate(request: GenerateAsyncInstruction): Observable<{
1766
- _id: string
1767
- }>
1786
+ /**
1787
+ * Run an instruction to generate content in a target document.
1788
+ * @param request instruction request
1789
+ */
1768
1790
  generate<DocumentShape extends Record<string, Any>>(
1769
- request: GenerateSyncInstruction<DocumentShape>,
1770
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1771
- transform(request: TransformDocumentAsync): Observable<{
1772
- _id: string
1773
- }>
1791
+ request: GenerateInstruction<DocumentShape>,
1792
+ ): Observable<
1793
+ (typeof request)['async'] extends true
1794
+ ? {
1795
+ _id: string
1796
+ }
1797
+ : IdentifiedSanityDocumentStub & DocumentShape
1798
+ >
1799
+ /**
1800
+ * Transform a target document based on a source.
1801
+ * @param request translation request
1802
+ */
1774
1803
  transform<DocumentShape extends Record<string, Any>>(
1775
- request: TransformDocumentSync,
1776
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1777
- translate(request: TranslateDocumentAsync): Observable<{
1778
- _id: string
1779
- }>
1804
+ request: TransformDocument<DocumentShape>,
1805
+ ): Observable<
1806
+ (typeof request)['async'] extends true
1807
+ ? {
1808
+ _id: string
1809
+ }
1810
+ : IdentifiedSanityDocumentStub & DocumentShape
1811
+ >
1812
+ /**
1813
+ * Translate a target document based on a source.
1814
+ * @param request translation request
1815
+ */
1780
1816
  translate<DocumentShape extends Record<string, Any>>(
1781
- request: TranslateDocumentSync,
1782
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1817
+ request: TranslateDocument<DocumentShape>,
1818
+ ): Observable<
1819
+ (typeof request)['async'] extends true
1820
+ ? {
1821
+ _id: string
1822
+ }
1823
+ : IdentifiedSanityDocumentStub & DocumentShape
1824
+ >
1783
1825
  }
1784
1826
 
1785
1827
  /** @internal */
@@ -3780,13 +3822,16 @@ export declare type TransactionMutationOptions =
3780
3822
  | TransactionAllDocumentIdsMutationOptions
3781
3823
 
3782
3824
  /** @beta */
3783
- export declare type TransformDocument = TransformDocumentSync | TransformDocumentAsync
3825
+ export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
3826
+ | TransformDocumentSync<T>
3827
+ | TransformDocumentAsync
3784
3828
 
3785
3829
  /** @beta */
3786
3830
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
3787
3831
 
3788
3832
  /** @beta */
3789
- declare type TransformDocumentSync = TransformRequestBase & AgentActionSync
3833
+ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3834
+ TransformRequestBase & AgentActionSync
3790
3835
 
3791
3836
  /** @beta */
3792
3837
  declare interface TransformRequestBase extends AgentActionRequestBase {
@@ -3862,13 +3907,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
3862
3907
  }
3863
3908
 
3864
3909
  /** @beta */
3865
- export declare type TranslateDocument = TranslateDocumentSync | TranslateDocumentAsync
3910
+ export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
3911
+ | TranslateDocumentSync<T>
3912
+ | TranslateDocumentAsync
3866
3913
 
3867
3914
  /** @beta */
3868
3915
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
3869
3916
 
3870
3917
  /** @beta */
3871
- declare type TranslateDocumentSync = TranslateRequestBase & AgentActionSync
3918
+ declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3919
+ TranslateRequestBase & AgentActionSync
3872
3920
 
3873
3921
  /** @beta */
3874
3922
  declare interface TranslateLanguage {
@@ -65,24 +65,45 @@ export declare type AgentActionPathSegment =
65
65
  declare class AgentActionsClient {
66
66
  #private
67
67
  constructor(client: SanityClient, httpRequest: HttpRequest)
68
- generate(request: GenerateAsyncInstruction): Promise<{
69
- _id: string
70
- }>
68
+ /**
69
+ * Run an instruction to generate content in a target document.
70
+ * @param request instruction request
71
+ */
71
72
  generate<DocumentShape extends Record<string, Any>>(
72
- request: GenerateSyncInstruction<DocumentShape>,
73
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
74
- transform(request: TransformDocumentAsync): Promise<{
75
- _id: string
76
- }>
73
+ request: GenerateInstruction<DocumentShape>,
74
+ ): Promise<
75
+ (typeof request)['async'] extends true
76
+ ? {
77
+ _id: string
78
+ }
79
+ : IdentifiedSanityDocumentStub & DocumentShape
80
+ >
81
+ /**
82
+ * Transform a target document based on a source.
83
+ * @param request translation request
84
+ */
77
85
  transform<DocumentShape extends Record<string, Any>>(
78
- request: TransformDocumentSync,
79
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
80
- translate(request: TranslateDocumentAsync): Promise<{
81
- _id: string
82
- }>
86
+ request: TransformDocument<DocumentShape>,
87
+ ): Promise<
88
+ (typeof request)['async'] extends true
89
+ ? {
90
+ _id: string
91
+ }
92
+ : IdentifiedSanityDocumentStub & DocumentShape
93
+ >
94
+ /**
95
+ * Translate a target document based on a source.
96
+ * @param request translation request
97
+ */
83
98
  translate<DocumentShape extends Record<string, Any>>(
84
- request: TranslateDocumentSync,
85
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
99
+ request: TranslateDocument<DocumentShape>,
100
+ ): Promise<
101
+ (typeof request)['async'] extends true
102
+ ? {
103
+ _id: string
104
+ }
105
+ : IdentifiedSanityDocumentStub & DocumentShape
106
+ >
86
107
  }
87
108
 
88
109
  /**
@@ -1762,24 +1783,45 @@ export declare type MutationSelectionQueryParams = {
1762
1783
  declare class ObservableAgentsActionClient {
1763
1784
  #private
1764
1785
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
1765
- generate(request: GenerateAsyncInstruction): Observable<{
1766
- _id: string
1767
- }>
1786
+ /**
1787
+ * Run an instruction to generate content in a target document.
1788
+ * @param request instruction request
1789
+ */
1768
1790
  generate<DocumentShape extends Record<string, Any>>(
1769
- request: GenerateSyncInstruction<DocumentShape>,
1770
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1771
- transform(request: TransformDocumentAsync): Observable<{
1772
- _id: string
1773
- }>
1791
+ request: GenerateInstruction<DocumentShape>,
1792
+ ): Observable<
1793
+ (typeof request)['async'] extends true
1794
+ ? {
1795
+ _id: string
1796
+ }
1797
+ : IdentifiedSanityDocumentStub & DocumentShape
1798
+ >
1799
+ /**
1800
+ * Transform a target document based on a source.
1801
+ * @param request translation request
1802
+ */
1774
1803
  transform<DocumentShape extends Record<string, Any>>(
1775
- request: TransformDocumentSync,
1776
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1777
- translate(request: TranslateDocumentAsync): Observable<{
1778
- _id: string
1779
- }>
1804
+ request: TransformDocument<DocumentShape>,
1805
+ ): Observable<
1806
+ (typeof request)['async'] extends true
1807
+ ? {
1808
+ _id: string
1809
+ }
1810
+ : IdentifiedSanityDocumentStub & DocumentShape
1811
+ >
1812
+ /**
1813
+ * Translate a target document based on a source.
1814
+ * @param request translation request
1815
+ */
1780
1816
  translate<DocumentShape extends Record<string, Any>>(
1781
- request: TranslateDocumentSync,
1782
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1817
+ request: TranslateDocument<DocumentShape>,
1818
+ ): Observable<
1819
+ (typeof request)['async'] extends true
1820
+ ? {
1821
+ _id: string
1822
+ }
1823
+ : IdentifiedSanityDocumentStub & DocumentShape
1824
+ >
1783
1825
  }
1784
1826
 
1785
1827
  /** @internal */
@@ -3780,13 +3822,16 @@ export declare type TransactionMutationOptions =
3780
3822
  | TransactionAllDocumentIdsMutationOptions
3781
3823
 
3782
3824
  /** @beta */
3783
- export declare type TransformDocument = TransformDocumentSync | TransformDocumentAsync
3825
+ export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
3826
+ | TransformDocumentSync<T>
3827
+ | TransformDocumentAsync
3784
3828
 
3785
3829
  /** @beta */
3786
3830
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
3787
3831
 
3788
3832
  /** @beta */
3789
- declare type TransformDocumentSync = TransformRequestBase & AgentActionSync
3833
+ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3834
+ TransformRequestBase & AgentActionSync
3790
3835
 
3791
3836
  /** @beta */
3792
3837
  declare interface TransformRequestBase extends AgentActionRequestBase {
@@ -3862,13 +3907,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
3862
3907
  }
3863
3908
 
3864
3909
  /** @beta */
3865
- export declare type TranslateDocument = TranslateDocumentSync | TranslateDocumentAsync
3910
+ export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
3911
+ | TranslateDocumentSync<T>
3912
+ | TranslateDocumentAsync
3866
3913
 
3867
3914
  /** @beta */
3868
3915
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
3869
3916
 
3870
3917
  /** @beta */
3871
- declare type TranslateDocumentSync = TranslateRequestBase & AgentActionSync
3918
+ declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3919
+ TranslateRequestBase & AgentActionSync
3872
3920
 
3873
3921
  /** @beta */
3874
3922
  declare interface TranslateLanguage {
package/dist/stega.d.cts CHANGED
@@ -65,24 +65,45 @@ export declare type AgentActionPathSegment =
65
65
  declare class AgentActionsClient {
66
66
  #private
67
67
  constructor(client: SanityClient, httpRequest: HttpRequest)
68
- generate(request: GenerateAsyncInstruction): Promise<{
69
- _id: string
70
- }>
68
+ /**
69
+ * Run an instruction to generate content in a target document.
70
+ * @param request instruction request
71
+ */
71
72
  generate<DocumentShape extends Record<string, Any>>(
72
- request: GenerateSyncInstruction<DocumentShape>,
73
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
74
- transform(request: TransformDocumentAsync): Promise<{
75
- _id: string
76
- }>
73
+ request: GenerateInstruction<DocumentShape>,
74
+ ): Promise<
75
+ (typeof request)['async'] extends true
76
+ ? {
77
+ _id: string
78
+ }
79
+ : IdentifiedSanityDocumentStub & DocumentShape
80
+ >
81
+ /**
82
+ * Transform a target document based on a source.
83
+ * @param request translation request
84
+ */
77
85
  transform<DocumentShape extends Record<string, Any>>(
78
- request: TransformDocumentSync,
79
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
80
- translate(request: TranslateDocumentAsync): Promise<{
81
- _id: string
82
- }>
86
+ request: TransformDocument<DocumentShape>,
87
+ ): Promise<
88
+ (typeof request)['async'] extends true
89
+ ? {
90
+ _id: string
91
+ }
92
+ : IdentifiedSanityDocumentStub & DocumentShape
93
+ >
94
+ /**
95
+ * Translate a target document based on a source.
96
+ * @param request translation request
97
+ */
83
98
  translate<DocumentShape extends Record<string, Any>>(
84
- request: TranslateDocumentSync,
85
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
99
+ request: TranslateDocument<DocumentShape>,
100
+ ): Promise<
101
+ (typeof request)['async'] extends true
102
+ ? {
103
+ _id: string
104
+ }
105
+ : IdentifiedSanityDocumentStub & DocumentShape
106
+ >
86
107
  }
87
108
 
88
109
  /**
@@ -1762,24 +1783,45 @@ export declare type MutationSelectionQueryParams = {
1762
1783
  declare class ObservableAgentsActionClient {
1763
1784
  #private
1764
1785
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
1765
- generate(request: GenerateAsyncInstruction): Observable<{
1766
- _id: string
1767
- }>
1786
+ /**
1787
+ * Run an instruction to generate content in a target document.
1788
+ * @param request instruction request
1789
+ */
1768
1790
  generate<DocumentShape extends Record<string, Any>>(
1769
- request: GenerateSyncInstruction<DocumentShape>,
1770
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1771
- transform(request: TransformDocumentAsync): Observable<{
1772
- _id: string
1773
- }>
1791
+ request: GenerateInstruction<DocumentShape>,
1792
+ ): Observable<
1793
+ (typeof request)['async'] extends true
1794
+ ? {
1795
+ _id: string
1796
+ }
1797
+ : IdentifiedSanityDocumentStub & DocumentShape
1798
+ >
1799
+ /**
1800
+ * Transform a target document based on a source.
1801
+ * @param request translation request
1802
+ */
1774
1803
  transform<DocumentShape extends Record<string, Any>>(
1775
- request: TransformDocumentSync,
1776
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1777
- translate(request: TranslateDocumentAsync): Observable<{
1778
- _id: string
1779
- }>
1804
+ request: TransformDocument<DocumentShape>,
1805
+ ): Observable<
1806
+ (typeof request)['async'] extends true
1807
+ ? {
1808
+ _id: string
1809
+ }
1810
+ : IdentifiedSanityDocumentStub & DocumentShape
1811
+ >
1812
+ /**
1813
+ * Translate a target document based on a source.
1814
+ * @param request translation request
1815
+ */
1780
1816
  translate<DocumentShape extends Record<string, Any>>(
1781
- request: TranslateDocumentSync,
1782
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1817
+ request: TranslateDocument<DocumentShape>,
1818
+ ): Observable<
1819
+ (typeof request)['async'] extends true
1820
+ ? {
1821
+ _id: string
1822
+ }
1823
+ : IdentifiedSanityDocumentStub & DocumentShape
1824
+ >
1783
1825
  }
1784
1826
 
1785
1827
  /** @internal */
@@ -3780,13 +3822,16 @@ export declare type TransactionMutationOptions =
3780
3822
  | TransactionAllDocumentIdsMutationOptions
3781
3823
 
3782
3824
  /** @beta */
3783
- export declare type TransformDocument = TransformDocumentSync | TransformDocumentAsync
3825
+ export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
3826
+ | TransformDocumentSync<T>
3827
+ | TransformDocumentAsync
3784
3828
 
3785
3829
  /** @beta */
3786
3830
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
3787
3831
 
3788
3832
  /** @beta */
3789
- declare type TransformDocumentSync = TransformRequestBase & AgentActionSync
3833
+ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3834
+ TransformRequestBase & AgentActionSync
3790
3835
 
3791
3836
  /** @beta */
3792
3837
  declare interface TransformRequestBase extends AgentActionRequestBase {
@@ -3862,13 +3907,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
3862
3907
  }
3863
3908
 
3864
3909
  /** @beta */
3865
- export declare type TranslateDocument = TranslateDocumentSync | TranslateDocumentAsync
3910
+ export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
3911
+ | TranslateDocumentSync<T>
3912
+ | TranslateDocumentAsync
3866
3913
 
3867
3914
  /** @beta */
3868
3915
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
3869
3916
 
3870
3917
  /** @beta */
3871
- declare type TranslateDocumentSync = TranslateRequestBase & AgentActionSync
3918
+ declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3919
+ TranslateRequestBase & AgentActionSync
3872
3920
 
3873
3921
  /** @beta */
3874
3922
  declare interface TranslateLanguage {
package/dist/stega.d.ts CHANGED
@@ -65,24 +65,45 @@ export declare type AgentActionPathSegment =
65
65
  declare class AgentActionsClient {
66
66
  #private
67
67
  constructor(client: SanityClient, httpRequest: HttpRequest)
68
- generate(request: GenerateAsyncInstruction): Promise<{
69
- _id: string
70
- }>
68
+ /**
69
+ * Run an instruction to generate content in a target document.
70
+ * @param request instruction request
71
+ */
71
72
  generate<DocumentShape extends Record<string, Any>>(
72
- request: GenerateSyncInstruction<DocumentShape>,
73
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
74
- transform(request: TransformDocumentAsync): Promise<{
75
- _id: string
76
- }>
73
+ request: GenerateInstruction<DocumentShape>,
74
+ ): Promise<
75
+ (typeof request)['async'] extends true
76
+ ? {
77
+ _id: string
78
+ }
79
+ : IdentifiedSanityDocumentStub & DocumentShape
80
+ >
81
+ /**
82
+ * Transform a target document based on a source.
83
+ * @param request translation request
84
+ */
77
85
  transform<DocumentShape extends Record<string, Any>>(
78
- request: TransformDocumentSync,
79
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
80
- translate(request: TranslateDocumentAsync): Promise<{
81
- _id: string
82
- }>
86
+ request: TransformDocument<DocumentShape>,
87
+ ): Promise<
88
+ (typeof request)['async'] extends true
89
+ ? {
90
+ _id: string
91
+ }
92
+ : IdentifiedSanityDocumentStub & DocumentShape
93
+ >
94
+ /**
95
+ * Translate a target document based on a source.
96
+ * @param request translation request
97
+ */
83
98
  translate<DocumentShape extends Record<string, Any>>(
84
- request: TranslateDocumentSync,
85
- ): Promise<IdentifiedSanityDocumentStub & DocumentShape>
99
+ request: TranslateDocument<DocumentShape>,
100
+ ): Promise<
101
+ (typeof request)['async'] extends true
102
+ ? {
103
+ _id: string
104
+ }
105
+ : IdentifiedSanityDocumentStub & DocumentShape
106
+ >
86
107
  }
87
108
 
88
109
  /**
@@ -1762,24 +1783,45 @@ export declare type MutationSelectionQueryParams = {
1762
1783
  declare class ObservableAgentsActionClient {
1763
1784
  #private
1764
1785
  constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
1765
- generate(request: GenerateAsyncInstruction): Observable<{
1766
- _id: string
1767
- }>
1786
+ /**
1787
+ * Run an instruction to generate content in a target document.
1788
+ * @param request instruction request
1789
+ */
1768
1790
  generate<DocumentShape extends Record<string, Any>>(
1769
- request: GenerateSyncInstruction<DocumentShape>,
1770
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1771
- transform(request: TransformDocumentAsync): Observable<{
1772
- _id: string
1773
- }>
1791
+ request: GenerateInstruction<DocumentShape>,
1792
+ ): Observable<
1793
+ (typeof request)['async'] extends true
1794
+ ? {
1795
+ _id: string
1796
+ }
1797
+ : IdentifiedSanityDocumentStub & DocumentShape
1798
+ >
1799
+ /**
1800
+ * Transform a target document based on a source.
1801
+ * @param request translation request
1802
+ */
1774
1803
  transform<DocumentShape extends Record<string, Any>>(
1775
- request: TransformDocumentSync,
1776
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1777
- translate(request: TranslateDocumentAsync): Observable<{
1778
- _id: string
1779
- }>
1804
+ request: TransformDocument<DocumentShape>,
1805
+ ): Observable<
1806
+ (typeof request)['async'] extends true
1807
+ ? {
1808
+ _id: string
1809
+ }
1810
+ : IdentifiedSanityDocumentStub & DocumentShape
1811
+ >
1812
+ /**
1813
+ * Translate a target document based on a source.
1814
+ * @param request translation request
1815
+ */
1780
1816
  translate<DocumentShape extends Record<string, Any>>(
1781
- request: TranslateDocumentSync,
1782
- ): Observable<IdentifiedSanityDocumentStub & DocumentShape>
1817
+ request: TranslateDocument<DocumentShape>,
1818
+ ): Observable<
1819
+ (typeof request)['async'] extends true
1820
+ ? {
1821
+ _id: string
1822
+ }
1823
+ : IdentifiedSanityDocumentStub & DocumentShape
1824
+ >
1783
1825
  }
1784
1826
 
1785
1827
  /** @internal */
@@ -3780,13 +3822,16 @@ export declare type TransactionMutationOptions =
3780
3822
  | TransactionAllDocumentIdsMutationOptions
3781
3823
 
3782
3824
  /** @beta */
3783
- export declare type TransformDocument = TransformDocumentSync | TransformDocumentAsync
3825
+ export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
3826
+ | TransformDocumentSync<T>
3827
+ | TransformDocumentAsync
3784
3828
 
3785
3829
  /** @beta */
3786
3830
  declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
3787
3831
 
3788
3832
  /** @beta */
3789
- declare type TransformDocumentSync = TransformRequestBase & AgentActionSync
3833
+ declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3834
+ TransformRequestBase & AgentActionSync
3790
3835
 
3791
3836
  /** @beta */
3792
3837
  declare interface TransformRequestBase extends AgentActionRequestBase {
@@ -3862,13 +3907,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
3862
3907
  }
3863
3908
 
3864
3909
  /** @beta */
3865
- export declare type TranslateDocument = TranslateDocumentSync | TranslateDocumentAsync
3910
+ export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
3911
+ | TranslateDocumentSync<T>
3912
+ | TranslateDocumentAsync
3866
3913
 
3867
3914
  /** @beta */
3868
3915
  declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
3869
3916
 
3870
3917
  /** @beta */
3871
- declare type TranslateDocumentSync = TranslateRequestBase & AgentActionSync
3918
+ declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
3919
+ TranslateRequestBase & AgentActionSync
3872
3920
 
3873
3921
  /** @beta */
3874
3922
  declare interface TranslateLanguage {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "6.29.0-generate.2",
3
+ "version": "6.29.0-generate.3",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "keywords": [
6
6
  "sanity",