@lovrabet/lovrabet-cli 2.0.13-beta.3 → 2.0.13-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -0
- 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/artifact/index.js +1 -0
- 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/dataset/sdk-doc.js +1 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -0
- 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/update-notice.js +1 -0
- 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
|
-
function
|
|
2
|
+
const a0_0x4d02d1=a0_0x5afc;function a0_0x5afc(_0x316cc5,_0xe7e40f){_0x316cc5=_0x316cc5-0x15c;const _0x53368b=a0_0x5336();let _0x5afc8c=_0x53368b[_0x316cc5];return _0x5afc8c;}(function(_0x3e550a,_0x173599){const _0x45efb0=a0_0x5afc,_0x5c8622=_0x3e550a();while(!![]){try{const _0x5e3557=-parseInt(_0x45efb0(0x15f))/0x1*(parseInt(_0x45efb0(0x174))/0x2)+parseInt(_0x45efb0(0x168))/0x3+parseInt(_0x45efb0(0x161))/0x4*(parseInt(_0x45efb0(0x15c))/0x5)+-parseInt(_0x45efb0(0x16b))/0x6*(-parseInt(_0x45efb0(0x17e))/0x7)+parseInt(_0x45efb0(0x179))/0x8+-parseInt(_0x45efb0(0x171))/0x9+-parseInt(_0x45efb0(0x16e))/0xa;if(_0x5e3557===_0x173599)break;else _0x5c8622['push'](_0x5c8622['shift']());}catch(_0x1b8d0a){_0x5c8622['push'](_0x5c8622['shift']());}}}(a0_0x5336,0x22fa1));import{jsx as a0_0x51b344}from'react/jsx-runtime';import a0_0x2e36a4 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';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_0x2e36a4(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'autoVersion':!![]});void main()[a0_0x4d02d1(0x165)](handleError);async function main(){try{await run();}catch(_0x3c1e81){handleError(_0x3c1e81);}}async function run(){const _0x500a01=a0_0x4d02d1;let _0x48c4e8=cli['input'][0x0],_0x30593b=cli[_0x500a01(0x16f)][0x1];const _0x43abc0=cli[_0x500a01(0x17f)];try{const {correctFlags:_0x239727}=await import(_0x500a01(0x17c)),_0x4002c4=getAllDefinitions()[_0x500a01(0x160)](_0x414e89=>_0x414e89['flags']??[]),{flags:_0x56a331,corrections:_0x17b385}=_0x239727(_0x43abc0,_0x4002c4);if(_0x17b385[_0x500a01(0x172)]>0x0){for(const _0xc27a8d of _0x17b385){process[_0x500a01(0x176)][_0x500a01(0x177)](_0x500a01(0x16c)+_0xc27a8d[_0x500a01(0x169)]+':\x20--'+_0xc27a8d['original']+_0x500a01(0x181)+_0xc27a8d[_0x500a01(0x180)]+'\x0a');}Object[_0x500a01(0x173)](_0x43abc0,_0x56a331);}}catch{}if(!_0x48c4e8||!isKnownService(_0x48c4e8)){const {waitUntilExit:_0x2a0463}=render(a0_0x51b344(Help,{}));await _0x2a0463();return;}const _0x4cef5a=getServiceEntry(_0x48c4e8);if(!_0x30593b){if(_0x43abc0[_0x500a01(0x15e)]){console['log'](generateServiceHelp(_0x48c4e8));return;}if(_0x4cef5a[_0x500a01(0x167)])_0x30593b=_0x4cef5a[_0x500a01(0x167)];else{console['log'](generateServiceHelp(_0x48c4e8));return;}}const _0x5e9858=findDefinition(_0x48c4e8,_0x30593b);!_0x5e9858&&(console['log'](generateServiceHelp(_0x48c4e8)),handleError(CliErrors['unknownCommand'](_0x48c4e8+'\x20'+_0x30593b)));if(_0x43abc0[_0x500a01(0x15e)]){console[_0x500a01(0x15d)](generateCommandHelp(_0x5e9858));return;}const _0x43813c=buildConfigFromFlags(_0x43abc0);await initGlobalEnvironment(_0x43813c);const _0x40a2fc=createPipelineEnv(_0x43813c,_0x43abc0);_0x40a2fc[_0x500a01(0x16d)]=cli[_0x500a01(0x16f)][_0x500a01(0x175)](0x2),await runCommand(_0x5e9858,_0x40a2fc);}function handleError(_0x1c8346){const _0x2c25ed=a0_0x4d02d1;if(_0x1c8346 instanceof CliError){_0x1c8346[_0x2c25ed(0x17a)]===_0x2c25ed(0x162)&&(process[_0x2c25ed(0x176)][_0x2c25ed(0x177)](_0x2c25ed(0x166)),process['exit'](0x0));console[_0x2c25ed(0x178)](_0x2c25ed(0x17b)+_0x1c8346[_0x2c25ed(0x170)]);if(_0x1c8346[_0x2c25ed(0x16a)])console[_0x2c25ed(0x178)]('Hint:\x20'+_0x1c8346['hint']);process['exit'](_0x1c8346[_0x2c25ed(0x163)]);}isUserCancellation(_0x1c8346)&&(process['stderr']['write'](_0x2c25ed(0x166)),process[_0x2c25ed(0x182)](0x0)),console[_0x2c25ed(0x178)]('Unexpected\x20error:',_0x1c8346),process[_0x2c25ed(0x182)](0x1);}function isUserCancellation(_0xaea1fe){const _0x982661=a0_0x4d02d1;if(!(_0xaea1fe instanceof Error))return![];if(_0xaea1fe['name']===_0x982661(0x17d))return!![];if(_0xaea1fe[_0x982661(0x17a)]===_0x982661(0x164))return!![];if(_0xaea1fe[_0x982661(0x17a)]==='ERR_STREAM_DESTROYED')return!![];return![];}function a0_0x5336(){const _0x314732=['error','1779432QFgCVw','code','Error:\x20','./framework/preparse.js','ExitPromptError','597079GyGPKo','flags','corrected','\x20->\x20--','exit','105VSpAiU','log','help','16acCaHY','flatMap','42908JdsIlX','cancelled','exitCode','ERR_USE_AFTER_CLOSE','catch','\x0aCancelled.\x0a','defaultCommand','351384uKgJAF','handler','hint','6UkdSNv','[preparse]\x20','args','1210270aWwSrx','input','message','946413lWHMeT','length','assign','35084PNFyIC','slice','stderr','write'];a0_0x5336=function(){return _0x314732;};return a0_0x5336();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a1_0x1c8f(_0x5e391c,_0x258811){_0x5e391c=_0x5e391c-0x12e;const _0xef8f62=a1_0xef8f();let _0x1c8f7e=_0xef8f62[_0x5e391c];return _0x1c8f7e;}const a1_0x3d458c=a1_0x1c8f;(function(_0xd20cf,_0x3dd63f){const _0x3963eb=a1_0x1c8f,_0x4456ed=_0xd20cf();while(!![]){try{const _0x1059ef=parseInt(_0x3963eb(0x190))/0x1*(-parseInt(_0x3963eb(0x178))/0x2)+parseInt(_0x3963eb(0x192))/0x3*(-parseInt(_0x3963eb(0x188))/0x4)+parseInt(_0x3963eb(0x141))/0x5*(parseInt(_0x3963eb(0x146))/0x6)+parseInt(_0x3963eb(0x169))/0x7*(parseInt(_0x3963eb(0x13b))/0x8)+parseInt(_0x3963eb(0x145))/0x9+-parseInt(_0x3963eb(0x160))/0xa+parseInt(_0x3963eb(0x15a))/0xb*(-parseInt(_0x3963eb(0x185))/0xc);if(_0x1059ef===_0x3dd63f)break;else _0x4456ed['push'](_0x4456ed['shift']());}catch(_0x76222b){_0x4456ed['push'](_0x4456ed['shift']());}}}(a1_0xef8f,0x32fe1));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x3d458c(0x18b),'type':a1_0x3d458c(0x189),'description':a1_0x3d458c(0x136)},KEYWORD_FLAG={'name':a1_0x3d458c(0x196),'type':'string','description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':'code','type':a1_0x3d458c(0x189),'required':!![],'description':'API\x20doc\x20code,\x20for\x20example\x20dataset_list'},DOCS=[{'code':a1_0x3d458c(0x133),'category':a1_0x3d458c(0x149),'title':a1_0x3d458c(0x17b),'method':a1_0x3d458c(0x15b),'path':'/api/dataset/get-dataset-list-by-app-code','summary':'分页获取数据集列表','whenToUse':a1_0x3d458c(0x172),'pathParams':[],'queryParams':[],'bodySchema':a1_0x3d458c(0x13d),'responseHighlights':[a1_0x3d458c(0x175),'paging.totalCount\x20gives\x20total\x20rows'],'examples':[a1_0x3d458c(0x164)],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':[a1_0x3d458c(0x184),'',a1_0x3d458c(0x19b)][a1_0x3d458c(0x19f)]('\x0a')},{'code':a1_0x3d458c(0x135),'category':'dataset','title':'Dataset\x20detail','method':a1_0x3d458c(0x14f),'path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x3d458c(0x17d),'whenToUse':a1_0x3d458c(0x17a),'pathParams':[],'queryParams':[{'name':a1_0x3d458c(0x19d),'description':a1_0x3d458c(0x174)}],'bodySchema':a1_0x3d458c(0x19a),'responseHighlights':['fields/properties\x20describe\x20data\x20shape',a1_0x3d458c(0x187)],'examples':['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>'],'notes':[a1_0x3d458c(0x14a)],'markdown':[a1_0x3d458c(0x161),'','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x3d458c(0x19f)]('\x0a')},{'code':a1_0x3d458c(0x15f),'category':'dataset','title':a1_0x3d458c(0x16e),'method':a1_0x3d458c(0x15b),'path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x3d458c(0x19e),'whenToUse':a1_0x3d458c(0x147),'pathParams':[{'name':a1_0x3d458c(0x152),'description':a1_0x3d458c(0x12e)},{'name':a1_0x3d458c(0x170),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x3d458c(0x143),'responseHighlights':['tableData\x20contains\x20records','paging\x20contains\x20pagination'],'examples':[a1_0x3d458c(0x13e)],'notes':['Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.'],'markdown':[a1_0x3d458c(0x13a),'',a1_0x3d458c(0x13c)][a1_0x3d458c(0x19f)]('\x0a')},{'code':a1_0x3d458c(0x18d),'category':a1_0x3d458c(0x149),'title':a1_0x3d458c(0x148),'method':a1_0x3d458c(0x15b),'path':a1_0x3d458c(0x191),'summary':a1_0x3d458c(0x171),'whenToUse':a1_0x3d458c(0x154),'pathParams':[{'name':'appCode','description':a1_0x3d458c(0x12e)},{'name':a1_0x3d458c(0x170),'description':a1_0x3d458c(0x174)}],'queryParams':[],'bodySchema':a1_0x3d458c(0x176),'responseHighlights':[a1_0x3d458c(0x195),a1_0x3d458c(0x19c)],'examples':[a1_0x3d458c(0x150)],'notes':[a1_0x3d458c(0x153)],'markdown':[a1_0x3d458c(0x158),'','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.']['join']('\x0a')},{'code':a1_0x3d458c(0x142),'category':'dataset','title':a1_0x3d458c(0x16c),'method':a1_0x3d458c(0x15b),'path':a1_0x3d458c(0x186),'summary':a1_0x3d458c(0x173),'whenToUse':'已经知道记录\x20id,需要按数据集读取单条业务数据时使用','pathParams':[{'name':a1_0x3d458c(0x152),'description':a1_0x3d458c(0x12e)},{'name':a1_0x3d458c(0x170),'description':a1_0x3d458c(0x174)}],'queryParams':[],'bodySchema':a1_0x3d458c(0x134),'responseHighlights':[a1_0x3d458c(0x144)],'examples':[a1_0x3d458c(0x168)],'notes':[a1_0x3d458c(0x130)],'markdown':a1_0x3d458c(0x183)},{'code':a1_0x3d458c(0x18e),'category':a1_0x3d458c(0x149),'title':a1_0x3d458c(0x151),'method':a1_0x3d458c(0x15b),'path':a1_0x3d458c(0x18a),'summary':a1_0x3d458c(0x137),'whenToUse':a1_0x3d458c(0x166),'pathParams':[{'name':a1_0x3d458c(0x152),'description':a1_0x3d458c(0x12e)},{'name':a1_0x3d458c(0x170),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x3d458c(0x156),'responseHighlights':[a1_0x3d458c(0x14e)],'examples':['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27'],'notes':[a1_0x3d458c(0x17c)],'markdown':a1_0x3d458c(0x17e)},{'code':a1_0x3d458c(0x155),'category':'bf','title':a1_0x3d458c(0x163),'method':a1_0x3d458c(0x14f),'path':'/api/endpoint/{appCode}/functions','summary':a1_0x3d458c(0x12f),'whenToUse':'需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','pathParams':[{'name':a1_0x3d458c(0x152),'description':a1_0x3d458c(0x12e)}],'queryParams':[],'bodySchema':'None','responseHighlights':['Returns\x20endpoint\x20functionName/id/description'],'examples':[a1_0x3d458c(0x13f)],'notes':[a1_0x3d458c(0x18c)],'markdown':a1_0x3d458c(0x179)},{'code':a1_0x3d458c(0x165),'category':'bf','title':a1_0x3d458c(0x157),'method':a1_0x3d458c(0x15b),'path':a1_0x3d458c(0x15c),'summary':'执行指定\x20BF\x20函数','whenToUse':a1_0x3d458c(0x139),'pathParams':[{'name':'appCode','description':a1_0x3d458c(0x12e)},{'name':'scriptName','description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x3d458c(0x16d)],'examples':[a1_0x3d458c(0x193)],'notes':[a1_0x3d458c(0x16f)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x3d458c(0x194),'category':a1_0x3d458c(0x159),'title':a1_0x3d458c(0x14d),'method':'POST','path':'/api/custom/executeSql','summary':a1_0x3d458c(0x15d),'whenToUse':a1_0x3d458c(0x177),'pathParams':[],'queryParams':[],'bodySchema':a1_0x3d458c(0x1a0),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':['lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27'],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':'##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.'}];function entrySummary(_0x42cb07){const _0x3ee049=a1_0x3d458c;return{'code':_0x42cb07[_0x3ee049(0x19d)],'category':_0x42cb07[_0x3ee049(0x18b)],'method':_0x42cb07[_0x3ee049(0x138)],'path':_0x42cb07[_0x3ee049(0x14b)],'summary':_0x42cb07['summary'],'whenToUse':_0x42cb07[_0x3ee049(0x14c)]};}export function listApiDocEntries(_0x501a07={}){const _0x4e71f4=a1_0x3d458c,_0x3ebfed=String(_0x501a07[_0x4e71f4(0x18b)]||'')[_0x4e71f4(0x167)](),_0x25a8fe=String(_0x501a07[_0x4e71f4(0x196)]||'')['trim']()['toLowerCase']();return DOCS[_0x4e71f4(0x131)](_0xd21d8e=>{const _0x36858e=_0x4e71f4;if(_0x3ebfed&&_0xd21d8e['category']!==_0x3ebfed)return![];if(!_0x25a8fe)return!![];return[_0xd21d8e[_0x36858e(0x19d)],_0xd21d8e['category'],_0xd21d8e[_0x36858e(0x138)],_0xd21d8e['path'],_0xd21d8e[_0x36858e(0x197)],_0xd21d8e[_0x36858e(0x14c)],_0xd21d8e[_0x36858e(0x18f)]]['join']('\x20')[_0x36858e(0x16b)]()[_0x36858e(0x181)](_0x25a8fe);})[_0x4e71f4(0x17f)](entrySummary);}function a1_0xef8f(){const _0x3bc777=['/api/{appCode}/{datasetCode}/getOne','operations\x20describes\x20runtime\x20APIs','1321188vsGRJG','string','/api/{appCode}/{datasetCode}/create','category','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','dataset_data_aggregate','dataset_data_create','title','7VlZGpc','/api/{appCode}/{datasetCode}/aggregate','3bsOCat','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','custom_sql_execute','result\x20rows\x20contain\x20aggregate\x20aliases','keyword','summary','read','api-doc','None','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','where\x20filters\x20before\x20aggregation','code','条件过滤查询数据','join','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','Current\x20app\x20code','获取应用下可调用的\x20BF\x20函数列表','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','filter','find','dataset_list','{\x22id\x22:123}','dataset_detail','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','创建数据','method','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','##\x20Filter\x20dataset\x20data','2055608nPxcKv','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','detail','730CwPxrl','dataset_data_get_one','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','Returns\x20one\x20matching\x20business\x20record','3138300bONZNM','9894CuggZh','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','Aggregate\x20dataset\x20data','dataset','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','path','whenToUse','Execute\x20custom\x20SQL','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','GET','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','Create\x20dataset\x20record','appCode','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','bf_function_list','{\x22fieldName\x22:\x22value\x22}','Execute\x20BF\x20endpoint\x20function','##\x20Aggregate\x20dataset\x20data','custom_sql','11ccGFba','POST','/api/endpoint/{appCode}/{scriptName}','执行自定义\x20SQL','List\x20available\x20runtime\x20API\x20documentation\x20entries','dataset_data_filter','2429650DdYrYH','##\x20Dataset\x20detail','str','List\x20BF\x20endpoint\x20functions','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','bf_execute','需要向指定数据集新增一条业务数据时使用','trim','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','7doWHyV','Show\x20runtime\x20API\x20documentation\x20by\x20code','toLowerCase','Get\x20one\x20dataset\x20record','Returns\x20script\x20business\x20payload','Filter\x20dataset\x20data','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','datasetCode','聚合查询数据集数据','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','查询单条数据','32-character\x20dataset\x20code','tableData\x20contains\x20dataset\x20id/code/name','{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','11642rjEwPG','##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','List\x20datasets','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','获取数据集详情','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','map','API\x20doc\x20code\x20not\x20found:\x20','includes','list','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','##\x20List\x20datasets','282372eOLFxN'];a1_0xef8f=function(){return _0x3bc777;};return a1_0xef8f();}export function getApiDocDetail(_0x530292){const _0x2fab21=a1_0x3d458c,_0x5e8c72=DOCS[_0x2fab21(0x132)](_0x2db1ea=>_0x2db1ea[_0x2fab21(0x19d)]===_0x530292);if(!_0x5e8c72)throw CliErrors['validation'](_0x2fab21(0x180)+_0x530292);return{..._0x5e8c72};}const apiDocList={'service':a1_0x3d458c(0x199),'command':a1_0x3d458c(0x182),'description':a1_0x3d458c(0x15e),'risk':a1_0x3d458c(0x198),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x2cbac0){const _0x22dff6=a1_0x3d458c,_0x32576a=listApiDocEntries({'category':_0x2cbac0[_0x22dff6(0x162)](_0x22dff6(0x18b)),'keyword':_0x2cbac0['str'](_0x22dff6(0x196))});return{'ok':!![],'data':{'total':_0x32576a['length'],'items':_0x32576a}};}},apiDocDetail={'service':'api-doc','command':a1_0x3d458c(0x140),'description':a1_0x3d458c(0x16a),'risk':a1_0x3d458c(0x198),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x284427){const _0x4ae708=a1_0x3d458c;return{'ok':!![],'data':getApiDocDetail(_0x284427[_0x4ae708(0x162)](_0x4ae708(0x19d)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x106309,_0x457814){const _0x503725=a2_0x71fd,_0x2a1308=_0x106309();while(!![]){try{const _0xe8f464=parseInt(_0x503725(0x1c2))/0x1*(parseInt(_0x503725(0x1c7))/0x2)+parseInt(_0x503725(0x1bc))/0x3+parseInt(_0x503725(0x1b0))/0x4+parseInt(_0x503725(0x1b1))/0x5+parseInt(_0x503725(0x1c4))/0x6+-parseInt(_0x503725(0x1c8))/0x7*(-parseInt(_0x503725(0x1b5))/0x8)+parseInt(_0x503725(0x1cd))/0x9*(-parseInt(_0x503725(0x1b8))/0xa);if(_0xe8f464===_0x457814)break;else _0x2a1308['push'](_0x2a1308['shift']());}catch(_0x2c5f08){_0x2a1308['push'](_0x2a1308['shift']());}}}(a2_0x1034,0x8dacd));function a2_0x1034(){const _0xc0af4c=['645152kerkCX','1908550WyFWhf','EXDEV','cache','.tmp','5313904FvpxDB','sha256','items','430AkhavX','hex','appName','isArray','146832NFCUgP','trim','EACCES','homeDirName','stringify','unknown','33TYSFAH','slice','5280546FUdmUh','update','utf8','13376JXkwiZ','7sfgtOl','find','code','EPERM','appCode','371862TLmoGQ'];a2_0x1034=function(){return _0xc0af4c;};return a2_0x1034();}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';function a2_0x71fd(_0x42d766,_0x22ab87){_0x42d766=_0x42d766-0x1b0;const _0x103427=a2_0x1034();let _0x71fd1f=_0x103427[_0x42d766];return _0x71fd1f;}export function fingerprintAccessKey(_0xd61eda){const _0x3209db=a2_0x71fd,_0x5a7860=_0xd61eda[_0x3209db(0x1bd)](),_0x51e3f2=_0x5a7860[_0x3209db(0x1c3)](-0x6)||_0x3209db(0x1c1),_0x2b5ec3=createHash(_0x3209db(0x1b6))[_0x3209db(0x1c5)](_0x5a7860)['digest'](_0x3209db(0x1b9))[_0x3209db(0x1c3)](0x0,0xc);return'ak_'+_0x51e3f2+'_'+_0x2b5ec3;}export function getAppCacheFilePath(_0x3dd4ac,_0x8107e3){const _0x58169b=a2_0x71fd;return resolve(homedir(),PRODUCT_CONFIG[_0x58169b(0x1bf)],_0x58169b(0x1b3),_0x3dd4ac,fingerprintAccessKey(_0x8107e3),'my-apps.json');}export function readCachedAppList(_0x5856ed,_0x253666){const _0x52db1f=a2_0x71fd;if(!_0x253666?.['trim']())return null;const _0x289b96=getAppCacheFilePath(_0x5856ed,_0x253666);if(!existsSync(_0x289b96))return null;try{const _0x58c057=readFileSync(_0x289b96,'utf8');if(!_0x58c057[_0x52db1f(0x1bd)]())return null;const _0x2ed4ef=JSON['parse'](_0x58c057);if(!Array[_0x52db1f(0x1bb)](_0x2ed4ef[_0x52db1f(0x1b7)]))return null;return _0x2ed4ef;}catch{return null;}}export function writeCachedAppList(_0x35f062,_0x1ba2a2,_0x208754){const _0x9b7b2c=a2_0x71fd,_0x2eefdd=getAppCacheFilePath(_0x35f062,_0x1ba2a2),_0x4a60a8=dirname(_0x2eefdd);!existsSync(_0x4a60a8)&&mkdirSync(_0x4a60a8,{'recursive':!![]});const _0x354d88=_0x2eefdd+_0x9b7b2c(0x1b4);try{writeFileSync(_0x354d88,JSON['stringify'](_0x208754,null,0x2)+'\x0a',{'encoding':_0x9b7b2c(0x1c6),'mode':0x180});try{renameSync(_0x354d88,_0x2eefdd);}catch(_0x107423){if(_0x107423[_0x9b7b2c(0x1ca)]===_0x9b7b2c(0x1cb)||_0x107423['code']===_0x9b7b2c(0x1b2)||_0x107423['code']===_0x9b7b2c(0x1be)){writeFileSync(_0x2eefdd,JSON[_0x9b7b2c(0x1c0)](_0x208754,null,0x2)+'\x0a',{'encoding':_0x9b7b2c(0x1c6)});try{unlinkSync(_0x354d88);}catch{}}else throw _0x107423;}}catch(_0x5916c1){try{unlinkSync(_0x354d88);}catch{}throw _0x5916c1;}return _0x2eefdd;}export function resolveCachedAppCode(_0x11e6e7,_0x1e895f,_0x228491){const _0x17a9a0=a2_0x71fd;if(!_0x11e6e7)return undefined;const _0xb08539=readCachedAppList(_0x1e895f,_0x228491),_0x1e1c2a=_0xb08539?.[_0x17a9a0(0x1b7)][_0x17a9a0(0x1c9)](_0x3b1ea6=>_0x3b1ea6[_0x17a9a0(0x1ba)]===_0x11e6e7);return _0x1e1c2a?.[_0x17a9a0(0x1cc)]?.[_0x17a9a0(0x1bd)]()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a2_0x243027=a2_0x3fca;function a2_0x3fca(_0xf77fb4,_0x24ccf4){_0xf77fb4=_0xf77fb4-0x1b0;const _0xb5823b=a2_0xb582();let _0x3fcaed=_0xb5823b[_0xf77fb4];return _0x3fcaed;}(function(_0x1d440c,_0x995326){const _0x5e1a4e=a2_0x3fca,_0x88b901=_0x1d440c();while(!![]){try{const _0x2e1b09=parseInt(_0x5e1a4e(0x201))/0x1*(-parseInt(_0x5e1a4e(0x1c3))/0x2)+-parseInt(_0x5e1a4e(0x1fa))/0x3+parseInt(_0x5e1a4e(0x1be))/0x4*(-parseInt(_0x5e1a4e(0x1b4))/0x5)+parseInt(_0x5e1a4e(0x1b3))/0x6+parseInt(_0x5e1a4e(0x1e3))/0x7+parseInt(_0x5e1a4e(0x1f0))/0x8*(-parseInt(_0x5e1a4e(0x1bc))/0x9)+parseInt(_0x5e1a4e(0x1ef))/0xa;if(_0x2e1b09===_0x995326)break;else _0x88b901['push'](_0x88b901['shift']());}catch(_0xffcd70){_0x88b901['push'](_0x88b901['shift']());}}}(a2_0xb582,0xcc39a));import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';function a2_0xb582(){const _0xf56d0c=['args','find','../../commands/app/cache.js','appName','map','isArray','11850410iCiAAD','8trqTzR','name','source','\x22\x20not\x20found.','Read\x20app\x20list\x20from\x20local\x20cache\x20only','use','appOwnerName','Usage:\x20','nonInteractive','enableI18n','4428099nmBtJJ','No\x20apps\x20found\x20on\x20the\x20platform.','cachePath','length','list','push','\x20app\x20use\x20<name>\x20[--global]','208724DAoSaF','env','App\x20\x22','Loaded\x20','boolean','Refreshed\x20app\x20cache\x20with\x20','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','no-cache','3287772pMDjzN','120yImxPC','Missing\x20app\x20name.','Filter\x20by\x20environment\x20(default:\x20current\x20env)','project-default','Read\x20from\x20local\x20cache\x20only','remote','type','read','2802546TyjSCQ','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','12424FkOLdF','mergedCli','No\x20cached\x20apps\x20found.','\x20app(s)\x20for\x20env=\x22','fetchedAt','4AanWWN','import','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','str','bool','Use\x20`','validation','local','pull','langs','appCode','newConfigFileName','global','write','production','config','envName','app','../../commands/app/remote-source.js','Use\x20global\x20config\x20scope','cache','Set\x20the\x20fallback\x20app\x20candidate','trim','Initialize\x20','init','appcode','items','.appcode\x20to\x20.lovrabet.json.','string','entries','join','Default\x20app\x20candidate\x20set\x20to\x20\x22','9680454awRBCX','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','../../context.js','globalPath','isCurrent','i18nInfo'];a2_0xb582=function(){return _0xf56d0c;};return a2_0xb582();}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_0x243027(0x1cf),'type':'boolean','description':a2_0x243027(0x1d6),'default':![]};function collectFlags(_0x222856,_0x4d7024){const _0x37d741=a2_0x243027,_0x859f37={};for(const _0x17c8f0 of _0x4d7024){const _0x3b8eb8=_0x17c8f0[_0x37d741(0x1ba)]==='boolean'?_0x222856[_0x37d741(0x1c7)](_0x17c8f0[_0x37d741(0x1f1)]):_0x222856[_0x37d741(0x1c6)](_0x17c8f0[_0x37d741(0x1f1)]);if(_0x3b8eb8!==''&&_0x3b8eb8!==![])_0x859f37[_0x17c8f0['name']]=_0x3b8eb8;}if(_0x222856[_0x37d741(0x1f8)])_0x859f37[_0x37d741(0x1f8)]=!![];return _0x859f37;}function normalizeLanguages(_0xf2f4ff){const _0x10d624=a2_0x243027;if(!Array[_0x10d624(0x1ee)](_0xf2f4ff))return[];return _0xf2f4ff['filter'](_0x50cf9b=>typeof _0x50cf9b===_0x10d624(0x1df))['map'](_0x44eb38=>_0x44eb38['trim']())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x6fce63){const _0xecfa2=a2_0x243027,_0x2709b2=normalizeLanguages(_0x6fce63['i18nInfo']?.[_0xecfa2(0x1cc)]);return{'enableI18n':typeof _0x6fce63['enableI18n']===_0xecfa2(0x205)?_0x6fce63[_0xecfa2(0x1f9)]:null,'languages':_0x2709b2,'i18nInfo':_0x6fce63[_0xecfa2(0x1e8)]?{..._0x6fce63['i18nInfo'],'langs':_0x2709b2[_0xecfa2(0x1fd)]?_0x2709b2:null}:null};}const initDef={'service':'app','command':a2_0x243027(0x1db),'description':a2_0x243027(0x1da)+PRODUCT_CONFIG[a2_0x243027(0x1ce)]+'\x20config\x20file','risk':a2_0x243027(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x309f83){return await runInit(collectFlags(_0x309f83,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a2_0x243027(0x1d4),'command':a2_0x243027(0x1fe),'description':a2_0x243027(0x1b1),'risk':a2_0x243027(0x1bb),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':a2_0x243027(0x1df),'description':a2_0x243027(0x1b6),'enum':[...RUNTIME_ENV_VALUES]},{'name':a2_0x243027(0x1ca),'type':a2_0x243027(0x205),'description':a2_0x243027(0x1f4),'default':![]},{'name':a2_0x243027(0x1b2),'type':a2_0x243027(0x205),'description':a2_0x243027(0x1bd),'default':![]}],async 'execute'(_0x24cfd8){const _0x504116=a2_0x243027,_0x5f4a0d=_0x24cfd8[_0x504116(0x1c6)](_0x504116(0x202))||_0x24cfd8[_0x504116(0x1d3)]||getEnv()||_0x504116(0x1d1),_0x3c9b95=_0x24cfd8[_0x504116(0x1c7)](_0x504116(0x1ca)),_0x13934c=_0x24cfd8['bool'](_0x504116(0x1b2)),{readRawConfigWithLayers:_0x4dba29,resolveDefaultAppSource:_0xf42c72,getLocalAppAliases:_0x4bbdb3}=await import('../../context.js'),{getRemoteAppList:_0x479f3a}=await import(_0x504116(0x1d5)),{config:_0x5a0584,layers:_0x3d22a0}=_0x4dba29(),_0x1722a2=_0xf42c72(_0x3d22a0),{defaultApp:_0x67d583}=_0x5a0584,_0x3a335d=await _0x479f3a({'env':_0x5f4a0d,'accessKey':_0x24cfd8['accessKey'],'localOnly':_0x3c9b95,'noCache':_0x13934c}),_0x4a82d7=_0x3a335d[_0x504116(0x1dd)][_0x504116(0x1ed)](_0x266bdf=>{const _0x459adb=_0x504116;return{'name':_0x266bdf[_0x459adb(0x1ec)],'appcode':_0x266bdf[_0x459adb(0x1cd)],'named':!![],'definedIn':_0x459adb(0x1b9),'isDefault':_0x266bdf['appName']===_0x67d583,...buildAppProfileListFields(_0x5f4a0d),...buildRemoteAppI18nFields(_0x266bdf),'source':_0x3a335d[_0x459adb(0x1f2)],'owner':_0x266bdf[_0x459adb(0x1f6)]??null,'status':_0x266bdf['appPublishStatus']??null,'cachedAt':_0x3a335d[_0x459adb(0x1c2)]};}),_0x1f695f=_0x4bbdb3(_0x5a0584);let _0x31218c=0x0;for(const [_0x40ed96,_0x3d1788]of Object[_0x504116(0x1e0)](_0x1f695f)){const _0x368f15=typeof _0x3d1788[_0x504116(0x1dc)]===_0x504116(0x1df)?_0x3d1788[_0x504116(0x1dc)][_0x504116(0x1d9)]():'';if(!_0x368f15)continue;_0x31218c+=0x1,_0x4a82d7[_0x504116(0x1ff)]({'name':_0x40ed96,'appcode':_0x368f15,'named':!![],'definedIn':'local','isDefault':_0x40ed96===_0x67d583,...buildAppProfileListFields(_0x5f4a0d),'source':_0x504116(0x1d2),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x4a82d7,_0x24cfd8[_0x504116(0x1bf)]);if(_0x4a82d7[_0x504116(0x1fd)]===0x0)return{'ok':!![],'data':[],'message':_0x3a335d[_0x504116(0x1f2)]===_0x504116(0x1d7)?_0x504116(0x1c0):_0x504116(0x1fb)};const _0x2c6fc1=_0x4a82d7[_0x504116(0x1ea)](_0x2fb8ad=>_0x2fb8ad[_0x504116(0x1e7)]===!![]),_0x4ae46b=_0x67d583??_0x2c6fc1?.[_0x504116(0x1f1)]??null,_0x15c5f4={'env':_0x5f4a0d,'source':_0x3a335d[_0x504116(0x1f2)],'fetchedAt':_0x3a335d[_0x504116(0x1c2)],'cachePath':_0x3a335d[_0x504116(0x1fc)],'globalPath':_0x3d22a0[_0x504116(0x1e6)]??null,'projectPath':_0x3d22a0['projectPath']??null,'defaultApp':_0x4ae46b,'defaultAppSource':_0x67d583!=null?_0x1722a2:null,'localAliasCount':_0x31218c};return{'ok':!![],'data':{'items':_0x4a82d7,'meta':_0x15c5f4}};}},pullDef={'service':'app','command':a2_0x243027(0x1cb),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a2_0x243027(0x202),'type':a2_0x243027(0x1df),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a2_0x243027(0x205),'description':a2_0x243027(0x1b8),'default':![]},{'name':a2_0x243027(0x1b2),'type':a2_0x243027(0x205),'description':a2_0x243027(0x1bd),'default':![]}],async 'execute'(_0x2b9cc6){const _0xe6d970=a2_0x243027,_0x46e991=_0x2b9cc6[_0xe6d970(0x1c6)](_0xe6d970(0x202))||_0x2b9cc6[_0xe6d970(0x1d3)]||getEnv()||_0xe6d970(0x1d1),_0x3c754b=_0x2b9cc6[_0xe6d970(0x1c7)](_0xe6d970(0x1ca)),_0x5c04c3=_0x2b9cc6[_0xe6d970(0x1c7)](_0xe6d970(0x1b2)),{getRemoteAppList:_0x3e7ded}=await import(_0xe6d970(0x1d5)),_0x192c56=await _0x3e7ded({'env':_0x46e991,'accessKey':_0x2b9cc6['accessKey'],'localOnly':_0x3c754b,'noCache':_0x5c04c3});return{'ok':!![],'data':{'total':_0x192c56[_0xe6d970(0x1dd)][_0xe6d970(0x1fd)],'env':_0x46e991,'source':_0x192c56['source'],'fetchedAt':_0x192c56['fetchedAt'],'cachePath':_0x192c56[_0xe6d970(0x1fc)]},'message':_0x192c56[_0xe6d970(0x1f2)]===_0xe6d970(0x1d7)?_0xe6d970(0x204)+_0x192c56['items'][_0xe6d970(0x1fd)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x46e991+'\x22.':_0xe6d970(0x1b0)+_0x192c56[_0xe6d970(0x1dd)][_0xe6d970(0x1fd)]+_0xe6d970(0x1c1)+_0x46e991+'\x22.'};}},useDef={'service':a2_0x243027(0x1d4),'command':a2_0x243027(0x1f5),'description':a2_0x243027(0x1d8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a2_0x243027(0x1f1),'description':'Remote\x20app\x20name\x20to\x20activate','required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x364d6b){const _0xeadb63=a2_0x243027;if(!_0x364d6b['args'][0x0])throw CliErrors[_0xeadb63(0x1c9)](_0xeadb63(0x1b5),_0xeadb63(0x1f7)+CLI_BIN_NAME+_0xeadb63(0x200));},async 'execute'(_0x4efb27){const _0x253531=a2_0x243027,_0x40e896=_0x4efb27[_0x253531(0x1e9)][0x0];if(!_0x40e896)throw CliErrors[_0x253531(0x1c9)](_0x253531(0x1b5),_0x253531(0x1f7)+CLI_BIN_NAME+_0x253531(0x200));const {buildConfigFromFlags:_0x12c98f,resolveLocalAppAliasCode:_0x3120c3}=await import(_0x253531(0x1e5)),{readCachedAppList:_0x132c5c}=await import(_0x253531(0x1eb)),_0x1ccc59=_0x4efb27[_0x253531(0x1c6)](_0x253531(0x202)),_0x56fd5f=_0x12c98f(_0x1ccc59?{'env':_0x1ccc59}:{}),_0x150f3a=_0x132c5c(_0x56fd5f['env'],_0x56fd5f['accessKey']),_0x3d670e=_0x150f3a?.['items']['find'](_0x6786b=>_0x6786b[_0x253531(0x1ec)]===_0x40e896),_0x31fb27=_0x3120c3(_0x56fd5f['raw']??{},_0x40e896);if(!_0x3d670e&&!_0x31fb27&&_0x56fd5f['defaultApp']!==_0x40e896){const _0x43d182=[..._0x150f3a?.['items']['map'](_0x25c477=>_0x25c477[_0x253531(0x1ec)])??[]],_0x342321=_0x43d182['length']===0x0?_0x253531(0x1c8)+CLI_BIN_NAME+_0x253531(0x1c5)+_0x40e896+_0x253531(0x1de):'Available\x20remote\x20apps:\x20'+Array['from'](new Set(_0x43d182))[_0x253531(0x1e1)](',\x20')+_0x253531(0x1e4);throw CliErrors[_0x253531(0x1c9)](_0x253531(0x203)+_0x40e896+_0x253531(0x1f3),_0x342321);}const _0x4c9dd4=_0x4efb27['bool']('global');let _0x2230b2;if(_0x4c9dd4)_0x2230b2={'global':!![]};else{const {isInProject:_0x1ef739}=await import(_0x253531(0x1e5)),_0x4cd632=_0x1ef739();_0x2230b2=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x253531(0x1b7),'inProject':_0x4cd632}));}const _0x25244e=readConfig(_0x2230b2);return _0x25244e['defaultApp']=_0x40e896,writeConfig(_0x25244e,_0x2230b2),{'ok':!![],'message':_0x253531(0x1e2)+_0x40e896+'\x22'+scopeLabel(_0x2230b2)+'.'};}},importDef={'service':a2_0x243027(0x1d4),'command':a2_0x243027(0x1c4),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a2_0x243027(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x195f0c){return await runInitImport(collectFlags(_0x195f0c,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
function a3_0x243d(){const _0xa0c460=['../../context.js','Target\x20environment\x20(default:\x20current\x20env)','bool','appName','remote','read','304ASaxqI','find','appPublishStatus','7680ppPfYz','cache','source','local','isCurrent','i18nInfo','trim','items','No\x20apps\x20found\x20on\x20the\x20platform.','entries','list','mergedCli','Initialize\x20','from','no-cache','Remote\x20app\x20name\x20to\x20activate','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','Use\x20global\x20config\x20scope','string','No\x20cached\x20apps\x20found.','length','app','1282164uaQtak','247514kzmypm','2578555ImSZXK','production','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','nonInteractive','envName','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','\x20app(s)\x20for\x20env=\x22','Available\x20remote\x20apps:\x20','Set\x20the\x20fallback\x20app\x20candidate','pull','Default\x20app\x20candidate\x20set\x20to\x20\x22','5220TFpuBv','fetchedAt','3098528RbKWzs','env','Usage:\x20','Read\x20from\x20local\x20cache\x20only','accessKey','config','51xeFNoU','appCode','Filter\x20by\x20environment\x20(default:\x20current\x20env)','name','filter','join','map','38872hsrfhR','cachePath','Missing\x20app\x20name.','validation','write','App\x20\x22','global','9455htcryN','use','import','type','boolean','str','../../commands/app/remote-source.js','init','Refreshed\x20app\x20cache\x20with\x20','\x20cached\x20app(s)\x20for\x20env=\x22','args','Use\x20`','../../commands/app/cache.js','\x22\x20not\x20found.','langs','project-default','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','globalPath','projectPath','appcode','\x20app\x20use\x20<name>\x20[--global]','defaultApp','raw','\x20config\x20file'];a3_0x243d=function(){return _0xa0c460;};return a3_0x243d();}const a3_0x3379ec=a3_0x522b;(function(_0x2c13c0,_0x413dc2){const _0x3379b9=a3_0x522b,_0x584660=_0x2c13c0();while(!![]){try{const _0x361db0=-parseInt(_0x3379b9(0x1e6))/0x1+-parseInt(_0x3379b9(0x201))/0x2*(-parseInt(_0x3379b9(0x1fa))/0x3)+-parseInt(_0x3379b9(0x1cc))/0x4*(-parseInt(_0x3379b9(0x208))/0x5)+-parseInt(_0x3379b9(0x1e5))/0x6+parseInt(_0x3379b9(0x1e7))/0x7+parseInt(_0x3379b9(0x1f4))/0x8+parseInt(_0x3379b9(0x1f2))/0x9*(-parseInt(_0x3379b9(0x1cf))/0xa);if(_0x361db0===_0x413dc2)break;else _0x584660['push'](_0x584660['shift']());}catch(_0x12e515){_0x584660['push'](_0x584660['shift']());}}}(a3_0x243d,0x4ee59));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';function a3_0x522b(_0x195fe0,_0x1327ad){_0x195fe0=_0x195fe0-0x1c9;const _0x243db0=a3_0x243d();let _0x522b43=_0x243db0[_0x195fe0];return _0x522b43;}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':a3_0x3379ec(0x207),'type':a3_0x3379ec(0x20c),'description':a3_0x3379ec(0x1e0),'default':![]};function collectFlags(_0x1e753d,_0x231d26){const _0x352443=a3_0x3379ec,_0x44a640={};for(const _0x4206bd of _0x231d26){const _0xdac173=_0x4206bd[_0x352443(0x20b)]===_0x352443(0x20c)?_0x1e753d[_0x352443(0x222)](_0x4206bd[_0x352443(0x1fd)]):_0x1e753d[_0x352443(0x20d)](_0x4206bd[_0x352443(0x1fd)]);if(_0xdac173!==''&&_0xdac173!==![])_0x44a640[_0x4206bd[_0x352443(0x1fd)]]=_0xdac173;}if(_0x1e753d[_0x352443(0x1ea)])_0x44a640[_0x352443(0x1ea)]=!![];return _0x44a640;}function normalizeLanguages(_0x36286a){const _0x552473=a3_0x3379ec;if(!Array['isArray'](_0x36286a))return[];return _0x36286a[_0x552473(0x1fe)](_0x263290=>typeof _0x263290===_0x552473(0x1e1))[_0x552473(0x200)](_0x2d5ee9=>_0x2d5ee9[_0x552473(0x1d5)]())[_0x552473(0x1fe)](Boolean);}function buildRemoteAppI18nFields(_0x1c5d6a){const _0x1d54e7=a3_0x3379ec,_0xb84c4f=normalizeLanguages(_0x1c5d6a[_0x1d54e7(0x1d4)]?.[_0x1d54e7(0x216)]);return{'enableI18n':typeof _0x1c5d6a['enableI18n']===_0x1d54e7(0x20c)?_0x1c5d6a['enableI18n']:null,'languages':_0xb84c4f,'i18nInfo':_0x1c5d6a[_0x1d54e7(0x1d4)]?{..._0x1c5d6a['i18nInfo'],'langs':_0xb84c4f['length']?_0xb84c4f:null}:null};}const initDef={'service':a3_0x3379ec(0x1e4),'command':a3_0x3379ec(0x20f),'description':a3_0x3379ec(0x1db)+PRODUCT_CONFIG['newConfigFileName']+a3_0x3379ec(0x21f),'risk':a3_0x3379ec(0x205),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x1af295){return await runInit(collectFlags(_0x1af295,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x3379ec(0x1e4),'command':a3_0x3379ec(0x1d9),'description':a3_0x3379ec(0x1df),'risk':a3_0x3379ec(0x1cb),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':'string','description':a3_0x3379ec(0x1fc),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x3379ec(0x1d2),'type':a3_0x3379ec(0x20c),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x3379ec(0x1dd),'type':'boolean','description':a3_0x3379ec(0x218),'default':![]}],async 'execute'(_0x1ba028){const _0x312973=a3_0x3379ec,_0x2a18c2=_0x1ba028[_0x312973(0x20d)](_0x312973(0x1f5))||_0x1ba028['envName']||getEnv()||_0x312973(0x1e8),_0x4ea0e5=_0x1ba028[_0x312973(0x222)](_0x312973(0x1d2)),_0x14f836=_0x1ba028[_0x312973(0x222)](_0x312973(0x1dd)),{readRawConfigWithLayers:_0x36b150,resolveDefaultAppSource:_0x432aea,getLocalAppAliases:_0x27c3a8}=await import('../../context.js'),{getRemoteAppList:_0x5cc004}=await import('../../commands/app/remote-source.js'),{config:_0x243b01,layers:_0x3a00bc}=_0x36b150(),_0x238cd5=_0x432aea(_0x3a00bc),{defaultApp:_0x40217f}=_0x243b01,_0x103c49=await _0x5cc004({'env':_0x2a18c2,'accessKey':_0x1ba028[_0x312973(0x1f8)],'localOnly':_0x4ea0e5,'noCache':_0x14f836}),_0x649234=_0x103c49[_0x312973(0x1d6)][_0x312973(0x200)](_0x2d31b9=>{const _0x2ca0f5=_0x312973;return{'name':_0x2d31b9['appName'],'appcode':_0x2d31b9[_0x2ca0f5(0x1fb)],'named':!![],'definedIn':_0x2ca0f5(0x1ca),'isDefault':_0x2d31b9[_0x2ca0f5(0x1c9)]===_0x40217f,...buildAppProfileListFields(_0x2a18c2),...buildRemoteAppI18nFields(_0x2d31b9),'source':_0x103c49[_0x2ca0f5(0x1d1)],'owner':_0x2d31b9['appOwnerName']??null,'status':_0x2d31b9[_0x2ca0f5(0x1ce)]??null,'cachedAt':_0x103c49[_0x2ca0f5(0x1f3)]};}),_0x4ac3b1=_0x27c3a8(_0x243b01);let _0x19705c=0x0;for(const [_0x1590ca,_0x4fb85d]of Object[_0x312973(0x1d8)](_0x4ac3b1)){const _0x32bb77=typeof _0x4fb85d[_0x312973(0x21b)]===_0x312973(0x1e1)?_0x4fb85d['appcode'][_0x312973(0x1d5)]():'';if(!_0x32bb77)continue;_0x19705c+=0x1,_0x649234['push']({'name':_0x1590ca,'appcode':_0x32bb77,'named':!![],'definedIn':_0x312973(0x1d2),'isDefault':_0x1590ca===_0x40217f,...buildAppProfileListFields(_0x2a18c2),'source':_0x312973(0x1f9),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x649234,_0x1ba028[_0x312973(0x1da)]);if(_0x649234[_0x312973(0x1e3)]===0x0)return{'ok':!![],'data':[],'message':_0x103c49[_0x312973(0x1d1)]===_0x312973(0x1d0)?_0x312973(0x1e2):_0x312973(0x1d7)};const _0x139df4=_0x649234[_0x312973(0x1cd)](_0x3d2e3b=>_0x3d2e3b[_0x312973(0x1d3)]===!![]),_0x2ae555=_0x40217f??_0x139df4?.[_0x312973(0x1fd)]??null,_0x48c2cb={'env':_0x2a18c2,'source':_0x103c49[_0x312973(0x1d1)],'fetchedAt':_0x103c49[_0x312973(0x1f3)],'cachePath':_0x103c49[_0x312973(0x202)],'globalPath':_0x3a00bc[_0x312973(0x219)]??null,'projectPath':_0x3a00bc[_0x312973(0x21a)]??null,'defaultApp':_0x2ae555,'defaultAppSource':_0x40217f!=null?_0x238cd5:null,'localAliasCount':_0x19705c};return{'ok':!![],'data':{'items':_0x649234,'meta':_0x48c2cb}};}},pullDef={'service':a3_0x3379ec(0x1e4),'command':a3_0x3379ec(0x1f0),'description':a3_0x3379ec(0x1e9),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x3379ec(0x1f5),'type':'string','description':a3_0x3379ec(0x221),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x3379ec(0x1d2),'type':a3_0x3379ec(0x20c),'description':a3_0x3379ec(0x1f7),'default':![]},{'name':a3_0x3379ec(0x1dd),'type':'boolean','description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x2b0ffa){const _0xd4d62e=a3_0x3379ec,_0x19512d=_0x2b0ffa[_0xd4d62e(0x20d)](_0xd4d62e(0x1f5))||_0x2b0ffa[_0xd4d62e(0x1eb)]||getEnv()||_0xd4d62e(0x1e8),_0x25698a=_0x2b0ffa['bool'](_0xd4d62e(0x1d2)),_0x439dba=_0x2b0ffa['bool'](_0xd4d62e(0x1dd)),{getRemoteAppList:_0x3063e}=await import(_0xd4d62e(0x20e)),_0x3e5d68=await _0x3063e({'env':_0x19512d,'accessKey':_0x2b0ffa[_0xd4d62e(0x1f8)],'localOnly':_0x25698a,'noCache':_0x439dba});return{'ok':!![],'data':{'total':_0x3e5d68[_0xd4d62e(0x1d6)]['length'],'env':_0x19512d,'source':_0x3e5d68[_0xd4d62e(0x1d1)],'fetchedAt':_0x3e5d68[_0xd4d62e(0x1f3)],'cachePath':_0x3e5d68[_0xd4d62e(0x202)]},'message':_0x3e5d68[_0xd4d62e(0x1d1)]===_0xd4d62e(0x1d0)?'Loaded\x20'+_0x3e5d68['items'][_0xd4d62e(0x1e3)]+_0xd4d62e(0x211)+_0x19512d+'\x22.':_0xd4d62e(0x210)+_0x3e5d68['items'][_0xd4d62e(0x1e3)]+_0xd4d62e(0x1ed)+_0x19512d+'\x22.'};}},useDef={'service':a3_0x3379ec(0x1e4),'command':a3_0x3379ec(0x209),'description':a3_0x3379ec(0x1ef),'risk':a3_0x3379ec(0x205),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x3379ec(0x1fd),'description':a3_0x3379ec(0x1de),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x1c6fc0){const _0x27e760=a3_0x3379ec;if(!_0x1c6fc0[_0x27e760(0x212)][0x0])throw CliErrors[_0x27e760(0x204)](_0x27e760(0x203),_0x27e760(0x1f6)+CLI_BIN_NAME+_0x27e760(0x21c));},async 'execute'(_0x48c368){const _0x1453d9=a3_0x3379ec,_0x19cba0=_0x48c368['args'][0x0];if(!_0x19cba0)throw CliErrors[_0x1453d9(0x204)]('Missing\x20app\x20name.',_0x1453d9(0x1f6)+CLI_BIN_NAME+_0x1453d9(0x21c));const {buildConfigFromFlags:_0x150fac,resolveLocalAppAliasCode:_0x5026d5}=await import(_0x1453d9(0x220)),{readCachedAppList:_0x43fbd6}=await import(_0x1453d9(0x214)),_0x2eae14=_0x48c368[_0x1453d9(0x20d)](_0x1453d9(0x1f5)),_0x31a3e6=_0x150fac(_0x2eae14?{'env':_0x2eae14}:{}),_0x260ff7=_0x43fbd6(_0x31a3e6[_0x1453d9(0x1f5)],_0x31a3e6[_0x1453d9(0x1f8)]),_0x2322ce=_0x260ff7?.['items']['find'](_0x58ce7a=>_0x58ce7a['appName']===_0x19cba0),_0x5dd5f4=_0x5026d5(_0x31a3e6[_0x1453d9(0x21e)]??{},_0x19cba0);if(!_0x2322ce&&!_0x5dd5f4&&_0x31a3e6[_0x1453d9(0x21d)]!==_0x19cba0){const _0x3de21e=[..._0x260ff7?.[_0x1453d9(0x1d6)][_0x1453d9(0x200)](_0x57924f=>_0x57924f['appName'])??[]],_0x2f9759=_0x3de21e[_0x1453d9(0x1e3)]===0x0?_0x1453d9(0x213)+CLI_BIN_NAME+'\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.'+_0x19cba0+'.appcode\x20to\x20.lovrabet.json.':_0x1453d9(0x1ee)+Array[_0x1453d9(0x1dc)](new Set(_0x3de21e))[_0x1453d9(0x1ff)](',\x20')+_0x1453d9(0x1ec);throw CliErrors['validation'](_0x1453d9(0x206)+_0x19cba0+_0x1453d9(0x215),_0x2f9759);}const _0x34f252=_0x48c368[_0x1453d9(0x222)]('global');let _0x7a3871;if(_0x34f252)_0x7a3871={'global':!![]};else{const {isInProject:_0x290ce6}=await import(_0x1453d9(0x220)),_0x25d0cb=_0x290ce6();_0x7a3871=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x1453d9(0x217),'inProject':_0x25d0cb}));}const _0x2a2094=readConfig(_0x7a3871);return _0x2a2094[_0x1453d9(0x21d)]=_0x19cba0,writeConfig(_0x2a2094,_0x7a3871),{'ok':!![],'message':_0x1453d9(0x1f1)+_0x19cba0+'\x22'+scopeLabel(_0x7a3871)+'.'};}},importDef={'service':'app','command':a3_0x3379ec(0x20a),'description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0x3379ec(0x205),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x4c72bb){return await runInitImport(collectFlags(_0x4c72bb,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x107c1e,_0x289fa1){const _0x44ffa4=a4_0x324e,_0x4b4d14=_0x107c1e();while(!![]){try{const _0x2a96d8=-parseInt(_0x44ffa4(0x1cb))/0x1*(-parseInt(_0x44ffa4(0x1cf))/0x2)+parseInt(_0x44ffa4(0x1ca))/0x3+-parseInt(_0x44ffa4(0x1d0))/0x4*(parseInt(_0x44ffa4(0x1d1))/0x5)+parseInt(_0x44ffa4(0x1c8))/0x6+parseInt(_0x44ffa4(0x1c7))/0x7+-parseInt(_0x44ffa4(0x1cc))/0x8*(-parseInt(_0x44ffa4(0x1c6))/0x9)+parseInt(_0x44ffa4(0x1c9))/0xa*(-parseInt(_0x44ffa4(0x1ce))/0xb);if(_0x2a96d8===_0x289fa1)break;else _0x4b4d14['push'](_0x4b4d14['shift']());}catch(_0x2bd6d2){_0x4b4d14['push'](_0x4b4d14['shift']());}}}(a4_0x3734,0x5384d));import{fileURLToPath}from'url';import{dirname,join}from'path';function a4_0x3734(){const _0x2604dc=['2424344WzWIYO','utf-8','9227735seJGvc','23438gWOlUf','156932NnLvIx','65kTZvwj','tableData','success','Mock\x20API\x20error:\x20','9gHWNbw','1355403vkyXbY','2469552vzRrFW','10mDgbyH','836478WwkJAt','43WZmbdL'];a4_0x3734=function(){return _0x2604dc;};return a4_0x3734();}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x11a8df=a4_0x324e,_0x4ffe1e=join(__dirname,'../../../mock/app-list.json'),_0x49cb23=readFileSync(_0x4ffe1e,_0x11a8df(0x1cd));return JSON['parse'](_0x49cb23);}function a4_0x324e(_0x4cae48,_0xfba5fc){_0x4cae48=_0x4cae48-0x1c5;const _0x37343f=a4_0x3734();let _0x324e68=_0x37343f[_0x4cae48];return _0x324e68;}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x504041=a4_0x324e,_0x3d6c21=getMockAppList();if(!_0x3d6c21[_0x504041(0x1d3)])throw new Error(_0x504041(0x1c5)+_0x3d6c21['errorMsg']+'\x20('+_0x3d6c21['errorCode']+')');return _0x3d6c21['data'][_0x504041(0x1d2)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a5_0x5065(){const _0xae14f0=['toISOString','651xNGGFy','remote','fetchedAt','items','334196dkylIM','76320HvUwLt','388911qdRynx','11976Vxnzuf','1271931pCCuwK','APP_LIST_SOURCE','cache','trim','96140oMMOEQ','7659HtpgCK','1910obMqUa','2njZLFI'];a5_0x5065=function(){return _0xae14f0;};return a5_0x5065();}(function(_0x3b63a9,_0x3f5745){const _0xbb92b1=a5_0x2fc8,_0x543e9e=_0x3b63a9();while(!![]){try{const _0x40bd4f=-parseInt(_0xbb92b1(0xa7))/0x1*(-parseInt(_0xbb92b1(0x9f))/0x2)+-parseInt(_0xbb92b1(0xa9))/0x3+-parseInt(_0xbb92b1(0xa5))/0x4+-parseInt(_0xbb92b1(0x9c))/0x5+parseInt(_0xbb92b1(0xa8))/0x6*(parseInt(_0xbb92b1(0xa1))/0x7)+parseInt(_0xbb92b1(0xa6))/0x8+-parseInt(_0xbb92b1(0x9d))/0x9*(-parseInt(_0xbb92b1(0x9e))/0xa);if(_0x40bd4f===_0x3f5745)break;else _0x543e9e['push'](_0x543e9e['shift']());}catch(_0x433364){_0x543e9e['push'](_0x543e9e['shift']());}}}(a5_0x5065,0x35ada));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 _0x509415=a5_0x2fc8,_0x34b62d=(productEnv(_0x509415(0xaa))||'')[_0x509415(0x9b)]()['toLowerCase']();return _0x34b62d==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}function a5_0x2fc8(_0x14811e,_0xf63538){_0x14811e=_0x14811e-0x9b;const _0x5065f2=a5_0x5065();let _0x2fc8ea=_0x5065f2[_0x14811e];return _0x2fc8ea;}export async function getRemoteAppList(_0x5d097d){const _0x2609f3=a5_0x2fc8,{env:_0x4b4594,accessKey:_0x2767ec,localOnly:localOnly=![],noCache:noCache=![]}=_0x5d097d,_0x1f6e64=readCachedAppList(_0x4b4594,_0x2767ec),_0x2b6323=_0x2767ec?.[_0x2609f3(0x9b)]()?getAppCacheFilePath(_0x4b4594,_0x2767ec):null;if(localOnly)return{'items':_0x1f6e64?.[_0x2609f3(0xa4)]??[],'source':_0x2609f3(0xab),'fetchedAt':_0x1f6e64?.[_0x2609f3(0xa3)]??null,'cachePath':_0x2b6323};try{const _0x5c1423=await getRemoteAppItems(),_0x3f8ed4=shouldUseMockRemoteApps()?'mock':_0x2609f3(0xa2),_0xe84c8e=new Date()[_0x2609f3(0xa0)](),_0x104835=_0x2767ec?.['trim']()?writeCachedAppList(_0x4b4594,_0x2767ec,{'env':_0x4b4594,'fetchedAt':_0xe84c8e,'source':_0x3f8ed4,'items':_0x5c1423}):null;return{'items':_0x5c1423,'source':_0x3f8ed4,'fetchedAt':_0xe84c8e,'cachePath':_0x104835};}catch(_0x8084bd){if(!noCache&&_0x1f6e64)return{'items':_0x1f6e64[_0x2609f3(0xa4)],'source':'cache','fetchedAt':_0x1f6e64['fetchedAt'],'cachePath':_0x2b6323};throw _0x8084bd;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5aab2b,_0x11cf0c){const _0x4dbb92=a6_0x3855,_0x1744cd=_0x5aab2b();while(!![]){try{const _0x429cd6=parseInt(_0x4dbb92(0x135))/0x1+parseInt(_0x4dbb92(0x126))/0x2+-parseInt(_0x4dbb92(0x128))/0x3*(-parseInt(_0x4dbb92(0x12e))/0x4)+parseInt(_0x4dbb92(0x129))/0x5*(-parseInt(_0x4dbb92(0x12c))/0x6)+-parseInt(_0x4dbb92(0x139))/0x7*(-parseInt(_0x4dbb92(0x130))/0x8)+-parseInt(_0x4dbb92(0x136))/0x9+-parseInt(_0x4dbb92(0x12b))/0xa*(-parseInt(_0x4dbb92(0x13a))/0xb);if(_0x429cd6===_0x11cf0c)break;else _0x1744cd['push'](_0x1744cd['shift']());}catch(_0x4ce6b2){_0x1744cd['push'](_0x1744cd['shift']());}}}(a6_0x47a3,0x1e98f));import{CLI_BIN_NAME}from'../../constant/cli.js';function a6_0x3855(_0x5accea,_0x4c92ae){_0x5accea=_0x5accea-0x124;const _0x47a318=a6_0x47a3();let _0x385576=_0x47a318[_0x5accea];return _0x385576;}import{formatScopeLabel}from'../../commands/common/config-policy.js';function a6_0x47a3(){const _0x3512e1=['local','125900aZVFBm','named','36510cjIqjn','5FIQTQo','trim','152270JzNIul','661278fdVtPx','find','12RVEbUi','isCurrent','8xEetgt','definedIn','currentApp','project','name','150280gCwwRF','2246778AbVvQx','defaultApp','global','49259BhLBPx','165CURdIg','appcode'];a6_0x47a3=function(){return _0x3512e1;};return a6_0x47a3();}export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x493f3f,_0x34fb9a){const _0x119457=a6_0x3855;if(!_0x34fb9a)return;const _0x15eee8=!!(_0x34fb9a[_0x119457(0x132)]??_0x34fb9a['defaultApp']);for(const _0xbbebc2 of _0x493f3f){_0xbbebc2[_0x119457(0x12f)]=![];}const _0xd6fb6b=_0x34fb9a['appCode']!=null?String(_0x34fb9a['appCode'])[_0x119457(0x12a)]():'';if(_0x15eee8){const _0x4349ec=_0x34fb9a[_0x119457(0x132)]??_0x34fb9a[_0x119457(0x137)];if(_0x4349ec){const _0x51c6cf=_0x493f3f[_0x119457(0x12d)](_0x2e761e=>_0x2e761e[_0x119457(0x127)]===!![]&&_0x2e761e[_0x119457(0x134)]===_0x4349ec&&_0x2e761e[_0x119457(0x131)]===_0x119457(0x125)),_0x45cdea=_0x51c6cf??_0x493f3f[_0x119457(0x12d)](_0x31bb4a=>_0x31bb4a[_0x119457(0x127)]===!![]&&_0x31bb4a[_0x119457(0x134)]===_0x4349ec);_0x45cdea&&(_0x45cdea[_0x119457(0x12f)]=!![]);}return;}if(!_0xd6fb6b)return;for(const _0x497014 of _0x493f3f){String(_0x497014[_0x119457(0x124)]??'')[_0x119457(0x12a)]()===_0xd6fb6b&&(_0x497014['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x3139e6){const _0x11d520=a6_0x3855;return formatScopeLabel(_0x3139e6[_0x11d520(0x138)]?_0x11d520(0x138):_0x11d520(0x133));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a7_0x5dbf61=a7_0x25a0;function a7_0x25a0(_0x4e73da,_0x39f128){_0x4e73da=_0x4e73da-0x12d;const _0x418c6f=a7_0x418c();let _0x25a018=_0x418c6f[_0x4e73da];return _0x25a018;}(function(_0x3d95c6,_0x56fb1b){const _0x563105=a7_0x25a0,_0x1a5f31=_0x3d95c6();while(!![]){try{const _0x5f1674=-parseInt(_0x563105(0x146))/0x1+-parseInt(_0x563105(0x15a))/0x2+-parseInt(_0x563105(0x13c))/0x3*(parseInt(_0x563105(0x155))/0x4)+-parseInt(_0x563105(0x16c))/0x5*(-parseInt(_0x563105(0x133))/0x6)+-parseInt(_0x563105(0x150))/0x7+parseInt(_0x563105(0x172))/0x8*(parseInt(_0x563105(0x134))/0x9)+parseInt(_0x563105(0x175))/0xa*(-parseInt(_0x563105(0x158))/0xb);if(_0x5f1674===_0x56fb1b)break;else _0x1a5f31['push'](_0x1a5f31['shift']());}catch(_0x5d2975){_0x1a5f31['push'](_0x1a5f31['shift']());}}}(a7_0x418c,0x706bc));import{existsSync,readFileSync,statSync}from'node:fs';function a7_0x418c(){const _0x4fa780=['update','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','some','list','790517LvWbCh','appCode','lastIndex','name','List\x20current-app\x20react_module\x20Artifacts','28rxMVHE','body','File\x20is\x20not\x20a\x20regular\x20file:\x20','391259nQGOfR','build','330990qlDZit','test','num','Artifact\x20display\x20name','file','AGENT','parse','split','artifact','Artifact\x20ID','react-dom','length','isArray','trim','favorite','write','string','react_module','170OKRZko','File\x20path\x20is\x20required.','metadata','create','validation','flag','2849448TQpJiw','compiledContent','bool','20worxKu','description','deleted','updateTime','utf8','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','createTime','lodash','join','Updated\x20Artifact\x20','dayjs','str','react_module\x20imports\x20are\x20limited\x20to:\x20','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','161562mbxNKv','9TppSxV','source','react','Artifact\x20source\x20file\x20is\x20blank.','Preview:\x20create\x20react_module\x20Artifact','map','read','filter','50658XRscmi','File\x20not\x20found:\x20','Invalid\x20JSON\x20for\x20--metadata:\x20','verbose','artifactType','--metadata\x20must\x20be\x20a\x20JSON\x20object.','Optional\x20favorite-state\x20filter','/client/artifact/','Show\x20one\x20Artifact\x20by\x20id','content','343457bFQach','.\x20Unsupported:\x20','object','antd','POST','isFile'];a7_0x418c=function(){return _0x4fa780;};return a7_0x418c();}import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a7_0x5dbf61(0x16b),ARTIFACT_SOURCE_AGENT=a7_0x5dbf61(0x15f),ALLOWED_REACT_MODULE_IMPORTS=[a7_0x5dbf61(0x136),a7_0x5dbf61(0x164),a7_0x5dbf61(0x17c),a7_0x5dbf61(0x12f),a7_0x5dbf61(0x149),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a7_0x5dbf61(0x15e),'type':a7_0x5dbf61(0x16a),'required':!![],'description':a7_0x5dbf61(0x14d)},ARTIFACT_NAME_FLAG={'name':a7_0x5dbf61(0x153),'type':a7_0x5dbf61(0x16a),'description':a7_0x5dbf61(0x15d)},METADATA_FLAG={'name':a7_0x5dbf61(0x16e),'type':a7_0x5dbf61(0x16a),'description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x41cff5){const _0x560eea=a7_0x5dbf61;return typeof _0x41cff5===_0x560eea(0x148)&&_0x41cff5!==null&&!Array[_0x560eea(0x166)](_0x41cff5);}function readSourceFile(_0x716a40){const _0x27450a=a7_0x5dbf61;if(!_0x716a40)throw CliErrors[_0x27450a(0x170)](_0x27450a(0x16d));if(!existsSync(_0x716a40))throw CliErrors[_0x27450a(0x170)](_0x27450a(0x13d)+_0x716a40);if(!statSync(_0x716a40)[_0x27450a(0x14b)]())throw CliErrors[_0x27450a(0x170)](_0x27450a(0x157)+_0x716a40);const _0xcafda=readFileSync(_0x716a40,_0x27450a(0x179));return validateReactModuleSource(_0xcafda),_0xcafda;}function parseMetadata(_0xc7026a){const _0x2c4beb=a7_0x5dbf61;if(!_0xc7026a)return undefined;let _0x3863f0;try{_0x3863f0=JSON[_0x2c4beb(0x160)](_0xc7026a);}catch{throw CliErrors[_0x2c4beb(0x170)](_0x2c4beb(0x13e)+_0xc7026a);}if(!isPlainObject(_0x3863f0))throw CliErrors[_0x2c4beb(0x170)](_0x2c4beb(0x141));const _0x4d10ad={..._0x3863f0};return delete _0x4d10ad[_0x2c4beb(0x173)],_0x4d10ad;}function getPackageName(_0x329b87){const _0x220e63=a7_0x5dbf61;if(_0x329b87['startsWith']('@')){const [_0x59d3c8,_0x23f858]=_0x329b87[_0x220e63(0x161)]('/');return _0x59d3c8&&_0x23f858?_0x59d3c8+'/'+_0x23f858:_0x329b87;}return _0x329b87[_0x220e63(0x161)]('/')[0x0]||_0x329b87;}function validateAllowedImports(_0x3da3eb){const _0x46b142=a7_0x5dbf61,_0x556440=new Set();for(const _0x5df1e1 of IMPORT_SOURCE_PATTERNS){_0x5df1e1[_0x46b142(0x152)]=0x0;let _0x4e5715;while((_0x4e5715=_0x5df1e1['exec'](_0x3da3eb))!==null){const _0x42397e=_0x4e5715[0x1]?.[_0x46b142(0x167)]();_0x42397e&&_0x556440['add'](_0x42397e);}}const _0xd8ca25=[..._0x556440]['map'](getPackageName)[_0x46b142(0x13b)](_0x3ecffa=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x3ecffa));if(_0xd8ca25['length']>0x0)throw CliErrors['validation'](_0x46b142(0x131)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x46b142(0x147)+[...new Set(_0xd8ca25)][_0x46b142(0x12d)](',\x20'));}export function validateReactModuleSource(_0x2b7f72){const _0x208493=a7_0x5dbf61;if(!_0x2b7f72[_0x208493(0x167)]())throw CliErrors['validation'](_0x208493(0x137));if(PAGE_LEVEL_PATTERNS[_0x208493(0x14e)](_0x5befe4=>_0x5befe4[_0x208493(0x15b)](_0x2b7f72)))throw CliErrors[_0x208493(0x170)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x2b7f72);}function buildArtifactInput(_0x39b955){const _0x4b227d=a7_0x5dbf61,_0x3e05d4=readSourceFile(_0x39b955['str'](_0x4b227d(0x15e))),_0x491df9=_0x39b955[_0x4b227d(0x130)](_0x4b227d(0x153))[_0x4b227d(0x167)](),_0x2d6d86=parseMetadata(_0x39b955[_0x4b227d(0x130)](_0x4b227d(0x16e)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x491df9?{'name':_0x491df9}:{},'content':_0x3e05d4,..._0x2d6d86?{'metadata':_0x2d6d86}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x5a8f4e){const _0x481527=a7_0x5dbf61;return{'id':_0x5a8f4e['id'],'name':_0x5a8f4e['name'],'artifactType':_0x5a8f4e['artifactType'],'source':_0x5a8f4e[_0x481527(0x135)],'favorite':_0x5a8f4e['favorite'],'deleted':_0x5a8f4e[_0x481527(0x177)],'createTime':_0x5a8f4e['createTime'],'updateTime':_0x5a8f4e[_0x481527(0x178)]};}function detailArtifact(_0x4e042b){const _0x57756c=a7_0x5dbf61;return{'id':_0x4e042b['id'],'appCode':_0x4e042b['appCode'],'name':_0x4e042b[_0x57756c(0x153)],'artifactType':_0x4e042b[_0x57756c(0x140)],'source':_0x4e042b[_0x57756c(0x135)],'favorite':_0x4e042b[_0x57756c(0x168)],'deleted':_0x4e042b[_0x57756c(0x177)],'content':_0x4e042b[_0x57756c(0x145)]??'','compiledContent':_0x4e042b[_0x57756c(0x173)],'metadata':_0x4e042b[_0x57756c(0x16e)]??{},'createTime':_0x4e042b[_0x57756c(0x17b)],'updateTime':_0x4e042b['updateTime']};}function readFavoriteFlag(_0x52590f){const _0x46135a=a7_0x5dbf61,_0x4938a0=_0x52590f[_0x46135a(0x171)]('favorite');return _0x4938a0===undefined||_0x4938a0===null||_0x4938a0===''?undefined:_0x52590f[_0x46135a(0x174)]('favorite');}const artifactList={'service':a7_0x5dbf61(0x162),'command':a7_0x5dbf61(0x14f),'description':a7_0x5dbf61(0x154),'risk':'read','flags':[{'name':'source','type':a7_0x5dbf61(0x16a),'description':'Optional\x20source\x20filter,\x20for\x20example\x20AGENT'},{'name':'favorite','type':'boolean','description':a7_0x5dbf61(0x142)},VERBOSE_FLAG],async 'execute'(_0x38ac05){const _0x5925dc=a7_0x5dbf61,_0x13ceda=await listRuntimeArtifacts(_0x38ac05[_0x5925dc(0x151)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x38ac05[_0x5925dc(0x130)]('source')?{'source':_0x38ac05[_0x5925dc(0x130)](_0x5925dc(0x135))}:{},...readFavoriteFlag(_0x38ac05)!==undefined?{'favorite':readFavoriteFlag(_0x38ac05)}:{}});return{'ok':!![],'data':{'total':_0x13ceda[_0x5925dc(0x165)],'items':_0x38ac05[_0x5925dc(0x174)](_0x5925dc(0x13f))?_0x13ceda:_0x13ceda[_0x5925dc(0x139)](summarizeArtifact)}};}},artifactDetail={'service':a7_0x5dbf61(0x162),'command':'detail','description':a7_0x5dbf61(0x144),'risk':a7_0x5dbf61(0x13a),'flags':[{...ID_FLAG,'description':a7_0x5dbf61(0x163)}],async 'execute'(_0x3218c4){const _0x717692=a7_0x5dbf61,_0x21d09d=await getRuntimeArtifact(_0x3218c4[_0x717692(0x15c)]('id'),_0x3218c4[_0x717692(0x151)]);return{'ok':!![],'data':detailArtifact(_0x21d09d)};}},artifactCreate={'service':a7_0x5dbf61(0x162),'command':a7_0x5dbf61(0x16f),'description':a7_0x5dbf61(0x17a),'risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2d2340){const _0x29a9c8=a7_0x5dbf61,_0x3fe72f=buildArtifactInput(_0x2d2340),_0x4bfe88=await createRuntimeArtifact(_0x2d2340[_0x29a9c8(0x151)],_0x3fe72f);return{'ok':!![],'data':detailArtifact(_0x4bfe88),'message':'Created\x20Artifact\x20'+_0x4bfe88['id']+(_0x4bfe88['name']?'\x20('+_0x4bfe88[_0x29a9c8(0x153)]+')':'')};},async 'dryRun'(_0x407593){const _0x453797=a7_0x5dbf61,_0x1ecf7c=buildArtifactInput(_0x407593);return dryRun(_0x453797(0x14a),'/client/artifact/create')['body']({'appCode':_0x407593[_0x453797(0x151)],..._0x1ecf7c})[_0x453797(0x176)](_0x453797(0x138))[_0x453797(0x159)]();}},artifactUpdate={'service':a7_0x5dbf61(0x162),'command':a7_0x5dbf61(0x14c),'description':a7_0x5dbf61(0x132),'risk':a7_0x5dbf61(0x169),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x12d4ce){const _0x3bce83=a7_0x5dbf61,_0x1acd0a=_0x12d4ce[_0x3bce83(0x15c)]('id'),_0x71fbc2=buildArtifactInput(_0x12d4ce),_0x1015b0=await updateRuntimeArtifact(_0x1acd0a,_0x12d4ce[_0x3bce83(0x151)],_0x71fbc2);return{'ok':!![],'data':detailArtifact(_0x1015b0),'message':_0x3bce83(0x12e)+_0x1015b0['id']+(_0x1015b0[_0x3bce83(0x153)]?'\x20('+_0x1015b0[_0x3bce83(0x153)]+')':'')};},async 'dryRun'(_0x1cb013){const _0x24d45a=a7_0x5dbf61,_0x46ebb9=_0x1cb013[_0x24d45a(0x15c)]('id'),_0x160d7f=buildArtifactInput(_0x1cb013);return dryRun(_0x24d45a(0x14a),_0x24d45a(0x143)+_0x46ebb9+'/update')[_0x24d45a(0x156)]({'appCode':_0x1cb013[_0x24d45a(0x151)],..._0x160d7f})[_0x24d45a(0x176)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x46ebb9)[_0x24d45a(0x159)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a6_0x2d3f3b=a6_0x3192;(function(_0x28d95f,_0x580bcd){const _0x5f3c25=a6_0x3192,_0x6f69a6=_0x28d95f();while(!![]){try{const _0x3794ec=-parseInt(_0x5f3c25(0x228))/0x1+parseInt(_0x5f3c25(0x21f))/0x2*(-parseInt(_0x5f3c25(0x215))/0x3)+-parseInt(_0x5f3c25(0x225))/0x4*(-parseInt(_0x5f3c25(0x22a))/0x5)+-parseInt(_0x5f3c25(0x21a))/0x6+parseInt(_0x5f3c25(0x1e5))/0x7*(-parseInt(_0x5f3c25(0x1f9))/0x8)+-parseInt(_0x5f3c25(0x1e3))/0x9+-parseInt(_0x5f3c25(0x1fe))/0xa*(-parseInt(_0x5f3c25(0x1ef))/0xb);if(_0x3794ec===_0x580bcd)break;else _0x6f69a6['push'](_0x6f69a6['shift']());}catch(_0x4cea4b){_0x6f69a6['push'](_0x6f69a6['shift']());}}}(a6_0x5eff,0x73343));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';function a6_0x3192(_0x4b97d6,_0x18cd9b){_0x4b97d6=_0x4b97d6-0x1e0;const _0x5effe7=a6_0x5eff();let _0x319213=_0x5effe7[_0x4b97d6];return _0x319213;}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 _0x2f1929=a6_0x3192;writeCliSideChannelLine(_0x2f1929(0x1f3)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x2f1929(0x237)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x2f1929(0x20b));}function buildAccessKeySetupGuide(){const _0x4d7417=a6_0x3192;return[_0x4d7417(0x1f3)+PRODUCT_CONFIG[_0x4d7417(0x1ea)]+':',USER_ACCESS_KEY_CREATE_URL,_0x4d7417(0x223)+CLI_BIN_NAME+_0x4d7417(0x22e)]['join']('\x0a');}function a6_0x5eff(){const _0x7049bc=['bool','2409858bJlyjm','ClientAk','production','\x20(via\x20','=ak_xxx','3070CtuJcx','nonInteractive','`auth\x20login`\x20does\x20not\x20support\x20--yes.','login','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Write\x20to\x20global\x20config\x20(default)','532heAZyZ','Clear\x20from\x20global\x20config\x20(default)','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','59608JklnKc','No\x20AccessKey\x20found\x20in\x20','4920wuhwvf','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','yes','\x20Current\x20env:\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Then\x20verify\x20with:\x20','AccessKey\x20cleared\x20from\x20','Clear\x20accessKey\x20from\x20config','daily','\x20env\x20var','isTTY','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','newConfigFileName','Tip:\x20you\x20can\x20also\x20run:','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','Invalid\x20accessKey\x20format:\x20\x22','accessKey','push','5231826zoqscg','init','14eZOgJQ','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','AccessKey\x20(ak_xxx...)','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','global','userCenterDisplayName','read','stdout','test','global-default','30614936SRmouC','\x20scope.','length','AccessKey\x20saved\x20to\x20','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','validation','Option\x20C:\x20environment\x20variable','\x20auth\x20status','info','\x20config.\x20Nothing\x20to\x20clear.','1853032GtyWem','access-key','\x20Verify:\x20','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','\x20\x20export\x20','10oQqDWd','trim','development','write','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','ACCESS_KEY','Show\x20current\x20authentication\x20status','string','\x20config','auth','env','repeat','stdin','\x20auth\x20login\x20--access-key\x20<ak_xxx>','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','boolean','Option\x20A:\x20','slice','status','str','\x20config.','1830vFFNnH','Missing\x20accessKey.','project','\x20doctor'];a6_0x5eff=function(){return _0x7049bc;};return a6_0x5eff();}function canPromptForAccessKey(_0x4525bd){const _0x3033ac=a6_0x3192;return!_0x4525bd[_0x3033ac(0x220)]&&process[_0x3033ac(0x20a)][_0x3033ac(0x234)]!==![]&&process[_0x3033ac(0x1ec)][_0x3033ac(0x234)]!==![];}function resolveAuthScopeFlags(_0x151269){const _0x17ce0e=a6_0x3192;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x151269[_0x17ce0e(0x219)](_0x17ce0e(0x1e9)),'explicitProject':_0x151269[_0x17ce0e(0x219)]('project'),'policy':_0x17ce0e(0x1ee)}));}async function resolveAuthWriteInput(_0x5c2f70){const _0x30feb8=a6_0x3192;let _0x54e24d=(_0x5c2f70[_0x30feb8(0x213)](_0x30feb8(0x1fa))||_0x5c2f70['str']('ak')||'')[_0x30feb8(0x1ff)]();const _0x205aab=(_0x5c2f70[_0x30feb8(0x213)](_0x30feb8(0x208))||'')[_0x30feb8(0x1ff)]();if(!_0x54e24d&&canPromptForAccessKey(_0x5c2f70))try{showAccessKeyCreateHint(),_0x54e24d=await promptAccessKey('');}catch(_0x3c7e81){if(isAbortPrompt(_0x3c7e81))throw CliErrors['cancelled']();throw _0x3c7e81;}if(!_0x54e24d)throw CliErrors[_0x30feb8(0x1f4)](_0x30feb8(0x216),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x30feb8(0x1ed)](_0x54e24d))throw CliErrors[_0x30feb8(0x1f4)](_0x30feb8(0x1e0)+_0x54e24d+'\x22',_0x30feb8(0x235));if(!_0x205aab)return{'accessKey':_0x54e24d};const _0x533247=normalizeEnv(_0x205aab);return{'accessKey':_0x54e24d,'env':isDaily(_0x533247)?_0x30feb8(0x232):isDev(_0x533247)?_0x30feb8(0x200):_0x30feb8(0x21c)};}export const authDefinitions=[{'service':a6_0x2d3f3b(0x207),'command':a6_0x2d3f3b(0x222),'description':'Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','risk':a6_0x2d3f3b(0x201),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x2d3f3b(0x1fa),'type':a6_0x2d3f3b(0x205),'description':a6_0x2d3f3b(0x1e7)},{'name':'ak','type':a6_0x2d3f3b(0x205),'description':'Shorthand\x20for\x20--access-key'},{'name':a6_0x2d3f3b(0x1e9),'type':a6_0x2d3f3b(0x20f),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a6_0x2d3f3b(0x217),'type':'boolean','description':a6_0x2d3f3b(0x20d),'default':![]}],async 'execute'(_0x5205ee){const _0x5721f4=a6_0x2d3f3b;if(_0x5205ee[_0x5721f4(0x219)](_0x5721f4(0x22c)))throw CliErrors[_0x5721f4(0x1f4)](_0x5721f4(0x221),'Use\x20`'+CLI_BIN_NAME+_0x5721f4(0x22b)+CLI_BIN_NAME+_0x5721f4(0x238));const _0xefb4e3=(_0x5205ee[_0x5721f4(0x213)](_0x5721f4(0x1fa))||_0x5205ee[_0x5721f4(0x213)]('ak')||'')[_0x5721f4(0x1ff)]();if(!_0xefb4e3&&_0x5205ee[_0x5721f4(0x220)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x58bd8c=await resolveAuthWriteInput(_0x5205ee),_0x33fd59=resolveAuthScopeFlags(_0x5205ee),_0x5ea2c2=readScopedConfig(_0x33fd59);_0x5ea2c2[_0x5721f4(0x1e1)]=_0x58bd8c[_0x5721f4(0x1e1)];_0x58bd8c[_0x5721f4(0x208)]&&(_0x5ea2c2[_0x5721f4(0x208)]=_0x58bd8c[_0x5721f4(0x208)]);writeScopedConfig(_0x5ea2c2,_0x33fd59);const _0x4861ba=_0x33fd59[_0x5721f4(0x1e9)]?'global':_0x5721f4(0x217),_0x3fce57=_0x5ea2c2['env']?_0x5721f4(0x22d)+_0x5ea2c2[_0x5721f4(0x208)]+'.':'';return{'ok':!![],'message':_0x5721f4(0x1f2)+_0x4861ba+_0x5721f4(0x214)+_0x3fce57+'\x20Verify:\x20'+CLI_BIN_NAME+_0x5721f4(0x1f6)};}},{'service':a6_0x2d3f3b(0x207),'command':a6_0x2d3f3b(0x1e4),'description':a6_0x2d3f3b(0x20e),'risk':a6_0x2d3f3b(0x201),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x2d3f3b(0x1fa),'type':'string','description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a6_0x2d3f3b(0x205),'description':'Shorthand\x20for\x20--access-key'},{'name':a6_0x2d3f3b(0x208),'type':a6_0x2d3f3b(0x205),'description':a6_0x2d3f3b(0x1fc)},{'name':'global','type':'boolean','description':a6_0x2d3f3b(0x224),'default':!![]},{'name':a6_0x2d3f3b(0x217),'type':a6_0x2d3f3b(0x20f),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x5d5ecd){const _0x162720=a6_0x2d3f3b,_0x34d5b8=await resolveAuthWriteInput(_0x5d5ecd),_0x228a24=resolveAuthScopeFlags(_0x5d5ecd),_0x5cca00={'accessKey':_0x34d5b8[_0x162720(0x1e1)]};_0x34d5b8[_0x162720(0x208)]&&(_0x5cca00['env']=_0x34d5b8[_0x162720(0x208)]);writeScopedConfig(_0x5cca00,_0x228a24);const _0x507943=_0x228a24[_0x162720(0x1e9)]?'global':_0x162720(0x217),_0x3a9c11=_0x5cca00[_0x162720(0x208)]?_0x162720(0x22d)+_0x5cca00[_0x162720(0x208)]+'.':'';return{'ok':!![],'message':'Auth\x20config\x20reinitialized\x20in\x20'+_0x507943+_0x162720(0x1f0)+_0x3a9c11+_0x162720(0x1fb)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a6_0x2d3f3b(0x207),'command':'logout','description':a6_0x2d3f3b(0x231),'risk':a6_0x2d3f3b(0x201),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a6_0x2d3f3b(0x1e9),'type':'boolean','description':a6_0x2d3f3b(0x226),'default':!![]},{'name':a6_0x2d3f3b(0x217),'type':a6_0x2d3f3b(0x20f),'description':a6_0x2d3f3b(0x20c),'default':![]}],async 'execute'(_0x5925cb){const _0x35d40e=a6_0x2d3f3b,_0xad5e05=resolveAuthScopeFlags(_0x5925cb),_0x21c7cb=readScopedConfig(_0xad5e05),_0x521e6e=!!_0x21c7cb['accessKey'];delete _0x21c7cb['accessKey'],writeScopedConfig(_0x21c7cb,_0xad5e05);const _0x3ac4c5=_0xad5e05[_0x35d40e(0x1e9)]?_0x35d40e(0x1e9):_0x35d40e(0x217);if(_0x521e6e)return{'ok':!![],'message':_0x35d40e(0x230)+_0x3ac4c5+_0x35d40e(0x214)};return{'ok':!![],'message':_0x35d40e(0x229)+_0x3ac4c5+_0x35d40e(0x1f8)};}},{'service':a6_0x2d3f3b(0x207),'command':a6_0x2d3f3b(0x212),'description':a6_0x2d3f3b(0x204),'risk':a6_0x2d3f3b(0x1eb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':'boolean','description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a6_0x2d3f3b(0x217),'type':a6_0x2d3f3b(0x20f),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0xf0ced9){const _0x3b8a5d=a6_0x2d3f3b,_0x37afd8=resolveAuthScopeFlags(_0xf0ced9),_0x3120d8=readScopedConfig(_0x37afd8),_0x449dc4=productEnvName(_0x3b8a5d(0x203)),_0x5546b1=productEnv('ACCESS_KEY')||undefined,_0x4f8c4e=_0x3120d8[_0x3b8a5d(0x1e1)]||undefined,_0x46af42=_0x5546b1||_0x4f8c4e,_0x3c1e98=_0x5546b1?_0x449dc4+_0x3b8a5d(0x233):_0x4f8c4e?(_0x37afd8[_0x3b8a5d(0x1e9)]?_0x3b8a5d(0x1e9):_0x3b8a5d(0x217))+_0x3b8a5d(0x206):null,_0x439096=['Auth\x20mode:\x20'+AUTH_MODE[_0x3b8a5d(0x21b)]];if(_0x46af42){const _0x23a0e2=_0x46af42[_0x3b8a5d(0x1f1)]>0x8?''+_0x46af42[_0x3b8a5d(0x211)](0x0,0x8)+'*'[_0x3b8a5d(0x209)](_0x46af42[_0x3b8a5d(0x1f1)]-0x8):_0x46af42;_0x439096[_0x3b8a5d(0x1e2)]('AccessKey:\x20'+_0x23a0e2+(_0x3c1e98?_0x3b8a5d(0x21d)+_0x3c1e98+')':''));}return!_0x46af42&&(_0x439096['push'](''),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x227)),_0x439096['push'](''),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x210)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x439096[_0x3b8a5d(0x1e2)](''),_0x439096[_0x3b8a5d(0x1e2)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x3b8a5d(0x236)]+')'),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x1e8)),_0x439096[_0x3b8a5d(0x1e2)](''),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x1f5)),_0x439096['push'](_0x3b8a5d(0x1fd)+_0x449dc4+_0x3b8a5d(0x21e)),_0x439096[_0x3b8a5d(0x1e2)](''),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x22f)+CLI_BIN_NAME+_0x3b8a5d(0x1f6)),_0x439096[_0x3b8a5d(0x1e2)](_0x3b8a5d(0x202)+CLI_BIN_NAME+_0x3b8a5d(0x218))),{'ok':!![],'message':_0x439096['join']('\x0a')};}},{'service':'auth','command':a6_0x2d3f3b(0x1f7),'description':a6_0x2d3f3b(0x1e6),'risk':a6_0x2d3f3b(0x1eb),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4d746f){const _0x4c4a4e=a6_0x2d3f3b,_0x149681=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x149681,'meta':{'env':_0x4d746f['envName']??_0x4c4a4e(0x21c)}}};}}];
|
|
1
|
+
const a8_0x209514=a8_0x24ef;(function(_0xd0cf6f,_0xef0452){const _0x43074d=a8_0x24ef,_0x18fed1=_0xd0cf6f();while(!![]){try{const _0x1d0739=parseInt(_0x43074d(0x184))/0x1*(parseInt(_0x43074d(0x176))/0x2)+-parseInt(_0x43074d(0x16f))/0x3*(parseInt(_0x43074d(0x1bd))/0x4)+parseInt(_0x43074d(0x185))/0x5+parseInt(_0x43074d(0x1ae))/0x6+parseInt(_0x43074d(0x189))/0x7*(parseInt(_0x43074d(0x1aa))/0x8)+-parseInt(_0x43074d(0x1b8))/0x9*(parseInt(_0x43074d(0x182))/0xa)+-parseInt(_0x43074d(0x197))/0xb*(-parseInt(_0x43074d(0x180))/0xc);if(_0x1d0739===_0xef0452)break;else _0x18fed1['push'](_0x18fed1['shift']());}catch(_0x3122e6){_0x18fed1['push'](_0x18fed1['shift']());}}}(a8_0x4b54,0xebac5));import{readScopedConfig,writeScopedConfig}from'../../context.js';function a8_0x4b54(){const _0x10dd39=['AccessKey\x20saved\x20to\x20','Auth\x20config\x20reinitialized\x20in\x20','validation','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','stdout','\x20config.','logout','Auth\x20mode:\x20','Missing\x20accessKey.','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','\x20config','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','No\x20AccessKey\x20found\x20in\x20','newConfigFileName','264792theolV','env','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','project','3061452XGPJzs','Shorthand\x20for\x20--access-key','cancelled','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','envName','ACCESS_KEY','Clear\x20from\x20global\x20config\x20(default)','AccessKey\x20cleared\x20from\x20','join','boolean','2565nnOOwv','Write\x20to\x20global\x20config\x20(default)','\x20auth\x20login\x20--access-key\x20<ak_xxx>','str','Read\x20from\x20global\x20config\x20(default)','1216PTMHBw','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','accessKey','\x20(via\x20','status','isTTY','production','Tip:\x20you\x20can\x20also\x20run:','repeat','AccessKey:\x20','read','14559RcpSdu','global','Then\x20verify\x20with:\x20','string','\x20auth\x20status','access-key','Option\x20A:\x20','600560tHHNqL','login','write','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','\x20env\x20var','nonInteractive','userCenterDisplayName','\x20scope.','=ak_xxx','4907316TsxWwo','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','33550pmrndJ','length','1twzRce','7683515mAwcct','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','bool','trim','49uVERHP','\x20Verify:\x20','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','test','AccessKey\x20(ak_xxx...)','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','Use\x20`','yes','info','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','stdin','push','development','\x20\x20export\x20','22qppjmp','init','auth'];a8_0x4b54=function(){return _0x10dd39;};return a8_0x4b54();}import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x24ef(_0x3416a6,_0x8cf80c){_0x3416a6=_0x3416a6-0x16c;const _0x4b5408=a8_0x4b54();let _0x24ef1f=_0x4b5408[_0x3416a6];return _0x24ef1f;}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 _0x14bd2e=a8_0x24ef;writeCliSideChannelLine(_0x14bd2e(0x19e)+PRODUCT_CONFIG[_0x14bd2e(0x17d)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x14bd2e(0x1c4)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x14bd2e(0x1ba));}function buildAccessKeySetupGuide(){const _0xebb561=a8_0x24ef;return[_0xebb561(0x19e)+PRODUCT_CONFIG[_0xebb561(0x17d)]+':',USER_ACCESS_KEY_CREATE_URL,_0xebb561(0x192)+CLI_BIN_NAME+_0xebb561(0x186)][_0xebb561(0x1b6)]('\x0a');}function canPromptForAccessKey(_0x160b88){const _0x2ebc18=a8_0x24ef;return!_0x160b88[_0x2ebc18(0x17c)]&&process[_0x2ebc18(0x193)][_0x2ebc18(0x1c2)]!==![]&&process[_0x2ebc18(0x19f)][_0x2ebc18(0x1c2)]!==![];}function resolveAuthScopeFlags(_0x2b19b0){const _0x283619=a8_0x24ef;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x2b19b0[_0x283619(0x187)](_0x283619(0x170)),'explicitProject':_0x2b19b0['bool'](_0x283619(0x1ad)),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x4b4cd0){const _0x5a5e4d=a8_0x24ef;let _0x554c27=(_0x4b4cd0['str']('access-key')||_0x4b4cd0[_0x5a5e4d(0x1bb)]('ak')||'')[_0x5a5e4d(0x188)]();const _0x55b22f=(_0x4b4cd0['str']('env')||'')[_0x5a5e4d(0x188)]();if(!_0x554c27&&canPromptForAccessKey(_0x4b4cd0))try{showAccessKeyCreateHint(),_0x554c27=await promptAccessKey('');}catch(_0x3b9e76){if(isAbortPrompt(_0x3b9e76))throw CliErrors[_0x5a5e4d(0x1b0)]();throw _0x3b9e76;}if(!_0x554c27)throw CliErrors[_0x5a5e4d(0x19c)](_0x5a5e4d(0x1a3),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x5a5e4d(0x18c)](_0x554c27))throw CliErrors['validation']('Invalid\x20accessKey\x20format:\x20\x22'+_0x554c27+'\x22',_0x5a5e4d(0x1b1));if(!_0x55b22f)return{'accessKey':_0x554c27};const _0x50638b=normalizeEnv(_0x55b22f);return{'accessKey':_0x554c27,'env':isDaily(_0x50638b)?'daily':isDev(_0x50638b)?_0x5a5e4d(0x195):'production'};}export const authDefinitions=[{'service':'auth','command':a8_0x209514(0x177),'description':a8_0x209514(0x19d),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':'string','description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a8_0x209514(0x172),'description':a8_0x209514(0x1af)},{'name':a8_0x209514(0x170),'type':a8_0x209514(0x1b7),'description':a8_0x209514(0x1b9),'default':!![]},{'name':a8_0x209514(0x1ad),'type':a8_0x209514(0x1b7),'description':a8_0x209514(0x1a5),'default':![]}],async 'execute'(_0x47a937){const _0x5776f5=a8_0x209514;if(_0x47a937[_0x5776f5(0x187)](_0x5776f5(0x190)))throw CliErrors['validation']('`auth\x20login`\x20does\x20not\x20support\x20--yes.',_0x5776f5(0x18f)+CLI_BIN_NAME+_0x5776f5(0x17a)+CLI_BIN_NAME+_0x5776f5(0x181));const _0x5a1745=(_0x47a937[_0x5776f5(0x1bb)](_0x5776f5(0x174))||_0x47a937['str']('ak')||'')['trim']();if(!_0x5a1745&&_0x47a937[_0x5776f5(0x17c)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x5e0322=await resolveAuthWriteInput(_0x47a937),_0x201ce1=resolveAuthScopeFlags(_0x47a937),_0x36e4a8=readScopedConfig(_0x201ce1);_0x36e4a8['accessKey']=_0x5e0322[_0x5776f5(0x1bf)];_0x5e0322[_0x5776f5(0x1ab)]&&(_0x36e4a8['env']=_0x5e0322[_0x5776f5(0x1ab)]);writeScopedConfig(_0x36e4a8,_0x201ce1);const _0x1f95e2=_0x201ce1[_0x5776f5(0x170)]?_0x5776f5(0x170):_0x5776f5(0x1ad),_0x4b7318=_0x36e4a8[_0x5776f5(0x1ab)]?'\x20Current\x20env:\x20'+_0x36e4a8[_0x5776f5(0x1ab)]+'.':'';return{'ok':!![],'message':_0x5776f5(0x19a)+_0x1f95e2+_0x5776f5(0x1a0)+_0x4b7318+_0x5776f5(0x18a)+CLI_BIN_NAME+_0x5776f5(0x173)};}},{'service':a8_0x209514(0x199),'command':a8_0x209514(0x198),'description':a8_0x209514(0x1be),'risk':a8_0x209514(0x178),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x209514(0x174),'type':a8_0x209514(0x172),'description':a8_0x209514(0x18d)},{'name':'ak','type':a8_0x209514(0x172),'description':a8_0x209514(0x1af)},{'name':a8_0x209514(0x1ab),'type':'string','description':a8_0x209514(0x1ac)},{'name':a8_0x209514(0x170),'type':a8_0x209514(0x1b7),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a8_0x209514(0x1b7),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x349c34){const _0x4a5220=a8_0x209514,_0x5e5d00=await resolveAuthWriteInput(_0x349c34),_0x2d5503=resolveAuthScopeFlags(_0x349c34),_0x1d8e29={'accessKey':_0x5e5d00[_0x4a5220(0x1bf)]};_0x5e5d00['env']&&(_0x1d8e29[_0x4a5220(0x1ab)]=_0x5e5d00['env']);writeScopedConfig(_0x1d8e29,_0x2d5503);const _0x2e39b2=_0x2d5503[_0x4a5220(0x170)]?_0x4a5220(0x170):_0x4a5220(0x1ad),_0x4caffd=_0x1d8e29[_0x4a5220(0x1ab)]?'\x20Current\x20env:\x20'+_0x1d8e29['env']+'.':'';return{'ok':!![],'message':_0x4a5220(0x19b)+_0x2e39b2+_0x4a5220(0x17e)+_0x4caffd+'\x20Verify:\x20'+CLI_BIN_NAME+_0x4a5220(0x173)};}},{'service':'auth','command':a8_0x209514(0x1a1),'description':'Clear\x20accessKey\x20from\x20config','risk':a8_0x209514(0x178),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x209514(0x170),'type':a8_0x209514(0x1b7),'description':a8_0x209514(0x1b4),'default':!![]},{'name':'project','type':a8_0x209514(0x1b7),'description':a8_0x209514(0x1a7),'default':![]}],async 'execute'(_0x11b891){const _0x97217c=a8_0x209514,_0x47ee87=resolveAuthScopeFlags(_0x11b891),_0x461378=readScopedConfig(_0x47ee87),_0x5c9ee4=!!_0x461378[_0x97217c(0x1bf)];delete _0x461378[_0x97217c(0x1bf)],writeScopedConfig(_0x461378,_0x47ee87);const _0x311426=_0x47ee87['global']?'global':_0x97217c(0x1ad);if(_0x5c9ee4)return{'ok':!![],'message':_0x97217c(0x1b5)+_0x311426+'\x20config.'};return{'ok':!![],'message':_0x97217c(0x1a8)+_0x311426+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a8_0x209514(0x199),'command':a8_0x209514(0x1c1),'description':'Show\x20current\x20authentication\x20status','risk':a8_0x209514(0x16e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x209514(0x170),'type':a8_0x209514(0x1b7),'description':a8_0x209514(0x1bc),'default':!![]},{'name':'project','type':'boolean','description':a8_0x209514(0x1a4),'default':![]}],async 'execute'(_0xe7e6e2){const _0x134043=a8_0x209514,_0x5ef15d=resolveAuthScopeFlags(_0xe7e6e2),_0x197258=readScopedConfig(_0x5ef15d),_0x345b60=productEnvName(_0x134043(0x1b3)),_0x1c0d76=productEnv(_0x134043(0x1b3))||undefined,_0x2865e2=_0x197258[_0x134043(0x1bf)]||undefined,_0x3d7b98=_0x1c0d76||_0x2865e2,_0x49181d=_0x1c0d76?_0x345b60+_0x134043(0x17b):_0x2865e2?(_0x5ef15d['global']?_0x134043(0x170):_0x134043(0x1ad))+_0x134043(0x1a6):null,_0x414152=[_0x134043(0x1a2)+AUTH_MODE['ClientAk']];if(_0x3d7b98){const _0x920970=_0x3d7b98[_0x134043(0x183)]>0x8?''+_0x3d7b98['slice'](0x0,0x8)+'*'[_0x134043(0x16c)](_0x3d7b98[_0x134043(0x183)]-0x8):_0x3d7b98;_0x414152[_0x134043(0x194)](_0x134043(0x16d)+_0x920970+(_0x49181d?_0x134043(0x1c0)+_0x49181d+')':''));}return!_0x3d7b98&&(_0x414152[_0x134043(0x194)](''),_0x414152[_0x134043(0x194)](_0x134043(0x179)),_0x414152[_0x134043(0x194)](''),_0x414152['push'](_0x134043(0x175)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x414152[_0x134043(0x194)](''),_0x414152['push']('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x134043(0x1a9)]+')'),_0x414152['push'](_0x134043(0x18e)),_0x414152[_0x134043(0x194)](''),_0x414152[_0x134043(0x194)]('Option\x20C:\x20environment\x20variable'),_0x414152[_0x134043(0x194)](_0x134043(0x196)+_0x345b60+_0x134043(0x17f)),_0x414152[_0x134043(0x194)](''),_0x414152[_0x134043(0x194)](_0x134043(0x171)+CLI_BIN_NAME+_0x134043(0x173)),_0x414152[_0x134043(0x194)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+'\x20doctor')),{'ok':!![],'message':_0x414152[_0x134043(0x1b6)]('\x0a')};}},{'service':a8_0x209514(0x199),'command':a8_0x209514(0x191),'description':a8_0x209514(0x18b),'risk':a8_0x209514(0x16e),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2a2842){const _0x309fcf=a8_0x209514,_0x322268=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x322268,'meta':{'env':_0x2a2842[_0x309fcf(0x1b2)]??_0x309fcf(0x1c3)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8dd097,_0x3263b5){const _0x39c689=a9_0x45ea,_0x124805=_0x8dd097();while(!![]){try{const _0x397850=-parseInt(_0x39c689(0x145))/0x1*(parseInt(_0x39c689(0x14b))/0x2)+-parseInt(_0x39c689(0x13e))/0x3+-parseInt(_0x39c689(0x14c))/0x4+-parseInt(_0x39c689(0x144))/0x5+-parseInt(_0x39c689(0x146))/0x6*(-parseInt(_0x39c689(0x149))/0x7)+parseInt(_0x39c689(0x148))/0x8+parseInt(_0x39c689(0x142))/0x9*(parseInt(_0x39c689(0x141))/0xa);if(_0x397850===_0x3263b5)break;else _0x124805['push'](_0x124805['shift']());}catch(_0x9e507d){_0x124805['push'](_0x124805['shift']());}}}(a9_0x45c8,0xda88a));function a9_0x45ea(_0x4ef58b,_0x391669){_0x4ef58b=_0x4ef58b-0x13c;const _0x45c8d6=a9_0x45c8();let _0x45ea1b=_0x45c8d6[_0x4ef58b];return _0x45ea1b;}import{createInterface}from'node:readline';function a9_0x45c8(){const _0x34a8f5=['691661SMyczq','642fcJXPy','AccessKey\x20(','5139120TrKehW','113834ZiOnZM','SIGINT','4YgxVjS','6182648jIHZMS','):\x20','AbortPrompt','3856836CYPLFu','stdout','name','1114290QkHtAJ','351szKvIM','removeListener','8092225tWjIbq'];a9_0x45c8=function(){return _0x34a8f5;};return a9_0x45c8();}class AbortPrompt extends Error{constructor(){super('User\x20aborted\x20prompt'),this['name']='AbortPrompt';}}function createSafeRl(){const _0xb39404=a9_0x45ea,_0x476de6=createInterface({'input':process['stdin'],'output':process[_0xb39404(0x13f)]});let _0x531a6c;const _0xe9639d=new Promise((_0x4ac46f,_0xb106dd)=>{const _0x1aa8a0=_0xb39404;_0x531a6c=()=>{const _0x5e21ba=a9_0x45ea;_0x531a6c&&(_0x476de6['removeListener'](_0x5e21ba(0x14a),_0x531a6c),_0x531a6c=undefined);try{_0x476de6['close']();}catch{}_0xb106dd(new AbortPrompt());},_0x476de6['once'](_0x1aa8a0(0x14a),_0x531a6c);}),_0x468604=()=>{const _0x43685b=_0xb39404;_0x531a6c&&(_0x476de6[_0x43685b(0x143)](_0x43685b(0x14a),_0x531a6c),_0x531a6c=undefined);try{_0x476de6['close']();}catch{}};return{'rl':_0x476de6,'abortPromise':_0xe9639d,'disposeSuccess':_0x468604};}export async function promptAccessKey(_0x5b43f7=''){const {rl:_0x210b4b,abortPromise:_0x2e3008,disposeSuccess:_0x19d176}=createSafeRl(),_0x37a7e9=new Promise(_0x23b6b1=>{const _0x39ffbb=a9_0x45ea,_0x378d67=_0x5b43f7?_0x39ffbb(0x147)+_0x5b43f7+_0x39ffbb(0x13c):'AccessKey\x20(paste\x20ak_...):\x20';_0x210b4b['question'](_0x378d67,_0x567e15=>{_0x19d176(),_0x23b6b1(_0x567e15['trim']()||_0x5b43f7);});});return Promise['race']([_0x37a7e9,_0x2e3008]);}export function isAbortPrompt(_0x1f953a){const _0x21c7dc=a9_0x45ea;return _0x1f953a instanceof Error&&_0x1f953a[_0x21c7dc(0x140)]===_0x21c7dc(0x13d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x3a5cb5=a10_0x3fbe;(function(_0x3a5653,_0x4b4549){const _0x4f05ee=a10_0x3fbe,_0x1e2122=_0x3a5653();while(!![]){try{const _0x16032f=-parseInt(_0x4f05ee(0xed))/0x1*(-parseInt(_0x4f05ee(0xff))/0x2)+-parseInt(_0x4f05ee(0xef))/0x3*(parseInt(_0x4f05ee(0xf2))/0x4)+parseInt(_0x4f05ee(0xf0))/0x5*(parseInt(_0x4f05ee(0xfb))/0x6)+-parseInt(_0x4f05ee(0x100))/0x7+-parseInt(_0x4f05ee(0xf9))/0x8+parseInt(_0x4f05ee(0xf7))/0x9+-parseInt(_0x4f05ee(0xea))/0xa*(parseInt(_0x4f05ee(0xfd))/0xb);if(_0x16032f===_0x4b4549)break;else _0x1e2122['push'](_0x1e2122['shift']());}catch(_0x2cafdf){_0x1e2122['push'](_0x1e2122['shift']());}}}(a10_0x1089,0xbd711));import{getBffScriptInfo}from'../../core/api-client.js';function a10_0x1089(){const _0x12fc84=['370zqMaoO','read','Get\x20BFF\x20script\x20details\x20by\x20ID','191bFdVlL','createdTime','489YzejuE','1786635UQHQhM','(none)','26712PDpUct','num','functionName','updatedTime','bff','13569183TYmIYD','description','6272568dEuyMM','Script\x20ID','12BSIroX','detail','58113fsacEk','scriptType','7414mKuHzG','604583nJPsGh','verbose','bool'];a10_0x1089=function(){return _0x12fc84;};return a10_0x1089();}function a10_0x3fbe(_0x54f8c5,_0x45d310){_0x54f8c5=_0x54f8c5-0xe8;const _0x108994=a10_0x1089();let _0x3fbe69=_0x108994[_0x54f8c5];return _0x3fbe69;}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a10_0x3a5cb5(0xf6),'command':a10_0x3a5cb5(0xfc),'description':a10_0x3a5cb5(0xec),'risk':a10_0x3a5cb5(0xeb),'flags':[{...ID_FLAG,'description':a10_0x3a5cb5(0xfa)},VERBOSE_FLAG],async 'execute'(_0x38867e){const _0x5ef8c2=a10_0x3a5cb5,_0x225f7c=await getBffScriptInfo(_0x38867e[_0x5ef8c2(0xf3)]('id')),_0x1e640b=_0x38867e[_0x5ef8c2(0xe9)](_0x5ef8c2(0xe8));if(_0x1e640b)return{'ok':!![],'data':_0x225f7c};return{'ok':!![],'data':{'id':_0x225f7c['id'],'appCode':_0x225f7c['appCode'],'functionName':_0x225f7c[_0x5ef8c2(0xf4)]??'','scriptType':_0x225f7c[_0x5ef8c2(0xfe)],'description':_0x225f7c[_0x5ef8c2(0xf8)]||_0x5ef8c2(0xf1),'createdTime':_0x225f7c[_0x5ef8c2(0xee)]??'','updatedTime':_0x225f7c[_0x5ef8c2(0xf5)]??''}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a11_0x417b(_0x59de40,_0x46b578){_0x59de40=_0x59de40-0xba;const _0x4bf9a3=a11_0x4bf9();let _0x417b8c=_0x4bf9a3[_0x59de40];return _0x417b8c;}function a11_0x4bf9(){const _0x27739b=['exec','read','BFF\x20function\x20name\x20to\x20execute','BFF\x20executed\x20in\x20','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','734758bVMoci','1780716NqwHJB','54mOUZyt','params','277140ydQbpt','str','79839AjLUnj','156408GgLyrN','now','1133164HIUHvm','88oCmcdH','bff','1252923OpLgUV'];a11_0x4bf9=function(){return _0x27739b;};return a11_0x4bf9();}const a11_0x4ef1e8=a11_0x417b;(function(_0x766edc,_0x1578d2){const _0x4b97bb=a11_0x417b,_0x706e0a=_0x766edc();while(!![]){try{const _0x5411d5=-parseInt(_0x4b97bb(0xc1))/0x1+parseInt(_0x4b97bb(0xba))/0x2+parseInt(_0x4b97bb(0xbb))/0x3+parseInt(_0x4b97bb(0xc3))/0x4+-parseInt(_0x4b97bb(0xbe))/0x5*(parseInt(_0x4b97bb(0xbc))/0x6)+-parseInt(_0x4b97bb(0xc6))/0x7+parseInt(_0x4b97bb(0xc4))/0x8*(-parseInt(_0x4b97bb(0xc0))/0x9);if(_0x5411d5===_0x1578d2)break;else _0x706e0a['push'](_0x706e0a['shift']());}catch(_0x209b58){_0x706e0a['push'](_0x706e0a['shift']());}}}(a11_0x4bf9,0x4c45c));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a11_0x4ef1e8(0xc5),'command':a11_0x4ef1e8(0xc7),'description':a11_0x4ef1e8(0xcb),'risk':a11_0x4ef1e8(0xc8),'flags':[{...NAME_FLAG,'required':!![],'description':a11_0x4ef1e8(0xc9)},PARAMS_FLAG],async 'execute'(_0xacc877){const _0x2cad97=a11_0x4ef1e8,_0x3df4d3=parseJsonParams(_0xacc877[_0x2cad97(0xbf)](_0x2cad97(0xbd))),_0xa415c0=Date['now'](),_0x24e510=await executeSdkBff(_0xacc877['str']('name'),_0x3df4d3),_0x534b3a=Date[_0x2cad97(0xc2)]()-_0xa415c0;return{'ok':!![],'data':{'result':_0x24e510,'elapsed':_0x534b3a},'message':_0x2cad97(0xca)+_0x534b3a+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a12_0x5f35(){const _0x1af689=['3847264HiNFQD','1955401nNaHzN','4728688GhHkmz','188930kARArO','69067iBfezR','189505XmkUGj','1071rmqjBo','475071TItiEt','18UJDrIr','84YTnIiL'];a12_0x5f35=function(){return _0x1af689;};return a12_0x5f35();}function a12_0x5119(_0x16dc4f,_0x2be262){_0x16dc4f=_0x16dc4f-0x82;const _0x5f35f0=a12_0x5f35();let _0x511966=_0x5f35f0[_0x16dc4f];return _0x511966;}(function(_0x1eda9f,_0x427951){const _0x39a9f4=a12_0x5119,_0x275a5a=_0x1eda9f();while(!![]){try{const _0x47708f=parseInt(_0x39a9f4(0x88))/0x1*(-parseInt(_0x39a9f4(0x82))/0x2)+parseInt(_0x39a9f4(0x8b))/0x3+-parseInt(_0x39a9f4(0x84))/0x4+parseInt(_0x39a9f4(0x89))/0x5*(parseInt(_0x39a9f4(0x83))/0x6)+-parseInt(_0x39a9f4(0x85))/0x7+-parseInt(_0x39a9f4(0x86))/0x8+-parseInt(_0x39a9f4(0x8a))/0x9*(-parseInt(_0x39a9f4(0x87))/0xa);if(_0x47708f===_0x427951)break;else _0x275a5a['push'](_0x275a5a['shift']());}catch(_0x502066){_0x275a5a['push'](_0x275a5a['shift']());}}}(a12_0x5f35,0x7603e));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24ec6b,_0x5a480e){const _0xbeee79=a13_0x1b62,_0xebf784=_0x24ec6b();while(!![]){try{const _0xad218e=parseInt(_0xbeee79(0xff))/0x1+parseInt(_0xbeee79(0xfe))/0x2+-parseInt(_0xbeee79(0xf3))/0x3+parseInt(_0xbeee79(0xf1))/0x4*(-parseInt(_0xbeee79(0xfd))/0x5)+parseInt(_0xbeee79(0xf2))/0x6+-parseInt(_0xbeee79(0xfb))/0x7+parseInt(_0xbeee79(0x100))/0x8;if(_0xad218e===_0x5a480e)break;else _0xebf784['push'](_0xebf784['shift']());}catch(_0x3a863e){_0xebf784['push'](_0xebf784['shift']());}}}(a13_0x4765,0x80c84));import{CLI_BIN_NAME}from'../../constant/cli.js';function a13_0x1b62(_0x18a423,_0x524604){_0x18a423=_0x18a423-0xf0;const _0x4765df=a13_0x4765();let _0x1b62b7=_0x4765df[_0x18a423];return _0x1b62b7;}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';function a13_0x4765(){const _0x11d8d4=['Add\x20--global\x20to\x20write\x20to\x20~/','\x20found).','14776kkEsgN','5254134cSocFv','1415880TXtHoP','Use\x20only\x20one\x20config\x20scope\x20flag.','\x20(global)','global','validation',',\x20or\x20run\x20`','inProject','project-default','2361842ijjUOO','project','595nXtHro','93106EXuVnE','446716PpvWRM','3259888JhHAJw','newConfigFileName'];a13_0x4765=function(){return _0x11d8d4;};return a13_0x4765();}export function resolveConfigScope(_0x2ca40e){const _0x449138=a13_0x1b62,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0xf484d1}=_0x2ca40e;if(explicitGlobal&&explicitProject)throw CliErrors[_0x449138(0xf7)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',_0x449138(0xf4));if(explicitGlobal)return'global';if(explicitProject)return _0x449138(0xfc);switch(_0xf484d1){case'global-default':return _0x449138(0xf6);case _0x449138(0xfa):return _0x2ca40e[_0x449138(0xf9)]??isInProject()?_0x449138(0xfc):'global';case'project-or-global-explicit':if(!(_0x2ca40e[_0x449138(0xf9)]??isInProject()))throw CliErrors[_0x449138(0xf7)]('Not\x20inside\x20a\x20project\x20(no\x20'+PRODUCT_CONFIG['newConfigFileName']+_0x449138(0xf0),_0x449138(0x102)+PRODUCT_CONFIG[_0x449138(0x101)]+_0x449138(0xf8)+CLI_BIN_NAME+'\x20init`\x20first.');return _0x449138(0xfc);}}export function toScopeFlags(_0x18cf04){return{'global':_0x18cf04==='global'};}export function formatScopeLabel(_0x238bd5){const _0x5bd847=a13_0x1b62;return _0x238bd5===_0x5bd847(0xf6)?_0x5bd847(0xf5):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a14_0x54e9(){const _0x58583c=['1AJFTXt','3FMjuqX','906298voqcAP','Invalid\x20--','14klrGCI','str','3344775TNwoQs','flag','join','Exactly\x20one\x20of\x20','4599416rGiwVS','filter','Provide\x20one\x20of:\x20','\x20is\x20required\x20for\x20`','some','validation','2413557SyuXkc','3028708DBsdUj',':\x20expected\x20','42581RKZFnJ','\x20are\x20mutually\x20exclusive\x20for\x20`','420lZndqu','At\x20least\x20one\x20of\x20','test',',\x20got\x20\x22','3336246HONEIt','length'];a14_0x54e9=function(){return _0x58583c;};return a14_0x54e9();}(function(_0x402e2c,_0x19b15e){const _0x5a141e=a14_0x1802,_0x1d49d3=_0x402e2c();while(!![]){try{const _0x4de847=-parseInt(_0x5a141e(0xb3))/0x1*(parseInt(_0x5a141e(0x9a))/0x2)+parseInt(_0x5a141e(0xb4))/0x3*(parseInt(_0x5a141e(0xa9))/0x4)+-parseInt(_0x5a141e(0x9e))/0x5+parseInt(_0x5a141e(0xb1))/0x6*(parseInt(_0x5a141e(0x9c))/0x7)+-parseInt(_0x5a141e(0xa2))/0x8+parseInt(_0x5a141e(0xa8))/0x9+parseInt(_0x5a141e(0xad))/0xa*(parseInt(_0x5a141e(0xab))/0xb);if(_0x4de847===_0x19b15e)break;else _0x1d49d3['push'](_0x1d49d3['shift']());}catch(_0x2d89ab){_0x1d49d3['push'](_0x1d49d3['shift']());}}}(a14_0x54e9,0x93367));function a14_0x1802(_0x286710,_0x49b2bd){_0x286710=_0x286710-0x9a;const _0x54e979=a14_0x54e9();let _0x1802bd=_0x54e979[_0x286710];return _0x1802bd;}import{CliErrors}from'../../errors.js';function isSet(_0xbd1f00,_0x3febb0){const _0x3f6e6c=a14_0x1802,_0x27aa18=_0xbd1f00[_0x3f6e6c(0x9f)](_0x3febb0);return _0x27aa18!==undefined&&_0x27aa18!==''&&_0x27aa18!==![]&&_0x27aa18!==0x0;}function fmtNames(_0x3f0ff7){const _0x57f481=a14_0x1802;return _0x3f0ff7['map'](_0x16e905=>'--'+_0x16e905)[_0x57f481(0xa0)](',\x20');}export function requireOneOf(_0x3f910c,_0x1f3e9c,_0x448b37){const _0x318e93=a14_0x1802,_0x44e594=_0x1f3e9c[_0x318e93(0xa3)](_0x3eca5f=>isSet(_0x3f910c,_0x3eca5f));if(_0x44e594[_0x318e93(0xb2)]!==0x1)throw CliErrors['validation'](_0x44e594['length']===0x0?_0x318e93(0xa1)+fmtNames(_0x1f3e9c)+_0x318e93(0xa5)+_0x448b37+'`.':'Only\x20one\x20of\x20'+fmtNames(_0x1f3e9c)+'\x20is\x20allowed,\x20found:\x20'+fmtNames(_0x44e594)+'.',_0x44e594['length']===0x0?_0x318e93(0xa4)+fmtNames(_0x1f3e9c):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x3d6943,_0x1116e4,_0x1488c6){const _0x5be4d2=a14_0x1802;if(!_0x1116e4[_0x5be4d2(0xa6)](_0x380ffe=>isSet(_0x3d6943,_0x380ffe)))throw CliErrors[_0x5be4d2(0xa7)](_0x5be4d2(0xae)+fmtNames(_0x1116e4)+_0x5be4d2(0xa5)+_0x1488c6+'`.',_0x5be4d2(0xa4)+fmtNames(_0x1116e4));}export function mutuallyExclusive(_0x2ac6ca,_0x4f81be,_0x44ae7c){const _0x198c82=a14_0x1802,_0x50b779=_0x4f81be['filter'](_0x46bd27=>isSet(_0x2ac6ca,_0x46bd27));if(_0x50b779['length']>0x1)throw CliErrors[_0x198c82(0xa7)]('Flags\x20'+fmtNames(_0x50b779)+_0x198c82(0xac)+_0x44ae7c+'`.','Use\x20only\x20one\x20of:\x20'+fmtNames(_0x4f81be));}export function validatePattern(_0xfb97c7,_0x58a004,_0x2f5958,_0xe785d5){const _0x1fae57=a14_0x1802,_0x2baf5f=_0xfb97c7[_0x1fae57(0x9d)](_0x58a004);if(_0x2baf5f&&!_0x2f5958[_0x1fae57(0xaf)](_0x2baf5f))throw CliErrors[_0x1fae57(0xa7)](_0x1fae57(0x9b)+_0x58a004+_0x1fae57(0xaa)+_0xe785d5+_0x1fae57(0xb0)+_0x2baf5f+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a15_0x368acd=a15_0x4421;(function(_0x544aec,_0x1dd5db){const _0x4cf911=a15_0x4421,_0x75f83b=_0x544aec();while(!![]){try{const _0x239c9a=-parseInt(_0x4cf911(0xf8))/0x1+parseInt(_0x4cf911(0x100))/0x2+parseInt(_0x4cf911(0xfd))/0x3+-parseInt(_0x4cf911(0x106))/0x4*(parseInt(_0x4cf911(0xf6))/0x5)+-parseInt(_0x4cf911(0xfb))/0x6+parseInt(_0x4cf911(0xfe))/0x7*(-parseInt(_0x4cf911(0x108))/0x8)+parseInt(_0x4cf911(0xfa))/0x9;if(_0x239c9a===_0x1dd5db)break;else _0x75f83b['push'](_0x75f83b['shift']());}catch(_0x43e999){_0x75f83b['push'](_0x75f83b['shift']());}}}(a15_0x45d8,0x42b2c));export const CODE_FLAG={'name':a15_0x368acd(0xf5),'type':a15_0x368acd(0xf7),'required':!![],'description':a15_0x368acd(0x107),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a15_0x368acd(0xf9)}};function a15_0x45d8(){const _0x2beb81=['108895HVaAcL','string','319348wHLNci','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)','4658652dOprJB','174042LgFJba','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','797889bLxVwz','91GHKuub','Resource\x20ID','994366LYSrpC','number','Return\x20full\x20raw\x20response\x20object','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','sqlcode','params','32AlesIQ','Dataset\x20code\x20(32-char\x20hex\x20UUID)','298456EtQuRA','boolean','Resource\x20name\x20for\x20lookup','code'];a15_0x45d8=function(){return _0x2beb81;};return a15_0x45d8();}export const SQLCODE_FLAG={'name':a15_0x368acd(0x104),'type':a15_0x368acd(0xf7),'required':!![],'description':a15_0x368acd(0xfc),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x368acd(0x103)}};export const VERBOSE_FLAG={'name':'verbose','type':a15_0x368acd(0x109),'description':a15_0x368acd(0x102)};export const PARAMS_FLAG={'name':a15_0x368acd(0x105),'type':a15_0x368acd(0xf7),'description':'Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'};export const NAME_FLAG={'name':'name','type':a15_0x368acd(0xf7),'description':a15_0x368acd(0x10a)};function a15_0x4421(_0x3e4f64,_0x1441a6){_0x3e4f64=_0x3e4f64-0xf5;const _0x45d846=a15_0x45d8();let _0x442156=_0x45d846[_0x3e4f64];return _0x442156;}export const ID_FLAG={'name':'id','type':a15_0x368acd(0x101),'required':!![],'description':a15_0x368acd(0xff)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a14_0x1d6864=a14_0x167d;(function(_0x16dc59,_0xf8a2e5){const _0x115c69=a14_0x167d,_0x5e4638=_0x16dc59();while(!![]){try{const _0x16d00c=parseInt(_0x115c69(0x1c9))/0x1*(parseInt(_0x115c69(0x1cf))/0x2)+-parseInt(_0x115c69(0x1d6))/0x3*(-parseInt(_0x115c69(0x1db))/0x4)+-parseInt(_0x115c69(0x1bf))/0x5*(parseInt(_0x115c69(0x1bb))/0x6)+parseInt(_0x115c69(0x1a1))/0x7+parseInt(_0x115c69(0x1a2))/0x8+parseInt(_0x115c69(0x1b2))/0x9*(parseInt(_0x115c69(0x1c8))/0xa)+-parseInt(_0x115c69(0x1d5))/0xb;if(_0x16d00c===_0xf8a2e5)break;else _0x5e4638['push'](_0x5e4638['shift']());}catch(_0x1eb533){_0x5e4638['push'](_0x5e4638['shift']());}}}(a14_0x434a,0xb0193));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';function a14_0x434a(){const _0x17fa3c=['delete','Top-level\x20key\x20\x22','4472174sTuetM','1947232GrYTdt','pageSize','pretty','project-or-global-explicit','args','\x22\x20not\x20found\x20at\x20top\x20level.','key','bool','field','Usage:\x20','get','write','stringify','keys','\x20config\x20get\x20<key>','Missing\x20key\x20argument.','9kmKqHB','Delete\x20a\x20config\x20value','Config\x20files:\x0a','Get\x20a\x20config\x20value','Deleted\x20`','list','value','`\x20=\x20\x22','apps','72mkXrJq','log','boolean','Missing\x20key\x20or\x20value.','535105CpeeIl','includes','global','split','config','Write\x20to\x20global\x20config','raw','Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','validation','5964760bRZZTr','1FgzRCR','Set\x20`','isArray','set','List\x20current\x20config','\x22\x20is\x20not\x20settable.','689504FIkMCR','../../context.js','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','\x20config\x20delete\x20<key>\x20[--global]','\x20\x20project:\x20','appcode','9779440ZzeoCY','459033aKCuaP','Key\x20not\x20found:\x20','alias','read','\x20(global)','28BhRDxY','trim','\x20\x20global:\x20\x20','length','Value\x20to\x20assign','join','object'];a14_0x434a=function(){return _0x17fa3c;};return a14_0x434a();}const GLOBAL_FLAG={'name':a14_0x1d6864(0x1c1),'type':a14_0x1d6864(0x1bd),'description':a14_0x1d6864(0x1c4),'default':![]};function parseAliasAppcodeSetKey(_0x516fb8){const _0x392db4=a14_0x1d6864,_0x3ec15f=_0x516fb8[_0x392db4(0x1c2)]('.');if(_0x3ec15f[_0x392db4(0x19b)]!==0x3||_0x3ec15f[0x0]!=='apps'||_0x3ec15f[0x2]!==_0x392db4(0x1d4))return undefined;const _0x1209fd=_0x3ec15f[0x1]?.['trim']();return _0x1209fd?_0x1209fd:undefined;}function parseAliasDeleteKey(_0x304663){const _0x37b6bb=a14_0x1d6864,_0x226542=_0x304663[_0x37b6bb(0x1c2)]('.');if(_0x226542[_0x37b6bb(0x19b)]===0x2&&_0x226542[0x0]===_0x37b6bb(0x1ba)){const _0x5f2fc6=_0x226542[0x1]?.[_0x37b6bb(0x1dc)]();return _0x5f2fc6?{'alias':_0x5f2fc6}:undefined;}if(_0x226542[_0x37b6bb(0x19b)]===0x3&&_0x226542[0x0]===_0x37b6bb(0x1ba)&&_0x226542[0x2]===_0x37b6bb(0x1d4)){const _0x2f97bc=_0x226542[0x1]?.['trim']();return _0x2f97bc?{'alias':_0x2f97bc,'field':'appcode'}:undefined;}return undefined;}function a14_0x167d(_0x2be72e,_0x3a4cfa){_0x2be72e=_0x2be72e-0x19b;const _0x434a29=a14_0x434a();let _0x167d65=_0x434a29[_0x2be72e];return _0x167d65;}function setLocalAppAlias(_0x1f0b64,_0x3a9510,_0x4a69cd){const _0x16a16c=a14_0x1d6864,_0x21acca=_0x1f0b64[_0x16a16c(0x1ba)]&&typeof _0x1f0b64['apps']===_0x16a16c(0x19e)&&!Array[_0x16a16c(0x1cb)](_0x1f0b64['apps'])?_0x1f0b64['apps']:{},_0x3c7713=_0x21acca[_0x3a9510]&&typeof _0x21acca[_0x3a9510]===_0x16a16c(0x19e)&&!Array[_0x16a16c(0x1cb)](_0x21acca[_0x3a9510])?_0x21acca[_0x3a9510]:{};_0x3c7713[_0x16a16c(0x1d4)]=_0x4a69cd,_0x21acca[_0x3a9510]=_0x3c7713,_0x1f0b64[_0x16a16c(0x1ba)]=_0x21acca;}function deleteLocalAppAlias(_0x2b3ebd,_0x5d3df4){const _0x56e013=a14_0x1d6864;if(!_0x2b3ebd[_0x56e013(0x1ba)]||typeof _0x2b3ebd[_0x56e013(0x1ba)]!==_0x56e013(0x19e)||Array[_0x56e013(0x1cb)](_0x2b3ebd[_0x56e013(0x1ba)]))return![];const _0x42bfd3=_0x2b3ebd[_0x56e013(0x1ba)],_0x1cbc68=_0x42bfd3[_0x5d3df4[_0x56e013(0x1d8)]];if(!_0x1cbc68||typeof _0x1cbc68!==_0x56e013(0x19e)||Array[_0x56e013(0x1cb)](_0x1cbc68))return![];if(!_0x5d3df4[_0x56e013(0x1aa)])return delete _0x42bfd3[_0x5d3df4['alias']],!![];if(!(_0x5d3df4[_0x56e013(0x1aa)]in _0x1cbc68))return![];return delete _0x1cbc68[_0x5d3df4[_0x56e013(0x1aa)]],Object[_0x56e013(0x1af)](_0x1cbc68)[_0x56e013(0x19b)]===0x0&&delete _0x42bfd3[_0x5d3df4[_0x56e013(0x1d8)]],!![];}const listDef={'service':a14_0x1d6864(0x1c3),'command':a14_0x1d6864(0x1b7),'description':a14_0x1d6864(0x1cd),'risk':a14_0x1d6864(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5a6602){const _0x49379=a14_0x1d6864,{buildConfigFromFlags:_0x263b1e}=await import(_0x49379(0x1d0)),_0x2b0fea=_0x263b1e({}),_0x4af2b2=getProjectConfigPath(),_0x2531a4=resolveWriteConfigPath('global');if(_0x5a6602['format']===_0x49379(0x1a4))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x49379(0x1ae)](_0x2b0fea[_0x49379(0x1c5)],null,0x2)+'\x0a\x0a')+_0x49379(0x1b4)+(_0x49379(0x1d3)+(_0x4af2b2??'(none)')+'\x0a')+(_0x49379(0x1dd)+_0x2531a4)};return{'ok':!![],'data':{'effective':_0x2b0fea[_0x49379(0x1c5)],'configFiles':{'project':_0x4af2b2??null,'global':_0x2531a4}}};}},getDef={'service':a14_0x1d6864(0x1c3),'command':a14_0x1d6864(0x1ac),'description':a14_0x1d6864(0x1b5),'risk':a14_0x1d6864(0x1d9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a14_0x1d6864(0x1a8),'description':a14_0x1d6864(0x1c6),'required':!![]}],'flags':[],async 'execute'(_0x52f4d1){const _0x7cc3c8=a14_0x1d6864,_0x47eeb1=_0x52f4d1[_0x7cc3c8(0x1a6)][0x0];if(!_0x47eeb1)throw CliErrors[_0x7cc3c8(0x1c7)](_0x7cc3c8(0x1b1),'Usage:\x20'+CLI_BIN_NAME+_0x7cc3c8(0x1b0));const {buildConfigFromFlags:_0x47f421}=await import(_0x7cc3c8(0x1d0)),{raw:_0x5de541}=_0x47f421({});if(_0x47eeb1[_0x7cc3c8(0x1c0)]('.')){const _0x70908d=_0x47eeb1['split']('.');let _0x46a2a7=_0x5de541;for(const _0x4d84b0 of _0x70908d){if(_0x46a2a7==null||typeof _0x46a2a7!=='object')throw CliErrors['validation'](_0x7cc3c8(0x1d7)+_0x47eeb1);_0x46a2a7=_0x46a2a7[_0x4d84b0];}if(_0x46a2a7===undefined)throw CliErrors['validation'](_0x7cc3c8(0x1d7)+_0x47eeb1);return console['log'](typeof _0x46a2a7==='object'?JSON[_0x7cc3c8(0x1ae)](_0x46a2a7,null,0x2):String(_0x46a2a7)),{'ok':!![]};}const _0x1e8c83=_0x5de541[_0x47eeb1];if(_0x1e8c83===undefined)throw CliErrors[_0x7cc3c8(0x1c7)](_0x7cc3c8(0x1d7)+_0x47eeb1);return console[_0x7cc3c8(0x1bc)](typeof _0x1e8c83===_0x7cc3c8(0x19e)?JSON[_0x7cc3c8(0x1ae)](_0x1e8c83,null,0x2):String(_0x1e8c83)),{'ok':!![]};}},setDef={'service':a14_0x1d6864(0x1c3),'command':a14_0x1d6864(0x1cc),'description':'Set\x20a\x20config\x20value','risk':a14_0x1d6864(0x1ad),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a14_0x1d6864(0x1b8),'description':a14_0x1d6864(0x19c),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x4a30e0){const _0x916cf7=a14_0x1d6864,_0xef9b79=_0x4a30e0[_0x916cf7(0x1a6)][0x0],_0x3a39d2=_0x4a30e0[_0x916cf7(0x1a6)][0x1];if(!_0xef9b79||_0x3a39d2===undefined)throw CliErrors['validation'](_0x916cf7(0x1be),_0x916cf7(0x1ab)+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0xef9b79]&&!ENUM_KEYS[_0xef9b79]['includes'](_0x3a39d2))throw CliErrors[_0x916cf7(0x1c7)]('Invalid\x20value\x20for\x20\x22'+_0xef9b79+'\x22.\x20Allowed:\x20'+ENUM_KEYS[_0xef9b79][_0x916cf7(0x19d)](',\x20'));if(_0xef9b79==='riskLevel')throw CliErrors['validation'](_0x916cf7(0x1d1));if(_0xef9b79===_0x916cf7(0x1a3)){const _0x3c9192=Number(_0x3a39d2);if(isNaN(_0x3c9192)||_0x3c9192<=0x0)throw CliErrors[_0x916cf7(0x1c7)]('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x22baef=resolveWriteScope({'explicitGlobal':_0x4a30e0['bool'](_0x916cf7(0x1c1)),'policy':_0x916cf7(0x1a5)}),_0x1b6076=toScopeFlags(_0x22baef),_0x13d4f2=readScopedConfig(_0x1b6076),_0xad7fe4=parseAliasAppcodeSetKey(_0xef9b79);if(!_0xad7fe4&&!isTopLevelConfigKey(_0xef9b79))throw CliErrors[_0x916cf7(0x1c7)](_0x916cf7(0x1a0)+_0xef9b79+_0x916cf7(0x1ce),'Settable\x20keys:\x20'+getTopLevelConfigKeySummary()+';\x20apps.<alias>.appcode');return _0xad7fe4?setLocalAppAlias(_0x13d4f2,_0xad7fe4,_0x3a39d2):_0x13d4f2[_0xef9b79]=_0xef9b79===_0x916cf7(0x1a3)?Number(_0x3a39d2):_0x3a39d2,console[_0x916cf7(0x1bc)](_0x916cf7(0x1ca)+_0xef9b79+_0x916cf7(0x1b9)+_0x3a39d2+'\x22'+(_0x22baef===_0x916cf7(0x1c1)?_0x916cf7(0x1da):'')),writeScopedConfig(_0x13d4f2,_0x1b6076),{'ok':!![]};}},deleteDef={'service':a14_0x1d6864(0x1c3),'command':a14_0x1d6864(0x19f),'description':a14_0x1d6864(0x1b3),'risk':a14_0x1d6864(0x1ad),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x22b669){const _0x38088b=a14_0x1d6864,_0x13a9b1=_0x22b669['args'][0x0];if(!_0x13a9b1)throw CliErrors['validation']('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+_0x38088b(0x1d2));const _0x4d0b9d=resolveWriteScope({'explicitGlobal':_0x22b669[_0x38088b(0x1a9)]('global'),'policy':_0x38088b(0x1a5)}),_0x35e278=toScopeFlags(_0x4d0b9d),_0x2624ed=readScopedConfig(_0x35e278),_0x317d52=parseAliasDeleteKey(_0x13a9b1);if(_0x317d52){if(!deleteLocalAppAlias(_0x2624ed,_0x317d52))throw CliErrors[_0x38088b(0x1c7)](_0x38088b(0x1d7)+_0x13a9b1);return console['log'](_0x38088b(0x1b6)+_0x13a9b1+'`'+(_0x4d0b9d==='global'?_0x38088b(0x1da):'')),writeScopedConfig(_0x2624ed,_0x35e278),{'ok':!![]};}if(_0x2624ed[_0x13a9b1]===undefined)throw CliErrors['validation']('Key\x20\x22'+_0x13a9b1+_0x38088b(0x1a7));return delete _0x2624ed[_0x13a9b1],console[_0x38088b(0x1bc)](_0x38088b(0x1b6)+_0x13a9b1+'`'+(_0x4d0b9d==='global'?_0x38088b(0x1da):'')),writeScopedConfig(_0x2624ed,_0x35e278),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|
|
1
|
+
const a16_0x28cf02=a16_0x505a;(function(_0x3bc2f3,_0x4bbd08){const _0x4348b0=a16_0x505a,_0x20c7f6=_0x3bc2f3();while(!![]){try{const _0x4f320a=parseInt(_0x4348b0(0x1e5))/0x1+-parseInt(_0x4348b0(0x1c6))/0x2*(-parseInt(_0x4348b0(0x1e1))/0x3)+-parseInt(_0x4348b0(0x1df))/0x4+-parseInt(_0x4348b0(0x1f6))/0x5+-parseInt(_0x4348b0(0x1eb))/0x6*(parseInt(_0x4348b0(0x1e0))/0x7)+-parseInt(_0x4348b0(0x1c4))/0x8*(parseInt(_0x4348b0(0x1e8))/0x9)+parseInt(_0x4348b0(0x1d0))/0xa;if(_0x4f320a===_0x4bbd08)break;else _0x20c7f6['push'](_0x20c7f6['shift']());}catch(_0x5d0d9d){_0x20c7f6['push'](_0x20c7f6['shift']());}}}(a16_0x565a,0x682fe));function a16_0x505a(_0x314159,_0x11eb24){_0x314159=_0x314159-0x1b4;const _0x565aef=a16_0x565a();let _0x505a48=_0x565aef[_0x314159];return _0x505a48;}function a16_0x565a(){const _0x211ee0=['list','469485zOLVcG','length','alias','9yyDZEQ','\x20config\x20set\x20<key>\x20<value>\x20[--global]','apps','18liIdKR','Value\x20to\x20assign','../../context.js','validation','\x20(global)','Deleted\x20`','pageSize\x20must\x20be\x20a\x20positive\x20number','Missing\x20key\x20or\x20value.','Missing\x20key\x20argument.','\x22\x20not\x20found\x20at\x20top\x20level.','get','132555DwIcVI','global','\x20\x20global:\x20\x20','bool','\x20config\x20get\x20<key>','raw','set','Top-level\x20key\x20\x22','project-or-global-explicit','stringify','Key\x20not\x20found:\x20','keys','read','pretty','pageSize','field','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','1946792LwrASd','List\x20current\x20config','8714inYkNi','Key\x20\x22','args','write','value','trim','Usage:\x20',';\x20apps.<alias>.appcode','\x22.\x20Allowed:\x20','Settable\x20keys:\x20','7212440PQlNjo','isArray','boolean','object','appcode','Set\x20a\x20config\x20value','Config\x20files:\x0a','config','Write\x20to\x20global\x20config','Invalid\x20value\x20for\x20\x22','`\x20=\x20\x22','split','riskLevel','Set\x20`','log','619176ASJfKj','1635564ajRSZj','249xdFamm','format','Delete\x20a\x20config\x20value'];a16_0x565a=function(){return _0x211ee0;};return a16_0x565a();}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':a16_0x28cf02(0x1b4),'type':a16_0x28cf02(0x1d2),'description':a16_0x28cf02(0x1d8),'default':![]};function parseAliasAppcodeSetKey(_0x435054){const _0x1ab564=a16_0x28cf02,_0x42fc83=_0x435054[_0x1ab564(0x1db)]('.');if(_0x42fc83['length']!==0x3||_0x42fc83[0x0]!=='apps'||_0x42fc83[0x2]!=='appcode')return undefined;const _0x4099b4=_0x42fc83[0x1]?.['trim']();return _0x4099b4?_0x4099b4:undefined;}function parseAliasDeleteKey(_0x4fe617){const _0x3e579b=a16_0x28cf02,_0x20a4e9=_0x4fe617[_0x3e579b(0x1db)]('.');if(_0x20a4e9['length']===0x2&&_0x20a4e9[0x0]===_0x3e579b(0x1ea)){const _0x270f55=_0x20a4e9[0x1]?.[_0x3e579b(0x1cb)]();return _0x270f55?{'alias':_0x270f55}:undefined;}if(_0x20a4e9[_0x3e579b(0x1e6)]===0x3&&_0x20a4e9[0x0]===_0x3e579b(0x1ea)&&_0x20a4e9[0x2]===_0x3e579b(0x1d4)){const _0x378e1e=_0x20a4e9[0x1]?.[_0x3e579b(0x1cb)]();return _0x378e1e?{'alias':_0x378e1e,'field':_0x3e579b(0x1d4)}:undefined;}return undefined;}function setLocalAppAlias(_0x41ba0d,_0x150fb5,_0x441b9b){const _0x2acca3=a16_0x28cf02,_0x2923a1=_0x41ba0d[_0x2acca3(0x1ea)]&&typeof _0x41ba0d[_0x2acca3(0x1ea)]===_0x2acca3(0x1d3)&&!Array[_0x2acca3(0x1d1)](_0x41ba0d[_0x2acca3(0x1ea)])?_0x41ba0d['apps']:{},_0x471204=_0x2923a1[_0x150fb5]&&typeof _0x2923a1[_0x150fb5]==='object'&&!Array[_0x2acca3(0x1d1)](_0x2923a1[_0x150fb5])?_0x2923a1[_0x150fb5]:{};_0x471204[_0x2acca3(0x1d4)]=_0x441b9b,_0x2923a1[_0x150fb5]=_0x471204,_0x41ba0d[_0x2acca3(0x1ea)]=_0x2923a1;}function deleteLocalAppAlias(_0x4bd6c5,_0x4e7351){const _0x4aae1=a16_0x28cf02;if(!_0x4bd6c5[_0x4aae1(0x1ea)]||typeof _0x4bd6c5[_0x4aae1(0x1ea)]!==_0x4aae1(0x1d3)||Array['isArray'](_0x4bd6c5[_0x4aae1(0x1ea)]))return![];const _0xe9c025=_0x4bd6c5[_0x4aae1(0x1ea)],_0x35e918=_0xe9c025[_0x4e7351['alias']];if(!_0x35e918||typeof _0x35e918!==_0x4aae1(0x1d3)||Array['isArray'](_0x35e918))return![];if(!_0x4e7351[_0x4aae1(0x1c2)])return delete _0xe9c025[_0x4e7351[_0x4aae1(0x1e7)]],!![];if(!(_0x4e7351['field']in _0x35e918))return![];return delete _0x35e918[_0x4e7351[_0x4aae1(0x1c2)]],Object[_0x4aae1(0x1be)](_0x35e918)[_0x4aae1(0x1e6)]===0x0&&delete _0xe9c025[_0x4e7351[_0x4aae1(0x1e7)]],!![];}const listDef={'service':'config','command':a16_0x28cf02(0x1e4),'description':a16_0x28cf02(0x1c5),'risk':a16_0x28cf02(0x1bf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x38641e){const _0x164141=a16_0x28cf02,{buildConfigFromFlags:_0x3060a3}=await import('../../context.js'),_0x4e53a3=_0x3060a3({}),_0x3f7158=getProjectConfigPath(),_0x42d141=resolveWriteConfigPath(_0x164141(0x1b4));if(_0x38641e[_0x164141(0x1e2)]===_0x164141(0x1c0))return{'ok':!![],'message':'#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a'+(JSON[_0x164141(0x1bc)](_0x4e53a3[_0x164141(0x1b8)],null,0x2)+'\x0a\x0a')+_0x164141(0x1d6)+('\x20\x20project:\x20'+(_0x3f7158??'(none)')+'\x0a')+(_0x164141(0x1b5)+_0x42d141)};return{'ok':!![],'data':{'effective':_0x4e53a3[_0x164141(0x1b8)],'configFiles':{'project':_0x3f7158??null,'global':_0x42d141}}};}},getDef={'service':a16_0x28cf02(0x1d7),'command':a16_0x28cf02(0x1f5),'description':'Get\x20a\x20config\x20value','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x1d9d2b){const _0x55b3d0=a16_0x28cf02,_0x100c85=_0x1d9d2b[_0x55b3d0(0x1c8)][0x0];if(!_0x100c85)throw CliErrors['validation'](_0x55b3d0(0x1f3),_0x55b3d0(0x1cc)+CLI_BIN_NAME+_0x55b3d0(0x1b7));const {buildConfigFromFlags:_0x3a6e34}=await import(_0x55b3d0(0x1ed)),{raw:_0x23b613}=_0x3a6e34({});if(_0x100c85['includes']('.')){const _0x5a63e4=_0x100c85[_0x55b3d0(0x1db)]('.');let _0x6ef464=_0x23b613;for(const _0x1bca12 of _0x5a63e4){if(_0x6ef464==null||typeof _0x6ef464!=='object')throw CliErrors['validation']('Key\x20not\x20found:\x20'+_0x100c85);_0x6ef464=_0x6ef464[_0x1bca12];}if(_0x6ef464===undefined)throw CliErrors[_0x55b3d0(0x1ee)]('Key\x20not\x20found:\x20'+_0x100c85);return console[_0x55b3d0(0x1de)](typeof _0x6ef464===_0x55b3d0(0x1d3)?JSON[_0x55b3d0(0x1bc)](_0x6ef464,null,0x2):String(_0x6ef464)),{'ok':!![]};}const _0x4bb215=_0x23b613[_0x100c85];if(_0x4bb215===undefined)throw CliErrors['validation'](_0x55b3d0(0x1bd)+_0x100c85);return console[_0x55b3d0(0x1de)](typeof _0x4bb215===_0x55b3d0(0x1d3)?JSON[_0x55b3d0(0x1bc)](_0x4bb215,null,0x2):String(_0x4bb215)),{'ok':!![]};}},setDef={'service':a16_0x28cf02(0x1d7),'command':a16_0x28cf02(0x1b9),'description':a16_0x28cf02(0x1d5),'risk':a16_0x28cf02(0x1c9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x28cf02(0x1ca),'description':a16_0x28cf02(0x1ec),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x151f1a){const _0x5189ee=a16_0x28cf02,_0x5b3906=_0x151f1a[_0x5189ee(0x1c8)][0x0],_0x46556e=_0x151f1a[_0x5189ee(0x1c8)][0x1];if(!_0x5b3906||_0x46556e===undefined)throw CliErrors[_0x5189ee(0x1ee)](_0x5189ee(0x1f2),'Usage:\x20'+CLI_BIN_NAME+_0x5189ee(0x1e9));if(ENUM_KEYS[_0x5b3906]&&!ENUM_KEYS[_0x5b3906]['includes'](_0x46556e))throw CliErrors['validation'](_0x5189ee(0x1d9)+_0x5b3906+_0x5189ee(0x1ce)+ENUM_KEYS[_0x5b3906]['join'](',\x20'));if(_0x5b3906===_0x5189ee(0x1dc))throw CliErrors['validation'](_0x5189ee(0x1c3));if(_0x5b3906==='pageSize'){const _0x25cac9=Number(_0x46556e);if(isNaN(_0x25cac9)||_0x25cac9<=0x0)throw CliErrors['validation'](_0x5189ee(0x1f1));}const _0x830c99=resolveWriteScope({'explicitGlobal':_0x151f1a[_0x5189ee(0x1b6)](_0x5189ee(0x1b4)),'policy':_0x5189ee(0x1bb)}),_0x180920=toScopeFlags(_0x830c99),_0x213383=readScopedConfig(_0x180920),_0x2c3f2d=parseAliasAppcodeSetKey(_0x5b3906);if(!_0x2c3f2d&&!isTopLevelConfigKey(_0x5b3906))throw CliErrors[_0x5189ee(0x1ee)](_0x5189ee(0x1ba)+_0x5b3906+'\x22\x20is\x20not\x20settable.',_0x5189ee(0x1cf)+getTopLevelConfigKeySummary()+_0x5189ee(0x1cd));return _0x2c3f2d?setLocalAppAlias(_0x213383,_0x2c3f2d,_0x46556e):_0x213383[_0x5b3906]=_0x5b3906===_0x5189ee(0x1c1)?Number(_0x46556e):_0x46556e,console['log'](_0x5189ee(0x1dd)+_0x5b3906+_0x5189ee(0x1da)+_0x46556e+'\x22'+(_0x830c99===_0x5189ee(0x1b4)?_0x5189ee(0x1ef):'')),writeScopedConfig(_0x213383,_0x180920),{'ok':!![]};}},deleteDef={'service':a16_0x28cf02(0x1d7),'command':'delete','description':a16_0x28cf02(0x1e3),'risk':a16_0x28cf02(0x1c9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'key','description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x191563){const _0x2dc1d4=a16_0x28cf02,_0x1d769b=_0x191563[_0x2dc1d4(0x1c8)][0x0];if(!_0x1d769b)throw CliErrors['validation']('Missing\x20key\x20argument.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x334dbb=resolveWriteScope({'explicitGlobal':_0x191563['bool']('global'),'policy':_0x2dc1d4(0x1bb)}),_0x3a7777=toScopeFlags(_0x334dbb),_0x130e77=readScopedConfig(_0x3a7777),_0x51273c=parseAliasDeleteKey(_0x1d769b);if(_0x51273c){if(!deleteLocalAppAlias(_0x130e77,_0x51273c))throw CliErrors['validation'](_0x2dc1d4(0x1bd)+_0x1d769b);return console[_0x2dc1d4(0x1de)]('Deleted\x20`'+_0x1d769b+'`'+(_0x334dbb===_0x2dc1d4(0x1b4)?_0x2dc1d4(0x1ef):'')),writeScopedConfig(_0x130e77,_0x3a7777),{'ok':!![]};}if(_0x130e77[_0x1d769b]===undefined)throw CliErrors[_0x2dc1d4(0x1ee)](_0x2dc1d4(0x1c7)+_0x1d769b+_0x2dc1d4(0x1f4));return delete _0x130e77[_0x1d769b],console[_0x2dc1d4(0x1de)](_0x2dc1d4(0x1f0)+_0x1d769b+'`'+(_0x334dbb===_0x2dc1d4(0x1b4)?_0x2dc1d4(0x1ef):'')),writeScopedConfig(_0x130e77,_0x3a7777),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|