@lovrabet/rabetbase-cli 2.5.1-beta.4 → 2.5.1-beta.6
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 +75 -1
- 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/api/generate-sdk-config-file.d.ts +0 -1
- package/lib/api/generate-sdk-config-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 +2 -0
- 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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +2 -0
- package/lib/commands/config/init.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/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-restore.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/dataset/user-deleted-field-list.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/table-diff-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/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/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.d.ts +1 -0
- 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/domain-routing-sync.d.ts +2 -0
- package/lib/commands/project/domain-routing-sync.js +1 -0
- 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/rule/get.d.ts +2 -0
- package/lib/commands/rule/get.js +1 -0
- package/lib/commands/rule/index.d.ts +2 -0
- package/lib/commands/rule/index.js +1 -0
- package/lib/commands/rule/list.d.ts +2 -0
- package/lib/commands/rule/list.js +1 -0
- package/lib/commands/rule/set.d.ts +2 -0
- package/lib/commands/rule/set.js +1 -0
- package/lib/commands/rule/shared.d.ts +43 -0
- package/lib/commands/rule/shared.js +1 -0
- 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/deployment-sync.js +1 -1
- package/lib/config/domain-config.d.ts +37 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.d.ts +27 -0
- package/lib/config/project-domain-routing.js +1 -0
- package/lib/config/schema.d.ts +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.d.ts +10 -4
- 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/region.d.ts +4 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +43 -49
- package/lib/constant/routing-profile.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.d.ts +2 -0
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +21 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.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/generated/official-routing.d.ts +83 -0
- package/lib/generated/official-routing.js +1 -0
- package/lib/generated/routing-contract.d.ts +9 -0
- package/lib/generated/routing-contract.js +1 -0
- 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/types/index.d.ts +0 -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/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 -1
- package/skills/rabetbase/SKILL.md +15 -12
- package/skills/rabetbase/guides/sdk-client-generation.md +10 -8
- package/skills/rabetbase/references/rabetbase-api-pull.md +16 -11
- package/skills/rabetbase/references/rabetbase-config.md +3 -3
- package/skills/rabetbase/references/rabetbase-database-template.md +36 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -0
- package/skills/rabetbase/references/rabetbase-init.md +32 -8
- package/skills/rabetbase/references/rabetbase-project-create.md +33 -8
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +28 -0
- package/skills/rabetbase/references/rabetbase-rule.md +64 -0
- package/skills/rabetbase.manifest.json +6 -3
- package/lib/config/project-routing.d.ts +0 -30
- package/lib/config/project-routing.js +0 -1
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a304_0x5eba21=a304_0x1ba2;function a304_0x1ba2(_0x296b86,_0x2b3b2b){_0x296b86=_0x296b86-0xea;const _0x143204=a304_0x1432();let _0x1ba267=_0x143204[_0x296b86];return _0x1ba267;}(function(_0x53fdf9,_0x1813c0){const _0x2988aa=a304_0x1ba2,_0x2f0479=_0x53fdf9();while(!![]){try{const _0x2ff148=-parseInt(_0x2988aa(0xf2))/0x1*(parseInt(_0x2988aa(0xf6))/0x2)+parseInt(_0x2988aa(0xff))/0x3*(parseInt(_0x2988aa(0x10e))/0x4)+-parseInt(_0x2988aa(0x117))/0x5+parseInt(_0x2988aa(0xfe))/0x6+parseInt(_0x2988aa(0x102))/0x7*(-parseInt(_0x2988aa(0x119))/0x8)+parseInt(_0x2988aa(0x105))/0x9+parseInt(_0x2988aa(0xfd))/0xa;if(_0x2ff148===_0x1813c0)break;else _0x2f0479['push'](_0x2f0479['shift']());}catch(_0x1140f1){_0x2f0479['push'](_0x2f0479['shift']());}}}(a304_0x1432,0xa7432));import a304_0x1c6c7a from'winston';import a304_0x4a6249 from'node:fs';import a304_0x1fdc1 from'node:path';function a304_0x1432(){const _0x1d679f=['7537884enprpT','346254cjYyGt','logFilePath','rawCommand','77HszSig','utf8','yellow','8735742fMbCIB','Failed\x20to\x20clear\x20logs:','setLogPath','File','toISOString','Failed\x20to\x20read\x20logs:','info','trim','mkdirSync','4ZkvrKQ','join','level','timestamp','winstonLogger','command','errors','readFileSync','transports','6361840mDBkKt','format','978232ZXrhGI','clear','combine','createLogger','currentRawCommand','initWinstonLogger','printf','now','success','warn','115GCzZAK','readLogs','existsSync','Starting:\x20','10684TeVqho','error','filter','message','duration','blue','writeFileSync','15745030lwcjcp'];a304_0x1432=function(){return _0x1d679f;};return a304_0x1432();}class Logger{[a304_0x5eba21(0x112)];[a304_0x5eba21(0x100)];[a304_0x5eba21(0xec)]='';constructor(){this['logFilePath']='';}['setRawCommand'](_0xcce94){const _0xfdc5dd=a304_0x5eba21;this[_0xfdc5dd(0xec)]=_0xcce94;}[a304_0x5eba21(0xed)](){const _0x6c50ed=a304_0x5eba21,_0x5ad217=a304_0x1fdc1['dirname'](this['logFilePath']);!a304_0x4a6249[_0x6c50ed(0xf4)](_0x5ad217)&&a304_0x4a6249[_0x6c50ed(0x10d)](_0x5ad217,{'recursive':!![]});const _0x31d412=a304_0x1c6c7a[_0x6c50ed(0x118)][_0x6c50ed(0xea)](a304_0x1c6c7a[_0x6c50ed(0x118)][_0x6c50ed(0x111)](),a304_0x1c6c7a[_0x6c50ed(0x118)][_0x6c50ed(0x114)]({'stack':!![]}),a304_0x1c6c7a['format'][_0x6c50ed(0xee)](_0x2058c4=>{const _0x279af1=_0x6c50ed,_0x5c2696={'timestamp':_0x2058c4[_0x279af1(0x111)]||new Date()[_0x279af1(0x109)](),'level':_0x2058c4[_0x279af1(0x110)]||'info','command':_0x2058c4[_0x279af1(0x113)]||'unknown','rawCommand':_0x2058c4[_0x279af1(0x101)]||this['currentRawCommand']||undefined,'message':_0x2058c4[_0x279af1(0xf9)]||'','duration':_0x2058c4[_0x279af1(0xfa)]||undefined,'details':_0x2058c4['details']||undefined};return JSON['stringify'](_0x5c2696);}));this[_0x6c50ed(0x112)]=a304_0x1c6c7a[_0x6c50ed(0xeb)]({'level':'info','format':_0x31d412,'transports':[new a304_0x1c6c7a[(_0x6c50ed(0x116))][(_0x6c50ed(0x108))]({'filename':this[_0x6c50ed(0x100)],'level':_0x6c50ed(0x10b)})],'silent':![]}),a304_0x1c6c7a['addColors']({'success':'green','error':'red','warn':_0x6c50ed(0x104),'info':_0x6c50ed(0xfb)});}[a304_0x5eba21(0x107)](_0x2f9772){const _0x48efc5=a304_0x5eba21;this[_0x48efc5(0x100)]=a304_0x1fdc1[_0x48efc5(0x10f)](_0x2f9772,'.lovrabet.log'),this[_0x48efc5(0x112)]&&this[_0x48efc5(0x112)][_0x48efc5(0x11a)](),this[_0x48efc5(0xed)]();}[a304_0x5eba21(0x10b)](_0xfa04f,_0x350273,_0x3419ae){const _0x17c996=a304_0x5eba21;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x17c996(0x112)][_0x17c996(0x10b)](_0x350273,{'command':_0xfa04f,'details':_0x3419ae});}['success'](_0x12db69,_0x3dab62,_0x216a5e,_0x331005){const _0x29f9b3=a304_0x5eba21;if(!this['logFilePath']||!this[_0x29f9b3(0x112)])return;this[_0x29f9b3(0x112)]['log'](_0x29f9b3(0x10b),_0x3dab62,{'level':_0x29f9b3(0xf0),'command':_0x12db69,'duration':_0x216a5e,'details':_0x331005});}[a304_0x5eba21(0xf7)](_0x3bfd2d,_0x1cf5e3,_0x3905d8){const _0x5445de=a304_0x5eba21;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x5445de(0x112)][_0x5445de(0xf7)](_0x1cf5e3,{'command':_0x3bfd2d,'details':_0x3905d8});}[a304_0x5eba21(0xf1)](_0x1d42ab,_0x580f6d,_0x5ef269){const _0xf7767a=a304_0x5eba21;if(!this[_0xf7767a(0x100)]||!this[_0xf7767a(0x112)])return;this[_0xf7767a(0x112)][_0xf7767a(0xf1)](_0x580f6d,{'command':_0x1d42ab,'details':_0x5ef269});}async['logTask'](_0x310821,_0x411690,_0x4b0afa){const _0x5b58cd=a304_0x5eba21,_0x34de2f=Date[_0x5b58cd(0xef)]();this[_0x5b58cd(0x10b)](_0x310821,_0x5b58cd(0xf5)+_0x411690);try{const _0x4c32a3=await _0x4b0afa(),_0x29c8fa=Date[_0x5b58cd(0xef)]()-_0x34de2f;return this[_0x5b58cd(0xf0)](_0x310821,'Completed:\x20'+_0x411690,_0x29c8fa),_0x4c32a3;}catch(_0x76c297){const _0x491f2a=Date[_0x5b58cd(0xef)]()-_0x34de2f;this[_0x5b58cd(0xf7)](_0x310821,'Failed:\x20'+_0x411690,{'error':_0x76c297 instanceof Error?_0x76c297[_0x5b58cd(0xf9)]:String(_0x76c297),'duration':_0x491f2a});throw _0x76c297;}}[a304_0x5eba21(0xf3)](){const _0x22825a=a304_0x5eba21;try{if(!a304_0x4a6249[_0x22825a(0xf4)](this['logFilePath']))return[];const _0x2852c0=a304_0x4a6249[_0x22825a(0x115)](this['logFilePath'],_0x22825a(0x103));return _0x2852c0['split']('\x0a')[_0x22825a(0xf8)](_0x505357=>_0x505357[_0x22825a(0x10c)]())['map'](_0x57acf5=>JSON['parse'](_0x57acf5));}catch(_0x4e5a0b){return console[_0x22825a(0xf1)](_0x22825a(0x10a),_0x4e5a0b),[];}}['clearLogs'](){const _0x4eb86c=a304_0x5eba21;try{a304_0x4a6249[_0x4eb86c(0xf4)](this[_0x4eb86c(0x100)])&&a304_0x4a6249[_0x4eb86c(0xfc)](this[_0x4eb86c(0x100)],'',_0x4eb86c(0x103));}catch(_0x2dd0c0){console[_0x4eb86c(0xf1)](_0x4eb86c(0x106),_0x2dd0c0);}}['getWinstonInstance'](){const _0x1bc4fc=a304_0x5eba21;return this[_0x1bc4fc(0x112)];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a305_0x1153(){const _0x4a931c=['validation','isArray','98574auXcGA','2863491Sacvjy','Invalid\x20JSON\x20for\x20--params:\x20','5295241txHAbo','10Stopls','7466208dHVNnb','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','19286145hUBAnS','3674aifVpi','object','356576iTARMh','208NoIIhm','parse','120eAsrSJ'];a305_0x1153=function(){return _0x4a931c;};return a305_0x1153();}(function(_0x34e702,_0x426c3){const _0x7f748a=a305_0x2952,_0x3922f3=_0x34e702();while(!![]){try{const _0x31f79d=parseInt(_0x7f748a(0xa1))/0x1*(-parseInt(_0x7f748a(0xae))/0x2)+-parseInt(_0x7f748a(0xa7))/0x3+-parseInt(_0x7f748a(0xb0))/0x4+parseInt(_0x7f748a(0xa3))/0x5*(-parseInt(_0x7f748a(0xa6))/0x6)+-parseInt(_0x7f748a(0xa9))/0x7+parseInt(_0x7f748a(0xab))/0x8+-parseInt(_0x7f748a(0xad))/0x9*(-parseInt(_0x7f748a(0xaa))/0xa);if(_0x31f79d===_0x426c3)break;else _0x3922f3['push'](_0x3922f3['shift']());}catch(_0x24c93c){_0x3922f3['push'](_0x3922f3['shift']());}}}(a305_0x1153,0x79fe5));import{CliErrors}from'../errors.js';function a305_0x2952(_0x5821b0,_0x554144){_0x5821b0=_0x5821b0-0xa1;const _0x1153a1=a305_0x1153();let _0x295228=_0x1153a1[_0x5821b0];return _0x295228;}export function parseJsonParams(_0x377ca1){const _0x5c3cfb=a305_0x2952;if(!_0x377ca1)return undefined;let _0xcb8a25;try{_0xcb8a25=JSON[_0x5c3cfb(0xa2)](_0x377ca1);}catch{throw CliErrors['validation'](_0x5c3cfb(0xa8)+_0x377ca1);}if(!_0xcb8a25||typeof _0xcb8a25!==_0x5c3cfb(0xaf)||Array[_0x5c3cfb(0xa5)](_0xcb8a25))throw CliErrors[_0x5c3cfb(0xa4)]('--params\x20must\x20be\x20a\x20JSON\x20object',_0x5c3cfb(0xac));return _0xcb8a25;}
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a306_0x2e66(){const _0x254ebc=['980pbalwO','1160MvniLB','4sRsYAb','3979728Oscotn','1380945qDznQs','6672232MtFuUA','21660885GKUAQC','.cmd','553431eZMoms','1229396SBglNZ'];a306_0x2e66=function(){return _0x254ebc;};return a306_0x2e66();}(function(_0x17379c,_0x2541e1){const _0x5ed7f6=a306_0x1515,_0x32e878=_0x17379c();while(!![]){try{const _0x55e14c=parseInt(_0x5ed7f6(0x1ec))/0x1*(parseInt(_0x5ed7f6(0x1ed))/0x2)+-parseInt(_0x5ed7f6(0x1ea))/0x3*(parseInt(_0x5ed7f6(0x1ee))/0x4)+-parseInt(_0x5ed7f6(0x1e6))/0x5+-parseInt(_0x5ed7f6(0x1ef))/0x6+-parseInt(_0x5ed7f6(0x1eb))/0x7+-parseInt(_0x5ed7f6(0x1e7))/0x8+parseInt(_0x5ed7f6(0x1e8))/0x9;if(_0x55e14c===_0x2541e1)break;else _0x32e878['push'](_0x32e878['shift']());}catch(_0x1b6485){_0x32e878['push'](_0x32e878['shift']());}}}(a306_0x2e66,0xcd752));function a306_0x1515(_0x1abfba,_0x55b1d8){_0x1abfba=_0x1abfba-0x1e6;const _0x2e66c4=a306_0x2e66();let _0x15156c=_0x2e66c4[_0x1abfba];return _0x15156c;}export const isWindows=process['platform']==='win32';export function resolveNpmBin(_0x1fc976){const _0xb42351=a306_0x1515;return isWindows?_0x1fc976+_0xb42351(0x1e9):_0x1fc976;}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x329304){return new Promise(_0x432048=>setTimeout(_0x432048,_0x329304));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a308_0x524b46=a308_0xf44c;function a308_0x1471(){const _0x1fca53=['toLowerCase','pad','template','isFile','974922wKwLGE','writeFile','promises','LOVRABET','toComponentName','extname','success','name','now','default','3232593AAvNkX','replaceContent','processTemplate','join','getFullYear','toDisplayTitle','padStart','readdir','6931200Rbqieg','.tsx','.jsx','isDirectory','replace','endsWith','push','.json','split','.ts','5105JStprE','getDate','error','includes','processFile','formatLocalTimestamp','.js','tableName:\x20\x22','name:\x20\x22','24HMgSjA','datasetCode','charAt','pop','950syTeFl','message','.tpl','\x20},','alias','1196766emphii','getHours','mkdir','slice','toUpperCase','getMinutes','.md','toISOString','.css','map','readFile','1036TUFZMD','\x0a\x20\x20\x20\x20{\x20','processDirectory','YourModel','Template\x20content\x20replacement\x20failed','tableName','25249sLuuuF','utf8','1259OgYYkv'];a308_0x1471=function(){return _0x1fca53;};return a308_0x1471();}(function(_0x2dc7f9,_0xd7863a){const _0x418168=a308_0xf44c,_0x165f41=_0x2dc7f9();while(!![]){try{const _0x2fd0f0=parseInt(_0x418168(0x15a))/0x1*(-parseInt(_0x418168(0x142))/0x2)+parseInt(_0x418168(0x119))/0x3+-parseInt(_0x418168(0x152))/0x4*(parseInt(_0x418168(0x135))/0x5)+-parseInt(_0x418168(0x147))/0x6+parseInt(_0x418168(0x158))/0x7*(-parseInt(_0x418168(0x13e))/0x8)+parseInt(_0x418168(0x123))/0x9+parseInt(_0x418168(0x12b))/0xa;if(_0x2fd0f0===_0xd7863a)break;else _0x165f41['push'](_0x165f41['shift']());}catch(_0x17cbb9){_0x165f41['push'](_0x165f41['shift']());}}}(a308_0x1471,0x4a58d));import a308_0x5a8490 from'node:fs';function a308_0xf44c(_0x186b3d,_0x2b063f){_0x186b3d=_0x186b3d-0x117;const _0x1471c6=a308_0x1471();let _0xf44cac=_0x1471c6[_0x186b3d];return _0xf44cac;}import a308_0xe92256 from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a308_0x524b46(0x15c)](_0x4a8a3d){const _0x47c9d8=a308_0x524b46;return String(_0x4a8a3d)[_0x47c9d8(0x129)](0x2,'0');}static[a308_0x524b46(0x13a)](_0x2d6e37){const _0x2bad9a=a308_0x524b46,_0x5722dc=_0x2d6e37[_0x2bad9a(0x127)](),_0x2cd45e=this[_0x2bad9a(0x15c)](_0x2d6e37['getMonth']()+0x1),_0x2fe73f=this[_0x2bad9a(0x15c)](_0x2d6e37[_0x2bad9a(0x136)]()),_0x5cc1dc=this[_0x2bad9a(0x15c)](_0x2d6e37[_0x2bad9a(0x148)]()),_0x2cfba7=this[_0x2bad9a(0x15c)](_0x2d6e37[_0x2bad9a(0x14c)]()),_0x9f1475=this['pad'](_0x2d6e37['getSeconds']());return{'createdAt':_0x5722dc+'-'+_0x2cd45e+'-'+_0x2fe73f+'\x20'+_0x5cc1dc+':'+_0x2cfba7+':'+_0x9f1475,'createdDate':_0x5722dc+'-'+_0x2cd45e+'-'+_0x2fe73f,'createdTime':_0x5cc1dc+':'+_0x2cfba7+':'+_0x9f1475};}static[a308_0x524b46(0x11d)](_0x3d1687){const _0x31ef85=a308_0x524b46,_0x3cc768=_0x3d1687['split']('/')[_0x31ef85(0x141)]()||_0x3d1687;return _0x3cc768[_0x31ef85(0x133)]('-')[_0x31ef85(0x150)](_0x45a37e=>_0x45a37e[_0x31ef85(0x140)](0x0)[_0x31ef85(0x14b)]()+_0x45a37e[_0x31ef85(0x14a)](0x1)['toLowerCase']())[_0x31ef85(0x126)]('');}static[a308_0x524b46(0x128)](_0x241421){const _0x39503a=a308_0x524b46,_0x6698e8=_0x241421['split']('/')[_0x39503a(0x141)]()||_0x241421;return _0x6698e8[_0x39503a(0x133)]('-')[_0x39503a(0x150)](_0x1363d6=>_0x1363d6['charAt'](0x0)[_0x39503a(0x14b)]()+_0x1363d6[_0x39503a(0x14a)](0x1)[_0x39503a(0x15b)]())['join']('\x20');}static[a308_0x524b46(0x124)](_0x3473a3,_0x232ec,_0x3ba49f){const _0x106eba=a308_0x524b46,_0xe9a8f7=this[_0x106eba(0x11d)](_0x232ec),_0x209a4d=this[_0x106eba(0x128)](_0x232ec),{createdAt:_0x1110ce,createdDate:_0x4f4dfd,createdTime:_0x5c3582}=this[_0x106eba(0x13a)](new Date());let _0xef53ad=_0x3473a3['replace'](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0xe9a8f7)[_0x106eba(0x12f)](/\{DisplayTitle\}/g,_0x209a4d)['replace'](/\{PageName\}/g,_0x232ec)['replace'](/\{TemplateName\}/g,_0x3ba49f)[_0x106eba(0x12f)](/\{CreatedAt\}/g,_0x1110ce)[_0x106eba(0x12f)](/\{CreatedDate\}/g,_0x4f4dfd)[_0x106eba(0x12f)](/\{CreatedTime\}/g,_0x5c3582);return _0xef53ad;}static['replaceApiContent'](_0x167705,_0x522bd0,_0x2afdc8,_0x23169f,_0x3abbb2,_0x41f68a,_0x1526dd,_0x35050e){const _0x14ff85=a308_0x524b46,_0x5bb6fb=new Date(),_0x314b04=_0x5bb6fb[_0x14ff85(0x14e)](),_0x2afadd=_0x2afdc8[_0x14ff85(0x150)](_0x21fa50=>{const _0x4381b1=_0x14ff85,_0x5c12e5=['datasetCode:\x20\x22'+_0x21fa50[_0x4381b1(0x13f)]+'\x22',_0x4381b1(0x13c)+_0x21fa50[_0x4381b1(0x157)]+'\x22',_0x4381b1(0x13d)+_0x21fa50[_0x4381b1(0x120)]+'\x22'];return _0x21fa50[_0x4381b1(0x146)]&&_0x5c12e5[_0x4381b1(0x131)]('alias:\x20\x22'+_0x21fa50[_0x4381b1(0x146)]+'\x22'),_0x4381b1(0x153)+_0x5c12e5[_0x4381b1(0x126)](',\x20')+_0x4381b1(0x145);})['join'](''),_0x47fce3=_0x23169f||_0x2afdc8[0x0]?.[_0x14ff85(0x146)]||_0x14ff85(0x155);let _0xd934dd=_0x167705['replace'](/\{AppCode\}/g,_0x522bd0)[_0x14ff85(0x12f)](/\{ModelConfigs\}/g,_0x2afadd)[_0x14ff85(0x12f)](/\{ExampleModelName\}/g,_0x47fce3)[_0x14ff85(0x12f)](/\{ApiFileName\}/g,_0x3abbb2||'api')[_0x14ff85(0x12f)](/\{ConfigName\}/g,_0x41f68a||_0x14ff85(0x122))[_0x14ff85(0x12f)](/\{ClientConfigParam\}/g,_0x1526dd||'')[_0x14ff85(0x12f)](/\{VarPrefix\}/g,_0x35050e||_0x14ff85(0x11c))[_0x14ff85(0x12f)](/\{CreatedAt\}/g,_0x314b04);return _0xd934dd;}static async[a308_0x524b46(0x125)](_0x215e07,_0x1c4e87,_0x32f40a,_0x529fec,_0x2ef980=!![]){const _0x5dc9b7=a308_0x524b46,_0xa35bc2=Date[_0x5dc9b7(0x121)]();try{_0x2ef980&&logger['info'](_0x5dc9b7(0x117),'Starting\x20template\x20content\x20replacement',{'templatePath':_0x215e07,'targetPath':_0x1c4e87,'pageName':_0x32f40a,'templateName':_0x529fec});await a308_0x5a8490[_0x5dc9b7(0x11b)]['mkdir'](_0x1c4e87,{'recursive':!![]}),await this[_0x5dc9b7(0x154)](_0x215e07,_0x1c4e87,_0x32f40a,_0x529fec);if(_0x2ef980){const _0x3dbe4c=Date[_0x5dc9b7(0x121)]()-_0xa35bc2;logger[_0x5dc9b7(0x11f)]('template','Template\x20content\x20replacement\x20completed',_0x3dbe4c,{'pageName':_0x32f40a,'templateName':_0x529fec});}}catch(_0xf1b775){if(_0x2ef980){const _0x64730c=Date[_0x5dc9b7(0x121)]()-_0xa35bc2;logger[_0x5dc9b7(0x137)](_0x5dc9b7(0x117),_0x5dc9b7(0x156),{'templatePath':_0x215e07,'targetPath':_0x1c4e87,'pageName':_0x32f40a,'templateName':_0x529fec,'error':_0xf1b775 instanceof Error?_0xf1b775[_0x5dc9b7(0x143)]:String(_0xf1b775),'duration':_0x64730c});}throw _0xf1b775;}}static async[a308_0x524b46(0x154)](_0x2bdf40,_0x48dd52,_0x57bc52,_0x97c6a3){const _0xccf4=a308_0x524b46,_0x10488e=await a308_0x5a8490[_0xccf4(0x11b)][_0xccf4(0x12a)](_0x2bdf40,{'withFileTypes':!![]});for(const _0x79a214 of _0x10488e){const _0x2f25ed=a308_0xe92256['join'](_0x2bdf40,_0x79a214['name']);let _0x516ec5=a308_0xe92256['join'](_0x48dd52,_0x79a214[_0xccf4(0x120)]);_0x79a214[_0xccf4(0x120)][_0xccf4(0x130)]('.tpl')&&(_0x516ec5=a308_0xe92256['join'](_0x48dd52,_0x79a214[_0xccf4(0x120)][_0xccf4(0x12f)](/\.tpl$/,'')));if(_0x79a214[_0xccf4(0x12e)]())await a308_0x5a8490[_0xccf4(0x11b)][_0xccf4(0x149)](_0x516ec5,{'recursive':!![]}),await this[_0xccf4(0x154)](_0x2f25ed,_0x516ec5,_0x57bc52,_0x97c6a3);else _0x79a214[_0xccf4(0x118)]()&&await this[_0xccf4(0x139)](_0x2f25ed,_0x516ec5,_0x57bc52,_0x97c6a3);}}static async['processFile'](_0x509cb5,_0x44f458,_0x3d122d,_0x45620a){const _0x34dc8c=a308_0x524b46,_0x271073=a308_0xe92256[_0x34dc8c(0x11e)](_0x509cb5)[_0x34dc8c(0x15b)]();_0x509cb5[_0x34dc8c(0x130)](_0x34dc8c(0x144))&&(_0x44f458=_0x44f458[_0x34dc8c(0x12f)](/\.tpl$/,''));const _0x1c6889=[_0x34dc8c(0x12c),_0x34dc8c(0x134),_0x34dc8c(0x12d),_0x34dc8c(0x13b),_0x34dc8c(0x132),_0x34dc8c(0x14d),_0x34dc8c(0x14f),'.scss',_0x34dc8c(0x144)];if(_0x1c6889[_0x34dc8c(0x138)](_0x271073)||_0x509cb5[_0x34dc8c(0x130)](_0x34dc8c(0x144))){const _0x3c4a6d=await a308_0x5a8490[_0x34dc8c(0x11b)][_0x34dc8c(0x151)](_0x509cb5,_0x34dc8c(0x159)),_0x34db3f=this['replaceContent'](_0x3c4a6d,_0x3d122d,_0x45620a);await a308_0x5a8490[_0x34dc8c(0x11b)][_0x34dc8c(0x11a)](_0x44f458,_0x34db3f,_0x34dc8c(0x159));}else await a308_0x5a8490['promises']['copyFile'](_0x509cb5,_0x44f458);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x30b9ee,_0xf0054d){const _0x32c363=a309_0x328f,_0x893c30=_0x30b9ee();while(!![]){try{const _0x403cae=-parseInt(_0x32c363(0x1be))/0x1*(parseInt(_0x32c363(0x1b5))/0x2)+-parseInt(_0x32c363(0x1b1))/0x3+parseInt(_0x32c363(0x1c2))/0x4+-parseInt(_0x32c363(0x1c1))/0x5+parseInt(_0x32c363(0x1c8))/0x6+-parseInt(_0x32c363(0x1ca))/0x7+parseInt(_0x32c363(0x1c9))/0x8;if(_0x403cae===_0xf0054d)break;else _0x893c30['push'](_0x893c30['shift']());}catch(_0x371991){_0x893c30['push'](_0x893c30['shift']());}}}(a309_0x3138,0x60f14));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a309_0xfe419d 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 _0x30730e=a309_0x328f,_0xc0c420=process.env.RABETBASE_NO_UPDATE_NOTICE?.[_0x30730e(0x1cb)]()[_0x30730e(0x1c5)]();return _0xc0c420==='1'||_0xc0c420===_0x30730e(0x1bb)||_0xc0c420==='yes';}function a309_0x3138(){const _0x1289c7=['valid','https://www.npmjs.com/package/','parse','number','lastNotifiedAt','true','\x20available,\x20current\x20','utf8','6085RNzIOG','gte','update-check.json','2330885ORStdl','571740lWvqaR','now','object','toLowerCase','lastNotifiedVersion','.cache','3684654sdYivf','14643216uyulOW','1461544SHutHH','trim','/v/','checkedAt','2300838ZEXYSS',',\x20run:\x20','rabetbase-cli','stableVersion','246zpnjvP'];a309_0x3138=function(){return _0x1289c7;};return a309_0x3138();}function cacheRoot(){const _0xfc33fc=a309_0x328f;return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),_0xfc33fc(0x1c7));}export function getUpdateNoticeCachePath(){const _0xf144a6=a309_0x328f;return join(cacheRoot(),_0xf144a6(0x1b3),_0xf144a6(0x1c0));}async function readUpdateNoticeCache(){const _0x3dd56d=a309_0x328f;try{const _0x2e2200=await readFile(getUpdateNoticeCachePath(),_0x3dd56d(0x1bd)),_0xc34bb5=JSON[_0x3dd56d(0x1b8)](_0x2e2200);if(!_0xc34bb5||typeof _0xc34bb5!==_0x3dd56d(0x1c4))return{};return _0xc34bb5;}catch{return{};}}function a309_0x328f(_0x1552d0,_0x52a87b){_0x1552d0=_0x1552d0-0x1b0;const _0x313881=a309_0x3138();let _0x328fcc=_0x313881[_0x1552d0];return _0x328fcc;}async function writeUpdateNoticeCache(_0x41c177){const _0x40eb1e=a309_0x328f;try{const _0x1b0545=getUpdateNoticeCachePath();await mkdir(dirname(_0x1b0545),{'recursive':!![]}),await writeFile(_0x1b0545,JSON['stringify'](_0x41c177,null,0x2)+'\x0a',_0x40eb1e(0x1bd));}catch{}}function isFreshCheck(_0x5ab496,_0x5369d1){const _0x381bf9=a309_0x328f;return typeof _0x5ab496[_0x381bf9(0x1b0)]==='number'&&_0x5369d1-_0x5ab496[_0x381bf9(0x1b0)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x4a4c79,_0x5c6f7a,_0x4dfe4b){const _0xcb4979=a309_0x328f;return _0x4a4c79[_0xcb4979(0x1c6)]===_0x5c6f7a&&typeof _0x4a4c79[_0xcb4979(0x1ba)]===_0xcb4979(0x1b9)&&_0x4dfe4b-_0x4a4c79[_0xcb4979(0x1ba)]<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0x3afdb0){const _0x375473=a309_0x328f;return _0x375473(0x1b7)+NPM_PACKAGE_NAME+_0x375473(0x1cc)+_0x3afdb0;}export async function resolveLatestUpdateNotice(){const _0x18509e=a309_0x328f;if(isUpdateNoticeDisabled())return null;try{const _0x42081d=Date[_0x18509e(0x1c3)](),_0x3e2efd=getCliVersion(),_0x51d64e=await readUpdateNoticeCache();let _0x59ddf5=isFreshCheck(_0x51d64e,_0x42081d)?_0x51d64e['latest']?.[_0x18509e(0x1cb)]():undefined;if(!_0x59ddf5&&!isFreshCheck(_0x51d64e,_0x42081d)){const _0x3801bd=await getCliVersionPolicy();_0x59ddf5=_0x3801bd?.[_0x18509e(0x1b4)]?.[_0x18509e(0x1cb)]()||undefined,await writeUpdateNoticeCache({..._0x51d64e,'checkedAt':_0x42081d,'latest':_0x59ddf5,'failed':!_0x59ddf5});}if(!_0x59ddf5||!a309_0xfe419d[_0x18509e(0x1b6)](_0x3e2efd)||!a309_0xfe419d[_0x18509e(0x1b6)](_0x59ddf5))return null;if(a309_0xfe419d[_0x18509e(0x1bf)](_0x3e2efd,_0x59ddf5))return null;if(isRecentlyNotified(_0x51d64e,_0x59ddf5,_0x42081d))return null;const _0xafe86f=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0x51d64e,'checkedAt':isFreshCheck(_0x51d64e,_0x42081d)?_0x51d64e[_0x18509e(0x1b0)]:_0x42081d,'latest':_0x59ddf5,'failed':![],'lastNotifiedVersion':_0x59ddf5,'lastNotifiedAt':_0x42081d}),{'command':_0xafe86f,'current':_0x3e2efd,'latest':_0x59ddf5,'url':buildNpmVersionUrl(_0x59ddf5),'message':CLI_BIN_NAME+'\x20'+_0x59ddf5+_0x18509e(0x1bc)+_0x3e2efd+_0x18509e(0x1b2)+_0xafe86f};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a310_0x5352(_0x533dd7,_0x1b8ec5){_0x533dd7=_0x533dd7-0x64;var _0x3d28b3=a310_0x3d28();var _0x535225=_0x3d28b3[_0x533dd7];return _0x535225;}function a310_0x3d28(){var _0x3b601c=['432184cGUDxB','111185dnhwzY','547598AlTPiD','1355920hlLviD','22092xKwlCz','11576cTorRn','400416NPRDHe','105zLToek'];a310_0x3d28=function(){return _0x3b601c;};return a310_0x3d28();}(function(_0x1af175,_0x4b5f92){var _0x34ce39=a310_0x5352,_0x33ed70=_0x1af175();while(!![]){try{var _0x37e6b9=-parseInt(_0x34ce39(0x69))/0x1+parseInt(_0x34ce39(0x66))/0x2+-parseInt(_0x34ce39(0x6a))/0x3+parseInt(_0x34ce39(0x64))/0x4+parseInt(_0x34ce39(0x65))/0x5+parseInt(_0x34ce39(0x68))/0x6*(parseInt(_0x34ce39(0x6b))/0x7)+-parseInt(_0x34ce39(0x67))/0x8;if(_0x37e6b9===_0x4b5f92)break;else _0x33ed70['push'](_0x33ed70['shift']());}catch(_0x5368d9){_0x33ed70['push'](_0x33ed70['shift']());}}}(a310_0x3d28,0x23586));import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a311_0x4c17(_0xaf2806,_0x100baf){_0xaf2806=_0xaf2806-0xd5;var _0x14c33f=a311_0x14c3();var _0x4c17df=_0x14c33f[_0xaf2806];return _0x4c17df;}(function(_0x114cdb,_0x2c5ad8){var _0x52be75=a311_0x4c17,_0x59eacb=_0x114cdb();while(!![]){try{var _0x193750=-parseInt(_0x52be75(0xd8))/0x1*(parseInt(_0x52be75(0xdd))/0x2)+-parseInt(_0x52be75(0xdb))/0x3+-parseInt(_0x52be75(0xda))/0x4+-parseInt(_0x52be75(0xd6))/0x5+parseInt(_0x52be75(0xd5))/0x6+-parseInt(_0x52be75(0xd9))/0x7*(parseInt(_0x52be75(0xdc))/0x8)+parseInt(_0x52be75(0xd7))/0x9;if(_0x193750===_0x2c5ad8)break;else _0x59eacb['push'](_0x59eacb['shift']());}catch(_0x2d4e22){_0x59eacb['push'](_0x59eacb['shift']());}}}(a311_0x14c3,0xd6b8b));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a311_0x14c3(){var _0x3d64af=['44621730IJHCYl','55773vUwCzZ','14TyIkPJ','2248412UEKyMi','4019691OSvpbx','4374128kHjtAF','40rLNqYm','1969014QUpyPv','1478240ncexOW'];a311_0x14c3=function(){return _0x3d64af;};return a311_0x14c3();}export async function withActiveCookie(_0x426b1a,_0x5f4e81){setActiveCookie(_0x426b1a);try{return await _0x5f4e81();}finally{clearActiveCookie();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5a4058,_0x1c2d20){var _0x3f9ab0=a312_0x4d6a,_0x5737a1=_0x5a4058();while(!![]){try{var _0x3cc25=-parseInt(_0x3f9ab0(0x1db))/0x1+parseInt(_0x3f9ab0(0x1df))/0x2+parseInt(_0x3f9ab0(0x1de))/0x3*(parseInt(_0x3f9ab0(0x1e6))/0x4)+parseInt(_0x3f9ab0(0x1e4))/0x5*(-parseInt(_0x3f9ab0(0x1e2))/0x6)+parseInt(_0x3f9ab0(0x1e3))/0x7*(parseInt(_0x3f9ab0(0x1dc))/0x8)+-parseInt(_0x3f9ab0(0x1dd))/0x9*(-parseInt(_0x3f9ab0(0x1e5))/0xa)+-parseInt(_0x3f9ab0(0x1e7))/0xb;if(_0x3cc25===_0x1c2d20)break;else _0x5737a1['push'](_0x5737a1['shift']());}catch(_0x27f7df){_0x5737a1['push'](_0x5737a1['shift']());}}}(a312_0x56c8,0xc1966));function a312_0x56c8(){var _0x136e32=['2430254LSXsOZ','stderr','write','18QOhocw','3919951nkFcpo','723940pwQVKy','121170DoIobZ','3017644hAMtXX','13322573ELPYLD','857072omFNzv','16lLSjlW','153pGiQgp','3nRHIuO'];a312_0x56c8=function(){return _0x136e32;};return a312_0x56c8();}function a312_0x4d6a(_0x43f18c,_0x9d81b7){_0x43f18c=_0x43f18c-0x1db;var _0x56c81f=a312_0x56c8();var _0x4d6adb=_0x56c81f[_0x43f18c];return _0x4d6adb;}export function writeCliSideChannelLine(_0x53138b){var _0x800230=a312_0x4d6a;process[_0x800230(0x1e0)][_0x800230(0x1e1)](_0x53138b+'\x0a');}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.5.1-beta.
|
|
3
|
+
"version": "2.5.1-beta.6",
|
|
4
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": [
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"sync:cdn": "node scripts/sync-cdn-assets.js",
|
|
47
47
|
"verify:bundled-jq": "node scripts/verify-bundled-jq.mjs",
|
|
48
48
|
"regression:release-smoke": "node scripts/regression-release-smoke.mjs",
|
|
49
|
+
"release:summary:prepare": "node scripts/release-summary-preparation.mjs",
|
|
49
50
|
"deploy:verify": "node scripts/deploy-verify.mjs",
|
|
50
51
|
"pack:dry-run-summary": "node scripts/package-dry-run-summary.mjs",
|
|
51
52
|
"verify:release-package": "node scripts/verify-release-package.mjs",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rabetbase
|
|
3
|
-
version: 2.5.1-beta.
|
|
4
|
-
description: "Lovrabet
|
|
3
|
+
version: 2.5.1-beta.6
|
|
4
|
+
description: "Use for Lovrabet development work through the rabetbase CLI: create or bind projects (including creating an AppCode project in the current folder), pull Dataset/API facts and maintain SDK clients, or manage datasets, database connections, pages, SQL, Backend Functions, menus, notifications, knowledge bases and kb search, Agent Context Rules, roles, files, OCR, deployment metadata, platform issues, and 钉钉沙箱账号绑定. Trigger when the user mentions rabetbase, Lovrabet development, AppCode, Dataset, project creation, api pull/codegen, dblink, page, SQL, BFF, menu, notification, knowledge base, kb search, Agent Context Rules, RULES.md, DATABASE.md, rule list/get/set, role, file/OCR, or related development workflows."
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
7
7
|
bins: ["rabetbase"]
|
|
@@ -12,15 +12,15 @@ metadata:
|
|
|
12
12
|
# Rabetbase CLI
|
|
13
13
|
|
|
14
14
|
> **前置条件:** 使用任何 API 命令前,需完成认证和配置(见下方)。
|
|
15
|
-
>
|
|
15
|
+
> **资料使用:** 先从意图索引定位能力,只读取当前任务直接相关的 reference。写操作、覆盖/恢复、复杂输出解析或命令契约不明确时,执行前读取对应 reference;简单只读操作可依据已确认的 CLI schema 直接完成。
|
|
16
16
|
> **命名约定:** 统一使用 `rabetbase <service> <command> [flags]` 格式。
|
|
17
17
|
> **输出格式:** AI Agent 需要结构化输出时,**优先 `--format compress`**(与 `json` 相同信封,单行紧凑、省 token);需要人类可读缩进时用 **`--format json`**。可在 **`json` / `compress`** 上叠加 **`--jq '<expr>'`**(对最终打印的整条 JSON 做 jq;二进制查找顺序为 **`JQ_PATH` → CLI 内置 sidecar jq → `PATH` 上的 jq**,通常无需单独安装系统 jq)。不确定当前 CLI 有哪些子命令或 flags 时,先跑 **`rabetbase schema`**(与 `--help` 同源的机器可读契约,无需登录)。
|
|
18
18
|
|
|
19
19
|
## 前置条件
|
|
20
20
|
|
|
21
|
-
1. **连接配置与认证分离**:首次使用先执行 `rabetbase config init
|
|
21
|
+
1. **连接配置与认证分离**:首次使用先执行 `rabetbase config init`。交互模式选择当前已开放国家/地区;非交互模式显式传 `--region`,未传时使用默认节点。企业独立部署优先导入 `lovrabet-routing/v1` 清单,也兼容旧扁平 Domain 文件和对应 `--*-domain` flags。`config init` 默认重建当前项目节点/Domain 配置,显式 `--global` 时写全局;保留 Cookie、AccessKey、format、locale 和应用绑定,但不登录、不绑定项目,随后再执行 `rabetbase auth login`
|
|
22
22
|
2. **AppCode**:确保 `.rabetbase.json` 中设置了 `apps`(单应用自动选中;多应用再配 `defaultApp`),或兼容读取的顶层 `appcode`,或通过 `--appcode <code>` / `--app <name>` 传入。旧 `.lovrabet.json` 不会自动读取
|
|
23
|
-
3. **配置文件**:`rabetbase config init`
|
|
23
|
+
3. **配置文件**:`rabetbase config init` 默认写当前项目 `.rabetbase.json`,显式 `--global` 时写 `~/.rabetbase.json`;默认节点不落冗余 `region`。官方节点模式清理显式和遗留 Domain,独立部署模式清理旧 `region`/Domain 后写入路由配置。完整字段说明见 [`.rabetbase.json` 配置参考](references/rabetbase-config.md)。当前目录应用绑定使用下方 `workspace init`
|
|
24
24
|
4. **工作目录应用绑定**:当前目录要固定使用某个应用时,使用 `rabetbase workspace init --appcode <code>` 或 `rabetbase workspace use --app <name>`(选型见「app vs workspace 职责边界」)
|
|
25
25
|
5. **多应用场景**:一个项目有多个应用时,先 `rabetbase workspace add <name> --appcode …` 登记各应用,再用 `--app <name>` 临时切换,或 `workspace use --app <name>` 修改当前工作目录默认应用
|
|
26
26
|
6. **平台发现**:当你不知道当前登录账号能访问哪些应用时,先 `rabetbase app list --remote`;它查询平台目录,不修改本地配置
|
|
@@ -60,7 +60,7 @@ metadata:
|
|
|
60
60
|
- 全部批次结束后再次执行异步差异刷新并重新获取完整差异;仍未收敛时,按 [`database-connection-workflow.md`](guides/database-connection-workflow.md) 对剩余 `toAnalyzeTables` 逐表串行重试且每表只恢复一次。仅当用户明确要求跳过分析/刷新时直接读取现有差异。状态查询失败继续使用原 `planId`,不得重复启动任务
|
|
61
61
|
- 输出很大且只需子集时,在 `compress`/`json` 上加 `--jq '.data…'` 缩小结果
|
|
62
62
|
- 需要真实业务行数据时必须交接给 `lovrabet data filter/getOne`;`lovrabet` 不可用时报告阻断并提示安装 Skill 与 CLI,不要静默安装或修复,也不要用 `rabetbase sql exec` 当行数据替代,见 [`guides/data-api-guidelines.md`](guides/data-api-guidelines.md)
|
|
63
|
-
- 需要 `src/api/api.ts` / `client.ts` 时:先 `rabetbase api pull --format compress` 取 `data.models`、`data.files`、`data.needsAgentMerge`,再按 [`sdk-client-generation.md`](guides/sdk-client-generation.md) 更新 TypeScript。`api pull`
|
|
63
|
+
- 需要 `src/api/api.ts` / `client.ts` 时:先 `rabetbase api pull --format compress` 取 `data.models`、`data.files`、`data.needsAgentMerge`,再按 [`sdk-client-generation.md`](guides/sdk-client-generation.md) 更新 TypeScript。`api pull` 默认**不会覆盖已有** `api.ts`/`client.ts`;只有用户明确要求放弃本地定制并完整重建时才使用 `--force --yes`
|
|
64
64
|
3. **SQL 工作流严格分步**
|
|
65
65
|
- 推荐路径:查现有(`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` 验证
|
|
66
66
|
- 先使用 `sql list/detail` 查找可复用的 Custom SQL;没有满足需求的资源时,按照 [`sql-creation-workflow.md`](guides/sql-creation-workflow.md) 与 [`sql-mybatis.md`](guides/sql-mybatis.md) 创建、校验、发布并验证
|
|
@@ -156,10 +156,10 @@ metadata:
|
|
|
156
156
|
|
|
157
157
|
## 配置作用域原则(`--global`)
|
|
158
158
|
|
|
159
|
-
-
|
|
159
|
+
- **写操作默认当前项目**(包括 `config init`、`workspace add`、`config set`、`project create` 等),除非用户**显式**传 `--global`。
|
|
160
160
|
- **不要**在用户未要求时给命令加 `--global`** — 默认行为已是「项目优先」;只有用户明确要改全局配置或不在项目内且意图写全局时才使用。
|
|
161
161
|
- **`config set`**:在**没有**项目配置文件(当前目录未解析到 `.rabetbase.json`)且**未**传 `--global` 时,CLI **拒绝执行**并提示使用 `--global` 或先 `rabetbase workspace init --appcode <code>`,**不会**静默写入全局。
|
|
162
|
-
- **`project create`** 生成的新项目 `.rabetbase.json` **只继承**少量全局偏好(如 `cookie` / `locale` / `format` / `riskLevel` 等),**不会**把全局 `apps` / `defaultApp` 带入新项目文件;同时生成浏览器安全的 `src/api/sdk-config.ts` 与 `rabetbase.routing.json
|
|
162
|
+
- **`project create`** 生成的新项目 `.rabetbase.json` **只继承**少量全局偏好(如 `cookie` / `locale` / `format` / `riskLevel` 等),**不会**把全局 `apps` / `defaultApp` 带入新项目文件;同时生成浏览器安全的 `src/api/sdk-config.ts` 与 `rabetbase.domain-routing.json`。每个官方节点直接声明自己的第三方库 CDN 与 Lovrabet 自有资源 Domain;项目文件始终包含解析后的完整地址,企业独立部署从共用清单读取显式 CDN。两个生成文件都不下发认证配置;Domain 配置变化后用 `project domain-routing-sync` 刷新项目快照,`api pull` 只刷新 SDK/API 文件。
|
|
163
163
|
- **`api pull` / `api list`**:默认仅针对**项目** `apps`;需要合并全局已登记应用时加 `--global`(见各命令 reference)。
|
|
164
164
|
- **`app list`**:默认展示**合并**后的全量;`--global` 仅全局、`--project` 仅项目(见 [`rabetbase app list`](references/rabetbase-app-list.md))。
|
|
165
165
|
|
|
@@ -297,7 +297,8 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
297
297
|
| 意图 | 推荐命令 | 备注 |
|
|
298
298
|
|------|---------|------|
|
|
299
299
|
| 初始化连接配置 | [`rabetbase config init`](references/rabetbase-init.md) | 选择官方节点或导入独立部署 Domain |
|
|
300
|
-
| 创建新项目 | [`rabetbase project create`](references/rabetbase-project-create.md) |
|
|
300
|
+
| 创建新项目 | [`rabetbase project create`](references/rabetbase-project-create.md) | 支持新目录或当前空目录创建;完成口径与安全边界见 reference |
|
|
301
|
+
| 刷新项目公开 Domain 路由 | [`rabetbase project domain-routing-sync`](references/rabetbase-project-domain-routing-sync.md) | 根据当前有效配置原子生成项目级 `rabetbase.domain-routing.json`;与前端页面路由无关 |
|
|
301
302
|
| 从 lovrabet-cli 迁移 | [`rabetbase project upgrade`](references/rabetbase-project-upgrade.md) | 6 步自动迁移,`--yes` 跳过确认 |
|
|
302
303
|
| 老项目翻新蓝图 / Legacy Application Blueprint | [`guides/legacy-application-blueprint-workflow.md`](guides/legacy-application-blueprint-workflow.md) | 先输出 `.rabetbase/blueprint/<appCode>/application-blueprint.md`,把老代码逻辑与 Dataset / Relations 绑定后再生成迁移 Backlog |
|
|
303
304
|
| 运行 package.json 脚本 | [`rabetbase run <script>`](references/rabetbase-run.md) | `write`;先审阅脚本命令体,嵌入式工具暂不开放 |
|
|
@@ -316,6 +317,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
316
317
|
| 列出配置 | [`rabetbase config list`](references/rabetbase-config.md) | 查看当前生效的配置 |
|
|
317
318
|
| 管理运行态 app-config | [`rabetbase app-config list/get/set/delete`](references/rabetbase-app-config.md) | 运行态 app-config 管理面;默认不输出明文 value;`set` 为 `write`,`delete` 保持 `high-risk-write` |
|
|
318
319
|
| 管理和检索当前研发应用的企业知识库 | [`rabetbase kb list/detail/search/create/update/delete`](references/rabetbase-kb.md) | 管理仅 company scope;search 固定 Development 且仅 `public/company`;`create/update` 为 `write`,`delete` 保持 `high-risk-write` |
|
|
320
|
+
| 管理当前研发应用的 Agent context 规则 | [`rabetbase rule list/get/set`](references/rabetbase-rule.md) | `RULES.md` 供页面、API 等研发 Agent 使用且排除 DB Agent;`DATABASE.md` 仅供数据库分析时 DB Agent 使用;两者在各自流程全程参与 context;set 为 `write`,先 dry-run |
|
|
319
321
|
| 查询或管理应用级通知配置 | [`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` |
|
|
320
322
|
| 查看线上菜单事实 / 菜单异常审计 | [`rabetbase menu list`](references/rabetbase-menu-list.md) | 返回 DFS 事实、children/page、URL、最近更新人/时间和 snapshotHash;异常治理先读 [`menu-anomaly-manual-cleanup`](guides/menu-anomaly-manual-cleanup.md) |
|
|
321
323
|
| 批量显示或隐藏菜单 | [`rabetbase menu visibility-update`](references/rabetbase-menu-visibility-update.md) | 用精确 ID/path 选择目标;先 dry-run,使用 `--expect-visible` / `--expected-count` 防漂移,正式执行必须 `--yes` |
|
|
@@ -367,7 +369,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
367
369
|
| 恢复已删除页面 | [`rabetbase page restore --id <pageId>`](references/rabetbase-page-restore.md) | 支持 `DATA_LIST|CUSTOM` 自动识别;跨类型同 ID 时显式传 `--page-type` |
|
|
368
370
|
| 数据库连接(dblink)/ 测连 / 结构分析 | [`rabetbase db list`](references/rabetbase-db-list.md) 起 | **`id`**、**trace/plan id** 与“终态 + 复跑 diff”完成口径见 [database-connection-workflow.md](guides/database-connection-workflow.md);各子命令见 `references/rabetbase-db-*.md` |
|
|
369
371
|
| 独立部署局部同步研发元数据 | [`rabetbase deployment sync`](references/rabetbase-deployment-sync.md) | 显式命令为 `write`;服务端仅允许应用 Admin 操作并原子检查 appCode 开关,未开启时正常 no-op;非生产 BFF/SQL 可配置 push 后置同步;生产、直连、Dataset 保持显式确认;失败或结果不确定时不自动重试 |
|
|
370
|
-
| 生成 / 更新 API 客户端代码 | [`rabetbase api pull`](references/rabetbase-api-pull.md) → [`sdk-client-generation.md`](guides/sdk-client-generation.md) | `api pull` 拉 Dataset 事实并刷新 `sdk-config.ts
|
|
372
|
+
| 生成 / 更新 API 客户端代码 | [`rabetbase api pull`](references/rabetbase-api-pull.md) → [`sdk-client-generation.md`](guides/sdk-client-generation.md) | `api pull` 拉 Dataset 事实并刷新 `sdk-config.ts`;已有 `api.ts`/`client.ts` 按 guide 合并更新 |
|
|
371
373
|
| 查看生成的 API 模型 | [`rabetbase api list`](references/rabetbase-api-list.md) | 列出已生成的数据模型 |
|
|
372
374
|
| 查看现有 SQL | [`rabetbase sql list --name "xxx"`](references/rabetbase-sql-list.md) | 分页,按名称过滤;默认查当前决议到的单个应用 |
|
|
373
375
|
| 查看 SQL 详情 | [`rabetbase sql detail --sqlcode xxx`](references/rabetbase-sql-detail.md) | 含完整 SQL 内容和参数定义 |
|
|
@@ -392,7 +394,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
392
394
|
| 查询应用人员及角色归属 | [`rabetbase app members-list --appcode <code>`](references/rabetbase-app-members-list.md) | 全量只读;按 userId 去重,角色归属聚合到 `roles[]` |
|
|
393
395
|
| 查询租户人员 | [`rabetbase tenant members-list --tenant-code <code>`](references/rabetbase-tenant-members-list.md) | 全量只读;租户必须属于当前账号 |
|
|
394
396
|
| 查看 app 服务帮助 | `rabetbase app` | 只显示 `app` 子命令帮助,不等价于 `app list` |
|
|
395
|
-
| 绑定当前目录到应用 | [`rabetbase workspace init --appcode <code>`](references/rabetbase-workspace.md) | 首次绑定;单应用自动选中且不写 `defaultApp
|
|
397
|
+
| 绑定当前目录到应用 | [`rabetbase workspace init --appcode <code>`](references/rabetbase-workspace.md) | 首次绑定;单应用自动选中且不写 `defaultApp`;与只处理国家/地区及 Domain 的 `config init` 不同 |
|
|
396
398
|
| 切换当前工作目录默认应用 | [`rabetbase workspace use --app <name>`](references/rabetbase-workspace.md) | 持久修改当前目录 defaultApp |
|
|
397
399
|
| 登记应用 | [`rabetbase workspace add <name> --appcode <code>`](references/rabetbase-workspace.md) | 单应用不写 default;增加第二个应用时保留原应用为默认;`--global` 写全局 |
|
|
398
400
|
| 移除应用 | [`rabetbase workspace remove <name>`](references/rabetbase-workspace.md) | 只移除本地 profile,移除后自动切换 default |
|
|
@@ -406,7 +408,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
406
408
|
| 命令分组 | 说明 |
|
|
407
409
|
|----------|------|
|
|
408
410
|
| Quick Start | [`init`](references/rabetbase-init.md) |
|
|
409
|
-
| Project | [`create`](references/rabetbase-project-create.md) / [`upgrade`](references/rabetbase-project-upgrade.md) |
|
|
411
|
+
| Project | [`create`](references/rabetbase-project-create.md) / [`domain-routing-sync`](references/rabetbase-project-domain-routing-sync.md) / [`upgrade`](references/rabetbase-project-upgrade.md) |
|
|
410
412
|
| Workspace | [`workspace init` / `workspace use` / `workspace add` / `workspace remove`](references/rabetbase-workspace.md) |
|
|
411
413
|
| Run Scripts | [`run`](references/rabetbase-run.md) |
|
|
412
414
|
| Authentication | [`auth login`](references/rabetbase-auth-login.md) / [`auth logout`](references/rabetbase-auth-logout.md) |
|
|
@@ -419,6 +421,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
419
421
|
| Configuration | [`config set/get/list/delete`](references/rabetbase-config.md) |
|
|
420
422
|
| Runtime App Config Management | [`app-config list/get/set/delete`](references/rabetbase-app-config.md) |
|
|
421
423
|
| Company Knowledge Base | [`kb list/detail/search/create/update/delete`](references/rabetbase-kb.md) |
|
|
424
|
+
| Agent Context Rules | [`rule list/get/set`](references/rabetbase-rule.md) |
|
|
422
425
|
| Menu | [`list`](references/rabetbase-menu-list.md) / [`external-link-create`](references/rabetbase-menu-external-link-create.md) / [`external-link-update`](references/rabetbase-menu-external-link-update.md) / [`rename`](references/rabetbase-menu-rename.md) / [`sync`](references/rabetbase-menu-sync.md) / [`asset-update`](references/rabetbase-menu-asset-update.md) / [`delete`](references/rabetbase-menu-delete.md) / [`group-create`](references/rabetbase-menu-group-create.md) / [`group-update`](references/rabetbase-menu-group-update.md) / [`move`](references/rabetbase-menu-move.md) / [`regroup-start`](references/rabetbase-menu-regroup-start.md) |
|
|
423
426
|
| Async Tasks | [`task status`](references/rabetbase-task-status.md) |
|
|
424
427
|
| Notification Configuration | [`notification config-list`](references/rabetbase-notification-config-list.md) / [`notification config-create`](references/rabetbase-notification-config-mutations.md) / [`notification config-update`](references/rabetbase-notification-config-mutations.md) / [`notification config-delete`](references/rabetbase-notification-config-mutations.md) |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> 目标:根据 `rabetbase api pull` 返回的数据集事实,生成或更新浏览器子应用的 `src/api/api.ts` 与 `src/api/client.ts`,并保留项目已有的自定义写法。
|
|
4
4
|
>
|
|
5
|
-
> CLI
|
|
5
|
+
> CLI 默认不覆盖 TypeScript。`api pull` 只保证:刷新 `sdk-config.ts`、返回 `data.models`,并在文件缺失时写入 Cookie-first 脚手架。已有文件由本指南更新;只有用户明确要求放弃本地定制并完整重建时,才使用 `--force --yes`。
|
|
6
6
|
|
|
7
7
|
## 何时执行
|
|
8
8
|
|
|
@@ -19,21 +19,24 @@
|
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
rabetbase api pull --format compress
|
|
22
|
-
→
|
|
22
|
+
→ 单应用读 data;项目应用清单逐项读 data.apps[]
|
|
23
|
+
→ 读取每项的 models / configName / isDefaultConfig / files / needsAgentMerge
|
|
23
24
|
→ 读已有 api.ts、client.ts、sdk-config.ts(含 {prefix}-api.ts / {prefix}-client.ts)
|
|
24
25
|
→ 按事实更新 models,保留本地 extras
|
|
25
26
|
→ 不要改已经正确的 createClient({ apiConfigName, ...LOVRABET_SDK_CONFIG })
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
1. 执行 `rabetbase api pull --format compress`(需要人类可读缩进时用 `--format json`)。
|
|
29
|
-
|
|
30
|
+
- 不要自动添加 `--force`。
|
|
31
|
+
- 只有用户明确要求丢弃本地 `api.ts` / `client.ts` 定制并完整重建时,才执行 `rabetbase api pull --force --yes --format compress`;此时根据返回的 `files.*.action` 回查是否为 `overwritten`。
|
|
32
|
+
2. 直接单应用结果使用 `data.models`;项目应用清单结果逐项使用 `data.apps[].models`。不要手写或猜测 `datasetCode`。也可用 `rabetbase api list --format compress` 核对目录,但写文件以 pull 返回的 models 为准。
|
|
30
33
|
3. 先读现有文件再写:
|
|
31
34
|
- 默认单应用:`src/api/api.ts`、`src/api/client.ts`、`src/api/sdk-config.ts`
|
|
32
35
|
- 多应用非 default:`{name}-api.ts` / `{name}-client.ts`(`data.files.api.path` / `data.files.client.path`)
|
|
33
36
|
4. `sdk-config.ts` 由 CLI 维护(`data.files.sdkConfig.action === "refreshed"`),不要往里面写 `cookie` / `accessKey` / `token`。
|
|
34
37
|
5. 看 `data.needsAgentMerge` 和 `data.files.*.action`,**不要**用已删除的 `wroteScaffold`:
|
|
35
38
|
- `needsAgentMerge === false` 且 `api`/`client` 均为 `created` 或 `overwritten`:脚手架已按当前 `models` 写好,只需检查项目 extras。
|
|
36
|
-
- `needsAgentMerge === true`:至少有一个 TypeScript 文件被 **preserved
|
|
39
|
+
- `needsAgentMerge === true`:至少有一个 TypeScript 文件被 **preserved**。先比较本地配置与返回事实,只在有差异时合并;即使 `client` 刚 `created`,也不能据此跳过对已保留 `api.ts` 的检查。
|
|
37
40
|
6. 默认应用:`data.isDefaultConfig === true`,`data.configName === "default"`,代码里用 `CONFIG_NAMES.DEFAULT`。
|
|
38
41
|
7. 具名应用:`data.isDefaultConfig === false`,`data.configName` 是不含引号的名字(如 `order`),`registerModels(..., "order")` 与 `apiConfigName: "order"`。不要把 `configName` 再包一层引号。
|
|
39
42
|
|
|
@@ -51,7 +54,7 @@ rabetbase api pull --format compress
|
|
|
51
54
|
export const LOVRABET_SDK_CONFIG = {} as const;
|
|
52
55
|
```
|
|
53
56
|
|
|
54
|
-
|
|
57
|
+
默认节点保持空对象;其他官方节点和企业独立部署统一写入最终 `runtimeDomain`。不要手改成认证字段。项目模板所需的完整公开 Domain 与资源策略由独立命令 `rabetbase project domain-routing-sync` 写入项目根目录的 `rabetbase.domain-routing.json`。
|
|
55
58
|
|
|
56
59
|
### api.ts
|
|
57
60
|
|
|
@@ -137,11 +140,10 @@ export const lovrabetClient = createClient({
|
|
|
137
140
|
| `configName` | `"default"` 或具名应用名(不含 TS 引号) |
|
|
138
141
|
| `isDefaultConfig` | 默认应用为 `true` |
|
|
139
142
|
| `models[]` | `datasetCode` / `tableName` / `name` / `alias` |
|
|
140
|
-
| `sdkRouting` | `{
|
|
141
|
-
| `projectRouting` | `{ path, manifest }`,最终公开 Domain 与资源策略 |
|
|
143
|
+
| `sdkRouting` | `{ runtimeDomain?: string }` |
|
|
142
144
|
| `files.api` / `files.client` / `files.sdkConfig` | `{ path, action }`;`action` 为 `created` / `overwritten` / `preserved` / `refreshed` |
|
|
143
145
|
| `needsAgentMerge` | 任一 TypeScript 被 `preserved` 时为 `true`,必须合并 `models` |
|
|
144
146
|
| `apiFilePath` / `clientFilePath` / `sdkConfigPath` | 与 `files.*.path` 相同,兼容路径字段 |
|
|
145
147
|
| `modelCount` / `datasetCount` | 模型数量 |
|
|
146
148
|
|
|
147
|
-
多应用时 `data.apps[]`
|
|
149
|
+
多应用时 `data.apps[]` 为上述对象的数组。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# api pull
|
|
2
2
|
|
|
3
|
-
拉取当前 App 下所有数据集(Dataset)的元信息,刷新 `src/api/sdk-config.ts
|
|
3
|
+
拉取当前 App 下所有数据集(Dataset)的元信息,刷新 `src/api/sdk-config.ts`,并在 `api.ts` / `client.ts` **缺失时**写入 Cookie-first 脚手架。项目公开 Domain 路由由 [`project domain-routing-sync`](rabetbase-project-domain-routing-sync.md) 独立维护。
|
|
4
4
|
|
|
5
|
-
已有 TypeScript
|
|
5
|
+
已有 TypeScript 默认**不会被覆盖**。Agent 必须用返回的 `data.models` 按 [`sdk-client-generation.md`](../guides/sdk-client-generation.md) 更新 `api.ts` / `client.ts`。人类明确要放弃本地定制并重新生成完整脚手架时,可使用 `--force --yes`。
|
|
6
6
|
|
|
7
7
|
## 命令
|
|
8
8
|
|
|
@@ -13,6 +13,9 @@ rabetbase api pull --format compress
|
|
|
13
13
|
# 指定输出目录
|
|
14
14
|
rabetbase api pull --output ./src/generated/api/ --format compress
|
|
15
15
|
|
|
16
|
+
# 放弃本地定制,按最新 Dataset 事实整体重建 TypeScript
|
|
17
|
+
rabetbase api pull --force --yes --format compress
|
|
18
|
+
|
|
16
19
|
# 多应用:默认只解析「项目级」apps;与全局合并配置一起拉取时加 --global
|
|
17
20
|
rabetbase api pull --global --format compress
|
|
18
21
|
|
|
@@ -27,6 +30,7 @@ rabetbase api pull --appcode app-order-001 --format compress
|
|
|
27
30
|
|------|------|
|
|
28
31
|
| `--output <dir>` | 输出目录,默认 `./src/api/` |
|
|
29
32
|
| `--global` | 多应用时显式从「全局+项目」双层解析 `apps`;默认仅项目级 `apps` |
|
|
33
|
+
| `--force` | 整体替换已有 `api.ts` / `client.ts`;必须同时传 `--yes`,本地定制会丢失 |
|
|
30
34
|
| `--app <name>` | 多应用模式下,指定应用名称 |
|
|
31
35
|
| `--appcode <code>` | 直接指定 appcode,跳过配置查找 |
|
|
32
36
|
| `--format compress\|json` | 结构化信封。Agent 应读 `data.models`,不要刮 stderr |
|
|
@@ -48,14 +52,13 @@ rabetbase api pull --appcode app-order-001 --format compress
|
|
|
48
52
|
|
|
49
53
|
| 文件 | 行为 |
|
|
50
54
|
|------|------|
|
|
51
|
-
| `sdk-config.ts` |
|
|
52
|
-
|
|
|
53
|
-
| `<prefix>-
|
|
54
|
-
| `<prefix>-client.ts` | 文件缺失时写入 Cookie-first `createClient`;已存在则跳过 |
|
|
55
|
+
| `sdk-config.ts` | **每次刷新**。只含必要的最终 `runtimeDomain`,不含凭证 |
|
|
56
|
+
| `<prefix>-api.ts` | 文件缺失时写入脚手架(含当前 `models`);已存在时默认跳过,`--force` 时整体替换 |
|
|
57
|
+
| `<prefix>-client.ts` | 文件缺失时写入 Cookie-first `createClient`;已存在时默认跳过,`--force` 时整体替换 |
|
|
55
58
|
|
|
56
59
|
默认 `prefix` 为空(单应用),多应用非 default 应用使用应用名作为 prefix。
|
|
57
60
|
|
|
58
|
-
`project create` 在拷贝空 demo 脚手架后会覆盖写入一次 TypeScript,以便带上真实 models
|
|
61
|
+
`project create` 在拷贝空 demo 脚手架后会覆盖写入一次 TypeScript,以便带上真实 models。首次拉取失败时,恢复提示会要求执行 `rabetbase api pull --force --yes`,避免占位脚手架被继续保留。日常 `api pull` 遇到已有 `api.ts` / `client.ts` 时跳过,只刷新 `sdk-config.ts` 并返回 Dataset 事实。
|
|
59
62
|
|
|
60
63
|
## 输出(单应用 `data`)
|
|
61
64
|
|
|
@@ -65,14 +68,13 @@ rabetbase api pull --appcode app-order-001 --format compress
|
|
|
65
68
|
| `configName` | `"default"` 或具名应用名(不含 TS 引号) |
|
|
66
69
|
| `isDefaultConfig` | 默认应用为 `true` |
|
|
67
70
|
| `models[]` | `datasetCode` / `tableName` / `name` / `alias` |
|
|
68
|
-
| `sdkRouting` | `{
|
|
69
|
-
| `projectRouting` | `{ path, manifest }`,manifest 为最终公开路由清单 |
|
|
71
|
+
| `sdkRouting` | `{ runtimeDomain?: string }` |
|
|
70
72
|
| `files.api` / `files.client` / `files.sdkConfig` | `{ path, action }`:`created` / `overwritten` / `preserved` / `refreshed` |
|
|
71
|
-
| `needsAgentMerge` | 任一 TypeScript 被 `preserved` 时为 `true
|
|
73
|
+
| `needsAgentMerge` | 任一 TypeScript 被 `preserved` 时为 `true`;这是本地检查提示,不表示文件一定存在差异 |
|
|
72
74
|
| `apiFilePath` / `clientFilePath` / `sdkConfigPath` | 与 `files.*.path` 相同 |
|
|
73
75
|
| `modelCount` / `datasetCount` | 模型数量 |
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
项目使用 `apps` 清单解析时,`data` 为 `{ apps, succeeded, failed }`,每个 `data.apps[]` 元素都使用上表结构。因此 Dataset 事实从直接单应用结果的 `data.models` 读取,或从项目应用清单结果的 `data.apps[].models` 读取;以实际信封为准。
|
|
76
78
|
|
|
77
79
|
## 生成标识符
|
|
78
80
|
|
|
@@ -94,6 +96,9 @@ rabetbase api pull --app order --format compress
|
|
|
94
96
|
|
|
95
97
|
# 独立输出目录
|
|
96
98
|
rabetbase api pull --output ./src/generated/api/ --format compress
|
|
99
|
+
|
|
100
|
+
# 仅在明确放弃本地 TypeScript 定制时整体重建
|
|
101
|
+
rabetbase api pull --force --yes --format compress
|
|
97
102
|
```
|
|
98
103
|
|
|
99
104
|
更新已有 TypeScript:见 [`sdk-client-generation.md`](../guides/sdk-client-generation.md)。
|
|
@@ -128,7 +128,7 @@ rabetbase workspace remove product --yes
|
|
|
128
128
|
| `pageSize` | number | — | 默认分页大小,用于 `sql list` 等分页命令 |
|
|
129
129
|
| `riskLevel` | string | `"write"` | 允许执行的最高风险等级。可选值:`read`、`write`、`high-risk-write` |
|
|
130
130
|
| `apiDir` | string | `"./src/api"` | `api pull` 生成代码的输出目录 |
|
|
131
|
-
| `region` | string | `"cn"`(省略) | 官方节点快捷配置:当前开放 `cn`、`id`;历史 `global`
|
|
131
|
+
| `region` | string | `"cn"`(省略) | 官方节点快捷配置:当前开放 `cn`、`id`;历史 `global` 配置仅保留读取兼容。显式未知值会阻止业务命令回落默认节点,先用 `rabetbase doctor` 定位后修复 |
|
|
132
132
|
| `template_base_url` | string | 平台默认 CDN | 模板 CDN 基础 URL,一般无需修改 |
|
|
133
133
|
| `defaultApp` | string | — | 多应用模式下的默认应用名称;单应用省略 |
|
|
134
134
|
| `apps` | object | — | 多应用配置。key 为应用名,value 为 AppProfile(见下方) |
|
|
@@ -327,7 +327,7 @@ rabetbase config set --key region --value id --global
|
|
|
327
327
|
rabetbase config init --domain-config ./lovrabet-domains.json
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
-
|
|
330
|
+
推荐使用 `lovrabet-routing/v1`,完整声明 `userDomain`、`apiDomain`、`runtimeDomain`、`skillDomain`、`kbDomain`、`appDomain`、`cdn.libraries` 与 `cdn.lovrabet`,并可选声明成对出现的 `localDomain`、`certificateDomain`。Domain 默认写成共用 HTTPS 字符串,确有差异时可按消费者覆盖。旧扁平 Domain 文件仍兼容。完整行为与命令行 flags 见 [`rabetbase config init`](rabetbase-init.md)。
|
|
331
331
|
|
|
332
332
|
也可以逐项覆盖:
|
|
333
333
|
|
|
@@ -341,4 +341,4 @@ rabetbase config set --key kbDomain --value https://your-kb.example.com --global
|
|
|
341
341
|
rabetbase config set --key appDomain --value https://your-app.example.com --global
|
|
342
342
|
```
|
|
343
343
|
|
|
344
|
-
官方模式:`region` 内置 Routing Profile,默认 `cn`,配置文件可省略;当前新配置只开放 `cn`、`id`,`id` 需保存对应 region。历史文件中的 `global` 仍可读取,但不能通过 `config init` 或 `config set`
|
|
344
|
+
官方模式:`region` 内置 Routing Profile,默认 `cn`,配置文件可省略;当前新配置只开放 `cn`、`id`,`id` 需保存对应 region。历史文件中的 `global` 仍可读取,但不能通过 `config init` 或 `config set` 新写入。每个官方节点直接配置最终 `cdn.libraries` 与 `cdn.lovrabet`,因此可按节点使用独立 CDN;中国大陆当前使用 AliCDN,印尼当前使用 Cloudflare cdnjs。企业独立部署模式保存显式 Domain 与 CDN。项目级配置可覆盖全局配置;默认项目合并会继承全局节点配置。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# DATABASE
|
|
2
|
+
|
|
3
|
+
> 仅记录当前应用特有、稳定,且无法从实时数据库结构、约束、索引、字段注释及通用数据库约定可靠推断的业务事实。删除不适用条目;完成后的文件建议不超过 5000 个 Unicode 字符,重要规则优先。物理结构以实时元数据为准,业务语义以已确认业务合同为准。
|
|
4
|
+
|
|
5
|
+
## BUSINESS_DOMAIN
|
|
6
|
+
|
|
7
|
+
- 系统定位:{一句话说明系统服务的业务与核心目标}。
|
|
8
|
+
- 业务边界:{明确包含与不包含的业务范围}。
|
|
9
|
+
- 数据隔离:{租户、组织、门店或其他隔离维度及判定字段}。
|
|
10
|
+
- 权威来源:{主数据、交易事实或配置分别以哪些表或外部系统为准}。
|
|
11
|
+
- 业务分组:{表前缀、模块或领域之间的稳定映射}。
|
|
12
|
+
|
|
13
|
+
## ENTITY_DICTIONARY
|
|
14
|
+
|
|
15
|
+
- `<table>`:业务对象={名称};类型={coreEntity/dictionaryTable/config/other};职责={该表保存什么事实};主记录判定={条件或字段}。
|
|
16
|
+
- `<child_table>`:从属于 `<parent_table>`;生命周期={随主对象创建、独立维护或历史保留};一条记录表示={业务含义}。
|
|
17
|
+
- `<snapshot_or_log_table>`:类型={snapshot/log/history};固化时点={事件};用途={审计、展示或计算};不作为={不应承担的当前事实来源}。
|
|
18
|
+
|
|
19
|
+
## COLUMN_SEMANTIC
|
|
20
|
+
|
|
21
|
+
- `<table>.<column>`:含义={业务含义};值域/单位={枚举、金额单位、时区等};空值={未设置、未知或不适用}。
|
|
22
|
+
- 系统字段:创建时间={field};修改时间={field};创建人={field};修改人={field};逻辑删除={field, 正常值/删除值}。
|
|
23
|
+
- 人员标识:`<table>.<column>` 表示 {employee/account/customer/external id},关联目标={table.column 或外部系统}。
|
|
24
|
+
- 状态流:`<table>.<status_column>` 的关键状态={value: meaning};终态={value};允许回退={条件}。
|
|
25
|
+
- 冗余或快照字段:`<table>.<column>` 来源={table.column/计算规则};刷新时机={事件};分析时优先级={源字段或快照字段}。
|
|
26
|
+
|
|
27
|
+
## RELATION_RULE
|
|
28
|
+
|
|
29
|
+
- `<source_table>.<source_column> -> <target_table>.<target_column>`;关系={many-to-one/one-to-one};唯一性依据={PK/unique index};展示字段={target.column}。
|
|
30
|
+
- `<source_table>.(<column_a>, <column_b>) -> <target_table>.(<column_x>, <column_y>)`;关系={复合关联含义};成立条件={过滤条件}。
|
|
31
|
+
- `<source_table>.<code_column> -> <dictionary_table>.<code_column>`;字典分类={类型字段及取值};展示字段={name_column}。
|
|
32
|
+
|
|
33
|
+
### 禁止关联
|
|
34
|
+
|
|
35
|
+
- `<table>.<column>` 是多态引用;由 `<type_column>` 判定目标:`<value> -> <target_table>`;缺少类型条件时不得直接关联。
|
|
36
|
+
- `<table>.<column>` 是 {快照文本/ID 列表/外部标识},不得按普通外键关联;正确解释={规则}。
|