@lovrabet/lovrabet-cli 2.0.9-beta.2 → 2.0.9-beta.4
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 -2
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4e6d93=a28_0x2299;(function(_0x1c9488,_0x4b267b){const _0x336fab=a28_0x2299,_0x1e0c8e=_0x1c9488();while(!![]){try{const _0x3aa082=-parseInt(_0x336fab(0x1ea))/0x1+parseInt(_0x336fab(0x1f2))/0x2*(parseInt(_0x336fab(0x1f4))/0x3)+-parseInt(_0x336fab(0x1f6))/0x4*(-parseInt(_0x336fab(0x1f7))/0x5)+parseInt(_0x336fab(0x1fa))/0x6+parseInt(_0x336fab(0x1eb))/0x7*(parseInt(_0x336fab(0x1e9))/0x8)+-parseInt(_0x336fab(0x1e7))/0x9*(parseInt(_0x336fab(0x1e6))/0xa)+-parseInt(_0x336fab(0x1e4))/0xb;if(_0x3aa082===_0x4b267b)break;else _0x1e0c8e['push'](_0x1e0c8e['shift']());}catch(_0x3214bd){_0x1e0c8e['push'](_0x1e0c8e['shift']());}}}(a28_0x3e08,0xcca1e));function a28_0x2299(_0x1150fb,_0x154ad3){_0x1150fb=_0x1150fb-0x1e2;const _0x3e08d5=a28_0x3e08();let _0x229946=_0x3e08d5[_0x1150fb];return _0x229946;}import{executeSdkSql}from'../../core/sdk-client.js';import{SQLCODE_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a28_0x3e08(){const _0x32734e=['SQL\x20execution\x20failed','execResult','isArray','length','exec','932462rlHUcH','execSuccess','3CHnQDq','sql','461128gmbSlw','35npISFP','execError','params','1828860VQrxLl','str','sqlcode','6081504jXPuuA','now','60AEkkfb','2183508wSoUJU','\x20row(s)\x20in\x20','16ckSpbR','263181ojwJVA','5361566fqhRpD','Returned\x20'];a28_0x3e08=function(){return _0x32734e;};return a28_0x3e08();}import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a28_0x4e6d93(0x1f5),'command':a28_0x4e6d93(0x1f1),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,PARAMS_FLAG],async 'execute'(_0x36e914){const _0x45083d=a28_0x4e6d93,_0x5d6224=parseJsonParams(_0x36e914[_0x45083d(0x1e2)](_0x45083d(0x1f9))),_0x34b5fa=Date[_0x45083d(0x1e5)](),_0x461e58=await executeSdkSql(_0x36e914['str'](_0x45083d(0x1e3)),_0x5d6224),_0x2c9e64=Date[_0x45083d(0x1e5)]()-_0x34b5fa,_0x929686=_0x461e58?.[_0x45083d(0x1ee)]??_0x461e58,_0x3704be=_0x461e58?.[_0x45083d(0x1f3)]??!![];if(!_0x3704be)return{'ok':![],'data':{'error':_0x461e58?.[_0x45083d(0x1f8)]||_0x45083d(0x1ed),'elapsed':_0x2c9e64},'message':_0x45083d(0x1ed)};const _0x54deea=Array[_0x45083d(0x1ef)](_0x929686)?_0x929686:[];return{'ok':!![],'data':{'rows':_0x54deea,'rowCount':_0x54deea[_0x45083d(0x1f0)],'elapsed':_0x2c9e64},'message':_0x45083d(0x1ec)+_0x54deea['length']+_0x45083d(0x1e8)+_0x2c9e64+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ffb72,_0x5ceffd){const _0x595a82=a29_0x58eb,_0x2dcd77=_0x3ffb72();while(!![]){try{const _0x57f349=parseInt(_0x595a82(0xb9))/0x1+parseInt(_0x595a82(0xbe))/0x2*(-parseInt(_0x595a82(0xb8))/0x3)+-parseInt(_0x595a82(0xc0))/0x4*(parseInt(_0x595a82(0xbd))/0x5)+parseInt(_0x595a82(0xbf))/0x6*(parseInt(_0x595a82(0xbb))/0x7)+-parseInt(_0x595a82(0xba))/0x8+-parseInt(_0x595a82(0xbc))/0x9+parseInt(_0x595a82(0xb7))/0xa*(parseInt(_0x595a82(0xb6))/0xb);if(_0x57f349===_0x5ceffd)break;else _0x2dcd77['push'](_0x2dcd77['shift']());}catch(_0x2c72b3){_0x2dcd77['push'](_0x2dcd77['shift']());}}}(a29_0xf9c1,0x3076e));import{sqlDetail}from'../../commands/sql/detail.js';function a29_0x58eb(_0x40eec9,_0x1a0936){_0x40eec9=_0x40eec9-0xb6;const _0xf9c1c0=a29_0xf9c1();let _0x58ebae=_0xf9c1c0[_0x40eec9];return _0x58ebae;}import{sqlExec}from'../../commands/sql/exec.js';export const sqlDefinitions=[sqlDetail,sqlExec];function a29_0xf9c1(){const _0x46ae99=['7570618gHnPpA','20CebjdE','342CYfsGn','7728cvzBNE','1868624WSuYsV','910VrxNzF','2198439Xrqmvf','1714945fgURLT','6718ebFNoJ','834rQdEfQ','4Knbfdi'];a29_0xf9c1=function(){return _0x46ae99;};return a29_0xf9c1();}
|
package/lib/commands/update.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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};
|
|
1
|
+
const a30_0x20d13b=a30_0x5a07;(function(_0x187988,_0x1b6b6c){const _0x47c7f6=a30_0x5a07,_0xc8bfb1=_0x187988();while(!![]){try{const _0x53a7d1=parseInt(_0x47c7f6(0x1a4))/0x1*(parseInt(_0x47c7f6(0x194))/0x2)+parseInt(_0x47c7f6(0x18b))/0x3+parseInt(_0x47c7f6(0x1b7))/0x4*(-parseInt(_0x47c7f6(0x19a))/0x5)+-parseInt(_0x47c7f6(0x18c))/0x6+-parseInt(_0x47c7f6(0x1c4))/0x7+parseInt(_0x47c7f6(0x1bd))/0x8+parseInt(_0x47c7f6(0x1c8))/0x9;if(_0x53a7d1===_0x1b6b6c)break;else _0xc8bfb1['push'](_0xc8bfb1['shift']());}catch(_0x4a10c5){_0xc8bfb1['push'](_0xc8bfb1['shift']());}}}(a30_0x3ffe,0xe3fc2));import{spawnSync}from'node:child_process';import{CliErrors}from'../errors.js';function a30_0x3ffe(){const _0x377c02=['Updated\x20to\x20v','\x20version\x20from\x20npm.','/dist-tags','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','7898072cwUmPg','log','string','major','2913579tqoLPB','object','\x20->\x20','no-skills','skills','validation','skipped','Update\x20failed:\x20','beta','Use\x20full\x20semver\x20versions\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','Invalid\x20version:\x20','fromEntries','entries','npm','message','source','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','2323698ZHhRKf','2844348mlXUHF','toString','Update\x20','Version\x20comparison\x20failed.','Skipping\x20official\x20skill\x20package\x20(--no-skills).','Updating\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','1370ldBYDR','warn','json','Current\x20version:\x20','version','Unable\x20to\x20resolve\x20','275wUeANw','Use\x20a\x20full\x20semver\x20such\x20as\x202.0.6\x20or\x202.0.7-beta.1.','\x20CLI\x20from\x20npm','filter','flag','Install\x20the\x20version\x20from\x20npm\x20latest\x20dist-tag','timeout','Already\x20up\x20to\x20date\x20(v','args','stderr','2089mSyTKJ','latest','\x20\x20Official\x20skill\x20update\x20failed:\x20','bool','map','Checking\x20npm\x20dist-tags...','boolean','error','status','Already\x20on\x20requested\x20version\x20(v','Refresh\x20official\x20skill\x20package\x20after\x20updating','trim','run','update','stdout','=1).','install','unknown','pipe','75044WhxHpe','exit\x20','nonInteractive','prerelease','match','\x20\x20Run\x20manually:\x20npx\x20skills\x20add\x20','8310184bXrNkB','minor','inherit'];a30_0x3ffe=function(){return _0x377c02;};return a30_0x3ffe();}import{CLI_BIN_NAME}from'../constant/cli.js';function a30_0x5a07(_0x28335a,_0x3cd859){_0x28335a=_0x28335a-0x187;const _0x3ffeb4=a30_0x3ffe();let _0x5a0786=_0x3ffeb4[_0x28335a];return _0x5a0786;}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_0x20d13b(0x1a5),'type':a30_0x20d13b(0x1aa),'description':a30_0x20d13b(0x19f),'default':![]},{'name':a30_0x20d13b(0x1d0),'type':'boolean','description':a30_0x20d13b(0x192),'default':![]},{'name':a30_0x20d13b(0x198),'type':'string','description':'Install\x20a\x20specific\x20CLI\x20version'},{'name':a30_0x20d13b(0x1cb),'type':a30_0x20d13b(0x1aa),'description':a30_0x20d13b(0x1c3),'default':![]},{'name':a30_0x20d13b(0x1cc),'type':a30_0x20d13b(0x1aa),'description':a30_0x20d13b(0x1ae),'default':!![],'hidden':!![]}];function parseSemver(_0x39591){const _0x435e5f=a30_0x20d13b,_0x1c1322=_0x39591['trim']()[_0x435e5f(0x1bb)](/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);if(!_0x1c1322)return null;return{'major':Number(_0x1c1322[0x1]),'minor':Number(_0x1c1322[0x2]),'patch':Number(_0x1c1322[0x3]),'prerelease':_0x1c1322[0x4]};}function compareSemver(_0x239f37,_0x283f40){const _0x2316e6=a30_0x20d13b,_0x303185=parseSemver(_0x239f37),_0x175c3d=parseSemver(_0x283f40);if(!_0x303185||!_0x175c3d)throw CliErrors[_0x2316e6(0x1cd)](_0x2316e6(0x18f),_0x2316e6(0x1d1));for(const _0x4d44bd of[_0x2316e6(0x1c7),_0x2316e6(0x1be),'patch']){if(_0x303185[_0x4d44bd]<_0x175c3d[_0x4d44bd])return-0x1;if(_0x303185[_0x4d44bd]>_0x175c3d[_0x4d44bd])return 0x1;}if(!_0x303185[_0x2316e6(0x1ba)]&&!_0x175c3d[_0x2316e6(0x1ba)])return 0x0;if(!_0x303185[_0x2316e6(0x1ba)])return 0x1;if(!_0x175c3d['prerelease'])return-0x1;if(_0x303185[_0x2316e6(0x1ba)]===_0x175c3d['prerelease'])return 0x0;return _0x303185[_0x2316e6(0x1ba)]<_0x175c3d[_0x2316e6(0x1ba)]?-0x1:0x1;}function getRequestedVersion(_0x223524){const _0x573685=a30_0x20d13b,_0x50a066=_0x223524['str']('version')[_0x573685(0x1af)]();if(_0x50a066)return _0x50a066;return String(_0x223524[_0x573685(0x1a2)]?.[0x0]??'')[_0x573685(0x1af)]();}function shouldSkipOfficialSkill(_0xcbf7cc){const _0x4a2ba5=a30_0x20d13b;return _0xcbf7cc[_0x4a2ba5(0x1a7)]('no-skills')||_0xcbf7cc[_0x4a2ba5(0x19e)](_0x4a2ba5(0x1cc))===![];}async function validateUpdateFlags(_0x4a7e4a){const _0x39b237=a30_0x20d13b,_0x4d46bb=getRequestedVersion(_0x4a7e4a),_0x1d39de=[_0x4a7e4a['bool']('latest')?_0x39b237(0x1a5):'',_0x4a7e4a[_0x39b237(0x1a7)](_0x39b237(0x1d0))?_0x39b237(0x1d0):'',_0x4d46bb?_0x39b237(0x198):'']['filter'](Boolean);if(_0x1d39de['length']>0x1)throw CliErrors[_0x39b237(0x1cd)]('--latest,\x20--beta,\x20and\x20version\x20cannot\x20be\x20used\x20together.','Choose\x20exactly\x20one\x20target:\x20--latest,\x20--beta,\x20or\x20--version\x20<version>.');if(_0x4d46bb&&!parseSemver(_0x4d46bb))throw CliErrors[_0x39b237(0x1cd)](_0x39b237(0x1d2)+_0x4d46bb,_0x39b237(0x19b));}async function fetchNpmDistTags(){const _0x111457=a30_0x20d13b;try{const _0x59c06a=NPM_REGISTRY_BASE_URL+'/-/package/'+encodeURIComponent(LOVRABET_NPM_PACKAGE_NAME)+_0x111457(0x1c2),_0x265159=await fetch(_0x59c06a,{'signal':AbortSignal[_0x111457(0x1a0)](0x2710)});if(!_0x265159['ok'])return null;const _0x4cb259=await _0x265159[_0x111457(0x196)]();if(!_0x4cb259||typeof _0x4cb259!==_0x111457(0x1c9))return null;return Object[_0x111457(0x1d3)](Object[_0x111457(0x1d4)](_0x4cb259)[_0x111457(0x19d)](([,_0x47c024])=>typeof _0x47c024===_0x111457(0x1c6)&&_0x47c024[_0x111457(0x1af)]())[_0x111457(0x1a8)](([_0x4ffdc0,_0x490896])=>[_0x4ffdc0,String(_0x490896)[_0x111457(0x1af)]()]));}catch{return null;}}async function resolveTargetVersion(_0x4d9d13){const _0x280cf7=a30_0x20d13b,_0xbea45d=getRequestedVersion(_0x4d9d13);if(_0xbea45d)return{'version':_0xbea45d,'source':'version'};const _0x5e1bdd=_0x4d9d13['bool'](_0x280cf7(0x1d0))?_0x280cf7(0x1d0):_0x280cf7(0x1a5),_0x4b7396=await fetchNpmDistTags(),_0x5c0e36=_0x4b7396?.[_0x5e1bdd];if(!_0x5c0e36)return null;return{'version':_0x5c0e36,'source':_0x5e1bdd};}function shouldInstallTarget(_0x4e1ff2,_0x896cc3){const _0x3edc25=a30_0x20d13b,_0x4fcb2e=compareSemver(_0x4e1ff2,_0x896cc3[_0x3edc25(0x198)]);if(_0x896cc3[_0x3edc25(0x189)]===_0x3edc25(0x198))return _0x4fcb2e!==0x0;return _0x4fcb2e<0x0;}function installCliPackage(_0x5d1043,_0x5ebb5e){const _0x51dc2f=a30_0x20d13b,_0x531d24=resolveNpmBin(_0x51dc2f(0x187)),_0x98565b=[_0x51dc2f(0x1b4),'-g',LOVRABET_NPM_PACKAGE_NAME+'@'+_0x5d1043];console[_0x51dc2f(0x1c5)]('*\x20'+[_0x531d24,..._0x98565b]['join']('\x20'));const _0x5c3f0d=spawnSync(_0x531d24,_0x98565b,{'cwd':process['cwd'](),'stdio':_0x5ebb5e?_0x51dc2f(0x1b6):_0x51dc2f(0x1bf),'env':process.env,'shell':![]});if(_0x5c3f0d[_0x51dc2f(0x1ac)]===0x0)return{'ok':!![]};let _0x3454be=_0x5c3f0d['error']?.[_0x51dc2f(0x188)]||_0x51dc2f(0x1b8)+(_0x5c3f0d[_0x51dc2f(0x1ac)]??_0x51dc2f(0x1b5));if(_0x5ebb5e){const _0x1becbd=_0x5c3f0d['stderr']?_0x5c3f0d[_0x51dc2f(0x1a3)][_0x51dc2f(0x18d)]()[_0x51dc2f(0x1af)]():'',_0x1bfd5d=_0x5c3f0d[_0x51dc2f(0x1b2)]?_0x5c3f0d[_0x51dc2f(0x1b2)][_0x51dc2f(0x18d)]()[_0x51dc2f(0x1af)]():'';if(_0x1becbd)_0x3454be=_0x1becbd;else{if(_0x1bfd5d)_0x3454be=_0x1bfd5d;}}return{'ok':![],'error':_0x3454be};}async function installOfficialSkill(_0x122985){const _0x379084=a30_0x20d13b;console[_0x379084(0x1c5)]('Checking\x20official\x20skill\x20package...');const _0x55d714=runNpxSkillsAddGlobal(process['cwd'](),LOVRABET_SKILL_SOURCE,{'stdio':_0x122985?_0x379084(0x1b6):_0x379084(0x1bf)});if(_0x55d714[_0x379084(0x1ce)]){console[_0x379084(0x1c5)]('\x20\x20Skipped\x20skill\x20install\x20('+LOVRABET_SKIP_NPX_SKILLS_ENV+_0x379084(0x1b3));return;}if(_0x55d714['ok']){console[_0x379084(0x1c5)](_0x379084(0x18a));return;}console[_0x379084(0x195)](_0x379084(0x1a6)+(_0x55d714[_0x379084(0x1ab)]||_0x379084(0x1b5))),console[_0x379084(0x1c5)](_0x379084(0x1bc)+LOVRABET_SKILL_SOURCE+'\x20-g\x20-y');}async function execute(_0x39e4f8){const _0x4b0728=a30_0x20d13b;await validateUpdateFlags(_0x39e4f8);const _0x233d6a=getCliVersion();console['log'](_0x4b0728(0x197)+_0x233d6a),console[_0x4b0728(0x1c5)](_0x4b0728(0x1a9));const _0x1d1077=await resolveTargetVersion(_0x39e4f8);if(!_0x1d1077){const _0x415475=_0x39e4f8[_0x4b0728(0x1a7)](_0x4b0728(0x1d0))?_0x4b0728(0x1d0):_0x4b0728(0x1a5),_0x4f0b41=_0x4b0728(0x199)+_0x415475+_0x4b0728(0x1c1);return console[_0x4b0728(0x195)](_0x4f0b41),console['log'](_0x4b0728(0x193)+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x415475),{'ok':![]};}if(!shouldInstallTarget(_0x233d6a,_0x1d1077)){const _0x104e8e=_0x1d1077[_0x4b0728(0x189)]===_0x4b0728(0x198)?_0x4b0728(0x1ad)+_0x1d1077[_0x4b0728(0x198)]+').':_0x4b0728(0x1a1)+_0x1d1077['version']+').';return console[_0x4b0728(0x1c5)](_0x104e8e),shouldSkipOfficialSkill(_0x39e4f8)?console[_0x4b0728(0x1c5)](_0x4b0728(0x190)):await installOfficialSkill(_0x39e4f8[_0x4b0728(0x1b9)]),{'ok':!![]};}console[_0x4b0728(0x1c5)](_0x4b0728(0x191)+LOVRABET_NPM_PACKAGE_NAME+':\x20'+_0x233d6a+_0x4b0728(0x1ca)+_0x1d1077[_0x4b0728(0x198)]);const _0x245e43=installCliPackage(_0x1d1077[_0x4b0728(0x198)],_0x39e4f8[_0x4b0728(0x1b9)]);if(!_0x245e43['ok']){const _0x3e8b6e=_0x4b0728(0x1cf)+(_0x245e43[_0x4b0728(0x1ab)]||_0x4b0728(0x1b5));return console[_0x4b0728(0x1ab)](_0x3e8b6e),console[_0x4b0728(0x1c5)]('\x20\x20Try\x20manually:\x20npm\x20install\x20-g\x20'+LOVRABET_NPM_PACKAGE_NAME+'@'+_0x1d1077['version']),{'ok':![]};}return console[_0x4b0728(0x1c5)](_0x4b0728(0x1c0)+_0x1d1077[_0x4b0728(0x198)]+'.'),console['log']('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'),shouldSkipOfficialSkill(_0x39e4f8)?console[_0x4b0728(0x1c5)](_0x4b0728(0x190)):await installOfficialSkill(_0x39e4f8[_0x4b0728(0x1b9)]),{'ok':!![]};}export const updateDefinition={'service':a30_0x20d13b(0x1b1),'command':a30_0x20d13b(0x1b0),'description':a30_0x20d13b(0x18e)+CLI_BIN_NAME+a30_0x20d13b(0x19c),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x2c9473=a31_0x2b3e;(function(_0x4163a1,_0x3548cc){const _0x1d7376=a31_0x2b3e,_0xa60ea2=_0x4163a1();while(!![]){try{const _0x3cd698=-parseInt(_0x1d7376(0xf6))/0x1*(-parseInt(_0x1d7376(0x104))/0x2)+-parseInt(_0x1d7376(0xf8))/0x3*(-parseInt(_0x1d7376(0x109))/0x4)+-parseInt(_0x1d7376(0x10c))/0x5+-parseInt(_0x1d7376(0xfd))/0x6*(-parseInt(_0x1d7376(0x107))/0x7)+-parseInt(_0x1d7376(0xfb))/0x8+-parseInt(_0x1d7376(0x10d))/0x9+parseInt(_0x1d7376(0x106))/0xa;if(_0x3cd698===_0x3548cc)break;else _0xa60ea2['push'](_0xa60ea2['shift']());}catch(_0x28b372){_0xa60ea2['push'](_0xa60ea2['shift']());}}}(a31_0x6fc6,0xe8be1));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{OUTPUT_FORMAT_VALUES}from'../constant/output.js';export const CONFIG_FIELD_SCHEMAS={'env':{'description':'Target\x20environment','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':RUNTIME_ENV_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c9473(0xff)],'importable':!![]},'format':{'description':'Default\x20output\x20format','topLevel':!![],'cliSettableTopLevel':!![],'enumValues':OUTPUT_FORMAT_VALUES,'defaultValue':DEFAULT_CONFIG_VALUES['format'],'importable':!![]},'pageSize':{'description':'Default\x20page\x20size','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'apiDomain':{'description':a31_0x2c9473(0x105),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'userDomain':{'description':a31_0x2c9473(0xfa),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'runtimeDomain':{'description':'Override\x20runtime\x20domain','topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'accessKey':{'description':a31_0x2c9473(0x102),'topLevel':!![],'cliSettableTopLevel':!![],'importable':!![]},'riskLevel':{'description':a31_0x2c9473(0x10a),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES[a31_0x2c9473(0x108)],'importable':!![]},'locale':{'description':a31_0x2c9473(0xfe),'topLevel':!![],'defaultValue':DEFAULT_CONFIG_VALUES['locale'],'importable':!![],'legacyCompatOnly':!![]}};export const TOP_LEVEL_CONFIG_KEYS=new Set(Object[a31_0x2c9473(0x100)](CONFIG_FIELD_SCHEMAS)[a31_0x2c9473(0x110)](([,_0x56606d])=>_0x56606d[a31_0x2c9473(0xf9)])[a31_0x2c9473(0x103)](([_0x38a4c1])=>_0x38a4c1));export const CONFIG_ENUM_VALUES=Object[a31_0x2c9473(0xfc)](Object[a31_0x2c9473(0x100)](CONFIG_FIELD_SCHEMAS)[a31_0x2c9473(0x110)](([,_0x1222ba])=>_0x1222ba[a31_0x2c9473(0x10e)])[a31_0x2c9473(0x103)](([_0x662bc5,_0xa331b5])=>[_0x662bc5,[..._0xa331b5[a31_0x2c9473(0x10e)]||[]]]));function a31_0x6fc6(){const _0x187bd7=['filter','Config\x20key.\x20Top-level:\x20','1DKbNwM',';\x20local\x20alias:\x20apps.<alias>.appcode','3620364aYsQUy','cliSettableTopLevel','Override\x20user\x20domain','5654744ZtTMHw','fromEntries','60qkJhXe','Locale','env','entries','join','Access\x20key\x20(client-ak\x20auth)','map','935654GcxVLf','Override\x20API\x20domain','6690220kWMPUL','598871AHtzFm','riskLevel','4GrLBVW','Risk\x20level','legacyCompatOnly','3044550IKVbmn','8370909OnOpwr','enumValues','importable'];a31_0x6fc6=function(){return _0x187bd7;};return a31_0x6fc6();}export const IMPORTABLE_RUNTIME_CONFIG_KEYS=Object[a31_0x2c9473(0x100)](CONFIG_FIELD_SCHEMAS)['filter'](([,_0xe0e884])=>_0xe0e884[a31_0x2c9473(0x10f)])[a31_0x2c9473(0x103)](([_0x3f3786])=>_0x3f3786);export function getConfigFieldSchema(_0x51ac98){return CONFIG_FIELD_SCHEMAS[_0x51ac98];}function a31_0x2b3e(_0x19063a,_0x4c45cd){_0x19063a=_0x19063a-0xf5;const _0x6fc68f=a31_0x6fc6();let _0x2b3e69=_0x6fc68f[_0x19063a];return _0x2b3e69;}export function getConfigEnumValues(_0x12363c){const _0x17c1bb=a31_0x2c9473;return getConfigFieldSchema(_0x12363c)?.[_0x17c1bb(0x10e)];}export function getConfigDefaultValue(_0x449360){return getConfigFieldSchema(_0x449360)?.['defaultValue'];}export function isTopLevelConfigKey(_0x2c4c91){return TOP_LEVEL_CONFIG_KEYS['has'](_0x2c4c91);}export function isLegacyCompatConfigKey(_0xf08811){const _0x241987=a31_0x2c9473;return getConfigFieldSchema(_0xf08811)?.[_0x241987(0x10b)]===!![];}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function formatConfigKeyList(_0x44e033){const _0x5c85ca=a31_0x2c9473;return[..._0x44e033][_0x5c85ca(0x101)](',\x20');}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x52a068=a31_0x2c9473;return _0x52a068(0xf5)+getTopLevelConfigKeySummary()+_0x52a068(0xf7);}export function buildAppProfileListFields(_0x46a796){return{'env':_0x46a796,'hasAccessKey':![],'format':null,'pageSize':null,'riskLevel':null,'locale':null};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x1b08a1=a32_0x8055;(function(_0x1329b9,_0x587dcb){const _0x41690f=a32_0x8055,_0x372f16=_0x1329b9();while(!![]){try{const _0x337a92=parseInt(_0x41690f(0x192))/0x1*(parseInt(_0x41690f(0x198))/0x2)+parseInt(_0x41690f(0x196))/0x3+-parseInt(_0x41690f(0x194))/0x4+parseInt(_0x41690f(0x195))/0x5*(parseInt(_0x41690f(0x19a))/0x6)+-parseInt(_0x41690f(0x19c))/0x7+-parseInt(_0x41690f(0x19b))/0x8*(parseInt(_0x41690f(0x199))/0x9)+parseInt(_0x41690f(0x197))/0xa;if(_0x337a92===_0x587dcb)break;else _0x372f16['push'](_0x372f16['shift']());}catch(_0x5b9b87){_0x372f16['push'](_0x372f16['shift']());}}}(a32_0x557d,0x56e34));function a32_0x8055(_0x12c717,_0x140312){_0x12c717=_0x12c717-0x192;const _0x557d1f=a32_0x557d();let _0x8055db=_0x557d1f[_0x12c717];return _0x8055db;}export const AUTH_MODE={'ClientAk':a32_0x1b08a1(0x19d)};function a32_0x557d(){const _0xdac8c3=['150996xykald','32EqRKYm','924308lzVxyA','client-ak','1xyvllc','ClientAk','1024872SomIUz','15TOaVMe','387825bAPhQz','5501590LtOQRw','1302084vnhBMX','1489095GJciUI'];a32_0x557d=function(){return _0xdac8c3;};return a32_0x557d();}export function isAuthMode(_0x18d1ba){const _0x29ec5c=a32_0x1b08a1;return _0x18d1ba===AUTH_MODE[_0x29ec5c(0x193)];}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0x528107=a33_0x5c88;(function(_0x31d8fd,_0x4b5815){const _0xae7682=a33_0x5c88,_0x155c00=_0x31d8fd();while(!![]){try{const _0x4cb27f=-parseInt(_0xae7682(0x130))/0x1+parseInt(_0xae7682(0x121))/0x2*(-parseInt(_0xae7682(0x142))/0x3)+-parseInt(_0xae7682(0x125))/0x4+-parseInt(_0xae7682(0x145))/0x5*(-parseInt(_0xae7682(0x147))/0x6)+-parseInt(_0xae7682(0x128))/0x7*(-parseInt(_0xae7682(0x140))/0x8)+parseInt(_0xae7682(0x137))/0x9+parseInt(_0xae7682(0x12a))/0xa;if(_0x4cb27f===_0x4b5815)break;else _0x155c00['push'](_0x155c00['shift']());}catch(_0x44a9b5){_0x155c00['push'](_0x155c00['shift']());}}}(a33_0x117b,0x47b5a));function a33_0x117b(){const _0x5d4285=['828579rLFRhR','Use\x20global\x20config\x20scope','JSON\x20params\x20for\x20execute\x20commands','1880slEpjS','Output\x20format','1308YZZWgz','meowKey','Record\x20ID','Clear\x20output','Alias\x20for\x20--non-interactive','sqlcode','verbose','name','<code>','Force\x20non-interactive\x20mode\x20(CI)','map','4gtGDHg','clear','env','help','1621464wrRLvR','Show\x20help','format','5215LzBzaO','json\x20|\x20pretty\x20|\x20compress','13929950zvzlVq','Override\x20appcode','yes','global','string','app','549938PckqKE','Name\x20filter','Environment','non-interactive','SQL\x20query\x20code','<name>','appcode','34776RnHvlf','Filter\x20JSON\x20output\x20(JQ_PATH\x20>\x20bundled\x20jq\x20>\x20PATH;\x20implies\x20--format\x20json\x20when\x20current\x20format\x20is\x20pretty)','type','Preview\x20operation\x20without\x20executing','cliDisplayName','dryRun','dry-run','params','boolean','3464wYBPAt','Skip\x20confirmation\x20for\x20high-risk\x20writes'];a33_0x117b=function(){return _0x5d4285;};return a33_0x117b();}import{PRODUCT_CONFIG}from'../constant/product.js';import{LOVRABET_NPM_PACKAGE_NAME}from'../constant/distribution.js';export const CLI_BIN_NAME=PRODUCT_CONFIG['cliBinName'];function a33_0x5c88(_0x36eab2,_0x5a3bfd){_0x36eab2=_0x36eab2-0x11d;const _0x117b85=a33_0x117b();let _0x5c8814=_0x117b85[_0x36eab2];return _0x5c8814;}export const CLI_DISPLAY_NAME=PRODUCT_CONFIG[a33_0x528107(0x13b)];export const NPM_PACKAGE_NAME=LOVRABET_NPM_PACKAGE_NAME;export const GLOBAL_FLAGS=[{'name':a33_0x528107(0x136),'meowKey':'appcode','type':a33_0x528107(0x12e),'description':a33_0x528107(0x12b),'hint':a33_0x528107(0x11e)},{'name':'app','meowKey':a33_0x528107(0x12f),'type':a33_0x528107(0x12e),'description':'Select\x20app\x20profile\x20by\x20name','hint':a33_0x528107(0x135)},{'name':a33_0x528107(0x123),'meowKey':a33_0x528107(0x123),'type':a33_0x528107(0x12e),'description':a33_0x528107(0x132),'hint':'production\x20|\x20development\x20|\x20daily'},{'name':a33_0x528107(0x127),'meowKey':a33_0x528107(0x127),'type':a33_0x528107(0x12e),'description':a33_0x528107(0x146),'hint':a33_0x528107(0x129)},{'name':'jq','meowKey':'jq','type':a33_0x528107(0x12e),'description':a33_0x528107(0x138),'hint':'<expr>'},{'name':a33_0x528107(0x13d),'meowKey':a33_0x528107(0x13c),'type':a33_0x528107(0x13f),'description':a33_0x528107(0x13a)},{'name':a33_0x528107(0x12c),'meowKey':a33_0x528107(0x12c),'type':'boolean','description':a33_0x528107(0x141)},{'name':a33_0x528107(0x133),'meowKey':'nonInteractive','type':'boolean','description':a33_0x528107(0x11f)},{'name':a33_0x528107(0x12d),'meowKey':a33_0x528107(0x12d),'type':a33_0x528107(0x13f),'description':a33_0x528107(0x143)},{'name':'ci','meowKey':'ci','type':a33_0x528107(0x13f),'description':a33_0x528107(0x14b),'hidden':!![]},{'name':a33_0x528107(0x124),'meowKey':a33_0x528107(0x124),'type':a33_0x528107(0x13f),'description':a33_0x528107(0x126)},{'name':'id','meowKey':'id','type':a33_0x528107(0x12e),'description':a33_0x528107(0x149),'hidden':!![]},{'name':a33_0x528107(0x11d),'meowKey':a33_0x528107(0x11d),'type':a33_0x528107(0x12e),'description':a33_0x528107(0x131),'hidden':!![]},{'name':'sqlcode','meowKey':a33_0x528107(0x14c),'type':a33_0x528107(0x12e),'description':a33_0x528107(0x134),'hidden':!![]},{'name':a33_0x528107(0x13e),'meowKey':a33_0x528107(0x13e),'type':a33_0x528107(0x12e),'description':a33_0x528107(0x144),'hidden':!![]},{'name':a33_0x528107(0x14d),'meowKey':a33_0x528107(0x14d),'type':'boolean','description':'Verbose\x20output','hidden':!![]},{'name':a33_0x528107(0x122),'meowKey':a33_0x528107(0x122),'type':'boolean','description':a33_0x528107(0x14a),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a33_0x528107(0x136),a33_0x528107(0x12f),a33_0x528107(0x123),a33_0x528107(0x127),'jq',a33_0x528107(0x13d),a33_0x528107(0x12c),a33_0x528107(0x133),'ci']);export function buildMeowFlags(){const _0x33f6c6=a33_0x528107;return Object['fromEntries'](GLOBAL_FLAGS[_0x33f6c6(0x120)](_0xadb7f4=>[_0xadb7f4[_0x33f6c6(0x148)],{'type':_0xadb7f4[_0x33f6c6(0x139)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x17d49e=a34_0x4fdb;(function(_0x339d7f,_0x31b79c){const _0x4279e8=a34_0x4fdb,_0x131ad4=_0x339d7f();while(!![]){try{const _0x3d19a0=parseInt(_0x4279e8(0x8b))/0x1*(-parseInt(_0x4279e8(0x82))/0x2)+parseInt(_0x4279e8(0x8c))/0x3+-parseInt(_0x4279e8(0x83))/0x4*(-parseInt(_0x4279e8(0x8f))/0x5)+-parseInt(_0x4279e8(0x87))/0x6*(-parseInt(_0x4279e8(0x8d))/0x7)+parseInt(_0x4279e8(0x80))/0x8*(parseInt(_0x4279e8(0x86))/0x9)+parseInt(_0x4279e8(0x8e))/0xa*(parseInt(_0x4279e8(0x88))/0xb)+-parseInt(_0x4279e8(0x81))/0xc*(parseInt(_0x4279e8(0x89))/0xd);if(_0x3d19a0===_0x31b79c)break;else _0x131ad4['push'](_0x131ad4['shift']());}catch(_0x49cc66){_0x131ad4['push'](_0x131ad4['shift']());}}}(a34_0x4460,0x6de30));export const DEFAULT_APP_PROFILE_NAME=a34_0x17d49e(0x84);function a34_0x4fdb(_0x38ad4f,_0x1eafe1){_0x38ad4f=_0x38ad4f-0x80;const _0x446050=a34_0x4460();let _0x4fdb72=_0x446050[_0x38ad4f];return _0x4fdb72;}export const DEFAULT_CONFIG_VALUES={'env':'production','format':a34_0x17d49e(0x85),'locale':'en-US','riskLevel':a34_0x17d49e(0x8a)};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a34_0x17d49e(0x85);function a34_0x4460(){const _0x25aea8=['785adTjEj','8QMfLTM','1188cGsTOd','2MnJxSe','15704hVDynL','main','compress','3563874AbugGr','37668WPYnPo','19206LNCzDs','236067GPUMjK','write','1526iOiEnx','558075hacLMC','434SNsvvd','3790hNTzAq'];a34_0x4460=function(){return _0x25aea8;};return a34_0x4460();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a35_0xc8ea(_0x28ab7a,_0x230b96){_0x28ab7a=_0x28ab7a-0x85;const _0x113ea3=a35_0x113e();let _0xc8ea82=_0x113ea3[_0x28ab7a];return _0xc8ea82;}const a35_0x43dba1=a35_0xc8ea;(function(_0x5072a3,_0x58c318){const _0x2b6091=a35_0xc8ea,_0x1e1919=_0x5072a3();while(!![]){try{const _0xf64a20=-parseInt(_0x2b6091(0x88))/0x1+parseInt(_0x2b6091(0x90))/0x2+parseInt(_0x2b6091(0x8f))/0x3*(parseInt(_0x2b6091(0x8e))/0x4)+parseInt(_0x2b6091(0x91))/0x5*(parseInt(_0x2b6091(0x87))/0x6)+parseInt(_0x2b6091(0x8c))/0x7*(parseInt(_0x2b6091(0x8d))/0x8)+-parseInt(_0x2b6091(0x8a))/0x9+-parseInt(_0x2b6091(0x8b))/0xa*(parseInt(_0x2b6091(0x89))/0xb);if(_0xf64a20===_0x58c318)break;else _0x1e1919['push'](_0x1e1919['shift']());}catch(_0x2cbe0b){_0x1e1919['push'](_0x1e1919['shift']());}}}(a35_0x113e,0x49c40));import{PRODUCT_CONFIG}from'../constant/product.js';function a35_0x113e(){const _0x3ddd77=['5123574KNogoo','50naZlZF','1415918CNNbgZ','8OMSlPZ','904HIdBzf','6342kHDykL','980344GFMPgq','10GDRJrs','skillSource','npmRegistryBaseUrl','934542jAoZMy','363184ZsJrhJ','543642vyzeHY'];a35_0x113e=function(){return _0x3ddd77;};return a35_0x113e();}export const LOVRABET_NPM_PACKAGE_NAME=PRODUCT_CONFIG['npmPackageName'];export const LOVRABET_SKILL_SOURCE=PRODUCT_CONFIG[a35_0x43dba1(0x85)];export const NPM_REGISTRY_BASE_URL=PRODUCT_CONFIG[a35_0x43dba1(0x86)];
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a36_0x4881(_0x3d750c,_0x36cb1e){_0x3d750c=_0x3d750c-0x197;const _0x45ee12=a36_0x45ee();let _0x488116=_0x45ee12[_0x3d750c];return _0x488116;}const a36_0xdcc5f3=a36_0x4881;(function(_0x10c905,_0x20b08e){const _0x50abf8=a36_0x4881,_0x4a4696=_0x10c905();while(!![]){try{const _0x1362dd=-parseInt(_0x50abf8(0x19c))/0x1*(parseInt(_0x50abf8(0x199))/0x2)+-parseInt(_0x50abf8(0x1a1))/0x3*(-parseInt(_0x50abf8(0x1aa))/0x4)+parseInt(_0x50abf8(0x1a5))/0x5*(-parseInt(_0x50abf8(0x1a9))/0x6)+-parseInt(_0x50abf8(0x1a0))/0x7+parseInt(_0x50abf8(0x1a8))/0x8+parseInt(_0x50abf8(0x19b))/0x9*(parseInt(_0x50abf8(0x19f))/0xa)+parseInt(_0x50abf8(0x19d))/0xb*(parseInt(_0x50abf8(0x19e))/0xc);if(_0x1362dd===_0x20b08e)break;else _0x4a4696['push'](_0x4a4696['shift']());}catch(_0x134855){_0x4a4696['push'](_0x4a4696['shift']());}}}(a36_0x45ee,0xc2164));import{getEnv,isProduction}from'../constant/env.js';import{PRODUCT_CONFIG}from'../constant/product.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x42eea8){const _0x5ad937=a36_0x4881;customApiDomain=_0x42eea8?.[_0x5ad937(0x198)],customUserDomain=_0x42eea8?.[_0x5ad937(0x197)],customRuntimeDomain=_0x42eea8?.[_0x5ad937(0x1a4)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0xdcc5f3(0x1a6)][a36_0xdcc5f3(0x19a)]['user']:PRODUCT_CONFIG[a36_0xdcc5f3(0x1a6)]['nonProduction'][a36_0xdcc5f3(0x1a7)]);function a36_0x45ee(){const _0x1a37fe=['user','7741504dObmtW','2039754RypiEy','3356gopbkZ','api','userDomain','apiDomain','12gkadPI','production','2884068uUZpZU','262303dzShgI','1947946RpcZCG','12DqKftg','40tkwkLC','678223puUSdD','2571kJQELK','nonProduction','runtime','runtimeDomain','10zzuHsr','domains'];a36_0x45ee=function(){return _0x1a37fe;};return a36_0x45ee();}export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?PRODUCT_CONFIG['domains'][a36_0xdcc5f3(0x19a)]['api']:PRODUCT_CONFIG[a36_0xdcc5f3(0x1a6)][a36_0xdcc5f3(0x1a2)][a36_0xdcc5f3(0x1ab)]);export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?PRODUCT_CONFIG[a36_0xdcc5f3(0x1a6)][a36_0xdcc5f3(0x19a)][a36_0xdcc5f3(0x1a3)]:PRODUCT_CONFIG['domains'][a36_0xdcc5f3(0x1a2)][a36_0xdcc5f3(0x1a3)]);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a37_0x42076c=a37_0x242a;function a37_0xc523(){const _0x55a977=['online','3087940hdYOVT','2478690JYkmYd','250911nIQfUc','385854ssvlim','dev','1123612HvCgpn','70nssVKe','development','production','30734152fJJeJf','ENV','2028504AwcTVJ'];a37_0xc523=function(){return _0x55a977;};return a37_0xc523();}(function(_0x18ff4b,_0xb7bc02){const _0x53ed15=a37_0x242a,_0x26a6d3=_0x18ff4b();while(!![]){try{const _0x1f6678=-parseInt(_0x53ed15(0xef))/0x1+-parseInt(_0x53ed15(0xea))/0x2+parseInt(_0x53ed15(0xec))/0x3+-parseInt(_0x53ed15(0xe8))/0x4+-parseInt(_0x53ed15(0xeb))/0x5+parseInt(_0x53ed15(0xed))/0x6*(parseInt(_0x53ed15(0xf0))/0x7)+parseInt(_0x53ed15(0xe6))/0x8;if(_0x1f6678===_0xb7bc02)break;else _0x26a6d3['push'](_0x26a6d3['shift']());}catch(_0x1db8cd){_0x26a6d3['push'](_0x26a6d3['shift']());}}}(a37_0xc523,0xdb402));function a37_0x242a(_0x2862e3,_0x17d3dd){_0x2862e3=_0x2862e3-0xe5;const _0xc523fc=a37_0xc523();let _0x242afd=_0xc523fc[_0x2862e3];return _0x242afd;}import{productEnv}from'../constant/product.js';export const RUNTIME_ENV_VALUES=[a37_0x42076c(0xe5),'development','daily'];export function normalizeEnv(_0x3ccc56){const _0x489b4d=a37_0x42076c;return _0x3ccc56===_0x489b4d(0xe9)?_0x489b4d(0xe5):_0x3ccc56;}export function isProduction(_0x762573){const _0x4df5a0=a37_0x42076c;return normalizeEnv(_0x762573)===_0x4df5a0(0xe5);}export function isDaily(_0x37eb14){return normalizeEnv(_0x37eb14)==='daily';}export function isDev(_0x2431ee){const _0x7340be=a37_0x42076c,_0xf9266d=normalizeEnv(_0x2431ee);return _0xf9266d===_0x7340be(0xf1)||_0xf9266d===_0x7340be(0xee);}let env=normalizeEnv(productEnv(a37_0x42076c(0xe7))||a37_0x42076c(0xe5));export function getEnv(){return env;}export function initEnv(_0x5af367){env=normalizeEnv(_0x5af367);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x162b(){const _0xfff93a=['40CZxVwu','2184476bookJy','6kPkuCP','443239CyzXHy','4323780ZGKyHZ','compress','pretty','708453vMTrGw','387782rInBGE','5IxLrzE','7rgLWIy','json','13443067xrDPcy','1102158herhka'];a38_0x162b=function(){return _0xfff93a;};return a38_0x162b();}const a38_0x5f4b62=a38_0x3341;function a38_0x3341(_0x1db01e,_0x5c149b){_0x1db01e=_0x1db01e-0xfe;const _0x162b17=a38_0x162b();let _0x33412b=_0x162b17[_0x1db01e];return _0x33412b;}(function(_0x993565,_0x1eab6a){const _0x163d5b=a38_0x3341,_0x180e8b=_0x993565();while(!![]){try{const _0x2019dc=-parseInt(_0x163d5b(0x106))/0x1+-parseInt(_0x163d5b(0x10b))/0x2*(parseInt(_0x163d5b(0x105))/0x3)+-parseInt(_0x163d5b(0x104))/0x4*(-parseInt(_0x163d5b(0xfe))/0x5)+parseInt(_0x163d5b(0x102))/0x6*(parseInt(_0x163d5b(0xff))/0x7)+parseInt(_0x163d5b(0x103))/0x8*(-parseInt(_0x163d5b(0x10a))/0x9)+-parseInt(_0x163d5b(0x107))/0xa+parseInt(_0x163d5b(0x101))/0xb;if(_0x2019dc===_0x1eab6a)break;else _0x180e8b['push'](_0x180e8b['shift']());}catch(_0x45657c){_0x180e8b['push'](_0x180e8b['shift']());}}}(a38_0x162b,0x4800d));export const OUTPUT_FORMAT_VALUES=[a38_0x5f4b62(0x100),a38_0x5f4b62(0x109),a38_0x5f4b62(0x108)];
|
package/lib/constant/product.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x58a5(){const _0xb187ae=['32857wdpGMm','.lovrabetrc','755380uHSLcJ','RABETBASE','3708mNGyro','8dOdbcm','5464vZcArc','legacyEnvPrefixes','lovrabet','359010SIuROO','@lovrabet/lovrabet-cli','LOVRABET','https://daily-api.lovrabet.com','.lovrabet-runtime.log','map','1660708npLmfs','https://registry.npmjs.org','.lovrabet.json','lovrabet/lovrabet-cli','Lovrabet\x20User\x20Center','10171940NvRNhk','Lovrabet\x20Runtime\x20CLI','SKIP_NPX_SKILLS','envPrefix','https://user-daily.lovrabet.com','323427glTfjK','63zgwstD'];a39_0x58a5=function(){return _0xb187ae;};return a39_0x58a5();}function a39_0x52aa(_0x28160e,_0x4fd527){_0x28160e=_0x28160e-0x19d;const _0x58a57e=a39_0x58a5();let _0x52aa64=_0x58a57e[_0x28160e];return _0x52aa64;}const a39_0x523643=a39_0x52aa;(function(_0x579cfa,_0x3933ec){const _0x56a373=a39_0x52aa,_0x3e7df6=_0x579cfa();while(!![]){try{const _0x29681e=-parseInt(_0x56a373(0x1b6))/0x1*(-parseInt(_0x56a373(0x1a0))/0x2)+parseInt(_0x56a373(0x1b4))/0x3+parseInt(_0x56a373(0x1aa))/0x4+-parseInt(_0x56a373(0x19d))/0x5+-parseInt(_0x56a373(0x1a4))/0x6*(-parseInt(_0x56a373(0x1b5))/0x7)+-parseInt(_0x56a373(0x1a1))/0x8*(-parseInt(_0x56a373(0x19f))/0x9)+-parseInt(_0x56a373(0x1af))/0xa;if(_0x29681e===_0x3933ec)break;else _0x3e7df6['push'](_0x3e7df6['shift']());}catch(_0x3c625d){_0x3e7df6['push'](_0x3e7df6['shift']());}}}(a39_0x58a5,0x4ab87));export const PRODUCT_CONFIG={'cliBinName':a39_0x523643(0x1a3),'cliDisplayName':a39_0x523643(0x1b0),'npmPackageName':a39_0x523643(0x1a5),'skillSource':a39_0x523643(0x1ad),'npmRegistryBaseUrl':a39_0x523643(0x1ab),'envPrefix':a39_0x523643(0x1a6),'legacyEnvPrefixes':[a39_0x523643(0x19e)],'configFileNames':[a39_0x523643(0x1ac),a39_0x523643(0x1b7)],'newConfigFileName':a39_0x523643(0x1ac),'homeDirName':'.lovrabet','logFileName':a39_0x523643(0x1a8),'invokeSource':'cli:lovrabet-runtime','userCenterDisplayName':a39_0x523643(0x1ae),'skipNpxSkillsEnvSuffix':a39_0x523643(0x1b1),'domains':{'production':{'user':'https://user.lovrabet.com','api':'https://api.lovrabet.com','runtime':'https://runtime.lovrabet.com'},'nonProduction':{'user':a39_0x523643(0x1b3),'api':a39_0x523643(0x1a7),'runtime':'https://daily-runtime.lovrabet.com'}},'accessKeyCreatePath':'/user/ak'};export function productEnvName(_0x50241f){const _0xee0af2=a39_0x523643;return PRODUCT_CONFIG[_0xee0af2(0x1b2)]+'_'+_0x50241f;}export function productEnvNames(_0x18b581){const _0xf49e3e=a39_0x523643;return[productEnvName(_0x18b581),...PRODUCT_CONFIG[_0xf49e3e(0x1a2)][_0xf49e3e(0x1a9)](_0x6c0ddc=>_0x6c0ddc+'_'+_0x18b581)];}export function productEnv(_0x29dceb){for(const _0x376a4f of productEnvNames(_0x29dceb)){const _0x2a5ae4=process.env[_0x376a4f];if(_0x2a5ae4!==undefined)return _0x2a5ae4;}return undefined;}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x56928b=a40_0x265d;(function(_0x14a36b,_0x461fb7){const _0x56eb85=a40_0x265d,_0x3de713=_0x14a36b();while(!![]){try{const _0x309f70=-parseInt(_0x56eb85(0x7a))/0x1+-parseInt(_0x56eb85(0x7d))/0x2+-parseInt(_0x56eb85(0x73))/0x3*(parseInt(_0x56eb85(0x78))/0x4)+-parseInt(_0x56eb85(0x7c))/0x5+-parseInt(_0x56eb85(0x79))/0x6*(-parseInt(_0x56eb85(0x76))/0x7)+-parseInt(_0x56eb85(0x7b))/0x8*(-parseInt(_0x56eb85(0x77))/0x9)+parseInt(_0x56eb85(0x75))/0xa;if(_0x309f70===_0x461fb7)break;else _0x3de713['push'](_0x3de713['shift']());}catch(_0x34cb7a){_0x3de713['push'](_0x3de713['shift']());}}}(a40_0x3020,0x4f4e1));function a40_0x265d(_0x3aed5e,_0x21c8cf){_0x3aed5e=_0x3aed5e-0x73;const _0x302018=a40_0x3020();let _0x265d13=_0x302018[_0x3aed5e];return _0x265d13;}function a40_0x3020(){const _0x1a611c=['315502hSQhGN','16818IjxksF','high-risk-write','12158530WdOHlh','120904hDwkOW','99549ZOXTnA','248rYLdDX','60BCPOxd','270591iFPiMn','152RaYiJg','2489925GpWwgb'];a40_0x3020=function(){return _0x1a611c;};return a40_0x3020();}export const RISK_LEVEL_VALUES=['read','write',a40_0x56928b(0x74)];
|
package/lib/constant/url.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a41_0x295d(_0x32c9d8,_0x5557aa){_0x32c9d8=_0x32c9d8-0x179;const _0x58b2ae=a41_0x58b2();let _0x295deb=_0x58b2ae[_0x32c9d8];return _0x295deb;}function a41_0x58b2(){const _0x5af8a9=['domains','7JcNNfB','user','2967080oMtmfF','3772088wvSycE','5305EVBoTH','5VgWDAc','55lbNjDs','6883614CkVaLY','production','23186215IJprUK','accessKeyCreatePath','9961482QngmTT','3wqTwqs','12HTLjGC','913904bdRPuC','372IaSJEi'];a41_0x58b2=function(){return _0x5af8a9;};return a41_0x58b2();}const a41_0x485393=a41_0x295d;(function(_0x1e3dca,_0x401678){const _0x46dd99=a41_0x295d,_0x52d136=_0x1e3dca();while(!![]){try{const _0x3a7b76=parseInt(_0x46dd99(0x188))/0x1*(-parseInt(_0x46dd99(0x182))/0x2)+-parseInt(_0x46dd99(0x17f))/0x3*(parseInt(_0x46dd99(0x187))/0x4)+-parseInt(_0x46dd99(0x189))/0x5*(-parseInt(_0x46dd99(0x17e))/0x6)+-parseInt(_0x46dd99(0x184))/0x7*(-parseInt(_0x46dd99(0x181))/0x8)+parseInt(_0x46dd99(0x17a))/0x9+parseInt(_0x46dd99(0x186))/0xa*(-parseInt(_0x46dd99(0x179))/0xb)+-parseInt(_0x46dd99(0x180))/0xc*(-parseInt(_0x46dd99(0x17c))/0xd);if(_0x3a7b76===_0x401678)break;else _0x52d136['push'](_0x52d136['shift']());}catch(_0x45e6ae){_0x52d136['push'](_0x52d136['shift']());}}}(a41_0x58b2,0xde11a));import{PRODUCT_CONFIG}from'../constant/product.js';export const USER_ACCESS_KEY_CREATE_URL=''+PRODUCT_CONFIG[a41_0x485393(0x183)][a41_0x485393(0x17b)][a41_0x485393(0x185)]+PRODUCT_CONFIG[a41_0x485393(0x17d)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)]();}};}
|
|
1
|
+
const a42_0x255626=a42_0x9577;(function(_0x15c0d3,_0xf21a03){const _0x117a81=a42_0x9577,_0x2839cd=_0x15c0d3();while(!![]){try{const _0x4fe290=-parseInt(_0x117a81(0x1c0))/0x1*(parseInt(_0x117a81(0x1cd))/0x2)+-parseInt(_0x117a81(0x1a7))/0x3+parseInt(_0x117a81(0x1bb))/0x4*(-parseInt(_0x117a81(0x1a9))/0x5)+-parseInt(_0x117a81(0x1d2))/0x6+parseInt(_0x117a81(0x1b5))/0x7+parseInt(_0x117a81(0x1b0))/0x8*(-parseInt(_0x117a81(0x1cc))/0x9)+parseInt(_0x117a81(0x1dd))/0xa*(parseInt(_0x117a81(0x1db))/0xb);if(_0x4fe290===_0xf21a03)break;else _0x2839cd['push'](_0x2839cd['shift']());}catch(_0x42e278){_0x2839cd['push'](_0x2839cd['shift']());}}}(a42_0x4ac6,0xc4ef9));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_0x255626(0x1d1)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a42_0x255626(0x1c1)];function resolveConfigPath(_0x250d67){for(const _0xf91206 of CONFIG_NAMES){const _0x5c7767=resolve(_0x250d67,_0xf91206);if(existsSync(_0x5c7767))return _0x5c7767;}return undefined;}export function resolveWriteConfigPath(_0x4a4683){const _0x4829f7=a42_0x255626,_0x5492d1=_0x4a4683==='project'?process[_0x4829f7(0x1ce)]():homedir(),_0x12eb69=resolveConfigPath(_0x5492d1);return _0x12eb69??resolve(_0x5492d1,NEW_CONFIG_NAME);}export function readConfigFile(_0x3af9f9){const _0x4df433=a42_0x255626;try{if(existsSync(_0x3af9f9)){const _0x356741=readFileSync(_0x3af9f9,{'encoding':_0x4df433(0x1c9)});if(_0x356741){const _0xe79af9=JSON['parse'](_0x356741);return migrateOnlineEnv(_0x3af9f9,_0xe79af9),_0xe79af9;}}}catch{}return{};}function migrateOnlineEnv(_0x2d58df,_0x142097){const _0x5433fb=a42_0x255626;let _0x519b5d=![];_0x142097['env']==='online'&&(_0x142097[_0x5433fb(0x1c3)]=_0x5433fb(0x1ab),_0x519b5d=!![]);if(_0x142097['apps']&&typeof _0x142097[_0x5433fb(0x1ca)]===_0x5433fb(0x1bc))for(const _0x1e7bac of Object[_0x5433fb(0x1df)](_0x142097[_0x5433fb(0x1ca)])){_0x1e7bac&&_0x1e7bac['env']==='online'&&(_0x1e7bac[_0x5433fb(0x1c3)]=_0x5433fb(0x1ab),_0x519b5d=!![]);}if(_0x519b5d)try{writeConfigFile(_0x2d58df,_0x142097);}catch{}}export function writeConfigFile(_0xb8a1c7,_0x483996){const _0x357f3a=a42_0x255626,_0x5782ac=dirname(_0xb8a1c7);!existsSync(_0x5782ac)&&mkdirSync(_0x5782ac,{'recursive':!![]});const _0x32d825=_0xb8a1c7+_0x357f3a(0x1d5);try{writeFileSync(_0x32d825,JSON[_0x357f3a(0x1aa)](_0x483996,null,0x2)+'\x0a',{'encoding':_0x357f3a(0x1c9),'mode':0x180});try{renameSync(_0x32d825,_0xb8a1c7);}catch(_0x3dc383){if(_0x3dc383['code']===_0x357f3a(0x1b8)||_0x3dc383[_0x357f3a(0x1bd)]==='EXDEV'||_0x3dc383[_0x357f3a(0x1bd)]==='EACCES'){writeFileSync(_0xb8a1c7,JSON[_0x357f3a(0x1aa)](_0x483996,null,0x2)+'\x0a',{'encoding':_0x357f3a(0x1c9)});try{unlinkSync(_0x32d825);}catch{}}else throw _0x3dc383;}}catch(_0x4c259e){try{unlinkSync(_0x32d825);}catch{}throw _0x4c259e;}}export function isNonInteractiveMode(_0x1de60d){const _0x212c49=a42_0x255626;return!!(_0x1de60d['nonInteractive']||_0x1de60d['ci']||productEnvNames('CI')['some'](_0x1620fd=>process.env[_0x1620fd]===_0x212c49(0x1dc))||process.env.CI==='true'||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x50e5c9=a42_0x255626;if(!process[_0x50e5c9(0x1cf)][_0x50e5c9(0x1b4)])return![];try{const _0x3aa2be=process[_0x50e5c9(0x1cf)]['isRaw'];return process[_0x50e5c9(0x1cf)][_0x50e5c9(0x1e1)](!![]),process[_0x50e5c9(0x1cf)]['setRawMode'](_0x3aa2be??![]),!![];}catch{return![];}}export async function createContext(_0x1a923f){const _0x5e0809=a42_0x255626,_0x32b1e2=readRawConfig(),_0x4d86af=buildConfig(_0x32b1e2,_0x1a923f);await initGlobalEnvironment(_0x4d86af);const {getUserDomain:_0x5bdd85,getApiDomain:_0x366dfe}=await import(_0x5e0809(0x1be)),_0x418507={'apiDomain':_0x366dfe(),'userDomain':_0x5bdd85()},_0x14f713=await buildAuth(_0x4d86af);logger[_0x5e0809(0x1a6)](process[_0x5e0809(0x1ce)]());const _0x445cda=(CLI_BIN_NAME+'\x20'+process[_0x5e0809(0x1a3)][_0x5e0809(0x1af)](0x2)[_0x5e0809(0x1a2)]('\x20'))[_0x5e0809(0x1c8)]();logger['setRawCommand'](_0x445cda);const _0x23e276=isNonInteractiveMode(_0x1a923f);return{'config':_0x4d86af,'auth':_0x14f713,'logger':logger,'env':_0x418507,'nonInteractive':_0x23e276};}export function buildConfigFromFlags(_0x191fd6){return buildConfig(readRawConfig(),_0x191fd6);}export function getLocalAppAliases(_0x10caa7){const _0xaa4ae0=a42_0x255626;return _0x10caa7[_0xaa4ae0(0x1ca)]&&typeof _0x10caa7['apps']===_0xaa4ae0(0x1bc)?_0x10caa7[_0xaa4ae0(0x1ca)]:{};}function a42_0x4ac6(){const _0x46325c=['production','format','empty','daily','slice','8IuPuID','missing','pageSize','string','isTTY','903504nNuUez','high-risk-write','top-level','EPERM','global','read','500YWXOWX','object','code','./constant/domain.js','explicit','2612LMFZjW','newConfigFileName','cache','env','find','ACCESS_KEY','riskLevel','error','trim','utf8','apps','maxRisk','6235101hQJTNd','424arTHxN','cwd','stdin','PAGE_SIZE','configFileNames','5737428zwwPRl','parse','development','.tmp','write','locale','appcode','raw','accessKey','77EJDcsK','true','6450700DLcRHL','runtimeDomain','values','authRequired','setRawMode','projectConfig','app','join','argv','project','defaultApp','setLogPath','2994051nQMeRd','inherit','25485WFOcNg','stringify'];a42_0x4ac6=function(){return _0x46325c;};return a42_0x4ac6();}export function resolveLocalAppAliasCode(_0x15757f,_0x2c5f5e){const _0x5b0b51=a42_0x255626;if(!_0x2c5f5e)return undefined;const _0x53625e=getLocalAppAliases(_0x15757f)[_0x2c5f5e],_0x1d2128=_0x53625e?.[_0x5b0b51(0x1d8)];return typeof _0x1d2128===_0x5b0b51(0x1b3)&&_0x1d2128[_0x5b0b51(0x1c8)]()?_0x1d2128[_0x5b0b51(0x1c8)]():undefined;}export function readAppCodeFromConfig(){const _0x326025=a42_0x255626,_0x216d59=readRawConfig(),_0x5c44e1=_0x216d59['appcode']??_0x216d59[_0x326025(0x1a1)];if(typeof _0x5c44e1===_0x326025(0x1b3)&&_0x5c44e1[_0x326025(0x1c8)]())return _0x5c44e1[_0x326025(0x1c8)]();const _0x2ecd75=resolveLocalAppAliasCode(_0x216d59,typeof _0x216d59['defaultApp']===_0x326025(0x1b3)?_0x216d59[_0x326025(0x1a5)]:undefined);if(_0x2ecd75)return _0x2ecd75;const _0x4123f4=normalizeEnv(String(_0x216d59[_0x326025(0x1c3)]||_0x326025(0x1ab))),_0x2dc225=isDaily(_0x4123f4)?_0x326025(0x1ae):isDev(_0x4123f4)?_0x326025(0x1d4):_0x326025(0x1ab),_0x45ac63=resolveCachedAppCode(typeof _0x216d59['defaultApp']===_0x326025(0x1b3)?_0x216d59[_0x326025(0x1a5)]:undefined,_0x2dc225,typeof _0x216d59['accessKey']==='string'?_0x216d59[_0x326025(0x1da)]:undefined);if(_0x45ac63)return _0x45ac63;const _0x431ce3=Object[_0x326025(0x1df)](getLocalAppAliases(_0x216d59))[_0x326025(0x1c4)](_0x1c0977=>_0x1c0977?.[_0x326025(0x1d8)]);return typeof _0x431ce3?.[_0x326025(0x1d8)]===_0x326025(0x1b3)&&_0x431ce3['appcode'][_0x326025(0x1c8)]()?_0x431ce3[_0x326025(0x1d8)]['trim']():undefined;}export function readScopedConfig(_0x40c25c){const _0x235c6d=a42_0x255626,_0x302006=_0x40c25c[_0x235c6d(0x1b9)]?_0x235c6d(0x1b9):_0x235c6d(0x1a4);return readConfigFile(resolveWriteConfigPath(_0x302006));}export function writeScopedConfig(_0x585cd4,_0x56fa54){const _0x3eaeaf=a42_0x255626,_0x28566c=_0x56fa54[_0x3eaeaf(0x1b9)]?_0x3eaeaf(0x1b9):_0x3eaeaf(0x1a4);writeConfigFile(resolveWriteConfigPath(_0x28566c),_0x585cd4);}export async function initGlobalEnvironment(_0x226dfc){const _0x3932a6=a42_0x255626,{initEnv:_0x3c9dd8}=await import('./constant/env.js');_0x3c9dd8(_0x226dfc[_0x3932a6(0x1c3)]);const {initDomains:_0x58cdd5}=await import(_0x3932a6(0x1be));_0x58cdd5({'apiDomain':_0x226dfc[_0x3932a6(0x1d9)]['apiDomain']||_0x226dfc['raw']['host']||undefined,'userDomain':_0x226dfc['raw']['userDomain']||undefined,'runtimeDomain':_0x226dfc[_0x3932a6(0x1d9)][_0x3932a6(0x1de)]||undefined});}export function getProjectConfigPath(){const _0x59fee2=a42_0x255626;return resolveConfigPath(process[_0x59fee2(0x1ce)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x2ece1e){const _0x4567f6=a42_0x255626;if(!existsSync(_0x2ece1e))return{'status':_0x4567f6(0x1b1)};try{const _0x8295a4=readFileSync(_0x2ece1e,{'encoding':_0x4567f6(0x1c9)});if(!_0x8295a4?.[_0x4567f6(0x1c8)]())return{'status':_0x4567f6(0x1ad)};const _0x5e166b=JSON[_0x4567f6(0x1d3)](_0x8295a4);return{'status':'ok','data':_0x5e166b};}catch(_0x5b5f35){return{'status':_0x4567f6(0x1c7),'message':_0x5b5f35 instanceof Error?_0x5b5f35['message']:String(_0x5b5f35)};}}export function loadRawConfigLayers(_0x46485b){const _0x1465e3=a42_0x255626;let _0x1a44d1={},_0x4351a7={},_0x1f2aba,_0x128b50;try{_0x1f2aba=resolveConfigPath(homedir());if(_0x1f2aba){const _0x2030fa=readFileSync(_0x1f2aba,{'encoding':'utf8'});if(_0x2030fa)_0x1a44d1=JSON[_0x1465e3(0x1d3)](_0x2030fa);}}catch{}try{const _0x35aa6a=_0x46485b||process[_0x1465e3(0x1ce)]();_0x128b50=resolveConfigPath(_0x35aa6a);if(_0x128b50){const _0x179ca0=readFileSync(_0x128b50,{'encoding':_0x1465e3(0x1c9)});if(_0x179ca0)_0x4351a7=JSON[_0x1465e3(0x1d3)](_0x179ca0);}}catch{}return{'globalPath':_0x1f2aba,'projectPath':_0x128b50,'globalConfig':_0x1a44d1,'projectConfig':_0x4351a7};}function mergeRawConfigLayers(_0x50138d){const _0x30cef6=a42_0x255626,{globalConfig:_0x1a18ab,projectConfig:_0x14185c}=_0x50138d;if(_0x14185c['inherit']===![]){const _0x4d377a={..._0x14185c};return delete _0x4d377a[_0x30cef6(0x1a8)],_0x4d377a;}const _0xeba86={..._0x1a18ab,..._0x14185c};if('defaultApp'in _0x14185c)_0xeba86[_0x30cef6(0x1a5)]=_0x14185c[_0x30cef6(0x1a5)];else _0x1a18ab[_0x30cef6(0x1a5)]&&(_0xeba86[_0x30cef6(0x1a5)]=_0x1a18ab[_0x30cef6(0x1a5)]);return _0xeba86;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x402985){return mergeRawConfigLayers(loadRawConfigLayers(_0x402985));}function a42_0x9577(_0x4e01dc,_0x549fdc){_0x4e01dc=_0x4e01dc-0x1a1;const _0x4ac608=a42_0x4ac6();let _0x9577ed=_0x4ac608[_0x4e01dc];return _0x9577ed;}export function readRawConfigWithLayers(_0x544682){const _0x37956c=loadRawConfigLayers(_0x544682);return{'config':mergeRawConfigLayers(_0x37956c),'layers':_0x37956c};}export function resolveDefaultAppSource(_0x323add){const _0x3d3e5d=a42_0x255626;if(_0x3d3e5d(0x1a5)in _0x323add[_0x3d3e5d(0x1e2)])return _0x3d3e5d(0x1a4);if(_0x323add[_0x3d3e5d(0x1e2)][_0x3d3e5d(0x1a8)]===![])return null;if(_0x323add['globalConfig'][_0x3d3e5d(0x1a5)])return _0x3d3e5d(0x1b9);return null;}function buildConfig(_0x33ff30,_0x3539c8){const _0x17de16=a42_0x255626,_0x2baa96=_0x33ff30[_0x17de16(0x1a5)]||undefined,_0x4c55c3=_0x3539c8[_0x17de16(0x1a1)]||env('APP')||undefined,_0x2ba5a6=_0x4c55c3||_0x2baa96||undefined,_0x526715=env(_0x17de16(0x1c5))||_0x33ff30[_0x17de16(0x1da)]||undefined,_0x2b8a97=_0x3539c8['env']||env('ENV')||_0x33ff30[_0x17de16(0x1c3)]||DEFAULT_CONFIG_VALUES['env'],_0x17a830=normalizeEnv(String(_0x2b8a97)),_0x561ccf=isDaily(_0x17a830)?_0x17de16(0x1ae):isDev(_0x17a830)?'development':_0x17de16(0x1ab),_0x1d4d7d=resolveLocalAppAliasCode(_0x33ff30,_0x2ba5a6),_0x27f97f=resolveCachedAppCode(_0x2ba5a6,_0x561ccf,_0x526715),_0x4d9915=typeof _0x3539c8['appcode']==='string'?_0x3539c8[_0x17de16(0x1d8)]:undefined,_0x2edcf8=env('APPCODE'),_0x2d9d30=_0x4c55c3?undefined:_0x33ff30[_0x17de16(0x1d8)]||_0x33ff30[_0x17de16(0x1a1)]||undefined,_0x5901ea=_0x4d9915||_0x2edcf8||_0x1d4d7d||_0x27f97f||_0x2d9d30||undefined,_0x37a14f=_0x4d9915?_0x17de16(0x1bf):_0x2edcf8?'env':_0x1d4d7d?'local-alias':_0x27f97f?_0x17de16(0x1c2):_0x2d9d30?_0x17de16(0x1b7):undefined,_0xa0a9e9=_0x33ff30[_0x17de16(0x1d7)]||DEFAULT_CONFIG_VALUES[_0x17de16(0x1d7)],_0x10e406=undefined,_0x3340b4=_0x3539c8['format']||env('FORMAT')||_0x33ff30[_0x17de16(0x1ac)],_0x26f0f3=normalizeLegacyOutputFormat(_0x3340b4),_0x237942=env(_0x17de16(0x1d0))||_0x33ff30[_0x17de16(0x1b2)],_0x5ca2bb=_0x237942?Number(_0x237942)||undefined:undefined,_0x4ecbcc=_0x33ff30[_0x17de16(0x1c6)]||_0x33ff30[_0x17de16(0x1cb)],_0x402b25=_0x4ecbcc===_0x17de16(0x1ba)||_0x4ecbcc===_0x17de16(0x1d6)||_0x4ecbcc===_0x17de16(0x1b6)?_0x4ecbcc:DEFAULT_CONFIG_VALUES[_0x17de16(0x1c6)],_0x204e56=env('VERBOSE'),_0x2ff06f=_0x204e56==='1'||_0x204e56==='true';return{'appCode':typeof _0x5901ea===_0x17de16(0x1b3)&&_0x5901ea[_0x17de16(0x1c8)]()?_0x5901ea['trim']():undefined,'appCodeSource':_0x37a14f,'env':_0x561ccf,'locale':_0xa0a9e9,'cookie':_0x10e406,'accessKey':_0x526715,'format':_0x26f0f3,'pageSize':_0x5ca2bb,'riskLevel':_0x402b25,'verbose':_0x2ff06f,'defaultApp':_0x2baa96,'currentApp':typeof _0x2ba5a6===_0x17de16(0x1b3)?_0x2ba5a6:undefined,'raw':_0x33ff30};}function env(_0x5e8ebf){return productEnv(_0x5e8ebf);}async function buildAuth(_0x31ab80){const _0x5ed40b=a42_0x255626,_0xb6f65b='',_0x3d46f7=!!_0x31ab80[_0x5ed40b(0x1da)];return{'cookie':_0xb6f65b,'isLoggedIn':_0x3d46f7,async 'getOrLogin'(){const _0x1ed7f3=_0x5ed40b;if(_0x3d46f7)return _0xb6f65b;throw CliErrors[_0x1ed7f3(0x1e0)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x166fbe,_0x5c2eeb){const _0x32282b=a43_0x2162,_0x448209=_0x166fbe();while(!![]){try{const _0x45bf81=parseInt(_0x32282b(0xb3))/0x1+parseInt(_0x32282b(0xb2))/0x2+parseInt(_0x32282b(0xa8))/0x3+parseInt(_0x32282b(0x7d))/0x4*(parseInt(_0x32282b(0x9c))/0x5)+parseInt(_0x32282b(0xa2))/0x6+-parseInt(_0x32282b(0x94))/0x7+parseInt(_0x32282b(0xac))/0x8*(-parseInt(_0x32282b(0xaf))/0x9);if(_0x45bf81===_0x5c2eeb)break;else _0x448209['push'](_0x448209['shift']());}catch(_0x2fdf24){_0x448209['push'](_0x448209['shift']());}}}(a43_0x59c6,0xc8420));import{getRuntimeDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';function a43_0x2162(_0x425987,_0x245da2){_0x425987=_0x425987-0x7b;const _0x59c629=a43_0x59c6();let _0x216234=_0x59c629[_0x425987];return _0x216234;}import{extractList}from'../framework/response.js';function a43_0x59c6(){const _0x3a2fd3=['string','9BneaYg','Request\x20timeout:\x20','topK','1731448ltUquX','1046922gENxel','json','code','Check\x20your\x20credentials\x20and\x20try\x20again.','API\x20error:\x20','validation','1271596ZLDcjI','tableData','/client/dataset/query?','application/json','abort','errorMsg','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','errorCode','success','/client/skill/company/list?appCode=','name','sqlCode','object','/client/app/my-apps','appCode','/client/knowledge-base/search','/update','/client/dataset/list','/client/sql/query','test','message','stringify','/client/skill/personal/create','11220377KswWma','isArray','/client/knowledge-base/personal/','data','?appCode=','BFF\x20script\x20not\x20found:\x20id=','/client/knowledge-base/personal/list?appCode=','AbortError','25BxUvZw','newConfigFileName','apiError','GET','invokeSource','filter','4283382DpWDGq','/client/skill/personal/','status','POST','Knowledge-base\x20entry\x20not\x20found:\x20id=','/client/knowledge-base/personal/create','3256278yIjRmP','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','authRequired','query','23026376uFKSzO','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.'];a43_0x59c6=function(){return _0x3a2fd3;};return a43_0x59c6();}let _activeAK;export function setActiveAK(_0x507434){_activeAK=_0x507434||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x5ccefe,_0x3a0b60={}){const _0xf6f861=a43_0x2162,{method:method=_0xf6f861(0x9f),body:_0x146ff5,headers:headers={},timeout:timeout=0x7530}=_0x3a0b60,_0x2f70e9=_activeAK,_0x140809=getRuntimeDomain();if(!_0x2f70e9)throw CliErrors[_0xf6f861(0xaa)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0xf6f861(0x9d)]+'.');const _0x33934d=''+_0x140809+_0x5ccefe,_0x47ea55={'X-User-AK':_0x2f70e9},_0x4a58ac=new AbortController(),_0x407bdb=setTimeout(()=>_0x4a58ac[_0xf6f861(0x81)](),timeout);try{const _0x50b3a9=await fetch(_0x33934d,{'method':method,'headers':{'Content-Type':_0xf6f861(0x80),'X-Invoke-Source':PRODUCT_CONFIG[_0xf6f861(0xa0)],..._0x47ea55,...headers},'body':_0x146ff5?JSON[_0xf6f861(0x92)](_0x146ff5):undefined,'signal':_0x4a58ac['signal']});let _0x47930e;try{_0x47930e=await _0x50b3a9[_0xf6f861(0xb4)]();}catch{throw CliErrors['apiError'](_0xf6f861(0x83)+_0x50b3a9[_0xf6f861(0xa4)]+')',_0x50b3a9[_0xf6f861(0xa4)]>=0x190?_0xf6f861(0xb6):undefined);}if(!_0x50b3a9['ok']||_0x47930e[_0xf6f861(0x85)]===![])throw CliErrors[_0xf6f861(0x9e)](_0x47930e[_0xf6f861(0x82)]||_0x47930e[_0xf6f861(0x91)]||_0xf6f861(0x7b)+_0x50b3a9['status'],_0x47930e[_0xf6f861(0x84)]?'API\x20error\x20code:\x20'+_0x47930e['errorCode']:undefined);return _0x47930e;}catch(_0x2e54fe){if(_0x2e54fe instanceof Error&&_0x2e54fe[_0xf6f861(0x87)]===_0xf6f861(0x9b))throw CliErrors[_0xf6f861(0x9e)](_0xf6f861(0xb0)+_0x33934d);throw _0x2e54fe;}finally{clearTimeout(_0x407bdb);}}export async function getBffScriptInfo(_0x276d28){const _0x50b9f4=a43_0x2162,_0x42c6ff=await apiRequest('/client/bff/query/'+_0x276d28);if(!_0x42c6ff['data'])throw CliErrors[_0x50b9f4(0x7c)](_0x50b9f4(0x99)+_0x276d28);return _0x42c6ff[_0x50b9f4(0x97)];}export async function getSqlQueryInfo(_0x341ed9,_0x17c60d){const _0x5dd67f=a43_0x2162,_0x149c9c=await apiRequest(_0x5dd67f(0x8f),{'method':_0x5dd67f(0xa5),'body':{'appCode':_0x341ed9,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x17c60d}}),_0x176972=_0x149c9c[_0x5dd67f(0x97)],_0x55e2ff=_0x176972&&typeof _0x176972===_0x5dd67f(0x89)&&_0x5dd67f(0x7e)in _0x176972?_0x176972[_0x5dd67f(0x7e)]?.[0x0]:_0x176972&&typeof _0x176972===_0x5dd67f(0x89)&&_0x5dd67f(0x88)in _0x176972?_0x176972:undefined;if(!_0x55e2ff)throw CliErrors[_0x5dd67f(0x7c)]('SQL\x20query\x20not\x20found:\x20'+_0x17c60d);return _0x55e2ff;}function isRemoteAppItem(_0x130416){const _0x3727d1=a43_0x2162;return!!_0x130416&&typeof _0x130416===_0x3727d1(0x89)&&typeof _0x130416[_0x3727d1(0x8b)]===_0x3727d1(0xae)&&typeof _0x130416['appName']==='string';}function extractRemoteAppItems(_0x422455){const _0x41eb5f=a43_0x2162;if(Array[_0x41eb5f(0x95)](_0x422455))return _0x422455[_0x41eb5f(0xa1)](isRemoteAppItem);if(!_0x422455||typeof _0x422455!=='object')throw CliErrors[_0x41eb5f(0x9e)](_0x41eb5f(0xad));const _0x3ca433=_0x422455;if(Array[_0x41eb5f(0x95)](_0x3ca433[_0x41eb5f(0x7e)]))return _0x3ca433['tableData'][_0x41eb5f(0xa1)](isRemoteAppItem);if(_0x3ca433[_0x41eb5f(0x97)]&&typeof _0x3ca433[_0x41eb5f(0x97)]===_0x41eb5f(0x89)){const _0x5d4b21=_0x3ca433[_0x41eb5f(0x97)];if(Array[_0x41eb5f(0x95)](_0x5d4b21['tableData']))return _0x5d4b21[_0x41eb5f(0x7e)][_0x41eb5f(0xa1)](isRemoteAppItem);}throw CliErrors[_0x41eb5f(0x9e)]('Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.');}export async function getMyApps(){const _0x4171b4=a43_0x2162,_0x103ca3=await apiRequest(_0x4171b4(0x8a));return extractRemoteAppItems(_0x103ca3[_0x4171b4(0x97)]);}export async function getLoginUserInfo(){const _0x49c979=a43_0x2162,_0x42c014=await apiRequest('/client/user/loginUserInfo');if(!_0x42c014[_0x49c979(0x97)]||typeof _0x42c014[_0x49c979(0x97)]!==_0x49c979(0x89)||Array[_0x49c979(0x95)](_0x42c014[_0x49c979(0x97)]))throw CliErrors[_0x49c979(0x9e)](_0x49c979(0xa9));return _0x42c014[_0x49c979(0x97)];}export async function listDatasets(_0x50e13b,_0x361205){const _0x24bf3d=a43_0x2162,_0x5cca83=await apiRequest(_0x24bf3d(0x8e),{'method':_0x24bf3d(0xa5),'body':{'appCode':_0x50e13b,..._0x361205?.['code']&&{'code':_0x361205[_0x24bf3d(0xb5)]},..._0x361205?.[_0x24bf3d(0x87)]&&{'name':_0x361205['name']}}});return extractList(_0x5cca83[_0x24bf3d(0x97)]);}export async function getDatasetDetail(_0x378ab1){const _0x5a882a=a43_0x2162,_0x249952=/^\d+$/[_0x5a882a(0x90)](_0x378ab1)?'id':'code',_0x285ca1=await apiRequest(_0x5a882a(0x7f)+_0x249952+'='+_0x378ab1);return _0x285ca1[_0x5a882a(0x97)];}export async function listPersonalKnowledgeBaseItems(_0x5ae1f3){const _0x442036=a43_0x2162,_0x4570d6=await apiRequest(_0x442036(0x9a)+encodeURIComponent(_0x5ae1f3));return Array[_0x442036(0x95)](_0x4570d6[_0x442036(0x97)])?_0x4570d6[_0x442036(0x97)]:[];}export async function getPersonalKnowledgeBaseItem(_0x27b42e,_0x36eddc){const _0x29fea6=a43_0x2162,_0x741cc0=await apiRequest(_0x29fea6(0x96)+_0x27b42e+_0x29fea6(0x98)+encodeURIComponent(_0x36eddc));if(!_0x741cc0['data'])throw CliErrors[_0x29fea6(0x7c)](_0x29fea6(0xa6)+_0x27b42e);return _0x741cc0[_0x29fea6(0x97)];}export async function createPersonalKnowledgeBaseItem(_0x1d1189,_0x218777){const _0x5e8648=a43_0x2162,_0x503a3c=await apiRequest(_0x5e8648(0xa7),{'method':_0x5e8648(0xa5),'body':{'appCode':_0x1d1189,..._0x218777}});return _0x503a3c['data'];}export async function updatePersonalKnowledgeBaseItem(_0x2fe970,_0x514cb6,_0x5bd3f9){const _0x4c9a8c=a43_0x2162,_0x31433e=await apiRequest(_0x4c9a8c(0x96)+_0x2fe970+_0x4c9a8c(0x8d),{'method':_0x4c9a8c(0xa5),'body':{'appCode':_0x514cb6,..._0x5bd3f9}});return _0x31433e[_0x4c9a8c(0x97)];}export async function searchKnowledgeBase(_0x2820eb,_0x20c9d0){const _0x21fa7c=a43_0x2162,_0xf9da3f=await apiRequest(_0x21fa7c(0x8c),{'method':_0x21fa7c(0xa5),'body':{'appCode':_0x2820eb,'query':_0x20c9d0[_0x21fa7c(0xab)],..._0x20c9d0[_0x21fa7c(0xb1)]!==undefined?{'topK':_0x20c9d0[_0x21fa7c(0xb1)]}:{}}});return Array[_0x21fa7c(0x95)](_0xf9da3f[_0x21fa7c(0x97)])?_0xf9da3f[_0x21fa7c(0x97)]:[];}export async function listPersonalRuntimeSkills(_0x574171){const _0x204a21=a43_0x2162,_0x539c0d=await apiRequest('/client/skill/personal/list?appCode='+encodeURIComponent(_0x574171));return Array[_0x204a21(0x95)](_0x539c0d['data'])?_0x539c0d['data']:[];}export async function listCompanyRuntimeSkills(_0x296e3e){const _0x326c63=a43_0x2162,_0x5dbdd8=await apiRequest(_0x326c63(0x86)+encodeURIComponent(_0x296e3e));return Array[_0x326c63(0x95)](_0x5dbdd8[_0x326c63(0x97)])?_0x5dbdd8[_0x326c63(0x97)]:[];}export async function createPersonalRuntimeSkill(_0x597716,_0xbad8c2){const _0x3dff92=a43_0x2162,_0x2d3c98=await apiRequest(_0x3dff92(0x93),{'method':_0x3dff92(0xa5),'body':{'appCode':_0x597716,..._0xbad8c2}});return _0x2d3c98['data'];}export async function updatePersonalRuntimeSkill(_0x292147,_0x1a4078,_0x3d4332){const _0xea6bb0=a43_0x2162,_0x29ef15=await apiRequest(_0xea6bb0(0xa3)+encodeURIComponent(_0x292147)+'/update',{'method':_0xea6bb0(0xa5),'body':{'appCode':_0x1a4078,..._0x3d4332}});return _0x29ef15[_0xea6bb0(0x97)];}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a77a3,_0xa9232a){const _0x2f9705=a44_0x2ce3,_0x1112d6=_0x2a77a3();while(!![]){try{const _0x319fc7=parseInt(_0x2f9705(0x1e3))/0x1+-parseInt(_0x2f9705(0x1f3))/0x2+-parseInt(_0x2f9705(0x1e2))/0x3*(parseInt(_0x2f9705(0x1e6))/0x4)+-parseInt(_0x2f9705(0x1e9))/0x5*(-parseInt(_0x2f9705(0x1ed))/0x6)+parseInt(_0x2f9705(0x1e5))/0x7+-parseInt(_0x2f9705(0x1e1))/0x8*(-parseInt(_0x2f9705(0x1f1))/0x9)+-parseInt(_0x2f9705(0x1f2))/0xa*(parseInt(_0x2f9705(0x1e7))/0xb);if(_0x319fc7===_0xa9232a)break;else _0x1112d6['push'](_0x1112d6['shift']());}catch(_0x545253){_0x1112d6['push'](_0x1112d6['shift']());}}}(a44_0x1de3,0xdc611));import{listDatasets}from'../core/api-client.js';function a44_0x1de3(){const _0x572912=['dbName','db-','entries','9Wpytnl','11248170iQyjBU','336900HYoXnA','dbId','727568FJXiiS','2553ruXhGt','695980JvtFzO','get','9858590IjUIPL','3964GCbRPR','11rtlHPl','has','575ALrFxB','set','dbtableConfig','find','44034ukIJUC'];a44_0x1de3=function(){return _0x572912;};return a44_0x1de3();}const cache=new Map();export async function listDatabases(_0x564740){const _0x1f0a22=a44_0x2ce3;if(cache[_0x1f0a22(0x1e8)](_0x564740))return cache[_0x1f0a22(0x1e4)](_0x564740);const _0xe8f0db=await listDatasets(_0x564740),_0x4a7f10=new Map();for(const _0x3e9ade of _0xe8f0db){const _0x58a73d=_0x3e9ade[_0x1f0a22(0x1eb)];_0x58a73d?.['dbId']!=null&&_0x4a7f10[_0x1f0a22(0x1ea)](_0x58a73d[_0x1f0a22(0x1e0)],_0x58a73d[_0x1f0a22(0x1ee)]??_0x1f0a22(0x1ef)+_0x58a73d[_0x1f0a22(0x1e0)]);}const _0x5e8ff9=[..._0x4a7f10[_0x1f0a22(0x1f0)]()]['map'](([_0x60abc2,_0x503106])=>({'dbId':_0x60abc2,'dbName':_0x503106}));return cache[_0x1f0a22(0x1ea)](_0x564740,_0x5e8ff9),_0x5e8ff9;}function a44_0x2ce3(_0x401d56,_0x5034ef){_0x401d56=_0x401d56-0x1e0;const _0x1de31a=a44_0x1de3();let _0x2ce3da=_0x1de31a[_0x401d56];return _0x2ce3da;}export async function getDbName(_0x26b0ab,_0x5a09c0){const _0x21dbbb=a44_0x2ce3;try{const _0x504832=await listDatabases(_0x26b0ab);return _0x504832[_0x21dbbb(0x1ec)](_0x56d42c=>_0x56d42c['dbId']===_0x5a09c0)?.['dbName'];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a45_0xb4a4(){const _0x3e4a50=['bff','2655824sxtPAf','1256UpexQS','298751ntoXtN','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27','models','3kYLJcp','delete','\x22.\x20','970934rBwCgZ','10567139ppKGtj','batchCreate','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','774RkybhB','update','41545RkbaPd','452615HbRSsM','authMode','execute','env','dataset_','getOne','accessKey','42unxloX','55970melCDW','SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.','36rJVTav'];a45_0xb4a4=function(){return _0x3e4a50;};return a45_0xb4a4();}(function(_0x3327e5,_0x53b216){const _0x11d640=a45_0x3b47,_0x573d51=_0x3327e5();while(!![]){try{const _0x9689ef=-parseInt(_0x11d640(0x81))/0x1+-parseInt(_0x11d640(0x87))/0x2*(parseInt(_0x11d640(0x84))/0x3)+parseInt(_0x11d640(0x7f))/0x4+parseInt(_0x11d640(0x8e))/0x5*(-parseInt(_0x11d640(0x95))/0x6)+parseInt(_0x11d640(0x8d))/0x7*(-parseInt(_0x11d640(0x80))/0x8)+parseInt(_0x11d640(0x8b))/0x9*(-parseInt(_0x11d640(0x96))/0xa)+parseInt(_0x11d640(0x88))/0xb*(parseInt(_0x11d640(0x98))/0xc);if(_0x9689ef===_0x53b216)break;else _0x573d51['push'](_0x573d51['shift']());}catch(_0x141adb){_0x573d51['push'](_0x573d51['shift']());}}}(a45_0xb4a4,0xae887));import{createClient}from'@lovrabet/sdk';import{parseBatchCreateItemsFromParams}from'../utils/params.js';function a45_0x3b47(_0x5a4058,_0x1642cb){_0x5a4058=_0x5a4058-0x7f;const _0xb4a42d=a45_0xb4a4();let _0x3b479a=_0xb4a42d[_0x5a4058];return _0x3b479a;}let _client;export function initSdkClient(_0x31a108){const _0x46b199=a45_0x3b47;_client=createClient({'appCode':_0x31a108['appCode'],'env':_0x31a108[_0x46b199(0x91)],'authMode':_0x31a108[_0x46b199(0x8f)],..._0x31a108[_0x46b199(0x94)]?{'accessKey':_0x31a108[_0x46b199(0x94)]}:{},'options':{'timeout':0x7530}});}function ensureClient(){const _0x10c485=a45_0x3b47;if(!_client)throw new Error(_0x10c485(0x97));return _client;}export async function executeData(_0x1788d4,_0x10ea51,_0x28ed31){const _0x265527=a45_0x3b47,_0x3ce654=ensureClient(),_0x36aec9=_0x265527(0x92)+_0x1788d4,_0x458cbb=_0x3ce654[_0x265527(0x83)][_0x36aec9];if(!_0x458cbb||typeof _0x458cbb[_0x10ea51]!=='function')throw new Error('SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22'+_0x10ea51+_0x265527(0x86)+'Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.');if(_0x10ea51===_0x265527(0x89))return _0x458cbb['batchCreate'](parseBatchCreateItemsFromParams(_0x28ed31));const _0x2281b0=_0x28ed31!==undefined&&_0x28ed31!==null&&!Array['isArray'](_0x28ed31)?_0x28ed31:{};switch(_0x10ea51){case _0x265527(0x93):{const _0x71c36e=_0x2281b0['id'];if(_0x71c36e===undefined||_0x71c36e===null)throw new Error('getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27');return _0x458cbb['getOne'](_0x71c36e);}case _0x265527(0x8c):{const {id:_0x152293,..._0x5e5e6c}=_0x2281b0;if(_0x152293===undefined||_0x152293===null)throw new Error(_0x265527(0x82));return _0x458cbb[_0x265527(0x8c)](_0x152293,_0x5e5e6c);}case _0x265527(0x85):{const _0x54fed4=_0x2281b0['id'];if(_0x54fed4===undefined||_0x54fed4===null)throw new Error(_0x265527(0x8a));return _0x458cbb['delete'](_0x54fed4);}default:return _0x458cbb[_0x10ea51](_0x2281b0);}}export async function executeSdkSql(_0xdcbc29,_0x59cbfa){const _0x20513c=ensureClient();return _0x20513c['sql']['execute']({'sqlCode':_0xdcbc29,'params':_0x59cbfa});}export async function executeSdkBff(_0x23d197,_0x5c474b){const _0x3baa00=a45_0x3b47,_0x207e79=ensureClient();return _0x207e79[_0x3baa00(0x99)][_0x3baa00(0x90)]({'scriptName':_0x23d197,'params':_0x5c474b});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x57995e=a46_0x43af;(function(_0x6ebf3c,_0x5ae794){const _0x170c6d=a46_0x43af,_0x476135=_0x6ebf3c();while(!![]){try{const _0x46af73=-parseInt(_0x170c6d(0x200))/0x1+parseInt(_0x170c6d(0x1fa))/0x2*(-parseInt(_0x170c6d(0x202))/0x3)+-parseInt(_0x170c6d(0x1fd))/0x4*(-parseInt(_0x170c6d(0x201))/0x5)+-parseInt(_0x170c6d(0x1f6))/0x6*(-parseInt(_0x170c6d(0x1ff))/0x7)+parseInt(_0x170c6d(0x1f3))/0x8*(parseInt(_0x170c6d(0x1f4))/0x9)+-parseInt(_0x170c6d(0x1f8))/0xa*(-parseInt(_0x170c6d(0x1f5))/0xb)+-parseInt(_0x170c6d(0x1fe))/0xc;if(_0x46af73===_0x5ae794)break;else _0x476135['push'](_0x476135['shift']());}catch(_0x475964){_0x476135['push'](_0x476135['shift']());}}}(a46_0x71c9,0x21403));function a46_0x43af(_0x24b369,_0xe36b35){_0x24b369=_0x24b369-0x1f3;const _0x71c99d=a46_0x71c9();let _0x43af5c=_0x71c99d[_0x24b369];return _0x43af5c;}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';function a46_0x71c9(){const _0x1a73ee=['305263LGeaDQ','243174bndhSR','805ewZbaW','3384mqMDnf','newConfigFileName','232fdbxKG','61272IMRoNm','715tVFbvz','30HwgKXE','\x20auth\x20login`.','23100DFYbMb','Set\x20appcode\x20via\x20--appcode\x20or\x20','8bcukCF','\x20or\x20run\x20`','\x20file.','1804NrNYrv','3052284azwajA'];a46_0x71c9=function(){return _0x1a73ee;};return a46_0x71c9();}export{CliError};export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':'Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG['newConfigFileName']+a46_0x57995e(0x1fb)+CLI_BIN_NAME+a46_0x57995e(0x1f7),'configMissingHint':a46_0x57995e(0x1f9)+PRODUCT_CONFIG['newConfigFileName']+'.','notInProjectHint':'Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20'+PRODUCT_CONFIG[a46_0x57995e(0x203)]+a46_0x57995e(0x1fc)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x1310(){var _0x23cffd=['420093HbhZGD','366Xmzgze','4275964SKaFjB','26135LuRHLI','1456965HWFDeJ','1116126gnWVDX','6034552NboXjq','1488712MYgYyX'];a47_0x1310=function(){return _0x23cffd;};return a47_0x1310();}(function(_0x20b42f,_0x409041){var _0x3858f6=a47_0xf41e,_0x12c568=_0x20b42f();while(!![]){try{var _0x2cc9e9=-parseInt(_0x3858f6(0x161))/0x1+parseInt(_0x3858f6(0x15e))/0x2+-parseInt(_0x3858f6(0x15d))/0x3+-parseInt(_0x3858f6(0x160))/0x4+parseInt(_0x3858f6(0x15c))/0x5*(-parseInt(_0x3858f6(0x15a))/0x6)+parseInt(_0x3858f6(0x15b))/0x7+parseInt(_0x3858f6(0x15f))/0x8;if(_0x2cc9e9===_0x409041)break;else _0x12c568['push'](_0x12c568['shift']());}catch(_0x2b78a3){_0x12c568['push'](_0x12c568['shift']());}}}(a47_0x1310,0x4fb3d));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';function a47_0xf41e(_0x3a842a,_0x798d26){_0x3a842a=_0x3a842a-0x15a;var _0x1310cd=a47_0x1310();var _0xf41e0a=_0x1310cd[_0x3a842a];return _0xf41e0a;}import{buildAllFlags as a47_0x64e93e}from'@lovrabet/cli-framework';export function buildAllFlags(_0x9290ed){return a47_0x64e93e(_0x9290ed,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a48_0x263d(_0x1bd5e6,_0x4cfbef){_0x1bd5e6=_0x1bd5e6-0xfc;const _0x47c8d4=a48_0x47c8();let _0x263dfd=_0x47c8d4[_0x1bd5e6];return _0x263dfd;}function a48_0x47c8(){const _0x4def54=['3033ogjsTm','1043zJfPgf','944932OeZMoW','82608zqlmGx','body','135406jfxJsC','description','4064DVgYGr','1843525vjQNdp','390224gtGzAm','4710dkbzen'];a48_0x47c8=function(){return _0x4def54;};return a48_0x47c8();}(function(_0x4b7fc1,_0x23b134){const _0x131d9f=a48_0x263d,_0x48eafe=_0x4b7fc1();while(!![]){try{const _0x468ab5=-parseInt(_0x131d9f(0xfe))/0x1+parseInt(_0x131d9f(0x102))/0x2+parseInt(_0x131d9f(0xfc))/0x3+parseInt(_0x131d9f(0x106))/0x4+-parseInt(_0x131d9f(0x101))/0x5+-parseInt(_0x131d9f(0x103))/0x6*(-parseInt(_0x131d9f(0x105))/0x7)+parseInt(_0x131d9f(0x100))/0x8*(parseInt(_0x131d9f(0x104))/0x9);if(_0x468ab5===_0x23b134)break;else _0x48eafe['push'](_0x48eafe['shift']());}catch(_0x1a3abb){_0x48eafe['push'](_0x48eafe['shift']());}}}(a48_0x47c8,0x3b4f3));export function dryRun(_0x312244,_0x3e48d8){const _0x3c9523={'method':_0x312244,'url':_0x3e48d8},_0x1e1810={'body'(_0x1a8aae){const _0x552471=a48_0x263d;return _0x3c9523[_0x552471(0xfd)]=_0x1a8aae,_0x1e1810;},'description'(_0x9ef9b9){const _0x3474f8=a48_0x263d;return _0x3c9523[_0x3474f8(0xff)]=_0x9ef9b9,_0x1e1810;},'build'(){return{..._0x3c9523};}};return _0x1e1810;}
|