@lovrabet/rabetbase-cli 2.0.11 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -0
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -0
- package/lib/commands/sql/validate.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/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 +1 -1
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x419486=a135_0x4632;function a135_0x1715(){const _0x316e10=['4394136tjHxnE','format','red','完成:\x20','initWinstonLogger','split','yellow','info','green','File','失败:\x20','addColors','level','Failed\x20to\x20read\x20logs:','combine','4MUgiju','now','clearLogs','rawCommand','error','utf8','Failed\x20to\x20clear\x20logs:','currentRawCommand','1794944DEFLCl','blue','errors','logFilePath','log','toISOString','4764570dLouMa','timestamp','winstonLogger','dirname','9135UAFxDo','logTask','existsSync','message','开始执行:\x20','528100gTqClk','transports','stringify','clear','unknown','setRawCommand','getWinstonInstance','printf','map','writeFileSync','warn','3993381wzcOHd','success','349833JLRUKv','command','readFileSync','join','trim'];a135_0x1715=function(){return _0x316e10;};return a135_0x1715();}(function(_0x2c60ff,_0x21223a){const _0x425144=a135_0x4632,_0x38de69=_0x2c60ff();while(!![]){try{const _0x2a1f9a=parseInt(_0x425144(0x13a))/0x1+-parseInt(_0x425144(0x12b))/0x2+-parseInt(_0x425144(0x147))/0x3*(-parseInt(_0x425144(0x15b))/0x4)+-parseInt(_0x425144(0x135))/0x5+parseInt(_0x425144(0x131))/0x6+-parseInt(_0x425144(0x145))/0x7+parseInt(_0x425144(0x14c))/0x8;if(_0x2a1f9a===_0x21223a)break;else _0x38de69['push'](_0x38de69['shift']());}catch(_0xb6069d){_0x38de69['push'](_0x38de69['shift']());}}}(a135_0x1715,0x7e893));import a135_0x23f9d0 from'winston';function a135_0x4632(_0x2d9fac,_0x1e10a4){_0x2d9fac=_0x2d9fac-0x125;const _0x1715a4=a135_0x1715();let _0x4632ce=_0x1715a4[_0x2d9fac];return _0x4632ce;}import a135_0x19037d from'node:fs';import a135_0x112cde from'node:path';class Logger{['winstonLogger'];[a135_0x419486(0x12e)];[a135_0x419486(0x12a)]='';constructor(){const _0x280bfc=a135_0x419486;this[_0x280bfc(0x12e)]='';}[a135_0x419486(0x13f)](_0x4d6a4f){this['currentRawCommand']=_0x4d6a4f;}[a135_0x419486(0x150)](){const _0x5237b2=a135_0x419486,_0x2c087d=a135_0x112cde[_0x5237b2(0x134)](this[_0x5237b2(0x12e)]);!a135_0x19037d[_0x5237b2(0x137)](_0x2c087d)&&a135_0x19037d['mkdirSync'](_0x2c087d,{'recursive':!![]});const _0x25e09c=a135_0x23f9d0[_0x5237b2(0x14d)][_0x5237b2(0x15a)](a135_0x23f9d0['format'][_0x5237b2(0x132)](),a135_0x23f9d0[_0x5237b2(0x14d)][_0x5237b2(0x12d)]({'stack':!![]}),a135_0x23f9d0[_0x5237b2(0x14d)][_0x5237b2(0x141)](_0x18e08b=>{const _0x183a5d=_0x5237b2,_0x29be20={'timestamp':_0x18e08b[_0x183a5d(0x132)]||new Date()[_0x183a5d(0x130)](),'level':_0x18e08b[_0x183a5d(0x158)]||_0x183a5d(0x153),'command':_0x18e08b[_0x183a5d(0x148)]||_0x183a5d(0x13e),'rawCommand':_0x18e08b[_0x183a5d(0x126)]||this[_0x183a5d(0x12a)]||undefined,'message':_0x18e08b[_0x183a5d(0x138)]||'','duration':_0x18e08b['duration']||undefined,'details':_0x18e08b['details']||undefined};return JSON[_0x183a5d(0x13c)](_0x29be20);}));this[_0x5237b2(0x133)]=a135_0x23f9d0['createLogger']({'level':'info','format':_0x25e09c,'transports':[new a135_0x23f9d0[(_0x5237b2(0x13b))][(_0x5237b2(0x155))]({'filename':this[_0x5237b2(0x12e)],'level':_0x5237b2(0x153)})],'silent':![]}),a135_0x23f9d0[_0x5237b2(0x157)]({'success':_0x5237b2(0x154),'error':_0x5237b2(0x14e),'warn':_0x5237b2(0x152),'info':_0x5237b2(0x12c)});}['setLogPath'](_0x155db3){const _0x45a0c1=a135_0x419486;this[_0x45a0c1(0x12e)]=a135_0x112cde[_0x45a0c1(0x14a)](_0x155db3,'.lovrabet.log'),this[_0x45a0c1(0x133)]&&this['winstonLogger'][_0x45a0c1(0x13d)](),this[_0x45a0c1(0x150)]();}['info'](_0xb73530,_0x4311bf,_0x1037b7){const _0x17d2f7=a135_0x419486;if(!this[_0x17d2f7(0x12e)]||!this[_0x17d2f7(0x133)])return;this[_0x17d2f7(0x133)][_0x17d2f7(0x153)](_0x4311bf,{'command':_0xb73530,'details':_0x1037b7});}[a135_0x419486(0x146)](_0x432385,_0x3c9f1a,_0x327add,_0x4fbb84){const _0x1d7180=a135_0x419486;if(!this['logFilePath']||!this['winstonLogger'])return;this['winstonLogger'][_0x1d7180(0x12f)](_0x1d7180(0x153),_0x3c9f1a,{'level':'success','command':_0x432385,'duration':_0x327add,'details':_0x4fbb84});}[a135_0x419486(0x127)](_0x52d9d5,_0x55dbd6,_0x1396b6){const _0x67500b=a135_0x419486;if(!this[_0x67500b(0x12e)]||!this[_0x67500b(0x133)])return;this[_0x67500b(0x133)]['error'](_0x55dbd6,{'command':_0x52d9d5,'details':_0x1396b6});}[a135_0x419486(0x144)](_0xda2dc3,_0x55d0cb,_0x353c30){const _0x236bdc=a135_0x419486;if(!this[_0x236bdc(0x12e)]||!this['winstonLogger'])return;this['winstonLogger'][_0x236bdc(0x144)](_0x55d0cb,{'command':_0xda2dc3,'details':_0x353c30});}async[a135_0x419486(0x136)](_0x5735c5,_0x1ca70c,_0x202477){const _0x4c489a=a135_0x419486,_0x5f5dd5=Date[_0x4c489a(0x15c)]();this['info'](_0x5735c5,_0x4c489a(0x139)+_0x1ca70c);try{const _0x1fb6fd=await _0x202477(),_0x36cb03=Date[_0x4c489a(0x15c)]()-_0x5f5dd5;return this[_0x4c489a(0x146)](_0x5735c5,_0x4c489a(0x14f)+_0x1ca70c,_0x36cb03),_0x1fb6fd;}catch(_0x30f66e){const _0x2c38a8=Date[_0x4c489a(0x15c)]()-_0x5f5dd5;this[_0x4c489a(0x127)](_0x5735c5,_0x4c489a(0x156)+_0x1ca70c,{'error':_0x30f66e instanceof Error?_0x30f66e[_0x4c489a(0x138)]:String(_0x30f66e),'duration':_0x2c38a8});throw _0x30f66e;}}['readLogs'](){const _0x5dfa41=a135_0x419486;try{if(!a135_0x19037d[_0x5dfa41(0x137)](this[_0x5dfa41(0x12e)]))return[];const _0x30c0c5=a135_0x19037d[_0x5dfa41(0x149)](this[_0x5dfa41(0x12e)],_0x5dfa41(0x128));return _0x30c0c5[_0x5dfa41(0x151)]('\x0a')['filter'](_0x50f53e=>_0x50f53e[_0x5dfa41(0x14b)]())[_0x5dfa41(0x142)](_0xc30c14=>JSON['parse'](_0xc30c14));}catch(_0x10eaef){return console[_0x5dfa41(0x144)](_0x5dfa41(0x159),_0x10eaef),[];}}[a135_0x419486(0x125)](){const _0x1fe6d1=a135_0x419486;try{a135_0x19037d['existsSync'](this[_0x1fe6d1(0x12e)])&&a135_0x19037d[_0x1fe6d1(0x143)](this[_0x1fe6d1(0x12e)],'','utf8');}catch(_0x26ff4e){console[_0x1fe6d1(0x144)](_0x1fe6d1(0x129),_0x26ff4e);}}[a135_0x419486(0x140)](){const _0x3114d5=a135_0x419486;return this[_0x3114d5(0x133)];}}export const logger=new Logger();
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a136_0x18fb(_0x14f83d,_0xbf2f5b){_0x14f83d=_0x14f83d-0x1c5;const _0x4236b1=a136_0x4236();let _0x18fbce=_0x4236b1[_0x14f83d];return _0x18fbce;}function a136_0x4236(){const _0x405335=['48TBRvff','4MXQyVU','255889Jhwaoe','10950570dRrAFs','3504882aCjQDs','4kOiVgr','277195NFnUZg','8tidUTc','7244973mpELOj','12059399qCHLHK','win32','535878KieCTK'];a136_0x4236=function(){return _0x405335;};return a136_0x4236();}const a136_0x2c5e6c=a136_0x18fb;(function(_0x2b03bf,_0x43ee09){const _0x4548bc=a136_0x18fb,_0x34de1c=_0x2b03bf();while(!![]){try{const _0x254a39=parseInt(_0x4548bc(0x1c6))/0x1*(parseInt(_0x4548bc(0x1c9))/0x2)+parseInt(_0x4548bc(0x1c8))/0x3*(-parseInt(_0x4548bc(0x1c5))/0x4)+parseInt(_0x4548bc(0x1ca))/0x5*(parseInt(_0x4548bc(0x1d0))/0x6)+parseInt(_0x4548bc(0x1cf))/0x7+parseInt(_0x4548bc(0x1cb))/0x8*(parseInt(_0x4548bc(0x1cc))/0x9)+parseInt(_0x4548bc(0x1c7))/0xa+-parseInt(_0x4548bc(0x1cd))/0xb;if(_0x254a39===_0x43ee09)break;else _0x34de1c['push'](_0x34de1c['shift']());}catch(_0x27751a){_0x34de1c['push'](_0x34de1c['shift']());}}}(a136_0x4236,0xa2e9f));export const isWindows=process['platform']===a136_0x2c5e6c(0x1ce);export function resolveNpmBin(_0x237aad){return isWindows?_0x237aad+'.cmd':_0x237aad;}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a137_0x55e6a2=a137_0x3533;function a137_0x3533(_0x2667c9,_0x1ada51){_0x2667c9=_0x2667c9-0x6a;const _0x9fbe80=a137_0x9fbe();let _0x353311=_0x9fbe80[_0x2667c9];return _0x353311;}(function(_0x18cfed,_0x2c1f85){const _0x1bc496=a137_0x3533,_0x411ee5=_0x18cfed();while(!![]){try{const _0x217e31=-parseInt(_0x1bc496(0x81))/0x1+parseInt(_0x1bc496(0x7a))/0x2*(-parseInt(_0x1bc496(0x76))/0x3)+-parseInt(_0x1bc496(0x7d))/0x4*(-parseInt(_0x1bc496(0x75))/0x5)+parseInt(_0x1bc496(0x71))/0x6+-parseInt(_0x1bc496(0x6a))/0x7*(parseInt(_0x1bc496(0x80))/0x8)+-parseInt(_0x1bc496(0x72))/0x9+parseInt(_0x1bc496(0x7c))/0xa;if(_0x217e31===_0x2c1f85)break;else _0x411ee5['push'](_0x411ee5['shift']());}catch(_0x3ec99){_0x411ee5['push'](_0x411ee5['shift']());}}}(a137_0x9fbe,0xa0d14));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'../utils/config.js';import{appendUpdateTime}from'../utils/guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x2b74b1=a137_0x3533,_0x351614=getTemplateBaseUrl();return _0x351614+_0x2b74b1(0x74);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a137_0x55e6a2(0x78));export async function fetchRulesFromCDN(){const _0x1bd930=a137_0x55e6a2,_0x4b8e78=getRulesCdnUrl(),_0x4a2cd3=await fetch(_0x4b8e78,{'headers':{'Accept':'application/json'}});if(!_0x4a2cd3['ok'])throw new Error(_0x1bd930(0x6c)+_0x4a2cd3['status']+'\x20'+_0x4a2cd3[_0x1bd930(0x6b)]);const _0x4d6ba3=await _0x4a2cd3[_0x1bd930(0x6d)]();if(!_0x4d6ba3['content']||typeof _0x4d6ba3[_0x1bd930(0x7e)]!=='string')throw new Error(_0x1bd930(0x6e));return _0x4d6ba3;}export async function getRulesContent(){const _0x2f1d36=a137_0x55e6a2;try{const _0xb17b76=await fetchRulesFromCDN();return _0xb17b76[_0x2f1d36(0x7e)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x229b88=a137_0x55e6a2;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x229b88(0x70));throw new Error(_0x229b88(0x7b)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x3bd999){const _0x278785=a137_0x55e6a2,_0xe4b9b7=await fetchRulesFromCDN()[_0x278785(0x6f)](()=>null);let _0x2d14ca;_0xe4b9b7?(_0x2d14ca=_0xe4b9b7[_0x278785(0x7e)],_0xe4b9b7[_0x278785(0x79)]&&(_0x2d14ca=appendUpdateTime(_0x2d14ca,_0xe4b9b7[_0x278785(0x79)]))):_0x2d14ca=readLocalTemplate();const _0x3decb5=dirname(_0x3bd999);!existsSync(_0x3decb5)&&mkdirSync(_0x3decb5,{'recursive':!![]}),writeFileSync(_0x3bd999,_0x2d14ca,_0x278785(0x70));}export async function copyRulesToCursor(_0x81b2d4){const _0x186fc1=a137_0x55e6a2,_0x4e45bb=join(_0x81b2d4,_0x186fc1(0x7f)),_0x54ba46=join(_0x4e45bb,_0x186fc1(0x73));if(existsSync(_0x54ba46))return![];return await writeRulesFile(_0x54ba46),!![];}function a137_0x9fbe(){const _0x30bf58=['2625380JQfOyj','content','.cursor/rules','8ZoeAOz','509981bjEeJc','6344436tfVRXs','statusText','CDN\x20请求失败:\x20','json','CDN\x20返回数据格式错误','catch','utf-8','5558484fOHNAA','4964373SuXzQG','lovrabet_rules.mdc','/rules/rules.json','10dUUYZC','87726WvjKyj','agents.md','../../templates/rules/lovrabet_rules.mdc.tpl','lastUpdated','4yIZJQm','本地模板文件不存在:\x20','4460140FwyOzl'];a137_0x9fbe=function(){return _0x30bf58;};return a137_0x9fbe();}export async function copyRulesToAgentsMd(_0x5b6b0c){const _0xa5c8ff=a137_0x55e6a2,_0x3f64e3=join(_0x5b6b0c,_0xa5c8ff(0x77));if(existsSync(_0x3f64e3))return![];return await writeRulesFile(_0x3f64e3),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x29dc16){return new Promise(_0x15e472=>setTimeout(_0x15e472,_0x29dc16));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a139_0x47f043=a139_0x4f9a;(function(_0x8a811f,_0x3cf65a){const _0x51f519=a139_0x4f9a,_0x1cfa97=_0x8a811f();while(!![]){try{const _0x49d5c1=parseInt(_0x51f519(0x104))/0x1+parseInt(_0x51f519(0xf7))/0x2*(-parseInt(_0x51f519(0x107))/0x3)+-parseInt(_0x51f519(0x111))/0x4*(-parseInt(_0x51f519(0x114))/0x5)+-parseInt(_0x51f519(0xe3))/0x6+-parseInt(_0x51f519(0xde))/0x7+-parseInt(_0x51f519(0xfb))/0x8+parseInt(_0x51f519(0xe2))/0x9;if(_0x49d5c1===_0x3cf65a)break;else _0x1cfa97['push'](_0x1cfa97['shift']());}catch(_0x2f568b){_0x1cfa97['push'](_0x1cfa97['shift']());}}}(a139_0x5b8d,0x80e64));import a139_0x480867 from'node:fs';import a139_0x32574a from'node:path';import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';function a139_0x4f9a(_0x54bd43,_0x1b29ec){_0x54bd43=_0x54bd43-0xdd;const _0x5b8dd0=a139_0x5b8d();let _0x4f9a54=_0x5b8dd0[_0x54bd43];return _0x4f9a54;}const CLI_VERSION=getCliVersion();function a139_0x5b8d(){const _0x61006d=['error','readdir','22820724uCtHvW','5471328WYsdOo','now','name','开始处理模板内容替换','template','charAt','toUpperCase','.scss','slice','tableName:\x20\x22','.css','name:\x20\x22','api','.tpl','success','toLocaleTimeString','.jsx','模板内容替换完成','numeric','.js','1992634redgHi','.json','2-digit','readFile','1023424CCXGnA','datasetCode','info','toComponentName','pop','join','promises','processFile','isDirectory','590145EbZVeF','tableName','replace','3JzxGXQ','alias','replaceContent','copyFile','endsWith','map','push','mkdir','toLowerCase','writeFile','20mGnfHp','utf8','toDisplayTitle','148355RENWVs','processDirectory','\x20},','split','alias:\x20\x22','toLocaleString','message','\x0a\x20\x20\x20\x20{\x20','extname','4970217niTrVk','processTemplate'];a139_0x5b8d=function(){return _0x61006d;};return a139_0x5b8d();}export class TemplateReplacer{static[a139_0x47f043(0xfe)](_0xdf7625){const _0x2f7c6c=a139_0x47f043,_0x165b89=_0xdf7625[_0x2f7c6c(0x117)]('/')[_0x2f7c6c(0xff)]()||_0xdf7625;return _0x165b89[_0x2f7c6c(0x117)]('-')[_0x2f7c6c(0x10c)](_0x1f2bbc=>_0x1f2bbc[_0x2f7c6c(0xe8)](0x0)[_0x2f7c6c(0xe9)]()+_0x1f2bbc[_0x2f7c6c(0xeb)](0x1)[_0x2f7c6c(0x10f)]())[_0x2f7c6c(0x100)]('');}static[a139_0x47f043(0x113)](_0x441a35){const _0x5827e4=a139_0x47f043,_0x4feb62=_0x441a35['split']('/')['pop']()||_0x441a35;return _0x4feb62[_0x5827e4(0x117)]('-')[_0x5827e4(0x10c)](_0x511cf8=>_0x511cf8[_0x5827e4(0xe8)](0x0)[_0x5827e4(0xe9)]()+_0x511cf8[_0x5827e4(0xeb)](0x1)[_0x5827e4(0x10f)]())[_0x5827e4(0x100)]('\x20');}static[a139_0x47f043(0x109)](_0x352922,_0x36433b,_0x5b8c8d){const _0x1eac10=a139_0x47f043,_0x75f10e=this[_0x1eac10(0xfe)](_0x36433b),_0x11e49d=this[_0x1eac10(0x113)](_0x36433b),_0x28f233=new Date(),_0x366996=_0x28f233[_0x1eac10(0x119)](undefined,{'year':_0x1eac10(0xf5),'month':_0x1eac10(0xf9),'day':_0x1eac10(0xf9),'hour':_0x1eac10(0xf9),'minute':_0x1eac10(0xf9),'second':_0x1eac10(0xf9),'hour12':![]})['replace'](/\//g,'-'),_0x343c76=_0x28f233['toLocaleDateString'](undefined,{'year':_0x1eac10(0xf5),'month':_0x1eac10(0xf9),'day':_0x1eac10(0xf9)})[_0x1eac10(0x106)](/\//g,'-'),_0x4a29f9=_0x28f233[_0x1eac10(0xf2)](undefined,{'hour12':![]});let _0x8fdf57=_0x352922['replace'](/\{CliVersion\}/g,CLI_VERSION)[_0x1eac10(0x106)](/\{ComponentName\}/g,_0x75f10e)[_0x1eac10(0x106)](/\{DisplayTitle\}/g,_0x11e49d)[_0x1eac10(0x106)](/\{PageName\}/g,_0x36433b)['replace'](/\{TemplateName\}/g,_0x5b8c8d)[_0x1eac10(0x106)](/\{CreatedAt\}/g,_0x366996)[_0x1eac10(0x106)](/\{CreatedDate\}/g,_0x343c76)['replace'](/\{CreatedTime\}/g,_0x4a29f9);return _0x8fdf57;}static['replaceApiContent'](_0x1423e4,_0xfea0e8,_0x34ec70,_0x56de23,_0x1c22ab,_0x24257e,_0x3e4b49,_0x4554b6){const _0x2e24a8=a139_0x47f043,_0x3f7ace=new Date(),_0x43c625=_0x3f7ace['toISOString'](),_0x28e166=_0x34ec70[_0x2e24a8(0x10c)](_0x34eabe=>{const _0x51b078=_0x2e24a8,_0x1164fe=['datasetCode:\x20\x22'+_0x34eabe[_0x51b078(0xfc)]+'\x22',_0x51b078(0xec)+_0x34eabe[_0x51b078(0x105)]+'\x22',_0x51b078(0xee)+_0x34eabe['name']+'\x22'];return _0x34eabe[_0x51b078(0x108)]&&_0x1164fe[_0x51b078(0x10d)](_0x51b078(0x118)+_0x34eabe[_0x51b078(0x108)]+'\x22'),_0x51b078(0x11b)+_0x1164fe[_0x51b078(0x100)](',\x20')+_0x51b078(0x116);})[_0x2e24a8(0x100)](''),_0x38a967=_0x56de23||_0x34ec70[0x0]?.[_0x2e24a8(0x108)]||'YourModel';let _0x9783c6=_0x1423e4[_0x2e24a8(0x106)](/\{AppCode\}/g,_0xfea0e8)[_0x2e24a8(0x106)](/\{ModelConfigs\}/g,_0x28e166)[_0x2e24a8(0x106)](/\{ExampleModelName\}/g,_0x38a967)[_0x2e24a8(0x106)](/\{ApiFileName\}/g,_0x1c22ab||_0x2e24a8(0xef))[_0x2e24a8(0x106)](/\{ConfigName\}/g,_0x24257e||'default')['replace'](/\{ClientConfigParam\}/g,_0x3e4b49||'')[_0x2e24a8(0x106)](/\{VarPrefix\}/g,_0x4554b6||'LOVRABET')[_0x2e24a8(0x106)](/\{CreatedAt\}/g,_0x43c625);return _0x9783c6;}static async[a139_0x47f043(0xdf)](_0x5d565c,_0x112205,_0x1f83a8,_0x11fb08,_0x289385=!![]){const _0x5500f1=a139_0x47f043,_0x40fb3f=Date[_0x5500f1(0xe4)]();try{_0x289385&&logger[_0x5500f1(0xfd)](_0x5500f1(0xe7),_0x5500f1(0xe6),{'templatePath':_0x5d565c,'targetPath':_0x112205,'pageName':_0x1f83a8,'templateName':_0x11fb08});await a139_0x480867['promises'][_0x5500f1(0x10e)](_0x112205,{'recursive':!![]}),await this[_0x5500f1(0x115)](_0x5d565c,_0x112205,_0x1f83a8,_0x11fb08);if(_0x289385){const _0x86553f=Date[_0x5500f1(0xe4)]()-_0x40fb3f;logger[_0x5500f1(0xf1)](_0x5500f1(0xe7),_0x5500f1(0xf4),_0x86553f,{'pageName':_0x1f83a8,'templateName':_0x11fb08});}}catch(_0x3dc197){if(_0x289385){const _0x4bde41=Date[_0x5500f1(0xe4)]()-_0x40fb3f;logger[_0x5500f1(0xe0)]('template','模板内容替换失败',{'templatePath':_0x5d565c,'targetPath':_0x112205,'pageName':_0x1f83a8,'templateName':_0x11fb08,'error':_0x3dc197 instanceof Error?_0x3dc197[_0x5500f1(0x11a)]:String(_0x3dc197),'duration':_0x4bde41});}throw _0x3dc197;}}static async[a139_0x47f043(0x115)](_0x23f89a,_0x1ed49e,_0x49dacc,_0x502d68){const _0x115ca7=a139_0x47f043,_0x13ba94=await a139_0x480867['promises'][_0x115ca7(0xe1)](_0x23f89a,{'withFileTypes':!![]});for(const _0x3f0684 of _0x13ba94){const _0x46d60d=a139_0x32574a[_0x115ca7(0x100)](_0x23f89a,_0x3f0684[_0x115ca7(0xe5)]);let _0x2465f2=a139_0x32574a['join'](_0x1ed49e,_0x3f0684[_0x115ca7(0xe5)]);_0x3f0684[_0x115ca7(0xe5)][_0x115ca7(0x10b)](_0x115ca7(0xf0))&&(_0x2465f2=a139_0x32574a[_0x115ca7(0x100)](_0x1ed49e,_0x3f0684[_0x115ca7(0xe5)]['replace'](/\.tpl$/,'')));if(_0x3f0684[_0x115ca7(0x103)]())await a139_0x480867[_0x115ca7(0x101)]['mkdir'](_0x2465f2,{'recursive':!![]}),await this[_0x115ca7(0x115)](_0x46d60d,_0x2465f2,_0x49dacc,_0x502d68);else _0x3f0684['isFile']()&&await this[_0x115ca7(0x102)](_0x46d60d,_0x2465f2,_0x49dacc,_0x502d68);}}static async[a139_0x47f043(0x102)](_0x8d006e,_0x470fe7,_0x19a797,_0x279ba8){const _0x489966=a139_0x47f043,_0x262630=a139_0x32574a[_0x489966(0xdd)](_0x8d006e)[_0x489966(0x10f)]();_0x8d006e[_0x489966(0x10b)](_0x489966(0xf0))&&(_0x470fe7=_0x470fe7['replace'](/\.tpl$/,''));const _0x361c64=['.tsx','.ts',_0x489966(0xf3),_0x489966(0xf6),_0x489966(0xf8),'.md',_0x489966(0xed),_0x489966(0xea),'.tpl'];if(_0x361c64['includes'](_0x262630)||_0x8d006e[_0x489966(0x10b)](_0x489966(0xf0))){const _0x3fabf9=await a139_0x480867[_0x489966(0x101)][_0x489966(0xfa)](_0x8d006e,'utf8'),_0x42fa56=this[_0x489966(0x109)](_0x3fabf9,_0x19a797,_0x279ba8);await a139_0x480867['promises'][_0x489966(0x110)](_0x470fe7,_0x42fa56,_0x489966(0x112));}else await a139_0x480867[_0x489966(0x101)][_0x489966(0x10a)](_0x8d006e,_0x470fe7);}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a140_0x440f(_0x17d349,_0x16474b){_0x17d349=_0x17d349-0x118;var _0x73cb12=a140_0x73cb();var _0x440f8f=_0x73cb12[_0x17d349];return _0x440f8f;}(function(_0x1c423b,_0x3f143d){var _0x1d78cb=a140_0x440f,_0x49d334=_0x1c423b();while(!![]){try{var _0x2dbe60=parseInt(_0x1d78cb(0x120))/0x1*(parseInt(_0x1d78cb(0x121))/0x2)+parseInt(_0x1d78cb(0x119))/0x3+-parseInt(_0x1d78cb(0x11c))/0x4*(-parseInt(_0x1d78cb(0x11e))/0x5)+-parseInt(_0x1d78cb(0x118))/0x6+-parseInt(_0x1d78cb(0x11b))/0x7+parseInt(_0x1d78cb(0x11f))/0x8*(-parseInt(_0x1d78cb(0x11d))/0x9)+parseInt(_0x1d78cb(0x11a))/0xa;if(_0x2dbe60===_0x3f143d)break;else _0x49d334['push'](_0x49d334['shift']());}catch(_0x342f32){_0x49d334['push'](_0x49d334['shift']());}}}(a140_0x73cb,0xd8b40));import{VERSION}from'../generated/build-info.js';function a140_0x73cb(){var _0x20fa77=['369hdFFIl','5WolkOz','91912Rfquul','307fZEGvH','3062MgArvm','6791442pVdGjk','2031915eveMnZ','18776200mzQdRs','7818069YsrPYO','2329988WLZeat'];a140_0x73cb=function(){return _0x20fa77;};return a140_0x73cb();}export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f32af,_0x53f155){var _0x55e428=a141_0x3fbd,_0x5e096f=_0x3f32af();while(!![]){try{var _0x454591=parseInt(_0x55e428(0xa8))/0x1*(-parseInt(_0x55e428(0xac))/0x2)+parseInt(_0x55e428(0xb2))/0x3*(-parseInt(_0x55e428(0xb3))/0x4)+-parseInt(_0x55e428(0xaf))/0x5*(-parseInt(_0x55e428(0xae))/0x6)+parseInt(_0x55e428(0xb1))/0x7*(-parseInt(_0x55e428(0xb0))/0x8)+parseInt(_0x55e428(0xaa))/0x9*(-parseInt(_0x55e428(0xab))/0xa)+parseInt(_0x55e428(0xad))/0xb*(parseInt(_0x55e428(0xa9))/0xc)+-parseInt(_0x55e428(0xa6))/0xd*(-parseInt(_0x55e428(0xa7))/0xe);if(_0x454591===_0x53f155)break;else _0x5e096f['push'](_0x5e096f['shift']());}catch(_0x516442){_0x5e096f['push'](_0x5e096f['shift']());}}}(a141_0x2273,0xde0fb));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a141_0x3fbd(_0x2527da,_0x1adcf3){_0x2527da=_0x2527da-0xa6;var _0x2273c9=a141_0x2273();var _0x3fbd7b=_0x2273c9[_0x2527da];return _0x3fbd7b;}function a141_0x2273(){var _0x4383fe=['380HHSCSz','32kJQumf','7178468oHOIJr','12LeyMYb','1065225pRnZoi','24DbrxOc','1552796HhZpti','3hWoBkW','1427948zVzERA','52PKTENx','10420508CTdoMN','46918NawEzj','12ogNpIm','325242ADIfhO'];a141_0x2273=function(){return _0x4383fe;};return a141_0x2273();}export async function withActiveCookie(_0x1ec495,_0x44f179){setActiveCookie(_0x1ec495);try{return await _0x44f179();}finally{clearActiveCookie();}}
|