@lovrabet/rabetbase-cli 2.4.2 → 2.4.3
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/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.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.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/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.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.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.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/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 +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase/guides/react-custom-page-workflow.md +9 -3
- package/skills/rabetbase/knowledge/react-page/generation-standards.md +13 -2
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a289_0x31e6(_0x1fa6d6,_0xd82114){_0x1fa6d6=_0x1fa6d6-0xca;const _0x3c5ee6=a289_0x3c5e();let _0x31e6e6=_0x3c5ee6[_0x1fa6d6];return _0x31e6e6;}const a289_0x7a7977=a289_0x31e6;(function(_0x133c64,_0x39a245){const _0x1e8e4f=a289_0x31e6,_0x3c2acc=_0x133c64();while(!![]){try{const _0x3c1ad0=parseInt(_0x1e8e4f(0xcc))/0x1+-parseInt(_0x1e8e4f(0xfa))/0x2*(parseInt(_0x1e8e4f(0xd4))/0x3)+parseInt(_0x1e8e4f(0xe2))/0x4*(parseInt(_0x1e8e4f(0xd3))/0x5)+parseInt(_0x1e8e4f(0xe3))/0x6*(parseInt(_0x1e8e4f(0xe4))/0x7)+-parseInt(_0x1e8e4f(0xe9))/0x8*(-parseInt(_0x1e8e4f(0xd2))/0x9)+parseInt(_0x1e8e4f(0xef))/0xa+-parseInt(_0x1e8e4f(0xcb))/0xb*(parseInt(_0x1e8e4f(0xda))/0xc);if(_0x3c1ad0===_0x39a245)break;else _0x3c2acc['push'](_0x3c2acc['shift']());}catch(_0x5013d2){_0x3c2acc['push'](_0x3c2acc['shift']());}}}(a289_0x3c5e,0xb66ff));import a289_0x153312 from'node:fs';import a289_0x3f225f from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';function a289_0x3c5e(){const _0x241203=['promises','processFile','utf8','.md','getDate','success','.tsx','tableName','\x0a\x20\x20\x20\x20{\x20','copyFile','alias','.ts','55JQvaLT','538983ldncbo','processTemplate','formatLocalTimestamp','name','pad','mkdir','63765qTOCMN','546270rLDpYt','22773cdndMN','template','processDirectory','push','now','tableName:\x20\x22','3131268CLUssM','toComponentName','alias:\x20\x22','toLowerCase','toISOString','.scss','LOVRABET','isFile','4JJwByu','42AUYjDt','1051708sSeQQL','endsWith','模板内容替换完成','toUpperCase','YourModel','464OsRKWR','.css','getMonth','slice','pop','join','13606000IHPIKN','开始处理模板内容替换','isDirectory','replaceApiContent','.json','split','message','default','.tpl','writeFile','map','374qwzYha','datasetCode','\x20},','charAt','datasetCode:\x20\x22','replaceContent','name:\x20\x22','padStart','getHours','readdir','replace'];a289_0x3c5e=function(){return _0x241203;};return a289_0x3c5e();}const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a289_0x7a7977(0xd0)](_0x428c5e){const _0x10b571=a289_0x7a7977;return String(_0x428c5e)[_0x10b571(0x101)](0x2,'0');}static[a289_0x7a7977(0xce)](_0x4e9cec){const _0x53ba48=a289_0x7a7977,_0xdf06e5=_0x4e9cec['getFullYear'](),_0x4ba97b=this['pad'](_0x4e9cec[_0x53ba48(0xeb)]()+0x1),_0x2ee30e=this[_0x53ba48(0xd0)](_0x4e9cec[_0x53ba48(0x109)]()),_0x12a865=this[_0x53ba48(0xd0)](_0x4e9cec[_0x53ba48(0x102)]()),_0x42da7e=this[_0x53ba48(0xd0)](_0x4e9cec['getMinutes']()),_0x2d6dfb=this[_0x53ba48(0xd0)](_0x4e9cec['getSeconds']());return{'createdAt':_0xdf06e5+'-'+_0x4ba97b+'-'+_0x2ee30e+'\x20'+_0x12a865+':'+_0x42da7e+':'+_0x2d6dfb,'createdDate':_0xdf06e5+'-'+_0x4ba97b+'-'+_0x2ee30e,'createdTime':_0x12a865+':'+_0x42da7e+':'+_0x2d6dfb};}static[a289_0x7a7977(0xdb)](_0x285d0d){const _0x1bd274=a289_0x7a7977,_0x30052d=_0x285d0d[_0x1bd274(0xf4)]('/')[_0x1bd274(0xed)]()||_0x285d0d;return _0x30052d[_0x1bd274(0xf4)]('-')[_0x1bd274(0xf9)](_0x326808=>_0x326808[_0x1bd274(0xfd)](0x0)[_0x1bd274(0xe7)]()+_0x326808[_0x1bd274(0xec)](0x1)[_0x1bd274(0xdd)]())[_0x1bd274(0xee)]('');}static['toDisplayTitle'](_0x51b26d){const _0x298763=a289_0x7a7977,_0x5edca6=_0x51b26d['split']('/')[_0x298763(0xed)]()||_0x51b26d;return _0x5edca6[_0x298763(0xf4)]('-')[_0x298763(0xf9)](_0x428e26=>_0x428e26['charAt'](0x0)[_0x298763(0xe7)]()+_0x428e26[_0x298763(0xec)](0x1)[_0x298763(0xdd)]())[_0x298763(0xee)]('\x20');}static['replaceContent'](_0x455d67,_0x54a1cc,_0x5d3833){const _0x16c4c2=a289_0x7a7977,_0x1514f3=this[_0x16c4c2(0xdb)](_0x54a1cc),_0x3914ea=this['toDisplayTitle'](_0x54a1cc),{createdAt:_0x11bd62,createdDate:_0x22a377,createdTime:_0x9daae2}=this[_0x16c4c2(0xce)](new Date());let _0x5d844c=_0x455d67[_0x16c4c2(0x104)](/\{CliVersion\}/g,CLI_VERSION)[_0x16c4c2(0x104)](/\{ComponentName\}/g,_0x1514f3)['replace'](/\{DisplayTitle\}/g,_0x3914ea)['replace'](/\{PageName\}/g,_0x54a1cc)[_0x16c4c2(0x104)](/\{TemplateName\}/g,_0x5d3833)[_0x16c4c2(0x104)](/\{CreatedAt\}/g,_0x11bd62)[_0x16c4c2(0x104)](/\{CreatedDate\}/g,_0x22a377)[_0x16c4c2(0x104)](/\{CreatedTime\}/g,_0x9daae2);return _0x5d844c;}static[a289_0x7a7977(0xf2)](_0x3db5ac,_0x42167c,_0x161762,_0x496e55,_0x413096,_0x327cb0,_0x5c59e3,_0x32b41f){const _0x38c8e1=a289_0x7a7977,_0x3a7eb3=new Date(),_0x246adf=_0x3a7eb3[_0x38c8e1(0xde)](),_0x25c085=_0x161762[_0x38c8e1(0xf9)](_0x90eabf=>{const _0x17f2ad=_0x38c8e1,_0x5bece4=[_0x17f2ad(0xfe)+_0x90eabf[_0x17f2ad(0xfb)]+'\x22',_0x17f2ad(0xd9)+_0x90eabf[_0x17f2ad(0x10c)]+'\x22',_0x17f2ad(0x100)+_0x90eabf[_0x17f2ad(0xcf)]+'\x22'];return _0x90eabf[_0x17f2ad(0x10f)]&&_0x5bece4[_0x17f2ad(0xd7)](_0x17f2ad(0xdc)+_0x90eabf[_0x17f2ad(0x10f)]+'\x22'),_0x17f2ad(0x10d)+_0x5bece4['join'](',\x20')+_0x17f2ad(0xfc);})['join'](''),_0x3614f4=_0x496e55||_0x161762[0x0]?.[_0x38c8e1(0x10f)]||_0x38c8e1(0xe8);let _0x2456fe=_0x3db5ac['replace'](/\{AppCode\}/g,_0x42167c)['replace'](/\{ModelConfigs\}/g,_0x25c085)[_0x38c8e1(0x104)](/\{ExampleModelName\}/g,_0x3614f4)[_0x38c8e1(0x104)](/\{ApiFileName\}/g,_0x413096||'api')[_0x38c8e1(0x104)](/\{ConfigName\}/g,_0x327cb0||_0x38c8e1(0xf6))[_0x38c8e1(0x104)](/\{ClientConfigParam\}/g,_0x5c59e3||'')[_0x38c8e1(0x104)](/\{VarPrefix\}/g,_0x32b41f||_0x38c8e1(0xe0))[_0x38c8e1(0x104)](/\{CreatedAt\}/g,_0x246adf);return _0x2456fe;}static async[a289_0x7a7977(0xcd)](_0xbd1faf,_0x1c9528,_0x597442,_0x554c7c,_0x4ed87d=!![]){const _0x13efc5=a289_0x7a7977,_0x1ac52a=Date['now']();try{_0x4ed87d&&logger['info'](_0x13efc5(0xd5),_0x13efc5(0xf0),{'templatePath':_0xbd1faf,'targetPath':_0x1c9528,'pageName':_0x597442,'templateName':_0x554c7c});await a289_0x153312[_0x13efc5(0x105)][_0x13efc5(0xd1)](_0x1c9528,{'recursive':!![]}),await this[_0x13efc5(0xd6)](_0xbd1faf,_0x1c9528,_0x597442,_0x554c7c);if(_0x4ed87d){const _0x5e602e=Date[_0x13efc5(0xd8)]()-_0x1ac52a;logger[_0x13efc5(0x10a)](_0x13efc5(0xd5),_0x13efc5(0xe6),_0x5e602e,{'pageName':_0x597442,'templateName':_0x554c7c});}}catch(_0x2c153e){if(_0x4ed87d){const _0x3b9a20=Date[_0x13efc5(0xd8)]()-_0x1ac52a;logger['error'](_0x13efc5(0xd5),'模板内容替换失败',{'templatePath':_0xbd1faf,'targetPath':_0x1c9528,'pageName':_0x597442,'templateName':_0x554c7c,'error':_0x2c153e instanceof Error?_0x2c153e[_0x13efc5(0xf5)]:String(_0x2c153e),'duration':_0x3b9a20});}throw _0x2c153e;}}static async[a289_0x7a7977(0xd6)](_0x3ff8eb,_0x55ead9,_0xc8ba24,_0x352464){const _0x43c55b=a289_0x7a7977,_0x4baf41=await a289_0x153312['promises'][_0x43c55b(0x103)](_0x3ff8eb,{'withFileTypes':!![]});for(const _0x3fc74d of _0x4baf41){const _0x5e0001=a289_0x3f225f[_0x43c55b(0xee)](_0x3ff8eb,_0x3fc74d[_0x43c55b(0xcf)]);let _0x4aaccb=a289_0x3f225f['join'](_0x55ead9,_0x3fc74d[_0x43c55b(0xcf)]);_0x3fc74d[_0x43c55b(0xcf)]['endsWith'](_0x43c55b(0xf7))&&(_0x4aaccb=a289_0x3f225f[_0x43c55b(0xee)](_0x55ead9,_0x3fc74d[_0x43c55b(0xcf)][_0x43c55b(0x104)](/\.tpl$/,'')));if(_0x3fc74d[_0x43c55b(0xf1)]())await a289_0x153312['promises']['mkdir'](_0x4aaccb,{'recursive':!![]}),await this[_0x43c55b(0xd6)](_0x5e0001,_0x4aaccb,_0xc8ba24,_0x352464);else _0x3fc74d[_0x43c55b(0xe1)]()&&await this[_0x43c55b(0x106)](_0x5e0001,_0x4aaccb,_0xc8ba24,_0x352464);}}static async[a289_0x7a7977(0x106)](_0x5dea29,_0x404f58,_0x10ca81,_0x52c9ad){const _0x7222ce=a289_0x7a7977,_0x58ef37=a289_0x3f225f['extname'](_0x5dea29)['toLowerCase']();_0x5dea29[_0x7222ce(0xe5)](_0x7222ce(0xf7))&&(_0x404f58=_0x404f58['replace'](/\.tpl$/,''));const _0x2d76d8=[_0x7222ce(0x10b),_0x7222ce(0xca),'.jsx','.js',_0x7222ce(0xf3),_0x7222ce(0x108),_0x7222ce(0xea),_0x7222ce(0xdf),_0x7222ce(0xf7)];if(_0x2d76d8['includes'](_0x58ef37)||_0x5dea29[_0x7222ce(0xe5)](_0x7222ce(0xf7))){const _0x2c2fc3=await a289_0x153312['promises']['readFile'](_0x5dea29,_0x7222ce(0x107)),_0x3aee9f=this[_0x7222ce(0xff)](_0x2c2fc3,_0x10ca81,_0x52c9ad);await a289_0x153312[_0x7222ce(0x105)][_0x7222ce(0xf8)](_0x404f58,_0x3aee9f,'utf8');}else await a289_0x153312[_0x7222ce(0x105)][_0x7222ce(0x10e)](_0x5dea29,_0x404f58);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54f5b0,_0x4332b7){const _0x517230=a290_0x4f66,_0x7f457=_0x54f5b0();while(!![]){try{const _0x1d3ffb=-parseInt(_0x517230(0x1d6))/0x1*(-parseInt(_0x517230(0x1d9))/0x2)+-parseInt(_0x517230(0x1d1))/0x3*(-parseInt(_0x517230(0x1da))/0x4)+parseInt(_0x517230(0x1dc))/0x5*(parseInt(_0x517230(0x1d8))/0x6)+-parseInt(_0x517230(0x1e0))/0x7*(parseInt(_0x517230(0x1ec))/0x8)+parseInt(_0x517230(0x1e2))/0x9*(-parseInt(_0x517230(0x1d2))/0xa)+-parseInt(_0x517230(0x1d4))/0xb*(parseInt(_0x517230(0x1dd))/0xc)+parseInt(_0x517230(0x1d3))/0xd;if(_0x1d3ffb===_0x4332b7)break;else _0x7f457['push'](_0x7f457['shift']());}catch(_0x47cded){_0x7f457['push'](_0x7f457['shift']());}}}(a290_0xa7e7,0x76640));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a290_0x554b3b from'semver';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';function a290_0x4f66(_0x391045,_0x14b383){_0x391045=_0x391045-0x1cc;const _0xa7e721=a290_0xa7e7();let _0x4f6624=_0xa7e721[_0x391045];return _0x4f6624;}function a290_0xa7e7(){const _0x45461a=['2PBiUSx','3692yxtrwg','object','712945dlZptb','12EfRANq','true','rabetbase-cli','7QcPRZE','trim','15174DEPQUx','valid','yes','now','/v/','checkedAt','parse','utf8','gte','lastNotifiedAt','6081832ohZBmt','toLowerCase','stableVersion','\x20available,\x20current\x20','https://www.npmjs.com/package/','stringify','number','lastNotifiedVersion','1731hfSHyd','4670OxAlFq','27348035BuDoSP','8862865ZSSaRe','\x20update','59379WxsHjD','latest','6BgMJmC'];a290_0xa7e7=function(){return _0x45461a;};return a290_0xa7e7();}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 _0x11616c=a290_0x4f66,_0x508200=process.env.RABETBASE_NO_UPDATE_NOTICE?.['trim']()[_0x11616c(0x1ed)]();return _0x508200==='1'||_0x508200===_0x11616c(0x1de)||_0x508200===_0x11616c(0x1e4);}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x43d93f=a290_0x4f66;return join(cacheRoot(),_0x43d93f(0x1df),'update-check.json');}async function readUpdateNoticeCache(){const _0x4f504d=a290_0x4f66;try{const _0x316644=await readFile(getUpdateNoticeCachePath(),_0x4f504d(0x1e9)),_0x1ae83f=JSON[_0x4f504d(0x1e8)](_0x316644);if(!_0x1ae83f||typeof _0x1ae83f!==_0x4f504d(0x1db))return{};return _0x1ae83f;}catch{return{};}}async function writeUpdateNoticeCache(_0x41b82e){const _0x5abe14=a290_0x4f66;try{const _0x3398a8=getUpdateNoticeCachePath();await mkdir(dirname(_0x3398a8),{'recursive':!![]}),await writeFile(_0x3398a8,JSON[_0x5abe14(0x1ce)](_0x41b82e,null,0x2)+'\x0a',_0x5abe14(0x1e9));}catch{}}function isFreshCheck(_0x1184dd,_0x4c58f5){const _0x141816=a290_0x4f66;return typeof _0x1184dd['checkedAt']===_0x141816(0x1cf)&&_0x4c58f5-_0x1184dd[_0x141816(0x1e7)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x53a1ea,_0x4788f5,_0x241203){const _0x276a1b=a290_0x4f66;return _0x53a1ea[_0x276a1b(0x1d0)]===_0x4788f5&&typeof _0x53a1ea[_0x276a1b(0x1eb)]==='number'&&_0x241203-_0x53a1ea[_0x276a1b(0x1eb)]<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0xb79769){const _0xb56d00=a290_0x4f66;return _0xb56d00(0x1cd)+NPM_PACKAGE_NAME+_0xb56d00(0x1e6)+_0xb79769;}export async function resolveLatestUpdateNotice(){const _0x57f78d=a290_0x4f66;if(isUpdateNoticeDisabled())return null;try{const _0x50191e=Date[_0x57f78d(0x1e5)](),_0x34eeee=getCliVersion(),_0x59cf4f=await readUpdateNoticeCache();let _0x5efe0f=isFreshCheck(_0x59cf4f,_0x50191e)?_0x59cf4f[_0x57f78d(0x1d7)]?.[_0x57f78d(0x1e1)]():undefined;if(!_0x5efe0f&&!isFreshCheck(_0x59cf4f,_0x50191e)){const _0x10a3ec=await getCliVersionPolicy();_0x5efe0f=_0x10a3ec?.[_0x57f78d(0x1ee)]?.['trim']()||undefined,await writeUpdateNoticeCache({..._0x59cf4f,'checkedAt':_0x50191e,'latest':_0x5efe0f,'failed':!_0x5efe0f});}if(!_0x5efe0f||!a290_0x554b3b[_0x57f78d(0x1e3)](_0x34eeee)||!a290_0x554b3b[_0x57f78d(0x1e3)](_0x5efe0f))return null;if(a290_0x554b3b[_0x57f78d(0x1ea)](_0x34eeee,_0x5efe0f))return null;if(isRecentlyNotified(_0x59cf4f,_0x5efe0f,_0x50191e))return null;const _0x531271=CLI_BIN_NAME+_0x57f78d(0x1d5);return await writeUpdateNoticeCache({..._0x59cf4f,'checkedAt':isFreshCheck(_0x59cf4f,_0x50191e)?_0x59cf4f[_0x57f78d(0x1e7)]:_0x50191e,'latest':_0x5efe0f,'failed':![],'lastNotifiedVersion':_0x5efe0f,'lastNotifiedAt':_0x50191e}),{'command':_0x531271,'current':_0x34eeee,'latest':_0x5efe0f,'url':buildNpmVersionUrl(_0x5efe0f),'message':CLI_BIN_NAME+'\x20'+_0x5efe0f+_0x57f78d(0x1cc)+_0x34eeee+',\x20run:\x20'+_0x531271};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a291_0x53e6(){var _0xca74af=['1041754pCtzlb','17526303RoKwEo','1122848lgNPuJ','7305bGXYDl','18QDfAhY','22153SxtzFQ','1959192SciYmS','1765440SiERag','556aRXToM'];a291_0x53e6=function(){return _0xca74af;};return a291_0x53e6();}(function(_0xdb1169,_0xb9f58a){var _0x447929=a291_0x17f1,_0x5bc1e7=_0xdb1169();while(!![]){try{var _0x5695af=parseInt(_0x447929(0xb5))/0x1*(-parseInt(_0x447929(0xb4))/0x2)+-parseInt(_0x447929(0xb7))/0x3+parseInt(_0x447929(0xb8))/0x4*(-parseInt(_0x447929(0xb3))/0x5)+-parseInt(_0x447929(0xb6))/0x6+-parseInt(_0x447929(0xb9))/0x7+-parseInt(_0x447929(0xb2))/0x8+parseInt(_0x447929(0xb1))/0x9;if(_0x5695af===_0xb9f58a)break;else _0x5bc1e7['push'](_0x5bc1e7['shift']());}catch(_0x434d50){_0x5bc1e7['push'](_0x5bc1e7['shift']());}}}(a291_0x53e6,0x532f1));function a291_0x17f1(_0x2748d1,_0xd6c18f){_0x2748d1=_0x2748d1-0xb1;var _0x53e61c=a291_0x53e6();var _0x17f12a=_0x53e61c[_0x2748d1];return _0x17f12a;}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34037,_0x39adc8){var _0x2aba10=a292_0x5b51,_0x18f0c0=_0x34037();while(!![]){try{var _0x14f89e=-parseInt(_0x2aba10(0x105))/0x1*(parseInt(_0x2aba10(0x108))/0x2)+-parseInt(_0x2aba10(0x104))/0x3*(-parseInt(_0x2aba10(0x106))/0x4)+-parseInt(_0x2aba10(0x109))/0x5*(-parseInt(_0x2aba10(0x10b))/0x6)+-parseInt(_0x2aba10(0x10a))/0x7*(-parseInt(_0x2aba10(0x107))/0x8)+parseInt(_0x2aba10(0xff))/0x9*(-parseInt(_0x2aba10(0x100))/0xa)+-parseInt(_0x2aba10(0x102))/0xb+-parseInt(_0x2aba10(0x101))/0xc*(-parseInt(_0x2aba10(0x103))/0xd);if(_0x14f89e===_0x39adc8)break;else _0x18f0c0['push'](_0x18f0c0['shift']());}catch(_0x4bdb36){_0x18f0c0['push'](_0x18f0c0['shift']());}}}(a292_0x3d8a,0x36b15));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a292_0x5b51(_0x1a36b7,_0xa4038c){_0x1a36b7=_0x1a36b7-0xff;var _0x3d8a07=a292_0x3d8a();var _0x5b5111=_0x3d8a07[_0x1a36b7];return _0x5b5111;}function a292_0x3d8a(){var _0x1ee5ef=['369yamOsH','1WyUpzi','6848QCdiLd','386200omNFQz','725446jhOXZI','762145ygcmlv','28BRWifM','12kcYqyK','31905GvfrzV','960wTvQmy','7784844Ohxfcm','4732277wuFfuo','13bOEXMT'];a292_0x3d8a=function(){return _0x1ee5ef;};return a292_0x3d8a();}export async function withActiveCookie(_0x52613c,_0x3e5551){setActiveCookie(_0x52613c);try{return await _0x3e5551();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a293_0x3105(_0x29f4b7,_0x552f7a){_0x29f4b7=_0x29f4b7-0x149;var _0x15b70b=a293_0x15b7();var _0x3105c7=_0x15b70b[_0x29f4b7];return _0x3105c7;}(function(_0x5b58fd,_0x10d06b){var _0x45c9dd=a293_0x3105,_0x4d4e2b=_0x5b58fd();while(!![]){try{var _0x4784d2=parseInt(_0x45c9dd(0x153))/0x1+-parseInt(_0x45c9dd(0x14f))/0x2*(-parseInt(_0x45c9dd(0x154))/0x3)+parseInt(_0x45c9dd(0x152))/0x4+parseInt(_0x45c9dd(0x155))/0x5+-parseInt(_0x45c9dd(0x14a))/0x6*(-parseInt(_0x45c9dd(0x150))/0x7)+parseInt(_0x45c9dd(0x14c))/0x8*(parseInt(_0x45c9dd(0x14d))/0x9)+-parseInt(_0x45c9dd(0x14e))/0xa*(parseInt(_0x45c9dd(0x151))/0xb);if(_0x4784d2===_0x10d06b)break;else _0x4d4e2b['push'](_0x4d4e2b['shift']());}catch(_0x2b9491){_0x4d4e2b['push'](_0x4d4e2b['shift']());}}}(a293_0x15b7,0x89a82));export function writeCliSideChannelLine(_0x49f44a){var _0x5c8aa9=a293_0x3105;process[_0x5c8aa9(0x14b)][_0x5c8aa9(0x149)](_0x49f44a+'\x0a');}function a293_0x15b7(){var _0x245d5e=['63GcDAeE','8575390vMCrpx','148NVfcSx','577199oYitML','22aRsTTx','3477252fqxLnw','333670RyiQEn','9117BjYQAL','905445VblMPb','write','30luiyXb','stderr','294488oUimvK'];a293_0x15b7=function(){return _0x245d5e;};return a293_0x15b7();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.3",
|
|
4
4
|
"description": "Developer CLI for Lovrabet apps, datasets, pages, SQL, BFF, database connections, skills, and AI agent workflows.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"keywords": [
|
|
@@ -39,14 +39,17 @@
|
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"prebuild": "node scripts/generate-build-info.js && node scripts/generate-builtin-skill-manifest.mjs --check",
|
|
42
|
-
"build": "
|
|
42
|
+
"build": "node scripts/clean-build-output.mjs && tsc && tsc-alias && javascript-obfuscator lib --output lib",
|
|
43
43
|
"prebuild:dev": "node scripts/generate-build-info.js",
|
|
44
|
-
"build:dev": "
|
|
44
|
+
"build:dev": "node scripts/clean-build-output.mjs && tsc && tsc-alias",
|
|
45
45
|
"start": "tsc --watch",
|
|
46
46
|
"sync-template": "node scripts/sync-template.js",
|
|
47
47
|
"sync:cdn": "node scripts/sync-cdn-assets.js",
|
|
48
48
|
"verify:bundled-jq": "node scripts/verify-bundled-jq.mjs",
|
|
49
|
-
"regression:
|
|
49
|
+
"regression:release-smoke": "node scripts/regression-release-smoke.mjs",
|
|
50
|
+
"deploy:verify": "node scripts/deploy-verify.mjs",
|
|
51
|
+
"pack:dry-run-summary": "node scripts/package-dry-run-summary.mjs",
|
|
52
|
+
"verify:release-package": "node scripts/verify-release-package.mjs",
|
|
50
53
|
"beta-release": "node scripts/beta-release.mjs",
|
|
51
54
|
"release": "node scripts/latest-release.mjs",
|
|
52
55
|
"test": "vitest run",
|
|
@@ -69,6 +72,7 @@
|
|
|
69
72
|
"postinstall": "node scripts/postinstall.mjs",
|
|
70
73
|
"lint": "echo 'No linter configured yet'",
|
|
71
74
|
"check:skill-version": "node scripts/check-skill-version.mjs",
|
|
75
|
+
"check:lockfile": "node scripts/check-lockfile-integrity.mjs",
|
|
72
76
|
"ci": "npm run typecheck && npm run check:skill-version && npm run test:run && npm run build"
|
|
73
77
|
},
|
|
74
78
|
"publishConfig": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rabetbase
|
|
3
|
-
version: 2.4.
|
|
3
|
+
version: 2.4.3
|
|
4
4
|
description: "Lovrabet 开发工作流 CLI — 通过 rabetbase 命令管理数据集、数据库连接(dblink)、智能列表页(Smart List Page)、React 自定义页面(JSX 页面)、SQL 查询、BFF 脚本、通知配置、菜单事实读取与同步、应用文件、OCR 识别、代码生成,以及平台问题上报。触发词:数据集、数据表、dataset relation-audit、dataset delete、dataset restore、废弃数据集、恢复数据集、dataset rename、dataset field-update、dataset extend-update、dataset business-group-update、businessGroup、字段对象更新、doType、options、智能列表页、Smart List Page、React 自定义页面、JSX 页面、page react-create、page react-list、page react-detail、page react-update、page react-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 test、db tables、db diff、db diff --table、db analyze-batch-plan、db analyze-start、analyze-cancel、analyze-status、traceId、自定义 SQL、sql.execute、bff.execute、BF 消息通知、BFF 消息通知、Backend Function 消息通知、notification config-list、EMAIL configCode、通知配置、notification.send、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 external-link-create、menu external-link-update、menu rename、菜单改名、外链菜单创建、外链 URL 更新、菜单异常审计、菜单手动删除清单、menu sync、menu asset-update、菜单资源更新、menu move、菜单移动、角色、用户组、权限、role、permit、role list、role create、role user-add、role user-remove、user-resolve、销售组、加入开发者、page-set、page-get、row-roles、SELF、ALL、行级权限、role-menus-set、role-apis-set、菜单权限、API 权限、DEV、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:
|
|
@@ -96,9 +96,15 @@ page react-create
|
|
|
96
96
|
|
|
97
97
|
### 选型
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
根据页面的实际业务需求选择数据访问方式,不要为了简单查询引入 SQL 或 BFF:
|
|
100
|
+
|
|
101
|
+
| 方式 | 适用场景 | 边界 |
|
|
102
|
+
| --- | --- | --- |
|
|
103
|
+
| 单一数据集请求 | 只涉及一个数据集的查询、详情、分页、筛选、创建、更新或删除 | 严格按照当前数据集 API-doc 返回的调用说明实现,不得自行推测或自由发挥调用标识、方法、字段、参数、返回值或异常处理 |
|
|
104
|
+
| 自定义 SQL | 需要组合多个数据集,或需要数据库完成关联、聚合、分组、排序、计算和复杂筛选 | 先确认 SQL 资源、参数和执行结果,再按 `@lovrabet/sdk` 规范调用;不要在页面中拼接 SQL,也不要把 CLI 的 `data.rows` 当作运行时返回结构 |
|
|
105
|
+
| BFF | 需要注入业务校验、数据转换、加密、条件分支、多步业务编排或外部服务调用 | 将业务逻辑放入已确认的 BFF,由页面通过 SDK 调用;简单数据集请求或单纯数据关联不应额外包装成 BFF |
|
|
106
|
+
|
|
107
|
+
判断顺序:先确认单一数据集请求能否满足需求;数据组合和数据库计算是主要问题时选择自定义 SQL;业务规则、数据处理流程或外部服务协同是主要问题时选择 BFF。三种方式可以根据已确认的 SDK 契约配合使用,但不得自行推测方法、参数或返回结构。
|
|
102
108
|
|
|
103
109
|
页面需要读取或写入数据集时,先按以下顺序确认事实:
|
|
104
110
|
|
|
@@ -88,10 +88,20 @@ export default App;
|
|
|
88
88
|
### 数据与交互
|
|
89
89
|
|
|
90
90
|
- 在调用 `client` 前按“数据客户端文档”拉取目标数据集的 SDK 契约
|
|
91
|
-
-
|
|
91
|
+
- 根据业务需求选择数据访问方式,不要为了简单查询引入 SQL 或 BFF
|
|
92
92
|
- 明确加载中、空结果、失败和成功后的页面行为
|
|
93
93
|
- 写操作前明确校验、确认、提交中和失败恢复策略
|
|
94
94
|
|
|
95
|
+
#### 数据访问方式选型
|
|
96
|
+
|
|
97
|
+
| 方式 | 优先考虑的场景 | 使用边界 |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| 单一数据集请求 | 只涉及一个数据集的列表查询、详情读取、分页、筛选、创建、更新或删除,且业务逻辑主要由数据集模型能力完成 | 优先使用 API-doc 中确认过的 `client.models` 方法;不要为简单的数据集操作改用 SQL 或 BFF,也不要猜测未在 API-doc 中出现的字段和参数 |
|
|
100
|
+
| 自定义 SQL | 需要一次查询组合多个数据集,或需要数据库完成明确的关联、聚合、分组、排序、计算和复杂筛选 | 先确认 SQL 资源、参数和实际返回结构,再按 SDK 规范调用;不要在页面中拼接 SQL、把 SQL 当作通用业务逻辑容器,或据 CLI 的 `data.rows` 推断运行时返回值 |
|
|
101
|
+
| BFF | 需要在数据操作生命周期中注入业务校验、转换、加密、条件分支、多步编排,或需要调用外部服务 | 将这类业务逻辑放在已确认的 BFF 中,由页面通过 SDK 调用;不要用 BFF 包装本可直接完成的简单 CRUD,也不要在页面中实现应由 BFF 负责的敏感逻辑 |
|
|
102
|
+
|
|
103
|
+
选择顺序:先判断单一数据集请求是否能直接满足需求;仅在数据组合或数据库计算是主要问题时使用自定义 SQL;当核心问题是业务规则、数据处理流程或外部服务协同时使用 BFF。三种方式的具体方法、参数、返回值和异常形态,均以当前资源事实和 `@lovrabet/sdk` 使用规范为准。
|
|
104
|
+
|
|
95
105
|
### 国际化与样式
|
|
96
106
|
|
|
97
107
|
- 先定义词条,再在组件中使用词条 key
|
|
@@ -149,7 +159,7 @@ const client = useSdkClient();
|
|
|
149
159
|
|
|
150
160
|
`client` 是运行时注入的 SDK 客户端实例,语义上与 `@lovrabet/sdk` 生成的 `createClient()` 返回对象一致,支持当前页面可用的全部 `@lovrabet/sdk` 能力。
|
|
151
161
|
|
|
152
|
-
- 数据集模型调用(如 `models.<dataset
|
|
162
|
+
- 数据集模型调用(如 `models.<dataset>`)的调用标识、方法、参数、返回值和异常形态,严格以当前数据集的 API-doc 返回文档为准,不得自行推测或自由发挥
|
|
153
163
|
- SQL、BFF 及其他非数据集能力的可用方法、参数、返回值和异常形态,均以 `@lovrabet/sdk` 的使用规范为准
|
|
154
164
|
- 页面调用 SQL 前,先用 `rabetbase sql list` 与 `rabetbase sql detail --sqlcode <sqlCode>` 确认目标资源
|
|
155
165
|
- 生成使用自定义 SQL 的页面代码前,使用代表性参数执行 `rabetbase sql exec --sqlcode <sqlCode> --params <json> --format json`。若返回 `data.error`,先解决执行错误;成功后再根据 `data.rows` 与 `data.rowCount` 确认实际数据结构
|
|
@@ -377,6 +387,7 @@ const location = useLocation();
|
|
|
377
387
|
- [ ] 每个本地相对导入均指向提交内容中的文件,导入名称与该文件的导出名称一致
|
|
378
388
|
- [ ] 每个非全局标识符均由 import、组件参数、Hook 返回值或同一作用域内声明提供,不保留未定义引用
|
|
379
389
|
- [ ] 用户可见文案均有有效词条和翻译
|
|
390
|
+
- [ ] 每个数据集调用的调用标识、方法、参数、返回值和异常处理均严格遵循当前 API-doc 返回文档,未自行推测或自由发挥
|
|
380
391
|
- [ ] 数据集、SQL、BFF 与其他 SDK 调用的资源事实、参数和返回结构均有依据
|
|
381
392
|
- [ ] 路由、状态和错误反馈符合已确认的交互
|
|
382
393
|
- [ ] CSS 未写死颜色或其他样式常量
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "rabetbase",
|
|
4
4
|
"packageName": "@lovrabet/rabetbase-cli",
|
|
5
|
-
"packageVersion": "2.4.
|
|
6
|
-
"skillVersion": "2.4.
|
|
5
|
+
"packageVersion": "2.4.3",
|
|
6
|
+
"skillVersion": "2.4.3",
|
|
7
7
|
"files": [
|
|
8
8
|
"SKILL.md",
|
|
9
9
|
"guides/backend-function.md",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"references/rabetbase-user-account.md",
|
|
134
134
|
"references/rabetbase-workspace.md"
|
|
135
135
|
],
|
|
136
|
-
"digest": "
|
|
136
|
+
"digest": "9e57a32f5a9e30bb30673391d04d0c4edee23256e99dea09385a44c6ebb6edd6"
|
|
137
137
|
}
|