@lovrabet/rabetbase-cli 2.0.7 → 2.0.8
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/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/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -0
- 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/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/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -0
- 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/schema-export.js +1 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -0
- 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 +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x904b5b,_0x22a866){const _0xc719b2=a53_0x5247,_0x35b034=_0x904b5b();while(!![]){try{const _0xe8b7b1=parseInt(_0xc719b2(0x156))/0x1*(parseInt(_0xc719b2(0x151))/0x2)+-parseInt(_0xc719b2(0x153))/0x3*(-parseInt(_0xc719b2(0x159))/0x4)+-parseInt(_0xc719b2(0x157))/0x5+-parseInt(_0xc719b2(0x158))/0x6+-parseInt(_0xc719b2(0x152))/0x7*(parseInt(_0xc719b2(0x155))/0x8)+parseInt(_0xc719b2(0x154))/0x9+parseInt(_0xc719b2(0x150))/0xa;if(_0xe8b7b1===_0x22a866)break;else _0x35b034['push'](_0x35b034['shift']());}catch(_0x91b400){_0x35b034['push'](_0x35b034['shift']());}}}(a53_0x4460,0xcdf78));import{menuSync}from'./sync.js';function a53_0x5247(_0x226857,_0x35bc01){_0x226857=_0x226857-0x150;const _0x446054=a53_0x4460();let _0x524759=_0x446054[_0x226857];return _0x524759;}import{menuUpdate}from'./update.js';function a53_0x4460(){const _0x3ba249=['3172384cqrTTw','11TjMOrF','4389245fgOIMf','3842580DDOJwA','436IhoCxz','20028410GVEMmo','1490AWekEA','28eLxGgY','8238OznVoS','14739849nBaYJj'];a53_0x4460=function(){return _0x3ba249;};return a53_0x4460();}export const menuDefinitions=[menuSync,menuUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5649f3,_0x3c4a21){const _0x1c2a51=a54_0x15be,_0x2fafc5=_0x5649f3();while(!![]){try{const _0x16909f=-parseInt(_0x1c2a51(0x167))/0x1+-parseInt(_0x1c2a51(0x158))/0x2*(parseInt(_0x1c2a51(0x172))/0x3)+parseInt(_0x1c2a51(0x16e))/0x4*(parseInt(_0x1c2a51(0x156))/0x5)+parseInt(_0x1c2a51(0x15b))/0x6*(parseInt(_0x1c2a51(0x16a))/0x7)+parseInt(_0x1c2a51(0x171))/0x8*(parseInt(_0x1c2a51(0x166))/0x9)+-parseInt(_0x1c2a51(0x15f))/0xa+parseInt(_0x1c2a51(0x165))/0xb;if(_0x16909f===_0x3c4a21)break;else _0x2fafc5['push'](_0x2fafc5['shift']());}catch(_0x57ee39){_0x2fafc5['push'](_0x2fafc5['shift']());}}}(a54_0xe4de,0xda60c));function strWidth(_0x4a8ccc){const _0x25eec1=a54_0x15be;let _0x1d978d=0x0;for(const _0x407522 of _0x4a8ccc){_0x1d978d+=/[\u4e00-\u9fa5]/[_0x25eec1(0x154)](_0x407522)?0x2:0x1;}return _0x1d978d;}function a54_0x15be(_0x2a377e,_0x5106fa){_0x2a377e=_0x2a377e-0x152;const _0xe4de0c=a54_0xe4de();let _0x15bef1=_0xe4de0c[_0x2a377e];return _0x15bef1;}function a54_0xe4de(){const _0x16fa58=['test','label','2900NJqVoJ','max','1336gYzhWO','length','push','97554THfIeh','\x20\x20No\x20pages\x20to\x20sync.','Platform','repeat','3393430QVsmUw','online','\x20menu(s)\x20will\x20be\x20updated\x20with\x20new\x20assets:','path','\x20\x20Affected\x20menus:\x20','join','11870353vdZrTl','9SzhduA','1643322uNXvxh','local','\x20page(s)\x20will\x20be\x20created\x20on\x20platform:','637gvrjpq','\x20\x20\x20\x20•\x20','\x20\x20\x20\x20JS:\x20\x20','\x20\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform.','6512doOMuM','map','Local','5040392gkLoHI','5640vooGOM','(unchanged)','\x20\x20\x20\x20CSS:\x20','showOnline'];a54_0xe4de=function(){return _0x16fa58;};return a54_0xe4de();}function padRight(_0x2a4d2f,_0x407b27){const _0xa0ecfb=a54_0x15be,_0x17e1ad=strWidth(_0x2a4d2f);return _0x2a4d2f+'\x20'[_0xa0ecfb(0x15e)](Math[_0xa0ecfb(0x157)](0x0,_0x407b27-_0x17e1ad));}export function renderCompareTable(_0x535eb0,_0x389c8d={}){const _0x2eb8f9=a54_0x15be;if(_0x535eb0[_0x2eb8f9(0x159)]===0x0)return'';const _0x497ca7=_0x389c8d[_0x2eb8f9(0x153)]??!![],_0x40ce54=Math[_0x2eb8f9(0x157)](0x1e,..._0x535eb0[_0x2eb8f9(0x16f)](_0x4224ae=>strWidth(_0x4224ae[_0x2eb8f9(0x155)]))),_0x8e6510=0x4,_0xaf1e4d=[],_0x8c45ca='\x20\x20'+padRight('Menu\x20Name',_0x40ce54),_0x377077=padRight(_0x2eb8f9(0x170),_0x8e6510),_0x388cd4=_0x497ca7?'\x20\x20'+padRight(_0x2eb8f9(0x15d),_0x8e6510):'';_0xaf1e4d[_0x2eb8f9(0x15a)](_0x8c45ca+'\x20\x20'+_0x377077+(_0x497ca7?_0x388cd4:'')),_0xaf1e4d[_0x2eb8f9(0x15a)]('\x20\x20'+'─'[_0x2eb8f9(0x15e)](_0x40ce54)+'\x20\x20'+'─'[_0x2eb8f9(0x15e)](_0x8e6510)+(_0x497ca7?'\x20\x20'+'─'[_0x2eb8f9(0x15e)](_0x8e6510):''));for(const _0x7ed67c of _0x535eb0){const _0xd6b3b1=padRight(_0x7ed67c[_0x2eb8f9(0x155)],_0x40ce54),_0x348d8c=_0x7ed67c[_0x2eb8f9(0x168)]?'✓':'✗',_0xfd1154=padRight(_0x348d8c,_0x8e6510);let _0x5502d6='\x20\x20'+_0xd6b3b1+'\x20\x20'+_0xfd1154;if(_0x497ca7){const _0x260b72=_0x7ed67c[_0x2eb8f9(0x160)]?'✓':'✗';_0x5502d6+='\x20\x20'+padRight(_0x260b72,_0x8e6510);}_0xaf1e4d[_0x2eb8f9(0x15a)](_0x5502d6);}return _0xaf1e4d[_0x2eb8f9(0x164)]('\x0a');}export function renderSyncSummary(_0x30af61,_0x374f47){const _0x3f40ae=a54_0x15be;if(_0x30af61[_0x3f40ae(0x159)]===0x0)return _0x374f47?_0x3f40ae(0x16d):_0x3f40ae(0x15c);const _0x276ec7=['\x20\x20'+_0x30af61[_0x3f40ae(0x159)]+_0x3f40ae(0x169)];for(const _0x5cc248 of _0x30af61){_0x276ec7['push'](_0x3f40ae(0x16b)+_0x5cc248['label']+'\x20('+_0x5cc248[_0x3f40ae(0x162)]+')');}return _0x276ec7[_0x3f40ae(0x164)]('\x0a');}export function renderUpdateSummary(_0x3b8265,_0x5147ae){const _0x4fdc6a=a54_0x15be;if(_0x3b8265[_0x4fdc6a(0x159)]===0x0)return'\x20\x20No\x20menus\x20with\x20existing\x20resources\x20found.';const _0x50393b=['\x20\x20'+_0x3b8265['length']+_0x4fdc6a(0x161),_0x4fdc6a(0x16c)+(_0x5147ae[0x0]??_0x4fdc6a(0x173)),_0x4fdc6a(0x152)+(_0x5147ae[0x1]??_0x4fdc6a(0x173)),'',_0x4fdc6a(0x163)+_0x3b8265[_0x4fdc6a(0x164)](',\x20')];return _0x50393b[_0x4fdc6a(0x164)]('\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xdafd74,_0x344fde){var _0x41a56d=a55_0x4c0c,_0xc05300=_0xdafd74();while(!![]){try{var _0x726774=parseInt(_0x41a56d(0x1ad))/0x1*(-parseInt(_0x41a56d(0x1b4))/0x2)+-parseInt(_0x41a56d(0x1ae))/0x3*(-parseInt(_0x41a56d(0x1b2))/0x4)+parseInt(_0x41a56d(0x1b1))/0x5*(-parseInt(_0x41a56d(0x1b3))/0x6)+-parseInt(_0x41a56d(0x1af))/0x7*(parseInt(_0x41a56d(0x1ab))/0x8)+parseInt(_0x41a56d(0x1b0))/0x9+-parseInt(_0x41a56d(0x1ac))/0xa*(parseInt(_0x41a56d(0x1b5))/0xb)+parseInt(_0x41a56d(0x1aa))/0xc;if(_0x726774===_0x344fde)break;else _0xc05300['push'](_0xc05300['shift']());}catch(_0x2a0592){_0xc05300['push'](_0xc05300['shift']());}}}(a55_0x37fe,0xf21f4));export*from'./types.js';function a55_0x37fe(){var _0x4d39b9=['47332UKzGTl','588378kQEIuu','50xqmEmx','15872549azrxAz','44643672YcHOIw','177304ZbLRJm','10cxeZmb','60527nFwWgJ','84keiGrV','231oPfBlI','10943937iBhjeR','30CzZMfO'];a55_0x37fe=function(){return _0x4d39b9;};return a55_0x37fe();}export*from'./logic.js';export*from'./compare-table.js';export*from'./inquirer.js';export*from'./valid-url.js';export*from'./local-pages.js';function a55_0x4c0c(_0x451e03,_0x593c79){_0x451e03=_0x451e03-0x1aa;var _0x37feb3=a55_0x37fe();var _0x4c0c3d=_0x37feb3[_0x451e03];return _0x4c0c3d;}export*from'./service.js';export*from'./sync-core.js';export*from'./update-core.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x237fed,_0x46436e){const _0x192ee6=a56_0x3090,_0x2132db=_0x237fed();while(!![]){try{const _0x5e90d7=parseInt(_0x192ee6(0x98))/0x1*(parseInt(_0x192ee6(0xb2))/0x2)+-parseInt(_0x192ee6(0xa2))/0x3+-parseInt(_0x192ee6(0xb6))/0x4+-parseInt(_0x192ee6(0x8f))/0x5*(-parseInt(_0x192ee6(0x9f))/0x6)+parseInt(_0x192ee6(0xb1))/0x7*(-parseInt(_0x192ee6(0xa5))/0x8)+parseInt(_0x192ee6(0xa0))/0x9*(-parseInt(_0x192ee6(0xa7))/0xa)+parseInt(_0x192ee6(0x9a))/0xb;if(_0x5e90d7===_0x46436e)break;else _0x2132db['push'](_0x2132db['shift']());}catch(_0x35d703){_0x2132db['push'](_0x2132db['shift']());}}}(a56_0x21b7,0x22ce1));import a56_0x4d5961 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a56_0x40edaf from'ora';import{isUrlReachable}from'./valid-url.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x207831){return _0x207831['catch'](_0x204354=>{const _0x3cf9d8=a56_0x3090;if(_0x204354?.[_0x3cf9d8(0xaa)]===_0x3cf9d8(0x96))throw CliErrors['cancelled']('Cancelled.');throw _0x204354;});}export function startSpinner(_0x5110fd){return a56_0x40edaf({'text':_0x5110fd,'color':'cyan'})['start']();}export function stopSpinner(_0x33d627,_0x4b3693,_0x5545f5){const _0x148bdf=a56_0x3090;_0x5545f5?_0x33d627['succeed'](_0x4b3693):_0x33d627[_0x148bdf(0xa3)](_0x4b3693);}function a56_0x3090(_0x3def09,_0x2226d4){_0x3def09=_0x3def09-0x8f;const _0x21b79e=a56_0x21b7();let _0x3090f9=_0x21b79e[_0x3def09];return _0x3090f9;}export async function askConfirm(_0xe0c8ce){return onCancel(confirm({'message':_0xe0c8ce,'theme':{'prefix':''}}));}export async function askJsUrl(_0x4cfd81){const _0x3d4bf3=a56_0x3090;while(!![]){const _0x4e5b7a=await onCancel(input({'message':'\x20\x20JS\x20URL:','default':_0x4cfd81,'theme':{'prefix':''}}));if(_0x4e5b7a[_0x3d4bf3(0x95)]()==='')throw CliErrors['cancelled'](_0x3d4bf3(0xaf));if(!/^https:\/\/.+\.js(\?.*)?$/['test'](_0x4e5b7a[_0x3d4bf3(0x95)]())){console[_0x3d4bf3(0xb0)](a56_0x4d5961[_0x3d4bf3(0x99)]('\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'));continue;}const _0x6a4c71=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x4db9c6=await isUrlReachable(_0x4e5b7a[_0x3d4bf3(0x95)]());stopSpinner(_0x6a4c71,'JS\x20URL\x20checked',_0x4db9c6);if(!_0x4db9c6){console[_0x3d4bf3(0xb0)](a56_0x4d5961[_0x3d4bf3(0x99)](_0x3d4bf3(0x93)));continue;}return _0x4e5b7a[_0x3d4bf3(0x95)]();}catch(_0x2291ac){stopSpinner(_0x6a4c71,'JS\x20URL\x20check\x20failed',![]);throw _0x2291ac;}}}function a56_0x21b7(){const _0x1198d6=['\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','707418hHDSbd','fail','[already\x20on\x20platform]','8jVrxxd','cancelled','2597890UDhgKR','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','test','name','\x20\x20CSS\x20URL:','map','label','isTTY','Cancelled.','error','1771819QQLYBP','6046LVGWGT','CSS\x20URL\x20checked','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','stdin','984812UldvGk','No\x20menus\x20selected.','965xVlQAH','gray','green','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','[new]','trim','ExitPromptError','has','53ToorlF','red','7860424NIdqJY','includes','length','filter','path','8166WZbQBi','9aBtzeS'];a56_0x21b7=function(){return _0x1198d6;};return a56_0x21b7();}export async function askCssUrl(_0x2124c8){const _0x19753e=a56_0x3090;while(!![]){const _0x327e73=await onCancel(input({'message':_0x19753e(0xab),'default':_0x2124c8,'theme':{'prefix':''}}));if(_0x327e73['trim']()==='')throw CliErrors[_0x19753e(0xa6)](_0x19753e(0xaf));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x19753e(0xa9)](_0x327e73[_0x19753e(0x95)]())){console[_0x19753e(0xb0)](a56_0x4d5961['red']('\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'));continue;}const _0x120c24=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x408b52=await isUrlReachable(_0x327e73['trim']());stopSpinner(_0x120c24,_0x19753e(0xb3),_0x408b52);if(!_0x408b52){console[_0x19753e(0xb0)](a56_0x4d5961[_0x19753e(0x99)](_0x19753e(0xa1)));continue;}return _0x327e73['trim']();}catch(_0x48ab3d){stopSpinner(_0x120c24,'CSS\x20URL\x20check\x20failed',![]);throw _0x48ab3d;}}}export async function selectPages(_0x58662b,_0x471686,_0x5c42d8){const _0x20627d=a56_0x3090,_0x3dfc1a=_0x58662b[_0x20627d(0xac)](_0xf8e33a=>({'name':_0xf8e33a[_0x20627d(0xad)]+'\x20\x20'+(_0x471686[_0x20627d(0x97)](_0xf8e33a['path'])?a56_0x4d5961[_0x20627d(0x90)](_0x20627d(0xa4)):a56_0x4d5961[_0x20627d(0x91)](_0x20627d(0x94))),'value':_0xf8e33a['label'],'checked':_0x5c42d8?_0x5c42d8[_0x20627d(0x9b)](_0xf8e33a[_0x20627d(0xad)]):!_0x471686[_0x20627d(0x97)](_0xf8e33a[_0x20627d(0x9e)])}));if(_0x3dfc1a[_0x20627d(0x9c)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0x595cc5=await onCancel(checkbox({'message':_0x20627d(0xb4),'choices':_0x3dfc1a,'loop':![],'theme':{'prefix':''}}));if(_0x595cc5['length']===0x0)throw new Error(_0x20627d(0xb7));return _0x58662b[_0x20627d(0x9d)](_0x12e645=>_0x595cc5[_0x20627d(0x9b)](_0x12e645[_0x20627d(0xad)]));}export function isInteractive(){const _0x4b7f4f=a56_0x3090;return process[_0x4b7f4f(0xb5)][_0x4b7f4f(0xae)]===!![];}export function requireInteractive(){const _0x42a798=a56_0x3090;if(!isInteractive())throw new Error(_0x42a798(0xa8)+_0x42a798(0x92));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a57_0x3cbc(_0x4b5827,_0x152b73){_0x4b5827=_0x4b5827-0x18f;const _0x2340b7=a57_0x2340();let _0x3cbcdf=_0x2340b7[_0x4b5827];return _0x3cbcdf;}(function(_0x43b543,_0x3adadb){const _0x355066=a57_0x3cbc,_0x3021c0=_0x43b543();while(!![]){try{const _0x545cdf=-parseInt(_0x355066(0x1a4))/0x1+parseInt(_0x355066(0x191))/0x2*(-parseInt(_0x355066(0x19a))/0x3)+parseInt(_0x355066(0x19d))/0x4+parseInt(_0x355066(0x19c))/0x5*(-parseInt(_0x355066(0x1a7))/0x6)+-parseInt(_0x355066(0x1a1))/0x7*(parseInt(_0x355066(0x196))/0x8)+parseInt(_0x355066(0x1a6))/0x9+parseInt(_0x355066(0x198))/0xa;if(_0x545cdf===_0x3adadb)break;else _0x3021c0['push'](_0x3021c0['shift']());}catch(_0x2adeaa){_0x3021c0['push'](_0x3021c0['shift']());}}}(a57_0x2340,0xad3b6));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a57_0x2340(){const _0x22a24a=['index.tsx','match','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','3570aZAyZT','replaceAll','join','1297292BOBVZs','push','12703833uRnoyL','36156PNStey','isDirectory','replace','224612ONpjwv','.tsx','concat','path','endsWith','8616fMjQOo','slice','22526680OJNmEm','forEach','15tMFZih','split','980bbVOIt','2538164GkcUpo'];a57_0x2340=function(){return _0x22a24a;};return a57_0x2340();}const pagesDir=resolve(process['cwd'](),'src/pages');export function extractTitleFromComment(_0x2ecaf0){const _0x3499c5=a57_0x3cbc;try{const _0x178403=readFileSync(_0x2ecaf0,'utf-8'),_0x16a3fc=_0x178403[_0x3499c5(0x19f)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x16a3fc&&_0x16a3fc[0x1]){const _0x1ba9bf=_0x16a3fc[0x1],_0x809465=_0x1ba9bf[_0x3499c5(0x19f)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x809465&&_0x809465[0x1])return _0x809465[0x1]['trim']();}let _0x492651=null;const _0x20b7ba=_0x178403[_0x3499c5(0x19f)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x20b7ba&&_0x20b7ba[0x1]&&(_0x492651=_0x20b7ba[0x1]);if(!_0x492651){const _0x55766d=_0x178403['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x55766d&&_0x55766d[0x1]&&(_0x492651=_0x55766d[0x1]);}if(_0x492651){const _0x94d227=new RegExp('\x5cb'+_0x492651+_0x3499c5(0x1a0)),_0x336090=_0x178403[_0x3499c5(0x19f)](_0x94d227);if(_0x336090&&_0x336090[0x1])return _0x336090[0x1];return _0x492651;}return null;}catch(_0x43db87){return null;}}export function getLocalPages(_0x4cb0e6=pagesDir,_0x2dd13a=pagesDir){const _0x1622c0=a57_0x3cbc;let _0x1bd19d=[];const _0x5664a3=readdirSync(_0x4cb0e6);return _0x5664a3[_0x1622c0(0x199)](_0x440fff=>{const _0x57d5d7=_0x1622c0,_0x518ccd=join(_0x4cb0e6,_0x440fff),_0x24ebbd=statSync(_0x518ccd);if(_0x24ebbd&&_0x24ebbd[_0x57d5d7(0x18f)]())_0x1bd19d=_0x1bd19d[_0x57d5d7(0x193)](getLocalPages(_0x518ccd,_0x2dd13a));else{if(_0x440fff[_0x57d5d7(0x195)](_0x57d5d7(0x192))){let _0x51c344=relative(_0x2dd13a,_0x518ccd);_0x51c344[_0x57d5d7(0x195)](_0x57d5d7(0x19e))?_0x51c344=_0x51c344[_0x57d5d7(0x190)](/index\.tsx$/,''):_0x51c344=_0x51c344[_0x57d5d7(0x190)](/\.tsx$/,'');_0x51c344[_0x57d5d7(0x195)](sep)&&(_0x51c344=_0x51c344[_0x57d5d7(0x197)](0x0,-0x1));const _0x5d7f5d=_0x51c344[_0x57d5d7(0x19b)](sep)[_0x57d5d7(0x1a3)]('/'),_0x1fd986=extractTitleFromComment(_0x518ccd),_0x266742=_0x1fd986||_0x5d7f5d;_0x1bd19d[_0x57d5d7(0x1a5)]({'path':_0x5d7f5d[_0x57d5d7(0x1a2)]('$',':'),'label':_0x266742});}}}),_0x1bd19d['filter'](_0x327b27=>_0x327b27[_0x1622c0(0x194)]!=='');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4345ce,_0x55e3fd){const _0x154b83=a58_0x3787,_0x2349f0=_0x4345ce();while(!![]){try{const _0x16f162=parseInt(_0x154b83(0xc0))/0x1*(parseInt(_0x154b83(0xc1))/0x2)+-parseInt(_0x154b83(0xcd))/0x3*(-parseInt(_0x154b83(0xd0))/0x4)+parseInt(_0x154b83(0xc9))/0x5*(-parseInt(_0x154b83(0xd5))/0x6)+parseInt(_0x154b83(0xde))/0x7+parseInt(_0x154b83(0xda))/0x8*(-parseInt(_0x154b83(0xd1))/0x9)+parseInt(_0x154b83(0xca))/0xa*(parseInt(_0x154b83(0xd9))/0xb)+-parseInt(_0x154b83(0xdf))/0xc*(parseInt(_0x154b83(0xd7))/0xd);if(_0x16f162===_0x55e3fd)break;else _0x2349f0['push'](_0x2349f0['shift']());}catch(_0x5b9bbc){_0x2349f0['push'](_0x2349f0['shift']());}}}(a58_0x15ec,0xe7d1c));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'./service.js';function a58_0x15ec(){const _0x20dbd7=['282YGyNWc','allSettled','errors','9608vQmiho','18khBZJh','CSS\x20URL\x20is\x20unreachable','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','has','162oQmtVN','find','13FXmRWa','path','197857seQgUH','208832ccWbSo','No\x20local\x20pages\x20matched\x20labels:\x20','join','rejected','8926351YjgiRT','22430748kZJpor','131932QbdFWh','8VjipbA','status','filter','resources','map','trim','length','JS\x20URL\x20is\x20unreachable','20565foeizK','530fJLFRM','label','push'];a58_0x15ec=function(){return _0x20dbd7;};return a58_0x15ec();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';export function validateJsUrl(_0x1aab9c){const _0x523412=a58_0x3787,_0x267b89=[];return!isValidJsHttpsUrl(_0x1aab9c)&&_0x267b89[_0x523412(0xcc)](_0x523412(0xd3)),{'ok':_0x267b89[_0x523412(0xc7)]===0x0,'errors':_0x267b89};}export function validateCssUrl(_0x236774){const _0x48361f=a58_0x3787,_0x565af9=[];return!isValidCssHttpsUrl(_0x236774)&&_0x565af9['push']('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0x565af9[_0x48361f(0xc7)]===0x0,'errors':_0x565af9};}export async function validateJsUrlReachable(_0x1675bd){const _0x77da44=a58_0x3787,_0x323e57=validateJsUrl(_0x1675bd);if(!_0x323e57['ok'])return _0x323e57;const _0x4963c1=await isUrlReachable(_0x1675bd);if(!_0x4963c1)_0x323e57[_0x77da44(0xcf)][_0x77da44(0xcc)](_0x77da44(0xc8));return{'ok':_0x323e57['errors'][_0x77da44(0xc7)]===0x0,'errors':_0x323e57[_0x77da44(0xcf)]};}export async function validateCssUrlReachable(_0x47736f){const _0x432602=a58_0x3787,_0x500920=validateCssUrl(_0x47736f);if(!_0x500920['ok'])return _0x500920;const _0xc74093=await isUrlReachable(_0x47736f);if(!_0xc74093)_0x500920[_0x432602(0xcf)][_0x432602(0xcc)](_0x432602(0xd2));return{'ok':_0x500920[_0x432602(0xcf)][_0x432602(0xc7)]===0x0,'errors':_0x500920[_0x432602(0xcf)]};}export function buildCompareRows(_0x4e3dad,_0x4ad9e3){const _0x136683=a58_0x3787;return _0x4e3dad[_0x136683(0xc5)](_0x3346c8=>({'label':_0x3346c8[_0x136683(0xcb)],'path':_0x3346c8[_0x136683(0xd8)],'local':!![],'online':_0x4ad9e3[_0x136683(0xd4)](_0x3346c8[_0x136683(0xd8)])}));}function a58_0x3787(_0x4d04ce,_0x4e2290){_0x4d04ce=_0x4d04ce-0xc0;const _0x15ecde=a58_0x15ec();let _0x3787e7=_0x15ecde[_0x4d04ce];return _0x3787e7;}export function filterNewPages(_0x38c868,_0x23d86f,_0x2eb1b2){const _0x4958b6=a58_0x3787;if(_0x2eb1b2&&_0x2eb1b2[_0x4958b6(0xc7)]>0x0){const _0x2196fa=new Set(_0x2eb1b2[_0x4958b6(0xc5)](_0x5e4e3c=>_0x5e4e3c[_0x4958b6(0xc6)]())),_0x555e57=_0x38c868[_0x4958b6(0xc3)](_0x1929c2=>_0x2196fa[_0x4958b6(0xd4)](_0x1929c2[_0x4958b6(0xcb)]));if(_0x555e57[_0x4958b6(0xc7)]===0x0)throw new Error(_0x4958b6(0xdb)+[..._0x2196fa][_0x4958b6(0xdc)](',\x20'));return _0x555e57;}return _0x38c868[_0x4958b6(0xc3)](_0x3ca7d9=>!_0x23d86f['has'](_0x3ca7d9[_0x4958b6(0xd8)]));}export function filterPagesByLabels(_0x47520a,_0x516eac){const _0x3f92ab=a58_0x3787,_0x3309ac=[],_0x585b22=[];for(const _0xbf1ba of _0x516eac){const _0x3e5fb7=_0xbf1ba[_0x3f92ab(0xc6)](),_0x286d10=_0x47520a[_0x3f92ab(0xd6)](_0x44655b=>_0x44655b[_0x3f92ab(0xcb)]===_0x3e5fb7);if(_0x286d10)_0x3309ac[_0x3f92ab(0xcc)](_0x286d10);else _0x585b22[_0x3f92ab(0xcc)](_0xbf1ba);}return{'matched':_0x3309ac,'unmatched':_0x585b22};}export async function doCreateMenus(_0x2e873f,_0xd5b8ff,_0x4f73fe,_0x41227d){const _0x528b9a=a58_0x3787;return await createMenus(_0x2e873f,_0xd5b8ff,_0x4f73fe,_0x41227d),{'created':_0x4f73fe[_0x528b9a(0xc7)],'failed':0x0,'labels':_0x4f73fe['map'](_0x43debc=>_0x43debc[_0x528b9a(0xcb)])};}export function filterMenusWithResources(_0x297ae3){const _0xb8686=a58_0x3787;return _0x297ae3[_0xb8686(0xc3)](_0x247ad1=>_0x247ad1[_0xb8686(0xc4)][_0xb8686(0xc7)]>0x0);}export async function doUpdateCdnUrls(_0x3dcdad,_0x5955f6,_0x1c7905,_0xddb7e){const _0x9f9f4b=a58_0x3787,_0x3e8070=_0x1c7905[_0x9f9f4b(0xc3)](_0x1f0f46=>_0x1f0f46[_0x9f9f4b(0xc4)][_0x9f9f4b(0xc7)]>0x0),_0x1e8b32=await Promise[_0x9f9f4b(0xce)](_0x3e8070['map'](_0x30d2f8=>updateMenuCdnUrl(_0x3dcdad,_0x5955f6,{'id':_0x30d2f8['id'],'label':_0x30d2f8[_0x9f9f4b(0xcb)],'path':_0x30d2f8[_0x9f9f4b(0xd8)],'resources':_0xddb7e}))),_0x2892fe=_0x1e8b32[_0x9f9f4b(0xc3)](_0x259d0c=>_0x259d0c[_0x9f9f4b(0xc2)]===_0x9f9f4b(0xdd))[_0x9f9f4b(0xc7)];return{'updated':_0x3e8070['length']-_0x2892fe,'failed':_0x2892fe};}export async function fetchMenuData(_0x4708c4,_0xe432b8){const _0x28d4e5=a58_0x3787,_0x579ec5=getLocalPages(),_0x33dc3c=await getOnlineMenuList(_0x4708c4,_0xe432b8),_0x23db90=new Set(_0x33dc3c[_0x28d4e5(0xc5)](_0x5d186a=>_0x5d186a[_0x28d4e5(0xd8)]));return{'localPages':_0x579ec5,'onlineMenuList':_0x33dc3c,'onlinePaths':_0x23db90};}export async function fetchOnlineMenuList(_0x470d37,_0x7b4699){return getOnlineMenuList(_0x470d37,_0x7b4699);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x537a1b,_0x1ec984){const _0x26241c=a59_0x9102,_0x44f488=_0x537a1b();while(!![]){try{const _0x4afbd3=parseInt(_0x26241c(0x153))/0x1*(-parseInt(_0x26241c(0x148))/0x2)+-parseInt(_0x26241c(0x142))/0x3+-parseInt(_0x26241c(0x140))/0x4+-parseInt(_0x26241c(0x15c))/0x5+-parseInt(_0x26241c(0x163))/0x6*(-parseInt(_0x26241c(0x15a))/0x7)+-parseInt(_0x26241c(0x13c))/0x8+parseInt(_0x26241c(0x146))/0x9*(parseInt(_0x26241c(0x143))/0xa);if(_0x4afbd3===_0x1ec984)break;else _0x44f488['push'](_0x44f488['shift']());}catch(_0x802e29){_0x44f488['push'](_0x44f488['shift']());}}}(a59_0x1cf6,0x44aa9));import{getApiDomain}from'../../../constant/domain.js';function a59_0x9102(_0x4e72c2,_0x49c489){_0x4e72c2=_0x4e72c2-0x139;const _0x1cf6b3=a59_0x1cf6();let _0x91021e=_0x1cf6b3[_0x4e72c2];return _0x91021e;}import{getEnv}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';function a59_0x1cf6(){const _0x329d75=['Batch\x20menu\x20creation\x20completed,\x20total\x20','resources','update-menu-cdn-url','all','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','POST','create-menu','57DMxYcH','Menu\x20created\x20successfully:\x20','map','stringify','create-menus','Fetched\x20','/smartapi/menu/create','72947QwYAVE','label','842510GgZFhs','Menu\x20assets\x20synced:\x20','Updating\x20menu\x20asset\x20links:\x20','Creating\x20menu:\x20','isArray','Create\x20menu\x20\x22','get-online-menu-list','6iVJZeh','children','/smartapi/menu/update','Fetch\x20menu\x20list','Server\x20returned\x20empty\x20menu\x20list','3613504gwQBAG','procode','extend','info','233552xvpPOH','parse','304479uwmPIM','1420CwZGut','length','Update\x20menu\x20assets\x20\x22','90837RDjkQV','path','13414gGHiga','import','online','/smartapi/menu/find?appCode='];a59_0x1cf6=function(){return _0x329d75;};return a59_0x1cf6();}import{platformFetch}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x58076d,_0x4e2207){const _0x5afd73=a59_0x9102,_0xc2d403=getEnv();logger[_0x5afd73(0x13f)](_0x5afd73(0x162),_0xc2d403===_0x5afd73(0x14a)?_0x5afd73(0x150)+_0x58076d+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x58076d+')');const _0x2d991a=await platformFetch(getApiDomain()+_0x5afd73(0x14b)+_0x58076d,{'cookie':_0x4e2207,'label':_0x5afd73(0x13a)});if(!_0x2d991a)return logger[_0x5afd73(0x13f)](_0x5afd73(0x162),_0x5afd73(0x13b)),[];return logger[_0x5afd73(0x13f)](_0x5afd73(0x162),_0x5afd73(0x158)+_0x2d991a[_0x5afd73(0x144)]+'\x20online\x20menus\x20successfully'),_0x2d991a[_0x5afd73(0x155)](flattenMenuItem)['flat']();}function flattenMenuItem(_0x5c76d3){const _0x703f1e=a59_0x9102;let _0x2108ee=[];try{if(_0x5c76d3[_0x703f1e(0x13e)]?.[_0x703f1e(0x14d)]){const _0x138672=JSON[_0x703f1e(0x141)](_0x5c76d3[_0x703f1e(0x13e)][_0x703f1e(0x14d)]);if(Array[_0x703f1e(0x160)](_0x138672))_0x2108ee=_0x138672;}}catch{}const _0x46a019=[{'id':_0x5c76d3['id'],'path':_0x5c76d3[_0x703f1e(0x147)],'label':_0x5c76d3[_0x703f1e(0x15b)],'resources':_0x2108ee}];if(_0x5c76d3['children']&&_0x5c76d3[_0x703f1e(0x164)][_0x703f1e(0x144)]>0x0)for(const _0x51de8c of _0x5c76d3[_0x703f1e(0x164)]){_0x46a019['push'](...flattenMenuItem(_0x51de8c));}return _0x46a019;}export async function createMenu(_0x37e76f,_0x136955,_0x5ee12c){const _0x3f3201=a59_0x9102;logger[_0x3f3201(0x13f)]('create-menu',_0x3f3201(0x15f)+_0x5ee12c[_0x3f3201(0x15b)]+'\x20('+_0x5ee12c[_0x3f3201(0x147)]+')');const _0x17d4c2={'appCode':_0x37e76f,'type':_0x3f3201(0x13d),'sort':0x0,'extend':{'loadScriptMode':_0x3f3201(0x149),'resources':_0x5ee12c[_0x3f3201(0x14d)]?JSON[_0x3f3201(0x156)](_0x5ee12c[_0x3f3201(0x14d)]):undefined},..._0x5ee12c};await platformFetch(getApiDomain()+'/smartapi/menu/create',{'method':'POST','body':_0x17d4c2,'cookie':_0x136955,'label':_0x3f3201(0x161)+_0x5ee12c[_0x3f3201(0x15b)]+'\x22'}),logger[_0x3f3201(0x13f)](_0x3f3201(0x152),_0x3f3201(0x154)+_0x5ee12c[_0x3f3201(0x15b)]);}async function createSingleMenu(_0x5be101,_0x11c674,_0x30809f,_0x155bd1){const _0x2fe08c=a59_0x9102,_0x388a41={'appCode':_0x5be101,'type':_0x2fe08c(0x13d),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x155bd1?JSON[_0x2fe08c(0x156)](_0x155bd1):undefined},'label':_0x30809f[_0x2fe08c(0x15b)],'path':_0x30809f[_0x2fe08c(0x147)]};await platformFetch(getApiDomain()+_0x2fe08c(0x159),{'method':_0x2fe08c(0x151),'body':_0x388a41,'cookie':_0x11c674,'label':_0x2fe08c(0x161)+_0x30809f[_0x2fe08c(0x15b)]+'\x22'}),logger[_0x2fe08c(0x13f)](_0x2fe08c(0x152),'Menu\x20created\x20successfully:\x20'+_0x30809f['label']);}export async function createMenus(_0xf9be56,_0x5addee,_0x3e33f2,_0x563e18){const _0x462592=a59_0x9102;logger[_0x462592(0x13f)](_0x462592(0x157),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x3e33f2[_0x462592(0x144)]),await Promise[_0x462592(0x14f)](_0x3e33f2[_0x462592(0x155)](_0x3c97bc=>createSingleMenu(_0xf9be56,_0x5addee,_0x3c97bc,_0x563e18))),logger[_0x462592(0x13f)](_0x462592(0x157),_0x462592(0x14c)+_0x3e33f2['length']);}export async function updateMenuCdnUrl(_0x55fdce,_0x5203ff,_0x1b9119){const _0x5aa595=a59_0x9102;logger['info'](_0x5aa595(0x14e),_0x5aa595(0x15e)+_0x1b9119[_0x5aa595(0x15b)]+'\x20('+_0x1b9119[_0x5aa595(0x147)]+')');const _0x37a818={'id':_0x1b9119['id'],'appCode':_0x55fdce,'extend':{'loadScriptMode':_0x5aa595(0x149),'resources':_0x1b9119['resources']?JSON['stringify'](_0x1b9119[_0x5aa595(0x14d)]):undefined}};await platformFetch(getApiDomain()+_0x5aa595(0x139),{'method':_0x5aa595(0x151),'body':_0x37a818,'cookie':_0x5203ff,'label':_0x5aa595(0x145)+_0x1b9119['label']+'\x22'}),logger['info'](_0x5aa595(0x14e),_0x5aa595(0x15d)+_0x1b9119[_0x5aa595(0x15b)],undefined);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x616b1a,_0x231956){const _0x5af39a=a60_0x37a2,_0x114f3b=_0x616b1a();while(!![]){try{const _0xd73004=parseInt(_0x5af39a(0x94))/0x1*(-parseInt(_0x5af39a(0xa8))/0x2)+-parseInt(_0x5af39a(0x96))/0x3+parseInt(_0x5af39a(0xaf))/0x4*(-parseInt(_0x5af39a(0xb3))/0x5)+parseInt(_0x5af39a(0xb1))/0x6+parseInt(_0x5af39a(0x9a))/0x7+parseInt(_0x5af39a(0xa4))/0x8+parseInt(_0x5af39a(0x9b))/0x9;if(_0xd73004===_0x231956)break;else _0x114f3b['push'](_0x114f3b['shift']());}catch(_0x2ce9d4){_0x114f3b['push'](_0x114f3b['shift']());}}}(a60_0x3211,0x46981));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x1291aa){const _0x4b0943=a60_0x37a2,_0x5ee7b5=[];return _0x1291aa['jsUrl']&&!isValidJsHttpsUrl(_0x1291aa['jsUrl'])&&_0x5ee7b5['push']({'field':_0x4b0943(0xb2),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x1291aa['cssUrl']&&!isValidCssHttpsUrl(_0x1291aa['cssUrl'])&&_0x5ee7b5[_0x4b0943(0xbc)]({'field':_0x4b0943(0x99),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x5ee7b5;}function a60_0x37a2(_0x1d33e9,_0x5c7c48){_0x1d33e9=_0x1d33e9-0x94;const _0x3211b6=a60_0x3211();let _0x37a294=_0x3211b6[_0x1d33e9];return _0x37a294;}export async function runMenuSyncCore(_0x7c99f6,_0x4617ff,_0x3ade94=[],_0xfde43b){const _0x17c7fe=a60_0x37a2,_0x4cb927=parseParamsFlag(_0xfde43b),_0x2adc30=_0x3ade94['length']>0x0?_0x3ade94:_0x4cb927[_0x17c7fe(0xb6)],_0xbcd810=_0x4cb927[_0x17c7fe(0xb2)],_0xebc9b7=_0x4cb927[_0x17c7fe(0x99)],_0x4c88f1=[];if(_0xbcd810)_0x4c88f1[_0x17c7fe(0xbc)](_0xbcd810);if(_0xebc9b7)_0x4c88f1[_0x17c7fe(0xbc)](_0xebc9b7);const _0xfa0b12=validateParams(_0x4cb927);if(_0xfa0b12['length']>0x0){const _0x137216=_0xfa0b12['map'](_0x30b5af=>_0x17c7fe(0x9c)+_0x30b5af[_0x17c7fe(0xa0)]+':\x20'+_0x30b5af[_0x17c7fe(0x95)])[_0x17c7fe(0xab)](';\x20');throw new Error(_0x17c7fe(0xb4)+_0x137216);}logger['setLogPath'](process[_0x17c7fe(0x9f)]()),logger[_0x17c7fe(0x97)](_0x17c7fe(0x9d),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x7c99f6,'selectedCount':_0x2adc30?.[_0x17c7fe(0x9e)],'jsUrl':_0xbcd810,'cssUrl':_0xebc9b7});if(_0xbcd810){const _0x4617d8=await isUrlReachable(_0xbcd810);if(!_0x4617d8)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0xbcd810);}if(_0xebc9b7){const _0x30d983=await isUrlReachable(_0xebc9b7);if(!_0x30d983)throw new Error(_0x17c7fe(0x98)+_0xebc9b7);}const _0x4d3d7f=getLocalPages();if(_0x4d3d7f[_0x17c7fe(0x9e)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x4bd70c=await getOnlineMenuList(_0x7c99f6,_0x4617ff),_0x5b5a0f=new Set(_0x4bd70c[_0x17c7fe(0xba)](_0x47b4d0=>_0x47b4d0[_0x17c7fe(0xb8)]));let _0x242cae;if(_0x2adc30&&_0x2adc30[_0x17c7fe(0x9e)]>0x0){const _0x3297aa=new Set(_0x2adc30['map'](_0x59efcb=>_0x59efcb[_0x17c7fe(0xa2)]()));_0x242cae=_0x4d3d7f['filter'](_0x16d8cd=>_0x3297aa['has'](_0x16d8cd[_0x17c7fe(0xae)]));if(_0x242cae[_0x17c7fe(0x9e)]===0x0){const _0x58dfff=_0x4d3d7f['map'](_0x5c8b65=>_0x5c8b65[_0x17c7fe(0xae)])['join'](',\x20');throw new Error(_0x17c7fe(0xb7)+[..._0x3297aa]['join'](',\x20')+'\x0a\x20\x20Available\x20local\x20pages:\x20'+_0x58dfff);}}else _0x242cae=_0x4d3d7f[_0x17c7fe(0xa9)](_0x52926a=>!_0x5b5a0f[_0x17c7fe(0xaa)](_0x52926a['path']));if(_0x242cae[_0x17c7fe(0x9e)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x7c99f6,_0x4617ff,_0x242cae,_0x4c88f1[_0x17c7fe(0x9e)]>0x0?_0x4c88f1:undefined),logger[_0x17c7fe(0x97)](_0x17c7fe(0x9d),_0x17c7fe(0xbd),{'count':_0x242cae[_0x17c7fe(0x9e)],'resources':_0x4c88f1}),{'created':_0x242cae[_0x17c7fe(0x9e)],'skipped':![],'targetPages':_0x242cae};}function a60_0x3211(){const _0x1bbeb8=['menu-sync','length','cwd','field','utf8','trim','isTTY','450960lpjYoS','stdin','concat','pages','765654VCArqm','filter','has','join','readableEnded','parse','label','16dKjYTK','string','1038654QYCCUk','jsUrl','114305YbDBYG','Invalid\x20--params:\x20','data','selectedLabels','No\x20local\x20pages\x20matched\x20labels:\x20','path','isArray','map','toString','push','Menu\x20sync\x20completed','1CiQzVl','message','1465668rFeecI','info','CSS\x20URL\x20is\x20unreachable:\x20','cssUrl','1470861PkbMUK','7311402xjNikD','--params.'];a60_0x3211=function(){return _0x1bbeb8;};return a60_0x3211();}export async function readPageLabelsFromStdin(){const _0x4dec96=a60_0x37a2;if(!process[_0x4dec96(0xa5)][_0x4dec96(0xa3)]&&!process[_0x4dec96(0xa5)][_0x4dec96(0xac)])return new Promise(_0x4e8b5d=>{const _0x391e87=_0x4dec96,_0x1be213=[];process[_0x391e87(0xa5)]['on'](_0x391e87(0xb5),_0x77355=>_0x1be213[_0x391e87(0xbc)](_0x77355)),process['stdin']['on']('end',()=>{const _0x35b8cd=_0x391e87,_0x38ff=Buffer[_0x35b8cd(0xa6)](_0x1be213)[_0x35b8cd(0xbb)](_0x35b8cd(0xa1)),_0x586a8f=_0x38ff['split']('\x0a')[_0x35b8cd(0xba)](_0x3c4003=>_0x3c4003[_0x35b8cd(0xa2)]())['filter'](_0x30015c=>_0x30015c[_0x35b8cd(0x9e)]>0x0&&!_0x30015c['startsWith']('#'));_0x4e8b5d(_0x586a8f);}),setTimeout(()=>_0x4e8b5d([]),0x1f4);});return[];}function parseParamsFlag(_0x2fc217){const _0x5b6477=a60_0x37a2;if(!_0x2fc217||typeof _0x2fc217!==_0x5b6477(0xb0))return{};try{const _0x58dbe3=JSON[_0x5b6477(0xad)](_0x2fc217);if(typeof _0x58dbe3!=='object'||_0x58dbe3===null||Array[_0x5b6477(0xb9)](_0x58dbe3))return{};return{'selectedLabels':Array[_0x5b6477(0xb9)](_0x58dbe3[_0x5b6477(0xa7)])?_0x58dbe3[_0x5b6477(0xa7)][_0x5b6477(0xba)](String):undefined,'jsUrl':typeof _0x58dbe3[_0x5b6477(0xb2)]===_0x5b6477(0xb0)?_0x58dbe3['jsUrl']['trim']():undefined,'cssUrl':typeof _0x58dbe3['cssUrl']==='string'?_0x58dbe3[_0x5b6477(0x99)][_0x5b6477(0xa2)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55602e,_0x45ff0a){const _0x13cf87=a62_0x14de,_0x18783d=_0x55602e();while(!![]){try{const _0x42afd1=parseInt(_0x13cf87(0x174))/0x1+-parseInt(_0x13cf87(0x170))/0x2+parseInt(_0x13cf87(0x15d))/0x3*(parseInt(_0x13cf87(0x15a))/0x4)+-parseInt(_0x13cf87(0x167))/0x5+-parseInt(_0x13cf87(0x169))/0x6+parseInt(_0x13cf87(0x179))/0x7+parseInt(_0x13cf87(0x161))/0x8*(parseInt(_0x13cf87(0x163))/0x9);if(_0x42afd1===_0x45ff0a)break;else _0x18783d['push'](_0x18783d['shift']());}catch(_0x2b3510){_0x18783d['push'](_0x18783d['shift']());}}}(a62_0x2ec3,0x7f1e6));import{updateMenuCdnUrl,getOnlineMenuList}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a62_0x14de(_0xbb7a33,_0x24c5e9){_0xbb7a33=_0xbb7a33-0x158;const _0x2ec321=a62_0x2ec3();let _0x14defd=_0x2ec321[_0xbb7a33];return _0x14defd;}import{logger}from'../../../utils/logger.js';function validateParams(_0x2c5682){const _0x1b1e6e=a62_0x14de,_0x58d38b=[];return _0x2c5682[_0x1b1e6e(0x16a)]&&!isValidJsHttpsUrl(_0x2c5682[_0x1b1e6e(0x16a)])&&_0x58d38b[_0x1b1e6e(0x16e)]({'field':_0x1b1e6e(0x16a),'message':_0x1b1e6e(0x172)}),_0x2c5682[_0x1b1e6e(0x162)]&&!isValidCssHttpsUrl(_0x2c5682[_0x1b1e6e(0x162)])&&_0x58d38b[_0x1b1e6e(0x16e)]({'field':_0x1b1e6e(0x162),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x58d38b;}export async function runMenuUpdateCore(_0x27034c,_0x11854b,_0x1e4db2){const _0x4d6fa1=a62_0x14de,_0x4f02c7=parseUpdateParamsFlag(_0x1e4db2),_0xa36ca=[];if(_0x4f02c7[_0x4d6fa1(0x16a)])_0xa36ca['push'](_0x4f02c7[_0x4d6fa1(0x16a)]);if(_0x4f02c7[_0x4d6fa1(0x162)])_0xa36ca[_0x4d6fa1(0x16e)](_0x4f02c7[_0x4d6fa1(0x162)]);const _0x45708e=validateParams(_0x4f02c7);if(_0x45708e[_0x4d6fa1(0x178)]>0x0){const _0x18f6a4=_0x45708e[_0x4d6fa1(0x171)](_0x3b9b82=>_0x4d6fa1(0x175)+_0x3b9b82['field']+':\x20'+_0x3b9b82[_0x4d6fa1(0x160)])[_0x4d6fa1(0x16b)](';\x20');throw new Error(_0x4d6fa1(0x159)+_0x18f6a4);}logger[_0x4d6fa1(0x158)](process['cwd']()),logger['info']('menu-update','Start\x20non-interactive\x20menu\x20update',{'appCode':_0x27034c,'jsUrl':_0x4f02c7[_0x4d6fa1(0x16a)],'cssUrl':_0x4f02c7[_0x4d6fa1(0x162)]});if(_0x4f02c7[_0x4d6fa1(0x16a)]){const _0x280556=await isUrlReachable(_0x4f02c7[_0x4d6fa1(0x16a)]);if(!_0x280556)throw new Error(_0x4d6fa1(0x15e)+_0x4f02c7['jsUrl']);}if(_0x4f02c7['cssUrl']){const _0x1db04d=await isUrlReachable(_0x4f02c7[_0x4d6fa1(0x162)]);if(!_0x1db04d)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x4f02c7[_0x4d6fa1(0x162)]);}const _0x461d80=await getOnlineMenuList(_0x27034c,_0x11854b),_0x4afdec=_0x461d80[_0x4d6fa1(0x166)](_0x1bfda7=>_0x1bfda7[_0x4d6fa1(0x16d)][_0x4d6fa1(0x178)]>0x0);if(_0x4afdec[_0x4d6fa1(0x178)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x5d6776=await Promise[_0x4d6fa1(0x15f)](_0x4afdec[_0x4d6fa1(0x171)](_0x1725a8=>updateMenuCdnUrl(_0x27034c,_0x11854b,{'id':_0x1725a8['id'],'label':_0x1725a8[_0x4d6fa1(0x165)],'path':_0x1725a8[_0x4d6fa1(0x15c)],'resources':_0xa36ca}))),_0x185957=_0x5d6776[_0x4d6fa1(0x166)](_0xfbe2a2=>_0xfbe2a2[_0x4d6fa1(0x16f)]==='rejected')[_0x4d6fa1(0x178)];return logger[_0x4d6fa1(0x177)](_0x4d6fa1(0x176),_0x4d6fa1(0x173),{'count':_0x4afdec[_0x4d6fa1(0x178)],'resources':_0xa36ca}),{'updated':_0x4afdec[_0x4d6fa1(0x178)]-_0x185957,'failed':_0x185957,'skipped':![]};}function a62_0x2ec3(){const _0x3afc1f=['1103326HwdRLQ','setLogPath','Invalid\x20--params:\x20','164zFTqsH','isArray','path','34098yZOLYt','JS\x20URL\x20is\x20unreachable:\x20','allSettled','message','2562944cDaoaA','cssUrl','18cknWUK','parse','label','filter','3583200EkSTim','string','1286964aFdfME','jsUrl','join','trim','resources','push','status','629162EYspru','map','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Menu\x20update\x20completed','502033xGrMVR','--params.','menu-update','info','length'];a62_0x2ec3=function(){return _0x3afc1f;};return a62_0x2ec3();}function parseUpdateParamsFlag(_0x3cb43b){const _0x2ed7f2=a62_0x14de;if(!_0x3cb43b||typeof _0x3cb43b!==_0x2ed7f2(0x168))return{};try{const _0x42a29e=JSON[_0x2ed7f2(0x164)](_0x3cb43b);if(typeof _0x42a29e!=='object'||_0x42a29e===null||Array[_0x2ed7f2(0x15b)](_0x42a29e))return{};return{'jsUrl':typeof _0x42a29e[_0x2ed7f2(0x16a)]===_0x2ed7f2(0x168)?_0x42a29e[_0x2ed7f2(0x16a)][_0x2ed7f2(0x16c)]():undefined,'cssUrl':typeof _0x42a29e[_0x2ed7f2(0x162)]===_0x2ed7f2(0x168)?_0x42a29e[_0x2ed7f2(0x162)][_0x2ed7f2(0x16c)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2b4b29,_0x1dc587){const _0x235b39=a63_0x2501,_0x5afc19=_0x2b4b29();while(!![]){try{const _0x56ae46=parseInt(_0x235b39(0x1b0))/0x1*(-parseInt(_0x235b39(0x1b7))/0x2)+-parseInt(_0x235b39(0x1b8))/0x3+parseInt(_0x235b39(0x1b3))/0x4+-parseInt(_0x235b39(0x1ba))/0x5*(-parseInt(_0x235b39(0x1b6))/0x6)+-parseInt(_0x235b39(0x1b1))/0x7*(-parseInt(_0x235b39(0x1b9))/0x8)+-parseInt(_0x235b39(0x1b5))/0x9+parseInt(_0x235b39(0x1b2))/0xa*(parseInt(_0x235b39(0x1ae))/0xb);if(_0x56ae46===_0x1dc587)break;else _0x5afc19['push'](_0x5afc19['shift']());}catch(_0x510168){_0x5afc19['push'](_0x5afc19['shift']());}}}(a63_0x2363,0x933e8));export function isValidJsHttpsUrl(_0x1d776c){const _0x4d64e8=a63_0x2501;return/^https:\/\/.+\.js(\?.*)?$/[_0x4d64e8(0x1b4)](_0x1d776c[_0x4d64e8(0x1bb)]());}function a63_0x2501(_0xf082cd,_0x2ec02d){_0xf082cd=_0xf082cd-0x1ae;const _0x236353=a63_0x2363();let _0x250124=_0x236353[_0xf082cd];return _0x250124;}function a63_0x2363(){const _0x1b01ba=['5823378EfRRoc','24uJEPSF','1198OOWyxm','2349852wBCcPO','32MhfLDC','225635xGdxYF','trim','7777mmiXSe','HEAD','1603ioFizH','1920478qPrgMr','21940SNcPBI','658212ZBWGcZ','test'];a63_0x2363=function(){return _0x1b01ba;};return a63_0x2363();}export function isValidCssHttpsUrl(_0x2be543){const _0x4c691a=a63_0x2501;return/^https:\/\/.+\.css(\?.*)?$/[_0x4c691a(0x1b4)](_0x2be543['trim']());}export async function isUrlReachable(_0x2dbc53){const _0x302080=a63_0x2501;try{const _0x48fb7b=await fetch(_0x2dbc53,{'method':_0x302080(0x1af)});return _0x48fb7b['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x5925f1=a64_0x12fc;(function(_0x5d0e76,_0x5648b7){const _0x3035a5=a64_0x12fc,_0x57786d=_0x5d0e76();while(!![]){try{const _0x595ff7=-parseInt(_0x3035a5(0x165))/0x1+-parseInt(_0x3035a5(0x14d))/0x2*(-parseInt(_0x3035a5(0x159))/0x3)+-parseInt(_0x3035a5(0x16b))/0x4*(parseInt(_0x3035a5(0x163))/0x5)+parseInt(_0x3035a5(0x16a))/0x6+parseInt(_0x3035a5(0x162))/0x7+parseInt(_0x3035a5(0x160))/0x8+-parseInt(_0x3035a5(0x17f))/0x9*(-parseInt(_0x3035a5(0x15b))/0xa);if(_0x595ff7===_0x5648b7)break;else _0x57786d['push'](_0x57786d['shift']());}catch(_0x17e60e){_0x57786d['push'](_0x57786d['shift']());}}}(a64_0xeeae,0x9d530));import a64_0xb92eca 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':a64_0x5925f1(0x16c),'risk':a64_0x5925f1(0x177),'flags':[{'name':a64_0x5925f1(0x14f),'type':a64_0x5925f1(0x149),'description':'Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20'+a64_0x5925f1(0x175)},{'name':a64_0x5925f1(0x150),'type':a64_0x5925f1(0x167),'description':a64_0x5925f1(0x151)}],async 'execute'(_0x3dc74b){const _0x3ea0a2=a64_0x5925f1,_0x3b7a6d=_0x3dc74b['flag']('yes'),_0xb12179=_0x3dc74b[_0x3ea0a2(0x148)]('params'),_0x375cdf=parseParams(_0xb12179),_0x3a2f80=!!(_0x375cdf[_0x3ea0a2(0x16e)]||_0x375cdf[_0x3ea0a2(0x14b)]||_0x375cdf['pages']&&_0x375cdf[_0x3ea0a2(0x173)][_0x3ea0a2(0x174)]>0x0);if(_0x3b7a6d||_0x3a2f80){let _0x2455c9=[];!isInteractive()&&!_0x375cdf[_0x3ea0a2(0x173)]?.[_0x3ea0a2(0x174)]&&(_0x2455c9=await readPageLabelsFromStdin());const _0x588d1b=await runMenuSyncCore(_0x3dc74b['appCode'],_0x3dc74b[_0x3ea0a2(0x168)],_0x2455c9[_0x3ea0a2(0x174)]>0x0?_0x2455c9:_0x375cdf[_0x3ea0a2(0x173)]??[],_0xb12179);if(_0x588d1b['skipped']){const _0x3acd05=getLocalPages();_0x3acd05[_0x3ea0a2(0x174)]===0x0?console[_0x3ea0a2(0x157)](_0x3ea0a2(0x14e)):console['log'](_0x3ea0a2(0x153));}else console[_0x3ea0a2(0x157)]('✓\x20Menu\x20sync\x20completed:\x20'+_0x588d1b[_0x3ea0a2(0x178)]+_0x3ea0a2(0x17b));return{'ok':!![]};}requireInteractive();const _0x2b02ba=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x522d84,_0x3e377e,_0x38499e;try{const _0x27f196=await fetchMenuData(_0x3dc74b[_0x3ea0a2(0x155)],_0x3dc74b[_0x3ea0a2(0x168)]);_0x522d84=_0x27f196[_0x3ea0a2(0x179)],_0x3e377e=_0x27f196[_0x3ea0a2(0x15f)],_0x38499e=_0x27f196['onlineMenuList'],stopSpinner(_0x2b02ba,_0x3ea0a2(0x161),!![]);}catch(_0x1e1010){stopSpinner(_0x2b02ba,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x3ea0a2(0x169)](_0x1e1010 instanceof Error?_0x1e1010[_0x3ea0a2(0x16d)]:_0x3ea0a2(0x158));}if(_0x522d84[_0x3ea0a2(0x174)]===0x0)return console[_0x3ea0a2(0x157)](a64_0xb92eca[_0x3ea0a2(0x156)]('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x1bff17=buildCompareRows(_0x522d84,_0x3e377e);console[_0x3ea0a2(0x157)](renderCompareTable(_0x1bff17)),console[_0x3ea0a2(0x157)]();const _0x3d63eb=_0x375cdf[_0x3ea0a2(0x173)],_0x2cd494=await selectPages(_0x522d84,_0x3e377e,_0x3d63eb);console['log'](),console[_0x3ea0a2(0x157)](a64_0xb92eca[_0x3ea0a2(0x170)](_0x3ea0a2(0x14a)+_0x2cd494[_0x3ea0a2(0x174)]+'\x20page(s)'));const _0x41f027=_0x375cdf[_0x3ea0a2(0x16e)]&&_0x375cdf['cssUrl'];if(!_0x41f027){console['log'](renderSyncSummary(_0x2cd494,_0x3e377e[_0x3ea0a2(0x17a)]>0x0));const _0x47c0df=await askConfirm(_0x3ea0a2(0x16f));if(!_0x47c0df)return console['log'](a64_0xb92eca[_0x3ea0a2(0x176)](_0x3ea0a2(0x15d))),{'ok':!![]};}let _0x433795=_0x375cdf[_0x3ea0a2(0x16e)],_0x20782b=_0x375cdf[_0x3ea0a2(0x14b)];!_0x433795&&(_0x433795=await askJsUrl());!_0x20782b&&(_0x20782b=await askCssUrl());const _0x43d9e9=await askConfirm(_0x3ea0a2(0x17d)+_0x2cd494[_0x3ea0a2(0x174)]+_0x3ea0a2(0x15e)+_0x433795+_0x3ea0a2(0x171)+_0x20782b+'?');if(!_0x43d9e9)return console[_0x3ea0a2(0x157)](a64_0xb92eca['gray']('\x20\x20Cancelled.')),{'ok':!![]};const _0x119064=[_0x433795,_0x20782b],_0x53e20d=startSpinner('Creating\x20'+_0x2cd494[_0x3ea0a2(0x174)]+_0x3ea0a2(0x15a));try{const _0x5dbc3a=await doCreateMenus(_0x3dc74b[_0x3ea0a2(0x155)],_0x3dc74b[_0x3ea0a2(0x168)],_0x2cd494,_0x119064);return stopSpinner(_0x53e20d,_0x3ea0a2(0x17e)+_0x5dbc3a[_0x3ea0a2(0x178)]+_0x3ea0a2(0x154),!![]),{'ok':!![],'data':_0x5dbc3a,'message':_0x3ea0a2(0x17c)+_0x5dbc3a[_0x3ea0a2(0x178)]+_0x3ea0a2(0x172)+_0x5dbc3a['failed']+'\x20failed.'};}catch(_0x3084db){stopSpinner(_0x53e20d,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x3ea0a2(0x169)](_0x3084db instanceof Error?_0x3084db[_0x3ea0a2(0x16d)]:_0x3ea0a2(0x164));}}};function a64_0x12fc(_0x573535,_0x44125c){_0x573535=_0x573535-0x148;const _0xeeae92=a64_0xeeae();let _0x12fc94=_0xeeae92[_0x573535];return _0x12fc94;}function parseParams(_0x413d89){const _0x12b0a4=a64_0x5925f1;if(!_0x413d89)return{};try{const _0x5b9f85=JSON['parse'](_0x413d89);if(typeof _0x5b9f85!==_0x12b0a4(0x15c)||_0x5b9f85===null||Array['isArray'](_0x5b9f85))return{};return{'jsUrl':typeof _0x5b9f85[_0x12b0a4(0x16e)]===_0x12b0a4(0x149)?_0x5b9f85[_0x12b0a4(0x16e)][_0x12b0a4(0x14c)]():undefined,'cssUrl':typeof _0x5b9f85['cssUrl']===_0x12b0a4(0x149)?_0x5b9f85[_0x12b0a4(0x14b)]['trim']():undefined,'pages':Array[_0x12b0a4(0x152)](_0x5b9f85[_0x12b0a4(0x173)])?_0x5b9f85[_0x12b0a4(0x173)][_0x12b0a4(0x166)](String):undefined};}catch{return{};}}function a64_0xeeae(){const _0x101508=['\x20menu(s)...','190FODOzP','object','\x20\x20Cancelled.','\x20menu(s)\x20with\x20JS:\x20','onlinePaths','2908952peqLsm','Online\x20menu\x20list\x20fetched','8714097SzMUsW','119785UOsfaL','Menu\x20creation\x20failed','1152182RVqLWk','map','boolean','cookie','validation','3507840qzMWGC','172rXwsen','Sync\x20local\x20pages\x20as\x20platform\x20menus','message','jsUrl','\x20\x20Continue\x20with\x20creation?','cyan','\x20and\x20CSS:\x20','\x20created,\x20','pages','length','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','gray','write','created','localPages','size','\x20menu(s)\x20created','Menu\x20sync\x20completed:\x20','\x20\x20Create\x20','Created\x20','280989cpghEd','str','string','\x20\x20✓\x20Selected:\x20','cssUrl','trim','26swjIUS','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','params','yes','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','isArray','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20menu(s)','appCode','yellow','log','Failed\x20to\x20fetch\x20online\x20menu\x20list','9324qcUKdh'];a64_0xeeae=function(){return _0x101508;};return a64_0xeeae();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x5029cd=a65_0x4ef5;function a65_0xc7df(){const _0x4be47a=['11110984rSGMTf','4115430wqRglC','✓\x20Menu\x20update\x20completed:\x20','update','appCode','365535lsGLIm','updated','Failed\x20to\x20fetch\x20online\x20menu\x20list','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','\x20and\x20CSS:\x20','3290844BUDrEc','boolean','str','object','yellow','jsUrl','label','string','write','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','failed','params','flag','map','error','\x20failed.','\x20\x20Update\x20','trim','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','4465281REyarF','\x20menu(s)\x20failed','cssUrl','\x20updated.','7OVfZaG','\x20menu(s)','\x20menu(s)...','\x20\x20Found\x20','message','cookie','784241YEhjTN','Fetching\x20online\x20menu\x20list...','\x20menu(s)\x20with\x20JS:\x20','isArray','validation','4399850egBUnO','\x20\x20Cancelled.','gray','cyan','Menu\x20update\x20completed:\x20','2GRBwSN','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','skipped','yes','log','Menu\x20update\x20failed','4LjrTeA','length','parse','Updated\x20'];a65_0xc7df=function(){return _0x4be47a;};return a65_0xc7df();}(function(_0x268a46,_0x482657){const _0x515346=a65_0x4ef5,_0x2d263e=_0x268a46();while(!![]){try{const _0x3ae5b0=-parseInt(_0x515346(0x191))/0x1*(-parseInt(_0x515346(0x19b))/0x2)+parseInt(_0x515346(0x187))/0x3*(parseInt(_0x515346(0x1a1))/0x4)+parseInt(_0x515346(0x1a6))/0x5+-parseInt(_0x515346(0x1b0))/0x6*(parseInt(_0x515346(0x18b))/0x7)+-parseInt(_0x515346(0x1a5))/0x8+parseInt(_0x515346(0x1aa))/0x9+-parseInt(_0x515346(0x196))/0xa;if(_0x3ae5b0===_0x482657)break;else _0x2d263e['push'](_0x2d263e['shift']());}catch(_0x594770){_0x2d263e['push'](_0x2d263e['shift']());}}}(a65_0xc7df,0xb94fd));import a65_0x287705 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';function a65_0x4ef5(_0x4a0127,_0x562de8){_0x4a0127=_0x4a0127-0x186;const _0xc7df6d=a65_0xc7df();let _0x4ef5e6=_0xc7df6d[_0x4a0127];return _0x4ef5e6;}import{CliErrors}from'../../errors.js';import{runMenuUpdateCore}from'./shared/update-core.js';export const menuUpdate={'service':'menu','command':a65_0x5029cd(0x1a8),'description':a65_0x5029cd(0x1ae),'risk':a65_0x5029cd(0x1b8),'flags':[{'name':a65_0x5029cd(0x1bb),'type':'string','description':a65_0x5029cd(0x1ad)+a65_0x5029cd(0x186)},{'name':a65_0x5029cd(0x19e),'type':a65_0x5029cd(0x1b1),'description':a65_0x5029cd(0x19c)}],async 'execute'(_0x27156a){const _0x2b35d2=a65_0x5029cd,_0x24aaee=_0x27156a[_0x2b35d2(0x1bc)](_0x2b35d2(0x19e)),_0x36c1cf=_0x27156a[_0x2b35d2(0x1b2)](_0x2b35d2(0x1bb)),_0x388a5f=parseParams(_0x36c1cf),_0x4c7b2d=!!(_0x388a5f[_0x2b35d2(0x1b5)]||_0x388a5f[_0x2b35d2(0x189)]);if(_0x24aaee||_0x4c7b2d&&!isInteractive()){const _0x19cbcd=await runMenuUpdateCore(_0x27156a[_0x2b35d2(0x1a9)],_0x27156a['cookie'],_0x36c1cf);return _0x19cbcd[_0x2b35d2(0x19d)]?console['log'](_0x2b35d2(0x1b9)):(console[_0x2b35d2(0x19f)](_0x2b35d2(0x1a7)+_0x19cbcd[_0x2b35d2(0x1ab)]+'\x20menu(s)\x20updated'),_0x19cbcd['failed']>0x0&&console[_0x2b35d2(0x1be)]('!\x20'+_0x19cbcd[_0x2b35d2(0x1ba)]+_0x2b35d2(0x188))),{'ok':_0x19cbcd['failed']===0x0};}requireInteractive();const _0x3ce5b5=startSpinner(_0x2b35d2(0x192));let _0x1192a1;try{_0x1192a1=await fetchOnlineMenuList(_0x27156a[_0x2b35d2(0x1a9)],_0x27156a[_0x2b35d2(0x190)]),stopSpinner(_0x3ce5b5,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x2f00c7){stopSpinner(_0x3ce5b5,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors[_0x2b35d2(0x195)](_0x2f00c7 instanceof Error?_0x2f00c7[_0x2b35d2(0x18f)]:_0x2b35d2(0x1ac));}const _0x2d6125=filterMenusWithResources(_0x1192a1);if(_0x2d6125['length']===0x0)return console[_0x2b35d2(0x19f)](a65_0x287705[_0x2b35d2(0x1b4)]('\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found')),{'ok':!![]};console[_0x2b35d2(0x19f)](),console[_0x2b35d2(0x19f)](a65_0x287705[_0x2b35d2(0x199)](_0x2b35d2(0x18e)+_0x2d6125['length']+'\x20menu(s)\x20with\x20existing\x20resources')),console['log'](renderUpdateSummary(_0x2d6125[_0x2b35d2(0x1bd)](_0x1ccb3e=>_0x1ccb3e[_0x2b35d2(0x1b6)]),[_0x388a5f[_0x2b35d2(0x1b5)],_0x388a5f['cssUrl']])),console[_0x2b35d2(0x19f)]();let _0x10f758=_0x388a5f[_0x2b35d2(0x1b5)],_0x33ffa7=_0x388a5f[_0x2b35d2(0x189)];!_0x10f758&&(_0x10f758=await askJsUrl());!_0x33ffa7&&(_0x33ffa7=await askCssUrl());const _0x39b4ba=await askConfirm(_0x2b35d2(0x1c0)+_0x2d6125[_0x2b35d2(0x1a2)]+_0x2b35d2(0x193)+_0x10f758+_0x2b35d2(0x1af)+_0x33ffa7+'?');if(!_0x39b4ba)return console[_0x2b35d2(0x19f)](a65_0x287705[_0x2b35d2(0x198)](_0x2b35d2(0x197))),{'ok':!![]};const _0x858c7e=[_0x10f758,_0x33ffa7],_0x599e81=startSpinner('Updating\x20'+_0x2d6125['length']+_0x2b35d2(0x18d));try{const _0x5e499d=await doUpdateCdnUrls(_0x27156a['appCode'],_0x27156a['cookie'],_0x2d6125,_0x858c7e);return stopSpinner(_0x599e81,_0x2b35d2(0x1a4)+_0x5e499d[_0x2b35d2(0x1ab)]+_0x2b35d2(0x18c),_0x5e499d[_0x2b35d2(0x1ba)]===0x0),{'ok':_0x5e499d[_0x2b35d2(0x1ba)]===0x0,'data':_0x5e499d,'message':_0x5e499d[_0x2b35d2(0x1ba)]>0x0?_0x2b35d2(0x19a)+_0x5e499d[_0x2b35d2(0x1ab)]+'\x20updated,\x20'+_0x5e499d[_0x2b35d2(0x1ba)]+_0x2b35d2(0x1bf):_0x2b35d2(0x19a)+_0x5e499d[_0x2b35d2(0x1ab)]+_0x2b35d2(0x18a)};}catch(_0x5e61c4){stopSpinner(_0x599e81,'Menu\x20update\x20failed',![]);throw CliErrors[_0x2b35d2(0x195)](_0x5e61c4 instanceof Error?_0x5e61c4[_0x2b35d2(0x18f)]:_0x2b35d2(0x1a0));}}};function parseParams(_0x2c30a2){const _0xa8a5b=a65_0x5029cd;if(!_0x2c30a2)return{};try{const _0x268066=JSON[_0xa8a5b(0x1a3)](_0x2c30a2);if(typeof _0x268066!==_0xa8a5b(0x1b3)||_0x268066===null||Array[_0xa8a5b(0x194)](_0x268066))return{};return{'jsUrl':typeof _0x268066[_0xa8a5b(0x1b5)]===_0xa8a5b(0x1b7)?_0x268066[_0xa8a5b(0x1b5)][_0xa8a5b(0x1c1)]():undefined,'cssUrl':typeof _0x268066[_0xa8a5b(0x189)]===_0xa8a5b(0x1b7)?_0x268066[_0xa8a5b(0x189)][_0xa8a5b(0x1c1)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc2c9c0,_0x47b201){const _0x482754=a66_0x5ab3,_0x10548d=_0xc2c9c0();while(!![]){try{const _0x39e2a5=parseInt(_0x482754(0x180))/0x1*(-parseInt(_0x482754(0x16c))/0x2)+parseInt(_0x482754(0x16b))/0x3*(-parseInt(_0x482754(0x16f))/0x4)+parseInt(_0x482754(0x17c))/0x5+parseInt(_0x482754(0x17f))/0x6+parseInt(_0x482754(0x17a))/0x7*(-parseInt(_0x482754(0x176))/0x8)+parseInt(_0x482754(0x178))/0x9*(-parseInt(_0x482754(0x172))/0xa)+parseInt(_0x482754(0x17b))/0xb;if(_0x39e2a5===_0x47b201)break;else _0x10548d['push'](_0x10548d['shift']());}catch(_0x32b121){_0x10548d['push'](_0x10548d['shift']());}}}(a66_0x4bfb,0x2c131));import{existsSync}from'node:fs';import a66_0x455652 from'node:path';import a66_0x990ed1 from'chalk';import{input,confirm}from'@inquirer/prompts';function a66_0x5ab3(_0x44bf22,_0x3253f5){_0x44bf22=_0x44bf22-0x166;const _0x4bfb5=a66_0x4bfb();let _0x5ab3b1=_0x4bfb5[_0x44bf22];return _0x5ab3b1;}import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a66_0x4bfb(){const _0x5d8541=['cyan','\x22\x20already\x20exists','8gUqLuf','√\x20App\x20Code:\x20','18LgFESg','my-app','2169524LJleBu','7066565XciQrz','944015plRxSe','Skipped','√\x20Project\x20Name:\x20','1752186qfZCSq','1ZMTSwh','string','log','√\x20Login\x20status:\x20','green','Not\x20set','cwd','Directory\x20\x22','production','153BgavKf','558562epikpd','trim','env','13732QKHagE','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Logged\x20in','892120iUoOfl','test'];a66_0x4bfb=function(){return _0x5d8541;};return a66_0x4bfb();}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../common/app-selector.js';export async function guidedCreateProject(_0x436dd4,_0x477088,_0x15dcca){const _0x31d049=a66_0x5ab3,_0x1f3fcc=_0x31d049(0x179),_0xd3dc1e=readConfig(),_0x31af74=typeof _0xd3dc1e[_0x31d049(0x16e)]===_0x31d049(0x181)?_0xd3dc1e[_0x31d049(0x16e)]:undefined,_0x4e94b3=await input({'message':'Project\x20name:','default':_0x1f3fcc,'validate':_0x2c53b9=>{const _0x577ec2=_0x31d049,_0x34cc78=_0x2c53b9[_0x577ec2(0x16d)]()||_0x1f3fcc;if(_0x34cc78['length']>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x4337bd=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x34cc78&&!_0x4337bd[_0x577ec2(0x173)](_0x34cc78))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x4f80c5=a66_0x455652['resolve'](process[_0x577ec2(0x168)](),_0x34cc78);if(existsSync(_0x4f80c5))return _0x577ec2(0x169)+_0x34cc78+_0x577ec2(0x175);return!![];}});console[_0x31d049(0x182)](a66_0x990ed1[_0x31d049(0x166)](_0x31d049(0x17e)+a66_0x990ed1[_0x31d049(0x174)](_0x4e94b3)));const _0x5a5af4=await selectSingleAppcode(_0x15dcca);console[_0x31d049(0x182)](a66_0x990ed1[_0x31d049(0x166)](_0x31d049(0x177)+a66_0x990ed1[_0x31d049(0x174)](_0x5a5af4||_0x31d049(0x167))));if(_0x5a5af4){const _0x52720a=await getIsSessionValid();if(!_0x52720a){const _0x52a77d=await confirm({'message':_0x31d049(0x170),'default':!![]});if(_0x52a77d){const _0x498a33=await authServer({'silent':!![]});console[_0x31d049(0x182)](a66_0x990ed1[_0x31d049(0x166)](_0x31d049(0x183)+a66_0x990ed1[_0x31d049(0x174)](_0x498a33?_0x31d049(0x171):'Login\x20failed')));}else console[_0x31d049(0x182)](a66_0x990ed1[_0x31d049(0x166)](_0x31d049(0x183)+a66_0x990ed1['cyan'](_0x31d049(0x17d))));}await _0x436dd4({'projectName':_0x4e94b3,'appCode':_0x5a5af4,'env':_0x477088||_0x31af74||_0x31d049(0x16a)});}else await _0x436dd4({'projectName':_0x4e94b3,'env':_0x477088||_0x31af74||_0x31d049(0x16a)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50157c,_0x3185a9){const _0x3453f0=a67_0x47f2,_0x1e1ce4=_0x50157c();while(!![]){try{const _0xfb9e66=parseInt(_0x3453f0(0x102))/0x1*(-parseInt(_0x3453f0(0xff))/0x2)+-parseInt(_0x3453f0(0x100))/0x3+parseInt(_0x3453f0(0x101))/0x4+parseInt(_0x3453f0(0xfa))/0x5*(-parseInt(_0x3453f0(0xfc))/0x6)+-parseInt(_0x3453f0(0xfb))/0x7+parseInt(_0x3453f0(0xfe))/0x8+-parseInt(_0x3453f0(0xfd))/0x9*(-parseInt(_0x3453f0(0xf9))/0xa);if(_0xfb9e66===_0x3185a9)break;else _0x1e1ce4['push'](_0x1e1ce4['shift']());}catch(_0x241f89){_0x1e1ce4['push'](_0x1e1ce4['shift']());}}}(a67_0x4794,0xda72f));function a67_0x4794(){const _0x2586a5=['848330DtbcPk','1250BeVXOP','1285ZiUPDS','6067929WxiApo','38922MEHNOY','153099kGBYWR','6875592SOTMkQ','2KsPQAw','312849VgSHZb','5582248ZJgien'];a67_0x4794=function(){return _0x2586a5;};return a67_0x4794();}function a67_0x47f2(_0x4b8dfd,_0x112aa1){_0x4b8dfd=_0x4b8dfd-0xf9;const _0x47946a=a67_0x4794();let _0x47f2ae=_0x47946a[_0x4b8dfd];return _0x47f2ae;}export function formatElapsed(_0x11ccc7){const _0x3192bc=Date['now']()-_0x11ccc7;if(_0x3192bc<0x3e8)return _0x3192bc+'ms';const _0x1f26c1=(_0x3192bc/0x3e8)['toFixed'](0x2),_0x4ea139=_0x1f26c1['replace'](/\.?0+$/u,'');return _0x4ea139+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x41c0d0,_0x372c6d){const _0x21a367=a68_0x2df0,_0x9e2611=_0x41c0d0();while(!![]){try{const _0x366e02=parseInt(_0x21a367(0x14a))/0x1*(-parseInt(_0x21a367(0x13b))/0x2)+-parseInt(_0x21a367(0x12b))/0x3+parseInt(_0x21a367(0x142))/0x4*(parseInt(_0x21a367(0x146))/0x5)+parseInt(_0x21a367(0x14c))/0x6*(-parseInt(_0x21a367(0x11d))/0x7)+-parseInt(_0x21a367(0x157))/0x8+parseInt(_0x21a367(0x147))/0x9+parseInt(_0x21a367(0x11a))/0xa;if(_0x366e02===_0x372c6d)break;else _0x9e2611['push'](_0x9e2611['shift']());}catch(_0x49117e){_0x9e2611['push'](_0x9e2611['shift']());}}}(a68_0x22da,0x79e9e));import a68_0x2b10c9 from'path';function a68_0x22da(){const _0x4c14ae=['constants','2918968wNamWd','trim','cookie','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','needsUpgrade','stringify','W_OK','*\x20Pulling\x20API\x20configuration...','test','1.0.0','error','*\x20Configuring\x20AppCode\x20for\x20project\x20','readFileSync','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','stop','cwd','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','\x20|\x20AppCode:\x20','🚀\x20Next\x20Steps:','modelCount','resolve','CLI\x20版本检查','配置应用AppCode:\x20','API\x20configuration\x20pulled:\x20','\x20&&\x20','success','bold','开始创建项目:\x20','existsSync','11114060gAlkia','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','green','21PbUJZu','√\x20package.json\x20updated:\x20name=','\x20run\x20start','appCode','Project\x20name\x20cannot\x20be\x20empty','更新\x20package.json\x20失败','Project\x20name:\x20','projectName','writeFileSync','version','log','warn','package.json','更新\x20package.json\x20name','604650CBoFiK','string','...','\x20model(s)','√\x20Pulled\x20','chdir','join','\x20Generated\x20by\x20rabetbase\x20cli\x20','env','currentVersion','message','项目创建完成:\x20','gray','rmSync','production','start','2diZdTZ','项目创建失败:\x20','toLocaleString','fail','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','projectCode','API\x20配置拉取异常','11668JPtAXF','create','length','dirname','605AOeUvH','1277055ELBiKS','cyan','\x20√\x20','130667NaXaXD','\x20already\x20exists','819624OersLc','清理项目目录失败:\x20','Copy\x20project\x20files','./src/api/','repeat','utf8','\x20\x202.\x20Pull\x20API\x20configuration:\x20','info','cd\x20','parse'];a68_0x22da=function(){return _0x4c14ae;};return a68_0x22da();}import a68_0x5d69b9 from'fs';import a68_0x1b097c from'chalk';import a68_0x6e0d75 from'ora';import{guidedCreateProject}from'./enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'./use-copy-project-template.js';import{installDependencies}from'./use-install-dependencies.js';import{formatProjectCode}from'./use-format-code.js';import{logger}from'../../../utils/logger.js';function a68_0x2df0(_0x1a29d7,_0x4ed4a7){_0x1a29d7=_0x1a29d7-0x104;const _0x22da13=a68_0x22da();let _0x2df025=_0x22da13[_0x1a29d7];return _0x2df025;}import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{selectSingleAppcode}from'../../common/app-selector.js';import{getRabetbaseCliPackageRoot}from'./project-template-path.js';export async function createApp(_0x191165){const _0x5ce7b8=a68_0x2df0,_0x3cdd59=await checkCliVersion();_0x3cdd59[_0x5ce7b8(0x15b)]&&(printCliUpgradeWarning(_0x3cdd59),logger[_0x5ce7b8(0x153)]('create',_0x5ce7b8(0x112),{'currentVersion':_0x3cdd59[_0x5ce7b8(0x134)],'stableVersion':_0x3cdd59['stableVersion'],'needsUpgrade':_0x3cdd59[_0x5ce7b8(0x15b)]}));if(_0x191165[_0x5ce7b8(0x140)]&&_0x191165[_0x5ce7b8(0x120)])await runCreate({'projectName':_0x191165[_0x5ce7b8(0x140)],'appCode':_0x191165[_0x5ce7b8(0x120)],'env':_0x191165[_0x5ce7b8(0x133)]},_0x191165);else{if(_0x191165['projectCode']){const _0x595ad1=await selectSingleAppcode(_0x191165[_0x5ce7b8(0x159)]);await runCreate({'projectName':_0x191165[_0x5ce7b8(0x140)],'appCode':_0x595ad1||undefined,'env':_0x191165[_0x5ce7b8(0x133)]},_0x191165);}else await guidedCreateProject(_0x3b6d91=>runCreate(_0x3b6d91,_0x191165),_0x191165[_0x5ce7b8(0x133)],_0x191165[_0x5ce7b8(0x159)]);}}async function runCreate(_0x50adaa,_0x45b4d0){const _0x3d8ab1=a68_0x2df0;if(!_0x50adaa[_0x3d8ab1(0x124)]||_0x50adaa['projectName'][_0x3d8ab1(0x158)]()==='')throw new Error(_0x3d8ab1(0x121));const _0x455303=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x455303[_0x3d8ab1(0x105)](_0x50adaa['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x50adaa[_0x3d8ab1(0x124)][_0x3d8ab1(0x144)]>0x64)throw new Error(_0x3d8ab1(0x10d));const _0xcae3f=a68_0x2b10c9[_0x3d8ab1(0x111)](process[_0x3d8ab1(0x10c)](),_0x50adaa[_0x3d8ab1(0x124)]);if(a68_0x5d69b9[_0x3d8ab1(0x119)](_0xcae3f))throw new Error('Project\x20directory\x20'+_0x50adaa['projectName']+_0x3d8ab1(0x14b));try{a68_0x5d69b9['accessSync'](a68_0x2b10c9[_0x3d8ab1(0x145)](_0xcae3f),a68_0x5d69b9[_0x3d8ab1(0x156)][_0x3d8ab1(0x15d)]);}catch{throw new Error(_0x3d8ab1(0x11b));}logger['setLogPath'](_0xcae3f),logger['info'](_0x3d8ab1(0x143),_0x3d8ab1(0x118)+_0x50adaa[_0x3d8ab1(0x124)],{'projectDir':_0xcae3f,'appCode':_0x50adaa[_0x3d8ab1(0x120)]}),console[_0x3d8ab1(0x127)](),console[_0x3d8ab1(0x127)](a68_0x1b097c[_0x3d8ab1(0x11c)](_0x3d8ab1(0x149))+_0x3d8ab1(0x123)+a68_0x1b097c[_0x3d8ab1(0x11c)](_0x50adaa[_0x3d8ab1(0x124)])+(_0x50adaa[_0x3d8ab1(0x120)]?_0x3d8ab1(0x10e)+a68_0x1b097c['cyan'](_0x50adaa[_0x3d8ab1(0x120)]):''));try{await runTask(_0x3d8ab1(0x14e),()=>copyProjectTemplate(_0x50adaa[_0x3d8ab1(0x124)])),await updatePackageJsonName(_0x50adaa['projectName']),await runTask('Install\x20dependencies',()=>installDependencies(_0x50adaa[_0x3d8ab1(0x124)])),await runTask('Format\x20code',()=>formatProjectCode(_0x50adaa[_0x3d8ab1(0x124)])),await configureAppCode(_0x50adaa['projectName'],_0x50adaa['appCode']||'',_0x50adaa[_0x3d8ab1(0x133)]);let _0x347b20=![];if(_0x50adaa[_0x3d8ab1(0x120)]){console[_0x3d8ab1(0x127)](_0x3d8ab1(0x104));const _0x213e64=process[_0x3d8ab1(0x10c)]();try{process[_0x3d8ab1(0x130)](_0xcae3f);const _0x18982b=_0x50adaa[_0x3d8ab1(0x133)]||_0x3d8ab1(0x139);initEnv(_0x18982b);const {configArray:_0x2a5907}=await fetchModelList(_0x50adaa[_0x3d8ab1(0x120)],_0x45b4d0[_0x3d8ab1(0x159)]||''),_0x594f3f=_0x3d8ab1(0x14f),_0x59cdf0=await generateApiFile(_0x2a5907,'',_0x50adaa[_0x3d8ab1(0x120)],!![],_0x18982b,_0x594f3f);console['log'](_0x3d8ab1(0x12f)+_0x2a5907[_0x3d8ab1(0x144)]+'\x20dataset(s),\x20generated\x20'+_0x59cdf0[_0x3d8ab1(0x110)]+_0x3d8ab1(0x12e)),logger[_0x3d8ab1(0x153)]('create',_0x3d8ab1(0x114)+_0x50adaa[_0x3d8ab1(0x120)]);}catch(_0x3d456f){_0x347b20=!![],console[_0x3d8ab1(0x127)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger[_0x3d8ab1(0x128)](_0x3d8ab1(0x143),_0x3d8ab1(0x141),{'error':_0x3d456f instanceof Error?_0x3d456f[_0x3d8ab1(0x135)]:String(_0x3d456f)});}finally{process[_0x3d8ab1(0x130)](_0x213e64);}}logger[_0x3d8ab1(0x116)]('create',_0x3d8ab1(0x136)+_0x50adaa[_0x3d8ab1(0x124)]),console[_0x3d8ab1(0x127)](),console[_0x3d8ab1(0x127)](a68_0x1b097c[_0x3d8ab1(0x11c)]('─'['repeat'](0x3c))),console[_0x3d8ab1(0x127)](a68_0x1b097c['cyan']['bold'](_0x3d8ab1(0x10f))),console[_0x3d8ab1(0x127)](),console['log']('\x20\x201.\x20Start\x20project:\x20'+a68_0x1b097c[_0x3d8ab1(0x148)][_0x3d8ab1(0x117)](_0x3d8ab1(0x154)+_0x50adaa[_0x3d8ab1(0x124)]+_0x3d8ab1(0x115)+CLI_BIN_NAME+_0x3d8ab1(0x11f))),_0x347b20&&console[_0x3d8ab1(0x127)](_0x3d8ab1(0x152)+a68_0x1b097c[_0x3d8ab1(0x148)][_0x3d8ab1(0x117)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x3d8ab1(0x127)](a68_0x1b097c[_0x3d8ab1(0x11c)]('─'[_0x3d8ab1(0x150)](0x3c)));}catch(_0xc0486c){logger['error'](_0x3d8ab1(0x143),_0x3d8ab1(0x13c)+_0x50adaa[_0x3d8ab1(0x124)],{'error':_0xc0486c instanceof Error?_0xc0486c[_0x3d8ab1(0x135)]:String(_0xc0486c)});try{a68_0x5d69b9[_0x3d8ab1(0x119)](_0xcae3f)&&(console[_0x3d8ab1(0x127)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0xcae3f),a68_0x5d69b9[_0x3d8ab1(0x138)](_0xcae3f,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x3d8ab1(0x143),_0x3d8ab1(0x14d)+_0xcae3f);}throw _0xc0486c;}}async function runTask(_0x58a58d,_0x4962ce){const _0x4defd9=a68_0x2df0,_0x3e9041=a68_0x6e0d75(_0x58a58d+_0x4defd9(0x12d))[_0x4defd9(0x13a)]();try{const _0x9e4911=await _0x4962ce();_0x3e9041[_0x4defd9(0x10b)](),console[_0x4defd9(0x127)](''+a68_0x1b097c[_0x4defd9(0x11c)](_0x4defd9(0x149))+_0x58a58d+'\x20'+a68_0x1b097c[_0x4defd9(0x137)]('['+_0x9e4911+']'));}catch(_0x1f34d3){_0x3e9041[_0x4defd9(0x13e)](_0x58a58d);throw _0x1f34d3;}}async function updatePackageJsonName(_0x245a5e){const _0x54f18d=a68_0x2df0,_0x31945a=a68_0x2b10c9[_0x54f18d(0x111)](process[_0x54f18d(0x10c)](),_0x245a5e),_0x14d66f=a68_0x2b10c9[_0x54f18d(0x131)](_0x31945a,_0x54f18d(0x129));try{console[_0x54f18d(0x127)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x400751=getRabetbaseCliPackageRoot(),_0x5d0e9c=a68_0x2b10c9[_0x54f18d(0x131)](_0x400751,'package.json');let _0x86181b=_0x54f18d(0x106);try{const _0xfd5e69=JSON[_0x54f18d(0x155)](a68_0x5d69b9[_0x54f18d(0x109)](_0x5d0e9c,_0x54f18d(0x151)));_0x86181b=_0xfd5e69[_0x54f18d(0x126)]||_0x54f18d(0x106);}catch{}const _0x1d0319=a68_0x5d69b9['readFileSync'](_0x14d66f,_0x54f18d(0x151)),_0x580f8e=JSON['parse'](_0x1d0319);_0x580f8e['name']=_0x245a5e,_0x580f8e['description']=_0x245a5e+_0x54f18d(0x132)+_0x86181b,a68_0x5d69b9[_0x54f18d(0x125)](_0x14d66f,JSON[_0x54f18d(0x15c)](_0x580f8e,null,0x2)+'\x0a',_0x54f18d(0x151)),console['log'](_0x54f18d(0x11e)+_0x245a5e),logger[_0x54f18d(0x153)](_0x54f18d(0x143),_0x54f18d(0x12a));}catch(_0x520b8a){logger[_0x54f18d(0x107)](_0x54f18d(0x143),_0x54f18d(0x122));throw _0x520b8a;}}async function configureAppCode(_0x6c873b,_0x2bf731,_0x4526b3){const _0x243276=a68_0x2df0,_0x31cc37=a68_0x2b10c9[_0x243276(0x111)](process['cwd'](),_0x6c873b),_0x632f68=a68_0x2b10c9['join'](_0x31cc37,NEW_CONFIG_NAME);try{_0x2bf731?console[_0x243276(0x127)](_0x243276(0x108)+_0x6c873b+':\x20'+_0x2bf731):console[_0x243276(0x127)](_0x243276(0x10a)+_0x6c873b);const _0x410153=getRabetbaseCliPackageRoot(),_0x3f6880=a68_0x2b10c9['join'](_0x410153,_0x243276(0x129));let _0xb1fa0e=_0x243276(0x106);try{const _0x32fb05=JSON[_0x243276(0x155)](a68_0x5d69b9[_0x243276(0x109)](_0x3f6880,_0x243276(0x151)));_0xb1fa0e=_0x32fb05[_0x243276(0x126)]||_0x243276(0x106);}catch{}const _0x55d04c=readConfig(),_0x4f7bac=typeof _0x55d04c[_0x243276(0x133)]===_0x243276(0x12c)?_0x55d04c[_0x243276(0x133)]:undefined,{app:_0x4a3091,appcode:_0x495517,..._0x3470a4}=_0x55d04c,_0x2570b4={..._0x3470a4,'appcode':_0x2bf731||'','env':_0x4526b3||_0x4f7bac||_0x243276(0x139),'createdAt':new Date()[_0x243276(0x13d)](),'version':_0xb1fa0e};writeConfigFile(_0x632f68,_0x2570b4),_0x2bf731?console[_0x243276(0x127)](_0x243276(0x13f)+_0x2bf731):console[_0x243276(0x127)](_0x243276(0x15a)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info']('create',_0x243276(0x113)+_0x2bf731);}catch(_0x23c2ca){logger[_0x243276(0x107)]('create','配置应用AppCode失败');}}
|
|
1
|
+
(function(_0x1de0d4,_0x4dee37){const _0x4e3427=a68_0x4fcd,_0x2d6220=_0x1de0d4();while(!![]){try{const _0x462403=-parseInt(_0x4e3427(0x131))/0x1+-parseInt(_0x4e3427(0x17a))/0x2*(parseInt(_0x4e3427(0x15c))/0x3)+parseInt(_0x4e3427(0x152))/0x4*(-parseInt(_0x4e3427(0x157))/0x5)+-parseInt(_0x4e3427(0x130))/0x6*(-parseInt(_0x4e3427(0x169))/0x7)+parseInt(_0x4e3427(0x126))/0x8*(-parseInt(_0x4e3427(0x176))/0x9)+-parseInt(_0x4e3427(0x179))/0xa*(-parseInt(_0x4e3427(0x168))/0xb)+parseInt(_0x4e3427(0x160))/0xc;if(_0x462403===_0x4dee37)break;else _0x2d6220['push'](_0x2d6220['shift']());}catch(_0x440e18){_0x2d6220['push'](_0x2d6220['shift']());}}}(a68_0x19cd,0x41e3a));import a68_0x277a6b from'path';import a68_0x35a058 from'fs';import a68_0x46b871 from'chalk';import a68_0x445f81 from'ora';import{guidedCreateProject}from'./enhanced-guided-create.js';function a68_0x19cd(){const _0x341695=['1.0.0','121NQztrS','63PZerht','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','modelCount','配置应用AppCode失败','string','√\x20Pulled\x20','开始创建项目:\x20','\x20run\x20start','version','\x20\x202.\x20Pull\x20API\x20configuration:\x20','green','parse','writeFileSync','1813473fUZxYW','\x20√\x20','setLogPath','439510hQXIrb','619126jhaTIN','message','Project\x20directory\x20','trim','\x20api\x20pull','*\x20Pulling\x20API\x20configuration...','cwd','W_OK','16LBtLJl','projectName','gray','Project\x20name:\x20','rmSync','utf8','stableVersion','更新\x20package.json\x20失败','projectCode','appCode','278268TFwwfZ','109783YdaXWe','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','更新\x20package.json\x20name','配置应用AppCode:\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','currentVersion','error','\x20&&\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','production','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','chdir','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','readFileSync','info','create','test','Install\x20dependencies','fail','description','stringify','./src/api/','start','Format\x20code','Project\x20name\x20cannot\x20be\x20empty','API\x20configuration\x20pulled:\x20','cd\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','API\x20配置拉取异常','log','constants','cookie','260200LcUyoq','length','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','\x20|\x20AppCode:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','5IvfvML','bold','toLocaleString','repeat','join','3ZelWgq','package.json','warn','needsUpgrade','3076908xxMURT','resolve','\x20model(s)','env','\x20dataset(s),\x20generated\x20','Copy\x20project\x20files','cyan'];a68_0x19cd=function(){return _0x341695;};return a68_0x19cd();}import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'./use-copy-project-template.js';import{installDependencies}from'./use-install-dependencies.js';import{formatProjectCode}from'./use-format-code.js';import{logger}from'../../../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{selectSingleAppcode}from'../../common/app-selector.js';import{getRabetbaseCliPackageRoot}from'./project-template-path.js';export async function createApp(_0x2c99af){const _0x5614fc=a68_0x4fcd,_0x570e44=await checkCliVersion();_0x570e44[_0x5614fc(0x15f)]&&(printCliUpgradeWarning(_0x570e44),logger[_0x5614fc(0x140)](_0x5614fc(0x141),'CLI\x20版本检查',{'currentVersion':_0x570e44[_0x5614fc(0x136)],'stableVersion':_0x570e44[_0x5614fc(0x12c)],'needsUpgrade':_0x570e44[_0x5614fc(0x15f)]}));if(_0x2c99af[_0x5614fc(0x12e)]&&_0x2c99af[_0x5614fc(0x12f)])await runCreate({'projectName':_0x2c99af[_0x5614fc(0x12e)],'appCode':_0x2c99af['appCode'],'env':_0x2c99af[_0x5614fc(0x163)]},_0x2c99af);else{if(_0x2c99af[_0x5614fc(0x12e)]){const _0x22093d=await selectSingleAppcode(_0x2c99af['cookie']);await runCreate({'projectName':_0x2c99af[_0x5614fc(0x12e)],'appCode':_0x22093d||undefined,'env':_0x2c99af[_0x5614fc(0x163)]},_0x2c99af);}else await guidedCreateProject(_0x508e5f=>runCreate(_0x508e5f,_0x2c99af),_0x2c99af[_0x5614fc(0x163)],_0x2c99af[_0x5614fc(0x151)]);}}async function runCreate(_0x56eea8,_0x49fbfe){const _0x5e9695=a68_0x4fcd;if(!_0x56eea8[_0x5e9695(0x127)]||_0x56eea8[_0x5e9695(0x127)][_0x5e9695(0x121)]()==='')throw new Error(_0x5e9695(0x14a));const _0x1f8d94=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1f8d94[_0x5e9695(0x142)](_0x56eea8[_0x5e9695(0x127)]))throw new Error(_0x5e9695(0x13b));if(_0x56eea8['projectName'][_0x5e9695(0x153)]>0x64)throw new Error(_0x5e9695(0x154));const _0x4506ed=a68_0x277a6b['resolve'](process[_0x5e9695(0x124)](),_0x56eea8[_0x5e9695(0x127)]);if(a68_0x35a058['existsSync'](_0x4506ed))throw new Error(_0x5e9695(0x17c)+_0x56eea8[_0x5e9695(0x127)]+'\x20already\x20exists');try{a68_0x35a058['accessSync'](a68_0x277a6b['dirname'](_0x4506ed),a68_0x35a058[_0x5e9695(0x150)][_0x5e9695(0x125)]);}catch{throw new Error(_0x5e9695(0x13e));}logger[_0x5e9695(0x178)](_0x4506ed),logger['info'](_0x5e9695(0x141),_0x5e9695(0x16f)+_0x56eea8[_0x5e9695(0x127)],{'projectDir':_0x4506ed,'appCode':_0x56eea8[_0x5e9695(0x12f)]}),console[_0x5e9695(0x14f)](),console[_0x5e9695(0x14f)](a68_0x46b871[_0x5e9695(0x173)](_0x5e9695(0x177))+_0x5e9695(0x129)+a68_0x46b871[_0x5e9695(0x173)](_0x56eea8['projectName'])+(_0x56eea8['appCode']?_0x5e9695(0x155)+a68_0x46b871[_0x5e9695(0x166)](_0x56eea8[_0x5e9695(0x12f)]):''));try{await runTask(_0x5e9695(0x165),()=>copyProjectTemplate(_0x56eea8[_0x5e9695(0x127)])),await updatePackageJsonName(_0x56eea8[_0x5e9695(0x127)]),await runTask(_0x5e9695(0x143),()=>installDependencies(_0x56eea8['projectName'])),await runTask(_0x5e9695(0x149),()=>formatProjectCode(_0x56eea8['projectName'])),await configureAppCode(_0x56eea8[_0x5e9695(0x127)],_0x56eea8[_0x5e9695(0x12f)]||'',_0x56eea8[_0x5e9695(0x163)]);let _0x4925c5=![];if(_0x56eea8[_0x5e9695(0x12f)]){console[_0x5e9695(0x14f)](_0x5e9695(0x123));const _0x26774a=process[_0x5e9695(0x124)]();try{process['chdir'](_0x4506ed);const _0x466310=_0x56eea8[_0x5e9695(0x163)]||_0x5e9695(0x13a);initEnv(_0x466310);const {configArray:_0x36d4d3}=await fetchModelList(_0x56eea8['appCode'],_0x49fbfe[_0x5e9695(0x151)]||''),_0x3c5eb7=_0x5e9695(0x147),_0x51b306=await generateApiFile(_0x36d4d3,'',_0x56eea8[_0x5e9695(0x12f)],!![],_0x466310,_0x3c5eb7);console[_0x5e9695(0x14f)](_0x5e9695(0x16e)+_0x36d4d3['length']+_0x5e9695(0x164)+_0x51b306[_0x5e9695(0x16b)]+_0x5e9695(0x162)),logger['info'](_0x5e9695(0x141),_0x5e9695(0x14b)+_0x56eea8[_0x5e9695(0x12f)]);}catch(_0x111360){_0x4925c5=!![],console[_0x5e9695(0x14f)](_0x5e9695(0x139)),logger[_0x5e9695(0x15e)](_0x5e9695(0x141),_0x5e9695(0x14e),{'error':_0x111360 instanceof Error?_0x111360[_0x5e9695(0x17b)]:String(_0x111360)});}finally{process[_0x5e9695(0x13d)](_0x26774a);}}logger['success']('create','项目创建完成:\x20'+_0x56eea8[_0x5e9695(0x127)]),console[_0x5e9695(0x14f)](),console[_0x5e9695(0x14f)](a68_0x46b871[_0x5e9695(0x173)]('─'['repeat'](0x3c))),console['log'](a68_0x46b871[_0x5e9695(0x166)][_0x5e9695(0x158)]('🚀\x20Next\x20Steps:')),console[_0x5e9695(0x14f)](),console[_0x5e9695(0x14f)]('\x20\x201.\x20Start\x20project:\x20'+a68_0x46b871[_0x5e9695(0x166)]['bold'](_0x5e9695(0x14c)+_0x56eea8['projectName']+_0x5e9695(0x138)+CLI_BIN_NAME+_0x5e9695(0x170))),_0x4925c5&&console['log'](_0x5e9695(0x172)+a68_0x46b871['cyan']['bold'](CLI_BIN_NAME+_0x5e9695(0x122))),console['log'](a68_0x46b871[_0x5e9695(0x173)]('─'[_0x5e9695(0x15a)](0x3c)));}catch(_0x1f8b9){logger[_0x5e9695(0x137)]('create','项目创建失败:\x20'+_0x56eea8[_0x5e9695(0x127)],{'error':_0x1f8b9 instanceof Error?_0x1f8b9[_0x5e9695(0x17b)]:String(_0x1f8b9)});try{a68_0x35a058['existsSync'](_0x4506ed)&&(console[_0x5e9695(0x14f)](_0x5e9695(0x132)+_0x4506ed),a68_0x35a058[_0x5e9695(0x12a)](_0x4506ed,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x5e9695(0x141),'清理项目目录失败:\x20'+_0x4506ed);}throw _0x1f8b9;}}async function runTask(_0x4c852c,_0x571adf){const _0x384a5e=a68_0x4fcd,_0x4a8ff6=a68_0x445f81(_0x4c852c+'...')[_0x384a5e(0x148)]();try{const _0x2ded84=await _0x571adf();_0x4a8ff6['stop'](),console[_0x384a5e(0x14f)](''+a68_0x46b871[_0x384a5e(0x173)](_0x384a5e(0x177))+_0x4c852c+'\x20'+a68_0x46b871[_0x384a5e(0x128)]('['+_0x2ded84+']'));}catch(_0x2fb09c){_0x4a8ff6[_0x384a5e(0x144)](_0x4c852c);throw _0x2fb09c;}}function a68_0x4fcd(_0x4195db,_0x3068ae){_0x4195db=_0x4195db-0x121;const _0x19cd9f=a68_0x19cd();let _0x4fcd88=_0x19cd9f[_0x4195db];return _0x4fcd88;}async function updatePackageJsonName(_0x2dea48){const _0x4685e0=a68_0x4fcd,_0x575207=a68_0x277a6b[_0x4685e0(0x161)](process['cwd'](),_0x2dea48),_0x54c18e=a68_0x277a6b[_0x4685e0(0x15b)](_0x575207,_0x4685e0(0x15d));try{console['log'](_0x4685e0(0x14d));const _0x239be2=getRabetbaseCliPackageRoot(),_0x26f7a7=a68_0x277a6b[_0x4685e0(0x15b)](_0x239be2,_0x4685e0(0x15d));let _0x5450de='1.0.0';try{const _0x117219=JSON[_0x4685e0(0x174)](a68_0x35a058[_0x4685e0(0x13f)](_0x26f7a7,_0x4685e0(0x12b)));_0x5450de=_0x117219[_0x4685e0(0x171)]||_0x4685e0(0x167);}catch{}const _0x613ce0=a68_0x35a058[_0x4685e0(0x13f)](_0x54c18e,'utf8'),_0x5eba55=JSON[_0x4685e0(0x174)](_0x613ce0);_0x5eba55['name']=_0x2dea48,_0x5eba55[_0x4685e0(0x145)]=_0x2dea48+_0x4685e0(0x156)+_0x5450de,a68_0x35a058[_0x4685e0(0x175)](_0x54c18e,JSON[_0x4685e0(0x146)](_0x5eba55,null,0x2)+'\x0a',_0x4685e0(0x12b)),console[_0x4685e0(0x14f)]('√\x20package.json\x20updated:\x20name='+_0x2dea48),logger['info'](_0x4685e0(0x141),_0x4685e0(0x133));}catch(_0x267d2c){logger[_0x4685e0(0x137)]('create',_0x4685e0(0x12d));throw _0x267d2c;}}async function configureAppCode(_0x5dc163,_0xe72f12,_0x387424){const _0x5bf5bb=a68_0x4fcd,_0x9acaf3=a68_0x277a6b['resolve'](process[_0x5bf5bb(0x124)](),_0x5dc163),_0x5a401c=a68_0x277a6b['join'](_0x9acaf3,NEW_CONFIG_NAME);try{_0xe72f12?console[_0x5bf5bb(0x14f)](_0x5bf5bb(0x135)+_0x5dc163+':\x20'+_0xe72f12):console[_0x5bf5bb(0x14f)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x5dc163);const _0x51b004=getRabetbaseCliPackageRoot(),_0x52df74=a68_0x277a6b[_0x5bf5bb(0x15b)](_0x51b004,'package.json');let _0x3e054d='1.0.0';try{const _0x115c8b=JSON[_0x5bf5bb(0x174)](a68_0x35a058['readFileSync'](_0x52df74,_0x5bf5bb(0x12b)));_0x3e054d=_0x115c8b[_0x5bf5bb(0x171)]||_0x5bf5bb(0x167);}catch{}const _0x507291=readConfig(),_0x555e57=typeof _0x507291['env']===_0x5bf5bb(0x16d)?_0x507291[_0x5bf5bb(0x163)]:undefined,{app:_0x5a8efe,appcode:_0x119e38,..._0x33da05}=_0x507291,_0x438b51={..._0x33da05,'appcode':_0xe72f12||'','env':_0x387424||_0x555e57||_0x5bf5bb(0x13a),'createdAt':new Date()[_0x5bf5bb(0x159)](),'version':_0x3e054d};writeConfigFile(_0x5a401c,_0x438b51),_0xe72f12?console[_0x5bf5bb(0x14f)](_0x5bf5bb(0x16a)+_0xe72f12):console[_0x5bf5bb(0x14f)](_0x5bf5bb(0x13c)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x5bf5bb(0x140)](_0x5bf5bb(0x141),_0x5bf5bb(0x134)+_0xe72f12);}catch(_0x278739){logger[_0x5bf5bb(0x137)](_0x5bf5bb(0x141),_0x5bf5bb(0x16c));}}
|