@lovrabet/lovrabet-cli 2.1.3 → 2.1.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -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 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x9e618c=a0_0x4cf3;(function(_0x26c7a5,_0x5ec80d){const _0x3ea016=a0_0x4cf3,_0x529c65=_0x26c7a5();while(!![]){try{const _0x5b7c50=-parseInt(_0x3ea016(0x11b))/0x1+parseInt(_0x3ea016(0x114))/0x2*(parseInt(_0x3ea016(0x130))/0x3)+-parseInt(_0x3ea016(0x10f))/0x4+parseInt(_0x3ea016(0x10b))/0x5+-parseInt(_0x3ea016(0x118))/0x6+-parseInt(_0x3ea016(0x119))/0x7*(parseInt(_0x3ea016(0x12c))/0x8)+parseInt(_0x3ea016(0x123))/0x9;if(_0x5b7c50===_0x5ec80d)break;else _0x529c65['push'](_0x529c65['shift']());}catch(_0x3204a1){_0x529c65['push'](_0x529c65['shift']());}}}(a0_0x2afc,0x243fe));function a0_0x4cf3(_0x2e58fa,_0x20b90e){_0x2e58fa=_0x2e58fa-0x10b;const _0x2afcb7=a0_0x2afc();let _0x4cf321=_0x2afcb7[_0x2e58fa];return _0x4cf321;}import{jsx as a0_0x387c9e}from'react/jsx-runtime';import a0_0x575f68 from'meow';import{render}from'ink';import{Help}from'./help.js';function a0_0x2afc(){const _0x4d1f10=['unknownCommand','message','original','66SLzSyR','220600mVEUow','flatMap','cancelled','ERR_STREAM_DESTROYED','1162876sxolsd','log','Error:\x20','handler','help','19702VUcONW','\x20->\x20--','exit','args','583404NFrZMI','42MtBcok','error','274855YPapNZ','catch','stderr','write','./framework/preparse.js','code','\x0aCancelled.\x0a','name','5971464hUgHBp','length','input','flags','hint','defaultCommand','Hint:\x20','assign','slice','150736bDRrDh'];a0_0x2afc=function(){return _0x4d1f10;};return a0_0x2afc();}import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{generateDynamicServiceHelp,resolveDynamicServiceCommand}from'./commands/service/dynamic.js';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_0x575f68(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x9e618c(0x11c)](handleError);async function main(){try{await run();}catch(_0x1f0e9a){handleError(_0x1f0e9a);}}async function run(){const _0x303a93=a0_0x9e618c;let _0x3ba580=cli[_0x303a93(0x125)][0x0],_0x26a0fc=cli[_0x303a93(0x125)][0x1];const _0x2158c2=cli[_0x303a93(0x126)];try{const {correctFlags:_0x4c3245}=await import(_0x303a93(0x11f)),_0x11a84f=getAllDefinitions()[_0x303a93(0x10c)](_0x49d325=>_0x49d325[_0x303a93(0x126)]??[]),{flags:_0x1f4cb1,corrections:_0x587077}=_0x4c3245(_0x2158c2,_0x11a84f);if(_0x587077[_0x303a93(0x124)]>0x0){for(const _0x28e024 of _0x587077){process['stderr'][_0x303a93(0x11e)]('[preparse]\x20'+_0x28e024[_0x303a93(0x112)]+':\x20--'+_0x28e024[_0x303a93(0x12f)]+_0x303a93(0x115)+_0x28e024['corrected']+'\x0a');}Object[_0x303a93(0x12a)](_0x2158c2,_0x1f4cb1);}}catch{}if(!_0x3ba580){const {waitUntilExit:_0x1b1b7e}=render(a0_0x387c9e(Help,{}));await _0x1b1b7e();return;}if(!isKnownService(_0x3ba580)){const _0x1a9c1a=resolveDynamicServiceCommand(cli['input'],_0x2158c2);if(_0x1a9c1a){if(_0x2158c2[_0x303a93(0x113)]){console[_0x303a93(0x110)](generateCommandHelp(_0x1a9c1a['definition']));return;}Object[_0x303a93(0x12a)](_0x2158c2,_0x1a9c1a['flags']);const _0x3f222a=buildConfigFromFlags(_0x2158c2);await initGlobalEnvironment(_0x3f222a);const _0x14e926=createPipelineEnv(_0x3f222a,_0x2158c2);_0x14e926[_0x303a93(0x117)]=_0x1a9c1a[_0x303a93(0x117)],await runCommand(_0x1a9c1a['definition'],_0x14e926);return;}if(_0x2158c2[_0x303a93(0x113)]){const _0x5650a2=generateDynamicServiceHelp(_0x3ba580);if(_0x5650a2){console[_0x303a93(0x110)](_0x5650a2);return;}}const {waitUntilExit:_0x25d551}=render(a0_0x387c9e(Help,{}));await _0x25d551();return;}const _0x3197fb=getServiceEntry(_0x3ba580);if(!_0x26a0fc){if(_0x2158c2[_0x303a93(0x113)]){console[_0x303a93(0x110)](generateServiceHelp(_0x3ba580));return;}if(_0x3197fb[_0x303a93(0x128)])_0x26a0fc=_0x3197fb[_0x303a93(0x128)];else{console['log'](generateServiceHelp(_0x3ba580));return;}}const _0x32f7ec=findDefinition(_0x3ba580,_0x26a0fc);!_0x32f7ec&&(console['log'](generateServiceHelp(_0x3ba580)),handleError(CliErrors[_0x303a93(0x12d)](_0x3ba580+'\x20'+_0x26a0fc)));if(_0x2158c2[_0x303a93(0x113)]){console[_0x303a93(0x110)](generateCommandHelp(_0x32f7ec));return;}const _0x1367d6=buildConfigFromFlags(_0x2158c2);await initGlobalEnvironment(_0x1367d6);const _0x4e13ef=createPipelineEnv(_0x1367d6,_0x2158c2);_0x4e13ef[_0x303a93(0x117)]=cli['input'][_0x303a93(0x12b)](0x2),await runCommand(_0x32f7ec,_0x4e13ef);}function handleError(_0x6d7ad8){const _0x5a1c2e=a0_0x9e618c;if(_0x6d7ad8 instanceof CliError){_0x6d7ad8[_0x5a1c2e(0x120)]===_0x5a1c2e(0x10d)&&(process[_0x5a1c2e(0x11d)]['write'](_0x5a1c2e(0x121)),process[_0x5a1c2e(0x116)](0x0));console[_0x5a1c2e(0x11a)](_0x5a1c2e(0x111)+_0x6d7ad8[_0x5a1c2e(0x12e)]);if(_0x6d7ad8['hint'])console[_0x5a1c2e(0x11a)](_0x5a1c2e(0x129)+_0x6d7ad8[_0x5a1c2e(0x127)]);process['exit'](_0x6d7ad8['exitCode']);}isUserCancellation(_0x6d7ad8)&&(process[_0x5a1c2e(0x11d)][_0x5a1c2e(0x11e)](_0x5a1c2e(0x121)),process['exit'](0x0)),console[_0x5a1c2e(0x11a)]('Unexpected\x20error:',_0x6d7ad8),process[_0x5a1c2e(0x116)](0x1);}function isUserCancellation(_0x3eeaa4){const _0x5d1942=a0_0x9e618c;if(!(_0x3eeaa4 instanceof Error))return![];if(_0x3eeaa4[_0x5d1942(0x122)]==='ExitPromptError')return!![];if(_0x3eeaa4[_0x5d1942(0x120)]==='ERR_USE_AFTER_CLOSE')return!![];if(_0x3eeaa4[_0x5d1942(0x120)]===_0x5d1942(0x10e))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a1_0x4191(){const _0x2fc06b=['需要向指定数据集新增一条业务数据时使用','validation','/api/endpoint/{appCode}/{scriptName}','str','dataset','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','查询单条数据','list','1555128TSUmpF','/api/dataset/getOneByCode?code={datasetCode}','Execute\x20BF\x20endpoint\x20function','code','{\x22id\x22:123}','toLowerCase','/api/{appCode}/{datasetCode}/getOne','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','read','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','length','32-character\x20dataset\x20code','获取数据集详情','api-doc','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','{\x22param\x22:\x22value\x22}','GET','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','POST','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','string','dataset_data_get_one','List\x20BF\x20endpoint\x20functions','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','Dataset\x20detail','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','聚合查询数据集数据','472040kmARly','执行指定\x20BF\x20函数','result\x20rows\x20contain\x20aggregate\x20aliases','1749576HiWmMO','title','dataset_data_aggregate','Returns\x20SQL\x20execution\x20payload','trim','15NfunJd','datasetCode','bf_execute','1333904fkXGCd','dataset_data_filter','dataset_detail','whenToUse','filter','API\x20doc\x20code\x20not\x20found:\x20','join','创建数据','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','1396192itUiBC','1Jlgorm','appCode','/api/{appCode}/{datasetCode}/aggregate','{\x22fieldName\x22:\x22value\x22}','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','fields/properties\x20describe\x20data\x20shape','##\x20List\x20datasets','custom_sql','获取应用下可调用的\x20BF\x20函数列表','category','List\x20available\x20runtime\x20API\x20documentation\x20entries','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','method','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','/api/endpoint/{appCode}/functions','List\x20datasets','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','Aggregate\x20dataset\x20data','tableData\x20contains\x20records','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','8118531MiKfeX','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','paging.totalCount\x20gives\x20total\x20rows','716118sGrxvx','dataset_list','find','/api/{appCode}/{datasetCode}/filter','scriptName','35hxqtFN','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','Endpoint\x20function\x20name','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','map','path','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','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','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Current\x20app\x20code','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','条件过滤查询数据','tableData\x20contains\x20dataset\x20id/code/name','Returns\x20one\x20matching\x20business\x20record','Create\x20dataset\x20record','paging\x20contains\x20pagination','##\x20Dataset\x20detail','summary','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','keyword','/api/custom/executeSql'];a1_0x4191=function(){return _0x2fc06b;};return a1_0x4191();}const a1_0x1f3e0f=a1_0x21de;(function(_0x26ccc1,_0x68a4b){const _0xeb741a=a1_0x21de,_0x2ea71d=_0x26ccc1();while(!![]){try{const _0x43e7dc=parseInt(_0xeb741a(0x9f))/0x1*(parseInt(_0xeb741a(0xb6))/0x2)+-parseInt(_0xeb741a(0x8d))/0x3+-parseInt(_0xeb741a(0x95))/0x4+parseInt(_0xeb741a(0x92))/0x5*(-parseInt(_0xeb741a(0xdd))/0x6)+-parseInt(_0xeb741a(0xbb))/0x7*(-parseInt(_0xeb741a(0x9e))/0x8)+parseInt(_0xeb741a(0xb3))/0x9+parseInt(_0xeb741a(0x8a))/0xa;if(_0x43e7dc===_0x68a4b)break;else _0x2ea71d['push'](_0x2ea71d['shift']());}catch(_0x1123c4){_0x2ea71d['push'](_0x2ea71d['shift']());}}}(a1_0x4191,0x7694e));import{CliErrors}from'../../errors.js';function a1_0x21de(_0x3758ab,_0x2191cf){_0x3758ab=_0x3758ab-0x6e;const _0x419139=a1_0x4191();let _0x21dea2=_0x419139[_0x3758ab];return _0x21dea2;}const CATEGORY_FLAG={'name':a1_0x1f3e0f(0xa8),'type':a1_0x1f3e0f(0x82),'description':a1_0x1f3e0f(0xda)},KEYWORD_FLAG={'name':a1_0x1f3e0f(0xd3),'type':a1_0x1f3e0f(0x82),'description':a1_0x1f3e0f(0x7a)},DOC_CODE_FLAG={'name':a1_0x1f3e0f(0x6f),'type':a1_0x1f3e0f(0x82),'required':!![],'description':'API\x20doc\x20code,\x20for\x20example\x20dataset_list'},DOCS=[{'code':a1_0x1f3e0f(0xb7),'category':a1_0x1f3e0f(0xd9),'title':a1_0x1f3e0f(0xae),'method':a1_0x1f3e0f(0x7f),'path':'/api/dataset/get-dataset-list-by-app-code','summary':'分页获取数据集列表','whenToUse':a1_0x1f3e0f(0x7e),'pathParams':[],'queryParams':[],'bodySchema':a1_0x1f3e0f(0xbf),'responseHighlights':[a1_0x1f3e0f(0xca),a1_0x1f3e0f(0xb5)],'examples':[a1_0x1f3e0f(0x88)],'notes':[a1_0x1f3e0f(0xb2)],'markdown':[a1_0x1f3e0f(0xa5),'',a1_0x1f3e0f(0xc8)][a1_0x1f3e0f(0x9b)]('\x0a')},{'code':a1_0x1f3e0f(0x97),'category':a1_0x1f3e0f(0xd9),'title':a1_0x1f3e0f(0x86),'method':a1_0x1f3e0f(0x7d),'path':a1_0x1f3e0f(0xde),'summary':a1_0x1f3e0f(0x78),'whenToUse':a1_0x1f3e0f(0x73),'pathParams':[],'queryParams':[{'name':a1_0x1f3e0f(0x6f),'description':a1_0x1f3e0f(0x77)}],'bodySchema':'None','responseHighlights':[a1_0x1f3e0f(0xa4),'operations\x20describes\x20runtime\x20APIs'],'examples':['lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>'],'notes':[a1_0x1f3e0f(0x81)],'markdown':[a1_0x1f3e0f(0xce),'','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x1f3e0f(0x9b)]('\x0a')},{'code':a1_0x1f3e0f(0x96),'category':'dataset','title':'Filter\x20dataset\x20data','method':'POST','path':a1_0x1f3e0f(0xb9),'summary':a1_0x1f3e0f(0xc9),'whenToUse':'需要携带\x20where、orderBy、分页等条件读取业务数据时使用','pathParams':[{'name':a1_0x1f3e0f(0xa0),'description':a1_0x1f3e0f(0xc5)},{'name':'datasetCode','description':a1_0x1f3e0f(0x77)}],'queryParams':[],'bodySchema':a1_0x1f3e0f(0xc6),'responseHighlights':[a1_0x1f3e0f(0xb1),a1_0x1f3e0f(0xcd)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27'],'notes':[a1_0x1f3e0f(0xd1)],'markdown':['##\x20Filter\x20dataset\x20data','',a1_0x1f3e0f(0xaf)]['join']('\x0a')},{'code':a1_0x1f3e0f(0x8f),'category':'dataset','title':a1_0x1f3e0f(0xb0),'method':a1_0x1f3e0f(0x7f),'path':a1_0x1f3e0f(0xa1),'summary':a1_0x1f3e0f(0x89),'whenToUse':a1_0x1f3e0f(0x9d),'pathParams':[{'name':'appCode','description':a1_0x1f3e0f(0xc5)},{'name':a1_0x1f3e0f(0x93),'description':a1_0x1f3e0f(0x77)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x1f3e0f(0x8c),'where\x20filters\x20before\x20aggregation'],'examples':[a1_0x1f3e0f(0xc3)],'notes':[a1_0x1f3e0f(0xac),a1_0x1f3e0f(0x7b)],'markdown':['##\x20Aggregate\x20dataset\x20data','','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x1f3e0f(0x9b)]('\x0a')},{'code':a1_0x1f3e0f(0x83),'category':'dataset','title':'Get\x20one\x20dataset\x20record','method':'POST','path':a1_0x1f3e0f(0x72),'summary':a1_0x1f3e0f(0xdb),'whenToUse':a1_0x1f3e0f(0x87),'pathParams':[{'name':a1_0x1f3e0f(0xa0),'description':a1_0x1f3e0f(0xc5)},{'name':'datasetCode','description':a1_0x1f3e0f(0x77)}],'queryParams':[],'bodySchema':a1_0x1f3e0f(0x70),'responseHighlights':[a1_0x1f3e0f(0xcb)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x1f3e0f(0xaa)],'markdown':'##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.'},{'code':'dataset_data_create','category':a1_0x1f3e0f(0xd9),'title':a1_0x1f3e0f(0xcc),'method':'POST','path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x1f3e0f(0x9c),'whenToUse':a1_0x1f3e0f(0xd5),'pathParams':[{'name':'appCode','description':a1_0x1f3e0f(0xc5)},{'name':a1_0x1f3e0f(0x93),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x1f3e0f(0xa2),'responseHighlights':[a1_0x1f3e0f(0x75)],'examples':[a1_0x1f3e0f(0xbe)],'notes':[a1_0x1f3e0f(0xd0)],'markdown':a1_0x1f3e0f(0xc4)},{'code':'bf_function_list','category':'bf','title':a1_0x1f3e0f(0x84),'method':a1_0x1f3e0f(0x7d),'path':a1_0x1f3e0f(0xad),'summary':a1_0x1f3e0f(0xa7),'whenToUse':'需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','pathParams':[{'name':a1_0x1f3e0f(0xa0),'description':a1_0x1f3e0f(0xc5)}],'queryParams':[],'bodySchema':'None','responseHighlights':['Returns\x20endpoint\x20functionName/id/description'],'examples':['lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>'],'notes':[a1_0x1f3e0f(0xbc)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x1f3e0f(0x94),'category':'bf','title':a1_0x1f3e0f(0x6e),'method':a1_0x1f3e0f(0x7f),'path':a1_0x1f3e0f(0xd7),'summary':a1_0x1f3e0f(0x8b),'whenToUse':a1_0x1f3e0f(0xa3),'pathParams':[{'name':'appCode','description':a1_0x1f3e0f(0xc5)},{'name':a1_0x1f3e0f(0xba),'description':a1_0x1f3e0f(0xbd)}],'queryParams':[],'bodySchema':a1_0x1f3e0f(0x7c),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x1f3e0f(0x85)],'notes':[a1_0x1f3e0f(0xd2)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':'custom_sql_execute','category':a1_0x1f3e0f(0xa6),'title':'Execute\x20custom\x20SQL','method':'POST','path':a1_0x1f3e0f(0xd4),'summary':'执行自定义\x20SQL','whenToUse':a1_0x1f3e0f(0xc2),'pathParams':[],'queryParams':[],'bodySchema':a1_0x1f3e0f(0x80),'responseHighlights':[a1_0x1f3e0f(0x90)],'examples':[a1_0x1f3e0f(0xb4)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x1f3e0f(0xc7)}];function entrySummary(_0x2f0d42){const _0x237d3e=a1_0x1f3e0f;return{'code':_0x2f0d42[_0x237d3e(0x6f)],'category':_0x2f0d42[_0x237d3e(0xa8)],'method':_0x2f0d42['method'],'path':_0x2f0d42['path'],'summary':_0x2f0d42['summary'],'whenToUse':_0x2f0d42[_0x237d3e(0x98)]};}export function listApiDocEntries(_0x9ea4b3={}){const _0x8e1641=a1_0x1f3e0f,_0x122d3e=String(_0x9ea4b3[_0x8e1641(0xa8)]||'')[_0x8e1641(0x91)](),_0x2106c5=String(_0x9ea4b3['keyword']||'')['trim']()[_0x8e1641(0x71)]();return DOCS[_0x8e1641(0x99)](_0x11bcad=>{const _0x587229=_0x8e1641;if(_0x122d3e&&_0x11bcad['category']!==_0x122d3e)return![];if(!_0x2106c5)return!![];return[_0x11bcad[_0x587229(0x6f)],_0x11bcad[_0x587229(0xa8)],_0x11bcad[_0x587229(0xab)],_0x11bcad[_0x587229(0xc1)],_0x11bcad[_0x587229(0xcf)],_0x11bcad['whenToUse'],_0x11bcad[_0x587229(0x8e)]][_0x587229(0x9b)]('\x20')[_0x587229(0x71)]()['includes'](_0x2106c5);})[_0x8e1641(0xc0)](entrySummary);}export function getApiDocDetail(_0x1ddc24){const _0x546235=a1_0x1f3e0f,_0x1fac25=DOCS[_0x546235(0xb8)](_0x34a263=>_0x34a263['code']===_0x1ddc24);if(!_0x1fac25)throw CliErrors[_0x546235(0xd6)](_0x546235(0x9a)+_0x1ddc24);return{..._0x1fac25};}const apiDocList={'service':'api-doc','command':a1_0x1f3e0f(0xdc),'description':a1_0x1f3e0f(0xa9),'risk':'read','requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x46fdda){const _0x4e976c=a1_0x1f3e0f,_0x283903=listApiDocEntries({'category':_0x46fdda[_0x4e976c(0xd8)](_0x4e976c(0xa8)),'keyword':_0x46fdda['str'](_0x4e976c(0xd3))});return{'ok':!![],'data':{'total':_0x283903[_0x4e976c(0x76)],'items':_0x283903}};}},apiDocDetail={'service':a1_0x1f3e0f(0x79),'command':'detail','description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x1f3e0f(0x74),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x8a3e22){const _0x2a34f1=a1_0x1f3e0f;return{'ok':!![],'data':getApiDocDetail(_0x8a3e22[_0x2a34f1(0xd8)](_0x2a34f1(0x6f)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
1
|
+
function a1_0x3f8f(){const _0xcadc4d=['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','category','/api/dataset/getOneByCode?code={datasetCode}','bf_function_list','5616880mgtmHk','dataset_data_aggregate','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','str','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','map','path','需要向指定数据集新增一条业务数据时使用','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','code','3axxqnX','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','获取数据集详情','Execute\x20custom\x20SQL','trim','join','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','length','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','List\x20available\x20runtime\x20API\x20documentation\x20entries','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','4908712tWMMvB','whenToUse','Execute\x20BF\x20endpoint\x20function','dataset_list','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','read','where\x20filters\x20before\x20aggregation','/api/endpoint/{appCode}/{scriptName}','获取应用下可调用的\x20BF\x20函数列表','10488411YShxoc','Returns\x20script\x20business\x20payload','POST','API\x20doc\x20code,\x20for\x20example\x20dataset_list','keyword','Dataset\x20detail','Create\x20dataset\x20record','GET','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','/api/{appCode}/{datasetCode}/getOne','Aggregate\x20dataset\x20data','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','{\x22aggregate\x22:[{\x22column\x22:\x20\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','bf_execute','3222695qOSjcc','list','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','创建数据','##\x20Aggregate\x20dataset\x20data','聚合查询数据集数据','summary','查询单条数据','dataset_data_filter','执行自定义\x20SQL','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','paging\x20contains\x20pagination','1284132sExrKz','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','appCode','21kDlPOP','List\x20datasets','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','32-character\x20dataset\x20code','paging.totalCount\x20gives\x20total\x20rows','filter','/api/dataset/get-dataset-list-by-app-code','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','/api/{appCode}/{datasetCode}/filter','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','##\x20List\x20datasets','Returns\x20SQL\x20execution\x20payload','string','dataset','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','dataset_data_create','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','datasetCode','{\x22id\x22:123}','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','api-doc','None','Current\x20app\x20code','operations\x20describes\x20runtime\x20APIs','detail','toLowerCase','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','custom_sql','`field`\x20is\x20accepted\x20as\x20a\x20deprecated\x20alias\x20for\x20`column`;\x20new\x20calls\x20should\x20use\x20`column`.','368576RSSoCJ','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','529734bDTPUM','{\x22param\x22:\x22value\x22}','##\x20Filter\x20dataset\x20data','Get\x20one\x20dataset\x20record','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','条件过滤查询数据','tableData\x20contains\x20dataset\x20id/code/name','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','find','dataset_data_get_one','执行指定\x20BF\x20函数','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','dataset_detail','method','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','Filter\x20dataset\x20data','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'];a1_0x3f8f=function(){return _0xcadc4d;};return a1_0x3f8f();}const a1_0x256e7a=a1_0x995e;(function(_0x8c839a,_0x24f558){const _0x5cab8c=a1_0x995e,_0x3b8934=_0x8c839a();while(!![]){try{const _0x4a0ab0=-parseInt(_0x5cab8c(0xaf))/0x1+-parseInt(_0x5cab8c(0x8e))/0x2+-parseInt(_0x5cab8c(0xd2))/0x3*(-parseInt(_0x5cab8c(0xdd))/0x4)+parseInt(_0x5cab8c(0xf4))/0x5+parseInt(_0x5cab8c(0xb1))/0x6*(parseInt(_0x5cab8c(0x91))/0x7)+parseInt(_0x5cab8c(0xc8))/0x8+-parseInt(_0x5cab8c(0xe6))/0x9;if(_0x4a0ab0===_0x24f558)break;else _0x3b8934['push'](_0x3b8934['shift']());}catch(_0x2a1e9e){_0x3b8934['push'](_0x3b8934['shift']());}}}(a1_0x3f8f,0xa1c91));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x256e7a(0xc5),'type':'string','description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0x256e7a(0xea),'type':a1_0x256e7a(0x9d),'description':a1_0x256e7a(0xf6)},DOC_CODE_FLAG={'name':a1_0x256e7a(0xd1),'type':a1_0x256e7a(0x9d),'required':!![],'description':a1_0x256e7a(0xe9)},DOCS=[{'code':a1_0x256e7a(0xe0),'category':a1_0x256e7a(0x9e),'title':a1_0x256e7a(0x92),'method':a1_0x256e7a(0xe8),'path':a1_0x256e7a(0x97),'summary':'分页获取数据集列表','whenToUse':a1_0x256e7a(0xb5),'pathParams':[],'queryParams':[],'bodySchema':a1_0x256e7a(0xa5),'responseHighlights':[a1_0x256e7a(0xb8),a1_0x256e7a(0x95)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':[a1_0x256e7a(0xb0)],'markdown':[a1_0x256e7a(0x9b),'',a1_0x256e7a(0x8f)][a1_0x256e7a(0xd7)]('\x0a')},{'code':a1_0x256e7a(0xbe),'category':'dataset','title':a1_0x256e7a(0xeb),'method':a1_0x256e7a(0xed),'path':a1_0x256e7a(0xc6),'summary':a1_0x256e7a(0xd4),'whenToUse':a1_0x256e7a(0xe1),'pathParams':[],'queryParams':[{'name':a1_0x256e7a(0xd1),'description':a1_0x256e7a(0x94)}],'bodySchema':a1_0x256e7a(0xa7),'responseHighlights':['fields/properties\x20describe\x20data\x20shape',a1_0x256e7a(0xa9)],'examples':[a1_0x256e7a(0xc0)],'notes':[a1_0x256e7a(0xb9)],'markdown':['##\x20Dataset\x20detail','',a1_0x256e7a(0xc3)][a1_0x256e7a(0xd7)]('\x0a')},{'code':a1_0x256e7a(0x8a),'category':a1_0x256e7a(0x9e),'title':a1_0x256e7a(0xc1),'method':a1_0x256e7a(0xe8),'path':a1_0x256e7a(0x99),'summary':a1_0x256e7a(0xb7),'whenToUse':a1_0x256e7a(0xd3),'pathParams':[{'name':'appCode','description':a1_0x256e7a(0xa8)},{'name':a1_0x256e7a(0xa3),'description':a1_0x256e7a(0x94)}],'queryParams':[],'bodySchema':a1_0x256e7a(0xcc),'responseHighlights':['tableData\x20contains\x20records',a1_0x256e7a(0x8d)],'examples':[a1_0x256e7a(0xa1)],'notes':[a1_0x256e7a(0xc2)],'markdown':[a1_0x256e7a(0xb3),'',a1_0x256e7a(0x8c)]['join']('\x0a')},{'code':a1_0x256e7a(0xc9),'category':a1_0x256e7a(0x9e),'title':a1_0x256e7a(0xf0),'method':a1_0x256e7a(0xe8),'path':'/api/{appCode}/{datasetCode}/aggregate','summary':a1_0x256e7a(0xfb),'whenToUse':a1_0x256e7a(0xda),'pathParams':[{'name':a1_0x256e7a(0x90),'description':a1_0x256e7a(0xa8)},{'name':a1_0x256e7a(0xa3),'description':a1_0x256e7a(0x94)}],'queryParams':[],'bodySchema':a1_0x256e7a(0xf2),'responseHighlights':['result\x20rows\x20contain\x20aggregate\x20aliases',a1_0x256e7a(0xe3)],'examples':[a1_0x256e7a(0xbd)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.',a1_0x256e7a(0xae)],'markdown':[a1_0x256e7a(0xfa),'',a1_0x256e7a(0xf7)][a1_0x256e7a(0xd7)]('\x0a')},{'code':a1_0x256e7a(0xbb),'category':a1_0x256e7a(0x9e),'title':a1_0x256e7a(0xb4),'method':a1_0x256e7a(0xe8),'path':a1_0x256e7a(0xef),'summary':a1_0x256e7a(0x89),'whenToUse':'已经知道记录\x20id,需要按数据集读取单条业务数据时使用','pathParams':[{'name':a1_0x256e7a(0x90),'description':a1_0x256e7a(0xa8)},{'name':a1_0x256e7a(0xa3),'description':a1_0x256e7a(0x94)}],'queryParams':[],'bodySchema':a1_0x256e7a(0xa4),'responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x256e7a(0xee)],'markdown':a1_0x256e7a(0x9f)},{'code':a1_0x256e7a(0xa0),'category':a1_0x256e7a(0x9e),'title':a1_0x256e7a(0xec),'method':a1_0x256e7a(0xe8),'path':'/api/{appCode}/{datasetCode}/create','summary':a1_0x256e7a(0xf9),'whenToUse':a1_0x256e7a(0xcf),'pathParams':[{'name':a1_0x256e7a(0x90),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':a1_0x256e7a(0x94)}],'queryParams':[],'bodySchema':'{\x22fieldName\x22:\x22value\x22}','responseHighlights':[a1_0x256e7a(0xac)],'examples':[a1_0x256e7a(0xc4)],'notes':[a1_0x256e7a(0xd0)],'markdown':a1_0x256e7a(0x98)},{'code':a1_0x256e7a(0xc7),'category':'bf','title':'List\x20BF\x20endpoint\x20functions','method':'GET','path':'/api/endpoint/{appCode}/functions','summary':a1_0x256e7a(0xe5),'whenToUse':'需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','pathParams':[{'name':a1_0x256e7a(0x90),'description':a1_0x256e7a(0xa8)}],'queryParams':[],'bodySchema':a1_0x256e7a(0xa7),'responseHighlights':['Returns\x20endpoint\x20functionName/id/description'],'examples':[a1_0x256e7a(0x9a)],'notes':[a1_0x256e7a(0xd8)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x256e7a(0xf3),'category':'bf','title':a1_0x256e7a(0xdf),'method':'POST','path':a1_0x256e7a(0xe4),'summary':a1_0x256e7a(0xbc),'whenToUse':a1_0x256e7a(0xdc),'pathParams':[{'name':a1_0x256e7a(0x90),'description':a1_0x256e7a(0xa8)},{'name':'scriptName','description':'Endpoint\x20function\x20name'}],'queryParams':[],'bodySchema':a1_0x256e7a(0xb2),'responseHighlights':[a1_0x256e7a(0xe7)],'examples':[a1_0x256e7a(0xb6)],'notes':[a1_0x256e7a(0xf1)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':'custom_sql_execute','category':a1_0x256e7a(0xad),'title':a1_0x256e7a(0xd5),'method':'POST','path':'/api/custom/executeSql','summary':a1_0x256e7a(0x8b),'whenToUse':a1_0x256e7a(0xca),'pathParams':[],'queryParams':[],'bodySchema':a1_0x256e7a(0xf8),'responseHighlights':[a1_0x256e7a(0x9c)],'examples':[a1_0x256e7a(0xa2)],'notes':['Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.'],'markdown':a1_0x256e7a(0x93)}];function a1_0x995e(_0x52a845,_0x3e26f0){_0x52a845=_0x52a845-0x89;const _0x3f8fde=a1_0x3f8f();let _0x995e96=_0x3f8fde[_0x52a845];return _0x995e96;}function entrySummary(_0x4b6dd2){const _0x1dfa26=a1_0x256e7a;return{'code':_0x4b6dd2[_0x1dfa26(0xd1)],'category':_0x4b6dd2[_0x1dfa26(0xc5)],'method':_0x4b6dd2[_0x1dfa26(0xbf)],'path':_0x4b6dd2[_0x1dfa26(0xce)],'summary':_0x4b6dd2['summary'],'whenToUse':_0x4b6dd2[_0x1dfa26(0xde)]};}export function listApiDocEntries(_0x5d445c={}){const _0x3b9b8b=a1_0x256e7a,_0x572736=String(_0x5d445c['category']||'')[_0x3b9b8b(0xd6)](),_0xa8be6d=String(_0x5d445c[_0x3b9b8b(0xea)]||'')[_0x3b9b8b(0xd6)]()[_0x3b9b8b(0xab)]();return DOCS[_0x3b9b8b(0x96)](_0x24243b=>{const _0x46b50d=_0x3b9b8b;if(_0x572736&&_0x24243b['category']!==_0x572736)return![];if(!_0xa8be6d)return!![];return[_0x24243b[_0x46b50d(0xd1)],_0x24243b[_0x46b50d(0xc5)],_0x24243b[_0x46b50d(0xbf)],_0x24243b[_0x46b50d(0xce)],_0x24243b[_0x46b50d(0xfc)],_0x24243b['whenToUse'],_0x24243b['title']][_0x46b50d(0xd7)]('\x20')['toLowerCase']()['includes'](_0xa8be6d);})[_0x3b9b8b(0xcd)](entrySummary);}export function getApiDocDetail(_0x51d84f){const _0x241ee8=a1_0x256e7a,_0x1d1dd3=DOCS[_0x241ee8(0xba)](_0x2b5b0e=>_0x2b5b0e[_0x241ee8(0xd1)]===_0x51d84f);if(!_0x1d1dd3)throw CliErrors['validation']('API\x20doc\x20code\x20not\x20found:\x20'+_0x51d84f);return{..._0x1d1dd3};}const apiDocList={'service':a1_0x256e7a(0xa6),'command':a1_0x256e7a(0xf5),'description':a1_0x256e7a(0xdb),'risk':a1_0x256e7a(0xe2),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x23d824){const _0x2bd985=a1_0x256e7a,_0x38bfff=listApiDocEntries({'category':_0x23d824['str'](_0x2bd985(0xc5)),'keyword':_0x23d824['str']('keyword')});return{'ok':!![],'data':{'total':_0x38bfff[_0x2bd985(0xd9)],'items':_0x38bfff}};}},apiDocDetail={'service':a1_0x256e7a(0xa6),'command':a1_0x256e7a(0xaa),'description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x256e7a(0xe2),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x5de1fd){const _0x35ac76=a1_0x256e7a;return{'ok':!![],'data':getApiDocDetail(_0x5de1fd[_0x35ac76(0xcb)](_0x35ac76(0xd1)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaa3e85,_0x4b86c6){const _0x3fb9a3=a2_0xb21b,_0x495588=_0xaa3e85();while(!![]){try{const _0x5c45af=-parseInt(_0x3fb9a3(0xa0))/0x1+-parseInt(_0x3fb9a3(0xb2))/0x2+-parseInt(_0x3fb9a3(0xa6))/0x3*(-parseInt(_0x3fb9a3(0xb8))/0x4)+-parseInt(_0x3fb9a3(0x9f))/0x5+parseInt(_0x3fb9a3(0xaf))/0x6+-parseInt(_0x3fb9a3(0xa1))/0x7+-parseInt(_0x3fb9a3(0xae))/0x8*(-parseInt(_0x3fb9a3(0xa3))/0x9);if(_0x5c45af===_0x4b86c6)break;else _0x495588['push'](_0x495588['shift']());}catch(_0x4aa979){_0x495588['push'](_0x495588['shift']());}}}(a2_0x3362,0x8a5f8));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';import{isRuntimeAccessibleApp}from'../../commands/app/eligibility.js';export function fingerprintAccessKey(_0x52ee61){const _0x10f7af=a2_0xb21b,_0x4d879e=_0x52ee61[_0x10f7af(0xa4)](),_0x14287a=_0x4d879e[_0x10f7af(0xb4)](-0x6)||_0x10f7af(0xaa),_0x2ff92=createHash(_0x10f7af(0xa9))['update'](_0x4d879e)[_0x10f7af(0x9e)](_0x10f7af(0x9a))[_0x10f7af(0xb4)](0x0,0xc);return _0x10f7af(0xad)+_0x14287a+'_'+_0x2ff92;}export function getAppCacheFilePath(_0x77dbae,_0x2a69ec){const _0xe9052b=a2_0xb21b;return resolve(homedir(),PRODUCT_CONFIG[_0xe9052b(0xab)],_0xe9052b(0x9c),_0x77dbae,fingerprintAccessKey(_0x2a69ec),_0xe9052b(0xa7));}function a2_0x3362(){const _0x6f480a=['109388xBSAIx','hex','stringify','cache','EPERM','digest','1627380hJjhNo','119036oiIigw','5187140GMJuIq','utf8','108ZLtpnI','trim','EACCES','87DVGWul','my-apps.json','isArray','sha256','unknown','homeDirName','find','ak_','888824xsRagL','3224220sXrbjY','code','EXDEV','1822722ammAjw','parse','slice','appCode','.tmp','items'];a2_0x3362=function(){return _0x6f480a;};return a2_0x3362();}export function readCachedAppList(_0x484947,_0x3c467e){const _0x3dc0d6=a2_0xb21b;if(!_0x3c467e?.['trim']())return null;const _0x1d6d29=getAppCacheFilePath(_0x484947,_0x3c467e);if(!existsSync(_0x1d6d29))return null;try{const _0x1ebb7e=readFileSync(_0x1d6d29,_0x3dc0d6(0xa2));if(!_0x1ebb7e[_0x3dc0d6(0xa4)]())return null;const _0x326df8=JSON[_0x3dc0d6(0xb3)](_0x1ebb7e);if(!Array[_0x3dc0d6(0xa8)](_0x326df8[_0x3dc0d6(0xb7)]))return null;return _0x326df8;}catch{return null;}}export function writeCachedAppList(_0x2a70d1,_0x3c9a4d,_0x186021){const _0x302cf2=a2_0xb21b,_0x55c619=getAppCacheFilePath(_0x2a70d1,_0x3c9a4d),_0x52f1a1=dirname(_0x55c619);!existsSync(_0x52f1a1)&&mkdirSync(_0x52f1a1,{'recursive':!![]});const _0x3b5b76=_0x55c619+_0x302cf2(0xb6);try{writeFileSync(_0x3b5b76,JSON[_0x302cf2(0x9b)](_0x186021,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180});try{renameSync(_0x3b5b76,_0x55c619);}catch(_0x227797){if(_0x227797[_0x302cf2(0xb0)]===_0x302cf2(0x9d)||_0x227797[_0x302cf2(0xb0)]===_0x302cf2(0xb1)||_0x227797[_0x302cf2(0xb0)]===_0x302cf2(0xa5)){writeFileSync(_0x55c619,JSON[_0x302cf2(0x9b)](_0x186021,null,0x2)+'\x0a',{'encoding':_0x302cf2(0xa2)});try{unlinkSync(_0x3b5b76);}catch{}}else throw _0x227797;}}catch(_0xb89e0e){try{unlinkSync(_0x3b5b76);}catch{}throw _0xb89e0e;}return _0x55c619;}function a2_0xb21b(_0x438d71,_0x2dd870){_0x438d71=_0x438d71-0x9a;const _0x33621a=a2_0x3362();let _0xb21b24=_0x33621a[_0x438d71];return _0xb21b24;}export function resolveCachedAppCode(_0x106785,_0x204fcc,_0x2eae6c){const _0x293eee=a2_0xb21b;if(!_0x106785)return undefined;const _0x479020=readCachedAppList(_0x204fcc,_0x2eae6c),_0x3a71e4=_0x479020?.[_0x293eee(0xb7)][_0x293eee(0xac)](_0x30b242=>_0x30b242['appName']===_0x106785&&isRuntimeAccessibleApp(_0x30b242));return _0x3a71e4?.[_0x293eee(0xb5)]?.[_0x293eee(0xa4)]()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a3_0x421e23=a3_0x4d3a;(function(_0x390462,_0x1b198f){const _0x6833d4=a3_0x4d3a,_0x341ee3=_0x390462();while(!![]){try{const _0x927a6f=-parseInt(_0x6833d4(0x1d7))/0x1*(parseInt(_0x6833d4(0x211))/0x2)+parseInt(_0x6833d4(0x205))/0x3+-parseInt(_0x6833d4(0x1dc))/0x4*(-parseInt(_0x6833d4(0x1df))/0x5)+-parseInt(_0x6833d4(0x1d0))/0x6+-parseInt(_0x6833d4(0x1ef))/0x7+parseInt(_0x6833d4(0x21a))/0x8*(-parseInt(_0x6833d4(0x1c7))/0x9)+-parseInt(_0x6833d4(0x1cb))/0xa*(-parseInt(_0x6833d4(0x1f0))/0xb);if(_0x927a6f===_0x1b198f)break;else _0x341ee3['push'](_0x341ee3['shift']());}catch(_0x235d18){_0x341ee3['push'](_0x341ee3['shift']());}}}(a3_0x4f61,0x4998b));import{CliErrors}from'../../errors.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';const GLOBAL_FLAG={'name':a3_0x421e23(0x1ee),'type':a3_0x421e23(0x20d),'description':a3_0x421e23(0x1ec),'default':![]};function collectFlags(_0x569130,_0x1625d2){const _0xc9d03=a3_0x421e23,_0x45ff29={};for(const _0x14a847 of _0x1625d2){const _0x1a197f=_0x14a847[_0xc9d03(0x1e6)]===_0xc9d03(0x20d)?_0x569130[_0xc9d03(0x1fd)](_0x14a847['name']):_0x569130[_0xc9d03(0x1fe)](_0x14a847[_0xc9d03(0x204)]);if(_0x1a197f!==''&&_0x1a197f!==![])_0x45ff29[_0x14a847['name']]=_0x1a197f;}if(_0x569130['nonInteractive'])_0x45ff29[_0xc9d03(0x213)]=!![];return _0x45ff29;}function normalizeLanguages(_0x4d9b3b){const _0x13b02a=a3_0x421e23;if(!Array[_0x13b02a(0x1d5)](_0x4d9b3b))return[];return _0x4d9b3b[_0x13b02a(0x1f5)](_0xd540c8=>typeof _0xd540c8===_0x13b02a(0x1d3))[_0x13b02a(0x1e7)](_0x206cd7=>_0x206cd7[_0x13b02a(0x20f)]())[_0x13b02a(0x1f5)](Boolean);}function buildRemoteAppI18nFields(_0x2ddc6c){const _0x3cccc7=a3_0x421e23,_0x2cc61d=normalizeLanguages(_0x2ddc6c['i18nInfo']?.[_0x3cccc7(0x1c4)]);return{'enableI18n':typeof _0x2ddc6c[_0x3cccc7(0x215)]===_0x3cccc7(0x20d)?_0x2ddc6c[_0x3cccc7(0x215)]:null,'languages':_0x2cc61d,'i18nInfo':_0x2ddc6c[_0x3cccc7(0x1ce)]?{..._0x2ddc6c[_0x3cccc7(0x1ce)],'langs':_0x2cc61d[_0x3cccc7(0x1f9)]?_0x2cc61d:null}:null};}function a3_0x4f61(){const _0x3cf326=['find','appCode','type','map','list','validation','raw','args','Use\x20global\x20config\x20scope','entries','global','419713DkdXOP','187TqqGtY','Loaded\x20','local','cachePath','production','filter','No\x20apps\x20found\x20on\x20the\x20platform.','Remote\x20app\x20name\x20to\x20activate','No\x20cached\x20apps\x20found.','length','Refreshed\x20app\x20cache\x20with\x20','cache','\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]','bool','str','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','appName','Target\x20environment\x20(default:\x20current\x20env)','push','../../commands/app/cache.js','name','1604148zkiAGE','\x20is\x20deprecated.\x20Use\x20`','Filter\x20by\x20environment\x20(default:\x20current\x20env)','fetchedAt','appcode','items','\x20cached\x20app(s)\x20for\x20env=\x22','from','boolean','.appcode\x20to\x20.lovrabet.json.','trim','globalPath','1198oYJKKd','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','nonInteractive','read','enableI18n','no-cache','import','defaultApp','`\x20instead.','4435448iAfErQ','\x20app\x20use\x20<name>\x20[--global]','Usage:\x20','isCurrent','langs','init','Available\x20remote\x20apps:\x20','9NJvOty','env','Default\x20app\x20candidate\x20set\x20to\x20\x22','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','563480NApRbp','\x20app(s)\x20for\x20env=\x22','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','i18nInfo','appOwnerName','2739906vEDtvj','Deprecated:\x20use\x20workspace\x20use\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','app','string','Missing\x20app\x20name.','isArray','use','713drkfNG','write','accessKey','Include\x20unpublished\x20apps\x20for\x20diagnostics','project-default','4sxnrFL','source','config','1534735SxNjpk','../../context.js','projectPath','\x22\x20not\x20found.','../../commands/app/remote-source.js'];a3_0x4f61=function(){return _0x3cf326;};return a3_0x4f61();}const initDef={'service':a3_0x421e23(0x1d2),'command':'init','description':'Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x594fda){const _0x1941d5=a3_0x421e23;return warnDeprecatedAppCommand(_0x1941d5(0x1c5),CLI_BIN_NAME+_0x1941d5(0x1fc)),await runInit(collectFlags(_0x594fda,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x421e23(0x1d2),'command':a3_0x421e23(0x1e8),'description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':a3_0x421e23(0x214),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':'string','description':a3_0x421e23(0x207),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x421e23(0x1f2),'type':a3_0x421e23(0x20d),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':'no-cache','type':a3_0x421e23(0x20d),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]},{'name':'include-unpublished','type':'boolean','description':a3_0x421e23(0x1da),'default':![]}],async 'execute'(_0x4e0341){const _0x330333=a3_0x421e23,_0x5232c8=_0x4e0341[_0x330333(0x1fe)]('env')||_0x4e0341['envName']||getEnv()||_0x330333(0x1f4),_0x13f5be=_0x4e0341['bool'](_0x330333(0x1f2)),_0x496c34=_0x4e0341[_0x330333(0x1fd)](_0x330333(0x216)),_0x40faaf=_0x4e0341['bool']('include-unpublished'),{readRawConfigWithLayers:_0x29f7da,resolveDefaultAppSource:_0x5e416d,getLocalAppAliases:_0x200873}=await import(_0x330333(0x1e0)),{getRemoteAppList:_0xeb79da}=await import(_0x330333(0x1e3)),{config:_0x1cc404,layers:_0x514367}=_0x29f7da(),_0x703c54=_0x5e416d(_0x514367),{defaultApp:_0x72a673}=_0x1cc404,_0x360151=await _0xeb79da({'env':_0x5232c8,'accessKey':_0x4e0341[_0x330333(0x1d9)],'localOnly':_0x13f5be,'noCache':_0x496c34}),_0x29c06d=_0x40faaf?_0x360151[_0x330333(0x20a)]:filterRuntimeAccessibleApps(_0x360151[_0x330333(0x20a)]),_0x10aa86=_0x360151[_0x330333(0x20a)][_0x330333(0x1f9)]-_0x29c06d[_0x330333(0x1f9)],_0x3662a5=_0x29c06d[_0x330333(0x1e7)](_0x5ee692=>{const _0x5f5187=_0x330333;return{'name':_0x5ee692[_0x5f5187(0x200)],'appcode':_0x5ee692['appCode'],'named':!![],'definedIn':'remote','isDefault':_0x5ee692[_0x5f5187(0x200)]===_0x72a673,...buildAppProfileListFields(_0x5232c8),...buildRemoteAppI18nFields(_0x5ee692),'source':_0x360151[_0x5f5187(0x1dd)],'owner':_0x5ee692[_0x5f5187(0x1cf)]??null,'status':_0x5ee692['appPublishStatus']??null,'cachedAt':_0x360151[_0x5f5187(0x208)]};}),_0x1c650b=_0x200873(_0x1cc404);let _0x457aa0=0x0;for(const [_0x1e9a3a,_0x41f21f]of Object[_0x330333(0x1ed)](_0x1c650b)){const _0x28f650=typeof _0x41f21f[_0x330333(0x209)]==='string'?_0x41f21f['appcode'][_0x330333(0x20f)]():'';if(!_0x28f650)continue;const _0x7828d2=findAppByCode(_0x360151[_0x330333(0x20a)],_0x28f650);if(!_0x40faaf&&_0x7828d2&&!isRuntimeAccessibleApp(_0x7828d2))continue;_0x457aa0+=0x1,_0x3662a5[_0x330333(0x202)]({'name':_0x1e9a3a,'appcode':_0x28f650,'named':!![],'definedIn':_0x330333(0x1f2),'isDefault':_0x1e9a3a===_0x72a673,...buildAppProfileListFields(_0x5232c8),'source':_0x330333(0x1de),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x3662a5,_0x4e0341['mergedCli']);const _0x4abe8b=_0x3662a5['find'](_0x452042=>_0x452042[_0x330333(0x1c3)]===!![]),_0x338f50=_0x72a673??_0x4abe8b?.[_0x330333(0x204)]??null,_0x4a746e={'env':_0x5232c8,'source':_0x360151[_0x330333(0x1dd)],'fetchedAt':_0x360151[_0x330333(0x208)],'cachePath':_0x360151[_0x330333(0x1f3)],'globalPath':_0x514367[_0x330333(0x210)]??null,'projectPath':_0x514367[_0x330333(0x1e1)]??null,'defaultApp':_0x338f50,'defaultAppSource':_0x72a673!=null?_0x703c54:null,'localAliasCount':_0x457aa0,'remoteTotal':_0x360151[_0x330333(0x20a)][_0x330333(0x1f9)],'hiddenUnpublishedCount':_0x10aa86,'includeUnpublished':_0x40faaf};if(_0x3662a5['length']===0x0)return{'ok':!![],'data':{'items':_0x3662a5,'meta':_0x4a746e},'message':_0x360151[_0x330333(0x1dd)]==='cache'?_0x330333(0x1f8):_0x330333(0x1f6)};return{'ok':!![],'data':{'items':_0x3662a5,'meta':_0x4a746e}};}},pullDef={'service':'app','command':'pull','description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x421e23(0x1d8),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x421e23(0x1c8),'type':a3_0x421e23(0x1d3),'description':a3_0x421e23(0x201),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x421e23(0x1f2),'type':a3_0x421e23(0x20d),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':'no-cache','type':a3_0x421e23(0x20d),'description':a3_0x421e23(0x1cd),'default':![]}],async 'execute'(_0x2ffba4){const _0xb237a8=a3_0x421e23,_0x1409e2=_0x2ffba4[_0xb237a8(0x1fe)]('env')||_0x2ffba4['envName']||getEnv()||_0xb237a8(0x1f4),_0x5f2740=_0x2ffba4['bool'](_0xb237a8(0x1f2)),_0x49a990=_0x2ffba4[_0xb237a8(0x1fd)]('no-cache'),{getRemoteAppList:_0x3497e2}=await import(_0xb237a8(0x1e3)),_0x1f2420=await _0x3497e2({'env':_0x1409e2,'accessKey':_0x2ffba4[_0xb237a8(0x1d9)],'localOnly':_0x5f2740,'noCache':_0x49a990});return{'ok':!![],'data':{'total':_0x1f2420[_0xb237a8(0x20a)][_0xb237a8(0x1f9)],'env':_0x1409e2,'source':_0x1f2420['source'],'fetchedAt':_0x1f2420[_0xb237a8(0x208)],'cachePath':_0x1f2420['cachePath']},'message':_0x1f2420[_0xb237a8(0x1dd)]===_0xb237a8(0x1fb)?_0xb237a8(0x1f1)+_0x1f2420['items']['length']+_0xb237a8(0x20b)+_0x1409e2+'\x22.':_0xb237a8(0x1fa)+_0x1f2420[_0xb237a8(0x20a)][_0xb237a8(0x1f9)]+_0xb237a8(0x1cc)+_0x1409e2+'\x22.'};}},useDef={'service':a3_0x421e23(0x1d2),'command':a3_0x421e23(0x1d6),'description':a3_0x421e23(0x1d1),'risk':a3_0x421e23(0x1d8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x421e23(0x204),'description':a3_0x421e23(0x1f7),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0xf9ae6e){const _0x3ce7ed=a3_0x421e23;if(!_0xf9ae6e[_0x3ce7ed(0x1eb)][0x0])throw CliErrors[_0x3ce7ed(0x1e9)](_0x3ce7ed(0x1d4),_0x3ce7ed(0x1c2)+CLI_BIN_NAME+_0x3ce7ed(0x21b));},async 'execute'(_0x2dc3c1){const _0x36a14e=a3_0x421e23;warnDeprecatedAppCommand(_0x36a14e(0x1d6),CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]');const _0x551556=_0x2dc3c1[_0x36a14e(0x1eb)][0x0];if(!_0x551556)throw CliErrors['validation'](_0x36a14e(0x1d4),'Usage:\x20'+CLI_BIN_NAME+_0x36a14e(0x21b));const {buildConfigFromFlags:_0x38806d,resolveLocalAppAliasCode:_0x24680b}=await import(_0x36a14e(0x1e0)),{readCachedAppList:_0x5af830}=await import(_0x36a14e(0x203)),_0x54b5f2=_0x2dc3c1['str'](_0x36a14e(0x1c8)),_0x2decc2=_0x38806d(_0x54b5f2?{'env':_0x54b5f2}:{}),_0x3a037b=_0x5af830(_0x2decc2['env'],_0x2decc2[_0x36a14e(0x1d9)]),_0x5928b2=_0x3a037b?.[_0x36a14e(0x20a)]['find'](_0x34ec35=>_0x34ec35['appName']===_0x551556),_0x202426=_0x24680b(_0x2decc2[_0x36a14e(0x1ea)]??{},_0x551556);if(_0x5928b2&&!isRuntimeAccessibleApp(_0x5928b2))throw runtimeInaccessibleAppError(_0x5928b2,'\x22'+_0x551556+'\x22');if(_0x202426){const _0xa1a5fd=_0x3a037b?.[_0x36a14e(0x20a)][_0x36a14e(0x1e4)](_0x5e7b7d=>_0x5e7b7d[_0x36a14e(0x1e5)]?.[_0x36a14e(0x20f)]()===_0x202426);if(_0xa1a5fd&&!isRuntimeAccessibleApp(_0xa1a5fd))throw runtimeInaccessibleAppError(_0xa1a5fd,'\x22'+_0x551556+'\x22');}if(!_0x5928b2&&!_0x202426&&_0x2decc2[_0x36a14e(0x218)]!==_0x551556){const _0x548560=[..._0x3a037b?.['items']['map'](_0x2007f1=>_0x2007f1[_0x36a14e(0x200)])??[]],_0x31c33d=_0x548560[_0x36a14e(0x1f9)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x36a14e(0x1ca)+_0x551556+_0x36a14e(0x20e):_0x36a14e(0x1c6)+Array[_0x36a14e(0x20c)](new Set(_0x548560))['join'](',\x20')+_0x36a14e(0x1ff);throw CliErrors[_0x36a14e(0x1e9)]('App\x20\x22'+_0x551556+_0x36a14e(0x1e2),_0x31c33d);}const _0x1eef67=_0x2dc3c1['bool']('global');let _0x5ee2b0;if(_0x1eef67)_0x5ee2b0={'global':!![]};else{const {isInProject:_0x11411b}=await import(_0x36a14e(0x1e0)),_0x595f10=_0x11411b();_0x5ee2b0=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x36a14e(0x1db),'inProject':_0x595f10}));}const _0x110fe8=readConfig(_0x5ee2b0);return _0x110fe8['defaultApp']=_0x551556,writeConfig(_0x110fe8,_0x5ee2b0),{'ok':!![],'message':_0x36a14e(0x1c9)+_0x551556+'\x22'+scopeLabel(_0x5ee2b0)+'.'};}};function warnDeprecatedAppCommand(_0x35bfe8,_0x5ee860){const _0x4dd4f3=a3_0x421e23;console['warn'](CLI_BIN_NAME+'\x20app\x20'+_0x35bfe8+_0x4dd4f3(0x206)+_0x5ee860+_0x4dd4f3(0x219));}const importDef={'service':'app','command':a3_0x421e23(0x217),'description':a3_0x421e23(0x212),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x309e54){return await runInitImport(collectFlags(_0x309e54,initImportFlagDefs)),{'ok':!![]};}};function a3_0x4d3a(_0xc3ee9e,_0x2bbd2d){_0xc3ee9e=_0xc3ee9e-0x1c2;const _0x4f613a=a3_0x4f61();let _0x4d3a5b=_0x4f613a[_0xc3ee9e];return _0x4d3a5b;}export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
const a3_0x1c5200=a3_0x22a5;(function(_0x2a413a,_0x4208e0){const _0x30a899=a3_0x22a5,_0x307daf=_0x2a413a();while(!![]){try{const _0x2687f5=parseInt(_0x30a899(0x11f))/0x1+parseInt(_0x30a899(0x126))/0x2+-parseInt(_0x30a899(0x123))/0x3*(-parseInt(_0x30a899(0x13b))/0x4)+-parseInt(_0x30a899(0x11d))/0x5*(parseInt(_0x30a899(0x163))/0x6)+-parseInt(_0x30a899(0x15d))/0x7+-parseInt(_0x30a899(0x138))/0x8*(-parseInt(_0x30a899(0x14c))/0x9)+-parseInt(_0x30a899(0x172))/0xa;if(_0x2687f5===_0x4208e0)break;else _0x307daf['push'](_0x307daf['shift']());}catch(_0x243363){_0x307daf['push'](_0x307daf['shift']());}}}(a3_0x3953,0x24e3e));import{CliErrors}from'../../errors.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{filterRuntimeAccessibleApps,findAppByCode,isRuntimeAccessibleApp,runtimeInaccessibleAppError}from'../../commands/app/eligibility.js';function a3_0x3953(){const _0x32056b=['\x20app(s)\x20for\x20env=\x22','\x20workspace\x20use\x20--app\x20<name>\x20[--env\x20daily]','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','../../commands/app/remote-source.js','Default\x20app\x20candidate\x20set\x20to\x20\x22','use','Filter\x20by\x20environment\x20(default:\x20current\x20env)','bool','write','\x20workspace\x20init\x20--appcode\x20<code>\x20[--env\x20daily]','langs','globalPath','projectPath','1873620SOVDMz','str','i18nInfo','string','map','config','292715awlBwv','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','4427KBrpul','items','production','appCode','114HarbSS','local','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','301962UgtNla','cachePath','length','project-default','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','No\x20apps\x20found\x20on\x20the\x20platform.','no-cache','isCurrent','fetchedAt','trim','validation','filter','include-unpublished','\x20app\x20','find','isArray','join','\x22\x20not\x20found.','1117208LFNQxh','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','source','16564hYVFsd','nonInteractive','\x20cached\x20app(s)\x20for\x20env=\x22','../../commands/app/cache.js','remote','Use\x20global\x20config\x20scope','warn','No\x20cached\x20apps\x20found.','Include\x20unpublished\x20apps\x20for\x20diagnostics','Loaded\x20','defaultApp','Use\x20`','envName','enableI18n','init','env','Read\x20from\x20local\x20cache\x20only','18EnICvR','push','appName','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','\x20app\x20use\x20<name>\x20[--global]','appcode','args','appPublishStatus','cache','pull','App\x20\x22','name','accessKey','Available\x20remote\x20apps:\x20','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','../../context.js','global','545825EIQkYj','from','appOwnerName','Missing\x20app\x20name.','Refreshed\x20app\x20cache\x20with\x20','boolean','18OynSVj','app'];a3_0x3953=function(){return _0x32056b;};return a3_0x3953();}const GLOBAL_FLAG={'name':a3_0x1c5200(0x15c),'type':a3_0x1c5200(0x162),'description':a3_0x1c5200(0x140),'default':![]};function collectFlags(_0x486af6,_0x40ef9a){const _0x109356=a3_0x1c5200,_0x491ede={};for(const _0x4da50f of _0x40ef9a){const _0x5c6cb5=_0x4da50f['type']===_0x109356(0x162)?_0x486af6[_0x109356(0x16c)](_0x4da50f[_0x109356(0x157)]):_0x486af6[_0x109356(0x173)](_0x4da50f[_0x109356(0x157)]);if(_0x5c6cb5!==''&&_0x5c6cb5!==![])_0x491ede[_0x4da50f[_0x109356(0x157)]]=_0x5c6cb5;}if(_0x486af6['nonInteractive'])_0x491ede[_0x109356(0x13c)]=!![];return _0x491ede;}function normalizeLanguages(_0x3dc14f){const _0x9acd65=a3_0x1c5200;if(!Array[_0x9acd65(0x135)](_0x3dc14f))return[];return _0x3dc14f[_0x9acd65(0x131)](_0x233788=>typeof _0x233788==='string')['map'](_0x4834fe=>_0x4834fe[_0x9acd65(0x12f)]())[_0x9acd65(0x131)](Boolean);}function buildRemoteAppI18nFields(_0xdb0d48){const _0x276222=a3_0x1c5200,_0x2c6f04=normalizeLanguages(_0xdb0d48['i18nInfo']?.[_0x276222(0x16f)]);return{'enableI18n':typeof _0xdb0d48[_0x276222(0x148)]===_0x276222(0x162)?_0xdb0d48[_0x276222(0x148)]:null,'languages':_0x2c6f04,'i18nInfo':_0xdb0d48[_0x276222(0x174)]?{..._0xdb0d48['i18nInfo'],'langs':_0x2c6f04[_0x276222(0x128)]?_0x2c6f04:null}:null};}const initDef={'service':a3_0x1c5200(0x164),'command':a3_0x1c5200(0x149),'description':a3_0x1c5200(0x15a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x1c4001){const _0x36a6e4=a3_0x1c5200;return warnDeprecatedAppCommand(_0x36a6e4(0x149),CLI_BIN_NAME+_0x36a6e4(0x16e)),await runInit(collectFlags(_0x1c4001,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x1c5200(0x164),'command':'list','description':a3_0x1c5200(0x125),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':'env','type':a3_0x1c5200(0x175),'description':a3_0x1c5200(0x16b),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1c5200(0x124),'type':a3_0x1c5200(0x162),'description':'Read\x20app\x20list\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x1c5200(0x12c),'type':'boolean','description':a3_0x1c5200(0x12a),'default':![]},{'name':a3_0x1c5200(0x132),'type':a3_0x1c5200(0x162),'description':a3_0x1c5200(0x143),'default':![]}],async 'execute'(_0x2aee76){const _0x591c40=a3_0x1c5200,_0x43f980=_0x2aee76[_0x591c40(0x173)](_0x591c40(0x14a))||_0x2aee76[_0x591c40(0x147)]||getEnv()||_0x591c40(0x121),_0x13187d=_0x2aee76[_0x591c40(0x16c)](_0x591c40(0x124)),_0x3db96e=_0x2aee76[_0x591c40(0x16c)](_0x591c40(0x12c)),_0x2d5fb2=_0x2aee76[_0x591c40(0x16c)](_0x591c40(0x132)),{readRawConfigWithLayers:_0x4cfa6f,resolveDefaultAppSource:_0x4c0cae,getLocalAppAliases:_0xf9b22}=await import(_0x591c40(0x15b)),{getRemoteAppList:_0x1c852c}=await import(_0x591c40(0x168)),{config:_0x20c93d,layers:_0x169075}=_0x4cfa6f(),_0x37cbe6=_0x4c0cae(_0x169075),{defaultApp:_0x409da5}=_0x20c93d,_0x377d26=await _0x1c852c({'env':_0x43f980,'accessKey':_0x2aee76[_0x591c40(0x158)],'localOnly':_0x13187d,'noCache':_0x3db96e}),_0x26fb8c=_0x2d5fb2?_0x377d26[_0x591c40(0x120)]:filterRuntimeAccessibleApps(_0x377d26[_0x591c40(0x120)]),_0xb9ad24=_0x377d26[_0x591c40(0x120)][_0x591c40(0x128)]-_0x26fb8c[_0x591c40(0x128)],_0x5429f0=_0x26fb8c[_0x591c40(0x11b)](_0x17b927=>{const _0x462754=_0x591c40;return{'name':_0x17b927[_0x462754(0x14e)],'appcode':_0x17b927['appCode'],'named':!![],'definedIn':_0x462754(0x13f),'isDefault':_0x17b927[_0x462754(0x14e)]===_0x409da5,...buildAppProfileListFields(_0x43f980),...buildRemoteAppI18nFields(_0x17b927),'source':_0x377d26[_0x462754(0x13a)],'owner':_0x17b927[_0x462754(0x15f)]??null,'status':_0x17b927[_0x462754(0x153)]??null,'cachedAt':_0x377d26['fetchedAt']};}),_0x43fc81=_0xf9b22(_0x20c93d);let _0x4d51d0=0x0;for(const [_0x151580,_0x51b734]of Object['entries'](_0x43fc81)){const _0x24af0c=typeof _0x51b734[_0x591c40(0x151)]===_0x591c40(0x175)?_0x51b734[_0x591c40(0x151)][_0x591c40(0x12f)]():'';if(!_0x24af0c)continue;const _0x54b17b=findAppByCode(_0x377d26['items'],_0x24af0c);if(!_0x2d5fb2&&_0x54b17b&&!isRuntimeAccessibleApp(_0x54b17b))continue;_0x4d51d0+=0x1,_0x5429f0[_0x591c40(0x14d)]({'name':_0x151580,'appcode':_0x24af0c,'named':!![],'definedIn':'local','isDefault':_0x151580===_0x409da5,...buildAppProfileListFields(_0x43f980),'source':_0x591c40(0x11c),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x5429f0,_0x2aee76['mergedCli']);const _0x169a26=_0x5429f0[_0x591c40(0x134)](_0x4df6d5=>_0x4df6d5[_0x591c40(0x12d)]===!![]),_0x10ffc5=_0x409da5??_0x169a26?.[_0x591c40(0x157)]??null,_0x5dd154={'env':_0x43f980,'source':_0x377d26[_0x591c40(0x13a)],'fetchedAt':_0x377d26[_0x591c40(0x12e)],'cachePath':_0x377d26[_0x591c40(0x127)],'globalPath':_0x169075[_0x591c40(0x170)]??null,'projectPath':_0x169075[_0x591c40(0x171)]??null,'defaultApp':_0x10ffc5,'defaultAppSource':_0x409da5!=null?_0x37cbe6:null,'localAliasCount':_0x4d51d0,'remoteTotal':_0x377d26[_0x591c40(0x120)][_0x591c40(0x128)],'hiddenUnpublishedCount':_0xb9ad24,'includeUnpublished':_0x2d5fb2};if(_0x5429f0[_0x591c40(0x128)]===0x0)return{'ok':!![],'data':{'items':_0x5429f0,'meta':_0x5dd154},'message':_0x377d26[_0x591c40(0x13a)]===_0x591c40(0x154)?_0x591c40(0x142):_0x591c40(0x12b)};return{'ok':!![],'data':{'items':_0x5429f0,'meta':_0x5dd154}};}},pullDef={'service':a3_0x1c5200(0x164),'command':a3_0x1c5200(0x155),'description':a3_0x1c5200(0x167),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a3_0x1c5200(0x175),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x1c5200(0x124),'type':a3_0x1c5200(0x162),'description':a3_0x1c5200(0x14b),'default':![]},{'name':'no-cache','type':'boolean','description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x544c84){const _0x2d5c88=a3_0x1c5200,_0x26e8c4=_0x544c84[_0x2d5c88(0x173)]('env')||_0x544c84[_0x2d5c88(0x147)]||getEnv()||_0x2d5c88(0x121),_0xb1b559=_0x544c84['bool'](_0x2d5c88(0x124)),_0x4520de=_0x544c84[_0x2d5c88(0x16c)](_0x2d5c88(0x12c)),{getRemoteAppList:_0x241df6}=await import(_0x2d5c88(0x168)),_0x172c92=await _0x241df6({'env':_0x26e8c4,'accessKey':_0x544c84[_0x2d5c88(0x158)],'localOnly':_0xb1b559,'noCache':_0x4520de});return{'ok':!![],'data':{'total':_0x172c92['items']['length'],'env':_0x26e8c4,'source':_0x172c92['source'],'fetchedAt':_0x172c92[_0x2d5c88(0x12e)],'cachePath':_0x172c92[_0x2d5c88(0x127)]},'message':_0x172c92[_0x2d5c88(0x13a)]===_0x2d5c88(0x154)?_0x2d5c88(0x144)+_0x172c92[_0x2d5c88(0x120)][_0x2d5c88(0x128)]+_0x2d5c88(0x13d)+_0x26e8c4+'\x22.':_0x2d5c88(0x161)+_0x172c92['items'][_0x2d5c88(0x128)]+_0x2d5c88(0x165)+_0x26e8c4+'\x22.'};}},useDef={'service':a3_0x1c5200(0x164),'command':a3_0x1c5200(0x16a),'description':'Deprecated:\x20use\x20workspace\x20use\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':a3_0x1c5200(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':'Remote\x20app\x20name\x20to\x20activate','required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x422b37){const _0xf61b39=a3_0x1c5200;if(!_0x422b37[_0xf61b39(0x152)][0x0])throw CliErrors[_0xf61b39(0x130)](_0xf61b39(0x160),'Usage:\x20'+CLI_BIN_NAME+_0xf61b39(0x150));},async 'execute'(_0x1f4945){const _0x1397f3=a3_0x1c5200;warnDeprecatedAppCommand(_0x1397f3(0x16a),CLI_BIN_NAME+_0x1397f3(0x166));const _0x4a76ee=_0x1f4945['args'][0x0];if(!_0x4a76ee)throw CliErrors[_0x1397f3(0x130)](_0x1397f3(0x160),'Usage:\x20'+CLI_BIN_NAME+_0x1397f3(0x150));const {buildConfigFromFlags:_0x203b52,resolveLocalAppAliasCode:_0x2f753b}=await import(_0x1397f3(0x15b)),{readCachedAppList:_0x17225c}=await import(_0x1397f3(0x13e)),_0x226462=_0x1f4945[_0x1397f3(0x173)](_0x1397f3(0x14a)),_0x4f6fff=_0x203b52(_0x226462?{'env':_0x226462}:{}),_0x52e660=_0x17225c(_0x4f6fff['env'],_0x4f6fff['accessKey']),_0x4a2d2c=_0x52e660?.[_0x1397f3(0x120)][_0x1397f3(0x134)](_0x4365fe=>_0x4365fe['appName']===_0x4a76ee),_0x368167=_0x2f753b(_0x4f6fff['raw']??{},_0x4a76ee);if(_0x4a2d2c&&!isRuntimeAccessibleApp(_0x4a2d2c))throw runtimeInaccessibleAppError(_0x4a2d2c,'\x22'+_0x4a76ee+'\x22');if(_0x368167){const _0x290ac3=_0x52e660?.['items'][_0x1397f3(0x134)](_0x2d9fc7=>_0x2d9fc7[_0x1397f3(0x122)]?.[_0x1397f3(0x12f)]()===_0x368167);if(_0x290ac3&&!isRuntimeAccessibleApp(_0x290ac3))throw runtimeInaccessibleAppError(_0x290ac3,'\x22'+_0x4a76ee+'\x22');}if(!_0x4a2d2c&&!_0x368167&&_0x4f6fff[_0x1397f3(0x145)]!==_0x4a76ee){const _0x1f993e=[..._0x52e660?.[_0x1397f3(0x120)][_0x1397f3(0x11b)](_0x22f90e=>_0x22f90e[_0x1397f3(0x14e)])??[]],_0xc5b6cf=_0x1f993e[_0x1397f3(0x128)]===0x0?_0x1397f3(0x146)+CLI_BIN_NAME+_0x1397f3(0x14f)+_0x4a76ee+'.appcode\x20to\x20.lovrabet.json.':_0x1397f3(0x159)+Array[_0x1397f3(0x15e)](new Set(_0x1f993e))[_0x1397f3(0x136)](',\x20')+_0x1397f3(0x139);throw CliErrors['validation'](_0x1397f3(0x156)+_0x4a76ee+_0x1397f3(0x137),_0xc5b6cf);}const _0x248b12=_0x1f4945[_0x1397f3(0x16c)](_0x1397f3(0x15c));let _0x1fe694;if(_0x248b12)_0x1fe694={'global':!![]};else{const {isInProject:_0xfd933c}=await import(_0x1397f3(0x15b)),_0x244af4=_0xfd933c();_0x1fe694=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x1397f3(0x129),'inProject':_0x244af4}));}const _0x1d43e9=readConfig(_0x1fe694);return _0x1d43e9[_0x1397f3(0x145)]=_0x4a76ee,writeConfig(_0x1d43e9,_0x1fe694),{'ok':!![],'message':_0x1397f3(0x169)+_0x4a76ee+'\x22'+scopeLabel(_0x1fe694)+'.'};}};function warnDeprecatedAppCommand(_0xa25ab5,_0x6cac04){const _0x5b92c8=a3_0x1c5200;console[_0x5b92c8(0x141)](CLI_BIN_NAME+_0x5b92c8(0x133)+_0xa25ab5+'\x20is\x20deprecated.\x20Use\x20`'+_0x6cac04+'`\x20instead.');}const importDef={'service':a3_0x1c5200(0x164),'command':'import','description':a3_0x1c5200(0x11e),'risk':a3_0x1c5200(0x16d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x3ee196){return await runInitImport(collectFlags(_0x3ee196,initImportFlagDefs)),{'ok':!![]};}};function a3_0x22a5(_0x4e455d,_0x11cf83){_0x4e455d=_0x4e455d-0x11b;const _0x39536=a3_0x3953();let _0x22a536=_0x39536[_0x4e455d];return _0x22a536;}export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24c817,_0x1b6af5){const _0x17b8d2=a4_0x7717,_0x4020ad=_0x24c817();while(!![]){try{const _0x11b4ac=parseInt(_0x17b8d2(0xf3))/0x1+parseInt(_0x17b8d2(0xe3))/0x2+parseInt(_0x17b8d2(0xea))/0x3*(-parseInt(_0x17b8d2(0xef))/0x4)+-parseInt(_0x17b8d2(0xe9))/0x5+-parseInt(_0x17b8d2(0xe7))/0x6*(-parseInt(_0x17b8d2(0xf2))/0x7)+-parseInt(_0x17b8d2(0xe0))/0x8+parseInt(_0x17b8d2(0xf1))/0x9*(parseInt(_0x17b8d2(0xdf))/0xa);if(_0x11b4ac===_0x1b6af5)break;else _0x4020ad['push'](_0x4020ad['shift']());}catch(_0x32963b){_0x4020ad['push'](_0x4020ad['shift']());}}}(a4_0x5e14,0x45354));import{CLI_BIN_NAME}from'../../constant/cli.js';function a4_0x5e14(){const _0x583807=['4588506MHICqt','7vukYvN','106431DjjonM','string','appPublishStatus','20GmfWma','4101472qZWbKZ','trim','Current\x20status:\x20','678406RVBQqF','UNKNOWN','.\x20Publish\x20the\x20app\x20before\x20using\x20','App\x20','934224vCwZSh','\x20dataset/data/sql/bff\x20commands,\x20or\x20choose\x20a\x20published\x20app.','1531010TuVbhY','388983IuitrE','appName','filter','validation','find','16zjfwkr','toUpperCase'];a4_0x5e14=function(){return _0x583807;};return a4_0x5e14();}import{RUNTIME_ACCESSIBLE_APP_STATUS}from'../../constant/app.js';import{CliErrors}from'../../errors.js';export function normalizeAppPublishStatus(_0x299903){const _0x175f14=a4_0x7717;if(typeof _0x299903!==_0x175f14(0xdd))return null;const _0x1d2189=_0x299903[_0x175f14(0xe1)]();return _0x1d2189?_0x1d2189[_0x175f14(0xf0)]():null;}function a4_0x7717(_0x20b8b2,_0x56a060){_0x20b8b2=_0x20b8b2-0xdd;const _0x5e14e5=a4_0x5e14();let _0x7717b4=_0x5e14e5[_0x20b8b2];return _0x7717b4;}export function isRuntimeAccessibleApp(_0x37475a){const _0x1743cf=a4_0x7717;return normalizeAppPublishStatus(_0x37475a[_0x1743cf(0xde)])===RUNTIME_ACCESSIBLE_APP_STATUS;}export function filterRuntimeAccessibleApps(_0xef3427){const _0xa88208=a4_0x7717;return _0xef3427[_0xa88208(0xec)](isRuntimeAccessibleApp);}export function findAppByName(_0x135a6d,_0x2d8118){const _0x5c0b3f=a4_0x7717;return _0x135a6d[_0x5c0b3f(0xee)](_0x330804=>_0x330804[_0x5c0b3f(0xeb)]===_0x2d8118);}export function findAppByCode(_0x46aee4,_0x2acf99){const _0x337262=a4_0x7717,_0x339618=_0x2acf99[_0x337262(0xe1)]();if(!_0x339618)return undefined;return _0x46aee4[_0x337262(0xee)](_0x274273=>_0x274273['appCode']?.[_0x337262(0xe1)]()===_0x339618);}export function runtimeInaccessibleAppError(_0x55deaf,_0x39ca6d){const _0xd3ebc6=a4_0x7717,_0x33eb63=normalizeAppPublishStatus(_0x55deaf['appPublishStatus'])??_0xd3ebc6(0xe4);return CliErrors[_0xd3ebc6(0xed)](_0xd3ebc6(0xe6)+_0x39ca6d+'\x20is\x20not\x20available\x20for\x20runtime\x20AI\x20access.',_0xd3ebc6(0xe2)+_0x33eb63+_0xd3ebc6(0xe5)+CLI_BIN_NAME+_0xd3ebc6(0xe8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x58427f,_0x359685){const _0x56cbae=a5_0x17c8,_0x29d5c4=_0x58427f();while(!![]){try{const _0x599804=-parseInt(_0x56cbae(0x1c9))/0x1*(-parseInt(_0x56cbae(0x1d0))/0x2)+parseInt(_0x56cbae(0x1c8))/0x3*(-parseInt(_0x56cbae(0x1ca))/0x4)+parseInt(_0x56cbae(0x1c4))/0x5+-parseInt(_0x56cbae(0x1c7))/0x6+-parseInt(_0x56cbae(0x1cb))/0x7+-parseInt(_0x56cbae(0x1cf))/0x8+parseInt(_0x56cbae(0x1c3))/0x9;if(_0x599804===_0x359685)break;else _0x29d5c4['push'](_0x29d5c4['shift']());}catch(_0x12e4a1){_0x29d5c4['push'](_0x29d5c4['shift']());}}}(a5_0x1c7f,0xb0327));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x407d84=a5_0x17c8,_0x411914=join(__dirname,'../../../mock/app-list.json'),_0x3d46f6=readFileSync(_0x411914,'utf-8');return JSON[_0x407d84(0x1cd)](_0x3d46f6);}function a5_0x1c7f(){const _0x3f98b2=['6NDVZHN','6067WjaWjh','1225660TlxAaj','7501109ibcghO','tableData','parse','errorCode','8803096VuWskz','456uAkDdg','data','Mock\x20API\x20error:\x20','28127376KDQyny','1115175JrEMLi','success','errorMsg','7350408FxOcRM'];a5_0x1c7f=function(){return _0x3f98b2;};return a5_0x1c7f();}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}function a5_0x17c8(_0x4913f3,_0x3fb479){_0x4913f3=_0x4913f3-0x1c3;const _0x1c7f3d=a5_0x1c7f();let _0x17c893=_0x1c7f3d[_0x4913f3];return _0x17c893;}export function getMockRemoteAppItems(){const _0x1ebca8=a5_0x17c8,_0x5aaa30=getMockAppList();if(!_0x5aaa30[_0x1ebca8(0x1c5)])throw new Error(_0x1ebca8(0x1d2)+_0x5aaa30[_0x1ebca8(0x1c6)]+'\x20('+_0x5aaa30[_0x1ebca8(0x1ce)]+')');return _0x5aaa30[_0x1ebca8(0x1d1)][_0x1ebca8(0x1cc)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x439b07,_0x4b9671){const _0x5b9d0e=a6_0x2300,_0x162c60=_0x439b07();while(!![]){try{const _0x1ee201=parseInt(_0x5b9d0e(0xb3))/0x1+-parseInt(_0x5b9d0e(0xad))/0x2*(-parseInt(_0x5b9d0e(0xb1))/0x3)+-parseInt(_0x5b9d0e(0xae))/0x4*(-parseInt(_0x5b9d0e(0xb7))/0x5)+parseInt(_0x5b9d0e(0xb4))/0x6+-parseInt(_0x5b9d0e(0xb2))/0x7+-parseInt(_0x5b9d0e(0xac))/0x8+-parseInt(_0x5b9d0e(0xa9))/0x9*(parseInt(_0x5b9d0e(0xb6))/0xa);if(_0x1ee201===_0x4b9671)break;else _0x162c60['push'](_0x162c60['shift']());}catch(_0x5b6864){_0x162c60['push'](_0x162c60['shift']());}}}(a6_0x411b,0xdfee6));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';function a6_0x2300(_0x1b3989,_0x50cd16){_0x1b3989=_0x1b3989-0xa7;const _0x411b2f=a6_0x411b();let _0x230072=_0x411b2f[_0x1b3989];return _0x230072;}import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';function a6_0x411b(){const _0x5e8802=['items','16263927KhohAk','trim','fetchedAt','2924200xRwieQ','118fbKyhp','432MStHML','APP_LIST_SOURCE','mock','79779gfuZbd','3738084bbpQYq','1315499LfPlHk','4511706WkBLpC','cache','20aOuoHp','83080lZQuRL','toLowerCase'];a6_0x411b=function(){return _0x5e8802;};return a6_0x411b();}import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0xa7855a=a6_0x2300,_0x2ea419=(productEnv(_0xa7855a(0xaf))||'')['trim']()[_0xa7855a(0xa7)]();return _0x2ea419===_0xa7855a(0xb0);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x45f7ea){const _0x10ecf1=a6_0x2300,{env:_0x387cc1,accessKey:_0x5a680c,localOnly:localOnly=![],noCache:noCache=![]}=_0x45f7ea,_0x37806e=readCachedAppList(_0x387cc1,_0x5a680c),_0x282691=_0x5a680c?.[_0x10ecf1(0xaa)]()?getAppCacheFilePath(_0x387cc1,_0x5a680c):null;if(localOnly)return{'items':_0x37806e?.[_0x10ecf1(0xa8)]??[],'source':_0x10ecf1(0xb5),'fetchedAt':_0x37806e?.[_0x10ecf1(0xab)]??null,'cachePath':_0x282691};try{const _0x113801=await getRemoteAppItems(),_0x5b455e=shouldUseMockRemoteApps()?_0x10ecf1(0xb0):'remote',_0x2cba25=new Date()['toISOString'](),_0x28aef0=_0x5a680c?.[_0x10ecf1(0xaa)]()?writeCachedAppList(_0x387cc1,_0x5a680c,{'env':_0x387cc1,'fetchedAt':_0x2cba25,'source':_0x5b455e,'items':_0x113801}):null;return{'items':_0x113801,'source':_0x5b455e,'fetchedAt':_0x2cba25,'cachePath':_0x28aef0};}catch(_0x48666f){if(!noCache&&_0x37806e)return{'items':_0x37806e[_0x10ecf1(0xa8)],'source':_0x10ecf1(0xb5),'fetchedAt':_0x37806e[_0x10ecf1(0xab)],'cachePath':_0x282691};throw _0x48666f;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1c0452,_0x1450fe){const _0x3fe333=a7_0x2d17,_0x36028b=_0x1c0452();while(!![]){try{const _0x37d40c=parseInt(_0x3fe333(0xbe))/0x1*(parseInt(_0x3fe333(0xbc))/0x2)+parseInt(_0x3fe333(0xbf))/0x3+-parseInt(_0x3fe333(0xb9))/0x4*(parseInt(_0x3fe333(0xc3))/0x5)+-parseInt(_0x3fe333(0xb4))/0x6+parseInt(_0x3fe333(0xb7))/0x7*(-parseInt(_0x3fe333(0xb8))/0x8)+-parseInt(_0x3fe333(0xc2))/0x9+-parseInt(_0x3fe333(0xba))/0xa*(-parseInt(_0x3fe333(0xb0))/0xb);if(_0x37d40c===_0x1450fe)break;else _0x36028b['push'](_0x36028b['shift']());}catch(_0x5b7885){_0x36028b['push'](_0x36028b['shift']());}}}(a7_0x1f4b,0xcd3dd));function a7_0x2d17(_0xad341,_0x11123b){_0xad341=_0xad341-0xaf;const _0x1f4b28=a7_0x1f4b();let _0x2d1711=_0x1f4b28[_0xad341];return _0x2d1711;}import{CLI_BIN_NAME}from'../../constant/cli.js';function a7_0x1f4b(){const _0x29402b=['8409828NDwWLW','isCurrent','local','4417287goRUbr','8CjHrWS','315976lzLyIJ','10lxSkSa','project','511782XaGVtv','appCode','6juubqH','4176168EtwkjF','trim','appcode','15025005BGNItW','50ozQxHL','defaultApp','26458641bTAVJC','find','named','name'];a7_0x1f4b=function(){return _0x29402b;};return a7_0x1f4b();}import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};export function enrichAppListItemsWithMergedSelection(_0x32b324,_0x5f1611){const _0x1ea695=a7_0x2d17;if(!_0x5f1611)return;const _0x3e8e3f=!!(_0x5f1611['currentApp']??_0x5f1611[_0x1ea695(0xaf)]);for(const _0x5f0024 of _0x32b324){_0x5f0024[_0x1ea695(0xb5)]=![];}const _0xf20575=_0x5f1611['appCode']!=null?String(_0x5f1611[_0x1ea695(0xbd)])[_0x1ea695(0xc0)]():'';if(_0x3e8e3f){const _0x5f3b0f=_0x5f1611['currentApp']??_0x5f1611[_0x1ea695(0xaf)];if(_0x5f3b0f){const _0x4444eb=_0x32b324[_0x1ea695(0xb1)](_0x277ffc=>_0x277ffc['named']===!![]&&_0x277ffc[_0x1ea695(0xb3)]===_0x5f3b0f&&_0x277ffc['definedIn']===_0x1ea695(0xb6)),_0x155fa6=_0x4444eb??_0x32b324[_0x1ea695(0xb1)](_0x21677f=>_0x21677f[_0x1ea695(0xb2)]===!![]&&_0x21677f['name']===_0x5f3b0f);_0x155fa6&&(_0x155fa6[_0x1ea695(0xb5)]=!![]);}return;}if(!_0xf20575)return;for(const _0x2397bf of _0x32b324){String(_0x2397bf[_0x1ea695(0xc1)]??'')['trim']()===_0xf20575&&(_0x2397bf[_0x1ea695(0xb5)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x1ac77){const _0x1e165f=a7_0x2d17;return formatScopeLabel(_0x1ac77['global']?'global':_0x1e165f(0xbb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x1f6234=a8_0x32a6;(function(_0x3be5b4,_0x4745b1){const _0x2bd276=a8_0x32a6,_0x27311e=_0x3be5b4();while(!![]){try{const _0x3981d0=parseInt(_0x2bd276(0xe5))/0x1+-parseInt(_0x2bd276(0xea))/0x2+parseInt(_0x2bd276(0x102))/0x3+-parseInt(_0x2bd276(0xf3))/0x4+-parseInt(_0x2bd276(0x112))/0x5*(parseInt(_0x2bd276(0x106))/0x6)+parseInt(_0x2bd276(0x12c))/0x7*(-parseInt(_0x2bd276(0xeb))/0x8)+-parseInt(_0x2bd276(0x117))/0x9*(-parseInt(_0x2bd276(0x111))/0xa);if(_0x3981d0===_0x4745b1)break;else _0x27311e['push'](_0x27311e['shift']());}catch(_0x4866d1){_0x27311e['push'](_0x27311e['shift']());}}}(a8_0x5c6d,0xaf337));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';function a8_0x5c6d(){const _0x5421c8=['55694lwAJAb','1064144YdBdMX','write','Invalid\x20JSON\x20for\x20--metadata:\x20','trim','lodash','utf8','file','File\x20path\x20is\x20required.','3949808ALMnON','content','POST','Created\x20Artifact\x20','Artifact\x20source\x20file\x20is\x20blank.','react','map','boolean','bool','dayjs','deleted','/client/artifact/create','join','filter','str','2333193HJrFhU','name','verbose','Optional\x20favorite-state\x20filter','14118zGPWXn','/client/artifact/','react-dom','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','string','source','AGENT','includes','validation','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','antd','6712980eHQiMc','1905zdsdqd','Show\x20one\x20Artifact\x20by\x20id','list','Preview:\x20create\x20react_module\x20Artifact','Artifact\x20display\x20name','18xiHgIo','detail','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','File\x20is\x20not\x20a\x20regular\x20file:\x20','split','create','length','@ant-design/icons','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','/update','File\x20not\x20found:\x20','favorite','Artifact\x20ID','metadata','react_module','artifact','Preview:\x20update\x20react_module\x20Artifact\x20','updateTime','react_module\x20imports\x20are\x20limited\x20to:\x20','build','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','28wBERaI','compiledContent','appCode','artifactType','parse','read','flag','List\x20current-app\x20react_module\x20Artifacts','1041160DWSNwC','isFile','body','object','num'];a8_0x5c6d=function(){return _0x5421c8;};return a8_0x5c6d();}import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a8_0x1f6234(0x125),ARTIFACT_SOURCE_AGENT=a8_0x1f6234(0x10c),ALLOWED_REACT_MODULE_IMPORTS=[a8_0x1f6234(0xf8),a8_0x1f6234(0x108),a8_0x1f6234(0xef),a8_0x1f6234(0xfc),a8_0x1f6234(0x110),a8_0x1f6234(0x11e)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a8_0x1f6234(0xff)](',\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':a8_0x1f6234(0xf1),'type':a8_0x1f6234(0x10a),'required':!![],'description':a8_0x1f6234(0x119)},ARTIFACT_NAME_FLAG={'name':a8_0x1f6234(0x103),'type':a8_0x1f6234(0x10a),'description':a8_0x1f6234(0x116)},METADATA_FLAG={'name':a8_0x1f6234(0x124),'type':'string','description':a8_0x1f6234(0x10f)};function isPlainObject(_0x2fde95){const _0x40be0b=a8_0x1f6234;return typeof _0x2fde95===_0x40be0b(0xe8)&&_0x2fde95!==null&&!Array['isArray'](_0x2fde95);}function readSourceFile(_0x16d1bf){const _0x183d04=a8_0x1f6234;if(!_0x16d1bf)throw CliErrors[_0x183d04(0x10e)](_0x183d04(0xf2));if(!existsSync(_0x16d1bf))throw CliErrors['validation'](_0x183d04(0x121)+_0x16d1bf);if(!statSync(_0x16d1bf)[_0x183d04(0xe6)]())throw CliErrors[_0x183d04(0x10e)](_0x183d04(0x11a)+_0x16d1bf);const _0x3d8082=readFileSync(_0x16d1bf,_0x183d04(0xf0));return validateReactModuleSource(_0x3d8082),_0x3d8082;}function parseMetadata(_0x3d8705){const _0x3bdf51=a8_0x1f6234;if(!_0x3d8705)return undefined;let _0x456407;try{_0x456407=JSON[_0x3bdf51(0xe1)](_0x3d8705);}catch{throw CliErrors[_0x3bdf51(0x10e)](_0x3bdf51(0xed)+_0x3d8705);}if(!isPlainObject(_0x456407))throw CliErrors[_0x3bdf51(0x10e)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x4181fc={..._0x456407};return delete _0x4181fc['compiledContent'],_0x4181fc;}function getPackageName(_0x16a6ce){const _0x47aef2=a8_0x1f6234;if(_0x16a6ce['startsWith']('@')){const [_0x59c75a,_0x2a8d33]=_0x16a6ce['split']('/');return _0x59c75a&&_0x2a8d33?_0x59c75a+'/'+_0x2a8d33:_0x16a6ce;}return _0x16a6ce[_0x47aef2(0x11b)]('/')[0x0]||_0x16a6ce;}function validateAllowedImports(_0x433e78){const _0xbd3e43=a8_0x1f6234,_0x2d0d88=new Set();for(const _0x16041a of IMPORT_SOURCE_PATTERNS){_0x16041a['lastIndex']=0x0;let _0x10d02a;while((_0x10d02a=_0x16041a['exec'](_0x433e78))!==null){const _0x69eaf4=_0x10d02a[0x1]?.[_0xbd3e43(0xee)]();_0x69eaf4&&_0x2d0d88['add'](_0x69eaf4);}}const _0x49cfc7=[..._0x2d0d88][_0xbd3e43(0xf9)](getPackageName)[_0xbd3e43(0x100)](_0x2f9daf=>!ALLOWED_REACT_MODULE_IMPORTS[_0xbd3e43(0x10d)](_0x2f9daf));if(_0x49cfc7[_0xbd3e43(0x11d)]>0x0)throw CliErrors[_0xbd3e43(0x10e)](_0xbd3e43(0x129)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+'.\x20Unsupported:\x20'+[...new Set(_0x49cfc7)][_0xbd3e43(0xff)](',\x20'));}export function validateReactModuleSource(_0x188c0d){const _0x5c5013=a8_0x1f6234;if(!_0x188c0d[_0x5c5013(0xee)]())throw CliErrors['validation'](_0x5c5013(0xf7));if(PAGE_LEVEL_PATTERNS['some'](_0x51dea1=>_0x51dea1['test'](_0x188c0d)))throw CliErrors[_0x5c5013(0x10e)](_0x5c5013(0x12b));validateAllowedImports(_0x188c0d);}function buildArtifactInput(_0x1b3c23){const _0x348b5e=a8_0x1f6234,_0x4af1b8=readSourceFile(_0x1b3c23[_0x348b5e(0x101)]('file')),_0x313f1c=_0x1b3c23['str'](_0x348b5e(0x103))['trim'](),_0x1214ab=parseMetadata(_0x1b3c23['str']('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x313f1c?{'name':_0x313f1c}:{},'content':_0x4af1b8,..._0x1214ab?{'metadata':_0x1214ab}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x26f566){const _0x199167=a8_0x1f6234;return{'id':_0x26f566['id'],'name':_0x26f566[_0x199167(0x103)],'artifactType':_0x26f566[_0x199167(0x12f)],'source':_0x26f566[_0x199167(0x10b)],'favorite':_0x26f566[_0x199167(0x122)],'deleted':_0x26f566[_0x199167(0xfd)],'createTime':_0x26f566['createTime'],'updateTime':_0x26f566[_0x199167(0x128)]};}function detailArtifact(_0x33a180){const _0x1eb7a0=a8_0x1f6234;return{'id':_0x33a180['id'],'appCode':_0x33a180[_0x1eb7a0(0x12e)],'name':_0x33a180[_0x1eb7a0(0x103)],'artifactType':_0x33a180[_0x1eb7a0(0x12f)],'source':_0x33a180[_0x1eb7a0(0x10b)],'favorite':_0x33a180['favorite'],'deleted':_0x33a180[_0x1eb7a0(0xfd)],'content':_0x33a180[_0x1eb7a0(0xf4)]??'','compiledContent':_0x33a180[_0x1eb7a0(0x12d)],'metadata':_0x33a180[_0x1eb7a0(0x124)]??{},'createTime':_0x33a180['createTime'],'updateTime':_0x33a180[_0x1eb7a0(0x128)]};}function readFavoriteFlag(_0x5a1ac6){const _0x1ea41e=a8_0x1f6234,_0x2714be=_0x5a1ac6[_0x1ea41e(0xe3)](_0x1ea41e(0x122));return _0x2714be===undefined||_0x2714be===null||_0x2714be===''?undefined:_0x5a1ac6['bool'](_0x1ea41e(0x122));}function a8_0x32a6(_0x1c35e1,_0x19e4cf){_0x1c35e1=_0x1c35e1-0xe1;const _0x5c6ded=a8_0x5c6d();let _0x32a6e1=_0x5c6ded[_0x1c35e1];return _0x32a6e1;}const artifactList={'service':a8_0x1f6234(0x126),'command':a8_0x1f6234(0x114),'description':a8_0x1f6234(0xe4),'risk':a8_0x1f6234(0xe2),'flags':[{'name':a8_0x1f6234(0x10b),'type':'string','description':a8_0x1f6234(0x109)},{'name':a8_0x1f6234(0x122),'type':a8_0x1f6234(0xfa),'description':a8_0x1f6234(0x105)},VERBOSE_FLAG],async 'execute'(_0x4b75de){const _0x5c7a60=a8_0x1f6234,_0x37997e=await listRuntimeArtifacts(_0x4b75de[_0x5c7a60(0x12e)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4b75de[_0x5c7a60(0x101)]('source')?{'source':_0x4b75de['str']('source')}:{},...readFavoriteFlag(_0x4b75de)!==undefined?{'favorite':readFavoriteFlag(_0x4b75de)}:{}});return{'ok':!![],'data':{'total':_0x37997e[_0x5c7a60(0x11d)],'items':_0x4b75de[_0x5c7a60(0xfb)](_0x5c7a60(0x104))?_0x37997e:_0x37997e[_0x5c7a60(0xf9)](summarizeArtifact)}};}},artifactDetail={'service':a8_0x1f6234(0x126),'command':a8_0x1f6234(0x118),'description':a8_0x1f6234(0x113),'risk':'read','flags':[{...ID_FLAG,'description':a8_0x1f6234(0x123)}],async 'execute'(_0x3cfa99){const _0x3d8d28=a8_0x1f6234,_0x143067=await getRuntimeArtifact(_0x3cfa99[_0x3d8d28(0xe9)]('id'),_0x3cfa99[_0x3d8d28(0x12e)]);return{'ok':!![],'data':detailArtifact(_0x143067)};}},artifactCreate={'service':'artifact','command':a8_0x1f6234(0x11c),'description':'Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x3f71e8){const _0x3bfaf6=a8_0x1f6234,_0x56bca3=buildArtifactInput(_0x3f71e8),_0x153fa4=await createRuntimeArtifact(_0x3f71e8[_0x3bfaf6(0x12e)],_0x56bca3);return{'ok':!![],'data':detailArtifact(_0x153fa4),'message':_0x3bfaf6(0xf6)+_0x153fa4['id']+(_0x153fa4[_0x3bfaf6(0x103)]?'\x20('+_0x153fa4[_0x3bfaf6(0x103)]+')':'')};},async 'dryRun'(_0x5ea585){const _0x176852=a8_0x1f6234,_0x1effdb=buildArtifactInput(_0x5ea585);return dryRun('POST',_0x176852(0xfe))['body']({'appCode':_0x5ea585[_0x176852(0x12e)],..._0x1effdb})['description'](_0x176852(0x115))[_0x176852(0x12a)]();}},artifactUpdate={'service':a8_0x1f6234(0x126),'command':'update','description':a8_0x1f6234(0x11f),'risk':a8_0x1f6234(0xec),'flags':[{...ID_FLAG,'description':a8_0x1f6234(0x123)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x2947bd){const _0x1ae503=a8_0x1f6234,_0x119ae6=_0x2947bd[_0x1ae503(0xe9)]('id'),_0x283050=buildArtifactInput(_0x2947bd),_0x660656=await updateRuntimeArtifact(_0x119ae6,_0x2947bd['appCode'],_0x283050);return{'ok':!![],'data':detailArtifact(_0x660656),'message':'Updated\x20Artifact\x20'+_0x660656['id']+(_0x660656[_0x1ae503(0x103)]?'\x20('+_0x660656[_0x1ae503(0x103)]+')':'')};},async 'dryRun'(_0x31fb74){const _0x2d6e69=a8_0x1f6234,_0x3efe93=_0x31fb74[_0x2d6e69(0xe9)]('id'),_0x591461=buildArtifactInput(_0x31fb74);return dryRun(_0x2d6e69(0xf5),_0x2d6e69(0x107)+_0x3efe93+_0x2d6e69(0x120))[_0x2d6e69(0xe7)]({'appCode':_0x31fb74[_0x2d6e69(0x12e)],..._0x591461})['description'](_0x2d6e69(0x127)+_0x3efe93)['build']();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a8_0x5cac5f=a8_0x1981;(function(_0x49907a,_0x1db354){const _0x336acc=a8_0x1981,_0x576fd4=_0x49907a();while(!![]){try{const _0x2f4af0=parseInt(_0x336acc(0x14c))/0x1*(parseInt(_0x336acc(0x131))/0x2)+-parseInt(_0x336acc(0x125))/0x3+parseInt(_0x336acc(0x148))/0x4+parseInt(_0x336acc(0x111))/0x5*(parseInt(_0x336acc(0x107))/0x6)+parseInt(_0x336acc(0x12a))/0x7*(parseInt(_0x336acc(0x128))/0x8)+parseInt(_0x336acc(0x140))/0x9+-parseInt(_0x336acc(0xfd))/0xa;if(_0x2f4af0===_0x1db354)break;else _0x576fd4['push'](_0x576fd4['shift']());}catch(_0x5aa2df){_0x576fd4['push'](_0x576fd4['shift']());}}}(a8_0x4110,0xbbfb7));function a8_0x1981(_0x37ec27,_0x58a27e){_0x37ec27=_0x37ec27-0xfc;const _0x411044=a8_0x4110();let _0x198162=_0x411044[_0x37ec27];return _0x198162;}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=a8_0x5cac5f(0x12b),ARTIFACT_SOURCE_AGENT='AGENT',ALLOWED_REACT_MODULE_IMPORTS=[a8_0x5cac5f(0x134),a8_0x5cac5f(0x13d),a8_0x5cac5f(0x149),'dayjs',a8_0x5cac5f(0x10e),a8_0x5cac5f(0x12e)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS['join'](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':'file','type':a8_0x5cac5f(0x146),'required':!![],'description':a8_0x5cac5f(0x135)},ARTIFACT_NAME_FLAG={'name':a8_0x5cac5f(0x104),'type':'string','description':a8_0x5cac5f(0x127)},METADATA_FLAG={'name':a8_0x5cac5f(0x11e),'type':'string','description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x128f1b){const _0x57e49c=a8_0x5cac5f;return typeof _0x128f1b===_0x57e49c(0x143)&&_0x128f1b!==null&&!Array[_0x57e49c(0x12f)](_0x128f1b);}function readSourceFile(_0x32db17){const _0x26fe1e=a8_0x5cac5f;if(!_0x32db17)throw CliErrors[_0x26fe1e(0x147)](_0x26fe1e(0x109));if(!existsSync(_0x32db17))throw CliErrors[_0x26fe1e(0x147)](_0x26fe1e(0x100)+_0x32db17);if(!statSync(_0x32db17)[_0x26fe1e(0x13f)]())throw CliErrors[_0x26fe1e(0x147)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x32db17);const _0x4c8162=readFileSync(_0x32db17,_0x26fe1e(0x129));return validateReactModuleSource(_0x4c8162),_0x4c8162;}function parseMetadata(_0x59f33e){const _0x54459f=a8_0x5cac5f;if(!_0x59f33e)return undefined;let _0x30eec8;try{_0x30eec8=JSON[_0x54459f(0x120)](_0x59f33e);}catch{throw CliErrors['validation']('Invalid\x20JSON\x20for\x20--metadata:\x20'+_0x59f33e);}if(!isPlainObject(_0x30eec8))throw CliErrors[_0x54459f(0x147)]('--metadata\x20must\x20be\x20a\x20JSON\x20object.');const _0x3e1d39={..._0x30eec8};return delete _0x3e1d39['compiledContent'],_0x3e1d39;}function getPackageName(_0x37784e){const _0x5926c4=a8_0x5cac5f;if(_0x37784e['startsWith']('@')){const [_0x28dc4a,_0x370b09]=_0x37784e[_0x5926c4(0x130)]('/');return _0x28dc4a&&_0x370b09?_0x28dc4a+'/'+_0x370b09:_0x37784e;}return _0x37784e['split']('/')[0x0]||_0x37784e;}function a8_0x4110(){const _0x4ccd94=['add','join','@ant-design/icons','isArray','split','3592UUmXnu','list','str','react','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','write','read','source','length','bool','deleted','/update','react-dom','List\x20current-app\x20react_module\x20Artifacts','isFile','6556311vUbCYA','Show\x20one\x20Artifact\x20by\x20id','map','object','Artifact\x20ID','Updated\x20Artifact\x20','string','validation','1867280zwurcP','lodash','includes','file','561LVYUEt','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','some','23516210dyGyTp','POST','test','File\x20not\x20found:\x20','update','.\x20Unsupported:\x20','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','name','artifactType','/client/artifact/','6394308BFNTOy','Artifact\x20source\x20file\x20is\x20blank.','File\x20path\x20is\x20required.','appCode','Preview:\x20create\x20react_module\x20Artifact','verbose','create','antd','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Created\x20Artifact\x20','5TAACJK','filter','boolean','trim','createTime','content','react_module\x20imports\x20are\x20limited\x20to:\x20','favorite','Preview:\x20update\x20react_module\x20Artifact\x20','build','num','flag','description','metadata','artifact','parse','body','/client/artifact/create','compiledContent','updateTime','1774815ZRnRXT','lastIndex','Artifact\x20display\x20name','61328ctavuX','utf8','406KLMQDR','react_module'];a8_0x4110=function(){return _0x4ccd94;};return a8_0x4110();}function validateAllowedImports(_0x324aa0){const _0x15406f=a8_0x5cac5f,_0x33ca93=new Set();for(const _0x184a39 of IMPORT_SOURCE_PATTERNS){_0x184a39[_0x15406f(0x126)]=0x0;let _0x29d0d5;while((_0x29d0d5=_0x184a39['exec'](_0x324aa0))!==null){const _0xb6c8d=_0x29d0d5[0x1]?.[_0x15406f(0x114)]();_0xb6c8d&&_0x33ca93[_0x15406f(0x12c)](_0xb6c8d);}}const _0x58c9d7=[..._0x33ca93][_0x15406f(0x142)](getPackageName)[_0x15406f(0x112)](_0x4daf72=>!ALLOWED_REACT_MODULE_IMPORTS[_0x15406f(0x14a)](_0x4daf72));if(_0x58c9d7[_0x15406f(0x139)]>0x0)throw CliErrors[_0x15406f(0x147)](_0x15406f(0x117)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x15406f(0x102)+[...new Set(_0x58c9d7)][_0x15406f(0x12d)](',\x20'));}export function validateReactModuleSource(_0x1db6ea){const _0x5cabe5=a8_0x5cac5f;if(!_0x1db6ea[_0x5cabe5(0x114)]())throw CliErrors[_0x5cabe5(0x147)](_0x5cabe5(0x108));if(PAGE_LEVEL_PATTERNS[_0x5cabe5(0xfc)](_0x531cd8=>_0x531cd8[_0x5cabe5(0xff)](_0x1db6ea)))throw CliErrors[_0x5cabe5(0x147)](_0x5cabe5(0x103));validateAllowedImports(_0x1db6ea);}function buildArtifactInput(_0x115f77){const _0x4641bb=a8_0x5cac5f,_0x1f4951=readSourceFile(_0x115f77['str'](_0x4641bb(0x14b))),_0x5a8b87=_0x115f77[_0x4641bb(0x133)]('name')[_0x4641bb(0x114)](),_0x3daeb4=parseMetadata(_0x115f77[_0x4641bb(0x133)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x5a8b87?{'name':_0x5a8b87}:{},'content':_0x1f4951,..._0x3daeb4?{'metadata':_0x3daeb4}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x534dc9){const _0x1c836c=a8_0x5cac5f;return{'id':_0x534dc9['id'],'name':_0x534dc9[_0x1c836c(0x104)],'artifactType':_0x534dc9[_0x1c836c(0x105)],'source':_0x534dc9[_0x1c836c(0x138)],'favorite':_0x534dc9['favorite'],'deleted':_0x534dc9['deleted'],'createTime':_0x534dc9[_0x1c836c(0x115)],'updateTime':_0x534dc9[_0x1c836c(0x124)]};}function detailArtifact(_0x334258){const _0x44fcd7=a8_0x5cac5f;return{'id':_0x334258['id'],'appCode':_0x334258[_0x44fcd7(0x10a)],'name':_0x334258[_0x44fcd7(0x104)],'artifactType':_0x334258[_0x44fcd7(0x105)],'source':_0x334258['source'],'favorite':_0x334258[_0x44fcd7(0x118)],'deleted':_0x334258[_0x44fcd7(0x13b)],'content':_0x334258[_0x44fcd7(0x116)]??'','compiledContent':_0x334258[_0x44fcd7(0x123)],'metadata':_0x334258[_0x44fcd7(0x11e)]??{},'createTime':_0x334258[_0x44fcd7(0x115)],'updateTime':_0x334258[_0x44fcd7(0x124)]};}function readFavoriteFlag(_0x57cdac){const _0x13cf73=a8_0x5cac5f,_0x520cdf=_0x57cdac[_0x13cf73(0x11c)]('favorite');return _0x520cdf===undefined||_0x520cdf===null||_0x520cdf===''?undefined:_0x57cdac[_0x13cf73(0x13a)]('favorite');}const artifactList={'service':a8_0x5cac5f(0x11f),'command':a8_0x5cac5f(0x132),'description':a8_0x5cac5f(0x13e),'risk':a8_0x5cac5f(0x137),'flags':[{'name':a8_0x5cac5f(0x138),'type':a8_0x5cac5f(0x146),'description':a8_0x5cac5f(0x14d)},{'name':a8_0x5cac5f(0x118),'type':a8_0x5cac5f(0x113),'description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x31b97f){const _0x2accf8=a8_0x5cac5f,_0x38f560=await listRuntimeArtifacts(_0x31b97f[_0x2accf8(0x10a)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x31b97f['str'](_0x2accf8(0x138))?{'source':_0x31b97f['str'](_0x2accf8(0x138))}:{},...readFavoriteFlag(_0x31b97f)!==undefined?{'favorite':readFavoriteFlag(_0x31b97f)}:{}});return{'ok':!![],'data':{'total':_0x38f560[_0x2accf8(0x139)],'items':_0x31b97f['bool'](_0x2accf8(0x10c))?_0x38f560:_0x38f560['map'](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':'detail','description':a8_0x5cac5f(0x141),'risk':a8_0x5cac5f(0x137),'flags':[{...ID_FLAG,'description':a8_0x5cac5f(0x144)}],async 'execute'(_0x589a3d){const _0x4eec99=a8_0x5cac5f,_0x1d748f=await getRuntimeArtifact(_0x589a3d[_0x4eec99(0x11b)]('id'),_0x589a3d[_0x4eec99(0x10a)]);return{'ok':!![],'data':detailArtifact(_0x1d748f)};}},artifactCreate={'service':a8_0x5cac5f(0x11f),'command':a8_0x5cac5f(0x10d),'description':a8_0x5cac5f(0x10f),'risk':a8_0x5cac5f(0x136),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1e339a){const _0x1e64d7=a8_0x5cac5f,_0x1fcf9c=buildArtifactInput(_0x1e339a),_0xdead39=await createRuntimeArtifact(_0x1e339a['appCode'],_0x1fcf9c);return{'ok':!![],'data':detailArtifact(_0xdead39),'message':_0x1e64d7(0x110)+_0xdead39['id']+(_0xdead39[_0x1e64d7(0x104)]?'\x20('+_0xdead39[_0x1e64d7(0x104)]+')':'')};},async 'dryRun'(_0x48ad08){const _0x262511=a8_0x5cac5f,_0x348a1a=buildArtifactInput(_0x48ad08);return dryRun('POST',_0x262511(0x122))[_0x262511(0x121)]({'appCode':_0x48ad08[_0x262511(0x10a)],..._0x348a1a})[_0x262511(0x11d)](_0x262511(0x10b))[_0x262511(0x11a)]();}},artifactUpdate={'service':a8_0x5cac5f(0x11f),'command':a8_0x5cac5f(0x101),'description':'Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':'write','flags':[{...ID_FLAG,'description':a8_0x5cac5f(0x144)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x511a09){const _0x378c19=a8_0x5cac5f,_0x3ec4bd=_0x511a09[_0x378c19(0x11b)]('id'),_0x3e67fa=buildArtifactInput(_0x511a09),_0x19b681=await updateRuntimeArtifact(_0x3ec4bd,_0x511a09[_0x378c19(0x10a)],_0x3e67fa);return{'ok':!![],'data':detailArtifact(_0x19b681),'message':_0x378c19(0x145)+_0x19b681['id']+(_0x19b681['name']?'\x20('+_0x19b681[_0x378c19(0x104)]+')':'')};},async 'dryRun'(_0x5934ac){const _0x38cf87=a8_0x5cac5f,_0x4cfdc0=_0x5934ac['num']('id'),_0x3fe411=buildArtifactInput(_0x5934ac);return dryRun(_0x38cf87(0xfe),_0x38cf87(0x106)+_0x4cfdc0+_0x38cf87(0x13c))[_0x38cf87(0x121)]({'appCode':_0x5934ac['appCode'],..._0x3fe411})[_0x38cf87(0x11d)](_0x38cf87(0x119)+_0x4cfdc0)[_0x38cf87(0x11a)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a9_0x15a80a=a9_0x3fc1;function a9_0x323d(){const _0x1e9a5b=['11457HzeYiX','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','1264dxZdJu','AccessKey:\x20','status','project','Missing\x20accessKey.','\x20env\x20var','Use\x20`','access-key','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','\x20(via\x20','stdout','string','`auth\x20login`\x20does\x20not\x20support\x20--yes.','str','Write\x20to\x20global\x20config\x20(default)','trim','Invalid\x20accessKey\x20format:\x20\x22','global-default','production','nonInteractive','slice','\x20\x20export\x20','global','accessKey','4iahgrU','login','Clear\x20accessKey\x20from\x20config','70UfpGip','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','push','boolean','ACCESS_KEY','userCenterDisplayName','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Shorthand\x20for\x20--access-key','\x20config','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','\x20Current\x20env:\x20','yes','595347AEpCAZ','=ak_xxx','\x20config.','logout','env','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','276iRPOSD','1267Bmpkip','No\x20AccessKey\x20found\x20in\x20','21703SQzVOi','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','write','length','Auth\x20config\x20reinitialized\x20in\x20','\x20Verify:\x20','development','ClientAk','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','newConfigFileName','Option\x20B:\x20apps\x20config\x20(','init','isTTY','auth','\x20scope.','test','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','validation','bool','Option\x20A:\x20','132202IdAuKE','stdin','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','\x20auth\x20status','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','Auth\x20mode:\x20','join','AccessKey\x20cleared\x20from\x20','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','185188tjkpOF','cancelled','\x20auth\x20login\x20--access-key\x20<ak_xxx>','Option\x20C:\x20environment\x20variable','Show\x20current\x20authentication\x20status','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','Read\x20from\x20global\x20config\x20(default)','read','182760kydXKV'];a9_0x323d=function(){return _0x1e9a5b;};return a9_0x323d();}(function(_0x1cba2b,_0x4ad4dc){const _0x281ab5=a9_0x3fc1,_0x3198be=_0x1cba2b();while(!![]){try{const _0x3724cd=parseInt(_0x281ab5(0x11f))/0x1+-parseInt(_0x281ab5(0x116))/0x2+-parseInt(_0x281ab5(0xf9))/0x3*(parseInt(_0x281ab5(0x142))/0x4)+-parseInt(_0x281ab5(0x127))/0x5+-parseInt(_0x281ab5(0xff))/0x6*(-parseInt(_0x281ab5(0x100))/0x7)+-parseInt(_0x281ab5(0x12a))/0x8*(-parseInt(_0x281ab5(0x128))/0x9)+parseInt(_0x281ab5(0xed))/0xa*(parseInt(_0x281ab5(0x102))/0xb);if(_0x3724cd===_0x4ad4dc)break;else _0x3198be['push'](_0x3198be['shift']());}catch(_0x10d5d7){_0x3198be['push'](_0x3198be['shift']());}}}(a9_0x323d,0x1a35d));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';function a9_0x3fc1(_0x366dbd,_0x4dfea1){_0x366dbd=_0x366dbd-0xeb;const _0x323dfc=a9_0x323d();let _0x3fc1c7=_0x323dfc[_0x366dbd];return _0x3fc1c7;}import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x43a149=a9_0x3fc1;writeCliSideChannelLine(_0x43a149(0xfe)+PRODUCT_CONFIG[_0x43a149(0xf2)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x43a149(0x121));}function buildAccessKeySetupGuide(){const _0x264340=a9_0x3fc1;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG['userCenterDisplayName']+':',USER_ACCESS_KEY_CREATE_URL,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+_0x264340(0x129)][_0x264340(0x11c)]('\x0a');}function canPromptForAccessKey(_0x5b836f){const _0x4afba4=a9_0x3fc1;return!_0x5b836f['nonInteractive']&&process[_0x4afba4(0x117)]['isTTY']!==![]&&process[_0x4afba4(0x134)][_0x4afba4(0x10e)]!==![];}function resolveAuthScopeFlags(_0x4b80e7){const _0x56faee=a9_0x3fc1;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4b80e7[_0x56faee(0x114)](_0x56faee(0x140)),'explicitProject':_0x4b80e7[_0x56faee(0x114)](_0x56faee(0x12d)),'policy':_0x56faee(0x13b)}));}async function resolveAuthWriteInput(_0x386ee9){const _0x3dc688=a9_0x3fc1;let _0x1ce189=(_0x386ee9[_0x3dc688(0x137)](_0x3dc688(0x131))||_0x386ee9[_0x3dc688(0x137)]('ak')||'')['trim']();const _0x783f40=(_0x386ee9[_0x3dc688(0x137)]('env')||'')['trim']();if(!_0x1ce189&&canPromptForAccessKey(_0x386ee9))try{showAccessKeyCreateHint(),_0x1ce189=await promptAccessKey('');}catch(_0x1f8d23){if(isAbortPrompt(_0x1f8d23))throw CliErrors[_0x3dc688(0x120)]();throw _0x1f8d23;}if(!_0x1ce189)throw CliErrors[_0x3dc688(0x113)](_0x3dc688(0x12e),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x3dc688(0x111)](_0x1ce189))throw CliErrors[_0x3dc688(0x113)](_0x3dc688(0x13a)+_0x1ce189+'\x22',_0x3dc688(0x132));if(!_0x783f40)return{'accessKey':_0x1ce189};const _0x5cb2dc=normalizeEnv(_0x783f40);return{'accessKey':_0x1ce189,'env':isDaily(_0x5cb2dc)?'daily':isDev(_0x5cb2dc)?_0x3dc688(0x108):_0x3dc688(0x13c)};}export const authDefinitions=[{'service':a9_0x15a80a(0x10f),'command':a9_0x15a80a(0xeb),'description':a9_0x15a80a(0x124),'risk':a9_0x15a80a(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a9_0x15a80a(0x135),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a9_0x15a80a(0x135),'description':a9_0x15a80a(0xf4)},{'name':a9_0x15a80a(0x140),'type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x138),'default':!![]},{'name':a9_0x15a80a(0x12d),'type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x112),'default':![]}],async 'execute'(_0x15ff29){const _0x2ce4b5=a9_0x15a80a;if(_0x15ff29[_0x2ce4b5(0x114)](_0x2ce4b5(0xf8)))throw CliErrors[_0x2ce4b5(0x113)](_0x2ce4b5(0x136),_0x2ce4b5(0x130)+CLI_BIN_NAME+_0x2ce4b5(0xee)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x4dd601=(_0x15ff29[_0x2ce4b5(0x137)](_0x2ce4b5(0x131))||_0x15ff29[_0x2ce4b5(0x137)]('ak')||'')[_0x2ce4b5(0x139)]();if(!_0x4dd601&&_0x15ff29[_0x2ce4b5(0x13d)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x50f889=await resolveAuthWriteInput(_0x15ff29),_0x5ad57d=resolveAuthScopeFlags(_0x15ff29),_0x48fc74=readScopedConfig(_0x5ad57d);_0x48fc74['accessKey']=_0x50f889[_0x2ce4b5(0x141)];_0x50f889[_0x2ce4b5(0xfd)]&&(_0x48fc74['env']=_0x50f889[_0x2ce4b5(0xfd)]);writeScopedConfig(_0x48fc74,_0x5ad57d);const _0xc5b088=_0x5ad57d[_0x2ce4b5(0x140)]?_0x2ce4b5(0x140):'project',_0x48340f=_0x48fc74[_0x2ce4b5(0xfd)]?_0x2ce4b5(0xf7)+_0x48fc74[_0x2ce4b5(0xfd)]+'.':'';return{'ok':!![],'message':'AccessKey\x20saved\x20to\x20'+_0xc5b088+_0x2ce4b5(0xfb)+_0x48340f+_0x2ce4b5(0x107)+CLI_BIN_NAME+_0x2ce4b5(0x119)};}},{'service':a9_0x15a80a(0x10f),'command':a9_0x15a80a(0x10d),'description':a9_0x15a80a(0x11a),'risk':a9_0x15a80a(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a9_0x15a80a(0x135),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':'string','description':a9_0x15a80a(0xf4)},{'name':a9_0x15a80a(0xfd),'type':a9_0x15a80a(0x135),'description':a9_0x15a80a(0x11e)},{'name':'global','type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x138),'default':!![]},{'name':a9_0x15a80a(0x12d),'type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x112),'default':![]}],async 'execute'(_0x39a1b3){const _0x3d031c=a9_0x15a80a,_0x458694=await resolveAuthWriteInput(_0x39a1b3),_0x5f329d=resolveAuthScopeFlags(_0x39a1b3),_0x5d0cc3={'accessKey':_0x458694['accessKey']};_0x458694[_0x3d031c(0xfd)]&&(_0x5d0cc3[_0x3d031c(0xfd)]=_0x458694[_0x3d031c(0xfd)]);writeScopedConfig(_0x5d0cc3,_0x5f329d);const _0x3dd150=_0x5f329d[_0x3d031c(0x140)]?_0x3d031c(0x140):_0x3d031c(0x12d),_0x5e9b98=_0x5d0cc3['env']?_0x3d031c(0xf7)+_0x5d0cc3[_0x3d031c(0xfd)]+'.':'';return{'ok':!![],'message':_0x3d031c(0x106)+_0x3dd150+_0x3d031c(0x110)+_0x5e9b98+'\x20Verify:\x20'+CLI_BIN_NAME+_0x3d031c(0x119)};}},{'service':a9_0x15a80a(0x10f),'command':a9_0x15a80a(0xfc),'description':a9_0x15a80a(0xec),'risk':a9_0x15a80a(0x104),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x15a80a(0x140),'type':a9_0x15a80a(0xf0),'description':'Clear\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':'boolean','description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x56ec6a){const _0x470c2f=a9_0x15a80a,_0x4014c7=resolveAuthScopeFlags(_0x56ec6a),_0x16576d=readScopedConfig(_0x4014c7),_0x1e043d=!!_0x16576d['accessKey'];delete _0x16576d[_0x470c2f(0x141)],writeScopedConfig(_0x16576d,_0x4014c7);const _0x2396b0=_0x4014c7[_0x470c2f(0x140)]?_0x470c2f(0x140):_0x470c2f(0x12d);if(_0x1e043d)return{'ok':!![],'message':_0x470c2f(0x11d)+_0x2396b0+_0x470c2f(0xfb)};return{'ok':!![],'message':_0x470c2f(0x101)+_0x2396b0+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a9_0x15a80a(0x10f),'command':a9_0x15a80a(0x12c),'description':a9_0x15a80a(0x123),'risk':a9_0x15a80a(0x126),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x125),'default':!![]},{'name':a9_0x15a80a(0x12d),'type':a9_0x15a80a(0xf0),'description':a9_0x15a80a(0x10a),'default':![]}],async 'execute'(_0x34ed53){const _0x4fe425=a9_0x15a80a,_0x20e901=resolveAuthScopeFlags(_0x34ed53),_0x3f1445=readScopedConfig(_0x20e901),_0x2b4e2f=productEnvName(_0x4fe425(0xf1)),_0x1e82cb=productEnv('ACCESS_KEY')||undefined,_0x2d819b=_0x3f1445[_0x4fe425(0x141)]||undefined,_0x571ffd=_0x1e82cb||_0x2d819b,_0x4abc30=_0x1e82cb?_0x2b4e2f+_0x4fe425(0x12f):_0x2d819b?(_0x20e901[_0x4fe425(0x140)]?_0x4fe425(0x140):_0x4fe425(0x12d))+_0x4fe425(0xf5):null,_0x138f25=[_0x4fe425(0x11b)+AUTH_MODE[_0x4fe425(0x109)]];if(_0x571ffd){const _0x4acfe5=_0x571ffd[_0x4fe425(0x105)]>0x8?''+_0x571ffd[_0x4fe425(0x13e)](0x0,0x8)+'*'['repeat'](_0x571ffd[_0x4fe425(0x105)]-0x8):_0x571ffd;_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x12b)+_0x4acfe5+(_0x4abc30?_0x4fe425(0x133)+_0x4abc30+')':''));}return!_0x571ffd&&(_0x138f25[_0x4fe425(0xef)](''),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0xf6)),_0x138f25[_0x4fe425(0xef)](''),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x115)+CLI_BIN_NAME+_0x4fe425(0xf3)),_0x138f25[_0x4fe425(0xef)](''),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x10c)+PRODUCT_CONFIG[_0x4fe425(0x10b)]+')'),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x103)),_0x138f25[_0x4fe425(0xef)](''),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x122)),_0x138f25[_0x4fe425(0xef)](_0x4fe425(0x13f)+_0x2b4e2f+_0x4fe425(0xfa)),_0x138f25[_0x4fe425(0xef)](''),_0x138f25['push']('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x4fe425(0x119)),_0x138f25[_0x4fe425(0xef)]('If\x20command\x20execution\x20still\x20fails,\x20run:\x20'+CLI_BIN_NAME+'\x20doctor')),{'ok':!![],'message':_0x138f25[_0x4fe425(0x11c)]('\x0a')};}},{'service':'auth','command':'info','description':a9_0x15a80a(0x118),'risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x3b43d7){const _0x2f55e7=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x2f55e7,'meta':{'env':_0x3b43d7['envName']??'production'}}};}}];
|
|
1
|
+
const a9_0x374adc=a9_0x368b;function a9_0x4cfe(){const _0x44457c=['\x20config.\x20Nothing\x20to\x20clear.','newConfigFileName','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','envName','repeat','\x20config.','info','\x20doctor','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','268017ehLflX','Auth\x20config\x20reinitialized\x20in\x20','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','slice','AccessKey:\x20','Option\x20A:\x20','accessKey','\x20config','nonInteractive','trim','logout','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','274nfmlKD','Option\x20B:\x20apps\x20config\x20(','access-key','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','project','stdin','Shorthand\x20for\x20--access-key','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','=ak_xxx','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Read\x20from\x20global\x20config\x20(default)','8507592XBgALP','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','\x20auth\x20login\x20--access-key\x20<ak_xxx>','20zKhbhL','Option\x20C:\x20environment\x20variable','write','string','daily','Write\x20to\x20global\x20config\x20(default)','validation','Clear\x20accessKey\x20from\x20config','6ObhUEo','test','6046940xeaZvM','auth','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','997DytGWC','str','`auth\x20login`\x20does\x20not\x20support\x20--yes.','yes','AccessKey\x20saved\x20to\x20','boolean','AccessKey\x20(ak_xxx...)','\x20auth\x20status','cancelled','env','Missing\x20accessKey.','read','userCenterDisplayName','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','ClientAk','push','global','9302624BdCgwN','isTTY','\x20Current\x20env:\x20','4671506QwTAeF','length','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','\x20Verify:\x20','development','Clear\x20from\x20global\x20config\x20(default)','\x20\x20export\x20','join','\x20env\x20var','No\x20AccessKey\x20found\x20in\x20','Auth\x20mode:\x20','status','bool','4617170mfRGbZ','production'];a9_0x4cfe=function(){return _0x44457c;};return a9_0x4cfe();}(function(_0x49e414,_0xfccd6a){const _0x22d088=a9_0x368b,_0x3a10e8=_0x49e414();while(!![]){try{const _0x527dd0=parseInt(_0x22d088(0xf3))/0x1*(parseInt(_0x22d088(0xd8))/0x2)+parseInt(_0x22d088(0xcc))/0x3*(parseInt(_0x22d088(0xe6))/0x4)+parseInt(_0x22d088(0xc0))/0x5*(-parseInt(_0x22d088(0xee))/0x6)+parseInt(_0x22d088(0xb3))/0x7+-parseInt(_0x22d088(0xb0))/0x8+parseInt(_0x22d088(0xe3))/0x9+parseInt(_0x22d088(0xf0))/0xa;if(_0x527dd0===_0xfccd6a)break;else _0x3a10e8['push'](_0x3a10e8['shift']());}catch(_0xae14dc){_0x3a10e8['push'](_0x3a10e8['shift']());}}}(a9_0x4cfe,0xae67a));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x1c3f70=a9_0x368b;writeCliSideChannelLine(_0x1c3f70(0xcb)+PRODUCT_CONFIG[_0x1c3f70(0xaa)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine('Tip:\x20you\x20can\x20also\x20run:'),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x1c3f70(0xe5));}function buildAccessKeySetupGuide(){const _0x1e39d3=a9_0x368b;return['AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x1e39d3(0xaa)]+':',USER_ACCESS_KEY_CREATE_URL,'Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20'+CLI_BIN_NAME+_0x1e39d3(0xf2)][_0x1e39d3(0xba)]('\x0a');}function a9_0x368b(_0x2c8cda,_0x13150f){_0x2c8cda=_0x2c8cda-0xa8;const _0x4cfe3d=a9_0x4cfe();let _0x368b9c=_0x4cfe3d[_0x2c8cda];return _0x368b9c;}function canPromptForAccessKey(_0x57cba9){const _0x4dea86=a9_0x368b;return!_0x57cba9[_0x4dea86(0xd4)]&&process[_0x4dea86(0xdd)][_0x4dea86(0xb1)]!==![]&&process['stdout'][_0x4dea86(0xb1)]!==![];}function resolveAuthScopeFlags(_0x333bf6){const _0x2fabe9=a9_0x368b;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x333bf6[_0x2fabe9(0xbf)]('global'),'explicitProject':_0x333bf6[_0x2fabe9(0xbf)](_0x2fabe9(0xdc)),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x3830b6){const _0x51e3c4=a9_0x368b;let _0x55784c=(_0x3830b6[_0x51e3c4(0xf4)](_0x51e3c4(0xda))||_0x3830b6[_0x51e3c4(0xf4)]('ak')||'')['trim']();const _0x123bf8=(_0x3830b6[_0x51e3c4(0xf4)]('env')||'')[_0x51e3c4(0xd5)]();if(!_0x55784c&&canPromptForAccessKey(_0x3830b6))try{showAccessKeyCreateHint(),_0x55784c=await promptAccessKey('');}catch(_0x868892){if(isAbortPrompt(_0x868892))throw CliErrors[_0x51e3c4(0xfb)]();throw _0x868892;}if(!_0x55784c)throw CliErrors[_0x51e3c4(0xec)](_0x51e3c4(0xa8),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x51e3c4(0xef)](_0x55784c))throw CliErrors[_0x51e3c4(0xec)]('Invalid\x20accessKey\x20format:\x20\x22'+_0x55784c+'\x22',_0x51e3c4(0xdf));if(!_0x123bf8)return{'accessKey':_0x55784c};const _0x39d36b=normalizeEnv(_0x123bf8);return{'accessKey':_0x55784c,'env':isDaily(_0x39d36b)?_0x51e3c4(0xea):isDev(_0x39d36b)?_0x51e3c4(0xb7):'production'};}export const authDefinitions=[{'service':a9_0x374adc(0xf1),'command':'login','description':a9_0x374adc(0xac),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x374adc(0xda),'type':a9_0x374adc(0xe9),'description':a9_0x374adc(0xf9)},{'name':'ak','type':a9_0x374adc(0xe9),'description':a9_0x374adc(0xde)},{'name':'global','type':'boolean','description':a9_0x374adc(0xeb),'default':!![]},{'name':a9_0x374adc(0xdc),'type':a9_0x374adc(0xf8),'description':a9_0x374adc(0xc4),'default':![]}],async 'execute'(_0x4c6cce){const _0x3ea304=a9_0x374adc;if(_0x4c6cce[_0x3ea304(0xbf)](_0x3ea304(0xf6)))throw CliErrors['validation'](_0x3ea304(0xf5),'Use\x20`'+CLI_BIN_NAME+_0x3ea304(0xce)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x24c8fd=(_0x4c6cce['str'](_0x3ea304(0xda))||_0x4c6cce[_0x3ea304(0xf4)]('ak')||'')[_0x3ea304(0xd5)]();if(!_0x24c8fd&&_0x4c6cce['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x2ccaf3=await resolveAuthWriteInput(_0x4c6cce),_0xc260c1=resolveAuthScopeFlags(_0x4c6cce),_0x2db380=readScopedConfig(_0xc260c1);_0x2db380[_0x3ea304(0xd2)]=_0x2ccaf3[_0x3ea304(0xd2)];_0x2ccaf3['env']&&(_0x2db380[_0x3ea304(0xfc)]=_0x2ccaf3['env']);writeScopedConfig(_0x2db380,_0xc260c1);const _0x4c7ca9=_0xc260c1[_0x3ea304(0xaf)]?_0x3ea304(0xaf):_0x3ea304(0xdc),_0x5b79ff=_0x2db380[_0x3ea304(0xfc)]?_0x3ea304(0xb2)+_0x2db380[_0x3ea304(0xfc)]+'.':'';return{'ok':!![],'message':_0x3ea304(0xf7)+_0x4c7ca9+_0x3ea304(0xc8)+_0x5b79ff+_0x3ea304(0xb6)+CLI_BIN_NAME+_0x3ea304(0xfa)};}},{'service':'auth','command':'init','description':'Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','risk':a9_0x374adc(0xe8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a9_0x374adc(0xe9),'description':a9_0x374adc(0xf9)},{'name':'ak','type':a9_0x374adc(0xe9),'description':a9_0x374adc(0xde)},{'name':'env','type':a9_0x374adc(0xe9),'description':a9_0x374adc(0xab)},{'name':a9_0x374adc(0xaf),'type':a9_0x374adc(0xf8),'description':a9_0x374adc(0xeb),'default':!![]},{'name':a9_0x374adc(0xdc),'type':a9_0x374adc(0xf8),'description':a9_0x374adc(0xc4),'default':![]}],async 'execute'(_0x5aca99){const _0x54c658=a9_0x374adc,_0x5ac37f=await resolveAuthWriteInput(_0x5aca99),_0x587a88=resolveAuthScopeFlags(_0x5aca99),_0x48c399={'accessKey':_0x5ac37f[_0x54c658(0xd2)]};_0x5ac37f[_0x54c658(0xfc)]&&(_0x48c399[_0x54c658(0xfc)]=_0x5ac37f[_0x54c658(0xfc)]);writeScopedConfig(_0x48c399,_0x587a88);const _0x6bec29=_0x587a88[_0x54c658(0xaf)]?_0x54c658(0xaf):_0x54c658(0xdc),_0x3aa9e4=_0x48c399[_0x54c658(0xfc)]?_0x54c658(0xb2)+_0x48c399[_0x54c658(0xfc)]+'.':'';return{'ok':!![],'message':_0x54c658(0xcd)+_0x6bec29+'\x20scope.'+_0x3aa9e4+'\x20Verify:\x20'+CLI_BIN_NAME+_0x54c658(0xfa)};}},{'service':a9_0x374adc(0xf1),'command':a9_0x374adc(0xd6),'description':a9_0x374adc(0xed),'risk':a9_0x374adc(0xe8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x374adc(0xaf),'type':a9_0x374adc(0xf8),'description':a9_0x374adc(0xb8),'default':!![]},{'name':a9_0x374adc(0xdc),'type':'boolean','description':a9_0x374adc(0xe1),'default':![]}],async 'execute'(_0x774a2){const _0x1a4613=a9_0x374adc,_0x5898ab=resolveAuthScopeFlags(_0x774a2),_0x58a084=readScopedConfig(_0x5898ab),_0x259ac8=!!_0x58a084[_0x1a4613(0xd2)];delete _0x58a084[_0x1a4613(0xd2)],writeScopedConfig(_0x58a084,_0x5898ab);const _0x31be7a=_0x5898ab[_0x1a4613(0xaf)]?_0x1a4613(0xaf):_0x1a4613(0xdc);if(_0x259ac8)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x31be7a+_0x1a4613(0xc8)};return{'ok':!![],'message':_0x1a4613(0xbc)+_0x31be7a+_0x1a4613(0xc2)};}},{'service':a9_0x374adc(0xf1),'command':a9_0x374adc(0xbe),'description':'Show\x20current\x20authentication\x20status','risk':a9_0x374adc(0xa9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a9_0x374adc(0xaf),'type':'boolean','description':a9_0x374adc(0xe2),'default':!![]},{'name':'project','type':'boolean','description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0xea1ded){const _0x552254=a9_0x374adc,_0x1594bd=resolveAuthScopeFlags(_0xea1ded),_0x128089=readScopedConfig(_0x1594bd),_0x5b99df=productEnvName('ACCESS_KEY'),_0x51dd9c=productEnv('ACCESS_KEY')||undefined,_0x46356b=_0x128089['accessKey']||undefined,_0x441684=_0x51dd9c||_0x46356b,_0x24e23e=_0x51dd9c?_0x5b99df+_0x552254(0xbb):_0x46356b?(_0x1594bd['global']?_0x552254(0xaf):_0x552254(0xdc))+_0x552254(0xd3):null,_0x1ccb13=[_0x552254(0xbd)+AUTH_MODE[_0x552254(0xad)]];if(_0x441684){const _0x77ea67=_0x441684['length']>0x8?''+_0x441684[_0x552254(0xcf)](0x0,0x8)+'*'[_0x552254(0xc7)](_0x441684[_0x552254(0xb4)]-0x8):_0x441684;_0x1ccb13[_0x552254(0xae)](_0x552254(0xd0)+_0x77ea67+(_0x24e23e?'\x20(via\x20'+_0x24e23e+')':''));}return!_0x441684&&(_0x1ccb13[_0x552254(0xae)](''),_0x1ccb13[_0x552254(0xae)](_0x552254(0xdb)),_0x1ccb13[_0x552254(0xae)](''),_0x1ccb13[_0x552254(0xae)](_0x552254(0xd1)+CLI_BIN_NAME+_0x552254(0xb5)),_0x1ccb13[_0x552254(0xae)](''),_0x1ccb13['push'](_0x552254(0xd9)+PRODUCT_CONFIG[_0x552254(0xc3)]+')'),_0x1ccb13[_0x552254(0xae)](_0x552254(0xe4)),_0x1ccb13[_0x552254(0xae)](''),_0x1ccb13[_0x552254(0xae)](_0x552254(0xe7)),_0x1ccb13[_0x552254(0xae)](_0x552254(0xb9)+_0x5b99df+_0x552254(0xe0)),_0x1ccb13['push'](''),_0x1ccb13[_0x552254(0xae)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x552254(0xfa)),_0x1ccb13[_0x552254(0xae)](_0x552254(0xc5)+CLI_BIN_NAME+_0x552254(0xca))),{'ok':!![],'message':_0x1ccb13['join']('\x0a')};}},{'service':'auth','command':a9_0x374adc(0xc9),'description':a9_0x374adc(0xd7),'risk':a9_0x374adc(0xa9),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x2195dc){const _0x2e2b9f=a9_0x374adc,_0x592650=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x592650,'meta':{'env':_0x2195dc[_0x2e2b9f(0xc6)]??_0x2e2b9f(0xc1)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x552e6f,_0x4c6e2b){const _0x12e9b7=a10_0x47dd,_0x36d30d=_0x552e6f();while(!![]){try{const _0x3ee2f2=-parseInt(_0x12e9b7(0x1bc))/0x1*(-parseInt(_0x12e9b7(0x1cb))/0x2)+-parseInt(_0x12e9b7(0x1be))/0x3+-parseInt(_0x12e9b7(0x1c6))/0x4+-parseInt(_0x12e9b7(0x1b5))/0x5*(parseInt(_0x12e9b7(0x1c9))/0x6)+-parseInt(_0x12e9b7(0x1c3))/0x7*(parseInt(_0x12e9b7(0x1ca))/0x8)+-parseInt(_0x12e9b7(0x1c0))/0x9+parseInt(_0x12e9b7(0x1c7))/0xa*(parseInt(_0x12e9b7(0x1c4))/0xb);if(_0x3ee2f2===_0x4c6e2b)break;else _0x36d30d['push'](_0x36d30d['shift']());}catch(_0x2fb4b1){_0x36d30d['push'](_0x36d30d['shift']());}}}(a10_0x54f5,0x34265));import{createInterface}from'node:readline';function a10_0x47dd(_0x562df8,_0x3cb273){_0x562df8=_0x562df8-0x1b5;const _0x54f529=a10_0x54f5();let _0x47dd91=_0x54f529[_0x562df8];return _0x47dd91;}class AbortPrompt extends Error{constructor(){const _0x1438e5=a10_0x47dd;super(_0x1438e5(0x1bb)),this['name']=_0x1438e5(0x1c5);}}function createSafeRl(){const _0x4773df=a10_0x47dd,_0x3b5c43=createInterface({'input':process[_0x4773df(0x1b8)],'output':process[_0x4773df(0x1c2)]});let _0x1f7638;const _0x4e9bca=new Promise((_0x5609d7,_0x19cfdb)=>{const _0x3e53c3=_0x4773df;_0x1f7638=()=>{const _0x4cd302=a10_0x47dd;_0x1f7638&&(_0x3b5c43[_0x4cd302(0x1b9)]('SIGINT',_0x1f7638),_0x1f7638=undefined);try{_0x3b5c43[_0x4cd302(0x1bd)]();}catch{}_0x19cfdb(new AbortPrompt());},_0x3b5c43['once'](_0x3e53c3(0x1bf),_0x1f7638);}),_0x515d1e=()=>{const _0x4bc748=_0x4773df;_0x1f7638&&(_0x3b5c43[_0x4bc748(0x1b9)](_0x4bc748(0x1bf),_0x1f7638),_0x1f7638=undefined);try{_0x3b5c43[_0x4bc748(0x1bd)]();}catch{}};return{'rl':_0x3b5c43,'abortPromise':_0x4e9bca,'disposeSuccess':_0x515d1e};}export async function promptAccessKey(_0x78574=''){const _0x5b219d=a10_0x47dd,{rl:_0x505381,abortPromise:_0xf48a11,disposeSuccess:_0x55d262}=createSafeRl(),_0x29e430=new Promise(_0x5d4be5=>{const _0xc6363c=a10_0x47dd,_0x5ddbe5=_0x78574?_0xc6363c(0x1c1)+_0x78574+_0xc6363c(0x1b6):_0xc6363c(0x1c8);_0x505381['question'](_0x5ddbe5,_0x1a7901=>{const _0x14272b=_0xc6363c;_0x55d262(),_0x5d4be5(_0x1a7901[_0x14272b(0x1ba)]()||_0x78574);});});return Promise[_0x5b219d(0x1b7)]([_0x29e430,_0xf48a11]);}export function isAbortPrompt(_0x481481){const _0x44435=a10_0x47dd;return _0x481481 instanceof Error&&_0x481481['name']===_0x44435(0x1c5);}function a10_0x54f5(){const _0x15f3f6=['1797630ihGfhC','AccessKey\x20(paste\x20ak_...):\x20','30dkdxLa','80kFDUuG','2162uucgUF','293855bEWdHy','):\x20','race','stdin','removeListener','trim','User\x20aborted\x20prompt','1xGiYNy','close','995268whaIeB','SIGINT','1675620ZeMHsl','AccessKey\x20(','stdout','55958chuqEq','77tkevZZ','AbortPrompt','616344wRpBvU'];a10_0x54f5=function(){return _0x15f3f6;};return a10_0x54f5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0x4109ae=a11_0x5b77;function a11_0x5b77(_0x27672f,_0xfe22bf){_0x27672f=_0x27672f-0x125;const _0x557613=a11_0x5576();let _0x5b772f=_0x557613[_0x27672f];return _0x5b772f;}(function(_0x33dc40,_0x2f5441){const _0x26c7e2=a11_0x5b77,_0x406dd1=_0x33dc40();while(!![]){try{const _0x58d09b=-parseInt(_0x26c7e2(0x129))/0x1+-parseInt(_0x26c7e2(0x12a))/0x2*(parseInt(_0x26c7e2(0x139))/0x3)+-parseInt(_0x26c7e2(0x12b))/0x4*(parseInt(_0x26c7e2(0x133))/0x5)+parseInt(_0x26c7e2(0x134))/0x6+parseInt(_0x26c7e2(0x136))/0x7*(parseInt(_0x26c7e2(0x138))/0x8)+parseInt(_0x26c7e2(0x130))/0x9*(parseInt(_0x26c7e2(0x137))/0xa)+parseInt(_0x26c7e2(0x131))/0xb*(parseInt(_0x26c7e2(0x127))/0xc);if(_0x58d09b===_0x2f5441)break;else _0x406dd1['push'](_0x406dd1['shift']());}catch(_0x441188){_0x406dd1['push'](_0x406dd1['shift']());}}}(a11_0x5576,0x7bc27));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a11_0x4109ae(0x132),'command':'detail','description':a11_0x4109ae(0x135),'risk':a11_0x4109ae(0x12d),'flags':[{...ID_FLAG,'description':a11_0x4109ae(0x125)},VERBOSE_FLAG],async 'execute'(_0x191890){const _0xe47d92=a11_0x4109ae,_0x4b898d=await getBffScriptInfo(_0x191890['num']('id')),_0x51ff6e=_0x191890['bool'](_0xe47d92(0x128));if(_0x51ff6e)return{'ok':!![],'data':_0x4b898d};return{'ok':!![],'data':{'id':_0x4b898d['id'],'appCode':_0x4b898d[_0xe47d92(0x126)],'functionName':_0x4b898d[_0xe47d92(0x12e)]??'','scriptType':_0x4b898d['scriptType'],'description':_0x4b898d[_0xe47d92(0x12c)]||'(none)','createdTime':_0x4b898d[_0xe47d92(0x12f)]??'','updatedTime':_0x4b898d['updatedTime']??''}};}};function a11_0x5576(){const _0x518010=['appCode','48ZeedWU','verbose','789382TKOQXi','1723636oWPznv','4XdlPvi','description','read','functionName','createdTime','1479015PGySDB','4488187TnOETq','bff','3819315zFMtcE','610344mmsUmL','Get\x20BFF\x20script\x20details\x20by\x20ID','17696SnWEZV','20HCECUc','2720ZYcFbl','3snQpeC','Script\x20ID'];a11_0x5576=function(){return _0x518010;};return a11_0x5576();}
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a12_0x590f34=a12_0x510e;(function(_0x3e583f,_0x4bda02){const _0x203e37=a12_0x510e,_0x4a377c=_0x3e583f();while(!![]){try{const _0x3e32e2=-parseInt(_0x203e37(0x1f8))/0x1+-parseInt(_0x203e37(0x1f7))/0x2+-parseInt(_0x203e37(0x1f6))/0x3+parseInt(_0x203e37(0x1f5))/0x4+parseInt(_0x203e37(0x1f1))/0x5*(parseInt(_0x203e37(0x1f4))/0x6)+parseInt(_0x203e37(0x1f0))/0x7*(parseInt(_0x203e37(0x1f9))/0x8)+parseInt(_0x203e37(0x1f3))/0x9*(parseInt(_0x203e37(0x1eb))/0xa);if(_0x3e32e2===_0x4bda02)break;else _0x4a377c['push'](_0x4a377c['shift']());}catch(_0x3475fd){_0x4a377c['push'](_0x4a377c['shift']());}}}(a12_0x3aff,0xb15a0));function a12_0x510e(_0x1b94a2,_0x271bdb){_0x1b94a2=_0x1b94a2-0x1ea;const _0x3affed=a12_0x3aff();let _0x510e52=_0x3affed[_0x1b94a2];return _0x510e52;}import{executeSdkBff}from'../../core/sdk-client.js';function a12_0x3aff(){const _0x2c6955=['bff','BFF\x20function\x20name\x20to\x20execute','read','760EMhWhs','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','BFF\x20executed\x20in\x20','name','str','3530716mLkwOm','5KnOkgG','exec','22347qckQUr','1295778LAAqTm','3993648ZDcYHn','2987229UDSzaN','273148NNxJll','48722alQofI','8dWZtWE'];a12_0x3aff=function(){return _0x2c6955;};return a12_0x3aff();}import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a12_0x590f34(0x1fa),'command':a12_0x590f34(0x1f2),'description':a12_0x590f34(0x1ec),'risk':a12_0x590f34(0x1ea),'flags':[{...NAME_FLAG,'required':!![],'description':a12_0x590f34(0x1fb)},PARAMS_FLAG],async 'execute'(_0x169f49){const _0x4a6af8=a12_0x590f34,_0x11e8ad=parseJsonParams(_0x169f49[_0x4a6af8(0x1ef)]('params')),_0x45d93c=Date['now'](),_0x4f9a99=await executeSdkBff(_0x169f49[_0x4a6af8(0x1ef)](_0x4a6af8(0x1ee)),_0x11e8ad),_0x274d02=Date['now']()-_0x45d93c;return{'ok':!![],'data':{'result':_0x4f9a99,'elapsed':_0x274d02},'message':_0x4a6af8(0x1ed)+_0x274d02+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x439f61,_0x4f586f){const _0x49e5e3=a13_0x587a,_0xcc9c1d=_0x439f61();while(!![]){try{const _0x31d71a=parseInt(_0x49e5e3(0xb3))/0x1*(-parseInt(_0x49e5e3(0xa9))/0x2)+parseInt(_0x49e5e3(0xb0))/0x3+-parseInt(_0x49e5e3(0xad))/0x4*(-parseInt(_0x49e5e3(0xb2))/0x5)+parseInt(_0x49e5e3(0xac))/0x6+parseInt(_0x49e5e3(0xaa))/0x7+parseInt(_0x49e5e3(0xae))/0x8*(parseInt(_0x49e5e3(0xb1))/0x9)+parseInt(_0x49e5e3(0xab))/0xa*(-parseInt(_0x49e5e3(0xaf))/0xb);if(_0x31d71a===_0x4f586f)break;else _0xcc9c1d['push'](_0xcc9c1d['shift']());}catch(_0x86ca89){_0xcc9c1d['push'](_0xcc9c1d['shift']());}}}(a13_0x5c48,0x3f212));function a13_0x587a(_0x20145e,_0x323382){_0x20145e=_0x20145e-0xa9;const _0x5c48f6=a13_0x5c48();let _0x587a28=_0x5c48f6[_0x20145e];return _0x587a28;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];function a13_0x5c48(){const _0xbda9af=['1079298tdKkMO','1912WcRxrm','72uQQlmY','99gHpTqJ','409623bpfVKe','49122Davjve','2355QWkExD','41UcLTdm','7806UcKIGO','1914108oTXsJt','495030UCMSao'];a13_0x5c48=function(){return _0xbda9af;};return a13_0x5c48();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x4731af=a14_0x5d98;(function(_0xea7fbe,_0x3de39f){const _0x5371ea=a14_0x5d98,_0x3b4b26=_0xea7fbe();while(!![]){try{const _0x499d75=parseInt(_0x5371ea(0x8f))/0x1+-parseInt(_0x5371ea(0xa7))/0x2*(parseInt(_0x5371ea(0x9d))/0x3)+-parseInt(_0x5371ea(0x95))/0x4+parseInt(_0x5371ea(0x9f))/0x5*(-parseInt(_0x5371ea(0xa1))/0x6)+parseInt(_0x5371ea(0x92))/0x7*(parseInt(_0x5371ea(0x90))/0x8)+parseInt(_0x5371ea(0xa2))/0x9*(-parseInt(_0x5371ea(0x9e))/0xa)+-parseInt(_0x5371ea(0x91))/0xb*(-parseInt(_0x5371ea(0x9c))/0xc);if(_0x499d75===_0x3de39f)break;else _0x3b4b26['push'](_0x3b4b26['shift']());}catch(_0x15143a){_0x3b4b26['push'](_0x3b4b26['shift']());}}}(a14_0x87b7,0x1cfb8));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';function a14_0x5d98(_0x305933,_0x92b5bb){_0x305933=_0x305933-0x8d;const _0x87b7b3=a14_0x87b7();let _0x5d98f3=_0x87b7b3[_0x305933];return _0x5d98f3;}export const cliSkillDefinitions=[{'service':a14_0x4731af(0x99),'command':a14_0x4731af(0x8d),'description':a14_0x4731af(0xa4),'risk':a14_0x4731af(0xa0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x130752){const _0x2f2a23=a14_0x4731af;logger[_0x2f2a23(0x97)](process[_0x2f2a23(0x8e)]()),logger['info']('cli-skill-install',_0x2f2a23(0x94));const {LOVRABET_SKILL_SOURCE:_0x700cf4,LOVRABET_SKIP_NPX_SKILLS_ENV:_0x301868,runNpxSkillsAddGlobal:_0x5a80ee}=await import(_0x2f2a23(0x9b)),_0x49344f=_0x130752[_0x2f2a23(0xa5)]?_0x2f2a23(0xa6):'inherit';console[_0x2f2a23(0x96)](_0x2f2a23(0xaa)+_0x700cf4+_0x2f2a23(0x98));const _0x39a8a8=_0x5a80ee(process['cwd'](),_0x700cf4,{'stdio':_0x49344f});if(_0x39a8a8['skipped'])console[_0x2f2a23(0x96)](_0x2f2a23(0xa9)+_0x301868+_0x2f2a23(0x93));else{if(_0x39a8a8['ok'])console['log'](_0x2f2a23(0xa3));else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0x39a8a8['error']||_0x2f2a23(0xa8)),_0x2f2a23(0x9a)+_0x700cf4+'\x20-g\x20-y');}return{'ok':!![]};}}];function a14_0x87b7(){const _0x271162=['setLogPath','\x20-g\x20-y)...','cli-skill','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20npx\x20skills\x20add\x20','../../skills/npx-skills-add.js','144564uimNAJ','9Xwokuo','60220wDTeZT','148145Lybgyi','write','42LrCSHP','324nLCatg','CLI\x20Built-in\x20Skill\x20installed','Install\x20the\x20CLI\x20Built-in\x20Skill\x20required\x20by\x20Lovrabet\x20runtime','nonInteractive','pipe','126842tBmXQt','unknown','Skipped\x20npx\x20(','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(npx\x20skills\x20add\x20','install','cwd','189824qoACBh','25104gwYzkZ','605qedrXa','259zmWzCv','=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','941380IpGLZe','log'];a14_0x87b7=function(){return _0x271162;};return a14_0x87b7();}
|