@lovrabet/rabetbase-cli 2.0.4-beta.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -0
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -0
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -0
- package/lib/commands/logs/index.js +1 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project/index.js +1 -0
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -0
- package/lib/commands/skill/index.js +1 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -0
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +2 -2
- package/lib/commands/auth.js +0 -1
- package/lib/commands/create.js +0 -1
- package/lib/commands/init.js +0 -1
- package/lib/commands/logout.js +0 -1
- package/lib/commands/logs.js +0 -1
- package/lib/commands/run.js +0 -1
- package/lib/commands/skill.js +0 -1
- package/lib/commands/smart-init.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a87_0x1dd8c9=a87_0x1ad5;(function(_0x5accc0,_0x38bf83){const _0x18944d=a87_0x1ad5,_0x4358f3=_0x5accc0();while(!![]){try{const _0x1286eb=parseInt(_0x18944d(0x106))/0x1+parseInt(_0x18944d(0xfb))/0x2*(-parseInt(_0x18944d(0xf0))/0x3)+parseInt(_0x18944d(0xec))/0x4*(parseInt(_0x18944d(0xeb))/0x5)+parseInt(_0x18944d(0x104))/0x6+-parseInt(_0x18944d(0xf5))/0x7+-parseInt(_0x18944d(0xe4))/0x8+-parseInt(_0x18944d(0xfd))/0x9*(-parseInt(_0x18944d(0xfa))/0xa);if(_0x1286eb===_0x38bf83)break;else _0x4358f3['push'](_0x4358f3['shift']());}catch(_0x1cc764){_0x4358f3['push'](_0x4358f3['shift']());}}}(a87_0x2221,0x97a27));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=[a87_0x1dd8c9(0xe9),a87_0x1dd8c9(0xea),a87_0x1dd8c9(0xf9)];export function normalizeBffType(_0x135745){const _0x564092=a87_0x1dd8c9;if(!_0x135745)return undefined;const _0x332487=_0x135745['trim']()[_0x564092(0x100)]();return SUPPORTED_BFF_TYPES[_0x564092(0xee)](_0x332487)?_0x332487:undefined;}async function scanJsFilesRecursively(_0x22d10f,_0x1628d5){const _0x51ee2d=a87_0x1dd8c9,_0x51a327=[];try{const _0x51a9a8=await readdir(_0x22d10f,{'withFileTypes':!![]});for(const _0x1dace6 of _0x51a9a8){const _0x3be597=join(_0x22d10f,_0x1dace6[_0x51ee2d(0xe8)]);if(_0x1dace6[_0x51ee2d(0xf2)]())_0x51a327[_0x51ee2d(0x107)](...await scanJsFilesRecursively(_0x3be597,_0x1628d5+'/'+_0x1dace6[_0x51ee2d(0xe8)]));else _0x1dace6[_0x51ee2d(0x102)]()&&_0x1dace6['name'][_0x51ee2d(0xf3)](_0x51ee2d(0x101))&&_0x51a327[_0x51ee2d(0x107)]({'lockKey':_0x1628d5+'/'+_0x1dace6[_0x51ee2d(0xe8)]['replace'](/\.js$/,''),'filePath':_0x3be597});}}catch(_0xa4b866){if(_0xa4b866['code']!==_0x51ee2d(0xff))throw _0xa4b866;}return _0x51a327;}async function scanFlatFunctions(_0x315cf8,_0x385c7f){const _0x7580ae=a87_0x1dd8c9,_0x4cb56a=join(_0x315cf8[_0x7580ae(0xfc)],_0x385c7f),_0x1fb293=await scanJsFilesRecursively(_0x4cb56a,_0x385c7f);return _0x1fb293[_0x7580ae(0xef)](({lockKey:_0x58cea3,filePath:_0xc348cb})=>({'type':_0x385c7f,'name':_0x58cea3[_0x7580ae(0xf7)]('/')['at'](-0x1)??'','filePath':_0xc348cb,'lockKey':_0x58cea3}));}async function scanHookFunctions(_0x3cad37){const _0x45ef0c=a87_0x1dd8c9,_0x32e1a7=join(_0x3cad37[_0x45ef0c(0xfc)],'HOOK'),_0x4659f5=[];try{const _0x53d4f0=await readdir(_0x32e1a7,{'withFileTypes':!![]});for(const _0x2f24bf of _0x53d4f0){if(!_0x2f24bf[_0x45ef0c(0xf2)]())continue;const _0x1c9c4f=_0x2f24bf[_0x45ef0c(0xe8)],_0x5ef1c0=join(_0x32e1a7,_0x1c9c4f),_0x50f48b=await readdir(_0x5ef1c0,{'withFileTypes':!![]});for(const _0x2766bd of _0x50f48b){if(!_0x2766bd[_0x45ef0c(0xf2)]())continue;const _0x31459f=_0x2766bd['name'],_0x7bebda=join(_0x5ef1c0,_0x31459f),_0x452376=await readdir(_0x7bebda,{'withFileTypes':!![]});for(const _0x3b2fcc of _0x452376){if(!_0x3b2fcc[_0x45ef0c(0xf2)]())continue;const _0x1d9036=_0x3b2fcc[_0x45ef0c(0xe8)],_0x35fc63=join(_0x7bebda,_0x1d9036),_0x5b2b48=await readdir(_0x35fc63,{'withFileTypes':!![]});for(const _0x27406e of _0x5b2b48){if(!_0x27406e[_0x45ef0c(0x102)]()||!_0x27406e['name'][_0x45ef0c(0xf3)](_0x45ef0c(0x101)))continue;const _0x575116=_0x27406e[_0x45ef0c(0xe8)][_0x45ef0c(0xf6)](/\.js$/,'');_0x4659f5[_0x45ef0c(0x107)]({'type':'HOOK','name':_0x575116,'filePath':join(_0x35fc63,_0x27406e[_0x45ef0c(0xe8)]),'lockKey':_0x45ef0c(0xf1)+_0x1c9c4f+'/'+_0x31459f+'/'+_0x1d9036+'/'+_0x575116,'alias':_0x1c9c4f,'operationType':_0x31459f,'functionNode':_0x1d9036});}}}}}catch(_0x6aa275){if(_0x6aa275[_0x45ef0c(0xf8)]!=='ENOENT')throw _0x6aa275;}return _0x4659f5;}export async function scanLocalBffFunctions(_0x32f6f4,_0x137cc8){const _0x2be498=a87_0x1dd8c9;if(_0x137cc8===_0x2be498(0xe9)||_0x137cc8==='ENDPOINT')return scanFlatFunctions(_0x32f6f4,_0x137cc8);if(_0x137cc8==='HOOK')return scanHookFunctions(_0x32f6f4);const [_0xbac53,_0xce7f0e,_0x26db00]=await Promise['all']([scanFlatFunctions(_0x32f6f4,_0x2be498(0xe9)),scanFlatFunctions(_0x32f6f4,_0x2be498(0xea)),scanHookFunctions(_0x32f6f4)]);return[..._0xbac53,..._0xce7f0e,..._0x26db00];}function a87_0x1ad5(_0x39b116,_0x1067ab){_0x39b116=_0x39b116-0xe2;const _0x22210a=a87_0x2221();let _0x1ad577=_0x22210a[_0x39b116];return _0x1ad577;}function a87_0x2221(){const _0x4d93c6=['58508CezfZG','after','includes','map','3yAHhsa','HOOK/','isDirectory','endsWith','functionName','853167SLjtyx','replace','split','code','HOOK','130couneq','1012678yURvfd','scriptsRootDir','94356UnhkJL','operationType','ENOENT','toUpperCase','.js','isFile','alias','345048owekCj','get','735785YpoqbN','push','functionNode','scriptType','4697152SjGFUu','datasetCode','beforeScriptId','F_OK','name','COMMON','ENDPOINT','310vqzILg'];a87_0x2221=function(){return _0x4d93c6;};return a87_0x2221();}export function resolveLocalFilePathFromLockKey(_0x4b36bf,_0x56429c){const _0x271063=a87_0x1dd8c9;return join(_0x4b36bf[_0x271063(0xfc)],..._0x56429c['split']('/'))+'.js';}export function createHookLocationMap(_0x43dc88){const _0x528fa5=a87_0x1dd8c9,_0x20218e=new Map();for(const _0x2578d1 of _0x43dc88){_0x2578d1[_0x528fa5(0xe6)]&&_0x20218e['set'](_0x2578d1['beforeScriptId'],{'datasetCode':_0x2578d1[_0x528fa5(0xe5)],'operationType':snakeToCamel(_0x2578d1['operationType']),'functionNode':'before'}),_0x2578d1['afterScriptId']&&_0x20218e['set'](_0x2578d1['afterScriptId'],{'datasetCode':_0x2578d1[_0x528fa5(0xe5)],'operationType':snakeToCamel(_0x2578d1[_0x528fa5(0xfe)]),'functionNode':_0x528fa5(0xed)});}return _0x20218e;}export function resolveRemoteScriptTarget(_0x123e01,_0x1872b3,_0x10e974,_0x2988e4,_0x386d6f){const _0x25a03a=a87_0x1dd8c9,_0x3eda5b=normalizeBffType(_0x1872b3[_0x25a03a(0xe3)]);if(!_0x3eda5b||!_0x1872b3[_0x25a03a(0xf4)])return null;if(_0x3eda5b===_0x25a03a(0xf9)){const _0x131ab6=(_0x1872b3['id']?_0x10e974[_0x25a03a(0x105)](_0x1872b3['id']):undefined)??findHookLocationByRemoteId(_0x2988e4,_0x1872b3['id']);if(!_0x131ab6)return null;const _0x510e13=_0x131ab6[_0x25a03a(0x103)]||_0x386d6f[_0x25a03a(0x105)](_0x131ab6[_0x25a03a(0xe5)]),_0x2cbfb6=_0x510e13??_0x131ab6[_0x25a03a(0xe5)],_0x17fbc0={..._0x131ab6,'alias':_0x510e13},_0xcdf480=_0x25a03a(0xf1)+_0x2cbfb6+'/'+_0x17fbc0[_0x25a03a(0xfe)]+'/'+_0x17fbc0[_0x25a03a(0xe2)]+'/'+_0x1872b3[_0x25a03a(0xf4)];return{'lockKey':_0xcdf480,'filePath':resolveLocalFilePathFromLockKey(_0x123e01,_0xcdf480),'type':'HOOK','hookLocation':_0x17fbc0};}const _0x365632=_0x3eda5b+'/'+_0x1872b3['functionName'];return{'lockKey':_0x365632,'filePath':resolveLocalFilePathFromLockKey(_0x123e01,_0x365632),'type':_0x3eda5b};}export async function ensureParentDirectory(_0x3055a2){await mkdir(dirname(_0x3055a2),{'recursive':!![]});}export async function fileExists(_0x1188d4){const _0x3cd685=a87_0x1dd8c9;try{return await access(_0x1188d4,constants[_0x3cd685(0xe7)]),!![];}catch{return![];}}export async function directoryExists(_0x4aa6b4){const _0x288595=a87_0x1dd8c9;try{const _0x1d867a=await stat(_0x4aa6b4);return _0x1d867a[_0x288595(0xf2)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a88_0x3bfb(_0x3b9415,_0x242735){_0x3b9415=_0x3b9415-0xb8;const _0x55428b=a88_0x5542();let _0x3bfbc8=_0x55428b[_0x3b9415];return _0x3bfbc8;}(function(_0x84e052,_0x5406e8){const _0x59fa86=a88_0x3bfb,_0x1ef6a3=_0x84e052();while(!![]){try{const _0x1a2ada=parseInt(_0x59fa86(0xbb))/0x1*(parseInt(_0x59fa86(0xba))/0x2)+parseInt(_0x59fa86(0xbe))/0x3*(parseInt(_0x59fa86(0xb8))/0x4)+parseInt(_0x59fa86(0xb9))/0x5+parseInt(_0x59fa86(0xc2))/0x6*(-parseInt(_0x59fa86(0xbd))/0x7)+-parseInt(_0x59fa86(0xc3))/0x8+-parseInt(_0x59fa86(0xbf))/0x9*(parseInt(_0x59fa86(0xbc))/0xa)+parseInt(_0x59fa86(0xc1))/0xb;if(_0x1a2ada===_0x5406e8)break;else _0x1ef6a3['push'](_0x1ef6a3['shift']());}catch(_0xafa4dc){_0x1ef6a3['push'](_0x1ef6a3['shift']());}}}(a88_0x5542,0x5381c));import{readFile}from'node:fs/promises';import a88_0x4f9acd from'node:crypto';function a88_0x5542(){const _0x1d7dfe=['126snnRIM','4158928NlxYNG','md5','1402796TnmJpT','1874835YTvWlT','230414maErbN','4scpGPC','6735810BiRzlF','191401YiujFH','3yewrqe','9CqInpi','utf8','10155200VFeCPf'];a88_0x5542=function(){return _0x1d7dfe;};return a88_0x5542();}export function computeContentHash(_0x940557){const _0x3b6e1b=a88_0x3bfb;return a88_0x4f9acd['createHash'](_0x3b6e1b(0xc4))['update'](_0x940557)['digest']('hex');}export async function computeFileHash(_0x58817f){const _0x4b1c7f=a88_0x3bfb,_0x1c3aae=await readFile(_0x58817f,_0x4b1c7f(0xc0));return computeContentHash(_0x1c3aae);}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b58b3,_0x8b8318){const _0x45fe03=a89_0x217c,_0x262bc2=_0x3b58b3();while(!![]){try{const _0x39236c=parseInt(_0x45fe03(0x189))/0x1*(-parseInt(_0x45fe03(0x17d))/0x2)+-parseInt(_0x45fe03(0x17f))/0x3*(parseInt(_0x45fe03(0x188))/0x4)+-parseInt(_0x45fe03(0x17b))/0x5*(parseInt(_0x45fe03(0x17c))/0x6)+-parseInt(_0x45fe03(0x183))/0x7*(parseInt(_0x45fe03(0x176))/0x8)+-parseInt(_0x45fe03(0x178))/0x9+-parseInt(_0x45fe03(0x185))/0xa+parseInt(_0x45fe03(0x186))/0xb;if(_0x39236c===_0x8b8318)break;else _0x262bc2['push'](_0x262bc2['shift']());}catch(_0x39c9a8){_0x262bc2['push'](_0x262bc2['shift']());}}}(a89_0x3a50,0xd9130));import{mkdir,readFile,writeFile}from'node:fs/promises';function a89_0x217c(_0x3334a4,_0x54fd03){_0x3334a4=_0x3334a4-0x172;const _0x3a50e5=a89_0x3a50();let _0x217c67=_0x3a50e5[_0x3334a4];return _0x217c67;}import{dirname}from'node:path';export function createEmptyBffLock(){return{'apps':{}};}export function ensureLockScope(_0x3227f7,_0x3b4f3a,_0x273fe4,_0x474a53){const _0x59b740=a89_0x217c,_0x22cb20={'apps':_0x3227f7[_0x59b740(0x182)]&&typeof _0x3227f7[_0x59b740(0x182)]===_0x59b740(0x181)?_0x3227f7['apps']:{}};let _0x544f7a=_0x22cb20[_0x59b740(0x182)][_0x3b4f3a];if(!_0x544f7a)return _0x544f7a={'scriptsRoot':_0x273fe4,'lastSync':'','functions':{}},_0x22cb20[_0x59b740(0x182)][_0x3b4f3a]=_0x544f7a,{'lockData':_0x22cb20,'appLock':_0x544f7a};if(!_0x544f7a[_0x59b740(0x174)])_0x544f7a[_0x59b740(0x174)]=_0x273fe4;else{if(_0x544f7a[_0x59b740(0x174)]!==_0x273fe4)throw new Error(_0x474a53+_0x59b740(0x180)+(_0x59b740(0x179)+_0x273fe4+'\x22\x20vs\x20lock\x20\x22'+_0x544f7a['scriptsRoot']+'\x22.\x20')+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x544f7a[_0x59b740(0x172)]&&(_0x544f7a[_0x59b740(0x172)]={}),!_0x544f7a['lastSync']&&(_0x544f7a[_0x59b740(0x175)]=''),{'lockData':_0x22cb20,'appLock':_0x544f7a};}export async function readBffLockFile(_0x4d9951){const _0x2f9bbc=a89_0x217c;try{const _0x48981f=await readFile(_0x4d9951,'utf8'),_0x41256f=JSON[_0x2f9bbc(0x177)](_0x48981f);return{'apps':_0x41256f[_0x2f9bbc(0x182)]&&typeof _0x41256f[_0x2f9bbc(0x182)]===_0x2f9bbc(0x181)?_0x41256f[_0x2f9bbc(0x182)]:{}};}catch(_0x46f291){if(_0x46f291[_0x2f9bbc(0x184)]===_0x2f9bbc(0x173))return null;throw new Error(_0x2f9bbc(0x17a)+String(_0x46f291));}}export async function writeBffLockFile(_0x2d5c5d,_0x34f6be){const _0x49968e=a89_0x217c;await mkdir(dirname(_0x2d5c5d),{'recursive':!![]}),await writeFile(_0x2d5c5d,JSON[_0x49968e(0x17e)](_0x34f6be,null,0x2),_0x49968e(0x187));}function a89_0x3a50(){const _0x200835=['784rXngPz','parse','11826072mjyMXM','current\x20\x22','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','8192665QsWfyj','6kphXRg','6398hSWKQG','stringify','3tZGckJ',':\x20scriptsRoot\x20mismatch\x20—\x20','object','apps','13727tBZTRy','code','12783330JegnVi','80126079TwkAZH','utf8','4151572uRMQRT','292WwTpzD','functions','ENOENT','scriptsRoot','lastSync'];a89_0x3a50=function(){return _0x200835;};return a89_0x3a50();}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f30a0,_0x26f683){const _0x2c61b1=a91_0x3640,_0x3273b2=_0x3f30a0();while(!![]){try{const _0x368fa9=parseInt(_0x2c61b1(0x160))/0x1+-parseInt(_0x2c61b1(0x169))/0x2*(parseInt(_0x2c61b1(0x172))/0x3)+-parseInt(_0x2c61b1(0x16e))/0x4+-parseInt(_0x2c61b1(0x170))/0x5*(parseInt(_0x2c61b1(0x167))/0x6)+parseInt(_0x2c61b1(0x16c))/0x7*(parseInt(_0x2c61b1(0x162))/0x8)+parseInt(_0x2c61b1(0x163))/0x9+-parseInt(_0x2c61b1(0x173))/0xa*(parseInt(_0x2c61b1(0x174))/0xb);if(_0x368fa9===_0x26f683)break;else _0x3273b2['push'](_0x3273b2['shift']());}catch(_0x3b9924){_0x3273b2['push'](_0x3273b2['shift']());}}}(a91_0x3d92,0x491ed));export function snakeToCamel(_0x23b20b){const _0x494354=a91_0x3640;return _0x23b20b[_0x494354(0x168)]()[_0x494354(0x16a)](/_([a-z])/g,(_0x179156,_0x55be68)=>_0x55be68[_0x494354(0x16f)]());}export function findHookLocationByRemoteId(_0x4587f3,_0x52fc4e){const _0x31086a=a91_0x3640;if(!_0x52fc4e)return undefined;for(const _0x5532b5 of Object[_0x31086a(0x15f)](_0x4587f3)){if(_0x5532b5['remoteId']===_0x52fc4e&&_0x5532b5[_0x31086a(0x166)]&&_0x5532b5[_0x31086a(0x171)]&&_0x5532b5['functionNode'])return{'datasetCode':_0x5532b5[_0x31086a(0x166)],'operationType':_0x5532b5[_0x31086a(0x171)],'functionNode':_0x5532b5[_0x31086a(0x165)]};}return undefined;}function a91_0x3640(_0x229122,_0x5e65ee){_0x229122=_0x229122-0x15e;const _0x3d92d1=a91_0x3d92();let _0x364092=_0x3d92d1[_0x229122];return _0x364092;}function a91_0x3d92(){const _0x36603d=['test','3595640qscahi','4196421mOfgQt','match','functionNode','datasetCode','56454rWBFot','toLowerCase','1766hOttRe','replace','after','7TuJXVV','before','9484WPRfzD','toUpperCase','270mymhVr','operationType','1107zsgDJD','91850wMeYpX','253QDKcjs','trim','values','431316ETnODT'];a91_0x3d92=function(){return _0x36603d;};return a91_0x3d92();}export function extractScriptDescription(_0x75464b){const _0x24d8e9=a91_0x3640,_0x16f70d=_0x75464b[_0x24d8e9(0x164)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x16f70d?.[0x1]?.[_0x24d8e9(0x15e)]()||undefined;}export function isValidBffFunctionName(_0x28532d){const _0x491956=a91_0x3640;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x491956(0x161)](_0x28532d);}export function normalizeHookFunctionNode(_0x32197e){const _0x351aea=a91_0x3640;if(!_0x32197e)return undefined;const _0x2169fe=_0x32197e['trim']()['toLowerCase']();if(_0x2169fe===_0x351aea(0x16d)||_0x2169fe===_0x351aea(0x16b))return _0x2169fe;return undefined;}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e2d15,_0x3eec98){const _0x3afe9e=a92_0x1bca,_0x4beb8f=_0x1e2d15();while(!![]){try{const _0x213a8a=-parseInt(_0x3afe9e(0xce))/0x1*(-parseInt(_0x3afe9e(0xcf))/0x2)+-parseInt(_0x3afe9e(0xe2))/0x3*(parseInt(_0x3afe9e(0xd3))/0x4)+-parseInt(_0x3afe9e(0xd4))/0x5*(parseInt(_0x3afe9e(0xdb))/0x6)+-parseInt(_0x3afe9e(0xd9))/0x7*(parseInt(_0x3afe9e(0xdf))/0x8)+parseInt(_0x3afe9e(0xdc))/0x9+parseInt(_0x3afe9e(0xd0))/0xa*(parseInt(_0x3afe9e(0xd7))/0xb)+parseInt(_0x3afe9e(0xe4))/0xc*(parseInt(_0x3afe9e(0xe9))/0xd);if(_0x213a8a===_0x3eec98)break;else _0x4beb8f['push'](_0x4beb8f['shift']());}catch(_0x2aec96){_0x4beb8f['push'](_0x4beb8f['shift']());}}}(a92_0x406e,0x8313f));import{listDatasets}from'./api-client.js';function a92_0x406e(){const _0x1879d8=['3231004xfYDsC','135GrKtoo','db-','\x22.\x20Available:\x20','40601zDknGN','filter','7pDjNJI','length','132786yCrcRM','6345918kIZRQN','dbtableConfig','dbId','6950216JnKSol','join','get','3qBDbYx','toLowerCase','12PlSzzj','set','isNaN','has','find','18686057CzxaiP','entries','No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.','398SCvclb','2xEjsbc','1810GEJfMR','map','dbName'];a92_0x406e=function(){return _0x1879d8;};return a92_0x406e();}const cache=new Map();export async function listDatabases(_0x560d24){const _0x1b6c35=a92_0x1bca;if(cache[_0x1b6c35(0xe7)](_0x560d24))return cache[_0x1b6c35(0xe1)](_0x560d24);const _0x4beb4b=await listDatasets(_0x560d24),_0x549eff=new Map();for(const _0x24ffbf of _0x4beb4b){const _0x43ebd5=_0x24ffbf[_0x1b6c35(0xdd)];_0x43ebd5?.[_0x1b6c35(0xde)]!=null&&_0x549eff[_0x1b6c35(0xe5)](_0x43ebd5[_0x1b6c35(0xde)],_0x43ebd5[_0x1b6c35(0xd2)]??_0x1b6c35(0xd5)+_0x43ebd5['dbId']);}const _0x5e1374=[..._0x549eff[_0x1b6c35(0xea)]()]['map'](([_0x5c2edc,_0x1cdc2f])=>({'dbId':_0x5c2edc,'dbName':_0x1cdc2f}));return cache[_0x1b6c35(0xe5)](_0x560d24,_0x5e1374),_0x5e1374;}export async function resolveDb(_0x126837,_0x310f14){const _0x438570=a92_0x1bca,_0x1dea85=await listDatabases(_0x126837);if(_0x1dea85[_0x438570(0xda)]===0x0)return{'resolved':[],'error':_0x438570(0xeb)};if(!_0x310f14)return{'resolved':_0x1dea85};const _0x534c1a=Number(_0x310f14);if(!Number[_0x438570(0xe6)](_0x534c1a)){const _0x218188=_0x1dea85[_0x438570(0xe8)](_0x4c0dc2=>_0x4c0dc2[_0x438570(0xde)]===_0x534c1a);if(_0x218188)return{'resolved':[_0x218188]};}const _0x1445c1=_0x310f14[_0x438570(0xe3)](),_0x26d09e=_0x1dea85[_0x438570(0xd8)](_0x3a9ff7=>_0x3a9ff7['dbName'][_0x438570(0xe3)]()['includes'](_0x1445c1));if(_0x26d09e['length']>0x0)return{'resolved':_0x26d09e};const _0x2f3842=_0x1dea85[_0x438570(0xd1)](_0x402074=>_0x402074[_0x438570(0xd2)]+'\x20('+_0x402074[_0x438570(0xde)]+')')[_0x438570(0xe0)](',\x20');return{'resolved':[],'error':'No\x20database\x20matching\x20\x22'+_0x310f14+_0x438570(0xd6)+_0x2f3842};}export async function resolveOneDb(_0x2f9838,_0x4d2887){const _0x505cb3=a92_0x1bca,{resolved:_0x5151d7,error:_0x2c5b38}=await resolveDb(_0x2f9838,_0x4d2887);if(_0x2c5b38)return{'db':null,'error':_0x2c5b38};if(_0x5151d7[_0x505cb3(0xda)]===0x1)return{'db':_0x5151d7[0x0]};if(!_0x4d2887){const _0x17a72a=_0x5151d7[_0x505cb3(0xd1)](_0x5aee82=>_0x5aee82['dbName']+'\x20('+_0x5aee82[_0x505cb3(0xde)]+')')['join'](',\x20');return{'db':null,'error':'Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20'+_0x17a72a};}const _0x31cfb9=_0x5151d7[_0x505cb3(0xd1)](_0x5c5846=>_0x5c5846[_0x505cb3(0xd2)]+'\x20('+_0x5c5846[_0x505cb3(0xde)]+')')[_0x505cb3(0xe0)](',\x20');return{'db':null,'error':'\x22'+_0x4d2887+'\x22\x20matches\x20multiple\x20databases:\x20'+_0x31cfb9+'.\x20Be\x20more\x20specific.'};}function a92_0x1bca(_0x1c0555,_0x1b6b34){_0x1c0555=_0x1c0555-0xce;const _0x406eeb=a92_0x406e();let _0x1bca8f=_0x406eeb[_0x1c0555];return _0x1bca8f;}export async function getDbName(_0x5c3f90,_0x5c1510){const _0x284587=a92_0x1bca,_0x35ca79=await listDatabases(_0x5c3f90);return _0x35ca79['find'](_0x2d6c6c=>_0x2d6c6c['dbId']===_0x5c1510)?.[_0x284587(0xd2)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x26aa74,_0x4e5a8f){const _0x27f8f6=a93_0x3e3e,_0x320581=_0x26aa74();while(!![]){try{const _0x3b08ad=-parseInt(_0x27f8f6(0x135))/0x1*(parseInt(_0x27f8f6(0x12a))/0x2)+-parseInt(_0x27f8f6(0x11a))/0x3*(parseInt(_0x27f8f6(0x137))/0x4)+parseInt(_0x27f8f6(0x116))/0x5*(-parseInt(_0x27f8f6(0x117))/0x6)+-parseInt(_0x27f8f6(0x128))/0x7*(-parseInt(_0x27f8f6(0x131))/0x8)+-parseInt(_0x27f8f6(0x12c))/0x9+parseInt(_0x27f8f6(0x12d))/0xa+parseInt(_0x27f8f6(0x11d))/0xb;if(_0x3b08ad===_0x4e5a8f)break;else _0x320581['push'](_0x320581['shift']());}catch(_0x510954){_0x320581['push'](_0x320581['shift']());}}}(a93_0x31fd,0x6d78a));function a93_0x31fd(){const _0x4933c9=['DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','24vmOOKA','join','DDL','from','match','DELETE','INSERT','75zDusjE','261234urFDMz','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.','add','90039erbbAI','replace','unknown\x20table(s)','9645361GYorYc','test','type','length','\x20query\x20targeting\x20','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','reason','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','includes','UNKNOWN','matchAll','1380911KTHMmY','toUpperCase','10TAmvoJ','isDangerous','3027285qOLWmH','6923130bzqmSZ','startsWith','SQL\x20content\x20is\x20empty','trim','8odmKkk','split','UPDATE','push','29703jinHgP'];a93_0x31fd=function(){return _0x4933c9;};return a93_0x31fd();}export function detectSqlType(_0x5795d9){const _0x491613=a93_0x3e3e;if(!_0x5795d9?.[_0x491613(0x130)]())return{'type':_0x491613(0x126),'isSelectOnly':![],'isDangerous':![],'reason':_0x491613(0x12f)};const _0x241992=_0x5795d9[_0x491613(0x11b)](/#\{[^}]*\}/g,'?')[_0x491613(0x11b)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x491613(0x11b)](/\/\*[\s\S]*?\*\//g,'')[_0x491613(0x130)](),_0x30ced4=_0x241992[_0x491613(0x132)]('\x0a');let _0x4a74aa='';for(const _0x44057e of _0x30ced4){const _0x45dcd7=_0x44057e['trim']();if(!_0x45dcd7||_0x45dcd7['startsWith']('--')||_0x45dcd7[_0x491613(0x12e)]('/*'))continue;_0x4a74aa=_0x45dcd7;break;}const _0x137ea=_0x4a74aa[_0x491613(0x129)]();if(_0x137ea[_0x491613(0x12e)]('SELECT')||_0x137ea[_0x491613(0x12e)]('WITH')){const _0x409a5e=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x491613(0x11e)](_0x241992);return{'type':'SELECT','isSelectOnly':!_0x409a5e,'isDangerous':_0x409a5e,'reason':_0x409a5e?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x137ea[_0x491613(0x12e)]('INSERT'))return{'type':_0x491613(0x115),'isSelectOnly':![],'isDangerous':![]};if(_0x137ea[_0x491613(0x12e)](_0x491613(0x133)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':![]};if(_0x137ea[_0x491613(0x12e)](_0x491613(0x114)))return{'type':_0x491613(0x114),'isSelectOnly':![],'isDangerous':!![],'reason':_0x491613(0x124)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x491613(0x11e)](_0x137ea))return{'type':_0x491613(0x139),'isSelectOnly':![],'isDangerous':!![],'reason':_0x491613(0x136)};return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![]};}function extractTables(_0x205134){const _0x2bd32a=a93_0x3e3e,_0x9b1af2=_0x205134[_0x2bd32a(0x11b)](/#\{[^}]*\}/g,'?')['replace'](/\$\{[^}]*\}/g,'?')[_0x2bd32a(0x11b)](/'[^']*'/g,'\x27\x27')[_0x2bd32a(0x11b)](/--.*$/gm,'')[_0x2bd32a(0x11b)](/\/\*[\s\S]*?\*\//g,''),_0x5c03d8=[],_0x2237c5=_0x9b1af2[_0x2bd32a(0x13b)](/FROM\s+([^\s,)(]+)/i);if(_0x2237c5?.[0x1])_0x5c03d8[_0x2bd32a(0x134)](_0x2237c5[0x1][_0x2bd32a(0x11b)](/[`"]/g,''));for(const _0x56705d of _0x9b1af2['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x57da84=_0x56705d[0x1]?.[_0x2bd32a(0x11b)](/[`"]/g,'');if(_0x57da84&&!_0x5c03d8['includes'](_0x57da84))_0x5c03d8['push'](_0x57da84);}const _0x50977f=_0x9b1af2[_0x2bd32a(0x13b)](/INTO\s+([^\s(]+)/i);if(_0x50977f?.[0x1]){const _0x2d036f=_0x50977f[0x1][_0x2bd32a(0x11b)](/[`"]/g,'');if(!_0x5c03d8[_0x2bd32a(0x125)](_0x2d036f))_0x5c03d8[_0x2bd32a(0x134)](_0x2d036f);}const _0x33bb67=_0x9b1af2[_0x2bd32a(0x13b)](/UPDATE\s+([^\s,)(]+)/i);if(_0x33bb67?.[0x1]){const _0x29ed2e=_0x33bb67[0x1][_0x2bd32a(0x11b)](/[`"]/g,'');if(!_0x5c03d8[_0x2bd32a(0x125)](_0x29ed2e))_0x5c03d8['push'](_0x29ed2e);}return _0x5c03d8;}function a93_0x3e3e(_0x91e4cd,_0x7aa5f){_0x91e4cd=_0x91e4cd-0x114;const _0x31fd0c=a93_0x31fd();let _0x3e3e8a=_0x31fd0c[_0x91e4cd];return _0x3e3e8a;}function extractParameters(_0xf8aa09){const _0x36e900=a93_0x3e3e,_0x31180a=new Set();for(const _0x206484 of _0xf8aa09[_0x36e900(0x127)](/#\{(\w+)\}/g))if(_0x206484[0x1])_0x31180a[_0x36e900(0x119)](_0x206484[0x1]);for(const _0x446990 of _0xf8aa09[_0x36e900(0x127)](/\$\{(\w+)\}/g))if(_0x446990[0x1])_0x31180a[_0x36e900(0x119)](_0x446990[0x1]);return Array[_0x36e900(0x13a)](_0x31180a);}export function validateSql(_0x5ccd6b){const _0x394169=a93_0x3e3e,_0x44fbd0=detectSqlType(_0x5ccd6b),_0x2c8902=extractTables(_0x5ccd6b),_0x3d0c10=extractParameters(_0x5ccd6b);if(_0x44fbd0[_0x394169(0x12b)])return{'valid':![],'sqlType':_0x44fbd0,'tables':_0x2c8902,'parameters':_0x3d0c10,'message':_0x44fbd0[_0x394169(0x123)]||_0x44fbd0[_0x394169(0x11f)]+_0x394169(0x122)};if(_0x44fbd0[_0x394169(0x11f)]==='UNKNOWN')return{'valid':![],'sqlType':_0x44fbd0,'tables':_0x2c8902,'parameters':_0x3d0c10,'message':_0x394169(0x118)};return{'valid':!![],'sqlType':_0x44fbd0,'tables':_0x2c8902,'parameters':_0x3d0c10,'message':_0x44fbd0[_0x394169(0x11f)]+_0x394169(0x121)+(_0x2c8902[_0x394169(0x120)]?_0x2c8902[_0x394169(0x138)](',\x20'):_0x394169(0x11c))+(_0x3d0c10['length']?'\x20with\x20parameters:\x20'+_0x3d0c10['join'](',\x20'):'')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a94_0x5347(_0x4c060e,_0x26f605){_0x4c060e=_0x4c060e-0x1ac;const _0x2b0842=a94_0x2b08();let _0x5347e2=_0x2b0842[_0x4c060e];return _0x5347e2;}(function(_0x2ec9d9,_0x525027){const _0x5451ac=a94_0x5347,_0x1e87af=_0x2ec9d9();while(!![]){try{const _0x4b5686=parseInt(_0x5451ac(0x1ca))/0x1+-parseInt(_0x5451ac(0x1b5))/0x2+-parseInt(_0x5451ac(0x1ba))/0x3+parseInt(_0x5451ac(0x1b7))/0x4*(parseInt(_0x5451ac(0x1ac))/0x5)+parseInt(_0x5451ac(0x1b2))/0x6*(parseInt(_0x5451ac(0x1bf))/0x7)+-parseInt(_0x5451ac(0x1c9))/0x8*(parseInt(_0x5451ac(0x1bb))/0x9)+-parseInt(_0x5451ac(0x1cb))/0xa*(-parseInt(_0x5451ac(0x1b8))/0xb);if(_0x4b5686===_0x525027)break;else _0x1e87af['push'](_0x1e87af['shift']());}catch(_0x529744){_0x1e87af['push'](_0x1e87af['shift']());}}}(a94_0x2b08,0x1ef6d));import{existsSync}from'node:fs';function a94_0x2b08(){const _0x2dd16f=['11485RqmvnL','\x22\x20already\x20exists','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','resolve','env','√\x20Login\x20status:\x20','294BCgNvM','Project\x20name\x20cannot\x20exceed\x2050\x20characters','cwd','428806nsZoBL','length','404JHjxEm','33mBqBHy','Logged\x20in','227943mIGotf','1170gUgPIM','test','log','green','7987pJOMOt','Directory\x20\x22','Project\x20name:','Not\x20set','cyan','trim','Login\x20failed','my-app','√\x20App\x20Code:\x20','production','1200YmIKjq','109006Palfoq','132670SnoYGr'];a94_0x2b08=function(){return _0x2dd16f;};return a94_0x2b08();}import a94_0x83ff1 from'node:path';import a94_0x5d5097 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';import{selectSingleAppcode}from'../commands/common/app-selector.js';export async function guidedCreateProject(_0x3b2c00,_0x47a3cd,_0x69494b){const _0x181886=a94_0x5347,_0xef629e=_0x181886(0x1c6),_0xc2ccb9=readConfig(),_0x21aa61=typeof _0xc2ccb9[_0x181886(0x1b0)]==='string'?_0xc2ccb9[_0x181886(0x1b0)]:undefined,_0x16b6e9=await input({'message':_0x181886(0x1c1),'default':_0xef629e,'validate':_0x1f7832=>{const _0x494ddc=_0x181886,_0x447c08=_0x1f7832[_0x494ddc(0x1c4)]()||_0xef629e;if(_0x447c08[_0x494ddc(0x1b6)]>0x32)return _0x494ddc(0x1b3);const _0x371070=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x447c08&&!_0x371070[_0x494ddc(0x1bc)](_0x447c08))return _0x494ddc(0x1ae);const _0x5bc859=a94_0x83ff1[_0x494ddc(0x1af)](process[_0x494ddc(0x1b4)](),_0x447c08);if(existsSync(_0x5bc859))return _0x494ddc(0x1c0)+_0x447c08+_0x494ddc(0x1ad);return!![];}});console[_0x181886(0x1bd)](a94_0x5d5097[_0x181886(0x1be)]('√\x20Project\x20Name:\x20'+a94_0x5d5097[_0x181886(0x1c3)](_0x16b6e9)));const _0x1f1eba=await selectSingleAppcode(_0x69494b);console['log'](a94_0x5d5097['green'](_0x181886(0x1c7)+a94_0x5d5097[_0x181886(0x1c3)](_0x1f1eba||_0x181886(0x1c2))));if(_0x1f1eba){const _0xa62e52=await getIsSessionValid();if(!_0xa62e52){const _0x574835=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x574835){const _0x3c4259=await authServer({'silent':!![]});console[_0x181886(0x1bd)](a94_0x5d5097[_0x181886(0x1be)](_0x181886(0x1b1)+a94_0x5d5097['cyan'](_0x3c4259?_0x181886(0x1b9):_0x181886(0x1c5))));}else console[_0x181886(0x1bd)](a94_0x5d5097['green'](_0x181886(0x1b1)+a94_0x5d5097[_0x181886(0x1c3)]('Skipped')));}await _0x3b2c00({'projectName':_0x16b6e9,'appCode':_0x1f1eba,'env':_0x47a3cd||_0x21aa61||_0x181886(0x1c8)});}else await _0x3b2c00({'projectName':_0x16b6e9,'env':_0x47a3cd||_0x21aa61||'production'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4da4b5,_0xf62aee){const _0x505317=a95_0x2a77,_0x2aace1=_0x4da4b5();while(!![]){try{const _0x4b3186=parseInt(_0x505317(0x72))/0x1*(parseInt(_0x505317(0x76))/0x2)+-parseInt(_0x505317(0x6e))/0x3+parseInt(_0x505317(0x75))/0x4*(parseInt(_0x505317(0x70))/0x5)+parseInt(_0x505317(0x74))/0x6*(-parseInt(_0x505317(0x7a))/0x7)+parseInt(_0x505317(0x73))/0x8*(-parseInt(_0x505317(0x78))/0x9)+parseInt(_0x505317(0x6f))/0xa*(-parseInt(_0x505317(0x71))/0xb)+parseInt(_0x505317(0x77))/0xc*(parseInt(_0x505317(0x79))/0xd);if(_0x4b3186===_0xf62aee)break;else _0x2aace1['push'](_0x2aace1['shift']());}catch(_0xb71c7a){_0x2aace1['push'](_0x2aace1['shift']());}}}(a95_0x5e75,0x6368f));function a95_0x2a77(_0x523668,_0x1da3f0){_0x523668=_0x523668-0x6e;const _0x5e75b6=a95_0x5e75();let _0x2a77f5=_0x5e75b6[_0x523668];return _0x2a77f5;}export function formatElapsed(_0x2e09d0){const _0xc4099f=a95_0x2a77,_0x24c42e=Date['now']()-_0x2e09d0;if(_0x24c42e<0x3e8)return _0x24c42e+'ms';const _0x19d9d6=(_0x24c42e/0x3e8)[_0xc4099f(0x7c)](0x2),_0x474b5b=_0x19d9d6[_0xc4099f(0x7b)](/\.?0+$/u,'');return _0x474b5b+'s';}function a95_0x5e75(){const _0x3eb547=['10FkSNDL','10aaMHfn','3957987quEEml','4AhrHBd','72544rWYHNR','797736UjcUkg','1483252vRcOar','3094LSSLhS','565188vppMfU','369GDqhps','403egTYaK','28XXrIkr','replace','toFixed','1611813HxhQxU'];a95_0x5e75=function(){return _0x3eb547;};return a95_0x5e75();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a97_0x27d6(_0x11fb11,_0x12d7c0){_0x11fb11=_0x11fb11-0x183;const _0x50ed47=a97_0x50ed();let _0x27d6db=_0x50ed47[_0x11fb11];return _0x27d6db;}(function(_0x461ba3,_0x238e9e){const _0x1f8a33=a97_0x27d6,_0x33e3e7=_0x461ba3();while(!![]){try{const _0x2c9c3c=parseInt(_0x1f8a33(0x186))/0x1+-parseInt(_0x1f8a33(0x19d))/0x2+parseInt(_0x1f8a33(0x1a6))/0x3*(parseInt(_0x1f8a33(0x1c7))/0x4)+-parseInt(_0x1f8a33(0x1a7))/0x5+parseInt(_0x1f8a33(0x1cd))/0x6*(-parseInt(_0x1f8a33(0x1ac))/0x7)+parseInt(_0x1f8a33(0x19b))/0x8+parseInt(_0x1f8a33(0x1c1))/0x9;if(_0x2c9c3c===_0x238e9e)break;else _0x33e3e7['push'](_0x33e3e7['shift']());}catch(_0x4b3f86){_0x33e3e7['push'](_0x33e3e7['shift']());}}}(a97_0x50ed,0x7ac12));import a97_0x1fe3eb from'path';import a97_0x111a94 from'fs';import{fileURLToPath}from'node:url';import a97_0x3ef1a5 from'chalk';import a97_0xa8bff6 from'ora';import{guidedCreateProject}from'./enhanced-guided-create.js';import{fetchModelList}from'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';function a97_0x50ed(){const _0x2abe15=['rmSync','existsSync','更新\x20package.json\x20name','\x20&&\x20rabetbase\x20run\x20start','projectName','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','string','repeat','readFileSync','Project\x20name:\x20','test','appCode','length','join','production','W_OK','6327288XhrFUW','dirname','parse','info','warn','1.0.0','126124byyxBj','cyan','cookie','constants','description','stop','2508816sKnxGR','\x20\x202.\x20Pull\x20API\x20configuration:\x20','gray','writeFileSync','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','projectCode','utf8','log','API\x20配置拉取异常','setLogPath','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27rabetbase\x20config\x20set\x20appcode\x20<app-code>\x27','API\x20configuration\x20pulled:\x20','500970LeVBjp','error','项目创建完成:\x20','Install\x20dependencies','resolve','toLocaleString','env','Project\x20name\x20cannot\x20be\x20empty','start','chdir','Copy\x20project\x20files','create','package.json','开始创建项目:\x20','success','green','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','name','\x20√\x20','更新\x20package.json\x20失败','message','4207944KMlBbo','bold','1543552BqEVGt','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','\x20dataset(s),\x20generated\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','fail','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','项目创建失败:\x20','trim','\x20Generated\x20by\x20rabetbase\x20cli\x20','54BIwvJG','3024195Klqprv','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','./src/api/','cwd','🚀\x20Next\x20Steps:','7oUVHMx','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','needsUpgrade','../..','Format\x20code'];a97_0x50ed=function(){return _0x2abe15;};return a97_0x50ed();}import{readConfig}from'../utils/config.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{copyProjectTemplate}from'./use-copy-project-template.js';import{installDependencies}from'./use-install-dependencies.js';import{formatProjectCode}from'./use-format-code.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{selectSingleAppcode}from'../commands/common/app-selector.js';export async function createApp(_0x536eab){const _0x3480f5=a97_0x27d6,_0x3c72f6=await checkCliVersion();_0x3c72f6[_0x3480f5(0x1ae)]&&(printCliUpgradeWarning(_0x3c72f6),logger['info']('create','CLI\x20版本检查',{'currentVersion':_0x3c72f6['currentVersion'],'stableVersion':_0x3c72f6['stableVersion'],'needsUpgrade':_0x3c72f6['needsUpgrade']}));if(_0x536eab[_0x3480f5(0x1d2)]&&_0x536eab[_0x3480f5(0x1bc)])await runCreate({'projectName':_0x536eab['projectCode'],'appCode':_0x536eab[_0x3480f5(0x1bc)],'env':_0x536eab[_0x3480f5(0x18c)]},_0x536eab);else{if(_0x536eab[_0x3480f5(0x1d2)]){const _0x2a7cc9=await selectSingleAppcode(_0x536eab[_0x3480f5(0x1c9)]);await runCreate({'projectName':_0x536eab[_0x3480f5(0x1d2)],'appCode':_0x2a7cc9||undefined,'env':_0x536eab[_0x3480f5(0x18c)]},_0x536eab);}else await guidedCreateProject(_0x3177a8=>runCreate(_0x3177a8,_0x536eab),_0x536eab[_0x3480f5(0x18c)],_0x536eab[_0x3480f5(0x1c9)]);}}async function runCreate(_0x3b18a0,_0x1a49a5){const _0x4a99e7=a97_0x27d6;if(!_0x3b18a0[_0x4a99e7(0x1b5)]||_0x3b18a0[_0x4a99e7(0x1b5)][_0x4a99e7(0x1a4)]()==='')throw new Error(_0x4a99e7(0x18d));const _0x51f74f=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x51f74f[_0x4a99e7(0x1bb)](_0x3b18a0[_0x4a99e7(0x1b5)]))throw new Error(_0x4a99e7(0x196));if(_0x3b18a0['projectName'][_0x4a99e7(0x1bd)]>0x64)throw new Error(_0x4a99e7(0x1b6));const _0x4885d1=a97_0x1fe3eb[_0x4a99e7(0x18a)](process[_0x4a99e7(0x1aa)](),_0x3b18a0[_0x4a99e7(0x1b5)]);if(a97_0x111a94['existsSync'](_0x4885d1))throw new Error('Project\x20directory\x20'+_0x3b18a0[_0x4a99e7(0x1b5)]+'\x20already\x20exists');try{a97_0x111a94['accessSync'](a97_0x1fe3eb[_0x4a99e7(0x1c2)](_0x4885d1),a97_0x111a94[_0x4a99e7(0x1ca)][_0x4a99e7(0x1c0)]);}catch{throw new Error(_0x4a99e7(0x1a8));}logger[_0x4a99e7(0x183)](_0x4885d1),logger['info'](_0x4a99e7(0x191),_0x4a99e7(0x193)+_0x3b18a0[_0x4a99e7(0x1b5)],{'projectDir':_0x4885d1,'appCode':_0x3b18a0[_0x4a99e7(0x1bc)]}),console[_0x4a99e7(0x1d4)](),console['log'](a97_0x3ef1a5[_0x4a99e7(0x195)]('\x20√\x20')+_0x4a99e7(0x1ba)+a97_0x3ef1a5[_0x4a99e7(0x195)](_0x3b18a0[_0x4a99e7(0x1b5)])+(_0x3b18a0[_0x4a99e7(0x1bc)]?'\x20|\x20AppCode:\x20'+a97_0x3ef1a5[_0x4a99e7(0x1c8)](_0x3b18a0[_0x4a99e7(0x1bc)]):''));try{await runTask(_0x4a99e7(0x190),()=>copyProjectTemplate(_0x3b18a0[_0x4a99e7(0x1b5)])),await updatePackageJsonName(_0x3b18a0[_0x4a99e7(0x1b5)]),await runTask(_0x4a99e7(0x189),()=>installDependencies(_0x3b18a0[_0x4a99e7(0x1b5)])),await runTask(_0x4a99e7(0x1b0),()=>formatProjectCode(_0x3b18a0[_0x4a99e7(0x1b5)])),await configureAppCode(_0x3b18a0[_0x4a99e7(0x1b5)],_0x3b18a0[_0x4a99e7(0x1bc)]||'',_0x3b18a0['env']);let _0x31917f=![];if(_0x3b18a0[_0x4a99e7(0x1bc)]){console['log']('*\x20Pulling\x20API\x20configuration...');const _0x4aebcd=process[_0x4a99e7(0x1aa)]();try{process[_0x4a99e7(0x18f)](_0x4885d1);const _0x556020=_0x3b18a0[_0x4a99e7(0x18c)]||_0x4a99e7(0x1bf);initEnv(_0x556020);const {configArray:_0x31dc12}=await fetchModelList(_0x3b18a0['appCode'],_0x1a49a5['cookie']||''),_0x52f748=_0x4a99e7(0x1a9),_0x7c7a2a=await generateApiFile(_0x31dc12,'',_0x3b18a0['appCode'],!![],_0x556020,_0x52f748);console[_0x4a99e7(0x1d4)]('√\x20Pulled\x20'+_0x31dc12[_0x4a99e7(0x1bd)]+_0x4a99e7(0x19f)+_0x7c7a2a['modelCount']+'\x20model(s)'),logger[_0x4a99e7(0x1c4)]('create',_0x4a99e7(0x185)+_0x3b18a0[_0x4a99e7(0x1bc)]);}catch(_0x4dc85f){_0x31917f=!![],console[_0x4a99e7(0x1d4)](_0x4a99e7(0x1d1)),logger['warn'](_0x4a99e7(0x191),_0x4a99e7(0x1d5),{'error':_0x4dc85f instanceof Error?_0x4dc85f[_0x4a99e7(0x19a)]:String(_0x4dc85f)});}finally{process[_0x4a99e7(0x18f)](_0x4aebcd);}}logger[_0x4a99e7(0x194)](_0x4a99e7(0x191),_0x4a99e7(0x188)+_0x3b18a0[_0x4a99e7(0x1b5)]),console[_0x4a99e7(0x1d4)](),console[_0x4a99e7(0x1d4)](a97_0x3ef1a5['green']('─'[_0x4a99e7(0x1b8)](0x3c))),console[_0x4a99e7(0x1d4)](a97_0x3ef1a5[_0x4a99e7(0x1c8)][_0x4a99e7(0x19c)](_0x4a99e7(0x1ab))),console[_0x4a99e7(0x1d4)](),console[_0x4a99e7(0x1d4)]('\x20\x201.\x20Start\x20project:\x20'+a97_0x3ef1a5['cyan'][_0x4a99e7(0x19c)]('cd\x20'+_0x3b18a0['projectName']+_0x4a99e7(0x1b4))),_0x31917f&&console[_0x4a99e7(0x1d4)](_0x4a99e7(0x1ce)+a97_0x3ef1a5[_0x4a99e7(0x1c8)][_0x4a99e7(0x19c)]('rabetbase\x20api\x20pull')),console[_0x4a99e7(0x1d4)](a97_0x3ef1a5[_0x4a99e7(0x195)]('─'[_0x4a99e7(0x1b8)](0x3c)));}catch(_0x301b26){logger[_0x4a99e7(0x187)](_0x4a99e7(0x191),_0x4a99e7(0x1a3)+_0x3b18a0['projectName'],{'error':_0x301b26 instanceof Error?_0x301b26[_0x4a99e7(0x19a)]:String(_0x301b26)});try{a97_0x111a94[_0x4a99e7(0x1b2)](_0x4885d1)&&(console[_0x4a99e7(0x1d4)](_0x4a99e7(0x1a0)+_0x4885d1),a97_0x111a94[_0x4a99e7(0x1b1)](_0x4885d1,{'recursive':!![],'force':!![]}));}catch{logger[_0x4a99e7(0x1c5)](_0x4a99e7(0x191),'清理项目目录失败:\x20'+_0x4885d1);}throw _0x301b26;}}async function runTask(_0x2fea42,_0x33c585){const _0x8b71dd=a97_0x27d6,_0x4ca832=a97_0xa8bff6(_0x2fea42+'...')[_0x8b71dd(0x18e)]();try{const _0x53270c=await _0x33c585();_0x4ca832[_0x8b71dd(0x1cc)](),console[_0x8b71dd(0x1d4)](''+a97_0x3ef1a5[_0x8b71dd(0x195)](_0x8b71dd(0x198))+_0x2fea42+'\x20'+a97_0x3ef1a5[_0x8b71dd(0x1cf)]('['+_0x53270c+']'));}catch(_0x481049){_0x4ca832[_0x8b71dd(0x1a1)](_0x2fea42);throw _0x481049;}}async function updatePackageJsonName(_0x53c705){const _0xa21c08=a97_0x27d6,_0x30d662=a97_0x1fe3eb[_0xa21c08(0x18a)](process[_0xa21c08(0x1aa)](),_0x53c705),_0x323bd3=a97_0x1fe3eb[_0xa21c08(0x1be)](_0x30d662,_0xa21c08(0x192));try{console[_0xa21c08(0x1d4)](_0xa21c08(0x1a2));const _0x53ce87=fileURLToPath(import.meta.url),_0x58a9cb=a97_0x1fe3eb[_0xa21c08(0x18a)](a97_0x1fe3eb[_0xa21c08(0x1c2)](_0x53ce87),_0xa21c08(0x1af)),_0x234c69=a97_0x1fe3eb[_0xa21c08(0x1be)](_0x58a9cb,_0xa21c08(0x192));let _0x1082da=_0xa21c08(0x1c6);try{const _0x330f7f=JSON['parse'](a97_0x111a94[_0xa21c08(0x1b9)](_0x234c69,'utf8'));_0x1082da=_0x330f7f['version']||'1.0.0';}catch{}const _0x55a327=a97_0x111a94[_0xa21c08(0x1b9)](_0x323bd3,'utf8'),_0x5603b9=JSON[_0xa21c08(0x1c3)](_0x55a327);_0x5603b9[_0xa21c08(0x197)]=_0x53c705,_0x5603b9[_0xa21c08(0x1cb)]=_0x53c705+_0xa21c08(0x1a5)+_0x1082da,a97_0x111a94[_0xa21c08(0x1d0)](_0x323bd3,JSON['stringify'](_0x5603b9,null,0x2)+'\x0a',_0xa21c08(0x1d3)),console[_0xa21c08(0x1d4)]('√\x20package.json\x20updated:\x20name='+_0x53c705),logger[_0xa21c08(0x1c4)](_0xa21c08(0x191),_0xa21c08(0x1b3));}catch(_0x4483f6){logger[_0xa21c08(0x187)](_0xa21c08(0x191),_0xa21c08(0x199));throw _0x4483f6;}}async function configureAppCode(_0x524112,_0x7f625a,_0xf153cb){const _0x5c9495=a97_0x27d6,_0x431269=a97_0x1fe3eb[_0x5c9495(0x18a)](process['cwd'](),_0x524112),_0x2f77a4=a97_0x1fe3eb['join'](_0x431269,NEW_CONFIG_NAME);try{_0x7f625a?console['log']('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x524112+':\x20'+_0x7f625a):console[_0x5c9495(0x1d4)](_0x5c9495(0x19e)+_0x524112);const _0x4b7503=fileURLToPath(import.meta.url),_0x364fa6=a97_0x1fe3eb[_0x5c9495(0x18a)](a97_0x1fe3eb[_0x5c9495(0x1c2)](_0x4b7503),_0x5c9495(0x1af)),_0x5d482e=a97_0x1fe3eb[_0x5c9495(0x1be)](_0x364fa6,_0x5c9495(0x192));let _0x39b554=_0x5c9495(0x1c6);try{const _0x7f9166=JSON[_0x5c9495(0x1c3)](a97_0x111a94[_0x5c9495(0x1b9)](_0x5d482e,_0x5c9495(0x1d3)));_0x39b554=_0x7f9166['version']||_0x5c9495(0x1c6);}catch{}const _0x5191fa=readConfig(),_0x407e6f=typeof _0x5191fa[_0x5c9495(0x18c)]===_0x5c9495(0x1b7)?_0x5191fa[_0x5c9495(0x18c)]:undefined,{app:_0x579268,appcode:_0x5ae8a2,..._0x7e378d}=_0x5191fa,_0x58bcce={..._0x7e378d,'appcode':_0x7f625a||'','env':_0xf153cb||_0x407e6f||'production','createdAt':new Date()[_0x5c9495(0x18b)](),'version':_0x39b554};writeConfigFile(_0x2f77a4,_0x58bcce),_0x7f625a?console['log'](_0x5c9495(0x1ad)+_0x7f625a):console['log'](_0x5c9495(0x184)),logger[_0x5c9495(0x1c4)]('create','配置应用AppCode:\x20'+_0x7f625a);}catch(_0x7adf56){logger[_0x5c9495(0x187)](_0x5c9495(0x191),'配置应用AppCode失败');}}
|
|
1
|
+
(function(_0xa0667f,_0x26c2e8){const _0x21df6c=a96_0x2adb,_0x2aff3f=_0xa0667f();while(!![]){try{const _0x555809=parseInt(_0x21df6c(0x16b))/0x1+-parseInt(_0x21df6c(0x14f))/0x2*(parseInt(_0x21df6c(0x18b))/0x3)+parseInt(_0x21df6c(0x192))/0x4*(parseInt(_0x21df6c(0x157))/0x5)+parseInt(_0x21df6c(0x178))/0x6+parseInt(_0x21df6c(0x184))/0x7*(parseInt(_0x21df6c(0x17f))/0x8)+-parseInt(_0x21df6c(0x179))/0x9*(-parseInt(_0x21df6c(0x19a))/0xa)+-parseInt(_0x21df6c(0x14b))/0xb;if(_0x555809===_0x26c2e8)break;else _0x2aff3f['push'](_0x2aff3f['shift']());}catch(_0x1ac460){_0x2aff3f['push'](_0x2aff3f['shift']());}}}(a96_0x4abc,0x2d820));import a96_0x90dcf2 from'path';import a96_0x5128cc from'fs';import{fileURLToPath}from'node:url';import a96_0x42b0cd from'chalk';import a96_0x266cd7 from'ora';import{guidedCreateProject}from'./enhanced-guided-create.js';import{fetchModelList}from'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';function a96_0x2adb(_0x339105,_0x420cd3){_0x339105=_0x339105-0x13c;const _0x4abc47=a96_0x4abc();let _0x2adbd4=_0x4abc47[_0x339105];return _0x2adbd4;}import{readConfig}from'../utils/config.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{copyProjectTemplate}from'./use-copy-project-template.js';import{installDependencies}from'./use-install-dependencies.js';import{formatProjectCode}from'./use-format-code.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{selectSingleAppcode}from'../commands/common/app-selector.js';export async function createApp(_0x4d13f9){const _0x37f01a=a96_0x2adb,_0x40206e=await checkCliVersion();_0x40206e['needsUpgrade']&&(printCliUpgradeWarning(_0x40206e),logger[_0x37f01a(0x15f)](_0x37f01a(0x148),_0x37f01a(0x166),{'currentVersion':_0x40206e[_0x37f01a(0x189)],'stableVersion':_0x40206e[_0x37f01a(0x188)],'needsUpgrade':_0x40206e['needsUpgrade']}));if(_0x4d13f9[_0x37f01a(0x144)]&&_0x4d13f9['appCode'])await runCreate({'projectName':_0x4d13f9['projectCode'],'appCode':_0x4d13f9['appCode'],'env':_0x4d13f9['env']},_0x4d13f9);else{if(_0x4d13f9[_0x37f01a(0x144)]){const _0x3c7ab3=await selectSingleAppcode(_0x4d13f9[_0x37f01a(0x155)]);await runCreate({'projectName':_0x4d13f9[_0x37f01a(0x144)],'appCode':_0x3c7ab3||undefined,'env':_0x4d13f9[_0x37f01a(0x17e)]},_0x4d13f9);}else await guidedCreateProject(_0x1d4f75=>runCreate(_0x1d4f75,_0x4d13f9),_0x4d13f9[_0x37f01a(0x17e)],_0x4d13f9[_0x37f01a(0x155)]);}}async function runCreate(_0x14db7f,_0x6c8db6){const _0x38cc30=a96_0x2adb;if(!_0x14db7f[_0x38cc30(0x13d)]||_0x14db7f[_0x38cc30(0x13d)][_0x38cc30(0x158)]()==='')throw new Error(_0x38cc30(0x13e));const _0x4cf9ab=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4cf9ab[_0x38cc30(0x141)](_0x14db7f[_0x38cc30(0x13d)]))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x14db7f[_0x38cc30(0x13d)][_0x38cc30(0x13c)]>0x64)throw new Error(_0x38cc30(0x181));const _0x13cacc=a96_0x90dcf2[_0x38cc30(0x161)](process[_0x38cc30(0x185)](),_0x14db7f[_0x38cc30(0x13d)]);if(a96_0x5128cc[_0x38cc30(0x168)](_0x13cacc))throw new Error(_0x38cc30(0x164)+_0x14db7f[_0x38cc30(0x13d)]+_0x38cc30(0x13f));try{a96_0x5128cc[_0x38cc30(0x15b)](a96_0x90dcf2[_0x38cc30(0x16c)](_0x13cacc),a96_0x5128cc[_0x38cc30(0x156)]['W_OK']);}catch{throw new Error(_0x38cc30(0x159));}logger['setLogPath'](_0x13cacc),logger['info'](_0x38cc30(0x148),_0x38cc30(0x151)+_0x14db7f[_0x38cc30(0x13d)],{'projectDir':_0x13cacc,'appCode':_0x14db7f[_0x38cc30(0x15e)]}),console['log'](),console[_0x38cc30(0x14a)](a96_0x42b0cd[_0x38cc30(0x163)](_0x38cc30(0x160))+'Project\x20name:\x20'+a96_0x42b0cd[_0x38cc30(0x163)](_0x14db7f[_0x38cc30(0x13d)])+(_0x14db7f[_0x38cc30(0x15e)]?_0x38cc30(0x17b)+a96_0x42b0cd[_0x38cc30(0x170)](_0x14db7f['appCode']):''));try{await runTask(_0x38cc30(0x199),()=>copyProjectTemplate(_0x14db7f[_0x38cc30(0x13d)])),await updatePackageJsonName(_0x14db7f[_0x38cc30(0x13d)]),await runTask(_0x38cc30(0x16e),()=>installDependencies(_0x14db7f['projectName'])),await runTask(_0x38cc30(0x162),()=>formatProjectCode(_0x14db7f['projectName'])),await configureAppCode(_0x14db7f[_0x38cc30(0x13d)],_0x14db7f[_0x38cc30(0x15e)]||'',_0x14db7f[_0x38cc30(0x17e)]);let _0x3b9b7d=![];if(_0x14db7f[_0x38cc30(0x15e)]){console[_0x38cc30(0x14a)](_0x38cc30(0x173));const _0x569122=process[_0x38cc30(0x185)]();try{process['chdir'](_0x13cacc);const _0x21abcc=_0x14db7f[_0x38cc30(0x17e)]||_0x38cc30(0x17d);initEnv(_0x21abcc);const {configArray:_0x341279}=await fetchModelList(_0x14db7f[_0x38cc30(0x15e)],_0x6c8db6[_0x38cc30(0x155)]||''),_0x332acc=_0x38cc30(0x15c),_0x477c35=await generateApiFile(_0x341279,'',_0x14db7f[_0x38cc30(0x15e)],!![],_0x21abcc,_0x332acc);console['log'](_0x38cc30(0x171)+_0x341279[_0x38cc30(0x13c)]+_0x38cc30(0x18a)+_0x477c35[_0x38cc30(0x183)]+'\x20model(s)'),logger['info']('create',_0x38cc30(0x186)+_0x14db7f[_0x38cc30(0x15e)]);}catch(_0x428932){_0x3b9b7d=!![],console[_0x38cc30(0x14a)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger[_0x38cc30(0x176)](_0x38cc30(0x148),_0x38cc30(0x190),{'error':_0x428932 instanceof Error?_0x428932[_0x38cc30(0x16f)]:String(_0x428932)});}finally{process[_0x38cc30(0x18d)](_0x569122);}}logger[_0x38cc30(0x145)](_0x38cc30(0x148),_0x38cc30(0x177)+_0x14db7f['projectName']),console[_0x38cc30(0x14a)](),console['log'](a96_0x42b0cd[_0x38cc30(0x163)]('─'[_0x38cc30(0x193)](0x3c))),console['log'](a96_0x42b0cd['cyan'][_0x38cc30(0x143)](_0x38cc30(0x196))),console[_0x38cc30(0x14a)](),console[_0x38cc30(0x14a)](_0x38cc30(0x16a)+a96_0x42b0cd['cyan']['bold']('cd\x20'+_0x14db7f[_0x38cc30(0x13d)]+'\x20&&\x20'+CLI_BIN_NAME+_0x38cc30(0x140))),_0x3b9b7d&&console[_0x38cc30(0x14a)](_0x38cc30(0x194)+a96_0x42b0cd[_0x38cc30(0x170)][_0x38cc30(0x143)](CLI_BIN_NAME+'\x20api\x20pull')),console['log'](a96_0x42b0cd[_0x38cc30(0x163)]('─'['repeat'](0x3c)));}catch(_0x134852){logger[_0x38cc30(0x167)](_0x38cc30(0x148),_0x38cc30(0x197)+_0x14db7f['projectName'],{'error':_0x134852 instanceof Error?_0x134852[_0x38cc30(0x16f)]:String(_0x134852)});try{a96_0x5128cc[_0x38cc30(0x168)](_0x13cacc)&&(console[_0x38cc30(0x14a)](_0x38cc30(0x142)+_0x13cacc),a96_0x5128cc[_0x38cc30(0x198)](_0x13cacc,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x38cc30(0x148),_0x38cc30(0x180)+_0x13cacc);}throw _0x134852;}}function a96_0x4abc(){const _0x2a4ce2=['Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','version','modelCount','175nwNbEL','cwd','API\x20configuration\x20pulled:\x20','配置应用AppCode:\x20','stableVersion','currentVersion','\x20dataset(s),\x20generated\x20','432ojqgaC','1.0.0','chdir','stringify','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','API\x20配置拉取异常','join','30644gZqTnj','repeat','\x20\x202.\x20Pull\x20API\x20configuration:\x20','utf8','🚀\x20Next\x20Steps:','项目创建失败:\x20','rmSync','Copy\x20project\x20files','20OIFQIz','length','projectName','Project\x20name\x20cannot\x20be\x20empty','\x20already\x20exists','\x20run\x20start','test','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','bold','projectCode','success','toLocaleString','*\x20Configuring\x20AppCode\x20for\x20project\x20','create','配置应用AppCode失败','log','7449530ASMnGP','更新\x20package.json\x20name','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','start','4388VwmLRP','readFileSync','开始创建项目:\x20','gray','\x20Generated\x20by\x20rabetbase\x20cli\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','cookie','constants','185MDcVNV','trim','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','package.json','accessSync','./src/api/','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','appCode','info','\x20√\x20','resolve','Format\x20code','green','Project\x20directory\x20','description','CLI\x20版本检查','error','existsSync','stop','\x20\x201.\x20Start\x20project:\x20','288505xYxYXo','dirname','fail','Install\x20dependencies','message','cyan','√\x20Pulled\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','*\x20Pulling\x20API\x20configuration...','../..','parse','warn','项目创建完成:\x20','29898VHZSCD','1213407KlTFhQ','name','\x20|\x20AppCode:\x20','√\x20package.json\x20updated:\x20name=','production','env','106552MyjTxU','清理项目目录失败:\x20'];a96_0x4abc=function(){return _0x2a4ce2;};return a96_0x4abc();}async function runTask(_0x41c6a4,_0x24ca17){const _0x4c324f=a96_0x2adb,_0x24ef0d=a96_0x266cd7(_0x41c6a4+'...')[_0x4c324f(0x14e)]();try{const _0x25182c=await _0x24ca17();_0x24ef0d[_0x4c324f(0x169)](),console[_0x4c324f(0x14a)](''+a96_0x42b0cd[_0x4c324f(0x163)]('\x20√\x20')+_0x41c6a4+'\x20'+a96_0x42b0cd[_0x4c324f(0x152)]('['+_0x25182c+']'));}catch(_0x5730ef){_0x24ef0d[_0x4c324f(0x16d)](_0x41c6a4);throw _0x5730ef;}}async function updatePackageJsonName(_0x74911c){const _0x19cbbd=a96_0x2adb,_0x3ff378=a96_0x90dcf2[_0x19cbbd(0x161)](process[_0x19cbbd(0x185)](),_0x74911c),_0x308570=a96_0x90dcf2[_0x19cbbd(0x191)](_0x3ff378,'package.json');try{console[_0x19cbbd(0x14a)](_0x19cbbd(0x14d));const _0x24631e=fileURLToPath(import.meta.url),_0x3728cf=a96_0x90dcf2[_0x19cbbd(0x161)](a96_0x90dcf2[_0x19cbbd(0x16c)](_0x24631e),_0x19cbbd(0x174)),_0x1ff146=a96_0x90dcf2['join'](_0x3728cf,_0x19cbbd(0x15a));let _0x21ce29=_0x19cbbd(0x18c);try{const _0x398f6f=JSON[_0x19cbbd(0x175)](a96_0x5128cc[_0x19cbbd(0x150)](_0x1ff146,_0x19cbbd(0x195)));_0x21ce29=_0x398f6f[_0x19cbbd(0x182)]||_0x19cbbd(0x18c);}catch{}const _0x386198=a96_0x5128cc['readFileSync'](_0x308570,'utf8'),_0x359f59=JSON['parse'](_0x386198);_0x359f59[_0x19cbbd(0x17a)]=_0x74911c,_0x359f59[_0x19cbbd(0x165)]=_0x74911c+_0x19cbbd(0x153)+_0x21ce29,a96_0x5128cc['writeFileSync'](_0x308570,JSON[_0x19cbbd(0x18e)](_0x359f59,null,0x2)+'\x0a',_0x19cbbd(0x195)),console[_0x19cbbd(0x14a)](_0x19cbbd(0x17c)+_0x74911c),logger[_0x19cbbd(0x15f)](_0x19cbbd(0x148),_0x19cbbd(0x14c));}catch(_0x27236e){logger[_0x19cbbd(0x167)](_0x19cbbd(0x148),'更新\x20package.json\x20失败');throw _0x27236e;}}async function configureAppCode(_0x57fd41,_0x177328,_0x421c8a){const _0x340a20=a96_0x2adb,_0x2d3159=a96_0x90dcf2[_0x340a20(0x161)](process[_0x340a20(0x185)](),_0x57fd41),_0x1ace64=a96_0x90dcf2[_0x340a20(0x191)](_0x2d3159,NEW_CONFIG_NAME);try{_0x177328?console[_0x340a20(0x14a)](_0x340a20(0x147)+_0x57fd41+':\x20'+_0x177328):console[_0x340a20(0x14a)](_0x340a20(0x18f)+_0x57fd41);const _0x4fba3e=fileURLToPath(import.meta.url),_0x53ee9f=a96_0x90dcf2['resolve'](a96_0x90dcf2['dirname'](_0x4fba3e),_0x340a20(0x174)),_0x3408f1=a96_0x90dcf2['join'](_0x53ee9f,'package.json');let _0x1276e4='1.0.0';try{const _0x281292=JSON[_0x340a20(0x175)](a96_0x5128cc['readFileSync'](_0x3408f1,'utf8'));_0x1276e4=_0x281292[_0x340a20(0x182)]||_0x340a20(0x18c);}catch{}const _0x28fbc9=readConfig(),_0x29d6f4=typeof _0x28fbc9[_0x340a20(0x17e)]==='string'?_0x28fbc9['env']:undefined,{app:_0x53e03a,appcode:_0x2df9cf,..._0x413372}=_0x28fbc9,_0x311c0e={..._0x413372,'appcode':_0x177328||'','env':_0x421c8a||_0x29d6f4||_0x340a20(0x17d),'createdAt':new Date()[_0x340a20(0x146)](),'version':_0x1276e4};writeConfigFile(_0x1ace64,_0x311c0e),_0x177328?console[_0x340a20(0x14a)](_0x340a20(0x15d)+_0x177328):console['log'](_0x340a20(0x154)+CLI_BIN_NAME+_0x340a20(0x172)),logger['info'](_0x340a20(0x148),_0x340a20(0x187)+_0x177328);}catch(_0x52e756){logger[_0x340a20(0x167)]('create',_0x340a20(0x149));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a97_0x4452(_0x311dcb,_0x294fec){_0x311dcb=_0x311dcb-0x193;const _0x15883a=a97_0x1588();let _0x44522c=_0x15883a[_0x311dcb];return _0x44522c;}(function(_0x3dcb93,_0x3881ae){const _0x13343d=a97_0x4452,_0xe680de=_0x3dcb93();while(!![]){try{const _0x5077cf=parseInt(_0x13343d(0x1bc))/0x1*(-parseInt(_0x13343d(0x1d3))/0x2)+parseInt(_0x13343d(0x196))/0x3*(-parseInt(_0x13343d(0x1ab))/0x4)+-parseInt(_0x13343d(0x1d0))/0x5+-parseInt(_0x13343d(0x1b3))/0x6*(parseInt(_0x13343d(0x1b9))/0x7)+parseInt(_0x13343d(0x1b0))/0x8+-parseInt(_0x13343d(0x194))/0x9+parseInt(_0x13343d(0x1b4))/0xa*(parseInt(_0x13343d(0x19d))/0xb);if(_0x5077cf===_0x3881ae)break;else _0xe680de['push'](_0xe680de['shift']());}catch(_0x20b1d3){_0xe680de['push'](_0xe680de['shift']());}}}(a97_0x1588,0x8cb7a));import a97_0x14f5cf from'path';import{fileURLToPath}from'url';import a97_0x2095ca from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../constant/cli.js';function a97_0x1588(){const _0x1f7265=['89092paoNjE','./src/api/','needsUpgrade','trim','*\x20Creating\x20project\x20','3188736rrGHMF','length','\x22\x20already\x20exists.','330vPEOLn','150KPijlD','\x20\x20rabetbase\x20run\x20start\x0a','\x20created\x20successfully!','Project\x20name\x20cannot\x20be\x20empty.','bun\x20run\x20format','99925yWNAVg','\x0a\x20\x20cd\x20','name','1mnhGjM','Project\x20directory\x20\x22','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','W_OK','Check\x20directory\x20permissions.','\x20api\x20pull`\x20manually\x20later.','bun','\x20\x20√\x20Pulled\x20','Use\x20a\x20different\x20project\x20name.','Project\x20name\x20contains\x20invalid\x20characters.','\x0a√\x20Project\x20','constants','utf-8','\x20\x20Installing\x20dependencies...','\x20model(s)','...','resolve','package.json','\x20\x20√\x20Code\x20formatted','validation','2800460uEsVfC','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Cannot\x20create\x20project\x20in\x20current\x20directory.','1315162JCKxoc','modelCount','1303722AxKttp','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','123dKJStq','ignore','readFile','writeFile','dirname','join','parse','2374999QDDJkQ','log','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','\x20dataset(s),\x20generated\x20','cwd','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20Pulling\x20API\x20configuration...','toLocaleString','test','bun\x20--version','production','access','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','chdir'];a97_0x1588=function(){return _0x1f7265;};return a97_0x1588();}import{exec,execSync}from'child_process';import{copyDirectory}from'../utils/copy-directory.js';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{readConfig}from'../utils/config.js';import{getCliVersion}from'../utils/version.js';import{CliErrors}from'../errors.js';import{fetchModelList}from'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';const execAsync=promisify(exec);function getTemplateDir(){const _0x5ea9a8=a97_0x4452,_0x1b8033=fileURLToPath(import.meta.url),_0x45a64c=a97_0x14f5cf[_0x5ea9a8(0x19a)](_0x1b8033);return a97_0x14f5cf['resolve'](_0x45a64c,'../../templates/projects/sub-app-react-demo');}export async function createProjectNonInteractive(_0x4fa746,_0x59ae0c,_0xb22895,_0x224316){const _0x5e0a3c=a97_0x4452,_0x4e6dc6=await checkCliVersion();_0x4e6dc6[_0x5e0a3c(0x1ad)]&&printCliUpgradeWarning(_0x4e6dc6);if(!_0x4fa746||_0x4fa746[_0x5e0a3c(0x1ae)]()==='')throw CliErrors[_0x5e0a3c(0x1cf)](_0x5e0a3c(0x1b7));const _0x31175e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x31175e[_0x5e0a3c(0x1a5)](_0x4fa746))throw CliErrors[_0x5e0a3c(0x1cf)](_0x5e0a3c(0x1c5),_0x5e0a3c(0x1d1));if(_0x4fa746['length']>0x64)throw CliErrors[_0x5e0a3c(0x1cf)](_0x5e0a3c(0x1be));const _0x5ce153=a97_0x14f5cf['resolve'](process[_0x5e0a3c(0x1a1)](),_0x4fa746);if(existsSync(_0x5ce153))throw CliErrors['validation'](_0x5e0a3c(0x1bd)+_0x4fa746+_0x5e0a3c(0x1b2),_0x5e0a3c(0x1c4));try{const _0x49486b=a97_0x14f5cf[_0x5e0a3c(0x19a)](_0x5ce153);await a97_0x2095ca[_0x5e0a3c(0x1a8)](_0x49486b,a97_0x2095ca[_0x5e0a3c(0x1c7)][_0x5e0a3c(0x1bf)]);}catch{throw CliErrors[_0x5e0a3c(0x1cf)](_0x5e0a3c(0x1d2),_0x5e0a3c(0x1c0));}try{console[_0x5e0a3c(0x19e)](_0x5e0a3c(0x1af)+_0x4fa746+_0x5e0a3c(0x1cb));const _0x35e33f=getTemplateDir();await copyDirectory(_0x35e33f,_0x5ce153),console[_0x5e0a3c(0x19e)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x4fa746),console['log']('\x20\x20√\x20package.json\x20updated'),console[_0x5e0a3c(0x19e)](_0x5e0a3c(0x1c9)),console['log'](_0x5e0a3c(0x195)),await formatCode(_0x5ce153),console[_0x5e0a3c(0x19e)](_0x5e0a3c(0x1ce)),await configureProject(_0x4fa746,_0xb22895,_0x59ae0c),console[_0x5e0a3c(0x19e)](_0x5e0a3c(0x1a2)),_0xb22895&&await pullApiConfig(_0x5ce153,_0xb22895,_0x59ae0c,_0x224316),console[_0x5e0a3c(0x19e)](_0x5e0a3c(0x1c6)+_0x4fa746+_0x5e0a3c(0x1b6)),console['log'](_0x5e0a3c(0x1ba)+_0x4fa746),console['log'](_0x5e0a3c(0x1b5));}catch(_0x488712){try{existsSync(_0x5ce153)&&await a97_0x2095ca['rm'](_0x5ce153,{'recursive':!![],'force':!![]});}catch{}throw _0x488712;}}async function updatePackageJsonName(_0x24dec5){const _0x23e9ca=a97_0x4452,_0x2ce788=a97_0x14f5cf['resolve'](process['cwd'](),_0x24dec5),_0x3265ab=a97_0x14f5cf[_0x23e9ca(0x19b)](_0x2ce788,_0x23e9ca(0x1cd)),_0xb3ecb2=await a97_0x2095ca[_0x23e9ca(0x198)](_0x3265ab,_0x23e9ca(0x1c8)),_0x4984b4=JSON[_0x23e9ca(0x19c)](_0xb3ecb2);_0x4984b4[_0x23e9ca(0x1bb)]=_0x24dec5,_0x4984b4['description']=_0x23e9ca(0x1a9),await a97_0x2095ca[_0x23e9ca(0x199)](_0x3265ab,JSON['stringify'](_0x4984b4,null,0x2)+'\x0a');}function detectPackageManager(){const _0x38812e=a97_0x4452;try{return execSync(_0x38812e(0x1a6),{'stdio':_0x38812e(0x197)}),_0x38812e(0x1c2);}catch{return'npm';}}async function formatCode(_0x16f7d9){const _0x5bb7bf=a97_0x4452;try{await execAsync(_0x5bb7bf(0x1b8),{'cwd':_0x16f7d9});}catch{}}async function configureProject(_0x4bccaa,_0x5c1256,_0x52bda4){const _0x1281f6=a97_0x4452,_0x1fa448=a97_0x14f5cf[_0x1281f6(0x1cc)](process[_0x1281f6(0x1a1)](),_0x4bccaa),_0x405585=a97_0x14f5cf['join'](_0x1fa448,NEW_CONFIG_NAME),_0x479382=readConfig(),_0x2bccfd=typeof _0x479382['env']==='string'?_0x479382['env']:undefined,{app:_0x35e0e0,appcode:_0x4242fa,..._0x249780}=_0x479382,_0x21e6ef={..._0x249780,'appcode':_0x5c1256||'','env':_0x52bda4||_0x2bccfd||_0x1281f6(0x1a7),'createdAt':new Date()[_0x1281f6(0x1a4)](),'version':getCliVersion()};writeConfigFile(_0x405585,_0x21e6ef);}async function pullApiConfig(_0x359b66,_0x4bfc0d,_0x3b558e,_0x55b9d6){const _0x5e9d51=a97_0x4452,_0x2a44f6=process[_0x5e9d51(0x1a1)]();try{process['chdir'](_0x359b66);const _0x1b29ce=_0x3b558e||_0x5e9d51(0x1a7);initEnv(_0x1b29ce),console['log'](_0x5e9d51(0x1a3));const {configArray:_0x143240}=await fetchModelList(_0x4bfc0d,_0x55b9d6||''),_0x301494=await generateApiFile(_0x143240,'',_0x4bfc0d,!![],_0x1b29ce,_0x5e9d51(0x1ac));console[_0x5e9d51(0x19e)](_0x5e9d51(0x1c3)+_0x143240[_0x5e9d51(0x1b1)]+_0x5e9d51(0x1a0)+_0x301494[_0x5e9d51(0x193)]+_0x5e9d51(0x1ca));}catch(_0x4dd2af){console[_0x5e9d51(0x19e)](_0x5e9d51(0x19f)+CLI_BIN_NAME+_0x5e9d51(0x1c1));}finally{process[_0x5e9d51(0x1aa)](_0x2a44f6);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a98_0x4c3172=a98_0x3337;(function(_0x39a080,_0xfe5567){const _0x5b70ba=a98_0x3337,_0x304947=_0x39a080();while(!![]){try{const _0xe65624=-parseInt(_0x5b70ba(0x1da))/0x1+-parseInt(_0x5b70ba(0x1e9))/0x2+-parseInt(_0x5b70ba(0x1dc))/0x3*(-parseInt(_0x5b70ba(0x1d4))/0x4)+parseInt(_0x5b70ba(0x1db))/0x5*(parseInt(_0x5b70ba(0x1e7))/0x6)+parseInt(_0x5b70ba(0x1e8))/0x7*(parseInt(_0x5b70ba(0x1e2))/0x8)+-parseInt(_0x5b70ba(0x1e5))/0x9*(-parseInt(_0x5b70ba(0x1ea))/0xa)+parseInt(_0x5b70ba(0x1d9))/0xb*(-parseInt(_0x5b70ba(0x1e6))/0xc);if(_0xe65624===_0xfe5567)break;else _0x304947['push'](_0x304947['shift']());}catch(_0x15d4c1){_0x304947['push'](_0x304947['shift']());}}}(a98_0x2fe3,0xc152e));import a98_0x2a4429 from'node:path';import{fileURLToPath}from'node:url';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a98_0x2a4429[a98_0x4c3172(0x1e4)](fileURLToPath(import.meta.url)),templateDir=a98_0x2a4429[a98_0x4c3172(0x1e1)](__dirname,a98_0x4c3172(0x1e3));export async function copyProjectTemplate(_0x542b9d){const _0x23fa79=a98_0x4c3172,_0x58f831=Date[_0x23fa79(0x1de)](),_0xf6f65e=a98_0x2a4429[_0x23fa79(0x1e1)](process[_0x23fa79(0x1df)](),_0x542b9d);try{logger[_0x23fa79(0x1e0)](_0x23fa79(0x1dd),_0x23fa79(0x1d7),{'projectCode':_0x542b9d,'templateDir':templateDir}),await copyDirectory(templateDir,_0xf6f65e);const _0x1dc8de=Date[_0x23fa79(0x1de)]()-_0x58f831;logger[_0x23fa79(0x1eb)](_0x23fa79(0x1dd),_0x23fa79(0x1d5),_0x1dc8de,{'projectCode':_0x542b9d});}catch(_0xb4044a){const _0x109c2d=Date[_0x23fa79(0x1de)]()-_0x58f831;logger[_0x23fa79(0x1d6)](_0x23fa79(0x1dd),'项目模板复制失败',{'projectCode':_0x542b9d,'error':_0xb4044a instanceof Error?_0xb4044a[_0x23fa79(0x1d8)]:String(_0xb4044a),'duration':_0x109c2d});throw _0xb4044a;}return formatElapsed(_0x58f831);}function a98_0x3337(_0x50d160,_0x113d7a){_0x50d160=_0x50d160-0x1d4;const _0x2fe3c1=a98_0x2fe3();let _0x333745=_0x2fe3c1[_0x50d160];return _0x333745;}function a98_0x2fe3(){const _0x14278d=['272738xtUvXH','7536410itrfuG','success','77460ixvMiv','项目模板复制完成','error','开始复制项目模板','message','11vlSheX','1321340rUTmPb','65xRsbrU','123tgtYrH','copy','now','cwd','info','resolve','6581304SaBYlu','../../templates/projects/sub-app-react-demo','dirname','9AwYUkm','10320972JqTVXV','341250HKrsFB','7JgAamG'];a98_0x2fe3=function(){return _0x14278d;};return a98_0x2fe3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37407d,_0x37658b){const _0x59ed0e=a99_0x1425,_0x2eaa0e=_0x37407d();while(!![]){try{const _0x2cb0a6=parseInt(_0x59ed0e(0xe6))/0x1+-parseInt(_0x59ed0e(0xeb))/0x2*(-parseInt(_0x59ed0e(0xe5))/0x3)+parseInt(_0x59ed0e(0xda))/0x4*(-parseInt(_0x59ed0e(0xea))/0x5)+-parseInt(_0x59ed0e(0xde))/0x6*(parseInt(_0x59ed0e(0xe0))/0x7)+-parseInt(_0x59ed0e(0xef))/0x8*(-parseInt(_0x59ed0e(0xe3))/0x9)+-parseInt(_0x59ed0e(0xe1))/0xa+parseInt(_0x59ed0e(0xdd))/0xb;if(_0x2cb0a6===_0x37658b)break;else _0x2eaa0e['push'](_0x2eaa0e['shift']());}catch(_0x255c3d){_0x2eaa0e['push'](_0x2eaa0e['shift']());}}}(a99_0x2a52,0x6bc7a));import a99_0x158bb9 from'node:path';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a99_0x2a52(){const _0x190839=['info','--write','245448CMNjJs','代码格式化完成','npx','2520428KkHQyT','resolve','format','484660rfQtvh','30viUsjj','cwd','790937FXFHgn','7609370opOnjV','success','243oBiRTk','prettier','190122EQWoup','701156GpNNdk','now','message','开始格式化代码','5yoFsoW','26oVvsFK','代码格式化失败'];a99_0x2a52=function(){return _0x190839;};return a99_0x2a52();}function a99_0x1425(_0x539359,_0x424a4f){_0x539359=_0x539359-0xda;const _0x2a5245=a99_0x2a52();let _0x14250b=_0x2a5245[_0x539359];return _0x14250b;}import{logger}from'../utils/logger.js';import{resolveNpmBin}from'../utils/platform.js';export async function formatProjectCode(_0x3c9cd0){const _0x2bd1b2=a99_0x1425,_0x45eacb=Date[_0x2bd1b2(0xe7)](),_0xf7e957=a99_0x158bb9[_0x2bd1b2(0xdb)](process[_0x2bd1b2(0xdf)](),_0x3c9cd0);try{logger[_0x2bd1b2(0xed)](_0x2bd1b2(0xdc),_0x2bd1b2(0xe9),{'projectCode':_0x3c9cd0}),await execa(resolveNpmBin(_0x2bd1b2(0xf1)),[_0x2bd1b2(0xe4),_0x2bd1b2(0xee),'.'],{'cwd':_0xf7e957});const _0x7cf527=Date[_0x2bd1b2(0xe7)]()-_0x45eacb;logger[_0x2bd1b2(0xe2)](_0x2bd1b2(0xdc),_0x2bd1b2(0xf0),_0x7cf527,{'projectCode':_0x3c9cd0});}catch(_0x15cbf0){const _0x3acf64=Date['now']()-_0x45eacb;logger['error'](_0x2bd1b2(0xdc),_0x2bd1b2(0xec),{'projectCode':_0x3c9cd0,'error':_0x15cbf0 instanceof Error?_0x15cbf0[_0x2bd1b2(0xe8)]:String(_0x15cbf0),'duration':_0x3acf64});throw _0x15cbf0;}return formatElapsed(_0x45eacb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4aa595,_0x415757){const _0x450cea=a100_0x5513,_0x16f518=_0x4aa595();while(!![]){try{const _0x1db04f=parseInt(_0x450cea(0xd3))/0x1*(parseInt(_0x450cea(0xd8))/0x2)+parseInt(_0x450cea(0xca))/0x3+-parseInt(_0x450cea(0xd5))/0x4+parseInt(_0x450cea(0xdc))/0x5+parseInt(_0x450cea(0xcb))/0x6+parseInt(_0x450cea(0xdd))/0x7*(parseInt(_0x450cea(0xc9))/0x8)+-parseInt(_0x450cea(0xd2))/0x9;if(_0x1db04f===_0x415757)break;else _0x16f518['push'](_0x16f518['shift']());}catch(_0xe1f2c5){_0x16f518['push'](_0x16f518['shift']());}}}(a100_0x25d4,0xba15e));import a100_0x509b82 from'node:path';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a100_0x5513(_0x209483,_0xb685ee){_0x209483=_0x209483-0xc9;const _0x25d438=a100_0x25d4();let _0x551359=_0x25d438[_0x209483];return _0x551359;}import{resolveNpmBin}from'../utils/platform.js';function a100_0x25d4(){const _0x5a719=['16357770GnhSTv','172sWfTAR','install','5412232cUHagF','error','success','10148IMiVWB','https://registry.npmmirror.com','resolve','依赖安装失败','4578230PMfVho','1044071kEKvpD','72ZyDFbB','1311606amvjXX','2189046TSvUyB','开始安装依赖','info','now','npm','--registry','依赖安装完成'];a100_0x25d4=function(){return _0x5a719;};return a100_0x25d4();}export async function installDependencies(_0x544544){const _0x4f6317=a100_0x5513,_0x42935f=Date[_0x4f6317(0xce)](),_0x3f9453=a100_0x509b82[_0x4f6317(0xda)](process['cwd'](),_0x544544);try{logger[_0x4f6317(0xcd)](_0x4f6317(0xd4),_0x4f6317(0xcc),{'projectCode':_0x544544,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x4f6317(0xcf)),[_0x4f6317(0xd4),_0x4f6317(0xd0),_0x4f6317(0xd9)],{'cwd':_0x3f9453});const _0x5d2f19=Date[_0x4f6317(0xce)]()-_0x42935f;logger[_0x4f6317(0xd7)]('install',_0x4f6317(0xd1),_0x5d2f19,{'projectCode':_0x544544});}catch(_0x32707f){const _0x1dea70=Date['now']()-_0x42935f;logger[_0x4f6317(0xd6)](_0x4f6317(0xd4),_0x4f6317(0xdb),{'projectCode':_0x544544,'error':_0x32707f instanceof Error?_0x32707f['message']:String(_0x32707f),'duration':_0x1dea70});throw _0x32707f;}return formatElapsed(_0x42935f);}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a101_0xaa81(_0x218340,_0x50bf02){_0x218340=_0x218340-0x1a7;const _0x237221=a101_0x2372();let _0xaa81eb=_0x237221[_0x218340];return _0xaa81eb;}const a101_0xaa8993=a101_0xaa81;(function(_0x220038,_0x4771e8){const _0x26c07a=a101_0xaa81,_0x2be45a=_0x220038();while(!![]){try{const _0x31aa38=parseInt(_0x26c07a(0x1b9))/0x1+-parseInt(_0x26c07a(0x1ac))/0x2+-parseInt(_0x26c07a(0x1a8))/0x3*(parseInt(_0x26c07a(0x1c4))/0x4)+-parseInt(_0x26c07a(0x1be))/0x5+parseInt(_0x26c07a(0x1b6))/0x6+-parseInt(_0x26c07a(0x1b0))/0x7+parseInt(_0x26c07a(0x1c0))/0x8;if(_0x31aa38===_0x4771e8)break;else _0x2be45a['push'](_0x2be45a['shift']());}catch(_0x5a065a){_0x2be45a['push'](_0x2be45a['shift']());}}}(a101_0x2372,0xab0aa));function a101_0x2372(){const _0x2cb219=['code','config_missing','Configuration\x20file\x20not\x20found','779810EgQTJr','\x20--help`\x20to\x20see\x20available\x20commands.','14200496RLatii','hint','exitCode','Tip:\x20`','456028GKlFNE','validation_error','Unknown\x20command:\x20','3pkAOfU','unknown_command','name','\x20auth`\x20to\x20login\x20first.','1413500FUAvRB','Network\x20error:\x20','\x0a\x20\x20\x20\x20\x20\x20\x20','join','6664826kiCLRg','Run\x20`','network_error','Set\x20appcode\x20via\x20`','Missing\x20required\x20flag:\x20--','Check\x20your\x20internet\x20connection\x20and\x20try\x20again.','920532onlOKR','\x20init\x20--appcode\x20<code>`\x20or\x20pass\x20--appcode.','Run\x20this\x20command\x20inside\x20a\x20project\x20with\x20.rabetbase.json\x20file.','700939NECrhv','\x20project\x20directory'];a101_0x2372=function(){return _0x2cb219;};return a101_0x2372();}import{CLI_BIN_NAME}from'./constant/cli.js';export class CliError extends Error{[a101_0xaa8993(0x1bb)];['exitCode'];[a101_0xaa8993(0x1c1)];constructor(_0xf5f2c6,_0x2cc999,_0x57e277,_0x5c1c8e){const _0x15f2f5=a101_0xaa8993;super(_0x57e277),this[_0x15f2f5(0x1aa)]='CliError',this[_0x15f2f5(0x1bb)]=_0xf5f2c6,this[_0x15f2f5(0x1c2)]=_0x2cc999,this[_0x15f2f5(0x1c1)]=_0x5c1c8e;}}export const CliErrors={'authRequired':_0xa2f732=>new CliError('auth_required',0x1,'Authentication\x20required',_0xa2f732??a101_0xaa8993(0x1b1)+CLI_BIN_NAME+a101_0xaa8993(0x1ab)),'configMissing':_0x38b9ea=>new CliError(a101_0xaa8993(0x1bc),0x1,a101_0xaa8993(0x1bd),_0x38b9ea??[a101_0xaa8993(0x1b3)+CLI_BIN_NAME+a101_0xaa8993(0x1b7),a101_0xaa8993(0x1c3)+CLI_BIN_NAME+'\x20init\x20--appcode\x20<code>\x20--global`\x20registers\x20globally\x20so\x20you\x20can\x20use\x20it\x20from\x20anywhere.'][a101_0xaa8993(0x1af)](a101_0xaa8993(0x1ae))),'notInProject':()=>new CliError('not_in_project',0x1,'Not\x20in\x20a\x20'+CLI_BIN_NAME+a101_0xaa8993(0x1ba),a101_0xaa8993(0x1b8)),'apiError':(_0x373bbd,_0x4e7714)=>new CliError('api_error',0x2,_0x373bbd,_0x4e7714),'networkError':_0x1ded13=>new CliError(a101_0xaa8993(0x1b2),0x2,a101_0xaa8993(0x1ad)+_0x1ded13,a101_0xaa8993(0x1b5)),'unknownCommand':_0x7186b5=>new CliError(a101_0xaa8993(0x1a9),0x1,a101_0xaa8993(0x1a7)+_0x7186b5,a101_0xaa8993(0x1b1)+CLI_BIN_NAME+a101_0xaa8993(0x1bf)),'flagMissing':(_0x1db41f,_0x4a31bf)=>new CliError('flag_missing',0x1,a101_0xaa8993(0x1b4)+_0x1db41f,_0x4a31bf),'validation':(_0xa029a0,_0x5b80f3)=>new CliError(a101_0xaa8993(0x1c5),0x1,_0xa029a0,_0x5b80f3),'cancelled':_0x50bcc7=>new CliError('cancelled',0x0,_0x50bcc7??'Operation\x20cancelled.',undefined)};
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b93d3,_0xa3aa68){const _0xf0275=a102_0x13f3,_0x482384=_0x1b93d3();while(!![]){try{const _0x3e6411=-parseInt(_0xf0275(0xa9))/0x1+parseInt(_0xf0275(0xb0))/0x2*(-parseInt(_0xf0275(0x95))/0x3)+parseInt(_0xf0275(0x96))/0x4+-parseInt(_0xf0275(0xab))/0x5*(-parseInt(_0xf0275(0x92))/0x6)+parseInt(_0xf0275(0xb1))/0x7*(-parseInt(_0xf0275(0x9b))/0x8)+-parseInt(_0xf0275(0xad))/0x9*(parseInt(_0xf0275(0x9f))/0xa)+parseInt(_0xf0275(0x9c))/0xb*(-parseInt(_0xf0275(0x99))/0xc);if(_0x3e6411===_0xa3aa68)break;else _0x482384['push'](_0x482384['shift']());}catch(_0x356637){_0x482384['push'](_0x482384['shift']());}}}(a102_0x494c,0x3db2a));import{CliErrors}from'../errors.js';export function parseFlags(_0x3849dc,_0x5b491f){const _0x324efd=a102_0x13f3,_0x1c3a3a={};for(const _0x37531f of _0x3849dc){const _0x3fd77d=_0x5b491f[_0x37531f[_0x324efd(0x97)]]??_0x5b491f[toCamelCase(_0x37531f['name'])];if(_0x3fd77d===undefined||_0x3fd77d===null){_0x37531f[_0x324efd(0xa3)]!==undefined&&(_0x1c3a3a[_0x37531f['name']]=_0x37531f['default']);continue;}_0x1c3a3a[_0x37531f['name']]=coerce(_0x37531f,_0x3fd77d);}for(const _0xeb559c of[_0x324efd(0x9d),_0x324efd(0x9e),'yes',_0x324efd(0xb2)]){const _0x3cbaf0=_0x5b491f[_0xeb559c];if(_0x3cbaf0!==undefined){const _0x3afd63=_0xeb559c===_0x324efd(0x9e)?'dry-run':_0xeb559c;_0x1c3a3a[_0x3afd63]=_0x3cbaf0;}}return _0x1c3a3a;}export function validateFlags(_0x3a2e39,_0x5445fb,_0x11150f){const _0x1ed678=a102_0x13f3;for(const _0x118679 of _0x3a2e39){const _0x323299=_0x5445fb[_0x118679[_0x1ed678(0x97)]];if(_0x118679[_0x1ed678(0xa6)]&&(_0x323299===undefined||_0x323299===''))throw CliErrors[_0x1ed678(0xac)](_0x118679['name'],'--'+_0x118679[_0x1ed678(0x97)]+_0x1ed678(0x9a)+_0x11150f+'`.');if(_0x118679[_0x1ed678(0xb3)]&&_0x118679[_0x1ed678(0xb3)][_0x1ed678(0xa0)]>0x0&&_0x323299!==undefined&&_0x323299!==''){if(!_0x118679[_0x1ed678(0xb3)]['includes'](String(_0x323299)))throw CliErrors[_0x1ed678(0xa8)]('Invalid\x20value\x20\x22'+_0x323299+_0x1ed678(0x94)+_0x118679[_0x1ed678(0x97)]+_0x1ed678(0xa5)+_0x118679['enum'][_0x1ed678(0xa7)](',\x20'));}if(_0x118679[_0x1ed678(0xa1)]&&_0x323299!==undefined&&_0x323299!==''){if(!_0x118679[_0x1ed678(0xa1)][_0x1ed678(0xaf)]['test'](String(_0x323299)))throw CliErrors['validation']('Invalid\x20--'+_0x118679[_0x1ed678(0x97)]+':\x20expected\x20'+_0x118679['pattern'][_0x1ed678(0x93)]+_0x1ed678(0x98)+_0x323299+'\x22.');}}}function a102_0x494c(){const _0x40301a=['toUpperCase','238695hymelX','flagMissing','306LoZbza','replace','regex','2TeYhCB','301tCTQRk','format','enum','60orjhWg','description','\x22\x20for\x20--','982017epoQpx','1688840vSjcbv','name',',\x20got\x20\x22','48ovywDP','\x20is\x20required\x20for\x20`','7096sHEkUO','126269ikmmdJ','dry-run','dryRun','53330SSvtid','length','pattern','number','default','\x20expects\x20a\x20number,\x20got\x20\x22','.\x20Allowed:\x20','required','join','validation','54168lVgGTi'];a102_0x494c=function(){return _0x40301a;};return a102_0x494c();}function coerce(_0x362064,_0x3ee2ce){const _0x12ce6e=a102_0x13f3;switch(_0x362064['type']){case'boolean':return _0x3ee2ce===!![]||_0x3ee2ce==='true';case _0x12ce6e(0xa2):{const _0x2be637=Number(_0x3ee2ce);if(isNaN(_0x2be637))throw CliErrors[_0x12ce6e(0xa8)]('--'+_0x362064[_0x12ce6e(0x97)]+_0x12ce6e(0xa4)+_0x3ee2ce+'\x22');return _0x2be637;}default:return String(_0x3ee2ce);}}function a102_0x13f3(_0x84fa6b,_0x910ff7){_0x84fa6b=_0x84fa6b-0x92;const _0x494c20=a102_0x494c();let _0x13f34a=_0x494c20[_0x84fa6b];return _0x13f34a;}function toCamelCase(_0x54fc8f){const _0x3513d1=a102_0x13f3;return _0x54fc8f[_0x3513d1(0xae)](/-([a-z])/g,(_0x2ce4c4,_0x182c03)=>_0x182c03[_0x3513d1(0xaa)]());}
|