@lovrabet/rabetbase-cli 2.0.4-beta.3 → 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/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 -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.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/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 -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-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 +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x23ec79,_0x11232a){const _0x43819c=a56_0x2322,_0x427de8=_0x23ec79();while(!![]){try{const _0x4abaa8=-parseInt(_0x43819c(0x1e5))/0x1+-parseInt(_0x43819c(0x1fb))/0x2+parseInt(_0x43819c(0x1e4))/0x3*(parseInt(_0x43819c(0x1e3))/0x4)+parseInt(_0x43819c(0x1eb))/0x5*(-parseInt(_0x43819c(0x1ec))/0x6)+-parseInt(_0x43819c(0x1f9))/0x7*(parseInt(_0x43819c(0x1f1))/0x8)+parseInt(_0x43819c(0x1f5))/0x9+parseInt(_0x43819c(0x1ed))/0xa;if(_0x4abaa8===_0x11232a)break;else _0x427de8['push'](_0x427de8['shift']());}catch(_0x550e97){_0x427de8['push'](_0x427de8['shift']());}}}(a56_0x15ea,0xd3668));function strWidth(_0x4595ea){const _0x415ae2=a56_0x2322;let _0x5a11f0=0x0;for(const _0x23e8c4 of _0x4595ea){_0x5a11f0+=/[\u4e00-\u9fa5]/[_0x415ae2(0x1fd)](_0x23e8c4)?0x2:0x1;}return _0x5a11f0;}function a56_0x15ea(){const _0x484d62=['join','max','length','13888827jNLpbR','Menu\x20Name','showOnline','(unchanged)','119aeobBT','\x20\x20Affected\x20menus:\x20','2519302GHClLe','\x20\x20\x20\x20•\x20','test','46148DmvRgr','51gRRPQh','1205777hqzwcB','push','label','\x20menu(s)\x20will\x20be\x20updated\x20with\x20new\x20assets:','\x20\x20\x20\x20CSS:\x20','local','195ThEBXt','207666PpgoJl','39480680YNeDbm','\x20page(s)\x20will\x20be\x20created\x20on\x20platform:','map','repeat','473528ZxkSeN'];a56_0x15ea=function(){return _0x484d62;};return a56_0x15ea();}function padRight(_0x3ea63f,_0x3be388){const _0x59e3c1=a56_0x2322,_0x1655a3=strWidth(_0x3ea63f);return _0x3ea63f+'\x20'[_0x59e3c1(0x1f0)](Math[_0x59e3c1(0x1f3)](0x0,_0x3be388-_0x1655a3));}export function renderCompareTable(_0x572344,_0x292800={}){const _0x274e4f=a56_0x2322;if(_0x572344[_0x274e4f(0x1f4)]===0x0)return'';const _0x18ada5=_0x292800[_0x274e4f(0x1f7)]??!![],_0x43f8dc=Math['max'](0x1e,..._0x572344[_0x274e4f(0x1ef)](_0x4a58aa=>strWidth(_0x4a58aa[_0x274e4f(0x1e7)]))),_0x200ea3=0x4,_0xc0793c=[],_0x57d227='\x20\x20'+padRight(_0x274e4f(0x1f6),_0x43f8dc),_0x3f82d7=padRight('Local',_0x200ea3),_0xd4b984=_0x18ada5?'\x20\x20'+padRight('Platform',_0x200ea3):'';_0xc0793c[_0x274e4f(0x1e6)](_0x57d227+'\x20\x20'+_0x3f82d7+(_0x18ada5?_0xd4b984:'')),_0xc0793c[_0x274e4f(0x1e6)]('\x20\x20'+'─'[_0x274e4f(0x1f0)](_0x43f8dc)+'\x20\x20'+'─'['repeat'](_0x200ea3)+(_0x18ada5?'\x20\x20'+'─'[_0x274e4f(0x1f0)](_0x200ea3):''));for(const _0x1eb3b2 of _0x572344){const _0x27d489=padRight(_0x1eb3b2[_0x274e4f(0x1e7)],_0x43f8dc),_0x58c893=_0x1eb3b2[_0x274e4f(0x1ea)]?'✓':'✗',_0x2ce1d4=padRight(_0x58c893,_0x200ea3);let _0x51e14e='\x20\x20'+_0x27d489+'\x20\x20'+_0x2ce1d4;if(_0x18ada5){const _0x54815c=_0x1eb3b2['online']?'✓':'✗';_0x51e14e+='\x20\x20'+padRight(_0x54815c,_0x200ea3);}_0xc0793c[_0x274e4f(0x1e6)](_0x51e14e);}return _0xc0793c[_0x274e4f(0x1f2)]('\x0a');}export function renderSyncSummary(_0x2ca581,_0x1d14e5){const _0x469a03=a56_0x2322;if(_0x2ca581[_0x469a03(0x1f4)]===0x0)return _0x1d14e5?'\x20\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform.':'\x20\x20No\x20pages\x20to\x20sync.';const _0x3d4228=['\x20\x20'+_0x2ca581['length']+_0x469a03(0x1ee)];for(const _0x3103a1 of _0x2ca581){_0x3d4228['push'](_0x469a03(0x1fc)+_0x3103a1['label']+'\x20('+_0x3103a1['path']+')');}return _0x3d4228['join']('\x0a');}function a56_0x2322(_0x103e4f,_0x42e26e){_0x103e4f=_0x103e4f-0x1e3;const _0x15ea9f=a56_0x15ea();let _0x23224e=_0x15ea9f[_0x103e4f];return _0x23224e;}export function renderUpdateSummary(_0xea68e,_0x12d2fe){const _0x219b99=a56_0x2322;if(_0xea68e['length']===0x0)return'\x20\x20No\x20menus\x20with\x20existing\x20resources\x20found.';const _0x587b2f=['\x20\x20'+_0xea68e['length']+_0x219b99(0x1e8),'\x20\x20\x20\x20JS:\x20\x20'+(_0x12d2fe[0x0]??_0x219b99(0x1f8)),_0x219b99(0x1e9)+(_0x12d2fe[0x1]??_0x219b99(0x1f8)),'',_0x219b99(0x1fa)+_0xea68e['join'](',\x20')];return _0x587b2f[_0x219b99(0x1f2)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a49ef,_0x20519f){var _0x419cc3=a57_0x1c7b,_0x4a8793=_0x3a49ef();while(!![]){try{var _0x1a29c6=-parseInt(_0x419cc3(0x1ef))/0x1+parseInt(_0x419cc3(0x1f5))/0x2*(parseInt(_0x419cc3(0x1f1))/0x3)+-parseInt(_0x419cc3(0x1ee))/0x4+-parseInt(_0x419cc3(0x1f0))/0x5+parseInt(_0x419cc3(0x1f7))/0x6*(parseInt(_0x419cc3(0x1f3))/0x7)+parseInt(_0x419cc3(0x1f6))/0x8+-parseInt(_0x419cc3(0x1f4))/0x9*(parseInt(_0x419cc3(0x1f2))/0xa);if(_0x1a29c6===_0x20519f)break;else _0x4a8793['push'](_0x4a8793['shift']());}catch(_0x1f2673){_0x4a8793['push'](_0x4a8793['shift']());}}}(a57_0x2e76,0xdbc5f));export*from'./types.js';export*from'./logic.js';export*from'./compare-table.js';function a57_0x1c7b(_0x13d111,_0x2a4c6b){_0x13d111=_0x13d111-0x1ee;var _0x2e76c8=a57_0x2e76();var _0x1c7b34=_0x2e76c8[_0x13d111];return _0x1c7b34;}export*from'./inquirer.js';export*from'./valid-url.js';export*from'./local-pages.js';function a57_0x2e76(){var _0x392908=['1450620xzzMfd','4081365imGHNl','5171442ncPvOJ','20vWQJuL','14oBXvam','214911boIenL','2DcpupB','9099848ZZvNLr','3333138WQjMay','3029996chgiSt'];a57_0x2e76=function(){return _0x392908;};return a57_0x2e76();}export*from'./service.js';export*from'./sync-core.js';export*from'./update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x310075,_0x46d6fd){const _0x76635a=a58_0x384c,_0x4e996b=_0x310075();while(!![]){try{const _0x1ff0d5=-parseInt(_0x76635a(0x176))/0x1+parseInt(_0x76635a(0x15e))/0x2+parseInt(_0x76635a(0x15c))/0x3+parseInt(_0x76635a(0x17b))/0x4+-parseInt(_0x76635a(0x16f))/0x5*(parseInt(_0x76635a(0x172))/0x6)+parseInt(_0x76635a(0x165))/0x7*(parseInt(_0x76635a(0x179))/0x8)+-parseInt(_0x76635a(0x174))/0x9;if(_0x1ff0d5===_0x46d6fd)break;else _0x4e996b['push'](_0x4e996b['shift']());}catch(_0x3f3ec3){_0x4e996b['push'](_0x4e996b['shift']());}}}(a58_0x554f,0x8ba32));import a58_0x543ad3 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a58_0x581f6d from'ora';import{isUrlReachable}from'./valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x211151){return _0x211151['catch'](_0x289f25=>{const _0x39f561=a58_0x384c;if(_0x289f25?.[_0x39f561(0x156)]===_0x39f561(0x16b))throw CliErrors[_0x39f561(0x161)](_0x39f561(0x173));throw _0x289f25;});}function a58_0x554f(){const _0x59a702=['JS\x20URL\x20check\x20failed','has','cancelled','green','succeed','map','896eVtXxi','No\x20menus\x20selected.','error','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','[new]','ExitPromptError','length','red','JS\x20URL\x20checked','35eHketb','filter','CSS\x20URL\x20checked','224346tKLdli','Cancelled.','16536753YpaqFx','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','105567JsREpX','path','No\x20local\x20pages\x20found.','35400UpMsYR','isTTY','2217128OmxsNV','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','start','test','\x20\x20CSS\x20URL:','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','fail','label','stdin','CSS\x20URL\x20check\x20failed','includes','name','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','\x20\x20Checking\x20JS\x20URL\x20reachability...','trim','\x20\x20JS\x20URL:','3402540vwPoCN','\x20\x20Checking\x20CSS\x20URL\x20reachability...','1043626ZZTbKC'];a58_0x554f=function(){return _0x59a702;};return a58_0x554f();}export function startSpinner(_0x35a3c6){const _0x32daf3=a58_0x384c;return a58_0x581f6d({'text':_0x35a3c6,'color':'cyan'})[_0x32daf3(0x17d)]();}export function stopSpinner(_0x31c4fc,_0x152a81,_0x1b28dd){const _0x5967a9=a58_0x384c;_0x1b28dd?_0x31c4fc[_0x5967a9(0x163)](_0x152a81):_0x31c4fc[_0x5967a9(0x181)](_0x152a81);}export async function askConfirm(_0x7473f9){return onCancel(confirm({'message':_0x7473f9,'theme':{'prefix':''}}));}export async function askJsUrl(_0x4c983c){const _0x56c9f3=a58_0x384c;while(!![]){const _0x126a76=await onCancel(input({'message':_0x56c9f3(0x15b),'default':_0x4c983c,'theme':{'prefix':''}}));if(_0x126a76[_0x56c9f3(0x15a)]()==='')throw CliErrors[_0x56c9f3(0x161)](_0x56c9f3(0x173));if(!/^https:\/\/.+\.js(\?.*)?$/[_0x56c9f3(0x17e)](_0x126a76[_0x56c9f3(0x15a)]())){console['error'](a58_0x543ad3[_0x56c9f3(0x16d)](_0x56c9f3(0x158)));continue;}const _0xea83f2=startSpinner(_0x56c9f3(0x159));try{const _0x539a38=await isUrlReachable(_0x126a76[_0x56c9f3(0x15a)]());stopSpinner(_0xea83f2,_0x56c9f3(0x16e),_0x539a38);if(!_0x539a38){console[_0x56c9f3(0x167)](a58_0x543ad3[_0x56c9f3(0x16d)](_0x56c9f3(0x175)));continue;}return _0x126a76['trim']();}catch(_0x134240){stopSpinner(_0xea83f2,_0x56c9f3(0x15f),![]);throw _0x134240;}}}export async function askCssUrl(_0x51d6a8){const _0x4a1abe=a58_0x384c;while(!![]){const _0x4a8db6=await onCancel(input({'message':_0x4a1abe(0x17f),'default':_0x51d6a8,'theme':{'prefix':''}}));if(_0x4a8db6[_0x4a1abe(0x15a)]()==='')throw CliErrors['cancelled'](_0x4a1abe(0x173));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x4a1abe(0x17e)](_0x4a8db6['trim']())){console[_0x4a1abe(0x167)](a58_0x543ad3[_0x4a1abe(0x16d)](_0x4a1abe(0x180)));continue;}const _0x48885d=startSpinner(_0x4a1abe(0x15d));try{const _0x14a810=await isUrlReachable(_0x4a8db6[_0x4a1abe(0x15a)]());stopSpinner(_0x48885d,_0x4a1abe(0x171),_0x14a810);if(!_0x14a810){console[_0x4a1abe(0x167)](a58_0x543ad3[_0x4a1abe(0x16d)](_0x4a1abe(0x169)));continue;}return _0x4a8db6[_0x4a1abe(0x15a)]();}catch(_0x307b02){stopSpinner(_0x48885d,_0x4a1abe(0x154),![]);throw _0x307b02;}}}function a58_0x384c(_0x434fdd,_0x14c522){_0x434fdd=_0x434fdd-0x154;const _0x554f1d=a58_0x554f();let _0x384c6c=_0x554f1d[_0x434fdd];return _0x384c6c;}export async function selectPages(_0x43cc63,_0x55a052,_0x120cb4){const _0x54ecee=a58_0x384c,_0x4fbe81=_0x43cc63[_0x54ecee(0x164)](_0x33c8a5=>({'name':_0x33c8a5[_0x54ecee(0x182)]+'\x20\x20'+(_0x55a052[_0x54ecee(0x160)](_0x33c8a5[_0x54ecee(0x177)])?a58_0x543ad3['gray']('[already\x20on\x20platform]'):a58_0x543ad3[_0x54ecee(0x162)](_0x54ecee(0x16a))),'value':_0x33c8a5[_0x54ecee(0x182)],'checked':_0x120cb4?_0x120cb4[_0x54ecee(0x155)](_0x33c8a5['label']):!_0x55a052[_0x54ecee(0x160)](_0x33c8a5[_0x54ecee(0x177)])}));if(_0x4fbe81[_0x54ecee(0x16c)]===0x0)throw new Error(_0x54ecee(0x178));const _0x5330bd=await onCancel(checkbox({'message':_0x54ecee(0x157),'choices':_0x4fbe81,'loop':![],'theme':{'prefix':''}}));if(_0x5330bd['length']===0x0)throw new Error(_0x54ecee(0x166));return _0x43cc63[_0x54ecee(0x170)](_0x3f921d=>_0x5330bd[_0x54ecee(0x155)](_0x3f921d['label']));}export function isInteractive(){const _0x498b0a=a58_0x384c;return process[_0x498b0a(0x183)][_0x498b0a(0x17a)]===!![];}export function requireInteractive(){const _0x2e2cad=a58_0x384c;if(!isInteractive())throw new Error(_0x2e2cad(0x168)+_0x2e2cad(0x17c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a59_0x2fc2fd=a59_0x5932;(function(_0x56daf3,_0x17253e){const _0x5a0c17=a59_0x5932,_0xe0c1ae=_0x56daf3();while(!![]){try{const _0x15578d=parseInt(_0x5a0c17(0xeb))/0x1+parseInt(_0x5a0c17(0xed))/0x2*(parseInt(_0x5a0c17(0xf9))/0x3)+parseInt(_0x5a0c17(0xef))/0x4*(-parseInt(_0x5a0c17(0x102))/0x5)+-parseInt(_0x5a0c17(0x103))/0x6*(-parseInt(_0x5a0c17(0xfe))/0x7)+-parseInt(_0x5a0c17(0xf8))/0x8*(-parseInt(_0x5a0c17(0xf4))/0x9)+-parseInt(_0x5a0c17(0xf0))/0xa+-parseInt(_0x5a0c17(0xec))/0xb*(parseInt(_0x5a0c17(0xfd))/0xc);if(_0x15578d===_0x17253e)break;else _0xe0c1ae['push'](_0xe0c1ae['shift']());}catch(_0x35dbe9){_0xe0c1ae['push'](_0xe0c1ae['shift']());}}}(a59_0x4e86,0xca508));function a59_0x5932(_0x21cc25,_0x160cdc){_0x21cc25=_0x21cc25-0xea;const _0x4e86d1=a59_0x4e86();let _0x593218=_0x4e86d1[_0x21cc25];return _0x593218;}import{readdirSync,statSync,readFileSync}from'fs';function a59_0x4e86(){const _0x1f5b32=['14982ogFrwp','2Tpceep','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','4JuLFYr','9581390ZhaHgD','path','replace','join','1242063yMBvFU','match','utf-8','isDirectory','16ofCEBl','4542387LldmNv','push','endsWith','src/pages','18372QmTLUP','125482wfWsmm','.tsx','slice','cwd','3659905hawlKn','534Jacdxq','trim','1218465rPTZPK'];a59_0x4e86=function(){return _0x1f5b32;};return a59_0x4e86();}import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a59_0x2fc2fd(0x101)](),a59_0x2fc2fd(0xfc));export function extractTitleFromComment(_0x3b8cc2){const _0x501576=a59_0x2fc2fd;try{const _0x50c0aa=readFileSync(_0x3b8cc2,_0x501576(0xf6)),_0x41813c=_0x50c0aa[_0x501576(0xf5)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x41813c&&_0x41813c[0x1]){const _0x2a1584=_0x41813c[0x1],_0x2425e7=_0x2a1584['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x2425e7&&_0x2425e7[0x1])return _0x2425e7[0x1][_0x501576(0xea)]();}let _0x20d02e=null;const _0x545859=_0x50c0aa['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x545859&&_0x545859[0x1]&&(_0x20d02e=_0x545859[0x1]);if(!_0x20d02e){const _0x4fbc36=_0x50c0aa['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x4fbc36&&_0x4fbc36[0x1]&&(_0x20d02e=_0x4fbc36[0x1]);}if(_0x20d02e){const _0x4350a3=new RegExp('\x5cb'+_0x20d02e+_0x501576(0xee)),_0x4010cf=_0x50c0aa[_0x501576(0xf5)](_0x4350a3);if(_0x4010cf&&_0x4010cf[0x1])return _0x4010cf[0x1];return _0x20d02e;}return null;}catch(_0x5e2989){return null;}}export function getLocalPages(_0x430792=pagesDir,_0x17e15a=pagesDir){const _0x59678a=a59_0x2fc2fd;let _0x4f407b=[];const _0x47d63f=readdirSync(_0x430792);return _0x47d63f['forEach'](_0x19ffce=>{const _0x5ebccd=a59_0x5932,_0x29a360=join(_0x430792,_0x19ffce),_0x111056=statSync(_0x29a360);if(_0x111056&&_0x111056[_0x5ebccd(0xf7)]())_0x4f407b=_0x4f407b['concat'](getLocalPages(_0x29a360,_0x17e15a));else{if(_0x19ffce[_0x5ebccd(0xfb)](_0x5ebccd(0xff))){let _0x33bf88=relative(_0x17e15a,_0x29a360);_0x33bf88[_0x5ebccd(0xfb)]('index.tsx')?_0x33bf88=_0x33bf88[_0x5ebccd(0xf2)](/index\.tsx$/,''):_0x33bf88=_0x33bf88['replace'](/\.tsx$/,'');_0x33bf88['endsWith'](sep)&&(_0x33bf88=_0x33bf88[_0x5ebccd(0x100)](0x0,-0x1));const _0x1caa01=_0x33bf88['split'](sep)[_0x5ebccd(0xf3)]('/'),_0xcd7401=extractTitleFromComment(_0x29a360),_0x27092f=_0xcd7401||_0x1caa01;_0x4f407b[_0x5ebccd(0xfa)]({'path':_0x1caa01['replaceAll']('$',':'),'label':_0x27092f});}}}),_0x4f407b['filter'](_0xf5103e=>_0xf5103e[_0x59678a(0xf1)]!=='');}
|
|
@@ -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
|
-
(function(
|
|
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
|
-
const
|
|
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);}};
|