@vcp-dev/contracts 0.7.0 → 0.7.2

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.
@@ -0,0 +1,76 @@
1
+ import { z } from "zod";
2
+ /** 一份快照在 store 上的定位坐标。**没有 store 根**:那是被调用方自己的挂载点。 */
3
+ declare const SnapshotRefSchema: z.ZodObject<{
4
+ snapshot_id: z.ZodString;
5
+ object_key: z.ZodString;
6
+ }, z.core.$strip>;
7
+ export type SubsiteSyncDiffSnapshotRef = z.infer<typeof SnapshotRefSchema>;
8
+ /**
9
+ * 请求体。`base` 是子站当前快照(差集的被减数),`target` 是主站目标快照
10
+ * (已发布优先,未发布回落 current)——两者都由 apps/api 在带 `tenant_id` 过滤的
11
+ * where 下解析出来,是「跨租户 object key 不可能出现」这条保证的唯一来源。
12
+ *
13
+ * 刻意**不接受** `sync_enabled`:那是主库 `sites` 上的用户开关,subsite-service
14
+ * 不读主库、对它没有任何裁决权。让它在这条通道上来回一趟只会让人误以为编排服务
15
+ * 参与了那个判断。开关状态由 apps/api 自己补进对外响应。
16
+ */
17
+ export declare const SubsiteSyncDiffComputeRequestSchema: z.ZodObject<{
18
+ tenant_id: z.ZodString;
19
+ parent_site_id: z.ZodString;
20
+ subsite_site_id: z.ZodString;
21
+ base: z.ZodObject<{
22
+ snapshot_id: z.ZodString;
23
+ object_key: z.ZodString;
24
+ }, z.core.$strip>;
25
+ target: z.ZodObject<{
26
+ snapshot_id: z.ZodString;
27
+ object_key: z.ZodString;
28
+ }, z.core.$strip>;
29
+ }, z.core.$strip>;
30
+ export type SubsiteSyncDiffComputeRequest = z.infer<typeof SubsiteSyncDiffComputeRequestSchema>;
31
+ /**
32
+ * 响应体。**绝不回带 `object_key`、store 绝对路径或内部堆栈**:调用方(apps/api)
33
+ * 那两个值本来就是自己传进去的,回显它们只会平白多一条把挂载点形状泄漏出去的路。
34
+ *
35
+ * `hash_diverged_count` / `child_only_count` 是原始读数,只出计数不出路径清单
36
+ * ——子站文件是主站文件的译文,同路径 hash 天然不同,把它当「主站改了 N 页」展示
37
+ * 是 100% 误报(口径见 apps/api 的 `SubsiteSyncDiffResponseSchema` 描述)。
38
+ */
39
+ export declare const SubsiteSyncDiffComputeResponseSchema: z.ZodObject<{
40
+ subsite_site_id: z.ZodString;
41
+ pending_pages: z.ZodArray<z.ZodString>;
42
+ hash_diverged_count: z.ZodNumber;
43
+ child_only_count: z.ZodNumber;
44
+ base_snapshot_id: z.ZodString;
45
+ target_snapshot_id: z.ZodString;
46
+ }, z.core.$strip>;
47
+ export type SubsiteSyncDiffComputeResponse = z.infer<typeof SubsiteSyncDiffComputeResponseSchema>;
48
+ /**
49
+ * 编排服务在读不出清单时返回的结构化错误码。
50
+ *
51
+ * **缺失或不可读的清单永远是错误,绝不退化成 `pending_pages: []`**——调用方拿到
52
+ * 一个空清单必须能确定那就是「真没有待同步页面」。`side` 让 apps/api 把失败归回
53
+ * 子站侧还是主站侧,两侧的既有错误码因此一个字都不用改。
54
+ */
55
+ export declare const SubsiteSyncDiffErrorCodeSchema: z.ZodEnum<{
56
+ SUBSITE_DIFF_REQUEST_INVALID: "SUBSITE_DIFF_REQUEST_INVALID";
57
+ SUBSITE_DIFF_STORE_NOT_CONFIGURED: "SUBSITE_DIFF_STORE_NOT_CONFIGURED";
58
+ SUBSITE_DIFF_MANIFEST_MISSING: "SUBSITE_DIFF_MANIFEST_MISSING";
59
+ SUBSITE_DIFF_MANIFEST_INVALID: "SUBSITE_DIFF_MANIFEST_INVALID";
60
+ }>;
61
+ export type SubsiteSyncDiffErrorCode = z.infer<typeof SubsiteSyncDiffErrorCodeSchema>;
62
+ export declare const SubsiteSyncDiffErrorResponseSchema: z.ZodObject<{
63
+ error_code: z.ZodEnum<{
64
+ SUBSITE_DIFF_REQUEST_INVALID: "SUBSITE_DIFF_REQUEST_INVALID";
65
+ SUBSITE_DIFF_STORE_NOT_CONFIGURED: "SUBSITE_DIFF_STORE_NOT_CONFIGURED";
66
+ SUBSITE_DIFF_MANIFEST_MISSING: "SUBSITE_DIFF_MANIFEST_MISSING";
67
+ SUBSITE_DIFF_MANIFEST_INVALID: "SUBSITE_DIFF_MANIFEST_INVALID";
68
+ }>;
69
+ message: z.ZodString;
70
+ side: z.ZodOptional<z.ZodEnum<{
71
+ target: "target";
72
+ base: "base";
73
+ }>>;
74
+ }, z.core.$strip>;
75
+ export type SubsiteSyncDiffErrorResponse = z.infer<typeof SubsiteSyncDiffErrorResponseSchema>;
76
+ export {};
@@ -9,6 +9,7 @@ export declare const SubsiteVisibleTextExportRequestSchema: z.ZodObject<{
9
9
  snapshot_id: z.ZodUUID;
10
10
  manifest_hash: z.ZodString;
11
11
  object_key: z.ZodString;
12
+ page_slug: z.ZodOptional<z.ZodString>;
12
13
  }, z.core.$strip>;
13
14
  export type SubsiteVisibleTextExportRequest = z.infer<typeof SubsiteVisibleTextExportRequestSchema>;
14
15
  /** 内部服务返回 Markdown 正文及可审计计数;公网接口只下载 markdown 字段。 */
@@ -18,5 +19,16 @@ export declare const SubsiteVisibleTextExportResponseSchema: z.ZodObject<{
18
19
  unit_count: z.ZodNumber;
19
20
  file_count: z.ZodNumber;
20
21
  markdown: z.ZodString;
22
+ page_slug: z.ZodOptional<z.ZodString>;
23
+ page_file: z.ZodOptional<z.ZodString>;
24
+ entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
25
+ id: z.ZodString;
26
+ file_path: z.ZodString;
27
+ line: z.ZodNullable<z.ZodNumber>;
28
+ kind: z.ZodString;
29
+ text: z.ZodString;
30
+ media_key: z.ZodOptional<z.ZodString>;
31
+ }, z.core.$strip>>>;
21
32
  }, z.core.$strip>;
33
+ export type SubsiteVisibleTextEntry = NonNullable<z.infer<typeof SubsiteVisibleTextExportResponseSchema>["entries"]>[number];
22
34
  export type SubsiteVisibleTextExportResponse = z.infer<typeof SubsiteVisibleTextExportResponseSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vcp-dev/contracts",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {