@lovrabet/lovrabet-cli 2.0.13-beta.7 → 2.0.13-beta.9
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/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/templates.js +1 -0
- package/lib/commands/skill/validate.js +1 -0
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -0
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +8 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a0_0x2516db=a0_0x5010;(function(_0x42ad80,_0x555bf8){const _0x49da8b=a0_0x5010,_0x216662=_0x42ad80();while(!![]){try{const _0x1aa923=-parseInt(_0x49da8b(0x94))/0x1+parseInt(_0x49da8b(0x8f))/0x2*(-parseInt(_0x49da8b(0x8b))/0x3)+-parseInt(_0x49da8b(0x86))/0x4*(-parseInt(_0x49da8b(0x93))/0x5)+-parseInt(_0x49da8b(0x9e))/0x6+parseInt(_0x49da8b(0x99))/0x7*(parseInt(_0x49da8b(0x90))/0x8)+-parseInt(_0x49da8b(0x88))/0x9+parseInt(_0x49da8b(0x9b))/0xa*(parseInt(_0x49da8b(0x95))/0xb);if(_0x1aa923===_0x555bf8)break;else _0x216662['push'](_0x216662['shift']());}catch(_0x2faf72){_0x216662['push'](_0x216662['shift']());}}}(a0_0x13e1,0xdf953));import{jsx as a0_0xe03d01}from'react/jsx-runtime';import a0_0x2f9f21 from'meow';import{render}from'ink';import{Help}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{buildConfigFromFlags,initGlobalEnvironment}from'./context.js';import{isKnownService,getServiceEntry,findDefinition,getAllDefinitions}from'./commands/registry.js';import{runCommand,createPipelineEnv}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{buildMeowFlags}from'./constant/cli.js';import{getCliVersionDisplay}from'./utils/version.js';function a0_0x5010(_0x578140,_0x18569d){_0x578140=_0x578140-0x79;const _0x13e15d=a0_0x13e1();let _0x5010f9=_0x13e15d[_0x578140];return _0x5010f9;}const helpText=generateFullHelp(),cli=a0_0x2f9f21(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()[a0_0x2516db(0x80)](handleError);async function main(){try{await run();}catch(_0x49280a){handleError(_0x49280a);}}async function run(){const _0x10d9be=a0_0x2516db;let _0x53c42d=cli[_0x10d9be(0x98)][0x0],_0x158394=cli[_0x10d9be(0x98)][0x1];const _0x60dff2=cli['flags'];try{const {correctFlags:_0x13e597}=await import(_0x10d9be(0x8d)),_0x188114=getAllDefinitions()[_0x10d9be(0x91)](_0x89cc18=>_0x89cc18['flags']??[]),{flags:_0x486f16,corrections:_0x379c89}=_0x13e597(_0x60dff2,_0x188114);if(_0x379c89[_0x10d9be(0x83)]>0x0){for(const _0x38e151 of _0x379c89){process[_0x10d9be(0x9f)][_0x10d9be(0x8a)](_0x10d9be(0x7c)+_0x38e151[_0x10d9be(0x9a)]+_0x10d9be(0xa1)+_0x38e151[_0x10d9be(0x97)]+_0x10d9be(0x7e)+_0x38e151[_0x10d9be(0x79)]+'\x0a');}Object['assign'](_0x60dff2,_0x486f16);}}catch{}if(!_0x53c42d||!isKnownService(_0x53c42d)){const {waitUntilExit:_0x114a94}=render(a0_0xe03d01(Help,{}));await _0x114a94();return;}const _0x44596a=getServiceEntry(_0x53c42d);if(!_0x158394){if(_0x60dff2[_0x10d9be(0x82)]){console['log'](generateServiceHelp(_0x53c42d));return;}if(_0x44596a[_0x10d9be(0x87)])_0x158394=_0x44596a['defaultCommand'];else{console[_0x10d9be(0x8e)](generateServiceHelp(_0x53c42d));return;}}const _0x18f788=findDefinition(_0x53c42d,_0x158394);!_0x18f788&&(console[_0x10d9be(0x8e)](generateServiceHelp(_0x53c42d)),handleError(CliErrors['unknownCommand'](_0x53c42d+'\x20'+_0x158394)));if(_0x60dff2['help']){console[_0x10d9be(0x8e)](generateCommandHelp(_0x18f788));return;}const _0xa466d0=buildConfigFromFlags(_0x60dff2);await initGlobalEnvironment(_0xa466d0);const _0x1acff4=createPipelineEnv(_0xa466d0,_0x60dff2);_0x1acff4['args']=cli[_0x10d9be(0x98)][_0x10d9be(0x85)](0x2),await runCommand(_0x18f788,_0x1acff4);}function handleError(_0x23eece){const _0x256cf3=a0_0x2516db;if(_0x23eece instanceof CliError){_0x23eece[_0x256cf3(0xa0)]===_0x256cf3(0x81)&&(process[_0x256cf3(0x9f)][_0x256cf3(0x8a)]('\x0aCancelled.\x0a'),process['exit'](0x0));console['error']('Error:\x20'+_0x23eece[_0x256cf3(0x7d)]);if(_0x23eece['hint'])console[_0x256cf3(0x8c)](_0x256cf3(0x9d)+_0x23eece[_0x256cf3(0x96)]);process[_0x256cf3(0x7b)](_0x23eece['exitCode']);}isUserCancellation(_0x23eece)&&(process[_0x256cf3(0x9f)][_0x256cf3(0x8a)](_0x256cf3(0x92)),process[_0x256cf3(0x7b)](0x0)),console[_0x256cf3(0x8c)](_0x256cf3(0x7f),_0x23eece),process['exit'](0x1);}function a0_0x13e1(){const _0x5de179=['hint','original','input','4676akvycL','handler','90qltUcP','name','Hint:\x20','3387396epVDTd','stderr','code',':\x20--','corrected','ExitPromptError','exit','[preparse]\x20','message','\x20->\x20--','Unexpected\x20error:','catch','cancelled','help','length','ERR_USE_AFTER_CLOSE','slice','2123876eHFqNL','defaultCommand','608931qjUAEF','ERR_STREAM_DESTROYED','write','42390hbZKKy','error','./framework/preparse.js','log','218UdwdGV','3152ldornt','flatMap','\x0aCancelled.\x0a','10oNxwTC','364063bTqBZj','2599817ENJFPh'];a0_0x13e1=function(){return _0x5de179;};return a0_0x13e1();}function isUserCancellation(_0x49d35d){const _0x5c4b9a=a0_0x2516db;if(!(_0x49d35d instanceof Error))return![];if(_0x49d35d[_0x5c4b9a(0x9c)]===_0x5c4b9a(0x7a))return!![];if(_0x49d35d[_0x5c4b9a(0xa0)]===_0x5c4b9a(0x84))return!![];if(_0x49d35d[_0x5c4b9a(0xa0)]===_0x5c4b9a(0x89))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a1_0x4d685c=a1_0x2a2d;(function(_0x86befa,_0xfe5329){const _0x4e9a40=a1_0x2a2d,_0x5e17e7=_0x86befa();while(!![]){try{const _0x3a8c63=-parseInt(_0x4e9a40(0x180))/0x1+parseInt(_0x4e9a40(0x16e))/0x2+parseInt(_0x4e9a40(0x19e))/0x3*(parseInt(_0x4e9a40(0x15a))/0x4)+parseInt(_0x4e9a40(0x15c))/0x5+parseInt(_0x4e9a40(0x17e))/0x6+-parseInt(_0x4e9a40(0x18d))/0x7*(parseInt(_0x4e9a40(0x150))/0x8)+parseInt(_0x4e9a40(0x13e))/0x9*(-parseInt(_0x4e9a40(0x1a2))/0xa);if(_0x3a8c63===_0xfe5329)break;else _0x5e17e7['push'](_0x5e17e7['shift']());}catch(_0x26f60c){_0x5e17e7['push'](_0x5e17e7['shift']());}}}(a1_0x5f19,0xf09ae));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x4d685c(0x19b),'type':a1_0x4d685c(0x145),'description':a1_0x4d685c(0x190)},KEYWORD_FLAG={'name':a1_0x4d685c(0x141),'type':a1_0x4d685c(0x145),'description':a1_0x4d685c(0x16a)},DOC_CODE_FLAG={'name':a1_0x4d685c(0x187),'type':a1_0x4d685c(0x145),'required':!![],'description':a1_0x4d685c(0x139)},DOCS=[{'code':'dataset_list','category':a1_0x4d685c(0x191),'title':a1_0x4d685c(0x169),'method':a1_0x4d685c(0x185),'path':'/api/dataset/get-dataset-list-by-app-code','summary':'分页获取数据集列表','whenToUse':a1_0x4d685c(0x153),'pathParams':[],'queryParams':[],'bodySchema':a1_0x4d685c(0x19a),'responseHighlights':[a1_0x4d685c(0x155),a1_0x4d685c(0x1a6)],'examples':[a1_0x4d685c(0x19c)],'notes':[a1_0x4d685c(0x1a5)],'markdown':[a1_0x4d685c(0x165),'',a1_0x4d685c(0x15b)][a1_0x4d685c(0x17d)]('\x0a')},{'code':a1_0x4d685c(0x147),'category':a1_0x4d685c(0x191),'title':a1_0x4d685c(0x14c),'method':a1_0x4d685c(0x199),'path':a1_0x4d685c(0x17f),'summary':'获取数据集详情','whenToUse':a1_0x4d685c(0x192),'pathParams':[],'queryParams':[{'name':a1_0x4d685c(0x187),'description':a1_0x4d685c(0x174)}],'bodySchema':a1_0x4d685c(0x15e),'responseHighlights':[a1_0x4d685c(0x179),'operations\x20describes\x20runtime\x20APIs'],'examples':[a1_0x4d685c(0x140)],'notes':['If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.'],'markdown':['##\x20Dataset\x20detail','','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.'][a1_0x4d685c(0x17d)]('\x0a')},{'code':a1_0x4d685c(0x183),'category':a1_0x4d685c(0x191),'title':a1_0x4d685c(0x17c),'method':'POST','path':'/api/{appCode}/{datasetCode}/filter','summary':'条件过滤查询数据','whenToUse':a1_0x4d685c(0x16f),'pathParams':[{'name':a1_0x4d685c(0x171),'description':a1_0x4d685c(0x16d)},{'name':a1_0x4d685c(0x156),'description':a1_0x4d685c(0x174)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x18a),'responseHighlights':[a1_0x4d685c(0x152),a1_0x4d685c(0x157)],'examples':[a1_0x4d685c(0x1a9)],'notes':['Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.'],'markdown':[a1_0x4d685c(0x18e),'',a1_0x4d685c(0x1a8)][a1_0x4d685c(0x17d)]('\x0a')},{'code':a1_0x4d685c(0x17a),'category':'dataset','title':a1_0x4d685c(0x181),'method':a1_0x4d685c(0x185),'path':a1_0x4d685c(0x151),'summary':'聚合查询数据集数据','whenToUse':a1_0x4d685c(0x18b),'pathParams':[{'name':a1_0x4d685c(0x171),'description':a1_0x4d685c(0x16d)},{'name':a1_0x4d685c(0x156),'description':a1_0x4d685c(0x174)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x15d),'responseHighlights':[a1_0x4d685c(0x176),a1_0x4d685c(0x14b)],'examples':['lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27'],'notes':[a1_0x4d685c(0x16c)],'markdown':[a1_0x4d685c(0x146),'',a1_0x4d685c(0x193)]['join']('\x0a')},{'code':a1_0x4d685c(0x173),'category':'dataset','title':a1_0x4d685c(0x14d),'method':a1_0x4d685c(0x185),'path':a1_0x4d685c(0x175),'summary':a1_0x4d685c(0x18f),'whenToUse':a1_0x4d685c(0x13d),'pathParams':[{'name':a1_0x4d685c(0x171),'description':'Current\x20app\x20code'},{'name':a1_0x4d685c(0x156),'description':a1_0x4d685c(0x174)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x168),'responseHighlights':[a1_0x4d685c(0x178)],'examples':[a1_0x4d685c(0x170)],'notes':[a1_0x4d685c(0x16b)],'markdown':a1_0x4d685c(0x188)},{'code':a1_0x4d685c(0x1a7),'category':a1_0x4d685c(0x191),'title':a1_0x4d685c(0x148),'method':'POST','path':a1_0x4d685c(0x167),'summary':a1_0x4d685c(0x14e),'whenToUse':a1_0x4d685c(0x186),'pathParams':[{'name':a1_0x4d685c(0x171),'description':a1_0x4d685c(0x16d)},{'name':a1_0x4d685c(0x156),'description':a1_0x4d685c(0x174)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x159),'responseHighlights':['Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result'],'examples':[a1_0x4d685c(0x1a4)],'notes':[a1_0x4d685c(0x196)],'markdown':a1_0x4d685c(0x189)},{'code':'bf_function_list','category':'bf','title':'List\x20BF\x20endpoint\x20functions','method':'GET','path':'/api/endpoint/{appCode}/functions','summary':a1_0x4d685c(0x15f),'whenToUse':a1_0x4d685c(0x195),'pathParams':[{'name':a1_0x4d685c(0x171),'description':a1_0x4d685c(0x16d)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x15e),'responseHighlights':[a1_0x4d685c(0x163)],'examples':[a1_0x4d685c(0x142)],'notes':['CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.'],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x4d685c(0x1a1),'category':'bf','title':a1_0x4d685c(0x13b),'method':'POST','path':a1_0x4d685c(0x1a0),'summary':a1_0x4d685c(0x177),'whenToUse':a1_0x4d685c(0x13a),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x4d685c(0x13f),'description':a1_0x4d685c(0x1aa)}],'queryParams':[],'bodySchema':a1_0x4d685c(0x14a),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x4d685c(0x194)],'notes':[a1_0x4d685c(0x162)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':'custom_sql_execute','category':a1_0x4d685c(0x197),'title':a1_0x4d685c(0x198),'method':a1_0x4d685c(0x185),'path':a1_0x4d685c(0x138),'summary':a1_0x4d685c(0x149),'whenToUse':'已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','pathParams':[],'queryParams':[],'bodySchema':a1_0x4d685c(0x13c),'responseHighlights':[a1_0x4d685c(0x1a3)],'examples':[a1_0x4d685c(0x14f)],'notes':[a1_0x4d685c(0x182)],'markdown':'##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.'}];function a1_0x5f19(){const _0x24c7c7=['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','filter','9OGUMTm','method','/api/endpoint/{appCode}/{scriptName}','bf_execute','23821970gyJzEh','Returns\x20SQL\x20execution\x20payload','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','paging.totalCount\x20gives\x20total\x20rows','dataset_data_create','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','Endpoint\x20function\x20name','/api/custom/executeSql','API\x20doc\x20code,\x20for\x20example\x20dataset_list','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','Execute\x20BF\x20endpoint\x20function','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','9ViwVnt','scriptName','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','keyword','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','summary','str','string','##\x20Aggregate\x20dataset\x20data','dataset_detail','Create\x20dataset\x20record','执行自定义\x20SQL','{\x22param\x22:\x22value\x22}','where\x20filters\x20before\x20aggregation','Dataset\x20detail','Get\x20one\x20dataset\x20record','创建数据','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','161608gAcnsI','/api/{appCode}/{datasetCode}/aggregate','tableData\x20contains\x20records','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','trim','tableData\x20contains\x20dataset\x20id/code/name','datasetCode','paging\x20contains\x20pagination','whenToUse','{\x22fieldName\x22:\x22value\x22}','1385844aecqsa','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','4344800wpERpi','{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','None','获取应用下可调用的\x20BF\x20函数列表','toLowerCase','api-doc','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','Returns\x20endpoint\x20functionName/id/description','path','##\x20List\x20datasets','map','/api/{appCode}/{datasetCode}/create','{\x22id\x22:123}','List\x20datasets','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','Current\x20app\x20code','3361186huoUBr','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','appCode','read','dataset_data_get_one','32-character\x20dataset\x20code','/api/{appCode}/{datasetCode}/getOne','result\x20rows\x20contain\x20aggregate\x20aliases','执行指定\x20BF\x20函数','Returns\x20one\x20matching\x20business\x20record','fields/properties\x20describe\x20data\x20shape','dataset_data_aggregate','List\x20available\x20runtime\x20API\x20documentation\x20entries','Filter\x20dataset\x20data','join','11618832PcoXDi','/api/dataset/getOneByCode?code={datasetCode}','218397fHoezN','Aggregate\x20dataset\x20data','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','dataset_data_filter','Show\x20runtime\x20API\x20documentation\x20by\x20code','POST','需要向指定数据集新增一条业务数据时使用','code','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','includes','672MmrzvU','##\x20Filter\x20dataset\x20data','查询单条数据','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','dataset','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','custom_sql','Execute\x20custom\x20SQL','GET','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','category'];a1_0x5f19=function(){return _0x24c7c7;};return a1_0x5f19();}function entrySummary(_0xa70c26){const _0x1bdf98=a1_0x4d685c;return{'code':_0xa70c26[_0x1bdf98(0x187)],'category':_0xa70c26[_0x1bdf98(0x19b)],'method':_0xa70c26[_0x1bdf98(0x19f)],'path':_0xa70c26['path'],'summary':_0xa70c26[_0x1bdf98(0x143)],'whenToUse':_0xa70c26[_0x1bdf98(0x158)]};}function a1_0x2a2d(_0x2bbf51,_0x35a7d6){_0x2bbf51=_0x2bbf51-0x138;const _0x5f1994=a1_0x5f19();let _0x2a2df5=_0x5f1994[_0x2bbf51];return _0x2a2df5;}export function listApiDocEntries(_0x2efda0={}){const _0x35f75f=a1_0x4d685c,_0x44bf51=String(_0x2efda0[_0x35f75f(0x19b)]||'')['trim'](),_0x334bda=String(_0x2efda0[_0x35f75f(0x141)]||'')[_0x35f75f(0x154)]()[_0x35f75f(0x160)]();return DOCS[_0x35f75f(0x19d)](_0x3f5624=>{const _0x56a62f=_0x35f75f;if(_0x44bf51&&_0x3f5624[_0x56a62f(0x19b)]!==_0x44bf51)return![];if(!_0x334bda)return!![];return[_0x3f5624[_0x56a62f(0x187)],_0x3f5624[_0x56a62f(0x19b)],_0x3f5624[_0x56a62f(0x19f)],_0x3f5624[_0x56a62f(0x164)],_0x3f5624[_0x56a62f(0x143)],_0x3f5624[_0x56a62f(0x158)],_0x3f5624['title']][_0x56a62f(0x17d)]('\x20')['toLowerCase']()[_0x56a62f(0x18c)](_0x334bda);})[_0x35f75f(0x166)](entrySummary);}export function getApiDocDetail(_0x14397b){const _0x3d06f7=a1_0x4d685c,_0x4adabd=DOCS['find'](_0x13df1e=>_0x13df1e[_0x3d06f7(0x187)]===_0x14397b);if(!_0x4adabd)throw CliErrors['validation']('API\x20doc\x20code\x20not\x20found:\x20'+_0x14397b);return{..._0x4adabd};}const apiDocList={'service':a1_0x4d685c(0x161),'command':'list','description':a1_0x4d685c(0x17b),'risk':a1_0x4d685c(0x172),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x30a586){const _0x46f52c=a1_0x4d685c,_0x59af27=listApiDocEntries({'category':_0x30a586[_0x46f52c(0x144)](_0x46f52c(0x19b)),'keyword':_0x30a586['str'](_0x46f52c(0x141))});return{'ok':!![],'data':{'total':_0x59af27['length'],'items':_0x59af27}};}},apiDocDetail={'service':a1_0x4d685c(0x161),'command':'detail','description':a1_0x4d685c(0x184),'risk':a1_0x4d685c(0x172),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x3d7a7f){const _0x2a2788=a1_0x4d685c;return{'ok':!![],'data':getApiDocDetail(_0x3d7a7f['str'](_0x2a2788(0x187)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
1
|
+
const a1_0x20241c=a1_0x2858;function a1_0x2858(_0x411974,_0x23983){_0x411974=_0x411974-0x16c;const _0x76eca7=a1_0x76ec();let _0x285847=_0x76eca7[_0x411974];return _0x285847;}(function(_0x39c1b9,_0x2ab292){const _0x653d0a=a1_0x2858,_0x1ad033=_0x39c1b9();while(!![]){try{const _0x405a2f=parseInt(_0x653d0a(0x198))/0x1+parseInt(_0x653d0a(0x18d))/0x2+-parseInt(_0x653d0a(0x1ac))/0x3+-parseInt(_0x653d0a(0x173))/0x4*(parseInt(_0x653d0a(0x1d4))/0x5)+parseInt(_0x653d0a(0x175))/0x6+parseInt(_0x653d0a(0x193))/0x7+-parseInt(_0x653d0a(0x180))/0x8*(-parseInt(_0x653d0a(0x184))/0x9);if(_0x405a2f===_0x2ab292)break;else _0x1ad033['push'](_0x1ad033['shift']());}catch(_0x21b36d){_0x1ad033['push'](_0x1ad033['shift']());}}}(a1_0x76ec,0x3b115));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x20241c(0x1c3),'type':a1_0x20241c(0x1c8),'description':a1_0x20241c(0x1a9)},KEYWORD_FLAG={'name':a1_0x20241c(0x1b4),'type':a1_0x20241c(0x1c8),'description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':a1_0x20241c(0x1b3),'type':a1_0x20241c(0x1c8),'required':!![],'description':a1_0x20241c(0x192)},DOCS=[{'code':a1_0x20241c(0x179),'category':a1_0x20241c(0x172),'title':a1_0x20241c(0x1a0),'method':a1_0x20241c(0x1d5),'path':a1_0x20241c(0x18b),'summary':a1_0x20241c(0x1d9),'whenToUse':a1_0x20241c(0x181),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','responseHighlights':[a1_0x20241c(0x1ca),a1_0x20241c(0x1cc)],'examples':[a1_0x20241c(0x1ad)],'notes':[a1_0x20241c(0x1d2)],'markdown':[a1_0x20241c(0x194),'',a1_0x20241c(0x1a1)][a1_0x20241c(0x177)]('\x0a')},{'code':a1_0x20241c(0x17b),'category':a1_0x20241c(0x172),'title':a1_0x20241c(0x1dc),'method':a1_0x20241c(0x16f),'path':'/api/dataset/getOneByCode?code={datasetCode}','summary':a1_0x20241c(0x1b7),'whenToUse':a1_0x20241c(0x17e),'pathParams':[],'queryParams':[{'name':a1_0x20241c(0x1b3),'description':a1_0x20241c(0x19d)}],'bodySchema':a1_0x20241c(0x187),'responseHighlights':[a1_0x20241c(0x186),a1_0x20241c(0x16e)],'examples':[a1_0x20241c(0x1b0)],'notes':[a1_0x20241c(0x1af)],'markdown':[a1_0x20241c(0x1bb),'',a1_0x20241c(0x1be)][a1_0x20241c(0x177)]('\x0a')},{'code':a1_0x20241c(0x18f),'category':a1_0x20241c(0x172),'title':a1_0x20241c(0x176),'method':a1_0x20241c(0x1d5),'path':a1_0x20241c(0x1c0),'summary':'条件过滤查询数据','whenToUse':a1_0x20241c(0x19f),'pathParams':[{'name':a1_0x20241c(0x183),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x20241c(0x1a4),'responseHighlights':[a1_0x20241c(0x191),a1_0x20241c(0x178)],'examples':[a1_0x20241c(0x1cf)],'notes':[a1_0x20241c(0x1c7)],'markdown':[a1_0x20241c(0x1ce),'','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.']['join']('\x0a')},{'code':a1_0x20241c(0x16c),'category':a1_0x20241c(0x172),'title':'Aggregate\x20dataset\x20data','method':'POST','path':a1_0x20241c(0x1a3),'summary':a1_0x20241c(0x1d8),'whenToUse':'需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','pathParams':[{'name':a1_0x20241c(0x183),'description':a1_0x20241c(0x1db)},{'name':a1_0x20241c(0x19a),'description':a1_0x20241c(0x19d)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x20241c(0x1bf),a1_0x20241c(0x1d1)],'examples':[a1_0x20241c(0x1cb)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.'],'markdown':[a1_0x20241c(0x1c6),'','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.']['join']('\x0a')},{'code':a1_0x20241c(0x18c),'category':a1_0x20241c(0x172),'title':a1_0x20241c(0x188),'method':'POST','path':a1_0x20241c(0x170),'summary':a1_0x20241c(0x17d),'whenToUse':a1_0x20241c(0x1bd),'pathParams':[{'name':'appCode','description':a1_0x20241c(0x1db)},{'name':a1_0x20241c(0x19a),'description':a1_0x20241c(0x19d)}],'queryParams':[],'bodySchema':a1_0x20241c(0x1ba),'responseHighlights':[a1_0x20241c(0x1de)],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x20241c(0x19c)],'markdown':a1_0x20241c(0x1d3)},{'code':'dataset_data_create','category':a1_0x20241c(0x172),'title':a1_0x20241c(0x19e),'method':a1_0x20241c(0x1d5),'path':a1_0x20241c(0x199),'summary':a1_0x20241c(0x1b9),'whenToUse':'需要向指定数据集新增一条业务数据时使用','pathParams':[{'name':a1_0x20241c(0x183),'description':a1_0x20241c(0x1db)},{'name':a1_0x20241c(0x19a),'description':a1_0x20241c(0x19d)}],'queryParams':[],'bodySchema':a1_0x20241c(0x189),'responseHighlights':[a1_0x20241c(0x1c4)],'examples':['lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27'],'notes':[a1_0x20241c(0x1ab)],'markdown':'##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.'},{'code':'bf_function_list','category':'bf','title':a1_0x20241c(0x1b8),'method':'GET','path':a1_0x20241c(0x1bc),'summary':a1_0x20241c(0x1c2),'whenToUse':a1_0x20241c(0x174),'pathParams':[{'name':a1_0x20241c(0x183),'description':a1_0x20241c(0x1db)}],'queryParams':[],'bodySchema':'None','responseHighlights':[a1_0x20241c(0x195)],'examples':[a1_0x20241c(0x1d7)],'notes':[a1_0x20241c(0x1dd)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':'bf_execute','category':'bf','title':a1_0x20241c(0x182),'method':a1_0x20241c(0x1d5),'path':'/api/endpoint/{appCode}/{scriptName}','summary':a1_0x20241c(0x1b1),'whenToUse':a1_0x20241c(0x1da),'pathParams':[{'name':a1_0x20241c(0x183),'description':a1_0x20241c(0x1db)},{'name':a1_0x20241c(0x1c5),'description':a1_0x20241c(0x19b)}],'queryParams':[],'bodySchema':a1_0x20241c(0x18e),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':[a1_0x20241c(0x171)],'notes':['Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.'],'markdown':a1_0x20241c(0x185)},{'code':a1_0x20241c(0x1b6),'category':'custom_sql','title':a1_0x20241c(0x16d),'method':a1_0x20241c(0x1d5),'path':a1_0x20241c(0x1d0),'summary':a1_0x20241c(0x1cd),'whenToUse':a1_0x20241c(0x197),'pathParams':[],'queryParams':[],'bodySchema':'{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':['lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27'],'notes':[a1_0x20241c(0x1b5)],'markdown':a1_0x20241c(0x1a2)}];function a1_0x76ec(){const _0x11413f=['368VyOEGU','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','Execute\x20BF\x20endpoint\x20function','appCode','1908gBtMzO','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','fields/properties\x20describe\x20data\x20shape','None','Get\x20one\x20dataset\x20record','{\x22fieldName\x22:\x22value\x22}','read','/api/dataset/get-dataset-list-by-app-code','dataset_data_get_one','531286QrnQgJ','{\x22param\x22:\x22value\x22}','dataset_data_filter','map','tableData\x20contains\x20records','API\x20doc\x20code,\x20for\x20example\x20dataset_list','217903riebzo','##\x20List\x20datasets','Returns\x20endpoint\x20functionName/id/description','filter','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','334500UxrRnC','/api/{appCode}/{datasetCode}/create','datasetCode','Endpoint\x20function\x20name','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','32-character\x20dataset\x20code','Create\x20dataset\x20record','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','List\x20datasets','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','/api/{appCode}/{datasetCode}/aggregate','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','detail','toLowerCase','title','trim','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','path','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','664482uBHrcL','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','str','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','执行指定\x20BF\x20函数','includes','code','keyword','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','custom_sql_execute','获取数据集详情','List\x20BF\x20endpoint\x20functions','创建数据','{\x22id\x22:123}','##\x20Dataset\x20detail','/api/endpoint/{appCode}/functions','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','result\x20rows\x20contain\x20aggregate\x20aliases','/api/{appCode}/{datasetCode}/filter','list','获取应用下可调用的\x20BF\x20函数列表','category','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','scriptName','##\x20Aggregate\x20dataset\x20data','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','string','method','tableData\x20contains\x20dataset\x20id/code/name','lovrabet\x20data\x20aggregate\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}]}\x27','paging.totalCount\x20gives\x20total\x20rows','执行自定义\x20SQL','##\x20Filter\x20dataset\x20data','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','/api/custom/executeSql','where\x20filters\x20before\x20aggregation','CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','5aXEqKi','POST','find','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','聚合查询数据集数据','分页获取数据集列表','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','Current\x20app\x20code','Dataset\x20detail','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','Returns\x20one\x20matching\x20business\x20record','dataset_data_aggregate','Execute\x20custom\x20SQL','operations\x20describes\x20runtime\x20APIs','GET','/api/{appCode}/{datasetCode}/getOne','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','dataset','1804012VUSWRC','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','1640484PUeUMD','Filter\x20dataset\x20data','join','paging\x20contains\x20pagination','dataset_list','API\x20doc\x20code\x20not\x20found:\x20','dataset_detail','api-doc','查询单条数据','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','whenToUse'];a1_0x76ec=function(){return _0x11413f;};return a1_0x76ec();}function entrySummary(_0x37b34d){const _0x296c3d=a1_0x20241c;return{'code':_0x37b34d[_0x296c3d(0x1b3)],'category':_0x37b34d['category'],'method':_0x37b34d[_0x296c3d(0x1c9)],'path':_0x37b34d[_0x296c3d(0x1aa)],'summary':_0x37b34d['summary'],'whenToUse':_0x37b34d[_0x296c3d(0x17f)]};}export function listApiDocEntries(_0x344ca8={}){const _0x2cbc3b=a1_0x20241c,_0x403299=String(_0x344ca8['category']||'')[_0x2cbc3b(0x1a8)](),_0x8ea0ba=String(_0x344ca8['keyword']||'')['trim']()[_0x2cbc3b(0x1a6)]();return DOCS[_0x2cbc3b(0x196)](_0x25e08a=>{const _0x4cf700=_0x2cbc3b;if(_0x403299&&_0x25e08a[_0x4cf700(0x1c3)]!==_0x403299)return![];if(!_0x8ea0ba)return!![];return[_0x25e08a[_0x4cf700(0x1b3)],_0x25e08a[_0x4cf700(0x1c3)],_0x25e08a['method'],_0x25e08a[_0x4cf700(0x1aa)],_0x25e08a['summary'],_0x25e08a[_0x4cf700(0x17f)],_0x25e08a[_0x4cf700(0x1a7)]][_0x4cf700(0x177)]('\x20')['toLowerCase']()[_0x4cf700(0x1b2)](_0x8ea0ba);})[_0x2cbc3b(0x190)](entrySummary);}export function getApiDocDetail(_0x2d30cd){const _0x30c600=a1_0x20241c,_0x461c72=DOCS[_0x30c600(0x1d6)](_0x2fa7aa=>_0x2fa7aa[_0x30c600(0x1b3)]===_0x2d30cd);if(!_0x461c72)throw CliErrors['validation'](_0x30c600(0x17a)+_0x2d30cd);return{..._0x461c72};}const apiDocList={'service':'api-doc','command':a1_0x20241c(0x1c1),'description':'List\x20available\x20runtime\x20API\x20documentation\x20entries','risk':'read','requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x1426ca){const _0x257a29=a1_0x20241c,_0x5c9b33=listApiDocEntries({'category':_0x1426ca[_0x257a29(0x1ae)](_0x257a29(0x1c3)),'keyword':_0x1426ca['str'](_0x257a29(0x1b4))});return{'ok':!![],'data':{'total':_0x5c9b33['length'],'items':_0x5c9b33}};}},apiDocDetail={'service':a1_0x20241c(0x17c),'command':a1_0x20241c(0x1a5),'description':'Show\x20runtime\x20API\x20documentation\x20by\x20code','risk':a1_0x20241c(0x18a),'requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0xd32a6c){const _0x1308e8=a1_0x20241c;return{'ok':!![],'data':getApiDocDetail(_0xd32a6c[_0x1308e8(0x1ae)](_0x1308e8(0x1b3)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbf0a23,_0x54527e){const _0x211f35=a2_0x3715,_0x3685df=_0xbf0a23();while(!![]){try{const _0x4d7025=-parseInt(_0x211f35(0x15f))/0x1+parseInt(_0x211f35(0x159))/0x2+parseInt(_0x211f35(0x151))/0x3+-parseInt(_0x211f35(0x15d))/0x4*(parseInt(_0x211f35(0x15a))/0x5)+parseInt(_0x211f35(0x161))/0x6+-parseInt(_0x211f35(0x156))/0x7*(-parseInt(_0x211f35(0x14f))/0x8)+-parseInt(_0x211f35(0x15b))/0x9;if(_0x4d7025===_0x54527e)break;else _0x3685df['push'](_0x3685df['shift']());}catch(_0x14277f){_0x3685df['push'](_0x3685df['shift']());}}}(a2_0x535c,0x366d1));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';function a2_0x3715(_0x3bde22,_0x1e703a){_0x3bde22=_0x3bde22-0x14b;const _0x535cda=a2_0x535c();let _0x3715a8=_0x535cda[_0x3bde22];return _0x3715a8;}import{dirname,resolve}from'node:path';import{PRODUCT_CONFIG}from'../../constant/product.js';export function fingerprintAccessKey(_0x169f6e){const _0x767d5c=a2_0x3715,_0x2e5ee6=_0x169f6e['trim'](),_0xd3d9aa=_0x2e5ee6[_0x767d5c(0x14c)](-0x6)||_0x767d5c(0x158),_0x2cdc44=createHash('sha256')[_0x767d5c(0x166)](_0x2e5ee6)[_0x767d5c(0x164)](_0x767d5c(0x153))[_0x767d5c(0x14c)](0x0,0xc);return _0x767d5c(0x154)+_0xd3d9aa+'_'+_0x2cdc44;}export function getAppCacheFilePath(_0x2c0e23,_0x17b559){const _0x575959=a2_0x3715;return resolve(homedir(),PRODUCT_CONFIG['homeDirName'],_0x575959(0x162),_0x2c0e23,fingerprintAccessKey(_0x17b559),'my-apps.json');}export function readCachedAppList(_0x2cf11d,_0x19bac7){const _0x4d9288=a2_0x3715;if(!_0x19bac7?.[_0x4d9288(0x165)]())return null;const _0x247280=getAppCacheFilePath(_0x2cf11d,_0x19bac7);if(!existsSync(_0x247280))return null;try{const _0x20d2a5=readFileSync(_0x247280,_0x4d9288(0x15e));if(!_0x20d2a5['trim']())return null;const _0x428e7f=JSON[_0x4d9288(0x160)](_0x20d2a5);if(!Array['isArray'](_0x428e7f[_0x4d9288(0x150)]))return null;return _0x428e7f;}catch{return null;}}export function writeCachedAppList(_0x73ffd2,_0x142937,_0x3e6b7c){const _0x1d9dc0=a2_0x3715,_0x2c6482=getAppCacheFilePath(_0x73ffd2,_0x142937),_0x26a81e=dirname(_0x2c6482);!existsSync(_0x26a81e)&&mkdirSync(_0x26a81e,{'recursive':!![]});const _0x241bed=_0x2c6482+_0x1d9dc0(0x14e);try{writeFileSync(_0x241bed,JSON[_0x1d9dc0(0x14d)](_0x3e6b7c,null,0x2)+'\x0a',{'encoding':_0x1d9dc0(0x15e),'mode':0x180});try{renameSync(_0x241bed,_0x2c6482);}catch(_0x36a6ed){if(_0x36a6ed[_0x1d9dc0(0x14b)]===_0x1d9dc0(0x163)||_0x36a6ed[_0x1d9dc0(0x14b)]===_0x1d9dc0(0x15c)||_0x36a6ed['code']===_0x1d9dc0(0x155)){writeFileSync(_0x2c6482,JSON[_0x1d9dc0(0x14d)](_0x3e6b7c,null,0x2)+'\x0a',{'encoding':_0x1d9dc0(0x15e)});try{unlinkSync(_0x241bed);}catch{}}else throw _0x36a6ed;}}catch(_0x3f7fa5){try{unlinkSync(_0x241bed);}catch{}throw _0x3f7fa5;}return _0x2c6482;}export function resolveCachedAppCode(_0x14fdaf,_0x451179,_0x215b79){const _0xc9b5e5=a2_0x3715;if(!_0x14fdaf)return undefined;const _0x318ddc=readCachedAppList(_0x451179,_0x215b79),_0x2ecf29=_0x318ddc?.[_0xc9b5e5(0x150)][_0xc9b5e5(0x152)](_0x10bc85=>_0x10bc85['appName']===_0x14fdaf);return _0x2ecf29?.[_0xc9b5e5(0x157)]?.['trim']()||undefined;}function a2_0x535c(){const _0x212664=['558300uDOHcF','686045GrPOLF','2040093MTSxtK','EXDEV','4YlMbEE','utf8','164499ermhhX','parse','109692DWMAlR','cache','EPERM','digest','trim','update','code','slice','stringify','.tmp','653096BJYKbq','items','382002UsTdcM','find','hex','ak_','EACCES','28qFTlPy','appCode','unknown'];a2_0x535c=function(){return _0x212664;};return a2_0x535c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a3_0x5eb44c=a3_0x399d;(function(_0x89a365,_0xf0c9e4){const _0x5c53d0=a3_0x399d,_0x489a35=_0x89a365();while(!![]){try{const _0xf3b84a=-parseInt(_0x5c53d0(0x1de))/0x1*(parseInt(_0x5c53d0(0x1f7))/0x2)+parseInt(_0x5c53d0(0x20d))/0x3+parseInt(_0x5c53d0(0x209))/0x4+-parseInt(_0x5c53d0(0x212))/0x5+-parseInt(_0x5c53d0(0x200))/0x6*(-parseInt(_0x5c53d0(0x1f0))/0x7)+-parseInt(_0x5c53d0(0x219))/0x8*(-parseInt(_0x5c53d0(0x207))/0x9)+-parseInt(_0x5c53d0(0x1d5))/0xa;if(_0xf3b84a===_0xf0c9e4)break;else _0x489a35['push'](_0x489a35['shift']());}catch(_0x381d0e){_0x489a35['push'](_0x489a35['shift']());}}}(a3_0x40f3,0xb7105));import{CliErrors}from'../../errors.js';function a3_0x40f3(){const _0x2ad290=['12874920LpmCyE','Read\x20from\x20local\x20cache\x20only','Remote\x20app\x20name\x20to\x20activate','cachePath','raw','push','appPublishStatus','App\x20\x22','Default\x20app\x20candidate\x20set\x20to\x20\x22','1028055yWHJTE','Use\x20`','no-cache','string','projectPath','join','newConfigFileName','Use\x20global\x20config\x20scope','appName','local','read','source','pull','Usage:\x20','trim','Loaded\x20','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','isArray','7kvgaQT','.appcode\x20to\x20.lovrabet.json.','envName','length','name','Missing\x20app\x20name.','validation','2RBZJPE','bool','globalPath','defaultApp','find','appOwnerName','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','import','6924654PCEuLJ','app','entries','../../context.js','\x20app\x20use\x20<name>\x20[--global]','appCode','production','240399QgEUDr','isCurrent','3787456vcuTZm','No\x20cached\x20apps\x20found.','mergedCli','Initialize\x20','3178398LLlkyR','env','\x20cached\x20app(s)\x20for\x20env=\x22','map','enableI18n','1410200RePfmh','Set\x20the\x20fallback\x20app\x20candidate','fetchedAt','items','boolean','global','Read\x20app\x20list\x20from\x20local\x20cache\x20only','56haKLKl','accessKey','cache','i18nInfo','\x20config\x20file','\x20app(s)\x20for\x20env=\x22','from','write','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','list','nonInteractive','Filter\x20by\x20environment\x20(default:\x20current\x20env)','../../commands/app/cache.js','args','appcode','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','filter','str'];a3_0x40f3=function(){return _0x2ad290;};return a3_0x40f3();}import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':a3_0x5eb44c(0x217),'type':a3_0x5eb44c(0x216),'description':a3_0x5eb44c(0x1e5),'default':![]};function collectFlags(_0x474c80,_0x193a1d){const _0x18cd14=a3_0x5eb44c,_0x237e58={};for(const _0xdfec81 of _0x193a1d){const _0xe45371=_0xdfec81['type']===_0x18cd14(0x216)?_0x474c80['bool'](_0xdfec81['name']):_0x474c80[_0x18cd14(0x1d4)](_0xdfec81[_0x18cd14(0x1f4)]);if(_0xe45371!==''&&_0xe45371!==![])_0x237e58[_0xdfec81[_0x18cd14(0x1f4)]]=_0xe45371;}if(_0x474c80[_0x18cd14(0x1cd)])_0x237e58[_0x18cd14(0x1cd)]=!![];return _0x237e58;}function normalizeLanguages(_0xdbd424){const _0x477e59=a3_0x5eb44c;if(!Array[_0x477e59(0x1ef)](_0xdbd424))return[];return _0xdbd424[_0x477e59(0x1d3)](_0x224a4b=>typeof _0x224a4b===_0x477e59(0x1e1))[_0x477e59(0x210)](_0xb2ed6b=>_0xb2ed6b['trim']())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x41d80a){const _0x3a4b5d=a3_0x5eb44c,_0x399b2f=normalizeLanguages(_0x41d80a[_0x3a4b5d(0x21c)]?.['langs']);return{'enableI18n':typeof _0x41d80a['enableI18n']===_0x3a4b5d(0x216)?_0x41d80a[_0x3a4b5d(0x211)]:null,'languages':_0x399b2f,'i18nInfo':_0x41d80a[_0x3a4b5d(0x21c)]?{..._0x41d80a[_0x3a4b5d(0x21c)],'langs':_0x399b2f[_0x3a4b5d(0x1f3)]?_0x399b2f:null}:null};}const initDef={'service':a3_0x5eb44c(0x201),'command':'init','description':a3_0x5eb44c(0x20c)+PRODUCT_CONFIG[a3_0x5eb44c(0x1e4)]+a3_0x5eb44c(0x21d),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x103f99){return await runInit(collectFlags(_0x103f99,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x5eb44c(0x201),'command':a3_0x5eb44c(0x1cc),'description':a3_0x5eb44c(0x1fd),'risk':a3_0x5eb44c(0x1e8),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x5eb44c(0x20e),'type':a3_0x5eb44c(0x1e1),'description':a3_0x5eb44c(0x1ce),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x5eb44c(0x1e7),'type':a3_0x5eb44c(0x216),'description':a3_0x5eb44c(0x218),'default':![]},{'name':a3_0x5eb44c(0x1e0),'type':'boolean','description':a3_0x5eb44c(0x1d2),'default':![]}],async 'execute'(_0x4833fa){const _0x1f5828=a3_0x5eb44c,_0x19621e=_0x4833fa[_0x1f5828(0x1d4)](_0x1f5828(0x20e))||_0x4833fa[_0x1f5828(0x1f2)]||getEnv()||_0x1f5828(0x206),_0x4d4d06=_0x4833fa['bool'](_0x1f5828(0x1e7)),_0x43b841=_0x4833fa['bool'](_0x1f5828(0x1e0)),{readRawConfigWithLayers:_0x233336,resolveDefaultAppSource:_0x3e55f5,getLocalAppAliases:_0xcd2922}=await import(_0x1f5828(0x203)),{getRemoteAppList:_0x377016}=await import('../../commands/app/remote-source.js'),{config:_0x9b7a7a,layers:_0x4f25f8}=_0x233336(),_0x1fc893=_0x3e55f5(_0x4f25f8),{defaultApp:_0x29f468}=_0x9b7a7a,_0x32cb35=await _0x377016({'env':_0x19621e,'accessKey':_0x4833fa[_0x1f5828(0x21a)],'localOnly':_0x4d4d06,'noCache':_0x43b841}),_0x2afd35=_0x32cb35[_0x1f5828(0x215)][_0x1f5828(0x210)](_0x3c443b=>{const _0x6aa697=_0x1f5828;return{'name':_0x3c443b['appName'],'appcode':_0x3c443b[_0x6aa697(0x205)],'named':!![],'definedIn':'remote','isDefault':_0x3c443b[_0x6aa697(0x1e6)]===_0x29f468,...buildAppProfileListFields(_0x19621e),...buildRemoteAppI18nFields(_0x3c443b),'source':_0x32cb35[_0x6aa697(0x1e9)],'owner':_0x3c443b[_0x6aa697(0x1fc)]??null,'status':_0x3c443b[_0x6aa697(0x1db)]??null,'cachedAt':_0x32cb35[_0x6aa697(0x214)]};}),_0x30fc07=_0xcd2922(_0x9b7a7a);let _0x370e42=0x0;for(const [_0x556868,_0xe83ad]of Object[_0x1f5828(0x202)](_0x30fc07)){const _0x5e58ba=typeof _0xe83ad[_0x1f5828(0x1d1)]===_0x1f5828(0x1e1)?_0xe83ad[_0x1f5828(0x1d1)][_0x1f5828(0x1ec)]():'';if(!_0x5e58ba)continue;_0x370e42+=0x1,_0x2afd35[_0x1f5828(0x1da)]({'name':_0x556868,'appcode':_0x5e58ba,'named':!![],'definedIn':_0x1f5828(0x1e7),'isDefault':_0x556868===_0x29f468,...buildAppProfileListFields(_0x19621e),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x2afd35,_0x4833fa[_0x1f5828(0x20b)]);if(_0x2afd35[_0x1f5828(0x1f3)]===0x0)return{'ok':!![],'data':[],'message':_0x32cb35['source']===_0x1f5828(0x21b)?_0x1f5828(0x20a):'No\x20apps\x20found\x20on\x20the\x20platform.'};const _0x5a3957=_0x2afd35[_0x1f5828(0x1fb)](_0x3e573d=>_0x3e573d[_0x1f5828(0x208)]===!![]),_0x45d4cf=_0x29f468??_0x5a3957?.[_0x1f5828(0x1f4)]??null,_0x1ce05c={'env':_0x19621e,'source':_0x32cb35[_0x1f5828(0x1e9)],'fetchedAt':_0x32cb35['fetchedAt'],'cachePath':_0x32cb35[_0x1f5828(0x1d8)],'globalPath':_0x4f25f8[_0x1f5828(0x1f9)]??null,'projectPath':_0x4f25f8[_0x1f5828(0x1e2)]??null,'defaultApp':_0x45d4cf,'defaultAppSource':_0x29f468!=null?_0x1fc893:null,'localAliasCount':_0x370e42};return{'ok':!![],'data':{'items':_0x2afd35,'meta':_0x1ce05c}};}},pullDef={'service':a3_0x5eb44c(0x201),'command':a3_0x5eb44c(0x1ea),'description':a3_0x5eb44c(0x1fe),'risk':a3_0x5eb44c(0x220),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x5eb44c(0x20e),'type':a3_0x5eb44c(0x1e1),'description':'Target\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x5eb44c(0x1e7),'type':a3_0x5eb44c(0x216),'description':a3_0x5eb44c(0x1d6),'default':![]},{'name':a3_0x5eb44c(0x1e0),'type':'boolean','description':a3_0x5eb44c(0x1d2),'default':![]}],async 'execute'(_0x3d4944){const _0x3fce39=a3_0x5eb44c,_0x367dea=_0x3d4944[_0x3fce39(0x1d4)](_0x3fce39(0x20e))||_0x3d4944[_0x3fce39(0x1f2)]||getEnv()||'production',_0x34c518=_0x3d4944[_0x3fce39(0x1f8)](_0x3fce39(0x1e7)),_0x257aa0=_0x3d4944[_0x3fce39(0x1f8)]('no-cache'),{getRemoteAppList:_0x445c94}=await import('../../commands/app/remote-source.js'),_0x5bbce2=await _0x445c94({'env':_0x367dea,'accessKey':_0x3d4944[_0x3fce39(0x21a)],'localOnly':_0x34c518,'noCache':_0x257aa0});return{'ok':!![],'data':{'total':_0x5bbce2[_0x3fce39(0x215)][_0x3fce39(0x1f3)],'env':_0x367dea,'source':_0x5bbce2[_0x3fce39(0x1e9)],'fetchedAt':_0x5bbce2[_0x3fce39(0x214)],'cachePath':_0x5bbce2[_0x3fce39(0x1d8)]},'message':_0x5bbce2[_0x3fce39(0x1e9)]==='cache'?_0x3fce39(0x1ed)+_0x5bbce2[_0x3fce39(0x215)][_0x3fce39(0x1f3)]+_0x3fce39(0x20f)+_0x367dea+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0x5bbce2[_0x3fce39(0x215)]['length']+_0x3fce39(0x21e)+_0x367dea+'\x22.'};}},useDef={'service':a3_0x5eb44c(0x201),'command':'use','description':a3_0x5eb44c(0x213),'risk':a3_0x5eb44c(0x220),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':a3_0x5eb44c(0x1d7),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x44989a){const _0x4a9090=a3_0x5eb44c;if(!_0x44989a[_0x4a9090(0x1d0)][0x0])throw CliErrors['validation']('Missing\x20app\x20name.',_0x4a9090(0x1eb)+CLI_BIN_NAME+_0x4a9090(0x204));},async 'execute'(_0x1b425c){const _0x5b5b13=a3_0x5eb44c,_0x356573=_0x1b425c[_0x5b5b13(0x1d0)][0x0];if(!_0x356573)throw CliErrors[_0x5b5b13(0x1f6)](_0x5b5b13(0x1f5),_0x5b5b13(0x1eb)+CLI_BIN_NAME+_0x5b5b13(0x204));const {buildConfigFromFlags:_0x40f543,resolveLocalAppAliasCode:_0x1bd85}=await import(_0x5b5b13(0x203)),{readCachedAppList:_0x38c25c}=await import(_0x5b5b13(0x1cf)),_0x4a4674=_0x1b425c[_0x5b5b13(0x1d4)](_0x5b5b13(0x20e)),_0x202c60=_0x40f543(_0x4a4674?{'env':_0x4a4674}:{}),_0x267c6e=_0x38c25c(_0x202c60[_0x5b5b13(0x20e)],_0x202c60[_0x5b5b13(0x21a)]),_0x33b014=_0x267c6e?.[_0x5b5b13(0x215)][_0x5b5b13(0x1fb)](_0x5aa4f6=>_0x5aa4f6[_0x5b5b13(0x1e6)]===_0x356573),_0x19ce17=_0x1bd85(_0x202c60[_0x5b5b13(0x1d9)]??{},_0x356573);if(!_0x33b014&&!_0x19ce17&&_0x202c60[_0x5b5b13(0x1fa)]!==_0x356573){const _0x3ac782=[..._0x267c6e?.['items']['map'](_0x59a51a=>_0x59a51a[_0x5b5b13(0x1e6)])??[]],_0x2137d2=_0x3ac782[_0x5b5b13(0x1f3)]===0x0?_0x5b5b13(0x1df)+CLI_BIN_NAME+_0x5b5b13(0x1ee)+_0x356573+_0x5b5b13(0x1f1):'Available\x20remote\x20apps:\x20'+Array[_0x5b5b13(0x21f)](new Set(_0x3ac782))[_0x5b5b13(0x1e3)](',\x20')+'.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.';throw CliErrors[_0x5b5b13(0x1f6)](_0x5b5b13(0x1dc)+_0x356573+'\x22\x20not\x20found.',_0x2137d2);}const _0x2a2189=_0x1b425c[_0x5b5b13(0x1f8)](_0x5b5b13(0x217));let _0x320d04;if(_0x2a2189)_0x320d04={'global':!![]};else{const {isInProject:_0x19ee68}=await import(_0x5b5b13(0x203)),_0x52ba57=_0x19ee68();_0x320d04=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':'project-default','inProject':_0x52ba57}));}const _0x4d000f=readConfig(_0x320d04);return _0x4d000f[_0x5b5b13(0x1fa)]=_0x356573,writeConfig(_0x4d000f,_0x320d04),{'ok':!![],'message':_0x5b5b13(0x1dd)+_0x356573+'\x22'+scopeLabel(_0x320d04)+'.'};}},importDef={'service':a3_0x5eb44c(0x201),'command':a3_0x5eb44c(0x1ff),'description':a3_0x5eb44c(0x221),'risk':a3_0x5eb44c(0x220),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x7df57c){return await runInitImport(collectFlags(_0x7df57c,initImportFlagDefs)),{'ok':!![]};}};function a3_0x399d(_0x302fbe,_0x340b4a){_0x302fbe=_0x302fbe-0x1cc;const _0x40f3c6=a3_0x40f3();let _0x399dfe=_0x40f3c6[_0x302fbe];return _0x399dfe;}export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
const a3_0xb50ee1=a3_0xd9c4;(function(_0x55654f,_0xbc70c6){const _0x230b5d=a3_0xd9c4,_0x537b30=_0x55654f();while(!![]){try{const _0x44da9a=-parseInt(_0x230b5d(0x140))/0x1+parseInt(_0x230b5d(0x108))/0x2*(-parseInt(_0x230b5d(0x112))/0x3)+-parseInt(_0x230b5d(0xfb))/0x4+-parseInt(_0x230b5d(0x13d))/0x5*(-parseInt(_0x230b5d(0x132))/0x6)+parseInt(_0x230b5d(0x11f))/0x7+parseInt(_0x230b5d(0xf6))/0x8*(-parseInt(_0x230b5d(0x115))/0x9)+parseInt(_0x230b5d(0x113))/0xa;if(_0x44da9a===_0xbc70c6)break;else _0x537b30['push'](_0x537b30['shift']());}catch(_0x1da550){_0x537b30['push'](_0x537b30['shift']());}}}(a3_0x8fae,0x330c8));import{CliErrors}from'../../errors.js';function a3_0xd9c4(_0x5aa6cd,_0x280342){_0x5aa6cd=_0x5aa6cd-0xf3;const _0x8faea8=a3_0x8fae();let _0xd9c4ce=_0x8faea8[_0x5aa6cd];return _0xd9c4ce;}import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';function a3_0x8fae(){const _0xf7f4d5=['envName','i18nInfo','args','source','boolean','config','Initialize\x20','use','projectPath','accessKey','Usage:\x20','filter','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','app','840ebyJPU','defaultApp','\x20cached\x20app(s)\x20for\x20env=\x22','appName','local','raw','../../context.js','name','join','\x22\x20not\x20found.','nonInteractive','1570bhdyIu','cache','validation','403015dDNEvK','Use\x20global\x20config\x20scope','pull','global','\x20config\x20file','globalPath','production','str','cachePath','Refreshed\x20app\x20cache\x20with\x20','string','appCode','264392BcQeho','.appcode\x20to\x20.lovrabet.json.','enableI18n','map','Available\x20remote\x20apps:\x20','1376820MOkWuD','newConfigFileName','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','appPublishStatus','project-default','no-cache','write','Missing\x20app\x20name.','Loaded\x20','items','init','../../commands/app/cache.js','2USnmVw','push','env','appcode','Target\x20environment\x20(default:\x20current\x20env)','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','length','Default\x20app\x20candidate\x20set\x20to\x20\x22','Remote\x20app\x20name\x20to\x20activate','No\x20apps\x20found\x20on\x20the\x20platform.','1249221KjsWxx','14391040Qannsn','isCurrent','54drdqFC','../../commands/app/remote-source.js','\x20app\x20use\x20<name>\x20[--global]','list','find','bool','from','Read\x20app\x20list\x20from\x20local\x20cache\x20only','fetchedAt','appOwnerName','615671wPkpkn','Use\x20`','read','trim','\x20app(s)\x20for\x20env=\x22'];a3_0x8fae=function(){return _0xf7f4d5;};return a3_0x8fae();}import{CLI_BIN_NAME,readConfig,writeConfig,scopeLabel,enrichAppListItemsWithMergedSelection}from'../../commands/app/shared.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';const GLOBAL_FLAG={'name':a3_0xb50ee1(0x143),'type':a3_0xb50ee1(0x128),'description':a3_0xb50ee1(0x141),'default':![]};function collectFlags(_0x31bf63,_0x377d18){const _0x2482ed=a3_0xb50ee1,_0x286fe2={};for(const _0x152116 of _0x377d18){const _0x19b653=_0x152116['type']===_0x2482ed(0x128)?_0x31bf63[_0x2482ed(0x11a)](_0x152116[_0x2482ed(0x139)]):_0x31bf63[_0x2482ed(0x147)](_0x152116[_0x2482ed(0x139)]);if(_0x19b653!==''&&_0x19b653!==![])_0x286fe2[_0x152116['name']]=_0x19b653;}if(_0x31bf63[_0x2482ed(0x13c)])_0x286fe2['nonInteractive']=!![];return _0x286fe2;}function normalizeLanguages(_0x1ebf82){const _0x3fb194=a3_0xb50ee1;if(!Array['isArray'](_0x1ebf82))return[];return _0x1ebf82[_0x3fb194(0x12f)](_0x4b1f39=>typeof _0x4b1f39==='string')[_0x3fb194(0xf9)](_0x255310=>_0x255310[_0x3fb194(0x122)]())[_0x3fb194(0x12f)](Boolean);}function buildRemoteAppI18nFields(_0x38f0fe){const _0x5953ff=a3_0xb50ee1,_0x4137f9=normalizeLanguages(_0x38f0fe[_0x5953ff(0x125)]?.['langs']);return{'enableI18n':typeof _0x38f0fe[_0x5953ff(0xf8)]==='boolean'?_0x38f0fe[_0x5953ff(0xf8)]:null,'languages':_0x4137f9,'i18nInfo':_0x38f0fe[_0x5953ff(0x125)]?{..._0x38f0fe[_0x5953ff(0x125)],'langs':_0x4137f9['length']?_0x4137f9:null}:null};}const initDef={'service':a3_0xb50ee1(0x131),'command':a3_0xb50ee1(0x106),'description':a3_0xb50ee1(0x12a)+PRODUCT_CONFIG[a3_0xb50ee1(0xfc)]+a3_0xb50ee1(0x144),'risk':a3_0xb50ee1(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x4a0e07){return await runInit(collectFlags(_0x4a0e07,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0xb50ee1(0x131),'command':a3_0xb50ee1(0x118),'description':a3_0xb50ee1(0x10d),'risk':a3_0xb50ee1(0x121),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0xb50ee1(0x10a),'type':'string','description':'Filter\x20by\x20environment\x20(default:\x20current\x20env)','enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0xb50ee1(0x128),'description':a3_0xb50ee1(0x11c),'default':![]},{'name':a3_0xb50ee1(0x101),'type':a3_0xb50ee1(0x128),'description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x19baf3){const _0x518cb0=a3_0xb50ee1,_0x16298f=_0x19baf3[_0x518cb0(0x147)]('env')||_0x19baf3['envName']||getEnv()||_0x518cb0(0x146),_0x5e69cc=_0x19baf3[_0x518cb0(0x11a)](_0x518cb0(0x136)),_0x3fdd97=_0x19baf3[_0x518cb0(0x11a)](_0x518cb0(0x101)),{readRawConfigWithLayers:_0x3908e4,resolveDefaultAppSource:_0x1cb52b,getLocalAppAliases:_0x2db5ea}=await import(_0x518cb0(0x138)),{getRemoteAppList:_0x1091a1}=await import(_0x518cb0(0x116)),{config:_0x3db3b1,layers:_0x3aa0b3}=_0x3908e4(),_0x15095b=_0x1cb52b(_0x3aa0b3),{defaultApp:_0x3a413c}=_0x3db3b1,_0x4a3219=await _0x1091a1({'env':_0x16298f,'accessKey':_0x19baf3['accessKey'],'localOnly':_0x5e69cc,'noCache':_0x3fdd97}),_0xc2cac4=_0x4a3219['items'][_0x518cb0(0xf9)](_0x56c330=>{const _0x3da79f=_0x518cb0;return{'name':_0x56c330[_0x3da79f(0x135)],'appcode':_0x56c330[_0x3da79f(0xf5)],'named':!![],'definedIn':'remote','isDefault':_0x56c330['appName']===_0x3a413c,...buildAppProfileListFields(_0x16298f),...buildRemoteAppI18nFields(_0x56c330),'source':_0x4a3219[_0x3da79f(0x127)],'owner':_0x56c330[_0x3da79f(0x11e)]??null,'status':_0x56c330[_0x3da79f(0xff)]??null,'cachedAt':_0x4a3219[_0x3da79f(0x11d)]};}),_0x240a0b=_0x2db5ea(_0x3db3b1);let _0x4e0270=0x0;for(const [_0xc7624,_0x41d413]of Object['entries'](_0x240a0b)){const _0x37a81c=typeof _0x41d413[_0x518cb0(0x10b)]===_0x518cb0(0xf4)?_0x41d413[_0x518cb0(0x10b)][_0x518cb0(0x122)]():'';if(!_0x37a81c)continue;_0x4e0270+=0x1,_0xc2cac4[_0x518cb0(0x109)]({'name':_0xc7624,'appcode':_0x37a81c,'named':!![],'definedIn':_0x518cb0(0x136),'isDefault':_0xc7624===_0x3a413c,...buildAppProfileListFields(_0x16298f),'source':_0x518cb0(0x129),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0xc2cac4,_0x19baf3['mergedCli']);if(_0xc2cac4[_0x518cb0(0x10e)]===0x0)return{'ok':!![],'data':[],'message':_0x4a3219[_0x518cb0(0x127)]===_0x518cb0(0x13e)?'No\x20cached\x20apps\x20found.':_0x518cb0(0x111)};const _0x256485=_0xc2cac4[_0x518cb0(0x119)](_0x333837=>_0x333837[_0x518cb0(0x114)]===!![]),_0x2a9bd2=_0x3a413c??_0x256485?.[_0x518cb0(0x139)]??null,_0xff164={'env':_0x16298f,'source':_0x4a3219[_0x518cb0(0x127)],'fetchedAt':_0x4a3219[_0x518cb0(0x11d)],'cachePath':_0x4a3219[_0x518cb0(0x148)],'globalPath':_0x3aa0b3[_0x518cb0(0x145)]??null,'projectPath':_0x3aa0b3[_0x518cb0(0x12c)]??null,'defaultApp':_0x2a9bd2,'defaultAppSource':_0x3a413c!=null?_0x15095b:null,'localAliasCount':_0x4e0270};return{'ok':!![],'data':{'items':_0xc2cac4,'meta':_0xff164}};}},pullDef={'service':a3_0xb50ee1(0x131),'command':a3_0xb50ee1(0x142),'description':a3_0xb50ee1(0xfe),'risk':a3_0xb50ee1(0x102),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a3_0xb50ee1(0xf4),'description':a3_0xb50ee1(0x10c),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0xb50ee1(0x136),'type':a3_0xb50ee1(0x128),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0xb50ee1(0x101),'type':'boolean','description':a3_0xb50ee1(0xfd),'default':![]}],async 'execute'(_0x411cc3){const _0x44d029=a3_0xb50ee1,_0x449d3a=_0x411cc3[_0x44d029(0x147)](_0x44d029(0x10a))||_0x411cc3[_0x44d029(0x124)]||getEnv()||_0x44d029(0x146),_0xaf78fa=_0x411cc3[_0x44d029(0x11a)](_0x44d029(0x136)),_0x31555c=_0x411cc3[_0x44d029(0x11a)]('no-cache'),{getRemoteAppList:_0xf298f9}=await import('../../commands/app/remote-source.js'),_0x5d4867=await _0xf298f9({'env':_0x449d3a,'accessKey':_0x411cc3['accessKey'],'localOnly':_0xaf78fa,'noCache':_0x31555c});return{'ok':!![],'data':{'total':_0x5d4867['items'][_0x44d029(0x10e)],'env':_0x449d3a,'source':_0x5d4867['source'],'fetchedAt':_0x5d4867[_0x44d029(0x11d)],'cachePath':_0x5d4867[_0x44d029(0x148)]},'message':_0x5d4867[_0x44d029(0x127)]==='cache'?_0x44d029(0x104)+_0x5d4867['items']['length']+_0x44d029(0x134)+_0x449d3a+'\x22.':_0x44d029(0xf3)+_0x5d4867['items'][_0x44d029(0x10e)]+_0x44d029(0x123)+_0x449d3a+'\x22.'};}},useDef={'service':a3_0xb50ee1(0x131),'command':a3_0xb50ee1(0x12b),'description':'Set\x20the\x20fallback\x20app\x20candidate','risk':a3_0xb50ee1(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0xb50ee1(0x139),'description':a3_0xb50ee1(0x110),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x4c0035){const _0x61b41e=a3_0xb50ee1;if(!_0x4c0035[_0x61b41e(0x126)][0x0])throw CliErrors['validation']('Missing\x20app\x20name.',_0x61b41e(0x12e)+CLI_BIN_NAME+_0x61b41e(0x117));},async 'execute'(_0x395f0c){const _0x15e233=a3_0xb50ee1,_0x596b30=_0x395f0c[_0x15e233(0x126)][0x0];if(!_0x596b30)throw CliErrors['validation'](_0x15e233(0x103),_0x15e233(0x12e)+CLI_BIN_NAME+_0x15e233(0x117));const {buildConfigFromFlags:_0x1000b1,resolveLocalAppAliasCode:_0x5d9efd}=await import(_0x15e233(0x138)),{readCachedAppList:_0x1e8b42}=await import(_0x15e233(0x107)),_0x1d2b88=_0x395f0c[_0x15e233(0x147)](_0x15e233(0x10a)),_0x39b641=_0x1000b1(_0x1d2b88?{'env':_0x1d2b88}:{}),_0x32bdab=_0x1e8b42(_0x39b641['env'],_0x39b641[_0x15e233(0x12d)]),_0x28d62a=_0x32bdab?.[_0x15e233(0x105)][_0x15e233(0x119)](_0x18be93=>_0x18be93[_0x15e233(0x135)]===_0x596b30),_0x2cea12=_0x5d9efd(_0x39b641[_0x15e233(0x137)]??{},_0x596b30);if(!_0x28d62a&&!_0x2cea12&&_0x39b641[_0x15e233(0x133)]!==_0x596b30){const _0x1cbcbf=[..._0x32bdab?.['items'][_0x15e233(0xf9)](_0x1a1399=>_0x1a1399[_0x15e233(0x135)])??[]],_0xe48a5d=_0x1cbcbf[_0x15e233(0x10e)]===0x0?_0x15e233(0x120)+CLI_BIN_NAME+_0x15e233(0x130)+_0x596b30+_0x15e233(0xf7):_0x15e233(0xfa)+Array[_0x15e233(0x11b)](new Set(_0x1cbcbf))[_0x15e233(0x13a)](',\x20')+'.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.';throw CliErrors[_0x15e233(0x13f)]('App\x20\x22'+_0x596b30+_0x15e233(0x13b),_0xe48a5d);}const _0x424329=_0x395f0c[_0x15e233(0x11a)]('global');let _0x5c3672;if(_0x424329)_0x5c3672={'global':!![]};else{const {isInProject:_0x54d334}=await import(_0x15e233(0x138)),_0x412a73=_0x54d334();_0x5c3672=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x15e233(0x100),'inProject':_0x412a73}));}const _0x798ec1=readConfig(_0x5c3672);return _0x798ec1[_0x15e233(0x133)]=_0x596b30,writeConfig(_0x798ec1,_0x5c3672),{'ok':!![],'message':_0x15e233(0x10f)+_0x596b30+'\x22'+scopeLabel(_0x5c3672)+'.'};}},importDef={'service':a3_0xb50ee1(0x131),'command':'import','description':'Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','risk':a3_0xb50ee1(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x376ec4){return await runInitImport(collectFlags(_0x376ec4,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fbcbd,_0x6b8d1b){const _0x459132=a4_0x250c,_0x40373a=_0x4fbcbd();while(!![]){try{const _0x4cd2d7=parseInt(_0x459132(0x1c7))/0x1*(-parseInt(_0x459132(0x1bb))/0x2)+-parseInt(_0x459132(0x1c1))/0x3+-parseInt(_0x459132(0x1be))/0x4*(parseInt(_0x459132(0x1c6))/0x5)+parseInt(_0x459132(0x1bf))/0x6+parseInt(_0x459132(0x1b7))/0x7*(-parseInt(_0x459132(0x1c8))/0x8)+parseInt(_0x459132(0x1c0))/0x9+parseInt(_0x459132(0x1c4))/0xa;if(_0x4cd2d7===_0x6b8d1b)break;else _0x40373a['push'](_0x40373a['shift']());}catch(_0x1d84f9){_0x40373a['push'](_0x40373a['shift']());}}}(a4_0x3a96,0x6efa9));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';function a4_0x250c(_0x5ce5aa,_0x1c81ac){_0x5ce5aa=_0x5ce5aa-0x1b7;const _0x3a96a8=a4_0x3a96();let _0x250c73=_0x3a96a8[_0x5ce5aa];return _0x250c73;}function a4_0x3a96(){const _0x45c989=['../../../mock/app-list.json','errorMsg','8KQaOud','Mock\x20API\x20error:\x20','utf-8','266648Nghrcb','1136862ZFSaFr','4218210YYnrkZ','2389971cdvyFR','tableData','success','24159120lRjpDx','data','50CumYtm','66059uEJpOT','8BlQZTr','6243979eGsVfo','errorCode'];a4_0x3a96=function(){return _0x45c989;};return a4_0x3a96();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x3fecbd=a4_0x250c,_0x15f6da=join(__dirname,_0x3fecbd(0x1b9)),_0x47abc0=readFileSync(_0x15f6da,_0x3fecbd(0x1bd));return JSON['parse'](_0x47abc0);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x130f38=a4_0x250c,_0x11e26c=getMockAppList();if(!_0x11e26c[_0x130f38(0x1c3)])throw new Error(_0x130f38(0x1bc)+_0x11e26c[_0x130f38(0x1ba)]+'\x20('+_0x11e26c[_0x130f38(0x1b8)]+')');return _0x11e26c[_0x130f38(0x1c5)][_0x130f38(0x1c2)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x55ddb8,_0xec9c71){const _0x41eaac=a5_0x2ee0,_0x519e6e=_0x55ddb8();while(!![]){try{const _0xdcbc4b=-parseInt(_0x41eaac(0x122))/0x1*(-parseInt(_0x41eaac(0x12e))/0x2)+parseInt(_0x41eaac(0x120))/0x3+parseInt(_0x41eaac(0x12c))/0x4*(-parseInt(_0x41eaac(0x131))/0x5)+parseInt(_0x41eaac(0x126))/0x6*(-parseInt(_0x41eaac(0x130))/0x7)+-parseInt(_0x41eaac(0x123))/0x8+-parseInt(_0x41eaac(0x12d))/0x9+-parseInt(_0x41eaac(0x125))/0xa*(-parseInt(_0x41eaac(0x11e))/0xb);if(_0xdcbc4b===_0xec9c71)break;else _0x519e6e['push'](_0x519e6e['shift']());}catch(_0xbb319){_0x519e6e['push'](_0x519e6e['shift']());}}}(a5_0x20ec,0x6e6f8));import{getMyApps}from'../../core/api-client.js';import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';function a5_0x20ec(){const _0x5a8062=['2951496iGFRfz','1205158GriVVe','remote','14nEGkXV','31105jyrURQ','1887083CGCARn','toLowerCase','96576GUeYlf','APP_LIST_SOURCE','1EdRFAd','1977096LwXojp','items','110ekwIAj','2187738fDdGni','fetchedAt','cache','toISOString','mock','trim','492LePZBe'];a5_0x20ec=function(){return _0x5a8062;};return a5_0x20ec();}import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x2bf2d0=a5_0x2ee0,_0x543985=(productEnv(_0x2bf2d0(0x121))||'')['trim']()[_0x2bf2d0(0x11f)]();return _0x543985===_0x2bf2d0(0x12a);}function a5_0x2ee0(_0x3d2626,_0x3ee05e){_0x3d2626=_0x3d2626-0x11e;const _0x20ec47=a5_0x20ec();let _0x2ee0ed=_0x20ec47[_0x3d2626];return _0x2ee0ed;}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x198a04){const _0x1b3bed=a5_0x2ee0,{env:_0x4a5251,accessKey:_0x452f75,localOnly:localOnly=![],noCache:noCache=![]}=_0x198a04,_0x2cabbc=readCachedAppList(_0x4a5251,_0x452f75),_0x731cfa=_0x452f75?.[_0x1b3bed(0x12b)]()?getAppCacheFilePath(_0x4a5251,_0x452f75):null;if(localOnly)return{'items':_0x2cabbc?.[_0x1b3bed(0x124)]??[],'source':'cache','fetchedAt':_0x2cabbc?.[_0x1b3bed(0x127)]??null,'cachePath':_0x731cfa};try{const _0x19a01a=await getRemoteAppItems(),_0x3597f5=shouldUseMockRemoteApps()?'mock':_0x1b3bed(0x12f),_0x165433=new Date()[_0x1b3bed(0x129)](),_0x34c296=_0x452f75?.['trim']()?writeCachedAppList(_0x4a5251,_0x452f75,{'env':_0x4a5251,'fetchedAt':_0x165433,'source':_0x3597f5,'items':_0x19a01a}):null;return{'items':_0x19a01a,'source':_0x3597f5,'fetchedAt':_0x165433,'cachePath':_0x34c296};}catch(_0x519a81){if(!noCache&&_0x2cabbc)return{'items':_0x2cabbc[_0x1b3bed(0x124)],'source':_0x1b3bed(0x128),'fetchedAt':_0x2cabbc['fetchedAt'],'cachePath':_0x731cfa};throw _0x519a81;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xc750b1,_0x395933){const _0x30c584=a6_0x548f,_0x5307b9=_0xc750b1();while(!![]){try{const _0x2f4714=parseInt(_0x30c584(0x124))/0x1*(-parseInt(_0x30c584(0x11c))/0x2)+-parseInt(_0x30c584(0x12c))/0x3*(parseInt(_0x30c584(0x128))/0x4)+parseInt(_0x30c584(0x123))/0x5*(-parseInt(_0x30c584(0x12a))/0x6)+parseInt(_0x30c584(0x12d))/0x7+-parseInt(_0x30c584(0x122))/0x8+parseInt(_0x30c584(0x127))/0x9+parseInt(_0x30c584(0x129))/0xa*(parseInt(_0x30c584(0x120))/0xb);if(_0x2f4714===_0x395933)break;else _0x5307b9['push'](_0x5307b9['shift']());}catch(_0x287a18){_0x5307b9['push'](_0x5307b9['shift']());}}}(a6_0x4640,0x39516));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};function a6_0x548f(_0x3b34d6,_0x23d8c8){_0x3b34d6=_0x3b34d6-0x119;const _0x464003=a6_0x4640();let _0x548f88=_0x464003[_0x3b34d6];return _0x548f88;}function a6_0x4640(){const _0x378ae7=['named','project','112rbZKrc','name','global','defaultApp','11XCvtPo','isCurrent','3270032sEPYwY','2176635DFbJTr','8011GTuaxz','trim','appCode','3672126DDHvrC','4GzIPhZ','10714010GVdUFw','6ojtmHR','definedIn','1025187BYDsMp','2728495hUvFjw','find','currentApp'];a6_0x4640=function(){return _0x378ae7;};return a6_0x4640();}export function enrichAppListItemsWithMergedSelection(_0x5389bd,_0x2ba7ce){const _0x486311=a6_0x548f;if(!_0x2ba7ce)return;const _0x3515d0=!!(_0x2ba7ce[_0x486311(0x119)]??_0x2ba7ce[_0x486311(0x11f)]);for(const _0x24145f of _0x5389bd){_0x24145f[_0x486311(0x121)]=![];}const _0x203f5a=_0x2ba7ce[_0x486311(0x126)]!=null?String(_0x2ba7ce['appCode'])[_0x486311(0x125)]():'';if(_0x3515d0){const _0x35c6d2=_0x2ba7ce['currentApp']??_0x2ba7ce[_0x486311(0x11f)];if(_0x35c6d2){const _0x487b92=_0x5389bd[_0x486311(0x12e)](_0x5ccc65=>_0x5ccc65[_0x486311(0x11a)]===!![]&&_0x5ccc65[_0x486311(0x11d)]===_0x35c6d2&&_0x5ccc65[_0x486311(0x12b)]==='local'),_0x40936f=_0x487b92??_0x5389bd[_0x486311(0x12e)](_0x96dff5=>_0x96dff5[_0x486311(0x11a)]===!![]&&_0x96dff5['name']===_0x35c6d2);_0x40936f&&(_0x40936f['isCurrent']=!![]);}return;}if(!_0x203f5a)return;for(const _0x1f83d9 of _0x5389bd){String(_0x1f83d9['appcode']??'')[_0x486311(0x125)]()===_0x203f5a&&(_0x1f83d9['isCurrent']=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x304410){const _0x4d247c=a6_0x548f;return formatScopeLabel(_0x304410[_0x4d247c(0x11e)]?_0x4d247c(0x11e):_0x4d247c(0x11b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x17b876=a7_0x8da4;function a7_0x5220(){const _0x5a7466=['compiledContent','join','update','exec','artifactType','file','createTime','Artifact\x20ID','some','File\x20not\x20found:\x20','12AvbgEM','favorite','3GaIHhe','includes','test','utf8','868713UJhJfR','react_module','bool','artifact','startsWith','13915dJxdaN','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','content','Optional\x20favorite-state\x20filter','name','map','updateTime','list','--metadata\x20must\x20be\x20a\x20JSON\x20object.','@ant-design/icons','validation','metadata','1725400nnQKTN','description','str','/client/artifact/create','write','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','num','2152600KEtwNA','AGENT','Show\x20one\x20Artifact\x20by\x20id','POST','read','string','File\x20is\x20not\x20a\x20regular\x20file:\x20','Artifact\x20source\x20file\x20is\x20blank.','List\x20current-app\x20react_module\x20Artifacts','lodash','isFile','parse','verbose','25254504FMTOYe','create','filter','flag','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Created\x20Artifact\x20','9RBISvZ','lastIndex','460924CxHMQd','788WFfIfU','source','split','isArray','Artifact\x20display\x20name','appCode','detail','deleted','body','Preview:\x20create\x20react_module\x20Artifact','trim','/client/artifact/','build','Updated\x20Artifact\x20','Preview:\x20update\x20react_module\x20Artifact\x20','add','.\x20Unsupported:\x20','3878854ljlygc','react_module\x20imports\x20are\x20limited\x20to:\x20','Invalid\x20JSON\x20for\x20--metadata:\x20'];a7_0x5220=function(){return _0x5a7466;};return a7_0x5220();}(function(_0x4c4cf7,_0x1e9167){const _0x2ce294=a7_0x8da4,_0x286472=_0x4c4cf7();while(!![]){try{const _0x4ff48b=-parseInt(_0x2ce294(0xca))/0x1+-parseInt(_0x2ce294(0xa5))/0x2*(parseInt(_0x2ce294(0xc6))/0x3)+-parseInt(_0x2ce294(0xa6))/0x4*(-parseInt(_0x2ce294(0xcf))/0x5)+parseInt(_0x2ce294(0xc4))/0x6*(-parseInt(_0x2ce294(0xb7))/0x7)+parseInt(_0x2ce294(0x90))/0x8+parseInt(_0x2ce294(0xa3))/0x9*(-parseInt(_0x2ce294(0x89))/0xa)+parseInt(_0x2ce294(0x9d))/0xb;if(_0x4ff48b===_0x1e9167)break;else _0x286472['push'](_0x286472['shift']());}catch(_0x368db8){_0x286472['push'](_0x286472['shift']());}}}(a7_0x5220,0xb302f));import{existsSync,readFileSync,statSync}from'node:fs';import{createRuntimeArtifact,getRuntimeArtifact,listRuntimeArtifacts,updateRuntimeArtifact}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a7_0x17b876(0xcb),ARTIFACT_SOURCE_AGENT=a7_0x17b876(0x91),ALLOWED_REACT_MODULE_IMPORTS=['react','react-dom',a7_0x17b876(0x99),'dayjs','antd',a7_0x17b876(0x86)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a7_0x17b876(0xbb)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':'file','type':a7_0x17b876(0x95),'required':!![],'description':a7_0x17b876(0x7d)},ARTIFACT_NAME_FLAG={'name':a7_0x17b876(0x81),'type':'string','description':a7_0x17b876(0xaa)},METADATA_FLAG={'name':a7_0x17b876(0x88),'type':a7_0x17b876(0x95),'description':a7_0x17b876(0x7e)};function isPlainObject(_0x2e7c1c){const _0x3e866e=a7_0x17b876;return typeof _0x2e7c1c==='object'&&_0x2e7c1c!==null&&!Array[_0x3e866e(0xa9)](_0x2e7c1c);}function readSourceFile(_0x2af4fd){const _0x1d3e30=a7_0x17b876;if(!_0x2af4fd)throw CliErrors[_0x1d3e30(0x87)]('File\x20path\x20is\x20required.');if(!existsSync(_0x2af4fd))throw CliErrors['validation'](_0x1d3e30(0xc3)+_0x2af4fd);if(!statSync(_0x2af4fd)[_0x1d3e30(0x9a)]())throw CliErrors[_0x1d3e30(0x87)](_0x1d3e30(0x96)+_0x2af4fd);const _0x566afe=readFileSync(_0x2af4fd,_0x1d3e30(0xc9));return validateReactModuleSource(_0x566afe),_0x566afe;}function parseMetadata(_0x1144ae){const _0x81264e=a7_0x17b876;if(!_0x1144ae)return undefined;let _0x1cea2a;try{_0x1cea2a=JSON[_0x81264e(0x9b)](_0x1144ae);}catch{throw CliErrors[_0x81264e(0x87)](_0x81264e(0xb9)+_0x1144ae);}if(!isPlainObject(_0x1cea2a))throw CliErrors['validation'](_0x81264e(0x85));const _0x2ec3b5={..._0x1cea2a};return delete _0x2ec3b5['compiledContent'],_0x2ec3b5;}function getPackageName(_0x427e2f){const _0x4602b2=a7_0x17b876;if(_0x427e2f[_0x4602b2(0xce)]('@')){const [_0x75aed4,_0x43c44c]=_0x427e2f['split']('/');return _0x75aed4&&_0x43c44c?_0x75aed4+'/'+_0x43c44c:_0x427e2f;}return _0x427e2f[_0x4602b2(0xa8)]('/')[0x0]||_0x427e2f;}function validateAllowedImports(_0x4ae936){const _0x2588b4=a7_0x17b876,_0x1db8e5=new Set();for(const _0x7b50e2 of IMPORT_SOURCE_PATTERNS){_0x7b50e2[_0x2588b4(0xa4)]=0x0;let _0x3fc8b3;while((_0x3fc8b3=_0x7b50e2[_0x2588b4(0xbd)](_0x4ae936))!==null){const _0x1a9617=_0x3fc8b3[0x1]?.[_0x2588b4(0xb0)]();_0x1a9617&&_0x1db8e5[_0x2588b4(0xb5)](_0x1a9617);}}const _0x570bae=[..._0x1db8e5][_0x2588b4(0x82)](getPackageName)[_0x2588b4(0x9f)](_0x679993=>!ALLOWED_REACT_MODULE_IMPORTS[_0x2588b4(0xc7)](_0x679993));if(_0x570bae['length']>0x0)throw CliErrors[_0x2588b4(0x87)](_0x2588b4(0xb8)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x2588b4(0xb6)+[...new Set(_0x570bae)]['join'](',\x20'));}export function validateReactModuleSource(_0x56576a){const _0x34b320=a7_0x17b876;if(!_0x56576a[_0x34b320(0xb0)]())throw CliErrors[_0x34b320(0x87)](_0x34b320(0x97));if(PAGE_LEVEL_PATTERNS[_0x34b320(0xc2)](_0x2b7bb2=>_0x2b7bb2[_0x34b320(0xc8)](_0x56576a)))throw CliErrors[_0x34b320(0x87)](_0x34b320(0xd0));validateAllowedImports(_0x56576a);}function buildArtifactInput(_0x4925f3){const _0x1dd5ba=a7_0x17b876,_0x1f77b8=readSourceFile(_0x4925f3[_0x1dd5ba(0x8b)](_0x1dd5ba(0xbf))),_0x214ec3=_0x4925f3[_0x1dd5ba(0x8b)](_0x1dd5ba(0x81))['trim'](),_0x75d7da=parseMetadata(_0x4925f3[_0x1dd5ba(0x8b)](_0x1dd5ba(0x88)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x214ec3?{'name':_0x214ec3}:{},'content':_0x1f77b8,..._0x75d7da?{'metadata':_0x75d7da}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x1717e5){const _0x116f7d=a7_0x17b876;return{'id':_0x1717e5['id'],'name':_0x1717e5[_0x116f7d(0x81)],'artifactType':_0x1717e5[_0x116f7d(0xbe)],'source':_0x1717e5['source'],'favorite':_0x1717e5['favorite'],'deleted':_0x1717e5[_0x116f7d(0xad)],'createTime':_0x1717e5[_0x116f7d(0xc0)],'updateTime':_0x1717e5[_0x116f7d(0x83)]};}function detailArtifact(_0x5ee499){const _0x320984=a7_0x17b876;return{'id':_0x5ee499['id'],'appCode':_0x5ee499[_0x320984(0xab)],'name':_0x5ee499[_0x320984(0x81)],'artifactType':_0x5ee499['artifactType'],'source':_0x5ee499[_0x320984(0xa7)],'favorite':_0x5ee499[_0x320984(0xc5)],'deleted':_0x5ee499['deleted'],'content':_0x5ee499[_0x320984(0x7f)]??'','compiledContent':_0x5ee499[_0x320984(0xba)],'metadata':_0x5ee499[_0x320984(0x88)]??{},'createTime':_0x5ee499['createTime'],'updateTime':_0x5ee499[_0x320984(0x83)]};}function readFavoriteFlag(_0x163b95){const _0x5a6992=a7_0x17b876,_0x2a46f2=_0x163b95[_0x5a6992(0xa0)](_0x5a6992(0xc5));return _0x2a46f2===undefined||_0x2a46f2===null||_0x2a46f2===''?undefined:_0x163b95[_0x5a6992(0xcc)]('favorite');}function a7_0x8da4(_0x46182f,_0x1913a4){_0x46182f=_0x46182f-0x7d;const _0x522052=a7_0x5220();let _0x8da416=_0x522052[_0x46182f];return _0x8da416;}const artifactList={'service':a7_0x17b876(0xcd),'command':a7_0x17b876(0x84),'description':a7_0x17b876(0x98),'risk':a7_0x17b876(0x94),'flags':[{'name':a7_0x17b876(0xa7),'type':a7_0x17b876(0x95),'description':a7_0x17b876(0x8e)},{'name':'favorite','type':'boolean','description':a7_0x17b876(0x80)},VERBOSE_FLAG],async 'execute'(_0x4ad915){const _0x2ed87a=a7_0x17b876,_0x596087=await listRuntimeArtifacts(_0x4ad915[_0x2ed87a(0xab)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x4ad915[_0x2ed87a(0x8b)](_0x2ed87a(0xa7))?{'source':_0x4ad915[_0x2ed87a(0x8b)](_0x2ed87a(0xa7))}:{},...readFavoriteFlag(_0x4ad915)!==undefined?{'favorite':readFavoriteFlag(_0x4ad915)}:{}});return{'ok':!![],'data':{'total':_0x596087['length'],'items':_0x4ad915['bool'](_0x2ed87a(0x9c))?_0x596087:_0x596087[_0x2ed87a(0x82)](summarizeArtifact)}};}},artifactDetail={'service':a7_0x17b876(0xcd),'command':a7_0x17b876(0xac),'description':a7_0x17b876(0x92),'risk':a7_0x17b876(0x94),'flags':[{...ID_FLAG,'description':a7_0x17b876(0xc1)}],async 'execute'(_0x36454f){const _0x43a484=a7_0x17b876,_0x5da06f=await getRuntimeArtifact(_0x36454f['num']('id'),_0x36454f[_0x43a484(0xab)]);return{'ok':!![],'data':detailArtifact(_0x5da06f)};}},artifactCreate={'service':'artifact','command':a7_0x17b876(0x9e),'description':'Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':a7_0x17b876(0x8d),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x4cb23a){const _0x3e4d8a=a7_0x17b876,_0x59056b=buildArtifactInput(_0x4cb23a),_0x59066c=await createRuntimeArtifact(_0x4cb23a['appCode'],_0x59056b);return{'ok':!![],'data':detailArtifact(_0x59066c),'message':_0x3e4d8a(0xa2)+_0x59066c['id']+(_0x59066c[_0x3e4d8a(0x81)]?'\x20('+_0x59066c[_0x3e4d8a(0x81)]+')':'')};},async 'dryRun'(_0x2a7b50){const _0x3e41aa=a7_0x17b876,_0x4e20dc=buildArtifactInput(_0x2a7b50);return dryRun(_0x3e41aa(0x93),_0x3e41aa(0x8c))[_0x3e41aa(0xae)]({'appCode':_0x2a7b50[_0x3e41aa(0xab)],..._0x4e20dc})['description'](_0x3e41aa(0xaf))[_0x3e41aa(0xb2)]();}},artifactUpdate={'service':a7_0x17b876(0xcd),'command':a7_0x17b876(0xbc),'description':a7_0x17b876(0xa1),'risk':a7_0x17b876(0x8d),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x47cd68){const _0x557c43=a7_0x17b876,_0x28cffe=_0x47cd68[_0x557c43(0x8f)]('id'),_0x39557f=buildArtifactInput(_0x47cd68),_0x12d16c=await updateRuntimeArtifact(_0x28cffe,_0x47cd68['appCode'],_0x39557f);return{'ok':!![],'data':detailArtifact(_0x12d16c),'message':_0x557c43(0xb3)+_0x12d16c['id']+(_0x12d16c['name']?'\x20('+_0x12d16c[_0x557c43(0x81)]+')':'')};},async 'dryRun'(_0x2be995){const _0x2e0f7a=a7_0x17b876,_0x2f4933=_0x2be995['num']('id'),_0x5a0fad=buildArtifactInput(_0x2be995);return dryRun(_0x2e0f7a(0x93),_0x2e0f7a(0xb1)+_0x2f4933+'/update')[_0x2e0f7a(0xae)]({'appCode':_0x2be995['appCode'],..._0x5a0fad})[_0x2e0f7a(0x8a)](_0x2e0f7a(0xb4)+_0x2f4933)['build']();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a7_0x5e9833=a7_0x200d;(function(_0x202268,_0x22214b){const _0x38f475=a7_0x200d,_0x3c5d83=_0x202268();while(!![]){try{const _0x4746e3=parseInt(_0x38f475(0x1a6))/0x1*(-parseInt(_0x38f475(0x1be))/0x2)+parseInt(_0x38f475(0x1a7))/0x3+parseInt(_0x38f475(0x1c9))/0x4+-parseInt(_0x38f475(0x1a3))/0x5+parseInt(_0x38f475(0x1d6))/0x6*(parseInt(_0x38f475(0x1df))/0x7)+parseInt(_0x38f475(0x1e2))/0x8+-parseInt(_0x38f475(0x19b))/0x9;if(_0x4746e3===_0x22214b)break;else _0x3c5d83['push'](_0x3c5d83['shift']());}catch(_0x3bd18f){_0x3c5d83['push'](_0x3c5d83['shift']());}}}(a7_0x1164,0xa2c6a));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 a7_0x200d(_0x1e5dd4,_0x40c117){_0x1e5dd4=_0x1e5dd4-0x19a;const _0x1164ed=a7_0x1164();let _0x200d79=_0x1164ed[_0x1e5dd4];return _0x200d79;}import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a7_0x5e9833(0x1b4),ARTIFACT_SOURCE_AGENT=a7_0x5e9833(0x19a),ALLOWED_REACT_MODULE_IMPORTS=['react',a7_0x5e9833(0x1c2),'lodash',a7_0x5e9833(0x1dd),a7_0x5e9833(0x1bf),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a7_0x5e9833(0x1ab)](',\x20');const IMPORT_SOURCE_PATTERNS=[/\bimport\s+(?:type\s+)?(?:[^'";]*?\s+from\s+)?["']([^"']+)["']/g,/\bexport\s+(?:type\s+)?[^'";]*?\s+from\s+["']([^"']+)["']/g,/\bimport\s*\(\s*["']([^"']+)["']\s*\)/g,/\brequire\s*\(\s*["']([^"']+)["']\s*\)/g],PAGE_LEVEL_PATTERNS=[/<!doctype\s+html/i,/<\s*html\b/i,/\bcreateRoot\s*\(/,/\bReactDOM\s*\.\s*render\s*\(/,/\bReactDOM\s*\.\s*createRoot\s*\(/],FILE_FLAG={'name':a7_0x5e9833(0x1c1),'type':a7_0x5e9833(0x1d9),'required':!![],'description':a7_0x5e9833(0x1d2)},ARTIFACT_NAME_FLAG={'name':'name','type':'string','description':a7_0x5e9833(0x1b8)},METADATA_FLAG={'name':a7_0x5e9833(0x1a0),'type':a7_0x5e9833(0x1d9),'description':'Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped'};function isPlainObject(_0x50e1e6){const _0x3f10a8=a7_0x5e9833;return typeof _0x50e1e6===_0x3f10a8(0x1e1)&&_0x50e1e6!==null&&!Array[_0x3f10a8(0x1a4)](_0x50e1e6);}function readSourceFile(_0x4a2448){const _0xeba7d3=a7_0x5e9833;if(!_0x4a2448)throw CliErrors[_0xeba7d3(0x1af)]('File\x20path\x20is\x20required.');if(!existsSync(_0x4a2448))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x4a2448);if(!statSync(_0x4a2448)[_0xeba7d3(0x1dc)]())throw CliErrors[_0xeba7d3(0x1af)](_0xeba7d3(0x1a2)+_0x4a2448);const _0x38e9ad=readFileSync(_0x4a2448,'utf8');return validateReactModuleSource(_0x38e9ad),_0x38e9ad;}function parseMetadata(_0x2e0e1f){const _0x136253=a7_0x5e9833;if(!_0x2e0e1f)return undefined;let _0x3cca70;try{_0x3cca70=JSON['parse'](_0x2e0e1f);}catch{throw CliErrors[_0x136253(0x1af)](_0x136253(0x1b7)+_0x2e0e1f);}if(!isPlainObject(_0x3cca70))throw CliErrors[_0x136253(0x1af)](_0x136253(0x19e));const _0x24fe47={..._0x3cca70};return delete _0x24fe47[_0x136253(0x1ba)],_0x24fe47;}function getPackageName(_0x21372d){if(_0x21372d['startsWith']('@')){const [_0x114d06,_0x4c4beb]=_0x21372d['split']('/');return _0x114d06&&_0x4c4beb?_0x114d06+'/'+_0x4c4beb:_0x21372d;}return _0x21372d['split']('/')[0x0]||_0x21372d;}function validateAllowedImports(_0x20d842){const _0x2b46a6=a7_0x5e9833,_0x2cac3b=new Set();for(const _0x5673f3 of IMPORT_SOURCE_PATTERNS){_0x5673f3['lastIndex']=0x0;let _0x2731e3;while((_0x2731e3=_0x5673f3[_0x2b46a6(0x1b0)](_0x20d842))!==null){const _0x25b27b=_0x2731e3[0x1]?.[_0x2b46a6(0x1d1)]();_0x25b27b&&_0x2cac3b[_0x2b46a6(0x1d0)](_0x25b27b);}}const _0xc011b5=[..._0x2cac3b][_0x2b46a6(0x1b2)](getPackageName)[_0x2b46a6(0x1c0)](_0x5cab04=>!ALLOWED_REACT_MODULE_IMPORTS[_0x2b46a6(0x1bc)](_0x5cab04));if(_0xc011b5[_0x2b46a6(0x1d4)]>0x0)throw CliErrors[_0x2b46a6(0x1af)](_0x2b46a6(0x1a8)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x2b46a6(0x1c7)+[...new Set(_0xc011b5)][_0x2b46a6(0x1ab)](',\x20'));}export function validateReactModuleSource(_0x59e86e){const _0x59868a=a7_0x5e9833;if(!_0x59e86e[_0x59868a(0x1d1)]())throw CliErrors[_0x59868a(0x1af)](_0x59868a(0x1cc));if(PAGE_LEVEL_PATTERNS[_0x59868a(0x1da)](_0x413aae=>_0x413aae['test'](_0x59e86e)))throw CliErrors[_0x59868a(0x1af)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x59e86e);}function buildArtifactInput(_0x1ea4a5){const _0xd949dc=a7_0x5e9833,_0x22f753=readSourceFile(_0x1ea4a5[_0xd949dc(0x1ae)](_0xd949dc(0x1c1))),_0x3a5453=_0x1ea4a5[_0xd949dc(0x1ae)](_0xd949dc(0x1a9))[_0xd949dc(0x1d1)](),_0x316ec3=parseMetadata(_0x1ea4a5['str'](_0xd949dc(0x1a0)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x3a5453?{'name':_0x3a5453}:{},'content':_0x22f753,..._0x316ec3?{'metadata':_0x316ec3}:{},'source':ARTIFACT_SOURCE_AGENT};}function a7_0x1164(){const _0x28a7e5=['5128452gKkQRR','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','read','--metadata\x20must\x20be\x20a\x20JSON\x20object.','flag','metadata','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','File\x20is\x20not\x20a\x20regular\x20file:\x20','749755vtKJmw','isArray','List\x20current-app\x20react_module\x20Artifacts','483149zKoUgk','850044QdEcdq','react_module\x20imports\x20are\x20limited\x20to:\x20','name','deleted','join','build','Preview:\x20create\x20react_module\x20Artifact','str','validation','exec','createTime','map','body','react_module','content','Artifact\x20ID','Invalid\x20JSON\x20for\x20--metadata:\x20','Artifact\x20display\x20name','updateTime','compiledContent','/client/artifact/create','includes','artifactType','2KpfwWL','antd','filter','file','react-dom','source','write','artifact','create','.\x20Unsupported:\x20','update','411580lUZKJJ','num','Show\x20one\x20Artifact\x20by\x20id','Artifact\x20source\x20file\x20is\x20blank.','POST','Created\x20Artifact\x20','description','add','trim','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','appCode','length','favorite','7770xWHPyW','Updated\x20Artifact\x20','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','string','some','verbose','isFile','dayjs','bool','1344KoYWmj','list','object','9878200iIMMfx','AGENT'];a7_0x1164=function(){return _0x28a7e5;};return a7_0x1164();}function summarizeArtifact(_0x1ae2fa){const _0x28170b=a7_0x5e9833;return{'id':_0x1ae2fa['id'],'name':_0x1ae2fa[_0x28170b(0x1a9)],'artifactType':_0x1ae2fa[_0x28170b(0x1bd)],'source':_0x1ae2fa[_0x28170b(0x1c3)],'favorite':_0x1ae2fa[_0x28170b(0x1d5)],'deleted':_0x1ae2fa[_0x28170b(0x1aa)],'createTime':_0x1ae2fa['createTime'],'updateTime':_0x1ae2fa[_0x28170b(0x1b9)]};}function detailArtifact(_0x145e36){const _0x4b111f=a7_0x5e9833;return{'id':_0x145e36['id'],'appCode':_0x145e36[_0x4b111f(0x1d3)],'name':_0x145e36[_0x4b111f(0x1a9)],'artifactType':_0x145e36[_0x4b111f(0x1bd)],'source':_0x145e36[_0x4b111f(0x1c3)],'favorite':_0x145e36['favorite'],'deleted':_0x145e36['deleted'],'content':_0x145e36[_0x4b111f(0x1b5)]??'','compiledContent':_0x145e36['compiledContent'],'metadata':_0x145e36['metadata']??{},'createTime':_0x145e36[_0x4b111f(0x1b1)],'updateTime':_0x145e36['updateTime']};}function readFavoriteFlag(_0x392dc6){const _0x338868=a7_0x5e9833,_0x2b332b=_0x392dc6[_0x338868(0x19f)](_0x338868(0x1d5));return _0x2b332b===undefined||_0x2b332b===null||_0x2b332b===''?undefined:_0x392dc6['bool']('favorite');}const artifactList={'service':a7_0x5e9833(0x1c5),'command':a7_0x5e9833(0x1e0),'description':a7_0x5e9833(0x1a5),'risk':a7_0x5e9833(0x19d),'flags':[{'name':a7_0x5e9833(0x1c3),'type':'string','description':a7_0x5e9833(0x19c)},{'name':a7_0x5e9833(0x1d5),'type':'boolean','description':'Optional\x20favorite-state\x20filter'},VERBOSE_FLAG],async 'execute'(_0x5ec83e){const _0x183697=a7_0x5e9833,_0x5efdec=await listRuntimeArtifacts(_0x5ec83e[_0x183697(0x1d3)],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x5ec83e[_0x183697(0x1ae)](_0x183697(0x1c3))?{'source':_0x5ec83e[_0x183697(0x1ae)](_0x183697(0x1c3))}:{},...readFavoriteFlag(_0x5ec83e)!==undefined?{'favorite':readFavoriteFlag(_0x5ec83e)}:{}});return{'ok':!![],'data':{'total':_0x5efdec[_0x183697(0x1d4)],'items':_0x5ec83e[_0x183697(0x1de)](_0x183697(0x1db))?_0x5efdec:_0x5efdec[_0x183697(0x1b2)](summarizeArtifact)}};}},artifactDetail={'service':a7_0x5e9833(0x1c5),'command':'detail','description':a7_0x5e9833(0x1cb),'risk':a7_0x5e9833(0x19d),'flags':[{...ID_FLAG,'description':'Artifact\x20ID'}],async 'execute'(_0x432d66){const _0x169aa1=a7_0x5e9833,_0x5643fe=await getRuntimeArtifact(_0x432d66[_0x169aa1(0x1ca)]('id'),_0x432d66[_0x169aa1(0x1d3)]);return{'ok':!![],'data':detailArtifact(_0x5643fe)};}},artifactCreate={'service':a7_0x5e9833(0x1c5),'command':a7_0x5e9833(0x1c6),'description':a7_0x5e9833(0x1a1),'risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x1a422b){const _0x255a81=a7_0x5e9833,_0x5a4252=buildArtifactInput(_0x1a422b),_0x2e366d=await createRuntimeArtifact(_0x1a422b[_0x255a81(0x1d3)],_0x5a4252);return{'ok':!![],'data':detailArtifact(_0x2e366d),'message':_0x255a81(0x1ce)+_0x2e366d['id']+(_0x2e366d['name']?'\x20('+_0x2e366d[_0x255a81(0x1a9)]+')':'')};},async 'dryRun'(_0x4df53e){const _0x40d0b8=a7_0x5e9833,_0x1fd5b8=buildArtifactInput(_0x4df53e);return dryRun(_0x40d0b8(0x1cd),_0x40d0b8(0x1bb))[_0x40d0b8(0x1b3)]({'appCode':_0x4df53e[_0x40d0b8(0x1d3)],..._0x1fd5b8})[_0x40d0b8(0x1cf)](_0x40d0b8(0x1ad))['build']();}},artifactUpdate={'service':a7_0x5e9833(0x1c5),'command':a7_0x5e9833(0x1c8),'description':a7_0x5e9833(0x1d8),'risk':a7_0x5e9833(0x1c4),'flags':[{...ID_FLAG,'description':a7_0x5e9833(0x1b6)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x5db60d){const _0x2e6f24=a7_0x5e9833,_0x58b521=_0x5db60d[_0x2e6f24(0x1ca)]('id'),_0x40884d=buildArtifactInput(_0x5db60d),_0x5762f5=await updateRuntimeArtifact(_0x58b521,_0x5db60d['appCode'],_0x40884d);return{'ok':!![],'data':detailArtifact(_0x5762f5),'message':_0x2e6f24(0x1d7)+_0x5762f5['id']+(_0x5762f5[_0x2e6f24(0x1a9)]?'\x20('+_0x5762f5[_0x2e6f24(0x1a9)]+')':'')};},async 'dryRun'(_0x45cf13){const _0x1f106e=a7_0x5e9833,_0x173e5e=_0x45cf13[_0x1f106e(0x1ca)]('id'),_0x2ee6bd=buildArtifactInput(_0x45cf13);return dryRun(_0x1f106e(0x1cd),'/client/artifact/'+_0x173e5e+'/update')[_0x1f106e(0x1b3)]({'appCode':_0x45cf13[_0x1f106e(0x1d3)],..._0x2ee6bd})['description']('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x173e5e)[_0x1f106e(0x1ac)]();}};export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x5a53b1=a8_0x26f5;(function(_0x4caca4,_0x5273d9){const _0x213b93=a8_0x26f5,_0x1de670=_0x4caca4();while(!![]){try{const _0x577088=-parseInt(_0x213b93(0xe5))/0x1+parseInt(_0x213b93(0xc8))/0x2*(-parseInt(_0x213b93(0xc3))/0x3)+-parseInt(_0x213b93(0xf0))/0x4*(parseInt(_0x213b93(0xea))/0x5)+parseInt(_0x213b93(0xf1))/0x6*(-parseInt(_0x213b93(0xa3))/0x7)+-parseInt(_0x213b93(0xb2))/0x8*(-parseInt(_0x213b93(0xd5))/0x9)+-parseInt(_0x213b93(0xde))/0xa+parseInt(_0x213b93(0xa5))/0xb;if(_0x577088===_0x5273d9)break;else _0x1de670['push'](_0x1de670['shift']());}catch(_0x338be8){_0x1de670['push'](_0x1de670['shift']());}}}(a8_0x3cc6,0x874e7));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a8_0x3cc6(){const _0x49e048=['`auth\x20login`\x20does\x20not\x20support\x20--yes.','push','=ak_xxx','\x20Current\x20env:\x20','write','Write\x20to\x20global\x20config\x20(default)','daily','Option\x20A:\x20','Tip:\x20you\x20can\x20also\x20run:','read','accessKey','AccessKey\x20saved\x20to\x20','21dAVURn','Then\x20verify\x20with:\x20','Use\x20`','isTTY','Shorthand\x20for\x20--access-key','60442lMQNxq','slice','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','No\x20AccessKey\x20found\x20in\x20','AccessKey\x20cleared\x20from\x20','\x20auth\x20status','AccessKey:\x20','development','stdout','join','trim','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','9CAUTeV','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','\x20Verify:\x20','Option\x20B:\x20apps\x20config\x20(','init','str','auth','4386910mLkgAk','test','\x20env\x20var','global','Invalid\x20accessKey\x20format:\x20\x22','Clear\x20accessKey\x20from\x20config','project','876383CpzdDv','\x20config','cancelled','\x20auth\x20login\x20--access-key\x20<ak_xxx>','Auth\x20config\x20reinitialized\x20in\x20','505265mDVtiv','boolean','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','\x20config.','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','access-key','24HJmRVp','12vBOhVg','\x20\x20export\x20','\x20(via\x20','status','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','Clear\x20from\x20global\x20config\x20(default)','string','production','Show\x20current\x20authentication\x20status','nonInteractive','userCenterDisplayName','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Read\x20from\x20global\x20config\x20(default)','72457KpqHnC','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','20007383LmJYjw','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','login','validation','bool','length','repeat','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','AccessKey\x20(ak_xxx...)','\x20config.\x20Nothing\x20to\x20clear.','\x20scope.','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','Option\x20C:\x20environment\x20variable','7112024KrEsNg','yes','ACCESS_KEY','info','env'];a8_0x3cc6=function(){return _0x49e048;};return a8_0x3cc6();}import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';function a8_0x26f5(_0x5b2717,_0x17b1cd){_0x5b2717=_0x5b2717-0xa1;const _0x3cc61f=a8_0x3cc6();let _0x26f5aa=_0x3cc61f[_0x5b2717];return _0x26f5aa;}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 _0x32e24f=a8_0x26f5;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x32e24f(0xfb)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x32e24f(0xbf)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x32e24f(0xe8));}function buildAccessKeySetupGuide(){const _0x4261da=a8_0x26f5;return[_0x4261da(0xd6)+PRODUCT_CONFIG['userCenterDisplayName']+':',USER_ACCESS_KEY_CREATE_URL,_0x4261da(0xfc)+CLI_BIN_NAME+_0x4261da(0xcb)][_0x4261da(0xd2)]('\x0a');}function canPromptForAccessKey(_0x482a2d){const _0x408e21=a8_0x26f5;return!_0x482a2d[_0x408e21(0xfa)]&&process['stdin'][_0x408e21(0xc6)]!==![]&&process[_0x408e21(0xd1)][_0x408e21(0xc6)]!==![];}function resolveAuthScopeFlags(_0x6a1c60){const _0x4c4716=a8_0x26f5;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x6a1c60[_0x4c4716(0xa9)](_0x4c4716(0xe1)),'explicitProject':_0x6a1c60[_0x4c4716(0xa9)](_0x4c4716(0xe4)),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x500025){const _0x501268=a8_0x26f5;let _0x36eb9f=(_0x500025[_0x501268(0xdc)]('access-key')||_0x500025[_0x501268(0xdc)]('ak')||'')[_0x501268(0xd3)]();const _0x59111c=(_0x500025[_0x501268(0xdc)]('env')||'')[_0x501268(0xd3)]();if(!_0x36eb9f&&canPromptForAccessKey(_0x500025))try{showAccessKeyCreateHint(),_0x36eb9f=await promptAccessKey('');}catch(_0x249d8f){if(isAbortPrompt(_0x249d8f))throw CliErrors[_0x501268(0xe7)]();throw _0x249d8f;}if(!_0x36eb9f)throw CliErrors[_0x501268(0xa8)]('Missing\x20accessKey.',buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x501268(0xdf)](_0x36eb9f))throw CliErrors['validation'](_0x501268(0xe2)+_0x36eb9f+'\x22',_0x501268(0xd7));if(!_0x59111c)return{'accessKey':_0x36eb9f};const _0x2d6672=normalizeEnv(_0x59111c);return{'accessKey':_0x36eb9f,'env':isDaily(_0x2d6672)?_0x501268(0xbd):isDev(_0x2d6672)?_0x501268(0xd0):_0x501268(0xf8)};}export const authDefinitions=[{'service':a8_0x5a53b1(0xdd),'command':a8_0x5a53b1(0xa7),'description':a8_0x5a53b1(0xf5),'risk':a8_0x5a53b1(0xbb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x5a53b1(0xef),'type':a8_0x5a53b1(0xf7),'description':a8_0x5a53b1(0xad)},{'name':'ak','type':a8_0x5a53b1(0xf7),'description':a8_0x5a53b1(0xc7)},{'name':a8_0x5a53b1(0xe1),'type':a8_0x5a53b1(0xeb),'description':a8_0x5a53b1(0xbc),'default':!![]},{'name':a8_0x5a53b1(0xe4),'type':a8_0x5a53b1(0xeb),'description':a8_0x5a53b1(0xa1),'default':![]}],async 'execute'(_0x5919c8){const _0x10637e=a8_0x5a53b1;if(_0x5919c8[_0x10637e(0xa9)](_0x10637e(0xb3)))throw CliErrors[_0x10637e(0xa8)](_0x10637e(0xb7),_0x10637e(0xc5)+CLI_BIN_NAME+_0x10637e(0xa6)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x20ddc4=(_0x5919c8[_0x10637e(0xdc)](_0x10637e(0xef))||_0x5919c8[_0x10637e(0xdc)]('ak')||'')[_0x10637e(0xd3)]();if(!_0x20ddc4&&_0x5919c8[_0x10637e(0xfa)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x44eaf3=await resolveAuthWriteInput(_0x5919c8),_0x28b922=resolveAuthScopeFlags(_0x5919c8),_0x497dce=readScopedConfig(_0x28b922);_0x497dce[_0x10637e(0xc1)]=_0x44eaf3[_0x10637e(0xc1)];_0x44eaf3['env']&&(_0x497dce[_0x10637e(0xb6)]=_0x44eaf3[_0x10637e(0xb6)]);writeScopedConfig(_0x497dce,_0x28b922);const _0x3fe0de=_0x28b922[_0x10637e(0xe1)]?_0x10637e(0xe1):_0x10637e(0xe4),_0xbbab7=_0x497dce[_0x10637e(0xb6)]?_0x10637e(0xba)+_0x497dce['env']+'.':'';return{'ok':!![],'message':_0x10637e(0xc2)+_0x3fe0de+_0x10637e(0xed)+_0xbbab7+_0x10637e(0xd9)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a8_0x5a53b1(0xdd),'command':a8_0x5a53b1(0xdb),'description':a8_0x5a53b1(0xd8),'risk':a8_0x5a53b1(0xbb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x5a53b1(0xef),'type':a8_0x5a53b1(0xf7),'description':a8_0x5a53b1(0xad)},{'name':'ak','type':a8_0x5a53b1(0xf7),'description':a8_0x5a53b1(0xc7)},{'name':'env','type':a8_0x5a53b1(0xf7),'description':a8_0x5a53b1(0xa4)},{'name':a8_0x5a53b1(0xe1),'type':a8_0x5a53b1(0xeb),'description':'Write\x20to\x20global\x20config\x20(default)','default':!![]},{'name':a8_0x5a53b1(0xe4),'type':a8_0x5a53b1(0xeb),'description':a8_0x5a53b1(0xa1),'default':![]}],async 'execute'(_0x22e4d1){const _0x1e1cf9=a8_0x5a53b1,_0x2479e5=await resolveAuthWriteInput(_0x22e4d1),_0x3bcc86=resolveAuthScopeFlags(_0x22e4d1),_0x50cea9={'accessKey':_0x2479e5[_0x1e1cf9(0xc1)]};_0x2479e5['env']&&(_0x50cea9['env']=_0x2479e5[_0x1e1cf9(0xb6)]);writeScopedConfig(_0x50cea9,_0x3bcc86);const _0x872691=_0x3bcc86[_0x1e1cf9(0xe1)]?_0x1e1cf9(0xe1):'project',_0x4040d4=_0x50cea9[_0x1e1cf9(0xb6)]?'\x20Current\x20env:\x20'+_0x50cea9[_0x1e1cf9(0xb6)]+'.':'';return{'ok':!![],'message':_0x1e1cf9(0xe9)+_0x872691+_0x1e1cf9(0xaf)+_0x4040d4+'\x20Verify:\x20'+CLI_BIN_NAME+_0x1e1cf9(0xce)};}},{'service':a8_0x5a53b1(0xdd),'command':'logout','description':a8_0x5a53b1(0xe3),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a8_0x5a53b1(0xeb),'description':a8_0x5a53b1(0xf6),'default':!![]},{'name':a8_0x5a53b1(0xe4),'type':'boolean','description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x251e62){const _0x5b2b52=a8_0x5a53b1,_0x383695=resolveAuthScopeFlags(_0x251e62),_0x6815a8=readScopedConfig(_0x383695),_0x3d530e=!!_0x6815a8['accessKey'];delete _0x6815a8[_0x5b2b52(0xc1)],writeScopedConfig(_0x6815a8,_0x383695);const _0x599d52=_0x383695[_0x5b2b52(0xe1)]?_0x5b2b52(0xe1):'project';if(_0x3d530e)return{'ok':!![],'message':_0x5b2b52(0xcd)+_0x599d52+_0x5b2b52(0xed)};return{'ok':!![],'message':_0x5b2b52(0xcc)+_0x599d52+_0x5b2b52(0xae)};}},{'service':a8_0x5a53b1(0xdd),'command':a8_0x5a53b1(0xf4),'description':a8_0x5a53b1(0xf9),'risk':a8_0x5a53b1(0xc0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x5a53b1(0xe1),'type':a8_0x5a53b1(0xeb),'description':a8_0x5a53b1(0xa2),'default':!![]},{'name':a8_0x5a53b1(0xe4),'type':'boolean','description':a8_0x5a53b1(0xac),'default':![]}],async 'execute'(_0x3f0044){const _0x3b624b=a8_0x5a53b1,_0x3f3dd8=resolveAuthScopeFlags(_0x3f0044),_0x518958=readScopedConfig(_0x3f3dd8),_0x1ef045=productEnvName(_0x3b624b(0xb4)),_0x2318b4=productEnv(_0x3b624b(0xb4))||undefined,_0x7a7824=_0x518958['accessKey']||undefined,_0x532dc2=_0x2318b4||_0x7a7824,_0x4b4f5b=_0x2318b4?_0x1ef045+_0x3b624b(0xe0):_0x7a7824?(_0x3f3dd8['global']?_0x3b624b(0xe1):_0x3b624b(0xe4))+_0x3b624b(0xe6):null,_0x34a3f3=['Auth\x20mode:\x20'+AUTH_MODE['ClientAk']];if(_0x532dc2){const _0x1d8335=_0x532dc2[_0x3b624b(0xaa)]>0x8?''+_0x532dc2[_0x3b624b(0xc9)](0x0,0x8)+'*'[_0x3b624b(0xab)](_0x532dc2[_0x3b624b(0xaa)]-0x8):_0x532dc2;_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xcf)+_0x1d8335+(_0x4b4f5b?_0x3b624b(0xf3)+_0x4b4f5b+')':''));}return!_0x532dc2&&(_0x34a3f3[_0x3b624b(0xb8)](''),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xca)),_0x34a3f3['push'](''),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xbe)+CLI_BIN_NAME+_0x3b624b(0xec)),_0x34a3f3[_0x3b624b(0xb8)](''),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xda)+PRODUCT_CONFIG['newConfigFileName']+')'),_0x34a3f3['push'](_0x3b624b(0xb0)),_0x34a3f3[_0x3b624b(0xb8)](''),_0x34a3f3['push'](_0x3b624b(0xb1)),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xf2)+_0x1ef045+_0x3b624b(0xb9)),_0x34a3f3[_0x3b624b(0xb8)](''),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xc4)+CLI_BIN_NAME+_0x3b624b(0xce)),_0x34a3f3[_0x3b624b(0xb8)](_0x3b624b(0xd4)+CLI_BIN_NAME+'\x20doctor')),{'ok':!![],'message':_0x34a3f3[_0x3b624b(0xd2)]('\x0a')};}},{'service':'auth','command':a8_0x5a53b1(0xb5),'description':a8_0x5a53b1(0xee),'risk':a8_0x5a53b1(0xc0),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x4e527c){const _0x397a7c=a8_0x5a53b1,_0x60e5d3=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x60e5d3,'meta':{'env':_0x4e527c['envName']??_0x397a7c(0xf8)}}};}}];
|
|
1
|
+
const a8_0x4e542e=a8_0x181f;(function(_0x4c6a89,_0x2ce10c){const _0x38f835=a8_0x181f,_0x215f69=_0x4c6a89();while(!![]){try{const _0x34cdd8=-parseInt(_0x38f835(0x1a7))/0x1*(-parseInt(_0x38f835(0x1c1))/0x2)+parseInt(_0x38f835(0x1af))/0x3+parseInt(_0x38f835(0x1d8))/0x4*(-parseInt(_0x38f835(0x1dd))/0x5)+parseInt(_0x38f835(0x1ba))/0x6+-parseInt(_0x38f835(0x1bd))/0x7*(parseInt(_0x38f835(0x1f8))/0x8)+-parseInt(_0x38f835(0x1cc))/0x9*(parseInt(_0x38f835(0x1e7))/0xa)+parseInt(_0x38f835(0x1ed))/0xb;if(_0x34cdd8===_0x2ce10c)break;else _0x215f69['push'](_0x215f69['shift']());}catch(_0x4939a4){_0x215f69['push'](_0x215f69['shift']());}}}(a8_0x2499,0xa001d));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';function a8_0x181f(_0x48fe9a,_0x4ed09){_0x48fe9a=_0x48fe9a-0x1a5;const _0x24998e=a8_0x2499();let _0x181f31=_0x24998e[_0x48fe9a];return _0x181f31;}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 _0x57a0c1=a8_0x181f;writeCliSideChannelLine(_0x57a0c1(0x1b9)+PRODUCT_CONFIG[_0x57a0c1(0x1b2)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x57a0c1(0x1cb)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x57a0c1(0x1a5));}function buildAccessKeySetupGuide(){const _0xe71a8b=a8_0x181f;return[_0xe71a8b(0x1b9)+PRODUCT_CONFIG['userCenterDisplayName']+':',USER_ACCESS_KEY_CREATE_URL,_0xe71a8b(0x1d6)+CLI_BIN_NAME+_0xe71a8b(0x1b6)][_0xe71a8b(0x1bb)]('\x0a');}function a8_0x2499(){const _0x7ed857=['repeat','stdin','\x20auth\x20status','env','cancelled','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Auth\x20config\x20reinitialized\x20in\x20','1598708qoOCcs','AccessKey\x20(ak_xxx...)','boolean','\x20scope.','\x20doctor','15qXbLGe','bool','accessKey','\x20Verify:\x20','Then\x20verify\x20with:\x20','\x20Current\x20env:\x20','\x20config','ACCESS_KEY','\x20config.\x20Nothing\x20to\x20clear.','\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`','259510TXuiMZ','test','isTTY','Option\x20B:\x20apps\x20config\x20(','str','write','11332288BrVnVj','slice','project','No\x20AccessKey\x20found\x20in\x20','read','Clear\x20from\x20global\x20config\x20(default)','logout','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','Shorthand\x20for\x20--access-key','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','9599008AmaBLY','\x20auth\x20login\x20--access-key\x20<ak_xxx>','global','39CNLjVl','length','nonInteractive','trim','\x20(via\x20','=ak_xxx','Use\x20`','Option\x20C:\x20environment\x20variable','2845254MFyKYJ','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','Missing\x20accessKey.','userCenterDisplayName','production','Write\x20to\x20global\x20config\x20(default)','push','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','auth','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','738954JhUopm','join','Auth\x20mode:\x20','7fhkKuR','\x20config.','global-default','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','54170JmNvfr','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','ClientAk','development','\x20\x20export\x20','access-key','Invalid\x20accessKey\x20format:\x20\x22','validation','AccessKey\x20saved\x20to\x20','Tip:\x20you\x20can\x20also\x20run:','36KXOapk','`auth\x20login`\x20does\x20not\x20support\x20--yes.','daily','string','login'];a8_0x2499=function(){return _0x7ed857;};return a8_0x2499();}function canPromptForAccessKey(_0x139b53){const _0x317f7b=a8_0x181f;return!_0x139b53[_0x317f7b(0x1a9)]&&process[_0x317f7b(0x1d2)][_0x317f7b(0x1e9)]!==![]&&process['stdout'][_0x317f7b(0x1e9)]!==![];}function resolveAuthScopeFlags(_0x25f084){const _0x534028=a8_0x181f;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x25f084[_0x534028(0x1de)]('global'),'explicitProject':_0x25f084['bool']('project'),'policy':_0x534028(0x1bf)}));}async function resolveAuthWriteInput(_0x5ee946){const _0x35fe2e=a8_0x181f;let _0x1370db=(_0x5ee946[_0x35fe2e(0x1eb)](_0x35fe2e(0x1c7))||_0x5ee946['str']('ak')||'')[_0x35fe2e(0x1aa)]();const _0x4f7012=(_0x5ee946['str']('env')||'')[_0x35fe2e(0x1aa)]();if(!_0x1370db&&canPromptForAccessKey(_0x5ee946))try{showAccessKeyCreateHint(),_0x1370db=await promptAccessKey('');}catch(_0x4ef819){if(isAbortPrompt(_0x4ef819))throw CliErrors[_0x35fe2e(0x1d5)]();throw _0x4ef819;}if(!_0x1370db)throw CliErrors[_0x35fe2e(0x1c9)](_0x35fe2e(0x1b1),buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x35fe2e(0x1e8)](_0x1370db))throw CliErrors[_0x35fe2e(0x1c9)](_0x35fe2e(0x1c8)+_0x1370db+'\x22','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0x4f7012)return{'accessKey':_0x1370db};const _0x4487fb=normalizeEnv(_0x4f7012);return{'accessKey':_0x1370db,'env':isDaily(_0x4487fb)?_0x35fe2e(0x1ce):isDev(_0x4487fb)?_0x35fe2e(0x1c5):_0x35fe2e(0x1b3)};}export const authDefinitions=[{'service':a8_0x4e542e(0x1b8),'command':a8_0x4e542e(0x1d0),'description':'Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','risk':a8_0x4e542e(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x4e542e(0x1c7),'type':'string','description':a8_0x4e542e(0x1d9)},{'name':'ak','type':a8_0x4e542e(0x1cf),'description':a8_0x4e542e(0x1f6)},{'name':a8_0x4e542e(0x1a6),'type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1b4),'default':!![]},{'name':a8_0x4e542e(0x1ef),'type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1b0),'default':![]}],async 'execute'(_0x2022e2){const _0x51a230=a8_0x4e542e;if(_0x2022e2[_0x51a230(0x1de)]('yes'))throw CliErrors[_0x51a230(0x1c9)](_0x51a230(0x1cd),_0x51a230(0x1ad)+CLI_BIN_NAME+_0x51a230(0x1e6)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x20828f=(_0x2022e2[_0x51a230(0x1eb)](_0x51a230(0x1c7))||_0x2022e2['str']('ak')||'')['trim']();if(!_0x20828f&&_0x2022e2[_0x51a230(0x1a9)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x4dc902=await resolveAuthWriteInput(_0x2022e2),_0x1f80b8=resolveAuthScopeFlags(_0x2022e2),_0x309ab6=readScopedConfig(_0x1f80b8);_0x309ab6[_0x51a230(0x1df)]=_0x4dc902[_0x51a230(0x1df)];_0x4dc902[_0x51a230(0x1d4)]&&(_0x309ab6[_0x51a230(0x1d4)]=_0x4dc902[_0x51a230(0x1d4)]);writeScopedConfig(_0x309ab6,_0x1f80b8);const _0x3929fe=_0x1f80b8[_0x51a230(0x1a6)]?'global':_0x51a230(0x1ef),_0x719650=_0x309ab6[_0x51a230(0x1d4)]?_0x51a230(0x1e2)+_0x309ab6[_0x51a230(0x1d4)]+'.':'';return{'ok':!![],'message':_0x51a230(0x1ca)+_0x3929fe+_0x51a230(0x1be)+_0x719650+_0x51a230(0x1e0)+CLI_BIN_NAME+_0x51a230(0x1d3)};}},{'service':a8_0x4e542e(0x1b8),'command':'init','description':a8_0x4e542e(0x1c0),'risk':a8_0x4e542e(0x1ec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':a8_0x4e542e(0x1cf),'description':a8_0x4e542e(0x1d9)},{'name':'ak','type':a8_0x4e542e(0x1cf),'description':a8_0x4e542e(0x1f6)},{'name':'env','type':a8_0x4e542e(0x1cf),'description':a8_0x4e542e(0x1f4)},{'name':a8_0x4e542e(0x1a6),'type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1b4),'default':!![]},{'name':a8_0x4e542e(0x1ef),'type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1b0),'default':![]}],async 'execute'(_0x3aab76){const _0x73fc51=a8_0x4e542e,_0x59c8a1=await resolveAuthWriteInput(_0x3aab76),_0x19897b=resolveAuthScopeFlags(_0x3aab76),_0x32a389={'accessKey':_0x59c8a1['accessKey']};_0x59c8a1['env']&&(_0x32a389[_0x73fc51(0x1d4)]=_0x59c8a1[_0x73fc51(0x1d4)]);writeScopedConfig(_0x32a389,_0x19897b);const _0x22b512=_0x19897b[_0x73fc51(0x1a6)]?_0x73fc51(0x1a6):'project',_0x238ad4=_0x32a389['env']?_0x73fc51(0x1e2)+_0x32a389['env']+'.':'';return{'ok':!![],'message':_0x73fc51(0x1d7)+_0x22b512+_0x73fc51(0x1db)+_0x238ad4+_0x73fc51(0x1e0)+CLI_BIN_NAME+'\x20auth\x20status'};}},{'service':a8_0x4e542e(0x1b8),'command':a8_0x4e542e(0x1f3),'description':'Clear\x20accessKey\x20from\x20config','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x4e542e(0x1a6),'type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1f2),'default':!![]},{'name':a8_0x4e542e(0x1ef),'type':a8_0x4e542e(0x1da),'description':'Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x8286e5){const _0x37b080=a8_0x4e542e,_0x26750a=resolveAuthScopeFlags(_0x8286e5),_0x4dc796=readScopedConfig(_0x26750a),_0x495b56=!!_0x4dc796['accessKey'];delete _0x4dc796[_0x37b080(0x1df)],writeScopedConfig(_0x4dc796,_0x26750a);const _0x526c29=_0x26750a[_0x37b080(0x1a6)]?_0x37b080(0x1a6):'project';if(_0x495b56)return{'ok':!![],'message':'AccessKey\x20cleared\x20from\x20'+_0x526c29+_0x37b080(0x1be)};return{'ok':!![],'message':_0x37b080(0x1f0)+_0x526c29+_0x37b080(0x1e5)};}},{'service':a8_0x4e542e(0x1b8),'command':'status','description':'Show\x20current\x20authentication\x20status','risk':a8_0x4e542e(0x1f1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x4e542e(0x1a6),'type':a8_0x4e542e(0x1da),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':'project','type':a8_0x4e542e(0x1da),'description':a8_0x4e542e(0x1b7),'default':![]}],async 'execute'(_0x34aebf){const _0x1689a8=a8_0x4e542e,_0x3027e1=resolveAuthScopeFlags(_0x34aebf),_0x59ce8b=readScopedConfig(_0x3027e1),_0x374da2=productEnvName('ACCESS_KEY'),_0xc0cbb6=productEnv(_0x1689a8(0x1e4))||undefined,_0x32b4d9=_0x59ce8b[_0x1689a8(0x1df)]||undefined,_0x339cab=_0xc0cbb6||_0x32b4d9,_0xd29efe=_0xc0cbb6?_0x374da2+'\x20env\x20var':_0x32b4d9?(_0x3027e1[_0x1689a8(0x1a6)]?_0x1689a8(0x1a6):'project')+_0x1689a8(0x1e3):null,_0x572153=[_0x1689a8(0x1bc)+AUTH_MODE[_0x1689a8(0x1c4)]];if(_0x339cab){const _0x53bf73=_0x339cab[_0x1689a8(0x1a8)]>0x8?''+_0x339cab[_0x1689a8(0x1ee)](0x0,0x8)+'*'[_0x1689a8(0x1d1)](_0x339cab[_0x1689a8(0x1a8)]-0x8):_0x339cab;_0x572153[_0x1689a8(0x1b5)]('AccessKey:\x20'+_0x53bf73+(_0xd29efe?_0x1689a8(0x1ab)+_0xd29efe+')':''));}return!_0x339cab&&(_0x572153['push'](''),_0x572153[_0x1689a8(0x1b5)]('No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:'),_0x572153[_0x1689a8(0x1b5)](''),_0x572153['push']('Option\x20A:\x20'+CLI_BIN_NAME+_0x1689a8(0x1c2)),_0x572153[_0x1689a8(0x1b5)](''),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1ea)+PRODUCT_CONFIG['newConfigFileName']+')'),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1f7)),_0x572153['push'](''),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1ae)),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1c6)+_0x374da2+_0x1689a8(0x1ac)),_0x572153[_0x1689a8(0x1b5)](''),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1e1)+CLI_BIN_NAME+_0x1689a8(0x1d3)),_0x572153[_0x1689a8(0x1b5)](_0x1689a8(0x1f5)+CLI_BIN_NAME+_0x1689a8(0x1dc))),{'ok':!![],'message':_0x572153[_0x1689a8(0x1bb)]('\x0a')};}},{'service':a8_0x4e542e(0x1b8),'command':'info','description':a8_0x4e542e(0x1c3),'risk':a8_0x4e542e(0x1f1),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x6ac156){const _0x30244c=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x30244c,'meta':{'env':_0x6ac156['envName']??'production'}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a9_0x4937(_0x1ab4b6,_0x435347){_0x1ab4b6=_0x1ab4b6-0xb1;const _0x1c4d8b=a9_0x1c4d();let _0x493714=_0x1c4d8b[_0x1ab4b6];return _0x493714;}(function(_0x13bd81,_0x42db67){const _0x26ae42=a9_0x4937,_0x181870=_0x13bd81();while(!![]){try{const _0x1054e6=parseInt(_0x26ae42(0xc0))/0x1*(-parseInt(_0x26ae42(0xc4))/0x2)+parseInt(_0x26ae42(0xb1))/0x3+-parseInt(_0x26ae42(0xbe))/0x4*(-parseInt(_0x26ae42(0xc8))/0x5)+-parseInt(_0x26ae42(0xc5))/0x6*(parseInt(_0x26ae42(0xb7))/0x7)+parseInt(_0x26ae42(0xbf))/0x8*(parseInt(_0x26ae42(0xb4))/0x9)+parseInt(_0x26ae42(0xb9))/0xa+parseInt(_0x26ae42(0xba))/0xb*(parseInt(_0x26ae42(0xc7))/0xc);if(_0x1054e6===_0x42db67)break;else _0x181870['push'](_0x181870['shift']());}catch(_0x567643){_0x181870['push'](_0x181870['shift']());}}}(a9_0x1c4d,0x9d455));import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x3a5587=a9_0x4937;super(_0x3a5587(0xb8)),this[_0x3a5587(0xb2)]='AbortPrompt';}}function createSafeRl(){const _0x3c539c=a9_0x4937,_0x479db8=createInterface({'input':process['stdin'],'output':process[_0x3c539c(0xc3)]});let _0x1e66a3;const _0x4a2efc=new Promise((_0x43b562,_0x2388ef)=>{const _0x18b33c=_0x3c539c;_0x1e66a3=()=>{const _0x5c5f44=a9_0x4937;_0x1e66a3&&(_0x479db8[_0x5c5f44(0xb6)](_0x5c5f44(0xc1),_0x1e66a3),_0x1e66a3=undefined);try{_0x479db8[_0x5c5f44(0xb3)]();}catch{}_0x2388ef(new AbortPrompt());},_0x479db8[_0x18b33c(0xbb)](_0x18b33c(0xc1),_0x1e66a3);}),_0x48064c=()=>{const _0xd09f1=_0x3c539c;_0x1e66a3&&(_0x479db8[_0xd09f1(0xb6)]('SIGINT',_0x1e66a3),_0x1e66a3=undefined);try{_0x479db8[_0xd09f1(0xb3)]();}catch{}};return{'rl':_0x479db8,'abortPromise':_0x4a2efc,'disposeSuccess':_0x48064c};}export async function promptAccessKey(_0x16911b=''){const _0x1ef88b=a9_0x4937,{rl:_0x563cc1,abortPromise:_0x57ccaa,disposeSuccess:_0x504110}=createSafeRl(),_0x9f613e=new Promise(_0x4631d5=>{const _0x4df1c3=a9_0x4937,_0x4bea73=_0x16911b?'AccessKey\x20('+_0x16911b+'):\x20':_0x4df1c3(0xbd);_0x563cc1[_0x4df1c3(0xc6)](_0x4bea73,_0x382037=>{const _0x57589b=_0x4df1c3;_0x504110(),_0x4631d5(_0x382037[_0x57589b(0xb5)]()||_0x16911b);});});return Promise[_0x1ef88b(0xbc)]([_0x9f613e,_0x57ccaa]);}export function isAbortPrompt(_0x45ff76){const _0x1e4ee8=a9_0x4937;return _0x45ff76 instanceof Error&&_0x45ff76[_0x1e4ee8(0xb2)]===_0x1e4ee8(0xc2);}function a9_0x1c4d(){const _0x3c1f91=['name','close','1005903MMOeEN','trim','removeListener','3095099Ajxjtl','User\x20aborted\x20prompt','2640400wSofBS','55wHHPAC','once','race','AccessKey\x20(paste\x20ak_...):\x20','116yDKvGZ','16acLtwF','302276hHbyjX','SIGINT','AbortPrompt','stdout','8OIXhTK','6wNwtKK','question','561480bzjtPI','156995FQUFwV','1990041GNhlLC'];a9_0x1c4d=function(){return _0x3c1f91;};return a9_0x1c4d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a10_0x344c(){const _0x213269=['223752ajWSud','40489pAHJWz','335949NXZNUJ','bool','description','scriptType','appCode','bff','1000240ELQPCO','detail','180201IdpPCW','160LkMEUS','298332pkKdFM','createdTime','4ntXwzx','266080GyOYWo','num','Script\x20ID','Get\x20BFF\x20script\x20details\x20by\x20ID','functionName','(none)'];a10_0x344c=function(){return _0x213269;};return a10_0x344c();}const a10_0x4ba3db=a10_0x1d17;function a10_0x1d17(_0x21d72d,_0x4e5211){_0x21d72d=_0x21d72d-0x111;const _0x344c18=a10_0x344c();let _0x1d17ef=_0x344c18[_0x21d72d];return _0x1d17ef;}(function(_0x4e35d0,_0x508ad4){const _0x300f20=a10_0x1d17,_0x228181=_0x4e35d0();while(!![]){try{const _0x229ab8=-parseInt(_0x300f20(0x11c))/0x1+-parseInt(_0x300f20(0x114))/0x2*(parseInt(_0x300f20(0x11d))/0x3)+-parseInt(_0x300f20(0x115))/0x4+-parseInt(_0x300f20(0x123))/0x5+parseInt(_0x300f20(0x11b))/0x6+-parseInt(_0x300f20(0x125))/0x7+parseInt(_0x300f20(0x111))/0x8*(parseInt(_0x300f20(0x112))/0x9);if(_0x229ab8===_0x508ad4)break;else _0x228181['push'](_0x228181['shift']());}catch(_0x4a6e33){_0x228181['push'](_0x228181['shift']());}}}(a10_0x344c,0x2307e));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':a10_0x4ba3db(0x122),'command':a10_0x4ba3db(0x124),'description':a10_0x4ba3db(0x118),'risk':'read','flags':[{...ID_FLAG,'description':a10_0x4ba3db(0x117)},VERBOSE_FLAG],async 'execute'(_0x3e70c){const _0x3d907c=a10_0x4ba3db,_0xb51b79=await getBffScriptInfo(_0x3e70c[_0x3d907c(0x116)]('id')),_0x669d9e=_0x3e70c[_0x3d907c(0x11e)]('verbose');if(_0x669d9e)return{'ok':!![],'data':_0xb51b79};return{'ok':!![],'data':{'id':_0xb51b79['id'],'appCode':_0xb51b79[_0x3d907c(0x121)],'functionName':_0xb51b79[_0x3d907c(0x119)]??'','scriptType':_0xb51b79[_0x3d907c(0x120)],'description':_0xb51b79[_0x3d907c(0x11f)]||_0x3d907c(0x11a),'createdTime':_0xb51b79[_0x3d907c(0x113)]??'','updatedTime':_0xb51b79['updatedTime']??''}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0xbd2393=a11_0x5840;(function(_0x1e0968,_0x506df5){const _0x5c561e=a11_0x5840,_0x4f968a=_0x1e0968();while(!![]){try{const _0x5201d1=-parseInt(_0x5c561e(0x151))/0x1+-parseInt(_0x5c561e(0x145))/0x2*(-parseInt(_0x5c561e(0x155))/0x3)+parseInt(_0x5c561e(0x14a))/0x4*(-parseInt(_0x5c561e(0x153))/0x5)+-parseInt(_0x5c561e(0x14c))/0x6+-parseInt(_0x5c561e(0x144))/0x7+-parseInt(_0x5c561e(0x156))/0x8*(-parseInt(_0x5c561e(0x14d))/0x9)+parseInt(_0x5c561e(0x148))/0xa*(parseInt(_0x5c561e(0x149))/0xb);if(_0x5201d1===_0x506df5)break;else _0x4f968a['push'](_0x4f968a['shift']());}catch(_0x21cd31){_0x4f968a['push'](_0x4f968a['shift']());}}}(a11_0x335c,0x492af));function a11_0x5840(_0x3aebf6,_0x25f601){_0x3aebf6=_0x3aebf6-0x144;const _0x335c38=a11_0x335c();let _0x58404c=_0x335c38[_0x3aebf6];return _0x58404c;}import{executeSdkBff}from'../../core/sdk-client.js';function a11_0x335c(){const _0x1d52bc=['Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','read','50fYeJWV','818213JmzqGi','967336uRnfOn','name','1664202cUUyNx','579429IiNbGj','now','bff','str','6604tPhvEL','params','5KGPgaC','BFF\x20function\x20name\x20to\x20execute','303087WJzQNx','56MFFZDo','BFF\x20executed\x20in\x20','2101183OaHAZm','6sJoheV'];a11_0x335c=function(){return _0x1d52bc;};return a11_0x335c();}import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';export const bffExec={'service':a11_0xbd2393(0x14f),'command':'exec','description':a11_0xbd2393(0x146),'risk':a11_0xbd2393(0x147),'flags':[{...NAME_FLAG,'required':!![],'description':a11_0xbd2393(0x154)},PARAMS_FLAG],async 'execute'(_0x628e6){const _0x269440=a11_0xbd2393,_0x59d9df=parseJsonParams(_0x628e6[_0x269440(0x150)](_0x269440(0x152))),_0x3d9754=Date[_0x269440(0x14e)](),_0x5b1fed=await executeSdkBff(_0x628e6[_0x269440(0x150)](_0x269440(0x14b)),_0x59d9df),_0x553732=Date[_0x269440(0x14e)]()-_0x3d9754;return{'ok':!![],'data':{'result':_0x5b1fed,'elapsed':_0x553732},'message':_0x269440(0x157)+_0x553732+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fe526,_0x1cbef7){const _0x3edfbf=a12_0x27cd,_0x198f11=_0x4fe526();while(!![]){try{const _0x310a8b=parseInt(_0x3edfbf(0xdf))/0x1*(parseInt(_0x3edfbf(0xe0))/0x2)+-parseInt(_0x3edfbf(0xdc))/0x3+-parseInt(_0x3edfbf(0xe4))/0x4+-parseInt(_0x3edfbf(0xe2))/0x5*(-parseInt(_0x3edfbf(0xe3))/0x6)+parseInt(_0x3edfbf(0xde))/0x7+-parseInt(_0x3edfbf(0xe5))/0x8*(parseInt(_0x3edfbf(0xe1))/0x9)+-parseInt(_0x3edfbf(0xdb))/0xa*(parseInt(_0x3edfbf(0xdd))/0xb);if(_0x310a8b===_0x1cbef7)break;else _0x198f11['push'](_0x198f11['shift']());}catch(_0x39c2a9){_0x198f11['push'](_0x198f11['shift']());}}}(a12_0x5085,0x8d450));function a12_0x5085(){const _0x5003ee=['7701827ffGGni','22307aXsJjR','44YvQRts','9kLdwey','1918400ZCokoT','18USBfdP','1445616IiNMYv','4812520DYwRPm','4444590zOwzWn','2267961sAUeKS','11mqYhQo'];a12_0x5085=function(){return _0x5003ee;};return a12_0x5085();}function a12_0x27cd(_0x9c145a,_0x386493){_0x9c145a=_0x9c145a-0xdb;const _0x508556=a12_0x5085();let _0x27cdf2=_0x508556[_0x9c145a];return _0x27cdf2;}import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';export const bffDefinitions=[bffDetail,bffExec];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bb44f,_0x13f3e2){const _0x508fc4=a13_0x171b,_0x5c79e1=_0x5bb44f();while(!![]){try{const _0x513cdb=parseInt(_0x508fc4(0xeb))/0x1*(parseInt(_0x508fc4(0xec))/0x2)+-parseInt(_0x508fc4(0xf3))/0x3+parseInt(_0x508fc4(0xf0))/0x4+-parseInt(_0x508fc4(0xe7))/0x5+parseInt(_0x508fc4(0xe6))/0x6*(parseInt(_0x508fc4(0xe4))/0x7)+-parseInt(_0x508fc4(0xe1))/0x8+parseInt(_0x508fc4(0xe8))/0x9;if(_0x513cdb===_0x13f3e2)break;else _0x5c79e1['push'](_0x5c79e1['shift']());}catch(_0x56bfeb){_0x5c79e1['push'](_0x5c79e1['shift']());}}}(a13_0x1e53,0x8b42c));import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG}from'../../constant/product.js';export{DEFAULT_APP_PROFILE_NAME,DEFAULT_CONFIG_VALUES}from'../../constant/defaults.js';export{RUNTIME_ENV_VALUES}from'../../constant/env.js';function a13_0x171b(_0x3cb512,_0x2d9629){_0x3cb512=_0x3cb512-0xdf;const _0x1e5389=a13_0x1e53();let _0x171b76=_0x1e5389[_0x3cb512];return _0x171b76;}function a13_0x1e53(){const _0x1a62ff=['project',',\x20or\x20run\x20`','validation','2339544MZZXOZ','global-default','Use\x20only\x20one\x20config\x20scope\x20flag.','2029890vzEcqW','Add\x20--global\x20to\x20write\x20to\x20~/','inProject','project-default','\x20found).','6832824vjCsxG','global','\x20init`\x20first.','49gxVYva','Not\x20inside\x20a\x20project\x20(no\x20','527628czSUMW','1830960XMpgHH','5300613OPwoit','project-or-global-explicit','newConfigFileName','8SkSgBW','169482BjbUDr'];a13_0x1e53=function(){return _0x1a62ff;};return a13_0x1e53();}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';import{isInProject}from'../../context.js';import{CliErrors}from'../../errors.js';export{buildAppProfileListFields,CONFIG_ENUM_VALUES,IMPORTABLE_RUNTIME_CONFIG_KEYS,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getConfigDefaultValue,getConfigEnumValues,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isLegacyCompatConfigKey,isTopLevelConfigKey}from'../../config/schema.js';export function resolveConfigScope(_0x1e5550){const _0x1233af=a13_0x171b,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x46a362}=_0x1e5550;if(explicitGlobal&&explicitProject)throw CliErrors[_0x1233af(0xef)]('Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.',_0x1233af(0xf2));if(explicitGlobal)return _0x1233af(0xe2);if(explicitProject)return'project';switch(_0x46a362){case _0x1233af(0xf1):return'global';case _0x1233af(0xdf):return _0x1e5550[_0x1233af(0xf5)]??isInProject()?_0x1233af(0xed):_0x1233af(0xe2);case _0x1233af(0xe9):if(!(_0x1e5550[_0x1233af(0xf5)]??isInProject()))throw CliErrors['validation'](_0x1233af(0xe5)+PRODUCT_CONFIG[_0x1233af(0xea)]+_0x1233af(0xe0),_0x1233af(0xf4)+PRODUCT_CONFIG[_0x1233af(0xea)]+_0x1233af(0xee)+CLI_BIN_NAME+_0x1233af(0xe3));return _0x1233af(0xed);}}export function toScopeFlags(_0x124a6e){const _0x1bcaaf=a13_0x171b;return{'global':_0x124a6e===_0x1bcaaf(0xe2)};}export function formatScopeLabel(_0x1d291f){const _0x5481b8=a13_0x171b;return _0x1d291f===_0x5481b8(0xe2)?'\x20(global)':'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c1b62,_0x286007){const _0x1c8362=a14_0x4ade,_0x892a06=_0x2c1b62();while(!![]){try{const _0x3f132a=parseInt(_0x1c8362(0xf5))/0x1+-parseInt(_0x1c8362(0xfe))/0x2+parseInt(_0x1c8362(0xef))/0x3*(-parseInt(_0x1c8362(0xe9))/0x4)+parseInt(_0x1c8362(0xfc))/0x5*(-parseInt(_0x1c8362(0xeb))/0x6)+parseInt(_0x1c8362(0xf1))/0x7+-parseInt(_0x1c8362(0xe8))/0x8*(parseInt(_0x1c8362(0xea))/0x9)+parseInt(_0x1c8362(0xff))/0xa;if(_0x3f132a===_0x286007)break;else _0x892a06['push'](_0x892a06['shift']());}catch(_0x4a13e2){_0x892a06['push'](_0x892a06['shift']());}}}(a14_0x2da4,0x2e7b4));import{CliErrors}from'../../errors.js';function a14_0x4ade(_0x69af17,_0x29f86c){_0x69af17=_0x69af17-0xe6;const _0x2da47b=a14_0x2da4();let _0x4ade04=_0x2da47b[_0x69af17];return _0x4ade04;}function isSet(_0x4f2cd4,_0x4fcba6){const _0x2bc678=a14_0x4ade,_0x1107b2=_0x4f2cd4[_0x2bc678(0xee)](_0x4fcba6);return _0x1107b2!==undefined&&_0x1107b2!==''&&_0x1107b2!==![]&&_0x1107b2!==0x0;}function fmtNames(_0x51d7c1){const _0x4cc722=a14_0x4ade;return _0x51d7c1[_0x4cc722(0xf0)](_0xdc9942=>'--'+_0xdc9942)[_0x4cc722(0xe6)](',\x20');}export function requireOneOf(_0x28fa18,_0x389142,_0x511f92){const _0x40b269=a14_0x4ade,_0xc09882=_0x389142['filter'](_0x55c42d=>isSet(_0x28fa18,_0x55c42d));if(_0xc09882[_0x40b269(0xf7)]!==0x1)throw CliErrors['validation'](_0xc09882[_0x40b269(0xf7)]===0x0?_0x40b269(0xf8)+fmtNames(_0x389142)+_0x40b269(0xed)+_0x511f92+'`.':'Only\x20one\x20of\x20'+fmtNames(_0x389142)+_0x40b269(0x100)+fmtNames(_0xc09882)+'.',_0xc09882[_0x40b269(0xf7)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x389142):_0x40b269(0xf4));}export function requireAnyOf(_0x3de35c,_0x3e004e,_0x2ea1c1){const _0x27050e=a14_0x4ade;if(!_0x3e004e[_0x27050e(0xf2)](_0x50fcf2=>isSet(_0x3de35c,_0x50fcf2)))throw CliErrors[_0x27050e(0xf9)](_0x27050e(0x101)+fmtNames(_0x3e004e)+_0x27050e(0xed)+_0x2ea1c1+'`.',_0x27050e(0xec)+fmtNames(_0x3e004e));}export function mutuallyExclusive(_0x39c13a,_0x50efa3,_0x5bcba2){const _0x4ab99e=a14_0x4ade,_0x51f4f4=_0x50efa3['filter'](_0x23fceb=>isSet(_0x39c13a,_0x23fceb));if(_0x51f4f4[_0x4ab99e(0xf7)]>0x1)throw CliErrors['validation']('Flags\x20'+fmtNames(_0x51f4f4)+_0x4ab99e(0xf6)+_0x5bcba2+'`.',_0x4ab99e(0xfd)+fmtNames(_0x50efa3));}function a14_0x2da4(){const _0x5d2333=['14471uYnugb','\x20are\x20mutually\x20exclusive\x20for\x20`','length','Exactly\x20one\x20of\x20','validation',',\x20got\x20\x22',':\x20expected\x20','1684925UczbHk','Use\x20only\x20one\x20of:\x20','22382JZYSeU','7994680ZOXaIR','\x20is\x20allowed,\x20found:\x20','At\x20least\x20one\x20of\x20','join','str','2280ZumkDq','542356bzLZVG','9189fPrqyK','6lUjIZk','Provide\x20one\x20of:\x20','\x20is\x20required\x20for\x20`','flag','6bsXdGk','map','2007516kWKBNY','some','test','Remove\x20all\x20but\x20one.'];a14_0x2da4=function(){return _0x5d2333;};return a14_0x2da4();}export function validatePattern(_0x39ccf9,_0x118c39,_0x5d093a,_0x1cfe52){const _0x1e0351=a14_0x4ade,_0x43362b=_0x39ccf9[_0x1e0351(0xe7)](_0x118c39);if(_0x43362b&&!_0x5d093a[_0x1e0351(0xf3)](_0x43362b))throw CliErrors[_0x1e0351(0xf9)]('Invalid\x20--'+_0x118c39+_0x1e0351(0xfb)+_0x1cfe52+_0x1e0351(0xfa)+_0x43362b+'\x22.');}
|