openxiangda 1.0.269 → 1.0.271

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.
Files changed (29) hide show
  1. package/README.md +2 -0
  2. package/lib/application-environments.js +17 -0
  3. package/lib/cli.js +720 -78
  4. package/lib/design-gates.js +18 -0
  5. package/lib/release-plan.js +78 -63
  6. package/openxiangda-skills/SKILL.md +3 -1
  7. package/openxiangda-skills/references/notifications.md +28 -23
  8. package/openxiangda-skills/references/openxiangda-api.md +22 -30
  9. package/openxiangda-skills/references/pages/page-sdk.md +1 -1
  10. package/openxiangda-skills/references/resource-manifest-cheatsheet.md +37 -9
  11. package/openxiangda-skills/references/webhooks.md +213 -0
  12. package/openxiangda-skills/skills/openxiangda-core/SKILL.md +1 -1
  13. package/openxiangda-skills/skills/openxiangda-page/SKILL.md +2 -2
  14. package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +3 -0
  15. package/package.json +24 -23
  16. package/packages/sdk/dist/runtime/index.cjs +39 -39
  17. package/packages/sdk/dist/runtime/index.mjs +39 -39
  18. package/packages/sdk/dist/runtime/react.cjs +39 -39
  19. package/packages/sdk/dist/runtime/react.d.mts +3 -0
  20. package/packages/sdk/dist/runtime/react.d.ts +3 -0
  21. package/packages/sdk/dist/runtime/react.mjs +46 -46
  22. package/packages/sdk/src/build-source/scripts/publish-all.mjs +33 -2
  23. package/packages/sdk/src/build-source/scripts/register.mjs +161 -1
  24. package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +1 -0
  25. package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +1 -0
  26. package/templates/openxiangda-react-spa/AGENTS.md +4 -0
  27. package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +2 -0
  28. package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +1 -0
  29. package/templates/sy-lowcode-app-workspace/AGENTS.md +3 -1
package/README.md CHANGED
@@ -617,6 +617,8 @@ const PublicAccessError = ({ error }: { error: { message?: string } }) => (
617
617
 
618
618
  App Function 访问第三方凭据时使用 `app_function_secrets_v1`:manifest 顶层只声明 `secretRefs: [{ "name": "dingtalk_org_app_key", "required": true }]`,同时使用 `definitionJson.version="function_v2"`、`runtimeContractVersion="trusted_node_v2"`;源码通过 `await ctx.secrets.get(name)` 解析,并通过 `ctx.utils.http` 访问受控公网 HTTPS(该桥接不会携带平台 Runtime token)。值只能经 `openxiangda secret create|rotate --value-stdin --change <id> --profile <name>` 或隐藏 TTY 输入,禁止进入 Git、manifest、源码、构建产物、plan、日志或异常。带 `secretRefs` 的 Function 必须走 `backend_release_v2`;需要整应用原子发布时先执行 `resource publish function --only <code> --stage-only`,再把返回的真实 `stagedResource` 交给 `release app-finalize --staged-resources-json ...` 完成 `atomic_staged_children_v2`。默认直接激活的 Backend Release 只返回 `activeResource`,不会伪装成 staged;旧平台 capability 不完整时 CLI 会失败关闭,绝不忽略绑定。
619
619
 
620
+ 外部系统主动调用应用时,在 `src/resources/webhooks/<code>.json` 声明 Inbound Webhook 和固定 `targetFunctionCode`,用 `openxiangda resource validate|plan|publish webhook` 发布。平台返回的 `callbackPath` 是公开回调路径;不要用租户内的 `appType` 自行拼接入口。目标 Function 在顶层 `secretRefs` 声明供应商 Secret,并且必须先基于精确 `input.rawBody` 验签,再访问表单、数据视图、连接器、通知或外部 HTTP;投递是 at-least-once,业务写入还要用 `input.idempotencyKey` 做原子幂等。使用 `openxiangda webhook deliveries|delivery` 查看投递状态和原始请求审计,完整契约见 `openxiangda-skills/references/webhooks.md`。
621
+
620
622
  平台部门和账号管理走 app-scoped organization 能力。只读查询要求目标应用的 `app:organization:read` 或 `app:organization:manage`,创建、更新和密码操作要求 `app:organization:manage`;平台管理员天然可用,普通应用角色需要显式授权。Runtime service principal 不会直接放行,`ctx.organization` 会按真实操作人 / audit actor 校验权限。新接口不提供删除;`account-update` 不能携带 `password`,重置他人密码必须走 `account-reset-password`,当前用户改密用 SDK / `ctx.organization.accounts.changeMyPassword({ oldPassword, newPassword })`。
621
623
 
622
624
  CLI 写操作必须加 `--force`:
@@ -1062,6 +1062,22 @@ function withManagedReleaseForwardedFlags(stepId, args = [], flags = {}) {
1062
1062
  return forwarded;
1063
1063
  }
1064
1064
 
1065
+ function withLegacyReleaseForwardedFlags(stepId, args = [], flags = {}) {
1066
+ let forwarded = [...args];
1067
+ const isExactResourcePublish =
1068
+ forwarded[0] === 'resource' &&
1069
+ forwarded[1] === 'publish' &&
1070
+ (forwarded.includes('--only') || forwarded.includes('--code'));
1071
+ if (!isExactResourcePublish) return forwarded;
1072
+ if (stepId === 'backend-stage' && flags['replace-manifest']) {
1073
+ forwarded.push('--replace-manifest');
1074
+ const replacementReason = String(flags.reason || '').trim();
1075
+ if (replacementReason) forwarded.push('--reason', replacementReason);
1076
+ }
1077
+ forwarded = withOnlineBaselineAdoptionFlags(forwarded, flags);
1078
+ return forwarded;
1079
+ }
1080
+
1065
1081
  function withOnlineBaselineAdoptionFlags(args = [], flags = {}) {
1066
1082
  const forwarded = [...args];
1067
1083
  const isExactResourcePublish =
@@ -1141,6 +1157,7 @@ module.exports = {
1141
1157
  resolveEnvironmentTarget,
1142
1158
  saveCandidate,
1143
1159
  sha256Canonical,
1160
+ withLegacyReleaseForwardedFlags,
1144
1161
  withManagedReleaseForwardedFlags,
1145
1162
  withOnlineBaselineAdoptionFlags,
1146
1163
  withReleaseClientSessionArgs,