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
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Backend
|
|
2
|
+
|
|
3
|
+
Keep normal record CRUD in the platform Data API. Use `apps/server` only for typed business actions that need server-side logic. For an interactive request, the platform gateway supplies the verified current user, complete application-role union and capabilities from the same platform authorization snapshot used by Data API. Controllers bind operations and capabilities through `openxiangda/nest`; workers continue to use their explicit application identity.
|
|
4
|
+
|
|
5
|
+
Do not duplicate resource persistence in controllers. Keep actions bounded and side-effect behavior explicit. Run `pnpm openxiangda dev` for the connected loop and `pnpm openxiangda check` before delivery.
|
|
6
|
+
|
|
7
|
+
Keep the generated `apps/server/src/main.ts` on
|
|
8
|
+
`bootstrapOpenXiangdaApplication(AppModule)`. Do not replace it with an
|
|
9
|
+
application-owned `NestFactory` or `FastifyAdapter`: the SDK bootstrap owns the
|
|
10
|
+
exact raw request bytes required by gateway signatures, proxy trust, shutdown
|
|
11
|
+
hooks, and the runtime listen contract.
|
|
12
|
+
|
|
13
|
+
Connected development and release builds deliberately use different compilers,
|
|
14
|
+
so application Nest classes must never depend on emitted constructor metadata.
|
|
15
|
+
Every constructor dependency in a `@Controller` or `@Injectable` class uses an
|
|
16
|
+
explicit token:
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { Controller, Inject } from '@nestjs/common';
|
|
20
|
+
import { OpenXiangdaStandardOperations } from 'openxiangda/nest';
|
|
21
|
+
|
|
22
|
+
@Controller('/api/visitor-reservations')
|
|
23
|
+
export class VisitorReservationsController {
|
|
24
|
+
constructor(
|
|
25
|
+
@Inject(OpenXiangdaStandardOperations)
|
|
26
|
+
private readonly operations: OpenXiangdaStandardOperations,
|
|
27
|
+
) {}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`openxiangda check` and `openxiangda dev` reject implicit constructor injection.
|
|
32
|
+
Do not silence that diagnostic or replace the connected-development compiler.
|
|
33
|
+
|
|
34
|
+
Backend routes are private to the application unless their operation declaration contains an explicit `ai` block. Never infer AI exposure or risk from the HTTP method. A write action declares its touched resources and non-empty side effects, for example:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
{
|
|
38
|
+
code: 'reservation.enroll',
|
|
39
|
+
method: 'POST',
|
|
40
|
+
path: '/api/reservations/enroll',
|
|
41
|
+
capability: 'app:visitor-app:reservation:enroll',
|
|
42
|
+
requestSchema: { type: 'object', properties: { visitorName: { type: 'string' } } },
|
|
43
|
+
responseSchema: { type: 'object' },
|
|
44
|
+
ai: {
|
|
45
|
+
name: '预约访客',
|
|
46
|
+
description: '校验预约规则并创建访客预约',
|
|
47
|
+
risk: 'write',
|
|
48
|
+
resources: ['reservations'],
|
|
49
|
+
sideEffects: ['reservations:create'],
|
|
50
|
+
concurrency: 'none',
|
|
51
|
+
timeoutMs: 10000,
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Every custom operation capability is declared once in
|
|
57
|
+
`authz.capabilities` with `kind: 'backend'`, then referenced by the operation
|
|
58
|
+
and granted to every role allowed to call it. A capability string written only
|
|
59
|
+
on an operation or role is invalid. Resource CRUD capabilities remain generated
|
|
60
|
+
and must not be copied into this catalog.
|
|
61
|
+
|
|
62
|
+
Generated CRUD and custom actions use the same platform Catalog, current-user authorization, Preview/Confirm boundary and idempotent execution path. Do not create an application-owned MCP server, preview store, AI role or database client.
|
|
63
|
+
|
|
64
|
+
For visitor duplicates, meeting-time conflicts, and course capacity, use
|
|
65
|
+
`OpenXiangdaStandardOperations`. These helpers submit the whole rule as one
|
|
66
|
+
platform transaction. Do not query mutable rows before calling them and do not
|
|
67
|
+
calculate replacement counters in application code. Course selection is a
|
|
68
|
+
locked `record-assert` plus a bounded `increment`; replay must reach the
|
|
69
|
+
platform idempotency receipt even after the course becomes full.
|
|
70
|
+
|
|
71
|
+
The visitor helper has one exact command shape. `duplicateMatch` is the actual
|
|
72
|
+
field-to-submitted-value object used for equality matching; it is never a list
|
|
73
|
+
of field names:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
return this.operations.createVisitorReservation({
|
|
77
|
+
reservationResourceCode: 'visitor-reservations',
|
|
78
|
+
duplicateMatch: {
|
|
79
|
+
visitorIdentityNumber: body.visitorIdentityNumber,
|
|
80
|
+
visitDate: body.visitDate,
|
|
81
|
+
startTime: body.startTime,
|
|
82
|
+
},
|
|
83
|
+
data: {
|
|
84
|
+
visitorIdentityNumber: body.visitorIdentityNumber,
|
|
85
|
+
visitDate: body.visitDate,
|
|
86
|
+
startTime: body.startTime,
|
|
87
|
+
status: body.status,
|
|
88
|
+
},
|
|
89
|
+
idempotencyKey: body.idempotencyKey,
|
|
90
|
+
activeStatusField: 'status',
|
|
91
|
+
activeStatusValues: ['pending', 'approved'],
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Use only declared field codes in `duplicateMatch`. Its values and `data` come
|
|
96
|
+
from the same immutable request body.
|
|
97
|
+
|
|
98
|
+
An idempotency key and the complete command payload are one immutable pair.
|
|
99
|
+
Never put `new Date()`, `Date.now()`, `randomUUID()` or another changing value
|
|
100
|
+
inside a controller while constructing the transaction. If a business time is
|
|
101
|
+
part of the record, declare it as a required operation request field; the
|
|
102
|
+
caller creates it once together with the idempotency key and reuses both on
|
|
103
|
+
every retry. Platform-created record timestamps remain the source of truth
|
|
104
|
+
when no separate business time is required.
|
|
105
|
+
|
|
106
|
+
When declaring a lower-level transaction directly, use only the current
|
|
107
|
+
contract:
|
|
108
|
+
|
|
109
|
+
- every guard has a stable `OPENXIANGDA_*` `errorCode`;
|
|
110
|
+
- `query-empty` protects a business-key uniqueness rule;
|
|
111
|
+
- `record-assert` locks one exact record and checks declared field values or
|
|
112
|
+
declared field-to-field comparisons;
|
|
113
|
+
- `increment` targets one declared integer field and must have a matching
|
|
114
|
+
same-resource, same-record `record-assert` guard;
|
|
115
|
+
- never send SQL, table names, expressions, old guards without `errorCode`, or
|
|
116
|
+
a pre-read/absolute-update fallback.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Data and Authorization
|
|
2
|
+
|
|
3
|
+
Declare a resource and every field exactly once in `openxiangda.config.ts`.
|
|
4
|
+
Do not write `schemaVersion`, `appCode`, `schema`, `capabilities`, `surface` or
|
|
5
|
+
resource-level `fieldPolicies`; those are compiler projections, not application
|
|
6
|
+
source. Do not create `platform/data` modules.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import {
|
|
10
|
+
currentUserDataPolicy,
|
|
11
|
+
defineOpenXiangdaApp,
|
|
12
|
+
resourceCapabilityCodes,
|
|
13
|
+
} from 'openxiangda/config';
|
|
14
|
+
|
|
15
|
+
const APP_CODE = 'visitor-center';
|
|
16
|
+
const reservations = resourceCapabilityCodes(APP_CODE, 'visitor-reservations');
|
|
17
|
+
|
|
18
|
+
const visitorReservations = {
|
|
19
|
+
code: 'visitor-reservations',
|
|
20
|
+
name: '访客预约',
|
|
21
|
+
dataPolicyCode: 'reservation-host',
|
|
22
|
+
fields: [
|
|
23
|
+
{
|
|
24
|
+
code: 'visitorName', type: 'text.short', label: '访客姓名', required: true,
|
|
25
|
+
indexed: true, list: true, filter: true, searchable: true, sortable: true,
|
|
26
|
+
section: '访客信息',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
code: 'visitDate', type: 'date', label: '来访日期', required: true,
|
|
30
|
+
list: true, filter: true, sortable: true, section: '来访安排',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
code: 'hostUserId', type: 'user.single', label: '接待人', required: true,
|
|
34
|
+
list: true, filter: true,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
code: 'hostDepartmentId', type: 'department.single', label: '接待部门',
|
|
38
|
+
list: true, filter: true,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
code: 'attachments', type: 'file', label: '附件',
|
|
42
|
+
file: { multiple: true, maxCount: 5, maxSizeMb: 20, accept: ['image/*', '.pdf'] },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
code: 'internalNote', type: 'text.long', label: '内部备注',
|
|
46
|
+
access: { read: ['app:visitor-center:internal-note:read'], update: false },
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
list: { defaultPageSize: 20, defaultSort: { field: 'visitDate', order: 'desc' } },
|
|
50
|
+
form: { layout: 'sections' }, detail: { layout: 'sections' },
|
|
51
|
+
mobile: { enabled: true },
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Put it in `data: { resources: [visitorReservations] }`. Resource CRUD
|
|
56
|
+
capabilities are derived by `resourceCapabilityCodes`; grant the needed values
|
|
57
|
+
to roles. Directory-backed roles also require
|
|
58
|
+
`app:<app-code>:directory:read`. Explicit field `access` capability codes are
|
|
59
|
+
also granted only to the intended roles.
|
|
60
|
+
|
|
61
|
+
`required: true` owns both storage nullability and form validation. A field
|
|
62
|
+
without `access` inherits the resource read/create/update capability. Each
|
|
63
|
+
access array is all-of; `false` is explicit deny. The same arrays drive the
|
|
64
|
+
generated UI and platform field policies.
|
|
65
|
+
|
|
66
|
+
Field types are semantic, not PostgreSQL storage aliases. Use the catalog in the generated `AGENTS.md`: for example `text.short`, `number.integer`, `user.single`, `department.multiple`, `resource-ref.single`, `file`, `address` and `subtable`. The compiler alone chooses storage columns and constraints. Reference fields store complete labeled snapshots; resource references additionally declare their source and snapshot fields. File limits exist only under `file` and use `maxSizeMb`.
|
|
67
|
+
|
|
68
|
+
Do not author raw schema or storage words as field types. `string`, `text`,
|
|
69
|
+
`integer`, `decimal`, `boolean`, `date`, `datetime`, `uuid`, `json` and `file`
|
|
70
|
+
describe value or storage families only when the platform protocol says so;
|
|
71
|
+
their authored counterparts are the semantic catalog entries above (some names
|
|
72
|
+
such as `date`, `datetime`, `uuid`, `json` and `file` intentionally coincide).
|
|
73
|
+
In particular, `number` is not a field type: choose `number.integer` or
|
|
74
|
+
`number.decimal`.
|
|
75
|
+
|
|
76
|
+
Current-user row access has one spelling only:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
currentUserDataPolicy({
|
|
80
|
+
code: 'reservation-host',
|
|
81
|
+
name: '接待人员仅查看本人预约',
|
|
82
|
+
resourceCode: 'visitor-reservations',
|
|
83
|
+
field: 'hostUserId.value',
|
|
84
|
+
roleCodes: ['reception_staff'],
|
|
85
|
+
unrestrictedRoleCodes: ['visitor_admin'],
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Put that value in `authz.dataPolicies`, declare both roles, and set the
|
|
90
|
+
resource `dataPolicyCode` to the same code. Do not invent `operator`, `value`,
|
|
91
|
+
`current_user: true`, lowercase match modes, or policy-level `roleCodes`.
|
|
92
|
+
|
|
93
|
+
Run `pnpm openxiangda check` after every declaration or permission change.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Delivery
|
|
2
|
+
|
|
3
|
+
Run `pnpm openxiangda check`; it owns generation, static checks, tests and production builds. Deploy to test with `pnpm openxiangda deploy`. The CLI uses the official application Dockerfile and the platform-provided repository target to build and push the Nest image, then seals only its immutable digest. Never ask the developer for an image tag, digest, registry password, Docker configuration, or another public build command. If Docker, Buildx, repository configuration, or registry login is missing, preserve the stable machine error and retry with the same `pnpm openxiangda deploy` command after fixing that prerequisite.
|
|
4
|
+
|
|
5
|
+
Use `pnpm openxiangda status` and `pnpm openxiangda logs` without an ID for the most recent run, or pass an explicit run ID.
|
|
6
|
+
|
|
7
|
+
For the AI-native MCP entrypoint, `build_app` and `deployment_plan` are explicitly unsealed previews. After the user authorizes deployment, call `deploy_app` without any image coordinate; it owns the same automatic Buildx, push, digest and sealing path as the CLI.
|
|
8
|
+
|
|
9
|
+
Applications with Native Data Resources automatically require `data.native-golden-crud`. If deployment returns `OPENXIANGDA_REQUIRED_CAPABILITY_UNAVAILABLE`, preserve the remediation to upgrade the platform and retry the same deploy command. Never remove the requirement, edit the AppPackage, construct a second identity path, or create Function-based CRUD.
|
|
10
|
+
|
|
11
|
+
After a successful test run, deploy the exact same version with `pnpm openxiangda deploy --environment production --from <test-deployment-id>`. Roll back with `pnpm openxiangda rollback --environment production --to <app-version-id>`. The platform owns durable deployment state.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Requirement Discovery
|
|
2
|
+
|
|
3
|
+
Before editing, write a compact decision record covering:
|
|
4
|
+
|
|
5
|
+
- business objective and measurable outcome;
|
|
6
|
+
- actors and positive/negative scenarios;
|
|
7
|
+
- resources, field meanings, required values and lifecycle states;
|
|
8
|
+
- role memberships, operation capabilities, field restrictions and row scope;
|
|
9
|
+
- external systems, side effects, concurrency and idempotency;
|
|
10
|
+
- environment, security, volume and latency bounds;
|
|
11
|
+
- acceptance evidence for UI, API, PostgreSQL/RLS and delivery.
|
|
12
|
+
|
|
13
|
+
Separate known facts, assumptions and unresolved choices. Inspect the workspace protocol and existing declarations before inventing a contract. If a choice changes data meaning, authorization, external writes or release scope, resolve it before implementation. Ordinary naming or layout details may use a documented reasonable assumption.
|
|
14
|
+
|
|
15
|
+
The output is complete only when every requirement maps to an owner and a falsifiable acceptance check. Do not begin with source patches and reconstruct intent afterward.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Frontend
|
|
2
|
+
|
|
3
|
+
Use the official Vite + React Router + Refine Core + Ant Design template. Import the platform-owned runtime from `openxiangda/react`, field controls from `openxiangda/field-kit` and clients/types from `openxiangda/core`. Do not copy these implementations into application source and do not add per-resource function wrappers.
|
|
4
|
+
|
|
5
|
+
Generated desktop lists already own row selection, atomic batch update/delete,
|
|
6
|
+
CSV/XLS/XLSX preview import, export, filters, column settings and density. Keep
|
|
7
|
+
imports at 100 rows per transaction, use exact declared labels or field codes,
|
|
8
|
+
and leave attachment values to the platform managed-file component.
|
|
9
|
+
|
|
10
|
+
Read the current user, complete application-role union and capabilities from the platform runtime authorization endpoint. There is no role switcher and the browser does not send a RoleSession header. Use capabilities and field access only to present or disable UI; strip unauthorized fields from create and update payloads and never treat a disabled input as server authorization. Verify with `pnpm openxiangda check`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Testing and Acceptance
|
|
2
|
+
|
|
3
|
+
Run `pnpm openxiangda check` after declaration or code changes. It owns generation, static validation, unit tests and production builds; preserve its stable diagnostic instead of bypassing a failing stage.
|
|
4
|
+
|
|
5
|
+
For each changed resource, verify the real chain:
|
|
6
|
+
|
|
7
|
+
1. declaration compiles into one resource, Surface and capability set;
|
|
8
|
+
2. desktop and mobile render the declared field semantics;
|
|
9
|
+
3. create, read, update, delete, filtering, export and revision conflict use Native Data API;
|
|
10
|
+
4. an allowed role succeeds and a denied role fails for operation, field and row paths;
|
|
11
|
+
5. stored values and audit records match the declared shape;
|
|
12
|
+
6. PostgreSQL/RLS remains authoritative, including current-user and multi-role-union cases.
|
|
13
|
+
|
|
14
|
+
Mock and unit tests are useful but do not close remote acceptance. Before production, deploy to preproduction and capture the exact AppVersion, environment Head, test identities, positive/negative results, browser behavior and request identifiers. Production promotion reuses that exact successful version; it is not another build.
|
|
15
|
+
|
|
16
|
+
For a new toolchain release, also create a completely fresh workspace using only the packed or published `openxiangda` package. Do not use repository-relative imports, unpublished workspace links or machine-installed legacy Skills.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Workflow and Notification Hub
|
|
2
|
+
|
|
3
|
+
Use these optional modules only when the application has a real standard approval or cross-channel notification requirement. Ordinary CRUD and application-specific state machines stay on Data API/App API and must not pull Workflow or Notification code into the default template.
|
|
4
|
+
|
|
5
|
+
## Boundaries
|
|
6
|
+
|
|
7
|
+
- The application owns business records and domain invariants.
|
|
8
|
+
- Workflow Kernel v2 owns definitions, instances, tasks, participants, commands, transitions and audit facts.
|
|
9
|
+
- Application Events v2 owns durable facts and delivery.
|
|
10
|
+
- Notification Hub v2 owns templates, rules, logical messages, channel delivery, callbacks and message operations.
|
|
11
|
+
- Native Identity/AuthZ v2 owns the current user and the union of that user's current application roles. Never select, transmit or persist a RoleSession.
|
|
12
|
+
- Never import, query, migrate or call 1.x workflow/message code, tables, APIs, queues, templates or callbacks.
|
|
13
|
+
|
|
14
|
+
## Workflow declaration
|
|
15
|
+
|
|
16
|
+
Declare workflow topology and bindings once in `openxiangda.config.ts`. Use only approval, condition and end nodes for the standard module. Keep business data in Data API/App API and pass an immutable `dataRef`, business revision and bounded facts into prepare/start.
|
|
17
|
+
|
|
18
|
+
Use an assignee Provider only when resolution depends on application data. The Provider returns stable Native user/role subjects and never makes the final task authorization decision.
|
|
19
|
+
|
|
20
|
+
The standard operations are approve, reject, return, resubmit, transfer, delegate, add-sign, withdraw, admin reassign, admin terminate and reminder. Render only operations returned by the task/instance Surface. A template or application action cannot add a Workflow command that is absent from the Surface.
|
|
21
|
+
|
|
22
|
+
## Submission and concurrency
|
|
23
|
+
|
|
24
|
+
1. Persist the business draft through Data API/App API.
|
|
25
|
+
2. Bind prepare to the saved revision and all submission answers.
|
|
26
|
+
3. Resolve required organization/approver choices.
|
|
27
|
+
4. Start with a stable idempotency key distinct from the draft-save key.
|
|
28
|
+
5. Use the Surface revision/concurrency token for every command.
|
|
29
|
+
|
|
30
|
+
Duplicate commands return the stored command receipt. Stale revisions fail with a structured conflict. A task/participant state transition, operation log, Workflow fact and event outbox commit atomically.
|
|
31
|
+
|
|
32
|
+
## Notification profile
|
|
33
|
+
|
|
34
|
+
A node may reference a notification profile that selects:
|
|
35
|
+
|
|
36
|
+
- source facts that create, update or close a message;
|
|
37
|
+
- audiences such as current participant, initiator, historical participant or CC;
|
|
38
|
+
- a versioned template reference;
|
|
39
|
+
- an allowlisted variable projection;
|
|
40
|
+
- channel priority/fallback;
|
|
41
|
+
- default detail target;
|
|
42
|
+
- whether to show Workflow Surface actions;
|
|
43
|
+
- whether a separate result message is required.
|
|
44
|
+
|
|
45
|
+
Template variables must be declared by JSON Schema and stay within the field policy visible to the recipient. The Notification Hub does not query arbitrary application tables to complete a template.
|
|
46
|
+
|
|
47
|
+
## Detail navigation
|
|
48
|
+
|
|
49
|
+
Use a canonical navigation target with `PLATFORM_ROUTE`, `APP_ROUTE` or allowlisted `EXTERNAL_URL`, stable route code, path/query parameters and an authenticated access requirement. Do not place environment domains, bearer tokens, cookies, RoleSession identifiers or secrets in template strings.
|
|
50
|
+
|
|
51
|
+
The Notification Hub resolves desktop, mobile and channel deep links. The landing page always re-runs platform authentication and Data/AuthZ/Workflow authorization.
|
|
52
|
+
|
|
53
|
+
## Interactive channel actions
|
|
54
|
+
|
|
55
|
+
Channel callbacks enter the Notification Action Gateway. The gateway verifies tenant, environment, recipient identity, task/participant, Surface revision, operation, nonce, signature and expiry before calling Workflow.
|
|
56
|
+
|
|
57
|
+
The callback never writes Workflow or business state directly. It returns the Workflow command receipt, waits for the resulting fact and lets Notification Hub update the existing logical message. Duplicate or expired clicks return the current receipt/snapshot and refresh the card.
|
|
58
|
+
|
|
59
|
+
Use direct card actions first for approve/reject. Return, transfer, delegate and add-sign normally deep-link to the standard task page because they require structured input.
|
|
60
|
+
|
|
61
|
+
## Event handling
|
|
62
|
+
|
|
63
|
+
Consume typed participant/task/instance facts with durable idempotency. Order Workflow message projection by `instanceId + instanceSequence`; never assume global event order. Terminal instance facts dominate stale participant facts and update every historical message for that instance.
|
|
64
|
+
|
|
65
|
+
Use Fake Channel before a real Adapter. Verify create, update, close, reconcile, duplicate, out-of-order, restart, retryable failure, terminal failure and unknown delivery before DingTalk or campus canaries.
|
|
66
|
+
|
|
67
|
+
## Verification
|
|
68
|
+
|
|
69
|
+
Run the workspace generate/check/test/build gates plus real current-user positive and negative role-union cases. Acceptance must include submit, approve, reject, return/resubmit, transfer, delegate, before/after add-sign, withdraw, terminate, duplicate commands, stale revisions, repeated callbacks, full terminal card updates, detail navigation and 1.x zero-touch evidence.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Application Agent Contract
|
|
2
|
+
|
|
3
|
+
- Use only the workspace-pinned CLI: `pnpm openxiangda <command>`. Never invoke a bare global `openxiangda` inside a 2.0 task.
|
|
4
|
+
- Use Vite, React Router, Refine Core and Ant Design. Do not add Umi, ProComponents or another admin shell.
|
|
5
|
+
- Declare each resource once in `openxiangda.config.ts` with only `code`, `name`, `fields` and optional list/layout/data-policy settings. Each field owns type, label, required state, Surface flags, reference/file metadata and access. Resource codes are lower kebab-case.
|
|
6
|
+
- Never write resource-level `schemaVersion`, `appCode`, `schema`, `surface`, `capabilities`, `fieldPolicies` or `platform/data` modules. The compiler derives the strict DataResource, CRUD capabilities, Surface and AI Schema. The application manifest still starts with its one top-level `schemaVersion: 3`.
|
|
7
|
+
- Ordinary list/get/create/update/delete, filters, export and batch operations use the platform Native Data API. Do not create Function CRUD or NestJS wrappers.
|
|
8
|
+
- Add NestJS only for a named business action that needs a cross-resource transaction, an invariant or an external side effect.
|
|
9
|
+
- A NestJS backend declares only `enabled`, `isolation: 'shared' | 'dedicated'` and `resourceProfile: 'light' | 'standard'`. Never put raw Kubernetes resources, replicas, ports or environment maps in application metadata; the platform owns capacity and scaling.
|
|
10
|
+
- Use the current logged-in user and the union of that user's application roles. The generated client uses same-origin cookies and does not transmit a RoleSession header. Business code must not persist a platform Token or authorization result and must not implement a second identity path.
|
|
11
|
+
- Fields inherit the resource read/create/update capabilities. Use field `access` only to tighten them; arrays are all-of and `false` is explicit deny. There is no `write` fallback.
|
|
12
|
+
- Field `type` is semantic, never a hand-authored database type. The supported catalog is exactly `text.short`, `text.long`, `text.rich`, `number.integer`, `number.decimal`, `boolean`, `date`, `time`, `datetime`, `date-range`, `datetime-range`, `option.single`, `option.multiple`, `cascade.single`, `cascade.multiple`, `user.single`, `user.multiple`, `department.single`, `department.multiple`, `resource-ref.single`, `resource-ref.multiple`, `file`, `image`, `signature`, `address`, `location`, `json`, `serial-number`, `uuid` and `subtable`. The compiler alone derives PostgreSQL columns, constraints and indexes.
|
|
13
|
+
- Declare every custom operation capability in `authz.capabilities` with `kind: 'backend'`, then reference that same code from the operation and its allowed roles. Generated resource CRUD capabilities do not go in this catalog.
|
|
14
|
+
- Visitor duplicate protection uses `createVisitorReservation({ duplicateMatch: { fieldCode: submittedValue }, ... })`. `duplicateMatch` is a non-empty value map, never a field-name array, and no mutable pre-read is allowed.
|
|
15
|
+
- Desktop and mobile pages share values, validation and authorization, but use separate renderers. Options, members, departments and resource references store their complete display snapshots; attachments, images and signatures use platform-managed file references.
|
|
16
|
+
- `option.*`, `user.*`, `department.*` and `resource-ref.*` values never collapse to scalar IDs. Single values store one labeled snapshot and multiple values store snapshot arrays. `location` accepts only exact WGS84 coordinates captured by DingTalk or browser geolocation; it has no manual input or `manual` source. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
|
|
17
|
+
- Derive role grants with `resourceCapabilityCodes(appCode, resourceCode)`. Declare current-user rows only with `currentUserDataPolicy(...)`; do not invent operators, values or alternate current-user spellings.
|
|
18
|
+
- Do not add compatibility aliases, migration branches or silent fallbacks for an earlier 2.0 alpha contract. Replace an incorrect contract and regenerate the application.
|
|
19
|
+
- Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through the canonical `openxiangda.config.ts` declarations and generated clients; never copy 1.x workflow/message code, tables, APIs, templates or callbacks into this workspace. Keep ordinary CRUD and application-specific state machines independent of them.
|
|
20
|
+
- Run `pnpm openxiangda check` after contract changes. Deploy with `pnpm openxiangda deploy`, inspect with `pnpm openxiangda status` and `pnpm openxiangda logs`, and use the platform rollback command rather than mutating K3s directly.
|
|
21
|
+
- AI-native clients start the workspace protocol through the same pinned binary: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. Read `openxiangda://workspace/contracts` or call `contract_describe`, and require its `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. This is a stdio transport mode, not a ninth CLI command. Never write an application MCP server, Catalog file, preview store or second authorization path.
|
package/bin/openxiangda.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { main } = require('../lib/cli');
|
|
4
|
-
const { maskText } = require('../lib/utils');
|
|
5
|
-
|
|
6
|
-
const argv = process.argv.slice(2);
|
|
7
|
-
|
|
8
|
-
main(argv).catch(error => {
|
|
9
|
-
const message =
|
|
10
|
-
error && error.message ? error.message : String(error || 'Unknown error');
|
|
11
|
-
if (argv.includes('--json')) {
|
|
12
|
-
const payload = {
|
|
13
|
-
success: false,
|
|
14
|
-
error: {
|
|
15
|
-
status: Number.isInteger(error?.status) ? error.status : null,
|
|
16
|
-
code: error?.code || error?.payload?.errorCode || null,
|
|
17
|
-
message,
|
|
18
|
-
data: error?.data ?? error?.payload?.data ?? null,
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
console.error(maskText(JSON.stringify(payload)));
|
|
22
|
-
process.exit(1);
|
|
23
|
-
}
|
|
24
|
-
console.error(maskText(message));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
function buildOpenXiangdaFunctionInvokeRequest(appType, functionCode, body) {
|
|
2
|
-
return {
|
|
3
|
-
method: 'POST',
|
|
4
|
-
path: `/openxiangda-api/v1/apps/${encodeURIComponent(appType)}/functions/${encodeURIComponent(functionCode)}/invoke`,
|
|
5
|
-
body,
|
|
6
|
-
strictEnvelope: true,
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function buildLegacyFunctionInvokeRequest(appType, functionCode, body) {
|
|
11
|
-
return {
|
|
12
|
-
method: 'POST',
|
|
13
|
-
path: `/${encodeURIComponent(appType)}/v1/functions/${encodeURIComponent(functionCode)}/invoke.json`,
|
|
14
|
-
body,
|
|
15
|
-
strictEnvelope: true,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function isHttpNotFound(error) {
|
|
20
|
-
const status = Number(error?.status || error?.statusCode || error?.response?.status);
|
|
21
|
-
return status === 404 || String(error?.message || '').includes('HTTP 404');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
module.exports = {
|
|
25
|
-
buildLegacyFunctionInvokeRequest,
|
|
26
|
-
buildOpenXiangdaFunctionInvokeRequest,
|
|
27
|
-
isHttpNotFound,
|
|
28
|
-
};
|