@lovrabet/rabetbase-cli 2.1.2-beta.0 → 2.1.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -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/generate.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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.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 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a7256,_0x4d9a8f){const _0x5a0576=a72_0x3de0,_0x362f95=_0x1a7256();while(!![]){try{const _0x3a4bff=-parseInt(_0x5a0576(0x7d))/0x1+parseInt(_0x5a0576(0x87))/0x2+-parseInt(_0x5a0576(0x82))/0x3*(parseInt(_0x5a0576(0x76))/0x4)+parseInt(_0x5a0576(0x7e))/0x5*(-parseInt(_0x5a0576(0x85))/0x6)+parseInt(_0x5a0576(0x7f))/0x7*(-parseInt(_0x5a0576(0x6f))/0x8)+parseInt(_0x5a0576(0x74))/0x9+parseInt(_0x5a0576(0x72))/0xa*(parseInt(_0x5a0576(0x71))/0xb);if(_0x3a4bff===_0x4d9a8f)break;else _0x362f95['push'](_0x362f95['shift']());}catch(_0x2ee537){_0x362f95['push'](_0x362f95['shift']());}}}(a72_0x40b9,0x35d2e));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'../../../commands/menu/shared/service.js';function a72_0x40b9(){const _0x333e57=['path','map','CSS\x20URL\x20is\x20unreachable','107204kLUNYa','219755gNYZjR','91mOHKLT','allSettled','No\x20local\x20pages\x20matched\x20labels:\x20','173457SzUcuU','rejected','length','42XWjiqk','join','204180sRrDef','errors','has','trim','247928OsNPnT','push','11vHoETt','10185010AhCXck','JS\x20URL\x20is\x20unreachable','1340019zBazeO','status','16oeyRnt','resources','filter','label'];a72_0x40b9=function(){return _0x333e57;};return a72_0x40b9();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a72_0x3de0(_0x46fc5d,_0x5e29b2){_0x46fc5d=_0x46fc5d-0x6d;const _0x40b98f=a72_0x40b9();let _0x3de0c0=_0x40b98f[_0x46fc5d];return _0x3de0c0;}export function validateJsUrl(_0x52c6b2){const _0xdf3623=a72_0x3de0,_0x1a38d0=[];return!isValidJsHttpsUrl(_0x52c6b2)&&_0x1a38d0[_0xdf3623(0x70)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x1a38d0[_0xdf3623(0x84)]===0x0,'errors':_0x1a38d0};}export function validateCssUrl(_0x11d1cc){const _0x54b96a=a72_0x3de0,_0x50af79=[];return!isValidCssHttpsUrl(_0x11d1cc)&&_0x50af79[_0x54b96a(0x70)]('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0x50af79['length']===0x0,'errors':_0x50af79};}export async function validateJsUrlReachable(_0x27889a){const _0x382518=a72_0x3de0,_0x2ba9b1=validateJsUrl(_0x27889a);if(!_0x2ba9b1['ok'])return _0x2ba9b1;const _0x4a3d25=await isUrlReachable(_0x27889a);if(!_0x4a3d25)_0x2ba9b1[_0x382518(0x88)][_0x382518(0x70)](_0x382518(0x73));return{'ok':_0x2ba9b1[_0x382518(0x88)]['length']===0x0,'errors':_0x2ba9b1[_0x382518(0x88)]};}export async function validateCssUrlReachable(_0x2bcad9){const _0x5895de=a72_0x3de0,_0x57774c=validateCssUrl(_0x2bcad9);if(!_0x57774c['ok'])return _0x57774c;const _0x39d514=await isUrlReachable(_0x2bcad9);if(!_0x39d514)_0x57774c['errors'][_0x5895de(0x70)](_0x5895de(0x7c));return{'ok':_0x57774c[_0x5895de(0x88)][_0x5895de(0x84)]===0x0,'errors':_0x57774c[_0x5895de(0x88)]};}export function buildCompareRows(_0x154cce,_0x3f5b37){const _0x1a9a46=a72_0x3de0;return _0x154cce[_0x1a9a46(0x7b)](_0x35e6c4=>({'label':_0x35e6c4[_0x1a9a46(0x79)],'path':_0x35e6c4['path'],'local':!![],'online':_0x3f5b37['has'](_0x35e6c4[_0x1a9a46(0x7a)])}));}export function filterNewPages(_0x25d856,_0x34af54,_0x141b41){const _0x44b057=a72_0x3de0;if(_0x141b41&&_0x141b41[_0x44b057(0x84)]>0x0){const _0x5baba7=new Set(_0x141b41[_0x44b057(0x7b)](_0x59a6ee=>_0x59a6ee[_0x44b057(0x6e)]())),_0x155be8=_0x25d856[_0x44b057(0x78)](_0x3552c0=>_0x5baba7['has'](_0x3552c0['label']));if(_0x155be8['length']===0x0)throw new Error(_0x44b057(0x81)+[..._0x5baba7][_0x44b057(0x86)](',\x20'));return _0x155be8;}return _0x25d856[_0x44b057(0x78)](_0x4790d3=>!_0x34af54[_0x44b057(0x6d)](_0x4790d3[_0x44b057(0x7a)]));}export function filterPagesByLabels(_0x15d52b,_0x46cd83){const _0x25e644=a72_0x3de0,_0x5c2eb9=[],_0x590482=[];for(const _0x240e39 of _0x46cd83){const _0x29f086=_0x240e39[_0x25e644(0x6e)](),_0x53de20=_0x15d52b['find'](_0x2b61cc=>_0x2b61cc[_0x25e644(0x79)]===_0x29f086);if(_0x53de20)_0x5c2eb9['push'](_0x53de20);else _0x590482[_0x25e644(0x70)](_0x240e39);}return{'matched':_0x5c2eb9,'unmatched':_0x590482};}export async function doCreateMenus(_0x8d00c0,_0x36c763,_0x5b6a40,_0x3d4114){const _0x5bd903=a72_0x3de0;return await createMenus(_0x8d00c0,_0x36c763,_0x5b6a40,_0x3d4114),{'created':_0x5b6a40[_0x5bd903(0x84)],'failed':0x0,'labels':_0x5b6a40[_0x5bd903(0x7b)](_0x5cc7d9=>_0x5cc7d9[_0x5bd903(0x79)])};}export function filterMenusWithResources(_0x25782e){const _0x92dc73=a72_0x3de0;return _0x25782e['filter'](_0x4522f8=>_0x4522f8[_0x92dc73(0x77)]['length']>0x0);}export async function doUpdateCdnUrls(_0x1d87cf,_0x240a97,_0x614648,_0x49e597){const _0xab04f8=a72_0x3de0,_0x57edd9=_0x614648[_0xab04f8(0x78)](_0x15e254=>_0x15e254[_0xab04f8(0x77)][_0xab04f8(0x84)]>0x0),_0x1c5678=await Promise[_0xab04f8(0x80)](_0x57edd9[_0xab04f8(0x7b)](_0x193b2e=>updateMenuCdnUrl(_0x1d87cf,_0x240a97,{'id':_0x193b2e['id'],'label':_0x193b2e[_0xab04f8(0x79)],'path':_0x193b2e[_0xab04f8(0x7a)],'resources':_0x49e597}))),_0x5775f6=_0x1c5678['filter'](_0x1e467c=>_0x1e467c[_0xab04f8(0x75)]===_0xab04f8(0x83))[_0xab04f8(0x84)];return{'updated':_0x57edd9['length']-_0x5775f6,'failed':_0x5775f6};}export async function fetchMenuData(_0x12629e,_0x33f13e){const _0x2f2fb0=a72_0x3de0,_0x4b7ed3=getLocalPages(),_0x4ea190=await getOnlineMenuList(_0x12629e,_0x33f13e),_0x1568c8=new Set(_0x4ea190[_0x2f2fb0(0x7b)](_0x561598=>_0x561598[_0x2f2fb0(0x7a)]));return{'localPages':_0x4b7ed3,'onlineMenuList':_0x4ea190,'onlinePaths':_0x1568c8};}export async function fetchOnlineMenuList(_0x5379aa,_0x10acf5){return getOnlineMenuList(_0x5379aa,_0x10acf5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x18eae0,_0x9cda22){const _0x13503f=a73_0x577a,_0x1f87b5=_0x18eae0();while(!![]){try{const _0x34fcb3=-parseInt(_0x13503f(0x95))/0x1+-parseInt(_0x13503f(0xa8))/0x2*(parseInt(_0x13503f(0xa6))/0x3)+parseInt(_0x13503f(0xa3))/0x4+-parseInt(_0x13503f(0xac))/0x5+parseInt(_0x13503f(0x91))/0x6*(parseInt(_0x13503f(0x9a))/0x7)+parseInt(_0x13503f(0x9f))/0x8+parseInt(_0x13503f(0xab))/0x9;if(_0x34fcb3===_0x9cda22)break;else _0x1f87b5['push'](_0x1f87b5['shift']());}catch(_0x16ddef){_0x1f87b5['push'](_0x1f87b5['shift']());}}}(a73_0x2999,0x782e9));import{getApiDomain}from'../../../constant/domain.js';function a73_0x577a(_0x51c3a4,_0x2d7eeb){_0x51c3a4=_0x51c3a4-0x8c;const _0x2999f2=a73_0x2999();let _0x577aef=_0x2999f2[_0x51c3a4];return _0x577aef;}import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{platformFetch}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x57836a,_0x500d9a){const _0x48a214=a73_0x577a,_0xc1bc81=getEnv();logger[_0x48a214(0xa7)](_0x48a214(0xa1),isProduction(_0xc1bc81)?_0x48a214(0xa4)+_0x57836a+')':_0x48a214(0xa2)+_0x57836a+')');const _0x245c4d=await platformFetch(getApiDomain()+_0x48a214(0x9b)+_0x57836a,{'cookie':_0x500d9a,'label':_0x48a214(0x9c)});if(!_0x245c4d)return logger[_0x48a214(0xa7)](_0x48a214(0xa1),'Server\x20returned\x20empty\x20menu\x20list'),[];return logger[_0x48a214(0xa7)](_0x48a214(0xa1),_0x48a214(0x8f)+_0x245c4d[_0x48a214(0xb4)]+_0x48a214(0x8c)),_0x245c4d['map'](flattenMenuItem)[_0x48a214(0xb1)]();}function flattenMenuItem(_0x5ea118){const _0x491e64=a73_0x577a;let _0x3eaabe=[];try{if(_0x5ea118[_0x491e64(0x9d)]?.[_0x491e64(0xb2)]){const _0x2d22ec=JSON[_0x491e64(0x8d)](_0x5ea118[_0x491e64(0x9d)]['resources']);if(Array[_0x491e64(0xb3)](_0x2d22ec))_0x3eaabe=_0x2d22ec;}}catch{}const _0x5cff52=[{'id':_0x5ea118['id'],'path':_0x5ea118[_0x491e64(0x90)],'label':_0x5ea118[_0x491e64(0xa9)],'resources':_0x3eaabe}];if(_0x5ea118['children']&&_0x5ea118[_0x491e64(0xaa)][_0x491e64(0xb4)]>0x0)for(const _0x369df7 of _0x5ea118['children']){_0x5cff52[_0x491e64(0xaf)](...flattenMenuItem(_0x369df7));}return _0x5cff52;}export async function createMenu(_0x5e43d1,_0x1bd56c,_0x257244){const _0x36940b=a73_0x577a;logger[_0x36940b(0xa7)]('create-menu',_0x36940b(0x9e)+_0x257244[_0x36940b(0xa9)]+'\x20('+_0x257244[_0x36940b(0x90)]+')');const _0x4de4f7={'appCode':_0x5e43d1,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x36940b(0x97),'resources':_0x257244[_0x36940b(0xb2)]?JSON['stringify'](_0x257244[_0x36940b(0xb2)]):undefined},..._0x257244};await platformFetch(getApiDomain()+_0x36940b(0xa5),{'method':'POST','body':_0x4de4f7,'cookie':_0x1bd56c,'label':_0x36940b(0x99)+_0x257244['label']+'\x22'}),logger['info'](_0x36940b(0xad),_0x36940b(0x93)+_0x257244['label']);}async function createSingleMenu(_0x477cdf,_0xf27d2f,_0x3a7bb0,_0x1bdeca){const _0x328801=a73_0x577a,_0x25bd03={'appCode':_0x477cdf,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x328801(0x97),'resources':_0x1bdeca?JSON[_0x328801(0x92)](_0x1bdeca):undefined},'label':_0x3a7bb0[_0x328801(0xa9)],'path':_0x3a7bb0[_0x328801(0x90)]};await platformFetch(getApiDomain()+_0x328801(0xa5),{'method':_0x328801(0xae),'body':_0x25bd03,'cookie':_0xf27d2f,'label':_0x328801(0x99)+_0x3a7bb0[_0x328801(0xa9)]+'\x22'}),logger[_0x328801(0xa7)](_0x328801(0xad),_0x328801(0x93)+_0x3a7bb0[_0x328801(0xa9)]);}function a73_0x2999(){const _0x4b3ce1=['push','Start\x20batch\x20menu\x20creation,\x20total\x20','flat','resources','isArray','length','\x20online\x20menus\x20successfully','parse','Update\x20menu\x20assets\x20\x22','Fetched\x20','path','635274ZKZIDs','stringify','Menu\x20created\x20successfully:\x20','/smartapi/menu/update','763578ePPPvd','Batch\x20menu\x20creation\x20completed,\x20total\x20','import','map','Create\x20menu\x20\x22','63QmgVPW','/smartapi/menu/find?appCode=','Fetch\x20menu\x20list','extend','Creating\x20menu:\x20','3668096syUqzQ','update-menu-cdn-url','get-online-menu-list','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','2355516iYdPvh','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','/smartapi/menu/create','14664jwPkpf','info','180nbNejy','label','children','4546206HMplyg','4048365MkhlVq','create-menu','POST'];a73_0x2999=function(){return _0x4b3ce1;};return a73_0x2999();}export async function createMenus(_0x3c1961,_0x33f7e6,_0x43c933,_0x571bfd){const _0x1971bc=a73_0x577a;logger[_0x1971bc(0xa7)]('create-menus',_0x1971bc(0xb0)+_0x43c933[_0x1971bc(0xb4)]),await Promise['all'](_0x43c933[_0x1971bc(0x98)](_0xa1db35=>createSingleMenu(_0x3c1961,_0x33f7e6,_0xa1db35,_0x571bfd))),logger[_0x1971bc(0xa7)]('create-menus',_0x1971bc(0x96)+_0x43c933['length']);}export async function updateMenuCdnUrl(_0x546a2b,_0x2b0489,_0x533b20){const _0x56aaa4=a73_0x577a;logger[_0x56aaa4(0xa7)]('update-menu-cdn-url','Updating\x20menu\x20asset\x20links:\x20'+_0x533b20[_0x56aaa4(0xa9)]+'\x20('+_0x533b20[_0x56aaa4(0x90)]+')');const _0xe40418={'id':_0x533b20['id'],'appCode':_0x546a2b,'extend':{'loadScriptMode':'import','resources':_0x533b20[_0x56aaa4(0xb2)]?JSON[_0x56aaa4(0x92)](_0x533b20[_0x56aaa4(0xb2)]):undefined}};await platformFetch(getApiDomain()+_0x56aaa4(0x94),{'method':'POST','body':_0xe40418,'cookie':_0x2b0489,'label':_0x56aaa4(0x8e)+_0x533b20[_0x56aaa4(0xa9)]+'\x22'}),logger[_0x56aaa4(0xa7)](_0x56aaa4(0xa0),'Menu\x20assets\x20synced:\x20'+_0x533b20['label'],undefined);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a74_0x410a(){const _0x3ddc63=['jsUrl','selectedLabels','map','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','stdin','message','cssUrl','menu-sync','Menu\x20sync\x20completed','setLogPath','99295poZUtz','utf8','854258kjhqNO','push','object','trim','3154242rCKFmV','1596825lrAGSb','label','--params.','642844ceDktR','end','join','filter','startsWith','258zSyxnr','split','1200782uNpdFK','parse','isArray','field','pages','length','data','readableEnded','toString','JS\x20URL\x20is\x20unreachable:\x20','has','16464968NfyJnq','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','\x0a\x20\x20Available\x20local\x20pages:\x20','string'];a74_0x410a=function(){return _0x3ddc63;};return a74_0x410a();}(function(_0x539c23,_0x417e27){const _0x37102b=a74_0x4b69,_0x31300d=_0x539c23();while(!![]){try{const _0x131a3f=parseInt(_0x37102b(0xea))/0x1+parseInt(_0x37102b(0xf9))/0x2+parseInt(_0x37102b(0xef))/0x3+parseInt(_0x37102b(0xf2))/0x4+-parseInt(_0x37102b(0xe8))/0x5*(-parseInt(_0x37102b(0xf7))/0x6)+-parseInt(_0x37102b(0xee))/0x7+-parseInt(_0x37102b(0x104))/0x8;if(_0x131a3f===_0x417e27)break;else _0x31300d['push'](_0x31300d['shift']());}catch(_0x477e6c){_0x31300d['push'](_0x31300d['shift']());}}}(a74_0x410a,0x7852d));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0xeb0d09){const _0xb14eb6=a74_0x4b69,_0x5411f9=[];return _0xeb0d09['jsUrl']&&!isValidJsHttpsUrl(_0xeb0d09[_0xb14eb6(0x108)])&&_0x5411f9[_0xb14eb6(0xeb)]({'field':_0xb14eb6(0x108),'message':_0xb14eb6(0x10b)}),_0xeb0d09[_0xb14eb6(0x10e)]&&!isValidCssHttpsUrl(_0xeb0d09[_0xb14eb6(0x10e)])&&_0x5411f9[_0xb14eb6(0xeb)]({'field':_0xb14eb6(0x10e),'message':_0xb14eb6(0x105)}),_0x5411f9;}export async function runMenuSyncCore(_0x2ca787,_0x5aff9a,_0x29a218=[],_0x2d919e){const _0x49604b=a74_0x4b69,_0x141e6b=parseParamsFlag(_0x2d919e),_0x493c1e=_0x29a218[_0x49604b(0xfe)]>0x0?_0x29a218:_0x141e6b[_0x49604b(0x109)],_0x447ce5=_0x141e6b['jsUrl'],_0xcf9ab2=_0x141e6b[_0x49604b(0x10e)],_0x284e5f=[];if(_0x447ce5)_0x284e5f['push'](_0x447ce5);if(_0xcf9ab2)_0x284e5f['push'](_0xcf9ab2);const _0x2d3ffe=validateParams(_0x141e6b);if(_0x2d3ffe[_0x49604b(0xfe)]>0x0){const _0x573b55=_0x2d3ffe[_0x49604b(0x10a)](_0x336335=>_0x49604b(0xf1)+_0x336335[_0x49604b(0xfc)]+':\x20'+_0x336335[_0x49604b(0x10d)])[_0x49604b(0xf4)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x573b55);}logger[_0x49604b(0xe7)](process['cwd']()),logger['info'](_0x49604b(0x10f),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x2ca787,'selectedCount':_0x493c1e?.[_0x49604b(0xfe)],'jsUrl':_0x447ce5,'cssUrl':_0xcf9ab2});if(_0x447ce5){const _0x3e0534=await isUrlReachable(_0x447ce5);if(!_0x3e0534)throw new Error(_0x49604b(0x102)+_0x447ce5);}if(_0xcf9ab2){const _0x42431e=await isUrlReachable(_0xcf9ab2);if(!_0x42431e)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0xcf9ab2);}const _0x5e40a2=getLocalPages();if(_0x5e40a2[_0x49604b(0xfe)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x5e7f85=await getOnlineMenuList(_0x2ca787,_0x5aff9a),_0x296618=new Set(_0x5e7f85['map'](_0x4bb3f6=>_0x4bb3f6['path']));let _0x16a26c;if(_0x493c1e&&_0x493c1e[_0x49604b(0xfe)]>0x0){const _0x2e5900=new Set(_0x493c1e[_0x49604b(0x10a)](_0x533cf8=>_0x533cf8[_0x49604b(0xed)]()));_0x16a26c=_0x5e40a2['filter'](_0x4bf496=>_0x2e5900[_0x49604b(0x103)](_0x4bf496['label']));if(_0x16a26c['length']===0x0){const _0x4dd9a0=_0x5e40a2[_0x49604b(0x10a)](_0x26914a=>_0x26914a[_0x49604b(0xf0)])[_0x49604b(0xf4)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20labels:\x20'+[..._0x2e5900][_0x49604b(0xf4)](',\x20')+_0x49604b(0x106)+_0x4dd9a0);}}else _0x16a26c=_0x5e40a2[_0x49604b(0xf5)](_0x4c1a20=>!_0x296618[_0x49604b(0x103)](_0x4c1a20['path']));if(_0x16a26c[_0x49604b(0xfe)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x2ca787,_0x5aff9a,_0x16a26c,_0x284e5f[_0x49604b(0xfe)]>0x0?_0x284e5f:undefined),logger['info'](_0x49604b(0x10f),_0x49604b(0xe6),{'count':_0x16a26c[_0x49604b(0xfe)],'resources':_0x284e5f}),{'created':_0x16a26c[_0x49604b(0xfe)],'skipped':![],'targetPages':_0x16a26c};}export async function readPageLabelsFromStdin(){const _0xa4084=a74_0x4b69;if(!process[_0xa4084(0x10c)]['isTTY']&&!process[_0xa4084(0x10c)][_0xa4084(0x100)])return new Promise(_0x1661d7=>{const _0xe457da=_0xa4084,_0x4aaef5=[];process['stdin']['on'](_0xe457da(0xff),_0x39fa5a=>_0x4aaef5[_0xe457da(0xeb)](_0x39fa5a)),process['stdin']['on'](_0xe457da(0xf3),()=>{const _0x33d7b1=_0xe457da,_0x1c2204=Buffer['concat'](_0x4aaef5)[_0x33d7b1(0x101)](_0x33d7b1(0xe9)),_0x23df2c=_0x1c2204[_0x33d7b1(0xf8)]('\x0a')['map'](_0x28e318=>_0x28e318[_0x33d7b1(0xed)]())[_0x33d7b1(0xf5)](_0xd9e8cc=>_0xd9e8cc[_0x33d7b1(0xfe)]>0x0&&!_0xd9e8cc[_0x33d7b1(0xf6)]('#'));_0x1661d7(_0x23df2c);}),setTimeout(()=>_0x1661d7([]),0x1f4);});return[];}function a74_0x4b69(_0xf526a,_0x429a8f){_0xf526a=_0xf526a-0xe6;const _0x410a04=a74_0x410a();let _0x4b693b=_0x410a04[_0xf526a];return _0x4b693b;}function parseParamsFlag(_0x2f99f9){const _0x2bdbc4=a74_0x4b69;if(!_0x2f99f9||typeof _0x2f99f9!=='string')return{};try{const _0x558758=JSON[_0x2bdbc4(0xfa)](_0x2f99f9);if(typeof _0x558758!==_0x2bdbc4(0xec)||_0x558758===null||Array[_0x2bdbc4(0xfb)](_0x558758))return{};return{'selectedLabels':Array[_0x2bdbc4(0xfb)](_0x558758['pages'])?_0x558758[_0x2bdbc4(0xfd)][_0x2bdbc4(0x10a)](String):undefined,'jsUrl':typeof _0x558758['jsUrl']===_0x2bdbc4(0x107)?_0x558758['jsUrl'][_0x2bdbc4(0xed)]():undefined,'cssUrl':typeof _0x558758[_0x2bdbc4(0x10e)]==='string'?_0x558758[_0x2bdbc4(0x10e)]['trim']():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x241518,_0x5e8eb8){const _0x2203e5=a76_0x31bb,_0x31da39=_0x241518();while(!![]){try{const _0x130cf5=-parseInt(_0x2203e5(0x9c))/0x1*(-parseInt(_0x2203e5(0x9e))/0x2)+parseInt(_0x2203e5(0x94))/0x3+-parseInt(_0x2203e5(0x9a))/0x4+-parseInt(_0x2203e5(0x9f))/0x5*(-parseInt(_0x2203e5(0x8e))/0x6)+parseInt(_0x2203e5(0x95))/0x7+-parseInt(_0x2203e5(0x98))/0x8+parseInt(_0x2203e5(0xa4))/0x9*(-parseInt(_0x2203e5(0xaf))/0xa);if(_0x130cf5===_0x5e8eb8)break;else _0x31da39['push'](_0x31da39['shift']());}catch(_0x41ce48){_0x31da39['push'](_0x31da39['shift']());}}}(a76_0x346d,0xe2658));function a76_0x31bb(_0x3da3ed,_0x2207b0){_0x3da3ed=_0x3da3ed-0x8c;const _0x346dc8=a76_0x346d();let _0x31bb3c=_0x346dc8[_0x3da3ed];return _0x31bb3c;}import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x4a0459){const _0x4851bf=a76_0x31bb,_0x8b4159=[];return _0x4a0459['jsUrl']&&!isValidJsHttpsUrl(_0x4a0459[_0x4851bf(0x91)])&&_0x8b4159['push']({'field':_0x4851bf(0x91),'message':_0x4851bf(0xa8)}),_0x4a0459['cssUrl']&&!isValidCssHttpsUrl(_0x4a0459[_0x4851bf(0xb2)])&&_0x8b4159[_0x4851bf(0xb1)]({'field':_0x4851bf(0xb2),'message':_0x4851bf(0xaa)}),_0x8b4159;}export async function runMenuUpdateCore(_0x36d366,_0x53725d,_0x550f97){const _0x2acf44=a76_0x31bb,_0x114e62=parseUpdateParamsFlag(_0x550f97),_0x1b8581=[];if(_0x114e62[_0x2acf44(0x91)])_0x1b8581[_0x2acf44(0xb1)](_0x114e62['jsUrl']);if(_0x114e62[_0x2acf44(0xb2)])_0x1b8581[_0x2acf44(0xb1)](_0x114e62[_0x2acf44(0xb2)]);const _0x4a4d81=validateParams(_0x114e62);if(_0x4a4d81[_0x2acf44(0x8f)]>0x0){const _0x17daa9=_0x4a4d81[_0x2acf44(0x8c)](_0x65f46f=>_0x2acf44(0x93)+_0x65f46f[_0x2acf44(0xae)]+':\x20'+_0x65f46f['message'])[_0x2acf44(0x90)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x17daa9);}logger[_0x2acf44(0xb0)](process[_0x2acf44(0xa1)]()),logger[_0x2acf44(0x92)]('menu-update',_0x2acf44(0xa6),{'appCode':_0x36d366,'jsUrl':_0x114e62['jsUrl'],'cssUrl':_0x114e62[_0x2acf44(0xb2)]});if(_0x114e62[_0x2acf44(0x91)]){const _0x9abe1f=await isUrlReachable(_0x114e62[_0x2acf44(0x91)]);if(!_0x9abe1f)throw new Error(_0x2acf44(0xad)+_0x114e62[_0x2acf44(0x91)]);}if(_0x114e62[_0x2acf44(0xb2)]){const _0x1235af=await isUrlReachable(_0x114e62[_0x2acf44(0xb2)]);if(!_0x1235af)throw new Error(_0x2acf44(0xa5)+_0x114e62[_0x2acf44(0xb2)]);}const _0x725ab2=await getOnlineMenuList(_0x36d366,_0x53725d),_0x42e41d=_0x725ab2[_0x2acf44(0x97)](_0x2f5338=>_0x2f5338[_0x2acf44(0xab)][_0x2acf44(0x8f)]>0x0);if(_0x42e41d['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x40c99a=await Promise[_0x2acf44(0xa3)](_0x42e41d[_0x2acf44(0x8c)](_0x4d3214=>updateMenuCdnUrl(_0x36d366,_0x53725d,{'id':_0x4d3214['id'],'label':_0x4d3214['label'],'path':_0x4d3214[_0x2acf44(0x99)],'resources':_0x1b8581}))),_0x5a2dc5=_0x40c99a[_0x2acf44(0x97)](_0x4c7e50=>_0x4c7e50[_0x2acf44(0xa7)]===_0x2acf44(0x9b))[_0x2acf44(0x8f)];return logger[_0x2acf44(0x92)](_0x2acf44(0xa0),_0x2acf44(0x96),{'count':_0x42e41d[_0x2acf44(0x8f)],'resources':_0x1b8581}),{'updated':_0x42e41d[_0x2acf44(0x8f)]-_0x5a2dc5,'failed':_0x5a2dc5,'skipped':![]};}function parseUpdateParamsFlag(_0x57b9bd){const _0x503996=a76_0x31bb;if(!_0x57b9bd||typeof _0x57b9bd!=='string')return{};try{const _0x38a537=JSON[_0x503996(0x8d)](_0x57b9bd);if(typeof _0x38a537!==_0x503996(0xac)||_0x38a537===null||Array[_0x503996(0xa9)](_0x38a537))return{};return{'jsUrl':typeof _0x38a537[_0x503996(0x91)]==='string'?_0x38a537[_0x503996(0x91)][_0x503996(0x9d)]():undefined,'cssUrl':typeof _0x38a537['cssUrl']===_0x503996(0xa2)?_0x38a537[_0x503996(0xb2)][_0x503996(0x9d)]():undefined};}catch{return{};}}function a76_0x346d(){const _0x1ae3ae=['allSettled','170928kiXQFn','CSS\x20URL\x20is\x20unreachable:\x20','Start\x20non-interactive\x20menu\x20update','status','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','isArray','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','resources','object','JS\x20URL\x20is\x20unreachable:\x20','field','460EeIvwC','setLogPath','push','cssUrl','map','parse','4552266iOfkoq','length','join','jsUrl','info','--params.','2343477zSDNVH','2674658DAoYtt','Menu\x20update\x20completed','filter','7038568IdjYIx','path','3432280dodYxV','rejected','1PVqJmc','trim','3233758opqGkR','5JpJthy','menu-update','cwd','string'];a76_0x346d=function(){return _0x1ae3ae;};return a76_0x346d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x14a1c6,_0x2a45b2){const _0x3ad708=a77_0x468f,_0x1f299c=_0x14a1c6();while(!![]){try{const _0x4d6262=parseInt(_0x3ad708(0x19f))/0x1+-parseInt(_0x3ad708(0x199))/0x2*(parseInt(_0x3ad708(0x19a))/0x3)+parseInt(_0x3ad708(0x1a1))/0x4*(-parseInt(_0x3ad708(0x19b))/0x5)+parseInt(_0x3ad708(0x1a0))/0x6+-parseInt(_0x3ad708(0x195))/0x7*(-parseInt(_0x3ad708(0x19d))/0x8)+parseInt(_0x3ad708(0x196))/0x9+-parseInt(_0x3ad708(0x19e))/0xa*(parseInt(_0x3ad708(0x19c))/0xb);if(_0x4d6262===_0x2a45b2)break;else _0x1f299c['push'](_0x1f299c['shift']());}catch(_0x376c62){_0x1f299c['push'](_0x1f299c['shift']());}}}(a77_0x3862,0x994a1));function a77_0x3862(){const _0x103917=['test','6QkwuJn','319755CvKued','20IcWEMh','55DhqgLQ','16CpJvaK','1916590luwZfq','86243AfcvNj','6340602HbAjjd','78824yrFbQI','2463055ifsTpn','1242063lGXKvn','trim'];a77_0x3862=function(){return _0x103917;};return a77_0x3862();}export function isValidJsHttpsUrl(_0x2c8bb4){const _0x102fc9=a77_0x468f;return/^https:\/\/.+\.js(\?.*)?$/[_0x102fc9(0x198)](_0x2c8bb4['trim']());}export function isValidCssHttpsUrl(_0x565915){const _0x320199=a77_0x468f;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x565915[_0x320199(0x197)]());}function a77_0x468f(_0x303d54,_0x1a846b){_0x303d54=_0x303d54-0x195;const _0x3862ad=a77_0x3862();let _0x468f57=_0x3862ad[_0x303d54];return _0x468f57;}export async function isUrlReachable(_0x49843c){try{const _0x1cb692=await fetch(_0x49843c,{'method':'HEAD'});return _0x1cb692['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a78_0x453fae=a78_0x5096;(function(_0x4639a7,_0xe24c27){const _0x3a1105=a78_0x5096,_0x2c732f=_0x4639a7();while(!![]){try{const _0x2c8242=-parseInt(_0x3a1105(0x11b))/0x1+parseInt(_0x3a1105(0x133))/0x2+-parseInt(_0x3a1105(0x128))/0x3*(parseInt(_0x3a1105(0x114))/0x4)+parseInt(_0x3a1105(0x12d))/0x5+parseInt(_0x3a1105(0x13f))/0x6+-parseInt(_0x3a1105(0x149))/0x7+parseInt(_0x3a1105(0x14e))/0x8;if(_0x2c8242===_0xe24c27)break;else _0x2c732f['push'](_0x2c732f['shift']());}catch(_0x2fae6f){_0x2c732f['push'](_0x2c732f['shift']());}}}(a78_0x1c66,0xa64dc));import a78_0xab5c86 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';function a78_0x5096(_0x8ea54,_0x57fc19){_0x8ea54=_0x8ea54-0x114;const _0x1c662f=a78_0x1c66();let _0x509600=_0x1c662f[_0x8ea54];return _0x509600;}import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuSyncCore,readPageLabelsFromStdin}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';export const menuSync={'service':a78_0x453fae(0x136),'command':a78_0x453fae(0x124),'description':a78_0x453fae(0x120),'risk':a78_0x453fae(0x11e),'flags':[{'name':a78_0x453fae(0x126),'type':a78_0x453fae(0x137),'description':a78_0x453fae(0x11f)+a78_0x453fae(0x129)},{'name':a78_0x453fae(0x138),'type':a78_0x453fae(0x116),'description':a78_0x453fae(0x14d)}],async 'execute'(_0x32983b){const _0x578602=a78_0x453fae,_0x1c7bfa=_0x32983b[_0x578602(0x123)](_0x578602(0x138)),_0x774447=_0x32983b['str'](_0x578602(0x126)),_0x264c65=parseParams(_0x774447),_0x5c794a=!!(_0x264c65[_0x578602(0x147)]||_0x264c65[_0x578602(0x12e)]||_0x264c65[_0x578602(0x148)]&&_0x264c65[_0x578602(0x148)][_0x578602(0x12f)]>0x0);if(_0x1c7bfa||_0x5c794a){let _0x147b16=[];!isInteractive()&&!_0x264c65[_0x578602(0x148)]?.[_0x578602(0x12f)]&&(_0x147b16=await readPageLabelsFromStdin());const _0x422c6b=await runMenuSyncCore(_0x32983b['appCode'],_0x32983b['cookie'],_0x147b16[_0x578602(0x12f)]>0x0?_0x147b16:_0x264c65[_0x578602(0x148)]??[],_0x774447);if(_0x422c6b['skipped']){const _0xa7f1f8=getLocalPages();_0xa7f1f8[_0x578602(0x12f)]===0x0?writeCliSideChannelLine(_0x578602(0x146)):writeCliSideChannelLine('✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform');}else writeCliSideChannelLine(_0x578602(0x12b)+_0x422c6b[_0x578602(0x134)]+_0x578602(0x13a));return{'ok':!![]};}requireInteractive();const _0x5afed6=startSpinner(_0x578602(0x12c));let _0x73483b,_0x57b2c1,_0x3caced;try{const _0x3c40d5=await fetchMenuData(_0x32983b['appCode'],_0x32983b[_0x578602(0x11d)]);_0x73483b=_0x3c40d5[_0x578602(0x12a)],_0x57b2c1=_0x3c40d5['onlinePaths'],_0x3caced=_0x3c40d5[_0x578602(0x13d)],stopSpinner(_0x5afed6,_0x578602(0x125),!![]);}catch(_0x2ebbde){stopSpinner(_0x5afed6,_0x578602(0x11a),![]);throw CliErrors[_0x578602(0x132)](_0x2ebbde instanceof Error?_0x2ebbde[_0x578602(0x117)]:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}if(_0x73483b[_0x578602(0x12f)]===0x0)return writeCliSideChannelLine(a78_0xab5c86[_0x578602(0x14b)]('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x141b65=buildCompareRows(_0x73483b,_0x57b2c1);writeCliSideChannelLine(renderCompareTable(_0x141b65)),writeCliSideChannelLine('');const _0x25860a=_0x264c65[_0x578602(0x148)],_0x5eea37=await selectPages(_0x73483b,_0x57b2c1,_0x25860a);writeCliSideChannelLine(''),writeCliSideChannelLine(a78_0xab5c86[_0x578602(0x13c)](_0x578602(0x140)+_0x5eea37[_0x578602(0x12f)]+_0x578602(0x118)));const _0x59f444=_0x264c65[_0x578602(0x147)]&&_0x264c65['cssUrl'];if(!_0x59f444){writeCliSideChannelLine(renderSyncSummary(_0x5eea37,_0x57b2c1[_0x578602(0x13b)]>0x0));const _0x19dd1a=await askConfirm(_0x578602(0x14c));if(!_0x19dd1a)return writeCliSideChannelLine(a78_0xab5c86[_0x578602(0x121)](_0x578602(0x141))),{'ok':!![]};}let _0x57d988=_0x264c65['jsUrl'],_0x245466=_0x264c65['cssUrl'];!_0x57d988&&(_0x57d988=await askJsUrl());!_0x245466&&(_0x245466=await askCssUrl());const _0x4205fa=await askConfirm('\x20\x20Create\x20'+_0x5eea37['length']+_0x578602(0x14a)+_0x57d988+_0x578602(0x144)+_0x245466+'?');if(!_0x4205fa)return writeCliSideChannelLine(a78_0xab5c86[_0x578602(0x121)](_0x578602(0x141))),{'ok':!![]};const _0x20959f=[_0x57d988,_0x245466],_0x5c6a6b=startSpinner(_0x578602(0x119)+_0x5eea37[_0x578602(0x12f)]+'\x20menu(s)...');try{const _0x2b3080=await doCreateMenus(_0x32983b[_0x578602(0x14f)],_0x32983b['cookie'],_0x5eea37,_0x20959f);return stopSpinner(_0x5c6a6b,_0x578602(0x139)+_0x2b3080['created']+_0x578602(0x127),!![]),{'ok':!![],'data':_0x2b3080,'message':_0x578602(0x142)+_0x2b3080[_0x578602(0x134)]+_0x578602(0x131)+_0x2b3080[_0x578602(0x145)]+_0x578602(0x143)};}catch(_0x2b5a0b){stopSpinner(_0x5c6a6b,_0x578602(0x115),![]);throw CliErrors[_0x578602(0x132)](_0x2b5a0b instanceof Error?_0x2b5a0b[_0x578602(0x117)]:_0x578602(0x115));}}};function parseParams(_0x5dc17d){const _0x336eec=a78_0x453fae;if(!_0x5dc17d)return{};try{const _0x236b89=JSON[_0x336eec(0x135)](_0x5dc17d);if(typeof _0x236b89!==_0x336eec(0x13e)||_0x236b89===null||Array['isArray'](_0x236b89))return{};return{'jsUrl':typeof _0x236b89['jsUrl']===_0x336eec(0x137)?_0x236b89[_0x336eec(0x147)][_0x336eec(0x11c)]():undefined,'cssUrl':typeof _0x236b89[_0x336eec(0x12e)]===_0x336eec(0x137)?_0x236b89[_0x336eec(0x12e)][_0x336eec(0x11c)]():undefined,'pages':Array[_0x336eec(0x122)](_0x236b89[_0x336eec(0x148)])?_0x236b89[_0x336eec(0x148)][_0x336eec(0x130)](String):undefined};}catch{return{};}}function a78_0x1c66(){const _0x897914=['Menu\x20creation\x20failed','boolean','message','\x20page(s)','Creating\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','1053249VLPbrh','trim','cookie','write','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','Sync\x20local\x20pages\x20as\x20platform\x20menus','gray','isArray','flag','sync','Online\x20menu\x20list\x20fetched','params','\x20menu(s)','60jlKnMv','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','localPages','✓\x20Menu\x20sync\x20completed:\x20','Fetching\x20online\x20menu\x20list...','2342570SbbKYF','cssUrl','length','map','\x20created,\x20','validation','355780nKRFuz','created','parse','menu','string','yes','Created\x20','\x20menu(s)\x20created','size','cyan','onlineMenuList','object','5383812EWbzIM','\x20\x20✓\x20Selected:\x20','\x20\x20Cancelled.','Menu\x20sync\x20completed:\x20','\x20failed.','\x20and\x20CSS:\x20','failed','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','jsUrl','pages','4667880upVeSS','\x20menu(s)\x20with\x20JS:\x20','yellow','\x20\x20Continue\x20with\x20creation?','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','16267704NTeryb','appCode','235180RaAtWp'];a78_0x1c66=function(){return _0x897914;};return a78_0x1c66();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a79_0x5a38fb=a79_0x4cdb;(function(_0x3f7b3e,_0x18282b){const _0x27003b=a79_0x4cdb,_0x62d9a5=_0x3f7b3e();while(!![]){try{const _0x53790b=-parseInt(_0x27003b(0x1d3))/0x1+-parseInt(_0x27003b(0x205))/0x2+parseInt(_0x27003b(0x1e0))/0x3+parseInt(_0x27003b(0x1f3))/0x4*(parseInt(_0x27003b(0x1d2))/0x5)+parseInt(_0x27003b(0x1d6))/0x6+-parseInt(_0x27003b(0x1e7))/0x7+parseInt(_0x27003b(0x1e1))/0x8*(parseInt(_0x27003b(0x1ee))/0x9);if(_0x53790b===_0x18282b)break;else _0x62d9a5['push'](_0x62d9a5['shift']());}catch(_0xc81a81){_0x62d9a5['push'](_0x62d9a5['shift']());}}}(a79_0x49a7,0x1a916));import a79_0x90f34e from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'../../commands/menu/shared/logic.js';function a79_0x49a7(){const _0x254ae4=['boolean','cookie','updated','yellow','\x20menu(s)\x20with\x20JS:\x20','186975vclYrC','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','\x20menu(s)...','length','\x20updated,\x20','1404stunLC','validation','trim','jsUrl','\x20updated.','map','isArray','✓\x20Menu\x20update\x20completed:\x20','\x20menu(s)\x20with\x20existing\x20resources','appCode','Failed\x20to\x20fetch\x20online\x20menu\x20list','cyan','write','message','params','Menu\x20update\x20completed:\x20','yes','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','16704LLxRvM','skipped','\x20\x20Update\x20','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','\x20\x20Cancelled.','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','800Sgsdcd','104098ODATsV','Updated\x20','parse','545454YjncQk','Fetching\x20online\x20menu\x20list...','failed','\x20\x20Found\x20','Menu\x20update\x20failed','\x20and\x20CSS:\x20','\x20menu(s)','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','gray','cssUrl','493488VtIYWp','8HnoASo','Updating\x20','menu','string','\x20menu(s)\x20failed','\x20menu(s)\x20updated','777476DtZKAS','Online\x20menu\x20list\x20fetched'];a79_0x49a7=function(){return _0x254ae4;};return a79_0x49a7();}function a79_0x4cdb(_0x34bcdd,_0x3ff566){_0x34bcdd=_0x34bcdd-0x1cd;const _0x49a70b=a79_0x49a7();let _0x4cdb7b=_0x49a70b[_0x34bcdd];return _0x4cdb7b;}import{renderUpdateSummary}from'../../commands/menu/shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{runMenuUpdateCore}from'../../commands/menu/shared/update-core.js';export const menuUpdate={'service':a79_0x5a38fb(0x1e3),'command':'update','description':a79_0x5a38fb(0x204),'risk':a79_0x5a38fb(0x1ff),'flags':[{'name':a79_0x5a38fb(0x201),'type':'string','description':a79_0x5a38fb(0x1d1)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a79_0x5a38fb(0x203),'type':a79_0x5a38fb(0x1e9),'description':a79_0x5a38fb(0x1dd)}],async 'execute'(_0x1a2f9a){const _0x43564a=a79_0x5a38fb,_0x47cf9d=_0x1a2f9a['flag']('yes'),_0x3066ac=_0x1a2f9a['str'](_0x43564a(0x201)),_0x450585=parseParams(_0x3066ac),_0x25898e=!!(_0x450585[_0x43564a(0x1f6)]||_0x450585['cssUrl']);if(_0x47cf9d||_0x25898e&&!isInteractive()){const _0x140186=await runMenuUpdateCore(_0x1a2f9a[_0x43564a(0x1fc)],_0x1a2f9a[_0x43564a(0x1ea)],_0x3066ac);return _0x140186[_0x43564a(0x1cd)]?writeCliSideChannelLine(_0x43564a(0x1cf)):(writeCliSideChannelLine(_0x43564a(0x1fa)+_0x140186[_0x43564a(0x1eb)]+_0x43564a(0x1e6)),_0x140186[_0x43564a(0x1d8)]>0x0&&writeCliSideChannelLine('!\x20'+_0x140186['failed']+_0x43564a(0x1e5))),{'ok':_0x140186[_0x43564a(0x1d8)]===0x0};}requireInteractive();const _0x3d5467=startSpinner(_0x43564a(0x1d7));let _0x448e6b;try{_0x448e6b=await fetchOnlineMenuList(_0x1a2f9a['appCode'],_0x1a2f9a[_0x43564a(0x1ea)]),stopSpinner(_0x3d5467,_0x43564a(0x1e8),!![]);}catch(_0x756b61){stopSpinner(_0x3d5467,_0x43564a(0x1fd),![]);throw CliErrors[_0x43564a(0x1f4)](_0x756b61 instanceof Error?_0x756b61[_0x43564a(0x200)]:_0x43564a(0x1fd));}const _0x329164=filterMenusWithResources(_0x448e6b);if(_0x329164['length']===0x0)return writeCliSideChannelLine(a79_0x90f34e[_0x43564a(0x1ec)](_0x43564a(0x1ef))),{'ok':!![]};writeCliSideChannelLine(''),writeCliSideChannelLine(a79_0x90f34e[_0x43564a(0x1fe)](_0x43564a(0x1d9)+_0x329164[_0x43564a(0x1f1)]+_0x43564a(0x1fb))),writeCliSideChannelLine(renderUpdateSummary(_0x329164[_0x43564a(0x1f8)](_0x39eeec=>_0x39eeec['label']),[_0x450585['jsUrl'],_0x450585[_0x43564a(0x1df)]])),writeCliSideChannelLine('');let _0x2574bf=_0x450585[_0x43564a(0x1f6)],_0x4a20d6=_0x450585[_0x43564a(0x1df)];!_0x2574bf&&(_0x2574bf=await askJsUrl());!_0x4a20d6&&(_0x4a20d6=await askCssUrl());const _0x26c9ca=await askConfirm(_0x43564a(0x1ce)+_0x329164['length']+_0x43564a(0x1ed)+_0x2574bf+_0x43564a(0x1db)+_0x4a20d6+'?');if(!_0x26c9ca)return writeCliSideChannelLine(a79_0x90f34e[_0x43564a(0x1de)](_0x43564a(0x1d0))),{'ok':!![]};const _0x3e2c2e=[_0x2574bf,_0x4a20d6],_0x2eca95=startSpinner(_0x43564a(0x1e2)+_0x329164[_0x43564a(0x1f1)]+_0x43564a(0x1f0));try{const _0x9570cb=await doUpdateCdnUrls(_0x1a2f9a['appCode'],_0x1a2f9a[_0x43564a(0x1ea)],_0x329164,_0x3e2c2e);return stopSpinner(_0x2eca95,_0x43564a(0x1d4)+_0x9570cb[_0x43564a(0x1eb)]+_0x43564a(0x1dc),_0x9570cb[_0x43564a(0x1d8)]===0x0),{'ok':_0x9570cb[_0x43564a(0x1d8)]===0x0,'data':_0x9570cb,'message':_0x9570cb['failed']>0x0?_0x43564a(0x202)+_0x9570cb[_0x43564a(0x1eb)]+_0x43564a(0x1f2)+_0x9570cb['failed']+'\x20failed.':'Menu\x20update\x20completed:\x20'+_0x9570cb[_0x43564a(0x1eb)]+_0x43564a(0x1f7)};}catch(_0x1300b9){stopSpinner(_0x2eca95,_0x43564a(0x1da),![]);throw CliErrors['validation'](_0x1300b9 instanceof Error?_0x1300b9['message']:_0x43564a(0x1da));}}};function parseParams(_0x4043d8){const _0x3bebb4=a79_0x5a38fb;if(!_0x4043d8)return{};try{const _0x2c301d=JSON[_0x3bebb4(0x1d5)](_0x4043d8);if(typeof _0x2c301d!=='object'||_0x2c301d===null||Array[_0x3bebb4(0x1f9)](_0x2c301d))return{};return{'jsUrl':typeof _0x2c301d['jsUrl']===_0x3bebb4(0x1e4)?_0x2c301d[_0x3bebb4(0x1f6)][_0x3bebb4(0x1f5)]():undefined,'cssUrl':typeof _0x2c301d[_0x3bebb4(0x1df)]===_0x3bebb4(0x1e4)?_0x2c301d[_0x3bebb4(0x1df)][_0x3bebb4(0x1f5)]():undefined};}catch{return{};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x39f0ce,_0x570f20){const _0x37e7d3=a80_0x339a,_0x50a58e=_0x39f0ce();while(!![]){try{const _0x162219=-parseInt(_0x37e7d3(0x110))/0x1+-parseInt(_0x37e7d3(0x127))/0x2*(parseInt(_0x37e7d3(0x11f))/0x3)+parseInt(_0x37e7d3(0x124))/0x4+-parseInt(_0x37e7d3(0x114))/0x5*(parseInt(_0x37e7d3(0x123))/0x6)+parseInt(_0x37e7d3(0x12a))/0x7+parseInt(_0x37e7d3(0x11c))/0x8*(parseInt(_0x37e7d3(0x11e))/0x9)+-parseInt(_0x37e7d3(0x11d))/0xa*(-parseInt(_0x37e7d3(0x112))/0xb);if(_0x162219===_0x570f20)break;else _0x50a58e['push'](_0x50a58e['shift']());}catch(_0x165517){_0x50a58e['push'](_0x50a58e['shift']());}}}(a80_0x87c2,0xd4c35));import{existsSync}from'node:fs';import a80_0x3c8c1d from'node:path';function a80_0x87c2(){const _0x482b11=['Project\x20name\x20cannot\x20exceed\x2050\x20characters','Skipped','trim','√\x20Project\x20Name:\x20','1630288AlFEeC','Not\x20set','517SDOYxh','√\x20App\x20Code:\x20','215kBFrPU','log','test','\x22\x20already\x20exists','Login\x20failed','√\x20Login\x20status:\x20','cyan','production','288jNnNLq','55270BKWwvD','217656vUuYXd','1220049BtEFeh','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','resolve','string','94098YHzeqf','6342692fCaRFG','cwd','Project\x20name:','2YDIpsS','my-app','green','6067257tZDMGT','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','env'];a80_0x87c2=function(){return _0x482b11;};return a80_0x87c2();}import a80_0x42d7fe from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a80_0x339a(_0x629793,_0x4b7e13){_0x629793=_0x629793-0x10e;const _0x87c295=a80_0x87c2();let _0x339afb=_0x87c295[_0x629793];return _0x339afb;}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x4ed2ec,_0x37b763,_0x33bbaa){const _0x3de47a=a80_0x339a,_0x10b6d6=_0x3de47a(0x128),_0x5f4d24=readConfig(),_0xc515d0=typeof _0x5f4d24['env']===_0x3de47a(0x122)?_0x5f4d24[_0x3de47a(0x12c)]:undefined,_0x33cf77=await input({'message':_0x3de47a(0x126),'default':_0x10b6d6,'validate':_0x5ddc67=>{const _0x94f5a2=_0x3de47a,_0x3c9f43=_0x5ddc67[_0x94f5a2(0x10e)]()||_0x10b6d6;if(_0x3c9f43['length']>0x32)return _0x94f5a2(0x12d);const _0x2a6b07=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3c9f43&&!_0x2a6b07[_0x94f5a2(0x116)](_0x3c9f43))return _0x94f5a2(0x12b);const _0x289013=a80_0x3c8c1d[_0x94f5a2(0x121)](process[_0x94f5a2(0x125)](),_0x3c9f43);if(existsSync(_0x289013))return'Directory\x20\x22'+_0x3c9f43+_0x94f5a2(0x117);return!![];}});console[_0x3de47a(0x115)](a80_0x42d7fe[_0x3de47a(0x129)](_0x3de47a(0x10f)+a80_0x42d7fe[_0x3de47a(0x11a)](_0x33cf77)));const _0x5aa954=await selectSingleAppcode(_0x33bbaa);console[_0x3de47a(0x115)](a80_0x42d7fe[_0x3de47a(0x129)](_0x3de47a(0x113)+a80_0x42d7fe[_0x3de47a(0x11a)](_0x5aa954||_0x3de47a(0x111))));if(_0x5aa954){const _0x27654f=await getIsSessionValid();if(!_0x27654f){const _0x296e81=await confirm({'message':_0x3de47a(0x120),'default':!![]});if(_0x296e81){const _0x3be790=await authServer({'silent':!![]});console['log'](a80_0x42d7fe['green']('√\x20Login\x20status:\x20'+a80_0x42d7fe['cyan'](_0x3be790?'Logged\x20in':_0x3de47a(0x118))));}else console[_0x3de47a(0x115)](a80_0x42d7fe[_0x3de47a(0x129)](_0x3de47a(0x119)+a80_0x42d7fe[_0x3de47a(0x11a)](_0x3de47a(0x12e))));}await _0x4ed2ec({'projectName':_0x33cf77,'appCode':_0x5aa954,'env':_0x37b763||_0xc515d0||_0x3de47a(0x11b)});}else await _0x4ed2ec({'projectName':_0x33cf77,'env':_0x37b763||_0xc515d0||_0x3de47a(0x11b)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a81_0x3921(){const _0x3a4aa9=['21537956Yeebpg','66jHYvgX','replace','2475970hqJEcr','15WxDska','now','88UVKbGY','20890gvIrPE','toFixed','123kXgfzK','2372sItYMW','112842CIMrCZ','334033XqhtFn','858069iWUuCs'];a81_0x3921=function(){return _0x3a4aa9;};return a81_0x3921();}function a81_0x3450(_0x578442,_0x41b923){_0x578442=_0x578442-0x155;const _0x392117=a81_0x3921();let _0x3450a5=_0x392117[_0x578442];return _0x3450a5;}(function(_0x49b105,_0x37cd3a){const _0x3d14fd=a81_0x3450,_0x547021=_0x49b105();while(!![]){try{const _0xbf1d97=parseInt(_0x3d14fd(0x159))/0x1*(-parseInt(_0x3d14fd(0x161))/0x2)+parseInt(_0x3d14fd(0x15b))/0x3*(-parseInt(_0x3d14fd(0x15c))/0x4)+parseInt(_0x3d14fd(0x156))/0x5*(parseInt(_0x3d14fd(0x15d))/0x6)+parseInt(_0x3d14fd(0x15e))/0x7*(-parseInt(_0x3d14fd(0x158))/0x8)+-parseInt(_0x3d14fd(0x15f))/0x9+-parseInt(_0x3d14fd(0x155))/0xa+parseInt(_0x3d14fd(0x160))/0xb;if(_0xbf1d97===_0x37cd3a)break;else _0x547021['push'](_0x547021['shift']());}catch(_0x252e8b){_0x547021['push'](_0x547021['shift']());}}}(a81_0x3921,0x69af7));export function formatElapsed(_0x54ff6d){const _0x4861a4=a81_0x3450,_0x1394cc=Date[_0x4861a4(0x157)]()-_0x54ff6d;if(_0x1394cc<0x3e8)return _0x1394cc+'ms';const _0x5b2b60=(_0x1394cc/0x3e8)[_0x4861a4(0x15a)](0x2),_0x12900f=_0x5b2b60[_0x4861a4(0x162)](/\.?0+$/u,'');return _0x12900f+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x179420,_0x4ef8c4){const _0x1d650c=a82_0x1ac5,_0x264a71=_0x179420();while(!![]){try{const _0x151329=-parseInt(_0x1d650c(0x1ad))/0x1+-parseInt(_0x1d650c(0x176))/0x2*(-parseInt(_0x1d650c(0x1a0))/0x3)+parseInt(_0x1d650c(0x17f))/0x4+parseInt(_0x1d650c(0x162))/0x5+parseInt(_0x1d650c(0x174))/0x6+parseInt(_0x1d650c(0x18e))/0x7+-parseInt(_0x1d650c(0x193))/0x8*(parseInt(_0x1d650c(0x17e))/0x9);if(_0x151329===_0x4ef8c4)break;else _0x264a71['push'](_0x264a71['shift']());}catch(_0xfdf98d){_0x264a71['push'](_0x264a71['shift']());}}}(a82_0x4c1a,0x874c5));function a82_0x4c1a(){const _0x5b7a87=['cyan','208KQRzKq','description','\x20&&\x20','trim','\x20model(s)','length','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','清理项目目录失败:\x20','\x20|\x20AppCode:\x20','message','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','currentVersion','1374SkXKzn','cwd','projectName','name','\x20Generated\x20by\x20rabetbase\x20cli\x20','create','production','*\x20Configuring\x20AppCode\x20for\x20project\x20','projectCode','needsUpgrade','repeat','Project\x20directory\x20','info','771425wewZSH','cookie','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','1.0.0','\x20\x201.\x20Start\x20project:\x20','package.json','\x20√\x20','bold','resolve','更新\x20package.json\x20失败','1085985UHfZPH','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','...','gray','rmSync','log','utf8','start','API\x20配置拉取异常','🚀\x20Next\x20Steps:','toLocaleString','配置应用AppCode失败','stop','Format\x20code','parse','\x20already\x20exists','chdir','fail','1926678DtvewQ','readFileSync','3208XajOFx','warn','string','accessSync','*\x20Pulling\x20API\x20configuration...','√\x20Pulled\x20','更新\x20package.json\x20name','setLogPath','320517oYTSlP','1922844yeZjUy','constants','green','开始创建项目:\x20','appCode','error','CLI\x20版本检查','version','existsSync','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','Install\x20dependencies','join','\x20run\x20start','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','stringify','3485237FOQSMU','env','defaultApp','\x20config\x20set\x20appcode\x20<app-code>\x27'];a82_0x4c1a=function(){return _0x5b7a87;};return a82_0x4c1a();}import a82_0x29738a from'path';import a82_0x13a143 from'fs';import a82_0x5ed87b from'chalk';import a82_0x51a318 from'ora';import{guidedCreateProject}from'../../../commands/project/create/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';function a82_0x1ac5(_0x107c18,_0x5c18bf){_0x107c18=_0x107c18-0x159;const _0x4c1a43=a82_0x4c1a();let _0x1ac59c=_0x4c1a43[_0x107c18];return _0x1ac59c;}import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x17fbb9){const _0x4f24df=a82_0x1ac5,_0x8865a6=await checkCliVersion();_0x8865a6['needsUpgrade']&&(printCliUpgradeWarning(_0x8865a6),logger[_0x4f24df(0x1ac)](_0x4f24df(0x1a5),_0x4f24df(0x185),{'currentVersion':_0x8865a6[_0x4f24df(0x19f)],'stableVersion':_0x8865a6['stableVersion'],'needsUpgrade':_0x8865a6[_0x4f24df(0x1a9)]}));if(_0x17fbb9['projectCode']&&_0x17fbb9[_0x4f24df(0x183)])await runCreate({'projectName':_0x17fbb9[_0x4f24df(0x1a8)],'appCode':_0x17fbb9[_0x4f24df(0x183)],'env':_0x17fbb9['env']},_0x17fbb9);else{if(_0x17fbb9[_0x4f24df(0x1a8)]){const _0x5ccf0d=await selectSingleAppcode(_0x17fbb9[_0x4f24df(0x159)]);await runCreate({'projectName':_0x17fbb9[_0x4f24df(0x1a8)],'appCode':_0x5ccf0d||undefined,'env':_0x17fbb9['env']},_0x17fbb9);}else await guidedCreateProject(_0x1dbd66=>runCreate(_0x1dbd66,_0x17fbb9),_0x17fbb9['env'],_0x17fbb9[_0x4f24df(0x159)]);}}async function runCreate(_0x15fdb7,_0x56d421){const _0x447d3b=a82_0x1ac5;if(!_0x15fdb7['projectName']||_0x15fdb7[_0x447d3b(0x1a2)][_0x447d3b(0x196)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x1f25bc=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1f25bc['test'](_0x15fdb7[_0x447d3b(0x1a2)]))throw new Error(_0x447d3b(0x19d));if(_0x15fdb7['projectName'][_0x447d3b(0x198)]>0x64)throw new Error(_0x447d3b(0x18c));const _0x512a23=a82_0x29738a[_0x447d3b(0x160)](process[_0x447d3b(0x1a1)](),_0x15fdb7['projectName']);if(a82_0x13a143['existsSync'](_0x512a23))throw new Error(_0x447d3b(0x1ab)+_0x15fdb7[_0x447d3b(0x1a2)]+_0x447d3b(0x171));try{a82_0x13a143[_0x447d3b(0x179)](a82_0x29738a['dirname'](_0x512a23),a82_0x13a143[_0x447d3b(0x180)]['W_OK']);}catch{throw new Error(_0x447d3b(0x188));}logger[_0x447d3b(0x17d)](_0x512a23),logger[_0x447d3b(0x1ac)](_0x447d3b(0x1a5),_0x447d3b(0x182)+_0x15fdb7['projectName'],{'projectDir':_0x512a23,'appCode':_0x15fdb7[_0x447d3b(0x183)]}),console[_0x447d3b(0x167)](),console[_0x447d3b(0x167)](a82_0x5ed87b[_0x447d3b(0x181)](_0x447d3b(0x15e))+'Project\x20name:\x20'+a82_0x5ed87b[_0x447d3b(0x181)](_0x15fdb7[_0x447d3b(0x1a2)])+(_0x15fdb7[_0x447d3b(0x183)]?_0x447d3b(0x19b)+a82_0x5ed87b[_0x447d3b(0x192)](_0x15fdb7[_0x447d3b(0x183)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x15fdb7['projectName'])),await updatePackageJsonName(_0x15fdb7[_0x447d3b(0x1a2)]),await runTask(_0x447d3b(0x189),()=>installDependencies(_0x15fdb7[_0x447d3b(0x1a2)])),await runTask(_0x447d3b(0x16f),()=>formatProjectCode(_0x15fdb7[_0x447d3b(0x1a2)])),await configureAppCode(_0x15fdb7['projectName'],_0x15fdb7[_0x447d3b(0x183)]||'',_0x15fdb7[_0x447d3b(0x18f)]);let _0xe4f13a=![];if(_0x15fdb7[_0x447d3b(0x183)]){console['log'](_0x447d3b(0x17a));const _0x28427a=process[_0x447d3b(0x1a1)]();try{process[_0x447d3b(0x172)](_0x512a23);const _0x549c12=_0x15fdb7['env']||_0x447d3b(0x1a6);initEnv(_0x549c12);const {configArray:_0x2aa9e3}=await fetchModelList(_0x15fdb7[_0x447d3b(0x183)],_0x56d421[_0x447d3b(0x159)]||''),_0x544b9a=DEFAULT_API_DIR,_0x1d54ba=await generateApiFile(_0x2aa9e3,'',_0x15fdb7[_0x447d3b(0x183)],!![],_0x549c12,_0x544b9a);console[_0x447d3b(0x167)](_0x447d3b(0x17b)+_0x2aa9e3[_0x447d3b(0x198)]+'\x20dataset(s),\x20generated\x20'+_0x1d54ba['modelCount']+_0x447d3b(0x197)),logger['info'](_0x447d3b(0x1a5),'API\x20configuration\x20pulled:\x20'+_0x15fdb7[_0x447d3b(0x183)]);}catch(_0x2caf01){_0xe4f13a=!![],console[_0x447d3b(0x167)](_0x447d3b(0x19e)),logger['warn'](_0x447d3b(0x1a5),_0x447d3b(0x16a),{'error':_0x2caf01 instanceof Error?_0x2caf01[_0x447d3b(0x19c)]:String(_0x2caf01)});}finally{process['chdir'](_0x28427a);}}logger['success'](_0x447d3b(0x1a5),'项目创建完成:\x20'+_0x15fdb7['projectName']),console['log'](),console[_0x447d3b(0x167)](a82_0x5ed87b[_0x447d3b(0x181)]('─'[_0x447d3b(0x1aa)](0x3c))),console['log'](a82_0x5ed87b[_0x447d3b(0x192)][_0x447d3b(0x15f)](_0x447d3b(0x16b))),console[_0x447d3b(0x167)](),console[_0x447d3b(0x167)](_0x447d3b(0x15c)+a82_0x5ed87b[_0x447d3b(0x192)][_0x447d3b(0x15f)]('cd\x20'+_0x15fdb7[_0x447d3b(0x1a2)]+_0x447d3b(0x195)+CLI_BIN_NAME+_0x447d3b(0x18b))),_0xe4f13a&&console[_0x447d3b(0x167)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a82_0x5ed87b['cyan'][_0x447d3b(0x15f)](CLI_BIN_NAME+'\x20api\x20pull')),console['log'](a82_0x5ed87b['green']('─'[_0x447d3b(0x1aa)](0x3c)));}catch(_0x15fa03){logger['error'](_0x447d3b(0x1a5),'项目创建失败:\x20'+_0x15fdb7[_0x447d3b(0x1a2)],{'error':_0x15fa03 instanceof Error?_0x15fa03[_0x447d3b(0x19c)]:String(_0x15fa03)});try{a82_0x13a143[_0x447d3b(0x187)](_0x512a23)&&(console['log'](_0x447d3b(0x15a)+_0x512a23),a82_0x13a143[_0x447d3b(0x166)](_0x512a23,{'recursive':!![],'force':!![]}));}catch{logger[_0x447d3b(0x177)]('create',_0x447d3b(0x19a)+_0x512a23);}throw _0x15fa03;}}async function runTask(_0x5cada1,_0x4a34d9){const _0x25e743=a82_0x1ac5,_0x55af02=a82_0x51a318(_0x5cada1+_0x25e743(0x164))[_0x25e743(0x169)]();try{const _0x4e8a6b=await _0x4a34d9();_0x55af02[_0x25e743(0x16e)](),console[_0x25e743(0x167)](''+a82_0x5ed87b['green'](_0x25e743(0x15e))+_0x5cada1+'\x20'+a82_0x5ed87b[_0x25e743(0x165)]('['+_0x4e8a6b+']'));}catch(_0x1474ea){_0x55af02[_0x25e743(0x173)](_0x5cada1);throw _0x1474ea;}}async function updatePackageJsonName(_0x5cd0b4){const _0x9350f8=a82_0x1ac5,_0x5eca1d=a82_0x29738a[_0x9350f8(0x160)](process[_0x9350f8(0x1a1)](),_0x5cd0b4),_0x3b5ced=a82_0x29738a[_0x9350f8(0x18a)](_0x5eca1d,_0x9350f8(0x15d));try{console['log'](_0x9350f8(0x163));const _0x143731=getRabetbaseCliPackageRoot(),_0x161a46=a82_0x29738a[_0x9350f8(0x18a)](_0x143731,_0x9350f8(0x15d));let _0x1ed4da=_0x9350f8(0x15b);try{const _0x3fd617=JSON[_0x9350f8(0x170)](a82_0x13a143[_0x9350f8(0x175)](_0x161a46,_0x9350f8(0x168)));_0x1ed4da=_0x3fd617[_0x9350f8(0x186)]||'1.0.0';}catch{}const _0x596051=a82_0x13a143[_0x9350f8(0x175)](_0x3b5ced,'utf8'),_0x199883=JSON['parse'](_0x596051);_0x199883[_0x9350f8(0x1a3)]=_0x5cd0b4,_0x199883[_0x9350f8(0x194)]=_0x5cd0b4+_0x9350f8(0x1a4)+_0x1ed4da,a82_0x13a143['writeFileSync'](_0x3b5ced,JSON[_0x9350f8(0x18d)](_0x199883,null,0x2)+'\x0a',_0x9350f8(0x168)),console['log']('√\x20package.json\x20updated:\x20name='+_0x5cd0b4),logger[_0x9350f8(0x1ac)](_0x9350f8(0x1a5),_0x9350f8(0x17c));}catch(_0x377115){logger[_0x9350f8(0x184)](_0x9350f8(0x1a5),_0x9350f8(0x161));throw _0x377115;}}async function configureAppCode(_0x43d179,_0x5e8b3b,_0x2c75a8){const _0x4f5300=a82_0x1ac5,_0x13996e=a82_0x29738a[_0x4f5300(0x160)](process[_0x4f5300(0x1a1)](),_0x43d179),_0x34a1c8=a82_0x29738a[_0x4f5300(0x18a)](_0x13996e,NEW_CONFIG_NAME);try{_0x5e8b3b?console[_0x4f5300(0x167)](_0x4f5300(0x1a7)+_0x43d179+':\x20'+_0x5e8b3b):console[_0x4f5300(0x167)](_0x4f5300(0x199)+_0x43d179);const _0x38d07a=getRabetbaseCliPackageRoot(),_0x3b22bd=a82_0x29738a['join'](_0x38d07a,'package.json');let _0x15134d=_0x4f5300(0x15b);try{const _0x48209a=JSON[_0x4f5300(0x170)](a82_0x13a143['readFileSync'](_0x3b22bd,_0x4f5300(0x168)));_0x15134d=_0x48209a['version']||_0x4f5300(0x15b);}catch{}const _0x3f63a2=readConfig(),_0x527572=typeof _0x3f63a2['env']===_0x4f5300(0x178)?_0x3f63a2['env']:undefined,_0x534911={};for(const _0x2bb5fd of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3f63a2[_0x2bb5fd]!=null)_0x534911[_0x2bb5fd]=_0x3f63a2[_0x2bb5fd];}const _0x5c4289=buildCanonicalProjectConfig(_0x534911,{'appCodes':_0x5e8b3b?[_0x5e8b3b]:[],'env':_0x2c75a8||_0x527572||_0x4f5300(0x1a6),'metadata':{'createdAt':new Date()[_0x4f5300(0x16c)](),'version':_0x15134d}});writeConfigFile(_0x34a1c8,_0x5c4289),_0x5e8b3b?console['log']('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object['keys'](_0x5c4289['apps']||{})[_0x4f5300(0x18a)](',\x20')+'\x20|\x20Default:\x20'+_0x5c4289[_0x4f5300(0x190)]):console[_0x4f5300(0x167)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x4f5300(0x191)),logger[_0x4f5300(0x1ac)](_0x4f5300(0x1a5),'配置应用AppCode:\x20'+_0x5e8b3b);}catch(_0x376168){logger[_0x4f5300(0x184)](_0x4f5300(0x1a5),_0x4f5300(0x16d));}}
|
|
1
|
+
(function(_0x53f3ff,_0x237846){const _0x103032=a82_0x1f43,_0x5d29e7=_0x53f3ff();while(!![]){try{const _0x13f4eb=parseInt(_0x103032(0x10e))/0x1*(-parseInt(_0x103032(0x115))/0x2)+-parseInt(_0x103032(0x117))/0x3+-parseInt(_0x103032(0x13b))/0x4+-parseInt(_0x103032(0x146))/0x5*(-parseInt(_0x103032(0x14a))/0x6)+-parseInt(_0x103032(0x127))/0x7+-parseInt(_0x103032(0x13a))/0x8+parseInt(_0x103032(0x148))/0x9;if(_0x13f4eb===_0x237846)break;else _0x5d29e7['push'](_0x5d29e7['shift']());}catch(_0x4ac9b6){_0x5d29e7['push'](_0x5d29e7['shift']());}}}(a82_0x4067,0xe78ef));import a82_0x2ea68d from'path';import a82_0x12de8f from'fs';import a82_0x1009af from'chalk';import a82_0xa371a5 from'ora';import{guidedCreateProject}from'../../../commands/project/create/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{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';function a82_0x1f43(_0x42b576,_0x4b8970){_0x42b576=_0x42b576-0xfa;const _0x40671e=a82_0x4067();let _0x1f437c=_0x40671e[_0x42b576];return _0x1f437c;}import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x14087e){const _0x42e648=a82_0x1f43,_0x194b09=await checkCliVersion();_0x194b09[_0x42e648(0x134)]&&(printCliUpgradeWarning(_0x194b09),logger['info'](_0x42e648(0x102),_0x42e648(0x13c),{'currentVersion':_0x194b09[_0x42e648(0x103)],'stableVersion':_0x194b09[_0x42e648(0x113)],'needsUpgrade':_0x194b09[_0x42e648(0x134)]}));if(_0x14087e[_0x42e648(0x118)]&&_0x14087e['appCode'])await runCreate({'projectName':_0x14087e[_0x42e648(0x118)],'appCode':_0x14087e['appCode'],'env':_0x14087e[_0x42e648(0x106)]},_0x14087e);else{if(_0x14087e[_0x42e648(0x118)]){const _0x4ad8e0=await selectSingleAppcode(_0x14087e[_0x42e648(0x14b)]);await runCreate({'projectName':_0x14087e[_0x42e648(0x118)],'appCode':_0x4ad8e0||undefined,'env':_0x14087e['env']},_0x14087e);}else await guidedCreateProject(_0x1c728a=>runCreate(_0x1c728a,_0x14087e),_0x14087e['env'],_0x14087e['cookie']);}}async function runCreate(_0xf776cc,_0x3b9028){const _0x34250a=a82_0x1f43;if(!_0xf776cc['projectName']||_0xf776cc[_0x34250a(0x13f)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x15187f=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x15187f['test'](_0xf776cc['projectName']))throw new Error(_0x34250a(0xfe));if(_0xf776cc[_0x34250a(0x13f)][_0x34250a(0x135)]>0x64)throw new Error(_0x34250a(0x11f));const _0x2cfdaa=a82_0x2ea68d[_0x34250a(0x12b)](process[_0x34250a(0x14e)](),_0xf776cc[_0x34250a(0x13f)]);if(a82_0x12de8f[_0x34250a(0x11a)](_0x2cfdaa))throw new Error(_0x34250a(0x101)+_0xf776cc[_0x34250a(0x13f)]+_0x34250a(0x10a));try{a82_0x12de8f[_0x34250a(0x10b)](a82_0x2ea68d['dirname'](_0x2cfdaa),a82_0x12de8f['constants'][_0x34250a(0x122)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x34250a(0x141)](_0x2cfdaa),logger[_0x34250a(0x132)](_0x34250a(0x102),_0x34250a(0x13e)+_0xf776cc[_0x34250a(0x13f)],{'projectDir':_0x2cfdaa,'appCode':_0xf776cc[_0x34250a(0x14c)]}),console[_0x34250a(0x136)](),console[_0x34250a(0x136)](a82_0x1009af[_0x34250a(0x108)](_0x34250a(0x128))+_0x34250a(0x11c)+a82_0x1009af[_0x34250a(0x108)](_0xf776cc['projectName'])+(_0xf776cc['appCode']?'\x20|\x20AppCode:\x20'+a82_0x1009af['cyan'](_0xf776cc['appCode']):''));try{await runTask(_0x34250a(0x10f),()=>copyProjectTemplate(_0xf776cc[_0x34250a(0x13f)])),await updatePackageJsonName(_0xf776cc[_0x34250a(0x13f)]),await runTask('Install\x20dependencies',()=>installDependencies(_0xf776cc['projectName'])),await runTask(_0x34250a(0x119),()=>formatProjectCode(_0xf776cc[_0x34250a(0x13f)])),await configureAppCode(_0xf776cc['projectName'],_0xf776cc['appCode']||'',_0xf776cc[_0x34250a(0x106)]);let _0x2a09f6=![];if(_0xf776cc[_0x34250a(0x14c)]){console['log']('*\x20Pulling\x20API\x20configuration...');const _0x303ba7=process[_0x34250a(0x14e)]();try{process[_0x34250a(0x12a)](_0x2cfdaa);const _0x295b78=_0xf776cc[_0x34250a(0x106)]||_0x34250a(0x109);initEnv(_0x295b78);const {configArray:_0x26b78e}=await fetchModelList(_0xf776cc['appCode'],_0x3b9028[_0x34250a(0x14b)]||''),_0x3e7668=DEFAULT_API_DIR,_0x2977cd=await generateApiFile(_0x26b78e,'',_0xf776cc[_0x34250a(0x14c)],!![],_0x295b78,_0x3e7668);console[_0x34250a(0x136)](_0x34250a(0x149)+_0x26b78e[_0x34250a(0x135)]+'\x20dataset(s),\x20generated\x20'+_0x2977cd[_0x34250a(0x10c)]+_0x34250a(0x121)),logger[_0x34250a(0x132)](_0x34250a(0x102),_0x34250a(0x10d)+_0xf776cc['appCode']);}catch(_0x4b3c4c){_0x2a09f6=!![],console[_0x34250a(0x136)](_0x34250a(0xfd)),logger[_0x34250a(0xfa)](_0x34250a(0x102),_0x34250a(0x12f),{'error':_0x4b3c4c instanceof Error?_0x4b3c4c[_0x34250a(0x105)]:String(_0x4b3c4c)});}finally{process[_0x34250a(0x12a)](_0x303ba7);}}logger[_0x34250a(0x120)](_0x34250a(0x102),_0x34250a(0x130)+_0xf776cc[_0x34250a(0x13f)]),console['log'](),console['log'](a82_0x1009af[_0x34250a(0x108)]('─'['repeat'](0x3c))),console['log'](a82_0x1009af[_0x34250a(0x12d)][_0x34250a(0x124)](_0x34250a(0x116))),console[_0x34250a(0x136)](),console['log'](_0x34250a(0x104)+a82_0x1009af[_0x34250a(0x12d)]['bold']('cd\x20'+_0xf776cc[_0x34250a(0x13f)]+_0x34250a(0x142)+CLI_BIN_NAME+_0x34250a(0x112))),_0x2a09f6&&console[_0x34250a(0x136)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a82_0x1009af[_0x34250a(0x12d)][_0x34250a(0x124)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x34250a(0x136)](a82_0x1009af['green']('─'[_0x34250a(0x107)](0x3c)));}catch(_0x2a2ec2){logger['error'](_0x34250a(0x102),_0x34250a(0x129)+_0xf776cc['projectName'],{'error':_0x2a2ec2 instanceof Error?_0x2a2ec2[_0x34250a(0x105)]:String(_0x2a2ec2)});try{a82_0x12de8f[_0x34250a(0x11a)](_0x2cfdaa)&&(console['log'](_0x34250a(0x144)+_0x2cfdaa),a82_0x12de8f[_0x34250a(0x123)](_0x2cfdaa,{'recursive':!![],'force':!![]}));}catch{logger[_0x34250a(0xfa)]('create','清理项目目录失败:\x20'+_0x2cfdaa);}throw _0x2a2ec2;}}async function runTask(_0x5cd1a1,_0x222303){const _0x183fd3=a82_0x1f43,_0x15ba88=a82_0xa371a5(_0x5cd1a1+_0x183fd3(0x114))[_0x183fd3(0x140)]();try{const _0x29fcab=await _0x222303();_0x15ba88[_0x183fd3(0x147)](),console['log'](''+a82_0x1009af[_0x183fd3(0x108)](_0x183fd3(0x128))+_0x5cd1a1+'\x20'+a82_0x1009af[_0x183fd3(0x145)]('['+_0x29fcab+']'));}catch(_0x597ce0){_0x15ba88['fail'](_0x5cd1a1);throw _0x597ce0;}}async function updatePackageJsonName(_0x3c74b8){const _0x24c4ee=a82_0x1f43,_0x3ad019=a82_0x2ea68d[_0x24c4ee(0x12b)](process[_0x24c4ee(0x14e)](),_0x3c74b8),_0x46da4e=a82_0x2ea68d['join'](_0x3ad019,'package.json');try{console[_0x24c4ee(0x136)](_0x24c4ee(0x137));const _0x37e471=getRabetbaseCliPackageRoot(),_0x5222d8=a82_0x2ea68d[_0x24c4ee(0x11b)](_0x37e471,_0x24c4ee(0x143));let _0x325169=_0x24c4ee(0x126);try{const _0x98c397=JSON[_0x24c4ee(0x12c)](a82_0x12de8f[_0x24c4ee(0x14f)](_0x5222d8,_0x24c4ee(0x14d)));_0x325169=_0x98c397[_0x24c4ee(0x100)]||_0x24c4ee(0x126);}catch{}const _0x5a6351=a82_0x12de8f[_0x24c4ee(0x14f)](_0x46da4e,_0x24c4ee(0x14d)),_0x429a43=JSON['parse'](_0x5a6351);_0x429a43['name']=_0x3c74b8,_0x429a43['description']=_0x3c74b8+_0x24c4ee(0x125)+_0x325169,a82_0x12de8f[_0x24c4ee(0xfb)](_0x46da4e,JSON[_0x24c4ee(0x12e)](_0x429a43,null,0x2)+'\x0a','utf8'),console[_0x24c4ee(0x136)](_0x24c4ee(0x111)+_0x3c74b8),logger[_0x24c4ee(0x132)]('create',_0x24c4ee(0x133));}catch(_0x407397){logger[_0x24c4ee(0xff)](_0x24c4ee(0x102),_0x24c4ee(0x139));throw _0x407397;}}function a82_0x4067(){const _0x3500b7=['11804872hYvrIa','3982460yJHARN','CLI\x20版本检查','*\x20Configuring\x20AppCode\x20for\x20project\x20','开始创建项目:\x20','projectName','start','setLogPath','\x20&&\x20','package.json','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','gray','3549990OKxwCd','stop','41898852Lwpkcg','√\x20Pulled\x20','12YXBybE','cookie','appCode','utf8','cwd','readFileSync','warn','writeFileSync','string','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','error','version','Project\x20directory\x20','create','currentVersion','\x20\x201.\x20Start\x20project:\x20','message','env','repeat','green','production','\x20already\x20exists','accessSync','modelCount','API\x20configuration\x20pulled:\x20','4UiJAcH','Copy\x20project\x20files','配置应用AppCode:\x20','√\x20package.json\x20updated:\x20name=','\x20run\x20start','stableVersion','...','160502FZvCzu','🚀\x20Next\x20Steps:','2213193SNbDvd','projectCode','Format\x20code','existsSync','join','Project\x20name:\x20','defaultApp','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','success','\x20model(s)','W_OK','rmSync','bold','\x20Generated\x20by\x20rabetbase\x20cli\x20','1.0.0','11179014ZiTJsq','\x20√\x20','项目创建失败:\x20','chdir','resolve','parse','cyan','stringify','API\x20配置拉取异常','项目创建完成:\x20','keys','info','更新\x20package.json\x20name','needsUpgrade','length','log','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','√\x20Configuration\x20file\x20created,\x20Apps:\x20','更新\x20package.json\x20失败'];a82_0x4067=function(){return _0x3500b7;};return a82_0x4067();}async function configureAppCode(_0x33301b,_0xefdab4,_0x26bb08){const _0x45fbb2=a82_0x1f43,_0x392a06=a82_0x2ea68d[_0x45fbb2(0x12b)](process[_0x45fbb2(0x14e)](),_0x33301b),_0x58f38c=a82_0x2ea68d[_0x45fbb2(0x11b)](_0x392a06,NEW_CONFIG_NAME);try{_0xefdab4?console[_0x45fbb2(0x136)](_0x45fbb2(0x13d)+_0x33301b+':\x20'+_0xefdab4):console['log'](_0x45fbb2(0x11e)+_0x33301b);const _0x1d2c64=getRabetbaseCliPackageRoot(),_0x23b5d6=a82_0x2ea68d[_0x45fbb2(0x11b)](_0x1d2c64,_0x45fbb2(0x143));let _0x326c40=_0x45fbb2(0x126);try{const _0x3d761b=JSON[_0x45fbb2(0x12c)](a82_0x12de8f['readFileSync'](_0x23b5d6,'utf8'));_0x326c40=_0x3d761b['version']||_0x45fbb2(0x126);}catch{}const _0x4ab0f9=readConfig(),_0x1088e9=typeof _0x4ab0f9[_0x45fbb2(0x106)]===_0x45fbb2(0xfc)?_0x4ab0f9[_0x45fbb2(0x106)]:undefined,_0x4337e4={};for(const _0x2b92fd of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4ab0f9[_0x2b92fd]!=null)_0x4337e4[_0x2b92fd]=_0x4ab0f9[_0x2b92fd];}const _0xd0c049=buildCanonicalProjectConfig(_0x4337e4,{'appCodes':_0xefdab4?[_0xefdab4]:[],'env':_0x26bb08||_0x1088e9||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x326c40}});writeConfigFile(_0x58f38c,_0xd0c049),_0xefdab4?console['log'](_0x45fbb2(0x138)+Object[_0x45fbb2(0x131)](_0xd0c049['apps']||{})[_0x45fbb2(0x11b)](',\x20')+'\x20|\x20Default:\x20'+_0xd0c049[_0x45fbb2(0x11d)]):console[_0x45fbb2(0x136)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x45fbb2(0x132)](_0x45fbb2(0x102),_0x45fbb2(0x110)+_0xefdab4);}catch(_0x3a8655){logger[_0x45fbb2(0xff)](_0x45fbb2(0x102),'配置应用AppCode失败');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x596344,_0x4a6190){const _0x2dfedf=a83_0x53cc,_0xbd2633=_0x596344();while(!![]){try{const _0x1f3b2d=-parseInt(_0x2dfedf(0x102))/0x1+parseInt(_0x2dfedf(0xf6))/0x2+parseInt(_0x2dfedf(0xf4))/0x3*(-parseInt(_0x2dfedf(0x12d))/0x4)+parseInt(_0x2dfedf(0x105))/0x5*(parseInt(_0x2dfedf(0xf8))/0x6)+-parseInt(_0x2dfedf(0x107))/0x7*(-parseInt(_0x2dfedf(0x12b))/0x8)+parseInt(_0x2dfedf(0x119))/0x9*(-parseInt(_0x2dfedf(0x10b))/0xa)+parseInt(_0x2dfedf(0xf7))/0xb*(parseInt(_0x2dfedf(0x118))/0xc);if(_0x1f3b2d===_0x4a6190)break;else _0xbd2633['push'](_0xbd2633['shift']());}catch(_0x144620){_0xbd2633['push'](_0xbd2633['shift']());}}}(a83_0x1dc6,0x2f85d));import a83_0x2dd001 from'path';import a83_0x4ca9bc from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';function a83_0x53cc(_0x4935a2,_0x77131f){_0x4935a2=_0x4935a2-0xf4;const _0x1dc647=a83_0x1dc6();let _0x53ccb9=_0x1dc647[_0x4935a2];return _0x53ccb9;}import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';function a83_0x1dc6(){const _0x2484e8=['Project\x20name\x20contains\x20invalid\x20characters.','writeFile','package.json','modelCount','description','access','length','484760oRnXKy','bun\x20run\x20format','12gsHfkf','\x20created\x20successfully!','27309AUAlwv','\x20\x20√\x20Project\x20template\x20created','546950cLdUZL','104115MNJfjl','12XZEnGy','test','Check\x20directory\x20permissions.','bun','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','constants','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','cwd','resolve','npm','188627ktPGuL','...','Project\x20directory\x20\x22','449725mKjdXf','production','7VAqNks','\x20api\x20pull`\x20manually\x20later.','env','string','377670VzrZDG','trim','name','*\x20Creating\x20project\x20','\x22\x20already\x20exists.','Use\x20a\x20different\x20project\x20name.','\x20\x20√\x20Code\x20formatted','needsUpgrade','Cannot\x20create\x20project\x20in\x20current\x20directory.','join','\x0a√\x20Project\x20','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','W_OK','252ZChJaC','72yOodGT','chdir','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20\x20Pulling\x20API\x20configuration...','log','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20√\x20package.json\x20updated','bun\x20--version','Project\x20name\x20cannot\x20be\x20empty.','utf-8','validation'];a83_0x1dc6=function(){return _0x2484e8;};return a83_0x1dc6();}import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x420beb,_0x3afdad,_0x3df009,_0xea5195){const _0x525cdf=a83_0x53cc,_0xd2b88f=await checkCliVersion();_0xd2b88f[_0x525cdf(0x112)]&&printCliUpgradeWarning(_0xd2b88f);if(!_0x420beb||_0x420beb[_0x525cdf(0x10c)]()==='')throw CliErrors[_0x525cdf(0x123)](_0x525cdf(0x121));const _0x4f740e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4f740e[_0x525cdf(0xf9)](_0x420beb))throw CliErrors[_0x525cdf(0x123)](_0x525cdf(0x124),_0x525cdf(0x11b));if(_0x420beb[_0x525cdf(0x12a)]>0x64)throw CliErrors[_0x525cdf(0x123)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x3331c6=a83_0x2dd001[_0x525cdf(0x100)](process[_0x525cdf(0xff)](),_0x420beb);if(existsSync(_0x3331c6))throw CliErrors[_0x525cdf(0x123)](_0x525cdf(0x104)+_0x420beb+_0x525cdf(0x10f),_0x525cdf(0x110));try{const _0x17dba1=a83_0x2dd001['dirname'](_0x3331c6);await a83_0x4ca9bc[_0x525cdf(0x129)](_0x17dba1,a83_0x4ca9bc[_0x525cdf(0xfd)][_0x525cdf(0x117)]);}catch{throw CliErrors[_0x525cdf(0x123)](_0x525cdf(0x113),_0x525cdf(0xfa));}try{console['log'](_0x525cdf(0x10e)+_0x420beb+_0x525cdf(0x103));const _0x21b864=getSubAppReactDemoTemplateDir();await copyDirectory(_0x21b864,_0x3331c6),console[_0x525cdf(0x11d)](_0x525cdf(0xf5)),await updatePackageJsonName(_0x420beb),console[_0x525cdf(0x11d)](_0x525cdf(0x11f)),console[_0x525cdf(0x11d)]('\x20\x20Installing\x20dependencies...'),console['log'](_0x525cdf(0xfe)),await formatCode(_0x3331c6),console[_0x525cdf(0x11d)](_0x525cdf(0x111)),await configureProject(_0x420beb,_0x3df009,_0x3afdad),console['log'](_0x525cdf(0x11e)),_0x3df009&&await pullApiConfig(_0x3331c6,_0x3df009,_0x3afdad,_0xea5195),console[_0x525cdf(0x11d)](_0x525cdf(0x115)+_0x420beb+_0x525cdf(0x12e)),console['log']('\x0a\x20\x20cd\x20'+_0x420beb),console[_0x525cdf(0x11d)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0xacbf57){try{existsSync(_0x3331c6)&&await a83_0x4ca9bc['rm'](_0x3331c6,{'recursive':!![],'force':!![]});}catch{}throw _0xacbf57;}}async function updatePackageJsonName(_0x52926f){const _0x5bf747=a83_0x53cc,_0x309926=a83_0x2dd001[_0x5bf747(0x100)](process[_0x5bf747(0xff)](),_0x52926f),_0x5d758d=a83_0x2dd001[_0x5bf747(0x114)](_0x309926,_0x5bf747(0x126)),_0x4be864=await a83_0x4ca9bc['readFile'](_0x5d758d,_0x5bf747(0x122)),_0x1d6e36=JSON['parse'](_0x4be864);_0x1d6e36[_0x5bf747(0x10d)]=_0x52926f,_0x1d6e36[_0x5bf747(0x128)]=_0x5bf747(0x116),await a83_0x4ca9bc[_0x5bf747(0x125)](_0x5d758d,JSON['stringify'](_0x1d6e36,null,0x2)+'\x0a');}function detectPackageManager(){const _0x75df83=a83_0x53cc;try{return execSync(_0x75df83(0x120),{'stdio':'ignore'}),_0x75df83(0xfb);}catch{return _0x75df83(0x101);}}async function formatCode(_0x5c74f1){const _0x343789=a83_0x53cc;try{await execAsync(_0x343789(0x12c),{'cwd':_0x5c74f1});}catch{}}async function configureProject(_0x276edc,_0x10a18d,_0xbebdba){const _0x2f916c=a83_0x53cc,_0x4caa25=a83_0x2dd001[_0x2f916c(0x100)](process[_0x2f916c(0xff)](),_0x276edc),_0x3dffa7=a83_0x2dd001[_0x2f916c(0x114)](_0x4caa25,NEW_CONFIG_NAME),_0x1db74b=readConfig(),_0x26b604=typeof _0x1db74b[_0x2f916c(0x109)]===_0x2f916c(0x10a)?_0x1db74b[_0x2f916c(0x109)]:undefined,_0x4b0ba5={};for(const _0x6c62c9 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1db74b[_0x6c62c9]!=null)_0x4b0ba5[_0x6c62c9]=_0x1db74b[_0x6c62c9];}const _0x2ce3a2=buildCanonicalProjectConfig(_0x4b0ba5,{'appCodes':_0x10a18d?[_0x10a18d]:[],'env':_0xbebdba||_0x26b604||_0x2f916c(0x106),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':getCliVersion()}});writeConfigFile(_0x3dffa7,_0x2ce3a2);}async function pullApiConfig(_0xc60cb1,_0x3d6bc3,_0x457c8a,_0x137865){const _0x326d5e=a83_0x53cc,_0x8f9981=process['cwd']();try{process[_0x326d5e(0x11a)](_0xc60cb1);const _0x2e2b22=_0x457c8a||_0x326d5e(0x106);initEnv(_0x2e2b22),console[_0x326d5e(0x11d)](_0x326d5e(0x11c));const {configArray:_0x43996f}=await fetchModelList(_0x3d6bc3,_0x137865||''),_0x2aa3b3=await generateApiFile(_0x43996f,'',_0x3d6bc3,!![],_0x2e2b22,DEFAULT_API_DIR);console[_0x326d5e(0x11d)]('\x20\x20√\x20Pulled\x20'+_0x43996f[_0x326d5e(0x12a)]+'\x20dataset(s),\x20generated\x20'+_0x2aa3b3[_0x326d5e(0x127)]+'\x20model(s)');}catch(_0x40f3b4){console[_0x326d5e(0x11d)](_0x326d5e(0xfc)+CLI_BIN_NAME+_0x326d5e(0x108));}finally{process[_0x326d5e(0x11a)](_0x8f9981);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a84_0x257aec=a84_0x3cfa;function a84_0x3cfa(_0x3ec497,_0x5166b2){_0x3ec497=_0x3ec497-0x1b0;const _0x2fae49=a84_0x2fae();let _0x3cfa05=_0x2fae49[_0x3ec497];return _0x3cfa05;}(function(_0x25fd1c,_0x31d912){const _0x2b0146=a84_0x3cfa,_0x1521d6=_0x25fd1c();while(!![]){try{const _0x316152=-parseInt(_0x2b0146(0x1b9))/0x1+parseInt(_0x2b0146(0x1b4))/0x2+-parseInt(_0x2b0146(0x1b2))/0x3+parseInt(_0x2b0146(0x1b6))/0x4*(-parseInt(_0x2b0146(0x1ba))/0x5)+-parseInt(_0x2b0146(0x1b3))/0x6+parseInt(_0x2b0146(0x1b8))/0x7+parseInt(_0x2b0146(0x1bb))/0x8;if(_0x316152===_0x31d912)break;else _0x1521d6['push'](_0x1521d6['shift']());}catch(_0x5859bf){_0x1521d6['push'](_0x1521d6['shift']());}}}(a84_0x2fae,0x3c652));import a84_0x870884 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a84_0x870884[a84_0x257aec(0x1b0)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x33d697=a84_0x257aec;return a84_0x870884[_0x33d697(0x1b7)](__dirname,'../../../../');}function a84_0x2fae(){const _0x58f8c3=['sub-app-react-demo','4jKmjHM','resolve','1617672UsmTJk','52895fqFhSy','429085hWZRor','4717400ktNYlN','templates','dirname','projects','383721tBmkby','2851806EPwSCY','337054WUjcqg'];a84_0x2fae=function(){return _0x58f8c3;};return a84_0x2fae();}export function getSubAppReactDemoTemplateDir(){const _0x53a411=a84_0x257aec;return a84_0x870884['join'](getRabetbaseCliPackageRoot(),_0x53a411(0x1bc),_0x53a411(0x1b1),_0x53a411(0x1b5));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47f69b,_0x35ccb9){const _0x23f920=a85_0x2ca3,_0x42d256=_0x47f69b();while(!![]){try{const _0x3f27c3=-parseInt(_0x23f920(0x10a))/0x1*(-parseInt(_0x23f920(0x10e))/0x2)+parseInt(_0x23f920(0x100))/0x3*(-parseInt(_0x23f920(0x10d))/0x4)+-parseInt(_0x23f920(0x101))/0x5+-parseInt(_0x23f920(0x10b))/0x6+parseInt(_0x23f920(0x10c))/0x7+-parseInt(_0x23f920(0xfe))/0x8*(-parseInt(_0x23f920(0x104))/0x9)+parseInt(_0x23f920(0x105))/0xa;if(_0x3f27c3===_0x35ccb9)break;else _0x42d256['push'](_0x42d256['shift']());}catch(_0x578b51){_0x42d256['push'](_0x42d256['shift']());}}}(a85_0x2226,0x73673));import a85_0xdcaf87 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();function a85_0x2ca3(_0x513e65,_0x42ef15){_0x513e65=_0x513e65-0xfe;const _0x222665=a85_0x2226();let _0x2ca338=_0x222665[_0x513e65];return _0x2ca338;}export async function copyProjectTemplate(_0x6beab3){const _0x3a8fca=a85_0x2ca3,_0x223d0c=Date[_0x3a8fca(0xff)](),_0x3a226d=a85_0xdcaf87[_0x3a8fca(0x103)](process['cwd'](),_0x6beab3);try{logger['info'](_0x3a8fca(0x107),_0x3a8fca(0x109),{'projectCode':_0x6beab3,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3a226d);const _0x22cc9b=Date[_0x3a8fca(0xff)]()-_0x223d0c;logger[_0x3a8fca(0x108)](_0x3a8fca(0x107),_0x3a8fca(0x102),_0x22cc9b,{'projectCode':_0x6beab3});}catch(_0x627269){const _0x5df24e=Date[_0x3a8fca(0xff)]()-_0x223d0c;logger['error'](_0x3a8fca(0x107),_0x3a8fca(0x106),{'projectCode':_0x6beab3,'error':_0x627269 instanceof Error?_0x627269['message']:String(_0x627269),'duration':_0x5df24e});throw _0x627269;}return formatElapsed(_0x223d0c);}function a85_0x2226(){const _0x2843a4=['589437KLSgZS','4317350qtXusm','项目模板复制失败','copy','success','开始复制项目模板','5avEjju','4470246TpVdwu','2240994HyyAoN','36BaqohZ','337442EhZhNy','104QqhhPj','now','221973BqYwUO','2816200mBTdxw','项目模板复制完成','resolve'];a85_0x2226=function(){return _0x2843a4;};return a85_0x2226();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38a6d2,_0xa43ebc){const _0x4c05c7=a86_0x1596,_0x6790c7=_0x38a6d2();while(!![]){try{const _0x979350=parseInt(_0x4c05c7(0x1d7))/0x1+-parseInt(_0x4c05c7(0x1de))/0x2+parseInt(_0x4c05c7(0x1df))/0x3*(parseInt(_0x4c05c7(0x1e7))/0x4)+parseInt(_0x4c05c7(0x1e4))/0x5*(parseInt(_0x4c05c7(0x1d8))/0x6)+-parseInt(_0x4c05c7(0x1ea))/0x7*(-parseInt(_0x4c05c7(0x1e9))/0x8)+parseInt(_0x4c05c7(0x1e0))/0x9*(-parseInt(_0x4c05c7(0x1d9))/0xa)+-parseInt(_0x4c05c7(0x1db))/0xb*(parseInt(_0x4c05c7(0x1dd))/0xc);if(_0x979350===_0xa43ebc)break;else _0x6790c7['push'](_0x6790c7['shift']());}catch(_0x257a95){_0x6790c7['push'](_0x6790c7['shift']());}}}(a86_0xe979,0xaa061));function a86_0x1596(_0x28c63e,_0x310e38){_0x28c63e=_0x28c63e-0x1d7;const _0xe979d4=a86_0xe979();let _0x159608=_0xe979d4[_0x28c63e];return _0x159608;}import a86_0x587fb3 from'node:path';function a86_0xe979(){const _0x470cb7=['npx','168iJeRaK','433398NXTNLb','1271178IuliGQ','2984046VkSovo','10qDvcqq','now','1474FLgKza','resolve','135312lqkAqF','1552502WYFDBI','870yEyuhW','10842759msolNh','success','error','format','5Oyhqpy','cwd','message','15444LzOUCd'];a86_0xe979=function(){return _0x470cb7;};return a86_0xe979();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1cf15f){const _0x193245=a86_0x1596,_0xc77801=Date[_0x193245(0x1da)](),_0x423d37=a86_0x587fb3[_0x193245(0x1dc)](process[_0x193245(0x1e5)](),_0x1cf15f);try{logger['info'](_0x193245(0x1e3),'开始格式化代码',{'projectCode':_0x1cf15f}),await execa(resolveNpmBin(_0x193245(0x1e8)),['prettier','--write','.'],{'cwd':_0x423d37});const _0x253bb9=Date[_0x193245(0x1da)]()-_0xc77801;logger[_0x193245(0x1e1)](_0x193245(0x1e3),'代码格式化完成',_0x253bb9,{'projectCode':_0x1cf15f});}catch(_0x377231){const _0x1632ec=Date['now']()-_0xc77801;logger[_0x193245(0x1e2)](_0x193245(0x1e3),'代码格式化失败',{'projectCode':_0x1cf15f,'error':_0x377231 instanceof Error?_0x377231[_0x193245(0x1e6)]:String(_0x377231),'duration':_0x1632ec});throw _0x377231;}return formatElapsed(_0xc77801);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2859ce,_0x52d874){const _0x3e04e9=a87_0x4e09,_0x25b4c7=_0x2859ce();while(!![]){try{const _0x10cd95=parseInt(_0x3e04e9(0x1a8))/0x1+parseInt(_0x3e04e9(0x1a7))/0x2*(-parseInt(_0x3e04e9(0x1a4))/0x3)+-parseInt(_0x3e04e9(0x1a2))/0x4+-parseInt(_0x3e04e9(0x1a0))/0x5*(parseInt(_0x3e04e9(0x1a9))/0x6)+parseInt(_0x3e04e9(0x19d))/0x7*(-parseInt(_0x3e04e9(0x19e))/0x8)+-parseInt(_0x3e04e9(0x1a3))/0x9+parseInt(_0x3e04e9(0x19a))/0xa;if(_0x10cd95===_0x52d874)break;else _0x25b4c7['push'](_0x25b4c7['shift']());}catch(_0x242a97){_0x25b4c7['push'](_0x25b4c7['shift']());}}}(a87_0x23d7,0xf283b));import a87_0xb15b91 from'node:path';function a87_0x23d7(){const _0x39ffd8=['now','5ZCdtHw','error','1896668LFNEjd','11315556AWRBKM','63069vueOwE','message','success','72GlNsGk','1183715powIDN','9032994ilAFgE','info','install','https://registry.npmmirror.com','开始安装依赖','依赖安装失败','49040420WXklkC','npm','--registry','128408FBnnlC','480LCHxZZ'];a87_0x23d7=function(){return _0x39ffd8;};return a87_0x23d7();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a87_0x4e09(_0x1f2d1f,_0x19e367){_0x1f2d1f=_0x1f2d1f-0x195;const _0x23d794=a87_0x23d7();let _0x4e0990=_0x23d794[_0x1f2d1f];return _0x4e0990;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x251736){const _0x10e590=a87_0x4e09,_0x270979=Date[_0x10e590(0x19f)](),_0x578aeb=a87_0xb15b91['resolve'](process['cwd'](),_0x251736);try{logger[_0x10e590(0x195)](_0x10e590(0x196),_0x10e590(0x198),{'projectCode':_0x251736,'registry':_0x10e590(0x197)}),await execa(resolveNpmBin(_0x10e590(0x19b)),['install',_0x10e590(0x19c),_0x10e590(0x197)],{'cwd':_0x578aeb});const _0x36bc62=Date['now']()-_0x270979;logger[_0x10e590(0x1a6)](_0x10e590(0x196),'依赖安装完成',_0x36bc62,{'projectCode':_0x251736});}catch(_0x4bc70b){const _0x53c8d1=Date['now']()-_0x270979;logger[_0x10e590(0x1a1)](_0x10e590(0x196),_0x10e590(0x199),{'projectCode':_0x251736,'error':_0x4bc70b instanceof Error?_0x4bc70b[_0x10e590(0x1a5)]:String(_0x4bc70b),'duration':_0x53c8d1});throw _0x4bc70b;}return formatElapsed(_0x270979);}
|