@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.
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.d.cts +82 -34
- package/dist/index.browser.d.ts +82 -34
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +82 -34
- package/dist/index.d.ts +82 -34
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.d.cts +82 -34
- package/dist/stega.browser.d.ts +82 -34
- package/dist/stega.d.cts +82 -34
- package/dist/stega.d.ts +82 -34
- package/package.json +1 -1
- package/src/agent/actions/AgentActionsClient.ts +33 -73
- package/src/agent/actions/generate.ts +5 -6
- package/src/agent/actions/transform.ts +12 -8
- package/src/agent/actions/translate.ts +12 -8
package/dist/stega.browser.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
|
-
|
|
69
|
-
|
|
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:
|
|
73
|
-
): Promise<
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
85
|
-
): Promise<
|
|
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
|
-
|
|
1766
|
-
|
|
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:
|
|
1770
|
-
): Observable<
|
|
1771
|
-
|
|
1772
|
-
|
|
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:
|
|
1776
|
-
): Observable<
|
|
1777
|
-
|
|
1778
|
-
|
|
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:
|
|
1782
|
-
): Observable<
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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.browser.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
|
-
|
|
69
|
-
|
|
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:
|
|
73
|
-
): Promise<
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
85
|
-
): Promise<
|
|
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
|
-
|
|
1766
|
-
|
|
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:
|
|
1770
|
-
): Observable<
|
|
1771
|
-
|
|
1772
|
-
|
|
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:
|
|
1776
|
-
): Observable<
|
|
1777
|
-
|
|
1778
|
-
|
|
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:
|
|
1782
|
-
): Observable<
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
69
|
-
|
|
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:
|
|
73
|
-
): Promise<
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
85
|
-
): Promise<
|
|
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
|
-
|
|
1766
|
-
|
|
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:
|
|
1770
|
-
): Observable<
|
|
1771
|
-
|
|
1772
|
-
|
|
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:
|
|
1776
|
-
): Observable<
|
|
1777
|
-
|
|
1778
|
-
|
|
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:
|
|
1782
|
-
): Observable<
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
69
|
-
|
|
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:
|
|
73
|
-
): Promise<
|
|
74
|
-
|
|
75
|
-
|
|
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:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
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:
|
|
85
|
-
): Promise<
|
|
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
|
-
|
|
1766
|
-
|
|
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:
|
|
1770
|
-
): Observable<
|
|
1771
|
-
|
|
1772
|
-
|
|
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:
|
|
1776
|
-
): Observable<
|
|
1777
|
-
|
|
1778
|
-
|
|
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:
|
|
1782
|
-
): Observable<
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 {
|