@lovrabet/rabetbase-cli 2.4.7-beta.1 → 2.4.7-beta.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 +4 -4
- 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.d.ts +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/business-groups.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-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.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/search.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/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.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/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.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- 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 +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.d.ts +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.d.ts +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.d.ts +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.d.ts +2 -2
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/types.d.ts +1 -1
- package/lib/core/bff/utils.d.ts +2 -2
- 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.js +1 -1
- 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.js +1 -1
- package/lib/skills/main.js +1 -1
- 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/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 +2 -2
- package/sidecar/flags.json +1 -1
- package/skills/rabetbase/SKILL.md +28 -28
- package/skills/rabetbase/guides/backend-function.md +30 -30
- package/skills/rabetbase/guides/best-practices.md +8 -8
- package/skills/rabetbase/guides/bff-creation-workflow.md +16 -16
- package/skills/rabetbase/guides/conflict-detection.md +3 -3
- package/skills/rabetbase/guides/custom-page-workflow.md +8 -8
- package/skills/rabetbase/guides/data-api-guidelines.md +6 -6
- package/skills/rabetbase/guides/legacy-application-blueprint-workflow.md +8 -8
- package/skills/rabetbase/guides/sql-creation-workflow.md +2 -2
- package/skills/rabetbase/guides/troubleshooting.md +6 -6
- package/skills/rabetbase/guides/typescript-sdk.md +10 -10
- package/skills/rabetbase/knowledge/page-schema/LrSmartTable.md +1 -1
- package/skills/rabetbase/knowledge/page-schema/external-resources-usage.md +10 -10
- package/skills/rabetbase/references/rabetbase-app-config.md +2 -2
- package/skills/rabetbase/references/rabetbase-bff-create.md +3 -3
- package/skills/rabetbase/references/rabetbase-bff-delete.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-detail.md +4 -4
- package/skills/rabetbase/references/rabetbase-bff-list.md +8 -8
- package/skills/rabetbase/references/rabetbase-bff-pull.md +1 -1
- package/skills/rabetbase/references/rabetbase-bff-push.md +3 -3
- package/skills/rabetbase/references/rabetbase-bff-status.md +1 -1
- package/skills/rabetbase/references/rabetbase-codegen-sql.md +3 -3
- package/skills/rabetbase/references/rabetbase-dataset-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-notification-config-list.md +3 -3
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/rules/lovrabet_rules.mdc.tpl +7 -7
- package/templates/skill/SKILL.md.tpl +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a291_0x571f7c=a291_0x3702;(function(_0xae3dc4,_0x1493b9){const _0x43f53d=a291_0x3702,_0x3fe134=_0xae3dc4();while(!![]){try{const _0x18861c=-parseInt(_0x43f53d(0xd2))/0x1+parseInt(_0x43f53d(0xe8))/0x2+parseInt(_0x43f53d(0xf6))/0x3*(-parseInt(_0x43f53d(0xd7))/0x4)+-parseInt(_0x43f53d(0xf4))/0x5*(-parseInt(_0x43f53d(0xe5))/0x6)+parseInt(_0x43f53d(0xe9))/0x7+-parseInt(_0x43f53d(0xfc))/0x8*(parseInt(_0x43f53d(0xc3))/0x9)+parseInt(_0x43f53d(0xeb))/0xa*(parseInt(_0x43f53d(0xc2))/0xb);if(_0x18861c===_0x1493b9)break;else _0x3fe134['push'](_0x3fe134['shift']());}catch(_0x462851){_0x3fe134['push'](_0x3fe134['shift']());}}}(a291_0x5751,0x6d385));import a291_0x45c49e from'node:fs';function a291_0x3702(_0x71b5f4,_0x3685be){_0x71b5f4=_0x71b5f4-0xbf;const _0x57519b=a291_0x5751();let _0x3702c8=_0x57519b[_0x71b5f4];return _0x3702c8;}import a291_0x503ce5 from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();function a291_0x5751(){const _0x10b06f=['padStart','split','processTemplate','getHours','YourModel','endsWith','模板内容替换失败','.md','toComponentName','tableName','.jsx','721128yjoSJd','LOVRABET','replaceContent','352396iSGsrH','694064GInuGz','includes','561880gkQFMN','\x20},','processDirectory','promises','copyFile','pad','push','getSeconds','getFullYear','20bVtZeV','tableName:\x20\x22','3oZncfe','name:\x20\x22','getMonth','isFile','info','readdir','80NwORXd','processFile','alias','slice','.scss','datasetCode:\x20\x22','message','formatLocalTimestamp','map','getMinutes','275fqkbrS','604251guqQxI','template','toDisplayTitle','success','getDate','writeFile','.tpl','charAt','.tsx','replaceApiContent','mkdir','.js','toUpperCase','.json','join','765233MxiqNn','extname','replace','.css','name','1107256FDSoxv','pop','now'];a291_0x5751=function(){return _0x10b06f;};return a291_0x5751();}export class TemplateReplacer{static[a291_0x571f7c(0xf0)](_0x27bffd){const _0x5bcb7a=a291_0x571f7c;return String(_0x27bffd)[_0x5bcb7a(0xda)](0x2,'0');}static[a291_0x571f7c(0xbf)](_0x8246ba){const _0x1eed82=a291_0x571f7c,_0xe2fe0e=_0x8246ba[_0x1eed82(0xf3)](),_0x560bb1=this[_0x1eed82(0xf0)](_0x8246ba[_0x1eed82(0xf8)]()+0x1),_0x3ebdea=this[_0x1eed82(0xf0)](_0x8246ba[_0x1eed82(0xc7)]()),_0x5f3f55=this['pad'](_0x8246ba[_0x1eed82(0xdd)]()),_0x1e4478=this['pad'](_0x8246ba[_0x1eed82(0xc1)]()),_0x24dff9=this[_0x1eed82(0xf0)](_0x8246ba[_0x1eed82(0xf2)]());return{'createdAt':_0xe2fe0e+'-'+_0x560bb1+'-'+_0x3ebdea+'\x20'+_0x5f3f55+':'+_0x1e4478+':'+_0x24dff9,'createdDate':_0xe2fe0e+'-'+_0x560bb1+'-'+_0x3ebdea,'createdTime':_0x5f3f55+':'+_0x1e4478+':'+_0x24dff9};}static[a291_0x571f7c(0xe2)](_0x1eb807){const _0x2576f8=a291_0x571f7c,_0x1ccc51=_0x1eb807['split']('/')[_0x2576f8(0xd8)]()||_0x1eb807;return _0x1ccc51[_0x2576f8(0xdb)]('-')[_0x2576f8(0xc0)](_0x5c65f5=>_0x5c65f5['charAt'](0x0)[_0x2576f8(0xcf)]()+_0x5c65f5[_0x2576f8(0xff)](0x1)['toLowerCase']())[_0x2576f8(0xd1)]('');}static['toDisplayTitle'](_0x5672cb){const _0x5974ca=a291_0x571f7c,_0x3e41dc=_0x5672cb[_0x5974ca(0xdb)]('/')[_0x5974ca(0xd8)]()||_0x5672cb;return _0x3e41dc[_0x5974ca(0xdb)]('-')[_0x5974ca(0xc0)](_0x2290b0=>_0x2290b0[_0x5974ca(0xca)](0x0)[_0x5974ca(0xcf)]()+_0x2290b0[_0x5974ca(0xff)](0x1)['toLowerCase']())[_0x5974ca(0xd1)]('\x20');}static[a291_0x571f7c(0xe7)](_0x2f5569,_0x1a2469,_0x53c4c9){const _0x3864a5=a291_0x571f7c,_0x124213=this['toComponentName'](_0x1a2469),_0xb9a8f4=this[_0x3864a5(0xc5)](_0x1a2469),{createdAt:_0x5195ef,createdDate:_0xaa7f85,createdTime:_0x34ec6d}=this[_0x3864a5(0xbf)](new Date());let _0xb2543f=_0x2f5569[_0x3864a5(0xd4)](/\{CliVersion\}/g,CLI_VERSION)[_0x3864a5(0xd4)](/\{ComponentName\}/g,_0x124213)['replace'](/\{DisplayTitle\}/g,_0xb9a8f4)[_0x3864a5(0xd4)](/\{PageName\}/g,_0x1a2469)[_0x3864a5(0xd4)](/\{TemplateName\}/g,_0x53c4c9)[_0x3864a5(0xd4)](/\{CreatedAt\}/g,_0x5195ef)['replace'](/\{CreatedDate\}/g,_0xaa7f85)[_0x3864a5(0xd4)](/\{CreatedTime\}/g,_0x34ec6d);return _0xb2543f;}static[a291_0x571f7c(0xcc)](_0x24e183,_0x3b830e,_0x3b05f6,_0x32d958,_0x207bfb,_0x34522f,_0x327a52,_0x1759ec){const _0x459533=a291_0x571f7c,_0xd3893e=new Date(),_0x460f9a=_0xd3893e['toISOString'](),_0x4144d2=_0x3b05f6[_0x459533(0xc0)](_0x264b9d=>{const _0x51071a=_0x459533,_0x306c4c=[_0x51071a(0x101)+_0x264b9d['datasetCode']+'\x22',_0x51071a(0xf5)+_0x264b9d[_0x51071a(0xe3)]+'\x22',_0x51071a(0xf7)+_0x264b9d['name']+'\x22'];return _0x264b9d[_0x51071a(0xfe)]&&_0x306c4c[_0x51071a(0xf1)]('alias:\x20\x22'+_0x264b9d[_0x51071a(0xfe)]+'\x22'),'\x0a\x20\x20\x20\x20{\x20'+_0x306c4c['join'](',\x20')+_0x51071a(0xec);})[_0x459533(0xd1)](''),_0x276e5d=_0x32d958||_0x3b05f6[0x0]?.['alias']||_0x459533(0xde);let _0x7c39b=_0x24e183[_0x459533(0xd4)](/\{AppCode\}/g,_0x3b830e)[_0x459533(0xd4)](/\{ModelConfigs\}/g,_0x4144d2)[_0x459533(0xd4)](/\{ExampleModelName\}/g,_0x276e5d)[_0x459533(0xd4)](/\{ApiFileName\}/g,_0x207bfb||'api')[_0x459533(0xd4)](/\{ConfigName\}/g,_0x34522f||'default')[_0x459533(0xd4)](/\{ClientConfigParam\}/g,_0x327a52||'')[_0x459533(0xd4)](/\{VarPrefix\}/g,_0x1759ec||_0x459533(0xe6))[_0x459533(0xd4)](/\{CreatedAt\}/g,_0x460f9a);return _0x7c39b;}static async[a291_0x571f7c(0xdc)](_0x541d11,_0x338600,_0xef722b,_0x304630,_0x33ad1a=!![]){const _0x5400f2=a291_0x571f7c,_0x5f2c85=Date['now']();try{_0x33ad1a&&logger[_0x5400f2(0xfa)]('template','开始处理模板内容替换',{'templatePath':_0x541d11,'targetPath':_0x338600,'pageName':_0xef722b,'templateName':_0x304630});await a291_0x45c49e['promises'][_0x5400f2(0xcd)](_0x338600,{'recursive':!![]}),await this[_0x5400f2(0xed)](_0x541d11,_0x338600,_0xef722b,_0x304630);if(_0x33ad1a){const _0x2f704e=Date[_0x5400f2(0xd9)]()-_0x5f2c85;logger[_0x5400f2(0xc6)](_0x5400f2(0xc4),'模板内容替换完成',_0x2f704e,{'pageName':_0xef722b,'templateName':_0x304630});}}catch(_0x1a3f41){if(_0x33ad1a){const _0x5ee0b8=Date[_0x5400f2(0xd9)]()-_0x5f2c85;logger['error'](_0x5400f2(0xc4),_0x5400f2(0xe0),{'templatePath':_0x541d11,'targetPath':_0x338600,'pageName':_0xef722b,'templateName':_0x304630,'error':_0x1a3f41 instanceof Error?_0x1a3f41[_0x5400f2(0x102)]:String(_0x1a3f41),'duration':_0x5ee0b8});}throw _0x1a3f41;}}static async['processDirectory'](_0x4cbf80,_0x3b0a36,_0xd03e1b,_0x1ce3fe){const _0x108166=a291_0x571f7c,_0x42d46f=await a291_0x45c49e[_0x108166(0xee)][_0x108166(0xfb)](_0x4cbf80,{'withFileTypes':!![]});for(const _0x343b7f of _0x42d46f){const _0x2bddb9=a291_0x503ce5[_0x108166(0xd1)](_0x4cbf80,_0x343b7f[_0x108166(0xd6)]);let _0x1f1f25=a291_0x503ce5['join'](_0x3b0a36,_0x343b7f[_0x108166(0xd6)]);_0x343b7f[_0x108166(0xd6)][_0x108166(0xdf)](_0x108166(0xc9))&&(_0x1f1f25=a291_0x503ce5[_0x108166(0xd1)](_0x3b0a36,_0x343b7f[_0x108166(0xd6)]['replace'](/\.tpl$/,'')));if(_0x343b7f['isDirectory']())await a291_0x45c49e[_0x108166(0xee)][_0x108166(0xcd)](_0x1f1f25,{'recursive':!![]}),await this[_0x108166(0xed)](_0x2bddb9,_0x1f1f25,_0xd03e1b,_0x1ce3fe);else _0x343b7f[_0x108166(0xf9)]()&&await this['processFile'](_0x2bddb9,_0x1f1f25,_0xd03e1b,_0x1ce3fe);}}static async[a291_0x571f7c(0xfd)](_0x395799,_0x245d22,_0x44dc25,_0x12f87d){const _0x17ddc2=a291_0x571f7c,_0x4ea73a=a291_0x503ce5[_0x17ddc2(0xd3)](_0x395799)['toLowerCase']();_0x395799[_0x17ddc2(0xdf)](_0x17ddc2(0xc9))&&(_0x245d22=_0x245d22['replace'](/\.tpl$/,''));const _0x21a098=[_0x17ddc2(0xcb),'.ts',_0x17ddc2(0xe4),_0x17ddc2(0xce),_0x17ddc2(0xd0),_0x17ddc2(0xe1),_0x17ddc2(0xd5),_0x17ddc2(0x100),'.tpl'];if(_0x21a098[_0x17ddc2(0xea)](_0x4ea73a)||_0x395799['endsWith']('.tpl')){const _0x4645c1=await a291_0x45c49e[_0x17ddc2(0xee)]['readFile'](_0x395799,'utf8'),_0x5bb1f5=this[_0x17ddc2(0xe7)](_0x4645c1,_0x44dc25,_0x12f87d);await a291_0x45c49e[_0x17ddc2(0xee)][_0x17ddc2(0xc8)](_0x245d22,_0x5bb1f5,'utf8');}else await a291_0x45c49e[_0x17ddc2(0xee)][_0x17ddc2(0xef)](_0x395799,_0x245d22);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27229d,_0x4b0d1f){const _0x3f0748=a292_0x5aa8,_0x1bb52c=_0x27229d();while(!![]){try{const _0x5143ee=-parseInt(_0x3f0748(0x17f))/0x1+-parseInt(_0x3f0748(0x17c))/0x2+-parseInt(_0x3f0748(0x170))/0x3+parseInt(_0x3f0748(0x182))/0x4+parseInt(_0x3f0748(0x175))/0x5*(parseInt(_0x3f0748(0x17b))/0x6)+parseInt(_0x3f0748(0x171))/0x7+parseInt(_0x3f0748(0x16c))/0x8;if(_0x5143ee===_0x4b0d1f)break;else _0x1bb52c['push'](_0x1bb52c['shift']());}catch(_0x3664c7){_0x1bb52c['push'](_0x1bb52c['shift']());}}}(a292_0x5f49,0xd9904));function a292_0x5f49(){const _0x5d8b00=['6498016RanNce','lastNotifiedAt','stringify','object','762780WirUPL','3173450rWGFPl','gte','https://www.npmjs.com/package/','rabetbase-cli','5lJiiGE','/v/','\x20available,\x20current\x20','utf8','valid','trim','2037606BTtiun','342694tefwNZ','now','number','1584190TsnHqR','checkedAt','parse','5182936mTlJWj','.cache','update-check.json','true','toLowerCase','stableVersion'];a292_0x5f49=function(){return _0x5d8b00;};return a292_0x5f49();}import{mkdir,readFile,writeFile}from'node:fs/promises';function a292_0x5aa8(_0x542c2e,_0x4b6510){_0x542c2e=_0x542c2e-0x169;const _0x5f498f=a292_0x5f49();let _0x5aa803=_0x5f498f[_0x542c2e];return _0x5aa803;}import{homedir}from'node:os';import{dirname,join}from'node:path';import a292_0x6bc56e from'semver';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x556c54=a292_0x5aa8,_0x49e14d=process.env.RABETBASE_NO_UPDATE_NOTICE?.['trim']()[_0x556c54(0x16a)]();return _0x49e14d==='1'||_0x49e14d===_0x556c54(0x169)||_0x49e14d==='yes';}function cacheRoot(){const _0x285772=a292_0x5aa8;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0x285772(0x183));}export function getUpdateNoticeCachePath(){const _0x7b4fc5=a292_0x5aa8;return join(cacheRoot(),_0x7b4fc5(0x174),_0x7b4fc5(0x184));}async function readUpdateNoticeCache(){const _0x5ab67a=a292_0x5aa8;try{const _0x591713=await readFile(getUpdateNoticeCachePath(),_0x5ab67a(0x178)),_0xf2520=JSON[_0x5ab67a(0x181)](_0x591713);if(!_0xf2520||typeof _0xf2520!==_0x5ab67a(0x16f))return{};return _0xf2520;}catch{return{};}}async function writeUpdateNoticeCache(_0x1c4733){const _0x11862c=a292_0x5aa8;try{const _0x2f595b=getUpdateNoticeCachePath();await mkdir(dirname(_0x2f595b),{'recursive':!![]}),await writeFile(_0x2f595b,JSON[_0x11862c(0x16e)](_0x1c4733,null,0x2)+'\x0a',_0x11862c(0x178));}catch{}}function isFreshCheck(_0x20203d,_0x2d8ec5){const _0x266615=a292_0x5aa8;return typeof _0x20203d[_0x266615(0x180)]==='number'&&_0x2d8ec5-_0x20203d['checkedAt']<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0xbb2147,_0x2507ed,_0x482d32){const _0x7dd067=a292_0x5aa8;return _0xbb2147['lastNotifiedVersion']===_0x2507ed&&typeof _0xbb2147['lastNotifiedAt']===_0x7dd067(0x17e)&&_0x482d32-_0xbb2147[_0x7dd067(0x16d)]<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0x19b054){const _0x50f62e=a292_0x5aa8;return _0x50f62e(0x173)+NPM_PACKAGE_NAME+_0x50f62e(0x176)+_0x19b054;}export async function resolveLatestUpdateNotice(){const _0x10f5a9=a292_0x5aa8;if(isUpdateNoticeDisabled())return null;try{const _0x455a66=Date[_0x10f5a9(0x17d)](),_0x50d979=getCliVersion(),_0x1425b1=await readUpdateNoticeCache();let _0x256bc1=isFreshCheck(_0x1425b1,_0x455a66)?_0x1425b1['latest']?.[_0x10f5a9(0x17a)]():undefined;if(!_0x256bc1&&!isFreshCheck(_0x1425b1,_0x455a66)){const _0x2ac357=await getCliVersionPolicy();_0x256bc1=_0x2ac357?.[_0x10f5a9(0x16b)]?.[_0x10f5a9(0x17a)]()||undefined,await writeUpdateNoticeCache({..._0x1425b1,'checkedAt':_0x455a66,'latest':_0x256bc1,'failed':!_0x256bc1});}if(!_0x256bc1||!a292_0x6bc56e[_0x10f5a9(0x179)](_0x50d979)||!a292_0x6bc56e[_0x10f5a9(0x179)](_0x256bc1))return null;if(a292_0x6bc56e[_0x10f5a9(0x172)](_0x50d979,_0x256bc1))return null;if(isRecentlyNotified(_0x1425b1,_0x256bc1,_0x455a66))return null;const _0x1914f9=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0x1425b1,'checkedAt':isFreshCheck(_0x1425b1,_0x455a66)?_0x1425b1[_0x10f5a9(0x180)]:_0x455a66,'latest':_0x256bc1,'failed':![],'lastNotifiedVersion':_0x256bc1,'lastNotifiedAt':_0x455a66}),{'command':_0x1914f9,'current':_0x50d979,'latest':_0x256bc1,'url':buildNpmVersionUrl(_0x256bc1),'message':CLI_BIN_NAME+'\x20'+_0x256bc1+_0x10f5a9(0x177)+_0x50d979+',\x20run:\x20'+_0x1914f9};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a293_0x225f(_0x43add0,_0x12a931){_0x43add0=_0x43add0-0x196;var _0x317c6d=a293_0x317c();var _0x225fe4=_0x317c6d[_0x43add0];return _0x225fe4;}(function(_0x52f53a,_0x31441d){var _0xe506f8=a293_0x225f,_0x491eed=_0x52f53a();while(!![]){try{var _0x50acfb=-parseInt(_0xe506f8(0x19d))/0x1*(-parseInt(_0xe506f8(0x19c))/0x2)+parseInt(_0xe506f8(0x1a0))/0x3*(-parseInt(_0xe506f8(0x19e))/0x4)+parseInt(_0xe506f8(0x199))/0x5*(parseInt(_0xe506f8(0x19b))/0x6)+-parseInt(_0xe506f8(0x198))/0x7+parseInt(_0xe506f8(0x196))/0x8+-parseInt(_0xe506f8(0x19a))/0x9*(parseInt(_0xe506f8(0x197))/0xa)+parseInt(_0xe506f8(0x19f))/0xb;if(_0x50acfb===_0x31441d)break;else _0x491eed['push'](_0x491eed['shift']());}catch(_0x5bb897){_0x491eed['push'](_0x491eed['shift']());}}}(a293_0x317c,0x86f24));function a293_0x317c(){var _0x400a6f=['3922292CAjjWr','3LpsKGe','7624688AAnLMi','4096500UpLYvg','1201067fRFdDB','310YCquAi','9LReAYE','1338zYHjJb','4eNQGNw','84737XcTcgL','1435948GqUWYm'];a293_0x317c=function(){return _0x400a6f;};return a293_0x317c();}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3888fd,_0x4e66c5){var _0x39c8fa=a294_0x218f,_0xb5c13e=_0x3888fd();while(!![]){try{var _0x38d4ac=-parseInt(_0x39c8fa(0x178))/0x1+parseInt(_0x39c8fa(0x173))/0x2*(-parseInt(_0x39c8fa(0x172))/0x3)+-parseInt(_0x39c8fa(0x177))/0x4*(-parseInt(_0x39c8fa(0x176))/0x5)+parseInt(_0x39c8fa(0x174))/0x6*(parseInt(_0x39c8fa(0x170))/0x7)+-parseInt(_0x39c8fa(0x171))/0x8+parseInt(_0x39c8fa(0x17a))/0x9*(parseInt(_0x39c8fa(0x179))/0xa)+parseInt(_0x39c8fa(0x175))/0xb;if(_0x38d4ac===_0x4e66c5)break;else _0xb5c13e['push'](_0xb5c13e['shift']());}catch(_0x54b235){_0xb5c13e['push'](_0xb5c13e['shift']());}}}(a294_0x1eba,0xdb79b));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a294_0x1eba(){var _0x4a090a=['221790RhRZCH','2kcGFFz','88254RizmGx','6054169kLWuFq','651395RwoLPc','12IGaVkb','32464oKofXc','21530SjVRvs','2286zQpEvu','21xJPcsx','4214720kyxQxi'];a294_0x1eba=function(){return _0x4a090a;};return a294_0x1eba();}function a294_0x218f(_0x4e1002,_0x6e9b7a){_0x4e1002=_0x4e1002-0x170;var _0x1eba2e=a294_0x1eba();var _0x218f54=_0x1eba2e[_0x4e1002];return _0x218f54;}export async function withActiveCookie(_0x5096d4,_0x4cf770){setActiveCookie(_0x5096d4);try{return await _0x4cf770();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a295_0x4d2e(_0x3da1fc,_0x2a894a){_0x3da1fc=_0x3da1fc-0x1dc;var _0xcd4769=a295_0xcd47();var _0x4d2e14=_0xcd4769[_0x3da1fc];return _0x4d2e14;}(function(_0x16448e,_0x44a212){var _0x57880f=a295_0x4d2e,_0x41a8e6=_0x16448e();while(!![]){try{var _0x5da010=-parseInt(_0x57880f(0x1e2))/0x1*(-parseInt(_0x57880f(0x1df))/0x2)+-parseInt(_0x57880f(0x1e0))/0x3*(parseInt(_0x57880f(0x1e9))/0x4)+parseInt(_0x57880f(0x1e3))/0x5*(-parseInt(_0x57880f(0x1de))/0x6)+parseInt(_0x57880f(0x1e7))/0x7+parseInt(_0x57880f(0x1dc))/0x8+-parseInt(_0x57880f(0x1e4))/0x9*(parseInt(_0x57880f(0x1e8))/0xa)+parseInt(_0x57880f(0x1dd))/0xb*(-parseInt(_0x57880f(0x1e5))/0xc);if(_0x5da010===_0x44a212)break;else _0x41a8e6['push'](_0x41a8e6['shift']());}catch(_0x94a8b1){_0x41a8e6['push'](_0x41a8e6['shift']());}}}(a295_0xcd47,0x4a3a3));export function writeCliSideChannelLine(_0x5de615){var _0x139026=a295_0x4d2e;process[_0x139026(0x1e6)][_0x139026(0x1e1)](_0x5de615+'\x0a');}function a295_0xcd47(){var _0x4ee805=['1535112zXkOFf','40942NajUYr','83454Avuvac','2IcmwqO','27IwCbNZ','write','190769SgLOmU','5sMrHit','1374498Hdwvir','12TCauKs','stderr','2397353ndCpwn','10gTjGlp','111444tVkCQv'];a295_0xcd47=function(){return _0x4ee805;};return a295_0xcd47();}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.4.7-beta.
|
|
4
|
-
"description": "Developer CLI for Lovrabet apps, datasets, pages, SQL,
|
|
3
|
+
"version": "2.4.7-beta.2",
|
|
4
|
+
"description": "Developer CLI for Lovrabet apps, datasets, pages, SQL, Backend Function, database connections, skills, and AI agent workflows.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"lovrabet",
|
package/sidecar/flags.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rabetbase
|
|
3
|
-
version: 2.4.7-beta.
|
|
4
|
-
description: "Lovrabet 开发工作流 CLI — 通过 rabetbase 命令管理数据集、数据库连接(dblink)、数据列表页(Data List Page)、自定义页面(Custom Page)、SQL 查询、
|
|
3
|
+
version: 2.4.7-beta.2
|
|
4
|
+
description: "Lovrabet 开发工作流 CLI — 通过 rabetbase 命令管理数据集、数据库连接(dblink)、数据列表页(Data List Page)、自定义页面(Custom Page)、SQL 查询、Backend Function 脚本、通知配置、企业知识库、菜单事实读取与同步、开发角色与协作者、应用文件、面向票证类业务材料文字与结构化字段提取的 OCR、代码生成,以及平台问题上报。触发词:数据集、数据表、dataset relation-audit、dataset delete、dataset restore、废弃数据集、恢复数据集、dataset rename、dataset field-update、dataset extend-update、dataset business-groups、dataset business-group-update、businessGroup、字段对象更新、doType、options、数据列表页、Data List Page、自定义页面、Custom Page、page create、page custom-list、page custom-detail、page custom-update、page custom-publish、page generate-start、page generate-status、page relation-audit、page sync、page pull、page push、page restore、恢复已删除页面、dblink、数据库连接、schema 分析、db list、db detail、db create、db update、db delete、db test、db tables、db diff、db diff --view all、db diff-refresh-start、db diff-refresh-status、db analyze-batch-plan、db analyze-start、analyze-cancel、analyze-status、traceId、自定义 SQL、sql.execute、bff.execute、BF 消息通知、Backend Function 消息通知、notification config-list、EMAIL configCode、通知配置、notification.send、企业知识库、公司知识、公共知识、kb search、get_dataset_detail、validate_sql_content、save_or_update_custom_sql、@lovrabet/sdk、lovrabet 开发、rabetbase、filter、codegen、init、appcode、app list、app members-list、tenant members-list、应用人员列表、租户人员列表、workspace、workspace init、workspace use、workspace add、workspace remove、多应用、默认应用、menu list、menu visibility-update、菜单显示、菜单隐藏、visible、menu external-link-create、menu external-link-update、menu rename、菜单改名、外链菜单创建、外链 URL 更新、菜单异常审计、菜单手动删除清单、menu sync、menu asset-update、菜单资源更新、menu move、菜单移动、开发角色、开发协作者、role、role list、role user-add、role user-remove、user-resolve、加入开发者、ADMIN、DEV、OWNER、CUSTOM、project create、project upgrade、schema、jq、compress、file upload、file query-url、ocr recognize、文件上传、OCR 识别、票证文字提取、票证字段提取、发票识别、票据识别、证照识别、长期链接、issue report、平台问题、platform issue、问题上报、user-account dingding-sandbox-bind、钉钉沙箱账号绑定。"
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
7
7
|
bins: ["rabetbase"]
|
|
@@ -26,9 +26,9 @@ metadata:
|
|
|
26
26
|
6. **平台发现**:当你不知道当前登录账号能访问哪些应用时,先 `rabetbase app list --remote`;它查询平台目录,不修改本地配置
|
|
27
27
|
7. **本地配置视图**:当你要确认当前项目或全局已经登记了哪些应用、默认应用是谁时,用 `rabetbase app list`。`rabetbase app` 本身只显示帮助,不等价于 `app list`
|
|
28
28
|
8. **人员目录查询**:查询某租户的人员用 `rabetbase tenant members-list --tenant-code <code>`;查询某应用的人员及其角色归属用 `rabetbase app members-list --appcode <code>`。两者均为只读全量查询,不提供分页、模糊搜索或写入能力。
|
|
29
|
-
9. **本地 SQL /
|
|
29
|
+
9. **本地 SQL / Backend Function 目录**:新建或长期维护的源文件应落在 CLI 与 `bff status` / `sql pull` 一致的路径,避免写在 `src/`、`queries/` 等随意目录后再迁移。
|
|
30
30
|
- **SQL**:项目根 **`.rabetbase/sql/<appCode>/<dbName|db-<id>>/<sqlCode>_<sqlName>.sql|xml`**;草稿或人工兜底可放 `.draft.sql`。`sql create` / `sql pull` / `sql push` / `sql status` 默认围绕这套目录与 `.rabetbase/sql.lock.json` 工作。
|
|
31
|
-
- **
|
|
31
|
+
- **Backend Function**:**`.rabetbase/bff/<appCode>/...`**(由 `bff create` 创建或 `bff pull` 同步;与 `bff status` / `bff push` 扫描范围一致)。详见 [`guides/sql-creation-workflow.md`](guides/sql-creation-workflow.md)、[`guides/bff-creation-workflow.md`](guides/bff-creation-workflow.md)。
|
|
32
32
|
10. **可选:`lovrabet` CLI 查数** — 若本机已安装 **`@lovrabet/lovrabet-cli`**(命令 **`lovrabet`**)且 **版本 ≥ 2.0**(`lovrabet --version`),可用 **`lovrabet data filter` / `lovrabet data getOne`** 按 SDK 语义在终端查看真实行数据与 JSON,便于调试;**非人人安装**,未安装或版本低于 2.0 时仅用 `rabetbase` 即可。详见 [`guides/data-api-guidelines.md`](guides/data-api-guidelines.md) 中「可选:`lovrabet` CLI 查数」。
|
|
33
33
|
|
|
34
34
|
## Skill Freshness
|
|
@@ -45,7 +45,7 @@ metadata:
|
|
|
45
45
|
- 简单聚合且数据集是 DB_TABLE → SDK aggregate;聚合列用 `aggregate[].column`,不要用旧别名 `field`
|
|
46
46
|
- 复杂 JOIN / 数据库函数且数据集是 DB_TABLE → Custom SQL
|
|
47
47
|
- 图表、统计卡片或数据大屏 → 自定义页面 + ECharts;数据层根据查询复杂度选择 Dataset 或 Custom SQL
|
|
48
|
-
- 当前用户、角色、数据范围、外部系统、跨表事务或复杂业务编排 →
|
|
48
|
+
- 当前用户、角色、数据范围、外部系统、跨表事务或复杂业务编排 → Backend Function;Backend Function HOOK 可挂 DB_TABLE 或 METADATA,具体 operation 以后端返回为准
|
|
49
49
|
2. **先拿元数据,再写代码**
|
|
50
50
|
- 至少先查 `rabetbase dataset detail --code xxx --format compress`(或 `json`)获取表结构
|
|
51
51
|
- 跨表场景还需查目标表的结构
|
|
@@ -62,10 +62,10 @@ metadata:
|
|
|
62
62
|
3. **SQL 工作流严格分步**
|
|
63
63
|
- 推荐路径:查现有(`sql list/detail`) 或新建(`sql create`) → 拉/落本地(`sql pull` / `sql create`) → 编辑同步目录文件 → 可选校验(`sql validate`) → 检查状态(`sql status`) → 先预览(`sql push --dry-run` / `sql delete --dry-run`) → 再 `sql push` / `sql delete` → `sql detail` / `sql exec` 验证
|
|
64
64
|
- 先使用 `sql list/detail` 查找可复用的 Custom SQL;没有满足需求的资源时,按照 [`sql-creation-workflow.md`](guides/sql-creation-workflow.md) 与 [`sql-mybatis.md`](guides/sql-mybatis.md) 创建、校验、发布并验证
|
|
65
|
-
- 页面和
|
|
66
|
-
4. **
|
|
65
|
+
- 页面和 Backend Function 执行已发布的 Custom SQL 时使用 `sqlCode` + `params`
|
|
66
|
+
4. **Backend Function 工作流严格分步**
|
|
67
67
|
- 查现有 → 确认字段或通知配置 → 查公共函数 → 本地创建(`bff create`) → 检查状态(`bff status`) → 先预览(`--dry-run`) → 再拉取/推送/删除
|
|
68
|
-
- 创建会发送消息通知的
|
|
68
|
+
- 创建会发送消息通知的 Backend Function 时,先读取 [`backend-function.md`](guides/backend-function.md) 的“消息通知扩展”契约,再执行 [`rabetbase notification config-list --type EMAIL`](references/rabetbase-notification-config-list.md) 获取当前应用的 `configCode`;不得猜测渠道、收件人或把密钥写进脚本
|
|
69
69
|
- 推送完成只代表脚本配置已同步到平台;若用户要确认最终运行效果,显式交接到运行验证(如可用的 `lovrabet bff exec`),不要把运行验证伪装成 `rabetbase` 已完成
|
|
70
70
|
5. **页面体系选择**
|
|
71
71
|
- 数据列表页(Data List Page)是数据集驱动的结构化页面组,用于数据查看、维护和模型验证,不等同于最终业务工作台
|
|
@@ -88,8 +88,8 @@ metadata:
|
|
|
88
88
|
- 编写 JSX、CSS 或词包前,必须阅读 [`generation-standards.md`](knowledge/custom-page/generation-standards.md);选择 UI 组件时阅读 [`components.md`](knowledge/custom-page/components.md)
|
|
89
89
|
8. **Legacy modernization / Application Blueprint 工作流**
|
|
90
90
|
- 当用户要把无人交接老项目、外包接手项目或遗留系统翻新到 Lovrabet 体系时,先阅读 [`guides/legacy-application-blueprint-workflow.md`](guides/legacy-application-blueprint-workflow.md)
|
|
91
|
-
- 主产物是 `.rabetbase/blueprint/<appCode>/application-blueprint.md`,不是直接生成或推送 SQL/
|
|
92
|
-
- 必须把老代码 Logic Graph 与 dbagent 已生成的 Dataset / Relations 绑定,再判断 Instant API、Custom SQL、
|
|
91
|
+
- 主产物是 `.rabetbase/blueprint/<appCode>/application-blueprint.md`,不是直接生成或推送 SQL/Backend Function
|
|
92
|
+
- 必须把老代码 Logic Graph 与 dbagent 已生成的 Dataset / Relations 绑定,再判断 Instant API、Custom SQL、Backend Function、Hook、COMMON 或 Java Service 落点
|
|
93
93
|
|
|
94
94
|
## 应用决议指引
|
|
95
95
|
|
|
@@ -213,7 +213,7 @@ metadata:
|
|
|
213
213
|
1. **标准 SDK 接口**(filter/getOne/create 等)— 能用就不写 SQL
|
|
214
214
|
2. **aggregate 聚合接口** — DB_TABLE 的简单分组汇总;METADATA 不默认支持 aggregate;聚合定义使用 `column` 指定列,`field` 仅作为历史兼容别名
|
|
215
215
|
3. **自定义 SQL** — DB_TABLE 的复杂 JOIN、数据库函数、跨表统计;METADATA 不支持 SQL 路径
|
|
216
|
-
4. **
|
|
216
|
+
4. **Backend Function** — 外部系统调用、跨表事务、复杂业务编排
|
|
217
217
|
|
|
218
218
|
## SDK 核心规则
|
|
219
219
|
|
|
@@ -246,7 +246,7 @@ where 条件强制使用操作符:`$eq` `$ne` `$gte` `$lte` `$gt` `$lt` `$in`
|
|
|
246
246
|
|
|
247
247
|
### SQL 调用
|
|
248
248
|
|
|
249
|
-
页面和
|
|
249
|
+
页面和 Backend Function 通过已发布 Custom SQL 的 `sqlCode` + `params` 执行查询。
|
|
250
250
|
|
|
251
251
|
```typescript
|
|
252
252
|
const data = await client.sql.execute<MyRow>({
|
|
@@ -258,9 +258,9 @@ if (data.execSuccess && data.execResult) {
|
|
|
258
258
|
}
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
自定义页面需要图表时,在其 React JSX 实现中使用 ECharts 呈现;只读查询且平台 `sqlCode` 权限已经满足时可以直接调用上面已发布的 Custom SQL。需要基于当前用户、角色、数据范围或业务规则做额外控制时,页面改调
|
|
261
|
+
自定义页面需要图表时,在其 React JSX 实现中使用 ECharts 呈现;只读查询且平台 `sqlCode` 权限已经满足时可以直接调用上面已发布的 Custom SQL。需要基于当前用户、角色、数据范围或业务规则做额外控制时,页面改调 Backend Function,由 Backend Function 完成校验后再执行该 Custom SQL。执行失败时保留并报告原始错误,根据 SQL 资源状态、参数与权限定位问题。
|
|
262
262
|
|
|
263
|
-
###
|
|
263
|
+
### Backend Function 调用
|
|
264
264
|
|
|
265
265
|
```typescript
|
|
266
266
|
const result = await client.bff.execute<DashboardData>({
|
|
@@ -269,9 +269,9 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
269
269
|
});
|
|
270
270
|
```
|
|
271
271
|
|
|
272
|
-
### 前端 vs
|
|
272
|
+
### 前端 vs Backend Function 关键差异
|
|
273
273
|
|
|
274
|
-
| | 前端 SDK |
|
|
274
|
+
| | 前端 SDK | Backend Function (context.client) |
|
|
275
275
|
| --------------- | -------------------------------------------- | ------------------------------------ |
|
|
276
276
|
| SQL 返回值 | `{ execSuccess, execResult }` | 直接返回数组 `T[]` |
|
|
277
277
|
| 单条查询 | `getOne({ id })` | `getOne({ id })` |
|
|
@@ -279,7 +279,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
279
279
|
| `filter()` 返回 | `tableData` 为列表数据 | `tableData` 为列表数据,不是 `list` |
|
|
280
280
|
| `create()` 返回 | 以 SDK 文档/类型为准 | 新记录 ID,不是完整对象 |
|
|
281
281
|
| SDK 初始化能力 | `createClient` / `registerModels` | 不可用;`context.client` 由平台注入 |
|
|
282
|
-
| 调
|
|
282
|
+
| 调 Backend Function | `client.bff.execute({ scriptName, params })` | — |
|
|
283
283
|
|
|
284
284
|
## 意图 → 命令索引
|
|
285
285
|
|
|
@@ -305,7 +305,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
305
305
|
| 列出配置 | [`rabetbase config list`](references/rabetbase-config.md) | 查看当前生效的配置 |
|
|
306
306
|
| 管理运行态 app-config | [`rabetbase app-config list/get/set/delete`](references/rabetbase-app-config.md) | 运行态 app-config 管理面;默认不输出明文 value;`set` 为 `write`,`delete` 保持 `high-risk-write` |
|
|
307
307
|
| 管理和检索当前研发应用的企业知识库 | [`rabetbase kb list/detail/search/create/update/delete`](references/rabetbase-kb.md) | 管理仅 company scope;search 仅 COMPANY/PUBLIC;`create/update` 为 `write`,`delete` 保持 `high-risk-write` |
|
|
308
|
-
| 查询或管理应用级通知配置 | [`rabetbase notification config-list`](references/rabetbase-notification-config-list.md) / [`rabetbase notification config-create`](references/rabetbase-notification-config-mutations.md) / [`rabetbase notification config-update`](references/rabetbase-notification-config-mutations.md) / [`rabetbase notification config-delete`](references/rabetbase-notification-config-mutations.md) | list 获取
|
|
308
|
+
| 查询或管理应用级通知配置 | [`rabetbase notification config-list`](references/rabetbase-notification-config-list.md) / [`rabetbase notification config-create`](references/rabetbase-notification-config-mutations.md) / [`rabetbase notification config-update`](references/rabetbase-notification-config-mutations.md) / [`rabetbase notification config-delete`](references/rabetbase-notification-config-mutations.md) | list 获取 Backend Function 所需 `configCode`;写入只接收单一敏感 JSON 源,先 dry-run;update/delete 必须 `--yes` |
|
|
309
309
|
| 查看线上菜单事实 / 菜单异常审计 | [`rabetbase menu list`](references/rabetbase-menu-list.md) | 返回 DFS 事实、children/page、URL、最近更新人/时间和 snapshotHash;异常治理先读 [`menu-anomaly-manual-cleanup`](guides/menu-anomaly-manual-cleanup.md) |
|
|
310
310
|
| 批量显示或隐藏菜单 | [`rabetbase menu visibility-update`](references/rabetbase-menu-visibility-update.md) | 用精确 ID/path 选择目标;先 dry-run,使用 `--expect-visible` / `--expected-count` 防漂移,正式执行必须 `--yes` |
|
|
311
311
|
| 创建外部网站链接菜单 | [`rabetbase menu external-link-create`](references/rabetbase-menu-external-link-create.md) | `write`;显式选择 `embedded` 或 `new-window`,仅接受 HTTPS;建议先 dry-run,正式执行不要求 `--yes` |
|
|
@@ -364,13 +364,13 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
364
364
|
| 删除 SQL | [`rabetbase sql delete --sqlcode xxx --yes`](references/rabetbase-sql-delete.md) | 删除远端并将本地文件移入 `.rabetbase/sql-trash/` |
|
|
365
365
|
| 校验 SQL 内容 | [`rabetbase sql validate --file xxx`](references/rabetbase-sql-validate.md) | 类型检测、危险语句检查、参数提取 |
|
|
366
366
|
| 执行 SQL 查询 | [`rabetbase sql exec --sqlcode xxx`](references/rabetbase-sql-exec.md) | 支持 `--params` JSON 参数 |
|
|
367
|
-
| 查看现有
|
|
368
|
-
| 查看
|
|
369
|
-
| 创建本地
|
|
370
|
-
| 查看
|
|
371
|
-
| 拉取远端
|
|
372
|
-
| 推送本地
|
|
373
|
-
| 删除
|
|
367
|
+
| 查看现有 Backend Function | [`rabetbase bff list`](references/rabetbase-bff-list.md) | 按类型和名称过滤,支持 `--app` 限定应用 |
|
|
368
|
+
| 查看 Backend Function 详情 | [`rabetbase bff detail --id n`](references/rabetbase-bff-detail.md) | 含完整脚本内容 |
|
|
369
|
+
| 创建本地 Backend Function | [`rabetbase bff create --type ENDPOINT --name xxx`](references/rabetbase-bff-create.md) | 在 `.rabetbase/bff/<appCode>/...` 下创建脚手架 |
|
|
370
|
+
| 查看 Backend Function 本地状态 | [`rabetbase bff status`](references/rabetbase-bff-status.md) | 检查 added / modified / unchanged / remoteOnly |
|
|
371
|
+
| 拉取远端 Backend Function | [`rabetbase bff pull`](references/rabetbase-bff-pull.md) | 从远端同步到本地 |
|
|
372
|
+
| 推送本地 Backend Function | [`rabetbase bff push`](references/rabetbase-bff-push.md) | `write`;建议先 dry-run,正式执行不要求 `--yes` |
|
|
373
|
+
| 删除 Backend Function | [`rabetbase bff delete --yes --target xxx`](references/rabetbase-bff-delete.md) | high-risk-write,删远端并清理本地 |
|
|
374
374
|
| 生成 SDK 代码 | [`rabetbase codegen sdk --code xxx`](references/rabetbase-codegen-sdk.md) | 按操作生成 TypeScript |
|
|
375
375
|
| 生成 SQL 调用代码 | [`rabetbase codegen sql --sqlcode xxx`](references/rabetbase-codegen-sql.md) | sdk/bff 两种 target |
|
|
376
376
|
| 列出已配置应用 | [`rabetbase app list`](references/rabetbase-app-list.md) | 默认合并视图;`--global` / `--project` 限定单层;`items[].named`、`meta` 见 reference |
|
|
@@ -489,11 +489,11 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
489
489
|
| SQL MyBatis 与动态 SQL | 写自定义 SQL、`<if>`/`<foreach>`、参数绑定 | [`sql-mybatis.md`](guides/sql-mybatis.md) |
|
|
490
490
|
| 前端页面开发约束 | React 页、表单、列表、与数据集绑定 | [`frontend-development.md`](guides/frontend-development.md) |
|
|
491
491
|
| 故障诊断 | CLI/登录/数据集/保存失败排障 | [`troubleshooting.md`](guides/troubleshooting.md) |
|
|
492
|
-
|
|
|
492
|
+
| Backend Function 脚本规范 | HOOK/ENDPOINT/COMMON、`context.client`、消息通知扩展、目录与注释模板 | [`backend-function.md`](guides/backend-function.md) |
|
|
493
493
|
| 数据接口访问 | 先 detail 再编码、外键/枚举、禁止 N+1、批量与关联查询;可选 `lovrabet data` 查数(**`lovrabet` CLI ≥ 2.0** 且已安装) | [`data-api-guidelines.md`](guides/data-api-guidelines.md) |
|
|
494
494
|
| SQL 创建工作流 | list/detail → pull/create → edit → validate → status → push/delete → exec 全链路 | [`sql-creation-workflow.md`](guides/sql-creation-workflow.md) |
|
|
495
|
-
|
|
|
495
|
+
| Backend Function 创建工作流 | new → status → dry-run → pull/push | [`bff-creation-workflow.md`](guides/bff-creation-workflow.md) |
|
|
496
496
|
| 冲突检测与保存 | `blocked`、未保存时的用户沟通、响应结构 | [`conflict-detection.md`](guides/conflict-detection.md) |
|
|
497
|
-
| 质量与最佳实践 | 审查 SQL/
|
|
497
|
+
| 质量与最佳实践 | 审查 SQL/Backend Function、命名、高危边界、描述字段 | [`best-practices.md`](guides/best-practices.md) |
|
|
498
498
|
| 数据库连接与分析 | 接入/改连/测连、`traceId` 来源、`db analyze-*` 与 dataset 分工;子命令速查见上文 **「数据库连接(db)」** | [`database-connection-workflow.md`](guides/database-connection-workflow.md) |
|
|
499
499
|
| 菜单异常审计与安全修复 | 重复 path、根级菜单重名、空 folder 删除计划和平台处理后回查 | [`menu-anomaly-manual-cleanup.md`](guides/menu-anomaly-manual-cleanup.md) |
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|------|------|
|
|
11
11
|
| CLI 信封、`datasetId`、`dbtableConfig` ↔ `data.dbtable`、OpenAPI 对照 | [`references/rabetbase-dataset-detail.md`](../references/rabetbase-dataset-detail.md) |
|
|
12
12
|
| 前后端数据访问、外键、性能 | [`data-api-guidelines.md`](data-api-guidelines.md) |
|
|
13
|
-
| 在
|
|
13
|
+
| 在 Backend Function 中发送应用级消息通知 | 下文“消息通知扩展” |
|
|
14
14
|
| HOOK/ENDPOINT 目录、注释模板、`context.client`、事务 | 下文 |
|
|
15
15
|
|
|
16
16
|
## 何时使用
|
|
@@ -19,22 +19,22 @@
|
|
|
19
19
|
|
|
20
20
|
* 编写 HOOK 脚本
|
|
21
21
|
* 编写 ENDPOINT 脚本
|
|
22
|
-
* 在
|
|
23
|
-
* 在
|
|
24
|
-
* 在
|
|
25
|
-
* 在
|
|
22
|
+
* 在 Backend Function 中调用数据集 API
|
|
23
|
+
* 在 Backend Function 中调用自定义 SQL
|
|
24
|
+
* 在 Backend Function 中调用应用级消息通知
|
|
25
|
+
* 在 Backend Function 中处理事务、权限、脱敏、聚合或多表逻辑
|
|
26
26
|
|
|
27
27
|
## 核心原则
|
|
28
28
|
|
|
29
29
|
* 先校验数据集和字段,再写脚本
|
|
30
30
|
* 所有脚本统一使用 `export default async function`
|
|
31
31
|
* 前后端单条查询统一使用 `getOne({ id })`
|
|
32
|
-
*
|
|
32
|
+
* Backend Function 中的 SQL 返回值与前端 SDK 不同,不能混用
|
|
33
33
|
* 消息通知只引用当前应用中存在且未删除的 `configCode`,不接收 `appCode`、渠道地址或密钥
|
|
34
34
|
* 平台自动维护字段不得手动设置
|
|
35
35
|
* 发现明显性能问题时,必须先改写再继续
|
|
36
|
-
* 新建与长期维护的
|
|
37
|
-
*
|
|
36
|
+
* 新建与长期维护的 Backend Function 源文件**仅**在 **`.rabetbase/bff/<appCode>/...`**(`bff create` / `bff pull` 与 `bff status` 扫描范围);不要写在 `src/` 等目录,详见 [`bff-creation-workflow.md`](bff-creation-workflow.md)
|
|
37
|
+
* Backend Function 脚本只写**纯 JavaScript(ESM)**,支持到 **ES2023** 特性,不支持 TypeScript
|
|
38
38
|
|
|
39
39
|
## 脚本类型
|
|
40
40
|
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
|------|------|----------------|----------|
|
|
43
43
|
| HOOK | 挂在标准数据接口前后执行 | Before / After | 通过数据集详情 |
|
|
44
44
|
| ENDPOINT | 独立业务端点 | `POST /api/endpoint/{appCode}/{scriptName}` | `rabetbase bff list --format json`(默认) |
|
|
45
|
-
| COMMON | 公共函数,供其他脚本 import 复用 | 被其他
|
|
45
|
+
| COMMON | 公共函数,供其他脚本 import 复用 | 被其他 Backend Function 引用 | `rabetbase bff list --format json`(type=COMMON) |
|
|
46
46
|
|
|
47
|
-
写
|
|
47
|
+
写 Backend Function 前,先查一下公共函数列表(`rabetbase bff list --format json`),看是否有可复用的工具函数。
|
|
48
48
|
|
|
49
49
|
## 平台配置地址
|
|
50
50
|
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
## 本地目录约定
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
Backend Function 脚本统一存放在 `.rabetbase/bff/<appCode>/` 目录下,由 CLI 同步体系管理:
|
|
63
63
|
|
|
64
64
|
```text
|
|
65
65
|
.rabetbase/bff/<appCode>/
|
|
@@ -110,7 +110,7 @@ HOOK 的第一层子目录名(标识数据集)按以下优先级确定:
|
|
|
110
110
|
|
|
111
111
|
使用 `aggregate` 时,聚合列名写在 `aggregate[].column`;`field` 只是历史兼容别名,新脚本不要使用。
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
Backend Function HOOK 可以挂在 `DB_TABLE` 或 `METADATA` 数据集上;是否可挂某个 operation,以平台返回的 operation types 为准。
|
|
114
114
|
|
|
115
115
|
### METADATA HOOK 脚本内部限制
|
|
116
116
|
|
|
@@ -142,7 +142,7 @@ METADATA 数据集没有 DB_TABLE 数据源上下文,脚本中优先使用标
|
|
|
142
142
|
|
|
143
143
|
### Step 2:校验数据集、字段与关系
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
Backend Function 涉及数据集读写时,必须执行 `rabetbase dataset detail --code xxx --format json`(或 `--format compress`),必要时先用 `rabetbase dataset list --format json` 定位数据集。纯消息通知 ENDPOINT 不需要为满足流程而虚构 `datasetCode`,但必须先确认当前应用、通知 `configCode`、接收对象和消息内容契约。
|
|
146
146
|
|
|
147
147
|
必须确认:
|
|
148
148
|
|
|
@@ -163,7 +163,7 @@ rabetbase dataset detail --code <datasetCode> --format compress \
|
|
|
163
163
|
|
|
164
164
|
* 未读取数据集详情就直接写字段名
|
|
165
165
|
* 凭经验猜 `user_id`、`status`、`deleted` 等通用字段
|
|
166
|
-
* 把前端代码里的字段名照搬到当前
|
|
166
|
+
* 把前端代码里的字段名照搬到当前 Backend Function
|
|
167
167
|
* 把某个 Demo 或历史案例中的字段、枚举、表名当作当前任务的通用规则
|
|
168
168
|
|
|
169
169
|
### Step 3:选择脚本类型
|
|
@@ -192,7 +192,7 @@ rabetbase dataset detail --code <datasetCode> --format compress \
|
|
|
192
192
|
* 修改时直接编辑 `.rabetbase/bff/<appCode>/...`
|
|
193
193
|
* 需要远端最新内容时先 `rabetbase bff pull`
|
|
194
194
|
|
|
195
|
-
如果
|
|
195
|
+
如果 Backend Function 行为与预期不符,或 `push` 显示 `unchanged` 但效果没变,先确认远端实际运行的是哪份代码:
|
|
196
196
|
|
|
197
197
|
* `rabetbase bff detail --id <id> --format json`
|
|
198
198
|
* 必要时再 `rabetbase bff pull --format json` 同步远端到本地
|
|
@@ -206,7 +206,7 @@ rabetbase dataset detail --code <datasetCode> --format compress \
|
|
|
206
206
|
* 函数名匹配(用于 `scriptName` 参数)
|
|
207
207
|
* 顶部注释占位符已替换
|
|
208
208
|
* 单条查询是否统一使用 `getOne({ id })`
|
|
209
|
-
* SQL 返回值是否按
|
|
209
|
+
* SQL 返回值是否按 Backend Function 语义处理
|
|
210
210
|
* 是否误设置系统字段
|
|
211
211
|
* 是否存在明显性能问题
|
|
212
212
|
|
|
@@ -244,7 +244,7 @@ rabetbase dataset detail --code <datasetCode> --format compress \
|
|
|
244
244
|
* 依赖数据集、调用 BF、执行 SQL 和副作用
|
|
245
245
|
* 显式抛出异常时的异常类型与触发条件
|
|
246
246
|
|
|
247
|
-
字段级参数使用标准 JSDoc `@param` 标签,写清类型、含义、必填性和默认值。没有字段级参数时只保留根 `params` 标签,不要虚构字段。代码出现显式 `throw` 时必须补充 `@throws`;依赖维护项必须与实际代码同步,便于发布后提取为
|
|
247
|
+
字段级参数使用标准 JSDoc `@param` 标签,写清类型、含义、必填性和默认值。没有字段级参数时只保留根 `params` 标签,不要虚构字段。代码出现显式 `throw` 时必须补充 `@throws`;依赖维护项必须与实际代码同步,便于发布后提取为 Backend Function 元数据。
|
|
248
248
|
|
|
249
249
|
占位符必须替换为真实值,不能保留:
|
|
250
250
|
|
|
@@ -395,7 +395,7 @@ await models[TABLES.primary].update({
|
|
|
395
395
|
|
|
396
396
|
### aggregate 调用与选型
|
|
397
397
|
|
|
398
|
-
`` context.client.models[`dataset_${datasetCode}`].aggregate(params) `` 是
|
|
398
|
+
`` context.client.models[`dataset_${datasetCode}`].aggregate(params) `` 是 Backend Function 的数据集 Instant API。实际脚本仍按上文的数据集映射,通过 `models[TABLES.xxx]` 访问;示例字段只用于展示参数契约,编写业务脚本前必须用 `dataset detail` 替换为真实字段:
|
|
399
399
|
|
|
400
400
|
```javascript
|
|
401
401
|
const aggregateResult = await models[TABLES.primary].aggregate({
|
|
@@ -550,7 +550,7 @@ export default async function afterFilter(params) {
|
|
|
550
550
|
|
|
551
551
|
公共函数建议统一加 `common` 前缀(如 `commonGetUserInfo`),便于与普通 ENDPOINT 区分,也方便人和 AI 识别。
|
|
552
552
|
|
|
553
|
-
### 在其他
|
|
553
|
+
### 在其他 Backend Function 中调用公共函数
|
|
554
554
|
|
|
555
555
|
通过 `context.client.bff.execute` 调用:
|
|
556
556
|
|
|
@@ -597,9 +597,9 @@ export default async function runBusinessFlow(params, context) {
|
|
|
597
597
|
|
|
598
598
|
## SQL 调用规则
|
|
599
599
|
|
|
600
|
-
|
|
600
|
+
Backend Function 入参使用业务参数;需要执行 SQL 时,通过已发布 Custom SQL 的 `sqlCode` + `params` 调用。执行失败时保留并报告原始错误,根据 SQL 资源状态、参数与权限定位问题。
|
|
601
601
|
|
|
602
|
-
在
|
|
602
|
+
在 Backend Function 中使用:
|
|
603
603
|
|
|
604
604
|
```javascript
|
|
605
605
|
const rows = await context.client.sql.execute({
|
|
@@ -709,7 +709,7 @@ After HOOK 通知失败或超时时,原业务操作可能已经完成,通知
|
|
|
709
709
|
|
|
710
710
|
### 获取 configCode
|
|
711
711
|
|
|
712
|
-
创建或修改通知型
|
|
712
|
+
创建或修改通知型 Backend Function 前,先查询当前应用的应用级通知配置:
|
|
713
713
|
|
|
714
714
|
```bash
|
|
715
715
|
rabetbase notification config-list --type EMAIL --format compress
|
|
@@ -719,7 +719,7 @@ rabetbase notification config-list --type EMAIL --format compress
|
|
|
719
719
|
|
|
720
720
|
`configCode` 与 `channelCode` 不是同一概念:
|
|
721
721
|
|
|
722
|
-
* `configCode`:应用级通知渠道配置编码,供
|
|
722
|
+
* `configCode`:应用级通知渠道配置编码,供 Backend Function `notification.send` 使用
|
|
723
723
|
* `channelCode`:dataset 级通知通道编码,不是本扩展的入参
|
|
724
724
|
|
|
725
725
|
查询为空时说明当前应用没有该类型的可用配置;查询出多个候选且无法从名称和描述判断业务目标时,向用户确认,不得自动取第一条。
|
|
@@ -765,7 +765,7 @@ rabetbase notification config-list --type EMAIL --format compress
|
|
|
765
765
|
| `facts` | 否 | 最多 8 项,每项严格为 `{ label, value }`,两个字段都是非空字符串 |
|
|
766
766
|
| `actions` | 否 | 最多 2 项,每项严格为 `{ text, url }`,两个字段都是非空字符串 |
|
|
767
767
|
|
|
768
|
-
消息对象不允许额外字段,也不支持 `${...}` 模板表达式。运行时值应由
|
|
768
|
+
消息对象不允许额外字段,也不支持 `${...}` 模板表达式。运行时值应由 Backend Function 根据已校验的 `params` 直接组装,不要把模板语法交给通知扩展解析。
|
|
769
769
|
|
|
770
770
|
### 返回值与副作用
|
|
771
771
|
|
|
@@ -784,7 +784,7 @@ rabetbase notification config-list --type EMAIL --format compress
|
|
|
784
784
|
|
|
785
785
|
通知发送是外部可见副作用:
|
|
786
786
|
|
|
787
|
-
* 创建/推送脚本的 dry-run 不会发送通知;只有执行
|
|
787
|
+
* 创建/推送脚本的 dry-run 不会发送通知;只有执行 Backend Function 才会发送
|
|
788
788
|
* 运行 smoke 前必须向用户展示当前应用、函数名、`configCode`、接收对象和消息摘要并取得确认
|
|
789
789
|
* 面向多人调用的正式 ENDPOINT 必须在调用扩展前校验 `params` 的字段、类型和接收对象范围;固定业务通知优先在脚本内固定 `configCode` 和允许的接收范围,不要把任意渠道或任意收件人转发能力暴露给调用者
|
|
790
790
|
* 超时或客户端未拿到结果时,发送状态可能未知;不得自动重试,避免重复通知
|
|
@@ -821,7 +821,7 @@ await context.client.db.transaction(async (tx) => {
|
|
|
821
821
|
|
|
822
822
|
## 性能约束
|
|
823
823
|
|
|
824
|
-
编写
|
|
824
|
+
编写 Backend Function 前,必须阅读 `data-api-guidelines.md` 中的性能优化部分。
|
|
825
825
|
|
|
826
826
|
重点避免:
|
|
827
827
|
|
|
@@ -843,12 +843,12 @@ await context.client.db.transaction(async (tx) => {
|
|
|
843
843
|
* 不要手动设置系统字段
|
|
844
844
|
* 不要保留顶部注释占位符
|
|
845
845
|
* 不要让参数、返回值、依赖数据集、调用 BF、执行 SQL 或副作用说明与实际代码不一致
|
|
846
|
-
* 不要把前端 SQL 返回值语义套到
|
|
847
|
-
* 不要在
|
|
846
|
+
* 不要把前端 SQL 返回值语义套到 Backend Function
|
|
847
|
+
* 不要在 Backend Function 中使用前端 SDK 独有的方法,如 `createClient`、`registerModels`
|
|
848
848
|
* 不要把示例里的字段名、表名、枚举值复制到真实脚本;字段事实必须来自当前数据集详情
|
|
849
849
|
* 不要忽略权限、脱敏和错误处理
|
|
850
850
|
* 不要在事务里做高延迟外部调用
|
|
851
|
-
* 不要在未确认 `configCode`、接收对象和消息内容时执行通知型
|
|
851
|
+
* 不要在未确认 `configCode`、接收对象和消息内容时执行通知型 Backend Function
|
|
852
852
|
* 不要把通知执行超时当作“肯定未发送”并自动重试
|
|
853
853
|
|
|
854
854
|
## 自检清单
|
|
@@ -868,7 +868,7 @@ await context.client.db.transaction(async (tx) => {
|
|
|
868
868
|
* [ ] `batchCreate()` 直接接收非空对象数组,并按新记录 ID 数组处理返回值
|
|
869
869
|
* [ ] 批量更新使用 `update({ id: [...] })`,没有使用不存在的 `batchUpdate()` 或记录数组参数
|
|
870
870
|
* [ ] 枚举/选择字段写入 `options[].value`,不是展示 `label`
|
|
871
|
-
* [ ] SQL 返回值按
|
|
871
|
+
* [ ] SQL 返回值按 Backend Function 语义处理
|
|
872
872
|
* [ ] 未设置系统自动维护字段
|
|
873
873
|
* [ ] 无明显 N+1 或循环写入问题
|
|
874
874
|
* [ ] HOOK 返回 `params`,ENDPOINT 返回业务对象
|