@lovrabet/lovrabet-cli 2.0.14-beta.2 → 2.0.14-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -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 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/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 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
(function(_0x43ebfd,_0x5bea46){const _0x4f7fb=a0_0x2eaa,_0x1a432a=_0x43ebfd();while(!![]){try{const _0x9e6f0e=parseInt(_0x4f7fb(0x1dd))/0x1*(-parseInt(_0x4f7fb(0x1f3))/0x2)+parseInt(_0x4f7fb(0x1f1))/0x3*(parseInt(_0x4f7fb(0x1eb))/0x4)+parseInt(_0x4f7fb(0x1d1))/0x5*(parseInt(_0x4f7fb(0x1df))/0x6)+parseInt(_0x4f7fb(0x1e5))/0x7+parseInt(_0x4f7fb(0x1f5))/0x8*(-parseInt(_0x4f7fb(0x1f0))/0x9)+-parseInt(_0x4f7fb(0x1f2))/0xa*(parseInt(_0x4f7fb(0x1d0))/0xb)+parseInt(_0x4f7fb(0x1dc))/0xc;if(_0x9e6f0e===_0x5bea46)break;else _0x1a432a['push'](_0x1a432a['shift']());}catch(_0x30b245){_0x1a432a['push'](_0x1a432a['shift']());}}}(a0_0x89b7,0x4362e));import{jsx as a0_0x398e63}from'react/jsx-runtime';import a0_0x2a7857 from'meow';import{render}from'ink';function a0_0x2eaa(_0x405238,_0x1a7487){_0x405238=_0x405238-0x1cc;const _0x89b72a=a0_0x89b7();let _0x2eaa8a=_0x89b72a[_0x405238];return _0x2eaa8a;}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_0x89b7(){const _0x13f085=['exit','slice','defaultCommand','hint','args','length','Error:\x20','ERR_STREAM_DESTROYED','3362892xOBNLT','206CFsZcn','code','2434308rVQmuV','\x0aCancelled.\x0a','message','exitCode','log','write','2313395aYNZAP','cancelled',':\x20--','help','corrected','Hint:\x20','24NwFqko','flatMap','\x20->\x20--','name','assign','180PHegKo','11598MjupeL','10CcaPor','1406ZnFCOj','ERR_USE_AFTER_CLOSE','82496yPSfwr','ExitPromptError','handler','input','flags','unknownCommand','4538248Prlwhr','5UaszUn','Unexpected\x20error:','stderr'];a0_0x89b7=function(){return _0x13f085;};return a0_0x89b7();}const helpText=generateFullHelp(),cli=a0_0x2a7857(helpText,{'importMeta':import.meta,'flags':buildMeowFlags(),'version':getCliVersionDisplay()});void main()['catch'](handleError);async function main(){try{await run();}catch(_0x10b060){handleError(_0x10b060);}}async function run(){const _0x22e97c=a0_0x2eaa;let _0x15a9e2=cli[_0x22e97c(0x1cd)][0x0],_0x2ee6d6=cli[_0x22e97c(0x1cd)][0x1];const _0x79e864=cli[_0x22e97c(0x1ce)];try{const {correctFlags:_0x2f92ea}=await import('./framework/preparse.js'),_0x14b3bb=getAllDefinitions()[_0x22e97c(0x1ec)](_0x169738=>_0x169738[_0x22e97c(0x1ce)]??[]),{flags:_0x43eefe,corrections:_0x4f8593}=_0x2f92ea(_0x79e864,_0x14b3bb);if(_0x4f8593[_0x22e97c(0x1d9)]>0x0){for(const _0xbcb58c of _0x4f8593){process[_0x22e97c(0x1d3)][_0x22e97c(0x1e4)]('[preparse]\x20'+_0xbcb58c[_0x22e97c(0x1cc)]+_0x22e97c(0x1e7)+_0xbcb58c['original']+_0x22e97c(0x1ed)+_0xbcb58c[_0x22e97c(0x1e9)]+'\x0a');}Object[_0x22e97c(0x1ef)](_0x79e864,_0x43eefe);}}catch{}if(!_0x15a9e2||!isKnownService(_0x15a9e2)){const {waitUntilExit:_0x255511}=render(a0_0x398e63(Help,{}));await _0x255511();return;}const _0x5019ed=getServiceEntry(_0x15a9e2);if(!_0x2ee6d6){if(_0x79e864[_0x22e97c(0x1e8)]){console[_0x22e97c(0x1e3)](generateServiceHelp(_0x15a9e2));return;}if(_0x5019ed[_0x22e97c(0x1d6)])_0x2ee6d6=_0x5019ed['defaultCommand'];else{console[_0x22e97c(0x1e3)](generateServiceHelp(_0x15a9e2));return;}}const _0x3bcc98=findDefinition(_0x15a9e2,_0x2ee6d6);!_0x3bcc98&&(console['log'](generateServiceHelp(_0x15a9e2)),handleError(CliErrors[_0x22e97c(0x1cf)](_0x15a9e2+'\x20'+_0x2ee6d6)));if(_0x79e864['help']){console[_0x22e97c(0x1e3)](generateCommandHelp(_0x3bcc98));return;}const _0x54b212=buildConfigFromFlags(_0x79e864);await initGlobalEnvironment(_0x54b212);const _0x43689f=createPipelineEnv(_0x54b212,_0x79e864);_0x43689f[_0x22e97c(0x1d8)]=cli[_0x22e97c(0x1cd)][_0x22e97c(0x1d5)](0x2),await runCommand(_0x3bcc98,_0x43689f);}function handleError(_0x41bb6c){const _0x44e5e3=a0_0x2eaa;if(_0x41bb6c instanceof CliError){_0x41bb6c[_0x44e5e3(0x1de)]===_0x44e5e3(0x1e6)&&(process['stderr']['write'](_0x44e5e3(0x1e0)),process['exit'](0x0));console['error'](_0x44e5e3(0x1da)+_0x41bb6c[_0x44e5e3(0x1e1)]);if(_0x41bb6c[_0x44e5e3(0x1d7)])console['error'](_0x44e5e3(0x1ea)+_0x41bb6c[_0x44e5e3(0x1d7)]);process['exit'](_0x41bb6c[_0x44e5e3(0x1e2)]);}isUserCancellation(_0x41bb6c)&&(process['stderr'][_0x44e5e3(0x1e4)](_0x44e5e3(0x1e0)),process[_0x44e5e3(0x1d4)](0x0)),console['error'](_0x44e5e3(0x1d2),_0x41bb6c),process[_0x44e5e3(0x1d4)](0x1);}function isUserCancellation(_0x23f6e2){const _0x46dc8c=a0_0x2eaa;if(!(_0x23f6e2 instanceof Error))return![];if(_0x23f6e2[_0x46dc8c(0x1ee)]===_0x46dc8c(0x1f6))return!![];if(_0x23f6e2[_0x46dc8c(0x1de)]===_0x46dc8c(0x1f4))return!![];if(_0x23f6e2[_0x46dc8c(0x1de)]===_0x46dc8c(0x1db))return!![];return![];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a1_0x3327e0=a1_0x3c61;function a1_0x110e(){const _0x41b951=['创建数据','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.','API\x20doc\x20code\x20not\x20found:\x20','includes','##\x20Filter\x20dataset\x20data','6xcWxzK','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','detail','List\x20BF\x20endpoint\x20functions','toLowerCase','分页获取数据集列表','10wSGqTL','None','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','path','method','length','whenToUse','List\x20datasets','fields/properties\x20describe\x20data\x20shape','Endpoint\x20function\x20name','List\x20available\x20runtime\x20API\x20documentation\x20entries','Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','需要向指定数据集新增一条业务数据时使用','scriptName','Create\x20dataset\x20record','11457891BOrdfQ','dataset_data_filter','Returns\x20SQL\x20execution\x20payload','##\x20List\x20datasets','Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset','string','datasetCode','/api/{appCode}/{datasetCode}/aggregate','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','where\x20filters\x20before\x20aggregation','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','tableData\x20contains\x20records','trim','category','appCode','346227SHJEml','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','{\x22fieldName\x22:\x22value\x22}','聚合查询数据集数据','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','{\x22param\x22:\x22value\x22}','map','code','dataset','3256050muSKOC','/api/endpoint/{appCode}/{scriptName}','Current\x20app\x20code','custom_sql','704509XgAqul','/api/dataset/getOneByCode?code={datasetCode}','{\x22id\x22:123}','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','validation','POST','55788HtPCBr','Get\x20one\x20dataset\x20record','/api/{appCode}/{datasetCode}/getOne','read','api-doc','bf_execute','operations\x20describes\x20runtime\x20APIs','This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','GET','Filter\x20dataset\x20data','Dataset\x20detail','summary','/api/{appCode}/{datasetCode}/filter','paging.totalCount\x20gives\x20total\x20rows','Aggregate\x20dataset\x20data','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','list','219yeAjlP','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','dataset_data_get_one','filter','bf_function_list','paging\x20contains\x20pagination','32-character\x20dataset\x20code','result\x20rows\x20contain\x20aggregate\x20aliases','{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','##\x20Dataset\x20detail','条件过滤查询数据','9032808jnKJcw','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','dataset_data_create','##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','join','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','执行自定义\x20SQL','keyword','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','find','Show\x20runtime\x20API\x20documentation\x20by\x20code','/api/custom/executeSql','/api/{appCode}/{datasetCode}/create','1091715iAADCN','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','str'];a1_0x110e=function(){return _0x41b951;};return a1_0x110e();}(function(_0x2fc567,_0x1b2e95){const _0x15ed08=a1_0x3c61,_0x18c50a=_0x2fc567();while(!![]){try{const _0x42e971=-parseInt(_0x15ed08(0x145))/0x1+-parseInt(_0x15ed08(0x141))/0x2+parseInt(_0x15ed08(0x15e))/0x3*(parseInt(_0x15ed08(0x14b))/0x4)+-parseInt(_0x15ed08(0x105))/0x5+-parseInt(_0x15ed08(0x112))/0x6*(-parseInt(_0x15ed08(0x138))/0x7)+parseInt(_0x15ed08(0x16a))/0x8+-parseInt(_0x15ed08(0x128))/0x9*(-parseInt(_0x15ed08(0x118))/0xa);if(_0x42e971===_0x1b2e95)break;else _0x18c50a['push'](_0x18c50a['shift']());}catch(_0x2c6447){_0x18c50a['push'](_0x18c50a['shift']());}}}(a1_0x110e,0xe0583));import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x3327e0(0x136),'type':a1_0x3327e0(0x12d),'description':a1_0x3327e0(0x12c)},KEYWORD_FLAG={'name':a1_0x3327e0(0xff),'type':'string','description':a1_0x3327e0(0x123)},DOC_CODE_FLAG={'name':a1_0x3327e0(0x13f),'type':a1_0x3327e0(0x12d),'required':!![],'description':'API\x20doc\x20code,\x20for\x20example\x20dataset_list'},DOCS=[{'code':'dataset_list','category':a1_0x3327e0(0x140),'title':a1_0x3327e0(0x11f),'method':'POST','path':'/api/dataset/get-dataset-list-by-app-code','summary':a1_0x3327e0(0x117),'whenToUse':a1_0x3327e0(0x107),'pathParams':[],'queryParams':[],'bodySchema':a1_0x3327e0(0x153),'responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name',a1_0x3327e0(0x15a)],'examples':['lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress'],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':[a1_0x3327e0(0x12b),'','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.'][a1_0x3327e0(0xfc)]('\x0a')},{'code':'dataset_detail','category':a1_0x3327e0(0x140),'title':a1_0x3327e0(0x157),'method':a1_0x3327e0(0x155),'path':a1_0x3327e0(0x146),'summary':'获取数据集详情','whenToUse':a1_0x3327e0(0xfb),'pathParams':[],'queryParams':[{'name':a1_0x3327e0(0x13f),'description':a1_0x3327e0(0x165)}],'bodySchema':a1_0x3327e0(0x119),'responseHighlights':[a1_0x3327e0(0x120),a1_0x3327e0(0x151)],'examples':[a1_0x3327e0(0x148)],'notes':[a1_0x3327e0(0x106)],'markdown':[a1_0x3327e0(0x168),'',a1_0x3327e0(0x10d)][a1_0x3327e0(0xfc)]('\x0a')},{'code':a1_0x3327e0(0x129),'category':a1_0x3327e0(0x140),'title':a1_0x3327e0(0x156),'method':a1_0x3327e0(0x14a),'path':a1_0x3327e0(0x159),'summary':a1_0x3327e0(0x169),'whenToUse':a1_0x3327e0(0x15c),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x3327e0(0x12e),'description':a1_0x3327e0(0x165)}],'queryParams':[],'bodySchema':a1_0x3327e0(0x160),'responseHighlights':[a1_0x3327e0(0x134),a1_0x3327e0(0x164)],'examples':['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27'],'notes':[a1_0x3327e0(0x10a)],'markdown':[a1_0x3327e0(0x111),'',a1_0x3327e0(0x133)][a1_0x3327e0(0xfc)]('\x0a')},{'code':'dataset_data_aggregate','category':a1_0x3327e0(0x140),'title':a1_0x3327e0(0x15b),'method':a1_0x3327e0(0x14a),'path':a1_0x3327e0(0x12f),'summary':a1_0x3327e0(0x13b),'whenToUse':a1_0x3327e0(0x10b),'pathParams':[{'name':a1_0x3327e0(0x137),'description':a1_0x3327e0(0x143)},{'name':a1_0x3327e0(0x12e),'description':a1_0x3327e0(0x165)}],'queryParams':[],'bodySchema':a1_0x3327e0(0x167),'responseHighlights':[a1_0x3327e0(0x166),a1_0x3327e0(0x131)],'examples':[a1_0x3327e0(0x113)],'notes':['Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.'],'markdown':['##\x20Aggregate\x20dataset\x20data','','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x3327e0(0xfc)]('\x0a')},{'code':a1_0x3327e0(0x161),'category':'dataset','title':a1_0x3327e0(0x14c),'method':'POST','path':a1_0x3327e0(0x14d),'summary':'查询单条数据','whenToUse':a1_0x3327e0(0x100),'pathParams':[{'name':a1_0x3327e0(0x137),'description':a1_0x3327e0(0x143)},{'name':a1_0x3327e0(0x12e),'description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x3327e0(0x147),'responseHighlights':['Returns\x20one\x20matching\x20business\x20record'],'examples':['lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27'],'notes':[a1_0x3327e0(0x16b)],'markdown':a1_0x3327e0(0x10c)},{'code':a1_0x3327e0(0x16c),'category':a1_0x3327e0(0x140),'title':a1_0x3327e0(0x127),'method':'POST','path':a1_0x3327e0(0x104),'summary':a1_0x3327e0(0x109),'whenToUse':a1_0x3327e0(0x125),'pathParams':[{'name':a1_0x3327e0(0x137),'description':a1_0x3327e0(0x143)},{'name':a1_0x3327e0(0x12e),'description':a1_0x3327e0(0x165)}],'queryParams':[],'bodySchema':a1_0x3327e0(0x13a),'responseHighlights':[a1_0x3327e0(0xfa)],'examples':[a1_0x3327e0(0x124)],'notes':[a1_0x3327e0(0x152)],'markdown':a1_0x3327e0(0x16d)},{'code':a1_0x3327e0(0x163),'category':'bf','title':a1_0x3327e0(0x115),'method':a1_0x3327e0(0x155),'path':'/api/endpoint/{appCode}/functions','summary':'获取应用下可调用的\x20BF\x20函数列表','whenToUse':a1_0x3327e0(0x130),'pathParams':[{'name':a1_0x3327e0(0x137),'description':a1_0x3327e0(0x143)}],'queryParams':[],'bodySchema':a1_0x3327e0(0x119),'responseHighlights':['Returns\x20endpoint\x20functionName/id/description'],'examples':[a1_0x3327e0(0x13c)],'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_0x3327e0(0x150),'category':'bf','title':'Execute\x20BF\x20endpoint\x20function','method':a1_0x3327e0(0x14a),'path':a1_0x3327e0(0x142),'summary':'执行指定\x20BF\x20函数','whenToUse':a1_0x3327e0(0x154),'pathParams':[{'name':a1_0x3327e0(0x137),'description':a1_0x3327e0(0x143)},{'name':a1_0x3327e0(0x126),'description':a1_0x3327e0(0x121)}],'queryParams':[],'bodySchema':a1_0x3327e0(0x13d),'responseHighlights':['Returns\x20script\x20business\x20payload'],'examples':['lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27'],'notes':[a1_0x3327e0(0x10e)],'markdown':'##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.'},{'code':'custom_sql_execute','category':a1_0x3327e0(0x144),'title':'Execute\x20custom\x20SQL','method':a1_0x3327e0(0x14a),'path':a1_0x3327e0(0x103),'summary':a1_0x3327e0(0xfe),'whenToUse':a1_0x3327e0(0x139),'pathParams':[],'queryParams':[],'bodySchema':a1_0x3327e0(0x15f),'responseHighlights':[a1_0x3327e0(0x12a)],'examples':[a1_0x3327e0(0x11a)],'notes':[a1_0x3327e0(0xfd)],'markdown':a1_0x3327e0(0x132)}];function entrySummary(_0x2c88f0){const _0xbe8ef1=a1_0x3327e0;return{'code':_0x2c88f0[_0xbe8ef1(0x13f)],'category':_0x2c88f0['category'],'method':_0x2c88f0[_0xbe8ef1(0x11c)],'path':_0x2c88f0[_0xbe8ef1(0x11b)],'summary':_0x2c88f0[_0xbe8ef1(0x158)],'whenToUse':_0x2c88f0[_0xbe8ef1(0x11e)]};}export function listApiDocEntries(_0x5e51b3={}){const _0x2cf7dd=a1_0x3327e0,_0x4a8709=String(_0x5e51b3['category']||'')[_0x2cf7dd(0x135)](),_0x50044c=String(_0x5e51b3['keyword']||'')['trim']()[_0x2cf7dd(0x116)]();return DOCS[_0x2cf7dd(0x162)](_0x3bdcd1=>{const _0x40e777=_0x2cf7dd;if(_0x4a8709&&_0x3bdcd1['category']!==_0x4a8709)return![];if(!_0x50044c)return!![];return[_0x3bdcd1[_0x40e777(0x13f)],_0x3bdcd1[_0x40e777(0x136)],_0x3bdcd1[_0x40e777(0x11c)],_0x3bdcd1['path'],_0x3bdcd1['summary'],_0x3bdcd1[_0x40e777(0x11e)],_0x3bdcd1['title']][_0x40e777(0xfc)]('\x20')[_0x40e777(0x116)]()[_0x40e777(0x110)](_0x50044c);})[_0x2cf7dd(0x13e)](entrySummary);}function a1_0x3c61(_0x3d6a5e,_0x2af1e6){_0x3d6a5e=_0x3d6a5e-0xfa;const _0x110e03=a1_0x110e();let _0x3c6135=_0x110e03[_0x3d6a5e];return _0x3c6135;}export function getApiDocDetail(_0x56d137){const _0x1ca184=a1_0x3327e0,_0x21ba6f=DOCS[_0x1ca184(0x101)](_0x4781be=>_0x4781be[_0x1ca184(0x13f)]===_0x56d137);if(!_0x21ba6f)throw CliErrors[_0x1ca184(0x149)](_0x1ca184(0x10f)+_0x56d137);return{..._0x21ba6f};}const apiDocList={'service':'api-doc','command':a1_0x3327e0(0x15d),'description':a1_0x3327e0(0x122),'risk':a1_0x3327e0(0x14e),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x1e0cce){const _0x8332d=a1_0x3327e0,_0x95289=listApiDocEntries({'category':_0x1e0cce[_0x8332d(0x108)](_0x8332d(0x136)),'keyword':_0x1e0cce['str']('keyword')});return{'ok':!![],'data':{'total':_0x95289[_0x8332d(0x11d)],'items':_0x95289}};}},apiDocDetail={'service':a1_0x3327e0(0x14f),'command':a1_0x3327e0(0x114),'description':a1_0x3327e0(0x102),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x18654e){const _0x1fad38=a1_0x3327e0;return{'ok':!![],'data':getApiDocDetail(_0x18654e[_0x1fad38(0x108)](_0x1fad38(0x13f)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
1
|
+
function a1_0x5aab(){const _0x58236c=['detail','10893920PWVivB','条件过滤查询数据','CLI\x20has\x20typed\x20`bff\x20detail`\x20and\x20`bff\x20exec`\x20commands\x20for\x20endpoint\x20scripts.','/api/custom/executeSql','POST','Returns\x20the\x20created\x20record\x20or\x20backend\x20operation\x20result','fields/properties\x20describe\x20data\x20shape','##\x20Get\x20one\x20dataset\x20record\x0a\x0aRead\x20one\x20record\x20by\x20id.','dataset_data_filter','{\x22appCode\x22:\x22app-aa63b188\x22,\x22currentPage\x22:1,\x22pageSize\x22:100}','已经确认目标\x20sqlCode\x20存在,并需要实际执行该自定义\x20SQL\x20时使用','List\x20BF\x20endpoint\x20functions','620456NgLaAq','86551eNdyKX','dataset_detail','path','##\x20Dataset\x20detail','Execute\x20BF\x20endpoint\x20function','dataset_list','api-doc','/api/{appCode}/{datasetCode}/aggregate','获取应用下可调用的\x20BF\x20函数列表','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27','Use\x20read-only\x20data\x20commands\x20before\x20writing\x20Artifacts\x20that\x20display\x20real\x20data.','List\x20available\x20runtime\x20API\x20documentation\x20entries','/api/endpoint/{appCode}/functions','List\x20datasets','summary','/api/{appCode}/{datasetCode}/create','API\x20doc\x20code,\x20for\x20example\x20dataset_list','datasetCode','Dataset\x20detail','Prefer\x20`filter`\x20when\x20the\x20record\x20id\x20is\x20unknown.','length','filter','聚合查询数据集数据','whenToUse','map','Current\x20app\x20code','8945616cKsBbE','Use\x20`lovrabet\x20sql\x20detail`\x20before\x20execution.','Use\x20`having`\x20only\x20for\x20post-aggregation\x20filters.','join','执行指定\x20BF\x20函数','lovrabet\x20sql\x20exec\x20--sqlcode\x20<sqlCode>\x20--params\x20\x27{}\x27','If\x20SDK\x20usage\x20is\x20needed,\x20follow\x20with\x20`lovrabet\x20dataset\x20sdk-doc\x20--code\x20<datasetCode>`.','lovrabet\x20bff\x20exec\x20--name\x20<functionName>\x20--params\x20\x27{}\x27','lovrabet\x20dataset\x20detail\x20--code\x20<datasetCode>\x20--appcode\x20<appCode>','validation','Returns\x20one\x20matching\x20business\x20record','GET','lovrabet\x20bff\x20detail\x20--id\x20<scriptId>\x20--appcode\x20<appCode>','##\x20Filter\x20dataset\x20data','分页获取数据集列表','None','tableData\x20contains\x20records','scriptName','已经知道记录\x20id,需要按数据集读取单条业务数据时使用','read','string','toLowerCase','operations\x20describes\x20runtime\x20APIs','/api/endpoint/{appCode}/{scriptName}','API\x20doc\x20code\x20not\x20found:\x20','code','需要携带\x20where、orderBy、分页等条件读取业务数据时使用','已经确认目标\x20BF\x20的\x20scriptName,且需要实际调用该\x20ENDPOINT\x20脚本完成业务操作时使用','/api/dataset/get-dataset-list-by-app-code','获取数据集详情','/api/dataset/getOneByCode?code={datasetCode}','lovrabet\x20dataset\x20list\x20--appcode\x20<appCode>\x20--format\x20compress','dataset_data_aggregate','Endpoint\x20function\x20name','8322057rUbktm','Inspect\x20field\x20names\x20and\x20operation\x20metadata\x20for\x20a\x20known\x20dataset\x20code.','title','dataset','/api/{appCode}/{datasetCode}/getOne','appCode','category','Use\x20this\x20API\x20or\x20`lovrabet\x20dataset\x20list`\x20to\x20discover\x20available\x20dataset\x20codes\x20before\x20reading\x20data.','Get\x20one\x20dataset\x20record','lovrabet\x20data\x20create\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22name\x22:\x22demo\x22}\x27','custom_sql_execute','Returns\x20script\x20business\x20payload','{\x22appCode\x22:\x22app-aa63b188\x22,\x22sqlCode\x22:\x22xxxxxxxx-xxxxxxxx\x22,\x22params\x22:{}}','5rRWInr','dataset_data_get_one','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22currentPage\x22:1,\x22pageSize\x22:5}\x27','Show\x20runtime\x20API\x20documentation\x20by\x20code','paging.totalCount\x20gives\x20total\x20rows','bf_function_list','{\x22fieldName\x22:\x22value\x22}','5866lBlGpb','result\x20rows\x20contain\x20aggregate\x20aliases','Aggregate\x20dataset\x20data','paging\x20contains\x20pagination','2489460WcuYCd','str','/api/{appCode}/{datasetCode}/filter','7842XfjKTr','##\x20Execute\x20BF\x20endpoint\x20function\x0a\x0aExecute\x20a\x20known\x20endpoint\x20script.','{\x22param\x22:\x22value\x22}','32-character\x20dataset\x20code','需要按\x20groupBy\x20分组并做\x20count、sum、avg、max、min\x20等聚合统计时使用','trim','{\x22where\x22:{},\x22currentPage\x22:1,\x22pageSize\x22:20}','dataset_data_create','Use\x20`where`,\x20`select`,\x20`orderBy`,\x20`currentPage`,\x20and\x20`pageSize`\x20to\x20inspect\x20live\x20data\x20shape.','method','bf_execute','{\x22id\x22:123}','需要按数据集\x20code\x20获取字段、表信息或操作定义时使用','keyword','需要按\x20appCode\x20分页获取运行态数据集列表,并优先收敛可用\x20datasetCode\x20时使用','16gohwwo','创建数据','##\x20Execute\x20custom\x20SQL\x0a\x0aExecute\x20a\x20configured\x20SQL\x20script\x20by\x20sqlCode.','where\x20filters\x20before\x20aggregation','需要先确认当前应用有哪些可执行的\x20BF/ENDPOINT\x20函数,以及收敛可用\x20scriptName\x20时使用','需要向指定数据集新增一条业务数据时使用'];a1_0x5aab=function(){return _0x58236c;};return a1_0x5aab();}const a1_0x113a0=a1_0x53c9;(function(_0x465333,_0x144681){const _0x377525=a1_0x53c9,_0x2c7841=_0x465333();while(!![]){try{const _0x1710e2=parseInt(_0x377525(0x215))/0x1*(-parseInt(_0x377525(0x201))/0x2)+-parseInt(_0x377525(0x1ef))/0x3+parseInt(_0x377525(0x214))/0x4*(parseInt(_0x377525(0x1e4))/0x5)+parseInt(_0x377525(0x1f2))/0x6*(-parseInt(_0x377525(0x1eb))/0x7)+parseInt(_0x377525(0x22f))/0x8+parseInt(_0x377525(0x251))/0x9+parseInt(_0x377525(0x208))/0xa;if(_0x1710e2===_0x144681)break;else _0x2c7841['push'](_0x2c7841['shift']());}catch(_0x3ff983){_0x2c7841['push'](_0x2c7841['shift']());}}}(a1_0x5aab,0xa38bf));function a1_0x53c9(_0x2236a9,_0x1fef25){_0x2236a9=_0x2236a9-0x1e2;const _0x5aab22=a1_0x5aab();let _0x53c9aa=_0x5aab22[_0x2236a9];return _0x53c9aa;}import{CliErrors}from'../../errors.js';const CATEGORY_FLAG={'name':a1_0x113a0(0x257),'type':a1_0x113a0(0x243),'description':'Filter\x20docs\x20by\x20category,\x20for\x20example\x20dataset'},KEYWORD_FLAG={'name':a1_0x113a0(0x1ff),'type':a1_0x113a0(0x243),'description':'Search\x20docs\x20by\x20code,\x20summary,\x20path,\x20or\x20usage\x20text'},DOC_CODE_FLAG={'name':a1_0x113a0(0x248),'type':a1_0x113a0(0x243),'required':!![],'description':a1_0x113a0(0x225)},DOCS=[{'code':a1_0x113a0(0x21a),'category':a1_0x113a0(0x254),'title':a1_0x113a0(0x222),'method':'POST','path':a1_0x113a0(0x24b),'summary':a1_0x113a0(0x23d),'whenToUse':a1_0x113a0(0x200),'pathParams':[],'queryParams':[],'bodySchema':a1_0x113a0(0x211),'responseHighlights':['tableData\x20contains\x20dataset\x20id/code/name',a1_0x113a0(0x1e8)],'examples':[a1_0x113a0(0x24e)],'notes':['CLI\x20users\x20should\x20prefer\x20`lovrabet\x20dataset\x20list`\x20for\x20this\x20workflow.'],'markdown':['##\x20List\x20datasets','',a1_0x113a0(0x258)]['join']('\x0a')},{'code':a1_0x113a0(0x216),'category':a1_0x113a0(0x254),'title':a1_0x113a0(0x227),'method':a1_0x113a0(0x23a),'path':a1_0x113a0(0x24d),'summary':a1_0x113a0(0x24c),'whenToUse':a1_0x113a0(0x1fe),'pathParams':[],'queryParams':[{'name':a1_0x113a0(0x248),'description':a1_0x113a0(0x1f5)}],'bodySchema':'None','responseHighlights':[a1_0x113a0(0x20e),a1_0x113a0(0x245)],'examples':[a1_0x113a0(0x237)],'notes':[a1_0x113a0(0x235)],'markdown':[a1_0x113a0(0x218),'',a1_0x113a0(0x252)][a1_0x113a0(0x232)]('\x0a')},{'code':a1_0x113a0(0x210),'category':a1_0x113a0(0x254),'title':'Filter\x20dataset\x20data','method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x1f1),'summary':a1_0x113a0(0x209),'whenToUse':a1_0x113a0(0x249),'pathParams':[{'name':a1_0x113a0(0x256),'description':'Current\x20app\x20code'},{'name':'datasetCode','description':'32-character\x20dataset\x20code'}],'queryParams':[],'bodySchema':a1_0x113a0(0x1f8),'responseHighlights':[a1_0x113a0(0x23f),a1_0x113a0(0x1ee)],'examples':[a1_0x113a0(0x1e6)],'notes':[a1_0x113a0(0x21f)],'markdown':[a1_0x113a0(0x23c),'',a1_0x113a0(0x1fa)][a1_0x113a0(0x232)]('\x0a')},{'code':a1_0x113a0(0x24f),'category':a1_0x113a0(0x254),'title':a1_0x113a0(0x1ed),'method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x21c),'summary':a1_0x113a0(0x22b),'whenToUse':a1_0x113a0(0x1f6),'pathParams':[{'name':'appCode','description':a1_0x113a0(0x22e)},{'name':a1_0x113a0(0x226),'description':a1_0x113a0(0x1f5)}],'queryParams':[],'bodySchema':'{\x22aggregate\x22:[{\x22field\x22:\x22id\x22,\x22type\x22:\x22COUNT\x22,\x22alias\x22:\x22cnt\x22}],\x22groupBy\x22:[]}','responseHighlights':[a1_0x113a0(0x1ec),a1_0x113a0(0x204)],'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_0x113a0(0x231)],'markdown':['##\x20Aggregate\x20dataset\x20data','','Aggregate\x20supports\x20COUNT,\x20SUM,\x20AVG,\x20MAX,\x20and\x20MIN\x20definitions\x20in\x20the\x20`aggregate`\x20array.'][a1_0x113a0(0x232)]('\x0a')},{'code':a1_0x113a0(0x1e5),'category':a1_0x113a0(0x254),'title':a1_0x113a0(0x259),'method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x255),'summary':'查询单条数据','whenToUse':a1_0x113a0(0x241),'pathParams':[{'name':'appCode','description':a1_0x113a0(0x22e)},{'name':'datasetCode','description':a1_0x113a0(0x1f5)}],'queryParams':[],'bodySchema':a1_0x113a0(0x1fd),'responseHighlights':[a1_0x113a0(0x239)],'examples':[a1_0x113a0(0x21e)],'notes':[a1_0x113a0(0x228)],'markdown':a1_0x113a0(0x20f)},{'code':a1_0x113a0(0x1f9),'category':a1_0x113a0(0x254),'title':'Create\x20dataset\x20record','method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x224),'summary':a1_0x113a0(0x202),'whenToUse':a1_0x113a0(0x206),'pathParams':[{'name':'appCode','description':'Current\x20app\x20code'},{'name':a1_0x113a0(0x226),'description':a1_0x113a0(0x1f5)}],'queryParams':[],'bodySchema':a1_0x113a0(0x1ea),'responseHighlights':[a1_0x113a0(0x20d)],'examples':[a1_0x113a0(0x25a)],'notes':['This\x20is\x20a\x20write\x20operation;\x20use\x20dry-run\x20when\x20available\x20and\x20safe\x20fixtures\x20for\x20smoke\x20tests.'],'markdown':'##\x20Create\x20dataset\x20record\x0a\x0aCreate\x20one\x20data\x20record\x20in\x20a\x20dataset.'},{'code':a1_0x113a0(0x1e9),'category':'bf','title':a1_0x113a0(0x213),'method':a1_0x113a0(0x23a),'path':a1_0x113a0(0x221),'summary':a1_0x113a0(0x21d),'whenToUse':a1_0x113a0(0x205),'pathParams':[{'name':a1_0x113a0(0x256),'description':a1_0x113a0(0x22e)}],'queryParams':[],'bodySchema':a1_0x113a0(0x23e),'responseHighlights':['Returns\x20endpoint\x20functionName/id/description'],'examples':[a1_0x113a0(0x23b)],'notes':[a1_0x113a0(0x20a)],'markdown':'##\x20List\x20BF\x20endpoint\x20functions\x0a\x0aDiscover\x20executable\x20endpoint\x20functions.'},{'code':a1_0x113a0(0x1fc),'category':'bf','title':a1_0x113a0(0x219),'method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x246),'summary':a1_0x113a0(0x233),'whenToUse':a1_0x113a0(0x24a),'pathParams':[{'name':a1_0x113a0(0x256),'description':'Current\x20app\x20code'},{'name':a1_0x113a0(0x240),'description':a1_0x113a0(0x250)}],'queryParams':[],'bodySchema':a1_0x113a0(0x1f4),'responseHighlights':[a1_0x113a0(0x1e2)],'examples':[a1_0x113a0(0x236)],'notes':['Script\x20behavior\x20may\x20have\x20side\x20effects;\x20inspect\x20detail\x20first.'],'markdown':a1_0x113a0(0x1f3)},{'code':a1_0x113a0(0x25b),'category':'custom_sql','title':'Execute\x20custom\x20SQL','method':a1_0x113a0(0x20c),'path':a1_0x113a0(0x20b),'summary':'执行自定义\x20SQL','whenToUse':a1_0x113a0(0x212),'pathParams':[],'queryParams':[],'bodySchema':a1_0x113a0(0x1e3),'responseHighlights':['Returns\x20SQL\x20execution\x20payload'],'examples':[a1_0x113a0(0x234)],'notes':[a1_0x113a0(0x230)],'markdown':a1_0x113a0(0x203)}];function entrySummary(_0x166b33){const _0xa83084=a1_0x113a0;return{'code':_0x166b33[_0xa83084(0x248)],'category':_0x166b33[_0xa83084(0x257)],'method':_0x166b33['method'],'path':_0x166b33[_0xa83084(0x217)],'summary':_0x166b33[_0xa83084(0x223)],'whenToUse':_0x166b33[_0xa83084(0x22c)]};}export function listApiDocEntries(_0x56a53d={}){const _0x3ace61=a1_0x113a0,_0x4f7132=String(_0x56a53d[_0x3ace61(0x257)]||'')[_0x3ace61(0x1f7)](),_0x41f5ed=String(_0x56a53d[_0x3ace61(0x1ff)]||'')[_0x3ace61(0x1f7)]()[_0x3ace61(0x244)]();return DOCS[_0x3ace61(0x22a)](_0x478c47=>{const _0x39e372=_0x3ace61;if(_0x4f7132&&_0x478c47['category']!==_0x4f7132)return![];if(!_0x41f5ed)return!![];return[_0x478c47[_0x39e372(0x248)],_0x478c47[_0x39e372(0x257)],_0x478c47[_0x39e372(0x1fb)],_0x478c47[_0x39e372(0x217)],_0x478c47[_0x39e372(0x223)],_0x478c47['whenToUse'],_0x478c47[_0x39e372(0x253)]][_0x39e372(0x232)]('\x20')[_0x39e372(0x244)]()['includes'](_0x41f5ed);})[_0x3ace61(0x22d)](entrySummary);}export function getApiDocDetail(_0x4a9387){const _0x273add=a1_0x113a0,_0x1fa996=DOCS['find'](_0x1152e6=>_0x1152e6[_0x273add(0x248)]===_0x4a9387);if(!_0x1fa996)throw CliErrors[_0x273add(0x238)](_0x273add(0x247)+_0x4a9387);return{..._0x1fa996};}const apiDocList={'service':a1_0x113a0(0x21b),'command':'list','description':a1_0x113a0(0x220),'risk':a1_0x113a0(0x242),'requiresAppCode':![],'flags':[CATEGORY_FLAG,KEYWORD_FLAG],async 'execute'(_0x582b32){const _0x1d50e6=a1_0x113a0,_0x37b890=listApiDocEntries({'category':_0x582b32[_0x1d50e6(0x1f0)]('category'),'keyword':_0x582b32[_0x1d50e6(0x1f0)](_0x1d50e6(0x1ff))});return{'ok':!![],'data':{'total':_0x37b890[_0x1d50e6(0x229)],'items':_0x37b890}};}},apiDocDetail={'service':'api-doc','command':a1_0x113a0(0x207),'description':a1_0x113a0(0x1e7),'risk':'read','requiresAppCode':![],'flags':[DOC_CODE_FLAG],async 'execute'(_0x5351fa){const _0x3024b1=a1_0x113a0;return{'ok':!![],'data':getApiDocDetail(_0x5351fa[_0x3024b1(0x1f0)](_0x3024b1(0x248)))};}};export const apiDocDefinitions=[apiDocList,apiDocDetail];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c552f,_0x42bc4a){const _0x5483d4=a2_0x2974,_0x5b5566=_0x2c552f();while(!![]){try{const _0x208972=-parseInt(_0x5483d4(0x12b))/0x1*(-parseInt(_0x5483d4(0x131))/0x2)+parseInt(_0x5483d4(0x13b))/0x3+-parseInt(_0x5483d4(0x139))/0x4*(-parseInt(_0x5483d4(0x13f))/0x5)+-parseInt(_0x5483d4(0x135))/0x6+-parseInt(_0x5483d4(0x133))/0x7+parseInt(_0x5483d4(0x13d))/0x8*(parseInt(_0x5483d4(0x138))/0x9)+-parseInt(_0x5483d4(0x128))/0xa;if(_0x208972===_0x42bc4a)break;else _0x5b5566['push'](_0x5b5566['shift']());}catch(_0x45d05f){_0x5b5566['push'](_0x5b5566['shift']());}}}(a2_0x4c38,0x63b11));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';function a2_0x4c38(){const _0x214284=['items','2336604pPUeYm','cache','slice','27uDBsLU','124DCnMTD','.tmp','374211ZpSYai','utf8','1902920xXIKHi','update','40615jGbiph','EXDEV','ak_','code','digest','isArray','my-apps.json','stringify','trim','6254920zZwRCT','unknown','hex','135439fXVGCy','homeDirName','parse','EACCES','sha256','find','10pqsgUB','EPERM','2408539msJDOF'];a2_0x4c38=function(){return _0x214284;};return a2_0x4c38();}import{PRODUCT_CONFIG}from'../../constant/product.js';export function fingerprintAccessKey(_0x4037e6){const _0x59ffbc=a2_0x2974,_0x36513c=_0x4037e6[_0x59ffbc(0x127)](),_0x2ddd16=_0x36513c[_0x59ffbc(0x137)](-0x6)||_0x59ffbc(0x129),_0x152c65=createHash(_0x59ffbc(0x12f))[_0x59ffbc(0x13e)](_0x36513c)[_0x59ffbc(0x143)](_0x59ffbc(0x12a))['slice'](0x0,0xc);return _0x59ffbc(0x141)+_0x2ddd16+'_'+_0x152c65;}export function getAppCacheFilePath(_0x5d1a11,_0x19f106){const _0x21944a=a2_0x2974;return resolve(homedir(),PRODUCT_CONFIG[_0x21944a(0x12c)],_0x21944a(0x136),_0x5d1a11,fingerprintAccessKey(_0x19f106),_0x21944a(0x145));}export function readCachedAppList(_0x1078bc,_0x1cf46e){const _0x3d13ab=a2_0x2974;if(!_0x1cf46e?.[_0x3d13ab(0x127)]())return null;const _0xaf7845=getAppCacheFilePath(_0x1078bc,_0x1cf46e);if(!existsSync(_0xaf7845))return null;try{const _0x51d5a9=readFileSync(_0xaf7845,_0x3d13ab(0x13c));if(!_0x51d5a9[_0x3d13ab(0x127)]())return null;const _0x4492bd=JSON[_0x3d13ab(0x12d)](_0x51d5a9);if(!Array[_0x3d13ab(0x144)](_0x4492bd[_0x3d13ab(0x134)]))return null;return _0x4492bd;}catch{return null;}}function a2_0x2974(_0x3de913,_0x2ec129){_0x3de913=_0x3de913-0x126;const _0x4c3806=a2_0x4c38();let _0x29748f=_0x4c3806[_0x3de913];return _0x29748f;}export function writeCachedAppList(_0x15a13f,_0x31a38a,_0x6694e8){const _0xa5645a=a2_0x2974,_0x5d6039=getAppCacheFilePath(_0x15a13f,_0x31a38a),_0x5d9618=dirname(_0x5d6039);!existsSync(_0x5d9618)&&mkdirSync(_0x5d9618,{'recursive':!![]});const _0x5cafe2=_0x5d6039+_0xa5645a(0x13a);try{writeFileSync(_0x5cafe2,JSON[_0xa5645a(0x126)](_0x6694e8,null,0x2)+'\x0a',{'encoding':_0xa5645a(0x13c),'mode':0x180});try{renameSync(_0x5cafe2,_0x5d6039);}catch(_0x31d455){if(_0x31d455['code']===_0xa5645a(0x132)||_0x31d455['code']===_0xa5645a(0x140)||_0x31d455[_0xa5645a(0x142)]===_0xa5645a(0x12e)){writeFileSync(_0x5d6039,JSON[_0xa5645a(0x126)](_0x6694e8,null,0x2)+'\x0a',{'encoding':'utf8'});try{unlinkSync(_0x5cafe2);}catch{}}else throw _0x31d455;}}catch(_0x51b9ac){try{unlinkSync(_0x5cafe2);}catch{}throw _0x51b9ac;}return _0x5d6039;}export function resolveCachedAppCode(_0x2468c3,_0x5d4b53,_0x24b50c){const _0x24256e=a2_0x2974;if(!_0x2468c3)return undefined;const _0x16de38=readCachedAppList(_0x5d4b53,_0x24b50c),_0x1c3ae2=_0x16de38?.[_0x24256e(0x134)][_0x24256e(0x130)](_0x1db049=>_0x1db049['appName']===_0x2468c3);return _0x1c3ae2?.['appCode']?.[_0x24256e(0x127)]()||undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a3_0x2f3f65=a3_0x3a4f;(function(_0x1a9078,_0x452772){const _0x4dd4bd=a3_0x3a4f,_0x4597c0=_0x1a9078();while(!![]){try{const _0x898e5e=-parseInt(_0x4dd4bd(0xd6))/0x1+-parseInt(_0x4dd4bd(0x9d))/0x2*(-parseInt(_0x4dd4bd(0xbf))/0x3)+parseInt(_0x4dd4bd(0xd1))/0x4+parseInt(_0x4dd4bd(0xcc))/0x5+-parseInt(_0x4dd4bd(0xa5))/0x6*(parseInt(_0x4dd4bd(0x83))/0x7)+parseInt(_0x4dd4bd(0xb2))/0x8*(parseInt(_0x4dd4bd(0xa4))/0x9)+-parseInt(_0x4dd4bd(0xb9))/0xa;if(_0x898e5e===_0x452772)break;else _0x4597c0['push'](_0x4597c0['shift']());}catch(_0x4b005b){_0x4597c0['push'](_0x4597c0['shift']());}}}(a3_0x8307,0xba291));import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';function a3_0x3a4f(_0x45c85e,_0x30f9d2){_0x45c85e=_0x45c85e-0x81;const _0x83071f=a3_0x8307();let _0x3a4f7b=_0x83071f[_0x45c85e];return _0x3a4f7b;}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_0x2f3f65(0xb7),'type':'boolean','description':a3_0x2f3f65(0xcd),'default':![]};function collectFlags(_0x5a043e,_0x5721d2){const _0x3ceb27=a3_0x2f3f65,_0x5350f4={};for(const _0x8db2cb of _0x5721d2){const _0x1740b8=_0x8db2cb[_0x3ceb27(0x93)]===_0x3ceb27(0xcb)?_0x5a043e[_0x3ceb27(0x96)](_0x8db2cb[_0x3ceb27(0x9c)]):_0x5a043e['str'](_0x8db2cb['name']);if(_0x1740b8!==''&&_0x1740b8!==![])_0x5350f4[_0x8db2cb[_0x3ceb27(0x9c)]]=_0x1740b8;}if(_0x5a043e[_0x3ceb27(0xc4)])_0x5350f4[_0x3ceb27(0xc4)]=!![];return _0x5350f4;}function a3_0x8307(){const _0xb9aead=['remote','Read\x20from\x20local\x20cache\x20only','read','name','161074wJAUcE','args','Use\x20`','No\x20apps\x20found\x20on\x20the\x20platform.','production','trim','config','9VnOMyG','6rxXoCF','string','appPublishStatus','No\x20cached\x20apps\x20found.','source','local','raw','str','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','cachePath','use','appOwnerName','push','10757584VXeJXk','length','project-default','cache','env','global','Available\x20remote\x20apps:\x20','16173560HcStaV','\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.','validation','fetchedAt','Filter\x20by\x20environment\x20(default:\x20current\x20env)','items','39FVwUPt','App\x20\x22','\x20app\x20use\x20<name>\x20[--global]','\x20config\x20file','appCode','nonInteractive','envName','.appcode\x20to\x20.lovrabet.json.','Default\x20app\x20candidate\x20set\x20to\x20\x22','i18nInfo','Usage:\x20','newConfigFileName','boolean','4178315IBzCOI','Use\x20global\x20config\x20scope','app','Target\x20environment\x20(default:\x20current\x20env)','find','3547748OsDszQ','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','\x20cached\x20app(s)\x20for\x20env=\x22','write','../../commands/app/remote-source.js','832804IOFctM','defaultApp','Refreshed\x20app\x20cache\x20with\x20','6311242JiQTKd','appName','mergedCli','init','pull','entries','Read\x20app\x20list\x20from\x20local\x20cache\x20only','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','appcode','globalPath','map','enableI18n','import','from','Missing\x20app\x20name.','List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','type','accessKey','no-cache','bool','../../context.js','projectPath'];a3_0x8307=function(){return _0xb9aead;};return a3_0x8307();}function normalizeLanguages(_0xb205f7){const _0x314c86=a3_0x2f3f65;if(!Array['isArray'](_0xb205f7))return[];return _0xb205f7['filter'](_0x4caf0f=>typeof _0x4caf0f===_0x314c86(0xa6))[_0x314c86(0x8d)](_0x1fdcb1=>_0x1fdcb1[_0x314c86(0xa2)]())['filter'](Boolean);}function buildRemoteAppI18nFields(_0x54e3a6){const _0x503ccd=a3_0x2f3f65,_0x35864e=normalizeLanguages(_0x54e3a6[_0x503ccd(0xc8)]?.['langs']);return{'enableI18n':typeof _0x54e3a6['enableI18n']==='boolean'?_0x54e3a6[_0x503ccd(0x8e)]:null,'languages':_0x35864e,'i18nInfo':_0x54e3a6[_0x503ccd(0xc8)]?{..._0x54e3a6[_0x503ccd(0xc8)],'langs':_0x35864e[_0x503ccd(0xb3)]?_0x35864e:null}:null};}const initDef={'service':a3_0x2f3f65(0xce),'command':a3_0x2f3f65(0x86),'description':'Initialize\x20'+PRODUCT_CONFIG[a3_0x2f3f65(0xca)]+a3_0x2f3f65(0xc2),'risk':a3_0x2f3f65(0xd4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0xb83b11){return await runInit(collectFlags(_0xb83b11,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x2f3f65(0xce),'command':'list','description':a3_0x2f3f65(0x92),'risk':a3_0x2f3f65(0x9b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x2f3f65(0xb6),'type':a3_0x2f3f65(0xa6),'description':a3_0x2f3f65(0xbd),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x2f3f65(0xaa),'type':a3_0x2f3f65(0xcb),'description':a3_0x2f3f65(0x89),'default':![]},{'name':a3_0x2f3f65(0x95),'type':a3_0x2f3f65(0xcb),'description':a3_0x2f3f65(0xd2),'default':![]}],async 'execute'(_0x2c083e){const _0x472770=a3_0x2f3f65,_0x398971=_0x2c083e['str'](_0x472770(0xb6))||_0x2c083e[_0x472770(0xc5)]||getEnv()||_0x472770(0xa1),_0x4f2d50=_0x2c083e['bool'](_0x472770(0xaa)),_0x56f158=_0x2c083e[_0x472770(0x96)](_0x472770(0x95)),{readRawConfigWithLayers:_0x21a053,resolveDefaultAppSource:_0x1f9855,getLocalAppAliases:_0x32072a}=await import('../../context.js'),{getRemoteAppList:_0x1ae19f}=await import(_0x472770(0xd5)),{config:_0x415c8f,layers:_0x37373d}=_0x21a053(),_0x583ea2=_0x1f9855(_0x37373d),{defaultApp:_0x264baf}=_0x415c8f,_0x5904d7=await _0x1ae19f({'env':_0x398971,'accessKey':_0x2c083e[_0x472770(0x94)],'localOnly':_0x4f2d50,'noCache':_0x56f158}),_0x2457b2=_0x5904d7[_0x472770(0xbe)]['map'](_0x448f66=>{const _0xee0989=_0x472770;return{'name':_0x448f66[_0xee0989(0x84)],'appcode':_0x448f66[_0xee0989(0xc3)],'named':!![],'definedIn':_0xee0989(0x99),'isDefault':_0x448f66[_0xee0989(0x84)]===_0x264baf,...buildAppProfileListFields(_0x398971),...buildRemoteAppI18nFields(_0x448f66),'source':_0x5904d7[_0xee0989(0xa9)],'owner':_0x448f66[_0xee0989(0xb0)]??null,'status':_0x448f66[_0xee0989(0xa7)]??null,'cachedAt':_0x5904d7['fetchedAt']};}),_0x37af1f=_0x32072a(_0x415c8f);let _0x59855e=0x0;for(const [_0x5741e0,_0x412963]of Object[_0x472770(0x88)](_0x37af1f)){const _0x310e6f=typeof _0x412963[_0x472770(0x8b)]===_0x472770(0xa6)?_0x412963[_0x472770(0x8b)][_0x472770(0xa2)]():'';if(!_0x310e6f)continue;_0x59855e+=0x1,_0x2457b2[_0x472770(0xb1)]({'name':_0x5741e0,'appcode':_0x310e6f,'named':!![],'definedIn':_0x472770(0xaa),'isDefault':_0x5741e0===_0x264baf,...buildAppProfileListFields(_0x398971),'source':_0x472770(0xa3),'owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x2457b2,_0x2c083e[_0x472770(0x85)]);if(_0x2457b2[_0x472770(0xb3)]===0x0)return{'ok':!![],'data':[],'message':_0x5904d7['source']===_0x472770(0xb5)?_0x472770(0xa8):_0x472770(0xa0)};const _0x3ffb59=_0x2457b2[_0x472770(0xd0)](_0x586477=>_0x586477['isCurrent']===!![]),_0x5e375a=_0x264baf??_0x3ffb59?.[_0x472770(0x9c)]??null,_0x50f1a1={'env':_0x398971,'source':_0x5904d7[_0x472770(0xa9)],'fetchedAt':_0x5904d7[_0x472770(0xbc)],'cachePath':_0x5904d7[_0x472770(0xae)],'globalPath':_0x37373d[_0x472770(0x8c)]??null,'projectPath':_0x37373d[_0x472770(0x98)]??null,'defaultApp':_0x5e375a,'defaultAppSource':_0x264baf!=null?_0x583ea2:null,'localAliasCount':_0x59855e};return{'ok':!![],'data':{'items':_0x2457b2,'meta':_0x50f1a1}};}},pullDef={'service':a3_0x2f3f65(0xce),'command':a3_0x2f3f65(0x87),'description':'Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','risk':a3_0x2f3f65(0xd4),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'env','type':a3_0x2f3f65(0xa6),'description':a3_0x2f3f65(0xcf),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x2f3f65(0xcb),'description':a3_0x2f3f65(0x9a),'default':![]},{'name':a3_0x2f3f65(0x95),'type':'boolean','description':'Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','default':![]}],async 'execute'(_0x1bbdc0){const _0x313206=a3_0x2f3f65,_0x4b69c8=_0x1bbdc0['str']('env')||_0x1bbdc0[_0x313206(0xc5)]||getEnv()||_0x313206(0xa1),_0x52a638=_0x1bbdc0[_0x313206(0x96)](_0x313206(0xaa)),_0x29de3b=_0x1bbdc0[_0x313206(0x96)](_0x313206(0x95)),{getRemoteAppList:_0x266c5d}=await import('../../commands/app/remote-source.js'),_0x3417a2=await _0x266c5d({'env':_0x4b69c8,'accessKey':_0x1bbdc0[_0x313206(0x94)],'localOnly':_0x52a638,'noCache':_0x29de3b});return{'ok':!![],'data':{'total':_0x3417a2[_0x313206(0xbe)][_0x313206(0xb3)],'env':_0x4b69c8,'source':_0x3417a2[_0x313206(0xa9)],'fetchedAt':_0x3417a2[_0x313206(0xbc)],'cachePath':_0x3417a2[_0x313206(0xae)]},'message':_0x3417a2[_0x313206(0xa9)]===_0x313206(0xb5)?'Loaded\x20'+_0x3417a2[_0x313206(0xbe)]['length']+_0x313206(0xd3)+_0x4b69c8+'\x22.':_0x313206(0x82)+_0x3417a2['items']['length']+'\x20app(s)\x20for\x20env=\x22'+_0x4b69c8+'\x22.'};}},useDef={'service':'app','command':a3_0x2f3f65(0xaf),'description':'Set\x20the\x20fallback\x20app\x20candidate','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'name','description':'Remote\x20app\x20name\x20to\x20activate','required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x9d8d8b){const _0x17e07d=a3_0x2f3f65;if(!_0x9d8d8b[_0x17e07d(0x9e)][0x0])throw CliErrors[_0x17e07d(0xbb)](_0x17e07d(0x91),'Usage:\x20'+CLI_BIN_NAME+_0x17e07d(0xc1));},async 'execute'(_0x1cbbf1){const _0x4ab3a4=a3_0x2f3f65,_0x53ebe2=_0x1cbbf1[_0x4ab3a4(0x9e)][0x0];if(!_0x53ebe2)throw CliErrors[_0x4ab3a4(0xbb)]('Missing\x20app\x20name.',_0x4ab3a4(0xc9)+CLI_BIN_NAME+_0x4ab3a4(0xc1));const {buildConfigFromFlags:_0x5e094b,resolveLocalAppAliasCode:_0x32dc69}=await import(_0x4ab3a4(0x97)),{readCachedAppList:_0x5c760e}=await import('../../commands/app/cache.js'),_0x27dffc=_0x1cbbf1[_0x4ab3a4(0xac)](_0x4ab3a4(0xb6)),_0x593f3c=_0x5e094b(_0x27dffc?{'env':_0x27dffc}:{}),_0x4b7d19=_0x5c760e(_0x593f3c[_0x4ab3a4(0xb6)],_0x593f3c[_0x4ab3a4(0x94)]),_0x2a2f48=_0x4b7d19?.[_0x4ab3a4(0xbe)][_0x4ab3a4(0xd0)](_0x27d9da=>_0x27d9da[_0x4ab3a4(0x84)]===_0x53ebe2),_0x5a4cdb=_0x32dc69(_0x593f3c[_0x4ab3a4(0xab)]??{},_0x53ebe2);if(!_0x2a2f48&&!_0x5a4cdb&&_0x593f3c[_0x4ab3a4(0x81)]!==_0x53ebe2){const _0x1061c8=[..._0x4b7d19?.[_0x4ab3a4(0xbe)]['map'](_0x1bca04=>_0x1bca04[_0x4ab3a4(0x84)])??[]],_0x2a3bd0=_0x1061c8[_0x4ab3a4(0xb3)]===0x0?_0x4ab3a4(0x9f)+CLI_BIN_NAME+_0x4ab3a4(0xba)+_0x53ebe2+_0x4ab3a4(0xc6):_0x4ab3a4(0xb8)+Array[_0x4ab3a4(0x90)](new Set(_0x1061c8))['join'](',\x20')+_0x4ab3a4(0xad);throw CliErrors['validation'](_0x4ab3a4(0xc0)+_0x53ebe2+'\x22\x20not\x20found.',_0x2a3bd0);}const _0x550ce3=_0x1cbbf1['bool']('global');let _0x20f0d8;if(_0x550ce3)_0x20f0d8={'global':!![]};else{const {isInProject:_0x3ff6a1}=await import(_0x4ab3a4(0x97)),_0x4a9ee0=_0x3ff6a1();_0x20f0d8=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0x4ab3a4(0xb4),'inProject':_0x4a9ee0}));}const _0x2bba01=readConfig(_0x20f0d8);return _0x2bba01[_0x4ab3a4(0x81)]=_0x53ebe2,writeConfig(_0x2bba01,_0x20f0d8),{'ok':!![],'message':_0x4ab3a4(0xc7)+_0x53ebe2+'\x22'+scopeLabel(_0x20f0d8)+'.'};}},importDef={'service':'app','command':a3_0x2f3f65(0x8f),'description':a3_0x2f3f65(0x8a),'risk':a3_0x2f3f65(0xd4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x4ba663){return await runInitImport(collectFlags(_0x4ba663,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
1
|
+
function a3_0x5e49(){const _0x30834d=['5895832KKQAKb','from','map','487304AIJkom','fetchedAt','Default\x20app\x20candidate\x20set\x20to\x20\x22','366witsog','.\x20Local\x20aliases\x20can\x20be\x20added\x20under\x20apps.<alias>.appcode.','args','Remote\x20app\x20name\x20to\x20activate','85561cblpRw','pull','projectPath','mergedCli','321100cjdtxf','i18nInfo','Usage:\x20','Missing\x20app\x20name.','1177328ZArjcp','length','1597470XDacLW','project-default','env','Loaded\x20','global','Initialize\x20','appPublishStatus','Target\x20environment\x20(default:\x20current\x20env)','join','Import\x20the\x20default\x20app\x20selection\x20from\x20a\x20.rabetbase.json\x20file','Available\x20remote\x20apps:\x20','production','\x20app(s)\x20for\x20env=\x22','App\x20\x22','9IuQzej','remote','Use\x20global\x20config\x20scope','No\x20apps\x20found\x20on\x20the\x20platform.','defaultApp','3617035KTbfIi','string','Set\x20the\x20fallback\x20app\x20candidate','appName','cache','../../commands/app/cache.js','globalPath','init','validation','../../context.js','str','Refresh\x20the\x20local\x20app\x20cache\x20from\x20the\x20platform','name','envName','items','Read\x20app\x20list\x20from\x20local\x20cache\x20only','cachePath','appCode','isCurrent','app','boolean','Force\x20remote\x20fetch\x20and\x20refresh\x20local\x20cache','filter','Use\x20`','Filter\x20by\x20environment\x20(default:\x20current\x20env)','local','\x22\x20not\x20found.','import','entries','push','\x20app\x20use\x20<name>\x20[--global]','appOwnerName','appcode','write','find','newConfigFileName','trim','bool','9LCCPFG','enableI18n','accessKey','langs','nonInteractive','no-cache','source'];a3_0x5e49=function(){return _0x30834d;};return a3_0x5e49();}const a3_0x245a1e=a3_0x1400;(function(_0xe4c1ef,_0x4c4c85){const _0x3be78d=a3_0x1400,_0x1eb576=_0xe4c1ef();while(!![]){try{const _0x35047b=-parseInt(_0x3be78d(0xfe))/0x1+parseInt(_0x3be78d(0xb9))/0x2+parseInt(_0x3be78d(0xc9))/0x3*(-parseInt(_0x3be78d(0xb5))/0x4)+parseInt(_0x3be78d(0xce))/0x5+parseInt(_0x3be78d(0x101))/0x6*(-parseInt(_0x3be78d(0xb1))/0x7)+-parseInt(_0x3be78d(0xfb))/0x8*(-parseInt(_0x3be78d(0xf4))/0x9)+-parseInt(_0x3be78d(0xbb))/0xa;if(_0x35047b===_0x4c4c85)break;else _0x1eb576['push'](_0x1eb576['shift']());}catch(_0x2e52ed){_0x1eb576['push'](_0x1eb576['shift']());}}}(a3_0x5e49,0x65753));function a3_0x1400(_0x556431,_0x19858d){_0x556431=_0x556431-0xb1;const _0x5e49d6=a3_0x5e49();let _0x1400f4=_0x5e49d6[_0x556431];return _0x1400f4;}import{CliErrors}from'../../errors.js';import{PRODUCT_CONFIG}from'../../constant/product.js';import{initCreateFlagDefs,initImportFlagDefs,runInit,runInitImport}from'../../commands/init.js';import{getEnv,RUNTIME_ENV_VALUES}from'../../constant/env.js';import{buildAppProfileListFields}from'../../config/schema.js';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_0x245a1e(0xbf),'type':a3_0x245a1e(0xe2),'description':a3_0x245a1e(0xcb),'default':![]};function collectFlags(_0x57923c,_0x5a7a00){const _0x484d48=a3_0x245a1e,_0x451f98={};for(const _0x4fe5e7 of _0x5a7a00){const _0x134ee9=_0x4fe5e7['type']===_0x484d48(0xe2)?_0x57923c[_0x484d48(0xf3)](_0x4fe5e7[_0x484d48(0xda)]):_0x57923c[_0x484d48(0xd8)](_0x4fe5e7['name']);if(_0x134ee9!==''&&_0x134ee9!==![])_0x451f98[_0x4fe5e7[_0x484d48(0xda)]]=_0x134ee9;}if(_0x57923c[_0x484d48(0xf8)])_0x451f98[_0x484d48(0xf8)]=!![];return _0x451f98;}function normalizeLanguages(_0x2b4b68){const _0x241069=a3_0x245a1e;if(!Array['isArray'](_0x2b4b68))return[];return _0x2b4b68[_0x241069(0xe4)](_0x5d8af9=>typeof _0x5d8af9===_0x241069(0xcf))[_0x241069(0xfd)](_0x18b535=>_0x18b535[_0x241069(0xf2)]())[_0x241069(0xe4)](Boolean);}function buildRemoteAppI18nFields(_0x5a08af){const _0x480731=a3_0x245a1e,_0x4d5a58=normalizeLanguages(_0x5a08af[_0x480731(0xb6)]?.[_0x480731(0xf7)]);return{'enableI18n':typeof _0x5a08af[_0x480731(0xf5)]==='boolean'?_0x5a08af['enableI18n']:null,'languages':_0x4d5a58,'i18nInfo':_0x5a08af[_0x480731(0xb6)]?{..._0x5a08af['i18nInfo'],'langs':_0x4d5a58[_0x480731(0xba)]?_0x4d5a58:null}:null};}const initDef={'service':'app','command':a3_0x245a1e(0xd5),'description':a3_0x245a1e(0xc0)+PRODUCT_CONFIG[a3_0x245a1e(0xf1)]+'\x20config\x20file','risk':a3_0x245a1e(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initCreateFlagDefs,async 'execute'(_0x4b06f7){return await runInit(collectFlags(_0x4b06f7,initCreateFlagDefs)),{'ok':!![]};}},listDef={'service':a3_0x245a1e(0xe1),'command':'list','description':'List\x20apps\x20available\x20to\x20the\x20current\x20access\x20key','risk':'read','requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[{'name':a3_0x245a1e(0xbd),'type':a3_0x245a1e(0xcf),'description':a3_0x245a1e(0xe6),'enum':[...RUNTIME_ENV_VALUES]},{'name':a3_0x245a1e(0xe7),'type':a3_0x245a1e(0xe2),'description':a3_0x245a1e(0xdd),'default':![]},{'name':a3_0x245a1e(0xf9),'type':'boolean','description':a3_0x245a1e(0xe3),'default':![]}],async 'execute'(_0x11a787){const _0x19f3cf=a3_0x245a1e,_0xe43c12=_0x11a787[_0x19f3cf(0xd8)](_0x19f3cf(0xbd))||_0x11a787[_0x19f3cf(0xdb)]||getEnv()||_0x19f3cf(0xc6),_0x49e49b=_0x11a787[_0x19f3cf(0xf3)]('local'),_0x10732f=_0x11a787[_0x19f3cf(0xf3)]('no-cache'),{readRawConfigWithLayers:_0x5188d9,resolveDefaultAppSource:_0x378379,getLocalAppAliases:_0x3cb9f9}=await import(_0x19f3cf(0xd7)),{getRemoteAppList:_0x5bfb34}=await import('../../commands/app/remote-source.js'),{config:_0x51b432,layers:_0x39b7a5}=_0x5188d9(),_0x4134fc=_0x378379(_0x39b7a5),{defaultApp:_0x1f300a}=_0x51b432,_0x37b753=await _0x5bfb34({'env':_0xe43c12,'accessKey':_0x11a787[_0x19f3cf(0xf6)],'localOnly':_0x49e49b,'noCache':_0x10732f}),_0x351e3c=_0x37b753[_0x19f3cf(0xdc)][_0x19f3cf(0xfd)](_0x27fa7b=>{const _0x2976d6=_0x19f3cf;return{'name':_0x27fa7b[_0x2976d6(0xd1)],'appcode':_0x27fa7b[_0x2976d6(0xdf)],'named':!![],'definedIn':_0x2976d6(0xca),'isDefault':_0x27fa7b[_0x2976d6(0xd1)]===_0x1f300a,...buildAppProfileListFields(_0xe43c12),...buildRemoteAppI18nFields(_0x27fa7b),'source':_0x37b753[_0x2976d6(0xfa)],'owner':_0x27fa7b[_0x2976d6(0xed)]??null,'status':_0x27fa7b[_0x2976d6(0xc1)]??null,'cachedAt':_0x37b753['fetchedAt']};}),_0x5a68a0=_0x3cb9f9(_0x51b432);let _0x5ba497=0x0;for(const [_0x38d4e7,_0xa75b7d]of Object[_0x19f3cf(0xea)](_0x5a68a0)){const _0x57c9a4=typeof _0xa75b7d[_0x19f3cf(0xee)]===_0x19f3cf(0xcf)?_0xa75b7d[_0x19f3cf(0xee)][_0x19f3cf(0xf2)]():'';if(!_0x57c9a4)continue;_0x5ba497+=0x1,_0x351e3c[_0x19f3cf(0xeb)]({'name':_0x38d4e7,'appcode':_0x57c9a4,'named':!![],'definedIn':'local','isDefault':_0x38d4e7===_0x1f300a,...buildAppProfileListFields(_0xe43c12),'source':'config','owner':null,'status':null,'cachedAt':null});}enrichAppListItemsWithMergedSelection(_0x351e3c,_0x11a787[_0x19f3cf(0xb4)]);if(_0x351e3c[_0x19f3cf(0xba)]===0x0)return{'ok':!![],'data':[],'message':_0x37b753['source']===_0x19f3cf(0xd2)?'No\x20cached\x20apps\x20found.':_0x19f3cf(0xcc)};const _0xe5a37e=_0x351e3c[_0x19f3cf(0xf0)](_0x838519=>_0x838519[_0x19f3cf(0xe0)]===!![]),_0x47ee3d=_0x1f300a??_0xe5a37e?.['name']??null,_0x1b8f55={'env':_0xe43c12,'source':_0x37b753[_0x19f3cf(0xfa)],'fetchedAt':_0x37b753[_0x19f3cf(0xff)],'cachePath':_0x37b753[_0x19f3cf(0xde)],'globalPath':_0x39b7a5[_0x19f3cf(0xd4)]??null,'projectPath':_0x39b7a5[_0x19f3cf(0xb3)]??null,'defaultApp':_0x47ee3d,'defaultAppSource':_0x1f300a!=null?_0x4134fc:null,'localAliasCount':_0x5ba497};return{'ok':!![],'data':{'items':_0x351e3c,'meta':_0x1b8f55}};}},pullDef={'service':'app','command':a3_0x245a1e(0xb2),'description':a3_0x245a1e(0xd9),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a3_0x245a1e(0xbd),'type':a3_0x245a1e(0xcf),'description':a3_0x245a1e(0xc2),'enum':[...RUNTIME_ENV_VALUES]},{'name':'local','type':a3_0x245a1e(0xe2),'description':'Read\x20from\x20local\x20cache\x20only','default':![]},{'name':a3_0x245a1e(0xf9),'type':a3_0x245a1e(0xe2),'description':a3_0x245a1e(0xe3),'default':![]}],async 'execute'(_0x495f5a){const _0x1e03c1=a3_0x245a1e,_0x33ee7f=_0x495f5a[_0x1e03c1(0xd8)]('env')||_0x495f5a[_0x1e03c1(0xdb)]||getEnv()||_0x1e03c1(0xc6),_0x23747c=_0x495f5a[_0x1e03c1(0xf3)](_0x1e03c1(0xe7)),_0x19fc76=_0x495f5a[_0x1e03c1(0xf3)](_0x1e03c1(0xf9)),{getRemoteAppList:_0x3d6b4a}=await import('../../commands/app/remote-source.js'),_0x7415a7=await _0x3d6b4a({'env':_0x33ee7f,'accessKey':_0x495f5a[_0x1e03c1(0xf6)],'localOnly':_0x23747c,'noCache':_0x19fc76});return{'ok':!![],'data':{'total':_0x7415a7['items']['length'],'env':_0x33ee7f,'source':_0x7415a7[_0x1e03c1(0xfa)],'fetchedAt':_0x7415a7['fetchedAt'],'cachePath':_0x7415a7[_0x1e03c1(0xde)]},'message':_0x7415a7['source']==='cache'?_0x1e03c1(0xbe)+_0x7415a7[_0x1e03c1(0xdc)][_0x1e03c1(0xba)]+'\x20cached\x20app(s)\x20for\x20env=\x22'+_0x33ee7f+'\x22.':'Refreshed\x20app\x20cache\x20with\x20'+_0x7415a7[_0x1e03c1(0xdc)][_0x1e03c1(0xba)]+_0x1e03c1(0xc7)+_0x33ee7f+'\x22.'};}},useDef={'service':a3_0x245a1e(0xe1),'command':'use','description':a3_0x245a1e(0xd0),'risk':a3_0x245a1e(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a3_0x245a1e(0xda),'description':a3_0x245a1e(0x104),'required':!![]}],'flags':[GLOBAL_FLAG],async 'validate'(_0x35055e){const _0x38f364=a3_0x245a1e;if(!_0x35055e['args'][0x0])throw CliErrors['validation'](_0x38f364(0xb8),'Usage:\x20'+CLI_BIN_NAME+_0x38f364(0xec));},async 'execute'(_0x5031f3){const _0xb84cc0=a3_0x245a1e,_0x5289c6=_0x5031f3[_0xb84cc0(0x103)][0x0];if(!_0x5289c6)throw CliErrors[_0xb84cc0(0xd6)](_0xb84cc0(0xb8),_0xb84cc0(0xb7)+CLI_BIN_NAME+_0xb84cc0(0xec));const {buildConfigFromFlags:_0x27bfe4,resolveLocalAppAliasCode:_0x41800f}=await import('../../context.js'),{readCachedAppList:_0x595dd2}=await import(_0xb84cc0(0xd3)),_0x57e35d=_0x5031f3[_0xb84cc0(0xd8)]('env'),_0x269d3d=_0x27bfe4(_0x57e35d?{'env':_0x57e35d}:{}),_0x5b00f9=_0x595dd2(_0x269d3d[_0xb84cc0(0xbd)],_0x269d3d[_0xb84cc0(0xf6)]),_0x2ad846=_0x5b00f9?.['items'][_0xb84cc0(0xf0)](_0x1e7e5f=>_0x1e7e5f[_0xb84cc0(0xd1)]===_0x5289c6),_0x266da4=_0x41800f(_0x269d3d['raw']??{},_0x5289c6);if(!_0x2ad846&&!_0x266da4&&_0x269d3d['defaultApp']!==_0x5289c6){const _0x1d473c=[..._0x5b00f9?.['items']['map'](_0x41f4d4=>_0x41f4d4[_0xb84cc0(0xd1)])??[]],_0x5060dd=_0x1d473c[_0xb84cc0(0xba)]===0x0?_0xb84cc0(0xe5)+CLI_BIN_NAME+'\x20app\x20list`\x20to\x20discover\x20remote\x20apps,\x20or\x20add\x20apps.'+_0x5289c6+'.appcode\x20to\x20.lovrabet.json.':_0xb84cc0(0xc5)+Array[_0xb84cc0(0xfc)](new Set(_0x1d473c))[_0xb84cc0(0xc3)](',\x20')+_0xb84cc0(0x102);throw CliErrors[_0xb84cc0(0xd6)](_0xb84cc0(0xc8)+_0x5289c6+_0xb84cc0(0xe8),_0x5060dd);}const _0x6d572d=_0x5031f3[_0xb84cc0(0xf3)](_0xb84cc0(0xbf));let _0xac81e9;if(_0x6d572d)_0xac81e9={'global':!![]};else{const {isInProject:_0x1a8bb8}=await import(_0xb84cc0(0xd7)),_0x529f50=_0x1a8bb8();_0xac81e9=toScopeFlags(resolveConfigScope({'explicitGlobal':![],'policy':_0xb84cc0(0xbc),'inProject':_0x529f50}));}const _0x56c3f6=readConfig(_0xac81e9);return _0x56c3f6[_0xb84cc0(0xcd)]=_0x5289c6,writeConfig(_0x56c3f6,_0xac81e9),{'ok':!![],'message':_0xb84cc0(0x100)+_0x5289c6+'\x22'+scopeLabel(_0xac81e9)+'.'};}},importDef={'service':a3_0x245a1e(0xe1),'command':a3_0x245a1e(0xe9),'description':a3_0x245a1e(0xc4),'risk':a3_0x245a1e(0xef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initImportFlagDefs,async 'execute'(_0x1f4275){return await runInitImport(collectFlags(_0x1f4275,initImportFlagDefs)),{'ok':!![]};}};export const appDefinitions=[initDef,listDef,pullDef,useDef,importDef];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x37f956,_0x3ceffd){const _0x95e98e=a4_0x41ea,_0x275bda=_0x37f956();while(!![]){try{const _0xb207b6=parseInt(_0x95e98e(0x173))/0x1*(-parseInt(_0x95e98e(0x182))/0x2)+-parseInt(_0x95e98e(0x181))/0x3*(parseInt(_0x95e98e(0x17e))/0x4)+parseInt(_0x95e98e(0x172))/0x5+-parseInt(_0x95e98e(0x17c))/0x6+-parseInt(_0x95e98e(0x174))/0x7+parseInt(_0x95e98e(0x178))/0x8+-parseInt(_0x95e98e(0x179))/0x9*(-parseInt(_0x95e98e(0x175))/0xa);if(_0xb207b6===_0x3ceffd)break;else _0x275bda['push'](_0x275bda['shift']());}catch(_0x122244){_0x275bda['push'](_0x275bda['shift']());}}}(a4_0x3b57,0x76dfa));import{fileURLToPath}from'url';import{dirname,join}from'path';import{readFileSync}from'fs';function a4_0x41ea(_0x2b3646,_0x1721c0){_0x2b3646=_0x2b3646-0x172;const _0x3b5775=a4_0x3b57();let _0x41eaa6=_0x3b5775[_0x2b3646];return _0x41eaa6;}function a4_0x3b57(){const _0x548e63=['parse','3FXSYdS','95516cZACLD','2647830AzjjmL','11NaXEmU','4574185ddHCmH','2809070cMjrdI','tableData','data','1295856GeXkoE','45QcpHht','utf-8','Mock\x20API\x20error:\x20','2022798FtFcfh','errorCode','373004ovQMoT','errorMsg'];a4_0x3b57=function(){return _0x548e63;};return a4_0x3b57();}const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function loadMockAppList(){const _0x2f5fcd=a4_0x41ea,_0x406222=join(__dirname,'../../../mock/app-list.json'),_0x55e67a=readFileSync(_0x406222,_0x2f5fcd(0x17a));return JSON[_0x2f5fcd(0x180)](_0x55e67a);}let _cached=null;export function getMockAppList(){return!_cached&&(_cached=loadMockAppList()),_cached;}export function getMockRemoteAppItems(){const _0x592fe4=a4_0x41ea,_0x21bb45=getMockAppList();if(!_0x21bb45['success'])throw new Error(_0x592fe4(0x17b)+_0x21bb45[_0x592fe4(0x17f)]+'\x20('+_0x21bb45[_0x592fe4(0x17d)]+')');return _0x21bb45[_0x592fe4(0x177)][_0x592fe4(0x176)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a5_0x4681(_0xc26958,_0x3002c3){_0xc26958=_0xc26958-0xfb;const _0xc12021=a5_0xc120();let _0x4681aa=_0xc12021[_0xc26958];return _0x4681aa;}(function(_0x4ed337,_0x335631){const _0x18a512=a5_0x4681,_0x22f745=_0x4ed337();while(!![]){try{const _0x5597cd=parseInt(_0x18a512(0x106))/0x1+-parseInt(_0x18a512(0x100))/0x2+-parseInt(_0x18a512(0xfc))/0x3+parseInt(_0x18a512(0x105))/0x4+parseInt(_0x18a512(0x109))/0x5*(parseInt(_0x18a512(0x104))/0x6)+parseInt(_0x18a512(0xfb))/0x7+-parseInt(_0x18a512(0x107))/0x8;if(_0x5597cd===_0x335631)break;else _0x22f745['push'](_0x22f745['shift']());}catch(_0x41ba31){_0x22f745['push'](_0x22f745['shift']());}}}(a5_0xc120,0xf3c44));import{getMyApps}from'../../core/api-client.js';function a5_0xc120(){const _0xd5e7a5=['items','trim','3755424pFsAfq','fetchedAt','APP_LIST_SOURCE','mock','2428428TcRZZQ','6645580qTKWno','681407EEcRxk','6345728sjiXBD','cache','20oKjPvQ','toLowerCase','10778208UmCcmB','5496306MKySxM','toISOString'];a5_0xc120=function(){return _0xd5e7a5;};return a5_0xc120();}import{getMockRemoteAppItems}from'../../commands/app/mock-loader.js';import{getAppCacheFilePath,readCachedAppList,writeCachedAppList}from'../../commands/app/cache.js';import{productEnv}from'../../constant/product.js';export function shouldUseMockRemoteApps(){const _0x323920=a5_0x4681,_0x2c5fa9=(productEnv(_0x323920(0x102))||'')['trim']()[_0x323920(0x10a)]();return _0x2c5fa9===_0x323920(0x103);}export async function getRemoteAppItems(){if(shouldUseMockRemoteApps())return getMockRemoteAppItems();return getMyApps();}export async function getRemoteAppList(_0x3f639c){const _0x55cbb0=a5_0x4681,{env:_0x5458f1,accessKey:_0x2ca3de,localOnly:localOnly=![],noCache:noCache=![]}=_0x3f639c,_0x21f0c4=readCachedAppList(_0x5458f1,_0x2ca3de),_0x2f1756=_0x2ca3de?.[_0x55cbb0(0xff)]()?getAppCacheFilePath(_0x5458f1,_0x2ca3de):null;if(localOnly)return{'items':_0x21f0c4?.[_0x55cbb0(0xfe)]??[],'source':_0x55cbb0(0x108),'fetchedAt':_0x21f0c4?.[_0x55cbb0(0x101)]??null,'cachePath':_0x2f1756};try{const _0x163286=await getRemoteAppItems(),_0x348cab=shouldUseMockRemoteApps()?_0x55cbb0(0x103):'remote',_0x3ac032=new Date()[_0x55cbb0(0xfd)](),_0x475fb1=_0x2ca3de?.[_0x55cbb0(0xff)]()?writeCachedAppList(_0x5458f1,_0x2ca3de,{'env':_0x5458f1,'fetchedAt':_0x3ac032,'source':_0x348cab,'items':_0x163286}):null;return{'items':_0x163286,'source':_0x348cab,'fetchedAt':_0x3ac032,'cachePath':_0x475fb1};}catch(_0x16e1d6){if(!noCache&&_0x21f0c4)return{'items':_0x21f0c4[_0x55cbb0(0xfe)],'source':_0x55cbb0(0x108),'fetchedAt':_0x21f0c4[_0x55cbb0(0x101)],'cachePath':_0x2f1756};throw _0x16e1d6;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c363c,_0x522155){const _0x8f1ba8=a6_0x57f2,_0x171dd3=_0x2c363c();while(!![]){try{const _0x865516=parseInt(_0x8f1ba8(0x1ce))/0x1+-parseInt(_0x8f1ba8(0x1c1))/0x2+parseInt(_0x8f1ba8(0x1c6))/0x3*(-parseInt(_0x8f1ba8(0x1d2))/0x4)+-parseInt(_0x8f1ba8(0x1cd))/0x5*(-parseInt(_0x8f1ba8(0x1d0))/0x6)+parseInt(_0x8f1ba8(0x1cf))/0x7+parseInt(_0x8f1ba8(0x1c4))/0x8+-parseInt(_0x8f1ba8(0x1c3))/0x9;if(_0x865516===_0x522155)break;else _0x171dd3['push'](_0x171dd3['shift']());}catch(_0x2249f2){_0x171dd3['push'](_0x171dd3['shift']());}}}(a6_0x1e8a,0x5cbb3));import{CLI_BIN_NAME}from'../../constant/cli.js';import{formatScopeLabel}from'../../commands/common/config-policy.js';export{CLI_BIN_NAME};function a6_0x57f2(_0x1aad14,_0x4feeba){_0x1aad14=_0x1aad14-0x1c1;const _0x1e8ac3=a6_0x1e8a();let _0x57f259=_0x1e8ac3[_0x1aad14];return _0x57f259;}export function enrichAppListItemsWithMergedSelection(_0x3af295,_0x152652){const _0x30bcd7=a6_0x57f2;if(!_0x152652)return;const _0x23115f=!!(_0x152652[_0x30bcd7(0x1cb)]??_0x152652[_0x30bcd7(0x1c2)]);for(const _0x589e98 of _0x3af295){_0x589e98[_0x30bcd7(0x1d3)]=![];}const _0x475911=_0x152652[_0x30bcd7(0x1cc)]!=null?String(_0x152652['appCode'])[_0x30bcd7(0x1c9)]():'';if(_0x23115f){const _0x41edc8=_0x152652[_0x30bcd7(0x1cb)]??_0x152652['defaultApp'];if(_0x41edc8){const _0x2466d6=_0x3af295['find'](_0x470be9=>_0x470be9[_0x30bcd7(0x1d4)]===!![]&&_0x470be9[_0x30bcd7(0x1ca)]===_0x41edc8&&_0x470be9['definedIn']===_0x30bcd7(0x1d1)),_0x96ef99=_0x2466d6??_0x3af295[_0x30bcd7(0x1c8)](_0xfa0d20=>_0xfa0d20[_0x30bcd7(0x1d4)]===!![]&&_0xfa0d20[_0x30bcd7(0x1ca)]===_0x41edc8);_0x96ef99&&(_0x96ef99[_0x30bcd7(0x1d3)]=!![]);}return;}if(!_0x475911)return;for(const _0x3bedc8 of _0x3af295){String(_0x3bedc8['appcode']??'')['trim']()===_0x475911&&(_0x3bedc8[_0x30bcd7(0x1d3)]=!![]);}}export{readScopedConfig as readConfig,writeScopedConfig as writeConfig,isInProject}from'../../context.js';export function scopeLabel(_0x22d59f){const _0x2cc515=a6_0x57f2;return formatScopeLabel(_0x22d59f[_0x2cc515(0x1c7)]?'global':_0x2cc515(0x1c5));}function a6_0x1e8a(){const _0x49c3a4=['9RWzgQN','global','find','trim','name','currentApp','appCode','5MyZwNQ','582866mxzfUu','4286345MbPIQs','2594334wfwnQD','local','839028IWTjxl','isCurrent','named','295178EMBPEY','defaultApp','5339502PKzKrf','979000ZwGJtx','project'];a6_0x1e8a=function(){return _0x49c3a4;};return a6_0x1e8a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a7_0x504572=a7_0x2c96;(function(_0x294742,_0x20aac3){const _0x218568=a7_0x2c96,_0x3d5345=_0x294742();while(!![]){try{const _0x19ec2c=-parseInt(_0x218568(0xdc))/0x1*(-parseInt(_0x218568(0xb5))/0x2)+parseInt(_0x218568(0xa1))/0x3+-parseInt(_0x218568(0xa7))/0x4+-parseInt(_0x218568(0xaf))/0x5*(parseInt(_0x218568(0xc6))/0x6)+-parseInt(_0x218568(0xb4))/0x7*(parseInt(_0x218568(0xa3))/0x8)+-parseInt(_0x218568(0xd0))/0x9*(parseInt(_0x218568(0xdb))/0xa)+-parseInt(_0x218568(0xcf))/0xb*(-parseInt(_0x218568(0xdd))/0xc);if(_0x19ec2c===_0x20aac3)break;else _0x3d5345['push'](_0x3d5345['shift']());}catch(_0x5758f6){_0x3d5345['push'](_0x3d5345['shift']());}}}(a7_0x4b31,0xd640f));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_0x4b31(){const _0x413b68=['1540bFLnCs','9CIADOQ','Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','str','length','metadata','content','name','filter','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','includes','favorite','3545130vnUZSg','1275049KazfGo','185964NcVVeB','File\x20path\x20is\x20required.','updateTime','verbose','build','boolean','appCode','join','description','createTime','Optional\x20source\x20filter,\x20for\x20example\x20AGENT','dayjs','Invalid\x20JSON\x20for\x20--metadata:\x20','add','Show\x20one\x20Artifact\x20by\x20id','artifact','exec','startsWith','compiledContent','--metadata\x20must\x20be\x20a\x20JSON\x20object.','1456047diXPJs','body','2099960XYbBUB','POST','parse','.\x20Unsupported:\x20','5273060KYQvrS','isFile','update','AGENT','lastIndex','trim','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','/update','930935lJvIak','utf8','create','split','Artifact\x20display\x20name','7REVZhj','2FXTods','string','react','antd','File\x20is\x20not\x20a\x20regular\x20file:\x20','Artifact\x20ID','isArray','map','react-dom','read','validation','detail','Preview:\x20create\x20react_module\x20Artifact','react_module','/client/artifact/','Updated\x20Artifact\x20','List\x20current-app\x20react_module\x20Artifacts','36kleHdt','file','num','File\x20not\x20found:\x20','object','source','Optional\x20favorite-state\x20filter','write','bool'];a7_0x4b31=function(){return _0x413b68;};return a7_0x4b31();}import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a7_0x504572(0xc2),ARTIFACT_SOURCE_AGENT=a7_0x504572(0xaa),ALLOWED_REACT_MODULE_IMPORTS=[a7_0x504572(0xb7),a7_0x504572(0xbd),'lodash',a7_0x504572(0xe8),a7_0x504572(0xb8),'@ant-design/icons'];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a7_0x504572(0xe4)](',\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_0x504572(0xc7),'type':'string','required':!![],'description':a7_0x504572(0xd1)},ARTIFACT_NAME_FLAG={'name':a7_0x504572(0xd6),'type':a7_0x504572(0xb6),'description':a7_0x504572(0xb3)},METADATA_FLAG={'name':a7_0x504572(0xd4),'type':a7_0x504572(0xb6),'description':a7_0x504572(0xd8)};function isPlainObject(_0x1a4259){const _0x1dc477=a7_0x504572;return typeof _0x1a4259===_0x1dc477(0xca)&&_0x1a4259!==null&&!Array[_0x1dc477(0xbb)](_0x1a4259);}function readSourceFile(_0x735f3a){const _0x5d2472=a7_0x504572;if(!_0x735f3a)throw CliErrors[_0x5d2472(0xbf)](_0x5d2472(0xde));if(!existsSync(_0x735f3a))throw CliErrors[_0x5d2472(0xbf)](_0x5d2472(0xc9)+_0x735f3a);if(!statSync(_0x735f3a)[_0x5d2472(0xa8)]())throw CliErrors[_0x5d2472(0xbf)](_0x5d2472(0xb9)+_0x735f3a);const _0x1a353e=readFileSync(_0x735f3a,_0x5d2472(0xb0));return validateReactModuleSource(_0x1a353e),_0x1a353e;}function parseMetadata(_0xc5312f){const _0x378ae0=a7_0x504572;if(!_0xc5312f)return undefined;let _0x554392;try{_0x554392=JSON[_0x378ae0(0xa5)](_0xc5312f);}catch{throw CliErrors[_0x378ae0(0xbf)](_0x378ae0(0xe9)+_0xc5312f);}if(!isPlainObject(_0x554392))throw CliErrors[_0x378ae0(0xbf)](_0x378ae0(0xa0));const _0x24ccd={..._0x554392};return delete _0x24ccd[_0x378ae0(0x9f)],_0x24ccd;}function getPackageName(_0x3bc644){const _0x58f773=a7_0x504572;if(_0x3bc644[_0x58f773(0x9e)]('@')){const [_0x210758,_0x50da89]=_0x3bc644['split']('/');return _0x210758&&_0x50da89?_0x210758+'/'+_0x50da89:_0x3bc644;}return _0x3bc644[_0x58f773(0xb2)]('/')[0x0]||_0x3bc644;}function validateAllowedImports(_0x27aace){const _0x248e0e=a7_0x504572,_0x5000d0=new Set();for(const _0x24dce5 of IMPORT_SOURCE_PATTERNS){_0x24dce5[_0x248e0e(0xab)]=0x0;let _0x489dbc;while((_0x489dbc=_0x24dce5[_0x248e0e(0x9d)](_0x27aace))!==null){const _0x1c0ae3=_0x489dbc[0x1]?.[_0x248e0e(0xac)]();_0x1c0ae3&&_0x5000d0[_0x248e0e(0xea)](_0x1c0ae3);}}const _0x167bd1=[..._0x5000d0][_0x248e0e(0xbc)](getPackageName)[_0x248e0e(0xd7)](_0x178ccd=>!ALLOWED_REACT_MODULE_IMPORTS[_0x248e0e(0xd9)](_0x178ccd));if(_0x167bd1[_0x248e0e(0xd3)]>0x0)throw CliErrors['validation']('react_module\x20imports\x20are\x20limited\x20to:\x20'+ALLOWED_REACT_MODULE_IMPORTS_TEXT+_0x248e0e(0xa6)+[...new Set(_0x167bd1)][_0x248e0e(0xe4)](',\x20'));}export function validateReactModuleSource(_0x3edc7b){const _0x58ca63=a7_0x504572;if(!_0x3edc7b['trim']())throw CliErrors[_0x58ca63(0xbf)]('Artifact\x20source\x20file\x20is\x20blank.');if(PAGE_LEVEL_PATTERNS['some'](_0x24330e=>_0x24330e['test'](_0x3edc7b)))throw CliErrors[_0x58ca63(0xbf)]('react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.');validateAllowedImports(_0x3edc7b);}function buildArtifactInput(_0x45adb5){const _0x3173ba=a7_0x504572,_0x3896e6=readSourceFile(_0x45adb5[_0x3173ba(0xd2)](_0x3173ba(0xc7))),_0x415cfe=_0x45adb5[_0x3173ba(0xd2)]('name')[_0x3173ba(0xac)](),_0x3d50f7=parseMetadata(_0x45adb5[_0x3173ba(0xd2)]('metadata'));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x415cfe?{'name':_0x415cfe}:{},'content':_0x3896e6,..._0x3d50f7?{'metadata':_0x3d50f7}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x471efb){const _0x34c2d1=a7_0x504572;return{'id':_0x471efb['id'],'name':_0x471efb[_0x34c2d1(0xd6)],'artifactType':_0x471efb['artifactType'],'source':_0x471efb[_0x34c2d1(0xcb)],'favorite':_0x471efb['favorite'],'deleted':_0x471efb['deleted'],'createTime':_0x471efb[_0x34c2d1(0xe6)],'updateTime':_0x471efb['updateTime']};}function detailArtifact(_0x27e9be){const _0x52c4c2=a7_0x504572;return{'id':_0x27e9be['id'],'appCode':_0x27e9be[_0x52c4c2(0xe3)],'name':_0x27e9be[_0x52c4c2(0xd6)],'artifactType':_0x27e9be['artifactType'],'source':_0x27e9be[_0x52c4c2(0xcb)],'favorite':_0x27e9be[_0x52c4c2(0xda)],'deleted':_0x27e9be['deleted'],'content':_0x27e9be[_0x52c4c2(0xd5)]??'','compiledContent':_0x27e9be[_0x52c4c2(0x9f)],'metadata':_0x27e9be[_0x52c4c2(0xd4)]??{},'createTime':_0x27e9be[_0x52c4c2(0xe6)],'updateTime':_0x27e9be[_0x52c4c2(0xdf)]};}function readFavoriteFlag(_0x2741a3){const _0x341012=a7_0x504572,_0x286e53=_0x2741a3['flag']('favorite');return _0x286e53===undefined||_0x286e53===null||_0x286e53===''?undefined:_0x2741a3[_0x341012(0xce)](_0x341012(0xda));}const artifactList={'service':a7_0x504572(0x9c),'command':'list','description':a7_0x504572(0xc5),'risk':a7_0x504572(0xbe),'flags':[{'name':a7_0x504572(0xcb),'type':a7_0x504572(0xb6),'description':a7_0x504572(0xe7)},{'name':'favorite','type':a7_0x504572(0xe2),'description':a7_0x504572(0xcc)},VERBOSE_FLAG],async 'execute'(_0x70529b){const _0xb4b0e7=a7_0x504572,_0x739404=await listRuntimeArtifacts(_0x70529b['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x70529b[_0xb4b0e7(0xd2)](_0xb4b0e7(0xcb))?{'source':_0x70529b[_0xb4b0e7(0xd2)]('source')}:{},...readFavoriteFlag(_0x70529b)!==undefined?{'favorite':readFavoriteFlag(_0x70529b)}:{}});return{'ok':!![],'data':{'total':_0x739404['length'],'items':_0x70529b[_0xb4b0e7(0xce)](_0xb4b0e7(0xe0))?_0x739404:_0x739404[_0xb4b0e7(0xbc)](summarizeArtifact)}};}},artifactDetail={'service':'artifact','command':a7_0x504572(0xc0),'description':a7_0x504572(0xeb),'risk':'read','flags':[{...ID_FLAG,'description':a7_0x504572(0xba)}],async 'execute'(_0x496122){const _0x5a9000=a7_0x504572,_0x26b23f=await getRuntimeArtifact(_0x496122['num']('id'),_0x496122[_0x5a9000(0xe3)]);return{'ok':!![],'data':detailArtifact(_0x26b23f)};}},artifactCreate={'service':a7_0x504572(0x9c),'command':a7_0x504572(0xb1),'description':a7_0x504572(0xad),'risk':a7_0x504572(0xcd),'flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x4d3b63){const _0x33111b=a7_0x504572,_0x3860eb=buildArtifactInput(_0x4d3b63),_0x21732a=await createRuntimeArtifact(_0x4d3b63[_0x33111b(0xe3)],_0x3860eb);return{'ok':!![],'data':detailArtifact(_0x21732a),'message':'Created\x20Artifact\x20'+_0x21732a['id']+(_0x21732a[_0x33111b(0xd6)]?'\x20('+_0x21732a[_0x33111b(0xd6)]+')':'')};},async 'dryRun'(_0x5223c0){const _0x3382d=a7_0x504572,_0x53e1fa=buildArtifactInput(_0x5223c0);return dryRun(_0x3382d(0xa4),'/client/artifact/create')[_0x3382d(0xa2)]({'appCode':_0x5223c0['appCode'],..._0x53e1fa})[_0x3382d(0xe5)](_0x3382d(0xc1))[_0x3382d(0xe1)]();}},artifactUpdate={'service':a7_0x504572(0x9c),'command':a7_0x504572(0xa9),'description':'Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','risk':a7_0x504572(0xcd),'flags':[{...ID_FLAG,'description':a7_0x504572(0xba)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x443dae){const _0x69d4e4=a7_0x504572,_0x16b3d2=_0x443dae[_0x69d4e4(0xc8)]('id'),_0x567645=buildArtifactInput(_0x443dae),_0x491188=await updateRuntimeArtifact(_0x16b3d2,_0x443dae[_0x69d4e4(0xe3)],_0x567645);return{'ok':!![],'data':detailArtifact(_0x491188),'message':_0x69d4e4(0xc4)+_0x491188['id']+(_0x491188['name']?'\x20('+_0x491188['name']+')':'')};},async 'dryRun'(_0x31fdd2){const _0x44cda9=a7_0x504572,_0x4f75a7=_0x31fdd2[_0x44cda9(0xc8)]('id'),_0x5a49bb=buildArtifactInput(_0x31fdd2);return dryRun(_0x44cda9(0xa4),_0x44cda9(0xc3)+_0x4f75a7+_0x44cda9(0xae))[_0x44cda9(0xa2)]({'appCode':_0x31fdd2[_0x44cda9(0xe3)],..._0x5a49bb})[_0x44cda9(0xe5)]('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x4f75a7)['build']();}};function a7_0x2c96(_0x583c4d,_0x3cc67b){_0x583c4d=_0x583c4d-0x9c;const _0x4b3152=a7_0x4b31();let _0x2c966d=_0x4b3152[_0x583c4d];return _0x2c966d;}export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
1
|
+
const a7_0xdf3cce=a7_0xc7d8;(function(_0x275e35,_0x219d38){const _0x5a2766=a7_0xc7d8,_0x10e2b8=_0x275e35();while(!![]){try{const _0x46afea=-parseInt(_0x5a2766(0x7b))/0x1+parseInt(_0x5a2766(0xb5))/0x2*(parseInt(_0x5a2766(0x95))/0x3)+-parseInt(_0x5a2766(0xb8))/0x4+-parseInt(_0x5a2766(0xac))/0x5*(-parseInt(_0x5a2766(0x85))/0x6)+parseInt(_0x5a2766(0x97))/0x7+-parseInt(_0x5a2766(0xaa))/0x8*(parseInt(_0x5a2766(0xad))/0x9)+parseInt(_0x5a2766(0xb6))/0xa*(-parseInt(_0x5a2766(0xbc))/0xb);if(_0x46afea===_0x219d38)break;else _0x10e2b8['push'](_0x10e2b8['shift']());}catch(_0x3daa5c){_0x10e2b8['push'](_0x10e2b8['shift']());}}}(a7_0x1f81,0x1c54d));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';function a7_0x1f81(){const _0x137c90=['Path\x20to\x20a\x20local\x20UTF-8\x20React\x20module\x20source\x20file','createTime','File\x20is\x20not\x20a\x20regular\x20file:\x20','Artifact\x20source\x20file\x20is\x20blank.','validation','some','test','react_module\x20must\x20be\x20an\x20embeddable\x20React\x20module,\x20not\x20full\x20HTML\x20or\x20a\x20ReactDOM/createRoot\x20mount\x20entry.','name','metadata','POST','1839832rbATKl','bool','137595tPzHbj','9odDYCn','length','Create\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','startsWith','Artifact\x20metadata\x20as\x20JSON\x20object;\x20compiledContent\x20is\x20stripped','List\x20current-app\x20react_module\x20Artifacts','react-dom','source','8dWTXFH','14530donSDq','parse','116812EgkTLE','map','File\x20not\x20found:\x20','/client/artifact/create','22aCzvpB','Artifact\x20display\x20name','artifactType','compiledContent','utf8','favorite','isArray','verbose','--metadata\x20must\x20be\x20a\x20JSON\x20object.','content','filter','react_module','react_module\x20imports\x20are\x20limited\x20to:\x20','artifact','react','write','138316mSoqhM','Update\x20a\x20react_module\x20Artifact\x20from\x20a\x20local\x20source\x20file','Optional\x20favorite-state\x20filter','list','File\x20path\x20is\x20required.','Created\x20Artifact\x20','AGENT','Preview:\x20create\x20react_module\x20Artifact','string','description','42zbHfaT','Show\x20one\x20Artifact\x20by\x20id','file','build','isFile','body','exec','Artifact\x20ID','create','Updated\x20Artifact\x20','boolean','Invalid\x20JSON\x20for\x20--metadata:\x20','deleted','updateTime','antd','trim','140310fvoPcZ','@ant-design/icons','957152nErBXK','split','num','str','join','lodash','appCode','/update'];a7_0x1f81=function(){return _0x137c90;};return a7_0x1f81();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const ARTIFACT_TYPE_REACT_MODULE=a7_0xdf3cce(0xc7),ARTIFACT_SOURCE_AGENT=a7_0xdf3cce(0x81),ALLOWED_REACT_MODULE_IMPORTS=[a7_0xdf3cce(0xca),a7_0xdf3cce(0xb3),a7_0xdf3cce(0x9c),'dayjs',a7_0xdf3cce(0x93),a7_0xdf3cce(0x96)];export const ALLOWED_REACT_MODULE_IMPORTS_TEXT=ALLOWED_REACT_MODULE_IMPORTS[a7_0xdf3cce(0x9b)](',\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_0xdf3cce(0x87),'type':a7_0xdf3cce(0x83),'required':!![],'description':a7_0xdf3cce(0x9f)},ARTIFACT_NAME_FLAG={'name':a7_0xdf3cce(0xa7),'type':'string','description':a7_0xdf3cce(0xbd)},METADATA_FLAG={'name':a7_0xdf3cce(0xa8),'type':a7_0xdf3cce(0x83),'description':a7_0xdf3cce(0xb1)};function isPlainObject(_0x5ea5ad){const _0x111380=a7_0xdf3cce;return typeof _0x5ea5ad==='object'&&_0x5ea5ad!==null&&!Array[_0x111380(0xc2)](_0x5ea5ad);}function readSourceFile(_0x5161c0){const _0x362da8=a7_0xdf3cce;if(!_0x5161c0)throw CliErrors[_0x362da8(0xa3)](_0x362da8(0x7f));if(!existsSync(_0x5161c0))throw CliErrors['validation'](_0x362da8(0xba)+_0x5161c0);if(!statSync(_0x5161c0)[_0x362da8(0x89)]())throw CliErrors[_0x362da8(0xa3)](_0x362da8(0xa1)+_0x5161c0);const _0x1aa87d=readFileSync(_0x5161c0,_0x362da8(0xc0));return validateReactModuleSource(_0x1aa87d),_0x1aa87d;}function parseMetadata(_0x3d728f){const _0x196eeb=a7_0xdf3cce;if(!_0x3d728f)return undefined;let _0x4483e4;try{_0x4483e4=JSON[_0x196eeb(0xb7)](_0x3d728f);}catch{throw CliErrors[_0x196eeb(0xa3)](_0x196eeb(0x90)+_0x3d728f);}if(!isPlainObject(_0x4483e4))throw CliErrors['validation'](_0x196eeb(0xc4));const _0x2c49dc={..._0x4483e4};return delete _0x2c49dc[_0x196eeb(0xbf)],_0x2c49dc;}function getPackageName(_0x23bb8f){const _0x241399=a7_0xdf3cce;if(_0x23bb8f[_0x241399(0xb0)]('@')){const [_0xb78ba6,_0x440971]=_0x23bb8f['split']('/');return _0xb78ba6&&_0x440971?_0xb78ba6+'/'+_0x440971:_0x23bb8f;}return _0x23bb8f[_0x241399(0x98)]('/')[0x0]||_0x23bb8f;}function validateAllowedImports(_0x19d64e){const _0x36fe39=a7_0xdf3cce,_0x5c7e27=new Set();for(const _0x5882f0 of IMPORT_SOURCE_PATTERNS){_0x5882f0['lastIndex']=0x0;let _0x378f16;while((_0x378f16=_0x5882f0[_0x36fe39(0x8b)](_0x19d64e))!==null){const _0x1d9821=_0x378f16[0x1]?.[_0x36fe39(0x94)]();_0x1d9821&&_0x5c7e27['add'](_0x1d9821);}}const _0x431f90=[..._0x5c7e27]['map'](getPackageName)[_0x36fe39(0xc6)](_0x51d56e=>!ALLOWED_REACT_MODULE_IMPORTS['includes'](_0x51d56e));if(_0x431f90[_0x36fe39(0xae)]>0x0)throw CliErrors[_0x36fe39(0xa3)](_0x36fe39(0xc8)+ALLOWED_REACT_MODULE_IMPORTS_TEXT+'.\x20Unsupported:\x20'+[...new Set(_0x431f90)][_0x36fe39(0x9b)](',\x20'));}export function validateReactModuleSource(_0x42351f){const _0x561bdc=a7_0xdf3cce;if(!_0x42351f[_0x561bdc(0x94)]())throw CliErrors[_0x561bdc(0xa3)](_0x561bdc(0xa2));if(PAGE_LEVEL_PATTERNS[_0x561bdc(0xa4)](_0x14d149=>_0x14d149[_0x561bdc(0xa5)](_0x42351f)))throw CliErrors['validation'](_0x561bdc(0xa6));validateAllowedImports(_0x42351f);}function buildArtifactInput(_0x56f565){const _0x251245=a7_0xdf3cce,_0xc57c16=readSourceFile(_0x56f565[_0x251245(0x9a)](_0x251245(0x87))),_0x495026=_0x56f565[_0x251245(0x9a)](_0x251245(0xa7))['trim'](),_0x2b1996=parseMetadata(_0x56f565[_0x251245(0x9a)](_0x251245(0xa8)));return{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x495026?{'name':_0x495026}:{},'content':_0xc57c16,..._0x2b1996?{'metadata':_0x2b1996}:{},'source':ARTIFACT_SOURCE_AGENT};}function summarizeArtifact(_0x2be078){const _0x3c5bf0=a7_0xdf3cce;return{'id':_0x2be078['id'],'name':_0x2be078[_0x3c5bf0(0xa7)],'artifactType':_0x2be078[_0x3c5bf0(0xbe)],'source':_0x2be078['source'],'favorite':_0x2be078['favorite'],'deleted':_0x2be078[_0x3c5bf0(0x91)],'createTime':_0x2be078[_0x3c5bf0(0xa0)],'updateTime':_0x2be078[_0x3c5bf0(0x92)]};}function detailArtifact(_0x169ddd){const _0x2a9b45=a7_0xdf3cce;return{'id':_0x169ddd['id'],'appCode':_0x169ddd[_0x2a9b45(0x9d)],'name':_0x169ddd[_0x2a9b45(0xa7)],'artifactType':_0x169ddd[_0x2a9b45(0xbe)],'source':_0x169ddd[_0x2a9b45(0xb4)],'favorite':_0x169ddd[_0x2a9b45(0xc1)],'deleted':_0x169ddd[_0x2a9b45(0x91)],'content':_0x169ddd[_0x2a9b45(0xc5)]??'','compiledContent':_0x169ddd[_0x2a9b45(0xbf)],'metadata':_0x169ddd[_0x2a9b45(0xa8)]??{},'createTime':_0x169ddd[_0x2a9b45(0xa0)],'updateTime':_0x169ddd[_0x2a9b45(0x92)]};}function readFavoriteFlag(_0x4b670a){const _0x537a30=a7_0xdf3cce,_0x27d897=_0x4b670a['flag'](_0x537a30(0xc1));return _0x27d897===undefined||_0x27d897===null||_0x27d897===''?undefined:_0x4b670a[_0x537a30(0xab)](_0x537a30(0xc1));}const artifactList={'service':a7_0xdf3cce(0xc9),'command':a7_0xdf3cce(0x7e),'description':a7_0xdf3cce(0xb2),'risk':'read','flags':[{'name':a7_0xdf3cce(0xb4),'type':'string','description':'Optional\x20source\x20filter,\x20for\x20example\x20AGENT'},{'name':a7_0xdf3cce(0xc1),'type':a7_0xdf3cce(0x8f),'description':a7_0xdf3cce(0x7d)},VERBOSE_FLAG],async 'execute'(_0x78bf83){const _0x5d2314=a7_0xdf3cce,_0x461869=await listRuntimeArtifacts(_0x78bf83['appCode'],{'artifactType':ARTIFACT_TYPE_REACT_MODULE,..._0x78bf83[_0x5d2314(0x9a)]('source')?{'source':_0x78bf83['str'](_0x5d2314(0xb4))}:{},...readFavoriteFlag(_0x78bf83)!==undefined?{'favorite':readFavoriteFlag(_0x78bf83)}:{}});return{'ok':!![],'data':{'total':_0x461869['length'],'items':_0x78bf83[_0x5d2314(0xab)](_0x5d2314(0xc3))?_0x461869:_0x461869[_0x5d2314(0xb9)](summarizeArtifact)}};}},artifactDetail={'service':a7_0xdf3cce(0xc9),'command':'detail','description':a7_0xdf3cce(0x86),'risk':'read','flags':[{...ID_FLAG,'description':a7_0xdf3cce(0x8c)}],async 'execute'(_0x32641a){const _0x4c019c=a7_0xdf3cce,_0x49a584=await getRuntimeArtifact(_0x32641a[_0x4c019c(0x99)]('id'),_0x32641a[_0x4c019c(0x9d)]);return{'ok':!![],'data':detailArtifact(_0x49a584)};}},artifactCreate={'service':'artifact','command':a7_0xdf3cce(0x8d),'description':a7_0xdf3cce(0xaf),'risk':'write','flags':[FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x359450){const _0x3812c1=a7_0xdf3cce,_0x1f77c9=buildArtifactInput(_0x359450),_0x37180a=await createRuntimeArtifact(_0x359450[_0x3812c1(0x9d)],_0x1f77c9);return{'ok':!![],'data':detailArtifact(_0x37180a),'message':_0x3812c1(0x80)+_0x37180a['id']+(_0x37180a[_0x3812c1(0xa7)]?'\x20('+_0x37180a[_0x3812c1(0xa7)]+')':'')};},async 'dryRun'(_0x1e81c9){const _0x37ba7b=a7_0xdf3cce,_0x10c926=buildArtifactInput(_0x1e81c9);return dryRun('POST',_0x37ba7b(0xbb))[_0x37ba7b(0x8a)]({'appCode':_0x1e81c9['appCode'],..._0x10c926})[_0x37ba7b(0x84)](_0x37ba7b(0x82))[_0x37ba7b(0x88)]();}},artifactUpdate={'service':a7_0xdf3cce(0xc9),'command':'update','description':a7_0xdf3cce(0x7c),'risk':a7_0xdf3cce(0x7a),'flags':[{...ID_FLAG,'description':a7_0xdf3cce(0x8c)},FILE_FLAG,ARTIFACT_NAME_FLAG,METADATA_FLAG],async 'execute'(_0x11a3b7){const _0x39203c=a7_0xdf3cce,_0x5e0386=_0x11a3b7[_0x39203c(0x99)]('id'),_0x1f3bc3=buildArtifactInput(_0x11a3b7),_0x50991a=await updateRuntimeArtifact(_0x5e0386,_0x11a3b7[_0x39203c(0x9d)],_0x1f3bc3);return{'ok':!![],'data':detailArtifact(_0x50991a),'message':_0x39203c(0x8e)+_0x50991a['id']+(_0x50991a[_0x39203c(0xa7)]?'\x20('+_0x50991a[_0x39203c(0xa7)]+')':'')};},async 'dryRun'(_0x56bdfa){const _0x488c97=a7_0xdf3cce,_0x15e903=_0x56bdfa[_0x488c97(0x99)]('id'),_0x176f91=buildArtifactInput(_0x56bdfa);return dryRun(_0x488c97(0xa9),'/client/artifact/'+_0x15e903+_0x488c97(0x9e))[_0x488c97(0x8a)]({'appCode':_0x56bdfa[_0x488c97(0x9d)],..._0x176f91})['description']('Preview:\x20update\x20react_module\x20Artifact\x20'+_0x15e903)[_0x488c97(0x88)]();}};function a7_0xc7d8(_0x15d5bd,_0x3a31e7){_0x15d5bd=_0x15d5bd-0x7a;const _0x1f81ca=a7_0x1f81();let _0xc7d88d=_0x1f81ca[_0x15d5bd];return _0xc7d88d;}export const artifactDefinitions=[artifactList,artifactDetail,artifactCreate,artifactUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a8_0x255173=a8_0x278f;function a8_0x278f(_0xc1f08e,_0xc8990d){_0xc1f08e=_0xc1f08e-0x16f;const _0x5a6db0=a8_0x5a6d();let _0x278fa0=_0x5a6db0[_0xc1f08e];return _0x278fa0;}(function(_0x141fc1,_0x20787f){const _0x37097e=a8_0x278f,_0x25f3a8=_0x141fc1();while(!![]){try{const _0x11b5ee=-parseInt(_0x37097e(0x18c))/0x1+-parseInt(_0x37097e(0x183))/0x2*(-parseInt(_0x37097e(0x173))/0x3)+-parseInt(_0x37097e(0x1c6))/0x4*(-parseInt(_0x37097e(0x181))/0x5)+parseInt(_0x37097e(0x1ba))/0x6+parseInt(_0x37097e(0x1c4))/0x7+-parseInt(_0x37097e(0x19e))/0x8+parseInt(_0x37097e(0x1b5))/0x9*(parseInt(_0x37097e(0x1bb))/0xa);if(_0x11b5ee===_0x20787f)break;else _0x25f3a8['push'](_0x25f3a8['shift']());}catch(_0x627c08){_0x25f3a8['push'](_0x25f3a8['shift']());}}}(a8_0x5a6d,0xda3d8));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x3ebc8c=a8_0x278f;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG['userCenterDisplayName']+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x3ebc8c(0x1b8)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x3ebc8c(0x180));}function buildAccessKeySetupGuide(){const _0x1b3fde=a8_0x278f;return[_0x1b3fde(0x198)+PRODUCT_CONFIG[_0x1b3fde(0x1ad)]+':',USER_ACCESS_KEY_CREATE_URL,_0x1b3fde(0x17a)+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]'][_0x1b3fde(0x189)]('\x0a');}function canPromptForAccessKey(_0x19f84b){const _0x12902e=a8_0x278f;return!_0x19f84b[_0x12902e(0x1c7)]&&process[_0x12902e(0x1ac)][_0x12902e(0x1c1)]!==![]&&process[_0x12902e(0x17c)][_0x12902e(0x1c1)]!==![];}function resolveAuthScopeFlags(_0x4cc3a0){const _0xc8a581=a8_0x278f;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x4cc3a0[_0xc8a581(0x1b9)](_0xc8a581(0x1a0)),'explicitProject':_0x4cc3a0[_0xc8a581(0x1b9)]('project'),'policy':_0xc8a581(0x194)}));}async function resolveAuthWriteInput(_0x25d2ff){const _0xb87ee4=a8_0x278f;let _0x39e5f0=(_0x25d2ff[_0xb87ee4(0x1bc)](_0xb87ee4(0x1b4))||_0x25d2ff[_0xb87ee4(0x1bc)]('ak')||'')['trim']();const _0xcb0732=(_0x25d2ff[_0xb87ee4(0x1bc)](_0xb87ee4(0x177))||'')[_0xb87ee4(0x172)]();if(!_0x39e5f0&&canPromptForAccessKey(_0x25d2ff))try{showAccessKeyCreateHint(),_0x39e5f0=await promptAccessKey('');}catch(_0x56f107){if(isAbortPrompt(_0x56f107))throw CliErrors[_0xb87ee4(0x193)]();throw _0x56f107;}if(!_0x39e5f0)throw CliErrors[_0xb87ee4(0x18f)]('Missing\x20accessKey.',buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0xb87ee4(0x176)](_0x39e5f0))throw CliErrors[_0xb87ee4(0x18f)](_0xb87ee4(0x17b)+_0x39e5f0+'\x22','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars');if(!_0xcb0732)return{'accessKey':_0x39e5f0};const _0x13ccc3=normalizeEnv(_0xcb0732);return{'accessKey':_0x39e5f0,'env':isDaily(_0x13ccc3)?_0xb87ee4(0x17f):isDev(_0x13ccc3)?'development':_0xb87ee4(0x1b2)};}export const authDefinitions=[{'service':a8_0x255173(0x19d),'command':a8_0x255173(0x188),'description':a8_0x255173(0x1a5),'risk':a8_0x255173(0x1bf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x255173(0x1b4),'type':a8_0x255173(0x190),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a8_0x255173(0x190),'description':a8_0x255173(0x18d)},{'name':a8_0x255173(0x1a0),'type':a8_0x255173(0x17d),'description':a8_0x255173(0x16f),'default':!![]},{'name':a8_0x255173(0x1a8),'type':a8_0x255173(0x17d),'description':a8_0x255173(0x170),'default':![]}],async 'execute'(_0x37c5c8){const _0x52f0f3=a8_0x255173;if(_0x37c5c8[_0x52f0f3(0x1b9)](_0x52f0f3(0x18a)))throw CliErrors[_0x52f0f3(0x18f)](_0x52f0f3(0x1a6),_0x52f0f3(0x18e)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+_0x52f0f3(0x187));const _0x72e514=(_0x37c5c8['str'](_0x52f0f3(0x1b4))||_0x37c5c8[_0x52f0f3(0x1bc)]('ak')||'')[_0x52f0f3(0x172)]();if(!_0x72e514&&_0x37c5c8[_0x52f0f3(0x1c7)])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x3be932=await resolveAuthWriteInput(_0x37c5c8),_0x3a2831=resolveAuthScopeFlags(_0x37c5c8),_0x3825e3=readScopedConfig(_0x3a2831);_0x3825e3['accessKey']=_0x3be932[_0x52f0f3(0x1a9)];_0x3be932[_0x52f0f3(0x177)]&&(_0x3825e3[_0x52f0f3(0x177)]=_0x3be932[_0x52f0f3(0x177)]);writeScopedConfig(_0x3825e3,_0x3a2831);const _0x217058=_0x3a2831[_0x52f0f3(0x1a0)]?_0x52f0f3(0x1a0):'project',_0x1d2799=_0x3825e3[_0x52f0f3(0x177)]?_0x52f0f3(0x1bd)+_0x3825e3[_0x52f0f3(0x177)]+'.':'';return{'ok':!![],'message':_0x52f0f3(0x1a3)+_0x217058+_0x52f0f3(0x1c3)+_0x1d2799+_0x52f0f3(0x1b0)+CLI_BIN_NAME+_0x52f0f3(0x1ae)};}},{'service':'auth','command':'init','description':a8_0x255173(0x175),'risk':a8_0x255173(0x1bf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':'string','description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a8_0x255173(0x190),'description':'Shorthand\x20for\x20--access-key'},{'name':a8_0x255173(0x177),'type':'string','description':a8_0x255173(0x197)},{'name':a8_0x255173(0x1a0),'type':a8_0x255173(0x17d),'description':a8_0x255173(0x16f),'default':!![]},{'name':a8_0x255173(0x1a8),'type':'boolean','description':a8_0x255173(0x170),'default':![]}],async 'execute'(_0x28c498){const _0x56a9c4=a8_0x255173,_0x2c1793=await resolveAuthWriteInput(_0x28c498),_0x5ca8c6=resolveAuthScopeFlags(_0x28c498),_0x5839fc={'accessKey':_0x2c1793[_0x56a9c4(0x1a9)]};_0x2c1793[_0x56a9c4(0x177)]&&(_0x5839fc[_0x56a9c4(0x177)]=_0x2c1793[_0x56a9c4(0x177)]);writeScopedConfig(_0x5839fc,_0x5ca8c6);const _0x3d63c8=_0x5ca8c6[_0x56a9c4(0x1a0)]?'global':_0x56a9c4(0x1a8),_0xaf77ee=_0x5839fc[_0x56a9c4(0x177)]?'\x20Current\x20env:\x20'+_0x5839fc['env']+'.':'';return{'ok':!![],'message':_0x56a9c4(0x191)+_0x3d63c8+'\x20scope.'+_0xaf77ee+'\x20Verify:\x20'+CLI_BIN_NAME+_0x56a9c4(0x1ae)};}},{'service':'auth','command':a8_0x255173(0x182),'description':a8_0x255173(0x1a2),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x255173(0x1a0),'type':a8_0x255173(0x17d),'description':a8_0x255173(0x1ab),'default':!![]},{'name':'project','type':a8_0x255173(0x17d),'description':a8_0x255173(0x1b6),'default':![]}],async 'execute'(_0x5e7f6d){const _0x37c09c=a8_0x255173,_0x294c6e=resolveAuthScopeFlags(_0x5e7f6d),_0x55ef29=readScopedConfig(_0x294c6e),_0x25ea64=!!_0x55ef29[_0x37c09c(0x1a9)];delete _0x55ef29['accessKey'],writeScopedConfig(_0x55ef29,_0x294c6e);const _0x5eada9=_0x294c6e[_0x37c09c(0x1a0)]?_0x37c09c(0x1a0):_0x37c09c(0x1a8);if(_0x25ea64)return{'ok':!![],'message':_0x37c09c(0x195)+_0x5eada9+_0x37c09c(0x1c3)};return{'ok':!![],'message':_0x37c09c(0x19f)+_0x5eada9+_0x37c09c(0x1be)};}},{'service':a8_0x255173(0x19d),'command':a8_0x255173(0x19a),'description':a8_0x255173(0x1aa),'risk':a8_0x255173(0x18b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x255173(0x1a0),'type':a8_0x255173(0x17d),'description':'Read\x20from\x20global\x20config\x20(default)','default':!![]},{'name':a8_0x255173(0x1a8),'type':a8_0x255173(0x17d),'description':'Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x51236d){const _0x4a65e6=a8_0x255173,_0x1af71b=resolveAuthScopeFlags(_0x51236d),_0x532d84=readScopedConfig(_0x1af71b),_0x3f3783=productEnvName(_0x4a65e6(0x1af)),_0x2d39df=productEnv(_0x4a65e6(0x1af))||undefined,_0x270c26=_0x532d84[_0x4a65e6(0x1a9)]||undefined,_0x45cba6=_0x2d39df||_0x270c26,_0x429383=_0x2d39df?_0x3f3783+_0x4a65e6(0x174):_0x270c26?(_0x1af71b[_0x4a65e6(0x1a0)]?_0x4a65e6(0x1a0):_0x4a65e6(0x1a8))+_0x4a65e6(0x1c0):null,_0x421cf4=[_0x4a65e6(0x196)+AUTH_MODE[_0x4a65e6(0x192)]];if(_0x45cba6){const _0x3c515b=_0x45cba6[_0x4a65e6(0x1b7)]>0x8?''+_0x45cba6[_0x4a65e6(0x171)](0x0,0x8)+'*'[_0x4a65e6(0x1c2)](_0x45cba6[_0x4a65e6(0x1b7)]-0x8):_0x45cba6;_0x421cf4[_0x4a65e6(0x1a4)](_0x4a65e6(0x186)+_0x3c515b+(_0x429383?'\x20(via\x20'+_0x429383+')':''));}return!_0x45cba6&&(_0x421cf4['push'](''),_0x421cf4['push'](_0x4a65e6(0x1b1)),_0x421cf4[_0x4a65e6(0x1a4)](''),_0x421cf4[_0x4a65e6(0x1a4)]('Option\x20A:\x20'+CLI_BIN_NAME+_0x4a65e6(0x1a7)),_0x421cf4[_0x4a65e6(0x1a4)](''),_0x421cf4[_0x4a65e6(0x1a4)](_0x4a65e6(0x1a1)+PRODUCT_CONFIG[_0x4a65e6(0x19b)]+')'),_0x421cf4[_0x4a65e6(0x1a4)]('{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}'),_0x421cf4[_0x4a65e6(0x1a4)](''),_0x421cf4[_0x4a65e6(0x1a4)](_0x4a65e6(0x1b3)),_0x421cf4['push'](_0x4a65e6(0x179)+_0x3f3783+_0x4a65e6(0x185)),_0x421cf4[_0x4a65e6(0x1a4)](''),_0x421cf4[_0x4a65e6(0x1a4)](_0x4a65e6(0x178)+CLI_BIN_NAME+_0x4a65e6(0x1ae)),_0x421cf4[_0x4a65e6(0x1a4)](_0x4a65e6(0x184)+CLI_BIN_NAME+_0x4a65e6(0x19c))),{'ok':!![],'message':_0x421cf4[_0x4a65e6(0x189)]('\x0a')};}},{'service':a8_0x255173(0x19d),'command':a8_0x255173(0x1c5),'description':a8_0x255173(0x17e),'risk':a8_0x255173(0x18b),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x5dc3f9){const _0x416352=a8_0x255173,_0x43f1c3=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x43f1c3,'meta':{'env':_0x5dc3f9[_0x416352(0x199)]??_0x416352(0x1b2)}}};}}];function a8_0x5a6d(){const _0x477640=['10559304gqFJkR','No\x20AccessKey\x20found\x20in\x20','global','Option\x20B:\x20apps\x20config\x20(','Clear\x20accessKey\x20from\x20config','AccessKey\x20saved\x20to\x20','push','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','`auth\x20login`\x20does\x20not\x20support\x20--yes.','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','project','accessKey','Show\x20current\x20authentication\x20status','Clear\x20from\x20global\x20config\x20(default)','stdin','userCenterDisplayName','\x20auth\x20status','ACCESS_KEY','\x20Verify:\x20','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','production','Option\x20C:\x20environment\x20variable','access-key','630PhZlqK','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','length','Tip:\x20you\x20can\x20also\x20run:','bool','3256296FMirBH','56430FzhIYJ','str','\x20Current\x20env:\x20','\x20config.\x20Nothing\x20to\x20clear.','write','\x20config','isTTY','repeat','\x20config.','8304086cPQSPD','info','111128KepDiS','nonInteractive','Write\x20to\x20global\x20config\x20(default)','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','slice','trim','633CYCKlj','\x20env\x20var','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch','test','env','Then\x20verify\x20with:\x20','\x20\x20export\x20','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','Invalid\x20accessKey\x20format:\x20\x22','stdout','boolean','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','daily','\x20auth\x20login\x20--access-key\x20<ak_xxx>','245CiLRQB','logout','4278NVxZJk','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','=ak_xxx','AccessKey:\x20','\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.','login','join','yes','read','1722846rgIzDm','Shorthand\x20for\x20--access-key','Use\x20`','validation','string','Auth\x20config\x20reinitialized\x20in\x20','ClientAk','cancelled','global-default','AccessKey\x20cleared\x20from\x20','Auth\x20mode:\x20','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','envName','status','newConfigFileName','\x20doctor','auth'];a8_0x5a6d=function(){return _0x477640;};return a8_0x5a6d();}
|
|
1
|
+
const a8_0x3d1f79=a8_0x297f;function a8_0x2d88(){const _0x3bd13d=['Write\x20to\x20global\x20config\x20(default)','project','\x20Current\x20env:\x20','\x20auth\x20status','global','2659572xoZagA','test','\x20auth\x20login\x20--access-key\x20<ak_xxx>','\x20scope.','Clear\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','AccessKey:\x20','development','login','Expected:\x20ak_\x20followed\x20by\x2016+\x20alphanumeric\x20chars','Save\x20accessKey\x20to\x20config\x20(global\x20by\x20default;\x20use\x20--project\x20for\x20project\x20config)','push','Auth\x20config\x20reinitialized\x20in\x20','\x20env\x20var','Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','AccessKey\x20cleared\x20from\x20','\x20\x20export\x20','production','=ak_xxx','\x20auth\x20login\x20--access-key\x20<ak_xxx>\x20[--global]','daily','Shorthand\x20for\x20--access-key','stdin','Tip:\x20you\x20can\x20also\x20run:','Read\x20from\x20project\x20config\x20instead\x20of\x20global\x20config','Give\x20the\x20AccessKey\x20to\x20your\x20AI\x20Agent,\x20then\x20run:\x20','\x20Verify:\x20','Target\x20environment\x20to\x20persist\x20with\x20the\x20new\x20auth\x20config','read','yes','accessKey','\x20doctor','593455ZQdKxR','AccessKey\x20(ak_xxx...)','Clear\x20from\x20global\x20config\x20(default)','Fetch\x20current\x20login\x20user\x20info\x20for\x20the\x20active\x20access\x20key','validation','newConfigFileName','init','Show\x20current\x20authentication\x20status','3364627Qgvwfk','398663pNCZbP','Use\x20`','length','info','If\x20command\x20execution\x20still\x20fails,\x20run:\x20','isTTY','stdout','slice','bool','str','status','16xJokTR','env','AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20','write','auth','boolean','string','4IuKVna','logout','envName','No\x20credentials\x20found.\x20Configure\x20one\x20of\x20the\x20options\x20below:','access-key','Option\x20A:\x20','3568632lTHzem','join','Clear\x20accessKey\x20from\x20config','Read\x20from\x20global\x20config\x20(default)','trim','`auth\x20login`\x20does\x20not\x20support\x20--yes.','812058MzVbZh','ClientAk','nonInteractive','4014504ZZnoZx','userCenterDisplayName','{\x20\x22accessKey\x22:\x20\x22ak_xxx\x22\x20}','ACCESS_KEY','\x20auth\x20login\x20[--global]\x20[--access-key\x20ak_xxx]','Clear\x20all\x20config\x20in\x20scope\x20and\x20initialize\x20auth\x20from\x20scratch'];a8_0x2d88=function(){return _0x3bd13d;};return a8_0x2d88();}function a8_0x297f(_0xc73920,_0x3d408b){_0xc73920=_0xc73920-0x1d8;const _0x2d88f6=a8_0x2d88();let _0x297f49=_0x2d88f6[_0xc73920];return _0x297f49;}(function(_0x13a767,_0x58b2e0){const _0x294fba=a8_0x297f,_0x50a380=_0x13a767();while(!![]){try{const _0x4e5250=parseInt(_0x294fba(0x222))/0x1+-parseInt(_0x294fba(0x1e0))/0x2*(parseInt(_0x294fba(0x1ec))/0x3)+parseInt(_0x294fba(0x1d9))/0x4*(-parseInt(_0x294fba(0x219))/0x5)+parseInt(_0x294fba(0x1fa))/0x6+parseInt(_0x294fba(0x221))/0x7+parseInt(_0x294fba(0x1e6))/0x8+-parseInt(_0x294fba(0x1ef))/0x9;if(_0x4e5250===_0x58b2e0)break;else _0x50a380['push'](_0x50a380['shift']());}catch(_0x1f5a3d){_0x50a380['push'](_0x50a380['shift']());}}}(a8_0x2d88,0x4ad29));import{readScopedConfig,writeScopedConfig}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{PRODUCT_CONFIG,productEnv,productEnvName}from'../../constant/product.js';import{AUTH_MODE}from'../../constant/auth-mode.js';import{normalizeEnv,isDaily,isDev}from'../../constant/env.js';import{USER_ACCESS_KEY_CREATE_URL}from'../../constant/url.js';import{CliErrors}from'../../errors.js';import{promptAccessKey,isAbortPrompt}from'../../commands/auth/prompt.js';import{resolveConfigScope,toScopeFlags}from'../../commands/common/config-policy.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{getLoginUserInfo}from'../../core/api-client.js';const ACCESS_KEY_PATTERN=/^ak_[A-Za-z0-9]{16,}$/;function showAccessKeyCreateHint(){const _0x314b9e=a8_0x297f;writeCliSideChannelLine('AccessKey\x20required\x20for\x20login.\x20Create\x20one\x20in\x20'+PRODUCT_CONFIG[_0x314b9e(0x1f0)]+':'),writeCliSideChannelLine('\x0a'+USER_ACCESS_KEY_CREATE_URL+'\x0a'),writeCliSideChannelLine(_0x314b9e(0x210)),writeCliSideChannelLine('\x20\x20'+CLI_BIN_NAME+_0x314b9e(0x1fc));}function buildAccessKeySetupGuide(){const _0x37a51d=a8_0x297f;return[_0x37a51d(0x1db)+PRODUCT_CONFIG[_0x37a51d(0x1f0)]+':',USER_ACCESS_KEY_CREATE_URL,_0x37a51d(0x212)+CLI_BIN_NAME+_0x37a51d(0x20c)][_0x37a51d(0x1e7)]('\x0a');}function canPromptForAccessKey(_0x4ba5eb){const _0x52b6d4=a8_0x297f;return!_0x4ba5eb[_0x52b6d4(0x1ee)]&&process[_0x52b6d4(0x20f)][_0x52b6d4(0x227)]!==![]&&process[_0x52b6d4(0x228)]['isTTY']!==![];}function resolveAuthScopeFlags(_0x20774c){const _0x566d52=a8_0x297f;return toScopeFlags(resolveConfigScope({'explicitGlobal':_0x20774c[_0x566d52(0x22a)](_0x566d52(0x1f9)),'explicitProject':_0x20774c[_0x566d52(0x22a)](_0x566d52(0x1f6)),'policy':'global-default'}));}async function resolveAuthWriteInput(_0x2c8680){const _0x3c5d29=a8_0x297f;let _0x27a109=(_0x2c8680[_0x3c5d29(0x22b)](_0x3c5d29(0x1e4))||_0x2c8680[_0x3c5d29(0x22b)]('ak')||'')[_0x3c5d29(0x1ea)]();const _0x3ce444=(_0x2c8680[_0x3c5d29(0x22b)](_0x3c5d29(0x1da))||'')[_0x3c5d29(0x1ea)]();if(!_0x27a109&&canPromptForAccessKey(_0x2c8680))try{showAccessKeyCreateHint(),_0x27a109=await promptAccessKey('');}catch(_0x477bab){if(isAbortPrompt(_0x477bab))throw CliErrors['cancelled']();throw _0x477bab;}if(!_0x27a109)throw CliErrors[_0x3c5d29(0x21d)]('Missing\x20accessKey.',buildAccessKeySetupGuide());if(!ACCESS_KEY_PATTERN[_0x3c5d29(0x1fb)](_0x27a109))throw CliErrors[_0x3c5d29(0x21d)]('Invalid\x20accessKey\x20format:\x20\x22'+_0x27a109+'\x22',_0x3c5d29(0x202));if(!_0x3ce444)return{'accessKey':_0x27a109};const _0xdd727d=normalizeEnv(_0x3ce444);return{'accessKey':_0x27a109,'env':isDaily(_0xdd727d)?_0x3c5d29(0x20d):isDev(_0xdd727d)?_0x3c5d29(0x200):'production'};}export const authDefinitions=[{'service':a8_0x3d1f79(0x1dd),'command':a8_0x3d1f79(0x201),'description':a8_0x3d1f79(0x203),'risk':a8_0x3d1f79(0x1dc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'access-key','type':'string','description':a8_0x3d1f79(0x21a)},{'name':'ak','type':a8_0x3d1f79(0x1df),'description':'Shorthand\x20for\x20--access-key'},{'name':a8_0x3d1f79(0x1f9),'type':a8_0x3d1f79(0x1de),'description':a8_0x3d1f79(0x1f5),'default':!![]},{'name':a8_0x3d1f79(0x1f6),'type':'boolean','description':'Write\x20to\x20project\x20config\x20instead\x20of\x20global\x20config','default':![]}],async 'execute'(_0x44a45c){const _0x5c3d36=a8_0x3d1f79;if(_0x44a45c[_0x5c3d36(0x22a)](_0x5c3d36(0x216)))throw CliErrors['validation'](_0x5c3d36(0x1eb),_0x5c3d36(0x223)+CLI_BIN_NAME+'\x20auth\x20login\x20--non-interactive`\x20to\x20avoid\x20prompts,\x20or\x20`'+CLI_BIN_NAME+'\x20auth\x20login\x20--access-key\x20<ak_xxx>`\x20to\x20save\x20credentials.');const _0x1f81e6=(_0x44a45c[_0x5c3d36(0x22b)]('access-key')||_0x44a45c[_0x5c3d36(0x22b)]('ak')||'')[_0x5c3d36(0x1ea)]();if(!_0x1f81e6&&_0x44a45c['nonInteractive'])return{'ok':!![],'message':buildAccessKeySetupGuide()};const _0x97269=await resolveAuthWriteInput(_0x44a45c),_0x4e5b5e=resolveAuthScopeFlags(_0x44a45c),_0x18eb1c=readScopedConfig(_0x4e5b5e);_0x18eb1c[_0x5c3d36(0x217)]=_0x97269['accessKey'];_0x97269[_0x5c3d36(0x1da)]&&(_0x18eb1c[_0x5c3d36(0x1da)]=_0x97269[_0x5c3d36(0x1da)]);writeScopedConfig(_0x18eb1c,_0x4e5b5e);const _0xf0a155=_0x4e5b5e[_0x5c3d36(0x1f9)]?_0x5c3d36(0x1f9):'project',_0x40d72f=_0x18eb1c['env']?_0x5c3d36(0x1f7)+_0x18eb1c[_0x5c3d36(0x1da)]+'.':'';return{'ok':!![],'message':'AccessKey\x20saved\x20to\x20'+_0xf0a155+'\x20config.'+_0x40d72f+_0x5c3d36(0x213)+CLI_BIN_NAME+_0x5c3d36(0x1f8)};}},{'service':a8_0x3d1f79(0x1dd),'command':a8_0x3d1f79(0x21f),'description':a8_0x3d1f79(0x1f4),'risk':a8_0x3d1f79(0x1dc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x3d1f79(0x1e4),'type':a8_0x3d1f79(0x1df),'description':'AccessKey\x20(ak_xxx...)'},{'name':'ak','type':a8_0x3d1f79(0x1df),'description':a8_0x3d1f79(0x20e)},{'name':a8_0x3d1f79(0x1da),'type':a8_0x3d1f79(0x1df),'description':a8_0x3d1f79(0x214)},{'name':'global','type':a8_0x3d1f79(0x1de),'description':a8_0x3d1f79(0x1f5),'default':!![]},{'name':'project','type':a8_0x3d1f79(0x1de),'description':a8_0x3d1f79(0x207),'default':![]}],async 'execute'(_0xf3c8c3){const _0x1444be=a8_0x3d1f79,_0x30099=await resolveAuthWriteInput(_0xf3c8c3),_0x3a015b=resolveAuthScopeFlags(_0xf3c8c3),_0x7d81a3={'accessKey':_0x30099[_0x1444be(0x217)]};_0x30099[_0x1444be(0x1da)]&&(_0x7d81a3[_0x1444be(0x1da)]=_0x30099[_0x1444be(0x1da)]);writeScopedConfig(_0x7d81a3,_0x3a015b);const _0x484538=_0x3a015b['global']?_0x1444be(0x1f9):_0x1444be(0x1f6),_0x49ae6b=_0x7d81a3[_0x1444be(0x1da)]?_0x1444be(0x1f7)+_0x7d81a3['env']+'.':'';return{'ok':!![],'message':_0x1444be(0x205)+_0x484538+_0x1444be(0x1fd)+_0x49ae6b+_0x1444be(0x213)+CLI_BIN_NAME+_0x1444be(0x1f8)};}},{'service':a8_0x3d1f79(0x1dd),'command':a8_0x3d1f79(0x1e1),'description':a8_0x3d1f79(0x1e8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'global','type':a8_0x3d1f79(0x1de),'description':a8_0x3d1f79(0x21b),'default':!![]},{'name':a8_0x3d1f79(0x1f6),'type':a8_0x3d1f79(0x1de),'description':a8_0x3d1f79(0x1fe),'default':![]}],async 'execute'(_0x65f66b){const _0x42bc5f=a8_0x3d1f79,_0x1e83e1=resolveAuthScopeFlags(_0x65f66b),_0x393866=readScopedConfig(_0x1e83e1),_0x4aba07=!!_0x393866[_0x42bc5f(0x217)];delete _0x393866['accessKey'],writeScopedConfig(_0x393866,_0x1e83e1);const _0x1c606d=_0x1e83e1[_0x42bc5f(0x1f9)]?'global':_0x42bc5f(0x1f6);if(_0x4aba07)return{'ok':!![],'message':_0x42bc5f(0x208)+_0x1c606d+'\x20config.'};return{'ok':!![],'message':'No\x20AccessKey\x20found\x20in\x20'+_0x1c606d+'\x20config.\x20Nothing\x20to\x20clear.'};}},{'service':a8_0x3d1f79(0x1dd),'command':a8_0x3d1f79(0x1d8),'description':a8_0x3d1f79(0x220),'risk':a8_0x3d1f79(0x215),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a8_0x3d1f79(0x1f9),'type':'boolean','description':a8_0x3d1f79(0x1e9),'default':!![]},{'name':a8_0x3d1f79(0x1f6),'type':'boolean','description':a8_0x3d1f79(0x211),'default':![]}],async 'execute'(_0x598e58){const _0x10ff5c=a8_0x3d1f79,_0x51b1e4=resolveAuthScopeFlags(_0x598e58),_0x499ce1=readScopedConfig(_0x51b1e4),_0x2bbed2=productEnvName('ACCESS_KEY'),_0xf15d1e=productEnv(_0x10ff5c(0x1f2))||undefined,_0xb0c439=_0x499ce1['accessKey']||undefined,_0x429f8d=_0xf15d1e||_0xb0c439,_0x40ce60=_0xf15d1e?_0x2bbed2+_0x10ff5c(0x206):_0xb0c439?(_0x51b1e4[_0x10ff5c(0x1f9)]?'global':_0x10ff5c(0x1f6))+'\x20config':null,_0x5ba833=['Auth\x20mode:\x20'+AUTH_MODE[_0x10ff5c(0x1ed)]];if(_0x429f8d){const _0x39fa99=_0x429f8d[_0x10ff5c(0x224)]>0x8?''+_0x429f8d[_0x10ff5c(0x229)](0x0,0x8)+'*'['repeat'](_0x429f8d[_0x10ff5c(0x224)]-0x8):_0x429f8d;_0x5ba833[_0x10ff5c(0x204)](_0x10ff5c(0x1ff)+_0x39fa99+(_0x40ce60?'\x20(via\x20'+_0x40ce60+')':''));}return!_0x429f8d&&(_0x5ba833['push'](''),_0x5ba833[_0x10ff5c(0x204)](_0x10ff5c(0x1e3)),_0x5ba833[_0x10ff5c(0x204)](''),_0x5ba833[_0x10ff5c(0x204)](_0x10ff5c(0x1e5)+CLI_BIN_NAME+_0x10ff5c(0x1f3)),_0x5ba833['push'](''),_0x5ba833['push']('Option\x20B:\x20apps\x20config\x20('+PRODUCT_CONFIG[_0x10ff5c(0x21e)]+')'),_0x5ba833['push'](_0x10ff5c(0x1f1)),_0x5ba833['push'](''),_0x5ba833[_0x10ff5c(0x204)]('Option\x20C:\x20environment\x20variable'),_0x5ba833['push'](_0x10ff5c(0x209)+_0x2bbed2+_0x10ff5c(0x20b)),_0x5ba833['push'](''),_0x5ba833[_0x10ff5c(0x204)]('Then\x20verify\x20with:\x20'+CLI_BIN_NAME+'\x20auth\x20status'),_0x5ba833[_0x10ff5c(0x204)](_0x10ff5c(0x226)+CLI_BIN_NAME+_0x10ff5c(0x218))),{'ok':!![],'message':_0x5ba833['join']('\x0a')};}},{'service':a8_0x3d1f79(0x1dd),'command':a8_0x3d1f79(0x225),'description':a8_0x3d1f79(0x21c),'risk':a8_0x3d1f79(0x215),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':!![],'flags':[],async 'execute'(_0x39f848){const _0x2bdbea=a8_0x3d1f79,_0x35825c=await getLoginUserInfo();return{'ok':!![],'data':{'user':_0x35825c,'meta':{'env':_0x39f848[_0x2bdbea(0x1e2)]??_0x2bdbea(0x20a)}}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e96ba,_0xd8818){const _0xebeab6=a9_0x597b,_0x5843a6=_0x3e96ba();while(!![]){try{const _0x109a5b=parseInt(_0xebeab6(0x175))/0x1+parseInt(_0xebeab6(0x169))/0x2+parseInt(_0xebeab6(0x16c))/0x3+-parseInt(_0xebeab6(0x16e))/0x4+parseInt(_0xebeab6(0x163))/0x5+-parseInt(_0xebeab6(0x171))/0x6*(-parseInt(_0xebeab6(0x173))/0x7)+parseInt(_0xebeab6(0x177))/0x8*(-parseInt(_0xebeab6(0x16b))/0x9);if(_0x109a5b===_0xd8818)break;else _0x5843a6['push'](_0x5843a6['shift']());}catch(_0x134c82){_0x5843a6['push'](_0x5843a6['shift']());}}}(a9_0x1138,0xd4cc7));function a9_0x597b(_0x443344,_0x263fdd){_0x443344=_0x443344-0x162;const _0x113808=a9_0x1138();let _0x597bd3=_0x113808[_0x443344];return _0x597bd3;}function a9_0x1138(){const _0x14c6b3=['1585207acyBkE','AbortPrompt','528wmOWvS','AccessKey\x20(','6164920FkaacM','AccessKey\x20(paste\x20ak_...):\x20','removeListener','close','):\x20','race','2581732UYetqa','SIGINT','521532UcECJF','319500ifWjmq','stdout','4132012zbAfif','stdin','name','9081822scNfyH','User\x20aborted\x20prompt','7HOeuYh','trim'];a9_0x1138=function(){return _0x14c6b3;};return a9_0x1138();}import{createInterface}from'node:readline';class AbortPrompt extends Error{constructor(){const _0x3b6f43=a9_0x597b;super(_0x3b6f43(0x172)),this[_0x3b6f43(0x170)]=_0x3b6f43(0x176);}}function createSafeRl(){const _0x5026b6=a9_0x597b,_0xa1593a=createInterface({'input':process[_0x5026b6(0x16f)],'output':process[_0x5026b6(0x16d)]});let _0x22f0e4;const _0x3b4fc3=new Promise((_0x2c75ee,_0x11de51)=>{const _0x3c2396=_0x5026b6;_0x22f0e4=()=>{const _0x17b0a6=a9_0x597b;_0x22f0e4&&(_0xa1593a[_0x17b0a6(0x165)](_0x17b0a6(0x16a),_0x22f0e4),_0x22f0e4=undefined);try{_0xa1593a[_0x17b0a6(0x166)]();}catch{}_0x11de51(new AbortPrompt());},_0xa1593a['once'](_0x3c2396(0x16a),_0x22f0e4);}),_0x40ee19=()=>{const _0x136563=_0x5026b6;_0x22f0e4&&(_0xa1593a[_0x136563(0x165)]('SIGINT',_0x22f0e4),_0x22f0e4=undefined);try{_0xa1593a[_0x136563(0x166)]();}catch{}};return{'rl':_0xa1593a,'abortPromise':_0x3b4fc3,'disposeSuccess':_0x40ee19};}export async function promptAccessKey(_0x33136f=''){const _0x1ba711=a9_0x597b,{rl:_0x582645,abortPromise:_0x372c22,disposeSuccess:_0x20b636}=createSafeRl(),_0x377f94=new Promise(_0x57cfa5=>{const _0x40f2e0=a9_0x597b,_0x17aa81=_0x33136f?_0x40f2e0(0x162)+_0x33136f+_0x40f2e0(0x167):_0x40f2e0(0x164);_0x582645['question'](_0x17aa81,_0x3337bf=>{const _0x3a47fb=_0x40f2e0;_0x20b636(),_0x57cfa5(_0x3337bf[_0x3a47fb(0x174)]()||_0x33136f);});});return Promise[_0x1ba711(0x168)]([_0x377f94,_0x372c22]);}export function isAbortPrompt(_0x598ed4){const _0x15d826=a9_0x597b;return _0x598ed4 instanceof Error&&_0x598ed4[_0x15d826(0x170)]===_0x15d826(0x176);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a10_0x29144e=a10_0x54b1;function a10_0x54b1(_0x2b4a88,_0x290b55){_0x2b4a88=_0x2b4a88-0x1db;const _0x50878e=a10_0x5087();let _0x54b1bb=_0x50878e[_0x2b4a88];return _0x54b1bb;}function a10_0x5087(){const _0xc65e15=['appCode','6YWHbuH','scriptType','Script\x20ID','read','createdTime','18mFmLBl','updatedTime','verbose','bool','196kwsjtk','9990704WuiQav','description','Get\x20BFF\x20script\x20details\x20by\x20ID','4RGekXH','functionName','556371RCHYGW','30415UxjEmf','detail','6015603Weiqpz','7134463hmAKga','6850700ySinro','107076TdJOqH'];a10_0x5087=function(){return _0xc65e15;};return a10_0x5087();}(function(_0x441532,_0x4a56e6){const _0xd60932=a10_0x54b1,_0x1ba25c=_0x441532();while(!![]){try{const _0x1019de=-parseInt(_0xd60932(0x1e0))/0x1+parseInt(_0xd60932(0x1de))/0x2*(-parseInt(_0xd60932(0x1e6))/0x3)+parseInt(_0xd60932(0x1f1))/0x4*(-parseInt(_0xd60932(0x1e1))/0x5)+-parseInt(_0xd60932(0x1e8))/0x6*(-parseInt(_0xd60932(0x1e4))/0x7)+-parseInt(_0xd60932(0x1db))/0x8+-parseInt(_0xd60932(0x1ed))/0x9*(-parseInt(_0xd60932(0x1e5))/0xa)+parseInt(_0xd60932(0x1e3))/0xb;if(_0x1019de===_0x4a56e6)break;else _0x1ba25c['push'](_0x1ba25c['shift']());}catch(_0x4e17f5){_0x1ba25c['push'](_0x1ba25c['shift']());}}}(a10_0x5087,0xb9eda));import{getBffScriptInfo}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';export const bffDetail={'service':'bff','command':a10_0x29144e(0x1e2),'description':a10_0x29144e(0x1dd),'risk':a10_0x29144e(0x1eb),'flags':[{...ID_FLAG,'description':a10_0x29144e(0x1ea)},VERBOSE_FLAG],async 'execute'(_0x1b76e5){const _0xd489ef=a10_0x29144e,_0x3dd946=await getBffScriptInfo(_0x1b76e5['num']('id')),_0x8be4c2=_0x1b76e5[_0xd489ef(0x1f0)](_0xd489ef(0x1ef));if(_0x8be4c2)return{'ok':!![],'data':_0x3dd946};return{'ok':!![],'data':{'id':_0x3dd946['id'],'appCode':_0x3dd946[_0xd489ef(0x1e7)],'functionName':_0x3dd946[_0xd489ef(0x1df)]??'','scriptType':_0x3dd946[_0xd489ef(0x1e9)],'description':_0x3dd946[_0xd489ef(0x1dc)]||'(none)','createdTime':_0x3dd946[_0xd489ef(0x1ec)]??'','updatedTime':_0x3dd946[_0xd489ef(0x1ee)]??''}};}};
|
package/lib/commands/bff/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a11_0x46da(_0x58dd6b,_0x2b46a4){_0x58dd6b=_0x58dd6b-0xe7;const _0x21ee36=a11_0x21ee();let _0x46da0e=_0x21ee36[_0x58dd6b];return _0x46da0e;}const a11_0x2128a0=a11_0x46da;(function(_0x2dd54c,_0x26bf17){const _0xed5b7d=a11_0x46da,_0x119138=_0x2dd54c();while(!![]){try{const _0xfdcf32=parseInt(_0xed5b7d(0xf1))/0x1+-parseInt(_0xed5b7d(0xf7))/0x2+parseInt(_0xed5b7d(0xe9))/0x3*(-parseInt(_0xed5b7d(0xef))/0x4)+parseInt(_0xed5b7d(0xf2))/0x5*(-parseInt(_0xed5b7d(0xf3))/0x6)+-parseInt(_0xed5b7d(0xe8))/0x7+-parseInt(_0xed5b7d(0xee))/0x8+parseInt(_0xed5b7d(0xed))/0x9;if(_0xfdcf32===_0x26bf17)break;else _0x119138['push'](_0x119138['shift']());}catch(_0x236ed5){_0x119138['push'](_0x119138['shift']());}}}(a11_0x21ee,0x54b09));import{executeSdkBff}from'../../core/sdk-client.js';import{parseJsonParams}from'../../utils/params.js';import{NAME_FLAG,PARAMS_FLAG}from'../../commands/common/flags.js';function a11_0x21ee(){const _0x507bcd=['now','2870483JRauZl','6729eQziBP','Execute\x20a\x20BFF\x20script\x20by\x20function\x20name','BFF\x20executed\x20in\x20','read','23822055QSQVIO','5133952hMjUZL','716CfRvoH','bff','366930UzTYNB','30VGQTbt','685302QtBdWJ','str','params','BFF\x20function\x20name\x20to\x20execute','1056648dZnioa'];a11_0x21ee=function(){return _0x507bcd;};return a11_0x21ee();}export const bffExec={'service':a11_0x2128a0(0xf0),'command':'exec','description':a11_0x2128a0(0xea),'risk':a11_0x2128a0(0xec),'flags':[{...NAME_FLAG,'required':!![],'description':a11_0x2128a0(0xf6)},PARAMS_FLAG],async 'execute'(_0x3344a7){const _0x425e23=a11_0x2128a0,_0x44aa27=parseJsonParams(_0x3344a7[_0x425e23(0xf4)](_0x425e23(0xf5))),_0x2a8f7b=Date[_0x425e23(0xe7)](),_0x1c312e=await executeSdkBff(_0x3344a7[_0x425e23(0xf4)]('name'),_0x44aa27),_0x38d64a=Date[_0x425e23(0xe7)]()-_0x2a8f7b;return{'ok':!![],'data':{'result':_0x1c312e,'elapsed':_0x38d64a},'message':_0x425e23(0xeb)+_0x38d64a+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31841e,_0x114795){const _0x3d233f=a12_0x1493,_0x26cf6b=_0x31841e();while(!![]){try{const _0x265eba=-parseInt(_0x3d233f(0x1e3))/0x1+-parseInt(_0x3d233f(0x1e4))/0x2*(-parseInt(_0x3d233f(0x1eb))/0x3)+-parseInt(_0x3d233f(0x1e6))/0x4*(-parseInt(_0x3d233f(0x1ea))/0x5)+-parseInt(_0x3d233f(0x1e5))/0x6*(parseInt(_0x3d233f(0x1e1))/0x7)+parseInt(_0x3d233f(0x1e2))/0x8*(parseInt(_0x3d233f(0x1e8))/0x9)+parseInt(_0x3d233f(0x1e9))/0xa*(-parseInt(_0x3d233f(0x1e7))/0xb)+parseInt(_0x3d233f(0x1e0))/0xc;if(_0x265eba===_0x114795)break;else _0x26cf6b['push'](_0x26cf6b['shift']());}catch(_0x11dc01){_0x26cf6b['push'](_0x26cf6b['shift']());}}}(a12_0x3cb5,0x39a4b));import{bffDetail}from'../../commands/bff/detail.js';import{bffExec}from'../../commands/bff/exec.js';function a12_0x1493(_0x2bede2,_0x3e6d6b){_0x2bede2=_0x2bede2-0x1e0;const _0x3cb5fb=a12_0x3cb5();let _0x14931d=_0x3cb5fb[_0x2bede2];return _0x14931d;}export const bffDefinitions=[bffDetail,bffExec];function a12_0x3cb5(){const _0x2ef088=['18QVmepq','34396cYZAoz','121xTnKng','2790hEtnRm','137610UaGafz','115FCXspT','6HmYZQU','2368500HhQWAQ','622818uekWXz','11048oQafNR','257804QiPwyR','88942ruURoe'];a12_0x3cb5=function(){return _0x2ef088;};return a12_0x3cb5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x143f5b,_0xce3484){const _0x22bbf3=a13_0x350c,_0x57b8fc=_0x143f5b();while(!![]){try{const _0x232f8c=-parseInt(_0x22bbf3(0xba))/0x1+-parseInt(_0x22bbf3(0xc0))/0x2+parseInt(_0x22bbf3(0xc6))/0x3*(-parseInt(_0x22bbf3(0xbc))/0x4)+parseInt(_0x22bbf3(0xb6))/0x5+-parseInt(_0x22bbf3(0xc5))/0x6*(parseInt(_0x22bbf3(0xc9))/0x7)+-parseInt(_0x22bbf3(0xc2))/0x8*(-parseInt(_0x22bbf3(0xbf))/0x9)+-parseInt(_0x22bbf3(0xca))/0xa*(-parseInt(_0x22bbf3(0xc1))/0xb);if(_0x232f8c===_0xce3484)break;else _0x57b8fc['push'](_0x57b8fc['shift']());}catch(_0x291847){_0x57b8fc['push'](_0x57b8fc['shift']());}}}(a13_0x4594,0x2b5f9));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_0x350c(_0x464ad3,_0x179dc4){_0x464ad3=_0x464ad3-0xb5;const _0x45944d=a13_0x4594();let _0x350c3e=_0x45944d[_0x464ad3];return _0x350c3e;}export{OUTPUT_FORMAT_VALUES}from'../../constant/output.js';function a13_0x4594(){const _0x59a964=['4782fxrqQi','51651NIQlit','project-default','Not\x20inside\x20a\x20project\x20(no\x20','847wMsOtO','1550ZcLeGh','validation','Use\x20only\x20one\x20config\x20scope\x20flag.','\x20(global)','1377175SaHGsd','newConfigFileName','\x20found).','Flags\x20--global\x20and\x20--project\x20are\x20mutually\x20exclusive.','204945gZiwbp','inProject','52CYOQnI','global','project','9ZBhCca','109906ZhbWKd','10527nURwXL','2672344OplksQ','project-or-global-explicit','global-default'];a13_0x4594=function(){return _0x59a964;};return a13_0x4594();}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(_0x335f5d){const _0x453303=a13_0x350c,{explicitGlobal:explicitGlobal=![],explicitProject:explicitProject=![],policy:_0x495961}=_0x335f5d;if(explicitGlobal&&explicitProject)throw CliErrors['validation'](_0x453303(0xb9),_0x453303(0xcc));if(explicitGlobal)return _0x453303(0xbd);if(explicitProject)return _0x453303(0xbe);switch(_0x495961){case _0x453303(0xc4):return _0x453303(0xbd);case _0x453303(0xc7):return _0x335f5d[_0x453303(0xbb)]??isInProject()?_0x453303(0xbe):_0x453303(0xbd);case _0x453303(0xc3):if(!(_0x335f5d[_0x453303(0xbb)]??isInProject()))throw CliErrors[_0x453303(0xcb)](_0x453303(0xc8)+PRODUCT_CONFIG[_0x453303(0xb7)]+_0x453303(0xb8),'Add\x20--global\x20to\x20write\x20to\x20~/'+PRODUCT_CONFIG[_0x453303(0xb7)]+',\x20or\x20run\x20`'+CLI_BIN_NAME+'\x20init`\x20first.');return _0x453303(0xbe);}}export function toScopeFlags(_0x7191bb){const _0x35f77c=a13_0x350c;return{'global':_0x7191bb===_0x35f77c(0xbd)};}export function formatScopeLabel(_0x21b4db){const _0x35d9c=a13_0x350c;return _0x21b4db===_0x35d9c(0xbd)?_0x35d9c(0xb5):'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x16d2fe,_0x10e8e4){const _0x2c1b26=a14_0x5675,_0x32d17f=_0x16d2fe();while(!![]){try{const _0xa5a526=-parseInt(_0x2c1b26(0x106))/0x1+parseInt(_0x2c1b26(0x119))/0x2*(parseInt(_0x2c1b26(0x11c))/0x3)+parseInt(_0x2c1b26(0x11a))/0x4+parseInt(_0x2c1b26(0x105))/0x5+-parseInt(_0x2c1b26(0x113))/0x6*(-parseInt(_0x2c1b26(0x10c))/0x7)+-parseInt(_0x2c1b26(0x11e))/0x8+parseInt(_0x2c1b26(0x11d))/0x9*(-parseInt(_0x2c1b26(0x10e))/0xa);if(_0xa5a526===_0x10e8e4)break;else _0x32d17f['push'](_0x32d17f['shift']());}catch(_0x3aa0e6){_0x32d17f['push'](_0x32d17f['shift']());}}}(a14_0x4329,0x1d7ac));import{CliErrors}from'../../errors.js';function a14_0x4329(){const _0xe6da24=['Use\x20only\x20one\x20of:\x20','14kmbtho',',\x20got\x20\x22','10UakiVI','Remove\x20all\x20but\x20one.','str','At\x20least\x20one\x20of\x20','\x20is\x20required\x20for\x20`','504396qplLvB','join','length','validation','flag','test','2alVjIF','663352FpWwxi','Provide\x20one\x20of:\x20','47793bdshOb','2246913bioaBq','1001128QzilFS','\x20is\x20allowed,\x20found:\x20','749835twVlir','4322yuUYkJ','some','filter','Only\x20one\x20of\x20',':\x20expected\x20'];a14_0x4329=function(){return _0xe6da24;};return a14_0x4329();}function a14_0x5675(_0xcf6a01,_0x23a273){_0xcf6a01=_0xcf6a01-0x105;const _0x4329bb=a14_0x4329();let _0x5675e6=_0x4329bb[_0xcf6a01];return _0x5675e6;}function isSet(_0x3fe81a,_0x5bf635){const _0x51db86=a14_0x5675,_0x2f9c40=_0x3fe81a[_0x51db86(0x117)](_0x5bf635);return _0x2f9c40!==undefined&&_0x2f9c40!==''&&_0x2f9c40!==![]&&_0x2f9c40!==0x0;}function fmtNames(_0x5f4678){const _0x516408=a14_0x5675;return _0x5f4678['map'](_0x4a20a2=>'--'+_0x4a20a2)[_0x516408(0x114)](',\x20');}export function requireOneOf(_0x119809,_0x2a46c0,_0x18d107){const _0x425b72=a14_0x5675,_0x305795=_0x2a46c0[_0x425b72(0x108)](_0x169ef5=>isSet(_0x119809,_0x169ef5));if(_0x305795[_0x425b72(0x115)]!==0x1)throw CliErrors[_0x425b72(0x116)](_0x305795[_0x425b72(0x115)]===0x0?'Exactly\x20one\x20of\x20'+fmtNames(_0x2a46c0)+'\x20is\x20required\x20for\x20`'+_0x18d107+'`.':_0x425b72(0x109)+fmtNames(_0x2a46c0)+_0x425b72(0x11f)+fmtNames(_0x305795)+'.',_0x305795[_0x425b72(0x115)]===0x0?'Provide\x20one\x20of:\x20'+fmtNames(_0x2a46c0):_0x425b72(0x10f));}export function requireAnyOf(_0x4c022a,_0x543639,_0x53e3e3){const _0x2df989=a14_0x5675;if(!_0x543639[_0x2df989(0x107)](_0xc3d498=>isSet(_0x4c022a,_0xc3d498)))throw CliErrors[_0x2df989(0x116)](_0x2df989(0x111)+fmtNames(_0x543639)+_0x2df989(0x112)+_0x53e3e3+'`.',_0x2df989(0x11b)+fmtNames(_0x543639));}export function mutuallyExclusive(_0x12ee19,_0x1dd8c5,_0x3e7085){const _0x539efb=a14_0x5675,_0x3e2a69=_0x1dd8c5[_0x539efb(0x108)](_0x49f84e=>isSet(_0x12ee19,_0x49f84e));if(_0x3e2a69[_0x539efb(0x115)]>0x1)throw CliErrors[_0x539efb(0x116)]('Flags\x20'+fmtNames(_0x3e2a69)+'\x20are\x20mutually\x20exclusive\x20for\x20`'+_0x3e7085+'`.',_0x539efb(0x10b)+fmtNames(_0x1dd8c5));}export function validatePattern(_0x4f8ad1,_0x485f03,_0x42a27d,_0xf7a442){const _0xfab9ab=a14_0x5675,_0x545715=_0x4f8ad1[_0xfab9ab(0x110)](_0x485f03);if(_0x545715&&!_0x42a27d[_0xfab9ab(0x118)](_0x545715))throw CliErrors['validation']('Invalid\x20--'+_0x485f03+_0xfab9ab(0x10a)+_0xf7a442+_0xfab9ab(0x10d)+_0x545715+'\x22.');}
|