@lovrabet/lovrabet-cli 2.0.11 → 2.0.13-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 -1
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a28_0x245b(_0x5de3ee,_0x47df7a){_0x5de3ee=_0x5de3ee-0xa3;const _0x400283=a28_0x4002();let _0x245b5a=_0x400283[_0x5de3ee];return _0x245b5a;}const a28_0x25f3bb=a28_0x245b;(function(_0x828269,_0x512dd4){const _0x3eda4e=a28_0x245b,_0x469736=_0x828269();while(!![]){try{const _0x190c4e=-parseInt(_0x3eda4e(0xa9))/0x1+-parseInt(_0x3eda4e(0xb3))/0x2+-parseInt(_0x3eda4e(0xaa))/0x3+parseInt(_0x3eda4e(0xa8))/0x4+-parseInt(_0x3eda4e(0xae))/0x5+parseInt(_0x3eda4e(0xb0))/0x6*(parseInt(_0x3eda4e(0xa7))/0x7)+parseInt(_0x3eda4e(0xb1))/0x8;if(_0x190c4e===_0x512dd4)break;else _0x469736['push'](_0x469736['shift']());}catch(_0x33b194){_0x469736['push'](_0x469736['shift']());}}}(a28_0x4002,0x857c4));import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a28_0x4002(){const _0x82046=['16991264McAJfd','execError','952948LJpzQM','execSuccess','SQL\x20execution\x20failed','length','params','read','\x20row(s)\x20in\x20','now','sqlcode','120358TielXF','233840aelXfP','825185lqcrCt','2478300KSvfwV','str','execResult','isArray','2525525rjKPpb','Returned\x20','348XMQBQA'];a28_0x4002=function(){return _0x82046;};return a28_0x4002();}export const sqlExec={'service':'sql','command':'exec','description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a28_0x25f3bb(0xa3),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x5df024){const _0x338faf=a28_0x25f3bb,_0x3e08fe=parseJsonParams(_0x5df024['str'](_0x338faf(0xb7))),_0x2197c4=Date[_0x338faf(0xa5)](),_0x43b889=await executeSdkSql(_0x5df024[_0x338faf(0xab)](_0x338faf(0xa6)),_0x3e08fe),_0x10f3e1=Date['now']()-_0x2197c4,_0xb97b53=_0x43b889?.[_0x338faf(0xac)]??_0x43b889,_0x239978=_0x43b889?.[_0x338faf(0xb4)]??!![];if(!_0x239978)return{'ok':![],'data':{'error':_0x43b889?.[_0x338faf(0xb2)]||_0x338faf(0xb5),'elapsed':_0x10f3e1},'message':'SQL\x20execution\x20failed'};const _0x4dde5e=Array[_0x338faf(0xad)](_0xb97b53)?_0xb97b53:[];return{'ok':!![],'data':{'rows':_0x4dde5e,'rowCount':_0x4dde5e[_0x338faf(0xb6)],'elapsed':_0x10f3e1},'message':_0x338faf(0xaf)+_0x4dde5e[_0x338faf(0xb6)]+_0x338faf(0xa4)+_0x10f3e1+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a29_0x292c(){const _0x1da36e=['1644HaJYxh','5749626Tqxdvs','1118KjkvQM','3941295qsekLn','999524MzeRZl','4819448DnHPqh','42348sJTPBe','5756548GCgBNE'];a29_0x292c=function(){return _0x1da36e;};return a29_0x292c();}function a29_0x3653(_0x2231d6,_0x507a14){_0x2231d6=_0x2231d6-0x100;const _0x292ccf=a29_0x292c();let _0x36534b=_0x292ccf[_0x2231d6];return _0x36534b;}(function(_0x42f63d,_0x3c59eb){const _0xedde0=a29_0x3653,_0x1914fa=_0x42f63d();while(!![]){try{const _0x171398=-parseInt(_0xedde0(0x103))/0x1+-parseInt(_0xedde0(0x101))/0x2*(-parseInt(_0xedde0(0x107))/0x3)+parseInt(_0xedde0(0x105))/0x4+parseInt(_0xedde0(0x102))/0x5+-parseInt(_0xedde0(0x100))/0x6+parseInt(_0xedde0(0x106))/0x7+parseInt(_0xedde0(0x104))/0x8;if(_0x171398===_0x3c59eb)break;else _0x1914fa['push'](_0x1914fa['shift']());}catch(_0x3c9bd9){_0x1914fa['push'](_0x1914fa['shift']());}}}(a29_0x292c,0x8bb12));import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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};
|
|
1
|
+
const a30_0x5ad25e=a30_0x2406;(function(_0x171c04,_0xb05fa8){const _0x501ddd=a30_0x2406,_0x1900b9=_0x171c04();while(!![]){try{const _0xcd0d71=parseInt(_0x501ddd(0x149))/0x1*(-parseInt(_0x501ddd(0x151))/0x2)+parseInt(_0x501ddd(0x131))/0x3+parseInt(_0x501ddd(0x126))/0x4*(parseInt(_0x501ddd(0x14d))/0x5)+-parseInt(_0x501ddd(0x11b))/0x6+parseInt(_0x501ddd(0x137))/0x7*(-parseInt(_0x501ddd(0x106))/0x8)+parseInt(_0x501ddd(0x10c))/0x9+-parseInt(_0x501ddd(0x150))/0xa*(parseInt(_0x501ddd(0x142))/0xb);if(_0xcd0d71===_0xb05fa8)break;else _0x1900b9['push'](_0x1900b9['shift']());}catch(_0x3e57a8){_0x1900b9['push'](_0x1900b9['shift']());}}}(a30_0x1e34,0x681c4));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';function a30_0x1e34(){const _0xd18898=['toString','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','stdout','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','126071wnDKjs','entries','patch','no-skills','43445mkLZVk','unknown','string','440KiqAst','4QnrAjR','/-/package/','install','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','write','=1).','Update\x20','skipped','filter','Current\x20version:\x20','Invalid\x20version:\x20','56kFRbzU','inherit','major','\x20version\x20from\x20npm.','Unable\x20to\x20resolve\x20','minor','4787343WnjQvr','timeout','\x20CLI\x20from\x20npm','bool','map','object','Refresh\x20official\x20skill\x20package\x20after\x20updating','error','match','beta','/dist-tags','pipe','Updating\x20','\x20\x20Skipped\x20skill\x20install\x20(','exit\x20','1881726NHvZkU','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','cwd','Version\x20comparison\x20failed.','status','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','args','nonInteractive','Already\x20on\x20requested\x20version\x20(v','join','trim','328oVGuNQ','flag','warn','skills','\x20->\x20','Updated\x20to\x20v','source','boolean','Already\x20up\x20to\x20date\x20(v','Checking\x20npm\x20dist-tags...','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','1924977ZugBbG','latest','run','update','Checking\x20official\x20skill\x20package...','\x20\x20Official\x20skill\x20update\x20failed:\x20','642117KYZkrz','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Install\x20a\x20specific\x20CLI\x20version','length','validation','version','prerelease','\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Skipping\x20official\x20skill\x20package\x20(--no-skills).','62942HcJgLo','log','stderr'];a30_0x1e34=function(){return _0xd18898;};return a30_0x1e34();}import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':'latest','type':a30_0x5ad25e(0x12d),'description':'Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','default':![]},{'name':a30_0x5ad25e(0x115),'type':'boolean','description':a30_0x5ad25e(0x148),'default':![]},{'name':a30_0x5ad25e(0x13c),'type':a30_0x5ad25e(0x14f),'description':a30_0x5ad25e(0x139)},{'name':a30_0x5ad25e(0x14c),'type':'boolean','description':a30_0x5ad25e(0x130),'default':![]},{'name':a30_0x5ad25e(0x129),'type':a30_0x5ad25e(0x12d),'description':a30_0x5ad25e(0x112),'default':!![],'hidden':!![]}];function parseSemver(_0x44d41b){const _0x4adb7c=a30_0x5ad25e,_0x413de4=_0x44d41b[_0x4adb7c(0x125)]()[_0x4adb7c(0x114)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x413de4)return null;return{'major':Number(_0x413de4[0x1]),'minor':Number(_0x413de4[0x2]),'patch':Number(_0x413de4[0x3]),'prerelease':_0x413de4[0x4]};}function compareSemver(_0x1f40ba,_0x51da22){const _0x18ef0d=a30_0x5ad25e,_0x398f02=parseSemver(_0x1f40ba),_0x1fd099=parseSemver(_0x51da22);if(!_0x398f02||!_0x1fd099)throw CliErrors['validation'](_0x18ef0d(0x11e),_0x18ef0d(0xfe));for(const _0x369abf of[_0x18ef0d(0x108),_0x18ef0d(0x10b),_0x18ef0d(0x14b)]){if(_0x398f02[_0x369abf]<_0x1fd099[_0x369abf])return-0x1;if(_0x398f02[_0x369abf]>_0x1fd099[_0x369abf])return 0x1;}if(!_0x398f02[_0x18ef0d(0x13d)]&&!_0x1fd099[_0x18ef0d(0x13d)])return 0x0;if(!_0x398f02['prerelease'])return 0x1;if(!_0x1fd099[_0x18ef0d(0x13d)])return-0x1;if(_0x398f02[_0x18ef0d(0x13d)]===_0x1fd099[_0x18ef0d(0x13d)])return 0x0;return _0x398f02[_0x18ef0d(0x13d)]<_0x1fd099[_0x18ef0d(0x13d)]?-0x1:0x1;}function a30_0x2406(_0x20a7d0,_0x155b94){_0x20a7d0=_0x20a7d0-0xfc;const _0x1e34bf=a30_0x1e34();let _0x2406a0=_0x1e34bf[_0x20a7d0];return _0x2406a0;}function getRequestedVersion(_0x4d2cfa){const _0x51f98f=a30_0x5ad25e,_0x16693f=_0x4d2cfa['str']('version')[_0x51f98f(0x125)]();if(_0x16693f)return _0x16693f;return String(_0x4d2cfa[_0x51f98f(0x121)]?.[0x0]??'')['trim']();}function shouldSkipOfficialSkill(_0x5b9ff5){const _0x6bd2c0=a30_0x5ad25e;return _0x5b9ff5[_0x6bd2c0(0x10f)]('no-skills')||_0x5b9ff5[_0x6bd2c0(0x127)](_0x6bd2c0(0x129))===![];}async function validateUpdateFlags(_0x391bc8){const _0x57df8b=a30_0x5ad25e,_0x3ca79e=getRequestedVersion(_0x391bc8),_0x132d18=[_0x391bc8[_0x57df8b(0x10f)](_0x57df8b(0x132))?_0x57df8b(0x132):'',_0x391bc8[_0x57df8b(0x10f)](_0x57df8b(0x115))?_0x57df8b(0x115):'',_0x3ca79e?_0x57df8b(0x13c):''][_0x57df8b(0x103)](Boolean);if(_0x132d18[_0x57df8b(0x13a)]>0x1)throw CliErrors['validation'](_0x57df8b(0x146),_0x57df8b(0x13f));if(_0x3ca79e&&!parseSemver(_0x3ca79e))throw CliErrors[_0x57df8b(0x13b)](_0x57df8b(0x105)+_0x3ca79e,_0x57df8b(0x138));}async function fetchNpmDistTags(){const _0x32090c=a30_0x5ad25e;try{const _0x52c05b=NPM_REGISTRY_BASE_URL+_0x32090c(0xfc)+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x32090c(0x116),_0x592f47=await fetch(_0x52c05b,{'signal':AbortSignal[_0x32090c(0x10d)](0x2710)});if(!_0x592f47['ok'])return null;const _0x371452=await _0x592f47['json']();if(!_0x371452||typeof _0x371452!==_0x32090c(0x111))return null;return Object['fromEntries'](Object[_0x32090c(0x14a)](_0x371452)[_0x32090c(0x103)](([,_0xdf398e])=>typeof _0xdf398e===_0x32090c(0x14f)&&_0xdf398e['trim']())[_0x32090c(0x110)](([_0x15d2e8,_0x31dc3b])=>[_0x15d2e8,String(_0x31dc3b)[_0x32090c(0x125)]()]));}catch{return null;}}async function resolveTargetVersion(_0x4fd090){const _0x13c2da=a30_0x5ad25e,_0x97a359=getRequestedVersion(_0x4fd090);if(_0x97a359)return{'version':_0x97a359,'source':_0x13c2da(0x13c)};const _0x355548=_0x4fd090[_0x13c2da(0x10f)](_0x13c2da(0x115))?_0x13c2da(0x115):_0x13c2da(0x132),_0x59df00=await fetchNpmDistTags(),_0xbf7d0b=_0x59df00?.[_0x355548];if(!_0xbf7d0b)return null;return{'version':_0xbf7d0b,'source':_0x355548};}function shouldInstallTarget(_0x5d333f,_0x3f4166){const _0x13f8d9=a30_0x5ad25e,_0x98f8c4=compareSemver(_0x5d333f,_0x3f4166[_0x13f8d9(0x13c)]);if(_0x3f4166[_0x13f8d9(0x12c)]===_0x13f8d9(0x13c))return _0x98f8c4!==0x0;return _0x98f8c4<0x0;}function installCliPackage(_0x3a9b02,_0x5d2d5e){const _0x3a7e5d=a30_0x5ad25e,_0x237452=resolveNpmBin('npm'),_0x3c276e=[_0x3a7e5d(0xfd),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x3a9b02];console[_0x3a7e5d(0x143)]('*\x20'+[_0x237452,..._0x3c276e][_0x3a7e5d(0x124)]('\x20'));const _0x82e56b=spawnSync(_0x237452,_0x3c276e,{'cwd':process['cwd'](),'stdio':_0x5d2d5e?_0x3a7e5d(0x117):_0x3a7e5d(0x107),'env':process.env,'shell':![]});if(_0x82e56b['status']===0x0)return{'ok':!![]};let _0x191784=_0x82e56b[_0x3a7e5d(0x113)]?.['message']||_0x3a7e5d(0x11a)+(_0x82e56b[_0x3a7e5d(0x11f)]??_0x3a7e5d(0x14e));if(_0x5d2d5e){const _0x4b8348=_0x82e56b[_0x3a7e5d(0x144)]?_0x82e56b[_0x3a7e5d(0x144)][_0x3a7e5d(0x145)]()[_0x3a7e5d(0x125)]():'',_0x2b24b7=_0x82e56b[_0x3a7e5d(0x147)]?_0x82e56b[_0x3a7e5d(0x147)][_0x3a7e5d(0x145)]()[_0x3a7e5d(0x125)]():'';if(_0x4b8348)_0x191784=_0x4b8348;else{if(_0x2b24b7)_0x191784=_0x2b24b7;}}return{'ok':![],'error':_0x191784};}async function installOfficialSkill(_0x544017){const _0x532a5f=a30_0x5ad25e;console[_0x532a5f(0x143)](_0x532a5f(0x135));const _0x4edafd=runNpxSkillsAddGlobal(process[_0x532a5f(0x11d)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x544017?_0x532a5f(0x117):_0x532a5f(0x107)});if(_0x4edafd[_0x532a5f(0x102)]){console['log'](_0x532a5f(0x119)+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x532a5f(0x100));return;}if(_0x4edafd['ok']){console[_0x532a5f(0x143)](_0x532a5f(0x11c));return;}console[_0x532a5f(0x128)](_0x532a5f(0x136)+(_0x4edafd['error']||_0x532a5f(0x14e))),console[_0x532a5f(0x143)](_0x532a5f(0x13e)+LOVRABET_SKILL_SOURCE+'\x20-g\x20-y');}async function execute(_0x14b2c4){const _0x4ef73a=a30_0x5ad25e;await validateUpdateFlags(_0x14b2c4);const _0x5b34b9=getCliVersion();console[_0x4ef73a(0x143)](_0x4ef73a(0x104)+_0x5b34b9),console['log'](_0x4ef73a(0x12f));const _0x17531c=await resolveTargetVersion(_0x14b2c4);if(!_0x17531c){const _0x5174a1=_0x14b2c4['bool'](_0x4ef73a(0x115))?_0x4ef73a(0x115):_0x4ef73a(0x132),_0x114e8c=_0x4ef73a(0x10a)+_0x5174a1+_0x4ef73a(0x109);return console[_0x4ef73a(0x128)](_0x114e8c),console[_0x4ef73a(0x143)](_0x4ef73a(0x140)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x5174a1),{'ok':![]};}if(!shouldInstallTarget(_0x5b34b9,_0x17531c)){const _0x45ec6b=_0x17531c['source']==='version'?_0x4ef73a(0x123)+_0x17531c[_0x4ef73a(0x13c)]+').':_0x4ef73a(0x12e)+_0x17531c[_0x4ef73a(0x13c)]+').';return console[_0x4ef73a(0x143)](_0x45ec6b),shouldSkipOfficialSkill(_0x14b2c4)?console['log'](_0x4ef73a(0x141)):await installOfficialSkill(_0x14b2c4[_0x4ef73a(0x122)]),{'ok':!![]};}console[_0x4ef73a(0x143)](_0x4ef73a(0x118)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x5b34b9+_0x4ef73a(0x12a)+_0x17531c['version']);const _0x1f4954=installCliPackage(_0x17531c[_0x4ef73a(0x13c)],_0x14b2c4[_0x4ef73a(0x122)]);if(!_0x1f4954['ok']){const _0x1dc7c4='Update\x20failed:\x20'+(_0x1f4954[_0x4ef73a(0x113)]||'unknown');return console[_0x4ef73a(0x113)](_0x1dc7c4),console[_0x4ef73a(0x143)]('\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x17531c[_0x4ef73a(0x13c)]),{'ok':![]};}return console[_0x4ef73a(0x143)](_0x4ef73a(0x12b)+_0x17531c[_0x4ef73a(0x13c)]+'.'),console[_0x4ef73a(0x143)](_0x4ef73a(0x120)),shouldSkipOfficialSkill(_0x14b2c4)?console[_0x4ef73a(0x143)](_0x4ef73a(0x141)):await installOfficialSkill(_0x14b2c4['nonInteractive']),{'ok':!![]};}export const updateDefinition={'service':a30_0x5ad25e(0x134),'command':a30_0x5ad25e(0x133),'description':a30_0x5ad25e(0x101)+CLI_BIN_NAME+a30_0x5ad25e(0x10e),'risk':a30_0x5ad25e(0xff),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a31_0xda9a1=a31_0x8621;(function(_0x249015,_0x8d1134){const _0x554ad4=a31_0x8621,_0x2c6c1d=_0x249015();while(!![]){try{const _0x34f9cb=parseInt(_0x554ad4(0xe5))/0x1*(parseInt(_0x554ad4(0xf8))/0x2)+parseInt(_0x554ad4(0xe1))/0x3*(parseInt(_0x554ad4(0xf3))/0x4)+-parseInt(_0x554ad4(0xde))/0x5*(-parseInt(_0x554ad4(0xf1))/0x6)+-parseInt(_0x554ad4(0xe8))/0x7*(-parseInt(_0x554ad4(0xe6))/0x8)+parseInt(_0x554ad4(0xec))/0x9*(-parseInt(_0x554ad4(0xe0))/0xa)+-parseInt(_0x554ad4(0xf0))/0xb+parseInt(_0x554ad4(0xe4))/0xc*(parseInt(_0x554ad4(0xe7))/0xd);if(_0x34f9cb===_0x8d1134)break;else _0x2c6c1d['push'](_0x2c6c1d['shift']());}catch(_0x390e3c){_0x2c6c1d['push'](_0x2c6c1d['shift']());}}}(a31_0x5056,0x2f95e));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';function a31_0x5056(){const _0x1e84e3=['50433MupUpP','Target\x20environment','format','60JPNKTE','151xVjfmn','16TxtIiS','1009567isRvEB','1173571BHPaNv','map','legacyCompatOnly','Access\x20key\x20(client-ak\x20auth)','42057EjFsnb','locale',';\x20local\x20alias:\x20apps.<alias>.appcode','Risk\x20level','3215729PNbYyR','102JXxPqE','entries','12EWuURY','has','Config\x20key.\x20Top-level:\x20','enumValues','fromEntries','460rPfqwb','Locale','cliSettableTopLevel','join','Override\x20user\x20domain','Override\x20API\x20domain','Default\x20output\x20format','Override\x20runtime\x20domain','3020WUyhPS','riskLevel','710tjgmNK'];a31_0x5056=function(){return _0x1e84e3;};return a31_0x5056();}import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':a31_0xda9a1(0xe2),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['env'],'importable':!![]},'format':{'description':a31_0xda9a1(0xdc),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0xda9a1(0xe3)],'importable':!![]},'pageSize':{'description':'Default\x20page\x20size','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a31_0xda9a1(0xdb),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a31_0xda9a1(0xda),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a31_0xda9a1(0xdd),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a31_0xda9a1(0xeb),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a31_0xda9a1(0xef),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0xda9a1(0xdf)],'importable':!![]},'locale':{'description':a31_0xda9a1(0xf9),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0xda9a1(0xed)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a31_0xda9a1(0xf2)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x53f5e7])=>_0x53f5e7[a31_0xda9a1(0xd8)])[a31_0xda9a1(0xe9)](([_0x3d2c3e])=>_0x3d2c3e));export const CONFIG_ENUM_VALUES=Object[a31_0xda9a1(0xf7)](Object[a31_0xda9a1(0xf2)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x2d4381])=>_0x2d4381[a31_0xda9a1(0xf6)])[a31_0xda9a1(0xe9)](([_0x89eaea,_0x2e536c])=>[_0x89eaea,[..._0x2e536c[a31_0xda9a1(0xf6)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object['entries'](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x41b321])=>_0x41b321['importable'])[a31_0xda9a1(0xe9)](([_0x190c6a])=>_0x190c6a);export function getConfigFieldSchema(_0x10bde7){return CONFIG_FIELD_SCHEMAS[_0x10bde7];}function a31_0x8621(_0x1f0065,_0x5f223f){_0x1f0065=_0x1f0065-0xd8;const _0x505603=a31_0x5056();let _0x86219a=_0x505603[_0x1f0065];return _0x86219a;}export function getConfigEnumValues(_0x4c2309){const _0x53873e=a31_0xda9a1;return getConfigFieldSchema(_0x4c2309)?.[_0x53873e(0xf6)];}export function getConfigDefaultValue(_0x58b751){return getConfigFieldSchema(_0x58b751)?.['defaultValue'];}export function isTopLevelConfigKey(_0x5f5811){const _0x5c0357=a31_0xda9a1;return TOP_LEVEL_CONFIG_KEYS[_0x5c0357(0xf4)](_0x5f5811);}export function isLegacyCompatConfigKey(_0x3d9bff){const _0x3b5ae3=a31_0xda9a1;return getConfigFieldSchema(_0x3d9bff)?.[_0x3b5ae3(0xea)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0xd48ebb){const _0x4a3a84=a31_0xda9a1;return[..._0xd48ebb][_0x4a3a84(0xd9)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x21eddb=a31_0xda9a1;return _0x21eddb(0xf5)+getTopLevelConfigKeySummary()+_0x21eddb(0xee);}export function buildAppProfileListFields(_0xf6a88b){return{'env':_0xf6a88b,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x324bf7,_0x3e8c65){const _0x125158=a32_0x519b,_0x1405f7=_0x324bf7();while(!![]){try{const _0x4ea42c=parseInt(_0x125158(0x90))/0x1+-parseInt(_0x125158(0x97))/0x2+-parseInt(_0x125158(0x8f))/0x3*(-parseInt(_0x125158(0x98))/0x4)+parseInt(_0x125158(0x92))/0x5+parseInt(_0x125158(0x93))/0x6*(-parseInt(_0x125158(0x95))/0x7)+parseInt(_0x125158(0x91))/0x8*(parseInt(_0x125158(0x96))/0x9)+-parseInt(_0x125158(0x94))/0xa;if(_0x4ea42c===_0x3e8c65)break;else _0x1405f7['push'](_0x1405f7['shift']());}catch(_0x28092d){_0x1405f7['push'](_0x1405f7['shift']());}}}(a32_0x1ff7,0x3d8cf));function a32_0x519b(_0x449dd6,_0x24f445){_0x449dd6=_0x449dd6-0x8f;const _0x1ff760=a32_0x1ff7();let _0x519b62=_0x1ff760[_0x449dd6];return _0x519b62;}export const AUTH_MODE={'ClientAk':'client-ak'};export function isAuthMode(_0x2ee00a){return _0x2ee00a===AUTH_MODE['ClientAk'];}function a32_0x1ff7(){const _0x294a25=['401003QOHwLR','228112aaGNQn','1507195ZaKweF','59862eVlTPQ','8219960shArAF','14TfeCOt','126UGdpwk','526476GJGAYw','4fWcxIU','766983nBxTga'];a32_0x1ff7=function(){return _0x294a25;};return a32_0x1ff7();}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0xf0fdb7=a33_0x48f6;(function(_0xada012,_0x201bd1){const _0x34e72e=a33_0x48f6,_0x597b38=_0xada012();while(!![]){try{const _0x3d8b2d=parseInt(_0x34e72e(0xdd))/0x1+-parseInt(_0x34e72e(0xed))/0x2+-parseInt(_0x34e72e(0xdb))/0x3+-parseInt(_0x34e72e(0xf6))/0x4+-parseInt(_0x34e72e(0xde))/0x5*(-parseInt(_0x34e72e(0xef))/0x6)+-parseInt(_0x34e72e(0xf2))/0x7*(parseInt(_0x34e72e(0xcf))/0x8)+parseInt(_0x34e72e(0xe8))/0x9*(parseInt(_0x34e72e(0xf4))/0xa);if(_0x3d8b2d===_0x201bd1)break;else _0x597b38['push'](_0x597b38['shift']());}catch(_0x351871){_0x597b38['push'](_0x597b38['shift']());}}}(a33_0x1f21,0x66a1c));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a33_0xf0fdb7(0xc9)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a33_0xf0fdb7(0xe9)];function a33_0x1f21(){const _0x397223=['app','non-interactive','params','env','map','production\x20|\x20development\x20|\x20daily','appcode','2131173BpUTdt','Use\x20global\x20config\x20scope','635789PJQjAm','13290nEjnqk','Force\x20non-interactive\x20mode\x20(CI)','yes','sqlcode','string','Name\x20filter','name','global','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','dryRun','50013BwjSmV','cliDisplayName','Select\x20app\x20profile\x20by\x20name','dry-run','type','217244tWwRbC','meowKey','1086EeaMzV','Clear\x20output','help','4558386RcSqdZ','<name>','2020tsghTO','format','1395240pCWGqw','Preview\x20operation\x20without\x20executing','Record\x20ID','JSON\x20params\x20for\x20execute\x20commands','cliBinName','Override\x20appcode','verbose','boolean','Show\x20help','<expr>','8uIeRRw','Alias\x20for\x20--non-interactive','SQL\x20query\x20code','clear','json\x20|\x20pretty\x20|\x20compress'];a33_0x1f21=function(){return _0x397223;};return a33_0x1f21();}export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;function a33_0x48f6(_0x446707,_0x405caf){_0x446707=_0x446707-0xc8;const _0x1f214e=a33_0x1f21();let _0x48f686=_0x1f214e[_0x446707];return _0x48f686;}export const GLOBAL_FLAGS=[{'name':a33_0xf0fdb7(0xda),'meowKey':'appcode','type':'string','description':a33_0xf0fdb7(0xca),'hint':'<code>'},{'name':a33_0xf0fdb7(0xd4),'meowKey':a33_0xf0fdb7(0xd4),'type':a33_0xf0fdb7(0xe2),'description':a33_0xf0fdb7(0xea),'hint':a33_0xf0fdb7(0xf3)},{'name':a33_0xf0fdb7(0xd7),'meowKey':a33_0xf0fdb7(0xd7),'type':a33_0xf0fdb7(0xe2),'description':'Environment','hint':a33_0xf0fdb7(0xd9)},{'name':a33_0xf0fdb7(0xf5),'meowKey':a33_0xf0fdb7(0xf5),'type':'string','description':'Output\x20format','hint':a33_0xf0fdb7(0xd3)},{'name':'jq','meowKey':'jq','type':a33_0xf0fdb7(0xe2),'description':a33_0xf0fdb7(0xe6),'hint':a33_0xf0fdb7(0xce)},{'name':a33_0xf0fdb7(0xeb),'meowKey':a33_0xf0fdb7(0xe7),'type':a33_0xf0fdb7(0xcc),'description':a33_0xf0fdb7(0xf7)},{'name':a33_0xf0fdb7(0xe0),'meowKey':'yes','type':a33_0xf0fdb7(0xcc),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a33_0xf0fdb7(0xd5),'meowKey':'nonInteractive','type':'boolean','description':a33_0xf0fdb7(0xdf)},{'name':a33_0xf0fdb7(0xe5),'meowKey':'global','type':a33_0xf0fdb7(0xcc),'description':a33_0xf0fdb7(0xdc)},{'name':'ci','meowKey':'ci','type':a33_0xf0fdb7(0xcc),'description':a33_0xf0fdb7(0xd0),'hidden':!![]},{'name':a33_0xf0fdb7(0xf1),'meowKey':'help','type':a33_0xf0fdb7(0xcc),'description':a33_0xf0fdb7(0xcd)},{'name':'id','meowKey':'id','type':'string','description':a33_0xf0fdb7(0xf8),'hidden':!![]},{'name':a33_0xf0fdb7(0xe4),'meowKey':a33_0xf0fdb7(0xe4),'type':a33_0xf0fdb7(0xe2),'description':a33_0xf0fdb7(0xe3),'hidden':!![]},{'name':'sqlcode','meowKey':a33_0xf0fdb7(0xe1),'type':a33_0xf0fdb7(0xe2),'description':a33_0xf0fdb7(0xd1),'hidden':!![]},{'name':a33_0xf0fdb7(0xd6),'meowKey':a33_0xf0fdb7(0xd6),'type':a33_0xf0fdb7(0xe2),'description':a33_0xf0fdb7(0xc8),'hidden':!![]},{'name':'verbose','meowKey':a33_0xf0fdb7(0xcb),'type':a33_0xf0fdb7(0xcc),'description':'Verbose\x20output','hidden':!![]},{'name':a33_0xf0fdb7(0xd2),'meowKey':a33_0xf0fdb7(0xd2),'type':a33_0xf0fdb7(0xcc),'description':a33_0xf0fdb7(0xf0),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a33_0xf0fdb7(0xda),a33_0xf0fdb7(0xd4),a33_0xf0fdb7(0xd7),'format','jq',a33_0xf0fdb7(0xeb),a33_0xf0fdb7(0xe0),a33_0xf0fdb7(0xd5),'ci']);export function buildMeowFlags(){const _0x44c1ff=a33_0xf0fdb7;return Object['fromEntries'](GLOBAL_FLAGS[_0x44c1ff(0xd8)](_0xe6fceb=>[_0xe6fceb[_0x44c1ff(0xee)],{'type':_0xe6fceb[_0x44c1ff(0xec)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x4879bd=a34_0x10bf;(function(_0x554ce4,_0x42396f){const _0x2702db=a34_0x10bf,_0x5cf3f2=_0x554ce4();while(!![]){try{const _0x106ac7=-parseInt(_0x2702db(0xdf))/0x1+parseInt(_0x2702db(0xdd))/0x2*(-parseInt(_0x2702db(0xe0))/0x3)+-parseInt(_0x2702db(0xd8))/0x4*(parseInt(_0x2702db(0xd6))/0x5)+parseInt(_0x2702db(0xd4))/0x6*(-parseInt(_0x2702db(0xdb))/0x7)+-parseInt(_0x2702db(0xd5))/0x8*(parseInt(_0x2702db(0xde))/0x9)+-parseInt(_0x2702db(0xd7))/0xa+parseInt(_0x2702db(0xd9))/0xb;if(_0x106ac7===_0x42396f)break;else _0x5cf3f2['push'](_0x5cf3f2['shift']());}catch(_0x32af24){_0x5cf3f2['push'](_0x5cf3f2['shift']());}}}(a34_0x1ed6,0xc2b28));function a34_0x10bf(_0x5d52a5,_0x4ba11b){_0x5d52a5=_0x5d52a5-0xd4;const _0x1ed6f0=a34_0x1ed6();let _0x10bf8d=_0x1ed6f0[_0x5d52a5];return _0x10bf8d;}function a34_0x1ed6(){const _0x3e1c70=['953226ZvRbZV','en-US','9684jRIKGZ','1040ItAaCN','5SyYlpS','739570wPiHkP','4366196fsUfwt','45740288Stxbje','main','1876ghhxOD','compress','2kwwCFv','39834LNRxgC','869548pYosal'];a34_0x1ed6=function(){return _0x3e1c70;};return a34_0x1ed6();}export const DEFAULT_APP_PROFILE_NAME=a34_0x4879bd(0xda);export const DEFAULT_CONFIG_VALUES={'env':'production','format':a34_0x4879bd(0xdc),'locale':a34_0x4879bd(0xe1),'riskLevel':'write'};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a34_0x4879bd(0xdc);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x49f2e6=a35_0x2e40;(function(_0x24f823,_0x316d2b){const _0x4499bc=a35_0x2e40,_0x3ec735=_0x24f823();while(!![]){try{const _0x17f73e=parseInt(_0x4499bc(0xd8))/0x1*(-parseInt(_0x4499bc(0xd9))/0x2)+parseInt(_0x4499bc(0xe1))/0x3*(parseInt(_0x4499bc(0xdc))/0x4)+parseInt(_0x4499bc(0xdf))/0x5*(-parseInt(_0x4499bc(0xe0))/0x6)+parseInt(_0x4499bc(0xde))/0x7*(-parseInt(_0x4499bc(0xd6))/0x8)+parseInt(_0x4499bc(0xda))/0x9+-parseInt(_0x4499bc(0xdd))/0xa+parseInt(_0x4499bc(0xd5))/0xb*(parseInt(_0x4499bc(0xe2))/0xc);if(_0x17f73e===_0x316d2b)break;else _0x3ec735['push'](_0x3ec735['shift']());}catch(_0x5149b6){_0x3ec735['push'](_0x3ec735['shift']());}}}(a35_0x51bf,0x820ed));function a35_0x51bf(){const _0x4bc1c8=['653412uAEAnF','npmRegistryBaseUrl','374LAjoeO','8OOKGhu','skillSource','25801zZSRfu','58lCMWIj','7337214DQqonS','npmPackageName','484OXMGXo','7631910DmWhCz','3599701kOSjDi','15eKJIpD','689268jRreqA','5862UAMvqd'];a35_0x51bf=function(){return _0x4bc1c8;};return a35_0x51bf();}function a35_0x2e40(_0x4ace9f,_0x46f1d9){_0x4ace9f=_0x4ace9f-0xd5;const _0x51bff4=a35_0x51bf();let _0x2e409d=_0x51bff4[_0x4ace9f];return _0x2e409d;}import{PRODUCT_CONFIG}from'../constant/product.js';export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a35_0x49f2e6(0xdb)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a35_0x49f2e6(0xd7)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a35_0x49f2e6(0xe3)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a36_0x30cef3=a36_0x2e99;(function(_0x22e38b,_0x510542){const _0x4f2619=a36_0x2e99,_0x582109=_0x22e38b();while(!![]){try{const _0x3b8483=-parseInt(_0x4f2619(0x1e3))/0x1+-parseInt(_0x4f2619(0x1e2))/0x2+-parseInt(_0x4f2619(0x1d7))/0x3+parseInt(_0x4f2619(0x1d6))/0x4*(parseInt(_0x4f2619(0x1dd))/0x5)+parseInt(_0x4f2619(0x1e5))/0x6+-parseInt(_0x4f2619(0x1e0))/0x7+parseInt(_0x4f2619(0x1de))/0x8;if(_0x3b8483===_0x510542)break;else _0x582109['push'](_0x582109['shift']());}catch(_0x1d7cd3){_0x582109['push'](_0x582109['shift']());}}}(a36_0x254e,0x45a44));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2d311e){const _0x5df28b=a36_0x2e99;customApiDomain=_0x2d311e?.[_0x5df28b(0x1e1)],customUserDomain=_0x2d311e?.[_0x5df28b(0x1df)],customRuntimeDomain=_0x2d311e?.[_0x5df28b(0x1d8)];}function a36_0x254e(){const _0x4a5ddd=['404342WpHeUe','355755CGPcPQ','runtime','283182otiJBp','domains','779836qUuusN','1398042FIjSxi','runtimeDomain','user','production','nonProduction','api','5VRiSvs','10592064vBsuqu','userDomain','1798804CyQERI','apiDomain'];a36_0x254e=function(){return _0x4a5ddd;};return a36_0x254e();}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1da)][a36_0x30cef3(0x1d9)]:PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1db)][a36_0x30cef3(0x1d9)]);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1da)][a36_0x30cef3(0x1dc)]:PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1db)][a36_0x30cef3(0x1dc)]);function a36_0x2e99(_0x37c59c,_0x506e9e){_0x37c59c=_0x37c59c-0x1d6;const _0x254e40=a36_0x254e();let _0x2e9950=_0x254e40[_0x37c59c];return _0x2e9950;}export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1da)][a36_0x30cef3(0x1e4)]:PRODUCT_CONFIG[a36_0x30cef3(0x1e6)][a36_0x30cef3(0x1db)][a36_0x30cef3(0x1e4)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x4c66da=a37_0x307a;(function(_0x4094a3,_0x2b3c78){const _0x5ccfad=a37_0x307a,_0x5a53d5=_0x4094a3();while(!![]){try{const _0x5c4606=-parseInt(_0x5ccfad(0x114))/0x1*(-parseInt(_0x5ccfad(0x109))/0x2)+-parseInt(_0x5ccfad(0x10e))/0x3+-parseInt(_0x5ccfad(0x10c))/0x4*(parseInt(_0x5ccfad(0x10f))/0x5)+parseInt(_0x5ccfad(0x113))/0x6*(-parseInt(_0x5ccfad(0x10a))/0x7)+parseInt(_0x5ccfad(0x10b))/0x8+-parseInt(_0x5ccfad(0x112))/0x9+parseInt(_0x5ccfad(0x116))/0xa;if(_0x5c4606===_0x2b3c78)break;else _0x5a53d5['push'](_0x5a53d5['shift']());}catch(_0x192d9d){_0x5a53d5['push'](_0x5a53d5['shift']());}}}(a37_0x9368,0x4a0f6));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=['production',a37_0x4c66da(0x111),a37_0x4c66da(0x110)];function a37_0x9368(){const _0x2ff2de=['100728cTzCSP','296509gThVbn','production','7252160mtfRBz','2LKyzbd','154KzwmAB','204304kbXnlv','44toZkRO','ENV','27207ZxDqzP','50395JFJuIu','daily','development','2291751OgUQeT'];a37_0x9368=function(){return _0x2ff2de;};return a37_0x9368();}export function normalizeEnv(_0x1ce951){return _0x1ce951==='online'?'production':_0x1ce951;}export function isProduction(_0x336398){const _0x2fe5c6=a37_0x4c66da;return normalizeEnv(_0x336398)===_0x2fe5c6(0x115);}export function isDaily(_0x3a0924){const _0x5f2092=a37_0x4c66da;return normalizeEnv(_0x3a0924)===_0x5f2092(0x110);}export function isDev(_0x17a74e){const _0x3da9df=normalizeEnv(_0x17a74e);return _0x3da9df==='development'||_0x3da9df==='dev';}let env=normalizeEnv(productEnv(a37_0x4c66da(0x10d))||a37_0x4c66da(0x115));function a37_0x307a(_0x4099fb,_0x17a009){_0x4099fb=_0x4099fb-0x109;const _0x936859=a37_0x9368();let _0x307a6c=_0x936859[_0x4099fb];return _0x307a6c;}export function getEnv(){return env;}export function initEnv(_0xd12384){env=normalizeEnv(_0xd12384);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x49eaf9=a38_0x1dc0;(function(_0x51d377,_0x1f9a27){const _0x1f7bb8=a38_0x1dc0,_0x1518ac=_0x51d377();while(!![]){try{const _0x2faa17=parseInt(_0x1f7bb8(0x147))/0x1*(parseInt(_0x1f7bb8(0x146))/0x2)+parseInt(_0x1f7bb8(0x141))/0x3+-parseInt(_0x1f7bb8(0x140))/0x4+parseInt(_0x1f7bb8(0x143))/0x5*(-parseInt(_0x1f7bb8(0x13f))/0x6)+-parseInt(_0x1f7bb8(0x145))/0x7+-parseInt(_0x1f7bb8(0x142))/0x8+parseInt(_0x1f7bb8(0x144))/0x9;if(_0x2faa17===_0x1f9a27)break;else _0x1518ac['push'](_0x1518ac['shift']());}catch(_0x1a556c){_0x1518ac['push'](_0x1518ac['shift']());}}}(a38_0x3628,0x229b6));function a38_0x1dc0(_0x307fda,_0x39d780){_0x307fda=_0x307fda-0x13f;const _0x362873=a38_0x3628();let _0x1dc07c=_0x362873[_0x307fda];return _0x1dc07c;}function a38_0x3628(){const _0x2a083d=['196467BYXDqX','509248zeeqVW','408940JLlgQU','5474862VsVSUr','1523977PiaeoA','329388OWXkHE','1qyagVh','compress','18oEIbAK','680080WOVwgm'];a38_0x3628=function(){return _0x2a083d;};return a38_0x3628();}export const OUTPUT_FORMAT_VALUES=['json','pretty',a38_0x49eaf9(0x148)];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x5e9a(_0x40cb7c,_0x4642a6){_0x40cb7c=_0x40cb7c-0x1d6;const _0x2db054=a39_0x2db0();let _0x5e9af6=_0x2db054[_0x40cb7c];return _0x5e9af6;}const a39_0x101ca4=a39_0x5e9a;(function(_0x1275e0,_0x262a48){const _0x35d713=a39_0x5e9a,_0x539769=_0x1275e0();while(!![]){try{const _0x2b1172=-parseInt(_0x35d713(0x1e8))/0x1+parseInt(_0x35d713(0x1e9))/0x2*(parseInt(_0x35d713(0x1eb))/0x3)+-parseInt(_0x35d713(0x1e6))/0x4*(parseInt(_0x35d713(0x1ef))/0x5)+parseInt(_0x35d713(0x1df))/0x6+parseInt(_0x35d713(0x1e5))/0x7+parseInt(_0x35d713(0x1ec))/0x8*(-parseInt(_0x35d713(0x1de))/0x9)+parseInt(_0x35d713(0x1e3))/0xa*(parseInt(_0x35d713(0x1f2))/0xb);if(_0x2b1172===_0x262a48)break;else _0x539769['push'](_0x539769['shift']());}catch(_0x489bad){_0x539769['push'](_0x539769['shift']());}}}(a39_0x2db0,0x53642));export const PRODUCT_CONFIG={'cliBinName':'lovrabet','cliDisplayName':a39_0x101ca4(0x1d8),'npmPackageName':a39_0x101ca4(0x1d6),'skillSource':'lovrabet/lovrabet-cli','npmRegistryBaseUrl':a39_0x101ca4(0x1ea),'envPrefix':a39_0x101ca4(0x1f0),'legacyEnvPrefixes':[a39_0x101ca4(0x1db)],'configFileNames':['.lovrabet.json',a39_0x101ca4(0x1e7)],'newConfigFileName':'.lovrabet.json','homeDirName':a39_0x101ca4(0x1f1),'logFileName':a39_0x101ca4(0x1e0),'invokeSource':a39_0x101ca4(0x1f4),'userCenterDisplayName':a39_0x101ca4(0x1e1),'skipNpxSkillsEnvSuffix':a39_0x101ca4(0x1da),'domains':{'production':{'user':a39_0x101ca4(0x1ee),'api':a39_0x101ca4(0x1ed),'runtime':a39_0x101ca4(0x1e2)},'nonProduction':{'user':a39_0x101ca4(0x1d9),'api':a39_0x101ca4(0x1f3),'runtime':'https://daily-runtime.lovrabet.com'}},'accessKeyCreatePath':a39_0x101ca4(0x1dd)};function a39_0x2db0(){const _0x31b45f=['cli:lovrabet-runtime','@lovrabet/lovrabet-cli','envPrefix','Lovrabet\x20Runtime\x20CLI','https://user-daily.lovrabet.com','SKIP_NPX_SKILLS','RABETBASE','legacyEnvPrefixes','/user/ak','3977109wcopMM','1945116zZsQav','.lovrabet-runtime.log','Lovrabet\x20User\x20Center','https://runtime.lovrabet.com','23230ubAsHU','map','67907bCctXO','44smJFNT','.lovrabetrc','623427jEWUvt','30468zLnQdd','https://registry.npmjs.org','33qEvFyT','8aSNMBl','https://api.lovrabet.com','https://user.lovrabet.com','38255ApQbze','LOVRABET','.lovrabet','4686OSycAI','https://daily-api.lovrabet.com'];a39_0x2db0=function(){return _0x31b45f;};return a39_0x2db0();}export function productEnvName(_0x814a73){const _0x2eea29=a39_0x101ca4;return PRODUCT_CONFIG[_0x2eea29(0x1d7)]+'_'+_0x814a73;}export function productEnvNames(_0x338cb5){const _0x1e177a=a39_0x101ca4;return[productEnvName(_0x338cb5),...PRODUCT_CONFIG[_0x1e177a(0x1dc)][_0x1e177a(0x1e4)](_0x518217=>_0x518217+'_'+_0x338cb5)];}export function productEnv(_0x237ffd){for(const _0x5b3dda of productEnvNames(_0x237ffd)){const _0x171efb=process.env[_0x5b3dda];if(_0x171efb!==undefined)return _0x171efb;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a40_0x1308(_0x163c1f,_0xd5438){_0x163c1f=_0x163c1f-0x6c;const _0x17c2ed=a40_0x17c2();let _0x13082b=_0x17c2ed[_0x163c1f];return _0x13082b;}const a40_0x3a6b91=a40_0x1308;(function(_0xc18d87,_0x516137){const _0x464477=a40_0x1308,_0x159852=_0xc18d87();while(!![]){try{const _0x301094=-parseInt(_0x464477(0x74))/0x1*(-parseInt(_0x464477(0x76))/0x2)+parseInt(_0x464477(0x79))/0x3+parseInt(_0x464477(0x6e))/0x4*(parseInt(_0x464477(0x78))/0x5)+parseInt(_0x464477(0x73))/0x6+-parseInt(_0x464477(0x72))/0x7*(parseInt(_0x464477(0x6f))/0x8)+parseInt(_0x464477(0x75))/0x9*(-parseInt(_0x464477(0x6c))/0xa)+-parseInt(_0x464477(0x6d))/0xb;if(_0x301094===_0x516137)break;else _0x159852['push'](_0x159852['shift']());}catch(_0x4bd3c4){_0x159852['push'](_0x159852['shift']());}}}(a40_0x17c2,0xe5040));function a40_0x17c2(){const _0x4a8d8b=['8992356VYmKqu','2389UMVAdl','3303EZtuEy','998kvkMDs','read','18385xQXYCF','1704423SDxSDx','21130KfUPGo','22597366jwbDja','1980cFzNMY','56WjdUxf','write','high-risk-write','1311268bWArZF'];a40_0x17c2=function(){return _0x4a8d8b;};return a40_0x17c2();}export const RISK_LEVEL_VALUES=[a40_0x3a6b91(0x77),a40_0x3a6b91(0x70),a40_0x3a6b91(0x71)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a41_0x2364(){const _0x116fde=['1358966PipZKP','547498wvYhVw','user','domains','3897606sVSEVm','26566280GMfQvH','4wqnaHk','2339499DqsEMT','2086030qStjJn','1554072xrXkFn','accessKeyCreatePath','production'];a41_0x2364=function(){return _0x116fde;};return a41_0x2364();}function a41_0x2f5b(_0x31f1fe,_0x32179d){_0x31f1fe=_0x31f1fe-0x64;const _0x236411=a41_0x2364();let _0x2f5b11=_0x236411[_0x31f1fe];return _0x2f5b11;}const a41_0x11fdd9=a41_0x2f5b;(function(_0x54b005,_0x1e8ffb){const _0x449b7f=a41_0x2f5b,_0x1de19e=_0x54b005();while(!![]){try{const _0x247e1d=-parseInt(_0x449b7f(0x66))/0x1*(parseInt(_0x449b7f(0x6d))/0x2)+-parseInt(_0x449b7f(0x67))/0x3+parseInt(_0x449b7f(0x69))/0x4+-parseInt(_0x449b7f(0x68))/0x5+-parseInt(_0x449b7f(0x64))/0x6+-parseInt(_0x449b7f(0x6c))/0x7+parseInt(_0x449b7f(0x65))/0x8;if(_0x247e1d===_0x1e8ffb)break;else _0x1de19e['push'](_0x1de19e['shift']());}catch(_0x36216b){_0x1de19e['push'](_0x1de19e['shift']());}}}(a41_0x2364,0x8c059));import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a41_0x11fdd9(0x6f)][a41_0x11fdd9(0x6b)][a41_0x11fdd9(0x6e)]+PRODUCT_CONFIG[a41_0x11fdd9(0x6a)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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();}
|
|
1
|
+
const a42_0x216d9b=a42_0x5965;(function(_0x37286b,_0x81fc02){const _0x48895a=a42_0x5965,_0x519924=_0x37286b();while(!![]){try{const _0xd97465=parseInt(_0x48895a(0x19f))/0x1*(-parseInt(_0x48895a(0x18e))/0x2)+-parseInt(_0x48895a(0x1c5))/0x3+-parseInt(_0x48895a(0x1b0))/0x4*(parseInt(_0x48895a(0x1c6))/0x5)+-parseInt(_0x48895a(0x187))/0x6+-parseInt(_0x48895a(0x1ad))/0x7*(parseInt(_0x48895a(0x1d1))/0x8)+parseInt(_0x48895a(0x18f))/0x9*(parseInt(_0x48895a(0x1c2))/0xa)+parseInt(_0x48895a(0x1ae))/0xb;if(_0xd97465===_0x81fc02)break;else _0x519924['push'](_0x519924['shift']());}catch(_0x265e3){_0x519924['push'](_0x519924['shift']());}}}(a42_0x13b7,0x58eb5));function a42_0x13b7(){const _0x1bea7c=['global','ENV','EPERM','cache','values','runtimeDomain','cwd','nonInteractive','PAGE_SIZE','app','16EJjAFg','isTTY','authRequired','apiDomain','3560964LZRctM','accessKey','project','defaultApp','env','message','./constant/domain.js','94RUKqke','423SbATYl','format','APPCODE','parse','locale','find','production','explicit','slice','maxRisk','appcode','riskLevel','isRaw','true','error','EXDEV','579bekTDJ','trim','userDomain','join','read','raw','online','write','apps','string','high-risk-write','stdin','VERBOSE','newConfigFileName','1303771AaKaGU','19946850JcmOBq','ACCESS_KEY','28DFZkBE','missing','argv','utf8','APP','inherit','code','setRawCommand','setLogPath','projectConfig','FORMAT','development','stdout','configFileNames','some','daily','host','stringify','147310rTTcYe','object','setRawMode','1549845ZfbgAU','451190tJTCOy'];a42_0x13b7=function(){return _0x1bea7c;};return a42_0x13b7();}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';export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a42_0x216d9b(0x1bd)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0x216d9b(0x1ac)];function resolveConfigPath(_0x54f798){for(const _0x494794 of CONFIG_NAMES){const _0xfa42d7=resolve(_0x54f798,_0x494794);if(existsSync(_0xfa42d7))return _0xfa42d7;}return undefined;}export function resolveWriteConfigPath(_0xe44007){const _0x1b6919=a42_0x216d9b,_0x48ff30=_0xe44007===_0x1b6919(0x189)?process[_0x1b6919(0x1cd)]():homedir(),_0x3319df=resolveConfigPath(_0x48ff30);return _0x3319df??resolve(_0x48ff30,NEW_CONFIG_NAME);}export function readConfigFile(_0x223fa8){const _0x25a894=a42_0x216d9b;try{if(existsSync(_0x223fa8)){const _0x49426a=readFileSync(_0x223fa8,{'encoding':'utf8'});if(_0x49426a){const _0x52676b=JSON[_0x25a894(0x192)](_0x49426a);return migrateOnlineEnv(_0x223fa8,_0x52676b),_0x52676b;}}}catch{}return{};}function migrateOnlineEnv(_0x417684,_0x21991a){const _0x163074=a42_0x216d9b;let _0x381fbe=![];_0x21991a['env']===_0x163074(0x1a5)&&(_0x21991a[_0x163074(0x18b)]=_0x163074(0x195),_0x381fbe=!![]);if(_0x21991a[_0x163074(0x1a7)]&&typeof _0x21991a[_0x163074(0x1a7)]===_0x163074(0x1c3))for(const _0xc9298a of Object[_0x163074(0x1cb)](_0x21991a[_0x163074(0x1a7)])){_0xc9298a&&_0xc9298a['env']==='online'&&(_0xc9298a[_0x163074(0x18b)]=_0x163074(0x195),_0x381fbe=!![]);}if(_0x381fbe)try{writeConfigFile(_0x417684,_0x21991a);}catch{}}export function writeConfigFile(_0x69cb65,_0x5af6af){const _0x27314c=a42_0x216d9b,_0xb6e810=dirname(_0x69cb65);!existsSync(_0xb6e810)&&mkdirSync(_0xb6e810,{'recursive':!![]});const _0x57f358=_0x69cb65+'.tmp';try{writeFileSync(_0x57f358,JSON[_0x27314c(0x1c1)](_0x5af6af,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x57f358,_0x69cb65);}catch(_0x25071e){if(_0x25071e[_0x27314c(0x1b6)]===_0x27314c(0x1c9)||_0x25071e[_0x27314c(0x1b6)]===_0x27314c(0x19e)||_0x25071e[_0x27314c(0x1b6)]==='EACCES'){writeFileSync(_0x69cb65,JSON[_0x27314c(0x1c1)](_0x5af6af,null,0x2)+'\x0a',{'encoding':_0x27314c(0x1b3)});try{unlinkSync(_0x57f358);}catch{}}else throw _0x25071e;}}catch(_0x5c5556){try{unlinkSync(_0x57f358);}catch{}throw _0x5c5556;}}export function isNonInteractiveMode(_0x37c2c7){const _0x65b5bc=a42_0x216d9b;return!!(_0x37c2c7[_0x65b5bc(0x1ce)]||_0x37c2c7['ci']||productEnvNames('CI')[_0x65b5bc(0x1be)](_0x2e884f=>process.env[_0x2e884f]===_0x65b5bc(0x19c))||process.env.CI==='true'||!process[_0x65b5bc(0x1bc)]['isTTY']||!isStdinRawModeSupported());}function a42_0x5965(_0x622560,_0xeb4f21){_0x622560=_0x622560-0x184;const _0x13b79f=a42_0x13b7();let _0x5965d4=_0x13b79f[_0x622560];return _0x5965d4;}function isStdinRawModeSupported(){const _0x53969b=a42_0x216d9b;if(!process[_0x53969b(0x1aa)][_0x53969b(0x184)])return![];try{const _0x21b3b8=process[_0x53969b(0x1aa)][_0x53969b(0x19b)];return process[_0x53969b(0x1aa)][_0x53969b(0x1c4)](!![]),process[_0x53969b(0x1aa)]['setRawMode'](_0x21b3b8??![]),!![];}catch{return![];}}export async function createContext(_0x3d1d3d){const _0xefc348=a42_0x216d9b,_0x412613=readRawConfig(),_0x56026a=buildConfig(_0x412613,_0x3d1d3d);await initGlobalEnvironment(_0x56026a);const {getUserDomain:_0x318f23,getApiDomain:_0xd0b872}=await import(_0xefc348(0x18d)),_0x33ae7a={'apiDomain':_0xd0b872(),'userDomain':_0x318f23()},_0x291151=await buildAuth(_0x56026a);logger[_0xefc348(0x1b8)](process['cwd']());const _0x5cd955=(CLI_BIN_NAME+'\x20'+process[_0xefc348(0x1b2)][_0xefc348(0x197)](0x2)[_0xefc348(0x1a2)]('\x20'))[_0xefc348(0x1a0)]();logger[_0xefc348(0x1b7)](_0x5cd955);const _0x19f031=isNonInteractiveMode(_0x3d1d3d);return{'config':_0x56026a,'auth':_0x291151,'logger':logger,'env':_0x33ae7a,'nonInteractive':_0x19f031};}export function buildConfigFromFlags(_0x837ea5){return buildConfig(readRawConfig(),_0x837ea5);}export function getLocalAppAliases(_0x5f4a51){const _0x1f6e5b=a42_0x216d9b;return _0x5f4a51[_0x1f6e5b(0x1a7)]&&typeof _0x5f4a51[_0x1f6e5b(0x1a7)]===_0x1f6e5b(0x1c3)?_0x5f4a51[_0x1f6e5b(0x1a7)]:{};}export function resolveLocalAppAliasCode(_0x304574,_0x487997){const _0x337ce4=a42_0x216d9b;if(!_0x487997)return undefined;const _0x530fa6=getLocalAppAliases(_0x304574)[_0x487997],_0x16422b=_0x530fa6?.[_0x337ce4(0x199)];return typeof _0x16422b===_0x337ce4(0x1a8)&&_0x16422b['trim']()?_0x16422b[_0x337ce4(0x1a0)]():undefined;}export function readAppCodeFromConfig(){const _0x549806=a42_0x216d9b,_0x53dbae=readRawConfig(),_0x2584a8=_0x53dbae[_0x549806(0x199)]??_0x53dbae[_0x549806(0x1d0)];if(typeof _0x2584a8===_0x549806(0x1a8)&&_0x2584a8[_0x549806(0x1a0)]())return _0x2584a8[_0x549806(0x1a0)]();const _0x2ea61a=resolveLocalAppAliasCode(_0x53dbae,typeof _0x53dbae[_0x549806(0x18a)]===_0x549806(0x1a8)?_0x53dbae[_0x549806(0x18a)]:undefined);if(_0x2ea61a)return _0x2ea61a;const _0x2c8a11=normalizeEnv(String(_0x53dbae[_0x549806(0x18b)]||_0x549806(0x195))),_0x397963=isDaily(_0x2c8a11)?_0x549806(0x1bf):isDev(_0x2c8a11)?_0x549806(0x1bb):_0x549806(0x195),_0x275e32=resolveCachedAppCode(typeof _0x53dbae[_0x549806(0x18a)]===_0x549806(0x1a8)?_0x53dbae[_0x549806(0x18a)]:undefined,_0x397963,typeof _0x53dbae[_0x549806(0x188)]===_0x549806(0x1a8)?_0x53dbae['accessKey']:undefined);if(_0x275e32)return _0x275e32;const _0x1d1a93=Object[_0x549806(0x1cb)](getLocalAppAliases(_0x53dbae))[_0x549806(0x194)](_0x353406=>_0x353406?.[_0x549806(0x199)]);return typeof _0x1d1a93?.[_0x549806(0x199)]===_0x549806(0x1a8)&&_0x1d1a93[_0x549806(0x199)][_0x549806(0x1a0)]()?_0x1d1a93[_0x549806(0x199)]['trim']():undefined;}export function readScopedConfig(_0x24e204){const _0xd560f5=a42_0x216d9b,_0x3a266e=_0x24e204[_0xd560f5(0x1c7)]?_0xd560f5(0x1c7):_0xd560f5(0x189);return readConfigFile(resolveWriteConfigPath(_0x3a266e));}export function writeScopedConfig(_0x40a43c,_0x5cfb5a){const _0x1cb2b9=a42_0x216d9b,_0x4dfe08=_0x5cfb5a[_0x1cb2b9(0x1c7)]?'global':_0x1cb2b9(0x189);writeConfigFile(resolveWriteConfigPath(_0x4dfe08),_0x40a43c);}export async function initGlobalEnvironment(_0x53c3c2){const _0x22187c=a42_0x216d9b,{initEnv:_0x4e7a2b}=await import('./constant/env.js');_0x4e7a2b(_0x53c3c2[_0x22187c(0x18b)]);const {initDomains:_0xbfd78a}=await import(_0x22187c(0x18d));_0xbfd78a({'apiDomain':_0x53c3c2[_0x22187c(0x1a4)][_0x22187c(0x186)]||_0x53c3c2['raw'][_0x22187c(0x1c0)]||undefined,'userDomain':_0x53c3c2[_0x22187c(0x1a4)][_0x22187c(0x1a1)]||undefined,'runtimeDomain':_0x53c3c2[_0x22187c(0x1a4)][_0x22187c(0x1cc)]||undefined});}export function getProjectConfigPath(){const _0x50ef56=a42_0x216d9b;return resolveConfigPath(process[_0x50ef56(0x1cd)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x4df598){const _0x1d8a41=a42_0x216d9b;if(!existsSync(_0x4df598))return{'status':_0x1d8a41(0x1b1)};try{const _0x575ed8=readFileSync(_0x4df598,{'encoding':_0x1d8a41(0x1b3)});if(!_0x575ed8?.[_0x1d8a41(0x1a0)]())return{'status':'empty'};const _0x162ff7=JSON[_0x1d8a41(0x192)](_0x575ed8);return{'status':'ok','data':_0x162ff7};}catch(_0x55e527){return{'status':_0x1d8a41(0x19d),'message':_0x55e527 instanceof Error?_0x55e527[_0x1d8a41(0x18c)]:String(_0x55e527)};}}export function loadRawConfigLayers(_0x4f43f7){const _0x284dcf=a42_0x216d9b;let _0x2cf7c5={},_0x2c2258={},_0x2d0fa5,_0x15ccc7;try{_0x2d0fa5=resolveConfigPath(homedir());if(_0x2d0fa5){const _0x17b7fa=readFileSync(_0x2d0fa5,{'encoding':_0x284dcf(0x1b3)});if(_0x17b7fa)_0x2cf7c5=JSON['parse'](_0x17b7fa);}}catch{}try{const _0x8418ea=_0x4f43f7||process['cwd']();_0x15ccc7=resolveConfigPath(_0x8418ea);if(_0x15ccc7){const _0x114965=readFileSync(_0x15ccc7,{'encoding':_0x284dcf(0x1b3)});if(_0x114965)_0x2c2258=JSON['parse'](_0x114965);}}catch{}return{'globalPath':_0x2d0fa5,'projectPath':_0x15ccc7,'globalConfig':_0x2cf7c5,'projectConfig':_0x2c2258};}function mergeRawConfigLayers(_0x339677){const _0x58975d=a42_0x216d9b,{globalConfig:_0x451eba,projectConfig:_0x289d8e}=_0x339677;if(_0x289d8e[_0x58975d(0x1b5)]===![]){const _0x5cbb02={..._0x289d8e};return delete _0x5cbb02[_0x58975d(0x1b5)],_0x5cbb02;}const _0x5225d8={..._0x451eba,..._0x289d8e};if(_0x58975d(0x18a)in _0x289d8e)_0x5225d8[_0x58975d(0x18a)]=_0x289d8e[_0x58975d(0x18a)];else _0x451eba['defaultApp']&&(_0x5225d8[_0x58975d(0x18a)]=_0x451eba[_0x58975d(0x18a)]);return _0x5225d8;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x1bbbd9){return mergeRawConfigLayers(loadRawConfigLayers(_0x1bbbd9));}export function readRawConfigWithLayers(_0x48af0e){const _0x239347=loadRawConfigLayers(_0x48af0e);return{'config':mergeRawConfigLayers(_0x239347),'layers':_0x239347};}export function resolveDefaultAppSource(_0x510e28){const _0x4fda33=a42_0x216d9b;if(_0x4fda33(0x18a)in _0x510e28[_0x4fda33(0x1b9)])return _0x4fda33(0x189);if(_0x510e28[_0x4fda33(0x1b9)][_0x4fda33(0x1b5)]===![])return null;if(_0x510e28['globalConfig'][_0x4fda33(0x18a)])return _0x4fda33(0x1c7);return null;}function buildConfig(_0x23804f,_0x355c6b){const _0x1fbd5c=a42_0x216d9b,_0x25726c=_0x23804f['defaultApp']||undefined,_0x15ca22=_0x355c6b[_0x1fbd5c(0x1d0)]||env(_0x1fbd5c(0x1b4))||undefined,_0x20dda7=_0x15ca22||_0x25726c||undefined,_0x33e40f=env(_0x1fbd5c(0x1af))||_0x23804f[_0x1fbd5c(0x188)]||undefined,_0x3afbf0=_0x355c6b['env']||env(_0x1fbd5c(0x1c8))||_0x23804f[_0x1fbd5c(0x18b)]||DEFAULT_CONFIG_VALUES[_0x1fbd5c(0x18b)],_0xd13289=normalizeEnv(String(_0x3afbf0)),_0x3dfe1f=isDaily(_0xd13289)?'daily':isDev(_0xd13289)?_0x1fbd5c(0x1bb):_0x1fbd5c(0x195),_0x324d2f=resolveLocalAppAliasCode(_0x23804f,_0x20dda7),_0x2f97e2=resolveCachedAppCode(_0x20dda7,_0x3dfe1f,_0x33e40f),_0x54351f=typeof _0x355c6b[_0x1fbd5c(0x199)]===_0x1fbd5c(0x1a8)?_0x355c6b[_0x1fbd5c(0x199)]:undefined,_0x4b1006=env(_0x1fbd5c(0x191)),_0x59ce1a=_0x15ca22?undefined:_0x23804f[_0x1fbd5c(0x199)]||_0x23804f['app']||undefined,_0x392e92=_0x54351f||_0x4b1006||_0x324d2f||_0x2f97e2||_0x59ce1a||undefined,_0x129522=_0x54351f?_0x1fbd5c(0x196):_0x4b1006?_0x1fbd5c(0x18b):_0x324d2f?'local-alias':_0x2f97e2?_0x1fbd5c(0x1ca):_0x59ce1a?'top-level':undefined,_0x2af678=_0x23804f['locale']||DEFAULT_CONFIG_VALUES[_0x1fbd5c(0x193)],_0x1a5c90=undefined,_0x2c33db=_0x355c6b['format']||env(_0x1fbd5c(0x1ba))||_0x23804f[_0x1fbd5c(0x190)],_0x2dbb1a=normalizeLegacyOutputFormat(_0x2c33db),_0x29aab3=env(_0x1fbd5c(0x1cf))||_0x23804f['pageSize'],_0x5e8525=_0x29aab3?Number(_0x29aab3)||undefined:undefined,_0x4f4715=_0x23804f['riskLevel']||_0x23804f[_0x1fbd5c(0x198)],_0x296127=_0x4f4715===_0x1fbd5c(0x1a3)||_0x4f4715===_0x1fbd5c(0x1a6)||_0x4f4715===_0x1fbd5c(0x1a9)?_0x4f4715:DEFAULT_CONFIG_VALUES[_0x1fbd5c(0x19a)],_0x3d365c=env(_0x1fbd5c(0x1ab)),_0x2ef36c=_0x3d365c==='1'||_0x3d365c===_0x1fbd5c(0x19c);return{'appCode':typeof _0x392e92===_0x1fbd5c(0x1a8)&&_0x392e92[_0x1fbd5c(0x1a0)]()?_0x392e92[_0x1fbd5c(0x1a0)]():undefined,'appCodeSource':_0x129522,'env':_0x3dfe1f,'locale':_0x2af678,'cookie':_0x1a5c90,'accessKey':_0x33e40f,'format':_0x2dbb1a,'pageSize':_0x5e8525,'riskLevel':_0x296127,'verbose':_0x2ef36c,'defaultApp':_0x25726c,'currentApp':typeof _0x20dda7===_0x1fbd5c(0x1a8)?_0x20dda7:undefined,'raw':_0x23804f};}function env(_0x24cf8c){return productEnv(_0x24cf8c);}async function buildAuth(_0x535f5a){const _0x97d57c=a42_0x216d9b,_0x4e0f9a='',_0x34ed05=!!_0x535f5a[_0x97d57c(0x188)];return{'cookie':_0x4e0f9a,'isLoggedIn':_0x34ed05,async 'getOrLogin'(){const _0x7328c7=_0x97d57c;if(_0x34ed05)return _0x4e0f9a;throw CliErrors[_0x7328c7(0x185)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17afed,_0x2e072a){const _0x4d4139=a43_0x33f1,_0xf98a05=_0x17afed();while(!![]){try{const _0x89055c=parseInt(_0x4d4139(0xf3))/0x1+-parseInt(_0x4d4139(0x104))/0x2*(-parseInt(_0x4d4139(0xf5))/0x3)+-parseInt(_0x4d4139(0xd7))/0x4*(parseInt(_0x4d4139(0x108))/0x5)+parseInt(_0x4d4139(0xf7))/0x6+-parseInt(_0x4d4139(0xd1))/0x7+-parseInt(_0x4d4139(0xdc))/0x8+parseInt(_0x4d4139(0xed))/0x9*(parseInt(_0x4d4139(0xe9))/0xa);if(_0x89055c===_0x2e072a)break;else _0xf98a05['push'](_0xf98a05['shift']());}catch(_0x569112){_0xf98a05['push'](_0xf98a05['shift']());}}}(a43_0x1d13,0xf0808));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;function a43_0x1d13(){const _0x40636a=['stringify','BFF\x20script\x20not\x20found:\x20id=','json','apiError','data','status','223590jPvtgf','errorCode','authRequired','isArray','1314pkgVhO','message','tableData','errorMsg','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','string','76456ovfNuN','object','2223hJGYZw','signal','3825132USNeLw','appName','/client/sql/query','POST','/client/knowledge-base/personal/','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','?appCode=','sqlCode','filter','Request\x20timeout:\x20','/client/skill/company/list?appCode=','/client/skill/personal/','test','4618ERTNhv','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','validation','name','55zPomTz','10848985MdokSe','SQL\x20query\x20not\x20found:\x20','AbortError','Configure\x20accessKey\x20in\x20','/client/dataset/list','invokeSource','459444snjDzf','GET','/client/knowledge-base/personal/create','/client/user/loginUserInfo','code','15127512mODnMZ','/client/knowledge-base/personal/list?appCode=','/client/knowledge-base/search','API\x20error:\x20','abort','appCode','API\x20error\x20code:\x20'];a43_0x1d13=function(){return _0x40636a;};return a43_0x1d13();}export function setActiveAK(_0x315c47){_activeAK=_0x315c47||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x4047a4,_0x5a639c={}){const _0x499382=a43_0x33f1,{method:method=_0x499382(0xd8),body:_0x4639f9,headers:headers={},timeout:timeout=0x7530}=_0x5a639c,_0x15b711=_activeAK,_0x12b657=getRuntimeDomain();if(!_0x15b711)throw CliErrors[_0x499382(0xeb)](_0x499382(0xd4)+PRODUCT_CONFIG['newConfigFileName']+'.');const _0x1a6c9c=''+_0x12b657+_0x4047a4,_0x516be2={'X-User-AK':_0x15b711},_0x4fa6cd=new AbortController(),_0x1413a8=setTimeout(()=>_0x4fa6cd[_0x499382(0xe0)](),timeout);try{const _0x41861f=await fetch(_0x1a6c9c,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x499382(0xd6)],..._0x516be2,...headers},'body':_0x4639f9?JSON[_0x499382(0xe3)](_0x4639f9):undefined,'signal':_0x4fa6cd[_0x499382(0xf6)]});let _0x2d964b;try{_0x2d964b=await _0x41861f[_0x499382(0xe5)]();}catch{throw CliErrors[_0x499382(0xe6)](_0x499382(0x105)+_0x41861f[_0x499382(0xe8)]+')',_0x41861f[_0x499382(0xe8)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}if(!_0x41861f['ok']||_0x2d964b['success']===![])throw CliErrors[_0x499382(0xe6)](_0x2d964b[_0x499382(0xf0)]||_0x2d964b[_0x499382(0xee)]||_0x499382(0xdf)+_0x41861f[_0x499382(0xe8)],_0x2d964b[_0x499382(0xea)]?_0x499382(0xe2)+_0x2d964b[_0x499382(0xea)]:undefined);return _0x2d964b;}catch(_0x4c9921){if(_0x4c9921 instanceof Error&&_0x4c9921[_0x499382(0x107)]===_0x499382(0xd3))throw CliErrors[_0x499382(0xe6)](_0x499382(0x100)+_0x1a6c9c);throw _0x4c9921;}finally{clearTimeout(_0x1413a8);}}export async function getBffScriptInfo(_0x5133a6){const _0x1ac32e=a43_0x33f1,_0xa7fb44=await apiRequest('/client/bff/query/'+_0x5133a6);if(!_0xa7fb44[_0x1ac32e(0xe7)])throw CliErrors['validation'](_0x1ac32e(0xe4)+_0x5133a6);return _0xa7fb44[_0x1ac32e(0xe7)];}export async function getSqlQueryInfo(_0x1d11ea,_0x437573){const _0x5f039a=a43_0x33f1,_0x1b99a4=await apiRequest(_0x5f039a(0xf9),{'method':'POST','body':{'appCode':_0x1d11ea,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x437573}}),_0x247176=_0x1b99a4['data'],_0xb3b0e3=_0x247176&&typeof _0x247176===_0x5f039a(0xf4)&&_0x5f039a(0xef)in _0x247176?_0x247176[_0x5f039a(0xef)]?.[0x0]:_0x247176&&typeof _0x247176==='object'&&_0x5f039a(0xfe)in _0x247176?_0x247176:undefined;if(!_0xb3b0e3)throw CliErrors['validation'](_0x5f039a(0xd2)+_0x437573);return _0xb3b0e3;}function a43_0x33f1(_0x39b25e,_0x161bf1){_0x39b25e=_0x39b25e-0xd1;const _0x1d1319=a43_0x1d13();let _0x33f116=_0x1d1319[_0x39b25e];return _0x33f116;}function isRemoteAppItem(_0x4b1f46){const _0x10b1ef=a43_0x33f1;return!!_0x4b1f46&&typeof _0x4b1f46===_0x10b1ef(0xf4)&&typeof _0x4b1f46[_0x10b1ef(0xe1)]===_0x10b1ef(0xf2)&&typeof _0x4b1f46[_0x10b1ef(0xf8)]===_0x10b1ef(0xf2);}function extractRemoteAppItems(_0x11c3c8){const _0x22860a=a43_0x33f1;if(Array[_0x22860a(0xec)](_0x11c3c8))return _0x11c3c8[_0x22860a(0xff)](isRemoteAppItem);if(!_0x11c3c8||typeof _0x11c3c8!==_0x22860a(0xf4))throw CliErrors[_0x22860a(0xe6)](_0x22860a(0xf1));const _0x641b42=_0x11c3c8;if(Array[_0x22860a(0xec)](_0x641b42[_0x22860a(0xef)]))return _0x641b42[_0x22860a(0xef)]['filter'](isRemoteAppItem);if(_0x641b42['data']&&typeof _0x641b42[_0x22860a(0xe7)]===_0x22860a(0xf4)){const _0x105aad=_0x641b42[_0x22860a(0xe7)];if(Array['isArray'](_0x105aad['tableData']))return _0x105aad['tableData'][_0x22860a(0xff)](isRemoteAppItem);}throw CliErrors[_0x22860a(0xe6)](_0x22860a(0xfc));}export async function getMyApps(){const _0x5a0dd7=a43_0x33f1,_0x15ec33=await apiRequest('/client/app/my-apps');return extractRemoteAppItems(_0x15ec33[_0x5a0dd7(0xe7)]);}export async function getLoginUserInfo(){const _0x593d07=a43_0x33f1,_0x41c49f=await apiRequest(_0x593d07(0xda));if(!_0x41c49f[_0x593d07(0xe7)]||typeof _0x41c49f['data']!=='object'||Array[_0x593d07(0xec)](_0x41c49f[_0x593d07(0xe7)]))throw CliErrors[_0x593d07(0xe6)]('Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.');return _0x41c49f[_0x593d07(0xe7)];}export async function listDatasets(_0x1be8a2,_0x6fa702){const _0x5619f1=a43_0x33f1,_0x4a883d=await apiRequest(_0x5619f1(0xd5),{'method':_0x5619f1(0xfa),'body':{'appCode':_0x1be8a2,..._0x6fa702?.[_0x5619f1(0xdb)]&&{'code':_0x6fa702[_0x5619f1(0xdb)]},..._0x6fa702?.[_0x5619f1(0x107)]&&{'name':_0x6fa702['name']}}});return extractList(_0x4a883d[_0x5619f1(0xe7)]);}export async function getDatasetDetail(_0x439db0){const _0x4ad8c3=a43_0x33f1,_0x23006a=/^\d+$/[_0x4ad8c3(0x103)](_0x439db0)?'id':_0x4ad8c3(0xdb),_0x51f684=await apiRequest('/client/dataset/query?'+_0x23006a+'='+_0x439db0);return _0x51f684[_0x4ad8c3(0xe7)];}export async function listPersonalKnowledgeBaseItems(_0x399883){const _0x39bec0=a43_0x33f1,_0x5ae2d4=await apiRequest(_0x39bec0(0xdd)+encodeURIComponent(_0x399883));return Array[_0x39bec0(0xec)](_0x5ae2d4[_0x39bec0(0xe7)])?_0x5ae2d4[_0x39bec0(0xe7)]:[];}export async function getPersonalKnowledgeBaseItem(_0x37fdcc,_0x8d730f){const _0x44e107=a43_0x33f1,_0x3ad1f3=await apiRequest(_0x44e107(0xfb)+_0x37fdcc+_0x44e107(0xfd)+encodeURIComponent(_0x8d730f));if(!_0x3ad1f3['data'])throw CliErrors[_0x44e107(0x106)]('Knowledge-base\x20entry\x20not\x20found:\x20id='+_0x37fdcc);return _0x3ad1f3[_0x44e107(0xe7)];}export async function createPersonalKnowledgeBaseItem(_0x2fee17,_0x895618){const _0x309cc7=a43_0x33f1,_0x20bfe1=await apiRequest(_0x309cc7(0xd9),{'method':_0x309cc7(0xfa),'body':{'appCode':_0x2fee17,..._0x895618}});return _0x20bfe1[_0x309cc7(0xe7)];}export async function updatePersonalKnowledgeBaseItem(_0x1b0059,_0x361ba5,_0x339b14){const _0x39a4c2=await apiRequest('/client/knowledge-base/personal/'+_0x1b0059+'/update',{'method':'POST','body':{'appCode':_0x361ba5,..._0x339b14}});return _0x39a4c2['data'];}export async function searchKnowledgeBase(_0x19ca4e,_0xa14c23){const _0x2ef464=a43_0x33f1,_0xa64908=await apiRequest(_0x2ef464(0xde),{'method':_0x2ef464(0xfa),'body':{'appCode':_0x19ca4e,'query':_0xa14c23['query'],..._0xa14c23['topK']!==undefined?{'topK':_0xa14c23['topK']}:{}}});return Array[_0x2ef464(0xec)](_0xa64908[_0x2ef464(0xe7)])?_0xa64908['data']:[];}export async function listPersonalRuntimeSkills(_0x2be7a9){const _0x4fe8e9=a43_0x33f1,_0xc1e39f=await apiRequest('/client/skill/personal/list?appCode='+encodeURIComponent(_0x2be7a9));return Array[_0x4fe8e9(0xec)](_0xc1e39f[_0x4fe8e9(0xe7)])?_0xc1e39f['data']:[];}export async function listCompanyRuntimeSkills(_0x2b4879){const _0xd95b37=a43_0x33f1,_0x4e67ed=await apiRequest(_0xd95b37(0x101)+encodeURIComponent(_0x2b4879));return Array['isArray'](_0x4e67ed[_0xd95b37(0xe7)])?_0x4e67ed[_0xd95b37(0xe7)]:[];}export async function createPersonalRuntimeSkill(_0x4527f2,_0x40a7ef){const _0x4abea4=a43_0x33f1,_0x4bb651=await apiRequest('/client/skill/personal/create',{'method':_0x4abea4(0xfa),'body':{'appCode':_0x4527f2,..._0x40a7ef}});return _0x4bb651[_0x4abea4(0xe7)];}export async function updatePersonalRuntimeSkill(_0x40974e,_0x4d1dc7,_0x39f17a){const _0x24c0c1=a43_0x33f1,_0x10f09e=await apiRequest(_0x24c0c1(0x102)+encodeURIComponent(_0x40974e)+'/update',{'method':_0x24c0c1(0xfa),'body':{'appCode':_0x4d1dc7,..._0x39f17a}});return _0x10f09e[_0x24c0c1(0xe7)];}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x59934f,_0x598a83){const _0x2379de=a44_0x506e,_0x4a45b3=_0x59934f();while(!![]){try{const _0x1b97c4=-parseInt(_0x2379de(0x125))/0x1+parseInt(_0x2379de(0x131))/0x2+parseInt(_0x2379de(0x129))/0x3*(parseInt(_0x2379de(0x132))/0x4)+parseInt(_0x2379de(0x12b))/0x5*(parseInt(_0x2379de(0x12c))/0x6)+-parseInt(_0x2379de(0x134))/0x7+parseInt(_0x2379de(0x12a))/0x8+-parseInt(_0x2379de(0x135))/0x9*(parseInt(_0x2379de(0x12f))/0xa);if(_0x1b97c4===_0x598a83)break;else _0x4a45b3['push'](_0x4a45b3['shift']());}catch(_0x237b1f){_0x4a45b3['push'](_0x4a45b3['shift']());}}}(a44_0x9669,0x24bd6));import{listDatasets}from'../core/api-client.js';const cache=new Map();export async function listDatabases(_0x3304da){const _0xf3ccc5=a44_0x506e;if(cache[_0xf3ccc5(0x136)](_0x3304da))return cache[_0xf3ccc5(0x130)](_0x3304da);const _0x1ec54e=await listDatasets(_0x3304da),_0x33023a=new Map();for(const _0x3bc9f0 of _0x1ec54e){const _0x41c1e3=_0x3bc9f0[_0xf3ccc5(0x133)];_0x41c1e3?.[_0xf3ccc5(0x137)]!=null&&_0x33023a[_0xf3ccc5(0x12e)](_0x41c1e3['dbId'],_0x41c1e3[_0xf3ccc5(0x126)]??'db-'+_0x41c1e3[_0xf3ccc5(0x137)]);}const _0x2cd5cd=[..._0x33023a[_0xf3ccc5(0x127)]()][_0xf3ccc5(0x12d)](([_0x43b1f6,_0x2cdaca])=>({'dbId':_0x43b1f6,'dbName':_0x2cdaca}));return cache[_0xf3ccc5(0x12e)](_0x3304da,_0x2cd5cd),_0x2cd5cd;}function a44_0x9669(){const _0x43fd47=['6mzsWHD','map','set','383690seaWbR','get','298270VEeinP','4rOaklH','dbtableConfig','861567CLHTIf','9HhALZd','has','dbId','195463qaJcqJ','dbName','entries','find','573399OpqJyZ','789168IGXhpA','342425dNkLIE'];a44_0x9669=function(){return _0x43fd47;};return a44_0x9669();}function a44_0x506e(_0x89bdf6,_0x1accd7){_0x89bdf6=_0x89bdf6-0x125;const _0x96690a=a44_0x9669();let _0x506e36=_0x96690a[_0x89bdf6];return _0x506e36;}export async function getDbName(_0x43fb92,_0x5cf0f9){const _0x15fadf=a44_0x506e;try{const _0x535660=await listDatabases(_0x43fb92);return _0x535660[_0x15fadf(0x128)](_0x4c9410=>_0x4c9410[_0x15fadf(0x137)]===_0x5cf0f9)?.[_0x15fadf(0x126)];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3aa478,_0x119fd0){const _0x38000d=a45_0x358e,_0x2551c0=_0x3aa478();while(!![]){try{const _0x2bce64=-parseInt(_0x38000d(0xfe))/0x1+-parseInt(_0x38000d(0xfa))/0x2*(parseInt(_0x38000d(0x100))/0x3)+parseInt(_0x38000d(0xfc))/0x4*(-parseInt(_0x38000d(0x10c))/0x5)+-parseInt(_0x38000d(0x108))/0x6+-parseInt(_0x38000d(0xf9))/0x7+-parseInt(_0x38000d(0xf5))/0x8+parseInt(_0x38000d(0xfd))/0x9;if(_0x2bce64===_0x119fd0)break;else _0x2551c0['push'](_0x2551c0['shift']());}catch(_0xd31566){_0x2551c0['push'](_0x2551c0['shift']());}}}(a45_0x1803,0xc9915));function a45_0x1803(){const _0x17bbdc=['authMode','8207787kCTTIf','20FRqnpj','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','24ngOHta','45001062rVVVjX','9407tQRzZO','models','83859hHtSoW','getOne','SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22','bff','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27','execute','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','delete','5174280hxVgTp','dataset_','batchCreate','update','879105Ywvzsx','appCode','sql','accessKey','6365704ysxjPK','env','isArray'];a45_0x1803=function(){return _0x17bbdc;};return a45_0x1803();}import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';let _client;export function initSdkClient(_0x70fbca){const _0xa1ac17=a45_0x358e;_client=createClient({'appCode':_0x70fbca[_0xa1ac17(0x10d)],'env':_0x70fbca[_0xa1ac17(0xf6)],'authMode':_0x70fbca[_0xa1ac17(0xf8)],..._0x70fbca[_0xa1ac17(0xf4)]?{'accessKey':_0x70fbca['accessKey']}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG['invokeSource']}}});}function ensureClient(){if(!_client)throw new Error('SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.');return _client;}export async function executeData(_0xd27712,_0x16774a,_0x19da4f){const _0x29d11b=a45_0x358e,_0x30e819=ensureClient(),_0x519c63=_0x29d11b(0x109)+_0xd27712,_0x25c6ac=_0x30e819[_0x29d11b(0xff)][_0x519c63];if(!_0x25c6ac||typeof _0x25c6ac[_0x16774a]!=='function')throw new Error(_0x29d11b(0x102)+_0x16774a+'\x22.\x20'+'Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.');if(_0x16774a==='batchCreate')return _0x25c6ac[_0x29d11b(0x10a)](parseBatchCreateItemsFromParams(_0x19da4f));const _0xcc2ddd=_0x19da4f!==undefined&&_0x19da4f!==null&&!Array[_0x29d11b(0xf7)](_0x19da4f)?_0x19da4f:{};switch(_0x16774a){case _0x29d11b(0x101):{const _0x4a7763=_0xcc2ddd['id'];if(_0x4a7763===undefined||_0x4a7763===null)throw new Error(_0x29d11b(0x106));return _0x25c6ac[_0x29d11b(0x101)](_0x4a7763);}case _0x29d11b(0x10b):{const {id:_0x188d61,..._0x14f404}=_0xcc2ddd;if(_0x188d61===undefined||_0x188d61===null)throw new Error(_0x29d11b(0x104));return _0x25c6ac['update'](_0x188d61,_0x14f404);}case'delete':{const _0x441c1b=_0xcc2ddd['id'];if(_0x441c1b===undefined||_0x441c1b===null)throw new Error(_0x29d11b(0xfb));return _0x25c6ac[_0x29d11b(0x107)](_0x441c1b);}default:return _0x25c6ac[_0x16774a](_0xcc2ddd);}}function a45_0x358e(_0x1aee1f,_0x50cadc){_0x1aee1f=_0x1aee1f-0xf4;const _0x1803f1=a45_0x1803();let _0x358e18=_0x1803f1[_0x1aee1f];return _0x358e18;}export async function executeSdkSql(_0x2e7d75,_0x3a3656){const _0x1d599e=a45_0x358e,_0x30a2c4=ensureClient();return _0x30a2c4[_0x1d599e(0x10e)]['execute']({'sqlCode':_0x2e7d75,'params':_0x3a3656});}export async function executeSdkBff(_0x2792db,_0x37f289){const _0x338412=a45_0x358e,_0x2ef533=ensureClient();return _0x2ef533[_0x338412(0x103)][_0x338412(0x105)]({'scriptName':_0x2792db,'params':_0x37f289});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x16c2ef=a46_0x1d1d;function a46_0x1d1d(_0x5bce80,_0x6a4264){_0x5bce80=_0x5bce80-0x166;const _0x4da6d6=a46_0x4da6();let _0x1d1d3e=_0x4da6d6[_0x5bce80];return _0x1d1d3e;}(function(_0xfc1cbf,_0x4b2e01){const _0x32a448=a46_0x1d1d,_0x16a017=_0xfc1cbf();while(!![]){try{const _0x50eb2e=-parseInt(_0x32a448(0x172))/0x1*(-parseInt(_0x32a448(0x167))/0x2)+parseInt(_0x32a448(0x170))/0x3*(-parseInt(_0x32a448(0x169))/0x4)+-parseInt(_0x32a448(0x16d))/0x5*(-parseInt(_0x32a448(0x176))/0x6)+parseInt(_0x32a448(0x173))/0x7*(parseInt(_0x32a448(0x16e))/0x8)+parseInt(_0x32a448(0x171))/0x9*(-parseInt(_0x32a448(0x174))/0xa)+parseInt(_0x32a448(0x177))/0xb*(parseInt(_0x32a448(0x166))/0xc)+-parseInt(_0x32a448(0x16f))/0xd;if(_0x50eb2e===_0x4b2e01)break;else _0x16a017['push'](_0x16a017['shift']());}catch(_0x5e17d7){_0x16a017['push'](_0x16a017['shift']());}}}(a46_0x4da6,0xd9614));import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';function a46_0x4da6(){const _0x1de5a0=['6229535ybznec','6YvrSaT','9qbNeBF','2214cDOSjZ','114709iORMuW','2819810FjhqNp','Configure\x20accessKey\x20in\x20','738PIofyw','10239581iBHzSF','12LZGpUb','652eKJlnP','newConfigFileName','2472676MnJDoe','Set\x20appcode\x20via\x20--appcode\x20or\x20','\x20or\x20run\x20`','\x20auth\x20login`.','44885wjNetb','64qwpkuH'];a46_0x4da6=function(){return _0x1de5a0;};return a46_0x4da6();}export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a46_0x16c2ef(0x175)+PRODUCT_CONFIG['newConfigFileName']+a46_0x16c2ef(0x16b)+CLI_BIN_NAME+a46_0x16c2ef(0x16c),'configMissingHint':a46_0x16c2ef(0x16a)+PRODUCT_CONFIG[a46_0x16c2ef(0x168)]+'.','notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20'+PRODUCT_CONFIG[a46_0x16c2ef(0x168)]+'\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaabb8a,_0x3e1b0b){var _0x45b5ee=a47_0x32c5,_0x124c58=_0xaabb8a();while(!![]){try{var _0x1c10bc=-parseInt(_0x45b5ee(0x10f))/0x1+parseInt(_0x45b5ee(0x113))/0x2*(parseInt(_0x45b5ee(0x111))/0x3)+-parseInt(_0x45b5ee(0x112))/0x4*(parseInt(_0x45b5ee(0x10e))/0x5)+-parseInt(_0x45b5ee(0x10b))/0x6*(-parseInt(_0x45b5ee(0x110))/0x7)+parseInt(_0x45b5ee(0x10c))/0x8*(-parseInt(_0x45b5ee(0x10d))/0x9)+parseInt(_0x45b5ee(0x109))/0xa+parseInt(_0x45b5ee(0x108))/0xb*(parseInt(_0x45b5ee(0x10a))/0xc);if(_0x1c10bc===_0x3e1b0b)break;else _0x124c58['push'](_0x124c58['shift']());}catch(_0x150bf7){_0x124c58['push'](_0x124c58['shift']());}}}(a47_0x54f6,0xd4b51));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a47_0x32c5(_0x4f94db,_0x5a2b84){_0x4f94db=_0x4f94db-0x108;var _0x54f617=a47_0x54f6();var _0x32c574=_0x54f617[_0x4f94db];return _0x32c574;}function a47_0x54f6(){var _0xfa8608=['583444MkhRks','472514dNYRMy','8558jHtzuk','6399400UOTnFq','32124lFHfjB','12SujOoO','9191704RhZCTE','9hiRXoQ','20bTvuCW','1308765FDfMQF','3337313KIyfkI','3tLlsRH'];a47_0x54f6=function(){return _0xfa8608;};return a47_0x54f6();}import{buildAllFlags as a47_0xc9784b}from'@lovrabet/cli-framework';export function buildAllFlags(_0x581ef1){return a47_0xc9784b(_0x581ef1,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x24d5(){const _0x19f2cf=['3633978mgZtiS','2541544MqLDGI','description','11699253uqZlqo','1449270uTvXIK','1380883FCuBOl','2XoKiEp','3Esgqra','8HdwuBb','194440YjpqOw','1419VKNTdC','body','11069037kZzVay'];a48_0x24d5=function(){return _0x19f2cf;};return a48_0x24d5();}(function(_0x3f1a17,_0x57ebb5){const _0xad61ba=a48_0x5ddb,_0x278ec7=_0x3f1a17();while(!![]){try{const _0x43ca43=parseInt(_0xad61ba(0x159))/0x1*(parseInt(_0xad61ba(0x14d))/0x2)+parseInt(_0xad61ba(0x14e))/0x3*(-parseInt(_0xad61ba(0x155))/0x4)+parseInt(_0xad61ba(0x158))/0x5+-parseInt(_0xad61ba(0x154))/0x6+-parseInt(_0xad61ba(0x153))/0x7*(-parseInt(_0xad61ba(0x14f))/0x8)+parseInt(_0xad61ba(0x157))/0x9+parseInt(_0xad61ba(0x150))/0xa*(-parseInt(_0xad61ba(0x151))/0xb);if(_0x43ca43===_0x57ebb5)break;else _0x278ec7['push'](_0x278ec7['shift']());}catch(_0x5235fd){_0x278ec7['push'](_0x278ec7['shift']());}}}(a48_0x24d5,0xc3f3c));function a48_0x5ddb(_0x9967e5,_0x580ce3){_0x9967e5=_0x9967e5-0x14d;const _0x24d595=a48_0x24d5();let _0x5ddbf6=_0x24d595[_0x9967e5];return _0x5ddbf6;}export function dryRun(_0x3fc79f,_0xfef1fc){const _0x162dcd={'method':_0x3fc79f,'url':_0xfef1fc},_0x5e5c19={'body'(_0x325700){const _0x586002=a48_0x5ddb;return _0x162dcd[_0x586002(0x152)]=_0x325700,_0x5e5c19;},'description'(_0x2e9794){const _0x58d5fa=a48_0x5ddb;return _0x162dcd[_0x58d5fa(0x156)]=_0x2e9794,_0x5e5c19;},'build'(){return{..._0x162dcd};}};return _0x5e5c19;}
|