@lovrabet/rabetbase-cli 2.3.2 → 2.3.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.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-selector.js +1 -1
- package/lib/commands/common/flags.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 -0
- 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/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/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/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/update.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/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/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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.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/save.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/workspace/index.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-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/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.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x203488,_0x5a8db6){const _0x3de523=a127_0x1751,_0x34dc13=_0x203488();while(!![]){try{const _0xda1393=parseInt(_0x3de523(0x18d))/0x1+-parseInt(_0x3de523(0x194))/0x2+-parseInt(_0x3de523(0x1a4))/0x3*(-parseInt(_0x3de523(0x18f))/0x4)+parseInt(_0x3de523(0x197))/0x5*(-parseInt(_0x3de523(0x18c))/0x6)+-parseInt(_0x3de523(0x1a0))/0x7+-parseInt(_0x3de523(0x19e))/0x8+-parseInt(_0x3de523(0x1a8))/0x9*(-parseInt(_0x3de523(0x196))/0xa);if(_0xda1393===_0x5a8db6)break;else _0x34dc13['push'](_0x34dc13['shift']());}catch(_0x5564f6){_0x34dc13['push'](_0x34dc13['shift']());}}}(a127_0xba5d,0xb5163));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a127_0x9fdc2d from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';function a127_0xba5d(){const _0x36b16d=['4907274ShShrc','436995BqGuoZ','production','2652688FxTvzy','\x20→\x20.rabetbase.json','log','env','apps','2847814nfOsAY','Migration\x20cancelled.\x20Run\x20`','11690cYNewQ','5SaSBsC','Please\x20enter\x20App\x20Code:','version','appcode','1.0.0','toLocaleString','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','3948960nMXTSY','\x20api\x20generate\x27\x20and\x20\x27','6167231IAdATG','green','cyan','join','3ZByIbI','trim','\x20project\x20init`\x20to\x20start\x20fresh.','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','25083eDqJFC','../..','\x20api\x20pull\x27','?\x20(Old\x20file\x20→\x20*.bak)','app','Upgrade\x20it\x20to\x20','info','App\x20Code\x20cannot\x20be\x20empty','defaultApp','init','\x20\x20appcode:\x20','.rabetbase.json','cwd','package.json','keys','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','bold','\x20\x20Apps:\x20','setLogPath','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','\x20\x20Default:\x20','✓\x20Upgraded\x20','string','utf8','Invalid\x20App\x20Code','从旧配置文件升级成功'];a127_0xba5d=function(){return _0x36b16d;};return a127_0xba5d();}function a127_0x1751(_0x474d5e,_0x3027b1){_0x474d5e=_0x474d5e-0x180;const _0xba5d04=a127_0xba5d();let _0x175193=_0xba5d04[_0x474d5e];return _0x175193;}import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x2c8fb5){const _0x2c5f57=a127_0x1751,{appcode:_0x4606f0,env:_0x56a5d8,autoYes:_0x5edfb1}=_0x2c8fb5,_0xc55137=process[_0x2c5f57(0x1b4)]();if(getProjectConfigPath())throw new Error(_0x2c5f57(0x1a7));let _0x4d6bd6;for(const _0x48c0a4 of LEGACY_CONFIG_NAMES){const _0x9d4634=resolve(_0xc55137,_0x48c0a4);if(existsSync(_0x9d4634)){_0x4d6bd6=_0x9d4634;break;}}if(_0x4d6bd6){let _0x521af3={};try{_0x521af3=JSON['parse'](readFileSync(_0x4d6bd6,'utf8'));}catch{}const _0x48c00f=basename(_0x4d6bd6),_0x32b2d2=_0x521af3?.['appcode']||_0x521af3?.[_0x2c5f57(0x1ac)];let _0x41cb64=_0x5edfb1;!_0x5edfb1&&(console['log'](a127_0x9fdc2d['yellow'](_0x2c5f57(0x19d)+a127_0x9fdc2d[_0x2c5f57(0x182)](_0x48c00f))),_0x32b2d2&&console[_0x2c5f57(0x191)](a127_0x9fdc2d[_0x2c5f57(0x1a2)](_0x2c5f57(0x1b2)+_0x32b2d2)),_0x41cb64=await confirm({'message':_0x2c5f57(0x1ad)+a127_0x9fdc2d['bold'](_0x2c5f57(0x1b3))+_0x2c5f57(0x1ab),'default':!![]}));if(!_0x41cb64){console[_0x2c5f57(0x191)](_0x2c5f57(0x195)+CLI_BIN_NAME+_0x2c5f57(0x1a6));return;}const _0x347a7f=resolve(_0xc55137,NEW_CONFIG_NAME),_0x536d18=getCliVersionFromPkg(),_0x49c99f=readRawConfig(),_0x3cfe7d=_0x4606f0||(typeof _0x521af3?.[_0x2c5f57(0x19a)]===_0x2c5f57(0x188)?_0x521af3['appcode']:undefined)||(typeof _0x521af3?.[_0x2c5f57(0x1ac)]==='string'?_0x521af3['app']:undefined)||await askAppcode(),_0x122005=typeof _0x521af3?.[_0x2c5f57(0x192)]===_0x2c5f57(0x188)?_0x521af3[_0x2c5f57(0x192)]:typeof _0x49c99f[_0x2c5f57(0x192)]===_0x2c5f57(0x188)?_0x49c99f['env']:_0x2c5f57(0x18e),_0x2ae331=buildCanonicalProjectConfig({..._0x49c99f,..._0x521af3},{'appCodes':[_0x3cfe7d],'env':_0x122005,'metadata':{'version':_0x536d18,'migratedAt':new Date()[_0x2c5f57(0x19c)](),'migratedFrom':_0x4d6bd6}});writeConfigFile(_0x347a7f,_0x2ae331);const _0x4ce5e7=_0x4d6bd6+'.bak';renameSync(_0x4d6bd6,_0x4ce5e7),logger[_0x2c5f57(0x184)](_0xc55137),logger[_0x2c5f57(0x1ae)]('init',_0x2c5f57(0x18b),{'from':_0x4d6bd6,'to':_0x347a7f,'appcode':_0x3cfe7d,'env':_0x2ae331[_0x2c5f57(0x192)]}),console[_0x2c5f57(0x191)](a127_0x9fdc2d[_0x2c5f57(0x1a1)](_0x2c5f57(0x187)+_0x48c00f+_0x2c5f57(0x190))),console[_0x2c5f57(0x191)](a127_0x9fdc2d['cyan'](_0x2c5f57(0x183)+Object[_0x2c5f57(0x180)](_0x2ae331[_0x2c5f57(0x193)]||{})[_0x2c5f57(0x1a3)](',\x20'))),console[_0x2c5f57(0x191)](a127_0x9fdc2d[_0x2c5f57(0x1a2)](_0x2c5f57(0x186)+_0x2ae331[_0x2c5f57(0x1b0)])),console['log'](a127_0x9fdc2d['gray']('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x48c00f+'.bak'));return;}const _0x217661=_0x4606f0||await askAppcode(),_0x7ee685=resolve(_0xc55137,NEW_CONFIG_NAME),_0x40c56b=getCliVersionFromPkg(),_0x22d7a5=readRawConfig(),_0x50c762=typeof _0x22d7a5[_0x2c5f57(0x192)]===_0x2c5f57(0x188)?_0x22d7a5[_0x2c5f57(0x192)]:undefined,_0x25a008=buildCanonicalProjectConfig({},{'appCodes':[_0x217661],'env':_0x56a5d8||_0x50c762||_0x2c5f57(0x18e),'metadata':{'version':_0x40c56b,'createdAt':new Date()[_0x2c5f57(0x19c)]()}});writeConfigFile(_0x7ee685,_0x25a008),logger['setLogPath'](_0xc55137),logger[_0x2c5f57(0x1ae)](_0x2c5f57(0x1b1),'初始化项目配置文件成功',{'appcode':_0x217661,'env':_0x25a008[_0x2c5f57(0x192)],'version':_0x25a008[_0x2c5f57(0x199)],'configPath':_0x7ee685}),console[_0x2c5f57(0x191)](a127_0x9fdc2d['green'](_0x2c5f57(0x185))),console[_0x2c5f57(0x191)](a127_0x9fdc2d[_0x2c5f57(0x1a2)](_0x2c5f57(0x183)+Object[_0x2c5f57(0x180)](_0x25a008[_0x2c5f57(0x193)]||{})['join'](',\x20'))),console[_0x2c5f57(0x191)](a127_0x9fdc2d[_0x2c5f57(0x1a2)](_0x2c5f57(0x186)+_0x25a008[_0x2c5f57(0x1b0)])),console['log'](_0x2c5f57(0x181)+CLI_BIN_NAME+_0x2c5f57(0x19f)+CLI_BIN_NAME+_0x2c5f57(0x1aa));}function askAppcode(){const _0x3a2886=a127_0x1751;return input({'message':_0x3a2886(0x198),'validate':_0x1b6ba2=>{const _0x53da87=_0x3a2886;if(!_0x1b6ba2[_0x53da87(0x1a5)]())return _0x53da87(0x1af);const {valid:_0x2520b6,message:_0x41a29a}=validateAppcode(_0x1b6ba2[_0x53da87(0x1a5)]());return _0x2520b6||_0x41a29a||_0x53da87(0x18a);}});}function getCliVersionFromPkg(){const _0x33f279=a127_0x1751;try{const _0x405d52=fileURLToPath(import.meta.url),_0x544817=resolve(dirname(_0x405d52),_0x33f279(0x1a9)),_0x47fe57=JSON['parse'](readFileSync(resolve(_0x544817,_0x33f279(0x1b5)),_0x33f279(0x189)));return _0x47fe57[_0x33f279(0x199)]||_0x33f279(0x19b);}catch{return _0x33f279(0x19b);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x313c66,_0x1fedc2){const _0x18d6ac=a127_0x2442,_0x4b9a86=_0x313c66();while(!![]){try{const _0x7c693f=-parseInt(_0x18d6ac(0x1ac))/0x1*(-parseInt(_0x18d6ac(0x193))/0x2)+-parseInt(_0x18d6ac(0x1c1))/0x3+parseInt(_0x18d6ac(0x20d))/0x4+parseInt(_0x18d6ac(0x196))/0x5*(parseInt(_0x18d6ac(0x1bc))/0x6)+-parseInt(_0x18d6ac(0x201))/0x7*(parseInt(_0x18d6ac(0x1fc))/0x8)+parseInt(_0x18d6ac(0x1ef))/0x9*(-parseInt(_0x18d6ac(0x19e))/0xa)+-parseInt(_0x18d6ac(0x1b5))/0xb*(-parseInt(_0x18d6ac(0x1ab))/0xc);if(_0x7c693f===_0x1fedc2)break;else _0x4b9a86['push'](_0x4b9a86['shift']());}catch(_0x2bbb29){_0x4b9a86['push'](_0x4b9a86['shift']());}}}(a127_0x3126,0xa4c82));function a127_0x2442(_0x8b0039,_0x2370a8){_0x8b0039=_0x8b0039-0x193;const _0x31269e=a127_0x3126();let _0x244275=_0x31269e[_0x8b0039];return _0x244275;}import a127_0x3b63cd from'chalk';import a127_0x4201fb from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x17b7d2=>_0x17b7d2!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x18ba1e){const _0x3d2438=a127_0x2442,_0x488bc8=[];for(const _0x4b3ec5 of Object[_0x3d2438(0x1a1)](CORE_IDE_CONFIGS)){if(_0x4b3ec5['files'])for(const _0x2cc7ff of _0x4b3ec5[_0x3d2438(0x1d1)]){_0x488bc8['push'](resolve(_0x18ba1e,_0x2cc7ff['path']));}}return _0x488bc8;}function analyse(_0x820369){const _0x27968c=a127_0x2442;let _0x38dc1a=null;const _0x57bd79=resolve(_0x820369,NEW_CONFIG_NAME),_0x3bbd37=existsSync(_0x57bd79);for(const _0x2ac0f2 of LEGACY_CONFIG_NAMES){const _0x3ab064=resolve(_0x820369,_0x2ac0f2);if(existsSync(_0x3ab064)){const _0x56f322=readConfigFile(_0x3ab064),_0x52abc9=Object[_0x27968c(0x1e4)](_0x56f322)[_0x27968c(0x204)](_0x5f11c6=>typeof _0x56f322[_0x5f11c6]!==_0x27968c(0x195));_0x38dc1a={'oldPath':_0x3ab064,'hasNewConfig':_0x3bbd37,'fields':_0x52abc9};break;}}const _0x5573be=[],_0x10665f=resolve(_0x820369,_0x27968c(0x1e8));if(existsSync(_0x10665f))_0x5573be[_0x27968c(0x1eb)](_0x10665f);const _0x48a3a6=resolve(_0x820369,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x48a3a6))_0x5573be[_0x27968c(0x1eb)](_0x48a3a6);const _0x55a148=resolve(_0x820369,_0x27968c(0x1f1));if(existsSync(_0x55a148))_0x5573be['push'](_0x55a148);for(const _0x54983f of collectIdeSkillFiles(_0x820369)){if(existsSync(_0x54983f))_0x5573be['push'](_0x54983f);}let _0x280186=null;const _0x1b6c71=resolve(_0x820369,_0x27968c(0x1cd));if(existsSync(_0x1b6c71))try{const _0x4c0401=JSON[_0x27968c(0x1ec)](readFileSync(_0x1b6c71,_0x27968c(0x1df)));if(_0x4c0401?.[_0x27968c(0x1c5)]&&typeof _0x4c0401[_0x27968c(0x1c5)]===_0x27968c(0x1c9)){const _0x10e4c9=[];for(const [_0x79849a,_0x3c1c40]of Object['entries'](_0x4c0401[_0x27968c(0x1c5)])){const _0x564395=_0x3c1c40;_0x564395?.[_0x27968c(0x1c2)]&&Array[_0x27968c(0x1d6)](_0x564395[_0x27968c(0x1c2)])&&_0x564395[_0x27968c(0x1c2)][_0x27968c(0x1e0)](_0x21e27c=>typeof _0x21e27c==='string'&&_0x21e27c['includes'](_0x27968c(0x19b)))&&_0x10e4c9['push'](_0x79849a);}_0x10e4c9[_0x27968c(0x1fe)]>0x0&&(_0x280186={'path':_0x1b6c71,'keys':_0x10e4c9});}}catch{}const _0x3739bf=_0x5573be[_0x27968c(0x1fe)]>0x0||_0x38dc1a!==null;let _0x19f063=null;const _0x1ea5e2=resolve(_0x820369,'package.json');if(existsSync(_0x1ea5e2))try{const _0x3892d0=JSON['parse'](readFileSync(_0x1ea5e2,_0x27968c(0x1df)));for(const _0x3c3d35 of[_0x27968c(0x1da),_0x27968c(0x1b0)]){const _0x1fb572=_0x3892d0?.[_0x3c3d35]?.[_0x27968c(0x1b9)];if(typeof _0x1fb572===_0x27968c(0x1b2)){_0x1fb572!=='latest'&&(_0x19f063={'pkgPath':_0x1ea5e2,'currentVersion':_0x1fb572,'field':_0x3c3d35});break;}}}catch{}return{'configMigration':_0x38dc1a,'oldArtifacts':_0x5573be,'oldMcpConfig':_0x280186,'needsSkillSwap':_0x3739bf,'sdkUpgrade':_0x19f063};}function printReport(_0xa5de9c){const _0x3e2c95=a127_0x2442,{configMigration:_0x1d4ec7,oldArtifacts:_0x5324e9,oldMcpConfig:_0x465551,needsSkillSwap:_0x1b9926}=_0xa5de9c;console[_0x3e2c95(0x1e7)](''),console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1b7)](_0x3e2c95(0x1a8))),console[_0x3e2c95(0x1e7)]('');_0x1d4ec7?(console['log'](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1ee))+('\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1ca)](_0x1d4ec7[_0x3e2c95(0x1c4)]))),console[_0x3e2c95(0x1e7)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x1d4ec7[_0x3e2c95(0x1b3)]?a127_0x3b63cd['green']('already\x20exists\x20(will\x20merge)'):a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x200)))),console['log'](_0x3e2c95(0x198)+_0x1d4ec7[_0x3e2c95(0x1ea)][_0x3e2c95(0x1aa)](',\x20')),console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1af))):console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1ee))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)]('no\x20legacy\x20config\x20found'));console[_0x3e2c95(0x1e7)]('');if(_0x5324e9['length']>0x0){console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1d8)));for(const _0x1ad67d of _0x5324e9){console['log']('\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1ed)](_0x3e2c95(0x1ae))+'\x20\x20'+_0x1ad67d);}console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1f2));}else console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1d8))+'\x20\x20'+a127_0x3b63cd['gray'](_0x3e2c95(0x19f)));console[_0x3e2c95(0x1e7)]('');_0x465551?(console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1b1))+('\x20\x20'+a127_0x3b63cd['yellow'](_0x465551['path'])+'\x20→\x20keys:\x20'+_0x465551[_0x3e2c95(0x1e4)]['join'](',\x20'))),console[_0x3e2c95(0x1e7)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1b1))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x207)));console['log'](''),console['log'](a127_0x3b63cd['cyan'](_0x3e2c95(0x1a3))+('\x20\x20'+(_0x1b9926?a127_0x3b63cd[_0x3e2c95(0x1ca)]('needed'):a127_0x3b63cd[_0x3e2c95(0x1bb)]('not\x20needed'))));_0x1b9926&&console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1f9)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3e2c95(0x1e7)]('');if(_0xa5de9c[_0x3e2c95(0x1dc)]){const {currentVersion:_0x50a4e4,field:_0x5a895f,pkgPath:_0x3bdeff}=_0xa5de9c['sdkUpgrade'];console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1f3))+('\x20\x20'+a127_0x3b63cd['yellow'](_0x3bdeff))),console[_0x3e2c95(0x1e7)]('\x20\x20Current\x20version\x20in\x20'+_0x5a895f+':\x20'+a127_0x3b63cd[_0x3e2c95(0x1ca)](_0x50a4e4)+_0x3e2c95(0x197)+a127_0x3b63cd['green'](_0x3e2c95(0x1ad))),console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1a0));}else console['log'](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1f3))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x1b4)));console[_0x3e2c95(0x1e7)]('');}function execConfigMigration(_0x5d6929,_0x26cc79){const _0x1773f2=a127_0x2442,{configMigration:_0x22bfb5}=_0x5d6929;if(!_0x22bfb5?.[_0x1773f2(0x1c4)])return{'step':0x1,'label':_0x1773f2(0x1e2),'ok':!![],'detail':_0x1773f2(0x1bd)};const _0x5165c1=readConfigFile(_0x22bfb5[_0x1773f2(0x1c4)]),_0x450977=resolve(_0x26cc79,NEW_CONFIG_NAME),_0x431ba0=_0x22bfb5[_0x1773f2(0x1b3)]?readConfigFile(_0x450977):{};for(const [_0x1e84a8,_0x2d4d75]of Object[_0x1773f2(0x206)](_0x5165c1)){!(_0x1e84a8 in _0x431ba0)&&(_0x431ba0[_0x1e84a8]=_0x2d4d75);}writeConfigFile(_0x450977,_0x431ba0);const _0x4c82a7=_0x22bfb5[_0x1773f2(0x1c4)]+'.bak';return renameSync(_0x22bfb5[_0x1773f2(0x1c4)],_0x4c82a7),{'step':0x1,'label':_0x1773f2(0x1e2),'ok':!![],'detail':_0x22bfb5[_0x1773f2(0x1c4)]+_0x1773f2(0x197)+_0x450977+_0x1773f2(0x1f6)+_0x4c82a7+')'};}function a127_0x3126(){const _0x4961ca=['Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Upgrade\x20@lovrabet/sdk','10080024qBWqhg','error','length','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','not\x20found\x20(will\x20create)','7wUjJCl','message','succeed','filter','no\x20matching\x20entry\x20found','entries','no\x20legacy\x20entry','Remove\x20old\x20skill','inherit','fail','lovrabet/lovrabet-skill\x20removed','\x20\x20Step\x20','101264NFEyrf','1267964KnljEZ','needsSkillSwap','undefined','26015HkvbYf','\x20→\x20','\x20\x20Fields\x20to\x20migrate:\x20','Install\x20new\x20skill','removed\x20','@lovrabet/dataset-mcp-server','stringify','cwd','70TtVCGr','none\x20found','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','values','path','Skill\x20swap:','oldMcpConfig','\x20\x20bun\x20install','yes','Step\x201/7:\x20Migrating\x20config...','===\x20Upgrade\x20Analysis\x20===','Step\x204/7:\x20MCP\x20config\x20—\x20','join','12pMNLCH','2NbTfTO','latest','FOUND','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','devDependencies','MCP\x20config:','string','hasNewConfig','not\x20found\x20or\x20already\x20at\x20latest','5270683xhbSOf','white','bold','Clean\x20MCP\x20config','@lovrabet/sdk','Step\x204/7:\x20Cleaning\x20MCP\x20config...','green','1386yHqcHL','skipped\x20(no\x20legacy\x20config)','isDirectory','[\x22@lovrabet/sdk\x22]:\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','1981002wnmFHJ','args','start','oldPath','mcpServers','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x205/7:\x20Removing\x20old\x20skill...','===\x20Upgrade\x20Summary\x20===','object','yellow','Remove\x20.lovrabet/','\x20\x20npm\x20install','.cursor/mcp.json','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Step\x201/7:\x20Config\x20migration\x20—\x20','files','detail','gray','Step\x206/7:\x20Installing\x20new\x20skill...','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','isArray','CANCEL','Legacy\x20artifacts:','cyan','dependencies','Upgrade\x20cancelled.','sdkUpgrade','done','Upgrade\x20completed\x20successfully!','utf8','some','oldArtifacts','Config\x20migration','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','keys','info','failed','log','.lovrabet','step','fields','push','parse','red','Config\x20file:','487341ZJCoQd','lovrabet/rabetbase\x20installed\x20globally','.claude/skills/lovrabet','\x20\x20Action:\x20delete','@lovrabet/sdk:','status','exit\x20','\x20(backup:\x20'];a127_0x3126=function(){return _0x4961ca;};return a127_0x3126();}function execRemoveOldArtifacts(_0xea2c98){const _0x50d3ae=a127_0x2442,_0x59c8e5=[];for(const _0x506fba of _0xea2c98){try{if(!existsSync(_0x506fba))continue;const _0x68bbb7=tryStat(_0x506fba);_0x68bbb7?.[_0x50d3ae(0x1be)]()?rmSync(_0x506fba,{'recursive':!![],'force':!![]}):unlinkSync(_0x506fba);}catch(_0x5dd553){_0x59c8e5[_0x50d3ae(0x1eb)](_0x506fba+':\x20'+_0x5dd553[_0x50d3ae(0x202)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x59c8e5[_0x50d3ae(0x1fe)]===0x0,'detail':_0x59c8e5['length']>0x0?_0xea2c98['length']-_0x59c8e5[_0x50d3ae(0x1fe)]+'/'+_0xea2c98['length']+'\x20removed\x20('+_0x59c8e5[_0x50d3ae(0x1aa)](';\x20')+')':_0xea2c98[_0x50d3ae(0x1fe)]+'\x20removed'};}function execCleanMcp(_0x29c2e7){const _0x29ef2c=a127_0x2442;if(!_0x29c2e7[_0x29ef2c(0x1a4)])return{'step':0x4,'label':_0x29ef2c(0x1b8),'ok':!![],'detail':'skipped'};try{const _0x3a53a9=readFileSync(_0x29c2e7['oldMcpConfig'][_0x29ef2c(0x1a2)],_0x29ef2c(0x1df)),_0x3c8ce1=JSON[_0x29ef2c(0x1ec)](_0x3a53a9);if(_0x3c8ce1?.['mcpServers']&&typeof _0x3c8ce1[_0x29ef2c(0x1c5)]==='object'){const _0x259da9=[];for(const [_0xb2ac5f,_0x1e5a78]of Object[_0x29ef2c(0x206)](_0x3c8ce1[_0x29ef2c(0x1c5)])){_0x1e5a78?.['args']&&Array[_0x29ef2c(0x1d6)](_0x1e5a78[_0x29ef2c(0x1c2)])&&_0x1e5a78[_0x29ef2c(0x1c2)]['some'](_0x3cf628=>typeof _0x3cf628==='string'&&_0x3cf628['includes']('@lovrabet/dataset-mcp-server'))&&_0x259da9[_0x29ef2c(0x1eb)](_0xb2ac5f);}for(const _0x5bd2dc of _0x259da9){delete _0x3c8ce1[_0x29ef2c(0x1c5)][_0x5bd2dc];}return _0x259da9[_0x29ef2c(0x1fe)]>0x0&&writeFileSync(_0x29c2e7['oldMcpConfig']['path'],JSON[_0x29ef2c(0x19c)](_0x3c8ce1,null,0x2)+'\x0a',_0x29ef2c(0x1df)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x29ef2c(0x19a)+_0x259da9['join'](',\x20')+'\x20from\x20'+_0x29c2e7[_0x29ef2c(0x1a4)][_0x29ef2c(0x1a2)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x29ef2c(0x205)};}catch(_0x1a4121){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x1a4121[_0x29ef2c(0x202)]};}}function execSkillsRemove(_0x3bbbc1,_0x17d16d){const _0x637aaf=a127_0x2442,_0x258b8e=runNpxSkillsRemove(_0x3bbbc1,{'stdio':_0x637aaf(0x209),'yes':_0x17d16d});return{'step':0x5,'label':_0x637aaf(0x208),'ok':_0x258b8e['ok'],'detail':_0x258b8e['ok']?_0x637aaf(0x20b):_0x258b8e[_0x637aaf(0x1fd)]??_0x637aaf(0x1f5)+_0x258b8e[_0x637aaf(0x1f4)]};}function execSkillsAdd(_0x15fd16,_0x45f16f){const _0x2f6804=a127_0x2442,_0x567b78=runNpxSkillsAddGlobal(_0x15fd16,'lovrabet/rabetbase',{'stdio':_0x2f6804(0x209),'yes':_0x45f16f});return{'step':0x6,'label':_0x2f6804(0x199),'ok':_0x567b78['ok'],'detail':_0x567b78['ok']?_0x2f6804(0x1f0):_0x567b78[_0x2f6804(0x1fd)]??_0x2f6804(0x1f5)+_0x567b78[_0x2f6804(0x1f4)]};}function execUpgradeSdk(_0x1309a9){const _0x308a20=a127_0x2442;if(!_0x1309a9['sdkUpgrade'])return{'step':0x7,'label':_0x308a20(0x1fb),'ok':!![],'detail':_0x308a20(0x1c6)};const {pkgPath:_0x279494,currentVersion:_0x3bbe43,field:_0x138595}=_0x1309a9[_0x308a20(0x1dc)];try{const _0x42c5f9=readFileSync(_0x279494,_0x308a20(0x1df)),_0x1bba68=JSON['parse'](_0x42c5f9);return _0x1bba68[_0x138595]['@lovrabet/sdk']=_0x308a20(0x1ad),writeFileSync(_0x279494,JSON[_0x308a20(0x19c)](_0x1bba68,null,0x2)+'\x0a',_0x308a20(0x1df)),{'step':0x7,'label':_0x308a20(0x1fb),'ok':!![],'detail':_0x138595+_0x308a20(0x1bf)+_0x3bbe43+'\x20→\x20latest'};}catch(_0x3cf764){return{'step':0x7,'label':_0x308a20(0x1fb),'ok':![],'detail':_0x3cf764['message']};}}function tryStat(_0x3cc8a9){try{return statSync(_0x3cc8a9);}catch{return undefined;}}function printSummary(_0x511cb3){const _0x23769f=a127_0x2442;console[_0x23769f(0x1e7)](''),console['log'](a127_0x3b63cd['bold'](_0x23769f(0x1c8))),console['log']('');for(const _0x489356 of _0x511cb3){const _0x31e897=_0x489356['ok']?a127_0x3b63cd[_0x23769f(0x1bb)]('OK'):a127_0x3b63cd[_0x23769f(0x1ed)]('FAIL');console[_0x23769f(0x1e7)]('\x20\x20'+_0x31e897+_0x23769f(0x20c)+_0x489356[_0x23769f(0x1e9)]+':\x20'+_0x489356['label']);if(_0x489356['detail'])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a127_0x3b63cd['gray'](_0x489356[_0x23769f(0x1d2)]));}console[_0x23769f(0x1e7)]('');}export async function upgradeApp(_0x428dbe,_0x2e3845){const _0x467d4d=a127_0x2442,_0x464c3b=process[_0x467d4d(0x19d)](),_0x5d2e32=analyse(_0x464c3b),_0x2b58b4=!_0x5d2e32['configMigration']&&_0x5d2e32[_0x467d4d(0x1e1)][_0x467d4d(0x1fe)]===0x0&&!_0x5d2e32['oldMcpConfig']&&!_0x5d2e32[_0x467d4d(0x194)]&&!_0x5d2e32['sdkUpgrade'];if(_0x2b58b4){console['log'](a127_0x3b63cd[_0x467d4d(0x1bb)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x5d2e32);const _0x9155e4=!!(_0x2e3845[_0x467d4d(0x1a6)]||_0x2e3845['Y']||_0x428dbe);if(!_0x9155e4)try{const _0x1bcc01=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x1bcc01){console[_0x467d4d(0x1e7)](a127_0x3b63cd['gray'](_0x467d4d(0x1db)));return;}}catch(_0x2e1fa5){if(_0x2e1fa5?.[_0x467d4d(0x202)]===_0x467d4d(0x1d7)){console['log'](a127_0x3b63cd[_0x467d4d(0x1d3)](_0x467d4d(0x1db)));return;}throw _0x2e1fa5;}const _0x231fa6=[],_0x433f6b=a127_0x4201fb({'text':_0x467d4d(0x1a7),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x33e28a=execConfigMigration(_0x5d2e32,_0x464c3b);_0x231fa6['push'](_0x33e28a),_0x433f6b[_0x33e28a['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1d0)+(_0x33e28a[_0x467d4d(0x1d2)]??(_0x33e28a['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x38aa95=resolve(_0x464c3b,_0x467d4d(0x1e8)),_0x108c46=a127_0x4201fb({'text':_0x467d4d(0x1f7),'color':'cyan'})[_0x467d4d(0x1c3)]();if(existsSync(_0x38aa95))try{rmSync(_0x38aa95,{'recursive':!![],'force':!![]}),_0x108c46[_0x467d4d(0x203)](_0x467d4d(0x1c0)),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':_0x467d4d(0x1cb),'ok':!![]});}catch(_0x1b05c1){_0x108c46[_0x467d4d(0x20a)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x1b05c1[_0x467d4d(0x202)]),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':_0x467d4d(0x1cb),'ok':![],'detail':_0x1b05c1[_0x467d4d(0x202)]});}else _0x108c46[_0x467d4d(0x1e5)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':'skipped'});const _0xd52b95=a127_0x4201fb({'text':_0x467d4d(0x1fa),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x46e957=execRemoveOldArtifacts(_0x5d2e32[_0x467d4d(0x1e1)]);_0x231fa6[_0x467d4d(0x1eb)](_0x46e957),_0xd52b95[_0x46e957['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1ce)+(_0x46e957[_0x467d4d(0x1d2)]??(_0x46e957['ok']?'done':_0x467d4d(0x1e6))));const _0x5ad15a=a127_0x4201fb({'text':_0x467d4d(0x1ba),'color':_0x467d4d(0x1d9)})['start'](),_0x1fccbb=execCleanMcp(_0x5d2e32);_0x231fa6[_0x467d4d(0x1eb)](_0x1fccbb),_0x5ad15a[_0x1fccbb['ok']?_0x467d4d(0x203):'fail'](_0x467d4d(0x1a9)+(_0x1fccbb[_0x467d4d(0x1d2)]??(_0x1fccbb['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x4b87fc=a127_0x4201fb({'text':_0x467d4d(0x1c7),'color':_0x467d4d(0x1d9)})['start'](),_0x1a7ecb=execSkillsRemove(_0x464c3b,_0x9155e4);_0x231fa6[_0x467d4d(0x1eb)](_0x1a7ecb),_0x4b87fc[_0x1a7ecb['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1d5)+(_0x1a7ecb[_0x467d4d(0x1d2)]??(_0x1a7ecb['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0xfe6cdd=a127_0x4201fb({'text':_0x467d4d(0x1d4),'color':_0x467d4d(0x1d9)})['start'](),_0x1f3bef=execSkillsAdd(_0x464c3b,_0x9155e4);_0x231fa6[_0x467d4d(0x1eb)](_0x1f3bef),_0xfe6cdd[_0x1f3bef['ok']?'succeed':_0x467d4d(0x20a)](_0x467d4d(0x1ff)+(_0x1f3bef[_0x467d4d(0x1d2)]??(_0x1f3bef['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x3c5be7=a127_0x4201fb({'text':_0x467d4d(0x1cf),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x1f8fd9=execUpgradeSdk(_0x5d2e32);_0x231fa6[_0x467d4d(0x1eb)](_0x1f8fd9),_0x3c5be7[_0x1f8fd9['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1f8)+(_0x1f8fd9[_0x467d4d(0x1d2)]??(_0x1f8fd9['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6)))),printSummary(_0x231fa6);const _0x4e7e45=_0x231fa6['some'](_0x510ff9=>!_0x510ff9['ok']);_0x4e7e45?console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1ca)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1bb)](_0x467d4d(0x1de))),_0x1f8fd9['ok']&&_0x5d2e32[_0x467d4d(0x1dc)]&&(console[_0x467d4d(0x1e7)](''),console[_0x467d4d(0x1e7)](a127_0x3b63cd['bold'][_0x467d4d(0x1d9)](_0x467d4d(0x1e3))),console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1d9)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console['log'](a127_0x3b63cd[_0x467d4d(0x1b6)](_0x467d4d(0x1cc))),console['log'](a127_0x3b63cd[_0x467d4d(0x1b6)]('\x20\x20#\x20or')),console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1b6)](_0x467d4d(0x1a5))),console[_0x467d4d(0x1e7)](''));}
|
|
1
|
+
function a128_0x1e00(){const _0x25f2c6=['no\x20legacy\x20entry','none\x20found','entries','object','values','2678855zNVpAE','string','Config\x20migration','CANCEL','Upgrade\x20cancelled.','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','message','green','package.json','info','hasNewConfig','\x20(backup:\x20','\x20→\x20keys:\x20','step','path','@lovrabet/sdk','red','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','no\x20matching\x20entry\x20found','some','Proceed\x20with\x20upgrade?','Legacy\x20artifacts:','fail','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','lovrabet/lovrabet-skill\x20removed','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Upgrade\x20@lovrabet/sdk','\x20removed\x20(','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','\x20\x20Fields\x20to\x20migrate:\x20','already\x20exists\x20(will\x20merge)','parse','.cursor/rules/lovrabet_rules.mdc','\x20\x20Step\x20','not\x20found\x20or\x20already\x20at\x20latest','Step\x201/7:\x20Config\x20migration\x20—\x20','oldMcpConfig','filter','log','not\x20needed','isDirectory','succeed','[\x22@lovrabet/sdk\x22]:\x20','Remove\x20.lovrabet/','lovrabet/rabetbase','===\x20Upgrade\x20Analysis\x20===','needed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','12eFhwJm','\x20→\x20latest','1952640lrxSxB','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','lovrabet/rabetbase\x20installed\x20globally','@lovrabet/dataset-mcp-server','Skill\x20swap:','Remove\x20legacy\x20artifacts','label','oldPath','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','287135GfHVEm','skipped','args','yes','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','gray','\x20removed','bold','error','Config\x20file:','yellow','not\x20found\x20(will\x20create)','\x20→\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','.claude/skills/lovrabet','skipped\x20(no\x20legacy\x20config)','devDependencies','isArray','push','14773032ibYObd','failed','length','includes','dependencies','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','done','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','cyan','exit\x20','sdkUpgrade','\x20\x20Action:\x20delete','.lovrabet','7130074pwGRjT','2027076iwhhlq','Clean\x20MCP\x20config','latest','\x20\x20npm\x20install','start','join','Step\x201/7:\x20Migrating\x20config...','Remove\x20old\x20skill','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','files','utf8','white','\x20from\x20','432452KnPoGN','.cursor/mcp.json','FOUND','FAIL','inherit','Step\x206/7:\x20Installing\x20new\x20skill...','@lovrabet/sdk:','status','stringify','mcpServers','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','\x20\x20Current\x20version\x20in\x20','Install\x20new\x20skill','oldArtifacts','detail','keys','MCP\x20config:','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','no\x20legacy\x20config\x20found'];a128_0x1e00=function(){return _0x25f2c6;};return a128_0x1e00();}const a128_0x40676f=a128_0x2756;(function(_0x215957,_0x5d7ed2){const _0x4c64c0=a128_0x2756,_0xac59c=_0x215957();while(!![]){try{const _0x36db22=-parseInt(_0x4c64c0(0x11d))/0x1+parseInt(_0x4c64c0(0x14b))/0x2+-parseInt(_0x4c64c0(0x114))/0x3+-parseInt(_0x4c64c0(0x13e))/0x4+-parseInt(_0x4c64c0(0x164))/0x5*(-parseInt(_0x4c64c0(0x112))/0x6)+-parseInt(_0x4c64c0(0x13d))/0x7+parseInt(_0x4c64c0(0x130))/0x8;if(_0x36db22===_0x5d7ed2)break;else _0xac59c['push'](_0xac59c['shift']());}catch(_0x213b3a){_0xac59c['push'](_0xac59c['shift']());}}}(a128_0x1e00,0xa3d37));import a128_0x17bd3e from'chalk';import a128_0x1dbc7a from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a128_0x40676f(0x107)](_0x1695b1=>_0x1695b1!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x50c71f){const _0x5a6a46=a128_0x40676f,_0x36b11a=[];for(const _0x2696be of Object[_0x5a6a46(0x163)](CORE_IDE_CONFIGS)){if(_0x2696be[_0x5a6a46(0x147)])for(const _0x700b65 of _0x2696be[_0x5a6a46(0x147)]){_0x36b11a[_0x5a6a46(0x12f)](resolve(_0x50c71f,_0x700b65[_0x5a6a46(0x172)]));}}return _0x36b11a;}function a128_0x2756(_0x5ed998,_0x4c45f){_0x5ed998=_0x5ed998-0x103;const _0x1e00cc=a128_0x1e00();let _0x2756da=_0x1e00cc[_0x5ed998];return _0x2756da;}function analyse(_0xf2a1ba){const _0x448da9=a128_0x40676f;let _0x55a40e=null;const _0x2abdcc=resolve(_0xf2a1ba,NEW_CONFIG_NAME),_0x4a790e=existsSync(_0x2abdcc);for(const _0x36ac5c of LEGACY_CONFIG_NAMES){const _0x2e93f9=resolve(_0xf2a1ba,_0x36ac5c);if(existsSync(_0x2e93f9)){const _0x164a8d=readConfigFile(_0x2e93f9),_0x47714f=Object[_0x448da9(0x15b)](_0x164a8d)[_0x448da9(0x107)](_0x45218d=>typeof _0x164a8d[_0x45218d]!=='undefined');_0x55a40e={'oldPath':_0x2e93f9,'hasNewConfig':_0x4a790e,'fields':_0x47714f};break;}}const _0x2ad9a5=[],_0x235107=resolve(_0xf2a1ba,_0x448da9(0x13c));if(existsSync(_0x235107))_0x2ad9a5[_0x448da9(0x12f)](_0x235107);const _0x491cb3=resolve(_0xf2a1ba,_0x448da9(0x184));if(existsSync(_0x491cb3))_0x2ad9a5['push'](_0x491cb3);const _0x5455ba=resolve(_0xf2a1ba,_0x448da9(0x12b));if(existsSync(_0x5455ba))_0x2ad9a5[_0x448da9(0x12f)](_0x5455ba);for(const _0xf4e722 of collectIdeSkillFiles(_0xf2a1ba)){if(existsSync(_0xf4e722))_0x2ad9a5[_0x448da9(0x12f)](_0xf4e722);}let _0x2727a8=null;const _0x4d83d5=resolve(_0xf2a1ba,_0x448da9(0x14c));if(existsSync(_0x4d83d5))try{const _0x12ed56=JSON[_0x448da9(0x183)](readFileSync(_0x4d83d5,'utf8'));if(_0x12ed56?.['mcpServers']&&typeof _0x12ed56[_0x448da9(0x154)]==='object'){const _0xc513e8=[];for(const [_0x244cec,_0x3a2f94]of Object[_0x448da9(0x161)](_0x12ed56[_0x448da9(0x154)])){const _0x8f81c5=_0x3a2f94;_0x8f81c5?.['args']&&Array[_0x448da9(0x12e)](_0x8f81c5['args'])&&_0x8f81c5[_0x448da9(0x11f)][_0x448da9(0x177)](_0x4537e3=>typeof _0x4537e3==='string'&&_0x4537e3[_0x448da9(0x133)](_0x448da9(0x117)))&&_0xc513e8[_0x448da9(0x12f)](_0x244cec);}_0xc513e8[_0x448da9(0x132)]>0x0&&(_0x2727a8={'path':_0x4d83d5,'keys':_0xc513e8});}}catch{}const _0x241226=_0x2ad9a5[_0x448da9(0x132)]>0x0||_0x55a40e!==null;let _0x300714=null;const _0x4236fa=resolve(_0xf2a1ba,_0x448da9(0x16c));if(existsSync(_0x4236fa))try{const _0x35477d=JSON[_0x448da9(0x183)](readFileSync(_0x4236fa,'utf8'));for(const _0x28d2b9 of[_0x448da9(0x134),_0x448da9(0x12d)]){const _0x128bbe=_0x35477d?.[_0x28d2b9]?.[_0x448da9(0x173)];if(typeof _0x128bbe===_0x448da9(0x165)){_0x128bbe!=='latest'&&(_0x300714={'pkgPath':_0x4236fa,'currentVersion':_0x128bbe,'field':_0x28d2b9});break;}}}catch{}return{'configMigration':_0x55a40e,'oldArtifacts':_0x2ad9a5,'oldMcpConfig':_0x2727a8,'needsSkillSwap':_0x241226,'sdkUpgrade':_0x300714};}function printReport(_0x1d51f2){const _0x5ed43f=a128_0x40676f,{configMigration:_0x40fe54,oldArtifacts:_0x2a1c74,oldMcpConfig:_0x3761f5,needsSkillSwap:_0x4e7548}=_0x1d51f2;console[_0x5ed43f(0x108)](''),console[_0x5ed43f(0x108)](a128_0x17bd3e[_0x5ed43f(0x124)](_0x5ed43f(0x10f))),console[_0x5ed43f(0x108)]('');_0x40fe54?(console['log'](a128_0x17bd3e[_0x5ed43f(0x138)](_0x5ed43f(0x126))+('\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x127)](_0x40fe54['oldPath']))),console['log']('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x40fe54[_0x5ed43f(0x16e)]?a128_0x17bd3e[_0x5ed43f(0x16b)](_0x5ed43f(0x182)):a128_0x17bd3e[_0x5ed43f(0x122)](_0x5ed43f(0x128)))),console[_0x5ed43f(0x108)](_0x5ed43f(0x181)+_0x40fe54['fields'][_0x5ed43f(0x143)](',\x20')),console[_0x5ed43f(0x108)](_0x5ed43f(0x169))):console['log'](a128_0x17bd3e[_0x5ed43f(0x138)](_0x5ed43f(0x126))+'\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x122)](_0x5ed43f(0x15e)));console[_0x5ed43f(0x108)]('');if(_0x2a1c74[_0x5ed43f(0x132)]>0x0){console['log'](a128_0x17bd3e['cyan'](_0x5ed43f(0x179)));for(const _0x27aa96 of _0x2a1c74){console[_0x5ed43f(0x108)]('\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x174)](_0x5ed43f(0x14d))+'\x20\x20'+_0x27aa96);}console[_0x5ed43f(0x108)](_0x5ed43f(0x13b));}else console[_0x5ed43f(0x108)](a128_0x17bd3e[_0x5ed43f(0x138)]('Legacy\x20artifacts:')+'\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x122)](_0x5ed43f(0x160)));console[_0x5ed43f(0x108)]('');_0x3761f5?(console[_0x5ed43f(0x108)](a128_0x17bd3e[_0x5ed43f(0x138)]('MCP\x20config:')+('\x20\x20'+a128_0x17bd3e['yellow'](_0x3761f5[_0x5ed43f(0x172)])+_0x5ed43f(0x170)+_0x3761f5[_0x5ed43f(0x15b)][_0x5ed43f(0x143)](',\x20'))),console['log'](_0x5ed43f(0x137))):console['log'](a128_0x17bd3e['cyan'](_0x5ed43f(0x15c))+'\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x122)](_0x5ed43f(0x15f)));console[_0x5ed43f(0x108)](''),console[_0x5ed43f(0x108)](a128_0x17bd3e[_0x5ed43f(0x138)](_0x5ed43f(0x118))+('\x20\x20'+(_0x4e7548?a128_0x17bd3e[_0x5ed43f(0x127)](_0x5ed43f(0x110)):a128_0x17bd3e[_0x5ed43f(0x16b)](_0x5ed43f(0x109)))));_0x4e7548&&console[_0x5ed43f(0x108)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x5ed43f(0x108)]('');if(_0x1d51f2[_0x5ed43f(0x13a)]){const {currentVersion:_0x3a9f74,field:_0x3ac7f9,pkgPath:_0x20eb76}=_0x1d51f2[_0x5ed43f(0x13a)];console[_0x5ed43f(0x108)](a128_0x17bd3e['cyan'](_0x5ed43f(0x151))+('\x20\x20'+a128_0x17bd3e[_0x5ed43f(0x127)](_0x20eb76))),console[_0x5ed43f(0x108)](_0x5ed43f(0x157)+_0x3ac7f9+':\x20'+a128_0x17bd3e[_0x5ed43f(0x127)](_0x3a9f74)+_0x5ed43f(0x129)+a128_0x17bd3e[_0x5ed43f(0x16b)](_0x5ed43f(0x140))),console[_0x5ed43f(0x108)](_0x5ed43f(0x175));}else console[_0x5ed43f(0x108)](a128_0x17bd3e[_0x5ed43f(0x138)](_0x5ed43f(0x151))+'\x20\x20'+a128_0x17bd3e['gray'](_0x5ed43f(0x104)));console['log']('');}function execConfigMigration(_0x168dab,_0x2a0d82){const _0x38c53c=a128_0x40676f,{configMigration:_0x584efd}=_0x168dab;if(!_0x584efd?.[_0x38c53c(0x11b)])return{'step':0x1,'label':_0x38c53c(0x166),'ok':!![],'detail':_0x38c53c(0x12c)};const _0x426b19=readConfigFile(_0x584efd[_0x38c53c(0x11b)]),_0x543e0c=resolve(_0x2a0d82,NEW_CONFIG_NAME),_0x4bd15a=_0x584efd['hasNewConfig']?readConfigFile(_0x543e0c):{};for(const [_0x499b39,_0x11521b]of Object[_0x38c53c(0x161)](_0x426b19)){!(_0x499b39 in _0x4bd15a)&&(_0x4bd15a[_0x499b39]=_0x11521b);}writeConfigFile(_0x543e0c,_0x4bd15a);const _0x304d81=_0x584efd[_0x38c53c(0x11b)]+'.bak';return renameSync(_0x584efd[_0x38c53c(0x11b)],_0x304d81),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x584efd[_0x38c53c(0x11b)]+_0x38c53c(0x129)+_0x543e0c+_0x38c53c(0x16f)+_0x304d81+')'};}function execRemoveOldArtifacts(_0x127454){const _0x49c1f8=a128_0x40676f,_0x2426b4=[];for(const _0x30e06a of _0x127454){try{if(!existsSync(_0x30e06a))continue;const _0x341396=tryStat(_0x30e06a);_0x341396?.[_0x49c1f8(0x10a)]()?rmSync(_0x30e06a,{'recursive':!![],'force':!![]}):unlinkSync(_0x30e06a);}catch(_0x926326){_0x2426b4['push'](_0x30e06a+':\x20'+_0x926326['message']);}}return{'step':0x3,'label':_0x49c1f8(0x119),'ok':_0x2426b4['length']===0x0,'detail':_0x2426b4['length']>0x0?_0x127454['length']-_0x2426b4[_0x49c1f8(0x132)]+'/'+_0x127454[_0x49c1f8(0x132)]+_0x49c1f8(0x17f)+_0x2426b4[_0x49c1f8(0x143)](';\x20')+')':_0x127454[_0x49c1f8(0x132)]+_0x49c1f8(0x123)};}function execCleanMcp(_0x49dcb5){const _0x398683=a128_0x40676f;if(!_0x49dcb5['oldMcpConfig'])return{'step':0x4,'label':_0x398683(0x13f),'ok':!![],'detail':_0x398683(0x11e)};try{const _0x3b0e4d=readFileSync(_0x49dcb5[_0x398683(0x106)][_0x398683(0x172)],_0x398683(0x148)),_0x4e4078=JSON[_0x398683(0x183)](_0x3b0e4d);if(_0x4e4078?.[_0x398683(0x154)]&&typeof _0x4e4078[_0x398683(0x154)]===_0x398683(0x162)){const _0x91ec3e=[];for(const [_0x28cbc8,_0x59080e]of Object['entries'](_0x4e4078[_0x398683(0x154)])){_0x59080e?.[_0x398683(0x11f)]&&Array[_0x398683(0x12e)](_0x59080e[_0x398683(0x11f)])&&_0x59080e[_0x398683(0x11f)][_0x398683(0x177)](_0x1acdbf=>typeof _0x1acdbf===_0x398683(0x165)&&_0x1acdbf[_0x398683(0x133)](_0x398683(0x117)))&&_0x91ec3e['push'](_0x28cbc8);}for(const _0x321c87 of _0x91ec3e){delete _0x4e4078['mcpServers'][_0x321c87];}return _0x91ec3e[_0x398683(0x132)]>0x0&&writeFileSync(_0x49dcb5[_0x398683(0x106)][_0x398683(0x172)],JSON[_0x398683(0x153)](_0x4e4078,null,0x2)+'\x0a',_0x398683(0x148)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0x91ec3e['join'](',\x20')+_0x398683(0x14a)+_0x49dcb5[_0x398683(0x106)][_0x398683(0x172)]};}return{'step':0x4,'label':_0x398683(0x13f),'ok':!![],'detail':_0x398683(0x176)};}catch(_0x188935){return{'step':0x4,'label':_0x398683(0x13f),'ok':![],'detail':_0x188935[_0x398683(0x16a)]};}}function execSkillsRemove(_0x28df9c,_0x25e07f){const _0x54523c=a128_0x40676f,_0x1ecaa7=runNpxSkillsRemove(_0x28df9c,{'stdio':_0x54523c(0x14f),'yes':_0x25e07f});return{'step':0x5,'label':_0x54523c(0x145),'ok':_0x1ecaa7['ok'],'detail':_0x1ecaa7['ok']?_0x54523c(0x17c):_0x1ecaa7[_0x54523c(0x125)]??_0x54523c(0x139)+_0x1ecaa7[_0x54523c(0x152)]};}function execSkillsAdd(_0x513faf,_0x372341){const _0x58e87c=a128_0x40676f,_0x407ef1=runNpxSkillsAddGlobal(_0x513faf,_0x58e87c(0x10e),{'stdio':_0x58e87c(0x14f),'yes':_0x372341});return{'step':0x6,'label':_0x58e87c(0x158),'ok':_0x407ef1['ok'],'detail':_0x407ef1['ok']?_0x58e87c(0x116):_0x407ef1[_0x58e87c(0x125)]??_0x58e87c(0x139)+_0x407ef1[_0x58e87c(0x152)]};}function execUpgradeSdk(_0x2cfb0b){const _0x51f669=a128_0x40676f;if(!_0x2cfb0b[_0x51f669(0x13a)])return{'step':0x7,'label':_0x51f669(0x17e),'ok':!![],'detail':_0x51f669(0x156)};const {pkgPath:_0x2c2c7e,currentVersion:_0x32e597,field:_0x4aed63}=_0x2cfb0b[_0x51f669(0x13a)];try{const _0x1a74d2=readFileSync(_0x2c2c7e,_0x51f669(0x148)),_0x42856d=JSON[_0x51f669(0x183)](_0x1a74d2);return _0x42856d[_0x4aed63][_0x51f669(0x173)]=_0x51f669(0x140),writeFileSync(_0x2c2c7e,JSON['stringify'](_0x42856d,null,0x2)+'\x0a',_0x51f669(0x148)),{'step':0x7,'label':_0x51f669(0x17e),'ok':!![],'detail':_0x4aed63+_0x51f669(0x10c)+_0x32e597+_0x51f669(0x113)};}catch(_0x8c6ce3){return{'step':0x7,'label':_0x51f669(0x17e),'ok':![],'detail':_0x8c6ce3[_0x51f669(0x16a)]};}}function tryStat(_0x39674b){try{return statSync(_0x39674b);}catch{return undefined;}}function printSummary(_0x1c84a7){const _0x377c2b=a128_0x40676f;console[_0x377c2b(0x108)](''),console[_0x377c2b(0x108)](a128_0x17bd3e['bold']('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x16186e of _0x1c84a7){const _0x536dce=_0x16186e['ok']?a128_0x17bd3e['green']('OK'):a128_0x17bd3e[_0x377c2b(0x174)](_0x377c2b(0x14e));console[_0x377c2b(0x108)]('\x20\x20'+_0x536dce+_0x377c2b(0x103)+_0x16186e[_0x377c2b(0x171)]+':\x20'+_0x16186e[_0x377c2b(0x11a)]);if(_0x16186e['detail'])console[_0x377c2b(0x108)]('\x20\x20\x20\x20\x20\x20\x20'+a128_0x17bd3e[_0x377c2b(0x122)](_0x16186e[_0x377c2b(0x15a)]));}console['log']('');}export async function upgradeApp(_0x398d2,_0x3068a2){const _0x5b6841=a128_0x40676f,_0x1c08d5=process['cwd'](),_0x2c5211=analyse(_0x1c08d5),_0x20318d=!_0x2c5211['configMigration']&&_0x2c5211[_0x5b6841(0x159)]['length']===0x0&&!_0x2c5211['oldMcpConfig']&&!_0x2c5211['needsSkillSwap']&&!_0x2c5211[_0x5b6841(0x13a)];if(_0x20318d){console['log'](a128_0x17bd3e[_0x5b6841(0x16b)](_0x5b6841(0x146)));return;}printReport(_0x2c5211);const _0x48fcbf=!!(_0x3068a2[_0x5b6841(0x120)]||_0x3068a2['Y']||_0x398d2);if(!_0x48fcbf)try{const _0x403202=await askConfirm(_0x5b6841(0x178));if(!_0x403202){console[_0x5b6841(0x108)](a128_0x17bd3e['gray'](_0x5b6841(0x168)));return;}}catch(_0x584a23){if(_0x584a23?.['message']===_0x5b6841(0x167)){console[_0x5b6841(0x108)](a128_0x17bd3e[_0x5b6841(0x122)](_0x5b6841(0x168)));return;}throw _0x584a23;}const _0x42e7aa=[],_0x1aa8c5=a128_0x1dbc7a({'text':_0x5b6841(0x144),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)](),_0x41252f=execConfigMigration(_0x2c5211,_0x1c08d5);_0x42e7aa[_0x5b6841(0x12f)](_0x41252f),_0x1aa8c5[_0x41252f['ok']?'succeed':_0x5b6841(0x17a)](_0x5b6841(0x105)+(_0x41252f['detail']??(_0x41252f['ok']?_0x5b6841(0x136):_0x5b6841(0x131))));const _0x93ac9c=resolve(_0x1c08d5,'.lovrabet'),_0x2e01d0=a128_0x1dbc7a({'text':_0x5b6841(0x11c),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)]();if(existsSync(_0x93ac9c))try{rmSync(_0x93ac9c,{'recursive':!![],'force':!![]}),_0x2e01d0[_0x5b6841(0x10b)](_0x5b6841(0x135)),_0x42e7aa[_0x5b6841(0x12f)]({'step':0x2,'label':_0x5b6841(0x10d),'ok':!![]});}catch(_0x13117c){_0x2e01d0['fail'](_0x5b6841(0x121)+_0x13117c[_0x5b6841(0x16a)]),_0x42e7aa[_0x5b6841(0x12f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x13117c[_0x5b6841(0x16a)]});}else _0x2e01d0[_0x5b6841(0x16d)](_0x5b6841(0x115)),_0x42e7aa[_0x5b6841(0x12f)]({'step':0x2,'label':_0x5b6841(0x10d),'ok':!![],'detail':_0x5b6841(0x11e)});const _0x2e7008=a128_0x1dbc7a({'text':_0x5b6841(0x17d),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)](),_0x1503f2=execRemoveOldArtifacts(_0x2c5211[_0x5b6841(0x159)]);_0x42e7aa[_0x5b6841(0x12f)](_0x1503f2),_0x2e7008[_0x1503f2['ok']?_0x5b6841(0x10b):_0x5b6841(0x17a)](_0x5b6841(0x15d)+(_0x1503f2[_0x5b6841(0x15a)]??(_0x1503f2['ok']?_0x5b6841(0x136):_0x5b6841(0x131))));const _0x2960d9=a128_0x1dbc7a({'text':_0x5b6841(0x12a),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)](),_0x4ba0f4=execCleanMcp(_0x2c5211);_0x42e7aa[_0x5b6841(0x12f)](_0x4ba0f4),_0x2960d9[_0x4ba0f4['ok']?_0x5b6841(0x10b):_0x5b6841(0x17a)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x4ba0f4[_0x5b6841(0x15a)]??(_0x4ba0f4['ok']?'done':_0x5b6841(0x131))));const _0x149c01=a128_0x1dbc7a({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':'cyan'})[_0x5b6841(0x142)](),_0xba65dc=execSkillsRemove(_0x1c08d5,_0x48fcbf);_0x42e7aa[_0x5b6841(0x12f)](_0xba65dc),_0x149c01[_0xba65dc['ok']?_0x5b6841(0x10b):_0x5b6841(0x17a)](_0x5b6841(0x155)+(_0xba65dc['detail']??(_0xba65dc['ok']?'done':_0x5b6841(0x131))));const _0x1cc0bb=a128_0x1dbc7a({'text':_0x5b6841(0x150),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)](),_0x5656eb=execSkillsAdd(_0x1c08d5,_0x48fcbf);_0x42e7aa[_0x5b6841(0x12f)](_0x5656eb),_0x1cc0bb[_0x5656eb['ok']?'succeed':_0x5b6841(0x17a)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x5656eb[_0x5b6841(0x15a)]??(_0x5656eb['ok']?'done':_0x5b6841(0x131))));const _0xbcfc81=a128_0x1dbc7a({'text':_0x5b6841(0x180),'color':_0x5b6841(0x138)})[_0x5b6841(0x142)](),_0x567642=execUpgradeSdk(_0x2c5211);_0x42e7aa[_0x5b6841(0x12f)](_0x567642),_0xbcfc81[_0x567642['ok']?_0x5b6841(0x10b):_0x5b6841(0x17a)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x567642['detail']??(_0x567642['ok']?'done':_0x5b6841(0x131)))),printSummary(_0x42e7aa);const _0x32e0e7=_0x42e7aa[_0x5b6841(0x177)](_0x434d5f=>!_0x434d5f['ok']);_0x32e0e7?console[_0x5b6841(0x108)](a128_0x17bd3e['yellow']('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a128_0x17bd3e[_0x5b6841(0x16b)]('Upgrade\x20completed\x20successfully!')),_0x567642['ok']&&_0x2c5211['sdkUpgrade']&&(console[_0x5b6841(0x108)](''),console['log'](a128_0x17bd3e[_0x5b6841(0x124)][_0x5b6841(0x138)](_0x5b6841(0x17b))),console[_0x5b6841(0x108)](a128_0x17bd3e[_0x5b6841(0x138)](_0x5b6841(0x111))),console[_0x5b6841(0x108)](''),console['log'](a128_0x17bd3e['white'](_0x5b6841(0x141))),console['log'](a128_0x17bd3e[_0x5b6841(0x149)]('\x20\x20#\x20or')),console['log'](a128_0x17bd3e[_0x5b6841(0x149)]('\x20\x20bun\x20install')),console[_0x5b6841(0x108)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a129_0x3a0d95=a129_0x1eb9;function a129_0x1eb9(_0x2d629e,_0x4e8779){_0x2d629e=_0x2d629e-0x15c;const _0x1bc82a=a129_0x1bc8();let _0x1eb97e=_0x1bc82a[_0x2d629e];return _0x1eb97e;}(function(_0x20ec21,_0x2c4d38){const _0x2d0944=a129_0x1eb9,_0x4f02a4=_0x20ec21();while(!![]){try{const _0x316a6c=parseInt(_0x2d0944(0x15e))/0x1*(-parseInt(_0x2d0944(0x18f))/0x2)+parseInt(_0x2d0944(0x193))/0x3*(parseInt(_0x2d0944(0x17e))/0x4)+parseInt(_0x2d0944(0x191))/0x5*(parseInt(_0x2d0944(0x18d))/0x6)+parseInt(_0x2d0944(0x199))/0x7*(parseInt(_0x2d0944(0x182))/0x8)+parseInt(_0x2d0944(0x186))/0x9*(parseInt(_0x2d0944(0x175))/0xa)+-parseInt(_0x2d0944(0x197))/0xb+parseInt(_0x2d0944(0x17d))/0xc*(parseInt(_0x2d0944(0x16f))/0xd);if(_0x316a6c===_0x2c4d38)break;else _0x4f02a4['push'](_0x4f02a4['shift']());}catch(_0x576775){_0x4f02a4['push'](_0x4f02a4['shift']());}}}(a129_0x1bc8,0x7ce0f));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x2ed40d){const _0x1090fa=a129_0x1eb9;for(const _0x5300ba of _0x2ed40d){definitions[_0x1090fa(0x192)](_0x5300ba['service']+':'+_0x5300ba[_0x1090fa(0x169)],_0x5300ba);let _0xacb52c=serviceGroups[_0x1090fa(0x179)](_0x5300ba[_0x1090fa(0x180)]);!_0xacb52c&&(_0xacb52c=[],serviceGroups[_0x1090fa(0x192)](_0x5300ba[_0x1090fa(0x180)],_0xacb52c)),_0xacb52c[_0x1090fa(0x17a)](_0x5300ba);}}function registerDeclarativeService(_0x104dd6,_0x4104c6,_0x57133d){const _0x344aaf=a129_0x1eb9;registerDefinitions(_0x4104c6);_0x57133d?.[_0x344aaf(0x176)]&®isterDefinitions([_0x57133d[_0x344aaf(0x176)]]);const _0x44f830=_0x2ce376=>_0x2ce376==='read'?'':_0x2ce376===_0x344aaf(0x174)?_0x344aaf(0x15d):_0x344aaf(0x188),_0x53afb1={'service':_0x4104c6[0x0][_0x344aaf(0x180)],'label':_0x104dd6,'commands':_0x4104c6[_0x344aaf(0x198)](_0x4a6b10=>({'command':_0x4a6b10['command'],'description':_0x4a6b10[_0x344aaf(0x170)],'tag':_0x44f830(_0x4a6b10[_0x344aaf(0x161)])})),'declarative':!![],'defaultCommand':_0x57133d?.[_0x344aaf(0x18b)]??(_0x57133d?.['isSingleCommand']?_0x4104c6[0x0][_0x344aaf(0x169)]:undefined),'wildcardDef':_0x57133d?.[_0x344aaf(0x176)],'isSingleCommand':_0x57133d?.[_0x344aaf(0x195)]};serviceRegistry[_0x344aaf(0x17a)](_0x53afb1),serviceByName[_0x344aaf(0x192)](_0x53afb1[_0x344aaf(0x180)],_0x53afb1);}registerDeclarativeService(a129_0x3a0d95(0x18a),initDefinitions,{'defaultCommand':a129_0x3a0d95(0x164),'isSingleCommand':!![]}),registerDeclarativeService(a129_0x3a0d95(0x15c),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a129_0x3a0d95(0x196),appDefinitions),registerDeclarativeService(a129_0x3a0d95(0x16d),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a129_0x3a0d95(0x17f),datasetDefinitions),registerDeclarativeService('Smart\x20List\x20Pages',pageDefinitions),registerDeclarativeService(a129_0x3a0d95(0x167),apiDefinitions),registerDeclarativeService(a129_0x3a0d95(0x178),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a129_0x3a0d95(0x165),dbDefinitions),registerDeclarativeService(a129_0x3a0d95(0x177),menuDefinitions),registerDeclarativeService(a129_0x3a0d95(0x16a),appConfigDefinitions),registerDeclarativeService(a129_0x3a0d95(0x16c),issueDefinitions),registerDeclarativeService(a129_0x3a0d95(0x17c),codegenDefinitions),registerDeclarativeService(a129_0x3a0d95(0x187),configDefinitions),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a129_0x3a0d95(0x16b),cliSkillDefinitions,{'defaultCommand':a129_0x3a0d95(0x194)}),registerDeclarativeService(a129_0x3a0d95(0x190),logsDefinitions,{'defaultCommand':a129_0x3a0d95(0x181)}),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a129_0x3a0d95(0x162)]-0x1];last[a129_0x3a0d95(0x185)]=[{'command':'<script>','description':a129_0x3a0d95(0x15f),'tag':''}];}export const deprecatedAliases={'create':{'service':a129_0x3a0d95(0x18e),'command':a129_0x3a0d95(0x166)},'start':{'service':a129_0x3a0d95(0x164),'command':'start'},'build':{'service':a129_0x3a0d95(0x164),'command':'build'},'preview':{'service':a129_0x3a0d95(0x164),'command':a129_0x3a0d95(0x17b)},'logout':{'service':a129_0x3a0d95(0x160),'command':'logout'}};const CLI_SKILL_INSTALL_REMOVED_HINT=a129_0x3a0d95(0x189);export function resolveRemovedCommand(_0x3c725d,_0x285f15){const _0x267ac6=a129_0x3a0d95;if(_0x3c725d===_0x267ac6(0x183)){const _0x1fecab=_0x285f15?_0x267ac6(0x171)+_0x285f15:_0x267ac6(0x183);return{'command':_0x1fecab,'message':_0x267ac6(0x168)+_0x1fecab+_0x267ac6(0x16e),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x3c725d===_0x267ac6(0x184))return{'command':_0x267ac6(0x184),'message':_0x267ac6(0x18c),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a129_0x3a0d95(0x166)},'sql':{'new':a129_0x3a0d95(0x166)}};export function resolveDeprecatedSubcommand(_0x3dd468,_0x4edfba){return deprecatedSubcommands[_0x3dd468]?.[_0x4edfba];}export function findDefinition(_0x407b9f,_0x1b5234){return definitions['get'](_0x407b9f+':'+_0x1b5234);}export function isKnownService(_0x195df7){return serviceByName['has'](_0x195df7);}export function isDeclarativeService(_0x4aa3bc){const _0x3d4121=a129_0x3a0d95;return serviceGroups[_0x3d4121(0x172)](_0x4aa3bc)||serviceByName[_0x3d4121(0x179)](_0x4aa3bc)?.[_0x3d4121(0x176)]!==undefined;}export function getServiceEntry(_0x5c43f0){const _0xa4ce8a=a129_0x3a0d95;return serviceByName[_0xa4ce8a(0x179)](_0x5c43f0);}function a129_0x1bc8(){const _0x301698=['\x20\x20[write]','51djPjpx','Run\x20any\x20package.json\x20script','auth','risk','length','values','run','Database\x20Connections','create','API','`rabetbase\x20','command','Remote\x20App\x20Config','CLI\x20Built-in\x20Skill','Platform\x20Issue','Authentication','`\x20has\x20been\x20removed.','13715Tgafod','description','skill\x20','has','from','write','20JvnTYi','wildcardDef','Menu','Instant\x20API','get','push','preview','Code\x20Generation','8508WHcUYb','20CNKYWl','Dataset\x20&\x20Operations','service','show','64xZDfKt','skill','skills','commands','470025LoxKtp','Configuration','\x20\x20[high-risk-write]','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','Quick\x20Start','defaultCommand','`rabetbase\x20skills`\x20has\x20been\x20removed.','6NsWSvE','project','24974ieHCuC','Logs','1829315SxajJO','set','160845Mpjifn','install','isSingleCommand','App\x20Management','9882257tlIVjt','map','490301lrMMJX','Project'];a129_0x1bc8=function(){return _0x301698;};return a129_0x1bc8();}export function getLegacyHandler(_0x144797,_0x47aa37){return undefined;}export function getAllDefinitions(){const _0x4bf4d6=a129_0x3a0d95;return Array[_0x4bf4d6(0x173)](definitions[_0x4bf4d6(0x163)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a130_0x3822(_0x2a6c56,_0xa3e8f4){_0x2a6c56=_0x2a6c56-0xbe;const _0x2419da=a130_0x2419();let _0x3822ac=_0x2419da[_0x2a6c56];return _0x3822ac;}const a130_0x129181=a130_0x3822;(function(_0x191a70,_0x33a34c){const _0x370c5b=a130_0x3822,_0x8bb465=_0x191a70();while(!![]){try{const _0x3ca46f=-parseInt(_0x370c5b(0xdc))/0x1*(-parseInt(_0x370c5b(0xf5))/0x2)+parseInt(_0x370c5b(0xff))/0x3*(-parseInt(_0x370c5b(0xd4))/0x4)+parseInt(_0x370c5b(0xcb))/0x5+parseInt(_0x370c5b(0xee))/0x6*(-parseInt(_0x370c5b(0xc4))/0x7)+parseInt(_0x370c5b(0xde))/0x8*(-parseInt(_0x370c5b(0xea))/0x9)+parseInt(_0x370c5b(0xd2))/0xa*(-parseInt(_0x370c5b(0xc0))/0xb)+parseInt(_0x370c5b(0xe5))/0xc;if(_0x3ca46f===_0x33a34c)break;else _0x8bb465['push'](_0x8bb465['shift']());}catch(_0x492a40){_0x8bb465['push'](_0x8bb465['shift']());}}}(a130_0x2419,0xb1d00));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start','dev']);function readPackageScripts(_0x5bf009){const _0x19228d=a130_0x3822,_0xeef770=resolve(_0x5bf009,_0x19228d(0xce));if(!existsSync(_0xeef770))return null;try{const _0x3a575b=JSON[_0x19228d(0xd0)](readFileSync(_0xeef770,_0x19228d(0xd7)));return _0x3a575b[_0x19228d(0xf1)]??{};}catch{return null;}}function detectPackageManager(_0x262546){const _0x15bef9=a130_0x3822;if(existsSync(resolve(_0x262546,_0x15bef9(0xc3)))||existsSync(resolve(_0x262546,_0x15bef9(0xe6))))return'bun';if(existsSync(resolve(_0x262546,_0x15bef9(0xfb))))return'pnpm';if(existsSync(resolve(_0x262546,'yarn.lock')))return _0x15bef9(0xfc);return _0x15bef9(0xf2);}async function versionCheck(_0x224ea5){const _0x353c17=a130_0x3822,_0x24d8dc=await checkCliVersion();(_0x24d8dc[_0x353c17(0xcc)]||_0x24d8dc[_0x353c17(0xf0)])&&(printCliUpgradeWarning(_0x24d8dc),assertCliVersionSupported(_0x24d8dc));const _0x4137ba=await checkSdkVersion(_0x224ea5);if(_0x4137ba[_0x353c17(0xcc)])printSdkUpgradeWarning(_0x4137ba);}function a130_0x2419(){const _0x1ba647=['30670kbzKIS','join','close','all','boolean','\x20run\x20build','pnpm-lock.yaml','yarn','script','inherit','3KRpSSf','padEnd','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','validation','22Auxzbk','\x20run\x20<script>\x0a','keys','bun.lockb','511mQCZAY','map','run','\x20\x20\x20\x20','\x22\x20not\x20found\x20in\x20package.json.','watch','build','5355675SuMLNX','needsUpgrade','--watch','package.json','\x0a\x20\x20Usage:\x20','parse','(none)','3628270IEwNHc','\x20run\x20preview','585292UthBIZ','push','read','utf-8','log','.bin','\x20exited\x20with\x20code\x20','node_modules','27LmVyiW','length','1220744DvNSwe','args','error','\x20run\x20start','\x20\x20EXAMPLES','cwd','Enable\x20watch\x20mode\x20for\x20preview','11598468Dfzkjl','bun.lock','has','vite\x20preview\x20exited\x20with\x20code\x20','slice','9pTvuZn','\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20','57438fhELRe','max','belowMinimum','scripts','npm','entries','preview'];a130_0x2419=function(){return _0x1ba647;};return a130_0x2419();}function spawnScript(_0x1077c8,_0x72679b,_0x4d4cc2,_0x5cbc37){return new Promise((_0x470f5e,_0x5fa4a8)=>{const _0x1dc647=a130_0x3822,_0x3b3434=[_0x1dc647(0xc6),_0x72679b,..._0x4d4cc2],_0xfce334=spawn(_0x1077c8,_0x3b3434,{'cwd':_0x5cbc37,'stdio':_0x1dc647(0xfe),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5cbc37,_0x1dc647(0xdb),_0x1dc647(0xd9))+delimiter+process.env.PATH}});_0xfce334['on']('close',_0x4c40a5=>{const _0x216072=_0x1dc647;if(_0x4c40a5===0x0||_0x4c40a5===null)_0x470f5e();else _0x5fa4a8(new Error(_0x1077c8+'\x20run\x20'+_0x72679b+_0x216072(0xda)+_0x4c40a5));}),_0xfce334['on'](_0x1dc647(0xe0),_0x5fa4a8);});}function spawnViteBuildWatch(_0x46282e){return new Promise((_0x488aa1,_0x284fe0)=>{const _0x311e88=a130_0x3822,_0x20e5ae=spawn('vite',[_0x311e88(0xca),_0x311e88(0xcd)],{'cwd':_0x46282e,'stdio':_0x311e88(0xfe),'shell':!![],'env':{...process.env,'PATH':''+join(_0x46282e,_0x311e88(0xdb),_0x311e88(0xd9))+delimiter+process.env.PATH}});_0x20e5ae['on'](_0x311e88(0xf7),_0xd58f28=>{if(_0xd58f28===0x0||_0xd58f28===null)_0x488aa1();else _0x284fe0(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0xd58f28));}),_0x20e5ae['on'](_0x311e88(0xe0),_0x284fe0);});}function spawnVitePreview(_0x1888d2){return new Promise((_0xab7ebf,_0x521d0b)=>{const _0x401023=a130_0x3822,_0x2bd82d=spawn('vite',[_0x401023(0xf4)],{'cwd':_0x1888d2,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x1888d2,_0x401023(0xdb),_0x401023(0xd9))+delimiter+process.env.PATH}});_0x2bd82d['on'](_0x401023(0xf7),_0x3a51a9=>{const _0x32cc9c=_0x401023;if(_0x3a51a9===0x0||_0x3a51a9===null)_0xab7ebf();else _0x521d0b(new Error(_0x32cc9c(0xe8)+_0x3a51a9));}),_0x2bd82d['on']('error',_0x521d0b);});}const runFlags=[{'name':a130_0x129181(0xc9),'type':a130_0x129181(0xf9),'description':a130_0x129181(0xe4),'default':![]}];export const runDefinition={'service':'run','command':a130_0x129181(0xc6),'description':'Run\x20a\x20package.json\x20script','risk':a130_0x129181(0xd6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a130_0x129181(0xfd),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x1891c9=a130_0x129181,_0x5f1a2f=readPackageScripts(process[_0x1891c9(0xe3)]()),_0x494e17=[];if(_0x5f1a2f&&Object[_0x1891c9(0xc2)](_0x5f1a2f)[_0x1891c9(0xdd)]>0x0){const _0x34fce3=Object[_0x1891c9(0xc2)](_0x5f1a2f),_0x4948ae=Math[_0x1891c9(0xef)](..._0x34fce3[_0x1891c9(0xc5)](_0x33ce91=>_0x33ce91[_0x1891c9(0xdd)]));_0x494e17[_0x1891c9(0xd5)](_0x1891c9(0xbe));for(const [_0x4841ce,_0x128ce4]of Object[_0x1891c9(0xf3)](_0x5f1a2f)){_0x494e17[_0x1891c9(0xd5)](_0x1891c9(0xc7)+CLI_BIN_NAME+_0x1891c9(0xed)+_0x4841ce[_0x1891c9(0x100)](_0x4948ae+0x2)+'#\x20'+_0x128ce4);}}else _0x494e17[_0x1891c9(0xd5)](_0x1891c9(0xe2)),_0x494e17[_0x1891c9(0xd5)](_0x1891c9(0xc7)+CLI_BIN_NAME+_0x1891c9(0xe1)),_0x494e17[_0x1891c9(0xd5)](_0x1891c9(0xc7)+CLI_BIN_NAME+_0x1891c9(0xfa)),_0x494e17['push'](_0x1891c9(0xc7)+CLI_BIN_NAME+_0x1891c9(0xd3)),_0x494e17[_0x1891c9(0xd5)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1891c9(0xeb));return _0x494e17[_0x1891c9(0xf6)]('\x0a');},async 'execute'(_0x59ac1f){const _0x53733f=a130_0x129181,_0x3f89f2=process['cwd'](),_0x1ced7b=_0x59ac1f[_0x53733f(0xdf)][0x0],_0x4ada58=_0x59ac1f[_0x53733f(0xdf)][_0x53733f(0xe9)](0x1),_0x26ba58=readPackageScripts(_0x3f89f2);if(!_0x26ba58)throw CliErrors[_0x53733f(0xbf)]('No\x20package.json\x20found\x20in\x20current\x20directory.');if(!_0x1ced7b){const _0x2087b1=Object['keys'](_0x26ba58);if(_0x2087b1[_0x53733f(0xdd)]===0x0)console[_0x53733f(0xd8)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log'](_0x53733f(0xec));const _0x5366d7=Math['max'](..._0x2087b1[_0x53733f(0xc5)](_0x2e0382=>_0x2e0382[_0x53733f(0xdd)]));for(const [_0x330089,_0x4a3b4c]of Object[_0x53733f(0xf3)](_0x26ba58)){console[_0x53733f(0xd8)](_0x53733f(0xc7)+_0x330089['padEnd'](_0x5366d7+0x2)+_0x4a3b4c);}console[_0x53733f(0xd8)](_0x53733f(0xcf)+CLI_BIN_NAME+_0x53733f(0xc1));}return{'ok':!![]};}if(!_0x26ba58[_0x1ced7b])throw CliErrors[_0x53733f(0xbf)]('Script\x20\x22'+_0x1ced7b+_0x53733f(0xc8),'Available:\x20'+(Object['keys'](_0x26ba58)[_0x53733f(0xf6)](',\x20')||_0x53733f(0xd1)));const _0x228523=detectPackageManager(_0x3f89f2);VERSION_CHECK_SCRIPTS[_0x53733f(0xe7)](_0x1ced7b)&&await versionCheck(_0x3f89f2);if(_0x1ced7b===_0x53733f(0xf4)&&_0x59ac1f['bool'](_0x53733f(0xc9)))return await Promise[_0x53733f(0xf8)]([spawnViteBuildWatch(_0x3f89f2),spawnVitePreview(_0x3f89f2)]),{'ok':!![]};return await spawnScript(_0x228523,_0x1ced7b,_0x4ada58,_0x3f89f2),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0xce19cb=a131_0xb26d;(function(_0x150d15,_0x2bd7bf){const _0x1d6ab6=a131_0xb26d,_0x41dcd7=_0x150d15();while(!![]){try{const _0xd80121=-parseInt(_0x1d6ab6(0x9a))/0x1*(-parseInt(_0x1d6ab6(0x99))/0x2)+-parseInt(_0x1d6ab6(0x9d))/0x3+parseInt(_0x1d6ab6(0xa6))/0x4*(-parseInt(_0x1d6ab6(0x9e))/0x5)+-parseInt(_0x1d6ab6(0x98))/0x6*(parseInt(_0x1d6ab6(0xa1))/0x7)+-parseInt(_0x1d6ab6(0x9f))/0x8*(-parseInt(_0x1d6ab6(0x9b))/0x9)+parseInt(_0x1d6ab6(0xa3))/0xa+-parseInt(_0x1d6ab6(0xa5))/0xb*(-parseInt(_0x1d6ab6(0x97))/0xc);if(_0xd80121===_0x2bd7bf)break;else _0x41dcd7['push'](_0x41dcd7['shift']());}catch(_0x399213){_0x41dcd7['push'](_0x41dcd7['shift']());}}}(a131_0x214b,0x88f59));function a131_0xb26d(_0x28d28d,_0x379da1){_0x28d28d=_0x28d28d-0x97;const _0x214b4e=a131_0x214b();let _0xb26d11=_0x214b4e[_0x28d28d];return _0xb26d11;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0xe6451d){const _0x254c97=await buildSchemaPayload();return{'ok':!![],'data':_0x254c97};}export const schemaDefinition={'service':a131_0xce19cb(0xa4),'command':a131_0xce19cb(0xa0),'description':a131_0xce19cb(0x9c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a131_0xce19cb(0xa2),'flags':[],'execute':execute};function a131_0x214b(){const _0x504bb2=['5152095slmPZd','232ILBxrG','export','7700TMQVbf','json','9255280NEiLhq','schema','212113CwIurS','4ibZejO','948mxyZzz','3894odBGOn','365786VsqElB','1gtQVSq','57537QQLZgo','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1535613igYOdD'];a131_0x214b=function(){return _0x504bb2;};return a131_0x214b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a131_0x478666=a131_0xf79d;(function(_0x39201c,_0x6c12e3){const _0x107328=a131_0xf79d,_0x1b60fc=_0x39201c();while(!![]){try{const _0x1c2342=parseInt(_0x107328(0x131))/0x1*(parseInt(_0x107328(0x15d))/0x2)+-parseInt(_0x107328(0x140))/0x3+-parseInt(_0x107328(0x153))/0x4*(-parseInt(_0x107328(0x145))/0x5)+-parseInt(_0x107328(0x126))/0x6*(parseInt(_0x107328(0x13d))/0x7)+-parseInt(_0x107328(0x13b))/0x8*(parseInt(_0x107328(0x13f))/0x9)+parseInt(_0x107328(0x154))/0xa+parseInt(_0x107328(0x124))/0xb;if(_0x1c2342===_0x6c12e3)break;else _0x1b60fc['push'](_0x1b60fc['shift']());}catch(_0x24f50a){_0x1b60fc['push'](_0x1b60fc['shift']());}}}(a131_0x6c0c,0x25d8d));function a131_0x6c0c(){const _0x389ba1=['8qZtRMX','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','602YPZcjg','catch','2248245braKOi','259938mXCgls','Created\x20SQL\x20query\x20','dbName','</select>','Target\x20database\x20ID','97340SXGaCr','mode','isInteger','sqlName','__manual__','请输入\x20SQL\x20名称:','db-id','high-risk-write','new','mybatisXml','sql','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','string','sqlRootDir','16NUjXvy','3053080wAEtAN','isFinite','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','lockFilePath','<server-generated-sqlCode>','length','lastSync','flagMissing','utf8','328582yYUrYP','SQL\x20query\x20display\x20name','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','number','\x20\x20SELECT\x201\x20AS\x20id','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','Local\x20SQL\x20file\x20mode','appCode','stringify','name','dbId\x20必须为正整数','2198361svzavv','flag','17850kAMHdE','MyBatis\x20XML(mybatisXml)','join','validation','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','✎\x20手动输入\x20dbId','请输入目标数据库\x20dbId:','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','str','dbId','description','1VHFvRZ','dbId\x20不能为空','trim','Invalid\x20database\x20selection\x20payload:\x20','sqlCode','请选择本地\x20SQL\x20模式:','nonInteractive','POST','create','File\x20already\x20exists:\x20'];a131_0x6c0c=function(){return _0x389ba1;};return a131_0x6c0c();}import{writeFile}from'node:fs/promises';function a131_0xf79d(_0x4d7f52,_0x9a4104){_0x4d7f52=_0x4d7f52-0x122;const _0x6c0c1b=a131_0x6c0c();let _0xf79dfb=_0x6c0c1b[_0x4d7f52];return _0xf79dfb;}import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x93dcbd){const _0x3e6698=a131_0xf79d;if(_0x93dcbd==='mybatisXml')return[_0x3e6698(0x162),_0x3e6698(0x161),_0x3e6698(0x143),''][_0x3e6698(0x128)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x3e6698(0x128)]('\x0a');}export const sqlCreate={'service':a131_0x478666(0x14f),'command':a131_0x478666(0x139),'description':a131_0x478666(0x12d),'risk':a131_0x478666(0x14c),'flags':[{'name':a131_0x478666(0x122),'type':a131_0x478666(0x151),'description':a131_0x478666(0x15e)},{'name':a131_0x478666(0x14b),'type':a131_0x478666(0x160),'description':a131_0x478666(0x144)},{'name':'mode','type':a131_0x478666(0x151),'enum':[a131_0x478666(0x14f),a131_0x478666(0x14e)],'description':a131_0x478666(0x163)}],async 'validate'(_0x65ab8d){const _0x407904=a131_0x478666;if(!_0x65ab8d[_0x407904(0x137)])return;if(!_0x65ab8d[_0x407904(0x12e)](_0x407904(0x122))['trim']())throw CliErrors[_0x407904(0x15b)](_0x407904(0x122),_0x407904(0x156));const _0x26a261=resolveProvidedDbId(_0x65ab8d);if(typeof _0x26a261!==_0x407904(0x160)||!Number[_0x407904(0x155)](_0x26a261)||_0x26a261<=0x0)throw CliErrors[_0x407904(0x15b)](_0x407904(0x14b),_0x407904(0x150));if(!_0x65ab8d[_0x407904(0x12e)]('mode')[_0x407904(0x133)]())throw CliErrors['flagMissing']('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');},async 'dryRun'(_0x35f57a){const _0x1d33f4=a131_0x478666,_0x27d030=loadSqlProjectConfig(_0x35f57a[_0x1d33f4(0x164)]),{sqlName:_0x4b8d0b,dbId:_0x367347,dbName:_0x45d789,mode:_0x3663c5}=await resolveSqlNewInputs(_0x35f57a),_0x275e6c=buildSqlRelativePath(_0x1d33f4(0x158),_0x4b8d0b,_0x45d789,_0x3663c5,_0x367347),_0x555e52=_0x27d030['sqlRootDir']+'/'+_0x275e6c;return{'method':_0x1d33f4(0x138),'url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x35f57a[_0x1d33f4(0x164)],'sqlName':_0x4b8d0b,'dbId':_0x367347,'mode':_0x3663c5,'localPath':_0x555e52},'description':_0x1d33f4(0x13c)+_0x27d030[_0x1d33f4(0x152)]};},async 'execute'(_0x164a3e){const _0x177ac2=a131_0x478666,_0x23ebeb=loadSqlProjectConfig(_0x164a3e[_0x177ac2(0x164)]),{sqlName:_0x1daaea,dbId:_0x5eb645,dbName:_0x3c6321,mode:_0x126635}=await resolveSqlNewInputs(_0x164a3e),_0x2b82cd=generateSqlTemplate(_0x126635),_0x190912=await createSqlQuery({'appCode':_0x164a3e[_0x177ac2(0x164)],'sqlName':_0x1daaea,'dbId':_0x5eb645,'sqlContent':_0x2b82cd}),_0x282b25=ensureRemoteSqlContent(_0x190912),_0x12051a=_0x3c6321||await getDbName(_0x164a3e['appCode'],_0x5eb645)[_0x177ac2(0x13e)](()=>undefined),_0x3d12bd=buildSqlRelativePath(_0x190912[_0x177ac2(0x135)],_0x190912['sqlName'],_0x12051a,_0x126635,_0x5eb645),_0x5b4ba5=_0x23ebeb['sqlRootDir']+'/'+_0x3d12bd,_0x24a607=buildLocalSqlFileContent({'sqlCode':_0x190912[_0x177ac2(0x135)],'sqlName':_0x190912[_0x177ac2(0x148)],'dbId':_0x190912[_0x177ac2(0x12f)]},_0x282b25,{'dbName':_0x12051a,'mode':_0x126635,'syncedAt':new Date()['toISOString'](),'description':_0x190912[_0x177ac2(0x130)]});if(await fileExists(_0x5b4ba5))throw CliErrors['validation'](_0x177ac2(0x13a)+_0x5b4ba5);await ensureParentDirectory(_0x5b4ba5),await writeFile(_0x5b4ba5,_0x24a607,_0x177ac2(0x15c));const _0x829a3d=await readSqlLockFile(_0x23ebeb[_0x177ac2(0x157)]),{lockData:_0x3ae96b,appLock:_0x4af248}=ensureSqlLockScope(_0x829a3d??createEmptySqlLock(),_0x23ebeb['appCode'],_0x23ebeb['sqlRoot'],_0x177ac2(0x14d));return _0x4af248['sqls'][_0x190912['sqlCode']]={...buildSqlLockEntry(_0x190912,_0x282b25,computeSqlContentHash(_0x24a607),{'dbName':_0x12051a}),'path':_0x3d12bd,'mode':_0x126635},_0x4af248[_0x177ac2(0x15a)]=new Date()['toISOString'](),await writeSqlLockFile(_0x23ebeb[_0x177ac2(0x157)],_0x3ae96b),{'ok':!![],'data':{'id':_0x190912['id'],'sqlCode':_0x190912['sqlCode'],'sqlName':_0x190912[_0x177ac2(0x148)],'dbId':_0x190912[_0x177ac2(0x12f)],'path':_0x5b4ba5,'mode':_0x126635},'message':_0x177ac2(0x141)+_0x190912[_0x177ac2(0x135)]};}};async function resolveSqlNewInputs(_0x5484d1){const _0x573f86=await resolveSqlNameInput(_0x5484d1),{dbId:_0x4c7454,dbName:_0x22cee2}=await resolveDbSelection(_0x5484d1),_0x459e44=await resolveSqlModeInput(_0x5484d1);return{'sqlName':_0x573f86,'dbId':_0x4c7454,'dbName':_0x22cee2,'mode':_0x459e44};}async function resolveSqlNameInput(_0x5d760c){const _0x5190e1=a131_0x478666,_0x3972b8=_0x5d760c[_0x5190e1(0x12e)](_0x5190e1(0x122))[_0x5190e1(0x133)]();if(_0x3972b8)return _0x3972b8;if(_0x5d760c[_0x5190e1(0x137)])throw CliErrors[_0x5190e1(0x15b)]('name','--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x5190e1(0x14a),'validate':_0x3acf04=>_0x3acf04[_0x5190e1(0x133)]()?!![]:'SQL\x20名称不能为空'}))[_0x5190e1(0x133)]();}async function resolveDbSelection(_0x261c33){const _0x4f7c89=a131_0x478666,_0x125b2f=resolveProvidedDbId(_0x261c33);if(typeof _0x125b2f==='number'&&Number['isFinite'](_0x125b2f)&&_0x125b2f>0x0)return{'dbId':_0x125b2f,'dbName':await getDbName(_0x261c33[_0x4f7c89(0x164)],_0x125b2f)[_0x4f7c89(0x13e)](()=>undefined)};if(_0x261c33[_0x4f7c89(0x137)])throw CliErrors['flagMissing'](_0x4f7c89(0x14b),'--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.');const _0x3651a4=await listDatabases(_0x261c33[_0x4f7c89(0x164)])[_0x4f7c89(0x13e)](()=>[]);if(_0x3651a4['length']===0x1)return{'dbId':_0x3651a4[0x0][_0x4f7c89(0x12f)],'dbName':_0x3651a4[0x0][_0x4f7c89(0x142)]};if(_0x3651a4[_0x4f7c89(0x159)]>0x1){const _0x5113b7=await select({'message':'请选择目标数据库:','choices':[..._0x3651a4['map'](_0x1e2473=>({'name':_0x1e2473[_0x4f7c89(0x142)]+'\x20('+_0x1e2473[_0x4f7c89(0x12f)]+')','value':serializeDbSelection(_0x1e2473)})),{'name':_0x4f7c89(0x12b),'value':_0x4f7c89(0x149)}]});if(_0x5113b7!==_0x4f7c89(0x149))return deserializeDbSelection(_0x5113b7);}const _0x5ef495=await input({'message':_0x4f7c89(0x12c),'validate':_0xc17434=>{const _0x48773e=_0x4f7c89,_0x3f08ab=_0xc17434['trim']();if(!_0x3f08ab)return _0x48773e(0x132);const _0x4462aa=Number(_0x3f08ab);if(!Number[_0x48773e(0x147)](_0x4462aa)||_0x4462aa<=0x0)return _0x48773e(0x123);return!![];}});return{'dbId':Number(_0x5ef495[_0x4f7c89(0x133)]())};}async function resolveSqlModeInput(_0x5187f2){const _0xc11c2e=a131_0x478666,_0xb438b0=_0x5187f2[_0xc11c2e(0x12e)](_0xc11c2e(0x146))['trim']();if(_0xb438b0===_0xc11c2e(0x14f)||_0xb438b0===_0xc11c2e(0x14e))return _0xb438b0;if(_0x5187f2[_0xc11c2e(0x137)])throw CliErrors[_0xc11c2e(0x15b)]('mode',_0xc11c2e(0x12a));return await select({'message':_0xc11c2e(0x136),'choices':[{'name':'普通\x20SQL(sql)','value':_0xc11c2e(0x14f),'description':_0xc11c2e(0x15f)},{'name':_0xc11c2e(0x127),'value':_0xc11c2e(0x14e),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function serializeDbSelection(_0x54a532){const _0x6336da=a131_0x478666;return JSON[_0x6336da(0x165)]({'dbId':_0x54a532[_0x6336da(0x12f)],'dbName':_0x54a532[_0x6336da(0x142)]});}function deserializeDbSelection(_0x4f979c){const _0x40902e=a131_0x478666;try{const _0x544488=JSON['parse'](_0x4f979c);if(typeof _0x544488['dbId']===_0x40902e(0x160)&&Number[_0x40902e(0x155)](_0x544488['dbId']))return{'dbId':_0x544488['dbId'],'dbName':_0x544488[_0x40902e(0x142)]};}catch{}throw CliErrors[_0x40902e(0x129)](_0x40902e(0x134)+_0x4f979c);}function resolveProvidedDbId(_0x30018b){const _0x440d9a=a131_0x478666,_0x35b11c=_0x30018b[_0x440d9a(0x125)](_0x440d9a(0x14b));if(typeof _0x35b11c===_0x440d9a(0x160)&&Number[_0x440d9a(0x155)](_0x35b11c))return _0x35b11c;return undefined;}
|
|
1
|
+
const a132_0x1b285c=a132_0x2d5c;(function(_0x2bb9a1,_0x107d99){const _0xaba444=a132_0x2d5c,_0x1079d1=_0x2bb9a1();while(!![]){try{const _0x1ff704=parseInt(_0xaba444(0x1cf))/0x1+-parseInt(_0xaba444(0x1c8))/0x2+-parseInt(_0xaba444(0x1c4))/0x3+-parseInt(_0xaba444(0x1c2))/0x4+-parseInt(_0xaba444(0x1d7))/0x5+parseInt(_0xaba444(0x1ab))/0x6*(parseInt(_0xaba444(0x197))/0x7)+parseInt(_0xaba444(0x1b9))/0x8;if(_0x1ff704===_0x107d99)break;else _0x1079d1['push'](_0x1079d1['shift']());}catch(_0x11df4e){_0x1079d1['push'](_0x1079d1['shift']());}}}(a132_0x4af6,0x66879));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function a132_0x2d5c(_0x575c3c,_0x464110){_0x575c3c=_0x575c3c-0x197;const _0x4af63f=a132_0x4af6();let _0x2d5c27=_0x4af63f[_0x575c3c];return _0x2d5c27;}function generateSqlTemplate(_0x2023f7){const _0x1e7a57=a132_0x2d5c;if(_0x2023f7===_0x1e7a57(0x1c5))return[_0x1e7a57(0x19e),_0x1e7a57(0x1cd),_0x1e7a57(0x1cc),''][_0x1e7a57(0x19d)]('\x0a');return[_0x1e7a57(0x1ce),''][_0x1e7a57(0x19d)]('\x0a');}export const sqlCreate={'service':'sql','command':a132_0x1b285c(0x1bb),'description':a132_0x1b285c(0x1c0),'risk':a132_0x1b285c(0x1b4),'flags':[{'name':a132_0x1b285c(0x1b0),'type':a132_0x1b285c(0x1d4),'description':'SQL\x20query\x20display\x20name'},{'name':a132_0x1b285c(0x1d8),'type':a132_0x1b285c(0x1a4),'description':a132_0x1b285c(0x1a3)},{'name':'mode','type':'string','enum':[a132_0x1b285c(0x19b),a132_0x1b285c(0x1c5)],'description':a132_0x1b285c(0x1b8)}],async 'validate'(_0x4c2160){const _0x5ced61=a132_0x1b285c;if(!_0x4c2160[_0x5ced61(0x1c3)])return;if(!_0x4c2160['str'](_0x5ced61(0x1b0))[_0x5ced61(0x1ad)]())throw CliErrors[_0x5ced61(0x1bc)](_0x5ced61(0x1b0),_0x5ced61(0x1d9));const _0x180a31=resolveProvidedDbId(_0x4c2160);if(typeof _0x180a31!=='number'||!Number[_0x5ced61(0x1ae)](_0x180a31)||_0x180a31<=0x0)throw CliErrors[_0x5ced61(0x1bc)]('db-id',_0x5ced61(0x1a8));if(!_0x4c2160[_0x5ced61(0x1bf)]('mode')['trim']())throw CliErrors[_0x5ced61(0x1bc)](_0x5ced61(0x1a5),_0x5ced61(0x1c9));},async 'dryRun'(_0x325fae){const _0x3b97a9=a132_0x1b285c,_0x2912bd=loadSqlProjectConfig(_0x325fae[_0x3b97a9(0x1d0)]),{sqlName:_0x4aa224,dbId:_0x5c8bcd,dbName:_0xdc1eca,mode:_0x5e8798}=await resolveSqlNewInputs(_0x325fae),_0x4f192f=buildSqlRelativePath(_0x3b97a9(0x1b2),_0x4aa224,_0xdc1eca,_0x5e8798,_0x5c8bcd),_0x1b9e72=_0x2912bd[_0x3b97a9(0x199)]+'/'+_0x4f192f;return{'method':'POST','url':'/smartapi/custom/saveUserCustomSql','body':{'appCode':_0x325fae[_0x3b97a9(0x1d0)],'sqlName':_0x4aa224,'dbId':_0x5c8bcd,'mode':_0x5e8798,'localPath':_0x1b9e72},'description':_0x3b97a9(0x1aa)+_0x2912bd['sqlRootDir']};},async 'execute'(_0x5b3cf1){const _0x4e8a23=a132_0x1b285c,_0x5883aa=loadSqlProjectConfig(_0x5b3cf1[_0x4e8a23(0x1d0)]),{sqlName:_0xf7fa2d,dbId:_0x2b1bee,dbName:_0xe93caf,mode:_0x2dcd00}=await resolveSqlNewInputs(_0x5b3cf1),_0x3e47d6=generateSqlTemplate(_0x2dcd00),_0x4e8e61=await createSqlQuery({'appCode':_0x5b3cf1[_0x4e8a23(0x1d0)],'sqlName':_0xf7fa2d,'dbId':_0x2b1bee,'sqlContent':_0x3e47d6}),_0x5a1368=ensureRemoteSqlContent(_0x4e8e61),_0x17745e=_0xe93caf||await getDbName(_0x5b3cf1[_0x4e8a23(0x1d0)],_0x2b1bee)[_0x4e8a23(0x1be)](()=>undefined),_0x207501=buildSqlRelativePath(_0x4e8e61[_0x4e8a23(0x1bd)],_0x4e8e61[_0x4e8a23(0x1ac)],_0x17745e,_0x2dcd00,_0x2b1bee),_0x5533b8=_0x5883aa[_0x4e8a23(0x199)]+'/'+_0x207501,_0x27167a=buildLocalSqlFileContent({'sqlCode':_0x4e8e61[_0x4e8a23(0x1bd)],'sqlName':_0x4e8e61[_0x4e8a23(0x1ac)],'dbId':_0x4e8e61['dbId']},_0x5a1368,{'dbName':_0x17745e,'mode':_0x2dcd00,'syncedAt':new Date()[_0x4e8a23(0x1d3)](),'description':_0x4e8e61[_0x4e8a23(0x1ca)]});if(await fileExists(_0x5533b8))throw CliErrors[_0x4e8a23(0x1a0)](_0x4e8a23(0x1b5)+_0x5533b8);await ensureParentDirectory(_0x5533b8),await writeFile(_0x5533b8,_0x27167a,_0x4e8a23(0x1ba));const _0x43c3e6=await readSqlLockFile(_0x5883aa[_0x4e8a23(0x1af)]),{lockData:_0x55353,appLock:_0x24ca81}=ensureSqlLockScope(_0x43c3e6??createEmptySqlLock(),_0x5883aa['appCode'],_0x5883aa[_0x4e8a23(0x1a6)],_0x4e8a23(0x1d2));return _0x24ca81[_0x4e8a23(0x1cb)][_0x4e8e61[_0x4e8a23(0x1bd)]]={...buildSqlLockEntry(_0x4e8e61,_0x5a1368,computeSqlContentHash(_0x27167a),{'dbName':_0x17745e}),'path':_0x207501,'mode':_0x2dcd00},_0x24ca81[_0x4e8a23(0x1d5)]=new Date()[_0x4e8a23(0x1d3)](),await writeSqlLockFile(_0x5883aa['lockFilePath'],_0x55353),{'ok':!![],'data':{'id':_0x4e8e61['id'],'sqlCode':_0x4e8e61[_0x4e8a23(0x1bd)],'sqlName':_0x4e8e61[_0x4e8a23(0x1ac)],'dbId':_0x4e8e61[_0x4e8a23(0x1d1)],'path':_0x5533b8,'mode':_0x2dcd00},'message':_0x4e8a23(0x19f)+_0x4e8e61[_0x4e8a23(0x1bd)]};}};async function resolveSqlNewInputs(_0x4d7bb0){const _0x2b4eb2=await resolveSqlNameInput(_0x4d7bb0),{dbId:_0x31dc27,dbName:_0x184e03}=await resolveDbSelection(_0x4d7bb0),_0x7611e5=await resolveSqlModeInput(_0x4d7bb0);return{'sqlName':_0x2b4eb2,'dbId':_0x31dc27,'dbName':_0x184e03,'mode':_0x7611e5};}async function resolveSqlNameInput(_0x37935d){const _0x5df8b1=a132_0x1b285c,_0x59a175=_0x37935d[_0x5df8b1(0x1bf)](_0x5df8b1(0x1b0))['trim']();if(_0x59a175)return _0x59a175;if(_0x37935d[_0x5df8b1(0x1c3)])throw CliErrors[_0x5df8b1(0x1bc)](_0x5df8b1(0x1b0),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x5df8b1(0x1c7),'validate':_0xf0474=>_0xf0474[_0x5df8b1(0x1ad)]()?!![]:_0x5df8b1(0x1c1)}))[_0x5df8b1(0x1ad)]();}async function resolveDbSelection(_0x292728){const _0x2a44f0=a132_0x1b285c,_0xb5311f=resolveProvidedDbId(_0x292728);if(typeof _0xb5311f==='number'&&Number['isFinite'](_0xb5311f)&&_0xb5311f>0x0)return{'dbId':_0xb5311f,'dbName':await getDbName(_0x292728[_0x2a44f0(0x1d0)],_0xb5311f)[_0x2a44f0(0x1be)](()=>undefined)};if(_0x292728[_0x2a44f0(0x1c3)])throw CliErrors['flagMissing'](_0x2a44f0(0x1d8),_0x2a44f0(0x1a8));const _0x3d3c59=await listDatabases(_0x292728[_0x2a44f0(0x1d0)])[_0x2a44f0(0x1be)](()=>[]);if(_0x3d3c59[_0x2a44f0(0x19c)]===0x1)return{'dbId':_0x3d3c59[0x0][_0x2a44f0(0x1d1)],'dbName':_0x3d3c59[0x0][_0x2a44f0(0x1c6)]};if(_0x3d3c59[_0x2a44f0(0x19c)]>0x1){const _0x11b7ac=await select({'message':_0x2a44f0(0x198),'choices':[..._0x3d3c59[_0x2a44f0(0x1a7)](_0x114f80=>({'name':_0x114f80[_0x2a44f0(0x1c6)]+'\x20('+_0x114f80[_0x2a44f0(0x1d1)]+')','value':serializeDbSelection(_0x114f80)})),{'name':_0x2a44f0(0x1b7),'value':'__manual__'}]});if(_0x11b7ac!==_0x2a44f0(0x1b1))return deserializeDbSelection(_0x11b7ac);}const _0x548eab=await input({'message':_0x2a44f0(0x1a1),'validate':_0x39dca8=>{const _0x13813f=_0x2a44f0,_0x17099c=_0x39dca8[_0x13813f(0x1ad)]();if(!_0x17099c)return _0x13813f(0x1a2);const _0x2d9509=Number(_0x17099c);if(!Number['isInteger'](_0x2d9509)||_0x2d9509<=0x0)return'dbId\x20必须为正整数';return!![];}});return{'dbId':Number(_0x548eab[_0x2a44f0(0x1ad)]())};}async function resolveSqlModeInput(_0x575a33){const _0x470c7b=a132_0x1b285c,_0xe27c84=_0x575a33['str'](_0x470c7b(0x1a5))[_0x470c7b(0x1ad)]();if(_0xe27c84==='sql'||_0xe27c84===_0x470c7b(0x1c5))return _0xe27c84;if(_0x575a33['nonInteractive'])throw CliErrors[_0x470c7b(0x1bc)]('mode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x470c7b(0x19a),'value':'sql','description':_0x470c7b(0x1b3)},{'name':'MyBatis\x20XML(mybatisXml)','value':_0x470c7b(0x1c5),'description':_0x470c7b(0x1d6)}]});}function serializeDbSelection(_0x9ad792){const _0x5bf234=a132_0x1b285c;return JSON[_0x5bf234(0x1a9)]({'dbId':_0x9ad792[_0x5bf234(0x1d1)],'dbName':_0x9ad792[_0x5bf234(0x1c6)]});}function deserializeDbSelection(_0x1638a1){const _0x52d295=a132_0x1b285c;try{const _0x541fc0=JSON['parse'](_0x1638a1);if(typeof _0x541fc0[_0x52d295(0x1d1)]===_0x52d295(0x1a4)&&Number['isFinite'](_0x541fc0[_0x52d295(0x1d1)]))return{'dbId':_0x541fc0[_0x52d295(0x1d1)],'dbName':_0x541fc0[_0x52d295(0x1c6)]};}catch{}throw CliErrors[_0x52d295(0x1a0)]('Invalid\x20database\x20selection\x20payload:\x20'+_0x1638a1);}function a132_0x4af6(){const _0x16062d=['utf8','create','flagMissing','sqlCode','catch','str','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','SQL\x20名称不能为空','2067380MKifUS','nonInteractive','1719507LWIUjn','mybatisXml','dbName','请输入\x20SQL\x20名称:','264416SALeRJ','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','description','sqls','</select>','\x20\x20SELECT\x201\x20AS\x20id','SELECT\x201\x20AS\x20id;','90366SlOrFB','appCode','dbId','new','toISOString','string','lastSync','适合带动态标签的\x20MyBatis\x20XML\x20SQL','3738215IglwaG','db-id','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','259PZXUeo','请选择目标数据库:','sqlRootDir','普通\x20SQL(sql)','sql','length','join','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','Created\x20SQL\x20query\x20','validation','请输入目标数据库\x20dbId:','dbId\x20不能为空','Target\x20database\x20ID','number','mode','sqlRoot','map','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','stringify','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','135138bgPYdv','sqlName','trim','isFinite','lockFilePath','name','__manual__','<server-generated-sqlCode>','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','high-risk-write','File\x20already\x20exists:\x20','flag','✎\x20手动输入\x20dbId','Local\x20SQL\x20file\x20mode','11728872kSCrNh'];a132_0x4af6=function(){return _0x16062d;};return a132_0x4af6();}function resolveProvidedDbId(_0xbc9814){const _0x189a01=a132_0x1b285c,_0x73bdcc=_0xbc9814[_0x189a01(0x1b6)](_0x189a01(0x1d8));if(typeof _0x73bdcc===_0x189a01(0x1a4)&&Number['isFinite'](_0x73bdcc))return _0x73bdcc;return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a133_0x106df0=a133_0x36c6;(function(_0x3603e1,_0x582f26){const _0x1c5860=a133_0x36c6,_0x58f77a=_0x3603e1();while(!![]){try{const _0x8e3d=-parseInt(_0x1c5860(0x1a4))/0x1+-parseInt(_0x1c5860(0x1ab))/0x2*(parseInt(_0x1c5860(0x1b9))/0x3)+-parseInt(_0x1c5860(0x1bf))/0x4*(parseInt(_0x1c5860(0x1b3))/0x5)+-parseInt(_0x1c5860(0x1aa))/0x6+-parseInt(_0x1c5860(0x1a3))/0x7*(-parseInt(_0x1c5860(0x1a7))/0x8)+-parseInt(_0x1c5860(0x1b2))/0x9*(parseInt(_0x1c5860(0x1ae))/0xa)+parseInt(_0x1c5860(0x1af))/0xb;if(_0x8e3d===_0x582f26)break;else _0x58f77a['push'](_0x58f77a['shift']());}catch(_0x54a18a){_0x58f77a['push'](_0x58f77a['shift']());}}}(a133_0x2e2d,0xd25a1));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a133_0x2e2d(){const _0x1beb0f=['2397198eXdoDj','2zJxiWF','sqlRoot','Deleted\x20','7610KEfQTn','28915623CqrevH','appCode','sqlcode','801XVugKF','205ZFEeze','POST','trashDir','lastSync','Would\x20delete\x20SQL\x20','toISOString','1443513kmlihD','validation','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','\x20(local\x20file\x20moved\x20to\x20trash)','filter','53776XsRxGj','fromEntries','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','length','sqls','high-risk-write','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','delete','lockFilePath','14VXMFNH','1683117YvWrGA','remoteId','sqlRootDir','5662648HEeVcY','str','sql'];a133_0x2e2d=function(){return _0x1beb0f;};return a133_0x2e2d();}import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a133_0x106df0(0x1a9),'command':a133_0x106df0(0x1a1),'description':a133_0x106df0(0x1bc),'risk':a133_0x106df0(0x1c4),'flags':[SQLCODE_FLAG],async 'validate'(_0xfe3c4a){const _0x2ccc2b=a133_0x106df0,_0x1a32c8=loadSqlProjectConfig(_0xfe3c4a['appCode']),_0x48bbeb=await readSqlLockFile(_0x1a32c8[_0x2ccc2b(0x1a2)]);if(!_0x48bbeb)throw CliErrors[_0x2ccc2b(0x1ba)](_0x2ccc2b(0x1a0));},async 'dryRun'(_0x30d3f4){const _0x3a356f=a133_0x106df0,_0x25fd98=loadSqlProjectConfig(_0x30d3f4[_0x3a356f(0x1b0)]),_0xa6a050=await readSqlLockFile(_0x25fd98[_0x3a356f(0x1a2)]);if(!_0xa6a050)throw CliErrors[_0x3a356f(0x1ba)](_0x3a356f(0x1a0));const {appLock:_0x337e25}=ensureSqlLockScope(_0xa6a050,_0x30d3f4[_0x3a356f(0x1b0)],_0x25fd98[_0x3a356f(0x1ac)],_0x3a356f(0x1a1)),_0x2b8b3b=_0x30d3f4['str'](_0x3a356f(0x1b1)),_0x373783=_0x337e25[_0x3a356f(0x1c3)][_0x2b8b3b];if(!_0x373783)throw CliErrors['validation'](_0x3a356f(0x1bb)+_0x2b8b3b+'\x22.');return{'method':_0x3a356f(0x1b4),'url':'/smartapi/custom/deleteUserCustomSql','body':{'sqlCode':_0x2b8b3b,'id':_0x373783[_0x3a356f(0x1a5)],'localPath':resolveLocalSqlFilePath(_0x25fd98,_0x2b8b3b,_0x373783)},'description':_0x3a356f(0x1b7)+_0x2b8b3b+_0x3a356f(0x1c1)+_0x25fd98['trashDir']};},async 'execute'(_0x43d0d0){const _0x5a05d3=a133_0x106df0,_0x5bc24a=loadSqlProjectConfig(_0x43d0d0[_0x5a05d3(0x1b0)]),_0x3149fa=await readSqlLockFile(_0x5bc24a[_0x5a05d3(0x1a2)]);if(!_0x3149fa)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.');const {lockData:_0x44ff73,appLock:_0x3caf60}=ensureSqlLockScope(_0x3149fa,_0x43d0d0[_0x5a05d3(0x1b0)],_0x5bc24a[_0x5a05d3(0x1ac)],_0x5a05d3(0x1a1)),_0x245631=_0x43d0d0[_0x5a05d3(0x1a8)](_0x5a05d3(0x1b1)),_0x53da30=_0x3caf60['sqls'][_0x245631];if(!_0x53da30)throw CliErrors['validation'](_0x5a05d3(0x1bb)+_0x245631+'\x22.');await deleteSqlQuery({'id':_0x53da30[_0x5a05d3(0x1a5)],'sqlCode':_0x245631}),_0x3caf60[_0x5a05d3(0x1c3)]=Object[_0x5a05d3(0x1c0)](Object['entries'](_0x3caf60[_0x5a05d3(0x1c3)])[_0x5a05d3(0x1be)](([_0x17b671])=>_0x17b671!==_0x245631)),_0x3caf60[_0x5a05d3(0x1b6)]=new Date()[_0x5a05d3(0x1b8)](),await writeSqlLockFile(_0x5bc24a[_0x5a05d3(0x1a2)],_0x44ff73);const _0xad2afb=resolveLocalSqlFilePath(_0x5bc24a,_0x245631,_0x53da30);let _0x53b92c;await fileExists(_0xad2afb)&&(_0x53b92c=await moveToTrash(_0x5bc24a['projectRoot'],_0x5bc24a[_0x5a05d3(0x1b5)],_0xad2afb),await cleanupEmptyDirectories(dirname(_0xad2afb),_0x5bc24a[_0x5a05d3(0x1a6)]));const _0x3bbc24={'deleted':_0x245631,'remoteId':_0x53da30['remoteId']};if(_0x53b92c)_0x3bbc24['trashedTo']=_0x53b92c;return{'ok':!![],'data':_0x3bbc24,'message':_0x5a05d3(0x1ad)+_0x245631+(_0x53b92c?_0x5a05d3(0x1bd):'')};}};async function moveToTrash(_0x3b3a67,_0x1ec7dc,_0x126829){const _0x1d925f=a133_0x106df0,_0x1605ff=new Date()[_0x1d925f(0x1b8)]()['replace'](/[:.]/g,'-'),_0x36880f=relative(_0x3b3a67,_0x126829),_0x2b5db9=join(_0x1ec7dc,_0x1605ff,_0x36880f);return await mkdir(dirname(_0x2b5db9),{'recursive':!![]}),await rename(_0x126829,_0x2b5db9),_0x2b5db9;}function a133_0x36c6(_0xce260b,_0x87b019){_0xce260b=_0xce260b-0x1a0;const _0x2e2d2a=a133_0x2e2d();let _0x36c6d7=_0x2e2d2a[_0xce260b];return _0x36c6d7;}async function cleanupEmptyDirectories(_0x4accc7,_0x1fc845){const _0x1278f5=a133_0x106df0;let _0x57a75f=resolve(_0x4accc7);const _0x46bd36=resolve(_0x1fc845);while(_0x57a75f['startsWith'](''+_0x46bd36+sep)||_0x57a75f===_0x46bd36){if(_0x57a75f===_0x46bd36)return;try{const _0x56b257=await readdir(_0x57a75f);if(_0x56b257[_0x1278f5(0x1c2)]>0x0)return;await rmdir(_0x57a75f);}catch{return;}_0x57a75f=dirname(_0x57a75f);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a134_0x109183=a134_0xf0d1;function a134_0x5d9a(){const _0x37cefe=['str','sql','sqlName','2264840okdepx','Return\x20full\x20raw\x20SQL\x20query\x20object','appCode','95898TIMZCY','read','3966564QbYVTK','detail','10mgwWtS','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','bool','description','4HcVxvU','4177116WLUWwU','sqlContent','31212PcTtIB','18nUenjv','boolean','286213QhxPYQ','16inCuVn','33OgPePc','dbId','sqlcode','verbose','378725LzNkIn'];a134_0x5d9a=function(){return _0x37cefe;};return a134_0x5d9a();}function a134_0xf0d1(_0x1e0832,_0x15fd37){_0x1e0832=_0x1e0832-0x141;const _0x5d9a98=a134_0x5d9a();let _0xf0d1a=_0x5d9a98[_0x1e0832];return _0xf0d1a;}(function(_0x3a7fb0,_0x88d283){const _0x269d4b=a134_0xf0d1,_0x415105=_0x3a7fb0();while(!![]){try{const _0xde888e=parseInt(_0x269d4b(0x153))/0x1*(parseInt(_0x269d4b(0x14d))/0x2)+-parseInt(_0x269d4b(0x145))/0x3*(-parseInt(_0x269d4b(0x154))/0x4)+parseInt(_0x269d4b(0x159))/0x5*(-parseInt(_0x269d4b(0x151))/0x6)+parseInt(_0x269d4b(0x147))/0x7+-parseInt(_0x269d4b(0x142))/0x8+-parseInt(_0x269d4b(0x14e))/0x9*(parseInt(_0x269d4b(0x149))/0xa)+parseInt(_0x269d4b(0x155))/0xb*(parseInt(_0x269d4b(0x150))/0xc);if(_0xde888e===_0x88d283)break;else _0x415105['push'](_0x415105['shift']());}catch(_0x4834a6){_0x415105['push'](_0x415105['shift']());}}}(a134_0x5d9a,0x494f9));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a134_0x109183(0x15b),'command':a134_0x109183(0x148),'description':a134_0x109183(0x14a),'risk':a134_0x109183(0x146),'flags':[SQLCODE_FLAG,{'name':a134_0x109183(0x158),'type':a134_0x109183(0x152),'description':a134_0x109183(0x143)}],async 'execute'(_0x3e764f){const _0xe59b16=a134_0x109183,_0x879449=await getSqlQueryInfo(_0x3e764f[_0xe59b16(0x144)],_0x3e764f[_0xe59b16(0x15a)](_0xe59b16(0x157))),_0x112da1=_0x3e764f[_0xe59b16(0x14b)](_0xe59b16(0x158));if(_0x112da1)return{'ok':!![],'data':_0x879449};const _0x16112e=_0x879449[_0xe59b16(0x156)]?await getDbName(_0x3e764f[_0xe59b16(0x144)],_0x879449[_0xe59b16(0x156)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x879449['sqlCode'],'sqlName':_0x879449[_0xe59b16(0x141)],'db':_0x16112e?_0x16112e+'\x20('+_0x879449[_0xe59b16(0x156)]+')':_0x879449[_0xe59b16(0x156)]??'','description':_0x879449[_0xe59b16(0x14c)]??'','sqlContent':_0x879449[_0xe59b16(0x14f)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x548bda=a135_0x2748;function a135_0x2748(_0x5a04e8,_0x11637c){_0x5a04e8=_0x5a04e8-0xab;const _0x3ce8a4=a135_0x3ce8();let _0x2748f8=_0x3ce8a4[_0x5a04e8];return _0x2748f8;}(function(_0x1b3513,_0x48cc70){const _0x57954d=a135_0x2748,_0x3f389c=_0x1b3513();while(!![]){try{const _0x352550=-parseInt(_0x57954d(0xb1))/0x1+-parseInt(_0x57954d(0xb5))/0x2+parseInt(_0x57954d(0xaf))/0x3+parseInt(_0x57954d(0xad))/0x4+parseInt(_0x57954d(0xbf))/0x5*(parseInt(_0x57954d(0xb6))/0x6)+-parseInt(_0x57954d(0xbe))/0x7*(parseInt(_0x57954d(0xb4))/0x8)+-parseInt(_0x57954d(0xbb))/0x9*(parseInt(_0x57954d(0xc3))/0xa);if(_0x352550===_0x48cc70)break;else _0x3f389c['push'](_0x3f389c['shift']());}catch(_0x222abd){_0x3f389c['push'](_0x3f389c['shift']());}}}(a135_0x3ce8,0xcfad9));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a135_0x3ce8(){const _0x549f42=['execResult','4220372HsNyWr','execError','1990143bkryXt','Returned\x20','547191icDqMu','SQL\x20execution\x20failed','read','280mWTjvw','592324IXhXts','2208462qXdTnS','sql','string','isArray','execSuccess','2801556NCSAoe','appCode','now','101227HfmLTh','15fqeUgr','length','params','str','20CeEQQi','sqlcode'];a135_0x3ce8=function(){return _0x549f42;};return a135_0x3ce8();}export const sqlExec={'service':a135_0x548bda(0xb7),'command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a135_0x548bda(0xb3),'flags':[SQLCODE_FLAG,{'name':a135_0x548bda(0xc1),'type':a135_0x548bda(0xb8),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0xa728b1){const _0x163d18=a135_0x548bda,_0x50a254=parseJsonParams(_0xa728b1[_0x163d18(0xc2)]('params')),_0x1a0dd6=Date['now'](),_0x346e8f=await executeSql(_0xa728b1[_0x163d18(0xbc)],_0xa728b1[_0x163d18(0xc2)](_0x163d18(0xab)),_0x50a254),_0xa5248b=Date[_0x163d18(0xbd)]()-_0x1a0dd6,_0x347d8a=_0x346e8f?.[_0x163d18(0xac)]??_0x346e8f,_0x250bb7=_0x346e8f?.[_0x163d18(0xba)]??!![];if(!_0x250bb7)return{'ok':![],'data':{'error':_0x346e8f?.[_0x163d18(0xae)]||_0x163d18(0xb2),'elapsed':_0xa5248b},'message':_0x163d18(0xb2)};const _0x1c55c4=Array[_0x163d18(0xb9)](_0x347d8a)?_0x347d8a:[];return{'ok':!![],'data':{'rows':_0x1c55c4,'rowCount':_0x1c55c4[_0x163d18(0xc0)],'elapsed':_0xa5248b},'message':_0x163d18(0xb0)+_0x1c55c4['length']+'\x20row(s)\x20in\x20'+_0xa5248b+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a136_0x2ab4(_0x38e771,_0x4e2095){_0x38e771=_0x38e771-0xea;const _0x5c8628=a136_0x5c86();let _0x2ab489=_0x5c8628[_0x38e771];return _0x2ab489;}(function(_0x2f8d50,_0x37cf36){const _0x1dca7a=a136_0x2ab4,_0x45f503=_0x2f8d50();while(!![]){try{const _0x36b03c=-parseInt(_0x1dca7a(0xf2))/0x1+parseInt(_0x1dca7a(0xee))/0x2*(parseInt(_0x1dca7a(0xf0))/0x3)+parseInt(_0x1dca7a(0xeb))/0x4+-parseInt(_0x1dca7a(0xf3))/0x5*(parseInt(_0x1dca7a(0xf1))/0x6)+-parseInt(_0x1dca7a(0xef))/0x7*(-parseInt(_0x1dca7a(0xed))/0x8)+-parseInt(_0x1dca7a(0xea))/0x9+parseInt(_0x1dca7a(0xec))/0xa;if(_0x36b03c===_0x37cf36)break;else _0x45f503['push'](_0x45f503['shift']());}catch(_0x2a753e){_0x45f503['push'](_0x45f503['shift']());}}}(a136_0x5c86,0xe6fff));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a136_0x5c86(){const _0x33782f=['2ZkyGQv','7441945BIcfOU','2204841vBNBLg','142032DMRNlf','1123640XHlndA','295FVwWkx','145206NWluqU','196948AuNxxz','16352780WOawAT','8UxNpaJ'];a136_0x5c86=function(){return _0x33782f;};return a136_0x5c86();}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x5d7268=a137_0x4387;(function(_0x17f1dd,_0x4eb2a1){const _0x24400a=a137_0x4387,_0x3a052b=_0x17f1dd();while(!![]){try{const _0x613867=-parseInt(_0x24400a(0x140))/0x1+parseInt(_0x24400a(0x137))/0x2*(parseInt(_0x24400a(0x13a))/0x3)+parseInt(_0x24400a(0x124))/0x4+-parseInt(_0x24400a(0x127))/0x5*(-parseInt(_0x24400a(0x13f))/0x6)+parseInt(_0x24400a(0x12e))/0x7*(-parseInt(_0x24400a(0x128))/0x8)+-parseInt(_0x24400a(0x121))/0x9*(-parseInt(_0x24400a(0x142))/0xa)+-parseInt(_0x24400a(0x126))/0xb*(-parseInt(_0x24400a(0x133))/0xc);if(_0x613867===_0x4eb2a1)break;else _0x3a052b['push'](_0x3a052b['shift']());}catch(_0xbb218e){_0x3a052b['push'](_0x3a052b['shift']());}}}(a137_0x2460,0xa9a52));import{listSqlQueries}from'../../core/api-client.js';function a137_0x4387(_0x1ad7ba,_0x1186f5){_0x1ad7ba=_0x1ad7ba-0x120;const _0x24603d=a137_0x2460();let _0x4387ae=_0x24603d[_0x1ad7ba];return _0x4387ae;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a137_0x2460(){const _0x12e631=['bool','7389963gCmDsm','List\x20custom\x20SQL\x20queries','num','number','totalCount','15947772FTdYiL','\x20SQL\x20queries\x20(total:\x20','sqlName','description','260016mEpZTt','Filter\x20by\x20SQL\x20name','page','3xbGntS','paging','str','Found\x20','sql','1194oizyfw','1065005lWCPKs','verbose','174700BOwCHm','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Page\x20number','appCode','all','name','read','315jOQtEr','pagesize','map','237548oDTsYg','string','11mbGrSM','17230yvkwWg','8MFdNXq','list','tableData','length','dbId'];a137_0x2460=function(){return _0x12e631;};return a137_0x2460();}export const sqlList={'service':a137_0x5d7268(0x13e),'command':a137_0x5d7268(0x129),'description':a137_0x5d7268(0x12f),'risk':a137_0x5d7268(0x120),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a137_0x5d7268(0x147),'type':a137_0x5d7268(0x125),'description':a137_0x5d7268(0x138)},{'name':'page','type':a137_0x5d7268(0x131),'description':a137_0x5d7268(0x144),'default':0x1},{'name':a137_0x5d7268(0x122),'type':a137_0x5d7268(0x131),'description':'Page\x20size'},{'name':a137_0x5d7268(0x141),'type':'boolean','description':a137_0x5d7268(0x143)}],async 'execute'(_0x45644c){const _0x2563fd=a137_0x5d7268,_0x126789=await listSqlQueries(_0x45644c[_0x2563fd(0x145)],{'sqlCode':_0x45644c['str']('sqlcode')||undefined,'sqlName':_0x45644c[_0x2563fd(0x13c)](_0x2563fd(0x147))||undefined,'currentPage':_0x45644c[_0x2563fd(0x130)](_0x2563fd(0x139)),'pageSize':_0x45644c[_0x2563fd(0x130)](_0x2563fd(0x122),0x32)}),_0xb125cf=_0x45644c[_0x2563fd(0x12d)](_0x2563fd(0x141)),_0x1f60a9=_0x126789[_0x2563fd(0x12a)]??[],_0x4f41db=_0x126789[_0x2563fd(0x13b)]?.[_0x2563fd(0x132)]??_0x1f60a9['length'];let _0x52ca11;return _0xb125cf?_0x52ca11=_0x1f60a9:_0x52ca11=await Promise[_0x2563fd(0x146)](_0x1f60a9[_0x2563fd(0x123)](async _0xfe2ffa=>{const _0x1f4917=_0x2563fd;let _0x41ee02;try{_0x41ee02=_0xfe2ffa[_0x1f4917(0x12c)]?await getDbName(_0x45644c[_0x1f4917(0x145)],_0xfe2ffa[_0x1f4917(0x12c)]):undefined;}catch{}return{'sqlCode':_0xfe2ffa['sqlCode'],'sqlName':_0xfe2ffa[_0x1f4917(0x135)],'description':_0xfe2ffa[_0x1f4917(0x136)]??'','db':_0x41ee02?_0x41ee02+'\x20('+_0xfe2ffa[_0x1f4917(0x12c)]+')':_0xfe2ffa[_0x1f4917(0x12c)]??''};})),{'ok':!![],'data':_0x52ca11,'message':_0x1f60a9[_0x2563fd(0x12b)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x2563fd(0x13d)+_0x1f60a9[_0x2563fd(0x12b)]+_0x2563fd(0x134)+_0x4f41db+').'};}};
|