@lovrabet/lovrabet-cli 2.0.2 → 2.0.4-beta.0
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/LICENSE +184 -0
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- 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/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -0
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.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/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.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/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -0
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -0
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +8 -7
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a53_0x1b36(_0x214325,_0x162669){_0x214325=_0x214325-0x1c3;const _0x3f8ba0=a53_0x3f8b();let _0x1b368f=_0x3f8ba0[_0x214325];return _0x1b368f;}(function(_0x538aed,_0x242958){const _0xed4d91=a53_0x1b36,_0x51d49a=_0x538aed();while(!![]){try{const _0x1806d5=parseInt(_0xed4d91(0x1d0))/0x1+parseInt(_0xed4d91(0x1ce))/0x2+parseInt(_0xed4d91(0x1d3))/0x3*(-parseInt(_0xed4d91(0x1d2))/0x4)+-parseInt(_0xed4d91(0x1e1))/0x5+parseInt(_0xed4d91(0x1c3))/0x6+parseInt(_0xed4d91(0x1c6))/0x7+-parseInt(_0xed4d91(0x1d5))/0x8;if(_0x1806d5===_0x242958)break;else _0x51d49a['push'](_0x51d49a['shift']());}catch(_0x1262dc){_0x51d49a['push'](_0x51d49a['shift']());}}}(a53_0x3f8b,0xa0b5d));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';function a53_0x3f8b(){const _0x4b2add=['1990706uCzfWp','pageSize','1174475DXLZcI','`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a','360VUplyU','29694kIDjJk','riskLevel','6242448OPaioG','error','requiresAppCode','appCode','defaultPageSize','defaultVerbose','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20.lovrabet.json.','env','requiresAuth','verbose','mergedCli','cancelled','5371255cpnPwo','currentApp','2311728QxkByX','format','../core/api-client.js','5939710tIxFLV','command','Set\x20accessKey\x20in\x20.lovrabet.json\x20or\x20pass\x20LOVRABET_ACCESS_KEY.','High-risk\x20operation\x20`','configMissing','accessKey','defaultApp','validation'];a53_0x3f8b=function(){return _0x4b2add;};return a53_0x3f8b();}export function resolveAuthMode(_0x5ae07e){return void _0x5ae07e,AUTH_MODE['ClientAk'];}export function createPipelineEnv(_0x1792af,_0x102a63){const _0x4a9a48=a53_0x1b36;return{'rawFlags':_0x102a63,'appCode':_0x1792af[_0x4a9a48(0x1d8)]||process.env.RABETBASE_APPCODE||readAppCodeFromConfig(),'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x102a63),'defaultFormat':_0x1792af[_0x4a9a48(0x1c4)],'defaultPageSize':_0x1792af[_0x4a9a48(0x1cf)],'defaultVerbose':_0x1792af[_0x4a9a48(0x1de)],'riskLevel':_0x1792af[_0x4a9a48(0x1d4)],'accessKey':_0x1792af[_0x4a9a48(0x1cb)],'env':_0x1792af[_0x4a9a48(0x1dc)],'mergedCli':{'defaultApp':_0x1792af[_0x4a9a48(0x1cc)],'currentApp':_0x1792af[_0x4a9a48(0x1e2)],'appCode':_0x1792af['appCode']}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS['filter'](_0x15d0ee=>PIPELINE_FLAG_NAMES['has'](_0x15d0ee['name']))['map'](({name:_0x552f0e,type:_0x131a62,description:_0x441d05})=>({'name':_0x552f0e,'type':_0x131a62,'description':_0x441d05})),'formatOutput':formatOutput,'getCommandLabel'(_0x460691){const _0x4e02f0=a53_0x1b36;return CLI_BIN_NAME+'\x20'+_0x460691['service']+'\x20'+_0x460691[_0x4e02f0(0x1c7)];},'riskPolicy':{'onViolation'(_0xd5690b){const _0xc82fa4=a53_0x1b36;console[_0xc82fa4(0x1d6)](_0xd5690b);},'createError'(_0x4fa0ea){const _0x43386d=a53_0x1b36;return CliErrors[_0x43386d(0x1e0)](_0x4fa0ea);}},async 'prepare'(_0x4d544c,_0xd5364e){const _0x8ef8e=a53_0x1b36,_0xe17d23=resolveAuthMode(_0xd5364e);if(_0x4d544c[_0x8ef8e(0x1dd)]!==![]){if(!_0xd5364e[_0x8ef8e(0x1cb)])throw CliErrors['authRequired'](_0x8ef8e(0x1c8));const {setActiveAK:_0x127942}=await import(_0x8ef8e(0x1c5));_0x127942(_0xd5364e['accessKey']);}let _0x5c37a3='';if(_0x4d544c[_0x8ef8e(0x1d7)]!==![]){_0x5c37a3=_0xd5364e[_0x8ef8e(0x1d8)]??'';if(!_0x5c37a3)throw CliErrors[_0x8ef8e(0x1ca)](_0x8ef8e(0x1db));}if(_0x5c37a3){const {initSdkClient:_0x44595d}=await import('../core/sdk-client.js');_0x44595d({'appCode':_0x5c37a3,'env':_0xd5364e[_0x8ef8e(0x1dc)]??'production','accessKey':_0xd5364e['accessKey'],'authMode':_0xe17d23});}return{'defaults':{'booleans':{'verbose':_0xd5364e[_0x8ef8e(0x1da)]},'numbers':{'pagesize':_0xd5364e[_0x8ef8e(0x1d9)]}},'extras':{'appCode':_0x5c37a3,'cookie':'','apiDomain':_0xd5364e['apiDomain'],'apiDir':'','accessKey':_0xd5364e[_0x8ef8e(0x1cb)],'envName':_0xd5364e[_0x8ef8e(0x1dc)],'mergedCli':_0xd5364e[_0x8ef8e(0x1df)]}};},async 'confirmHighRisk'({def:_0x5cb55c,env:_0x575ef3,flags:_0x87881c,commandLabel:_0x471479}){const _0x1e421a=a53_0x1b36;if(_0x575ef3['isNonInteractive']){const _0xed1feb=reconstructCommandArgv(_0x5cb55c,_0x87881c);throw CliErrors[_0x1e421a(0x1cd)](_0x1e421a(0x1c9)+_0x471479+_0x1e421a(0x1d1)+('\x20\x20To\x20proceed:\x20'+_0xed1feb));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x5cb55c,_0x471479,_0x87881c),'createCancelledError':_0x2bb613=>CliErrors[_0x1e421a(0x1e0)](_0x2bb613)});},'mapDryRunError'(_0x8dee21){return mapUserFacingExecuteError(_0x8dee21);},'mapExecuteError'(_0x4c714f){return mapUserFacingExecuteError(_0x4c714f);},async 'finalize'(){const _0x55c3e8=a53_0x1b36,{clearActiveAK:_0x49d8ee}=await import(_0x55c3e8(0x1c5));_0x49d8ee();}};export async function runCommand(_0x165639,_0x5c0f4a){await runCommandWithAdapter(_0x165639,_0x5c0f4a,runnerAdapter);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ecaab,_0x4f9fd9){const _0x3fb669=a54_0x1aef,_0x581c97=_0x3ecaab();while(!![]){try{const _0x2e20b3=parseInt(_0x3fb669(0x15e))/0x1*(parseInt(_0x3fb669(0x160))/0x2)+-parseInt(_0x3fb669(0x161))/0x3+-parseInt(_0x3fb669(0x158))/0x4+-parseInt(_0x3fb669(0x159))/0x5+-parseInt(_0x3fb669(0x15c))/0x6+-parseInt(_0x3fb669(0x15a))/0x7*(parseInt(_0x3fb669(0x157))/0x8)+-parseInt(_0x3fb669(0x15d))/0x9*(-parseInt(_0x3fb669(0x15b))/0xa);if(_0x2e20b3===_0x4f9fd9)break;else _0x581c97['push'](_0x581c97['shift']());}catch(_0x33b0f4){_0x581c97['push'](_0x581c97['shift']());}}}(a54_0x4f47,0xa05fe));import{buildSchemaPayload as a54_0x5b5ad8}from'@lovrabet/cli-framework';function a54_0x4f47(){const _0xdf734c=['304652SonyrW','1506762FIPLYb','160haODlc','1196804gSUlMy','1132190QfJZxj','141827btTVby','1430zddpNS','1189260HnOYit','76905RWwBTt','7PZLmUn','../commands/registry.js'];a54_0x4f47=function(){return _0xdf734c;};return a54_0x4f47();}function a54_0x1aef(_0x11c6e5,_0x455776){_0x11c6e5=_0x11c6e5-0x157;const _0x4f47d1=a54_0x4f47();let _0x1aef25=_0x4f47d1[_0x11c6e5];return _0x1aef25;}import{buildAllFlags}from'../framework/build-all-flags.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0x48693e=a54_0x1aef,{serviceRegistry:_0x4e2406,findDefinition:_0x48de6e}=await import(_0x48693e(0x15f));return a54_0x5b5ad8({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':process.env.GIT_COMMIT??'','globalFlags':GLOBAL_FLAGS,'serviceRegistry':_0x4e2406,'buildAllFlags':buildAllFlags,'findDefinition':_0x48de6e});}
|
package/lib/framework/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a55_0x5132(_0x48f00d,_0x529cbd){_0x48f00d=_0x48f00d-0x73;var _0x44bbbe=a55_0x44bb();var _0x513244=_0x44bbbe[_0x48f00d];return _0x513244;}(function(_0x4eb03b,_0x410fd1){var _0x3efa75=a55_0x5132,_0x43772f=_0x4eb03b();while(!![]){try{var _0x549196=parseInt(_0x3efa75(0x78))/0x1+-parseInt(_0x3efa75(0x73))/0x2+parseInt(_0x3efa75(0x77))/0x3+-parseInt(_0x3efa75(0x75))/0x4+parseInt(_0x3efa75(0x76))/0x5+-parseInt(_0x3efa75(0x79))/0x6+parseInt(_0x3efa75(0x74))/0x7;if(_0x549196===_0x410fd1)break;else _0x43772f['push'](_0x43772f['shift']());}catch(_0x48f332){_0x43772f['push'](_0x43772f['shift']());}}}(a55_0x44bb,0xe3a85));export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';function a55_0x44bb(){var _0x2c4124=['14487774GVJZyM','3962048jdRZHz','7468925seiYJH','4311102JHTJFN','375278aWVsFQ','10645254TqNFpq','3357146cwSoFW'];a55_0x44bb=function(){return _0x2c4124;};return a55_0x44bb();}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5dfaf7,_0x1d0a15){const _0x1cd52b=a56_0x21c2,_0x418055=_0x5dfaf7();while(!![]){try{const _0x3c4d99=parseInt(_0x1cd52b(0x1df))/0x1*(-parseInt(_0x1cd52b(0x1e1))/0x2)+parseInt(_0x1cd52b(0x1e5))/0x3*(-parseInt(_0x1cd52b(0x1db))/0x4)+-parseInt(_0x1cd52b(0x1e8))/0x5*(-parseInt(_0x1cd52b(0x1e2))/0x6)+-parseInt(_0x1cd52b(0x1dc))/0x7*(parseInt(_0x1cd52b(0x1da))/0x8)+parseInt(_0x1cd52b(0x1e3))/0x9*(-parseInt(_0x1cd52b(0x1e0))/0xa)+-parseInt(_0x1cd52b(0x1e4))/0xb*(parseInt(_0x1cd52b(0x1d7))/0xc)+parseInt(_0x1cd52b(0x1d8))/0xd;if(_0x3c4d99===_0x1d0a15)break;else _0x418055['push'](_0x418055['shift']());}catch(_0x25f976){_0x418055['push'](_0x418055['shift']());}}}(a56_0x1e9e,0x696ef));import{jsx as a56_0x5eb911,jsxs as a56_0x197ddf}from'react/jsx-runtime';import{useEffect}from'react';function a56_0x21c2(_0x49c39d,_0x54f439){_0x49c39d=_0x49c39d-0x1d7;const _0x1e9e2e=a56_0x1e9e();let _0x21c26c=_0x1e9e2e[_0x49c39d];return _0x21c26c;}import{Box,Text,useApp}from'ink';function a56_0x1e9e(){const _0x4f2f09=['95jeiryI','240UvqlPA','23061870LHVkeB','\x20--help','40gQrVdW','364956tPMGII','984403QsJcqx','\x20to\x20view\x20available\x20commands.','green','62429hcGaxB','20xBUTEH','8LvprSL','177942NOQKNt','1815381sWspkm','251955tycwHH','3tHfnmI','\x20\x20Use\x20','column'];a56_0x1e9e=function(){return _0x4f2f09;};return a56_0x1e9e();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME}from'./constant/cli.js';export function Help(){const _0x188f09=a56_0x21c2,{exit:_0xc25e75}=useApp();return useEffect(()=>{_0xc25e75();},[_0xc25e75]),a56_0x197ddf(Box,{'flexDirection':_0x188f09(0x1e7),'marginTop':0x1,'marginBottom':0x1,'children':[a56_0x5eb911(Box,{'children':a56_0x5eb911(Text,{'bold':!![],'color':_0x188f09(0x1de),'children':'\x20\x20'+CLI_DISPLAY_NAME})}),a56_0x197ddf(Box,{'marginTop':0x1,'children':[a56_0x5eb911(Text,{'dimColor':!![],'children':_0x188f09(0x1e6)}),a56_0x5eb911(Text,{'bold':!![],'color':'green','children':CLI_BIN_NAME+_0x188f09(0x1d9)}),a56_0x5eb911(Text,{'dimColor':!![],'children':_0x188f09(0x1dd)})]})]});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a57_0x2cb4(_0x35bb89,_0x40158b){_0x35bb89=_0x35bb89-0xdc;const _0x4d1e07=a57_0x4d1e();let _0x2cb42b=_0x4d1e07[_0x35bb89];return _0x2cb42b;}const a57_0x411772=a57_0x2cb4;function a57_0x4d1e(){const _0x344e48=['5AgPoWx','stderr','status','72YWxcOC','unknown','stdout','toString','exit\x20','log','98ltruew','431568zGLPrI','stdio','1472364VoEjvR','inherit','trim','36454PPIuSG','add','skills','218336ShDwSw','LOVRABET_SKIP_NPX_SKILLS','372530IPlaWp','npx','pipe','lovrabet/lovrabet-cli','183074kcXdeZ','2cqaKOZ','920538fsAxZc','816mPRIwi'];a57_0x4d1e=function(){return _0x344e48;};return a57_0x4d1e();}(function(_0x6b497f,_0x500281){const _0x13c807=a57_0x2cb4,_0x263d16=_0x6b497f();while(!![]){try{const _0x501161=parseInt(_0x13c807(0xe8))/0x1*(-parseInt(_0x13c807(0xe7))/0x2)+-parseInt(_0x13c807(0xf7))/0x3+-parseInt(_0x13c807(0xf5))/0x4+-parseInt(_0x13c807(0xeb))/0x5*(-parseInt(_0x13c807(0xe9))/0x6)+-parseInt(_0x13c807(0xf4))/0x7*(-parseInt(_0x13c807(0xe1))/0x8)+-parseInt(_0x13c807(0xee))/0x9*(-parseInt(_0x13c807(0xe3))/0xa)+parseInt(_0x13c807(0xde))/0xb*(parseInt(_0x13c807(0xea))/0xc);if(_0x501161===_0x500281)break;else _0x263d16['push'](_0x263d16['shift']());}catch(_0x4a01c6){_0x263d16['push'](_0x263d16['shift']());}}}(a57_0x4d1e,0x43a8d));import{spawnSync}from'node:child_process';import{resolveNpmBin}from'../utils/platform.js';export const LOVRABET_SKILL_SOURCE=a57_0x411772(0xe6);export const LOVRABET_SKIP_NPX_SKILLS_ENV=a57_0x411772(0xe2);export function shouldSkipNpxSkillsAdd(){return process.env[LOVRABET_SKIP_NPX_SKILLS_ENV]==='1';}export function runNpxSkillsAddGlobal(_0x390036,_0x2d20f2=LOVRABET_SKILL_SOURCE,_0x213922){const _0x1a56aa=a57_0x411772;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5b9614=_0x213922?.[_0x1a56aa(0xf6)]??_0x1a56aa(0xdc),_0x49da00=resolveNpmBin(_0x1a56aa(0xe4)),_0x1cdb73=[_0x1a56aa(0xe0),_0x1a56aa(0xdf),_0x2d20f2,'-g','-y'],_0x13da78=[_0x49da00,..._0x1cdb73]['join']('\x20');console[_0x1a56aa(0xf3)]('*\x20'+_0x13da78);const _0x985bc2=spawnSync(_0x49da00,_0x1cdb73,{'cwd':_0x390036,'stdio':_0x5b9614,'env':process.env,'shell':![]});if(_0x985bc2['status']===0x0)return{'ok':!![],'status':0x0};let _0x43d60e=_0x1a56aa(0xf2)+(_0x985bc2[_0x1a56aa(0xed)]??_0x1a56aa(0xef));if(_0x5b9614===_0x1a56aa(0xe5)){const _0x23f125=_0x985bc2[_0x1a56aa(0xec)]?_0x985bc2[_0x1a56aa(0xec)][_0x1a56aa(0xf1)]()['trim']():'',_0x4870e2=_0x985bc2['stdout']?_0x985bc2[_0x1a56aa(0xf0)][_0x1a56aa(0xf1)]()[_0x1a56aa(0xdd)]():'';if(_0x23f125)_0x43d60e=_0x23f125;else{if(_0x4870e2)_0x43d60e=_0x4870e2;}}return{'ok':![],'status':_0x985bc2[_0x1a56aa(0xed)]??null,'error':_0x43d60e};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c0727,_0x9ecea2){const _0x4c5da8=a58_0x3bf8,_0x163b9d=_0x3c0727();while(!![]){try{const _0x4aa191=parseInt(_0x4c5da8(0x1df))/0x1*(parseInt(_0x4c5da8(0x1da))/0x2)+-parseInt(_0x4c5da8(0x1d9))/0x3+-parseInt(_0x4c5da8(0x1e0))/0x4+-parseInt(_0x4c5da8(0x1de))/0x5+parseInt(_0x4c5da8(0x1db))/0x6*(-parseInt(_0x4c5da8(0x1dc))/0x7)+-parseInt(_0x4c5da8(0x1e1))/0x8*(parseInt(_0x4c5da8(0x1dd))/0x9)+parseInt(_0x4c5da8(0x1d8))/0xa;if(_0x4aa191===_0x9ecea2)break;else _0x163b9d['push'](_0x163b9d['shift']());}catch(_0x40cdef){_0x163b9d['push'](_0x163b9d['shift']());}}}(a58_0x11a5,0x9233d));function a58_0x11a5(){const _0x52f466=['1179693puHjWf','397690VMxnGw','29676PwyeJN','301hLfFgm','9uVftrs','3772925tlqlkP','5AngLKw','3475412GjCshz','1904744ZQRNoa','20720600DJapBf'];a58_0x11a5=function(){return _0x52f466;};return a58_0x11a5();}import{createJqFilter,resolveBundledJqPaths}from'@lovrabet/cli-framework';import{CliErrors}from'../errors.js';function a58_0x3bf8(_0x44616f,_0x2a387a){_0x44616f=_0x44616f-0x1d8;const _0x11a5d9=a58_0x11a5();let _0x3bf89=_0x11a5d9[_0x44616f];return _0x3bf89;}export const applyJqFilter=createJqFilter(CliErrors,{'bundledJqPaths':resolveBundledJqPaths()});
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x2de963=a59_0x4178;(function(_0x3a4c65,_0x342e94){const _0xabae4=a59_0x4178,_0x563d8d=_0x3a4c65();while(!![]){try{const _0x3894a1=-parseInt(_0xabae4(0x1bd))/0x1*(-parseInt(_0xabae4(0x193))/0x2)+parseInt(_0xabae4(0x1be))/0x3+-parseInt(_0xabae4(0x1a2))/0x4+parseInt(_0xabae4(0x1bc))/0x5+-parseInt(_0xabae4(0x19b))/0x6*(-parseInt(_0xabae4(0x19a))/0x7)+parseInt(_0xabae4(0x1c0))/0x8+parseInt(_0xabae4(0x19d))/0x9*(-parseInt(_0xabae4(0x1bb))/0xa);if(_0x3894a1===_0x342e94)break;else _0x563d8d['push'](_0x563d8d['shift']());}catch(_0xf88bd0){_0x563d8d['push'](_0x563d8d['shift']());}}}(a59_0x5742,0xe6f19));import a59_0x3e1800 from'winston';import a59_0x3d55fe from'node:fs';function a59_0x5742(){const _0x1d7410=['combine','existsSync','transports','createLogger','clear','success','green','format','setRawCommand','writeFileSync','yellow','mkdirSync','stringify','warn','map','duration','level','133090aLGIHp','1254625LzFSmM','1HyTzDs','2664924xFyAeJ','getWinstonInstance','14511544mOXofn','details','trim','Failed\x20to\x20clear\x20logs:','parse','addColors','command','now','error','Failed:\x20','.lovrabet-runtime.log','info','328902vixvNZ','timestamp','initWinstonLogger','unknown','clearLogs','logFilePath','rawCommand','7SJUzvk','8879106YvuZzA','log','1251SDgTOF','printf','filter','message','split','7206328LbZjWK','blue','winstonLogger','currentRawCommand','File','logTask','join','utf8'];a59_0x5742=function(){return _0x1d7410;};return a59_0x5742();}import a59_0x5cf6c3 from'node:path';function a59_0x4178(_0x511ab2,_0x57d257){_0x511ab2=_0x511ab2-0x18a;const _0x5742be=a59_0x5742();let _0x417862=_0x5742be[_0x511ab2];return _0x417862;}class Logger{[a59_0x2de963(0x1a4)];[a59_0x2de963(0x198)]='';[a59_0x2de963(0x1a5)]='';constructor(){}[a59_0x2de963(0x1b2)](_0x5ef93a){const _0x5362b0=a59_0x2de963;this[_0x5362b0(0x1a5)]=_0x5ef93a;}['setLogPath'](_0x533c6e){const _0x4b9bfc=a59_0x2de963;this[_0x4b9bfc(0x198)]=a59_0x5cf6c3[_0x4b9bfc(0x1a8)](_0x533c6e,_0x4b9bfc(0x191)),this[_0x4b9bfc(0x1a4)]&&this[_0x4b9bfc(0x1a4)][_0x4b9bfc(0x1ae)](),this[_0x4b9bfc(0x195)]();}[a59_0x2de963(0x195)](){const _0x39e0a1=a59_0x2de963,_0x5d2bc9=a59_0x5cf6c3['dirname'](this[_0x39e0a1(0x198)]);!a59_0x3d55fe[_0x39e0a1(0x1ab)](_0x5d2bc9)&&a59_0x3d55fe[_0x39e0a1(0x1b5)](_0x5d2bc9,{'recursive':!![]});const _0x9accd3=a59_0x3e1800['format'][_0x39e0a1(0x1aa)](a59_0x3e1800[_0x39e0a1(0x1b1)][_0x39e0a1(0x194)](),a59_0x3e1800['format']['errors']({'stack':!![]}),a59_0x3e1800['format'][_0x39e0a1(0x19e)](_0xe48f99=>{const _0xbb67a3=_0x39e0a1,_0x3083f2={'timestamp':_0xe48f99[_0xbb67a3(0x194)]||new Date()['toISOString'](),'level':_0xe48f99[_0xbb67a3(0x1ba)]||_0xbb67a3(0x192),'command':_0xe48f99[_0xbb67a3(0x18d)]||_0xbb67a3(0x196),'rawCommand':_0xe48f99[_0xbb67a3(0x199)]||this[_0xbb67a3(0x1a5)]||undefined,'message':_0xe48f99['message']||'','duration':_0xe48f99[_0xbb67a3(0x1b9)]||undefined,'details':_0xe48f99[_0xbb67a3(0x1c1)]||undefined};return JSON[_0xbb67a3(0x1b6)](_0x3083f2);}));this[_0x39e0a1(0x1a4)]=a59_0x3e1800[_0x39e0a1(0x1ad)]({'level':'info','format':_0x9accd3,'transports':[new a59_0x3e1800[(_0x39e0a1(0x1ac))][(_0x39e0a1(0x1a6))]({'filename':this[_0x39e0a1(0x198)],'level':'info'})],'silent':![]}),a59_0x3e1800[_0x39e0a1(0x18c)]({'success':_0x39e0a1(0x1b0),'error':'red','warn':_0x39e0a1(0x1b4),'info':_0x39e0a1(0x1a3)});}[a59_0x2de963(0x192)](_0x3433f6,_0x2b95aa,_0x2271e8){const _0x437584=a59_0x2de963;if(!this[_0x437584(0x198)]||!this['winstonLogger'])return;this[_0x437584(0x1a4)][_0x437584(0x192)](_0x2b95aa,{'command':_0x3433f6,'details':_0x2271e8});}[a59_0x2de963(0x1af)](_0x1c1e7e,_0x6fed1e,_0x2bf86b,_0xb47791){const _0x9e6cb8=a59_0x2de963;if(!this['logFilePath']||!this['winstonLogger'])return;this['winstonLogger'][_0x9e6cb8(0x19c)](_0x9e6cb8(0x192),_0x6fed1e,{'level':'success','command':_0x1c1e7e,'duration':_0x2bf86b,'details':_0xb47791});}[a59_0x2de963(0x18f)](_0x6fdeee,_0x13483d,_0x381e8c){const _0x267819=a59_0x2de963;if(!this['logFilePath']||!this['winstonLogger'])return;this['winstonLogger'][_0x267819(0x18f)](_0x13483d,{'command':_0x6fdeee,'details':_0x381e8c});}[a59_0x2de963(0x1b7)](_0x14b438,_0x3468cd,_0x42ce9b){const _0xa794f8=a59_0x2de963;if(!this[_0xa794f8(0x198)]||!this[_0xa794f8(0x1a4)])return;this[_0xa794f8(0x1a4)]['warn'](_0x3468cd,{'command':_0x14b438,'details':_0x42ce9b});}async[a59_0x2de963(0x1a7)](_0xba94ef,_0x2674ee,_0x385e04){const _0x5e57ae=a59_0x2de963,_0x15d708=Date['now']();this['info'](_0xba94ef,'Starting:\x20'+_0x2674ee);try{const _0x150c3e=await _0x385e04(),_0x2c8fa5=Date[_0x5e57ae(0x18e)]()-_0x15d708;return this[_0x5e57ae(0x1af)](_0xba94ef,'Completed:\x20'+_0x2674ee,_0x2c8fa5),_0x150c3e;}catch(_0x39eb8e){const _0x261fd8=Date[_0x5e57ae(0x18e)]()-_0x15d708;this[_0x5e57ae(0x18f)](_0xba94ef,_0x5e57ae(0x190)+_0x2674ee,{'error':_0x39eb8e instanceof Error?_0x39eb8e[_0x5e57ae(0x1a0)]:String(_0x39eb8e),'duration':_0x261fd8});throw _0x39eb8e;}}['readLogs'](){const _0x2ec13c=a59_0x2de963;try{if(!a59_0x3d55fe[_0x2ec13c(0x1ab)](this[_0x2ec13c(0x198)]))return[];const _0x30008c=a59_0x3d55fe['readFileSync'](this[_0x2ec13c(0x198)],_0x2ec13c(0x1a9));return _0x30008c[_0x2ec13c(0x1a1)](/\r?\n/)[_0x2ec13c(0x19f)](_0x4bd287=>_0x4bd287[_0x2ec13c(0x1c2)]())[_0x2ec13c(0x1b8)](_0xd7020f=>JSON[_0x2ec13c(0x18b)](_0xd7020f));}catch(_0xe90b4){return console[_0x2ec13c(0x1b7)]('Failed\x20to\x20read\x20logs:',_0xe90b4),[];}}[a59_0x2de963(0x197)](){const _0x3a0141=a59_0x2de963;try{a59_0x3d55fe[_0x3a0141(0x1ab)](this[_0x3a0141(0x198)])&&a59_0x3d55fe[_0x3a0141(0x1b3)](this['logFilePath'],'','utf8');}catch(_0x534096){console[_0x3a0141(0x1b7)](_0x3a0141(0x18a),_0x534096);}}[a59_0x2de963(0x1bf)](){const _0x5db98d=a59_0x2de963;return this[_0x5db98d(0x1a4)];}}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x309bb3,_0xd1f6dc){var _0x5ec2a4=a60_0x3a39,_0x10229c=_0x309bb3();while(!![]){try{var _0x1a1f97=parseInt(_0x5ec2a4(0x1eb))/0x1*(-parseInt(_0x5ec2a4(0x1e0))/0x2)+parseInt(_0x5ec2a4(0x1ec))/0x3*(parseInt(_0x5ec2a4(0x1e8))/0x4)+-parseInt(_0x5ec2a4(0x1e7))/0x5+parseInt(_0x5ec2a4(0x1e3))/0x6*(parseInt(_0x5ec2a4(0x1de))/0x7)+parseInt(_0x5ec2a4(0x1e5))/0x8*(parseInt(_0x5ec2a4(0x1ea))/0x9)+parseInt(_0x5ec2a4(0x1dd))/0xa+parseInt(_0x5ec2a4(0x1e4))/0xb*(-parseInt(_0x5ec2a4(0x1e6))/0xc);if(_0x1a1f97===_0xd1f6dc)break;else _0x10229c['push'](_0x10229c['shift']());}catch(_0x140573){_0x10229c['push'](_0x10229c['shift']());}}}(a60_0x2c81,0xa369d));import{CliErrors}from'../errors.js';export function parseJsonParams(_0x4cac0d){var _0x599589=a60_0x3a39;if(!_0x4cac0d)return undefined;try{return JSON[_0x599589(0x1df)](_0x4cac0d);}catch{throw CliErrors[_0x599589(0x1db)](_0x599589(0x1da)+_0x4cac0d);}}function a60_0x2c81(){var _0x456947=['962975VOyJSm','188dzhtNw','object','3537DbDmsi','1UuHhul','84807TDZScZ','isArray','Invalid\x20JSON\x20for\x20--params:\x20','validation','items','3386190wEOsBu','5509357rjlafG','parse','1711630vBFCBK','Example:\x20--params\x20\x27[{\x22name\x22:\x22a\x22},{\x22name\x22:\x22b\x22}]\x27','batchCreate\x20--params\x20must\x20be\x20a\x20JSON\x20array\x20or\x20{\x22items\x22:[...]}','6MVglbJ','2615591IiFHRu','9208RsyeEk','60VQoTfL'];a60_0x2c81=function(){return _0x456947;};return a60_0x2c81();}function a60_0x3a39(_0x4936c7,_0x5318e5){_0x4936c7=_0x4936c7-0x1da;var _0x2c8137=a60_0x2c81();var _0x3a39f1=_0x2c8137[_0x4936c7];return _0x3a39f1;}export function parseJsonParamsValue(_0x40f1bb){var _0x2fac60=a60_0x3a39;if(!_0x40f1bb)return undefined;try{return JSON['parse'](_0x40f1bb);}catch{throw CliErrors['validation'](_0x2fac60(0x1da)+_0x40f1bb);}}export function parseBatchCreateItemsFromParams(_0x4e3574){var _0x165d29=a60_0x3a39;if(Array[_0x165d29(0x1ed)](_0x4e3574))return _0x4e3574;if(_0x4e3574!==null&&_0x4e3574!==undefined&&typeof _0x4e3574===_0x165d29(0x1e9)&&Array[_0x165d29(0x1ed)](_0x4e3574[_0x165d29(0x1dc)]))return _0x4e3574['items'];throw CliErrors[_0x165d29(0x1db)](_0x165d29(0x1e2),_0x165d29(0x1e1));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a61_0x48f2f9=a61_0x2dae;function a61_0x2dae(_0x4e0508,_0x3a516d){_0x4e0508=_0x4e0508-0x11e;const _0x2ce080=a61_0x2ce0();let _0x2daedc=_0x2ce080[_0x4e0508];return _0x2daedc;}(function(_0x454db3,_0x53119f){const _0x39aa3d=a61_0x2dae,_0x49814f=_0x454db3();while(!![]){try{const _0x5489f8=-parseInt(_0x39aa3d(0x127))/0x1+-parseInt(_0x39aa3d(0x125))/0x2*(parseInt(_0x39aa3d(0x121))/0x3)+-parseInt(_0x39aa3d(0x11e))/0x4+-parseInt(_0x39aa3d(0x123))/0x5+parseInt(_0x39aa3d(0x126))/0x6+parseInt(_0x39aa3d(0x124))/0x7*(-parseInt(_0x39aa3d(0x11f))/0x8)+parseInt(_0x39aa3d(0x122))/0x9;if(_0x5489f8===_0x53119f)break;else _0x49814f['push'](_0x49814f['shift']());}catch(_0x2737ab){_0x49814f['push'](_0x49814f['shift']());}}}(a61_0x2ce0,0x3fefa));export const isWindows=process['platform']===a61_0x48f2f9(0x128);function a61_0x2ce0(){const _0x51133a=['win32','1862352GWDEvn','2008ptzFpP','.cmd','65388IrJCnV','13573035lHPFHy','2113440WOnkki','8078svFAnB','4PSvGtv','666174ayFRVA','135740MOnSOa'];a61_0x2ce0=function(){return _0x51133a;};return a61_0x2ce0();}export function resolveNpmBin(_0x15c41d){const _0x469e31=a61_0x48f2f9;return isWindows?_0x15c41d+_0x469e31(0x120):_0x15c41d;}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51a0c2,_0x453925){const _0x214cad=a62_0x3472,_0xa500c9=_0x51a0c2();while(!![]){try{const _0x3ccd49=parseInt(_0x214cad(0x19e))/0x1+parseInt(_0x214cad(0x1a6))/0x2+parseInt(_0x214cad(0x1a5))/0x3+-parseInt(_0x214cad(0x1a7))/0x4+-parseInt(_0x214cad(0x1a4))/0x5*(-parseInt(_0x214cad(0x1a0))/0x6)+parseInt(_0x214cad(0x1a3))/0x7+-parseInt(_0x214cad(0x1a2))/0x8*(parseInt(_0x214cad(0x19d))/0x9);if(_0x3ccd49===_0x453925)break;else _0xa500c9['push'](_0xa500c9['shift']());}catch(_0x32cb2a){_0xa500c9['push'](_0xa500c9['shift']());}}}(a62_0x3fe7,0x4e2ed));function a62_0x3472(_0x46c45d,_0x373385){_0x46c45d=_0x46c45d-0x19c;const _0x3fe798=a62_0x3fe7();let _0x347233=_0x3fe798[_0x46c45d];return _0x347233;}import{readFileSync}from'node:fs';function a62_0x3fe7(){const _0x52dc25=['762831UdpeRA','857218kWFPSq','1861724ksDRME','parse','234063HaazCt','51950UwDbNI','version','288BaKyEL','package.json','200hBaIFW','3654777sSTGOL','18635VAyRDQ'];a62_0x3fe7=function(){return _0x52dc25;};return a62_0x3fe7();}import{dirname,join}from'node:path';import{fileURLToPath}from'node:url';let cached;export function getCliVersion(){const _0x3d4b29=a62_0x3472;if(cached)return cached;const _0x17ae78=join(dirname(fileURLToPath(import.meta.url)),'..','..'),_0x2db2f5=readFileSync(join(_0x17ae78,_0x3d4b29(0x1a1)),'utf8'),_0xa35e6f=JSON[_0x3d4b29(0x19c)](_0x2db2f5);return cached=_0xa35e6f[_0x3d4b29(0x19f)],cached;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a63_0x5dda(_0x564665,_0x8ed696){_0x564665=_0x564665-0x118;var _0x4e7e87=a63_0x4e7e();var _0x5dda96=_0x4e7e87[_0x564665];return _0x5dda96;}function a63_0x4e7e(){var _0x430d55=['292018UtHMgH','366bzGepP','105DWHQVl','322556lNqiju','48072GJWUMk','2271320KEHXpp','44uFkltb','1dcUtOT','write','16090dGqSbx','2403891htWAZY','6zOMxou','stderr','2510700yANrTR'];a63_0x4e7e=function(){return _0x430d55;};return a63_0x4e7e();}(function(_0x4b5153,_0xa524df){var _0x337766=a63_0x5dda,_0x3f02df=_0x4b5153();while(!![]){try{var _0x2c0fdc=parseInt(_0x337766(0x120))/0x1*(-parseInt(_0x337766(0x119))/0x2)+parseInt(_0x337766(0x124))/0x3*(-parseInt(_0x337766(0x11c))/0x4)+-parseInt(_0x337766(0x122))/0x5*(-parseInt(_0x337766(0x11a))/0x6)+-parseInt(_0x337766(0x11b))/0x7*(parseInt(_0x337766(0x11d))/0x8)+-parseInt(_0x337766(0x123))/0x9+-parseInt(_0x337766(0x11e))/0xa+parseInt(_0x337766(0x11f))/0xb*(parseInt(_0x337766(0x118))/0xc);if(_0x2c0fdc===_0xa524df)break;else _0x3f02df['push'](_0x3f02df['shift']());}catch(_0x3644b1){_0x3f02df['push'](_0x3f02df['shift']());}}}(a63_0x4e7e,0x228e9));export function writeCliSideChannelLine(_0x56da63){var _0x53556b=a63_0x5dda;process[_0x53556b(0x125)][_0x53556b(0x121)](_0x56da63+'\x0a');}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/lovrabet-cli",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"license": "
|
|
3
|
+
"version": "2.0.4-beta.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git@codeup.aliyun.com:yuntoo/open/lovrabet-runtime-cli.git"
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"build:dev": "rimraf lib && tsc && tsc-alias",
|
|
24
24
|
"start": "tsc --watch",
|
|
25
25
|
"typecheck": "tsc --noEmit",
|
|
26
|
+
"verify:bundled-jq": "node scripts/verify-bundled-jq.mjs",
|
|
27
|
+
"publish:github": "node scripts/publish-github.mjs",
|
|
26
28
|
"lint": "echo 'No linter configured yet'",
|
|
27
29
|
"beta-release": "sh scripts/update-beta-version.sh && bun run build && git push && git push origin --tag && bun publish --tag beta",
|
|
28
30
|
"release": "sh scripts/update-latest-version.sh && bun run build && git push && git push origin --tag && bun publish",
|
|
@@ -35,14 +37,13 @@
|
|
|
35
37
|
"lib"
|
|
36
38
|
],
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@lovrabet/cli-framework": "1.0.
|
|
39
|
-
"chalk": "^5.6.2",
|
|
40
|
+
"@lovrabet/cli-framework": "1.0.3",
|
|
40
41
|
"@lovrabet/sdk": "1.4.1",
|
|
41
42
|
"@types/winston": "^2.4.4",
|
|
43
|
+
"chalk": "^5.6.2",
|
|
42
44
|
"ink": "^6.2.3",
|
|
43
45
|
"ink-spinner": "^5.0.0",
|
|
44
46
|
"meow": "^13.2.0",
|
|
45
|
-
"node-jq": "^6.3.1",
|
|
46
47
|
"react": "^19.2.0",
|
|
47
48
|
"winston": "^3.17.0"
|
|
48
49
|
},
|
|
@@ -51,9 +52,9 @@
|
|
|
51
52
|
"@types/react": "^19.2.0",
|
|
52
53
|
"@vitest/coverage-v8": "^4.1.2",
|
|
53
54
|
"javascript-obfuscator": "^5.4.1",
|
|
54
|
-
"tsc-alias": "^1.8.10",
|
|
55
55
|
"rimraf": "^6.1.3",
|
|
56
|
-
"
|
|
56
|
+
"tsc-alias": "^1.8.10",
|
|
57
|
+
"typescript": "5.9.3",
|
|
57
58
|
"vitest": "^4.1.2"
|
|
58
59
|
}
|
|
59
60
|
}
|