@lovrabet/lovrabet-cli 2.0.11 → 2.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
(function(_0x190f34,_0x539a5a){const _0xee679=a0_0x2f65,_0xb874e8=_0x190f34();while(!![]){try{const _0x453e89=parseInt(_0xee679(0x1ee))/0x1*(-parseInt(_0xee679(0x1ea))/0x2)+-parseInt(_0xee679(0x1f0))/0x3+parseInt(_0xee679(0x1d3))/0x4*(-parseInt(_0xee679(0x1da))/0x5)+-parseInt(_0xee679(0x1e8))/0x6+parseInt(_0xee679(0x1df))/0x7*(-parseInt(_0xee679(0x1f4))/0x8)+-parseInt(_0xee679(0x1dc))/0x9+-parseInt(_0xee679(0x1ed))/0xa*(-parseInt(_0xee679(0x1e9))/0xb);if(_0x453e89===_0x539a5a)break;else _0xb874e8['push'](_0xb874e8['shift']());}catch(_0x4a6550){_0xb874e8['push'](_0xb874e8['shift']());}}}(a0_0x5d5c,0x19f41));import{jsx as a0_0x537f1c}from'react/jsx-runtime';import a0_0x6b6fc5 from'meow';import{render}from'ink';import{Help}from'./help.js';function a0_0x2f65(_0x2aee67,_0x1a0008){_0x2aee67=_0x2aee67-0x1d0;const _0x5d5cd9=a0_0x5d5c();let _0x2f6594=_0x5d5cd9[_0x2aee67];return _0x2f6594;}import{CliError,CliErrors}from'./errors.js';function a0_0x5d5c(){const _0x4508b2=['11KmvqDz','2BxTYAs','ERR_USE_AFTER_CLOSE','corrected','7266460qOdPBr','178741ExuoOC','error','244170DXzkIJ','\x20->\x20--','flatMap','[preparse]\x20','976uRygdr','ERR_STREAM_DESTROYED','code','exitCode','length','Unexpected\x20error:','original','log',':\x20--','12JYCNLb','hint','\x0aCancelled.\x0a','flags','slice','write','Hint:\x20','39545oYQxmn','defaultCommand','1304370oIARmE','Error:\x20','unknownCommand','2051ENXMtJ','help','input','args','message','handler','exit','stderr','assign','934842bRCQFY'];a0_0x5d5c=function(){return _0x4508b2;};return a0_0x5d5c();}import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';const helpText=generateFullHelp(),cli=a0_0x6b6fc5(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'autoVersion':!![]});void main()['catch'](handleError);async function main(){try{await run();}catch(_0x4e9b50){handleError(_0x4e9b50);}}async function run(){const _0x5b8c1a=a0_0x2f65;let _0x4ed667=cli[_0x5b8c1a(0x1e1)][0x0],_0x44540b=cli[_0x5b8c1a(0x1e1)][0x1];const _0x29b4fa=cli[_0x5b8c1a(0x1d6)];try{const {correctFlags:_0x57fda7}=await import('./framework/preparse.js'),_0x4137e7=getAllDefinitions()[_0x5b8c1a(0x1f2)](_0x1047f7=>_0x1047f7[_0x5b8c1a(0x1d6)]??[]),{flags:_0x394cf6,corrections:_0x64fcff}=_0x57fda7(_0x29b4fa,_0x4137e7);if(_0x64fcff[_0x5b8c1a(0x1f8)]>0x0){for(const _0x45e461 of _0x64fcff){process[_0x5b8c1a(0x1e6)]['write'](_0x5b8c1a(0x1f3)+_0x45e461[_0x5b8c1a(0x1e4)]+_0x5b8c1a(0x1d2)+_0x45e461[_0x5b8c1a(0x1d0)]+_0x5b8c1a(0x1f1)+_0x45e461[_0x5b8c1a(0x1ec)]+'\x0a');}Object[_0x5b8c1a(0x1e7)](_0x29b4fa,_0x394cf6);}}catch{}if(!_0x4ed667||!isKnownService(_0x4ed667)){const {waitUntilExit:_0x1db452}=render(a0_0x537f1c(Help,{}));await _0x1db452();return;}const _0x3ce0fa=getServiceEntry(_0x4ed667);if(!_0x44540b){if(_0x29b4fa[_0x5b8c1a(0x1e0)]){console[_0x5b8c1a(0x1d1)](generateServiceHelp(_0x4ed667));return;}if(_0x3ce0fa[_0x5b8c1a(0x1db)])_0x44540b=_0x3ce0fa[_0x5b8c1a(0x1db)];else{console[_0x5b8c1a(0x1d1)](generateServiceHelp(_0x4ed667));return;}}const _0x1bcc7c=findDefinition(_0x4ed667,_0x44540b);!_0x1bcc7c&&(console[_0x5b8c1a(0x1d1)](generateServiceHelp(_0x4ed667)),handleError(CliErrors[_0x5b8c1a(0x1de)](_0x4ed667+'\x20'+_0x44540b)));if(_0x29b4fa[_0x5b8c1a(0x1e0)]){console['log'](generateCommandHelp(_0x1bcc7c));return;}const _0x24ef54=buildConfigFromFlags(_0x29b4fa);await initGlobalEnvironment(_0x24ef54);const _0x28b8a8=createPipelineEnv(_0x24ef54,_0x29b4fa);_0x28b8a8[_0x5b8c1a(0x1e2)]=cli[_0x5b8c1a(0x1e1)][_0x5b8c1a(0x1d7)](0x2),await runCommand(_0x1bcc7c,_0x28b8a8);}function handleError(_0x47902d){const _0x902588=a0_0x2f65;if(_0x47902d instanceof CliError){_0x47902d[_0x902588(0x1f6)]==='cancelled'&&(process[_0x902588(0x1e6)]['write'](_0x902588(0x1d5)),process[_0x902588(0x1e5)](0x0));console[_0x902588(0x1ef)](_0x902588(0x1dd)+_0x47902d[_0x902588(0x1e3)]);if(_0x47902d[_0x902588(0x1d4)])console['error'](_0x902588(0x1d9)+_0x47902d[_0x902588(0x1d4)]);process[_0x902588(0x1e5)](_0x47902d[_0x902588(0x1f7)]);}isUserCancellation(_0x47902d)&&(process[_0x902588(0x1e6)][_0x902588(0x1d8)](_0x902588(0x1d5)),process[_0x902588(0x1e5)](0x0)),console[_0x902588(0x1ef)](_0x902588(0x1f9),_0x47902d),process[_0x902588(0x1e5)](0x1);}function isUserCancellation(_0x4dd432){const _0xb39199=a0_0x2f65;if(!(_0x4dd432 instanceof Error))return![];if(_0x4dd432['name']==='ExitPromptError')return!![];if(_0x4dd432['code']===_0xb39199(0x1eb))return!![];if(_0x4dd432[_0xb39199(0x1f6)]===_0xb39199(0x1f5))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x836ec,_0x29876c){const _0x18939d=a1_0xb01b,_0x41bbdb=_0x836ec();while(!![]){try{const _0x352c99=parseInt(_0x18939d(0x136))/0x1*(-parseInt(_0x18939d(0x153))/0x2)+-parseInt(_0x18939d(0x14c))/0x3+-parseInt(_0x18939d(0x145))/0x4*(parseInt(_0x18939d(0x141))/0x5)+parseInt(_0x18939d(0x14b))/0x6*(-parseInt(_0x18939d(0x154))/0x7)+-parseInt(_0x18939d(0x149))/0x8*(parseInt(_0x18939d(0x13b))/0x9)+-parseInt(_0x18939d(0x148))/0xa*(parseInt(_0x18939d(0x14f))/0xb)+parseInt(_0x18939d(0x139))/0xc;if(_0x352c99===_0x29876c)break;else _0x41bbdb['push'](_0x41bbdb['shift']());}catch(_0x10fe93){_0x41bbdb['push'](_0x41bbdb['shift']());}}}(a1_0x4c37,0xa6d59));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';export function fingerprintAccessKey(_0x5b7eda){const _0x253d82=a1_0xb01b,_0x340e89=_0x5b7eda[_0x253d82(0x14d)](),_0x1fc9ff=_0x340e89['slice'](-0x6)||_0x253d82(0x150),_0x124de7=createHash(_0x253d82(0x138))[_0x253d82(0x143)](_0x340e89)[_0x253d82(0x13e)](_0x253d82(0x137))[_0x253d82(0x147)](0x0,0xc);return _0x253d82(0x152)+_0x1fc9ff+'_'+_0x124de7;}function a1_0xb01b(_0x227a9a,_0x4bf139){_0x227a9a=_0x227a9a-0x136;const _0x4c378a=a1_0x4c37();let _0xb01b3c=_0x4c378a[_0x227a9a];return _0xb01b3c;}export function getAppCacheFilePath(_0x29ad6a,_0x1d7bbc){const _0x27439a=a1_0xb01b;return resolve(homedir(),PRODUCT_CONFIG[_0x27439a(0x14e)],_0x27439a(0x13c),_0x29ad6a,fingerprintAccessKey(_0x1d7bbc),_0x27439a(0x140));}function a1_0x4c37(){const _0x7b73ea=['slice','7154330oRngdE','2608096ksEhQJ','utf8','468dSBaPO','632034QAQHzW','trim','homeDirName','11YGneKt','unknown','stringify','ak_','2IQxWwh','27153vNzfqN','170006nacbaW','hex','sha256','37948596CSukyd','code','9WFlwme','cache','appName','digest','find','my-apps.json','5fEnXiZ','items','update','EACCES','3017356RTEIaP','EPERM'];a1_0x4c37=function(){return _0x7b73ea;};return a1_0x4c37();}export function readCachedAppList(_0x2dbffc,_0x21fa3b){const _0x570a0a=a1_0xb01b;if(!_0x21fa3b?.['trim']())return null;const _0x54fa7e=getAppCacheFilePath(_0x2dbffc,_0x21fa3b);if(!existsSync(_0x54fa7e))return null;try{const _0x4f8507=readFileSync(_0x54fa7e,_0x570a0a(0x14a));if(!_0x4f8507['trim']())return null;const _0x291436=JSON['parse'](_0x4f8507);if(!Array['isArray'](_0x291436[_0x570a0a(0x142)]))return null;return _0x291436;}catch{return null;}}export function writeCachedAppList(_0x5cfb86,_0x19d5dd,_0x27e8ad){const _0x1ca9dc=a1_0xb01b,_0x284a74=getAppCacheFilePath(_0x5cfb86,_0x19d5dd),_0x40ccd9=dirname(_0x284a74);!existsSync(_0x40ccd9)&&mkdirSync(_0x40ccd9,{'recursive':!![]});const _0xb23f08=_0x284a74+'.tmp';try{writeFileSync(_0xb23f08,JSON[_0x1ca9dc(0x151)](_0x27e8ad,null,0x2)+'\x0a',{'encoding':_0x1ca9dc(0x14a),'mode':0x180});try{renameSync(_0xb23f08,_0x284a74);}catch(_0x395ba6){if(_0x395ba6[_0x1ca9dc(0x13a)]===_0x1ca9dc(0x146)||_0x395ba6[_0x1ca9dc(0x13a)]==='EXDEV'||_0x395ba6[_0x1ca9dc(0x13a)]===_0x1ca9dc(0x144)){writeFileSync(_0x284a74,JSON['stringify'](_0x27e8ad,null,0x2)+'\x0a',{'encoding':_0x1ca9dc(0x14a)});try{unlinkSync(_0xb23f08);}catch{}}else throw _0x395ba6;}}catch(_0x2a49cf){try{unlinkSync(_0xb23f08);}catch{}throw _0x2a49cf;}return _0x284a74;}export function resolveCachedAppCode(_0x4ef040,_0x435919,_0x412292){const _0x4ab32f=a1_0xb01b;if(!_0x4ef040)return undefined;const _0x506fde=readCachedAppList(_0x435919,_0x412292),_0x15317b=_0x506fde?.[_0x4ab32f(0x142)][_0x4ab32f(0x13f)](_0xd98e38=>_0xd98e38[_0x4ab32f(0x13d)]===_0x4ef040);return _0x15317b?.['appCode']?.['trim']()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a2_0x454578=a2_0x4c80;(function(_0x412439,_0x9d167e){const _0x2e077d=a2_0x4c80,_0x48e714=_0x412439();while(!![]){try{const _0x4e5fbc=-parseInt(_0x2e077d(0x185))/0x1*(parseInt(_0x2e077d(0x177))/0x2)+parseInt(_0x2e077d(0x1bf))/0x3+parseInt(_0x2e077d(0x1a4))/0x4*(-parseInt(_0x2e077d(0x172))/0x5)+parseInt(_0x2e077d(0x19a))/0x6+parseInt(_0x2e077d(0x1bd))/0x7*(-parseInt(_0x2e077d(0x18c))/0x8)+parseInt(_0x2e077d(0x1ab))/0x9+-parseInt(_0x2e077d(0x1ae))/0xa*(-parseInt(_0x2e077d(0x1ac))/0xb);if(_0x4e5fbc===_0x9d167e)break;else _0x48e714['push'](_0x48e714['shift']());}catch(_0xaa0da4){_0x48e714['push'](_0x48e714['shift']());}}}(a2_0x158f,0xdc8f2));function a2_0x158f(){const _0x5a6d8a=['production','isArray','join','boolean','cachePath','project-default','filter','Target\x20environment\x20(default:\x20current\x20env)','global','4308564xITILa','\x20cached\x20app(s)\x20for\x20env=\x22','Missing\x20app\x20name.','push','enableI18n','Use\x20`','source','entries','args','no-cache','4474084MMiytH','isCurrent','init','items','cache','.appcode\x20to\x20.lovrabet.json.','\x22\x20not\x20found.','12431817MqKICo','77zqFWMI','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','4281380Jpdjul','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','\x20app(s)\x20for\x20env=\x22','i18nInfo','accessKey','langs','fetchedAt','name','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','pull','../../context.js','App\x20\x22','bool','appPublishStatus','../../commands/app/cache.js','9576SsnePS','Set\x20the\x20fallback\x20app\x20candidate','796341qIZfRh','list','env','Filter\x20by\x20environment\x20(default:\x20current\x20env)','appcode','appName','defaultApp','app','Read\x20app\x20list\x20from\x20local\x20cache\x20only','nonInteractive','5eEZxDG','globalPath','\x20app\x20use\x20<name>\x20[--global]','envName','from','467246kXVIHQ','type','mergedCli','../../commands/app/remote-source.js','find','local','use','Refreshed\x20app\x20cache\x20with\x20','write','appCode','Remote\x20app\x20name\x20to\x20activate','No\x20cached\x20apps\x20found.','projectPath','validation','7WTBuFN','Usage:\x20','No\x20apps\x20found\x20on\x20the\x20platform.','map','Loaded\x20','str','Default\x20app\x20candidate\x20set\x20to\x20\x22','9968kQVtTd','length','raw','string','Initialize\x20'];a2_0x158f=function(){return _0x5a6d8a;};return a2_0x158f();}import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':'global','type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]};function collectFlags(_0x4c67a8,_0x1feb49){const _0x40e578=a2_0x4c80,_0x52d4af={};for(const _0x2c0221 of _0x1feb49){const _0x180240=_0x2c0221[_0x40e578(0x178)]==='boolean'?_0x4c67a8[_0x40e578(0x1ba)](_0x2c0221[_0x40e578(0x1b5)]):_0x4c67a8[_0x40e578(0x18a)](_0x2c0221[_0x40e578(0x1b5)]);if(_0x180240!==''&&_0x180240!==![])_0x52d4af[_0x2c0221[_0x40e578(0x1b5)]]=_0x180240;}if(_0x4c67a8[_0x40e578(0x171)])_0x52d4af[_0x40e578(0x171)]=!![];return _0x52d4af;}function normalizeLanguages(_0x4c1cba){const _0x2a2e6e=a2_0x4c80;if(!Array[_0x2a2e6e(0x192)](_0x4c1cba))return[];return _0x4c1cba[_0x2a2e6e(0x197)](_0x48045f=>typeof _0x48045f===_0x2a2e6e(0x18f))['map'](_0x339146=>_0x339146['trim']())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x2f0ed2){const _0x502a52=a2_0x4c80,_0x28cfb4=normalizeLanguages(_0x2f0ed2['i18nInfo']?.[_0x502a52(0x1b3)]);return{'enableI18n':typeof _0x2f0ed2[_0x502a52(0x19e)]===_0x502a52(0x194)?_0x2f0ed2[_0x502a52(0x19e)]:null,'languages':_0x28cfb4,'i18nInfo':_0x2f0ed2[_0x502a52(0x1b1)]?{..._0x2f0ed2[_0x502a52(0x1b1)],'langs':_0x28cfb4[_0x502a52(0x18d)]?_0x28cfb4:null}:null};}function a2_0x4c80(_0x33adf1,_0x1059e7){_0x33adf1=_0x33adf1-0x169;const _0x158fed=a2_0x158f();let _0x4c80f8=_0x158fed[_0x33adf1];return _0x4c80f8;}const initDef={'service':'app','command':a2_0x454578(0x1a6),'description':a2_0x454578(0x190)+PRODUCT_CONFIG['newConfigFileName']+'\x20config\x20file','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x49cfd7){return await runInit(collectFlags(_0x49cfd7,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a2_0x454578(0x16f),'command':a2_0x454578(0x169),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':'string','description':a2_0x454578(0x16b),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x454578(0x17c),'type':'boolean','description':a2_0x454578(0x170),'default':![]},{'name':a2_0x454578(0x1a3),'type':a2_0x454578(0x194),'description':a2_0x454578(0x1b6),'default':![]}],async 'execute'(_0x1dd590){const _0x32976f=a2_0x454578,_0x2abda2=_0x1dd590[_0x32976f(0x18a)](_0x32976f(0x16a))||_0x1dd590[_0x32976f(0x175)]||getEnv()||_0x32976f(0x191),_0x91af06=_0x1dd590[_0x32976f(0x1ba)](_0x32976f(0x17c)),_0x1341c8=_0x1dd590[_0x32976f(0x1ba)](_0x32976f(0x1a3)),{readRawConfigWithLayers:_0x90869e,resolveDefaultAppSource:_0x4d3828,getLocalAppAliases:_0x3e78bf}=await import(_0x32976f(0x1b8)),{getRemoteAppList:_0x4082ee}=await import(_0x32976f(0x17a)),{config:_0x335021,layers:_0xff069c}=_0x90869e(),_0x172a4a=_0x4d3828(_0xff069c),{defaultApp:_0x159e9f}=_0x335021,_0x1c6fe8=await _0x4082ee({'env':_0x2abda2,'accessKey':_0x1dd590[_0x32976f(0x1b2)],'localOnly':_0x91af06,'noCache':_0x1341c8}),_0x480a60=_0x1c6fe8[_0x32976f(0x1a7)]['map'](_0x16194b=>{const _0x216fba=_0x32976f;return{'name':_0x16194b[_0x216fba(0x16d)],'appcode':_0x16194b[_0x216fba(0x180)],'named':!![],'definedIn':'remote','isDefault':_0x16194b[_0x216fba(0x16d)]===_0x159e9f,...buildAppProfileListFields(_0x2abda2),...buildRemoteAppI18nFields(_0x16194b),'source':_0x1c6fe8[_0x216fba(0x1a0)],'owner':_0x16194b['appOwnerName']??null,'status':_0x16194b[_0x216fba(0x1bb)]??null,'cachedAt':_0x1c6fe8[_0x216fba(0x1b4)]};}),_0x1fab0f=_0x3e78bf(_0x335021);let _0x1217d9=0x0;for(const [_0x7bc0b8,_0x27a6c7]of Object[_0x32976f(0x1a1)](_0x1fab0f)){const _0x233341=typeof _0x27a6c7[_0x32976f(0x16c)]===_0x32976f(0x18f)?_0x27a6c7[_0x32976f(0x16c)]['trim']():'';if(!_0x233341)continue;_0x1217d9+=0x1,_0x480a60[_0x32976f(0x19d)]({'name':_0x7bc0b8,'appcode':_0x233341,'named':!![],'definedIn':_0x32976f(0x17c),'isDefault':_0x7bc0b8===_0x159e9f,...buildAppProfileListFields(_0x2abda2),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x480a60,_0x1dd590[_0x32976f(0x179)]);if(_0x480a60['length']===0x0)return{'ok':!![],'data':[],'message':_0x1c6fe8[_0x32976f(0x1a0)]===_0x32976f(0x1a8)?_0x32976f(0x182):_0x32976f(0x187)};const _0x58bfb9=_0x480a60[_0x32976f(0x17b)](_0x9d4639=>_0x9d4639[_0x32976f(0x1a5)]===!![]),_0x1de261=_0x159e9f??_0x58bfb9?.[_0x32976f(0x1b5)]??null,_0xb64aa5={'env':_0x2abda2,'source':_0x1c6fe8[_0x32976f(0x1a0)],'fetchedAt':_0x1c6fe8[_0x32976f(0x1b4)],'cachePath':_0x1c6fe8['cachePath'],'globalPath':_0xff069c[_0x32976f(0x173)]??null,'projectPath':_0xff069c[_0x32976f(0x183)]??null,'defaultApp':_0x1de261,'defaultAppSource':_0x159e9f!=null?_0x172a4a:null,'localAliasCount':_0x1217d9};return{'ok':!![],'data':{'items':_0x480a60,'meta':_0xb64aa5}};}},pullDef={'service':a2_0x454578(0x16f),'command':a2_0x454578(0x1b7),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a2_0x454578(0x16a),'type':a2_0x454578(0x18f),'description':a2_0x454578(0x198),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x454578(0x17c),'type':a2_0x454578(0x194),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a2_0x454578(0x1a3),'type':a2_0x454578(0x194),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x33c221){const _0x27d7a1=a2_0x454578,_0x3d86d9=_0x33c221['str'](_0x27d7a1(0x16a))||_0x33c221[_0x27d7a1(0x175)]||getEnv()||_0x27d7a1(0x191),_0x7daef6=_0x33c221[_0x27d7a1(0x1ba)](_0x27d7a1(0x17c)),_0x342d92=_0x33c221[_0x27d7a1(0x1ba)](_0x27d7a1(0x1a3)),{getRemoteAppList:_0x44014e}=await import(_0x27d7a1(0x17a)),_0x18efc8=await _0x44014e({'env':_0x3d86d9,'accessKey':_0x33c221['accessKey'],'localOnly':_0x7daef6,'noCache':_0x342d92});return{'ok':!![],'data':{'total':_0x18efc8[_0x27d7a1(0x1a7)][_0x27d7a1(0x18d)],'env':_0x3d86d9,'source':_0x18efc8[_0x27d7a1(0x1a0)],'fetchedAt':_0x18efc8['fetchedAt'],'cachePath':_0x18efc8[_0x27d7a1(0x195)]},'message':_0x18efc8[_0x27d7a1(0x1a0)]===_0x27d7a1(0x1a8)?_0x27d7a1(0x189)+_0x18efc8[_0x27d7a1(0x1a7)][_0x27d7a1(0x18d)]+_0x27d7a1(0x19b)+_0x3d86d9+'\x22.':_0x27d7a1(0x17e)+_0x18efc8[_0x27d7a1(0x1a7)][_0x27d7a1(0x18d)]+_0x27d7a1(0x1b0)+_0x3d86d9+'\x22.'};}},useDef={'service':'app','command':a2_0x454578(0x17d),'description':a2_0x454578(0x1be),'risk':a2_0x454578(0x17f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a2_0x454578(0x1b5),'description':a2_0x454578(0x181),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x1b472b){const _0xbfdaa1=a2_0x454578;if(!_0x1b472b[_0xbfdaa1(0x1a2)][0x0])throw CliErrors[_0xbfdaa1(0x184)](_0xbfdaa1(0x19c),_0xbfdaa1(0x186)+CLI_BIN_NAME+_0xbfdaa1(0x174));},async 'execute'(_0xa063d4){const _0x3b3b2a=a2_0x454578,_0x18f62e=_0xa063d4['args'][0x0];if(!_0x18f62e)throw CliErrors[_0x3b3b2a(0x184)](_0x3b3b2a(0x19c),'Usage:\x20'+CLI_BIN_NAME+_0x3b3b2a(0x174));const {buildConfigFromFlags:_0x281698,resolveLocalAppAliasCode:_0x63c089}=await import('../../context.js'),{readCachedAppList:_0x566b62}=await import(_0x3b3b2a(0x1bc)),_0x49029a=_0xa063d4[_0x3b3b2a(0x18a)](_0x3b3b2a(0x16a)),_0x501726=_0x281698(_0x49029a?{'env':_0x49029a}:{}),_0x1a8268=_0x566b62(_0x501726['env'],_0x501726[_0x3b3b2a(0x1b2)]),_0x455740=_0x1a8268?.['items'][_0x3b3b2a(0x17b)](_0x27a409=>_0x27a409['appName']===_0x18f62e),_0x306ed1=_0x63c089(_0x501726[_0x3b3b2a(0x18e)]??{},_0x18f62e);if(!_0x455740&&!_0x306ed1&&_0x501726[_0x3b3b2a(0x16e)]!==_0x18f62e){const _0x4debba=[..._0x1a8268?.['items'][_0x3b3b2a(0x188)](_0x1feb7e=>_0x1feb7e[_0x3b3b2a(0x16d)])??[]],_0x48d9c1=_0x4debba[_0x3b3b2a(0x18d)]===0x0?_0x3b3b2a(0x19f)+CLI_BIN_NAME+_0x3b3b2a(0x1ad)+_0x18f62e+_0x3b3b2a(0x1a9):'Available\x20remote\x20apps:\x20'+Array[_0x3b3b2a(0x176)](new Set(_0x4debba))[_0x3b3b2a(0x193)](',\x20')+_0x3b3b2a(0x1af);throw CliErrors[_0x3b3b2a(0x184)](_0x3b3b2a(0x1b9)+_0x18f62e+_0x3b3b2a(0x1aa),_0x48d9c1);}const _0x124e63=_0xa063d4[_0x3b3b2a(0x1ba)](_0x3b3b2a(0x199));let _0x16af59;if(_0x124e63)_0x16af59={'global':!![]};else{const {isInProject:_0x1fa7ab}=await import(_0x3b3b2a(0x1b8)),_0x2d7ed3=_0x1fa7ab();_0x16af59=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x3b3b2a(0x196),'inProject':_0x2d7ed3}));}const _0x292025=readConfig(_0x16af59);return _0x292025[_0x3b3b2a(0x16e)]=_0x18f62e,writeConfig(_0x292025,_0x16af59),{'ok':!![],'message':_0x3b3b2a(0x18b)+_0x18f62e+'\x22'+scopeLabel(_0x16af59)+'.'};}},importDef={'service':a2_0x454578(0x16f),'command':'import','description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a2_0x454578(0x17f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x2b271b){return await runInitImport(collectFlags(_0x2b271b,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
const a2_0x47a246=a2_0x50e7;function a2_0x50e7(_0x3c3c7b,_0x39828b){_0x3c3c7b=_0x3c3c7b-0x1c6;const _0x19b3d0=a2_0x19b3();let _0x50e7de=_0x19b3d0[_0x3c3c7b];return _0x50e7de;}(function(_0x477c34,_0x4f70d4){const _0x5f4670=a2_0x50e7,_0x4f6c94=_0x477c34();while(!![]){try{const _0x25399f=parseInt(_0x5f4670(0x1e7))/0x1*(parseInt(_0x5f4670(0x217))/0x2)+parseInt(_0x5f4670(0x1d1))/0x3*(parseInt(_0x5f4670(0x1fe))/0x4)+parseInt(_0x5f4670(0x1ff))/0x5+parseInt(_0x5f4670(0x206))/0x6+-parseInt(_0x5f4670(0x208))/0x7*(-parseInt(_0x5f4670(0x1f8))/0x8)+-parseInt(_0x5f4670(0x1f3))/0x9+-parseInt(_0x5f4670(0x1da))/0xa*(parseInt(_0x5f4670(0x218))/0xb);if(_0x25399f===_0x4f70d4)break;else _0x4f6c94['push'](_0x4f6c94['shift']());}catch(_0x159b1a){_0x4f6c94['push'](_0x4f6c94['shift']());}}}(a2_0x19b3,0x83ee1));import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';function a2_0x19b3(){const _0x2f9fca=['project-default','cache','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','../../commands/app/remote-source.js','mergedCli','23469VLEEfS','string','read','use','trim','no-cache','Available\x20remote\x20apps:\x20','env','write','10TWiDNn','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','newConfigFileName','bool','Filter\x20by\x20environment\x20(default:\x20current\x20env)','Default\x20app\x20candidate\x20set\x20to\x20\x22','push','Set\x20the\x20fallback\x20app\x20candidate','Loaded\x20','projectPath','init','items','Read\x20app\x20list\x20from\x20local\x20cache\x20only','193KGbEtT','\x22\x20not\x20found.','envName','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','App\x20\x22','import','validation','app','enableI18n','No\x20cached\x20apps\x20found.','str','entries','8323497luHdXJ','../../context.js','fetchedAt','raw','nonInteractive','1095064cvfBfI','length','\x20app\x20use\x20<name>\x20[--global]','type','appOwnerName','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','24SXXNKT','3122750gkFDio','map','find','.appcode\x20to\x20.lovrabet.json.','global','appName','Initialize\x20','3411300JRsKLp','config','35DbgNED','join','appPublishStatus','remote','Usage:\x20','i18nInfo','langs','boolean','globalPath','appcode','appCode','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','Missing\x20app\x20name.','isCurrent','Refreshed\x20app\x20cache\x20with\x20','1458tqPOHg','6599252JzQyvS','from','defaultApp','Remote\x20app\x20name\x20to\x20activate','../../commands/app/cache.js','\x20app(s)\x20for\x20env=\x22','production','local','name','source','Use\x20`','cachePath','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','filter'];a2_0x19b3=function(){return _0x2f9fca;};return a2_0x19b3();}import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':a2_0x47a246(0x203),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]};function collectFlags(_0x4794bd,_0x19b3d6){const _0x1bafee=a2_0x47a246,_0x3d033a={};for(const _0x2058f5 of _0x19b3d6){const _0x53247f=_0x2058f5[_0x1bafee(0x1fb)]===_0x1bafee(0x20f)?_0x4794bd[_0x1bafee(0x1dd)](_0x2058f5[_0x1bafee(0x1c6)]):_0x4794bd[_0x1bafee(0x1f1)](_0x2058f5['name']);if(_0x53247f!==''&&_0x53247f!==![])_0x3d033a[_0x2058f5[_0x1bafee(0x1c6)]]=_0x53247f;}if(_0x4794bd[_0x1bafee(0x1f7)])_0x3d033a[_0x1bafee(0x1f7)]=!![];return _0x3d033a;}function normalizeLanguages(_0x4b6f14){const _0x322c92=a2_0x47a246;if(!Array['isArray'](_0x4b6f14))return[];return _0x4b6f14[_0x322c92(0x1cb)](_0x403007=>typeof _0x403007===_0x322c92(0x1d2))['map'](_0x240a90=>_0x240a90[_0x322c92(0x1d5)]())[_0x322c92(0x1cb)](Boolean);}function buildRemoteAppI18nFields(_0x23a15c){const _0x3248b3=a2_0x47a246,_0x2320ec=normalizeLanguages(_0x23a15c[_0x3248b3(0x20d)]?.[_0x3248b3(0x20e)]);return{'enableI18n':typeof _0x23a15c[_0x3248b3(0x1ef)]===_0x3248b3(0x20f)?_0x23a15c[_0x3248b3(0x1ef)]:null,'languages':_0x2320ec,'i18nInfo':_0x23a15c[_0x3248b3(0x20d)]?{..._0x23a15c[_0x3248b3(0x20d)],'langs':_0x2320ec['length']?_0x2320ec:null}:null};}const initDef={'service':a2_0x47a246(0x1ee),'command':a2_0x47a246(0x1e4),'description':a2_0x47a246(0x205)+PRODUCT_CONFIG[a2_0x47a246(0x1dc)]+'\x20config\x20file','risk':a2_0x47a246(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x4936d5){return await runInit(collectFlags(_0x4936d5,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a2_0x47a246(0x1ee),'command':'list','description':a2_0x47a246(0x1ce),'risk':a2_0x47a246(0x1d3),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a2_0x47a246(0x1d8),'type':'string','description':a2_0x47a246(0x1de),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a2_0x47a246(0x20f),'description':a2_0x47a246(0x1e6),'default':![]},{'name':'no-cache','type':a2_0x47a246(0x20f),'description':a2_0x47a246(0x1db),'default':![]}],async 'execute'(_0x1423ec){const _0x3de473=a2_0x47a246,_0x4297f5=_0x1423ec[_0x3de473(0x1f1)](_0x3de473(0x1d8))||_0x1423ec[_0x3de473(0x1e9)]||getEnv()||_0x3de473(0x21e),_0x4d91d6=_0x1423ec[_0x3de473(0x1dd)](_0x3de473(0x21f)),_0x24f77a=_0x1423ec[_0x3de473(0x1dd)](_0x3de473(0x1d6)),{readRawConfigWithLayers:_0x4ada1d,resolveDefaultAppSource:_0x5b1288,getLocalAppAliases:_0x209233}=await import(_0x3de473(0x1f4)),{getRemoteAppList:_0x595cd1}=await import(_0x3de473(0x1cf)),{config:_0x289385,layers:_0x3a7ab7}=_0x4ada1d(),_0x8fbcd6=_0x5b1288(_0x3a7ab7),{defaultApp:_0x141b5b}=_0x289385,_0xd936d1=await _0x595cd1({'env':_0x4297f5,'accessKey':_0x1423ec['accessKey'],'localOnly':_0x4d91d6,'noCache':_0x24f77a}),_0x5259e6=_0xd936d1[_0x3de473(0x1e5)][_0x3de473(0x200)](_0x54e96a=>{const _0x4d5d80=_0x3de473;return{'name':_0x54e96a[_0x4d5d80(0x204)],'appcode':_0x54e96a[_0x4d5d80(0x212)],'named':!![],'definedIn':_0x4d5d80(0x20b),'isDefault':_0x54e96a['appName']===_0x141b5b,...buildAppProfileListFields(_0x4297f5),...buildRemoteAppI18nFields(_0x54e96a),'source':_0xd936d1[_0x4d5d80(0x1c7)],'owner':_0x54e96a[_0x4d5d80(0x1fc)]??null,'status':_0x54e96a[_0x4d5d80(0x20a)]??null,'cachedAt':_0xd936d1[_0x4d5d80(0x1f5)]};}),_0x472429=_0x209233(_0x289385);let _0x15311a=0x0;for(const [_0x3b5a27,_0x53c011]of Object[_0x3de473(0x1f2)](_0x472429)){const _0x31982=typeof _0x53c011[_0x3de473(0x211)]===_0x3de473(0x1d2)?_0x53c011[_0x3de473(0x211)][_0x3de473(0x1d5)]():'';if(!_0x31982)continue;_0x15311a+=0x1,_0x5259e6[_0x3de473(0x1e0)]({'name':_0x3b5a27,'appcode':_0x31982,'named':!![],'definedIn':_0x3de473(0x21f),'isDefault':_0x3b5a27===_0x141b5b,...buildAppProfileListFields(_0x4297f5),'source':_0x3de473(0x207),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x5259e6,_0x1423ec[_0x3de473(0x1d0)]);if(_0x5259e6['length']===0x0)return{'ok':!![],'data':[],'message':_0xd936d1[_0x3de473(0x1c7)]===_0x3de473(0x1cd)?_0x3de473(0x1f0):'No\x20apps\x20found\x20on\x20the\x20platform.'};const _0x2d162a=_0x5259e6['find'](_0x378d2b=>_0x378d2b[_0x3de473(0x215)]===!![]),_0x126e96=_0x141b5b??_0x2d162a?.[_0x3de473(0x1c6)]??null,_0x528bd0={'env':_0x4297f5,'source':_0xd936d1[_0x3de473(0x1c7)],'fetchedAt':_0xd936d1['fetchedAt'],'cachePath':_0xd936d1[_0x3de473(0x1c9)],'globalPath':_0x3a7ab7[_0x3de473(0x210)]??null,'projectPath':_0x3a7ab7[_0x3de473(0x1e3)]??null,'defaultApp':_0x126e96,'defaultAppSource':_0x141b5b!=null?_0x8fbcd6:null,'localAliasCount':_0x15311a};return{'ok':!![],'data':{'items':_0x5259e6,'meta':_0x528bd0}};}},pullDef={'service':a2_0x47a246(0x1ee),'command':'pull','description':a2_0x47a246(0x1ca),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a2_0x47a246(0x1d2),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':'boolean','description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a2_0x47a246(0x1d6),'type':a2_0x47a246(0x20f),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x311f84){const _0x521696=a2_0x47a246,_0x1acd9c=_0x311f84[_0x521696(0x1f1)](_0x521696(0x1d8))||_0x311f84[_0x521696(0x1e9)]||getEnv()||_0x521696(0x21e),_0x31f7fe=_0x311f84[_0x521696(0x1dd)](_0x521696(0x21f)),_0x58f3f1=_0x311f84['bool']('no-cache'),{getRemoteAppList:_0x14dbe4}=await import(_0x521696(0x1cf)),_0x3f6180=await _0x14dbe4({'env':_0x1acd9c,'accessKey':_0x311f84['accessKey'],'localOnly':_0x31f7fe,'noCache':_0x58f3f1});return{'ok':!![],'data':{'total':_0x3f6180[_0x521696(0x1e5)]['length'],'env':_0x1acd9c,'source':_0x3f6180[_0x521696(0x1c7)],'fetchedAt':_0x3f6180['fetchedAt'],'cachePath':_0x3f6180['cachePath']},'message':_0x3f6180[_0x521696(0x1c7)]===_0x521696(0x1cd)?_0x521696(0x1e2)+_0x3f6180[_0x521696(0x1e5)]['length']+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x1acd9c+'\x22.':_0x521696(0x216)+_0x3f6180[_0x521696(0x1e5)][_0x521696(0x1f9)]+_0x521696(0x21d)+_0x1acd9c+'\x22.'};}},useDef={'service':a2_0x47a246(0x1ee),'command':a2_0x47a246(0x1d4),'description':a2_0x47a246(0x1e1),'risk':a2_0x47a246(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':a2_0x47a246(0x21b),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x5d9e65){const _0x38c236=a2_0x47a246;if(!_0x5d9e65['args'][0x0])throw CliErrors[_0x38c236(0x1ed)](_0x38c236(0x214),'Usage:\x20'+CLI_BIN_NAME+_0x38c236(0x1fa));},async 'execute'(_0x47ab5f){const _0x4fd219=a2_0x47a246,_0x5230b5=_0x47ab5f['args'][0x0];if(!_0x5230b5)throw CliErrors['validation']('Missing\x20app\x20name.',_0x4fd219(0x20c)+CLI_BIN_NAME+_0x4fd219(0x1fa));const {buildConfigFromFlags:_0x380e34,resolveLocalAppAliasCode:_0x2f8e6d}=await import(_0x4fd219(0x1f4)),{readCachedAppList:_0x2c1ffa}=await import(_0x4fd219(0x21c)),_0x6a06cb=_0x47ab5f[_0x4fd219(0x1f1)](_0x4fd219(0x1d8)),_0x8db979=_0x380e34(_0x6a06cb?{'env':_0x6a06cb}:{}),_0x3c6d7e=_0x2c1ffa(_0x8db979[_0x4fd219(0x1d8)],_0x8db979['accessKey']),_0x5bbf2e=_0x3c6d7e?.['items'][_0x4fd219(0x201)](_0x41a217=>_0x41a217[_0x4fd219(0x204)]===_0x5230b5),_0x3a858b=_0x2f8e6d(_0x8db979[_0x4fd219(0x1f6)]??{},_0x5230b5);if(!_0x5bbf2e&&!_0x3a858b&&_0x8db979['defaultApp']!==_0x5230b5){const _0x20bc23=[..._0x3c6d7e?.[_0x4fd219(0x1e5)][_0x4fd219(0x200)](_0x17adba=>_0x17adba[_0x4fd219(0x204)])??[]],_0x1eda4f=_0x20bc23[_0x4fd219(0x1f9)]===0x0?_0x4fd219(0x1c8)+CLI_BIN_NAME+_0x4fd219(0x1ea)+_0x5230b5+_0x4fd219(0x202):_0x4fd219(0x1d7)+Array[_0x4fd219(0x219)](new Set(_0x20bc23))[_0x4fd219(0x209)](',\x20')+_0x4fd219(0x1fd);throw CliErrors[_0x4fd219(0x1ed)](_0x4fd219(0x1eb)+_0x5230b5+_0x4fd219(0x1e8),_0x1eda4f);}const _0x4a3da=_0x47ab5f[_0x4fd219(0x1dd)]('global');let _0x5a4c49;if(_0x4a3da)_0x5a4c49={'global':!![]};else{const {isInProject:_0x11d69a}=await import('../../context.js'),_0x40b059=_0x11d69a();_0x5a4c49=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x4fd219(0x1cc),'inProject':_0x40b059}));}const _0x4133b8=readConfig(_0x5a4c49);return _0x4133b8[_0x4fd219(0x21a)]=_0x5230b5,writeConfig(_0x4133b8,_0x5a4c49),{'ok':!![],'message':_0x4fd219(0x1df)+_0x5230b5+'\x22'+scopeLabel(_0x5a4c49)+'.'};}},importDef={'service':a2_0x47a246(0x1ee),'command':a2_0x47a246(0x1ec),'description':a2_0x47a246(0x213),'risk':a2_0x47a246(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x52f1f1){return await runInitImport(collectFlags(_0x52f1f1,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a3_0x4faa(_0x40a0c2,_0x19f2d8){_0x40a0c2=_0x40a0c2-0x166;const _0x3626f4=a3_0x3626();let _0x4faaa1=_0x3626f4[_0x40a0c2];return _0x4faaa1;}(function(_0x3bdc51,_0x2cfbc2){const _0x4f4280=a3_0x4faa,_0x35fda4=_0x3bdc51();while(!![]){try{const _0x2ae517=parseInt(_0x4f4280(0x169))/0x1*(parseInt(_0x4f4280(0x16f))/0x2)+-parseInt(_0x4f4280(0x171))/0x3*(-parseInt(_0x4f4280(0x168))/0x4)+parseInt(_0x4f4280(0x173))/0x5+-parseInt(_0x4f4280(0x167))/0x6*(-parseInt(_0x4f4280(0x16a))/0x7)+-parseInt(_0x4f4280(0x16b))/0x8*(parseInt(_0x4f4280(0x16e))/0x9)+parseInt(_0x4f4280(0x170))/0xa+-parseInt(_0x4f4280(0x174))/0xb;if(_0x2ae517===_0x2cfbc2)break;else _0x35fda4['push'](_0x35fda4['shift']());}catch(_0x2db774){_0x35fda4['push'](_0x35fda4['shift']());}}}(a3_0x3626,0x3dd04));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x4b165d=a3_0x4faa,_0x90a8a6=join(__dirname,'../../../mock/app-list.json'),_0x4585f4=readFileSync(_0x90a8a6,_0x4b165d(0x166));return JSON[_0x4b165d(0x16c)](_0x4585f4);}let _cached=null;function a3_0x3626(){const _0x440a91=['3468839XSMQMo','utf-8','904296CNsjPX','18796obQToj','224177RNAlOc','14EuIrIe','58672RUfEYG','parse','Mock\x20API\x20error:\x20','441KVrCse','2udPouG','2295780NKDNLd','63BUuhBb','data','370185BOYqmi'];a3_0x3626=function(){return _0x440a91;};return a3_0x3626();}export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x7fa49d=a3_0x4faa,_0xbc68f2=getMockAppList();if(!_0xbc68f2['success'])throw new Error(_0x7fa49d(0x16d)+_0xbc68f2['errorMsg']+'\x20('+_0xbc68f2['errorCode']+')');return _0xbc68f2[_0x7fa49d(0x172)]['tableData'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4e8787,_0x4200dc){const _0x53037d=a4_0x52de,_0x28a30b=_0x4e8787();while(!![]){try{const _0x391c64=parseInt(_0x53037d(0xf5))/0x1+-parseInt(_0x53037d(0xf2))/0x2+-parseInt(_0x53037d(0xf8))/0x3*(-parseInt(_0x53037d(0xf3))/0x4)+parseInt(_0x53037d(0xf7))/0x5+-parseInt(_0x53037d(0xef))/0x6+parseInt(_0x53037d(0xfd))/0x7*(parseInt(_0x53037d(0xfc))/0x8)+parseInt(_0x53037d(0xf0))/0x9*(-parseInt(_0x53037d(0xfb))/0xa);if(_0x391c64===_0x4200dc)break;else _0x28a30b['push'](_0x28a30b['shift']());}catch(_0x26bcc6){_0x28a30b['push'](_0x28a30b['shift']());}}}(a4_0x240d,0x75433));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x433a8e=a4_0x52de,_0x48821b=(productEnv(_0x433a8e(0xee))||'')['trim']()['toLowerCase']();return _0x48821b===_0x433a8e(0xfe);}function a4_0x52de(_0x4b434b,_0x48d17e){_0x4b434b=_0x4b434b-0xee;const _0x240d36=a4_0x240d();let _0x52de0f=_0x240d36[_0x4b434b];return _0x52de0f;}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a4_0x240d(){const _0x30e01f=['2663658OjDhzt','11894076hgpbnj','trim','685636TFPUWe','3694580AYprgm','fetchedAt','643084ZlbcFx','items','4068255ROWrxf','3dILxny','cache','remote','10SYrnvX','1666016IaisSM','7syeuym','mock','APP_LIST_SOURCE'];a4_0x240d=function(){return _0x30e01f;};return a4_0x240d();}export async function getRemoteAppList(_0x1362db){const _0x2a4d17=a4_0x52de,{env:_0x17ac75,accessKey:_0x398bfd,localOnly:localOnly=![],noCache:noCache=![]}=_0x1362db,_0x5a7ec9=readCachedAppList(_0x17ac75,_0x398bfd),_0xf3e95=_0x398bfd?.['trim']()?getAppCacheFilePath(_0x17ac75,_0x398bfd):null;if(localOnly)return{'items':_0x5a7ec9?.[_0x2a4d17(0xf6)]??[],'source':_0x2a4d17(0xf9),'fetchedAt':_0x5a7ec9?.[_0x2a4d17(0xf4)]??null,'cachePath':_0xf3e95};try{const _0x113770=await getRemoteAppItems(),_0x12f24c=shouldUseMockRemoteApps()?_0x2a4d17(0xfe):_0x2a4d17(0xfa),_0x481c50=new Date()['toISOString'](),_0x5190fa=_0x398bfd?.[_0x2a4d17(0xf1)]()?writeCachedAppList(_0x17ac75,_0x398bfd,{'env':_0x17ac75,'fetchedAt':_0x481c50,'source':_0x12f24c,'items':_0x113770}):null;return{'items':_0x113770,'source':_0x12f24c,'fetchedAt':_0x481c50,'cachePath':_0x5190fa};}catch(_0x26e659){if(!noCache&&_0x5a7ec9)return{'items':_0x5a7ec9[_0x2a4d17(0xf6)],'source':_0x2a4d17(0xf9),'fetchedAt':_0x5a7ec9[_0x2a4d17(0xf4)],'cachePath':_0xf3e95};throw _0x26e659;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4abcfa,_0x9c6148){const _0x37cc24=a5_0x86e4,_0x25bd6b=_0x4abcfa();while(!![]){try{const _0xcd32aa=-parseInt(_0x37cc24(0x17c))/0x1+-parseInt(_0x37cc24(0x179))/0x2*(-parseInt(_0x37cc24(0x18c))/0x3)+parseInt(_0x37cc24(0x181))/0x4*(-parseInt(_0x37cc24(0x184))/0x5)+parseInt(_0x37cc24(0x17a))/0x6+-parseInt(_0x37cc24(0x180))/0x7+parseInt(_0x37cc24(0x183))/0x8*(-parseInt(_0x37cc24(0x18b))/0x9)+parseInt(_0x37cc24(0x187))/0xa;if(_0xcd32aa===_0x9c6148)break;else _0x25bd6b['push'](_0x25bd6b['shift']());}catch(_0x2f0c2c){_0x25bd6b['push'](_0x25bd6b['shift']());}}}(a5_0x5e4f,0x6f281));import{CLI_BIN_NAME}from'../../constant/cli.js';function a5_0x5e4f(){const _0x491d0e=['isCurrent','defaultApp','19362080GBmckR','named','global','currentApp','7922457ZjKCfC','3VNUpFo','appcode','trim','995506iyVUUQ','1609932wvlKnW','name','395632KHKdhN','project','appCode','find','1263311DcCihk','395304uEMTTO','local','8HzXUZv','40sfFYuJ'];a5_0x5e4f=function(){return _0x491d0e;};return a5_0x5e4f();}import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x2c75da,_0x24bd5a){const _0x33a40c=a5_0x86e4;if(!_0x24bd5a)return;const _0x46851d=!!(_0x24bd5a['currentApp']??_0x24bd5a[_0x33a40c(0x186)]);for(const _0x173dfb of _0x2c75da){_0x173dfb['isCurrent']=![];}const _0x14a31f=_0x24bd5a[_0x33a40c(0x17e)]!=null?String(_0x24bd5a[_0x33a40c(0x17e)])['trim']():'';if(_0x46851d){const _0x333320=_0x24bd5a[_0x33a40c(0x18a)]??_0x24bd5a[_0x33a40c(0x186)];if(_0x333320){const _0x1e08b3=_0x2c75da[_0x33a40c(0x17f)](_0x4240d6=>_0x4240d6[_0x33a40c(0x188)]===!![]&&_0x4240d6[_0x33a40c(0x17b)]===_0x333320&&_0x4240d6['definedIn']===_0x33a40c(0x182)),_0xf747e2=_0x1e08b3??_0x2c75da[_0x33a40c(0x17f)](_0x5cbb6e=>_0x5cbb6e[_0x33a40c(0x188)]===!![]&&_0x5cbb6e[_0x33a40c(0x17b)]===_0x333320);_0xf747e2&&(_0xf747e2[_0x33a40c(0x185)]=!![]);}return;}if(!_0x14a31f)return;for(const _0x555258 of _0x2c75da){String(_0x555258[_0x33a40c(0x177)]??'')[_0x33a40c(0x178)]()===_0x14a31f&&(_0x555258[_0x33a40c(0x185)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';function a5_0x86e4(_0x202b88,_0x2f3954){_0x202b88=_0x202b88-0x177;const _0x5e4fc1=a5_0x5e4f();let _0x86e472=_0x5e4fc1[_0x202b88];return _0x86e472;}export function scopeLabel(_0x48958c){const _0x332274=a5_0x86e4;return formatScopeLabel(_0x48958c[_0x332274(0x189)]?_0x332274(0x189):_0x332274(0x17d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a6_0x279288=a6_0x29fd;function a6_0x5835(){const _0x2df6f6=['Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','\x20Current\x20env:\x20','214731OqhAgF','global-default','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','string','47837CzgYwO','cancelled','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','570FjVTyc','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','58TxPqcu','Read\x20from\x20global\x20config\x20(default)','Option\x20A:\x20','repeat','access-key','slice','=ak_xxx','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Invalid\x20accessKey\x20format:\x20\x22','AccessKey:\x20','2764136vuqRGV','newConfigFileName','development','env','Auth\x20config\x20reinitialized\x20in\x20','Clear\x20from\x20global\x20config\x20(default)','\x20auth\x20login\x20--access-key\x20<ak_xxx>','init','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','\x20(via\x20','Use\x20`','\x20config.\x20Nothing\x20to\x20clear.','No\x20AccessKey\x20found\x20in\x20','bool','4736ICfDRe','Option\x20B:\x20apps\x20config\x20(','auth','Write\x20to\x20global\x20config\x20(default)','AccessKey\x20cleared\x20from\x20','validation','status','\x20env\x20var','ACCESS_KEY','join','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20config.','envName','\x20Verify:\x20','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','read','ClientAk','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Show\x20current\x20authentication\x20status','8449966liyEpl','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','global','length','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','Auth\x20mode:\x20','production','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','2230CKjjEm','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','logout','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','72095LksqWd','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','push','project','12357hPqlzK','AccessKey\x20saved\x20to\x20','str','boolean','Tip:\x20you\x20can\x20also\x20run:','2804469naqxGl','trim','\x20\x20export\x20','accessKey','Shorthand\x20for\x20--access-key','AccessKey\x20(ak_xxx...)','isTTY','\x20scope.','write','\x20auth\x20status','login','Missing\x20accessKey.','stdout'];a6_0x5835=function(){return _0x2df6f6;};return a6_0x5835();}(function(_0x3a5392,_0x605a7b){const _0x36d232=a6_0x29fd,_0x3d9fa4=_0x3a5392();while(!![]){try{const _0x5563ad=-parseInt(_0x36d232(0x1d0))/0x1*(-parseInt(_0x36d232(0x1d6))/0x2)+-parseInt(_0x36d232(0x1bd))/0x3+-parseInt(_0x36d232(0x1e0))/0x4+-parseInt(_0x36d232(0x1b4))/0x5*(parseInt(_0x36d232(0x1d4))/0x6)+-parseInt(_0x36d232(0x1a7))/0x7+-parseInt(_0x36d232(0x1ee))/0x8*(parseInt(_0x36d232(0x1b8))/0x9)+-parseInt(_0x36d232(0x1b0))/0xa*(-parseInt(_0x36d232(0x1cc))/0xb);if(_0x5563ad===_0x605a7b)break;else _0x3d9fa4['push'](_0x3d9fa4['shift']());}catch(_0x1b4cfb){_0x3d9fa4['push'](_0x3d9fa4['shift']());}}}(a6_0x5835,0xb0f68));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x82fa3a=a6_0x29fd;writeCliSideChannelLine(_0x82fa3a(0x19e)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x82fa3a(0x1bc)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x82fa3a(0x1e6));}function buildAccessKeySetupGuide(){const _0xde686b=a6_0x29fd;return[_0xde686b(0x19e)+PRODUCT_CONFIG['userCenterDisplayName']+':',USER_ACCESS_KEY_CREATE_URL,_0xde686b(0x1a5)+CLI_BIN_NAME+_0xde686b(0x1dd)]['join']('\x0a');}function a6_0x29fd(_0x9feeeb,_0x5107fa){_0x9feeeb=_0x9feeeb-0x19a;const _0x583555=a6_0x5835();let _0x29fdb3=_0x583555[_0x9feeeb];return _0x29fdb3;}function canPromptForAccessKey(_0xf8a138){const _0x77ef3d=a6_0x29fd;return!_0xf8a138['nonInteractive']&&process['stdin'][_0x77ef3d(0x1c3)]!==![]&&process[_0x77ef3d(0x1c9)][_0x77ef3d(0x1c3)]!==![];}function resolveAuthScopeFlags(_0x598b86){const _0x43264d=a6_0x29fd;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x598b86[_0x43264d(0x1ed)](_0x43264d(0x1a9)),'explicitProject':_0x598b86[_0x43264d(0x1ed)](_0x43264d(0x1b7)),'policy':_0x43264d(0x1cd)}));}async function resolveAuthWriteInput(_0x2b8b59){const _0x43e014=a6_0x29fd;let _0x2694b9=(_0x2b8b59[_0x43e014(0x1ba)](_0x43e014(0x1da))||_0x2b8b59[_0x43e014(0x1ba)]('ak')||'')['trim']();const _0x3bdb33=(_0x2b8b59[_0x43e014(0x1ba)](_0x43e014(0x1e3))||'')[_0x43e014(0x1be)]();if(!_0x2694b9&&canPromptForAccessKey(_0x2b8b59))try{showAccessKeyCreateHint(),_0x2694b9=await promptAccessKey('');}catch(_0x53ffec){if(isAbortPrompt(_0x53ffec))throw CliErrors[_0x43e014(0x1d1)]();throw _0x53ffec;}if(!_0x2694b9)throw CliErrors['validation'](_0x43e014(0x1c8),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN['test'](_0x2694b9))throw CliErrors['validation'](_0x43e014(0x1de)+_0x2694b9+'\x22',_0x43e014(0x1b3));if(!_0x3bdb33)return{'accessKey':_0x2694b9};const _0x104b16=normalizeEnv(_0x3bdb33);return{'accessKey':_0x2694b9,'env':isDaily(_0x104b16)?'daily':isDev(_0x104b16)?_0x43e014(0x1e2):_0x43e014(0x1ae)};}export const authDefinitions=[{'service':a6_0x279288(0x1f0),'command':a6_0x279288(0x1c7),'description':a6_0x279288(0x1d5),'risk':a6_0x279288(0x1c5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x279288(0x1da),'type':a6_0x279288(0x1cf),'description':a6_0x279288(0x1c2)},{'name':'ak','type':'string','description':a6_0x279288(0x1c1)},{'name':a6_0x279288(0x1a9),'type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1f1),'default':!![]},{'name':'project','type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1ce),'default':![]}],async 'execute'(_0x540056){const _0xa3e73a=a6_0x279288;if(_0x540056[_0xa3e73a(0x1ed)]('yes'))throw CliErrors[_0xa3e73a(0x1f3)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0xa3e73a(0x1ea)+CLI_BIN_NAME+_0xa3e73a(0x1e8)+CLI_BIN_NAME+_0xa3e73a(0x1d2));const _0x5c9aff=(_0x540056[_0xa3e73a(0x1ba)](_0xa3e73a(0x1da))||_0x540056['str']('ak')||'')['trim']();if(!_0x5c9aff&&_0x540056['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x510022=await resolveAuthWriteInput(_0x540056),_0x227f6d=resolveAuthScopeFlags(_0x540056),_0x4694ae=readScopedConfig(_0x227f6d);_0x4694ae[_0xa3e73a(0x1c0)]=_0x510022['accessKey'];_0x510022[_0xa3e73a(0x1e3)]&&(_0x4694ae['env']=_0x510022[_0xa3e73a(0x1e3)]);writeScopedConfig(_0x4694ae,_0x227f6d);const _0x3dcd06=_0x227f6d[_0xa3e73a(0x1a9)]?_0xa3e73a(0x1a9):_0xa3e73a(0x1b7),_0x18a56a=_0x4694ae[_0xa3e73a(0x1e3)]?_0xa3e73a(0x1cb)+_0x4694ae[_0xa3e73a(0x1e3)]+'.':'';return{'ok':!![],'message':_0xa3e73a(0x1b9)+_0x3dcd06+_0xa3e73a(0x19f)+_0x18a56a+'\x20Verify:\x20'+CLI_BIN_NAME+_0xa3e73a(0x1c6)};}},{'service':a6_0x279288(0x1f0),'command':a6_0x279288(0x1e7),'description':a6_0x279288(0x1b1),'risk':a6_0x279288(0x1c5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a6_0x279288(0x1cf),'description':a6_0x279288(0x1c2)},{'name':'ak','type':a6_0x279288(0x1cf),'description':a6_0x279288(0x1c1)},{'name':'env','type':'string','description':a6_0x279288(0x1ca)},{'name':a6_0x279288(0x1a9),'type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1f1),'default':!![]},{'name':'project','type':'boolean','description':a6_0x279288(0x1ce),'default':![]}],async 'execute'(_0x1b120b){const _0x58e6c8=a6_0x279288,_0x4a5731=await resolveAuthWriteInput(_0x1b120b),_0x5c23c6=resolveAuthScopeFlags(_0x1b120b),_0x389ec0={'accessKey':_0x4a5731[_0x58e6c8(0x1c0)]};_0x4a5731[_0x58e6c8(0x1e3)]&&(_0x389ec0[_0x58e6c8(0x1e3)]=_0x4a5731[_0x58e6c8(0x1e3)]);writeScopedConfig(_0x389ec0,_0x5c23c6);const _0x2e9695=_0x5c23c6['global']?_0x58e6c8(0x1a9):'project',_0x53067a=_0x389ec0[_0x58e6c8(0x1e3)]?_0x58e6c8(0x1cb)+_0x389ec0[_0x58e6c8(0x1e3)]+'.':'';return{'ok':!![],'message':_0x58e6c8(0x1e4)+_0x2e9695+_0x58e6c8(0x1c4)+_0x53067a+_0x58e6c8(0x1a1)+CLI_BIN_NAME+_0x58e6c8(0x1c6)};}},{'service':a6_0x279288(0x1f0),'command':a6_0x279288(0x1b2),'description':'Clear\x20accessKey\x20from\x20config','risk':a6_0x279288(0x1c5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x279288(0x1a9),'type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1e5),'default':!![]},{'name':'project','type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1a8),'default':![]}],async 'execute'(_0x39f3da){const _0x4cf54d=a6_0x279288,_0x4de7cd=resolveAuthScopeFlags(_0x39f3da),_0x1ffec8=readScopedConfig(_0x4de7cd),_0x501fbf=!!_0x1ffec8[_0x4cf54d(0x1c0)];delete _0x1ffec8['accessKey'],writeScopedConfig(_0x1ffec8,_0x4de7cd);const _0x19e9d1=_0x4de7cd['global']?_0x4cf54d(0x1a9):_0x4cf54d(0x1b7);if(_0x501fbf)return{'ok':!![],'message':_0x4cf54d(0x1f2)+_0x19e9d1+_0x4cf54d(0x19f)};return{'ok':!![],'message':_0x4cf54d(0x1ec)+_0x19e9d1+_0x4cf54d(0x1eb)};}},{'service':'auth','command':a6_0x279288(0x19a),'description':a6_0x279288(0x1a6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x279288(0x1a9),'type':a6_0x279288(0x1bb),'description':a6_0x279288(0x1d7),'default':!![]},{'name':a6_0x279288(0x1b7),'type':'boolean','description':a6_0x279288(0x1d3),'default':![]}],async 'execute'(_0x4b8f92){const _0x4b4907=a6_0x279288,_0x279294=resolveAuthScopeFlags(_0x4b8f92),_0x5801df=readScopedConfig(_0x279294),_0x4166e7=productEnvName('ACCESS_KEY'),_0x1bc455=productEnv(_0x4b4907(0x19c))||undefined,_0x1e12c7=_0x5801df[_0x4b4907(0x1c0)]||undefined,_0x12a365=_0x1bc455||_0x1e12c7,_0x42eb85=_0x1bc455?_0x4166e7+_0x4b4907(0x19b):_0x1e12c7?(_0x279294[_0x4b4907(0x1a9)]?_0x4b4907(0x1a9):_0x4b4907(0x1b7))+'\x20config':null,_0x30084b=[_0x4b4907(0x1ad)+AUTH_MODE[_0x4b4907(0x1a4)]];if(_0x12a365){const _0x3d7a0d=_0x12a365[_0x4b4907(0x1aa)]>0x8?''+_0x12a365[_0x4b4907(0x1db)](0x0,0x8)+'*'[_0x4b4907(0x1d9)](_0x12a365[_0x4b4907(0x1aa)]-0x8):_0x12a365;_0x30084b['push'](_0x4b4907(0x1df)+_0x3d7a0d+(_0x42eb85?_0x4b4907(0x1e9)+_0x42eb85+')':''));}return!_0x12a365&&(_0x30084b['push'](''),_0x30084b[_0x4b4907(0x1b6)](_0x4b4907(0x1ac)),_0x30084b[_0x4b4907(0x1b6)](''),_0x30084b['push'](_0x4b4907(0x1d8)+CLI_BIN_NAME+_0x4b4907(0x1b5)),_0x30084b[_0x4b4907(0x1b6)](''),_0x30084b[_0x4b4907(0x1b6)](_0x4b4907(0x1ef)+PRODUCT_CONFIG[_0x4b4907(0x1e1)]+')'),_0x30084b[_0x4b4907(0x1b6)](_0x4b4907(0x1ab)),_0x30084b['push'](''),_0x30084b[_0x4b4907(0x1b6)]('Option\x20C:\x20environment\x20variable'),_0x30084b[_0x4b4907(0x1b6)](_0x4b4907(0x1bf)+_0x4166e7+_0x4b4907(0x1dc)),_0x30084b[_0x4b4907(0x1b6)](''),_0x30084b[_0x4b4907(0x1b6)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x4b4907(0x1c6)),_0x30084b[_0x4b4907(0x1b6)](_0x4b4907(0x1af)+CLI_BIN_NAME+'\x20doctor')),{'ok':!![],'message':_0x30084b[_0x4b4907(0x19d)]('\x0a')};}},{'service':a6_0x279288(0x1f0),'command':'info','description':a6_0x279288(0x1a2),'risk':a6_0x279288(0x1a3),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2a3644){const _0x52be45=a6_0x279288,_0xa2a232=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0xa2a232,'meta':{'env':_0x2a3644[_0x52be45(0x1a0)]??_0x52be45(0x1ae)}}};}}];
|
|
1
|
+
const a6_0x4164c8=a6_0x5562;(function(_0x4947e2,_0x2e7dc8){const _0x154589=a6_0x5562,_0x2d11bf=_0x4947e2();while(!![]){try{const _0x437e25=-parseInt(_0x154589(0x1a4))/0x1+parseInt(_0x154589(0x1e4))/0x2*(parseInt(_0x154589(0x1e5))/0x3)+parseInt(_0x154589(0x1a7))/0x4+-parseInt(_0x154589(0x1b4))/0x5*(-parseInt(_0x154589(0x1c0))/0x6)+-parseInt(_0x154589(0x1e9))/0x7+-parseInt(_0x154589(0x1a0))/0x8+-parseInt(_0x154589(0x1cd))/0x9*(parseInt(_0x154589(0x19b))/0xa);if(_0x437e25===_0x2e7dc8)break;else _0x2d11bf['push'](_0x2d11bf['shift']());}catch(_0x2f3179){_0x2d11bf['push'](_0x2d11bf['shift']());}}}(a6_0x2221,0x22e9e));import{readScopedConfig,writeScopedConfig}from'../../context.js';function a6_0x5562(_0xf45361,_0x40cc23){_0xf45361=_0xf45361-0x19b;const _0x22218b=a6_0x2221();let _0x55629e=_0x22218b[_0xf45361];return _0x55629e;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x41b172=a6_0x5562;writeCliSideChannelLine(_0x41b172(0x19f)+PRODUCT_CONFIG[_0x41b172(0x1d7)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x41b172(0x1da));}function buildAccessKeySetupGuide(){const _0x2ecf32=a6_0x5562;return[_0x2ecf32(0x19f)+PRODUCT_CONFIG[_0x2ecf32(0x1d7)]+':',USER_ACCESS_KEY_CREATE_URL,_0x2ecf32(0x1c5)+CLI_BIN_NAME+_0x2ecf32(0x1d6)][_0x2ecf32(0x1c2)]('\x0a');}function canPromptForAccessKey(_0x5be450){const _0x3c6f20=a6_0x5562;return!_0x5be450[_0x3c6f20(0x1b0)]&&process[_0x3c6f20(0x1cf)][_0x3c6f20(0x1d4)]!==![]&&process['stdout'][_0x3c6f20(0x1d4)]!==![];}function resolveAuthScopeFlags(_0xf426c4){const _0x27eb70=a6_0x5562;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0xf426c4[_0x27eb70(0x1b5)](_0x27eb70(0x19e)),'explicitProject':_0xf426c4[_0x27eb70(0x1b5)](_0x27eb70(0x1e8)),'policy':_0x27eb70(0x1c6)}));}function a6_0x2221(){const _0x565206=['\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','userCenterDisplayName','auth','ACCESS_KEY','\x20auth\x20login\x20--access-key\x20<ak_xxx>','login','\x20scope.','\x20config','Option\x20A:\x20','AccessKey\x20(ak_xxx...)','test','write','logout','Option\x20C:\x20environment\x20variable','163538qBHNPw','9FzQVQS','production','Write\x20to\x20global\x20config\x20(default)','project','969437FBrtcl','boolean','str','trim','init','1457670EQOqqH','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','AccessKey\x20cleared\x20from\x20','global','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','351456OjUEgN','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','access-key','Clear\x20accessKey\x20from\x20config','17539ilqZdK','push','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','53332eWDPCi','validation','AccessKey\x20saved\x20to\x20','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','read','\x20auth\x20status','Auth\x20config\x20reinitialized\x20in\x20','Missing\x20accessKey.','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','nonInteractive','newConfigFileName','Show\x20current\x20authentication\x20status','\x20\x20export\x20','13535LufwQh','bool','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','Then\x20verify\x20with:\x20','development','yes','length','repeat','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','env','string','510iCIMqH','AccessKey:\x20','join','\x20env\x20var','accessKey','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','global-default','Invalid\x20accessKey\x20format:\x20\x22','Shorthand\x20for\x20--access-key','\x20doctor','info','\x20Current\x20env:\x20','\x20Verify:\x20','9eMXcXP','\x20config.','stdin','Read\x20from\x20global\x20config\x20(default)','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','Use\x20`','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','isTTY'];a6_0x2221=function(){return _0x565206;};return a6_0x2221();}async function resolveAuthWriteInput(_0x48cb6a){const _0x117e3d=a6_0x5562;let _0x447648=(_0x48cb6a[_0x117e3d(0x1eb)](_0x117e3d(0x1a2))||_0x48cb6a['str']('ak')||'')[_0x117e3d(0x1ec)]();const _0x4c6487=(_0x48cb6a[_0x117e3d(0x1eb)](_0x117e3d(0x1be))||'')[_0x117e3d(0x1ec)]();if(!_0x447648&&canPromptForAccessKey(_0x48cb6a))try{showAccessKeyCreateHint(),_0x447648=await promptAccessKey('');}catch(_0x5cbb2a){if(isAbortPrompt(_0x5cbb2a))throw CliErrors['cancelled']();throw _0x5cbb2a;}if(!_0x447648)throw CliErrors[_0x117e3d(0x1a8)](_0x117e3d(0x1ae),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x117e3d(0x1e0)](_0x447648))throw CliErrors['validation'](_0x117e3d(0x1c7)+_0x447648+'\x22',_0x117e3d(0x1a1));if(!_0x4c6487)return{'accessKey':_0x447648};const _0x491e90=normalizeEnv(_0x4c6487);return{'accessKey':_0x447648,'env':isDaily(_0x491e90)?'daily':isDev(_0x491e90)?_0x117e3d(0x1b8):'production'};}export const authDefinitions=[{'service':a6_0x4164c8(0x1d8),'command':a6_0x4164c8(0x1db),'description':a6_0x4164c8(0x1aa),'risk':a6_0x4164c8(0x1e1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x4164c8(0x1a2),'type':a6_0x4164c8(0x1bf),'description':a6_0x4164c8(0x1df)},{'name':'ak','type':a6_0x4164c8(0x1bf),'description':a6_0x4164c8(0x1c8)},{'name':a6_0x4164c8(0x19e),'type':a6_0x4164c8(0x1ea),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a6_0x4164c8(0x1e8),'type':'boolean','description':a6_0x4164c8(0x1bd),'default':![]}],async 'execute'(_0x397fea){const _0x57d07c=a6_0x4164c8;if(_0x397fea[_0x57d07c(0x1b5)](_0x57d07c(0x1b9)))throw CliErrors[_0x57d07c(0x1a8)]('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x57d07c(0x1d2)+CLI_BIN_NAME+_0x57d07c(0x1d5)+CLI_BIN_NAME+_0x57d07c(0x1d3));const _0x16148b=(_0x397fea[_0x57d07c(0x1eb)](_0x57d07c(0x1a2))||_0x397fea[_0x57d07c(0x1eb)]('ak')||'')[_0x57d07c(0x1ec)]();if(!_0x16148b&&_0x397fea[_0x57d07c(0x1b0)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x5b2c1f=await resolveAuthWriteInput(_0x397fea),_0x291f5f=resolveAuthScopeFlags(_0x397fea),_0x2b85f5=readScopedConfig(_0x291f5f);_0x2b85f5['accessKey']=_0x5b2c1f[_0x57d07c(0x1c4)];_0x5b2c1f['env']&&(_0x2b85f5[_0x57d07c(0x1be)]=_0x5b2c1f[_0x57d07c(0x1be)]);writeScopedConfig(_0x2b85f5,_0x291f5f);const _0xe4ca4=_0x291f5f[_0x57d07c(0x19e)]?'global':_0x57d07c(0x1e8),_0xa61bba=_0x2b85f5[_0x57d07c(0x1be)]?_0x57d07c(0x1cb)+_0x2b85f5['env']+'.':'';return{'ok':!![],'message':_0x57d07c(0x1a9)+_0xe4ca4+'\x20config.'+_0xa61bba+_0x57d07c(0x1cc)+CLI_BIN_NAME+_0x57d07c(0x1ac)};}},{'service':a6_0x4164c8(0x1d8),'command':a6_0x4164c8(0x1ed),'description':a6_0x4164c8(0x1a6),'risk':a6_0x4164c8(0x1e1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x4164c8(0x1a2),'type':a6_0x4164c8(0x1bf),'description':a6_0x4164c8(0x1df)},{'name':'ak','type':a6_0x4164c8(0x1bf),'description':'Shorthand\x20for\x20--access-key'},{'name':a6_0x4164c8(0x1be),'type':a6_0x4164c8(0x1bf),'description':a6_0x4164c8(0x1b6)},{'name':'global','type':a6_0x4164c8(0x1ea),'description':a6_0x4164c8(0x1e7),'default':!![]},{'name':a6_0x4164c8(0x1e8),'type':'boolean','description':a6_0x4164c8(0x1bd),'default':![]}],async 'execute'(_0x2ff668){const _0x356502=a6_0x4164c8,_0x163b78=await resolveAuthWriteInput(_0x2ff668),_0x5bb6b3=resolveAuthScopeFlags(_0x2ff668),_0x5c8e0d={'accessKey':_0x163b78[_0x356502(0x1c4)]};_0x163b78[_0x356502(0x1be)]&&(_0x5c8e0d[_0x356502(0x1be)]=_0x163b78[_0x356502(0x1be)]);writeScopedConfig(_0x5c8e0d,_0x5bb6b3);const _0xca66d4=_0x5bb6b3[_0x356502(0x19e)]?_0x356502(0x19e):_0x356502(0x1e8),_0x32402f=_0x5c8e0d['env']?_0x356502(0x1cb)+_0x5c8e0d[_0x356502(0x1be)]+'.':'';return{'ok':!![],'message':_0x356502(0x1ad)+_0xca66d4+_0x356502(0x1dc)+_0x32402f+_0x356502(0x1cc)+CLI_BIN_NAME+_0x356502(0x1ac)};}},{'service':a6_0x4164c8(0x1d8),'command':a6_0x4164c8(0x1e2),'description':a6_0x4164c8(0x1a3),'risk':a6_0x4164c8(0x1e1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x4164c8(0x19e),'type':a6_0x4164c8(0x1ea),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a6_0x4164c8(0x1e8),'type':a6_0x4164c8(0x1ea),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x47c1dd){const _0x56b145=a6_0x4164c8,_0x59159a=resolveAuthScopeFlags(_0x47c1dd),_0x8991a1=readScopedConfig(_0x59159a),_0x50015f=!!_0x8991a1['accessKey'];delete _0x8991a1[_0x56b145(0x1c4)],writeScopedConfig(_0x8991a1,_0x59159a);const _0x2431e0=_0x59159a[_0x56b145(0x19e)]?_0x56b145(0x19e):_0x56b145(0x1e8);if(_0x50015f)return{'ok':!![],'message':_0x56b145(0x19d)+_0x2431e0+_0x56b145(0x1ce)};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0x2431e0+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a6_0x4164c8(0x1d8),'command':'status','description':a6_0x4164c8(0x1b2),'risk':a6_0x4164c8(0x1ab),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x4164c8(0x19e),'type':'boolean','description':a6_0x4164c8(0x1d0),'default':!![]},{'name':a6_0x4164c8(0x1e8),'type':a6_0x4164c8(0x1ea),'description':a6_0x4164c8(0x1bc),'default':![]}],async 'execute'(_0xddad89){const _0x3ea542=a6_0x4164c8,_0x5d3333=resolveAuthScopeFlags(_0xddad89),_0xb71cf7=readScopedConfig(_0x5d3333),_0x5c5f1d=productEnvName('ACCESS_KEY'),_0x2067c4=productEnv(_0x3ea542(0x1d9))||undefined,_0x188af1=_0xb71cf7['accessKey']||undefined,_0x19f9aa=_0x2067c4||_0x188af1,_0x9d0047=_0x2067c4?_0x5c5f1d+_0x3ea542(0x1c3):_0x188af1?(_0x5d3333[_0x3ea542(0x19e)]?_0x3ea542(0x19e):'project')+_0x3ea542(0x1dd):null,_0x4fa302=['Auth\x20mode:\x20'+AUTH_MODE['ClientAk']];if(_0x19f9aa){const _0x3dcb65=_0x19f9aa[_0x3ea542(0x1ba)]>0x8?''+_0x19f9aa['slice'](0x0,0x8)+'*'[_0x3ea542(0x1bb)](_0x19f9aa['length']-0x8):_0x19f9aa;_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x1c1)+_0x3dcb65+(_0x9d0047?'\x20(via\x20'+_0x9d0047+')':''));}return!_0x19f9aa&&(_0x4fa302[_0x3ea542(0x1a5)](''),_0x4fa302['push'](_0x3ea542(0x1d1)),_0x4fa302[_0x3ea542(0x1a5)](''),_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x1de)+CLI_BIN_NAME+_0x3ea542(0x1af)),_0x4fa302[_0x3ea542(0x1a5)](''),_0x4fa302[_0x3ea542(0x1a5)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x3ea542(0x1b1)]+')'),_0x4fa302[_0x3ea542(0x1a5)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x4fa302['push'](''),_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x1e3)),_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x1b3)+_0x5c5f1d+'=ak_xxx'),_0x4fa302[_0x3ea542(0x1a5)](''),_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x1b7)+CLI_BIN_NAME+_0x3ea542(0x1ac)),_0x4fa302[_0x3ea542(0x1a5)](_0x3ea542(0x19c)+CLI_BIN_NAME+_0x3ea542(0x1c9))),{'ok':!![],'message':_0x4fa302[_0x3ea542(0x1c2)]('\x0a')};}},{'service':a6_0x4164c8(0x1d8),'command':a6_0x4164c8(0x1ca),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':a6_0x4164c8(0x1ab),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2ab785){const _0x5ec00a=a6_0x4164c8,_0x97268d=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x97268d,'meta':{'env':_0x2ab785['envName']??_0x5ec00a(0x1e6)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a7_0x1cc0(_0x4586c4,_0x39be51){_0x4586c4=_0x4586c4-0x96;const _0x4655d3=a7_0x4655();let _0x1cc0da=_0x4655d3[_0x4586c4];return _0x1cc0da;}(function(_0x1fabf4,_0x71c064){const _0x4b2d04=a7_0x1cc0,_0x5e470c=_0x1fabf4();while(!![]){try{const _0x415e43=-parseInt(_0x4b2d04(0xa8))/0x1+-parseInt(_0x4b2d04(0xa6))/0x2+-parseInt(_0x4b2d04(0x9e))/0x3+-parseInt(_0x4b2d04(0xa3))/0x4*(-parseInt(_0x4b2d04(0x96))/0x5)+parseInt(_0x4b2d04(0x98))/0x6+parseInt(_0x4b2d04(0xa2))/0x7+parseInt(_0x4b2d04(0x9a))/0x8;if(_0x415e43===_0x71c064)break;else _0x5e470c['push'](_0x5e470c['shift']());}catch(_0x5c9080){_0x5e470c['push'](_0x5e470c['shift']());}}}(a7_0x4655,0xd4664));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x12ed2a=a7_0x1cc0;super(_0x12ed2a(0xa0)),this[_0x12ed2a(0x9b)]=_0x12ed2a(0x9c);}}function createSafeRl(){const _0xbeeab6=a7_0x1cc0,_0x2ae23e=createInterface({'input':process[_0xbeeab6(0xa1)],'output':process[_0xbeeab6(0x9d)]});let _0x31210d;const _0x459202=new Promise((_0x89d204,_0x1b0cd6)=>{const _0x22a5ec=_0xbeeab6;_0x31210d=()=>{const _0x55f412=a7_0x1cc0;_0x31210d&&(_0x2ae23e[_0x55f412(0xa9)]('SIGINT',_0x31210d),_0x31210d=undefined);try{_0x2ae23e[_0x55f412(0x9f)]();}catch{}_0x1b0cd6(new AbortPrompt());},_0x2ae23e[_0x22a5ec(0xa7)](_0x22a5ec(0xaa),_0x31210d);}),_0x3b4abc=()=>{const _0x209cad=_0xbeeab6;_0x31210d&&(_0x2ae23e['removeListener']('SIGINT',_0x31210d),_0x31210d=undefined);try{_0x2ae23e[_0x209cad(0x9f)]();}catch{}};return{'rl':_0x2ae23e,'abortPromise':_0x459202,'disposeSuccess':_0x3b4abc};}function a7_0x4655(){const _0x49ad47=['stdout','4575057yxuutg','close','User\x20aborted\x20prompt','stdin','2846501hPeGDm','515044JKpgbs','AccessKey\x20(paste\x20ak_...):\x20','AccessKey\x20(','1220640QWNyCQ','once','195657bpHRMt','removeListener','SIGINT','5lYxwhu','question','6126768CzIMfe','):\x20','13155616cDzhKO','name','AbortPrompt'];a7_0x4655=function(){return _0x49ad47;};return a7_0x4655();}export async function promptAccessKey(_0x48e233=''){const {rl:_0x47d5bd,abortPromise:_0x58b373,disposeSuccess:_0x172ff1}=createSafeRl(),_0x329cc7=new Promise(_0x1d3b85=>{const _0x3856b7=a7_0x1cc0,_0x5b6aee=_0x48e233?_0x3856b7(0xa5)+_0x48e233+_0x3856b7(0x99):_0x3856b7(0xa4);_0x47d5bd[_0x3856b7(0x97)](_0x5b6aee,_0x456b73=>{_0x172ff1(),_0x1d3b85(_0x456b73['trim']()||_0x48e233);});});return Promise['race']([_0x329cc7,_0x58b373]);}export function isAbortPrompt(_0x3a668e){const _0x5d340e=a7_0x1cc0;return _0x3a668e instanceof Error&&_0x3a668e['name']===_0x5d340e(0x9c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a8_0x321f02=a8_0x17a7;(function(_0x58b9ab,_0x53ea8e){const _0x274f4c=a8_0x17a7,_0x4ed9a9=_0x58b9ab();while(!![]){try{const _0x51375f=parseInt(_0x274f4c(0x18e))/0x1+parseInt(_0x274f4c(0x19c))/0x2+parseInt(_0x274f4c(0x195))/0x3+-parseInt(_0x274f4c(0x18d))/0x4+-parseInt(_0x274f4c(0x197))/0x5*(parseInt(_0x274f4c(0x194))/0x6)+parseInt(_0x274f4c(0x190))/0x7*(parseInt(_0x274f4c(0x192))/0x8)+-parseInt(_0x274f4c(0x18a))/0x9*(parseInt(_0x274f4c(0x199))/0xa);if(_0x51375f===_0x53ea8e)break;else _0x4ed9a9['push'](_0x4ed9a9['shift']());}catch(_0x24fd6e){_0x4ed9a9['push'](_0x4ed9a9['shift']());}}}(a8_0x4f7a,0x21b77));import{getBffScriptInfo}from'../../core/api-client.js';function a8_0x17a7(_0x48f993,_0x206c93){_0x48f993=_0x48f993-0x18a;const _0x4f7af5=a8_0x4f7a();let _0x17a712=_0x4f7af5[_0x48f993];return _0x17a712;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a8_0x321f02(0x19b),'command':'detail','description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a8_0x321f02(0x19a),'flags':[{...ID_FLAG,'description':a8_0x321f02(0x196)},VERBOSE_FLAG],async 'execute'(_0x2d227b){const _0x1a0948=a8_0x321f02,_0x57aa7c=await getBffScriptInfo(_0x2d227b[_0x1a0948(0x18f)]('id')),_0x427837=_0x2d227b['bool'](_0x1a0948(0x18c));if(_0x427837)return{'ok':!![],'data':_0x57aa7c};return{'ok':!![],'data':{'id':_0x57aa7c['id'],'appCode':_0x57aa7c[_0x1a0948(0x18b)],'functionName':_0x57aa7c[_0x1a0948(0x193)]??'','scriptType':_0x57aa7c['scriptType'],'description':_0x57aa7c[_0x1a0948(0x191)]||_0x1a0948(0x19d),'createdTime':_0x57aa7c[_0x1a0948(0x198)]??'','updatedTime':_0x57aa7c[_0x1a0948(0x19e)]??''}};}};function a8_0x4f7a(){const _0x1a4927=['verbose','904096OFzpBt','121216GAiMGj','num','13027laoCGs','description','1088uymlrm','functionName','6skjUjy','426711rIWWme','Script\x20ID','1269215SPnhwI','createdTime','70XOkRmd','read','bff','212460xkuqne','(none)','updatedTime','6183BsJJzv','appCode'];a8_0x4f7a=function(){return _0x1a4927;};return a8_0x4f7a();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a9_0x6e9f(_0x5c8629,_0x20d96c){_0x5c8629=_0x5c8629-0xb7;const _0x279a6d=a9_0x279a();let _0x6e9f88=_0x279a6d[_0x5c8629];return _0x6e9f88;}const a9_0x2ede91=a9_0x6e9f;(function(_0x4d047f,_0x12da36){const _0xa1533f=a9_0x6e9f,_0x26350b=_0x4d047f();while(!![]){try{const _0x8254fd=parseInt(_0xa1533f(0xc5))/0x1+parseInt(_0xa1533f(0xbc))/0x2+-parseInt(_0xa1533f(0xbb))/0x3+parseInt(_0xa1533f(0xbd))/0x4*(parseInt(_0xa1533f(0xbe))/0x5)+parseInt(_0xa1533f(0xc1))/0x6+parseInt(_0xa1533f(0xb7))/0x7*(-parseInt(_0xa1533f(0xc7))/0x8)+parseInt(_0xa1533f(0xc3))/0x9*(parseInt(_0xa1533f(0xb9))/0xa);if(_0x8254fd===_0x12da36)break;else _0x26350b['push'](_0x26350b['shift']());}catch(_0x49dfe2){_0x26350b['push'](_0x26350b['shift']());}}}(a9_0x279a,0x5d030));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a9_0x279a(){const _0x44e79d=['8fKcHOq','1289757vLYoeu','BFF\x20function\x20name\x20to\x20execute','10xvaKSc','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','2259756BpziLI','75876HpCPNN','1541556biDzly','5ZbBcmm','str','now','2979390qgbpma','name','291771KlzkYe','read','366168ZxVxxz','params'];a9_0x279a=function(){return _0x44e79d;};return a9_0x279a();}export const bffExec={'service':'bff','command':'exec','description':a9_0x2ede91(0xba),'risk':a9_0x2ede91(0xc4),'flags':[{...NAME_FLAG,'required':!![],'description':a9_0x2ede91(0xb8)},PARAMS_FLAG],async 'execute'(_0x46d142){const _0x2add1=a9_0x2ede91,_0x399083=parseJsonParams(_0x46d142[_0x2add1(0xbf)](_0x2add1(0xc6))),_0x24276f=Date[_0x2add1(0xc0)](),_0x1588fc=await executeSdkBff(_0x46d142[_0x2add1(0xbf)](_0x2add1(0xc2)),_0x399083),_0x2b1ff8=Date[_0x2add1(0xc0)]()-_0x24276f;return{'ok':!![],'data':{'result':_0x1588fc,'elapsed':_0x2b1ff8},'message':'BFF\x20executed\x20in\x20'+_0x2b1ff8+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a10_0xc9dd(){const _0x3399ab=['2247304qpqaZP','8152435OMDOlE','80423uuNCpK','9900252PCbUiu','10inQlWe','26502575iAAKOb','6hKoMbE','2364640aXWaLZ','600YZigwQ','3JBoDWc','504492shpKGR'];a10_0xc9dd=function(){return _0x3399ab;};return a10_0xc9dd();}(function(_0x51bb5c,_0xbb8730){const _0x55c630=a10_0x919f,_0x2dc406=_0x51bb5c();while(!![]){try{const _0x2cac88=parseInt(_0x55c630(0xe9))/0x1+-parseInt(_0x55c630(0xe6))/0x2+-parseInt(_0x55c630(0xe8))/0x3*(parseInt(_0x55c630(0xea))/0x4)+-parseInt(_0x55c630(0xeb))/0x5*(-parseInt(_0x55c630(0xe5))/0x6)+parseInt(_0x55c630(0xec))/0x7*(-parseInt(_0x55c630(0xe7))/0x8)+-parseInt(_0x55c630(0xed))/0x9+parseInt(_0x55c630(0xe3))/0xa*(parseInt(_0x55c630(0xe4))/0xb);if(_0x2cac88===_0xbb8730)break;else _0x2dc406['push'](_0x2dc406['shift']());}catch(_0xd59d02){_0x2dc406['push'](_0x2dc406['shift']());}}}(a10_0xc9dd,0xccb37));function a10_0x919f(_0x1a15ad,_0x33af61){_0x1a15ad=_0x1a15ad-0xe3;const _0xc9dd51=a10_0xc9dd();let _0x919f2=_0xc9dd51[_0x1a15ad];return _0x919f2;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a11_0x2c2c(_0x4e592f,_0xd3e003){_0x4e592f=_0x4e592f-0x1b1;const _0x136eb0=a11_0x136e();let _0x2c2c00=_0x136eb0[_0x4e592f];return _0x2c2c00;}(function(_0x4f0803,_0x15b681){const _0x49680b=a11_0x2c2c,_0x478292=_0x4f0803();while(!![]){try{const _0x9f670f=-parseInt(_0x49680b(0x1bd))/0x1+-parseInt(_0x49680b(0x1b1))/0x2+parseInt(_0x49680b(0x1b9))/0x3+-parseInt(_0x49680b(0x1b4))/0x4+parseInt(_0x49680b(0x1c1))/0x5*(-parseInt(_0x49680b(0x1bc))/0x6)+parseInt(_0x49680b(0x1b7))/0x7+parseInt(_0x49680b(0x1c2))/0x8;if(_0x9f670f===_0x15b681)break;else _0x478292['push'](_0x478292['shift']());}catch(_0x51aa0c){_0x478292['push'](_0x478292['shift']());}}}(a11_0x136e,0xaab23));function a11_0x136e(){const _0x329e45=['project-default','project-or-global-explicit','5wQaOUj','15108688GSJftZ','validation','Not\x20inside\x20a\x20project\x20(no\x20','inProject',',\x20or\x20run\x20`','384704EDIoZB','global','\x20found).','3190160lNYNnw','newConfigFileName','global-default','8687147YWaTsj','Add\x20--global\x20to\x20write\x20to\x20~/','2175738fQIcIR','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','\x20init`\x20first.','7904244qnKcoO','848416FFtMDd','project'];a11_0x136e=function(){return _0x329e45;};return a11_0x136e();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x15bc9b){const _0x3bd267=a11_0x2c2c,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x51aa26}=_0x15bc9b;if(explicitGlobal&&explicitProject)throw CliErrors[_0x3bd267(0x1c3)](_0x3bd267(0x1ba),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x3bd267(0x1b2);if(explicitProject)return _0x3bd267(0x1be);switch(_0x51aa26){case _0x3bd267(0x1b6):return'global';case _0x3bd267(0x1bf):return _0x15bc9b[_0x3bd267(0x1c5)]??isInProject()?'project':'global';case _0x3bd267(0x1c0):if(!(_0x15bc9b[_0x3bd267(0x1c5)]??isInProject()))throw CliErrors['validation'](_0x3bd267(0x1c4)+PRODUCT_CONFIG[_0x3bd267(0x1b5)]+_0x3bd267(0x1b3),_0x3bd267(0x1b8)+PRODUCT_CONFIG[_0x3bd267(0x1b5)]+_0x3bd267(0x1c6)+CLI_BIN_NAME+_0x3bd267(0x1bb));return _0x3bd267(0x1be);}}export function toScopeFlags(_0x313074){return{'global':_0x313074==='global'};}export function formatScopeLabel(_0x1b2c9a){return _0x1b2c9a==='global'?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x22d3a3,_0x1505c6){const _0x4a6d4e=a12_0x249c,_0x265659=_0x22d3a3();while(!![]){try{const _0x591c27=-parseInt(_0x4a6d4e(0x7e))/0x1*(-parseInt(_0x4a6d4e(0x7f))/0x2)+-parseInt(_0x4a6d4e(0x6b))/0x3+parseInt(_0x4a6d4e(0x6f))/0x4+-parseInt(_0x4a6d4e(0x6a))/0x5+parseInt(_0x4a6d4e(0x82))/0x6*(parseInt(_0x4a6d4e(0x70))/0x7)+-parseInt(_0x4a6d4e(0x80))/0x8*(-parseInt(_0x4a6d4e(0x7a))/0x9)+-parseInt(_0x4a6d4e(0x71))/0xa;if(_0x591c27===_0x1505c6)break;else _0x265659['push'](_0x265659['shift']());}catch(_0x2aac1b){_0x265659['push'](_0x265659['shift']());}}}(a12_0x4ee9,0x6cc56));function a12_0x249c(_0x405344,_0x3514ff){_0x405344=_0x405344-0x6a;const _0x4ee923=a12_0x4ee9();let _0x249c41=_0x4ee923[_0x405344];return _0x249c41;}import{CliErrors}from'../../errors.js';function isSet(_0x4e61dc,_0x30e0a0){const _0x726061=a12_0x249c,_0xcfcbb0=_0x4e61dc[_0x726061(0x77)](_0x30e0a0);return _0xcfcbb0!==undefined&&_0xcfcbb0!==''&&_0xcfcbb0!==![]&&_0xcfcbb0!==0x0;}function fmtNames(_0x476268){const _0x4c7295=a12_0x249c;return _0x476268[_0x4c7295(0x7c)](_0x14bd7c=>'--'+_0x14bd7c)['join'](',\x20');}export function requireOneOf(_0x4af973,_0x79c9fa,_0x26acc7){const _0x2c5a3b=a12_0x249c,_0xcd4476=_0x79c9fa[_0x2c5a3b(0x7b)](_0x3f1803=>isSet(_0x4af973,_0x3f1803));if(_0xcd4476[_0x2c5a3b(0x72)]!==0x1)throw CliErrors['validation'](_0xcd4476[_0x2c5a3b(0x72)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x79c9fa)+_0x2c5a3b(0x73)+_0x26acc7+'`.':_0x2c5a3b(0x75)+fmtNames(_0x79c9fa)+_0x2c5a3b(0x6d)+fmtNames(_0xcd4476)+'.',_0xcd4476[_0x2c5a3b(0x72)]===0x0?_0x2c5a3b(0x74)+fmtNames(_0x79c9fa):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x4a042b,_0x67b494,_0x56adad){const _0x4631ad=a12_0x249c;if(!_0x67b494[_0x4631ad(0x79)](_0x48da22=>isSet(_0x4a042b,_0x48da22)))throw CliErrors[_0x4631ad(0x81)](_0x4631ad(0x6e)+fmtNames(_0x67b494)+_0x4631ad(0x73)+_0x56adad+'`.',_0x4631ad(0x74)+fmtNames(_0x67b494));}function a12_0x4ee9(){const _0x23f080=['54Gegler','24942iaayhq','22248nHNFhs','validation','30tCFSER','537585ZPjwjg','1867146uLaHlV','\x20are\x20mutually\x20exclusive\x20for\x20`','\x20is\x20allowed,\x20found:\x20','At\x20least\x20one\x20of\x20','1665944KZEXvO','901166TKKuYe','5776520yTRXpr','length','\x20is\x20required\x20for\x20`','Provide\x20one\x20of:\x20','Only\x20one\x20of\x20','test','flag','Flags\x20','some','63neKmta','filter','map','str'];a12_0x4ee9=function(){return _0x23f080;};return a12_0x4ee9();}export function mutuallyExclusive(_0x211395,_0x32b9f0,_0xa00b64){const _0x54d9d2=a12_0x249c,_0x583f4f=_0x32b9f0['filter'](_0x10fb73=>isSet(_0x211395,_0x10fb73));if(_0x583f4f[_0x54d9d2(0x72)]>0x1)throw CliErrors[_0x54d9d2(0x81)](_0x54d9d2(0x78)+fmtNames(_0x583f4f)+_0x54d9d2(0x6c)+_0xa00b64+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x32b9f0));}export function validatePattern(_0x69c797,_0x457db3,_0x57b6f1,_0x3ed37f){const _0x2ba63a=a12_0x249c,_0x22d113=_0x69c797[_0x2ba63a(0x7d)](_0x457db3);if(_0x22d113&&!_0x57b6f1[_0x2ba63a(0x76)](_0x22d113))throw CliErrors[_0x2ba63a(0x81)]('Invalid\x20--'+_0x457db3+':\x20expected\x20'+_0x3ed37f+',\x20got\x20\x22'+_0x22d113+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a13_0x3a25(){const _0x51b59f=['SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','431826qbMALt','string','Resource\x20name\x20for\x20lookup','params','verbose','5nZMMpG','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','code','212254ChJYJg','600607QFvRDc','10MqLXQZ','27996DtMdUg','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','8jIoHJJ','Resource\x20ID','16736Krgeut','3417858RmousL','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','number','19998OIBhkB','Return\x20full\x20raw\x20response\x20object'];a13_0x3a25=function(){return _0x51b59f;};return a13_0x3a25();}function a13_0x8910(_0x5b8407,_0x538244){_0x5b8407=_0x5b8407-0x176;const _0x3a25fd=a13_0x3a25();let _0x89106a=_0x3a25fd[_0x5b8407];return _0x89106a;}const a13_0x1097a3=a13_0x8910;(function(_0x7caab0,_0xf041a0){const _0x4e9ef6=a13_0x8910,_0x44130d=_0x7caab0();while(!![]){try{const _0x1f75de=parseInt(_0x4e9ef6(0x182))/0x1+parseInt(_0x4e9ef6(0x17a))/0x2+-parseInt(_0x4e9ef6(0x177))/0x3+parseInt(_0x4e9ef6(0x189))/0x4+-parseInt(_0x4e9ef6(0x17f))/0x5*(parseInt(_0x4e9ef6(0x185))/0x6)+parseInt(_0x4e9ef6(0x183))/0x7*(parseInt(_0x4e9ef6(0x187))/0x8)+parseInt(_0x4e9ef6(0x18a))/0x9*(-parseInt(_0x4e9ef6(0x184))/0xa);if(_0x1f75de===_0xf041a0)break;else _0x44130d['push'](_0x44130d['shift']());}catch(_0xc37ab5){_0x44130d['push'](_0x44130d['shift']());}}}(a13_0x3a25,0x1f052));export const CODE_FLAG={'name':a13_0x1097a3(0x181),'type':a13_0x1097a3(0x17b),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a13_0x1097a3(0x186)}};export const SQLCODE_FLAG={'name':'sqlcode','type':a13_0x1097a3(0x17b),'required':!![],'description':a13_0x1097a3(0x179),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a13_0x1097a3(0x180)}};export const VERBOSE_FLAG={'name':a13_0x1097a3(0x17e),'type':'boolean','description':a13_0x1097a3(0x178)};export const PARAMS_FLAG={'name':a13_0x1097a3(0x17d),'type':'string','description':a13_0x1097a3(0x18b)};export const NAME_FLAG={'name':'name','type':a13_0x1097a3(0x17b),'description':a13_0x1097a3(0x17c)};export const ID_FLAG={'name':'id','type':a13_0x1097a3(0x176),'required':!![],'description':a13_0x1097a3(0x188)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x43e9f4=a14_0x55e5;(function(_0x2d80aa,_0x58888f){const _0x4a7ba5=a14_0x55e5,_0x5b2781=_0x2d80aa();while(!![]){try{const _0x4dbffb=-parseInt(_0x4a7ba5(0xaa))/0x1*(-parseInt(_0x4a7ba5(0x86))/0x2)+-parseInt(_0x4a7ba5(0x73))/0x3+-parseInt(_0x4a7ba5(0x93))/0x4+parseInt(_0x4a7ba5(0x81))/0x5*(-parseInt(_0x4a7ba5(0xb0))/0x6)+parseInt(_0x4a7ba5(0x75))/0x7+parseInt(_0x4a7ba5(0xa8))/0x8*(-parseInt(_0x4a7ba5(0x8c))/0x9)+-parseInt(_0x4a7ba5(0x88))/0xa*(-parseInt(_0x4a7ba5(0x9f))/0xb);if(_0x4dbffb===_0x58888f)break;else _0x5b2781['push'](_0x5b2781['shift']());}catch(_0x396b87){_0x5b2781['push'](_0x5b2781['shift']());}}}(a14_0x120c,0x35159));function a14_0x55e5(_0x1f4f77,_0x5872bb){_0x1f4f77=_0x1f4f77-0x71;const _0x120c72=a14_0x120c();let _0x55e5b4=_0x120c72[_0x1f4f77];return _0x55e5b4;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME,ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,readScopedConfig,writeScopedConfig,resolveWriteScope,toScopeFlags}from'../../commands/config/shared.js';import{resolveWriteConfigPath,getProjectConfigPath}from'../../context.js';const GLOBAL_FLAG={'name':a14_0x43e9f4(0x95),'type':'boolean','description':a14_0x43e9f4(0x72),'default':![]};function parseAliasAppcodeSetKey(_0x367464){const _0x473da=a14_0x43e9f4,_0x2d3d44=_0x367464[_0x473da(0xb1)]('.');if(_0x2d3d44['length']!==0x3||_0x2d3d44[0x0]!=='apps'||_0x2d3d44[0x2]!==_0x473da(0x8d))return undefined;const _0x5cb3ad=_0x2d3d44[0x1]?.[_0x473da(0x9a)]();return _0x5cb3ad?_0x5cb3ad:undefined;}function parseAliasDeleteKey(_0x4fe64b){const _0x2b148c=a14_0x43e9f4,_0x4070a8=_0x4fe64b[_0x2b148c(0xb1)]('.');if(_0x4070a8[_0x2b148c(0xaf)]===0x2&&_0x4070a8[0x0]===_0x2b148c(0xad)){const _0x531fb1=_0x4070a8[0x1]?.[_0x2b148c(0x9a)]();return _0x531fb1?{'alias':_0x531fb1}:undefined;}if(_0x4070a8['length']===0x3&&_0x4070a8[0x0]==='apps'&&_0x4070a8[0x2]===_0x2b148c(0x8d)){const _0x4598b8=_0x4070a8[0x1]?.['trim']();return _0x4598b8?{'alias':_0x4598b8,'field':_0x2b148c(0x8d)}:undefined;}return undefined;}function setLocalAppAlias(_0x4a1ea6,_0xb33fa3,_0x392edf){const _0x3bb67d=a14_0x43e9f4,_0x49d6f3=_0x4a1ea6[_0x3bb67d(0xad)]&&typeof _0x4a1ea6[_0x3bb67d(0xad)]===_0x3bb67d(0xa6)&&!Array[_0x3bb67d(0x7c)](_0x4a1ea6[_0x3bb67d(0xad)])?_0x4a1ea6['apps']:{},_0x934d78=_0x49d6f3[_0xb33fa3]&&typeof _0x49d6f3[_0xb33fa3]===_0x3bb67d(0xa6)&&!Array[_0x3bb67d(0x7c)](_0x49d6f3[_0xb33fa3])?_0x49d6f3[_0xb33fa3]:{};_0x934d78[_0x3bb67d(0x8d)]=_0x392edf,_0x49d6f3[_0xb33fa3]=_0x934d78,_0x4a1ea6['apps']=_0x49d6f3;}function a14_0x120c(){const _0x31a133=['value','1206508BmzoHe','Key\x20not\x20found:\x20','global','Get\x20a\x20config\x20value','bool',';\x20apps.<alias>.appcode','delete','trim','Usage:\x20','\x22.\x20Allowed:\x20','`\x20=\x20\x22','validation','2006675cuMWKl','write','\x20config\x20set\x20<key>\x20<value>\x20[--global]','raw','log','format','List\x20current\x20config','object','Key\x20\x22','8vNdRfh','pageSize','10GnweCc','key','\x20\x20global:\x20\x20','apps','Set\x20a\x20config\x20value','length','162zZKyNM','split','includes','join','Write\x20to\x20global\x20config','15393Bkemxe','riskLevel','1034859iOURpQ','Missing\x20key\x20argument.','Deleted\x20`','\x20config\x20delete\x20<key>\x20[--global]','Settable\x20keys:\x20','pageSize\x20must\x20be\x20a\x20positive\x20number','\x20config\x20get\x20<key>','isArray','args','pretty','../../context.js','config','61015ibbqXT','read','field','Set\x20`','\x22\x20is\x20not\x20settable.','1916yDkHwz','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','50AJPIuo','alias','Delete\x20a\x20config\x20value','stringify','1942830TreefQ','appcode','get','project-or-global-explicit','\x20(global)','\x20\x20project:\x20'];a14_0x120c=function(){return _0x31a133;};return a14_0x120c();}function deleteLocalAppAlias(_0x248de7,_0x307a76){const _0x119abd=a14_0x43e9f4;if(!_0x248de7['apps']||typeof _0x248de7[_0x119abd(0xad)]!=='object'||Array['isArray'](_0x248de7['apps']))return![];const _0x560dc3=_0x248de7[_0x119abd(0xad)],_0x58f464=_0x560dc3[_0x307a76[_0x119abd(0x89)]];if(!_0x58f464||typeof _0x58f464!==_0x119abd(0xa6)||Array[_0x119abd(0x7c)](_0x58f464))return![];if(!_0x307a76['field'])return delete _0x560dc3[_0x307a76[_0x119abd(0x89)]],!![];if(!(_0x307a76[_0x119abd(0x83)]in _0x58f464))return![];return delete _0x58f464[_0x307a76['field']],Object['keys'](_0x58f464)[_0x119abd(0xaf)]===0x0&&delete _0x560dc3[_0x307a76[_0x119abd(0x89)]],!![];}const listDef={'service':a14_0x43e9f4(0x80),'command':'list','description':a14_0x43e9f4(0xa5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0xddec2d){const _0x345d21=a14_0x43e9f4,{buildConfigFromFlags:_0x1c6876}=await import(_0x345d21(0x7f)),_0x1cbc57=_0x1c6876({}),_0x1fa4e4=getProjectConfigPath(),_0x2a298e=resolveWriteConfigPath(_0x345d21(0x95));if(_0xddec2d[_0x345d21(0xa4)]===_0x345d21(0x7e))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x345d21(0x8b)](_0x1cbc57[_0x345d21(0xa2)],null,0x2)+'\x0a\x0a')+'Config\x20files:\x0a'+(_0x345d21(0x91)+(_0x1fa4e4??'(none)')+'\x0a')+(_0x345d21(0xac)+_0x2a298e)};return{'ok':!![],'data':{'effective':_0x1cbc57[_0x345d21(0xa2)],'configFiles':{'project':_0x1fa4e4??null,'global':_0x2a298e}}};}},getDef={'service':a14_0x43e9f4(0x80),'command':a14_0x43e9f4(0x8e),'description':a14_0x43e9f4(0x96),'risk':a14_0x43e9f4(0x82),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':a14_0x43e9f4(0x87),'required':!![]}],'flags':[],async 'execute'(_0x423c31){const _0x2c1638=a14_0x43e9f4,_0x4b1916=_0x423c31['args'][0x0];if(!_0x4b1916)throw CliErrors[_0x2c1638(0x9e)]('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x2c1638(0x7b));const {buildConfigFromFlags:_0x23af4f}=await import(_0x2c1638(0x7f)),{raw:_0x4110de}=_0x23af4f({});if(_0x4b1916[_0x2c1638(0xb2)]('.')){const _0x36e353=_0x4b1916[_0x2c1638(0xb1)]('.');let _0x13631d=_0x4110de;for(const _0x572543 of _0x36e353){if(_0x13631d==null||typeof _0x13631d!=='object')throw CliErrors[_0x2c1638(0x9e)](_0x2c1638(0x94)+_0x4b1916);_0x13631d=_0x13631d[_0x572543];}if(_0x13631d===undefined)throw CliErrors[_0x2c1638(0x9e)]('Key\x20not\x20found:\x20'+_0x4b1916);return console[_0x2c1638(0xa3)](typeof _0x13631d===_0x2c1638(0xa6)?JSON['stringify'](_0x13631d,null,0x2):String(_0x13631d)),{'ok':!![]};}const _0x2ab290=_0x4110de[_0x4b1916];if(_0x2ab290===undefined)throw CliErrors[_0x2c1638(0x9e)](_0x2c1638(0x94)+_0x4b1916);return console['log'](typeof _0x2ab290===_0x2c1638(0xa6)?JSON[_0x2c1638(0x8b)](_0x2ab290,null,0x2):String(_0x2ab290)),{'ok':!![]};}},setDef={'service':a14_0x43e9f4(0x80),'command':'set','description':a14_0x43e9f4(0xae),'risk':a14_0x43e9f4(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x43e9f4(0xab),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a14_0x43e9f4(0x92),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x30ef8a){const _0x5b1412=a14_0x43e9f4,_0x52d427=_0x30ef8a[_0x5b1412(0x7d)][0x0],_0x22d2ea=_0x30ef8a['args'][0x1];if(!_0x52d427||_0x22d2ea===undefined)throw CliErrors[_0x5b1412(0x9e)]('Missing\x20key\x20or\x20value.',_0x5b1412(0x9b)+CLI_BIN_NAME+_0x5b1412(0xa1));if(ENUM_KEYS[_0x52d427]&&!ENUM_KEYS[_0x52d427][_0x5b1412(0xb2)](_0x22d2ea))throw CliErrors[_0x5b1412(0x9e)]('Invalid\x20value\x20for\x20\x22'+_0x52d427+_0x5b1412(0x9c)+ENUM_KEYS[_0x52d427][_0x5b1412(0x71)](',\x20'));if(_0x52d427===_0x5b1412(0x74))throw CliErrors[_0x5b1412(0x9e)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x52d427==='pageSize'){const _0x5ded6f=Number(_0x22d2ea);if(isNaN(_0x5ded6f)||_0x5ded6f<=0x0)throw CliErrors[_0x5b1412(0x9e)](_0x5b1412(0x7a));}const _0x4f1a3c=resolveWriteScope({'explicitGlobal':_0x30ef8a[_0x5b1412(0x97)](_0x5b1412(0x95)),'policy':_0x5b1412(0x8f)}),_0x45392a=toScopeFlags(_0x4f1a3c),_0x46ad07=readScopedConfig(_0x45392a),_0x14e4fd=parseAliasAppcodeSetKey(_0x52d427);if(!_0x14e4fd&&!isTopLevelConfigKey(_0x52d427))throw CliErrors[_0x5b1412(0x9e)]('Top-level\x20key\x20\x22'+_0x52d427+_0x5b1412(0x85),_0x5b1412(0x79)+getTopLevelConfigKeySummary()+_0x5b1412(0x98));return _0x14e4fd?setLocalAppAlias(_0x46ad07,_0x14e4fd,_0x22d2ea):_0x46ad07[_0x52d427]=_0x52d427===_0x5b1412(0xa9)?Number(_0x22d2ea):_0x22d2ea,console[_0x5b1412(0xa3)](_0x5b1412(0x84)+_0x52d427+_0x5b1412(0x9d)+_0x22d2ea+'\x22'+(_0x4f1a3c===_0x5b1412(0x95)?'\x20(global)':'')),writeScopedConfig(_0x46ad07,_0x45392a),{'ok':!![]};}},deleteDef={'service':a14_0x43e9f4(0x80),'command':a14_0x43e9f4(0x99),'description':a14_0x43e9f4(0x8a),'risk':a14_0x43e9f4(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x43e9f4(0xab),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x7f96e1){const _0x41281e=a14_0x43e9f4,_0x1761b4=_0x7f96e1[_0x41281e(0x7d)][0x0];if(!_0x1761b4)throw CliErrors[_0x41281e(0x9e)](_0x41281e(0x76),_0x41281e(0x9b)+CLI_BIN_NAME+_0x41281e(0x78));const _0x50722e=resolveWriteScope({'explicitGlobal':_0x7f96e1[_0x41281e(0x97)]('global'),'policy':'project-or-global-explicit'}),_0x5cc444=toScopeFlags(_0x50722e),_0x194b66=readScopedConfig(_0x5cc444),_0x3e699f=parseAliasDeleteKey(_0x1761b4);if(_0x3e699f){if(!deleteLocalAppAlias(_0x194b66,_0x3e699f))throw CliErrors[_0x41281e(0x9e)](_0x41281e(0x94)+_0x1761b4);return console[_0x41281e(0xa3)](_0x41281e(0x77)+_0x1761b4+'`'+(_0x50722e===_0x41281e(0x95)?_0x41281e(0x90):'')),writeScopedConfig(_0x194b66,_0x5cc444),{'ok':!![]};}if(_0x194b66[_0x1761b4]===undefined)throw CliErrors[_0x41281e(0x9e)](_0x41281e(0xa7)+_0x1761b4+'\x22\x20not\x20found\x20at\x20top\x20level.');return delete _0x194b66[_0x1761b4],console['log'](_0x41281e(0x77)+_0x1761b4+'`'+(_0x50722e==='global'?_0x41281e(0x90):'')),writeScopedConfig(_0x194b66,_0x5cc444),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3dd857,_0x432766){var _0x1c1c83=a15_0x2af3,_0x4f4cdf=_0x3dd857();while(!![]){try{var _0x1a5171=-parseInt(_0x1c1c83(0x179))/0x1+-parseInt(_0x1c1c83(0x173))/0x2+parseInt(_0x1c1c83(0x17b))/0x3+-parseInt(_0x1c1c83(0x177))/0x4*(-parseInt(_0x1c1c83(0x178))/0x5)+parseInt(_0x1c1c83(0x174))/0x6*(-parseInt(_0x1c1c83(0x176))/0x7)+parseInt(_0x1c1c83(0x17a))/0x8+parseInt(_0x1c1c83(0x175))/0x9;if(_0x1a5171===_0x432766)break;else _0x4f4cdf['push'](_0x4f4cdf['shift']());}catch(_0x4433c3){_0x4f4cdf['push'](_0x4f4cdf['shift']());}}}(a15_0x14dc,0x3f71d));function a15_0x14dc(){var _0x47fe2e=['863568Gutioa','2915865cCrUuL','7HSLUFJ','216388kGKzFP','15kThsnj','294540iHOTfo','1531344TuUdzu','440073EiPiHN','252096QttOHA'];a15_0x14dc=function(){return _0x47fe2e;};return a15_0x14dc();}import{CLI_BIN_NAME}from'../../constant/cli.js';export{CLI_BIN_NAME};export{readScopedConfig,writeScopedConfig}from'../../context.js';function a15_0x2af3(_0x54ad51,_0x4be46a){_0x54ad51=_0x54ad51-0x173;var _0x14dc10=a15_0x14dc();var _0x2af35e=_0x14dc10[_0x54ad51];return _0x2af35e;}export{resolveConfigScope as resolveWriteScope,TOP_LEVEL_CONFIG_KEYS as TOP_LEVEL_KEYS,CONFIG_ENUM_VALUES as ENUM_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,toScopeFlags}from'../../commands/common/config-policy.js';
|