@lovrabet/lovrabet-cli 2.0.10 → 2.0.11
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/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/kb/index.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 -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/update.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/distribution.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/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- 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 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- 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 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +17 -3
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a28_0x1d0e(){const _0x18cd76=['Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','10534972oJQTeQ','SQL\x20execution\x20failed','sql','execError','13mtkqiE','now','\x20row(s)\x20in\x20','length','read','384350qTrQAx','2dKGJnP','4IJQgLY','str','exec','34101lkqrEs','410649eJcczg','560LzQTst','isArray','45pKjujJ','10456344IxKxtn','11bQtyLu','params','7395740OyTAtq','219684lpaIqN'];a28_0x1d0e=function(){return _0x18cd76;};return a28_0x1d0e();}const a28_0x686944=a28_0xfe90;function a28_0xfe90(_0x308352,_0x39dea7){_0x308352=_0x308352-0x1a9;const _0x1d0e14=a28_0x1d0e();let _0xfe90f2=_0x1d0e14[_0x308352];return _0xfe90f2;}(function(_0x3012f2,_0x7c0959){const _0xbc8151=a28_0xfe90,_0x94a963=_0x3012f2();while(!![]){try{const _0xc10b25=-parseInt(_0xbc8151(0x1c1))/0x1*(parseInt(_0xbc8151(0x1c0))/0x2)+parseInt(_0xbc8151(0x1ad))/0x3*(-parseInt(_0xbc8151(0x1a9))/0x4)+parseInt(_0xbc8151(0x1b0))/0x5*(-parseInt(_0xbc8151(0x1b5))/0x6)+parseInt(_0xbc8151(0x1b7))/0x7+parseInt(_0xbc8151(0x1ae))/0x8*(parseInt(_0xbc8151(0x1ac))/0x9)+-parseInt(_0xbc8151(0x1b4))/0xa*(-parseInt(_0xbc8151(0x1b2))/0xb)+parseInt(_0xbc8151(0x1b1))/0xc*(-parseInt(_0xbc8151(0x1bb))/0xd);if(_0xc10b25===_0x7c0959)break;else _0x94a963['push'](_0x94a963['shift']());}catch(_0x151e3a){_0x94a963['push'](_0x94a963['shift']());}}}(a28_0x1d0e,0xc04df));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a28_0x686944(0x1b9),'command':a28_0x686944(0x1ab),'description':a28_0x686944(0x1b6),'risk':a28_0x686944(0x1bf),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x1dc949){const _0x525707=a28_0x686944,_0x59988b=parseJsonParams(_0x1dc949['str'](_0x525707(0x1b3))),_0x5de1c9=Date[_0x525707(0x1bc)](),_0x247ded=await executeSdkSql(_0x1dc949[_0x525707(0x1aa)]('sqlcode'),_0x59988b),_0x1e39d4=Date['now']()-_0x5de1c9,_0x25bc7a=_0x247ded?.['execResult']??_0x247ded,_0x24e9f6=_0x247ded?.['execSuccess']??!![];if(!_0x24e9f6)return{'ok':![],'data':{'error':_0x247ded?.[_0x525707(0x1ba)]||_0x525707(0x1b8),'elapsed':_0x1e39d4},'message':'SQL\x20execution\x20failed'};const _0x4c08dc=Array[_0x525707(0x1af)](_0x25bc7a)?_0x25bc7a:[];return{'ok':!![],'data':{'rows':_0x4c08dc,'rowCount':_0x4c08dc[_0x525707(0x1be)],'elapsed':_0x1e39d4},'message':'Returned\x20'+_0x4c08dc[_0x525707(0x1be)]+_0x525707(0x1bd)+_0x1e39d4+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x439c86,_0x5b8a37){const _0x2dd9a0=a29_0x58ad,_0x370470=_0x439c86();while(!![]){try{const _0x48f42a=parseInt(_0x2dd9a0(0x165))/0x1+-parseInt(_0x2dd9a0(0x162))/0x2*(parseInt(_0x2dd9a0(0x164))/0x3)+parseInt(_0x2dd9a0(0x16a))/0x4*(parseInt(_0x2dd9a0(0x163))/0x5)+parseInt(_0x2dd9a0(0x16b))/0x6+-parseInt(_0x2dd9a0(0x168))/0x7*(-parseInt(_0x2dd9a0(0x166))/0x8)+-parseInt(_0x2dd9a0(0x167))/0x9+-parseInt(_0x2dd9a0(0x169))/0xa;if(_0x48f42a===_0x5b8a37)break;else _0x370470['push'](_0x370470['shift']());}catch(_0x1f79bf){_0x370470['push'](_0x370470['shift']());}}}(a29_0x5727,0x5fb27));import{sqlDetail}from'../../commands/sql/detail.js';function a29_0x58ad(_0x4f56d8,_0x2515ab){_0x4f56d8=_0x4f56d8-0x162;const _0x572744=a29_0x5727();let _0x58adb6=_0x572744[_0x4f56d8];return _0x58adb6;}function a29_0x5727(){const _0x8a1b59=['4576593auHmbN','1866960ahjbcf','8ZQLSpN','2502126rVKzbw','695482ZBXhFY','1128095njksnN','3gPkNfZ','74863HZMOMm','8yGlOKO','6034581NaFvMs'];a29_0x5727=function(){return _0x8a1b59;};return a29_0x5727();}import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0x1ceb9a=a30_0x3206;(function(_0x62412b,_0x19a7d8){const _0x4ae946=a30_0x3206,_0x2e3ac8=_0x62412b();while(!![]){try{const _0xa783fe=-parseInt(_0x4ae946(0x235))/0x1*(-parseInt(_0x4ae946(0x224))/0x2)+parseInt(_0x4ae946(0x219))/0x3+parseInt(_0x4ae946(0x208))/0x4*(parseInt(_0x4ae946(0x21e))/0x5)+-parseInt(_0x4ae946(0x206))/0x6*(-parseInt(_0x4ae946(0x236))/0x7)+-parseInt(_0x4ae946(0x21d))/0x8+parseInt(_0x4ae946(0x1f9))/0x9+-parseInt(_0x4ae946(0x1f5))/0xa;if(_0xa783fe===_0x19a7d8)break;else _0x2e3ac8['push'](_0x2e3ac8['shift']());}catch(_0x17ebff){_0x2e3ac8['push'](_0x2e3ac8['shift']());}}}(a30_0x3626,0xe37f6));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a30_0x1ceb9a(0x237),'type':'boolean','description':a30_0x1ceb9a(0x22c),'default':![]},{'name':a30_0x1ceb9a(0x1ff),'type':'boolean','description':a30_0x1ceb9a(0x1f8),'default':![]},{'name':a30_0x1ceb9a(0x21b),'type':a30_0x1ceb9a(0x214),'description':a30_0x1ceb9a(0x1fc)},{'name':a30_0x1ceb9a(0x240),'type':a30_0x1ceb9a(0x211),'description':'Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','default':![]},{'name':'skills','type':a30_0x1ceb9a(0x211),'description':a30_0x1ceb9a(0x1fd),'default':!![],'hidden':!![]}];function parseSemver(_0x3818bf){const _0x2dda61=a30_0x1ceb9a,_0x39fb82=_0x3818bf[_0x2dda61(0x22d)]()[_0x2dda61(0x20e)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x39fb82)return null;return{'major':Number(_0x39fb82[0x1]),'minor':Number(_0x39fb82[0x2]),'patch':Number(_0x39fb82[0x3]),'prerelease':_0x39fb82[0x4]};}function compareSemver(_0x3da3cc,_0x11ba5f){const _0xdbeff6=a30_0x1ceb9a,_0x1dbd2f=parseSemver(_0x3da3cc),_0x1a0daf=parseSemver(_0x11ba5f);if(!_0x1dbd2f||!_0x1a0daf)throw CliErrors[_0xdbeff6(0x23b)](_0xdbeff6(0x23e),_0xdbeff6(0x207));for(const _0x3e21ac of[_0xdbeff6(0x230),_0xdbeff6(0x20f),_0xdbeff6(0x229)]){if(_0x1dbd2f[_0x3e21ac]<_0x1a0daf[_0x3e21ac])return-0x1;if(_0x1dbd2f[_0x3e21ac]>_0x1a0daf[_0x3e21ac])return 0x1;}if(!_0x1dbd2f[_0xdbeff6(0x23c)]&&!_0x1a0daf['prerelease'])return 0x0;if(!_0x1dbd2f[_0xdbeff6(0x23c)])return 0x1;if(!_0x1a0daf[_0xdbeff6(0x23c)])return-0x1;if(_0x1dbd2f[_0xdbeff6(0x23c)]===_0x1a0daf[_0xdbeff6(0x23c)])return 0x0;return _0x1dbd2f[_0xdbeff6(0x23c)]<_0x1a0daf[_0xdbeff6(0x23c)]?-0x1:0x1;}function getRequestedVersion(_0x86e3e8){const _0x2c04d3=a30_0x1ceb9a,_0x5e371c=_0x86e3e8['str'](_0x2c04d3(0x21b))[_0x2c04d3(0x22d)]();if(_0x5e371c)return _0x5e371c;return String(_0x86e3e8[_0x2c04d3(0x212)]?.[0x0]??'')[_0x2c04d3(0x22d)]();}function shouldSkipOfficialSkill(_0x35d272){const _0x305a06=a30_0x1ceb9a;return _0x35d272['bool'](_0x305a06(0x240))||_0x35d272[_0x305a06(0x234)]('skills')===![];}async function validateUpdateFlags(_0x569296){const _0xd98942=a30_0x1ceb9a,_0x21769b=getRequestedVersion(_0x569296),_0x37fe74=[_0x569296['bool'](_0xd98942(0x237))?'latest':'',_0x569296[_0xd98942(0x213)]('beta')?_0xd98942(0x1ff):'',_0x21769b?_0xd98942(0x21b):''][_0xd98942(0x22b)](Boolean);if(_0x37fe74[_0xd98942(0x1f2)]>0x1)throw CliErrors['validation'](_0xd98942(0x209),_0xd98942(0x1fa));if(_0x21769b&&!parseSemver(_0x21769b))throw CliErrors[_0xd98942(0x23b)]('Invalid\x20version:\x20'+_0x21769b,_0xd98942(0x225));}async function fetchNpmDistTags(){const _0x43aa25=a30_0x1ceb9a;try{const _0x1b3cda=NPM_REGISTRY_BASE_URL+_0x43aa25(0x210)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x43aa25(0x215),_0x32ca96=await fetch(_0x1b3cda,{'signal':AbortSignal[_0x43aa25(0x239)](0x2710)});if(!_0x32ca96['ok'])return null;const _0x3e77fd=await _0x32ca96[_0x43aa25(0x20c)]();if(!_0x3e77fd||typeof _0x3e77fd!==_0x43aa25(0x1f6))return null;return Object['fromEntries'](Object[_0x43aa25(0x1fb)](_0x3e77fd)['filter'](([,_0x1279ac])=>typeof _0x1279ac===_0x43aa25(0x214)&&_0x1279ac['trim']())[_0x43aa25(0x204)](([_0x4d7de4,_0x3b4fcc])=>[_0x4d7de4,String(_0x3b4fcc)[_0x43aa25(0x22d)]()]));}catch{return null;}}async function resolveTargetVersion(_0x552299){const _0x4aea7b=a30_0x1ceb9a,_0x208cc4=getRequestedVersion(_0x552299);if(_0x208cc4)return{'version':_0x208cc4,'source':_0x4aea7b(0x21b)};const _0x5114e8=_0x552299[_0x4aea7b(0x213)](_0x4aea7b(0x1ff))?_0x4aea7b(0x1ff):_0x4aea7b(0x237),_0xbcc524=await fetchNpmDistTags(),_0x4785f3=_0xbcc524?.[_0x5114e8];if(!_0x4785f3)return null;return{'version':_0x4785f3,'source':_0x5114e8};}function shouldInstallTarget(_0x246f86,_0x3a10de){const _0x27288e=a30_0x1ceb9a,_0x335570=compareSemver(_0x246f86,_0x3a10de[_0x27288e(0x21b)]);if(_0x3a10de[_0x27288e(0x221)]===_0x27288e(0x21b))return _0x335570!==0x0;return _0x335570<0x0;}function a30_0x3626(){const _0x3c4a5c=['/dist-tags','nonInteractive','error','Unable\x20to\x20resolve\x20','712515kIxvbY','update','version','Updated\x20to\x20v','9985224VxsEKK','127185WYDRZp','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','Checking\x20npm\x20dist-tags...','source','join','warn','55394gmmyxd','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','run','unknown','\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20','patch','npm','filter','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','trim','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','cwd','major','stderr','toString','pipe','flag','49sDNIrM','14qnJgHu','latest','Update\x20failed:\x20','timeout','inherit','validation','prerelease','\x20\x20Official\x20skill\x20update\x20failed:\x20','Version\x20comparison\x20failed.','status','no-skills','length','exit\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','18300930nkVvYk','object','log','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','10198323ZvFquP','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','entries','Install\x20a\x20specific\x20CLI\x20version','Refresh\x20official\x20skill\x20package\x20after\x20updating','install','beta','Already\x20on\x20requested\x20version\x20(v','Already\x20up\x20to\x20date\x20(v','message','stdout','map','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','2702148RryHDT','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','60xLYFwu','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','Current\x20version:\x20','\x20-g\x20-y','json','\x20version\x20from\x20npm.','match','minor','/-/package/','boolean','args','bool','string'];a30_0x3626=function(){return _0x3c4a5c;};return a30_0x3626();}function installCliPackage(_0x44b870,_0x58cad9){const _0x479eae=a30_0x1ceb9a,_0x14f4e7=resolveNpmBin(_0x479eae(0x22a)),_0xdd0647=[_0x479eae(0x1fe),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x44b870];console['log']('*\x20'+[_0x14f4e7,..._0xdd0647][_0x479eae(0x222)]('\x20'));const _0x4a9cfa=spawnSync(_0x14f4e7,_0xdd0647,{'cwd':process['cwd'](),'stdio':_0x58cad9?_0x479eae(0x233):_0x479eae(0x23a),'env':process.env,'shell':![]});if(_0x4a9cfa[_0x479eae(0x23f)]===0x0)return{'ok':!![]};let _0x30200a=_0x4a9cfa[_0x479eae(0x217)]?.[_0x479eae(0x202)]||_0x479eae(0x1f3)+(_0x4a9cfa['status']??_0x479eae(0x227));if(_0x58cad9){const _0x51af31=_0x4a9cfa[_0x479eae(0x231)]?_0x4a9cfa[_0x479eae(0x231)]['toString']()[_0x479eae(0x22d)]():'',_0x1aed09=_0x4a9cfa['stdout']?_0x4a9cfa[_0x479eae(0x203)][_0x479eae(0x232)]()[_0x479eae(0x22d)]():'';if(_0x51af31)_0x30200a=_0x51af31;else{if(_0x1aed09)_0x30200a=_0x1aed09;}}return{'ok':![],'error':_0x30200a};}async function installOfficialSkill(_0x186ddb){const _0x3d0b13=a30_0x1ceb9a;console[_0x3d0b13(0x1f7)]('Checking\x20official\x20skill\x20package...');const _0x94ac6c=runNpxSkillsAddGlobal(process[_0x3d0b13(0x22f)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x186ddb?'pipe':_0x3d0b13(0x23a)});if(_0x94ac6c['skipped']){console['log']('\x20\x20Skipped\x20skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x94ac6c['ok']){console[_0x3d0b13(0x1f7)](_0x3d0b13(0x22e));return;}console[_0x3d0b13(0x223)](_0x3d0b13(0x23d)+(_0x94ac6c[_0x3d0b13(0x217)]||'unknown')),console[_0x3d0b13(0x1f7)](_0x3d0b13(0x228)+LOVRABET_SKILL_SOURCE+_0x3d0b13(0x20b));}async function execute(_0x477029){const _0x49c2ba=a30_0x1ceb9a;await validateUpdateFlags(_0x477029);const _0x597f87=getCliVersion();console['log'](_0x49c2ba(0x20a)+_0x597f87),console[_0x49c2ba(0x1f7)](_0x49c2ba(0x220));const _0x53fdf6=await resolveTargetVersion(_0x477029);if(!_0x53fdf6){const _0x469f72=_0x477029['bool'](_0x49c2ba(0x1ff))?_0x49c2ba(0x1ff):_0x49c2ba(0x237),_0x3fbf51=_0x49c2ba(0x218)+_0x469f72+_0x49c2ba(0x20d);return console['warn'](_0x3fbf51),console[_0x49c2ba(0x1f7)](_0x49c2ba(0x205)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x469f72),{'ok':![]};}if(!shouldInstallTarget(_0x597f87,_0x53fdf6)){const _0x288156=_0x53fdf6[_0x49c2ba(0x221)]===_0x49c2ba(0x21b)?_0x49c2ba(0x200)+_0x53fdf6[_0x49c2ba(0x21b)]+').':_0x49c2ba(0x201)+_0x53fdf6[_0x49c2ba(0x21b)]+').';return console[_0x49c2ba(0x1f7)](_0x288156),shouldSkipOfficialSkill(_0x477029)?console['log']('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0x477029[_0x49c2ba(0x216)]),{'ok':!![]};}console[_0x49c2ba(0x1f7)]('Updating\x20'+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x597f87+'\x20->\x20'+_0x53fdf6['version']);const _0x5303a4=installCliPackage(_0x53fdf6['version'],_0x477029[_0x49c2ba(0x216)]);if(!_0x5303a4['ok']){const _0x4e0c3c=_0x49c2ba(0x238)+(_0x5303a4[_0x49c2ba(0x217)]||_0x49c2ba(0x227));return console['error'](_0x4e0c3c),console[_0x49c2ba(0x1f7)](_0x49c2ba(0x21f)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x53fdf6[_0x49c2ba(0x21b)]),{'ok':![]};}return console[_0x49c2ba(0x1f7)](_0x49c2ba(0x21c)+_0x53fdf6[_0x49c2ba(0x21b)]+'.'),console[_0x49c2ba(0x1f7)](_0x49c2ba(0x1f4)),shouldSkipOfficialSkill(_0x477029)?console['log']('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0x477029[_0x49c2ba(0x216)]),{'ok':!![]};}function a30_0x3206(_0x1147b1,_0xfb8c9d){_0x1147b1=_0x1147b1-0x1f2;const _0x3626a3=a30_0x3626();let _0x320695=_0x3626a3[_0x1147b1];return _0x320695;}export const updateDefinition={'service':a30_0x1ceb9a(0x21a),'command':a30_0x1ceb9a(0x226),'description':'Update\x20'+CLI_BIN_NAME+'\x20CLI\x20from\x20npm','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
function a30_0x2efd(_0x12f8a0,_0x25051a){_0x12f8a0=_0x12f8a0-0x1cf;const _0x38c3fb=a30_0x38c3();let _0x2efd7a=_0x38c3fb[_0x12f8a0];return _0x2efd7a;}const a30_0x48b049=a30_0x2efd;(function(_0x37b512,_0x4b8e73){const _0x19a47f=a30_0x2efd,_0x222ebc=_0x37b512();while(!![]){try{const _0x4c8861=-parseInt(_0x19a47f(0x209))/0x1*(parseInt(_0x19a47f(0x20f))/0x2)+parseInt(_0x19a47f(0x203))/0x3+-parseInt(_0x19a47f(0x1e9))/0x4+parseInt(_0x19a47f(0x1f5))/0x5+-parseInt(_0x19a47f(0x1e5))/0x6+parseInt(_0x19a47f(0x1fb))/0x7*(parseInt(_0x19a47f(0x1fd))/0x8)+parseInt(_0x19a47f(0x204))/0x9;if(_0x4c8861===_0x4b8e73)break;else _0x222ebc['push'](_0x222ebc['shift']());}catch(_0x4bdc9a){_0x222ebc['push'](_0x222ebc['shift']());}}}(a30_0x38c3,0x229ae));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';function a30_0x38c3(){const _0x4eb22a=['\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Install\x20a\x20specific\x20CLI\x20version','stderr','\x20version\x20from\x20npm.','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','length','\x20\x20Official\x20skill\x20update\x20failed:\x20','message','=1).','nonInteractive','filter','fromEntries','\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20-g\x20-y','beta','unknown','str','major','1437252XYrwHw','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','stdout','map','615640UuZYWS','Refresh\x20official\x20skill\x20package\x20after\x20updating','Skipping\x20official\x20skill\x20package\x20(--no-skills).','inherit','flag','log','Current\x20version:\x20','validation','update','/dist-tags','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Update\x20','1053375PFINsI','entries','exit\x20','no-skills','\x20\x20Skipped\x20skill\x20install\x20(','prerelease','1127231sEEYUt','\x20CLI\x20from\x20npm','8uZpUUB','Update\x20failed:\x20','toString','version','error','Updating\x20','625461fsQzof','1191798ecBqKI','bool','args','string','boolean','59141ZWdkhw','timeout','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','skills','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Checking\x20npm\x20dist-tags...','6uEfmtZ','npm','source','Already\x20up\x20to\x20date\x20(v','cwd','trim','Updated\x20to\x20v','pipe','Already\x20on\x20requested\x20version\x20(v','latest'];a30_0x38c3=function(){return _0x4eb22a;};return a30_0x38c3();}import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':'latest','type':'boolean','description':a30_0x48b049(0x1d6),'default':![]},{'name':a30_0x48b049(0x1e1),'type':a30_0x48b049(0x208),'description':a30_0x48b049(0x1df),'default':![]},{'name':a30_0x48b049(0x200),'type':a30_0x48b049(0x207),'description':a30_0x48b049(0x1d3)},{'name':'no-skills','type':a30_0x48b049(0x208),'description':'Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','default':![]},{'name':a30_0x48b049(0x20c),'type':a30_0x48b049(0x208),'description':a30_0x48b049(0x1ea),'default':!![],'hidden':!![]}];function parseSemver(_0x80e705){const _0x3c5c4e=_0x80e705['trim']()['match'](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x3c5c4e)return null;return{'major':Number(_0x3c5c4e[0x1]),'minor':Number(_0x3c5c4e[0x2]),'patch':Number(_0x3c5c4e[0x3]),'prerelease':_0x3c5c4e[0x4]};}function compareSemver(_0xe8ffbf,_0x1d76c7){const _0x4f37b8=a30_0x48b049,_0x51021f=parseSemver(_0xe8ffbf),_0x3c1e8e=parseSemver(_0x1d76c7);if(!_0x51021f||!_0x3c1e8e)throw CliErrors[_0x4f37b8(0x1f0)]('Version\x20comparison\x20failed.',_0x4f37b8(0x20d));for(const _0x47bd6a of[_0x4f37b8(0x1e4),'minor','patch']){if(_0x51021f[_0x47bd6a]<_0x3c1e8e[_0x47bd6a])return-0x1;if(_0x51021f[_0x47bd6a]>_0x3c1e8e[_0x47bd6a])return 0x1;}if(!_0x51021f[_0x4f37b8(0x1fa)]&&!_0x3c1e8e[_0x4f37b8(0x1fa)])return 0x0;if(!_0x51021f['prerelease'])return 0x1;if(!_0x3c1e8e[_0x4f37b8(0x1fa)])return-0x1;if(_0x51021f[_0x4f37b8(0x1fa)]===_0x3c1e8e[_0x4f37b8(0x1fa)])return 0x0;return _0x51021f['prerelease']<_0x3c1e8e[_0x4f37b8(0x1fa)]?-0x1:0x1;}function getRequestedVersion(_0x37daff){const _0x5b7637=a30_0x48b049,_0x5b10c8=_0x37daff[_0x5b7637(0x1e3)](_0x5b7637(0x200))[_0x5b7637(0x214)]();if(_0x5b10c8)return _0x5b10c8;return String(_0x37daff[_0x5b7637(0x206)]?.[0x0]??'')[_0x5b7637(0x214)]();}function shouldSkipOfficialSkill(_0x4644b3){const _0x3264c1=a30_0x48b049;return _0x4644b3[_0x3264c1(0x205)](_0x3264c1(0x1f8))||_0x4644b3[_0x3264c1(0x1ed)](_0x3264c1(0x20c))===![];}async function validateUpdateFlags(_0x455431){const _0x103ccb=a30_0x48b049,_0x15df82=getRequestedVersion(_0x455431),_0x446d5a=[_0x455431[_0x103ccb(0x205)](_0x103ccb(0x1d0))?_0x103ccb(0x1d0):'',_0x455431[_0x103ccb(0x205)](_0x103ccb(0x1e1))?'beta':'',_0x15df82?_0x103ccb(0x200):''][_0x103ccb(0x1dc)](Boolean);if(_0x446d5a[_0x103ccb(0x1d7)]>0x1)throw CliErrors[_0x103ccb(0x1f0)](_0x103ccb(0x1e6),_0x103ccb(0x20b));if(_0x15df82&&!parseSemver(_0x15df82))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x15df82,_0x103ccb(0x1d2));}async function fetchNpmDistTags(){const _0x515242=a30_0x48b049;try{const _0x45d70d=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x515242(0x1f2),_0x3580af=await fetch(_0x45d70d,{'signal':AbortSignal[_0x515242(0x20a)](0x2710)});if(!_0x3580af['ok'])return null;const _0x4fb753=await _0x3580af['json']();if(!_0x4fb753||typeof _0x4fb753!=='object')return null;return Object[_0x515242(0x1dd)](Object[_0x515242(0x1f6)](_0x4fb753)[_0x515242(0x1dc)](([,_0x4184f8])=>typeof _0x4184f8===_0x515242(0x207)&&_0x4184f8['trim']())[_0x515242(0x1e8)](([_0x45a81f,_0x1b23b9])=>[_0x45a81f,String(_0x1b23b9)[_0x515242(0x214)]()]));}catch{return null;}}async function resolveTargetVersion(_0x1de4aa){const _0x46d6ef=a30_0x48b049,_0x20fc5f=getRequestedVersion(_0x1de4aa);if(_0x20fc5f)return{'version':_0x20fc5f,'source':_0x46d6ef(0x200)};const _0x355f48=_0x1de4aa[_0x46d6ef(0x205)](_0x46d6ef(0x1e1))?_0x46d6ef(0x1e1):'latest',_0x23cb50=await fetchNpmDistTags(),_0x1b01be=_0x23cb50?.[_0x355f48];if(!_0x1b01be)return null;return{'version':_0x1b01be,'source':_0x355f48};}function shouldInstallTarget(_0x1b95f2,_0x3282a5){const _0x4914f3=a30_0x48b049,_0x37dce3=compareSemver(_0x1b95f2,_0x3282a5[_0x4914f3(0x200)]);if(_0x3282a5[_0x4914f3(0x211)]===_0x4914f3(0x200))return _0x37dce3!==0x0;return _0x37dce3<0x0;}function installCliPackage(_0x237077,_0x346e84){const _0x1f9548=a30_0x48b049,_0x183459=resolveNpmBin(_0x1f9548(0x210)),_0x1cddec=['install','-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x237077];console[_0x1f9548(0x1ee)]('*\x20'+[_0x183459,..._0x1cddec]['join']('\x20'));const _0x4ff690=spawnSync(_0x183459,_0x1cddec,{'cwd':process[_0x1f9548(0x213)](),'stdio':_0x346e84?_0x1f9548(0x216):_0x1f9548(0x1ec),'env':process.env,'shell':![]});if(_0x4ff690['status']===0x0)return{'ok':!![]};let _0x3fd42a=_0x4ff690['error']?.[_0x1f9548(0x1d9)]||_0x1f9548(0x1f7)+(_0x4ff690['status']??_0x1f9548(0x1e2));if(_0x346e84){const _0x1a6a2e=_0x4ff690['stderr']?_0x4ff690[_0x1f9548(0x1d4)][_0x1f9548(0x1ff)]()[_0x1f9548(0x214)]():'',_0x4e7d5f=_0x4ff690[_0x1f9548(0x1e7)]?_0x4ff690[_0x1f9548(0x1e7)][_0x1f9548(0x1ff)]()['trim']():'';if(_0x1a6a2e)_0x3fd42a=_0x1a6a2e;else{if(_0x4e7d5f)_0x3fd42a=_0x4e7d5f;}}return{'ok':![],'error':_0x3fd42a};}async function installOfficialSkill(_0x48c980){const _0x53716e=a30_0x48b049;console[_0x53716e(0x1ee)]('Checking\x20official\x20skill\x20package...');const _0x27f193=runNpxSkillsAddGlobal(process[_0x53716e(0x213)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x48c980?_0x53716e(0x216):_0x53716e(0x1ec)});if(_0x27f193['skipped']){console[_0x53716e(0x1ee)](_0x53716e(0x1f9)+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x53716e(0x1da));return;}if(_0x27f193['ok']){console['log'](_0x53716e(0x1d1));return;}console['warn'](_0x53716e(0x1d8)+(_0x27f193[_0x53716e(0x201)]||'unknown')),console[_0x53716e(0x1ee)](_0x53716e(0x1de)+LOVRABET_SKILL_SOURCE+_0x53716e(0x1e0));}async function execute(_0x35d03a){const _0xdf72e2=a30_0x48b049;await validateUpdateFlags(_0x35d03a);const _0x1a6860=getCliVersion();console['log'](_0xdf72e2(0x1ef)+_0x1a6860),console[_0xdf72e2(0x1ee)](_0xdf72e2(0x20e));const _0x78006f=await resolveTargetVersion(_0x35d03a);if(!_0x78006f){const _0x2ad800=_0x35d03a['bool'](_0xdf72e2(0x1e1))?_0xdf72e2(0x1e1):'latest',_0x2f8a8b='Unable\x20to\x20resolve\x20'+_0x2ad800+_0xdf72e2(0x1d5);return console['warn'](_0x2f8a8b),console[_0xdf72e2(0x1ee)](_0xdf72e2(0x1f3)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x2ad800),{'ok':![]};}if(!shouldInstallTarget(_0x1a6860,_0x78006f)){const _0xe09df4=_0x78006f[_0xdf72e2(0x211)]==='version'?_0xdf72e2(0x1cf)+_0x78006f[_0xdf72e2(0x200)]+').':_0xdf72e2(0x212)+_0x78006f[_0xdf72e2(0x200)]+').';return console[_0xdf72e2(0x1ee)](_0xe09df4),shouldSkipOfficialSkill(_0x35d03a)?console[_0xdf72e2(0x1ee)](_0xdf72e2(0x1eb)):await installOfficialSkill(_0x35d03a[_0xdf72e2(0x1db)]),{'ok':!![]};}console[_0xdf72e2(0x1ee)](_0xdf72e2(0x202)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x1a6860+'\x20->\x20'+_0x78006f[_0xdf72e2(0x200)]);const _0x4f67de=installCliPackage(_0x78006f[_0xdf72e2(0x200)],_0x35d03a[_0xdf72e2(0x1db)]);if(!_0x4f67de['ok']){const _0x316fb4=_0xdf72e2(0x1fe)+(_0x4f67de[_0xdf72e2(0x201)]||_0xdf72e2(0x1e2));return console[_0xdf72e2(0x201)](_0x316fb4),console[_0xdf72e2(0x1ee)]('\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x78006f[_0xdf72e2(0x200)]),{'ok':![]};}return console[_0xdf72e2(0x1ee)](_0xdf72e2(0x215)+_0x78006f[_0xdf72e2(0x200)]+'.'),console[_0xdf72e2(0x1ee)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'),shouldSkipOfficialSkill(_0x35d03a)?console[_0xdf72e2(0x1ee)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0x35d03a['nonInteractive']),{'ok':!![]};}export const updateDefinition={'service':a30_0x48b049(0x1f1),'command':'run','description':a30_0x48b049(0x1f4)+CLI_BIN_NAME+a30_0x48b049(0x1fc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a31_0x3502(_0x18ed47,_0x57f54){_0x18ed47=_0x18ed47-0x1d4;const _0x3ce436=a31_0x3ce4();let _0x3502da=_0x3ce436[_0x18ed47];return _0x3502da;}const a31_0x5e7abc=a31_0x3502;(function(_0x2f06b6,_0x1a983b){const _0x53e7cc=a31_0x3502,_0xaf764b=_0x2f06b6();while(!![]){try{const _0x4ccb2a=-parseInt(_0x53e7cc(0x1d4))/0x1+parseInt(_0x53e7cc(0x1dc))/0x2*(parseInt(_0x53e7cc(0x1e9))/0x3)+-parseInt(_0x53e7cc(0x1e3))/0x4*(parseInt(_0x53e7cc(0x1ee))/0x5)+-parseInt(_0x53e7cc(0x1f1))/0x6*(-parseInt(_0x53e7cc(0x1f2))/0x7)+parseInt(_0x53e7cc(0x1d5))/0x8*(-parseInt(_0x53e7cc(0x1ef))/0x9)+-parseInt(_0x53e7cc(0x1ed))/0xa*(-parseInt(_0x53e7cc(0x1de))/0xb)+-parseInt(_0x53e7cc(0x1e7))/0xc*(-parseInt(_0x53e7cc(0x1e4))/0xd);if(_0x4ccb2a===_0x1a983b)break;else _0xaf764b['push'](_0xaf764b['shift']());}catch(_0x579cc8){_0xaf764b['push'](_0xaf764b['shift']());}}}(a31_0x3ce4,0xcf33b));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':'Target\x20environment','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5e7abc(0x1e0)],'importable':!![]},'format':{'description':a31_0x5e7abc(0x1e2),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5e7abc(0x1e6)],'importable':!![]},'pageSize':{'description':'Default\x20page\x20size','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':'Override\x20API\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a31_0x5e7abc(0x1f3),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a31_0x5e7abc(0x1ea),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a31_0x5e7abc(0x1eb),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a31_0x5e7abc(0x1d7),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5e7abc(0x1df)],'importable':!![]},'locale':{'description':a31_0x5e7abc(0x1d9),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES['locale'],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a31_0x5e7abc(0x1dd)](CONFIG_FIELD_SCHEMAS)[a31_0x5e7abc(0x1ec)](([,_0x2e1638])=>_0x2e1638[a31_0x5e7abc(0x1da)])[a31_0x5e7abc(0x1d6)](([_0xf26a0d])=>_0xf26a0d));export const CONFIG_ENUM_VALUES=Object['fromEntries'](Object[a31_0x5e7abc(0x1dd)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x4ad68e])=>_0x4ad68e['enumValues'])[a31_0x5e7abc(0x1d6)](([_0x4a1dc0,_0xd11953])=>[_0x4a1dc0,[..._0xd11953[a31_0x5e7abc(0x1e5)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a31_0x5e7abc(0x1dd)](CONFIG_FIELD_SCHEMAS)[a31_0x5e7abc(0x1ec)](([,_0x1b18f8])=>_0x1b18f8[a31_0x5e7abc(0x1d8)])[a31_0x5e7abc(0x1d6)](([_0x3bd9f5])=>_0x3bd9f5);export function getConfigFieldSchema(_0x4de068){return CONFIG_FIELD_SCHEMAS[_0x4de068];}export function getConfigEnumValues(_0x4bd743){const _0x4a7f49=a31_0x5e7abc;return getConfigFieldSchema(_0x4bd743)?.[_0x4a7f49(0x1e5)];}export function getConfigDefaultValue(_0x5aecf5){const _0x9c475d=a31_0x5e7abc;return getConfigFieldSchema(_0x5aecf5)?.[_0x9c475d(0x1e1)];}export function isTopLevelConfigKey(_0x2bad1d){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2bad1d);}function a31_0x3ce4(){const _0x369d08=['defaultValue','Default\x20output\x20format','896PVcehc','1282879VxpwIN','enumValues','format','12soxxSl','legacyCompatOnly','420213iDaobC','Override\x20runtime\x20domain','Access\x20key\x20(client-ak\x20auth)','filter','100aLNtSu','965ivDcXv','13770837WSQUkh','Config\x20key.\x20Top-level:\x20','688326dwSRdF','98IQiJZW','Override\x20user\x20domain','797961OxbVAD','8pJBGMN','map','Risk\x20level','importable','Locale','cliSettableTopLevel',';\x20local\x20alias:\x20apps.<alias>.appcode','16XNQIYP','entries','434104igpgXe','riskLevel','env'];a31_0x3ce4=function(){return _0x369d08;};return a31_0x3ce4();}export function isLegacyCompatConfigKey(_0x3555ba){const _0x156a92=a31_0x5e7abc;return getConfigFieldSchema(_0x3555ba)?.[_0x156a92(0x1e8)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x1e3b47){return[..._0x1e3b47]['join'](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x58529f=a31_0x5e7abc;return _0x58529f(0x1f0)+getTopLevelConfigKeySummary()+_0x58529f(0x1db);}export function buildAppProfileListFields(_0x5d979a){return{'env':_0x5d979a,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x2282(_0x37170d,_0x4a16bd){_0x37170d=_0x37170d-0x140;const _0x2c72d8=a32_0x2c72();let _0x22824f=_0x2c72d8[_0x37170d];return _0x22824f;}function a32_0x2c72(){const _0x48f4bd=['client-ak','151166uyQnFK','883272dfxCsZ','57648azrbAG','61824MsxFAw','7xTMfsu','ClientAk','266320foNMtH','428275HeTpRr','90aiRBEF','2SVVYQe','1678392AVYcVA'];a32_0x2c72=function(){return _0x48f4bd;};return a32_0x2c72();}const a32_0x390833=a32_0x2282;(function(_0x2680b1,_0x3f3a82){const _0x1bbce0=a32_0x2282,_0x1bade3=_0x2680b1();while(!![]){try{const _0x275072=-parseInt(_0x1bbce0(0x141))/0x1+-parseInt(_0x1bbce0(0x14a))/0x2*(parseInt(_0x1bbce0(0x143))/0x3)+parseInt(_0x1bbce0(0x144))/0x4+parseInt(_0x1bbce0(0x148))/0x5+parseInt(_0x1bbce0(0x142))/0x6+-parseInt(_0x1bbce0(0x145))/0x7*(parseInt(_0x1bbce0(0x14b))/0x8)+parseInt(_0x1bbce0(0x149))/0x9*(parseInt(_0x1bbce0(0x147))/0xa);if(_0x275072===_0x3f3a82)break;else _0x1bade3['push'](_0x1bade3['shift']());}catch(_0x18f9d9){_0x1bade3['push'](_0x1bade3['shift']());}}}(a32_0x2c72,0x20d3e));export const AUTH_MODE={'ClientAk':a32_0x390833(0x140)};export function isAuthMode(_0x35ce2c){const _0x502752=a32_0x390833;return _0x35ce2c===AUTH_MODE[_0x502752(0x146)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x2188(_0x592e3f,_0x30b451){_0x592e3f=_0x592e3f-0x1c1;const _0x14639f=a33_0x1463();let _0x218847=_0x14639f[_0x592e3f];return _0x218847;}function a33_0x1463(){const _0xc16893=['appcode','yes','Clear\x20output','<name>','string','help','json\x20|\x20pretty\x20|\x20compress','nonInteractive','dry-run','3230140zESrGF','clear','178XGzbdi','JSON\x20params\x20for\x20execute\x20commands','cliDisplayName','params','Use\x20global\x20config\x20scope','5061eiIGXT','22459294GUiEZo','Name\x20filter','9237684IuIDew','non-interactive','boolean','type','production\x20|\x20development\x20|\x20daily','Override\x20appcode','<code>','format','dryRun','verbose','3521658nSmlhj','Skip\x20confirmation\x20for\x20high-risk\x20writes','fromEntries','2943110xXHUzx','9452853SeRjiN','global','10nhIDBH','app','cliBinName','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','24RUwLdp','name','env','SQL\x20query\x20code','sqlcode','Preview\x20operation\x20without\x20executing','3qVgcPC','Alias\x20for\x20--non-interactive','Select\x20app\x20profile\x20by\x20name','Environment'];a33_0x1463=function(){return _0xc16893;};return a33_0x1463();}const a33_0x151bcd=a33_0x2188;(function(_0x1a7f07,_0x502c1e){const _0x2a956a=a33_0x2188,_0x10f52d=_0x1a7f07();while(!![]){try{const _0x3eb340=parseInt(_0x2a956a(0x1d5))/0x1*(parseInt(_0x2a956a(0x1d0))/0x2)+parseInt(_0x2a956a(0x1c1))/0x3*(parseInt(_0x2a956a(0x1ce))/0x4)+parseInt(_0x2a956a(0x1e5))/0x5+-parseInt(_0x2a956a(0x1d8))/0x6+parseInt(_0x2a956a(0x1e2))/0x7*(parseInt(_0x2a956a(0x1ec))/0x8)+-parseInt(_0x2a956a(0x1e6))/0x9*(-parseInt(_0x2a956a(0x1e8))/0xa)+-parseInt(_0x2a956a(0x1d6))/0xb;if(_0x3eb340===_0x502c1e)break;else _0x10f52d['push'](_0x10f52d['shift']());}catch(_0x595a44){_0x10f52d['push'](_0x10f52d['shift']());}}}(a33_0x1463,0xc95f1));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a33_0x151bcd(0x1ea)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a33_0x151bcd(0x1d2)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a33_0x151bcd(0x1c5),'meowKey':a33_0x151bcd(0x1c5),'type':a33_0x151bcd(0x1c9),'description':a33_0x151bcd(0x1dd),'hint':a33_0x151bcd(0x1de)},{'name':a33_0x151bcd(0x1e9),'meowKey':'app','type':a33_0x151bcd(0x1c9),'description':a33_0x151bcd(0x1c3),'hint':a33_0x151bcd(0x1c8)},{'name':'env','meowKey':a33_0x151bcd(0x1ee),'type':a33_0x151bcd(0x1c9),'description':a33_0x151bcd(0x1c4),'hint':a33_0x151bcd(0x1dc)},{'name':a33_0x151bcd(0x1df),'meowKey':a33_0x151bcd(0x1df),'type':a33_0x151bcd(0x1c9),'description':'Output\x20format','hint':a33_0x151bcd(0x1cb)},{'name':'jq','meowKey':'jq','type':'string','description':a33_0x151bcd(0x1eb),'hint':'<expr>'},{'name':'dry-run','meowKey':a33_0x151bcd(0x1e0),'type':a33_0x151bcd(0x1da),'description':a33_0x151bcd(0x1f1)},{'name':a33_0x151bcd(0x1c6),'meowKey':'yes','type':a33_0x151bcd(0x1da),'description':a33_0x151bcd(0x1e3)},{'name':a33_0x151bcd(0x1d9),'meowKey':a33_0x151bcd(0x1cc),'type':a33_0x151bcd(0x1da),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a33_0x151bcd(0x1e7),'meowKey':a33_0x151bcd(0x1e7),'type':a33_0x151bcd(0x1da),'description':a33_0x151bcd(0x1d4)},{'name':'ci','meowKey':'ci','type':'boolean','description':a33_0x151bcd(0x1c2),'hidden':!![]},{'name':a33_0x151bcd(0x1ca),'meowKey':a33_0x151bcd(0x1ca),'type':'boolean','description':'Show\x20help'},{'name':'id','meowKey':'id','type':'string','description':'Record\x20ID','hidden':!![]},{'name':a33_0x151bcd(0x1ed),'meowKey':a33_0x151bcd(0x1ed),'type':'string','description':a33_0x151bcd(0x1d7),'hidden':!![]},{'name':a33_0x151bcd(0x1f0),'meowKey':'sqlcode','type':a33_0x151bcd(0x1c9),'description':a33_0x151bcd(0x1ef),'hidden':!![]},{'name':a33_0x151bcd(0x1d3),'meowKey':a33_0x151bcd(0x1d3),'type':a33_0x151bcd(0x1c9),'description':a33_0x151bcd(0x1d1),'hidden':!![]},{'name':a33_0x151bcd(0x1e1),'meowKey':'verbose','type':a33_0x151bcd(0x1da),'description':'Verbose\x20output','hidden':!![]},{'name':a33_0x151bcd(0x1cf),'meowKey':a33_0x151bcd(0x1cf),'type':'boolean','description':a33_0x151bcd(0x1c7),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a33_0x151bcd(0x1c5),'app',a33_0x151bcd(0x1ee),'format','jq',a33_0x151bcd(0x1cd),a33_0x151bcd(0x1c6),a33_0x151bcd(0x1d9),'ci']);export function buildMeowFlags(){const _0x44dc2f=a33_0x151bcd;return Object[_0x44dc2f(0x1e4)](GLOBAL_FLAGS['map'](_0x39e627=>[_0x39e627['meowKey'],{'type':_0x39e627[_0x44dc2f(0x1db)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x5c56(){const _0x254d0f=['en-US','12AXSKEJ','732ZJhYNq','compress','10465JfsgdA','598031GICYCy','production','2892960bUvHlu','write','2139669OjodoA','main','464889JfIiqE','237028Cgjkmy','1038CQTsJv'];a34_0x5c56=function(){return _0x254d0f;};return a34_0x5c56();}const a34_0x412c3b=a34_0x306d;function a34_0x306d(_0x264842,_0x39d1a9){_0x264842=_0x264842-0x1e7;const _0x5c56f6=a34_0x5c56();let _0x306d8c=_0x5c56f6[_0x264842];return _0x306d8c;}(function(_0x3c9f2d,_0x5a7183){const _0x25fb8c=a34_0x306d,_0x26162a=_0x3c9f2d();while(!![]){try{const _0x1fc6aa=-parseInt(_0x25fb8c(0x1ea))/0x1+parseInt(_0x25fb8c(0x1ec))/0x2*(parseInt(_0x25fb8c(0x1ef))/0x3)+-parseInt(_0x25fb8c(0x1eb))/0x4+parseInt(_0x25fb8c(0x1f1))/0x5+parseInt(_0x25fb8c(0x1ee))/0x6*(parseInt(_0x25fb8c(0x1f2))/0x7)+parseInt(_0x25fb8c(0x1f4))/0x8+parseInt(_0x25fb8c(0x1e8))/0x9;if(_0x1fc6aa===_0x5a7183)break;else _0x26162a['push'](_0x26162a['shift']());}catch(_0x11166a){_0x26162a['push'](_0x26162a['shift']());}}}(a34_0x5c56,0x5b81a));export const DEFAULT_APP_PROFILE_NAME=a34_0x412c3b(0x1e9);export const DEFAULT_CONFIG_VALUES={'env':a34_0x412c3b(0x1f3),'format':a34_0x412c3b(0x1f0),'locale':a34_0x412c3b(0x1ed),'riskLevel':a34_0x412c3b(0x1e7)};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a34_0x412c3b(0x1f0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a35_0x56f436=a35_0x4803;(function(_0x3a6087,_0x20c0cf){const _0x5ae8f5=a35_0x4803,_0x25038b=_0x3a6087();while(!![]){try{const _0x5792d3=parseInt(_0x5ae8f5(0xb8))/0x1+parseInt(_0x5ae8f5(0xb4))/0x2*(-parseInt(_0x5ae8f5(0xbd))/0x3)+-parseInt(_0x5ae8f5(0xbf))/0x4+parseInt(_0x5ae8f5(0xbb))/0x5+parseInt(_0x5ae8f5(0xbe))/0x6*(-parseInt(_0x5ae8f5(0xb7))/0x7)+parseInt(_0x5ae8f5(0xb5))/0x8+parseInt(_0x5ae8f5(0xc0))/0x9*(parseInt(_0x5ae8f5(0xbc))/0xa);if(_0x5792d3===_0x20c0cf)break;else _0x25038b['push'](_0x25038b['shift']());}catch(_0x5661b0){_0x25038b['push'](_0x25038b['shift']());}}}(a35_0x511e,0x3ce0a));import{PRODUCT_CONFIG}from'../constant/product.js';function a35_0x4803(_0x3dd23f,_0x2a37e1){_0x3dd23f=_0x3dd23f-0xb4;const _0x511ec3=a35_0x511e();let _0x480309=_0x511ec3[_0x3dd23f];return _0x480309;}function a35_0x511e(){const _0x40e23c=['npmRegistryBaseUrl','2268600lWXYKw','1910WIYFDX','453wCmTVG','1471920FUEfDX','1897684vQlBAj','16659chXyDf','5806QPLvPC','1628320oCcuEO','npmPackageName','7TYcYnz','396647rEGHHO','skillSource'];a35_0x511e=function(){return _0x40e23c;};return a35_0x511e();}export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a35_0x56f436(0xb6)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a35_0x56f436(0xb9)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a35_0x56f436(0xba)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a36_0x52f5(){const _0x3a8977=['userDomain','369177MPnpTN','2OicAJC','12MLzOVx','domains','nonProduction','1729320mRpbAa','runtime','379232EaDTMB','2875176KIetoQ','production','user','56jAysRf','21102110SIvasl','runtimeDomain','2578485TjAdma','386757kYmMWp','api'];a36_0x52f5=function(){return _0x3a8977;};return a36_0x52f5();}const a36_0x43ce1b=a36_0x6670;(function(_0x7adb95,_0x30378b){const _0x490ffb=a36_0x6670,_0x5c40bd=_0x7adb95();while(!![]){try{const _0x40f467=-parseInt(_0x490ffb(0x1c3))/0x1*(-parseInt(_0x490ffb(0x1c4))/0x2)+parseInt(_0x490ffb(0x1c0))/0x3+-parseInt(_0x490ffb(0x1c5))/0x4*(parseInt(_0x490ffb(0x1d1))/0x5)+-parseInt(_0x490ffb(0x1c8))/0x6+-parseInt(_0x490ffb(0x1ca))/0x7*(-parseInt(_0x490ffb(0x1ce))/0x8)+-parseInt(_0x490ffb(0x1cb))/0x9+parseInt(_0x490ffb(0x1cf))/0xa;if(_0x40f467===_0x30378b)break;else _0x5c40bd['push'](_0x5c40bd['shift']());}catch(_0x12a736){_0x5c40bd['push'](_0x5c40bd['shift']());}}}(a36_0x52f5,0xcb4fc));import{getEnv,isProduction}from'../constant/env.js';function a36_0x6670(_0x42fe23,_0x124cde){_0x42fe23=_0x42fe23-0x1c0;const _0x52f525=a36_0x52f5();let _0x66706e=_0x52f525[_0x42fe23];return _0x66706e;}import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x211214){const _0x90bc0d=a36_0x6670;customApiDomain=_0x211214?.['apiDomain'],customUserDomain=_0x211214?.[_0x90bc0d(0x1c2)],customRuntimeDomain=_0x211214?.[_0x90bc0d(0x1d0)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x43ce1b(0x1c6)]['production'][a36_0x43ce1b(0x1cd)]:PRODUCT_CONFIG[a36_0x43ce1b(0x1c6)][a36_0x43ce1b(0x1c7)]['user']);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a36_0x43ce1b(0x1cc)][a36_0x43ce1b(0x1c1)]:PRODUCT_CONFIG['domains'][a36_0x43ce1b(0x1c7)][a36_0x43ce1b(0x1c1)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x43ce1b(0x1c6)][a36_0x43ce1b(0x1cc)][a36_0x43ce1b(0x1c9)]:PRODUCT_CONFIG[a36_0x43ce1b(0x1c6)][a36_0x43ce1b(0x1c7)][a36_0x43ce1b(0x1c9)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x103994=a37_0x5423;(function(_0x55d6d1,_0x1ff51f){const _0xe983d4=a37_0x5423,_0xb75fde=_0x55d6d1();while(!![]){try{const _0x1ebbd5=-parseInt(_0xe983d4(0xdd))/0x1*(parseInt(_0xe983d4(0xdf))/0x2)+-parseInt(_0xe983d4(0xd3))/0x3*(-parseInt(_0xe983d4(0xd8))/0x4)+-parseInt(_0xe983d4(0xde))/0x5*(parseInt(_0xe983d4(0xdb))/0x6)+parseInt(_0xe983d4(0xd7))/0x7*(parseInt(_0xe983d4(0xd6))/0x8)+parseInt(_0xe983d4(0xe2))/0x9*(parseInt(_0xe983d4(0xe0))/0xa)+parseInt(_0xe983d4(0xdc))/0xb*(parseInt(_0xe983d4(0xda))/0xc)+parseInt(_0xe983d4(0xe3))/0xd;if(_0x1ebbd5===_0x1ff51f)break;else _0xb75fde['push'](_0xb75fde['shift']());}catch(_0x32e15a){_0xb75fde['push'](_0xb75fde['shift']());}}}(a37_0xfd35,0x51a07));function a37_0x5423(_0x2bf914,_0x183638){_0x2bf914=_0x2bf914-0xd1;const _0xfd35f4=a37_0xfd35();let _0x542319=_0xfd35f4[_0x2bf914];return _0x542319;}function a37_0xfd35(){const _0x431b34=['30DZryuW','online','31005yjlsuz','3130881vqZXnG','dev','production','688302oootsh','development','ENV','8CRwpyy','1808905tYmtgO','8MMzMol','daily','3711972RIiZXp','2321070ddCYNl','11vHrKTh','2NHaUyj','5UGzDHP','556598NOtSyB'];a37_0xfd35=function(){return _0x431b34;};return a37_0xfd35();}import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=[a37_0x103994(0xd2),a37_0x103994(0xd4),a37_0x103994(0xd9)];export function normalizeEnv(_0x49711e){const _0x738be4=a37_0x103994;return _0x49711e===_0x738be4(0xe1)?_0x738be4(0xd2):_0x49711e;}export function isProduction(_0x45d037){return normalizeEnv(_0x45d037)==='production';}export function isDaily(_0x4abf0b){const _0x38509c=a37_0x103994;return normalizeEnv(_0x4abf0b)===_0x38509c(0xd9);}export function isDev(_0x18f83e){const _0x4080ae=a37_0x103994,_0x3b09f7=normalizeEnv(_0x18f83e);return _0x3b09f7==='development'||_0x3b09f7===_0x4080ae(0xd1);}let env=normalizeEnv(productEnv(a37_0x103994(0xd5))||a37_0x103994(0xd2));export function getEnv(){return env;}export function initEnv(_0x2e8b02){env=normalizeEnv(_0x2e8b02);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0x4cd2(_0x13aa26,_0x546075){_0x13aa26=_0x13aa26-0x1ec;const _0xbd29e4=a38_0xbd29();let _0x4cd2da=_0xbd29e4[_0x13aa26];return _0x4cd2da;}const a38_0x18c57f=a38_0x4cd2;(function(_0x3252b9,_0x41e0f3){const _0x577fbf=a38_0x4cd2,_0xfce2eb=_0x3252b9();while(!![]){try{const _0x578a93=parseInt(_0x577fbf(0x1ec))/0x1*(-parseInt(_0x577fbf(0x1f5))/0x2)+parseInt(_0x577fbf(0x1f2))/0x3+parseInt(_0x577fbf(0x1ee))/0x4+parseInt(_0x577fbf(0x1f6))/0x5*(-parseInt(_0x577fbf(0x1f1))/0x6)+parseInt(_0x577fbf(0x1f0))/0x7*(-parseInt(_0x577fbf(0x1f7))/0x8)+parseInt(_0x577fbf(0x1f3))/0x9+parseInt(_0x577fbf(0x1ed))/0xa;if(_0x578a93===_0x41e0f3)break;else _0xfce2eb['push'](_0xfce2eb['shift']());}catch(_0x74d842){_0xfce2eb['push'](_0xfce2eb['shift']());}}}(a38_0xbd29,0xbc693));export const OUTPUT_FORMAT_VALUES=[a38_0x18c57f(0x1ef),a38_0x18c57f(0x1f4),'compress'];function a38_0xbd29(){const _0x38350b=['375494ihStnN','18LwMYng','1766691vjLOOL','11782575mEVZqc','pretty','36094UijwZX','391915IALfXc','168VLVnRl','37tRqIwg','9011680dylCdN','7444OZRfRY','json'];a38_0xbd29=function(){return _0x38350b;};return a38_0xbd29();}
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x2f2f0e=a39_0x5ec2;(function(_0x284e57,_0x1c0d0b){const _0x25de76=a39_0x5ec2,_0x318f1d=_0x284e57();while(!![]){try{const _0x2e22e0=-parseInt(_0x25de76(0x195))/0x1+parseInt(_0x25de76(0x189))/0x2+parseInt(_0x25de76(0x18f))/0x3*(-parseInt(_0x25de76(0x199))/0x4)+parseInt(_0x25de76(0x192))/0x5+-parseInt(_0x25de76(0x19c))/0x6+-parseInt(_0x25de76(0x18b))/0x7+parseInt(_0x25de76(0x198))/0x8;if(_0x2e22e0===_0x1c0d0b)break;else _0x318f1d['push'](_0x318f1d['shift']());}catch(_0x491fc5){_0x318f1d['push'](_0x318f1d['shift']());}}}(a39_0x208d,0x2a3d0));function a39_0x5ec2(_0x552b52,_0x1c8d64){_0x552b52=_0x552b52-0x189;const _0x208d39=a39_0x208d();let _0x5ec2c6=_0x208d39[_0x552b52];return _0x5ec2c6;}export const PRODUCT_CONFIG={'cliBinName':a39_0x2f2f0e(0x18d),'cliDisplayName':a39_0x2f2f0e(0x18a),'npmPackageName':'@lovrabet/lovrabet-cli','skillSource':a39_0x2f2f0e(0x19f),'npmRegistryBaseUrl':a39_0x2f2f0e(0x19e),'envPrefix':a39_0x2f2f0e(0x1a0),'legacyEnvPrefixes':[a39_0x2f2f0e(0x196)],'configFileNames':[a39_0x2f2f0e(0x19a),'.lovrabetrc'],'newConfigFileName':'.lovrabet.json','homeDirName':'.lovrabet','logFileName':'.lovrabet-runtime.log','invokeSource':a39_0x2f2f0e(0x194),'userCenterDisplayName':a39_0x2f2f0e(0x1a1),'skipNpxSkillsEnvSuffix':a39_0x2f2f0e(0x193),'domains':{'production':{'user':'https://user.lovrabet.com','api':a39_0x2f2f0e(0x19b),'runtime':a39_0x2f2f0e(0x191)},'nonProduction':{'user':a39_0x2f2f0e(0x18c),'api':a39_0x2f2f0e(0x190),'runtime':a39_0x2f2f0e(0x18e)}},'accessKeyCreatePath':'/user/ak'};function a39_0x208d(){const _0x1e4958=['lovrabet','https://daily-runtime.lovrabet.com','6588bQPkJN','https://daily-api.lovrabet.com','https://runtime.lovrabet.com','178910Dkqqny','SKIP_NPX_SKILLS','cli:lovrabet-runtime','246906XywHBW','RABETBASE','map','4868552taCnvi','240JWMpig','.lovrabet.json','https://api.lovrabet.com','1975488jxffbt','envPrefix','https://registry.npmjs.org','lovrabet/lovrabet-cli','LOVRABET','Lovrabet\x20User\x20Center','633978SCImEf','Lovrabet\x20Runtime\x20CLI','562926vwyfoA','https://user-daily.lovrabet.com'];a39_0x208d=function(){return _0x1e4958;};return a39_0x208d();}export function productEnvName(_0x20b8cd){const _0x356364=a39_0x2f2f0e;return PRODUCT_CONFIG[_0x356364(0x19d)]+'_'+_0x20b8cd;}export function productEnvNames(_0x16fb5d){const _0x1be1b5=a39_0x2f2f0e;return[productEnvName(_0x16fb5d),...PRODUCT_CONFIG['legacyEnvPrefixes'][_0x1be1b5(0x197)](_0x5d35ec=>_0x5d35ec+'_'+_0x16fb5d)];}export function productEnv(_0x36ec96){for(const _0x5b8175 of productEnvNames(_0x36ec96)){const _0x32c014=process.env[_0x5b8175];if(_0x32c014!==undefined)return _0x32c014;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x32e6d0=a40_0x2065;function a40_0x4cbe(){const _0x286ad7=['299494xtwFBs','2UOrTPA','96649cghMzw','high-risk-write','1796799qhFQwv','84vUQABg','5168910IXAGGb','3499568NhisMS','read','1195600NaKtPP','write','12353292iWTffv'];a40_0x4cbe=function(){return _0x286ad7;};return a40_0x4cbe();}function a40_0x2065(_0x2f41b1,_0x24cb87){_0x2f41b1=_0x2f41b1-0x118;const _0x4cbede=a40_0x4cbe();let _0x206513=_0x4cbede[_0x2f41b1];return _0x206513;}(function(_0x52e1eb,_0x22ceba){const _0x1b2331=a40_0x2065,_0x31a93f=_0x52e1eb();while(!![]){try{const _0x51634d=parseInt(_0x1b2331(0x122))/0x1+parseInt(_0x1b2331(0x123))/0x2*(-parseInt(_0x1b2331(0x11a))/0x3)+parseInt(_0x1b2331(0x11d))/0x4+-parseInt(_0x1b2331(0x11c))/0x5+parseInt(_0x1b2331(0x11b))/0x6*(-parseInt(_0x1b2331(0x118))/0x7)+-parseInt(_0x1b2331(0x11f))/0x8+parseInt(_0x1b2331(0x121))/0x9;if(_0x51634d===_0x22ceba)break;else _0x31a93f['push'](_0x31a93f['shift']());}catch(_0x1a27aa){_0x31a93f['push'](_0x31a93f['shift']());}}}(a40_0x4cbe,0x8b877));export const RISK_LEVEL_VALUES=[a40_0x32e6d0(0x11e),a40_0x32e6d0(0x120),a40_0x32e6d0(0x119)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a41_0x5e5c(_0x18c3a8,_0x1c1838){_0x18c3a8=_0x18c3a8-0x1a6;const _0x2676ed=a41_0x2676();let _0x5e5cc4=_0x2676ed[_0x18c3a8];return _0x5e5cc4;}const a41_0x110f80=a41_0x5e5c;function a41_0x2676(){const _0x30a36b=['5357710cMtmVx','39216EUsKDW','991011EcFgnJ','2euzrZk','2790272svRWvs','36tckQTh','8291003FEgbxN','user','612056mNHJgN','production','96iAywXY','480170ETEfxL','domains'];a41_0x2676=function(){return _0x30a36b;};return a41_0x2676();}(function(_0x347992,_0x84e557){const _0x126f95=a41_0x5e5c,_0x4c576a=_0x347992();while(!![]){try{const _0x246ab0=-parseInt(_0x126f95(0x1a9))/0x1*(-parseInt(_0x126f95(0x1aa))/0x2)+-parseInt(_0x126f95(0x1a8))/0x3+-parseInt(_0x126f95(0x1ab))/0x4+parseInt(_0x126f95(0x1b2))/0x5*(-parseInt(_0x126f95(0x1b1))/0x6)+parseInt(_0x126f95(0x1ad))/0x7+parseInt(_0x126f95(0x1af))/0x8*(parseInt(_0x126f95(0x1ac))/0x9)+parseInt(_0x126f95(0x1a7))/0xa;if(_0x246ab0===_0x84e557)break;else _0x4c576a['push'](_0x4c576a['shift']());}catch(_0x4bbc3b){_0x4c576a['push'](_0x4c576a['shift']());}}}(a41_0x2676,0xbc007));import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a41_0x110f80(0x1a6)][a41_0x110f80(0x1b0)][a41_0x110f80(0x1ae)]+PRODUCT_CONFIG['accessKeyCreatePath'];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x4a8c7c=a42_0x5b8d;(function(_0x289f5f,_0x1a1b05){const _0x2076da=a42_0x5b8d,_0x5a5144=_0x289f5f();while(!![]){try{const _0x7e3f8a=-parseInt(_0x2076da(0xd3))/0x1+-parseInt(_0x2076da(0xdf))/0x2+-parseInt(_0x2076da(0x10d))/0x3*(-parseInt(_0x2076da(0xec))/0x4)+parseInt(_0x2076da(0x10f))/0x5*(parseInt(_0x2076da(0xd4))/0x6)+-parseInt(_0x2076da(0xe4))/0x7+-parseInt(_0x2076da(0xf7))/0x8+parseInt(_0x2076da(0xe7))/0x9;if(_0x7e3f8a===_0x1a1b05)break;else _0x5a5144['push'](_0x5a5144['shift']());}catch(_0x5462d7){_0x5a5144['push'](_0x5a5144['shift']());}}}(a42_0x19af,0x5cf94));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';function a42_0x19af(){const _0x47740c=['userDomain','read','utf8','isTTY','defaultApp','empty','parse','apiDomain','argv','EXDEV','string','project','code','3uWPDsV','stdin','4965OTAamO','APPCODE','globalConfig','message','development','write','maxRisk','locale','PAGE_SIZE','env','host','daily','setRawMode','error','values','542342pMMMmv','2862FpwcSu','stringify','inherit','riskLevel','EACCES','FORMAT','app','cwd','accessKey','join','local-alias','447144gvoElt','./constant/domain.js','object','production','runtimeDomain','160251lDFoyM','EPERM','ACCESS_KEY','583317lTPqHW','projectConfig','apps','stdout','explicit','3043972hjSWgS','setRawCommand','.tmp','raw','authRequired','missing','top-level','trim','appcode','global','online','1038720YNDoAC','pageSize','setLogPath','APP','nonInteractive','newConfigFileName','configFileNames','format','true'];a42_0x19af=function(){return _0x47740c;};return a42_0x19af();}export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a42_0x4a8c7c(0xfd)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0x4a8c7c(0xfc)];function resolveConfigPath(_0x27a7a0){for(const _0x30d00f of CONFIG_NAMES){const _0x30e473=resolve(_0x27a7a0,_0x30d00f);if(existsSync(_0x30e473))return _0x30e473;}return undefined;}export function resolveWriteConfigPath(_0x34e84a){const _0x4aa97e=a42_0x4a8c7c,_0x5a762f=_0x34e84a===_0x4aa97e(0x10b)?process[_0x4aa97e(0xdb)]():homedir(),_0x12c1b8=resolveConfigPath(_0x5a762f);return _0x12c1b8??resolve(_0x5a762f,NEW_CONFIG_NAME);}export function readConfigFile(_0x4aa822){const _0x26cdad=a42_0x4a8c7c;try{if(existsSync(_0x4aa822)){const _0x52038a=readFileSync(_0x4aa822,{'encoding':_0x26cdad(0x102)});if(_0x52038a){const _0x4cab7b=JSON['parse'](_0x52038a);return migrateOnlineEnv(_0x4aa822,_0x4cab7b),_0x4cab7b;}}}catch{}return{};}function migrateOnlineEnv(_0x5b025e,_0x2d4e37){const _0x3dd37c=a42_0x4a8c7c;let _0xb0dccd=![];_0x2d4e37['env']==='online'&&(_0x2d4e37[_0x3dd37c(0x118)]='production',_0xb0dccd=!![]);if(_0x2d4e37[_0x3dd37c(0xe9)]&&typeof _0x2d4e37[_0x3dd37c(0xe9)]===_0x3dd37c(0xe1))for(const _0x51e6e0 of Object[_0x3dd37c(0xd2)](_0x2d4e37['apps'])){_0x51e6e0&&_0x51e6e0[_0x3dd37c(0x118)]===_0x3dd37c(0xf6)&&(_0x51e6e0[_0x3dd37c(0x118)]='production',_0xb0dccd=!![]);}if(_0xb0dccd)try{writeConfigFile(_0x5b025e,_0x2d4e37);}catch{}}export function writeConfigFile(_0x405db5,_0x4c6ea7){const _0x3a02ee=a42_0x4a8c7c,_0x52f027=dirname(_0x405db5);!existsSync(_0x52f027)&&mkdirSync(_0x52f027,{'recursive':!![]});const _0x5ee758=_0x405db5+_0x3a02ee(0xee);try{writeFileSync(_0x5ee758,JSON[_0x3a02ee(0xd5)](_0x4c6ea7,null,0x2)+'\x0a',{'encoding':_0x3a02ee(0x102),'mode':0x180});try{renameSync(_0x5ee758,_0x405db5);}catch(_0x50f21c){if(_0x50f21c[_0x3a02ee(0x10c)]===_0x3a02ee(0xe5)||_0x50f21c[_0x3a02ee(0x10c)]===_0x3a02ee(0x109)||_0x50f21c[_0x3a02ee(0x10c)]===_0x3a02ee(0xd8)){writeFileSync(_0x405db5,JSON['stringify'](_0x4c6ea7,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x5ee758);}catch{}}else throw _0x50f21c;}}catch(_0x47207d){try{unlinkSync(_0x5ee758);}catch{}throw _0x47207d;}}export function isNonInteractiveMode(_0x376d5){const _0x2ba58f=a42_0x4a8c7c;return!!(_0x376d5[_0x2ba58f(0xfb)]||_0x376d5['ci']||productEnvNames('CI')['some'](_0x2a1f99=>process.env[_0x2a1f99]===_0x2ba58f(0xff))||process.env.CI===_0x2ba58f(0xff)||!process[_0x2ba58f(0xea)]['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x58c2fb=a42_0x4a8c7c;if(!process['stdin'][_0x58c2fb(0x103)])return![];try{const _0x1861a6=process[_0x58c2fb(0x10e)]['isRaw'];return process[_0x58c2fb(0x10e)][_0x58c2fb(0xd0)](!![]),process[_0x58c2fb(0x10e)]['setRawMode'](_0x1861a6??![]),!![];}catch{return![];}}export async function createContext(_0x466589){const _0x2c95f2=a42_0x4a8c7c,_0x1983a1=readRawConfig(),_0x182486=buildConfig(_0x1983a1,_0x466589);await initGlobalEnvironment(_0x182486);const {getUserDomain:_0x27de9e,getApiDomain:_0x5ede82}=await import(_0x2c95f2(0xe0)),_0x10dfda={'apiDomain':_0x5ede82(),'userDomain':_0x27de9e()},_0x985522=await buildAuth(_0x182486);logger[_0x2c95f2(0xf9)](process[_0x2c95f2(0xdb)]());const _0x18e269=(CLI_BIN_NAME+'\x20'+process[_0x2c95f2(0x108)]['slice'](0x2)[_0x2c95f2(0xdd)]('\x20'))[_0x2c95f2(0xf3)]();logger[_0x2c95f2(0xed)](_0x18e269);const _0x58755d=isNonInteractiveMode(_0x466589);return{'config':_0x182486,'auth':_0x985522,'logger':logger,'env':_0x10dfda,'nonInteractive':_0x58755d};}export function buildConfigFromFlags(_0x574387){return buildConfig(readRawConfig(),_0x574387);}export function getLocalAppAliases(_0x2d7618){const _0x50d4e2=a42_0x4a8c7c;return _0x2d7618['apps']&&typeof _0x2d7618[_0x50d4e2(0xe9)]==='object'?_0x2d7618[_0x50d4e2(0xe9)]:{};}export function resolveLocalAppAliasCode(_0x459bb4,_0xeb83e1){const _0x94247f=a42_0x4a8c7c;if(!_0xeb83e1)return undefined;const _0x40efea=getLocalAppAliases(_0x459bb4)[_0xeb83e1],_0x246449=_0x40efea?.[_0x94247f(0xf4)];return typeof _0x246449===_0x94247f(0x10a)&&_0x246449['trim']()?_0x246449[_0x94247f(0xf3)]():undefined;}export function readAppCodeFromConfig(){const _0x564ffc=a42_0x4a8c7c,_0x4807b0=readRawConfig(),_0x2d8469=_0x4807b0['appcode']??_0x4807b0[_0x564ffc(0xda)];if(typeof _0x2d8469===_0x564ffc(0x10a)&&_0x2d8469[_0x564ffc(0xf3)]())return _0x2d8469[_0x564ffc(0xf3)]();const _0x168981=resolveLocalAppAliasCode(_0x4807b0,typeof _0x4807b0['defaultApp']===_0x564ffc(0x10a)?_0x4807b0['defaultApp']:undefined);if(_0x168981)return _0x168981;const _0x2b8ddb=normalizeEnv(String(_0x4807b0[_0x564ffc(0x118)]||_0x564ffc(0xe2))),_0x274e66=isDaily(_0x2b8ddb)?_0x564ffc(0xcf):isDev(_0x2b8ddb)?_0x564ffc(0x113):_0x564ffc(0xe2),_0x48ae28=resolveCachedAppCode(typeof _0x4807b0[_0x564ffc(0x104)]===_0x564ffc(0x10a)?_0x4807b0[_0x564ffc(0x104)]:undefined,_0x274e66,typeof _0x4807b0[_0x564ffc(0xdc)]===_0x564ffc(0x10a)?_0x4807b0[_0x564ffc(0xdc)]:undefined);if(_0x48ae28)return _0x48ae28;const _0x1ddc80=Object[_0x564ffc(0xd2)](getLocalAppAliases(_0x4807b0))['find'](_0x525520=>_0x525520?.[_0x564ffc(0xf4)]);return typeof _0x1ddc80?.[_0x564ffc(0xf4)]===_0x564ffc(0x10a)&&_0x1ddc80[_0x564ffc(0xf4)][_0x564ffc(0xf3)]()?_0x1ddc80[_0x564ffc(0xf4)][_0x564ffc(0xf3)]():undefined;}export function readScopedConfig(_0xdc9093){const _0x5e942c=a42_0x4a8c7c,_0x446efa=_0xdc9093[_0x5e942c(0xf5)]?_0x5e942c(0xf5):_0x5e942c(0x10b);return readConfigFile(resolveWriteConfigPath(_0x446efa));}export function writeScopedConfig(_0x51d7fc,_0x331763){const _0x2a8608=a42_0x4a8c7c,_0x4b0ff3=_0x331763['global']?'global':_0x2a8608(0x10b);writeConfigFile(resolveWriteConfigPath(_0x4b0ff3),_0x51d7fc);}export async function initGlobalEnvironment(_0x1d8040){const _0x5cd643=a42_0x4a8c7c,{initEnv:_0x27ac1e}=await import('./constant/env.js');_0x27ac1e(_0x1d8040['env']);const {initDomains:_0x21cda4}=await import(_0x5cd643(0xe0));_0x21cda4({'apiDomain':_0x1d8040[_0x5cd643(0xef)][_0x5cd643(0x107)]||_0x1d8040['raw'][_0x5cd643(0xce)]||undefined,'userDomain':_0x1d8040[_0x5cd643(0xef)][_0x5cd643(0x100)]||undefined,'runtimeDomain':_0x1d8040[_0x5cd643(0xef)][_0x5cd643(0xe3)]||undefined});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x5e632e){const _0x339d59=a42_0x4a8c7c;if(!existsSync(_0x5e632e))return{'status':_0x339d59(0xf1)};try{const _0x59f2b0=readFileSync(_0x5e632e,{'encoding':_0x339d59(0x102)});if(!_0x59f2b0?.[_0x339d59(0xf3)]())return{'status':_0x339d59(0x105)};const _0xe67321=JSON['parse'](_0x59f2b0);return{'status':'ok','data':_0xe67321};}catch(_0x45546f){return{'status':_0x339d59(0xd1),'message':_0x45546f instanceof Error?_0x45546f[_0x339d59(0x112)]:String(_0x45546f)};}}export function loadRawConfigLayers(_0x214a75){const _0x3d96c2=a42_0x4a8c7c;let _0x3f6db7={},_0x2e989f={},_0x51f374,_0x49501a;try{_0x51f374=resolveConfigPath(homedir());if(_0x51f374){const _0x2a764d=readFileSync(_0x51f374,{'encoding':'utf8'});if(_0x2a764d)_0x3f6db7=JSON[_0x3d96c2(0x106)](_0x2a764d);}}catch{}try{const _0x54ee32=_0x214a75||process[_0x3d96c2(0xdb)]();_0x49501a=resolveConfigPath(_0x54ee32);if(_0x49501a){const _0x2128c7=readFileSync(_0x49501a,{'encoding':_0x3d96c2(0x102)});if(_0x2128c7)_0x2e989f=JSON[_0x3d96c2(0x106)](_0x2128c7);}}catch{}return{'globalPath':_0x51f374,'projectPath':_0x49501a,'globalConfig':_0x3f6db7,'projectConfig':_0x2e989f};}function mergeRawConfigLayers(_0x235570){const _0x5749f6=a42_0x4a8c7c,{globalConfig:_0x31ebec,projectConfig:_0x2876}=_0x235570;if(_0x2876[_0x5749f6(0xd6)]===![]){const _0x4f488e={..._0x2876};return delete _0x4f488e[_0x5749f6(0xd6)],_0x4f488e;}const _0x2c4371={..._0x31ebec,..._0x2876};if(_0x5749f6(0x104)in _0x2876)_0x2c4371['defaultApp']=_0x2876['defaultApp'];else _0x31ebec[_0x5749f6(0x104)]&&(_0x2c4371[_0x5749f6(0x104)]=_0x31ebec[_0x5749f6(0x104)]);return _0x2c4371;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x2af146){return mergeRawConfigLayers(loadRawConfigLayers(_0x2af146));}export function readRawConfigWithLayers(_0x13a96f){const _0x4d73d5=loadRawConfigLayers(_0x13a96f);return{'config':mergeRawConfigLayers(_0x4d73d5),'layers':_0x4d73d5};}export function resolveDefaultAppSource(_0x4f0656){const _0x5ec24a=a42_0x4a8c7c;if(_0x5ec24a(0x104)in _0x4f0656[_0x5ec24a(0xe8)])return _0x5ec24a(0x10b);if(_0x4f0656[_0x5ec24a(0xe8)][_0x5ec24a(0xd6)]===![])return null;if(_0x4f0656[_0x5ec24a(0x111)]['defaultApp'])return _0x5ec24a(0xf5);return null;}function buildConfig(_0x7e92ae,_0x3a49e7){const _0x3e0a18=a42_0x4a8c7c,_0x17c9c3=_0x7e92ae[_0x3e0a18(0x104)]||undefined,_0x21d135=_0x3a49e7[_0x3e0a18(0xda)]||env(_0x3e0a18(0xfa))||undefined,_0x447fa5=_0x21d135||_0x17c9c3||undefined,_0x3f8b97=env(_0x3e0a18(0xe6))||_0x7e92ae['accessKey']||undefined,_0x1a0f6a=_0x3a49e7[_0x3e0a18(0x118)]||env('ENV')||_0x7e92ae[_0x3e0a18(0x118)]||DEFAULT_CONFIG_VALUES[_0x3e0a18(0x118)],_0x391251=normalizeEnv(String(_0x1a0f6a)),_0x2dc93c=isDaily(_0x391251)?_0x3e0a18(0xcf):isDev(_0x391251)?'development':_0x3e0a18(0xe2),_0xd4ea83=resolveLocalAppAliasCode(_0x7e92ae,_0x447fa5),_0x4182ab=resolveCachedAppCode(_0x447fa5,_0x2dc93c,_0x3f8b97),_0x4139b4=typeof _0x3a49e7[_0x3e0a18(0xf4)]==='string'?_0x3a49e7['appcode']:undefined,_0xe99342=env(_0x3e0a18(0x110)),_0x11bc26=_0x21d135?undefined:_0x7e92ae[_0x3e0a18(0xf4)]||_0x7e92ae[_0x3e0a18(0xda)]||undefined,_0x39f2f0=_0x4139b4||_0xe99342||_0xd4ea83||_0x4182ab||_0x11bc26||undefined,_0x18a50e=_0x4139b4?_0x3e0a18(0xeb):_0xe99342?_0x3e0a18(0x118):_0xd4ea83?_0x3e0a18(0xde):_0x4182ab?'cache':_0x11bc26?_0x3e0a18(0xf2):undefined,_0x341459=_0x7e92ae[_0x3e0a18(0x116)]||DEFAULT_CONFIG_VALUES[_0x3e0a18(0x116)],_0x187944=undefined,_0x466ca8=_0x3a49e7['format']||env(_0x3e0a18(0xd9))||_0x7e92ae[_0x3e0a18(0xfe)],_0x402a55=normalizeLegacyOutputFormat(_0x466ca8),_0x2fb0c1=env(_0x3e0a18(0x117))||_0x7e92ae[_0x3e0a18(0xf8)],_0x127b8c=_0x2fb0c1?Number(_0x2fb0c1)||undefined:undefined,_0x5391f6=_0x7e92ae['riskLevel']||_0x7e92ae[_0x3e0a18(0x115)],_0x5454ac=_0x5391f6===_0x3e0a18(0x101)||_0x5391f6===_0x3e0a18(0x114)||_0x5391f6==='high-risk-write'?_0x5391f6:DEFAULT_CONFIG_VALUES[_0x3e0a18(0xd7)],_0x3af3c3=env('VERBOSE'),_0x465842=_0x3af3c3==='1'||_0x3af3c3==='true';return{'appCode':typeof _0x39f2f0===_0x3e0a18(0x10a)&&_0x39f2f0['trim']()?_0x39f2f0[_0x3e0a18(0xf3)]():undefined,'appCodeSource':_0x18a50e,'env':_0x2dc93c,'locale':_0x341459,'cookie':_0x187944,'accessKey':_0x3f8b97,'format':_0x402a55,'pageSize':_0x127b8c,'riskLevel':_0x5454ac,'verbose':_0x465842,'defaultApp':_0x17c9c3,'currentApp':typeof _0x447fa5===_0x3e0a18(0x10a)?_0x447fa5:undefined,'raw':_0x7e92ae};}function env(_0x2b0f73){return productEnv(_0x2b0f73);}function a42_0x5b8d(_0x15488c,_0x5d1a8a){_0x15488c=_0x15488c-0xce;const _0x19af94=a42_0x19af();let _0x5b8d58=_0x19af94[_0x15488c];return _0x5b8d58;}async function buildAuth(_0x59bb6a){const _0x3ca1da=a42_0x4a8c7c,_0x43340f='',_0x469308=!!_0x59bb6a[_0x3ca1da(0xdc)];return{'cookie':_0x43340f,'isLoggedIn':_0x469308,async 'getOrLogin'(){const _0x333218=_0x3ca1da;if(_0x469308)return _0x43340f;throw CliErrors[_0x333218(0xf0)]();}};}
|
|
1
|
+
const a42_0xccd83c=a42_0x6c60;(function(_0x35b953,_0x4f35f3){const _0x574d5f=a42_0x6c60,_0x632e44=_0x35b953();while(!![]){try{const _0x3d7379=parseInt(_0x574d5f(0x75))/0x1*(-parseInt(_0x574d5f(0x92))/0x2)+-parseInt(_0x574d5f(0x98))/0x3+-parseInt(_0x574d5f(0x97))/0x4+parseInt(_0x574d5f(0x72))/0x5+-parseInt(_0x574d5f(0x8f))/0x6*(-parseInt(_0x574d5f(0xa1))/0x7)+-parseInt(_0x574d5f(0xa5))/0x8+-parseInt(_0x574d5f(0xb2))/0x9*(-parseInt(_0x574d5f(0xa6))/0xa);if(_0x3d7379===_0x4f35f3)break;else _0x632e44['push'](_0x632e44['shift']());}catch(_0x56575b){_0x632e44['push'](_0x632e44['shift']());}}}(a42_0x2dfd,0x5b247));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function a42_0x6c60(_0x1310ea,_0x5e69de){_0x1310ea=_0x1310ea-0x6c;const _0x2dfd14=a42_0x2dfd();let _0x6c604c=_0x2dfd14[_0x1310ea];return _0x6c604c;}import{resolveCachedAppCode}from'./commands/app/cache.js';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a42_0xccd83c(0x7d)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0xccd83c(0x84)];function resolveConfigPath(_0x20df56){for(const _0x25c731 of CONFIG_NAMES){const _0x380b22=resolve(_0x20df56,_0x25c731);if(existsSync(_0x380b22))return _0x380b22;}return undefined;}export function resolveWriteConfigPath(_0x59788e){const _0x12659d=_0x59788e==='project'?process['cwd']():homedir(),_0x29ef57=resolveConfigPath(_0x12659d);return _0x29ef57??resolve(_0x12659d,NEW_CONFIG_NAME);}export function readConfigFile(_0x7282f5){const _0x17841a=a42_0xccd83c;try{if(existsSync(_0x7282f5)){const _0x5d8253=readFileSync(_0x7282f5,{'encoding':_0x17841a(0xac)});if(_0x5d8253){const _0x5358c7=JSON['parse'](_0x5d8253);return migrateOnlineEnv(_0x7282f5,_0x5358c7),_0x5358c7;}}}catch{}return{};}function migrateOnlineEnv(_0x626108,_0x3fb3ef){const _0x3d49e1=a42_0xccd83c;let _0x29b932=![];_0x3fb3ef[_0x3d49e1(0xa3)]===_0x3d49e1(0x7c)&&(_0x3fb3ef['env']=_0x3d49e1(0x9f),_0x29b932=!![]);if(_0x3fb3ef[_0x3d49e1(0xa2)]&&typeof _0x3fb3ef[_0x3d49e1(0xa2)]===_0x3d49e1(0x7e))for(const _0x4d40d4 of Object[_0x3d49e1(0x76)](_0x3fb3ef[_0x3d49e1(0xa2)])){_0x4d40d4&&_0x4d40d4[_0x3d49e1(0xa3)]===_0x3d49e1(0x7c)&&(_0x4d40d4[_0x3d49e1(0xa3)]='production',_0x29b932=!![]);}if(_0x29b932)try{writeConfigFile(_0x626108,_0x3fb3ef);}catch{}}export function writeConfigFile(_0x46338c,_0x17a1ad){const _0x4da155=a42_0xccd83c,_0x3e7c6c=dirname(_0x46338c);!existsSync(_0x3e7c6c)&&mkdirSync(_0x3e7c6c,{'recursive':!![]});const _0x429611=_0x46338c+_0x4da155(0x96);try{writeFileSync(_0x429611,JSON[_0x4da155(0x83)](_0x17a1ad,null,0x2)+'\x0a',{'encoding':_0x4da155(0xac),'mode':0x180});try{renameSync(_0x429611,_0x46338c);}catch(_0x4db22f){if(_0x4db22f[_0x4da155(0xa4)]===_0x4da155(0xb1)||_0x4db22f[_0x4da155(0xa4)]===_0x4da155(0x8a)||_0x4db22f[_0x4da155(0xa4)]===_0x4da155(0x7b)){writeFileSync(_0x46338c,JSON[_0x4da155(0x83)](_0x17a1ad,null,0x2)+'\x0a',{'encoding':_0x4da155(0xac)});try{unlinkSync(_0x429611);}catch{}}else throw _0x4db22f;}}catch(_0x103154){try{unlinkSync(_0x429611);}catch{}throw _0x103154;}}export function isNonInteractiveMode(_0x27058d){const _0x16ccd6=a42_0xccd83c;return!!(_0x27058d[_0x16ccd6(0xa7)]||_0x27058d['ci']||productEnvNames('CI')[_0x16ccd6(0x86)](_0x47ad97=>process.env[_0x47ad97]===_0x16ccd6(0xb0))||process.env.CI===_0x16ccd6(0xb0)||!process[_0x16ccd6(0xaf)][_0x16ccd6(0x8e)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x5139d8=a42_0xccd83c;if(!process[_0x5139d8(0x80)]['isTTY'])return![];try{const _0x219625=process['stdin'][_0x5139d8(0x88)];return process[_0x5139d8(0x80)][_0x5139d8(0x9a)](!![]),process[_0x5139d8(0x80)][_0x5139d8(0x9a)](_0x219625??![]),!![];}catch{return![];}}export async function createContext(_0x1631d2){const _0x8f26fb=a42_0xccd83c,_0x53db69=readRawConfig(),_0x5d46ad=buildConfig(_0x53db69,_0x1631d2);await initGlobalEnvironment(_0x5d46ad);const {getUserDomain:_0x302237,getApiDomain:_0x593c52}=await import(_0x8f26fb(0x99)),_0x1403f4={'apiDomain':_0x593c52(),'userDomain':_0x302237()},_0x12c909=await buildAuth(_0x5d46ad);logger[_0x8f26fb(0x70)](process[_0x8f26fb(0xae)]());const _0x16feff=(CLI_BIN_NAME+'\x20'+process[_0x8f26fb(0x78)]['slice'](0x2)[_0x8f26fb(0x85)]('\x20'))[_0x8f26fb(0xa0)]();logger[_0x8f26fb(0x9c)](_0x16feff);const _0x1a7347=isNonInteractiveMode(_0x1631d2);return{'config':_0x5d46ad,'auth':_0x12c909,'logger':logger,'env':_0x1403f4,'nonInteractive':_0x1a7347};}export function buildConfigFromFlags(_0x4691ef){return buildConfig(readRawConfig(),_0x4691ef);}export function getLocalAppAliases(_0xb05ceb){const _0x2c2535=a42_0xccd83c;return _0xb05ceb[_0x2c2535(0xa2)]&&typeof _0xb05ceb['apps']===_0x2c2535(0x7e)?_0xb05ceb[_0x2c2535(0xa2)]:{};}export function resolveLocalAppAliasCode(_0x46ada1,_0xf2ffd3){const _0x18d7ba=a42_0xccd83c;if(!_0xf2ffd3)return undefined;const _0x178f8a=getLocalAppAliases(_0x46ada1)[_0xf2ffd3],_0x1f7ea2=_0x178f8a?.[_0x18d7ba(0x6d)];return typeof _0x1f7ea2===_0x18d7ba(0x81)&&_0x1f7ea2[_0x18d7ba(0xa0)]()?_0x1f7ea2['trim']():undefined;}export function readAppCodeFromConfig(){const _0x5973a0=a42_0xccd83c,_0x348265=readRawConfig(),_0x120da1=_0x348265[_0x5973a0(0x6d)]??_0x348265['app'];if(typeof _0x120da1===_0x5973a0(0x81)&&_0x120da1['trim']())return _0x120da1['trim']();const _0x22c779=resolveLocalAppAliasCode(_0x348265,typeof _0x348265[_0x5973a0(0x6f)]==='string'?_0x348265[_0x5973a0(0x6f)]:undefined);if(_0x22c779)return _0x22c779;const _0x220b10=normalizeEnv(String(_0x348265[_0x5973a0(0xa3)]||'production')),_0x34a74d=isDaily(_0x220b10)?_0x5973a0(0x95):isDev(_0x220b10)?_0x5973a0(0x8d):'production',_0x3bc811=resolveCachedAppCode(typeof _0x348265[_0x5973a0(0x6f)]===_0x5973a0(0x81)?_0x348265[_0x5973a0(0x6f)]:undefined,_0x34a74d,typeof _0x348265[_0x5973a0(0xa8)]===_0x5973a0(0x81)?_0x348265[_0x5973a0(0xa8)]:undefined);if(_0x3bc811)return _0x3bc811;const _0x492623=Object[_0x5973a0(0x76)](getLocalAppAliases(_0x348265))[_0x5973a0(0x9b)](_0x5ab296=>_0x5ab296?.[_0x5973a0(0x6d)]);return typeof _0x492623?.[_0x5973a0(0x6d)]==='string'&&_0x492623[_0x5973a0(0x6d)][_0x5973a0(0xa0)]()?_0x492623[_0x5973a0(0x6d)]['trim']():undefined;}export function readScopedConfig(_0x437a75){const _0x1087ef=a42_0xccd83c,_0x375b1d=_0x437a75[_0x1087ef(0x94)]?_0x1087ef(0x94):_0x1087ef(0x73);return readConfigFile(resolveWriteConfigPath(_0x375b1d));}export function writeScopedConfig(_0x23c76e,_0x24131e){const _0x3f5c04=a42_0xccd83c,_0x168062=_0x24131e[_0x3f5c04(0x94)]?_0x3f5c04(0x94):_0x3f5c04(0x73);writeConfigFile(resolveWriteConfigPath(_0x168062),_0x23c76e);}export async function initGlobalEnvironment(_0x5adcfc){const _0x133fb7=a42_0xccd83c,{initEnv:_0x34262c}=await import('./constant/env.js');_0x34262c(_0x5adcfc[_0x133fb7(0xa3)]);const {initDomains:_0x15d016}=await import(_0x133fb7(0x99));_0x15d016({'apiDomain':_0x5adcfc[_0x133fb7(0x90)]['apiDomain']||_0x5adcfc[_0x133fb7(0x90)][_0x133fb7(0x8c)]||undefined,'userDomain':_0x5adcfc[_0x133fb7(0x90)]['userDomain']||undefined,'runtimeDomain':_0x5adcfc[_0x133fb7(0x90)][_0x133fb7(0x7f)]||undefined});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x52c497){const _0x22b2e6=a42_0xccd83c;if(!existsSync(_0x52c497))return{'status':_0x22b2e6(0x93)};try{const _0x11824d=readFileSync(_0x52c497,{'encoding':'utf8'});if(!_0x11824d?.['trim']())return{'status':_0x22b2e6(0x82)};const _0x359fef=JSON[_0x22b2e6(0x9e)](_0x11824d);return{'status':'ok','data':_0x359fef};}catch(_0x3bc66f){return{'status':_0x22b2e6(0x6c),'message':_0x3bc66f instanceof Error?_0x3bc66f['message']:String(_0x3bc66f)};}}export function loadRawConfigLayers(_0x56c777){const _0x10393c=a42_0xccd83c;let _0x49034a={},_0x4d087b={},_0x3a1aae,_0x1ccd3d;try{_0x3a1aae=resolveConfigPath(homedir());if(_0x3a1aae){const _0x1742ad=readFileSync(_0x3a1aae,{'encoding':_0x10393c(0xac)});if(_0x1742ad)_0x49034a=JSON['parse'](_0x1742ad);}}catch{}try{const _0x8ddb81=_0x56c777||process['cwd']();_0x1ccd3d=resolveConfigPath(_0x8ddb81);if(_0x1ccd3d){const _0x3c758c=readFileSync(_0x1ccd3d,{'encoding':'utf8'});if(_0x3c758c)_0x4d087b=JSON['parse'](_0x3c758c);}}catch{}return{'globalPath':_0x3a1aae,'projectPath':_0x1ccd3d,'globalConfig':_0x49034a,'projectConfig':_0x4d087b};}function mergeRawConfigLayers(_0x12883c){const _0x5a61bd=a42_0xccd83c,{globalConfig:_0x4f9db1,projectConfig:_0x2b7d5c}=_0x12883c;if(_0x2b7d5c[_0x5a61bd(0x71)]===![]){const _0x4f1d95={..._0x2b7d5c};return delete _0x4f1d95[_0x5a61bd(0x71)],_0x4f1d95;}const _0xd7a74={..._0x4f9db1,..._0x2b7d5c};if(_0x5a61bd(0x6f)in _0x2b7d5c)_0xd7a74['defaultApp']=_0x2b7d5c['defaultApp'];else _0x4f9db1[_0x5a61bd(0x6f)]&&(_0xd7a74[_0x5a61bd(0x6f)]=_0x4f9db1['defaultApp']);return _0xd7a74;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x53f8fd){return mergeRawConfigLayers(loadRawConfigLayers(_0x53f8fd));}export function readRawConfigWithLayers(_0x131bcd){const _0x110e73=loadRawConfigLayers(_0x131bcd);return{'config':mergeRawConfigLayers(_0x110e73),'layers':_0x110e73};}export function resolveDefaultAppSource(_0x16a0ea){const _0x3c2349=a42_0xccd83c;if(_0x3c2349(0x6f)in _0x16a0ea[_0x3c2349(0x8b)])return _0x3c2349(0x73);if(_0x16a0ea[_0x3c2349(0x8b)][_0x3c2349(0x71)]===![])return null;if(_0x16a0ea['globalConfig'][_0x3c2349(0x6f)])return'global';return null;}function buildConfig(_0x527d55,_0x2887bf){const _0x1d2968=a42_0xccd83c,_0x4c004c=_0x527d55[_0x1d2968(0x6f)]||undefined,_0x4753f0=_0x2887bf[_0x1d2968(0xab)]||env(_0x1d2968(0xa9))||undefined,_0xe982b6=_0x4753f0||_0x4c004c||undefined,_0x29b432=env(_0x1d2968(0x74))||_0x527d55[_0x1d2968(0xa8)]||undefined,_0x3180a6=_0x2887bf[_0x1d2968(0xa3)]||env(_0x1d2968(0x89))||_0x527d55['env']||DEFAULT_CONFIG_VALUES['env'],_0x3a47d1=normalizeEnv(String(_0x3180a6)),_0x8abce3=isDaily(_0x3a47d1)?_0x1d2968(0x95):isDev(_0x3a47d1)?'development':_0x1d2968(0x9f),_0x53fe2c=resolveLocalAppAliasCode(_0x527d55,_0xe982b6),_0x5191d5=resolveCachedAppCode(_0xe982b6,_0x8abce3,_0x29b432),_0x310a82=typeof _0x2887bf['appcode']==='string'?_0x2887bf[_0x1d2968(0x6d)]:undefined,_0xf76ad6=env(_0x1d2968(0x77)),_0x5100e8=_0x4753f0?undefined:_0x527d55[_0x1d2968(0x6d)]||_0x527d55[_0x1d2968(0xab)]||undefined,_0x102575=_0x310a82||_0xf76ad6||_0x53fe2c||_0x5191d5||_0x5100e8||undefined,_0x45d188=_0x310a82?'explicit':_0xf76ad6?_0x1d2968(0xa3):_0x53fe2c?_0x1d2968(0xaa):_0x5191d5?'cache':_0x5100e8?_0x1d2968(0x9d):undefined,_0x34055f=_0x527d55['locale']||DEFAULT_CONFIG_VALUES['locale'],_0x101ac0=undefined,_0x54dd5d=_0x2887bf[_0x1d2968(0xad)]||env(_0x1d2968(0x79))||_0x527d55[_0x1d2968(0xad)],_0x531704=normalizeLegacyOutputFormat(_0x54dd5d),_0x4efe0e=env('PAGE_SIZE')||_0x527d55['pageSize'],_0x411ce0=_0x4efe0e?Number(_0x4efe0e)||undefined:undefined,_0x4a62b3=_0x527d55[_0x1d2968(0x91)]||_0x527d55[_0x1d2968(0x87)],_0x13fb68=_0x4a62b3==='read'||_0x4a62b3===_0x1d2968(0xb3)||_0x4a62b3===_0x1d2968(0x6e)?_0x4a62b3:DEFAULT_CONFIG_VALUES[_0x1d2968(0x91)],_0xf97e81=env(_0x1d2968(0x7a)),_0x292746=_0xf97e81==='1'||_0xf97e81===_0x1d2968(0xb0);return{'appCode':typeof _0x102575===_0x1d2968(0x81)&&_0x102575[_0x1d2968(0xa0)]()?_0x102575['trim']():undefined,'appCodeSource':_0x45d188,'env':_0x8abce3,'locale':_0x34055f,'cookie':_0x101ac0,'accessKey':_0x29b432,'format':_0x531704,'pageSize':_0x411ce0,'riskLevel':_0x13fb68,'verbose':_0x292746,'defaultApp':_0x4c004c,'currentApp':typeof _0xe982b6===_0x1d2968(0x81)?_0xe982b6:undefined,'raw':_0x527d55};}function env(_0x515f00){return productEnv(_0x515f00);}async function buildAuth(_0x419bef){const _0x4ba2bc=a42_0xccd83c,_0x18308e='',_0x21440f=!!_0x419bef[_0x4ba2bc(0xa8)];return{'cookie':_0x18308e,'isLoggedIn':_0x21440f,async 'getOrLogin'(){if(_0x21440f)return _0x18308e;throw CliErrors['authRequired']();}};}function a42_0x2dfd(){const _0x3e4cac=['inherit','2534910YuUKeO','project','ACCESS_KEY','757roWJRY','values','APPCODE','argv','FORMAT','VERBOSE','EACCES','online','configFileNames','object','runtimeDomain','stdin','string','empty','stringify','newConfigFileName','join','some','maxRisk','isRaw','ENV','EXDEV','projectConfig','host','development','isTTY','6ktupCK','raw','riskLevel','1374unHpdU','missing','global','daily','.tmp','876812stCGIQ','2134191nquEda','./constant/domain.js','setRawMode','find','setRawCommand','top-level','parse','production','trim','1356061lkCYCB','apps','env','code','2691784kbrUSL','2432910kVLHvE','nonInteractive','accessKey','APP','local-alias','app','utf8','format','cwd','stdout','true','EPERM','54YYuSpA','write','error','appcode','high-risk-write','defaultApp','setLogPath'];a42_0x2dfd=function(){return _0x3e4cac;};return a42_0x2dfd();}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a6966,_0x23271f){const _0x1e3f5b=a43_0x4261,_0xbe2e33=_0x1a6966();while(!![]){try{const _0x27d8c3=parseInt(_0x1e3f5b(0x1fa))/0x1+-parseInt(_0x1e3f5b(0x207))/0x2+-parseInt(_0x1e3f5b(0x1ec))/0x3*(-parseInt(_0x1e3f5b(0x1e4))/0x4)+-parseInt(_0x1e3f5b(0x1d8))/0x5*(parseInt(_0x1e3f5b(0x20b))/0x6)+-parseInt(_0x1e3f5b(0x201))/0x7*(-parseInt(_0x1e3f5b(0x211))/0x8)+-parseInt(_0x1e3f5b(0x20e))/0x9+-parseInt(_0x1e3f5b(0x1f6))/0xa*(-parseInt(_0x1e3f5b(0x1e3))/0xb);if(_0x27d8c3===_0x23271f)break;else _0xbe2e33['push'](_0xbe2e33['shift']());}catch(_0x586d2d){_0xbe2e33['push'](_0xbe2e33['shift']());}}}(a43_0x25f6,0xe1347));import{getRuntimeDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0x336246){_activeAK=_0x336246||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x1d3e8e,_0x129e56={}){const _0x1b779e=a43_0x4261,{method:method='GET',body:_0x1f10fc,headers:headers={},timeout:timeout=0x7530}=_0x129e56,_0x56d5c6=_activeAK,_0x586b3c=getRuntimeDomain();if(!_0x56d5c6)throw CliErrors[_0x1b779e(0x20c)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x1b779e(0x205)]+'.');const _0xa4bd54=''+_0x586b3c+_0x1d3e8e,_0x35c627={'X-User-AK':_0x56d5c6},_0x215393=new AbortController(),_0x4b5358=setTimeout(()=>_0x215393[_0x1b779e(0x1e0)](),timeout);try{const _0x33ed7c=await fetch(_0xa4bd54,{'method':method,'headers':{'Content-Type':_0x1b779e(0x1da),'X-Invoke-Source':PRODUCT_CONFIG[_0x1b779e(0x1fd)],..._0x35c627,...headers},'body':_0x1f10fc?JSON['stringify'](_0x1f10fc):undefined,'signal':_0x215393[_0x1b779e(0x209)]});let _0x307c6b;try{_0x307c6b=await _0x33ed7c[_0x1b779e(0x200)]();}catch{throw CliErrors[_0x1b779e(0x1ff)](_0x1b779e(0x1de)+_0x33ed7c[_0x1b779e(0x1f4)]+')',_0x33ed7c[_0x1b779e(0x1f4)]>=0x190?_0x1b779e(0x1e5):undefined);}if(!_0x33ed7c['ok']||_0x307c6b[_0x1b779e(0x1e7)]===![])throw CliErrors['apiError'](_0x307c6b[_0x1b779e(0x20f)]||_0x307c6b[_0x1b779e(0x1f0)]||_0x1b779e(0x1f1)+_0x33ed7c['status'],_0x307c6b[_0x1b779e(0x20d)]?_0x1b779e(0x1d5)+_0x307c6b['errorCode']:undefined);return _0x307c6b;}catch(_0x3b0eca){if(_0x3b0eca instanceof Error&&_0x3b0eca[_0x1b779e(0x1fc)]===_0x1b779e(0x1dc))throw CliErrors['apiError'](_0x1b779e(0x1dd)+_0xa4bd54);throw _0x3b0eca;}finally{clearTimeout(_0x4b5358);}}export async function getBffScriptInfo(_0x5ddacb){const _0x5f4bcb=a43_0x4261,_0x1cd660=await apiRequest('/client/bff/query/'+_0x5ddacb);if(!_0x1cd660[_0x5f4bcb(0x1d6)])throw CliErrors[_0x5f4bcb(0x1ea)](_0x5f4bcb(0x1f5)+_0x5ddacb);return _0x1cd660['data'];}export async function getSqlQueryInfo(_0x57a413,_0x9605d9){const _0x2f8ad0=a43_0x4261,_0xbc141e=await apiRequest(_0x2f8ad0(0x1f7),{'method':_0x2f8ad0(0x206),'body':{'appCode':_0x57a413,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x9605d9}}),_0x4917fe=_0xbc141e[_0x2f8ad0(0x1d6)],_0x4f6bcb=_0x4917fe&&typeof _0x4917fe===_0x2f8ad0(0x1eb)&&'tableData'in _0x4917fe?_0x4917fe[_0x2f8ad0(0x202)]?.[0x0]:_0x4917fe&&typeof _0x4917fe===_0x2f8ad0(0x1eb)&&_0x2f8ad0(0x1e6)in _0x4917fe?_0x4917fe:undefined;if(!_0x4f6bcb)throw CliErrors['validation'](_0x2f8ad0(0x1e8)+_0x9605d9);return _0x4f6bcb;}function isRemoteAppItem(_0x226584){const _0x295286=a43_0x4261;return!!_0x226584&&typeof _0x226584===_0x295286(0x1eb)&&typeof _0x226584[_0x295286(0x1f2)]===_0x295286(0x1d9)&&typeof _0x226584[_0x295286(0x1f8)]===_0x295286(0x1d9);}function extractRemoteAppItems(_0x12d3c8){const _0x211001=a43_0x4261;if(Array[_0x211001(0x1ee)](_0x12d3c8))return _0x12d3c8[_0x211001(0x1ef)](isRemoteAppItem);if(!_0x12d3c8||typeof _0x12d3c8!=='object')throw CliErrors['apiError'](_0x211001(0x1ed));const _0x16eadd=_0x12d3c8;if(Array['isArray'](_0x16eadd[_0x211001(0x202)]))return _0x16eadd[_0x211001(0x202)][_0x211001(0x1ef)](isRemoteAppItem);if(_0x16eadd['data']&&typeof _0x16eadd['data']==='object'){const _0x34df9d=_0x16eadd[_0x211001(0x1d6)];if(Array[_0x211001(0x1ee)](_0x34df9d[_0x211001(0x202)]))return _0x34df9d[_0x211001(0x202)][_0x211001(0x1ef)](isRemoteAppItem);}throw CliErrors[_0x211001(0x1ff)](_0x211001(0x1e2));}export async function getMyApps(){const _0xf95fb0=a43_0x4261,_0x267399=await apiRequest(_0xf95fb0(0x1f9));return extractRemoteAppItems(_0x267399[_0xf95fb0(0x1d6)]);}export async function getLoginUserInfo(){const _0x2131d6=a43_0x4261,_0xc9a403=await apiRequest('/client/user/loginUserInfo');if(!_0xc9a403[_0x2131d6(0x1d6)]||typeof _0xc9a403[_0x2131d6(0x1d6)]!==_0x2131d6(0x1eb)||Array[_0x2131d6(0x1ee)](_0xc9a403[_0x2131d6(0x1d6)]))throw CliErrors['apiError'](_0x2131d6(0x204));return _0xc9a403[_0x2131d6(0x1d6)];}export async function listDatasets(_0x59e334,_0x1c384b){const _0x35250e=a43_0x4261,_0x329238=await apiRequest(_0x35250e(0x1fb),{'method':_0x35250e(0x206),'body':{'appCode':_0x59e334,..._0x1c384b?.['code']&&{'code':_0x1c384b[_0x35250e(0x1e1)]},..._0x1c384b?.[_0x35250e(0x1fc)]&&{'name':_0x1c384b['name']}}});return extractList(_0x329238[_0x35250e(0x1d6)]);}function a43_0x4261(_0x5c9059,_0x2876a8){_0x5c9059=_0x5c9059-0x1d5;const _0x25f609=a43_0x25f6();let _0x426130=_0x25f609[_0x5c9059];return _0x426130;}export async function getDatasetDetail(_0x22c74e){const _0x1fc4cb=a43_0x4261,_0x21732f=/^\d+$/['test'](_0x22c74e)?'id':_0x1fc4cb(0x1e1),_0xfe8cda=await apiRequest(_0x1fc4cb(0x1e9)+_0x21732f+'='+_0x22c74e);return _0xfe8cda['data'];}export async function listPersonalKnowledgeBaseItems(_0x2caee9){const _0x38b323=a43_0x4261,_0xb6ea55=await apiRequest(_0x38b323(0x20a)+encodeURIComponent(_0x2caee9));return Array[_0x38b323(0x1ee)](_0xb6ea55['data'])?_0xb6ea55['data']:[];}export async function getPersonalKnowledgeBaseItem(_0x407584,_0x206b19){const _0x4448f6=a43_0x4261,_0x5a6380=await apiRequest(_0x4448f6(0x1db)+_0x407584+'?appCode='+encodeURIComponent(_0x206b19));if(!_0x5a6380['data'])throw CliErrors['validation'](_0x4448f6(0x1fe)+_0x407584);return _0x5a6380[_0x4448f6(0x1d6)];}export async function createPersonalKnowledgeBaseItem(_0x2adb30,_0x30b869){const _0x653add=a43_0x4261,_0x3ccd9e=await apiRequest(_0x653add(0x1f3),{'method':_0x653add(0x206),'body':{'appCode':_0x2adb30,..._0x30b869}});return _0x3ccd9e[_0x653add(0x1d6)];}function a43_0x25f6(){const _0xf8f877=['132KtZueT','1012CSMQkg','Check\x20your\x20credentials\x20and\x20try\x20again.','sqlCode','success','SQL\x20query\x20not\x20found:\x20','/client/dataset/query?','validation','object','10929FQNtxr','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','isArray','filter','message','API\x20error:\x20','appCode','/client/knowledge-base/personal/create','status','BFF\x20script\x20not\x20found:\x20id=','363130SYvWVg','/client/sql/query','appName','/client/app/my-apps','673120HEwvXS','/client/dataset/list','name','invokeSource','Knowledge-base\x20entry\x20not\x20found:\x20id=','apiError','json','7OBeeyK','tableData','/update','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','newConfigFileName','POST','160200HbzgLk','/client/knowledge-base/search','signal','/client/knowledge-base/personal/list?appCode=','30JcZLih','authRequired','errorCode','3108357mERXoP','errorMsg','/client/skill/personal/list?appCode=','5466056kqlWCZ','API\x20error\x20code:\x20','data','topK','1365900lPLsOl','string','application/json','/client/knowledge-base/personal/','AbortError','Request\x20timeout:\x20','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/client/skill/company/list?appCode=','abort','code','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.'];a43_0x25f6=function(){return _0xf8f877;};return a43_0x25f6();}export async function updatePersonalKnowledgeBaseItem(_0x5857da,_0x3d1a48,_0x49a135){const _0x76088f=a43_0x4261,_0x27dedd=await apiRequest(_0x76088f(0x1db)+_0x5857da+_0x76088f(0x203),{'method':_0x76088f(0x206),'body':{'appCode':_0x3d1a48,..._0x49a135}});return _0x27dedd[_0x76088f(0x1d6)];}export async function searchKnowledgeBase(_0x4576e4,_0x3eee0a){const _0x2b3ab2=a43_0x4261,_0x43ac1f=await apiRequest(_0x2b3ab2(0x208),{'method':_0x2b3ab2(0x206),'body':{'appCode':_0x4576e4,'query':_0x3eee0a['query'],..._0x3eee0a[_0x2b3ab2(0x1d7)]!==undefined?{'topK':_0x3eee0a[_0x2b3ab2(0x1d7)]}:{}}});return Array['isArray'](_0x43ac1f[_0x2b3ab2(0x1d6)])?_0x43ac1f[_0x2b3ab2(0x1d6)]:[];}export async function listPersonalRuntimeSkills(_0x96d748){const _0x1863cd=a43_0x4261,_0x5050fe=await apiRequest(_0x1863cd(0x210)+encodeURIComponent(_0x96d748));return Array[_0x1863cd(0x1ee)](_0x5050fe[_0x1863cd(0x1d6)])?_0x5050fe[_0x1863cd(0x1d6)]:[];}export async function listCompanyRuntimeSkills(_0x28b2a5){const _0x4aee68=a43_0x4261,_0x10de65=await apiRequest(_0x4aee68(0x1df)+encodeURIComponent(_0x28b2a5));return Array[_0x4aee68(0x1ee)](_0x10de65[_0x4aee68(0x1d6)])?_0x10de65['data']:[];}export async function createPersonalRuntimeSkill(_0x120474,_0x212ab9){const _0x1af6a7=a43_0x4261,_0x30bec5=await apiRequest('/client/skill/personal/create',{'method':_0x1af6a7(0x206),'body':{'appCode':_0x120474,..._0x212ab9}});return _0x30bec5[_0x1af6a7(0x1d6)];}export async function updatePersonalRuntimeSkill(_0x52514c,_0x5033dd,_0x7d100c){const _0x4f7443=a43_0x4261,_0x120b02=await apiRequest('/client/skill/personal/'+encodeURIComponent(_0x52514c)+_0x4f7443(0x203),{'method':_0x4f7443(0x206),'body':{'appCode':_0x5033dd,..._0x7d100c}});return _0x120b02[_0x4f7443(0x1d6)];}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a44_0x1af0(){const _0x1cb940=['map','8581962jsrUYd','3675920aNNIlD','504805sLGoxW','dbName','90098XYdsOI','dbId','get','entries','find','7277120gfhucr','2221528rZGMLv','469344AhbvLh','set','9FmFVSL','3jrQooS'];a44_0x1af0=function(){return _0x1cb940;};return a44_0x1af0();}(function(_0x32a5a1,_0x333213){const _0x40fc57=a44_0x4cf3,_0x284912=_0x32a5a1();while(!![]){try{const _0x5e1406=-parseInt(_0x40fc57(0x11f))/0x1+-parseInt(_0x40fc57(0x126))/0x2*(parseInt(_0x40fc57(0x119))/0x3)+parseInt(_0x40fc57(0x11c))/0x4+parseInt(_0x40fc57(0x124))/0x5+-parseInt(_0x40fc57(0x11b))/0x6+parseInt(_0x40fc57(0x11d))/0x7+-parseInt(_0x40fc57(0x125))/0x8*(-parseInt(_0x40fc57(0x128))/0x9);if(_0x5e1406===_0x333213)break;else _0x284912['push'](_0x284912['shift']());}catch(_0x240c3f){_0x284912['push'](_0x284912['shift']());}}}(a44_0x1af0,0xec999));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a44_0x4cf3(_0x3d0309,_0x2f0fd1){_0x3d0309=_0x3d0309-0x119;const _0x1af062=a44_0x1af0();let _0x4cf38e=_0x1af062[_0x3d0309];return _0x4cf38e;}export async function listDatabases(_0x3558){const _0xb91da3=a44_0x4cf3;if(cache['has'](_0x3558))return cache[_0xb91da3(0x121)](_0x3558);const _0x3c1adc=await listDatasets(_0x3558),_0x36f55d=new Map();for(const _0x49465b of _0x3c1adc){const _0x22fcc7=_0x49465b['dbtableConfig'];_0x22fcc7?.[_0xb91da3(0x120)]!=null&&_0x36f55d[_0xb91da3(0x127)](_0x22fcc7[_0xb91da3(0x120)],_0x22fcc7['dbName']??'db-'+_0x22fcc7['dbId']);}const _0x4ea5a0=[..._0x36f55d[_0xb91da3(0x122)]()][_0xb91da3(0x11a)](([_0x4671cd,_0x4e2a55])=>({'dbId':_0x4671cd,'dbName':_0x4e2a55}));return cache[_0xb91da3(0x127)](_0x3558,_0x4ea5a0),_0x4ea5a0;}export async function getDbName(_0x19c1c9,_0x1134a0){const _0xdc119d=a44_0x4cf3;try{const _0x2827d5=await listDatabases(_0x19c1c9);return _0x2827d5[_0xdc119d(0x123)](_0x320b2b=>_0x320b2b['dbId']===_0x1134a0)?.[_0xdc119d(0x11e)];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12ee0e,_0x23e532){const _0x44437c=a45_0x4f40,_0x19868b=_0x12ee0e();while(!![]){try{const _0x5c5f3e=parseInt(_0x44437c(0xd9))/0x1+parseInt(_0x44437c(0xca))/0x2+parseInt(_0x44437c(0xd0))/0x3*(-parseInt(_0x44437c(0xcb))/0x4)+parseInt(_0x44437c(0xd7))/0x5*(parseInt(_0x44437c(0xdb))/0x6)+parseInt(_0x44437c(0xd3))/0x7+parseInt(_0x44437c(0xcd))/0x8+-parseInt(_0x44437c(0xdf))/0x9*(parseInt(_0x44437c(0xd1))/0xa);if(_0x5c5f3e===_0x23e532)break;else _0x19868b['push'](_0x19868b['shift']());}catch(_0x2b5780){_0x19868b['push'](_0x19868b['shift']());}}}(a45_0x2ef3,0x3b4da));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';let _client;export function initSdkClient(_0x277802){const _0xba0486=a45_0x4f40;_client=createClient({'appCode':_0x277802[_0xba0486(0xce)],'env':_0x277802['env'],'authMode':_0x277802[_0xba0486(0xdd)],..._0x277802['accessKey']?{'accessKey':_0x277802['accessKey']}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource']}}});}function a45_0x2ef3(){const _0x73fb5b=['batchCreate','1731736YVAyzx','appCode','SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.','3wmCvaD','20GhPYmR','isArray','2618798RDWlNP','bff','dataset_','\x22.\x20','5cfrytG','models','416830FpqKFC','update','439854WzOFPo','sql','authMode','execute','2642859RcBYvr','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27','delete','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22','435162lsJThc','1872372CXYUPo'];a45_0x2ef3=function(){return _0x73fb5b;};return a45_0x2ef3();}function ensureClient(){const _0x1debf=a45_0x4f40;if(!_client)throw new Error(_0x1debf(0xcf));return _client;}export async function executeData(_0x6c1e4d,_0x512cce,_0x3857ad){const _0x4002f4=a45_0x4f40,_0x3dd72d=ensureClient(),_0xd5f4c4=_0x4002f4(0xd5)+_0x6c1e4d,_0x562d3d=_0x3dd72d[_0x4002f4(0xd8)][_0xd5f4c4];if(!_0x562d3d||typeof _0x562d3d[_0x512cce]!=='function')throw new Error(_0x4002f4(0xe3)+_0x512cce+_0x4002f4(0xd6)+'Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.');if(_0x512cce===_0x4002f4(0xcc))return _0x562d3d[_0x4002f4(0xcc)](parseBatchCreateItemsFromParams(_0x3857ad));const _0x392fe3=_0x3857ad!==undefined&&_0x3857ad!==null&&!Array[_0x4002f4(0xd2)](_0x3857ad)?_0x3857ad:{};switch(_0x512cce){case'getOne':{const _0x2546b1=_0x392fe3['id'];if(_0x2546b1===undefined||_0x2546b1===null)throw new Error(_0x4002f4(0xe2));return _0x562d3d['getOne'](_0x2546b1);}case _0x4002f4(0xda):{const {id:_0x42d9e4,..._0x5255b5}=_0x392fe3;if(_0x42d9e4===undefined||_0x42d9e4===null)throw new Error(_0x4002f4(0xe0));return _0x562d3d[_0x4002f4(0xda)](_0x42d9e4,_0x5255b5);}case'delete':{const _0x34bd90=_0x392fe3['id'];if(_0x34bd90===undefined||_0x34bd90===null)throw new Error('delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27');return _0x562d3d[_0x4002f4(0xe1)](_0x34bd90);}default:return _0x562d3d[_0x512cce](_0x392fe3);}}export async function executeSdkSql(_0x156dab,_0x302ffe){const _0x48e787=a45_0x4f40,_0x265ea9=ensureClient();return _0x265ea9[_0x48e787(0xdc)]['execute']({'sqlCode':_0x156dab,'params':_0x302ffe});}function a45_0x4f40(_0x33c860,_0x4575dd){_0x33c860=_0x33c860-0xca;const _0x2ef324=a45_0x2ef3();let _0x4f40fd=_0x2ef324[_0x33c860];return _0x4f40fd;}export async function executeSdkBff(_0xe4e0ac,_0x2a0676){const _0x4f4bd5=a45_0x4f40,_0x538204=ensureClient();return _0x538204[_0x4f4bd5(0xd4)][_0x4f4bd5(0xde)]({'scriptName':_0xe4e0ac,'params':_0x2a0676});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x4efc8b=a46_0x1c32;(function(_0x3e9a82,_0x5a2418){const _0x2a6f74=a46_0x1c32,_0x10a342=_0x3e9a82();while(!![]){try{const _0x44a12c=parseInt(_0x2a6f74(0x1fb))/0x1*(-parseInt(_0x2a6f74(0x1f8))/0x2)+-parseInt(_0x2a6f74(0x1f2))/0x3+-parseInt(_0x2a6f74(0x1f5))/0x4+-parseInt(_0x2a6f74(0x1fa))/0x5+parseInt(_0x2a6f74(0x1fc))/0x6+parseInt(_0x2a6f74(0x1f6))/0x7*(-parseInt(_0x2a6f74(0x1fd))/0x8)+parseInt(_0x2a6f74(0x1f9))/0x9*(parseInt(_0x2a6f74(0x1f7))/0xa);if(_0x44a12c===_0x5a2418)break;else _0x10a342['push'](_0x10a342['shift']());}catch(_0x628b03){_0x10a342['push'](_0x10a342['shift']());}}}(a46_0x4911,0x8dfd0));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';export{CliError};function a46_0x1c32(_0x496c28,_0x32e70b){_0x496c28=_0x496c28-0x1f2;const _0x491130=a46_0x4911();let _0x1c325b=_0x491130[_0x496c28];return _0x1c325b;}function a46_0x4911(){const _0x4c1db2=['4581816cBzoOA','1408OXmHdG','\x20auth\x20login`.','1540104dTeHwI','Configure\x20accessKey\x20in\x20','newConfigFileName','989176DlCnBm','39585tbkJqb','76870ESbEkU','6NuEZAV','3429xVzmvX','2447070STLjkz','288481jkoDcK'];a46_0x4911=function(){return _0x4c1db2;};return a46_0x4911();}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a46_0x4efc8b(0x1f3)+PRODUCT_CONFIG[a46_0x4efc8b(0x1f4)]+'\x20or\x20run\x20`'+CLI_BIN_NAME+a46_0x4efc8b(0x1fe),'configMissingHint':'Set\x20appcode\x20via\x20--appcode\x20or\x20'+PRODUCT_CONFIG['newConfigFileName']+'.','notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20'+PRODUCT_CONFIG[a46_0x4efc8b(0x1f4)]+'\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x477d5e,_0x4b7b04){var _0x406a52=a47_0x426a,_0x4e6c12=_0x477d5e();while(!![]){try{var _0x45305b=-parseInt(_0x406a52(0xaf))/0x1*(parseInt(_0x406a52(0xa8))/0x2)+-parseInt(_0x406a52(0xad))/0x3*(-parseInt(_0x406a52(0xac))/0x4)+parseInt(_0x406a52(0xaa))/0x5*(-parseInt(_0x406a52(0xae))/0x6)+parseInt(_0x406a52(0xa9))/0x7+-parseInt(_0x406a52(0xa7))/0x8+-parseInt(_0x406a52(0xab))/0x9+parseInt(_0x406a52(0xb0))/0xa;if(_0x45305b===_0x4b7b04)break;else _0x4e6c12['push'](_0x4e6c12['shift']());}catch(_0xb6726e){_0x4e6c12['push'](_0x4e6c12['shift']());}}}(a47_0x13c5,0x72bef));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a47_0x426a(_0x6a3cf2,_0x469167){_0x6a3cf2=_0x6a3cf2-0xa7;var _0x13c512=a47_0x13c5();var _0x426a74=_0x13c512[_0x6a3cf2];return _0x426a74;}import{buildAllFlags as a47_0x5c6b26}from'@lovrabet/cli-framework';export function buildAllFlags(_0x34971d){return a47_0x5c6b26(_0x34971d,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}function a47_0x13c5(){var _0x4af29e=['8441568EfrCbJ','124fJdAkb','50430DUudSo','4133424txuPXS','16LwfJkZ','16978770pmxpME','2346008zljBCZ','60530ClRzFY','4587513zNIJjS','5IblsTz'];a47_0x13c5=function(){return _0x4af29e;};return a47_0x13c5();}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3ed414,_0x571162){const _0x1d6a88=a48_0xb5be,_0x1adc70=_0x3ed414();while(!![]){try{const _0x3d5396=-parseInt(_0x1d6a88(0x1e9))/0x1+-parseInt(_0x1d6a88(0x1e4))/0x2+parseInt(_0x1d6a88(0x1e6))/0x3*(parseInt(_0x1d6a88(0x1eb))/0x4)+parseInt(_0x1d6a88(0x1de))/0x5*(parseInt(_0x1d6a88(0x1e1))/0x6)+-parseInt(_0x1d6a88(0x1e2))/0x7*(parseInt(_0x1d6a88(0x1e0))/0x8)+-parseInt(_0x1d6a88(0x1e3))/0x9*(-parseInt(_0x1d6a88(0x1e5))/0xa)+parseInt(_0x1d6a88(0x1ea))/0xb*(-parseInt(_0x1d6a88(0x1e8))/0xc);if(_0x3d5396===_0x571162)break;else _0x1adc70['push'](_0x1adc70['shift']());}catch(_0x1d5e6d){_0x1adc70['push'](_0x1adc70['shift']());}}}(a48_0x17e8,0xcbcbe));function a48_0xb5be(_0x593481,_0x449fbf){_0x593481=_0x593481-0x1de;const _0x17e83e=a48_0x17e8();let _0xb5be20=_0x17e83e[_0x593481];return _0xb5be20;}export function dryRun(_0x9d1b8a,_0xde59c){const _0x5f4d2f={'method':_0x9d1b8a,'url':_0xde59c},_0x4efad0={'body'(_0xab9ab8){const _0x1813a0=a48_0xb5be;return _0x5f4d2f[_0x1813a0(0x1e7)]=_0xab9ab8,_0x4efad0;},'description'(_0x4fd5d1){const _0x2050ad=a48_0xb5be;return _0x5f4d2f[_0x2050ad(0x1df)]=_0x4fd5d1,_0x4efad0;},'build'(){return{..._0x5f4d2f};}};return _0x4efad0;}function a48_0x17e8(){const _0x54a916=['1723504LRfrbd','12170hSPGZn','9RKMJjx','body','2756820jAvpwp','29788cdumpR','22GIpInO','463052jTxuyC','5ykEbSX','description','607832NpRbXb','9822990uxjbdJ','42YctUqS','4860YAywIx'];a48_0x17e8=function(){return _0x54a916;};return a48_0x17e8();}
|