@lovrabet/lovrabet-cli 2.1.6-beta.1 → 2.1.6-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x5e04d3=a27_0xf790;(function(_0x201e46,_0x166b9c){const _0x1d974e=a27_0xf790,_0x4222b0=_0x201e46();while(!![]){try{const _0x1760ed=parseInt(_0x1d974e(0x16d))/0x1*(parseInt(_0x1d974e(0x149))/0x2)+parseInt(_0x1d974e(0x13c))/0x3+-parseInt(_0x1d974e(0x152))/0x4+parseInt(_0x1d974e(0x15a))/0x5*(parseInt(_0x1d974e(0x171))/0x6)+-parseInt(_0x1d974e(0x159))/0x7+-parseInt(_0x1d974e(0x156))/0x8+parseInt(_0x1d974e(0x138))/0x9;if(_0x1760ed===_0x166b9c)break;else _0x4222b0['push'](_0x4222b0['shift']());}catch(_0x549dcb){_0x4222b0['push'](_0x4222b0['shift']());}}}(a27_0x213b,0x5cfd0));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a27_0x5e04d3(0x170),'type':'string','required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a27_0x5e04d3(0x139),'type':a27_0x5e04d3(0x175),'required':!![],'description':a27_0x5e04d3(0x165)},QUERY_FLAG={'name':'query','type':'string','required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':'topk','type':a27_0x5e04d3(0x141),'description':a27_0x5e04d3(0x163)};function readKnowledgeFile(_0x4af653){const _0x29c6de=a27_0x5e04d3;if(!_0x4af653)throw CliErrors[_0x29c6de(0x15d)](_0x29c6de(0x167));if(!existsSync(_0x4af653))throw CliErrors[_0x29c6de(0x15d)](_0x29c6de(0x162)+_0x4af653);if(!statSync(_0x4af653)[_0x29c6de(0x150)]())throw CliErrors[_0x29c6de(0x15d)](_0x29c6de(0x169)+_0x4af653);return readFileSync(_0x4af653,'utf8');}function summarizePersonalItem(_0x259613){const _0x440171=a27_0x5e04d3;return{'id':_0x259613['id'],'title':_0x259613[_0x440171(0x170)],'version':_0x259613[_0x440171(0x13f)],'ragStatus':_0x259613[_0x440171(0x15f)],'ragErrorMessage':_0x259613[_0x440171(0x16f)],'updateTime':_0x259613[_0x440171(0x16b)]};}function detailPersonalItem(_0x3fd565){const _0x4b4db9=a27_0x5e04d3;return{'id':_0x3fd565['id'],'appCode':_0x3fd565[_0x4b4db9(0x14b)],'scope':_0x3fd565['scope'],'userId':_0x3fd565[_0x4b4db9(0x168)],'title':_0x3fd565[_0x4b4db9(0x170)],'content':_0x3fd565[_0x4b4db9(0x164)]??'','version':_0x3fd565[_0x4b4db9(0x13f)],'ragStatus':_0x3fd565[_0x4b4db9(0x15f)],'ragErrorMessage':_0x3fd565[_0x4b4db9(0x16f)],'createTime':_0x3fd565[_0x4b4db9(0x148)],'updateTime':_0x3fd565['updateTime']};}function summarizeSearchHit(_0x361638){const _0x26c68d=a27_0x5e04d3;return{'scope':_0x361638[_0x26c68d(0x140)],'docId':_0x361638[_0x26c68d(0x136)],'score':_0x361638[_0x26c68d(0x16e)],'weightedScore':_0x361638['weightedScore'],'content':_0x361638[_0x26c68d(0x164)],'metadata':_0x361638[_0x26c68d(0x174)]};}function a27_0x213b(){const _0x32be14=['File\x20path\x20is\x20required.','userId','File\x20is\x20not\x20a\x20regular\x20file:\x20','body','updateTime','length','1pxzgIG','score','ragErrorMessage','title','1219122ctHtlY','create','num','metadata','string','Search\x20query\x20is\x20required.','docId','str','1053018MUsoCD','file','topk','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','2246676tNJRFM','Created\x20KB\x20entry\x20','map','version','scope','number','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','bool','--topk\x20must\x20be\x20a\x20positive\x20number.','read','Personal\x20knowledge-base\x20entry\x20ID','build','createTime','1494278KtqlQq','Override\x20the\x20existing\x20entry\x20title','appCode','isFinite','Updated\x20KB\x20entry\x20','detail','search','isFile','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','2496824svOOZX','/client/knowledge-base/personal/create','/client/knowledge-base/personal/','trim','5961992bqOiBM','POST','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','3305813ygpGNy','15dFZTZx','description','verbose','validation','flag','ragStatus','write','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','File\x20not\x20found:\x20','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','content','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','list'];a27_0x213b=function(){return _0x32be14;};return a27_0x213b();}function a27_0xf790(_0x1207cf,_0x3999c4){_0x1207cf=_0x1207cf-0x136;const _0x213bf0=a27_0x213b();let _0xf790f1=_0x213bf0[_0x1207cf];return _0xf790f1;}function readTopK(_0x577707){const _0x39b3bd=a27_0x5e04d3,_0x42be6a=_0x577707[_0x39b3bd(0x15e)](_0x39b3bd(0x13a));if(_0x42be6a===undefined||_0x42be6a===null||_0x42be6a==='')return undefined;const _0x640bdb=_0x577707['num']('topk');if(!Number[_0x39b3bd(0x14c)](_0x640bdb)||_0x640bdb<0x1)throw CliErrors[_0x39b3bd(0x15d)](_0x39b3bd(0x144));return _0x640bdb;}const kbList={'service':'kb','command':a27_0x5e04d3(0x166),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a27_0x5e04d3(0x145),'flags':[VERBOSE_FLAG],async 'execute'(_0x3dc1d4){const _0x2c8a48=a27_0x5e04d3,_0x4b9b08=await listPersonalKnowledgeBaseItems(_0x3dc1d4['appCode']);if(_0x3dc1d4[_0x2c8a48(0x143)](_0x2c8a48(0x15c)))return{'ok':!![],'data':{'total':_0x4b9b08[_0x2c8a48(0x16c)],'items':_0x4b9b08}};return{'ok':!![],'data':{'total':_0x4b9b08['length'],'items':_0x4b9b08[_0x2c8a48(0x13e)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a27_0x5e04d3(0x14e),'description':a27_0x5e04d3(0x161),'risk':a27_0x5e04d3(0x145),'flags':[{...ID_FLAG,'description':a27_0x5e04d3(0x146)}],async 'execute'(_0x19cf83){const _0x2b7447=a27_0x5e04d3,_0x1b2148=await getPersonalKnowledgeBaseItem(_0x19cf83[_0x2b7447(0x173)]('id'),_0x19cf83[_0x2b7447(0x14b)]);return{'ok':!![],'data':detailPersonalItem(_0x1b2148)};}},kbCreate={'service':'kb','command':a27_0x5e04d3(0x172),'description':a27_0x5e04d3(0x158),'risk':a27_0x5e04d3(0x160),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x5a55ce){const _0x35b2a7=a27_0x5e04d3,_0x5a7271=_0x5a55ce[_0x35b2a7(0x137)]('title'),_0x169197=readKnowledgeFile(_0x5a55ce[_0x35b2a7(0x137)]('file')),_0x3b3186=await createPersonalKnowledgeBaseItem(_0x5a55ce[_0x35b2a7(0x14b)],{'title':_0x5a7271,'content':_0x169197});return{'ok':!![],'data':summarizePersonalItem(_0x3b3186),'message':_0x35b2a7(0x13d)+_0x3b3186['id']+'\x20('+_0x3b3186[_0x35b2a7(0x170)]+')'};},async 'dryRun'(_0x544084){const _0x350199=a27_0x5e04d3,_0x624b0e=_0x544084['str'](_0x350199(0x170)),_0x4ca672=readKnowledgeFile(_0x544084[_0x350199(0x137)](_0x350199(0x139)));return dryRun(_0x350199(0x157),_0x350199(0x153))['body']({'appCode':_0x544084['appCode'],'title':_0x624b0e,'content':_0x4ca672})[_0x350199(0x15b)](_0x350199(0x151)+_0x624b0e+'\x22')[_0x350199(0x147)]();}},kbUpdate={'service':'kb','command':'update','description':'Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a27_0x5e04d3(0x160),'flags':[{...ID_FLAG,'description':a27_0x5e04d3(0x146)},{...TITLE_FLAG,'required':![],'description':a27_0x5e04d3(0x14a)},FILE_FLAG],async 'execute'(_0x4da0fd){const _0x81f8cb=a27_0x5e04d3,_0xfeab6c=_0x4da0fd[_0x81f8cb(0x173)]('id'),_0x3a8528=readKnowledgeFile(_0x4da0fd[_0x81f8cb(0x137)](_0x81f8cb(0x139))),_0x44f231=_0x4da0fd[_0x81f8cb(0x137)](_0x81f8cb(0x170))||(await getPersonalKnowledgeBaseItem(_0xfeab6c,_0x4da0fd[_0x81f8cb(0x14b)]))[_0x81f8cb(0x170)],_0x5002a3=await updatePersonalKnowledgeBaseItem(_0xfeab6c,_0x4da0fd[_0x81f8cb(0x14b)],{'title':_0x44f231,'content':_0x3a8528});return{'ok':!![],'data':summarizePersonalItem(_0x5002a3),'message':_0x81f8cb(0x14d)+_0x5002a3['id']+'\x20('+_0x5002a3['title']+')'};},async 'dryRun'(_0x53b0da){const _0x3f983f=a27_0x5e04d3,_0x439a97=_0x53b0da[_0x3f983f(0x173)]('id'),_0x3671ad=readKnowledgeFile(_0x53b0da[_0x3f983f(0x137)]('file')),_0x448907=_0x53b0da[_0x3f983f(0x137)](_0x3f983f(0x170))||(await getPersonalKnowledgeBaseItem(_0x439a97,_0x53b0da[_0x3f983f(0x14b)]))[_0x3f983f(0x170)];return dryRun(_0x3f983f(0x157),_0x3f983f(0x154)+_0x439a97+'/update')[_0x3f983f(0x16a)]({'appCode':_0x53b0da[_0x3f983f(0x14b)],'title':_0x448907,'content':_0x3671ad})[_0x3f983f(0x15b)](_0x3f983f(0x142)+_0x439a97)[_0x3f983f(0x147)]();}},kbSearch={'service':'kb','command':a27_0x5e04d3(0x14f),'description':a27_0x5e04d3(0x13b),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x4c9a94){const _0x4f0b70=a27_0x5e04d3;if(!_0x4c9a94[_0x4f0b70(0x137)]('query')['trim']())throw CliErrors[_0x4f0b70(0x15d)](_0x4f0b70(0x176));readTopK(_0x4c9a94);},async 'execute'(_0x1fed77){const _0x391eda=a27_0x5e04d3,_0x7c93ad=_0x1fed77[_0x391eda(0x137)]('query')[_0x391eda(0x155)](),_0x30da41=readTopK(_0x1fed77),_0x5993a7=await searchKnowledgeBase(_0x1fed77[_0x391eda(0x14b)],{'query':_0x7c93ad,'topK':_0x30da41});return{'ok':!![],'data':{'total':_0x5993a7[_0x391eda(0x16c)],'hits':_0x5993a7[_0x391eda(0x13e)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x4e8dda=a28_0x3e41;(function(_0x10af74,_0xbe84bf){const _0x3e484b=a28_0x3e41,_0x25c373=_0x10af74();while(!![]){try{const _0x3fa80c=-parseInt(_0x3e484b(0x131))/0x1+parseInt(_0x3e484b(0x133))/0x2*(-parseInt(_0x3e484b(0x125))/0x3)+-parseInt(_0x3e484b(0x12c))/0x4+parseInt(_0x3e484b(0x132))/0x5+-parseInt(_0x3e484b(0x123))/0x6+parseInt(_0x3e484b(0x11e))/0x7+-parseInt(_0x3e484b(0x124))/0x8*(-parseInt(_0x3e484b(0x11f))/0x9);if(_0x3fa80c===_0xbe84bf)break;else _0x25c373['push'](_0x25c373['shift']());}catch(_0x5e9328){_0x25c373['push'](_0x25c373['shift']());}}}(a28_0x48b7,0x580df));import{logger}from'../../utils/logger.js';function a28_0x48b7(){const _0x2d50e5=['command','toLocaleString','log','message','\x20\x20\x20Duration:\x20','clearLogs','\x20\x20\x20Time:\x20','381962NGHFdZ','9nOFsFV','warn','write','success','4319226yNHYxv','22846120lRBzzR','3xPUxcu','length','error','\x20logs:\x0a','details','duration','clear','2747172CBwVUe','*\x20No\x20logs\x20found','en-US','timestamp','level','558611XQFDER','458080gkSdjC','1352002cSuayY','stringify','keys','logs'];a28_0x48b7=function(){return _0x2d50e5;};return a28_0x48b7();}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x312984){const _0x7480f5=a28_0x3e41;if(_0x312984['length']===0x0){console[_0x7480f5(0x119)](_0x7480f5(0x12d));return;}console[_0x7480f5(0x119)]('*\x20'+CLI_DISPLAY_NAME+_0x7480f5(0x128)),_0x312984['forEach']((_0x57ce78,_0x17142a)=>{const _0x2b0d0a=_0x7480f5,_0x1c5252=new Date(_0x57ce78[_0x2b0d0a(0x12f)])[_0x2b0d0a(0x118)](_0x2b0d0a(0x12e)),_0x358074=_0x57ce78[_0x2b0d0a(0x130)]===_0x2b0d0a(0x122)?'√':_0x57ce78[_0x2b0d0a(0x130)]===_0x2b0d0a(0x127)?'×':_0x57ce78[_0x2b0d0a(0x130)]===_0x2b0d0a(0x120)?'!':'i';console[_0x2b0d0a(0x119)](_0x17142a+0x1+'.\x20'+_0x358074+'\x20['+_0x57ce78[_0x2b0d0a(0x117)]+']\x20'+_0x57ce78[_0x2b0d0a(0x11a)]),console[_0x2b0d0a(0x119)](_0x2b0d0a(0x11d)+_0x1c5252),_0x57ce78[_0x2b0d0a(0x12a)]&&console[_0x2b0d0a(0x119)](_0x2b0d0a(0x11b)+_0x57ce78[_0x2b0d0a(0x12a)]+'ms'),_0x57ce78[_0x2b0d0a(0x129)]&&Object[_0x2b0d0a(0x115)](_0x57ce78[_0x2b0d0a(0x129)])[_0x2b0d0a(0x126)]>0x0&&console[_0x2b0d0a(0x119)]('\x20\x20\x20Details:\x20'+JSON[_0x2b0d0a(0x114)](_0x57ce78['details'],null,0x2)),console['log']('');});}function a28_0x3e41(_0x4b4421,_0x2772d3){_0x4b4421=_0x4b4421-0x114;const _0x48b791=a28_0x48b7();let _0x3e413d=_0x48b791[_0x4b4421];return _0x3e413d;}export const logsDefinitions=[{'service':a28_0x4e8dda(0x116),'command':'show','description':'View\x20command\x20history\x20logs','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5012f2){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a28_0x4e8dda(0x116),'command':a28_0x4e8dda(0x12b),'description':'Clear\x20command\x20history\x20logs','risk':a28_0x4e8dda(0x121),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1e7811){const _0xaab8ce=a28_0x4e8dda;return logger[_0xaab8ce(0x11c)](),console[_0xaab8ce(0x119)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x15d8e1=a29_0xd223;(function(_0x109c27,_0x1fd851){const _0x5b1885=a29_0xd223,_0x47b84b=_0x109c27();while(!![]){try{const _0x5d87f6=-parseInt(_0x5b1885(0x12c))/0x1+-parseInt(_0x5b1885(0x122))/0x2+-parseInt(_0x5b1885(0x146))/0x3*(-parseInt(_0x5b1885(0x11b))/0x4)+-parseInt(_0x5b1885(0x135))/0x5+-parseInt(_0x5b1885(0x107))/0x6+-parseInt(_0x5b1885(0x10d))/0x7*(-parseInt(_0x5b1885(0x137))/0x8)+parseInt(_0x5b1885(0x140))/0x9;if(_0x5d87f6===_0x1fd851)break;else _0x47b84b['push'](_0x47b84b['shift']());}catch(_0x2ca3e6){_0x47b84b['push'](_0x47b84b['shift']());}}}(a29_0x5f3d,0x2369d));import{existsSync,readFileSync,statSync}from'node:fs';function a29_0xd223(_0x4d33da,_0x494226){_0x4d33da=_0x4d33da-0x106;const _0x5f3d3a=a29_0x5f3d();let _0xd223f4=_0x5f3d3a[_0x4d33da];return _0xd223f4;}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a29_0x15d8e1(0x13e),'type':a29_0x15d8e1(0x10f),'description':a29_0x15d8e1(0x129)},FUNCTION_NAME_FLAG={'name':a29_0x15d8e1(0x124),'type':a29_0x15d8e1(0x10f),'required':!![],'description':a29_0x15d8e1(0x11c)},DESCRIPTION_FLAG={'name':a29_0x15d8e1(0x123),'type':a29_0x15d8e1(0x10f),'description':a29_0x15d8e1(0x133)},SOURCE_SESSION_FLAG={'name':a29_0x15d8e1(0x115),'type':a29_0x15d8e1(0x10f),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x58e7a1){const _0x594c09=a29_0x15d8e1,_0x3fcf60=String(_0x58e7a1||'')[_0x594c09(0x145)]();if(!_0x3fcf60||!FUNCTION_NAME_PATTERN[_0x594c09(0x148)](_0x3fcf60))throw CliErrors[_0x594c09(0x117)](_0x594c09(0x112));return _0x3fcf60;}function readScriptFile(_0x5ce0f2){const _0x124770=a29_0x15d8e1;if(!_0x5ce0f2)throw CliErrors[_0x124770(0x117)]('File\x20path\x20is\x20required.');if(!existsSync(_0x5ce0f2))throw CliErrors[_0x124770(0x117)](_0x124770(0x149)+_0x5ce0f2);if(!statSync(_0x5ce0f2)['isFile']())throw CliErrors[_0x124770(0x117)](_0x124770(0x130)+_0x5ce0f2);const _0x9ca8cd=readFileSync(_0x5ce0f2,'utf8');if(!_0x9ca8cd[_0x124770(0x145)]())throw CliErrors[_0x124770(0x117)](_0x124770(0x10b));return _0x9ca8cd;}function optionalTrimmed(_0x1cdeb1){const _0x25e4d2=a29_0x15d8e1,_0x12829b=String(_0x1cdeb1||'')[_0x25e4d2(0x145)]();return _0x12829b||undefined;}function summarizeBff(_0xe7f464){const _0x22ea67=a29_0x15d8e1;return{'id':_0xe7f464['id'],'appCode':_0xe7f464[_0x22ea67(0x138)],'functionName':_0xe7f464[_0x22ea67(0x121)],'description':_0xe7f464[_0x22ea67(0x123)],'scriptType':_0xe7f464[_0x22ea67(0x126)],'version':_0xe7f464[_0x22ea67(0x12b)],'gmtModified':_0xe7f464['gmtModified'],'updateTime':_0xe7f464['updateTime']};}function a29_0x5f3d(){const _0x1a0be7=['isArray','updateTime','high-risk-write','sourceSessionId','POST','file','Updated\x20personal\x20BFF\x20','2473155JNPiOQ','bool','Preview:\x20create\x20personal\x20BFF\x20','scriptContent','body','trim','9DzjzYD','--params\x20must\x20be\x20a\x20JSON\x20object.','test','File\x20not\x20found:\x20','createTime','922278decAed','/client/runtime-bff/personal/create','length','keys','Personal\x20BFF\x20script\x20file\x20is\x20blank.','createUserId','186788eIVuhY','/update','string','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','exec','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','Preview:\x20update\x20personal\x20BFF\x20','read','source-session-id','detail','validation','/client/runtime-bff/personal/','config','Show\x20one\x20personal\x20BFF\x20by\x20id','356956sCyQJw','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','personal-bff','Created\x20personal\x20BFF\x20','write','Personal\x20BFF\x20script\x20ID','functionName','129238hgvcHe','description','name','num','scriptType','map','gmtCreate','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','str','version','222054HkibcJ','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','params','gmtModified','File\x20is\x20not\x20a\x20regular\x20file:\x20','build','flag','Personal\x20BFF\x20description','create','1119565WXhcNR','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','80jiOOaP','appCode'];a29_0x5f3d=function(){return _0x1a0be7;};return a29_0x5f3d();}function detailBff(_0x2cb8d9){const _0x355a49=a29_0x15d8e1;return{'id':_0x2cb8d9['id'],'appCode':_0x2cb8d9[_0x355a49(0x138)],'functionName':_0x2cb8d9[_0x355a49(0x121)],'description':_0x2cb8d9[_0x355a49(0x123)],'scriptType':_0x2cb8d9[_0x355a49(0x126)],'scriptContent':_0x2cb8d9[_0x355a49(0x143)]??'','config':_0x2cb8d9[_0x355a49(0x119)],'version':_0x2cb8d9[_0x355a49(0x12b)],'createUserId':_0x2cb8d9[_0x355a49(0x10c)],'gmtCreate':_0x2cb8d9[_0x355a49(0x128)],'gmtModified':_0x2cb8d9[_0x355a49(0x12f)],'createTime':_0x2cb8d9[_0x355a49(0x106)],'updateTime':_0x2cb8d9[_0x355a49(0x13a)]};}function buildCreateInput(_0x3bf8b3){const _0x504ad6=a29_0x15d8e1;return{'functionName':normalizeFunctionName(_0x3bf8b3[_0x504ad6(0x12a)](_0x504ad6(0x124))),...optionalTrimmed(_0x3bf8b3[_0x504ad6(0x12a)](_0x504ad6(0x123)))?{'description':optionalTrimmed(_0x3bf8b3[_0x504ad6(0x12a)](_0x504ad6(0x123)))}:{},'scriptContent':readScriptFile(_0x3bf8b3[_0x504ad6(0x12a)](_0x504ad6(0x13e))),...optionalTrimmed(_0x3bf8b3['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x3bf8b3['str']('source-session-id'))}:{}};}function buildUpdateInput(_0x23ffb9){const _0x239af0=a29_0x15d8e1,_0x587796={};optionalTrimmed(_0x23ffb9['str'](_0x239af0(0x124)))&&(_0x587796[_0x239af0(0x121)]=normalizeFunctionName(_0x23ffb9[_0x239af0(0x12a)](_0x239af0(0x124))));_0x23ffb9[_0x239af0(0x132)](_0x239af0(0x123))!==undefined&&(_0x587796['description']=_0x23ffb9[_0x239af0(0x12a)]('description'));optionalTrimmed(_0x23ffb9[_0x239af0(0x12a)]('file'))&&(_0x587796[_0x239af0(0x143)]=readScriptFile(_0x23ffb9[_0x239af0(0x12a)](_0x239af0(0x13e))));_0x23ffb9[_0x239af0(0x132)]('source-session-id')!==undefined&&(_0x587796[_0x239af0(0x13c)]=_0x23ffb9[_0x239af0(0x12a)](_0x239af0(0x115)));if(Object[_0x239af0(0x10a)](_0x587796)[_0x239af0(0x109)]===0x0)throw CliErrors[_0x239af0(0x117)](_0x239af0(0x110));return _0x587796;}function parseExecParams(_0xbb77b2){const _0x3675c9=a29_0x15d8e1,_0x1d0ed8=parseJsonParams(_0xbb77b2)??{};if(Array[_0x3675c9(0x139)](_0x1d0ed8))throw CliErrors['validation'](_0x3675c9(0x147));return _0x1d0ed8;}const personalBffList={'service':'personal-bff','command':'list','description':a29_0x15d8e1(0x136),'risk':a29_0x15d8e1(0x114),'flags':[VERBOSE_FLAG],async 'execute'(_0x52bce2){const _0x2cd510=a29_0x15d8e1,_0x504db0=await listPersonalBffs(_0x52bce2[_0x2cd510(0x138)]);return{'ok':!![],'data':{'total':_0x504db0['length'],'items':_0x52bce2[_0x2cd510(0x141)]('verbose')?_0x504db0:_0x504db0[_0x2cd510(0x127)](summarizeBff)}};}},personalBffDetail={'service':a29_0x15d8e1(0x11d),'command':a29_0x15d8e1(0x116),'description':a29_0x15d8e1(0x11a),'risk':a29_0x15d8e1(0x114),'flags':[{...ID_FLAG,'description':a29_0x15d8e1(0x120)}],async 'execute'(_0x2ec7cb){const _0x41c500=a29_0x15d8e1,_0x151387=await getPersonalBff(_0x2ec7cb['num']('id'),_0x2ec7cb[_0x41c500(0x138)]);return{'ok':!![],'data':detailBff(_0x151387)};}},personalBffCreate={'service':a29_0x15d8e1(0x11d),'command':a29_0x15d8e1(0x134),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a29_0x15d8e1(0x11f),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x66559e){const _0x3f442d=a29_0x15d8e1,_0x39f8ba=buildCreateInput(_0x66559e),_0x141e53=await createPersonalBff(_0x66559e[_0x3f442d(0x138)],_0x39f8ba);return{'ok':!![],'data':detailBff(_0x141e53),'message':_0x3f442d(0x11e)+_0x141e53['id']+(_0x141e53[_0x3f442d(0x121)]?'\x20('+_0x141e53[_0x3f442d(0x121)]+')':'')};},async 'dryRun'(_0x2e4e5c){const _0x5b38c9=a29_0x15d8e1,_0x56d3ba=buildCreateInput(_0x2e4e5c);return dryRun(_0x5b38c9(0x13d),_0x5b38c9(0x108))['body']({'appCode':_0x2e4e5c[_0x5b38c9(0x138)],..._0x56d3ba})[_0x5b38c9(0x123)](_0x5b38c9(0x142)+_0x56d3ba[_0x5b38c9(0x121)])[_0x5b38c9(0x131)]();}},personalBffUpdate={'service':a29_0x15d8e1(0x11d),'command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':'write','flags':[{...ID_FLAG,'description':a29_0x15d8e1(0x120)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2ee96c){const _0x2a145b=a29_0x15d8e1,_0x54f7b4=_0x2ee96c[_0x2a145b(0x125)]('id'),_0x20ef76=buildUpdateInput(_0x2ee96c),_0x3ffa0e=await updatePersonalBff(_0x54f7b4,_0x2ee96c[_0x2a145b(0x138)],_0x20ef76);return{'ok':!![],'data':detailBff(_0x3ffa0e),'message':_0x2a145b(0x13f)+_0x3ffa0e['id']+(_0x3ffa0e[_0x2a145b(0x121)]?'\x20('+_0x3ffa0e[_0x2a145b(0x121)]+')':'')};},async 'dryRun'(_0x59f3c8){const _0x3749aa=a29_0x15d8e1,_0x33c022=_0x59f3c8[_0x3749aa(0x125)]('id'),_0x80da31=buildUpdateInput(_0x59f3c8);return dryRun(_0x3749aa(0x13d),_0x3749aa(0x118)+_0x33c022+_0x3749aa(0x10e))[_0x3749aa(0x144)]({'appCode':_0x59f3c8['appCode'],..._0x80da31})[_0x3749aa(0x123)](_0x3749aa(0x113)+_0x33c022)['build']();}},personalBffExec={'service':a29_0x15d8e1(0x11d),'command':a29_0x15d8e1(0x111),'description':a29_0x15d8e1(0x12d),'risk':a29_0x15d8e1(0x13b),'flags':[{...ID_FLAG,'description':a29_0x15d8e1(0x120)},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0xe39f4){parseExecParams(_0xe39f4['str']('params'));},async 'execute'(_0x2dbd90){const _0xd6cc0=a29_0x15d8e1,_0x4bb0d6=_0x2dbd90[_0xd6cc0(0x125)]('id'),_0xb565e9=parseExecParams(_0x2dbd90[_0xd6cc0(0x12a)](_0xd6cc0(0x12e))),_0x1372db=await executePersonalBff(_0x4bb0d6,_0x2dbd90['appCode'],_0xb565e9);return{'ok':!![],'data':{'result':_0x1372db},'message':'Executed\x20personal\x20BFF\x20'+_0x4bb0d6};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a29_0x51b652=a29_0x5c5b;(function(_0x44cc00,_0x115093){const _0x9bfa32=a29_0x5c5b,_0x377a73=_0x44cc00();while(!![]){try{const _0x438d6a=parseInt(_0x9bfa32(0x1cb))/0x1+-parseInt(_0x9bfa32(0x193))/0x2*(-parseInt(_0x9bfa32(0x198))/0x3)+-parseInt(_0x9bfa32(0x1ab))/0x4+parseInt(_0x9bfa32(0x1bf))/0x5*(-parseInt(_0x9bfa32(0x19d))/0x6)+parseInt(_0x9bfa32(0x1b3))/0x7+-parseInt(_0x9bfa32(0x1be))/0x8+-parseInt(_0x9bfa32(0x1a6))/0x9;if(_0x438d6a===_0x115093)break;else _0x377a73['push'](_0x377a73['shift']());}catch(_0x1fed07){_0x377a73['push'](_0x377a73['shift']());}}}(a29_0x230c,0x78c21));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a29_0x230c(){const _0xec06db=['map','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','/client/runtime-bff/personal/','Created\x20personal\x20BFF\x20','validation','isArray','1844FeVahB','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','write','scriptType','list','273myFzIr','Optional\x20source\x20RuntimeAgent\x20session\x20id','version','File\x20not\x20found:\x20','description','310578BuBRYU','appCode','verbose','createTime','config','Personal\x20BFF\x20script\x20file\x20is\x20blank.','length','test','functionName','4534767eBeoNX','str','file','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','build','221464IMNIGW','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Show\x20one\x20personal\x20BFF\x20by\x20id','personal-bff','exec','updateTime','Executed\x20personal\x20BFF\x20','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','4004833eZKbai','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','source-session-id','gmtModified','Updated\x20personal\x20BFF\x20','trim','scriptContent','params','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','read','isFile','880984RjuYij','20wdJcDs','bool','name','create','body','Personal\x20BFF\x20script\x20ID','update','flag','string','Personal\x20BFF\x20description','Update\x20a\x20personal\x20BFF\x20by\x20id','detail','715008MtfUns','POST','num'];a29_0x230c=function(){return _0xec06db;};return a29_0x230c();}import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a29_0x51b652(0x1a8),'type':'string','description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':a29_0x51b652(0x1c7),'required':!![],'description':a29_0x51b652(0x1ac)},DESCRIPTION_FLAG={'name':a29_0x51b652(0x19c),'type':'string','description':a29_0x51b652(0x1c8)},SOURCE_SESSION_FLAG={'name':a29_0x51b652(0x1b5),'type':a29_0x51b652(0x1c7),'description':a29_0x51b652(0x199)};function normalizeFunctionName(_0x5e9bbc){const _0x28122a=a29_0x51b652,_0x52ccef=String(_0x5e9bbc||'')[_0x28122a(0x1b8)]();if(!_0x52ccef||!FUNCTION_NAME_PATTERN[_0x28122a(0x1a4)](_0x52ccef))throw CliErrors[_0x28122a(0x191)](_0x28122a(0x1cf));return _0x52ccef;}function readScriptFile(_0x5e586d){const _0x1aeeff=a29_0x51b652;if(!_0x5e586d)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x5e586d))throw CliErrors[_0x1aeeff(0x191)](_0x1aeeff(0x19b)+_0x5e586d);if(!statSync(_0x5e586d)[_0x1aeeff(0x1bd)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5e586d);const _0x3a30ba=readFileSync(_0x5e586d,'utf8');if(!_0x3a30ba[_0x1aeeff(0x1b8)]())throw CliErrors[_0x1aeeff(0x191)](_0x1aeeff(0x1a2));return _0x3a30ba;}function optionalTrimmed(_0x309f53){const _0x5d4997=String(_0x309f53||'')['trim']();return _0x5d4997||undefined;}function summarizeBff(_0x3517a4){const _0x33da40=a29_0x51b652;return{'id':_0x3517a4['id'],'appCode':_0x3517a4['appCode'],'functionName':_0x3517a4[_0x33da40(0x1a5)],'description':_0x3517a4[_0x33da40(0x19c)],'scriptType':_0x3517a4['scriptType'],'version':_0x3517a4[_0x33da40(0x19a)],'gmtModified':_0x3517a4[_0x33da40(0x1b6)],'updateTime':_0x3517a4[_0x33da40(0x1b0)]};}function detailBff(_0x339a53){const _0x174320=a29_0x51b652;return{'id':_0x339a53['id'],'appCode':_0x339a53[_0x174320(0x19e)],'functionName':_0x339a53[_0x174320(0x1a5)],'description':_0x339a53['description'],'scriptType':_0x339a53[_0x174320(0x196)],'scriptContent':_0x339a53[_0x174320(0x1b9)]??'','config':_0x339a53[_0x174320(0x1a1)],'version':_0x339a53[_0x174320(0x19a)],'createUserId':_0x339a53['createUserId'],'gmtCreate':_0x339a53['gmtCreate'],'gmtModified':_0x339a53[_0x174320(0x1b6)],'createTime':_0x339a53[_0x174320(0x1a0)],'updateTime':_0x339a53[_0x174320(0x1b0)]};}function buildCreateInput(_0x42b6ec){const _0x165442=a29_0x51b652;return{'functionName':normalizeFunctionName(_0x42b6ec[_0x165442(0x1a7)](_0x165442(0x1c1))),...optionalTrimmed(_0x42b6ec[_0x165442(0x1a7)](_0x165442(0x19c)))?{'description':optionalTrimmed(_0x42b6ec[_0x165442(0x1a7)](_0x165442(0x19c)))}:{},'scriptContent':readScriptFile(_0x42b6ec[_0x165442(0x1a7)](_0x165442(0x1a8))),...optionalTrimmed(_0x42b6ec[_0x165442(0x1a7)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x42b6ec['str']('source-session-id'))}:{}};}function a29_0x5c5b(_0x29f11c,_0x1177bb){_0x29f11c=_0x29f11c-0x191;const _0x230c69=a29_0x230c();let _0x5c5b91=_0x230c69[_0x29f11c];return _0x5c5b91;}function buildUpdateInput(_0x420943){const _0x430ca0=a29_0x51b652,_0x1c804f={};optionalTrimmed(_0x420943[_0x430ca0(0x1a7)](_0x430ca0(0x1c1)))&&(_0x1c804f[_0x430ca0(0x1a5)]=normalizeFunctionName(_0x420943[_0x430ca0(0x1a7)](_0x430ca0(0x1c1))));_0x420943['flag']('description')!==undefined&&(_0x1c804f['description']=_0x420943[_0x430ca0(0x1a7)](_0x430ca0(0x19c)));optionalTrimmed(_0x420943['str'](_0x430ca0(0x1a8)))&&(_0x1c804f[_0x430ca0(0x1b9)]=readScriptFile(_0x420943[_0x430ca0(0x1a7)](_0x430ca0(0x1a8))));_0x420943[_0x430ca0(0x1c6)]('source-session-id')!==undefined&&(_0x1c804f['sourceSessionId']=_0x420943[_0x430ca0(0x1a7)](_0x430ca0(0x1b5)));if(Object['keys'](_0x1c804f)[_0x430ca0(0x1a3)]===0x0)throw CliErrors['validation'](_0x430ca0(0x1a9));return _0x1c804f;}function parseExecParams(_0x218798){const _0x5b8c96=a29_0x51b652,_0x3ec89f=parseJsonParams(_0x218798)??{};if(Array[_0x5b8c96(0x192)](_0x3ec89f))throw CliErrors[_0x5b8c96(0x191)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3ec89f;}const personalBffList={'service':a29_0x51b652(0x1ae),'command':a29_0x51b652(0x197),'description':a29_0x51b652(0x1bb),'risk':a29_0x51b652(0x1bc),'flags':[VERBOSE_FLAG],async 'execute'(_0x4708b7){const _0x3bd82a=a29_0x51b652,_0x2ff54b=await listPersonalBffs(_0x4708b7[_0x3bd82a(0x19e)]);return{'ok':!![],'data':{'total':_0x2ff54b[_0x3bd82a(0x1a3)],'items':_0x4708b7[_0x3bd82a(0x1c0)](_0x3bd82a(0x19f))?_0x2ff54b:_0x2ff54b[_0x3bd82a(0x1ce)](summarizeBff)}};}},personalBffDetail={'service':a29_0x51b652(0x1ae),'command':a29_0x51b652(0x1ca),'description':a29_0x51b652(0x1ad),'risk':'read','flags':[{...ID_FLAG,'description':a29_0x51b652(0x1c4)}],async 'execute'(_0x45ffad){const _0x567bac=a29_0x51b652,_0x48ddfe=await getPersonalBff(_0x45ffad[_0x567bac(0x1cd)]('id'),_0x45ffad[_0x567bac(0x19e)]);return{'ok':!![],'data':detailBff(_0x48ddfe)};}},personalBffCreate={'service':a29_0x51b652(0x1ae),'command':a29_0x51b652(0x1c2),'description':a29_0x51b652(0x194),'risk':a29_0x51b652(0x195),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x36a17d){const _0x4a3980=a29_0x51b652,_0x5bfb39=buildCreateInput(_0x36a17d),_0x5ddcb9=await createPersonalBff(_0x36a17d[_0x4a3980(0x19e)],_0x5bfb39);return{'ok':!![],'data':detailBff(_0x5ddcb9),'message':_0x4a3980(0x1d1)+_0x5ddcb9['id']+(_0x5ddcb9[_0x4a3980(0x1a5)]?'\x20('+_0x5ddcb9['functionName']+')':'')};},async 'dryRun'(_0x399538){const _0x224b9a=a29_0x51b652,_0xd926ad=buildCreateInput(_0x399538);return dryRun('POST','/client/runtime-bff/personal/create')[_0x224b9a(0x1c3)]({'appCode':_0x399538[_0x224b9a(0x19e)],..._0xd926ad})['description']('Preview:\x20create\x20personal\x20BFF\x20'+_0xd926ad['functionName'])[_0x224b9a(0x1aa)]();}},personalBffUpdate={'service':a29_0x51b652(0x1ae),'command':a29_0x51b652(0x1c5),'description':a29_0x51b652(0x1c9),'risk':'write','flags':[{...ID_FLAG,'description':a29_0x51b652(0x1c4)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5232c4){const _0x5b23eb=a29_0x51b652,_0x590a5c=_0x5232c4[_0x5b23eb(0x1cd)]('id'),_0xdce8df=buildUpdateInput(_0x5232c4),_0x3f7b7a=await updatePersonalBff(_0x590a5c,_0x5232c4[_0x5b23eb(0x19e)],_0xdce8df);return{'ok':!![],'data':detailBff(_0x3f7b7a),'message':_0x5b23eb(0x1b7)+_0x3f7b7a['id']+(_0x3f7b7a[_0x5b23eb(0x1a5)]?'\x20('+_0x3f7b7a[_0x5b23eb(0x1a5)]+')':'')};},async 'dryRun'(_0x14166b){const _0x4eda9b=a29_0x51b652,_0x468add=_0x14166b['num']('id'),_0x342e59=buildUpdateInput(_0x14166b);return dryRun(_0x4eda9b(0x1cc),_0x4eda9b(0x1d0)+_0x468add+'/update')[_0x4eda9b(0x1c3)]({'appCode':_0x14166b[_0x4eda9b(0x19e)],..._0x342e59})[_0x4eda9b(0x19c)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x468add)['build']();}},personalBffExec={'service':a29_0x51b652(0x1ae),'command':a29_0x51b652(0x1af),'description':a29_0x51b652(0x1b4),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a29_0x51b652(0x1b2)}],async 'validate'(_0x1ddece){const _0x411ea8=a29_0x51b652;parseExecParams(_0x1ddece[_0x411ea8(0x1a7)](_0x411ea8(0x1ba)));},async 'execute'(_0x8ff269){const _0x34f95f=a29_0x51b652,_0x36e042=_0x8ff269[_0x34f95f(0x1cd)]('id'),_0xab504e=parseExecParams(_0x8ff269[_0x34f95f(0x1a7)](_0x34f95f(0x1ba))),_0xdf3c9b=await executePersonalBff(_0x36e042,_0x8ff269[_0x34f95f(0x19e)],_0xab504e);return{'ok':!![],'data':{'result':_0xdf3c9b},'message':_0x34f95f(0x1b1)+_0x36e042};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x250421=a30_0x22da;(function(_0x420c50,_0x4db2e7){const _0x403bf1=a30_0x22da,_0x242ff2=_0x420c50();while(!![]){try{const _0x710246=parseInt(_0x403bf1(0x1ef))/0x1*(parseInt(_0x403bf1(0x1e4))/0x2)+-parseInt(_0x403bf1(0x1ee))/0x3+-parseInt(_0x403bf1(0x1e7))/0x4*(-parseInt(_0x403bf1(0x1ed))/0x5)+parseInt(_0x403bf1(0x1d5))/0x6+parseInt(_0x403bf1(0x1d7))/0x7*(-parseInt(_0x403bf1(0x1d2))/0x8)+parseInt(_0x403bf1(0x1d9))/0x9+parseInt(_0x403bf1(0x1f2))/0xa*(-parseInt(_0x403bf1(0x1e0))/0xb);if(_0x710246===_0x4db2e7)break;else _0x242ff2['push'](_0x242ff2['shift']());}catch(_0x375e1a){_0x242ff2['push'](_0x242ff2['shift']());}}}(a30_0x235b,0x41d7f));function a30_0x235b(){const _0x49530c=['BFF\x20Scripts','CLI\x20Built-in\x20Skill','write','API\x20Documentation','\x20\x20[high-risk-write]','description','Skills','Self\x20Update','service','defaultCommand','push','32tMJYYm','Artifacts','get','1095546ZTUDIG','risk','517832iCZCog','list','2041002VgOsZa','\x20\x20[write]','Knowledge\x20Base','isSingleCommand','App\x20Management','login','command','6006022yxhtou','Schema','install','set','215306CDnvrM','map','Personal\x20BFF','980552VTQqnK','values','Datasets','Service\x20Tree','Configuration','SQL\x20Queries','10LvmHft','10050XzRGSw','2ZXFoHn','Diagnostics','Workspace','10EObfbS'];a30_0x235b=function(){return _0x49530c;};return a30_0x235b();}import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();function a30_0x22da(_0x19930d,_0x5c4def){_0x19930d=_0x19930d-0x1ce;const _0x235b82=a30_0x235b();let _0x22da32=_0x235b82[_0x19930d];return _0x22da32;}export const serviceGroups=new Map();function registerDefinitions(_0x37305d){const _0x1f5b37=a30_0x22da;for(const _0x4e8f6d of _0x37305d){definitions[_0x1f5b37(0x1e3)](_0x4e8f6d[_0x1f5b37(0x1cf)]+':'+_0x4e8f6d[_0x1f5b37(0x1df)],_0x4e8f6d);let _0x102552=serviceGroups[_0x1f5b37(0x1d4)](_0x4e8f6d[_0x1f5b37(0x1cf)]);!_0x102552&&(_0x102552=[],serviceGroups[_0x1f5b37(0x1e3)](_0x4e8f6d['service'],_0x102552)),_0x102552[_0x1f5b37(0x1d1)](_0x4e8f6d);}}function registerService(_0x356ea6,_0x301f61,_0x590260){const _0x58b237=a30_0x22da;registerDefinitions(_0x301f61);const _0x5bf711=_0x4f1ea9=>_0x4f1ea9==='read'?'':_0x4f1ea9===_0x58b237(0x1f5)?_0x58b237(0x1da):_0x58b237(0x1f7),_0x4f62ca={'service':_0x301f61[0x0]['service'],'label':_0x356ea6,'commands':_0x301f61[_0x58b237(0x1e5)](_0x1ebb80=>({'command':_0x1ebb80[_0x58b237(0x1df)],'description':_0x1ebb80[_0x58b237(0x1f8)],'tag':_0x5bf711(_0x1ebb80[_0x58b237(0x1d6)])})),'defaultCommand':_0x590260?.[_0x58b237(0x1d0)]??(_0x590260?.[_0x58b237(0x1dc)]?_0x301f61[0x0][_0x58b237(0x1df)]:undefined),'isSingleCommand':_0x590260?.[_0x58b237(0x1dc)]};serviceRegistry[_0x58b237(0x1d1)](_0x4f62ca),serviceByName[_0x58b237(0x1e3)](_0x4f62ca[_0x58b237(0x1cf)],_0x4f62ca);}registerService('Authentication',authDefinitions,{'defaultCommand':a30_0x250421(0x1de)}),registerService(a30_0x250421(0x1f6),apiDocDefinitions),registerService(a30_0x250421(0x1e9),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a30_0x250421(0x1ec),sqlDefinitions),registerService(a30_0x250421(0x1f3),bffDefinitions),registerService(a30_0x250421(0x1e6),personalBffDefinitions),registerService(a30_0x250421(0x1d3),artifactDefinitions),registerService(a30_0x250421(0x1db),kbDefinitions),registerService(a30_0x250421(0x1dd),appDefinitions,{'defaultCommand':a30_0x250421(0x1d8)}),registerService(a30_0x250421(0x1f1),workspaceDefinitions),registerService(a30_0x250421(0x1eb),configDefinitions,{'defaultCommand':a30_0x250421(0x1d8)}),registerService(a30_0x250421(0x1ea),serviceDefinitions,{'defaultCommand':a30_0x250421(0x1d8)}),registerService(a30_0x250421(0x1f9),skillDefinitions,{'defaultCommand':a30_0x250421(0x1e2)}),registerService(a30_0x250421(0x1f4),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a30_0x250421(0x1ce),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a30_0x250421(0x1f0),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a30_0x250421(0x1e1),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x127514,_0x3ae1df){return definitions['get'](_0x127514+':'+_0x3ae1df);}export function isKnownService(_0x239dba){return serviceByName['has'](_0x239dba);}export function getServiceEntry(_0xb4f3cf){return serviceByName['get'](_0xb4f3cf);}export function getAllDefinitions(){const _0x30a94b=a30_0x250421;return Array['from'](definitions[_0x30a94b(0x1e8)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x476bba=a31_0xd1a1;(function(_0x563869,_0x3052ed){const _0x4aebf5=a31_0xd1a1,_0x2a0e36=_0x563869();while(!![]){try{const _0x374dfe=-parseInt(_0x4aebf5(0x16b))/0x1*(parseInt(_0x4aebf5(0x178))/0x2)+-parseInt(_0x4aebf5(0x16a))/0x3*(parseInt(_0x4aebf5(0x174))/0x4)+parseInt(_0x4aebf5(0x16c))/0x5*(-parseInt(_0x4aebf5(0x172))/0x6)+-parseInt(_0x4aebf5(0x173))/0x7*(parseInt(_0x4aebf5(0x16d))/0x8)+parseInt(_0x4aebf5(0x16e))/0x9*(parseInt(_0x4aebf5(0x171))/0xa)+parseInt(_0x4aebf5(0x175))/0xb+parseInt(_0x4aebf5(0x16f))/0xc;if(_0x374dfe===_0x3052ed)break;else _0x2a0e36['push'](_0x2a0e36['shift']());}catch(_0x110bb9){_0x2a0e36['push'](_0x2a0e36['shift']());}}}(a31_0x1c15,0x6e557));function a31_0xd1a1(_0x18b6a6,_0x2cf28f){_0x18b6a6=_0x18b6a6-0x16a;const _0x1c1576=a31_0x1c15();let _0xd1a110=_0x1c1576[_0x18b6a6];return _0xd1a110;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x480ebb){const _0x28dbd4=await buildSchemaPayload();return{'ok':!![],'data':_0x28dbd4};}function a31_0x1c15(){const _0x198aa1=['4459020irTNpI','786uZHEvF','28iayDRS','4iOERVn','8296233uaMQNt','schema','export','158344ibtWRl','47148pQrHeQ','4HLadTa','13595CnrYFy','1737824dUKwrN','18aOJBaP','4361100IFbRAK','read'];a31_0x1c15=function(){return _0x198aa1;};return a31_0x1c15();}export const schemaDefinition={'service':a31_0x476bba(0x176),'command':a31_0x476bba(0x177),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a31_0x476bba(0x170),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1b8b95,_0x1c8010){const _0x7a01a8=a32_0x4f5b,_0x388be2=_0x1b8b95();while(!![]){try{const _0x2e655b=parseInt(_0x7a01a8(0x9e))/0x1*(-parseInt(_0x7a01a8(0xa6))/0x2)+-parseInt(_0x7a01a8(0x98))/0x3*(parseInt(_0x7a01a8(0xb2))/0x4)+-parseInt(_0x7a01a8(0xa5))/0x5+-parseInt(_0x7a01a8(0x7a))/0x6*(parseInt(_0x7a01a8(0xaa))/0x7)+-parseInt(_0x7a01a8(0x97))/0x8+-parseInt(_0x7a01a8(0xab))/0x9*(parseInt(_0x7a01a8(0xc1))/0xa)+parseInt(_0x7a01a8(0x94))/0xb*(parseInt(_0x7a01a8(0xaf))/0xc);if(_0x2e655b===_0x1c8010)break;else _0x388be2['push'](_0x388be2['shift']());}catch(_0x3afa6b){_0x388be2['push'](_0x388be2['shift']());}}}(a32_0x27d7,0x3dd16));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a32_0x4f5b(_0x3060bd,_0x508936){_0x3060bd=_0x3060bd-0x6e;const _0x27d7b1=a32_0x27d7();let _0x4f5b82=_0x27d7b1[_0x3060bd];return _0x4f5b82;}import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x475f48,_0xbe445a){const _0x242f26=a32_0x4f5b,_0x2bc202=listLocalServiceTrees();let _0x47f784;for(const _0xfe2dea of _0x2bc202){const _0x5c4dde=matchServiceTreeCommand(_0xfe2dea,_0x475f48);if(!_0x5c4dde)continue;(!_0x47f784||_0x5c4dde[_0x242f26(0x71)]['fullPath'][_0x242f26(0x92)]>_0x47f784[_0x242f26(0x71)][_0x242f26(0x78)][_0x242f26(0x92)])&&(_0x47f784={'tree':_0xfe2dea,'command':_0x5c4dde['command'],'remainingArgs':_0x5c4dde[_0x242f26(0xc4)]});}if(!_0x47f784)return undefined;const _0x47559b={..._0xbe445a};return applyAppBinding(_0x47f784[_0x242f26(0x99)],_0x47f784[_0x242f26(0x71)],_0x47559b),{'definition':buildDynamicCommandDefinition(_0x47f784[_0x242f26(0x99)],_0x47f784[_0x242f26(0x71)]),'args':_0x47f784['remainingArgs'],'flags':_0x47559b,'tree':_0x47f784[_0x242f26(0x99)],'command':_0x47f784['command']};}export function generateDynamicServiceHelp(_0x474f71){const _0x57c658=a32_0x4f5b,_0x520a9b=listLocalServiceTrees()[_0x57c658(0xbe)](_0x3816d5=>_0x3816d5[_0x57c658(0x80)][_0x57c658(0x93)]===_0x474f71);if(!_0x520a9b)return undefined;const _0x3b6e34=[CLI_BIN_NAME+'\x20'+_0x474f71+'\x20<command>\x20[flags]','',_0x520a9b[_0x57c658(0x80)][_0x57c658(0xb8)]||_0x474f71,_0x520a9b['service'][_0x57c658(0x96)]?'\x20\x20'+_0x520a9b['service'][_0x57c658(0x96)]:'','',_0x57c658(0x82),..._0x520a9b[_0x57c658(0x8e)][_0x57c658(0xa1)](_0x348106=>{const _0x220f76=_0x57c658,_0x3537af=_0x348106[_0x220f76(0x78)][_0x220f76(0xb5)](0x1)['join']('\x20'),_0x18cac4=_0x348106[_0x220f76(0x7f)]==='read'?'':'\x20['+_0x348106[_0x220f76(0x7f)]+']';return'\x20\x20'+_0x3537af['padEnd'](0x18)+'\x20'+(_0x348106[_0x220f76(0x96)]||'')+_0x18cac4;}),'',_0x57c658(0x9a)+CLI_BIN_NAME+_0x57c658(0x9c)+_0x474f71+_0x57c658(0x8a)][_0x57c658(0x86)](Boolean);return _0x3b6e34[_0x57c658(0x72)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0xedb8cf=>{const _0x1b8fd1=a32_0x4f5b,_0x51cc9f=_0xedb8cf[_0x1b8fd1(0x8f)];return{'service':_0x51cc9f['service'][_0x1b8fd1(0x93)],'label':_0x51cc9f['service'][_0x1b8fd1(0xb8)]||_0x51cc9f[_0x1b8fd1(0x80)]['code'],'commands':_0x51cc9f[_0x1b8fd1(0x8e)][_0x1b8fd1(0xa1)](_0x24af34=>({'command':dynamicCommandName(_0x24af34),'description':_0x24af34[_0x1b8fd1(0x96)]||_0x1b8fd1(0xa0)+_0x24af34[_0x1b8fd1(0xd0)],'tag':riskTag(_0x24af34[_0x1b8fd1(0x7f)])}))};});}export function getDynamicServiceEntry(_0x20e72c){const _0xe8df4a=a32_0x4f5b;return listDynamicServiceEntries()['find'](_0x559dfc=>_0x559dfc[_0xe8df4a(0x80)]===_0x20e72c);}export function listDynamicServiceDefinitions(_0x811ad1){const _0x53d695=a32_0x4f5b;return listLocalServiceTrees()[_0x53d695(0x86)](_0x313fb6=>!_0x811ad1||_0x313fb6[_0x53d695(0x80)]['code']===_0x811ad1)[_0x53d695(0x7e)](_0x4a2574=>_0x4a2574['commands'][_0x53d695(0xa1)](_0x170afa=>buildDynamicCommandDefinition(_0x4a2574,_0x170afa)));}function a32_0x27d7(){const _0x3bb7d3=['\x20service\x20detail\x20--service\x20','type','864LjJtiJ','\x20\x20\x20\x20command:\x20','Run\x20service\x20command\x20','map','SERVICE_TREE','\x20\x20\x20\x20','sql','1025730IrmgoB','512XttMDf','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','now','scriptName','2343565VHJDJW','18mJXouT','\x20requires\x20target.sqlCode.','string','required','36gQYYRE','employeeId','operator','4DMUadS','Unsupported\x20service\x20target\x20kind:\x20','bffCode','slice','\x20\x20[','json','name','target','fromEntries','bffId','args','const','find','datasetCode','cliName','1750330eNXtGR','bff','enum','remainingArgs','appBindings','datatable','startsWith','env','sqlCode','read','envName','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20\x20\x20\x20kind:\x20\x20\x20\x20','Preview\x20dynamic\x20service\x20command:\x20','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','cliPath','appcode','Service\x20command\x20','\x20\x20\x20\x20datasetCode:\x20','userName','validation','command','join','tableName','\x20\x20\x20\x20sqlCode:\x20','app','nickName','kind','fullPath','\x20\x20\x20\x20scriptName:\x20','6NXXeuf','params','entries','appCode','flatMap','risk','service','\x20\x20\x20\x20datatable:\x20','Commands:','boolean','\x20requires\x20target.scriptName.','push','filter','rawFlags','nickname','mapTo','`\x20to\x20inspect\x20the\x20manifest.','tenantCode','\x22\x20in\x20service\x20command\x20','data','commands','normalizedManifest','Unknown\x20appRef\x20\x22','number','length','code','7720031VGvyVo','source','description','2280520CJTVrx','1368003OmTVjD','tree','Use\x20`','appRef'];a32_0x27d7=function(){return _0x3bb7d3;};return a32_0x27d7();}export function getDynamicServiceDefinitions(_0x5e603e){const _0x139e06=a32_0x4f5b,_0x2d8675=listDynamicServiceDefinitions(_0x5e603e);return _0x2d8675[_0x139e06(0x92)]>0x0?_0x2d8675:undefined;}export function findDynamicServiceDefinition(_0xa983e9,_0x282111){const _0x512fd0=a32_0x4f5b;return listDynamicServiceDefinitions(_0xa983e9)['find'](_0x100820=>_0x100820[_0x512fd0(0x71)]===_0x282111);}export function buildDynamicCommandDefinition(_0x56297c,_0x5e1250){const _0x669a24=a32_0x4f5b;return{'service':_0x56297c[_0x669a24(0x80)]['code'],'command':dynamicCommandName(_0x5e1250),'description':_0x5e1250[_0x669a24(0x96)]||_0x669a24(0xa0)+_0x5e1250[_0x669a24(0xd0)],'risk':_0x5e1250[_0x669a24(0x7f)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x5e1250[_0x669a24(0xbc)][_0x669a24(0xa1)](_0x306ddd=>({'name':_0x306ddd[_0x669a24(0xb8)],'description':_0x306ddd[_0x669a24(0x96)]||_0x306ddd['name'],'required':_0x306ddd[_0x669a24(0xae)]})),'flags':_0x5e1250['flags']['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x5e1250),async 'dryRun'(_0x2d94d6){const _0x526dcb=_0x669a24,_0x5c9f31=await compilePlan(_0x5e1250,_0x2d94d6);return{'method':_0x526dcb(0xa2),'url':_0x5e1250[_0x526dcb(0xd0)],'body':{'target':targetPreview(_0x5c9f31),'params':_0x5c9f31['params']},'description':_0x526dcb(0xce)+_0x5e1250[_0x526dcb(0xd0)]};},async 'execute'(_0xd72996){const _0x1aa40c=_0x669a24,_0x64280a=await compilePlan(_0x5e1250,_0xd72996),_0x2b49f1=Date[_0x1aa40c(0xa8)](),_0x5d0145=await executePlan(_0x64280a,_0x5e1250,_0xd72996),_0x2777a2=Date[_0x1aa40c(0xa8)]()-_0x2b49f1;return{'ok':!![],'data':{'service':_0x56297c[_0x1aa40c(0x80)],'command':_0x5e1250[_0x1aa40c(0xd0)],'target':targetPreview(_0x64280a),'result':_0x5d0145,'elapsed':_0x2777a2},'message':_0x1aa40c(0xd2)+_0x5e1250['cliPath']+'\x20completed\x20in\x20'+_0x2777a2+'ms'};}};}function dynamicCommandName(_0xf82648){const _0x503e2f=a32_0x4f5b;return _0xf82648['fullPath'][_0x503e2f(0xb5)](0x1)['join']('\x20');}function riskTag(_0x4bc3e9){const _0xc086ec=a32_0x4f5b;return _0x4bc3e9===_0xc086ec(0xca)?'':_0xc086ec(0xb6)+_0x4bc3e9+']';}function flagToCommandFlag(_0x46150b){const _0x566133=a32_0x4f5b;return{'name':_0x46150b[_0x566133(0xc0)],'type':_0x46150b[_0x566133(0x9d)]===_0x566133(0xb7)?_0x566133(0xad):_0x46150b[_0x566133(0x9d)],'description':_0x46150b['description']||_0x46150b[_0x566133(0xb8)],'required':_0x46150b['required'],'default':isPrimitiveFlagDefault(_0x46150b['default'])?_0x46150b['default']:undefined,'enum':_0x46150b[_0x566133(0xc3)]};}async function compilePlan(_0x245b61,_0x41ef5c){const _0x5cfdef=a32_0x4f5b;return compileServiceTreeCommand(_0x245b61,{'flags':_0x41ef5c[_0x5cfdef(0x87)],'args':_0x41ef5c[_0x5cfdef(0xbc)],'context':await buildServiceContext(_0x245b61,_0x41ef5c)});}async function buildServiceContext(_0x5712ae,_0x49e428){const _0x3cabbf=a32_0x4f5b,_0x1d2658={'appCode':_0x49e428[_0x3cabbf(0x7d)],'env':_0x49e428['envName'],'envName':_0x49e428[_0x3cabbf(0xcb)]};if(!usesRuntimeContext(_0x5712ae))return _0x1d2658;const _0x3806e9=await getLoginUserInfo(),_0x523a50=pickFirst(_0x3806e9['userId'],_0x3806e9['id']);return{..._0x1d2658,'user':_0x3806e9,'userId':_0x523a50,'id':_0x3806e9['id'],'username':pickFirst(_0x3806e9['username'],_0x3806e9[_0x3cabbf(0x6f)],_0x3806e9['loginName']),'userName':_0x3806e9[_0x3cabbf(0x6f)],'nickname':pickFirst(_0x3806e9[_0x3cabbf(0x88)],_0x3806e9[_0x3cabbf(0x76)]),'nickName':_0x3806e9[_0x3cabbf(0x76)],'tenantCode':_0x3806e9[_0x3cabbf(0x8b)],'employeeId':_0x3806e9[_0x3cabbf(0xb0)]};}function usesRuntimeContext(_0x3d2ec9){const _0x48c995=a32_0x4f5b;return _0x3d2ec9[_0x48c995(0x89)]['some'](_0x3c82b3=>typeof _0x3c82b3[_0x48c995(0x95)]===_0x48c995(0xad)&&(_0x3c82b3[_0x48c995(0x95)][_0x48c995(0xc7)]('context.')||_0x3c82b3[_0x48c995(0x95)]['startsWith']('ctx.')));}function pickFirst(..._0x27d7f4){const _0x2a7fbf=a32_0x4f5b;return _0x27d7f4[_0x2a7fbf(0xbe)](_0x15ed22=>_0x15ed22!==undefined&&_0x15ed22!==null);}async function executePlan(_0xf25b74,_0x387e1a,_0x400e75){const _0x586a84=a32_0x4f5b;if(_0xf25b74['kind']===_0x586a84(0x8d)){const _0x2768ea=await resolveDatasetCode(_0xf25b74,_0x387e1a,_0x400e75);return executeData(_0x2768ea,_0xf25b74['command'],_0xf25b74['params']);}if(_0xf25b74['kind']===_0x586a84(0xa4)){if(!_0xf25b74[_0x586a84(0xc9)])throw CliErrors[_0x586a84(0x70)]('Service\x20command\x20'+_0x387e1a['cliPath']+_0x586a84(0xac));return executeSdkSql(_0xf25b74[_0x586a84(0xc9)],normalizeScalarParams(_0xf25b74[_0x586a84(0x7b)]));}if(_0xf25b74[_0x586a84(0x77)]===_0x586a84(0xc2)){const _0x1ff236=_0xf25b74['scriptName']||_0xf25b74['bffCode']||(_0xf25b74[_0x586a84(0xbb)]==null?'':String(_0xf25b74[_0x586a84(0xbb)]));if(!_0x1ff236)throw CliErrors[_0x586a84(0x70)]('Service\x20command\x20'+_0x387e1a[_0x586a84(0xd0)]+_0x586a84(0x84));return executeSdkBff(_0x1ff236,_0xf25b74[_0x586a84(0x7b)]);}throw CliErrors['validation'](_0x586a84(0xb3)+_0xf25b74[_0x586a84(0x77)]);}async function resolveDatasetCode(_0x18b022,_0x4fcb82,_0x3927c7){const _0x4eebe2=a32_0x4f5b;if(_0x18b022[_0x4eebe2(0xbf)])return _0x18b022[_0x4eebe2(0xbf)];if(!_0x18b022['datatable'])throw CliErrors[_0x4eebe2(0x70)]('Service\x20command\x20'+_0x4fcb82[_0x4eebe2(0xd0)]+_0x4eebe2(0xcf));const _0x3d58ef=await listDatasets(_0x3927c7[_0x4eebe2(0x7d)]),_0x229140=_0x3d58ef[_0x4eebe2(0xbe)](_0x19c4c9=>_0x19c4c9['dbtableConfig']?.[_0x4eebe2(0x73)]===_0x18b022['datatable']);if(!_0x229140?.[_0x4eebe2(0x93)])throw CliErrors['validation']('Cannot\x20resolve\x20datatable\x20\x22'+_0x18b022['datatable']+_0x4eebe2(0xa7)+_0x3927c7[_0x4eebe2(0x7d)]+'.',_0x4eebe2(0xcc));return _0x229140[_0x4eebe2(0x93)];}function applyAppBinding(_0x2792a6,_0x25f935,_0x1570f6){const _0x40ed88=a32_0x4f5b,_0x380717=_0x25f935['target'][_0x40ed88(0x9b)];if(!_0x380717)return;const _0x5cfa3c=_0x2792a6[_0x40ed88(0xc5)][_0x380717];if(!_0x5cfa3c)throw CliErrors['validation'](_0x40ed88(0x90)+_0x380717+_0x40ed88(0x8c)+_0x25f935[_0x40ed88(0xd0)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x105d63=_0x5cfa3c[_0x40ed88(0xd1)]||_0x5cfa3c[_0x40ed88(0x7d)];_0x105d63&&!hasText(_0x1570f6[_0x40ed88(0xd1)])&&(_0x1570f6[_0x40ed88(0xd1)]=_0x105d63),_0x5cfa3c[_0x40ed88(0x75)]&&!hasText(_0x1570f6[_0x40ed88(0x75)])&&!hasText(_0x1570f6['appcode'])&&(_0x1570f6['app']=_0x5cfa3c[_0x40ed88(0x75)]),_0x5cfa3c[_0x40ed88(0xc8)]&&!hasText(_0x1570f6['env'])&&(_0x1570f6[_0x40ed88(0xc8)]=_0x5cfa3c[_0x40ed88(0xc8)]);}function renderDynamicCommandHelp(_0x281f57){const _0x48bccb=a32_0x4f5b,_0x3864f3=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x48bccb(0xcd)+_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0x77)],_0x48bccb(0x9f)+_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0x71)]];if(_0x281f57['target'][_0x48bccb(0xbf)])_0x3864f3[_0x48bccb(0x85)](_0x48bccb(0x6e)+_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0xbf)]);if(_0x281f57[_0x48bccb(0xb9)]['datatable'])_0x3864f3['push'](_0x48bccb(0x81)+_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0xc6)]);if(_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0xc9)])_0x3864f3['push'](_0x48bccb(0x74)+_0x281f57[_0x48bccb(0xb9)]['sqlCode']);if(_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0xa9)])_0x3864f3['push'](_0x48bccb(0x79)+_0x281f57[_0x48bccb(0xb9)][_0x48bccb(0xa9)]);if(_0x281f57['mapTo'][_0x48bccb(0x92)]>0x0){_0x3864f3['push']('','\x20\x20MAP\x20TO');for(const _0x670cce of _0x281f57[_0x48bccb(0x89)]){_0x3864f3[_0x48bccb(0x85)](_0x48bccb(0xa3)+(_0x670cce['source']||_0x48bccb(0xbd))+'\x20->\x20'+_0x670cce['target']+(_0x670cce[_0x48bccb(0xb1)]?'.'+_0x670cce['operator']:''));}}return _0x3864f3[_0x48bccb(0x72)]('\x0a');}function targetPreview(_0x4d36c7){const _0x242d32=a32_0x4f5b;return{'kind':_0x4d36c7[_0x242d32(0x77)],'command':_0x4d36c7[_0x242d32(0x71)],'appRef':_0x4d36c7[_0x242d32(0x9b)],'datasetCode':_0x4d36c7[_0x242d32(0xbf)],'datatable':_0x4d36c7[_0x242d32(0xc6)],'sqlCode':_0x4d36c7[_0x242d32(0xc9)],'bffCode':_0x4d36c7[_0x242d32(0xb4)],'bffId':_0x4d36c7[_0x242d32(0xbb)],'scriptName':_0x4d36c7[_0x242d32(0xa9)]};}function normalizeScalarParams(_0x4391ec){const _0x1cb4dc=a32_0x4f5b;return Object[_0x1cb4dc(0xba)](Object[_0x1cb4dc(0x7c)](_0x4391ec)[_0x1cb4dc(0x86)](([,_0x544141])=>typeof _0x544141===_0x1cb4dc(0xad)||typeof _0x544141===_0x1cb4dc(0x91)));}function hasText(_0x141672){const _0xaa1c4f=a32_0x4f5b;return typeof _0x141672===_0xaa1c4f(0xad)&&_0x141672['trim']()[_0xaa1c4f(0x92)]>0x0;}function isPrimitiveFlagDefault(_0x5702bd){const _0x4096b8=a32_0x4f5b;return _0x5702bd===undefined||typeof _0x5702bd==='string'||typeof _0x5702bd===_0x4096b8(0x91)||typeof _0x5702bd===_0x4096b8(0x83);}
|
|
1
|
+
(function(_0x5b83fd,_0xe7ff0){const _0x1f65c7=a32_0x2e03,_0x26d689=_0x5b83fd();while(!![]){try{const _0x3f8d2f=parseInt(_0x1f65c7(0x16d))/0x1+-parseInt(_0x1f65c7(0x192))/0x2+-parseInt(_0x1f65c7(0x15a))/0x3+parseInt(_0x1f65c7(0x156))/0x4+-parseInt(_0x1f65c7(0x140))/0x5+-parseInt(_0x1f65c7(0x13f))/0x6+parseInt(_0x1f65c7(0x13d))/0x7;if(_0x3f8d2f===_0xe7ff0)break;else _0x26d689['push'](_0x26d689['shift']());}catch(_0x5ccd32){_0x26d689['push'](_0x26d689['shift']());}}}(a32_0xd853,0x938f1));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0xd26dd9,_0x1eaa4c){const _0x12ef76=a32_0x2e03,_0x1e6fd7=listLocalServiceTrees();let _0x2a9812;for(const _0x50db17 of _0x1e6fd7){const _0x361ca4=matchServiceTreeCommand(_0x50db17,_0xd26dd9);if(!_0x361ca4)continue;(!_0x2a9812||_0x361ca4[_0x12ef76(0x18f)][_0x12ef76(0x14b)][_0x12ef76(0x19a)]>_0x2a9812[_0x12ef76(0x18f)][_0x12ef76(0x14b)][_0x12ef76(0x19a)])&&(_0x2a9812={'tree':_0x50db17,'command':_0x361ca4[_0x12ef76(0x18f)],'remainingArgs':_0x361ca4['remainingArgs']});}if(!_0x2a9812)return undefined;const _0x2c1671={..._0x1eaa4c};return applyAppBinding(_0x2a9812['tree'],_0x2a9812[_0x12ef76(0x18f)],_0x2c1671),{'definition':buildDynamicCommandDefinition(_0x2a9812[_0x12ef76(0x18a)],_0x2a9812[_0x12ef76(0x18f)]),'args':_0x2a9812[_0x12ef76(0x13a)],'flags':_0x2c1671,'tree':_0x2a9812[_0x12ef76(0x18a)],'command':_0x2a9812['command']};}export function generateDynamicServiceHelp(_0x38a88a){const _0x1a3b83=a32_0x2e03,_0x225bb9=listLocalServiceTrees()[_0x1a3b83(0x172)](_0x531c64=>_0x531c64[_0x1a3b83(0x191)][_0x1a3b83(0x17c)]===_0x38a88a);if(!_0x225bb9)return undefined;const _0x24d240=[CLI_BIN_NAME+'\x20'+_0x38a88a+_0x1a3b83(0x164),'',_0x225bb9['service'][_0x1a3b83(0x195)]||_0x38a88a,_0x225bb9[_0x1a3b83(0x191)][_0x1a3b83(0x168)]?'\x20\x20'+_0x225bb9[_0x1a3b83(0x191)][_0x1a3b83(0x168)]:'','','Commands:',..._0x225bb9[_0x1a3b83(0x173)]['map'](_0x5d68b2=>{const _0x49210e=_0x1a3b83,_0x1422dd=_0x5d68b2['fullPath'][_0x49210e(0x189)](0x1)['join']('\x20'),_0x59b424=_0x5d68b2[_0x49210e(0x15f)]===_0x49210e(0x15b)?'':'\x20['+_0x5d68b2[_0x49210e(0x15f)]+']';return'\x20\x20'+_0x1422dd[_0x49210e(0x149)](0x18)+'\x20'+(_0x5d68b2[_0x49210e(0x168)]||'')+_0x59b424;}),'',_0x1a3b83(0x16e)+CLI_BIN_NAME+_0x1a3b83(0x16f)+_0x38a88a+_0x1a3b83(0x176)]['filter'](Boolean);return _0x24d240[_0x1a3b83(0x19d)]('\x0a');}export function listDynamicServiceEntries(){const _0x167ee8=a32_0x2e03;return listLocalServices()[_0x167ee8(0x170)](_0x5ad8bc=>{const _0x4d1489=_0x167ee8,_0xcbb417=_0x5ad8bc[_0x4d1489(0x15e)];return{'service':_0xcbb417[_0x4d1489(0x191)]['code'],'label':_0xcbb417[_0x4d1489(0x191)][_0x4d1489(0x195)]||_0xcbb417[_0x4d1489(0x191)][_0x4d1489(0x17c)],'commands':_0xcbb417[_0x4d1489(0x173)][_0x4d1489(0x170)](_0x5bf743=>({'command':dynamicCommandName(_0x5bf743),'description':_0x5bf743[_0x4d1489(0x168)]||'Run\x20service\x20command\x20'+_0x5bf743['cliPath'],'tag':riskTag(_0x5bf743['risk'])}))};});}export function getDynamicServiceEntry(_0x3fa2f){const _0x5abf91=a32_0x2e03;return listDynamicServiceEntries()[_0x5abf91(0x172)](_0x30f1f9=>_0x30f1f9['service']===_0x3fa2f);}export function listDynamicServiceDefinitions(_0x52494c){const _0x414de0=a32_0x2e03;return listLocalServiceTrees()[_0x414de0(0x139)](_0x3cfa90=>!_0x52494c||_0x3cfa90[_0x414de0(0x191)][_0x414de0(0x17c)]===_0x52494c)[_0x414de0(0x177)](_0x28e099=>_0x28e099[_0x414de0(0x173)]['map'](_0x1ad358=>buildDynamicCommandDefinition(_0x28e099,_0x1ad358)));}export function getDynamicServiceDefinitions(_0x4fd266){const _0x329a58=listDynamicServiceDefinitions(_0x4fd266);return _0x329a58['length']>0x0?_0x329a58:undefined;}export function findDynamicServiceDefinition(_0x2999cf,_0x54859e){const _0x596820=a32_0x2e03;return listDynamicServiceDefinitions(_0x2999cf)[_0x596820(0x172)](_0x5ea1cb=>_0x5ea1cb[_0x596820(0x18f)]===_0x54859e);}export function buildDynamicCommandDefinition(_0x213eac,_0x436be3){const _0x1f3cfd=a32_0x2e03;return{'service':_0x213eac[_0x1f3cfd(0x191)]['code'],'command':dynamicCommandName(_0x436be3),'description':_0x436be3[_0x1f3cfd(0x168)]||_0x1f3cfd(0x198)+_0x436be3[_0x1f3cfd(0x141)],'risk':_0x436be3[_0x1f3cfd(0x15f)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x436be3['args'][_0x1f3cfd(0x170)](_0xd23d94=>({'name':_0xd23d94[_0x1f3cfd(0x195)],'description':_0xd23d94[_0x1f3cfd(0x168)]||_0xd23d94[_0x1f3cfd(0x195)],'required':_0xd23d94[_0x1f3cfd(0x153)]})),'flags':_0x436be3['flags'][_0x1f3cfd(0x170)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x436be3),async 'dryRun'(_0x3a4de1){const _0x23a675=_0x1f3cfd,_0x14b09f=await compilePlan(_0x436be3,_0x3a4de1);return{'method':_0x23a675(0x162),'url':_0x436be3[_0x23a675(0x141)],'body':{'target':targetPreview(_0x14b09f),'params':_0x14b09f[_0x23a675(0x174)]},'description':_0x23a675(0x13c)+_0x436be3[_0x23a675(0x141)]};},async 'execute'(_0x4dffeb){const _0x419c70=_0x1f3cfd,_0x3f5fa4=await compilePlan(_0x436be3,_0x4dffeb),_0x39f1ee=Date[_0x419c70(0x151)](),_0x34993c=await executePlan(_0x3f5fa4,_0x436be3,_0x4dffeb),_0x242e9e=Date[_0x419c70(0x151)]()-_0x39f1ee;return{'ok':!![],'data':{'service':_0x213eac['service'],'command':_0x436be3[_0x419c70(0x141)],'target':targetPreview(_0x3f5fa4),'result':_0x34993c,'elapsed':_0x242e9e},'message':'Service\x20command\x20'+_0x436be3[_0x419c70(0x141)]+_0x419c70(0x179)+_0x242e9e+'ms'};}};}function dynamicCommandName(_0x3f00e7){const _0x3efd13=a32_0x2e03;return _0x3f00e7[_0x3efd13(0x14b)][_0x3efd13(0x189)](0x1)['join']('\x20');}function riskTag(_0x56490f){const _0x13eb33=a32_0x2e03;return _0x56490f==='read'?'':_0x13eb33(0x158)+_0x56490f+']';}function flagToCommandFlag(_0x28a0e9){const _0x21fb32=a32_0x2e03;return{'name':_0x28a0e9[_0x21fb32(0x154)],'type':_0x28a0e9[_0x21fb32(0x142)]===_0x21fb32(0x17a)?_0x21fb32(0x152):_0x28a0e9[_0x21fb32(0x142)],'description':_0x28a0e9[_0x21fb32(0x168)]||_0x28a0e9[_0x21fb32(0x195)],'required':_0x28a0e9['required'],'default':isPrimitiveFlagDefault(_0x28a0e9['default'])?_0x28a0e9[_0x21fb32(0x18e)]:undefined,'enum':_0x28a0e9[_0x21fb32(0x146)]};}function a32_0x2e03(_0x3a473c,_0x582085){_0x3a473c=_0x3a473c-0x139;const _0xd85325=a32_0xd853();let _0x2e03d4=_0xd85325[_0x3a473c];return _0x2e03d4;}async function compilePlan(_0x18695d,_0x478cca){const _0x365b98=a32_0x2e03;return compileServiceTreeCommand(_0x18695d,{'flags':_0x478cca[_0x365b98(0x165)],'args':_0x478cca[_0x365b98(0x145)],'context':await buildServiceContext(_0x18695d,_0x478cca)});}async function buildServiceContext(_0x43bc41,_0x5902e7){const _0x21ee08=a32_0x2e03,_0x5223f1={'appCode':_0x5902e7[_0x21ee08(0x163)],'env':_0x5902e7['envName'],'envName':_0x5902e7[_0x21ee08(0x18c)]};if(!usesRuntimeContext(_0x43bc41))return _0x5223f1;const _0x1e5690=await getLoginUserInfo(),_0x5b3f00=pickFirst(_0x1e5690[_0x21ee08(0x196)],_0x1e5690['id']);return{..._0x5223f1,'user':_0x1e5690,'userId':_0x5b3f00,'id':_0x1e5690['id'],'username':pickFirst(_0x1e5690[_0x21ee08(0x155)],_0x1e5690[_0x21ee08(0x147)],_0x1e5690[_0x21ee08(0x15d)]),'userName':_0x1e5690[_0x21ee08(0x147)],'nickname':pickFirst(_0x1e5690[_0x21ee08(0x144)],_0x1e5690[_0x21ee08(0x14f)]),'nickName':_0x1e5690[_0x21ee08(0x14f)],'tenantCode':_0x1e5690['tenantCode'],'employeeId':_0x1e5690[_0x21ee08(0x184)]};}function usesRuntimeContext(_0x4cc629){const _0x17e642=a32_0x2e03;return _0x4cc629[_0x17e642(0x14a)][_0x17e642(0x171)](_0x1032d8=>typeof _0x1032d8[_0x17e642(0x14e)]==='string'&&(_0x1032d8[_0x17e642(0x14e)][_0x17e642(0x183)](_0x17e642(0x17b))||_0x1032d8[_0x17e642(0x14e)]['startsWith'](_0x17e642(0x17f))));}function a32_0xd853(){const _0x4805ab=['dbtableConfig','\x20completed\x20in\x20','json','context.','code','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','ctx.','operator','scriptName','appBindings','startsWith','employeeId','\x20\x20\x20\x20command:\x20','appRef','boolean','Unsupported\x20service\x20target\x20kind:\x20','slice','tree','number','envName','\x20\x20MAP\x20TO','default','command','bffCode','service','2046730MgZdNy','bff','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','name','userId','appcode','Run\x20service\x20command\x20','datasetCode','length','kind','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','join','filter','remainingArgs','\x20\x20\x20\x20datatable:\x20','Preview\x20dynamic\x20service\x20command:\x20','7118027bPauJe','tableName','4177998ODKBXi','59175PjRfXP','cliPath','type','Cannot\x20resolve\x20datatable\x20\x22','nickname','args','enum','userName','sql','padEnd','mapTo','fullPath','\x20requires\x20target.scriptName.','datatable','source','nickName','Unknown\x20appRef\x20\x22','now','string','required','cliName','username','4566668kRbEGY','\x20\x20\x20\x20','\x20\x20[','bffId','1366455Idrnxj','read','Service\x20command\x20','loginName','normalizedManifest','risk','sqlCode','\x20->\x20','SERVICE_TREE','appCode','\x20<command>\x20[flags]','rawFlags','trim','push','description','target','const','\x20\x20\x20\x20kind:\x20\x20\x20\x20','env','632891WHeSso','Use\x20`','\x20service\x20detail\x20--service\x20','map','some','find','commands','params','validation','`\x20to\x20inspect\x20the\x20manifest.','flatMap'];a32_0xd853=function(){return _0x4805ab;};return a32_0xd853();}function pickFirst(..._0x28b9ea){const _0x5ba794=a32_0x2e03;return _0x28b9ea[_0x5ba794(0x172)](_0xdd3fef=>_0xdd3fef!==undefined&&_0xdd3fef!==null);}async function executePlan(_0x2b3818,_0x1b9e40,_0x5d9634){const _0x41fb39=a32_0x2e03;if(_0x2b3818['kind']==='data'){const _0x246afc=await resolveDatasetCode(_0x2b3818,_0x1b9e40,_0x5d9634);return executeData(_0x246afc,_0x2b3818[_0x41fb39(0x18f)],_0x2b3818['params']);}if(_0x2b3818[_0x41fb39(0x19b)]===_0x41fb39(0x148)){if(!_0x2b3818['sqlCode'])throw CliErrors[_0x41fb39(0x175)](_0x41fb39(0x15c)+_0x1b9e40['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x2b3818[_0x41fb39(0x160)],normalizeScalarParams(_0x2b3818[_0x41fb39(0x174)]));}if(_0x2b3818[_0x41fb39(0x19b)]===_0x41fb39(0x193)){const _0x2d2025=_0x2b3818[_0x41fb39(0x181)]||_0x2b3818[_0x41fb39(0x190)]||(_0x2b3818[_0x41fb39(0x159)]==null?'':String(_0x2b3818['bffId']));if(!_0x2d2025)throw CliErrors[_0x41fb39(0x175)]('Service\x20command\x20'+_0x1b9e40[_0x41fb39(0x141)]+_0x41fb39(0x14c));return executeSdkBff(_0x2d2025,_0x2b3818['params']);}throw CliErrors['validation'](_0x41fb39(0x188)+_0x2b3818[_0x41fb39(0x19b)]);}async function resolveDatasetCode(_0x383568,_0x34f7e5,_0x4ef74f){const _0x484866=a32_0x2e03;if(_0x383568[_0x484866(0x199)])return _0x383568[_0x484866(0x199)];if(!_0x383568[_0x484866(0x14d)])throw CliErrors[_0x484866(0x175)]('Service\x20command\x20'+_0x34f7e5[_0x484866(0x141)]+_0x484866(0x17d));const _0x2b6887=await listDatasets(_0x4ef74f['appCode']),_0x1c2821=_0x2b6887[_0x484866(0x172)](_0x280fa8=>_0x280fa8[_0x484866(0x178)]?.[_0x484866(0x13e)]===_0x383568[_0x484866(0x14d)]);if(!_0x1c2821?.[_0x484866(0x17c)])throw CliErrors[_0x484866(0x175)](_0x484866(0x143)+_0x383568[_0x484866(0x14d)]+_0x484866(0x19c)+_0x4ef74f[_0x484866(0x163)]+'.',_0x484866(0x194));return _0x1c2821[_0x484866(0x17c)];}function applyAppBinding(_0x248aa1,_0x213ccb,_0x2f0836){const _0x21fc49=a32_0x2e03,_0x3e5e2d=_0x213ccb[_0x21fc49(0x169)]['appRef'];if(!_0x3e5e2d)return;const _0x28eb0e=_0x248aa1[_0x21fc49(0x182)][_0x3e5e2d];if(!_0x28eb0e)throw CliErrors[_0x21fc49(0x175)](_0x21fc49(0x150)+_0x3e5e2d+'\x22\x20in\x20service\x20command\x20'+_0x213ccb['cliPath']+'.',_0x21fc49(0x17e));const _0x49c76f=_0x28eb0e[_0x21fc49(0x197)]||_0x28eb0e[_0x21fc49(0x163)];_0x49c76f&&!hasText(_0x2f0836[_0x21fc49(0x197)])&&(_0x2f0836['appcode']=_0x49c76f),_0x28eb0e['app']&&!hasText(_0x2f0836['app'])&&!hasText(_0x2f0836[_0x21fc49(0x197)])&&(_0x2f0836['app']=_0x28eb0e['app']),_0x28eb0e['env']&&!hasText(_0x2f0836[_0x21fc49(0x16c)])&&(_0x2f0836['env']=_0x28eb0e[_0x21fc49(0x16c)]);}function renderDynamicCommandHelp(_0x61f114){const _0xdd6c62=a32_0x2e03,_0x3316f9=['\x20\x20SERVICE\x20TREE\x20TARGET',_0xdd6c62(0x16b)+_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x19b)],_0xdd6c62(0x185)+_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x18f)]];if(_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x199)])_0x3316f9['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x61f114[_0xdd6c62(0x169)]['datasetCode']);if(_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x14d)])_0x3316f9[_0xdd6c62(0x167)](_0xdd6c62(0x13b)+_0x61f114['target'][_0xdd6c62(0x14d)]);if(_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x160)])_0x3316f9['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x160)]);if(_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x181)])_0x3316f9[_0xdd6c62(0x167)]('\x20\x20\x20\x20scriptName:\x20'+_0x61f114[_0xdd6c62(0x169)][_0xdd6c62(0x181)]);if(_0x61f114[_0xdd6c62(0x14a)][_0xdd6c62(0x19a)]>0x0){_0x3316f9[_0xdd6c62(0x167)]('',_0xdd6c62(0x18d));for(const _0x42a0a8 of _0x61f114['mapTo']){_0x3316f9[_0xdd6c62(0x167)](_0xdd6c62(0x157)+(_0x42a0a8[_0xdd6c62(0x14e)]||_0xdd6c62(0x16a))+_0xdd6c62(0x161)+_0x42a0a8[_0xdd6c62(0x169)]+(_0x42a0a8['operator']?'.'+_0x42a0a8[_0xdd6c62(0x180)]:''));}}return _0x3316f9[_0xdd6c62(0x19d)]('\x0a');}function targetPreview(_0x7bbcf7){const _0x47ba03=a32_0x2e03;return{'kind':_0x7bbcf7[_0x47ba03(0x19b)],'command':_0x7bbcf7[_0x47ba03(0x18f)],'appRef':_0x7bbcf7[_0x47ba03(0x186)],'datasetCode':_0x7bbcf7[_0x47ba03(0x199)],'datatable':_0x7bbcf7[_0x47ba03(0x14d)],'sqlCode':_0x7bbcf7[_0x47ba03(0x160)],'bffCode':_0x7bbcf7[_0x47ba03(0x190)],'bffId':_0x7bbcf7[_0x47ba03(0x159)],'scriptName':_0x7bbcf7[_0x47ba03(0x181)]};}function normalizeScalarParams(_0x52180d){const _0x18975a=a32_0x2e03;return Object['fromEntries'](Object['entries'](_0x52180d)['filter'](([,_0x4a04bf])=>typeof _0x4a04bf===_0x18975a(0x152)||typeof _0x4a04bf==='number'));}function hasText(_0x482d54){const _0x403f18=a32_0x2e03;return typeof _0x482d54==='string'&&_0x482d54[_0x403f18(0x166)]()[_0x403f18(0x19a)]>0x0;}function isPrimitiveFlagDefault(_0x46cc37){const _0x415135=a32_0x2e03;return _0x46cc37===undefined||typeof _0x46cc37==='string'||typeof _0x46cc37===_0x415135(0x18b)||typeof _0x46cc37===_0x415135(0x187);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x394f7c=a33_0x330a;(function(_0x119564,_0x1a5f2d){const _0x29547e=a33_0x330a,_0xe40073=_0x119564();while(!![]){try{const _0xe68e3c=-parseInt(_0x29547e(0xd1))/0x1+parseInt(_0x29547e(0xb5))/0x2+-parseInt(_0x29547e(0xeb))/0x3*(-parseInt(_0x29547e(0xe4))/0x4)+parseInt(_0x29547e(0xe0))/0x5*(parseInt(_0x29547e(0xbb))/0x6)+-parseInt(_0x29547e(0xb7))/0x7+-parseInt(_0x29547e(0xf7))/0x8*(parseInt(_0x29547e(0xc7))/0x9)+-parseInt(_0x29547e(0xf3))/0xa*(-parseInt(_0x29547e(0xc8))/0xb);if(_0xe68e3c===_0x1a5f2d)break;else _0xe40073['push'](_0xe40073['shift']());}catch(_0x2e8d88){_0xe40073['push'](_0xe40073['shift']());}}}(a33_0x2e66,0x240ba));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a33_0x394f7c(0xbc),'type':a33_0x394f7c(0xd2),'required':!![],'description':a33_0x394f7c(0xfc)},SERVICE_FLAG={'name':a33_0x394f7c(0xd4),'type':'string','required':!![],'description':a33_0x394f7c(0xc0),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a33_0x394f7c(0xcb)}};function summarizeService(_0x4ec33d){const _0x5343c7=a33_0x394f7c;return{'serviceCode':_0x4ec33d[_0x5343c7(0xf0)],'name':_0x4ec33d[_0x5343c7(0xdb)][_0x5343c7(0xd4)][_0x5343c7(0xcd)],'version':_0x4ec33d[_0x5343c7(0xda)],'importedAt':_0x4ec33d[_0x5343c7(0xb8)],'source':_0x4ec33d[_0x5343c7(0xd8)],'commandCount':_0x4ec33d['normalizedManifest'][_0x5343c7(0xdc)][_0x5343c7(0xb4)],'commands':_0x4ec33d[_0x5343c7(0xdb)][_0x5343c7(0xdc)][_0x5343c7(0xc6)](_0x4419e3=>({'path':_0x4419e3[_0x5343c7(0xc3)],'description':_0x4419e3[_0x5343c7(0xe5)],'risk':_0x4419e3[_0x5343c7(0xc4)],'target':_0x4419e3[_0x5343c7(0xbd)],'flags':_0x4419e3[_0x5343c7(0xe3)]['map'](_0x2de466=>({'name':_0x2de466[_0x5343c7(0xcd)],'cliName':_0x2de466[_0x5343c7(0xb9)],'type':_0x2de466[_0x5343c7(0xfb)],'required':_0x2de466[_0x5343c7(0xd9)]===!![]}))}))};}function summarizeLoadedManifest(_0x7ebc71){const _0x2df32b=a33_0x394f7c;return{'service':_0x7ebc71['normalizedManifest']?.[_0x2df32b(0xd4)],'version':_0x7ebc71[_0x2df32b(0xdb)]?.['version'],'commandCount':_0x7ebc71[_0x2df32b(0xdb)]?.['commands'][_0x2df32b(0xb4)]??0x0,'commands':_0x7ebc71[_0x2df32b(0xdb)]?.[_0x2df32b(0xdc)][_0x2df32b(0xc6)](_0x1ee0a4=>({'path':_0x1ee0a4[_0x2df32b(0xc3)],'risk':_0x1ee0a4['risk'],'target':_0x1ee0a4[_0x2df32b(0xbd)]}))??[],'registryIndex':_0x7ebc71[_0x2df32b(0xca)],'registryServiceCode':_0x7ebc71[_0x2df32b(0xd7)],'errors':_0x7ebc71[_0x2df32b(0xf4)][_0x2df32b(0xcc)],'warnings':_0x7ebc71[_0x2df32b(0xf4)][_0x2df32b(0xd6)]};}function a33_0x330a(_0x2a0ef7,_0x49d89b){_0x2a0ef7=_0x2a0ef7-0xb3;const _0x2e6609=a33_0x2e66();let _0x330a81=_0x2e6609[_0x2a0ef7];return _0x330a81;}function a33_0x2e66(){const _0x220480=['list','type','Service\x20Tree\x20manifest\x20file\x20path','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','export','filePath','detail','length','387444nNLFcG','hash','1438318qJSFww','importedAt','cliName','\x20service(s),\x20updated\x20','66kphZBE','file','target','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Local\x20service\x20code,\x20for\x20example\x20crm','validate','registryPath','cliPath','risk','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','map','2602539OsVvon','11POnFSz','manifests','registryIndex','lower\x20kebab-case\x20service\x20code','errors','name','Service\x20manifest\x20validation\x20passed.','serviceCount','\x20service(s).','158433eYDxBq','string','write','service','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','warnings','registryServiceCode','source','required','version','normalizedManifest','commands','kind','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','Service\x20registry\x20validation\x20passed.','3295Wizzoo','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','read','flags','732VjYnhW','description','entry','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','updated','WRITE','Imported','420JkhYxe','entries','str','Imported\x20','replaced','serviceCode','Removed\x20service\x20','Local\x20service\x20not\x20found:\x20','5741290lWBIeV','report','Exported\x20service\x20','import','8PMOPTt','imported','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry'];a33_0x2e66=function(){return _0x220480;};return a33_0x2e66();}export const serviceDefinitions=[{'service':'service','command':a33_0x394f7c(0xc1),'description':a33_0x394f7c(0xc5),'risk':a33_0x394f7c(0xe2),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x35715c){const _0x2f63d6=a33_0x394f7c,_0xa6804f=loadServiceManifestFromFile(_0x35715c['str'](_0x2f63d6(0xbc)));if(!_0xa6804f[_0x2f63d6(0xf4)]['ok'])return{'ok':![],'data':{'file':_0xa6804f[_0x2f63d6(0xff)],'hash':_0xa6804f[_0x2f63d6(0xb6)],'kind':_0xa6804f[_0x2f63d6(0xdd)],'serviceCount':_0xa6804f[_0x2f63d6(0xc9)][_0x2f63d6(0xb4)],'services':_0xa6804f['manifests'][_0x2f63d6(0xc6)](summarizeLoadedManifest),'errors':_0xa6804f['report']['errors'],'warnings':_0xa6804f[_0x2f63d6(0xf4)][_0x2f63d6(0xd6)]},'message':formatValidationFailure(_0xa6804f[_0x2f63d6(0xf4)])};if(_0xa6804f[_0x2f63d6(0xdd)]==='registry'||_0xa6804f[_0x2f63d6(0xc9)][_0x2f63d6(0xb4)]!==0x1)return{'ok':!![],'data':{'file':_0xa6804f[_0x2f63d6(0xff)],'hash':_0xa6804f[_0x2f63d6(0xb6)],'kind':_0xa6804f['kind'],'serviceCount':_0xa6804f[_0x2f63d6(0xc9)]['length'],'commandCount':_0xa6804f['manifests']['reduce']((_0x37246c,_0x443cd3)=>_0x37246c+(_0x443cd3['normalizedManifest']?.[_0x2f63d6(0xdc)][_0x2f63d6(0xb4)]??0x0),0x0),'services':_0xa6804f[_0x2f63d6(0xc9)][_0x2f63d6(0xc6)](summarizeLoadedManifest),'warnings':_0xa6804f[_0x2f63d6(0xf4)][_0x2f63d6(0xd6)]},'message':_0x2f63d6(0xdf)};return{'ok':!![],'data':{'file':_0xa6804f[_0x2f63d6(0xff)],'hash':_0xa6804f[_0x2f63d6(0xb6)],'kind':_0xa6804f['kind'],'service':_0xa6804f['normalizedManifest']?.[_0x2f63d6(0xd4)],'version':_0xa6804f[_0x2f63d6(0xdb)]?.[_0x2f63d6(0xda)],'commandCount':_0xa6804f['normalizedManifest']?.[_0x2f63d6(0xdc)][_0x2f63d6(0xb4)]??0x0,'commands':_0xa6804f[_0x2f63d6(0xdb)]?.[_0x2f63d6(0xdc)]['map'](_0x8e620c=>({'path':_0x8e620c['cliPath'],'risk':_0x8e620c[_0x2f63d6(0xc4)],'target':_0x8e620c[_0x2f63d6(0xbd)]})),'warnings':_0xa6804f['report'][_0x2f63d6(0xd6)]},'message':_0x2f63d6(0xce)};}},{'service':a33_0x394f7c(0xd4),'command':a33_0x394f7c(0xf6),'description':a33_0x394f7c(0xf9),'risk':a33_0x394f7c(0xd3),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x41a6a9){const _0xfb5b8b=a33_0x394f7c,_0x2b30c5=loadServiceManifestFromFile(_0x41a6a9[_0xfb5b8b(0xed)](_0xfb5b8b(0xbc)));return{'method':_0xfb5b8b(0xe9),'url':getServiceRegistryPath(),'body':{'file':_0x2b30c5[_0xfb5b8b(0xff)],'hash':_0x2b30c5[_0xfb5b8b(0xb6)],'kind':_0x2b30c5[_0xfb5b8b(0xdd)],'ok':_0x2b30c5[_0xfb5b8b(0xf4)]['ok'],'service':_0x2b30c5[_0xfb5b8b(0xdb)]?.['service'],'version':_0x2b30c5['normalizedManifest']?.[_0xfb5b8b(0xda)],'serviceCount':_0x2b30c5['manifests'][_0xfb5b8b(0xb4)],'services':_0x2b30c5[_0xfb5b8b(0xc9)][_0xfb5b8b(0xc6)](_0x1bab0c=>({'service':_0x1bab0c[_0xfb5b8b(0xdb)]?.[_0xfb5b8b(0xd4)],'version':_0x1bab0c[_0xfb5b8b(0xdb)]?.[_0xfb5b8b(0xda)],'commandCount':_0x1bab0c[_0xfb5b8b(0xdb)]?.[_0xfb5b8b(0xdc)][_0xfb5b8b(0xb4)]??0x0,'errors':_0x1bab0c[_0xfb5b8b(0xf4)][_0xfb5b8b(0xcc)]})),'errors':_0x2b30c5[_0xfb5b8b(0xf4)][_0xfb5b8b(0xcc)],'commandCount':_0x2b30c5[_0xfb5b8b(0xdb)]?.[_0xfb5b8b(0xdc)][_0xfb5b8b(0xb4)]??0x0},'description':_0xfb5b8b(0xd5)};},async 'execute'(_0x3220a4){const _0x5afaa4=a33_0x394f7c,_0x19fc26=importServiceManifest(_0x3220a4[_0x5afaa4(0xed)](_0x5afaa4(0xbc)));if(_0x19fc26[_0x5afaa4(0xec)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x19fc26[_0x5afaa4(0xc2)],'imported':_0x19fc26[_0x5afaa4(0xf8)],'updated':_0x19fc26[_0x5afaa4(0xe8)],'serviceCount':_0x19fc26[_0x5afaa4(0xcf)],'services':_0x19fc26['entries'][_0x5afaa4(0xc6)](summarizeService)},'message':_0x5afaa4(0xee)+_0x19fc26[_0x5afaa4(0xf8)]+_0x5afaa4(0xba)+_0x19fc26[_0x5afaa4(0xe8)]+_0x5afaa4(0xd0)};return{'ok':!![],'data':{'registryPath':_0x19fc26['registryPath'],'replaced':_0x19fc26[_0x5afaa4(0xef)],'imported':_0x19fc26[_0x5afaa4(0xf8)],'updated':_0x19fc26[_0x5afaa4(0xe8)],'serviceCount':_0x19fc26[_0x5afaa4(0xcf)],'service':summarizeService(_0x19fc26['entry'])},'message':(_0x19fc26[_0x5afaa4(0xef)]?'Updated':_0x5afaa4(0xea))+'\x20service\x20'+_0x19fc26[_0x5afaa4(0xe6)][_0x5afaa4(0xf0)]+'.'};}},{'service':a33_0x394f7c(0xd4),'command':a33_0x394f7c(0xfe),'description':a33_0x394f7c(0xfd),'risk':a33_0x394f7c(0xd3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x643462){const _0x431731=a33_0x394f7c,_0x421a29=getLocalServiceEntry(_0x643462['str'](_0x431731(0xd4)));return{'method':_0x431731(0xe9),'url':_0x643462['str'](_0x431731(0xbc)),'body':{'service':_0x643462[_0x431731(0xed)](_0x431731(0xd4)),'found':Boolean(_0x421a29),'version':_0x421a29?.[_0x431731(0xda)],'source':_0x421a29?.[_0x431731(0xd8)]},'description':_0x431731(0xbf)};},async 'execute'(_0x42f60d){const _0x13669b=a33_0x394f7c,_0x19f85d=exportServiceManifest(_0x42f60d['str'](_0x13669b(0xd4)),_0x42f60d['str'](_0x13669b(0xbc)));return{'ok':!![],'data':{'registryPath':_0x19f85d[_0x13669b(0xc2)],'file':_0x19f85d[_0x13669b(0xff)],'service':summarizeService(_0x19f85d[_0x13669b(0xe6)])},'message':_0x13669b(0xf5)+_0x19f85d['entry']['serviceCode']+'.'};}},{'service':a33_0x394f7c(0xd4),'command':a33_0x394f7c(0xfa),'description':a33_0x394f7c(0xe7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x171e2b=a33_0x394f7c,_0x42159b=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x42159b['length'],'services':_0x42159b[_0x171e2b(0xc6)](summarizeService)}};}},{'service':a33_0x394f7c(0xd4),'command':'remove','description':a33_0x394f7c(0xde),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x31506e){const _0x211b68=a33_0x394f7c,_0x4a9ded=getLocalServiceEntry(_0x31506e[_0x211b68(0xed)](_0x211b68(0xd4)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x31506e[_0x211b68(0xed)]('service'),'found':Boolean(_0x4a9ded),'version':_0x4a9ded?.[_0x211b68(0xda)],'source':_0x4a9ded?.['source']},'description':_0x211b68(0xbe)};},async 'execute'(_0x4de8eb){const _0x9fe794=a33_0x394f7c,_0x92296f=removeServiceManifest(_0x4de8eb['str'](_0x9fe794(0xd4)));return{'ok':!![],'data':{'registryPath':_0x92296f[_0x9fe794(0xc2)],'serviceCount':_0x92296f[_0x9fe794(0xcf)],'service':summarizeService(_0x92296f['entry'])},'message':_0x9fe794(0xf1)+_0x92296f[_0x9fe794(0xe6)][_0x9fe794(0xf0)]+'.'};}},{'service':a33_0x394f7c(0xd4),'command':a33_0x394f7c(0xb3),'description':a33_0x394f7c(0xe1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x277547){const _0x2aec62=a33_0x394f7c,_0x51fccd=getLocalServiceEntry(_0x277547[_0x2aec62(0xed)](_0x2aec62(0xd4)));if(!_0x51fccd)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x277547[_0x2aec62(0xed)]('service')},'message':_0x2aec62(0xf2)+_0x277547[_0x2aec62(0xed)](_0x2aec62(0xd4))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x51fccd),'manifest':_0x51fccd['manifest'],'normalizedManifest':_0x51fccd[_0x2aec62(0xdb)]}};}}];
|
|
1
|
+
const a33_0xc25cd2=a33_0x4e37;(function(_0x521956,_0x23b4a4){const _0x5ed0ed=a33_0x4e37,_0x54858e=_0x521956();while(!![]){try{const _0x1b90bd=parseInt(_0x5ed0ed(0xda))/0x1*(parseInt(_0x5ed0ed(0xfa))/0x2)+-parseInt(_0x5ed0ed(0x109))/0x3*(parseInt(_0x5ed0ed(0x115))/0x4)+parseInt(_0x5ed0ed(0x10a))/0x5+parseInt(_0x5ed0ed(0xf7))/0x6*(parseInt(_0x5ed0ed(0x113))/0x7)+parseInt(_0x5ed0ed(0xf1))/0x8*(parseInt(_0x5ed0ed(0xff))/0x9)+parseInt(_0x5ed0ed(0xfb))/0xa+-parseInt(_0x5ed0ed(0x117))/0xb;if(_0x1b90bd===_0x23b4a4)break;else _0x54858e['push'](_0x54858e['shift']());}catch(_0x3d7f63){_0x54858e['push'](_0x54858e['shift']());}}}(a33_0x5c9d,0xb7095));function a33_0x5c9d(){const _0x2e58ba=['description','kind','1hSDvtn','\x20service(s).','imported','report','serviceCode','cliPath','type','str','validate','risk','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registryPath','reduce','string','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Local\x20service\x20not\x20found:\x20','\x20service(s),\x20updated\x20','manifest','flags','detail','registryServiceCode','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Service\x20manifest\x20validation\x20passed.','9032ciCTfs','errors','hash','Imported\x20','WRITE','warnings','123834NjboMj','updated','Service\x20registry\x20validation\x20passed.','2742524xAXTYW','8904850irmRey','\x20service\x20','importedAt','normalizedManifest','9099OBNTCu','export','lower\x20kebab-case\x20service\x20code','remove','registryIndex','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','target','Exported\x20service\x20','length','version','42375llJPrU','2925295abGhHy','entry','name','entries','serviceCount','cliName','manifests','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','filePath','112PqToOI','service','232fvcxhN','Updated','30244302nxuYHe','write','Removed\x20service\x20','file','map','registry','commands','replaced','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'];a33_0x5c9d=function(){return _0x2e58ba;};return a33_0x5c9d();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a33_0xc25cd2(0x11a),'type':a33_0xc25cd2(0xe7),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a33_0xc25cd2(0x114),'type':a33_0xc25cd2(0xe7),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a33_0xc25cd2(0x101)}};function summarizeService(_0x34ab6d){const _0x756fb8=a33_0xc25cd2;return{'serviceCode':_0x34ab6d[_0x756fb8(0xde)],'name':_0x34ab6d[_0x756fb8(0xfe)][_0x756fb8(0x114)][_0x756fb8(0x10c)],'version':_0x34ab6d[_0x756fb8(0x108)],'importedAt':_0x34ab6d[_0x756fb8(0xfd)],'source':_0x34ab6d[_0x756fb8(0xd6)],'commandCount':_0x34ab6d[_0x756fb8(0xfe)][_0x756fb8(0xd2)][_0x756fb8(0x107)],'commands':_0x34ab6d[_0x756fb8(0xfe)][_0x756fb8(0xd2)][_0x756fb8(0xd0)](_0xe9d4fc=>({'path':_0xe9d4fc[_0x756fb8(0xdf)],'description':_0xe9d4fc[_0x756fb8(0xd8)],'risk':_0xe9d4fc[_0x756fb8(0xe3)],'target':_0xe9d4fc[_0x756fb8(0x105)],'flags':_0xe9d4fc[_0x756fb8(0xec)][_0x756fb8(0xd0)](_0x35c4be=>({'name':_0x35c4be[_0x756fb8(0x10c)],'cliName':_0x35c4be[_0x756fb8(0x10f)],'type':_0x35c4be[_0x756fb8(0xe0)],'required':_0x35c4be['required']===!![]}))}))};}function a33_0x4e37(_0x19a811,_0x413128){_0x19a811=_0x19a811-0xd0;const _0x5c9d45=a33_0x5c9d();let _0x4e37d6=_0x5c9d45[_0x19a811];return _0x4e37d6;}function summarizeLoadedManifest(_0x4a21a7){const _0x291b6b=a33_0xc25cd2;return{'service':_0x4a21a7[_0x291b6b(0xfe)]?.[_0x291b6b(0x114)],'version':_0x4a21a7[_0x291b6b(0xfe)]?.[_0x291b6b(0x108)],'commandCount':_0x4a21a7['normalizedManifest']?.['commands'][_0x291b6b(0x107)]??0x0,'commands':_0x4a21a7[_0x291b6b(0xfe)]?.['commands'][_0x291b6b(0xd0)](_0x51bd94=>({'path':_0x51bd94[_0x291b6b(0xdf)],'risk':_0x51bd94[_0x291b6b(0xe3)],'target':_0x51bd94[_0x291b6b(0x105)]}))??[],'registryIndex':_0x4a21a7[_0x291b6b(0x103)],'registryServiceCode':_0x4a21a7[_0x291b6b(0xee)],'errors':_0x4a21a7['report']['errors'],'warnings':_0x4a21a7['report'][_0x291b6b(0xf6)]};}export const serviceDefinitions=[{'service':a33_0xc25cd2(0x114),'command':a33_0xc25cd2(0xe2),'description':a33_0xc25cd2(0xef),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x1b1906){const _0x3e8b9b=a33_0xc25cd2,_0xfdb441=loadServiceManifestFromFile(_0x1b1906[_0x3e8b9b(0xe1)](_0x3e8b9b(0x11a)));if(!_0xfdb441['report']['ok'])return{'ok':![],'data':{'file':_0xfdb441['filePath'],'hash':_0xfdb441[_0x3e8b9b(0xf3)],'kind':_0xfdb441['kind'],'serviceCount':_0xfdb441[_0x3e8b9b(0x110)]['length'],'services':_0xfdb441['manifests']['map'](summarizeLoadedManifest),'errors':_0xfdb441[_0x3e8b9b(0xdd)][_0x3e8b9b(0xf2)],'warnings':_0xfdb441[_0x3e8b9b(0xdd)][_0x3e8b9b(0xf6)]},'message':formatValidationFailure(_0xfdb441[_0x3e8b9b(0xdd)])};if(_0xfdb441[_0x3e8b9b(0xd9)]===_0x3e8b9b(0xd1)||_0xfdb441['manifests'][_0x3e8b9b(0x107)]!==0x1)return{'ok':!![],'data':{'file':_0xfdb441[_0x3e8b9b(0x112)],'hash':_0xfdb441['hash'],'kind':_0xfdb441[_0x3e8b9b(0xd9)],'serviceCount':_0xfdb441[_0x3e8b9b(0x110)]['length'],'commandCount':_0xfdb441[_0x3e8b9b(0x110)][_0x3e8b9b(0xe6)]((_0x38cd54,_0x5dcde7)=>_0x38cd54+(_0x5dcde7['normalizedManifest']?.[_0x3e8b9b(0xd2)][_0x3e8b9b(0x107)]??0x0),0x0),'services':_0xfdb441['manifests'][_0x3e8b9b(0xd0)](summarizeLoadedManifest),'warnings':_0xfdb441[_0x3e8b9b(0xdd)][_0x3e8b9b(0xf6)]},'message':_0x3e8b9b(0xf9)};return{'ok':!![],'data':{'file':_0xfdb441[_0x3e8b9b(0x112)],'hash':_0xfdb441[_0x3e8b9b(0xf3)],'kind':_0xfdb441[_0x3e8b9b(0xd9)],'service':_0xfdb441[_0x3e8b9b(0xfe)]?.[_0x3e8b9b(0x114)],'version':_0xfdb441[_0x3e8b9b(0xfe)]?.[_0x3e8b9b(0x108)],'commandCount':_0xfdb441[_0x3e8b9b(0xfe)]?.[_0x3e8b9b(0xd2)][_0x3e8b9b(0x107)]??0x0,'commands':_0xfdb441[_0x3e8b9b(0xfe)]?.[_0x3e8b9b(0xd2)][_0x3e8b9b(0xd0)](_0x51902b=>({'path':_0x51902b[_0x3e8b9b(0xdf)],'risk':_0x51902b['risk'],'target':_0x51902b[_0x3e8b9b(0x105)]})),'warnings':_0xfdb441[_0x3e8b9b(0xdd)][_0x3e8b9b(0xf6)]},'message':_0x3e8b9b(0xf0)};}},{'service':a33_0xc25cd2(0x114),'command':'import','description':a33_0xc25cd2(0xe8),'risk':a33_0xc25cd2(0x118),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3bf1a8){const _0x809d75=a33_0xc25cd2,_0x27eee2=loadServiceManifestFromFile(_0x3bf1a8[_0x809d75(0xe1)](_0x809d75(0x11a)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x27eee2[_0x809d75(0x112)],'hash':_0x27eee2[_0x809d75(0xf3)],'kind':_0x27eee2['kind'],'ok':_0x27eee2[_0x809d75(0xdd)]['ok'],'service':_0x27eee2['normalizedManifest']?.[_0x809d75(0x114)],'version':_0x27eee2[_0x809d75(0xfe)]?.['version'],'serviceCount':_0x27eee2[_0x809d75(0x110)]['length'],'services':_0x27eee2['manifests'][_0x809d75(0xd0)](_0x5c0144=>({'service':_0x5c0144[_0x809d75(0xfe)]?.[_0x809d75(0x114)],'version':_0x5c0144[_0x809d75(0xfe)]?.[_0x809d75(0x108)],'commandCount':_0x5c0144[_0x809d75(0xfe)]?.[_0x809d75(0xd2)][_0x809d75(0x107)]??0x0,'errors':_0x5c0144[_0x809d75(0xdd)][_0x809d75(0xf2)]})),'errors':_0x27eee2[_0x809d75(0xdd)][_0x809d75(0xf2)],'commandCount':_0x27eee2[_0x809d75(0xfe)]?.[_0x809d75(0xd2)]['length']??0x0},'description':_0x809d75(0x104)};},async 'execute'(_0x54a23b){const _0x3a8f16=a33_0xc25cd2,_0x3068da=importServiceManifest(_0x54a23b[_0x3a8f16(0xe1)](_0x3a8f16(0x11a)));if(_0x3068da[_0x3a8f16(0x10d)][_0x3a8f16(0x107)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x3068da[_0x3a8f16(0xe5)],'imported':_0x3068da[_0x3a8f16(0xdc)],'updated':_0x3068da[_0x3a8f16(0xf8)],'serviceCount':_0x3068da[_0x3a8f16(0x10e)],'services':_0x3068da[_0x3a8f16(0x10d)][_0x3a8f16(0xd0)](summarizeService)},'message':_0x3a8f16(0xf4)+_0x3068da[_0x3a8f16(0xdc)]+_0x3a8f16(0xea)+_0x3068da[_0x3a8f16(0xf8)]+_0x3a8f16(0xdb)};return{'ok':!![],'data':{'registryPath':_0x3068da['registryPath'],'replaced':_0x3068da[_0x3a8f16(0xd3)],'imported':_0x3068da['imported'],'updated':_0x3068da['updated'],'serviceCount':_0x3068da[_0x3a8f16(0x10e)],'service':summarizeService(_0x3068da['entry'])},'message':(_0x3068da[_0x3a8f16(0xd3)]?_0x3a8f16(0x116):'Imported')+_0x3a8f16(0xfc)+_0x3068da['entry'][_0x3a8f16(0xde)]+'.'};}},{'service':'service','command':a33_0xc25cd2(0x100),'description':a33_0xc25cd2(0x111),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x787927){const _0xb30f10=a33_0xc25cd2,_0x45ae60=getLocalServiceEntry(_0x787927[_0xb30f10(0xe1)](_0xb30f10(0x114)));return{'method':_0xb30f10(0xf5),'url':_0x787927[_0xb30f10(0xe1)]('file'),'body':{'service':_0x787927[_0xb30f10(0xe1)](_0xb30f10(0x114)),'found':Boolean(_0x45ae60),'version':_0x45ae60?.['version'],'source':_0x45ae60?.['source']},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x22bcc3){const _0x378017=a33_0xc25cd2,_0x997cad=exportServiceManifest(_0x22bcc3['str'](_0x378017(0x114)),_0x22bcc3['str']('file'));return{'ok':!![],'data':{'registryPath':_0x997cad[_0x378017(0xe5)],'file':_0x997cad[_0x378017(0x112)],'service':summarizeService(_0x997cad[_0x378017(0x10b)])},'message':_0x378017(0x106)+_0x997cad[_0x378017(0x10b)][_0x378017(0xde)]+'.'};}},{'service':'service','command':'list','description':a33_0xc25cd2(0xe4),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x21a670=a33_0xc25cd2,_0xbe8ebe=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xbe8ebe[_0x21a670(0x107)],'services':_0xbe8ebe['map'](summarizeService)}};}},{'service':a33_0xc25cd2(0x114),'command':a33_0xc25cd2(0x102),'description':a33_0xc25cd2(0xd5),'risk':a33_0xc25cd2(0x118),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4e1ea3){const _0x2dafab=a33_0xc25cd2,_0x5026af=getLocalServiceEntry(_0x4e1ea3[_0x2dafab(0xe1)]('service'));return{'method':_0x2dafab(0xf5),'url':getServiceRegistryPath(),'body':{'service':_0x4e1ea3[_0x2dafab(0xe1)](_0x2dafab(0x114)),'found':Boolean(_0x5026af),'version':_0x5026af?.[_0x2dafab(0x108)],'source':_0x5026af?.['source']},'description':_0x2dafab(0xd7)};},async 'execute'(_0x7cf1d5){const _0x269fe6=a33_0xc25cd2,_0xf22faa=removeServiceManifest(_0x7cf1d5[_0x269fe6(0xe1)]('service'));return{'ok':!![],'data':{'registryPath':_0xf22faa[_0x269fe6(0xe5)],'serviceCount':_0xf22faa[_0x269fe6(0x10e)],'service':summarizeService(_0xf22faa[_0x269fe6(0x10b)])},'message':_0x269fe6(0x119)+_0xf22faa[_0x269fe6(0x10b)][_0x269fe6(0xde)]+'.'};}},{'service':a33_0xc25cd2(0x114),'command':a33_0xc25cd2(0xed),'description':a33_0xc25cd2(0xd4),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x3ef7c3){const _0x51abbd=a33_0xc25cd2,_0x208714=getLocalServiceEntry(_0x3ef7c3[_0x51abbd(0xe1)]('service'));if(!_0x208714)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x3ef7c3['str'](_0x51abbd(0x114))},'message':_0x51abbd(0xe9)+_0x3ef7c3[_0x51abbd(0xe1)](_0x51abbd(0x114))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x208714),'manifest':_0x208714[_0x51abbd(0xeb)],'normalizedManifest':_0x208714[_0x51abbd(0xfe)]}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a34_0x34dc96=a34_0x28bb;(function(_0x4bebf6,_0x1a2bfa){const _0x560db0=a34_0x28bb,_0x1116f9=_0x4bebf6();while(!![]){try{const _0x48c1d3=parseInt(_0x560db0(0x201))/0x1*(parseInt(_0x560db0(0x1ed))/0x2)+parseInt(_0x560db0(0x1d9))/0x3*(-parseInt(_0x560db0(0x209))/0x4)+parseInt(_0x560db0(0x1e3))/0x5+parseInt(_0x560db0(0x1f3))/0x6+parseInt(_0x560db0(0x1d2))/0x7*(-parseInt(_0x560db0(0x1c9))/0x8)+-parseInt(_0x560db0(0x21b))/0x9+parseInt(_0x560db0(0x1f2))/0xa;if(_0x48c1d3===_0x1a2bfa)break;else _0x1116f9['push'](_0x1116f9['shift']());}catch(_0x149a75){_0x1116f9['push'](_0x1116f9['shift']());}}}(a34_0x3ab0,0x28927));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a34_0x34dc96(0x1e4);export function getServiceRegistryPath(_0x400d98={}){const _0x2c54c8=a34_0x34dc96;return resolve(_0x400d98[_0x2c54c8(0x1d4)]??homedir(),PRODUCT_CONFIG[_0x2c54c8(0x212)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x1b4b3a={}){const _0x510526=a34_0x34dc96,_0x52489b=getServiceRegistryPath(_0x1b4b3a);if(!existsSync(_0x52489b))return emptyServiceRegistry();try{const _0x378512=readFileSync(_0x52489b,'utf8');if(!_0x378512[_0x510526(0x20e)]())return emptyServiceRegistry();const _0x2aa3b0=JSON[_0x510526(0x1fd)](_0x378512);if(_0x2aa3b0['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation']('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x2aa3b0[_0x510526(0x1fb)]),_0x510526(0x1f7)+_0x52489b+'.');if(!Array[_0x510526(0x215)](_0x2aa3b0[_0x510526(0x1d1)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2aa3b0[_0x510526(0x1fc)],'services':_0x2aa3b0[_0x510526(0x1d1)]};}catch(_0x261c2d){if(_0x261c2d instanceof Error&&_0x261c2d['name']==='CliError')throw _0x261c2d;throw CliErrors[_0x510526(0x21a)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x52489b,_0x510526(0x1f0));}}function a34_0x28bb(_0x2c2fc0,_0x483962){_0x2c2fc0=_0x2c2fc0-0x1c9;const _0x3ab0aa=a34_0x3ab0();let _0x28bb6f=_0x3ab0aa[_0x2c2fc0];return _0x28bb6f;}export function writeServiceRegistry(_0x2bce44,_0x17b724={}){const _0xdb052c=a34_0x34dc96,_0x4ad54b=getServiceRegistryPath(_0x17b724),_0x2599da=dirname(_0x4ad54b);!existsSync(_0x2599da)&&mkdirSync(_0x2599da,{'recursive':!![]});const _0x21ea1f=_0x4ad54b+_0xdb052c(0x1f4);try{writeFileSync(_0x21ea1f,JSON[_0xdb052c(0x205)](_0x2bce44,null,0x2)+'\x0a',{'encoding':_0xdb052c(0x1fe),'mode':0x180}),renameSync(_0x21ea1f,_0x4ad54b);}catch(_0x4f9573){try{unlinkSync(_0x21ea1f);}catch{}if(_0x4f9573?.['code']===_0xdb052c(0x219))throw CliErrors[_0xdb052c(0x21a)](_0xdb052c(0x1f5)+_0x4ad54b);throw _0x4f9573;}return _0x4ad54b;}export function loadServiceManifestFromFile(_0x5dfe49){const _0x3c4e1a=a34_0x34dc96,_0x5d1d67=resolve(_0x5dfe49);if(!existsSync(_0x5d1d67))throw CliErrors[_0x3c4e1a(0x21a)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x5dfe49);let _0x332274;const _0x481168=readFileSync(_0x5d1d67,_0x3c4e1a(0x1fe));try{_0x332274=JSON[_0x3c4e1a(0x1fd)](_0x481168);}catch{throw CliErrors[_0x3c4e1a(0x21a)](_0x3c4e1a(0x218)+_0x5dfe49,_0x3c4e1a(0x1e5));}const _0x139c3b=sha256(_0x481168),_0x2bba2f=extractLoadedServiceManifests(_0x332274,_0x139c3b),_0x2b228c=aggregateValidationReports(_0x2bba2f),_0x31fd58=_0x2bba2f[0x0];return{'filePath':_0x5d1d67,'hash':_0x139c3b,'kind':isServiceRegistryLike(_0x332274)?_0x3c4e1a(0x207):_0x3c4e1a(0x1dd),'manifest':_0x31fd58?.['manifest']??_0x332274,'report':_0x2b228c,'normalizedManifest':_0x2bba2f[_0x3c4e1a(0x1cd)]===0x1?_0x31fd58?.[_0x3c4e1a(0x1f1)]:undefined,'manifests':_0x2bba2f};}function a34_0x3ab0(){const _0x1e24a0=['ENOENT','validation','2082816ritutG','203960bwaaqw','hex','reduce','].manifest.','length','services\x20must\x20be\x20an\x20array','report','object','services','77MnsaUW','risk','homeDir','$.services[','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','service','join','7035zRnswZ','push','errors','importedAt','manifest','empty','update','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','source','commandCount','1110135KKRVqr','service.json','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','localeCompare','now','splice','registryIndex','serviceCode','code','missing','4dKaDlb','].manifest','toISOString','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','normalizedManifest','2532130CegLQC','880986oaEUFf','.tmp','Cannot\x20write\x20service\x20registry:\x20','startsWith','Remove\x20or\x20migrate\x20','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','file','find','schemaVersion','updatedAt','parse','utf8','target','flatMap','160483xdtjdM','command','invalid','Local\x20service\x20not\x20found:\x20','stringify','Service\x20manifest\x20validation\x20failed:\x0a','registry','Unsupported\x20schemaVersion:\x20','452cxJiwV','findIndex','path','version','warnings','trim','message','filePath','map','homeDirName','string','description','isArray','name','slice','Invalid\x20service\x20manifest\x20JSON:\x20'];a34_0x3ab0=function(){return _0x1e24a0;};return a34_0x3ab0();}export function importServiceManifest(_0x227d4c,_0x51866f={}){const _0x1c991b=a34_0x34dc96,_0x5d572f=loadServiceManifestFromFile(_0x227d4c);if(!_0x5d572f[_0x1c991b(0x1cf)]['ok'])throw CliErrors[_0x1c991b(0x21a)](formatValidationFailure(_0x5d572f[_0x1c991b(0x1cf)]),_0x1c991b(0x1f8));if(_0x5d572f['manifests'][_0x1c991b(0x1cd)]===0x0)throw CliErrors[_0x1c991b(0x21a)](_0x1c991b(0x1d6),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x5ea26f=readServiceRegistry(_0x51866f),_0x2859af=(_0x51866f[_0x1c991b(0x1e7)]??(()=>new Date()))()[_0x1c991b(0x1ef)](),_0x5e5bb1=[];let _0x12cc76=0x0,_0x413158=0x0;for(const _0x15cc89 of _0x5d572f['manifests']){if(!_0x15cc89[_0x1c991b(0x1f1)])continue;const _0x5bcd10=_0x15cc89[_0x1c991b(0x1f1)][_0x1c991b(0x1d7)][_0x1c991b(0x1eb)],_0x3d1645={'serviceCode':_0x5bcd10,'version':_0x15cc89[_0x1c991b(0x1f1)][_0x1c991b(0x20c)],'importedAt':_0x2859af,'source':{'type':_0x1c991b(0x1f9),'path':_0x5d572f[_0x1c991b(0x210)],'hash':_0x15cc89['sourceHash']},'manifest':_0x15cc89[_0x1c991b(0x1dd)],'normalizedManifest':_0x15cc89['normalizedManifest']},_0x138a86=_0x5ea26f[_0x1c991b(0x1d1)]['findIndex'](_0x19bfc4=>_0x19bfc4[_0x1c991b(0x1ea)]===_0x5bcd10);_0x138a86>=0x0?(_0x5ea26f[_0x1c991b(0x1d1)][_0x138a86]=_0x3d1645,_0x413158++):(_0x5ea26f[_0x1c991b(0x1d1)][_0x1c991b(0x1da)](_0x3d1645),_0x12cc76++),_0x5e5bb1[_0x1c991b(0x1da)](_0x3d1645);}_0x5ea26f['services']['sort']((_0x1add6f,_0xc0700e)=>_0x1add6f[_0x1c991b(0x1ea)][_0x1c991b(0x1e6)](_0xc0700e[_0x1c991b(0x1ea)])),_0x5ea26f['updatedAt']=_0x2859af;const _0x13c267=writeServiceRegistry(_0x5ea26f,_0x51866f);return{'registryPath':_0x13c267,'entry':_0x5e5bb1[0x0],'replaced':_0x5e5bb1['length']===0x1?_0x413158===0x1:_0x413158>0x0,'entries':_0x5e5bb1,'imported':_0x12cc76,'updated':_0x413158,'serviceCount':_0x5ea26f['services'][_0x1c991b(0x1cd)]};}export function exportServiceManifest(_0x208eec,_0x4e8245,_0x21814c={}){const _0x53cbb7=a34_0x34dc96,_0x16f50b=getServiceRegistryPath(_0x21814c),_0x36d6b0=getLocalServiceEntry(_0x208eec,_0x21814c);if(!_0x36d6b0)throw CliErrors[_0x53cbb7(0x21a)]('Local\x20service\x20not\x20found:\x20'+_0x208eec,_0x53cbb7(0x1e0));const _0x49e856=resolve(_0x4e8245),_0x31ef93=dirname(_0x49e856);return!existsSync(_0x31ef93)&&mkdirSync(_0x31ef93,{'recursive':!![]}),writeFileSync(_0x49e856,JSON[_0x53cbb7(0x205)](_0x36d6b0['manifest'],null,0x2)+'\x0a',{'encoding':_0x53cbb7(0x1fe),'mode':0x180}),{'registryPath':_0x16f50b,'filePath':_0x49e856,'entry':_0x36d6b0};}export function removeServiceManifest(_0x43d48f,_0x810227={}){const _0x43ef08=a34_0x34dc96,_0x1cea46=readServiceRegistry(_0x810227),_0x43d360=_0x43d48f[_0x43ef08(0x20e)](),_0x3a417d=_0x1cea46[_0x43ef08(0x1d1)][_0x43ef08(0x20a)](_0x1a42f0=>_0x1a42f0['serviceCode']===_0x43d360);if(_0x3a417d<0x0)throw CliErrors[_0x43ef08(0x21a)](_0x43ef08(0x204)+_0x43d360,_0x43ef08(0x1e0));const [_0xb0aede]=_0x1cea46[_0x43ef08(0x1d1)][_0x43ef08(0x1e8)](_0x3a417d,0x1),_0x26b893=(_0x810227['now']??(()=>new Date()))()[_0x43ef08(0x1ef)]();_0x1cea46['updatedAt']=_0x26b893;const _0x1b5f3f=writeServiceRegistry(_0x1cea46,_0x810227);return{'registryPath':_0x1b5f3f,'entry':_0xb0aede,'serviceCount':_0x1cea46[_0x43ef08(0x1d1)][_0x43ef08(0x1cd)]};}export function listLocalServices(_0x4a8de9={}){const _0x16fc94=a34_0x34dc96;return readServiceRegistry(_0x4a8de9)[_0x16fc94(0x1d1)];}export function getLocalServiceEntry(_0x246903,_0x578fce={}){const _0xb4c1ec=a34_0x34dc96;return readServiceRegistry(_0x578fce)['services'][_0xb4c1ec(0x1fa)](_0x5bbac4=>_0x5bbac4[_0xb4c1ec(0x1ea)]===_0x246903[_0xb4c1ec(0x20e)]());}export function listLocalServiceTrees(_0x3d35f2={}){const _0x47d1a9=a34_0x34dc96;return readServiceRegistry(_0x3d35f2)[_0x47d1a9(0x1d1)][_0x47d1a9(0x211)](_0x1801aa=>_0x1801aa[_0x47d1a9(0x1f1)]);}export function inspectServiceRegistry(_0x1dd6b={}){const _0x3b9c51=a34_0x34dc96,_0x16b93a=getServiceRegistryPath(_0x1dd6b);if(!existsSync(_0x16b93a))return emptyServiceRegistryInspection(_0x16b93a,_0x3b9c51(0x1ec),![]);try{const _0x410add=readFileSync(_0x16b93a,_0x3b9c51(0x1fe));if(!_0x410add[_0x3b9c51(0x20e)]())return emptyServiceRegistryInspection(_0x16b93a,_0x3b9c51(0x1de),!![]);const _0x616202=JSON[_0x3b9c51(0x1fd)](_0x410add);if(_0x616202[_0x3b9c51(0x1fb)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x16b93a,_0x3b9c51(0x203),!![]),'schemaVersion':_0x616202[_0x3b9c51(0x1fb)],'message':_0x3b9c51(0x208)+String(_0x616202[_0x3b9c51(0x1fb)])};if(!Array['isArray'](_0x616202['services']))return{...emptyServiceRegistryInspection(_0x16b93a,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x616202[_0x3b9c51(0x1fc)],'message':_0x3b9c51(0x1ce)};const _0x59f22f=_0x616202['services'][_0x3b9c51(0x211)](summarizeLocalServiceEntry);return{'registryPath':_0x16b93a,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x616202[_0x3b9c51(0x1fc)],'serviceCount':_0x59f22f['length'],'commandCount':_0x59f22f[_0x3b9c51(0x1cb)]((_0x2aa549,_0x535faf)=>_0x2aa549+_0x535faf[_0x3b9c51(0x1e2)],0x0),'services':_0x59f22f};}catch(_0x4155a3){return{...emptyServiceRegistryInspection(_0x16b93a,_0x3b9c51(0x203),!![]),'message':_0x4155a3 instanceof Error?_0x4155a3[_0x3b9c51(0x20f)]:String(_0x4155a3)};}}export function formatValidationFailure(_0x36e3ab){const _0xf872bd=a34_0x34dc96,_0x57d3b6=_0x36e3ab[_0xf872bd(0x1db)][_0xf872bd(0x211)](_0x21f49f=>_0x21f49f[_0xf872bd(0x20b)]+':\x20'+_0x21f49f['message']);return _0xf872bd(0x206)+_0x57d3b6[_0xf872bd(0x1d8)]('\x0a');}function extractLoadedServiceManifests(_0x464540,_0x2f07ef){const _0x193c1c=a34_0x34dc96;if(!isServiceRegistryLike(_0x464540)){const _0x22fc35=_0x464540,_0xc1933f=validateServiceTreeManifest(_0x22fc35);return[{'manifest':_0x22fc35,'report':_0xc1933f,'normalizedManifest':_0xc1933f['ok']?normalizeServiceTreeManifest(_0x22fc35):undefined,'sourceHash':_0x2f07ef}];}return _0x464540[_0x193c1c(0x1d1)][_0x193c1c(0x211)]((_0x353638,_0x36ab3f)=>{const _0x11bb35=_0x193c1c,_0x3db2fc=isObjectRecord(_0x353638)?_0x353638[_0x11bb35(0x1dd)]:undefined,_0x2f7f29=validateServiceTreeManifest(_0x3db2fc),_0x3c322c=isObjectRecord(_0x353638)&&typeof _0x353638['serviceCode']===_0x11bb35(0x213)?_0x353638[_0x11bb35(0x1ea)]:undefined;return{'manifest':_0x3db2fc,'report':_0x2f7f29,'normalizedManifest':_0x2f7f29['ok']?normalizeServiceTreeManifest(_0x3db2fc):undefined,'sourceHash':sha256(JSON[_0x11bb35(0x205)](_0x3db2fc,null,0x2)+'\x0a'),'registryIndex':_0x36ab3f,'registryServiceCode':_0x3c322c};});}function aggregateValidationReports(_0x5e5115){const _0x1920b0=a34_0x34dc96,_0x2f1ece=_0x5e5115[_0x1920b0(0x200)](_0x4daf91=>_0x4daf91['registryIndex']===undefined?_0x4daf91[_0x1920b0(0x1cf)][_0x1920b0(0x1db)]:_0x4daf91[_0x1920b0(0x1cf)][_0x1920b0(0x1db)][_0x1920b0(0x211)](_0x2707a7=>({..._0x2707a7,'path':prefixRegistryIssuePath(_0x4daf91[_0x1920b0(0x1e9)],_0x2707a7[_0x1920b0(0x20b)])}))),_0x1bfb83=_0x5e5115['flatMap'](_0x56f41e=>_0x56f41e[_0x1920b0(0x1e9)]===undefined?_0x56f41e[_0x1920b0(0x1cf)]['warnings']:_0x56f41e[_0x1920b0(0x1cf)][_0x1920b0(0x20d)]['map'](_0x1ad694=>({..._0x1ad694,'path':prefixRegistryIssuePath(_0x56f41e[_0x1920b0(0x1e9)],_0x1ad694['path'])})));return{'ok':_0x2f1ece[_0x1920b0(0x1cd)]===0x0,'errors':_0x2f1ece,'warnings':_0x1bfb83};}function prefixRegistryIssuePath(_0x480b9f,_0x543c82){const _0x3b9da=a34_0x34dc96;if(_0x543c82==='$')return _0x3b9da(0x1d5)+_0x480b9f+_0x3b9da(0x1ee);if(_0x543c82[_0x3b9da(0x1f6)]('$.'))return _0x3b9da(0x1d5)+_0x480b9f+_0x3b9da(0x1ee)+_0x543c82[_0x3b9da(0x217)](0x1);if(_0x543c82[_0x3b9da(0x1f6)]('$['))return'$.services['+_0x480b9f+_0x3b9da(0x1ee)+_0x543c82[_0x3b9da(0x217)](0x1);return'$.services['+_0x480b9f+_0x3b9da(0x1cc)+_0x543c82;}function isServiceRegistryLike(_0x5c268e){const _0x4ce526=a34_0x34dc96;return isObjectRecord(_0x5c268e)&&_0x5c268e[_0x4ce526(0x1fb)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x4ce526(0x215)](_0x5c268e[_0x4ce526(0x1d1)]);}function isObjectRecord(_0x52362d){const _0x4186b4=a34_0x34dc96;return Boolean(_0x52362d)&&typeof _0x52362d===_0x4186b4(0x1d0)&&!Array['isArray'](_0x52362d);}function emptyServiceRegistryInspection(_0x556c58,_0x95ee6b,_0x236703){return{'registryPath':_0x556c58,'exists':_0x236703,'status':_0x95ee6b,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x30ef04){const _0x48457d=a34_0x34dc96,_0x3ee4a4=_0x30ef04[_0x48457d(0x1f1)],_0x431d49=_0x3ee4a4['commands'][_0x48457d(0x211)](_0x1faeef=>({'path':_0x1faeef['cliPath'],'description':_0x1faeef[_0x48457d(0x214)],'risk':_0x1faeef[_0x48457d(0x1d3)],'targetKind':_0x1faeef[_0x48457d(0x1ff)]['kind'],'targetCommand':_0x1faeef[_0x48457d(0x1ff)][_0x48457d(0x202)]}));return{'serviceCode':_0x30ef04[_0x48457d(0x1ea)],'name':_0x3ee4a4['service'][_0x48457d(0x216)],'description':_0x3ee4a4[_0x48457d(0x1d7)]['description'],'version':_0x30ef04['version'],'importedAt':_0x30ef04[_0x48457d(0x1dc)],'source':_0x30ef04[_0x48457d(0x1e1)],'commandCount':_0x431d49[_0x48457d(0x1cd)],'commands':_0x431d49};}function sha256(_0x301ce6){const _0x1285a4=a34_0x34dc96;return createHash('sha256')[_0x1285a4(0x1df)](_0x301ce6)['digest'](_0x1285a4(0x1ca));}
|
|
1
|
+
(function(_0x34c495,_0x47bb1f){const _0x1467e8=a34_0x5189,_0x572515=_0x34c495();while(!![]){try{const _0x3293f6=-parseInt(_0x1467e8(0x19e))/0x1*(parseInt(_0x1467e8(0x1e2))/0x2)+parseInt(_0x1467e8(0x1d4))/0x3+-parseInt(_0x1467e8(0x1b7))/0x4*(-parseInt(_0x1467e8(0x1d0))/0x5)+parseInt(_0x1467e8(0x1b5))/0x6+-parseInt(_0x1467e8(0x1a6))/0x7*(-parseInt(_0x1467e8(0x1bf))/0x8)+-parseInt(_0x1467e8(0x1be))/0x9*(-parseInt(_0x1467e8(0x1ab))/0xa)+-parseInt(_0x1467e8(0x1a9))/0xb;if(_0x3293f6===_0x47bb1f)break;else _0x572515['push'](_0x572515['shift']());}catch(_0xd5e3c6){_0x572515['push'](_0x572515['shift']());}}}(a34_0x1c96,0x3d060));function a34_0x1c96(){const _0xec42c1=['validation','Cannot\x20write\x20service\x20registry:\x20','filePath','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','description','homeDir','286908dnYSRg','stringify','8108aHZeLz','cliPath','findIndex','trim','manifest','].manifest','Service\x20manifest\x20file\x20not\x20found:\x20','691911ztbTsh','8fustEK','version','name','flatMap','length','update','Invalid\x20service\x20manifest\x20JSON:\x20','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','digest','homeDirName','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','file','map','services','commandCount','$.services[','report','395DfWmzP','sha256','normalizedManifest','source','848928AiFQYO','.tmp','parse','service','serviceCode','].manifest.','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Service\x20manifest\x20validation\x20failed:\x0a','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','registryIndex','isArray','Unsupported\x20service\x20registry\x20schemaVersion:\x20','now','errors','4vKMoZc','updatedAt','reduce','object','importedAt','Local\x20service\x20not\x20found:\x20','invalid','services\x20must\x20be\x20an\x20array','target','slice','Remove\x20or\x20migrate\x20','toISOString','string','111647evFbch','warnings','sourceHash','hex','push','join','message','ENOENT','2824115UEsOvl','utf8','schemaVersion','8015062ejZoJu','startsWith','40vpxnXU','manifests','path','kind'];a34_0x1c96=function(){return _0xec42c1;};return a34_0x1c96();}import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x404b22={}){const _0x564751=a34_0x5189;return resolve(_0x404b22[_0x564751(0x1b4)]??homedir(),PRODUCT_CONFIG[_0x564751(0x1c8)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x55fbad={}){const _0xa5d220=a34_0x5189,_0x418058=getServiceRegistryPath(_0x55fbad);if(!existsSync(_0x418058))return emptyServiceRegistry();try{const _0x4cef3e=readFileSync(_0x418058,'utf8');if(!_0x4cef3e[_0xa5d220(0x1ba)]())return emptyServiceRegistry();const _0x49a377=JSON['parse'](_0x4cef3e);if(_0x49a377['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0xa5d220(0x1af)](_0xa5d220(0x1df)+String(_0x49a377[_0xa5d220(0x1a8)]),_0xa5d220(0x1ec)+_0x418058+'.');if(!Array['isArray'](_0x49a377['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x49a377[_0xa5d220(0x1e3)],'services':_0x49a377[_0xa5d220(0x1cc)]};}catch(_0x568b70){if(_0x568b70 instanceof Error&&_0x568b70[_0xa5d220(0x1c1)]==='CliError')throw _0x568b70;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x418058,_0xa5d220(0x1c6));}}export function writeServiceRegistry(_0x575314,_0x50b274={}){const _0x5615dc=a34_0x5189,_0x4816fa=getServiceRegistryPath(_0x50b274),_0x43153f=dirname(_0x4816fa);!existsSync(_0x43153f)&&mkdirSync(_0x43153f,{'recursive':!![]});const _0x4a5a44=_0x4816fa+_0x5615dc(0x1d5);try{writeFileSync(_0x4a5a44,JSON[_0x5615dc(0x1b6)](_0x575314,null,0x2)+'\x0a',{'encoding':_0x5615dc(0x1a7),'mode':0x180}),renameSync(_0x4a5a44,_0x4816fa);}catch(_0x3697e8){try{unlinkSync(_0x4a5a44);}catch{}if(_0x3697e8?.['code']===_0x5615dc(0x1a5))throw CliErrors[_0x5615dc(0x1af)](_0x5615dc(0x1b0)+_0x4816fa);throw _0x3697e8;}return _0x4816fa;}export function loadServiceManifestFromFile(_0x5891f6){const _0x9fbd32=a34_0x5189,_0x3553d8=resolve(_0x5891f6);if(!existsSync(_0x3553d8))throw CliErrors[_0x9fbd32(0x1af)](_0x9fbd32(0x1bd)+_0x5891f6);let _0x58db40;const _0x4a65b9=readFileSync(_0x3553d8,_0x9fbd32(0x1a7));try{_0x58db40=JSON[_0x9fbd32(0x1d6)](_0x4a65b9);}catch{throw CliErrors[_0x9fbd32(0x1af)](_0x9fbd32(0x1c5)+_0x5891f6,_0x9fbd32(0x1c9));}const _0x197c87=sha256(_0x4a65b9),_0x636aab=extractLoadedServiceManifests(_0x58db40,_0x197c87),_0x59f027=aggregateValidationReports(_0x636aab),_0x364f79=_0x636aab[0x0];return{'filePath':_0x3553d8,'hash':_0x197c87,'kind':isServiceRegistryLike(_0x58db40)?'registry':_0x9fbd32(0x1bb),'manifest':_0x364f79?.[_0x9fbd32(0x1bb)]??_0x58db40,'report':_0x59f027,'normalizedManifest':_0x636aab[_0x9fbd32(0x1c3)]===0x1?_0x364f79?.[_0x9fbd32(0x1d2)]:undefined,'manifests':_0x636aab};}export function importServiceManifest(_0x285db0,_0x4a0091={}){const _0x96cb95=a34_0x5189,_0x1ec121=loadServiceManifestFromFile(_0x285db0);if(!_0x1ec121[_0x96cb95(0x1cf)]['ok'])throw CliErrors[_0x96cb95(0x1af)](formatValidationFailure(_0x1ec121[_0x96cb95(0x1cf)]),_0x96cb95(0x1da));if(_0x1ec121[_0x96cb95(0x1ac)]['length']===0x0)throw CliErrors[_0x96cb95(0x1af)]('Service\x20registry\x20has\x20no\x20services\x20to\x20import.',_0x96cb95(0x1b2));const _0x430f7d=readServiceRegistry(_0x4a0091),_0x40111f=(_0x4a0091[_0x96cb95(0x1e0)]??(()=>new Date()))()[_0x96cb95(0x19c)](),_0x53aaed=[];let _0x2effa2=0x0,_0x32790d=0x0;for(const _0x271619 of _0x1ec121[_0x96cb95(0x1ac)]){if(!_0x271619['normalizedManifest'])continue;const _0x25beec=_0x271619[_0x96cb95(0x1d2)][_0x96cb95(0x1d7)]['code'],_0x1e008d={'serviceCode':_0x25beec,'version':_0x271619[_0x96cb95(0x1d2)][_0x96cb95(0x1c0)],'importedAt':_0x40111f,'source':{'type':_0x96cb95(0x1ca),'path':_0x1ec121[_0x96cb95(0x1b1)],'hash':_0x271619[_0x96cb95(0x1a0)]},'manifest':_0x271619['manifest'],'normalizedManifest':_0x271619['normalizedManifest']},_0x244dc2=_0x430f7d[_0x96cb95(0x1cc)]['findIndex'](_0xcc5d8a=>_0xcc5d8a[_0x96cb95(0x1d8)]===_0x25beec);_0x244dc2>=0x0?(_0x430f7d['services'][_0x244dc2]=_0x1e008d,_0x32790d++):(_0x430f7d[_0x96cb95(0x1cc)][_0x96cb95(0x1a2)](_0x1e008d),_0x2effa2++),_0x53aaed[_0x96cb95(0x1a2)](_0x1e008d);}_0x430f7d[_0x96cb95(0x1cc)]['sort']((_0x3d61df,_0x524877)=>_0x3d61df[_0x96cb95(0x1d8)]['localeCompare'](_0x524877[_0x96cb95(0x1d8)])),_0x430f7d['updatedAt']=_0x40111f;const _0xfd903c=writeServiceRegistry(_0x430f7d,_0x4a0091);return{'registryPath':_0xfd903c,'entry':_0x53aaed[0x0],'replaced':_0x53aaed['length']===0x1?_0x32790d===0x1:_0x32790d>0x0,'entries':_0x53aaed,'imported':_0x2effa2,'updated':_0x32790d,'serviceCount':_0x430f7d[_0x96cb95(0x1cc)][_0x96cb95(0x1c3)]};}export function exportServiceManifest(_0x429f92,_0x38c458,_0x1cdf0a={}){const _0x14a300=a34_0x5189,_0x3e9ce4=getServiceRegistryPath(_0x1cdf0a),_0x1eccbc=getLocalServiceEntry(_0x429f92,_0x1cdf0a);if(!_0x1eccbc)throw CliErrors[_0x14a300(0x1af)](_0x14a300(0x1e7)+_0x429f92,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x48d3bc=resolve(_0x38c458),_0x2505dd=dirname(_0x48d3bc);return!existsSync(_0x2505dd)&&mkdirSync(_0x2505dd,{'recursive':!![]}),writeFileSync(_0x48d3bc,JSON[_0x14a300(0x1b6)](_0x1eccbc[_0x14a300(0x1bb)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x3e9ce4,'filePath':_0x48d3bc,'entry':_0x1eccbc};}export function removeServiceManifest(_0x42260b,_0xd577cd={}){const _0x276a63=a34_0x5189,_0x150742=readServiceRegistry(_0xd577cd),_0x1fe000=_0x42260b['trim'](),_0x319c1b=_0x150742[_0x276a63(0x1cc)][_0x276a63(0x1b9)](_0x482a62=>_0x482a62[_0x276a63(0x1d8)]===_0x1fe000);if(_0x319c1b<0x0)throw CliErrors[_0x276a63(0x1af)]('Local\x20service\x20not\x20found:\x20'+_0x1fe000,_0x276a63(0x1dc));const [_0x57ee57]=_0x150742[_0x276a63(0x1cc)]['splice'](_0x319c1b,0x1),_0x461f6e=(_0xd577cd[_0x276a63(0x1e0)]??(()=>new Date()))()['toISOString']();_0x150742[_0x276a63(0x1e3)]=_0x461f6e;const _0x3e7f17=writeServiceRegistry(_0x150742,_0xd577cd);return{'registryPath':_0x3e7f17,'entry':_0x57ee57,'serviceCount':_0x150742[_0x276a63(0x1cc)][_0x276a63(0x1c3)]};}export function listLocalServices(_0x2a135d={}){return readServiceRegistry(_0x2a135d)['services'];}function a34_0x5189(_0x2c1985,_0x14d486){_0x2c1985=_0x2c1985-0x19c;const _0x1c9662=a34_0x1c96();let _0x5189d3=_0x1c9662[_0x2c1985];return _0x5189d3;}export function getLocalServiceEntry(_0xac450a,_0x37a429={}){const _0x491827=a34_0x5189;return readServiceRegistry(_0x37a429)[_0x491827(0x1cc)]['find'](_0xa99d36=>_0xa99d36[_0x491827(0x1d8)]===_0xac450a[_0x491827(0x1ba)]());}export function listLocalServiceTrees(_0x2c34db={}){const _0x20f08d=a34_0x5189;return readServiceRegistry(_0x2c34db)['services'][_0x20f08d(0x1cb)](_0x32d2df=>_0x32d2df['normalizedManifest']);}export function inspectServiceRegistry(_0x20be86={}){const _0x49f4e4=a34_0x5189,_0xf1be87=getServiceRegistryPath(_0x20be86);if(!existsSync(_0xf1be87))return emptyServiceRegistryInspection(_0xf1be87,'missing',![]);try{const _0x3295eb=readFileSync(_0xf1be87,_0x49f4e4(0x1a7));if(!_0x3295eb[_0x49f4e4(0x1ba)]())return emptyServiceRegistryInspection(_0xf1be87,'empty',!![]);const _0x2d9a2b=JSON[_0x49f4e4(0x1d6)](_0x3295eb);if(_0x2d9a2b['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xf1be87,_0x49f4e4(0x1e8),!![]),'schemaVersion':_0x2d9a2b[_0x49f4e4(0x1a8)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x2d9a2b[_0x49f4e4(0x1a8)])};if(!Array[_0x49f4e4(0x1de)](_0x2d9a2b['services']))return{...emptyServiceRegistryInspection(_0xf1be87,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2d9a2b[_0x49f4e4(0x1e3)],'message':_0x49f4e4(0x1e9)};const _0x255873=_0x2d9a2b['services']['map'](summarizeLocalServiceEntry);return{'registryPath':_0xf1be87,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2d9a2b[_0x49f4e4(0x1e3)],'serviceCount':_0x255873[_0x49f4e4(0x1c3)],'commandCount':_0x255873[_0x49f4e4(0x1e4)]((_0xc4019a,_0x1fff3a)=>_0xc4019a+_0x1fff3a[_0x49f4e4(0x1cd)],0x0),'services':_0x255873};}catch(_0x5f4206){return{...emptyServiceRegistryInspection(_0xf1be87,_0x49f4e4(0x1e8),!![]),'message':_0x5f4206 instanceof Error?_0x5f4206[_0x49f4e4(0x1a4)]:String(_0x5f4206)};}}export function formatValidationFailure(_0x30219a){const _0x37cb8b=a34_0x5189,_0x592a03=_0x30219a[_0x37cb8b(0x1e1)][_0x37cb8b(0x1cb)](_0x447dad=>_0x447dad[_0x37cb8b(0x1ad)]+':\x20'+_0x447dad[_0x37cb8b(0x1a4)]);return _0x37cb8b(0x1db)+_0x592a03[_0x37cb8b(0x1a3)]('\x0a');}function extractLoadedServiceManifests(_0x326ae1,_0x41235e){const _0x59ea05=a34_0x5189;if(!isServiceRegistryLike(_0x326ae1)){const _0xa4f022=_0x326ae1,_0x43cc2c=validateServiceTreeManifest(_0xa4f022);return[{'manifest':_0xa4f022,'report':_0x43cc2c,'normalizedManifest':_0x43cc2c['ok']?normalizeServiceTreeManifest(_0xa4f022):undefined,'sourceHash':_0x41235e}];}return _0x326ae1[_0x59ea05(0x1cc)]['map']((_0x332e9a,_0x3a2d8d)=>{const _0xd22aa0=_0x59ea05,_0x3e003e=isObjectRecord(_0x332e9a)?_0x332e9a[_0xd22aa0(0x1bb)]:undefined,_0x33e78d=validateServiceTreeManifest(_0x3e003e),_0x87c24d=isObjectRecord(_0x332e9a)&&typeof _0x332e9a[_0xd22aa0(0x1d8)]===_0xd22aa0(0x19d)?_0x332e9a['serviceCode']:undefined;return{'manifest':_0x3e003e,'report':_0x33e78d,'normalizedManifest':_0x33e78d['ok']?normalizeServiceTreeManifest(_0x3e003e):undefined,'sourceHash':sha256(JSON[_0xd22aa0(0x1b6)](_0x3e003e,null,0x2)+'\x0a'),'registryIndex':_0x3a2d8d,'registryServiceCode':_0x87c24d};});}function aggregateValidationReports(_0x32638c){const _0x22b609=a34_0x5189,_0x24f6cd=_0x32638c[_0x22b609(0x1c2)](_0x27d41a=>_0x27d41a[_0x22b609(0x1dd)]===undefined?_0x27d41a['report'][_0x22b609(0x1e1)]:_0x27d41a['report'][_0x22b609(0x1e1)][_0x22b609(0x1cb)](_0x4b7d40=>({..._0x4b7d40,'path':prefixRegistryIssuePath(_0x27d41a[_0x22b609(0x1dd)],_0x4b7d40[_0x22b609(0x1ad)])}))),_0x1a9976=_0x32638c[_0x22b609(0x1c2)](_0x43f158=>_0x43f158['registryIndex']===undefined?_0x43f158[_0x22b609(0x1cf)]['warnings']:_0x43f158[_0x22b609(0x1cf)][_0x22b609(0x19f)]['map'](_0x4cec2a=>({..._0x4cec2a,'path':prefixRegistryIssuePath(_0x43f158[_0x22b609(0x1dd)],_0x4cec2a[_0x22b609(0x1ad)])})));return{'ok':_0x24f6cd['length']===0x0,'errors':_0x24f6cd,'warnings':_0x1a9976};}function prefixRegistryIssuePath(_0x4eee2e,_0x4b37b3){const _0x59b453=a34_0x5189;if(_0x4b37b3==='$')return _0x59b453(0x1ce)+_0x4eee2e+_0x59b453(0x1bc);if(_0x4b37b3[_0x59b453(0x1aa)]('$.'))return'$.services['+_0x4eee2e+_0x59b453(0x1bc)+_0x4b37b3[_0x59b453(0x1eb)](0x1);if(_0x4b37b3['startsWith']('$['))return _0x59b453(0x1ce)+_0x4eee2e+'].manifest'+_0x4b37b3[_0x59b453(0x1eb)](0x1);return _0x59b453(0x1ce)+_0x4eee2e+_0x59b453(0x1d9)+_0x4b37b3;}function isServiceRegistryLike(_0x31e978){const _0x17650c=a34_0x5189;return isObjectRecord(_0x31e978)&&_0x31e978['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x17650c(0x1de)](_0x31e978[_0x17650c(0x1cc)]);}function isObjectRecord(_0x16ada5){const _0x49c8f0=a34_0x5189;return Boolean(_0x16ada5)&&typeof _0x16ada5===_0x49c8f0(0x1e5)&&!Array[_0x49c8f0(0x1de)](_0x16ada5);}function emptyServiceRegistryInspection(_0x2091ce,_0x536631,_0x36856e){return{'registryPath':_0x2091ce,'exists':_0x36856e,'status':_0x536631,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x2524b0){const _0xfe46d3=a34_0x5189,_0x4b1aee=_0x2524b0['normalizedManifest'],_0x5d5bf2=_0x4b1aee['commands'][_0xfe46d3(0x1cb)](_0x1c17d7=>({'path':_0x1c17d7[_0xfe46d3(0x1b8)],'description':_0x1c17d7[_0xfe46d3(0x1b3)],'risk':_0x1c17d7['risk'],'targetKind':_0x1c17d7['target'][_0xfe46d3(0x1ae)],'targetCommand':_0x1c17d7[_0xfe46d3(0x1ea)]['command']}));return{'serviceCode':_0x2524b0['serviceCode'],'name':_0x4b1aee['service'][_0xfe46d3(0x1c1)],'description':_0x4b1aee['service'][_0xfe46d3(0x1b3)],'version':_0x2524b0[_0xfe46d3(0x1c0)],'importedAt':_0x2524b0[_0xfe46d3(0x1e6)],'source':_0x2524b0[_0xfe46d3(0x1d3)],'commandCount':_0x5d5bf2[_0xfe46d3(0x1c3)],'commands':_0x5d5bf2};}function sha256(_0x838c8e){const _0x124a4f=a34_0x5189;return createHash(_0x124a4f(0x1d1))[_0x124a4f(0x1c4)](_0x838c8e)[_0x124a4f(0x1c7)](_0x124a4f(0x1a1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x292df1=a35_0x496d;(function(_0x252182,_0xf269d6){const _0x50dd5b=a35_0x496d,_0x1f6ee8=_0x252182();while(!![]){try{const _0x53ed04=parseInt(_0x50dd5b(0x1eb))/0x1*(-parseInt(_0x50dd5b(0x1fe))/0x2)+parseInt(_0x50dd5b(0x1f6))/0x3*(-parseInt(_0x50dd5b(0x1f4))/0x4)+-parseInt(_0x50dd5b(0x207))/0x5*(parseInt(_0x50dd5b(0x1e8))/0x6)+-parseInt(_0x50dd5b(0x1f7))/0x7*(parseInt(_0x50dd5b(0x1e9))/0x8)+parseInt(_0x50dd5b(0x1f1))/0x9*(parseInt(_0x50dd5b(0x204))/0xa)+-parseInt(_0x50dd5b(0x200))/0xb+parseInt(_0x50dd5b(0x1fb))/0xc;if(_0x53ed04===_0xf269d6)break;else _0x1f6ee8['push'](_0x1f6ee8['shift']());}catch(_0x2e5434){_0x1f6ee8['push'](_0x1f6ee8['shift']());}}}(a35_0x1659,0x9f4f1));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a35_0x496d(_0xdc2c9f,_0x311c94){_0xdc2c9f=_0xdc2c9f-0x1e4;const _0x1659fe=a35_0x1659();let _0x496d55=_0x1659fe[_0xdc2c9f];return _0x496d55;}import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a35_0x292df1(0x1ff),'command':'create','description':a35_0x292df1(0x1e6),'risk':a35_0x292df1(0x1ec),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x415bce){const _0x3a7e87=a35_0x292df1,_0x3bec90=buildSkillCreatePlan(_0x415bce[_0x3a7e87(0x1e5)](_0x3a7e87(0x1fd)),_0x415bce['str'](_0x3a7e87(0x1f2)),_0x415bce[_0x3a7e87(0x1e5)](_0x3a7e87(0x208)));return{'method':_0x3a7e87(0x1e4),'url':_0x3bec90[_0x3a7e87(0x206)],'body':{'skillName':_0x3bec90[_0x3a7e87(0x1ef)][_0x3a7e87(0x209)],'type':_0x3bec90[_0x3a7e87(0x1ef)][_0x3a7e87(0x1f2)],'selfContained':!![],'files':_0x3bec90[_0x3a7e87(0x1ef)][_0x3a7e87(0x1f3)][_0x3a7e87(0x1e7)](_0x2d685b=>_0x2d685b[_0x3a7e87(0x203)])},'description':_0x3a7e87(0x1f9)};},async 'execute'(_0x191e65){const _0x20c384=a35_0x292df1,_0x4fbe58=buildSkillCreatePlan(_0x191e65['str'](_0x20c384(0x1fd)),_0x191e65['str'](_0x20c384(0x1f2)),_0x191e65['str'](_0x20c384(0x208)));return writeSkillDraft(_0x4fbe58,_0x191e65[_0x20c384(0x1ea)](_0x20c384(0x201))),{'ok':!![],'data':{'skillName':_0x4fbe58[_0x20c384(0x1ef)][_0x20c384(0x209)],'type':_0x4fbe58[_0x20c384(0x1ef)]['type'],'dir':_0x4fbe58[_0x20c384(0x206)],'files':_0x4fbe58[_0x20c384(0x1ef)][_0x20c384(0x1f3)][_0x20c384(0x1e7)](_0x3ef460=>_0x3ef460[_0x20c384(0x203)])},'message':_0x20c384(0x1f5)+_0x4fbe58[_0x20c384(0x1ef)][_0x20c384(0x209)]};}};function buildSkillCreatePlan(_0x89ca33,_0x3c7a27,_0x3ecbe1){const _0x51f455=renderSkillTemplate({'skillName':_0x89ca33,'type':_0x3c7a27}),_0x5b7d34=resolve(normalizeSkillTarget(_0x3ecbe1));return{'rendered':_0x51f455,'targetRoot':_0x5b7d34,'skillDir':resolve(_0x5b7d34,_0x51f455['skillName'])};}function normalizeSkillTarget(_0x37634c){const _0x250fe7=a35_0x292df1;return(_0x37634c||DEFAULT_SKILL_TARGET)[_0x250fe7(0x1fc)]()||DEFAULT_SKILL_TARGET;}function a35_0x1659(){const _0x2cfffb=['2061186PYhqMj','2404272yJlCRy','bool','4496XoXdVZ','write','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','rendered','Refusing\x20to\x20overwrite\x20symlink:\x20','3915BgaDUx','type','files','4ldLVXr','Created\x20local\x20Skill\x20draft\x20','1483992HSShug','28CnlPKj','content','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','validation','36470832hkCifR','trim','name','52PlaEqO','skill','6983900WrjmBJ','force','isDirectory','path','9320EpFnCw','isSymbolicLink','skillDir','5dUQFuT','target','skillName','WRITE','str','Create\x20a\x20local\x20self-contained\x20runtime\x20Skill\x20draft','map'];a35_0x1659=function(){return _0x2cfffb;};return a35_0x1659();}function writeSkillDraft(_0x28f86e,_0x26245f){const _0x5150e0=a35_0x292df1;if(existsSync(_0x28f86e[_0x5150e0(0x206)])){const _0xb36345=lstatSync(_0x28f86e['skillDir']);if(!_0xb36345[_0x5150e0(0x202)]()||_0xb36345[_0x5150e0(0x205)]())throw CliErrors['validation'](_0x5150e0(0x1ed)+_0x28f86e['skillDir']);if(!_0x26245f)throw CliErrors[_0x5150e0(0x1fa)]('Skill\x20directory\x20already\x20exists:\x20'+_0x28f86e[_0x5150e0(0x206)],_0x5150e0(0x1ee));}for(const _0x3d8db0 of _0x28f86e['rendered']['files']){const _0x4322d0=resolve(_0x28f86e[_0x5150e0(0x206)],_0x3d8db0['path']),_0x1c4e1f=dirname(_0x4322d0);mkdirSync(_0x1c4e1f,{'recursive':!![]});if(existsSync(_0x4322d0)&&lstatSync(_0x4322d0)[_0x5150e0(0x205)]())throw CliErrors[_0x5150e0(0x1fa)](_0x5150e0(0x1f0)+_0x4322d0);writeFileSync(_0x4322d0,_0x3d8db0[_0x5150e0(0x1f8)],'utf8');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xc41b53=a36_0x5a42;(function(_0x47b1bb,_0x5c8420){const _0x5f2029=a36_0x5a42,_0x57fb76=_0x47b1bb();while(!![]){try{const _0x200f26=-parseInt(_0x5f2029(0x166))/0x1+-parseInt(_0x5f2029(0x145))/0x2+parseInt(_0x5f2029(0x15b))/0x3+-parseInt(_0x5f2029(0x15e))/0x4+-parseInt(_0x5f2029(0x15f))/0x5*(-parseInt(_0x5f2029(0x15d))/0x6)+-parseInt(_0x5f2029(0x157))/0x7+parseInt(_0x5f2029(0x162))/0x8;if(_0x200f26===_0x5c8420)break;else _0x57fb76['push'](_0x57fb76['shift']());}catch(_0x1cfc8d){_0x57fb76['push'](_0x57fb76['shift']());}}}(a36_0x14b9,0x7c020));import{CliErrors}from'../../../errors.js';function a36_0x5a42(_0x660a2d,_0x241474){_0x660a2d=_0x660a2d-0x13c;const _0x14b9b5=a36_0x14b9();let _0x5a4286=_0x14b9b5[_0x660a2d];return _0x5a4286;}import{CODE_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';function a36_0x14b9(){const _0x4f99a4=['\x20company\x20Skill(s).','../../../core/api-client.js','accessKey','updated','code','unchanged','appCode','2931579imGopD','reduce','str','personal','1336311JObWnd','envName','3930798yKZKPX','4021824RYYiLm','5cfjpfv','map','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','14044312sYTRRz','Installed\x20','removed','filter','69382HwuqfG','install','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','length','skillCode','action','company','write','all','production','1709076agtxBK','../../../skills/runtime-skill-sync.js','includes','push','authRequired','trim','flatMap','version','scope','skill','created'];a36_0x14b9=function(){return _0x4f99a4;};return a36_0x14b9();}import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a36_0xc41b53(0x14e),'command':a36_0xc41b53(0x13c),'description':a36_0xc41b53(0x161),'risk':a36_0xc41b53(0x142),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG],async 'execute'(_0x39bd8e){return syncRuntimeSkills(_0x39bd8e);}};async function syncRuntimeSkills(_0x1e76cc){const _0x25a337=a36_0xc41b53,{downloadRuntimeSkillPackage:_0x17c935,listRuntimeSkills:_0x2a230e}=await import(_0x25a337(0x151)),{linkEffectiveRuntimeSkills:_0x323123,materializeRuntimeSkill:_0x374691,pruneStaleRuntimeSkillCache:_0xcecba8,pruneStaleRuntimeSkillLinks:_0x479ca2}=await import(_0x25a337(0x146)),_0x47c332=_0x1e76cc['str'](_0x25a337(0x154)),_0x146eb0=normalizeSyncScopes(_0x1e76cc[_0x25a337(0x159)](_0x25a337(0x14d))),_0x45b8d9=_0x1e76cc[_0x25a337(0x15c)]??_0x25a337(0x144),_0x16b80a=_0x1e76cc[_0x25a337(0x152)];if(!_0x16b80a)throw CliErrors[_0x25a337(0x149)](_0x25a337(0x13d));const _0x4f9f2c=await Promise[_0x25a337(0x143)](_0x146eb0[_0x25a337(0x160)](_0x248e91=>_0x2a230e({'appCode':_0x1e76cc[_0x25a337(0x156)],'scope':_0x248e91,'code':_0x47c332[_0x25a337(0x14a)]()||undefined}))),_0x5d7217=_0x146eb0[_0x25a337(0x147)]('personal')?_0x4f9f2c[_0x25a337(0x14b)]((_0x1a5859,_0x3b48a6)=>_0x146eb0[_0x3b48a6]===_0x25a337(0x15a)?_0x1a5859[_0x25a337(0x15a)]:[]):[],_0x458488=_0x146eb0[_0x25a337(0x147)](_0x25a337(0x141))?_0x4f9f2c[_0x25a337(0x14b)]((_0x2ae624,_0x4715f6)=>_0x146eb0[_0x4715f6]===_0x25a337(0x141)?_0x2ae624[_0x25a337(0x141)]:[]):[],_0x14c979=new Set([..._0x5d7217[_0x25a337(0x160)](_0x4b344a=>_0x4b344a[_0x25a337(0x13f)]?.[_0x25a337(0x14a)]())['filter'](_0x1c012c=>Boolean(_0x1c012c)),..._0x458488['map'](_0x85b47b=>_0x85b47b[_0x25a337(0x13f)]?.[_0x25a337(0x14a)]())[_0x25a337(0x165)](_0x2f8b2f=>Boolean(_0x2f8b2f))]),_0x1dcd5f=_0x47c332[_0x25a337(0x14a)]()?[_0x47c332[_0x25a337(0x14a)]()]:undefined,_0x653ed2=_0x146eb0[_0x25a337(0x13e)]===0x2&&_0x146eb0[_0x25a337(0x147)](_0x25a337(0x15a))&&_0x146eb0[_0x25a337(0x147)](_0x25a337(0x141)),_0x7e97f5=_0x653ed2?_0x479ca2(_0x1e76cc['appCode'],_0x14c979,{},_0x1dcd5f):[],_0x4bca8f=_0xcecba8({'env':_0x45b8d9,'accessKey':_0x16b80a,'appCode':_0x1e76cc[_0x25a337(0x156)],'activeSkillCodes':_0x14c979,'pruneSkillCodes':_0x1dcd5f,'scopes':_0x146eb0}),_0xc2030c=[];for(const _0x4fd4f9 of _0x5d7217){_0xc2030c[_0x25a337(0x148)](_0x374691(_0x4fd4f9,_0x25a337(0x15a),{'env':_0x45b8d9,'accessKey':_0x16b80a,'appCode':_0x1e76cc[_0x25a337(0x156)],'packageBytes':await downloadSkillPackage(_0x4fd4f9,_0x25a337(0x15a),_0x1e76cc[_0x25a337(0x156)],_0x17c935)}));}for(const _0x52399d of _0x458488){_0xc2030c[_0x25a337(0x148)](_0x374691(_0x52399d,'company',{'env':_0x45b8d9,'accessKey':_0x16b80a,'appCode':_0x1e76cc[_0x25a337(0x156)],'packageBytes':await downloadSkillPackage(_0x52399d,_0x25a337(0x141),_0x1e76cc[_0x25a337(0x156)],_0x17c935)}));}const _0x280e89=_0x323123(_0xc2030c,_0x1e76cc[_0x25a337(0x156)]),_0x436909=countLinkActions(_0x280e89);return{'ok':!![],'data':{'appCode':_0x1e76cc[_0x25a337(0x156)],'personal':_0x5d7217[_0x25a337(0x13e)],'company':_0x458488[_0x25a337(0x13e)],'materialized':_0xc2030c[_0x25a337(0x13e)],'links':{'total':_0x280e89[_0x25a337(0x13e)],'created':_0x436909[_0x25a337(0x14f)]??0x0,'updated':_0x436909[_0x25a337(0x153)]??0x0,'unchanged':_0x436909[_0x25a337(0x155)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x7e97f5[_0x25a337(0x165)](_0x182ef2=>_0x182ef2[_0x25a337(0x140)]==='removed')[_0x25a337(0x13e)],'cacheDirs':_0x4bca8f['filter'](_0x35ab74=>_0x35ab74[_0x25a337(0x140)]===_0x25a337(0x164))['length'],'skipped':[..._0x7e97f5,..._0x4bca8f][_0x25a337(0x165)](_0x4e2f61=>_0x4e2f61['action']==='skipped')[_0x25a337(0x13e)]},'skills':{'personal':_0x5d7217[_0x25a337(0x160)](summarizeRuntimeSkill),'company':_0x458488[_0x25a337(0x160)](summarizeRuntimeSkill)}},'message':_0x25a337(0x163)+_0x5d7217[_0x25a337(0x13e)]+'\x20personal\x20and\x20'+_0x458488[_0x25a337(0x13e)]+_0x25a337(0x150)};}async function downloadSkillPackage(_0x218c71,_0x192a66,_0x2645c5,_0x52756b){const _0x49ea75=a36_0xc41b53,_0x53be33=_0x218c71[_0x49ea75(0x14c)]?.[_0x49ea75(0x14a)]();return _0x53be33?_0x52756b(_0x192a66,_0x218c71[_0x49ea75(0x13f)],_0x2645c5,_0x53be33):_0x52756b(_0x192a66,_0x218c71[_0x49ea75(0x13f)],_0x2645c5);}function countLinkActions(_0x4dda99){const _0x31ea9b=a36_0xc41b53;return _0x4dda99[_0x31ea9b(0x158)]((_0x592bef,_0x45d841)=>{const _0x52640b=_0x31ea9b;return _0x592bef[_0x45d841[_0x52640b(0x140)]]=(_0x592bef[_0x45d841[_0x52640b(0x140)]]??0x0)+0x1,_0x592bef;},{});}
|