@lovrabet/rabetbase-cli 2.3.16-beta.7 → 2.4.1
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 +4 -10
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.d.ts +2 -0
- package/lib/commands/page/react/create.js +1 -0
- package/lib/commands/page/react/detail.d.ts +2 -0
- package/lib/commands/page/react/detail.js +1 -0
- package/lib/commands/page/react/list.d.ts +2 -0
- package/lib/commands/page/react/list.js +1 -0
- package/lib/commands/page/react/publish.d.ts +2 -0
- package/lib/commands/page/react/publish.js +1 -0
- package/lib/commands/page/react/shared.d.ts +78 -0
- package/lib/commands/page/react/shared.js +1 -0
- package/lib/commands/page/react/syntax.d.ts +18 -0
- package/lib/commands/page/react/syntax.js +1 -0
- package/lib/commands/page/react/template.d.ts +8 -0
- package/lib/commands/page/react/template.js +1 -0
- package/lib/commands/page/react/update.d.ts +2 -0
- package/lib/commands/page/react/update.js +1 -0
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.d.ts +1 -0
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.d.ts +2 -0
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -0
- package/lib/commands/user-account/index.d.ts +2 -0
- package/lib/commands/user-account/index.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +117 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.d.ts +3 -0
- package/lib/postinstall.js +1 -0
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.d.ts +37 -0
- package/lib/skills/builtin-skill.js +1 -0
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.d.ts +4 -2
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +9 -3
- package/scripts/postinstall.mjs +24 -0
- package/skills/rabetbase/SKILL.md +493 -0
- package/skills/rabetbase/guides/backend-function.md +835 -0
- package/skills/rabetbase/guides/best-practices.md +137 -0
- package/skills/rabetbase/guides/bff-creation-workflow.md +148 -0
- package/skills/rabetbase/guides/conflict-detection.md +119 -0
- package/skills/rabetbase/guides/data-api-guidelines.md +414 -0
- package/skills/rabetbase/guides/database-connection-workflow.md +169 -0
- package/skills/rabetbase/guides/frontend-development.md +179 -0
- package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +495 -0
- package/skills/rabetbase/guides/menu-anomaly-manual-cleanup.md +137 -0
- package/skills/rabetbase/guides/page-development-workflow.md +187 -0
- package/skills/rabetbase/guides/react-custom-page-workflow.md +184 -0
- package/skills/rabetbase/guides/role-permit-workflow.md +127 -0
- package/skills/rabetbase/guides/sql-creation-workflow.md +173 -0
- package/skills/rabetbase/guides/sql-mybatis.md +126 -0
- package/skills/rabetbase/guides/troubleshooting.md +67 -0
- package/skills/rabetbase/guides/typescript-sdk.md +227 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartCreate.md +367 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartDetail.md +153 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartEcharts.md +291 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartFilter.md +478 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +119 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartStatistic.md +223 -0
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +632 -0
- package/skills/rabetbase/knowledge/page-schema/YtPage.md +172 -0
- package/skills/rabetbase/knowledge/page-schema/dataset-relations.md +126 -0
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +232 -0
- package/skills/rabetbase/knowledge/page-schema/field-components.md +312 -0
- package/skills/rabetbase/knowledge/page-schema/syntax-reference.md +278 -0
- package/skills/rabetbase/knowledge/react-page/components.md +225 -0
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +385 -0
- package/skills/rabetbase/references/rabetbase-api-list.md +58 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +82 -0
- package/skills/rabetbase/references/rabetbase-app-config.md +95 -0
- package/skills/rabetbase/references/rabetbase-app-list.md +79 -0
- package/skills/rabetbase/references/rabetbase-app-members-list.md +64 -0
- package/skills/rabetbase/references/rabetbase-auth-login.md +53 -0
- package/skills/rabetbase/references/rabetbase-auth-logout.md +29 -0
- package/skills/rabetbase/references/rabetbase-bff-create.md +59 -0
- package/skills/rabetbase/references/rabetbase-bff-delete.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-detail.md +38 -0
- package/skills/rabetbase/references/rabetbase-bff-list.md +61 -0
- package/skills/rabetbase/references/rabetbase-bff-pull.md +42 -0
- package/skills/rabetbase/references/rabetbase-bff-push.md +65 -0
- package/skills/rabetbase/references/rabetbase-bff-save.md +63 -0
- package/skills/rabetbase/references/rabetbase-bff-status.md +37 -0
- package/skills/rabetbase/references/rabetbase-cli-skill-install.md +42 -0
- package/skills/rabetbase/references/rabetbase-codegen-sdk.md +35 -0
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +33 -0
- package/skills/rabetbase/references/rabetbase-config.md +296 -0
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +84 -0
- package/skills/rabetbase/references/rabetbase-dataset-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +106 -0
- package/skills/rabetbase/references/rabetbase-dataset-extend-update.md +70 -0
- package/skills/rabetbase/references/rabetbase-dataset-field-update.md +117 -0
- package/skills/rabetbase/references/rabetbase-dataset-generate.md +206 -0
- package/skills/rabetbase/references/rabetbase-dataset-list.md +42 -0
- package/skills/rabetbase/references/rabetbase-dataset-operations.md +34 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-audit.md +63 -0
- package/skills/rabetbase/references/rabetbase-dataset-relation-mutations.md +141 -0
- package/skills/rabetbase/references/rabetbase-dataset-relations.md +71 -0
- package/skills/rabetbase/references/rabetbase-dataset-rename.md +107 -0
- package/skills/rabetbase/references/rabetbase-dataset-restore.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-analyze.md +135 -0
- package/skills/rabetbase/references/rabetbase-db-create.md +54 -0
- package/skills/rabetbase/references/rabetbase-db-delete.md +26 -0
- package/skills/rabetbase/references/rabetbase-db-detail.md +27 -0
- package/skills/rabetbase/references/rabetbase-db-diff.md +57 -0
- package/skills/rabetbase/references/rabetbase-db-list.md +37 -0
- package/skills/rabetbase/references/rabetbase-db-tables.md +25 -0
- package/skills/rabetbase/references/rabetbase-db-test.md +29 -0
- package/skills/rabetbase/references/rabetbase-db-update.md +29 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +62 -0
- package/skills/rabetbase/references/rabetbase-file.md +35 -0
- package/skills/rabetbase/references/rabetbase-init.md +70 -0
- package/skills/rabetbase/references/rabetbase-issue-report.md +132 -0
- package/skills/rabetbase/references/rabetbase-kb.md +62 -0
- package/skills/rabetbase/references/rabetbase-menu-asset-update.md +135 -0
- package/skills/rabetbase/references/rabetbase-menu-delete.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-create.md +63 -0
- package/skills/rabetbase/references/rabetbase-menu-external-link-update.md +74 -0
- package/skills/rabetbase/references/rabetbase-menu-group-create.md +33 -0
- package/skills/rabetbase/references/rabetbase-menu-group-update.md +38 -0
- package/skills/rabetbase/references/rabetbase-menu-list.md +144 -0
- package/skills/rabetbase/references/rabetbase-menu-move.md +54 -0
- package/skills/rabetbase/references/rabetbase-menu-regroup-start.md +45 -0
- package/skills/rabetbase/references/rabetbase-menu-rename.md +48 -0
- package/skills/rabetbase/references/rabetbase-menu-sync.md +60 -0
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +80 -0
- package/skills/rabetbase/references/rabetbase-ocr.md +86 -0
- package/skills/rabetbase/references/rabetbase-page-generate-start.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-generate-status.md +32 -0
- package/skills/rabetbase/references/rabetbase-page-pull.md +47 -0
- package/skills/rabetbase/references/rabetbase-page-push.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-react-create.md +29 -0
- package/skills/rabetbase/references/rabetbase-page-react-detail.md +26 -0
- package/skills/rabetbase/references/rabetbase-page-react-list.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-publish.md +23 -0
- package/skills/rabetbase/references/rabetbase-page-react-update.md +24 -0
- package/skills/rabetbase/references/rabetbase-page-relation-binding.md +72 -0
- package/skills/rabetbase/references/rabetbase-page-restore.md +45 -0
- package/skills/rabetbase/references/rabetbase-page-sync.md +36 -0
- package/skills/rabetbase/references/rabetbase-permit-page-set.md +69 -0
- package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +53 -0
- package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +57 -0
- package/skills/rabetbase/references/rabetbase-project-create.md +46 -0
- package/skills/rabetbase/references/rabetbase-project-upgrade.md +57 -0
- package/skills/rabetbase/references/rabetbase-role-list.md +68 -0
- package/skills/rabetbase/references/rabetbase-role-user-add.md +54 -0
- package/skills/rabetbase/references/rabetbase-role-user-resolve.md +27 -0
- package/skills/rabetbase/references/rabetbase-run.md +53 -0
- package/skills/rabetbase/references/rabetbase-schema.md +22 -0
- package/skills/rabetbase/references/rabetbase-sql-create.md +41 -0
- package/skills/rabetbase/references/rabetbase-sql-delete.md +37 -0
- package/skills/rabetbase/references/rabetbase-sql-detail.md +32 -0
- package/skills/rabetbase/references/rabetbase-sql-exec.md +34 -0
- package/skills/rabetbase/references/rabetbase-sql-list.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-pull.md +54 -0
- package/skills/rabetbase/references/rabetbase-sql-push.md +46 -0
- package/skills/rabetbase/references/rabetbase-sql-status.md +39 -0
- package/skills/rabetbase/references/rabetbase-sql-validate.md +73 -0
- package/skills/rabetbase/references/rabetbase-standard-page-status.md +31 -0
- package/skills/rabetbase/references/rabetbase-task-status.md +40 -0
- package/skills/rabetbase/references/rabetbase-tenant-members-list.md +69 -0
- package/skills/rabetbase/references/rabetbase-update.md +56 -0
- package/skills/rabetbase/references/rabetbase-user-account.md +45 -0
- package/skills/rabetbase/references/rabetbase-workspace.md +60 -0
- package/skills/rabetbase.manifest.json +137 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: YtPage
|
|
3
|
+
description: YtPage 页面布局组件完整配置
|
|
4
|
+
tags: [page, layout, page-schema]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# YtPage
|
|
8
|
+
|
|
9
|
+
页面容器组件,支持磁贴布局和流式布局两种模式。
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 布局类型
|
|
14
|
+
|
|
15
|
+
| 类型 | 判断条件 | 特点 | 场景 |
|
|
16
|
+
|------|----------|------|------|
|
|
17
|
+
| 磁贴布局 | 包含 `YtRglContainer` | 网格定位、支持并排 | 仪表盘、数据看板 |
|
|
18
|
+
| 流式布局 | 无 `YtRglContainer` | 上下排列 | 表单页、详情页 |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 磁贴布局(YtRglContainer)
|
|
23
|
+
|
|
24
|
+
### 结构
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"componentName": "YtPage",
|
|
29
|
+
"children": [{
|
|
30
|
+
"componentName": "YtRglContainer",
|
|
31
|
+
"props": {
|
|
32
|
+
"RGLlayout": [
|
|
33
|
+
{"i": "node_filter", "w": 12, "h": 10, "x": 0, "y": 0, "autoHeight": true},
|
|
34
|
+
{"i": "node_table", "w": 12, "h": 30, "x": 0, "y": 10, "autoHeight": false}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"children": [...]
|
|
38
|
+
}]
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### RGLlayout 参数
|
|
43
|
+
|
|
44
|
+
| 参数 | 类型 | 说明 |
|
|
45
|
+
|------|------|------|
|
|
46
|
+
| i | string | 组件 ID(对应 children 中的 id) |
|
|
47
|
+
| w | number | 宽度(总列数 12) |
|
|
48
|
+
| h | number | 高度(单位行数) |
|
|
49
|
+
| x | number | X 起始位置(0-11) |
|
|
50
|
+
| y | number | Y 起始位置 |
|
|
51
|
+
| autoHeight | boolean | 自动高度(true 时 h 无效) |
|
|
52
|
+
|
|
53
|
+
### 布局规则
|
|
54
|
+
|
|
55
|
+
| 规则 | 说明 |
|
|
56
|
+
|------|------|
|
|
57
|
+
| 每行总宽度 | 必须为 12 |
|
|
58
|
+
| Filter/Table | 必须独占一行(w: 12) |
|
|
59
|
+
| 图表并排 | 两个图表各占 w: 6 |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 流式布局
|
|
64
|
+
|
|
65
|
+
### 结构
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"componentName": "YtPage",
|
|
70
|
+
"children": [
|
|
71
|
+
{"componentName": "LrSmartFilter"},
|
|
72
|
+
{"componentName": "LrSmartTable"}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 布局规则
|
|
78
|
+
|
|
79
|
+
- Filter 必须在 Table 前
|
|
80
|
+
- 组件按 children 数组顺序排列
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 常见布局场景
|
|
85
|
+
|
|
86
|
+
### 并排图表
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"RGLlayout": [
|
|
91
|
+
{"i": "chart1", "w": 6, "h": 20, "x": 0, "y": 0},
|
|
92
|
+
{"i": "chart2", "w": 6, "h": 20, "x": 6, "y": 0}
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 统计卡 + 图表
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"RGLlayout": [
|
|
102
|
+
{"i": "stat1", "w": 3, "h": 10, "x": 0, "y": 0},
|
|
103
|
+
{"i": "stat2", "w": 3, "h": 10, "x": 3, "y": 0},
|
|
104
|
+
{"i": "stat3", "w": 3, "h": 10, "x": 6, "y": 0},
|
|
105
|
+
{"i": "stat4", "w": 3, "h": 10, "x": 9, "y": 0},
|
|
106
|
+
{"i": "chart1", "w": 12, "h": 20, "x": 0, "y": 10}
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Filter + Table
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"RGLlayout": [
|
|
116
|
+
{"i": "filter", "w": 12, "h": 10, "x": 0, "y": 0, "autoHeight": true},
|
|
117
|
+
{"i": "table", "w": 12, "h": 30, "x": 0, "y": 10}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## 禁止事项
|
|
125
|
+
|
|
126
|
+
| 禁止 | 说明 |
|
|
127
|
+
|------|------|
|
|
128
|
+
| 添加/删除组件 | 只能调整布局 |
|
|
129
|
+
| 更改组件类型 | 只能调整位置 |
|
|
130
|
+
| 每行宽度不为 12 | 磁贴布局必须填满 12 列 |
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 常见问题
|
|
135
|
+
|
|
136
|
+
| 问题 | 原因 | 解决方案 |
|
|
137
|
+
|------|------|----------|
|
|
138
|
+
| 布局空白 | 宽度不为 12 | 确保每行 w 总和为 12 |
|
|
139
|
+
| 高度不一致 | autoHeight 设置错误 | 统一设置 autoHeight |
|
|
140
|
+
| 组件重叠 | x/y 坐标冲突 | 检查坐标是否正确 |
|
|
141
|
+
| Filter 不生效 | 在 Table 后 | 将 Filter 移到 Table 前 |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## 完整示例
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
{
|
|
149
|
+
"componentName": "YtPage",
|
|
150
|
+
"children": [{
|
|
151
|
+
"componentName": "YtRglContainer",
|
|
152
|
+
"props": {
|
|
153
|
+
"RGLlayout": [
|
|
154
|
+
{"i": "node_stat1", "w": 3, "h": 8, "x": 0, "y": 0},
|
|
155
|
+
{"i": "node_stat2", "w": 3, "h": 8, "x": 3, "y": 0},
|
|
156
|
+
{"i": "node_stat3", "w": 3, "h": 8, "x": 6, "y": 0},
|
|
157
|
+
{"i": "node_stat4", "w": 3, "h": 8, "x": 9, "y": 0},
|
|
158
|
+
{"i": "node_filter", "w": 12, "h": 10, "x": 0, "y": 8, "autoHeight": true},
|
|
159
|
+
{"i": "node_table", "w": 12, "h": 30, "x": 0, "y": 18}
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"children": [
|
|
163
|
+
{"id": "node_stat1", "componentName": "LrSmartStatistic"},
|
|
164
|
+
{"id": "node_stat2", "componentName": "LrSmartStatistic"},
|
|
165
|
+
{"id": "node_stat3", "componentName": "LrSmartStatistic"},
|
|
166
|
+
{"id": "node_stat4", "componentName": "LrSmartStatistic"},
|
|
167
|
+
{"id": "node_filter", "componentName": "LrSmartFilter"},
|
|
168
|
+
{"id": "node_table", "componentName": "LrSmartTable"}
|
|
169
|
+
]
|
|
170
|
+
}]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dataset-relations
|
|
3
|
+
description: 数据集关系模型参考,包含关系方向、字段语义、关系基数、主子表语义与页面配置边界
|
|
4
|
+
tags: [page-schema, dataset, relation]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 数据集关系声明
|
|
8
|
+
|
|
9
|
+
数据集关系是数据模型元数据,用于描述两个数据集的字段如何关联。它不是某个页面组件的专属配置,也不等同于数据库外键:关系既可以表示物理表之间的引用,也可以表示字典选项源、METADATA 自关联或主子表业务归属。
|
|
10
|
+
|
|
11
|
+
页面中的 `relation.field`、关联字段展示和筛选,都依赖已定义且有效的数据集关系。
|
|
12
|
+
|
|
13
|
+
## 关系事实字段
|
|
14
|
+
|
|
15
|
+
服务端返回的关系事实嵌入在来源数据集的 `relations` 中。下面保留服务端原始字段名;来源数据集本身由外层数据集对象确定,因此关系对象内不重复提供 `fromDatasetCode`。
|
|
16
|
+
|
|
17
|
+
数据集 `relations` 中的普通关联关系示例:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"relationId": 9074,
|
|
22
|
+
"fromField": "create_by",
|
|
23
|
+
"toDatasetCode": "d7c1ad8525ce4823bf5f7e4f4edab30b",
|
|
24
|
+
"toDatasetId": 48426,
|
|
25
|
+
"toDatasetName": "员工",
|
|
26
|
+
"toField": "id",
|
|
27
|
+
"toFieldLabel": "user_name",
|
|
28
|
+
"toTableName": "crm_user",
|
|
29
|
+
"sourceType": "DB_TABLE",
|
|
30
|
+
"joinType": "MANY_TO_ONE",
|
|
31
|
+
"cardinality": "MANY_TO_ONE",
|
|
32
|
+
"bizRelationType": null,
|
|
33
|
+
"mainColumnName": null,
|
|
34
|
+
"subColumnName": null,
|
|
35
|
+
"subDatasetCode": null,
|
|
36
|
+
"subTableName": null
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
示例将 `joinType` 和 `cardinality` 并列展示,便于说明字段对应关系;实际接口会按各自定义使用其中一个字段名,两者表示的关系基数必须一致。
|
|
41
|
+
|
|
42
|
+
| 字段 | 含义 |
|
|
43
|
+
|------|------|
|
|
44
|
+
| `relationId` | 关系记录标识 |
|
|
45
|
+
| `fromField` | 当前数据集中的关联字段 |
|
|
46
|
+
| `sourceType` | 主表的数据源类型:`DB_TABLE` 表示数据库类型,`METADATA` 表示文生类型 |
|
|
47
|
+
| `toDatasetCode` / `toDatasetId` / `toDatasetName` | 目标数据集的编码、标识和名称 |
|
|
48
|
+
| `toField` | 目标数据集中的关联字段 |
|
|
49
|
+
| `toFieldLabel` | 目标数据集的展示字段名,例如 `user_name`;不是中文标题 |
|
|
50
|
+
| `toTableName` | 目标物理表名称;非物理表数据集时可为空 |
|
|
51
|
+
| `joinType` | 关系对象中的关系基数字段,可选 `ONE_TO_ONE`、`ONE_TO_MANY`、`MANY_TO_ONE`、`MANY_TO_MANY` |
|
|
52
|
+
| `cardinality` | 关系接口中的关系基数字段,与 `er-config` 中的 `joinType` 表示同一个内容;只是接口字段名不同,取值范围完全一致 |
|
|
53
|
+
| `bizRelationType` | 业务关系类型;普通关联为 `null`,主子表为 `main_sub` |
|
|
54
|
+
| `mainColumnName` / `subColumnName` | 主子表关联时使用的主表列和子表列 |
|
|
55
|
+
| `subDatasetCode` / `subTableName` | 主子表关联时使用的子表数据集编码和子表名称 |
|
|
56
|
+
|
|
57
|
+
一条关系从当前数据集的 `fromField` 指向 `toDatasetCode.toField`。目标数据集名称、物理表名和展示字段是关系的补充信息,不能代替数据集编码和真实字段名判断关系。
|
|
58
|
+
|
|
59
|
+
## 关系方向
|
|
60
|
+
|
|
61
|
+
关系方向始终从当前数据集指向目标数据集。方向决定字段含义、关系基数的观察视角,以及页面从哪个字段加载目标数据。
|
|
62
|
+
|
|
63
|
+
| From | To | 是否支持 | 常见语义 |
|
|
64
|
+
|------|----|:---:|----------|
|
|
65
|
+
| `DB_TABLE` | `DB_TABLE` | 是 | 物理表数据集之间的引用或主子关系 |
|
|
66
|
+
| `DB_TABLE` | `METADATA` | 是 | 业务字段消费 METADATA 字典或选项源 |
|
|
67
|
+
| `METADATA` | `METADATA` | 是 | 配置数据集关系或自关联父子关系 |
|
|
68
|
+
| `METADATA` | `DB_TABLE` | 否 | 当前关系模型不支持该方向 |
|
|
69
|
+
|
|
70
|
+
当当前数据集编码与 `toDatasetCode` 相同时,该关系是自关联。自关联仍需明确 `fromField`、`toField` 和基数,不能仅凭数据集编码相同推断父子语义。
|
|
71
|
+
|
|
72
|
+
## 关系基数
|
|
73
|
+
|
|
74
|
+
服务端不同接口对同一关系基数使用了不同的字段表达:`er-config` 关系对象使用 `joinType`,其他关系接口使用 `cardinality`。两者本质上是同一个属性,不是两项需要分别维护的数据。CLI 调用的是使用 `cardinality` 的关系接口,因此对应的参数名为 `cardinality`(命令行参数为 `--cardinality`)。
|
|
75
|
+
|
|
76
|
+
关系基数以当前数据集记录到目标数据集记录的方向解释:
|
|
77
|
+
|
|
78
|
+
| 值 | 含义 |
|
|
79
|
+
|----|------|
|
|
80
|
+
| `ONE_TO_ONE` | 一条来源记录对应一条目标记录 |
|
|
81
|
+
| `ONE_TO_MANY` | 一条来源记录对应多条目标记录 |
|
|
82
|
+
| `MANY_TO_ONE` | 多条来源记录可以指向同一条目标记录 |
|
|
83
|
+
| `MANY_TO_MANY` | 来源与目标两端都可以关联多条记录 |
|
|
84
|
+
|
|
85
|
+
基数必须与真实数据约束一致。不能因为字段名看起来像外键,就直接判断为 `MANY_TO_ONE`;也不能因为页面要展示列表,就把普通引用关系改成 `ONE_TO_MANY`。
|
|
86
|
+
|
|
87
|
+
## 普通关系与主子表
|
|
88
|
+
|
|
89
|
+
普通关系表示两个相对独立的数据集之间存在引用,例如订单引用客户、项目引用负责人。主子表则表示明确的业务归属:一条主记录拥有一组随其维护的明细记录,例如订单与订单明细、合同与付款计划。
|
|
90
|
+
|
|
91
|
+
| 业务关系 | `joinType` | `bizRelationType` |
|
|
92
|
+
|----------|------------|-------------------|
|
|
93
|
+
| 普通引用 | 按真实基数设置 | `null` |
|
|
94
|
+
| 主子表 | `ONE_TO_MANY` | `main_sub` |
|
|
95
|
+
|
|
96
|
+
判断是否属于主子表时,应同时确认:
|
|
97
|
+
|
|
98
|
+
1. 打开一条主记录时,是否天然需要查看或维护它下面的一组明细。
|
|
99
|
+
2. 明细是否独立归属于该主记录,而不是多个业务记录共享的独立对象。
|
|
100
|
+
3. 两端字段能否真实关联到同一条主记录,字段类型和值域是否兼容。
|
|
101
|
+
4. 子记录是否应随主记录的业务生命周期一起维护。
|
|
102
|
+
|
|
103
|
+
普通引用、枚举映射、字典选项和只用于展示的 LOOKUP 都不应标记为 `main_sub`。元数据只能描述结构,不能证明业务归属;最终仍需结合真实记录验证。
|
|
104
|
+
|
|
105
|
+
## 完整性规则
|
|
106
|
+
|
|
107
|
+
有效的数据集关系应满足:
|
|
108
|
+
|
|
109
|
+
- 当前和目标数据集都存在,且 `toDatasetCode` 指向真实数据集。
|
|
110
|
+
- `fromField`、`toField` 都存在,字段类型和值域能够匹配。
|
|
111
|
+
- `toFieldLabel` 是目标数据集的真实字段名,并适合向用户展示。
|
|
112
|
+
- 关系方向处于支持范围内。
|
|
113
|
+
- `joinType` 与真实数据约束和业务语义一致。
|
|
114
|
+
- 同一组来源、目标和字段不存在重复关系。
|
|
115
|
+
- `main_sub` 只用于真实的一对多业务归属关系。
|
|
116
|
+
|
|
117
|
+
验收主子表时,应至少准备一条主记录和多条子记录:当前主记录只能读取归属于它的子记录,切换主记录后不能继续出现上一条记录的明细。
|
|
118
|
+
|
|
119
|
+
## 与页面配置的边界
|
|
120
|
+
|
|
121
|
+
- 数据集关系只定义数据模型语义;关系存在不代表页面已经生成关联区域、明细布局或新增编辑交互。
|
|
122
|
+
- `LrSmartCreate`、`LrSmartUpdate` 和 `LrSmartDetail` 的 `props.sub_info` 是 PageSchema 展示与交互配置,不是数据集关系对象。
|
|
123
|
+
- 标准页生成器使用的 `extend.subDatasetCode`、`extend.subTableName`、可选 `extend.subColumnName` 和 `relatedTablesJson` 属于页面生成协议;即使与关系元数据存在同名字段,它们也不是数据集 `relations` 对象本身。
|
|
124
|
+
- 表单、筛选器和表格中的动态选项配置只负责加载候选数据,不能替代数据集关系声明。
|
|
125
|
+
|
|
126
|
+
排查页面关联异常时,应先确认数据集关系本身的方向、字段、展示字段、基数和业务类型,再检查页面的数据源与组件绑定。
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PageSchema-external-resources-usage
|
|
3
|
+
description: 外部资源(自定义SQL、BFF脚本、权限点)在PageSchema中的消费规范,Skill只引用不生成。先验知识:低代码引擎搭建协议、Ant Design 5 组件知识。
|
|
4
|
+
tags: [page-schema, external-resources, custom-sql, bff, permission]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 外部资源使用规范
|
|
8
|
+
|
|
9
|
+
> **先验知识**:默认已具备低代码引擎搭建协议和 Ant Design 5 组件知识。
|
|
10
|
+
|
|
11
|
+
## 1. 核心原则
|
|
12
|
+
|
|
13
|
+
**Skill 职责边界**:
|
|
14
|
+
|
|
15
|
+
- ✅ **只消费**:引用已生成的自定义 SQL、BFF 脚本、权限点
|
|
16
|
+
- ❌ **不生成**:不负责创建新的自定义 SQL、BFF 脚本、权限点
|
|
17
|
+
|
|
18
|
+
## 2. 自定义 SQL 使用规范
|
|
19
|
+
|
|
20
|
+
### 2.1 两种聚合查询方式对比
|
|
21
|
+
|
|
22
|
+
| 维度 | aggregate API | custom SQL |
|
|
23
|
+
|------|--------------|------------|
|
|
24
|
+
| API 路径 | `POST /api/{appCode}/{datasetCode}/aggregate` | `POST /api/custom/executeSql` |
|
|
25
|
+
| 跨表支持 | **单表**(基于 datasetCode 对应的一张表) | **任意跨表**(自定义 SELECT + JOIN) |
|
|
26
|
+
| SQL 编写者 | 平台自动生成 SQL | 开发者手写 SQL(MyBatis 语法) |
|
|
27
|
+
|
|
28
|
+
**选择策略**:
|
|
29
|
+
|
|
30
|
+
- **单表聚合**:优先使用 aggregate API(平台自动生成 SQL)
|
|
31
|
+
- **跨表聚合**:必须使用 custom SQL(支持 JOIN、复杂条件)
|
|
32
|
+
|
|
33
|
+
### 2.2 aggregate API 接口
|
|
34
|
+
|
|
35
|
+
**接口路径**:`POST /api/{appCode}/{datasetCode}/aggregate`
|
|
36
|
+
|
|
37
|
+
**请求参数**:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"where": { "status": { "$eq": "ACTIVE" } },
|
|
42
|
+
"aggregate": [
|
|
43
|
+
{ "type": "SUM", "column": "amount", "alias": "totalAmount" },
|
|
44
|
+
{ "type": "COUNT", "column": "id", "alias": "recordCount", "distinct": true }
|
|
45
|
+
],
|
|
46
|
+
"groupBy": ["company_id"],
|
|
47
|
+
"having": { "company_id": { "$notNull": true } },
|
|
48
|
+
"orderBy": [{ "totalAmount": "desc" }],
|
|
49
|
+
"currentPage": 1,
|
|
50
|
+
"pageSize": 20
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`having` 与 `where` 使用相同的对象结构,字段名必须是数据集真实字段;聚合结果别名可用于 `orderBy`。
|
|
55
|
+
|
|
56
|
+
**聚合函数类型**:`SUM` / `AVG` / `COUNT` / `MAX` / `MIN`
|
|
57
|
+
|
|
58
|
+
**在 PageSchema 中的配置方式**:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"dataSource": {
|
|
63
|
+
"type": "aggregate",
|
|
64
|
+
"datasetCode": "customer_dataset_code",
|
|
65
|
+
"aggregate": [{ "type": "SUM", "column": "amount", "alias": "totalAmount" }],
|
|
66
|
+
"groupBy": ["status"]
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2.3 custom SQL 接口
|
|
72
|
+
|
|
73
|
+
**接口路径**:`POST /api/custom/executeSql`
|
|
74
|
+
|
|
75
|
+
**请求参数**:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"sqlCode": "xxxx-xxxxx",
|
|
80
|
+
"params": { "customerId": "123", "startDate": "2025-01-01" }
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**在 PageSchema 中的配置方式**:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"dataSource": {
|
|
89
|
+
"type": "customSql",
|
|
90
|
+
"sqlCode": "query_customer_with_level",
|
|
91
|
+
"params": { "customerId": "123" }
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
- `type: "customSql"` 表示使用自定义 SQL 数据源
|
|
97
|
+
- `sqlCode` 是在平台创建的自定义 SQL 的唯一标识
|
|
98
|
+
- `params` 是传递给 SQL 的参数(对应 SQL 中的 `#{paramName}` 占位符)
|
|
99
|
+
|
|
100
|
+
### 2.4 禁止的操作
|
|
101
|
+
|
|
102
|
+
- ❌ 生成新的自定义 SQL 语句
|
|
103
|
+
- ❌ 创建新的 sqlCode
|
|
104
|
+
- ❌ 修改已有的自定义 SQL 内容
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 3. BFF 脚本使用规范
|
|
109
|
+
|
|
110
|
+
### 3.1 BFF 脚本类型
|
|
111
|
+
|
|
112
|
+
| 类型 | 说明 | 消费方式 | PageSchema 是否需要配置 |
|
|
113
|
+
|------|------|---------|---------------------|
|
|
114
|
+
| **HOOK 脚本** | 绑定到数据集 API(Before/After) | 平台自动执行 | ❌ 否(平台配置) |
|
|
115
|
+
| **ENDPOINT 脚本** | 独立业务端点 | 通过 dataSource 配置 | ✅ 是(需要配置 dataSource) |
|
|
116
|
+
|
|
117
|
+
**职责边界**:
|
|
118
|
+
|
|
119
|
+
- `skill_edit_smart_page_dov2` 只消费 ENDPOINT 类型的 BFF 脚本
|
|
120
|
+
- HOOK 类型的 BFF 脚本由平台自动执行,不需要在 PageSchema 中引用
|
|
121
|
+
|
|
122
|
+
### 3.2 ENDPOINT 脚本消费方式
|
|
123
|
+
|
|
124
|
+
**API 路径**:`POST /api/endpoint/{appCode}/{scriptName}`
|
|
125
|
+
|
|
126
|
+
**步骤 1:在 dataSource 中配置 ENDPOINT API**:
|
|
127
|
+
|
|
128
|
+
```json
|
|
129
|
+
{
|
|
130
|
+
"dataSource": {
|
|
131
|
+
"list": [{
|
|
132
|
+
"id": "convertToCustomer",
|
|
133
|
+
"type": "fetch",
|
|
134
|
+
"options": {
|
|
135
|
+
"uri": "/api/endpoint/<appCode>/convertToCustomer",
|
|
136
|
+
"params": {}
|
|
137
|
+
}
|
|
138
|
+
}]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**步骤 2:在按钮配置中调用**:
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"title": "转化为客户",
|
|
148
|
+
"optType": "flowAction",
|
|
149
|
+
"options": {
|
|
150
|
+
"flowList": [{
|
|
151
|
+
"active": true,
|
|
152
|
+
"optType": "request",
|
|
153
|
+
"options": {
|
|
154
|
+
"_bindDataSource": "convertToCustomer",
|
|
155
|
+
"_bindDataSourceParams": {
|
|
156
|
+
"type": "JSFunction",
|
|
157
|
+
"value": "function(extraParams) {\n return { id: extraParams.rowKey };\n}"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 3.3 HOOK 脚本说明
|
|
166
|
+
|
|
167
|
+
HOOK 脚本绑定到数据集 API 上,在 API 执行前或执行后自动触发。Skill 不需要处理 HOOK 脚本,PageSchema 中无需引用。
|
|
168
|
+
|
|
169
|
+
### 3.4 禁止的操作
|
|
170
|
+
|
|
171
|
+
- ❌ 生成新的 BFF 脚本代码(HOOK 或 ENDPOINT)
|
|
172
|
+
- ❌ 创建新的 scriptName
|
|
173
|
+
- ❌ 在 PageSchema 中引用 HOOK 类型的 BFF 脚本
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## 4. 权限点使用规范
|
|
178
|
+
|
|
179
|
+
当前标准页面权限由 `LrSmartTable` 运行时内置逻辑处理,Agent 只维护 `LrSmartTable` schema,不生成权限字段。
|
|
180
|
+
|
|
181
|
+
### 4.1 当前实现
|
|
182
|
+
|
|
183
|
+
表格会在运行时过滤无权限按钮:
|
|
184
|
+
|
|
185
|
+
- `toolbar.globalButtons`:按新增动作 `create` 校验。
|
|
186
|
+
- `toolbar.exportButtons.buttons`:按按钮上的 `actionType` 校验,常见值为 `export` / `delete`。
|
|
187
|
+
- `operateButtons`:按数组下标映射为 `update` / `detail` / `delete` 校验。
|
|
188
|
+
|
|
189
|
+
hard rule:`operateButtons` 当前按数组下标硬编码权限动作,顺序必须严格保持 `[update, detail, delete]`。不要调换、插入额外按钮或省略中间位置;第 4 个及之后按钮不会进入当前权限过滤。
|
|
190
|
+
|
|
191
|
+
### 4.2 当前权限链路
|
|
192
|
+
|
|
193
|
+
运行时读取 `_context.appHelper.yt.pointPermitMap`:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
datasetCode -> {
|
|
197
|
+
DATA_CREATE?: boolean,
|
|
198
|
+
DATA_UPDATE?: boolean,
|
|
199
|
+
DATA_DELETE?: boolean,
|
|
200
|
+
DATA_DETAIL?: boolean,
|
|
201
|
+
DATA_EXPORT?: boolean
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
当表格配置了 `datasetCode` 时,使用该数据集对应权限;未配置 `datasetCode` 时,使用 `pointPermitMap` 中第一组权限。
|
|
206
|
+
|
|
207
|
+
动作映射:
|
|
208
|
+
|
|
209
|
+
| actionType | 权限 key |
|
|
210
|
+
|------------|----------|
|
|
211
|
+
| `create` | `DATA_CREATE` |
|
|
212
|
+
| `update` | `DATA_UPDATE` |
|
|
213
|
+
| `delete` | `DATA_DELETE` |
|
|
214
|
+
| `detail` | `DATA_DETAIL` |
|
|
215
|
+
| `export` | `DATA_EXPORT` |
|
|
216
|
+
|
|
217
|
+
### 4.3 Agent 规则
|
|
218
|
+
|
|
219
|
+
- 不生成任何权限字段。
|
|
220
|
+
- 批量导出 / 批量删除等 `exportButtons.buttons[]` 需要明确动作语义时,可配置 `actionType`。
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## 5. 总结
|
|
225
|
+
|
|
226
|
+
| 资源类型 | 允许操作 | 禁止操作 |
|
|
227
|
+
|---------|---------|---------|
|
|
228
|
+
| 自定义 SQL | 引用 sqlCode | 生成 SQL 语句 |
|
|
229
|
+
| BFF 脚本 | 调用 scriptName | 生成脚本代码 |
|
|
230
|
+
| 权限点 | 使用当前表格内置权限过滤 | 生成权限字段或创建权限点 |
|
|
231
|
+
|
|
232
|
+
**用户需要新建资源时**:引导用户到平台手动配置,获取 code/name 后帮助配置到 Schema。
|