mirror of
https://github.com/larksuite/cli.git
synced 2026-07-12 04:14:04 +08:00
refactor(apps): remove app_id from html-publish output, update skill doc
This commit is contained in:
@@ -136,9 +136,7 @@ var AppsHTMLPublish = common.Shortcut{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out["app_id"] = spec.AppID
|
||||
rctx.OutFormat(out, nil, func(w io.Writer) {
|
||||
fmt.Fprintf(w, "app_id: %s\n", spec.AppID)
|
||||
if url, ok := out["url"].(string); ok && url != "" {
|
||||
fmt.Fprintf(w, "url: %s\n", url)
|
||||
}
|
||||
@@ -366,7 +364,6 @@ func runHTMLPublishTOS(ctx context.Context, rctx *common.RuntimeContext, spec ap
|
||||
}
|
||||
|
||||
return map[string]interface{}{
|
||||
"app_id": spec.AppID,
|
||||
"release_id": common.GetString(releaseData, "release_id"),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -676,9 +676,6 @@ func TestRunHTMLPublishTOS_Success(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("err=%v", err)
|
||||
}
|
||||
if out["app_id"] != "app_tos" {
|
||||
t.Fatalf("app_id=%v, want app_tos", out["app_id"])
|
||||
}
|
||||
if out["release_id"] != "rel_123" {
|
||||
t.Fatalf("release_id=%v, want rel_123", out["release_id"])
|
||||
}
|
||||
|
||||
@@ -23,8 +23,13 @@ lark-cli apps +html-publish --app-id app_xxx --path ./index.html --dry-run
|
||||
|
||||
## 输出契约
|
||||
|
||||
- 成功默认 JSON envelope 只关心 `data.url`;这是本轮 HTML 发布后的发布态访问链接。
|
||||
- pretty 输出为 `url: <url>`,适合人看;自动化取字段用 JSON 或 `--jq '.data.url'`。
|
||||
根据应用类型,输出字段不同:
|
||||
|
||||
- **静态 HTML 应用**:`data.url` 是本轮发布后的访问链接,一步完成发布。
|
||||
- **其他 HTML 应用**:`data.release_id` 是发布标识,命令内部已完成产物上传和发布创建。用 `+release-get --app-id <app_id> --release-id <release_id>` 轮询发布状态直到 `finished`。
|
||||
|
||||
判断走哪条路径:有 `url` 字段说明已直接发布完成;有 `release_id` 字段说明需要用 `+release-get` 轮询。
|
||||
|
||||
- 业务失败如构建失败、应用不存在通常带 `error.hint`;优先转述 hint。网络/服务端失败则建议稍后重试。
|
||||
|
||||
## 链接边界
|
||||
|
||||
Reference in New Issue
Block a user