@lark-apaas/miaoda-cli 0.1.3-alpha.4bf312e → 0.1.3-alpha.579e439

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.
@@ -215,7 +215,7 @@ function renderDiff(target, preview) {
215
215
  action: c.action,
216
216
  droppedAt: c.droppedAt,
217
217
  })),
218
- estimatedSeconds: estimated ?? 0,
218
+ estimatedSeconds: estimated ?? 30,
219
219
  }));
220
220
  return;
221
221
  }
@@ -240,9 +240,9 @@ function renderDiffTty(target, changes, tablesAffected, estimated) {
240
240
  lines.push(` ${c.table}:${pad}${describeChange(c)}`);
241
241
  }
242
242
  // PRD 要求 estimated time 块固定出现(即便 dataloom 当前没填 EstimatedSeconds,
243
- // CLI 也用 0 兜底,保证输出结构稳定不漂)。
243
+ // CLI 也用 30s 兜底——PRD 示例展示的就是 30s,统一一个不至于误导的常量)。
244
244
  lines.push("");
245
- lines.push(` estimated time: ~${String(estimated ?? 0)}s`);
245
+ lines.push(` estimated time: ~${String(estimated ?? 30)}s`);
246
246
  return lines.join("\n");
247
247
  }
248
248
  function renderDiffPipe(target, changes, tablesAffected, estimated) {
@@ -256,8 +256,8 @@ function renderDiffPipe(target, changes, tablesAffected, estimated) {
256
256
  for (const c of changes) {
257
257
  lines.push(`${c.table}\t${describeChange(c)}`);
258
258
  }
259
- // 与 TTY 一致,始终输出 estimated_time(默认 0),让 awk 解析时不用兜底。
260
- lines.push(`estimated_time\t${String(estimated ?? 0)}`);
259
+ // 与 TTY 一致,始终输出 estimated_time(默认 30),让 awk 解析时不用兜底。
260
+ lines.push(`estimated_time\t${String(estimated ?? 30)}`);
261
261
  return lines.join("\n");
262
262
  }
263
263
  function describeChange(c) {
@@ -276,9 +276,22 @@ function describeChange(c) {
276
276
  return `table will be created${ts}`;
277
277
  }
278
278
  if (c.action?.startsWith("schema_") === true) {
279
- // schema diff 子类不细化,统一显示 "schema changed (<diffType>)"
279
+ // dataloom 透出的 schema diffType 来自 schema_handler/common/constants:
280
+ // - create: 当前没这表 / 目标时间点有 → 恢复后表会被建出来(PRD 用 restored 表达)
281
+ // - drop: 当前有 / 目标时间点没 → 恢复后会被删掉
282
+ // - alter: 两侧都在但结构有差异 → 列 / 索引 / 关系等会被改回
280
283
  const diffType = c.action.slice("schema_".length);
281
- return `schema changed${diffType !== "" ? ` (${diffType})` : ""}`;
284
+ const ts = c.droppedAt ? ` (was dropped at ${c.droppedAt})` : "";
285
+ switch (diffType) {
286
+ case "create":
287
+ return `table will be restored${ts}`;
288
+ case "drop":
289
+ return `table will be dropped${ts}`;
290
+ case "alter":
291
+ return `schema will be altered${ts}`;
292
+ default:
293
+ return `schema changed${diffType !== "" ? ` (${diffType})` : ""}${ts}`;
294
+ }
282
295
  }
283
296
  if (c.action === "unavailable") {
284
297
  // dataloom 端 count 失败的表,复用 droppedAt 透传 message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-cli",
3
- "version": "0.1.3-alpha.4bf312e",
3
+ "version": "0.1.3-alpha.579e439",
4
4
  "description": "Miaoda 平台命令行工具,面向 Agent 调用",
5
5
  "type": "commonjs",
6
6
  "bin": {