@lovrabet/rabetbase-cli 2.0.4-beta.5 → 2.0.5
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/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/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.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/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 -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/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/preview.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.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/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-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/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/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x317371,_0x33e92e){const _0x5e7ae6=a55_0x5e2b,_0x4c0b20=_0x317371();while(!![]){try{const _0x1f208e=-parseInt(_0x5e7ae6(0x1ad))/0x1+-parseInt(_0x5e7ae6(0x1a8))/0x2*(-parseInt(_0x5e7ae6(0x1a4))/0x3)+parseInt(_0x5e7ae6(0x1ae))/0x4*(-parseInt(_0x5e7ae6(0x1a7))/0x5)+parseInt(_0x5e7ae6(0x1b6))/0x6*(-parseInt(_0x5e7ae6(0x1a9))/0x7)+-parseInt(_0x5e7ae6(0x1b3))/0x8*(parseInt(_0x5e7ae6(0x1b0))/0x9)+parseInt(_0x5e7ae6(0x1af))/0xa*(parseInt(_0x5e7ae6(0x19f))/0xb)+parseInt(_0x5e7ae6(0x1ac))/0xc;if(_0x1f208e===_0x33e92e)break;else _0x4c0b20['push'](_0x4c0b20['shift']());}catch(_0x2dd7f7){_0x4c0b20['push'](_0x4c0b20['shift']());}}}(a55_0x1463,0x2b741));function a55_0x1463(){const _0x2b4842=['local','\x20\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform.','66ZhUEGh','\x20page(s)\x20will\x20be\x20created\x20on\x20platform:','\x20menu(s)\x20will\x20be\x20updated\x20with\x20new\x20assets:','\x20\x20\x20\x20CSS:\x20','test','183azsgGk','path','\x20\x20Affected\x20menus:\x20','21590AWqsyR','1388HoGzzj','48013VuXeav','label','\x20\x20\x20\x20JS:\x20\x20','5350152vtkDZe','61046cuvwdi','284qjXDcD','539770sOoIaQ','2150973PPTrmx','join','max','8RgJCPB','length','(unchanged)','24UkVdzk','push','\x20\x20No\x20pages\x20to\x20sync.','Menu\x20Name','repeat'];a55_0x1463=function(){return _0x2b4842;};return a55_0x1463();}function strWidth(_0x1579f1){const _0x19ea0c=a55_0x5e2b;let _0x376ec3=0x0;for(const _0x4c4aae of _0x1579f1){_0x376ec3+=/[\u4e00-\u9fa5]/[_0x19ea0c(0x1a3)](_0x4c4aae)?0x2:0x1;}return _0x376ec3;}function a55_0x5e2b(_0x594d50,_0x36c41a){_0x594d50=_0x594d50-0x19b;const _0x1463e3=a55_0x1463();let _0x5e2ba2=_0x1463e3[_0x594d50];return _0x5e2ba2;}function padRight(_0x2b7ddd,_0x44c511){const _0x305289=a55_0x5e2b,_0x403193=strWidth(_0x2b7ddd);return _0x2b7ddd+'\x20'[_0x305289(0x19c)](Math[_0x305289(0x1b2)](0x0,_0x44c511-_0x403193));}export function renderCompareTable(_0x488620,_0x25df11={}){const _0x55405e=a55_0x5e2b;if(_0x488620['length']===0x0)return'';const _0x3c9971=_0x25df11['showOnline']??!![],_0x2d5fa0=Math[_0x55405e(0x1b2)](0x1e,..._0x488620['map'](_0x51128a=>strWidth(_0x51128a[_0x55405e(0x1aa)]))),_0xd72f4a=0x4,_0x1a8c08=[],_0x25e16e='\x20\x20'+padRight(_0x55405e(0x19b),_0x2d5fa0),_0x3f7b01=padRight('Local',_0xd72f4a),_0x40f44c=_0x3c9971?'\x20\x20'+padRight('Platform',_0xd72f4a):'';_0x1a8c08[_0x55405e(0x1b7)](_0x25e16e+'\x20\x20'+_0x3f7b01+(_0x3c9971?_0x40f44c:'')),_0x1a8c08[_0x55405e(0x1b7)]('\x20\x20'+'─'[_0x55405e(0x19c)](_0x2d5fa0)+'\x20\x20'+'─'[_0x55405e(0x19c)](_0xd72f4a)+(_0x3c9971?'\x20\x20'+'─'['repeat'](_0xd72f4a):''));for(const _0x3dbc54 of _0x488620){const _0x3e0f38=padRight(_0x3dbc54[_0x55405e(0x1aa)],_0x2d5fa0),_0x1da174=_0x3dbc54[_0x55405e(0x19d)]?'✓':'✗',_0x3b6a96=padRight(_0x1da174,_0xd72f4a);let _0x48441e='\x20\x20'+_0x3e0f38+'\x20\x20'+_0x3b6a96;if(_0x3c9971){const _0x47cc2d=_0x3dbc54['online']?'✓':'✗';_0x48441e+='\x20\x20'+padRight(_0x47cc2d,_0xd72f4a);}_0x1a8c08['push'](_0x48441e);}return _0x1a8c08[_0x55405e(0x1b1)]('\x0a');}export function renderSyncSummary(_0x27110c,_0x4b3260){const _0x519a2d=a55_0x5e2b;if(_0x27110c[_0x519a2d(0x1b4)]===0x0)return _0x4b3260?_0x519a2d(0x19e):_0x519a2d(0x1b8);const _0x38b806=['\x20\x20'+_0x27110c[_0x519a2d(0x1b4)]+_0x519a2d(0x1a0)];for(const _0x53c9a8 of _0x27110c){_0x38b806[_0x519a2d(0x1b7)]('\x20\x20\x20\x20•\x20'+_0x53c9a8[_0x519a2d(0x1aa)]+'\x20('+_0x53c9a8[_0x519a2d(0x1a5)]+')');}return _0x38b806[_0x519a2d(0x1b1)]('\x0a');}export function renderUpdateSummary(_0x2515aa,_0x4fb9ca){const _0x4d7113=a55_0x5e2b;if(_0x2515aa[_0x4d7113(0x1b4)]===0x0)return'\x20\x20No\x20menus\x20with\x20existing\x20resources\x20found.';const _0x47f6b9=['\x20\x20'+_0x2515aa['length']+_0x4d7113(0x1a1),_0x4d7113(0x1ab)+(_0x4fb9ca[0x0]??_0x4d7113(0x1b5)),_0x4d7113(0x1a2)+(_0x4fb9ca[0x1]??'(unchanged)'),'',_0x4d7113(0x1a6)+_0x2515aa[_0x4d7113(0x1b1)](',\x20')];return _0x47f6b9[_0x4d7113(0x1b1)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1621f5,_0x332a13){var _0x545eb5=a56_0x954c,_0x1300ca=_0x1621f5();while(!![]){try{var _0x37382b=parseInt(_0x545eb5(0xad))/0x1*(parseInt(_0x545eb5(0xa8))/0x2)+parseInt(_0x545eb5(0xa6))/0x3*(parseInt(_0x545eb5(0xae))/0x4)+parseInt(_0x545eb5(0xa9))/0x5*(-parseInt(_0x545eb5(0xac))/0x6)+parseInt(_0x545eb5(0xa7))/0x7+-parseInt(_0x545eb5(0xa5))/0x8*(parseInt(_0x545eb5(0xa3))/0x9)+-parseInt(_0x545eb5(0xa4))/0xa*(-parseInt(_0x545eb5(0xab))/0xb)+parseInt(_0x545eb5(0xaa))/0xc;if(_0x37382b===_0x332a13)break;else _0x1300ca['push'](_0x1300ca['shift']());}catch(_0x5996eb){_0x1300ca['push'](_0x1300ca['shift']());}}}(a56_0x31a3,0x9d9ee));export*from'./types.js';function a56_0x31a3(){var _0x215aec=['129530WSSgJb','1405956dfTGGr','72578YzqhNC','138uBavST','359klLAkI','911308eKanTg','6881022sFbkiJ','1180DhqJpD','8oDifCe','9xHEnAs','303730CHiDOp','2136pXLmZF'];a56_0x31a3=function(){return _0x215aec;};return a56_0x31a3();}export*from'./logic.js';function a56_0x954c(_0x566b86,_0x1c1e9b){_0x566b86=_0x566b86-0xa3;var _0x31a3fc=a56_0x31a3();var _0x954cee=_0x31a3fc[_0x566b86];return _0x954cee;}export*from'./compare-table.js';export*from'./inquirer.js';export*from'./valid-url.js';export*from'./local-pages.js';export*from'./service.js';export*from'./sync-core.js';export*from'./update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x308665,_0x169ed0){const _0x472547=a57_0x32d9,_0x2f5a4a=_0x308665();while(!![]){try{const _0x3d86e0=-parseInt(_0x472547(0x1f8))/0x1*(-parseInt(_0x472547(0x218))/0x2)+parseInt(_0x472547(0x20f))/0x3*(-parseInt(_0x472547(0x215))/0x4)+-parseInt(_0x472547(0x1f4))/0x5+-parseInt(_0x472547(0x20d))/0x6+-parseInt(_0x472547(0x1fa))/0x7+parseInt(_0x472547(0x1f6))/0x8*(-parseInt(_0x472547(0x211))/0x9)+parseInt(_0x472547(0x207))/0xa;if(_0x3d86e0===_0x169ed0)break;else _0x2f5a4a['push'](_0x2f5a4a['shift']());}catch(_0x54e8a8){_0x2f5a4a['push'](_0x2f5a4a['shift']());}}}(a57_0x3023,0x8d111));function a57_0x32d9(_0x14643d,_0x4d5bc2){_0x14643d=_0x14643d-0x1f4;const _0x3023e3=a57_0x3023();let _0x32d90e=_0x3023e3[_0x14643d];return _0x32d90e;}function a57_0x3023(){const _0x8f8e0e=['catch','16KYyRgs','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','440830IMDoyH','trim','6598011RSPgCt','filter','No\x20local\x20pages\x20found.','test','[already\x20on\x20platform]','\x20\x20CSS\x20URL:','start','label','succeed','fail','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','cancelled','21837420lUupqK','\x20\x20Checking\x20JS\x20URL\x20reachability...','stdin','No\x20menus\x20selected.','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','JS\x20URL\x20check\x20failed','542094VvraPs','length','192243eDKDSn','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','1780227zRrSmL','ExitPromptError','red','path','44jdKNhB','has','map','4liLOHK','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','name','includes','error','CSS\x20URL\x20checked','Cancelled.','1770870odXweb'];a57_0x3023=function(){return _0x8f8e0e;};return a57_0x3023();}import a57_0x59a99a from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a57_0x42ea2f from'ora';import{isUrlReachable}from'./valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x37d75f){const _0x48cee0=a57_0x32d9;return _0x37d75f[_0x48cee0(0x1f5)](_0x32b2b2=>{const _0x2e0199=_0x48cee0;if(_0x32b2b2?.[_0x2e0199(0x21a)]===_0x2e0199(0x212))throw CliErrors['cancelled'](_0x2e0199(0x21e));throw _0x32b2b2;});}export function startSpinner(_0x170060){const _0x4e7dde=a57_0x32d9;return a57_0x42ea2f({'text':_0x170060,'color':'cyan'})[_0x4e7dde(0x200)]();}export function stopSpinner(_0x38a345,_0x386ace,_0x46d1e7){const _0x389ba2=a57_0x32d9;_0x46d1e7?_0x38a345[_0x389ba2(0x202)](_0x386ace):_0x38a345[_0x389ba2(0x203)](_0x386ace);}export async function askConfirm(_0x4b1472){return onCancel(confirm({'message':_0x4b1472,'theme':{'prefix':''}}));}export async function askJsUrl(_0x1a2de4){const _0x45ea2d=a57_0x32d9;while(!![]){const _0x1f1c4a=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x1a2de4,'theme':{'prefix':''}}));if(_0x1f1c4a[_0x45ea2d(0x1f9)]()==='')throw CliErrors[_0x45ea2d(0x206)](_0x45ea2d(0x21e));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x45ea2d(0x1fd)](_0x1f1c4a['trim']())){console['error'](a57_0x59a99a['red'](_0x45ea2d(0x204)));continue;}const _0x4c990c=startSpinner(_0x45ea2d(0x208));try{const _0x56f314=await isUrlReachable(_0x1f1c4a[_0x45ea2d(0x1f9)]());stopSpinner(_0x4c990c,'JS\x20URL\x20checked',_0x56f314);if(!_0x56f314){console[_0x45ea2d(0x21c)](a57_0x59a99a[_0x45ea2d(0x213)](_0x45ea2d(0x205)));continue;}return _0x1f1c4a[_0x45ea2d(0x1f9)]();}catch(_0x5cc3f7){stopSpinner(_0x4c990c,_0x45ea2d(0x20c),![]);throw _0x5cc3f7;}}}export async function askCssUrl(_0x1d49ce){const _0x474a1a=a57_0x32d9;while(!![]){const _0x4c1da1=await onCancel(input({'message':_0x474a1a(0x1ff),'default':_0x1d49ce,'theme':{'prefix':''}}));if(_0x4c1da1[_0x474a1a(0x1f9)]()==='')throw CliErrors[_0x474a1a(0x206)]('Cancelled.');if(!/^https:\/\/.+\.css(\?.*)?$/[_0x474a1a(0x1fd)](_0x4c1da1['trim']())){console['error'](a57_0x59a99a[_0x474a1a(0x213)](_0x474a1a(0x219)));continue;}const _0x56e468=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x5ce126=await isUrlReachable(_0x4c1da1[_0x474a1a(0x1f9)]());stopSpinner(_0x56e468,_0x474a1a(0x21d),_0x5ce126);if(!_0x5ce126){console['error'](a57_0x59a99a[_0x474a1a(0x213)](_0x474a1a(0x1f7)));continue;}return _0x4c1da1[_0x474a1a(0x1f9)]();}catch(_0x4e7727){stopSpinner(_0x56e468,'CSS\x20URL\x20check\x20failed',![]);throw _0x4e7727;}}}export async function selectPages(_0x1fb66c,_0x43508e,_0x47392b){const _0x4bbf83=a57_0x32d9,_0x62911c=_0x1fb66c[_0x4bbf83(0x217)](_0xddc5f5=>({'name':_0xddc5f5['label']+'\x20\x20'+(_0x43508e['has'](_0xddc5f5[_0x4bbf83(0x214)])?a57_0x59a99a['gray'](_0x4bbf83(0x1fe)):a57_0x59a99a['green']('[new]')),'value':_0xddc5f5[_0x4bbf83(0x201)],'checked':_0x47392b?_0x47392b[_0x4bbf83(0x21b)](_0xddc5f5[_0x4bbf83(0x201)]):!_0x43508e[_0x4bbf83(0x216)](_0xddc5f5[_0x4bbf83(0x214)])}));if(_0x62911c['length']===0x0)throw new Error(_0x4bbf83(0x1fc));const _0x32e1e2=await onCancel(checkbox({'message':_0x4bbf83(0x210),'choices':_0x62911c,'loop':![],'theme':{'prefix':''}}));if(_0x32e1e2[_0x4bbf83(0x20e)]===0x0)throw new Error(_0x4bbf83(0x20a));return _0x1fb66c[_0x4bbf83(0x1fb)](_0xd79e29=>_0x32e1e2['includes'](_0xd79e29[_0x4bbf83(0x201)]));}export function isInteractive(){const _0x198d40=a57_0x32d9;return process[_0x198d40(0x209)]['isTTY']===!![];}export function requireInteractive(){const _0x4fa5c9=a57_0x32d9;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0x4fa5c9(0x20b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a58_0x12b2e6=a58_0x10c1;(function(_0x5e72d3,_0x3251bb){const _0x59099c=a58_0x10c1,_0x53e4d5=_0x5e72d3();while(!![]){try{const _0x160037=-parseInt(_0x59099c(0x184))/0x1*(-parseInt(_0x59099c(0x189))/0x2)+parseInt(_0x59099c(0x188))/0x3*(parseInt(_0x59099c(0x190))/0x4)+parseInt(_0x59099c(0x180))/0x5+-parseInt(_0x59099c(0x18d))/0x6+parseInt(_0x59099c(0x18e))/0x7+parseInt(_0x59099c(0x17c))/0x8*(-parseInt(_0x59099c(0x17b))/0x9)+-parseInt(_0x59099c(0x191))/0xa;if(_0x160037===_0x3251bb)break;else _0x53e4d5['push'](_0x53e4d5['shift']());}catch(_0xc64c5d){_0x53e4d5['push'](_0x53e4d5['shift']());}}}(a58_0x5349,0xa1f0d));function a58_0x10c1(_0x2ea1cf,_0x589b47){_0x2ea1cf=_0x2ea1cf-0x17b;const _0x5349a8=a58_0x5349();let _0x10c130=_0x5349a8[_0x2ea1cf];return _0x10c130;}import{readdirSync,statSync,readFileSync}from'fs';function a58_0x5349(){const _0x467e3c=['forEach','join','match','2xQtNlw','split','push','slice','3521319rYWmFO','382218ESRBgu','utf-8','index.tsx','.tsx','3386034cJZHaE','2268560fHhian','path','4BXFFtF','6582110tfLMQo','trim','replace','replaceAll','216cZwCJk','167512CeCYWi','src/pages','endsWith','filter','2541620WJYZKP'];a58_0x5349=function(){return _0x467e3c;};return a58_0x5349();}import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process['cwd'](),a58_0x12b2e6(0x17d));export function extractTitleFromComment(_0x427e47){const _0x1ad1c1=a58_0x12b2e6;try{const _0x2c66fc=readFileSync(_0x427e47,_0x1ad1c1(0x18a)),_0x362b84=_0x2c66fc[_0x1ad1c1(0x183)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x362b84&&_0x362b84[0x1]){const _0x2e0261=_0x362b84[0x1],_0x26a657=_0x2e0261[_0x1ad1c1(0x183)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x26a657&&_0x26a657[0x1])return _0x26a657[0x1][_0x1ad1c1(0x192)]();}let _0x264828=null;const _0x2140ec=_0x2c66fc['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x2140ec&&_0x2140ec[0x1]&&(_0x264828=_0x2140ec[0x1]);if(!_0x264828){const _0x3c78a4=_0x2c66fc['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x3c78a4&&_0x3c78a4[0x1]&&(_0x264828=_0x3c78a4[0x1]);}if(_0x264828){const _0x1417cc=new RegExp('\x5cb'+_0x264828+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x155e0d=_0x2c66fc['match'](_0x1417cc);if(_0x155e0d&&_0x155e0d[0x1])return _0x155e0d[0x1];return _0x264828;}return null;}catch(_0x1e4023){return null;}}export function getLocalPages(_0x4a3d8d=pagesDir,_0x381b54=pagesDir){const _0x5731ff=a58_0x12b2e6;let _0x4be791=[];const _0x929fee=readdirSync(_0x4a3d8d);return _0x929fee[_0x5731ff(0x181)](_0x4a6b01=>{const _0x6885cc=_0x5731ff,_0x57d501=join(_0x4a3d8d,_0x4a6b01),_0x1687ea=statSync(_0x57d501);if(_0x1687ea&&_0x1687ea['isDirectory']())_0x4be791=_0x4be791['concat'](getLocalPages(_0x57d501,_0x381b54));else{if(_0x4a6b01[_0x6885cc(0x17e)](_0x6885cc(0x18c))){let _0x9c141b=relative(_0x381b54,_0x57d501);_0x9c141b[_0x6885cc(0x17e)](_0x6885cc(0x18b))?_0x9c141b=_0x9c141b[_0x6885cc(0x193)](/index\.tsx$/,''):_0x9c141b=_0x9c141b['replace'](/\.tsx$/,'');_0x9c141b[_0x6885cc(0x17e)](sep)&&(_0x9c141b=_0x9c141b[_0x6885cc(0x187)](0x0,-0x1));const _0x25e6a4=_0x9c141b[_0x6885cc(0x185)](sep)[_0x6885cc(0x182)]('/'),_0x482ffe=extractTitleFromComment(_0x57d501),_0x88cc4a=_0x482ffe||_0x25e6a4;_0x4be791[_0x6885cc(0x186)]({'path':_0x25e6a4[_0x6885cc(0x194)]('$',':'),'label':_0x88cc4a});}}}),_0x4be791[_0x5731ff(0x17f)](_0x10a1c1=>_0x10a1c1[_0x5731ff(0x18f)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x511265,_0x10739d){const _0x5b6bf4=a59_0x3cb6,_0x4b89ec=_0x511265();while(!![]){try{const _0x139c38=-parseInt(_0x5b6bf4(0x112))/0x1+-parseInt(_0x5b6bf4(0x116))/0x2*(-parseInt(_0x5b6bf4(0x115))/0x3)+-parseInt(_0x5b6bf4(0x11d))/0x4*(parseInt(_0x5b6bf4(0x11e))/0x5)+-parseInt(_0x5b6bf4(0x11c))/0x6*(-parseInt(_0x5b6bf4(0x124))/0x7)+-parseInt(_0x5b6bf4(0x120))/0x8*(-parseInt(_0x5b6bf4(0x11a))/0x9)+-parseInt(_0x5b6bf4(0x113))/0xa*(-parseInt(_0x5b6bf4(0x117))/0xb)+parseInt(_0x5b6bf4(0x10d))/0xc;if(_0x139c38===_0x10739d)break;else _0x4b89ec['push'](_0x4b89ec['shift']());}catch(_0x2cb130){_0x4b89ec['push'](_0x4b89ec['shift']());}}}(a59_0x5463,0x4a6ca));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';export function validateJsUrl(_0x336168){const _0x2a11e5=a59_0x3cb6,_0x28cef3=[];return!isValidJsHttpsUrl(_0x336168)&&_0x28cef3['push']('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x28cef3[_0x2a11e5(0x119)]===0x0,'errors':_0x28cef3};}export function validateCssUrl(_0x538e46){const _0x55cd12=a59_0x3cb6,_0x124e67=[];return!isValidCssHttpsUrl(_0x538e46)&&_0x124e67[_0x55cd12(0x129)](_0x55cd12(0x111)),{'ok':_0x124e67['length']===0x0,'errors':_0x124e67};}function a59_0x3cb6(_0x323cb9,_0x43096b){_0x323cb9=_0x323cb9-0x10c;const _0x5463da=a59_0x5463();let _0x3cb63e=_0x5463da[_0x323cb9];return _0x3cb63e;}export async function validateJsUrlReachable(_0x25e8d9){const _0x560bbc=a59_0x3cb6,_0x2f121b=validateJsUrl(_0x25e8d9);if(!_0x2f121b['ok'])return _0x2f121b;const _0x5fb37b=await isUrlReachable(_0x25e8d9);if(!_0x5fb37b)_0x2f121b['errors'][_0x560bbc(0x129)](_0x560bbc(0x123));return{'ok':_0x2f121b[_0x560bbc(0x11f)][_0x560bbc(0x119)]===0x0,'errors':_0x2f121b[_0x560bbc(0x11f)]};}export async function validateCssUrlReachable(_0x42a01e){const _0x499f37=a59_0x3cb6,_0x290881=validateCssUrl(_0x42a01e);if(!_0x290881['ok'])return _0x290881;const _0x29131f=await isUrlReachable(_0x42a01e);if(!_0x29131f)_0x290881[_0x499f37(0x11f)][_0x499f37(0x129)](_0x499f37(0x118));return{'ok':_0x290881['errors'][_0x499f37(0x119)]===0x0,'errors':_0x290881[_0x499f37(0x11f)]};}export function buildCompareRows(_0x4a3a71,_0x15b50e){const _0x1cdfe1=a59_0x3cb6;return _0x4a3a71['map'](_0x31bcb7=>({'label':_0x31bcb7[_0x1cdfe1(0x10e)],'path':_0x31bcb7['path'],'local':!![],'online':_0x15b50e[_0x1cdfe1(0x114)](_0x31bcb7[_0x1cdfe1(0x126)])}));}function a59_0x5463(){const _0x132c65=['CSS\x20URL\x20is\x20unreachable','length','871092nqijec','find','157986HsTRjr','775412PibeZu','15FLRRuX','errors','8qFDiGG','No\x20local\x20pages\x20matched\x20labels:\x20','resources','JS\x20URL\x20is\x20unreachable','21ixgcDp','filter','path','map','allSettled','push','trim','5974776XGclDY','label','join','status','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','306967bOqewO','40LFvNiP','has','49563HzzgHQ','58eXJpaL','111595nHRosi'];a59_0x5463=function(){return _0x132c65;};return a59_0x5463();}export function filterNewPages(_0x1b906d,_0x51d9ef,_0x2a94f5){const _0x48141f=a59_0x3cb6;if(_0x2a94f5&&_0x2a94f5[_0x48141f(0x119)]>0x0){const _0x3fddca=new Set(_0x2a94f5['map'](_0x725436=>_0x725436['trim']())),_0xed9875=_0x1b906d[_0x48141f(0x125)](_0x1b3e2b=>_0x3fddca[_0x48141f(0x114)](_0x1b3e2b[_0x48141f(0x10e)]));if(_0xed9875['length']===0x0)throw new Error(_0x48141f(0x121)+[..._0x3fddca][_0x48141f(0x10f)](',\x20'));return _0xed9875;}return _0x1b906d['filter'](_0x4fe1d5=>!_0x51d9ef['has'](_0x4fe1d5['path']));}export function filterPagesByLabels(_0x542047,_0xa58ed6){const _0x333124=a59_0x3cb6,_0x446e10=[],_0x3d7a5e=[];for(const _0x4dc501 of _0xa58ed6){const _0x4c1e57=_0x4dc501[_0x333124(0x10c)](),_0x345302=_0x542047[_0x333124(0x11b)](_0x279d46=>_0x279d46['label']===_0x4c1e57);if(_0x345302)_0x446e10['push'](_0x345302);else _0x3d7a5e[_0x333124(0x129)](_0x4dc501);}return{'matched':_0x446e10,'unmatched':_0x3d7a5e};}export async function doCreateMenus(_0x446c53,_0xb91989,_0x3763da,_0x59f9bc){const _0x3ffc2b=a59_0x3cb6;return await createMenus(_0x446c53,_0xb91989,_0x3763da,_0x59f9bc),{'created':_0x3763da['length'],'failed':0x0,'labels':_0x3763da[_0x3ffc2b(0x127)](_0x490607=>_0x490607[_0x3ffc2b(0x10e)])};}export function filterMenusWithResources(_0x213f40){const _0x2129b2=a59_0x3cb6;return _0x213f40[_0x2129b2(0x125)](_0x1e5ed7=>_0x1e5ed7[_0x2129b2(0x122)][_0x2129b2(0x119)]>0x0);}export async function doUpdateCdnUrls(_0x572672,_0x1f946b,_0x4a9b37,_0x47e7b4){const _0x53bdab=a59_0x3cb6,_0x5be183=_0x4a9b37[_0x53bdab(0x125)](_0xf011ff=>_0xf011ff[_0x53bdab(0x122)][_0x53bdab(0x119)]>0x0),_0x190007=await Promise[_0x53bdab(0x128)](_0x5be183[_0x53bdab(0x127)](_0x55fb91=>updateMenuCdnUrl(_0x572672,_0x1f946b,{'id':_0x55fb91['id'],'label':_0x55fb91['label'],'path':_0x55fb91[_0x53bdab(0x126)],'resources':_0x47e7b4}))),_0x3a8888=_0x190007[_0x53bdab(0x125)](_0x452d33=>_0x452d33[_0x53bdab(0x110)]==='rejected')['length'];return{'updated':_0x5be183[_0x53bdab(0x119)]-_0x3a8888,'failed':_0x3a8888};}export async function fetchMenuData(_0x197573,_0x5d7456){const _0x2ebf42=a59_0x3cb6,_0x22aed7=getLocalPages(),_0xd147d0=await getOnlineMenuList(_0x197573,_0x5d7456),_0x14d327=new Set(_0xd147d0[_0x2ebf42(0x127)](_0x3e0eba=>_0x3e0eba[_0x2ebf42(0x126)]));return{'localPages':_0x22aed7,'onlineMenuList':_0xd147d0,'onlinePaths':_0x14d327};}export async function fetchOnlineMenuList(_0x1c79f7,_0xb21f83){return getOnlineMenuList(_0x1c79f7,_0xb21f83);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19a609,_0x350d9a){const _0x38c1b6=a60_0x16bb,_0x2e069f=_0x19a609();while(!![]){try{const _0xd1b649=-parseInt(_0x38c1b6(0x1f3))/0x1+-parseInt(_0x38c1b6(0x1f9))/0x2+-parseInt(_0x38c1b6(0x207))/0x3*(parseInt(_0x38c1b6(0x201))/0x4)+-parseInt(_0x38c1b6(0x200))/0x5*(parseInt(_0x38c1b6(0x1f7))/0x6)+-parseInt(_0x38c1b6(0x213))/0x7+parseInt(_0x38c1b6(0x205))/0x8+parseInt(_0x38c1b6(0x204))/0x9;if(_0xd1b649===_0x350d9a)break;else _0x2e069f['push'](_0x2e069f['shift']());}catch(_0x561e0f){_0x2e069f['push'](_0x2e069f['shift']());}}}(a60_0x1cc7,0x2561b));import{getApiDomain}from'../../../constant/domain.js';function a60_0x1cc7(){const _0x26b261=['info','Menu\x20created\x20successfully:\x20','Menu\x20assets\x20synced:\x20','resources','/smartapi/menu/create','flat','map','children','extend','Updating\x20menu\x20asset\x20links:\x20','/smartapi/menu/update','260071nuNbql','isArray','Create\x20menu\x20\x22','Fetched\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','get-online-menu-list','\x20online\x20menus\x20successfully','create-menu','update-menu-cdn-url','236058CSlIrY','push','import','create-menus','18qXaQcA','stringify','603570BiZuif','label','online','path','length','Creating\x20menu:\x20','parse','59545jXxWnv','12LBnqpY','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','POST','6905547xKuyGY','403408OrhGui','Server\x20returned\x20empty\x20menu\x20list','53871aZdYgx'];a60_0x1cc7=function(){return _0x26b261;};return a60_0x1cc7();}import{getEnv}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{platformFetch}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x59f7d8,_0x55036d){const _0x3b805a=a60_0x16bb,_0x84994e=getEnv();logger[_0x3b805a(0x208)](_0x3b805a(0x218),_0x84994e===_0x3b805a(0x1fb)?_0x3b805a(0x217)+_0x59f7d8+')':_0x3b805a(0x202)+_0x59f7d8+')');const _0x323d11=await platformFetch(getApiDomain()+'/smartapi/menu/find?appCode='+_0x59f7d8,{'cookie':_0x55036d,'label':'Fetch\x20menu\x20list'});if(!_0x323d11)return logger[_0x3b805a(0x208)]('get-online-menu-list',_0x3b805a(0x206)),[];return logger[_0x3b805a(0x208)]('get-online-menu-list',_0x3b805a(0x216)+_0x323d11['length']+_0x3b805a(0x219)),_0x323d11[_0x3b805a(0x20e)](flattenMenuItem)[_0x3b805a(0x20d)]();}function flattenMenuItem(_0x285f2f){const _0x88b34e=a60_0x16bb;let _0x1001ed=[];try{if(_0x285f2f[_0x88b34e(0x210)]?.[_0x88b34e(0x20b)]){const _0x24ec88=JSON[_0x88b34e(0x1ff)](_0x285f2f[_0x88b34e(0x210)][_0x88b34e(0x20b)]);if(Array[_0x88b34e(0x214)](_0x24ec88))_0x1001ed=_0x24ec88;}}catch{}const _0x392602=[{'id':_0x285f2f['id'],'path':_0x285f2f['path'],'label':_0x285f2f[_0x88b34e(0x1fa)],'resources':_0x1001ed}];if(_0x285f2f['children']&&_0x285f2f[_0x88b34e(0x20f)][_0x88b34e(0x1fd)]>0x0)for(const _0x231d49 of _0x285f2f[_0x88b34e(0x20f)]){_0x392602[_0x88b34e(0x1f4)](...flattenMenuItem(_0x231d49));}return _0x392602;}export async function createMenu(_0x7997ce,_0x40c9fd,_0x4ba00a){const _0x1428fc=a60_0x16bb;logger[_0x1428fc(0x208)](_0x1428fc(0x21a),_0x1428fc(0x1fe)+_0x4ba00a[_0x1428fc(0x1fa)]+'\x20('+_0x4ba00a[_0x1428fc(0x1fc)]+')');const _0xf455f8={'appCode':_0x7997ce,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x1428fc(0x1f5),'resources':_0x4ba00a['resources']?JSON[_0x1428fc(0x1f8)](_0x4ba00a[_0x1428fc(0x20b)]):undefined},..._0x4ba00a};await platformFetch(getApiDomain()+_0x1428fc(0x20c),{'method':_0x1428fc(0x203),'body':_0xf455f8,'cookie':_0x40c9fd,'label':_0x1428fc(0x215)+_0x4ba00a[_0x1428fc(0x1fa)]+'\x22'}),logger[_0x1428fc(0x208)](_0x1428fc(0x21a),_0x1428fc(0x209)+_0x4ba00a[_0x1428fc(0x1fa)]);}async function createSingleMenu(_0x27563f,_0x5ad685,_0x12446d,_0x5095bf){const _0xbf0884=a60_0x16bb,_0x111d4b={'appCode':_0x27563f,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0xbf0884(0x1f5),'resources':_0x5095bf?JSON[_0xbf0884(0x1f8)](_0x5095bf):undefined},'label':_0x12446d[_0xbf0884(0x1fa)],'path':_0x12446d[_0xbf0884(0x1fc)]};await platformFetch(getApiDomain()+_0xbf0884(0x20c),{'method':_0xbf0884(0x203),'body':_0x111d4b,'cookie':_0x5ad685,'label':_0xbf0884(0x215)+_0x12446d[_0xbf0884(0x1fa)]+'\x22'}),logger['info'](_0xbf0884(0x21a),_0xbf0884(0x209)+_0x12446d[_0xbf0884(0x1fa)]);}export async function createMenus(_0x219894,_0x8fc1b4,_0x350f51,_0x55638c){const _0x4d90dd=a60_0x16bb;logger[_0x4d90dd(0x208)](_0x4d90dd(0x1f6),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x350f51[_0x4d90dd(0x1fd)]),await Promise['all'](_0x350f51[_0x4d90dd(0x20e)](_0x311a31=>createSingleMenu(_0x219894,_0x8fc1b4,_0x311a31,_0x55638c))),logger['info'](_0x4d90dd(0x1f6),'Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x350f51[_0x4d90dd(0x1fd)]);}function a60_0x16bb(_0x3ca60a,_0x4eb33c){_0x3ca60a=_0x3ca60a-0x1f2;const _0x1cc7d7=a60_0x1cc7();let _0x16bb3a=_0x1cc7d7[_0x3ca60a];return _0x16bb3a;}export async function updateMenuCdnUrl(_0x5db536,_0x1dee54,_0x41ef61){const _0x4771db=a60_0x16bb;logger[_0x4771db(0x208)](_0x4771db(0x1f2),_0x4771db(0x211)+_0x41ef61[_0x4771db(0x1fa)]+'\x20('+_0x41ef61[_0x4771db(0x1fc)]+')');const _0xe1cc97={'id':_0x41ef61['id'],'appCode':_0x5db536,'extend':{'loadScriptMode':_0x4771db(0x1f5),'resources':_0x41ef61['resources']?JSON['stringify'](_0x41ef61[_0x4771db(0x20b)]):undefined}};await platformFetch(getApiDomain()+_0x4771db(0x212),{'method':_0x4771db(0x203),'body':_0xe1cc97,'cookie':_0x1dee54,'label':'Update\x20menu\x20assets\x20\x22'+_0x41ef61[_0x4771db(0x1fa)]+'\x22'}),logger['info'](_0x4771db(0x1f2),_0x4771db(0x20a)+_0x41ef61[_0x4771db(0x1fa)],undefined);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c18b6,_0x4dc5b5){const _0x189046=a61_0x376b,_0x28b4ec=_0x2c18b6();while(!![]){try{const _0x42d670=parseInt(_0x189046(0x10a))/0x1+parseInt(_0x189046(0x120))/0x2*(parseInt(_0x189046(0x10b))/0x3)+parseInt(_0x189046(0x127))/0x4+-parseInt(_0x189046(0x132))/0x5*(parseInt(_0x189046(0x130))/0x6)+parseInt(_0x189046(0x121))/0x7*(-parseInt(_0x189046(0x131))/0x8)+-parseInt(_0x189046(0x10c))/0x9+parseInt(_0x189046(0x133))/0xa;if(_0x42d670===_0x4dc5b5)break;else _0x28b4ec['push'](_0x28b4ec['shift']());}catch(_0x5ab048){_0x28b4ec['push'](_0x28b4ec['shift']());}}}(a61_0x2c30,0x5ef72));import{getLocalPages}from'./local-pages.js';function a61_0x376b(_0x3a83cb,_0x498577){_0x3a83cb=_0x3a83cb-0x109;const _0x2c3032=a61_0x2c30();let _0x376b93=_0x2c3032[_0x3a83cb];return _0x376b93;}import{getOnlineMenuList,createMenus}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x5f32a4){const _0x2d59b7=a61_0x376b,_0x547d4c=[];return _0x5f32a4[_0x2d59b7(0x12e)]&&!isValidJsHttpsUrl(_0x5f32a4[_0x2d59b7(0x12e)])&&_0x547d4c[_0x2d59b7(0x134)]({'field':_0x2d59b7(0x12e),'message':_0x2d59b7(0x11b)}),_0x5f32a4[_0x2d59b7(0x11c)]&&!isValidCssHttpsUrl(_0x5f32a4[_0x2d59b7(0x11c)])&&_0x547d4c[_0x2d59b7(0x134)]({'field':_0x2d59b7(0x11c),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x547d4c;}export async function runMenuSyncCore(_0x48d8ff,_0xa428d8,_0x51f6c3=[],_0x20dfdd){const _0x47530f=a61_0x376b,_0x5ea110=parseParamsFlag(_0x20dfdd),_0x5a8d08=_0x51f6c3[_0x47530f(0x12a)]>0x0?_0x51f6c3:_0x5ea110[_0x47530f(0x12d)],_0x37281c=_0x5ea110['jsUrl'],_0x1a495b=_0x5ea110[_0x47530f(0x11c)],_0x275a4d=[];if(_0x37281c)_0x275a4d['push'](_0x37281c);if(_0x1a495b)_0x275a4d[_0x47530f(0x134)](_0x1a495b);const _0x14b873=validateParams(_0x5ea110);if(_0x14b873['length']>0x0){const _0x1fef98=_0x14b873['map'](_0x2a86a6=>_0x47530f(0x12f)+_0x2a86a6[_0x47530f(0x10f)]+':\x20'+_0x2a86a6[_0x47530f(0x118)])[_0x47530f(0x122)](';\x20');throw new Error(_0x47530f(0x117)+_0x1fef98);}logger[_0x47530f(0x124)](process[_0x47530f(0x10e)]()),logger[_0x47530f(0x110)](_0x47530f(0x12c),_0x47530f(0x119),{'appCode':_0x48d8ff,'selectedCount':_0x5a8d08?.[_0x47530f(0x12a)],'jsUrl':_0x37281c,'cssUrl':_0x1a495b});if(_0x37281c){const _0x2c4faa=await isUrlReachable(_0x37281c);if(!_0x2c4faa)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x37281c);}if(_0x1a495b){const _0x16ac7e=await isUrlReachable(_0x1a495b);if(!_0x16ac7e)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x1a495b);}const _0x513d2b=getLocalPages();if(_0x513d2b['length']===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x45c899=await getOnlineMenuList(_0x48d8ff,_0xa428d8),_0x230ee7=new Set(_0x45c899['map'](_0x44acc0=>_0x44acc0[_0x47530f(0x12b)]));let _0x5467cf;if(_0x5a8d08&&_0x5a8d08['length']>0x0){const _0x1807c8=new Set(_0x5a8d08[_0x47530f(0x125)](_0x46fdd6=>_0x46fdd6[_0x47530f(0x11d)]()));_0x5467cf=_0x513d2b[_0x47530f(0x11a)](_0x2ad9e4=>_0x1807c8[_0x47530f(0x113)](_0x2ad9e4[_0x47530f(0x129)]));if(_0x5467cf[_0x47530f(0x12a)]===0x0){const _0x25589d=_0x513d2b[_0x47530f(0x125)](_0x45bb55=>_0x45bb55[_0x47530f(0x129)])[_0x47530f(0x122)](',\x20');throw new Error(_0x47530f(0x11f)+[..._0x1807c8][_0x47530f(0x122)](',\x20')+_0x47530f(0x126)+_0x25589d);}}else _0x5467cf=_0x513d2b[_0x47530f(0x11a)](_0x1793d9=>!_0x230ee7['has'](_0x1793d9[_0x47530f(0x12b)]));if(_0x5467cf[_0x47530f(0x12a)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x48d8ff,_0xa428d8,_0x5467cf,_0x275a4d[_0x47530f(0x12a)]>0x0?_0x275a4d:undefined),logger['info']('menu-sync',_0x47530f(0x10d),{'count':_0x5467cf[_0x47530f(0x12a)],'resources':_0x275a4d}),{'created':_0x5467cf[_0x47530f(0x12a)],'skipped':![],'targetPages':_0x5467cf};}function a61_0x2c30(){const _0x421703=['data','Invalid\x20--params:\x20','message','Start\x20non-interactive\x20menu\x20sync','filter','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','cssUrl','trim','object','No\x20local\x20pages\x20matched\x20labels:\x20','2QpAnOM','3668189HwGqfb','join','end','setLogPath','map','\x0a\x20\x20Available\x20local\x20pages:\x20','768956HUglTc','split','label','length','path','menu-sync','selectedLabels','jsUrl','--params.','8622UxbOiE','8cpBEKV','305GkBhys','4730690xHCxCa','push','concat','string','262946IOYtNj','590007hADSMB','1118349aOoKPv','Menu\x20sync\x20completed','cwd','field','info','parse','readableEnded','has','stdin','pages'];a61_0x2c30=function(){return _0x421703;};return a61_0x2c30();}export async function readPageLabelsFromStdin(){const _0xb2b273=a61_0x376b;if(!process[_0xb2b273(0x114)]['isTTY']&&!process[_0xb2b273(0x114)][_0xb2b273(0x112)])return new Promise(_0x595947=>{const _0x17c480=_0xb2b273,_0x1aa641=[];process[_0x17c480(0x114)]['on'](_0x17c480(0x116),_0x457596=>_0x1aa641['push'](_0x457596)),process['stdin']['on'](_0x17c480(0x123),()=>{const _0x3d3f65=_0x17c480,_0x31bccc=Buffer[_0x3d3f65(0x135)](_0x1aa641)['toString']('utf8'),_0x25bd18=_0x31bccc[_0x3d3f65(0x128)]('\x0a')[_0x3d3f65(0x125)](_0x2ebaa1=>_0x2ebaa1['trim']())[_0x3d3f65(0x11a)](_0x4f222b=>_0x4f222b[_0x3d3f65(0x12a)]>0x0&&!_0x4f222b['startsWith']('#'));_0x595947(_0x25bd18);}),setTimeout(()=>_0x595947([]),0x1f4);});return[];}function parseParamsFlag(_0x53df67){const _0x300de6=a61_0x376b;if(!_0x53df67||typeof _0x53df67!==_0x300de6(0x109))return{};try{const _0x4d1b69=JSON[_0x300de6(0x111)](_0x53df67);if(typeof _0x4d1b69!==_0x300de6(0x11e)||_0x4d1b69===null||Array['isArray'](_0x4d1b69))return{};return{'selectedLabels':Array['isArray'](_0x4d1b69[_0x300de6(0x115)])?_0x4d1b69['pages'][_0x300de6(0x125)](String):undefined,'jsUrl':typeof _0x4d1b69[_0x300de6(0x12e)]===_0x300de6(0x109)?_0x4d1b69[_0x300de6(0x12e)]['trim']():undefined,'cssUrl':typeof _0x4d1b69[_0x300de6(0x11c)]==='string'?_0x4d1b69[_0x300de6(0x11c)][_0x300de6(0x11d)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a63_0x2a33(_0x1aa543,_0x7979e4){_0x1aa543=_0x1aa543-0x69;const _0x460023=a63_0x4600();let _0x2a33d5=_0x460023[_0x1aa543];return _0x2a33d5;}(function(_0x3f1308,_0x25b855){const _0x1eaa25=a63_0x2a33,_0x479419=_0x3f1308();while(!![]){try{const _0x5b5153=parseInt(_0x1eaa25(0x77))/0x1*(-parseInt(_0x1eaa25(0x7f))/0x2)+-parseInt(_0x1eaa25(0x8e))/0x3+-parseInt(_0x1eaa25(0x8a))/0x4*(-parseInt(_0x1eaa25(0x6a))/0x5)+-parseInt(_0x1eaa25(0x6b))/0x6+parseInt(_0x1eaa25(0x80))/0x7+parseInt(_0x1eaa25(0x7e))/0x8*(-parseInt(_0x1eaa25(0x76))/0x9)+parseInt(_0x1eaa25(0x88))/0xa*(parseInt(_0x1eaa25(0x70))/0xb);if(_0x5b5153===_0x25b855)break;else _0x479419['push'](_0x479419['shift']());}catch(_0x3bb48a){_0x479419['push'](_0x479419['shift']());}}}(a63_0x4600,0xf205c));import{updateMenuCdnUrl,getOnlineMenuList}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a63_0x4600(){const _0x8153c1=['5056689XJdpWm','isArray','--params.','jsUrl','allSettled','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','18FPOQDx','437908SPXPJr','string','menu-update','Invalid\x20--params:\x20','Start\x20non-interactive\x20menu\x20update','filter','label','225616JCIbJG','6yDpXYI','12122096NPWbFC','field','parse','resources','setLogPath','status','map','CSS\x20URL\x20is\x20unreachable:\x20','20ONXRjO','JS\x20URL\x20is\x20unreachable:\x20','5097452QkeJEF','info','rejected','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','321576bwjkcd','push','cssUrl','trim','5eHWJKp','8741070pOCiUw','join','length','cwd','object'];a63_0x4600=function(){return _0x8153c1;};return a63_0x4600();}import{logger}from'../../../utils/logger.js';function validateParams(_0x533465){const _0x174f28=a63_0x2a33,_0x25af4d=[];return _0x533465[_0x174f28(0x73)]&&!isValidJsHttpsUrl(_0x533465[_0x174f28(0x73)])&&_0x25af4d[_0x174f28(0x8f)]({'field':_0x174f28(0x73),'message':_0x174f28(0x8d)}),_0x533465['cssUrl']&&!isValidCssHttpsUrl(_0x533465[_0x174f28(0x90)])&&_0x25af4d[_0x174f28(0x8f)]({'field':_0x174f28(0x90),'message':_0x174f28(0x75)}),_0x25af4d;}export async function runMenuUpdateCore(_0xa3c23b,_0x5d113c,_0x743705){const _0x22498d=a63_0x2a33,_0x3adc3f=parseUpdateParamsFlag(_0x743705),_0x592fbf=[];if(_0x3adc3f[_0x22498d(0x73)])_0x592fbf[_0x22498d(0x8f)](_0x3adc3f[_0x22498d(0x73)]);if(_0x3adc3f[_0x22498d(0x90)])_0x592fbf[_0x22498d(0x8f)](_0x3adc3f[_0x22498d(0x90)]);const _0x134577=validateParams(_0x3adc3f);if(_0x134577[_0x22498d(0x6d)]>0x0){const _0x1348c8=_0x134577[_0x22498d(0x86)](_0x2f3bc1=>_0x22498d(0x72)+_0x2f3bc1[_0x22498d(0x81)]+':\x20'+_0x2f3bc1['message'])[_0x22498d(0x6c)](';\x20');throw new Error(_0x22498d(0x7a)+_0x1348c8);}logger[_0x22498d(0x84)](process[_0x22498d(0x6e)]()),logger[_0x22498d(0x8b)](_0x22498d(0x79),_0x22498d(0x7b),{'appCode':_0xa3c23b,'jsUrl':_0x3adc3f['jsUrl'],'cssUrl':_0x3adc3f[_0x22498d(0x90)]});if(_0x3adc3f[_0x22498d(0x73)]){const _0x332e6e=await isUrlReachable(_0x3adc3f[_0x22498d(0x73)]);if(!_0x332e6e)throw new Error(_0x22498d(0x89)+_0x3adc3f[_0x22498d(0x73)]);}if(_0x3adc3f[_0x22498d(0x90)]){const _0x23ba59=await isUrlReachable(_0x3adc3f[_0x22498d(0x90)]);if(!_0x23ba59)throw new Error(_0x22498d(0x87)+_0x3adc3f[_0x22498d(0x90)]);}const _0x260a39=await getOnlineMenuList(_0xa3c23b,_0x5d113c),_0x1dc1c3=_0x260a39[_0x22498d(0x7c)](_0x4654b3=>_0x4654b3[_0x22498d(0x83)][_0x22498d(0x6d)]>0x0);if(_0x1dc1c3[_0x22498d(0x6d)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x30ca97=await Promise[_0x22498d(0x74)](_0x1dc1c3[_0x22498d(0x86)](_0x5d4d1b=>updateMenuCdnUrl(_0xa3c23b,_0x5d113c,{'id':_0x5d4d1b['id'],'label':_0x5d4d1b[_0x22498d(0x7d)],'path':_0x5d4d1b['path'],'resources':_0x592fbf}))),_0x3fa60e=_0x30ca97[_0x22498d(0x7c)](_0x5acafe=>_0x5acafe[_0x22498d(0x85)]===_0x22498d(0x8c))[_0x22498d(0x6d)];return logger['info'](_0x22498d(0x79),'Menu\x20update\x20completed',{'count':_0x1dc1c3[_0x22498d(0x6d)],'resources':_0x592fbf}),{'updated':_0x1dc1c3['length']-_0x3fa60e,'failed':_0x3fa60e,'skipped':![]};}function parseUpdateParamsFlag(_0x31739a){const _0x226d64=a63_0x2a33;if(!_0x31739a||typeof _0x31739a!==_0x226d64(0x78))return{};try{const _0xfa8317=JSON[_0x226d64(0x82)](_0x31739a);if(typeof _0xfa8317!==_0x226d64(0x6f)||_0xfa8317===null||Array[_0x226d64(0x71)](_0xfa8317))return{};return{'jsUrl':typeof _0xfa8317[_0x226d64(0x73)]===_0x226d64(0x78)?_0xfa8317[_0x226d64(0x73)]['trim']():undefined,'cssUrl':typeof _0xfa8317[_0x226d64(0x90)]===_0x226d64(0x78)?_0xfa8317['cssUrl'][_0x226d64(0x69)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a64_0x4de1(_0x2e44cb,_0x13132a){_0x2e44cb=_0x2e44cb-0xb1;const _0x2686f8=a64_0x2686();let _0x4de18a=_0x2686f8[_0x2e44cb];return _0x4de18a;}function a64_0x2686(){const _0x4f01f8=['4976QmTEiP','HEAD','3222lJodbC','423dUuMli','33070YreNpy','2hjvsRW','227973gxixEs','3sGkpVF','8112825YoFnPq','7580352fEkQwG','1078fbJjZz','3465844OmrTKs','test','trim','8150rEhZcf'];a64_0x2686=function(){return _0x4f01f8;};return a64_0x2686();}(function(_0x5dcf11,_0x32c488){const _0x59efd=a64_0x4de1,_0x16f360=_0x5dcf11();while(!![]){try{const _0x1a161d=-parseInt(_0x59efd(0xb7))/0x1*(parseInt(_0x59efd(0xb6))/0x2)+-parseInt(_0x59efd(0xb8))/0x3*(parseInt(_0x59efd(0xbc))/0x4)+-parseInt(_0x59efd(0xbf))/0x5*(-parseInt(_0x59efd(0xb3))/0x6)+parseInt(_0x59efd(0xb9))/0x7+-parseInt(_0x59efd(0xb1))/0x8*(-parseInt(_0x59efd(0xb4))/0x9)+parseInt(_0x59efd(0xb5))/0xa*(parseInt(_0x59efd(0xbb))/0xb)+-parseInt(_0x59efd(0xba))/0xc;if(_0x1a161d===_0x32c488)break;else _0x16f360['push'](_0x16f360['shift']());}catch(_0x509b6c){_0x16f360['push'](_0x16f360['shift']());}}}(a64_0x2686,0xa17e3));export function isValidJsHttpsUrl(_0x45abe3){const _0x40f7ce=a64_0x4de1;return/^https:\/\/.+\.js(\?.*)?$/[_0x40f7ce(0xbd)](_0x45abe3['trim']());}export function isValidCssHttpsUrl(_0x1389b4){const _0x23a455=a64_0x4de1;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x1389b4[_0x23a455(0xbe)]());}export async function isUrlReachable(_0x268022){const _0x29c521=a64_0x4de1;try{const _0x5ba2e0=await fetch(_0x268022,{'method':_0x29c521(0xb2)});return _0x5ba2e0['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a65_0x2753(_0x55c8f3,_0x203d52){_0x55c8f3=_0x55c8f3-0xfd;const _0x50205a=a65_0x5020();let _0x27534f=_0x50205a[_0x55c8f3];return _0x27534f;}const a65_0x4f0d99=a65_0x2753;(function(_0x1d8324,_0x56b510){const _0x2a7e4e=a65_0x2753,_0x1ee605=_0x1d8324();while(!![]){try{const _0x457da6=-parseInt(_0x2a7e4e(0x11d))/0x1+parseInt(_0x2a7e4e(0x10b))/0x2+parseInt(_0x2a7e4e(0x111))/0x3+-parseInt(_0x2a7e4e(0xfd))/0x4+parseInt(_0x2a7e4e(0x10a))/0x5*(parseInt(_0x2a7e4e(0x131))/0x6)+parseInt(_0x2a7e4e(0x129))/0x7*(-parseInt(_0x2a7e4e(0x133))/0x8)+-parseInt(_0x2a7e4e(0x113))/0x9*(parseInt(_0x2a7e4e(0x100))/0xa);if(_0x457da6===_0x56b510)break;else _0x1ee605['push'](_0x1ee605['shift']());}catch(_0x51f900){_0x1ee605['push'](_0x1ee605['shift']());}}}(a65_0x5020,0xaec94));import a65_0x46762a from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'./shared/logic.js';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';export const menuSync={'service':'menu','command':'sync','description':a65_0x4f0d99(0x12d),'risk':a65_0x4f0d99(0x132),'flags':[{'name':'params','type':'string','description':'Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20'+a65_0x4f0d99(0x116)},{'name':a65_0x4f0d99(0xff),'type':a65_0x4f0d99(0x102),'description':a65_0x4f0d99(0x119)}],async 'execute'(_0x2bde8c){const _0x296a80=a65_0x4f0d99,_0x46b673=_0x2bde8c[_0x296a80(0x11e)](_0x296a80(0xff)),_0x1c2110=_0x2bde8c[_0x296a80(0x127)](_0x296a80(0x122)),_0x3242f5=parseParams(_0x1c2110),_0x5783c3=!!(_0x3242f5[_0x296a80(0x109)]||_0x3242f5[_0x296a80(0x134)]||_0x3242f5[_0x296a80(0x130)]&&_0x3242f5[_0x296a80(0x130)]['length']>0x0);if(_0x46b673||_0x5783c3){let _0x379a2f=[];!isInteractive()&&!_0x3242f5['pages']?.[_0x296a80(0x121)]&&(_0x379a2f=await readPageLabelsFromStdin());const _0x13266a=await runMenuSyncCore(_0x2bde8c[_0x296a80(0xfe)],_0x2bde8c[_0x296a80(0x10d)],_0x379a2f['length']>0x0?_0x379a2f:_0x3242f5[_0x296a80(0x130)]??[],_0x1c2110);if(_0x13266a[_0x296a80(0x11a)]){const _0x481c9a=getLocalPages();_0x481c9a['length']===0x0?console['log'](_0x296a80(0x124)):console['log'](_0x296a80(0x10f));}else console[_0x296a80(0x128)](_0x296a80(0x106)+_0x13266a[_0x296a80(0x101)]+_0x296a80(0x12b));return{'ok':!![]};}requireInteractive();const _0x33c81c=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x269fce,_0x12cb73,_0x157657;try{const _0x5d0e2c=await fetchMenuData(_0x2bde8c['appCode'],_0x2bde8c[_0x296a80(0x10d)]);_0x269fce=_0x5d0e2c[_0x296a80(0x11f)],_0x12cb73=_0x5d0e2c[_0x296a80(0x138)],_0x157657=_0x5d0e2c[_0x296a80(0x11b)],stopSpinner(_0x33c81c,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x4ee5ac){stopSpinner(_0x33c81c,_0x296a80(0x107),![]);throw CliErrors[_0x296a80(0x12a)](_0x4ee5ac instanceof Error?_0x4ee5ac[_0x296a80(0x112)]:_0x296a80(0x107));}if(_0x269fce[_0x296a80(0x121)]===0x0)return console['log'](a65_0x46762a[_0x296a80(0x110)](_0x296a80(0x12f))),{'ok':!![]};const _0x5e5398=buildCompareRows(_0x269fce,_0x12cb73);console[_0x296a80(0x128)](renderCompareTable(_0x5e5398)),console[_0x296a80(0x128)]();const _0x3a5d11=_0x3242f5[_0x296a80(0x130)],_0x3338ee=await selectPages(_0x269fce,_0x12cb73,_0x3a5d11);console[_0x296a80(0x128)](),console[_0x296a80(0x128)](a65_0x46762a[_0x296a80(0x118)](_0x296a80(0x10e)+_0x3338ee['length']+_0x296a80(0x126)));const _0x5f5b36=_0x3242f5[_0x296a80(0x109)]&&_0x3242f5[_0x296a80(0x134)];if(!_0x5f5b36){console['log'](renderSyncSummary(_0x3338ee,_0x12cb73['size']>0x0));const _0x2ff72b=await askConfirm(_0x296a80(0x120));if(!_0x2ff72b)return console[_0x296a80(0x128)](a65_0x46762a[_0x296a80(0x108)](_0x296a80(0x135))),{'ok':!![]};}let _0x112d15=_0x3242f5[_0x296a80(0x109)],_0x24beea=_0x3242f5[_0x296a80(0x134)];!_0x112d15&&(_0x112d15=await askJsUrl());!_0x24beea&&(_0x24beea=await askCssUrl());const _0x57b903=await askConfirm('\x20\x20Create\x20'+_0x3338ee[_0x296a80(0x121)]+_0x296a80(0x115)+_0x112d15+_0x296a80(0x104)+_0x24beea+'?');if(!_0x57b903)return console[_0x296a80(0x128)](a65_0x46762a[_0x296a80(0x108)](_0x296a80(0x135))),{'ok':!![]};const _0x2def55=[_0x112d15,_0x24beea],_0x267bde=startSpinner('Creating\x20'+_0x3338ee[_0x296a80(0x121)]+'\x20menu(s)...');try{const _0x270fea=await doCreateMenus(_0x2bde8c[_0x296a80(0xfe)],_0x2bde8c['cookie'],_0x3338ee,_0x2def55);return stopSpinner(_0x267bde,'Created\x20'+_0x270fea[_0x296a80(0x101)]+_0x296a80(0x136),!![]),{'ok':!![],'data':_0x270fea,'message':_0x296a80(0x105)+_0x270fea[_0x296a80(0x101)]+_0x296a80(0x117)+_0x270fea[_0x296a80(0x10c)]+_0x296a80(0x11c)};}catch(_0x1f07ba){stopSpinner(_0x267bde,_0x296a80(0x12e),![]);throw CliErrors[_0x296a80(0x12a)](_0x1f07ba instanceof Error?_0x1f07ba[_0x296a80(0x112)]:'Menu\x20creation\x20failed');}}};function a65_0x5020(){const _0x2c0d14=['283902DsdpZs','write','8XKQRmm','cssUrl','\x20\x20Cancelled.','\x20menu(s)','trim','onlinePaths','49996PqXgUl','appCode','yes','10HFPyUZ','created','boolean','isArray','\x20and\x20CSS:\x20','Menu\x20sync\x20completed:\x20','✓\x20Menu\x20sync\x20completed:\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','gray','jsUrl','125XIMrMk','878616NWTURI','failed','cookie','\x20\x20✓\x20Selected:\x20','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yellow','2952288ZoygVL','message','14285259WHWejc','string','\x20menu(s)\x20with\x20JS:\x20','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','\x20created,\x20','cyan','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','skipped','onlineMenuList','\x20failed.','145464XaIKvz','flag','localPages','\x20\x20Continue\x20with\x20creation?','length','params','parse','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','object','\x20page(s)','str','log','1016337aQcTAH','validation','\x20menu(s)\x20created','map','Sync\x20local\x20pages\x20as\x20platform\x20menus','Menu\x20creation\x20failed','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','pages'];a65_0x5020=function(){return _0x2c0d14;};return a65_0x5020();}function parseParams(_0x4b99e2){const _0x3922c0=a65_0x4f0d99;if(!_0x4b99e2)return{};try{const _0x26c73f=JSON[_0x3922c0(0x123)](_0x4b99e2);if(typeof _0x26c73f!==_0x3922c0(0x125)||_0x26c73f===null||Array[_0x3922c0(0x103)](_0x26c73f))return{};return{'jsUrl':typeof _0x26c73f['jsUrl']==='string'?_0x26c73f[_0x3922c0(0x109)][_0x3922c0(0x137)]():undefined,'cssUrl':typeof _0x26c73f[_0x3922c0(0x134)]===_0x3922c0(0x114)?_0x26c73f[_0x3922c0(0x134)][_0x3922c0(0x137)]():undefined,'pages':Array[_0x3922c0(0x103)](_0x26c73f[_0x3922c0(0x130)])?_0x26c73f['pages'][_0x3922c0(0x12c)](String):undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x3cc2ca=a66_0x3783;(function(_0x164736,_0x597bb3){const _0x2ff2d2=a66_0x3783,_0x22a196=_0x164736();while(!![]){try{const _0x23c35e=-parseInt(_0x2ff2d2(0x15f))/0x1*(parseInt(_0x2ff2d2(0x156))/0x2)+-parseInt(_0x2ff2d2(0x157))/0x3+parseInt(_0x2ff2d2(0x148))/0x4*(-parseInt(_0x2ff2d2(0x137))/0x5)+parseInt(_0x2ff2d2(0x14c))/0x6*(parseInt(_0x2ff2d2(0x149))/0x7)+parseInt(_0x2ff2d2(0x154))/0x8+-parseInt(_0x2ff2d2(0x15d))/0x9*(-parseInt(_0x2ff2d2(0x145))/0xa)+-parseInt(_0x2ff2d2(0x15e))/0xb*(parseInt(_0x2ff2d2(0x14e))/0xc);if(_0x23c35e===_0x597bb3)break;else _0x22a196['push'](_0x22a196['shift']());}catch(_0x31d9e7){_0x22a196['push'](_0x22a196['shift']());}}}(a66_0x2a90,0x5147a));function a66_0x3783(_0x50170f,_0x4a441c){_0x50170f=_0x50170f-0x136;const _0x2a908c=a66_0x2a90();let _0x378329=_0x2a908c[_0x50170f];return _0x378329;}function a66_0x2a90(){const _0x1c6842=['20946wlVRea','545613TltPaO','yes','appCode','Online\x20menu\x20list\x20fetched','\x20menu(s)\x20with\x20existing\x20resources','str','11952JWEzXi','14267CQvjVd','7YvTnFf','Updating\x20','message','cyan','Menu\x20update\x20completed:\x20','cssUrl','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','Fetching\x20online\x20menu\x20list...','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','failed','\x20updated,\x20','log','jsUrl','65NKQZLp','label','boolean','Failed\x20to\x20fetch\x20online\x20menu\x20list','\x20menu(s)\x20failed','length','menu','\x20menu(s)','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','gray','flag','yellow','string','trim','4310hFczFX','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','Menu\x20update\x20failed','152996WjhUQm','790832CapVwL','write','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','12WHuula','params','1224TSGtiV','validation','updated','object','✓\x20Menu\x20update\x20completed:\x20','Updated\x20','3354520hABiXK','cookie'];a66_0x2a90=function(){return _0x1c6842;};return a66_0x2a90();}import a66_0x462b85 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':a66_0x3cc2ca(0x13d),'command':'update','description':a66_0x3cc2ca(0x165),'risk':a66_0x3cc2ca(0x14a),'flags':[{'name':a66_0x3cc2ca(0x14d),'type':'string','description':a66_0x3cc2ca(0x13f)+a66_0x3cc2ca(0x14b)},{'name':'yes','type':a66_0x3cc2ca(0x139),'description':'Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation'}],async 'execute'(_0x7a34a2){const _0x4b7ff9=a66_0x3cc2ca,_0xa80f31=_0x7a34a2[_0x4b7ff9(0x141)](_0x4b7ff9(0x158)),_0x306ed2=_0x7a34a2[_0x4b7ff9(0x15c)](_0x4b7ff9(0x14d)),_0x5d3dda=parseParams(_0x306ed2),_0x52cce5=!!(_0x5d3dda[_0x4b7ff9(0x136)]||_0x5d3dda[_0x4b7ff9(0x164)]);if(_0xa80f31||_0x52cce5&&!isInteractive()){const _0x525666=await runMenuUpdateCore(_0x7a34a2[_0x4b7ff9(0x159)],_0x7a34a2[_0x4b7ff9(0x155)],_0x306ed2);return _0x525666['skipped']?console[_0x4b7ff9(0x16a)](_0x4b7ff9(0x146)):(console[_0x4b7ff9(0x16a)](_0x4b7ff9(0x152)+_0x525666[_0x4b7ff9(0x150)]+'\x20menu(s)\x20updated'),_0x525666[_0x4b7ff9(0x168)]>0x0&&console['error']('!\x20'+_0x525666[_0x4b7ff9(0x168)]+_0x4b7ff9(0x13b))),{'ok':_0x525666[_0x4b7ff9(0x168)]===0x0};}requireInteractive();const _0x8dcf61=startSpinner(_0x4b7ff9(0x166));let _0x4e30ed;try{_0x4e30ed=await fetchOnlineMenuList(_0x7a34a2[_0x4b7ff9(0x159)],_0x7a34a2[_0x4b7ff9(0x155)]),stopSpinner(_0x8dcf61,_0x4b7ff9(0x15a),!![]);}catch(_0x10e7bf){stopSpinner(_0x8dcf61,_0x4b7ff9(0x13a),![]);throw CliErrors['validation'](_0x10e7bf instanceof Error?_0x10e7bf['message']:_0x4b7ff9(0x13a));}const _0x173c76=filterMenusWithResources(_0x4e30ed);if(_0x173c76[_0x4b7ff9(0x13c)]===0x0)return console[_0x4b7ff9(0x16a)](a66_0x462b85[_0x4b7ff9(0x142)](_0x4b7ff9(0x167))),{'ok':!![]};console[_0x4b7ff9(0x16a)](),console['log'](a66_0x462b85[_0x4b7ff9(0x162)]('\x20\x20Found\x20'+_0x173c76[_0x4b7ff9(0x13c)]+_0x4b7ff9(0x15b))),console['log'](renderUpdateSummary(_0x173c76['map'](_0x111c04=>_0x111c04[_0x4b7ff9(0x138)]),[_0x5d3dda[_0x4b7ff9(0x136)],_0x5d3dda[_0x4b7ff9(0x164)]])),console[_0x4b7ff9(0x16a)]();let _0x1973ee=_0x5d3dda[_0x4b7ff9(0x136)],_0xe145f7=_0x5d3dda[_0x4b7ff9(0x164)];!_0x1973ee&&(_0x1973ee=await askJsUrl());!_0xe145f7&&(_0xe145f7=await askCssUrl());const _0x2efc86=await askConfirm('\x20\x20Update\x20'+_0x173c76[_0x4b7ff9(0x13c)]+'\x20menu(s)\x20with\x20JS:\x20'+_0x1973ee+'\x20and\x20CSS:\x20'+_0xe145f7+'?');if(!_0x2efc86)return console['log'](a66_0x462b85[_0x4b7ff9(0x140)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x38bacf=[_0x1973ee,_0xe145f7],_0x559afa=startSpinner(_0x4b7ff9(0x160)+_0x173c76['length']+'\x20menu(s)...');try{const _0x2fbb8c=await doUpdateCdnUrls(_0x7a34a2[_0x4b7ff9(0x159)],_0x7a34a2[_0x4b7ff9(0x155)],_0x173c76,_0x38bacf);return stopSpinner(_0x559afa,_0x4b7ff9(0x153)+_0x2fbb8c['updated']+_0x4b7ff9(0x13e),_0x2fbb8c[_0x4b7ff9(0x168)]===0x0),{'ok':_0x2fbb8c[_0x4b7ff9(0x168)]===0x0,'data':_0x2fbb8c,'message':_0x2fbb8c[_0x4b7ff9(0x168)]>0x0?_0x4b7ff9(0x163)+_0x2fbb8c['updated']+_0x4b7ff9(0x169)+_0x2fbb8c[_0x4b7ff9(0x168)]+'\x20failed.':_0x4b7ff9(0x163)+_0x2fbb8c['updated']+'\x20updated.'};}catch(_0x3a9a42){stopSpinner(_0x559afa,_0x4b7ff9(0x147),![]);throw CliErrors[_0x4b7ff9(0x14f)](_0x3a9a42 instanceof Error?_0x3a9a42[_0x4b7ff9(0x161)]:_0x4b7ff9(0x147));}}};function parseParams(_0x417064){const _0x254a87=a66_0x3cc2ca;if(!_0x417064)return{};try{const _0x14f6fe=JSON['parse'](_0x417064);if(typeof _0x14f6fe!==_0x254a87(0x151)||_0x14f6fe===null||Array['isArray'](_0x14f6fe))return{};return{'jsUrl':typeof _0x14f6fe[_0x254a87(0x136)]===_0x254a87(0x143)?_0x14f6fe[_0x254a87(0x136)]['trim']():undefined,'cssUrl':typeof _0x14f6fe[_0x254a87(0x164)]===_0x254a87(0x143)?_0x14f6fe['cssUrl'][_0x254a87(0x144)]():undefined};}catch{return{};}}
|
package/lib/commands/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x24da83=a67_0x7cdc;(function(_0x8c262e,_0x109127){const _0x4978d7=a67_0x7cdc,_0x50e5dd=_0x8c262e();while(!![]){try{const _0x5d90fe=parseInt(_0x4978d7(0x158))/0x1+parseInt(_0x4978d7(0x15a))/0x2+-parseInt(_0x4978d7(0x167))/0x3+parseInt(_0x4978d7(0x154))/0x4*(-parseInt(_0x4978d7(0x15e))/0x5)+parseInt(_0x4978d7(0x155))/0x6+-parseInt(_0x4978d7(0x166))/0x7+parseInt(_0x4978d7(0x159))/0x8;if(_0x5d90fe===_0x109127)break;else _0x50e5dd['push'](_0x50e5dd['shift']());}catch(_0x401cb8){_0x50e5dd['push'](_0x50e5dd['shift']());}}}(a67_0x4ba8,0x5174a));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runPreview(_0x2ed224){return new Promise((_0x12ac0f,_0x2acf6c)=>{const _0x1302c2=a67_0x7cdc,_0x5f1a7b=Date[_0x1302c2(0x16e)]();_0x2ed224['logger'][_0x1302c2(0x163)](_0x1302c2(0x164),_0x1302c2(0x169),{'command':_0x1302c2(0x15d)});let _0x1f1baa='';const _0x771da9=spawn(_0x1302c2(0x171),[_0x1302c2(0x164)],{'stdio':['inherit','inherit',_0x1302c2(0x165)],'shell':!![],'env':{...process.env,'PATH':''+join(process[_0x1302c2(0x16f)](),'node_modules',_0x1302c2(0x157))+delimiter+process.env.PATH}});_0x771da9['stderr']?.['on'](_0x1302c2(0x15b),_0x41f058=>{const _0x5a2977=_0x1302c2;_0x1f1baa+=_0x41f058[_0x5a2977(0x160)]();}),_0x771da9['on']('close',_0x9cec81=>{const _0x58cb44=_0x1302c2,_0x5d505c=Date[_0x58cb44(0x16e)]()-_0x5f1a7b;if(_0x9cec81===0x0||_0x9cec81===null)_0x2ed224[_0x58cb44(0x15c)][_0x58cb44(0x172)](_0x58cb44(0x164),'预览服务器启动成功',_0x5d505c),_0x12ac0f();else{const _0xa3c847={'exitCode':_0x9cec81,'duration':_0x5d505c,'command':'vite\x20preview','cwd':process[_0x58cb44(0x16f)]()};_0x1f1baa[_0x58cb44(0x153)]()&&(_0xa3c847[_0x58cb44(0x173)]=_0x1f1baa[_0x58cb44(0x153)]()),_0x2ed224[_0x58cb44(0x15c)][_0x58cb44(0x16a)]('preview',_0x58cb44(0x161),_0xa3c847),_0x2acf6c(new Error(_0x58cb44(0x16c)+_0x9cec81));}}),_0x771da9['on']('error',_0x14aadd=>{const _0x31180a=_0x1302c2,_0x5e9a26=Date[_0x31180a(0x16e)]()-_0x5f1a7b;_0x2ed224[_0x31180a(0x15c)][_0x31180a(0x16a)](_0x31180a(0x164),'预览服务器启动出错',{'error':_0x14aadd[_0x31180a(0x168)],'duration':_0x5e9a26,'stderr':_0x1f1baa[_0x31180a(0x153)]()||undefined}),_0x2acf6c(_0x14aadd);});});}function runBuildWatch(){return new Promise((_0x4cf98f,_0x5bf109)=>{const _0x40c054=a67_0x7cdc,_0x5edb7c=spawn('vite',[_0x40c054(0x170),_0x40c054(0x16b)],{'stdio':_0x40c054(0x162),'shell':!![],'env':{...process.env,'PATH':''+join(process[_0x40c054(0x16f)](),'node_modules',_0x40c054(0x157))+delimiter+process.env.PATH}});_0x5edb7c['on']('close',_0x5a3545=>{if(_0x5a3545===0x0||_0x5a3545===null)_0x4cf98f();else _0x5bf109(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x5a3545));}),_0x5edb7c['on'](_0x40c054(0x16a),_0x5bf109);});}function a67_0x7cdc(_0xcc49c2,_0x2d8f8d){_0xcc49c2=_0xcc49c2-0x153;const _0x4ba815=a67_0x4ba8();let _0x7cdca9=_0x4ba815[_0xcc49c2];return _0x7cdca9;}function a67_0x4ba8(){const _0x3c122f=['2260344JOdwrK','all','.bin','456897vhuVFM','4240520whpWGH','518046boQVJU','data','logger','vite\x20preview','584560BPkAmd','Preview\x20project','toString','预览服务器启动失败','inherit','info','preview','pipe','3233741qPCUcR','1429104UyocfZ','message','启动预览服务器','error','--watch','vite\x20preview\x20exited\x20with\x20code\x20','watch','now','cwd','build','vite','success','stderr','执行预览命令','trim','12axuDtI'];a67_0x4ba8=function(){return _0x3c122f;};return a67_0x4ba8();}export const previewCommand={'name':'preview','description':a67_0x24da83(0x15f),async 'run'(_0x5eeab3,_0x1464b0,_0x9eb45e){const _0x4dbd4e=a67_0x24da83,_0x365b9d=_0x9eb45e[_0x4dbd4e(0x16d)];_0x5eeab3[_0x4dbd4e(0x15c)]['info'](_0x4dbd4e(0x164),_0x4dbd4e(0x174)+(_0x365b9d?'\x20(监听模式)':'')),_0x365b9d?await Promise[_0x4dbd4e(0x156)]([runBuildWatch(),runPreview(_0x5eeab3)]):await runPreview(_0x5eeab3);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a68_0x48b2a7=a68_0x389d;(function(_0x4dd3ab,_0x46621a){const _0x1b3f09=a68_0x389d,_0x1119fb=_0x4dd3ab();while(!![]){try{const _0x1855c2=parseInt(_0x1b3f09(0x7e))/0x1*(parseInt(_0x1b3f09(0x6b))/0x2)+-parseInt(_0x1b3f09(0x67))/0x3+-parseInt(_0x1b3f09(0x70))/0x4*(-parseInt(_0x1b3f09(0x85))/0x5)+parseInt(_0x1b3f09(0x7f))/0x6+-parseInt(_0x1b3f09(0x77))/0x7+-parseInt(_0x1b3f09(0x6c))/0x8+parseInt(_0x1b3f09(0x6a))/0x9;if(_0x1855c2===_0x46621a)break;else _0x1119fb['push'](_0x1119fb['shift']());}catch(_0x35e8ee){_0x1119fb['push'](_0x1119fb['shift']());}}}(a68_0x212c,0xa1a9d));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../init/main.js';function a68_0x212c(){const _0x4f4379=['15146fasEpD','5932232TZrVOx','appcode','write','project-name','316724nMZquD','init','yes','env','cookie','create','args','6332473kuTMjp','project','boolean','str','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','../../create-app/non-interactive.js','Target\x20environment','69GJIqxg','6995364APtgOk','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','Usage:\x20','nonInteractive','App\x20code\x20to\x20initialize','trim','70jLnLsp','Skip\x20confirmation\x20prompt','bool','validation','3693279lElOzq','string','name','6682221LEsyoY'];a68_0x212c=function(){return _0x4f4379;};return a68_0x212c();}import{upgradeApp}from'../project-upgrade.js';const initFlags=[{'name':a68_0x48b2a7(0x6d),'type':a68_0x48b2a7(0x68),'description':a68_0x48b2a7(0x83)},{'name':'env','type':a68_0x48b2a7(0x68),'description':a68_0x48b2a7(0x7d)},{'name':a68_0x48b2a7(0x72),'type':a68_0x48b2a7(0x79),'description':'Auto-confirm\x20prompts','default':![]}],createFlags=[{'name':a68_0x48b2a7(0x69),'type':a68_0x48b2a7(0x68),'description':'Project\x20name'},{'name':'env','type':'string','description':a68_0x48b2a7(0x7d)},{'name':a68_0x48b2a7(0x6d),'type':'string','description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':'yes','type':a68_0x48b2a7(0x79),'description':a68_0x48b2a7(0x86),'default':![]}];function a68_0x389d(_0x54dd88,_0x391d54){_0x54dd88=_0x54dd88-0x66;const _0x212cf6=a68_0x212c();let _0x389d0f=_0x212cf6[_0x54dd88];return _0x389d0f;}export const projectDefinitions=[{'service':a68_0x48b2a7(0x78),'command':a68_0x48b2a7(0x71),'description':a68_0x48b2a7(0x80),'risk':a68_0x48b2a7(0x6e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x535439){const _0x30655d=a68_0x48b2a7;return await initConfig({'appcode':_0x535439['str'](_0x30655d(0x6d))||undefined,'env':_0x535439[_0x30655d(0x7a)](_0x30655d(0x73))||undefined,'autoYes':_0x535439[_0x30655d(0x87)](_0x30655d(0x72))}),{'ok':!![]};}},{'service':'project','command':a68_0x48b2a7(0x75),'description':'Create\x20a\x20new\x20project','risk':a68_0x48b2a7(0x6e),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a68_0x48b2a7(0x6f),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x4d2661){const _0x4f3bd7=a68_0x48b2a7,{createApp:_0x248fef}=await import('../../create-app/main.js'),{createProjectNonInteractive:_0x5d567a}=await import(_0x4f3bd7(0x7c)),_0x34b2f=_0x4d2661[_0x4f3bd7(0x7a)]('name')[_0x4f3bd7(0x84)]()||_0x4d2661[_0x4f3bd7(0x76)][0x0]?.[_0x4f3bd7(0x84)](),_0x374639=_0x4d2661[_0x4f3bd7(0x7a)]('env')||undefined,_0x3505f0=_0x4d2661[_0x4f3bd7(0x7a)](_0x4f3bd7(0x6d))||undefined;if(_0x4d2661[_0x4f3bd7(0x82)]){if(!_0x34b2f)throw CliErrors[_0x4f3bd7(0x66)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x4f3bd7(0x81)+CLI_BIN_NAME+_0x4f3bd7(0x7b));await _0x5d567a(_0x34b2f,_0x374639,_0x3505f0,_0x4d2661[_0x4f3bd7(0x74)]);}else await _0x248fef({'projectCode':_0x34b2f,'appCode':_0x3505f0,'env':_0x374639,'cookie':_0x4d2661[_0x4f3bd7(0x74)]});return{'ok':!![]};}},{'service':a68_0x48b2a7(0x78),'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a68_0x48b2a7(0x6e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x166632){const _0x15e0cf=a68_0x48b2a7;return await upgradeApp(_0x166632['nonInteractive'],{'yes':_0x166632[_0x15e0cf(0x87)](_0x15e0cf(0x72))}),{'ok':!![]};}}];
|