openxiangda 1.0.264 → 2.0.0-alpha.2
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 +11 -666
- package/bin/run.js +11 -0
- package/dist/browser/AuthoritativeSelector.d.ts +37 -0
- package/dist/browser/AuthoritativeSelector.d.ts.map +1 -0
- package/dist/browser/AuthoritativeSelector.js +357 -0
- package/dist/browser/AuthoritativeSelector.js.map +1 -0
- package/dist/browser/FilePreviewPage.d.ts +2 -0
- package/dist/browser/FilePreviewPage.d.ts.map +1 -0
- package/dist/browser/FilePreviewPage.js +191 -0
- package/dist/browser/FilePreviewPage.js.map +1 -0
- package/dist/browser/Shell.d.ts +6 -0
- package/dist/browser/Shell.d.ts.map +1 -0
- package/dist/browser/Shell.js +198 -0
- package/dist/browser/Shell.js.map +1 -0
- package/dist/browser/appearance.d.ts +12 -0
- package/dist/browser/appearance.d.ts.map +1 -0
- package/dist/browser/appearance.js +100 -0
- package/dist/browser/appearance.js.map +1 -0
- package/dist/browser/application.d.ts +8 -0
- package/dist/browser/application.d.ts.map +1 -0
- package/dist/browser/application.js +42 -0
- package/dist/browser/application.js.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts +12 -0
- package/dist/browser/components/platform-fields/AddressField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AddressField.js +179 -0
- package/dist/browser/components/platform-fields/AddressField.js.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts +9 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js +164 -0
- package/dist/browser/components/platform-fields/AttachmentFileList.js.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts +13 -0
- package/dist/browser/components/platform-fields/CascadeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/CascadeField.js +14 -0
- package/dist/browser/components/platform-fields/CascadeField.js.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts +16 -0
- package/dist/browser/components/platform-fields/DateTimeField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/DateTimeField.js +51 -0
- package/dist/browser/components/platform-fields/DateTimeField.js.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts +11 -0
- package/dist/browser/components/platform-fields/JsonField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/JsonField.js +40 -0
- package/dist/browser/components/platform-fields/JsonField.js.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts +11 -0
- package/dist/browser/components/platform-fields/LocationField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/LocationField.js +73 -0
- package/dist/browser/components/platform-fields/LocationField.js.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts +12 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js +269 -0
- package/dist/browser/components/platform-fields/PlatformDirectoryPicker.js.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts +12 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js +22 -0
- package/dist/browser/components/platform-fields/ResourceReferenceField.js.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts +14 -0
- package/dist/browser/components/platform-fields/RichTextField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/RichTextField.js +214 -0
- package/dist/browser/components/platform-fields/RichTextField.js.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts +15 -0
- package/dist/browser/components/platform-fields/SignatureField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SignatureField.js +179 -0
- package/dist/browser/components/platform-fields/SignatureField.js.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts +18 -0
- package/dist/browser/components/platform-fields/SubtableField.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/SubtableField.js +236 -0
- package/dist/browser/components/platform-fields/SubtableField.js.map +1 -0
- package/dist/browser/components/platform-fields/address-value.d.ts +13 -0
- package/dist/browser/components/platform-fields/address-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/address-value.js +70 -0
- package/dist/browser/components/platform-fields/address-value.js.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts +6 -0
- package/dist/browser/components/platform-fields/cascade-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/cascade-value.js +47 -0
- package/dist/browser/components/platform-fields/cascade-value.js.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts +7 -0
- package/dist/browser/components/platform-fields/directory-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/directory-value.js +35 -0
- package/dist/browser/components/platform-fields/directory-value.js.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts +10 -0
- package/dist/browser/components/platform-fields/field-form-codec.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/field-form-codec.js +82 -0
- package/dist/browser/components/platform-fields/field-form-codec.js.map +1 -0
- package/dist/browser/components/platform-fields/location-value.d.ts +20 -0
- package/dist/browser/components/platform-fields/location-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/location-value.js +57 -0
- package/dist/browser/components/platform-fields/location-value.js.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts +14 -0
- package/dist/browser/components/platform-fields/resource-query.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/resource-query.js +102 -0
- package/dist/browser/components/platform-fields/resource-query.js.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts +12 -0
- package/dist/browser/components/platform-fields/rich-text-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/rich-text-value.js +83 -0
- package/dist/browser/components/platform-fields/rich-text-value.js.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts +31 -0
- package/dist/browser/components/platform-fields/subtable-value.d.ts.map +1 -0
- package/dist/browser/components/platform-fields/subtable-value.js +120 -0
- package/dist/browser/components/platform-fields/subtable-value.js.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts +8 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.d.ts.map +1 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js +580 -0
- package/dist/browser/components/resource/GeneratedResourceCrud.js.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts +25 -0
- package/dist/browser/components/resource/ResourceBatchActions.d.ts.map +1 -0
- package/dist/browser/components/resource/ResourceBatchActions.js +168 -0
- package/dist/browser/components/resource/ResourceBatchActions.js.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts +57 -0
- package/dist/browser/components/resource/StandardResourcePages.d.ts.map +1 -0
- package/dist/browser/components/resource/StandardResourcePages.js +89 -0
- package/dist/browser/components/resource/StandardResourcePages.js.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts +88 -0
- package/dist/browser/components/resource/SurfaceFields.d.ts.map +1 -0
- package/dist/browser/components/resource/SurfaceFields.js +497 -0
- package/dist/browser/components/resource/SurfaceFields.js.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts +19 -0
- package/dist/browser/components/resource/generated-resource-definition.d.ts.map +1 -0
- package/dist/browser/components/resource/generated-resource-definition.js +2 -0
- package/dist/browser/components/resource/generated-resource-definition.js.map +1 -0
- package/dist/browser/components/resource/resource-import.d.ts +15 -0
- package/dist/browser/components/resource/resource-import.d.ts.map +1 -0
- package/dist/browser/components/resource/resource-import.js +197 -0
- package/dist/browser/components/resource/resource-import.js.map +1 -0
- package/dist/browser/data-provider.d.ts +4 -0
- package/dist/browser/data-provider.d.ts.map +1 -0
- package/dist/browser/data-provider.js +45 -0
- package/dist/browser/data-provider.js.map +1 -0
- package/dist/browser/platform-client.d.ts +81 -0
- package/dist/browser/platform-client.d.ts.map +1 -0
- package/dist/browser/platform-client.js +422 -0
- package/dist/browser/platform-client.js.map +1 -0
- package/dist/browser/resource-definitions.d.ts +8 -0
- package/dist/browser/resource-definitions.d.ts.map +1 -0
- package/dist/browser/resource-definitions.js +14 -0
- package/dist/browser/resource-definitions.js.map +1 -0
- package/dist/browser/runtime-meta.d.ts +22 -0
- package/dist/browser/runtime-meta.d.ts.map +1 -0
- package/dist/browser/runtime-meta.js +79 -0
- package/dist/browser/runtime-meta.js.map +1 -0
- package/dist/browser/runtime.d.ts +13 -0
- package/dist/browser/runtime.d.ts.map +1 -0
- package/dist/browser/runtime.js +47 -0
- package/dist/browser/runtime.js.map +1 -0
- package/dist/browser/styles.css +1941 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -0
- package/dist/core.d.ts +6 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +4 -0
- package/dist/core.js.map +1 -0
- package/dist/field-kit.d.ts +22 -0
- package/dist/field-kit.d.ts.map +1 -0
- package/dist/field-kit.js +22 -0
- package/dist/field-kit.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/nest.d.ts +10 -0
- package/dist/nest.d.ts.map +1 -0
- package/dist/nest.js +9 -0
- package/dist/nest.js.map +1 -0
- package/dist/react.d.ts +12 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +11 -0
- package/dist/react.js.map +1 -0
- package/dist/testing.d.ts +4 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +4 -0
- package/dist/testing.js.map +1 -0
- package/package.json +95 -200
- package/skills/manifest.json +10 -0
- package/skills/openxiangda-v2/SKILL.md +55 -0
- package/skills/openxiangda-v2/references/architecture.md +7 -0
- package/skills/openxiangda-v2/references/backend.md +116 -0
- package/skills/openxiangda-v2/references/data-authz.md +93 -0
- package/skills/openxiangda-v2/references/delivery.md +11 -0
- package/skills/openxiangda-v2/references/discovery.md +15 -0
- package/skills/openxiangda-v2/references/frontend.md +10 -0
- package/skills/openxiangda-v2/references/testing.md +16 -0
- package/skills/openxiangda-v2/references/workflow-notification.md +69 -0
- package/skills/openxiangda-v2/references/workspace.md +21 -0
- package/bin/openxiangda.js +0 -26
- package/lib/app-function-invoke.js +0 -28
- package/lib/application-environments.js +0 -1134
- package/lib/change-baseline.js +0 -1359
- package/lib/cli.js +0 -31084
- package/lib/config.js +0 -450
- package/lib/content-cache.js +0 -97
- package/lib/delivery-v2-cli.js +0 -329
- package/lib/delivery-v2-executor.js +0 -1703
- package/lib/delivery-v2-package.js +0 -1176
- package/lib/dependency-capsule.js +0 -246
- package/lib/design-gates.js +0 -668
- package/lib/design-review.js +0 -220
- package/lib/developer-center.js +0 -160
- package/lib/form-field-contract.js +0 -79
- package/lib/form-schema-loader.js +0 -181
- package/lib/git-remote-identity.js +0 -89
- package/lib/http.js +0 -196
- package/lib/integration-bundle.js +0 -225
- package/lib/js-code-build.js +0 -175
- package/lib/open-api.js +0 -256
- package/lib/policy.js +0 -137
- package/lib/publish-context.js +0 -98
- package/lib/publish-lease-heartbeat.js +0 -182
- package/lib/publish-lease.js +0 -221
- package/lib/release-error-classification.js +0 -41
- package/lib/release-explain.js +0 -75
- package/lib/release-mainline.js +0 -654
- package/lib/release-plan.js +0 -550
- package/lib/release-telemetry.js +0 -182
- package/lib/resource-binding-contract.js +0 -210
- package/lib/role-resolution.js +0 -57
- package/lib/runtime-lineage.js +0 -326
- package/lib/sdd.js +0 -3306
- package/lib/skills.js +0 -453
- package/lib/source-dependencies.js +0 -921
- package/lib/task-status.js +0 -330
- package/lib/utils.js +0 -178
- package/lib/workspace-bootstrap.js +0 -268
- package/lib/workspace-init.js +0 -202
- package/lib/worktree-cleanup.js +0 -631
- package/lib/worktree-owner.js +0 -354
- package/openxiangda-skills/SKILL.md +0 -226
- package/openxiangda-skills/references/architecture-design.md +0 -409
- package/openxiangda-skills/references/architecture-patterns.md +0 -264
- package/openxiangda-skills/references/automation-v3.md +0 -349
- package/openxiangda-skills/references/best-practices.md +0 -272
- package/openxiangda-skills/references/component-guide.md +0 -287
- package/openxiangda-skills/references/connector-resources.md +0 -80
- package/openxiangda-skills/references/data-views.md +0 -360
- package/openxiangda-skills/references/forms/component-registry.md +0 -90
- package/openxiangda-skills/references/forms/form-schema.md +0 -146
- package/openxiangda-skills/references/forms/layout-and-rules.md +0 -24
- package/openxiangda-skills/references/notifications.md +0 -227
- package/openxiangda-skills/references/openxiangda-api.md +0 -971
- package/openxiangda-skills/references/pages/app-shell.md +0 -66
- package/openxiangda-skills/references/pages/page-sdk.md +0 -401
- package/openxiangda-skills/references/pages/publish-flow.md +0 -84
- package/openxiangda-skills/references/pages/workspace-structure.md +0 -41
- package/openxiangda-skills/references/permission-design-patterns.md +0 -313
- package/openxiangda-skills/references/permissions-settings.md +0 -468
- package/openxiangda-skills/references/platform-data-model.md +0 -340
- package/openxiangda-skills/references/resource-manifest-cheatsheet.md +0 -936
- package/openxiangda-skills/references/school-contact-relations.md +0 -224
- package/openxiangda-skills/references/style-system.md +0 -218
- package/openxiangda-skills/references/troubleshooting.md +0 -271
- package/openxiangda-skills/references/workflow-v3.md +0 -441
- package/openxiangda-skills/references/workspace-state.md +0 -115
- package/openxiangda-skills/skills/openxiangda-app/SKILL.md +0 -118
- package/openxiangda-skills/skills/openxiangda-architecture-design/SKILL.md +0 -137
- package/openxiangda-skills/skills/openxiangda-core/SKILL.md +0 -222
- package/openxiangda-skills/skills/openxiangda-form/SKILL.md +0 -184
- package/openxiangda-skills/skills/openxiangda-inspect/SKILL.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/SKILL.md +0 -57
- package/openxiangda-skills/skills/openxiangda-open-api/agents/openai.yaml +0 -4
- package/openxiangda-skills/skills/openxiangda-open-api/references/backend-authentication.md +0 -63
- package/openxiangda-skills/skills/openxiangda-open-api/references/dingtalk-api.openapi.json +0 -15653
- package/openxiangda-skills/skills/openxiangda-page/SKILL.md +0 -154
- package/openxiangda-skills/skills/openxiangda-permission-settings/SKILL.md +0 -209
- package/openxiangda-skills/skills/openxiangda-workflow-automation/SKILL.md +0 -201
- package/packages/sdk/bin/lowcode-workspace.mjs +0 -4
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.mts +0 -1292
- package/packages/sdk/dist/ProcessPreview-DSUIJi5V.d.ts +0 -1292
- package/packages/sdk/dist/build/index.cjs +0 -1
- package/packages/sdk/dist/build/index.d.mts +0 -60
- package/packages/sdk/dist/build/index.d.ts +0 -60
- package/packages/sdk/dist/build/index.mjs +0 -1
- package/packages/sdk/dist/components/index.cjs +0 -148
- package/packages/sdk/dist/components/index.d.mts +0 -970
- package/packages/sdk/dist/components/index.d.ts +0 -970
- package/packages/sdk/dist/components/index.mjs +0 -148
- package/packages/sdk/dist/dataManagementApi-Ro9itwm8.d.ts +0 -142
- package/packages/sdk/dist/dataManagementApi-p_HOhQnA.d.mts +0 -142
- package/packages/sdk/dist/runtime/index.cjs +0 -148
- package/packages/sdk/dist/runtime/index.d.mts +0 -171
- package/packages/sdk/dist/runtime/index.d.ts +0 -171
- package/packages/sdk/dist/runtime/index.mjs +0 -148
- package/packages/sdk/dist/runtime/react.cjs +0 -148
- package/packages/sdk/dist/runtime/react.d.mts +0 -3202
- package/packages/sdk/dist/runtime/react.d.ts +0 -3202
- package/packages/sdk/dist/runtime/react.mjs +0 -148
- package/packages/sdk/dist/styles/antd-theme.cjs +0 -1
- package/packages/sdk/dist/styles/antd-theme.d.mts +0 -6
- package/packages/sdk/dist/styles/antd-theme.d.ts +0 -6
- package/packages/sdk/dist/styles/antd-theme.mjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.cjs +0 -1
- package/packages/sdk/dist/styles/tailwind-preset.d.mts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.d.ts +0 -74
- package/packages/sdk/dist/styles/tailwind-preset.mjs +0 -1
- package/packages/sdk/dist/styles/tokens.css +0 -74
- package/packages/sdk/dist/workflow/index.cjs +0 -3
- package/packages/sdk/dist/workflow/index.d.mts +0 -291
- package/packages/sdk/dist/workflow/index.d.ts +0 -291
- package/packages/sdk/dist/workflow/index.mjs +0 -3
- package/packages/sdk/source/admin-list/AdminList.tsx +0 -1734
- package/packages/sdk/source/admin-list/README.md +0 -12
- package/packages/sdk/source/admin-list/dataSources.ts +0 -345
- package/packages/sdk/source/admin-list/index.ts +0 -42
- package/packages/sdk/source/admin-list/preferences.ts +0 -174
- package/packages/sdk/source/admin-list/types.ts +0 -273
- package/packages/sdk/src/build-source/README.md +0 -9
- package/packages/sdk/src/build-source/bin/lowcode-workspace.mjs +0 -7
- package/packages/sdk/src/build-source/package.json +0 -34
- package/packages/sdk/src/build-source/scripts/build-forms.mjs +0 -1129
- package/packages/sdk/src/build-source/scripts/build-pages.mjs +0 -897
- package/packages/sdk/src/build-source/scripts/build-workspace.mjs +0 -89
- package/packages/sdk/src/build-source/scripts/publish-all.mjs +0 -190
- package/packages/sdk/src/build-source/scripts/publish-oss.mjs +0 -144
- package/packages/sdk/src/build-source/scripts/register-bundle.mjs +0 -1
- package/packages/sdk/src/build-source/scripts/register.mjs +0 -362
- package/packages/sdk/src/build-source/scripts/sync-schema.mjs +0 -381
- package/packages/sdk/src/build-source/scripts/utils/form-api.mjs +0 -1058
- package/packages/sdk/src/build-source/scripts/utils/form-runtime-assets.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/incremental.mjs +0 -348
- package/packages/sdk/src/build-source/scripts/utils/load-config.mjs +0 -331
- package/packages/sdk/src/build-source/scripts/utils/mime-types.mjs +0 -70
- package/packages/sdk/src/build-source/scripts/utils/namespace-css.mjs +0 -77
- package/packages/sdk/src/build-source/scripts/utils/oss-client.mjs +0 -128
- package/packages/sdk/src/build-source/scripts/utils/pages.mjs +0 -150
- package/packages/sdk/src/build-source/scripts/utils/progress.mjs +0 -57
- package/packages/sdk/src/build-source/scripts/utils/publish-oss-patterns.mjs +0 -20
- package/packages/sdk/src/build-source/scripts/utils/register-payload.mjs +0 -90
- package/packages/sdk/src/build-source/scripts/utils/runtime-css-check.mjs +0 -44
- package/packages/sdk/src/build-source/scripts/utils/schema-transform.mjs +0 -142
- package/packages/sdk/src/build-source/scripts/utils/static-assets.mjs +0 -165
- package/packages/sdk/src/build-source/scripts/utils/tailwind-config.mjs +0 -283
- package/packages/sdk/src/build-source/scripts/utils/tailwind-token-warnings.mjs +0 -146
- package/packages/sdk/src/build-source/scripts/utils/workspace-style-entry.mjs +0 -29
- package/packages/sdk/src/build-source/src/cli.mjs +0 -735
- package/policy/openxiangda-policy.json +0 -72
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-page.mdc +0 -25
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-resources.mdc +0 -32
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda-workflow-automation.mdc +0 -26
- package/templates/openxiangda-react-spa/.cursor/rules/openxiangda.mdc +0 -68
- package/templates/openxiangda-react-spa/.env.example +0 -4
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-form.md +0 -37
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-page.md +0 -29
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-resources.md +0 -32
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda-workflow-automation.md +0 -34
- package/templates/openxiangda-react-spa/.qoder/rules/openxiangda.md +0 -66
- package/templates/openxiangda-react-spa/AGENTS.md +0 -192
- package/templates/openxiangda-react-spa/DELIVERY.md +0 -43
- package/templates/openxiangda-react-spa/app-workspace.config.ts +0 -50
- package/templates/openxiangda-react-spa/index.html +0 -12
- package/templates/openxiangda-react-spa/package.json +0 -53
- package/templates/openxiangda-react-spa/postcss.config.cjs +0 -6
- package/templates/openxiangda-react-spa/scripts/build-js-code.mjs +0 -600
- package/templates/openxiangda-react-spa/scripts/deploy.mjs +0 -18
- package/templates/openxiangda-react-spa/scripts/guard-publish.mjs +0 -21
- package/templates/openxiangda-react-spa/src/app/navigation.ts +0 -73
- package/templates/openxiangda-react-spa/src/app/router.tsx +0 -146
- package/templates/openxiangda-react-spa/src/app/starter-content.ts +0 -144
- package/templates/openxiangda-react-spa/src/forms/.gitkeep +0 -1
- package/templates/openxiangda-react-spa/src/layouts/AdminShell.tsx +0 -570
- package/templates/openxiangda-react-spa/src/main.tsx +0 -21
- package/templates/openxiangda-react-spa/src/pages/admin/AdminDashboardPage.tsx +0 -170
- package/templates/openxiangda-react-spa/src/pages/admin/LoginLogPage.tsx +0 -425
- package/templates/openxiangda-react-spa/src/pages/defaults/DataRoutePage.tsx +0 -36
- package/templates/openxiangda-react-spa/src/pages/defaults/FilePreviewRoutePage.tsx +0 -65
- package/templates/openxiangda-react-spa/src/pages/defaults/FormRoutePage.tsx +0 -235
- package/templates/openxiangda-react-spa/src/pages/public/PublicRegisterPage.tsx +0 -15
- package/templates/openxiangda-react-spa/src/pages/states/NotFoundPage.tsx +0 -31
- package/templates/openxiangda-react-spa/src/resources/menus/menus.json +0 -22
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/app-admin.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/permissions/page-groups/public-visitor.json +0 -8
- package/templates/openxiangda-react-spa/src/resources/public-access/public-register.json +0 -14
- package/templates/openxiangda-react-spa/src/resources/roles/roles.json +0 -15
- package/templates/openxiangda-react-spa/src/resources/routes/public-register.json +0 -8
- package/templates/openxiangda-react-spa/src/runtime/default-page-overrides.tsx +0 -35
- package/templates/openxiangda-react-spa/src/runtime/default-routes.ts +0 -16
- package/templates/openxiangda-react-spa/src/shared/form-schema.ts +0 -135
- package/templates/openxiangda-react-spa/src/shared/mac-admin.tsx +0 -651
- package/templates/openxiangda-react-spa/src/shared/ui.tsx +0 -22
- package/templates/openxiangda-react-spa/src/styles/index.css +0 -105
- package/templates/openxiangda-react-spa/tailwind.config.cjs +0 -37
- package/templates/openxiangda-react-spa/tsconfig.app.json +0 -36
- package/templates/openxiangda-react-spa/tsconfig.js-code-nodes.json +0 -19
- package/templates/openxiangda-react-spa/tsconfig.json +0 -7
- package/templates/openxiangda-react-spa/tsconfig.node.json +0 -10
- package/templates/openxiangda-react-spa/vite.config.ts +0 -209
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-form.mdc +0 -24
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-page.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-resources.mdc +0 -40
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda-workflow-automation.mdc +0 -21
- package/templates/sy-lowcode-app-workspace/.cursor/rules/openxiangda.mdc +0 -81
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-form.md +0 -38
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-page.md +0 -39
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-resources.md +0 -59
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda-workflow-automation.md +0 -46
- package/templates/sy-lowcode-app-workspace/.qoder/rules/openxiangda.md +0 -82
- package/templates/sy-lowcode-app-workspace/AGENTS.md +0 -158
- package/templates/sy-lowcode-app-workspace/DELIVERY.md +0 -43
- package/templates/sy-lowcode-app-workspace/app-workspace.config.ts +0 -51
- package/templates/sy-lowcode-app-workspace/examples/best-practices/README.md +0 -43
- package/templates/sy-lowcode-app-workspace/examples/best-practices/access-governance.md +0 -239
- package/templates/sy-lowcode-app-workspace/examples/best-practices/catalog.json +0 -99
- package/templates/sy-lowcode-app-workspace/examples/best-practices/decision-guide.md +0 -94
- package/templates/sy-lowcode-app-workspace/examples/best-practices/design-style.md +0 -91
- package/templates/sy-lowcode-app-workspace/examples/best-practices/module-structure.md +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/index.ts +0 -2
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.test.ts +0 -52
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/permissions.ts +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/role-governance/types.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/index.ts +0 -4
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.test.ts +0 -42
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/permissions.ts +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.test.ts +0 -63
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/state-machine.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.test.ts +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/ticket-query.ts +0 -73
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/domain/service-ticket/types.ts +0 -66
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/app-role/schema.ts +0 -109
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/customer-profile/schema.ts +0 -92
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/service-ticket/schema.ts +0 -153
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/forms/ticket-action-log/schema.ts +0 -65
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/daily_ticket_digest/index.ts +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/js-code-nodes/sync_roles_to_platform/index.ts +0 -33
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/GlassHomeDashboard.tsx +0 -232
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/glass-home-dashboard/styles.css +0 -196
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/WorkbenchPage.tsx +0 -36
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/ConfigPanel.tsx +0 -34
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/components/PreviewPanel.tsx +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/reducer.ts +0 -29
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/interactive-workbench/styles.css +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/MintAnalyticsDashboard.tsx +0 -279
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mint-analytics-dashboard/styles.css +0 -163
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/MobilePortalShell.tsx +0 -31
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/modules/MobileHome.tsx +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/routes.ts +0 -13
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/mobile-portal-shell/styles.css +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/OpsMonitorDashboard.tsx +0 -306
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/ops-monitor-dashboard/styles.css +0 -248
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/PcPortalShell.tsx +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/components/PortalMetric.tsx +0 -11
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/HomeModule.tsx +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/modules/TicketsModule.tsx +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/routes.ts +0 -19
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/pc-portal-shell/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/App.tsx +0 -7
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/TicketOpsPage.tsx +0 -105
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketActionTimeline.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketDetailDrawer.tsx +0 -44
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/components/TicketTableActions.tsx +0 -57
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/page.config.ts +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/service-ticket-ops/styles.css +0 -35
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/App.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/WorkOrderListDrawerPage.tsx +0 -371
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/index.tsx +0 -10
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/page.config.ts +0 -14
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/pages/work-order-list-drawer/styles.css +0 -182
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/automation.json +0 -25
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/automations/daily-ticket-digest/trigger.json +0 -9
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/notifications/daily-ticket-digest.json +0 -24
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/form-groups/service-ticket-college.json +0 -21
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/permissions/roles.json +0 -17
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/resources/workflows/expense-approval-workflow.json +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/ConfirmAction.tsx +0 -22
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/QueryState.tsx +0 -37
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/StatusTag.tsx +0 -20
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/DashboardPrimitives.tsx +0 -832
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/chartOptions.ts +0 -140
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/sampleData.ts +0 -466
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/styles.css +0 -874
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/components/admin-ui-templates/types.ts +0 -150
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/hooks/useTicketOps.ts +0 -96
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/role-governance.ts +0 -48
- package/templates/sy-lowcode-app-workspace/examples/best-practices/src/shared/services/service-ticket.ts +0 -113
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/page.tsx +0 -1
- package/templates/sy-lowcode-app-workspace/examples/forms/customer/schema.ts +0 -36
- package/templates/sy-lowcode-app-workspace/index.html +0 -12
- package/templates/sy-lowcode-app-workspace/package.json +0 -58
- package/templates/sy-lowcode-app-workspace/postcss.config.cjs +0 -9
- package/templates/sy-lowcode-app-workspace/scripts/build-js-code.mjs +0 -600
- package/templates/sy-lowcode-app-workspace/scripts/guard-publish.mjs +0 -29
- package/templates/sy-lowcode-app-workspace/src/dev/App.tsx +0 -820
- package/templates/sy-lowcode-app-workspace/src/forms/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/forms/README.md +0 -52
- package/templates/sy-lowcode-app-workspace/src/index.css +0 -26
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/js-code-nodes/types.d.ts +0 -3
- package/templates/sy-lowcode-app-workspace/src/main.tsx +0 -29
- package/templates/sy-lowcode-app-workspace/src/pages/.gitkeep +0 -1
- package/templates/sy-lowcode-app-workspace/src/runtime/builtin-overrides.tsx +0 -8
- package/templates/sy-lowcode-app-workspace/src/shared/form-schema.ts +0 -135
- package/templates/sy-lowcode-app-workspace/src/types/app-workspace.types.ts +0 -88
- package/templates/sy-lowcode-app-workspace/tailwind.config.cjs +0 -31
- package/templates/sy-lowcode-app-workspace/tsconfig.app.json +0 -40
- package/templates/sy-lowcode-app-workspace/tsconfig.examples.json +0 -24
- package/templates/sy-lowcode-app-workspace/tsconfig.js-code-nodes.json +0 -19
- package/templates/sy-lowcode-app-workspace/tsconfig.json +0 -7
- package/templates/sy-lowcode-app-workspace/tsconfig.node.json +0 -10
- package/templates/sy-lowcode-app-workspace/vite.config.ts +0 -85
- package/v2/README.md +0 -35
- package/v2/skills/manifest.json +0 -45
- package/v2/skills/openxiangda-v1-maintenance/SKILL.md +0 -21
- package/v2/skills/openxiangda-v1-maintenance/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2/SKILL.md +0 -38
- package/v2/skills/openxiangda-v2-architecture/SKILL.md +0 -29
- package/v2/skills/openxiangda-v2-architecture/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-backend/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-backend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-data-authz/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-data-authz/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-delivery/SKILL.md +0 -30
- package/v2/skills/openxiangda-v2-delivery/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-frontend/SKILL.md +0 -21
- package/v2/skills/openxiangda-v2-frontend/agents/openai.yaml +0 -4
- package/v2/skills/openxiangda-v2-workflow-events/SKILL.md +0 -28
- package/v2/skills/openxiangda-v2-workflow-events/agents/openai.yaml +0 -4
- /package/{v2/skills → skills}/openxiangda-v2/agents/openai.yaml +0 -0
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
# Workflow V3 Reference
|
|
2
|
-
|
|
3
|
-
Workflow definitions are v3 graph JSON objects saved by `openxiangda workflow create`.
|
|
4
|
-
|
|
5
|
-
AI-authored workflows should prefer the compile-time TypeScript DSL. The SDK compiles local `workflow.ts` into the current v3 graph JSON, so the backend still uses the existing workflow engine for approval tasks, copy tasks, return/resubmit, transfer, callback waits, branch advancement, operation logs, notifications, and process completion events. Write raw JSON only when repairing a pulled designer definition.
|
|
6
|
-
|
|
7
|
-
Example `src/workflows/expense_approval/workflow.ts`:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import { defineWorkflow } from "openxiangda/workflow";
|
|
11
|
-
|
|
12
|
-
export default defineWorkflow({
|
|
13
|
-
build(flow) {
|
|
14
|
-
const start = flow.start();
|
|
15
|
-
const approve = flow.approval("manager_approval", {
|
|
16
|
-
label: "主管审批",
|
|
17
|
-
approverType: "ext_target_approval",
|
|
18
|
-
approvals: ["USER_MANAGER"],
|
|
19
|
-
approvalNames: ["主管"],
|
|
20
|
-
multiApprove: "or",
|
|
21
|
-
actions: [
|
|
22
|
-
flow.action.approve("通过"),
|
|
23
|
-
flow.action.reject("驳回"),
|
|
24
|
-
flow.action.transfer(),
|
|
25
|
-
flow.action.return(),
|
|
26
|
-
],
|
|
27
|
-
returnPolicy: { scopeType: "initiator", resubmitMode: "resume_current" },
|
|
28
|
-
fieldPermissions: [{ fieldId: "amount", fieldBehavior: "READONLY" }],
|
|
29
|
-
});
|
|
30
|
-
const sync = flow.functionCall("sync_budget", {
|
|
31
|
-
functionCode: "sync_budget",
|
|
32
|
-
input: { amount: "{{form.amount}}" },
|
|
33
|
-
saveResponseTo: "budgetResult",
|
|
34
|
-
});
|
|
35
|
-
const copy = flow.copy("copy_finance", {
|
|
36
|
-
label: "抄送财务",
|
|
37
|
-
approverType: "ext_target_approval",
|
|
38
|
-
approvals: ["USER_FINANCE"],
|
|
39
|
-
approvalNames: ["财务"],
|
|
40
|
-
});
|
|
41
|
-
const end = flow.end();
|
|
42
|
-
flow.sequence(start, approve, sync, copy, end);
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
For compact AI-authored drafts, `flow.define` is also exported. It accepts
|
|
48
|
-
declarative node and edge helpers, then compiles to the same v3 JSON:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
import { flow } from "openxiangda/workflow";
|
|
52
|
-
|
|
53
|
-
export default flow.define({
|
|
54
|
-
name: "费用审批",
|
|
55
|
-
formUuid: "FORM_UUID",
|
|
56
|
-
nodes: [
|
|
57
|
-
flow.start("start"),
|
|
58
|
-
flow.approval("manager_approval", {
|
|
59
|
-
label: "主管审批",
|
|
60
|
-
assignees: [flow.assignee.initiator()],
|
|
61
|
-
actions: [
|
|
62
|
-
flow.action.approve("通过"),
|
|
63
|
-
flow.action.returnToInitiator(),
|
|
64
|
-
flow.action.transfer(),
|
|
65
|
-
],
|
|
66
|
-
fieldPermissions: { amount: "readonly" },
|
|
67
|
-
}),
|
|
68
|
-
flow.functionCall("sync_budget", {
|
|
69
|
-
functionName: "sync_budget",
|
|
70
|
-
input: { amount: "${amount}" },
|
|
71
|
-
}),
|
|
72
|
-
flow.end("end"),
|
|
73
|
-
],
|
|
74
|
-
edges: [
|
|
75
|
-
flow.connect("start", "manager_approval"),
|
|
76
|
-
flow.connect("manager_approval", "sync_budget"),
|
|
77
|
-
flow.connect("sync_budget", "end"),
|
|
78
|
-
],
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Resource manifest:
|
|
83
|
-
|
|
84
|
-
```json
|
|
85
|
-
{
|
|
86
|
-
"code": "expense_approval",
|
|
87
|
-
"formCode": "expense",
|
|
88
|
-
"workflowFile": "../../../workflows/expense_approval/workflow.ts",
|
|
89
|
-
"definitionFile": "definition.v3.json",
|
|
90
|
-
"previewFile": "preview.json",
|
|
91
|
-
"publish": true
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
During `openxiangda resource validate`, `resource plan`, and `resource publish --dry-run`, the CLI compiles `workflowFile` without writing generated files or platform resources. During real `openxiangda resource publish`, the CLI compiles `workflowFile`, writes `definitionFile` and `previewFile` when configured, sends v3 `definitionJson` to the backend, and stores the preview in `viewJson` for read-only frontend display.
|
|
96
|
-
|
|
97
|
-
Compile locally before publishing:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
openxiangda workflow compile src/workflows/expense_approval/workflow.ts --check
|
|
101
|
-
openxiangda workflow compile src/workflows/expense_approval/workflow.ts --stdout
|
|
102
|
-
openxiangda workflow compile src/workflows/expense_approval/workflow.ts \
|
|
103
|
-
--out-definition src/resources/workflows/expense_approval/definition.v3.json \
|
|
104
|
-
--out-preview src/resources/workflows/expense_approval/preview.json
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Runtime pages should not guess buttons. Use `sdk.process.resolveCapabilities(...)` or the React helpers from `openxiangda/runtime/react`: `useProcessCapabilities`, `useProcessActions`, `ProcessActionBar`, `ProcessTimeline`, `ProcessPreviewPanel`, and `InitiatorApproverSelector`. The capability protocol returns `visible`, `enabled`, `disabledReason`, `paramsSchema`, `uiSchema`, return candidates, field permissions, and refresh hints for operations such as approve, reject, transfer, return, save, withdraw, resubmit, callback, retryException, and adminTransfer.
|
|
108
|
-
|
|
109
|
-
Runtime todo, done, cc, and initiated lists should use `sdk.workCenter.listItems({ boxType })` plus `sdk.workCenter.getStats()`. These APIs return the current user's projected work-center items with pagination, app/form filters, status/result filters, `actionUrl`, `formUuid`, `formInstanceId`, `taskId`, and node/title snapshots. Do not query workflow operation logs, automation logs, or raw process task tables for end-user task-center pages.
|
|
110
|
-
|
|
111
|
-
For delayed approval start, do not submit a process form and then delete/recreate records. Save the process-form instance without starting workflow via `StandardFormPage submitBehavior="save-draft"` or `sdk.form.create({ formUuid, data, saveAsDraft: true, startProcess: false })`. Later start approval on that same `formInstId` with `sdk.process.startFromExistingInstance({ formUuid, formInstId })` or `StandardFormPage submitBehavior="start-existing-process"`.
|
|
112
|
-
|
|
113
|
-
For return-to-initiator workflows, prefer `returnPolicy: { scopeType: "initiator", resubmitMode: "resume_current" }` or `flow.action.returnToInitiator()`. The runtime capabilities protocol exposes `resubmit` only on pending `originator_return` tasks. If a user returns to a previous approval node, continuing the flow is a normal `approve` action on that returned approval task.
|
|
114
|
-
|
|
115
|
-
## Cookbook: draft, start, return, resubmit
|
|
116
|
-
|
|
117
|
-
Use this pattern when the business user creates real data first and starts approval later from the same form instance. Do not copy the draft into a new process record.
|
|
118
|
-
|
|
119
|
-
1. Define a semantic workflow with an approval node that can save, return to the initiator, and resume the current approval after resubmission:
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
import { defineWorkflow } from "openxiangda/workflow";
|
|
123
|
-
|
|
124
|
-
export default defineWorkflow({
|
|
125
|
-
build(flow) {
|
|
126
|
-
const start = flow.start();
|
|
127
|
-
const approval = flow.approval("manager_approval", {
|
|
128
|
-
label: "Manager approval",
|
|
129
|
-
approverType: "ext_target_approval",
|
|
130
|
-
approvals: ["USER_MANAGER"],
|
|
131
|
-
approvalNames: ["Manager"],
|
|
132
|
-
actions: [
|
|
133
|
-
flow.action.approve("Approve"),
|
|
134
|
-
flow.action.reject("Reject"),
|
|
135
|
-
flow.action.save("Save"),
|
|
136
|
-
flow.action.transfer("Transfer"),
|
|
137
|
-
flow.action.returnToInitiator("Return to initiator", {
|
|
138
|
-
resubmitMode: "resume_current",
|
|
139
|
-
}),
|
|
140
|
-
],
|
|
141
|
-
returnPolicy: {
|
|
142
|
-
scopeType: "initiator",
|
|
143
|
-
resubmitMode: "resume_current",
|
|
144
|
-
},
|
|
145
|
-
});
|
|
146
|
-
flow.sequence(start, approval, flow.end());
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
2. Publish the process form before publishing the workflow resource. The form publish initializes the process-form storage table used by delayed starts:
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
openxiangda workspace publish --form expense --profile dev
|
|
155
|
-
openxiangda workflow compile src/workflows/expense_approval/workflow.ts --check
|
|
156
|
-
openxiangda resource publish --profile dev --dry-run
|
|
157
|
-
openxiangda resource publish --profile dev
|
|
158
|
-
openxiangda workflow list --profile dev --json
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
If the target workflow is a draft after resource publish, run `openxiangda workflow publish <workflowCode> --profile dev` until `isPublished: true` is visible.
|
|
162
|
-
|
|
163
|
-
3. Save the process-form record without starting approval:
|
|
164
|
-
|
|
165
|
-
```tsx
|
|
166
|
-
await sdk.form.create({
|
|
167
|
-
formUuid,
|
|
168
|
-
data: draftValues,
|
|
169
|
-
saveAsDraft: true,
|
|
170
|
-
startProcess: false,
|
|
171
|
-
});
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Standard form pages can use the built-in behavior:
|
|
175
|
-
|
|
176
|
-
```tsx
|
|
177
|
-
<StandardFormPage
|
|
178
|
-
schema={schema}
|
|
179
|
-
mode="submit"
|
|
180
|
-
submitBehavior="save-draft"
|
|
181
|
-
/>
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
4. Later, start approval on the same `formInstId`. The current operator becomes the workflow initiator by default:
|
|
185
|
-
|
|
186
|
-
```tsx
|
|
187
|
-
await sdk.process.startFromExistingInstance({
|
|
188
|
-
formUuid,
|
|
189
|
-
formInstId,
|
|
190
|
-
updateFormDataJson: JSON.stringify(finalValues),
|
|
191
|
-
submissionDepartmentId,
|
|
192
|
-
selectedApprovers,
|
|
193
|
-
});
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
Standard form pages can start approval in place:
|
|
197
|
-
|
|
198
|
-
```tsx
|
|
199
|
-
<StandardFormPage
|
|
200
|
-
schema={schema}
|
|
201
|
-
mode="submit"
|
|
202
|
-
formInstanceId={formInstId}
|
|
203
|
-
submitBehavior="start-existing-process"
|
|
204
|
-
/>
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
5. In a custom detail page, render operations from capabilities instead of hard-coded buttons:
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
import {
|
|
211
|
-
ProcessActionBar,
|
|
212
|
-
ProcessTimeline,
|
|
213
|
-
useProcessCapabilities,
|
|
214
|
-
} from "openxiangda/runtime/react";
|
|
215
|
-
|
|
216
|
-
export function ContractApprovalPanel({ formUuid, formInstId, getValues }) {
|
|
217
|
-
const capabilityParams = { formUuid, formInstId };
|
|
218
|
-
const process = useProcessCapabilities(capabilityParams);
|
|
219
|
-
|
|
220
|
-
return (
|
|
221
|
-
<>
|
|
222
|
-
<ProcessActionBar
|
|
223
|
-
capabilities={process.capabilities}
|
|
224
|
-
formUuid={formUuid}
|
|
225
|
-
getFormValues={getValues}
|
|
226
|
-
onRefreshCapabilities={process.refresh}
|
|
227
|
-
/>
|
|
228
|
-
<ProcessTimeline capabilities={process.capabilities} />
|
|
229
|
-
</>
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
6. Return-to-initiator flow:
|
|
235
|
-
|
|
236
|
-
- Approver executes the `return` operation. For initiator return, the return candidate normally has `nodeId: "__originator__"` or equivalent initiator metadata.
|
|
237
|
-
- Initiator resolves capabilities for the same `formInstId` or returned `taskId`; the current task should be `nodeType: "originator_return"`.
|
|
238
|
-
- Initiator executes `resubmit` with updated form data.
|
|
239
|
-
- With `resubmitMode: "resume_current"`, the engine restores the source approval task. The next capabilities response should show an approval task again, often with `taskKind: "resume"`.
|
|
240
|
-
- The approver then uses the normal `approve` action. Final form search snapshots should show `processInstanceStatus: "completed"` and `approvalResult: "approved"`.
|
|
241
|
-
|
|
242
|
-
## Capability action reference
|
|
243
|
-
|
|
244
|
-
Always call `sdk.process.resolveCapabilities(...)` first. It returns instance state, current task, field permissions, timeline, and `operations`. Each operation includes `key`, `label`, `visible`, `enabled`, `disabledReason`, `taskId`, `instanceId`, `nodeId`, `paramsSchema`, `uiSchema`, `returnableNodes`, and `refreshHints`. Render only operations where `visible !== false`; if `enabled === false`, show `disabledReason`.
|
|
245
|
-
|
|
246
|
-
Use `paramsSchema` and `uiSchema` as the source of truth for dialogs. Do not hard-code which operation needs a modal or which fields are required.
|
|
247
|
-
|
|
248
|
-
| Operation | When it appears | SDK method | Required IDs | Common params |
|
|
249
|
-
| --- | --- | --- | --- | --- |
|
|
250
|
-
| `startProcess` | Saved process-form instance that has no workflow instance yet | `sdk.process.startFromExistingInstance` | `formUuid`, `formInstId` / `formInstanceId` | `updateFormDataJson`, `submissionDepartmentId`, `selectedApprovers`, `initiatorSelectedApprovers` |
|
|
251
|
-
| `approve` | Current user has a pending approval task | `sdk.process.approve` | `instanceId` (process instance ID, not task ID) | `comments`, `updateFormDataJson` |
|
|
252
|
-
| `reject` | Current user can reject the pending approval task | `sdk.process.reject` | `instanceId` (process instance ID, not task ID) | `comments`, `updateFormDataJson` |
|
|
253
|
-
| `save` | Current task allows editing without advancing the workflow | `sdk.process.saveTask` | `instanceId`, `formUuid` | `updateFormDataJson`, `comments` |
|
|
254
|
-
| `transfer` | Current user can transfer the current task | `sdk.process.transferTask` | `taskId` | `newAssignee`, `reason` |
|
|
255
|
-
| `return` | Current approval task has return candidates | `sdk.process.returnTask` | `taskId`, `targetNodeId` | `reason`; choose `targetNodeId` from `operation.returnableNodes` |
|
|
256
|
-
| `withdraw` | Initiator can withdraw a running process | `sdk.process.withdraw` | `instanceId` | `reason` |
|
|
257
|
-
| `resubmit` | Initiator is handling an `originator_return` task | `sdk.process.resubmitTask` | `taskId`, `formUuid` | `updateFormDataJson`, `comments`, `selectedApprovers`, `initiatorSelectedApprovers` |
|
|
258
|
-
| `callback` | Process is waiting on a callback task | `sdk.process.triggerCallback` | `taskId` | `payload` |
|
|
259
|
-
| `retryException` | Process instance is in exception state and user can retry | `sdk.process.retryException` | `instanceId` | none |
|
|
260
|
-
| `adminTransfer` | App/platform admin can reassign a task | `sdk.process.adminTransferTask` | `taskId` | `newAssignee`, `reason` |
|
|
261
|
-
|
|
262
|
-
Recommended custom dispatcher:
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
const caps = await sdk.process.resolveCapabilities({ formUuid, formInstId });
|
|
266
|
-
const op = caps.result.operations.find((item) => item.key === "return");
|
|
267
|
-
if (!op?.enabled) throw new Error(op?.disabledReason || "return unavailable");
|
|
268
|
-
|
|
269
|
-
await sdk.process.returnTask({
|
|
270
|
-
taskId: String(op.taskId),
|
|
271
|
-
targetNodeId: String(op.returnableNodes?.[0]?.nodeId),
|
|
272
|
-
reason: "Need more information",
|
|
273
|
-
});
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
After every successful action, refresh the surfaces listed by `operation.refreshHints`. In most pages this means reloading capabilities, process basic/progress, timeline, and form data. `ProcessActionBar` does this when `onRefreshCapabilities` or `capabilityParams` is provided.
|
|
277
|
-
|
|
278
|
-
Troubleshooting:
|
|
279
|
-
|
|
280
|
-
- If `approve` or `reject` returns "process instance not found", check that the request used `instanceId`, not `taskId`.
|
|
281
|
-
- If `return` has no valid target, inspect `operation.returnableNodes` and the workflow node `returnPolicy`; do not invent a node ID.
|
|
282
|
-
- If `resubmit` is missing, make sure the active task is `originator_return`; a task returned to a previous approval node continues with normal `approve`.
|
|
283
|
-
- If a workflow created by `resource publish` is not active, run `openxiangda workflow list --profile <name> --json` and publish the workflow until `isPublished: true`.
|
|
284
|
-
- If `workflow list` shows a row with empty `resourceCode`, it is a platform shell workflow. The default list hides those rows; use `--all` only for raw diagnostics.
|
|
285
|
-
|
|
286
|
-
Minimum shape:
|
|
287
|
-
|
|
288
|
-
```json
|
|
289
|
-
{
|
|
290
|
-
"version": "v3",
|
|
291
|
-
"nodes": [
|
|
292
|
-
{ "id": "start", "type": "start", "data": { "label": "开始" } },
|
|
293
|
-
{ "id": "approve", "type": "approval", "data": { "label": "审批" } },
|
|
294
|
-
{ "id": "end", "type": "end", "data": { "label": "结束" } }
|
|
295
|
-
],
|
|
296
|
-
"edges": [
|
|
297
|
-
{ "id": "e1", "source": "start", "target": "approve" },
|
|
298
|
-
{ "id": "e2", "source": "approve", "target": "end" }
|
|
299
|
-
],
|
|
300
|
-
"flowConfig": {}
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
Rules:
|
|
305
|
-
|
|
306
|
-
- `nodes` and `edges` must be arrays.
|
|
307
|
-
- `version` must be `v3`.
|
|
308
|
-
- Publishing requires one `start` node and at least one `end` node.
|
|
309
|
-
- Each node needs `id`, `type`, and object `data`.
|
|
310
|
-
- Edges must reference existing node IDs.
|
|
311
|
-
- Keep live platform IDs out of the JSON when possible. Resolve `formUuid` and `workflowId` through CLI state.
|
|
312
|
-
- JS_CODE V2 supports trusted Node execution. For AI/admin logic use `runtimeMode: "trusted_node"`.
|
|
313
|
-
|
|
314
|
-
Supported node types:
|
|
315
|
-
|
|
316
|
-
- `start`
|
|
317
|
-
- `approval`
|
|
318
|
-
- `condition`
|
|
319
|
-
- `condition_branch`
|
|
320
|
-
- `end`
|
|
321
|
-
- `copy`
|
|
322
|
-
- `js_code`
|
|
323
|
-
- `branch`
|
|
324
|
-
- `data_retrieve_single`
|
|
325
|
-
- `data_retrieve_batch`
|
|
326
|
-
- `data_create`
|
|
327
|
-
- `data_update`
|
|
328
|
-
- `loop_container`
|
|
329
|
-
- `connector_call`
|
|
330
|
-
- `function_call`
|
|
331
|
-
- `callback_wait`
|
|
332
|
-
- `work_notification`
|
|
333
|
-
- `dingtalk_card`
|
|
334
|
-
|
|
335
|
-
## JS_CODE V2
|
|
336
|
-
|
|
337
|
-
Workflow JS_CODE runs on the backend when the process reaches the `js_code` node. Use it before or after approval nodes, in branches, or before ending a process when the workflow needs server-side side effects such as cross-form synchronization, audit record creation, external API calls, or terminating a related process. Do not use it for frontend-only behavior.
|
|
338
|
-
|
|
339
|
-
Inline:
|
|
340
|
-
|
|
341
|
-
```json
|
|
342
|
-
{
|
|
343
|
-
"id": "calc",
|
|
344
|
-
"type": "js_code",
|
|
345
|
-
"data": {
|
|
346
|
-
"label": "计算",
|
|
347
|
-
"runtimeMode": "trusted_node",
|
|
348
|
-
"sourceType": "inline",
|
|
349
|
-
"code": "const crypto = require('crypto'); variables.hash = crypto.createHash('sha256').update('x').digest('hex'); return variables.hash;",
|
|
350
|
-
"timeout": 30000
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
File snapshot:
|
|
356
|
-
|
|
357
|
-
```json
|
|
358
|
-
{
|
|
359
|
-
"id": "sync_customer",
|
|
360
|
-
"type": "js_code",
|
|
361
|
-
"data": {
|
|
362
|
-
"label": "同步客户",
|
|
363
|
-
"runtimeMode": "trusted_node",
|
|
364
|
-
"sourceType": "file_snapshot",
|
|
365
|
-
"scriptCode": "sync_customer",
|
|
366
|
-
"sourceFile": {
|
|
367
|
-
"localPath": "src/js-code-nodes/sync_customer/index.ts"
|
|
368
|
-
},
|
|
369
|
-
"timeout": 30000
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
AI-authored JS_CODE source must be TypeScript under `src/js-code-nodes/<scriptCode>/index.ts`. When validating or creating, the CLI runs `pnpm build-js-code --script <scriptCode>`, which typechecks only the selected entry plus its transitive/shared/ambient dependencies, bundles to `dist/js-code-nodes/<scriptCode>/index.cjs`, uploads the bundle, and replaces `sourceFile.localPath` with immutable snapshot metadata. An intentionally unscoped build retains full-workspace TypeScript validation. The backend verifies snapshot `sha256`, runs it in the trusted Node runtime, applies the node timeout (`30000` ms by default), stores console/runtime logs in the execution record, and writes the returned value to the node output and `variables.node_<nodeId>`.
|
|
375
|
-
|
|
376
|
-
For reusable backend logic that should be shared by pages, automations, and workflows, prefer an App Function under `src/functions/<functionCode>/index.ts` plus `src/resources/functions/<functionCode>.json`. Workflow graphs that support App Function nodes can call it with:
|
|
377
|
-
|
|
378
|
-
```json
|
|
379
|
-
{
|
|
380
|
-
"id": "call_summary",
|
|
381
|
-
"type": "function_call",
|
|
382
|
-
"data": {
|
|
383
|
-
"functionCode": "reservation_reminder_summary",
|
|
384
|
-
"input": { "scope": "process" },
|
|
385
|
-
"saveResponseTo": "summary"
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
Use JS_CODE V2 when the script is local to one workflow node.
|
|
391
|
-
|
|
392
|
-
Scripts can export `export default async function (ctx) {}` or `module.exports = async (ctx) => {}`. The runtime exposes `ctx.triggerEvent`, `ctx.formData`, `ctx.workflowData`, `ctx.operator`, `ctx.app`, `ctx.variables`, `ctx.resources`, `ctx.form`, `ctx.dataView`, `ctx.connector`, `ctx.notification`, `ctx.organization`, `ctx.platform.roles.*`, `ctx.platform.api.*`, `ctx.utils`, `require`, `process`, and `Buffer`. App Functions additionally expose `ctx.process.startFromExistingInstance/resolveCapabilities/resubmitTask/withdraw/transferTask`; trusted code is scoped to its current tenant/application and reuses the real operator's official workflow permission, operation-log, event, idempotency, and replay paths. Per-resource declarations are optional mapping/audit metadata, not an application-internal authorization list. Prefer `ctx.resources.resolveForm/resolveDataView/resolveConnector`, `ctx.form.queryOne/queryMany/getById/createOne/updateOne/updateById`, `ctx.dataView.query/stats`, `ctx.connector.call/invoke`, and `ctx.platform.roles.findByCode/addUsers/removeUser` for platform-side work. Use `ctx.organization.departments.*` and `ctx.organization.accounts.*` only for intentional organization-management flows; the real operator/audit actor must hold `app:organization:manage`. App Function and trusted-node form writes are backend operations, not direct page-user submit access; keep internal forms closed to raw user submission unless the business requires it. Raw `ctx.platform.api.*` calls return HTTP response plus platform envelope. Legacy data/process bridge methods remain available as `ctx.methods.queryOneData/queryManyData/getDataByFormInstanceId/updateOneData/updateDataByFormInstanceId/updateManyData/createOneData/terminateProcess/getAllParentDepartments`.
|
|
393
|
-
|
|
394
|
-
Example `src/js-code-nodes/sync_customer/index.ts`:
|
|
395
|
-
|
|
396
|
-
```ts
|
|
397
|
-
export default async function syncCustomer(ctx) {
|
|
398
|
-
const current = ctx.formData?.current || {};
|
|
399
|
-
const appType = ctx.app.appType;
|
|
400
|
-
const customerNo = current.customer_no;
|
|
401
|
-
|
|
402
|
-
const customer = await ctx.methods.queryOneData(appType, "FORM_CUSTOMER", {
|
|
403
|
-
customer_no: customerNo,
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
if (customer) {
|
|
407
|
-
await ctx.methods.updateOneData(
|
|
408
|
-
appType,
|
|
409
|
-
"FORM_CUSTOMER",
|
|
410
|
-
{ customer_no: customerNo },
|
|
411
|
-
{ last_approved_at: new Date().toISOString() }
|
|
412
|
-
);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
const log = await ctx.methods.createOneData(appType, "FORM_SYNC_LOG", {
|
|
416
|
-
source: "workflow",
|
|
417
|
-
customer_no: customerNo,
|
|
418
|
-
result: customer ? "updated" : "missing",
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
return {
|
|
422
|
-
customerFound: Boolean(customer),
|
|
423
|
-
logId: log?.formInstanceId || log?.id,
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
Field permission config lives in `flowConfig` by node ID:
|
|
429
|
-
|
|
430
|
-
```json
|
|
431
|
-
{
|
|
432
|
-
"flowConfig": {
|
|
433
|
-
"approve": [
|
|
434
|
-
{ "fieldId": "amount", "fieldBehavior": "READONLY" },
|
|
435
|
-
{ "fieldId": "remark", "fieldBehavior": "NORMAL" }
|
|
436
|
-
]
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
```
|
|
440
|
-
|
|
441
|
-
Allowed `fieldBehavior` values: `NORMAL`, `READONLY`, `HIDDEN`.
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
# Workspace State
|
|
2
|
-
|
|
3
|
-
OpenXiangda durable project bindings live in `.openxiangda/state.json`. Volatile release execution, candidate, deployment, and recovery progress lives under the private `.openxiangda/releases/` journal and must not be copied into the durable ID map.
|
|
4
|
-
|
|
5
|
-
Tokens never belong in the project. User tokens live in `~/.openxiangda/profiles.json`. Shared workspace env values such as `APP_OSS_*` live in `~/.openxiangda/.env` by default, while project `.env` is only a local override.
|
|
6
|
-
|
|
7
|
-
## Shape
|
|
8
|
-
|
|
9
|
-
```json
|
|
10
|
-
{
|
|
11
|
-
"version": 1,
|
|
12
|
-
"profiles": {
|
|
13
|
-
"dev": {
|
|
14
|
-
"baseUrl": "https://dev-lowcode.example.com/service",
|
|
15
|
-
"appType": "APP_DEV",
|
|
16
|
-
"resources": {
|
|
17
|
-
"forms": {
|
|
18
|
-
"customer": {
|
|
19
|
-
"formUuid": "FORM_XXX"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"pages": {
|
|
23
|
-
"dashboard": {
|
|
24
|
-
"pageId": "PAGE_XXX",
|
|
25
|
-
"routeKey": "dashboard",
|
|
26
|
-
"legacyFormUuid": "FORM_LEGACY_PAGE"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"workflows": {},
|
|
30
|
-
"automations": {},
|
|
31
|
-
"menus": {},
|
|
32
|
-
"roles": {},
|
|
33
|
-
"connectors": {},
|
|
34
|
-
"dataViews": {
|
|
35
|
-
"ticket_with_customer": {
|
|
36
|
-
"dataViewId": "DV_XXX",
|
|
37
|
-
"materializedViewName": "mv_dv_abc123",
|
|
38
|
-
"status": "active"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"notifications": {
|
|
42
|
-
"templates": {},
|
|
43
|
-
"typeConfigs": {}
|
|
44
|
-
},
|
|
45
|
-
"pagePermissionGroups": {},
|
|
46
|
-
"formPermissionGroups": {},
|
|
47
|
-
"formSettings": {}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Environment-managed workspaces add a logical application and target-specific bindings. The legacy `profiles` map may remain for compatibility, but managed commands resolve only the selected target:
|
|
55
|
-
|
|
56
|
-
```json
|
|
57
|
-
{
|
|
58
|
-
"version": 1,
|
|
59
|
-
"logicalApp": {
|
|
60
|
-
"id": "ENVSET_UUID",
|
|
61
|
-
"code": "instrument-sharing",
|
|
62
|
-
"name": "大型仪器共享"
|
|
63
|
-
},
|
|
64
|
-
"currentTarget": "preproduction",
|
|
65
|
-
"targets": {
|
|
66
|
-
"preproduction": {
|
|
67
|
-
"profile": "hgy",
|
|
68
|
-
"environmentId": "PRE_ENV_UUID",
|
|
69
|
-
"kind": "preproduction",
|
|
70
|
-
"appType": "APP_PRE",
|
|
71
|
-
"revision": 4,
|
|
72
|
-
"sideEffectPolicy": {
|
|
73
|
-
"notifications": "tester_allowlist",
|
|
74
|
-
"notificationAllowlist": [],
|
|
75
|
-
"organizationWrites": "deny",
|
|
76
|
-
"scheduledAutomations": "disabled",
|
|
77
|
-
"externalWrites": "allowlist",
|
|
78
|
-
"payments": "deny",
|
|
79
|
-
"publicIndexing": "deny",
|
|
80
|
-
"environmentBanner": true
|
|
81
|
-
},
|
|
82
|
-
"resources": {}
|
|
83
|
-
},
|
|
84
|
-
"production": {
|
|
85
|
-
"profile": "hgy",
|
|
86
|
-
"environmentId": "PROD_ENV_UUID",
|
|
87
|
-
"kind": "production",
|
|
88
|
-
"appType": "APP_PROD",
|
|
89
|
-
"resources": {}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Rules
|
|
96
|
-
|
|
97
|
-
- Profile is the deployment boundary.
|
|
98
|
-
- For an environment-managed logical application, the selected target is the deployment boundary inside the profile. `preproduction` and `production` own independent appType, resource IDs, Release Heads, data, and side-effect policy. Their volatile deployment progress is isolated in `.openxiangda/releases/targets/`.
|
|
99
|
-
- `baseUrl` is the backend API base. On standard private deployments it is `<origin>/service`; management pages use `/platform`, and app runtime pages use `/view`.
|
|
100
|
-
- Local state is authoritative for app binding. If a workspace has no `appType` for the target profile, create a new app/workspace with `openxiangda workspace init <dir> --profile <name> --app-name "应用名称"`.
|
|
101
|
-
- Do not search platform apps or reuse similar names unless the user explicitly asks to reuse an existing app or provides an `appType`.
|
|
102
|
-
- Local resource keys are logical codes.
|
|
103
|
-
- Live IDs and lightweight runtime aliases are nested under the profile that produced them.
|
|
104
|
-
- `resources.dataViews` is keyed by data view `code` and stores only profile-local platform metadata such as `dataViewId`, `materializedViewName`, and last known `status`.
|
|
105
|
-
- The stored DataView `status` is observational: managed staging legitimately moves it between `draft` and `active`. Candidate binding validation ignores only that field, including for older sealed candidates, while keeping `dataViewId`, `materializedViewName`, `storageMode`, and all non-DataView status fields strict.
|
|
106
|
-
- Data view definitions, refresh config, permissions, and source `formCode` references belong in `src/resources/data-views/*.json`, not in state.
|
|
107
|
-
- Do not store business configuration or secrets in `.openxiangda/state.json`; store those in `src/resources/`.
|
|
108
|
-
- CLI writes use a lock, a three-way merge at profile/resource-key granularity, and fsync + atomic rename. Concurrent writes to different profiles or logical resource keys are preserved; competing writes to the same field fail with `OPENXIANGDA_STATE_CONFLICT` and must be retried from a freshly loaded state.
|
|
109
|
-
- This protects the ID map from truncation/lost updates. Concurrent development still uses separate Git worktrees/branches; `.openxiangda/worktree-owner.json` binds one worktree to one active `CODEX_THREAD_ID` and blocks a second task at SDD context/publish time.
|
|
110
|
-
- A prod publish must not read dev IDs.
|
|
111
|
-
- Never copy target resource bindings. Use `openxiangda environment use <target>` or pass `--environment <target>` and let the CLI populate that target from its own deployment.
|
|
112
|
-
- Managed targets cannot use direct `release publish`; use `release ship`. The normal first invocation prepares preproduction and stops, while a later `--confirm-production` promotes the same sealed candidate. Explicitly authorized emergencies may place `--confirm-production` on the first invocation to run both ordered phases in one command. The candidate freezes stable environment/resource bindings and target-specific Runtime artifacts, and both server deployments must finish as `succeeded`. A frozen baseline-adoption intent is reused from `ship.json`; a different repeated intent fails before a request. Human acceptance is recommended and may be recorded with optional `--acceptance-note`.
|
|
113
|
-
- In a managed workspace with multiple targets, `function invoke` must include `--environment <target>` and reports the resolved target on stderr before sending the request.
|
|
114
|
-
- Change a single target's side-effect policy with `openxiangda environment policy update <kind|id> --side-effect-policy-json <JSON|file> --reason "..." --dry-run`, inspect the exact diff, then repeat without `--dry-run`. The write uses the server revision as CAS and updates local `revision`; it does not swap roles or alter Release Heads. Omitted fields are preserved unless `--full-replace` is explicit, and production additionally requires `--confirm-production`.
|
|
115
|
-
- Before publishing to another platform, run `openxiangda workspace bind --profile <name> --app-type <APP_XXX>`.
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: openxiangda-app
|
|
3
|
-
description: Manage OpenXiangda low-code apps and workspaces — create / scaffold / bind / inspect / publish apps, manage menus / nav / 导航 / 菜单, app snapshots, and the profile-isolated `.openxiangda/state.json` resource map. Trigger on 创建应用 / 新建 app / scaffold app / 初始化工作区 / workspace init / workspace bind / appType / APP_XXX / app snapshot / 应用快照 / 菜单 / menu / nav, or when the user starts work in an empty folder that should become a sy-lowcode-app-workspace.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# OpenXiangda App
|
|
7
|
-
|
|
8
|
-
## When to use this skill
|
|
9
|
-
|
|
10
|
-
- User wants to **create / scaffold a new app** or initialize a `sy-lowcode-app-workspace`.
|
|
11
|
-
- User wants to **bind** the workspace to an existing platform app (`APP_XXX`) for one profile.
|
|
12
|
-
- User asks about **menus / navigation / app snapshot / appType / .openxiangda/state.json shape**.
|
|
13
|
-
- Before scaffolding a real business app: read the architecture-pattern decision via `references/best-practices.md`.
|
|
14
|
-
|
|
15
|
-
## Decision card — new app vs. bind existing
|
|
16
|
-
|
|
17
|
-
| Situation | Action |
|
|
18
|
-
|---|---|
|
|
19
|
-
| Empty folder, no `.openxiangda/state.json`, user did NOT mention an `appType` | `openxiangda workspace init <dir> --profile <name> --app-name "..."` (creates a NEW app) |
|
|
20
|
-
| User explicitly provides `APP_XXX` or asks to reuse an existing app | `workspace init <dir> --profile <name> --app-type APP_XXX` |
|
|
21
|
-
| Existing workspace, no binding for the target profile | `openxiangda workspace bind --profile <name> --app-type APP_XXX` |
|
|
22
|
-
| Workspace already bound for the target profile | use it; never re-bind silently |
|
|
23
|
-
|
|
24
|
-
**Never** search the platform for similar app names to "reuse" — local `.openxiangda/state.json` is authoritative.
|
|
25
|
-
|
|
26
|
-
## Required Context
|
|
27
|
-
|
|
28
|
-
Always start from the current profile and workspace binding:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
openxiangda env --profile <name>
|
|
32
|
-
openxiangda auth status --profile <name>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
If the workspace is not bound:
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
openxiangda workspace init ./my-app-workspace --profile <name> --app-name "应用名称"
|
|
39
|
-
cd ./my-app-workspace
|
|
40
|
-
pnpm install
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
For new Phase 6 React SPA apps, use the standard React application template:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
openxiangda workspace init ./my-react-app \
|
|
47
|
-
--profile <name> \
|
|
48
|
-
--app-name "应用名称" \
|
|
49
|
-
--runtime react-spa
|
|
50
|
-
cd ./my-react-app
|
|
51
|
-
pnpm install
|
|
52
|
-
pnpm dev
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
React SPA workspaces use React Router, Tailwind CSS, `OpenXiangdaProvider`
|
|
56
|
-
from `openxiangda/runtime/react`, and resources under `src/resources/`.
|
|
57
|
-
Do not use old `isRenderNav`, app-shell, or workbench page parameters inside
|
|
58
|
-
React SPA routes.
|
|
59
|
-
|
|
60
|
-
Publish React SPA apps with:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
openxiangda resource publish --profile <name>
|
|
64
|
-
openxiangda runtime deploy --profile <name>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`runtime deploy` builds and activates the app-level SPA release for `/view/:appType/*`. It uploads `dist/` through staged multipart file uploads by default; use `--upload-mode legacy-json` only as an older-server fallback.
|
|
68
|
-
Publish React SPA forms separately with `openxiangda workspace publish --form <formCode>`;
|
|
69
|
-
with `runtimeMode: "react-spa"` this is schema-only and does not require OSS.
|
|
70
|
-
|
|
71
|
-
Bind to an existing app only when the user explicitly provides `appType` or asks to reuse an existing platform app:
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
openxiangda workspace init ./my-app-workspace --profile <name> --app-type APP_XXX
|
|
75
|
-
openxiangda workspace bind --profile <name> --app-type APP_XXX
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
For menu work:
|
|
79
|
-
|
|
80
|
-
```bash
|
|
81
|
-
openxiangda menu list --profile <name>
|
|
82
|
-
openxiangda menu create main --name "主菜单" --type nav --profile <name>
|
|
83
|
-
openxiangda menu create customer-entry --name "客户信息" --type receipt --form-code customer --profile <name>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
If the user explicitly asks to create an app without initializing a workspace:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
openxiangda app create "应用名称" --profile <name>
|
|
90
|
-
openxiangda app create "React应用名称" --profile <name> --runtime react-spa
|
|
91
|
-
openxiangda workspace bind --profile <name> --app-type APP_XXX
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Rules
|
|
95
|
-
|
|
96
|
-
- Never ask for AK/SK.
|
|
97
|
-
- Always pass `--profile` for publish or cross-platform operations.
|
|
98
|
-
- Local `.openxiangda/state.json` is authoritative. If the user starts from a new empty directory or the workspace has no app binding, create a new app with `openxiangda workspace init <dir> --profile <name> --app-name "应用名称"`.
|
|
99
|
-
- Do not search platform apps or reuse similar app names unless the user explicitly asks to reuse an existing app or gives an `appType`.
|
|
100
|
-
- Store platform-specific IDs only in `.openxiangda/state.json`.
|
|
101
|
-
- Use logical local codes for forms, pages, workflows, automations, and menus.
|
|
102
|
-
- Before scaffolding a new business app, read `references/best-practices.md` and pick an architecture from the initialized `examples/best-practices/` catalog. Do not generate a large single-file app page when a template pattern already covers the scenario.
|
|
103
|
-
- For Phase 6 React SPA apps, use `--runtime react-spa`. The generated app owns routing/layouts/menus with React Router and Tailwind CSS; platform permissions still come from backend runtime bootstrap and route checks.
|
|
104
|
-
- React SPA form publish is schema-only by default. Do not add OSS credentials or old embedded form bundles unless explicitly maintaining legacy compatibility with `--legacy-form-bundle`.
|
|
105
|
-
- When publishing after app edits, prefer targeted commands (`workspace publish --changed --dry-run`, then `--changed`, `--page`, `--form`, or `--only`). Do not publish all forms/pages just because one page changed.
|
|
106
|
-
- Use `openxiangda app snapshot <APP_XXX> --profile <name> --json` before changing an existing app.
|
|
107
|
-
|
|
108
|
-
## Resource State
|
|
109
|
-
|
|
110
|
-
Read `references/workspace-state.md` when changing `.openxiangda/state.json`.
|
|
111
|
-
|
|
112
|
-
Read `references/openxiangda-api.md` when exact endpoint fields are needed.
|
|
113
|
-
|
|
114
|
-
Read `references/resource-manifest-cheatsheet.md` before creating shared resources such as data views, connectors, notifications, App Functions, workflows, automations, permissions, settings, or menus.
|
|
115
|
-
|
|
116
|
-
Read `references/architecture-patterns.md` to understand the overall app structure (how forms, pages, menus, workflows, and permissions compose into an app, and the recommended `src/forms` / `src/pages` layout) before scaffolding or restructuring an app workspace.
|
|
117
|
-
|
|
118
|
-
Read `references/best-practices.md` before implementing app-level patterns such as status lifecycles, role governance, PC/mobile portals, high-performance data management pages, workflow boundaries, and automation.
|