@sanity/client 6.29.0-generate.3 → 6.29.0-generate.5
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.d.cts +152 -26
- package/dist/index.browser.d.ts +152 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +152 -26
- package/dist/index.d.ts +152 -26
- package/dist/index.js +1 -1
- package/dist/stega.browser.d.cts +152 -26
- package/dist/stega.browser.d.ts +152 -26
- package/dist/stega.d.cts +152 -26
- package/dist/stega.d.ts +152 -26
- package/package.json +1 -1
- package/src/agent/actions/commonTypes.ts +3 -0
- package/src/types.ts +15 -0
package/dist/index.browser.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {AgentActionAsync} from '@sanity/client/agent/actions/commonTypes'
|
|
1
|
+
import type {AgentActionAsync as AgentActionAsync_2} from '@sanity/client/agent/actions/commonTypes'
|
|
2
2
|
import type {AgentActionPath as AgentActionPath_2} from '@sanity/client/agent/actions/commonTypes'
|
|
3
3
|
import type {AgentActionPathSegment as AgentActionPathSegment_2} from '@sanity/client/agent/actions/commonTypes'
|
|
4
|
-
import type {AgentActionRequestBase} from '@sanity/client/agent/actions/commonTypes'
|
|
5
|
-
import type {AgentActionSync} from '@sanity/client/agent/actions/commonTypes'
|
|
4
|
+
import type {AgentActionRequestBase as AgentActionRequestBase_2} from '@sanity/client/agent/actions/commonTypes'
|
|
5
|
+
import type {AgentActionSync as AgentActionSync_2} from '@sanity/client/agent/actions/commonTypes'
|
|
6
6
|
import type {AgentActionTarget as AgentActionTarget_2} from '@sanity/client/agent/actions/commonTypes'
|
|
7
|
-
import type {AgentActionTargetInclude} from '@sanity/client/agent/actions/commonTypes'
|
|
7
|
+
import type {AgentActionTargetInclude as AgentActionTargetInclude_2} from '@sanity/client/agent/actions/commonTypes'
|
|
8
8
|
import type {ContentSourceMapDocuments as ContentSourceMapDocuments_2} from '@sanity/client/csm'
|
|
9
9
|
import {ContentSourceMapParsedPath} from '@sanity/client/csm'
|
|
10
10
|
import {ContentSourceMapParsedPathKeyedSegment} from '@sanity/client/csm'
|
|
@@ -46,6 +46,19 @@ export declare interface ActionErrorItem {
|
|
|
46
46
|
index: number
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/** @beta */
|
|
50
|
+
export declare interface AgentActionAsync {
|
|
51
|
+
/**
|
|
52
|
+
* When async: true, requests responds with status 201 and {_id} as response body as soon as the request is validated.
|
|
53
|
+
* The instruction operation will carry on in the background.
|
|
54
|
+
*
|
|
55
|
+
* When async: false (default), requests respond with status 200 and the document value after instruction has been applied.
|
|
56
|
+
*
|
|
57
|
+
* async: true is incompatible with noWrite, as async: true does not return the resulting document
|
|
58
|
+
*/
|
|
59
|
+
async: true
|
|
60
|
+
}
|
|
61
|
+
|
|
49
62
|
/** @beta */
|
|
50
63
|
export declare type AgentActionParam =
|
|
51
64
|
| string
|
|
@@ -67,6 +80,80 @@ export declare type AgentActionPathSegment =
|
|
|
67
80
|
_key: string
|
|
68
81
|
}
|
|
69
82
|
|
|
83
|
+
/** @beta */
|
|
84
|
+
export declare interface AgentActionRequestBase {
|
|
85
|
+
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
86
|
+
schemaId: string
|
|
87
|
+
/**
|
|
88
|
+
* When a type or field in the schema has a function set for `hidden` or `readOnly`, it is conditional.
|
|
89
|
+
*
|
|
90
|
+
* By default, Generate will not output to conditional `readOnly` and `hidden` fields,
|
|
91
|
+
* ie, they are considered to resolve to `readOnly: true` / `hidden: true`.
|
|
92
|
+
*
|
|
93
|
+
* `conditionalPaths` param allows setting the default conditional value for
|
|
94
|
+
* `hidden` and `readOnly` to false,
|
|
95
|
+
* or individually set `hidden` and `readOnly` state for individual document paths.
|
|
96
|
+
*
|
|
97
|
+
* Note: fields and types with explicit readOnly: true or hidden: true in the schema, are not available to Generate,
|
|
98
|
+
* and cannot be changed via conditionalPaths
|
|
99
|
+
*
|
|
100
|
+
* conditionalPaths state only apply to fields and types that have conditional `hidden` or `readOnly` in their schema definition.
|
|
101
|
+
*
|
|
102
|
+
* Consider using `hidden: () => true` in schema config, if a field should be writeable only by Generate and never
|
|
103
|
+
* visible in the studio – then make the field visible to the Generate using `conditionalPaths`.
|
|
104
|
+
*
|
|
105
|
+
* @see GenerateRequestBase#target
|
|
106
|
+
*/
|
|
107
|
+
conditionalPaths?: {
|
|
108
|
+
defaultReadOnly?: boolean
|
|
109
|
+
defaultHidden?: boolean
|
|
110
|
+
paths?: {
|
|
111
|
+
/** path here is not a relative path: it must be the full document path, regardless of `path` param used in targets */
|
|
112
|
+
path: AgentActionPath
|
|
113
|
+
readOnly: boolean
|
|
114
|
+
hidden: boolean
|
|
115
|
+
}[]
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* When localeSettings is provided on the request, instruct can write to date and datetime fields.
|
|
119
|
+
* Otherwise, such fields will be ignored.
|
|
120
|
+
*/
|
|
121
|
+
localeSettings?: {
|
|
122
|
+
/**
|
|
123
|
+
* A valid Unicode BCP 47 locale identifier used to interpret and format
|
|
124
|
+
* natural language inputs and date output. Examples include "en-US", "fr-FR", or "ja-JP".
|
|
125
|
+
*
|
|
126
|
+
* This affects how phrases like "next Friday" or "in two weeks" are parsed,
|
|
127
|
+
* and how resulting dates are presented (e.g., 12-hour vs 24-hour format).
|
|
128
|
+
*
|
|
129
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#getcanonicalocales
|
|
130
|
+
*/
|
|
131
|
+
locale: string
|
|
132
|
+
/**
|
|
133
|
+
* A valid IANA time zone identifier used to resolve relative and absolute
|
|
134
|
+
* date expressions to a specific point in time. Examples include
|
|
135
|
+
* "America/New_York", "Europe/Paris", or "Asia/Tokyo".
|
|
136
|
+
*
|
|
137
|
+
* This ensures phrases like "tomorrow at 9am" are interpreted correctly
|
|
138
|
+
* based on the user's local time.
|
|
139
|
+
*
|
|
140
|
+
* @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
141
|
+
*/
|
|
142
|
+
timeZone: string
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Controls how much variance the instructions will run with.
|
|
146
|
+
*
|
|
147
|
+
* Value must be in the range [0, 1] (inclusive).
|
|
148
|
+
*
|
|
149
|
+
* Defaults:
|
|
150
|
+
* - generate: 0.3
|
|
151
|
+
* - translate: 0
|
|
152
|
+
* - transform: 0
|
|
153
|
+
*/
|
|
154
|
+
temperature?: number
|
|
155
|
+
}
|
|
156
|
+
|
|
70
157
|
/** @public */
|
|
71
158
|
declare class AgentActionsClient {
|
|
72
159
|
#private
|
|
@@ -112,6 +199,30 @@ declare class AgentActionsClient {
|
|
|
112
199
|
>
|
|
113
200
|
}
|
|
114
201
|
|
|
202
|
+
/** @beta */
|
|
203
|
+
export declare interface AgentActionSync {
|
|
204
|
+
/**
|
|
205
|
+
* By default, noWrite: false.
|
|
206
|
+
* Write enabled operations will mutate the target document, and emit AI presence in the studio.
|
|
207
|
+
*
|
|
208
|
+
* When noWrite: true, the api will not mutate any documents nor emit presence.
|
|
209
|
+
* Ie, when true, no changes will be made to content-lake
|
|
210
|
+
*
|
|
211
|
+
* noWrite: true is incompatible with async: true,
|
|
212
|
+
* as noWrite implies that you will use the return value of the operation
|
|
213
|
+
*/
|
|
214
|
+
noWrite?: boolean
|
|
215
|
+
/**
|
|
216
|
+
* When async: true, requests responds with status 201 and {_id} as response body as soon as the request is validated.
|
|
217
|
+
* The instruction operation will carry on in the background.
|
|
218
|
+
*
|
|
219
|
+
* When async: false (default), requests respond with status 200 and the document value after instruction has been applied.
|
|
220
|
+
*
|
|
221
|
+
* async: true is incompatible with noWrite: true, as async: true does not return the resulting document
|
|
222
|
+
*/
|
|
223
|
+
async?: false
|
|
224
|
+
}
|
|
225
|
+
|
|
115
226
|
/**
|
|
116
227
|
* @beta
|
|
117
228
|
*/
|
|
@@ -164,7 +275,24 @@ export declare interface AgentActionTarget {
|
|
|
164
275
|
}
|
|
165
276
|
|
|
166
277
|
/** @beta */
|
|
167
|
-
declare
|
|
278
|
+
export declare interface AgentActionTargetInclude {
|
|
279
|
+
path: AgentActionPathSegment | AgentActionPath
|
|
280
|
+
/**
|
|
281
|
+
* By default, all children up to `target.maxPathDepth` are included.
|
|
282
|
+
* Fields or array items not on the exclude list, are implicitly included.
|
|
283
|
+
*/
|
|
284
|
+
exclude?: AgentActionPathSegment[]
|
|
285
|
+
/**
|
|
286
|
+
* Types can be used to exclude array item types or all fields directly under the target path of a certain type.
|
|
287
|
+
* If you do exclude: ['string'] all string fields under the target will be excluded, for instance.
|
|
288
|
+
*
|
|
289
|
+
* `types.include` and `types.exclude` are mutually exclusive.
|
|
290
|
+
*/
|
|
291
|
+
types?: AgentActionTypeConfig
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** @beta */
|
|
295
|
+
export declare type AgentActionTypeConfig =
|
|
168
296
|
| {
|
|
169
297
|
include: string[]
|
|
170
298
|
exclude?: never
|
|
@@ -1025,12 +1153,10 @@ export declare type FirstDocumentMutationOptions = BaseMutationOptions & {
|
|
|
1025
1153
|
}
|
|
1026
1154
|
|
|
1027
1155
|
/** @beta */
|
|
1028
|
-
declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1029
|
-
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
GenerateRequestBase &
|
|
1033
|
-
AgentActionAsync
|
|
1156
|
+
export declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1157
|
+
(GenerateExistingDocumentRequest | GenerateCreateDocumentRequest<T>) &
|
|
1158
|
+
GenerateRequestBase &
|
|
1159
|
+
AgentActionAsync_2
|
|
1034
1160
|
|
|
1035
1161
|
/**
|
|
1036
1162
|
* Instruction to create a new document
|
|
@@ -1065,7 +1191,7 @@ export declare type GenerateInstruction<T extends Record<string, Any> = Record<s
|
|
|
1065
1191
|
export declare type GenerateOperation = 'set' | 'append' | 'mixed'
|
|
1066
1192
|
|
|
1067
1193
|
/** @beta */
|
|
1068
|
-
declare interface GenerateRequestBase extends
|
|
1194
|
+
export declare interface GenerateRequestBase extends AgentActionRequestBase_2 {
|
|
1069
1195
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
1070
1196
|
schemaId: string
|
|
1071
1197
|
/** string template using $variable */
|
|
@@ -1089,12 +1215,12 @@ declare interface GenerateRequestBase extends AgentActionRequestBase {
|
|
|
1089
1215
|
}
|
|
1090
1216
|
|
|
1091
1217
|
/** @beta */
|
|
1092
|
-
declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1218
|
+
export declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1093
1219
|
| GenerateExistingDocumentRequest
|
|
1094
1220
|
| GenerateCreateDocumentRequest<T>
|
|
1095
1221
|
) &
|
|
1096
1222
|
GenerateRequestBase &
|
|
1097
|
-
|
|
1223
|
+
AgentActionSync_2
|
|
1098
1224
|
|
|
1099
1225
|
/** @beta */
|
|
1100
1226
|
export declare interface GenerateTarget extends AgentActionTarget_2 {
|
|
@@ -1142,7 +1268,7 @@ export declare interface GenerateTarget extends AgentActionTarget_2 {
|
|
|
1142
1268
|
}
|
|
1143
1269
|
|
|
1144
1270
|
/** @beta */
|
|
1145
|
-
export declare interface GenerateTargetInclude extends
|
|
1271
|
+
export declare interface GenerateTargetInclude extends AgentActionTargetInclude_2 {
|
|
1146
1272
|
/**
|
|
1147
1273
|
* Sets the operation for this path, and all its children.
|
|
1148
1274
|
* This overrides any operation set parents or the root target.
|
|
@@ -3569,14 +3695,14 @@ export declare type TransformDocument<T extends Record<string, Any> = Record<str
|
|
|
3569
3695
|
| TransformDocumentAsync
|
|
3570
3696
|
|
|
3571
3697
|
/** @beta */
|
|
3572
|
-
declare type TransformDocumentAsync = TransformRequestBase &
|
|
3698
|
+
export declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync_2
|
|
3573
3699
|
|
|
3574
3700
|
/** @beta */
|
|
3575
|
-
declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3576
|
-
TransformRequestBase &
|
|
3701
|
+
export declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3702
|
+
TransformRequestBase & AgentActionSync_2
|
|
3577
3703
|
|
|
3578
3704
|
/** @beta */
|
|
3579
|
-
declare interface TransformRequestBase extends
|
|
3705
|
+
export declare interface TransformRequestBase extends AgentActionRequestBase_2 {
|
|
3580
3706
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
3581
3707
|
schemaId: string
|
|
3582
3708
|
documentId: string
|
|
@@ -3635,7 +3761,7 @@ export declare type TransformTargetDocument =
|
|
|
3635
3761
|
}
|
|
3636
3762
|
|
|
3637
3763
|
/** @beta */
|
|
3638
|
-
export declare interface TransformTargetInclude extends
|
|
3764
|
+
export declare interface TransformTargetInclude extends AgentActionTargetInclude_2 {
|
|
3639
3765
|
/** string template using $variable from instructionParams */
|
|
3640
3766
|
transformation?: string
|
|
3641
3767
|
/**
|
|
@@ -3654,20 +3780,20 @@ export declare type TranslateDocument<T extends Record<string, Any> = Record<str
|
|
|
3654
3780
|
| TranslateDocumentAsync
|
|
3655
3781
|
|
|
3656
3782
|
/** @beta */
|
|
3657
|
-
declare type TranslateDocumentAsync = TranslateRequestBase &
|
|
3783
|
+
export declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync_2
|
|
3658
3784
|
|
|
3659
3785
|
/** @beta */
|
|
3660
|
-
declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3661
|
-
TranslateRequestBase &
|
|
3786
|
+
export declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3787
|
+
TranslateRequestBase & AgentActionSync_2
|
|
3662
3788
|
|
|
3663
3789
|
/** @beta */
|
|
3664
|
-
declare interface TranslateLanguage {
|
|
3790
|
+
export declare interface TranslateLanguage {
|
|
3665
3791
|
id: string
|
|
3666
3792
|
title?: string
|
|
3667
3793
|
}
|
|
3668
3794
|
|
|
3669
3795
|
/** @beta */
|
|
3670
|
-
declare interface TranslateRequestBase extends
|
|
3796
|
+
export declare interface TranslateRequestBase extends AgentActionRequestBase_2 {
|
|
3671
3797
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
3672
3798
|
schemaId: string
|
|
3673
3799
|
documentId: string
|
|
@@ -3711,7 +3837,7 @@ export declare interface TranslateTarget extends AgentActionTarget {
|
|
|
3711
3837
|
}
|
|
3712
3838
|
|
|
3713
3839
|
/** @beta */
|
|
3714
|
-
export declare interface TranslateTargetInclude extends
|
|
3840
|
+
export declare interface TranslateTargetInclude extends AgentActionTargetInclude_2 {
|
|
3715
3841
|
/** string template using $variable from instructionParams */
|
|
3716
3842
|
styleGuide?: string
|
|
3717
3843
|
/**
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {AgentActionAsync} from '@sanity/client/agent/actions/commonTypes'
|
|
1
|
+
import type {AgentActionAsync as AgentActionAsync_2} from '@sanity/client/agent/actions/commonTypes'
|
|
2
2
|
import type {AgentActionPath as AgentActionPath_2} from '@sanity/client/agent/actions/commonTypes'
|
|
3
3
|
import type {AgentActionPathSegment as AgentActionPathSegment_2} from '@sanity/client/agent/actions/commonTypes'
|
|
4
|
-
import type {AgentActionRequestBase} from '@sanity/client/agent/actions/commonTypes'
|
|
5
|
-
import type {AgentActionSync} from '@sanity/client/agent/actions/commonTypes'
|
|
4
|
+
import type {AgentActionRequestBase as AgentActionRequestBase_2} from '@sanity/client/agent/actions/commonTypes'
|
|
5
|
+
import type {AgentActionSync as AgentActionSync_2} from '@sanity/client/agent/actions/commonTypes'
|
|
6
6
|
import type {AgentActionTarget as AgentActionTarget_2} from '@sanity/client/agent/actions/commonTypes'
|
|
7
|
-
import type {AgentActionTargetInclude} from '@sanity/client/agent/actions/commonTypes'
|
|
7
|
+
import type {AgentActionTargetInclude as AgentActionTargetInclude_2} from '@sanity/client/agent/actions/commonTypes'
|
|
8
8
|
import type {ContentSourceMapDocuments as ContentSourceMapDocuments_2} from '@sanity/client/csm'
|
|
9
9
|
import {ContentSourceMapParsedPath} from '@sanity/client/csm'
|
|
10
10
|
import {ContentSourceMapParsedPathKeyedSegment} from '@sanity/client/csm'
|
|
@@ -46,6 +46,19 @@ export declare interface ActionErrorItem {
|
|
|
46
46
|
index: number
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/** @beta */
|
|
50
|
+
export declare interface AgentActionAsync {
|
|
51
|
+
/**
|
|
52
|
+
* When async: true, requests responds with status 201 and {_id} as response body as soon as the request is validated.
|
|
53
|
+
* The instruction operation will carry on in the background.
|
|
54
|
+
*
|
|
55
|
+
* When async: false (default), requests respond with status 200 and the document value after instruction has been applied.
|
|
56
|
+
*
|
|
57
|
+
* async: true is incompatible with noWrite, as async: true does not return the resulting document
|
|
58
|
+
*/
|
|
59
|
+
async: true
|
|
60
|
+
}
|
|
61
|
+
|
|
49
62
|
/** @beta */
|
|
50
63
|
export declare type AgentActionParam =
|
|
51
64
|
| string
|
|
@@ -67,6 +80,80 @@ export declare type AgentActionPathSegment =
|
|
|
67
80
|
_key: string
|
|
68
81
|
}
|
|
69
82
|
|
|
83
|
+
/** @beta */
|
|
84
|
+
export declare interface AgentActionRequestBase {
|
|
85
|
+
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
86
|
+
schemaId: string
|
|
87
|
+
/**
|
|
88
|
+
* When a type or field in the schema has a function set for `hidden` or `readOnly`, it is conditional.
|
|
89
|
+
*
|
|
90
|
+
* By default, Generate will not output to conditional `readOnly` and `hidden` fields,
|
|
91
|
+
* ie, they are considered to resolve to `readOnly: true` / `hidden: true`.
|
|
92
|
+
*
|
|
93
|
+
* `conditionalPaths` param allows setting the default conditional value for
|
|
94
|
+
* `hidden` and `readOnly` to false,
|
|
95
|
+
* or individually set `hidden` and `readOnly` state for individual document paths.
|
|
96
|
+
*
|
|
97
|
+
* Note: fields and types with explicit readOnly: true or hidden: true in the schema, are not available to Generate,
|
|
98
|
+
* and cannot be changed via conditionalPaths
|
|
99
|
+
*
|
|
100
|
+
* conditionalPaths state only apply to fields and types that have conditional `hidden` or `readOnly` in their schema definition.
|
|
101
|
+
*
|
|
102
|
+
* Consider using `hidden: () => true` in schema config, if a field should be writeable only by Generate and never
|
|
103
|
+
* visible in the studio – then make the field visible to the Generate using `conditionalPaths`.
|
|
104
|
+
*
|
|
105
|
+
* @see GenerateRequestBase#target
|
|
106
|
+
*/
|
|
107
|
+
conditionalPaths?: {
|
|
108
|
+
defaultReadOnly?: boolean
|
|
109
|
+
defaultHidden?: boolean
|
|
110
|
+
paths?: {
|
|
111
|
+
/** path here is not a relative path: it must be the full document path, regardless of `path` param used in targets */
|
|
112
|
+
path: AgentActionPath
|
|
113
|
+
readOnly: boolean
|
|
114
|
+
hidden: boolean
|
|
115
|
+
}[]
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* When localeSettings is provided on the request, instruct can write to date and datetime fields.
|
|
119
|
+
* Otherwise, such fields will be ignored.
|
|
120
|
+
*/
|
|
121
|
+
localeSettings?: {
|
|
122
|
+
/**
|
|
123
|
+
* A valid Unicode BCP 47 locale identifier used to interpret and format
|
|
124
|
+
* natural language inputs and date output. Examples include "en-US", "fr-FR", or "ja-JP".
|
|
125
|
+
*
|
|
126
|
+
* This affects how phrases like "next Friday" or "in two weeks" are parsed,
|
|
127
|
+
* and how resulting dates are presented (e.g., 12-hour vs 24-hour format).
|
|
128
|
+
*
|
|
129
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#getcanonicalocales
|
|
130
|
+
*/
|
|
131
|
+
locale: string
|
|
132
|
+
/**
|
|
133
|
+
* A valid IANA time zone identifier used to resolve relative and absolute
|
|
134
|
+
* date expressions to a specific point in time. Examples include
|
|
135
|
+
* "America/New_York", "Europe/Paris", or "Asia/Tokyo".
|
|
136
|
+
*
|
|
137
|
+
* This ensures phrases like "tomorrow at 9am" are interpreted correctly
|
|
138
|
+
* based on the user's local time.
|
|
139
|
+
*
|
|
140
|
+
* @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
141
|
+
*/
|
|
142
|
+
timeZone: string
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Controls how much variance the instructions will run with.
|
|
146
|
+
*
|
|
147
|
+
* Value must be in the range [0, 1] (inclusive).
|
|
148
|
+
*
|
|
149
|
+
* Defaults:
|
|
150
|
+
* - generate: 0.3
|
|
151
|
+
* - translate: 0
|
|
152
|
+
* - transform: 0
|
|
153
|
+
*/
|
|
154
|
+
temperature?: number
|
|
155
|
+
}
|
|
156
|
+
|
|
70
157
|
/** @public */
|
|
71
158
|
declare class AgentActionsClient {
|
|
72
159
|
#private
|
|
@@ -112,6 +199,30 @@ declare class AgentActionsClient {
|
|
|
112
199
|
>
|
|
113
200
|
}
|
|
114
201
|
|
|
202
|
+
/** @beta */
|
|
203
|
+
export declare interface AgentActionSync {
|
|
204
|
+
/**
|
|
205
|
+
* By default, noWrite: false.
|
|
206
|
+
* Write enabled operations will mutate the target document, and emit AI presence in the studio.
|
|
207
|
+
*
|
|
208
|
+
* When noWrite: true, the api will not mutate any documents nor emit presence.
|
|
209
|
+
* Ie, when true, no changes will be made to content-lake
|
|
210
|
+
*
|
|
211
|
+
* noWrite: true is incompatible with async: true,
|
|
212
|
+
* as noWrite implies that you will use the return value of the operation
|
|
213
|
+
*/
|
|
214
|
+
noWrite?: boolean
|
|
215
|
+
/**
|
|
216
|
+
* When async: true, requests responds with status 201 and {_id} as response body as soon as the request is validated.
|
|
217
|
+
* The instruction operation will carry on in the background.
|
|
218
|
+
*
|
|
219
|
+
* When async: false (default), requests respond with status 200 and the document value after instruction has been applied.
|
|
220
|
+
*
|
|
221
|
+
* async: true is incompatible with noWrite: true, as async: true does not return the resulting document
|
|
222
|
+
*/
|
|
223
|
+
async?: false
|
|
224
|
+
}
|
|
225
|
+
|
|
115
226
|
/**
|
|
116
227
|
* @beta
|
|
117
228
|
*/
|
|
@@ -164,7 +275,24 @@ export declare interface AgentActionTarget {
|
|
|
164
275
|
}
|
|
165
276
|
|
|
166
277
|
/** @beta */
|
|
167
|
-
declare
|
|
278
|
+
export declare interface AgentActionTargetInclude {
|
|
279
|
+
path: AgentActionPathSegment | AgentActionPath
|
|
280
|
+
/**
|
|
281
|
+
* By default, all children up to `target.maxPathDepth` are included.
|
|
282
|
+
* Fields or array items not on the exclude list, are implicitly included.
|
|
283
|
+
*/
|
|
284
|
+
exclude?: AgentActionPathSegment[]
|
|
285
|
+
/**
|
|
286
|
+
* Types can be used to exclude array item types or all fields directly under the target path of a certain type.
|
|
287
|
+
* If you do exclude: ['string'] all string fields under the target will be excluded, for instance.
|
|
288
|
+
*
|
|
289
|
+
* `types.include` and `types.exclude` are mutually exclusive.
|
|
290
|
+
*/
|
|
291
|
+
types?: AgentActionTypeConfig
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/** @beta */
|
|
295
|
+
export declare type AgentActionTypeConfig =
|
|
168
296
|
| {
|
|
169
297
|
include: string[]
|
|
170
298
|
exclude?: never
|
|
@@ -1025,12 +1153,10 @@ export declare type FirstDocumentMutationOptions = BaseMutationOptions & {
|
|
|
1025
1153
|
}
|
|
1026
1154
|
|
|
1027
1155
|
/** @beta */
|
|
1028
|
-
declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1029
|
-
|
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
GenerateRequestBase &
|
|
1033
|
-
AgentActionAsync
|
|
1156
|
+
export declare type GenerateAsyncInstruction<T extends Record<string, Any> = Record<string, Any>> =
|
|
1157
|
+
(GenerateExistingDocumentRequest | GenerateCreateDocumentRequest<T>) &
|
|
1158
|
+
GenerateRequestBase &
|
|
1159
|
+
AgentActionAsync_2
|
|
1034
1160
|
|
|
1035
1161
|
/**
|
|
1036
1162
|
* Instruction to create a new document
|
|
@@ -1065,7 +1191,7 @@ export declare type GenerateInstruction<T extends Record<string, Any> = Record<s
|
|
|
1065
1191
|
export declare type GenerateOperation = 'set' | 'append' | 'mixed'
|
|
1066
1192
|
|
|
1067
1193
|
/** @beta */
|
|
1068
|
-
declare interface GenerateRequestBase extends
|
|
1194
|
+
export declare interface GenerateRequestBase extends AgentActionRequestBase_2 {
|
|
1069
1195
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
1070
1196
|
schemaId: string
|
|
1071
1197
|
/** string template using $variable */
|
|
@@ -1089,12 +1215,12 @@ declare interface GenerateRequestBase extends AgentActionRequestBase {
|
|
|
1089
1215
|
}
|
|
1090
1216
|
|
|
1091
1217
|
/** @beta */
|
|
1092
|
-
declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1218
|
+
export declare type GenerateSyncInstruction<T extends Record<string, Any> = Record<string, Any>> = (
|
|
1093
1219
|
| GenerateExistingDocumentRequest
|
|
1094
1220
|
| GenerateCreateDocumentRequest<T>
|
|
1095
1221
|
) &
|
|
1096
1222
|
GenerateRequestBase &
|
|
1097
|
-
|
|
1223
|
+
AgentActionSync_2
|
|
1098
1224
|
|
|
1099
1225
|
/** @beta */
|
|
1100
1226
|
export declare interface GenerateTarget extends AgentActionTarget_2 {
|
|
@@ -1142,7 +1268,7 @@ export declare interface GenerateTarget extends AgentActionTarget_2 {
|
|
|
1142
1268
|
}
|
|
1143
1269
|
|
|
1144
1270
|
/** @beta */
|
|
1145
|
-
export declare interface GenerateTargetInclude extends
|
|
1271
|
+
export declare interface GenerateTargetInclude extends AgentActionTargetInclude_2 {
|
|
1146
1272
|
/**
|
|
1147
1273
|
* Sets the operation for this path, and all its children.
|
|
1148
1274
|
* This overrides any operation set parents or the root target.
|
|
@@ -3569,14 +3695,14 @@ export declare type TransformDocument<T extends Record<string, Any> = Record<str
|
|
|
3569
3695
|
| TransformDocumentAsync
|
|
3570
3696
|
|
|
3571
3697
|
/** @beta */
|
|
3572
|
-
declare type TransformDocumentAsync = TransformRequestBase &
|
|
3698
|
+
export declare type TransformDocumentAsync = TransformRequestBase & AgentActionAsync_2
|
|
3573
3699
|
|
|
3574
3700
|
/** @beta */
|
|
3575
|
-
declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3576
|
-
TransformRequestBase &
|
|
3701
|
+
export declare type TransformDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3702
|
+
TransformRequestBase & AgentActionSync_2
|
|
3577
3703
|
|
|
3578
3704
|
/** @beta */
|
|
3579
|
-
declare interface TransformRequestBase extends
|
|
3705
|
+
export declare interface TransformRequestBase extends AgentActionRequestBase_2 {
|
|
3580
3706
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
3581
3707
|
schemaId: string
|
|
3582
3708
|
documentId: string
|
|
@@ -3635,7 +3761,7 @@ export declare type TransformTargetDocument =
|
|
|
3635
3761
|
}
|
|
3636
3762
|
|
|
3637
3763
|
/** @beta */
|
|
3638
|
-
export declare interface TransformTargetInclude extends
|
|
3764
|
+
export declare interface TransformTargetInclude extends AgentActionTargetInclude_2 {
|
|
3639
3765
|
/** string template using $variable from instructionParams */
|
|
3640
3766
|
transformation?: string
|
|
3641
3767
|
/**
|
|
@@ -3654,20 +3780,20 @@ export declare type TranslateDocument<T extends Record<string, Any> = Record<str
|
|
|
3654
3780
|
| TranslateDocumentAsync
|
|
3655
3781
|
|
|
3656
3782
|
/** @beta */
|
|
3657
|
-
declare type TranslateDocumentAsync = TranslateRequestBase &
|
|
3783
|
+
export declare type TranslateDocumentAsync = TranslateRequestBase & AgentActionAsync_2
|
|
3658
3784
|
|
|
3659
3785
|
/** @beta */
|
|
3660
|
-
declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3661
|
-
TranslateRequestBase &
|
|
3786
|
+
export declare type TranslateDocumentSync<T extends Record<string, Any> = Record<string, Any>> =
|
|
3787
|
+
TranslateRequestBase & AgentActionSync_2
|
|
3662
3788
|
|
|
3663
3789
|
/** @beta */
|
|
3664
|
-
declare interface TranslateLanguage {
|
|
3790
|
+
export declare interface TranslateLanguage {
|
|
3665
3791
|
id: string
|
|
3666
3792
|
title?: string
|
|
3667
3793
|
}
|
|
3668
3794
|
|
|
3669
3795
|
/** @beta */
|
|
3670
|
-
declare interface TranslateRequestBase extends
|
|
3796
|
+
export declare interface TranslateRequestBase extends AgentActionRequestBase_2 {
|
|
3671
3797
|
/** schemaId as reported by sanity deploy / sanity schema store */
|
|
3672
3798
|
schemaId: string
|
|
3673
3799
|
documentId: string
|
|
@@ -3711,7 +3837,7 @@ export declare interface TranslateTarget extends AgentActionTarget {
|
|
|
3711
3837
|
}
|
|
3712
3838
|
|
|
3713
3839
|
/** @beta */
|
|
3714
|
-
export declare interface TranslateTargetInclude extends
|
|
3840
|
+
export declare interface TranslateTargetInclude extends AgentActionTargetInclude_2 {
|
|
3715
3841
|
/** string template using $variable from instructionParams */
|
|
3716
3842
|
styleGuide?: string
|
|
3717
3843
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -1668,7 +1668,7 @@ function defineDeprecatedCreateClient(createClient2) {
|
|
|
1668
1668
|
return config.printNoDefaultExport(), createClient2(config$1);
|
|
1669
1669
|
};
|
|
1670
1670
|
}
|
|
1671
|
-
var name = "@sanity/client", version = "6.29.0-generate.
|
|
1671
|
+
var name = "@sanity/client", version = "6.29.0-generate.5";
|
|
1672
1672
|
const middleware = [
|
|
1673
1673
|
middleware$1.debug({ verbose: !0, namespace: "sanity:client" }),
|
|
1674
1674
|
middleware$1.headers({ "User-Agent": `${name} ${version}` }),
|