@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/index.browser.d.cts
CHANGED
|
@@ -71,24 +71,45 @@ export declare type AgentActionPathSegment =
|
|
|
71
71
|
declare class AgentActionsClient {
|
|
72
72
|
#private
|
|
73
73
|
constructor(client: SanityClient, httpRequest: HttpRequest)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Run an instruction to generate content in a target document.
|
|
76
|
+
* @param request instruction request
|
|
77
|
+
*/
|
|
77
78
|
generate<DocumentShape extends Record<string, Any>>(
|
|
78
|
-
request:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
request: GenerateInstruction<DocumentShape>,
|
|
80
|
+
): Promise<
|
|
81
|
+
(typeof request)['async'] extends true
|
|
82
|
+
? {
|
|
83
|
+
_id: string
|
|
84
|
+
}
|
|
85
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
86
|
+
>
|
|
87
|
+
/**
|
|
88
|
+
* Transform a target document based on a source.
|
|
89
|
+
* @param request translation request
|
|
90
|
+
*/
|
|
83
91
|
transform<DocumentShape extends Record<string, Any>>(
|
|
84
|
-
request:
|
|
85
|
-
): Promise<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
request: TransformDocument<DocumentShape>,
|
|
93
|
+
): Promise<
|
|
94
|
+
(typeof request)['async'] extends true
|
|
95
|
+
? {
|
|
96
|
+
_id: string
|
|
97
|
+
}
|
|
98
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
99
|
+
>
|
|
100
|
+
/**
|
|
101
|
+
* Translate a target document based on a source.
|
|
102
|
+
* @param request translation request
|
|
103
|
+
*/
|
|
89
104
|
translate<DocumentShape extends Record<string, Any>>(
|
|
90
|
-
request:
|
|
91
|
-
): Promise<
|
|
105
|
+
request: TranslateDocument<DocumentShape>,
|
|
106
|
+
): Promise<
|
|
107
|
+
(typeof request)['async'] extends true
|
|
108
|
+
? {
|
|
109
|
+
_id: string
|
|
110
|
+
}
|
|
111
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
112
|
+
>
|
|
92
113
|
}
|
|
93
114
|
|
|
94
115
|
/**
|
|
@@ -1585,24 +1606,45 @@ export declare type MutationSelectionQueryParams = {
|
|
|
1585
1606
|
declare class ObservableAgentsActionClient {
|
|
1586
1607
|
#private
|
|
1587
1608
|
constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1609
|
+
/**
|
|
1610
|
+
* Run an instruction to generate content in a target document.
|
|
1611
|
+
* @param request instruction request
|
|
1612
|
+
*/
|
|
1591
1613
|
generate<DocumentShape extends Record<string, Any>>(
|
|
1592
|
-
request:
|
|
1593
|
-
): Observable<
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1614
|
+
request: GenerateInstruction<DocumentShape>,
|
|
1615
|
+
): Observable<
|
|
1616
|
+
(typeof request)['async'] extends true
|
|
1617
|
+
? {
|
|
1618
|
+
_id: string
|
|
1619
|
+
}
|
|
1620
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1621
|
+
>
|
|
1622
|
+
/**
|
|
1623
|
+
* Transform a target document based on a source.
|
|
1624
|
+
* @param request translation request
|
|
1625
|
+
*/
|
|
1597
1626
|
transform<DocumentShape extends Record<string, Any>>(
|
|
1598
|
-
request:
|
|
1599
|
-
): Observable<
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1627
|
+
request: TransformDocument<DocumentShape>,
|
|
1628
|
+
): Observable<
|
|
1629
|
+
(typeof request)['async'] extends true
|
|
1630
|
+
? {
|
|
1631
|
+
_id: string
|
|
1632
|
+
}
|
|
1633
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1634
|
+
>
|
|
1635
|
+
/**
|
|
1636
|
+
* Translate a target document based on a source.
|
|
1637
|
+
* @param request translation request
|
|
1638
|
+
*/
|
|
1603
1639
|
translate<DocumentShape extends Record<string, Any>>(
|
|
1604
|
-
request:
|
|
1605
|
-
): Observable<
|
|
1640
|
+
request: TranslateDocument<DocumentShape>,
|
|
1641
|
+
): Observable<
|
|
1642
|
+
(typeof request)['async'] extends true
|
|
1643
|
+
? {
|
|
1644
|
+
_id: string
|
|
1645
|
+
}
|
|
1646
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1647
|
+
>
|
|
1606
1648
|
}
|
|
1607
1649
|
|
|
1608
1650
|
/** @internal */
|
|
@@ -3522,13 +3564,16 @@ export declare type TransactionMutationOptions =
|
|
|
3522
3564
|
| TransactionAllDocumentIdsMutationOptions
|
|
3523
3565
|
|
|
3524
3566
|
/** @beta */
|
|
3525
|
-
export declare type TransformDocument =
|
|
3567
|
+
export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
3568
|
+
| TransformDocumentSync<T>
|
|
3569
|
+
| TransformDocumentAsync
|
|
3526
3570
|
|
|
3527
3571
|
/** @beta */
|
|
3528
3572
|
declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
|
|
3529
3573
|
|
|
3530
3574
|
/** @beta */
|
|
3531
|
-
declare type TransformDocumentSync =
|
|
3575
|
+
declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3576
|
+
TransformRequestBase & AgentActionSync
|
|
3532
3577
|
|
|
3533
3578
|
/** @beta */
|
|
3534
3579
|
declare interface TransformRequestBase extends AgentActionRequestBase {
|
|
@@ -3604,13 +3649,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
|
|
|
3604
3649
|
}
|
|
3605
3650
|
|
|
3606
3651
|
/** @beta */
|
|
3607
|
-
export declare type TranslateDocument =
|
|
3652
|
+
export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
3653
|
+
| TranslateDocumentSync<T>
|
|
3654
|
+
| TranslateDocumentAsync
|
|
3608
3655
|
|
|
3609
3656
|
/** @beta */
|
|
3610
3657
|
declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
|
|
3611
3658
|
|
|
3612
3659
|
/** @beta */
|
|
3613
|
-
declare type TranslateDocumentSync =
|
|
3660
|
+
declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3661
|
+
TranslateRequestBase & AgentActionSync
|
|
3614
3662
|
|
|
3615
3663
|
/** @beta */
|
|
3616
3664
|
declare interface TranslateLanguage {
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -71,24 +71,45 @@ export declare type AgentActionPathSegment =
|
|
|
71
71
|
declare class AgentActionsClient {
|
|
72
72
|
#private
|
|
73
73
|
constructor(client: SanityClient, httpRequest: HttpRequest)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Run an instruction to generate content in a target document.
|
|
76
|
+
* @param request instruction request
|
|
77
|
+
*/
|
|
77
78
|
generate<DocumentShape extends Record<string, Any>>(
|
|
78
|
-
request:
|
|
79
|
-
): Promise<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
request: GenerateInstruction<DocumentShape>,
|
|
80
|
+
): Promise<
|
|
81
|
+
(typeof request)['async'] extends true
|
|
82
|
+
? {
|
|
83
|
+
_id: string
|
|
84
|
+
}
|
|
85
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
86
|
+
>
|
|
87
|
+
/**
|
|
88
|
+
* Transform a target document based on a source.
|
|
89
|
+
* @param request translation request
|
|
90
|
+
*/
|
|
83
91
|
transform<DocumentShape extends Record<string, Any>>(
|
|
84
|
-
request:
|
|
85
|
-
): Promise<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
request: TransformDocument<DocumentShape>,
|
|
93
|
+
): Promise<
|
|
94
|
+
(typeof request)['async'] extends true
|
|
95
|
+
? {
|
|
96
|
+
_id: string
|
|
97
|
+
}
|
|
98
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
99
|
+
>
|
|
100
|
+
/**
|
|
101
|
+
* Translate a target document based on a source.
|
|
102
|
+
* @param request translation request
|
|
103
|
+
*/
|
|
89
104
|
translate<DocumentShape extends Record<string, Any>>(
|
|
90
|
-
request:
|
|
91
|
-
): Promise<
|
|
105
|
+
request: TranslateDocument<DocumentShape>,
|
|
106
|
+
): Promise<
|
|
107
|
+
(typeof request)['async'] extends true
|
|
108
|
+
? {
|
|
109
|
+
_id: string
|
|
110
|
+
}
|
|
111
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
112
|
+
>
|
|
92
113
|
}
|
|
93
114
|
|
|
94
115
|
/**
|
|
@@ -1585,24 +1606,45 @@ export declare type MutationSelectionQueryParams = {
|
|
|
1585
1606
|
declare class ObservableAgentsActionClient {
|
|
1586
1607
|
#private
|
|
1587
1608
|
constructor(client: ObservableSanityClient, httpRequest: HttpRequest)
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1609
|
+
/**
|
|
1610
|
+
* Run an instruction to generate content in a target document.
|
|
1611
|
+
* @param request instruction request
|
|
1612
|
+
*/
|
|
1591
1613
|
generate<DocumentShape extends Record<string, Any>>(
|
|
1592
|
-
request:
|
|
1593
|
-
): Observable<
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1614
|
+
request: GenerateInstruction<DocumentShape>,
|
|
1615
|
+
): Observable<
|
|
1616
|
+
(typeof request)['async'] extends true
|
|
1617
|
+
? {
|
|
1618
|
+
_id: string
|
|
1619
|
+
}
|
|
1620
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1621
|
+
>
|
|
1622
|
+
/**
|
|
1623
|
+
* Transform a target document based on a source.
|
|
1624
|
+
* @param request translation request
|
|
1625
|
+
*/
|
|
1597
1626
|
transform<DocumentShape extends Record<string, Any>>(
|
|
1598
|
-
request:
|
|
1599
|
-
): Observable<
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1627
|
+
request: TransformDocument<DocumentShape>,
|
|
1628
|
+
): Observable<
|
|
1629
|
+
(typeof request)['async'] extends true
|
|
1630
|
+
? {
|
|
1631
|
+
_id: string
|
|
1632
|
+
}
|
|
1633
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1634
|
+
>
|
|
1635
|
+
/**
|
|
1636
|
+
* Translate a target document based on a source.
|
|
1637
|
+
* @param request translation request
|
|
1638
|
+
*/
|
|
1603
1639
|
translate<DocumentShape extends Record<string, Any>>(
|
|
1604
|
-
request:
|
|
1605
|
-
): Observable<
|
|
1640
|
+
request: TranslateDocument<DocumentShape>,
|
|
1641
|
+
): Observable<
|
|
1642
|
+
(typeof request)['async'] extends true
|
|
1643
|
+
? {
|
|
1644
|
+
_id: string
|
|
1645
|
+
}
|
|
1646
|
+
: IdentifiedSanityDocumentStub & DocumentShape
|
|
1647
|
+
>
|
|
1606
1648
|
}
|
|
1607
1649
|
|
|
1608
1650
|
/** @internal */
|
|
@@ -3522,13 +3564,16 @@ export declare type TransactionMutationOptions =
|
|
|
3522
3564
|
| TransactionAllDocumentIdsMutationOptions
|
|
3523
3565
|
|
|
3524
3566
|
/** @beta */
|
|
3525
|
-
export declare type TransformDocument =
|
|
3567
|
+
export declare type TransformDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
3568
|
+
| TransformDocumentSync<T>
|
|
3569
|
+
| TransformDocumentAsync
|
|
3526
3570
|
|
|
3527
3571
|
/** @beta */
|
|
3528
3572
|
declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync
|
|
3529
3573
|
|
|
3530
3574
|
/** @beta */
|
|
3531
|
-
declare type TransformDocumentSync =
|
|
3575
|
+
declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3576
|
+
TransformRequestBase & AgentActionSync
|
|
3532
3577
|
|
|
3533
3578
|
/** @beta */
|
|
3534
3579
|
declare interface TransformRequestBase extends AgentActionRequestBase {
|
|
@@ -3604,13 +3649,16 @@ export declare interface TransformTargetInclude extends AgentActionTargetInclude
|
|
|
3604
3649
|
}
|
|
3605
3650
|
|
|
3606
3651
|
/** @beta */
|
|
3607
|
-
export declare type TranslateDocument =
|
|
3652
|
+
export declare type TranslateDocument<T extends Record<string, Any> = Record<string, Any>> =
|
|
3653
|
+
| TranslateDocumentSync<T>
|
|
3654
|
+
| TranslateDocumentAsync
|
|
3608
3655
|
|
|
3609
3656
|
/** @beta */
|
|
3610
3657
|
declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync
|
|
3611
3658
|
|
|
3612
3659
|
/** @beta */
|
|
3613
|
-
declare type TranslateDocumentSync =
|
|
3660
|
+
declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3661
|
+
TranslateRequestBase & AgentActionSync
|
|
3614
3662
|
|
|
3615
3663
|
/** @beta */
|
|
3616
3664
|
declare interface TranslateLanguage {
|