@lovrabet/rabetbase-cli 2.1.1 → 2.1.2-beta.0
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 -0
- 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 -0
- 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 -0
- 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/auth/index.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/new.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-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/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.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/logs/index.js +1 -1
- package/lib/commands/menu/index.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/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/skill/index.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/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -0
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -0
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -0
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -0
- 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/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 -0
- 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/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/config.js +1 -1
- package/lib/utils/copy-directory.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/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/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 +3 -2
- package/lib/commands/api/doc.js +0 -1
- package/lib/commands/app/remote.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a88_0x26ea(_0x3a642f,_0x44fb23){_0x3a642f=_0x3a642f-0x154;const _0x3eaa05=a88_0x3eaa();let _0x26eaf7=_0x3eaa05[_0x3a642f];return _0x26eaf7;}const a88_0x552e97=a88_0x26ea;(function(_0x591d6f,_0x4bd8e1){const _0x468c48=a88_0x26ea,_0x5c6d32=_0x591d6f();while(!![]){try{const _0xe6cdba=-parseInt(_0x468c48(0x16a))/0x1*(parseInt(_0x468c48(0x15f))/0x2)+parseInt(_0x468c48(0x16f))/0x3+parseInt(_0x468c48(0x170))/0x4+-parseInt(_0x468c48(0x155))/0x5*(-parseInt(_0x468c48(0x171))/0x6)+parseInt(_0x468c48(0x176))/0x7+parseInt(_0x468c48(0x15b))/0x8+parseInt(_0x468c48(0x168))/0x9*(-parseInt(_0x468c48(0x165))/0xa);if(_0xe6cdba===_0x4bd8e1)break;else _0x5c6d32['push'](_0x5c6d32['shift']());}catch(_0x394d5d){_0x5c6d32['push'](_0x5c6d32['shift']());}}}(a88_0x3eaa,0xcaef6));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a88_0x552e97(0x166),'type':a88_0x552e97(0x16e),'description':a88_0x552e97(0x177)},{'name':'env','type':a88_0x552e97(0x16e),'description':a88_0x552e97(0x164)},{'name':'yes','type':a88_0x552e97(0x15c),'description':'Auto-confirm\x20prompts','default':![]}],createFlags=[{'name':'name','type':'string','description':'Project\x20name'},{'name':'env','type':a88_0x552e97(0x16e),'description':a88_0x552e97(0x164)},{'name':a88_0x552e97(0x166),'type':a88_0x552e97(0x16e),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':'yes','type':a88_0x552e97(0x15c),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a88_0x552e97(0x173),'command':a88_0x552e97(0x161),'description':a88_0x552e97(0x169),'risk':a88_0x552e97(0x157),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x3c7675){const _0x538901=a88_0x552e97;return await initConfig({'appcode':_0x3c7675[_0x538901(0x16c)](_0x538901(0x166))||undefined,'env':_0x3c7675[_0x538901(0x16c)](_0x538901(0x174))||undefined,'autoYes':_0x3c7675[_0x538901(0x163)](_0x538901(0x15d))}),{'ok':!![]};}},{'service':a88_0x552e97(0x173),'command':a88_0x552e97(0x15a),'description':a88_0x552e97(0x158),'risk':a88_0x552e97(0x157),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x3ae4d2){const _0x3acaf4=a88_0x552e97,{createApp:_0x396c95}=await import(_0x3acaf4(0x16d)),{createProjectNonInteractive:_0x1ff45d}=await import('../../commands/project/create/non-interactive.js'),_0x232dbe=_0x3ae4d2[_0x3acaf4(0x16c)]('name')[_0x3acaf4(0x167)]()||_0x3ae4d2[_0x3acaf4(0x162)][0x0]?.[_0x3acaf4(0x167)](),_0x409515=_0x3ae4d2[_0x3acaf4(0x16c)](_0x3acaf4(0x174))||undefined,_0x2517cd=_0x3ae4d2[_0x3acaf4(0x16c)](_0x3acaf4(0x166))||undefined;if(_0x3ae4d2['nonInteractive']){if(!_0x232dbe)throw CliErrors[_0x3acaf4(0x156)](_0x3acaf4(0x15e),_0x3acaf4(0x159)+CLI_BIN_NAME+_0x3acaf4(0x154));await _0x1ff45d(_0x232dbe,_0x409515,_0x2517cd,_0x3ae4d2['cookie']);}else await _0x396c95({'projectCode':_0x232dbe,'appCode':_0x2517cd,'env':_0x409515,'cookie':_0x3ae4d2[_0x3acaf4(0x160)]});return{'ok':!![]};}},{'service':a88_0x552e97(0x173),'command':a88_0x552e97(0x16b),'description':a88_0x552e97(0x175),'risk':a88_0x552e97(0x157),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x18a86e){const _0x28e258=a88_0x552e97;return await upgradeApp(_0x18a86e[_0x28e258(0x172)],{'yes':_0x18a86e[_0x28e258(0x163)](_0x28e258(0x15d))}),{'ok':!![]};}}];function a88_0x3eaa(){const _0x490d65=['validation','write','Create\x20a\x20new\x20project','Usage:\x20','create','2284608RjPVpI','boolean','yes','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','156mPxegd','cookie','init','args','bool','Target\x20environment','3130obuxiG','appcode','trim','68193uPperg','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','2886PCtFUo','upgrade','str','../../commands/project/create/main.js','string','2074629RdWaMx','4124772fUbUQD','110022HstkFL','nonInteractive','project','env','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','7113435JuvLWa','App\x20code\x20to\x20initialize','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','110PKlifi'];a88_0x3eaa=function(){return _0x490d65;};return a88_0x3eaa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x569d57,_0x3d5151){const _0x554bc0=a89_0x51fc,_0x24a26e=_0x569d57();while(!![]){try{const _0x4adc8b=-parseInt(_0x554bc0(0x214))/0x1+parseInt(_0x554bc0(0x1f3))/0x2+parseInt(_0x554bc0(0x1f9))/0x3*(parseInt(_0x554bc0(0x20f))/0x4)+-parseInt(_0x554bc0(0x1f6))/0x5*(parseInt(_0x554bc0(0x206))/0x6)+parseInt(_0x554bc0(0x213))/0x7*(-parseInt(_0x554bc0(0x212))/0x8)+-parseInt(_0x554bc0(0x203))/0x9*(parseInt(_0x554bc0(0x1ea))/0xa)+parseInt(_0x554bc0(0x1fc))/0xb;if(_0x4adc8b===_0x3d5151)break;else _0x24a26e['push'](_0x24a26e['shift']());}catch(_0x27206c){_0x24a26e['push'](_0x24a26e['shift']());}}}(a89_0xf19a,0x6bc78));import{readFileSync,existsSync,renameSync}from'node:fs';function a89_0xf19a(){const _0xb5a832=['\x20\x20Apps:\x20','21326635xtQJhl','\x20api\x20generate\x27\x20and\x20\x27','production','version','cwd','\x20api\x20pull\x27','utf8','2349MXtYXK','初始化项目配置文件成功','env','15198MpHflg','.bak','log','setLogPath','info','\x20→\x20.rabetbase.json','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','trim','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','12EVYSXb','Please\x20enter\x20App\x20Code:','App\x20Code\x20cannot\x20be\x20empty','26488CDVfCE','1155GkMRkr','688471wlARbp','join','parse','init','appcode','string','从旧配置文件升级成功','?\x20(Old\x20file\x20→\x20*.bak)','23390GFkynG','apps','cyan','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','Invalid\x20App\x20Code','app','yellow','1.0.0','Migration\x20cancelled.\x20Run\x20`','758538vHKjvR','package.json','defaultApp','1510TCCVOQ','../..','keys','733641BgLfWc','bold'];a89_0xf19a=function(){return _0xb5a832;};return a89_0xf19a();}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a89_0x437a16 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';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';function a89_0x51fc(_0x296915,_0x389365){_0x296915=_0x296915-0x1e8;const _0xf19ac8=a89_0xf19a();let _0x51fc90=_0xf19ac8[_0x296915];return _0x51fc90;}export async function initConfig(_0x1d7fb0){const _0x5b4219=a89_0x51fc,{appcode:_0x2fd7e3,env:_0x4a2d18,autoYes:_0x15b13c}=_0x1d7fb0,_0x2c8e5e=process[_0x5b4219(0x200)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x35f321;for(const _0x42c3a4 of LEGACY_CONFIG_NAMES){const _0x140599=resolve(_0x2c8e5e,_0x42c3a4);if(existsSync(_0x140599)){_0x35f321=_0x140599;break;}}if(_0x35f321){let _0x541507={};try{_0x541507=JSON[_0x5b4219(0x216)](readFileSync(_0x35f321,'utf8'));}catch{}const _0x520c6c=basename(_0x35f321),_0x37350b=_0x541507?.[_0x5b4219(0x218)]||_0x541507?.[_0x5b4219(0x1ef)];let _0x587c67=_0x15b13c;!_0x15b13c&&(console[_0x5b4219(0x208)](a89_0x437a16[_0x5b4219(0x1f0)](_0x5b4219(0x20e)+a89_0x437a16[_0x5b4219(0x1fa)](_0x520c6c))),_0x37350b&&console[_0x5b4219(0x208)](a89_0x437a16[_0x5b4219(0x1ec)]('\x20\x20appcode:\x20'+_0x37350b)),_0x587c67=await confirm({'message':'Upgrade\x20it\x20to\x20'+a89_0x437a16[_0x5b4219(0x1fa)]('.rabetbase.json')+_0x5b4219(0x1e9),'default':!![]}));if(!_0x587c67){console['log'](_0x5b4219(0x1f2)+CLI_BIN_NAME+'\x20project\x20init`\x20to\x20start\x20fresh.');return;}const _0x3e9299=resolve(_0x2c8e5e,NEW_CONFIG_NAME),_0x4ae5b7=getCliVersionFromPkg(),_0x5b8e25=readRawConfig(),_0x497e78=_0x2fd7e3||(typeof _0x541507?.[_0x5b4219(0x218)]===_0x5b4219(0x219)?_0x541507[_0x5b4219(0x218)]:undefined)||(typeof _0x541507?.[_0x5b4219(0x1ef)]==='string'?_0x541507[_0x5b4219(0x1ef)]:undefined)||await askAppcode(),_0x34824d=typeof _0x541507?.[_0x5b4219(0x205)]===_0x5b4219(0x219)?_0x541507[_0x5b4219(0x205)]:typeof _0x5b8e25[_0x5b4219(0x205)]===_0x5b4219(0x219)?_0x5b8e25['env']:_0x5b4219(0x1fe),_0x4c8a20=buildCanonicalProjectConfig({..._0x5b8e25,..._0x541507},{'appCodes':[_0x497e78],'env':_0x34824d,'metadata':{'version':_0x4ae5b7,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x35f321}});writeConfigFile(_0x3e9299,_0x4c8a20);const _0x52b4f5=_0x35f321+'.bak';renameSync(_0x35f321,_0x52b4f5),logger[_0x5b4219(0x209)](_0x2c8e5e),logger[_0x5b4219(0x20a)](_0x5b4219(0x217),_0x5b4219(0x1e8),{'from':_0x35f321,'to':_0x3e9299,'appcode':_0x497e78,'env':_0x4c8a20[_0x5b4219(0x205)]}),console[_0x5b4219(0x208)](a89_0x437a16['green']('✓\x20Upgraded\x20'+_0x520c6c+_0x5b4219(0x20b))),console[_0x5b4219(0x208)](a89_0x437a16[_0x5b4219(0x1ec)](_0x5b4219(0x1fb)+Object['keys'](_0x4c8a20[_0x5b4219(0x1eb)]||{})[_0x5b4219(0x215)](',\x20'))),console[_0x5b4219(0x208)](a89_0x437a16[_0x5b4219(0x1ec)]('\x20\x20Default:\x20'+_0x4c8a20[_0x5b4219(0x1f5)])),console[_0x5b4219(0x208)](a89_0x437a16['gray']('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x520c6c+_0x5b4219(0x207)));return;}const _0x2d6ab9=_0x2fd7e3||await askAppcode(),_0x25c062=resolve(_0x2c8e5e,NEW_CONFIG_NAME),_0x5121ea=getCliVersionFromPkg(),_0x42e966=readRawConfig(),_0x4ed908=typeof _0x42e966[_0x5b4219(0x205)]===_0x5b4219(0x219)?_0x42e966[_0x5b4219(0x205)]:undefined,_0x4b4879=buildCanonicalProjectConfig({},{'appCodes':[_0x2d6ab9],'env':_0x4a2d18||_0x4ed908||_0x5b4219(0x1fe),'metadata':{'version':_0x5121ea,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x25c062,_0x4b4879),logger[_0x5b4219(0x209)](_0x2c8e5e),logger['info'](_0x5b4219(0x217),_0x5b4219(0x204),{'appcode':_0x2d6ab9,'env':_0x4b4879[_0x5b4219(0x205)],'version':_0x4b4879['version'],'configPath':_0x25c062}),console[_0x5b4219(0x208)](a89_0x437a16['green'](_0x5b4219(0x1ed))),console[_0x5b4219(0x208)](a89_0x437a16[_0x5b4219(0x1ec)]('\x20\x20Apps:\x20'+Object[_0x5b4219(0x1f8)](_0x4b4879[_0x5b4219(0x1eb)]||{})[_0x5b4219(0x215)](',\x20'))),console['log'](a89_0x437a16[_0x5b4219(0x1ec)]('\x20\x20Default:\x20'+_0x4b4879[_0x5b4219(0x1f5)])),console[_0x5b4219(0x208)](_0x5b4219(0x20c)+CLI_BIN_NAME+_0x5b4219(0x1fd)+CLI_BIN_NAME+_0x5b4219(0x201));}function askAppcode(){const _0x33b8e5=a89_0x51fc;return input({'message':_0x33b8e5(0x210),'validate':_0xc16d40=>{const _0x42e6c9=_0x33b8e5;if(!_0xc16d40[_0x42e6c9(0x20d)]())return _0x42e6c9(0x211);const {valid:_0x323fa1,message:_0x114d2b}=validateAppcode(_0xc16d40[_0x42e6c9(0x20d)]());return _0x323fa1||_0x114d2b||_0x42e6c9(0x1ee);}});}function getCliVersionFromPkg(){const _0x5f4dc3=a89_0x51fc;try{const _0x218c9b=fileURLToPath(import.meta.url),_0x4a80c0=resolve(dirname(_0x218c9b),_0x5f4dc3(0x1f7)),_0x65449d=JSON[_0x5f4dc3(0x216)](readFileSync(resolve(_0x4a80c0,_0x5f4dc3(0x1f4)),_0x5f4dc3(0x202)));return _0x65449d[_0x5f4dc3(0x1ff)]||_0x5f4dc3(0x1f1);}catch{return _0x5f4dc3(0x1f1);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a89_0x4e1fd9=a89_0x5b99;(function(_0x1c836a,_0x29a001){const _0x40a754=a89_0x5b99,_0x15781a=_0x1c836a();while(!![]){try{const _0x2237eb=parseInt(_0x40a754(0x178))/0x1+-parseInt(_0x40a754(0x1f3))/0x2+parseInt(_0x40a754(0x1c0))/0x3+-parseInt(_0x40a754(0x186))/0x4+-parseInt(_0x40a754(0x190))/0x5*(parseInt(_0x40a754(0x1eb))/0x6)+-parseInt(_0x40a754(0x197))/0x7+parseInt(_0x40a754(0x19b))/0x8;if(_0x2237eb===_0x29a001)break;else _0x15781a['push'](_0x15781a['shift']());}catch(_0x3c7f44){_0x15781a['push'](_0x15781a['shift']());}}}(a89_0x1450,0x5b6ed));import a89_0x1486b8 from'chalk';import a89_0x353349 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';function a89_0x5b99(_0x21e371,_0x28302a){_0x21e371=_0x21e371-0x175;const _0x14505e=a89_0x1450();let _0x5b9917=_0x14505e[_0x21e371];return _0x5b9917;}import{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a89_0x4e1fd9(0x1cc)](_0x566993=>_0x566993!==NEW_CONFIG_NAME);function a89_0x1450(){const _0x34c4f7=['Proceed\x20with\x20upgrade?','some','FAIL','detail','\x20\x20bun\x20install','none\x20found','.cursor/mcp.json','no\x20legacy\x20config\x20found','\x20→\x20latest','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','\x20(backup:\x20','CANCEL','@lovrabet/sdk','sdkUpgrade','dependencies','Step\x205/7:\x20Removing\x20old\x20skill...','utf8','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20removed\x20(','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','bold','entries','fail','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','FOUND','status','Config\x20file:','\x20→\x20keys:\x20','log','exit\x20','cwd','1542822KCrlmL','white','info','@lovrabet/dataset-mcp-server','not\x20found\x20(will\x20create)','isDirectory','[\x22@lovrabet/sdk\x22]:\x20','lovrabet/rabetbase\x20installed\x20globally','.cursor/rules/lovrabet_rules.mdc','hasNewConfig','undefined','cyan','filter','devDependencies','succeed','\x20from\x20','parse','string','===\x20Upgrade\x20Analysis\x20===','gray','message','step','join','Upgrade\x20cancelled.','\x20\x20New\x20config\x20(.rabetbase.json):\x20','path','isArray','.lovrabet','\x20\x20Current\x20version\x20in\x20','Skill\x20swap:','done','green','includes','\x20\x20Fields\x20to\x20migrate:\x20','Step\x206/7:\x20Installing\x20new\x20skill...','Remove\x20legacy\x20artifacts','error','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','yellow','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','===\x20Upgrade\x20Summary\x20===','Step\x204/7:\x20MCP\x20config\x20—\x20','removed\x20','636ShchhY','Legacy\x20artifacts:','.bak','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20→\x20','oldPath','files','1045628aVvGWy','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','lovrabet/rabetbase','red','658723iRsiLb','Config\x20migration','push','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','\x20removed','length','Clean\x20MCP\x20config','keys','stringify','configMigration','mcpServers','oldMcpConfig','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','skipped\x20(no\x20legacy\x20config)','1601084IixBmN','latest','package.json','object','Remove\x20old\x20skill','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','args','\x20\x20#\x20or','oldArtifacts','21860Sysvvr','no\x20legacy\x20entry','Remove\x20.lovrabet/','already\x20exists\x20(will\x20merge)','failed','Upgrade\x20@lovrabet/sdk','start','3591693mGjXlf','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','lovrabet/lovrabet-skill\x20removed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','8809024XRiydD','\x20\x20Step\x20','MCP\x20config:','Install\x20new\x20skill','values','@lovrabet/sdk:'];a89_0x1450=function(){return _0x34c4f7;};return a89_0x1450();}function collectIdeSkillFiles(_0x132862){const _0x340dd8=a89_0x4e1fd9,_0x13c7b8=[];for(const _0x3f659a of Object[_0x340dd8(0x19f)](CORE_IDE_CONFIGS)){if(_0x3f659a[_0x340dd8(0x1f2)])for(const _0x56ae59 of _0x3f659a[_0x340dd8(0x1f2)]){_0x13c7b8[_0x340dd8(0x17a)](resolve(_0x132862,_0x56ae59['path']));}}return _0x13c7b8;}function analyse(_0x3f0b37){const _0x892751=a89_0x4e1fd9;let _0x41b72f=null;const _0x2176dc=resolve(_0x3f0b37,NEW_CONFIG_NAME),_0xa35320=existsSync(_0x2176dc);for(const _0x34fd7f of LEGACY_CONFIG_NAMES){const _0x59c345=resolve(_0x3f0b37,_0x34fd7f);if(existsSync(_0x59c345)){const _0x3d56b2=readConfigFile(_0x59c345),_0x5b9cd7=Object[_0x892751(0x17f)](_0x3d56b2)[_0x892751(0x1cc)](_0x42f151=>typeof _0x3d56b2[_0x42f151]!==_0x892751(0x1ca));_0x41b72f={'oldPath':_0x59c345,'hasNewConfig':_0xa35320,'fields':_0x5b9cd7};break;}}const _0x29dee7=[],_0x2faacc=resolve(_0x3f0b37,_0x892751(0x1db));if(existsSync(_0x2faacc))_0x29dee7[_0x892751(0x17a)](_0x2faacc);const _0xfcd013=resolve(_0x3f0b37,_0x892751(0x1c8));if(existsSync(_0xfcd013))_0x29dee7['push'](_0xfcd013);const _0x4023bb=resolve(_0x3f0b37,'.claude/skills/lovrabet');if(existsSync(_0x4023bb))_0x29dee7[_0x892751(0x17a)](_0x4023bb);for(const _0x27f34b of collectIdeSkillFiles(_0x3f0b37)){if(existsSync(_0x27f34b))_0x29dee7[_0x892751(0x17a)](_0x27f34b);}let _0x5d9780=null;const _0x27c962=resolve(_0x3f0b37,_0x892751(0x1a7));if(existsSync(_0x27c962))try{const _0x305c98=JSON[_0x892751(0x1d0)](readFileSync(_0x27c962,'utf8'));if(_0x305c98?.[_0x892751(0x182)]&&typeof _0x305c98[_0x892751(0x182)]===_0x892751(0x189)){const _0x374bb3=[];for(const [_0x32298a,_0xa83eb6]of Object[_0x892751(0x1b6)](_0x305c98[_0x892751(0x182)])){const _0x245de8=_0xa83eb6;_0x245de8?.[_0x892751(0x18d)]&&Array['isArray'](_0x245de8[_0x892751(0x18d)])&&_0x245de8[_0x892751(0x18d)][_0x892751(0x1a2)](_0x542416=>typeof _0x542416==='string'&&_0x542416[_0x892751(0x1e0)](_0x892751(0x1c3)))&&_0x374bb3[_0x892751(0x17a)](_0x32298a);}_0x374bb3[_0x892751(0x17d)]>0x0&&(_0x5d9780={'path':_0x27c962,'keys':_0x374bb3});}}catch{}const _0x5c73be=_0x29dee7[_0x892751(0x17d)]>0x0||_0x41b72f!==null;let _0x3f104f=null;const _0x2c8207=resolve(_0x3f0b37,_0x892751(0x188));if(existsSync(_0x2c8207))try{const _0x19b79d=JSON[_0x892751(0x1d0)](readFileSync(_0x2c8207,_0x892751(0x1b1)));for(const _0xbec2e1 of[_0x892751(0x1af),_0x892751(0x1cd)]){const _0x47f088=_0x19b79d?.[_0xbec2e1]?.[_0x892751(0x1ad)];if(typeof _0x47f088===_0x892751(0x1d1)){_0x47f088!==_0x892751(0x187)&&(_0x3f104f={'pkgPath':_0x2c8207,'currentVersion':_0x47f088,'field':_0xbec2e1});break;}}}catch{}return{'configMigration':_0x41b72f,'oldArtifacts':_0x29dee7,'oldMcpConfig':_0x5d9780,'needsSkillSwap':_0x5c73be,'sdkUpgrade':_0x3f104f};}function printReport(_0x18786c){const _0x170932=a89_0x4e1fd9,{configMigration:_0x10e9c8,oldArtifacts:_0x3cfee1,oldMcpConfig:_0x2c96c1,needsSkillSwap:_0x3d3938}=_0x18786c;console[_0x170932(0x1bd)](''),console['log'](a89_0x1486b8[_0x170932(0x1b5)](_0x170932(0x1d2))),console[_0x170932(0x1bd)]('');_0x10e9c8?(console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1bb))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x10e9c8[_0x170932(0x1f1)]))),console[_0x170932(0x1bd)](_0x170932(0x1d8)+(_0x10e9c8[_0x170932(0x1c9)]?a89_0x1486b8[_0x170932(0x1df)](_0x170932(0x193)):a89_0x1486b8[_0x170932(0x1d3)](_0x170932(0x1c4)))),console[_0x170932(0x1bd)](_0x170932(0x1e1)+_0x10e9c8['fields'][_0x170932(0x1d6)](',\x20')),console['log'](_0x170932(0x1e7))):console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1bb))+'\x20\x20'+a89_0x1486b8['gray'](_0x170932(0x1a8)));console[_0x170932(0x1bd)]('');if(_0x3cfee1['length']>0x0){console['log'](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1ec)));for(const _0x1b355c of _0x3cfee1){console['log']('\x20\x20'+a89_0x1486b8[_0x170932(0x177)](_0x170932(0x1b9))+'\x20\x20'+_0x1b355c);}console[_0x170932(0x1bd)]('\x20\x20Action:\x20delete');}else console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1ec))+'\x20\x20'+a89_0x1486b8['gray'](_0x170932(0x1a6)));console[_0x170932(0x1bd)]('');_0x2c96c1?(console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x19d))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x2c96c1['path'])+_0x170932(0x1bc)+_0x2c96c1[_0x170932(0x17f)][_0x170932(0x1d6)](',\x20'))),console[_0x170932(0x1bd)](_0x170932(0x1e5))):console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x19d))+'\x20\x20'+a89_0x1486b8[_0x170932(0x1d3)](_0x170932(0x191)));console[_0x170932(0x1bd)](''),console[_0x170932(0x1bd)](a89_0x1486b8['cyan'](_0x170932(0x1dd))+('\x20\x20'+(_0x3d3938?a89_0x1486b8[_0x170932(0x1e6)]('needed'):a89_0x1486b8[_0x170932(0x1df)]('not\x20needed'))));_0x3d3938&&console[_0x170932(0x1bd)](_0x170932(0x17b));console[_0x170932(0x1bd)]('');if(_0x18786c[_0x170932(0x1ae)]){const {currentVersion:_0xc58510,field:_0x1d13da,pkgPath:_0x2155f7}=_0x18786c[_0x170932(0x1ae)];console[_0x170932(0x1bd)](a89_0x1486b8['cyan'](_0x170932(0x1a0))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x2155f7))),console[_0x170932(0x1bd)](_0x170932(0x1dc)+_0x1d13da+':\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0xc58510)+_0x170932(0x1f0)+a89_0x1486b8['green']('latest')),console[_0x170932(0x1bd)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)]('@lovrabet/sdk:')+'\x20\x20'+a89_0x1486b8[_0x170932(0x1d3)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x170932(0x1bd)]('');}function execConfigMigration(_0x3f664a,_0x10cba4){const _0x437883=a89_0x4e1fd9,{configMigration:_0x103b23}=_0x3f664a;if(!_0x103b23?.['oldPath'])return{'step':0x1,'label':_0x437883(0x179),'ok':!![],'detail':_0x437883(0x185)};const _0x141248=readConfigFile(_0x103b23[_0x437883(0x1f1)]),_0x3d3656=resolve(_0x10cba4,NEW_CONFIG_NAME),_0xd4b20f=_0x103b23[_0x437883(0x1c9)]?readConfigFile(_0x3d3656):{};for(const [_0x3fb7d0,_0x1c269b]of Object[_0x437883(0x1b6)](_0x141248)){!(_0x3fb7d0 in _0xd4b20f)&&(_0xd4b20f[_0x3fb7d0]=_0x1c269b);}writeConfigFile(_0x3d3656,_0xd4b20f);const _0x55bfc9=_0x103b23[_0x437883(0x1f1)]+_0x437883(0x1ed);return renameSync(_0x103b23[_0x437883(0x1f1)],_0x55bfc9),{'step':0x1,'label':_0x437883(0x179),'ok':!![],'detail':_0x103b23[_0x437883(0x1f1)]+_0x437883(0x1f0)+_0x3d3656+_0x437883(0x1ab)+_0x55bfc9+')'};}function execRemoveOldArtifacts(_0xd0ca7e){const _0xe1e3a1=a89_0x4e1fd9,_0x11354d=[];for(const _0x29568b of _0xd0ca7e){try{if(!existsSync(_0x29568b))continue;const _0x39c02a=tryStat(_0x29568b);_0x39c02a?.[_0xe1e3a1(0x1c5)]()?rmSync(_0x29568b,{'recursive':!![],'force':!![]}):unlinkSync(_0x29568b);}catch(_0x25c6ff){_0x11354d['push'](_0x29568b+':\x20'+_0x25c6ff[_0xe1e3a1(0x1d4)]);}}return{'step':0x3,'label':_0xe1e3a1(0x1e3),'ok':_0x11354d['length']===0x0,'detail':_0x11354d[_0xe1e3a1(0x17d)]>0x0?_0xd0ca7e[_0xe1e3a1(0x17d)]-_0x11354d[_0xe1e3a1(0x17d)]+'/'+_0xd0ca7e['length']+_0xe1e3a1(0x1b3)+_0x11354d['join'](';\x20')+')':_0xd0ca7e[_0xe1e3a1(0x17d)]+_0xe1e3a1(0x17c)};}function execCleanMcp(_0x1a179c){const _0x25aa64=a89_0x4e1fd9;if(!_0x1a179c[_0x25aa64(0x183)])return{'step':0x4,'label':_0x25aa64(0x17e),'ok':!![],'detail':'skipped'};try{const _0x1a32fb=readFileSync(_0x1a179c[_0x25aa64(0x183)]['path'],_0x25aa64(0x1b1)),_0x40472b=JSON[_0x25aa64(0x1d0)](_0x1a32fb);if(_0x40472b?.[_0x25aa64(0x182)]&&typeof _0x40472b['mcpServers']===_0x25aa64(0x189)){const _0x5988a8=[];for(const [_0x17f10b,_0x26362d]of Object[_0x25aa64(0x1b6)](_0x40472b[_0x25aa64(0x182)])){_0x26362d?.[_0x25aa64(0x18d)]&&Array[_0x25aa64(0x1da)](_0x26362d[_0x25aa64(0x18d)])&&_0x26362d[_0x25aa64(0x18d)]['some'](_0x2fef6b=>typeof _0x2fef6b===_0x25aa64(0x1d1)&&_0x2fef6b[_0x25aa64(0x1e0)](_0x25aa64(0x1c3)))&&_0x5988a8[_0x25aa64(0x17a)](_0x17f10b);}for(const _0x5a9937 of _0x5988a8){delete _0x40472b[_0x25aa64(0x182)][_0x5a9937];}return _0x5988a8[_0x25aa64(0x17d)]>0x0&&writeFileSync(_0x1a179c['oldMcpConfig'][_0x25aa64(0x1d9)],JSON[_0x25aa64(0x180)](_0x40472b,null,0x2)+'\x0a',_0x25aa64(0x1b1)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x25aa64(0x1ea)+_0x5988a8[_0x25aa64(0x1d6)](',\x20')+_0x25aa64(0x1cf)+_0x1a179c[_0x25aa64(0x183)]['path']};}return{'step':0x4,'label':_0x25aa64(0x17e),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x519ad3){return{'step':0x4,'label':_0x25aa64(0x17e),'ok':![],'detail':_0x519ad3['message']};}}function execSkillsRemove(_0x377843,_0x231916){const _0x2a5843=a89_0x4e1fd9,_0xc8caef=runNpxSkillsRemove(_0x377843,{'stdio':'inherit','yes':_0x231916});return{'step':0x5,'label':_0x2a5843(0x18a),'ok':_0xc8caef['ok'],'detail':_0xc8caef['ok']?_0x2a5843(0x199):_0xc8caef['error']??'exit\x20'+_0xc8caef[_0x2a5843(0x1ba)]};}function execSkillsAdd(_0x46d7df,_0x5ab8ea){const _0x47155f=a89_0x4e1fd9,_0x39989a=runNpxSkillsAddGlobal(_0x46d7df,_0x47155f(0x176),{'stdio':'inherit','yes':_0x5ab8ea});return{'step':0x6,'label':_0x47155f(0x19e),'ok':_0x39989a['ok'],'detail':_0x39989a['ok']?_0x47155f(0x1c7):_0x39989a[_0x47155f(0x1e4)]??_0x47155f(0x1be)+_0x39989a[_0x47155f(0x1ba)]};}function execUpgradeSdk(_0x557bee){const _0x59fba6=a89_0x4e1fd9;if(!_0x557bee['sdkUpgrade'])return{'step':0x7,'label':_0x59fba6(0x195),'ok':!![],'detail':_0x59fba6(0x1b4)};const {pkgPath:_0x55f078,currentVersion:_0x47cdf6,field:_0x57a1af}=_0x557bee[_0x59fba6(0x1ae)];try{const _0x36896b=readFileSync(_0x55f078,_0x59fba6(0x1b1)),_0x5b489f=JSON[_0x59fba6(0x1d0)](_0x36896b);return _0x5b489f[_0x57a1af]['@lovrabet/sdk']=_0x59fba6(0x187),writeFileSync(_0x55f078,JSON[_0x59fba6(0x180)](_0x5b489f,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x59fba6(0x195),'ok':!![],'detail':_0x57a1af+_0x59fba6(0x1c6)+_0x47cdf6+_0x59fba6(0x1a9)};}catch(_0x5282e4){return{'step':0x7,'label':_0x59fba6(0x195),'ok':![],'detail':_0x5282e4[_0x59fba6(0x1d4)]};}}function tryStat(_0x21d726){try{return statSync(_0x21d726);}catch{return undefined;}}function printSummary(_0x1e0617){const _0x10d9b9=a89_0x4e1fd9;console[_0x10d9b9(0x1bd)](''),console[_0x10d9b9(0x1bd)](a89_0x1486b8[_0x10d9b9(0x1b5)](_0x10d9b9(0x1e8))),console['log']('');for(const _0x38455b of _0x1e0617){const _0x262067=_0x38455b['ok']?a89_0x1486b8['green']('OK'):a89_0x1486b8['red'](_0x10d9b9(0x1a3));console['log']('\x20\x20'+_0x262067+_0x10d9b9(0x19c)+_0x38455b[_0x10d9b9(0x1d5)]+':\x20'+_0x38455b['label']);if(_0x38455b[_0x10d9b9(0x1a4)])console[_0x10d9b9(0x1bd)]('\x20\x20\x20\x20\x20\x20\x20'+a89_0x1486b8[_0x10d9b9(0x1d3)](_0x38455b['detail']));}console[_0x10d9b9(0x1bd)]('');}export async function upgradeApp(_0x5aa5d4,_0x4a840f){const _0x2773d7=a89_0x4e1fd9,_0x379505=process[_0x2773d7(0x1bf)](),_0x34e2df=analyse(_0x379505),_0x343f6e=!_0x34e2df[_0x2773d7(0x181)]&&_0x34e2df[_0x2773d7(0x18f)][_0x2773d7(0x17d)]===0x0&&!_0x34e2df[_0x2773d7(0x183)]&&!_0x34e2df['needsSkillSwap']&&!_0x34e2df['sdkUpgrade'];if(_0x343f6e){console[_0x2773d7(0x1bd)](a89_0x1486b8['green'](_0x2773d7(0x1ee)));return;}printReport(_0x34e2df);const _0x3a08c3=!!(_0x4a840f['yes']||_0x4a840f['Y']||_0x5aa5d4);if(!_0x3a08c3)try{const _0x153c45=await askConfirm(_0x2773d7(0x1a1));if(!_0x153c45){console[_0x2773d7(0x1bd)](a89_0x1486b8['gray'](_0x2773d7(0x1d7)));return;}}catch(_0x2f6f9a){if(_0x2f6f9a?.[_0x2773d7(0x1d4)]===_0x2773d7(0x1ac)){console['log'](a89_0x1486b8['gray'](_0x2773d7(0x1d7)));return;}throw _0x2f6f9a;}const _0x6a19a3=[],_0x509704=a89_0x353349({'text':'Step\x201/7:\x20Migrating\x20config...','color':'cyan'})[_0x2773d7(0x196)](),_0x5ea09e=execConfigMigration(_0x34e2df,_0x379505);_0x6a19a3[_0x2773d7(0x17a)](_0x5ea09e),_0x509704[_0x5ea09e['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x18b)+(_0x5ea09e[_0x2773d7(0x1a4)]??(_0x5ea09e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x547c1e=resolve(_0x379505,'.lovrabet'),_0x536597=a89_0x353349({'text':_0x2773d7(0x18c),'color':'cyan'})[_0x2773d7(0x196)]();if(existsSync(_0x547c1e))try{rmSync(_0x547c1e,{'recursive':!![],'force':!![]}),_0x536597['succeed']('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x6a19a3[_0x2773d7(0x17a)]({'step':0x2,'label':_0x2773d7(0x192),'ok':!![]});}catch(_0x1362ec){_0x536597[_0x2773d7(0x1b7)](_0x2773d7(0x1aa)+_0x1362ec[_0x2773d7(0x1d4)]),_0x6a19a3['push']({'step':0x2,'label':_0x2773d7(0x192),'ok':![],'detail':_0x1362ec['message']});}else _0x536597[_0x2773d7(0x1c2)](_0x2773d7(0x1b8)),_0x6a19a3[_0x2773d7(0x17a)]({'step':0x2,'label':_0x2773d7(0x192),'ok':!![],'detail':'skipped'});const _0x1dffc5=a89_0x353349({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x32b73e=execRemoveOldArtifacts(_0x34e2df[_0x2773d7(0x18f)]);_0x6a19a3[_0x2773d7(0x17a)](_0x32b73e),_0x1dffc5[_0x32b73e['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x175)+(_0x32b73e[_0x2773d7(0x1a4)]??(_0x32b73e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x3ef243=a89_0x353349({'text':_0x2773d7(0x19a),'color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x3aa26e=execCleanMcp(_0x34e2df);_0x6a19a3[_0x2773d7(0x17a)](_0x3aa26e),_0x3ef243[_0x3aa26e['ok']?_0x2773d7(0x1ce):'fail'](_0x2773d7(0x1e9)+(_0x3aa26e[_0x2773d7(0x1a4)]??(_0x3aa26e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x50582b=a89_0x353349({'text':_0x2773d7(0x1b0),'color':'cyan'})[_0x2773d7(0x196)](),_0x3c40d7=execSkillsRemove(_0x379505,_0x3a08c3);_0x6a19a3[_0x2773d7(0x17a)](_0x3c40d7),_0x50582b[_0x3c40d7['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x1ef)+(_0x3c40d7[_0x2773d7(0x1a4)]??(_0x3c40d7['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0xf51cdb=a89_0x353349({'text':_0x2773d7(0x1e2),'color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x35d0d4=execSkillsAdd(_0x379505,_0x3a08c3);_0x6a19a3[_0x2773d7(0x17a)](_0x35d0d4),_0xf51cdb[_0x35d0d4['ok']?'succeed':_0x2773d7(0x1b7)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x35d0d4[_0x2773d7(0x1a4)]??(_0x35d0d4['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x38264f=a89_0x353349({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x559ee4=execUpgradeSdk(_0x34e2df);_0x6a19a3[_0x2773d7(0x17a)](_0x559ee4),_0x38264f[_0x559ee4['ok']?'succeed':_0x2773d7(0x1b7)](_0x2773d7(0x184)+(_0x559ee4[_0x2773d7(0x1a4)]??(_0x559ee4['ok']?_0x2773d7(0x1de):_0x2773d7(0x194)))),printSummary(_0x6a19a3);const _0x4f52ee=_0x6a19a3['some'](_0x21b2eb=>!_0x21b2eb['ok']);_0x4f52ee?console[_0x2773d7(0x1bd)](a89_0x1486b8['yellow'](_0x2773d7(0x198))):console[_0x2773d7(0x1bd)](a89_0x1486b8['green']('Upgrade\x20completed\x20successfully!')),_0x559ee4['ok']&&_0x34e2df[_0x2773d7(0x1ae)]&&(console[_0x2773d7(0x1bd)](''),console[_0x2773d7(0x1bd)](a89_0x1486b8[_0x2773d7(0x1b5)]['cyan']('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x2773d7(0x1bd)](a89_0x1486b8['cyan'](_0x2773d7(0x1b2))),console[_0x2773d7(0x1bd)](''),console['log'](a89_0x1486b8['white']('\x20\x20npm\x20install')),console['log'](a89_0x1486b8[_0x2773d7(0x1c1)](_0x2773d7(0x18e))),console[_0x2773d7(0x1bd)](a89_0x1486b8['white'](_0x2773d7(0x1a5))),console[_0x2773d7(0x1bd)](''));}
|
|
1
|
+
const a90_0x3763a7=a90_0x2e3e;function a90_0x5af5(){const _0x4c07e2=['status','args','configMigration','white','parse','26076uGMITy','\x20(backup:\x20','filter','Proceed\x20with\x20upgrade?','Step\x205/7:\x20Removing\x20old\x20skill...','Upgrade\x20cancelled.','\x20\x20Action:\x20delete','string','Skill\x20swap:','Upgrade\x20@lovrabet/sdk','some','done','needsSkillSwap','step','entries','Step\x201/7:\x20Config\x20migration\x20—\x20','exit\x20','Step\x204/7:\x20MCP\x20config\x20—\x20','already\x20exists\x20(will\x20merge)','FAIL','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','.bak','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Remove\x20.lovrabet/','\x20→\x20','object','\x20\x20Fields\x20to\x20migrate:\x20','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','fail','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Remove\x20old\x20skill','start','values','fields','succeed','not\x20found\x20(will\x20create)','push','needed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','70fRoYCB','Clean\x20MCP\x20config','Config\x20file:','gray','keys','\x20removed\x20(','mcpServers','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','===\x20Upgrade\x20Summary\x20===','3068HhMlrR','isArray','[\x22@lovrabet/sdk\x22]:\x20','no\x20legacy\x20config\x20found','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','label','red','hasNewConfig','cwd','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','@lovrabet/sdk:','30584GadNol','331961eFhWaO','none\x20found','not\x20found\x20or\x20already\x20at\x20latest','stringify','\x20\x20npm\x20install','===\x20Upgrade\x20Analysis\x20===','failed','163740NGDnIY','log','351laMWKv','yellow','Install\x20new\x20skill','lovrabet/lovrabet-skill\x20removed','oldPath','@lovrabet/sdk','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Upgrade\x20completed\x20successfully!','Remove\x20legacy\x20artifacts','\x20→\x20keys:\x20','cyan','@lovrabet/dataset-mcp-server','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','oldMcpConfig','MCP\x20config:','isDirectory','Step\x206/7:\x20Installing\x20new\x20skill...','\x20\x20\x20\x20\x20\x20\x20','.cursor/mcp.json','message','bold','\x20→\x20latest','Step\x201/7:\x20Migrating\x20config...','.lovrabet','\x20\x20Current\x20version\x20in\x20','\x20\x20bun\x20install','files','skipped','sdkUpgrade','Config\x20migration','CANCEL','path','no\x20legacy\x20entry','\x20removed','Legacy\x20artifacts:','latest','395Fvbzze','oldArtifacts','24992DsqCha','package.json','length','detail','error','lovrabet/rabetbase\x20installed\x20globally','utf8','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','444422ahvkEP','6eDEVRJ','join','inherit','green','devDependencies','FOUND','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','includes','no\x20matching\x20entry\x20found'];a90_0x5af5=function(){return _0x4c07e2;};return a90_0x5af5();}(function(_0x19c207,_0x51144b){const _0x395143=a90_0x2e3e,_0x33fec9=_0x19c207();while(!![]){try{const _0x5763cb=parseInt(_0x395143(0x1c7))/0x1+parseInt(_0x395143(0x1b0))/0x2+-parseInt(_0x395143(0x188))/0x3+-parseInt(_0x395143(0x1f8))/0x4*(parseInt(_0x395143(0x1ae))/0x5)+parseInt(_0x395143(0x1b9))/0x6*(parseInt(_0x395143(0x181))/0x7)+-parseInt(_0x395143(0x180))/0x8*(parseInt(_0x395143(0x18a))/0x9)+parseInt(_0x395143(0x1ef))/0xa*(parseInt(_0x395143(0x1b8))/0xb);if(_0x5763cb===_0x51144b)break;else _0x33fec9['push'](_0x33fec9['shift']());}catch(_0x5e4583){_0x33fec9['push'](_0x33fec9['shift']());}}}(a90_0x5af5,0x1985b));import a90_0x5c8f92 from'chalk';import a90_0x4c0e44 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{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a90_0x3763a7(0x1c9)](_0x13519e=>_0x13519e!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x3b3f4e){const _0x5f7597=a90_0x3763a7,_0x3cb6e6=[];for(const _0x39bd99 of Object[_0x5f7597(0x1e8)](CORE_IDE_CONFIGS)){if(_0x39bd99[_0x5f7597(0x1a4)])for(const _0x5bdf4d of _0x39bd99[_0x5f7597(0x1a4)]){_0x3cb6e6[_0x5f7597(0x1ec)](resolve(_0x3b3f4e,_0x5bdf4d[_0x5f7597(0x1a9)]));}}return _0x3cb6e6;}function analyse(_0x200c5a){const _0x82f8fa=a90_0x3763a7;let _0x5f497a=null;const _0xc9676a=resolve(_0x200c5a,NEW_CONFIG_NAME),_0x2e2587=existsSync(_0xc9676a);for(const _0x5292fd of LEGACY_CONFIG_NAMES){const _0x52b22d=resolve(_0x200c5a,_0x5292fd);if(existsSync(_0x52b22d)){const _0x490de1=readConfigFile(_0x52b22d),_0x2a0a35=Object[_0x82f8fa(0x1f3)](_0x490de1)['filter'](_0x197d6e=>typeof _0x490de1[_0x197d6e]!=='undefined');_0x5f497a={'oldPath':_0x52b22d,'hasNewConfig':_0x2e2587,'fields':_0x2a0a35};break;}}const _0x11963c=[],_0x23e052=resolve(_0x200c5a,_0x82f8fa(0x1a1));if(existsSync(_0x23e052))_0x11963c[_0x82f8fa(0x1ec)](_0x23e052);const _0x39635e=resolve(_0x200c5a,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x39635e))_0x11963c[_0x82f8fa(0x1ec)](_0x39635e);const _0x3ea077=resolve(_0x200c5a,'.claude/skills/lovrabet');if(existsSync(_0x3ea077))_0x11963c[_0x82f8fa(0x1ec)](_0x3ea077);for(const _0xadb1b9 of collectIdeSkillFiles(_0x200c5a)){if(existsSync(_0xadb1b9))_0x11963c[_0x82f8fa(0x1ec)](_0xadb1b9);}let _0x10ab60=null;const _0x11dc43=resolve(_0x200c5a,_0x82f8fa(0x19c));if(existsSync(_0x11dc43))try{const _0x279a70=JSON[_0x82f8fa(0x1c6)](readFileSync(_0x11dc43,_0x82f8fa(0x1b6)));if(_0x279a70?.[_0x82f8fa(0x1f5)]&&typeof _0x279a70[_0x82f8fa(0x1f5)]==='object'){const _0x3701ef=[];for(const [_0x91f0ac,_0xfb18a9]of Object['entries'](_0x279a70[_0x82f8fa(0x1f5)])){const _0x283dae=_0xfb18a9;_0x283dae?.[_0x82f8fa(0x1c3)]&&Array[_0x82f8fa(0x1f9)](_0x283dae[_0x82f8fa(0x1c3)])&&_0x283dae[_0x82f8fa(0x1c3)][_0x82f8fa(0x1d1)](_0xd56b8a=>typeof _0xd56b8a==='string'&&_0xd56b8a[_0x82f8fa(0x1c0)](_0x82f8fa(0x195)))&&_0x3701ef['push'](_0x91f0ac);}_0x3701ef['length']>0x0&&(_0x10ab60={'path':_0x11dc43,'keys':_0x3701ef});}}catch{}const _0x38f7e5=_0x11963c[_0x82f8fa(0x1b2)]>0x0||_0x5f497a!==null;let _0x19155=null;const _0x28ea29=resolve(_0x200c5a,_0x82f8fa(0x1b1));if(existsSync(_0x28ea29))try{const _0x439c60=JSON[_0x82f8fa(0x1c6)](readFileSync(_0x28ea29,_0x82f8fa(0x1b6)));for(const _0x2b8aff of['dependencies',_0x82f8fa(0x1bd)]){const _0x37a97f=_0x439c60?.[_0x2b8aff]?.[_0x82f8fa(0x18f)];if(typeof _0x37a97f===_0x82f8fa(0x1ce)){_0x37a97f!==_0x82f8fa(0x1ad)&&(_0x19155={'pkgPath':_0x28ea29,'currentVersion':_0x37a97f,'field':_0x2b8aff});break;}}}catch{}return{'configMigration':_0x5f497a,'oldArtifacts':_0x11963c,'oldMcpConfig':_0x10ab60,'needsSkillSwap':_0x38f7e5,'sdkUpgrade':_0x19155};}function printReport(_0x2f4aba){const _0x59e1a1=a90_0x3763a7,{configMigration:_0x4520c9,oldArtifacts:_0x216f95,oldMcpConfig:_0x16de9d,needsSkillSwap:_0x3d9992}=_0x2f4aba;console['log'](''),console['log'](a90_0x5c8f92['bold'](_0x59e1a1(0x186))),console[_0x59e1a1(0x189)]('');_0x4520c9?(console[_0x59e1a1(0x189)](a90_0x5c8f92[_0x59e1a1(0x194)](_0x59e1a1(0x1f1))+('\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x18b)](_0x4520c9[_0x59e1a1(0x18e)]))),console[_0x59e1a1(0x189)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x4520c9['hasNewConfig']?a90_0x5c8f92[_0x59e1a1(0x1bc)](_0x59e1a1(0x1d9)):a90_0x5c8f92[_0x59e1a1(0x1f2)](_0x59e1a1(0x1eb)))),console[_0x59e1a1(0x189)](_0x59e1a1(0x1e2)+_0x4520c9[_0x59e1a1(0x1e9)]['join'](',\x20')),console[_0x59e1a1(0x189)](_0x59e1a1(0x1de))):console[_0x59e1a1(0x189)](a90_0x5c8f92[_0x59e1a1(0x194)](_0x59e1a1(0x1f1))+'\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x1f2)](_0x59e1a1(0x1fb)));console[_0x59e1a1(0x189)]('');if(_0x216f95[_0x59e1a1(0x1b2)]>0x0){console['log'](a90_0x5c8f92[_0x59e1a1(0x194)]('Legacy\x20artifacts:'));for(const _0x1836ad of _0x216f95){console[_0x59e1a1(0x189)]('\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x17b)](_0x59e1a1(0x1be))+'\x20\x20'+_0x1836ad);}console['log'](_0x59e1a1(0x1cd));}else console[_0x59e1a1(0x189)](a90_0x5c8f92['cyan'](_0x59e1a1(0x1ac))+'\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x1f2)](_0x59e1a1(0x182)));console[_0x59e1a1(0x189)]('');_0x16de9d?(console[_0x59e1a1(0x189)](a90_0x5c8f92[_0x59e1a1(0x194)](_0x59e1a1(0x198))+('\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x18b)](_0x16de9d[_0x59e1a1(0x1a9)])+_0x59e1a1(0x193)+_0x16de9d[_0x59e1a1(0x1f3)][_0x59e1a1(0x1ba)](',\x20'))),console[_0x59e1a1(0x189)](_0x59e1a1(0x1f6))):console[_0x59e1a1(0x189)](a90_0x5c8f92[_0x59e1a1(0x194)]('MCP\x20config:')+'\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x1f2)](_0x59e1a1(0x1aa)));console[_0x59e1a1(0x189)](''),console['log'](a90_0x5c8f92['cyan'](_0x59e1a1(0x1cf))+('\x20\x20'+(_0x3d9992?a90_0x5c8f92['yellow'](_0x59e1a1(0x1ed)):a90_0x5c8f92[_0x59e1a1(0x1bc)]('not\x20needed'))));_0x3d9992&&console[_0x59e1a1(0x189)](_0x59e1a1(0x1db));console[_0x59e1a1(0x189)]('');if(_0x2f4aba[_0x59e1a1(0x1a6)]){const {currentVersion:_0x187e1b,field:_0x2c3716,pkgPath:_0x5265aa}=_0x2f4aba[_0x59e1a1(0x1a6)];console[_0x59e1a1(0x189)](a90_0x5c8f92[_0x59e1a1(0x194)]('@lovrabet/sdk:')+('\x20\x20'+a90_0x5c8f92[_0x59e1a1(0x18b)](_0x5265aa))),console['log'](_0x59e1a1(0x1a2)+_0x2c3716+':\x20'+a90_0x5c8f92[_0x59e1a1(0x18b)](_0x187e1b)+_0x59e1a1(0x1e0)+a90_0x5c8f92[_0x59e1a1(0x1bc)](_0x59e1a1(0x1ad))),console[_0x59e1a1(0x189)](_0x59e1a1(0x1b7));}else console['log'](a90_0x5c8f92[_0x59e1a1(0x194)](_0x59e1a1(0x17f))+'\x20\x20'+a90_0x5c8f92['gray'](_0x59e1a1(0x183)));console[_0x59e1a1(0x189)]('');}function execConfigMigration(_0x2bc2a2,_0xeb4fa7){const _0x436f9e=a90_0x3763a7,{configMigration:_0x1dbe39}=_0x2bc2a2;if(!_0x1dbe39?.['oldPath'])return{'step':0x1,'label':_0x436f9e(0x1a7),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x561263=readConfigFile(_0x1dbe39['oldPath']),_0x1bd156=resolve(_0xeb4fa7,NEW_CONFIG_NAME),_0x2328b6=_0x1dbe39[_0x436f9e(0x17c)]?readConfigFile(_0x1bd156):{};for(const [_0x321c24,_0x3bc350]of Object[_0x436f9e(0x1d5)](_0x561263)){!(_0x321c24 in _0x2328b6)&&(_0x2328b6[_0x321c24]=_0x3bc350);}writeConfigFile(_0x1bd156,_0x2328b6);const _0x186150=_0x1dbe39['oldPath']+_0x436f9e(0x1dd);return renameSync(_0x1dbe39[_0x436f9e(0x18e)],_0x186150),{'step':0x1,'label':_0x436f9e(0x1a7),'ok':!![],'detail':_0x1dbe39[_0x436f9e(0x18e)]+_0x436f9e(0x1e0)+_0x1bd156+_0x436f9e(0x1c8)+_0x186150+')'};}function execRemoveOldArtifacts(_0xf4c0d4){const _0x1b14e8=a90_0x3763a7,_0x307980=[];for(const _0x3a9d53 of _0xf4c0d4){try{if(!existsSync(_0x3a9d53))continue;const _0x40b3ba=tryStat(_0x3a9d53);_0x40b3ba?.[_0x1b14e8(0x199)]()?rmSync(_0x3a9d53,{'recursive':!![],'force':!![]}):unlinkSync(_0x3a9d53);}catch(_0xb6b8d){_0x307980[_0x1b14e8(0x1ec)](_0x3a9d53+':\x20'+_0xb6b8d['message']);}}return{'step':0x3,'label':_0x1b14e8(0x192),'ok':_0x307980[_0x1b14e8(0x1b2)]===0x0,'detail':_0x307980[_0x1b14e8(0x1b2)]>0x0?_0xf4c0d4[_0x1b14e8(0x1b2)]-_0x307980[_0x1b14e8(0x1b2)]+'/'+_0xf4c0d4[_0x1b14e8(0x1b2)]+_0x1b14e8(0x1f4)+_0x307980[_0x1b14e8(0x1ba)](';\x20')+')':_0xf4c0d4['length']+_0x1b14e8(0x1ab)};}function execCleanMcp(_0xffdb5e){const _0x25f33b=a90_0x3763a7;if(!_0xffdb5e['oldMcpConfig'])return{'step':0x4,'label':_0x25f33b(0x1f0),'ok':!![],'detail':_0x25f33b(0x1a5)};try{const _0xa2955d=readFileSync(_0xffdb5e[_0x25f33b(0x197)][_0x25f33b(0x1a9)],_0x25f33b(0x1b6)),_0x267c3f=JSON[_0x25f33b(0x1c6)](_0xa2955d);if(_0x267c3f?.[_0x25f33b(0x1f5)]&&typeof _0x267c3f[_0x25f33b(0x1f5)]===_0x25f33b(0x1e1)){const _0x28b6f6=[];for(const [_0x32f844,_0x1b12b7]of Object[_0x25f33b(0x1d5)](_0x267c3f[_0x25f33b(0x1f5)])){_0x1b12b7?.[_0x25f33b(0x1c3)]&&Array['isArray'](_0x1b12b7[_0x25f33b(0x1c3)])&&_0x1b12b7[_0x25f33b(0x1c3)]['some'](_0x1ea5f5=>typeof _0x1ea5f5==='string'&&_0x1ea5f5['includes']('@lovrabet/dataset-mcp-server'))&&_0x28b6f6['push'](_0x32f844);}for(const _0x308146 of _0x28b6f6){delete _0x267c3f[_0x25f33b(0x1f5)][_0x308146];}return _0x28b6f6[_0x25f33b(0x1b2)]>0x0&&writeFileSync(_0xffdb5e[_0x25f33b(0x197)]['path'],JSON[_0x25f33b(0x184)](_0x267c3f,null,0x2)+'\x0a',_0x25f33b(0x1b6)),{'step':0x4,'label':_0x25f33b(0x1f0),'ok':!![],'detail':'removed\x20'+_0x28b6f6['join'](',\x20')+'\x20from\x20'+_0xffdb5e['oldMcpConfig'][_0x25f33b(0x1a9)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x25f33b(0x1c1)};}catch(_0x118207){return{'step':0x4,'label':_0x25f33b(0x1f0),'ok':![],'detail':_0x118207[_0x25f33b(0x19d)]};}}function execSkillsRemove(_0x54997e,_0x24ca1b){const _0x274ecc=a90_0x3763a7,_0x4c9a39=runNpxSkillsRemove(_0x54997e,{'stdio':'inherit','yes':_0x24ca1b});return{'step':0x5,'label':_0x274ecc(0x1e6),'ok':_0x4c9a39['ok'],'detail':_0x4c9a39['ok']?_0x274ecc(0x18d):_0x4c9a39[_0x274ecc(0x1b4)]??_0x274ecc(0x1d7)+_0x4c9a39[_0x274ecc(0x1c2)]};}function execSkillsAdd(_0xf61fd0,_0x539b4b){const _0x3d0965=a90_0x3763a7,_0x210825=runNpxSkillsAddGlobal(_0xf61fd0,'lovrabet/rabetbase',{'stdio':_0x3d0965(0x1bb),'yes':_0x539b4b});return{'step':0x6,'label':_0x3d0965(0x18c),'ok':_0x210825['ok'],'detail':_0x210825['ok']?_0x3d0965(0x1b5):_0x210825[_0x3d0965(0x1b4)]??_0x3d0965(0x1d7)+_0x210825[_0x3d0965(0x1c2)]};}function a90_0x2e3e(_0xc6e2b6,_0x1ac393){_0xc6e2b6=_0xc6e2b6-0x17b;const _0x5af55e=a90_0x5af5();let _0x2e3ee7=_0x5af55e[_0xc6e2b6];return _0x2e3ee7;}function execUpgradeSdk(_0x4656fd){const _0x1bd73b=a90_0x3763a7;if(!_0x4656fd[_0x1bd73b(0x1a6)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x478544,currentVersion:_0x12fb8b,field:_0x8fb08a}=_0x4656fd[_0x1bd73b(0x1a6)];try{const _0x476881=readFileSync(_0x478544,_0x1bd73b(0x1b6)),_0x324a61=JSON[_0x1bd73b(0x1c6)](_0x476881);return _0x324a61[_0x8fb08a][_0x1bd73b(0x18f)]=_0x1bd73b(0x1ad),writeFileSync(_0x478544,JSON[_0x1bd73b(0x184)](_0x324a61,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x8fb08a+_0x1bd73b(0x1fa)+_0x12fb8b+_0x1bd73b(0x19f)};}catch(_0x356d07){return{'step':0x7,'label':_0x1bd73b(0x1d0),'ok':![],'detail':_0x356d07[_0x1bd73b(0x19d)]};}}function tryStat(_0x1d73a9){try{return statSync(_0x1d73a9);}catch{return undefined;}}function printSummary(_0x4a03bb){const _0x22a4fa=a90_0x3763a7;console['log'](''),console[_0x22a4fa(0x189)](a90_0x5c8f92[_0x22a4fa(0x19e)](_0x22a4fa(0x1f7))),console['log']('');for(const _0x1f7285 of _0x4a03bb){const _0x1fe32c=_0x1f7285['ok']?a90_0x5c8f92[_0x22a4fa(0x1bc)]('OK'):a90_0x5c8f92[_0x22a4fa(0x17b)](_0x22a4fa(0x1da));console[_0x22a4fa(0x189)]('\x20\x20'+_0x1fe32c+'\x20\x20Step\x20'+_0x1f7285[_0x22a4fa(0x1d4)]+':\x20'+_0x1f7285[_0x22a4fa(0x1fd)]);if(_0x1f7285[_0x22a4fa(0x1b3)])console[_0x22a4fa(0x189)](_0x22a4fa(0x19b)+a90_0x5c8f92[_0x22a4fa(0x1f2)](_0x1f7285[_0x22a4fa(0x1b3)]));}console['log']('');}export async function upgradeApp(_0x3a21b0,_0x72bd37){const _0x6bd162=a90_0x3763a7,_0x5b9b90=process[_0x6bd162(0x17d)](),_0x51cfc8=analyse(_0x5b9b90),_0x5c8b25=!_0x51cfc8[_0x6bd162(0x1c4)]&&_0x51cfc8[_0x6bd162(0x1af)][_0x6bd162(0x1b2)]===0x0&&!_0x51cfc8[_0x6bd162(0x197)]&&!_0x51cfc8[_0x6bd162(0x1d3)]&&!_0x51cfc8[_0x6bd162(0x1a6)];if(_0x5c8b25){console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x1bc)](_0x6bd162(0x190)));return;}printReport(_0x51cfc8);const _0x14711f=!!(_0x72bd37['yes']||_0x72bd37['Y']||_0x3a21b0);if(!_0x14711f)try{const _0x9dadbe=await askConfirm(_0x6bd162(0x1ca));if(!_0x9dadbe){console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x1f2)](_0x6bd162(0x1cc)));return;}}catch(_0x1b63a9){if(_0x1b63a9?.['message']===_0x6bd162(0x1a8)){console[_0x6bd162(0x189)](a90_0x5c8f92['gray']('Upgrade\x20cancelled.'));return;}throw _0x1b63a9;}const _0x2c49d4=[],_0x5be0f6=a90_0x4c0e44({'text':_0x6bd162(0x1a0),'color':'cyan'})[_0x6bd162(0x1e7)](),_0x3687a3=execConfigMigration(_0x51cfc8,_0x5b9b90);_0x2c49d4[_0x6bd162(0x1ec)](_0x3687a3),_0x5be0f6[_0x3687a3['ok']?'succeed':_0x6bd162(0x1e4)](_0x6bd162(0x1d6)+(_0x3687a3[_0x6bd162(0x1b3)]??(_0x3687a3['ok']?_0x6bd162(0x1d2):'failed')));const _0x40ee1a=resolve(_0x5b9b90,_0x6bd162(0x1a1)),_0x55e275=a90_0x4c0e44({'text':_0x6bd162(0x17e),'color':_0x6bd162(0x194)})[_0x6bd162(0x1e7)]();if(existsSync(_0x40ee1a))try{rmSync(_0x40ee1a,{'recursive':!![],'force':!![]}),_0x55e275[_0x6bd162(0x1ea)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x2c49d4[_0x6bd162(0x1ec)]({'step':0x2,'label':_0x6bd162(0x1df),'ok':!![]});}catch(_0x473999){_0x55e275[_0x6bd162(0x1e4)](_0x6bd162(0x1e5)+_0x473999[_0x6bd162(0x19d)]),_0x2c49d4[_0x6bd162(0x1ec)]({'step':0x2,'label':_0x6bd162(0x1df),'ok':![],'detail':_0x473999[_0x6bd162(0x19d)]});}else _0x55e275['info']('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x2c49d4[_0x6bd162(0x1ec)]({'step':0x2,'label':_0x6bd162(0x1df),'ok':!![],'detail':'skipped'});const _0xffc36b=a90_0x4c0e44({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x6bd162(0x194)})['start'](),_0x33a6bc=execRemoveOldArtifacts(_0x51cfc8['oldArtifacts']);_0x2c49d4[_0x6bd162(0x1ec)](_0x33a6bc),_0xffc36b[_0x33a6bc['ok']?'succeed':'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x33a6bc['detail']??(_0x33a6bc['ok']?_0x6bd162(0x1d2):_0x6bd162(0x187))));const _0x560ab7=a90_0x4c0e44({'text':_0x6bd162(0x1ee),'color':'cyan'})['start'](),_0x13699e=execCleanMcp(_0x51cfc8);_0x2c49d4[_0x6bd162(0x1ec)](_0x13699e),_0x560ab7[_0x13699e['ok']?_0x6bd162(0x1ea):_0x6bd162(0x1e4)](_0x6bd162(0x1d8)+(_0x13699e['detail']??(_0x13699e['ok']?_0x6bd162(0x1d2):'failed')));const _0x2472ee=a90_0x4c0e44({'text':_0x6bd162(0x1cb),'color':_0x6bd162(0x194)})[_0x6bd162(0x1e7)](),_0x3fb230=execSkillsRemove(_0x5b9b90,_0x14711f);_0x2c49d4[_0x6bd162(0x1ec)](_0x3fb230),_0x2472ee[_0x3fb230['ok']?_0x6bd162(0x1ea):'fail'](_0x6bd162(0x1bf)+(_0x3fb230['detail']??(_0x3fb230['ok']?_0x6bd162(0x1d2):_0x6bd162(0x187))));const _0x30f836=a90_0x4c0e44({'text':_0x6bd162(0x19a),'color':_0x6bd162(0x194)})[_0x6bd162(0x1e7)](),_0x301033=execSkillsAdd(_0x5b9b90,_0x14711f);_0x2c49d4[_0x6bd162(0x1ec)](_0x301033),_0x30f836[_0x301033['ok']?_0x6bd162(0x1ea):_0x6bd162(0x1e4)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x301033[_0x6bd162(0x1b3)]??(_0x301033['ok']?_0x6bd162(0x1d2):_0x6bd162(0x187))));const _0x16e19d=a90_0x4c0e44({'text':_0x6bd162(0x1fc),'color':_0x6bd162(0x194)})['start'](),_0x271d8e=execUpgradeSdk(_0x51cfc8);_0x2c49d4[_0x6bd162(0x1ec)](_0x271d8e),_0x16e19d[_0x271d8e['ok']?'succeed':'fail'](_0x6bd162(0x1e3)+(_0x271d8e[_0x6bd162(0x1b3)]??(_0x271d8e['ok']?_0x6bd162(0x1d2):_0x6bd162(0x187)))),printSummary(_0x2c49d4);const _0x173470=_0x2c49d4[_0x6bd162(0x1d1)](_0x568eef=>!_0x568eef['ok']);_0x173470?console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x18b)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a90_0x5c8f92[_0x6bd162(0x1bc)](_0x6bd162(0x191))),_0x271d8e['ok']&&_0x51cfc8[_0x6bd162(0x1a6)]&&(console[_0x6bd162(0x189)](''),console['log'](a90_0x5c8f92['bold'][_0x6bd162(0x194)](_0x6bd162(0x196))),console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x194)](_0x6bd162(0x1dc))),console[_0x6bd162(0x189)](''),console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x1c5)](_0x6bd162(0x185))),console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x1c5)]('\x20\x20#\x20or')),console[_0x6bd162(0x189)](a90_0x5c8f92[_0x6bd162(0x1c5)](_0x6bd162(0x1a3))),console[_0x6bd162(0x189)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a91_0x2d9109=a91_0x1144;(function(_0x203c1a,_0xf63f6a){const _0x3f28c5=a91_0x1144,_0x477978=_0x203c1a();while(!![]){try{const _0x5ac357=-parseInt(_0x3f28c5(0x154))/0x1+parseInt(_0x3f28c5(0x135))/0x2+parseInt(_0x3f28c5(0x12e))/0x3+-parseInt(_0x3f28c5(0x128))/0x4+parseInt(_0x3f28c5(0x139))/0x5*(-parseInt(_0x3f28c5(0x14d))/0x6)+parseInt(_0x3f28c5(0x151))/0x7*(-parseInt(_0x3f28c5(0x14a))/0x8)+parseInt(_0x3f28c5(0x155))/0x9*(parseInt(_0x3f28c5(0x147))/0xa);if(_0x5ac357===_0xf63f6a)break;else _0x477978['push'](_0x477978['shift']());}catch(_0x379092){_0x477978['push'](_0x477978['shift']());}}}(a91_0x4741,0xce991));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';function a91_0x1144(_0x1673d8,_0x2df1c6){_0x1673d8=_0x1673d8-0x126;const _0x4741d7=a91_0x4741();let _0x114488=_0x4741d7[_0x1673d8];return _0x114488;}import{datasetDefinitions}from'../commands/dataset/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';function a91_0x4741(){const _0x4ab5e9=['Run\x20Scripts','command','Database\x20Connections','service','BFF\x20Scripts','4502760hnhWFo','API','Self\x20Update','isSingleCommand','read','Run\x20any\x20package.json\x20script','Code\x20Generation','2007440lVlftW','build','\x20\x20[high-risk-write]','description','14065qNBwdd','get','Authentication','SQL\x20Queries','set','defaultCommand','Menu','preview','commands','length','from','run','\x20\x20[write]','Schema','160sBAmSO','logout','push','3326440qLwKrk','create','has','2898pfYqYB','auth','Logs','App\x20Management','7RZACsl','wildcardDef','write','170026paaXDO','729036JUgoMV','project','Dataset\x20&\x20Operations','map','4039876dtXilU'];a91_0x4741=function(){return _0x4ab5e9;};return a91_0x4741();}import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/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{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/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(_0x33384e){const _0x5d796a=a91_0x1144;for(const _0x30df7a of _0x33384e){definitions[_0x5d796a(0x13d)](_0x30df7a['service']+':'+_0x30df7a[_0x5d796a(0x12a)],_0x30df7a);let _0x1e4adc=serviceGroups[_0x5d796a(0x13a)](_0x30df7a[_0x5d796a(0x12c)]);!_0x1e4adc&&(_0x1e4adc=[],serviceGroups[_0x5d796a(0x13d)](_0x30df7a[_0x5d796a(0x12c)],_0x1e4adc)),_0x1e4adc[_0x5d796a(0x149)](_0x30df7a);}}function registerDeclarativeService(_0x39d55c,_0x1ffd28,_0x2d3254){const _0x315406=a91_0x1144;registerDefinitions(_0x1ffd28);_0x2d3254?.[_0x315406(0x152)]&®isterDefinitions([_0x2d3254[_0x315406(0x152)]]);const _0x1793bb=_0x2ef3a9=>_0x2ef3a9===_0x315406(0x132)?'':_0x2ef3a9===_0x315406(0x153)?_0x315406(0x145):_0x315406(0x137),_0x4d351f={'service':_0x1ffd28[0x0][_0x315406(0x12c)],'label':_0x39d55c,'commands':_0x1ffd28[_0x315406(0x127)](_0x380fff=>({'command':_0x380fff[_0x315406(0x12a)],'description':_0x380fff[_0x315406(0x138)],'tag':_0x1793bb(_0x380fff['risk'])})),'declarative':!![],'defaultCommand':_0x2d3254?.[_0x315406(0x13e)]??(_0x2d3254?.['isSingleCommand']?_0x1ffd28[0x0]['command']:undefined),'wildcardDef':_0x2d3254?.[_0x315406(0x152)],'isSingleCommand':_0x2d3254?.[_0x315406(0x131)]};serviceRegistry[_0x315406(0x149)](_0x4d351f),serviceByName['set'](_0x4d351f['service'],_0x4d351f);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a91_0x2d9109(0x144),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a91_0x2d9109(0x150),appDefinitions),registerDeclarativeService(a91_0x2d9109(0x129),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a91_0x2d9109(0x142)]-0x1];last[a91_0x2d9109(0x141)]=[{'command':'<script>','description':a91_0x2d9109(0x133),'tag':''}];}registerDeclarativeService(a91_0x2d9109(0x13b),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a91_0x2d9109(0x130),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x2d9109(0x146),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService(a91_0x2d9109(0x12f),apiDefinitions),registerDeclarativeService(a91_0x2d9109(0x13f),menuDefinitions),registerDeclarativeService(a91_0x2d9109(0x12b),dbDefinitions),registerDeclarativeService(a91_0x2d9109(0x126),datasetDefinitions),registerDeclarativeService(a91_0x2d9109(0x12d),bffDefinitions),registerDeclarativeService(a91_0x2d9109(0x13c),sqlDefinitions),registerDeclarativeService(a91_0x2d9109(0x134),codegenDefinitions),registerDeclarativeService('Skills',skillDefinitions),registerDeclarativeService(a91_0x2d9109(0x14f),logsDefinitions,{'defaultCommand':'show'});export const deprecatedAliases={'create':{'service':a91_0x2d9109(0x156),'command':a91_0x2d9109(0x14b)},'start':{'service':a91_0x2d9109(0x144),'command':'start'},'build':{'service':a91_0x2d9109(0x144),'command':a91_0x2d9109(0x136)},'preview':{'service':'run','command':a91_0x2d9109(0x140)},'logout':{'service':a91_0x2d9109(0x14e),'command':a91_0x2d9109(0x148)},'skills':{'service':'skill','command':'install'}};export function findDefinition(_0xc97534,_0x32bb3b){const _0x249450=a91_0x2d9109;return definitions[_0x249450(0x13a)](_0xc97534+':'+_0x32bb3b);}export function isKnownService(_0x509a6a){return serviceByName['has'](_0x509a6a);}export function isDeclarativeService(_0x2bb502){const _0x4f80d3=a91_0x2d9109;return serviceGroups[_0x4f80d3(0x14c)](_0x2bb502)||serviceByName[_0x4f80d3(0x13a)](_0x2bb502)?.['wildcardDef']!==undefined;}export function getServiceEntry(_0x44e900){return serviceByName['get'](_0x44e900);}export function getLegacyHandler(_0xbd18e4,_0x13d815){return undefined;}export function getAllDefinitions(){const _0x53f934=a91_0x2d9109;return Array[_0x53f934(0x143)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a92_0x49b66a=a92_0x5269;(function(_0x8882d8,_0x456758){const _0x2063df=a92_0x5269,_0x564d26=_0x8882d8();while(!![]){try{const _0x1c1ee6=-parseInt(_0x2063df(0x14c))/0x1+parseInt(_0x2063df(0x143))/0x2+-parseInt(_0x2063df(0x139))/0x3*(parseInt(_0x2063df(0x132))/0x4)+-parseInt(_0x2063df(0x141))/0x5+-parseInt(_0x2063df(0x14e))/0x6+parseInt(_0x2063df(0x137))/0x7+parseInt(_0x2063df(0x12a))/0x8;if(_0x1c1ee6===_0x456758)break;else _0x564d26['push'](_0x564d26['shift']());}catch(_0x202a8d){_0x564d26['push'](_0x564d26['shift']());}}}(a92_0x5785,0xa338f));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{checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a92_0x49b66a(0x11d),a92_0x49b66a(0x140)]);function a92_0x5785(){const _0x39cb9b=['1392290lcVzKt','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','watch','Script\x20name\x20defined\x20in\x20package.json','script','bun.lockb','map','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','\x20run\x20','1151201DzkyOK','preview','7867950RPlmel','push','all','No\x20package.json\x20found\x20in\x20current\x20directory.','slice','\x20\x20\x20\x20','inherit','\x20run\x20preview','read','padEnd','args','validation','Enable\x20watch\x20mode\x20for\x20preview','vite\x20preview\x20exited\x20with\x20code\x20','parse','Script\x20\x22','join','start','\x20\x20EXAMPLES','\x0a\x20\x20Usage:\x20','pnpm-lock.yaml','bun.lock','cwd','yarn.lock','Available:\x20','.bin','close','yarn','needsUpgrade','entries','23593936hyusvd','utf-8','has','keys','error','\x20exited\x20with\x20code\x20','(none)','\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview','356utIUNl','length','npm','package.json','--watch','9155055WohVAa','pnpm','37341VIOCAn','max','Run\x20a\x20package.json\x20script','bun','\x20run\x20<script>\x0a','vite','\x0a\x20\x20Available\x20scripts:\x0a','dev','3571920ZaCamh','run'];a92_0x5785=function(){return _0x39cb9b;};return a92_0x5785();}function readPackageScripts(_0x5d844a){const _0xeaba1e=a92_0x49b66a,_0x1e7155=resolve(_0x5d844a,_0xeaba1e(0x135));if(!existsSync(_0x1e7155))return null;try{const _0x146b95=JSON[_0xeaba1e(0x15c)](readFileSync(_0x1e7155,_0xeaba1e(0x12b)));return _0x146b95['scripts']??{};}catch{return null;}}function detectPackageManager(_0x23b51a){const _0x4fb184=a92_0x49b66a;if(existsSync(resolve(_0x23b51a,_0x4fb184(0x148)))||existsSync(resolve(_0x23b51a,_0x4fb184(0x121))))return _0x4fb184(0x13c);if(existsSync(resolve(_0x23b51a,_0x4fb184(0x120))))return _0x4fb184(0x138);if(existsSync(resolve(_0x23b51a,_0x4fb184(0x123))))return _0x4fb184(0x127);return _0x4fb184(0x134);}async function versionCheck(_0x4ef04c){const _0x24218e=a92_0x49b66a,_0x510841=await checkCliVersion();if(_0x510841[_0x24218e(0x128)])printCliUpgradeWarning(_0x510841);const _0x38aec7=await checkSdkVersion(_0x4ef04c);if(_0x38aec7[_0x24218e(0x128)])printSdkUpgradeWarning(_0x38aec7);}function spawnScript(_0x2cc9ba,_0x106ae1,_0x35a18c,_0xd10500){return new Promise((_0x421b67,_0x4bf17a)=>{const _0x23b289=a92_0x5269,_0x2e3264=[_0x23b289(0x142),_0x106ae1,..._0x35a18c],_0x47f655=spawn(_0x2cc9ba,_0x2e3264,{'cwd':_0xd10500,'stdio':_0x23b289(0x154),'shell':!![],'env':{...process.env,'PATH':''+join(_0xd10500,'node_modules','.bin')+delimiter+process.env.PATH}});_0x47f655['on'](_0x23b289(0x126),_0x1c049e=>{const _0x5c306e=_0x23b289;if(_0x1c049e===0x0||_0x1c049e===null)_0x421b67();else _0x4bf17a(new Error(_0x2cc9ba+_0x5c306e(0x14b)+_0x106ae1+_0x5c306e(0x12f)+_0x1c049e));}),_0x47f655['on'](_0x23b289(0x12e),_0x4bf17a);});}function spawnViteBuildWatch(_0x2bbe18){return new Promise((_0x3667b4,_0x59c6d8)=>{const _0x511d71=a92_0x5269,_0x31b17a=spawn(_0x511d71(0x13e),['build',_0x511d71(0x136)],{'cwd':_0x2bbe18,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x2bbe18,'node_modules',_0x511d71(0x125))+delimiter+process.env.PATH}});_0x31b17a['on'](_0x511d71(0x126),_0x33e40b=>{const _0x4813c1=_0x511d71;if(_0x33e40b===0x0||_0x33e40b===null)_0x3667b4();else _0x59c6d8(new Error(_0x4813c1(0x14a)+_0x33e40b));}),_0x31b17a['on'](_0x511d71(0x12e),_0x59c6d8);});}function a92_0x5269(_0x374ad0,_0x31fb48){_0x374ad0=_0x374ad0-0x11b;const _0x57852b=a92_0x5785();let _0x526930=_0x57852b[_0x374ad0];return _0x526930;}function spawnVitePreview(_0x67ceae){return new Promise((_0x3c32c6,_0x243e2f)=>{const _0x16fbf9=a92_0x5269,_0x25e43a=spawn(_0x16fbf9(0x13e),[_0x16fbf9(0x14d)],{'cwd':_0x67ceae,'stdio':_0x16fbf9(0x154),'shell':!![],'env':{...process.env,'PATH':''+join(_0x67ceae,'node_modules',_0x16fbf9(0x125))+delimiter+process.env.PATH}});_0x25e43a['on']('close',_0x1c0fbe=>{const _0xc650b6=_0x16fbf9;if(_0x1c0fbe===0x0||_0x1c0fbe===null)_0x3c32c6();else _0x243e2f(new Error(_0xc650b6(0x15b)+_0x1c0fbe));}),_0x25e43a['on'](_0x16fbf9(0x12e),_0x243e2f);});}const runFlags=[{'name':'watch','type':'boolean','description':a92_0x49b66a(0x15a),'default':![]}];export const runDefinition={'service':a92_0x49b66a(0x142),'command':'run','description':a92_0x49b66a(0x13b),'risk':a92_0x49b66a(0x156),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a92_0x49b66a(0x147),'description':a92_0x49b66a(0x146),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4a697b=a92_0x49b66a,_0x14ca6b=readPackageScripts(process[_0x4a697b(0x122)]()),_0x57f55c=[];if(_0x14ca6b&&Object['keys'](_0x14ca6b)['length']>0x0){const _0x40ba90=Object['keys'](_0x14ca6b),_0x838006=Math[_0x4a697b(0x13a)](..._0x40ba90[_0x4a697b(0x149)](_0x4c32d0=>_0x4c32d0['length']));_0x57f55c[_0x4a697b(0x14f)](_0x4a697b(0x144));for(const [_0xe45098,_0x343510]of Object['entries'](_0x14ca6b)){_0x57f55c[_0x4a697b(0x14f)](_0x4a697b(0x153)+CLI_BIN_NAME+_0x4a697b(0x14b)+_0xe45098[_0x4a697b(0x157)](_0x838006+0x2)+'#\x20'+_0x343510);}}else _0x57f55c['push'](_0x4a697b(0x11e)),_0x57f55c[_0x4a697b(0x14f)](_0x4a697b(0x153)+CLI_BIN_NAME+'\x20run\x20start'),_0x57f55c[_0x4a697b(0x14f)](_0x4a697b(0x153)+CLI_BIN_NAME+'\x20run\x20build'),_0x57f55c[_0x4a697b(0x14f)](_0x4a697b(0x153)+CLI_BIN_NAME+_0x4a697b(0x155)),_0x57f55c[_0x4a697b(0x14f)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x4a697b(0x131));return _0x57f55c[_0x4a697b(0x11c)]('\x0a');},async 'execute'(_0x257886){const _0x4fb24b=a92_0x49b66a,_0x263713=process[_0x4fb24b(0x122)](),_0x57c597=_0x257886['args'][0x0],_0x31e316=_0x257886[_0x4fb24b(0x158)][_0x4fb24b(0x152)](0x1),_0x8fa182=readPackageScripts(_0x263713);if(!_0x8fa182)throw CliErrors[_0x4fb24b(0x159)](_0x4fb24b(0x151));if(!_0x57c597){const _0x4f3b6c=Object[_0x4fb24b(0x12d)](_0x8fa182);if(_0x4f3b6c[_0x4fb24b(0x133)]===0x0)console['log']('No\x20scripts\x20defined\x20in\x20package.json.');else{console['log'](_0x4fb24b(0x13f));const _0x817112=Math[_0x4fb24b(0x13a)](..._0x4f3b6c[_0x4fb24b(0x149)](_0x2e71d1=>_0x2e71d1[_0x4fb24b(0x133)]));for(const [_0xafbf83,_0x5ab71a]of Object[_0x4fb24b(0x129)](_0x8fa182)){console['log'](_0x4fb24b(0x153)+_0xafbf83['padEnd'](_0x817112+0x2)+_0x5ab71a);}console['log'](_0x4fb24b(0x11f)+CLI_BIN_NAME+_0x4fb24b(0x13d));}return{'ok':!![]};}if(!_0x8fa182[_0x57c597])throw CliErrors[_0x4fb24b(0x159)](_0x4fb24b(0x11b)+_0x57c597+'\x22\x20not\x20found\x20in\x20package.json.',_0x4fb24b(0x124)+(Object[_0x4fb24b(0x12d)](_0x8fa182)[_0x4fb24b(0x11c)](',\x20')||_0x4fb24b(0x130)));const _0x281fbf=detectPackageManager(_0x263713);VERSION_CHECK_SCRIPTS[_0x4fb24b(0x12c)](_0x57c597)&&await versionCheck(_0x263713);if(_0x57c597===_0x4fb24b(0x14d)&&_0x257886['bool'](_0x4fb24b(0x145)))return await Promise[_0x4fb24b(0x150)]([spawnViteBuildWatch(_0x263713),spawnVitePreview(_0x263713)]),{'ok':!![]};return await spawnScript(_0x281fbf,_0x57c597,_0x31e316,_0x263713),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a93_0x411e(){const _0x3f27a5=['1113360wogjPB','161240MBHPTI','json','1798657HilVeX','Export\x20machine-readable\x20command\x20schema\x20(JSON)','9756gFtMDD','read','1911000mbwEKO','24ICDhhD','export','3vVEfqi','204558jJEzBZ','schema','2620692wobceq','388RKcLqs'];a93_0x411e=function(){return _0x3f27a5;};return a93_0x411e();}const a93_0x5b8a40=a93_0x536a;(function(_0x3eb65f,_0xbfeaee){const _0xe293cf=a93_0x536a,_0x506d09=_0x3eb65f();while(!![]){try{const _0x3d7609=parseInt(_0xe293cf(0x133))/0x1*(-parseInt(_0xe293cf(0x134))/0x2)+parseInt(_0xe293cf(0x12e))/0x3*(-parseInt(_0xe293cf(0x137))/0x4)+-parseInt(_0xe293cf(0x139))/0x5*(-parseInt(_0xe293cf(0x131))/0x6)+parseInt(_0xe293cf(0x12c))/0x7+parseInt(_0xe293cf(0x130))/0x8+parseInt(_0xe293cf(0x136))/0x9+-parseInt(_0xe293cf(0x138))/0xa;if(_0x3d7609===_0xbfeaee)break;else _0x506d09['push'](_0x506d09['shift']());}catch(_0x4c162a){_0x506d09['push'](_0x506d09['shift']());}}}(a93_0x411e,0x2c875));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3598d2){const _0x10f259=await buildSchemaPayload();return{'ok':!![],'data':_0x10f259};}function a93_0x536a(_0x65b9a5,_0x30f876){_0x65b9a5=_0x65b9a5-0x12b;const _0x411ed7=a93_0x411e();let _0x536a0c=_0x411ed7[_0x65b9a5];return _0x536a0c;}export const schemaDefinition={'service':a93_0x5b8a40(0x135),'command':a93_0x5b8a40(0x132),'description':a93_0x5b8a40(0x12d),'risk':a93_0x5b8a40(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a93_0x5b8a40(0x12b),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a94_0x32f9(_0x49213d,_0x13390d){_0x49213d=_0x49213d-0x74;const _0x3da4bb=a94_0x3da4();let _0x32f9b8=_0x3da4bb[_0x49213d];return _0x32f9b8;}const a94_0x1aecd2=a94_0x32f9;(function(_0x1ac5e7,_0xa83080){const _0x32cc08=a94_0x32f9,_0xfab380=_0x1ac5e7();while(!![]){try{const _0x1557b8=-parseInt(_0x32cc08(0x7e))/0x1+-parseInt(_0x32cc08(0x75))/0x2*(-parseInt(_0x32cc08(0x76))/0x3)+parseInt(_0x32cc08(0x84))/0x4+-parseInt(_0x32cc08(0x89))/0x5+parseInt(_0x32cc08(0x79))/0x6+-parseInt(_0x32cc08(0x7a))/0x7+parseInt(_0x32cc08(0x90))/0x8;if(_0x1557b8===_0xa83080)break;else _0xfab380['push'](_0xfab380['shift']());}catch(_0x29f96c){_0xfab380['push'](_0xfab380['shift']());}}}(a94_0x3da4,0x728bc));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a94_0x3da4(){const _0x99c687=['lovrabet/rabetbase','700919QWTtIV','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','nonInteractive','npx\x20skills\x20add\x20failed:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','skill-install','1860576oskmWB','skipped','apiError','pipe','info','4437465elmMsd','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','\x20skill\x20installed','skill','Check\x20network\x20connectivity\x20and\x20try\x20again.','error','../../skills/npx-skills-add.js','3573280UjfOuj','unknown','7908mNBXsz','486gOFZFn','Install\x20developer\x20skill\x20package','install','4709196ZxNGNJ','1957382piZunx','log','cwd'];a94_0x3da4=function(){return _0x99c687;};return a94_0x3da4();}export const skillDefinitions=[{'service':a94_0x1aecd2(0x8c),'command':a94_0x1aecd2(0x78),'description':a94_0x1aecd2(0x77),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3f69bc){const _0x4cdd59=a94_0x1aecd2;logger['setLogPath'](process[_0x4cdd59(0x7c)]()),logger[_0x4cdd59(0x88)](_0x4cdd59(0x83),_0x4cdd59(0x8a));const {runNpxSkillsAddGlobal:_0x202f56}=await import(_0x4cdd59(0x8f)),_0x3706bd=_0x3f69bc[_0x4cdd59(0x80)]?_0x4cdd59(0x87):'inherit';console[_0x4cdd59(0x7b)](_0x4cdd59(0x7f));const _0x4d3fd2=_0x202f56(process[_0x4cdd59(0x7c)](),_0x4cdd59(0x7d),{'stdio':_0x3706bd});if(_0x4d3fd2[_0x4cdd59(0x85)])console['log'](_0x4cdd59(0x82));else{if(_0x4d3fd2['ok'])console[_0x4cdd59(0x7b)](CLI_BIN_NAME+_0x4cdd59(0x8b));else throw CliErrors[_0x4cdd59(0x86)](_0x4cdd59(0x81)+(_0x4d3fd2[_0x4cdd59(0x8e)]||_0x4cdd59(0x74)),_0x4cdd59(0x8d));}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a95_0x2149(){const _0x2730a8=['Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','5698172VeXJNd','description','1118684CdXikx','verbose','544150eajrmU','5eZfyfL','sqlContent','9ycAyMI','sqlCode','sqlcode','dbId','1OHrUnQ','53480NJspcy','3605739OxqAOR','sqlName','429trULBD','sql','Return\x20full\x20raw\x20SQL\x20query\x20object','str','boolean','6634184GXJTqP','833694zxErUy','read'];a95_0x2149=function(){return _0x2730a8;};return a95_0x2149();}const a95_0x271a83=a95_0x5e62;(function(_0x1f8493,_0x4bad98){const _0x5b71c8=a95_0x5e62,_0x281ca5=_0x1f8493();while(!![]){try{const _0x56c345=-parseInt(_0x5b71c8(0xdd))/0x1*(-parseInt(_0x5b71c8(0xd4))/0x2)+-parseInt(_0x5b71c8(0xdf))/0x3+-parseInt(_0x5b71c8(0xd2))/0x4*(parseInt(_0x5b71c8(0xd7))/0x5)+-parseInt(_0x5b71c8(0xcf))/0x6+-parseInt(_0x5b71c8(0xde))/0x7+-parseInt(_0x5b71c8(0xe6))/0x8*(-parseInt(_0x5b71c8(0xd9))/0x9)+-parseInt(_0x5b71c8(0xd6))/0xa*(-parseInt(_0x5b71c8(0xe1))/0xb);if(_0x56c345===_0x4bad98)break;else _0x281ca5['push'](_0x281ca5['shift']());}catch(_0x3b32af){_0x281ca5['push'](_0x281ca5['shift']());}}}(a95_0x2149,0xb41db));import{getSqlQueryInfo}from'../../core/api-client.js';function a95_0x5e62(_0x50fb97,_0x25e2ab){_0x50fb97=_0x50fb97-0xcf;const _0x21493c=a95_0x2149();let _0x5e6247=_0x21493c[_0x50fb97];return _0x5e6247;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a95_0x271a83(0xe2),'command':'detail','description':a95_0x271a83(0xd1),'risk':a95_0x271a83(0xd0),'flags':[SQLCODE_FLAG,{'name':a95_0x271a83(0xd5),'type':a95_0x271a83(0xe5),'description':a95_0x271a83(0xe3)}],async 'execute'(_0x5d3ede){const _0x4aef85=a95_0x271a83,_0x2e6189=await getSqlQueryInfo(_0x5d3ede['appCode'],_0x5d3ede[_0x4aef85(0xe4)](_0x4aef85(0xdb))),_0x48f48b=_0x5d3ede['bool'](_0x4aef85(0xd5));if(_0x48f48b)return{'ok':!![],'data':_0x2e6189};const _0x31a30c=_0x2e6189[_0x4aef85(0xdc)]?await getDbName(_0x5d3ede['appCode'],_0x2e6189[_0x4aef85(0xdc)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x2e6189[_0x4aef85(0xda)],'sqlName':_0x2e6189[_0x4aef85(0xe0)],'db':_0x31a30c?_0x31a30c+'\x20('+_0x2e6189[_0x4aef85(0xdc)]+')':_0x2e6189['dbId']??'','description':_0x2e6189[_0x4aef85(0xd3)]??'','sqlContent':_0x2e6189[_0x4aef85(0xd8)]??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a96_0x4e9a12=a96_0x5528;(function(_0x5d2597,_0x468c10){const _0xe5df90=a96_0x5528,_0xed4ae0=_0x5d2597();while(!![]){try{const _0x227586=parseInt(_0xe5df90(0xd2))/0x1+parseInt(_0xe5df90(0xd7))/0x2+-parseInt(_0xe5df90(0xd1))/0x3+-parseInt(_0xe5df90(0xcc))/0x4+parseInt(_0xe5df90(0xd6))/0x5+parseInt(_0xe5df90(0xdb))/0x6*(parseInt(_0xe5df90(0xce))/0x7)+parseInt(_0xe5df90(0xca))/0x8;if(_0x227586===_0x468c10)break;else _0xed4ae0['push'](_0xed4ae0['shift']());}catch(_0x75fbdb){_0xed4ae0['push'](_0xed4ae0['shift']());}}}(a96_0x3f63,0x9cbc4));function a96_0x5528(_0x27d0d5,_0xdf0cc2){_0x27d0d5=_0x27d0d5-0xc6;const _0x3f638d=a96_0x3f63();let _0x5528f3=_0x3f638d[_0x27d0d5];return _0x5528f3;}import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':'sql','command':'exec','description':a96_0x4e9a12(0xd0),'risk':'read','flags':[SQLCODE_FLAG,{'name':a96_0x4e9a12(0xcb),'type':a96_0x4e9a12(0xdc),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x2e53b7){const _0x1d7832=a96_0x4e9a12;let _0x1d0ebc;const _0x29320e=_0x2e53b7['str'](_0x1d7832(0xcb));if(_0x29320e)try{_0x1d0ebc=JSON[_0x1d7832(0xd9)](_0x29320e);}catch{throw CliErrors[_0x1d7832(0xd4)](_0x1d7832(0xc8)+_0x29320e);}const _0x109a65=Date[_0x1d7832(0xcd)](),_0xd90edf=await executeSql(_0x2e53b7[_0x1d7832(0xc7)],_0x2e53b7[_0x1d7832(0xd8)](_0x1d7832(0xd5)),_0x1d0ebc),_0x54bc4e=Date[_0x1d7832(0xcd)]()-_0x109a65,_0x530097=_0xd90edf?.[_0x1d7832(0xc9)]??_0xd90edf,_0x3b36f0=_0xd90edf?.[_0x1d7832(0xcf)]??!![];if(!_0x3b36f0)return{'ok':![],'data':{'error':_0xd90edf?.[_0x1d7832(0xdd)]||_0x1d7832(0xda),'elapsed':_0x54bc4e},'message':'SQL\x20execution\x20failed'};const _0x1953c7=Array[_0x1d7832(0xd3)](_0x530097)?_0x530097:[];return{'ok':!![],'data':{'rows':_0x1953c7,'rowCount':_0x1953c7[_0x1d7832(0xc6)],'elapsed':_0x54bc4e},'message':'Returned\x20'+_0x1953c7['length']+'\x20row(s)\x20in\x20'+_0x54bc4e+'ms'};}};function a96_0x3f63(){const _0x412262=['now','663733DpTEfp','execSuccess','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','768681BRESGC','206627TUFosI','isArray','validation','sqlcode','899555bpOpVy','151834NVXCBR','str','parse','SQL\x20execution\x20failed','42rQGFSV','string','execError','length','appCode','Invalid\x20JSON\x20for\x20--params:\x20','execResult','2389024VUQFRD','params','2106404ZceJLl'];a96_0x3f63=function(){return _0x412262;};return a96_0x3f63();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a97_0x13c4(_0x2762c8,_0x58557b){_0x2762c8=_0x2762c8-0x11b;const _0x1eb033=a97_0x1eb0();let _0x13c41f=_0x1eb033[_0x2762c8];return _0x13c41f;}(function(_0x227580,_0x2b6d7f){const _0x3821cb=a97_0x13c4,_0x30e560=_0x227580();while(!![]){try{const _0x190b42=parseInt(_0x3821cb(0x120))/0x1+-parseInt(_0x3821cb(0x11d))/0x2+-parseInt(_0x3821cb(0x121))/0x3+-parseInt(_0x3821cb(0x11f))/0x4+parseInt(_0x3821cb(0x11b))/0x5*(parseInt(_0x3821cb(0x123))/0x6)+parseInt(_0x3821cb(0x11c))/0x7*(parseInt(_0x3821cb(0x124))/0x8)+parseInt(_0x3821cb(0x122))/0x9*(parseInt(_0x3821cb(0x11e))/0xa);if(_0x190b42===_0x2b6d7f)break;else _0x30e560['push'](_0x30e560['shift']());}catch(_0x42ca19){_0x30e560['push'](_0x30e560['shift']());}}}(a97_0x1eb0,0x42ede));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';function a97_0x1eb0(){const _0x23dfc1=['582gCYYxI','184ZWnvLm','27495QPMAEB','6727rtXrXZ','705504cYKTAm','125890gqtrVU','761276UYiheH','252910vzTAFU','313512jeljKo','81cwRAvo'];a97_0x1eb0=function(){return _0x23dfc1;};return a97_0x1eb0();}import{sqlPull}from'../../commands/sql/pull.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec,sqlPull];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a98_0x517baf=a98_0x368e;(function(_0x11f2dc,_0xc8359b){const _0x66df66=a98_0x368e,_0x3031b1=_0x11f2dc();while(!![]){try{const _0x304b1b=parseInt(_0x66df66(0x102))/0x1+parseInt(_0x66df66(0xe7))/0x2+parseInt(_0x66df66(0xf5))/0x3*(-parseInt(_0x66df66(0xef))/0x4)+parseInt(_0x66df66(0xec))/0x5*(-parseInt(_0x66df66(0xfb))/0x6)+parseInt(_0x66df66(0xed))/0x7*(-parseInt(_0x66df66(0x101))/0x8)+parseInt(_0x66df66(0xe2))/0x9*(-parseInt(_0x66df66(0xf1))/0xa)+parseInt(_0x66df66(0xf0))/0xb;if(_0x304b1b===_0xc8359b)break;else _0x3031b1['push'](_0x3031b1['shift']());}catch(_0x510e3c){_0x3031b1['push'](_0x3031b1['shift']());}}}(a98_0x3fa3,0x456b1));function a98_0x368e(_0x509fc7,_0x5a57ae){_0x509fc7=_0x509fc7-0xdf;const _0x3fa3ba=a98_0x3fa3();let _0x368e89=_0x3fa3ba[_0x509fc7];return _0x368e89;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':a98_0x517baf(0xeb),'description':'List\x20custom\x20SQL\x20queries','risk':a98_0x517baf(0xfd),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a98_0x517baf(0xe4),'type':a98_0x517baf(0xe9),'description':a98_0x517baf(0xe8)},{'name':a98_0x517baf(0xf9),'type':a98_0x517baf(0xe1),'description':a98_0x517baf(0xe3),'default':0x1},{'name':a98_0x517baf(0xff),'type':a98_0x517baf(0xe1),'description':'Page\x20size'},{'name':a98_0x517baf(0xfc),'type':a98_0x517baf(0xfe),'description':a98_0x517baf(0xf4)}],async 'execute'(_0x1cdf6e){const _0x3c9961=a98_0x517baf,_0x11e7d0=await listSqlQueries(_0x1cdf6e[_0x3c9961(0xe5)],{'sqlCode':_0x1cdf6e['str'](_0x3c9961(0xdf))||undefined,'sqlName':_0x1cdf6e[_0x3c9961(0xf6)](_0x3c9961(0xe4))||undefined,'currentPage':_0x1cdf6e[_0x3c9961(0xf2)]('page'),'pageSize':_0x1cdf6e[_0x3c9961(0xf2)](_0x3c9961(0xff),0x32)}),_0x12a709=_0x1cdf6e['bool'](_0x3c9961(0xfc)),_0x5a6892=_0x11e7d0[_0x3c9961(0xee)]??[],_0x4fc8f5=_0x11e7d0[_0x3c9961(0xf3)]?.[_0x3c9961(0x100)]??_0x5a6892[_0x3c9961(0xe0)];let _0x538ee6;return _0x12a709?_0x538ee6=_0x5a6892:_0x538ee6=await Promise[_0x3c9961(0xe6)](_0x5a6892[_0x3c9961(0x103)](async _0x32bfd5=>{const _0x37ce25=_0x3c9961;let _0xb48e9d;try{_0xb48e9d=_0x32bfd5[_0x37ce25(0xfa)]?await getDbName(_0x1cdf6e[_0x37ce25(0xe5)],_0x32bfd5[_0x37ce25(0xfa)]):undefined;}catch{}return{'sqlCode':_0x32bfd5['sqlCode'],'sqlName':_0x32bfd5['sqlName'],'description':_0x32bfd5[_0x37ce25(0xf8)]??'','db':_0xb48e9d?_0xb48e9d+'\x20('+_0x32bfd5['dbId']+')':_0x32bfd5['dbId']??''};})),{'ok':!![],'data':_0x538ee6,'message':_0x5a6892[_0x3c9961(0xe0)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x3c9961(0xea)+_0x5a6892['length']+_0x3c9961(0xf7)+_0x4fc8f5+').'};}};function a98_0x3fa3(){const _0xfeed6=['string','Found\x20','list','1075AVZWzY','22141NwhCSI','tableData','7444ApsgCy','2336774nqJuAN','1310QBCMWP','num','paging','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','57zlJrVm','str','\x20SQL\x20queries\x20(total:\x20','description','page','dbId','8916erKafn','verbose','read','boolean','pagesize','totalCount','24DkpMuN','367283dbNCdX','map','sqlcode','length','number','5058ftxjPH','Page\x20number','name','appCode','all','285160hfcWWk','Filter\x20by\x20SQL\x20name'];a98_0x3fa3=function(){return _0xfeed6;};return a98_0x3fa3();}
|
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a99_0x4131b7=a99_0x2551;(function(_0x97075b,_0x685163){const _0x679891=a99_0x2551,_0xc6a61f=_0x97075b();while(!![]){try{const _0x57eca3=parseInt(_0x679891(0xe8))/0x1*(-parseInt(_0x679891(0xeb))/0x2)+parseInt(_0x679891(0x112))/0x3+-parseInt(_0x679891(0x10d))/0x4+-parseInt(_0x679891(0x108))/0x5*(-parseInt(_0x679891(0xf9))/0x6)+parseInt(_0x679891(0xe7))/0x7*(parseInt(_0x679891(0xf4))/0x8)+parseInt(_0x679891(0x105))/0x9*(-parseInt(_0x679891(0x109))/0xa)+-parseInt(_0x679891(0xe2))/0xb*(-parseInt(_0x679891(0x114))/0xc);if(_0x57eca3===_0x685163)break;else _0xc6a61f['push'](_0xc6a61f['shift']());}catch(_0x5f4c24){_0xc6a61f['push'](_0xc6a61f['shift']());}}}(a99_0x4b0e,0x6961b));function a99_0x4b0e(){const _0x92596f=['sqlCode','\x20error(s)).','utf8','1570591CfxwKy','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','Would\x20pull\x20','yes','close','875AKWaTH','713623IjXaiV','appCode','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','2wkahoy','question','string','stderr','Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)','/smartapi/custom/queryUserCustomSqlList','push','sqlContent','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20','17312sfMyGO','trim','name','local\x20differs\x20from\x20remote','Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote','53634ZUmjov','sqlName','Pull\x20complete:\x20','includes','No\x20remote\x20SQL\x20queries\x20matched.','\x20SQL\x20file(s)\x20under\x20','cancelled','totalCount','would_pull','\x20skipped,\x20','length','write','9mKUkZp','paging','\x20written,\x20','185gkIHXX','2158910KrVLND','force','bool','str','471448fclrUz','stdin','unchanged','sql','message','2204985dUouVA','sqlcode','12yxjBxp'];a99_0x4b0e=function(){return _0x92596f;};return a99_0x4b0e();}import{createInterface}from'node:readline';import{readFile,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryInfo,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{findProjectRootDirectory}from'../../context.js';import{assignSqlFileNames,buildPulledSqlFileContent,resolveSqlLocalDir}from'../../commands/sql/shared.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x263d00,_0x5c53fa){const _0xcbe3cd=a99_0x2551,_0x5f2224=[];let _0x1397c8=0x1;while(!![]){const _0x4f0077=await listSqlQueries(_0x263d00,{'currentPage':_0x1397c8,'pageSize':PAGE_SIZE,'sqlCode':_0x5c53fa[_0xcbe3cd(0xdf)],'sqlName':_0x5c53fa[_0xcbe3cd(0xfa)]}),_0x1a9252=_0x4f0077['tableData']??[];_0x5f2224[_0xcbe3cd(0xf1)](..._0x1a9252);if(_0x1a9252['length']===0x0)break;const _0x189758=_0x4f0077[_0xcbe3cd(0x106)]?.[_0xcbe3cd(0x100)];if(_0x189758!=null?_0x5f2224[_0xcbe3cd(0x103)]>=_0x189758:_0x1a9252[_0xcbe3cd(0x103)]<PAGE_SIZE)break;_0x1397c8++;}return _0x5f2224;}async function ensureSqlContent(_0x54d67a,_0x467962){const _0x11d48c=a99_0x2551;if(_0x467962[_0x11d48c(0xf2)]!=null&&String(_0x467962[_0x11d48c(0xf2)])[_0x11d48c(0x103)]>0x0)return _0x467962;return getSqlQueryInfo(_0x54d67a,_0x467962[_0x11d48c(0xdf)]);}export const sqlPull={'service':a99_0x4131b7(0x110),'command':'pull','description':a99_0x4131b7(0xe3),'risk':a99_0x4131b7(0x104),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a99_0x4131b7(0xf6),'type':a99_0x4131b7(0xed),'description':a99_0x4131b7(0xef)},{'name':a99_0x4131b7(0x10a),'type':'boolean','description':a99_0x4131b7(0xf8)}],async 'dryRun'(_0x376095){const _0x4b3463=a99_0x4131b7,_0x1e9a89=findProjectRootDirectory(),_0x13d115=resolveSqlLocalDir(_0x1e9a89),_0x5033d7=_0x376095[_0x4b3463(0x10c)]('sqlcode')||undefined,_0x132007=_0x376095['str'](_0x4b3463(0xf6))||undefined,_0x58d03d=await fetchAllSqlQueries(_0x376095[_0x4b3463(0xe9)],{'sqlCode':_0x5033d7,'sqlName':_0x132007}),_0x5490f3=[],_0x2a77d6=[];for(const _0x4010df of _0x58d03d){try{_0x5490f3[_0x4b3463(0xf1)](await ensureSqlContent(_0x376095[_0x4b3463(0xe9)],_0x4010df));}catch(_0x22c300){_0x2a77d6['push']({'sqlCode':_0x4010df[_0x4b3463(0xdf)],'error':_0x22c300 instanceof Error?_0x22c300[_0x4b3463(0x111)]:String(_0x22c300)});}}const _0x88bfac=assignSqlFileNames(_0x5490f3),_0x87b514=[];for(const [_0x5542a3,_0x163f20]of _0x88bfac){const _0x5197bd=join(_0x13d115,_0x5542a3),_0x363277=buildPulledSqlFileContent(_0x163f20);let _0x561d9d=_0x4b3463(0x101),_0xd5f247;if(await fileExists(_0x5197bd)){const _0x59827c=await readFile(_0x5197bd,'utf8');_0x59827c===_0x363277?(_0x561d9d='skipped',_0xd5f247=_0x4b3463(0x10f)):(_0x561d9d='conflict',_0xd5f247=_0x4b3463(0xea));}_0x87b514['push']({'sqlCode':_0x163f20[_0x4b3463(0xdf)],'sqlName':_0x163f20[_0x4b3463(0xfa)],'filePath':_0x5197bd,'status':_0x561d9d,'reason':_0xd5f247});}return{'method':'POST','url':_0x4b3463(0xf0),'body':{'appCode':_0x376095['appCode'],'sqlCode':_0x5033d7??null,'sqlName':_0x132007??null,'loadErrors':_0x2a77d6,'files':_0x87b514},'description':_0x4b3463(0xe4)+_0x87b514['length']+_0x4b3463(0xfe)+_0x13d115};},async 'execute'(_0x2b20c1){const _0x53b416=a99_0x4131b7,_0x2741db=findProjectRootDirectory(),_0x2f167a=resolveSqlLocalDir(_0x2741db),_0x404fbc=_0x2b20c1[_0x53b416(0x10c)](_0x53b416(0x113))||undefined,_0x3b87a7=_0x2b20c1[_0x53b416(0x10c)](_0x53b416(0xf6))||undefined,_0xff7f1f=_0x2b20c1[_0x53b416(0x10b)]('force'),_0x36fb8d=await fetchAllSqlQueries(_0x2b20c1['appCode'],{'sqlCode':_0x404fbc,'sqlName':_0x3b87a7});if(_0x36fb8d['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x53b416(0xfd)};const _0x6c2fea=[],_0x51ae53=[];for(const _0x248457 of _0x36fb8d){try{_0x6c2fea[_0x53b416(0xf1)](await ensureSqlContent(_0x2b20c1['appCode'],_0x248457));}catch(_0x3f16eb){_0x51ae53[_0x53b416(0xf1)]({'sqlCode':_0x248457[_0x53b416(0xdf)],'error':_0x3f16eb instanceof Error?_0x3f16eb['message']:String(_0x3f16eb)});}}if(_0x6c2fea['length']===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x51ae53},'message':'Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20('+_0x51ae53[_0x53b416(0x103)]+_0x53b416(0xe0)};const _0x157be5=assignSqlFileNames(_0x6c2fea);if(_0xff7f1f&&!_0x2b20c1['nonInteractive']){let _0x4904f2=![];for(const [_0x35eb8f,_0x5b6384]of _0x157be5){const _0x11769b=join(_0x2f167a,_0x35eb8f),_0x28218b=buildPulledSqlFileContent(_0x5b6384);if(await fileExists(_0x11769b)){const _0x2a432a=await readFile(_0x11769b,_0x53b416(0xe1));if(_0x2a432a!==_0x28218b){_0x4904f2=!![];break;}}}if(_0x4904f2){const _0x50b8e4=await confirmForce();if(!_0x50b8e4)throw CliErrors[_0x53b416(0xff)]('Force\x20pull\x20cancelled.');}}const _0x18535a=[],_0x3626f2=[];for(const [_0x26db9e,_0x5364a5]of _0x157be5){const _0x4b327d=join(_0x2f167a,_0x26db9e),_0x438cfa=buildPulledSqlFileContent(_0x5364a5);try{if(await fileExists(_0x4b327d)){const _0x3ac660=await readFile(_0x4b327d,'utf8');if(_0x3ac660===_0x438cfa){_0x3626f2['push']({'sqlCode':_0x5364a5[_0x53b416(0xdf)],'reason':_0x53b416(0x10f)});continue;}if(!_0xff7f1f){_0x3626f2[_0x53b416(0xf1)]({'sqlCode':_0x5364a5[_0x53b416(0xdf)],'reason':_0x53b416(0xf7)});continue;}}await ensureParentDirectory(_0x4b327d),await writeFile(_0x4b327d,_0x438cfa,'utf8'),_0x18535a[_0x53b416(0xf1)]({'sqlCode':_0x5364a5[_0x53b416(0xdf)],'filePath':_0x4b327d});}catch(_0x453369){_0x51ae53[_0x53b416(0xf1)]({'sqlCode':_0x5364a5[_0x53b416(0xdf)],'error':_0x453369 instanceof Error?_0x453369[_0x53b416(0x111)]:String(_0x453369)});}}const _0x4cc0ac=_0x51ae53[_0x53b416(0x103)]===0x0;return{'ok':_0x4cc0ac,'data':{'pulled':_0x18535a,'skipped':_0x3626f2,'failed':_0x51ae53},'message':_0x53b416(0xfb)+_0x18535a['length']+_0x53b416(0x107)+_0x3626f2[_0x53b416(0x103)]+_0x53b416(0x102)+_0x51ae53[_0x53b416(0x103)]+'\x20failed'};}};function a99_0x2551(_0x5c0e45,_0x4f82d0){_0x5c0e45=_0x5c0e45-0xdf;const _0x4b0eea=a99_0x4b0e();let _0x2551eb=_0x4b0eea[_0x5c0e45];return _0x2551eb;}async function confirmForce(){const _0x381c9f=a99_0x4131b7,_0x2fe493=createInterface({'input':process[_0x381c9f(0x10e)],'output':process[_0x381c9f(0xee)]}),_0x2712a2=await new Promise(_0x5bcdc3=>{const _0x2389a8=_0x381c9f;_0x2fe493[_0x2389a8(0xec)](_0x2389a8(0xf3),_0x5bcdc3);});return _0x2fe493[_0x381c9f(0xe6)](),['y',_0x381c9f(0xe5)][_0x381c9f(0xfc)](_0x2712a2[_0x381c9f(0xf5)]()['toLowerCase']());}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a100_0x226f40=a100_0x1d10;(function(_0x328400,_0x4eebd7){const _0x215410=a100_0x1d10,_0x3a157f=_0x328400();while(!![]){try{const _0xae7e07=-parseInt(_0x215410(0x16f))/0x1*(-parseInt(_0x215410(0x164))/0x2)+-parseInt(_0x215410(0x149))/0x3+-parseInt(_0x215410(0x16e))/0x4+-parseInt(_0x215410(0x16a))/0x5+-parseInt(_0x215410(0x15d))/0x6+-parseInt(_0x215410(0x152))/0x7+-parseInt(_0x215410(0x16d))/0x8*(-parseInt(_0x215410(0x175))/0x9);if(_0xae7e07===_0x4eebd7)break;else _0x3a157f['push'](_0x3a157f['shift']());}catch(_0x581942){_0x3a157f['push'](_0x3a157f['shift']());}}}(a100_0x273e,0x4e2ad));function a100_0x273e(){const _0x426f37=['9704vAMksn','2110680nvBSPY','35077CmEwKf','Validation:\x20','/api/node-toolbox/sql/save','appCode','SQL\x20query\x20description','File\x20not\x20found:\x20','14283utwkQQ','Type:\x20','732495zjlRKJ','length','blocked','\x20chars)','Save\x20SQL\x20query\x20from\x20','sqlName','\x20|\x20Tables:\x20','utf-8','cwd','3750698HkVFPN','string','sqlname','sqlCode','write','file','POST','tables','validation','description','str','3807990lKmyAd','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','action','sqlcode','Path\x20to\x20the\x20SQL\x20file','dbId','sqlType','24xSWjgN','message','parameters','\x20successfully','created','join','417340sXckjF','sql','type'];a100_0x273e=function(){return _0x426f37;};return a100_0x273e();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';function a100_0x1d10(_0x37d5c4,_0xf0bdba){_0x37d5c4=_0x37d5c4-0x148;const _0x273ed4=a100_0x273e();let _0x1d1076=_0x273ed4[_0x37d5c4];return _0x1d1076;}import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a100_0x226f40(0x16b),'command':'save','description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','risk':a100_0x226f40(0x156),'flags':[{'name':a100_0x226f40(0x157),'type':'string','required':!![],'description':a100_0x226f40(0x161)},SQLCODE_FLAG_OPTIONAL,{'name':a100_0x226f40(0x154),'type':'string','description':'SQL\x20query\x20display\x20name'},{'name':'db','type':'string','description':a100_0x226f40(0x15e)},{'name':a100_0x226f40(0x15b),'type':a100_0x226f40(0x153),'description':a100_0x226f40(0x173)}],async 'validate'(_0xc3e05d){const _0x2bae2d=a100_0x226f40,_0x45768a=resolve(process[_0x2bae2d(0x151)](),_0xc3e05d[_0x2bae2d(0x15c)](_0x2bae2d(0x157)));if(!existsSync(_0x45768a))throw CliErrors[_0x2bae2d(0x15a)](_0x2bae2d(0x174)+_0x45768a);const _0x42cf03=readFileSync(_0x45768a,_0x2bae2d(0x150)),_0xc3463e=validateSql(_0x42cf03);if(!_0xc3463e['valid'])throw CliErrors[_0x2bae2d(0x15a)]('SQL\x20validation\x20failed:\x20'+_0xc3463e[_0x2bae2d(0x165)]);},async 'dryRun'(_0x103964){const _0x5e5159=a100_0x226f40,_0x559fed=resolve(process[_0x5e5159(0x151)](),_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x157))),_0x39c5f1=readFileSync(_0x559fed,_0x5e5159(0x150)),_0x403d80=validateSql(_0x39c5f1),_0x19593f=_0x103964[_0x5e5159(0x15c)]('db')||undefined,{db:_0x1162f3,error:_0x17ab7b}=await resolveOneDb(_0x103964[_0x5e5159(0x172)],_0x19593f);return{'method':_0x5e5159(0x158),'url':_0x5e5159(0x171),'body':{'appCode':_0x103964[_0x5e5159(0x172)],'sqlContent':'('+_0x39c5f1[_0x5e5159(0x14a)]+_0x5e5159(0x14c),'sqlCode':_0x103964[_0x5e5159(0x15c)]('sqlcode')||undefined,'sqlName':_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x154))||undefined,'db':_0x1162f3?_0x1162f3['dbName']+'\x20('+_0x1162f3['dbId']+')':_0x17ab7b},'description':[_0x5e5159(0x14d)+_0x103964[_0x5e5159(0x15c)](_0x5e5159(0x157)),_0x5e5159(0x170)+_0x403d80[_0x5e5159(0x165)],_0x5e5159(0x148)+_0x403d80[_0x5e5159(0x163)][_0x5e5159(0x16c)]+_0x5e5159(0x14f)+(_0x403d80[_0x5e5159(0x159)]['join'](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x403d80[_0x5e5159(0x166)][_0x5e5159(0x169)](',\x20')||'none')][_0x5e5159(0x169)]('\x0a')};},async 'execute'(_0x5c48e6){const _0x7f4013=a100_0x226f40,_0x1f537f=resolve(process[_0x7f4013(0x151)](),_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x157))),_0xc5d510=readFileSync(_0x1f537f,_0x7f4013(0x150)),_0x1e0cce=_0x5c48e6['str']('db')||undefined,{db:_0x40e737,error:_0x48062d}=await resolveOneDb(_0x5c48e6[_0x7f4013(0x172)],_0x1e0cce);if(_0x48062d)throw CliErrors[_0x7f4013(0x15a)](_0x48062d);const _0xc436ad=await saveSqlQuery({'appCode':_0x5c48e6[_0x7f4013(0x172)],'sqlContent':_0xc5d510,'sqlCode':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x160))||undefined,'sqlName':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x154))||undefined,'dbId':_0x40e737[_0x7f4013(0x162)],'description':_0x5c48e6[_0x7f4013(0x15c)](_0x7f4013(0x15b))||undefined});if(_0xc436ad[_0x7f4013(0x14b)])return{'ok':![],'data':_0xc436ad,'message':_0xc436ad[_0x7f4013(0x165)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0xc436ad[_0x7f4013(0x155)],'sqlName':_0xc436ad[_0x7f4013(0x14e)],'action':_0xc436ad[_0x7f4013(0x15f)]},'message':(_0xc436ad['action']===_0x7f4013(0x168)?'Created':'Updated')+_0x7f4013(0x167)+(_0xc436ad[_0x7f4013(0x155)]?'\x20('+_0xc436ad[_0x7f4013(0x155)]+')':'')};}};
|