feat(apps): 妙搭(Miaoda) 应用 HTML 秒搭一键部署#163
Open
nengqi wants to merge 1 commit into
Open
Conversation
117f2cc to
8c311a7
Compare
对齐官方 lark-cli apps 域,移植妙搭低代码应用的一键部署能力(全部 User 身份,需 spark scope):
- apps create 创建 HTML 应用(POST /open-apis/spark/v1/apps),返回 data.app.app_id
- apps html-publish --path 打包成单 tar.gz,单次 multipart 上传发布,返回 data.url(一键部署)
index.html 校验 + 200MB/20MB 尺寸上限 + 凭证文件扫描(--allow-sensitive 放行)
复用 SDK Formdata 原语,线格式与 lark-cli 一致;响应只白名单提取 url
- apps update 部分更新名称/描述(PATCH /apps/{id})
- apps access-scope-get/set 查看/设置访问范围(specific|public|tenant → Range|All|Tenant)
- apps list 列出当前用户应用(隐藏,游标分页)
internal/client: SparkCall(JSON, 镜像 BaseV3Call) + SparkHTMLPublish(multipart)
统一 --format/--jq,写命令 --dry-run;权限 spark:app:read/write
文档:README 命令参考+权限清单、CHANGELOG、skills/feishu-cli-apps、root.go
测试:cmd/apps_test.go + internal/client/apps_test.go(23 用例,纯逻辑不触网)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
这个 PR 做什么
新增
apps命令组,把「妙搭(Miaoda)」低代码平台能力接入 feishu-cli —— 一份 HTML 秒级发布成可分享的飞书应用(一键部署)。对标官方 lark-cli v1.0.47 的shortcuts/apps近逐行直译,两边共用larksuite/oapi-sdk-go/v3。命令
apps createPOST /open-apis/spark/v1/appsapps html-publishPOST .../apps/{id}/upload_and_release_html_codeapps updatePATCH .../apps/{id}apps listGET .../appsapps access-scope-getGET .../apps/{id}/access-scopeapps access-scope-setPUT .../apps/{id}/access-scope全部 User Access Token + scope
spark:app:read/spark:app:write。html-publish 关键设计
--path接单个 HTML 文件或整个目录 → 打包成单个 tar.gz → 单次 multipart(form fieldfile)上传 → 返回data.url。index.html,单文件形态文件名需为index.html。.env/.env.*/.npmrc/.netrc/.git-credentials/.aws/credentials/.docker/config.json/.kube/config,--allow-sensitive显式放行并记录放行清单。../ 空字节。--dry-run预览打包清单(文件列表 / 总大小 / 缺 index 警告 / 放行凭证),不发请求。验证
go build/vet/test ./...全绿,gofmt干净,go mod tidy无改动(未引入新依赖)。data.url。备注
internal/client的响应解析 / 错误码翻译;新增SparkCall(user-only,无 X-App-Id)对应妙搭契约。spark:app:read/write)+ 新 skill + CHANGELOG + root.go。