@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.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/ai-setup/config.js +1 -1
- 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 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/mcp.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -0
- package/lib/telemetry/otel-logger-version.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.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/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a79_0x214d91=a79_0xbbaf;(function(_0x2bc5a6,_0xc35641){const _0x48f854=a79_0xbbaf,_0x46a8bf=_0x2bc5a6();while(!![]){try{const _0x4888bc=-parseInt(_0x48f854(0x1a9))/0x1+parseInt(_0x48f854(0x199))/0x2+parseInt(_0x48f854(0x1b0))/0x3+-parseInt(_0x48f854(0x1ae))/0x4+parseInt(_0x48f854(0x19c))/0x5+-parseInt(_0x48f854(0x192))/0x6+parseInt(_0x48f854(0x197))/0x7;if(_0x4888bc===_0xc35641)break;else _0x46a8bf['push'](_0x46a8bf['shift']());}catch(_0x5e6d20){_0x46a8bf['push'](_0x46a8bf['shift']());}}}(a79_0x2ce8,0x40aca));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';export const SUPPORTED_BFF_TYPES=[a79_0x214d91(0x1b3),a79_0x214d91(0x1a7),a79_0x214d91(0x194)];function a79_0xbbaf(_0x3eee6f,_0x3ceea5){_0x3eee6f=_0x3eee6f-0x192;const _0x2ce8c4=a79_0x2ce8();let _0xbbafec=_0x2ce8c4[_0x3eee6f];return _0xbbafec;}export function normalizeBffType(_0x4e7d8f){const _0x189a46=a79_0x214d91;if(!_0x4e7d8f)return undefined;const _0xe5bb2d=_0x4e7d8f[_0x189a46(0x1a8)]()['toUpperCase']();return SUPPORTED_BFF_TYPES['includes'](_0xe5bb2d)?_0xe5bb2d:undefined;}async function scanJsFilesRecursively(_0x58cb9c,_0x3643d9){const _0x5e79d6=a79_0x214d91,_0x4cd494=[];try{const _0x2fec1b=await readdir(_0x58cb9c,{'withFileTypes':!![]});for(const _0x480434 of _0x2fec1b){const _0x583834=join(_0x58cb9c,_0x480434[_0x5e79d6(0x1a2)]);if(_0x480434[_0x5e79d6(0x1b1)]())_0x4cd494[_0x5e79d6(0x1a5)](...await scanJsFilesRecursively(_0x583834,_0x3643d9+'/'+_0x480434['name']));else _0x480434['isFile']()&&_0x480434[_0x5e79d6(0x1a2)][_0x5e79d6(0x19d)](_0x5e79d6(0x198))&&_0x4cd494[_0x5e79d6(0x1a5)]({'lockKey':_0x3643d9+'/'+_0x480434[_0x5e79d6(0x1a2)][_0x5e79d6(0x1a4)](/\.js$/,''),'filePath':_0x583834});}}catch(_0x3e1faf){if(_0x3e1faf[_0x5e79d6(0x19a)]!==_0x5e79d6(0x1ac))throw _0x3e1faf;}return _0x4cd494;}async function scanFlatFunctions(_0x1f13f2,_0x3c032d){const _0x3426b5=a79_0x214d91,_0x4d82c2=join(_0x1f13f2[_0x3426b5(0x1af)],_0x3c032d),_0x1a456e=await scanJsFilesRecursively(_0x4d82c2,_0x3c032d);return _0x1a456e[_0x3426b5(0x1a6)](({lockKey:_0x5eb758,filePath:_0x5de940})=>({'type':_0x3c032d,'name':_0x5eb758[_0x3426b5(0x1a3)]('/')['at'](-0x1)??'','filePath':_0x5de940,'lockKey':_0x5eb758}));}async function scanHookFunctions(_0x33c6ba){const _0x43a927=a79_0x214d91,_0x3a80da=join(_0x33c6ba[_0x43a927(0x1af)],_0x43a927(0x194)),_0x534b9c=[];try{const _0x3cc004=await readdir(_0x3a80da,{'withFileTypes':!![]});for(const _0x157f4d of _0x3cc004){if(!_0x157f4d['isDirectory']())continue;const _0x120a89=_0x157f4d[_0x43a927(0x1a2)],_0x4d4723=join(_0x3a80da,_0x120a89),_0x4bd227=await readdir(_0x4d4723,{'withFileTypes':!![]});for(const _0x1004bd of _0x4bd227){if(!_0x1004bd[_0x43a927(0x1b1)]())continue;const _0x343f47=_0x1004bd[_0x43a927(0x1a2)],_0x5ef89d=join(_0x4d4723,_0x343f47),_0x283b66=await readdir(_0x5ef89d,{'withFileTypes':!![]});for(const _0x25bf85 of _0x283b66){if(!_0x25bf85[_0x43a927(0x1b1)]())continue;const _0x1e015c=_0x25bf85[_0x43a927(0x1a2)],_0x857100=join(_0x5ef89d,_0x1e015c),_0x4f7f75=await readdir(_0x857100,{'withFileTypes':!![]});for(const _0x52cdf7 of _0x4f7f75){if(!_0x52cdf7[_0x43a927(0x196)]()||!_0x52cdf7[_0x43a927(0x1a2)]['endsWith']('.js'))continue;const _0x3b3adc=_0x52cdf7['name']['replace'](/\.js$/,'');_0x534b9c[_0x43a927(0x1a5)]({'type':_0x43a927(0x194),'name':_0x3b3adc,'filePath':join(_0x857100,_0x52cdf7['name']),'lockKey':_0x43a927(0x19e)+_0x120a89+'/'+_0x343f47+'/'+_0x1e015c+'/'+_0x3b3adc,'alias':_0x120a89,'operationType':_0x343f47,'functionNode':_0x1e015c});}}}}}catch(_0x564590){if(_0x564590[_0x43a927(0x19a)]!=='ENOENT')throw _0x564590;}return _0x534b9c;}export async function scanLocalBffFunctions(_0x33e62d,_0x3c0285){const _0x2cfc01=a79_0x214d91;if(_0x3c0285==='COMMON'||_0x3c0285===_0x2cfc01(0x1a7))return scanFlatFunctions(_0x33e62d,_0x3c0285);if(_0x3c0285===_0x2cfc01(0x194))return scanHookFunctions(_0x33e62d);const [_0x598695,_0x46b9aa,_0x4fee42]=await Promise[_0x2cfc01(0x1b2)]([scanFlatFunctions(_0x33e62d,_0x2cfc01(0x1b3)),scanFlatFunctions(_0x33e62d,_0x2cfc01(0x1a7)),scanHookFunctions(_0x33e62d)]);return[..._0x598695,..._0x46b9aa,..._0x4fee42];}export function resolveLocalFilePathFromLockKey(_0x4176e1,_0x5b3b61){const _0x4db9ce=a79_0x214d91;return join(_0x4176e1[_0x4db9ce(0x1af)],..._0x5b3b61['split']('/'))+_0x4db9ce(0x198);}export function createHookLocationMap(_0x25d050){const _0x22166e=a79_0x214d91,_0x159b6e=new Map();for(const _0x3d9b2c of _0x25d050){_0x3d9b2c[_0x22166e(0x195)]&&_0x159b6e[_0x22166e(0x1ab)](_0x3d9b2c[_0x22166e(0x195)],{'datasetCode':_0x3d9b2c['datasetCode'],'operationType':snakeToCamel(_0x3d9b2c[_0x22166e(0x19f)]),'functionNode':'before'}),_0x3d9b2c[_0x22166e(0x1aa)]&&_0x159b6e[_0x22166e(0x1ab)](_0x3d9b2c[_0x22166e(0x1aa)],{'datasetCode':_0x3d9b2c[_0x22166e(0x1a1)],'operationType':snakeToCamel(_0x3d9b2c[_0x22166e(0x19f)]),'functionNode':'after'});}return _0x159b6e;}export function resolveRemoteScriptTarget(_0xd836cd,_0x3ce0cb,_0x1e33e8,_0x513c53,_0x4d7ad6){const _0x1388cf=a79_0x214d91,_0x5cbb7d=normalizeBffType(_0x3ce0cb[_0x1388cf(0x1b4)]);if(!_0x5cbb7d||!_0x3ce0cb[_0x1388cf(0x193)])return null;if(_0x5cbb7d===_0x1388cf(0x194)){const _0x574eb1=(_0x3ce0cb['id']?_0x1e33e8['get'](_0x3ce0cb['id']):undefined)??findHookLocationByRemoteId(_0x513c53,_0x3ce0cb['id']);if(!_0x574eb1)return null;const _0x16e18d=_0x574eb1[_0x1388cf(0x1ad)]||_0x4d7ad6[_0x1388cf(0x1a0)](_0x574eb1[_0x1388cf(0x1a1)]),_0x18ddd2=_0x16e18d??_0x574eb1[_0x1388cf(0x1a1)],_0x36eefa={..._0x574eb1,'alias':_0x16e18d},_0x381569=_0x1388cf(0x19e)+_0x18ddd2+'/'+_0x36eefa['operationType']+'/'+_0x36eefa[_0x1388cf(0x19b)]+'/'+_0x3ce0cb['functionName'];return{'lockKey':_0x381569,'filePath':resolveLocalFilePathFromLockKey(_0xd836cd,_0x381569),'type':_0x1388cf(0x194),'hookLocation':_0x36eefa};}const _0x3a5a3a=_0x5cbb7d+'/'+_0x3ce0cb[_0x1388cf(0x193)];return{'lockKey':_0x3a5a3a,'filePath':resolveLocalFilePathFromLockKey(_0xd836cd,_0x3a5a3a),'type':_0x5cbb7d};}export async function ensureParentDirectory(_0x150f7a){await mkdir(dirname(_0x150f7a),{'recursive':!![]});}function a79_0x2ce8(){const _0x452b1b=['scriptsRootDir','435207prlyal','isDirectory','all','COMMON','scriptType','2653836qMVlwZ','functionName','HOOK','beforeScriptId','isFile','4477375TQWsCj','.js','889246ZHlYsJ','code','functionNode','411000uHDaGl','endsWith','HOOK/','operationType','get','datasetCode','name','split','replace','push','map','ENDPOINT','trim','269373ZEDydb','afterScriptId','set','ENOENT','alias','1339728gSYbRt'];a79_0x2ce8=function(){return _0x452b1b;};return a79_0x2ce8();}export async function fileExists(_0x164a0d){try{return await access(_0x164a0d,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x7561c9){const _0x100f1d=a79_0x214d91;try{const _0x45f8b0=await stat(_0x7561c9);return _0x45f8b0[_0x100f1d(0x1b1)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x41ecfc,_0x59585d){const _0x322342=a80_0x50e8,_0x114da7=_0x41ecfc();while(!![]){try{const _0x29eadc=parseInt(_0x322342(0x1ee))/0x1*(-parseInt(_0x322342(0x1f9))/0x2)+-parseInt(_0x322342(0x1f8))/0x3*(parseInt(_0x322342(0x1fa))/0x4)+parseInt(_0x322342(0x1f0))/0x5*(parseInt(_0x322342(0x1f4))/0x6)+parseInt(_0x322342(0x1fc))/0x7+parseInt(_0x322342(0x1ed))/0x8+-parseInt(_0x322342(0x1f5))/0x9*(parseInt(_0x322342(0x1fb))/0xa)+parseInt(_0x322342(0x1f3))/0xb*(parseInt(_0x322342(0x1f1))/0xc);if(_0x29eadc===_0x59585d)break;else _0x114da7['push'](_0x114da7['shift']());}catch(_0x5e0607){_0x114da7['push'](_0x114da7['shift']());}}}(a80_0x482a,0x82c7c));import{readFile}from'node:fs/promises';import a80_0x1da9ec from'node:crypto';function a80_0x50e8(_0x458e66,_0x14e251){_0x458e66=_0x458e66-0x1ec;const _0x482a39=a80_0x482a();let _0x50e870=_0x482a39[_0x458e66];return _0x50e870;}export function computeContentHash(_0x25ab3b){const _0x47d3ec=a80_0x50e8;return a80_0x1da9ec['createHash'](_0x47d3ec(0x1f6))[_0x47d3ec(0x1ec)](_0x25ab3b)[_0x47d3ec(0x1f7)](_0x47d3ec(0x1f2));}function a80_0x482a(){const _0x1ade93=['update','1284664ckkZRD','89ZxgpuQ','utf8','467365ciANFs','60mNySFR','hex','2343803nQRhir','42aPNdnO','18ybJYkH','md5','digest','2849970DulEtz','21814PcSdXE','4PfVUiE','388860GjggLX','4577314DbKdMa'];a80_0x482a=function(){return _0x1ade93;};return a80_0x482a();}export async function computeFileHash(_0x540d87){const _0x504e1=a80_0x50e8,_0x4f94cd=await readFile(_0x540d87,_0x504e1(0x1ef));return computeContentHash(_0x4f94cd);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e06a2,_0x30ba50){const _0x2cd720=a81_0xb42f,_0x3f1c01=_0x5e06a2();while(!![]){try{const _0x497c=parseInt(_0x2cd720(0xe2))/0x1*(-parseInt(_0x2cd720(0xdf))/0x2)+parseInt(_0x2cd720(0xe0))/0x3*(-parseInt(_0x2cd720(0xef))/0x4)+parseInt(_0x2cd720(0xe9))/0x5*(parseInt(_0x2cd720(0xd6))/0x6)+parseInt(_0x2cd720(0xe8))/0x7+parseInt(_0x2cd720(0xee))/0x8*(-parseInt(_0x2cd720(0xd2))/0x9)+-parseInt(_0x2cd720(0xdb))/0xa*(parseInt(_0x2cd720(0xe6))/0xb)+-parseInt(_0x2cd720(0xde))/0xc*(-parseInt(_0x2cd720(0xd5))/0xd);if(_0x497c===_0x30ba50)break;else _0x3f1c01['push'](_0x3f1c01['shift']());}catch(_0x216758){_0x3f1c01['push'](_0x3f1c01['shift']());}}}(a81_0x3d90,0x845e0));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(_0x42faf4){return{'aliases':_0x42faf4?{'default':_0x42faf4}:{},'apps':{}};}function normalizeLockFile(_0x580c1d,_0x11c29c,_0x3b888b){const _0x4cc489=a81_0xb42f;if(_0x4cc489(0xe7)in _0x580c1d&&_0x580c1d[_0x4cc489(0xe7)]&&typeof _0x580c1d[_0x4cc489(0xe7)]===_0x4cc489(0xdc))return(!_0x580c1d['aliases']||typeof _0x580c1d['aliases']!==_0x4cc489(0xdc))&&(_0x580c1d[_0x4cc489(0xd7)]={}),!_0x580c1d['aliases'][_0x4cc489(0xea)]&&(_0x580c1d[_0x4cc489(0xd7)][_0x4cc489(0xea)]=_0x11c29c),_0x580c1d;const _0x27280c=_0x580c1d,_0x2e3e9d=_0x27280c[_0x4cc489(0xeb)]?.[_0x4cc489(0xda)]?.['trim']()||_0x11c29c,_0x3cdd32=_0x27280c[_0x4cc489(0xeb)]?.[_0x4cc489(0xd9)]?.[_0x4cc489(0xec)]()||_0x3b888b;return{'aliases':{'default':_0x2e3e9d},'apps':{[_0x2e3e9d]:{'scriptsRoot':_0x3cdd32,'lastSync':_0x27280c['lastSync']||'','functions':_0x27280c[_0x4cc489(0xe1)]||{}}}};}export function ensureLockScope(_0x101321,_0x49d5c7,_0x54c14e,_0x30fb2c,_0x21c4a6,_0x2bc83d){const _0x361b90=a81_0xb42f,_0x154682=normalizeLockFile(_0x101321,_0x21c4a6,_0x2bc83d);!_0x154682[_0x361b90(0xd7)][_0x361b90(0xea)]&&(_0x154682['aliases'][_0x361b90(0xea)]=_0x21c4a6);let _0x40a98b=_0x154682[_0x361b90(0xe7)][_0x49d5c7];if(!_0x40a98b)return _0x40a98b={'scriptsRoot':_0x54c14e,'lastSync':'','functions':{}},_0x154682[_0x361b90(0xe7)][_0x49d5c7]=_0x40a98b,{'lockData':_0x154682,'appLock':_0x40a98b};if(!_0x40a98b['scriptsRoot'])_0x40a98b[_0x361b90(0xd9)]=_0x54c14e;else{if(_0x40a98b['scriptsRoot']!==_0x54c14e)throw new Error(_0x30fb2c+_0x361b90(0xe4)+(_0x361b90(0xdd)+_0x54c14e+_0x361b90(0xd4)+_0x40a98b[_0x361b90(0xd9)]+_0x361b90(0xd3))+_0x361b90(0xe3));}return!_0x40a98b[_0x361b90(0xe1)]&&(_0x40a98b[_0x361b90(0xe1)]={}),!_0x40a98b[_0x361b90(0xd1)]&&(_0x40a98b['lastSync']=''),{'lockData':_0x154682,'appLock':_0x40a98b};}export async function readBffLockFile(_0x13e772){const _0x5900c6=a81_0xb42f;try{const _0x10e7bf=await readFile(_0x13e772,'utf8');return JSON[_0x5900c6(0xed)](_0x10e7bf);}catch(_0x223cb4){if(_0x223cb4[_0x5900c6(0xd8)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x223cb4));}}function a81_0xb42f(_0x28b87f,_0x138e81){_0x28b87f=_0x28b87f-0xd1;const _0x3d90c0=a81_0x3d90();let _0xb42f27=_0x3d90c0[_0x28b87f];return _0xb42f27;}export async function writeBffLockFile(_0x1f6844,_0x52ebe0){const _0x5281e5=a81_0xb42f;await mkdir(dirname(_0x1f6844),{'recursive':!![]}),await writeFile(_0x1f6844,JSON['stringify'](_0x52ebe0,null,0x2),_0x5281e5(0xe5));}function a81_0x3d90(){const _0x50fc26=['apps','2786875HXHWfW','29565ngJyWX','default','meta','trim','parse','1096kawNXm','4sFnwlW','lastSync','13437vQKvzi','\x22.\x20','\x22\x20vs\x20lock\x20\x22','962nzzhiG','102VXKLlg','aliases','code','scriptsRoot','appCode','2870twJHSE','object','current\x20\x22','408744VVYuBs','3482EwoYdi','2710059vEdVcq','functions','417HSHkHF','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.',':\x20scriptsRoot\x20mismatch\x20—\x20','utf8','24651evKPSZ'];a81_0x3d90=function(){return _0x50fc26;};return a81_0x3d90();}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a83_0x3698(_0x276960,_0x2abbb5){_0x276960=_0x276960-0x11f;const _0x4ffbc8=a83_0x4ffb();let _0x3698d7=_0x4ffbc8[_0x276960];return _0x3698d7;}(function(_0x48ee35,_0x57644f){const _0x4fb89b=a83_0x3698,_0x55ec6f=_0x48ee35();while(!![]){try{const _0x5a9497=-parseInt(_0x4fb89b(0x12f))/0x1+-parseInt(_0x4fb89b(0x127))/0x2*(-parseInt(_0x4fb89b(0x12a))/0x3)+parseInt(_0x4fb89b(0x129))/0x4*(parseInt(_0x4fb89b(0x11f))/0x5)+parseInt(_0x4fb89b(0x131))/0x6*(-parseInt(_0x4fb89b(0x12b))/0x7)+parseInt(_0x4fb89b(0x12e))/0x8*(parseInt(_0x4fb89b(0x133))/0x9)+-parseInt(_0x4fb89b(0x126))/0xa*(-parseInt(_0x4fb89b(0x137))/0xb)+-parseInt(_0x4fb89b(0x136))/0xc*(parseInt(_0x4fb89b(0x12c))/0xd);if(_0x5a9497===_0x57644f)break;else _0x55ec6f['push'](_0x55ec6f['shift']());}catch(_0x492dca){_0x55ec6f['push'](_0x55ec6f['shift']());}}}(a83_0x4ffb,0x45531));export function snakeToCamel(_0x36b072){const _0x52bc3c=a83_0x3698;return _0x36b072[_0x52bc3c(0x123)]()[_0x52bc3c(0x120)](/_([a-z])/g,(_0x38f2ee,_0x76fcb9)=>_0x76fcb9[_0x52bc3c(0x132)]());}export function findHookLocationByRemoteId(_0x125b97,_0x251bf8){const _0x9bd02f=a83_0x3698;if(!_0x251bf8)return undefined;for(const _0x1f9656 of Object[_0x9bd02f(0x134)](_0x125b97)){if(_0x1f9656[_0x9bd02f(0x128)]===_0x251bf8&&_0x1f9656[_0x9bd02f(0x130)]&&_0x1f9656['operationType']&&_0x1f9656[_0x9bd02f(0x135)])return{'datasetCode':_0x1f9656['datasetCode'],'operationType':_0x1f9656[_0x9bd02f(0x124)],'functionNode':_0x1f9656['functionNode']};}return undefined;}export function extractScriptDescription(_0x23b8e9){const _0x4fee15=a83_0x3698,_0x2aa445=_0x23b8e9[_0x4fee15(0x125)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x2aa445?.[0x1]?.[_0x4fee15(0x12d)]()||undefined;}export function isValidBffFunctionName(_0x1154af){const _0x504ee2=a83_0x3698;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x504ee2(0x121)](_0x1154af);}export function normalizeHookFunctionNode(_0x575b4f){const _0x192f0c=a83_0x3698;if(!_0x575b4f)return undefined;const _0x51fda8=_0x575b4f[_0x192f0c(0x12d)]()['toLowerCase']();if(_0x51fda8==='before'||_0x51fda8===_0x192f0c(0x122))return _0x51fda8;return undefined;}function a83_0x4ffb(){const _0x5155f7=['trim','8144rjayZY','124031bGqfDo','datasetCode','120132JSyjBl','toUpperCase','675CDeZfo','values','functionNode','122412HbpNWT','649MjmvXi','50aXkrBo','replace','test','after','toLowerCase','operationType','match','32990qpoWQs','174qONwVt','remoteId','163736KAkmPO','12195qjWYNr','119GlmZFb','364AqDKjw'];a83_0x4ffb=function(){return _0x5155f7;};return a83_0x4ffb();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5eb46d,_0x13d85e){const _0x1d2606=a84_0x514f,_0xd7b63b=_0x5eb46d();while(!![]){try{const _0x59ba41=-parseInt(_0x1d2606(0x67))/0x1*(parseInt(_0x1d2606(0x78))/0x2)+parseInt(_0x1d2606(0x80))/0x3*(-parseInt(_0x1d2606(0x74))/0x4)+parseInt(_0x1d2606(0x7e))/0x5*(-parseInt(_0x1d2606(0x7c))/0x6)+-parseInt(_0x1d2606(0x7a))/0x7+parseInt(_0x1d2606(0x6d))/0x8+parseInt(_0x1d2606(0x7f))/0x9*(-parseInt(_0x1d2606(0x76))/0xa)+parseInt(_0x1d2606(0x77))/0xb;if(_0x59ba41===_0x13d85e)break;else _0xd7b63b['push'](_0xd7b63b['shift']());}catch(_0x3dc374){_0xd7b63b['push'](_0xd7b63b['shift']());}}}(a84_0x41da,0x52359));function a84_0x514f(_0x3b897f,_0xeb7ab9){_0x3b897f=_0x3b897f-0x67;const _0x41dafb=a84_0x41da();let _0x514fcf=_0x41dafb[_0x3b897f];return _0x514fcf;}import{listDatasets}from'./api-client.js';const cache=new Map();export async function listDatabases(_0x1a146a){const _0x46a15c=a84_0x514f;if(cache[_0x46a15c(0x70)](_0x1a146a))return cache[_0x46a15c(0x71)](_0x1a146a);const _0x1517ad=await listDatasets(_0x1a146a),_0x451735=new Map();for(const _0x1d5142 of _0x1517ad){const _0x5523cd=_0x1d5142[_0x46a15c(0x6a)];_0x5523cd?.[_0x46a15c(0x6b)]!=null&&_0x451735[_0x46a15c(0x81)](_0x5523cd['dbId'],_0x5523cd[_0x46a15c(0x68)]??_0x46a15c(0x79)+_0x5523cd[_0x46a15c(0x6b)]);}const _0xc15d4c=[..._0x451735[_0x46a15c(0x72)]()][_0x46a15c(0x7b)](([_0x2a2f29,_0x1f5824])=>({'dbId':_0x2a2f29,'dbName':_0x1f5824}));return cache[_0x46a15c(0x81)](_0x1a146a,_0xc15d4c),_0xc15d4c;}export async function resolveDb(_0x369efb,_0x8a8315){const _0xace821=a84_0x514f,_0x21e92e=await listDatabases(_0x369efb);if(_0x21e92e['length']===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x8a8315)return{'resolved':_0x21e92e};const _0xedbd8f=Number(_0x8a8315);if(!Number['isNaN'](_0xedbd8f)){const _0xab270a=_0x21e92e[_0xace821(0x6e)](_0x5375e7=>_0x5375e7[_0xace821(0x6b)]===_0xedbd8f);if(_0xab270a)return{'resolved':[_0xab270a]};}const _0x4ffa8f=_0x8a8315[_0xace821(0x6c)](),_0xc449e=_0x21e92e[_0xace821(0x7d)](_0x34254d=>_0x34254d['dbName'][_0xace821(0x6c)]()[_0xace821(0x69)](_0x4ffa8f));if(_0xc449e['length']>0x0)return{'resolved':_0xc449e};const _0x254e06=_0x21e92e[_0xace821(0x7b)](_0x507e4f=>_0x507e4f[_0xace821(0x68)]+'\x20('+_0x507e4f[_0xace821(0x6b)]+')')['join'](',\x20');return{'resolved':[],'error':_0xace821(0x75)+_0x8a8315+_0xace821(0x6f)+_0x254e06};}function a84_0x41da(){const _0x133c57=['3453pVgIdT','set','113011oFDVRi','dbName','includes','dbtableConfig','dbId','toLowerCase','2296840ogMTyh','find','\x22.\x20Available:\x20','has','get','entries','join','1140oNpRjT','No\x20database\x20matching\x20\x22','56220eNysML','22335577lekGCt','10dNzmSW','db-','3454087ivsuSR','map','604806YuuWqT','filter','20rlUeta','306oRrKoA'];a84_0x41da=function(){return _0x133c57;};return a84_0x41da();}export async function resolveOneDb(_0x508c69,_0x13b563){const _0x2a86ab=a84_0x514f,{resolved:_0x272c01,error:_0x264c84}=await resolveDb(_0x508c69,_0x13b563);if(_0x264c84)return{'db':null,'error':_0x264c84};if(_0x272c01['length']===0x1)return{'db':_0x272c01[0x0]};if(!_0x13b563){const _0x2b2e9f=_0x272c01[_0x2a86ab(0x7b)](_0x54aca6=>_0x54aca6[_0x2a86ab(0x68)]+'\x20('+_0x54aca6['dbId']+')')[_0x2a86ab(0x73)](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x2b2e9f};}const _0x3c08d9=_0x272c01['map'](_0x114d1d=>_0x114d1d[_0x2a86ab(0x68)]+'\x20('+_0x114d1d[_0x2a86ab(0x6b)]+')')['join'](',\x20');return{'db':null,'error':'\x22'+_0x13b563+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x3c08d9+'.\x20Be\x20more\x20specific.'};}export async function getDbName(_0x46da29,_0x5dccae){const _0x54d3f7=a84_0x514f,_0x22a389=await listDatabases(_0x46da29);return _0x22a389[_0x54d3f7(0x6e)](_0x20e807=>_0x20e807[_0x54d3f7(0x6b)]===_0x5dccae)?.[_0x54d3f7(0x68)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x324810,_0x4c356a){const _0x234fc8=a85_0x5e15,_0x105e93=_0x324810();while(!![]){try{const _0x441677=parseInt(_0x234fc8(0x1cb))/0x1*(parseInt(_0x234fc8(0x1c4))/0x2)+parseInt(_0x234fc8(0x1c3))/0x3*(parseInt(_0x234fc8(0x1cc))/0x4)+parseInt(_0x234fc8(0x1c8))/0x5*(parseInt(_0x234fc8(0x1d3))/0x6)+parseInt(_0x234fc8(0x1ce))/0x7*(parseInt(_0x234fc8(0x1bb))/0x8)+parseInt(_0x234fc8(0x1d1))/0x9+-parseInt(_0x234fc8(0x1b4))/0xa*(parseInt(_0x234fc8(0x1d0))/0xb)+-parseInt(_0x234fc8(0x1c1))/0xc*(parseInt(_0x234fc8(0x1c6))/0xd);if(_0x441677===_0x4c356a)break;else _0x105e93['push'](_0x105e93['shift']());}catch(_0x1dee7f){_0x105e93['push'](_0x105e93['shift']());}}}(a85_0x180d,0xcce3c));export function detectSqlType(_0x5ba242){const _0x5b8e31=a85_0x5e15;if(!_0x5ba242?.[_0x5b8e31(0x1b0)]())return{'type':_0x5b8e31(0x1c7),'isSelectOnly':![],'isDangerous':![],'reason':_0x5b8e31(0x1b8)};const _0x14b03d=_0x5ba242[_0x5b8e31(0x1be)](/#\{[^}]*\}/g,'?')[_0x5b8e31(0x1be)](/\$\{[^}]*\}/g,'?')[_0x5b8e31(0x1be)](/@[^(\s]+(\([^)]*\))?/g,'')[_0x5b8e31(0x1be)](/\/\*[\s\S]*?\*\//g,'')[_0x5b8e31(0x1b0)](),_0x29f8a6=_0x14b03d[_0x5b8e31(0x1c2)]('\x0a');let _0x29d0ed='';for(const _0x410fba of _0x29f8a6){const _0x3fb5a4=_0x410fba[_0x5b8e31(0x1b0)]();if(!_0x3fb5a4||_0x3fb5a4[_0x5b8e31(0x1b6)]('--')||_0x3fb5a4['startsWith']('/*'))continue;_0x29d0ed=_0x3fb5a4;break;}const _0x5260fb=_0x29d0ed[_0x5b8e31(0x1b1)]();if(_0x5260fb[_0x5b8e31(0x1b6)](_0x5b8e31(0x1bd))||_0x5260fb['startsWith'](_0x5b8e31(0x1c5))){const _0x56b192=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i['test'](_0x14b03d);return{'type':'SELECT','isSelectOnly':!_0x56b192,'isDangerous':_0x56b192,'reason':_0x56b192?_0x5b8e31(0x1ac):undefined};}if(_0x5260fb[_0x5b8e31(0x1b6)](_0x5b8e31(0x1aa)))return{'type':_0x5b8e31(0x1aa),'isSelectOnly':![],'isDangerous':![]};if(_0x5260fb['startsWith'](_0x5b8e31(0x1b9)))return{'type':_0x5b8e31(0x1b9),'isSelectOnly':![],'isDangerous':![]};if(_0x5260fb['startsWith']('DELETE'))return{'type':_0x5b8e31(0x1a8),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5b8e31(0x1ab)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x5b8e31(0x1d2)](_0x5260fb))return{'type':_0x5b8e31(0x1a9),'isSelectOnly':![],'isDangerous':!![],'reason':_0x5b8e31(0x1ca)};return{'type':_0x5b8e31(0x1c7),'isSelectOnly':![],'isDangerous':![]};}function a85_0x5e15(_0x2a1d48,_0x408f61){_0x2a1d48=_0x2a1d48-0x1a8;const _0x180db0=a85_0x180d();let _0x5e1536=_0x180db0[_0x2a1d48];return _0x5e1536;}function a85_0x180d(){const _0x323a02=['\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','trim','toUpperCase','add','push','5580eytWCr','\x20query\x20targeting\x20','startsWith','\x20with\x20parameters:\x20','SQL\x20content\x20is\x20empty','UPDATE','matchAll','30432baXIzl','length','SELECT','replace','includes','join','7871628wucCKC','split','6TjSfUr','2GvojHZ','WITH','13aExGMB','UNKNOWN','31215yAlHsF','from','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','105769FkBhrH','1111484CdpZRi','type','238OIBMWz','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','26213pWCPsG','3641769PTEmYo','test','1566ORIXRS','DELETE','DDL','INSERT','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT','reason','match'];a85_0x180d=function(){return _0x323a02;};return a85_0x180d();}function extractTables(_0x30a14a){const _0x52837f=a85_0x5e15,_0x4711b6=_0x30a14a[_0x52837f(0x1be)](/#\{[^}]*\}/g,'?')[_0x52837f(0x1be)](/\$\{[^}]*\}/g,'?')[_0x52837f(0x1be)](/'[^']*'/g,'\x27\x27')['replace'](/--.*$/gm,'')[_0x52837f(0x1be)](/\/\*[\s\S]*?\*\//g,''),_0x11f9d8=[],_0x6eaec0=_0x4711b6[_0x52837f(0x1ae)](/FROM\s+([^\s,)(]+)/i);if(_0x6eaec0?.[0x1])_0x11f9d8['push'](_0x6eaec0[0x1]['replace'](/[`"]/g,''));for(const _0x20a1a0 of _0x4711b6['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x16a150=_0x20a1a0[0x1]?.[_0x52837f(0x1be)](/[`"]/g,'');if(_0x16a150&&!_0x11f9d8[_0x52837f(0x1bf)](_0x16a150))_0x11f9d8[_0x52837f(0x1b3)](_0x16a150);}const _0x24e238=_0x4711b6['match'](/INTO\s+([^\s(]+)/i);if(_0x24e238?.[0x1]){const _0x4665a4=_0x24e238[0x1]['replace'](/[`"]/g,'');if(!_0x11f9d8[_0x52837f(0x1bf)](_0x4665a4))_0x11f9d8[_0x52837f(0x1b3)](_0x4665a4);}const _0x33652f=_0x4711b6[_0x52837f(0x1ae)](/UPDATE\s+([^\s,)(]+)/i);if(_0x33652f?.[0x1]){const _0x27ffe2=_0x33652f[0x1]['replace'](/[`"]/g,'');if(!_0x11f9d8['includes'](_0x27ffe2))_0x11f9d8[_0x52837f(0x1b3)](_0x27ffe2);}return _0x11f9d8;}function extractParameters(_0xb629fc){const _0x25feef=a85_0x5e15,_0x4418ad=new Set();for(const _0x51fc0c of _0xb629fc[_0x25feef(0x1ba)](/#\{(\w+)\}/g))if(_0x51fc0c[0x1])_0x4418ad[_0x25feef(0x1b2)](_0x51fc0c[0x1]);for(const _0x3c7129 of _0xb629fc[_0x25feef(0x1ba)](/\$\{(\w+)\}/g))if(_0x3c7129[0x1])_0x4418ad[_0x25feef(0x1b2)](_0x3c7129[0x1]);return Array[_0x25feef(0x1c9)](_0x4418ad);}export function validateSql(_0x1e0fd2){const _0x4fe691=a85_0x5e15,_0x3cd553=detectSqlType(_0x1e0fd2),_0x4afdfa=extractTables(_0x1e0fd2),_0x3034b0=extractParameters(_0x1e0fd2);if(_0x3cd553['isDangerous'])return{'valid':![],'sqlType':_0x3cd553,'tables':_0x4afdfa,'parameters':_0x3034b0,'message':_0x3cd553[_0x4fe691(0x1ad)]||_0x3cd553[_0x4fe691(0x1cd)]+_0x4fe691(0x1af)};if(_0x3cd553[_0x4fe691(0x1cd)]===_0x4fe691(0x1c7))return{'valid':![],'sqlType':_0x3cd553,'tables':_0x4afdfa,'parameters':_0x3034b0,'message':_0x4fe691(0x1cf)};return{'valid':!![],'sqlType':_0x3cd553,'tables':_0x4afdfa,'parameters':_0x3034b0,'message':_0x3cd553[_0x4fe691(0x1cd)]+_0x4fe691(0x1b5)+(_0x4afdfa[_0x4fe691(0x1bc)]?_0x4afdfa[_0x4fe691(0x1c0)](',\x20'):'unknown\x20table(s)')+(_0x3034b0['length']?_0x4fe691(0x1b7)+_0x3034b0[_0x4fe691(0x1c0)](',\x20'):'')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5e367d,_0x41f917){const _0x233ed2=a85_0x8072,_0x3ec48c=_0x5e367d();while(!![]){try{const _0x1bd22e=parseInt(_0x233ed2(0xe1))/0x1+-parseInt(_0x233ed2(0xdb))/0x2*(parseInt(_0x233ed2(0xc6))/0x3)+-parseInt(_0x233ed2(0xd0))/0x4+parseInt(_0x233ed2(0xab))/0x5*(parseInt(_0x233ed2(0xce))/0x6)+-parseInt(_0x233ed2(0xaf))/0x7+-parseInt(_0x233ed2(0xa8))/0x8*(parseInt(_0x233ed2(0xae))/0x9)+-parseInt(_0x233ed2(0xe4))/0xa*(-parseInt(_0x233ed2(0xb5))/0xb);if(_0x1bd22e===_0x41f917)break;else _0x3ec48c['push'](_0x3ec48c['shift']());}catch(_0xc12be8){_0x3ec48c['push'](_0x3ec48c['shift']());}}}(a85_0x2b5c,0x43308));function a85_0x2b5c(){const _0x6b3eb5=['slice','66PAUImT','label','cyan','production','length','Project\x20Name','App\x20Code','rightArrow','login-check','*\x20Login\x20first\x20to\x20pull\x20API\x20config?','project-name','green','column','Bind\x20AppCode\x20to\x20auto-configure\x20API,\x20e.g.\x20app-c4c89304\x20(press\x20Enter\x20to\x20skip)','Invalid\x20project\x20name','Logged\x20in','Project\x20name\x20cannot\x20exceed\x2050\x20characters','222135qQjMNO','login-prompt','app-code','red','Project\x20directory\x20','Login\x20status','\x22\x20already\x20exists','step','900aPRQlJ','return','1005764mrHOHh','gray','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','login','\x20←\x20','login-process','Press\x20Enter\x20to\x20confirm\x20or\x20type\x20a\x20custom\x20name','delete','Yes','AppCode\x20can\x20only\x20contain\x20letters,\x20numbers,\x20hyphens\x20and\x20underscores,\x20and\x20must\x20start\x20with\x20a\x20letter\x20or\x20number','*\x20Creating\x20project...','10nwiFoF','creating','Login\x20skipped','map','trim','AppCode\x20cannot\x20exceed\x20100\x20characters','341501YKyvJV','*\x20Logging\x20in,\x20please\x20complete\x20in\x20browser...','*\x20Create\x20new\x20project','1412640JLXjmW','\x20Checking...','leftArrow','Not\x20set','\x20\x20Use\x20←→\x20to\x20choose,\x20press\x20Enter\x20to\x20confirm','80560yrSBck','Invalid\x20AppCode','resolve','11230nwiARN','[optional]:\x20','cwd','396VwuMxY','1302217TkEcsG','Project\x20name\x20must\x20start\x20with\x20a\x20letter\x20or\x20number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','string','Directory\x20\x22','env'];a85_0x2b5c=function(){return _0x6b3eb5;};return a85_0x2b5c();}function a85_0x8072(_0x4030d8,_0xe4e520){_0x4030d8=_0x4030d8-0xa7;const _0x2b5c8e=a85_0x2b5c();let _0x8072ce=_0x2b5c8e[_0x4030d8];return _0x8072ce;}import{jsx as a85_0x4e8542,jsxs as a85_0x2c1f78,Fragment as a85_0x4ed775}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a85_0x316d4f from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x5570a0){const _0x29f853=a85_0x8072,{onCreate:_0x1a7845,env:_0xb4fdf5}=_0x5570a0,[_0x407c3c,_0xf4bddb]=useState('project-name'),[_0x5e75bc,_0x1d07a8]=useState(''),[_0x4cead8,_0x41d128]=useState(''),[_0x12e2c9,_0x2bf332]=useState(''),[_0x1685d4,_0x52d59b]=useState(''),[_0x1ed2f5,_0x549919]=useState([]),[_0x3cbf66,_0x52d01a]=useState(null),[_0x569f0c,_0xa1e00a]=useState(![]),[_0x522d44,_0x529f06]=useState(![]),[_0x30b66a,_0x1221e2]=useState(0x0),[_0x2ab046,_0x27af41]=useState(''),_0xf9932c='my-app',_0xe8600e=readConfig(),_0x5f3b12=typeof _0xe8600e[_0x29f853(0xb3)]===_0x29f853(0xb1)?_0xe8600e[_0x29f853(0xb3)]:undefined;function _0x318c32(_0x9538bf){const _0x945b23=_0x29f853,_0x3bdc1c=_0x9538bf||_0xf9932c,_0x108dc6=a85_0x316d4f[_0x945b23(0xaa)](process[_0x945b23(0xad)](),_0x3bdc1c);return existsSync(_0x108dc6);}function _0x119c76(_0x1a39b1){const _0x3a10ea=_0x29f853;if(_0x1a39b1[_0x3a10ea(0xb9)]>0x32)return{'valid':![],'message':_0x3a10ea(0xc5)};const _0x2bace1=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1a39b1?.[_0x3a10ea(0xdf)]()&&!_0x2bace1['test'](_0x1a39b1))return{'valid':![],'message':_0x3a10ea(0xb0)};return{'valid':!![]};}function _0x333d05(_0xdac9ad){const _0x546213=_0x29f853;if(!_0xdac9ad['trim']())return{'valid':!![]};if(_0xdac9ad[_0x546213(0xb9)]>0x64)return{'valid':![],'message':_0x546213(0xe0)};const _0x2e1f1d=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x2e1f1d['test'](_0xdac9ad))return{'valid':![],'message':_0x546213(0xd9)};return{'valid':!![]};}async function _0x486354(){_0xa1e00a(!![]);try{const _0x8b1dea=await getIsSessionValid();return _0x52d01a(_0x8b1dea),_0x8b1dea;}catch(_0x14d5a1){return _0x52d01a(![]),![];}finally{_0xa1e00a(![]);}}async function _0x4cea5e(){_0x529f06(!![]);try{const _0x3dd7ab=await authServer({'silent':!![]});return _0x52d01a(_0x3dd7ab),_0x3dd7ab;}catch(_0x49b6fb){return _0x52d01a(![]),![];}finally{_0x529f06(![]);}}function _0x19b3d6(_0x48b28d){const _0x4b1cab=_0x29f853,_0x2bd0e8=_0xb4fdf5||_0x5f3b12||_0x4b1cab(0xb8);_0x1a7845({'projectName':_0x5e75bc,'appCode':_0x48b28d,'env':_0x2bd0e8}),_0xf4bddb(_0x4b1cab(0xdc));}return useInput(async(_0x57b973,_0x428caf)=>{const _0x3b0f0a=_0x29f853;if(_0x428caf[_0x3b0f0a(0xe6)]||_0x428caf[_0x3b0f0a(0xbc)]){if(_0x407c3c==='login-prompt'){_0x1221e2(_0x1f2703=>_0x1f2703===0x0?0x1:0x0);return;}}if(_0x428caf[_0x3b0f0a(0xcf)]){if(_0x407c3c===_0x3b0f0a(0xbf)){const _0x167e0e=_0x12e2c9[_0x3b0f0a(0xdf)]()||_0xf9932c;if(_0x1685d4)return;if(_0x318c32(_0x167e0e)){_0x27af41(_0x3b0f0a(0xca)+_0x167e0e+_0x3b0f0a(0xd2));return;}_0x1d07a8(_0x167e0e),_0x549919([{'step':_0x3b0f0a(0xbf),'label':_0x3b0f0a(0xba),'value':_0x167e0e}]),_0x2bf332(''),_0x52d59b(''),_0x27af41(''),_0xf4bddb(_0x3b0f0a(0xc8));return;}if(_0x407c3c===_0x3b0f0a(0xc8)){if(_0x1685d4)return;const _0x474b5c=_0x12e2c9[_0x3b0f0a(0xdf)]();_0x41d128(_0x474b5c),_0x549919(_0x4c268f=>[..._0x4c268f,{'step':_0x3b0f0a(0xc8),'label':_0x3b0f0a(0xbb),'value':_0x474b5c||_0x3b0f0a(0xe7)}]),_0x2bf332(''),_0x52d59b('');if(_0x474b5c){_0xf4bddb(_0x3b0f0a(0xbd));const _0x83f7f3=await _0x486354();_0x83f7f3?_0x19b3d6(_0x474b5c):_0xf4bddb(_0x3b0f0a(0xc7));}else _0x19b3d6(undefined);return;}if(_0x407c3c===_0x3b0f0a(0xc7)){const _0x2b09ed=_0x30b66a===0x0;if(_0x2b09ed){_0xf4bddb(_0x3b0f0a(0xd5));const _0x5afb3d=await _0x4cea5e();_0x5afb3d?(_0x549919(_0x4b25cb=>[..._0x4b25cb,{'step':_0x3b0f0a(0xd3),'label':_0x3b0f0a(0xcb),'value':_0x3b0f0a(0xc4)}]),_0x19b3d6(_0x4cead8)):(_0x549919(_0x11ee85=>[..._0x11ee85,{'step':'login','label':_0x3b0f0a(0xcb),'value':'Login\x20failed'}]),_0x19b3d6(_0x4cead8));}else _0x549919(_0x224aaf=>[..._0x224aaf,{'step':_0x3b0f0a(0xd3),'label':_0x3b0f0a(0xcb),'value':_0x3b0f0a(0xdd)}]),_0x19b3d6(_0x4cead8);return;}}if(_0x428caf['backspace']||_0x428caf[_0x3b0f0a(0xd7)]){_0x2bf332(_0xad7bb6=>{const _0x1a014b=_0x3b0f0a,_0x2ca474=_0xad7bb6[_0x1a014b(0xb4)](0x0,-0x1);if(_0x407c3c==='project-name'){const {valid:_0x45e821,message:_0x18bc8f}=_0x119c76(_0x2ca474);_0x52d59b(_0x45e821?'':_0x18bc8f||_0x1a014b(0xc3));if(_0x45e821&&!_0x1685d4){const _0x2e47e2=_0x2ca474||_0xf9932c;_0x318c32(_0x2e47e2)?_0x27af41(_0x1a014b(0xb2)+_0x2e47e2+_0x1a014b(0xcc)):_0x27af41('');}}else{if(_0x407c3c==='app-code'){const {valid:_0x124ff3,message:_0x55b86d}=_0x333d05(_0x2ca474);_0x52d59b(_0x124ff3?'':_0x55b86d||_0x1a014b(0xa9));}}return _0x2ca474;});return;}if([_0x3b0f0a(0xdc),_0x3b0f0a(0xbd),_0x3b0f0a(0xd5),_0x3b0f0a(0xc7)]['includes'](_0x407c3c))return;_0x2bf332(_0x1fb53e=>{const _0x30c241=_0x3b0f0a,_0x4c9dc8=_0x1fb53e+_0x57b973;if(_0x407c3c===_0x30c241(0xbf)){const {valid:_0x1027ce,message:_0x34d297}=_0x119c76(_0x4c9dc8);_0x52d59b(_0x1027ce?'':_0x34d297||_0x30c241(0xc3));if(_0x1027ce&&!_0x1685d4){const _0x34ed5a=_0x4c9dc8||_0xf9932c;_0x318c32(_0x34ed5a)?_0x27af41(_0x30c241(0xb2)+_0x34ed5a+'\x22\x20already\x20exists'):_0x27af41('');}}else{if(_0x407c3c===_0x30c241(0xc8)){const {valid:_0x53197b,message:_0x2cb6d4}=_0x333d05(_0x4c9dc8);_0x52d59b(_0x53197b?'':_0x2cb6d4||'Invalid\x20AppCode');}}return _0x4c9dc8;});}),a85_0x2c1f78(Box,{'flexDirection':_0x29f853(0xc1),'marginTop':0x1,'children':[_0x1ed2f5[_0x29f853(0xb9)]===0x0&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xb7),'children':_0x29f853(0xe3)})}),_0x1ed2f5[_0x29f853(0xde)](_0x1709fe=>a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':'√\x20'+_0x1709fe[_0x29f853(0xb6)]+':\x20'}),a85_0x4e8542(Text,{'color':'cyan','children':_0x1709fe['value']})]},_0x1709fe[_0x29f853(0xcd)])),_0x407c3c===_0x29f853(0xbf)&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20Project\x20name:\x20'}),_0x12e2c9?a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':_0x12e2c9}):a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0xf9932c}),_0x1685d4&&a85_0x2c1f78(Text,{'color':_0x29f853(0xc9),'children':[_0x29f853(0xd4),_0x1685d4]}),_0x2ab046&&a85_0x2c1f78(Text,{'color':'red','children':[_0x29f853(0xd4),_0x2ab046]})]}),!_0x1685d4&&!_0x2ab046&&!_0x12e2c9&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xd6)})})]}),_0x407c3c===_0x29f853(0xc8)&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20AppCode\x20'}),a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xac)}),a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':_0x12e2c9}),_0x1685d4&&a85_0x2c1f78(Text,{'color':'red','children':[_0x29f853(0xd4),_0x1685d4]})]}),!_0x1685d4&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xc2)})})]}),_0x407c3c===_0x29f853(0xbd)&&a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20Checking\x20login\x20status...'}),_0x569f0c&&a85_0x4e8542(Text,{'color':'gray','children':_0x29f853(0xe5)})]}),_0x407c3c==='login-prompt'&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':'yellow','children':'!\x20No\x20valid\x20login\x20detected'})}),a85_0x4e8542(Box,{'marginTop':0x1,'children':a85_0x4e8542(Text,{'children':_0x29f853(0xbe)})}),a85_0x2c1f78(Box,{'marginLeft':0x2,'children':[a85_0x2c1f78(Text,{'color':_0x30b66a===0x0?'green':_0x29f853(0xd1),'children':[_0x30b66a===0x0?'▶\x20':'\x20\x20',_0x29f853(0xd8)]}),a85_0x4e8542(Text,{'children':'\x20'}),a85_0x2c1f78(Text,{'color':_0x30b66a===0x1?'green':_0x29f853(0xd1),'children':[_0x30b66a===0x1?'▶\x20':'\x20\x20','No']})]}),a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xa7)})})]}),_0x407c3c===_0x29f853(0xd5)&&a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':_0x29f853(0xe2)}),_0x522d44&&a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':'\x20Logging\x20in...'})]}),_0x407c3c==='creating'&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':'green','children':_0x29f853(0xda)})})]});}
|
|
1
|
+
function a86_0x180c(_0x468fbe,_0x150c3c){_0x468fbe=_0x468fbe-0x1b7;const _0x5e5b2c=a86_0x5e5b();let _0x180cbc=_0x5e5b2c[_0x468fbe];return _0x180cbc;}(function(_0x557bc1,_0x1fae1d){const _0x2fe01e=a86_0x180c,_0x16f66f=_0x557bc1();while(!![]){try{const _0x5c16e1=parseInt(_0x2fe01e(0x1e0))/0x1*(-parseInt(_0x2fe01e(0x1e7))/0x2)+parseInt(_0x2fe01e(0x1f9))/0x3+parseInt(_0x2fe01e(0x1f3))/0x4*(parseInt(_0x2fe01e(0x1d8))/0x5)+-parseInt(_0x2fe01e(0x1f4))/0x6+parseInt(_0x2fe01e(0x1d4))/0x7*(parseInt(_0x2fe01e(0x1d6))/0x8)+-parseInt(_0x2fe01e(0x1bb))/0x9*(parseInt(_0x2fe01e(0x1bf))/0xa)+-parseInt(_0x2fe01e(0x1ee))/0xb;if(_0x5c16e1===_0x1fae1d)break;else _0x16f66f['push'](_0x16f66f['shift']());}catch(_0x4ea647){_0x16f66f['push'](_0x16f66f['shift']());}}}(a86_0x5e5b,0x98eeb));import{jsx as a86_0x1621c4,jsxs as a86_0x86c9fd,Fragment as a86_0x124c9f}from'react/jsx-runtime';function a86_0x5e5b(){const _0x304048=['length','Invalid\x20project\x20name','Login\x20skipped','resolve','map','2204pZsFUG','test','return','label','*\x20Login\x20first\x20to\x20pull\x20API\x20config?','string','Project\x20name\x20must\x20start\x20with\x20a\x20letter\x20or\x20number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','146QFvICJ','cwd','*\x20Project\x20name:\x20','env','project-name','production','login-prompt','17949283raRsyz','my-app','value','*\x20Create\x20new\x20project','Press\x20Enter\x20to\x20confirm\x20or\x20type\x20a\x20custom\x20name','28uZOyFW','1333200tZrrtf','app-code','\x22\x20already\x20exists','AppCode\x20cannot\x20exceed\x20100\x20characters','Bind\x20AppCode\x20to\x20auto-configure\x20API,\x20e.g.\x20app-c4c89304\x20(press\x20Enter\x20to\x20skip)','3442458gZhyzG','login-process','column','cyan','*\x20Creating\x20project...','37359KKslSS','Invalid\x20AppCode','red','Project\x20directory\x20','2110GvknHp','\x20Logging\x20in...','leftArrow','*\x20AppCode\x20','delete','trim','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','login-check','slice','rightArrow','App\x20Code','\x20←\x20','creating','gray','step','!\x20No\x20valid\x20login\x20detected','\x20\x20Use\x20←→\x20to\x20choose,\x20press\x20Enter\x20to\x20confirm','includes','AppCode\x20can\x20only\x20contain\x20letters,\x20numbers,\x20hyphens\x20and\x20underscores,\x20and\x20must\x20start\x20with\x20a\x20letter\x20or\x20number','green','Project\x20name\x20cannot\x20exceed\x2050\x20characters','1031191wRDGTy','login','64wKJjuv','backspace','850805POjZdc','Project\x20Name','Login\x20status'];a86_0x5e5b=function(){return _0x304048;};return a86_0x5e5b();}import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a86_0x43560c from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0xade1ae){const _0x226724=a86_0x180c,{onCreate:_0x2d1d6c,env:_0x363593}=_0xade1ae,[_0x49642c,_0x4d9686]=useState(_0x226724(0x1eb)),[_0x48335a,_0x2f9407]=useState(''),[_0x38057d,_0x4202dc]=useState(''),[_0x12df58,_0x465905]=useState(''),[_0x272591,_0x35dba6]=useState(''),[_0x2a31d9,_0x8f4492]=useState([]),[_0x4f8e5d,_0x9d25f4]=useState(null),[_0x7d9a24,_0x15ac65]=useState(![]),[_0x25f065,_0x34c201]=useState(![]),[_0x56733b,_0x41c12c]=useState(0x0),[_0x409105,_0x4014ae]=useState(''),_0x273f6c=_0x226724(0x1ef),_0x5ee9b5=readConfig(),_0x1f1008=typeof _0x5ee9b5[_0x226724(0x1ea)]===_0x226724(0x1e5)?_0x5ee9b5[_0x226724(0x1ea)]:undefined;function _0x305fba(_0x3ea1bc){const _0x1750c8=_0x226724,_0x5cab70=_0x3ea1bc||_0x273f6c,_0x3293da=a86_0x43560c[_0x1750c8(0x1de)](process[_0x1750c8(0x1e8)](),_0x5cab70);return existsSync(_0x3293da);}function _0x2ca030(_0x5c732a){const _0x59de83=_0x226724;if(_0x5c732a[_0x59de83(0x1db)]>0x32)return{'valid':![],'message':_0x59de83(0x1d3)};const _0x5f5af6=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5c732a?.[_0x59de83(0x1c4)]()&&!_0x5f5af6['test'](_0x5c732a))return{'valid':![],'message':_0x59de83(0x1e6)};return{'valid':!![]};}function _0x29631a(_0x3a5ec2){const _0x23509d=_0x226724;if(!_0x3a5ec2[_0x23509d(0x1c4)]())return{'valid':!![]};if(_0x3a5ec2[_0x23509d(0x1db)]>0x64)return{'valid':![],'message':_0x23509d(0x1f7)};const _0x3452e9=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x3452e9[_0x23509d(0x1e1)](_0x3a5ec2))return{'valid':![],'message':_0x23509d(0x1d1)};return{'valid':!![]};}async function _0x46f638(){_0x15ac65(!![]);try{const _0x35220f=await getIsSessionValid();return _0x9d25f4(_0x35220f),_0x35220f;}catch(_0x5b3983){return _0x9d25f4(![]),![];}finally{_0x15ac65(![]);}}async function _0x5a3240(){_0x34c201(!![]);try{const _0x5427a4=await authServer({'silent':!![]});return _0x9d25f4(_0x5427a4),_0x5427a4;}catch(_0x1df47a){return _0x9d25f4(![]),![];}finally{_0x34c201(![]);}}function _0x964de9(_0x124b4a){const _0x3c84e0=_0x226724,_0x207ed7=_0x363593||_0x1f1008||_0x3c84e0(0x1ec);_0x2d1d6c({'projectName':_0x48335a,'appCode':_0x124b4a,'env':_0x207ed7}),_0x4d9686(_0x3c84e0(0x1cb));}return useInput(async(_0x639545,_0x384d9d)=>{const _0x22e1ae=_0x226724;if(_0x384d9d[_0x22e1ae(0x1c1)]||_0x384d9d[_0x22e1ae(0x1c8)]){if(_0x49642c==='login-prompt'){_0x41c12c(_0xa9e087=>_0xa9e087===0x0?0x1:0x0);return;}}if(_0x384d9d[_0x22e1ae(0x1e2)]){if(_0x49642c===_0x22e1ae(0x1eb)){const _0x52e8f6=_0x12df58[_0x22e1ae(0x1c4)]()||_0x273f6c;if(_0x272591)return;if(_0x305fba(_0x52e8f6)){_0x4014ae(_0x22e1ae(0x1be)+_0x52e8f6+_0x22e1ae(0x1c5));return;}_0x2f9407(_0x52e8f6),_0x8f4492([{'step':_0x22e1ae(0x1eb),'label':_0x22e1ae(0x1d9),'value':_0x52e8f6}]),_0x465905(''),_0x35dba6(''),_0x4014ae(''),_0x4d9686('app-code');return;}if(_0x49642c===_0x22e1ae(0x1f5)){if(_0x272591)return;const _0x47a908=_0x12df58['trim']();_0x4202dc(_0x47a908),_0x8f4492(_0x60770e=>[..._0x60770e,{'step':_0x22e1ae(0x1f5),'label':_0x22e1ae(0x1c9),'value':_0x47a908||'Not\x20set'}]),_0x465905(''),_0x35dba6('');if(_0x47a908){_0x4d9686(_0x22e1ae(0x1c6));const _0x14a3f9=await _0x46f638();_0x14a3f9?_0x964de9(_0x47a908):_0x4d9686(_0x22e1ae(0x1ed));}else _0x964de9(undefined);return;}if(_0x49642c===_0x22e1ae(0x1ed)){const _0x4d70cc=_0x56733b===0x0;if(_0x4d70cc){_0x4d9686(_0x22e1ae(0x1b7));const _0x5f08a9=await _0x5a3240();_0x5f08a9?(_0x8f4492(_0x48c2c8=>[..._0x48c2c8,{'step':'login','label':_0x22e1ae(0x1da),'value':'Logged\x20in'}]),_0x964de9(_0x38057d)):(_0x8f4492(_0x4e5d7b=>[..._0x4e5d7b,{'step':_0x22e1ae(0x1d5),'label':'Login\x20status','value':'Login\x20failed'}]),_0x964de9(_0x38057d));}else _0x8f4492(_0x3ae1f8=>[..._0x3ae1f8,{'step':_0x22e1ae(0x1d5),'label':_0x22e1ae(0x1da),'value':_0x22e1ae(0x1dd)}]),_0x964de9(_0x38057d);return;}}if(_0x384d9d[_0x22e1ae(0x1d7)]||_0x384d9d[_0x22e1ae(0x1c3)]){_0x465905(_0xd787b3=>{const _0x390a17=_0x22e1ae,_0x3ea0e8=_0xd787b3[_0x390a17(0x1c7)](0x0,-0x1);if(_0x49642c===_0x390a17(0x1eb)){const {valid:_0x59ec9b,message:_0x5b76fc}=_0x2ca030(_0x3ea0e8);_0x35dba6(_0x59ec9b?'':_0x5b76fc||'Invalid\x20project\x20name');if(_0x59ec9b&&!_0x272591){const _0xa25ee7=_0x3ea0e8||_0x273f6c;_0x305fba(_0xa25ee7)?_0x4014ae('Directory\x20\x22'+_0xa25ee7+'\x22\x20already\x20exists'):_0x4014ae('');}}else{if(_0x49642c===_0x390a17(0x1f5)){const {valid:_0x1f1549,message:_0x38e023}=_0x29631a(_0x3ea0e8);_0x35dba6(_0x1f1549?'':_0x38e023||_0x390a17(0x1bc));}}return _0x3ea0e8;});return;}if(['creating',_0x22e1ae(0x1c6),_0x22e1ae(0x1b7),_0x22e1ae(0x1ed)][_0x22e1ae(0x1d0)](_0x49642c))return;_0x465905(_0x628996=>{const _0x1794fb=_0x22e1ae,_0x14e994=_0x628996+_0x639545;if(_0x49642c==='project-name'){const {valid:_0x5d23a0,message:_0x35bc1d}=_0x2ca030(_0x14e994);_0x35dba6(_0x5d23a0?'':_0x35bc1d||_0x1794fb(0x1dc));if(_0x5d23a0&&!_0x272591){const _0x58c44d=_0x14e994||_0x273f6c;_0x305fba(_0x58c44d)?_0x4014ae('Directory\x20\x22'+_0x58c44d+_0x1794fb(0x1f6)):_0x4014ae('');}}else{if(_0x49642c===_0x1794fb(0x1f5)){const {valid:_0x45f510,message:_0x2d5679}=_0x29631a(_0x14e994);_0x35dba6(_0x45f510?'':_0x2d5679||_0x1794fb(0x1bc));}}return _0x14e994;});}),a86_0x86c9fd(Box,{'flexDirection':_0x226724(0x1b8),'marginTop':0x1,'children':[_0x2a31d9['length']===0x0&&a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':_0x226724(0x1b9),'children':_0x226724(0x1f1)})}),_0x2a31d9[_0x226724(0x1df)](_0x36b2ba=>a86_0x86c9fd(Box,{'children':[a86_0x1621c4(Text,{'color':_0x226724(0x1d2),'children':'√\x20'+_0x36b2ba[_0x226724(0x1e3)]+':\x20'}),a86_0x1621c4(Text,{'color':_0x226724(0x1b9),'children':_0x36b2ba[_0x226724(0x1f0)]})]},_0x36b2ba[_0x226724(0x1cd)])),_0x49642c===_0x226724(0x1eb)&&a86_0x86c9fd(a86_0x124c9f,{'children':[a86_0x86c9fd(Box,{'children':[a86_0x1621c4(Text,{'children':_0x226724(0x1e9)}),_0x12df58?a86_0x1621c4(Text,{'color':_0x226724(0x1d2),'children':_0x12df58}):a86_0x1621c4(Text,{'color':_0x226724(0x1cc),'children':_0x273f6c}),_0x272591&&a86_0x86c9fd(Text,{'color':'red','children':[_0x226724(0x1ca),_0x272591]}),_0x409105&&a86_0x86c9fd(Text,{'color':_0x226724(0x1bd),'children':[_0x226724(0x1ca),_0x409105]})]}),!_0x272591&&!_0x409105&&!_0x12df58&&a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':_0x226724(0x1cc),'children':_0x226724(0x1f2)})})]}),_0x49642c===_0x226724(0x1f5)&&a86_0x86c9fd(a86_0x124c9f,{'children':[a86_0x86c9fd(Box,{'children':[a86_0x1621c4(Text,{'children':_0x226724(0x1c2)}),a86_0x1621c4(Text,{'color':_0x226724(0x1cc),'children':'[optional]:\x20'}),a86_0x1621c4(Text,{'color':_0x226724(0x1d2),'children':_0x12df58}),_0x272591&&a86_0x86c9fd(Text,{'color':_0x226724(0x1bd),'children':[_0x226724(0x1ca),_0x272591]})]}),!_0x272591&&a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':'gray','children':_0x226724(0x1f8)})})]}),_0x49642c===_0x226724(0x1c6)&&a86_0x86c9fd(Box,{'children':[a86_0x1621c4(Text,{'children':'*\x20Checking\x20login\x20status...'}),_0x7d9a24&&a86_0x1621c4(Text,{'color':_0x226724(0x1cc),'children':'\x20Checking...'})]}),_0x49642c===_0x226724(0x1ed)&&a86_0x86c9fd(a86_0x124c9f,{'children':[a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':'yellow','children':_0x226724(0x1ce)})}),a86_0x1621c4(Box,{'marginTop':0x1,'children':a86_0x1621c4(Text,{'children':_0x226724(0x1e4)})}),a86_0x86c9fd(Box,{'marginLeft':0x2,'children':[a86_0x86c9fd(Text,{'color':_0x56733b===0x0?_0x226724(0x1d2):_0x226724(0x1cc),'children':[_0x56733b===0x0?'▶\x20':'\x20\x20','Yes']}),a86_0x1621c4(Text,{'children':'\x20'}),a86_0x86c9fd(Text,{'color':_0x56733b===0x1?_0x226724(0x1d2):_0x226724(0x1cc),'children':[_0x56733b===0x1?'▶\x20':'\x20\x20','No']})]}),a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':_0x226724(0x1cc),'children':_0x226724(0x1cf)})})]}),_0x49642c===_0x226724(0x1b7)&&a86_0x86c9fd(Box,{'children':[a86_0x1621c4(Text,{'children':'*\x20Logging\x20in,\x20please\x20complete\x20in\x20browser...'}),_0x25f065&&a86_0x1621c4(Text,{'color':'gray','children':_0x226724(0x1c0)})]}),_0x49642c===_0x226724(0x1cb)&&a86_0x1621c4(Box,{'children':a86_0x1621c4(Text,{'color':_0x226724(0x1d2),'children':_0x226724(0x1ba)})})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c8030,_0x1722e6){const _0x3c30bc=a87_0x2943,_0x7ff320=_0x2c8030();while(!![]){try{const _0x206318=parseInt(_0x3c30bc(0x134))/0x1+parseInt(_0x3c30bc(0x132))/0x2*(-parseInt(_0x3c30bc(0x12a))/0x3)+-parseInt(_0x3c30bc(0x12c))/0x4*(-parseInt(_0x3c30bc(0x136))/0x5)+-parseInt(_0x3c30bc(0x135))/0x6+-parseInt(_0x3c30bc(0x131))/0x7*(parseInt(_0x3c30bc(0x12f))/0x8)+-parseInt(_0x3c30bc(0x130))/0x9*(parseInt(_0x3c30bc(0x133))/0xa)+parseInt(_0x3c30bc(0x12e))/0xb;if(_0x206318===_0x1722e6)break;else _0x7ff320['push'](_0x7ff320['shift']());}catch(_0x4ffa3b){_0x7ff320['push'](_0x7ff320['shift']());}}}(a87_0x2b7f,0x28534));function a87_0x2943(_0x54a731,_0x24ddc9){_0x54a731=_0x54a731-0x12a;const _0x2b7f76=a87_0x2b7f();let _0x2943cc=_0x2b7f76[_0x54a731];return _0x2943cc;}export function formatElapsed(_0x2274d8){const _0xae0b4=a87_0x2943,_0x5896b0=Date[_0xae0b4(0x12b)]()-_0x2274d8;if(_0x5896b0<0x3e8)return _0x5896b0+'ms';const _0x2b8c21=(_0x5896b0/0x3e8)[_0xae0b4(0x12d)](0x2),_0x1b4888=_0x2b8c21[_0xae0b4(0x137)](/\.?0+$/u,'');return _0x1b4888+'s';}function a87_0x2b7f(){const _0x39a97a=['432812zjrqrJ','toFixed','4860372drGyCh','766336lktdwE','377235nRtwgW','21EJkZHo','14ekkGXg','10lEKHIw','170306nMHVLc','633264nBKlph','10yXjDNA','replace','97953owIFea','now'];a87_0x2b7f=function(){return _0x39a97a;};return a87_0x2b7f();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13a17c,_0x5912de){const _0x79aff9=a87_0x3bb5,_0x219f8c=_0x13a17c();while(!![]){try{const _0x59b109=-parseInt(_0x79aff9(0xa0))/0x1*(-parseInt(_0x79aff9(0xba))/0x2)+-parseInt(_0x79aff9(0x8a))/0x3*(-parseInt(_0x79aff9(0xb8))/0x4)+parseInt(_0x79aff9(0x96))/0x5+parseInt(_0x79aff9(0xd9))/0x6*(-parseInt(_0x79aff9(0x9b))/0x7)+-parseInt(_0x79aff9(0x90))/0x8+-parseInt(_0x79aff9(0xac))/0x9*(-parseInt(_0x79aff9(0x9c))/0xa)+parseInt(_0x79aff9(0xcf))/0xb;if(_0x59b109===_0x5912de)break;else _0x219f8c['push'](_0x219f8c['shift']());}catch(_0x497c61){_0x219f8c['push'](_0x219f8c['shift']());}}}(a87_0x2fb4,0x2fd6b));import{jsx as a87_0x1ff642,Fragment as a87_0x4b3849,jsxs as a87_0x38b553}from'react/jsx-runtime';function a87_0x3bb5(_0x535d06,_0x498e0f){_0x535d06=_0x535d06-0x84;const _0x2fb411=a87_0x2fb4();let _0x3bb57a=_0x2fb411[_0x535d06];return _0x3bb57a;}import a87_0x209598 from'path';function a87_0x2fb4(){const _0x82ca45=['rmSync','error','description','Project\x20name\x20cannot\x20be\x20empty','env','Project\x20directory\x20','项目创建完成:\x20','test','existsSync','constants','stringify','8235vcZgqr','√\x20Pulled\x20','projectCode','green','API\x20configuration\x20pulled:\x20','version','\x20Generated\x20by\x20rabetbase\x20cli\x20','更新\x20package.json\x20失败','stableVersion','cwd','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','项目创建失败:\x20','29292gYKbTN','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','14228LRpbIq','!\x20API\x20configuration\x20pull\x20error,\x20project\x20created,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','doTask','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27rabetbase\x20config\x20set\x20appcode\x20<app-code>\x27','Start\x20project:','length','currentVersion','warn','trim','info','create','../..','cyan','accessSync','success','🚀\x20Next\x20Steps:','string','resolve','appCode','join','1208328vkMdqe','log','projectName','\x20|\x20AppCode:\x20','name','dirname','white','1.0.0','parse','\x20dataset(s),\x20generated\x20','12rifSIN','cookie','modelCount','Project\x20name:\x20','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','清理项目目录失败:\x20','\x20√\x20','production','1.\x20','readFileSync','setLogPath','column','./src/api/','repeat','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','3cWiLYa','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','rabetbase\x20api\x20pull','2.\x20','cd\x20','配置应用AppCode失败','942528BaorDG','√\x20package.json\x20updated:\x20name=','utf8','needsUpgrade','×\x20Project\x20creation\x20failed:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','634815RqzIUl','yellow','chdir','开始创建项目:\x20','message','394233mTymxO','1370OInouL','package.json','配置应用AppCode:\x20','then','8qDSvOy'];a87_0x2fb4=function(){return _0x82ca45;};return a87_0x2fb4();}import a87_0x118fc0 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}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{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x14be20){const _0x2a30e6=a87_0x3bb5,[_0x139dc0,_0x59418e]=useState(![]),[_0x4e1dee,_0x1ca472]=useState(![]),[_0x2f6b3a,_0x1d9b48]=useState(![]),[_0x276697,_0x55135a]=useState(null),_0x43f85f=useCopyProjectTemplate(),_0x3dfd19=useInstallDependencies(),_0x3d62dc=useFormatCode();useEffect(()=>{const _0xa7ab93=a87_0x3bb5;checkCliVersion()[_0xa7ab93(0x9f)](_0x554b10=>{const _0x4ac534=_0xa7ab93;_0x554b10[_0x4ac534(0x93)]&&(printCliUpgradeWarning(_0x554b10),logger['info'](_0x4ac534(0xc5),'CLI\x20版本检查',{'currentVersion':_0x554b10[_0x4ac534(0xc1)],'stableVersion':_0x554b10[_0x4ac534(0xb4)],'needsUpgrade':_0x554b10[_0x4ac534(0x93)]}));});},[]);const _0x1ac7e4=async _0x166a09=>{const _0x20b4ba=a87_0x3bb5;if(!_0x166a09[_0x20b4ba(0xd1)]||_0x166a09[_0x20b4ba(0xd1)][_0x20b4ba(0xc3)]()===''){console[_0x20b4ba(0xa2)](_0x20b4ba(0xa4));return;}const _0x329d51=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x329d51[_0x20b4ba(0xa8)](_0x166a09[_0x20b4ba(0xd1)])){console[_0x20b4ba(0xa2)](_0x20b4ba(0x89));return;}if(_0x166a09[_0x20b4ba(0xd1)][_0x20b4ba(0xc0)]>0x64){console[_0x20b4ba(0xa2)](_0x20b4ba(0xbd));return;}const _0x15df00=a87_0x209598[_0x20b4ba(0xcc)](process[_0x20b4ba(0xb5)](),_0x166a09[_0x20b4ba(0xd1)]);if(a87_0x118fc0['existsSync'](_0x15df00)){console[_0x20b4ba(0xa2)](_0x20b4ba(0xa6)+_0x166a09['projectName']+_0x20b4ba(0xb9));return;}try{const _0x3a6694=a87_0x209598[_0x20b4ba(0xd4)](_0x15df00);a87_0x118fc0[_0x20b4ba(0xc8)](_0x3a6694,a87_0x118fc0[_0x20b4ba(0xaa)]['W_OK']);}catch(_0x18b52b){console[_0x20b4ba(0xa2)]('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');return;}_0x55135a(_0x166a09),_0x59418e(!![]),logger[_0x20b4ba(0x85)](_0x15df00),logger['info']('create',_0x20b4ba(0x99)+_0x166a09[_0x20b4ba(0xd1)],{'projectDir':_0x15df00,'appCode':_0x166a09['appCode']});try{await _0x43f85f[_0x20b4ba(0xbc)](_0x166a09[_0x20b4ba(0xd1)]),await _0x6019ab(_0x166a09[_0x20b4ba(0xd1)]),await _0x3dfd19['doTask'](_0x166a09[_0x20b4ba(0xd1)]),await _0x3d62dc[_0x20b4ba(0xbc)](_0x166a09[_0x20b4ba(0xd1)]),await _0x45748b(_0x166a09[_0x20b4ba(0xd1)],_0x166a09[_0x20b4ba(0xcd)]||'',_0x166a09[_0x20b4ba(0xa5)]);if(_0x166a09[_0x20b4ba(0xcd)]){console[_0x20b4ba(0xd0)]('*\x20Pulling\x20API\x20configuration...');const _0x54b190=process[_0x20b4ba(0xb5)]();try{process[_0x20b4ba(0x98)](_0x15df00);const _0x3ee441=_0x166a09[_0x20b4ba(0xa5)]||_0x20b4ba(0xe0);initEnv(_0x3ee441);const {configArray:_0x1cc040}=await fetchModelList(_0x166a09[_0x20b4ba(0xcd)],_0x14be20[_0x20b4ba(0xda)]||''),_0x50d84c=_0x20b4ba(0x87),_0x210037=await generateApiFile(_0x1cc040,'',_0x166a09['appCode'],!![],_0x3ee441,_0x50d84c);console['log'](_0x20b4ba(0xad)+_0x1cc040[_0x20b4ba(0xc0)]+_0x20b4ba(0xd8)+_0x210037[_0x20b4ba(0xdb)]+'\x20model(s)'),logger[_0x20b4ba(0xc4)]('create',_0x20b4ba(0xb0)+_0x166a09[_0x20b4ba(0xcd)]),_0x1d9b48(!![]);}catch(_0x48ad64){console['log'](_0x20b4ba(0xbb)),logger[_0x20b4ba(0xc2)]('create','API\x20配置拉取异常',{'error':_0x48ad64 instanceof Error?_0x48ad64[_0x20b4ba(0x9a)]:String(_0x48ad64)});}finally{process['chdir'](_0x54b190);}}logger[_0x20b4ba(0xc9)](_0x20b4ba(0xc5),_0x20b4ba(0xa7)+_0x166a09[_0x20b4ba(0xd1)]),_0x1ca472(!![]),_0x59418e(![]);}catch(_0x5cfaa5){logger['error'](_0x20b4ba(0xc5),_0x20b4ba(0xb7)+_0x166a09[_0x20b4ba(0xd1)],{'error':_0x5cfaa5 instanceof Error?_0x5cfaa5[_0x20b4ba(0x9a)]:String(_0x5cfaa5)});try{a87_0x118fc0[_0x20b4ba(0xa9)](_0x15df00)&&(console[_0x20b4ba(0xd0)](_0x20b4ba(0x8b)+_0x15df00),a87_0x118fc0[_0x20b4ba(0xa1)](_0x15df00,{'recursive':!![],'force':!![]}));}catch(_0x1b1856){logger[_0x20b4ba(0xc2)](_0x20b4ba(0xc5),_0x20b4ba(0xde)+_0x15df00);}_0x59418e(![]),console[_0x20b4ba(0xa2)](_0x20b4ba(0x94)+(_0x5cfaa5 instanceof Error?_0x5cfaa5[_0x20b4ba(0x9a)]:String(_0x5cfaa5)));}},_0x5655e3=async _0xe132f1=>{await _0x1ac7e4({'projectName':_0xe132f1,'env':_0x14be20['env']});},_0x6019ab=async _0x449f52=>{const _0x5c2945=a87_0x3bb5,_0x2f9e33=a87_0x209598[_0x5c2945(0xcc)](process[_0x5c2945(0xb5)](),_0x449f52),_0x407833=a87_0x209598[_0x5c2945(0xce)](_0x2f9e33,_0x5c2945(0x9d));try{console[_0x5c2945(0xd0)](_0x5c2945(0x95));const _0x4adbb4=fileURLToPath(import.meta.url),_0x2fa01d=a87_0x209598[_0x5c2945(0xcc)](a87_0x209598[_0x5c2945(0xd4)](_0x4adbb4),'../..'),_0x21d644=a87_0x209598[_0x5c2945(0xce)](_0x2fa01d,_0x5c2945(0x9d));let _0x39a082='1.0.0';try{const _0x2012d2=JSON[_0x5c2945(0xd7)](a87_0x118fc0[_0x5c2945(0x84)](_0x21d644,_0x5c2945(0x92)));_0x39a082=_0x2012d2[_0x5c2945(0xb1)]||_0x5c2945(0xd6);}catch(_0x2cf30d){}const _0x1ca11f=a87_0x118fc0['readFileSync'](_0x407833,_0x5c2945(0x92)),_0x22b8bb=JSON['parse'](_0x1ca11f);_0x22b8bb[_0x5c2945(0xd3)]=_0x449f52,_0x22b8bb[_0x5c2945(0xa3)]=_0x449f52+_0x5c2945(0xb2)+_0x39a082,a87_0x118fc0['writeFileSync'](_0x407833,JSON[_0x5c2945(0xab)](_0x22b8bb,null,0x2)+'\x0a',_0x5c2945(0x92)),console[_0x5c2945(0xd0)](_0x5c2945(0x91)+_0x449f52),logger['info']('create','更新\x20package.json\x20name');}catch(_0x389b01){logger[_0x5c2945(0xa2)](_0x5c2945(0xc5),_0x5c2945(0xb3));throw _0x389b01;}},_0x45748b=async(_0x5d9c71,_0x5045f2,_0x41ed87)=>{const _0x1efd43=a87_0x3bb5,_0x3f09f2=a87_0x209598[_0x1efd43(0xcc)](process['cwd'](),_0x5d9c71),_0x2c5987=a87_0x209598[_0x1efd43(0xce)](_0x3f09f2,NEW_CONFIG_NAME);try{_0x5045f2?console[_0x1efd43(0xd0)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x5d9c71+':\x20'+_0x5045f2):console['log'](_0x1efd43(0xb6)+_0x5d9c71);const _0x2276b9=fileURLToPath(import.meta.url),_0xb95d92=a87_0x209598[_0x1efd43(0xcc)](a87_0x209598[_0x1efd43(0xd4)](_0x2276b9),_0x1efd43(0xc6)),_0x305dd1=a87_0x209598[_0x1efd43(0xce)](_0xb95d92,'package.json');let _0x3f842a='1.0.0';try{const _0x217532=JSON[_0x1efd43(0xd7)](a87_0x118fc0[_0x1efd43(0x84)](_0x305dd1,_0x1efd43(0x92)));_0x3f842a=_0x217532[_0x1efd43(0xb1)]||_0x1efd43(0xd6);}catch{}const _0x9bbbdb=readConfig(),_0x5a470c=typeof _0x9bbbdb['env']===_0x1efd43(0xcb)?_0x9bbbdb[_0x1efd43(0xa5)]:undefined,{app:_0x5190a1,appcode:_0x48f9db,..._0x269b44}=_0x9bbbdb,_0x65a638={..._0x269b44,'appcode':_0x5045f2||'','env':_0x41ed87||_0x5a470c||'production','createdAt':new Date()['toLocaleString'](),'version':_0x3f842a};writeConfigFile(_0x2c5987,_0x65a638),_0x5045f2?console['log'](_0x1efd43(0xdd)+_0x5045f2):console[_0x1efd43(0xd0)](_0x1efd43(0xbe)),logger[_0x1efd43(0xc4)](_0x1efd43(0xc5),_0x1efd43(0x9e)+_0x5045f2);}catch(_0x2472ab){logger[_0x1efd43(0xa2)]('create',_0x1efd43(0x8f));}};useEffect(()=>{const _0x38ad15=a87_0x3bb5;_0x14be20[_0x38ad15(0xae)]&&_0x5655e3(_0x14be20[_0x38ad15(0xae)]);},[_0x14be20['projectCode']]);if(!_0x139dc0&&!_0x4e1dee&&!_0x14be20['projectCode'])return a87_0x1ff642(EnhancedGuidedCreate,{'onCreate':_0x1ac7e4,'env':_0x14be20[_0x2a30e6(0xa5)]});if(_0x139dc0)return a87_0x38b553(a87_0x4b3849,{'children':[a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Box,{'width':'1'}),a87_0x1ff642(Text,{'color':'green','children':_0x2a30e6(0xdf)}),a87_0x1ff642(Text,{'children':_0x2a30e6(0xdc)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':_0x276697?.['projectName']}),_0x276697?.[_0x2a30e6(0xcd)]&&a87_0x38b553(a87_0x4b3849,{'children':[a87_0x1ff642(Text,{'children':_0x2a30e6(0xd2)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'children':_0x276697['appCode']})]})]}),a87_0x1ff642(TaskRunning,{..._0x43f85f}),a87_0x1ff642(TaskRunning,{..._0x3dfd19}),a87_0x1ff642(TaskRunning,{..._0x3d62dc})]});if(_0x4e1dee)return a87_0x38b553(a87_0x4b3849,{'children':[a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Box,{'width':'1'}),a87_0x1ff642(Text,{'color':'green','children':'\x20√\x20'}),a87_0x1ff642(Text,{'children':_0x2a30e6(0xdc)}),a87_0x1ff642(Text,{'color':'green','children':_0x276697?.['projectName']}),_0x276697?.[_0x2a30e6(0xcd)]&&a87_0x38b553(a87_0x4b3849,{'children':[a87_0x1ff642(Text,{'children':_0x2a30e6(0xd2)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'children':_0x276697['appCode']})]})]}),a87_0x1ff642(TaskFinished,{..._0x43f85f}),a87_0x1ff642(TaskFinished,{..._0x3dfd19}),a87_0x1ff642(TaskFinished,{..._0x3d62dc}),a87_0x1ff642(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a87_0x1ff642(Text,{'color':'green','children':'─'[_0x2a30e6(0x88)](0x3c)})}),a87_0x1ff642(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a87_0x1ff642(Text,{'color':'cyan','bold':!![],'children':_0x2a30e6(0xca)})}),a87_0x38b553(Box,{'marginLeft':0x2,'flexDirection':_0x2a30e6(0x86),'children':[a87_0x38b553(Box,{'children':[a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':_0x2a30e6(0xe1)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xd5),'children':_0x2a30e6(0xbf)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'bold':!![],'children':_0x2a30e6(0x8e)+_0x276697?.[_0x2a30e6(0xd1)]+'\x20&&\x20rabetbase\x20run\x20start'})]}),_0x276697?.[_0x2a30e6(0xcd)]&&!_0x2f6b3a&&a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Text,{'color':_0x2a30e6(0x97),'children':_0x2a30e6(0x8d)}),a87_0x1ff642(Text,{'color':'white','children':'Pull\x20API\x20configuration:'}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'bold':!![],'children':_0x2a30e6(0x8c)})]})]}),a87_0x1ff642(Box,{'marginTop':0x1,'children':a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':'─'['repeat'](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x12f882,_0x39f741){const _0x4b9a55=a88_0x3af4,_0x2f5d05=_0x12f882();while(!![]){try{const _0x106f14=-parseInt(_0x4b9a55(0x1fb))/0x1*(-parseInt(_0x4b9a55(0x1fd))/0x2)+parseInt(_0x4b9a55(0x1e0))/0x3*(parseInt(_0x4b9a55(0x1bd))/0x4)+parseInt(_0x4b9a55(0x1bc))/0x5*(-parseInt(_0x4b9a55(0x1de))/0x6)+-parseInt(_0x4b9a55(0x1f9))/0x7*(-parseInt(_0x4b9a55(0x1c1))/0x8)+parseInt(_0x4b9a55(0x1ea))/0x9+parseInt(_0x4b9a55(0x1ba))/0xa+-parseInt(_0x4b9a55(0x1f1))/0xb;if(_0x106f14===_0x39f741)break;else _0x2f5d05['push'](_0x2f5d05['shift']());}catch(_0x4c3a87){_0x2f5d05['push'](_0x2f5d05['shift']());}}}(a88_0xbf97,0x7ea6b));function a88_0xbf97(){const _0xdf83a7=['writeFileSync','doTask','Pull\x20API\x20configuration:','warn','项目创建完成:\x20','52524DdRybR','stringify','38799IBHVrF','setLogPath','chdir','cd\x20','error','message','1.0.0','yellow','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','更新\x20package.json\x20失败','6845418CdnZXv','Project\x20directory\x20','2.\x20','dirname','开始创建项目:\x20','create','name','20478920YjgkDD','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','√\x20package.json\x20updated:\x20name=','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27rabetbase\x20config\x20set\x20appcode\x20<app-code>\x27','resolve','green','cyan','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','7NuOCkY','env','2hMshzP','modelCount','994458viqPcR','package.json','stableVersion','更新\x20package.json\x20name','cookie','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','then','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','test','cwd','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','success','version','../..','join','projectCode','配置应用AppCode失败','needsUpgrade','CLI\x20版本检查','log','Project\x20name:\x20','4424890zCqwtn','API\x20configuration\x20pulled:\x20','135HnJovr','124mQxSFh','white','\x20&&\x20rabetbase\x20run\x20start','\x20model(s)','146952ZcoIbS','production','parse','repeat','\x20|\x20AppCode:\x20','string','Project\x20name\x20cannot\x20be\x20empty','readFileSync','existsSync','*\x20Pulling\x20API\x20configuration...','description','projectName','toLocaleString','currentVersion','length','utf8','!\x20API\x20configuration\x20pull\x20error,\x20project\x20created,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','rabetbase\x20api\x20pull','info','\x20√\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','清理项目目录失败:\x20','W_OK','appCode'];a88_0xbf97=function(){return _0xdf83a7;};return a88_0xbf97();}import{jsx as a88_0x4a067b,Fragment as a88_0x1e7cc3,jsxs as a88_0x12a007}from'react/jsx-runtime';import a88_0x13fa78 from'path';import a88_0x595ba7 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}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';function a88_0x3af4(_0xf368e0,_0x26ca16){_0xf368e0=_0xf368e0-0x1ac;const _0xbf97a7=a88_0xbf97();let _0x3af462=_0xbf97a7[_0xf368e0];return _0x3af462;}import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x16ad69){const _0x2a4443=a88_0x3af4,[_0x2e19c2,_0x592a49]=useState(![]),[_0x1c1e68,_0xf7aa87]=useState(![]),[_0x385170,_0x45dea2]=useState(![]),[_0x14911a,_0x608363]=useState(null),_0x76546=useCopyProjectTemplate(),_0xf3e4ce=useInstallDependencies(),_0xdd3f7d=useFormatCode();useEffect(()=>{const _0x18c918=a88_0x3af4;checkCliVersion()[_0x18c918(0x203)](_0x4b5ef1=>{const _0x2a4b0f=_0x18c918;_0x4b5ef1[_0x2a4b0f(0x1b6)]&&(printCliUpgradeWarning(_0x4b5ef1),logger[_0x2a4b0f(0x1d3)]('create',_0x2a4b0f(0x1b7),{'currentVersion':_0x4b5ef1[_0x2a4b0f(0x1ce)],'stableVersion':_0x4b5ef1[_0x2a4b0f(0x1ff)],'needsUpgrade':_0x4b5ef1[_0x2a4b0f(0x1b6)]}));});},[]);const _0x5c427a=async _0x4c15df=>{const _0x56ad3b=a88_0x3af4;if(!_0x4c15df[_0x56ad3b(0x1cc)]||_0x4c15df[_0x56ad3b(0x1cc)]['trim']()===''){console[_0x56ad3b(0x1e4)](_0x56ad3b(0x1c7));return;}const _0x2c76fb=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2c76fb[_0x56ad3b(0x1ad)](_0x4c15df[_0x56ad3b(0x1cc)])){console['error'](_0x56ad3b(0x1ac));return;}if(_0x4c15df[_0x56ad3b(0x1cc)]['length']>0x64){console['error'](_0x56ad3b(0x1d5));return;}const _0x2bc0ac=a88_0x13fa78[_0x56ad3b(0x1f5)](process['cwd'](),_0x4c15df[_0x56ad3b(0x1cc)]);if(a88_0x595ba7[_0x56ad3b(0x1c9)](_0x2bc0ac)){console[_0x56ad3b(0x1e4)](_0x56ad3b(0x1eb)+_0x4c15df[_0x56ad3b(0x1cc)]+_0x56ad3b(0x1f2));return;}try{const _0x21ef25=a88_0x13fa78[_0x56ad3b(0x1ed)](_0x2bc0ac);a88_0x595ba7['accessSync'](_0x21ef25,a88_0x595ba7['constants'][_0x56ad3b(0x1d7)]);}catch(_0x488425){console[_0x56ad3b(0x1e4)](_0x56ad3b(0x1f8));return;}_0x608363(_0x4c15df),_0x592a49(!![]),logger[_0x56ad3b(0x1e1)](_0x2bc0ac),logger['info']('create',_0x56ad3b(0x1ee)+_0x4c15df[_0x56ad3b(0x1cc)],{'projectDir':_0x2bc0ac,'appCode':_0x4c15df[_0x56ad3b(0x1d8)]});try{await _0x76546['doTask'](_0x4c15df['projectName']),await _0x146f06(_0x4c15df['projectName']),await _0xf3e4ce[_0x56ad3b(0x1da)](_0x4c15df[_0x56ad3b(0x1cc)]),await _0xdd3f7d[_0x56ad3b(0x1da)](_0x4c15df[_0x56ad3b(0x1cc)]),await _0x550980(_0x4c15df[_0x56ad3b(0x1cc)],_0x4c15df[_0x56ad3b(0x1d8)]||'',_0x4c15df['env']);if(_0x4c15df['appCode']){console[_0x56ad3b(0x1b8)](_0x56ad3b(0x1ca));const _0x13fcd0=process['cwd']();try{process['chdir'](_0x2bc0ac);const _0x9a1f01=_0x4c15df['env']||_0x56ad3b(0x1c2);initEnv(_0x9a1f01);const {configArray:_0x2010b9}=await fetchModelList(_0x4c15df['appCode'],_0x16ad69[_0x56ad3b(0x201)]||''),_0x183fb2='./src/api/',_0x46090c=await generateApiFile(_0x2010b9,'',_0x4c15df[_0x56ad3b(0x1d8)],!![],_0x9a1f01,_0x183fb2);console[_0x56ad3b(0x1b8)]('√\x20Pulled\x20'+_0x2010b9[_0x56ad3b(0x1cf)]+'\x20dataset(s),\x20generated\x20'+_0x46090c[_0x56ad3b(0x1fc)]+_0x56ad3b(0x1c0)),logger[_0x56ad3b(0x1d3)](_0x56ad3b(0x1ef),_0x56ad3b(0x1bb)+_0x4c15df[_0x56ad3b(0x1d8)]),_0x45dea2(!![]);}catch(_0x4ce55d){console[_0x56ad3b(0x1b8)](_0x56ad3b(0x1d1)),logger[_0x56ad3b(0x1dc)](_0x56ad3b(0x1ef),'API\x20配置拉取异常',{'error':_0x4ce55d instanceof Error?_0x4ce55d[_0x56ad3b(0x1e5)]:String(_0x4ce55d)});}finally{process[_0x56ad3b(0x1e2)](_0x13fcd0);}}logger[_0x56ad3b(0x1b0)](_0x56ad3b(0x1ef),_0x56ad3b(0x1dd)+_0x4c15df[_0x56ad3b(0x1cc)]),_0xf7aa87(!![]),_0x592a49(![]);}catch(_0x21eaff){logger[_0x56ad3b(0x1e4)](_0x56ad3b(0x1ef),'项目创建失败:\x20'+_0x4c15df[_0x56ad3b(0x1cc)],{'error':_0x21eaff instanceof Error?_0x21eaff['message']:String(_0x21eaff)});try{a88_0x595ba7[_0x56ad3b(0x1c9)](_0x2bc0ac)&&(console[_0x56ad3b(0x1b8)](_0x56ad3b(0x1e8)+_0x2bc0ac),a88_0x595ba7['rmSync'](_0x2bc0ac,{'recursive':!![],'force':!![]}));}catch(_0x425aac){logger[_0x56ad3b(0x1dc)](_0x56ad3b(0x1ef),_0x56ad3b(0x1d6)+_0x2bc0ac);}_0x592a49(![]),console[_0x56ad3b(0x1e4)]('×\x20Project\x20creation\x20failed:\x20'+(_0x21eaff instanceof Error?_0x21eaff[_0x56ad3b(0x1e5)]:String(_0x21eaff)));}},_0x4a72ac=async _0xf03044=>{const _0x2a4e54=a88_0x3af4;await _0x5c427a({'projectName':_0xf03044,'env':_0x16ad69[_0x2a4e54(0x1fa)]});},_0x146f06=async _0x3d376a=>{const _0x49a4a4=a88_0x3af4,_0x32179a=a88_0x13fa78[_0x49a4a4(0x1f5)](process[_0x49a4a4(0x1ae)](),_0x3d376a),_0x7808f5=a88_0x13fa78[_0x49a4a4(0x1b3)](_0x32179a,_0x49a4a4(0x1fe));try{console[_0x49a4a4(0x1b8)](_0x49a4a4(0x202));const _0x522ee3=fileURLToPath(import.meta.url),_0x3e9a54=a88_0x13fa78['resolve'](a88_0x13fa78['dirname'](_0x522ee3),'../..'),_0xc1471d=a88_0x13fa78['join'](_0x3e9a54,_0x49a4a4(0x1fe));let _0x66befe='1.0.0';try{const _0x2ce2c7=JSON[_0x49a4a4(0x1c3)](a88_0x595ba7[_0x49a4a4(0x1c8)](_0xc1471d,'utf8'));_0x66befe=_0x2ce2c7[_0x49a4a4(0x1b1)]||_0x49a4a4(0x1e6);}catch(_0x5d0a73){}const _0x2e05db=a88_0x595ba7[_0x49a4a4(0x1c8)](_0x7808f5,_0x49a4a4(0x1d0)),_0x139061=JSON[_0x49a4a4(0x1c3)](_0x2e05db);_0x139061[_0x49a4a4(0x1f0)]=_0x3d376a,_0x139061[_0x49a4a4(0x1cb)]=_0x3d376a+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x66befe,a88_0x595ba7[_0x49a4a4(0x1d9)](_0x7808f5,JSON[_0x49a4a4(0x1df)](_0x139061,null,0x2)+'\x0a',_0x49a4a4(0x1d0)),console[_0x49a4a4(0x1b8)](_0x49a4a4(0x1f3)+_0x3d376a),logger[_0x49a4a4(0x1d3)](_0x49a4a4(0x1ef),_0x49a4a4(0x200));}catch(_0x5675e1){logger['error']('create',_0x49a4a4(0x1e9));throw _0x5675e1;}},_0x550980=async(_0x2032fe,_0x3ed5ec,_0x4e9bfb)=>{const _0x2d6aa9=a88_0x3af4,_0x35477e=a88_0x13fa78[_0x2d6aa9(0x1f5)](process[_0x2d6aa9(0x1ae)](),_0x2032fe),_0x4c1ecb=a88_0x13fa78[_0x2d6aa9(0x1b3)](_0x35477e,NEW_CONFIG_NAME);try{_0x3ed5ec?console[_0x2d6aa9(0x1b8)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x2032fe+':\x20'+_0x3ed5ec):console[_0x2d6aa9(0x1b8)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x2032fe);const _0x31329e=fileURLToPath(import.meta.url),_0x2a2bfd=a88_0x13fa78['resolve'](a88_0x13fa78[_0x2d6aa9(0x1ed)](_0x31329e),_0x2d6aa9(0x1b2)),_0x2bb504=a88_0x13fa78[_0x2d6aa9(0x1b3)](_0x2a2bfd,_0x2d6aa9(0x1fe));let _0x44e485=_0x2d6aa9(0x1e6);try{const _0x5e3e0c=JSON[_0x2d6aa9(0x1c3)](a88_0x595ba7[_0x2d6aa9(0x1c8)](_0x2bb504,_0x2d6aa9(0x1d0)));_0x44e485=_0x5e3e0c[_0x2d6aa9(0x1b1)]||_0x2d6aa9(0x1e6);}catch{}const _0x26b9b3=readConfig(),_0x475094=typeof _0x26b9b3[_0x2d6aa9(0x1fa)]===_0x2d6aa9(0x1c6)?_0x26b9b3[_0x2d6aa9(0x1fa)]:undefined,{app:_0x490307,appcode:_0x1578bd,..._0x4d4ae8}=_0x26b9b3,_0x2d6fcc={..._0x4d4ae8,'appcode':_0x3ed5ec||'','env':_0x4e9bfb||_0x475094||_0x2d6aa9(0x1c2),'createdAt':new Date()[_0x2d6aa9(0x1cd)](),'version':_0x44e485};writeConfigFile(_0x4c1ecb,_0x2d6fcc),_0x3ed5ec?console[_0x2d6aa9(0x1b8)](_0x2d6aa9(0x1af)+_0x3ed5ec):console[_0x2d6aa9(0x1b8)](_0x2d6aa9(0x1f4)),logger[_0x2d6aa9(0x1d3)](_0x2d6aa9(0x1ef),'配置应用AppCode:\x20'+_0x3ed5ec);}catch(_0x35582e){logger[_0x2d6aa9(0x1e4)](_0x2d6aa9(0x1ef),_0x2d6aa9(0x1b5));}};useEffect(()=>{const _0x19fc15=a88_0x3af4;_0x16ad69[_0x19fc15(0x1b4)]&&_0x4a72ac(_0x16ad69['projectCode']);},[_0x16ad69[_0x2a4443(0x1b4)]]);if(!_0x2e19c2&&!_0x1c1e68&&!_0x16ad69[_0x2a4443(0x1b4)])return a88_0x4a067b(EnhancedGuidedCreate,{'onCreate':_0x5c427a,'env':_0x16ad69[_0x2a4443(0x1fa)]});if(_0x2e19c2)return a88_0x12a007(a88_0x1e7cc3,{'children':[a88_0x12a007(Box,{'marginTop':0x1,'children':[a88_0x4a067b(Box,{'width':'1'}),a88_0x4a067b(Text,{'color':'green','children':_0x2a4443(0x1d4)}),a88_0x4a067b(Text,{'children':_0x2a4443(0x1b9)}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f6),'children':_0x14911a?.[_0x2a4443(0x1cc)]}),_0x14911a?.[_0x2a4443(0x1d8)]&&a88_0x12a007(a88_0x1e7cc3,{'children':[a88_0x4a067b(Text,{'children':'\x20|\x20AppCode:\x20'}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f7),'children':_0x14911a[_0x2a4443(0x1d8)]})]})]}),a88_0x4a067b(TaskRunning,{..._0x76546}),a88_0x4a067b(TaskRunning,{..._0xf3e4ce}),a88_0x4a067b(TaskRunning,{..._0xdd3f7d})]});if(_0x1c1e68)return a88_0x12a007(a88_0x1e7cc3,{'children':[a88_0x12a007(Box,{'marginTop':0x1,'children':[a88_0x4a067b(Box,{'width':'1'}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f6),'children':_0x2a4443(0x1d4)}),a88_0x4a067b(Text,{'children':_0x2a4443(0x1b9)}),a88_0x4a067b(Text,{'color':'green','children':_0x14911a?.['projectName']}),_0x14911a?.['appCode']&&a88_0x12a007(a88_0x1e7cc3,{'children':[a88_0x4a067b(Text,{'children':_0x2a4443(0x1c5)}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f7),'children':_0x14911a['appCode']})]})]}),a88_0x4a067b(TaskFinished,{..._0x76546}),a88_0x4a067b(TaskFinished,{..._0xf3e4ce}),a88_0x4a067b(TaskFinished,{..._0xdd3f7d}),a88_0x4a067b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a88_0x4a067b(Text,{'color':_0x2a4443(0x1f6),'children':'─'[_0x2a4443(0x1c4)](0x3c)})}),a88_0x4a067b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a88_0x4a067b(Text,{'color':_0x2a4443(0x1f7),'bold':!![],'children':'🚀\x20Next\x20Steps:'})}),a88_0x12a007(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a88_0x12a007(Box,{'children':[a88_0x4a067b(Text,{'color':_0x2a4443(0x1f6),'children':'1.\x20'}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1be),'children':'Start\x20project:'}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f7),'bold':!![],'children':_0x2a4443(0x1e3)+_0x14911a?.[_0x2a4443(0x1cc)]+_0x2a4443(0x1bf)})]}),_0x14911a?.[_0x2a4443(0x1d8)]&&!_0x385170&&a88_0x12a007(Box,{'marginTop':0x1,'children':[a88_0x4a067b(Text,{'color':_0x2a4443(0x1e7),'children':_0x2a4443(0x1ec)}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1be),'children':_0x2a4443(0x1db)}),a88_0x4a067b(Text,{'color':_0x2a4443(0x1f7),'bold':!![],'children':_0x2a4443(0x1d2)})]})]}),a88_0x4a067b(Box,{'marginTop':0x1,'children':a88_0x4a067b(Text,{'color':_0x2a4443(0x1f6),'children':'─'['repeat'](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58639f,_0x4cbf84){const _0x5a7b95=a89_0x3abe,_0x2bd095=_0x58639f();while(!![]){try{const _0x45db4d=-parseInt(_0x5a7b95(0x1ca))/0x1*(-parseInt(_0x5a7b95(0x1eb))/0x2)+-parseInt(_0x5a7b95(0x1c6))/0x3+parseInt(_0x5a7b95(0x1cf))/0x4+parseInt(_0x5a7b95(0x1c1))/0x5+parseInt(_0x5a7b95(0x1d5))/0x6*(-parseInt(_0x5a7b95(0x1db))/0x7)+parseInt(_0x5a7b95(0x1e1))/0x8*(-parseInt(_0x5a7b95(0x1d6))/0x9)+-parseInt(_0x5a7b95(0x1e3))/0xa*(-parseInt(_0x5a7b95(0x1d0))/0xb);if(_0x45db4d===_0x4cbf84)break;else _0x2bd095['push'](_0x2bd095['shift']());}catch(_0x16a43e){_0x2bd095['push'](_0x2bd095['shift']());}}}(a89_0x411a,0x3fa7a));import a89_0x64c3f0 from'path';import{fileURLToPath}from'url';function a89_0x3abe(_0x4b55db,_0x15084d){_0x4b55db=_0x4b55db-0x1b8;const _0x411add=a89_0x411a();let _0x3abe31=_0x411add[_0x4b55db];return _0x3abe31;}import a89_0x4e439 from'fs/promises';import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';import{exec}from'child_process';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a89_0x411a(){const _0x1bb820=['192688MHWVlO','1408iJblUv','bun\x20--version','error','...','Project\x20name\x20cannot\x20be\x20empty','922776bgGfJv','18TmZsOm','Project\x20directory\x20','\x20created\x20successfully!','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','join','14KkktCD','description','\x0a√\x20Project\x20','\x20\x20rabetbase\x20run\x20start\x0a','dirname','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','1580848uCDKvr','\x20\x20√\x20package.json\x20updated','29570QXgDdA','env','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','needsUpgrade','resolve','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','log','parse','2bdbBxF','bun','\x20\x20√\x20Project\x20template\x20created','rabetbase.config.json','length','cwd','bun\x20run\x20format','依赖安装失败:\x20','\x20\x20√\x20Environment\x20configured','×\x20Project\x20creation\x20failed:\x20','1599105MzKmjf','utf-8','trim','\x20\x20Installing\x20dependencies...','writeFile','612459UXWiwV','message','*\x20Creating\x20project\x20','stringify','421198HQLfYc','W_OK','access','exit','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions'];a89_0x411a=function(){return _0x1bb820;};return a89_0x411a();}const execAsync=promisify(exec);function getTemplateDir(){const _0x3e428b=a89_0x3abe,_0xa557d6=fileURLToPath(import.meta.url),_0x18149b=a89_0x64c3f0[_0x3e428b(0x1df)](_0xa557d6);return a89_0x64c3f0['resolve'](_0x18149b,'../../templates/projects/sub-app-react-demo');}export async function createProjectNonInteractive(_0x35cc38,_0x87eab1){const _0x1e1401=a89_0x3abe,_0x1ea793=await checkCliVersion();_0x1ea793[_0x1e1401(0x1e6)]&&printCliUpgradeWarning(_0x1ea793);(!_0x35cc38||_0x35cc38[_0x1e1401(0x1c3)]()==='')&&(console[_0x1e1401(0x1d2)](_0x1e1401(0x1d4)),process[_0x1e1401(0x1cd)](0x1));const _0x16022b=/[<>:"|?*\x00-\x1f\x7f]/;_0x16022b['test'](_0x35cc38)&&(console['error'](_0x1e1401(0x1e8)),process['exit'](0x1));_0x35cc38[_0x1e1401(0x1bb)]>0x64&&(console[_0x1e1401(0x1d2)](_0x1e1401(0x1e0)),process['exit'](0x1));const _0x12be7b=a89_0x64c3f0[_0x1e1401(0x1e7)](process[_0x1e1401(0x1bc)](),_0x35cc38);existsSync(_0x12be7b)&&(console['error'](_0x1e1401(0x1d7)+_0x35cc38+_0x1e1401(0x1d9)),process[_0x1e1401(0x1cd)](0x1));try{const _0x30a03c=a89_0x64c3f0[_0x1e1401(0x1df)](_0x12be7b);await a89_0x4e439[_0x1e1401(0x1cc)](_0x30a03c,a89_0x4e439['constants'][_0x1e1401(0x1cb)]);}catch(_0x3cd8e9){console[_0x1e1401(0x1d2)](_0x1e1401(0x1ce)),process['exit'](0x1);}try{console[_0x1e1401(0x1e9)](_0x1e1401(0x1c8)+_0x35cc38+_0x1e1401(0x1d3));const _0x27dcd7=getTemplateDir();await copyDirectory(_0x27dcd7,_0x12be7b),console['log'](_0x1e1401(0x1b9)),await updatePackageJsonName(_0x35cc38),console['log'](_0x1e1401(0x1e2)),console[_0x1e1401(0x1e9)](_0x1e1401(0x1c4)),console['log']('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x12be7b),console[_0x1e1401(0x1e9)]('\x20\x20√\x20Code\x20formatted'),await configureAppEnv(_0x35cc38,_0x87eab1),console['log'](_0x1e1401(0x1bf)),console[_0x1e1401(0x1e9)](_0x1e1401(0x1dd)+_0x35cc38+_0x1e1401(0x1d8)),console['log']('\x0a\x20\x20cd\x20'+_0x35cc38),console['log'](_0x1e1401(0x1de));}catch(_0x47ac70){const _0x4ebb9d=_0x47ac70 instanceof Error?_0x47ac70[_0x1e1401(0x1c7)]:String(_0x47ac70);try{existsSync(_0x12be7b)&&await a89_0x4e439['rm'](_0x12be7b,{'recursive':!![],'force':!![]});}catch{}console[_0x1e1401(0x1d2)](_0x1e1401(0x1c0)+_0x4ebb9d),process[_0x1e1401(0x1cd)](0x1);}}async function updatePackageJsonName(_0x546a66){const _0x4cd42f=a89_0x3abe,_0x93ff07=a89_0x64c3f0[_0x4cd42f(0x1e7)](process[_0x4cd42f(0x1bc)](),_0x546a66),_0x377d9e=a89_0x64c3f0[_0x4cd42f(0x1da)](_0x93ff07,'package.json'),_0x57e069=await a89_0x4e439['readFile'](_0x377d9e,_0x4cd42f(0x1c2)),_0x4bfdcc=JSON['parse'](_0x57e069);_0x4bfdcc['name']=_0x546a66,_0x4bfdcc[_0x4cd42f(0x1dc)]=_0x4cd42f(0x1e5),await a89_0x4e439[_0x4cd42f(0x1c5)](_0x377d9e,JSON[_0x4cd42f(0x1c9)](_0x4bfdcc,null,0x2)+'\x0a');}async function installDependencies(_0x2f3e18){const _0x1f9435=a89_0x3abe,_0x12169a=detectPackageManager(),_0x2ca8f1=_0x12169a+'\x20install';try{await execAsync(_0x2ca8f1,{'cwd':_0x2f3e18});}catch(_0x2b17d4){throw new Error(_0x1f9435(0x1be)+_0x2b17d4);}}function detectPackageManager(){const _0x4f2406=a89_0x3abe;try{return execAsync(_0x4f2406(0x1d1),{}),_0x4f2406(0x1b8);}catch{return'npm';}}async function formatCode(_0x460098){const _0x2e48=a89_0x3abe;try{await execAsync(_0x2e48(0x1bd),{'cwd':_0x460098});}catch{}}async function configureAppEnv(_0x4e9557,_0x25e4ae){const _0x22d582=a89_0x3abe,_0x4c4194=a89_0x64c3f0[_0x22d582(0x1e7)](process['cwd'](),_0x4e9557),_0x309939=a89_0x64c3f0[_0x22d582(0x1da)](_0x4c4194,_0x22d582(0x1ba));let _0x34cf48={};if(existsSync(_0x309939)){const _0x5ce68e=await a89_0x4e439['readFile'](_0x309939,_0x22d582(0x1c2));_0x34cf48=JSON[_0x22d582(0x1ea)](_0x5ce68e);}_0x25e4ae&&(_0x34cf48[_0x22d582(0x1e4)]=_0x25e4ae),await a89_0x4e439[_0x22d582(0x1c5)](_0x309939,JSON[_0x22d582(0x1c9)](_0x34cf48,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56b92d,_0x1be58c){var _0x5c1e25=a90_0x33c5,_0x1061fb=_0x56b92d();while(!![]){try{var _0x1e4d12=-parseInt(_0x5c1e25(0x1f8))/0x1*(parseInt(_0x5c1e25(0x1f3))/0x2)+parseInt(_0x5c1e25(0x1f5))/0x3*(parseInt(_0x5c1e25(0x1f0))/0x4)+-parseInt(_0x5c1e25(0x1f2))/0x5*(-parseInt(_0x5c1e25(0x1f9))/0x6)+-parseInt(_0x5c1e25(0x1fc))/0x7*(parseInt(_0x5c1e25(0x1fb))/0x8)+-parseInt(_0x5c1e25(0x1f7))/0x9*(-parseInt(_0x5c1e25(0x1ee))/0xa)+parseInt(_0x5c1e25(0x1f4))/0xb+-parseInt(_0x5c1e25(0x1f6))/0xc;if(_0x1e4d12===_0x1be58c)break;else _0x1061fb['push'](_0x1061fb['shift']());}catch(_0x5d2721){_0x1061fb['push'](_0x1061fb['shift']());}}}(a90_0x24a1,0x1ec92));import{jsx as a90_0x406777,jsxs as a90_0x118950}from'react/jsx-runtime';function a90_0x24a1(){var _0x1ae779=['\x20√\x20','39210YEdsDe','green','292wKAFji','elapsed','29810vbmPMQ','2lqaagT','1688863mhMhYi','4791uvxdDf','1604640eSFkzF','234LaAKZZ','137524YhTnKJ','180iWaMuE','taskName','136KZZtGj','63238IMMewU'];a90_0x24a1=function(){return _0x1ae779;};return a90_0x24a1();}import{Box,Text}from'ink';function a90_0x33c5(_0x793ef5,_0x5b9af5){_0x793ef5=_0x793ef5-0x1ee;var _0x24a12c=a90_0x24a1();var _0x33c595=_0x24a12c[_0x793ef5];return _0x33c595;}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x351087){var _0x1ed1f5=a90_0x33c5;return a90_0x118950(Box,{'children':[a90_0x406777(Box,{'width':'1'}),a90_0x406777(Text,{'color':_0x1ed1f5(0x1ef),'children':_0x1ed1f5(0x1fd)}),a90_0x406777(Text,{'children':_0x351087[_0x1ed1f5(0x1fa)]}),a90_0x406777(TaskTime,{'elapsed':_0x351087[_0x1ed1f5(0x1f1)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d7528,_0x2c2763){var _0xb9858d=a91_0xc0a9,_0x4e94d7=_0x2d7528();while(!![]){try{var _0x4f52a7=parseInt(_0xb9858d(0x1e5))/0x1*(parseInt(_0xb9858d(0x1ea))/0x2)+-parseInt(_0xb9858d(0x1df))/0x3+parseInt(_0xb9858d(0x1e3))/0x4+-parseInt(_0xb9858d(0x1e9))/0x5+parseInt(_0xb9858d(0x1e0))/0x6*(parseInt(_0xb9858d(0x1e4))/0x7)+-parseInt(_0xb9858d(0x1e2))/0x8*(parseInt(_0xb9858d(0x1e8))/0x9)+-parseInt(_0xb9858d(0x1e7))/0xa;if(_0x4f52a7===_0x2c2763)break;else _0x4e94d7['push'](_0x4e94d7['shift']());}catch(_0x5042de){_0x4e94d7['push'](_0x4e94d7['shift']());}}}(a91_0x1a6a,0xaefa4));import{jsx as a91_0xc6a401,jsxs as a91_0x262b9b}from'react/jsx-runtime';function a91_0x1a6a(){var _0x39db5b=['green','\x20\x20\x20','1722927EytTVZ','653412hkUWgf','\x20√\x20','1274104uniEZe','4100620HNKvsf','49KwqCqe','5peDBYP','loading','6453240DtJAXb','9ISHKuR','2007300kYVvMI','283838iWujUT'];a91_0x1a6a=function(){return _0x39db5b;};return a91_0x1a6a();}function a91_0xc0a9(_0x4dabaa,_0x2fdfc1){_0x4dabaa=_0x4dabaa-0x1df;var _0x1a6af4=a91_0x1a6a();var _0xc0a966=_0x1a6af4[_0x4dabaa];return _0xc0a966;}import{Text}from'ink';import a91_0x21d237 from'ink-spinner';export function TaskLoading(_0x19ae3a){var _0x564994=a91_0xc0a9;if(_0x19ae3a['finished'])return a91_0xc6a401(Text,{'color':_0x564994(0x1eb),'children':_0x564994(0x1e1)});if(_0x19ae3a[_0x564994(0x1e6)])return a91_0x262b9b(Text,{'color':_0x564994(0x1eb),'children':['\x20',a91_0xc6a401(a91_0x21d237,{'type':'dots'}),'\x20']});return a91_0xc6a401(Text,{'children':_0x564994(0x1ec)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x217f17,_0x21d84c){var _0x22265e=a92_0x3f2b,_0x4aa426=_0x217f17();while(!![]){try{var _0x1faa20=parseInt(_0x22265e(0xf0))/0x1*(-parseInt(_0x22265e(0xf4))/0x2)+-parseInt(_0x22265e(0xf7))/0x3+-parseInt(_0x22265e(0xf3))/0x4+-parseInt(_0x22265e(0xf5))/0x5+parseInt(_0x22265e(0xf1))/0x6*(parseInt(_0x22265e(0xf2))/0x7)+-parseInt(_0x22265e(0xf6))/0x8+parseInt(_0x22265e(0xef))/0x9;if(_0x1faa20===_0x21d84c)break;else _0x4aa426['push'](_0x4aa426['shift']());}catch(_0x71dd10){_0x4aa426['push'](_0x4aa426['shift']());}}}(a92_0x11f0,0xbc270));import{jsx as a92_0x3323a3,jsxs as a92_0x5ae35b}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a92_0x11f0(){var _0x39bab3=['2752700wyWXQh','2eNhjei','7163120rAPLIq','8585432XhcfTR','412122bGagew','34981974DMRuKq','1037105tUTNUh','6PiyZoj','8765701Uaguwc'];a92_0x11f0=function(){return _0x39bab3;};return a92_0x11f0();}function a92_0x3f2b(_0x3a8e89,_0x5e08b4){_0x3a8e89=_0x3a8e89-0xef;var _0x11f0ad=a92_0x11f0();var _0x3f2bfb=_0x11f0ad[_0x3a8e89];return _0x3f2bfb;}export function TaskRunning(_0x3c6856){return a92_0x5ae35b(Box,{'children':[a92_0x3323a3(Box,{'width':'1'}),a92_0x3323a3(TaskLoading,{..._0x3c6856}),a92_0x3323a3(Text,{'children':_0x3c6856['taskName']}),a92_0x3323a3(TaskTime,{'elapsed':_0x3c6856['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x15409e,_0x41bc09){var _0x2bc12f=a93_0x2c43,_0x4c6d17=_0x15409e();while(!![]){try{var _0x49ce54=-parseInt(_0x2bc12f(0x10c))/0x1*(-parseInt(_0x2bc12f(0x10b))/0x2)+parseInt(_0x2bc12f(0x105))/0x3+parseInt(_0x2bc12f(0x108))/0x4*(parseInt(_0x2bc12f(0x10f))/0x5)+-parseInt(_0x2bc12f(0x106))/0x6*(-parseInt(_0x2bc12f(0x107))/0x7)+parseInt(_0x2bc12f(0x110))/0x8*(parseInt(_0x2bc12f(0x10d))/0x9)+-parseInt(_0x2bc12f(0x109))/0xa*(-parseInt(_0x2bc12f(0x111))/0xb)+parseInt(_0x2bc12f(0x112))/0xc*(-parseInt(_0x2bc12f(0x10a))/0xd);if(_0x49ce54===_0x41bc09)break;else _0x4c6d17['push'](_0x4c6d17['shift']());}catch(_0x1ed556){_0x4c6d17['push'](_0x4c6d17['shift']());}}}(a93_0xae2f,0xc3c1e));import{jsx as a93_0x47baf1,Fragment as a93_0x4fbd82,jsxs as a93_0x30d5ed}from'react/jsx-runtime';function a93_0x2c43(_0x20a462,_0x1dfb30){_0x20a462=_0x20a462-0x104;var _0xae2f5e=a93_0xae2f();var _0x2c43cc=_0xae2f5e[_0x20a462];return _0x2c43cc;}import{Text}from'ink';function a93_0xae2f(){var _0x1a089f=['52CpsLyS','1952274KgqMTX','1gDYIPq','9YynlRP','gray','617345VkEAek','1015544UyLCuQ','486233smhMIt','9062232uhVkqz','elapsed','101265UPqUZH','12zfeSRu','2875467jFhwdV','16MwfZSE','310POrPoY'];a93_0xae2f=function(){return _0x1a089f;};return a93_0xae2f();}export function TaskTime(_0x52f79c){var _0x1342e3=a93_0x2c43;if(_0x52f79c[_0x1342e3(0x104)])return a93_0x30d5ed(a93_0x4fbd82,{'children':[a93_0x47baf1(Text,{'color':_0x1342e3(0x10e),'children':'\x20['}),a93_0x47baf1(Text,{'color':_0x1342e3(0x10e),'bold':!![],'children':_0x52f79c[_0x1342e3(0x104)]}),a93_0x47baf1(Text,{'color':_0x1342e3(0x10e),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a94_0x56c1da=a94_0x3dd5;(function(_0x31ae1e,_0x1f28d9){const _0x1d35e8=a94_0x3dd5,_0x2a4e30=_0x31ae1e();while(!![]){try{const _0x5af9d0=-parseInt(_0x1d35e8(0xa7))/0x1*(parseInt(_0x1d35e8(0xa8))/0x2)+parseInt(_0x1d35e8(0xad))/0x3*(-parseInt(_0x1d35e8(0xab))/0x4)+parseInt(_0x1d35e8(0xa1))/0x5*(parseInt(_0x1d35e8(0x9a))/0x6)+-parseInt(_0x1d35e8(0xac))/0x7*(-parseInt(_0x1d35e8(0x97))/0x8)+parseInt(_0x1d35e8(0xa9))/0x9*(parseInt(_0x1d35e8(0x96))/0xa)+parseInt(_0x1d35e8(0xaa))/0xb*(parseInt(_0x1d35e8(0xa0))/0xc)+-parseInt(_0x1d35e8(0xa4))/0xd;if(_0x5af9d0===_0x1f28d9)break;else _0x2a4e30['push'](_0x2a4e30['shift']());}catch(_0x16d538){_0x2a4e30['push'](_0x2a4e30['shift']());}}}(a94_0x58a1,0xe60a2));import a94_0x1a20fc from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a94_0x3dd5(_0x4dd0a5,_0x52ef75){_0x4dd0a5=_0x4dd0a5-0x96;const _0x58a1e6=a94_0x58a1();let _0x3dd573=_0x58a1e6[_0x4dd0a5];return _0x3dd573;}const __dirname=a94_0x1a20fc[a94_0x56c1da(0xa2)](fileURLToPath(import.meta.url)),templateDir=a94_0x1a20fc['resolve'](__dirname,a94_0x56c1da(0x9b));function a94_0x58a1(){const _0x238a82=['dirname','copy','10250877cspOfy','开始复制项目模板','info','1tuEpIK','68602eBpYOv','72MSHTmz','66gZePYM','132264CxraJj','553UIzOdp','132pkWLYt','1321770LcOsuu','38472HzwNuY','error','resolve','23910YOaeKO','../../templates/projects/sub-app-react-demo','now','cwd','项目模板复制完成','success','3461688AvFYTb','65lpiWvT'];a94_0x58a1=function(){return _0x238a82;};return a94_0x58a1();}export function useCopyProjectTemplate(){const [_0x2b2e7f,_0x1948c2]=useState(![]),[_0x12a205,_0x36d4ca]=useState(![]),[_0x3bacf1,_0x2b7c20]=useState(''),_0x7b4d43=useCallback(async _0x679a00=>{const _0x281335=a94_0x3dd5,_0x55d61e=Date['now'](),_0x50cde8=a94_0x1a20fc[_0x281335(0x99)](process[_0x281335(0x9d)](),_0x679a00);_0x1948c2(!![]);try{logger[_0x281335(0xa6)]('copy',_0x281335(0xa5),{'projectCode':_0x679a00,'templateDir':templateDir}),await copyDirectory(templateDir,_0x50cde8);const _0x55bd60=Date[_0x281335(0x9c)]()-_0x55d61e;logger[_0x281335(0x9f)](_0x281335(0xa3),_0x281335(0x9e),_0x55bd60,{'projectCode':_0x679a00});}catch(_0x556f43){const _0x5a09ff=Date[_0x281335(0x9c)]()-_0x55d61e;logger[_0x281335(0x98)]('copy','项目模板复制失败',{'projectCode':_0x679a00,'error':_0x556f43 instanceof Error?_0x556f43['message']:String(_0x556f43),'duration':_0x5a09ff});throw _0x556f43;}finally{_0x1948c2(![]),_0x36d4ca(!![]),_0x2b7c20(formatElapsed(_0x55d61e));}},[]);return{'taskName':'Copy\x20project\x20files','finished':_0x12a205,'loading':_0x2b2e7f,'elapsed':_0x3bacf1,'doTask':_0x7b4d43};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x177f79,_0x5b0792){const _0x56ed8c=a95_0x57a2,_0x4c3efa=_0x177f79();while(!![]){try{const _0x41c67=-parseInt(_0x56ed8c(0x88))/0x1+parseInt(_0x56ed8c(0x8a))/0x2+parseInt(_0x56ed8c(0x9a))/0x3*(-parseInt(_0x56ed8c(0x99))/0x4)+parseInt(_0x56ed8c(0x89))/0x5+-parseInt(_0x56ed8c(0x8c))/0x6*(parseInt(_0x56ed8c(0x94))/0x7)+-parseInt(_0x56ed8c(0x8f))/0x8*(parseInt(_0x56ed8c(0x8e))/0x9)+-parseInt(_0x56ed8c(0x96))/0xa*(-parseInt(_0x56ed8c(0x97))/0xb);if(_0x41c67===_0x5b0792)break;else _0x4c3efa['push'](_0x4c3efa['shift']());}catch(_0x265b1a){_0x4c3efa['push'](_0x4c3efa['shift']());}}}(a95_0xd531,0x2c5a9));import a95_0x31f5f1 from'node:path';import{useCallback,useState}from'react';function a95_0xd531(){const _0x19b5be=['7170zEaeba','format','info','Format\x20code','now','319743bnJmWa','1273225ovNIKz','562314ocpDOI','代码格式化失败','246nuIWmQ','--write','9SaDQRD','907640EzkZvN','cwd','success','开始格式化代码','resolve','27657hpLYtS','prettier','2150OqddZx','20526qIgLDS','代码格式化完成','268ywFOeM'];a95_0xd531=function(){return _0x19b5be;};return a95_0xd531();}function a95_0x57a2(_0x1de4dd,_0x4c65ad){_0x1de4dd=_0x1de4dd-0x85;const _0xd5312f=a95_0xd531();let _0x57a20d=_0xd5312f[_0x1de4dd];return _0x57a20d;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x21b39a=a95_0x57a2,[_0x4bc424,_0x3a9d4e]=useState(![]),[_0x576fa4,_0x39f34c]=useState(![]),[_0x50f4c3,_0x211826]=useState(''),_0x2552d1=useCallback(async _0x5edcea=>{const _0x308bdc=a95_0x57a2,_0x1d562b=Date[_0x308bdc(0x87)](),_0x17d127=a95_0x31f5f1[_0x308bdc(0x93)](process[_0x308bdc(0x90)](),_0x5edcea);_0x3a9d4e(!![]);try{logger[_0x308bdc(0x85)](_0x308bdc(0x9b),_0x308bdc(0x92),{'projectCode':_0x5edcea}),await execa('npx',[_0x308bdc(0x95),_0x308bdc(0x8d),'.'],{'cwd':_0x17d127});const _0x491a86=Date[_0x308bdc(0x87)]()-_0x1d562b;logger[_0x308bdc(0x91)](_0x308bdc(0x9b),_0x308bdc(0x98),_0x491a86,{'projectCode':_0x5edcea});}catch(_0xaa2105){const _0x7f73de=Date[_0x308bdc(0x87)]()-_0x1d562b;logger['error'](_0x308bdc(0x9b),_0x308bdc(0x8b),{'projectCode':_0x5edcea,'error':_0xaa2105 instanceof Error?_0xaa2105['message']:String(_0xaa2105),'duration':_0x7f73de});throw _0xaa2105;}finally{_0x3a9d4e(![]),_0x39f34c(!![]),_0x211826(formatElapsed(_0x1d562b));}},[]);return{'taskName':_0x21b39a(0x86),'finished':_0x576fa4,'loading':_0x4bc424,'elapsed':_0x50f4c3,'doTask':_0x2552d1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x262a96,_0x3a56c6){const _0x3caa3f=a96_0x157b,_0x1ff9f7=_0x262a96();while(!![]){try{const _0x296718=parseInt(_0x3caa3f(0x17b))/0x1+-parseInt(_0x3caa3f(0x186))/0x2*(parseInt(_0x3caa3f(0x18e))/0x3)+parseInt(_0x3caa3f(0x18b))/0x4*(parseInt(_0x3caa3f(0x17c))/0x5)+parseInt(_0x3caa3f(0x17f))/0x6*(parseInt(_0x3caa3f(0x18a))/0x7)+parseInt(_0x3caa3f(0x17e))/0x8+-parseInt(_0x3caa3f(0x184))/0x9*(parseInt(_0x3caa3f(0x188))/0xa)+-parseInt(_0x3caa3f(0x18c))/0xb;if(_0x296718===_0x3a56c6)break;else _0x1ff9f7['push'](_0x1ff9f7['shift']());}catch(_0x2b3e0d){_0x1ff9f7['push'](_0x1ff9f7['shift']());}}}(a96_0x29f8,0xc9217));function a96_0x157b(_0x888af5,_0xb0d8){_0x888af5=_0x888af5-0x179;const _0x29f8e5=a96_0x29f8();let _0x157bd9=_0x29f8e5[_0x888af5];return _0x157bd9;}import a96_0x239fd4 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a96_0x29f8(){const _0x4ed486=['954344sOVtCC','6oAXKXv','依赖安装失败','cwd','https://registry.npmmirror.com','--registry','6393843oRpNRx','info','764ujJwtc','Install\x20dependencies','10VnZAzt','error','1476678kOWcwQ','292gPeVDD','9873655kPgeVs','now','5517lCAQPR','开始安装依赖','success','1322506ycZedP','101480yUhkRy','install'];a96_0x29f8=function(){return _0x4ed486;};return a96_0x29f8();}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x40a19b=a96_0x157b,[_0x2c8476,_0x1a4bc9]=useState(![]),[_0x221c5a,_0x38a430]=useState(![]),[_0x2b52a9,_0x22a8e3]=useState(''),_0x4a0bd1=useCallback(async _0x562d18=>{const _0xe8dd3f=a96_0x157b,_0x17a119=Date['now'](),_0x280453=a96_0x239fd4['resolve'](process[_0xe8dd3f(0x181)](),_0x562d18);_0x1a4bc9(!![]),_0x38a430(![]);const _0x4bb218=async(_0x4d5fb6,_0x36c3eb)=>{await execa(_0x4d5fb6,_0x36c3eb,{'cwd':_0x280453});};try{logger[_0xe8dd3f(0x185)](_0xe8dd3f(0x17d),_0xe8dd3f(0x179),{'projectCode':_0x562d18,'registry':_0xe8dd3f(0x182)}),await _0x4bb218('npm',[_0xe8dd3f(0x17d),_0xe8dd3f(0x183),_0xe8dd3f(0x182)]);const _0x3c5b05=Date[_0xe8dd3f(0x18d)]()-_0x17a119;logger[_0xe8dd3f(0x17a)](_0xe8dd3f(0x17d),'依赖安装完成',_0x3c5b05,{'projectCode':_0x562d18});}catch(_0x263475){const _0x594316=Date['now']()-_0x17a119;logger[_0xe8dd3f(0x189)](_0xe8dd3f(0x17d),_0xe8dd3f(0x180),{'projectCode':_0x562d18,'error':_0x263475 instanceof Error?_0x263475['message']:String(_0x263475),'duration':_0x594316});throw _0x263475;}finally{_0x1a4bc9(![]),_0x38a430(!![]),_0x22a8e3(formatElapsed(_0x17a119));}},[]);return{'taskName':_0x40a19b(0x187),'finished':_0x221c5a,'loading':_0x2c8476,'elapsed':_0x2b52a9,'doTask':_0x4a0bd1};}
|