openxiangda 1.0.156 → 1.0.157
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 +8 -2
- package/lib/cli.js +176 -1
- package/lib/open-api.js +256 -0
- package/lib/skills.js +16 -2
- package/openxiangda-skills/SKILL.md +7 -3
- package/openxiangda-skills/references/openxiangda-api.md +2 -2
- package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +57 -0
- package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +4 -0
- package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +63 -0
- package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +15653 -0
- package/package.json +6 -3
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +2 -0
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +2 -0
- package/templates/openxiangda-react-spa/AGENTS.md +1 -0
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +2 -1
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +2 -1
- package/templates/sy-lowcode-app-workspace/AGENTS.md +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openxiangda",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.157",
|
|
4
4
|
"description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"bin": {
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"scripts": {
|
|
63
63
|
"build:sdk": "tsup --config packages/sdk/tsup.config.ts",
|
|
64
64
|
"check": "node --check bin/openxiangda.js && node --check lib/*.js && node --check packages/sdk/src/build-source/src/cli.mjs && node --check packages/sdk/src/build-source/scripts/*.mjs && node --check packages/sdk/src/build-source/scripts/utils/*.mjs",
|
|
65
|
-
"test": "npm run check && node scripts/form-export-cli-smoke.mjs",
|
|
65
|
+
"test": "npm run check && node scripts/form-export-cli-smoke.mjs && node scripts/open-api-cli-smoke.mjs",
|
|
66
66
|
"prepack": "npm run build:sdk",
|
|
67
67
|
"test:profile-isolation": "bash scripts/profile-isolation-smoke.sh",
|
|
68
68
|
"test:resource-plan": "node scripts/resource-plan-smoke.mjs",
|
|
@@ -75,8 +75,11 @@
|
|
|
75
75
|
"test:app-function-fallback": "node scripts/app-function-source-fallback-smoke.mjs",
|
|
76
76
|
"test:runtime-deploy": "node scripts/runtime-deploy-smoke.mjs",
|
|
77
77
|
"test:sdd": "node scripts/sdd-smoke.mjs",
|
|
78
|
+
"test:open-api": "node scripts/open-api-cli-smoke.mjs",
|
|
78
79
|
"test:skill-install": "bash scripts/skill-install-smoke.sh",
|
|
79
|
-
"test:workspace-init": "bash scripts/workspace-init-smoke.sh"
|
|
80
|
+
"test:workspace-init": "bash scripts/workspace-init-smoke.sh",
|
|
81
|
+
"open-api:sync": "node scripts/sync-dingtalk-openapi.mjs",
|
|
82
|
+
"open-api:verify": "node scripts/sync-dingtalk-openapi.mjs --check"
|
|
80
83
|
},
|
|
81
84
|
"dependencies": {
|
|
82
85
|
"@ant-design/cssinjs": "^1.23.0",
|
|
@@ -16,6 +16,7 @@ This is an OpenXiangda React SPA workspace. See [AGENTS.md](mdc:AGENTS.md) for f
|
|
|
16
16
|
| full deploy | `pnpm deploy -- --profile <name>` |
|
|
17
17
|
| diff / plan | `openxiangda resource plan --profile <name>` |
|
|
18
18
|
| diagnose | `openxiangda doctor --profile <name> --json` |
|
|
19
|
+
| external backend Open API | `openxiangda-open-api` + `openxiangda open-api spec describe ...` |
|
|
19
20
|
|
|
20
21
|
## Always
|
|
21
22
|
|
|
@@ -29,6 +30,7 @@ This is an OpenXiangda React SPA workspace. See [AGENTS.md](mdc:AGENTS.md) for f
|
|
|
29
30
|
- Use `AttachmentField` / `ImageField` for form-context previews, and `AttachmentPreviewList` / `ImagePreviewGrid` / `useFilePreview` for standalone custom pages. Do not fake form context, import internal preview implementations, or maintain local previewable-extension lists.
|
|
30
31
|
- Backend permissions, public-access grants, and App Function role/scope checks are authoritative.
|
|
31
32
|
- Query parameters are context, filters, or ticket input only; they are not sensitive authorization.
|
|
33
|
+
- External backends using `/dingtalk-api/v1.0` must own AK/SK and token storage; never pass those credentials into the React SPA.
|
|
32
34
|
|
|
33
35
|
## Never
|
|
34
36
|
|
|
@@ -16,6 +16,7 @@ This is an OpenXiangda React SPA workspace. Read [AGENTS.md](AGENTS.md) for full
|
|
|
16
16
|
| 完整部署 / deploy | `pnpm deploy -- --profile <name>` |
|
|
17
17
|
| 资源计划 / diff | `openxiangda resource plan --profile <name>` |
|
|
18
18
|
| 诊断 / 环境 | `openxiangda doctor --profile <name> --json` / `openxiangda env --profile <name>` |
|
|
19
|
+
| 外部后端 / 三方系统开放接口 | `openxiangda-open-api` + `openxiangda open-api spec describe ...` |
|
|
19
20
|
|
|
20
21
|
## Always
|
|
21
22
|
|
|
@@ -29,6 +30,7 @@ This is an OpenXiangda React SPA workspace. Read [AGENTS.md](AGENTS.md) for full
|
|
|
29
30
|
- 表单附件预览使用 `AttachmentField` / `ImageField`;普通自定义页面使用 `AttachmentPreviewList` / `ImagePreviewGrid` / `useFilePreview`,不要伪造表单上下文、直接引用内部预览实现或维护扩展名白名单。
|
|
30
31
|
- 页面权限、表单权限、公开访问 grants、App Function 后端检查是授权依据;前端只做展示保护。
|
|
31
32
|
- 查询参数只能做上下文、筛选或 ticket 输入,不能作为敏感数据授权依据。
|
|
33
|
+
- 外部后端使用 `/dingtalk-api/v1.0` 时由后端自己保管 AK/SK 和 token;React SPA 不得接收这些凭证。
|
|
32
34
|
|
|
33
35
|
## Never
|
|
34
36
|
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
- 只给用户分配“管理员”业务角色不等于授权其设置角色;缺少 `app:role:manage` 时角色创建、成员分配和角色接口权限授予会被后端拒绝。
|
|
20
20
|
- 本地开发通过 Vite `/service` 代理远端平台,保持 HttpOnly Cookie 同域访问。
|
|
21
21
|
- 新公开访问页使用 `/view/:appType/public/*`、`src/resources/routes/`、`src/resources/public-access/` 和 `PublicAccessGate`。不要使用旧 `?publicAccess=guest`。
|
|
22
|
+
- 外部后端或三方系统调用享搭时,使用 `openxiangda-open-api` 与 `openxiangda open-api spec describe`;不要把 AK/SK 或开放 API token 放进 React SPA。
|
|
22
23
|
|
|
23
24
|
## 常用命令
|
|
24
25
|
|
|
@@ -21,6 +21,7 @@ This is a `sy-lowcode-app-workspace` managed by the `openxiangda` CLI. See [AGEN
|
|
|
21
21
|
| account / role / permission / data scope / query-param authorization | `openxiangda-permission-settings` | run `openxiangda design gates --topic permissions --json` first, then `openxiangda permission ...` / `openxiangda settings ...` |
|
|
22
22
|
| diagnose / snapshot / 排查 / 报错 | `openxiangda-inspect` | `openxiangda app snapshot APP_XXX --profile <name> --json` |
|
|
23
23
|
| login / token / switch profile | `openxiangda-core` | `openxiangda env --profile <name>` / `openxiangda auth status` |
|
|
24
|
+
| external backend / third-party platform calls / AK/SK | `openxiangda-open-api` | `openxiangda open-api spec list --search <keyword> --json` |
|
|
24
25
|
|
|
25
26
|
## Always
|
|
26
27
|
|
|
@@ -39,7 +40,7 @@ This is a `sy-lowcode-app-workspace` managed by the `openxiangda` CLI. See [AGEN
|
|
|
39
40
|
## Never
|
|
40
41
|
|
|
41
42
|
- ❌ `pnpm publish:all` / `pnpm publish:oss` / `pnpm register` / `lowcode-workspace publish-*` directly. They are guarded by `_guard:publish` and will fail-fast without `OPENXIANGDA_PROFILE`.
|
|
42
|
-
- ❌ Ask
|
|
43
|
+
- ❌ Ask the user to paste AK / SK / appKey / appSecret into chat; use authorized `open-api credential` secure handoff for external backends.
|
|
43
44
|
- ❌ Search the platform for similar app names when `.openxiangda/state.json` has no binding.
|
|
44
45
|
- ❌ Copy `formUuid` / `pageId` / `workflowId` / `automationId` across profiles.
|
|
45
46
|
- ❌ Run a full publish for a single-file edit.
|
|
@@ -21,6 +21,7 @@ This is a `sy-lowcode-app-workspace` managed by the `openxiangda` CLI. Read [AGE
|
|
|
21
21
|
| 账号 / 角色 / 权限 / 数据范围 / 查询参数授权 | `openxiangda-permission-settings` | 先 `openxiangda design gates --topic permissions --json`,再 `openxiangda permission ...` / `openxiangda settings ...` |
|
|
22
22
|
| 排查 / 快照 / 对比 / 报错 | `openxiangda-inspect` | `openxiangda app snapshot APP_XXX --profile <name> --json` |
|
|
23
23
|
| 登录 / token / 切平台 | `openxiangda-core` | `openxiangda env --profile <name>` / `openxiangda auth status` |
|
|
24
|
+
| 外部后端 / 三方系统调用享搭 / AK/SK | `openxiangda-open-api` | `openxiangda open-api spec list --search <keyword> --json` |
|
|
24
25
|
|
|
25
26
|
## Always
|
|
26
27
|
|
|
@@ -39,7 +40,7 @@ This is a `sy-lowcode-app-workspace` managed by the `openxiangda` CLI. Read [AGE
|
|
|
39
40
|
## Never
|
|
40
41
|
|
|
41
42
|
- ❌ `pnpm publish:all` / `pnpm publish:oss` / `pnpm register` / `lowcode-workspace publish-*` 直接调用。它们由 `_guard:publish` 拦截,缺少 `OPENXIANGDA_PROFILE` 时会 fail-fast。
|
|
42
|
-
- ❌
|
|
43
|
+
- ❌ 要求用户在对话中粘贴 AK / SK / appKey / appSecret;获授权的外部后端集成使用 `open-api credential` 安全交付。
|
|
43
44
|
- ❌ 在没有本地 `.openxiangda/state.json` 绑定时,去平台搜索同名应用"复用"。
|
|
44
45
|
- ❌ 把 `formUuid` / `pageId` / `workflowId` / `automationId` 从 dev 复制到 prod。
|
|
45
46
|
- ❌ 改一处就全量发布。
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
| 登录 / 切平台 / token / whoami | `openxiangda-core` | `openxiangda env --profile <name>` / `openxiangda auth status` |
|
|
32
32
|
| 多表只读联表查询 / 报表数据源 | `openxiangda-form`(data view) | 在 `src/resources/data-views/<code>.json` 声明 → `resource publish` |
|
|
33
33
|
| 调外部 / 第三方 API / 钉钉 / 自建系统 | `openxiangda-page`(connector) | 在 `src/resources/connectors/<code>.json` 声明 → `sdk.connector.invoke()` |
|
|
34
|
+
| 外部后端 / 三方系统调用享搭 / AK/SK / 开放接口 | `openxiangda-open-api` | `openxiangda open-api spec list --search <keyword> --json` |
|
|
34
35
|
| 资源诊断 / 小步修复 / 同步 manifest | 对应资源 skill | `openxiangda route|public-access|auth-config|function|connector|notification|data-view|menu|permission ... --dry-run` |
|
|
35
36
|
|
|
36
37
|
## 必须遵守
|
|
@@ -52,7 +53,7 @@
|
|
|
52
53
|
## 严禁
|
|
53
54
|
|
|
54
55
|
- ❌ 直接 `pnpm publish:all` / `pnpm publish:oss` / `pnpm register` / `lowcode-workspace publish-*`。它们是工作区内部脚本,不会注入 `OPENXIANGDA_PROFILE / BASE_URL / ACCESS_TOKEN / APP_TYPE`,发到错的环境也无人提醒。
|
|
55
|
-
- ❌
|
|
56
|
+
- ❌ 要求用户在对话中粘贴 AK / SK / appKey / appSecret。普通工作区流程使用用户 token;获授权的外部后端集成使用 `open-api credential` 安全交付。
|
|
56
57
|
- ❌ 在没有本地 `.openxiangda/state.json` 绑定时,去平台搜索同名应用尝试"复用"。空目录 / 无绑定 → 直接 `workspace init --app-name` 创建新应用。
|
|
57
58
|
- ❌ 把 `openxiangda form create` / `form publish` / `page publish` 当作日常页面生成方式。它们仅作底层修复 / 诊断。
|
|
58
59
|
- ❌ 改一个文件就 `workspace publish` 全量。
|
|
@@ -100,7 +101,7 @@ sy-lowcode-app-workspace/
|
|
|
100
101
|
|
|
101
102
|
## 还想看更细的
|
|
102
103
|
|
|
103
|
-
- 全局 skill:`~/.qoder/skills/openxiangda/SKILL.md`(root 决策卡)+
|
|
104
|
+
- 全局 skill:`~/.qoder/skills/openxiangda/SKILL.md`(root 决策卡)+ 9 个子 skill。
|
|
104
105
|
- 资源 / 连接器 manifest:`docs/openxiangda-resources-and-connectors.md`(来自 openxiangda 仓库)。
|
|
105
106
|
- 平台数据模型:`references/platform-data-model.md`(option `{label, value}`、附件、成员字段等持久化形态)。
|
|
106
107
|
- 排错清单:`references/troubleshooting.md`。
|