@lovrabet/lovrabet-cli 2.0.13-beta.3 → 2.0.13-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/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/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
const a0_0x5e56d2=a0_0x2c85;(function(_0x15111f,_0x3b0e7d){const _0x56697e=a0_0x2c85,_0x4b9915=_0x15111f();while(!![]){try{const _0x129f6d=-parseInt(_0x56697e(0x141))/0x1*(-parseInt(_0x56697e(0x126))/0x2)+-parseInt(_0x56697e(0x142))/0x3*(parseInt(_0x56697e(0x12e))/0x4)+parseInt(_0x56697e(0x149))/0x5+-parseInt(_0x56697e(0x14a))/0x6*(-parseInt(_0x56697e(0x13b))/0x7)+-parseInt(_0x56697e(0x128))/0x8*(-parseInt(_0x56697e(0x125))/0x9)+parseInt(_0x56697e(0x133))/0xa*(parseInt(_0x56697e(0x14d))/0xb)+-parseInt(_0x56697e(0x135))/0xc;if(_0x129f6d===_0x3b0e7d)break;else _0x4b9915['push'](_0x4b9915['shift']());}catch(_0x37f2fe){_0x4b9915['push'](_0x4b9915['shift']());}}}(a0_0x3b8b,0x368bc));import{jsx as a0_0x39be57}from'react/jsx-runtime';import a0_0x3e2ade from'meow';import{render}from'ink';import{Help}from'./help.js';function a0_0x2c85(_0x141e17,_0x44677a){_0x141e17=_0x141e17-0x122;const _0x3b8b65=a0_0x3b8b();let _0x2c8572=_0x3b8b65[_0x141e17];return _0x2c8572;}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';function a0_0x3b8b(){const _0x55b774=['168760yICuPh','handler','7704816WIGsoi','length','assign','write','Unexpected\x20error:','\x20->\x20--','3941FUPTaQ','\x0aCancelled.\x0a','cancelled','exitCode','help','hint','115646DWKVis','56205typCdB','slice','[preparse]\x20','code','Error:\x20','log','original','192740HqaLAv','2556aJPUfY','Hint:\x20','exit','132MyMxTk','error','catch','message','defaultCommand','name','153yBeWqJ','6ZMcqki','input','44168SvMqqq','flatMap','ExitPromptError','stderr','ERR_USE_AFTER_CLOSE','args','12qopCIt','flags','corrected',':\x20--','./framework/preparse.js'];a0_0x3b8b=function(){return _0x55b774;};return a0_0x3b8b();}import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';const helpText=generateFullHelp(),cli=a0_0x3e2ade(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'autoVersion':!![]});void main()[a0_0x5e56d2(0x14f)](handleError);async function main(){try{await run();}catch(_0x2c9d6b){handleError(_0x2c9d6b);}}async function run(){const _0xb84d31=a0_0x5e56d2;let _0xd28eb=cli['input'][0x0],_0x295666=cli[_0xb84d31(0x127)][0x1];const _0x28f218=cli[_0xb84d31(0x12f)];try{const {correctFlags:_0x3f5dac}=await import(_0xb84d31(0x132)),_0x35e489=getAllDefinitions()[_0xb84d31(0x129)](_0x298dfe=>_0x298dfe[_0xb84d31(0x12f)]??[]),{flags:_0x3a42b7,corrections:_0x24c685}=_0x3f5dac(_0x28f218,_0x35e489);if(_0x24c685[_0xb84d31(0x136)]>0x0){for(const _0x5d0bd8 of _0x24c685){process[_0xb84d31(0x12b)][_0xb84d31(0x138)](_0xb84d31(0x144)+_0x5d0bd8[_0xb84d31(0x134)]+_0xb84d31(0x131)+_0x5d0bd8[_0xb84d31(0x148)]+_0xb84d31(0x13a)+_0x5d0bd8[_0xb84d31(0x130)]+'\x0a');}Object[_0xb84d31(0x137)](_0x28f218,_0x3a42b7);}}catch{}if(!_0xd28eb||!isKnownService(_0xd28eb)){const {waitUntilExit:_0x9796a5}=render(a0_0x39be57(Help,{}));await _0x9796a5();return;}const _0x2b92c6=getServiceEntry(_0xd28eb);if(!_0x295666){if(_0x28f218[_0xb84d31(0x13f)]){console[_0xb84d31(0x147)](generateServiceHelp(_0xd28eb));return;}if(_0x2b92c6[_0xb84d31(0x123)])_0x295666=_0x2b92c6[_0xb84d31(0x123)];else{console[_0xb84d31(0x147)](generateServiceHelp(_0xd28eb));return;}}const _0x5c352a=findDefinition(_0xd28eb,_0x295666);!_0x5c352a&&(console[_0xb84d31(0x147)](generateServiceHelp(_0xd28eb)),handleError(CliErrors['unknownCommand'](_0xd28eb+'\x20'+_0x295666)));if(_0x28f218[_0xb84d31(0x13f)]){console['log'](generateCommandHelp(_0x5c352a));return;}const _0x294118=buildConfigFromFlags(_0x28f218);await initGlobalEnvironment(_0x294118);const _0x239098=createPipelineEnv(_0x294118,_0x28f218);_0x239098[_0xb84d31(0x12d)]=cli[_0xb84d31(0x127)][_0xb84d31(0x143)](0x2),await runCommand(_0x5c352a,_0x239098);}function handleError(_0x489eb5){const _0x317021=a0_0x5e56d2;if(_0x489eb5 instanceof CliError){_0x489eb5[_0x317021(0x145)]===_0x317021(0x13d)&&(process[_0x317021(0x12b)]['write'](_0x317021(0x13c)),process[_0x317021(0x14c)](0x0));console[_0x317021(0x14e)](_0x317021(0x146)+_0x489eb5[_0x317021(0x122)]);if(_0x489eb5[_0x317021(0x140)])console['error'](_0x317021(0x14b)+_0x489eb5[_0x317021(0x140)]);process[_0x317021(0x14c)](_0x489eb5[_0x317021(0x13e)]);}isUserCancellation(_0x489eb5)&&(process[_0x317021(0x12b)]['write'](_0x317021(0x13c)),process[_0x317021(0x14c)](0x0)),console[_0x317021(0x14e)](_0x317021(0x139),_0x489eb5),process['exit'](0x1);}function isUserCancellation(_0x4e556c){const _0x2ab795=a0_0x5e56d2;if(!(_0x4e556c instanceof Error))return![];if(_0x4e556c[_0x2ab795(0x124)]===_0x2ab795(0x12a))return!![];if(_0x4e556c[_0x2ab795(0x145)]===_0x2ab795(0x12c))return!![];if(_0x4e556c[_0x2ab795(0x145)]==='ERR_STREAM_DESTROYED')return!![];return![];}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a1_0x18bd4f=a1_0xe03f;function a1_0xe03f(_0xd6e762,_0x36e06f){_0xd6e762=_0xd6e762-0xf7;const _0x699565=a1_0x6995();let _0xe03fb2=_0x699565[_0xd6e762];return _0xe03fb2;}(function(_0x53a2a8,_0x1c746d){const _0x3b3c78=a1_0xe03f,_0x14c61b=_0x53a2a8();while(!![]){try{const _0xe3d208=-parseInt(_0x3b3c78(0x14a))/0x1*(parseInt(_0x3b3c78(0x115))/0x2)+-parseInt(_0x3b3c78(0x14b))/0x3+-parseInt(_0x3b3c78(0x13b))/0x4+-parseInt(_0x3b3c78(0x101))/0x5+-parseInt(_0x3b3c78(0x121))/0x6*(-parseInt(_0x3b3c78(0x116))/0x7)+parseInt(_0x3b3c78(0x13c))/0x8+parseInt(_0x3b3c78(0x120))/0x9;if(_0xe3d208===_0x1c746d)break;else _0x14c61b['push'](_0x14c61b['shift']());}catch(_0xd20c8b){_0x14c61b['push'](_0x14c61b['shift']());}}}(a1_0x6995,0x75b4d));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x18bd4f(0x13d),'type':a1_0x18bd4f(0x164),'description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':'keyword','type':a1_0x18bd4f(0x164),'description':a1_0x18bd4f(0x130)},DOC_CODE_FLAG={'name':'code','type':a1_0x18bd4f(0x164),'required':!![],'description':a1_0x18bd4f(0x12c)},DOCS=[{'code':a1_0x18bd4f(0x128),'category':a1_0x18bd4f(0x108),'title':'List\x20datasets','method':a1_0x18bd4f(0x145),'path':a1_0x18bd4f(0x155),'summary':a1_0x18bd4f(0x124),'whenToUse':a1_0x18bd4f(0x153),'pathParams':[],'queryParams':[],'bodySchema':a1_0x18bd4f(0x10f),'responseHighlights':[a1_0x18bd4f(0x127),a1_0x18bd4f(0x10e)],'examples':[a1_0x18bd4f(0x133)],'notes':[a1_0x18bd4f(0x12d)],'markdown':[a1_0x18bd4f(0x11b),'','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.'][a1_0x18bd4f(0x123)]('\x0a')},{'code':a1_0x18bd4f(0xfb),'category':'dataset','title':a1_0x18bd4f(0x162),'method':a1_0x18bd4f(0x144),'path':a1_0x18bd4f(0x141),'summary':'获取数据集详情','whenToUse':a1_0x18bd4f(0x12a),'pathParams':[],'queryParams':[{'name':a1_0x18bd4f(0x104),'description':'32-character\x20dataset\x20code'}],'bodySchema':a1_0x18bd4f(0x112),'responseHighlights':[a1_0x18bd4f(0x12f),'operations\x20describes\x20runtime\x20APIs'],'examples':['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>'],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':[a1_0x18bd4f(0x111),'',a1_0x18bd4f(0x15a)]['join']('\x0a')},{'code':a1_0x18bd4f(0x125),'category':a1_0x18bd4f(0x108),'title':a1_0x18bd4f(0xf8),'method':a1_0x18bd4f(0x145),'path':'/api/{appCode}/{datasetCode}/filter','summary':a1_0x18bd4f(0xfd),'whenToUse':a1_0x18bd4f(0x140),'pathParams':[{'name':a1_0x18bd4f(0x109),'description':'Current\x20app\x20code'},{'name':a1_0x18bd4f(0x158),'description':a1_0x18bd4f(0x134)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0x10c),'responseHighlights':[a1_0x18bd4f(0x102),a1_0x18bd4f(0x135)],'examples':[a1_0x18bd4f(0x154)],'notes':[a1_0x18bd4f(0x142)],'markdown':[a1_0x18bd4f(0x122),'',a1_0x18bd4f(0x11c)]['join']('\x0a')},{'code':a1_0x18bd4f(0x143),'category':'dataset','title':a1_0x18bd4f(0x12e),'method':a1_0x18bd4f(0x145),'path':a1_0x18bd4f(0x147),'summary':'聚合查询数据集数据','whenToUse':'需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','pathParams':[{'name':a1_0x18bd4f(0x109),'description':a1_0x18bd4f(0x15b)},{'name':a1_0x18bd4f(0x158),'description':a1_0x18bd4f(0x134)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0x157),'responseHighlights':[a1_0x18bd4f(0x11e),a1_0x18bd4f(0x159)],'examples':[a1_0x18bd4f(0xff)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.'],'markdown':['##\x20Aggregate\x20dataset\x20data','','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x18bd4f(0x123)]('\x0a')},{'code':'dataset_data_get_one','category':a1_0x18bd4f(0x108),'title':a1_0x18bd4f(0x161),'method':a1_0x18bd4f(0x145),'path':'/api/{appCode}/{datasetCode}/getOne','summary':a1_0x18bd4f(0x150),'whenToUse':a1_0x18bd4f(0x151),'pathParams':[{'name':a1_0x18bd4f(0x109),'description':a1_0x18bd4f(0x15b)},{'name':a1_0x18bd4f(0x158),'description':a1_0x18bd4f(0x134)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0xf7),'responseHighlights':[a1_0x18bd4f(0xfe)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':['Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.'],'markdown':'##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.'},{'code':a1_0x18bd4f(0x100),'category':a1_0x18bd4f(0x108),'title':a1_0x18bd4f(0x129),'method':a1_0x18bd4f(0x145),'path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x18bd4f(0x15e),'whenToUse':a1_0x18bd4f(0x139),'pathParams':[{'name':a1_0x18bd4f(0x109),'description':'Current\x20app\x20code'},{'name':a1_0x18bd4f(0x158),'description':a1_0x18bd4f(0x134)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0x11a),'responseHighlights':[a1_0x18bd4f(0x15c)],'examples':[a1_0x18bd4f(0x13f)],'notes':[a1_0x18bd4f(0x14e)],'markdown':a1_0x18bd4f(0xfc)},{'code':'bf_function_list','category':'bf','title':a1_0x18bd4f(0x156),'method':'GET','path':'/api/endpoint/{appCode}/functions','summary':a1_0x18bd4f(0x146),'whenToUse':a1_0x18bd4f(0x12b),'pathParams':[{'name':a1_0x18bd4f(0x109),'description':a1_0x18bd4f(0x15b)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0x112),'responseHighlights':[a1_0x18bd4f(0x15f)],'examples':['lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>'],'notes':[a1_0x18bd4f(0x117)],'markdown':a1_0x18bd4f(0x107)},{'code':'bf_execute','category':'bf','title':a1_0x18bd4f(0xf9),'method':a1_0x18bd4f(0x145),'path':'/api/endpoint/{appCode}/{scriptName}','summary':a1_0x18bd4f(0x13a),'whenToUse':a1_0x18bd4f(0x113),'pathParams':[{'name':a1_0x18bd4f(0x109),'description':a1_0x18bd4f(0x15b)},{'name':'scriptName','description':a1_0x18bd4f(0x149)}],'queryParams':[],'bodySchema':a1_0x18bd4f(0x14c),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x18bd4f(0x106)],'notes':[a1_0x18bd4f(0x137)],'markdown':a1_0x18bd4f(0x14d)},{'code':'custom_sql_execute','category':a1_0x18bd4f(0x148),'title':a1_0x18bd4f(0x126),'method':'POST','path':a1_0x18bd4f(0x114),'summary':a1_0x18bd4f(0x152),'whenToUse':'已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':[a1_0x18bd4f(0x138)],'examples':[a1_0x18bd4f(0x13e)],'notes':[a1_0x18bd4f(0x103)],'markdown':'##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.'}];function a1_0x6995(){const _0x52807f=['已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','/api/custom/executeSql','2978YSEBTJ','474131nhQbpN','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','list','map','{\x22fieldName\x22:\x22value\x22}','##\x20List\x20datasets','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','read','result\x20rows\x20contain\x20aggregate\x20aliases','API\x20doc\x20code\x20not\x20found:\x20','2388996TGCSDM','84XJQwXs','##\x20Filter\x20dataset\x20data','join','分页获取数据集列表','dataset_data_filter','Execute\x20custom\x20SQL','tableData\x20contains\x20dataset\x20id/code/name','dataset_list','Create\x20dataset\x20record','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','API\x20doc\x20code,\x20for\x20example\x20dataset_list','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','Aggregate\x20dataset\x20data','fields/properties\x20describe\x20data\x20shape','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','method','path','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','32-character\x20dataset\x20code','paging\x20contains\x20pagination','Show\x20runtime\x20API\x20documentation\x20by\x20code','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Returns\x20SQL\x20execution\x20payload','需要向指定数据集新增一条业务数据时使用','执行指定\x20BF\x20函数','1168056pYtmwN','230592qPzYDp','category','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','/api/dataset/getOneByCode?code={datasetCode}','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','dataset_data_aggregate','GET','POST','获取应用下可调用的\x20BF\x20函数列表','/api/{appCode}/{datasetCode}/aggregate','custom_sql','Endpoint\x20function\x20name','6ZCjMqD','937014ATWydt','{\x22param\x22:\x22value\x22}','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','keyword','查询单条数据','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','执行自定义\x20SQL','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','/api/dataset/get-dataset-list-by-app-code','List\x20BF\x20endpoint\x20functions','{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','datasetCode','where\x20filters\x20before\x20aggregation','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Current\x20app\x20code','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','toLowerCase','创建数据','Returns\x20endpoint\x20functionName/id/description','summary','Get\x20one\x20dataset\x20record','Dataset\x20detail','title','string','find','{\x22id\x22:123}','Filter\x20dataset\x20data','Execute\x20BF\x20endpoint\x20function','str','dataset_detail','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','条件过滤查询数据','Returns\x20one\x20matching\x20business\x20record','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','dataset_data_create','735595FjStpe','tableData\x20contains\x20records','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','code','filter','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.','dataset','appCode','whenToUse','api-doc','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','trim','paging.totalCount\x20gives\x20total\x20rows','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','detail','##\x20Dataset\x20detail','None'];a1_0x6995=function(){return _0x52807f;};return a1_0x6995();}function entrySummary(_0x3f4020){const _0x55cb56=a1_0x18bd4f;return{'code':_0x3f4020[_0x55cb56(0x104)],'category':_0x3f4020[_0x55cb56(0x13d)],'method':_0x3f4020[_0x55cb56(0x131)],'path':_0x3f4020[_0x55cb56(0x132)],'summary':_0x3f4020['summary'],'whenToUse':_0x3f4020['whenToUse']};}export function listApiDocEntries(_0x5beeb2={}){const _0x4f160c=a1_0x18bd4f,_0x2a61b6=String(_0x5beeb2['category']||'')[_0x4f160c(0x10d)](),_0x2ea0c8=String(_0x5beeb2[_0x4f160c(0x14f)]||'')['trim']()['toLowerCase']();return DOCS[_0x4f160c(0x105)](_0x168943=>{const _0xe6ccef=_0x4f160c;if(_0x2a61b6&&_0x168943['category']!==_0x2a61b6)return![];if(!_0x2ea0c8)return!![];return[_0x168943[_0xe6ccef(0x104)],_0x168943[_0xe6ccef(0x13d)],_0x168943['method'],_0x168943[_0xe6ccef(0x132)],_0x168943[_0xe6ccef(0x160)],_0x168943[_0xe6ccef(0x10a)],_0x168943[_0xe6ccef(0x163)]]['join']('\x20')[_0xe6ccef(0x15d)]()['includes'](_0x2ea0c8);})[_0x4f160c(0x119)](entrySummary);}export function getApiDocDetail(_0x459233){const _0x3d8b9a=a1_0x18bd4f,_0xbabdd6=DOCS[_0x3d8b9a(0x165)](_0x370399=>_0x370399['code']===_0x459233);if(!_0xbabdd6)throw CliErrors['validation'](_0x3d8b9a(0x11f)+_0x459233);return{..._0xbabdd6};}const apiDocList={'service':a1_0x18bd4f(0x10b),'command':a1_0x18bd4f(0x118),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':a1_0x18bd4f(0x11d),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x155150){const _0x17ac27=a1_0x18bd4f,_0xc2eae=listApiDocEntries({'category':_0x155150[_0x17ac27(0xfa)](_0x17ac27(0x13d)),'keyword':_0x155150[_0x17ac27(0xfa)](_0x17ac27(0x14f))});return{'ok':!![],'data':{'total':_0xc2eae['length'],'items':_0xc2eae}};}},apiDocDetail={'service':a1_0x18bd4f(0x10b),'command':a1_0x18bd4f(0x110),'description':a1_0x18bd4f(0x136),'risk':a1_0x18bd4f(0x11d),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x49ab03){const _0x4754f0=a1_0x18bd4f;return{'ok':!![],'data':getApiDocDetail(_0x49ab03['str'](_0x4754f0(0x104)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2cc691,_0x5c37da){const _0x2138b8=a2_0x4a15,_0x283f2b=_0x2cc691();while(!![]){try{const _0x4ec949=-parseInt(_0x2138b8(0x97))/0x1+-parseInt(_0x2138b8(0xad))/0x2*(parseInt(_0x2138b8(0x9f))/0x3)+-parseInt(_0x2138b8(0xa2))/0x4*(parseInt(_0x2138b8(0xae))/0x5)+parseInt(_0x2138b8(0xa6))/0x6+parseInt(_0x2138b8(0x98))/0x7*(-parseInt(_0x2138b8(0xa5))/0x8)+parseInt(_0x2138b8(0xa9))/0x9+parseInt(_0x2138b8(0x9e))/0xa*(parseInt(_0x2138b8(0xa3))/0xb);if(_0x4ec949===_0x5c37da)break;else _0x283f2b['push'](_0x283f2b['shift']());}catch(_0x480fc8){_0x283f2b['push'](_0x283f2b['shift']());}}}(a2_0x2fb6,0x56cf6));import{createHash}from'node:crypto';function a2_0x4a15(_0x118307,_0x747788){_0x118307=_0x118307-0x94;const _0x2fb664=a2_0x2fb6();let _0x4a15d4=_0x2fb664[_0x118307];return _0x4a15d4;}import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';export function fingerprintAccessKey(_0x74b57f){const _0x5ae189=a2_0x4a15,_0xdc91a5=_0x74b57f[_0x5ae189(0xaa)](),_0x534c97=_0xdc91a5[_0x5ae189(0x9c)](-0x6)||_0x5ae189(0x94),_0x4312d7=createHash(_0x5ae189(0xa8))[_0x5ae189(0x9d)](_0xdc91a5)[_0x5ae189(0xac)](_0x5ae189(0xa0))[_0x5ae189(0x9c)](0x0,0xc);return _0x5ae189(0x99)+_0x534c97+'_'+_0x4312d7;}export function getAppCacheFilePath(_0x17b1c6,_0x564349){const _0x5a6163=a2_0x4a15;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],'cache',_0x17b1c6,fingerprintAccessKey(_0x564349),_0x5a6163(0x96));}export function readCachedAppList(_0x35704b,_0x5eb9b6){const _0x3ce2a2=a2_0x4a15;if(!_0x5eb9b6?.[_0x3ce2a2(0xaa)]())return null;const _0x3bf04e=getAppCacheFilePath(_0x35704b,_0x5eb9b6);if(!existsSync(_0x3bf04e))return null;try{const _0x1cfa4b=readFileSync(_0x3bf04e,_0x3ce2a2(0x95));if(!_0x1cfa4b[_0x3ce2a2(0xaa)]())return null;const _0x4790fa=JSON['parse'](_0x1cfa4b);if(!Array['isArray'](_0x4790fa[_0x3ce2a2(0xa1)]))return null;return _0x4790fa;}catch{return null;}}export function writeCachedAppList(_0xc90c9d,_0x5db8ae,_0x39161d){const _0x516615=a2_0x4a15,_0x46f001=getAppCacheFilePath(_0xc90c9d,_0x5db8ae),_0x1a0caf=dirname(_0x46f001);!existsSync(_0x1a0caf)&&mkdirSync(_0x1a0caf,{'recursive':!![]});const _0x377070=_0x46f001+_0x516615(0x9a);try{writeFileSync(_0x377070,JSON[_0x516615(0x9b)](_0x39161d,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x377070,_0x46f001);}catch(_0x117da2){if(_0x117da2['code']===_0x516615(0xaf)||_0x117da2['code']==='EXDEV'||_0x117da2[_0x516615(0xa4)]==='EACCES'){writeFileSync(_0x46f001,JSON[_0x516615(0x9b)](_0x39161d,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x377070);}catch{}}else throw _0x117da2;}}catch(_0x4c1485){try{unlinkSync(_0x377070);}catch{}throw _0x4c1485;}return _0x46f001;}function a2_0x2fb6(){const _0x5aa413=['code','16OlgtqC','760338LxobTa','find','sha256','2610666WyGfBS','trim','appCode','digest','235590efhQmY','15CUoXGV','EPERM','unknown','utf8','my-apps.json','241945cJsOCv','1350727LQFvco','ak_','.tmp','stringify','slice','update','17076610YMOajm','15bcFvPm','hex','items','736056MhrQDx','11LzPfKv'];a2_0x2fb6=function(){return _0x5aa413;};return a2_0x2fb6();}export function resolveCachedAppCode(_0x256aa7,_0x2a48c0,_0x58a06f){const _0x2728fc=a2_0x4a15;if(!_0x256aa7)return undefined;const _0x249745=readCachedAppList(_0x2a48c0,_0x58a06f),_0xe426b1=_0x249745?.[_0x2728fc(0xa1)][_0x2728fc(0xa7)](_0x354463=>_0x354463['appName']===_0x256aa7);return _0xe426b1?.[_0x2728fc(0xab)]?.[_0x2728fc(0xaa)]()||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
|
+
const a3_0x155699=a3_0x2414;(function(_0x57fb70,_0x418e98){const _0x32d465=a3_0x2414,_0x12153c=_0x57fb70();while(!![]){try{const _0x319559=parseInt(_0x32d465(0xe2))/0x1+parseInt(_0x32d465(0xf4))/0x2*(-parseInt(_0x32d465(0xb3))/0x3)+parseInt(_0x32d465(0xf3))/0x4*(parseInt(_0x32d465(0xac))/0x5)+-parseInt(_0x32d465(0xc2))/0x6+-parseInt(_0x32d465(0xd1))/0x7+parseInt(_0x32d465(0xbd))/0x8*(parseInt(_0x32d465(0xd6))/0x9)+parseInt(_0x32d465(0xd0))/0xa;if(_0x319559===_0x418e98)break;else _0x12153c['push'](_0x12153c['shift']());}catch(_0x1e935e){_0x12153c['push'](_0x12153c['shift']());}}}(a3_0x3fb7,0xf0dae));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_0x3fb7(){const _0x2a4a68=['1022886yBwVdP','accessKey','filter','Set\x20the\x20fallback\x20app\x20candidate','Missing\x20app\x20name.','app','Remote\x20app\x20name\x20to\x20activate','init','nonInteractive','../../commands/app/remote-source.js','\x20config\x20file','items','1003090wXduWj','appName','envName','\x22\x20not\x20found.','args','Default\x20app\x20candidate\x20set\x20to\x20\x22','string','../../commands/app/cache.js','entries','Filter\x20by\x20environment\x20(default:\x20current\x20env)','Use\x20global\x20config\x20scope','\x20cached\x20app(s)\x20for\x20env=\x22','from','globalPath','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','global','.appcode\x20to\x20.lovrabet.json.','192876rwZapU','12942kDsIlN','find','length','../../context.js','i18nInfo','Available\x20remote\x20apps:\x20','str','App\x20\x22','langs','validation','pull','175fFjErg','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','import','cache','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','defaultApp','fetchedAt','597kuZRbr','mergedCli','Refreshed\x20app\x20cache\x20with\x20','Usage:\x20','\x20app(s)\x20for\x20env=\x22','write','\x20app\x20use\x20<name>\x20[--global]','Use\x20`','join','trim','136ZMbkUt','remote','env','appCode','appcode','7595976SmlePS','source','bool','Read\x20from\x20local\x20cache\x20only','projectPath','cachePath','config','enableI18n','map','local','appPublishStatus','read','name','no-cache','5515380xDuNaG','11439008kpcfNH','isArray','No\x20cached\x20apps\x20found.','boolean','type'];a3_0x3fb7=function(){return _0x2a4a68;};return a3_0x3fb7();}import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';function a3_0x2414(_0x559332,_0x4e30bf){_0x559332=_0x559332-0xab;const _0x3fb7a2=a3_0x3fb7();let _0x2414b1=_0x3fb7a2[_0x559332];return _0x2414b1;}const GLOBAL_FLAG={'name':a3_0x155699(0xf1),'type':a3_0x155699(0xd4),'description':a3_0x155699(0xec),'default':![]};function collectFlags(_0x225ee1,_0x459a29){const _0x453adb=a3_0x155699,_0x267ac5={};for(const _0xf60c0b of _0x459a29){const _0x1435c0=_0xf60c0b[_0x453adb(0xd5)]===_0x453adb(0xd4)?_0x225ee1[_0x453adb(0xc4)](_0xf60c0b[_0x453adb(0xce)]):_0x225ee1[_0x453adb(0xfa)](_0xf60c0b['name']);if(_0x1435c0!==''&&_0x1435c0!==![])_0x267ac5[_0xf60c0b[_0x453adb(0xce)]]=_0x1435c0;}if(_0x225ee1['nonInteractive'])_0x267ac5[_0x453adb(0xde)]=!![];return _0x267ac5;}function normalizeLanguages(_0x267344){const _0x1f857f=a3_0x155699;if(!Array[_0x1f857f(0xd2)](_0x267344))return[];return _0x267344[_0x1f857f(0xd8)](_0x58f5da=>typeof _0x58f5da==='string')['map'](_0x583571=>_0x583571[_0x1f857f(0xbc)]())[_0x1f857f(0xd8)](Boolean);}function buildRemoteAppI18nFields(_0x14145c){const _0x1c1f45=a3_0x155699,_0x5e3f32=normalizeLanguages(_0x14145c[_0x1c1f45(0xf8)]?.[_0x1c1f45(0xfc)]);return{'enableI18n':typeof _0x14145c['enableI18n']===_0x1c1f45(0xd4)?_0x14145c[_0x1c1f45(0xc9)]:null,'languages':_0x5e3f32,'i18nInfo':_0x14145c['i18nInfo']?{..._0x14145c[_0x1c1f45(0xf8)],'langs':_0x5e3f32[_0x1c1f45(0xf6)]?_0x5e3f32:null}:null};}const initDef={'service':a3_0x155699(0xdb),'command':a3_0x155699(0xdd),'description':'Initialize\x20'+PRODUCT_CONFIG['newConfigFileName']+a3_0x155699(0xe0),'risk':a3_0x155699(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x3456e3){return await runInit(collectFlags(_0x3456e3,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x155699(0xdb),'command':'list','description':a3_0x155699(0xad),'risk':a3_0x155699(0xcd),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x155699(0xbf),'type':a3_0x155699(0xe8),'description':a3_0x155699(0xeb),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x155699(0xcb),'type':a3_0x155699(0xd4),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x155699(0xcf),'type':a3_0x155699(0xd4),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0xad0316){const _0xe7ff76=a3_0x155699,_0x20014f=_0xad0316['str'](_0xe7ff76(0xbf))||_0xad0316['envName']||getEnv()||'production',_0x349870=_0xad0316[_0xe7ff76(0xc4)](_0xe7ff76(0xcb)),_0x2d37ac=_0xad0316[_0xe7ff76(0xc4)]('no-cache'),{readRawConfigWithLayers:_0x29915b,resolveDefaultAppSource:_0x3624a6,getLocalAppAliases:_0x1cac04}=await import('../../context.js'),{getRemoteAppList:_0x51b7aa}=await import(_0xe7ff76(0xdf)),{config:_0x303e7e,layers:_0x4b079f}=_0x29915b(),_0x39093c=_0x3624a6(_0x4b079f),{defaultApp:_0x420b71}=_0x303e7e,_0x2c83cd=await _0x51b7aa({'env':_0x20014f,'accessKey':_0xad0316[_0xe7ff76(0xd7)],'localOnly':_0x349870,'noCache':_0x2d37ac}),_0x21e8f9=_0x2c83cd['items'][_0xe7ff76(0xca)](_0x39a032=>{const _0x592d52=_0xe7ff76;return{'name':_0x39a032[_0x592d52(0xe3)],'appcode':_0x39a032[_0x592d52(0xc0)],'named':!![],'definedIn':_0x592d52(0xbe),'isDefault':_0x39a032[_0x592d52(0xe3)]===_0x420b71,...buildAppProfileListFields(_0x20014f),...buildRemoteAppI18nFields(_0x39a032),'source':_0x2c83cd['source'],'owner':_0x39a032['appOwnerName']??null,'status':_0x39a032[_0x592d52(0xcc)]??null,'cachedAt':_0x2c83cd['fetchedAt']};}),_0x5d68e6=_0x1cac04(_0x303e7e);let _0x51adb5=0x0;for(const [_0x346e71,_0x378998]of Object[_0xe7ff76(0xea)](_0x5d68e6)){const _0x6ca210=typeof _0x378998['appcode']===_0xe7ff76(0xe8)?_0x378998[_0xe7ff76(0xc1)][_0xe7ff76(0xbc)]():'';if(!_0x6ca210)continue;_0x51adb5+=0x1,_0x21e8f9['push']({'name':_0x346e71,'appcode':_0x6ca210,'named':!![],'definedIn':_0xe7ff76(0xcb),'isDefault':_0x346e71===_0x420b71,...buildAppProfileListFields(_0x20014f),'source':_0xe7ff76(0xc8),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x21e8f9,_0xad0316[_0xe7ff76(0xb4)]);if(_0x21e8f9[_0xe7ff76(0xf6)]===0x0)return{'ok':!![],'data':[],'message':_0x2c83cd[_0xe7ff76(0xc3)]===_0xe7ff76(0xaf)?_0xe7ff76(0xd3):'No\x20apps\x20found\x20on\x20the\x20platform.'};const _0x68ef80=_0x21e8f9[_0xe7ff76(0xf5)](_0x20c490=>_0x20c490['isCurrent']===!![]),_0x325aad=_0x420b71??_0x68ef80?.[_0xe7ff76(0xce)]??null,_0x3a1500={'env':_0x20014f,'source':_0x2c83cd[_0xe7ff76(0xc3)],'fetchedAt':_0x2c83cd[_0xe7ff76(0xb2)],'cachePath':_0x2c83cd['cachePath'],'globalPath':_0x4b079f[_0xe7ff76(0xef)]??null,'projectPath':_0x4b079f[_0xe7ff76(0xc6)]??null,'defaultApp':_0x325aad,'defaultAppSource':_0x420b71!=null?_0x39093c:null,'localAliasCount':_0x51adb5};return{'ok':!![],'data':{'items':_0x21e8f9,'meta':_0x3a1500}};}},pullDef={'service':'app','command':a3_0x155699(0xab),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x155699(0xb8),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x155699(0xbf),'type':a3_0x155699(0xe8),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x155699(0xcb),'type':a3_0x155699(0xd4),'description':a3_0x155699(0xc5),'default':![]},{'name':a3_0x155699(0xcf),'type':'boolean','description':a3_0x155699(0xb0),'default':![]}],async 'execute'(_0x18083f){const _0x4d4729=a3_0x155699,_0x2db484=_0x18083f[_0x4d4729(0xfa)](_0x4d4729(0xbf))||_0x18083f[_0x4d4729(0xe4)]||getEnv()||'production',_0x3d1170=_0x18083f[_0x4d4729(0xc4)](_0x4d4729(0xcb)),_0x22fbe3=_0x18083f[_0x4d4729(0xc4)](_0x4d4729(0xcf)),{getRemoteAppList:_0x3b4e2a}=await import(_0x4d4729(0xdf)),_0x2f7d81=await _0x3b4e2a({'env':_0x2db484,'accessKey':_0x18083f[_0x4d4729(0xd7)],'localOnly':_0x3d1170,'noCache':_0x22fbe3});return{'ok':!![],'data':{'total':_0x2f7d81[_0x4d4729(0xe1)][_0x4d4729(0xf6)],'env':_0x2db484,'source':_0x2f7d81[_0x4d4729(0xc3)],'fetchedAt':_0x2f7d81['fetchedAt'],'cachePath':_0x2f7d81[_0x4d4729(0xc7)]},'message':_0x2f7d81['source']===_0x4d4729(0xaf)?'Loaded\x20'+_0x2f7d81['items'][_0x4d4729(0xf6)]+_0x4d4729(0xed)+_0x2db484+'\x22.':_0x4d4729(0xb5)+_0x2f7d81[_0x4d4729(0xe1)][_0x4d4729(0xf6)]+_0x4d4729(0xb7)+_0x2db484+'\x22.'};}},useDef={'service':a3_0x155699(0xdb),'command':'use','description':a3_0x155699(0xd9),'risk':a3_0x155699(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x155699(0xce),'description':a3_0x155699(0xdc),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x56af4f){const _0xb0acc8=a3_0x155699;if(!_0x56af4f[_0xb0acc8(0xe6)][0x0])throw CliErrors[_0xb0acc8(0xfd)](_0xb0acc8(0xda),_0xb0acc8(0xb6)+CLI_BIN_NAME+_0xb0acc8(0xb9));},async 'execute'(_0x55c5ba){const _0x517ee6=a3_0x155699,_0x24b4c3=_0x55c5ba['args'][0x0];if(!_0x24b4c3)throw CliErrors[_0x517ee6(0xfd)](_0x517ee6(0xda),_0x517ee6(0xb6)+CLI_BIN_NAME+_0x517ee6(0xb9));const {buildConfigFromFlags:_0x2b4c2c,resolveLocalAppAliasCode:_0x240c42}=await import(_0x517ee6(0xf7)),{readCachedAppList:_0x53ca09}=await import(_0x517ee6(0xe9)),_0x1b8ef5=_0x55c5ba['str'](_0x517ee6(0xbf)),_0x3f3774=_0x2b4c2c(_0x1b8ef5?{'env':_0x1b8ef5}:{}),_0x106faa=_0x53ca09(_0x3f3774[_0x517ee6(0xbf)],_0x3f3774['accessKey']),_0x1cd834=_0x106faa?.[_0x517ee6(0xe1)]['find'](_0x59e27a=>_0x59e27a[_0x517ee6(0xe3)]===_0x24b4c3),_0x40f9ea=_0x240c42(_0x3f3774['raw']??{},_0x24b4c3);if(!_0x1cd834&&!_0x40f9ea&&_0x3f3774[_0x517ee6(0xb1)]!==_0x24b4c3){const _0x802015=[..._0x106faa?.[_0x517ee6(0xe1)][_0x517ee6(0xca)](_0x583b1a=>_0x583b1a['appName'])??[]],_0x4145e3=_0x802015[_0x517ee6(0xf6)]===0x0?_0x517ee6(0xba)+CLI_BIN_NAME+'\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.'+_0x24b4c3+_0x517ee6(0xf2):_0x517ee6(0xf9)+Array[_0x517ee6(0xee)](new Set(_0x802015))[_0x517ee6(0xbb)](',\x20')+'.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.';throw CliErrors[_0x517ee6(0xfd)](_0x517ee6(0xfb)+_0x24b4c3+_0x517ee6(0xe5),_0x4145e3);}const _0x46570c=_0x55c5ba['bool'](_0x517ee6(0xf1));let _0x4dcb2d;if(_0x46570c)_0x4dcb2d={'global':!![]};else{const {isInProject:_0x8a72ef}=await import(_0x517ee6(0xf7)),_0x2418df=_0x8a72ef();_0x4dcb2d=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':'project-default','inProject':_0x2418df}));}const _0x479d89=readConfig(_0x4dcb2d);return _0x479d89[_0x517ee6(0xb1)]=_0x24b4c3,writeConfig(_0x479d89,_0x4dcb2d),{'ok':!![],'message':_0x517ee6(0xe7)+_0x24b4c3+'\x22'+scopeLabel(_0x4dcb2d)+'.'};}},importDef={'service':a3_0x155699(0xdb),'command':a3_0x155699(0xae),'description':a3_0x155699(0xf0),'risk':a3_0x155699(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x584796){return await runInitImport(collectFlags(_0x584796,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ec056,_0x328f4d){const _0xaa40aa=a4_0x14a0,_0x69e239=_0x1ec056();while(!![]){try{const _0x92f787=parseInt(_0xaa40aa(0x1fd))/0x1+parseInt(_0xaa40aa(0x1f7))/0x2+parseInt(_0xaa40aa(0x1f8))/0x3+-parseInt(_0xaa40aa(0x1f3))/0x4*(-parseInt(_0xaa40aa(0x1f9))/0x5)+parseInt(_0xaa40aa(0x1fe))/0x6*(parseInt(_0xaa40aa(0x201))/0x7)+-parseInt(_0xaa40aa(0x1f5))/0x8*(parseInt(_0xaa40aa(0x1f6))/0x9)+-parseInt(_0xaa40aa(0x202))/0xa*(parseInt(_0xaa40aa(0x1fb))/0xb);if(_0x92f787===_0x328f4d)break;else _0x69e239['push'](_0x69e239['shift']());}catch(_0x346751){_0x69e239['push'](_0x69e239['shift']());}}}(a4_0x3bda,0xaa085));import{fileURLToPath}from'url';import{dirname,join}from'path';function a4_0x14a0(_0x3a5b4c,_0x3c9ebe){_0x3a5b4c=_0x3a5b4c-0x1f3;const _0x3bda33=a4_0x3bda();let _0x14a040=_0x3bda33[_0x3a5b4c];return _0x14a040;}import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x25523f=a4_0x14a0,_0x3ca6b1=join(__dirname,_0x25523f(0x1f4)),_0x1c235f=readFileSync(_0x3ca6b1,'utf-8');return JSON[_0x25523f(0x1fc)](_0x1c235f);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}function a4_0x3bda(){const _0x3a45f5=['2123622AxTMeq','errorCode','tableData','21FiYIga','863340jRUqji','100NDOyRm','../../../mock/app-list.json','104pJXLjB','763938xdrwEf','2096962sOccat','251271mbFehN','94865hUsKXH','success','242MnPwso','parse','1030893qctjvX'];a4_0x3bda=function(){return _0x3a45f5;};return a4_0x3bda();}export function getMockRemoteAppItems(){const _0x2ceb65=a4_0x14a0,_0xff3748=getMockAppList();if(!_0xff3748[_0x2ceb65(0x1fa)])throw new Error('Mock\x20API\x20error:\x20'+_0xff3748['errorMsg']+'\x20('+_0xff3748[_0x2ceb65(0x1ff)]+')');return _0xff3748['data'][_0x2ceb65(0x200)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8ede96,_0x32c913){const _0x258c87=a5_0x6bb0,_0x98411b=_0x8ede96();while(!![]){try{const _0x44c8c1=parseInt(_0x258c87(0x108))/0x1+parseInt(_0x258c87(0x10f))/0x2+-parseInt(_0x258c87(0x107))/0x3+-parseInt(_0x258c87(0x109))/0x4+parseInt(_0x258c87(0x111))/0x5+-parseInt(_0x258c87(0x10e))/0x6*(parseInt(_0x258c87(0x115))/0x7)+parseInt(_0x258c87(0x114))/0x8*(-parseInt(_0x258c87(0x110))/0x9);if(_0x44c8c1===_0x32c913)break;else _0x98411b['push'](_0x98411b['shift']());}catch(_0x1e3b8f){_0x98411b['push'](_0x98411b['shift']());}}}(a5_0x2745,0x85c3e));function a5_0x2745(){const _0x5c63a2=['2599115qsaRBd','cache','items','8exOHXK','203Uvqxcw','603138VeJaAf','673457kQYKyY','2630004bZfYof','fetchedAt','trim','toLowerCase','mock','87288YHHvWZ','1713730FugmET','1996236MlnOhU'];a5_0x2745=function(){return _0x5c63a2;};return a5_0x2745();}import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';function a5_0x6bb0(_0x375157,_0x4d41fd){_0x375157=_0x375157-0x107;const _0x27457a=a5_0x2745();let _0x6bb035=_0x27457a[_0x375157];return _0x6bb035;}import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x22dc18=a5_0x6bb0,_0x14760b=(productEnv('APP_LIST_SOURCE')||'')[_0x22dc18(0x10b)]()[_0x22dc18(0x10c)]();return _0x14760b==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x30f891){const _0x2761ed=a5_0x6bb0,{env:_0x264b03,accessKey:_0x4c63d0,localOnly:localOnly=![],noCache:noCache=![]}=_0x30f891,_0x3a3f69=readCachedAppList(_0x264b03,_0x4c63d0),_0x151e5f=_0x4c63d0?.[_0x2761ed(0x10b)]()?getAppCacheFilePath(_0x264b03,_0x4c63d0):null;if(localOnly)return{'items':_0x3a3f69?.[_0x2761ed(0x113)]??[],'source':'cache','fetchedAt':_0x3a3f69?.[_0x2761ed(0x10a)]??null,'cachePath':_0x151e5f};try{const _0xf120ea=await getRemoteAppItems(),_0x2ea4ee=shouldUseMockRemoteApps()?_0x2761ed(0x10d):'remote',_0x434ec8=new Date()['toISOString'](),_0x153bc1=_0x4c63d0?.['trim']()?writeCachedAppList(_0x264b03,_0x4c63d0,{'env':_0x264b03,'fetchedAt':_0x434ec8,'source':_0x2ea4ee,'items':_0xf120ea}):null;return{'items':_0xf120ea,'source':_0x2ea4ee,'fetchedAt':_0x434ec8,'cachePath':_0x153bc1};}catch(_0x576b20){if(!noCache&&_0x3a3f69)return{'items':_0x3a3f69[_0x2761ed(0x113)],'source':_0x2761ed(0x112),'fetchedAt':_0x3a3f69[_0x2761ed(0x10a)],'cachePath':_0x151e5f};throw _0x576b20;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x25c3a8,_0x383867){const _0x5b3114=a6_0x2ccd,_0x54a3d2=_0x25c3a8();while(!![]){try{const _0x3be661=-parseInt(_0x5b3114(0xb1))/0x1*(parseInt(_0x5b3114(0xaf))/0x2)+-parseInt(_0x5b3114(0xab))/0x3+parseInt(_0x5b3114(0xb6))/0x4+parseInt(_0x5b3114(0xad))/0x5+parseInt(_0x5b3114(0xac))/0x6*(-parseInt(_0x5b3114(0xb3))/0x7)+-parseInt(_0x5b3114(0xba))/0x8*(-parseInt(_0x5b3114(0xa7))/0x9)+parseInt(_0x5b3114(0xb2))/0xa*(parseInt(_0x5b3114(0xb9))/0xb);if(_0x3be661===_0x383867)break;else _0x54a3d2['push'](_0x54a3d2['shift']());}catch(_0x5db14d){_0x54a3d2['push'](_0x54a3d2['shift']());}}}(a6_0x4431,0x49c95));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';function a6_0x2ccd(_0x19b59d,_0x3e4be6){_0x19b59d=_0x19b59d-0xa4;const _0x443140=a6_0x4431();let _0x2ccd42=_0x443140[_0x19b59d];return _0x2ccd42;}function a6_0x4431(){const _0x3da7d0=['appCode','project','2751156ZHXELZ','defaultApp','name','trim','1324860fvyqrO','2924472VGsMWb','2476695mteODu','local','461346gqwSns','isCurrent','1RsGFxU','235370tvBOJe','7FPclFn','named','find','1608016NytNtD','appcode','global','121IoMYXL','8CGFSak','definedIn'];a6_0x4431=function(){return _0x3da7d0;};return a6_0x4431();}export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x45c9ab,_0x187c71){const _0x573ea9=a6_0x2ccd;if(!_0x187c71)return;const _0x4dd5c8=!!(_0x187c71['currentApp']??_0x187c71['defaultApp']);for(const _0x5628b0 of _0x45c9ab){_0x5628b0['isCurrent']=![];}const _0x46d73b=_0x187c71[_0x573ea9(0xa5)]!=null?String(_0x187c71[_0x573ea9(0xa5)])[_0x573ea9(0xaa)]():'';if(_0x4dd5c8){const _0x41a2e2=_0x187c71['currentApp']??_0x187c71[_0x573ea9(0xa8)];if(_0x41a2e2){const _0x469783=_0x45c9ab[_0x573ea9(0xb5)](_0x12c507=>_0x12c507['named']===!![]&&_0x12c507['name']===_0x41a2e2&&_0x12c507[_0x573ea9(0xa4)]===_0x573ea9(0xae)),_0x4da7cd=_0x469783??_0x45c9ab['find'](_0x35fa9e=>_0x35fa9e[_0x573ea9(0xb4)]===!![]&&_0x35fa9e[_0x573ea9(0xa9)]===_0x41a2e2);_0x4da7cd&&(_0x4da7cd[_0x573ea9(0xb0)]=!![]);}return;}if(!_0x46d73b)return;for(const _0x231908 of _0x45c9ab){String(_0x231908[_0x573ea9(0xb7)]??'')[_0x573ea9(0xaa)]()===_0x46d73b&&(_0x231908[_0x573ea9(0xb0)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x5c5eed){const _0x306105=a6_0x2ccd;return formatScopeLabel(_0x5c5eed['global']?_0x306105(0xb8):_0x306105(0xa6));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a7_0x45eb81=a7_0x55be;(function(_0x31ec7b,_0xf58877){const _0xd73597=a7_0x55be,_0x2ae105=_0x31ec7b();while(!![]){try{const _0x7bdfbb=-parseInt(_0xd73597(0x7a))/0x1*(-parseInt(_0xd73597(0x87))/0x2)+-parseInt(_0xd73597(0x9c))/0x3+parseInt(_0xd73597(0x6f))/0x4*(parseInt(_0xd73597(0x86))/0x5)+parseInt(_0xd73597(0x78))/0x6*(-parseInt(_0xd73597(0x76))/0x7)+-parseInt(_0xd73597(0xb0))/0x8*(-parseInt(_0xd73597(0x83))/0x9)+parseInt(_0xd73597(0x97))/0xa*(-parseInt(_0xd73597(0x93))/0xb)+-parseInt(_0xd73597(0xae))/0xc*(-parseInt(_0xd73597(0x8b))/0xd);if(_0x7bdfbb===_0xf58877)break;else _0x2ae105['push'](_0x2ae105['shift']());}catch(_0x5e3dc2){_0x2ae105['push'](_0x2ae105['shift']());}}}(a7_0x5de9,0xcae85));import{existsSync,readFileSync,statSync}from'node:fs';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_0x45eb81(0x95),ARTIFACT_SOURCE_AGENT=a7_0x45eb81(0xa2),ALLOWED_REACT_MODULE_IMPORTS=[a7_0x45eb81(0x7f),'react-dom',a7_0x45eb81(0xb2),a7_0x45eb81(0xa8),'antd',a7_0x45eb81(0x89)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a7_0x45eb81(0x82)](',\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':'file','type':a7_0x45eb81(0x81),'required':!![],'description':a7_0x45eb81(0xb5)},ARTIFACT_NAME_FLAG={'name':'name','type':'string','description':a7_0x45eb81(0x71)},METADATA_FLAG={'name':a7_0x45eb81(0xa9),'type':a7_0x45eb81(0x81),'description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x459ffb){const _0x286e03=a7_0x45eb81;return typeof _0x459ffb===_0x286e03(0xa4)&&_0x459ffb!==null&&!Array[_0x286e03(0x8f)](_0x459ffb);}function readSourceFile(_0x1e45bc){const _0x397ac6=a7_0x45eb81;if(!_0x1e45bc)throw CliErrors[_0x397ac6(0x96)](_0x397ac6(0xab));if(!existsSync(_0x1e45bc))throw CliErrors[_0x397ac6(0x96)](_0x397ac6(0x8e)+_0x1e45bc);if(!statSync(_0x1e45bc)[_0x397ac6(0xba)]())throw CliErrors[_0x397ac6(0x96)](_0x397ac6(0xa3)+_0x1e45bc);const _0x1491b7=readFileSync(_0x1e45bc,'utf8');return validateReactModuleSource(_0x1491b7),_0x1491b7;}function parseMetadata(_0x1039f2){const _0x1c08d4=a7_0x45eb81;if(!_0x1039f2)return undefined;let _0x3ede4f;try{_0x3ede4f=JSON[_0x1c08d4(0x9b)](_0x1039f2);}catch{throw CliErrors[_0x1c08d4(0x96)](_0x1c08d4(0xad)+_0x1039f2);}if(!isPlainObject(_0x3ede4f))throw CliErrors[_0x1c08d4(0x96)](_0x1c08d4(0xaa));const _0x3ec15f={..._0x3ede4f};return delete _0x3ec15f[_0x1c08d4(0xb6)],_0x3ec15f;}function getPackageName(_0x218e86){const _0x571510=a7_0x45eb81;if(_0x218e86[_0x571510(0x6e)]('@')){const [_0x234316,_0x5ec064]=_0x218e86[_0x571510(0xb9)]('/');return _0x234316&&_0x5ec064?_0x234316+'/'+_0x5ec064:_0x218e86;}return _0x218e86[_0x571510(0xb9)]('/')[0x0]||_0x218e86;}function a7_0x55be(_0xc0157a,_0x53f0a2){_0xc0157a=_0xc0157a-0x69;const _0x5de9cd=a7_0x5de9();let _0x55be3e=_0x5de9cd[_0xc0157a];return _0x55be3e;}function validateAllowedImports(_0x176aee){const _0x750dce=a7_0x45eb81,_0x325b23=new Set();for(const _0x3ef958 of IMPORT_SOURCE_PATTERNS){_0x3ef958[_0x750dce(0xa1)]=0x0;let _0x43ca51;while((_0x43ca51=_0x3ef958[_0x750dce(0x69)](_0x176aee))!==null){const _0x5419d8=_0x43ca51[0x1]?.['trim']();_0x5419d8&&_0x325b23[_0x750dce(0x7c)](_0x5419d8);}}const _0x1ba474=[..._0x325b23][_0x750dce(0x8a)](getPackageName)[_0x750dce(0x84)](_0x303f3d=>!ALLOWED_REACT_MODULE_IMPORTS[_0x750dce(0xa7)](_0x303f3d));if(_0x1ba474[_0x750dce(0x75)]>0x0)throw CliErrors[_0x750dce(0x96)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x750dce(0x9f)+[...new Set(_0x1ba474)]['join'](',\x20'));}export function validateReactModuleSource(_0x4dba14){const _0x1cd043=a7_0x45eb81;if(!_0x4dba14[_0x1cd043(0x72)]())throw CliErrors['validation']('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS[_0x1cd043(0x7d)](_0x51ef41=>_0x51ef41['test'](_0x4dba14)))throw CliErrors[_0x1cd043(0x96)](_0x1cd043(0xb3));validateAllowedImports(_0x4dba14);}function buildArtifactInput(_0x31cb68){const _0x1e429b=a7_0x45eb81,_0xc7ead7=readSourceFile(_0x31cb68['str']('file')),_0x23a05b=_0x31cb68[_0x1e429b(0x90)](_0x1e429b(0x92))[_0x1e429b(0x72)](),_0xf22a30=parseMetadata(_0x31cb68['str'](_0x1e429b(0xa9)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x23a05b?{'name':_0x23a05b}:{},'content':_0xc7ead7,..._0xf22a30?{'metadata':_0xf22a30}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0xbd28f7){const _0x7e6173=a7_0x45eb81;return{'id':_0xbd28f7['id'],'name':_0xbd28f7[_0x7e6173(0x92)],'artifactType':_0xbd28f7[_0x7e6173(0x85)],'source':_0xbd28f7[_0x7e6173(0x70)],'favorite':_0xbd28f7[_0x7e6173(0x9e)],'deleted':_0xbd28f7[_0x7e6173(0x9d)],'createTime':_0xbd28f7[_0x7e6173(0xa6)],'updateTime':_0xbd28f7[_0x7e6173(0x6a)]};}function detailArtifact(_0x148a96){const _0x438aeb=a7_0x45eb81;return{'id':_0x148a96['id'],'appCode':_0x148a96[_0x438aeb(0xb1)],'name':_0x148a96[_0x438aeb(0x92)],'artifactType':_0x148a96['artifactType'],'source':_0x148a96['source'],'favorite':_0x148a96[_0x438aeb(0x9e)],'deleted':_0x148a96[_0x438aeb(0x9d)],'content':_0x148a96[_0x438aeb(0x79)]??'','compiledContent':_0x148a96[_0x438aeb(0xb6)],'metadata':_0x148a96[_0x438aeb(0xa9)]??{},'createTime':_0x148a96[_0x438aeb(0xa6)],'updateTime':_0x148a96['updateTime']};}function readFavoriteFlag(_0x1b9734){const _0x164ae6=a7_0x45eb81,_0x1160db=_0x1b9734[_0x164ae6(0x6b)]('favorite');return _0x1160db===undefined||_0x1160db===null||_0x1160db===''?undefined:_0x1b9734['bool'](_0x164ae6(0x9e));}const artifactList={'service':a7_0x45eb81(0x99),'command':'list','description':'List\x20current-app\x20react_module\x20Artifacts','risk':a7_0x45eb81(0x7b),'flags':[{'name':a7_0x45eb81(0x70),'type':a7_0x45eb81(0x81),'description':a7_0x45eb81(0x94)},{'name':a7_0x45eb81(0x9e),'type':'boolean','description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x36b2b7){const _0x1f802a=a7_0x45eb81,_0x2398d5=await listRuntimeArtifacts(_0x36b2b7['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x36b2b7[_0x1f802a(0x90)](_0x1f802a(0x70))?{'source':_0x36b2b7[_0x1f802a(0x90)](_0x1f802a(0x70))}:{},...readFavoriteFlag(_0x36b2b7)!==undefined?{'favorite':readFavoriteFlag(_0x36b2b7)}:{}});return{'ok':!![],'data':{'total':_0x2398d5['length'],'items':_0x36b2b7[_0x1f802a(0xaf)](_0x1f802a(0x6c))?_0x2398d5:_0x2398d5[_0x1f802a(0x8a)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a7_0x45eb81(0x98),'description':a7_0x45eb81(0x9a),'risk':'read','flags':[{...ID_FLAG,'description':a7_0x45eb81(0x91)}],async 'execute'(_0xaa0cdc){const _0x11e539=a7_0x45eb81,_0x20c7ec=await getRuntimeArtifact(_0xaa0cdc[_0x11e539(0xa0)]('id'),_0xaa0cdc[_0x11e539(0xb1)]);return{'ok':!![],'data':detailArtifact(_0x20c7ec)};}},artifactCreate={'service':a7_0x45eb81(0x99),'command':a7_0x45eb81(0x74),'description':a7_0x45eb81(0x8c),'risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3abf66){const _0xaaa4f0=a7_0x45eb81,_0x547840=buildArtifactInput(_0x3abf66),_0x315333=await createRuntimeArtifact(_0x3abf66['appCode'],_0x547840);return{'ok':!![],'data':detailArtifact(_0x315333),'message':_0xaaa4f0(0xac)+_0x315333['id']+(_0x315333['name']?'\x20('+_0x315333['name']+')':'')};},async 'dryRun'(_0x3c4e93){const _0x3487f1=a7_0x45eb81,_0x368139=buildArtifactInput(_0x3c4e93);return dryRun('POST',_0x3487f1(0xb7))[_0x3487f1(0x8d)]({'appCode':_0x3c4e93[_0x3487f1(0xb1)],..._0x368139})['description'](_0x3487f1(0x80))[_0x3487f1(0x7e)]();}},artifactUpdate={'service':a7_0x45eb81(0x99),'command':a7_0x45eb81(0x73),'description':a7_0x45eb81(0xb8),'risk':'write','flags':[{...ID_FLAG,'description':a7_0x45eb81(0x91)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5cf328){const _0x1bab66=a7_0x45eb81,_0x4d73ea=_0x5cf328['num']('id'),_0x40a0ba=buildArtifactInput(_0x5cf328),_0x52d3bb=await updateRuntimeArtifact(_0x4d73ea,_0x5cf328['appCode'],_0x40a0ba);return{'ok':!![],'data':detailArtifact(_0x52d3bb),'message':_0x1bab66(0x77)+_0x52d3bb['id']+(_0x52d3bb[_0x1bab66(0x92)]?'\x20('+_0x52d3bb[_0x1bab66(0x92)]+')':'')};},async 'dryRun'(_0x46f326){const _0x3defc1=a7_0x45eb81,_0x431120=_0x46f326['num']('id'),_0x5bb9f5=buildArtifactInput(_0x46f326);return dryRun(_0x3defc1(0xa5),_0x3defc1(0xb4)+_0x431120+_0x3defc1(0x6d))[_0x3defc1(0x8d)]({'appCode':_0x46f326[_0x3defc1(0xb1)],..._0x5bb9f5})[_0x3defc1(0x88)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x431120)[_0x3defc1(0x7e)]();}};function a7_0x5de9(){const _0x448009=['map','9789dhrbYp','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','body','File\x20not\x20found:\x20','isArray','str','Artifact\x20ID','name','33GNHScg','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','react_module','validation','4854410Zpsswc','detail','artifact','Show\x20one\x20Artifact\x20by\x20id','parse','4968141cHnYkL','deleted','favorite','.\x20Unsupported:\x20','num','lastIndex','AGENT','File\x20is\x20not\x20a\x20regular\x20file:\x20','object','POST','createTime','includes','dayjs','metadata','--metadata\x20must\x20be\x20a\x20JSON\x20object.','File\x20path\x20is\x20required.','Created\x20Artifact\x20','Invalid\x20JSON\x20for\x20--metadata:\x20','61260gYjXlK','bool','312JztbLR','appCode','lodash','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','/client/artifact/','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','compiledContent','/client/artifact/create','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','split','isFile','exec','updateTime','flag','verbose','/update','startsWith','4025020InKkCa','source','Artifact\x20display\x20name','trim','update','create','length','14651Phvxrf','Updated\x20Artifact\x20','4722euAzhw','content','13iKWCgc','read','add','some','build','react','Preview:\x20create\x20react_module\x20Artifact','string','join','76311zEWyjb','filter','artifactType','5lSfBCq','63026ycZXZv','description','@ant-design/icons'];a7_0x5de9=function(){return _0x448009;};return a7_0x5de9();}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_0x43a492=a8_0x144c;(function(_0xedcbe9,_0x1c9218){const _0x4723ec=a8_0x144c,_0x3d3645=_0xedcbe9();while(!![]){try{const _0xf90cc0=parseInt(_0x4723ec(0x11b))/0x1*(parseInt(_0x4723ec(0x10c))/0x2)+parseInt(_0x4723ec(0x107))/0x3+parseInt(_0x4723ec(0x104))/0x4*(-parseInt(_0x4723ec(0xdf))/0x5)+-parseInt(_0x4723ec(0xee))/0x6+-parseInt(_0x4723ec(0x117))/0x7+-parseInt(_0x4723ec(0x11e))/0x8+parseInt(_0x4723ec(0xec))/0x9;if(_0xf90cc0===_0x1c9218)break;else _0x3d3645['push'](_0x3d3645['shift']());}catch(_0x7f1bdf){_0x3d3645['push'](_0x3d3645['shift']());}}}(a8_0x2111,0x2ce83));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';function a8_0x144c(_0x446917,_0x53fbe2){_0x446917=_0x446917-0xde;const _0x2111a7=a8_0x2111();let _0x144c2e=_0x2111a7[_0x446917];return _0x144c2e;}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';function a8_0x2111(){const _0x2c5c05=['production','Option\x20A:\x20','global-default','validation','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','cancelled','nonInteractive','\x20Verify:\x20','Invalid\x20accessKey\x20format:\x20\x22','Use\x20`','`auth\x20login`\x20does\x20not\x20support\x20--yes.','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','string','join','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20env\x20var','development','logout','access-key','Option\x20B:\x20apps\x20config\x20(','8470UCiqMS','No\x20AccessKey\x20found\x20in\x20','boolean','\x20auth\x20status','Write\x20to\x20global\x20config\x20(default)','isTTY','push','\x20config.','env','AccessKey\x20(ak_xxx...)','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','init','Clear\x20from\x20global\x20config\x20(default)','33507JSKNys','test','878856yUhxFh','global','ACCESS_KEY','AccessKey\x20cleared\x20from\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','daily','auth','AccessKey\x20saved\x20to\x20','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','status','accessKey','stdin','login','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Auth\x20config\x20reinitialized\x20in\x20','Auth\x20mode:\x20','info','\x20(via\x20','Clear\x20accessKey\x20from\x20config','\x20Current\x20env:\x20','\x20doctor','project','68AbgUzA','Missing\x20accessKey.','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','709662jvTnbS','slice','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','newConfigFileName','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','185486koaPtX','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','length','=ak_xxx','envName','\x20auth\x20login\x20--access-key\x20<ak_xxx>','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','userCenterDisplayName','Shorthand\x20for\x20--access-key','\x20\x20export\x20','840063vNyDvC','Then\x20verify\x20with:\x20','bool','write','3vgMIur','str','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','314272wxXxxW','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'];a8_0x2111=function(){return _0x2c5c05;};return a8_0x2111();}const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x47df34=a8_0x144c;writeCliSideChannelLine(_0x47df34(0x12e)+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x47df34(0x112));}function buildAccessKeySetupGuide(){const _0x1e5ab3=a8_0x144c;return[_0x1e5ab3(0x12e)+PRODUCT_CONFIG[_0x1e5ab3(0x114)]+':',USER_ACCESS_KEY_CREATE_URL,_0x1e5ab3(0x11f)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]'][_0x1e5ab3(0x12d)]('\x0a');}function canPromptForAccessKey(_0x91b455){const _0x58ef0d=a8_0x144c;return!_0x91b455[_0x58ef0d(0x126)]&&process[_0x58ef0d(0xf9)][_0x58ef0d(0xe4)]!==![]&&process['stdout'][_0x58ef0d(0xe4)]!==![];}function resolveAuthScopeFlags(_0x211adc){const _0x2f6a41=a8_0x144c;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x211adc[_0x2f6a41(0x119)]('global'),'explicitProject':_0x211adc[_0x2f6a41(0x119)]('project'),'policy':_0x2f6a41(0x122)}));}async function resolveAuthWriteInput(_0x36e83b){const _0x3f6357=a8_0x144c;let _0x1c0200=(_0x36e83b['str']('access-key')||_0x36e83b['str']('ak')||'')['trim']();const _0x3b7e96=(_0x36e83b[_0x3f6357(0x11c)](_0x3f6357(0xe7))||'')['trim']();if(!_0x1c0200&&canPromptForAccessKey(_0x36e83b))try{showAccessKeyCreateHint(),_0x1c0200=await promptAccessKey('');}catch(_0x53c3c0){if(isAbortPrompt(_0x53c3c0))throw CliErrors[_0x3f6357(0x125)]();throw _0x53c3c0;}if(!_0x1c0200)throw CliErrors[_0x3f6357(0x123)](_0x3f6357(0x105),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x3f6357(0xed)](_0x1c0200))throw CliErrors[_0x3f6357(0x123)](_0x3f6357(0x128)+_0x1c0200+'\x22',_0x3f6357(0xfb));if(!_0x3b7e96)return{'accessKey':_0x1c0200};const _0x4854fb=normalizeEnv(_0x3b7e96);return{'accessKey':_0x1c0200,'env':isDaily(_0x4854fb)?_0x3f6357(0xf3):isDev(_0x4854fb)?_0x3f6357(0x130):_0x3f6357(0x120)};}export const authDefinitions=[{'service':a8_0x43a492(0xf4),'command':a8_0x43a492(0xfa),'description':a8_0x43a492(0x11d),'risk':a8_0x43a492(0x11a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x43a492(0x132),'type':a8_0x43a492(0x12c),'description':a8_0x43a492(0xe8)},{'name':'ak','type':a8_0x43a492(0x12c),'description':a8_0x43a492(0x115)},{'name':a8_0x43a492(0xef),'type':a8_0x43a492(0xe1),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a8_0x43a492(0x103),'type':'boolean','description':a8_0x43a492(0x106),'default':![]}],async 'execute'(_0x2c6c50){const _0x121f7c=a8_0x43a492;if(_0x2c6c50[_0x121f7c(0x119)]('yes'))throw CliErrors[_0x121f7c(0x123)](_0x121f7c(0x12a),_0x121f7c(0x129)+CLI_BIN_NAME+_0x121f7c(0x12b)+CLI_BIN_NAME+_0x121f7c(0xf2));const _0x44d958=(_0x2c6c50['str'](_0x121f7c(0x132))||_0x2c6c50[_0x121f7c(0x11c)]('ak')||'')['trim']();if(!_0x44d958&&_0x2c6c50[_0x121f7c(0x126)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x26216e=await resolveAuthWriteInput(_0x2c6c50),_0x9b6e14=resolveAuthScopeFlags(_0x2c6c50),_0x5436b7=readScopedConfig(_0x9b6e14);_0x5436b7[_0x121f7c(0xf8)]=_0x26216e[_0x121f7c(0xf8)];_0x26216e[_0x121f7c(0xe7)]&&(_0x5436b7[_0x121f7c(0xe7)]=_0x26216e[_0x121f7c(0xe7)]);writeScopedConfig(_0x5436b7,_0x9b6e14);const _0x2bfe8f=_0x9b6e14[_0x121f7c(0xef)]?'global':_0x121f7c(0x103),_0x39bca7=_0x5436b7[_0x121f7c(0xe7)]?_0x121f7c(0x101)+_0x5436b7['env']+'.':'';return{'ok':!![],'message':_0x121f7c(0xf5)+_0x2bfe8f+_0x121f7c(0xe6)+_0x39bca7+_0x121f7c(0x127)+CLI_BIN_NAME+_0x121f7c(0xe2)};}},{'service':'auth','command':a8_0x43a492(0xea),'description':a8_0x43a492(0x109),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x43a492(0x132),'type':a8_0x43a492(0x12c),'description':a8_0x43a492(0xe8)},{'name':'ak','type':a8_0x43a492(0x12c),'description':a8_0x43a492(0x115)},{'name':'env','type':a8_0x43a492(0x12c),'description':a8_0x43a492(0x124)},{'name':a8_0x43a492(0xef),'type':'boolean','description':a8_0x43a492(0xe3),'default':!![]},{'name':a8_0x43a492(0x103),'type':'boolean','description':a8_0x43a492(0x106),'default':![]}],async 'execute'(_0x229443){const _0x2dc675=a8_0x43a492,_0x44f221=await resolveAuthWriteInput(_0x229443),_0x35bf01=resolveAuthScopeFlags(_0x229443),_0x522bbf={'accessKey':_0x44f221[_0x2dc675(0xf8)]};_0x44f221[_0x2dc675(0xe7)]&&(_0x522bbf[_0x2dc675(0xe7)]=_0x44f221[_0x2dc675(0xe7)]);writeScopedConfig(_0x522bbf,_0x35bf01);const _0x4f349b=_0x35bf01['global']?_0x2dc675(0xef):_0x2dc675(0x103),_0x483e65=_0x522bbf[_0x2dc675(0xe7)]?_0x2dc675(0x101)+_0x522bbf[_0x2dc675(0xe7)]+'.':'';return{'ok':!![],'message':_0x2dc675(0xfc)+_0x4f349b+'\x20scope.'+_0x483e65+_0x2dc675(0x127)+CLI_BIN_NAME+_0x2dc675(0xe2)};}},{'service':a8_0x43a492(0xf4),'command':a8_0x43a492(0x131),'description':a8_0x43a492(0x100),'risk':a8_0x43a492(0x11a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':'boolean','description':a8_0x43a492(0xeb),'default':!![]},{'name':a8_0x43a492(0x103),'type':a8_0x43a492(0xe1),'description':a8_0x43a492(0x10e),'default':![]}],async 'execute'(_0x3ae271){const _0x391102=a8_0x43a492,_0xdff2e=resolveAuthScopeFlags(_0x3ae271),_0x4331e2=readScopedConfig(_0xdff2e),_0x60ab40=!!_0x4331e2[_0x391102(0xf8)];delete _0x4331e2[_0x391102(0xf8)],writeScopedConfig(_0x4331e2,_0xdff2e);const _0x558441=_0xdff2e[_0x391102(0xef)]?'global':'project';if(_0x60ab40)return{'ok':!![],'message':_0x391102(0xf1)+_0x558441+_0x391102(0xe6)};return{'ok':!![],'message':_0x391102(0xe0)+_0x558441+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a8_0x43a492(0xf4),'command':a8_0x43a492(0xf7),'description':'Show\x20current\x20authentication\x20status','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':'boolean','description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a8_0x43a492(0xe1),'description':a8_0x43a492(0x10b),'default':![]}],async 'execute'(_0x57acdc){const _0x55daf0=a8_0x43a492,_0x341cdb=resolveAuthScopeFlags(_0x57acdc),_0x3a134b=readScopedConfig(_0x341cdb),_0x41dcc4=productEnvName(_0x55daf0(0xf0)),_0x505181=productEnv(_0x55daf0(0xf0))||undefined,_0x52e4d4=_0x3a134b[_0x55daf0(0xf8)]||undefined,_0x49a314=_0x505181||_0x52e4d4,_0xf6fc21=_0x505181?_0x41dcc4+_0x55daf0(0x12f):_0x52e4d4?(_0x341cdb['global']?_0x55daf0(0xef):_0x55daf0(0x103))+'\x20config':null,_0x358135=[_0x55daf0(0xfd)+AUTH_MODE['ClientAk']];if(_0x49a314){const _0x530de7=_0x49a314['length']>0x8?''+_0x49a314[_0x55daf0(0x108)](0x0,0x8)+'*'['repeat'](_0x49a314[_0x55daf0(0x10f)]-0x8):_0x49a314;_0x358135[_0x55daf0(0xe5)]('AccessKey:\x20'+_0x530de7+(_0xf6fc21?_0x55daf0(0xff)+_0xf6fc21+')':''));}return!_0x49a314&&(_0x358135['push'](''),_0x358135[_0x55daf0(0xe5)](_0x55daf0(0xe9)),_0x358135[_0x55daf0(0xe5)](''),_0x358135['push'](_0x55daf0(0x121)+CLI_BIN_NAME+_0x55daf0(0x113)),_0x358135[_0x55daf0(0xe5)](''),_0x358135[_0x55daf0(0xe5)](_0x55daf0(0xde)+PRODUCT_CONFIG[_0x55daf0(0x10a)]+')'),_0x358135['push'](_0x55daf0(0xf6)),_0x358135[_0x55daf0(0xe5)](''),_0x358135[_0x55daf0(0xe5)]('Option\x20C:\x20environment\x20variable'),_0x358135[_0x55daf0(0xe5)](_0x55daf0(0x116)+_0x41dcc4+_0x55daf0(0x110)),_0x358135['push'](''),_0x358135[_0x55daf0(0xe5)](_0x55daf0(0x118)+CLI_BIN_NAME+_0x55daf0(0xe2)),_0x358135[_0x55daf0(0xe5)](_0x55daf0(0x10d)+CLI_BIN_NAME+_0x55daf0(0x102))),{'ok':!![],'message':_0x358135[_0x55daf0(0x12d)]('\x0a')};}},{'service':a8_0x43a492(0xf4),'command':a8_0x43a492(0xfe),'description':'Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2d74c1){const _0x2af655=a8_0x43a492,_0x92fe2f=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x92fe2f,'meta':{'env':_0x2d74c1[_0x2af655(0x111)]??_0x2af655(0x120)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3acba1,_0x4fc04f){const _0x41d1f2=a9_0x5c46,_0x389cd1=_0x3acba1();while(!![]){try{const _0x14a000=parseInt(_0x41d1f2(0xfd))/0x1+parseInt(_0x41d1f2(0x106))/0x2+-parseInt(_0x41d1f2(0x113))/0x3*(parseInt(_0x41d1f2(0x104))/0x4)+-parseInt(_0x41d1f2(0x114))/0x5+parseInt(_0x41d1f2(0x100))/0x6*(parseInt(_0x41d1f2(0x101))/0x7)+parseInt(_0x41d1f2(0x112))/0x8*(-parseInt(_0x41d1f2(0x107))/0x9)+parseInt(_0x41d1f2(0xfe))/0xa*(parseInt(_0x41d1f2(0x10a))/0xb);if(_0x14a000===_0x4fc04f)break;else _0x389cd1['push'](_0x389cd1['shift']());}catch(_0x28dd1c){_0x389cd1['push'](_0x389cd1['shift']());}}}(a9_0x4156,0xb52ef));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x3e8386=a9_0x5c46;super(_0x3e8386(0xff)),this[_0x3e8386(0x10d)]='AbortPrompt';}}function a9_0x5c46(_0x3bb205,_0x11de76){_0x3bb205=_0x3bb205-0xfd;const _0x41563d=a9_0x4156();let _0x5c46be=_0x41563d[_0x3bb205];return _0x5c46be;}function a9_0x4156(){const _0x474963=['433208ibcxoj','12zMvKXX','6025235mpOvDs','AccessKey\x20(paste\x20ak_...):\x20','615241xdUUTa','10wXHDeX','User\x20aborted\x20prompt','396810KrCISV','7VFTaDW','once','AbortPrompt','928640TmENVI','SIGINT','2482676rWEVhG','27wKGpFO','stdout','race','12271083gxVfSv','question','AccessKey\x20(','name','):\x20','close','stdin','removeListener'];a9_0x4156=function(){return _0x474963;};return a9_0x4156();}function createSafeRl(){const _0x39a364=a9_0x5c46,_0xc40ee7=createInterface({'input':process[_0x39a364(0x110)],'output':process[_0x39a364(0x108)]});let _0x197c4a;const _0x5ee792=new Promise((_0x531afc,_0x949960)=>{const _0x4d229c=_0x39a364;_0x197c4a=()=>{const _0x1d1e18=a9_0x5c46;_0x197c4a&&(_0xc40ee7[_0x1d1e18(0x111)](_0x1d1e18(0x105),_0x197c4a),_0x197c4a=undefined);try{_0xc40ee7['close']();}catch{}_0x949960(new AbortPrompt());},_0xc40ee7[_0x4d229c(0x102)](_0x4d229c(0x105),_0x197c4a);}),_0x48c284=()=>{const _0x305498=_0x39a364;_0x197c4a&&(_0xc40ee7[_0x305498(0x111)](_0x305498(0x105),_0x197c4a),_0x197c4a=undefined);try{_0xc40ee7[_0x305498(0x10f)]();}catch{}};return{'rl':_0xc40ee7,'abortPromise':_0x5ee792,'disposeSuccess':_0x48c284};}export async function promptAccessKey(_0x54fd49=''){const _0x1b7c8a=a9_0x5c46,{rl:_0x2239d9,abortPromise:_0x30e458,disposeSuccess:_0x40e145}=createSafeRl(),_0x5e9020=new Promise(_0x86885b=>{const _0x4ae2b3=a9_0x5c46,_0x2a817e=_0x54fd49?_0x4ae2b3(0x10c)+_0x54fd49+_0x4ae2b3(0x10e):_0x4ae2b3(0x115);_0x2239d9[_0x4ae2b3(0x10b)](_0x2a817e,_0x558f03=>{_0x40e145(),_0x86885b(_0x558f03['trim']()||_0x54fd49);});});return Promise[_0x1b7c8a(0x109)]([_0x5e9020,_0x30e458]);}export function isAbortPrompt(_0x3a1304){const _0x1ee9ba=a9_0x5c46;return _0x3a1304 instanceof Error&&_0x3a1304[_0x1ee9ba(0x10d)]===_0x1ee9ba(0x103);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x53a44e=a10_0xabc5;(function(_0xa37971,_0x26c26a){const _0x4b0706=a10_0xabc5,_0x4b2131=_0xa37971();while(!![]){try{const _0xe2e94c=-parseInt(_0x4b0706(0x1bc))/0x1*(-parseInt(_0x4b0706(0x1c1))/0x2)+parseInt(_0x4b0706(0x1be))/0x3*(-parseInt(_0x4b0706(0x1c5))/0x4)+parseInt(_0x4b0706(0x1c6))/0x5+parseInt(_0x4b0706(0x1b7))/0x6*(-parseInt(_0x4b0706(0x1b2))/0x7)+parseInt(_0x4b0706(0x1bf))/0x8+-parseInt(_0x4b0706(0x1b8))/0x9*(parseInt(_0x4b0706(0x1b4))/0xa)+parseInt(_0x4b0706(0x1b3))/0xb;if(_0xe2e94c===_0x26c26a)break;else _0x4b2131['push'](_0x4b2131['shift']());}catch(_0x586c0f){_0x4b2131['push'](_0x4b2131['shift']());}}}(a10_0x58e4,0x3cba9));import{getBffScriptInfo}from'../../core/api-client.js';function a10_0x58e4(){const _0xa0fe0c=['description','createdTime','12OpBAYJ','1712645lAmAaH','num','14oAmgUZ','2072334BYGMGu','855000ofJkwl','appCode','verbose','1272246wwBqHf','9SAIMwS','read','bool','functionName','53039fpIvrp','Script\x20ID','163806KBRkjb','1856744PdQKOS','(none)','6Otuonp','Get\x20BFF\x20script\x20details\x20by\x20ID'];a10_0x58e4=function(){return _0xa0fe0c;};return a10_0x58e4();}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a10_0xabc5(_0x54c8c5,_0x4a96a2){_0x54c8c5=_0x54c8c5-0x1b2;const _0x58e415=a10_0x58e4();let _0xabc556=_0x58e415[_0x54c8c5];return _0xabc556;}export const bffDetail={'service':'bff','command':'detail','description':a10_0x53a44e(0x1c2),'risk':a10_0x53a44e(0x1b9),'flags':[{...ID_FLAG,'description':a10_0x53a44e(0x1bd)},VERBOSE_FLAG],async 'execute'(_0x3272ee){const _0x343ff3=a10_0x53a44e,_0x216cdf=await getBffScriptInfo(_0x3272ee[_0x343ff3(0x1c7)]('id')),_0x55df9e=_0x3272ee[_0x343ff3(0x1ba)](_0x343ff3(0x1b6));if(_0x55df9e)return{'ok':!![],'data':_0x216cdf};return{'ok':!![],'data':{'id':_0x216cdf['id'],'appCode':_0x216cdf[_0x343ff3(0x1b5)],'functionName':_0x216cdf[_0x343ff3(0x1bb)]??'','scriptType':_0x216cdf['scriptType'],'description':_0x216cdf[_0x343ff3(0x1c3)]||_0x343ff3(0x1c0),'createdTime':_0x216cdf[_0x343ff3(0x1c4)]??'','updatedTime':_0x216cdf['updatedTime']??''}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a11_0x9ad9ad=a11_0x4971;(function(_0x409466,_0x195a67){const _0x42d114=a11_0x4971,_0x3abafb=_0x409466();while(!![]){try{const _0x48ca39=-parseInt(_0x42d114(0x195))/0x1+-parseInt(_0x42d114(0x196))/0x2+parseInt(_0x42d114(0x19d))/0x3*(parseInt(_0x42d114(0x19e))/0x4)+parseInt(_0x42d114(0x197))/0x5+parseInt(_0x42d114(0x199))/0x6*(-parseInt(_0x42d114(0x1a1))/0x7)+parseInt(_0x42d114(0x19c))/0x8*(-parseInt(_0x42d114(0x19f))/0x9)+parseInt(_0x42d114(0x19a))/0xa;if(_0x48ca39===_0x195a67)break;else _0x3abafb['push'](_0x3abafb['shift']());}catch(_0x1495d7){_0x3abafb['push'](_0x3abafb['shift']());}}}(a11_0xfd75,0xb6f4f));import{executeSdkBff}from'../../core/sdk-client.js';function a11_0x4971(_0x2eaabd,_0x164431){_0x2eaabd=_0x2eaabd-0x193;const _0xfd75a5=a11_0xfd75();let _0x49715b=_0xfd75a5[_0x2eaabd];return _0x49715b;}import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':'bff','command':'exec','description':a11_0x9ad9ad(0x19b),'risk':'read','flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name\x20to\x20execute'},PARAMS_FLAG],async 'execute'(_0x4cf013){const _0x3e9c5b=a11_0x9ad9ad,_0x417c97=parseJsonParams(_0x4cf013[_0x3e9c5b(0x193)]('params')),_0x4ce022=Date[_0x3e9c5b(0x194)](),_0x51db75=await executeSdkBff(_0x4cf013[_0x3e9c5b(0x193)](_0x3e9c5b(0x1a0)),_0x417c97),_0x144051=Date['now']()-_0x4ce022;return{'ok':!![],'data':{'result':_0x51db75,'elapsed':_0x144051},'message':_0x3e9c5b(0x198)+_0x144051+'ms'};}};function a11_0xfd75(){const _0x51dae6=['3184132WJVHha','1094283ZhjmpJ','name','14756IGawHM','str','now','641701OyMKJF','1405284Ufvdcq','4084665SDBMZZ','BFF\x20executed\x20in\x20','2928NoSYGr','18742330hhOjxH','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','24hpcwXe','3aFxCEr'];a11_0xfd75=function(){return _0x51dae6;};return a11_0xfd75();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e1122,_0x10d8d6){const _0x28548e=a12_0x4431,_0x4d2187=_0x5e1122();while(!![]){try{const _0x1da860=-parseInt(_0x28548e(0x18e))/0x1*(-parseInt(_0x28548e(0x18f))/0x2)+-parseInt(_0x28548e(0x194))/0x3*(-parseInt(_0x28548e(0x18c))/0x4)+-parseInt(_0x28548e(0x190))/0x5*(-parseInt(_0x28548e(0x192))/0x6)+parseInt(_0x28548e(0x193))/0x7+-parseInt(_0x28548e(0x195))/0x8*(parseInt(_0x28548e(0x18b))/0x9)+parseInt(_0x28548e(0x191))/0xa+-parseInt(_0x28548e(0x18d))/0xb;if(_0x1da860===_0x10d8d6)break;else _0x4d2187['push'](_0x4d2187['shift']());}catch(_0x331a8d){_0x4d2187['push'](_0x4d2187['shift']());}}}(a12_0x4051,0x8a957));function a12_0x4431(_0x342ce9,_0x414cec){_0x342ce9=_0x342ce9-0x18b;const _0x40512f=a12_0x4051();let _0x44310d=_0x40512f[_0x342ce9];return _0x44310d;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];function a12_0x4051(){const _0x560a3f=['9736ZeVjIL','4356FjNLLb','12WpevPR','18409160xQqnCI','412zsMbdv','2446buLHoZ','1953345GhMvLB','7990790jRswye','12qwcqlp','4821467IEqdqU','57153AcTMJm'];a12_0x4051=function(){return _0x560a3f;};return a12_0x4051();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x23e6d2,_0x479355){const _0x33fe7a=a13_0x1202,_0x5984ca=_0x23e6d2();while(!![]){try{const _0x4e86f3=-parseInt(_0x33fe7a(0x1bf))/0x1*(-parseInt(_0x33fe7a(0x1c2))/0x2)+-parseInt(_0x33fe7a(0x1c4))/0x3+parseInt(_0x33fe7a(0x1bc))/0x4+-parseInt(_0x33fe7a(0x1ce))/0x5*(-parseInt(_0x33fe7a(0x1ba))/0x6)+parseInt(_0x33fe7a(0x1c3))/0x7*(-parseInt(_0x33fe7a(0x1be))/0x8)+parseInt(_0x33fe7a(0x1ca))/0x9*(-parseInt(_0x33fe7a(0x1c0))/0xa)+-parseInt(_0x33fe7a(0x1d2))/0xb*(-parseInt(_0x33fe7a(0x1bd))/0xc);if(_0x4e86f3===_0x479355)break;else _0x5984ca['push'](_0x5984ca['shift']());}catch(_0x2e1edf){_0x5984ca['push'](_0x5984ca['shift']());}}}(a13_0x5e2b,0x3e9d0));import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';function a13_0x1202(_0x48c4be,_0x56cc20){_0x48c4be=_0x48c4be-0x1b9;const _0x5e2b16=a13_0x5e2b();let _0x120299=_0x5e2b16[_0x48c4be];return _0x120299;}function a13_0x5e2b(){const _0xd7e745=['10rJEBKJ','project','2kRdzsg','2132837ccwGYF','605688sQlDOj','\x20init`\x20first.','project-or-global-explicit','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','project-default',',\x20or\x20run\x20`','2783943bMwolN','global-default','newConfigFileName','inProject','1405acDvhV','\x20found).','validation','Not\x20inside\x20a\x20project\x20(no\x20','8008946xQqedC','\x20(global)','2034cEnbPV','global','122528kZsqYp','12nNDuad','8oNnzLi','218401QXnOEv'];a13_0x5e2b=function(){return _0xd7e745;};return a13_0x5e2b();}export function resolveConfigScope(_0x4420af){const _0x16a8b3=a13_0x1202,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x358e8a}=_0x4420af;if(explicitGlobal&&explicitProject)throw CliErrors[_0x16a8b3(0x1d0)](_0x16a8b3(0x1c7),'Use\x20only\x20one\x20config\x20scope\x20flag.');if(explicitGlobal)return _0x16a8b3(0x1bb);if(explicitProject)return _0x16a8b3(0x1c1);switch(_0x358e8a){case _0x16a8b3(0x1cb):return _0x16a8b3(0x1bb);case _0x16a8b3(0x1c8):return _0x4420af['inProject']??isInProject()?_0x16a8b3(0x1c1):'global';case _0x16a8b3(0x1c6):if(!(_0x4420af[_0x16a8b3(0x1cd)]??isInProject()))throw CliErrors[_0x16a8b3(0x1d0)](_0x16a8b3(0x1d1)+PRODUCT_CONFIG[_0x16a8b3(0x1cc)]+_0x16a8b3(0x1cf),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG['newConfigFileName']+_0x16a8b3(0x1c9)+CLI_BIN_NAME+_0x16a8b3(0x1c5));return _0x16a8b3(0x1c1);}}export function toScopeFlags(_0x22138e){const _0x19fd22=a13_0x1202;return{'global':_0x22138e===_0x19fd22(0x1bb)};}export function formatScopeLabel(_0xadff3f){const _0xcc2466=a13_0x1202;return _0xadff3f==='global'?_0xcc2466(0x1b9):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x522775,_0x258b97){const _0x4443cf=a14_0x22a7,_0x16ae85=_0x522775();while(!![]){try{const _0x2ccc78=-parseInt(_0x4443cf(0x8a))/0x1*(parseInt(_0x4443cf(0x7d))/0x2)+parseInt(_0x4443cf(0x74))/0x3+parseInt(_0x4443cf(0x88))/0x4*(-parseInt(_0x4443cf(0x89))/0x5)+-parseInt(_0x4443cf(0x6f))/0x6*(-parseInt(_0x4443cf(0x81))/0x7)+parseInt(_0x4443cf(0x84))/0x8*(-parseInt(_0x4443cf(0x71))/0x9)+parseInt(_0x4443cf(0x76))/0xa*(-parseInt(_0x4443cf(0x7a))/0xb)+-parseInt(_0x4443cf(0x8c))/0xc*(-parseInt(_0x4443cf(0x87))/0xd);if(_0x2ccc78===_0x258b97)break;else _0x16ae85['push'](_0x16ae85['shift']());}catch(_0x171ab4){_0x16ae85['push'](_0x16ae85['shift']());}}}(a14_0x4e37,0x399fe));function a14_0x4e37(){const _0xe1a86b=['length','26ksvJre','48ocaZBb','22585oXiEzu','1ZMMUtl','\x20are\x20mutually\x20exclusive\x20for\x20`','5134956dKAsyp','24JQnNZh','At\x20least\x20one\x20of\x20','6741aDwZQS','\x20is\x20allowed,\x20found:\x20',':\x20expected\x20','879762RTnAne','validation','888590YyPcpk','Only\x20one\x20of\x20','map','some','44MrAaux','Provide\x20one\x20of:\x20','flag','828026fkOeUS','Flags\x20','test','Use\x20only\x20one\x20of:\x20','395381UiQyEW','Invalid\x20--','filter','3368QVeIbf','Exactly\x20one\x20of\x20'];a14_0x4e37=function(){return _0xe1a86b;};return a14_0x4e37();}import{CliErrors}from'../../errors.js';function isSet(_0x5c8735,_0x448f1d){const _0xf532ca=a14_0x22a7,_0x3656e4=_0x5c8735[_0xf532ca(0x7c)](_0x448f1d);return _0x3656e4!==undefined&&_0x3656e4!==''&&_0x3656e4!==![]&&_0x3656e4!==0x0;}function fmtNames(_0x38abc){const _0x4fec12=a14_0x22a7;return _0x38abc[_0x4fec12(0x78)](_0x2dc3cf=>'--'+_0x2dc3cf)['join'](',\x20');}export function requireOneOf(_0x29d042,_0x2f490c,_0x4623e7){const _0x36da33=a14_0x22a7,_0x5c2d21=_0x2f490c[_0x36da33(0x83)](_0x5dca03=>isSet(_0x29d042,_0x5dca03));if(_0x5c2d21['length']!==0x1)throw CliErrors['validation'](_0x5c2d21[_0x36da33(0x86)]===0x0?_0x36da33(0x85)+fmtNames(_0x2f490c)+'\x20is\x20required\x20for\x20`'+_0x4623e7+'`.':_0x36da33(0x77)+fmtNames(_0x2f490c)+_0x36da33(0x72)+fmtNames(_0x5c2d21)+'.',_0x5c2d21['length']===0x0?_0x36da33(0x7b)+fmtNames(_0x2f490c):'Remove\x20all\x20but\x20one.');}export function requireAnyOf(_0x599446,_0x31ba3d,_0x3c7581){const _0xae554e=a14_0x22a7;if(!_0x31ba3d[_0xae554e(0x79)](_0x516d15=>isSet(_0x599446,_0x516d15)))throw CliErrors[_0xae554e(0x75)](_0xae554e(0x70)+fmtNames(_0x31ba3d)+'\x20is\x20required\x20for\x20`'+_0x3c7581+'`.',_0xae554e(0x7b)+fmtNames(_0x31ba3d));}function a14_0x22a7(_0x1f08ff,_0x10bc51){_0x1f08ff=_0x1f08ff-0x6f;const _0x4e373f=a14_0x4e37();let _0x22a7c2=_0x4e373f[_0x1f08ff];return _0x22a7c2;}export function mutuallyExclusive(_0x10c1ee,_0x574587,_0x34c85d){const _0x78dfed=a14_0x22a7,_0x3dd872=_0x574587[_0x78dfed(0x83)](_0x458b48=>isSet(_0x10c1ee,_0x458b48));if(_0x3dd872[_0x78dfed(0x86)]>0x1)throw CliErrors[_0x78dfed(0x75)](_0x78dfed(0x7e)+fmtNames(_0x3dd872)+_0x78dfed(0x8b)+_0x34c85d+'`.',_0x78dfed(0x80)+fmtNames(_0x574587));}export function validatePattern(_0x26070e,_0x43e6ee,_0x28379f,_0x5ce4c6){const _0x4d2f63=a14_0x22a7,_0x3fd3a1=_0x26070e['str'](_0x43e6ee);if(_0x3fd3a1&&!_0x28379f[_0x4d2f63(0x7f)](_0x3fd3a1))throw CliErrors[_0x4d2f63(0x75)](_0x4d2f63(0x82)+_0x43e6ee+_0x4d2f63(0x73)+_0x5ce4c6+',\x20got\x20\x22'+_0x3fd3a1+'\x22.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a15_0x15c59f=a15_0x1687;function a15_0x3194(){const _0x4398ce=['Resource\x20ID','boolean','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','sqlcode','12ROoiOO','7cQYnEr','130448EQQsDm','Parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','312108VQLAzW','code','name','1735560PYlKLQ','params','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','2176910DXffSg','string','verbose','Return\x20full\x20raw\x20response\x20object','5158024udQneX','8717472SpVbQN','Dataset\x20code\x20(32-char\x20hex\x20UUID)','number','2048916KRJZgf','a\x2032-character\x20lowercase\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588a3a79d4a3540bbb2def2ad0a228a9acd)'];a15_0x3194=function(){return _0x4398ce;};return a15_0x3194();}(function(_0x2a6903,_0x43587b){const _0x438144=a15_0x1687,_0x503fa8=_0x2a6903();while(!![]){try{const _0x15b407=-parseInt(_0x438144(0x17b))/0x1+parseInt(_0x438144(0x17d))/0x2*(-parseInt(_0x438144(0x179))/0x3)+-parseInt(_0x438144(0x180))/0x4+-parseInt(_0x438144(0x183))/0x5+parseInt(_0x438144(0x18b))/0x6+parseInt(_0x438144(0x17a))/0x7*(parseInt(_0x438144(0x187))/0x8)+parseInt(_0x438144(0x188))/0x9;if(_0x15b407===_0x43587b)break;else _0x503fa8['push'](_0x503fa8['shift']());}catch(_0x547159){_0x503fa8['push'](_0x503fa8['shift']());}}}(a15_0x3194,0x50c9f));export const CODE_FLAG={'name':a15_0x15c59f(0x17e),'type':'string','required':!![],'description':a15_0x15c59f(0x189),'pattern':{'regex':/^[a-f0-9]{32}$/i,'description':a15_0x15c59f(0x18c)}};export const SQLCODE_FLAG={'name':a15_0x15c59f(0x178),'type':'string','required':!![],'description':a15_0x15c59f(0x177),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a15_0x15c59f(0x182)}};function a15_0x1687(_0x288a65,_0x56b58f){_0x288a65=_0x288a65-0x176;const _0x319488=a15_0x3194();let _0x168781=_0x319488[_0x288a65];return _0x168781;}export const VERBOSE_FLAG={'name':a15_0x15c59f(0x185),'type':a15_0x15c59f(0x176),'description':a15_0x15c59f(0x186)};export const PARAMS_FLAG={'name':a15_0x15c59f(0x181),'type':a15_0x15c59f(0x184),'description':a15_0x15c59f(0x17c)};export const NAME_FLAG={'name':a15_0x15c59f(0x17f),'type':a15_0x15c59f(0x184),'description':'Resource\x20name\x20for\x20lookup'};export const ID_FLAG={'name':'id','type':a15_0x15c59f(0x18a),'required':!![],'description':a15_0x15c59f(0x18d)};
|
|
@@ -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_0x16bb3e=a16_0x426b;(function(_0x58faa5,_0x2cd141){const _0x29e283=a16_0x426b,_0x5a76ab=_0x58faa5();while(!![]){try{const _0x107a4c=parseInt(_0x29e283(0x1ee))/0x1*(parseInt(_0x29e283(0x1e6))/0x2)+-parseInt(_0x29e283(0x1cb))/0x3*(-parseInt(_0x29e283(0x205))/0x4)+parseInt(_0x29e283(0x1c9))/0x5*(-parseInt(_0x29e283(0x201))/0x6)+parseInt(_0x29e283(0x1d2))/0x7+-parseInt(_0x29e283(0x1f9))/0x8*(parseInt(_0x29e283(0x1da))/0x9)+parseInt(_0x29e283(0x1ed))/0xa+-parseInt(_0x29e283(0x1fb))/0xb;if(_0x107a4c===_0x2cd141)break;else _0x5a76ab['push'](_0x5a76ab['shift']());}catch(_0x5905b2){_0x5a76ab['push'](_0x5a76ab['shift']());}}}(a16_0x584e,0x3a5ab));function a16_0x426b(_0x1c9f9e,_0x14e9b7){_0x1c9f9e=_0x1c9f9e-0x1c7;const _0x584e37=a16_0x584e();let _0x426bdd=_0x584e37[_0x1c9f9e];return _0x426bdd;}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_0x16bb3e(0x1db),'type':a16_0x16bb3e(0x1e1),'description':a16_0x16bb3e(0x204),'default':![]};function parseAliasAppcodeSetKey(_0x41f330){const _0x4bc732=a16_0x16bb3e,_0x25e43e=_0x41f330[_0x4bc732(0x1d7)]('.');if(_0x25e43e[_0x4bc732(0x1e3)]!==0x3||_0x25e43e[0x0]!=='apps'||_0x25e43e[0x2]!==_0x4bc732(0x1ef))return undefined;const _0x1cc749=_0x25e43e[0x1]?.[_0x4bc732(0x200)]();return _0x1cc749?_0x1cc749:undefined;}function parseAliasDeleteKey(_0x5155b8){const _0x5d2b45=a16_0x16bb3e,_0x3c8f4c=_0x5155b8[_0x5d2b45(0x1d7)]('.');if(_0x3c8f4c[_0x5d2b45(0x1e3)]===0x2&&_0x3c8f4c[0x0]===_0x5d2b45(0x1cc)){const _0x66efcc=_0x3c8f4c[0x1]?.['trim']();return _0x66efcc?{'alias':_0x66efcc}:undefined;}if(_0x3c8f4c[_0x5d2b45(0x1e3)]===0x3&&_0x3c8f4c[0x0]===_0x5d2b45(0x1cc)&&_0x3c8f4c[0x2]===_0x5d2b45(0x1ef)){const _0x5eba14=_0x3c8f4c[0x1]?.[_0x5d2b45(0x200)]();return _0x5eba14?{'alias':_0x5eba14,'field':_0x5d2b45(0x1ef)}:undefined;}return undefined;}function setLocalAppAlias(_0x472a1c,_0x5261c6,_0x5ef560){const _0x596fa3=a16_0x16bb3e,_0x6541d3=_0x472a1c[_0x596fa3(0x1cc)]&&typeof _0x472a1c[_0x596fa3(0x1cc)]===_0x596fa3(0x1d8)&&!Array['isArray'](_0x472a1c[_0x596fa3(0x1cc)])?_0x472a1c[_0x596fa3(0x1cc)]:{},_0x2589aa=_0x6541d3[_0x5261c6]&&typeof _0x6541d3[_0x5261c6]===_0x596fa3(0x1d8)&&!Array['isArray'](_0x6541d3[_0x5261c6])?_0x6541d3[_0x5261c6]:{};_0x2589aa['appcode']=_0x5ef560,_0x6541d3[_0x5261c6]=_0x2589aa,_0x472a1c[_0x596fa3(0x1cc)]=_0x6541d3;}function deleteLocalAppAlias(_0x37986e,_0x595677){const _0x562530=a16_0x16bb3e;if(!_0x37986e[_0x562530(0x1cc)]||typeof _0x37986e[_0x562530(0x1cc)]!==_0x562530(0x1d8)||Array[_0x562530(0x206)](_0x37986e[_0x562530(0x1cc)]))return![];const _0x103590=_0x37986e[_0x562530(0x1cc)],_0x1863f9=_0x103590[_0x595677[_0x562530(0x1e7)]];if(!_0x1863f9||typeof _0x1863f9!==_0x562530(0x1d8)||Array[_0x562530(0x206)](_0x1863f9))return![];if(!_0x595677[_0x562530(0x1f5)])return delete _0x103590[_0x595677[_0x562530(0x1e7)]],!![];if(!(_0x595677[_0x562530(0x1f5)]in _0x1863f9))return![];return delete _0x1863f9[_0x595677[_0x562530(0x1f5)]],Object[_0x562530(0x1fd)](_0x1863f9)['length']===0x0&&delete _0x103590[_0x595677[_0x562530(0x1e7)]],!![];}function a16_0x584e(){const _0x49693b=['\x20\x20project:\x20','log','get','Invalid\x20value\x20for\x20\x22','split','object','\x22\x20is\x20not\x20settable.','18CjEpLN','global',';\x20apps.<alias>.appcode','args','pageSize','raw','Missing\x20key\x20argument.','boolean','#\x20Effective\x20config\x20(merged\x20global\x20+\x20project)\x0a\x0a','length','config','stringify','42838JyoTOM','alias','delete','join','includes','set','Key\x20not\x20found:\x20','1927310QEYgpt','18vkxZKm','appcode','pretty','Key\x20\x22','write','\x22\x20not\x20found\x20at\x20top\x20level.','validation','field','Config\x20files:\x0a','project-or-global-explicit','Deleted\x20`','1579224hpRDRo','Top-level\x20key\x20\x22','1877194FZqJyQ','Usage:\x20','keys','../../context.js','value','trim','2280774nutrhj','List\x20current\x20config','list','Write\x20to\x20global\x20config','55004VzLwmD','isArray','\x20(global)','Set\x20`','Settable\x20keys:\x20','\x22.\x20Allowed:\x20','5egSNmo','(none)','69pZwDbn','apps','read','bool','\x20config\x20get\x20<key>','\x20\x20global:\x20\x20','key','2030434nGBesg'];a16_0x584e=function(){return _0x49693b;};return a16_0x584e();}const listDef={'service':a16_0x16bb3e(0x1e4),'command':a16_0x16bb3e(0x203),'description':a16_0x16bb3e(0x202),'risk':a16_0x16bb3e(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5bb95b){const _0x2d1d17=a16_0x16bb3e,{buildConfigFromFlags:_0x5dc4ea}=await import(_0x2d1d17(0x1fe)),_0x52a40e=_0x5dc4ea({}),_0x43e60f=getProjectConfigPath(),_0x2027dc=resolveWriteConfigPath(_0x2d1d17(0x1db));if(_0x5bb95b['format']===_0x2d1d17(0x1f0))return{'ok':!![],'message':_0x2d1d17(0x1e2)+(JSON['stringify'](_0x52a40e[_0x2d1d17(0x1df)],null,0x2)+'\x0a\x0a')+_0x2d1d17(0x1f6)+(_0x2d1d17(0x1d3)+(_0x43e60f??_0x2d1d17(0x1ca))+'\x0a')+(_0x2d1d17(0x1d0)+_0x2027dc)};return{'ok':!![],'data':{'effective':_0x52a40e[_0x2d1d17(0x1df)],'configFiles':{'project':_0x43e60f??null,'global':_0x2027dc}}};}},getDef={'service':a16_0x16bb3e(0x1e4),'command':a16_0x16bb3e(0x1d5),'description':'Get\x20a\x20config\x20value','risk':a16_0x16bb3e(0x1cd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x16bb3e(0x1d1),'description':'Config\x20key\x20(supports\x20dot\x20notation\x20for\x20reads\x20only)','required':!![]}],'flags':[],async 'execute'(_0x16b34a){const _0x412d6c=a16_0x16bb3e,_0x35ebcb=_0x16b34a['args'][0x0];if(!_0x35ebcb)throw CliErrors[_0x412d6c(0x1f4)]('Missing\x20key\x20argument.',_0x412d6c(0x1fc)+CLI_BIN_NAME+_0x412d6c(0x1cf));const {buildConfigFromFlags:_0x12bf9e}=await import(_0x412d6c(0x1fe)),{raw:_0x5132e2}=_0x12bf9e({});if(_0x35ebcb[_0x412d6c(0x1ea)]('.')){const _0x3a472c=_0x35ebcb[_0x412d6c(0x1d7)]('.');let _0x142b1b=_0x5132e2;for(const _0x56cee4 of _0x3a472c){if(_0x142b1b==null||typeof _0x142b1b!==_0x412d6c(0x1d8))throw CliErrors[_0x412d6c(0x1f4)](_0x412d6c(0x1ec)+_0x35ebcb);_0x142b1b=_0x142b1b[_0x56cee4];}if(_0x142b1b===undefined)throw CliErrors['validation'](_0x412d6c(0x1ec)+_0x35ebcb);return console[_0x412d6c(0x1d4)](typeof _0x142b1b===_0x412d6c(0x1d8)?JSON[_0x412d6c(0x1e5)](_0x142b1b,null,0x2):String(_0x142b1b)),{'ok':!![]};}const _0x6ce949=_0x5132e2[_0x35ebcb];if(_0x6ce949===undefined)throw CliErrors[_0x412d6c(0x1f4)]('Key\x20not\x20found:\x20'+_0x35ebcb);return console['log'](typeof _0x6ce949===_0x412d6c(0x1d8)?JSON[_0x412d6c(0x1e5)](_0x6ce949,null,0x2):String(_0x6ce949)),{'ok':!![]};}},setDef={'service':'config','command':a16_0x16bb3e(0x1eb),'description':'Set\x20a\x20config\x20value','risk':a16_0x16bb3e(0x1f2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x16bb3e(0x1d1),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a16_0x16bb3e(0x1ff),'description':'Value\x20to\x20assign','required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x145e63){const _0x2216f7=a16_0x16bb3e,_0x2a7104=_0x145e63[_0x2216f7(0x1dd)][0x0],_0x25d5ef=_0x145e63[_0x2216f7(0x1dd)][0x1];if(!_0x2a7104||_0x25d5ef===undefined)throw CliErrors[_0x2216f7(0x1f4)]('Missing\x20key\x20or\x20value.','Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20[--global]');if(ENUM_KEYS[_0x2a7104]&&!ENUM_KEYS[_0x2a7104][_0x2216f7(0x1ea)](_0x25d5ef))throw CliErrors[_0x2216f7(0x1f4)](_0x2216f7(0x1d6)+_0x2a7104+_0x2216f7(0x1c8)+ENUM_KEYS[_0x2a7104][_0x2216f7(0x1e9)](',\x20'));if(_0x2a7104==='riskLevel')throw CliErrors[_0x2216f7(0x1f4)]('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(_0x2a7104===_0x2216f7(0x1de)){const _0x310754=Number(_0x25d5ef);if(isNaN(_0x310754)||_0x310754<=0x0)throw CliErrors['validation']('pageSize\x20must\x20be\x20a\x20positive\x20number');}const _0x11cc7f=resolveWriteScope({'explicitGlobal':_0x145e63[_0x2216f7(0x1ce)](_0x2216f7(0x1db)),'policy':'project-or-global-explicit'}),_0x34fb68=toScopeFlags(_0x11cc7f),_0x43f9dc=readScopedConfig(_0x34fb68),_0x1c122f=parseAliasAppcodeSetKey(_0x2a7104);if(!_0x1c122f&&!isTopLevelConfigKey(_0x2a7104))throw CliErrors[_0x2216f7(0x1f4)](_0x2216f7(0x1fa)+_0x2a7104+_0x2216f7(0x1d9),_0x2216f7(0x1c7)+getTopLevelConfigKeySummary()+_0x2216f7(0x1dc));return _0x1c122f?setLocalAppAlias(_0x43f9dc,_0x1c122f,_0x25d5ef):_0x43f9dc[_0x2a7104]=_0x2a7104===_0x2216f7(0x1de)?Number(_0x25d5ef):_0x25d5ef,console[_0x2216f7(0x1d4)](_0x2216f7(0x208)+_0x2a7104+'`\x20=\x20\x22'+_0x25d5ef+'\x22'+(_0x11cc7f===_0x2216f7(0x1db)?_0x2216f7(0x207):'')),writeScopedConfig(_0x43f9dc,_0x34fb68),{'ok':!![]};}},deleteDef={'service':a16_0x16bb3e(0x1e4),'command':a16_0x16bb3e(0x1e8),'description':'Delete\x20a\x20config\x20value','risk':a16_0x16bb3e(0x1f2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a16_0x16bb3e(0x1d1),'description':getConfigCommandKeyDescription(),'required':!![]}],'flags':[GLOBAL_FLAG],async 'execute'(_0x55a52d){const _0x22e70c=a16_0x16bb3e,_0x182a90=_0x55a52d[_0x22e70c(0x1dd)][0x0];if(!_0x182a90)throw CliErrors['validation'](_0x22e70c(0x1e0),_0x22e70c(0x1fc)+CLI_BIN_NAME+'\x20config\x20delete\x20<key>\x20[--global]');const _0x2229fa=resolveWriteScope({'explicitGlobal':_0x55a52d[_0x22e70c(0x1ce)]('global'),'policy':_0x22e70c(0x1f7)}),_0xde53ac=toScopeFlags(_0x2229fa),_0x592f0d=readScopedConfig(_0xde53ac),_0x43de32=parseAliasDeleteKey(_0x182a90);if(_0x43de32){if(!deleteLocalAppAlias(_0x592f0d,_0x43de32))throw CliErrors['validation'](_0x22e70c(0x1ec)+_0x182a90);return console[_0x22e70c(0x1d4)](_0x22e70c(0x1f8)+_0x182a90+'`'+(_0x2229fa===_0x22e70c(0x1db)?_0x22e70c(0x207):'')),writeScopedConfig(_0x592f0d,_0xde53ac),{'ok':!![]};}if(_0x592f0d[_0x182a90]===undefined)throw CliErrors[_0x22e70c(0x1f4)](_0x22e70c(0x1f1)+_0x182a90+_0x22e70c(0x1f3));return delete _0x592f0d[_0x182a90],console[_0x22e70c(0x1d4)](_0x22e70c(0x1f8)+_0x182a90+'`'+(_0x2229fa===_0x22e70c(0x1db)?_0x22e70c(0x207):'')),writeScopedConfig(_0x592f0d,_0xde53ac),{'ok':!![]};}};export const configDefinitions=[listDef,getDef,setDef,deleteDef];
|