modu-platform 0.1.4 → 0.1.6
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/README.md +29 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -48,6 +48,35 @@ modu hub --project ../demo-app --port 3300 # 工作台,另开一个终
|
|
|
48
48
|
|
|
49
49
|
打开 <http://127.0.0.1:3300> → 用上一步的账号登录(口令由服务端校验,拿到 JWT)。
|
|
50
50
|
|
|
51
|
+
## 0.1.6(2026-11-19 发布)
|
|
52
|
+
|
|
53
|
+
这一版把**对外 REST API** 做成可用能力:模型定义好之后,声明 `.modu/api.json` 就能给第三方开接口,
|
|
54
|
+
与有没有页面无关(配不配 `MODU_SERVE_DIST` 都行)。
|
|
55
|
+
|
|
56
|
+
### 新增
|
|
57
|
+
|
|
58
|
+
| 能力 | 说明 |
|
|
59
|
+
|---|---|
|
|
60
|
+
| **对外接口声明** | `.modu/api.json`:`basePath`(默认 `/v1`,也可 `/api/v1`)、`enabled` 总开关、`resources`(字段白名单/filters/sorts)、`bundles`(聚合)、`commands`、`clients` |
|
|
61
|
+
| **API Key 鉴权** | key → IAM 用户,复用角色/资源 ACL/**字段策略**/数据范围/审计;key 只写 `keyRef` 环境变量名 |
|
|
62
|
+
| **资源读** | `GET {base}/tasks`:`limit/offset/sort=no:asc/filter[status]=eq.sent`;字段白名单投影;`{data, meta:{total}}` 信封 |
|
|
63
|
+
| **聚合读(bundle)** | 订单 + 明细 + 物流一次取回:主查 1 次 + 每个关系 1 次 `in(...)`(不是 N+1);从实体各自权限/字段白名单;超限报 `BUNDLE_TOO_MUCH` |
|
|
64
|
+
| **命令面** | `POST {base}/commands/task-create`:写只走命令(事务/幂等/审计/状态机) |
|
|
65
|
+
| **外部幂等键** | `Idempotency-Key` 头:仅当命令声明了 `idempotentBy` 时生效,重放返回同一 runId |
|
|
66
|
+
| **OpenAPI** | `GET /openapi.json`;也可 `modu api openapi --out` 离线出文档(进 CI 产物) |
|
|
67
|
+
| **CLI** | `modu api check/openapi/clients/client create/call`;`client create --write-iam` 建服务用户(`status:"service"`,不能登录)+ 角色 + 授权 |
|
|
68
|
+
| **MCP** | `api_get` / `api_set`(同 `modu check` 校验、写前备份、支持 `dryRun`)/ `api_openapi`——建模型与声明暴露面都在 MCP 里完成 |
|
|
69
|
+
| **多应用** | `MODU_APPS` 下对外接口挂 `/api/app/<appId>{basePath}/…`;跨应用用错 key → 401 |
|
|
70
|
+
| **限流** | `rateLimit.rpm` 令牌桶 → 429 + `Retry-After` |
|
|
71
|
+
|
|
72
|
+
### 升级须知
|
|
73
|
+
|
|
74
|
+
1. **`/v1` 只读**(写表 405):业务写必须走命令——这是事务/幂等/审计唯一入口。
|
|
75
|
+
2. **默认全关**:`api.json` 没声明的资源/命令不可达;没配 `clients` 时只有 `/v1/health` 与 `/openapi.json` 可用。
|
|
76
|
+
3. `basePath` 不得占用内部前缀(`/api`、`/__modu`、`/.well-known`、`/metrics`、`/health`、`/openapi.json`)。
|
|
77
|
+
4. 聚合的从实体读失败(多为未授权)返回 `403 BUNDLE_RELATION_FORBIDDEN`,**不会**把「看不到」伪装成「没有」。
|
|
78
|
+
5. `modu new --template api` 生成的骨架只是不含 UI 文件;运行期是否有页面由 `MODU_SERVE_DIST` 决定(两者正交)。
|
|
79
|
+
|
|
51
80
|
## 0.1.3(2026-11-16 发布)
|
|
52
81
|
|
|
53
82
|
只做一件事:**修 0.1.2 的图表白屏**。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "modu-platform",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "modu 命令行:低代码业务平台的二进制命令面(MCP 启动 · 项目建立 · 研发 · 运维)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"README.md"
|
|
15
15
|
],
|
|
16
16
|
"optionalDependencies": {
|
|
17
|
-
"modu-platform-darwin-arm64": "0.1.
|
|
18
|
-
"modu-platform-linux-x64": "0.1.
|
|
19
|
-
"modu-platform-windows-x64": "0.1.
|
|
17
|
+
"modu-platform-darwin-arm64": "0.1.6",
|
|
18
|
+
"modu-platform-linux-x64": "0.1.6",
|
|
19
|
+
"modu-platform-windows-x64": "0.1.6"
|
|
20
20
|
}
|
|
21
21
|
}
|