@vcp-dev/contracts 0.4.0 → 0.4.1
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/colorway-distinctness.js +1 -1
- package/dist/connect-dynamic-collection.d.ts +6 -0
- package/dist/connect-form.d.ts +6 -0
- package/dist/design-tokens.d.ts +26 -0
- package/dist/design-tokens.js +1 -1
- package/dist/index.d.ts +1004 -144
- package/dist/index.js +1 -1
- package/dist/input-context-bundle.d.ts +250 -0
- package/dist/site-edit-event.d.ts +8 -0
- package/dist/site-edit-operation.d.ts +84 -2
- package/dist/site-edit-patch-plan.d.ts +2 -2
- package/dist/site-edit-render-document.d.ts +8 -0
- package/dist/site-edit-source.d.ts +170 -0
- package/dist/site-edit-version.d.ts +1 -1
- package/dist/site-locale.d.ts +2 -47
- package/package.json +2 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const InputSourceTypeSchema: z.ZodEnum<{
|
|
3
|
+
text: "text";
|
|
4
|
+
url: "url";
|
|
5
|
+
document: "document";
|
|
6
|
+
image: "image";
|
|
7
|
+
}>;
|
|
8
|
+
export type InputSourceType = z.infer<typeof InputSourceTypeSchema>;
|
|
9
|
+
export declare const InputSourceStatusSchema: z.ZodEnum<{
|
|
10
|
+
ready: "ready";
|
|
11
|
+
failed: "failed";
|
|
12
|
+
pending: "pending";
|
|
13
|
+
}>;
|
|
14
|
+
export type InputSourceStatus = z.infer<typeof InputSourceStatusSchema>;
|
|
15
|
+
export declare const InputBundleStatusSchema: z.ZodEnum<{
|
|
16
|
+
ready: "ready";
|
|
17
|
+
failed: "failed";
|
|
18
|
+
pending: "pending";
|
|
19
|
+
}>;
|
|
20
|
+
export type InputBundleStatus = z.infer<typeof InputBundleStatusSchema>;
|
|
21
|
+
export declare const ExtractedFactKindSchema: z.ZodEnum<{
|
|
22
|
+
product: "product";
|
|
23
|
+
price: "price";
|
|
24
|
+
contact: "contact";
|
|
25
|
+
copy: "copy";
|
|
26
|
+
audience: "audience";
|
|
27
|
+
other: "other";
|
|
28
|
+
}>;
|
|
29
|
+
export declare const ExtractedFactSchema: z.ZodObject<{
|
|
30
|
+
fact: z.ZodString;
|
|
31
|
+
kind: z.ZodEnum<{
|
|
32
|
+
product: "product";
|
|
33
|
+
price: "price";
|
|
34
|
+
contact: "contact";
|
|
35
|
+
copy: "copy";
|
|
36
|
+
audience: "audience";
|
|
37
|
+
other: "other";
|
|
38
|
+
}>;
|
|
39
|
+
source_id: z.ZodString;
|
|
40
|
+
quote: z.ZodString;
|
|
41
|
+
trust: z.ZodDefault<z.ZodEnum<{
|
|
42
|
+
verbatim: "verbatim";
|
|
43
|
+
ocr: "ocr";
|
|
44
|
+
}>>;
|
|
45
|
+
}, z.core.$strip>;
|
|
46
|
+
export type ExtractedFact = z.infer<typeof ExtractedFactSchema>;
|
|
47
|
+
export declare const ReferencePagePatternSchema: z.ZodObject<{
|
|
48
|
+
page_type: z.ZodString;
|
|
49
|
+
sections: z.ZodArray<z.ZodString>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type ReferencePagePattern = z.infer<typeof ReferencePagePatternSchema>;
|
|
52
|
+
export declare const ReferenceSignalsSchema: z.ZodObject<{
|
|
53
|
+
source_id: z.ZodString;
|
|
54
|
+
nav_structure: z.ZodArray<z.ZodString>;
|
|
55
|
+
page_patterns: z.ZodArray<z.ZodObject<{
|
|
56
|
+
page_type: z.ZodString;
|
|
57
|
+
sections: z.ZodArray<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
tone: z.ZodArray<z.ZodString>;
|
|
60
|
+
screenshot_ref: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
export type ReferenceSignals = z.infer<typeof ReferenceSignalsSchema>;
|
|
63
|
+
export declare const InputSourceSchema: z.ZodObject<{
|
|
64
|
+
source_id: z.ZodString;
|
|
65
|
+
type: z.ZodEnum<{
|
|
66
|
+
text: "text";
|
|
67
|
+
url: "url";
|
|
68
|
+
document: "document";
|
|
69
|
+
image: "image";
|
|
70
|
+
}>;
|
|
71
|
+
status: z.ZodEnum<{
|
|
72
|
+
ready: "ready";
|
|
73
|
+
failed: "failed";
|
|
74
|
+
pending: "pending";
|
|
75
|
+
}>;
|
|
76
|
+
title: z.ZodOptional<z.ZodString>;
|
|
77
|
+
original_ref: z.ZodString;
|
|
78
|
+
source_metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
79
|
+
error_code: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
export type InputSource = z.infer<typeof InputSourceSchema>;
|
|
82
|
+
export declare const InputConflictSchema: z.ZodObject<{
|
|
83
|
+
topic: z.ZodString;
|
|
84
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
85
|
+
value: z.ZodString;
|
|
86
|
+
source_id: z.ZodString;
|
|
87
|
+
}, z.core.$strip>>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
export type InputConflict = z.infer<typeof InputConflictSchema>;
|
|
90
|
+
/**
|
|
91
|
+
* `POST /sites/:site_id/input-context/sources` 请求体(M2:text | url 判别联合)。
|
|
92
|
+
*
|
|
93
|
+
* 每个变体 `.strict()` 拒绝多余字段——尤其挡掉浏览器夹带 `source_id` / `status` /
|
|
94
|
+
* `facts` 等服务端权威字段(创建行的 id/status/attempt 全由 service 生成)。
|
|
95
|
+
* - text:`content` 长度闸门(20..10000)与 agent 抽取端点上限对齐;`title` 可选。
|
|
96
|
+
* - url:`url` 为参考站地址。`rights_ack` 是保留字段(供未来「自有站重建」通道):
|
|
97
|
+
* 当前 web UI 已移除采集控件、恒不发送,服务端亦不消费;URL 一律走 reference
|
|
98
|
+
* 管道,即使是自己旧站也只作参考,不开内容搬运通道。
|
|
99
|
+
*/
|
|
100
|
+
export declare const CreateTextInputSourceRequestSchema: z.ZodObject<{
|
|
101
|
+
type: z.ZodLiteral<"text">;
|
|
102
|
+
content: z.ZodString;
|
|
103
|
+
title: z.ZodOptional<z.ZodString>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
export declare const CreateUrlInputSourceRequestSchema: z.ZodObject<{
|
|
106
|
+
type: z.ZodLiteral<"url">;
|
|
107
|
+
url: z.ZodString;
|
|
108
|
+
rights_ack: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
title: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strict>;
|
|
111
|
+
export declare const CreateInputSourceRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
112
|
+
type: z.ZodLiteral<"text">;
|
|
113
|
+
content: z.ZodString;
|
|
114
|
+
title: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
type: z.ZodLiteral<"url">;
|
|
117
|
+
url: z.ZodString;
|
|
118
|
+
rights_ack: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
title: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>], "type">;
|
|
121
|
+
/**
|
|
122
|
+
* 文档上传白名单(M3):扩展名 + MIME 双闸门。**禁 PDF/PPT**——PDF 即使 Firecrawl
|
|
123
|
+
* `/parse` 支持也一律拒(AGENTS.md 硬规则),UI 文案提示导出 DOCX/HTML 后再传。
|
|
124
|
+
* 白名单只放行可安全解析为纯文本/富文本 markdown 的格式。
|
|
125
|
+
*/
|
|
126
|
+
export declare const DOCUMENT_EXTENSION_WHITELIST: readonly [".docx", ".html", ".md", ".txt"];
|
|
127
|
+
export declare const DOCUMENT_MIME_WHITELIST: readonly ["application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/html", "text/markdown", "text/x-markdown", "text/plain", "application/octet-stream"];
|
|
128
|
+
/** 单文件上限 10MB(413);每 site document 类 source 上限 2(409)。 */
|
|
129
|
+
export declare const MAX_DOCUMENT_UPLOAD_BYTES: number;
|
|
130
|
+
export declare const MAX_DOCUMENT_SOURCES_PER_SITE = 2;
|
|
131
|
+
/**
|
|
132
|
+
* `POST /sites/:site_id/input-context/sources/upload` 的表单字段(文件走 multipart
|
|
133
|
+
* `file` 字段,不在此 schema)。**出境单独同意**(PIPL 单独同意可举证,红队 P1-9):
|
|
134
|
+
* `consent_cross_border` 必须显式 `true`(false/缺失 → 422 CONSENT_REQUIRED),
|
|
135
|
+
* `consent_text_version` 记同意文案版本号,落库供取证。
|
|
136
|
+
*
|
|
137
|
+
* multipart/form-data 字段值一律是字符串:`consent_cross_border` 用字面量联合只放行
|
|
138
|
+
* `true` / `"true"`(其余含 `"false"` 一律拒)。**不用 `.transform()`**——会破坏
|
|
139
|
+
* `z.toJSONSchema` → OpenAPI(该 schema 进 `@ApiBody`;见 tasks/lessons.md 教训);
|
|
140
|
+
* 服务端用 `isConsentGranted()` 把 `true`/`"true"` 归一为已同意布尔。
|
|
141
|
+
*/
|
|
142
|
+
export declare const CreateDocumentUploadRequestSchema: z.ZodObject<{
|
|
143
|
+
consent_cross_border: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodLiteral<"true">]>;
|
|
144
|
+
consent_text_version: z.ZodString;
|
|
145
|
+
title: z.ZodOptional<z.ZodString>;
|
|
146
|
+
}, z.core.$strict>;
|
|
147
|
+
export type CreateDocumentUploadRequest = z.infer<typeof CreateDocumentUploadRequestSchema>;
|
|
148
|
+
/** `consent_cross_border` 归一:字面 `true` 或字符串 `"true"` 视为已同意。 */
|
|
149
|
+
export declare function isConsentGranted(value: unknown): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* 图片上传白名单(M4):扩展名 + MIME 双闸门。**只放行 raster**——`.svg` 一律拒
|
|
152
|
+
* (D13/红队 P0:SVG 可携带 script/事件属性/外部引用,素材落站直达生成站 `public/`
|
|
153
|
+
* 即 stored XSS 且不过 L3 AST validator;首版禁上传比 sanitize 更小更稳)。UI 文案
|
|
154
|
+
* 提示「SVG 请转 PNG 后上传」。png/jpg/jpeg/webp 经 sharp 重编码可顺带剥除潜在负载。
|
|
155
|
+
*/
|
|
156
|
+
export declare const IMAGE_EXTENSION_WHITELIST: readonly [".png", ".jpg", ".jpeg", ".webp"];
|
|
157
|
+
export declare const IMAGE_MIME_WHITELIST: readonly ["image/png", "image/jpeg", "image/webp", "application/octet-stream"];
|
|
158
|
+
/** 单图上限 8MB(413);每 site 图片类 source 上限 10(409)。 */
|
|
159
|
+
export declare const MAX_IMAGE_UPLOAD_BYTES: number;
|
|
160
|
+
export declare const MAX_IMAGE_SOURCES_PER_SITE = 10;
|
|
161
|
+
/**
|
|
162
|
+
* 图片素材角色(M4):`asset` = 用户素材(落站,facts OCR 抽取);`reference` = 仅参考
|
|
163
|
+
* (写 `ReferenceSignals` 调性信号,不落站)。方案倾向显式选择,故创建请求必填。
|
|
164
|
+
*/
|
|
165
|
+
export declare const ImageRoleSchema: z.ZodEnum<{
|
|
166
|
+
asset: "asset";
|
|
167
|
+
reference: "reference";
|
|
168
|
+
}>;
|
|
169
|
+
export type ImageRole = z.infer<typeof ImageRoleSchema>;
|
|
170
|
+
/**
|
|
171
|
+
* `POST /sites/:site_id/input-context/sources/upload-image` 的表单字段(图片二进制走
|
|
172
|
+
* multipart `file` 字段,不在此 schema)。`image_role` 必填(素材/仅参考显式选择)。
|
|
173
|
+
* `.strict()` 挡浏览器夹带 `source_id`/`status` 等服务端权威字段。**不用
|
|
174
|
+
* `.transform()`**——会破坏 `z.toJSONSchema` → OpenAPI(该 schema 进 `@ApiBody`)。
|
|
175
|
+
*/
|
|
176
|
+
export declare const CreateImageUploadRequestSchema: z.ZodObject<{
|
|
177
|
+
image_role: z.ZodEnum<{
|
|
178
|
+
asset: "asset";
|
|
179
|
+
reference: "reference";
|
|
180
|
+
}>;
|
|
181
|
+
title: z.ZodOptional<z.ZodString>;
|
|
182
|
+
}, z.core.$strict>;
|
|
183
|
+
export type CreateImageUploadRequest = z.infer<typeof CreateImageUploadRequestSchema>;
|
|
184
|
+
export type CreateInputSourceRequest = z.infer<typeof CreateInputSourceRequestSchema>;
|
|
185
|
+
export type CreateTextInputSourceRequest = z.infer<typeof CreateTextInputSourceRequestSchema>;
|
|
186
|
+
export type CreateUrlInputSourceRequest = z.infer<typeof CreateUrlInputSourceRequestSchema>;
|
|
187
|
+
export declare const InputContextBundleSchema: z.ZodObject<{
|
|
188
|
+
version: z.ZodLiteral<1>;
|
|
189
|
+
site_id: z.ZodString;
|
|
190
|
+
tenant_id: z.ZodString;
|
|
191
|
+
user_prompt: z.ZodString;
|
|
192
|
+
status: z.ZodEnum<{
|
|
193
|
+
ready: "ready";
|
|
194
|
+
failed: "failed";
|
|
195
|
+
pending: "pending";
|
|
196
|
+
}>;
|
|
197
|
+
sources: z.ZodArray<z.ZodObject<{
|
|
198
|
+
source_id: z.ZodString;
|
|
199
|
+
type: z.ZodEnum<{
|
|
200
|
+
text: "text";
|
|
201
|
+
url: "url";
|
|
202
|
+
document: "document";
|
|
203
|
+
image: "image";
|
|
204
|
+
}>;
|
|
205
|
+
status: z.ZodEnum<{
|
|
206
|
+
ready: "ready";
|
|
207
|
+
failed: "failed";
|
|
208
|
+
pending: "pending";
|
|
209
|
+
}>;
|
|
210
|
+
title: z.ZodOptional<z.ZodString>;
|
|
211
|
+
original_ref: z.ZodString;
|
|
212
|
+
source_metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
213
|
+
error_code: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, z.core.$strip>>;
|
|
215
|
+
facts: z.ZodArray<z.ZodObject<{
|
|
216
|
+
fact: z.ZodString;
|
|
217
|
+
kind: z.ZodEnum<{
|
|
218
|
+
product: "product";
|
|
219
|
+
price: "price";
|
|
220
|
+
contact: "contact";
|
|
221
|
+
copy: "copy";
|
|
222
|
+
audience: "audience";
|
|
223
|
+
other: "other";
|
|
224
|
+
}>;
|
|
225
|
+
source_id: z.ZodString;
|
|
226
|
+
quote: z.ZodString;
|
|
227
|
+
trust: z.ZodDefault<z.ZodEnum<{
|
|
228
|
+
verbatim: "verbatim";
|
|
229
|
+
ocr: "ocr";
|
|
230
|
+
}>>;
|
|
231
|
+
}, z.core.$strip>>;
|
|
232
|
+
reference: z.ZodOptional<z.ZodObject<{
|
|
233
|
+
source_id: z.ZodString;
|
|
234
|
+
nav_structure: z.ZodArray<z.ZodString>;
|
|
235
|
+
page_patterns: z.ZodArray<z.ZodObject<{
|
|
236
|
+
page_type: z.ZodString;
|
|
237
|
+
sections: z.ZodArray<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
239
|
+
tone: z.ZodArray<z.ZodString>;
|
|
240
|
+
screenshot_ref: z.ZodOptional<z.ZodString>;
|
|
241
|
+
}, z.core.$strip>>;
|
|
242
|
+
conflicts: z.ZodArray<z.ZodObject<{
|
|
243
|
+
topic: z.ZodString;
|
|
244
|
+
variants: z.ZodArray<z.ZodObject<{
|
|
245
|
+
value: z.ZodString;
|
|
246
|
+
source_id: z.ZodString;
|
|
247
|
+
}, z.core.$strip>>;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
export type InputContextBundle = z.infer<typeof InputContextBundleSchema>;
|
|
@@ -20,12 +20,14 @@ export declare const SiteEditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
20
20
|
requestId: z.ZodString;
|
|
21
21
|
kind: z.ZodEnum<{
|
|
22
22
|
"update-text": "update-text";
|
|
23
|
+
"update-array-item": "update-array-item";
|
|
23
24
|
"remove-node": "remove-node";
|
|
24
25
|
"insert-child": "insert-child";
|
|
25
26
|
"move-node": "move-node";
|
|
26
27
|
"set-class-name-source": "set-class-name-source";
|
|
27
28
|
"set-props": "set-props";
|
|
28
29
|
"apply-style-draft": "apply-style-draft";
|
|
30
|
+
"source-edit": "source-edit";
|
|
29
31
|
}>;
|
|
30
32
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
31
33
|
kind: z.ZodLiteral<"node">;
|
|
@@ -33,6 +35,12 @@ export declare const SiteEditEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
33
35
|
}, z.core.$strip>, z.ZodObject<{
|
|
34
36
|
kind: z.ZodLiteral<"route">;
|
|
35
37
|
routeId: z.ZodString;
|
|
38
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
39
|
+
kind: z.ZodLiteral<"source-file">;
|
|
40
|
+
path: z.ZodString;
|
|
41
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
+
kind: z.ZodLiteral<"source-batch">;
|
|
43
|
+
paths: z.ZodArray<z.ZodString>;
|
|
36
44
|
}, z.core.$strip>], "kind">;
|
|
37
45
|
resultVersion: z.ZodNumber;
|
|
38
46
|
affectedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2,12 +2,14 @@ import { z } from "zod";
|
|
|
2
2
|
import { type SiteEditCommandResult } from "./site-edit-command-result.js";
|
|
3
3
|
export declare const SiteEditOperationTypeSchema: z.ZodEnum<{
|
|
4
4
|
"update-text": "update-text";
|
|
5
|
+
"update-array-item": "update-array-item";
|
|
5
6
|
"remove-node": "remove-node";
|
|
6
7
|
"insert-child": "insert-child";
|
|
7
8
|
"move-node": "move-node";
|
|
8
9
|
"set-class-name-source": "set-class-name-source";
|
|
9
10
|
"set-props": "set-props";
|
|
10
11
|
"apply-style-draft": "apply-style-draft";
|
|
12
|
+
"source-edit": "source-edit";
|
|
11
13
|
}>;
|
|
12
14
|
export type SiteEditOperationType = z.infer<typeof SiteEditOperationTypeSchema>;
|
|
13
15
|
export type SiteEditOperationValue = string | number | boolean | null | SiteEditOperationValue[] | {
|
|
@@ -20,6 +22,12 @@ export declare const SiteEditOperationTargetSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
20
22
|
}, z.core.$strip>, z.ZodObject<{
|
|
21
23
|
kind: z.ZodLiteral<"route">;
|
|
22
24
|
routeId: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"source-file">;
|
|
27
|
+
path: z.ZodString;
|
|
28
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
+
kind: z.ZodLiteral<"source-batch">;
|
|
30
|
+
paths: z.ZodArray<z.ZodString>;
|
|
23
31
|
}, z.core.$strip>], "kind">;
|
|
24
32
|
export type SiteEditOperationTarget = z.infer<typeof SiteEditOperationTargetSchema>;
|
|
25
33
|
export declare const SiteEditStylePropertySchema: z.ZodEnum<{
|
|
@@ -167,6 +175,11 @@ export declare const SiteEditOperationParamsSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
167
175
|
kind: z.ZodLiteral<"update-text">;
|
|
168
176
|
segmentIndex: z.ZodNumber;
|
|
169
177
|
value: z.ZodString;
|
|
178
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"update-array-item">;
|
|
180
|
+
segmentIndex: z.ZodNumber;
|
|
181
|
+
index: z.ZodNumber;
|
|
182
|
+
value: z.ZodString;
|
|
170
183
|
}, z.core.$strip>, z.ZodObject<{
|
|
171
184
|
kind: z.ZodLiteral<"remove-node">;
|
|
172
185
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -308,7 +321,27 @@ export declare const SiteEditOperationParamsSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
308
321
|
width: "width";
|
|
309
322
|
height: "height";
|
|
310
323
|
}> & z.core.$partial, z.ZodString>>;
|
|
311
|
-
}, z.core.$strip
|
|
324
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
325
|
+
kind: z.ZodLiteral<"source-edit">;
|
|
326
|
+
conflictPolicy: z.ZodEnum<{
|
|
327
|
+
"compare-and-swap": "compare-and-swap";
|
|
328
|
+
overwrite: "overwrite";
|
|
329
|
+
}>;
|
|
330
|
+
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
331
|
+
operation: z.ZodLiteral<"upsert">;
|
|
332
|
+
path: z.ZodString;
|
|
333
|
+
content: z.ZodString;
|
|
334
|
+
baseContentHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
336
|
+
operation: z.ZodLiteral<"delete">;
|
|
337
|
+
path: z.ZodString;
|
|
338
|
+
capability: z.ZodLiteral<"source-delete">;
|
|
339
|
+
confirmDelete: z.ZodLiteral<true>;
|
|
340
|
+
confirmPath: z.ZodString;
|
|
341
|
+
baseContentHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
342
|
+
}, z.core.$strict>], "operation">>;
|
|
343
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
344
|
+
}, z.core.$strict>], "kind">;
|
|
312
345
|
export type SiteEditOperationParams = z.infer<typeof SiteEditOperationParamsSchema>;
|
|
313
346
|
export declare const SiteEditOperationErrorCodeSchema: z.ZodEnum<{
|
|
314
347
|
NODE_NOT_FOUND: "NODE_NOT_FOUND";
|
|
@@ -363,12 +396,14 @@ export declare const SiteEditOperationRequestSchema: z.ZodObject<{
|
|
|
363
396
|
routeId: z.ZodOptional<z.ZodString>;
|
|
364
397
|
kind: z.ZodEnum<{
|
|
365
398
|
"update-text": "update-text";
|
|
399
|
+
"update-array-item": "update-array-item";
|
|
366
400
|
"remove-node": "remove-node";
|
|
367
401
|
"insert-child": "insert-child";
|
|
368
402
|
"move-node": "move-node";
|
|
369
403
|
"set-class-name-source": "set-class-name-source";
|
|
370
404
|
"set-props": "set-props";
|
|
371
405
|
"apply-style-draft": "apply-style-draft";
|
|
406
|
+
"source-edit": "source-edit";
|
|
372
407
|
}>;
|
|
373
408
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
374
409
|
kind: z.ZodLiteral<"node">;
|
|
@@ -376,6 +411,12 @@ export declare const SiteEditOperationRequestSchema: z.ZodObject<{
|
|
|
376
411
|
}, z.core.$strip>, z.ZodObject<{
|
|
377
412
|
kind: z.ZodLiteral<"route">;
|
|
378
413
|
routeId: z.ZodString;
|
|
414
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
415
|
+
kind: z.ZodLiteral<"source-file">;
|
|
416
|
+
path: z.ZodString;
|
|
417
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
418
|
+
kind: z.ZodLiteral<"source-batch">;
|
|
419
|
+
paths: z.ZodArray<z.ZodString>;
|
|
379
420
|
}, z.core.$strip>], "kind">;
|
|
380
421
|
documentVersion: z.ZodNumber;
|
|
381
422
|
selectionRef: z.ZodOptional<z.ZodObject<{
|
|
@@ -387,6 +428,11 @@ export declare const SiteEditOperationRequestSchema: z.ZodObject<{
|
|
|
387
428
|
kind: z.ZodLiteral<"update-text">;
|
|
388
429
|
segmentIndex: z.ZodNumber;
|
|
389
430
|
value: z.ZodString;
|
|
431
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
432
|
+
kind: z.ZodLiteral<"update-array-item">;
|
|
433
|
+
segmentIndex: z.ZodNumber;
|
|
434
|
+
index: z.ZodNumber;
|
|
435
|
+
value: z.ZodString;
|
|
390
436
|
}, z.core.$strip>, z.ZodObject<{
|
|
391
437
|
kind: z.ZodLiteral<"remove-node">;
|
|
392
438
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -528,19 +574,41 @@ export declare const SiteEditOperationRequestSchema: z.ZodObject<{
|
|
|
528
574
|
width: "width";
|
|
529
575
|
height: "height";
|
|
530
576
|
}> & z.core.$partial, z.ZodString>>;
|
|
531
|
-
}, z.core.$strip
|
|
577
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
578
|
+
kind: z.ZodLiteral<"source-edit">;
|
|
579
|
+
conflictPolicy: z.ZodEnum<{
|
|
580
|
+
"compare-and-swap": "compare-and-swap";
|
|
581
|
+
overwrite: "overwrite";
|
|
582
|
+
}>;
|
|
583
|
+
edits: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
584
|
+
operation: z.ZodLiteral<"upsert">;
|
|
585
|
+
path: z.ZodString;
|
|
586
|
+
content: z.ZodString;
|
|
587
|
+
baseContentHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
588
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
589
|
+
operation: z.ZodLiteral<"delete">;
|
|
590
|
+
path: z.ZodString;
|
|
591
|
+
capability: z.ZodLiteral<"source-delete">;
|
|
592
|
+
confirmDelete: z.ZodLiteral<true>;
|
|
593
|
+
confirmPath: z.ZodString;
|
|
594
|
+
baseContentHash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
595
|
+
}, z.core.$strict>], "operation">>;
|
|
596
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
597
|
+
}, z.core.$strict>], "kind">;
|
|
532
598
|
}, z.core.$strip>;
|
|
533
599
|
export type SiteEditOperationRequest = z.infer<typeof SiteEditOperationRequestSchema>;
|
|
534
600
|
export declare const SiteEditOperationPayloadSchema: z.ZodObject<{
|
|
535
601
|
requestId: z.ZodString;
|
|
536
602
|
kind: z.ZodEnum<{
|
|
537
603
|
"update-text": "update-text";
|
|
604
|
+
"update-array-item": "update-array-item";
|
|
538
605
|
"remove-node": "remove-node";
|
|
539
606
|
"insert-child": "insert-child";
|
|
540
607
|
"move-node": "move-node";
|
|
541
608
|
"set-class-name-source": "set-class-name-source";
|
|
542
609
|
"set-props": "set-props";
|
|
543
610
|
"apply-style-draft": "apply-style-draft";
|
|
611
|
+
"source-edit": "source-edit";
|
|
544
612
|
}>;
|
|
545
613
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
546
614
|
kind: z.ZodLiteral<"node">;
|
|
@@ -548,6 +616,12 @@ export declare const SiteEditOperationPayloadSchema: z.ZodObject<{
|
|
|
548
616
|
}, z.core.$strip>, z.ZodObject<{
|
|
549
617
|
kind: z.ZodLiteral<"route">;
|
|
550
618
|
routeId: z.ZodString;
|
|
619
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
620
|
+
kind: z.ZodLiteral<"source-file">;
|
|
621
|
+
path: z.ZodString;
|
|
622
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
623
|
+
kind: z.ZodLiteral<"source-batch">;
|
|
624
|
+
paths: z.ZodArray<z.ZodString>;
|
|
551
625
|
}, z.core.$strip>], "kind">;
|
|
552
626
|
resultVersion: z.ZodNumber;
|
|
553
627
|
affectedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -564,12 +638,14 @@ export declare const SiteEditOperationCommandResultSchema: z.ZodDiscriminatedUni
|
|
|
564
638
|
requestId: z.ZodString;
|
|
565
639
|
kind: z.ZodEnum<{
|
|
566
640
|
"update-text": "update-text";
|
|
641
|
+
"update-array-item": "update-array-item";
|
|
567
642
|
"remove-node": "remove-node";
|
|
568
643
|
"insert-child": "insert-child";
|
|
569
644
|
"move-node": "move-node";
|
|
570
645
|
"set-class-name-source": "set-class-name-source";
|
|
571
646
|
"set-props": "set-props";
|
|
572
647
|
"apply-style-draft": "apply-style-draft";
|
|
648
|
+
"source-edit": "source-edit";
|
|
573
649
|
}>;
|
|
574
650
|
target: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
575
651
|
kind: z.ZodLiteral<"node">;
|
|
@@ -577,6 +653,12 @@ export declare const SiteEditOperationCommandResultSchema: z.ZodDiscriminatedUni
|
|
|
577
653
|
}, z.core.$strip>, z.ZodObject<{
|
|
578
654
|
kind: z.ZodLiteral<"route">;
|
|
579
655
|
routeId: z.ZodString;
|
|
656
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
657
|
+
kind: z.ZodLiteral<"source-file">;
|
|
658
|
+
path: z.ZodString;
|
|
659
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
660
|
+
kind: z.ZodLiteral<"source-batch">;
|
|
661
|
+
paths: z.ZodArray<z.ZodString>;
|
|
580
662
|
}, z.core.$strip>], "kind">;
|
|
581
663
|
resultVersion: z.ZodNumber;
|
|
582
664
|
affectedFiles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -2,9 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const SiteEditPatchPlanPatchSchema: z.ZodObject<{
|
|
3
3
|
path: z.ZodString;
|
|
4
4
|
operation: z.ZodEnum<{
|
|
5
|
+
delete: "delete";
|
|
5
6
|
create: "create";
|
|
6
7
|
update: "update";
|
|
7
|
-
delete: "delete";
|
|
8
8
|
}>;
|
|
9
9
|
expectedHash: z.ZodOptional<z.ZodString>;
|
|
10
10
|
fullContent: z.ZodOptional<z.ZodString>;
|
|
@@ -18,9 +18,9 @@ export declare const SiteEditPatchPlanSchema: z.ZodObject<{
|
|
|
18
18
|
patches: z.ZodArray<z.ZodObject<{
|
|
19
19
|
path: z.ZodString;
|
|
20
20
|
operation: z.ZodEnum<{
|
|
21
|
+
delete: "delete";
|
|
21
22
|
create: "create";
|
|
22
23
|
update: "update";
|
|
23
|
-
delete: "delete";
|
|
24
24
|
}>;
|
|
25
25
|
expectedHash: z.ZodOptional<z.ZodString>;
|
|
26
26
|
fullContent: z.ZodOptional<z.ZodString>;
|
|
@@ -377,12 +377,14 @@ export declare const SiteEditStyleModelSchema: z.ZodUnion<readonly [z.ZodRecord<
|
|
|
377
377
|
}, z.core.$strip>>>;
|
|
378
378
|
operationBoundary: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
379
379
|
"update-text": "update-text";
|
|
380
|
+
"update-array-item": "update-array-item";
|
|
380
381
|
"remove-node": "remove-node";
|
|
381
382
|
"insert-child": "insert-child";
|
|
382
383
|
"move-node": "move-node";
|
|
383
384
|
"set-class-name-source": "set-class-name-source";
|
|
384
385
|
"set-props": "set-props";
|
|
385
386
|
"apply-style-draft": "apply-style-draft";
|
|
387
|
+
"source-edit": "source-edit";
|
|
386
388
|
}>>>;
|
|
387
389
|
}, z.core.$strip>>;
|
|
388
390
|
}, z.core.$strip>]>;
|
|
@@ -399,12 +401,14 @@ export declare const SiteEditStyleSourceSchema: z.ZodObject<{
|
|
|
399
401
|
editable: z.ZodBoolean;
|
|
400
402
|
operationBoundary: z.ZodArray<z.ZodEnum<{
|
|
401
403
|
"update-text": "update-text";
|
|
404
|
+
"update-array-item": "update-array-item";
|
|
402
405
|
"remove-node": "remove-node";
|
|
403
406
|
"insert-child": "insert-child";
|
|
404
407
|
"move-node": "move-node";
|
|
405
408
|
"set-class-name-source": "set-class-name-source";
|
|
406
409
|
"set-props": "set-props";
|
|
407
410
|
"apply-style-draft": "apply-style-draft";
|
|
411
|
+
"source-edit": "source-edit";
|
|
408
412
|
}>>;
|
|
409
413
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
410
414
|
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -629,12 +633,14 @@ export declare const SiteEditObjectDetailSchema: z.ZodObject<{
|
|
|
629
633
|
editable: z.ZodBoolean;
|
|
630
634
|
operationBoundary: z.ZodArray<z.ZodEnum<{
|
|
631
635
|
"update-text": "update-text";
|
|
636
|
+
"update-array-item": "update-array-item";
|
|
632
637
|
"remove-node": "remove-node";
|
|
633
638
|
"insert-child": "insert-child";
|
|
634
639
|
"move-node": "move-node";
|
|
635
640
|
"set-class-name-source": "set-class-name-source";
|
|
636
641
|
"set-props": "set-props";
|
|
637
642
|
"apply-style-draft": "apply-style-draft";
|
|
643
|
+
"source-edit": "source-edit";
|
|
638
644
|
}>>;
|
|
639
645
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
640
646
|
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -956,12 +962,14 @@ export declare const SiteEditObjectStyleDetailSchema: z.ZodObject<{
|
|
|
956
962
|
editable: z.ZodBoolean;
|
|
957
963
|
operationBoundary: z.ZodArray<z.ZodEnum<{
|
|
958
964
|
"update-text": "update-text";
|
|
965
|
+
"update-array-item": "update-array-item";
|
|
959
966
|
"remove-node": "remove-node";
|
|
960
967
|
"insert-child": "insert-child";
|
|
961
968
|
"move-node": "move-node";
|
|
962
969
|
"set-class-name-source": "set-class-name-source";
|
|
963
970
|
"set-props": "set-props";
|
|
964
971
|
"apply-style-draft": "apply-style-draft";
|
|
972
|
+
"source-edit": "source-edit";
|
|
965
973
|
}>>;
|
|
966
974
|
sourcePath: z.ZodOptional<z.ZodString>;
|
|
967
975
|
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|