@lovrabet/rabetbase-cli 2.0.2-beta.9 → 2.0.4-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- 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/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/app/add.js +1 -0
- package/lib/commands/app/index.js +1 -0
- package/lib/commands/app/list.js +1 -0
- package/lib/commands/app/remote.js +1 -0
- package/lib/commands/app/remove.js +1 -0
- package/lib/commands/app/shared.js +1 -0
- package/lib/commands/app/use.js +1 -0
- package/lib/commands/auth.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/build.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 -0
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -0
- package/lib/commands/config/get.js +1 -0
- package/lib/commands/config/index.js +1 -0
- package/lib/commands/config/list.js +1 -0
- package/lib/commands/config/set.js +1 -0
- package/lib/commands/config/shared.js +1 -0
- package/lib/commands/create.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/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.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/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.js +1 -1
- package/lib/commands/smart-init.js +1 -0
- 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/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.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.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/init/main.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -0
- package/lib/utils/ai_config.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 -0
- 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 -0
- package/lib/utils/with-active-cookie.js +1 -0
- package/package.json +7 -11
- package/lib/commands/app.js +0 -1
- package/lib/commands/config.js +0 -1
- package/lib/config/config-help.js +0 -1
- package/lib/config/main.js +0 -1
- package/lib/create-app/task-finished.js +0 -1
- package/lib/create-app/task-loading.js +0 -1
- package/lib/create-app/task-running.js +0 -1
- package/lib/create-app/task-time.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4199d2,_0x4ded90){const _0x44ab5e=a60_0x5884,_0x20d81e=_0x4199d2();while(!![]){try{const _0x4963d3=-parseInt(_0x44ab5e(0x19a))/0x1+parseInt(_0x44ab5e(0x18a))/0x2+parseInt(_0x44ab5e(0x184))/0x3+parseInt(_0x44ab5e(0x188))/0x4+parseInt(_0x44ab5e(0x19e))/0x5*(-parseInt(_0x44ab5e(0x194))/0x6)+parseInt(_0x44ab5e(0x196))/0x7*(parseInt(_0x44ab5e(0x191))/0x8)+-parseInt(_0x44ab5e(0x199))/0x9*(-parseInt(_0x44ab5e(0x190))/0xa);if(_0x4963d3===_0x4ded90)break;else _0x20d81e['push'](_0x20d81e['shift']());}catch(_0x4e6b06){_0x20d81e['push'](_0x20d81e['shift']());}}}(a60_0x1eaf,0x28999));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'./service.js';function a60_0x5884(_0x45505a,_0x33f451){_0x45505a=_0x45505a-0x182;const _0x1eaf96=a60_0x1eaf();let _0x5884c1=_0x1eaf96[_0x45505a];return _0x5884c1;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';export function validateJsUrl(_0x4bafb9){const _0x3ff8c9=a60_0x5884,_0x3df577=[];return!isValidJsHttpsUrl(_0x4bafb9)&&_0x3df577[_0x3ff8c9(0x186)](_0x3ff8c9(0x19d)),{'ok':_0x3df577[_0x3ff8c9(0x189)]===0x0,'errors':_0x3df577};}export function validateCssUrl(_0xe98160){const _0x59dbfc=a60_0x5884,_0x3618f6=[];return!isValidCssHttpsUrl(_0xe98160)&&_0x3618f6['push'](_0x59dbfc(0x198)),{'ok':_0x3618f6[_0x59dbfc(0x189)]===0x0,'errors':_0x3618f6};}function a60_0x1eaf(){const _0x3abc3e=['push','has','175936tPzKAn','length','159536AkcpgK','find','allSettled','map','label','filter','30IQRwZs','376zCZIRc','path','status','6FWQSlB','resources','3353qWdIkt','trim','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1450602UmEUPV','300930qkIXtU','rejected','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','1020715XFBuWv','errors','JS\x20URL\x20is\x20unreachable','124713vcBCqJ','No\x20local\x20pages\x20matched\x20labels:\x20'];a60_0x1eaf=function(){return _0x3abc3e;};return a60_0x1eaf();}export async function validateJsUrlReachable(_0x24abd3){const _0x33743d=a60_0x5884,_0x35a97f=validateJsUrl(_0x24abd3);if(!_0x35a97f['ok'])return _0x35a97f;const _0x27e7da=await isUrlReachable(_0x24abd3);if(!_0x27e7da)_0x35a97f[_0x33743d(0x182)][_0x33743d(0x186)](_0x33743d(0x183));return{'ok':_0x35a97f['errors']['length']===0x0,'errors':_0x35a97f[_0x33743d(0x182)]};}export async function validateCssUrlReachable(_0x3fbff4){const _0x373bb3=a60_0x5884,_0x2f6e2f=validateCssUrl(_0x3fbff4);if(!_0x2f6e2f['ok'])return _0x2f6e2f;const _0x394bb3=await isUrlReachable(_0x3fbff4);if(!_0x394bb3)_0x2f6e2f['errors'][_0x373bb3(0x186)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x2f6e2f[_0x373bb3(0x182)][_0x373bb3(0x189)]===0x0,'errors':_0x2f6e2f['errors']};}export function buildCompareRows(_0x18a728,_0x195ada){const _0x24499f=a60_0x5884;return _0x18a728[_0x24499f(0x18d)](_0x47ecb6=>({'label':_0x47ecb6[_0x24499f(0x18e)],'path':_0x47ecb6[_0x24499f(0x192)],'local':!![],'online':_0x195ada[_0x24499f(0x187)](_0x47ecb6[_0x24499f(0x192)])}));}export function filterNewPages(_0x588b1c,_0x3ec904,_0x2d3dcc){const _0x140a1d=a60_0x5884;if(_0x2d3dcc&&_0x2d3dcc[_0x140a1d(0x189)]>0x0){const _0x4aa967=new Set(_0x2d3dcc['map'](_0x415e26=>_0x415e26[_0x140a1d(0x197)]())),_0x1f9613=_0x588b1c[_0x140a1d(0x18f)](_0x4301eb=>_0x4aa967['has'](_0x4301eb['label']));if(_0x1f9613['length']===0x0)throw new Error(_0x140a1d(0x185)+[..._0x4aa967][_0x140a1d(0x19c)](',\x20'));return _0x1f9613;}return _0x588b1c[_0x140a1d(0x18f)](_0x3fdcf9=>!_0x3ec904[_0x140a1d(0x187)](_0x3fdcf9[_0x140a1d(0x192)]));}export function filterPagesByLabels(_0x2d34fb,_0x504bf2){const _0x52a895=a60_0x5884,_0x55d820=[],_0x48f33f=[];for(const _0x362857 of _0x504bf2){const _0x4d47a4=_0x362857[_0x52a895(0x197)](),_0x2f2f7f=_0x2d34fb[_0x52a895(0x18b)](_0x561358=>_0x561358[_0x52a895(0x18e)]===_0x4d47a4);if(_0x2f2f7f)_0x55d820['push'](_0x2f2f7f);else _0x48f33f['push'](_0x362857);}return{'matched':_0x55d820,'unmatched':_0x48f33f};}export async function doCreateMenus(_0x4d45fe,_0x267b7d,_0x6b3ecc,_0x252c4e){const _0x18d70e=a60_0x5884;return await createMenus(_0x4d45fe,_0x267b7d,_0x6b3ecc,_0x252c4e),{'created':_0x6b3ecc[_0x18d70e(0x189)],'failed':0x0,'labels':_0x6b3ecc['map'](_0x32d181=>_0x32d181['label'])};}export function filterMenusWithResources(_0x384be5){const _0x30f0e8=a60_0x5884;return _0x384be5[_0x30f0e8(0x18f)](_0x13264a=>_0x13264a[_0x30f0e8(0x195)][_0x30f0e8(0x189)]>0x0);}export async function doUpdateCdnUrls(_0xa08a85,_0xc41740,_0x1b674a,_0x3fbee5){const _0x1062ed=a60_0x5884,_0x4d0259=_0x1b674a['filter'](_0x248ed9=>_0x248ed9[_0x1062ed(0x195)][_0x1062ed(0x189)]>0x0),_0x2ef1d2=await Promise[_0x1062ed(0x18c)](_0x4d0259[_0x1062ed(0x18d)](_0xef9171=>updateMenuCdnUrl(_0xa08a85,_0xc41740,{'id':_0xef9171['id'],'label':_0xef9171[_0x1062ed(0x18e)],'path':_0xef9171[_0x1062ed(0x192)],'resources':_0x3fbee5}))),_0xee9773=_0x2ef1d2[_0x1062ed(0x18f)](_0x317a27=>_0x317a27[_0x1062ed(0x193)]===_0x1062ed(0x19b))['length'];return{'updated':_0x4d0259[_0x1062ed(0x189)]-_0xee9773,'failed':_0xee9773};}export async function fetchMenuData(_0x2f88a6,_0x3450d0){const _0x15b6e1=a60_0x5884,_0x14d758=getLocalPages(),_0x93a494=await getOnlineMenuList(_0x2f88a6,_0x3450d0),_0x3e6028=new Set(_0x93a494[_0x15b6e1(0x18d)](_0x883789=>_0x883789['path']));return{'localPages':_0x14d758,'onlineMenuList':_0x93a494,'onlinePaths':_0x3e6028};}export async function fetchOnlineMenuList(_0x50210e,_0x4055b2){return getOnlineMenuList(_0x50210e,_0x4055b2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a61_0x7be9(_0x2f6a1d,_0x1ee7b0){_0x2f6a1d=_0x2f6a1d-0x1c9;const _0x3797f7=a61_0x3797();let _0x7be996=_0x3797f7[_0x2f6a1d];return _0x7be996;}(function(_0x50456c,_0xdedc55){const _0x1c856d=a61_0x7be9,_0x48504e=_0x50456c();while(!![]){try{const _0x2f507b=-parseInt(_0x1c856d(0x1c9))/0x1+-parseInt(_0x1c856d(0x1e8))/0x2*(parseInt(_0x1c856d(0x1f2))/0x3)+parseInt(_0x1c856d(0x1fb))/0x4+parseInt(_0x1c856d(0x1ee))/0x5+parseInt(_0x1c856d(0x1ce))/0x6+parseInt(_0x1c856d(0x1fc))/0x7*(parseInt(_0x1c856d(0x1db))/0x8)+-parseInt(_0x1c856d(0x1de))/0x9*(-parseInt(_0x1c856d(0x1df))/0xa);if(_0x2f507b===_0xdedc55)break;else _0x48504e['push'](_0x48504e['shift']());}catch(_0x49cff9){_0x48504e['push'](_0x48504e['shift']());}}}(a61_0x3797,0x5fd3f));import{getApiDomain}from'../../../constant/domain.js';import{getEnv}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';export async function getOnlineMenuList(_0x2e0c12,_0x529981){const _0x164798=a61_0x7be9,_0x468ea4=getEnv();logger[_0x164798(0x1e0)](_0x164798(0x1cb),_0x468ea4===_0x164798(0x1f8)?_0x164798(0x1ef)+_0x2e0c12+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x2e0c12+')');const _0x524ad9=await fetch(getApiDomain()+_0x164798(0x1ec)+_0x2e0c12,{'method':'GET','headers':{'Content-Type':_0x164798(0x1eb),'Cookie':_0x529981}});if(!_0x524ad9['ok']){if(_0x524ad9[_0x164798(0x1e4)]===0x191){const _0x473978=_0x164798(0x1d3);logger[_0x164798(0x1f5)](_0x164798(0x1cb),_0x473978,{'status':_0x524ad9[_0x164798(0x1e4)]});throw new Error(_0x473978);}const _0x3704b3=_0x164798(0x1d2)+_0x524ad9['status'];logger[_0x164798(0x1f5)](_0x164798(0x1cb),_0x3704b3);throw new Error(_0x3704b3);}const _0x1dffbd=await _0x524ad9[_0x164798(0x1dd)]();if(!_0x1dffbd[_0x164798(0x1e3)]){const _0x2f5ec2='Failed\x20to\x20fetch\x20menu\x20list:\x20'+(_0x1dffbd[_0x164798(0x1f3)]||_0x164798(0x1d5));logger[_0x164798(0x1f5)](_0x164798(0x1cb),_0x2f5ec2,{'errorCode':_0x1dffbd[_0x164798(0x1cc)],'errorMsg':_0x1dffbd[_0x164798(0x1f3)]});throw new Error(_0x2f5ec2);}if(!_0x1dffbd[_0x164798(0x1d1)])return logger['info'](_0x164798(0x1cb),_0x164798(0x1cf)),[];return logger[_0x164798(0x1e0)](_0x164798(0x1cb),_0x164798(0x1f0)+_0x1dffbd[_0x164798(0x1d1)][_0x164798(0x1ed)]+'\x20online\x20menus\x20successfully'),_0x1dffbd['data'][_0x164798(0x1d8)](flattenMenuItem)['flat']();}function flattenMenuItem(_0x45c7ad){const _0x3241eb=a61_0x7be9;let _0x445b9b=[];try{if(_0x45c7ad[_0x3241eb(0x1ea)]?.[_0x3241eb(0x1f4)]){const _0xb6c8c9=JSON[_0x3241eb(0x1e2)](_0x45c7ad[_0x3241eb(0x1ea)]['resources']);Array['isArray'](_0xb6c8c9)&&(_0x445b9b=_0xb6c8c9);}}catch(_0x2d806c){}const _0x3b36a5=[{'id':_0x45c7ad['id'],'path':_0x45c7ad[_0x3241eb(0x1f6)],'label':_0x45c7ad[_0x3241eb(0x1dc)],'resources':_0x445b9b}];if(_0x45c7ad[_0x3241eb(0x1da)]&&_0x45c7ad[_0x3241eb(0x1da)][_0x3241eb(0x1ed)]>0x0)for(const _0x5d0884 of _0x45c7ad[_0x3241eb(0x1da)]){_0x3b36a5[_0x3241eb(0x1e9)](...flattenMenuItem(_0x5d0884));}return _0x3b36a5;}export async function createMenu(_0x4675ca,_0x442a65,_0x1e7449){const _0x211690=a61_0x7be9;logger[_0x211690(0x1e0)](_0x211690(0x1f1),_0x211690(0x1ca)+_0x1e7449[_0x211690(0x1dc)]+'\x20('+_0x1e7449[_0x211690(0x1f6)]+')');const _0x248579={'appCode':_0x4675ca,'type':_0x211690(0x1f7),'sort':0x0,'extend':{'loadScriptMode':_0x211690(0x1e6),'resources':_0x1e7449[_0x211690(0x1f4)]?JSON[_0x211690(0x200)](_0x1e7449[_0x211690(0x1f4)]):undefined},..._0x1e7449},_0x4494fd=await fetch(getApiDomain()+_0x211690(0x1f9),{'method':_0x211690(0x1e1),'body':JSON[_0x211690(0x200)](_0x248579),'headers':{'Content-Type':_0x211690(0x1eb),'Cookie':_0x442a65}});if(!_0x4494fd['ok']){if(_0x4494fd[_0x211690(0x1e4)]===0x191){const _0x26b45f=_0x211690(0x1d3);logger[_0x211690(0x1f5)](_0x211690(0x1f1),_0x26b45f,{'status':_0x4494fd[_0x211690(0x1e4)],'menu':_0x1e7449[_0x211690(0x1dc)]});throw new Error(_0x26b45f);}const _0x40e216=_0x211690(0x1fa)+_0x4494fd[_0x211690(0x1e4)];logger[_0x211690(0x1f5)](_0x211690(0x1f1),_0x40e216,{'menu':_0x1e7449[_0x211690(0x1dc)]});throw new Error(_0x40e216);}const _0x17d61d=await _0x4494fd[_0x211690(0x1dd)]();if(!_0x17d61d[_0x211690(0x1e3)]){const _0x33dcb2='Failed\x20to\x20create\x20menu:\x20'+(_0x17d61d[_0x211690(0x1f3)]||'Error');logger[_0x211690(0x1f5)]('create-menu',_0x33dcb2,{'errorCode':_0x17d61d['errorCode'],'errorMsg':_0x17d61d[_0x211690(0x1f3)],'menu':_0x1e7449[_0x211690(0x1dc)]});throw new Error(_0x33dcb2);}logger[_0x211690(0x1e0)](_0x211690(0x1f1),_0x211690(0x1d6)+_0x1e7449[_0x211690(0x1dc)],_0x17d61d['data']);}async function createSingleMenu(_0x4c4b85,_0xb77dd2,_0x30ac70,_0x5d3d57){const _0x33684e=a61_0x7be9,_0x18e021={'appCode':_0x4c4b85,'type':'procode','sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x5d3d57?JSON[_0x33684e(0x200)](_0x5d3d57):undefined},'label':_0x30ac70[_0x33684e(0x1dc)],'path':_0x30ac70[_0x33684e(0x1f6)]},_0x3e990e=await fetch(getApiDomain()+_0x33684e(0x1f9),{'method':'POST','body':JSON['stringify'](_0x18e021),'headers':{'Content-Type':'application/json','Cookie':_0xb77dd2}});if(!_0x3e990e['ok']){if(_0x3e990e[_0x33684e(0x1e4)]===0x191){const _0x5afe07='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger['error'](_0x33684e(0x1f1),_0x5afe07,{'status':_0x3e990e[_0x33684e(0x1e4)],'menu':_0x30ac70[_0x33684e(0x1dc)]});throw new Error(_0x5afe07);}const _0x48cf80=_0x33684e(0x1fa)+_0x3e990e['status'];logger[_0x33684e(0x1f5)](_0x33684e(0x1f1),_0x48cf80,{'menu':_0x30ac70[_0x33684e(0x1dc)]});throw new Error(_0x48cf80);}const _0x51b797=await _0x3e990e[_0x33684e(0x1dd)]();if(!_0x51b797[_0x33684e(0x1e3)]){if(_0x51b797[_0x33684e(0x1cc)]===_0x33684e(0x1fe)||_0x51b797[_0x33684e(0x1f3)]?.['includes']('登录')){const _0x729cbf='Auth\x20validation\x20failed.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x33684e(0x1f5)]('create-menu',_0x729cbf,{'errorCode':_0x51b797[_0x33684e(0x1cc)],'errorMsg':_0x51b797[_0x33684e(0x1f3)],'menu':_0x30ac70[_0x33684e(0x1dc)]});throw new Error(_0x729cbf);}const _0x43d9b5=_0x33684e(0x1cd)+(_0x51b797[_0x33684e(0x1f3)]||'Error');logger['error']('create-menu',_0x43d9b5,{'errorCode':_0x51b797['errorCode'],'errorMsg':_0x51b797[_0x33684e(0x1f3)],'menu':_0x30ac70[_0x33684e(0x1dc)]});throw new Error(_0x43d9b5);}logger['info'](_0x33684e(0x1f1),_0x33684e(0x1d6)+_0x30ac70[_0x33684e(0x1dc)]);}function a61_0x3797(){const _0x1b93fe=['Failed\x20to\x20create\x20menu,\x20HTTP\x20status:\x20','262992hNUnWF','69181OTxWUv','Updating\x20menu\x20asset\x20links:\x20','0011','update-menu-cdn-url','stringify','724022MnsDmF','Creating\x20menu:\x20','get-online-menu-list','errorCode','Failed\x20to\x20create\x20menu:\x20','97890hJpzba','Server\x20returned\x20empty\x20menu\x20list','Menu\x20assets\x20synced:\x20','data','Failed\x20to\x20fetch\x20menu\x20list,\x20HTTP\x20status:\x20','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','Start\x20batch\x20menu\x20creation,\x20total\x20','Error','Menu\x20created\x20successfully:\x20','Failed\x20to\x20update\x20menu\x20assets:\x20','map','/smartapi/menu/update','children','40wlbhda','label','json','368181DpruhV','260kyrEck','info','POST','parse','success','status','all','import','create-menus','4yNPHJT','push','extend','application/json','/smartapi/menu/find?appCode=','length','1360245FermuW','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Fetched\x20','create-menu','525942LKqMPN','errorMsg','resources','error','path','procode','online','/smartapi/menu/create'];a61_0x3797=function(){return _0x1b93fe;};return a61_0x3797();}export async function createMenus(_0xddc4af,_0x2b2bdc,_0x4c58e1,_0x5455ae){const _0x14d00d=a61_0x7be9;logger[_0x14d00d(0x1e0)](_0x14d00d(0x1e7),_0x14d00d(0x1d4)+_0x4c58e1[_0x14d00d(0x1ed)]),await Promise[_0x14d00d(0x1e5)](_0x4c58e1['map'](async _0x535997=>{await createSingleMenu(_0xddc4af,_0x2b2bdc,_0x535997,_0x5455ae);})),logger[_0x14d00d(0x1e0)](_0x14d00d(0x1e7),'Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x4c58e1[_0x14d00d(0x1ed)]);}export async function updateMenuCdnUrl(_0x439fb6,_0x4a5dc3,_0x244917){const _0x3d4cf4=a61_0x7be9;logger[_0x3d4cf4(0x1e0)](_0x3d4cf4(0x1ff),_0x3d4cf4(0x1fd)+_0x244917[_0x3d4cf4(0x1dc)]+'\x20('+_0x244917['path']+')');const _0x1b339c={'id':_0x244917['id'],'appCode':_0x439fb6,'extend':{'loadScriptMode':'import','resources':_0x244917[_0x3d4cf4(0x1f4)]?JSON[_0x3d4cf4(0x200)](_0x244917[_0x3d4cf4(0x1f4)]):undefined}},_0xffd27a=await fetch(getApiDomain()+_0x3d4cf4(0x1d9),{'method':_0x3d4cf4(0x1e1),'body':JSON[_0x3d4cf4(0x200)](_0x1b339c),'headers':{'Content-Type':'application/json','Cookie':_0x4a5dc3}});if(!_0xffd27a['ok']){if(_0xffd27a[_0x3d4cf4(0x1e4)]===0x191){const _0x4beacb=_0x3d4cf4(0x1d3);logger[_0x3d4cf4(0x1f5)](_0x3d4cf4(0x1ff),_0x4beacb,{'status':_0xffd27a[_0x3d4cf4(0x1e4)],'menu':_0x244917[_0x3d4cf4(0x1dc)]});throw new Error(_0x4beacb);}const _0x5ac690=_0x3d4cf4(0x1d7)+_0xffd27a['status'];logger[_0x3d4cf4(0x1f5)](_0x3d4cf4(0x1ff),_0x5ac690,{'menu':_0x244917['label']});throw new Error(_0x5ac690);}const _0x3d56bd=await _0xffd27a[_0x3d4cf4(0x1dd)]();if(!_0x3d56bd[_0x3d4cf4(0x1e3)]){const _0x3bb225=_0x3d4cf4(0x1d7)+(_0x3d56bd['errorMsg']||'Error');logger['error']('update-menu-cdn-url',_0x3bb225,{'errorCode':_0x3d56bd[_0x3d4cf4(0x1cc)],'errorMsg':_0x3d56bd[_0x3d4cf4(0x1f3)],'menu':_0x244917[_0x3d4cf4(0x1dc)]});throw new Error(_0x3bb225);}logger[_0x3d4cf4(0x1e0)]('update-menu-cdn-url',_0x3d4cf4(0x1d0)+_0x244917[_0x3d4cf4(0x1dc)],_0x3d56bd['data']);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7c3bee,_0x568cd4){const _0x2e39ba=a62_0x3c36,_0x53000f=_0x7c3bee();while(!![]){try{const _0x42aa10=parseInt(_0x2e39ba(0xcf))/0x1*(parseInt(_0x2e39ba(0xd6))/0x2)+-parseInt(_0x2e39ba(0xbc))/0x3+parseInt(_0x2e39ba(0xc2))/0x4+-parseInt(_0x2e39ba(0xb2))/0x5*(parseInt(_0x2e39ba(0xd2))/0x6)+-parseInt(_0x2e39ba(0xbf))/0x7*(-parseInt(_0x2e39ba(0xbe))/0x8)+-parseInt(_0x2e39ba(0xd4))/0x9*(parseInt(_0x2e39ba(0xb0))/0xa)+parseInt(_0x2e39ba(0xd0))/0xb;if(_0x42aa10===_0x568cd4)break;else _0x53000f['push'](_0x53000f['shift']());}catch(_0x116928){_0x53000f['push'](_0x53000f['shift']());}}}(a62_0x2c86,0xc6705));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus}from'./service.js';function a62_0x3c36(_0x57e92a,_0x213428){_0x57e92a=_0x57e92a-0xa6;const _0x2c86a3=a62_0x2c86();let _0x3c3626=_0x2c86a3[_0x57e92a];return _0x3c3626;}function a62_0x2c86(){const _0x482c9b=['jsUrl','split','selectedLabels','\x0a\x20\x20Available\x20local\x20pages:\x20','pages','string','label','menu-sync','field','4436409QikzVa','message','47480RHwjAb','273hRhnCB','setLogPath','length','3957508WWYfDU','filter','path','map','push','Start\x20non-interactive\x20menu\x20sync','join','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','cwd','CSS\x20URL\x20is\x20unreachable:\x20','has','JS\x20URL\x20is\x20unreachable:\x20','data','1RolfgN','13690853Bslyop','Menu\x20sync\x20completed','996396WbIyaw','No\x20local\x20pages\x20matched\x20labels:\x20','36COvWsO','toString','1207478bCPAcj','end','stdin','isTTY','Invalid\x20--params:\x20','trim','cssUrl','info','startsWith','concat','isArray','283330MOECNw','parse','20XqFJBF'];a62_0x2c86=function(){return _0x482c9b;};return a62_0x2c86();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x1125c4){const _0x1b6d88=a62_0x3c36,_0x394c19=[];return _0x1125c4[_0x1b6d88(0xb3)]&&!isValidJsHttpsUrl(_0x1125c4[_0x1b6d88(0xb3)])&&_0x394c19[_0x1b6d88(0xc6)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x1125c4[_0x1b6d88(0xab)]&&!isValidCssHttpsUrl(_0x1125c4[_0x1b6d88(0xab)])&&_0x394c19[_0x1b6d88(0xc6)]({'field':'cssUrl','message':_0x1b6d88(0xc9)}),_0x394c19;}export async function runMenuSyncCore(_0x322f0d,_0x37c99f,_0x1933ac=[],_0x573998){const _0x57904d=a62_0x3c36,_0x2566c1=parseParamsFlag(_0x573998),_0xad5b6e=_0x1933ac[_0x57904d(0xc1)]>0x0?_0x1933ac:_0x2566c1[_0x57904d(0xb5)],_0x21cdcb=_0x2566c1[_0x57904d(0xb3)],_0xf28723=_0x2566c1[_0x57904d(0xab)],_0x2aa4da=[];if(_0x21cdcb)_0x2aa4da[_0x57904d(0xc6)](_0x21cdcb);if(_0xf28723)_0x2aa4da[_0x57904d(0xc6)](_0xf28723);const _0x4f4223=validateParams(_0x2566c1);if(_0x4f4223[_0x57904d(0xc1)]>0x0){const _0x36ea26=_0x4f4223['map'](_0x363625=>'--params.'+_0x363625[_0x57904d(0xbb)]+':\x20'+_0x363625[_0x57904d(0xbd)])[_0x57904d(0xc8)](';\x20');throw new Error(_0x57904d(0xa9)+_0x36ea26);}logger[_0x57904d(0xc0)](process[_0x57904d(0xca)]()),logger[_0x57904d(0xac)](_0x57904d(0xba),_0x57904d(0xc7),{'appCode':_0x322f0d,'selectedCount':_0xad5b6e?.['length'],'jsUrl':_0x21cdcb,'cssUrl':_0xf28723});if(_0x21cdcb){const _0x47e56d=await isUrlReachable(_0x21cdcb);if(!_0x47e56d)throw new Error(_0x57904d(0xcd)+_0x21cdcb);}if(_0xf28723){const _0xd28100=await isUrlReachable(_0xf28723);if(!_0xd28100)throw new Error(_0x57904d(0xcb)+_0xf28723);}const _0x2599b9=getLocalPages();if(_0x2599b9['length']===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x5c270c=await getOnlineMenuList(_0x322f0d,_0x37c99f),_0x5b1059=new Set(_0x5c270c[_0x57904d(0xc5)](_0x242f79=>_0x242f79[_0x57904d(0xc4)]));let _0x541602;if(_0xad5b6e&&_0xad5b6e[_0x57904d(0xc1)]>0x0){const _0x26043a=new Set(_0xad5b6e[_0x57904d(0xc5)](_0x1f4d8e=>_0x1f4d8e['trim']()));_0x541602=_0x2599b9['filter'](_0x128a16=>_0x26043a['has'](_0x128a16[_0x57904d(0xb9)]));if(_0x541602[_0x57904d(0xc1)]===0x0){const _0xf88805=_0x2599b9[_0x57904d(0xc5)](_0x3aa350=>_0x3aa350['label'])[_0x57904d(0xc8)](',\x20');throw new Error(_0x57904d(0xd3)+[..._0x26043a][_0x57904d(0xc8)](',\x20')+_0x57904d(0xb6)+_0xf88805);}}else _0x541602=_0x2599b9[_0x57904d(0xc3)](_0x640583=>!_0x5b1059[_0x57904d(0xcc)](_0x640583[_0x57904d(0xc4)]));if(_0x541602[_0x57904d(0xc1)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x322f0d,_0x37c99f,_0x541602,_0x2aa4da[_0x57904d(0xc1)]>0x0?_0x2aa4da:undefined),logger['info'](_0x57904d(0xba),_0x57904d(0xd1),{'count':_0x541602[_0x57904d(0xc1)],'resources':_0x2aa4da}),{'created':_0x541602[_0x57904d(0xc1)],'skipped':![],'targetPages':_0x541602};}export async function readPageLabelsFromStdin(){const _0x3b851b=a62_0x3c36;if(!process[_0x3b851b(0xa7)][_0x3b851b(0xa8)]&&!process[_0x3b851b(0xa7)]['readableEnded'])return new Promise(_0x16202c=>{const _0x1569a2=_0x3b851b,_0x4f6722=[];process[_0x1569a2(0xa7)]['on'](_0x1569a2(0xce),_0x3668a8=>_0x4f6722[_0x1569a2(0xc6)](_0x3668a8)),process['stdin']['on'](_0x1569a2(0xa6),()=>{const _0xbee4a7=_0x1569a2,_0x3b024b=Buffer[_0xbee4a7(0xae)](_0x4f6722)[_0xbee4a7(0xd5)]('utf8'),_0x72928d=_0x3b024b[_0xbee4a7(0xb4)]('\x0a')['map'](_0x1996ac=>_0x1996ac[_0xbee4a7(0xaa)]())[_0xbee4a7(0xc3)](_0x2a393a=>_0x2a393a[_0xbee4a7(0xc1)]>0x0&&!_0x2a393a[_0xbee4a7(0xad)]('#'));_0x16202c(_0x72928d);}),setTimeout(()=>_0x16202c([]),0x1f4);});return[];}function parseParamsFlag(_0x2501c4){const _0x2d917e=a62_0x3c36;if(!_0x2501c4||typeof _0x2501c4!==_0x2d917e(0xb8))return{};try{const _0x2f1867=JSON[_0x2d917e(0xb1)](_0x2501c4);if(typeof _0x2f1867!=='object'||_0x2f1867===null||Array[_0x2d917e(0xaf)](_0x2f1867))return{};return{'selectedLabels':Array[_0x2d917e(0xaf)](_0x2f1867[_0x2d917e(0xb7)])?_0x2f1867[_0x2d917e(0xb7)][_0x2d917e(0xc5)](String):undefined,'jsUrl':typeof _0x2f1867['jsUrl']===_0x2d917e(0xb8)?_0x2f1867[_0x2d917e(0xb3)]['trim']():undefined,'cssUrl':typeof _0x2f1867[_0x2d917e(0xab)]==='string'?_0x2f1867['cssUrl'][_0x2d917e(0xaa)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3fcc04,_0x391d3a){const _0x396683=a64_0xf2a0,_0x1d6d84=_0x3fcc04();while(!![]){try{const _0x2fae1f=-parseInt(_0x396683(0x1dc))/0x1+parseInt(_0x396683(0x1e0))/0x2*(-parseInt(_0x396683(0x1d5))/0x3)+-parseInt(_0x396683(0x1c7))/0x4*(parseInt(_0x396683(0x1e2))/0x5)+-parseInt(_0x396683(0x1cf))/0x6+-parseInt(_0x396683(0x1d1))/0x7+-parseInt(_0x396683(0x1e3))/0x8+parseInt(_0x396683(0x1d8))/0x9;if(_0x2fae1f===_0x391d3a)break;else _0x1d6d84['push'](_0x1d6d84['shift']());}catch(_0x16697c){_0x1d6d84['push'](_0x1d6d84['shift']());}}}(a64_0x1c2d,0xf0bcb));import{updateMenuCdnUrl,getOnlineMenuList}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a64_0xf2a0(_0x549726,_0xcb4934){_0x549726=_0x549726-0x1c5;const _0x1c2d29=a64_0x1c2d();let _0xf2a04d=_0x1c2d29[_0x549726];return _0xf2a04d;}import{logger}from'../../../utils/logger.js';function validateParams(_0x678800){const _0x111ec0=a64_0xf2a0,_0x3b4756=[];return _0x678800[_0x111ec0(0x1d7)]&&!isValidJsHttpsUrl(_0x678800['jsUrl'])&&_0x3b4756[_0x111ec0(0x1e6)]({'field':_0x111ec0(0x1d7),'message':_0x111ec0(0x1c9)}),_0x678800['cssUrl']&&!isValidCssHttpsUrl(_0x678800[_0x111ec0(0x1cd)])&&_0x3b4756['push']({'field':_0x111ec0(0x1cd),'message':_0x111ec0(0x1e5)}),_0x3b4756;}export async function runMenuUpdateCore(_0x929495,_0x3d82bf,_0x1dfc49){const _0x52f587=a64_0xf2a0,_0x2d8fe4=parseUpdateParamsFlag(_0x1dfc49),_0x4216e5=[];if(_0x2d8fe4['jsUrl'])_0x4216e5[_0x52f587(0x1e6)](_0x2d8fe4['jsUrl']);if(_0x2d8fe4[_0x52f587(0x1cd)])_0x4216e5['push'](_0x2d8fe4[_0x52f587(0x1cd)]);const _0x25ebc3=validateParams(_0x2d8fe4);if(_0x25ebc3['length']>0x0){const _0x464b6d=_0x25ebc3[_0x52f587(0x1d2)](_0x3b26d8=>'--params.'+_0x3b26d8['field']+':\x20'+_0x3b26d8['message'])[_0x52f587(0x1df)](';\x20');throw new Error(_0x52f587(0x1d4)+_0x464b6d);}logger['setLogPath'](process[_0x52f587(0x1d6)]()),logger[_0x52f587(0x1e1)](_0x52f587(0x1ca),_0x52f587(0x1ce),{'appCode':_0x929495,'jsUrl':_0x2d8fe4['jsUrl'],'cssUrl':_0x2d8fe4[_0x52f587(0x1cd)]});if(_0x2d8fe4[_0x52f587(0x1d7)]){const _0x542bf2=await isUrlReachable(_0x2d8fe4[_0x52f587(0x1d7)]);if(!_0x542bf2)throw new Error(_0x52f587(0x1d0)+_0x2d8fe4[_0x52f587(0x1d7)]);}if(_0x2d8fe4[_0x52f587(0x1cd)]){const _0xcc922a=await isUrlReachable(_0x2d8fe4[_0x52f587(0x1cd)]);if(!_0xcc922a)throw new Error(_0x52f587(0x1dd)+_0x2d8fe4['cssUrl']);}const _0x401772=await getOnlineMenuList(_0x929495,_0x3d82bf),_0x2e97fc=_0x401772[_0x52f587(0x1d9)](_0x464ae3=>_0x464ae3[_0x52f587(0x1da)][_0x52f587(0x1e7)]>0x0);if(_0x2e97fc[_0x52f587(0x1e7)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x3fe340=await Promise[_0x52f587(0x1c6)](_0x2e97fc[_0x52f587(0x1d2)](_0x5ab178=>updateMenuCdnUrl(_0x929495,_0x3d82bf,{'id':_0x5ab178['id'],'label':_0x5ab178[_0x52f587(0x1c5)],'path':_0x5ab178['path'],'resources':_0x4216e5}))),_0x462037=_0x3fe340[_0x52f587(0x1d9)](_0x5741d8=>_0x5741d8[_0x52f587(0x1e4)]===_0x52f587(0x1db))[_0x52f587(0x1e7)];return logger[_0x52f587(0x1e1)](_0x52f587(0x1ca),_0x52f587(0x1d3),{'count':_0x2e97fc[_0x52f587(0x1e7)],'resources':_0x4216e5}),{'updated':_0x2e97fc[_0x52f587(0x1e7)]-_0x462037,'failed':_0x462037,'skipped':![]};}function a64_0x1c2d(){const _0x1fa043=['1650682VOjSTw','CSS\x20URL\x20is\x20unreachable:\x20','trim','join','1216522TvAmTr','info','3533750ewpGoS','2086352qVvrOU','status','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','push','length','label','allSettled','4ZBQxoC','string','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','menu-update','isArray','object','cssUrl','Start\x20non-interactive\x20menu\x20update','8606118ZuooeX','JS\x20URL\x20is\x20unreachable:\x20','10457286sFjZek','map','Menu\x20update\x20completed','Invalid\x20--params:\x20','3McUMWn','cwd','jsUrl','64267173gfvoYK','filter','resources','rejected'];a64_0x1c2d=function(){return _0x1fa043;};return a64_0x1c2d();}function parseUpdateParamsFlag(_0x4a4581){const _0x31c367=a64_0xf2a0;if(!_0x4a4581||typeof _0x4a4581!==_0x31c367(0x1c8))return{};try{const _0x49f287=JSON['parse'](_0x4a4581);if(typeof _0x49f287!==_0x31c367(0x1cc)||_0x49f287===null||Array[_0x31c367(0x1cb)](_0x49f287))return{};return{'jsUrl':typeof _0x49f287['jsUrl']==='string'?_0x49f287[_0x31c367(0x1d7)]['trim']():undefined,'cssUrl':typeof _0x49f287[_0x31c367(0x1cd)]===_0x31c367(0x1c8)?_0x49f287[_0x31c367(0x1cd)][_0x31c367(0x1de)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a65_0x187b(_0x3a2428,_0x48f277){_0x3a2428=_0x3a2428-0x8f;const _0x1f8141=a65_0x1f81();let _0x187bdd=_0x1f8141[_0x3a2428];return _0x187bdd;}(function(_0x24b738,_0x57d240){const _0x2054ab=a65_0x187b,_0x37d2bc=_0x24b738();while(!![]){try{const _0x3d9625=parseInt(_0x2054ab(0x96))/0x1*(parseInt(_0x2054ab(0x93))/0x2)+-parseInt(_0x2054ab(0x99))/0x3+parseInt(_0x2054ab(0x9b))/0x4+-parseInt(_0x2054ab(0x91))/0x5+parseInt(_0x2054ab(0x92))/0x6*(-parseInt(_0x2054ab(0x8f))/0x7)+-parseInt(_0x2054ab(0x9a))/0x8+-parseInt(_0x2054ab(0x98))/0x9*(-parseInt(_0x2054ab(0x95))/0xa);if(_0x3d9625===_0x57d240)break;else _0x37d2bc['push'](_0x37d2bc['shift']());}catch(_0x55be66){_0x37d2bc['push'](_0x37d2bc['shift']());}}}(a65_0x1f81,0x32e8c));export function isValidJsHttpsUrl(_0x1dcbfe){const _0x326fec=a65_0x187b;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x1dcbfe[_0x326fec(0x94)]());}function a65_0x1f81(){const _0x23c025=['test','266615Cfmzds','6vVcKdi','6866Ogqgqi','trim','840590TGnXXs','67sYqqTS','HEAD','18hjuxBx','428250sxGEDj','377864JwtnIH','939692ZQXzPS','1268554mJCNag'];a65_0x1f81=function(){return _0x23c025;};return a65_0x1f81();}export function isValidCssHttpsUrl(_0x6859b9){const _0x41c780=a65_0x187b;return/^https:\/\/.+\.css(\?.*)?$/[_0x41c780(0x90)](_0x6859b9[_0x41c780(0x94)]());}export async function isUrlReachable(_0x54bba8){const _0x342360=a65_0x187b;try{const _0x3f8bb9=await fetch(_0x54bba8,{'method':_0x342360(0x97)});return _0x3f8bb9['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x5a6d7b=a66_0x55a1;(function(_0x45b462,_0x2f98c3){const _0x4b0594=a66_0x55a1,_0x5cd295=_0x45b462();while(!![]){try{const _0x3f20c3=-parseInt(_0x4b0594(0x121))/0x1*(-parseInt(_0x4b0594(0x13d))/0x2)+-parseInt(_0x4b0594(0x115))/0x3*(parseInt(_0x4b0594(0x12a))/0x4)+-parseInt(_0x4b0594(0x135))/0x5+-parseInt(_0x4b0594(0x138))/0x6*(parseInt(_0x4b0594(0x12b))/0x7)+parseInt(_0x4b0594(0x133))/0x8*(-parseInt(_0x4b0594(0x136))/0x9)+-parseInt(_0x4b0594(0x147))/0xa+parseInt(_0x4b0594(0x124))/0xb*(parseInt(_0x4b0594(0x111))/0xc);if(_0x3f20c3===_0x2f98c3)break;else _0x5cd295['push'](_0x5cd295['shift']());}catch(_0x31039c){_0x5cd295['push'](_0x5cd295['shift']());}}}(a66_0x37e7,0xddfe5));import a66_0x2bcca4 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'./shared/logic.js';function a66_0x55a1(_0x1b6692,_0x56c40b){_0x1b6692=_0x1b6692-0x10e;const _0x37e7ff=a66_0x37e7();let _0x55a107=_0x37e7ff[_0x1b6692];return _0x55a107;}import{renderCompareTable,renderSyncSummary}from'./shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';import{CliErrors}from'../../errors.js';import{runMenuSyncCore,readPageLabelsFromStdin}from'./shared/sync-core.js';import{getLocalPages}from'./shared/local-pages.js';function a66_0x37e7(){const _0x38278a=['397720WEoGAX','created','parse','cssUrl','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','✓\x20Menu\x20sync\x20completed:\x20','\x20menu(s)','1812NITPMG','skipped','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','object','9AvfKIE','length','trim','Failed\x20to\x20fetch\x20online\x20menu\x20list','message','gray','\x20menu(s)\x20created','\x20\x20Cancelled.','size','cookie','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','map','103otWWiG','jsUrl','yellow','129371sCCSDz','validation','Created\x20','\x20menu(s)...','pages','onlineMenuList','489196TyXxON','112EXZWYT','failed','\x20page(s)','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','isArray','\x20and\x20CSS:\x20','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','15832wvmwtK','\x20failed.','382465nhcSCM','1431dFGllz','onlinePaths','175782RlaDkp','yes','log','Creating\x20','Online\x20menu\x20list\x20fetched','7766nwtKqi','string','write','localPages','params','\x20\x20✓\x20Selected:\x20','Menu\x20creation\x20failed','\x20\x20Create\x20','Menu\x20sync\x20completed:\x20','appCode'];a66_0x37e7=function(){return _0x38278a;};return a66_0x37e7();}export const menuSync={'service':'menu','command':'sync','description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':a66_0x5a6d7b(0x13f),'flags':[{'name':a66_0x5a6d7b(0x141),'type':a66_0x5a6d7b(0x13e),'description':a66_0x5a6d7b(0x132)+a66_0x5a6d7b(0x12e)},{'name':'yes','type':'boolean','description':a66_0x5a6d7b(0x11f)}],async 'execute'(_0x1043df){const _0x3625f4=a66_0x5a6d7b,_0x1ca98d=_0x1043df['flag'](_0x3625f4(0x139)),_0x335c0d=_0x1043df['str'](_0x3625f4(0x141)),_0x135304=parseParams(_0x335c0d),_0x3f15d4=!!(_0x135304[_0x3625f4(0x122)]||_0x135304[_0x3625f4(0x14a)]||_0x135304[_0x3625f4(0x128)]&&_0x135304[_0x3625f4(0x128)][_0x3625f4(0x116)]>0x0);if(_0x1ca98d||_0x3f15d4){let _0x401096=[];!isInteractive()&&!_0x135304[_0x3625f4(0x128)]?.['length']&&(_0x401096=await readPageLabelsFromStdin());const _0x374e72=await runMenuSyncCore(_0x1043df[_0x3625f4(0x146)],_0x1043df[_0x3625f4(0x11e)],_0x401096[_0x3625f4(0x116)]>0x0?_0x401096:_0x135304[_0x3625f4(0x128)]??[],_0x335c0d);if(_0x374e72[_0x3625f4(0x112)]){const _0x2de8a=getLocalPages();_0x2de8a[_0x3625f4(0x116)]===0x0?console['log'](_0x3625f4(0x131)):console[_0x3625f4(0x13a)](_0x3625f4(0x10e));}else console[_0x3625f4(0x13a)](_0x3625f4(0x10f)+_0x374e72[_0x3625f4(0x148)]+_0x3625f4(0x11b));return{'ok':!![]};}requireInteractive();const _0x3eb705=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x4f33de,_0x46bab9,_0x4cc4b7;try{const _0x1497b5=await fetchMenuData(_0x1043df[_0x3625f4(0x146)],_0x1043df[_0x3625f4(0x11e)]);_0x4f33de=_0x1497b5[_0x3625f4(0x140)],_0x46bab9=_0x1497b5[_0x3625f4(0x137)],_0x4cc4b7=_0x1497b5[_0x3625f4(0x129)],stopSpinner(_0x3eb705,_0x3625f4(0x13c),!![]);}catch(_0x276823){stopSpinner(_0x3eb705,_0x3625f4(0x118),![]);throw CliErrors[_0x3625f4(0x125)](_0x276823 instanceof Error?_0x276823[_0x3625f4(0x119)]:_0x3625f4(0x118));}if(_0x4f33de[_0x3625f4(0x116)]===0x0)return console[_0x3625f4(0x13a)](a66_0x2bcca4[_0x3625f4(0x123)](_0x3625f4(0x113))),{'ok':!![]};const _0x53efcb=buildCompareRows(_0x4f33de,_0x46bab9);console[_0x3625f4(0x13a)](renderCompareTable(_0x53efcb)),console['log']();const _0x222d1b=_0x135304['pages'],_0x3aa00c=await selectPages(_0x4f33de,_0x46bab9,_0x222d1b);console[_0x3625f4(0x13a)](),console[_0x3625f4(0x13a)](a66_0x2bcca4['cyan'](_0x3625f4(0x142)+_0x3aa00c[_0x3625f4(0x116)]+_0x3625f4(0x12d)));const _0x592048=_0x135304['jsUrl']&&_0x135304[_0x3625f4(0x14a)];if(!_0x592048){console[_0x3625f4(0x13a)](renderSyncSummary(_0x3aa00c,_0x46bab9[_0x3625f4(0x11d)]>0x0));const _0x518f5e=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x518f5e)return console[_0x3625f4(0x13a)](a66_0x2bcca4[_0x3625f4(0x11a)](_0x3625f4(0x11c))),{'ok':!![]};}let _0x3741d4=_0x135304[_0x3625f4(0x122)],_0x5827c4=_0x135304[_0x3625f4(0x14a)];!_0x3741d4&&(_0x3741d4=await askJsUrl());!_0x5827c4&&(_0x5827c4=await askCssUrl());const _0x2233e1=await askConfirm(_0x3625f4(0x144)+_0x3aa00c['length']+'\x20menu(s)\x20with\x20JS:\x20'+_0x3741d4+_0x3625f4(0x130)+_0x5827c4+'?');if(!_0x2233e1)return console[_0x3625f4(0x13a)](a66_0x2bcca4[_0x3625f4(0x11a)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x30825c=[_0x3741d4,_0x5827c4],_0x2a36ac=startSpinner(_0x3625f4(0x13b)+_0x3aa00c[_0x3625f4(0x116)]+_0x3625f4(0x127));try{const _0x100e28=await doCreateMenus(_0x1043df[_0x3625f4(0x146)],_0x1043df['cookie'],_0x3aa00c,_0x30825c);return stopSpinner(_0x2a36ac,_0x3625f4(0x126)+_0x100e28[_0x3625f4(0x148)]+_0x3625f4(0x110),!![]),{'ok':!![],'data':_0x100e28,'message':_0x3625f4(0x145)+_0x100e28[_0x3625f4(0x148)]+'\x20created,\x20'+_0x100e28[_0x3625f4(0x12c)]+_0x3625f4(0x134)};}catch(_0x513b8e){stopSpinner(_0x2a36ac,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x3625f4(0x125)](_0x513b8e instanceof Error?_0x513b8e['message']:_0x3625f4(0x143));}}};function parseParams(_0x1f1388){const _0x4148de=a66_0x5a6d7b;if(!_0x1f1388)return{};try{const _0x1c6c8b=JSON[_0x4148de(0x149)](_0x1f1388);if(typeof _0x1c6c8b!==_0x4148de(0x114)||_0x1c6c8b===null||Array[_0x4148de(0x12f)](_0x1c6c8b))return{};return{'jsUrl':typeof _0x1c6c8b[_0x4148de(0x122)]===_0x4148de(0x13e)?_0x1c6c8b[_0x4148de(0x122)][_0x4148de(0x117)]():undefined,'cssUrl':typeof _0x1c6c8b[_0x4148de(0x14a)]===_0x4148de(0x13e)?_0x1c6c8b[_0x4148de(0x14a)][_0x4148de(0x117)]():undefined,'pages':Array['isArray'](_0x1c6c8b[_0x4148de(0x128)])?_0x1c6c8b[_0x4148de(0x128)][_0x4148de(0x120)](String):undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0xd7c74e=a67_0x244d;(function(_0x24bbe1,_0x2bda2a){const _0x137064=a67_0x244d,_0x24dd55=_0x24bbe1();while(!![]){try{const _0x331299=parseInt(_0x137064(0x1f1))/0x1+parseInt(_0x137064(0x20f))/0x2+parseInt(_0x137064(0x1eb))/0x3+-parseInt(_0x137064(0x1e5))/0x4+-parseInt(_0x137064(0x1f3))/0x5+parseInt(_0x137064(0x1ed))/0x6*(-parseInt(_0x137064(0x209))/0x7)+-parseInt(_0x137064(0x210))/0x8*(-parseInt(_0x137064(0x203))/0x9);if(_0x331299===_0x2bda2a)break;else _0x24dd55['push'](_0x24dd55['shift']());}catch(_0x466db0){_0x24dd55['push'](_0x24dd55['shift']());}}}(a67_0x4d82,0xe7c81));function a67_0x244d(_0x4aa64a,_0x26ce58){_0x4aa64a=_0x4aa64a-0x1df;const _0x4d8245=a67_0x4d82();let _0x244d9f=_0x4d8245[_0x4aa64a];return _0x244d9f;}import a67_0x2d89c6 from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'./shared/logic.js';import{renderUpdateSummary}from'./shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';import{CliErrors}from'../../errors.js';import{runMenuUpdateCore}from'./shared/update-core.js';export const menuUpdate={'service':'menu','command':a67_0xd7c74e(0x1e0),'description':a67_0xd7c74e(0x1ee),'risk':a67_0xd7c74e(0x1fc),'flags':[{'name':a67_0xd7c74e(0x20c),'type':'string','description':a67_0xd7c74e(0x1f7)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a67_0xd7c74e(0x214),'type':a67_0xd7c74e(0x20a),'description':a67_0xd7c74e(0x1f6)}],async 'execute'(_0x1e0a2b){const _0x473f6b=a67_0xd7c74e,_0x4b9e30=_0x1e0a2b[_0x473f6b(0x1ef)](_0x473f6b(0x214)),_0x43c9f4=_0x1e0a2b[_0x473f6b(0x204)]('params'),_0x56228d=parseParams(_0x43c9f4),_0x205d0e=!!(_0x56228d['jsUrl']||_0x56228d[_0x473f6b(0x1df)]);if(_0x4b9e30||_0x205d0e&&!isInteractive()){const _0x4b475f=await runMenuUpdateCore(_0x1e0a2b[_0x473f6b(0x1e8)],_0x1e0a2b['cookie'],_0x43c9f4);return _0x4b475f[_0x473f6b(0x1f9)]?console[_0x473f6b(0x1e2)]('!\x20No\x20menus\x20with\x20existing\x20resources\x20found'):(console[_0x473f6b(0x1e2)](_0x473f6b(0x205)+_0x4b475f['updated']+_0x473f6b(0x1fa)),_0x4b475f[_0x473f6b(0x207)]>0x0&&console[_0x473f6b(0x1fe)]('!\x20'+_0x4b475f[_0x473f6b(0x207)]+'\x20menu(s)\x20failed')),{'ok':_0x4b475f['failed']===0x0};}requireInteractive();const _0x328082=startSpinner(_0x473f6b(0x1f4));let _0x4f6ffa;try{_0x4f6ffa=await fetchOnlineMenuList(_0x1e0a2b[_0x473f6b(0x1e8)],_0x1e0a2b[_0x473f6b(0x212)]),stopSpinner(_0x328082,_0x473f6b(0x1f8),!![]);}catch(_0xb51d6c){stopSpinner(_0x328082,_0x473f6b(0x20b),![]);throw CliErrors[_0x473f6b(0x1fd)](_0xb51d6c instanceof Error?_0xb51d6c[_0x473f6b(0x1e1)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0x1c8029=filterMenusWithResources(_0x4f6ffa);if(_0x1c8029[_0x473f6b(0x200)]===0x0)return console[_0x473f6b(0x1e2)](a67_0x2d89c6[_0x473f6b(0x1ff)]('\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found')),{'ok':!![]};console[_0x473f6b(0x1e2)](),console[_0x473f6b(0x1e2)](a67_0x2d89c6['cyan'](_0x473f6b(0x201)+_0x1c8029[_0x473f6b(0x200)]+_0x473f6b(0x1e6))),console[_0x473f6b(0x1e2)](renderUpdateSummary(_0x1c8029[_0x473f6b(0x1e9)](_0x249214=>_0x249214[_0x473f6b(0x1ec)]),[_0x56228d[_0x473f6b(0x208)],_0x56228d['cssUrl']])),console['log']();let _0x57121a=_0x56228d[_0x473f6b(0x208)],_0x37aca1=_0x56228d[_0x473f6b(0x1df)];!_0x57121a&&(_0x57121a=await askJsUrl());!_0x37aca1&&(_0x37aca1=await askCssUrl());const _0x5e1c85=await askConfirm('\x20\x20Update\x20'+_0x1c8029[_0x473f6b(0x200)]+_0x473f6b(0x1ea)+_0x57121a+_0x473f6b(0x1e3)+_0x37aca1+'?');if(!_0x5e1c85)return console['log'](a67_0x2d89c6['gray']('\x20\x20Cancelled.')),{'ok':!![]};const _0x16d141=[_0x57121a,_0x37aca1],_0x3e15d6=startSpinner(_0x473f6b(0x213)+_0x1c8029['length']+'\x20menu(s)...');try{const _0x514e21=await doUpdateCdnUrls(_0x1e0a2b[_0x473f6b(0x1e8)],_0x1e0a2b[_0x473f6b(0x212)],_0x1c8029,_0x16d141);return stopSpinner(_0x3e15d6,_0x473f6b(0x202)+_0x514e21[_0x473f6b(0x1f0)]+_0x473f6b(0x1fb),_0x514e21['failed']===0x0),{'ok':_0x514e21['failed']===0x0,'data':_0x514e21,'message':_0x514e21[_0x473f6b(0x207)]>0x0?_0x473f6b(0x1e7)+_0x514e21[_0x473f6b(0x1f0)]+_0x473f6b(0x1f5)+_0x514e21[_0x473f6b(0x207)]+_0x473f6b(0x20d):_0x473f6b(0x1e7)+_0x514e21['updated']+'\x20updated.'};}catch(_0x4badd1){stopSpinner(_0x3e15d6,_0x473f6b(0x1f2),![]);throw CliErrors[_0x473f6b(0x1fd)](_0x4badd1 instanceof Error?_0x4badd1[_0x473f6b(0x1e1)]:'Menu\x20update\x20failed');}}};function parseParams(_0x514dbf){const _0x252ec2=a67_0xd7c74e;if(!_0x514dbf)return{};try{const _0x17f3d8=JSON[_0x252ec2(0x1e4)](_0x514dbf);if(typeof _0x17f3d8!=='object'||_0x17f3d8===null||Array[_0x252ec2(0x206)](_0x17f3d8))return{};return{'jsUrl':typeof _0x17f3d8[_0x252ec2(0x208)]===_0x252ec2(0x20e)?_0x17f3d8[_0x252ec2(0x208)][_0x252ec2(0x211)]():undefined,'cssUrl':typeof _0x17f3d8[_0x252ec2(0x1df)]===_0x252ec2(0x20e)?_0x17f3d8[_0x252ec2(0x1df)]['trim']():undefined};}catch{return{};}}function a67_0x4d82(){const _0x45a4e6=['update','message','log','\x20and\x20CSS:\x20','parse','2526304apskpt','\x20menu(s)\x20with\x20existing\x20resources','Menu\x20update\x20completed:\x20','appCode','map','\x20menu(s)\x20with\x20JS:\x20','2346009kixnSD','label','6gaFIeS','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','flag','updated','299894FKNtYo','Menu\x20update\x20failed','2778740oVBrho','Fetching\x20online\x20menu\x20list...','\x20updated,\x20','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','Online\x20menu\x20list\x20fetched','skipped','\x20menu(s)\x20updated','\x20menu(s)','write','validation','error','yellow','length','\x20\x20Found\x20','Updated\x20','212427KLHAXS','str','✓\x20Menu\x20update\x20completed:\x20','isArray','failed','jsUrl','1016267rKNBQM','boolean','Failed\x20to\x20fetch\x20online\x20menu\x20list','params','\x20failed.','string','1597468isCjua','136UmjXhA','trim','cookie','Updating\x20','yes','cssUrl'];a67_0x4d82=function(){return _0x45a4e6;};return a67_0x4d82();}
|
package/lib/commands/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a68_0xbdcf8f=a68_0x1750;(function(_0x7b4921,_0x5111c5){const _0x56b62e=a68_0x1750,_0x525ee2=_0x7b4921();while(!![]){try{const _0x28b85a=-parseInt(_0x56b62e(0x1b3))/0x1*(parseInt(_0x56b62e(0x1bf))/0x2)+parseInt(_0x56b62e(0x1c7))/0x3*(parseInt(_0x56b62e(0x1bc))/0x4)+parseInt(_0x56b62e(0x1b6))/0x5+parseInt(_0x56b62e(0x1b0))/0x6+-parseInt(_0x56b62e(0x1ad))/0x7+parseInt(_0x56b62e(0x1b2))/0x8*(parseInt(_0x56b62e(0x1b7))/0x9)+parseInt(_0x56b62e(0x1bd))/0xa*(-parseInt(_0x56b62e(0x1b5))/0xb);if(_0x28b85a===_0x5111c5)break;else _0x525ee2['push'](_0x525ee2['shift']());}catch(_0x408acd){_0x525ee2['push'](_0x525ee2['shift']());}}}(a68_0x204f,0x82237));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a68_0x1750(_0x2957d3,_0x43cd1e){_0x2957d3=_0x2957d3-0x1a5;const _0x204fe1=a68_0x204f();let _0x1750bb=_0x204fe1[_0x2957d3];return _0x1750bb;}function runPreview(_0x4281cc){return new Promise((_0x26608b,_0x1aa270)=>{const _0x343249=a68_0x1750,_0x38a8b1=Date[_0x343249(0x1ba)]();_0x4281cc[_0x343249(0x1ab)][_0x343249(0x1a9)](_0x343249(0x1a8),_0x343249(0x1bb),{'command':'vite\x20preview'});let _0x54532d='';const _0x14f043=spawn('vite',[_0x343249(0x1a8)],{'stdio':[_0x343249(0x1c2),_0x343249(0x1c2),'pipe'],'shell':!![],'env':{...process.env,'PATH':''+join(process[_0x343249(0x1c5)](),_0x343249(0x1b1),_0x343249(0x1c6))+delimiter+process.env.PATH}});_0x14f043[_0x343249(0x1ae)]?.['on'](_0x343249(0x1c1),_0x56d564=>{const _0x1b302f=_0x343249;_0x54532d+=_0x56d564[_0x1b302f(0x1b4)]();}),_0x14f043['on'](_0x343249(0x1af),_0x1e09fd=>{const _0x574061=_0x343249,_0x1422f6=Date[_0x574061(0x1ba)]()-_0x38a8b1;if(_0x1e09fd===0x0||_0x1e09fd===null)_0x4281cc[_0x574061(0x1ab)]['success'](_0x574061(0x1a8),_0x574061(0x1a5),_0x1422f6),_0x26608b();else{const _0x140389={'exitCode':_0x1e09fd,'duration':_0x1422f6,'command':'vite\x20preview','cwd':process[_0x574061(0x1c5)]()};_0x54532d[_0x574061(0x1c0)]()&&(_0x140389[_0x574061(0x1ae)]=_0x54532d[_0x574061(0x1c0)]()),_0x4281cc['logger'][_0x574061(0x1be)](_0x574061(0x1a8),_0x574061(0x1aa),_0x140389),_0x1aa270(new Error(_0x574061(0x1ac)+_0x1e09fd));}}),_0x14f043['on']('error',_0x5b4c39=>{const _0x48cb4d=_0x343249,_0x5f0d72=Date['now']()-_0x38a8b1;_0x4281cc[_0x48cb4d(0x1ab)][_0x48cb4d(0x1be)](_0x48cb4d(0x1a8),_0x48cb4d(0x1c4),{'error':_0x5b4c39[_0x48cb4d(0x1c3)],'duration':_0x5f0d72,'stderr':_0x54532d['trim']()||undefined}),_0x1aa270(_0x5b4c39);});});}function runBuildWatch(){return new Promise((_0x48df6b,_0x59f36a)=>{const _0x31b81e=a68_0x1750,_0x440b5f=spawn('vite',['build','--watch'],{'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(process[_0x31b81e(0x1c5)](),'node_modules',_0x31b81e(0x1c6))+delimiter+process.env.PATH}});_0x440b5f['on'](_0x31b81e(0x1af),_0x25707d=>{if(_0x25707d===0x0||_0x25707d===null)_0x48df6b();else _0x59f36a(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x25707d));}),_0x440b5f['on'](_0x31b81e(0x1be),_0x59f36a);});}function a68_0x204f(){const _0x300cac=['all','Preview\x20project','preview','info','预览服务器启动失败','logger','vite\x20preview\x20exited\x20with\x20code\x20','427665mYpHxl','stderr','close','5996604LDSjBd','node_modules','184ZotXiw','54yljJMj','toString','34199rxJLsU','4043140rCqjxC','95373nyXWDX','执行预览命令','watch','now','启动预览服务器','152452cPQSXS','2110lDrwtg','error','32514nBPbXK','trim','data','inherit','message','预览服务器启动出错','cwd','.bin','6YGCMeb','预览服务器启动成功'];a68_0x204f=function(){return _0x300cac;};return a68_0x204f();}export const previewCommand={'name':'preview','description':a68_0xbdcf8f(0x1a7),async 'run'(_0x4fc6a2,_0x419527,_0x5f3224){const _0x41d3dd=a68_0xbdcf8f,_0x1a7451=_0x5f3224[_0x41d3dd(0x1b9)];_0x4fc6a2[_0x41d3dd(0x1ab)][_0x41d3dd(0x1a9)](_0x41d3dd(0x1a8),_0x41d3dd(0x1b8)+(_0x1a7451?'\x20(监听模式)':'')),_0x1a7451?await Promise[_0x41d3dd(0x1a6)]([runBuildWatch(),runPreview(_0x4fc6a2)]):await runPreview(_0x4fc6a2);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a57_0x590ca6=a57_0x2ff0;(function(_0x2f7f4e,_0xb505){const _0xfb3b7d=a57_0x2ff0,_0x26607f=_0x2f7f4e();while(!![]){try{const _0x5916e2=-parseInt(_0xfb3b7d(0x104))/0x1+parseInt(_0xfb3b7d(0x11a))/0x2*(-parseInt(_0xfb3b7d(0x111))/0x3)+parseInt(_0xfb3b7d(0x132))/0x4*(-parseInt(_0xfb3b7d(0x10a))/0x5)+parseInt(_0xfb3b7d(0x124))/0x6+-parseInt(_0xfb3b7d(0xfd))/0x7+-parseInt(_0xfb3b7d(0x107))/0x8+parseInt(_0xfb3b7d(0x118))/0x9;if(_0x5916e2===_0xb505)break;else _0x26607f['push'](_0x26607f['shift']());}catch(_0x20dedc){_0x26607f['push'](_0x26607f['shift']());}}}(a57_0x545b,0x4594e));import a57_0x289342 from'chalk';import a57_0x1902fb from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a57_0x545b(){const _0x470ceb=['MCP\x20config:','Step\x205/6:\x20Removing\x20old\x20skill...','@lovrabet/dataset-mcp-server','oldPath','files','yellow','Step\x201/6:\x20Migrating\x20config...','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Remove\x20legacy\x20artifacts','failed','Step\x202/6:\x20.lovrabet/\x20not\x20found,\x20skipped','lovrabet/rabetbase','info','Remove\x20.lovrabet/','Step\x203/6:\x20Legacy\x20artifacts\x20—\x20','error','Remove\x20old\x20skill','\x20from\x20','upgrade','Step\x201/6:\x20Config\x20migration\x20—\x20','detail','.cursor/mcp.json','Step\x204/6:\x20Cleaning\x20MCP\x20config...','length','args','step','entries','label','nonInteractive','Skill\x20swap:','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','.lovrabet','status','already\x20exists\x20(will\x20merge)','Step\x202/6:\x20.lovrabet/\x20directory\x20removed','3351005WYAHOm','red','values','keys','none\x20found','\x20\x20Action:\x20delete','bold','163236YVpzmG','cwd','isArray','2322184ehZQzD','join','exit\x20','1902545yYVRti','FAIL','no\x20legacy\x20config\x20found','utf8','Step\x204/6:\x20MCP\x20config\x20—\x20','Step\x202/6:\x20Removing\x20.lovrabet/\x20directory...','Config\x20file:','3KcOvMk','oldMcpConfig','needed','\x20→\x20keys:\x20','fail','Clean\x20MCP\x20config','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','13907349pVVxOR','oldArtifacts','874154uGDybP','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','filter','string','cyan','green','not\x20needed','.bak','.claude/skills/lovrabet','\x20\x20Fields\x20to\x20migrate:\x20','2937330whBywF','Proceed\x20with\x20upgrade?','fields','no\x20matching\x20entry\x20found','.cursor/rules/lovrabet_rules.mdc','mcpServers','\x20removed','Step\x203/6:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','object','gray','skipped','done','inherit','===\x20Upgrade\x20Analysis\x20===','4fUnGDH','log','lovrabet/rabetbase\x20installed\x20globally','isDirectory','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Step\x205/6:\x20Remove\x20old\x20skill\x20—\x20','message','path','some','parse','includes','Legacy\x20artifacts:','succeed','push','FOUND','CANCEL','Config\x20migration','Step\x206/6:\x20Install\x20new\x20skill\x20—\x20','\x20\x20Step\x20','hasNewConfig','start'];a57_0x545b=function(){return _0x470ceb;};return a57_0x545b();}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'./menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a57_0x590ca6(0x11c)](_0x222094=>_0x222094!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x318c41){const _0x1f6308=a57_0x590ca6,_0x16785e=[];for(const _0x2010b0 of Object[_0x1f6308(0xff)](CORE_IDE_CONFIGS)){if(_0x2010b0[_0x1f6308(0xdd)])for(const _0x19126a of _0x2010b0[_0x1f6308(0xdd)]){_0x16785e[_0x1f6308(0xd1)](resolve(_0x318c41,_0x19126a[_0x1f6308(0x139)]));}}return _0x16785e;}function analyse(_0x4472ba){const _0x3122a1=a57_0x590ca6;let _0x1257a5=null;const _0x45440d=resolve(_0x4472ba,NEW_CONFIG_NAME),_0x210350=existsSync(_0x45440d);for(const _0x490830 of LEGACY_CONFIG_NAMES){const _0x4b9a43=resolve(_0x4472ba,_0x490830);if(existsSync(_0x4b9a43)){const _0xe0f347=readConfigFile(_0x4b9a43),_0x37a7e8=Object[_0x3122a1(0x100)](_0xe0f347)['filter'](_0x47d263=>typeof _0xe0f347[_0x47d263]!=='undefined');_0x1257a5={'oldPath':_0x4b9a43,'hasNewConfig':_0x210350,'fields':_0x37a7e8};break;}}const _0x4c7962=[],_0x54b39d=resolve(_0x4472ba,'.lovrabet');if(existsSync(_0x54b39d))_0x4c7962[_0x3122a1(0xd1)](_0x54b39d);const _0x5c0061=resolve(_0x4472ba,_0x3122a1(0x128));if(existsSync(_0x5c0061))_0x4c7962[_0x3122a1(0xd1)](_0x5c0061);const _0x2bd7a5=resolve(_0x4472ba,_0x3122a1(0x122));if(existsSync(_0x2bd7a5))_0x4c7962[_0x3122a1(0xd1)](_0x2bd7a5);for(const _0x353f21 of collectIdeSkillFiles(_0x4472ba)){if(existsSync(_0x353f21))_0x4c7962[_0x3122a1(0xd1)](_0x353f21);}let _0xb5afa7=null;const _0x36ca5e=resolve(_0x4472ba,_0x3122a1(0xee));if(existsSync(_0x36ca5e))try{const _0x224795=JSON['parse'](readFileSync(_0x36ca5e,'utf8'));if(_0x224795?.[_0x3122a1(0x129)]&&typeof _0x224795[_0x3122a1(0x129)]===_0x3122a1(0x12c)){const _0x22a8df=[];for(const [_0x292f33,_0x35c19f]of Object[_0x3122a1(0xf3)](_0x224795[_0x3122a1(0x129)])){const _0x46a95c=_0x35c19f;_0x46a95c?.[_0x3122a1(0xf1)]&&Array[_0x3122a1(0x106)](_0x46a95c['args'])&&_0x46a95c[_0x3122a1(0xf1)][_0x3122a1(0x13a)](_0x56e186=>typeof _0x56e186===_0x3122a1(0x11d)&&_0x56e186[_0x3122a1(0x13c)](_0x3122a1(0xdb)))&&_0x22a8df[_0x3122a1(0xd1)](_0x292f33);}_0x22a8df['length']>0x0&&(_0xb5afa7={'path':_0x36ca5e,'keys':_0x22a8df});}}catch{}const _0x3486eb=_0x4c7962[_0x3122a1(0xf0)]>0x0||_0x1257a5!==null;return{'configMigration':_0x1257a5,'oldArtifacts':_0x4c7962,'oldMcpConfig':_0xb5afa7,'needsSkillSwap':_0x3486eb};}function printReport(_0x18ec78){const _0x5ba338=a57_0x590ca6,{configMigration:_0x3a37d5,oldArtifacts:_0x12ecad,oldMcpConfig:_0x4afe30,needsSkillSwap:_0x44c758}=_0x18ec78;console[_0x5ba338(0x133)](''),console[_0x5ba338(0x133)](a57_0x289342[_0x5ba338(0x103)](_0x5ba338(0x131))),console['log']('');_0x3a37d5?(console['log'](a57_0x289342[_0x5ba338(0x11e)]('Config\x20file:')+('\x20\x20'+a57_0x289342[_0x5ba338(0xde)](_0x3a37d5['oldPath']))),console[_0x5ba338(0x133)](_0x5ba338(0xe0)+(_0x3a37d5[_0x5ba338(0xd7)]?a57_0x289342['green'](_0x5ba338(0xfb)):a57_0x289342[_0x5ba338(0x12d)]('not\x20found\x20(will\x20create)'))),console[_0x5ba338(0x133)](_0x5ba338(0x123)+_0x3a37d5[_0x5ba338(0x126)]['join'](',\x20')),console[_0x5ba338(0x133)](_0x5ba338(0xf8))):console['log'](a57_0x289342[_0x5ba338(0x11e)](_0x5ba338(0x110))+'\x20\x20'+a57_0x289342[_0x5ba338(0x12d)](_0x5ba338(0x10c)));console[_0x5ba338(0x133)]('');if(_0x12ecad['length']>0x0){console[_0x5ba338(0x133)](a57_0x289342[_0x5ba338(0x11e)](_0x5ba338(0xcf)));for(const _0x28e3f0 of _0x12ecad){console[_0x5ba338(0x133)]('\x20\x20'+a57_0x289342['red'](_0x5ba338(0xd2))+'\x20\x20'+_0x28e3f0);}console[_0x5ba338(0x133)](_0x5ba338(0x102));}else console[_0x5ba338(0x133)](a57_0x289342[_0x5ba338(0x11e)](_0x5ba338(0xcf))+'\x20\x20'+a57_0x289342['gray'](_0x5ba338(0x101)));console['log'](''),_0x4afe30?(console['log'](a57_0x289342['cyan'](_0x5ba338(0xd9))+('\x20\x20'+a57_0x289342[_0x5ba338(0xde)](_0x4afe30[_0x5ba338(0x139)])+_0x5ba338(0x114)+_0x4afe30[_0x5ba338(0x100)][_0x5ba338(0x108)](',\x20'))),console['log'](_0x5ba338(0xf7))):console['log'](a57_0x289342[_0x5ba338(0x11e)](_0x5ba338(0xd9))+'\x20\x20'+a57_0x289342[_0x5ba338(0x12d)]('no\x20legacy\x20entry')),console[_0x5ba338(0x133)](''),console[_0x5ba338(0x133)](a57_0x289342[_0x5ba338(0x11e)](_0x5ba338(0xf6))+('\x20\x20'+(_0x44c758?a57_0x289342[_0x5ba338(0xde)](_0x5ba338(0x113)):a57_0x289342['green'](_0x5ba338(0x120))))),_0x44c758&&console[_0x5ba338(0x133)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global'),console[_0x5ba338(0x133)]('');}function execConfigMigration(_0x381ee1,_0x316ac9){const _0x34cc05=a57_0x590ca6,{configMigration:_0x29a0a4}=_0x381ee1;if(!_0x29a0a4?.[_0x34cc05(0xdc)])return{'step':0x1,'label':_0x34cc05(0xd4),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x902727=readConfigFile(_0x29a0a4[_0x34cc05(0xdc)]),_0x15f4fe=resolve(_0x316ac9,NEW_CONFIG_NAME),_0x33e0c2=_0x29a0a4[_0x34cc05(0xd7)]?readConfigFile(_0x15f4fe):{};for(const [_0x5d4797,_0x58329b]of Object['entries'](_0x902727)){!(_0x5d4797 in _0x33e0c2)&&(_0x33e0c2[_0x5d4797]=_0x58329b);}writeConfigFile(_0x15f4fe,_0x33e0c2);const _0x2e2271=_0x29a0a4['oldPath']+_0x34cc05(0x121);return renameSync(_0x29a0a4[_0x34cc05(0xdc)],_0x2e2271),{'step':0x1,'label':_0x34cc05(0xd4),'ok':!![],'detail':_0x29a0a4['oldPath']+'\x20→\x20'+_0x15f4fe+'\x20(backup:\x20'+_0x2e2271+')'};}function execRemoveOldArtifacts(_0x335bec){const _0x1c91f0=a57_0x590ca6,_0x3ecbab=[];for(const _0x55f2b6 of _0x335bec){try{if(!existsSync(_0x55f2b6))continue;const _0x57fc0a=tryStat(_0x55f2b6);_0x57fc0a?.[_0x1c91f0(0x135)]()?rmSync(_0x55f2b6,{'recursive':!![],'force':!![]}):unlinkSync(_0x55f2b6);}catch(_0x32d11b){_0x3ecbab[_0x1c91f0(0xd1)](_0x55f2b6+':\x20'+_0x32d11b['message']);}}return{'step':0x3,'label':_0x1c91f0(0xe1),'ok':_0x3ecbab['length']===0x0,'detail':_0x3ecbab[_0x1c91f0(0xf0)]>0x0?_0x335bec[_0x1c91f0(0xf0)]-_0x3ecbab['length']+'/'+_0x335bec['length']+'\x20removed\x20('+_0x3ecbab[_0x1c91f0(0x108)](';\x20')+')':_0x335bec[_0x1c91f0(0xf0)]+_0x1c91f0(0x12a)};}function execCleanMcp(_0x1556bd){const _0x3e6946=a57_0x590ca6;if(!_0x1556bd[_0x3e6946(0x112)])return{'step':0x4,'label':_0x3e6946(0x116),'ok':!![],'detail':_0x3e6946(0x12e)};try{const _0xd0c6ef=readFileSync(_0x1556bd[_0x3e6946(0x112)][_0x3e6946(0x139)],_0x3e6946(0x10d)),_0x309336=JSON[_0x3e6946(0x13b)](_0xd0c6ef);if(_0x309336?.[_0x3e6946(0x129)]&&typeof _0x309336[_0x3e6946(0x129)]==='object'){const _0x192b49=[];for(const [_0x4f7787,_0x5796cc]of Object['entries'](_0x309336[_0x3e6946(0x129)])){_0x5796cc?.[_0x3e6946(0xf1)]&&Array[_0x3e6946(0x106)](_0x5796cc[_0x3e6946(0xf1)])&&_0x5796cc['args'][_0x3e6946(0x13a)](_0x210b3e=>typeof _0x210b3e===_0x3e6946(0x11d)&&_0x210b3e[_0x3e6946(0x13c)](_0x3e6946(0xdb)))&&_0x192b49[_0x3e6946(0xd1)](_0x4f7787);}for(const _0x4b971d of _0x192b49){delete _0x309336['mcpServers'][_0x4b971d];}return _0x192b49[_0x3e6946(0xf0)]>0x0&&writeFileSync(_0x1556bd['oldMcpConfig']['path'],JSON['stringify'](_0x309336,null,0x2)+'\x0a',_0x3e6946(0x10d)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0x192b49[_0x3e6946(0x108)](',\x20')+_0x3e6946(0xea)+_0x1556bd[_0x3e6946(0x112)][_0x3e6946(0x139)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x3e6946(0x127)};}catch(_0x147369){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x147369[_0x3e6946(0x138)]};}}function execSkillsRemove(_0x1ea635){const _0x3e46ac=a57_0x590ca6,_0x62d1d0=runNpxSkillsRemove(_0x1ea635,{'stdio':_0x3e46ac(0x130)});return{'step':0x5,'label':_0x3e46ac(0xe9),'ok':_0x62d1d0['ok'],'detail':_0x62d1d0['ok']?'lovrabet/lovrabet-skill\x20removed':_0x62d1d0[_0x3e46ac(0xe8)]??_0x3e46ac(0x109)+_0x62d1d0[_0x3e46ac(0xfa)]};}function a57_0x2ff0(_0x135dac,_0x1568b4){_0x135dac=_0x135dac-0xcf;const _0x545b8c=a57_0x545b();let _0x2ff083=_0x545b8c[_0x135dac];return _0x2ff083;}function execSkillsAdd(_0x338024){const _0x3ba111=a57_0x590ca6,_0xa532ca=runNpxSkillsAddGlobal(_0x338024,_0x3ba111(0xe4),{'stdio':_0x3ba111(0x130)});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0xa532ca['ok'],'detail':_0xa532ca['ok']?_0x3ba111(0x134):_0xa532ca[_0x3ba111(0xe8)]??_0x3ba111(0x109)+_0xa532ca['status']};}function tryStat(_0x33f36e){try{return statSync(_0x33f36e);}catch{return undefined;}}function printSummary(_0x235e7a){const _0x2308fd=a57_0x590ca6;console[_0x2308fd(0x133)](''),console[_0x2308fd(0x133)](a57_0x289342['bold']('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x838cf7 of _0x235e7a){const _0x48a37b=_0x838cf7['ok']?a57_0x289342[_0x2308fd(0x11f)]('OK'):a57_0x289342[_0x2308fd(0xfe)](_0x2308fd(0x10b));console[_0x2308fd(0x133)]('\x20\x20'+_0x48a37b+_0x2308fd(0xd6)+_0x838cf7[_0x2308fd(0xf2)]+':\x20'+_0x838cf7[_0x2308fd(0xf4)]);if(_0x838cf7[_0x2308fd(0xed)])console[_0x2308fd(0x133)]('\x20\x20\x20\x20\x20\x20\x20'+a57_0x289342[_0x2308fd(0x12d)](_0x838cf7[_0x2308fd(0xed)]));}console[_0x2308fd(0x133)]('');}export async function upgradeApp(_0x4c3e4f,_0x23cf46){const _0x178e09=a57_0x590ca6,_0xf6be9a=process[_0x178e09(0x105)](),_0x1fa617=analyse(_0xf6be9a),_0x54fd56=!_0x1fa617['configMigration']&&_0x1fa617[_0x178e09(0x119)][_0x178e09(0xf0)]===0x0&&!_0x1fa617['oldMcpConfig']&&!_0x1fa617['needsSkillSwap'];if(_0x54fd56){console[_0x178e09(0x133)](a57_0x289342['green'](_0x178e09(0x117)));return;}printReport(_0x1fa617);const _0x419887=_0x23cf46['yes']||_0x23cf46['Y']||_0x4c3e4f[_0x178e09(0xf5)];if(!_0x419887)try{const _0x3b94d4=await askConfirm(_0x178e09(0x125));if(!_0x3b94d4){console['log'](a57_0x289342[_0x178e09(0x12d)]('Upgrade\x20cancelled.'));return;}}catch(_0x5bdc80){if(_0x5bdc80?.[_0x178e09(0x138)]===_0x178e09(0xd3)){console['log'](a57_0x289342[_0x178e09(0x12d)]('Upgrade\x20cancelled.'));return;}throw _0x5bdc80;}const _0x14728c=[],_0xfe8f93=a57_0x1902fb({'text':_0x178e09(0xdf),'color':'cyan'})['start'](),_0xb80c5c=execConfigMigration(_0x1fa617,_0xf6be9a);_0x14728c[_0x178e09(0xd1)](_0xb80c5c),_0xfe8f93[_0xb80c5c['ok']?_0x178e09(0xd0):_0x178e09(0x115)](_0x178e09(0xec)+(_0xb80c5c[_0x178e09(0xed)]??(_0xb80c5c['ok']?_0x178e09(0x12f):'failed')));const _0x4ed4d1=resolve(_0xf6be9a,_0x178e09(0xf9)),_0x1431d6=a57_0x1902fb({'text':_0x178e09(0x10f),'color':'cyan'})[_0x178e09(0xd8)]();if(existsSync(_0x4ed4d1))try{rmSync(_0x4ed4d1,{'recursive':!![],'force':!![]}),_0x1431d6[_0x178e09(0xd0)](_0x178e09(0xfc)),_0x14728c[_0x178e09(0xd1)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x58cab7){_0x1431d6[_0x178e09(0x115)]('Step\x202/6:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x58cab7[_0x178e09(0x138)]),_0x14728c[_0x178e09(0xd1)]({'step':0x2,'label':_0x178e09(0xe6),'ok':![],'detail':_0x58cab7['message']});}else _0x1431d6[_0x178e09(0xe5)](_0x178e09(0xe3)),_0x14728c[_0x178e09(0xd1)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x178e09(0x12e)});const _0x1821eb=a57_0x1902fb({'text':_0x178e09(0x12b),'color':'cyan'})[_0x178e09(0xd8)](),_0x11b1cb=execRemoveOldArtifacts(_0x1fa617[_0x178e09(0x119)]);_0x14728c[_0x178e09(0xd1)](_0x11b1cb),_0x1821eb[_0x11b1cb['ok']?_0x178e09(0xd0):_0x178e09(0x115)](_0x178e09(0xe7)+(_0x11b1cb['detail']??(_0x11b1cb['ok']?'done':_0x178e09(0xe2))));const _0x448ebc=a57_0x1902fb({'text':_0x178e09(0xef),'color':_0x178e09(0x11e)})[_0x178e09(0xd8)](),_0x1a7830=execCleanMcp(_0x1fa617);_0x14728c['push'](_0x1a7830),_0x448ebc[_0x1a7830['ok']?_0x178e09(0xd0):_0x178e09(0x115)](_0x178e09(0x10e)+(_0x1a7830[_0x178e09(0xed)]??(_0x1a7830['ok']?_0x178e09(0x12f):'failed')));const _0x26762c=a57_0x1902fb({'text':_0x178e09(0xda),'color':_0x178e09(0x11e)})[_0x178e09(0xd8)](),_0x7fe628=execSkillsRemove(_0xf6be9a);_0x14728c['push'](_0x7fe628),_0x26762c[_0x7fe628['ok']?_0x178e09(0xd0):_0x178e09(0x115)](_0x178e09(0x137)+(_0x7fe628[_0x178e09(0xed)]??(_0x7fe628['ok']?_0x178e09(0x12f):_0x178e09(0xe2))));const _0x1aa6c2=a57_0x1902fb({'text':'Step\x206/6:\x20Installing\x20new\x20skill...','color':'cyan'})[_0x178e09(0xd8)](),_0x57744b=execSkillsAdd(_0xf6be9a);_0x14728c[_0x178e09(0xd1)](_0x57744b),_0x1aa6c2[_0x57744b['ok']?_0x178e09(0xd0):'fail'](_0x178e09(0xd5)+(_0x57744b['detail']??(_0x57744b['ok']?'done':_0x178e09(0xe2)))),printSummary(_0x14728c);const _0x4f97aa=_0x14728c[_0x178e09(0x13a)](_0x15b7dd=>!_0x15b7dd['ok']);_0x4f97aa?console[_0x178e09(0x133)](a57_0x289342[_0x178e09(0xde)](_0x178e09(0x11b))):console[_0x178e09(0x133)](a57_0x289342[_0x178e09(0x11f)]('Upgrade\x20completed\x20successfully!'));}export const upgradeCommand={'name':a57_0x590ca6(0xeb),'description':a57_0x590ca6(0x136),async 'run'(_0x503c37,_0xcb1155,_0xea41ee){await upgradeApp(_0x503c37,_0xea41ee);}};
|
|
1
|
+
const a69_0x145ed7=a69_0x20bc;(function(_0x55f8b6,_0x28120c){const _0x215ee4=a69_0x20bc,_0x245091=_0x55f8b6();while(!![]){try{const _0x124ae2=parseInt(_0x215ee4(0x1b3))/0x1*(-parseInt(_0x215ee4(0x1ac))/0x2)+-parseInt(_0x215ee4(0x1cf))/0x3+parseInt(_0x215ee4(0x1d7))/0x4*(parseInt(_0x215ee4(0x1d4))/0x5)+parseInt(_0x215ee4(0x1fa))/0x6+parseInt(_0x215ee4(0x208))/0x7*(-parseInt(_0x215ee4(0x1fd))/0x8)+-parseInt(_0x215ee4(0x213))/0x9+parseInt(_0x215ee4(0x201))/0xa*(parseInt(_0x215ee4(0x20b))/0xb);if(_0x124ae2===_0x28120c)break;else _0x245091['push'](_0x245091['shift']());}catch(_0x109d7c){_0x245091['push'](_0x245091['shift']());}}}(a69_0x218a,0xe78bd));import a69_0xd9a38e from'chalk';import a69_0x378261 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'./menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a69_0x145ed7(0x1d0)](_0x2ee58e=>_0x2ee58e!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x5b3ca8){const _0x3588fb=a69_0x145ed7,_0x4aa9eb=[];for(const _0x4baecd of Object[_0x3588fb(0x1f0)](CORE_IDE_CONFIGS)){if(_0x4baecd[_0x3588fb(0x1c1)])for(const _0x1babad of _0x4baecd[_0x3588fb(0x1c1)]){_0x4aa9eb['push'](resolve(_0x5b3ca8,_0x1babad[_0x3588fb(0x1a7)]));}}return _0x4aa9eb;}function analyse(_0x3351f0){const _0x33b741=a69_0x145ed7;let _0x247479=null;const _0x2c0716=resolve(_0x3351f0,NEW_CONFIG_NAME),_0xbfb788=existsSync(_0x2c0716);for(const _0x56c229 of LEGACY_CONFIG_NAMES){const _0x5889c4=resolve(_0x3351f0,_0x56c229);if(existsSync(_0x5889c4)){const _0x47eb10=readConfigFile(_0x5889c4),_0x5c9699=Object[_0x33b741(0x200)](_0x47eb10)['filter'](_0x37a1b6=>typeof _0x47eb10[_0x37a1b6]!==_0x33b741(0x1fe));_0x247479={'oldPath':_0x5889c4,'hasNewConfig':_0xbfb788,'fields':_0x5c9699};break;}}const _0x2199cb=[],_0x3ae5e9=resolve(_0x3351f0,_0x33b741(0x209));if(existsSync(_0x3ae5e9))_0x2199cb[_0x33b741(0x1a3)](_0x3ae5e9);const _0x21261a=resolve(_0x3351f0,_0x33b741(0x1ae));if(existsSync(_0x21261a))_0x2199cb[_0x33b741(0x1a3)](_0x21261a);const _0x4b389d=resolve(_0x3351f0,'.claude/skills/lovrabet');if(existsSync(_0x4b389d))_0x2199cb[_0x33b741(0x1a3)](_0x4b389d);for(const _0x4174a0 of collectIdeSkillFiles(_0x3351f0)){if(existsSync(_0x4174a0))_0x2199cb[_0x33b741(0x1a3)](_0x4174a0);}let _0x51bf3d=null;const _0x464bd8=resolve(_0x3351f0,_0x33b741(0x1d3));if(existsSync(_0x464bd8))try{const _0x273ca1=JSON[_0x33b741(0x1e3)](readFileSync(_0x464bd8,_0x33b741(0x1a8)));if(_0x273ca1?.[_0x33b741(0x1d1)]&&typeof _0x273ca1[_0x33b741(0x1d1)]===_0x33b741(0x1cb)){const _0x3860ec=[];for(const [_0x1cff9d,_0x2b1bae]of Object[_0x33b741(0x1f7)](_0x273ca1[_0x33b741(0x1d1)])){const _0x2d0860=_0x2b1bae;_0x2d0860?.['args']&&Array[_0x33b741(0x20a)](_0x2d0860['args'])&&_0x2d0860['args'][_0x33b741(0x1f3)](_0x593e20=>typeof _0x593e20===_0x33b741(0x1d9)&&_0x593e20[_0x33b741(0x1e4)](_0x33b741(0x20d)))&&_0x3860ec[_0x33b741(0x1a3)](_0x1cff9d);}_0x3860ec['length']>0x0&&(_0x51bf3d={'path':_0x464bd8,'keys':_0x3860ec});}}catch{}const _0x4a5bf5=_0x2199cb[_0x33b741(0x1dd)]>0x0||_0x247479!==null;return{'configMigration':_0x247479,'oldArtifacts':_0x2199cb,'oldMcpConfig':_0x51bf3d,'needsSkillSwap':_0x4a5bf5};}function printReport(_0x7b6c97){const _0x1c0565=a69_0x145ed7,{configMigration:_0xd1a8a0,oldArtifacts:_0x108855,oldMcpConfig:_0x4e3960,needsSkillSwap:_0x4ed85a}=_0x7b6c97;console[_0x1c0565(0x1de)](''),console[_0x1c0565(0x1de)](a69_0xd9a38e[_0x1c0565(0x1e2)](_0x1c0565(0x1bb))),console[_0x1c0565(0x1de)]('');_0xd1a8a0?(console[_0x1c0565(0x1de)](a69_0xd9a38e['cyan'](_0x1c0565(0x1ba))+('\x20\x20'+a69_0xd9a38e[_0x1c0565(0x1a6)](_0xd1a8a0[_0x1c0565(0x1c5)]))),console[_0x1c0565(0x1de)](_0x1c0565(0x1ef)+(_0xd1a8a0['hasNewConfig']?a69_0xd9a38e[_0x1c0565(0x1d6)](_0x1c0565(0x1b4)):a69_0xd9a38e['gray'](_0x1c0565(0x1e1)))),console[_0x1c0565(0x1de)](_0x1c0565(0x1da)+_0xd1a8a0[_0x1c0565(0x1aa)]['join'](',\x20')),console[_0x1c0565(0x1de)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x1c0565(0x1de)](a69_0xd9a38e[_0x1c0565(0x20c)](_0x1c0565(0x1ba))+'\x20\x20'+a69_0xd9a38e[_0x1c0565(0x1b2)](_0x1c0565(0x1b8)));console[_0x1c0565(0x1de)]('');if(_0x108855[_0x1c0565(0x1dd)]>0x0){console[_0x1c0565(0x1de)](a69_0xd9a38e[_0x1c0565(0x20c)]('Legacy\x20artifacts:'));for(const _0x36a836 of _0x108855){console[_0x1c0565(0x1de)]('\x20\x20'+a69_0xd9a38e['red'](_0x1c0565(0x1e0))+'\x20\x20'+_0x36a836);}console[_0x1c0565(0x1de)]('\x20\x20Action:\x20delete');}else console['log'](a69_0xd9a38e[_0x1c0565(0x20c)](_0x1c0565(0x1f9))+'\x20\x20'+a69_0xd9a38e[_0x1c0565(0x1b2)](_0x1c0565(0x203)));console[_0x1c0565(0x1de)](''),_0x4e3960?(console[_0x1c0565(0x1de)](a69_0xd9a38e['cyan'](_0x1c0565(0x1ea))+('\x20\x20'+a69_0xd9a38e[_0x1c0565(0x1a6)](_0x4e3960[_0x1c0565(0x1a7)])+'\x20→\x20keys:\x20'+_0x4e3960[_0x1c0565(0x200)][_0x1c0565(0x205)](',\x20'))),console[_0x1c0565(0x1de)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x1c0565(0x1de)](a69_0xd9a38e[_0x1c0565(0x20c)](_0x1c0565(0x1ea))+'\x20\x20'+a69_0xd9a38e[_0x1c0565(0x1b2)](_0x1c0565(0x1f8))),console[_0x1c0565(0x1de)](''),console['log'](a69_0xd9a38e[_0x1c0565(0x20c)](_0x1c0565(0x1e6))+('\x20\x20'+(_0x4ed85a?a69_0xd9a38e['yellow']('needed'):a69_0xd9a38e[_0x1c0565(0x1d6)]('not\x20needed')))),_0x4ed85a&&console['log']('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global'),console[_0x1c0565(0x1de)]('');}function execConfigMigration(_0x3801d2,_0x3296d6){const _0x4bede2=a69_0x145ed7,{configMigration:_0x8c00c1}=_0x3801d2;if(!_0x8c00c1?.[_0x4bede2(0x1c5)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x253e2a=readConfigFile(_0x8c00c1['oldPath']),_0x5817a1=resolve(_0x3296d6,NEW_CONFIG_NAME),_0x3265fd=_0x8c00c1[_0x4bede2(0x206)]?readConfigFile(_0x5817a1):{};for(const [_0x175b7f,_0x5c6465]of Object[_0x4bede2(0x1f7)](_0x253e2a)){!(_0x175b7f in _0x3265fd)&&(_0x3265fd[_0x175b7f]=_0x5c6465);}writeConfigFile(_0x5817a1,_0x3265fd);const _0x3ed263=_0x8c00c1['oldPath']+_0x4bede2(0x1f1);return renameSync(_0x8c00c1['oldPath'],_0x3ed263),{'step':0x1,'label':_0x4bede2(0x1e9),'ok':!![],'detail':_0x8c00c1['oldPath']+_0x4bede2(0x1a5)+_0x5817a1+_0x4bede2(0x1f6)+_0x3ed263+')'};}function execRemoveOldArtifacts(_0x156a94){const _0x4fd309=a69_0x145ed7,_0x3190d1=[];for(const _0x1560b4 of _0x156a94){try{if(!existsSync(_0x1560b4))continue;const _0x3aca4c=tryStat(_0x1560b4);_0x3aca4c?.[_0x4fd309(0x1cd)]()?rmSync(_0x1560b4,{'recursive':!![],'force':!![]}):unlinkSync(_0x1560b4);}catch(_0x48ae73){_0x3190d1[_0x4fd309(0x1a3)](_0x1560b4+':\x20'+_0x48ae73[_0x4fd309(0x20f)]);}}return{'step':0x3,'label':_0x4fd309(0x1f2),'ok':_0x3190d1[_0x4fd309(0x1dd)]===0x0,'detail':_0x3190d1[_0x4fd309(0x1dd)]>0x0?_0x156a94[_0x4fd309(0x1dd)]-_0x3190d1[_0x4fd309(0x1dd)]+'/'+_0x156a94[_0x4fd309(0x1dd)]+_0x4fd309(0x1b7)+_0x3190d1[_0x4fd309(0x205)](';\x20')+')':_0x156a94[_0x4fd309(0x1dd)]+_0x4fd309(0x1ed)};}function execCleanMcp(_0x403761){const _0xc405b7=a69_0x145ed7;if(!_0x403761['oldMcpConfig'])return{'step':0x4,'label':_0xc405b7(0x1d2),'ok':!![],'detail':_0xc405b7(0x1db)};try{const _0x3376a2=readFileSync(_0x403761['oldMcpConfig'][_0xc405b7(0x1a7)],'utf8'),_0x2cb092=JSON['parse'](_0x3376a2);if(_0x2cb092?.[_0xc405b7(0x1d1)]&&typeof _0x2cb092[_0xc405b7(0x1d1)]===_0xc405b7(0x1cb)){const _0x181dd8=[];for(const [_0x532196,_0x6e09f0]of Object[_0xc405b7(0x1f7)](_0x2cb092[_0xc405b7(0x1d1)])){_0x6e09f0?.[_0xc405b7(0x1f5)]&&Array[_0xc405b7(0x20a)](_0x6e09f0['args'])&&_0x6e09f0[_0xc405b7(0x1f5)]['some'](_0x647eb4=>typeof _0x647eb4===_0xc405b7(0x1d9)&&_0x647eb4['includes'](_0xc405b7(0x20d)))&&_0x181dd8[_0xc405b7(0x1a3)](_0x532196);}for(const _0x53efa4 of _0x181dd8){delete _0x2cb092['mcpServers'][_0x53efa4];}return _0x181dd8['length']>0x0&&writeFileSync(_0x403761[_0xc405b7(0x1c2)]['path'],JSON[_0xc405b7(0x212)](_0x2cb092,null,0x2)+'\x0a',_0xc405b7(0x1a8)),{'step':0x4,'label':_0xc405b7(0x1d2),'ok':!![],'detail':_0xc405b7(0x1ec)+_0x181dd8[_0xc405b7(0x205)](',\x20')+_0xc405b7(0x1a9)+_0x403761[_0xc405b7(0x1c2)][_0xc405b7(0x1a7)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0xa5647){return{'step':0x4,'label':_0xc405b7(0x1d2),'ok':![],'detail':_0xa5647[_0xc405b7(0x20f)]};}}function execSkillsRemove(_0x4e3268){const _0x32dfe6=a69_0x145ed7,_0x892ac2=runNpxSkillsRemove(_0x4e3268,{'stdio':_0x32dfe6(0x1c0)});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x892ac2['ok'],'detail':_0x892ac2['ok']?_0x32dfe6(0x20e):_0x892ac2['error']??_0x32dfe6(0x202)+_0x892ac2[_0x32dfe6(0x1b0)]};}function execSkillsAdd(_0x3d71d9){const _0x50d2cd=a69_0x145ed7,_0x242840=runNpxSkillsAddGlobal(_0x3d71d9,_0x50d2cd(0x1e5),{'stdio':_0x50d2cd(0x1c0)});return{'step':0x6,'label':_0x50d2cd(0x1f4),'ok':_0x242840['ok'],'detail':_0x242840['ok']?_0x50d2cd(0x1be):_0x242840[_0x50d2cd(0x1e7)]??_0x50d2cd(0x202)+_0x242840[_0x50d2cd(0x1b0)]};}function a69_0x20bc(_0x3a0865,_0x412408){_0x3a0865=_0x3a0865-0x1a1;const _0x218a92=a69_0x218a();let _0x20bc28=_0x218a92[_0x3a0865];return _0x20bc28;}function tryStat(_0x150c8d){try{return statSync(_0x150c8d);}catch{return undefined;}}function printSummary(_0x50b2b1){const _0x18c7da=a69_0x145ed7;console[_0x18c7da(0x1de)](''),console[_0x18c7da(0x1de)](a69_0xd9a38e[_0x18c7da(0x1e2)](_0x18c7da(0x1a1))),console[_0x18c7da(0x1de)]('');for(const _0x495f31 of _0x50b2b1){const _0x48f466=_0x495f31['ok']?a69_0xd9a38e['green']('OK'):a69_0xd9a38e[_0x18c7da(0x1c4)](_0x18c7da(0x204));console[_0x18c7da(0x1de)]('\x20\x20'+_0x48f466+'\x20\x20Step\x20'+_0x495f31['step']+':\x20'+_0x495f31['label']);if(_0x495f31[_0x18c7da(0x1d5)])console[_0x18c7da(0x1de)](_0x18c7da(0x1c8)+a69_0xd9a38e[_0x18c7da(0x1b2)](_0x495f31[_0x18c7da(0x1d5)]));}console[_0x18c7da(0x1de)]('');}export async function upgradeApp(_0x55f828,_0x18cf89){const _0x14a761=a69_0x145ed7,_0x3714b8=process[_0x14a761(0x1dc)](),_0x4dd5a0=analyse(_0x3714b8),_0x23525c=!_0x4dd5a0[_0x14a761(0x1bc)]&&_0x4dd5a0['oldArtifacts'][_0x14a761(0x1dd)]===0x0&&!_0x4dd5a0[_0x14a761(0x1c2)]&&!_0x4dd5a0[_0x14a761(0x1a4)];if(_0x23525c){console[_0x14a761(0x1de)](a69_0xd9a38e['green'](_0x14a761(0x210)));return;}printReport(_0x4dd5a0);const _0x622eca=_0x18cf89[_0x14a761(0x211)]||_0x18cf89['Y']||_0x55f828[_0x14a761(0x1b5)];if(!_0x622eca)try{const _0x15a767=await askConfirm(_0x14a761(0x1c3));if(!_0x15a767){console[_0x14a761(0x1de)](a69_0xd9a38e[_0x14a761(0x1b2)](_0x14a761(0x1c9)));return;}}catch(_0x5f3594){if(_0x5f3594?.['message']===_0x14a761(0x1df)){console[_0x14a761(0x1de)](a69_0xd9a38e[_0x14a761(0x1b2)](_0x14a761(0x1c9)));return;}throw _0x5f3594;}const _0xfedd89=[],_0x1ce8f0=a69_0x378261({'text':_0x14a761(0x1af),'color':_0x14a761(0x20c)})['start'](),_0x919a0b=execConfigMigration(_0x4dd5a0,_0x3714b8);_0xfedd89['push'](_0x919a0b),_0x1ce8f0[_0x919a0b['ok']?_0x14a761(0x1cc):_0x14a761(0x1b1)](_0x14a761(0x1c7)+(_0x919a0b[_0x14a761(0x1d5)]??(_0x919a0b['ok']?_0x14a761(0x1ca):_0x14a761(0x1b9))));const _0xadae65=resolve(_0x3714b8,_0x14a761(0x209)),_0x483154=a69_0x378261({'text':_0x14a761(0x1fc),'color':_0x14a761(0x20c)})['start']();if(existsSync(_0xadae65))try{rmSync(_0xadae65,{'recursive':!![],'force':!![]}),_0x483154[_0x14a761(0x1cc)]('Step\x202/6:\x20.lovrabet/\x20directory\x20removed'),_0xfedd89[_0x14a761(0x1a3)]({'step':0x2,'label':_0x14a761(0x1fb),'ok':!![]});}catch(_0x33e560){_0x483154[_0x14a761(0x1b1)](_0x14a761(0x1bd)+_0x33e560[_0x14a761(0x20f)]),_0xfedd89[_0x14a761(0x1a3)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x33e560[_0x14a761(0x20f)]});}else _0x483154[_0x14a761(0x1b6)]('Step\x202/6:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0xfedd89['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x14a761(0x1db)});const _0x157b4f=a69_0x378261({'text':_0x14a761(0x1e8),'color':_0x14a761(0x20c)})[_0x14a761(0x1ce)](),_0x552480=execRemoveOldArtifacts(_0x4dd5a0[_0x14a761(0x1c6)]);_0xfedd89['push'](_0x552480),_0x157b4f[_0x552480['ok']?_0x14a761(0x1cc):_0x14a761(0x1b1)](_0x14a761(0x1ee)+(_0x552480[_0x14a761(0x1d5)]??(_0x552480['ok']?_0x14a761(0x1ca):_0x14a761(0x1b9))));const _0x25f7a1=a69_0x378261({'text':_0x14a761(0x1eb),'color':_0x14a761(0x20c)})[_0x14a761(0x1ce)](),_0x148ae0=execCleanMcp(_0x4dd5a0);_0xfedd89[_0x14a761(0x1a3)](_0x148ae0),_0x25f7a1[_0x148ae0['ok']?_0x14a761(0x1cc):_0x14a761(0x1b1)]('Step\x204/6:\x20MCP\x20config\x20—\x20'+(_0x148ae0['detail']??(_0x148ae0['ok']?_0x14a761(0x1ca):'failed')));const _0x33c850=a69_0x378261({'text':_0x14a761(0x1bf),'color':_0x14a761(0x20c)})[_0x14a761(0x1ce)](),_0x3973bc=execSkillsRemove(_0x3714b8);_0xfedd89[_0x14a761(0x1a3)](_0x3973bc),_0x33c850[_0x3973bc['ok']?'succeed':'fail'](_0x14a761(0x1ad)+(_0x3973bc[_0x14a761(0x1d5)]??(_0x3973bc['ok']?_0x14a761(0x1ca):_0x14a761(0x1b9))));const _0xf50a89=a69_0x378261({'text':_0x14a761(0x1ab),'color':_0x14a761(0x20c)})[_0x14a761(0x1ce)](),_0x5b80de=execSkillsAdd(_0x3714b8);_0xfedd89[_0x14a761(0x1a3)](_0x5b80de),_0xf50a89[_0x5b80de['ok']?_0x14a761(0x1cc):_0x14a761(0x1b1)](_0x14a761(0x1a2)+(_0x5b80de[_0x14a761(0x1d5)]??(_0x5b80de['ok']?_0x14a761(0x1ca):'failed'))),printSummary(_0xfedd89);const _0x5a9ddd=_0xfedd89[_0x14a761(0x1f3)](_0xf64c4e=>!_0xf64c4e['ok']);_0x5a9ddd?console[_0x14a761(0x1de)](a69_0xd9a38e[_0x14a761(0x1a6)](_0x14a761(0x1ff))):console[_0x14a761(0x1de)](a69_0xd9a38e[_0x14a761(0x1d6)]('Upgrade\x20completed\x20successfully!'));}const flagDefs=[{'name':a69_0x145ed7(0x211),'type':a69_0x145ed7(0x207),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const upgradeCommand={'name':'upgrade','description':a69_0x145ed7(0x1d8),'flags':flagDefs,async 'run'(_0x26b950,_0x5e4dd2,_0x1ef7a9){await upgradeApp(_0x26b950,_0x1ef7a9);}};function a69_0x218a(){const _0x31a5ec=['oldPath','oldArtifacts','Step\x201/6:\x20Config\x20migration\x20—\x20','\x20\x20\x20\x20\x20\x20\x20','Upgrade\x20cancelled.','done','object','succeed','isDirectory','start','2692110dQgWGz','filter','mcpServers','Clean\x20MCP\x20config','.cursor/mcp.json','5905epZrzM','detail','green','396VDKzge','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','string','\x20\x20Fields\x20to\x20migrate:\x20','skipped','cwd','length','log','CANCEL','FOUND','not\x20found\x20(will\x20create)','bold','parse','includes','lovrabet/rabetbase','Skill\x20swap:','error','Step\x203/6:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Config\x20migration','MCP\x20config:','Step\x204/6:\x20Cleaning\x20MCP\x20config...','removed\x20','\x20removed','Step\x203/6:\x20Legacy\x20artifacts\x20—\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','values','.bak','Remove\x20legacy\x20artifacts','some','Install\x20new\x20skill','args','\x20(backup:\x20','entries','no\x20legacy\x20entry','Legacy\x20artifacts:','7018206uBTzhd','Remove\x20.lovrabet/','Step\x202/6:\x20Removing\x20.lovrabet/\x20directory...','8nhHDys','undefined','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','keys','60sRsYyX','exit\x20','none\x20found','FAIL','join','hasNewConfig','boolean','3422867GQkKXe','.lovrabet','isArray','4802138CmtMwh','cyan','@lovrabet/dataset-mcp-server','lovrabet/lovrabet-skill\x20removed','message','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','yes','stringify','2520657fPYtoX','===\x20Upgrade\x20Summary\x20===','Step\x206/6:\x20Install\x20new\x20skill\x20—\x20','push','needsSkillSwap','\x20→\x20','yellow','path','utf8','\x20from\x20','fields','Step\x206/6:\x20Installing\x20new\x20skill...','246psvCWJ','Step\x205/6:\x20Remove\x20old\x20skill\x20—\x20','.cursor/rules/lovrabet_rules.mdc','Step\x201/6:\x20Migrating\x20config...','status','fail','gray','10497qaUxOQ','already\x20exists\x20(will\x20merge)','nonInteractive','info','\x20removed\x20(','no\x20legacy\x20config\x20found','failed','Config\x20file:','===\x20Upgrade\x20Analysis\x20===','configMigration','Step\x202/6:\x20.lovrabet/\x20removal\x20failed\x20—\x20','lovrabet/rabetbase\x20installed\x20globally','Step\x205/6:\x20Removing\x20old\x20skill...','inherit','files','oldMcpConfig','Proceed\x20with\x20upgrade?','red'];a69_0x218a=function(){return _0x31a5ec;};return a69_0x218a();}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a70_0x4323e0=a70_0xb9c0;(function(_0x1abbb6,_0x4015ef){const _0x1b7a49=a70_0xb9c0,_0x9f65ed=_0x1abbb6();while(!![]){try{const _0x10fbb7=parseInt(_0x1b7a49(0x113))/0x1+parseInt(_0x1b7a49(0x101))/0x2+-parseInt(_0x1b7a49(0x111))/0x3+-parseInt(_0x1b7a49(0xfc))/0x4+-parseInt(_0x1b7a49(0xe9))/0x5*(-parseInt(_0x1b7a49(0xf1))/0x6)+parseInt(_0x1b7a49(0xe5))/0x7+-parseInt(_0x1b7a49(0x118))/0x8;if(_0x10fbb7===_0x4015ef)break;else _0x9f65ed['push'](_0x9f65ed['shift']());}catch(_0xf40e42){_0x9f65ed['push'](_0x9f65ed['shift']());}}}(a70_0x50f6,0xb36b9));import{initCommand}from'./init.js';import{createCommand}from'./create.js';import{smartInitCommand}from'./smart-init.js';import{upgradeCommand}from'./project-upgrade.js';import{runCommand}from'./run.js';import{authCommand}from'./auth.js';import{logoutCommand}from'./logout.js';import{skillCommand}from'./skill.js';import{logsCommand}from'./logs.js';import{apiDefinitions}from'./api/index.js';import{bffDefinitions}from'./bff/index.js';import{sqlDefinitions}from'./sql/index.js';import{datasetDefinitions}from'./dataset/index.js';import{codegenDefinitions}from'./codegen/index.js';import{menuDefinitions}from'./menu/index.js';import{appDefinitions}from'./app/index.js';import{configDefinitions}from'./config/index.js';import{doctorDefinition}from'./doctor.js';function a70_0x50f6(){const _0x5d805c=['module','Run\x20Scripts','Install\x20developer\x20skill\x20package','logs','App\x20Management','get','command','preview','Create\x20a\x20new\x20project','5582464lliSAX','clear','login','Dataset\x20&\x20Operations','Clear\x20command\x20history\x20logs','603808NLezfc','Logs','start','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','run','View\x20command\x20history\x20logs','BFF\x20Scripts','Clear\x20login\x20session','Skills','init','Initialize\x20.rabetbase.json\x20config','show','service','auth','defaultCommand','skill','358332JdBsDx','has','445905BZADxN','write','Run\x20any\x20package.json\x20script','risk','install','367912vyiywO','Code\x20Generation','values','\x20\x20[high-risk-write]','Self\x20Update','6639983laXpEF','description','set','Authentication','10eCXwMR','API','Project','logout','project','Menu','isSingleCommand','Login\x20via\x20browser','1798728ChQNLo','push'];a70_0x50f6=function(){return _0x5d805c;};return a70_0x50f6();}function a70_0xb9c0(_0x4f1997,_0x16b815){_0x4f1997=_0x4f1997-0xe1;const _0x50f6a2=a70_0x50f6();let _0xb9c06=_0x50f6a2[_0x4f1997];return _0xb9c06;}import{updateDefinition}from'./cli-update.js';export const serviceRegistry=[];const serviceByName=new Map(),legacyHandlers=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x492d73){const _0x59ad1e=a70_0xb9c0;for(const _0x201d84 of _0x492d73){definitions[_0x59ad1e(0xe7)](_0x201d84[_0x59ad1e(0x10d)]+':'+_0x201d84[_0x59ad1e(0xf9)],_0x201d84);let _0x5bf1f3=serviceGroups[_0x59ad1e(0xf8)](_0x201d84[_0x59ad1e(0x10d)]);!_0x5bf1f3&&(_0x5bf1f3=[],serviceGroups['set'](_0x201d84[_0x59ad1e(0x10d)],_0x5bf1f3)),_0x5bf1f3[_0x59ad1e(0xf2)](_0x201d84);}}function registerDeclarativeService(_0x4e93e3,_0x714334,_0x2d987b){const _0x3fabea=a70_0xb9c0;registerDefinitions(_0x714334);const _0x2b4346=_0x5cc31b=>_0x5cc31b==='read'?'':_0x5cc31b===_0x3fabea(0x114)?'\x20\x20[write]':_0x3fabea(0xe3),_0x4385c8={'service':_0x714334[0x0]['service'],'label':_0x4e93e3,'commands':_0x714334['map'](_0x5137c2=>({'command':_0x5137c2['command'],'description':_0x5137c2[_0x3fabea(0xe6)],'tag':_0x2b4346(_0x5137c2[_0x3fabea(0x116)])})),'declarative':!![],'isSingleCommand':_0x2d987b?.[_0x3fabea(0xef)]};serviceRegistry[_0x3fabea(0xf2)](_0x4385c8),serviceByName[_0x3fabea(0xe7)](_0x4385c8['service'],_0x4385c8);}function registerLegacyService(_0x977641,_0x24a683,_0x2acb14,_0x73ef8){const _0x3f1648=a70_0xb9c0,_0x201244={'service':_0x977641,'label':_0x24a683,'commands':_0x2acb14['map'](_0x3dd9a4=>({'command':_0x3dd9a4[_0x3f1648(0xf9)],'description':_0x3dd9a4[_0x3f1648(0xe6)],'tag':''})),'declarative':![],'defaultCommand':_0x73ef8?.[_0x3f1648(0x10f)],'wildcardModule':_0x73ef8?.['wildcardModule'],'isSingleCommand':_0x73ef8?.[_0x3f1648(0xef)]};serviceRegistry[_0x3f1648(0xf2)](_0x201244),serviceByName['set'](_0x977641,_0x201244);for(const _0x31f64e of _0x2acb14){legacyHandlers[_0x3f1648(0xe7)](_0x977641+':'+_0x31f64e['command'],{'module':_0x31f64e[_0x3f1648(0xf3)]});}}registerLegacyService(a70_0x4323e0(0x10a),'Quick\x20Start',[{'command':'run','description':'Smart\x20init:\x20auto-detect,\x20upgrade,\x20or\x20select\x20app\x20from\x20platform','module':smartInitCommand}],{'defaultCommand':a70_0x4323e0(0x105),'isSingleCommand':!![]}),registerLegacyService(a70_0x4323e0(0xed),a70_0x4323e0(0xeb),[{'command':a70_0x4323e0(0x10a),'description':a70_0x4323e0(0x10b),'module':initCommand},{'command':'create','description':a70_0x4323e0(0xfb),'module':createCommand},{'command':'upgrade','description':a70_0x4323e0(0x104),'module':upgradeCommand}]),registerDeclarativeService(a70_0x4323e0(0xf7),appDefinitions),registerLegacyService('run',a70_0x4323e0(0xf4),[{'command':'<script>','description':a70_0x4323e0(0x115),'module':runCommand}],{'wildcardModule':runCommand}),registerLegacyService(a70_0x4323e0(0x10e),a70_0x4323e0(0xe8),[{'command':a70_0x4323e0(0xfe),'description':a70_0x4323e0(0xf0),'module':authCommand},{'command':a70_0x4323e0(0xec),'description':a70_0x4323e0(0x108),'module':logoutCommand}],{'defaultCommand':a70_0x4323e0(0xfe)}),registerDeclarativeService(a70_0x4323e0(0xe4),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService(a70_0x4323e0(0xea),apiDefinitions),registerDeclarativeService(a70_0x4323e0(0xee),menuDefinitions),registerDeclarativeService(a70_0x4323e0(0xff),datasetDefinitions),registerDeclarativeService(a70_0x4323e0(0x107),bffDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService(a70_0x4323e0(0xe1),codegenDefinitions),registerLegacyService('skill',a70_0x4323e0(0x109),[{'command':'install','description':a70_0x4323e0(0xf5),'module':skillCommand}]),registerLegacyService(a70_0x4323e0(0xf6),a70_0x4323e0(0x102),[{'command':a70_0x4323e0(0x10c),'description':a70_0x4323e0(0x106),'module':logsCommand},{'command':a70_0x4323e0(0xfd),'description':a70_0x4323e0(0x100),'module':logsCommand}],{'defaultCommand':a70_0x4323e0(0x10c)});export const deprecatedAliases={'create':{'service':a70_0x4323e0(0xed),'command':'create'},'start':{'service':a70_0x4323e0(0x105),'command':a70_0x4323e0(0x103)},'build':{'service':a70_0x4323e0(0x105),'command':'build'},'preview':{'service':'run','command':a70_0x4323e0(0xfa)},'logout':{'service':a70_0x4323e0(0x10e),'command':a70_0x4323e0(0xec)},'skills':{'service':a70_0x4323e0(0x110),'command':a70_0x4323e0(0x117)}};export function findDefinition(_0x436942,_0x1ed58b){return definitions['get'](_0x436942+':'+_0x1ed58b);}export function isKnownService(_0x5343bf){return serviceByName['has'](_0x5343bf);}export function isDeclarativeService(_0x3d8370){const _0x211ee5=a70_0x4323e0;return serviceGroups[_0x211ee5(0x112)](_0x3d8370);}export function getServiceEntry(_0x57b513){const _0x42157d=a70_0x4323e0;return serviceByName[_0x42157d(0xf8)](_0x57b513);}export function getLegacyHandler(_0x50dc9d,_0x1855e2){const _0x5412b3=a70_0x4323e0;return legacyHandlers[_0x5412b3(0xf8)](_0x50dc9d+':'+_0x1855e2);}export function getAllDefinitions(){const _0xeae7e3=a70_0x4323e0;return Array['from'](definitions[_0xeae7e3(0xe2)]());}
|