@lovrabet/lovrabet-cli 2.0.14-beta.5 → 2.0.14-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -0
- package/lib/commands/service/index.js +1 -0
- package/lib/commands/service/registry.js +1 -0
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -0
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +5 -5
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x16d8d3=a0_0x3a57;(function(_0x5548bd,_0x22e1b3){const _0x1c8b2e=a0_0x3a57,_0x1e67d1=_0x5548bd();while(!![]){try{const _0xadb1a2=parseInt(_0x1c8b2e(0xf2))/0x1+-parseInt(_0x1c8b2e(0x10f))/0x2+-parseInt(_0x1c8b2e(0x107))/0x3+-parseInt(_0x1c8b2e(0xf6))/0x4+-parseInt(_0x1c8b2e(0xec))/0x5*(-parseInt(_0x1c8b2e(0x111))/0x6)+parseInt(_0x1c8b2e(0xf7))/0x7+-parseInt(_0x1c8b2e(0xee))/0x8;if(_0xadb1a2===_0x22e1b3)break;else _0x1e67d1['push'](_0x1e67d1['shift']());}catch(_0x3b9cdf){_0x1e67d1['push'](_0x1e67d1['shift']());}}}(a0_0x1780,0x5f934));import{jsx as a0_0x1f71fd}from'react/jsx-runtime';import a0_0x16b099 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';function a0_0x3a57(_0x29d3e0,_0x3ded05){_0x29d3e0=_0x29d3e0-0xeb;const _0x1780f4=a0_0x1780();let _0x3a5773=_0x1780f4[_0x29d3e0];return _0x3a5773;}import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';function a0_0x1780(){const _0x1edc8d=['code','args','error','22454iqlTpn','flatMap','6PTLnvH','ExitPromptError','definition','630790RxQxdE','exitCode','1432848NqZhyf','write','\x0aCancelled.\x0a',':\x20--','739211xraKfu','hint','input','assign','3130416nXQXcn','4555019mggJEE','Hint:\x20','ERR_STREAM_DESTROYED','unknownCommand','defaultCommand','stderr','original','[preparse]\x20','length','flags','catch','exit','Error:\x20','corrected','help','ERR_USE_AFTER_CLOSE','455019SHNdYD','cancelled','slice','log','./framework/preparse.js'];a0_0x1780=function(){return _0x1edc8d;};return a0_0x1780();}import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';const helpText=generateFullHelp(),cli=a0_0x16b099(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x16d8d3(0x101)](handleError);async function main(){try{await run();}catch(_0x325747){handleError(_0x325747);}}async function run(){const _0x452c28=a0_0x16d8d3;let _0x58fa62=cli[_0x452c28(0xf4)][0x0],_0x113dc5=cli[_0x452c28(0xf4)][0x1];const _0x8dc34c=cli['flags'];try{const {correctFlags:_0x28a69c}=await import(_0x452c28(0x10b)),_0x2bb256=getAllDefinitions()[_0x452c28(0x110)](_0x31e0e1=>_0x31e0e1[_0x452c28(0x100)]??[]),{flags:_0x863f55,corrections:_0x3ce9ab}=_0x28a69c(_0x8dc34c,_0x2bb256);if(_0x3ce9ab[_0x452c28(0xff)]>0x0){for(const _0xcc241e of _0x3ce9ab){process[_0x452c28(0xfc)][_0x452c28(0xef)](_0x452c28(0xfe)+_0xcc241e['handler']+_0x452c28(0xf1)+_0xcc241e[_0x452c28(0xfd)]+'\x20->\x20--'+_0xcc241e[_0x452c28(0x104)]+'\x0a');}Object[_0x452c28(0xf5)](_0x8dc34c,_0x863f55);}}catch{}if(!_0x58fa62){const {waitUntilExit:_0x2375e3}=render(a0_0x1f71fd(Help,{}));await _0x2375e3();return;}if(!isKnownService(_0x58fa62)){const _0x152f45=resolveDynamicServiceCommand(cli[_0x452c28(0xf4)],_0x8dc34c);if(_0x152f45){if(_0x8dc34c[_0x452c28(0x105)]){console['log'](generateCommandHelp(_0x152f45[_0x452c28(0xeb)]));return;}Object[_0x452c28(0xf5)](_0x8dc34c,_0x152f45['flags']);const _0x287677=buildConfigFromFlags(_0x8dc34c);await initGlobalEnvironment(_0x287677);const _0x292559=createPipelineEnv(_0x287677,_0x8dc34c);_0x292559[_0x452c28(0x10d)]=_0x152f45[_0x452c28(0x10d)],await runCommand(_0x152f45[_0x452c28(0xeb)],_0x292559);return;}if(_0x8dc34c[_0x452c28(0x105)]){const _0x104bd3=generateDynamicServiceHelp(_0x58fa62);if(_0x104bd3){console['log'](_0x104bd3);return;}}const {waitUntilExit:_0x67df41}=render(a0_0x1f71fd(Help,{}));await _0x67df41();return;}const _0x548cff=getServiceEntry(_0x58fa62);if(!_0x113dc5){if(_0x8dc34c[_0x452c28(0x105)]){console[_0x452c28(0x10a)](generateServiceHelp(_0x58fa62));return;}if(_0x548cff[_0x452c28(0xfb)])_0x113dc5=_0x548cff[_0x452c28(0xfb)];else{console[_0x452c28(0x10a)](generateServiceHelp(_0x58fa62));return;}}const _0x2348e6=findDefinition(_0x58fa62,_0x113dc5);!_0x2348e6&&(console[_0x452c28(0x10a)](generateServiceHelp(_0x58fa62)),handleError(CliErrors[_0x452c28(0xfa)](_0x58fa62+'\x20'+_0x113dc5)));if(_0x8dc34c[_0x452c28(0x105)]){console[_0x452c28(0x10a)](generateCommandHelp(_0x2348e6));return;}const _0x494e77=buildConfigFromFlags(_0x8dc34c);await initGlobalEnvironment(_0x494e77);const _0x4b34ae=createPipelineEnv(_0x494e77,_0x8dc34c);_0x4b34ae[_0x452c28(0x10d)]=cli['input'][_0x452c28(0x109)](0x2),await runCommand(_0x2348e6,_0x4b34ae);}function handleError(_0x398724){const _0x414834=a0_0x16d8d3;if(_0x398724 instanceof CliError){_0x398724[_0x414834(0x10c)]===_0x414834(0x108)&&(process[_0x414834(0xfc)][_0x414834(0xef)]('\x0aCancelled.\x0a'),process[_0x414834(0x102)](0x0));console[_0x414834(0x10e)](_0x414834(0x103)+_0x398724['message']);if(_0x398724[_0x414834(0xf3)])console[_0x414834(0x10e)](_0x414834(0xf8)+_0x398724[_0x414834(0xf3)]);process['exit'](_0x398724[_0x414834(0xed)]);}isUserCancellation(_0x398724)&&(process[_0x414834(0xfc)][_0x414834(0xef)](_0x414834(0xf0)),process[_0x414834(0x102)](0x0)),console[_0x414834(0x10e)]('Unexpected\x20error:',_0x398724),process[_0x414834(0x102)](0x1);}function isUserCancellation(_0x542f3b){const _0x39ba08=a0_0x16d8d3;if(!(_0x542f3b instanceof Error))return![];if(_0x542f3b['name']===_0x39ba08(0x112))return!![];if(_0x542f3b[_0x39ba08(0x10c)]===_0x39ba08(0x106))return!![];if(_0x542f3b[_0x39ba08(0x10c)]===_0x39ba08(0xf9))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a1_0x59dcc5=a1_0x7f94;(function(_0x428244,_0x4f0be9){const _0x3ec22a=a1_0x7f94,_0x176bb2=_0x428244();while(!![]){try{const _0x52ed56=parseInt(_0x3ec22a(0x241))/0x1*(parseInt(_0x3ec22a(0x1f8))/0x2)+parseInt(_0x3ec22a(0x238))/0x3+-parseInt(_0x3ec22a(0x24d))/0x4*(-parseInt(_0x3ec22a(0x220))/0x5)+-parseInt(_0x3ec22a(0x221))/0x6*(-parseInt(_0x3ec22a(0x21e))/0x7)+-parseInt(_0x3ec22a(0x226))/0x8*(parseInt(_0x3ec22a(0x235))/0x9)+-parseInt(_0x3ec22a(0x22a))/0xa*(-parseInt(_0x3ec22a(0x20d))/0xb)+-parseInt(_0x3ec22a(0x23b))/0xc;if(_0x52ed56===_0x4f0be9)break;else _0x176bb2['push'](_0x176bb2['shift']());}catch(_0x313480){_0x176bb2['push'](_0x176bb2['shift']());}}}(a1_0x4769,0xcd39e));function a1_0x7f94(_0x11d90e,_0x503686){_0x11d90e=_0x11d90e-0x1e2;const _0x4769f3=a1_0x4769();let _0x7f946f=_0x4769f3[_0x11d90e];return _0x7f946f;}function a1_0x4769(){const _0x4cd914=['/api/{appCode}/{datasetCode}/create','4vMnguT','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','Filter\x20dataset\x20data','##\x20Dataset\x20detail','POST','List\x20available\x20runtime\x20API\x20documentation\x20entries','bf_execute','bf_function_list','/api/{appCode}/{datasetCode}/aggregate','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','Aggregate\x20dataset\x20data','paging\x20contains\x20pagination','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','custom_sql','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','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','List\x20BF\x20endpoint\x20functions','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','detail','tableData\x20contains\x20dataset\x20id/code/name','13607dDSomO','GET','operations\x20describes\x20runtime\x20APIs','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','fields/properties\x20describe\x20data\x20shape','Current\x20app\x20code','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','trim','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','length','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','创建数据','dataset','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','/api/{appCode}/{datasetCode}/filter','None','413wgUUQW','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','1158425lpJuTO','25458yzitUz','summary','聚合查询数据集数据','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','获取数据集详情','8bUpuVv','Returns\x20script\x20business\x20payload','keyword','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','12130DfmWxW','分页获取数据集列表','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','read','category','/api/endpoint/{appCode}/functions','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','list','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','includes','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','5121621TxStsP','/api/{appCode}/{datasetCode}/getOne','Create\x20dataset\x20record','2545617EZiUvU','需要向指定数据集新增一条业务数据时使用','method','22022712UBSROM','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','条件过滤查询数据','dataset_data_filter','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','tableData\x20contains\x20records','91087HpgfrI','dataset_data_create','paging.totalCount\x20gives\x20total\x20rows','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','code','where\x20filters\x20before\x20aggregation','32-character\x20dataset\x20code','custom_sql_execute','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','join','scriptName','Dataset\x20detail','8BoCjgu','string','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','执行自定义\x20SQL','Returns\x20endpoint\x20functionName/id/description','str','validation','api-doc','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','{\x22id\x22:123}','/api/dataset/get-dataset-list-by-app-code','result\x20rows\x20contain\x20aggregate\x20aliases','toLowerCase','查询单条数据','whenToUse','appCode','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','Show\x20runtime\x20API\x20documentation\x20by\x20code','Get\x20one\x20dataset\x20record','find','datasetCode','dataset_data_get_one','API\x20doc\x20code,\x20for\x20example\x20dataset_list','/api/custom/executeSql','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','dataset_data_aggregate','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','##\x20List\x20datasets','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用'];a1_0x4769=function(){return _0x4cd914;};return a1_0x4769();}import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x59dcc5(0x22e),'type':a1_0x59dcc5(0x24e),'description':a1_0x59dcc5(0x1e2)},KEYWORD_FLAG={'name':a1_0x59dcc5(0x228),'type':a1_0x59dcc5(0x24e),'description':a1_0x59dcc5(0x204)},DOC_CODE_FLAG={'name':a1_0x59dcc5(0x245),'type':'string','required':!![],'description':a1_0x59dcc5(0x1f0)},DOCS=[{'code':'dataset_list','category':a1_0x59dcc5(0x219),'title':'List\x20datasets','method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x1e4),'summary':a1_0x59dcc5(0x22b),'whenToUse':a1_0x59dcc5(0x1f6),'pathParams':[],'queryParams':[],'bodySchema':a1_0x59dcc5(0x210),'responseHighlights':[a1_0x59dcc5(0x20c),a1_0x59dcc5(0x243)],'examples':[a1_0x59dcc5(0x23f)],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':[a1_0x59dcc5(0x1f5),'','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.'][a1_0x59dcc5(0x24a)]('\x0a')},{'code':'dataset_detail','category':a1_0x59dcc5(0x219),'title':a1_0x59dcc5(0x24c),'method':'GET','path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x59dcc5(0x225),'whenToUse':'需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','pathParams':[],'queryParams':[{'name':a1_0x59dcc5(0x245),'description':a1_0x59dcc5(0x247)}],'bodySchema':'None','responseHighlights':[a1_0x59dcc5(0x211),a1_0x59dcc5(0x20f)],'examples':[a1_0x59dcc5(0x201)],'notes':[a1_0x59dcc5(0x244)],'markdown':[a1_0x59dcc5(0x1fb),'','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x59dcc5(0x24a)]('\x0a')},{'code':a1_0x59dcc5(0x23e),'category':a1_0x59dcc5(0x219),'title':a1_0x59dcc5(0x1fa),'method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x21c),'summary':a1_0x59dcc5(0x23d),'whenToUse':a1_0x59dcc5(0x21a),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x59dcc5(0x1ee),'description':a1_0x59dcc5(0x247)}],'queryParams':[],'bodySchema':a1_0x59dcc5(0x1f2),'responseHighlights':[a1_0x59dcc5(0x240),a1_0x59dcc5(0x203)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27'],'notes':[a1_0x59dcc5(0x22c)],'markdown':['##\x20Filter\x20dataset\x20data','',a1_0x59dcc5(0x215)]['join']('\x0a')},{'code':a1_0x59dcc5(0x1f3),'category':a1_0x59dcc5(0x219),'title':a1_0x59dcc5(0x202),'method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x200),'summary':a1_0x59dcc5(0x223),'whenToUse':a1_0x59dcc5(0x249),'pathParams':[{'name':a1_0x59dcc5(0x1e9),'description':a1_0x59dcc5(0x212)},{'name':a1_0x59dcc5(0x1ee),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x59dcc5(0x1e5),a1_0x59dcc5(0x246)],'examples':[a1_0x59dcc5(0x208)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.'],'markdown':['##\x20Aggregate\x20dataset\x20data','',a1_0x59dcc5(0x1f9)][a1_0x59dcc5(0x24a)]('\x0a')},{'code':a1_0x59dcc5(0x1ef),'category':a1_0x59dcc5(0x219),'title':a1_0x59dcc5(0x1ec),'method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x236),'summary':a1_0x59dcc5(0x1e7),'whenToUse':a1_0x59dcc5(0x230),'pathParams':[{'name':a1_0x59dcc5(0x1e9),'description':a1_0x59dcc5(0x212)},{'name':a1_0x59dcc5(0x1ee),'description':a1_0x59dcc5(0x247)}],'queryParams':[],'bodySchema':a1_0x59dcc5(0x1e3),'responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':[a1_0x59dcc5(0x1ea)],'notes':[a1_0x59dcc5(0x213)],'markdown':'##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.'},{'code':a1_0x59dcc5(0x242),'category':'dataset','title':a1_0x59dcc5(0x237),'method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x1f7),'summary':a1_0x59dcc5(0x218),'whenToUse':a1_0x59dcc5(0x239),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x59dcc5(0x1ee),'description':a1_0x59dcc5(0x247)}],'queryParams':[],'bodySchema':'{\x22fieldName\x22:\x22value\x22}','responseHighlights':[a1_0x59dcc5(0x206)],'examples':[a1_0x59dcc5(0x21b)],'notes':[a1_0x59dcc5(0x207)],'markdown':a1_0x59dcc5(0x234)},{'code':a1_0x59dcc5(0x1ff),'category':'bf','title':a1_0x59dcc5(0x209),'method':a1_0x59dcc5(0x20e),'path':a1_0x59dcc5(0x22f),'summary':'获取应用下可调用的\x20BF\x20函数列表','whenToUse':a1_0x59dcc5(0x229),'pathParams':[{'name':a1_0x59dcc5(0x1e9),'description':a1_0x59dcc5(0x212)}],'queryParams':[],'bodySchema':a1_0x59dcc5(0x21d),'responseHighlights':[a1_0x59dcc5(0x251)],'examples':[a1_0x59dcc5(0x20a)],'notes':[a1_0x59dcc5(0x1f4)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x59dcc5(0x1fe),'category':'bf','title':'Execute\x20BF\x20endpoint\x20function','method':a1_0x59dcc5(0x1fc),'path':'/api/endpoint/{appCode}/{scriptName}','summary':'执行指定\x20BF\x20函数','whenToUse':a1_0x59dcc5(0x23c),'pathParams':[{'name':'appCode','description':a1_0x59dcc5(0x212)},{'name':a1_0x59dcc5(0x24b),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':'{\x22param\x22:\x22value\x22}','responseHighlights':[a1_0x59dcc5(0x227)],'examples':[a1_0x59dcc5(0x224)],'notes':['Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.'],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':a1_0x59dcc5(0x248),'category':a1_0x59dcc5(0x205),'title':'Execute\x20custom\x20SQL','method':a1_0x59dcc5(0x1fc),'path':a1_0x59dcc5(0x1f1),'summary':a1_0x59dcc5(0x250),'whenToUse':a1_0x59dcc5(0x232),'pathParams':[],'queryParams':[],'bodySchema':a1_0x59dcc5(0x217),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x59dcc5(0x21f)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x59dcc5(0x24f)}];function entrySummary(_0x446231){const _0x5bb79b=a1_0x59dcc5;return{'code':_0x446231[_0x5bb79b(0x245)],'category':_0x446231[_0x5bb79b(0x22e)],'method':_0x446231[_0x5bb79b(0x23a)],'path':_0x446231['path'],'summary':_0x446231[_0x5bb79b(0x222)],'whenToUse':_0x446231[_0x5bb79b(0x1e8)]};}export function listApiDocEntries(_0x37a665={}){const _0x5bbfd2=a1_0x59dcc5,_0x417ce4=String(_0x37a665[_0x5bbfd2(0x22e)]||'')[_0x5bbfd2(0x214)](),_0x1e8960=String(_0x37a665['keyword']||'')[_0x5bbfd2(0x214)]()['toLowerCase']();return DOCS['filter'](_0x227706=>{const _0x1bb6c6=_0x5bbfd2;if(_0x417ce4&&_0x227706[_0x1bb6c6(0x22e)]!==_0x417ce4)return![];if(!_0x1e8960)return!![];return[_0x227706['code'],_0x227706[_0x1bb6c6(0x22e)],_0x227706[_0x1bb6c6(0x23a)],_0x227706['path'],_0x227706[_0x1bb6c6(0x222)],_0x227706[_0x1bb6c6(0x1e8)],_0x227706['title']][_0x1bb6c6(0x24a)]('\x20')[_0x1bb6c6(0x1e6)]()[_0x1bb6c6(0x233)](_0x1e8960);})['map'](entrySummary);}export function getApiDocDetail(_0x5d83b7){const _0x1cd4ff=a1_0x59dcc5,_0x174bd1=DOCS[_0x1cd4ff(0x1ed)](_0x1abea5=>_0x1abea5[_0x1cd4ff(0x245)]===_0x5d83b7);if(!_0x174bd1)throw CliErrors[_0x1cd4ff(0x253)]('API\x20doc\x20code\x20not\x20found:\x20'+_0x5d83b7);return{..._0x174bd1};}const apiDocList={'service':a1_0x59dcc5(0x254),'command':a1_0x59dcc5(0x231),'description':a1_0x59dcc5(0x1fd),'risk':a1_0x59dcc5(0x22d),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x5770b8){const _0x2ec9c6=a1_0x59dcc5,_0x148afa=listApiDocEntries({'category':_0x5770b8['str'](_0x2ec9c6(0x22e)),'keyword':_0x5770b8[_0x2ec9c6(0x252)](_0x2ec9c6(0x228))});return{'ok':!![],'data':{'total':_0x148afa[_0x2ec9c6(0x216)],'items':_0x148afa}};}},apiDocDetail={'service':a1_0x59dcc5(0x254),'command':a1_0x59dcc5(0x20b),'description':a1_0x59dcc5(0x1eb),'risk':a1_0x59dcc5(0x22d),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x24082f){const _0x3366c4=a1_0x59dcc5;return{'ok':!![],'data':getApiDocDetail(_0x24082f['str'](_0x3366c4(0x245)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
1
|
+
function a1_0x368d(_0xe99b16,_0x188e41){_0xe99b16=_0xe99b16-0x145;const _0x1d73c9=a1_0x1d73();let _0x368ddc=_0x1d73c9[_0xe99b16];return _0x368ddc;}const a1_0x2ddcf8=a1_0x368d;(function(_0xfdaf6b,_0x37fcaa){const _0x3b7f3b=a1_0x368d,_0x48267b=_0xfdaf6b();while(!![]){try{const _0x30b372=-parseInt(_0x3b7f3b(0x1ba))/0x1*(-parseInt(_0x3b7f3b(0x1ab))/0x2)+parseInt(_0x3b7f3b(0x193))/0x3*(-parseInt(_0x3b7f3b(0x177))/0x4)+-parseInt(_0x3b7f3b(0x1b1))/0x5+parseInt(_0x3b7f3b(0x18b))/0x6+parseInt(_0x3b7f3b(0x1ad))/0x7+-parseInt(_0x3b7f3b(0x150))/0x8*(-parseInt(_0x3b7f3b(0x197))/0x9)+-parseInt(_0x3b7f3b(0x1b0))/0xa*(parseInt(_0x3b7f3b(0x189))/0xb);if(_0x30b372===_0x37fcaa)break;else _0x48267b['push'](_0x48267b['shift']());}catch(_0x343b85){_0x48267b['push'](_0x48267b['shift']());}}}(a1_0x1d73,0xeab66));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x2ddcf8(0x14a),'type':'string','description':a1_0x2ddcf8(0x1b8)},KEYWORD_FLAG={'name':a1_0x2ddcf8(0x1b7),'type':a1_0x2ddcf8(0x153),'description':a1_0x2ddcf8(0x16c)},DOC_CODE_FLAG={'name':'code','type':a1_0x2ddcf8(0x153),'required':!![],'description':a1_0x2ddcf8(0x171)},DOCS=[{'code':a1_0x2ddcf8(0x1bb),'category':a1_0x2ddcf8(0x1a3),'title':a1_0x2ddcf8(0x19a),'method':'POST','path':a1_0x2ddcf8(0x16f),'summary':a1_0x2ddcf8(0x170),'whenToUse':a1_0x2ddcf8(0x161),'pathParams':[],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x1a2),'responseHighlights':[a1_0x2ddcf8(0x166),a1_0x2ddcf8(0x15e)],'examples':[a1_0x2ddcf8(0x1a4)],'notes':[a1_0x2ddcf8(0x147)],'markdown':[a1_0x2ddcf8(0x1b2),'',a1_0x2ddcf8(0x179)][a1_0x2ddcf8(0x1a1)]('\x0a')},{'code':a1_0x2ddcf8(0x165),'category':'dataset','title':'Dataset\x20detail','method':a1_0x2ddcf8(0x187),'path':a1_0x2ddcf8(0x14c),'summary':a1_0x2ddcf8(0x18a),'whenToUse':a1_0x2ddcf8(0x160),'pathParams':[],'queryParams':[{'name':a1_0x2ddcf8(0x1b3),'description':a1_0x2ddcf8(0x184)}],'bodySchema':a1_0x2ddcf8(0x14b),'responseHighlights':[a1_0x2ddcf8(0x168),a1_0x2ddcf8(0x1a8)],'examples':[a1_0x2ddcf8(0x164)],'notes':[a1_0x2ddcf8(0x1a0)],'markdown':['##\x20Dataset\x20detail','','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x2ddcf8(0x1a1)]('\x0a')},{'code':a1_0x2ddcf8(0x1b6),'category':a1_0x2ddcf8(0x1a3),'title':a1_0x2ddcf8(0x1a7),'method':a1_0x2ddcf8(0x186),'path':a1_0x2ddcf8(0x182),'summary':a1_0x2ddcf8(0x178),'whenToUse':'需要携带\x20where、orderBy、分页等条件读取业务数据时使用','pathParams':[{'name':a1_0x2ddcf8(0x15d),'description':a1_0x2ddcf8(0x1ae)},{'name':a1_0x2ddcf8(0x16b),'description':a1_0x2ddcf8(0x184)}],'queryParams':[],'bodySchema':'{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','responseHighlights':['tableData\x20contains\x20records',a1_0x2ddcf8(0x154)],'examples':[a1_0x2ddcf8(0x19d)],'notes':[a1_0x2ddcf8(0x181)],'markdown':[a1_0x2ddcf8(0x173),'',a1_0x2ddcf8(0x183)][a1_0x2ddcf8(0x1a1)]('\x0a')},{'code':a1_0x2ddcf8(0x1a6),'category':a1_0x2ddcf8(0x1a3),'title':a1_0x2ddcf8(0x1af),'method':a1_0x2ddcf8(0x186),'path':a1_0x2ddcf8(0x185),'summary':a1_0x2ddcf8(0x162),'whenToUse':a1_0x2ddcf8(0x159),'pathParams':[{'name':a1_0x2ddcf8(0x15d),'description':a1_0x2ddcf8(0x1ae)},{'name':a1_0x2ddcf8(0x16b),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':['result\x20rows\x20contain\x20aggregate\x20aliases','where\x20filters\x20before\x20aggregation'],'examples':['lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22column\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27'],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.',a1_0x2ddcf8(0x1a5)],'markdown':[a1_0x2ddcf8(0x16d),'',a1_0x2ddcf8(0x199)][a1_0x2ddcf8(0x1a1)]('\x0a')},{'code':a1_0x2ddcf8(0x14d),'category':a1_0x2ddcf8(0x1a3),'title':a1_0x2ddcf8(0x16a),'method':a1_0x2ddcf8(0x186),'path':a1_0x2ddcf8(0x16e),'summary':'查询单条数据','whenToUse':a1_0x2ddcf8(0x19e),'pathParams':[{'name':'appCode','description':a1_0x2ddcf8(0x1ae)},{'name':a1_0x2ddcf8(0x16b),'description':a1_0x2ddcf8(0x184)}],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x192),'responseHighlights':[a1_0x2ddcf8(0x176)],'examples':[a1_0x2ddcf8(0x191)],'notes':[a1_0x2ddcf8(0x17e)],'markdown':a1_0x2ddcf8(0x18f)},{'code':a1_0x2ddcf8(0x146),'category':a1_0x2ddcf8(0x1a3),'title':'Create\x20dataset\x20record','method':a1_0x2ddcf8(0x186),'path':a1_0x2ddcf8(0x15b),'summary':'创建数据','whenToUse':a1_0x2ddcf8(0x14e),'pathParams':[{'name':a1_0x2ddcf8(0x15d),'description':a1_0x2ddcf8(0x1ae)},{'name':a1_0x2ddcf8(0x16b),'description':a1_0x2ddcf8(0x184)}],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x1ac),'responseHighlights':[a1_0x2ddcf8(0x156)],'examples':['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27'],'notes':[a1_0x2ddcf8(0x18e)],'markdown':'##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.'},{'code':a1_0x2ddcf8(0x1bc),'category':'bf','title':a1_0x2ddcf8(0x198),'method':'GET','path':'/api/endpoint/{appCode}/functions','summary':a1_0x2ddcf8(0x14f),'whenToUse':a1_0x2ddcf8(0x17b),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'}],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x14b),'responseHighlights':[a1_0x2ddcf8(0x1b4)],'examples':[a1_0x2ddcf8(0x151)],'notes':[a1_0x2ddcf8(0x175)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x2ddcf8(0x1a9),'category':'bf','title':a1_0x2ddcf8(0x149),'method':a1_0x2ddcf8(0x186),'path':'/api/endpoint/{appCode}/{scriptName}','summary':a1_0x2ddcf8(0x163),'whenToUse':a1_0x2ddcf8(0x145),'pathParams':[{'name':a1_0x2ddcf8(0x15d),'description':'Current\x20app\x20code'},{'name':a1_0x2ddcf8(0x195),'description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x167),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x2ddcf8(0x158)],'notes':[a1_0x2ddcf8(0x17c)],'markdown':a1_0x2ddcf8(0x1aa)},{'code':a1_0x2ddcf8(0x190),'category':a1_0x2ddcf8(0x19c),'title':a1_0x2ddcf8(0x174),'method':'POST','path':a1_0x2ddcf8(0x157),'summary':a1_0x2ddcf8(0x18d),'whenToUse':a1_0x2ddcf8(0x17a),'pathParams':[],'queryParams':[],'bodySchema':a1_0x2ddcf8(0x172),'responseHighlights':[a1_0x2ddcf8(0x18c)],'examples':['lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27'],'notes':[a1_0x2ddcf8(0x169)],'markdown':'##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.'}];function entrySummary(_0x54d406){const _0x1d8a5c=a1_0x2ddcf8;return{'code':_0x54d406[_0x1d8a5c(0x1b3)],'category':_0x54d406[_0x1d8a5c(0x14a)],'method':_0x54d406[_0x1d8a5c(0x155)],'path':_0x54d406[_0x1d8a5c(0x188)],'summary':_0x54d406[_0x1d8a5c(0x194)],'whenToUse':_0x54d406[_0x1d8a5c(0x196)]};}export function listApiDocEntries(_0x15b6cf={}){const _0x4f5c66=a1_0x2ddcf8,_0x30d294=String(_0x15b6cf[_0x4f5c66(0x14a)]||'')['trim'](),_0x12f2a2=String(_0x15b6cf[_0x4f5c66(0x1b7)]||'')[_0x4f5c66(0x19b)]()[_0x4f5c66(0x15a)]();return DOCS[_0x4f5c66(0x17d)](_0x1c212e=>{const _0xb53d0d=_0x4f5c66;if(_0x30d294&&_0x1c212e[_0xb53d0d(0x14a)]!==_0x30d294)return![];if(!_0x12f2a2)return!![];return[_0x1c212e[_0xb53d0d(0x1b3)],_0x1c212e[_0xb53d0d(0x14a)],_0x1c212e['method'],_0x1c212e[_0xb53d0d(0x188)],_0x1c212e['summary'],_0x1c212e['whenToUse'],_0x1c212e['title']][_0xb53d0d(0x1a1)]('\x20')['toLowerCase']()[_0xb53d0d(0x1b9)](_0x12f2a2);})[_0x4f5c66(0x152)](entrySummary);}function a1_0x1d73(){const _0x4e846c=['paging.totalCount\x20gives\x20total\x20rows','find','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','聚合查询数据集数据','执行指定\x20BF\x20函数','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','dataset_detail','tableData\x20contains\x20dataset\x20id/code/name','{\x22param\x22:\x22value\x22}','fields/properties\x20describe\x20data\x20shape','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','Get\x20one\x20dataset\x20record','datasetCode','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','##\x20Aggregate\x20dataset\x20data','/api/{appCode}/{datasetCode}/getOne','/api/dataset/get-dataset-list-by-app-code','分页获取数据集列表','API\x20doc\x20code,\x20for\x20example\x20dataset_list','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','##\x20Filter\x20dataset\x20data','Execute\x20custom\x20SQL','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','Returns\x20one\x20matching\x20business\x20record','4pTXZko','条件过滤查询数据','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','filter','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','length','detail','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','/api/{appCode}/{datasetCode}/filter','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','32-character\x20dataset\x20code','/api/{appCode}/{datasetCode}/aggregate','POST','GET','path','44836DKqtjN','获取数据集详情','1792446iOYkzG','Returns\x20SQL\x20execution\x20payload','执行自定义\x20SQL','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','custom_sql_execute','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','{\x22id\x22:123}','1926897aWrRVp','summary','scriptName','whenToUse','9bQIWli','List\x20BF\x20endpoint\x20functions','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','List\x20datasets','trim','custom_sql','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','str','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','join','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','dataset','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','dataset_data_aggregate','Filter\x20dataset\x20data','operations\x20describes\x20runtime\x20APIs','bf_execute','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','38LJHLXh','{\x22fieldName\x22:\x22value\x22}','7826343KJLBZL','Current\x20app\x20code','Aggregate\x20dataset\x20data','3820GRXYcS','159980PkGTMM','##\x20List\x20datasets','code','Returns\x20endpoint\x20functionName/id/description','read','dataset_data_filter','keyword','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','includes','71789AXhnVk','dataset_list','bf_function_list','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','dataset_data_create','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','api-doc','Execute\x20BF\x20endpoint\x20function','category','None','/api/dataset/getOneByCode?code={datasetCode}','dataset_data_get_one','需要向指定数据集新增一条业务数据时使用','获取应用下可调用的\x20BF\x20函数列表','3295424QpbrwN','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','map','string','paging\x20contains\x20pagination','method','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','/api/custom/executeSql','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','toLowerCase','/api/{appCode}/{datasetCode}/create','List\x20available\x20runtime\x20API\x20documentation\x20entries','appCode'];a1_0x1d73=function(){return _0x4e846c;};return a1_0x1d73();}export function getApiDocDetail(_0x218de1){const _0x31cde2=a1_0x2ddcf8,_0x12d79b=DOCS[_0x31cde2(0x15f)](_0x5e8f30=>_0x5e8f30['code']===_0x218de1);if(!_0x12d79b)throw CliErrors['validation']('API\x20doc\x20code\x20not\x20found:\x20'+_0x218de1);return{..._0x12d79b};}const apiDocList={'service':a1_0x2ddcf8(0x148),'command':'list','description':a1_0x2ddcf8(0x15c),'risk':a1_0x2ddcf8(0x1b5),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x3293d9){const _0x2d9939=a1_0x2ddcf8,_0x3ed8dc=listApiDocEntries({'category':_0x3293d9[_0x2d9939(0x19f)](_0x2d9939(0x14a)),'keyword':_0x3293d9['str'](_0x2d9939(0x1b7))});return{'ok':!![],'data':{'total':_0x3ed8dc[_0x2d9939(0x17f)],'items':_0x3ed8dc}};}},apiDocDetail={'service':a1_0x2ddcf8(0x148),'command':a1_0x2ddcf8(0x180),'description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x2ddcf8(0x1b5),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x3665f4){const _0x3404ce=a1_0x2ddcf8;return{'ok':!![],'data':getApiDocDetail(_0x3665f4['str'](_0x3404ce(0x1b3)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x33fdb9,_0x3ca462){const _0x429bfa=a2_0x1980,_0x4c1d8a=_0x33fdb9();while(!![]){try{const _0x3ef7e7=parseInt(_0x429bfa(0xe3))/0x1+parseInt(_0x429bfa(0xd9))/0x2+-parseInt(_0x429bfa(0xe1))/0x3*(parseInt(_0x429bfa(0xea))/0x4)+parseInt(_0x429bfa(0xd4))/0x5*(parseInt(_0x429bfa(0xd8))/0x6)+parseInt(_0x429bfa(0xd5))/0x7+parseInt(_0x429bfa(0xe6))/0x8*(-parseInt(_0x429bfa(0xdf))/0x9)+-parseInt(_0x429bfa(0xd6))/0xa*(parseInt(_0x429bfa(0xe0))/0xb);if(_0x3ef7e7===_0x3ca462)break;else _0x4c1d8a['push'](_0x4c1d8a['shift']());}catch(_0x4bd198){_0x4c1d8a['push'](_0x4c1d8a['shift']());}}}(a2_0x4a7c,0x2ee93));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a2_0x4a7c(){const _0x22027a=['items','823314AIfFCM','17568gvLCNB','code','stringify','digest','update','find','2799emiwSB','99FaNOFd','3eVlwsD','EXDEV','315654LXrIKU','trim','.tmp','4456EUFbYH','my-apps.json','slice','appName','459280pOCaKd','appCode','isArray','utf8','unknown','5relFpt','436695JEbDmw','48720IWaEtT'];a2_0x4a7c=function(){return _0x22027a;};return a2_0x4a7c();}import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a2_0x1980(_0x58bd62,_0x34c54e){_0x58bd62=_0x58bd62-0xd4;const _0x4a7c30=a2_0x4a7c();let _0x198037=_0x4a7c30[_0x58bd62];return _0x198037;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x48901f){const _0x22906a=a2_0x1980,_0x26086e=_0x48901f['trim'](),_0x4da729=_0x26086e[_0x22906a(0xe8)](-0x6)||_0x22906a(0xee),_0x399b35=createHash('sha256')[_0x22906a(0xdd)](_0x26086e)[_0x22906a(0xdc)]('hex')[_0x22906a(0xe8)](0x0,0xc);return'ak_'+_0x4da729+'_'+_0x399b35;}export function getAppCacheFilePath(_0xbd163b,_0x2e4cb3){const _0x251f7e=a2_0x1980;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],'cache',_0xbd163b,fingerprintAccessKey(_0x2e4cb3),_0x251f7e(0xe7));}export function readCachedAppList(_0x253a57,_0xabf6c6){const _0x5c49b7=a2_0x1980;if(!_0xabf6c6?.['trim']())return null;const _0x1dfb8d=getAppCacheFilePath(_0x253a57,_0xabf6c6);if(!existsSync(_0x1dfb8d))return null;try{const _0x372e16=readFileSync(_0x1dfb8d,_0x5c49b7(0xed));if(!_0x372e16['trim']())return null;const _0x598b83=JSON['parse'](_0x372e16);if(!Array[_0x5c49b7(0xec)](_0x598b83[_0x5c49b7(0xd7)]))return null;return _0x598b83;}catch{return null;}}export function writeCachedAppList(_0x3f6350,_0x44c963,_0x2aa5e0){const _0xa1b4ab=a2_0x1980,_0x510e34=getAppCacheFilePath(_0x3f6350,_0x44c963),_0x2a7896=dirname(_0x510e34);!existsSync(_0x2a7896)&&mkdirSync(_0x2a7896,{'recursive':!![]});const _0x17b076=_0x510e34+_0xa1b4ab(0xe5);try{writeFileSync(_0x17b076,JSON[_0xa1b4ab(0xdb)](_0x2aa5e0,null,0x2)+'\x0a',{'encoding':_0xa1b4ab(0xed),'mode':0x180});try{renameSync(_0x17b076,_0x510e34);}catch(_0x373baa){if(_0x373baa['code']==='EPERM'||_0x373baa[_0xa1b4ab(0xda)]===_0xa1b4ab(0xe2)||_0x373baa[_0xa1b4ab(0xda)]==='EACCES'){writeFileSync(_0x510e34,JSON[_0xa1b4ab(0xdb)](_0x2aa5e0,null,0x2)+'\x0a',{'encoding':_0xa1b4ab(0xed)});try{unlinkSync(_0x17b076);}catch{}}else throw _0x373baa;}}catch(_0x3547f8){try{unlinkSync(_0x17b076);}catch{}throw _0x3547f8;}return _0x510e34;}export function resolveCachedAppCode(_0x307238,_0x3cc2b3,_0x563ef5){const _0x18ada0=a2_0x1980;if(!_0x307238)return undefined;const _0x219282=readCachedAppList(_0x3cc2b3,_0x563ef5),_0x5689eb=_0x219282?.[_0x18ada0(0xd7)][_0x18ada0(0xde)](_0x1ee2a9=>_0x1ee2a9[_0x18ada0(0xe9)]===_0x307238&&isRuntimeAccessibleApp(_0x1ee2a9));return _0x5689eb?.[_0x18ada0(0xeb)]?.[_0x18ada0(0xe4)]()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a3_0x3c9e89=a3_0x3dc5;(function(_0x4aff48,_0x26f6db){const _0x1de98c=a3_0x3dc5,_0x47ce28=_0x4aff48();while(!![]){try{const _0x8eb4ef=-parseInt(_0x1de98c(0xb3))/0x1*(parseInt(_0x1de98c(0xb6))/0x2)+parseInt(_0x1de98c(0xac))/0x3*(-parseInt(_0x1de98c(0x74))/0x4)+-parseInt(_0x1de98c(0xb8))/0x5*(parseInt(_0x1de98c(0xc1))/0x6)+-parseInt(_0x1de98c(0xb4))/0x7+-parseInt(_0x1de98c(0x7b))/0x8+parseInt(_0x1de98c(0xa3))/0x9+parseInt(_0x1de98c(0xb1))/0xa*(parseInt(_0x1de98c(0x89))/0xb);if(_0x8eb4ef===_0x26f6db)break;else _0x47ce28['push'](_0x47ce28['shift']());}catch(_0x36b30a){_0x47ce28['push'](_0x47ce28['shift']());}}}(a3_0x2bf0,0x583c0));import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';function a3_0x3dc5(_0x44e7db,_0x33cbd5){_0x44e7db=_0x44e7db-0x6f;const _0x2bf03d=a3_0x2bf0();let _0x3dc554=_0x2bf03d[_0x44e7db];return _0x3dc554;}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';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':a3_0x3c9e89(0xbb),'type':'boolean','description':a3_0x3c9e89(0x9c),'default':![]};function collectFlags(_0x3d1355,_0x501095){const _0xd48307=a3_0x3c9e89,_0x4f1f4c={};for(const _0x30a817 of _0x501095){const _0xc0f74b=_0x30a817[_0xd48307(0xa5)]==='boolean'?_0x3d1355[_0xd48307(0xaf)](_0x30a817[_0xd48307(0xad)]):_0x3d1355['str'](_0x30a817[_0xd48307(0xad)]);if(_0xc0f74b!==''&&_0xc0f74b!==![])_0x4f1f4c[_0x30a817[_0xd48307(0xad)]]=_0xc0f74b;}if(_0x3d1355[_0xd48307(0x7c)])_0x4f1f4c[_0xd48307(0x7c)]=!![];return _0x4f1f4c;}function normalizeLanguages(_0x2e8254){const _0x37be90=a3_0x3c9e89;if(!Array[_0x37be90(0xaa)](_0x2e8254))return[];return _0x2e8254[_0x37be90(0x90)](_0x41cd2b=>typeof _0x41cd2b===_0x37be90(0xc3))[_0x37be90(0x8e)](_0x5484b9=>_0x5484b9[_0x37be90(0xc8)]())[_0x37be90(0x90)](Boolean);}function buildRemoteAppI18nFields(_0x3579e7){const _0x736c3f=a3_0x3c9e89,_0x54422a=normalizeLanguages(_0x3579e7[_0x736c3f(0xc7)]?.[_0x736c3f(0x8b)]);return{'enableI18n':typeof _0x3579e7[_0x736c3f(0x8f)]===_0x736c3f(0xb9)?_0x3579e7[_0x736c3f(0x8f)]:null,'languages':_0x54422a,'i18nInfo':_0x3579e7[_0x736c3f(0xc7)]?{..._0x3579e7['i18nInfo'],'langs':_0x54422a[_0x736c3f(0x8c)]?_0x54422a:null}:null};}const initDef={'service':a3_0x3c9e89(0x99),'command':a3_0x3c9e89(0xa8),'description':a3_0x3c9e89(0xc6)+PRODUCT_CONFIG['newConfigFileName']+a3_0x3c9e89(0x88),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x131888){return await runInit(collectFlags(_0x131888,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':'app','command':a3_0x3c9e89(0xa1),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':a3_0x3c9e89(0xca),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x3c9e89(0xbe),'type':'string','description':a3_0x3c9e89(0x84),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x3c9e89(0x79),'type':a3_0x3c9e89(0xb9),'description':a3_0x3c9e89(0xc2),'default':![]},{'name':a3_0x3c9e89(0xab),'type':'boolean','description':a3_0x3c9e89(0xbc),'default':![]},{'name':a3_0x3c9e89(0x7f),'type':a3_0x3c9e89(0xb9),'description':a3_0x3c9e89(0x6f),'default':![]}],async 'execute'(_0x51c1ae){const _0x38c6bc=a3_0x3c9e89,_0x22f843=_0x51c1ae['str']('env')||_0x51c1ae[_0x38c6bc(0x85)]||getEnv()||_0x38c6bc(0xb0),_0xb225b0=_0x51c1ae['bool']('local'),_0x2003a0=_0x51c1ae[_0x38c6bc(0xaf)](_0x38c6bc(0xab)),_0x3b5d0b=_0x51c1ae[_0x38c6bc(0xaf)]('include-unpublished'),{readRawConfigWithLayers:_0x1467b1,resolveDefaultAppSource:_0x48ebc7,getLocalAppAliases:_0x545bf3}=await import(_0x38c6bc(0x82)),{getRemoteAppList:_0xe6459f}=await import(_0x38c6bc(0x87)),{config:_0xca1646,layers:_0x4ee738}=_0x1467b1(),_0xf43428=_0x48ebc7(_0x4ee738),{defaultApp:_0x112701}=_0xca1646,_0x17bcb6=await _0xe6459f({'env':_0x22f843,'accessKey':_0x51c1ae[_0x38c6bc(0xc5)],'localOnly':_0xb225b0,'noCache':_0x2003a0}),_0x22d683=_0x3b5d0b?_0x17bcb6[_0x38c6bc(0x78)]:filterRuntimeAccessibleApps(_0x17bcb6[_0x38c6bc(0x78)]),_0x59441d=_0x17bcb6[_0x38c6bc(0x78)]['length']-_0x22d683[_0x38c6bc(0x8c)],_0x15d722=_0x22d683['map'](_0x171ac1=>{const _0x55dfae=_0x38c6bc;return{'name':_0x171ac1[_0x55dfae(0xba)],'appcode':_0x171ac1['appCode'],'named':!![],'definedIn':_0x55dfae(0x75),'isDefault':_0x171ac1[_0x55dfae(0xba)]===_0x112701,...buildAppProfileListFields(_0x22f843),...buildRemoteAppI18nFields(_0x171ac1),'source':_0x17bcb6[_0x55dfae(0xbd)],'owner':_0x171ac1[_0x55dfae(0xa0)]??null,'status':_0x171ac1['appPublishStatus']??null,'cachedAt':_0x17bcb6[_0x55dfae(0x70)]};}),_0xc6e4d7=_0x545bf3(_0xca1646);let _0x52752e=0x0;for(const [_0x1db60a,_0x147ae8]of Object[_0x38c6bc(0x8d)](_0xc6e4d7)){const _0x27b905=typeof _0x147ae8['appcode']===_0x38c6bc(0xc3)?_0x147ae8[_0x38c6bc(0x92)][_0x38c6bc(0xc8)]():'';if(!_0x27b905)continue;const _0x332431=findAppByCode(_0x17bcb6[_0x38c6bc(0x78)],_0x27b905);if(!_0x3b5d0b&&_0x332431&&!isRuntimeAccessibleApp(_0x332431))continue;_0x52752e+=0x1,_0x15d722[_0x38c6bc(0x73)]({'name':_0x1db60a,'appcode':_0x27b905,'named':!![],'definedIn':'local','isDefault':_0x1db60a===_0x112701,...buildAppProfileListFields(_0x22f843),'source':_0x38c6bc(0xb7),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x15d722,_0x51c1ae[_0x38c6bc(0x91)]);const _0x2bd48b=_0x15d722['find'](_0x888c2e=>_0x888c2e[_0x38c6bc(0x9b)]===!![]),_0x2febad=_0x112701??_0x2bd48b?.[_0x38c6bc(0xad)]??null,_0x35b883={'env':_0x22f843,'source':_0x17bcb6['source'],'fetchedAt':_0x17bcb6[_0x38c6bc(0x70)],'cachePath':_0x17bcb6['cachePath'],'globalPath':_0x4ee738[_0x38c6bc(0x83)]??null,'projectPath':_0x4ee738[_0x38c6bc(0x77)]??null,'defaultApp':_0x2febad,'defaultAppSource':_0x112701!=null?_0xf43428:null,'localAliasCount':_0x52752e,'remoteTotal':_0x17bcb6[_0x38c6bc(0x78)][_0x38c6bc(0x8c)],'hiddenUnpublishedCount':_0x59441d,'includeUnpublished':_0x3b5d0b};if(_0x15d722[_0x38c6bc(0x8c)]===0x0)return{'ok':!![],'data':{'items':_0x15d722,'meta':_0x35b883},'message':_0x17bcb6['source']===_0x38c6bc(0xb2)?_0x38c6bc(0x8a):_0x38c6bc(0x96)};return{'ok':!![],'data':{'items':_0x15d722,'meta':_0x35b883}};}},pullDef={'service':a3_0x3c9e89(0x99),'command':a3_0x3c9e89(0x7a),'description':a3_0x3c9e89(0xae),'risk':a3_0x3c9e89(0x97),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x3c9e89(0xbe),'type':'string','description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x3c9e89(0x79),'type':a3_0x3c9e89(0xb9),'description':a3_0x3c9e89(0x93),'default':![]},{'name':'no-cache','type':a3_0x3c9e89(0xb9),'description':a3_0x3c9e89(0xbc),'default':![]}],async 'execute'(_0x30628b){const _0x408a59=a3_0x3c9e89,_0x253f17=_0x30628b['str'](_0x408a59(0xbe))||_0x30628b[_0x408a59(0x85)]||getEnv()||'production',_0x1938d3=_0x30628b[_0x408a59(0xaf)](_0x408a59(0x79)),_0x21b1c8=_0x30628b['bool']('no-cache'),{getRemoteAppList:_0x271e8f}=await import(_0x408a59(0x87)),_0x2706e3=await _0x271e8f({'env':_0x253f17,'accessKey':_0x30628b[_0x408a59(0xc5)],'localOnly':_0x1938d3,'noCache':_0x21b1c8});return{'ok':!![],'data':{'total':_0x2706e3['items'][_0x408a59(0x8c)],'env':_0x253f17,'source':_0x2706e3[_0x408a59(0xbd)],'fetchedAt':_0x2706e3[_0x408a59(0x70)],'cachePath':_0x2706e3[_0x408a59(0xb5)]},'message':_0x2706e3['source']===_0x408a59(0xb2)?_0x408a59(0xc4)+_0x2706e3[_0x408a59(0x78)][_0x408a59(0x8c)]+_0x408a59(0x9a)+_0x253f17+'\x22.':_0x408a59(0x71)+_0x2706e3[_0x408a59(0x78)][_0x408a59(0x8c)]+_0x408a59(0x86)+_0x253f17+'\x22.'};}},useDef={'service':a3_0x3c9e89(0x99),'command':a3_0x3c9e89(0xa2),'description':a3_0x3c9e89(0xa6),'risk':a3_0x3c9e89(0x97),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x3c9e89(0xad),'description':a3_0x3c9e89(0x7d),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x282883){const _0x5520a3=a3_0x3c9e89;if(!_0x282883['args'][0x0])throw CliErrors['validation'](_0x5520a3(0x9f),_0x5520a3(0x98)+CLI_BIN_NAME+_0x5520a3(0xa4));},async 'execute'(_0x3558c1){const _0x272a60=a3_0x3c9e89,_0x34e55d=_0x3558c1[_0x272a60(0x94)][0x0];if(!_0x34e55d)throw CliErrors[_0x272a60(0xc9)](_0x272a60(0x9f),_0x272a60(0x98)+CLI_BIN_NAME+_0x272a60(0xa4));const {buildConfigFromFlags:_0x33c51f,resolveLocalAppAliasCode:_0x1a3435}=await import(_0x272a60(0x82)),{readCachedAppList:_0x324a7d}=await import('../../commands/app/cache.js'),_0x5bbefb=_0x3558c1[_0x272a60(0xbf)](_0x272a60(0xbe)),_0x413cbb=_0x33c51f(_0x5bbefb?{'env':_0x5bbefb}:{}),_0x2f5b17=_0x324a7d(_0x413cbb[_0x272a60(0xbe)],_0x413cbb['accessKey']),_0x5727be=_0x2f5b17?.['items']['find'](_0x2ee7b9=>_0x2ee7b9[_0x272a60(0xba)]===_0x34e55d),_0x54083e=_0x1a3435(_0x413cbb[_0x272a60(0x9d)]??{},_0x34e55d);if(_0x5727be&&!isRuntimeAccessibleApp(_0x5727be))throw runtimeInaccessibleAppError(_0x5727be,'\x22'+_0x34e55d+'\x22');if(_0x54083e){const _0x408c64=_0x2f5b17?.[_0x272a60(0x78)][_0x272a60(0xc0)](_0x189731=>_0x189731['appCode']?.[_0x272a60(0xc8)]()===_0x54083e);if(_0x408c64&&!isRuntimeAccessibleApp(_0x408c64))throw runtimeInaccessibleAppError(_0x408c64,'\x22'+_0x34e55d+'\x22');}if(!_0x5727be&&!_0x54083e&&_0x413cbb[_0x272a60(0x95)]!==_0x34e55d){const _0x117ec4=[..._0x2f5b17?.[_0x272a60(0x78)]['map'](_0x5818e3=>_0x5818e3[_0x272a60(0xba)])??[]],_0x554ccf=_0x117ec4[_0x272a60(0x8c)]===0x0?_0x272a60(0x80)+CLI_BIN_NAME+_0x272a60(0x76)+_0x34e55d+'.appcode\x20to\x20.lovrabet.json.':_0x272a60(0x9e)+Array['from'](new Set(_0x117ec4))[_0x272a60(0xa9)](',\x20')+'.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.';throw CliErrors[_0x272a60(0xc9)](_0x272a60(0x7e)+_0x34e55d+'\x22\x20not\x20found.',_0x554ccf);}const _0x4951f6=_0x3558c1[_0x272a60(0xaf)](_0x272a60(0xbb));let _0x276498;if(_0x4951f6)_0x276498={'global':!![]};else{const {isInProject:_0x289677}=await import(_0x272a60(0x82)),_0x236e62=_0x289677();_0x276498=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x272a60(0x81),'inProject':_0x236e62}));}const _0x2edff5=readConfig(_0x276498);return _0x2edff5[_0x272a60(0x95)]=_0x34e55d,writeConfig(_0x2edff5,_0x276498),{'ok':!![],'message':_0x272a60(0xa7)+_0x34e55d+'\x22'+scopeLabel(_0x276498)+'.'};}},importDef={'service':'app','command':'import','description':a3_0x3c9e89(0x72),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x5e4ba6){return await runInitImport(collectFlags(_0x5e4ba6,initImportFlagDefs)),{'ok':!![]};}};function a3_0x2bf0(){const _0x539796=['224251uzWusF','2184644KFCErH','cachePath','2DWtfjj','config','5RQzZzU','boolean','appName','global','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','source','env','str','find','1186734Dclvap','Read\x20app\x20list\x20from\x20local\x20cache\x20only','string','Loaded\x20','accessKey','Initialize\x20','i18nInfo','trim','validation','read','Include\x20unpublished\x20apps\x20for\x20diagnostics','fetchedAt','Refreshed\x20app\x20cache\x20with\x20','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','push','175388LzigZW','remote','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','projectPath','items','local','pull','702888VdBOgU','nonInteractive','Remote\x20app\x20name\x20to\x20activate','App\x20\x22','include-unpublished','Use\x20`','project-default','../../context.js','globalPath','Filter\x20by\x20environment\x20(default:\x20current\x20env)','envName','\x20app(s)\x20for\x20env=\x22','../../commands/app/remote-source.js','\x20config\x20file','14063137XTrIjW','No\x20cached\x20apps\x20found.','langs','length','entries','map','enableI18n','filter','mergedCli','appcode','Read\x20from\x20local\x20cache\x20only','args','defaultApp','No\x20apps\x20found\x20on\x20the\x20platform.','write','Usage:\x20','app','\x20cached\x20app(s)\x20for\x20env=\x22','isCurrent','Use\x20global\x20config\x20scope','raw','Available\x20remote\x20apps:\x20','Missing\x20app\x20name.','appOwnerName','list','use','4274505LeFZPl','\x20app\x20use\x20<name>\x20[--global]','type','Set\x20the\x20fallback\x20app\x20candidate','Default\x20app\x20candidate\x20set\x20to\x20\x22','init','join','isArray','no-cache','39wmKjYM','name','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','bool','production','10bQzNnk','cache'];a3_0x2bf0=function(){return _0x539796;};return a3_0x2bf0();}export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
const a3_0x1b9396=a3_0x12ee;(function(_0x4d6ecb,_0x51895d){const _0x45ad29=a3_0x12ee,_0xa8b012=_0x4d6ecb();while(!![]){try{const _0x2b09e4=parseInt(_0x45ad29(0x21d))/0x1+-parseInt(_0x45ad29(0x22a))/0x2+parseInt(_0x45ad29(0x1e7))/0x3+-parseInt(_0x45ad29(0x1fa))/0x4*(parseInt(_0x45ad29(0x208))/0x5)+parseInt(_0x45ad29(0x1df))/0x6*(parseInt(_0x45ad29(0x1e3))/0x7)+-parseInt(_0x45ad29(0x1ec))/0x8+-parseInt(_0x45ad29(0x21c))/0x9*(parseInt(_0x45ad29(0x21a))/0xa);if(_0x2b09e4===_0x51895d)break;else _0xa8b012['push'](_0xa8b012['shift']());}catch(_0x3ae551){_0xa8b012['push'](_0xa8b012['shift']());}}}(a3_0x21e0,0x33e7a));import{CliErrors}from'../../errors.js';function a3_0x21e0(){const _0x2c90d7=['project-default','316554Cluhfm','\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]','envName','App\x20\x22','406734fRVEfj','entries','\x22\x20not\x20found.','length','init','1867968EkSPuK','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','i18nInfo','app','trim','No\x20apps\x20found\x20on\x20the\x20platform.','raw','nonInteractive','Loaded\x20','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','name','push','appOwnerName','Filter\x20by\x20environment\x20(default:\x20current\x20env)','356740zQierW','remote','defaultApp','production','\x20app\x20use\x20<name>\x20[--global]','enableI18n','write','`\x20instead.','source','../../context.js','appName','no-cache','\x20cached\x20app(s)\x20for\x20env=\x22','projectPath','10OzsPZQ','appPublishStatus','globalPath','boolean','isArray','\x20app\x20','../../commands/app/cache.js','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','map','filter','cachePath','global','Default\x20app\x20candidate\x20set\x20to\x20\x22','Refreshed\x20app\x20cache\x20with\x20','bool','warn','config','import','22200FcrZTS','use','171IhKFVw','339065MEokrr','fetchedAt','items','Missing\x20app\x20name.','appcode','accessKey','local','.appcode\x20to\x20.lovrabet.json.','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','string','join','appCode','Use\x20global\x20config\x20scope','249098UjToex','Read\x20from\x20local\x20cache\x20only','find','from','env','\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]','args','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','Usage:\x20','str','\x20app(s)\x20for\x20env=\x22','42dNtxHy','validation','Deprecated:\x20use\x20workspace\x20use\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app'];a3_0x21e0=function(){return _0x2c90d7;};return a3_0x21e0();}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';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':a3_0x1b9396(0x213),'type':a3_0x1b9396(0x20b),'description':a3_0x1b9396(0x229),'default':![]};function collectFlags(_0x1ae8aa,_0x33c77a){const _0x35c7ea=a3_0x1b9396,_0x4cb6a8={};for(const _0x529c1a of _0x33c77a){const _0x4e3d7d=_0x529c1a['type']===_0x35c7ea(0x20b)?_0x1ae8aa[_0x35c7ea(0x216)](_0x529c1a[_0x35c7ea(0x1f6)]):_0x1ae8aa[_0x35c7ea(0x1dd)](_0x529c1a['name']);if(_0x4e3d7d!==''&&_0x4e3d7d!==![])_0x4cb6a8[_0x529c1a[_0x35c7ea(0x1f6)]]=_0x4e3d7d;}if(_0x1ae8aa[_0x35c7ea(0x1f3)])_0x4cb6a8[_0x35c7ea(0x1f3)]=!![];return _0x4cb6a8;}function a3_0x12ee(_0x58b4e0,_0x27d5fe){_0x58b4e0=_0x58b4e0-0x1d6;const _0x21e000=a3_0x21e0();let _0x12eeea=_0x21e000[_0x58b4e0];return _0x12eeea;}function normalizeLanguages(_0x5a1cd7){const _0x1df6ca=a3_0x1b9396;if(!Array[_0x1df6ca(0x20c)](_0x5a1cd7))return[];return _0x5a1cd7[_0x1df6ca(0x211)](_0x361ffc=>typeof _0x361ffc==='string')[_0x1df6ca(0x210)](_0x201e61=>_0x201e61[_0x1df6ca(0x1f0)]())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x2973e6){const _0x44333f=a3_0x1b9396,_0x2dae5f=normalizeLanguages(_0x2973e6[_0x44333f(0x1ee)]?.['langs']);return{'enableI18n':typeof _0x2973e6[_0x44333f(0x1ff)]===_0x44333f(0x20b)?_0x2973e6[_0x44333f(0x1ff)]:null,'languages':_0x2dae5f,'i18nInfo':_0x2973e6[_0x44333f(0x1ee)]?{..._0x2973e6[_0x44333f(0x1ee)],'langs':_0x2dae5f[_0x44333f(0x1ea)]?_0x2dae5f:null}:null};}const initDef={'service':'app','command':a3_0x1b9396(0x1eb),'description':'Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':a3_0x1b9396(0x200),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x38c832){const _0x5b4987=a3_0x1b9396;return warnDeprecatedAppCommand(_0x5b4987(0x1eb),CLI_BIN_NAME+_0x5b4987(0x1d9)),await runInit(collectFlags(_0x38c832,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x1b9396(0x1ef),'command':'list','description':a3_0x1b9396(0x225),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x1b9396(0x1d8),'type':a3_0x1b9396(0x226),'description':a3_0x1b9396(0x1f9),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1b9396(0x223),'type':a3_0x1b9396(0x20b),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x1b9396(0x205),'type':a3_0x1b9396(0x20b),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]},{'name':'include-unpublished','type':'boolean','description':'Include\x20unpublished\x20apps\x20for\x20diagnostics','default':![]}],async 'execute'(_0x1da6cd){const _0x28a877=a3_0x1b9396,_0x28a403=_0x1da6cd[_0x28a877(0x1dd)](_0x28a877(0x1d8))||_0x1da6cd[_0x28a877(0x1e5)]||getEnv()||_0x28a877(0x1fd),_0x4e2655=_0x1da6cd[_0x28a877(0x216)](_0x28a877(0x223)),_0xdbe43=_0x1da6cd[_0x28a877(0x216)](_0x28a877(0x205)),_0x49ac68=_0x1da6cd[_0x28a877(0x216)]('include-unpublished'),{readRawConfigWithLayers:_0x3914fb,resolveDefaultAppSource:_0x2e5008,getLocalAppAliases:_0x174a75}=await import('../../context.js'),{getRemoteAppList:_0x269492}=await import('../../commands/app/remote-source.js'),{config:_0x3235ed,layers:_0xa8a8dd}=_0x3914fb(),_0x1ecbf0=_0x2e5008(_0xa8a8dd),{defaultApp:_0x2ff353}=_0x3235ed,_0x424150=await _0x269492({'env':_0x28a403,'accessKey':_0x1da6cd['accessKey'],'localOnly':_0x4e2655,'noCache':_0xdbe43}),_0x2fe671=_0x49ac68?_0x424150[_0x28a877(0x21f)]:filterRuntimeAccessibleApps(_0x424150[_0x28a877(0x21f)]),_0x38f434=_0x424150[_0x28a877(0x21f)][_0x28a877(0x1ea)]-_0x2fe671[_0x28a877(0x1ea)],_0x326332=_0x2fe671[_0x28a877(0x210)](_0x367a3c=>{const _0x376be8=_0x28a877;return{'name':_0x367a3c[_0x376be8(0x204)],'appcode':_0x367a3c[_0x376be8(0x228)],'named':!![],'definedIn':_0x376be8(0x1fb),'isDefault':_0x367a3c[_0x376be8(0x204)]===_0x2ff353,...buildAppProfileListFields(_0x28a403),...buildRemoteAppI18nFields(_0x367a3c),'source':_0x424150[_0x376be8(0x202)],'owner':_0x367a3c[_0x376be8(0x1f8)]??null,'status':_0x367a3c[_0x376be8(0x209)]??null,'cachedAt':_0x424150[_0x376be8(0x21e)]};}),_0x532e22=_0x174a75(_0x3235ed);let _0x55b829=0x0;for(const [_0x8fc13e,_0x30e1f1]of Object[_0x28a877(0x1e8)](_0x532e22)){const _0x2e947d=typeof _0x30e1f1[_0x28a877(0x221)]===_0x28a877(0x226)?_0x30e1f1[_0x28a877(0x221)][_0x28a877(0x1f0)]():'';if(!_0x2e947d)continue;const _0x17e262=findAppByCode(_0x424150[_0x28a877(0x21f)],_0x2e947d);if(!_0x49ac68&&_0x17e262&&!isRuntimeAccessibleApp(_0x17e262))continue;_0x55b829+=0x1,_0x326332[_0x28a877(0x1f7)]({'name':_0x8fc13e,'appcode':_0x2e947d,'named':!![],'definedIn':_0x28a877(0x223),'isDefault':_0x8fc13e===_0x2ff353,...buildAppProfileListFields(_0x28a403),'source':_0x28a877(0x218),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x326332,_0x1da6cd['mergedCli']);const _0x19e47e=_0x326332[_0x28a877(0x1d6)](_0x52098a=>_0x52098a['isCurrent']===!![]),_0x124240=_0x2ff353??_0x19e47e?.['name']??null,_0x367311={'env':_0x28a403,'source':_0x424150[_0x28a877(0x202)],'fetchedAt':_0x424150['fetchedAt'],'cachePath':_0x424150['cachePath'],'globalPath':_0xa8a8dd[_0x28a877(0x20a)]??null,'projectPath':_0xa8a8dd[_0x28a877(0x207)]??null,'defaultApp':_0x124240,'defaultAppSource':_0x2ff353!=null?_0x1ecbf0:null,'localAliasCount':_0x55b829,'remoteTotal':_0x424150[_0x28a877(0x21f)][_0x28a877(0x1ea)],'hiddenUnpublishedCount':_0x38f434,'includeUnpublished':_0x49ac68};if(_0x326332[_0x28a877(0x1ea)]===0x0)return{'ok':!![],'data':{'items':_0x326332,'meta':_0x367311},'message':_0x424150['source']==='cache'?'No\x20cached\x20apps\x20found.':_0x28a877(0x1f1)};return{'ok':!![],'data':{'items':_0x326332,'meta':_0x367311}};}},pullDef={'service':a3_0x1b9396(0x1ef),'command':'pull','description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x1b9396(0x200),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x1b9396(0x1d8),'type':'string','description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1b9396(0x223),'type':a3_0x1b9396(0x20b),'description':a3_0x1b9396(0x22b),'default':![]},{'name':'no-cache','type':a3_0x1b9396(0x20b),'description':a3_0x1b9396(0x1db),'default':![]}],async 'execute'(_0x155f78){const _0x392046=a3_0x1b9396,_0x234081=_0x155f78['str']('env')||_0x155f78[_0x392046(0x1e5)]||getEnv()||_0x392046(0x1fd),_0x3b67d0=_0x155f78[_0x392046(0x216)](_0x392046(0x223)),_0x32811d=_0x155f78[_0x392046(0x216)](_0x392046(0x205)),{getRemoteAppList:_0x380380}=await import('../../commands/app/remote-source.js'),_0x545854=await _0x380380({'env':_0x234081,'accessKey':_0x155f78['accessKey'],'localOnly':_0x3b67d0,'noCache':_0x32811d});return{'ok':!![],'data':{'total':_0x545854['items']['length'],'env':_0x234081,'source':_0x545854[_0x392046(0x202)],'fetchedAt':_0x545854[_0x392046(0x21e)],'cachePath':_0x545854[_0x392046(0x212)]},'message':_0x545854[_0x392046(0x202)]==='cache'?_0x392046(0x1f4)+_0x545854['items'][_0x392046(0x1ea)]+_0x392046(0x206)+_0x234081+'\x22.':_0x392046(0x215)+_0x545854[_0x392046(0x21f)][_0x392046(0x1ea)]+_0x392046(0x1de)+_0x234081+'\x22.'};}},useDef={'service':a3_0x1b9396(0x1ef),'command':'use','description':a3_0x1b9396(0x1e1),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x1b9396(0x1f6),'description':'Remote\x20app\x20name\x20to\x20activate','required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x399c6c){const _0x5aabde=a3_0x1b9396;if(!_0x399c6c[_0x5aabde(0x1da)][0x0])throw CliErrors[_0x5aabde(0x1e0)](_0x5aabde(0x220),_0x5aabde(0x1dc)+CLI_BIN_NAME+_0x5aabde(0x1fe));},async 'execute'(_0x1c9b5d){const _0xed6e05=a3_0x1b9396;warnDeprecatedAppCommand(_0xed6e05(0x21b),CLI_BIN_NAME+_0xed6e05(0x1e4));const _0x5ee1c7=_0x1c9b5d[_0xed6e05(0x1da)][0x0];if(!_0x5ee1c7)throw CliErrors[_0xed6e05(0x1e0)](_0xed6e05(0x220),'Usage:\x20'+CLI_BIN_NAME+_0xed6e05(0x1fe));const {buildConfigFromFlags:_0x359efb,resolveLocalAppAliasCode:_0x1fa6da}=await import(_0xed6e05(0x203)),{readCachedAppList:_0x163542}=await import(_0xed6e05(0x20e)),_0x15a60a=_0x1c9b5d[_0xed6e05(0x1dd)](_0xed6e05(0x1d8)),_0x3aac9f=_0x359efb(_0x15a60a?{'env':_0x15a60a}:{}),_0x1b39a4=_0x163542(_0x3aac9f[_0xed6e05(0x1d8)],_0x3aac9f[_0xed6e05(0x222)]),_0x4282b7=_0x1b39a4?.['items'][_0xed6e05(0x1d6)](_0x6a658=>_0x6a658[_0xed6e05(0x204)]===_0x5ee1c7),_0x493b40=_0x1fa6da(_0x3aac9f[_0xed6e05(0x1f2)]??{},_0x5ee1c7);if(_0x4282b7&&!isRuntimeAccessibleApp(_0x4282b7))throw runtimeInaccessibleAppError(_0x4282b7,'\x22'+_0x5ee1c7+'\x22');if(_0x493b40){const _0x88226e=_0x1b39a4?.[_0xed6e05(0x21f)][_0xed6e05(0x1d6)](_0x9d7282=>_0x9d7282[_0xed6e05(0x228)]?.[_0xed6e05(0x1f0)]()===_0x493b40);if(_0x88226e&&!isRuntimeAccessibleApp(_0x88226e))throw runtimeInaccessibleAppError(_0x88226e,'\x22'+_0x5ee1c7+'\x22');}if(!_0x4282b7&&!_0x493b40&&_0x3aac9f['defaultApp']!==_0x5ee1c7){const _0x32d456=[..._0x1b39a4?.[_0xed6e05(0x21f)][_0xed6e05(0x210)](_0x1762ec=>_0x1762ec[_0xed6e05(0x204)])??[]],_0x52635c=_0x32d456[_0xed6e05(0x1ea)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0xed6e05(0x20f)+_0x5ee1c7+_0xed6e05(0x224):'Available\x20remote\x20apps:\x20'+Array[_0xed6e05(0x1d7)](new Set(_0x32d456))[_0xed6e05(0x227)](',\x20')+_0xed6e05(0x1f5);throw CliErrors['validation'](_0xed6e05(0x1e6)+_0x5ee1c7+_0xed6e05(0x1e9),_0x52635c);}const _0x20390f=_0x1c9b5d['bool'](_0xed6e05(0x213));let _0x11ae0c;if(_0x20390f)_0x11ae0c={'global':!![]};else{const {isInProject:_0x1a87c9}=await import(_0xed6e05(0x203)),_0x33911e=_0x1a87c9();_0x11ae0c=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0xed6e05(0x1e2),'inProject':_0x33911e}));}const _0x55fb76=readConfig(_0x11ae0c);return _0x55fb76[_0xed6e05(0x1fc)]=_0x5ee1c7,writeConfig(_0x55fb76,_0x11ae0c),{'ok':!![],'message':_0xed6e05(0x214)+_0x5ee1c7+'\x22'+scopeLabel(_0x11ae0c)+'.'};}};function warnDeprecatedAppCommand(_0x270e9e,_0x55c0e7){const _0x15cdb8=a3_0x1b9396;console[_0x15cdb8(0x217)](CLI_BIN_NAME+_0x15cdb8(0x20d)+_0x270e9e+'\x20is\x20deprecated.\x20Use\x20`'+_0x55c0e7+_0x15cdb8(0x201));}const importDef={'service':a3_0x1b9396(0x1ef),'command':a3_0x1b9396(0x219),'description':a3_0x1b9396(0x1ed),'risk':a3_0x1b9396(0x200),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x251f7f){return await runInitImport(collectFlags(_0x251f7f,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3244d8,_0x1ca673){const _0x29adb7=a4_0x4a53,_0x1b02f1=_0x3244d8();while(!![]){try{const _0x52dd5e=parseInt(_0x29adb7(0x1ce))/0x1*(parseInt(_0x29adb7(0x1ca))/0x2)+parseInt(_0x29adb7(0x1c0))/0x3*(-parseInt(_0x29adb7(0x1c1))/0x4)+-parseInt(_0x29adb7(0x1bd))/0x5+-parseInt(_0x29adb7(0x1c2))/0x6*(parseInt(_0x29adb7(0x1bb))/0x7)+parseInt(_0x29adb7(0x1cb))/0x8+-parseInt(_0x29adb7(0x1c7))/0x9+parseInt(_0x29adb7(0x1bf))/0xa*(parseInt(_0x29adb7(0x1c9))/0xb);if(_0x52dd5e===_0x1ca673)break;else _0x1b02f1['push'](_0x1b02f1['shift']());}catch(_0x50a6d3){_0x1b02f1['push'](_0x1b02f1['shift']());}}}(a4_0x13eb,0x330bc));import{CLI_BIN_NAME}from'../../constant/cli.js';import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x557abc){if(typeof _0x557abc!=='string')return null;const _0x2d7173=_0x557abc['trim']();return _0x2d7173?_0x2d7173['toUpperCase']():null;}function a4_0x4a53(_0x5267be,_0x30423b){_0x5267be=_0x5267be-0x1ba;const _0x13eb71=a4_0x13eb();let _0x4a5371=_0x13eb71[_0x5267be];return _0x4a5371;}export function isRuntimeAccessibleApp(_0x13a9fa){const _0x41ac8e=a4_0x4a53;return normalizeAppPublishStatus(_0x13a9fa[_0x41ac8e(0x1c5)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0x44c164){return _0x44c164['filter'](isRuntimeAccessibleApp);}function a4_0x13eb(){const _0x4c732a=['54670HQRfmd','12UKSXBo','1749064UpWAma','appCode','find','20507tqoPte','\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.','153685zvEMfq','trim','728585EAjIrV','App\x20','990NRTeiH','39vVAGdf','23580figESu','24hEpLgC','UNKNOWN','Current\x20status:\x20','appPublishStatus','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','2830041WtCajq','appName'];a4_0x13eb=function(){return _0x4c732a;};return a4_0x13eb();}export function findAppByName(_0x4e7170,_0x54efc6){const _0x438ac1=a4_0x4a53;return _0x4e7170[_0x438ac1(0x1cd)](_0x33a6f5=>_0x33a6f5[_0x438ac1(0x1c8)]===_0x54efc6);}export function findAppByCode(_0x251762,_0x3de118){const _0x36701c=a4_0x4a53,_0x4ca1a0=_0x3de118[_0x36701c(0x1bc)]();if(!_0x4ca1a0)return undefined;return _0x251762[_0x36701c(0x1cd)](_0x12599e=>_0x12599e[_0x36701c(0x1cc)]?.['trim']()===_0x4ca1a0);}export function runtimeInaccessibleAppError(_0x4c3cb2,_0x39c653){const _0x4af47f=a4_0x4a53,_0x2af201=normalizeAppPublishStatus(_0x4c3cb2[_0x4af47f(0x1c5)])??_0x4af47f(0x1c3);return CliErrors['validation'](_0x4af47f(0x1be)+_0x39c653+_0x4af47f(0x1ba),_0x4af47f(0x1c4)+_0x2af201+'.\x20Publish\x20the\x20app\x20before\x20using\x20'+CLI_BIN_NAME+_0x4af47f(0x1c6));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37805a,_0x4717bf){const _0x566a36=a5_0x3284,_0x390a23=_0x37805a();while(!![]){try{const _0x3cd367=parseInt(_0x566a36(0x123))/0x1*(-parseInt(_0x566a36(0x11e))/0x2)+parseInt(_0x566a36(0x121))/0x3+parseInt(_0x566a36(0x114))/0x4*(parseInt(_0x566a36(0x11b))/0x5)+parseInt(_0x566a36(0x117))/0x6*(parseInt(_0x566a36(0x116))/0x7)+parseInt(_0x566a36(0x115))/0x8*(-parseInt(_0x566a36(0x118))/0x9)+-parseInt(_0x566a36(0x122))/0xa+parseInt(_0x566a36(0x119))/0xb;if(_0x3cd367===_0x4717bf)break;else _0x390a23['push'](_0x390a23['shift']());}catch(_0x78cc8a){_0x390a23['push'](_0x390a23['shift']());}}}(a5_0xb750,0x668b3));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function a5_0xb750(){const _0x3bca56=['1KujgKz','parse','errorMsg','1977076XvrUtW','448FzEQhZ','1099588YvBTPg','6XKHhCW','104337oGbOGX','14913129EBAIAd','Mock\x20API\x20error:\x20','5NHViVS','../../../mock/app-list.json','utf-8','976838vPoADr','success','errorCode','251730OnqYTT','5333560Uvysxe'];a5_0xb750=function(){return _0x3bca56;};return a5_0xb750();}function loadMockAppList(){const _0x371b14=a5_0x3284,_0x509d0b=join(__dirname,_0x371b14(0x11c)),_0x3ca761=readFileSync(_0x509d0b,_0x371b14(0x11d));return JSON[_0x371b14(0x124)](_0x3ca761);}function a5_0x3284(_0x4c976f,_0x51d2a4){_0x4c976f=_0x4c976f-0x113;const _0xb750ae=a5_0xb750();let _0x32847c=_0xb750ae[_0x4c976f];return _0x32847c;}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x4b8a8c=a5_0x3284,_0x1b60fc=getMockAppList();if(!_0x1b60fc[_0x4b8a8c(0x11f)])throw new Error(_0x4b8a8c(0x11a)+_0x1b60fc[_0x4b8a8c(0x113)]+'\x20('+_0x1b60fc[_0x4b8a8c(0x120)]+')');return _0x1b60fc['data']['tableData'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a6_0x530c(){const _0x8ae1d3=['toLowerCase','9003wmeaPB','15770150nvcbJB','items','9lvccnd','358GGHHno','972Mstbat','cache','trim','9078780HGJUBJ','1782208VmDIdY','APP_LIST_SOURCE','31206woVVfW','mock','toISOString','838846mQloHw','580wVbcwx','fetchedAt','31525aVRaaf'];a6_0x530c=function(){return _0x8ae1d3;};return a6_0x530c();}(function(_0x196739,_0x2d5ea6){const _0x35e00e=a6_0x4a3f,_0x2b909e=_0x196739();while(!![]){try{const _0x477f5f=-parseInt(_0x35e00e(0x19a))/0x1+-parseInt(_0x35e00e(0x1a3))/0x2*(parseInt(_0x35e00e(0x19f))/0x3)+-parseInt(_0x35e00e(0x19b))/0x4*(-parseInt(_0x35e00e(0x19d))/0x5)+-parseInt(_0x35e00e(0x1a4))/0x6*(-parseInt(_0x35e00e(0x1aa))/0x7)+-parseInt(_0x35e00e(0x1a8))/0x8+-parseInt(_0x35e00e(0x1a2))/0x9*(parseInt(_0x35e00e(0x1a7))/0xa)+parseInt(_0x35e00e(0x1a0))/0xb;if(_0x477f5f===_0x2d5ea6)break;else _0x2b909e['push'](_0x2b909e['shift']());}catch(_0x2a4c67){_0x2b909e['push'](_0x2b909e['shift']());}}}(a6_0x530c,0x898c0));import{getMyApps}from'../../core/api-client.js';function a6_0x4a3f(_0x6809cb,_0x30fa85){_0x6809cb=_0x6809cb-0x198;const _0x530c37=a6_0x530c();let _0x4a3f4a=_0x530c37[_0x6809cb];return _0x4a3f4a;}import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x176163=a6_0x4a3f,_0x300830=(productEnv(_0x176163(0x1a9))||'')['trim']()[_0x176163(0x19e)]();return _0x300830==='mock';}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x15f46b){const _0x3ce2c3=a6_0x4a3f,{env:_0x3c00aa,accessKey:_0x163d33,localOnly:localOnly=![],noCache:noCache=![]}=_0x15f46b,_0x27acbc=readCachedAppList(_0x3c00aa,_0x163d33),_0x39f674=_0x163d33?.[_0x3ce2c3(0x1a6)]()?getAppCacheFilePath(_0x3c00aa,_0x163d33):null;if(localOnly)return{'items':_0x27acbc?.[_0x3ce2c3(0x1a1)]??[],'source':'cache','fetchedAt':_0x27acbc?.[_0x3ce2c3(0x19c)]??null,'cachePath':_0x39f674};try{const _0x425751=await getRemoteAppItems(),_0x280b8d=shouldUseMockRemoteApps()?_0x3ce2c3(0x198):'remote',_0x3cd209=new Date()[_0x3ce2c3(0x199)](),_0x427935=_0x163d33?.[_0x3ce2c3(0x1a6)]()?writeCachedAppList(_0x3c00aa,_0x163d33,{'env':_0x3c00aa,'fetchedAt':_0x3cd209,'source':_0x280b8d,'items':_0x425751}):null;return{'items':_0x425751,'source':_0x280b8d,'fetchedAt':_0x3cd209,'cachePath':_0x427935};}catch(_0x180726){if(!noCache&&_0x27acbc)return{'items':_0x27acbc[_0x3ce2c3(0x1a1)],'source':_0x3ce2c3(0x1a5),'fetchedAt':_0x27acbc[_0x3ce2c3(0x19c)],'cachePath':_0x39f674};throw _0x180726;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a7_0x4e9d(_0x3aab13,_0x27d8a4){_0x3aab13=_0x3aab13-0x122;const _0x25588c=a7_0x2558();let _0x4e9de=_0x25588c[_0x3aab13];return _0x4e9de;}function a7_0x2558(){const _0x382975=['appcode','629690MObxSm','trim','3215934xUALuX','468KkUHae','appCode','1476572ukFObr','150007LVhJvg','isCurrent','named','469zzOwsq','definedIn','228sIcIbP','global','8DbDdCC','103542DyAmaH','20307QAaKFB','name','local','1184733YGZQWn','10GlsOXG','find'];a7_0x2558=function(){return _0x382975;};return a7_0x2558();}(function(_0x329b6f,_0x518f51){const _0x1b1a4d=a7_0x4e9d,_0x120ff0=_0x329b6f();while(!![]){try{const _0x254b4e=-parseInt(_0x1b1a4d(0x127))/0x1+parseInt(_0x1b1a4d(0x136))/0x2*(parseInt(_0x1b1a4d(0x124))/0x3)+parseInt(_0x1b1a4d(0x130))/0x4*(parseInt(_0x1b1a4d(0x128))/0x5)+parseInt(_0x1b1a4d(0x123))/0x6*(parseInt(_0x1b1a4d(0x134))/0x7)+-parseInt(_0x1b1a4d(0x122))/0x8*(parseInt(_0x1b1a4d(0x12d))/0x9)+parseInt(_0x1b1a4d(0x12b))/0xa+parseInt(_0x1b1a4d(0x131))/0xb*(-parseInt(_0x1b1a4d(0x12e))/0xc);if(_0x254b4e===_0x518f51)break;else _0x120ff0['push'](_0x120ff0['shift']());}catch(_0x4e0138){_0x120ff0['push'](_0x120ff0['shift']());}}}(a7_0x2558,0x9ff86));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x47807b,_0x3c3ac9){const _0x50c4c4=a7_0x4e9d;if(!_0x3c3ac9)return;const _0x519223=!!(_0x3c3ac9['currentApp']??_0x3c3ac9['defaultApp']);for(const _0x575297 of _0x47807b){_0x575297[_0x50c4c4(0x132)]=![];}const _0x45c0fa=_0x3c3ac9[_0x50c4c4(0x12f)]!=null?String(_0x3c3ac9[_0x50c4c4(0x12f)])[_0x50c4c4(0x12c)]():'';if(_0x519223){const _0x391c8f=_0x3c3ac9['currentApp']??_0x3c3ac9['defaultApp'];if(_0x391c8f){const _0x2d5e33=_0x47807b[_0x50c4c4(0x129)](_0x342b49=>_0x342b49[_0x50c4c4(0x133)]===!![]&&_0x342b49[_0x50c4c4(0x125)]===_0x391c8f&&_0x342b49[_0x50c4c4(0x135)]===_0x50c4c4(0x126)),_0x32a29d=_0x2d5e33??_0x47807b['find'](_0x9390ad=>_0x9390ad[_0x50c4c4(0x133)]===!![]&&_0x9390ad[_0x50c4c4(0x125)]===_0x391c8f);_0x32a29d&&(_0x32a29d[_0x50c4c4(0x132)]=!![]);}return;}if(!_0x45c0fa)return;for(const _0x41c580 of _0x47807b){String(_0x41c580[_0x50c4c4(0x12a)]??'')[_0x50c4c4(0x12c)]()===_0x45c0fa&&(_0x41c580['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x4529a0){const _0x12d5e4=a7_0x4e9d;return formatScopeLabel(_0x4529a0[_0x12d5e4(0x137)]?_0x12d5e4(0x137):'project');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x58856d=a8_0x21f5;(function(_0x33540c,_0x54d5a2){const _0x48e2e5=a8_0x21f5,_0x37d515=_0x33540c();while(!![]){try{const _0x29e587=parseInt(_0x48e2e5(0x155))/0x1*(-parseInt(_0x48e2e5(0x162))/0x2)+parseInt(_0x48e2e5(0x182))/0x3*(-parseInt(_0x48e2e5(0x15a))/0x4)+parseInt(_0x48e2e5(0x17d))/0x5*(parseInt(_0x48e2e5(0x14f))/0x6)+parseInt(_0x48e2e5(0x14d))/0x7+parseInt(_0x48e2e5(0x17c))/0x8*(parseInt(_0x48e2e5(0x170))/0x9)+parseInt(_0x48e2e5(0x18a))/0xa+parseInt(_0x48e2e5(0x154))/0xb*(parseInt(_0x48e2e5(0x185))/0xc);if(_0x29e587===_0x54d5a2)break;else _0x37d515['push'](_0x37d515['shift']());}catch(_0x4177d0){_0x37d515['push'](_0x37d515['shift']());}}}(a8_0x22d7,0xafa31));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='react_module',ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a8_0x58856d(0x172),'react-dom',a8_0x58856d(0x17b),a8_0x58856d(0x18c),a8_0x58856d(0x183),a8_0x58856d(0x149)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a8_0x58856d(0x15f)](',\x20');function a8_0x21f5(_0x37cfbc,_0x5ac9c4){_0x37cfbc=_0x37cfbc-0x140;const _0x22d7f6=a8_0x22d7();let _0x21f5fa=_0x22d7f6[_0x37cfbc];return _0x21f5fa;}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':'string','required':!![],'description':a8_0x58856d(0x161)},ARTIFACT_NAME_FLAG={'name':'name','type':a8_0x58856d(0x164),'description':a8_0x58856d(0x141)},METADATA_FLAG={'name':'metadata','type':a8_0x58856d(0x164),'description':a8_0x58856d(0x174)};function isPlainObject(_0x41b50e){const _0x4470c1=a8_0x58856d;return typeof _0x41b50e===_0x4470c1(0x151)&&_0x41b50e!==null&&!Array[_0x4470c1(0x17a)](_0x41b50e);}function a8_0x22d7(){const _0x79517e=['deleted','list','description','List\x20current-app\x20react_module\x20Artifacts','1426970llxDPj','name','dayjs','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','favorite','create','updateTime','update','Artifact\x20display\x20name','artifact','filter','metadata','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','POST','build','trim','@ant-design/icons','validation','isFile','Show\x20one\x20Artifact\x20by\x20id','8562400nOrdzh','length','6xOugkI','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','object','appCode','content','253omdBzR','1313791WeAWGB','write','Optional\x20favorite-state\x20filter','body','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','400mPGWiY','file','detail','Invalid\x20JSON\x20for\x20--metadata:\x20','exec','join','File\x20not\x20found:\x20','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','2eGawSr','split','string','createTime','test','compiledContent','map','Artifact\x20source\x20file\x20is\x20blank.','startsWith','num','flag','react_module\x20imports\x20are\x20limited\x20to:\x20','source','read','387zZQJcG','.\x20Unsupported:\x20','react','str','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','File\x20is\x20not\x20a\x20regular\x20file:\x20','utf8','artifactType','/update','lastIndex','isArray','lodash','16216bvUrow','3539095ZCrtXA','Created\x20Artifact\x20','includes','/client/artifact/','some','24324ErhAis','antd','boolean','356412qDCkVH'];a8_0x22d7=function(){return _0x79517e;};return a8_0x22d7();}function readSourceFile(_0x508c46){const _0x3150d0=a8_0x58856d;if(!_0x508c46)throw CliErrors[_0x3150d0(0x14a)]('File\x20path\x20is\x20required.');if(!existsSync(_0x508c46))throw CliErrors[_0x3150d0(0x14a)](_0x3150d0(0x160)+_0x508c46);if(!statSync(_0x508c46)[_0x3150d0(0x14b)]())throw CliErrors[_0x3150d0(0x14a)](_0x3150d0(0x175)+_0x508c46);const _0x3798e9=readFileSync(_0x508c46,_0x3150d0(0x176));return validateReactModuleSource(_0x3798e9),_0x3798e9;}function parseMetadata(_0x6e67d7){const _0x258b9a=a8_0x58856d;if(!_0x6e67d7)return undefined;let _0x559414;try{_0x559414=JSON['parse'](_0x6e67d7);}catch{throw CliErrors[_0x258b9a(0x14a)](_0x258b9a(0x15d)+_0x6e67d7);}if(!isPlainObject(_0x559414))throw CliErrors[_0x258b9a(0x14a)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x40908a={..._0x559414};return delete _0x40908a[_0x258b9a(0x167)],_0x40908a;}function getPackageName(_0x567fcf){const _0x2bbcf1=a8_0x58856d;if(_0x567fcf[_0x2bbcf1(0x16a)]('@')){const [_0x56e723,_0x151c8f]=_0x567fcf['split']('/');return _0x56e723&&_0x151c8f?_0x56e723+'/'+_0x151c8f:_0x567fcf;}return _0x567fcf[_0x2bbcf1(0x163)]('/')[0x0]||_0x567fcf;}function validateAllowedImports(_0x4c1487){const _0x15f3fe=a8_0x58856d,_0x45eccd=new Set();for(const _0x340442 of IMPORT_SOURCE_PATTERNS){_0x340442[_0x15f3fe(0x179)]=0x0;let _0x339868;while((_0x339868=_0x340442[_0x15f3fe(0x15e)](_0x4c1487))!==null){const _0x1c6915=_0x339868[0x1]?.[_0x15f3fe(0x148)]();_0x1c6915&&_0x45eccd['add'](_0x1c6915);}}const _0x520959=[..._0x45eccd][_0x15f3fe(0x168)](getPackageName)[_0x15f3fe(0x143)](_0x2d7384=>!ALLOWED_REACT_MODULE_IMPORTS[_0x15f3fe(0x17f)](_0x2d7384));if(_0x520959[_0x15f3fe(0x14e)]>0x0)throw CliErrors[_0x15f3fe(0x14a)](_0x15f3fe(0x16d)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x15f3fe(0x171)+[...new Set(_0x520959)][_0x15f3fe(0x15f)](',\x20'));}export function validateReactModuleSource(_0x5ac4f5){const _0x2d06e8=a8_0x58856d;if(!_0x5ac4f5[_0x2d06e8(0x148)]())throw CliErrors[_0x2d06e8(0x14a)](_0x2d06e8(0x169));if(PAGE_LEVEL_PATTERNS[_0x2d06e8(0x181)](_0x59ed00=>_0x59ed00[_0x2d06e8(0x166)](_0x5ac4f5)))throw CliErrors[_0x2d06e8(0x14a)](_0x2d06e8(0x159));validateAllowedImports(_0x5ac4f5);}function buildArtifactInput(_0x1e67b0){const _0x4a8264=a8_0x58856d,_0x45f0cd=readSourceFile(_0x1e67b0[_0x4a8264(0x173)](_0x4a8264(0x15b))),_0x3ebcba=_0x1e67b0['str'](_0x4a8264(0x18b))[_0x4a8264(0x148)](),_0x4c43c4=parseMetadata(_0x1e67b0[_0x4a8264(0x173)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x3ebcba?{'name':_0x3ebcba}:{},'content':_0x45f0cd,..._0x4c43c4?{'metadata':_0x4c43c4}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x5aef9d){const _0x415799=a8_0x58856d;return{'id':_0x5aef9d['id'],'name':_0x5aef9d[_0x415799(0x18b)],'artifactType':_0x5aef9d[_0x415799(0x177)],'source':_0x5aef9d[_0x415799(0x16e)],'favorite':_0x5aef9d['favorite'],'deleted':_0x5aef9d[_0x415799(0x186)],'createTime':_0x5aef9d[_0x415799(0x165)],'updateTime':_0x5aef9d[_0x415799(0x190)]};}function detailArtifact(_0x19d73f){const _0x20de18=a8_0x58856d;return{'id':_0x19d73f['id'],'appCode':_0x19d73f[_0x20de18(0x152)],'name':_0x19d73f[_0x20de18(0x18b)],'artifactType':_0x19d73f[_0x20de18(0x177)],'source':_0x19d73f[_0x20de18(0x16e)],'favorite':_0x19d73f[_0x20de18(0x18e)],'deleted':_0x19d73f[_0x20de18(0x186)],'content':_0x19d73f[_0x20de18(0x153)]??'','compiledContent':_0x19d73f[_0x20de18(0x167)],'metadata':_0x19d73f[_0x20de18(0x144)]??{},'createTime':_0x19d73f['createTime'],'updateTime':_0x19d73f[_0x20de18(0x190)]};}function readFavoriteFlag(_0x42bbcf){const _0x532f86=a8_0x58856d,_0x1e873a=_0x42bbcf[_0x532f86(0x16c)](_0x532f86(0x18e));return _0x1e873a===undefined||_0x1e873a===null||_0x1e873a===''?undefined:_0x42bbcf['bool'](_0x532f86(0x18e));}const artifactList={'service':a8_0x58856d(0x142),'command':a8_0x58856d(0x187),'description':a8_0x58856d(0x189),'risk':'read','flags':[{'name':a8_0x58856d(0x16e),'type':a8_0x58856d(0x164),'description':a8_0x58856d(0x145)},{'name':a8_0x58856d(0x18e),'type':a8_0x58856d(0x184),'description':a8_0x58856d(0x157)},VERBOSE_FLAG],async 'execute'(_0x3715ee){const _0x33c59a=a8_0x58856d,_0x4efcaf=await listRuntimeArtifacts(_0x3715ee['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x3715ee[_0x33c59a(0x173)](_0x33c59a(0x16e))?{'source':_0x3715ee[_0x33c59a(0x173)]('source')}:{},...readFavoriteFlag(_0x3715ee)!==undefined?{'favorite':readFavoriteFlag(_0x3715ee)}:{}});return{'ok':!![],'data':{'total':_0x4efcaf[_0x33c59a(0x14e)],'items':_0x3715ee['bool']('verbose')?_0x4efcaf:_0x4efcaf[_0x33c59a(0x168)](summarizeArtifact)}};}},artifactDetail={'service':a8_0x58856d(0x142),'command':a8_0x58856d(0x15c),'description':a8_0x58856d(0x14c),'risk':a8_0x58856d(0x16f),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'}],async 'execute'(_0x16e500){const _0x53d00a=await getRuntimeArtifact(_0x16e500['num']('id'),_0x16e500['appCode']);return{'ok':!![],'data':detailArtifact(_0x53d00a)};}},artifactCreate={'service':a8_0x58856d(0x142),'command':a8_0x58856d(0x18f),'description':a8_0x58856d(0x150),'risk':a8_0x58856d(0x156),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3c7684){const _0x2187e3=a8_0x58856d,_0x987241=buildArtifactInput(_0x3c7684),_0x5d3a93=await createRuntimeArtifact(_0x3c7684['appCode'],_0x987241);return{'ok':!![],'data':detailArtifact(_0x5d3a93),'message':_0x2187e3(0x17e)+_0x5d3a93['id']+(_0x5d3a93[_0x2187e3(0x18b)]?'\x20('+_0x5d3a93[_0x2187e3(0x18b)]+')':'')};},async 'dryRun'(_0x222791){const _0x3bf828=a8_0x58856d,_0x6f9398=buildArtifactInput(_0x222791);return dryRun(_0x3bf828(0x146),'/client/artifact/create')[_0x3bf828(0x158)]({'appCode':_0x222791['appCode'],..._0x6f9398})[_0x3bf828(0x188)]('Preview:\x20create\x20react_module\x20Artifact')[_0x3bf828(0x147)]();}},artifactUpdate={'service':a8_0x58856d(0x142),'command':a8_0x58856d(0x140),'description':a8_0x58856d(0x18d),'risk':'write','flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x54ce95){const _0x2c5a9f=a8_0x58856d,_0x55e8ac=_0x54ce95[_0x2c5a9f(0x16b)]('id'),_0x4811f8=buildArtifactInput(_0x54ce95),_0x5746e5=await updateRuntimeArtifact(_0x55e8ac,_0x54ce95[_0x2c5a9f(0x152)],_0x4811f8);return{'ok':!![],'data':detailArtifact(_0x5746e5),'message':'Updated\x20Artifact\x20'+_0x5746e5['id']+(_0x5746e5[_0x2c5a9f(0x18b)]?'\x20('+_0x5746e5['name']+')':'')};},async 'dryRun'(_0x3222a1){const _0x207471=a8_0x58856d,_0x24eabd=_0x3222a1['num']('id'),_0x5b5ef3=buildArtifactInput(_0x3222a1);return dryRun('POST',_0x207471(0x180)+_0x24eabd+_0x207471(0x178))['body']({'appCode':_0x3222a1[_0x207471(0x152)],..._0x5b5ef3})[_0x207471(0x188)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x24eabd)[_0x207471(0x147)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a8_0x18bf58=a8_0xef43;(function(_0xf7a5f2,_0xde8840){const _0x47144b=a8_0xef43,_0x582065=_0xf7a5f2();while(!![]){try{const _0x4fc0b=parseInt(_0x47144b(0x1ba))/0x1*(parseInt(_0x47144b(0x1e8))/0x2)+-parseInt(_0x47144b(0x1c5))/0x3*(parseInt(_0x47144b(0x1cb))/0x4)+parseInt(_0x47144b(0x1c2))/0x5+-parseInt(_0x47144b(0x1e0))/0x6*(parseInt(_0x47144b(0x1c0))/0x7)+parseInt(_0x47144b(0x1c4))/0x8+-parseInt(_0x47144b(0x1ee))/0x9+parseInt(_0x47144b(0x1eb))/0xa;if(_0x4fc0b===_0xde8840)break;else _0x582065['push'](_0x582065['shift']());}catch(_0x2f1799){_0x582065['push'](_0x582065['shift']());}}}(a8_0x7977,0x48110));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='react_module',ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a8_0x18bf58(0x1ad),a8_0x18bf58(0x1f9),a8_0x18bf58(0x1c7),a8_0x18bf58(0x1e1),a8_0x18bf58(0x1d3),a8_0x18bf58(0x1d0)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a8_0x18bf58(0x1fa)](',\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':'string','required':!![],'description':a8_0x18bf58(0x1be)},ARTIFACT_NAME_FLAG={'name':a8_0x18bf58(0x1cd),'type':a8_0x18bf58(0x1df),'description':'Artifact\x20display\x20name'},METADATA_FLAG={'name':a8_0x18bf58(0x1da),'type':a8_0x18bf58(0x1df),'description':a8_0x18bf58(0x1b8)};function isPlainObject(_0xc6dcfc){const _0x502fdb=a8_0x18bf58;return typeof _0xc6dcfc===_0x502fdb(0x1c6)&&_0xc6dcfc!==null&&!Array[_0x502fdb(0x1bb)](_0xc6dcfc);}function readSourceFile(_0x524dc0){const _0x2b270b=a8_0x18bf58;if(!_0x524dc0)throw CliErrors[_0x2b270b(0x1d1)]('File\x20path\x20is\x20required.');if(!existsSync(_0x524dc0))throw CliErrors[_0x2b270b(0x1d1)]('File\x20not\x20found:\x20'+_0x524dc0);if(!statSync(_0x524dc0)[_0x2b270b(0x1fc)]())throw CliErrors['validation'](_0x2b270b(0x1b5)+_0x524dc0);const _0x2c143c=readFileSync(_0x524dc0,_0x2b270b(0x1dd));return validateReactModuleSource(_0x2c143c),_0x2c143c;}function parseMetadata(_0x4d1ff5){const _0x272c0b=a8_0x18bf58;if(!_0x4d1ff5)return undefined;let _0x5d7c93;try{_0x5d7c93=JSON[_0x272c0b(0x1bc)](_0x4d1ff5);}catch{throw CliErrors[_0x272c0b(0x1d1)]('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x4d1ff5);}if(!isPlainObject(_0x5d7c93))throw CliErrors['validation'](_0x272c0b(0x1cc));const _0x5b5c91={..._0x5d7c93};return delete _0x5b5c91['compiledContent'],_0x5b5c91;}function a8_0x7977(){const _0x43ed87=['metadata','Preview:\x20create\x20react_module\x20Artifact','POST','utf8','lastIndex','string','3049950XlfkKz','dayjs','deleted','body','test','split','update','favorite','205336WWbXfR','Artifact\x20ID','length','7287680NWEEcI','file','detail','2889630glSFJL','str','trim','List\x20current-app\x20react_module\x20Artifacts','Updated\x20Artifact\x20','num','/client/artifact/','.\x20Unsupported:\x20','appCode','Show\x20one\x20Artifact\x20by\x20id','includes','react-dom','join','exec','isFile','react','updateTime','filter','Created\x20Artifact\x20','source','read','bool','artifact','File\x20is\x20not\x20a\x20regular\x20file:\x20','Optional\x20favorite-state\x20filter','map','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','artifactType','1RhgCjU','isArray','parse','create','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','boolean','7IDAVws','add','2854890YNaTZi','createTime','1124456KsaIVh','894mluqGs','object','lodash','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','Artifact\x20source\x20file\x20is\x20blank.','build','5616uVwfWS','--metadata\x20must\x20be\x20a\x20JSON\x20object.','name','verbose','/client/artifact/create','@ant-design/icons','validation','list','antd','description','flag','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','write','content'];a8_0x7977=function(){return _0x43ed87;};return a8_0x7977();}function getPackageName(_0xa2add6){const _0xfb7707=a8_0x18bf58;if(_0xa2add6['startsWith']('@')){const [_0x42e993,_0x36401e]=_0xa2add6[_0xfb7707(0x1e5)]('/');return _0x42e993&&_0x36401e?_0x42e993+'/'+_0x36401e:_0xa2add6;}return _0xa2add6[_0xfb7707(0x1e5)]('/')[0x0]||_0xa2add6;}function validateAllowedImports(_0x2947f0){const _0xb79332=a8_0x18bf58,_0x377b9c=new Set();for(const _0x1397bc of IMPORT_SOURCE_PATTERNS){_0x1397bc[_0xb79332(0x1de)]=0x0;let _0x4fcb89;while((_0x4fcb89=_0x1397bc[_0xb79332(0x1fb)](_0x2947f0))!==null){const _0x37d733=_0x4fcb89[0x1]?.['trim']();_0x37d733&&_0x377b9c[_0xb79332(0x1c1)](_0x37d733);}}const _0xaa490a=[..._0x377b9c][_0xb79332(0x1b7)](getPackageName)[_0xb79332(0x1af)](_0x253cea=>!ALLOWED_REACT_MODULE_IMPORTS[_0xb79332(0x1f8)](_0x253cea));if(_0xaa490a[_0xb79332(0x1ea)]>0x0)throw CliErrors[_0xb79332(0x1d1)]('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0xb79332(0x1f5)+[...new Set(_0xaa490a)][_0xb79332(0x1fa)](',\x20'));}export function validateReactModuleSource(_0x1db6f8){const _0x494915=a8_0x18bf58;if(!_0x1db6f8[_0x494915(0x1f0)]())throw CliErrors['validation'](_0x494915(0x1c9));if(PAGE_LEVEL_PATTERNS['some'](_0x2db4a6=>_0x2db4a6[_0x494915(0x1e4)](_0x1db6f8)))throw CliErrors[_0x494915(0x1d1)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x1db6f8);}function buildArtifactInput(_0x3d7add){const _0x3a2820=a8_0x18bf58,_0x2303c0=readSourceFile(_0x3d7add['str'](_0x3a2820(0x1ec))),_0x38a145=_0x3d7add[_0x3a2820(0x1ef)](_0x3a2820(0x1cd))[_0x3a2820(0x1f0)](),_0x5a3f7e=parseMetadata(_0x3d7add[_0x3a2820(0x1ef)](_0x3a2820(0x1da)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x38a145?{'name':_0x38a145}:{},'content':_0x2303c0,..._0x5a3f7e?{'metadata':_0x5a3f7e}:{},'source':ARTIFACT_SOURCE_AGENT};}function a8_0xef43(_0x3d9c02,_0x40d811){_0x3d9c02=_0x3d9c02-0x1ad;const _0x79776d=a8_0x7977();let _0xef43c5=_0x79776d[_0x3d9c02];return _0xef43c5;}function summarizeArtifact(_0x23bcaa){const _0x3c549c=a8_0x18bf58;return{'id':_0x23bcaa['id'],'name':_0x23bcaa[_0x3c549c(0x1cd)],'artifactType':_0x23bcaa['artifactType'],'source':_0x23bcaa[_0x3c549c(0x1b1)],'favorite':_0x23bcaa[_0x3c549c(0x1e7)],'deleted':_0x23bcaa[_0x3c549c(0x1e2)],'createTime':_0x23bcaa[_0x3c549c(0x1c3)],'updateTime':_0x23bcaa[_0x3c549c(0x1ae)]};}function detailArtifact(_0x4bb168){const _0x1d5a29=a8_0x18bf58;return{'id':_0x4bb168['id'],'appCode':_0x4bb168['appCode'],'name':_0x4bb168[_0x1d5a29(0x1cd)],'artifactType':_0x4bb168[_0x1d5a29(0x1b9)],'source':_0x4bb168[_0x1d5a29(0x1b1)],'favorite':_0x4bb168[_0x1d5a29(0x1e7)],'deleted':_0x4bb168[_0x1d5a29(0x1e2)],'content':_0x4bb168[_0x1d5a29(0x1d9)]??'','compiledContent':_0x4bb168['compiledContent'],'metadata':_0x4bb168[_0x1d5a29(0x1da)]??{},'createTime':_0x4bb168['createTime'],'updateTime':_0x4bb168[_0x1d5a29(0x1ae)]};}function readFavoriteFlag(_0x256afc){const _0x545f00=a8_0x18bf58,_0x3c0603=_0x256afc[_0x545f00(0x1d5)]('favorite');return _0x3c0603===undefined||_0x3c0603===null||_0x3c0603===''?undefined:_0x256afc[_0x545f00(0x1b3)](_0x545f00(0x1e7));}const artifactList={'service':'artifact','command':a8_0x18bf58(0x1d2),'description':a8_0x18bf58(0x1f1),'risk':a8_0x18bf58(0x1b2),'flags':[{'name':a8_0x18bf58(0x1b1),'type':a8_0x18bf58(0x1df),'description':a8_0x18bf58(0x1c8)},{'name':a8_0x18bf58(0x1e7),'type':a8_0x18bf58(0x1bf),'description':a8_0x18bf58(0x1b6)},VERBOSE_FLAG],async 'execute'(_0x1c1902){const _0xbb1a08=a8_0x18bf58,_0x452ae3=await listRuntimeArtifacts(_0x1c1902[_0xbb1a08(0x1f6)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x1c1902[_0xbb1a08(0x1ef)]('source')?{'source':_0x1c1902['str']('source')}:{},...readFavoriteFlag(_0x1c1902)!==undefined?{'favorite':readFavoriteFlag(_0x1c1902)}:{}});return{'ok':!![],'data':{'total':_0x452ae3['length'],'items':_0x1c1902[_0xbb1a08(0x1b3)](_0xbb1a08(0x1ce))?_0x452ae3:_0x452ae3[_0xbb1a08(0x1b7)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a8_0x18bf58(0x1ed),'description':a8_0x18bf58(0x1f7),'risk':a8_0x18bf58(0x1b2),'flags':[{...ID_FLAG,'description':a8_0x18bf58(0x1e9)}],async 'execute'(_0x35762d){const _0xd7b3e9=a8_0x18bf58,_0x27e70f=await getRuntimeArtifact(_0x35762d[_0xd7b3e9(0x1f3)]('id'),_0x35762d[_0xd7b3e9(0x1f6)]);return{'ok':!![],'data':detailArtifact(_0x27e70f)};}},artifactCreate={'service':'artifact','command':a8_0x18bf58(0x1bd),'description':a8_0x18bf58(0x1d7),'risk':a8_0x18bf58(0x1d8),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3964d6){const _0x4256e4=a8_0x18bf58,_0x1631ae=buildArtifactInput(_0x3964d6),_0x3e0b78=await createRuntimeArtifact(_0x3964d6['appCode'],_0x1631ae);return{'ok':!![],'data':detailArtifact(_0x3e0b78),'message':_0x4256e4(0x1b0)+_0x3e0b78['id']+(_0x3e0b78['name']?'\x20('+_0x3e0b78['name']+')':'')};},async 'dryRun'(_0x16784c){const _0x56e0ef=a8_0x18bf58,_0x253a64=buildArtifactInput(_0x16784c);return dryRun(_0x56e0ef(0x1dc),_0x56e0ef(0x1cf))[_0x56e0ef(0x1e3)]({'appCode':_0x16784c[_0x56e0ef(0x1f6)],..._0x253a64})[_0x56e0ef(0x1d4)](_0x56e0ef(0x1db))[_0x56e0ef(0x1ca)]();}},artifactUpdate={'service':a8_0x18bf58(0x1b4),'command':a8_0x18bf58(0x1e6),'description':a8_0x18bf58(0x1d6),'risk':a8_0x18bf58(0x1d8),'flags':[{...ID_FLAG,'description':a8_0x18bf58(0x1e9)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1d1dac){const _0x424b4d=a8_0x18bf58,_0x4b8cd9=_0x1d1dac['num']('id'),_0x23cddf=buildArtifactInput(_0x1d1dac),_0x56fbe4=await updateRuntimeArtifact(_0x4b8cd9,_0x1d1dac['appCode'],_0x23cddf);return{'ok':!![],'data':detailArtifact(_0x56fbe4),'message':_0x424b4d(0x1f2)+_0x56fbe4['id']+(_0x56fbe4[_0x424b4d(0x1cd)]?'\x20('+_0x56fbe4[_0x424b4d(0x1cd)]+')':'')};},async 'dryRun'(_0x2f6439){const _0x3183fc=a8_0x18bf58,_0x32cca3=_0x2f6439['num']('id'),_0xb4549d=buildArtifactInput(_0x2f6439);return dryRun('POST',_0x3183fc(0x1f4)+_0x32cca3+'/update')['body']({'appCode':_0x2f6439[_0x3183fc(0x1f6)],..._0xb4549d})['description']('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x32cca3)[_0x3183fc(0x1ca)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x28cd1f=a9_0x1b43;(function(_0x889d28,_0x27eafe){const _0x563db5=a9_0x1b43,_0x368c7c=_0x889d28();while(!![]){try{const _0x48e85b=-parseInt(_0x563db5(0x12d))/0x1*(-parseInt(_0x563db5(0x10f))/0x2)+-parseInt(_0x563db5(0x14f))/0x3+parseInt(_0x563db5(0x157))/0x4*(-parseInt(_0x563db5(0x13d))/0x5)+-parseInt(_0x563db5(0x106))/0x6*(parseInt(_0x563db5(0x109))/0x7)+-parseInt(_0x563db5(0x137))/0x8+-parseInt(_0x563db5(0x142))/0x9+parseInt(_0x563db5(0x126))/0xa;if(_0x48e85b===_0x27eafe)break;else _0x368c7c['push'](_0x368c7c['shift']());}catch(_0x483057){_0x368c7c['push'](_0x368c7c['shift']());}}}(a9_0x12f1,0x88f3e));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 a9_0x12f1(){const _0x4ae604=['\x20(via\x20','\x20config.\x20Nothing\x20to\x20clear.','=ak_xxx','nonInteractive','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','info','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','580472bUtMLY','daily','auth','ClientAk','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Read\x20from\x20global\x20config\x20(default)','access-key','repeat','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','slice','accessKey','187662RYXGIi','Tip:\x20you\x20can\x20also\x20run:','read','245UotIwu','stdout','string','status','envName','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','271528IXiaXP','Missing\x20accessKey.','Auth\x20config\x20reinitialized\x20in\x20','logout','write','bool','\x20config','isTTY','\x20doctor','\x20auth\x20login\x20--access-key\x20<ak_xxx>','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','env','Show\x20current\x20authentication\x20status','AccessKey\x20(ak_xxx...)','project','newConfigFileName','boolean','\x20Current\x20env:\x20','global-default','init','cancelled','Auth\x20mode:\x20','str','36642150BAiKUf','`auth\x20login`\x20does\x20not\x20support\x20--yes.','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','production','\x20config.','yes','Use\x20`','1PGzmEa','\x20Verify:\x20','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','join','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','AccessKey\x20saved\x20to\x20','\x20auth\x20status','Option\x20C:\x20environment\x20variable','\x20env\x20var','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','6541224IQWOfC','\x20scope.','test','validation','Option\x20A:\x20','Write\x20to\x20global\x20config\x20(default)','15uowEuG','ACCESS_KEY','Shorthand\x20for\x20--access-key','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','userCenterDisplayName','3994731heJdTo','trim','push','global','length','Clear\x20accessKey\x20from\x20config','login','No\x20AccessKey\x20found\x20in\x20','\x20\x20export\x20','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Clear\x20from\x20global\x20config\x20(default)','development','AccessKey\x20cleared\x20from\x20','1342380TBqWPG'];a9_0x12f1=function(){return _0x4ae604;};return a9_0x12f1();}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 _0x4f3019=a9_0x1b43;writeCliSideChannelLine(_0x4f3019(0x140)+PRODUCT_CONFIG[_0x4f3019(0x141)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x4f3019(0x107)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x4f3019(0x118));}function buildAccessKeySetupGuide(){const _0x3a2f51=a9_0x1b43;return[_0x3a2f51(0x140)+PRODUCT_CONFIG[_0x3a2f51(0x141)]+':',USER_ACCESS_KEY_CREATE_URL,_0x3a2f51(0x14b)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]'][_0x3a2f51(0x130)]('\x0a');}function canPromptForAccessKey(_0x153139){const _0x5a7f77=a9_0x1b43;return!_0x153139[_0x5a7f77(0x153)]&&process['stdin']['isTTY']!==![]&&process[_0x5a7f77(0x10a)][_0x5a7f77(0x116)]!==![];}function resolveAuthScopeFlags(_0x4903fd){const _0x5a900e=a9_0x1b43;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4903fd['bool'](_0x5a900e(0x145)),'explicitProject':_0x4903fd[_0x5a900e(0x114)](_0x5a900e(0x11d)),'policy':_0x5a900e(0x121)}));}async function resolveAuthWriteInput(_0x53ef95){const _0x51619e=a9_0x1b43;let _0x5872e8=(_0x53ef95[_0x51619e(0x125)]('access-key')||_0x53ef95[_0x51619e(0x125)]('ak')||'')[_0x51619e(0x143)]();const _0x187f07=(_0x53ef95[_0x51619e(0x125)](_0x51619e(0x11a))||'')[_0x51619e(0x143)]();if(!_0x5872e8&&canPromptForAccessKey(_0x53ef95))try{showAccessKeyCreateHint(),_0x5872e8=await promptAccessKey('');}catch(_0x377769){if(isAbortPrompt(_0x377769))throw CliErrors[_0x51619e(0x123)]();throw _0x377769;}if(!_0x5872e8)throw CliErrors[_0x51619e(0x13a)](_0x51619e(0x110),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x51619e(0x139)](_0x5872e8))throw CliErrors['validation']('Invalid\x20accessKey\x20format:\x20\x22'+_0x5872e8+'\x22',_0x51619e(0x154));if(!_0x187f07)return{'accessKey':_0x5872e8};const _0x212e8c=normalizeEnv(_0x187f07);return{'accessKey':_0x5872e8,'env':isDaily(_0x212e8c)?_0x51619e(0x158):isDev(_0x212e8c)?_0x51619e(0x14d):'production'};}function a9_0x1b43(_0x1ab3f8,_0x4ca6dd){_0x1ab3f8=_0x1ab3f8-0x103;const _0x12f1af=a9_0x12f1();let _0x1b436e=_0x12f1af[_0x1ab3f8];return _0x1b436e;}export const authDefinitions=[{'service':a9_0x28cd1f(0x159),'command':a9_0x28cd1f(0x148),'description':'Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','risk':a9_0x28cd1f(0x113),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x28cd1f(0x15d),'type':a9_0x28cd1f(0x10b),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a9_0x28cd1f(0x10b),'description':a9_0x28cd1f(0x13f)},{'name':a9_0x28cd1f(0x145),'type':a9_0x28cd1f(0x11f),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a9_0x28cd1f(0x11d),'type':'boolean','description':a9_0x28cd1f(0x15b),'default':![]}],async 'execute'(_0x268f1d){const _0x198dd2=a9_0x28cd1f;if(_0x268f1d['bool'](_0x198dd2(0x12b)))throw CliErrors[_0x198dd2(0x13a)](_0x198dd2(0x127),_0x198dd2(0x12c)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x167505=(_0x268f1d[_0x198dd2(0x125)](_0x198dd2(0x15d))||_0x268f1d[_0x198dd2(0x125)]('ak')||'')[_0x198dd2(0x143)]();if(!_0x167505&&_0x268f1d['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x345c5e=await resolveAuthWriteInput(_0x268f1d),_0x436e26=resolveAuthScopeFlags(_0x268f1d),_0x436ddb=readScopedConfig(_0x436e26);_0x436ddb[_0x198dd2(0x105)]=_0x345c5e[_0x198dd2(0x105)];_0x345c5e[_0x198dd2(0x11a)]&&(_0x436ddb['env']=_0x345c5e[_0x198dd2(0x11a)]);writeScopedConfig(_0x436ddb,_0x436e26);const _0x39ac4d=_0x436e26['global']?_0x198dd2(0x145):_0x198dd2(0x11d),_0xaf189=_0x436ddb['env']?_0x198dd2(0x120)+_0x436ddb[_0x198dd2(0x11a)]+'.':'';return{'ok':!![],'message':_0x198dd2(0x132)+_0x39ac4d+_0x198dd2(0x12a)+_0xaf189+_0x198dd2(0x12e)+CLI_BIN_NAME+_0x198dd2(0x133)};}},{'service':a9_0x28cd1f(0x159),'command':a9_0x28cd1f(0x122),'description':a9_0x28cd1f(0x131),'risk':a9_0x28cd1f(0x113),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a9_0x28cd1f(0x10b),'description':a9_0x28cd1f(0x11c)},{'name':'ak','type':'string','description':a9_0x28cd1f(0x13f)},{'name':a9_0x28cd1f(0x11a),'type':a9_0x28cd1f(0x10b),'description':a9_0x28cd1f(0x10e)},{'name':'global','type':'boolean','description':a9_0x28cd1f(0x13c),'default':!![]},{'name':a9_0x28cd1f(0x11d),'type':a9_0x28cd1f(0x11f),'description':a9_0x28cd1f(0x15b),'default':![]}],async 'execute'(_0x52c166){const _0x64dde0=a9_0x28cd1f,_0x2c6910=await resolveAuthWriteInput(_0x52c166),_0x3b49da=resolveAuthScopeFlags(_0x52c166),_0x1f2cfa={'accessKey':_0x2c6910['accessKey']};_0x2c6910[_0x64dde0(0x11a)]&&(_0x1f2cfa[_0x64dde0(0x11a)]=_0x2c6910['env']);writeScopedConfig(_0x1f2cfa,_0x3b49da);const _0x1fa204=_0x3b49da['global']?'global':_0x64dde0(0x11d),_0x17e3f5=_0x1f2cfa[_0x64dde0(0x11a)]?_0x64dde0(0x120)+_0x1f2cfa[_0x64dde0(0x11a)]+'.':'';return{'ok':!![],'message':_0x64dde0(0x111)+_0x1fa204+_0x64dde0(0x138)+_0x17e3f5+_0x64dde0(0x12e)+CLI_BIN_NAME+_0x64dde0(0x133)};}},{'service':a9_0x28cd1f(0x159),'command':a9_0x28cd1f(0x112),'description':a9_0x28cd1f(0x147),'risk':a9_0x28cd1f(0x113),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x28cd1f(0x145),'type':a9_0x28cd1f(0x11f),'description':a9_0x28cd1f(0x14c),'default':!![]},{'name':a9_0x28cd1f(0x11d),'type':a9_0x28cd1f(0x11f),'description':a9_0x28cd1f(0x103),'default':![]}],async 'execute'(_0x3c9b49){const _0xcc5468=a9_0x28cd1f,_0x2ff6a3=resolveAuthScopeFlags(_0x3c9b49),_0x774bf4=readScopedConfig(_0x2ff6a3),_0x21028e=!!_0x774bf4['accessKey'];delete _0x774bf4['accessKey'],writeScopedConfig(_0x774bf4,_0x2ff6a3);const _0x2c530d=_0x2ff6a3['global']?_0xcc5468(0x145):_0xcc5468(0x11d);if(_0x21028e)return{'ok':!![],'message':_0xcc5468(0x14e)+_0x2c530d+_0xcc5468(0x12a)};return{'ok':!![],'message':_0xcc5468(0x149)+_0x2c530d+_0xcc5468(0x151)};}},{'service':'auth','command':a9_0x28cd1f(0x10c),'description':a9_0x28cd1f(0x11b),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x28cd1f(0x145),'type':a9_0x28cd1f(0x11f),'description':a9_0x28cd1f(0x15c),'default':!![]},{'name':a9_0x28cd1f(0x11d),'type':'boolean','description':a9_0x28cd1f(0x128),'default':![]}],async 'execute'(_0x300cea){const _0x577e9b=a9_0x28cd1f,_0x535d5d=resolveAuthScopeFlags(_0x300cea),_0x3b4b49=readScopedConfig(_0x535d5d),_0x37a2b4=productEnvName('ACCESS_KEY'),_0x399a7a=productEnv(_0x577e9b(0x13e))||undefined,_0x33f3f8=_0x3b4b49[_0x577e9b(0x105)]||undefined,_0x13607b=_0x399a7a||_0x33f3f8,_0x348291=_0x399a7a?_0x37a2b4+_0x577e9b(0x135):_0x33f3f8?(_0x535d5d['global']?'global':_0x577e9b(0x11d))+_0x577e9b(0x115):null,_0x57c979=[_0x577e9b(0x124)+AUTH_MODE[_0x577e9b(0x15a)]];if(_0x13607b){const _0x9e07f9=_0x13607b[_0x577e9b(0x146)]>0x8?''+_0x13607b[_0x577e9b(0x104)](0x0,0x8)+'*'[_0x577e9b(0x15e)](_0x13607b[_0x577e9b(0x146)]-0x8):_0x13607b;_0x57c979[_0x577e9b(0x144)]('AccessKey:\x20'+_0x9e07f9+(_0x348291?_0x577e9b(0x150)+_0x348291+')':''));}return!_0x13607b&&(_0x57c979[_0x577e9b(0x144)](''),_0x57c979[_0x577e9b(0x144)](_0x577e9b(0x119)),_0x57c979[_0x577e9b(0x144)](''),_0x57c979[_0x577e9b(0x144)](_0x577e9b(0x13b)+CLI_BIN_NAME+'\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]'),_0x57c979['push'](''),_0x57c979[_0x577e9b(0x144)]('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x577e9b(0x11e)]+')'),_0x57c979[_0x577e9b(0x144)](_0x577e9b(0x136)),_0x57c979['push'](''),_0x57c979[_0x577e9b(0x144)](_0x577e9b(0x134)),_0x57c979[_0x577e9b(0x144)](_0x577e9b(0x14a)+_0x37a2b4+_0x577e9b(0x152)),_0x57c979[_0x577e9b(0x144)](''),_0x57c979[_0x577e9b(0x144)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x577e9b(0x133)),_0x57c979['push'](_0x577e9b(0x12f)+CLI_BIN_NAME+_0x577e9b(0x117))),{'ok':!![],'message':_0x57c979[_0x577e9b(0x130)]('\x0a')};}},{'service':'auth','command':a9_0x28cd1f(0x155),'description':a9_0x28cd1f(0x156),'risk':a9_0x28cd1f(0x108),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5c380f){const _0x4f15cf=a9_0x28cd1f,_0x321122=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x321122,'meta':{'env':_0x5c380f[_0x4f15cf(0x10d)]??_0x4f15cf(0x129)}}};}}];
|
|
1
|
+
const a9_0x21a553=a9_0x3837;(function(_0x5b9c30,_0x21a454){const _0x2bbdc1=a9_0x3837,_0x4ec04a=_0x5b9c30();while(!![]){try{const _0x41d543=-parseInt(_0x2bbdc1(0x182))/0x1*(-parseInt(_0x2bbdc1(0x189))/0x2)+-parseInt(_0x2bbdc1(0x193))/0x3*(-parseInt(_0x2bbdc1(0x14f))/0x4)+parseInt(_0x2bbdc1(0x152))/0x5*(parseInt(_0x2bbdc1(0x14b))/0x6)+-parseInt(_0x2bbdc1(0x175))/0x7*(parseInt(_0x2bbdc1(0x16d))/0x8)+-parseInt(_0x2bbdc1(0x146))/0x9*(-parseInt(_0x2bbdc1(0x198))/0xa)+parseInt(_0x2bbdc1(0x168))/0xb+parseInt(_0x2bbdc1(0x148))/0xc*(-parseInt(_0x2bbdc1(0x145))/0xd);if(_0x41d543===_0x21a454)break;else _0x4ec04a['push'](_0x4ec04a['shift']());}catch(_0x11172c){_0x4ec04a['push'](_0x4ec04a['shift']());}}}(a9_0x5410,0xb242a));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 a9_0x5410(){const _0x454bdc=['string','length','cancelled','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','ACCESS_KEY','Auth\x20mode:\x20','validation','AccessKey:\x20','Show\x20current\x20authentication\x20status','userCenterDisplayName','Shorthand\x20for\x20--access-key','No\x20AccessKey\x20found\x20in\x20','envName','`auth\x20login`\x20does\x20not\x20support\x20--yes.','trim','production','global','stdout','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','13409979SHeIcF','nonInteractive','str','\x20config.\x20Nothing\x20to\x20clear.','\x20doctor','40IxCpea','\x20auth\x20status','development','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','status','access-key','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','451507PdhadB','stdin','\x20\x20export\x20','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','\x20Verify:\x20','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Clear\x20accessKey\x20from\x20config','Invalid\x20accessKey\x20format:\x20\x22','init','boolean','\x20env\x20var','bool','349809YyOUwc','ClientAk','push','write','\x20scope.','\x20config.','global-default','2ExDcXS','\x20auth\x20login\x20--access-key\x20<ak_xxx>','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Write\x20to\x20global\x20config\x20(default)','newConfigFileName','AccessKey\x20(ak_xxx...)','Option\x20A:\x20','=ak_xxx','Auth\x20config\x20reinitialized\x20in\x20','AccessKey\x20cleared\x20from\x20','2523dxSoQB','info','Tip:\x20you\x20can\x20also\x20run:','auth','isTTY','297090XUIRsz','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Then\x20verify\x20with:\x20','join','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','project','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','4979hrqLpB','171XCbUXf','Read\x20from\x20global\x20config\x20(default)','66564pOVNuo','login','slice','6XWjGZd','env','Option\x20B:\x20apps\x20config\x20(','accessKey','4868ppfAzr','read','Use\x20`','101470FqhQNC','Clear\x20from\x20global\x20config\x20(default)','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)'];a9_0x5410=function(){return _0x454bdc;};return a9_0x5410();}import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';function a9_0x3837(_0x8f865b,_0x365e51){_0x8f865b=_0x8f865b-0x141;const _0x5410ca=a9_0x5410();let _0x383785=_0x5410ca[_0x8f865b];return _0x383785;}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 _0x430b42=a9_0x3837;writeCliSideChannelLine(_0x430b42(0x178)+PRODUCT_CONFIG[_0x430b42(0x15e)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x430b42(0x195)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x430b42(0x18a));}function buildAccessKeySetupGuide(){const _0x5c4784=a9_0x3837;return[_0x5c4784(0x178)+PRODUCT_CONFIG[_0x5c4784(0x15e)]+':',USER_ACCESS_KEY_CREATE_URL,_0x5c4784(0x18b)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]'][_0x5c4784(0x141)]('\x0a');}function canPromptForAccessKey(_0xac27a0){const _0x24af3e=a9_0x3837;return!_0xac27a0[_0x24af3e(0x169)]&&process[_0x24af3e(0x176)]['isTTY']!==![]&&process[_0x24af3e(0x166)][_0x24af3e(0x197)]!==![];}function resolveAuthScopeFlags(_0x4026d7){const _0x3f993c=a9_0x3837;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4026d7['bool'](_0x3f993c(0x165)),'explicitProject':_0x4026d7[_0x3f993c(0x181)](_0x3f993c(0x143)),'policy':_0x3f993c(0x188)}));}async function resolveAuthWriteInput(_0x3bdfa9){const _0x18383f=a9_0x3837;let _0x103dbe=(_0x3bdfa9[_0x18383f(0x16a)](_0x18383f(0x172))||_0x3bdfa9['str']('ak')||'')[_0x18383f(0x163)]();const _0x59b586=(_0x3bdfa9[_0x18383f(0x16a)](_0x18383f(0x14c))||'')[_0x18383f(0x163)]();if(!_0x103dbe&&canPromptForAccessKey(_0x3bdfa9))try{showAccessKeyCreateHint(),_0x103dbe=await promptAccessKey('');}catch(_0x43a61e){if(isAbortPrompt(_0x43a61e))throw CliErrors[_0x18383f(0x157)]();throw _0x43a61e;}if(!_0x103dbe)throw CliErrors[_0x18383f(0x15b)]('Missing\x20accessKey.',buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN['test'](_0x103dbe))throw CliErrors[_0x18383f(0x15b)](_0x18383f(0x17d)+_0x103dbe+'\x22','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x59b586)return{'accessKey':_0x103dbe};const _0x53bc71=normalizeEnv(_0x59b586);return{'accessKey':_0x103dbe,'env':isDaily(_0x53bc71)?'daily':isDev(_0x53bc71)?_0x18383f(0x16f):_0x18383f(0x164)};}export const authDefinitions=[{'service':'auth','command':a9_0x21a553(0x149),'description':a9_0x21a553(0x154),'risk':a9_0x21a553(0x185),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a9_0x21a553(0x155),'description':a9_0x21a553(0x18e)},{'name':'ak','type':a9_0x21a553(0x155),'description':a9_0x21a553(0x15f)},{'name':'global','type':a9_0x21a553(0x17f),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a9_0x21a553(0x143),'type':'boolean','description':a9_0x21a553(0x17b),'default':![]}],async 'execute'(_0x10940b){const _0x131725=a9_0x21a553;if(_0x10940b[_0x131725(0x181)]('yes'))throw CliErrors[_0x131725(0x15b)](_0x131725(0x162),_0x131725(0x151)+CLI_BIN_NAME+_0x131725(0x173)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x1365dd=(_0x10940b['str']('access-key')||_0x10940b[_0x131725(0x16a)]('ak')||'')[_0x131725(0x163)]();if(!_0x1365dd&&_0x10940b[_0x131725(0x169)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x2c1357=await resolveAuthWriteInput(_0x10940b),_0x45222d=resolveAuthScopeFlags(_0x10940b),_0x43e8fe=readScopedConfig(_0x45222d);_0x43e8fe[_0x131725(0x14e)]=_0x2c1357[_0x131725(0x14e)];_0x2c1357[_0x131725(0x14c)]&&(_0x43e8fe[_0x131725(0x14c)]=_0x2c1357[_0x131725(0x14c)]);writeScopedConfig(_0x43e8fe,_0x45222d);const _0x21f0f3=_0x45222d[_0x131725(0x165)]?_0x131725(0x165):'project',_0xfb4c6f=_0x43e8fe[_0x131725(0x14c)]?'\x20Current\x20env:\x20'+_0x43e8fe[_0x131725(0x14c)]+'.':'';return{'ok':!![],'message':'AccessKey\x20saved\x20to\x20'+_0x21f0f3+_0x131725(0x187)+_0xfb4c6f+_0x131725(0x179)+CLI_BIN_NAME+_0x131725(0x16e)};}},{'service':a9_0x21a553(0x196),'command':a9_0x21a553(0x17e),'description':a9_0x21a553(0x144),'risk':a9_0x21a553(0x185),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x21a553(0x172),'type':a9_0x21a553(0x155),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a9_0x21a553(0x155),'description':a9_0x21a553(0x15f)},{'name':a9_0x21a553(0x14c),'type':a9_0x21a553(0x155),'description':'Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config'},{'name':'global','type':a9_0x21a553(0x17f),'description':a9_0x21a553(0x18c),'default':!![]},{'name':a9_0x21a553(0x143),'type':a9_0x21a553(0x17f),'description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x11083f){const _0x463877=a9_0x21a553,_0x46527f=await resolveAuthWriteInput(_0x11083f),_0x2b8435=resolveAuthScopeFlags(_0x11083f),_0x196333={'accessKey':_0x46527f[_0x463877(0x14e)]};_0x46527f['env']&&(_0x196333[_0x463877(0x14c)]=_0x46527f[_0x463877(0x14c)]);writeScopedConfig(_0x196333,_0x2b8435);const _0x40e670=_0x2b8435[_0x463877(0x165)]?'global':'project',_0x131289=_0x196333[_0x463877(0x14c)]?'\x20Current\x20env:\x20'+_0x196333[_0x463877(0x14c)]+'.':'';return{'ok':!![],'message':_0x463877(0x191)+_0x40e670+_0x463877(0x186)+_0x131289+_0x463877(0x179)+CLI_BIN_NAME+_0x463877(0x16e)};}},{'service':a9_0x21a553(0x196),'command':'logout','description':a9_0x21a553(0x17c),'risk':a9_0x21a553(0x185),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x21a553(0x165),'type':a9_0x21a553(0x17f),'description':a9_0x21a553(0x153),'default':!![]},{'name':'project','type':a9_0x21a553(0x17f),'description':a9_0x21a553(0x199),'default':![]}],async 'execute'(_0x27981e){const _0x709a32=a9_0x21a553,_0x5a1fb3=resolveAuthScopeFlags(_0x27981e),_0x321399=readScopedConfig(_0x5a1fb3),_0x2a80de=!!_0x321399[_0x709a32(0x14e)];delete _0x321399[_0x709a32(0x14e)],writeScopedConfig(_0x321399,_0x5a1fb3);const _0x10b1ad=_0x5a1fb3[_0x709a32(0x165)]?_0x709a32(0x165):_0x709a32(0x143);if(_0x2a80de)return{'ok':!![],'message':_0x709a32(0x192)+_0x10b1ad+_0x709a32(0x187)};return{'ok':!![],'message':_0x709a32(0x160)+_0x10b1ad+_0x709a32(0x16b)};}},{'service':a9_0x21a553(0x196),'command':a9_0x21a553(0x171),'description':a9_0x21a553(0x15d),'risk':a9_0x21a553(0x150),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x21a553(0x165),'type':a9_0x21a553(0x17f),'description':a9_0x21a553(0x147),'default':!![]},{'name':a9_0x21a553(0x143),'type':a9_0x21a553(0x17f),'description':a9_0x21a553(0x17a),'default':![]}],async 'execute'(_0x264fed){const _0x36ffc7=a9_0x21a553,_0x587447=resolveAuthScopeFlags(_0x264fed),_0x4eb87a=readScopedConfig(_0x587447),_0x461a15=productEnvName(_0x36ffc7(0x159)),_0x915c45=productEnv('ACCESS_KEY')||undefined,_0x15f1d8=_0x4eb87a[_0x36ffc7(0x14e)]||undefined,_0xe07914=_0x915c45||_0x15f1d8,_0x1a5732=_0x915c45?_0x461a15+_0x36ffc7(0x180):_0x15f1d8?(_0x587447['global']?'global':_0x36ffc7(0x143))+'\x20config':null,_0x1893d6=[_0x36ffc7(0x15a)+AUTH_MODE[_0x36ffc7(0x183)]];if(_0xe07914){const _0x216fac=_0xe07914[_0x36ffc7(0x156)]>0x8?''+_0xe07914[_0x36ffc7(0x14a)](0x0,0x8)+'*'['repeat'](_0xe07914['length']-0x8):_0xe07914;_0x1893d6['push'](_0x36ffc7(0x15c)+_0x216fac+(_0x1a5732?'\x20(via\x20'+_0x1a5732+')':''));}return!_0xe07914&&(_0x1893d6[_0x36ffc7(0x184)](''),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x158)),_0x1893d6[_0x36ffc7(0x184)](''),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x18f)+CLI_BIN_NAME+_0x36ffc7(0x167)),_0x1893d6['push'](''),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x14d)+PRODUCT_CONFIG[_0x36ffc7(0x18d)]+')'),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x174)),_0x1893d6['push'](''),_0x1893d6['push']('Option\x20C:\x20environment\x20variable'),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x177)+_0x461a15+_0x36ffc7(0x190)),_0x1893d6[_0x36ffc7(0x184)](''),_0x1893d6[_0x36ffc7(0x184)](_0x36ffc7(0x19a)+CLI_BIN_NAME+_0x36ffc7(0x16e)),_0x1893d6['push'](_0x36ffc7(0x142)+CLI_BIN_NAME+_0x36ffc7(0x16c))),{'ok':!![],'message':_0x1893d6[_0x36ffc7(0x141)]('\x0a')};}},{'service':a9_0x21a553(0x196),'command':a9_0x21a553(0x194),'description':a9_0x21a553(0x170),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x433d5f){const _0xd39dad=a9_0x21a553,_0x2b3be6=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x2b3be6,'meta':{'env':_0x433d5f[_0xd39dad(0x161)]??_0xd39dad(0x164)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xe10277,_0x401168){const _0x19d8c6=a10_0x5408,_0x4da775=_0xe10277();while(!![]){try{const _0x16f2f5=-parseInt(_0x19d8c6(0x1d8))/0x1+parseInt(_0x19d8c6(0x1ca))/0x2+-parseInt(_0x19d8c6(0x1d0))/0x3*(-parseInt(_0x19d8c6(0x1cc))/0x4)+parseInt(_0x19d8c6(0x1d2))/0x5+-parseInt(_0x19d8c6(0x1db))/0x6+-parseInt(_0x19d8c6(0x1ce))/0x7*(parseInt(_0x19d8c6(0x1d4))/0x8)+parseInt(_0x19d8c6(0x1cd))/0x9*(parseInt(_0x19d8c6(0x1d9))/0xa);if(_0x16f2f5===_0x401168)break;else _0x4da775['push'](_0x4da775['shift']());}catch(_0x364ae2){_0x4da775['push'](_0x4da775['shift']());}}}(a10_0x21a4,0x4fda4));import{createInterface}from'node:readline';function a10_0x5408(_0x4d0c23,_0x3eacd2){_0x4d0c23=_0x4d0c23-0x1c9;const _0x21a4ec=a10_0x21a4();let _0x540818=_0x21a4ec[_0x4d0c23];return _0x540818;}class AbortPrompt extends Error{constructor(){const _0x4356d4=a10_0x5408;super('User\x20aborted\x20prompt'),this[_0x4356d4(0x1cb)]=_0x4356d4(0x1d6);}}function createSafeRl(){const _0x1ef04a=a10_0x5408,_0x3579f1=createInterface({'input':process[_0x1ef04a(0x1d1)],'output':process[_0x1ef04a(0x1c9)]});let _0x4c2aac;const _0x9ae07a=new Promise((_0x13561d,_0x3a4243)=>{const _0x15dc55=_0x1ef04a;_0x4c2aac=()=>{const _0xb1d6e9=a10_0x5408;_0x4c2aac&&(_0x3579f1[_0xb1d6e9(0x1d7)]('SIGINT',_0x4c2aac),_0x4c2aac=undefined);try{_0x3579f1['close']();}catch{}_0x3a4243(new AbortPrompt());},_0x3579f1[_0x15dc55(0x1d5)]('SIGINT',_0x4c2aac);}),_0x5dce85=()=>{const _0x21bc7b=_0x1ef04a;_0x4c2aac&&(_0x3579f1[_0x21bc7b(0x1d7)](_0x21bc7b(0x1cf),_0x4c2aac),_0x4c2aac=undefined);try{_0x3579f1['close']();}catch{}};return{'rl':_0x3579f1,'abortPromise':_0x9ae07a,'disposeSuccess':_0x5dce85};}export async function promptAccessKey(_0x51925f=''){const _0x23bc80=a10_0x5408,{rl:_0x3680a4,abortPromise:_0x1e77c2,disposeSuccess:_0x34f68c}=createSafeRl(),_0x5d99d5=new Promise(_0x4568aa=>{const _0x7cfeb9=a10_0x5408,_0x1b55eb=_0x51925f?'AccessKey\x20('+_0x51925f+_0x7cfeb9(0x1d3):'AccessKey\x20(paste\x20ak_...):\x20';_0x3680a4['question'](_0x1b55eb,_0x468b05=>{_0x34f68c(),_0x4568aa(_0x468b05['trim']()||_0x51925f);});});return Promise[_0x23bc80(0x1da)]([_0x5d99d5,_0x1e77c2]);}export function isAbortPrompt(_0x30910d){const _0x3d3d0f=a10_0x5408;return _0x30910d instanceof Error&&_0x30910d[_0x3d3d0f(0x1cb)]===_0x3d3d0f(0x1d6);}function a10_0x21a4(){const _0x2cb092=['stdin','1886205EWdAGy','):\x20','8EJfjTp','once','AbortPrompt','removeListener','505533DPuCyb','10GmLKfc','race','2710650QTuObH','stdout','623962dxkeWn','name','760sDcDKQ','7282449mpsalB','2260083BbjkYl','SIGINT','1719LVpQFE'];a10_0x21a4=function(){return _0x2cb092;};return a10_0x21a4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a11_0x3e3b(_0x1ff22e,_0x5e1633){_0x1ff22e=_0x1ff22e-0x73;const _0x425d2d=a11_0x425d();let _0x3e3b73=_0x425d2d[_0x1ff22e];return _0x3e3b73;}const a11_0x2b3a99=a11_0x3e3b;(function(_0x4694af,_0x33bd36){const _0x4fa62f=a11_0x3e3b,_0x4267f9=_0x4694af();while(!![]){try{const _0x3bfc1c=parseInt(_0x4fa62f(0x73))/0x1+-parseInt(_0x4fa62f(0x7a))/0x2+-parseInt(_0x4fa62f(0x78))/0x3+-parseInt(_0x4fa62f(0x80))/0x4*(parseInt(_0x4fa62f(0x79))/0x5)+parseInt(_0x4fa62f(0x7d))/0x6+-parseInt(_0x4fa62f(0x7b))/0x7+-parseInt(_0x4fa62f(0x7e))/0x8*(-parseInt(_0x4fa62f(0x7f))/0x9);if(_0x3bfc1c===_0x33bd36)break;else _0x4267f9['push'](_0x4267f9['shift']());}catch(_0x52164a){_0x4267f9['push'](_0x4267f9['shift']());}}}(a11_0x425d,0x6f661));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':'bff','command':a11_0x2b3a99(0x75),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':'read','flags':[{...ID_FLAG,'description':a11_0x2b3a99(0x74)},VERBOSE_FLAG],async 'execute'(_0x2ad1e0){const _0x572913=a11_0x2b3a99,_0x35ec13=await getBffScriptInfo(_0x2ad1e0[_0x572913(0x82)]('id')),_0x1d5fde=_0x2ad1e0['bool']('verbose');if(_0x1d5fde)return{'ok':!![],'data':_0x35ec13};return{'ok':!![],'data':{'id':_0x35ec13['id'],'appCode':_0x35ec13['appCode'],'functionName':_0x35ec13[_0x572913(0x76)]??'','scriptType':_0x35ec13['scriptType'],'description':_0x35ec13['description']||_0x572913(0x7c),'createdTime':_0x35ec13[_0x572913(0x81)]??'','updatedTime':_0x35ec13[_0x572913(0x77)]??''}};}};function a11_0x425d(){const _0x500c4c=['updatedTime','1839372fWeMkv','10TLyykq','118172EXECmQ','4286198vpXTPF','(none)','4044600mZQFbO','8iLGmUy','11332197CwGbBn','860740nkxNwz','createdTime','num','237950EELuFk','Script\x20ID','detail','functionName'];a11_0x425d=function(){return _0x500c4c;};return a11_0x425d();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x497098=a12_0x4a16;(function(_0x4fb098,_0x828c95){const _0x154e4f=a12_0x4a16,_0x343d86=_0x4fb098();while(!![]){try{const _0x4e82ae=parseInt(_0x154e4f(0x1cd))/0x1*(parseInt(_0x154e4f(0x1cf))/0x2)+-parseInt(_0x154e4f(0x1c5))/0x3*(-parseInt(_0x154e4f(0x1c6))/0x4)+-parseInt(_0x154e4f(0x1cc))/0x5+-parseInt(_0x154e4f(0x1d0))/0x6+parseInt(_0x154e4f(0x1d1))/0x7+-parseInt(_0x154e4f(0x1ca))/0x8+-parseInt(_0x154e4f(0x1ce))/0x9;if(_0x4e82ae===_0x828c95)break;else _0x343d86['push'](_0x343d86['shift']());}catch(_0x206d43){_0x343d86['push'](_0x343d86['shift']());}}}(a12_0x1a36,0x797d8));function a12_0x1a36(){const _0x1a4fce=['BFF\x20executed\x20in\x20','6FHLvYe','926284thZdsm','now','params','name','965192RFryEh','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','116535XAWBwG','2416ozvBMk','11859516KQXKPD','718bFVYzB','524862KyaUMo','5014065OrafPY','read','bff','str'];a12_0x1a36=function(){return _0x1a4fce;};return a12_0x1a36();}import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';function a12_0x4a16(_0x2af592,_0x3e9cc2){_0x2af592=_0x2af592-0x1c2;const _0x1a366b=a12_0x1a36();let _0x4a1694=_0x1a366b[_0x2af592];return _0x4a1694;}import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a12_0x497098(0x1c2),'command':'exec','description':a12_0x497098(0x1cb),'risk':a12_0x497098(0x1d2),'flags':[{...NAME_FLAG,'required':!![],'description':'BFF\x20function\x20name\x20to\x20execute'},PARAMS_FLAG],async 'execute'(_0x302e00){const _0x59bb2e=a12_0x497098,_0x22021c=parseJsonParams(_0x302e00[_0x59bb2e(0x1c3)](_0x59bb2e(0x1c8))),_0x15eec8=Date[_0x59bb2e(0x1c7)](),_0x4e3f09=await executeSdkBff(_0x302e00[_0x59bb2e(0x1c3)](_0x59bb2e(0x1c9)),_0x22021c),_0xa934d7=Date[_0x59bb2e(0x1c7)]()-_0x15eec8;return{'ok':!![],'data':{'result':_0x4e3f09,'elapsed':_0xa934d7},'message':_0x59bb2e(0x1c4)+_0xa934d7+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f8cbd,_0x52e684){const _0x466e05=a13_0x5e71,_0x11e90e=_0x3f8cbd();while(!![]){try{const _0x529bca=parseInt(_0x466e05(0xa1))/0x1+parseInt(_0x466e05(0xa0))/0x2*(parseInt(_0x466e05(0x9d))/0x3)+-parseInt(_0x466e05(0xa5))/0x4*(-parseInt(_0x466e05(0x9e))/0x5)+-parseInt(_0x466e05(0xa2))/0x6*(parseInt(_0x466e05(0xa3))/0x7)+-parseInt(_0x466e05(0xa4))/0x8+-parseInt(_0x466e05(0x9b))/0x9*(-parseInt(_0x466e05(0x9f))/0xa)+parseInt(_0x466e05(0x9c))/0xb;if(_0x529bca===_0x52e684)break;else _0x11e90e['push'](_0x11e90e['shift']());}catch(_0x8df496){_0x11e90e['push'](_0x11e90e['shift']());}}}(a13_0x45c9,0xaf05b));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a13_0x5e71(_0x16704f,_0x26dc51){_0x16704f=_0x16704f-0x9b;const _0x45c9aa=a13_0x45c9();let _0x5e7174=_0x45c9aa[_0x16704f];return _0x5e7174;}function a13_0x45c9(){const _0x47617e=['136870mEIpoJ','20TKXBJC','53426NGeUDl','1496658QNRdaJ','28CcULFL','8403992hoJtSW','2752604tqNbdO','747vbIOYW','6553404MjCHUU','87540pGfllC','5DwDDxx'];a13_0x45c9=function(){return _0x47617e;};return a13_0x45c9();}export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10c2a4,_0x35976a){const _0x72bb81=a14_0x3641,_0x499ace=_0x10c2a4();while(!![]){try{const _0x126068=-parseInt(_0x72bb81(0x91))/0x1*(-parseInt(_0x72bb81(0x8b))/0x2)+parseInt(_0x72bb81(0x90))/0x3+-parseInt(_0x72bb81(0x92))/0x4*(-parseInt(_0x72bb81(0x9a))/0x5)+parseInt(_0x72bb81(0x8a))/0x6*(parseInt(_0x72bb81(0x8e))/0x7)+parseInt(_0x72bb81(0x9f))/0x8+parseInt(_0x72bb81(0x8d))/0x9*(-parseInt(_0x72bb81(0x8f))/0xa)+-parseInt(_0x72bb81(0x9e))/0xb;if(_0x126068===_0x35976a)break;else _0x499ace['push'](_0x499ace['shift']());}catch(_0x36116a){_0x499ace['push'](_0x499ace['shift']());}}}(a14_0x341f,0xcb31e));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';function a14_0x341f(){const _0x26e4fc=[',\x20or\x20run\x20`','\x20init`\x20first.','\x20(global)','project-default','108695NfcpQO','Use\x20only\x20one\x20config\x20scope\x20flag.','Not\x20inside\x20a\x20project\x20(no\x20','inProject','20114347qiakqm','5421656YAPKjX','project','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','global','project-or-global-explicit','6RIlPWM','5764uqAshu','Add\x20--global\x20to\x20write\x20to\x20~/','270117vOtBVv','11454919mWKftF','210gBTARM','385110RmHfAN','38dNNNtB','136aIfDPd','newConfigFileName','\x20found).','validation'];a14_0x341f=function(){return _0x26e4fc;};return a14_0x341f();}export{RUNTIME_ENV_VALUES}from'../../constant/env.js';export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x3b6e33){const _0x2506c2=a14_0x3641,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x2907c8}=_0x3b6e33;if(explicitGlobal&&explicitProject)throw CliErrors[_0x2506c2(0x95)](_0x2506c2(0x87),_0x2506c2(0x9b));if(explicitGlobal)return'global';if(explicitProject)return'project';switch(_0x2907c8){case'global-default':return _0x2506c2(0x88);case _0x2506c2(0x99):return _0x3b6e33[_0x2506c2(0x9d)]??isInProject()?'project':_0x2506c2(0x88);case _0x2506c2(0x89):if(!(_0x3b6e33[_0x2506c2(0x9d)]??isInProject()))throw CliErrors[_0x2506c2(0x95)](_0x2506c2(0x9c)+PRODUCT_CONFIG[_0x2506c2(0x93)]+_0x2506c2(0x94),_0x2506c2(0x8c)+PRODUCT_CONFIG[_0x2506c2(0x93)]+_0x2506c2(0x96)+CLI_BIN_NAME+_0x2506c2(0x97));return _0x2506c2(0xa0);}}function a14_0x3641(_0x12f802,_0x481d8e){_0x12f802=_0x12f802-0x87;const _0x341fda=a14_0x341f();let _0x3641a4=_0x341fda[_0x12f802];return _0x3641a4;}export function toScopeFlags(_0xc086a0){const _0x2fbbe6=a14_0x3641;return{'global':_0xc086a0===_0x2fbbe6(0x88)};}export function formatScopeLabel(_0x161e38){const _0x1e8fde=a14_0x3641;return _0x161e38===_0x1e8fde(0x88)?_0x1e8fde(0x98):'';}
|