@lovrabet/lovrabet-cli 2.0.14-beta.9 → 2.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.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/artifact/index.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/cli-skill/index.js +1 -0
- 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/dataset/sdk-doc.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/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.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/generated/build-info.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/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a54_0x1445e5=a54_0xc751;(function(_0x51968d,_0x1f8571){const _0x1d5331=a54_0xc751,_0x440e69=_0x51968d();while(!![]){try{const _0x1cecf8=parseInt(_0x1d5331(0x1be))/0x1+parseInt(_0x1d5331(0x1ae))/0x2+parseInt(_0x1d5331(0x1ac))/0x3*(parseInt(_0x1d5331(0x1c4))/0x4)+parseInt(_0x1d5331(0x1c6))/0x5*(parseInt(_0x1d5331(0x1d1))/0x6)+-parseInt(_0x1d5331(0x1aa))/0x7+-parseInt(_0x1d5331(0x1e8))/0x8+-parseInt(_0x1d5331(0x1dc))/0x9;if(_0x1cecf8===_0x1f8571)break;else _0x440e69['push'](_0x440e69['shift']());}catch(_0x421a05){_0x440e69['push'](_0x440e69['shift']());}}}(a54_0x1d4d,0x49c26));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[a54_0x1445e5(0x1d3)];function a54_0xc751(_0x3a9ac5,_0x1b6d45){_0x3a9ac5=_0x3a9ac5-0x1a8;const _0x1d4d77=a54_0x1d4d();let _0xc751a1=_0x1d4d77[_0x3a9ac5];return _0xc751a1;}export const NEW_CONFIG_NAME=PRODUCT_CONFIG['newConfigFileName'];function resolveConfigPath(_0x276b7a){for(const _0x465334 of CONFIG_NAMES){const _0xdf0106=resolve(_0x276b7a,_0x465334);if(existsSync(_0xdf0106))return _0xdf0106;}return undefined;}export function resolveWriteConfigPath(_0xe98b89){const _0x98823f=a54_0x1445e5,_0x3c33c6=_0xe98b89===_0x98823f(0x1d9)?process[_0x98823f(0x1c5)]():homedir(),_0x588434=resolveConfigPath(_0x3c33c6);return _0x588434??resolve(_0x3c33c6,NEW_CONFIG_NAME);}export function readConfigFile(_0xc9fb32){const _0x10abc8=a54_0x1445e5;try{if(existsSync(_0xc9fb32)){const _0x2d55a2=readFileSync(_0xc9fb32,{'encoding':_0x10abc8(0x1d5)});if(_0x2d55a2){const _0xc93c67=JSON[_0x10abc8(0x1bf)](_0x2d55a2);return migrateOnlineEnv(_0xc9fb32,_0xc93c67),_0xc93c67;}}}catch{}return{};}function migrateOnlineEnv(_0x2c59fa,_0x187cc6){const _0x36965d=a54_0x1445e5;let _0x573c09=![];_0x187cc6[_0x36965d(0x1b4)]==='online'&&(_0x187cc6[_0x36965d(0x1b4)]=_0x36965d(0x1dd),_0x573c09=!![]);if(_0x187cc6[_0x36965d(0x1af)]&&typeof _0x187cc6['apps']===_0x36965d(0x1e3))for(const _0x5ddafd of Object[_0x36965d(0x1b2)](_0x187cc6[_0x36965d(0x1af)])){_0x5ddafd&&_0x5ddafd['env']===_0x36965d(0x1e1)&&(_0x5ddafd[_0x36965d(0x1b4)]=_0x36965d(0x1dd),_0x573c09=!![]);}if(_0x573c09)try{writeConfigFile(_0x2c59fa,_0x187cc6);}catch{}}export function writeConfigFile(_0x41bc24,_0x453fa8){const _0x4c1e82=a54_0x1445e5,_0x1fcd51=dirname(_0x41bc24);!existsSync(_0x1fcd51)&&mkdirSync(_0x1fcd51,{'recursive':!![]});const _0x22ff3a=_0x41bc24+_0x4c1e82(0x1c0);try{writeFileSync(_0x22ff3a,JSON[_0x4c1e82(0x1ad)](_0x453fa8,null,0x2)+'\x0a',{'encoding':_0x4c1e82(0x1d5),'mode':0x180});try{renameSync(_0x22ff3a,_0x41bc24);}catch(_0x375e6b){if(_0x375e6b[_0x4c1e82(0x1c3)]===_0x4c1e82(0x1b1)||_0x375e6b[_0x4c1e82(0x1c3)]==='EXDEV'||_0x375e6b['code']==='EACCES'){writeFileSync(_0x41bc24,JSON[_0x4c1e82(0x1ad)](_0x453fa8,null,0x2)+'\x0a',{'encoding':_0x4c1e82(0x1d5)});try{unlinkSync(_0x22ff3a);}catch{}}else throw _0x375e6b;}}catch(_0x4eafb2){try{unlinkSync(_0x22ff3a);}catch{}throw _0x4eafb2;}}export function isNonInteractiveMode(_0x36cba2){const _0x364851=a54_0x1445e5;return!!(_0x36cba2[_0x364851(0x1b3)]||_0x36cba2['ci']||productEnvNames('CI')[_0x364851(0x1d2)](_0x445899=>process.env[_0x445899]===_0x364851(0x1c1))||process.env.CI===_0x364851(0x1c1)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x14b257=a54_0x1445e5;if(!process[_0x14b257(0x1ba)]['isTTY'])return![];try{const _0x50c96d=process[_0x14b257(0x1ba)][_0x14b257(0x1c9)];return process['stdin'][_0x14b257(0x1e2)](!![]),process[_0x14b257(0x1ba)][_0x14b257(0x1e2)](_0x50c96d??![]),!![];}catch{return![];}}export async function createContext(_0x306cf0){const _0x4a4f2f=a54_0x1445e5,_0x1cea91=readRawConfig(),_0x469743=buildConfig(_0x1cea91,_0x306cf0);await initGlobalEnvironment(_0x469743);const {getUserDomain:_0x235aba,getApiDomain:_0xfbd81a}=await import('./constant/domain.js'),_0x41d6c0={'apiDomain':_0xfbd81a(),'userDomain':_0x235aba()},_0x292223=await buildAuth(_0x469743);logger['setLogPath'](process[_0x4a4f2f(0x1c5)]());const _0x1b6ecd=(CLI_BIN_NAME+'\x20'+process['argv'][_0x4a4f2f(0x1cb)](0x2)[_0x4a4f2f(0x1e5)]('\x20'))['trim']();logger[_0x4a4f2f(0x1c8)](_0x1b6ecd);const _0x2bc763=isNonInteractiveMode(_0x306cf0);return{'config':_0x469743,'auth':_0x292223,'logger':logger,'env':_0x41d6c0,'nonInteractive':_0x2bc763};}export function buildConfigFromFlags(_0x41036a){return buildConfig(readRawConfig(),_0x41036a);}export function getLocalAppAliases(_0x7aeef6){const _0x2b0f1c=a54_0x1445e5;return _0x7aeef6['apps']&&typeof _0x7aeef6['apps']===_0x2b0f1c(0x1e3)?_0x7aeef6['apps']:{};}export function resolveLocalAppAliasCode(_0x19641a,_0x3e7f7b){const _0x400611=a54_0x1445e5;if(!_0x3e7f7b)return undefined;const _0x1439f6=getLocalAppAliases(_0x19641a)[_0x3e7f7b],_0x480b4a=_0x1439f6?.[_0x400611(0x1b8)];return typeof _0x480b4a===_0x400611(0x1e7)&&_0x480b4a['trim']()?_0x480b4a[_0x400611(0x1e6)]():undefined;}export function readAppCodeFromConfig(){const _0x1ed54a=a54_0x1445e5,_0x37e973=readRawConfig(),_0x2613df=_0x37e973[_0x1ed54a(0x1b8)]??_0x37e973['app'];if(typeof _0x2613df===_0x1ed54a(0x1e7)&&_0x2613df['trim']())return _0x2613df[_0x1ed54a(0x1e6)]();const _0x15cc1e=resolveLocalAppAliasCode(_0x37e973,typeof _0x37e973[_0x1ed54a(0x1b0)]===_0x1ed54a(0x1e7)?_0x37e973['defaultApp']:undefined);if(_0x15cc1e)return _0x15cc1e;const _0x1e9404=normalizeEnv(String(_0x37e973[_0x1ed54a(0x1b4)]||_0x1ed54a(0x1dd))),_0x3f1c06=isDaily(_0x1e9404)?'daily':isDev(_0x1e9404)?'development':_0x1ed54a(0x1dd),_0x2f5106=resolveCachedAppCode(typeof _0x37e973[_0x1ed54a(0x1b0)]===_0x1ed54a(0x1e7)?_0x37e973[_0x1ed54a(0x1b0)]:undefined,_0x3f1c06,typeof _0x37e973['accessKey']==='string'?_0x37e973['accessKey']:undefined);if(_0x2f5106)return _0x2f5106;const _0x4aefc8=Object['values'](getLocalAppAliases(_0x37e973))[_0x1ed54a(0x1e0)](_0x2136bf=>_0x2136bf?.[_0x1ed54a(0x1b8)]);return typeof _0x4aefc8?.[_0x1ed54a(0x1b8)]===_0x1ed54a(0x1e7)&&_0x4aefc8[_0x1ed54a(0x1b8)][_0x1ed54a(0x1e6)]()?_0x4aefc8[_0x1ed54a(0x1b8)][_0x1ed54a(0x1e6)]():undefined;}export function readScopedConfig(_0x3cadf6){const _0x6dd118=a54_0x1445e5,_0x81af1d=_0x3cadf6[_0x6dd118(0x1b7)]?_0x6dd118(0x1b7):'project';return readConfigFile(resolveWriteConfigPath(_0x81af1d));}export function writeScopedConfig(_0x3d19e3,_0x2fe4f8){const _0x27c6ee=a54_0x1445e5,_0x2d6d42=_0x2fe4f8[_0x27c6ee(0x1b7)]?_0x27c6ee(0x1b7):_0x27c6ee(0x1d9);writeConfigFile(resolveWriteConfigPath(_0x2d6d42),_0x3d19e3);}export async function initGlobalEnvironment(_0x261311){const _0x1965e5=a54_0x1445e5,{initEnv:_0x35e4d5}=await import(_0x1965e5(0x1e9));_0x35e4d5(_0x261311[_0x1965e5(0x1b4)]);const {initDomains:_0x41b4f0}=await import(_0x1965e5(0x1de));_0x41b4f0({'apiDomain':_0x261311[_0x1965e5(0x1a8)][_0x1965e5(0x1df)]||_0x261311[_0x1965e5(0x1a8)][_0x1965e5(0x1e4)]||undefined,'userDomain':_0x261311[_0x1965e5(0x1a8)]['userDomain']||undefined,'runtimeDomain':_0x261311['raw']['runtimeDomain']||undefined});}export function getProjectConfigPath(){const _0x1f6a6f=a54_0x1445e5;return resolveConfigPath(process[_0x1f6a6f(0x1c5)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function inspectCliConfigJsonFile(_0x379042){const _0x1b6ca2=a54_0x1445e5;if(!existsSync(_0x379042))return{'status':'missing'};try{const _0xe8e75e=readFileSync(_0x379042,{'encoding':'utf8'});if(!_0xe8e75e?.[_0x1b6ca2(0x1e6)]())return{'status':_0x1b6ca2(0x1bd)};const _0x1adc0b=JSON[_0x1b6ca2(0x1bf)](_0xe8e75e);return{'status':'ok','data':_0x1adc0b};}catch(_0x13cedf){return{'status':'error','message':_0x13cedf instanceof Error?_0x13cedf[_0x1b6ca2(0x1d6)]:String(_0x13cedf)};}}export function loadRawConfigLayers(_0x2d64d4){const _0x2200e5=a54_0x1445e5;let _0x57895b={},_0x23057a={},_0x5ca2ad,_0x1f1ea9;try{_0x5ca2ad=resolveConfigPath(homedir());if(_0x5ca2ad){const _0x191ab4=readFileSync(_0x5ca2ad,{'encoding':_0x2200e5(0x1d5)});if(_0x191ab4)_0x57895b=JSON[_0x2200e5(0x1bf)](_0x191ab4);}}catch{}try{const _0x3a3c12=_0x2d64d4||process[_0x2200e5(0x1c5)]();_0x1f1ea9=resolveConfigPath(_0x3a3c12);if(_0x1f1ea9){const _0x5d54d7=readFileSync(_0x1f1ea9,{'encoding':_0x2200e5(0x1d5)});if(_0x5d54d7)_0x23057a=JSON[_0x2200e5(0x1bf)](_0x5d54d7);}}catch{}return{'globalPath':_0x5ca2ad,'projectPath':_0x1f1ea9,'globalConfig':_0x57895b,'projectConfig':_0x23057a};}function mergeRawConfigLayers(_0x1a0da3){const _0x318b43=a54_0x1445e5,{globalConfig:_0x30ff79,projectConfig:_0x1509b3}=_0x1a0da3;if(_0x1509b3[_0x318b43(0x1d0)]===![]){const _0x22de70={..._0x1509b3};return delete _0x22de70[_0x318b43(0x1d0)],_0x22de70;}const _0x548e2d={..._0x30ff79,..._0x1509b3};if(_0x318b43(0x1b0)in _0x1509b3)_0x548e2d[_0x318b43(0x1b0)]=_0x1509b3[_0x318b43(0x1b0)];else _0x30ff79[_0x318b43(0x1b0)]&&(_0x548e2d[_0x318b43(0x1b0)]=_0x30ff79[_0x318b43(0x1b0)]);return _0x548e2d;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x50f905){return mergeRawConfigLayers(loadRawConfigLayers(_0x50f905));}export function readRawConfigWithLayers(_0x56d430){const _0x156627=loadRawConfigLayers(_0x56d430);return{'config':mergeRawConfigLayers(_0x156627),'layers':_0x156627};}export function resolveDefaultAppSource(_0x7a004c){const _0x2e0479=a54_0x1445e5;if('defaultApp'in _0x7a004c[_0x2e0479(0x1b5)])return _0x2e0479(0x1d9);if(_0x7a004c['projectConfig'][_0x2e0479(0x1d0)]===![])return null;if(_0x7a004c['globalConfig'][_0x2e0479(0x1b0)])return _0x2e0479(0x1b7);return null;}function buildConfig(_0x1635b8,_0x1f3fb2){const _0x311cb7=a54_0x1445e5,_0x1c32ed=_0x1635b8[_0x311cb7(0x1b0)]||undefined,_0x314f95=_0x1f3fb2[_0x311cb7(0x1ce)]||env('APP')||undefined,_0x1ea23b=_0x314f95||_0x1c32ed||undefined,_0x757363=env(_0x311cb7(0x1b9))||_0x1635b8['accessKey']||undefined,_0x50dd2c=_0x1f3fb2[_0x311cb7(0x1b4)]||env(_0x311cb7(0x1d4))||_0x1635b8['env']||DEFAULT_CONFIG_VALUES[_0x311cb7(0x1b4)],_0xdb9613=normalizeEnv(String(_0x50dd2c)),_0x5227c0=isDaily(_0xdb9613)?_0x311cb7(0x1d8):isDev(_0xdb9613)?_0x311cb7(0x1bc):_0x311cb7(0x1dd),_0xaa0f12=resolveLocalAppAliasCode(_0x1635b8,_0x1ea23b),_0x2e87f8=resolveCachedAppCode(_0x1ea23b,_0x5227c0,_0x757363),_0x4e5773=typeof _0x1f3fb2[_0x311cb7(0x1b8)]==='string'?_0x1f3fb2[_0x311cb7(0x1b8)]:undefined,_0x18a4a2=env(_0x311cb7(0x1bb)),_0x334a5b=_0x314f95?undefined:_0x1635b8[_0x311cb7(0x1b8)]||_0x1635b8['app']||undefined,_0x31874e=_0x4e5773||_0x18a4a2||_0xaa0f12||_0x2e87f8||_0x334a5b||undefined,_0x1314d4=_0x4e5773?_0x311cb7(0x1b6):_0x18a4a2?_0x311cb7(0x1b4):_0xaa0f12?_0x311cb7(0x1c2):_0x2e87f8?_0x311cb7(0x1db):_0x334a5b?_0x311cb7(0x1cf):undefined,_0x21c47a=_0x1635b8[_0x311cb7(0x1ab)]||DEFAULT_CONFIG_VALUES[_0x311cb7(0x1ab)],_0xbc2426=undefined,_0x495569=_0x1f3fb2[_0x311cb7(0x1c7)]||env(_0x311cb7(0x1a9))||_0x1635b8['format'],_0x1caf77=normalizeLegacyOutputFormat(_0x495569),_0x1c42db=env(_0x311cb7(0x1cd))||_0x1635b8['pageSize'],_0x4d33e6=_0x1c42db?Number(_0x1c42db)||undefined:undefined,_0x4fc8e9=_0x1635b8[_0x311cb7(0x1d7)]||_0x1635b8['maxRisk'],_0x5c924b=_0x4fc8e9===_0x311cb7(0x1ca)||_0x4fc8e9==='write'||_0x4fc8e9==='high-risk-write'?_0x4fc8e9:DEFAULT_CONFIG_VALUES[_0x311cb7(0x1d7)],_0x1df400=env(_0x311cb7(0x1cc)),_0x3fe8e9=_0x1df400==='1'||_0x1df400==='true';return{'appCode':typeof _0x31874e===_0x311cb7(0x1e7)&&_0x31874e[_0x311cb7(0x1e6)]()?_0x31874e[_0x311cb7(0x1e6)]():undefined,'appCodeSource':_0x1314d4,'env':_0x5227c0,'locale':_0x21c47a,'cookie':_0xbc2426,'accessKey':_0x757363,'format':_0x1caf77,'pageSize':_0x4d33e6,'riskLevel':_0x5c924b,'verbose':_0x3fe8e9,'defaultApp':_0x1c32ed,'currentApp':typeof _0x1ea23b===_0x311cb7(0x1e7)?_0x1ea23b:undefined,'raw':_0x1635b8};}function a54_0x1d4d(){const _0x1faeb8=['setRawCommand','isRaw','read','slice','VERBOSE','PAGE_SIZE','app','top-level','inherit','498xyqXCf','some','configFileNames','ENV','utf8','message','riskLevel','daily','project','authRequired','cache','3022236VJWyHa','production','./constant/domain.js','apiDomain','find','online','setRawMode','object','host','join','trim','string','3139456HdODZO','./constant/env.js','raw','FORMAT','2494877TtkHse','locale','3iLmHeB','stringify','548790QFfMRZ','apps','defaultApp','EPERM','values','nonInteractive','env','projectConfig','explicit','global','appcode','ACCESS_KEY','stdin','APPCODE','development','empty','261296pWFKFb','parse','.tmp','true','local-alias','code','2289108sqnzsJ','cwd','16795EXcFTy','format'];a54_0x1d4d=function(){return _0x1faeb8;};return a54_0x1d4d();}function env(_0x914f1){return productEnv(_0x914f1);}async function buildAuth(_0x1e3641){const _0xf7d55d='',_0x5efba4=!!_0x1e3641['accessKey'];return{'cookie':_0xf7d55d,'isLoggedIn':_0x5efba4,async 'getOrLogin'(){const _0x49139c=a54_0xc751;if(_0x5efba4)return _0xf7d55d;throw CliErrors[_0x49139c(0x1da)]();}};}
|
|
1
|
+
const a55_0xa0676c=a55_0x5595;(function(_0x160c07,_0x1f7c5c){const _0x3b9276=a55_0x5595,_0x119ce0=_0x160c07();while(!![]){try{const _0x4b39d5=-parseInt(_0x3b9276(0x178))/0x1*(-parseInt(_0x3b9276(0x14f))/0x2)+-parseInt(_0x3b9276(0x14a))/0x3+parseInt(_0x3b9276(0x171))/0x4*(-parseInt(_0x3b9276(0x15b))/0x5)+parseInt(_0x3b9276(0x13f))/0x6*(-parseInt(_0x3b9276(0x162))/0x7)+-parseInt(_0x3b9276(0x13e))/0x8+-parseInt(_0x3b9276(0x155))/0x9+parseInt(_0x3b9276(0x172))/0xa*(parseInt(_0x3b9276(0x15d))/0xb);if(_0x4b39d5===_0x1f7c5c)break;else _0x119ce0['push'](_0x119ce0['shift']());}catch(_0x465ecb){_0x119ce0['push'](_0x119ce0['shift']());}}}(a55_0xebc4,0x499ea));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';function a55_0xebc4(){const _0x1882d0=['code','61071RWcECb','object','riskLevel','app','setRawMode','153276UgZMag','utf8','cache','EACCES','ACCESS_KEY','PAGE_SIZE','5164047hOxFaG','cwd','project','./constant/env.js','userDomain','stdin','5wdvpCr','apps','102113jcZfiU','values','string','write','FORMAT','7MvvCxn','parse','globalConfig','global','newConfigFileName','runtimeDomain','projectConfig','nonInteractive','daily','inherit','skillHubDomain','isTTY','configFileNames','EPERM','accessKey','1704692GeeFID','1670BeqDHZ','true','format','VERBOSE','EXDEV','find','5rRqVhz','some','setRawCommand','online','appcode','production','raw','env','argv','message','ENV','isRaw','1727872LJVeyy','2373648CrJJoo','host','./constant/domain.js','locale','authRequired','trim','error','stringify','defaultApp','.tmp'];a55_0xebc4=function(){return _0x1882d0;};return a55_0xebc4();}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[a55_0xa0676c(0x16e)];export const NEW_CONFIG_NAME=PRODUCT_CONFIG[a55_0xa0676c(0x166)];function resolveConfigPath(_0x51ba19){for(const _0x1bd411 of CONFIG_NAMES){const _0x41d53a=resolve(_0x51ba19,_0x1bd411);if(existsSync(_0x41d53a))return _0x41d53a;}return undefined;}export function resolveWriteConfigPath(_0x3b1451){const _0x4e96ff=a55_0xa0676c,_0x39c7eb=_0x3b1451===_0x4e96ff(0x157)?process[_0x4e96ff(0x156)]():homedir(),_0x2d05f7=resolveConfigPath(_0x39c7eb);return _0x2d05f7??resolve(_0x39c7eb,NEW_CONFIG_NAME);}export function readConfigFile(_0x4d1bab){const _0x89ac1=a55_0xa0676c;try{if(existsSync(_0x4d1bab)){const _0x410463=readFileSync(_0x4d1bab,{'encoding':_0x89ac1(0x150)});if(_0x410463){const _0x19f74c=JSON[_0x89ac1(0x163)](_0x410463);return migrateOnlineEnv(_0x4d1bab,_0x19f74c),_0x19f74c;}}}catch{}return{};}function migrateOnlineEnv(_0xdc9fd1,_0x2608b8){const _0x2d08ad=a55_0xa0676c;let _0x5c12f6=![];_0x2608b8['env']===_0x2d08ad(0x17b)&&(_0x2608b8[_0x2d08ad(0x139)]=_0x2d08ad(0x137),_0x5c12f6=!![]);if(_0x2608b8['apps']&&typeof _0x2608b8[_0x2d08ad(0x15c)]===_0x2d08ad(0x14b))for(const _0x5b9006 of Object[_0x2d08ad(0x15e)](_0x2608b8[_0x2d08ad(0x15c)])){_0x5b9006&&_0x5b9006['env']===_0x2d08ad(0x17b)&&(_0x5b9006[_0x2d08ad(0x139)]=_0x2d08ad(0x137),_0x5c12f6=!![]);}if(_0x5c12f6)try{writeConfigFile(_0xdc9fd1,_0x2608b8);}catch{}}export function writeConfigFile(_0x3dc19,_0x3a2db5){const _0x31e307=a55_0xa0676c,_0xced064=dirname(_0x3dc19);!existsSync(_0xced064)&&mkdirSync(_0xced064,{'recursive':!![]});const _0x47e4bb=_0x3dc19+_0x31e307(0x148);try{writeFileSync(_0x47e4bb,JSON[_0x31e307(0x146)](_0x3a2db5,null,0x2)+'\x0a',{'encoding':_0x31e307(0x150),'mode':0x180});try{renameSync(_0x47e4bb,_0x3dc19);}catch(_0x1ef2a5){if(_0x1ef2a5[_0x31e307(0x149)]===_0x31e307(0x16f)||_0x1ef2a5[_0x31e307(0x149)]===_0x31e307(0x176)||_0x1ef2a5[_0x31e307(0x149)]===_0x31e307(0x152)){writeFileSync(_0x3dc19,JSON['stringify'](_0x3a2db5,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x47e4bb);}catch{}}else throw _0x1ef2a5;}}catch(_0x4046e1){try{unlinkSync(_0x47e4bb);}catch{}throw _0x4046e1;}}export function isNonInteractiveMode(_0xf061e4){const _0x275e9f=a55_0xa0676c;return!!(_0xf061e4[_0x275e9f(0x169)]||_0xf061e4['ci']||productEnvNames('CI')[_0x275e9f(0x179)](_0x5390e1=>process.env[_0x5390e1]===_0x275e9f(0x173))||process.env.CI===_0x275e9f(0x173)||!process['stdout'][_0x275e9f(0x16d)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x1d99af=a55_0xa0676c;if(!process[_0x1d99af(0x15a)]['isTTY'])return![];try{const _0x480704=process[_0x1d99af(0x15a)][_0x1d99af(0x13d)];return process[_0x1d99af(0x15a)][_0x1d99af(0x14e)](!![]),process[_0x1d99af(0x15a)][_0x1d99af(0x14e)](_0x480704??![]),!![];}catch{return![];}}export async function createContext(_0x3cd718){const _0x12c12e=a55_0xa0676c,_0x10d4c5=readRawConfig(),_0x7565f3=buildConfig(_0x10d4c5,_0x3cd718);await initGlobalEnvironment(_0x7565f3);const {getUserDomain:_0x1af230,getApiDomain:_0x11131c}=await import(_0x12c12e(0x141)),_0x52e651={'apiDomain':_0x11131c(),'userDomain':_0x1af230()},_0x136eec=await buildAuth(_0x7565f3);logger['setLogPath'](process[_0x12c12e(0x156)]());const _0x2bf9ce=(CLI_BIN_NAME+'\x20'+process[_0x12c12e(0x13a)]['slice'](0x2)['join']('\x20'))[_0x12c12e(0x144)]();logger[_0x12c12e(0x17a)](_0x2bf9ce);const _0x280e2b=isNonInteractiveMode(_0x3cd718);return{'config':_0x7565f3,'auth':_0x136eec,'logger':logger,'env':_0x52e651,'nonInteractive':_0x280e2b};}export function buildConfigFromFlags(_0x338285){return buildConfig(readRawConfig(),_0x338285);}export function getLocalAppAliases(_0x2652c5){const _0x26b316=a55_0xa0676c;return _0x2652c5[_0x26b316(0x15c)]&&typeof _0x2652c5['apps']===_0x26b316(0x14b)?_0x2652c5[_0x26b316(0x15c)]:{};}export function resolveLocalAppAliasCode(_0x4422b6,_0x324d10){const _0x99b99e=a55_0xa0676c;if(!_0x324d10)return undefined;const _0x534005=getLocalAppAliases(_0x4422b6)[_0x324d10],_0x2b812d=_0x534005?.[_0x99b99e(0x17c)];return typeof _0x2b812d===_0x99b99e(0x15f)&&_0x2b812d[_0x99b99e(0x144)]()?_0x2b812d[_0x99b99e(0x144)]():undefined;}export function readAppCodeFromConfig(){const _0x3451c4=a55_0xa0676c,_0x144685=readRawConfig(),_0x4ffa61=_0x144685[_0x3451c4(0x17c)]??_0x144685[_0x3451c4(0x14d)];if(typeof _0x4ffa61===_0x3451c4(0x15f)&&_0x4ffa61['trim']())return _0x4ffa61['trim']();const _0x5dffc2=resolveLocalAppAliasCode(_0x144685,typeof _0x144685[_0x3451c4(0x147)]==='string'?_0x144685[_0x3451c4(0x147)]:undefined);if(_0x5dffc2)return _0x5dffc2;const _0x9ec7f2=normalizeEnv(String(_0x144685['env']||_0x3451c4(0x137))),_0x5a2394=isDaily(_0x9ec7f2)?_0x3451c4(0x16a):isDev(_0x9ec7f2)?'development':_0x3451c4(0x137),_0x272b66=resolveCachedAppCode(typeof _0x144685[_0x3451c4(0x147)]===_0x3451c4(0x15f)?_0x144685['defaultApp']:undefined,_0x5a2394,typeof _0x144685['accessKey']===_0x3451c4(0x15f)?_0x144685[_0x3451c4(0x170)]:undefined);if(_0x272b66)return _0x272b66;const _0x5243d6=Object[_0x3451c4(0x15e)](getLocalAppAliases(_0x144685))[_0x3451c4(0x177)](_0x1ed7b4=>_0x1ed7b4?.[_0x3451c4(0x17c)]);return typeof _0x5243d6?.['appcode']===_0x3451c4(0x15f)&&_0x5243d6[_0x3451c4(0x17c)]['trim']()?_0x5243d6[_0x3451c4(0x17c)][_0x3451c4(0x144)]():undefined;}export function readScopedConfig(_0x2c6926){const _0x5bcb90=a55_0xa0676c,_0x495e52=_0x2c6926[_0x5bcb90(0x165)]?'global':_0x5bcb90(0x157);return readConfigFile(resolveWriteConfigPath(_0x495e52));}export function writeScopedConfig(_0x23d10f,_0x2c4a99){const _0xa7af84=a55_0xa0676c,_0x5effe5=_0x2c4a99[_0xa7af84(0x165)]?_0xa7af84(0x165):_0xa7af84(0x157);writeConfigFile(resolveWriteConfigPath(_0x5effe5),_0x23d10f);}export async function initGlobalEnvironment(_0x5e9ae5){const _0x211093=a55_0xa0676c,{initEnv:_0x5256b4}=await import(_0x211093(0x158));_0x5256b4(_0x5e9ae5[_0x211093(0x139)]);const {initDomains:_0x3b9f65}=await import(_0x211093(0x141));_0x3b9f65({'apiDomain':_0x5e9ae5[_0x211093(0x138)]['apiDomain']||_0x5e9ae5[_0x211093(0x138)][_0x211093(0x140)]||undefined,'userDomain':_0x5e9ae5[_0x211093(0x138)][_0x211093(0x159)]||undefined,'runtimeDomain':_0x5e9ae5[_0x211093(0x138)][_0x211093(0x167)]||undefined,'skillHubDomain':_0x5e9ae5[_0x211093(0x138)][_0x211093(0x16c)]||undefined});}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}function a55_0x5595(_0x35b3c0,_0x2d5ea0){_0x35b3c0=_0x35b3c0-0x137;const _0xebc4bf=a55_0xebc4();let _0x55959c=_0xebc4bf[_0x35b3c0];return _0x55959c;}export function inspectCliConfigJsonFile(_0x22170f){const _0x194d0b=a55_0xa0676c;if(!existsSync(_0x22170f))return{'status':'missing'};try{const _0x41e651=readFileSync(_0x22170f,{'encoding':_0x194d0b(0x150)});if(!_0x41e651?.[_0x194d0b(0x144)]())return{'status':'empty'};const _0x441249=JSON[_0x194d0b(0x163)](_0x41e651);return{'status':'ok','data':_0x441249};}catch(_0x58500e){return{'status':_0x194d0b(0x145),'message':_0x58500e instanceof Error?_0x58500e[_0x194d0b(0x13b)]:String(_0x58500e)};}}export function loadRawConfigLayers(_0x47fd0a){const _0x33d53a=a55_0xa0676c;let _0x203c76={},_0x270834={},_0x3a1842,_0x4ed0f4;try{_0x3a1842=resolveConfigPath(homedir());if(_0x3a1842){const _0x32f0ee=readFileSync(_0x3a1842,{'encoding':'utf8'});if(_0x32f0ee)_0x203c76=JSON[_0x33d53a(0x163)](_0x32f0ee);}}catch{}try{const _0x35da08=_0x47fd0a||process[_0x33d53a(0x156)]();_0x4ed0f4=resolveConfigPath(_0x35da08);if(_0x4ed0f4){const _0x568411=readFileSync(_0x4ed0f4,{'encoding':_0x33d53a(0x150)});if(_0x568411)_0x270834=JSON[_0x33d53a(0x163)](_0x568411);}}catch{}return{'globalPath':_0x3a1842,'projectPath':_0x4ed0f4,'globalConfig':_0x203c76,'projectConfig':_0x270834};}function mergeRawConfigLayers(_0x55fc04){const _0x51cef4=a55_0xa0676c,{globalConfig:_0x3d653b,projectConfig:_0x44d580}=_0x55fc04;if(_0x44d580[_0x51cef4(0x16b)]===![]){const _0x32addb={..._0x44d580};return delete _0x32addb[_0x51cef4(0x16b)],_0x32addb;}const _0x51a84d={..._0x3d653b,..._0x44d580};if(_0x51cef4(0x147)in _0x44d580)_0x51a84d[_0x51cef4(0x147)]=_0x44d580[_0x51cef4(0x147)];else _0x3d653b[_0x51cef4(0x147)]&&(_0x51a84d['defaultApp']=_0x3d653b['defaultApp']);return _0x51a84d;}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x5bb0b4){return mergeRawConfigLayers(loadRawConfigLayers(_0x5bb0b4));}export function readRawConfigWithLayers(_0x12acda){const _0x5a7b19=loadRawConfigLayers(_0x12acda);return{'config':mergeRawConfigLayers(_0x5a7b19),'layers':_0x5a7b19};}export function resolveDefaultAppSource(_0x2067da){const _0x254fe5=a55_0xa0676c;if('defaultApp'in _0x2067da[_0x254fe5(0x168)])return _0x254fe5(0x157);if(_0x2067da[_0x254fe5(0x168)]['inherit']===![])return null;if(_0x2067da[_0x254fe5(0x164)][_0x254fe5(0x147)])return _0x254fe5(0x165);return null;}function buildConfig(_0x1c96bb,_0x179419){const _0x54ec24=a55_0xa0676c,_0x239ee0=_0x1c96bb[_0x54ec24(0x147)]||undefined,_0x3eebe8=_0x179419['app']||env('APP')||undefined,_0x136014=_0x3eebe8||_0x239ee0||undefined,_0x3006eb=env(_0x54ec24(0x153))||_0x1c96bb['accessKey']||undefined,_0x55f8cf=_0x179419[_0x54ec24(0x139)]||env(_0x54ec24(0x13c))||_0x1c96bb['env']||DEFAULT_CONFIG_VALUES[_0x54ec24(0x139)],_0x4903a2=normalizeEnv(String(_0x55f8cf)),_0x3663d6=isDaily(_0x4903a2)?_0x54ec24(0x16a):isDev(_0x4903a2)?'development':_0x54ec24(0x137),_0xcbc988=resolveLocalAppAliasCode(_0x1c96bb,_0x136014),_0x408ed0=resolveCachedAppCode(_0x136014,_0x3663d6,_0x3006eb),_0x1e3d88=typeof _0x179419[_0x54ec24(0x17c)]===_0x54ec24(0x15f)?_0x179419['appcode']:undefined,_0x36a46e=env('APPCODE'),_0x46e542=_0x3eebe8?undefined:_0x1c96bb[_0x54ec24(0x17c)]||_0x1c96bb[_0x54ec24(0x14d)]||undefined,_0x2db4a3=_0x1e3d88||_0x36a46e||_0xcbc988||_0x408ed0||_0x46e542||undefined,_0xc0f57=_0x1e3d88?'explicit':_0x36a46e?'env':_0xcbc988?'local-alias':_0x408ed0?_0x54ec24(0x151):_0x46e542?'top-level':undefined,_0x3d4a69=_0x1c96bb[_0x54ec24(0x142)]||DEFAULT_CONFIG_VALUES[_0x54ec24(0x142)],_0x1957ce=undefined,_0x1c2717=_0x179419[_0x54ec24(0x174)]||env(_0x54ec24(0x161))||_0x1c96bb[_0x54ec24(0x174)],_0x41d25d=normalizeLegacyOutputFormat(_0x1c2717),_0x478461=env(_0x54ec24(0x154))||_0x1c96bb['pageSize'],_0x1dbb03=_0x478461?Number(_0x478461)||undefined:undefined,_0x1730fb=_0x1c96bb['riskLevel']||_0x1c96bb['maxRisk'],_0x2c8eab=_0x1730fb==='read'||_0x1730fb===_0x54ec24(0x160)||_0x1730fb==='high-risk-write'?_0x1730fb:DEFAULT_CONFIG_VALUES[_0x54ec24(0x14c)],_0x4b028b=env(_0x54ec24(0x175)),_0x5f46e9=_0x4b028b==='1'||_0x4b028b==='true';return{'appCode':typeof _0x2db4a3===_0x54ec24(0x15f)&&_0x2db4a3['trim']()?_0x2db4a3[_0x54ec24(0x144)]():undefined,'appCodeSource':_0xc0f57,'env':_0x3663d6,'locale':_0x3d4a69,'cookie':_0x1957ce,'accessKey':_0x3006eb,'format':_0x41d25d,'pageSize':_0x1dbb03,'riskLevel':_0x2c8eab,'verbose':_0x5f46e9,'defaultApp':_0x239ee0,'currentApp':typeof _0x136014===_0x54ec24(0x15f)?_0x136014:undefined,'raw':_0x1c96bb};}function env(_0x5055c7){return productEnv(_0x5055c7);}async function buildAuth(_0x14d3f2){const _0x322175=a55_0xa0676c,_0x1d1899='',_0x36dee3=!!_0x14d3f2[_0x322175(0x170)];return{'cookie':_0x1d1899,'isLoggedIn':_0x36dee3,async 'getOrLogin'(){const _0x140068=_0x322175;if(_0x36dee3)return _0x1d1899;throw CliErrors[_0x140068(0x143)]();}};}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x241310,_0x107d0a){const _0x31f26c=a55_0x2e1d,_0x30950e=_0x241310();while(!![]){try{const _0x39a54e=parseInt(_0x31f26c(0xe1))/0x1*(parseInt(_0x31f26c(0xe6))/0x2)+-parseInt(_0x31f26c(0xd2))/0x3*(-parseInt(_0x31f26c(0xb4))/0x4)+parseInt(_0x31f26c(0x102))/0x5*(-parseInt(_0x31f26c(0xbc))/0x6)+-parseInt(_0x31f26c(0xbf))/0x7+-parseInt(_0x31f26c(0xff))/0x8*(parseInt(_0x31f26c(0xf2))/0x9)+-parseInt(_0x31f26c(0xcf))/0xa+parseInt(_0x31f26c(0xb9))/0xb*(parseInt(_0x31f26c(0x10f))/0xc);if(_0x39a54e===_0x107d0a)break;else _0x30950e['push'](_0x30950e['shift']());}catch(_0x5e3981){_0x30950e['push'](_0x30950e['shift']());}}}(a55_0x5b78,0x5d830));import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0xbc0ebc){_activeAK=_0xbc0ebc||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x373088,_0x3e2f08={}){const _0x93b7d=a55_0x2e1d,{method:method=_0x93b7d(0xe3),body:_0x14e590,headers:headers={},timeout:timeout=0x7530}=_0x3e2f08,_0x1285a1=_activeAK,_0x4466b0=getRuntimeDomain();if(!_0x1285a1)throw CliErrors[_0x93b7d(0xd9)]('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x93b7d(0x109)]+'.');const _0x5f38da=''+_0x4466b0+_0x373088,_0xa73852={'X-User-AK':_0x1285a1},_0x545301=new AbortController(),_0x36f6b4=setTimeout(()=>_0x545301[_0x93b7d(0xc1)](),timeout);try{const _0x3bc26f=await fetch(_0x5f38da,{'method':method,'headers':{'Content-Type':_0x93b7d(0xe9),'X-Invoke-Source':PRODUCT_CONFIG[_0x93b7d(0x104)],..._0xa73852,...headers},'body':_0x14e590?JSON[_0x93b7d(0xd4)](_0x14e590):undefined,'signal':_0x545301[_0x93b7d(0xdf)]});let _0x590362;try{_0x590362=await _0x3bc26f[_0x93b7d(0xca)]();}catch{throw CliErrors['apiError'](_0x93b7d(0x101)+_0x3bc26f[_0x93b7d(0x108)]+')',_0x3bc26f[_0x93b7d(0x108)]>=0x190?_0x93b7d(0x10c):undefined);}if(!_0x3bc26f['ok']||_0x590362[_0x93b7d(0xfe)]===![])throw CliErrors[_0x93b7d(0xce)](_0x590362[_0x93b7d(0xbe)]||_0x590362['message']||_0x93b7d(0xed)+_0x3bc26f[_0x93b7d(0x108)],_0x590362['errorCode']?_0x93b7d(0xc4)+_0x590362['errorCode']:undefined);return _0x590362;}catch(_0x163263){if(_0x163263 instanceof Error&&_0x163263['name']==='AbortError')throw CliErrors[_0x93b7d(0xce)](_0x93b7d(0xf3)+_0x5f38da);throw _0x163263;}finally{clearTimeout(_0x36f6b4);}}async function apiBinaryRequest(_0x39b6d2,_0x56e061={}){const _0x260b39=a55_0x2e1d,{method:method=_0x260b39(0xe3),headers:headers={},timeout:timeout=0x7530}=_0x56e061,_0x23e7e0=_activeAK,_0x9f40b0=getRuntimeDomain();if(!_0x23e7e0)throw CliErrors['authRequired']('Configure\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x260b39(0x109)]+'.');const _0x54b0e5=''+_0x9f40b0+_0x39b6d2,_0x43e191=new AbortController(),_0x46e00a=setTimeout(()=>_0x43e191['abort'](),timeout);try{const _0x520960=await fetch(_0x54b0e5,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x260b39(0x104)],'X-User-AK':_0x23e7e0,...headers},'signal':_0x43e191[_0x260b39(0xdf)]});if(!_0x520960['ok']){let _0x188f15;try{const _0x36752a=await _0x520960[_0x260b39(0xca)]();_0x188f15=_0x36752a[_0x260b39(0xbe)]||_0x36752a[_0x260b39(0x106)]||_0x36752a[_0x260b39(0xfa)];}catch{_0x188f15=await _0x520960[_0x260b39(0x105)]()[_0x260b39(0xfc)](()=>undefined);}throw CliErrors['apiError'](_0x188f15||'API\x20error:\x20'+_0x520960['status'],'Download\x20failed:\x20'+_0x54b0e5);}return Buffer['from'](await _0x520960[_0x260b39(0xcd)]());}catch(_0x430c5b){if(_0x430c5b instanceof Error&&_0x430c5b['name']===_0x260b39(0xdc))throw CliErrors[_0x260b39(0xce)]('Request\x20timeout:\x20'+_0x54b0e5);throw _0x430c5b;}finally{clearTimeout(_0x46e00a);}}async function toolboxRequest(_0x481a5f,_0x2dfd36,_0x17895a={}){const _0x333182=a55_0x2e1d,{method:method=_0x333182(0xe3),headers:headers={},timeout:timeout=0x7530}=_0x17895a,_0x2c77b3=_activeAK;if(!_0x2c77b3)throw CliErrors['authRequired'](_0x333182(0xf7)+PRODUCT_CONFIG[_0x333182(0x109)]+'.');const _0xe229df=getApiDomain()[_0x333182(0xec)](/\/$/,''),_0x522f0d=new URL(_0x481a5f,_0xe229df+_0x333182(0xbd));if(_0x2dfd36)for(const [_0x548625,_0x57f9c5]of Object[_0x333182(0xe4)](_0x2dfd36)){_0x57f9c5!==undefined&&_0x57f9c5!==null&&_0x522f0d[_0x333182(0xba)][_0x333182(0xc2)](_0x548625,String(_0x57f9c5));}const _0x4d8aac=new AbortController(),_0x951b4b=setTimeout(()=>_0x4d8aac['abort'](),timeout);try{const _0x2360d7=await fetch(_0x522f0d,{'method':method,'headers':{'Content-Type':_0x333182(0xe9),'X-Invoke-Source':PRODUCT_CONFIG['invokeSource'],'X-User-AK':_0x2c77b3,...headers},'signal':_0x4d8aac['signal']});let _0x54a402;try{_0x54a402=await _0x2360d7[_0x333182(0xca)]();}catch{throw CliErrors['apiError'](_0x333182(0xb5)+_0x2360d7[_0x333182(0x108)]+')',_0x2360d7[_0x333182(0x108)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}if(!_0x2360d7['ok']){const _0x20bdad=_0x54a402&&typeof _0x54a402===_0x333182(0xcb)?_0x54a402:{};throw CliErrors['apiError'](_0x20bdad[_0x333182(0xbe)]||_0x20bdad[_0x333182(0x106)]||_0x333182(0xc8)+_0x2360d7[_0x333182(0x108)],_0x20bdad[_0x333182(0xfa)]?'Toolbox\x20error\x20code:\x20'+_0x20bdad[_0x333182(0xfa)]:undefined);}if(_0x54a402&&typeof _0x54a402===_0x333182(0xcb)&&_0x333182(0xfe)in _0x54a402&&typeof _0x54a402[_0x333182(0xfe)]===_0x333182(0xb1)){const _0x2bb3b7=_0x54a402;if(!_0x2bb3b7[_0x333182(0xfe)])throw CliErrors[_0x333182(0xce)](_0x2bb3b7['errorMsg']||_0x2bb3b7['message']||'Toolbox\x20API\x20error',_0x2bb3b7[_0x333182(0xfa)]?_0x333182(0xb7)+_0x2bb3b7['errorCode']:undefined);return _0x2bb3b7[_0x333182(0x107)];}return _0x54a402;}catch(_0xdf6e6e){if(_0xdf6e6e instanceof Error&&_0xdf6e6e[_0x333182(0xf1)]===_0x333182(0xdc))throw CliErrors['apiError'](_0x333182(0xf3)+_0x522f0d[_0x333182(0xea)]());throw _0xdf6e6e;}finally{clearTimeout(_0x951b4b);}}export async function getBffScriptInfo(_0x54d635){const _0x3d1e03=a55_0x2e1d,_0x28a133=await apiRequest(_0x3d1e03(0xc3)+_0x54d635);if(!_0x28a133[_0x3d1e03(0x107)])throw CliErrors['validation'](_0x3d1e03(0xf9)+_0x54d635);return _0x28a133[_0x3d1e03(0x107)];}export async function getSqlQueryInfo(_0xaebc05,_0x231d0b){const _0x45e6bc=a55_0x2e1d,_0xbbcc92=await apiRequest('/client/sql/query',{'method':_0x45e6bc(0xc0),'body':{'appCode':_0xaebc05,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x231d0b}}),_0x15ad35=_0xbbcc92[_0x45e6bc(0x107)],_0x417ce5=_0x15ad35&&typeof _0x15ad35===_0x45e6bc(0xcb)&&'tableData'in _0x15ad35?_0x15ad35['tableData']?.[0x0]:_0x15ad35&&typeof _0x15ad35==='object'&&_0x45e6bc(0xdb)in _0x15ad35?_0x15ad35:undefined;if(!_0x417ce5)throw CliErrors[_0x45e6bc(0xf6)](_0x45e6bc(0xfb)+_0x231d0b);return _0x417ce5;}function isRemoteAppItem(_0x163c54){const _0x21031b=a55_0x2e1d;return!!_0x163c54&&typeof _0x163c54===_0x21031b(0xcb)&&typeof _0x163c54[_0x21031b(0xd0)]===_0x21031b(0xd8)&&typeof _0x163c54[_0x21031b(0xe7)]==='string';}function extractRemoteAppItems(_0x566840){const _0xd03580=a55_0x2e1d;if(Array[_0xd03580(0xb3)](_0x566840))return _0x566840[_0xd03580(0xf4)](isRemoteAppItem);if(!_0x566840||typeof _0x566840!=='object')throw CliErrors['apiError'](_0xd03580(0xd5));const _0x1b2889=_0x566840;if(Array[_0xd03580(0xb3)](_0x1b2889['tableData']))return _0x1b2889[_0xd03580(0xb8)]['filter'](isRemoteAppItem);if(_0x1b2889[_0xd03580(0x107)]&&typeof _0x1b2889[_0xd03580(0x107)]===_0xd03580(0xcb)){const _0x3f74f6=_0x1b2889[_0xd03580(0x107)];if(Array[_0xd03580(0xb3)](_0x3f74f6[_0xd03580(0xb8)]))return _0x3f74f6[_0xd03580(0xb8)][_0xd03580(0xf4)](isRemoteAppItem);}throw CliErrors[_0xd03580(0xce)](_0xd03580(0xd6));}export async function getMyApps(){const _0x574e56=a55_0x2e1d,_0x545536=await apiRequest(_0x574e56(0xde));return extractRemoteAppItems(_0x545536['data']);}export async function getLoginUserInfo(){const _0xd9b049=a55_0x2e1d,_0x360e6c=await apiRequest(_0xd9b049(0xda));if(!_0x360e6c['data']||typeof _0x360e6c[_0xd9b049(0x107)]!==_0xd9b049(0xcb)||Array[_0xd9b049(0xb3)](_0x360e6c[_0xd9b049(0x107)]))throw CliErrors[_0xd9b049(0xce)](_0xd9b049(0xc5));return _0x360e6c['data'];}export async function listDatasets(_0x144c9e,_0x4989f0){const _0x418074=a55_0x2e1d,_0x3190e3=await apiRequest(_0x418074(0xf5),{'method':_0x418074(0xc0),'body':{'appCode':_0x144c9e,..._0x4989f0?.[_0x418074(0xee)]&&{'code':_0x4989f0[_0x418074(0xee)]},..._0x4989f0?.[_0x418074(0xf1)]&&{'name':_0x4989f0['name']}}});return extractList(_0x3190e3[_0x418074(0x107)]);}export async function getDatasetDetail(_0x3d6686){const _0x35aae1=a55_0x2e1d,_0x4e7b7b=/^\d+$/['test'](_0x3d6686)?'id':_0x35aae1(0xee),_0x3e56e7=await apiRequest(_0x35aae1(0xe5)+_0x4e7b7b+'='+_0x3d6686);return _0x3e56e7['data'];}export async function getDatasetSdkUsageDoc(_0x437e68,_0x56e0c3){const _0x37c2c5=a55_0x2e1d,_0x4c0fd9=await toolboxRequest(_0x37c2c5(0xc6),{'datasetCode':_0x437e68,'appCode':_0x56e0c3});return typeof _0x4c0fd9?.[_0x37c2c5(0xd7)]===_0x37c2c5(0xd8)?_0x4c0fd9['markdown']:'';}export async function listRuntimeArtifacts(_0x517300,_0x34a3b2){const _0x4300cf=a55_0x2e1d,_0xc905bc=new URLSearchParams({'appCode':_0x517300});if(_0x34a3b2?.[_0x4300cf(0xfd)])_0xc905bc[_0x4300cf(0xc2)]('artifactType',_0x34a3b2[_0x4300cf(0xfd)]);if(_0x34a3b2?.[_0x4300cf(0xbb)])_0xc905bc['set']('source',_0x34a3b2[_0x4300cf(0xbb)]);if(_0x34a3b2?.[_0x4300cf(0x10d)]!==undefined)_0xc905bc['set'](_0x4300cf(0x10d),String(_0x34a3b2[_0x4300cf(0x10d)]));const _0x4a63f7=await apiRequest(_0x4300cf(0xb6)+_0xc905bc[_0x4300cf(0xea)]());return Array['isArray'](_0x4a63f7['data'])?_0x4a63f7[_0x4300cf(0x107)]:[];}export async function getRuntimeArtifact(_0x411482,_0x47e477){const _0xa2ee16=a55_0x2e1d,_0x14ca3a=await apiRequest(_0xa2ee16(0xe2)+_0x411482+'?appCode='+encodeURIComponent(_0x47e477));if(!_0x14ca3a[_0xa2ee16(0x107)])throw CliErrors[_0xa2ee16(0xf6)]('Artifact\x20not\x20found:\x20id='+_0x411482);return _0x14ca3a[_0xa2ee16(0x107)];}export async function createRuntimeArtifact(_0x338ee3,_0x11b2b9){const _0x33cbf6=a55_0x2e1d,_0x4bfc9d=await apiRequest(_0x33cbf6(0x10e),{'method':_0x33cbf6(0xc0),'body':{'appCode':_0x338ee3,..._0x11b2b9}});return _0x4bfc9d['data'];}export async function updateRuntimeArtifact(_0x5a6149,_0x25fa3e,_0x431144){const _0x42cf24=a55_0x2e1d,_0x37af5f=await apiRequest('/client/artifact/'+_0x5a6149+'/update',{'method':_0x42cf24(0xc0),'body':{'appCode':_0x25fa3e,..._0x431144}});return _0x37af5f[_0x42cf24(0x107)];}export async function listPersonalBffs(_0x9f17e4){const _0x45627b=a55_0x2e1d,_0x1950f8=await apiRequest(_0x45627b(0xe0)+encodeURIComponent(_0x9f17e4));return Array[_0x45627b(0xb3)](_0x1950f8[_0x45627b(0x107)])?_0x1950f8[_0x45627b(0x107)]:[];}export async function getPersonalBff(_0x4c52b8,_0x3f8ccf){const _0x425d3b=a55_0x2e1d,_0x37e05e=await apiRequest('/client/runtime-bff/personal/'+_0x4c52b8+_0x425d3b(0xd3)+encodeURIComponent(_0x3f8ccf));if(!_0x37e05e['data'])throw CliErrors[_0x425d3b(0xf6)](_0x425d3b(0x100)+_0x4c52b8);return _0x37e05e[_0x425d3b(0x107)];}export async function createPersonalBff(_0x5977d1,_0x1898c8){const _0x426a6f=a55_0x2e1d,_0x39a3ef=await apiRequest(_0x426a6f(0xe8),{'method':'POST','body':{'appCode':_0x5977d1,..._0x1898c8}});return _0x39a3ef[_0x426a6f(0x107)];}function a55_0x2e1d(_0x2e8dd8,_0x523929){_0x2e8dd8=_0x2e8dd8-0xb1;const _0x5b78a7=a55_0x5b78();let _0x2e1dc4=_0x5b78a7[_0x2e8dd8];return _0x2e1dc4;}export async function updatePersonalBff(_0x34a09e,_0x19fdb3,_0x365bc2){const _0x7da122=a55_0x2e1d,_0x1227cf=await apiRequest(_0x7da122(0xeb)+_0x34a09e+_0x7da122(0xc7),{'method':_0x7da122(0xc0),'body':{'appCode':_0x19fdb3,..._0x365bc2}});return _0x1227cf['data'];}export async function executePersonalBff(_0x45fff0,_0x45570f,_0x45714c){const _0x2303c4=a55_0x2e1d,_0x1875b0=await apiRequest(_0x2303c4(0xeb)+_0x45fff0+_0x2303c4(0xc9)+encodeURIComponent(_0x45570f),{'method':_0x2303c4(0xc0),'body':_0x45714c});return _0x1875b0[_0x2303c4(0x107)];}export async function listPersonalKnowledgeBaseItems(_0x48a660){const _0x3de851=a55_0x2e1d,_0x4be467=await apiRequest('/client/knowledge-base/personal/list?appCode='+encodeURIComponent(_0x48a660));return Array[_0x3de851(0xb3)](_0x4be467[_0x3de851(0x107)])?_0x4be467[_0x3de851(0x107)]:[];}export async function getPersonalKnowledgeBaseItem(_0x4c25bf,_0x22fb27){const _0x4a414f=a55_0x2e1d,_0x28ae85=await apiRequest(_0x4a414f(0xf0)+_0x4c25bf+_0x4a414f(0xd3)+encodeURIComponent(_0x22fb27));if(!_0x28ae85[_0x4a414f(0x107)])throw CliErrors[_0x4a414f(0xf6)](_0x4a414f(0x10a)+_0x4c25bf);return _0x28ae85[_0x4a414f(0x107)];}export async function createPersonalKnowledgeBaseItem(_0x26510f,_0x3056bc){const _0x35ab5d=a55_0x2e1d,_0x199755=await apiRequest(_0x35ab5d(0x103),{'method':_0x35ab5d(0xc0),'body':{'appCode':_0x26510f,..._0x3056bc}});return _0x199755[_0x35ab5d(0x107)];}export async function updatePersonalKnowledgeBaseItem(_0x4cd721,_0x2331e4,_0xfb172e){const _0x3883fe=a55_0x2e1d,_0x4b7d08=await apiRequest(_0x3883fe(0xf0)+_0x4cd721+_0x3883fe(0xc7),{'method':'POST','body':{'appCode':_0x2331e4,..._0xfb172e}});return _0x4b7d08[_0x3883fe(0x107)];}export async function searchKnowledgeBase(_0x2f3131,_0x96ee94){const _0x2cf69e=a55_0x2e1d,_0x5bd907=await apiRequest('/client/knowledge-base/search',{'method':_0x2cf69e(0xc0),'body':{'appCode':_0x2f3131,'query':_0x96ee94['query'],..._0x96ee94[_0x2cf69e(0xb2)]!==undefined?{'topK':_0x96ee94[_0x2cf69e(0xb2)]}:{}}});return Array[_0x2cf69e(0xb3)](_0x5bd907['data'])?_0x5bd907['data']:[];}export async function listPersonalRuntimeSkills(_0x1c3c5f){const _0x304a33=a55_0x2e1d,_0x221dba=await apiRequest(_0x304a33(0xd1)+encodeURIComponent(_0x1c3c5f));return Array[_0x304a33(0xb3)](_0x221dba[_0x304a33(0x107)])?_0x221dba['data']:[];}export async function listCompanyRuntimeSkills(_0x26f2b1){const _0x1b704f=a55_0x2e1d,_0x524efa=await apiRequest(_0x1b704f(0xcc)+encodeURIComponent(_0x26f2b1));return Array['isArray'](_0x524efa[_0x1b704f(0x107)])?_0x524efa[_0x1b704f(0x107)]:[];}export async function listVisibleRuntimeSkills(_0x4b5b07){const _0x280253=a55_0x2e1d,_0x515237=await apiRequest(_0x280253(0xef)+encodeURIComponent(_0x4b5b07));return Array[_0x280253(0xb3)](_0x515237[_0x280253(0x107)])?_0x515237[_0x280253(0x107)]:[];}function a55_0x5b78(){const _0x557bd2=['filter','/client/dataset/list','validation','Configure\x20accessKey\x20in\x20','/package?appCode=','BFF\x20script\x20not\x20found:\x20id=','errorCode','SQL\x20query\x20not\x20found:\x20','catch','artifactType','success','3050016FwjoGD','Personal\x20BFF\x20not\x20found:\x20id=','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','5niPqGP','/client/knowledge-base/personal/create','invokeSource','text','message','data','status','newConfigFileName','Knowledge-base\x20entry\x20not\x20found:\x20id=','/client/skill/personal/','Check\x20your\x20credentials\x20and\x20try\x20again.','favorite','/client/artifact/create','72AZbJHo','boolean','topK','isArray','1487684vQIpCb','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/client/artifact/list?','Toolbox\x20error\x20code:\x20','tableData','2867887mfLIQL','searchParams','source','52170HSvkud','/api/node-toolbox/','errorMsg','4728605CTSMKu','POST','abort','set','/client/bff/query/','API\x20error\x20code:\x20','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','api-doc-generator','/update','Toolbox\x20API\x20error:\x20','/execute?appCode=','json','object','/client/skill/company/list?appCode=','arrayBuffer','apiError','5234110dhHYMt','appCode','/client/skill/personal/list?appCode=','3VvUVRe','?appCode=','stringify','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','markdown','string','authRequired','/client/user/loginUserInfo','sqlCode','AbortError','/client/skill/personal/create','/client/app/my-apps','signal','/client/runtime-bff/personal/list?appCode=','35674PzBlyV','/client/artifact/','GET','entries','/client/dataset/query?','2wHzumx','appName','/client/runtime-bff/personal/create','application/json','toString','/client/runtime-bff/personal/','replace','API\x20error:\x20','code','/client/skill/list?appCode=','/client/knowledge-base/personal/','name','9foQHnn','Request\x20timeout:\x20'];a55_0x5b78=function(){return _0x557bd2;};return a55_0x5b78();}export async function createPersonalRuntimeSkill(_0x28d933,_0x6944f3){const _0xe70d70=a55_0x2e1d,_0x3d0685=await apiRequest(_0xe70d70(0xdd),{'method':'POST','body':{'appCode':_0x28d933,..._0x6944f3}});return _0x3d0685[_0xe70d70(0x107)];}export async function updatePersonalRuntimeSkill(_0x21a3ef,_0x203abd,_0x15c0ad){const _0x4e64f7=a55_0x2e1d,_0x44e5db=await apiRequest(_0x4e64f7(0x10b)+encodeURIComponent(_0x21a3ef)+_0x4e64f7(0xc7),{'method':_0x4e64f7(0xc0),'body':{'appCode':_0x203abd,..._0x15c0ad}});return _0x44e5db[_0x4e64f7(0x107)];}export async function downloadRuntimeSkillPackage(_0x4b64fb,_0x163698,_0x362a87){const _0x1bf7fa=a55_0x2e1d;return apiBinaryRequest('/client/skill/'+encodeURIComponent(_0x4b64fb)+'/'+encodeURIComponent(_0x163698)+_0x1bf7fa(0xf8)+encodeURIComponent(_0x362a87));}
|
|
1
|
+
function a56_0x455e(_0x4b9635,_0x3a7317){_0x4b9635=_0x4b9635-0x1d8;const _0x16f4c7=a56_0x16f4();let _0x455ee5=_0x16f4c7[_0x4b9635];return _0x455ee5;}(function(_0x3cdd25,_0x1a1f53){const _0x38bf38=a56_0x455e,_0x9ba676=_0x3cdd25();while(!![]){try{const _0x4f58a1=parseInt(_0x38bf38(0x220))/0x1+-parseInt(_0x38bf38(0x239))/0x2*(parseInt(_0x38bf38(0x231))/0x3)+-parseInt(_0x38bf38(0x1ed))/0x4*(-parseInt(_0x38bf38(0x1ff))/0x5)+parseInt(_0x38bf38(0x1e3))/0x6*(parseInt(_0x38bf38(0x23b))/0x7)+parseInt(_0x38bf38(0x210))/0x8*(-parseInt(_0x38bf38(0x1f5))/0x9)+-parseInt(_0x38bf38(0x1f3))/0xa+parseInt(_0x38bf38(0x23e))/0xb*(-parseInt(_0x38bf38(0x1e0))/0xc);if(_0x4f58a1===_0x1a1f53)break;else _0x9ba676['push'](_0x9ba676['shift']());}catch(_0x493280){_0x9ba676['push'](_0x9ba676['shift']());}}}(a56_0x16f4,0xa9339));import{getApiDomain,getRuntimeDomain,getSkillHubDomain}from'../constant/domain.js';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeAK;export function setActiveAK(_0x3dea49){_activeAK=_0x3dea49||undefined;}export function clearActiveAK(){_activeAK=undefined;}async function apiRequest(_0x4aa608,_0x5c2f13={}){const _0x406f00=a56_0x455e,{method:method=_0x406f00(0x1de),body:_0x1da5a1,headers:headers={},timeout:timeout=0x7530}=_0x5c2f13,_0x2c3dfa=_activeAK,_0x435070=getRuntimeDomain();if(!_0x2c3dfa)throw CliErrors[_0x406f00(0x252)](_0x406f00(0x22d)+PRODUCT_CONFIG[_0x406f00(0x212)]+'.');const _0xcc09b3=''+_0x435070+_0x4aa608,_0x118c2c={'X-User-AK':_0x2c3dfa},_0x4d926e=new AbortController(),_0x22feda=setTimeout(()=>_0x4d926e[_0x406f00(0x249)](),timeout);try{const _0x36749b=await fetch(_0xcc09b3,{'method':method,'headers':{'Content-Type':_0x406f00(0x20a),'X-Invoke-Source':PRODUCT_CONFIG[_0x406f00(0x1e1)],..._0x118c2c,...headers},'body':_0x1da5a1?JSON['stringify'](_0x1da5a1):undefined,'signal':_0x4d926e[_0x406f00(0x208)]});let _0x598ef3;try{_0x598ef3=await _0x36749b[_0x406f00(0x246)]();}catch{throw CliErrors[_0x406f00(0x1e9)](_0x406f00(0x1d8)+_0x36749b[_0x406f00(0x253)]+')',_0x36749b[_0x406f00(0x253)]>=0x190?_0x406f00(0x238):undefined);}if(!_0x36749b['ok']||_0x598ef3[_0x406f00(0x1e8)]===![])throw CliErrors[_0x406f00(0x1e9)](_0x598ef3['errorMsg']||_0x598ef3[_0x406f00(0x23a)]||_0x406f00(0x216)+_0x36749b[_0x406f00(0x253)],_0x598ef3['errorCode']?'API\x20error\x20code:\x20'+_0x598ef3[_0x406f00(0x244)]:undefined);return _0x598ef3;}catch(_0x54be4c){if(_0x54be4c instanceof Error&&_0x54be4c['name']===_0x406f00(0x21d))throw CliErrors[_0x406f00(0x1e9)]('Request\x20timeout:\x20'+_0xcc09b3);throw _0x54be4c;}finally{clearTimeout(_0x22feda);}}async function apiBinaryRequest(_0x49c974,_0x16df15={}){const _0x45d74d=a56_0x455e,{method:method=_0x45d74d(0x1de),headers:headers={},timeout:timeout=0x7530}=_0x16df15,_0x1329ac=_activeAK,_0x1e70a0=getRuntimeDomain();if(!_0x1329ac)throw CliErrors[_0x45d74d(0x252)](_0x45d74d(0x22d)+PRODUCT_CONFIG[_0x45d74d(0x212)]+'.');const _0x3c738d=''+_0x1e70a0+_0x49c974,_0x4eecd9=new AbortController(),_0xbef1c9=setTimeout(()=>_0x4eecd9[_0x45d74d(0x249)](),timeout);try{const _0x2ab484=await fetch(_0x3c738d,{'method':method,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x45d74d(0x1e1)],'X-User-AK':_0x1329ac,...headers},'signal':_0x4eecd9[_0x45d74d(0x208)]});if(!_0x2ab484['ok']){let _0x8636e2;try{const _0x27c1b8=await _0x2ab484['json']();_0x8636e2=_0x27c1b8[_0x45d74d(0x1e2)]||_0x27c1b8[_0x45d74d(0x23a)]||_0x27c1b8['errorCode'];}catch{_0x8636e2=await _0x2ab484[_0x45d74d(0x223)]()[_0x45d74d(0x23c)](()=>undefined);}throw CliErrors[_0x45d74d(0x1e9)](_0x8636e2||_0x45d74d(0x216)+_0x2ab484[_0x45d74d(0x253)],'Download\x20failed:\x20'+_0x3c738d);}return Buffer[_0x45d74d(0x225)](await _0x2ab484[_0x45d74d(0x240)]());}catch(_0x2f5fad){if(_0x2f5fad instanceof Error&&_0x2f5fad['name']===_0x45d74d(0x21d))throw CliErrors[_0x45d74d(0x1e9)]('Request\x20timeout:\x20'+_0x3c738d);throw _0x2f5fad;}finally{clearTimeout(_0xbef1c9);}}async function toolboxRequest(_0x41fe3e,_0x59b123,_0x1bfcc2={}){const _0xe0c613=a56_0x455e,{method:method=_0xe0c613(0x1de),headers:headers={},timeout:timeout=0x7530}=_0x1bfcc2,_0xb2f561=_activeAK;if(!_0xb2f561)throw CliErrors['authRequired'](_0xe0c613(0x22d)+PRODUCT_CONFIG[_0xe0c613(0x212)]+'.');const _0x4dffdd=getApiDomain()[_0xe0c613(0x1ea)](/\/$/,''),_0x55d254=new URL(_0x41fe3e,_0x4dffdd+_0xe0c613(0x1f9));if(_0x59b123)for(const [_0x407931,_0x3d5e6a]of Object[_0xe0c613(0x236)](_0x59b123)){_0x3d5e6a!==undefined&&_0x3d5e6a!==null&&_0x55d254[_0xe0c613(0x234)][_0xe0c613(0x1fc)](_0x407931,String(_0x3d5e6a));}const _0x59d27=new AbortController(),_0x4716ff=setTimeout(()=>_0x59d27[_0xe0c613(0x249)](),timeout);try{const _0x426620=await fetch(_0x55d254,{'method':method,'headers':{'Content-Type':_0xe0c613(0x20a),'X-Invoke-Source':PRODUCT_CONFIG[_0xe0c613(0x1e1)],'X-User-AK':_0xb2f561,...headers},'signal':_0x59d27[_0xe0c613(0x208)]});let _0x3c2384;try{_0x3c2384=await _0x426620[_0xe0c613(0x246)]();}catch{throw CliErrors[_0xe0c613(0x1e9)](_0xe0c613(0x226)+_0x426620['status']+')',_0x426620[_0xe0c613(0x253)]>=0x190?_0xe0c613(0x238):undefined);}if(!_0x426620['ok']){const _0x400030=_0x3c2384&&typeof _0x3c2384===_0xe0c613(0x21c)?_0x3c2384:{};throw CliErrors[_0xe0c613(0x1e9)](_0x400030[_0xe0c613(0x1e2)]||_0x400030[_0xe0c613(0x23a)]||_0xe0c613(0x245)+_0x426620[_0xe0c613(0x253)],_0x400030[_0xe0c613(0x244)]?_0xe0c613(0x1ef)+_0x400030[_0xe0c613(0x244)]:undefined);}if(_0x3c2384&&typeof _0x3c2384==='object'&&_0xe0c613(0x1e8)in _0x3c2384&&typeof _0x3c2384[_0xe0c613(0x1e8)]===_0xe0c613(0x1fa)){const _0xc5e546=_0x3c2384;if(!_0xc5e546[_0xe0c613(0x1e8)])throw CliErrors['apiError'](_0xc5e546[_0xe0c613(0x1e2)]||_0xc5e546['message']||_0xe0c613(0x1f4),_0xc5e546[_0xe0c613(0x244)]?'Toolbox\x20error\x20code:\x20'+_0xc5e546[_0xe0c613(0x244)]:undefined);return _0xc5e546[_0xe0c613(0x22c)];}return _0x3c2384;}catch(_0x1dfd60){if(_0x1dfd60 instanceof Error&&_0x1dfd60[_0xe0c613(0x1e6)]==='AbortError')throw CliErrors[_0xe0c613(0x1e9)](_0xe0c613(0x21e)+_0x55d254[_0xe0c613(0x24f)]());throw _0x1dfd60;}finally{clearTimeout(_0x4716ff);}}async function skillHubJsonRequest(_0x98d51e,_0x20dd1c={}){const _0x331801=a56_0x455e,{method:method=_0x331801(0x1de),query:_0x19c330,body:_0x426431,headers:headers={},timeout:timeout=0x7530}=_0x20dd1c,_0x26ce11=_activeAK;if(!_0x26ce11)throw CliErrors[_0x331801(0x252)](_0x331801(0x22d)+PRODUCT_CONFIG[_0x331801(0x212)]+'.');const _0x32e577=getSkillHubDomain()[_0x331801(0x1ea)](/\/$/,''),_0x516a70=new URL(_0x98d51e,_0x32e577+'/');if(_0x19c330)for(const [_0x23d64f,_0x73f731]of Object[_0x331801(0x236)](_0x19c330)){_0x73f731!==undefined&&_0x73f731!==null&&_0x516a70['searchParams']['set'](_0x23d64f,String(_0x73f731));}const _0x353504=new AbortController(),_0x25c6b7=setTimeout(()=>_0x353504['abort'](),timeout);try{const _0x4646f1=await fetch(_0x516a70[_0x331801(0x24f)](),{'method':method,'headers':{'Accept':'application/json','X-Invoke-Source':PRODUCT_CONFIG[_0x331801(0x1e1)],'X-User-AK':_0x26ce11,...headers},'body':_0x426431,'signal':_0x353504[_0x331801(0x208)]});let _0x166024;try{_0x166024=await _0x4646f1[_0x331801(0x246)]();}catch{throw CliErrors['apiError']('SkillHub\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x4646f1['status']+')',_0x4646f1[_0x331801(0x253)]>=0x190?'Check\x20your\x20credentials\x20and\x20try\x20again.':undefined);}const _0x1ba478=!_0x4646f1['ok']||_0x166024?.[_0x331801(0x1e8)]===![]||typeof _0x166024?.[_0x331801(0x215)]===_0x331801(0x1ec)&&_0x166024[_0x331801(0x215)]>=0x190;if(_0x1ba478)throw CliErrors[_0x331801(0x1e9)](_0x166024?.[_0x331801(0x1e2)]||_0x166024?.[_0x331801(0x23a)]||_0x166024?.['msg']||_0x331801(0x1eb)+_0x4646f1[_0x331801(0x253)],_0x166024?.[_0x331801(0x244)]?'SkillHub\x20error\x20code:\x20'+_0x166024[_0x331801(0x244)]:undefined);return _0x166024?.['data']??_0x166024;}catch(_0x5bfba5){if(_0x5bfba5 instanceof Error&&_0x5bfba5[_0x331801(0x1e6)]===_0x331801(0x21d))throw CliErrors[_0x331801(0x1e9)]('Request\x20timeout:\x20'+_0x516a70[_0x331801(0x24f)]());throw _0x5bfba5;}finally{clearTimeout(_0x25c6b7);}}async function skillHubBinaryRequest(_0x5eeb46,_0x46c486={}){const _0x1e104f=a56_0x455e,{query:_0x4e0598,headers:headers={},timeout:timeout=0x7530}=_0x46c486,_0x3911ed=_activeAK;if(!_0x3911ed)throw CliErrors[_0x1e104f(0x252)](_0x1e104f(0x22d)+PRODUCT_CONFIG[_0x1e104f(0x212)]+'.');const _0x4f31a4=getSkillHubDomain()['replace'](/\/$/,''),_0x1bb553=new URL(_0x5eeb46,_0x4f31a4+'/');if(_0x4e0598)for(const [_0x5a7ae7,_0xf6b3f4]of Object[_0x1e104f(0x236)](_0x4e0598)){_0xf6b3f4!==undefined&&_0xf6b3f4!==null&&_0x1bb553[_0x1e104f(0x234)]['set'](_0x5a7ae7,String(_0xf6b3f4));}const _0x302984=new AbortController(),_0x24ad91=setTimeout(()=>_0x302984[_0x1e104f(0x249)](),timeout);try{const _0x1022db=await fetch(_0x1bb553[_0x1e104f(0x24f)](),{'method':'GET','headers':{'Accept':'application/octet-stream','X-Invoke-Source':PRODUCT_CONFIG[_0x1e104f(0x1e1)],'X-User-AK':_0x3911ed,...headers},'signal':_0x302984[_0x1e104f(0x208)]});if(!_0x1022db['ok']){let _0x17f8de;try{const _0x281140=await _0x1022db[_0x1e104f(0x246)]();_0x17f8de=_0x281140['errorMsg']||_0x281140[_0x1e104f(0x23a)]||_0x281140[_0x1e104f(0x21a)]||_0x281140[_0x1e104f(0x244)];}catch{_0x17f8de=await _0x1022db[_0x1e104f(0x223)]()[_0x1e104f(0x23c)](()=>undefined);}throw CliErrors['apiError'](_0x17f8de||_0x1e104f(0x1eb)+_0x1022db['status'],_0x1e104f(0x20d)+_0x1bb553[_0x1e104f(0x24f)]());}return Buffer[_0x1e104f(0x225)](await _0x1022db['arrayBuffer']());}catch(_0x1d07f7){if(_0x1d07f7 instanceof Error&&_0x1d07f7[_0x1e104f(0x1e6)]===_0x1e104f(0x21d))throw CliErrors['apiError'](_0x1e104f(0x21e)+_0x1bb553[_0x1e104f(0x24f)]());throw _0x1d07f7;}finally{clearTimeout(_0x24ad91);}}export async function getBffScriptInfo(_0x13b15f){const _0x2ecff1=a56_0x455e,_0x18008b=await apiRequest(_0x2ecff1(0x222)+_0x13b15f);if(!_0x18008b[_0x2ecff1(0x22c)])throw CliErrors[_0x2ecff1(0x250)](_0x2ecff1(0x219)+_0x13b15f);return _0x18008b[_0x2ecff1(0x22c)];}export async function getSqlQueryInfo(_0x1b570c,_0x250f64){const _0x318a09=a56_0x455e,_0x2edc4f=await apiRequest(_0x318a09(0x209),{'method':_0x318a09(0x22b),'body':{'appCode':_0x1b570c,'currentPage':0x1,'pageSize':0x1,'sqlCode':_0x250f64}}),_0x40987b=_0x2edc4f['data'],_0x3d869=_0x40987b&&typeof _0x40987b===_0x318a09(0x21c)&&_0x318a09(0x1fe)in _0x40987b?_0x40987b[_0x318a09(0x1fe)]?.[0x0]:_0x40987b&&typeof _0x40987b===_0x318a09(0x21c)&&_0x318a09(0x1e7)in _0x40987b?_0x40987b:undefined;if(!_0x3d869)throw CliErrors[_0x318a09(0x250)](_0x318a09(0x1f7)+_0x250f64);return _0x3d869;}function isRemoteAppItem(_0x2726c4){const _0x12ac76=a56_0x455e;return!!_0x2726c4&&typeof _0x2726c4===_0x12ac76(0x21c)&&typeof _0x2726c4[_0x12ac76(0x24a)]===_0x12ac76(0x241)&&typeof _0x2726c4[_0x12ac76(0x1f6)]==='string';}function extractRemoteAppItems(_0x40f237){const _0x5aea0f=a56_0x455e;if(Array[_0x5aea0f(0x23f)](_0x40f237))return _0x40f237[_0x5aea0f(0x227)](isRemoteAppItem);if(!_0x40f237||typeof _0x40f237!==_0x5aea0f(0x21c))throw CliErrors[_0x5aea0f(0x1e9)](_0x5aea0f(0x203));const _0x1caf49=_0x40f237;if(Array[_0x5aea0f(0x23f)](_0x1caf49['tableData']))return _0x1caf49['tableData']['filter'](isRemoteAppItem);if(_0x1caf49[_0x5aea0f(0x22c)]&&typeof _0x1caf49[_0x5aea0f(0x22c)]===_0x5aea0f(0x21c)){const _0x89012b=_0x1caf49[_0x5aea0f(0x22c)];if(Array[_0x5aea0f(0x23f)](_0x89012b['tableData']))return _0x89012b[_0x5aea0f(0x1fe)][_0x5aea0f(0x227)](isRemoteAppItem);}throw CliErrors[_0x5aea0f(0x1e9)](_0x5aea0f(0x23d));}export async function getMyApps(){const _0x3dabfc=a56_0x455e,_0x47cc9b=await apiRequest('/client/app/my-apps');return extractRemoteAppItems(_0x47cc9b[_0x3dabfc(0x22c)]);}export async function getLoginUserInfo(){const _0x157ab1=a56_0x455e,_0x3cfdb8=await apiRequest('/client/user/loginUserInfo');if(!_0x3cfdb8[_0x157ab1(0x22c)]||typeof _0x3cfdb8[_0x157ab1(0x22c)]!==_0x157ab1(0x21c)||Array['isArray'](_0x3cfdb8[_0x157ab1(0x22c)]))throw CliErrors[_0x157ab1(0x1e9)](_0x157ab1(0x232));return _0x3cfdb8['data'];}export async function listDatasets(_0xb6e92e,_0x3cadc8){const _0x3e35d8=a56_0x455e,_0x5e0047=await apiRequest(_0x3e35d8(0x204),{'method':_0x3e35d8(0x22b),'body':{'appCode':_0xb6e92e,..._0x3cadc8?.[_0x3e35d8(0x215)]&&{'code':_0x3cadc8[_0x3e35d8(0x215)]},..._0x3cadc8?.['name']&&{'name':_0x3cadc8[_0x3e35d8(0x1e6)]}}});return extractList(_0x5e0047['data']);}export async function getDatasetDetail(_0xe2f474){const _0x2aefd3=a56_0x455e,_0x192845=/^\d+$/[_0x2aefd3(0x24d)](_0xe2f474)?'id':'code',_0x3dcc7c=await apiRequest(_0x2aefd3(0x22f)+_0x192845+'='+_0xe2f474);return _0x3dcc7c['data'];}export async function getDatasetSdkUsageDoc(_0x4e0778,_0x36f5af){const _0x29c4e0=a56_0x455e,_0x48c72d=await toolboxRequest(_0x29c4e0(0x254),{'datasetCode':_0x4e0778,'appCode':_0x36f5af});return typeof _0x48c72d?.[_0x29c4e0(0x243)]===_0x29c4e0(0x241)?_0x48c72d[_0x29c4e0(0x243)]:'';}export async function listRuntimeArtifacts(_0x2a43ca,_0x5a5e9b){const _0x2cc934=a56_0x455e,_0x5924cb=new URLSearchParams({'appCode':_0x2a43ca});if(_0x5a5e9b?.[_0x2cc934(0x22e)])_0x5924cb[_0x2cc934(0x1fc)](_0x2cc934(0x22e),_0x5a5e9b['artifactType']);if(_0x5a5e9b?.[_0x2cc934(0x251)])_0x5924cb[_0x2cc934(0x1fc)]('source',_0x5a5e9b[_0x2cc934(0x251)]);if(_0x5a5e9b?.[_0x2cc934(0x22a)]!==undefined)_0x5924cb['set'](_0x2cc934(0x22a),String(_0x5a5e9b[_0x2cc934(0x22a)]));const _0x3b9ee6=await apiRequest(_0x2cc934(0x24b)+_0x5924cb[_0x2cc934(0x24f)]());return Array[_0x2cc934(0x23f)](_0x3b9ee6['data'])?_0x3b9ee6[_0x2cc934(0x22c)]:[];}export async function getRuntimeArtifact(_0x39970b,_0x47d6eb){const _0x13b3d8=a56_0x455e,_0x26feae=await apiRequest(_0x13b3d8(0x224)+_0x39970b+'?appCode='+encodeURIComponent(_0x47d6eb));if(!_0x26feae[_0x13b3d8(0x22c)])throw CliErrors[_0x13b3d8(0x250)](_0x13b3d8(0x1f2)+_0x39970b);return _0x26feae[_0x13b3d8(0x22c)];}export async function createRuntimeArtifact(_0x5a0561,_0x5c6238){const _0x4e75eb=a56_0x455e,_0x42095b=await apiRequest(_0x4e75eb(0x206),{'method':'POST','body':{'appCode':_0x5a0561,..._0x5c6238}});return _0x42095b['data'];}export async function updateRuntimeArtifact(_0x20ad22,_0x217d8a,_0x474018){const _0x246996=a56_0x455e,_0x37c8ac=await apiRequest('/client/artifact/'+_0x20ad22+_0x246996(0x1da),{'method':_0x246996(0x22b),'body':{'appCode':_0x217d8a,..._0x474018}});return _0x37c8ac['data'];}export async function listPersonalBffs(_0x2ebbef){const _0x5912d2=a56_0x455e,_0x477cc5=await apiRequest(_0x5912d2(0x221)+encodeURIComponent(_0x2ebbef));return Array[_0x5912d2(0x23f)](_0x477cc5['data'])?_0x477cc5[_0x5912d2(0x22c)]:[];}export async function getPersonalBff(_0x42fc07,_0x5648f8){const _0x195a5c=a56_0x455e,_0x1bf3d6=await apiRequest(_0x195a5c(0x235)+_0x42fc07+_0x195a5c(0x205)+encodeURIComponent(_0x5648f8));if(!_0x1bf3d6['data'])throw CliErrors[_0x195a5c(0x250)](_0x195a5c(0x20e)+_0x42fc07);return _0x1bf3d6[_0x195a5c(0x22c)];}export async function createPersonalBff(_0x739d90,_0xa7f70f){const _0x4c7695=await apiRequest('/client/runtime-bff/personal/create',{'method':'POST','body':{'appCode':_0x739d90,..._0xa7f70f}});return _0x4c7695['data'];}export async function updatePersonalBff(_0x6c8f1a,_0x40ecf5,_0x438dd8){const _0x54bcaf=a56_0x455e,_0x250462=await apiRequest('/client/runtime-bff/personal/'+_0x6c8f1a+_0x54bcaf(0x1da),{'method':_0x54bcaf(0x22b),'body':{'appCode':_0x40ecf5,..._0x438dd8}});return _0x250462[_0x54bcaf(0x22c)];}export async function executePersonalBff(_0x169f8e,_0x1ee6ad,_0x4b3252){const _0x522cca=a56_0x455e,_0x4f52e4=await apiRequest(_0x522cca(0x235)+_0x169f8e+_0x522cca(0x228)+encodeURIComponent(_0x1ee6ad),{'method':_0x522cca(0x22b),'body':_0x4b3252});return _0x4f52e4['data'];}export async function listPersonalKnowledgeBaseItems(_0x157cbe){const _0x2909ec=a56_0x455e,_0x16950d=await apiRequest(_0x2909ec(0x21f)+encodeURIComponent(_0x157cbe));return Array[_0x2909ec(0x23f)](_0x16950d[_0x2909ec(0x22c)])?_0x16950d[_0x2909ec(0x22c)]:[];}export async function getPersonalKnowledgeBaseItem(_0x501668,_0x4b8eb0){const _0x4792a1=a56_0x455e,_0xf641a5=await apiRequest(_0x4792a1(0x21b)+_0x501668+_0x4792a1(0x205)+encodeURIComponent(_0x4b8eb0));if(!_0xf641a5['data'])throw CliErrors[_0x4792a1(0x250)](_0x4792a1(0x1e4)+_0x501668);return _0xf641a5[_0x4792a1(0x22c)];}export async function createPersonalKnowledgeBaseItem(_0x11262a,_0x3d904e){const _0x5680bc=a56_0x455e,_0x107157=await apiRequest('/client/knowledge-base/personal/create',{'method':_0x5680bc(0x22b),'body':{'appCode':_0x11262a,..._0x3d904e}});return _0x107157[_0x5680bc(0x22c)];}export async function updatePersonalKnowledgeBaseItem(_0x4ec982,_0x589636,_0x2d3d2a){const _0x1aadd8=a56_0x455e,_0xabcbd5=await apiRequest(_0x1aadd8(0x21b)+_0x4ec982+'/update',{'method':_0x1aadd8(0x22b),'body':{'appCode':_0x589636,..._0x2d3d2a}});return _0xabcbd5[_0x1aadd8(0x22c)];}export async function searchKnowledgeBase(_0x1abdc3,_0x2de7f5){const _0x37d9e3=a56_0x455e,_0x4656da=await apiRequest(_0x37d9e3(0x24c),{'method':'POST','body':{'appCode':_0x1abdc3,'query':_0x2de7f5['query'],..._0x2de7f5[_0x37d9e3(0x218)]!==undefined?{'topK':_0x2de7f5[_0x37d9e3(0x218)]}:{}}});return Array[_0x37d9e3(0x23f)](_0x4656da[_0x37d9e3(0x22c)])?_0x4656da['data']:[];}export async function listRuntimeSkills(_0x2529fc){const _0x341293=a56_0x455e,_0x305313=await skillHubJsonRequest('/api/runtime/v1/namespaces/'+encodeURIComponent(_0x2529fc[_0x341293(0x24a)])+_0x341293(0x217),{'query':{'page':0x0,'size':0xc8}});return normalizeSkillHubRuntimeListResponse(_0x2529fc[_0x341293(0x24a)],_0x305313,_0x2529fc[_0x341293(0x248)]??_0x341293(0x1ee),_0x2529fc[_0x341293(0x215)]);}export async function listPersonalRuntimeSkills(_0x433c79){const _0x56ac37=a56_0x455e;return(await listRuntimeSkills({'appCode':_0x433c79,'scope':_0x56ac37(0x237)}))['personal'];}function a56_0x16f4(){const _0x5efcc1=['api-doc-generator','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','tags','/update','builtin','version','effective','GET','application/zip','11196Jmsgwf','invokeSource','errorMsg','5442KtpSdD','Knowledge-base\x20entry\x20not\x20found:\x20id=','files','name','sqlCode','success','apiError','replace','SkillHub\x20API\x20error:\x20','number','560012mmrqcW','user','Toolbox\x20error\x20code:\x20','PRIVATE','map','Artifact\x20not\x20found:\x20id=','3494920JAPqkj','Toolbox\x20API\x20error','936moWPkN','appName','SQL\x20query\x20not\x20found:\x20','/api/cli/v1/skills/','/api/node-toolbox/','boolean','description','set','public','tableData','40euCpQo','summary','namespace','trim','Invalid\x20app\x20list\x20response:\x20expected\x20object\x20or\x20array.','/client/dataset/list','?appCode=','/client/artifact/create','displayName','signal','/client/sql/query','application/json','undefined','items','Download\x20failed:\x20','Personal\x20BFF\x20not\x20found:\x20id=','company','46448DokFkU','Missing\x20Skill\x20package\x20payload.','newConfigFileName','.zip','visibility','code','API\x20error:\x20','/skills','topK','BFF\x20script\x20not\x20found:\x20id=','msg','/client/knowledge-base/personal/','object','AbortError','Request\x20timeout:\x20','/client/knowledge-base/personal/list?appCode=','1241907bJTyxL','/client/runtime-bff/personal/list?appCode=','/client/bff/query/','text','/client/artifact/','from','Toolbox\x20returned\x20non-JSON\x20response\x20(HTTP\x20','filter','/execute?appCode=','skillCode','favorite','POST','data','Configure\x20accessKey\x20in\x20','artifactType','/client/dataset/query?','slug','6FSciqP','Invalid\x20login\x20user\x20info\x20response:\x20expected\x20object.','/download','searchParams','/client/runtime-bff/personal/','entries','personal','Check\x20your\x20credentials\x20and\x20try\x20again.','502058lSDedC','message','9254Urumhx','catch','Invalid\x20app\x20list\x20response:\x20missing\x20data.tableData.','16654CfaPXA','isArray','arrayBuffer','string','packageBase64','markdown','errorCode','Toolbox\x20API\x20error:\x20','json','ownerPreviewVersion','scope','abort','appCode','/client/artifact/list?','/client/knowledge-base/search','test','headlineVersion','toString','validation','source','authRequired','status'];a56_0x16f4=function(){return _0x5efcc1;};return a56_0x16f4();}export async function listCompanyRuntimeSkills(_0x1b16c8){const _0x1ca74d=a56_0x455e;return(await listRuntimeSkills({'appCode':_0x1b16c8,'scope':_0x1ca74d(0x20f)}))[_0x1ca74d(0x20f)];}export async function listVisibleRuntimeSkills(_0x91af4){const _0x5c3169=a56_0x455e;return(await listRuntimeSkills({'appCode':_0x91af4,'scope':_0x5c3169(0x1ee)}))[_0x5c3169(0x1dd)];}export async function createPersonalRuntimeSkill(_0x657415,_0x3ceb4b){return publishRuntimeSkill(_0x657415,_0x3ceb4b);}export async function updatePersonalRuntimeSkill(_0x126ceb,_0x562958,_0x3d9f5d){return publishRuntimeSkill(_0x562958,{..._0x3d9f5d,'skillCode':_0x3d9f5d['skillCode']??_0x126ceb});}export async function downloadRuntimeSkillPackage(_0x2a2e3c,_0x44cfcc,_0x2abec5,_0x49f04a){const _0x5353c0=a56_0x455e;void _0x2a2e3c;const _0x3f120f=_0x49f04a?'/api/cli/v1/skills/'+encodeURIComponent(_0x2abec5)+'/'+encodeURIComponent(_0x44cfcc)+'/versions/'+encodeURIComponent(_0x49f04a)+'/download':_0x5353c0(0x1f8)+encodeURIComponent(_0x2abec5)+'/'+encodeURIComponent(_0x44cfcc)+_0x5353c0(0x233);return skillHubBinaryRequest(_0x3f120f);}async function publishRuntimeSkill(_0x547cad,_0x5066d8){const _0x52e408=a56_0x455e,_0x4b04e5=new FormData();_0x4b04e5[_0x52e408(0x1fc)]('file',runtimeSkillPackageFile(_0x5066d8)),_0x4b04e5[_0x52e408(0x1fc)](_0x52e408(0x214),_0x52e408(0x1f0));const _0x330d33=await skillHubJsonRequest(_0x52e408(0x1f8)+encodeURIComponent(_0x547cad)+'/publish',{'method':_0x52e408(0x22b),'body':_0x4b04e5});return{'appCode':_0x330d33['namespace']??_0x547cad,'skillCode':_0x330d33[_0x52e408(0x230)]??_0x5066d8['skillCode']??'','skillName':_0x5066d8['skillName']??_0x330d33[_0x52e408(0x230)]??_0x5066d8[_0x52e408(0x229)],'description':_0x5066d8[_0x52e408(0x1fb)],'scope':skillHubVisibilityToScope(_0x330d33[_0x52e408(0x214)])??_0x52e408(0x237),'version':_0x330d33[_0x52e408(0x1dc)]??_0x5066d8[_0x52e408(0x1dc)],'tags':_0x5066d8[_0x52e408(0x1d9)],'content':_0x5066d8['content'],'files':_0x5066d8[_0x52e408(0x1e5)]};}function runtimeSkillPackageFile(_0x89900){const _0x28d058=a56_0x455e;if(!_0x89900['packageBase64'])throw CliErrors[_0x28d058(0x250)](_0x28d058(0x211));const _0x2f772b=Buffer[_0x28d058(0x225)](_0x89900[_0x28d058(0x242)],'base64'),_0x3bcf8b=new Blob([_0x2f772b],{'type':_0x28d058(0x1df)}),_0x33efc6=(_0x89900['skillCode']||'skill')+_0x28d058(0x213);if(typeof File!==_0x28d058(0x20b))return new File([_0x3bcf8b],_0x33efc6,{'type':_0x28d058(0x1df)});return _0x3bcf8b;}function normalizeSkillHubRuntimeListResponse(_0x795def,_0x170054,_0x1d4ae9,_0x4ccc92){const _0x2c6c19=a56_0x455e,_0x22aaae=Array['isArray'](_0x170054)?_0x170054:Array[_0x2c6c19(0x23f)](_0x170054?.[_0x2c6c19(0x20c)])?_0x170054[_0x2c6c19(0x20c)]:[],_0x1640b5=_0x4ccc92?.['trim'](),_0x3fa6e0=_0x22aaae[_0x2c6c19(0x227)](_0x45310f=>!_0x1640b5||_0x45310f[_0x2c6c19(0x230)]===_0x1640b5)[_0x2c6c19(0x1f1)](skillHubRuntimeItemToRuntimeSkill)[_0x2c6c19(0x227)](_0x5c686c=>Boolean(_0x5c686c)),_0x4a1c0e=_0x3fa6e0['filter'](_0x144a50=>_0x144a50[_0x2c6c19(0x248)]===_0x2c6c19(0x237)),_0x54de31=_0x3fa6e0[_0x2c6c19(0x227)](_0x2f1248=>_0x2f1248[_0x2c6c19(0x248)]===_0x2c6c19(0x20f)),_0x9bd9cb=_0x3fa6e0[_0x2c6c19(0x227)](_0x3b8b82=>_0x3b8b82['scope']===_0x2c6c19(0x1fd));return{'appCode':_0x795def,'personal':_0x1d4ae9===_0x2c6c19(0x20f)||_0x1d4ae9===_0x2c6c19(0x1fd)?[]:_0x4a1c0e,'company':_0x1d4ae9===_0x2c6c19(0x237)||_0x1d4ae9===_0x2c6c19(0x1fd)?[]:_0x54de31,'public':_0x1d4ae9===_0x2c6c19(0x237)||_0x1d4ae9==='company'?[]:_0x9bd9cb,'effective':buildEffectiveRuntimeSkills(_0x4a1c0e,_0x54de31,_0x9bd9cb,_0x1d4ae9)};}function skillHubRuntimeItemToRuntimeSkill(_0xba6fba){const _0x4ca0d3=a56_0x455e,_0x5508a1=_0xba6fba[_0x4ca0d3(0x230)]?.[_0x4ca0d3(0x202)](),_0x1b6c9e=skillHubVisibilityToScope(_0xba6fba[_0x4ca0d3(0x214)]);if(!_0x5508a1||!_0x1b6c9e)return undefined;return{'id':_0xba6fba['id'],'appCode':_0xba6fba[_0x4ca0d3(0x201)],'skillCode':_0x5508a1,'skillName':_0xba6fba[_0x4ca0d3(0x207)]??_0x5508a1,'description':_0xba6fba[_0x4ca0d3(0x200)],'scope':_0x1b6c9e,'version':skillHubRuntimeItemVersion(_0xba6fba),'status':_0xba6fba['status']};}function skillHubVisibilityToScope(_0x2d1201){const _0x294571=a56_0x455e;if(_0x2d1201===_0x294571(0x1f0))return _0x294571(0x237);if(_0x2d1201==='NAMESPACE_ONLY')return _0x294571(0x20f);if(_0x2d1201==='PUBLIC')return _0x294571(0x1fd);return undefined;}function skillHubRuntimeItemVersion(_0x42b94c){const _0x5bd0b5=a56_0x455e;return _0x42b94c['publishedVersion']?.[_0x5bd0b5(0x1dc)]??_0x42b94c[_0x5bd0b5(0x24e)]?.[_0x5bd0b5(0x1dc)]??_0x42b94c[_0x5bd0b5(0x247)]?.[_0x5bd0b5(0x1dc)];}function buildEffectiveRuntimeSkills(_0x24c0dc,_0x13c83b,_0x14f175,_0x32f62b){const _0x3408c5=a56_0x455e;if(_0x32f62b===_0x3408c5(0x237))return _0x24c0dc;if(_0x32f62b===_0x3408c5(0x20f))return _0x13c83b;if(_0x32f62b===_0x3408c5(0x1fd))return _0x14f175;const _0x35f4b9=new Map();for(const _0x537e39 of _0x14f175){_0x35f4b9[_0x3408c5(0x1fc)](_0x537e39[_0x3408c5(0x229)],_0x537e39);}for(const _0x529775 of _0x13c83b){_0x35f4b9[_0x3408c5(0x1fc)](_0x529775[_0x3408c5(0x229)],_0x529775);}for(const _0x191438 of _0x24c0dc){_0x35f4b9[_0x3408c5(0x1fc)](_0x191438[_0x3408c5(0x229)],_0x191438);}return Array[_0x3408c5(0x225)](_0x35f4b9['values']());}function normalizeRuntimeSkillListResponse(_0x33353d,_0x11d968){const _0x465ae1=a56_0x455e;if(Array[_0x465ae1(0x23f)](_0x11d968)){const _0x51cb21=_0x11d968[_0x465ae1(0x227)](_0x34dfde=>_0x34dfde['scope']==='personal'),_0x4ef33b=_0x11d968[_0x465ae1(0x227)](_0x5da4b4=>_0x5da4b4[_0x465ae1(0x248)]===_0x465ae1(0x20f)),_0x1a3bce=_0x11d968[_0x465ae1(0x227)](_0x1e4eb5=>_0x1e4eb5[_0x465ae1(0x248)]===_0x465ae1(0x1fd));return{'appCode':_0x33353d,'personal':_0x51cb21,'company':_0x4ef33b,'public':_0x1a3bce,'effective':_0x11d968[_0x465ae1(0x227)](_0x8c6bbc=>_0x8c6bbc[_0x465ae1(0x248)]!==_0x465ae1(0x1db))};}return{'appCode':_0x11d968?.['appCode']??_0x33353d,'personal':Array[_0x465ae1(0x23f)](_0x11d968?.[_0x465ae1(0x237)])?_0x11d968[_0x465ae1(0x237)]:[],'company':Array[_0x465ae1(0x23f)](_0x11d968?.[_0x465ae1(0x20f)])?_0x11d968['company']:[],'public':Array['isArray'](_0x11d968?.[_0x465ae1(0x1fd)])?_0x11d968[_0x465ae1(0x1fd)]:[],'effective':Array[_0x465ae1(0x23f)](_0x11d968?.['effective'])?_0x11d968[_0x465ae1(0x1dd)]:[]};}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x12be22,_0x41b11c){const _0x2189eb=a57_0x1c05,_0x5ddeb0=_0x12be22();while(!![]){try{const _0x252c92=-parseInt(_0x2189eb(0x1c1))/0x1+-parseInt(_0x2189eb(0x1cd))/0x2+-parseInt(_0x2189eb(0x1c2))/0x3+-parseInt(_0x2189eb(0x1c3))/0x4+parseInt(_0x2189eb(0x1cb))/0x5*(parseInt(_0x2189eb(0x1c8))/0x6)+parseInt(_0x2189eb(0x1ca))/0x7+-parseInt(_0x2189eb(0x1c6))/0x8*(-parseInt(_0x2189eb(0x1cc))/0x9);if(_0x252c92===_0x41b11c)break;else _0x5ddeb0['push'](_0x5ddeb0['shift']());}catch(_0xcc42f9){_0x5ddeb0['push'](_0x5ddeb0['shift']());}}}(a57_0x2c88,0xbd2d3));import{listDatasets}from'../core/api-client.js';const cache=new Map();function a57_0x1c05(_0x31be79,_0x48f362){_0x31be79=_0x31be79-0x1c1;const _0x2c889a=a57_0x2c88();let _0x1c0557=_0x2c889a[_0x31be79];return _0x1c0557;}function a57_0x2c88(){const _0x2a8d23=['dbName','697698ZIcgZM','3162051AfKuNC','4909468IIbEVL','find','get','10096QGrTpc','dbtableConfig','99258HVqbyr','dbId','882742TOMZKf','145gJmYLE','30618qROEKD','2290456ZqjdUR','has','map','set','db-'];a57_0x2c88=function(){return _0x2a8d23;};return a57_0x2c88();}export async function listDatabases(_0x4d23e0){const _0x40ba28=a57_0x1c05;if(cache[_0x40ba28(0x1ce)](_0x4d23e0))return cache[_0x40ba28(0x1c5)](_0x4d23e0);const _0x567a8e=await listDatasets(_0x4d23e0),_0xa3ebd1=new Map();for(const _0x59f5ef of _0x567a8e){const _0x4b9a12=_0x59f5ef[_0x40ba28(0x1c7)];_0x4b9a12?.[_0x40ba28(0x1c9)]!=null&&_0xa3ebd1[_0x40ba28(0x1d0)](_0x4b9a12[_0x40ba28(0x1c9)],_0x4b9a12['dbName']??_0x40ba28(0x1d1)+_0x4b9a12[_0x40ba28(0x1c9)]);}const _0x1cc844=[..._0xa3ebd1['entries']()][_0x40ba28(0x1cf)](([_0x54d418,_0x3ba7a7])=>({'dbId':_0x54d418,'dbName':_0x3ba7a7}));return cache[_0x40ba28(0x1d0)](_0x4d23e0,_0x1cc844),_0x1cc844;}export async function getDbName(_0x473ed3,_0x1aac08){const _0x545e7d=a57_0x1c05;try{const _0x35e810=await listDatabases(_0x473ed3);return _0x35e810[_0x545e7d(0x1c4)](_0x220fb0=>_0x220fb0['dbId']===_0x1aac08)?.[_0x545e7d(0x1d2)];}catch{return undefined;}}
|
package/lib/core/sdk-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ee6ad,_0x1419a2){const _0x11283=a58_0x43b6,_0x400544=_0x1ee6ad();while(!![]){try{const _0x525a70=parseInt(_0x11283(0xb4))/0x1*(-parseInt(_0x11283(0xd4))/0x2)+-parseInt(_0x11283(0xc1))/0x3*(-parseInt(_0x11283(0xd2))/0x4)+-parseInt(_0x11283(0xc7))/0x5*(parseInt(_0x11283(0xbd))/0x6)+-parseInt(_0x11283(0xc9))/0x7+parseInt(_0x11283(0xb1))/0x8+-parseInt(_0x11283(0xb9))/0x9+parseInt(_0x11283(0xbc))/0xa;if(_0x525a70===_0x1419a2)break;else _0x400544['push'](_0x400544['shift']());}catch(_0x59be17){_0x400544['push'](_0x400544['shift']());}}}(a58_0x5c2e,0x6fef2));import{createClient}from'@lovrabet/sdk';import{PRODUCT_CONFIG}from'../constant/product.js';import{CliErrors}from'../errors.js';import{parseBatchCreateItemsFromParams}from'../utils/params.js';function a58_0x5c2e(){const _0x2cfc27=['execute','env','delete\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27',']\x20requires\x20\x22column\x22;\x20\x22field\x22\x20is\x20accepted\x20only\x20as\x20a\x20deprecated\x20alias.','bff','update\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123,\x22name\x22:\x22new\x22}\x27','28TaRuHl',']\x20must\x20be\x20an\x20object.','623190KnrYQh','isArray','2981896kfJgYt','dataset_','Available:\x20filter,\x20getOne,\x20create,\x20batchCreate,\x20update,\x20delete,\x20aggregate.','1eXfeJD','validation','batchCreate','SDK\x20client\x20not\x20initialized.\x20Call\x20initSdkClient()\x20first.','appCode','662994aEHvKj','delete','getOne','8921580lCnACk','264CdzjFk','update','object','getOne\x20requires\x20\x22id\x22\x20in\x20--params,\x20e.g.\x20\x27{\x22id\x22:123}\x27','41433iWLRYP','column','sql','\x22.\x20','aggregate','data\x20aggregate\x20--params.aggregate[','4175WyjOtn','invokeSource','3367623UWmHkM','field','accessKey'];a58_0x5c2e=function(){return _0x2cfc27;};return a58_0x5c2e();}let _client;export function initSdkClient(_0x49564e){const _0x14fdb1=a58_0x43b6;_client=createClient({'appCode':_0x49564e[_0x14fdb1(0xb8)],'env':_0x49564e[_0x14fdb1(0xcd)],'authMode':_0x49564e['authMode'],..._0x49564e[_0x14fdb1(0xcb)]?{'accessKey':_0x49564e[_0x14fdb1(0xcb)]}:{},'options':{'timeout':0x7530,'headers':{'X-Invoke-Source':PRODUCT_CONFIG[_0x14fdb1(0xc8)]}}});}function ensureClient(){const _0x2f9fec=a58_0x43b6;if(!_client)throw new Error(_0x2f9fec(0xb7));return _client;}function normalizeAggregateParams(_0x59677a){const _0x409364=a58_0x43b6,_0x48014f=_0x59677a[_0x409364(0xc5)];if(_0x48014f===undefined)return _0x59677a;if(!Array[_0x409364(0xd5)](_0x48014f))throw CliErrors[_0x409364(0xb5)]('data\x20aggregate\x20--params.aggregate\x20must\x20be\x20an\x20array.');return{..._0x59677a,'aggregate':_0x48014f['map']((_0x5679b5,_0x1e7bf7)=>{const _0x2b94f6=_0x409364;if(!_0x5679b5||typeof _0x5679b5!==_0x2b94f6(0xbf)||Array[_0x2b94f6(0xd5)](_0x5679b5))throw CliErrors['validation']('data\x20aggregate\x20--params.aggregate['+_0x1e7bf7+_0x2b94f6(0xd3));const _0x180144=_0x5679b5[_0x2b94f6(0xc2)]??_0x5679b5['field'];if(typeof _0x180144!=='string'||_0x180144['trim']()==='')throw CliErrors['validation'](_0x2b94f6(0xc6)+_0x1e7bf7+_0x2b94f6(0xcf));const _0x315232={..._0x5679b5,'column':_0x180144};return delete _0x315232[_0x2b94f6(0xca)],_0x315232;})};}export async function executeData(_0x4f84f7,_0x32bfe9,_0x39940b){const _0x256d81=a58_0x43b6,_0x508534=ensureClient(),_0x5b04c0=_0x256d81(0xb2)+_0x4f84f7,_0x126f03=_0x508534['models'][_0x5b04c0];if(!_0x126f03||typeof _0x126f03[_0x32bfe9]!=='function')throw new Error('SDK\x20model\x20does\x20not\x20support\x20operation\x20\x22'+_0x32bfe9+_0x256d81(0xc4)+_0x256d81(0xb3));if(_0x32bfe9===_0x256d81(0xb6))return _0x126f03[_0x256d81(0xb6)](parseBatchCreateItemsFromParams(_0x39940b));const _0xcd9ad1=_0x39940b!==undefined&&_0x39940b!==null&&!Array[_0x256d81(0xd5)](_0x39940b)?_0x39940b:{};switch(_0x32bfe9){case'getOne':{const _0x202fde=_0xcd9ad1['id'];if(_0x202fde===undefined||_0x202fde===null)throw new Error(_0x256d81(0xc0));return _0x126f03[_0x256d81(0xbb)](_0x202fde);}case _0x256d81(0xbe):{const {id:_0x57d036,..._0x10ed02}=_0xcd9ad1;if(_0x57d036===undefined||_0x57d036===null)throw new Error(_0x256d81(0xd1));return _0x126f03['update'](_0x57d036,_0x10ed02);}case _0x256d81(0xba):{const _0x3e9c76=_0xcd9ad1['id'];if(_0x3e9c76===undefined||_0x3e9c76===null)throw new Error(_0x256d81(0xce));return _0x126f03[_0x256d81(0xba)](_0x3e9c76);}case _0x256d81(0xc5):return _0x126f03[_0x256d81(0xc5)](normalizeAggregateParams(_0xcd9ad1));default:return _0x126f03[_0x32bfe9](_0xcd9ad1);}}function a58_0x43b6(_0x3668b5,_0x4be282){_0x3668b5=_0x3668b5-0xb1;const _0x5c2e6c=a58_0x5c2e();let _0x43b6c0=_0x5c2e6c[_0x3668b5];return _0x43b6c0;}export async function executeSdkSql(_0x1e8993,_0x3d12ce){const _0x23cd07=a58_0x43b6,_0x4f71fc=ensureClient();return _0x4f71fc[_0x23cd07(0xc3)][_0x23cd07(0xcc)]({'sqlCode':_0x1e8993,'params':_0x3d12ce});}export async function executeSdkBff(_0x1b76e0,_0x281fee){const _0x40dc85=a58_0x43b6,_0x40bd8d=ensureClient();return _0x40bd8d[_0x40dc85(0xd0)][_0x40dc85(0xcc)]({'scriptName':_0x1b76e0,'params':_0x281fee});}
|
package/lib/errors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x1195f0=a59_0x1a82;(function(_0x4571de,_0x19c295){const _0x33be63=a59_0x1a82,_0x5c2a63=_0x4571de();while(!![]){try{const _0x463bfa=parseInt(_0x33be63(0xc3))/0x1*(parseInt(_0x33be63(0xc1))/0x2)+-parseInt(_0x33be63(0xc9))/0x3+parseInt(_0x33be63(0xcd))/0x4*(-parseInt(_0x33be63(0xc5))/0x5)+-parseInt(_0x33be63(0xc7))/0x6+-parseInt(_0x33be63(0xc6))/0x7+parseInt(_0x33be63(0xc2))/0x8*(-parseInt(_0x33be63(0xcb))/0x9)+parseInt(_0x33be63(0xbe))/0xa*(parseInt(_0x33be63(0xc0))/0xb);if(_0x463bfa===_0x19c295)break;else _0x5c2a63['push'](_0x5c2a63['shift']());}catch(_0xfeba42){_0x5c2a63['push'](_0x5c2a63['shift']());}}}(a59_0x2e6f,0x5021c));function a59_0x2e6f(){const _0x5ef165=['308101AJURNY','\x20file.','55yGqrdE','2258522QKdHXC','2921766TnUhmZ','Run\x20this\x20command\x20inside\x20a\x20directory\x20with\x20a\x20','1707597IfPdud','Configure\x20accessKey\x20in\x20','153bVfRPA','Set\x20appcode\x20via\x20--appcode\x20or\x20','134308XpxkAa','\x20or\x20run\x20`','290vpNcPn','newConfigFileName','904519cNJKzG','2FbGnCy','290056nIJKvW'];a59_0x2e6f=function(){return _0x5ef165;};return a59_0x2e6f();}import{CliError,createCliErrors}from'@lovrabet/cli-framework';import{CLI_BIN_NAME}from'./constant/cli.js';import{PRODUCT_CONFIG}from'./constant/product.js';export{CliError};function a59_0x1a82(_0x58e4e5,_0x823c3e){_0x58e4e5=_0x58e4e5-0xbd;const _0x2e6ffa=a59_0x2e6f();let _0x1a8215=_0x2e6ffa[_0x58e4e5];return _0x1a8215;}export const CliErrors=createCliErrors({'cliBinName':CLI_BIN_NAME,'authRequiredHint':a59_0x1195f0(0xca)+PRODUCT_CONFIG[a59_0x1195f0(0xbf)]+a59_0x1195f0(0xbd)+CLI_BIN_NAME+'\x20auth\x20login`.','configMissingHint':a59_0x1195f0(0xcc)+PRODUCT_CONFIG[a59_0x1195f0(0xbf)]+'.','notInProjectHint':a59_0x1195f0(0xc8)+PRODUCT_CONFIG['newConfigFileName']+a59_0x1195f0(0xc4)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fca36,_0x3421b2){var _0x465cd7=a60_0x5c0e,_0x1cc85f=_0x2fca36();while(!![]){try{var _0x5a27ed=parseInt(_0x465cd7(0x1b8))/0x1*(parseInt(_0x465cd7(0x1ba))/0x2)+-parseInt(_0x465cd7(0x1b6))/0x3+-parseInt(_0x465cd7(0x1b5))/0x4*(-parseInt(_0x465cd7(0x1b7))/0x5)+parseInt(_0x465cd7(0x1be))/0x6*(-parseInt(_0x465cd7(0x1bc))/0x7)+-parseInt(_0x465cd7(0x1b4))/0x8+parseInt(_0x465cd7(0x1bd))/0x9+parseInt(_0x465cd7(0x1b9))/0xa*(-parseInt(_0x465cd7(0x1bb))/0xb);if(_0x5a27ed===_0x3421b2)break;else _0x1cc85f['push'](_0x1cc85f['shift']());}catch(_0x4fe447){_0x1cc85f['push'](_0x1cc85f['shift']());}}}(a60_0x41ca,0x4402e));import{DEFAULT_COMMAND_OUTPUT_FORMAT}from'../constant/defaults.js';import{buildAllFlags as a60_0x578274}from'@lovrabet/cli-framework';function a60_0x5c0e(_0x19b095,_0x4a5619){_0x19b095=_0x19b095-0x1b4;var _0x41ca0f=a60_0x41ca();var _0x5c0e7f=_0x41ca0f[_0x19b095];return _0x5c0e7f;}function a60_0x41ca(){var _0x52a128=['1MRqCpd','10lemAgP','1049798wFDLEp','8990509NweetR','616LUBSUV','3514527fcUFqs','13782EIVhqI','566264wMgZut','92qmyoSm','33846BavUEA','101020mqhazP'];a60_0x41ca=function(){return _0x52a128;};return a60_0x41ca();}export function buildAllFlags(_0x37b6af){return a60_0x578274(_0x37b6af,{'defaultOutputFormat':DEFAULT_COMMAND_OUTPUT_FORMAT});}
|
package/lib/framework/dryrun.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a61_0x44b1(_0x493891,_0x36b5c3){_0x493891=_0x493891-0x171;const _0x1a9291=a61_0x1a92();let _0x44b1e4=_0x1a9291[_0x493891];return _0x44b1e4;}(function(_0x5f4d6a,_0x5de39a){const _0x224808=a61_0x44b1,_0x5000bf=_0x5f4d6a();while(!![]){try{const _0x1a9e29=-parseInt(_0x224808(0x179))/0x1*(-parseInt(_0x224808(0x178))/0x2)+-parseInt(_0x224808(0x177))/0x3+parseInt(_0x224808(0x175))/0x4+-parseInt(_0x224808(0x171))/0x5+-parseInt(_0x224808(0x17a))/0x6+-parseInt(_0x224808(0x174))/0x7*(parseInt(_0x224808(0x173))/0x8)+parseInt(_0x224808(0x176))/0x9;if(_0x1a9e29===_0x5de39a)break;else _0x5000bf['push'](_0x5000bf['shift']());}catch(_0x59d6c7){_0x5000bf['push'](_0x5000bf['shift']());}}}(a61_0x1a92,0x9fbe9));export function dryRun(_0x25500f,_0x4f0865){const _0x6f2adf={'method':_0x25500f,'url':_0x4f0865},_0x29abbb={'body'(_0xce848c){return _0x6f2adf['body']=_0xce848c,_0x29abbb;},'description'(_0x470aa9){const _0x169405=a61_0x44b1;return _0x6f2adf[_0x169405(0x172)]=_0x470aa9,_0x29abbb;},'build'(){return{..._0x6f2adf};}};return _0x29abbb;}function a61_0x1a92(){const _0xc45f61=['9uIpLUc','6838530WWhAkF','4452870ylXbgk','description','1646984nkYOsl','14GrVgSL','500532TDoSVV','26529597vUwEiV','2122347dTOAXi','162438MyoNDw'];a61_0x1a92=function(){return _0xc45f61;};return a61_0x1a92();}
|
package/lib/framework/flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a62_0x5c1f6c=a62_0x3917;function a62_0x3802(){const _0x1d389b=['2574030GmFrBx','230BCIFQs','28wibqZb','parseFlags','5924wNgsWN','69489BnbGVo','2361369RJZhVk','755JsYIqw','4684928oVgJJf','83277lKvVoZ','46933XiJlyv'];a62_0x3802=function(){return _0x1d389b;};return a62_0x3802();}(function(_0xe011d7,_0x3a163e){const _0x20a734=a62_0x3917,_0x368254=_0xe011d7();while(!![]){try{const _0x20022d=parseInt(_0x20a734(0xb2))/0x1*(parseInt(_0x20a734(0xaa))/0x2)+parseInt(_0x20a734(0xae))/0x3+parseInt(_0x20a734(0xac))/0x4*(parseInt(_0x20a734(0xaf))/0x5)+-parseInt(_0x20a734(0xa8))/0x6+parseInt(_0x20a734(0xad))/0x7+-parseInt(_0x20a734(0xb0))/0x8+-parseInt(_0x20a734(0xb1))/0x9*(parseInt(_0x20a734(0xa9))/0xa);if(_0x20022d===_0x3a163e)break;else _0x368254['push'](_0x368254['shift']());}catch(_0x4ee3cb){_0x368254['push'](_0x368254['shift']());}}}(a62_0x3802,0x6deff));import{createFlagHelpers}from'@lovrabet/cli-framework';function a62_0x3917(_0x1b8b24,_0x4df325){_0x1b8b24=_0x1b8b24-0xa8;const _0x380293=a62_0x3802();let _0x3917e7=_0x380293[_0x1b8b24];return _0x3917e7;}import{CliErrors}from'../errors.js';const helpers=createFlagHelpers(CliErrors);export const parseFlags=helpers[a62_0x5c1f6c(0xab)];export const validateFlags=helpers['validateFlags'];
|
package/lib/framework/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x27f80c,_0x1cc0bf){const _0x568988=a63_0x10b7,_0x5965fb=_0x27f80c();while(!![]){try{const _0x33b467=parseInt(_0x568988(0xaf))/0x1*(parseInt(_0x568988(0xa2))/0x2)+parseInt(_0x568988(0xac))/0x3+-parseInt(_0x568988(0xa3))/0x4+-parseInt(_0x568988(0xa6))/0x5*(-parseInt(_0x568988(0xa9))/0x6)+parseInt(_0x568988(0xae))/0x7*(-parseInt(_0x568988(0xab))/0x8)+parseInt(_0x568988(0xa7))/0x9+parseInt(_0x568988(0xa8))/0xa;if(_0x33b467===_0x1cc0bf)break;else _0x5965fb['push'](_0x5965fb['shift']());}catch(_0x206025){_0x5965fb['push'](_0x5965fb['shift']());}}}(a63_0x4e59,0xee71b));import{createHelpGenerators}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{serviceRegistry,serviceGroups,getServiceEntry}from'../commands/registry.js';function a63_0x10b7(_0xcd3244,_0x563509){_0xcd3244=_0xcd3244-0xa0;const _0x4e5957=a63_0x4e59();let _0x10b74d=_0x4e5957[_0xcd3244];return _0x10b74d;}import{getDynamicServiceDefinitions,getDynamicServiceEntry,listDynamicServiceEntries}from'../commands/service/dynamic.js';function a63_0x4e59(){const _0x217157=['903744iIhwtM','2870424cUXjlq','get','119PvnzjY','48YZMpbc','Requires\x20appcode\x20(set\x20via\x20','map','10676bzjFqY','7645984UrUPtA','has','service','159035idIDoj','5768820naZEKx','14596780fUuMVg','282zzAJfq','\x20or\x20--appcode).'];a63_0x4e59=function(){return _0x217157;};return a63_0x4e59();}import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';function createGenerators(){const _0x1c0169=a63_0x10b7;return createHelpGenerators({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'globalFlags':GLOBAL_FLAGS,'serviceRegistry':[...serviceRegistry,...safeListDynamicServiceEntries()],'getServiceEntry':getAnyServiceEntry,'getServiceDefinitions':getAnyServiceDefinitions,'buildAllFlags':buildAllFlags,'appPrerequisiteText':_0x1c0169(0xa0)+PRODUCT_CONFIG['newConfigFileName']+_0x1c0169(0xaa)});}export function generateCommandHelp(_0x3123fb){return createGenerators()['generateCommandHelp'](_0x3123fb);}export function generateServiceHelp(_0x18516b){return createGenerators()['generateServiceHelp'](_0x18516b);}export function generateFullHelp(){return createGenerators()['generateFullHelp']();}function getAnyServiceEntry(_0x1c7711){const _0x1b5d8c=getServiceEntry(_0x1c7711);if(_0x1b5d8c)return _0x1b5d8c;try{return getDynamicServiceEntry(_0x1c7711);}catch{return undefined;}}function getAnyServiceDefinitions(_0x4cdfbb){const _0x192cd1=a63_0x10b7,_0x5e84a1=serviceGroups[_0x192cd1(0xad)](_0x4cdfbb);if(_0x5e84a1)return _0x5e84a1;try{return getDynamicServiceDefinitions(_0x4cdfbb);}catch{return undefined;}}function safeListDynamicServiceEntries(){const _0x4ac1bb=a63_0x10b7,_0x447b1c=new Set(serviceRegistry[_0x4ac1bb(0xa1)](_0x4066f4=>_0x4066f4[_0x4ac1bb(0xa5)]));try{return listDynamicServiceEntries()['filter'](_0x381940=>!_0x447b1c[_0x4ac1bb(0xa4)](_0x381940[_0x4ac1bb(0xa5)]));}catch{return[];}}
|
package/lib/framework/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x402e98,_0x1d3bd0){var _0x444cd8=a64_0x4f25,_0x3f7ddd=_0x402e98();while(!![]){try{var _0x59c2b2=-parseInt(_0x444cd8(0x155))/0x1*(parseInt(_0x444cd8(0x153))/0x2)+parseInt(_0x444cd8(0x157))/0x3+-parseInt(_0x444cd8(0x152))/0x4+-parseInt(_0x444cd8(0x14f))/0x5*(-parseInt(_0x444cd8(0x151))/0x6)+-parseInt(_0x444cd8(0x150))/0x7+-parseInt(_0x444cd8(0x14e))/0x8+-parseInt(_0x444cd8(0x156))/0x9*(-parseInt(_0x444cd8(0x154))/0xa);if(_0x59c2b2===_0x1d3bd0)break;else _0x3f7ddd['push'](_0x3f7ddd['shift']());}catch(_0x20f58e){_0x3f7ddd['push'](_0x3f7ddd['shift']());}}}(a64_0x2995,0x68963));export{runCommand}from'../framework/runner.js';export{parseFlags,validateFlags}from'../framework/flags.js';function a64_0x4f25(_0x48ca80,_0x2a46d5){_0x48ca80=_0x48ca80-0x14e;var _0x299535=a64_0x2995();var _0x4f250a=_0x299535[_0x48ca80];return _0x4f250a;}export{formatOutput}from'../framework/output.js';export{generateCommandHelp,generateServiceHelp,generateFullHelp}from'../framework/help.js';export{extractList,extractPaging}from'../framework/response.js';export{dryRun}from'../framework/dryrun.js';export{riskLevelOrder,isValidFormat}from'../framework/types.js';function a64_0x2995(){var _0x45af4c=['8DFrkUo','9lKeNJY','1243083qoYDbZ','4527408qTnUXL','375YziHuU','563122GFOmOs','52974UfbvPc','602224GbzqwL','211340fOMJhG','9941390PtJzPE'];a64_0x2995=function(){return _0x45af4c;};return a64_0x2995();}
|
package/lib/framework/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf53852,_0x8e2c36){const _0x2e3cee=a65_0x3e80,_0x2fa4f6=_0xf53852();while(!![]){try{const _0x425efb=-parseInt(_0x2e3cee(0x94))/0x1*(-parseInt(_0x2e3cee(0xa4))/0x2)+-parseInt(_0x2e3cee(0x98))/0x3+parseInt(_0x2e3cee(0x9c))/0x4*(parseInt(_0x2e3cee(0xa3))/0x5)+-parseInt(_0x2e3cee(0x9f))/0x6*(-parseInt(_0x2e3cee(0xa2))/0x7)+parseInt(_0x2e3cee(0xa0))/0x8+parseInt(_0x2e3cee(0x9b))/0x9*(parseInt(_0x2e3cee(0x96))/0xa)+parseInt(_0x2e3cee(0xa6))/0xb*(-parseInt(_0x2e3cee(0x9d))/0xc);if(_0x425efb===_0x8e2c36)break;else _0x2fa4f6['push'](_0x2fa4f6['shift']());}catch(_0x26aade){_0x2fa4f6['push'](_0x2fa4f6['shift']());}}}(a65_0x2ab2,0x58bae));import{createFormatOutput,resolveBundledJqPaths}from'@lovrabet/cli-framework';function a65_0x3e80(_0x3a8277,_0x393026){_0x3a8277=_0x3a8277-0x94;const _0x2ab2af=a65_0x2ab2();let _0x3e8042=_0x2ab2af[_0x3a8277];return _0x3e8042;}import{CliErrors}from'../errors.js';const baseFormatOutput=createFormatOutput({'cliErrors':CliErrors,'jqBinaryResolverOptions':{'bundledJqPaths':resolveBundledJqPaths()}});function a65_0x2ab2(){const _0x3e404e=['message','30gSkUre','error','1155708TgwdSF','_notice','format','1600803vGQmeQ','572jmXckC','12jEMoQK','pretty','462048gYSOwC','5566696pHtmUA','update','7lfIAlY','3500rWbgXN','12598FVraEH','url','12641134EAEqMp','78rtZRvP'];a65_0x2ab2=function(){return _0x3e404e;};return a65_0x2ab2();}export function formatOutput(_0x30cf4c,_0x1d4deb){const _0x19b956=a65_0x3e80,_0x194731=_0x30cf4c[_0x19b956(0x99)],{_notice:_0x31bc5e,..._0x5c47a4}=_0x30cf4c;void _0x31bc5e,baseFormatOutput(_0x5c47a4,_0x1d4deb),_0x1d4deb[_0x19b956(0x9a)]===_0x19b956(0x9e)&&printPrettyNotice(_0x194731);}function printPrettyNotice(_0x35f3dd){const _0x66491=a65_0x3e80;if(!_0x35f3dd?.[_0x66491(0xa1)])return;console[_0x66491(0x97)](_0x35f3dd[_0x66491(0xa1)][_0x66491(0x95)]+'\x20('+_0x35f3dd[_0x66491(0xa1)][_0x66491(0xa5)]+')');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a66_0x55a2(){const _0x52f16a=['292114YtrTxa','length','string','toLowerCase','972095yuePyg','nonInteractive','appcode','push','version','corrected','84YYHylH','dry-run','904rECfbx','sticky','slice','2177zkSFaP','has','non-interactive','number','indexOf','1649820fGjmgo','19017kOqJlf','entries','type','12392nToTWr','952589oRHBOD','name','set','add','get','20AtQMRh','global','13qsaBOw','replace','1oKkdPT','5004buaiRG','help','original','format','env','keys'];a66_0x55a2=function(){return _0x52f16a;};return a66_0x55a2();}(function(_0x30d111,_0x454bbd){const _0x58ccba=a66_0x44a2,_0x501ebb=_0x30d111();while(!![]){try{const _0x2e16f4=parseInt(_0x58ccba(0x190))/0x1*(-parseInt(_0x58ccba(0x197))/0x2)+parseInt(_0x58ccba(0x1a1))/0x3*(-parseInt(_0x58ccba(0x186))/0x4)+parseInt(_0x58ccba(0x19b))/0x5+-parseInt(_0x58ccba(0x191))/0x6*(-parseInt(_0x58ccba(0x1a6))/0x7)+parseInt(_0x58ccba(0x1a3))/0x8*(parseInt(_0x58ccba(0x183))/0x9)+-parseInt(_0x58ccba(0x18c))/0xa*(parseInt(_0x58ccba(0x187))/0xb)+-parseInt(_0x58ccba(0x182))/0xc*(parseInt(_0x58ccba(0x18e))/0xd);if(_0x2e16f4===_0x454bbd)break;else _0x501ebb['push'](_0x501ebb['shift']());}catch(_0x53bdc2){_0x501ebb['push'](_0x501ebb['shift']());}}}(a66_0x55a2,0x24656));function toKebab(_0x181f31){const _0x45a8a5=a66_0x44a2;return _0x181f31[_0x45a8a5(0x18f)](/_/g,'-')['replace'](/-([A-Z]+)/g,(_0x584e2e,_0x2212a7)=>'-'+_0x2212a7['toLowerCase']())[_0x45a8a5(0x18f)](/([a-z0-9])([A-Z])/g,(_0x2af3e7,_0x42450c,_0x5cd9cd)=>_0x42450c+'-'+_0x5cd9cd)[_0x45a8a5(0x19a)]();}function a66_0x44a2(_0x6f3fdd,_0x36aeaa){_0x6f3fdd=_0x6f3fdd-0x182;const _0x55a239=a66_0x55a2();let _0x44a253=_0x55a239[_0x6f3fdd];return _0x44a253;}function buildKnownFlags(_0x18739f){const _0x2084a6=a66_0x44a2,_0x1c9325=new Set();for(const _0x4d0bb8 of _0x18739f){_0x1c9325['add'](_0x4d0bb8[_0x2084a6(0x188)]),_0x1c9325[_0x2084a6(0x18a)](toCamelCase(_0x4d0bb8[_0x2084a6(0x188)]));}for(const _0x2c6c6e of[_0x2084a6(0x1a2),'dryRun','yes',_0x2084a6(0x194)]){_0x1c9325[_0x2084a6(0x18a)](_0x2c6c6e);}for(const _0x17ffcc of[_0x2084a6(0x192),_0x2084a6(0x195),_0x2084a6(0x19d),'app',_0x2084a6(0x19c),_0x2084a6(0x1a8),'ci',_0x2084a6(0x18d),_0x2084a6(0x19f)]){_0x1c9325[_0x2084a6(0x18a)](_0x17ffcc);}return _0x1c9325;}function buildFlagTypeMap(_0x419aa1){const _0xd631b3=a66_0x44a2,_0x1b76c5=new Map();for(const _0x5d4c53 of _0x419aa1){_0x1b76c5[_0xd631b3(0x189)](_0x5d4c53['name'],_0x5d4c53[_0xd631b3(0x185)]),_0x1b76c5[_0xd631b3(0x189)](toCamelCase(_0x5d4c53[_0xd631b3(0x188)]),_0x5d4c53['type']);}return _0x1b76c5;}function toCamelCase(_0x3f5f04){return _0x3f5f04['replace'](/-([a-z])/g,(_0x2df7fc,_0x11b4e8)=>_0x11b4e8['toUpperCase']());}function aliasHandler(_0x413fe1,_0x3e11a2){const _0x55d63a=a66_0x44a2,_0x81bed5=[];for(const _0x4534a8 of Object[_0x55d63a(0x196)](_0x413fe1)){if(_0x3e11a2['has'](_0x4534a8))continue;const _0x2d3553=toKebab(_0x4534a8);_0x2d3553!==_0x4534a8&&_0x3e11a2[_0x55d63a(0x1a7)](_0x2d3553)&&_0x81bed5[_0x55d63a(0x19e)]({'original':_0x4534a8,'corrected':_0x2d3553,'handler':'alias'});}return _0x81bed5;}function stickyHandler(_0x443f00,_0x45953f,_0x2b6ed6){const _0x3aa2ac=a66_0x44a2,_0x2df961=[];for(const [_0x25004a,_0x52dadf]of Object[_0x3aa2ac(0x184)](_0x443f00)){if(_0x52dadf!==!![])continue;for(let _0x322aa7=_0x25004a[_0x3aa2ac(0x198)]-0x1;_0x322aa7>0x0;_0x322aa7--){const _0x41812d=_0x25004a[_0x3aa2ac(0x1a5)](0x0,_0x322aa7),_0x5501f4=_0x25004a[_0x3aa2ac(0x1a5)](_0x322aa7),_0x8c13ef=toKebab(_0x41812d),_0x496a13=toCamelCase(_0x41812d),_0x2018df=_0x45953f[_0x3aa2ac(0x1a7)](_0x41812d)?_0x41812d:_0x45953f['has'](_0x8c13ef)?_0x8c13ef:_0x45953f[_0x3aa2ac(0x1a7)](_0x496a13)?_0x496a13:null;if(!_0x2018df)continue;const _0x23a462=_0x2b6ed6['get'](_0x2018df)??'string';let _0x3d4a5c;if(_0x23a462===_0x3aa2ac(0x1a9)){const _0xff6a07=Number(_0x5501f4);if(isNaN(_0xff6a07)||_0x5501f4==='')continue;_0x3d4a5c=_0xff6a07;}else{if(_0x23a462==='boolean')continue;else{if(_0x5501f4==='')continue;_0x3d4a5c=_0x5501f4;}}_0x2df961[_0x3aa2ac(0x19e)]({'original':_0x25004a,'corrected':_0x2018df+'='+_0x3d4a5c,'handler':_0x3aa2ac(0x1a4)});break;}}return _0x2df961;}export function correctFlags(_0xcf27a,_0x2c81ac){const _0x4cc9ac=a66_0x44a2,_0x1579ba=buildKnownFlags(_0x2c81ac),_0x4d48a6=buildFlagTypeMap(_0x2c81ac),_0x2112c5=aliasHandler(_0xcf27a,_0x1579ba),_0x3d2bae=stickyHandler(_0xcf27a,_0x1579ba,_0x4d48a6),_0x4a3ea1=[..._0x2112c5,..._0x3d2bae];if(_0x4a3ea1[_0x4cc9ac(0x198)]===0x0)return{'flags':_0xcf27a,'corrections':[]};const _0x4c56d1={..._0xcf27a},_0x4c1e45=new Set();for(const _0x590938 of _0x2112c5){_0x4c56d1[_0x590938[_0x4cc9ac(0x1a0)]]=_0xcf27a[_0x590938[_0x4cc9ac(0x193)]],_0x4c1e45[_0x4cc9ac(0x18a)](_0x590938[_0x4cc9ac(0x193)]);}for(const _0x599701 of _0x3d2bae){const _0x2a5144=_0x599701[_0x4cc9ac(0x1a0)][_0x4cc9ac(0x1aa)]('='),_0x3f9a3e=_0x599701[_0x4cc9ac(0x1a0)][_0x4cc9ac(0x1a5)](0x0,_0x2a5144),_0x337961=_0x599701[_0x4cc9ac(0x1a0)][_0x4cc9ac(0x1a5)](_0x2a5144+0x1),_0x1e0682=_0x4d48a6[_0x4cc9ac(0x18b)](_0x3f9a3e)??_0x4cc9ac(0x199);_0x1e0682===_0x4cc9ac(0x1a9)?_0x4c56d1[_0x3f9a3e]=Number(_0x337961):_0x4c56d1[_0x3f9a3e]=_0x337961,_0x4c1e45[_0x4cc9ac(0x18a)](_0x599701[_0x4cc9ac(0x193)]);}for(const _0x4738c5 of _0x4c1e45){delete _0x4c56d1[_0x4738c5];}return{'flags':_0x4c56d1,'corrections':_0x4a3ea1};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38b00c,_0x5225fa){var _0x5f1a58=a67_0x5969,_0x49ff47=_0x38b00c();while(!![]){try{var _0x25bb74=-parseInt(_0x5f1a58(0x12e))/0x1+parseInt(_0x5f1a58(0x12f))/0x2+parseInt(_0x5f1a58(0x12d))/0x3+-parseInt(_0x5f1a58(0x126))/0x4*(parseInt(_0x5f1a58(0x12c))/0x5)+parseInt(_0x5f1a58(0x127))/0x6*(parseInt(_0x5f1a58(0x128))/0x7)+-parseInt(_0x5f1a58(0x129))/0x8*(-parseInt(_0x5f1a58(0x12b))/0x9)+-parseInt(_0x5f1a58(0x12a))/0xa;if(_0x25bb74===_0x5225fa)break;else _0x49ff47['push'](_0x49ff47['shift']());}catch(_0x5182e1){_0x49ff47['push'](_0x49ff47['shift']());}}}(a67_0x4ae3,0x738c7));export{extractList,extractPaging}from'@lovrabet/cli-framework';function a67_0x5969(_0x217f04,_0x130509){_0x217f04=_0x217f04-0x126;var _0x4ae36a=a67_0x4ae3();var _0x596934=_0x4ae36a[_0x217f04];return _0x596934;}function a67_0x4ae3(){var _0x28c6a1=['697158LYdIEi','1522824lzEuwx','48qqaJVE','2166UorcJz','16933THbNiA','83544jTTSYt','13018850XDAeXN','684ZLeeQF','347195SHkjWM','2631777Kzjvlr'];a67_0x4ae3=function(){return _0x28c6a1;};return a67_0x4ae3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a68_0x4ce2(_0x1030c5,_0x9ffece){_0x1030c5=_0x1030c5-0x95;const _0x209ac3=a68_0x209a();let _0x4ce245=_0x209ac3[_0x1030c5];return _0x4ce245;}(function(_0x1af03e,_0x59ec21){const _0x512e5b=a68_0x4ce2,_0x32074a=_0x1af03e();while(!![]){try{const _0x37557c=parseInt(_0x512e5b(0xae))/0x1+-parseInt(_0x512e5b(0xa8))/0x2*(-parseInt(_0x512e5b(0x97))/0x3)+parseInt(_0x512e5b(0xa7))/0x4+-parseInt(_0x512e5b(0x96))/0x5*(parseInt(_0x512e5b(0x99))/0x6)+parseInt(_0x512e5b(0xaa))/0x7+parseInt(_0x512e5b(0xab))/0x8+parseInt(_0x512e5b(0xac))/0x9*(-parseInt(_0x512e5b(0x95))/0xa);if(_0x37557c===_0x59ec21)break;else _0x32074a['push'](_0x32074a['shift']());}catch(_0x1279e1){_0x32074a['push'](_0x32074a['shift']());}}}(a68_0x209a,0xabf71));import{CLI_BIN_NAME}from'../constant/cli.js';export function buildConfirmationLines(_0xf86d42,_0x538565,_0x1e0645){const _0x43f35a=a68_0x4ce2,_0x470e28=buildConfirmationContext(_0xf86d42,_0x538565,_0x1e0645),_0x3b7c02=[_0x43f35a(0xa4)+_0x470e28[_0x43f35a(0x9f)]];return _0x470e28['description']&&_0x3b7c02[_0x43f35a(0x9b)]('\x20\x20\x20'+_0x470e28[_0x43f35a(0x9d)]),_0x470e28[_0x43f35a(0x9a)]&&_0x3b7c02[_0x43f35a(0x9b)](_0x43f35a(0xa2)+_0x470e28[_0x43f35a(0x9a)]),_0x3b7c02[_0x43f35a(0x9b)](_0x43f35a(0xb0)),_0x3b7c02;}export function reconstructCommandArgv(_0x572993,_0x14d70c){const _0x57012e=a68_0x4ce2,_0x57a8db=[CLI_BIN_NAME,_0x572993[_0x57012e(0x9e)],_0x572993['command']];for(const [_0x340887,_0x1b2d94]of Object[_0x57012e(0x98)](_0x14d70c)){if(_0x1b2d94===!![])_0x57a8db['push']('--'+_0x340887);else _0x1b2d94!==![]&&_0x1b2d94!==undefined&&_0x1b2d94!==''&&_0x57a8db[_0x57012e(0x9b)]('--'+_0x340887+'\x20'+JSON['stringify'](_0x1b2d94));}return _0x57a8db[_0x57012e(0x9b)](_0x57012e(0xa1)),_0x57a8db['join']('\x20');}function a68_0x209a(){const _0xe34dfd=['join','--yes','\x20\x20\x20Affected:\x20','params=','⚠\x20\x20High-risk\x20operation:\x20','name','name=','3342492Cnygvu','114612omeGOu','length','9501905DqQKIi','10365960FSqoWv','37432053BMEUQM','code','458598uTGzfb','code=','\x20\x20\x20Continue?\x20[y/N]\x20','10MCDVov','185ULGBpw','54UejufX','entries','18714GBNuYc','affectedRecords','push','params','description','service','commandLabel'];a68_0x209a=function(){return _0xe34dfd;};return a68_0x209a();}function buildConfirmationContext(_0x22e95b,_0x214358,_0x493868){const _0x52a5b0=a68_0x4ce2,_0x28cce2=extractAffectedRecords(_0x493868);return{'commandLabel':_0x214358,'description':_0x22e95b[_0x52a5b0(0x9d)],'affectedRecords':_0x28cce2};}function extractAffectedRecords(_0x393d0e){const _0x319993=a68_0x4ce2,_0x488ce3=[];if(_0x393d0e['code'])_0x488ce3[_0x319993(0x9b)](_0x319993(0xaf)+_0x393d0e[_0x319993(0xad)]);if(_0x393d0e['id'])_0x488ce3[_0x319993(0x9b)]('id='+_0x393d0e['id']);if(_0x393d0e[_0x319993(0xa5)])_0x488ce3[_0x319993(0x9b)](_0x319993(0xa6)+_0x393d0e[_0x319993(0xa5)]);if(_0x393d0e[_0x319993(0x9c)])_0x488ce3[_0x319993(0x9b)](_0x319993(0xa3)+_0x393d0e[_0x319993(0x9c)]);return _0x488ce3[_0x319993(0xa9)]>0x0?_0x488ce3[_0x319993(0xa0)](',\x20'):undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xee3ea,_0x220853){const _0x2771fb=a69_0x3f42,_0x405083=_0xee3ea();while(!![]){try{const _0x2f33a8=parseInt(_0x2771fb(0x15d))/0x1*(parseInt(_0x2771fb(0x155))/0x2)+-parseInt(_0x2771fb(0x15b))/0x3+parseInt(_0x2771fb(0x158))/0x4*(-parseInt(_0x2771fb(0x153))/0x5)+-parseInt(_0x2771fb(0x15e))/0x6*(-parseInt(_0x2771fb(0x154))/0x7)+-parseInt(_0x2771fb(0x15a))/0x8*(-parseInt(_0x2771fb(0x152))/0x9)+-parseInt(_0x2771fb(0x161))/0xa+parseInt(_0x2771fb(0x157))/0xb;if(_0x2f33a8===_0x220853)break;else _0x405083['push'](_0x405083['shift']());}catch(_0x3dc53d){_0x405083['push'](_0x405083['shift']());}}}(a69_0x4fb1,0x38dfd));function a69_0x3f42(_0xd7ac37,_0x1069af){_0xd7ac37=_0xd7ac37-0x152;const _0x4fb196=a69_0x4fb1();let _0x3f42d4=_0x4fb196[_0xd7ac37];return _0x3f42d4;}import{LovrabetError}from'@lovrabet/sdk';import{CliErrors}from'../errors.js';function a69_0x4fb1(){const _0x7f64cc=['stringify','8vBZFZz','151917RBeDVd','validation','5shYnIA','90HjVCTw','string','message','251920SIosvb','2857509DhbbQM','133505XEuFRs','33551vvSSLd','43786uhSOfj','trim','2021151cRLpkC','56qUSXYa'];a69_0x4fb1=function(){return _0x7f64cc;};return a69_0x4fb1();}export function mapUserFacingExecuteError(_0x5714d0){const _0x91ad66=a69_0x3f42;if(_0x5714d0 instanceof LovrabetError)return CliErrors[_0x91ad66(0x15c)](userFacingLovrabetMessage(_0x5714d0));return _0x5714d0;}function userFacingLovrabetMessage(_0x5102d8){const _0x2bd2b0=a69_0x3f42,_0x46738f=_0x5102d8['description'];if(_0x46738f!==undefined&&_0x46738f!==null){if(typeof _0x46738f===_0x2bd2b0(0x15f)&&_0x46738f[_0x2bd2b0(0x156)]())return _0x46738f[_0x2bd2b0(0x156)]();try{return JSON[_0x2bd2b0(0x159)](_0x46738f);}catch{}}return _0x5102d8[_0x2bd2b0(0x160)];}
|
package/lib/framework/runner.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a69_0xac7885=a69_0x4e94;(function(_0x42f642,_0x4916ed){const _0x255642=a69_0x4e94,_0x2f1bfd=_0x42f642();while(!![]){try{const _0x30ca2e=parseInt(_0x255642(0x1dd))/0x1+parseInt(_0x255642(0x1e8))/0x2*(-parseInt(_0x255642(0x1ec))/0x3)+-parseInt(_0x255642(0x1d2))/0x4*(-parseInt(_0x255642(0x1e7))/0x5)+-parseInt(_0x255642(0x1d3))/0x6+-parseInt(_0x255642(0x1ce))/0x7+parseInt(_0x255642(0x1bb))/0x8*(parseInt(_0x255642(0x1c1))/0x9)+parseInt(_0x255642(0x1dc))/0xa;if(_0x30ca2e===_0x4916ed)break;else _0x2f1bfd['push'](_0x2f1bfd['shift']());}catch(_0x414bb6){_0x2f1bfd['push'](_0x2f1bfd['shift']());}}}(a69_0x3f54,0x6c523));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';export function resolveAuthMode(_0x5d2c81){return void _0x5d2c81,AUTH_MODE['ClientAk'];}export function createPipelineEnv(_0x1295aa,_0x277538){const _0x252e38=a69_0x4e94,_0x7e3947=typeof _0x277538[_0x252e38(0x1e4)]===_0x252e38(0x1b9)&&_0x277538[_0x252e38(0x1e4)]['trim']();return{'rawFlags':_0x277538,'appCode':_0x1295aa['appCode']||productEnv(_0x252e38(0x1e9))||(_0x7e3947?undefined:readAppCodeFromConfig()),'appCodeSource':_0x1295aa[_0x252e38(0x1e5)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x277538),'defaultFormat':_0x1295aa[_0x252e38(0x1ef)],'defaultPageSize':_0x1295aa[_0x252e38(0x1bc)],'defaultVerbose':_0x1295aa['verbose'],'riskLevel':_0x1295aa[_0x252e38(0x1d5)],'accessKey':_0x1295aa[_0x252e38(0x1ed)],'env':_0x1295aa[_0x252e38(0x1d9)],'mergedCli':{'defaultApp':_0x1295aa[_0x252e38(0x1d7)],'currentApp':_0x1295aa[_0x252e38(0x1bf)],'appCode':_0x1295aa[_0x252e38(0x1da)]}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS['filter'](_0x89ff3e=>PIPELINE_FLAG_NAMES[a69_0xac7885(0x1cb)](_0x89ff3e[a69_0xac7885(0x1ba)]))[a69_0xac7885(0x1c0)](({name:_0x3778f2,type:_0x3ff3b0,description:_0x28ee19})=>({'name':_0x3778f2,'type':_0x3ff3b0,'description':_0x28ee19})),'formatOutput':formatOutput,'getCommandLabel'(_0x35aa63){const _0x2abca5=a69_0xac7885;return CLI_BIN_NAME+'\x20'+_0x35aa63['service']+'\x20'+_0x35aa63[_0x2abca5(0x1e0)];},'riskPolicy':{'onViolation'(_0x6139c0){const _0x55c578=a69_0xac7885;console[_0x55c578(0x1e6)](_0x6139c0);},'createError'(_0x30def8){return CliErrors['cancelled'](_0x30def8);}},async 'prepare'(_0x23a728,_0x2ba9cb){const _0x16e505=a69_0xac7885,_0x2bd152=resolveAuthMode(_0x2ba9cb);if(_0x23a728[_0x16e505(0x1d8)]!==![]){if(!_0x2ba9cb['accessKey'])throw CliErrors[_0x16e505(0x1ee)](_0x16e505(0x1ca)+PRODUCT_CONFIG[_0x16e505(0x1d1)]+'\x20or\x20pass\x20'+productEnvName(_0x16e505(0x1e2))+'.');const {setActiveAK:_0x2beed0}=await import(_0x16e505(0x1c8));_0x2beed0(_0x2ba9cb[_0x16e505(0x1ed)]);}let _0x22eb1d='';if(_0x23a728[_0x16e505(0x1e1)]!==![]){_0x22eb1d=_0x2ba9cb['appCode']??'',_0x22eb1d=await resolveExplicitAppName(_0x23a728,_0x2ba9cb,_0x22eb1d);if(!_0x22eb1d){await assertSelectedAppNameIsRuntimeAccessible(_0x23a728,_0x2ba9cb);throw CliErrors['configMissing']('Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20'+PRODUCT_CONFIG[_0x16e505(0x1d1)]+'.');}await assertAppCodeIsRuntimeAccessible(_0x23a728,_0x2ba9cb,_0x22eb1d);}if(_0x22eb1d){const {initSdkClient:_0x303f80}=await import('../core/sdk-client.js');_0x303f80({'appCode':_0x22eb1d,'env':_0x2ba9cb[_0x16e505(0x1d9)]??_0x16e505(0x1db),'accessKey':_0x2ba9cb[_0x16e505(0x1ed)],'authMode':_0x2bd152});}return{'defaults':{'booleans':{'verbose':_0x2ba9cb[_0x16e505(0x1cc)]},'numbers':{'pagesize':_0x2ba9cb['defaultPageSize']}},'extras':{'appCode':_0x22eb1d,'cookie':'','apiDomain':_0x2ba9cb['apiDomain'],'apiDir':'','accessKey':_0x2ba9cb['accessKey'],'envName':_0x2ba9cb[_0x16e505(0x1d9)],'mergedCli':_0x2ba9cb[_0x16e505(0x1cf)]}};},async 'confirmHighRisk'({def:_0x411139,env:_0x22dc49,flags:_0x337bbe,commandLabel:_0x1f9a32}){const _0x1e28aa=a69_0xac7885;if(_0x22dc49[_0x1e28aa(0x1c3)]){const _0x21ee79=reconstructCommandArgv(_0x411139,_0x337bbe);throw CliErrors[_0x1e28aa(0x1e3)](_0x1e28aa(0x1c5)+_0x1f9a32+'`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a'+(_0x1e28aa(0x1d6)+_0x21ee79));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x411139,_0x1f9a32,_0x337bbe),'createCancelledError':_0x22b518=>CliErrors[_0x1e28aa(0x1c4)](_0x22b518)});},'mapDryRunError'(_0x423136){return mapUserFacingExecuteError(_0x423136);},'mapExecuteError'(_0x4e3927){return mapUserFacingExecuteError(_0x4e3927);},async 'finalize'(){const {clearActiveAK:_0x5d428}=await import('../core/api-client.js');_0x5d428();}};async function resolveExplicitAppName(_0x52265c,_0x1769a1,_0xab6053){const _0x4f757e=a69_0xac7885;if(_0x52265c[_0x4f757e(0x1e1)]===![])return _0xab6053;const _0x57b716=typeof _0x1769a1[_0x4f757e(0x1cd)][_0x4f757e(0x1e4)]===_0x4f757e(0x1b9)?_0x1769a1['rawFlags']['app'][_0x4f757e(0x1bd)]():'';if(!_0x57b716)return _0xab6053;const _0x5642b6=typeof _0x1769a1[_0x4f757e(0x1cd)][_0x4f757e(0x1d0)]==='string'&&_0x1769a1[_0x4f757e(0x1cd)][_0x4f757e(0x1d0)][_0x4f757e(0x1bd)]()||productEnv(_0x4f757e(0x1e9));if(_0x5642b6||_0x1769a1[_0x4f757e(0x1e5)]===_0x4f757e(0x1ea))return _0xab6053;const {getRemoteAppList:_0x29c207}=await import(_0x4f757e(0x1de)),_0x2b0c0a=await _0x29c207({'env':_0x1769a1[_0x4f757e(0x1d9)]??_0x4f757e(0x1db),'accessKey':_0x1769a1[_0x4f757e(0x1ed)]}),_0x566269=findAppByName(_0x2b0c0a[_0x4f757e(0x1df)],_0x57b716);if(_0x566269&&!isRuntimeAccessibleApp(_0x566269))throw runtimeInaccessibleAppError(_0x566269,'\x22'+_0x57b716+'\x22');const _0x21f28f=_0x566269?.[_0x4f757e(0x1da)]?.[_0x4f757e(0x1bd)]();if(_0x21f28f)return _0x21f28f;throw CliErrors['validation'](_0x4f757e(0x1be)+_0x57b716,_0x4f757e(0x1c2)+CLI_BIN_NAME+'\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.'+_0x57b716+_0x4f757e(0x1f0)+PRODUCT_CONFIG['newConfigFileName']+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x3a9f8b,_0xf85d12){const _0x17c21d=a69_0xac7885;if(_0x3a9f8b[_0x17c21d(0x1e1)]===![]||!_0xf85d12[_0x17c21d(0x1ed)])return;const _0x155ebd=(typeof _0xf85d12[_0x17c21d(0x1cd)][_0x17c21d(0x1e4)]===_0x17c21d(0x1b9)&&_0xf85d12[_0x17c21d(0x1cd)][_0x17c21d(0x1e4)][_0x17c21d(0x1bd)]()?_0xf85d12[_0x17c21d(0x1cd)][_0x17c21d(0x1e4)]:_0xf85d12[_0x17c21d(0x1cf)]?.[_0x17c21d(0x1bf)]??_0xf85d12[_0x17c21d(0x1cf)]?.[_0x17c21d(0x1d7)])?.[_0x17c21d(0x1bd)]();if(!_0x155ebd)return;const {getRemoteAppList:_0x47b3ef}=await import('../commands/app/remote-source.js'),_0x5da09b=await _0x47b3ef({'env':_0xf85d12[_0x17c21d(0x1d9)]??_0x17c21d(0x1db),'accessKey':_0xf85d12[_0x17c21d(0x1ed)]}),_0x153b58=findAppByName(_0x5da09b['items'],_0x155ebd);if(_0x153b58&&!isRuntimeAccessibleApp(_0x153b58))throw runtimeInaccessibleAppError(_0x153b58,'\x22'+_0x155ebd+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x125286,_0x4ba217,_0x4a0ef7){const _0xec489a=a69_0xac7885;if(_0x125286[_0xec489a(0x1e1)]===![]||!_0x4ba217[_0xec489a(0x1ed)])return;const {getRemoteAppList:_0x3b5ba4}=await import('../commands/app/remote-source.js'),_0x3b95f6=await _0x3b5ba4({'env':_0x4ba217['env']??_0xec489a(0x1db),'accessKey':_0x4ba217[_0xec489a(0x1ed)]}),_0x149900=findAppByCode(_0x3b95f6[_0xec489a(0x1df)],_0x4a0ef7);if(_0x149900&&!isRuntimeAccessibleApp(_0x149900))throw runtimeInaccessibleAppError(_0x149900,_0xec489a(0x1c9)+_0x4a0ef7+'\x22');}export async function runCommand(_0x47fe1a,_0x5bdc0d){await runCommandWithAdapter(shouldAttachUpdateNotice(_0x47fe1a)?withUpdateNotice(_0x47fe1a):_0x47fe1a,_0x5bdc0d,runnerAdapter);}function shouldAttachUpdateNotice(_0x444ae7){const _0x322493=a69_0xac7885;return!['update','schema',_0x322493(0x1b6)][_0x322493(0x1d4)](_0x444ae7['service']);}function a69_0x4e94(_0x19a3e7,_0x19ac04){_0x19a3e7=_0x19a3e7-0x1b6;const _0x3f5470=a69_0x3f54();let _0x4e942f=_0x3f5470[_0x19a3e7];return _0x4e942f;}function a69_0x3f54(){const _0x185731=['production','6968100hRMIfT','658766bBkvCP','../commands/app/remote-source.js','items','command','requiresAppCode','ACCESS_KEY','validation','app','appCodeSource','error','1405GKgYAX','1036WLdDpM','APPCODE','local-alias','catch','573dVOXet','accessKey','authRequired','format','.appcode\x20to\x20','doctor','object','execute','string','name','689224ooABTt','pageSize','trim','Unknown\x20app:\x20','currentApp','map','27iqNZhD','Run\x20`','isNonInteractive','cancelled','High-risk\x20operation\x20`','_notice','resolve','../core/api-client.js','appcode\x20\x22','Set\x20accessKey\x20in\x20','has','defaultVerbose','rawFlags','2945341caNjaV','mergedCli','appcode','newConfigFileName','836nOvcZX','4256280tvyxHq','includes','riskLevel','\x20\x20To\x20proceed:\x20','defaultApp','requiresAuth','env','appCode'];a69_0x3f54=function(){return _0x185731;};return a69_0x3f54();}function withUpdateNotice(_0x6afa41){return{..._0x6afa41,async 'execute'(_0x133e39){const _0x2b9016=a69_0x4e94,_0xe44e05=shouldResolveUpdateNotice(_0x133e39)?resolveLatestUpdateNotice()[_0x2b9016(0x1eb)](()=>null):Promise[_0x2b9016(0x1c7)](null),_0x4631aa=await _0x6afa41[_0x2b9016(0x1b8)](_0x133e39);return attachUpdateNotice(_0x4631aa,await _0xe44e05);}};}function shouldResolveUpdateNotice(_0x16d377){return _0x16d377['format']==='pretty'&&!_0x16d377['nonInteractive'];}function attachUpdateNotice(_0x386f6f,_0x16eaa5){const _0x610798=a69_0xac7885;if(!_0x16eaa5||!_0x386f6f||typeof _0x386f6f!==_0x610798(0x1b7))return _0x386f6f;const _0x22a964=_0x386f6f,_0x43dc6c=typeof _0x22a964[_0x610798(0x1c6)]===_0x610798(0x1b7)&&_0x22a964[_0x610798(0x1c6)]!==null?_0x22a964[_0x610798(0x1c6)]:{};return{..._0x22a964,'_notice':{..._0x43dc6c,'update':_0x16eaa5}};}
|
|
1
|
+
const a70_0x24891d=a70_0x2d71;(function(_0x579645,_0x117c96){const _0x3c0dec=a70_0x2d71,_0x47263e=_0x579645();while(!![]){try{const _0x1ad483=parseInt(_0x3c0dec(0x137))/0x1*(parseInt(_0x3c0dec(0x161))/0x2)+parseInt(_0x3c0dec(0x126))/0x3*(parseInt(_0x3c0dec(0x166))/0x4)+-parseInt(_0x3c0dec(0x12d))/0x5*(parseInt(_0x3c0dec(0x135))/0x6)+-parseInt(_0x3c0dec(0x130))/0x7*(-parseInt(_0x3c0dec(0x13f))/0x8)+-parseInt(_0x3c0dec(0x153))/0x9*(-parseInt(_0x3c0dec(0x15b))/0xa)+parseInt(_0x3c0dec(0x151))/0xb*(parseInt(_0x3c0dec(0x140))/0xc)+-parseInt(_0x3c0dec(0x162))/0xd;if(_0x1ad483===_0x117c96)break;else _0x47263e['push'](_0x47263e['shift']());}catch(_0x24b1f8){_0x47263e['push'](_0x47263e['shift']());}}}(a70_0x44d3,0x6ff51));import{runCommandWithAdapter,requireConfirmationPrompt}from'@lovrabet/cli-framework';import{formatOutput}from'../framework/output.js';import{CliErrors}from'../errors.js';function a70_0x2d71(_0x4d6806,_0x2bc740){_0x4d6806=_0x4d6806-0x123;const _0x44d39b=a70_0x44d3();let _0x2d7116=_0x44d39b[_0x4d6806];return _0x2d7116;}import{CLI_BIN_NAME,GLOBAL_FLAGS,PIPELINE_FLAG_NAMES}from'../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../constant/product.js';import{isNonInteractiveMode,readAppCodeFromConfig}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{getApiDomain}from'../constant/domain.js';import{buildConfirmationLines,reconstructCommandArgv}from'../framework/runner-confirmation.js';import{mapUserFacingExecuteError}from'../framework/runner-error.js';import{resolveLatestUpdateNotice}from'../utils/update-notice.js';import{findAppByCode,findAppByName,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../commands/app/eligibility.js';export function resolveAuthMode(_0x4a9ee6){const _0x24d96a=a70_0x2d71;return void _0x4a9ee6,AUTH_MODE[_0x24d96a(0x148)];}export function createPipelineEnv(_0xcbaf71,_0x58257c){const _0x55775a=a70_0x2d71,_0x23407b=typeof _0x58257c[_0x55775a(0x141)]===_0x55775a(0x163)&&_0x58257c['app']['trim']();return{'rawFlags':_0x58257c,'appCode':_0xcbaf71[_0x55775a(0x149)]||productEnv(_0x55775a(0x14c))||(_0x23407b?undefined:readAppCodeFromConfig()),'appCodeSource':_0xcbaf71[_0x55775a(0x15d)],'apiDomain':getApiDomain(),'isNonInteractive':isNonInteractiveMode(_0x58257c),'defaultFormat':_0xcbaf71[_0x55775a(0x134)],'defaultPageSize':_0xcbaf71[_0x55775a(0x128)],'defaultVerbose':_0xcbaf71[_0x55775a(0x143)],'riskLevel':_0xcbaf71[_0x55775a(0x165)],'accessKey':_0xcbaf71[_0x55775a(0x13e)],'env':_0xcbaf71['env'],'mergedCli':{'defaultApp':_0xcbaf71[_0x55775a(0x13a)],'currentApp':_0xcbaf71[_0x55775a(0x136)],'appCode':_0xcbaf71[_0x55775a(0x149)]}};}const runnerAdapter={'cliErrors':CliErrors,'pipelineFlags':GLOBAL_FLAGS[a70_0x24891d(0x12b)](_0xe840be=>PIPELINE_FLAG_NAMES[a70_0x24891d(0x131)](_0xe840be[a70_0x24891d(0x124)]))[a70_0x24891d(0x157)](({name:_0x4cb609,type:_0x13ab98,description:_0x1f52aa})=>({'name':_0x4cb609,'type':_0x13ab98,'description':_0x1f52aa})),'formatOutput':formatOutput,'getCommandLabel'(_0x4542e7){const _0xab68c5=a70_0x24891d;return CLI_BIN_NAME+'\x20'+_0x4542e7[_0xab68c5(0x14a)]+'\x20'+_0x4542e7[_0xab68c5(0x144)];},'riskPolicy':{'onViolation'(_0xf8bc00){const _0x3aa001=a70_0x24891d;console[_0x3aa001(0x15a)](_0xf8bc00);},'createError'(_0x53e5b0){const _0x5eac89=a70_0x24891d;return CliErrors[_0x5eac89(0x12a)](_0x53e5b0);}},async 'prepare'(_0x53ad14,_0x472803){const _0x5e389a=a70_0x24891d,_0x3d75b0=resolveAuthMode(_0x472803);if(_0x53ad14[_0x5e389a(0x12e)]!==![]){if(!_0x472803[_0x5e389a(0x13e)])throw CliErrors['authRequired']('Set\x20accessKey\x20in\x20'+PRODUCT_CONFIG[_0x5e389a(0x14d)]+_0x5e389a(0x152)+productEnvName(_0x5e389a(0x123))+'.');const {setActiveAK:_0x113ffd}=await import(_0x5e389a(0x138));_0x113ffd(_0x472803['accessKey']);}let _0x1adf92='';if(_0x53ad14['requiresAppCode']!==![]){_0x1adf92=_0x472803[_0x5e389a(0x149)]??'',_0x1adf92=await resolveExplicitAppName(_0x53ad14,_0x472803,_0x1adf92);if(!_0x1adf92){await assertSelectedAppNameIsRuntimeAccessible(_0x53ad14,_0x472803);throw CliErrors[_0x5e389a(0x15f)](_0x5e389a(0x127)+PRODUCT_CONFIG[_0x5e389a(0x14d)]+'.');}await assertAppCodeIsRuntimeAccessible(_0x53ad14,_0x472803,_0x1adf92);}if(_0x1adf92){const {initSdkClient:_0x394e27}=await import(_0x5e389a(0x150));_0x394e27({'appCode':_0x1adf92,'env':_0x472803['env']??_0x5e389a(0x146),'accessKey':_0x472803[_0x5e389a(0x13e)],'authMode':_0x3d75b0});}return{'defaults':{'booleans':{'verbose':_0x472803[_0x5e389a(0x12f)]},'numbers':{'pagesize':_0x472803['defaultPageSize']}},'extras':{'appCode':_0x1adf92,'cookie':'','apiDomain':_0x472803['apiDomain'],'apiDir':'','accessKey':_0x472803[_0x5e389a(0x13e)],'envName':_0x472803['env'],'mergedCli':_0x472803['mergedCli']}};},async 'confirmHighRisk'({def:_0x5ec57f,env:_0x491add,flags:_0x1ec051,commandLabel:_0x1a5c85}){const _0x16d616=a70_0x24891d;if(_0x491add[_0x16d616(0x156)]){const _0x13dd5f=reconstructCommandArgv(_0x5ec57f,_0x1ec051);throw CliErrors[_0x16d616(0x132)](_0x16d616(0x155)+_0x1a5c85+'`\x20requires\x20--yes\x20in\x20non-interactive\x20mode.\x0a'+(_0x16d616(0x14e)+_0x13dd5f));}await requireConfirmationPrompt({'lines':buildConfirmationLines(_0x5ec57f,_0x1a5c85,_0x1ec051),'createCancelledError':_0x58add5=>CliErrors[_0x16d616(0x12a)](_0x58add5)});},'mapDryRunError'(_0x51bdeb){return mapUserFacingExecuteError(_0x51bdeb);},'mapExecuteError'(_0x1f8c73){return mapUserFacingExecuteError(_0x1f8c73);},async 'finalize'(){const _0x3886fd=a70_0x24891d,{clearActiveAK:_0x3c3962}=await import(_0x3886fd(0x138));_0x3c3962();}};async function resolveExplicitAppName(_0x4dce6c,_0x1c537e,_0x3a3f92){const _0x39d8e7=a70_0x24891d;if(_0x4dce6c[_0x39d8e7(0x14b)]===![])return _0x3a3f92;const _0x187622=typeof _0x1c537e[_0x39d8e7(0x139)]['app']===_0x39d8e7(0x163)?_0x1c537e[_0x39d8e7(0x139)][_0x39d8e7(0x141)][_0x39d8e7(0x12c)]():'';if(!_0x187622)return _0x3a3f92;const _0x5b1b53=typeof _0x1c537e[_0x39d8e7(0x139)]['appcode']==='string'&&_0x1c537e[_0x39d8e7(0x139)][_0x39d8e7(0x14f)]['trim']()||productEnv('APPCODE');if(_0x5b1b53||_0x1c537e['appCodeSource']===_0x39d8e7(0x145))return _0x3a3f92;const {getRemoteAppList:_0xbd9775}=await import(_0x39d8e7(0x13c)),_0x35f945=await _0xbd9775({'env':_0x1c537e[_0x39d8e7(0x164)]??_0x39d8e7(0x146),'accessKey':_0x1c537e[_0x39d8e7(0x13e)]}),_0x36c90d=findAppByName(_0x35f945[_0x39d8e7(0x154)],_0x187622);if(_0x36c90d&&!isRuntimeAccessibleApp(_0x36c90d))throw runtimeInaccessibleAppError(_0x36c90d,'\x22'+_0x187622+'\x22');const _0x3189ec=_0x36c90d?.[_0x39d8e7(0x149)]?.[_0x39d8e7(0x12c)]();if(_0x3189ec)return _0x3189ec;throw CliErrors[_0x39d8e7(0x132)]('Unknown\x20app:\x20'+_0x187622,_0x39d8e7(0x147)+CLI_BIN_NAME+_0x39d8e7(0x129)+_0x187622+_0x39d8e7(0x159)+PRODUCT_CONFIG[_0x39d8e7(0x14d)]+'.');}async function assertSelectedAppNameIsRuntimeAccessible(_0x373dfc,_0x12507e){const _0x26931c=a70_0x24891d;if(_0x373dfc['requiresAppCode']===![]||!_0x12507e[_0x26931c(0x13e)])return;const _0x2253e4=(typeof _0x12507e[_0x26931c(0x139)][_0x26931c(0x141)]===_0x26931c(0x163)&&_0x12507e['rawFlags']['app']['trim']()?_0x12507e[_0x26931c(0x139)]['app']:_0x12507e[_0x26931c(0x15e)]?.[_0x26931c(0x136)]??_0x12507e['mergedCli']?.[_0x26931c(0x13a)])?.['trim']();if(!_0x2253e4)return;const {getRemoteAppList:_0x1b5a7a}=await import(_0x26931c(0x13c)),_0x150ebc=await _0x1b5a7a({'env':_0x12507e[_0x26931c(0x164)]??'production','accessKey':_0x12507e['accessKey']}),_0x14cf5a=findAppByName(_0x150ebc['items'],_0x2253e4);if(_0x14cf5a&&!isRuntimeAccessibleApp(_0x14cf5a))throw runtimeInaccessibleAppError(_0x14cf5a,'\x22'+_0x2253e4+'\x22');}async function assertAppCodeIsRuntimeAccessible(_0x2bad75,_0x145e07,_0x34cf01){const _0x3fa6c1=a70_0x24891d;if(_0x2bad75[_0x3fa6c1(0x14b)]===![]||!_0x145e07[_0x3fa6c1(0x13e)])return;const {getRemoteAppList:_0x1fbfb7}=await import(_0x3fa6c1(0x13c)),_0x3bbde4=await _0x1fbfb7({'env':_0x145e07[_0x3fa6c1(0x164)]??_0x3fa6c1(0x146),'accessKey':_0x145e07[_0x3fa6c1(0x13e)]}),_0x58de2b=findAppByCode(_0x3bbde4['items'],_0x34cf01);if(_0x58de2b&&!isRuntimeAccessibleApp(_0x58de2b))throw runtimeInaccessibleAppError(_0x58de2b,_0x3fa6c1(0x133)+_0x34cf01+'\x22');}export async function runCommand(_0x4086f1,_0x5ccf12){await runCommandWithAdapter(shouldAttachUpdateNotice(_0x4086f1)?withUpdateNotice(_0x4086f1):_0x4086f1,_0x5ccf12,runnerAdapter);}function a70_0x44d3(){const _0x1c2514=['\x20app\x20list\x20--no-cache`\x20to\x20refresh\x20available\x20apps,\x20or\x20add\x20apps.','cancelled','filter','trim','27085idfHUd','requiresAuth','defaultVerbose','42vFyaeK','has','validation','appcode\x20\x22','format','6lRNhcV','currentApp','217397mYqTgX','../core/api-client.js','rawFlags','defaultApp','object','../commands/app/remote-source.js','pretty','accessKey','320912dopDTR','240XCDuyh','app','includes','verbose','command','local-alias','production','Run\x20`','ClientAk','appCode','service','requiresAppCode','APPCODE','newConfigFileName','\x20\x20To\x20proceed:\x20','appcode','../core/sdk-client.js','124256dgCVTZ','\x20or\x20pass\x20','13329njQXom','items','High-risk\x20operation\x20`','isNonInteractive','map','nonInteractive','.appcode\x20to\x20','error','790YUQlIE','resolve','appCodeSource','mergedCli','configMissing','update','2aoSvsS','11647701TlgKfz','string','env','riskLevel','2235884NCPcLP','execute','doctor','ACCESS_KEY','name','_notice','3XAqnkM','Set\x20appcode\x20via\x20--appcode\x20or\x20in\x20','pageSize'];a70_0x44d3=function(){return _0x1c2514;};return a70_0x44d3();}function shouldAttachUpdateNotice(_0x178c1f){const _0xda76da=a70_0x24891d;return![_0xda76da(0x160),'schema',_0xda76da(0x168)][_0xda76da(0x142)](_0x178c1f[_0xda76da(0x14a)]);}function withUpdateNotice(_0x5182eb){return{..._0x5182eb,async 'execute'(_0x10ede0){const _0x18c6f2=a70_0x2d71,_0xa22b7b=shouldResolveUpdateNotice(_0x10ede0)?resolveLatestUpdateNotice()['catch'](()=>null):Promise[_0x18c6f2(0x15c)](null),_0x47d0fc=await _0x5182eb[_0x18c6f2(0x167)](_0x10ede0);return attachUpdateNotice(_0x47d0fc,await _0xa22b7b);}};}function shouldResolveUpdateNotice(_0x5d57ff){const _0x54169a=a70_0x24891d;return _0x5d57ff['format']===_0x54169a(0x13d)&&!_0x5d57ff[_0x54169a(0x158)];}function attachUpdateNotice(_0x4d228c,_0x3169e5){const _0x457607=a70_0x24891d;if(!_0x3169e5||!_0x4d228c||typeof _0x4d228c!==_0x457607(0x13b))return _0x4d228c;const _0x2d7d28=_0x4d228c,_0x6f4172=typeof _0x2d7d28[_0x457607(0x125)]===_0x457607(0x13b)&&_0x2d7d28[_0x457607(0x125)]!==null?_0x2d7d28[_0x457607(0x125)]:{};return{..._0x2d7d28,'_notice':{..._0x6f4172,'update':_0x3169e5}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3e708e,_0x2d2f30){const _0x1fa2a3=a71_0x5fd0,_0x51a534=_0x3e708e();while(!![]){try{const _0x32a829=-parseInt(_0x1fa2a3(0x1f6))/0x1+-parseInt(_0x1fa2a3(0x1ef))/0x2*(parseInt(_0x1fa2a3(0x1ee))/0x3)+-parseInt(_0x1fa2a3(0x1ec))/0x4*(-parseInt(_0x1fa2a3(0x1ed))/0x5)+parseInt(_0x1fa2a3(0x1f2))/0x6+parseInt(_0x1fa2a3(0x1f5))/0x7+-parseInt(_0x1fa2a3(0x1eb))/0x8+-parseInt(_0x1fa2a3(0x1f0))/0x9;if(_0x32a829===_0x2d2f30)break;else _0x51a534['push'](_0x51a534['shift']());}catch(_0x5ee9d6){_0x51a534['push'](_0x51a534['shift']());}}}(a71_0x56a1,0x39ca5));import{buildSchemaPayload as a71_0x1a5d51}from'@lovrabet/cli-framework';import{buildAllFlags}from'../framework/build-all-flags.js';import{findDynamicServiceDefinition,listDynamicServiceEntries}from'../commands/service/dynamic.js';import{CLI_BIN_NAME,CLI_DISPLAY_NAME,GLOBAL_FLAGS}from'../constant/cli.js';function a71_0x56a1(){const _0x4cd0a5=['25DAGTBV','95094WAObTd','8NsAZjS','1187811bCZKiH','../commands/registry.js','1103910zrOuYf','has','service','2560901zLENVH','37243VWqlPo','565520WHFqQK','42868RJOcWi'];a71_0x56a1=function(){return _0x4cd0a5;};return a71_0x56a1();}function a71_0x5fd0(_0x12ca1b,_0xc2d907){_0x12ca1b=_0x12ca1b-0x1eb;const _0x56a118=a71_0x56a1();let _0x5fd0a5=_0x56a118[_0x12ca1b];return _0x5fd0a5;}import{getCliGitCommit,getCliVersion}from'../utils/version.js';export async function buildSchemaPayload(){const _0x1b8962=a71_0x5fd0,{serviceRegistry:_0x11425c,findDefinition:_0x1123c9}=await import(_0x1b8962(0x1f1)),_0x509f18=new Set(_0x11425c['map'](_0x24e40a=>_0x24e40a['service'])),_0x21023c=listDynamicServiceEntries()['filter'](_0x265574=>!_0x509f18[_0x1b8962(0x1f3)](_0x265574[_0x1b8962(0x1f4)]));return a71_0x1a5d51({'cliBinName':CLI_BIN_NAME,'cliDisplayName':CLI_DISPLAY_NAME,'cliVersion':getCliVersion(),'gitCommit':getCliGitCommit(),'globalFlags':GLOBAL_FLAGS,'serviceRegistry':[..._0x11425c,..._0x21023c],'buildAllFlags':buildAllFlags,'findDefinition':(_0x161dcf,_0x3ae7fb)=>_0x1123c9(_0x161dcf,_0x3ae7fb)??findDynamicServiceDefinition(_0x161dcf,_0x3ae7fb)});}
|
package/lib/framework/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a72_0xf063(){var _0x27d304=['3117618XLUYzz','77459ULcHpw','16288151VMlRbv','344272EyasCt','635553YEbfRJ','2HGIZLW','45LStssv','121784waAGQa','156666xFkZZB','133PiHBuQ','10StFsiv'];a72_0xf063=function(){return _0x27d304;};return a72_0xf063();}function a72_0xa9d7(_0x2d37c7,_0xd1e31){_0x2d37c7=_0x2d37c7-0xe0;var _0xf0632e=a72_0xf063();var _0xa9d7cb=_0xf0632e[_0x2d37c7];return _0xa9d7cb;}(function(_0x2fa387,_0x549e0f){var _0x399d57=a72_0xa9d7,_0x41b370=_0x2fa387();while(!![]){try{var _0x188e4d=parseInt(_0x399d57(0xe3))/0x1*(-parseInt(_0x399d57(0xe7))/0x2)+-parseInt(_0x399d57(0xe6))/0x3+-parseInt(_0x399d57(0xe5))/0x4+-parseInt(_0x399d57(0xe8))/0x5*(parseInt(_0x399d57(0xea))/0x6)+parseInt(_0x399d57(0xe0))/0x7*(-parseInt(_0x399d57(0xe9))/0x8)+-parseInt(_0x399d57(0xe2))/0x9+parseInt(_0x399d57(0xe1))/0xa*(parseInt(_0x399d57(0xe4))/0xb);if(_0x188e4d===_0x549e0f)break;else _0x41b370['push'](_0x41b370['shift']());}catch(_0x4f897f){_0x41b370['push'](_0x41b370['shift']());}}}(a72_0xf063,0x394e5));export{riskLevelOrder,normalizeLegacyOutputFormat,isValidFormat}from'@lovrabet/cli-framework';
|