@lovrabet/lovrabet-cli 2.0.9-beta.0 → 2.0.9-beta.2
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
|
-
const
|
|
1
|
+
const a28_0x3dd8d3=a28_0x5ae4;(function(_0x13d373,_0x552bd5){const _0x4e42b3=a28_0x5ae4,_0x2ac082=_0x13d373();while(!![]){try{const _0x27422c=parseInt(_0x4e42b3(0x132))/0x1+-parseInt(_0x4e42b3(0x12e))/0x2*(-parseInt(_0x4e42b3(0x130))/0x3)+parseInt(_0x4e42b3(0x129))/0x4*(-parseInt(_0x4e42b3(0x126))/0x5)+-parseInt(_0x4e42b3(0x133))/0x6+-parseInt(_0x4e42b3(0x122))/0x7+-parseInt(_0x4e42b3(0x131))/0x8*(-parseInt(_0x4e42b3(0x12c))/0x9)+parseInt(_0x4e42b3(0x12f))/0xa;if(_0x27422c===_0x552bd5)break;else _0x2ac082['push'](_0x2ac082['shift']());}catch(_0x33a7c5){_0x2ac082['push'](_0x2ac082['shift']());}}}(a28_0x1153,0x49363));function a28_0x1153(){const _0x52730e=['isArray','SQL\x20execution\x20failed','execResult','length','execError','438032cWOWGF','now','\x20row(s)\x20in\x20','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','2842995tKIizL','Returned\x20','execSuccess','4TTmqNQ','params','exec','4086KmgoWa','read','222gKpMwn','755790nthMWF','2997qSMzMV','8224LWqtZT','375946VlQjLP','588456ijejhc','sql','sqlcode'];a28_0x1153=function(){return _0x52730e;};return a28_0x1153();}function a28_0x5ae4(_0x262a39,_0x347c14){_0x262a39=_0x262a39-0x11d;const _0x115322=a28_0x1153();let _0x5ae48c=_0x115322[_0x262a39];return _0x5ae48c;}import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a28_0x3dd8d3(0x134),'command':a28_0x3dd8d3(0x12b),'description':a28_0x3dd8d3(0x125),'risk':a28_0x3dd8d3(0x12d),'flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x19b69f){const _0x7dfee1=a28_0x3dd8d3,_0x4637fd=parseJsonParams(_0x19b69f['str'](_0x7dfee1(0x12a))),_0x16294a=Date[_0x7dfee1(0x123)](),_0x3d984f=await executeSdkSql(_0x19b69f['str'](_0x7dfee1(0x135)),_0x4637fd),_0x1d678e=Date[_0x7dfee1(0x123)]()-_0x16294a,_0x57e381=_0x3d984f?.[_0x7dfee1(0x11f)]??_0x3d984f,_0x36012e=_0x3d984f?.[_0x7dfee1(0x128)]??!![];if(!_0x36012e)return{'ok':![],'data':{'error':_0x3d984f?.[_0x7dfee1(0x121)]||'SQL\x20execution\x20failed','elapsed':_0x1d678e},'message':_0x7dfee1(0x11e)};const _0x37f2c9=Array[_0x7dfee1(0x11d)](_0x57e381)?_0x57e381:[];return{'ok':!![],'data':{'rows':_0x37f2c9,'rowCount':_0x37f2c9[_0x7dfee1(0x120)],'elapsed':_0x1d678e},'message':_0x7dfee1(0x127)+_0x37f2c9[_0x7dfee1(0x120)]+_0x7dfee1(0x124)+_0x1d678e+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cbd1b,_0x195a79){const _0x2ec748=a29_0xf43d,_0x3b3e00=_0x1cbd1b();while(!![]){try{const _0x3a8898=-parseInt(_0x2ec748(0xcb))/0x1*(parseInt(_0x2ec748(0xcf))/0x2)+parseInt(_0x2ec748(0xcc))/0x3+parseInt(_0x2ec748(0xd0))/0x4*(parseInt(_0x2ec748(0xca))/0x5)+parseInt(_0x2ec748(0xcd))/0x6*(-parseInt(_0x2ec748(0xc9))/0x7)+-parseInt(_0x2ec748(0xd1))/0x8+parseInt(_0x2ec748(0xc8))/0x9*(-parseInt(_0x2ec748(0xd2))/0xa)+parseInt(_0x2ec748(0xce))/0xb*(parseInt(_0x2ec748(0xc7))/0xc);if(_0x3a8898===_0x195a79)break;else _0x3b3e00['push'](_0x3b3e00['shift']());}catch(_0x33a5a2){_0x3b3e00['push'](_0x3b3e00['shift']());}}}(a29_0x3fab,0x43911));import{sqlDetail}from'../../commands/sql/detail.js';import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];function a29_0xf43d(_0x193f7e,_0x5a2598){_0x193f7e=_0x193f7e-0xc7;const _0x3fabdb=a29_0x3fab();let _0xf43ddc=_0x3fabdb[_0x193f7e];return _0xf43ddc;}function a29_0x3fab(){const _0x3abfb0=['986386UsXWME','53948eNBunD','1826400IXQxjM','1667910RQIMuX','84wbOeMI','18tyRlJL','2451603flAEze','115LNTRVD','1urGMlX','1512891ilxztR','6MnseTA','1363307QYEYGq'];a29_0x3fab=function(){return _0x3abfb0;};return a29_0x3fab();}
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a30_0xeb4b32=a30_0x318e;(function(_0x298d4e,_0x383c32){const _0xcece76=a30_0x318e,_0x35a88a=_0x298d4e();while(!![]){try{const _0xe3ab95=parseInt(_0xcece76(0xe9))/0x1*(parseInt(_0xcece76(0x115))/0x2)+parseInt(_0xcece76(0xe1))/0x3+-parseInt(_0xcece76(0xda))/0x4*(parseInt(_0xcece76(0x119))/0x5)+-parseInt(_0xcece76(0x10f))/0x6*(parseInt(_0xcece76(0x11a))/0x7)+parseInt(_0xcece76(0xe4))/0x8+-parseInt(_0xcece76(0x11f))/0x9+parseInt(_0xcece76(0xe0))/0xa;if(_0xe3ab95===_0x383c32)break;else _0x35a88a['push'](_0x35a88a['shift']());}catch(_0x414365){_0x35a88a['push'](_0x35a88a['shift']());}}}(a30_0x3c0d,0xc4bf6));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a30_0xeb4b32(0xe2),'type':a30_0xeb4b32(0x107),'description':a30_0xeb4b32(0xdd),'default':![]},{'name':a30_0xeb4b32(0xe7),'type':a30_0xeb4b32(0x107),'description':a30_0xeb4b32(0x11b),'default':![]},{'name':'version','type':a30_0xeb4b32(0xf8),'description':a30_0xeb4b32(0xeb)},{'name':a30_0xeb4b32(0xf5),'type':'boolean','description':'Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','default':![]},{'name':a30_0xeb4b32(0xfb),'type':'boolean','description':a30_0xeb4b32(0x116),'default':!![],'hidden':!![]}];function parseSemver(_0x1f5eb7){const _0x46b00e=a30_0xeb4b32,_0x483a5b=_0x1f5eb7[_0x46b00e(0xd8)]()[_0x46b00e(0x120)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x483a5b)return null;return{'major':Number(_0x483a5b[0x1]),'minor':Number(_0x483a5b[0x2]),'patch':Number(_0x483a5b[0x3]),'prerelease':_0x483a5b[0x4]};}function compareSemver(_0x452faf,_0x385145){const _0x14bc62=a30_0xeb4b32,_0x5aae0a=parseSemver(_0x452faf),_0x33df86=parseSemver(_0x385145);if(!_0x5aae0a||!_0x33df86)throw CliErrors[_0x14bc62(0xfe)](_0x14bc62(0x117),_0x14bc62(0xf1));for(const _0x156910 of[_0x14bc62(0x112),_0x14bc62(0xe3),_0x14bc62(0x103)]){if(_0x5aae0a[_0x156910]<_0x33df86[_0x156910])return-0x1;if(_0x5aae0a[_0x156910]>_0x33df86[_0x156910])return 0x1;}if(!_0x5aae0a[_0x14bc62(0xdf)]&&!_0x33df86[_0x14bc62(0xdf)])return 0x0;if(!_0x5aae0a[_0x14bc62(0xdf)])return 0x1;if(!_0x33df86[_0x14bc62(0xdf)])return-0x1;if(_0x5aae0a[_0x14bc62(0xdf)]===_0x33df86[_0x14bc62(0xdf)])return 0x0;return _0x5aae0a[_0x14bc62(0xdf)]<_0x33df86[_0x14bc62(0xdf)]?-0x1:0x1;}function getRequestedVersion(_0x5773b1){const _0x1c0596=a30_0xeb4b32,_0x36365f=_0x5773b1[_0x1c0596(0xea)]('version')[_0x1c0596(0xd8)]();if(_0x36365f)return _0x36365f;return String(_0x5773b1[_0x1c0596(0x106)]?.[0x0]??'')['trim']();}function shouldSkipOfficialSkill(_0x9ba168){const _0x5b0565=a30_0xeb4b32;return _0x9ba168[_0x5b0565(0xf4)](_0x5b0565(0xf5))||_0x9ba168[_0x5b0565(0x10a)](_0x5b0565(0xfb))===![];}async function validateUpdateFlags(_0x440b9c){const _0x22a1d4=a30_0xeb4b32,_0x4ffcbb=getRequestedVersion(_0x440b9c),_0x36bebc=[_0x440b9c[_0x22a1d4(0xf4)]('latest')?_0x22a1d4(0xe2):'',_0x440b9c[_0x22a1d4(0xf4)](_0x22a1d4(0xe7))?_0x22a1d4(0xe7):'',_0x4ffcbb?'version':''][_0x22a1d4(0xec)](Boolean);if(_0x36bebc[_0x22a1d4(0xf3)]>0x1)throw CliErrors[_0x22a1d4(0xfe)](_0x22a1d4(0x118),'Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x4ffcbb&&!parseSemver(_0x4ffcbb))throw CliErrors[_0x22a1d4(0xfe)](_0x22a1d4(0x111)+_0x4ffcbb,_0x22a1d4(0x104));}async function fetchNpmDistTags(){const _0xb07321=a30_0xeb4b32;try{const _0x39cf13=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0xb07321(0xe6),_0x1c0bf4=await fetch(_0x39cf13,{'signal':AbortSignal[_0xb07321(0xd9)](0x2710)});if(!_0x1c0bf4['ok'])return null;const _0xbd6aa8=await _0x1c0bf4[_0xb07321(0xf7)]();if(!_0xbd6aa8||typeof _0xbd6aa8!==_0xb07321(0xd3))return null;return Object['fromEntries'](Object['entries'](_0xbd6aa8)[_0xb07321(0xec)](([,_0x314545])=>typeof _0x314545===_0xb07321(0xf8)&&_0x314545[_0xb07321(0xd8)]())['map'](([_0x2aaeb0,_0x2fcf0e])=>[_0x2aaeb0,String(_0x2fcf0e)[_0xb07321(0xd8)]()]));}catch{return null;}}async function resolveTargetVersion(_0x2baeff){const _0x1dd32a=a30_0xeb4b32,_0x3815a3=getRequestedVersion(_0x2baeff);if(_0x3815a3)return{'version':_0x3815a3,'source':_0x1dd32a(0xee)};const _0x5396fc=_0x2baeff['bool'](_0x1dd32a(0xe7))?_0x1dd32a(0xe7):_0x1dd32a(0xe2),_0x35d96a=await fetchNpmDistTags(),_0x50bf1e=_0x35d96a?.[_0x5396fc];if(!_0x50bf1e)return null;return{'version':_0x50bf1e,'source':_0x5396fc};}function a30_0x318e(_0x2195cb,_0x57b15b){_0x2195cb=_0x2195cb-0xd3;const _0x3c0df1=a30_0x3c0d();let _0x318e28=_0x3c0df1[_0x2195cb];return _0x318e28;}function shouldInstallTarget(_0x1e01b7,_0xeff127){const _0x2702d5=a30_0xeb4b32,_0x152024=compareSemver(_0x1e01b7,_0xeff127['version']);if(_0xeff127[_0x2702d5(0xfc)]===_0x2702d5(0xee))return _0x152024!==0x0;return _0x152024<0x0;}function installCliPackage(_0x4dc8c8,_0x55d123){const _0xf6884=a30_0xeb4b32,_0x66c6d=resolveNpmBin('npm'),_0x448947=[_0xf6884(0x100),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4dc8c8];console['log']('*\x20'+[_0x66c6d,..._0x448947][_0xf6884(0x10d)]('\x20'));const _0x574ed4=spawnSync(_0x66c6d,_0x448947,{'cwd':process[_0xf6884(0x10c)](),'stdio':_0x55d123?'pipe':_0xf6884(0xfd),'env':process.env,'shell':![]});if(_0x574ed4[_0xf6884(0xde)]===0x0)return{'ok':!![]};let _0x33d12f=_0x574ed4[_0xf6884(0x108)]?.[_0xf6884(0xd4)]||_0xf6884(0x105)+(_0x574ed4[_0xf6884(0xde)]??_0xf6884(0x113));if(_0x55d123){const _0x25177b=_0x574ed4[_0xf6884(0x109)]?_0x574ed4[_0xf6884(0x109)][_0xf6884(0x10b)]()[_0xf6884(0xd8)]():'',_0x2690f1=_0x574ed4[_0xf6884(0x114)]?_0x574ed4[_0xf6884(0x114)]['toString']()[_0xf6884(0xd8)]():'';if(_0x25177b)_0x33d12f=_0x25177b;else{if(_0x2690f1)_0x33d12f=_0x2690f1;}}return{'ok':![],'error':_0x33d12f};}async function installOfficialSkill(_0x58539a){const _0x10b1ab=a30_0xeb4b32;console[_0x10b1ab(0xd7)]('Checking\x20official\x20skill\x20package...');const _0x3dd7b6=runNpxSkillsAddGlobal(process[_0x10b1ab(0x10c)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x58539a?_0x10b1ab(0x102):_0x10b1ab(0xfd)});if(_0x3dd7b6['skipped']){console[_0x10b1ab(0xd7)]('\x20\x20Skipped\x20skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x10b1ab(0xe5));return;}if(_0x3dd7b6['ok']){console[_0x10b1ab(0xd7)]('\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.');return;}console[_0x10b1ab(0x11e)]('\x20\x20Official\x20skill\x20update\x20failed:\x20'+(_0x3dd7b6['error']||'unknown')),console['log']('\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20'+LOVRABET_SKILL_SOURCE+_0x10b1ab(0xf6));}async function execute(_0xf0c783){const _0x3ab98d=a30_0xeb4b32;await validateUpdateFlags(_0xf0c783);const _0xc0cc4a=getCliVersion();console[_0x3ab98d(0xd7)](_0x3ab98d(0xdc)+_0xc0cc4a),console['log'](_0x3ab98d(0x110));const _0x112d1c=await resolveTargetVersion(_0xf0c783);if(!_0x112d1c){const _0x38ebf3=_0xf0c783[_0x3ab98d(0xf4)](_0x3ab98d(0xe7))?_0x3ab98d(0xe7):_0x3ab98d(0xe2),_0xb3a462=_0x3ab98d(0xdb)+_0x38ebf3+_0x3ab98d(0xff);return console[_0x3ab98d(0x11e)](_0xb3a462),console[_0x3ab98d(0xd7)](_0x3ab98d(0xf0)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x38ebf3),{'ok':![]};}if(!shouldInstallTarget(_0xc0cc4a,_0x112d1c)){const _0xc0218d=_0x112d1c[_0x3ab98d(0xfc)]==='version'?_0x3ab98d(0x11d)+_0x112d1c['version']+').':_0x3ab98d(0xe8)+_0x112d1c[_0x3ab98d(0xee)]+').';return console['log'](_0xc0218d),shouldSkipOfficialSkill(_0xf0c783)?console[_0x3ab98d(0xd7)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).'):await installOfficialSkill(_0xf0c783[_0x3ab98d(0x10e)]),{'ok':!![]};}console[_0x3ab98d(0xd7)](_0x3ab98d(0xf2)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0xc0cc4a+'\x20->\x20'+_0x112d1c[_0x3ab98d(0xee)]);const _0xd06ac=installCliPackage(_0x112d1c[_0x3ab98d(0xee)],_0xf0c783[_0x3ab98d(0x10e)]);if(!_0xd06ac['ok']){const _0x1b3067=_0x3ab98d(0xd6)+(_0xd06ac[_0x3ab98d(0x108)]||_0x3ab98d(0x113));return console[_0x3ab98d(0x108)](_0x1b3067),console[_0x3ab98d(0xd7)](_0x3ab98d(0xf9)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x112d1c[_0x3ab98d(0xee)]),{'ok':![]};}return console['log']('Updated\x20to\x20v'+_0x112d1c[_0x3ab98d(0xee)]+'.'),console[_0x3ab98d(0xd7)](_0x3ab98d(0xef)),shouldSkipOfficialSkill(_0xf0c783)?console['log'](_0x3ab98d(0x101)):await installOfficialSkill(_0xf0c783[_0x3ab98d(0x10e)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a30_0xeb4b32(0xd5),'description':a30_0xeb4b32(0x11c)+CLI_BIN_NAME+a30_0xeb4b32(0xfa),'risk':a30_0xeb4b32(0xed),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};function a30_0x3c0d(){const _0x157865=['Current\x20version:\x20','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','status','prerelease','5561870SnwRMc','3017877SWlsCL','latest','minor','982064RYBCYa','=1).','/dist-tags','beta','Already\x20up\x20to\x20date\x20(v','1FpHmCN','str','Install\x20a\x20specific\x20CLI\x20version','filter','write','version','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Updating\x20','length','bool','no-skills','\x20-g\x20-y','json','string','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20CLI\x20from\x20npm','skills','source','inherit','validation','\x20version\x20from\x20npm.','install','Skipping\x20official\x20skill\x20package\x20(--no-skills).','pipe','patch','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','exit\x20','args','boolean','error','stderr','flag','toString','cwd','join','nonInteractive','114UkNDQq','Checking\x20npm\x20dist-tags...','Invalid\x20version:\x20','major','unknown','stdout','2993958EWGLqR','Refresh\x20official\x20skill\x20package\x20after\x20updating','Version\x20comparison\x20failed.','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','30MwPdaS','389011HLQrtD','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20','Already\x20on\x20requested\x20version\x20(v','warn','9674460DkjYfz','match','object','message','run','Update\x20failed:\x20','log','trim','timeout','163452swSCyB','Unable\x20to\x20resolve\x20'];a30_0x3c0d=function(){return _0x157865;};return a30_0x3c0d();}
|
|
1
|
+
const a30_0x2b5b1a=a30_0x4592;(function(_0x5610b7,_0x17629e){const _0x19f644=a30_0x4592,_0x2d7e13=_0x5610b7();while(!![]){try{const _0x3d7f2a=-parseInt(_0x19f644(0x9e))/0x1*(parseInt(_0x19f644(0xbb))/0x2)+-parseInt(_0x19f644(0x7d))/0x3+-parseInt(_0x19f644(0x86))/0x4+parseInt(_0x19f644(0x8a))/0x5+parseInt(_0x19f644(0x83))/0x6*(parseInt(_0x19f644(0xa6))/0x7)+parseInt(_0x19f644(0x7a))/0x8+parseInt(_0x19f644(0x85))/0x9;if(_0x3d7f2a===_0x17629e)break;else _0x2d7e13['push'](_0x2d7e13['shift']());}catch(_0x25bbbd){_0x2d7e13['push'](_0x2d7e13['shift']());}}}(a30_0x382b,0xe5969));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{LOVRABET_NPM_PACKAGE_NAME,LOVRABET_SKILL_SOURCE,NPM_REGISTRY_BASE_URL}from'../constant/distribution.js';import{resolveNpmBin}from'../utils/platform.js';import{getCliVersion}from'../utils/version.js';import{LOVRABET_SKIP_NPX_SKILLS_ENV,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';const updateFlags=[{'name':a30_0x2b5b1a(0xbc),'type':a30_0x2b5b1a(0x98),'description':a30_0x2b5b1a(0xae),'default':![]},{'name':'beta','type':a30_0x2b5b1a(0x98),'description':a30_0x2b5b1a(0xb4),'default':![]},{'name':a30_0x2b5b1a(0xb9),'type':a30_0x2b5b1a(0xbe),'description':a30_0x2b5b1a(0x7c)},{'name':a30_0x2b5b1a(0x99),'type':a30_0x2b5b1a(0x98),'description':a30_0x2b5b1a(0xb0),'default':![]},{'name':'skills','type':'boolean','description':'Refresh\x20official\x20skill\x20package\x20after\x20updating','default':!![],'hidden':!![]}];function parseSemver(_0x3866ed){const _0x29e537=a30_0x2b5b1a,_0x10d33d=_0x3866ed[_0x29e537(0xb6)]()['match'](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x10d33d)return null;return{'major':Number(_0x10d33d[0x1]),'minor':Number(_0x10d33d[0x2]),'patch':Number(_0x10d33d[0x3]),'prerelease':_0x10d33d[0x4]};}function compareSemver(_0xdf9443,_0x27c732){const _0x1edbbb=a30_0x2b5b1a,_0x3545b9=parseSemver(_0xdf9443),_0x33de4f=parseSemver(_0x27c732);if(!_0x3545b9||!_0x33de4f)throw CliErrors[_0x1edbbb(0xb8)](_0x1edbbb(0x8c),'Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.');for(const _0x4e6208 of[_0x1edbbb(0xb3),_0x1edbbb(0x8d),_0x1edbbb(0xa2)]){if(_0x3545b9[_0x4e6208]<_0x33de4f[_0x4e6208])return-0x1;if(_0x3545b9[_0x4e6208]>_0x33de4f[_0x4e6208])return 0x1;}if(!_0x3545b9[_0x1edbbb(0x9f)]&&!_0x33de4f[_0x1edbbb(0x9f)])return 0x0;if(!_0x3545b9[_0x1edbbb(0x9f)])return 0x1;if(!_0x33de4f['prerelease'])return-0x1;if(_0x3545b9[_0x1edbbb(0x9f)]===_0x33de4f['prerelease'])return 0x0;return _0x3545b9[_0x1edbbb(0x9f)]<_0x33de4f[_0x1edbbb(0x9f)]?-0x1:0x1;}function getRequestedVersion(_0x20001e){const _0x59839f=a30_0x2b5b1a,_0x3ef9ce=_0x20001e[_0x59839f(0x9c)](_0x59839f(0xb9))['trim']();if(_0x3ef9ce)return _0x3ef9ce;return String(_0x20001e[_0x59839f(0x9b)]?.[0x0]??'')[_0x59839f(0xb6)]();}function shouldSkipOfficialSkill(_0x424965){const _0x2f1a33=a30_0x2b5b1a;return _0x424965[_0x2f1a33(0xc0)](_0x2f1a33(0x99))||_0x424965[_0x2f1a33(0x93)](_0x2f1a33(0x76))===![];}async function validateUpdateFlags(_0x2cd50a){const _0x24c93a=a30_0x2b5b1a,_0x4dd466=getRequestedVersion(_0x2cd50a),_0x2c8888=[_0x2cd50a[_0x24c93a(0xc0)](_0x24c93a(0xbc))?_0x24c93a(0xbc):'',_0x2cd50a[_0x24c93a(0xc0)](_0x24c93a(0xac))?'beta':'',_0x4dd466?_0x24c93a(0xb9):'']['filter'](Boolean);if(_0x2c8888[_0x24c93a(0x95)]>0x1)throw CliErrors[_0x24c93a(0xb8)](_0x24c93a(0xad),'Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x4dd466&&!parseSemver(_0x4dd466))throw CliErrors['validation'](_0x24c93a(0xa0)+_0x4dd466,_0x24c93a(0xc1));}async function fetchNpmDistTags(){const _0x10b414=a30_0x2b5b1a;try{const _0xa7993b=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x10b414(0x94),_0x3f2df0=await fetch(_0xa7993b,{'signal':AbortSignal[_0x10b414(0x89)](0x2710)});if(!_0x3f2df0['ok'])return null;const _0x53c947=await _0x3f2df0[_0x10b414(0xbd)]();if(!_0x53c947||typeof _0x53c947!==_0x10b414(0xa9))return null;return Object[_0x10b414(0x84)](Object['entries'](_0x53c947)[_0x10b414(0x88)](([,_0x4a60c3])=>typeof _0x4a60c3==='string'&&_0x4a60c3['trim']())['map'](([_0x2a6d59,_0x27866e])=>[_0x2a6d59,String(_0x27866e)[_0x10b414(0xb6)]()]));}catch{return null;}}function a30_0x4592(_0xed76d6,_0x14a286){_0xed76d6=_0xed76d6-0x76;const _0x382b8d=a30_0x382b();let _0x459249=_0x382b8d[_0xed76d6];return _0x459249;}async function resolveTargetVersion(_0x3acd5a){const _0x1bdc8a=a30_0x2b5b1a,_0x5754b5=getRequestedVersion(_0x3acd5a);if(_0x5754b5)return{'version':_0x5754b5,'source':_0x1bdc8a(0xb9)};const _0x27dbe8=_0x3acd5a[_0x1bdc8a(0xc0)]('beta')?'beta':_0x1bdc8a(0xbc),_0x101af9=await fetchNpmDistTags(),_0x580328=_0x101af9?.[_0x27dbe8];if(!_0x580328)return null;return{'version':_0x580328,'source':_0x27dbe8};}function shouldInstallTarget(_0x10c58e,_0x5f508d){const _0x5379c9=a30_0x2b5b1a,_0x2fccee=compareSemver(_0x10c58e,_0x5f508d[_0x5379c9(0xb9)]);if(_0x5f508d[_0x5379c9(0x8e)]===_0x5379c9(0xb9))return _0x2fccee!==0x0;return _0x2fccee<0x0;}function a30_0x382b(){const _0x258d51=['Checking\x20npm\x20dist-tags...','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','194934VBjzOn','fromEntries','7490880rfvnJw','61920EZPbiN','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','filter','timeout','707530EErgdq','warn','Version\x20comparison\x20failed.','minor','source','\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20','\x20version\x20from\x20npm.','\x20\x20Skipped\x20skill\x20install\x20(','stderr','flag','/dist-tags','length','Current\x20version:\x20','Update\x20','boolean','no-skills','Unable\x20to\x20resolve\x20','args','str','status','2PvERoV','prerelease','Invalid\x20version:\x20','Update\x20failed:\x20','patch','Skipping\x20official\x20skill\x20package\x20(--no-skills).','npm','\x20CLI\x20from\x20npm','259ohLZwb','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Updated\x20to\x20v','object','\x20\x20Official\x20skill\x20update\x20failed:\x20','toString','beta','--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','pipe','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','inherit','Checking\x20official\x20skill\x20package...','major','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','join','trim','nonInteractive','validation','version','message','1353328OIfHrz','latest','json','string','Updating\x20','bool','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','skills','\x20-g\x20-y','cwd','skipped','2709872nkSELK','log','Install\x20a\x20specific\x20CLI\x20version','616356blvAHN','install','exit\x20','error'];a30_0x382b=function(){return _0x258d51;};return a30_0x382b();}function installCliPackage(_0x2139a6,_0x302b6a){const _0x583945=a30_0x2b5b1a,_0x2c4f7b=resolveNpmBin(_0x583945(0xa4)),_0xa4e28a=[_0x583945(0x7e),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x2139a6];console[_0x583945(0x7b)]('*\x20'+[_0x2c4f7b,..._0xa4e28a][_0x583945(0xb5)]('\x20'));const _0x5f5af6=spawnSync(_0x2c4f7b,_0xa4e28a,{'cwd':process[_0x583945(0x78)](),'stdio':_0x302b6a?_0x583945(0xaf):'inherit','env':process.env,'shell':![]});if(_0x5f5af6[_0x583945(0x9d)]===0x0)return{'ok':!![]};let _0x5a6df5=_0x5f5af6[_0x583945(0x80)]?.[_0x583945(0xba)]||_0x583945(0x7f)+(_0x5f5af6[_0x583945(0x9d)]??'unknown');if(_0x302b6a){const _0x310239=_0x5f5af6[_0x583945(0x92)]?_0x5f5af6[_0x583945(0x92)][_0x583945(0xab)]()['trim']():'',_0x331439=_0x5f5af6['stdout']?_0x5f5af6['stdout'][_0x583945(0xab)]()[_0x583945(0xb6)]():'';if(_0x310239)_0x5a6df5=_0x310239;else{if(_0x331439)_0x5a6df5=_0x331439;}}return{'ok':![],'error':_0x5a6df5};}async function installOfficialSkill(_0x2012f2){const _0x4a0e50=a30_0x2b5b1a;console[_0x4a0e50(0x7b)](_0x4a0e50(0xb2));const _0x31a5ba=runNpxSkillsAddGlobal(process[_0x4a0e50(0x78)](),LOVRABET_SKILL_SOURCE,{'stdio':_0x2012f2?_0x4a0e50(0xaf):_0x4a0e50(0xb1)});if(_0x31a5ba[_0x4a0e50(0x79)]){console[_0x4a0e50(0x7b)](_0x4a0e50(0x91)+LOVRABET_SKIP_NPX_SKILLS_ENV+'=1).');return;}if(_0x31a5ba['ok']){console['log'](_0x4a0e50(0x87));return;}console[_0x4a0e50(0x8b)](_0x4a0e50(0xaa)+(_0x31a5ba[_0x4a0e50(0x80)]||'unknown')),console[_0x4a0e50(0x7b)]('\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20'+LOVRABET_SKILL_SOURCE+_0x4a0e50(0x77));}async function execute(_0x492ba7){const _0x49ff4e=a30_0x2b5b1a;await validateUpdateFlags(_0x492ba7);const _0x4b83d4=getCliVersion();console[_0x49ff4e(0x7b)](_0x49ff4e(0x96)+_0x4b83d4),console['log'](_0x49ff4e(0x81));const _0x17dbdb=await resolveTargetVersion(_0x492ba7);if(!_0x17dbdb){const _0x4a6832=_0x492ba7['bool'](_0x49ff4e(0xac))?_0x49ff4e(0xac):_0x49ff4e(0xbc),_0x40d50c=_0x49ff4e(0x9a)+_0x4a6832+_0x49ff4e(0x90);return console[_0x49ff4e(0x8b)](_0x40d50c),console[_0x49ff4e(0x7b)](_0x49ff4e(0x82)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x4a6832),{'ok':![]};}if(!shouldInstallTarget(_0x4b83d4,_0x17dbdb)){const _0x29e813=_0x17dbdb['source']===_0x49ff4e(0xb9)?'Already\x20on\x20requested\x20version\x20(v'+_0x17dbdb['version']+').':'Already\x20up\x20to\x20date\x20(v'+_0x17dbdb['version']+').';return console[_0x49ff4e(0x7b)](_0x29e813),shouldSkipOfficialSkill(_0x492ba7)?console[_0x49ff4e(0x7b)](_0x49ff4e(0xa3)):await installOfficialSkill(_0x492ba7[_0x49ff4e(0xb7)]),{'ok':!![]};}console['log'](_0x49ff4e(0xbf)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x4b83d4+'\x20->\x20'+_0x17dbdb[_0x49ff4e(0xb9)]);const _0x4d6e4d=installCliPackage(_0x17dbdb[_0x49ff4e(0xb9)],_0x492ba7[_0x49ff4e(0xb7)]);if(!_0x4d6e4d['ok']){const _0x23c4c6=_0x49ff4e(0xa1)+(_0x4d6e4d[_0x49ff4e(0x80)]||'unknown');return console['error'](_0x23c4c6),console[_0x49ff4e(0x7b)](_0x49ff4e(0x8f)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x17dbdb[_0x49ff4e(0xb9)]),{'ok':![]};}return console['log'](_0x49ff4e(0xa8)+_0x17dbdb[_0x49ff4e(0xb9)]+'.'),console[_0x49ff4e(0x7b)](_0x49ff4e(0xa7)),shouldSkipOfficialSkill(_0x492ba7)?console['log'](_0x49ff4e(0xa3)):await installOfficialSkill(_0x492ba7[_0x49ff4e(0xb7)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':'run','description':a30_0x2b5b1a(0x97)+CLI_BIN_NAME+a30_0x2b5b1a(0xa5),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x5d3bf5=a31_0x81a8;(function(_0x418076,_0x1a86f3){const _0x37280f=a31_0x81a8,_0x4624db=_0x418076();while(!![]){try{const _0x36da52=parseInt(_0x37280f(0x144))/0x1+parseInt(_0x37280f(0x141))/0x2*(-parseInt(_0x37280f(0x139))/0x3)+parseInt(_0x37280f(0x137))/0x4*(parseInt(_0x37280f(0x13b))/0x5)+-parseInt(_0x37280f(0x130))/0x6+parseInt(_0x37280f(0x133))/0x7*(-parseInt(_0x37280f(0x128))/0x8)+-parseInt(_0x37280f(0x142))/0x9*(parseInt(_0x37280f(0x129))/0xa)+parseInt(_0x37280f(0x12b))/0xb;if(_0x36da52===_0x1a86f3)break;else _0x4624db['push'](_0x4624db['shift']());}catch(_0x15f281){_0x4624db['push'](_0x4624db['shift']());}}}(a31_0x2c15,0xbea33));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':a31_0x5d3bf5(0x135),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5d3bf5(0x12f)],'importable':!![]},'format':{'description':a31_0x5d3bf5(0x12a),'topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['format'],'importable':!![]},'pageSize':{'description':'Default\x20page\x20size','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a31_0x5d3bf5(0x132),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a31_0x5d3bf5(0x12e),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':a31_0x5d3bf5(0x138),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a31_0x5d3bf5(0x134),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a31_0x5d3bf5(0x131),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5d3bf5(0x136)],'importable':!![]},'locale':{'description':'Locale','topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x5d3bf5(0x140)],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object['entries'](CONFIG_FIELD_SCHEMAS)[a31_0x5d3bf5(0x13d)](([,_0x509baa])=>_0x509baa[a31_0x5d3bf5(0x13c)])['map'](([_0x181bd2])=>_0x181bd2));function a31_0x81a8(_0x2ef6af,_0x11f046){_0x2ef6af=_0x2ef6af-0x127;const _0x2c153d=a31_0x2c15();let _0x81a8af=_0x2c153d[_0x2ef6af];return _0x81a8af;}export const CONFIG_ENUM_VALUES=Object[a31_0x5d3bf5(0x13f)](Object[a31_0x5d3bf5(0x12d)](CONFIG_FIELD_SCHEMAS)[a31_0x5d3bf5(0x13d)](([,_0x58ceda])=>_0x58ceda['enumValues'])['map'](([_0x593cdf,_0x401f9e])=>[_0x593cdf,[..._0x401f9e[a31_0x5d3bf5(0x12c)]||[]]]));export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a31_0x5d3bf5(0x12d)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0x3d87b7])=>_0x3d87b7[a31_0x5d3bf5(0x143)])[a31_0x5d3bf5(0x145)](([_0x1b2338])=>_0x1b2338);export function getConfigFieldSchema(_0x5a6dab){return CONFIG_FIELD_SCHEMAS[_0x5a6dab];}export function getConfigEnumValues(_0x293697){const _0x3f2113=a31_0x5d3bf5;return getConfigFieldSchema(_0x293697)?.[_0x3f2113(0x12c)];}export function getConfigDefaultValue(_0x5992f8){return getConfigFieldSchema(_0x5992f8)?.['defaultValue'];}export function isTopLevelConfigKey(_0x148c3a){return TOP_LEVEL_CONFIG_KEYS['has'](_0x148c3a);}export function isLegacyCompatConfigKey(_0x40e07a){const _0x36ac00=a31_0x5d3bf5;return getConfigFieldSchema(_0x40e07a)?.[_0x36ac00(0x13a)]===!![];}function a31_0x2c15(){const _0x94167b=['entries','Override\x20user\x20domain','env','7047024HdXTpH','Risk\x20level','Override\x20API\x20domain','7BeMjwA','Access\x20key\x20(client-ak\x20auth)','Target\x20environment','riskLevel','2988956mEoYVf','Override\x20runtime\x20domain','129EQxnrT','legacyCompatOnly','5EPjAZj','cliSettableTopLevel','filter','join','fromEntries','locale','43526FqKfhf','981Ldtsuv','importable','1044307zLKTUS','map',';\x20local\x20alias:\x20apps.<alias>.appcode','Config\x20key.\x20Top-level:\x20','7261568xOMQzL','35810RipPfs','Default\x20output\x20format','26374073jherbZ','enumValues'];a31_0x2c15=function(){return _0x94167b;};return a31_0x2c15();}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x4b41fc){const _0x2d140e=a31_0x5d3bf5;return[..._0x4b41fc][_0x2d140e(0x13e)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x2eb67b=a31_0x5d3bf5;return _0x2eb67b(0x127)+getTopLevelConfigKeySummary()+_0x2eb67b(0x146);}export function buildAppProfileListFields(_0xeb96a){return{'env':_0xeb96a,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0xc0a9(_0x21d715,_0x570bd9){_0x21d715=_0x21d715-0x131;const _0x5e7e9b=a32_0x5e7e();let _0xc0a9d1=_0x5e7e9b[_0x21d715];return _0xc0a9d1;}(function(_0x557322,_0x4e0e5c){const _0x589815=a32_0xc0a9,_0x5bdb58=_0x557322();while(!![]){try{const _0x159127=-parseInt(_0x589815(0x135))/0x1*(-parseInt(_0x589815(0x131))/0x2)+-parseInt(_0x589815(0x134))/0x3+-parseInt(_0x589815(0x132))/0x4+-parseInt(_0x589815(0x13a))/0x5+parseInt(_0x589815(0x139))/0x6+parseInt(_0x589815(0x136))/0x7+-parseInt(_0x589815(0x137))/0x8*(-parseInt(_0x589815(0x133))/0x9);if(_0x159127===_0x4e0e5c)break;else _0x5bdb58['push'](_0x5bdb58['shift']());}catch(_0x3d1d4a){_0x5bdb58['push'](_0x5bdb58['shift']());}}}(a32_0x5e7e,0xc149c));export const AUTH_MODE={'ClientAk':'client-ak'};function a32_0x5e7e(){const _0x51d319=['8921066CmvbwX','1383280oyPnfE','ClientAk','1362984MDwKOs','2696165VdWmed','46iKbzvo','3517156wyEVCB','18WVXTVS','3149142urfaak','61414rGxrML'];a32_0x5e7e=function(){return _0x51d319;};return a32_0x5e7e();}export function isAuthMode(_0x4866a3){const _0x5aa0e6=a32_0xc0a9;return _0x4866a3===AUTH_MODE[_0x5aa0e6(0x138)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0xd5ca(_0x400939,_0x5dbf6f){_0x400939=_0x400939-0x183;const _0x42a5e6=a33_0x42a5();let _0xd5cad0=_0x42a5e6[_0x400939];return _0xd5cad0;}function a33_0x42a5(){const _0x486e82=['6548868itmYiL','5993670Msowcr','fromEntries','Record\x20ID','cliDisplayName','1QYZoXI','Select\x20app\x20profile\x20by\x20name','8wPvQvq','56uGWbdj','boolean','format','dry-run','appcode','Output\x20format','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','map','name','production\x20|\x20development\x20|\x20daily','384268mMurjM','Name\x20filter','params','5686696naABQs','267516JVCjeF','help','env','Verbose\x20output','Alias\x20for\x20--non-interactive','Force\x20non-interactive\x20mode\x20(CI)','dryRun','Show\x20help','string','app','Use\x20global\x20config\x20scope','yes','SQL\x20query\x20code','sqlcode','11974633zaGTUi','5KdBssQ','clear','verbose','cliBinName','non-interactive','<name>','meowKey','Override\x20appcode','nonInteractive','global','2592450qmCPzv'];a33_0x42a5=function(){return _0x486e82;};return a33_0x42a5();}const a33_0x436ffb=a33_0xd5ca;(function(_0x12265f,_0x13f0e5){const _0x1bcc8f=a33_0xd5ca,_0x4f0e33=_0x12265f();while(!![]){try{const _0xacbb31=parseInt(_0x1bcc8f(0x1b1))/0x1*(-parseInt(_0x1bcc8f(0x18e))/0x2)+parseInt(_0x1bcc8f(0x1ab))/0x3+parseInt(_0x1bcc8f(0x191))/0x4*(parseInt(_0x1bcc8f(0x1a1))/0x5)+parseInt(_0x1bcc8f(0x192))/0x6*(-parseInt(_0x1bcc8f(0x184))/0x7)+parseInt(_0x1bcc8f(0x183))/0x8*(parseInt(_0x1bcc8f(0x1ac))/0x9)+-parseInt(_0x1bcc8f(0x1ad))/0xa+-parseInt(_0x1bcc8f(0x1a0))/0xb;if(_0xacbb31===_0x13f0e5)break;else _0x4f0e33['push'](_0x4f0e33['shift']());}catch(_0x3101d7){_0x4f0e33['push'](_0x4f0e33['shift']());}}}(a33_0x42a5,0xbd9ec));import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG[a33_0x436ffb(0x1a4)];export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a33_0x436ffb(0x1b0)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a33_0x436ffb(0x188),'meowKey':'appcode','type':a33_0x436ffb(0x19a),'description':a33_0x436ffb(0x1a8),'hint':'<code>'},{'name':a33_0x436ffb(0x19b),'meowKey':a33_0x436ffb(0x19b),'type':a33_0x436ffb(0x19a),'description':a33_0x436ffb(0x1b2),'hint':a33_0x436ffb(0x1a6)},{'name':'env','meowKey':a33_0x436ffb(0x194),'type':a33_0x436ffb(0x19a),'description':'Environment','hint':a33_0x436ffb(0x18d)},{'name':a33_0x436ffb(0x186),'meowKey':a33_0x436ffb(0x186),'type':'string','description':a33_0x436ffb(0x189),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':'string','description':a33_0x436ffb(0x18a),'hint':'<expr>'},{'name':a33_0x436ffb(0x187),'meowKey':a33_0x436ffb(0x198),'type':a33_0x436ffb(0x185),'description':'Preview\x20operation\x20without\x20executing'},{'name':a33_0x436ffb(0x19d),'meowKey':a33_0x436ffb(0x19d),'type':a33_0x436ffb(0x185),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a33_0x436ffb(0x1a5),'meowKey':a33_0x436ffb(0x1a9),'type':a33_0x436ffb(0x185),'description':a33_0x436ffb(0x197)},{'name':a33_0x436ffb(0x1aa),'meowKey':'global','type':a33_0x436ffb(0x185),'description':a33_0x436ffb(0x19c)},{'name':'ci','meowKey':'ci','type':a33_0x436ffb(0x185),'description':a33_0x436ffb(0x196),'hidden':!![]},{'name':a33_0x436ffb(0x193),'meowKey':a33_0x436ffb(0x193),'type':a33_0x436ffb(0x185),'description':a33_0x436ffb(0x199)},{'name':'id','meowKey':'id','type':'string','description':a33_0x436ffb(0x1af),'hidden':!![]},{'name':a33_0x436ffb(0x18c),'meowKey':a33_0x436ffb(0x18c),'type':'string','description':a33_0x436ffb(0x18f),'hidden':!![]},{'name':a33_0x436ffb(0x19f),'meowKey':a33_0x436ffb(0x19f),'type':a33_0x436ffb(0x19a),'description':a33_0x436ffb(0x19e),'hidden':!![]},{'name':a33_0x436ffb(0x190),'meowKey':a33_0x436ffb(0x190),'type':a33_0x436ffb(0x19a),'description':'JSON\x20params\x20for\x20execute\x20commands','hidden':!![]},{'name':a33_0x436ffb(0x1a3),'meowKey':'verbose','type':'boolean','description':a33_0x436ffb(0x195),'hidden':!![]},{'name':a33_0x436ffb(0x1a2),'meowKey':a33_0x436ffb(0x1a2),'type':a33_0x436ffb(0x185),'description':'Clear\x20output','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a33_0x436ffb(0x188),a33_0x436ffb(0x19b),a33_0x436ffb(0x194),a33_0x436ffb(0x186),'jq',a33_0x436ffb(0x187),a33_0x436ffb(0x19d),a33_0x436ffb(0x1a5),'ci']);export function buildMeowFlags(){const _0x365c77=a33_0x436ffb;return Object[_0x365c77(0x1ae)](GLOBAL_FLAGS[_0x365c77(0x18b)](_0x169290=>[_0x169290[_0x365c77(0x1a7)],{'type':_0x169290['type']}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x32609e=a34_0x4cd6;(function(_0xafe152,_0x1c34b5){const _0x5e606e=a34_0x4cd6,_0x40d60f=_0xafe152();while(!![]){try{const _0x55a2fd=-parseInt(_0x5e606e(0x19f))/0x1*(-parseInt(_0x5e606e(0x196))/0x2)+-parseInt(_0x5e606e(0x199))/0x3*(-parseInt(_0x5e606e(0x19d))/0x4)+parseInt(_0x5e606e(0x1a0))/0x5*(-parseInt(_0x5e606e(0x198))/0x6)+parseInt(_0x5e606e(0x1a2))/0x7+-parseInt(_0x5e606e(0x197))/0x8+-parseInt(_0x5e606e(0x19a))/0x9*(parseInt(_0x5e606e(0x19b))/0xa)+parseInt(_0x5e606e(0x19e))/0xb*(parseInt(_0x5e606e(0x19c))/0xc);if(_0x55a2fd===_0x1c34b5)break;else _0x40d60f['push'](_0x40d60f['shift']());}catch(_0x1ff83d){_0x40d60f['push'](_0x40d60f['shift']());}}}(a34_0xc2df,0x62b38));export const DEFAULT_APP_PROFILE_NAME=a34_0x32609e(0x195);function a34_0x4cd6(_0x4d13a2,_0x386972){_0x4d13a2=_0x4d13a2-0x193;const _0xc2dfba=a34_0xc2df();let _0x4cd617=_0xc2dfba[_0x4d13a2];return _0x4cd617;}export const DEFAULT_CONFIG_VALUES={'env':a34_0x32609e(0x1a1),'format':'compress','locale':a34_0x32609e(0x194),'riskLevel':a34_0x32609e(0x193)};export const DEFAULT_COMMAND_OUTPUT_FORMAT='compress';function a34_0xc2df(){const _0x45e5d2=['11dwlkBK','521uezzyY','5JFHJOU','production','3602340HUKQWZ','write','en-US','main','198XagwMs','3473048ngfZbP','139572oQanTf','405gFTDgC','336087jnvQLC','110zWLpjb','7447884AefssY','2536vLuVzl'];a34_0xc2df=function(){return _0x45e5d2;};return a34_0xc2df();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x1842b7=a35_0x1b8f;function a35_0x1b8f(_0xeeb5b6,_0x294770){_0xeeb5b6=_0xeeb5b6-0x1d3;const _0x5aa5d2=a35_0x5aa5();let _0x1b8f56=_0x5aa5d2[_0xeeb5b6];return _0x1b8f56;}(function(_0xc3a912,_0x4f2c98){const _0xef3dcd=a35_0x1b8f,_0x57a1bb=_0xc3a912();while(!![]){try{const _0x56452b=-parseInt(_0xef3dcd(0x1d8))/0x1+-parseInt(_0xef3dcd(0x1de))/0x2+-parseInt(_0xef3dcd(0x1dd))/0x3*(-parseInt(_0xef3dcd(0x1d3))/0x4)+parseInt(_0xef3dcd(0x1d6))/0x5*(-parseInt(_0xef3dcd(0x1d4))/0x6)+parseInt(_0xef3dcd(0x1df))/0x7+-parseInt(_0xef3dcd(0x1d9))/0x8*(-parseInt(_0xef3dcd(0x1db))/0x9)+parseInt(_0xef3dcd(0x1da))/0xa;if(_0x56452b===_0x4f2c98)break;else _0x57a1bb['push'](_0x57a1bb['shift']());}catch(_0x56c889){_0x57a1bb['push'](_0x57a1bb['shift']());}}}(a35_0x5aa5,0x58b05));import{PRODUCT_CONFIG}from'../constant/product.js';function a35_0x5aa5(){const _0x2fdb97=['63579COzEnT','1129030iAelLZ','2631839GxTqID','68greOsY','30fJQSJK','skillSource','539780taHthW','npmPackageName','204685wVLDMt','11312VRsjZt','9176090ZfjBxC','117LCxWmF','npmRegistryBaseUrl'];a35_0x5aa5=function(){return _0x2fdb97;};return a35_0x5aa5();}export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG[a35_0x1842b7(0x1d7)];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a35_0x1842b7(0x1d5)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a35_0x1842b7(0x1dc)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a36_0x4e11(_0x36b0f4,_0x5800ee){_0x36b0f4=_0x36b0f4-0x166;const _0x5a2e95=a36_0x5a2e();let _0x4e1118=_0x5a2e95[_0x36b0f4];return _0x4e1118;}const a36_0x594bc1=a36_0x4e11;(function(_0x48e488,_0xd0902a){const _0x3cf4ee=a36_0x4e11,_0x5ed313=_0x48e488();while(!![]){try{const _0x47a88b=-parseInt(_0x3cf4ee(0x175))/0x1+parseInt(_0x3cf4ee(0x173))/0x2+-parseInt(_0x3cf4ee(0x168))/0x3*(-parseInt(_0x3cf4ee(0x16d))/0x4)+parseInt(_0x3cf4ee(0x167))/0x5*(-parseInt(_0x3cf4ee(0x16e))/0x6)+-parseInt(_0x3cf4ee(0x16f))/0x7+parseInt(_0x3cf4ee(0x16b))/0x8+parseInt(_0x3cf4ee(0x172))/0x9;if(_0x47a88b===_0xd0902a)break;else _0x5ed313['push'](_0x5ed313['shift']());}catch(_0x1ac298){_0x5ed313['push'](_0x5ed313['shift']());}}}(a36_0x5a2e,0xa00ed));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x18837e){const _0x4142d4=a36_0x4e11;customApiDomain=_0x18837e?.['apiDomain'],customUserDomain=_0x18837e?.['userDomain'],customRuntimeDomain=_0x18837e?.[_0x4142d4(0x171)];}function a36_0x5a2e(){const _0x260314=['runtimeDomain','3158397wAxWIJ','514864TgLvzR','runtime','581781oLLmzH','production','5325ZstDie','30rFYYMQ','user','nonProduction','10017936BOOcqL','api','214468pEPlBj','5004EWhMTC','1898323CpngtV','domains'];a36_0x5a2e=function(){return _0x260314;};return a36_0x5a2e();}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0x594bc1(0x170)][a36_0x594bc1(0x166)][a36_0x594bc1(0x169)]:PRODUCT_CONFIG[a36_0x594bc1(0x170)][a36_0x594bc1(0x16a)][a36_0x594bc1(0x169)]);export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a36_0x594bc1(0x166)][a36_0x594bc1(0x16c)]:PRODUCT_CONFIG[a36_0x594bc1(0x170)][a36_0x594bc1(0x16a)][a36_0x594bc1(0x16c)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a36_0x594bc1(0x166)][a36_0x594bc1(0x174)]:PRODUCT_CONFIG['domains'][a36_0x594bc1(0x16a)]['runtime']);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a37_0x2ed8(){const _0x38b2b6=['1306870tAbLBB','18blKMse','development','298212uUGhec','6mJqOkp','582200MeZqQo','production','ENV','2385090DmwjdH','143UniRvD','daily','4eeeTGO','1908245VXPeLH','2526713Rzsbus','350134SKCXkT','2tJVagM','11ruZZbH'];a37_0x2ed8=function(){return _0x38b2b6;};return a37_0x2ed8();}const a37_0x43259c=a37_0x597e;(function(_0x4a5cee,_0xc0b22e){const _0x190eb4=a37_0x597e,_0x32dbff=_0x4a5cee();while(!![]){try{const _0x18d1ec=-parseInt(_0x190eb4(0xcf))/0x1*(-parseInt(_0x190eb4(0xce))/0x2)+parseInt(_0x190eb4(0xd9))/0x3*(parseInt(_0x190eb4(0xcb))/0x4)+parseInt(_0x190eb4(0xcc))/0x5*(-parseInt(_0x190eb4(0xd5))/0x6)+-parseInt(_0x190eb4(0xcd))/0x7+parseInt(_0x190eb4(0xd6))/0x8*(-parseInt(_0x190eb4(0xd2))/0x9)+parseInt(_0x190eb4(0xd1))/0xa*(-parseInt(_0x190eb4(0xd0))/0xb)+parseInt(_0x190eb4(0xd4))/0xc*(parseInt(_0x190eb4(0xda))/0xd);if(_0x18d1ec===_0xc0b22e)break;else _0x32dbff['push'](_0x32dbff['shift']());}catch(_0x23ddfb){_0x32dbff['push'](_0x32dbff['shift']());}}}(a37_0x2ed8,0x61940));import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=[a37_0x43259c(0xd7),'development',a37_0x43259c(0xdb)];export function normalizeEnv(_0x1bafeb){const _0xd7298f=a37_0x43259c;return _0x1bafeb==='online'?_0xd7298f(0xd7):_0x1bafeb;}export function isProduction(_0x473140){return normalizeEnv(_0x473140)==='production';}function a37_0x597e(_0x3eddcb,_0x4f5fcd){_0x3eddcb=_0x3eddcb-0xcb;const _0x2ed81f=a37_0x2ed8();let _0x597e01=_0x2ed81f[_0x3eddcb];return _0x597e01;}export function isDaily(_0x3b4de6){return normalizeEnv(_0x3b4de6)==='daily';}export function isDev(_0x1d6bb8){const _0x550b6a=a37_0x43259c,_0x248bf1=normalizeEnv(_0x1d6bb8);return _0x248bf1===_0x550b6a(0xd3)||_0x248bf1==='dev';}let env=normalizeEnv(productEnv(a37_0x43259c(0xd8))||a37_0x43259c(0xd7));export function getEnv(){return env;}export function initEnv(_0xbdb96c){env=normalizeEnv(_0xbdb96c);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x555e8c=a38_0x3591;function a38_0x3d1a(){const _0x1df9da=['compress','1372890gsVoqJ','9936ukejFM','11011LZNTzQ','404nERYBQ','49QDsHiy','111516YWeoPd','3vLciKo','61890MRMQvf','json','330080PEOnsa','pretty','1224638MqKpAe','9728iHFldU','1539270BbvGqW','594PLHMXm'];a38_0x3d1a=function(){return _0x1df9da;};return a38_0x3d1a();}(function(_0x22a5ef,_0x2e7889){const _0xb46fda=a38_0x3591,_0xb79d81=_0x22a5ef();while(!![]){try{const _0x144eeb=-parseInt(_0xb46fda(0x7b))/0x1+-parseInt(_0xb46fda(0x79))/0x2*(-parseInt(_0xb46fda(0x84))/0x3)+-parseInt(_0xb46fda(0x81))/0x4*(parseInt(_0xb46fda(0x85))/0x5)+-parseInt(_0xb46fda(0x7e))/0x6*(parseInt(_0xb46fda(0x82))/0x7)+-parseInt(_0xb46fda(0x7a))/0x8*(parseInt(_0xb46fda(0x7f))/0x9)+parseInt(_0xb46fda(0x87))/0xa*(-parseInt(_0xb46fda(0x7c))/0xb)+-parseInt(_0xb46fda(0x83))/0xc*(-parseInt(_0xb46fda(0x80))/0xd);if(_0x144eeb===_0x2e7889)break;else _0xb79d81['push'](_0xb79d81['shift']());}catch(_0x374d16){_0xb79d81['push'](_0xb79d81['shift']());}}}(a38_0x3d1a,0xec311));function a38_0x3591(_0x663217,_0x3db63e){_0x663217=_0x663217-0x79;const _0x3d1ab7=a38_0x3d1a();let _0x359154=_0x3d1ab7[_0x663217];return _0x359154;}export const OUTPUT_FORMAT_VALUES=[a38_0x555e8c(0x86),a38_0x555e8c(0x88),a38_0x555e8c(0x7d)];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0x20bc83=a39_0x511e;(function(_0x1109a8,_0x155ba5){const _0x4dcb49=a39_0x511e,_0x5116b6=_0x1109a8();while(!![]){try{const _0x27518a=-parseInt(_0x4dcb49(0xf1))/0x1+-parseInt(_0x4dcb49(0xfd))/0x2*(parseInt(_0x4dcb49(0xe1))/0x3)+parseInt(_0x4dcb49(0xf6))/0x4*(-parseInt(_0x4dcb49(0xed))/0x5)+-parseInt(_0x4dcb49(0xee))/0x6+parseInt(_0x4dcb49(0xe0))/0x7+parseInt(_0x4dcb49(0xe8))/0x8+parseInt(_0x4dcb49(0xfc))/0x9;if(_0x27518a===_0x155ba5)break;else _0x5116b6['push'](_0x5116b6['shift']());}catch(_0x18b7ae){_0x5116b6['push'](_0x5116b6['shift']());}}}(a39_0x5bab,0x76228));export const PRODUCT_CONFIG={'cliBinName':a39_0x20bc83(0xf5),'cliDisplayName':a39_0x20bc83(0xe4),'npmPackageName':a39_0x20bc83(0xf4),'skillSource':a39_0x20bc83(0xe9),'npmRegistryBaseUrl':a39_0x20bc83(0xfb),'envPrefix':a39_0x20bc83(0xfa),'legacyEnvPrefixes':[a39_0x20bc83(0xe7)],'configFileNames':[a39_0x20bc83(0xe6),'.lovrabetrc'],'newConfigFileName':a39_0x20bc83(0xe6),'homeDirName':a39_0x20bc83(0xf7),'logFileName':a39_0x20bc83(0xf9),'invokeSource':a39_0x20bc83(0xe2),'userCenterDisplayName':a39_0x20bc83(0xf8),'skipNpxSkillsEnvSuffix':a39_0x20bc83(0xec),'domains':{'production':{'user':a39_0x20bc83(0xef),'api':'https://api.lovrabet.com','runtime':a39_0x20bc83(0xea)},'nonProduction':{'user':a39_0x20bc83(0xe5),'api':'https://daily-api.lovrabet.com','runtime':a39_0x20bc83(0xf3)}},'accessKeyCreatePath':a39_0x20bc83(0xf0)};export function productEnvName(_0x494f30){const _0x5c06e1=a39_0x20bc83;return PRODUCT_CONFIG[_0x5c06e1(0xeb)]+'_'+_0x494f30;}export function productEnvNames(_0x8b4e){const _0x590791=a39_0x20bc83;return[productEnvName(_0x8b4e),...PRODUCT_CONFIG[_0x590791(0xf2)][_0x590791(0xe3)](_0x2d3c4d=>_0x2d3c4d+'_'+_0x8b4e)];}export function productEnv(_0x488fc2){for(const _0x2e5a7d of productEnvNames(_0x488fc2)){const _0xb88ba2=process.env[_0x2e5a7d];if(_0xb88ba2!==undefined)return _0xb88ba2;}return undefined;}function a39_0x511e(_0x2fb2d9,_0x4bb552){_0x2fb2d9=_0x2fb2d9-0xe0;const _0x5bab80=a39_0x5bab();let _0x511eec=_0x5bab80[_0x2fb2d9];return _0x511eec;}function a39_0x5bab(){const _0x422311=['RABETBASE','4943736luMtVd','lovrabet/lovrabet-cli','https://runtime.lovrabet.com','envPrefix','SKIP_NPX_SKILLS','1010005FxVQkt','5081226bJJjfl','https://user.lovrabet.com','/user/ak','605943xwgyLc','legacyEnvPrefixes','https://daily-runtime.lovrabet.com','@lovrabet/lovrabet-cli','lovrabet','8ZbyMXS','.lovrabet','Lovrabet\x20User\x20Center','.lovrabet-runtime.log','LOVRABET','https://registry.npmjs.org','16607655fVYpYr','1806922ZSvJfs','5466265joLnHo','3RRSePp','cli:lovrabet-runtime','map','Lovrabet\x20Runtime\x20CLI','https://user-daily.lovrabet.com','.lovrabet.json'];a39_0x5bab=function(){return _0x422311;};return a39_0x5bab();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a40_0x323c9b=a40_0x2169;(function(_0x35c551,_0x4e2e13){const _0x259147=a40_0x2169,_0x3c726e=_0x35c551();while(!![]){try{const _0x3f3432=-parseInt(_0x259147(0x198))/0x1+-parseInt(_0x259147(0x19a))/0x2+-parseInt(_0x259147(0x1a0))/0x3*(-parseInt(_0x259147(0x19c))/0x4)+-parseInt(_0x259147(0x19d))/0x5*(parseInt(_0x259147(0x195))/0x6)+parseInt(_0x259147(0x19f))/0x7*(-parseInt(_0x259147(0x1a1))/0x8)+parseInt(_0x259147(0x19e))/0x9+parseInt(_0x259147(0x197))/0xa*(parseInt(_0x259147(0x19b))/0xb);if(_0x3f3432===_0x4e2e13)break;else _0x3c726e['push'](_0x3c726e['shift']());}catch(_0x19156a){_0x3c726e['push'](_0x3c726e['shift']());}}}(a40_0xce8a,0xa4297));export const RISK_LEVEL_VALUES=[a40_0x323c9b(0x199),a40_0x323c9b(0x196),a40_0x323c9b(0x194)];function a40_0x2169(_0x5c062d,_0x479f49){_0x5c062d=_0x5c062d-0x194;const _0xce8ab1=a40_0xce8a();let _0x216949=_0xce8ab1[_0x5c062d];return _0x216949;}function a40_0xce8a(){const _0x15e096=['read','1004646adIHUp','19522767aOBBfw','3000752cRQJwf','3930105UonpUG','3007314FqrawO','2833537qkvufj','3UTHqhU','16EwdEKA','high-risk-write','6XAKHVV','write','10PgOway','88798hKmumJ'];a40_0xce8a=function(){return _0x15e096;};return a40_0xce8a();}
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a41_0xad3e(_0x5495b3,_0x2310a9){_0x5495b3=_0x5495b3-0x85;const _0x592835=a41_0x5928();let _0xad3efb=_0x592835[_0x5495b3];return _0xad3efb;}const a41_0x171882=a41_0xad3e;(function(_0x5a9779,_0x55a8e8){const _0x527dee=a41_0xad3e,_0xe9f054=_0x5a9779();while(!![]){try{const _0x4ad39e=parseInt(_0x527dee(0x8c))/0x1*(-parseInt(_0x527dee(0x87))/0x2)+-parseInt(_0x527dee(0x91))/0x3+parseInt(_0x527dee(0x90))/0x4*(parseInt(_0x527dee(0x8d))/0x5)+parseInt(_0x527dee(0x89))/0x6*(-parseInt(_0x527dee(0x93))/0x7)+-parseInt(_0x527dee(0x8f))/0x8*(-parseInt(_0x527dee(0x85))/0x9)+-parseInt(_0x527dee(0x92))/0xa*(-parseInt(_0x527dee(0x86))/0xb)+parseInt(_0x527dee(0x88))/0xc*(parseInt(_0x527dee(0x8e))/0xd);if(_0x4ad39e===_0x55a8e8)break;else _0xe9f054['push'](_0xe9f054['shift']());}catch(_0x82cf4a){_0xe9f054['push'](_0xe9f054['shift']());}}}(a41_0x5928,0xe4e3d));import{PRODUCT_CONFIG}from'../constant/product.js';function a41_0x5928(){const _0x50de6a=['4hqBrpN','1812417XvaZjX','10IEGAOV','308rNcifH','7101DFPdCk','10267917gvDRmc','532MTzTNf','708AipTPc','228708isszUJ','production','accessKeyCreatePath','3986JXERhf','6530955ZllhcR','179049EwGIzW','12440MVZFif'];a41_0x5928=function(){return _0x50de6a;};return a41_0x5928();}export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG['domains'][a41_0x171882(0x8a)]['user']+PRODUCT_CONFIG[a41_0x171882(0x8b)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x43a54e=a42_0x36d6;(function(_0x1f70d5,_0x54176e){const _0x29bb98=a42_0x36d6,_0x46436b=_0x1f70d5();while(!![]){try{const _0x2af1c3=-parseInt(_0x29bb98(0x146))/0x1+parseInt(_0x29bb98(0x17a))/0x2+-parseInt(_0x29bb98(0x163))/0x3+parseInt(_0x29bb98(0x14e))/0x4+-parseInt(_0x29bb98(0x178))/0x5+-parseInt(_0x29bb98(0x171))/0x6+-parseInt(_0x29bb98(0x180))/0x7*(-parseInt(_0x29bb98(0x156))/0x8);if(_0x2af1c3===_0x54176e)break;else _0x46436b['push'](_0x46436b['shift']());}catch(_0x2c214c){_0x46436b['push'](_0x46436b['shift']());}}}(a42_0x19c2,0x62963));import{readFileSync,existsSync,mkdirSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvNames}from'./constant/product.js';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily,isDev}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';import{resolveCachedAppCode}from'./commands/app/cache.js';function a42_0x19c2(){const _0xdbb5d1=['setRawMode','2027650pdVzWW','stringify','1610312IOPtvH','error','read','VERBOSE','raw','object','14mbBIIe','configFileNames','riskLevel','setLogPath','.tmp','inherit','userDomain','defaultApp','projectConfig','authRequired','project','env','slice','ACCESS_KEY','461323nUFcNi','missing','locale','string','EXDEV','EPERM','join','EACCES','1357424YkHaUb','isTTY','code','argv','find','apps','global','true','3735800CbHcLK','utf8','online','cache','APPCODE','pageSize','parse','appcode','maxRisk','newConfigFileName','values','cwd','runtimeDomain','560775GIihmc','app','stdin','FORMAT','daily','nonInteractive','accessKey','explicit','high-risk-write','PAGE_SIZE','isRaw','production','stdout','trim','3725238OGMNHe','./constant/domain.js','globalConfig','format','development','top-level'];a42_0x19c2=function(){return _0xdbb5d1;};return a42_0x19c2();}export{AUTH_MODE,isAuthMode}from'./constant/auth-mode.js';const CONFIG_NAMES=PRODUCT_CONFIG[a42_0x43a54e(0x181)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0x43a54e(0x15f)];function resolveConfigPath(_0x13b9bc){for(const _0x20c879 of CONFIG_NAMES){const _0x1a9171=resolve(_0x13b9bc,_0x20c879);if(existsSync(_0x1a9171))return _0x1a9171;}return undefined;}export function resolveWriteConfigPath(_0xc38d86){const _0x43c16e=a42_0x43a54e,_0x562375=_0xc38d86==='project'?process[_0x43c16e(0x161)]():homedir(),_0x2ec14e=resolveConfigPath(_0x562375);return _0x2ec14e??resolve(_0x562375,NEW_CONFIG_NAME);}export function readConfigFile(_0x356986){const _0x21d60a=a42_0x43a54e;try{if(existsSync(_0x356986)){const _0x24046b=readFileSync(_0x356986,{'encoding':_0x21d60a(0x157)});if(_0x24046b){const _0x1aa137=JSON['parse'](_0x24046b);return migrateOnlineEnv(_0x356986,_0x1aa137),_0x1aa137;}}}catch{}return{};}function migrateOnlineEnv(_0x31fe5e,_0x206fc2){const _0x37a018=a42_0x43a54e;let _0x23812e=![];_0x206fc2['env']===_0x37a018(0x158)&&(_0x206fc2[_0x37a018(0x18b)]=_0x37a018(0x16e),_0x23812e=!![]);if(_0x206fc2['apps']&&typeof _0x206fc2[_0x37a018(0x153)]===_0x37a018(0x17f))for(const _0x276895 of Object[_0x37a018(0x160)](_0x206fc2['apps'])){_0x276895&&_0x276895[_0x37a018(0x18b)]===_0x37a018(0x158)&&(_0x276895[_0x37a018(0x18b)]=_0x37a018(0x16e),_0x23812e=!![]);}if(_0x23812e)try{writeConfigFile(_0x31fe5e,_0x206fc2);}catch{}}export function writeConfigFile(_0x5b5868,_0x36b7f5){const _0x2cad1c=a42_0x43a54e,_0x1776a2=dirname(_0x5b5868);!existsSync(_0x1776a2)&&mkdirSync(_0x1776a2,{'recursive':!![]});const _0x1abd32=_0x5b5868+_0x2cad1c(0x184);try{writeFileSync(_0x1abd32,JSON[_0x2cad1c(0x179)](_0x36b7f5,null,0x2)+'\x0a',{'encoding':_0x2cad1c(0x157),'mode':0x180});try{renameSync(_0x1abd32,_0x5b5868);}catch(_0x498c1d){if(_0x498c1d[_0x2cad1c(0x150)]===_0x2cad1c(0x14b)||_0x498c1d[_0x2cad1c(0x150)]===_0x2cad1c(0x14a)||_0x498c1d[_0x2cad1c(0x150)]===_0x2cad1c(0x14d)){writeFileSync(_0x5b5868,JSON[_0x2cad1c(0x179)](_0x36b7f5,null,0x2)+'\x0a',{'encoding':_0x2cad1c(0x157)});try{unlinkSync(_0x1abd32);}catch{}}else throw _0x498c1d;}}catch(_0x619c6){try{unlinkSync(_0x1abd32);}catch{}throw _0x619c6;}}export function isNonInteractiveMode(_0x139376){const _0x2b78fb=a42_0x43a54e;return!!(_0x139376[_0x2b78fb(0x168)]||_0x139376['ci']||productEnvNames('CI')['some'](_0x468a05=>process.env[_0x468a05]==='true')||process.env.CI===_0x2b78fb(0x155)||!process[_0x2b78fb(0x16f)]['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x380bd8=a42_0x43a54e;if(!process[_0x380bd8(0x165)][_0x380bd8(0x14f)])return![];try{const _0x5b2854=process[_0x380bd8(0x165)][_0x380bd8(0x16d)];return process[_0x380bd8(0x165)][_0x380bd8(0x177)](!![]),process[_0x380bd8(0x165)]['setRawMode'](_0x5b2854??![]),!![];}catch{return![];}}export async function createContext(_0x412b0e){const _0x1496b7=a42_0x43a54e,_0x1d660c=readRawConfig(),_0x29324f=buildConfig(_0x1d660c,_0x412b0e);await initGlobalEnvironment(_0x29324f);const {getUserDomain:_0x8699e7,getApiDomain:_0xd4aef7}=await import(_0x1496b7(0x172)),_0x45a860={'apiDomain':_0xd4aef7(),'userDomain':_0x8699e7()},_0x929a24=await buildAuth(_0x29324f);logger[_0x1496b7(0x183)](process[_0x1496b7(0x161)]());const _0x4c90c1=(CLI_BIN_NAME+'\x20'+process[_0x1496b7(0x151)][_0x1496b7(0x18c)](0x2)[_0x1496b7(0x14c)]('\x20'))[_0x1496b7(0x170)]();logger['setRawCommand'](_0x4c90c1);const _0x487228=isNonInteractiveMode(_0x412b0e);return{'config':_0x29324f,'auth':_0x929a24,'logger':logger,'env':_0x45a860,'nonInteractive':_0x487228};}export function buildConfigFromFlags(_0x4224fd){return buildConfig(readRawConfig(),_0x4224fd);}export function getLocalAppAliases(_0x22a532){const _0x4ca3c8=a42_0x43a54e;return _0x22a532[_0x4ca3c8(0x153)]&&typeof _0x22a532[_0x4ca3c8(0x153)]===_0x4ca3c8(0x17f)?_0x22a532[_0x4ca3c8(0x153)]:{};}function a42_0x36d6(_0x5c44f0,_0x25f0a0){_0x5c44f0=_0x5c44f0-0x145;const _0x19c249=a42_0x19c2();let _0x36d6b0=_0x19c249[_0x5c44f0];return _0x36d6b0;}export function resolveLocalAppAliasCode(_0x2e3b47,_0x458df8){const _0x12ff51=a42_0x43a54e;if(!_0x458df8)return undefined;const _0x5687df=getLocalAppAliases(_0x2e3b47)[_0x458df8],_0xe76a19=_0x5687df?.[_0x12ff51(0x15d)];return typeof _0xe76a19===_0x12ff51(0x149)&&_0xe76a19['trim']()?_0xe76a19[_0x12ff51(0x170)]():undefined;}export function readAppCodeFromConfig(){const _0x44f0b1=a42_0x43a54e,_0x364b47=readRawConfig(),_0x3ca518=_0x364b47[_0x44f0b1(0x15d)]??_0x364b47['app'];if(typeof _0x3ca518===_0x44f0b1(0x149)&&_0x3ca518[_0x44f0b1(0x170)]())return _0x3ca518[_0x44f0b1(0x170)]();const _0x58fb44=resolveLocalAppAliasCode(_0x364b47,typeof _0x364b47[_0x44f0b1(0x187)]===_0x44f0b1(0x149)?_0x364b47[_0x44f0b1(0x187)]:undefined);if(_0x58fb44)return _0x58fb44;const _0x3b449e=normalizeEnv(String(_0x364b47['env']||_0x44f0b1(0x16e))),_0x136fb4=isDaily(_0x3b449e)?'daily':isDev(_0x3b449e)?'development':_0x44f0b1(0x16e),_0x3e9e42=resolveCachedAppCode(typeof _0x364b47[_0x44f0b1(0x187)]===_0x44f0b1(0x149)?_0x364b47[_0x44f0b1(0x187)]:undefined,_0x136fb4,typeof _0x364b47[_0x44f0b1(0x169)]===_0x44f0b1(0x149)?_0x364b47['accessKey']:undefined);if(_0x3e9e42)return _0x3e9e42;const _0x2d5e6f=Object[_0x44f0b1(0x160)](getLocalAppAliases(_0x364b47))[_0x44f0b1(0x152)](_0x4bed19=>_0x4bed19?.[_0x44f0b1(0x15d)]);return typeof _0x2d5e6f?.['appcode']===_0x44f0b1(0x149)&&_0x2d5e6f[_0x44f0b1(0x15d)]['trim']()?_0x2d5e6f['appcode'][_0x44f0b1(0x170)]():undefined;}export function readScopedConfig(_0x1c2930){const _0x127eb5=a42_0x43a54e,_0x38271f=_0x1c2930[_0x127eb5(0x154)]?_0x127eb5(0x154):_0x127eb5(0x18a);return readConfigFile(resolveWriteConfigPath(_0x38271f));}export function writeScopedConfig(_0x1af605,_0x2a0d5a){const _0x90c864=a42_0x43a54e,_0x42fc10=_0x2a0d5a['global']?_0x90c864(0x154):_0x90c864(0x18a);writeConfigFile(resolveWriteConfigPath(_0x42fc10),_0x1af605);}export async function initGlobalEnvironment(_0x4f985f){const _0xce869a=a42_0x43a54e,{initEnv:_0x3372e5}=await import('./constant/env.js');_0x3372e5(_0x4f985f[_0xce869a(0x18b)]);const {initDomains:_0xfe8aa1}=await import(_0xce869a(0x172));_0xfe8aa1({'apiDomain':_0x4f985f[_0xce869a(0x17e)]['apiDomain']||_0x4f985f['raw']['host']||undefined,'userDomain':_0x4f985f['raw'][_0xce869a(0x186)]||undefined,'runtimeDomain':_0x4f985f[_0xce869a(0x17e)][_0xce869a(0x162)]||undefined});}export function getProjectConfigPath(){const _0x34c4e7=a42_0x43a54e;return resolveConfigPath(process[_0x34c4e7(0x161)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x1c2270){const _0x50b3a5=a42_0x43a54e;if(!existsSync(_0x1c2270))return{'status':_0x50b3a5(0x147)};try{const _0x4db931=readFileSync(_0x1c2270,{'encoding':_0x50b3a5(0x157)});if(!_0x4db931?.['trim']())return{'status':'empty'};const _0x5ec9b5=JSON[_0x50b3a5(0x15c)](_0x4db931);return{'status':'ok','data':_0x5ec9b5};}catch(_0x55f3cf){return{'status':_0x50b3a5(0x17b),'message':_0x55f3cf instanceof Error?_0x55f3cf['message']:String(_0x55f3cf)};}}export function loadRawConfigLayers(_0x194429){const _0x11b073=a42_0x43a54e;let _0x14dcc4={},_0x1f06cd={},_0x57eb95,_0x11675c;try{_0x57eb95=resolveConfigPath(homedir());if(_0x57eb95){const _0x2816e2=readFileSync(_0x57eb95,{'encoding':_0x11b073(0x157)});if(_0x2816e2)_0x14dcc4=JSON[_0x11b073(0x15c)](_0x2816e2);}}catch{}try{const _0x5e8cac=_0x194429||process[_0x11b073(0x161)]();_0x11675c=resolveConfigPath(_0x5e8cac);if(_0x11675c){const _0x6d45d3=readFileSync(_0x11675c,{'encoding':'utf8'});if(_0x6d45d3)_0x1f06cd=JSON[_0x11b073(0x15c)](_0x6d45d3);}}catch{}return{'globalPath':_0x57eb95,'projectPath':_0x11675c,'globalConfig':_0x14dcc4,'projectConfig':_0x1f06cd};}function mergeRawConfigLayers(_0x11ed21){const _0x26437b=a42_0x43a54e,{globalConfig:_0x5802a7,projectConfig:_0x174dc2}=_0x11ed21;if(_0x174dc2['inherit']===![]){const _0x2fb668={..._0x174dc2};return delete _0x2fb668[_0x26437b(0x185)],_0x2fb668;}const _0x2ae215={..._0x5802a7,..._0x174dc2};if(_0x26437b(0x187)in _0x174dc2)_0x2ae215[_0x26437b(0x187)]=_0x174dc2['defaultApp'];else _0x5802a7[_0x26437b(0x187)]&&(_0x2ae215[_0x26437b(0x187)]=_0x5802a7[_0x26437b(0x187)]);return _0x2ae215;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x585b4a){return mergeRawConfigLayers(loadRawConfigLayers(_0x585b4a));}export function readRawConfigWithLayers(_0x31443a){const _0x1ebb4b=loadRawConfigLayers(_0x31443a);return{'config':mergeRawConfigLayers(_0x1ebb4b),'layers':_0x1ebb4b};}export function resolveDefaultAppSource(_0x23df88){const _0xeb681b=a42_0x43a54e;if(_0xeb681b(0x187)in _0x23df88[_0xeb681b(0x188)])return _0xeb681b(0x18a);if(_0x23df88[_0xeb681b(0x188)][_0xeb681b(0x185)]===![])return null;if(_0x23df88[_0xeb681b(0x173)][_0xeb681b(0x187)])return _0xeb681b(0x154);return null;}function buildConfig(_0x26ae87,_0x5ee81e){const _0x1250c5=a42_0x43a54e,_0x21545b=_0x26ae87[_0x1250c5(0x187)]||undefined,_0x5655fd=_0x5ee81e['app']||env('APP')||undefined,_0x34a87e=_0x5655fd||_0x21545b||undefined,_0x55abcd=env(_0x1250c5(0x145))||_0x26ae87[_0x1250c5(0x169)]||undefined,_0x5e0c34=_0x5ee81e['env']||env('ENV')||_0x26ae87[_0x1250c5(0x18b)]||DEFAULT_CONFIG_VALUES[_0x1250c5(0x18b)],_0xd29e83=normalizeEnv(String(_0x5e0c34)),_0x528824=isDaily(_0xd29e83)?_0x1250c5(0x167):isDev(_0xd29e83)?_0x1250c5(0x175):_0x1250c5(0x16e),_0x3a7d1b=resolveLocalAppAliasCode(_0x26ae87,_0x34a87e),_0x494d55=resolveCachedAppCode(_0x34a87e,_0x528824,_0x55abcd),_0x46dd22=typeof _0x5ee81e[_0x1250c5(0x15d)]==='string'?_0x5ee81e['appcode']:undefined,_0x56a886=env(_0x1250c5(0x15a)),_0x4eb45e=_0x5655fd?undefined:_0x26ae87[_0x1250c5(0x15d)]||_0x26ae87[_0x1250c5(0x164)]||undefined,_0x151fdc=_0x46dd22||_0x56a886||_0x3a7d1b||_0x494d55||_0x4eb45e||undefined,_0x1fa5cd=_0x46dd22?_0x1250c5(0x16a):_0x56a886?_0x1250c5(0x18b):_0x3a7d1b?'local-alias':_0x494d55?_0x1250c5(0x159):_0x4eb45e?_0x1250c5(0x176):undefined,_0x2f4153=_0x26ae87[_0x1250c5(0x148)]||DEFAULT_CONFIG_VALUES[_0x1250c5(0x148)],_0x5b9478=undefined,_0x3a53a7=_0x5ee81e[_0x1250c5(0x174)]||env(_0x1250c5(0x166))||_0x26ae87['format'],_0x698120=normalizeLegacyOutputFormat(_0x3a53a7),_0x4b11df=env(_0x1250c5(0x16c))||_0x26ae87[_0x1250c5(0x15b)],_0x25aaee=_0x4b11df?Number(_0x4b11df)||undefined:undefined,_0x29c656=_0x26ae87[_0x1250c5(0x182)]||_0x26ae87[_0x1250c5(0x15e)],_0x3fd734=_0x29c656===_0x1250c5(0x17c)||_0x29c656==='write'||_0x29c656===_0x1250c5(0x16b)?_0x29c656:DEFAULT_CONFIG_VALUES[_0x1250c5(0x182)],_0x3d477a=env(_0x1250c5(0x17d)),_0x1b6502=_0x3d477a==='1'||_0x3d477a===_0x1250c5(0x155);return{'appCode':typeof _0x151fdc===_0x1250c5(0x149)&&_0x151fdc[_0x1250c5(0x170)]()?_0x151fdc[_0x1250c5(0x170)]():undefined,'appCodeSource':_0x1fa5cd,'env':_0x528824,'locale':_0x2f4153,'cookie':_0x5b9478,'accessKey':_0x55abcd,'format':_0x698120,'pageSize':_0x25aaee,'riskLevel':_0x3fd734,'verbose':_0x1b6502,'defaultApp':_0x21545b,'currentApp':typeof _0x34a87e===_0x1250c5(0x149)?_0x34a87e:undefined,'raw':_0x26ae87};}function env(_0x39856c){return productEnv(_0x39856c);}async function buildAuth(_0x144b3f){const _0x3fc052=a42_0x43a54e,_0x5d427e='',_0x2f23a8=!!_0x144b3f[_0x3fc052(0x169)];return{'cookie':_0x5d427e,'isLoggedIn':_0x2f23a8,async 'getOrLogin'(){const _0x2cb82e=_0x3fc052;if(_0x2f23a8)return _0x5d427e;throw CliErrors[_0x2cb82e(0x189)]();}};}
|
|
1
|
+
const a42_0x19e65d=a42_0x42c0;(function(_0x1775c8,_0x1e9827){const _0x1e6fa3=a42_0x42c0,_0xa4b9a6=_0x1775c8();while(!![]){try{const _0x5b0e20=-parseInt(_0x1e6fa3(0x10a))/0x1+parseInt(_0x1e6fa3(0x12b))/0x2*(parseInt(_0x1e6fa3(0x125))/0x3)+-parseInt(_0x1e6fa3(0x131))/0x4*(parseInt(_0x1e6fa3(0x140))/0x5)+-parseInt(_0x1e6fa3(0x117))/0x6+parseInt(_0x1e6fa3(0x13e))/0x7*(parseInt(_0x1e6fa3(0x127))/0x8)+parseInt(_0x1e6fa3(0x110))/0x9+parseInt(_0x1e6fa3(0x146))/0xa;if(_0x5b0e20===_0x1e9827)break;else _0xa4b9a6['push'](_0xa4b9a6['shift']());}catch(_0x4ebaa9){_0xa4b9a6['push'](_0xa4b9a6['shift']());}}}(a42_0x54c3,0x39e6b));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_0x19e65d(0x122)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0x19e65d(0x12e)];function resolveConfigPath(_0x715f4d){for(const _0x595365 of CONFIG_NAMES){const _0x18204f=resolve(_0x715f4d,_0x595365);if(existsSync(_0x18204f))return _0x18204f;}return undefined;}export function resolveWriteConfigPath(_0x4b580f){const _0x359ccf=a42_0x19e65d,_0x2833c2=_0x4b580f===_0x359ccf(0x113)?process['cwd']():homedir(),_0x37b5de=resolveConfigPath(_0x2833c2);return _0x37b5de??resolve(_0x2833c2,NEW_CONFIG_NAME);}export function readConfigFile(_0x5d474f){const _0x5da863=a42_0x19e65d;try{if(existsSync(_0x5d474f)){const _0xf2de65=readFileSync(_0x5d474f,{'encoding':_0x5da863(0x120)});if(_0xf2de65){const _0x199b0e=JSON[_0x5da863(0x134)](_0xf2de65);return migrateOnlineEnv(_0x5d474f,_0x199b0e),_0x199b0e;}}}catch{}return{};}function migrateOnlineEnv(_0x2b0c38,_0x38a73f){const _0x2b59d2=a42_0x19e65d;let _0x32f9f1=![];_0x38a73f[_0x2b59d2(0x10d)]===_0x2b59d2(0x129)&&(_0x38a73f[_0x2b59d2(0x10d)]=_0x2b59d2(0x128),_0x32f9f1=!![]);if(_0x38a73f[_0x2b59d2(0x115)]&&typeof _0x38a73f[_0x2b59d2(0x115)]===_0x2b59d2(0x135))for(const _0x3467d7 of Object[_0x2b59d2(0x11a)](_0x38a73f[_0x2b59d2(0x115)])){_0x3467d7&&_0x3467d7[_0x2b59d2(0x10d)]===_0x2b59d2(0x129)&&(_0x3467d7[_0x2b59d2(0x10d)]=_0x2b59d2(0x128),_0x32f9f1=!![]);}if(_0x32f9f1)try{writeConfigFile(_0x2b0c38,_0x38a73f);}catch{}}function a42_0x54c3(){const _0x5447ac=['308252lhyscW','APP','raw','env','message','argv','2158821LWmUwn','high-risk-write','APPCODE','project','missing','apps','./constant/domain.js','1916580YMeaRD','stdout','setLogPath','values','true','appcode','explicit','stdin','EACCES','utf8','./constant/env.js','configFileNames','projectConfig','accessKey','409953TnFLVs','format','8qJYJsP','production','online','runtimeDomain','2GlWtqB','EPERM','isRaw','newConfigFileName','stringify','string','4TVYjdp','locale','setRawCommand','parse','object','isTTY','empty','setRawMode','global','PAGE_SIZE','error','host','trim','1073191XYitZk','local-alias','1469690NEXYpj','defaultApp','VERBOSE','EXDEV','code','apiDomain','6289500nqEjpx','some','ACCESS_KEY','daily','cwd','slice','riskLevel','read','top-level','inherit','cache','app','development','authRequired'];a42_0x54c3=function(){return _0x5447ac;};return a42_0x54c3();}export function writeConfigFile(_0x2adf52,_0x530029){const _0x3a6d50=a42_0x19e65d,_0x87cf1e=dirname(_0x2adf52);!existsSync(_0x87cf1e)&&mkdirSync(_0x87cf1e,{'recursive':!![]});const _0x8d1e53=_0x2adf52+'.tmp';try{writeFileSync(_0x8d1e53,JSON[_0x3a6d50(0x12f)](_0x530029,null,0x2)+'\x0a',{'encoding':_0x3a6d50(0x120),'mode':0x180});try{renameSync(_0x8d1e53,_0x2adf52);}catch(_0x219d02){if(_0x219d02[_0x3a6d50(0x144)]===_0x3a6d50(0x12c)||_0x219d02[_0x3a6d50(0x144)]===_0x3a6d50(0x143)||_0x219d02[_0x3a6d50(0x144)]===_0x3a6d50(0x11f)){writeFileSync(_0x2adf52,JSON[_0x3a6d50(0x12f)](_0x530029,null,0x2)+'\x0a',{'encoding':_0x3a6d50(0x120)});try{unlinkSync(_0x8d1e53);}catch{}}else throw _0x219d02;}}catch(_0x2095cb){try{unlinkSync(_0x8d1e53);}catch{}throw _0x2095cb;}}export function isNonInteractiveMode(_0x261bc4){const _0x33018b=a42_0x19e65d;return!!(_0x261bc4['nonInteractive']||_0x261bc4['ci']||productEnvNames('CI')[_0x33018b(0x147)](_0x4221a4=>process.env[_0x4221a4]===_0x33018b(0x11b))||process.env.CI==='true'||!process[_0x33018b(0x118)][_0x33018b(0x136)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x54e48a=a42_0x19e65d;if(!process[_0x54e48a(0x11e)][_0x54e48a(0x136)])return![];try{const _0x3250f1=process['stdin'][_0x54e48a(0x12d)];return process[_0x54e48a(0x11e)][_0x54e48a(0x138)](!![]),process['stdin'][_0x54e48a(0x138)](_0x3250f1??![]),!![];}catch{return![];}}export async function createContext(_0x43410d){const _0x7448bb=a42_0x19e65d,_0x297c2d=readRawConfig(),_0x4d8610=buildConfig(_0x297c2d,_0x43410d);await initGlobalEnvironment(_0x4d8610);const {getUserDomain:_0x371e9e,getApiDomain:_0xc76366}=await import(_0x7448bb(0x116)),_0x444ccb={'apiDomain':_0xc76366(),'userDomain':_0x371e9e()},_0x344591=await buildAuth(_0x4d8610);logger[_0x7448bb(0x119)](process[_0x7448bb(0x100)]());const _0x1e55db=(CLI_BIN_NAME+'\x20'+process[_0x7448bb(0x10f)][_0x7448bb(0x101)](0x2)['join']('\x20'))[_0x7448bb(0x13d)]();logger[_0x7448bb(0x133)](_0x1e55db);const _0x17cc5=isNonInteractiveMode(_0x43410d);return{'config':_0x4d8610,'auth':_0x344591,'logger':logger,'env':_0x444ccb,'nonInteractive':_0x17cc5};}export function buildConfigFromFlags(_0x28d0fb){return buildConfig(readRawConfig(),_0x28d0fb);}export function getLocalAppAliases(_0x3190b8){const _0x451c80=a42_0x19e65d;return _0x3190b8['apps']&&typeof _0x3190b8[_0x451c80(0x115)]==='object'?_0x3190b8[_0x451c80(0x115)]:{};}export function resolveLocalAppAliasCode(_0x3f01f4,_0x45a46a){const _0x445655=a42_0x19e65d;if(!_0x45a46a)return undefined;const _0x46f47a=getLocalAppAliases(_0x3f01f4)[_0x45a46a],_0x483dd5=_0x46f47a?.[_0x445655(0x11c)];return typeof _0x483dd5==='string'&&_0x483dd5[_0x445655(0x13d)]()?_0x483dd5[_0x445655(0x13d)]():undefined;}export function readAppCodeFromConfig(){const _0x44324e=a42_0x19e65d,_0x561296=readRawConfig(),_0xbbbf58=_0x561296[_0x44324e(0x11c)]??_0x561296[_0x44324e(0x107)];if(typeof _0xbbbf58===_0x44324e(0x130)&&_0xbbbf58['trim']())return _0xbbbf58['trim']();const _0x4c0164=resolveLocalAppAliasCode(_0x561296,typeof _0x561296[_0x44324e(0x141)]===_0x44324e(0x130)?_0x561296['defaultApp']:undefined);if(_0x4c0164)return _0x4c0164;const _0x310e6f=normalizeEnv(String(_0x561296[_0x44324e(0x10d)]||_0x44324e(0x128))),_0x380a32=isDaily(_0x310e6f)?_0x44324e(0xff):isDev(_0x310e6f)?_0x44324e(0x108):'production',_0x199023=resolveCachedAppCode(typeof _0x561296['defaultApp']===_0x44324e(0x130)?_0x561296[_0x44324e(0x141)]:undefined,_0x380a32,typeof _0x561296[_0x44324e(0x124)]===_0x44324e(0x130)?_0x561296['accessKey']:undefined);if(_0x199023)return _0x199023;const _0x32b3e0=Object[_0x44324e(0x11a)](getLocalAppAliases(_0x561296))['find'](_0x47c67d=>_0x47c67d?.[_0x44324e(0x11c)]);return typeof _0x32b3e0?.[_0x44324e(0x11c)]==='string'&&_0x32b3e0[_0x44324e(0x11c)][_0x44324e(0x13d)]()?_0x32b3e0[_0x44324e(0x11c)][_0x44324e(0x13d)]():undefined;}export function readScopedConfig(_0xdf00af){const _0x2e0ada=a42_0x19e65d,_0x197d56=_0xdf00af[_0x2e0ada(0x139)]?_0x2e0ada(0x139):_0x2e0ada(0x113);return readConfigFile(resolveWriteConfigPath(_0x197d56));}export function writeScopedConfig(_0x588e0a,_0x477bd0){const _0x5c66d1=a42_0x19e65d,_0x55c7cc=_0x477bd0[_0x5c66d1(0x139)]?_0x5c66d1(0x139):_0x5c66d1(0x113);writeConfigFile(resolveWriteConfigPath(_0x55c7cc),_0x588e0a);}export async function initGlobalEnvironment(_0x1d2b30){const _0x5bb055=a42_0x19e65d,{initEnv:_0x4560a}=await import(_0x5bb055(0x121));_0x4560a(_0x1d2b30[_0x5bb055(0x10d)]);const {initDomains:_0x440ec3}=await import('./constant/domain.js');_0x440ec3({'apiDomain':_0x1d2b30[_0x5bb055(0x10c)][_0x5bb055(0x145)]||_0x1d2b30[_0x5bb055(0x10c)][_0x5bb055(0x13c)]||undefined,'userDomain':_0x1d2b30[_0x5bb055(0x10c)]['userDomain']||undefined,'runtimeDomain':_0x1d2b30[_0x5bb055(0x10c)][_0x5bb055(0x12a)]||undefined});}export function getProjectConfigPath(){const _0x26af1a=a42_0x19e65d;return resolveConfigPath(process[_0x26af1a(0x100)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0xb401ea){const _0x2313e2=a42_0x19e65d;if(!existsSync(_0xb401ea))return{'status':_0x2313e2(0x114)};try{const _0x1c771b=readFileSync(_0xb401ea,{'encoding':_0x2313e2(0x120)});if(!_0x1c771b?.[_0x2313e2(0x13d)]())return{'status':_0x2313e2(0x137)};const _0x19e8ef=JSON[_0x2313e2(0x134)](_0x1c771b);return{'status':'ok','data':_0x19e8ef};}catch(_0x45eaa0){return{'status':_0x2313e2(0x13b),'message':_0x45eaa0 instanceof Error?_0x45eaa0[_0x2313e2(0x10e)]:String(_0x45eaa0)};}}export function loadRawConfigLayers(_0x442a56){const _0x590f03=a42_0x19e65d;let _0x53bd22={},_0x515aea={},_0x400de4,_0x841049;try{_0x400de4=resolveConfigPath(homedir());if(_0x400de4){const _0x37b0f1=readFileSync(_0x400de4,{'encoding':_0x590f03(0x120)});if(_0x37b0f1)_0x53bd22=JSON['parse'](_0x37b0f1);}}catch{}try{const _0x56107a=_0x442a56||process[_0x590f03(0x100)]();_0x841049=resolveConfigPath(_0x56107a);if(_0x841049){const _0x2fab5e=readFileSync(_0x841049,{'encoding':'utf8'});if(_0x2fab5e)_0x515aea=JSON[_0x590f03(0x134)](_0x2fab5e);}}catch{}return{'globalPath':_0x400de4,'projectPath':_0x841049,'globalConfig':_0x53bd22,'projectConfig':_0x515aea};}function mergeRawConfigLayers(_0x1545bc){const _0x384a85=a42_0x19e65d,{globalConfig:_0x355579,projectConfig:_0x4e44b6}=_0x1545bc;if(_0x4e44b6[_0x384a85(0x105)]===![]){const _0x3c2ad6={..._0x4e44b6};return delete _0x3c2ad6[_0x384a85(0x105)],_0x3c2ad6;}const _0xbf2285={..._0x355579,..._0x4e44b6};if(_0x384a85(0x141)in _0x4e44b6)_0xbf2285[_0x384a85(0x141)]=_0x4e44b6['defaultApp'];else _0x355579[_0x384a85(0x141)]&&(_0xbf2285[_0x384a85(0x141)]=_0x355579[_0x384a85(0x141)]);return _0xbf2285;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x5e315f){return mergeRawConfigLayers(loadRawConfigLayers(_0x5e315f));}export function readRawConfigWithLayers(_0x139539){const _0x3edcee=loadRawConfigLayers(_0x139539);return{'config':mergeRawConfigLayers(_0x3edcee),'layers':_0x3edcee};}export function resolveDefaultAppSource(_0x401a5e){const _0x40ed02=a42_0x19e65d;if('defaultApp'in _0x401a5e[_0x40ed02(0x123)])return _0x40ed02(0x113);if(_0x401a5e[_0x40ed02(0x123)][_0x40ed02(0x105)]===![])return null;if(_0x401a5e['globalConfig'][_0x40ed02(0x141)])return _0x40ed02(0x139);return null;}function a42_0x42c0(_0x2460d8,_0x30d956){_0x2460d8=_0x2460d8-0xfe;const _0x54c39f=a42_0x54c3();let _0x42c0b1=_0x54c39f[_0x2460d8];return _0x42c0b1;}function buildConfig(_0x121040,_0x24928e){const _0x5811f5=a42_0x19e65d,_0x305c43=_0x121040['defaultApp']||undefined,_0x4eb909=_0x24928e[_0x5811f5(0x107)]||env(_0x5811f5(0x10b))||undefined,_0x9c1328=_0x4eb909||_0x305c43||undefined,_0x190049=env(_0x5811f5(0xfe))||_0x121040['accessKey']||undefined,_0x1e9b6a=_0x24928e['env']||env('ENV')||_0x121040[_0x5811f5(0x10d)]||DEFAULT_CONFIG_VALUES['env'],_0x242d04=normalizeEnv(String(_0x1e9b6a)),_0xabb2af=isDaily(_0x242d04)?'daily':isDev(_0x242d04)?_0x5811f5(0x108):'production',_0x507b30=resolveLocalAppAliasCode(_0x121040,_0x9c1328),_0x3bb7f9=resolveCachedAppCode(_0x9c1328,_0xabb2af,_0x190049),_0x200614=typeof _0x24928e[_0x5811f5(0x11c)]==='string'?_0x24928e[_0x5811f5(0x11c)]:undefined,_0x2818a0=env(_0x5811f5(0x112)),_0x17c82e=_0x4eb909?undefined:_0x121040[_0x5811f5(0x11c)]||_0x121040[_0x5811f5(0x107)]||undefined,_0x18be27=_0x200614||_0x2818a0||_0x507b30||_0x3bb7f9||_0x17c82e||undefined,_0x141c23=_0x200614?_0x5811f5(0x11d):_0x2818a0?'env':_0x507b30?_0x5811f5(0x13f):_0x3bb7f9?_0x5811f5(0x106):_0x17c82e?_0x5811f5(0x104):undefined,_0x4bc94a=_0x121040[_0x5811f5(0x132)]||DEFAULT_CONFIG_VALUES[_0x5811f5(0x132)],_0x2b419c=undefined,_0x2c5e72=_0x24928e[_0x5811f5(0x126)]||env('FORMAT')||_0x121040[_0x5811f5(0x126)],_0x586bf7=normalizeLegacyOutputFormat(_0x2c5e72),_0x39efbc=env(_0x5811f5(0x13a))||_0x121040['pageSize'],_0x58d1b4=_0x39efbc?Number(_0x39efbc)||undefined:undefined,_0x1d309c=_0x121040[_0x5811f5(0x102)]||_0x121040['maxRisk'],_0x53b741=_0x1d309c===_0x5811f5(0x103)||_0x1d309c==='write'||_0x1d309c===_0x5811f5(0x111)?_0x1d309c:DEFAULT_CONFIG_VALUES[_0x5811f5(0x102)],_0x1a1814=env(_0x5811f5(0x142)),_0x275105=_0x1a1814==='1'||_0x1a1814===_0x5811f5(0x11b);return{'appCode':typeof _0x18be27===_0x5811f5(0x130)&&_0x18be27['trim']()?_0x18be27[_0x5811f5(0x13d)]():undefined,'appCodeSource':_0x141c23,'env':_0xabb2af,'locale':_0x4bc94a,'cookie':_0x2b419c,'accessKey':_0x190049,'format':_0x586bf7,'pageSize':_0x58d1b4,'riskLevel':_0x53b741,'verbose':_0x275105,'defaultApp':_0x305c43,'currentApp':typeof _0x9c1328==='string'?_0x9c1328:undefined,'raw':_0x121040};}function env(_0x25264e){return productEnv(_0x25264e);}async function buildAuth(_0xd9853){const _0x16f214='',_0x52b837=!!_0xd9853['accessKey'];return{'cookie':_0x16f214,'isLoggedIn':_0x52b837,async 'getOrLogin'(){const _0x59394c=a42_0x42c0;if(_0x52b837)return _0x16f214;throw CliErrors[_0x59394c(0x109)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5574a0,_0x11ed2c){const _0x4b1bf5=a43_0x431b,_0x2f5eb7=_0x5574a0();while(!![]){try{const _0x4fa089=parseInt(_0x4b1bf5(0x104))/0x1+-parseInt(_0x4b1bf5(0x103))/0x2*(-parseInt(_0x4b1bf5(0x128))/0x3)+parseInt(_0x4b1bf5(0x132))/0x4+parseInt(_0x4b1bf5(0x112))/0x5+-parseInt(_0x4b1bf5(0x134))/0x6*(parseInt(_0x4b1bf5(0x105))/0x7)+-parseInt(_0x4b1bf5(0x102))/0x8*(-parseInt(_0x4b1bf5(0x126))/0x9)+-parseInt(_0x4b1bf5(0x133))/0xa;if(_0x4fa089===_0x11ed2c)break;else _0x2f5eb7['push'](_0x2f5eb7['shift']());}catch(_0x147297){_0x2f5eb7['push'](_0x2f5eb7['shift']());}}}(a43_0x70f5,0x43c30));import{getRuntimeDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';function a43_0x70f5(){const _0x18e81a=['filter','success','3780603NyYiKl','json','1383876hPzJmu','/client/dataset/list','Check\x20your\x20credentials\x20and\x20try\x20again.','Configure\x20accessKey\x20in\x20','invokeSource','/client/dataset/query?','Request\x20timeout:\x20','/client/skill/personal/create','POST','status','434760YTmsRp','8375880mtRjUr','6WQZepQ','apiError','topK','/client/knowledge-base/personal/create','authRequired','?appCode=','Knowledge-base\x20entry\x20not\x20found:\x20id=','message','data','8hKtbrj','2EwQfgi','14617FVcJGh','78295jiIfNT','errorCode','BFF\x20script\x20not\x20found:\x20id=','/client/knowledge-base/personal/list?appCode=','/client/skill/personal/list?appCode=','object','SQL\x20query\x20not\x20found:\x20','abort','GET','newConfigFileName','sqlCode','query','AbortError','608295LLaJiU','API\x20error\x20code:\x20','/client/skill/personal/','/update','errorMsg','test','isArray','/client/app/my-apps','/client/knowledge-base/search','/client/user/loginUserInfo','/client/bff/query/','code','tableData','name','/client/knowledge-base/personal/','validation','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','string'];a43_0x70f5=function(){return _0x18e81a;};return a43_0x70f5();}import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0x519092){_activeAK=_0x519092||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0xc5c8f6,_0x572706={}){const _0x4b6082=a43_0x431b,{method:method=_0x4b6082(0x10d),body:_0x334b80,headers:headers={},timeout:timeout=0x7530}=_0x572706,_0x4e3252=_activeAK,_0x4fefd8=getRuntimeDomain();if(!_0x4e3252)throw CliErrors[_0x4b6082(0x138)](_0x4b6082(0x12b)+PRODUCT_CONFIG[_0x4b6082(0x10e)]+'.');const _0xbb98ca=''+_0x4fefd8+_0xc5c8f6,_0x55e7a2={'X-User-AK':_0x4e3252},_0x4f00f3=new AbortController(),_0x3ea8ef=setTimeout(()=>_0x4f00f3[_0x4b6082(0x10c)](),timeout);try{const _0x1d0553=await fetch(_0xbb98ca,{'method':method,'headers':{'Content-Type':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x4b6082(0x12c)],..._0x55e7a2,...headers},'body':_0x334b80?JSON['stringify'](_0x334b80):undefined,'signal':_0x4f00f3['signal']});let _0x5c0407;try{_0x5c0407=await _0x1d0553[_0x4b6082(0x127)]();}catch{throw CliErrors['apiError']('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x1d0553['status']+')',_0x1d0553[_0x4b6082(0x131)]>=0x190?_0x4b6082(0x12a):undefined);}if(!_0x1d0553['ok']||_0x5c0407[_0x4b6082(0x125)]===![])throw CliErrors[_0x4b6082(0x135)](_0x5c0407[_0x4b6082(0x116)]||_0x5c0407[_0x4b6082(0x100)]||'API\x20error:\x20'+_0x1d0553[_0x4b6082(0x131)],_0x5c0407[_0x4b6082(0x106)]?_0x4b6082(0x113)+_0x5c0407['errorCode']:undefined);return _0x5c0407;}catch(_0x1eb8bc){if(_0x1eb8bc instanceof Error&&_0x1eb8bc[_0x4b6082(0x11f)]===_0x4b6082(0x111))throw CliErrors[_0x4b6082(0x135)](_0x4b6082(0x12e)+_0xbb98ca);throw _0x1eb8bc;}finally{clearTimeout(_0x3ea8ef);}}export async function getBffScriptInfo(_0x43cf0f){const _0x3ce226=a43_0x431b,_0xb2412e=await apiRequest(_0x3ce226(0x11c)+_0x43cf0f);if(!_0xb2412e['data'])throw CliErrors['validation'](_0x3ce226(0x107)+_0x43cf0f);return _0xb2412e[_0x3ce226(0x101)];}export async function getSqlQueryInfo(_0x33ea1b,_0x1ccb49){const _0x295cee=a43_0x431b,_0x114474=await apiRequest('/client/sql/query',{'method':'POST','body':{'appCode':_0x33ea1b,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x1ccb49}}),_0x5166dd=_0x114474['data'],_0x38af55=_0x5166dd&&typeof _0x5166dd===_0x295cee(0x10a)&&'tableData'in _0x5166dd?_0x5166dd[_0x295cee(0x11e)]?.[0x0]:_0x5166dd&&typeof _0x5166dd===_0x295cee(0x10a)&&_0x295cee(0x10f)in _0x5166dd?_0x5166dd:undefined;if(!_0x38af55)throw CliErrors[_0x295cee(0x121)](_0x295cee(0x10b)+_0x1ccb49);return _0x38af55;}function isRemoteAppItem(_0x8aaa12){const _0x4586de=a43_0x431b;return!!_0x8aaa12&&typeof _0x8aaa12==='object'&&typeof _0x8aaa12['appCode']==='string'&&typeof _0x8aaa12['appName']===_0x4586de(0x123);}function extractRemoteAppItems(_0xd605d){const _0x1f756d=a43_0x431b;if(Array['isArray'](_0xd605d))return _0xd605d[_0x1f756d(0x124)](isRemoteAppItem);if(!_0xd605d||typeof _0xd605d!==_0x1f756d(0x10a))throw CliErrors[_0x1f756d(0x135)]('Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.');const _0x1cef94=_0xd605d;if(Array[_0x1f756d(0x118)](_0x1cef94[_0x1f756d(0x11e)]))return _0x1cef94[_0x1f756d(0x11e)]['filter'](isRemoteAppItem);if(_0x1cef94[_0x1f756d(0x101)]&&typeof _0x1cef94[_0x1f756d(0x101)]===_0x1f756d(0x10a)){const _0x1c2679=_0x1cef94[_0x1f756d(0x101)];if(Array[_0x1f756d(0x118)](_0x1c2679[_0x1f756d(0x11e)]))return _0x1c2679['tableData']['filter'](isRemoteAppItem);}throw CliErrors[_0x1f756d(0x135)](_0x1f756d(0x122));}export async function getMyApps(){const _0x7b8ca5=a43_0x431b,_0xe51b6f=await apiRequest(_0x7b8ca5(0x119));return extractRemoteAppItems(_0xe51b6f[_0x7b8ca5(0x101)]);}export async function getLoginUserInfo(){const _0x4e09c2=a43_0x431b,_0x69f2fb=await apiRequest(_0x4e09c2(0x11b));if(!_0x69f2fb[_0x4e09c2(0x101)]||typeof _0x69f2fb[_0x4e09c2(0x101)]!==_0x4e09c2(0x10a)||Array[_0x4e09c2(0x118)](_0x69f2fb[_0x4e09c2(0x101)]))throw CliErrors[_0x4e09c2(0x135)]('Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.');return _0x69f2fb[_0x4e09c2(0x101)];}export async function listDatasets(_0x2a0842,_0x35f4fa){const _0x3ea561=a43_0x431b,_0x4e1f3e=await apiRequest(_0x3ea561(0x129),{'method':_0x3ea561(0x130),'body':{'appCode':_0x2a0842,..._0x35f4fa?.[_0x3ea561(0x11d)]&&{'code':_0x35f4fa[_0x3ea561(0x11d)]},..._0x35f4fa?.[_0x3ea561(0x11f)]&&{'name':_0x35f4fa[_0x3ea561(0x11f)]}}});return extractList(_0x4e1f3e['data']);}export async function getDatasetDetail(_0x3faee4){const _0x318df5=a43_0x431b,_0x42d7f8=/^\d+$/[_0x318df5(0x117)](_0x3faee4)?'id':'code',_0x4b1dcd=await apiRequest(_0x318df5(0x12d)+_0x42d7f8+'='+_0x3faee4);return _0x4b1dcd['data'];}function a43_0x431b(_0x3f5ba2,_0x1c0f3b){_0x3f5ba2=_0x3f5ba2-0xfe;const _0x70f51a=a43_0x70f5();let _0x431bec=_0x70f51a[_0x3f5ba2];return _0x431bec;}export async function listPersonalKnowledgeBaseItems(_0x22ca56){const _0x59b44d=a43_0x431b,_0x2ea132=await apiRequest(_0x59b44d(0x108)+encodeURIComponent(_0x22ca56));return Array['isArray'](_0x2ea132['data'])?_0x2ea132[_0x59b44d(0x101)]:[];}export async function getPersonalKnowledgeBaseItem(_0x52b5f5,_0x3ab710){const _0x4ad5fd=a43_0x431b,_0x15e263=await apiRequest(_0x4ad5fd(0x120)+_0x52b5f5+_0x4ad5fd(0xfe)+encodeURIComponent(_0x3ab710));if(!_0x15e263[_0x4ad5fd(0x101)])throw CliErrors['validation'](_0x4ad5fd(0xff)+_0x52b5f5);return _0x15e263['data'];}export async function createPersonalKnowledgeBaseItem(_0x237d50,_0xf5c2b0){const _0x367f2d=a43_0x431b,_0x1fc4e7=await apiRequest(_0x367f2d(0x137),{'method':_0x367f2d(0x130),'body':{'appCode':_0x237d50,..._0xf5c2b0}});return _0x1fc4e7[_0x367f2d(0x101)];}export async function updatePersonalKnowledgeBaseItem(_0x2be52c,_0x3bb508,_0x28933c){const _0x12a4fb=a43_0x431b,_0x9ab71e=await apiRequest(_0x12a4fb(0x120)+_0x2be52c+_0x12a4fb(0x115),{'method':'POST','body':{'appCode':_0x3bb508,..._0x28933c}});return _0x9ab71e[_0x12a4fb(0x101)];}export async function searchKnowledgeBase(_0x4bbb39,_0x5900fc){const _0x35955c=a43_0x431b,_0x34b3d3=await apiRequest(_0x35955c(0x11a),{'method':_0x35955c(0x130),'body':{'appCode':_0x4bbb39,'query':_0x5900fc[_0x35955c(0x110)],..._0x5900fc['topK']!==undefined?{'topK':_0x5900fc[_0x35955c(0x136)]}:{}}});return Array['isArray'](_0x34b3d3[_0x35955c(0x101)])?_0x34b3d3[_0x35955c(0x101)]:[];}export async function listPersonalRuntimeSkills(_0x378003){const _0x2272f7=a43_0x431b,_0x53d195=await apiRequest(_0x2272f7(0x109)+encodeURIComponent(_0x378003));return Array[_0x2272f7(0x118)](_0x53d195[_0x2272f7(0x101)])?_0x53d195[_0x2272f7(0x101)]:[];}export async function listCompanyRuntimeSkills(_0x2d7933){const _0x5f1f97=a43_0x431b,_0x15fc4a=await apiRequest('/client/skill/company/list?appCode='+encodeURIComponent(_0x2d7933));return Array[_0x5f1f97(0x118)](_0x15fc4a[_0x5f1f97(0x101)])?_0x15fc4a[_0x5f1f97(0x101)]:[];}export async function createPersonalRuntimeSkill(_0x5b3045,_0x4e8b38){const _0x44a32c=a43_0x431b,_0x47f8fb=await apiRequest(_0x44a32c(0x12f),{'method':_0x44a32c(0x130),'body':{'appCode':_0x5b3045,..._0x4e8b38}});return _0x47f8fb[_0x44a32c(0x101)];}export async function updatePersonalRuntimeSkill(_0xfd8d93,_0x3306eb,_0x52dce6){const _0x364dd2=a43_0x431b,_0x31fb1d=await apiRequest(_0x364dd2(0x114)+encodeURIComponent(_0xfd8d93)+_0x364dd2(0x115),{'method':'POST','body':{'appCode':_0x3306eb,..._0x52dce6}});return _0x31fb1d[_0x364dd2(0x101)];}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x144fc9,_0x14bffb){const _0xd210cf=a44_0x337a,_0x37b323=_0x144fc9();while(!![]){try{const _0x4763f3=parseInt(_0xd210cf(0xa2))/0x1+parseInt(_0xd210cf(0x9e))/0x2+parseInt(_0xd210cf(0xa1))/0x3+parseInt(_0xd210cf(0xa0))/0x4*(-parseInt(_0xd210cf(0xa7))/0x5)+parseInt(_0xd210cf(0xa4))/0x6*(-parseInt(_0xd210cf(0xa5))/0x7)+-parseInt(_0xd210cf(0xa8))/0x8*(-parseInt(_0xd210cf(0xa3))/0x9)+-parseInt(_0xd210cf(0x9c))/0xa*(parseInt(_0xd210cf(0xa9))/0xb);if(_0x4763f3===_0x14bffb)break;else _0x37b323['push'](_0x37b323['shift']());}catch(_0x5c3cde){_0x37b323['push'](_0x37b323['shift']());}}}(a44_0x24c0,0x7b9f8));import{listDatasets}from'../core/api-client.js';function a44_0x337a(_0x29d1e2,_0x30a174){_0x29d1e2=_0x29d1e2-0x9c;const _0x24c07e=a44_0x24c0();let _0x337aa8=_0x24c07e[_0x29d1e2];return _0x337aa8;}function a44_0x24c0(){const _0x2b1c20=['1440494fYXpIt','set','40LRLbum','db-','795824YNBQQy','dbName','44mHBSzQ','2885271EfxRMv','840401UoxpPa','414boTpft','5240604dYMnSd','7DaFfmW','dbId','250110LEVaHB','44136PRdNcS'];a44_0x24c0=function(){return _0x2b1c20;};return a44_0x24c0();}const cache=new Map();export async function listDatabases(_0x574a9d){const _0x28959f=a44_0x337a;if(cache['has'](_0x574a9d))return cache['get'](_0x574a9d);const _0x10a816=await listDatasets(_0x574a9d),_0x7da2fc=new Map();for(const _0x18b53a of _0x10a816){const _0x159168=_0x18b53a['dbtableConfig'];_0x159168?.[_0x28959f(0xa6)]!=null&&_0x7da2fc[_0x28959f(0xaa)](_0x159168[_0x28959f(0xa6)],_0x159168[_0x28959f(0x9f)]??_0x28959f(0x9d)+_0x159168[_0x28959f(0xa6)]);}const _0x40f581=[..._0x7da2fc['entries']()]['map'](([_0x2c0569,_0x158fa2])=>({'dbId':_0x2c0569,'dbName':_0x158fa2}));return cache[_0x28959f(0xaa)](_0x574a9d,_0x40f581),_0x40f581;}export async function getDbName(_0xa7eda3,_0x56cfbf){const _0x187271=a44_0x337a;try{const _0x37490e=await listDatabases(_0xa7eda3);return _0x37490e['find'](_0x3922c9=>_0x3922c9[_0x187271(0xa6)]===_0x56cfbf)?.[_0x187271(0x9f)];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d034c,_0x4430b7){const _0x5de31a=a45_0x373c,_0x146878=_0x2d034c();while(!![]){try{const _0x5b0dca=parseInt(_0x5de31a(0x1a2))/0x1+parseInt(_0x5de31a(0x1b3))/0x2*(-parseInt(_0x5de31a(0x1a6))/0x3)+-parseInt(_0x5de31a(0x1b6))/0x4*(-parseInt(_0x5de31a(0x1a8))/0x5)+parseInt(_0x5de31a(0x1b1))/0x6*(parseInt(_0x5de31a(0x1a7))/0x7)+parseInt(_0x5de31a(0x1aa))/0x8*(parseInt(_0x5de31a(0x1ab))/0x9)+parseInt(_0x5de31a(0x1b7))/0xa+-parseInt(_0x5de31a(0x1ae))/0xb;if(_0x5b0dca===_0x4430b7)break;else _0x146878['push'](_0x146878['shift']());}catch(_0x40db74){_0x146878['push'](_0x146878['shift']());}}}(a45_0x3dd6,0xa38e0));function a45_0x3dd6(){const _0x53563f=['449642tOobDc','authMode','accessKey','SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.','3BZPDNr','112140AwbhGO','15StxbtW','sql','5785448FwMwCR','9OxGovC','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27','models','16470718SEWyex','appCode','batchCreate','318xcjQBW','\x22.\x20','1002166nuyhLc','isArray','getOne','623708dxrUmN','1786770hrKcuK','env','function','execute','update','Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.'];a45_0x3dd6=function(){return _0x53563f;};return a45_0x3dd6();}function a45_0x373c(_0x33cfbf,_0x151b74){_0x33cfbf=_0x33cfbf-0x1a1;const _0x3dd6d7=a45_0x3dd6();let _0x373c9e=_0x3dd6d7[_0x33cfbf];return _0x373c9e;}import{createClient}from'@lovrabet/sdk';import{parseBatchCreateItemsFromParams}from'../utils/params.js';let _client;export function initSdkClient(_0x2a3d77){const _0x38c212=a45_0x373c;_client=createClient({'appCode':_0x2a3d77[_0x38c212(0x1af)],'env':_0x2a3d77[_0x38c212(0x1b8)],'authMode':_0x2a3d77[_0x38c212(0x1a3)],..._0x2a3d77[_0x38c212(0x1a4)]?{'accessKey':_0x2a3d77[_0x38c212(0x1a4)]}:{},'options':{'timeout':0x7530}});}function ensureClient(){const _0x4c2d02=a45_0x373c;if(!_client)throw new Error(_0x4c2d02(0x1a5));return _client;}export async function executeData(_0x1f338d,_0x15bbc5,_0x510f3c){const _0xfc6cad=a45_0x373c,_0x7e4dc0=ensureClient(),_0x283e51='dataset_'+_0x1f338d,_0xc491e3=_0x7e4dc0[_0xfc6cad(0x1ad)][_0x283e51];if(!_0xc491e3||typeof _0xc491e3[_0x15bbc5]!==_0xfc6cad(0x1b9))throw new Error('SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22'+_0x15bbc5+_0xfc6cad(0x1b2)+_0xfc6cad(0x1a1));if(_0x15bbc5===_0xfc6cad(0x1b0))return _0xc491e3[_0xfc6cad(0x1b0)](parseBatchCreateItemsFromParams(_0x510f3c));const _0x230358=_0x510f3c!==undefined&&_0x510f3c!==null&&!Array[_0xfc6cad(0x1b4)](_0x510f3c)?_0x510f3c:{};switch(_0x15bbc5){case _0xfc6cad(0x1b5):{const _0x1145a4=_0x230358['id'];if(_0x1145a4===undefined||_0x1145a4===null)throw new Error('getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27');return _0xc491e3['getOne'](_0x1145a4);}case _0xfc6cad(0x1bb):{const {id:_0x2996a7,..._0x5a2325}=_0x230358;if(_0x2996a7===undefined||_0x2996a7===null)throw new Error(_0xfc6cad(0x1ac));return _0xc491e3[_0xfc6cad(0x1bb)](_0x2996a7,_0x5a2325);}case'delete':{const _0x1509ed=_0x230358['id'];if(_0x1509ed===undefined||_0x1509ed===null)throw new Error('delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27');return _0xc491e3['delete'](_0x1509ed);}default:return _0xc491e3[_0x15bbc5](_0x230358);}}export async function executeSdkSql(_0x351718,_0x24ece6){const _0x362578=a45_0x373c,_0x322002=ensureClient();return _0x322002[_0x362578(0x1a9)]['execute']({'sqlCode':_0x351718,'params':_0x24ece6});}export async function executeSdkBff(_0x4b6022,_0x1e24a6){const _0x3c557b=a45_0x373c,_0x13c061=ensureClient();return _0x13c061['bff'][_0x3c557b(0x1ba)]({'scriptName':_0x4b6022,'params':_0x1e24a6});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a46_0x170418=a46_0x332e;function a46_0xe0df(){const _0x50cf0b=['22477aIASno','7836666dObFca','18NoGefH','\x20or\x20run\x20`','8734311FDufDg','Set\x20appcode\x20via\x20--appcode\x20or\x20','4755877iBkJTi','newConfigFileName','Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20','10131384RKFcEv','3204417yqYhBW','652030KNPiZl','4PHjSCp'];a46_0xe0df=function(){return _0x50cf0b;};return a46_0xe0df();}(function(_0x530212,_0x14a80e){const _0x1657b2=a46_0x332e,_0x430978=_0x530212();while(!![]){try{const _0x25b35a=-parseInt(_0x1657b2(0x138))/0x1*(parseInt(_0x1657b2(0x13a))/0x2)+parseInt(_0x1657b2(0x135))/0x3*(-parseInt(_0x1657b2(0x137))/0x4)+-parseInt(_0x1657b2(0x136))/0x5+parseInt(_0x1657b2(0x139))/0x6+parseInt(_0x1657b2(0x13e))/0x7+parseInt(_0x1657b2(0x134))/0x8+-parseInt(_0x1657b2(0x13c))/0x9;if(_0x25b35a===_0x14a80e)break;else _0x430978['push'](_0x430978['shift']());}catch(_0x3e8ddc){_0x430978['push'](_0x430978['shift']());}}}(a46_0xe0df,0xd6ff4));function a46_0x332e(_0x45270f,_0x15b222){_0x45270f=_0x45270f-0x134;const _0xe0df2d=a46_0xe0df();let _0x332e81=_0xe0df2d[_0x45270f];return _0x332e81;}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG['newConfigFileName']+a46_0x170418(0x13b)+CLI_BIN_NAME+'\x20auth\x20login`.','configMissingHint':a46_0x170418(0x13d)+PRODUCT_CONFIG[a46_0x170418(0x13f)]+'.','notInProjectHint':a46_0x170418(0x140)+PRODUCT_CONFIG[a46_0x170418(0x13f)]+'\x20file.'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1864a1,_0x46d87f){var _0x3ab045=a47_0x385d,_0x31246c=_0x1864a1();while(!![]){try{var _0x808943=parseInt(_0x3ab045(0xb3))/0x1*(-parseInt(_0x3ab045(0xab))/0x2)+parseInt(_0x3ab045(0xac))/0x3*(-parseInt(_0x3ab045(0xaf))/0x4)+parseInt(_0x3ab045(0xb4))/0x5*(parseInt(_0x3ab045(0xae))/0x6)+parseInt(_0x3ab045(0xb6))/0x7+parseInt(_0x3ab045(0xb0))/0x8*(parseInt(_0x3ab045(0xb2))/0x9)+parseInt(_0x3ab045(0xb1))/0xa*(parseInt(_0x3ab045(0xad))/0xb)+parseInt(_0x3ab045(0xb5))/0xc;if(_0x808943===_0x46d87f)break;else _0x31246c['push'](_0x31246c['shift']());}catch(_0x5248a0){_0x31246c['push'](_0x31246c['shift']());}}}(a47_0x100f,0xb362f));function a47_0x385d(_0x1f04cb,_0x1dd26b){_0x1f04cb=_0x1f04cb-0xab;var _0x100f8d=a47_0x100f();var _0x385d5a=_0x100f8d[_0x1f04cb];return _0x385d5a;}function a47_0x100f(){var _0x3ae4c4=['133148zCguET','35049blVSym','673431CXUHdc','519858Hgmhqe','188iYJjyG','16FolpZQ','20VSxkyx','5830794zvOKEe','11IqIeIP','5fSaNnB','5201208WlImpg','545517zXCAPm'];a47_0x100f=function(){return _0x3ae4c4;};return a47_0x100f();}import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a47_0x97a551}from'@lovrabet/cli-framework';export function buildAllFlags(_0x49a42e){return a47_0x97a551(_0x49a42e,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a48_0x71ad(_0x9f6129,_0x115d4f){_0x9f6129=_0x9f6129-0x1b0;const _0x363a86=a48_0x363a();let _0x71ad5a=_0x363a86[_0x9f6129];return _0x71ad5a;}(function(_0x1697ab,_0x22ef06){const _0x201be5=a48_0x71ad,_0x449f6b=_0x1697ab();while(!![]){try{const _0x571467=-parseInt(_0x201be5(0x1b0))/0x1*(-parseInt(_0x201be5(0x1b2))/0x2)+-parseInt(_0x201be5(0x1b4))/0x3*(parseInt(_0x201be5(0x1b9))/0x4)+parseInt(_0x201be5(0x1b8))/0x5+-parseInt(_0x201be5(0x1b6))/0x6+parseInt(_0x201be5(0x1b1))/0x7*(-parseInt(_0x201be5(0x1b7))/0x8)+-parseInt(_0x201be5(0x1bc))/0x9*(parseInt(_0x201be5(0x1b3))/0xa)+parseInt(_0x201be5(0x1bb))/0xb;if(_0x571467===_0x22ef06)break;else _0x449f6b['push'](_0x449f6b['shift']());}catch(_0x26604d){_0x449f6b['push'](_0x449f6b['shift']());}}}(a48_0x363a,0xccc01));export function dryRun(_0x55feaf,_0x2c88ba){const _0x39d4ab={'method':_0x55feaf,'url':_0x2c88ba},_0x1fabec={'body'(_0x439e1a){const _0x47014f=a48_0x71ad;return _0x39d4ab[_0x47014f(0x1ba)]=_0x439e1a,_0x1fabec;},'description'(_0x59d8d8){const _0x36fac0=a48_0x71ad;return _0x39d4ab[_0x36fac0(0x1b5)]=_0x59d8d8,_0x1fabec;},'build'(){return{..._0x39d4ab};}};return _0x1fabec;}function a48_0x363a(){const _0x46cfc3=['7364260nYlnSq','380hAtBfS','body','15993461fpzsyH','9lZKjEZ','193345rprtzg','7MyZRni','2prYPcL','3733430BKpTuo','6081yXlqbG','description','7650912xVnvVT','3523448bxsLbc'];a48_0x363a=function(){return _0x46cfc3;};return a48_0x363a();}
|