@lovrabet/lovrabet-cli 2.1.22-beta.4 → 2.1.22-beta.6
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/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.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/common/local-file.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/file/index.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/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.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/diagram.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/diagram.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/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.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/rate-limit.js +1 -1
- package/lib/framework/raw-flags.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/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.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/install-target.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/lossless-json.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
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x27c684,_0x49bbca){const _0x1b4c72=a39_0x38a5,_0x34923d=_0x27c684();while(!![]){try{const _0x203471=-parseInt(_0x1b4c72(0xd3))/0x1+-parseInt(_0x1b4c72(0xe4))/0x2*(-parseInt(_0x1b4c72(0xe3))/0x3)+-parseInt(_0x1b4c72(0x10d))/0x4*(-parseInt(_0x1b4c72(0xf4))/0x5)+parseInt(_0x1b4c72(0xf6))/0x6*(parseInt(_0x1b4c72(0xd1))/0x7)+parseInt(_0x1b4c72(0x107))/0x8+-parseInt(_0x1b4c72(0xce))/0x9+-parseInt(_0x1b4c72(0xd2))/0xa;if(_0x203471===_0x49bbca)break;else _0x34923d['push'](_0x34923d['shift']());}catch(_0x2a526f){_0x34923d['push'](_0x34923d['shift']());}}}(a39_0x48c9,0x5fa55));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';function a39_0x38a5(_0x343ae1,_0xcc010a){_0x343ae1=_0x343ae1-0xb5;const _0x48c919=a39_0x48c9();let _0x38a5d5=_0x48c919[_0x343ae1];return _0x38a5d5;}function a39_0x48c9(){const _0x90a16a=['bffId','loginName','mapTo','enum','\x20requires\x20target.sqlCode.','sqlCode','cliPath','padEnd','sql','operator','json','find','context.','110100SiXPKn','10AbuQcq','Preview\x20dynamic\x20service\x20command:\x20','\x20\x20[','datasetCode','type','read','required','params','fullPath','Service\x20command\x20','service','commands','bffCode','appCode','number','\x20\x20\x20\x20kind:\x20\x20\x20\x20','837230GXORRY','scriptName','6HNfQvm','\x20service\x20detail\x20--service\x20','flags','length','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20functionName:\x20','nickName','filter','push','Unknown\x20appRef\x20\x22','envName','kind','boolean','risk','employeeId','map','command','224896BkoQhX','now','fromEntries','userId','some','code','4wDIHDy','datatable','Use\x20`','appcode','env','default','target','app','dbtableConfig','\x20requires\x20target.functionName.','\x22\x20in\x20service\x20command\x20','const','\x20\x20SERVICE\x20TREE\x20TARGET','trim','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','source','tenantCode','userName','flatMap','validation','\x20->\x20','bff','slice','name','\x20<command>\x20[flags]','\x20\x20\x20\x20sqlCode:\x20','tableName','join','\x20completed\x20in\x20','rawFlags','remainingArgs','Run\x20service\x20command\x20','startsWith','appBindings','entries','string','1992636BCvzXG','data','\x20\x20\x20\x20command:\x20','3374203FLJmNy','1970120RDvQea','50906QUKTlm','nickname','tree'];a39_0x48c9=function(){return _0x90a16a;};return a39_0x48c9();}export function resolveDynamicServiceCommand(_0x338b16,_0x5c2040){const _0x37e1e8=a39_0x38a5,_0x460bee=listLocalServiceTrees();let _0x6694b0;for(const _0xb6b68b of _0x460bee){const _0x2a31ca=matchServiceTreeCommand(_0xb6b68b,_0x338b16);if(!_0x2a31ca)continue;(!_0x6694b0||_0x2a31ca[_0x37e1e8(0x106)]['fullPath'][_0x37e1e8(0xf9)]>_0x6694b0[_0x37e1e8(0x106)][_0x37e1e8(0xec)][_0x37e1e8(0xf9)])&&(_0x6694b0={'tree':_0xb6b68b,'command':_0x2a31ca[_0x37e1e8(0x106)],'remainingArgs':_0x2a31ca[_0x37e1e8(0xc8)]});}if(!_0x6694b0)return undefined;const _0x23e1ec={..._0x5c2040};return applyAppBinding(_0x6694b0['tree'],_0x6694b0[_0x37e1e8(0x106)],_0x23e1ec),{'definition':buildDynamicCommandDefinition(_0x6694b0[_0x37e1e8(0xd5)],_0x6694b0[_0x37e1e8(0x106)]),'args':_0x6694b0[_0x37e1e8(0xc8)],'flags':_0x23e1ec,'tree':_0x6694b0[_0x37e1e8(0xd5)],'command':_0x6694b0[_0x37e1e8(0x106)]};}export function generateDynamicServiceHelp(_0x256886){const _0x45d745=a39_0x38a5,_0x229fc5=listLocalServiceTrees()['find'](_0x3c2844=>_0x3c2844['service'][_0x45d745(0x10c)]===_0x256886);if(!_0x229fc5)return undefined;const _0x551187=[CLI_BIN_NAME+'\x20'+_0x256886+_0x45d745(0xc2),'',_0x229fc5[_0x45d745(0xee)][_0x45d745(0xc1)]||_0x256886,_0x229fc5['service']['description']?'\x20\x20'+_0x229fc5[_0x45d745(0xee)]['description']:'','','Commands:',..._0x229fc5[_0x45d745(0xef)][_0x45d745(0x105)](_0x39250b=>{const _0x1d64fc=_0x45d745,_0x4c0c85=_0x39250b[_0x1d64fc(0xec)][_0x1d64fc(0xc0)](0x1)[_0x1d64fc(0xc5)]('\x20'),_0x5c8c7c=_0x39250b['risk']==='read'?'':'\x20['+_0x39250b[_0x1d64fc(0x103)]+']';return'\x20\x20'+_0x4c0c85[_0x1d64fc(0xdd)](0x18)+'\x20'+(_0x39250b['description']||'')+_0x5c8c7c;}),'',_0x45d745(0x10f)+CLI_BIN_NAME+_0x45d745(0xf7)+_0x256886+'`\x20to\x20inspect\x20the\x20manifest.'][_0x45d745(0xfd)](Boolean);return _0x551187['join']('\x0a');}export function listDynamicServiceEntries(){const _0x417d3e=a39_0x38a5;return listLocalServices()[_0x417d3e(0x105)](_0x20d53e=>{const _0x365494=_0x417d3e,_0xeeaf2f=_0x20d53e['normalizedManifest'];return{'service':_0xeeaf2f[_0x365494(0xee)][_0x365494(0x10c)],'label':_0xeeaf2f['service'][_0x365494(0xc1)]||_0xeeaf2f[_0x365494(0xee)][_0x365494(0x10c)],'commands':_0xeeaf2f['commands'][_0x365494(0x105)](_0x439890=>({'command':dynamicCommandName(_0x439890),'description':_0x439890['description']||_0x365494(0xc9)+_0x439890[_0x365494(0xdc)],'tag':riskTag(_0x439890[_0x365494(0x103)])}))};});}export function getDynamicServiceEntry(_0x5c429c){const _0x2c2332=a39_0x38a5;return listDynamicServiceEntries()['find'](_0x59956b=>_0x59956b[_0x2c2332(0xee)]===_0x5c429c);}export function listDynamicServiceDefinitions(_0x5c8080){const _0x409389=a39_0x38a5;return listLocalServiceTrees()[_0x409389(0xfd)](_0x2230dd=>!_0x5c8080||_0x2230dd['service']['code']===_0x5c8080)[_0x409389(0xbc)](_0x58bca3=>_0x58bca3[_0x409389(0xef)][_0x409389(0x105)](_0x7b3b29=>buildDynamicCommandDefinition(_0x58bca3,_0x7b3b29)));}export function getDynamicServiceDefinitions(_0x432630){const _0x3794ad=listDynamicServiceDefinitions(_0x432630);return _0x3794ad['length']>0x0?_0x3794ad:undefined;}export function findDynamicServiceDefinition(_0x123734,_0x30f7a0){const _0x36e33d=a39_0x38a5;return listDynamicServiceDefinitions(_0x123734)['find'](_0xc3444d=>_0xc3444d[_0x36e33d(0x106)]===_0x30f7a0);}export function buildDynamicCommandDefinition(_0x3f79e9,_0x3a558e){const _0x387e73=a39_0x38a5;return{'service':_0x3f79e9[_0x387e73(0xee)][_0x387e73(0x10c)],'command':dynamicCommandName(_0x3a558e),'description':_0x3a558e['description']||_0x387e73(0xc9)+_0x3a558e[_0x387e73(0xdc)],'risk':_0x3a558e[_0x387e73(0x103)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3a558e['args'][_0x387e73(0x105)](_0xcbd39e=>({'name':_0xcbd39e[_0x387e73(0xc1)],'description':_0xcbd39e['description']||_0xcbd39e[_0x387e73(0xc1)],'required':_0xcbd39e['required']})),'flags':_0x3a558e[_0x387e73(0xf8)][_0x387e73(0x105)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3a558e),async 'dryRun'(_0x3f01af){const _0x469379=_0x387e73,_0x1de40=await compilePlan(_0x3a558e,_0x3f01af);return{'method':'SERVICE_TREE','url':_0x3a558e[_0x469379(0xdc)],'body':{'target':targetPreview(_0x1de40),'params':_0x1de40[_0x469379(0xeb)]},'description':_0x469379(0xe5)+_0x3a558e[_0x469379(0xdc)]};},async 'execute'(_0x51b6b9){const _0x23d78a=_0x387e73,_0x39ee5b=await compilePlan(_0x3a558e,_0x51b6b9),_0x43443c=Date[_0x23d78a(0x108)](),_0x43afa5=await executePlan(_0x39ee5b,_0x3a558e,_0x51b6b9),_0x4308cf=Date['now']()-_0x43443c;return{'ok':!![],'data':{'service':_0x3f79e9[_0x23d78a(0xee)],'command':_0x3a558e[_0x23d78a(0xdc)],'target':targetPreview(_0x39ee5b),'result':_0x43afa5,'elapsed':_0x4308cf},'message':_0x23d78a(0xed)+_0x3a558e[_0x23d78a(0xdc)]+_0x23d78a(0xc6)+_0x4308cf+'ms'};}};}function dynamicCommandName(_0x50ea64){const _0x311093=a39_0x38a5;return _0x50ea64[_0x311093(0xec)][_0x311093(0xc0)](0x1)['join']('\x20');}function riskTag(_0x18ef1d){const _0x4fef94=a39_0x38a5;return _0x18ef1d===_0x4fef94(0xe9)?'':_0x4fef94(0xe6)+_0x18ef1d+']';}function flagToCommandFlag(_0x21d798){const _0x33bca5=a39_0x38a5;return{'name':_0x21d798['cliName'],'type':_0x21d798[_0x33bca5(0xe8)]===_0x33bca5(0xe0)?_0x33bca5(0xcd):_0x21d798[_0x33bca5(0xe8)],'description':_0x21d798['description']||_0x21d798[_0x33bca5(0xc1)],'required':_0x21d798[_0x33bca5(0xea)],'default':isPrimitiveFlagDefault(_0x21d798['default'])?_0x21d798[_0x33bca5(0x112)]:undefined,'enum':_0x21d798[_0x33bca5(0xd9)]};}async function compilePlan(_0x430a84,_0x5b4ec9){const _0xe1ab0b=a39_0x38a5;return compileServiceTreeCommand(_0x430a84,{'flags':_0x5b4ec9[_0xe1ab0b(0xc7)],'args':_0x5b4ec9['args'],'context':await buildServiceContext(_0x430a84,_0x5b4ec9)});}async function buildServiceContext(_0x20391a,_0x44d481){const _0x3e33d1=a39_0x38a5,_0x1840a6={'appCode':_0x44d481[_0x3e33d1(0xf1)],'env':_0x44d481[_0x3e33d1(0x100)],'envName':_0x44d481[_0x3e33d1(0x100)]};if(!usesRuntimeContext(_0x20391a))return _0x1840a6;const _0x4276c9=await getLoginUserInfo(),_0x276d42=pickFirst(_0x4276c9[_0x3e33d1(0x10a)],_0x4276c9['id']);return{..._0x1840a6,'user':_0x4276c9,'userId':_0x276d42,'id':_0x4276c9['id'],'username':pickFirst(_0x4276c9['username'],_0x4276c9[_0x3e33d1(0xbb)],_0x4276c9[_0x3e33d1(0xd7)]),'userName':_0x4276c9[_0x3e33d1(0xbb)],'nickname':pickFirst(_0x4276c9[_0x3e33d1(0xd4)],_0x4276c9['nickName']),'nickName':_0x4276c9[_0x3e33d1(0xfc)],'tenantCode':_0x4276c9[_0x3e33d1(0xba)],'employeeId':_0x4276c9[_0x3e33d1(0x104)]};}function usesRuntimeContext(_0x2d9089){const _0x38c08e=a39_0x38a5;return _0x2d9089[_0x38c08e(0xd8)][_0x38c08e(0x10b)](_0x35faba=>typeof _0x35faba[_0x38c08e(0xb9)]===_0x38c08e(0xcd)&&(_0x35faba[_0x38c08e(0xb9)]['startsWith'](_0x38c08e(0xe2))||_0x35faba['source'][_0x38c08e(0xca)]('ctx.')));}function pickFirst(..._0x2e19e6){const _0x3d7356=a39_0x38a5;return _0x2e19e6[_0x3d7356(0xe1)](_0x43a970=>_0x43a970!==undefined&&_0x43a970!==null);}async function executePlan(_0x5d2587,_0x2faafb,_0xa5cbed){const _0x466e9a=a39_0x38a5;if(_0x5d2587[_0x466e9a(0x101)]===_0x466e9a(0xcf)){const _0x99fa3d=await resolveDatasetCode(_0x5d2587,_0x2faafb,_0xa5cbed);return executeData(_0x99fa3d,_0x5d2587['command'],_0x5d2587[_0x466e9a(0xeb)]);}if(_0x5d2587['kind']===_0x466e9a(0xde)){if(!_0x5d2587['sqlCode'])throw CliErrors['validation'](_0x466e9a(0xed)+_0x2faafb[_0x466e9a(0xdc)]+_0x466e9a(0xda));return executeSdkSql(_0x5d2587['sqlCode'],normalizeScalarParams(_0x5d2587['params']));}if(_0x5d2587[_0x466e9a(0x101)]===_0x466e9a(0xbf)){const _0x68548f=_0x5d2587[_0x466e9a(0xf5)]||_0x5d2587[_0x466e9a(0xf0)]||(_0x5d2587['bffId']==null?'':String(_0x5d2587['bffId']));if(!_0x68548f)throw CliErrors[_0x466e9a(0xbd)]('Service\x20command\x20'+_0x2faafb['cliPath']+_0x466e9a(0x116));return executeSdkBff(_0x68548f,_0x5d2587[_0x466e9a(0xeb)]);}throw CliErrors[_0x466e9a(0xbd)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x5d2587[_0x466e9a(0x101)]);}async function resolveDatasetCode(_0x32569a,_0x303a12,_0x1f6d2c){const _0x1e0d79=a39_0x38a5;if(_0x32569a[_0x1e0d79(0xe7)])return _0x32569a[_0x1e0d79(0xe7)];if(!_0x32569a[_0x1e0d79(0x10e)])throw CliErrors[_0x1e0d79(0xbd)]('Service\x20command\x20'+_0x303a12[_0x1e0d79(0xdc)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x3f5dd8=await listDatasets(_0x1f6d2c[_0x1e0d79(0xf1)]),_0x9b2ec2=_0x3f5dd8['find'](_0x5a5900=>_0x5a5900[_0x1e0d79(0x115)]?.[_0x1e0d79(0xc4)]===_0x32569a[_0x1e0d79(0x10e)]);if(!_0x9b2ec2?.[_0x1e0d79(0x10c)])throw CliErrors[_0x1e0d79(0xbd)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x32569a[_0x1e0d79(0x10e)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1f6d2c[_0x1e0d79(0xf1)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x9b2ec2[_0x1e0d79(0x10c)];}function applyAppBinding(_0x1bbbb3,_0x29abcc,_0x1b89f7){const _0x42aa88=a39_0x38a5,_0x3440de=_0x29abcc[_0x42aa88(0x113)]['appRef'];if(!_0x3440de)return;const _0x56e1f2=_0x1bbbb3[_0x42aa88(0xcb)][_0x3440de];if(!_0x56e1f2)throw CliErrors[_0x42aa88(0xbd)](_0x42aa88(0xff)+_0x3440de+_0x42aa88(0x117)+_0x29abcc[_0x42aa88(0xdc)]+'.',_0x42aa88(0xb8));const _0x1b9b3c=_0x56e1f2[_0x42aa88(0x110)]||_0x56e1f2[_0x42aa88(0xf1)];_0x1b9b3c&&!hasText(_0x1b89f7[_0x42aa88(0x110)])&&(_0x1b89f7[_0x42aa88(0x110)]=_0x1b9b3c),_0x56e1f2[_0x42aa88(0x114)]&&!hasText(_0x1b89f7['app'])&&!hasText(_0x1b89f7[_0x42aa88(0x110)])&&(_0x1b89f7['app']=_0x56e1f2[_0x42aa88(0x114)]),_0x56e1f2[_0x42aa88(0x111)]&&!hasText(_0x1b89f7[_0x42aa88(0x111)])&&(_0x1b89f7['env']=_0x56e1f2[_0x42aa88(0x111)]);}function renderDynamicCommandHelp(_0x54f7c6){const _0x504c0a=a39_0x38a5,_0x5b1ff7=[_0x504c0a(0xb6),_0x504c0a(0xf3)+_0x54f7c6[_0x504c0a(0x113)]['kind'],_0x504c0a(0xd0)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x106)]];if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xe7)])_0x5b1ff7['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xe7)]);if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x10e)])_0x5b1ff7[_0x504c0a(0xfe)](_0x504c0a(0xfa)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0x10e)]);if(_0x54f7c6[_0x504c0a(0x113)]['sqlCode'])_0x5b1ff7['push'](_0x504c0a(0xc3)+_0x54f7c6['target'][_0x504c0a(0xdb)]);if(_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xf5)])_0x5b1ff7[_0x504c0a(0xfe)](_0x504c0a(0xfb)+_0x54f7c6[_0x504c0a(0x113)][_0x504c0a(0xf5)]);if(_0x54f7c6['mapTo'][_0x504c0a(0xf9)]>0x0){_0x5b1ff7[_0x504c0a(0xfe)]('','\x20\x20MAP\x20TO');for(const _0x34f0cf of _0x54f7c6[_0x504c0a(0xd8)]){_0x5b1ff7[_0x504c0a(0xfe)]('\x20\x20\x20\x20'+(_0x34f0cf['source']||_0x504c0a(0xb5))+_0x504c0a(0xbe)+_0x34f0cf['target']+(_0x34f0cf[_0x504c0a(0xdf)]?'.'+_0x34f0cf['operator']:''));}}return _0x5b1ff7[_0x504c0a(0xc5)]('\x0a');}function targetPreview(_0x3509a3){const _0x1c52dd=a39_0x38a5;return{'kind':_0x3509a3[_0x1c52dd(0x101)],'command':_0x3509a3[_0x1c52dd(0x106)],'appRef':_0x3509a3['appRef'],'datasetCode':_0x3509a3['datasetCode'],'datatable':_0x3509a3[_0x1c52dd(0x10e)],'sqlCode':_0x3509a3[_0x1c52dd(0xdb)],'bffCode':_0x3509a3[_0x1c52dd(0xf0)],'bffId':_0x3509a3[_0x1c52dd(0xd6)],'functionName':_0x3509a3[_0x1c52dd(0xf5)]};}function normalizeScalarParams(_0x5b8f9c){const _0x425178=a39_0x38a5;return Object[_0x425178(0x109)](Object[_0x425178(0xcc)](_0x5b8f9c)['filter'](([,_0x542051])=>typeof _0x542051===_0x425178(0xcd)||typeof _0x542051===_0x425178(0xf2)));}function hasText(_0x5c2023){const _0x6bb6f6=a39_0x38a5;return typeof _0x5c2023===_0x6bb6f6(0xcd)&&_0x5c2023[_0x6bb6f6(0xb7)]()[_0x6bb6f6(0xf9)]>0x0;}function isPrimitiveFlagDefault(_0x2fe758){const _0x501f7c=a39_0x38a5;return _0x2fe758===undefined||typeof _0x2fe758===_0x501f7c(0xcd)||typeof _0x2fe758===_0x501f7c(0xf2)||typeof _0x2fe758===_0x501f7c(0x102);}
|
|
1
|
+
function a39_0x5ddf(_0x2a6d4f,_0xf45866){_0x2a6d4f=_0x2a6d4f-0x88;const _0x4a410e=a39_0x4a41();let _0x5ddfd7=_0x4a410e[_0x2a6d4f];return _0x5ddfd7;}(function(_0x1c9dc2,_0x2ab9de){const _0x24b496=a39_0x5ddf,_0x16f8e4=_0x1c9dc2();while(!![]){try{const _0x13f870=-parseInt(_0x24b496(0xb5))/0x1*(parseInt(_0x24b496(0xaf))/0x2)+-parseInt(_0x24b496(0xa9))/0x3*(-parseInt(_0x24b496(0xce))/0x4)+-parseInt(_0x24b496(0xe8))/0x5*(-parseInt(_0x24b496(0xe4))/0x6)+parseInt(_0x24b496(0xa4))/0x7*(parseInt(_0x24b496(0x8d))/0x8)+parseInt(_0x24b496(0xc1))/0x9+-parseInt(_0x24b496(0xd5))/0xa*(parseInt(_0x24b496(0xd1))/0xb)+parseInt(_0x24b496(0xba))/0xc;if(_0x13f870===_0x2ab9de)break;else _0x16f8e4['push'](_0x16f8e4['shift']());}catch(_0x4d4a5){_0x16f8e4['push'](_0x16f8e4['shift']());}}}(a39_0x4a41,0x89029));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(_0x42b934,_0x43c862){const _0x2dc75e=a39_0x5ddf,_0x3a6336=listLocalServiceTrees();let _0x3ef7dd;for(const _0x5620c5 of _0x3a6336){const _0x3ef492=matchServiceTreeCommand(_0x5620c5,_0x42b934);if(!_0x3ef492)continue;(!_0x3ef7dd||_0x3ef492[_0x2dc75e(0xe1)][_0x2dc75e(0xe3)][_0x2dc75e(0xe5)]>_0x3ef7dd['command'][_0x2dc75e(0xe3)][_0x2dc75e(0xe5)])&&(_0x3ef7dd={'tree':_0x5620c5,'command':_0x3ef492[_0x2dc75e(0xe1)],'remainingArgs':_0x3ef492[_0x2dc75e(0x88)]});}if(!_0x3ef7dd)return undefined;const _0x404c0f={..._0x43c862};return applyAppBinding(_0x3ef7dd[_0x2dc75e(0xdd)],_0x3ef7dd[_0x2dc75e(0xe1)],_0x404c0f),{'definition':buildDynamicCommandDefinition(_0x3ef7dd[_0x2dc75e(0xdd)],_0x3ef7dd['command']),'args':_0x3ef7dd[_0x2dc75e(0x88)],'flags':_0x404c0f,'tree':_0x3ef7dd['tree'],'command':_0x3ef7dd[_0x2dc75e(0xe1)]};}export function generateDynamicServiceHelp(_0x1146f4){const _0x463f33=a39_0x5ddf,_0x4fcab7=listLocalServiceTrees()['find'](_0x19cba4=>_0x19cba4['service']['code']===_0x1146f4);if(!_0x4fcab7)return undefined;const _0x1e281a=[CLI_BIN_NAME+'\x20'+_0x1146f4+'\x20<command>\x20[flags]','',_0x4fcab7['service'][_0x463f33(0xb4)]||_0x1146f4,_0x4fcab7[_0x463f33(0xc5)]['description']?'\x20\x20'+_0x4fcab7[_0x463f33(0xc5)][_0x463f33(0xb1)]:'','','Commands:',..._0x4fcab7[_0x463f33(0xaa)][_0x463f33(0xca)](_0x532d7d=>{const _0x4f5801=_0x463f33,_0x5af210=_0x532d7d[_0x4f5801(0xe3)][_0x4f5801(0xa2)](0x1)['join']('\x20'),_0x5d2a37=_0x532d7d[_0x4f5801(0xb9)]===_0x4f5801(0xe9)?'':'\x20['+_0x532d7d[_0x4f5801(0xb9)]+']';return'\x20\x20'+_0x5af210[_0x4f5801(0xad)](0x18)+'\x20'+(_0x532d7d[_0x4f5801(0xb1)]||'')+_0x5d2a37;}),'',_0x463f33(0xcb)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x1146f4+'`\x20to\x20inspect\x20the\x20manifest.'][_0x463f33(0xab)](Boolean);return _0x1e281a[_0x463f33(0xbc)]('\x0a');}export function listDynamicServiceEntries(){const _0x5b85f9=a39_0x5ddf;return listLocalServices()[_0x5b85f9(0xca)](_0x57f839=>{const _0x5d3fa1=_0x5b85f9,_0x25fda3=_0x57f839[_0x5d3fa1(0x98)];return{'service':_0x25fda3['service'][_0x5d3fa1(0xbf)],'label':_0x25fda3[_0x5d3fa1(0xc5)][_0x5d3fa1(0xb4)]||_0x25fda3[_0x5d3fa1(0xc5)][_0x5d3fa1(0xbf)],'commands':_0x25fda3[_0x5d3fa1(0xaa)][_0x5d3fa1(0xca)](_0x16e202=>({'command':dynamicCommandName(_0x16e202),'description':_0x16e202[_0x5d3fa1(0xb1)]||_0x5d3fa1(0xd9)+_0x16e202['cliPath'],'tag':riskTag(_0x16e202[_0x5d3fa1(0xb9)])}))};});}function a39_0x4a41(){const _0x2e1c27=['json','Preview\x20dynamic\x20service\x20command:\x20','\x22\x20in\x20service\x20command\x20','trim','app','Unsupported\x20service\x20target\x20kind:\x20','normalizedManifest','find','context.','\x20requires\x20target.functionName.','nickName','string','appcode','appRef','kind','startsWith','slice','tableName','344988gueufr','operator','args','number','tenantCode','3UKjcam','commands','filter','const','padEnd','\x20\x20MAP\x20TO','1733288VeadVd','scriptName','description','cliName','validation','name','1fFZBwv','\x20\x20\x20\x20datasetCode:\x20','\x20\x20[','datatable','risk','591504VsVBGe','datasetCode','join','\x20\x20\x20\x20datatable:\x20','\x20requires\x20target.sqlCode.','code','\x20->\x20','3007836CAZXtQ','\x20\x20\x20\x20','flatMap','type','service','enum','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','ctx.','bffId','map','Use\x20`','appBindings','source','1317340rNXkmc','Service\x20command\x20','bffCode','33KUFkro','env','\x20\x20\x20\x20functionName:\x20','username','1894910MDAZfM','\x20\x20\x20\x20kind:\x20\x20\x20\x20','now','data','Run\x20service\x20command\x20','push','userName','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','tree','cliPath','mapTo','target','command','appCode','fullPath','6jWxyLd','length','loginName','\x20completed\x20in\x20','5431715iZvKaC','read','default','remainingArgs','required','userId','sqlCode','\x20\x20SERVICE\x20TREE\x20TARGET','32asXlAD','\x20\x20\x20\x20command:\x20','envName','bff','params'];a39_0x4a41=function(){return _0x2e1c27;};return a39_0x4a41();}export function getDynamicServiceEntry(_0x3f0508){const _0x5b82fb=a39_0x5ddf;return listDynamicServiceEntries()[_0x5b82fb(0x99)](_0x4298a0=>_0x4298a0[_0x5b82fb(0xc5)]===_0x3f0508);}export function listDynamicServiceDefinitions(_0x470a9b){const _0x32f319=a39_0x5ddf;return listLocalServiceTrees()[_0x32f319(0xab)](_0x253d31=>!_0x470a9b||_0x253d31[_0x32f319(0xc5)]['code']===_0x470a9b)[_0x32f319(0xc3)](_0x415abe=>_0x415abe['commands'][_0x32f319(0xca)](_0x3ae928=>buildDynamicCommandDefinition(_0x415abe,_0x3ae928)));}export function getDynamicServiceDefinitions(_0x4d680b){const _0x174a55=a39_0x5ddf,_0x2de3c4=listDynamicServiceDefinitions(_0x4d680b);return _0x2de3c4[_0x174a55(0xe5)]>0x0?_0x2de3c4:undefined;}export function findDynamicServiceDefinition(_0xaaebd8,_0x22f6ee){const _0x492506=a39_0x5ddf;return listDynamicServiceDefinitions(_0xaaebd8)[_0x492506(0x99)](_0x2a36cc=>_0x2a36cc['command']===_0x22f6ee);}export function buildDynamicCommandDefinition(_0x3fd6cb,_0x3d7d38){const _0x266bd9=a39_0x5ddf;return{'service':_0x3fd6cb[_0x266bd9(0xc5)][_0x266bd9(0xbf)],'command':dynamicCommandName(_0x3d7d38),'description':_0x3d7d38[_0x266bd9(0xb1)]||_0x266bd9(0xd9)+_0x3d7d38['cliPath'],'risk':_0x3d7d38['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3d7d38[_0x266bd9(0xa6)][_0x266bd9(0xca)](_0x11c28f=>({'name':_0x11c28f[_0x266bd9(0xb4)],'description':_0x11c28f[_0x266bd9(0xb1)]||_0x11c28f[_0x266bd9(0xb4)],'required':_0x11c28f[_0x266bd9(0x89)]})),'flags':_0x3d7d38['flags'][_0x266bd9(0xca)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3d7d38),async 'dryRun'(_0x3f3d5e){const _0x2774af=_0x266bd9,_0x3cd15c=await compilePlan(_0x3d7d38,_0x3f3d5e);return{'method':'SERVICE_TREE','url':_0x3d7d38[_0x2774af(0xde)],'body':{'target':targetPreview(_0x3cd15c),'params':_0x3cd15c['params']},'description':_0x2774af(0x93)+_0x3d7d38[_0x2774af(0xde)]};},async 'execute'(_0x2b2131){const _0x310a23=_0x266bd9,_0x50b5b5=await compilePlan(_0x3d7d38,_0x2b2131),_0x58c36e=Date[_0x310a23(0xd7)](),_0x22793b=await executePlan(_0x50b5b5,_0x3d7d38,_0x2b2131),_0x407553=Date[_0x310a23(0xd7)]()-_0x58c36e;return{'ok':!![],'data':{'service':_0x3fd6cb['service'],'command':_0x3d7d38[_0x310a23(0xde)],'target':targetPreview(_0x50b5b5),'result':_0x22793b,'elapsed':_0x407553},'message':_0x310a23(0xcf)+_0x3d7d38[_0x310a23(0xde)]+_0x310a23(0xe7)+_0x407553+'ms'};}};}function dynamicCommandName(_0x4b8e89){const _0x12c078=a39_0x5ddf;return _0x4b8e89[_0x12c078(0xe3)][_0x12c078(0xa2)](0x1)[_0x12c078(0xbc)]('\x20');}function riskTag(_0x101082){const _0x427967=a39_0x5ddf;return _0x101082===_0x427967(0xe9)?'':_0x427967(0xb7)+_0x101082+']';}function flagToCommandFlag(_0x56767f){const _0x1f2347=a39_0x5ddf;return{'name':_0x56767f[_0x1f2347(0xb2)],'type':_0x56767f['type']===_0x1f2347(0x92)?'string':_0x56767f[_0x1f2347(0xc4)],'description':_0x56767f[_0x1f2347(0xb1)]||_0x56767f[_0x1f2347(0xb4)],'required':_0x56767f[_0x1f2347(0x89)],'default':isPrimitiveFlagDefault(_0x56767f['default'])?_0x56767f[_0x1f2347(0xea)]:undefined,'enum':_0x56767f[_0x1f2347(0xc6)]};}async function compilePlan(_0x11b480,_0x334fc8){const _0x11e9f2=a39_0x5ddf;return compileServiceTreeCommand(_0x11b480,{'flags':_0x334fc8['rawFlags'],'args':_0x334fc8[_0x11e9f2(0xa6)],'context':await buildServiceContext(_0x11b480,_0x334fc8)});}async function buildServiceContext(_0xadc40d,_0x2a967b){const _0x327178=a39_0x5ddf,_0xa6b00={'appCode':_0x2a967b[_0x327178(0xe2)],'env':_0x2a967b[_0x327178(0x8f)],'envName':_0x2a967b[_0x327178(0x8f)]};if(!usesRuntimeContext(_0xadc40d))return _0xa6b00;const _0x5134db=await getLoginUserInfo(),_0xaf1842=pickFirst(_0x5134db[_0x327178(0x8a)],_0x5134db['id']);return{..._0xa6b00,'user':_0x5134db,'userId':_0xaf1842,'id':_0x5134db['id'],'username':pickFirst(_0x5134db[_0x327178(0xd4)],_0x5134db[_0x327178(0xdb)],_0x5134db[_0x327178(0xe6)]),'userName':_0x5134db[_0x327178(0xdb)],'nickname':pickFirst(_0x5134db['nickname'],_0x5134db[_0x327178(0x9c)]),'nickName':_0x5134db[_0x327178(0x9c)],'tenantCode':_0x5134db[_0x327178(0xa8)],'employeeId':_0x5134db['employeeId']};}function usesRuntimeContext(_0x5b692b){const _0x1cd7c9=a39_0x5ddf;return _0x5b692b['mapTo']['some'](_0x42707a=>typeof _0x42707a[_0x1cd7c9(0xcd)]===_0x1cd7c9(0x9d)&&(_0x42707a[_0x1cd7c9(0xcd)][_0x1cd7c9(0xa1)](_0x1cd7c9(0x9a))||_0x42707a[_0x1cd7c9(0xcd)][_0x1cd7c9(0xa1)](_0x1cd7c9(0xc8))));}function pickFirst(..._0x33efd2){const _0x4047f3=a39_0x5ddf;return _0x33efd2[_0x4047f3(0x99)](_0x1175f2=>_0x1175f2!==undefined&&_0x1175f2!==null);}async function executePlan(_0x114fd5,_0x506aad,_0xcec7f4){const _0x8466f8=a39_0x5ddf;if(_0x114fd5['kind']===_0x8466f8(0xd8)){const _0x15a94b=await resolveDatasetCode(_0x114fd5,_0x506aad,_0xcec7f4);return executeData(_0x15a94b,_0x114fd5[_0x8466f8(0xe1)],_0x114fd5['params']);}if(_0x114fd5[_0x8466f8(0xa0)]==='sql'){if(!_0x114fd5['sqlCode'])throw CliErrors['validation'](_0x8466f8(0xcf)+_0x506aad[_0x8466f8(0xde)]+_0x8466f8(0xbe));return executeSdkSql(_0x114fd5[_0x8466f8(0x8b)],normalizeScalarParams(_0x114fd5[_0x8466f8(0x91)]));}if(_0x114fd5[_0x8466f8(0xa0)]===_0x8466f8(0x90)){const _0x1fd702=_0x114fd5[_0x8466f8(0xb0)]||_0x114fd5['bffCode']||(_0x114fd5[_0x8466f8(0xc9)]==null?'':String(_0x114fd5['bffId']));if(!_0x1fd702)throw CliErrors[_0x8466f8(0xb3)](_0x8466f8(0xcf)+_0x506aad['cliPath']+_0x8466f8(0x9b));return executeSdkBff(_0x1fd702,_0x114fd5['params']);}throw CliErrors['validation'](_0x8466f8(0x97)+_0x114fd5[_0x8466f8(0xa0)]);}async function resolveDatasetCode(_0x3f1251,_0x320e69,_0xb18840){const _0x5be7b2=a39_0x5ddf;if(_0x3f1251[_0x5be7b2(0xbb)])return _0x3f1251[_0x5be7b2(0xbb)];if(!_0x3f1251[_0x5be7b2(0xb8)])throw CliErrors[_0x5be7b2(0xb3)](_0x5be7b2(0xcf)+_0x320e69['cliPath']+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x66a94c=await listDatasets(_0xb18840[_0x5be7b2(0xe2)]),_0x307c6a=_0x66a94c[_0x5be7b2(0x99)](_0x27ea13=>_0x27ea13['dbtableConfig']?.[_0x5be7b2(0xa3)]===_0x3f1251['datatable']);if(!_0x307c6a?.[_0x5be7b2(0xbf)])throw CliErrors['validation']('Cannot\x20resolve\x20datatable\x20\x22'+_0x3f1251['datatable']+_0x5be7b2(0xdc)+_0xb18840[_0x5be7b2(0xe2)]+'.',_0x5be7b2(0xc7));return _0x307c6a[_0x5be7b2(0xbf)];}function applyAppBinding(_0x5532e7,_0x5cfc5c,_0x23a69e){const _0x8b6351=a39_0x5ddf,_0x8b98ea=_0x5cfc5c['target'][_0x8b6351(0x9f)];if(!_0x8b98ea)return;const _0x1607d0=_0x5532e7[_0x8b6351(0xcc)][_0x8b98ea];if(!_0x1607d0)throw CliErrors['validation']('Unknown\x20appRef\x20\x22'+_0x8b98ea+_0x8b6351(0x94)+_0x5cfc5c[_0x8b6351(0xde)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x4816b7=_0x1607d0[_0x8b6351(0x9e)]||_0x1607d0[_0x8b6351(0xe2)];_0x4816b7&&!hasText(_0x23a69e[_0x8b6351(0x9e)])&&(_0x23a69e[_0x8b6351(0x9e)]=_0x4816b7),_0x1607d0['app']&&!hasText(_0x23a69e[_0x8b6351(0x96)])&&!hasText(_0x23a69e[_0x8b6351(0x9e)])&&(_0x23a69e['app']=_0x1607d0[_0x8b6351(0x96)]),_0x1607d0[_0x8b6351(0xd2)]&&!hasText(_0x23a69e[_0x8b6351(0xd2)])&&(_0x23a69e[_0x8b6351(0xd2)]=_0x1607d0[_0x8b6351(0xd2)]);}function renderDynamicCommandHelp(_0x5450b7){const _0x185671=a39_0x5ddf,_0x2112a3=[_0x185671(0x8c),_0x185671(0xd6)+_0x5450b7['target']['kind'],_0x185671(0x8e)+_0x5450b7[_0x185671(0xe0)][_0x185671(0xe1)]];if(_0x5450b7[_0x185671(0xe0)][_0x185671(0xbb)])_0x2112a3[_0x185671(0xda)](_0x185671(0xb6)+_0x5450b7[_0x185671(0xe0)][_0x185671(0xbb)]);if(_0x5450b7[_0x185671(0xe0)]['datatable'])_0x2112a3[_0x185671(0xda)](_0x185671(0xbd)+_0x5450b7[_0x185671(0xe0)]['datatable']);if(_0x5450b7['target']['sqlCode'])_0x2112a3[_0x185671(0xda)]('\x20\x20\x20\x20sqlCode:\x20'+_0x5450b7['target'][_0x185671(0x8b)]);if(_0x5450b7['target']['scriptName'])_0x2112a3[_0x185671(0xda)](_0x185671(0xd3)+_0x5450b7[_0x185671(0xe0)]['scriptName']);if(_0x5450b7[_0x185671(0xdf)][_0x185671(0xe5)]>0x0){_0x2112a3[_0x185671(0xda)]('',_0x185671(0xae));for(const _0x322a05 of _0x5450b7[_0x185671(0xdf)]){_0x2112a3[_0x185671(0xda)](_0x185671(0xc2)+(_0x322a05[_0x185671(0xcd)]||_0x185671(0xac))+_0x185671(0xc0)+_0x322a05['target']+(_0x322a05[_0x185671(0xa5)]?'.'+_0x322a05[_0x185671(0xa5)]:''));}}return _0x2112a3[_0x185671(0xbc)]('\x0a');}function targetPreview(_0x5ba518){const _0x3e0e07=a39_0x5ddf;return{'kind':_0x5ba518[_0x3e0e07(0xa0)],'command':_0x5ba518['command'],'appRef':_0x5ba518['appRef'],'datasetCode':_0x5ba518[_0x3e0e07(0xbb)],'datatable':_0x5ba518['datatable'],'sqlCode':_0x5ba518[_0x3e0e07(0x8b)],'bffCode':_0x5ba518[_0x3e0e07(0xd0)],'bffId':_0x5ba518[_0x3e0e07(0xc9)],'functionName':_0x5ba518[_0x3e0e07(0xb0)]};}function normalizeScalarParams(_0x267d07){const _0x676b97=a39_0x5ddf;return Object['fromEntries'](Object['entries'](_0x267d07)[_0x676b97(0xab)](([,_0x42159b])=>typeof _0x42159b===_0x676b97(0x9d)||typeof _0x42159b===_0x676b97(0xa7)));}function hasText(_0x47fbb2){const _0x1126d1=a39_0x5ddf;return typeof _0x47fbb2===_0x1126d1(0x9d)&&_0x47fbb2[_0x1126d1(0x95)]()[_0x1126d1(0xe5)]>0x0;}function isPrimitiveFlagDefault(_0x32e046){const _0x1dd327=a39_0x5ddf;return _0x32e046===undefined||typeof _0x32e046==='string'||typeof _0x32e046===_0x1dd327(0xa7)||typeof _0x32e046==='boolean';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a40_0x27a5(){const _0x6d052d=['24ilKTSL','.resources','functionName','1778LTyNwx','commands','31yaSmHr','push','error','367675cXbxKp','bff.exec','string','8280441nAqFcv','$.resources','prototype','isArray','actions','.functionName','object','5139147zpspNl','forEach','.target','33288600gUtKKK','$.commands[','hasOwnProperty','6083008eGsDqG','.scriptName','].target','scriptName','kind','call','map','entries','51722idgluU','14376miZUZJ','bff','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','fromEntries','trim','action','target'];a40_0x27a5=function(){return _0x6d052d;};return a40_0x27a5();}(function(_0x30e242,_0x4ed77e){const _0x5b70a4=a40_0x2654,_0x823278=_0x30e242();while(!![]){try{const _0x405824=parseInt(_0x5b70a4(0x126))/0x1*(parseInt(_0x5b70a4(0x141))/0x2)+parseInt(_0x5b70a4(0x133))/0x3+parseInt(_0x5b70a4(0x139))/0x4+-parseInt(_0x5b70a4(0x129))/0x5*(parseInt(_0x5b70a4(0x121))/0x6)+-parseInt(_0x5b70a4(0x124))/0x7*(parseInt(_0x5b70a4(0x11a))/0x8)+parseInt(_0x5b70a4(0x12c))/0x9+-parseInt(_0x5b70a4(0x136))/0xa;if(_0x405824===_0x4ed77e)break;else _0x823278['push'](_0x823278['shift']());}catch(_0xd530dd){_0x823278['push'](_0x823278['shift']());}}}(a40_0x27a5,0xd5e47));export function adaptServiceTreeManifestForLegacyFramework(_0x339885){const _0x56793a=a40_0x2654,_0x570c53=cloneJsonValue(_0x339885),_0x32471a=[];if(!isObjectRecord(_0x570c53))return{'manifest':_0x570c53,'errors':_0x32471a};return Array[_0x56793a(0x12f)](_0x570c53[_0x56793a(0x125)])&&_0x570c53['commands'][_0x56793a(0x134)]((_0x399826,_0x5baa00)=>{const _0x3a7f79=_0x56793a;if(!isObjectRecord(_0x399826))return;adaptBffTarget(_0x399826[_0x3a7f79(0x120)],_0x3a7f79(0x137)+_0x5baa00+_0x3a7f79(0x13b),_0x32471a);}),adaptResources(_0x570c53['resources'],_0x56793a(0x12d),_0x32471a),{'manifest':_0x570c53,'errors':_0x32471a};}export function toPublicServiceTreeTarget(_0x239848){const _0xfc2cfe=a40_0x2654,{scriptName:_0x3141a0,..._0x52cd52}=_0x239848;return typeof _0x3141a0===_0xfc2cfe(0x12b)&&_0x3141a0[_0xfc2cfe(0x11e)]()&&(_0x52cd52[_0xfc2cfe(0x123)]=_0x3141a0),_0x52cd52;}export function toPublicNormalizedServiceTree(_0x33ca1c){const _0x2ab0ee=a40_0x2654;return{..._0x33ca1c,'commands':_0x33ca1c['commands'][_0x2ab0ee(0x13f)](_0x401dae=>({..._0x401dae,'target':toPublicServiceTreeTarget(_0x401dae[_0x2ab0ee(0x120)])}))};}function adaptResources(_0x54805b,_0x2c7616,_0x23d17b){const _0x4d2b7d=a40_0x2654;if(!isObjectRecord(_0x54805b))return;for(const [_0x4af7d6,_0x12a022]of Object['entries'](_0x54805b)){if(!isObjectRecord(_0x12a022))continue;const _0x35b642=_0x2c7616+'.'+_0x4af7d6;if(isObjectRecord(_0x12a022[_0x4d2b7d(0x130)]))for(const [_0x452f41,_0x1a3a7c]of Object[_0x4d2b7d(0x140)](_0x12a022[_0x4d2b7d(0x130)])){if(!isObjectRecord(_0x1a3a7c))continue;const _0x595955=_0x35b642+'.actions.'+_0x452f41,_0x4d632c=isObjectRecord(_0x1a3a7c['target'])&&_0x1a3a7c['target'][_0x4d2b7d(0x13d)]==='bff';adaptBffTarget(_0x1a3a7c[_0x4d2b7d(0x120)],_0x595955+_0x4d2b7d(0x135),_0x23d17b),(_0x4d632c||isBffAction(_0x1a3a7c))&&adaptFunctionNameField(_0x1a3a7c,_0x595955,_0x23d17b);}adaptResources(_0x12a022['resources'],_0x35b642+_0x4d2b7d(0x122),_0x23d17b);}}function adaptBffTarget(_0x30fbb3,_0x215953,_0x2bb9dc){const _0x53d05d=a40_0x2654;if(!isObjectRecord(_0x30fbb3)||_0x30fbb3[_0x53d05d(0x13d)]!==_0x53d05d(0x11b))return;adaptFunctionNameField(_0x30fbb3,_0x215953,_0x2bb9dc);}function adaptFunctionNameField(_0x5ba5f9,_0x17c372,_0x2144f1){const _0x2c0641=a40_0x2654;Object[_0x2c0641(0x12e)][_0x2c0641(0x138)]['call'](_0x5ba5f9,'scriptName')&&_0x2144f1['push']({'level':_0x2c0641(0x128),'path':_0x17c372+_0x2c0641(0x13a),'message':_0x2c0641(0x11c)});if(Object[_0x2c0641(0x12e)][_0x2c0641(0x138)][_0x2c0641(0x13e)](_0x5ba5f9,'functionName')){if(typeof _0x5ba5f9[_0x2c0641(0x123)]!=='string'||!_0x5ba5f9[_0x2c0641(0x123)]['trim']()){_0x2144f1[_0x2c0641(0x127)]({'level':'error','path':_0x17c372+_0x2c0641(0x131),'message':'functionName\x20must\x20be\x20a\x20non-empty\x20string.'}),delete _0x5ba5f9[_0x2c0641(0x123)];return;}_0x5ba5f9[_0x2c0641(0x13c)]=_0x5ba5f9['functionName'],delete _0x5ba5f9[_0x2c0641(0x123)];}}function isBffAction(_0x5221c5){const _0x273eb1=a40_0x2654;return _0x5221c5[_0x273eb1(0x13d)]===_0x273eb1(0x11b)||_0x5221c5[_0x273eb1(0x11f)]===_0x273eb1(0x12a)||_0x5221c5[_0x273eb1(0x120)]===_0x273eb1(0x12a);}function cloneJsonValue(_0x1561bd){const _0x3c00f6=a40_0x2654;if(Array[_0x3c00f6(0x12f)](_0x1561bd))return _0x1561bd[_0x3c00f6(0x13f)](_0xcabbe2=>cloneJsonValue(_0xcabbe2));if(isObjectRecord(_0x1561bd))return Object[_0x3c00f6(0x11d)](Object[_0x3c00f6(0x140)](_0x1561bd)[_0x3c00f6(0x13f)](([_0x4b5a30,_0x38f461])=>[_0x4b5a30,cloneJsonValue(_0x38f461)]));return _0x1561bd;}function a40_0x2654(_0x43a67c,_0x16870c){_0x43a67c=_0x43a67c-0x11a;const _0x27a5bd=a40_0x27a5();let _0x26549f=_0x27a5bd[_0x43a67c];return _0x26549f;}function isObjectRecord(_0x24a618){const _0x5ae14d=a40_0x2654;return Boolean(_0x24a618)&&typeof _0x24a618===_0x5ae14d(0x132)&&!Array[_0x5ae14d(0x12f)](_0x24a618);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a41_0x3239(_0x4a2f1e,_0x379e22){_0x4a2f1e=_0x4a2f1e-0x13f;const _0x468671=a41_0x4686();let _0x32390c=_0x468671[_0x4a2f1e];return _0x32390c;}const a41_0x44be85=a41_0x3239;(function(_0x12afc9,_0x1d0c51){const _0x34c2a2=a41_0x3239,_0x754250=_0x12afc9();while(!![]){try{const _0xe1b5c=parseInt(_0x34c2a2(0x170))/0x1+parseInt(_0x34c2a2(0x173))/0x2*(-parseInt(_0x34c2a2(0x14f))/0x3)+parseInt(_0x34c2a2(0x140))/0x4+-parseInt(_0x34c2a2(0x16d))/0x5*(parseInt(_0x34c2a2(0x159))/0x6)+-parseInt(_0x34c2a2(0x143))/0x7*(-parseInt(_0x34c2a2(0x149))/0x8)+parseInt(_0x34c2a2(0x16a))/0x9*(parseInt(_0x34c2a2(0x160))/0xa)+-parseInt(_0x34c2a2(0x178))/0xb;if(_0xe1b5c===_0x1d0c51)break;else _0x754250['push'](_0x754250['shift']());}catch(_0x43d9ae){_0x754250['push'](_0x754250['shift']());}}}(a41_0x4686,0x53022));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x44be85(0x154),'type':a41_0x44be85(0x17a),'required':!![],'description':a41_0x44be85(0x14b)},SERVICE_FLAG={'name':a41_0x44be85(0x163),'type':a41_0x44be85(0x17a),'required':!![],'description':a41_0x44be85(0x16e),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x44be85(0x148)}};function summarizeService(_0x36f121){const _0x188480=a41_0x44be85;return{'serviceCode':_0x36f121[_0x188480(0x157)],'name':_0x36f121['normalizedManifest']['service']['name'],'version':_0x36f121[_0x188480(0x168)],'importedAt':_0x36f121['importedAt'],'source':_0x36f121['source'],'commandCount':_0x36f121[_0x188480(0x165)][_0x188480(0x181)][_0x188480(0x151)],'commands':_0x36f121['normalizedManifest']['commands'][_0x188480(0x15b)](_0x168e66=>({'path':_0x168e66[_0x188480(0x146)],'description':_0x168e66[_0x188480(0x169)],'risk':_0x168e66[_0x188480(0x142)],'target':toPublicServiceTreeTarget(_0x168e66[_0x188480(0x14c)]),'flags':_0x168e66['flags'][_0x188480(0x15b)](_0x1c38c6=>({'name':_0x1c38c6['name'],'cliName':_0x1c38c6[_0x188480(0x180)],'type':_0x1c38c6[_0x188480(0x164)],'required':_0x1c38c6[_0x188480(0x179)]===!![]}))}))};}function summarizeLoadedManifest(_0x486af9){const _0x780922=a41_0x44be85;return{'service':_0x486af9['normalizedManifest']?.['service'],'version':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x168)],'commandCount':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x181)][_0x780922(0x151)]??0x0,'commands':_0x486af9[_0x780922(0x165)]?.[_0x780922(0x181)][_0x780922(0x15b)](_0x482a2e=>({'path':_0x482a2e['cliPath'],'risk':_0x482a2e[_0x780922(0x142)],'target':toPublicServiceTreeTarget(_0x482a2e['target'])}))??[],'registryIndex':_0x486af9[_0x780922(0x156)],'registryServiceCode':_0x486af9['registryServiceCode'],'errors':_0x486af9[_0x780922(0x14a)]['errors'],'warnings':_0x486af9[_0x780922(0x14a)][_0x780922(0x162)]};}function a41_0x4686(){const _0x3be560=['service','type','normalizedManifest','export','detail','version','description','1002393apvatj','source','\x20service(s).','15erwnsK','Local\x20service\x20code,\x20for\x20example\x20crm','validate','429985cZhMJl','remove','Removed\x20service\x20','498664HlfKzq','serviceCount','import','str','read','6611066qYnoCV','required','string','errors','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','kind','\x20service\x20','entries','cliName','commands','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','reduce','hash','2241612GYczsX','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk','28ypJKbU','Imported\x20','manifests','cliPath','write','lower\x20kebab-case\x20service\x20code','587128iswuUT','report','Service\x20Tree\x20manifest\x20file\x20path','target','filePath','WRITE','3Rwoyaq','updated','length','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','file','Updated','registryIndex','serviceCode','imported','855486SsENUO','registryPath','map','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Service\x20registry\x20validation\x20passed.','Imported','manifest','30bhkQmI','entry','warnings'];a41_0x4686=function(){return _0x3be560;};return a41_0x4686();}export const serviceDefinitions=[{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x16f),'description':a41_0x44be85(0x183),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x126894){const _0x5eb8ab=a41_0x44be85,_0x4c7503=loadServiceManifestFromFile(_0x126894[_0x5eb8ab(0x176)](_0x5eb8ab(0x154)));if(!_0x4c7503[_0x5eb8ab(0x14a)]['ok'])return{'ok':![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503[_0x5eb8ab(0x17d)],'serviceCount':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x151)],'services':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x15b)](summarizeLoadedManifest),'errors':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x17b)],'warnings':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x162)]},'message':formatValidationFailure(_0x4c7503[_0x5eb8ab(0x14a)])};if(_0x4c7503[_0x5eb8ab(0x17d)]==='registry'||_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x151)]!==0x1)return{'ok':!![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503['kind'],'serviceCount':_0x4c7503['manifests'][_0x5eb8ab(0x151)],'commandCount':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x184)]((_0x528511,_0x5981a9)=>_0x528511+(_0x5981a9['normalizedManifest']?.['commands'][_0x5eb8ab(0x151)]??0x0),0x0),'services':_0x4c7503[_0x5eb8ab(0x145)][_0x5eb8ab(0x15b)](summarizeLoadedManifest),'warnings':_0x4c7503['report'][_0x5eb8ab(0x162)]},'message':_0x5eb8ab(0x15d)};return{'ok':!![],'data':{'file':_0x4c7503['filePath'],'hash':_0x4c7503['hash'],'kind':_0x4c7503[_0x5eb8ab(0x17d)],'service':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x163)],'version':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x168)],'commandCount':_0x4c7503[_0x5eb8ab(0x165)]?.[_0x5eb8ab(0x181)]['length']??0x0,'commands':_0x4c7503['normalizedManifest']?.[_0x5eb8ab(0x181)][_0x5eb8ab(0x15b)](_0x2f7642=>({'path':_0x2f7642[_0x5eb8ab(0x146)],'risk':_0x2f7642['risk'],'target':toPublicServiceTreeTarget(_0x2f7642['target'])})),'warnings':_0x4c7503[_0x5eb8ab(0x14a)][_0x5eb8ab(0x162)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x175),'description':a41_0x44be85(0x141),'risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x3e21b5){const _0x1b948a=a41_0x44be85,_0x3a6693=loadServiceManifestFromFile(_0x3e21b5[_0x1b948a(0x176)](_0x1b948a(0x154)));return{'method':_0x1b948a(0x14e),'url':getServiceRegistryPath(),'body':{'file':_0x3a6693[_0x1b948a(0x14d)],'hash':_0x3a6693[_0x1b948a(0x13f)],'kind':_0x3a6693[_0x1b948a(0x17d)],'ok':_0x3a6693[_0x1b948a(0x14a)]['ok'],'service':_0x3a6693[_0x1b948a(0x165)]?.[_0x1b948a(0x163)],'version':_0x3a6693[_0x1b948a(0x165)]?.['version'],'serviceCount':_0x3a6693[_0x1b948a(0x145)]['length'],'services':_0x3a6693[_0x1b948a(0x145)][_0x1b948a(0x15b)](_0xf4a6e4=>({'service':_0xf4a6e4[_0x1b948a(0x165)]?.[_0x1b948a(0x163)],'version':_0xf4a6e4['normalizedManifest']?.[_0x1b948a(0x168)],'commandCount':_0xf4a6e4['normalizedManifest']?.['commands'][_0x1b948a(0x151)]??0x0,'errors':_0xf4a6e4[_0x1b948a(0x14a)][_0x1b948a(0x17b)]})),'errors':_0x3a6693['report']['errors'],'commandCount':_0x3a6693[_0x1b948a(0x165)]?.[_0x1b948a(0x181)][_0x1b948a(0x151)]??0x0},'description':_0x1b948a(0x182)};},async 'execute'(_0x36a24c){const _0x5e76d5=a41_0x44be85,_0x498d41=importServiceManifest(_0x36a24c[_0x5e76d5(0x176)](_0x5e76d5(0x154)));if(_0x498d41[_0x5e76d5(0x17f)][_0x5e76d5(0x151)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x498d41[_0x5e76d5(0x15a)],'imported':_0x498d41[_0x5e76d5(0x158)],'updated':_0x498d41['updated'],'serviceCount':_0x498d41[_0x5e76d5(0x174)],'services':_0x498d41[_0x5e76d5(0x17f)]['map'](summarizeService)},'message':_0x5e76d5(0x144)+_0x498d41[_0x5e76d5(0x158)]+'\x20service(s),\x20updated\x20'+_0x498d41[_0x5e76d5(0x150)]+_0x5e76d5(0x16c)};return{'ok':!![],'data':{'registryPath':_0x498d41['registryPath'],'replaced':_0x498d41['replaced'],'imported':_0x498d41[_0x5e76d5(0x158)],'updated':_0x498d41[_0x5e76d5(0x150)],'serviceCount':_0x498d41[_0x5e76d5(0x174)],'service':summarizeService(_0x498d41[_0x5e76d5(0x161)])},'message':(_0x498d41['replaced']?_0x5e76d5(0x155):_0x5e76d5(0x15e))+_0x5e76d5(0x17e)+_0x498d41[_0x5e76d5(0x161)]['serviceCode']+'.'};}},{'service':a41_0x44be85(0x163),'command':a41_0x44be85(0x166),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x492b06){const _0x5428e4=a41_0x44be85,_0x3fea5f=getLocalServiceEntry(_0x492b06['str'](_0x5428e4(0x163)));return{'method':_0x5428e4(0x14e),'url':_0x492b06[_0x5428e4(0x176)](_0x5428e4(0x154)),'body':{'service':_0x492b06[_0x5428e4(0x176)](_0x5428e4(0x163)),'found':Boolean(_0x3fea5f),'version':_0x3fea5f?.[_0x5428e4(0x168)],'source':_0x3fea5f?.[_0x5428e4(0x16b)]},'description':_0x5428e4(0x17c)};},async 'execute'(_0x208c3d){const _0xe2f87c=a41_0x44be85,_0x515788=exportServiceManifest(_0x208c3d['str'](_0xe2f87c(0x163)),_0x208c3d[_0xe2f87c(0x176)](_0xe2f87c(0x154)));return{'ok':!![],'data':{'registryPath':_0x515788[_0xe2f87c(0x15a)],'file':_0x515788[_0xe2f87c(0x14d)],'service':summarizeService(_0x515788[_0xe2f87c(0x161)])},'message':'Exported\x20service\x20'+_0x515788[_0xe2f87c(0x161)][_0xe2f87c(0x157)]+'.'};}},{'service':'service','command':'list','description':a41_0x44be85(0x15c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x333ef0=a41_0x44be85,_0x5373f8=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x5373f8[_0x333ef0(0x151)],'services':_0x5373f8[_0x333ef0(0x15b)](summarizeService)}};}},{'service':'service','command':a41_0x44be85(0x171),'description':a41_0x44be85(0x153),'risk':a41_0x44be85(0x147),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1b545b){const _0x3743ca=a41_0x44be85,_0x16aa43=getLocalServiceEntry(_0x1b545b[_0x3743ca(0x176)](_0x3743ca(0x163)));return{'method':_0x3743ca(0x14e),'url':getServiceRegistryPath(),'body':{'service':_0x1b545b[_0x3743ca(0x176)]('service'),'found':Boolean(_0x16aa43),'version':_0x16aa43?.[_0x3743ca(0x168)],'source':_0x16aa43?.[_0x3743ca(0x16b)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1c9d4c){const _0x5cefd7=a41_0x44be85,_0x332377=removeServiceManifest(_0x1c9d4c[_0x5cefd7(0x176)](_0x5cefd7(0x163)));return{'ok':!![],'data':{'registryPath':_0x332377[_0x5cefd7(0x15a)],'serviceCount':_0x332377[_0x5cefd7(0x174)],'service':summarizeService(_0x332377[_0x5cefd7(0x161)])},'message':_0x5cefd7(0x172)+_0x332377['entry']['serviceCode']+'.'};}},{'service':'service','command':a41_0x44be85(0x167),'description':a41_0x44be85(0x152),'risk':a41_0x44be85(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x22278b){const _0x3e1f30=a41_0x44be85,_0x2889e9=getLocalServiceEntry(_0x22278b[_0x3e1f30(0x176)]('service'));if(!_0x2889e9)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x22278b[_0x3e1f30(0x176)](_0x3e1f30(0x163))},'message':'Local\x20service\x20not\x20found:\x20'+_0x22278b[_0x3e1f30(0x176)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2889e9),'manifest':_0x2889e9[_0x3e1f30(0x15f)],'normalizedManifest':toPublicNormalizedServiceTree(_0x2889e9[_0x3e1f30(0x165)])}};}}];
|
|
1
|
+
function a41_0x79e7(_0x721d7d,_0x17a035){_0x721d7d=_0x721d7d-0xb0;const _0x3d24af=a41_0x3d24();let _0x79e775=_0x3d24af[_0x721d7d];return _0x79e775;}const a41_0x530add=a41_0x79e7;(function(_0xc07f45,_0x5c9db4){const _0x9a9e46=a41_0x79e7,_0x4534db=_0xc07f45();while(!![]){try{const _0xd74948=-parseInt(_0x9a9e46(0xbd))/0x1+parseInt(_0x9a9e46(0xef))/0x2+-parseInt(_0x9a9e46(0xd2))/0x3+-parseInt(_0x9a9e46(0xe2))/0x4+parseInt(_0x9a9e46(0xee))/0x5+-parseInt(_0x9a9e46(0xb5))/0x6*(parseInt(_0x9a9e46(0xc2))/0x7)+parseInt(_0x9a9e46(0xe1))/0x8*(parseInt(_0x9a9e46(0xc5))/0x9);if(_0xd74948===_0x5c9db4)break;else _0x4534db['push'](_0x4534db['shift']());}catch(_0x40118e){_0x4534db['push'](_0x4534db['shift']());}}}(a41_0x3d24,0x9b643));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a41_0x3d24(){const _0x204b56=['1245820fYtgyh','required','Local\x20service\x20code,\x20for\x20example\x20crm','target','report','7WWbdve','\x20service(s),\x20updated\x20','version','21035574uQeEAZ','serviceCode','length','Service\x20registry\x20validation\x20passed.','normalizedManifest','\x20service\x20','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Local\x20service\x20not\x20found:\x20','entries','Removed\x20service\x20','string','str','filePath','1649172SQIrve','file','cliName','Updated','registryServiceCode','updated','commands','importedAt','cliPath','errors','registryIndex','read','lower\x20kebab-case\x20service\x20code','source','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','8VQDITL','4151964yaZFtk','import','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','description','flags','Service\x20manifest\x20validation\x20passed.','Imported','registry','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','map','manifest','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','4759235KHByFN','2210608WRdEax','entry','将\x20Service\x20Tree\x20清单导入本地运行态注册表','imported','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','hash','serviceCount','Imported\x20','WRITE','registryPath','kind','warnings','replaced','validate','5546514hbceDl','service','detail','risk','reduce','Exported\x20service\x20','manifests','write'];a41_0x3d24=function(){return _0x204b56;};return a41_0x3d24();}const FILE_FLAG={'name':a41_0x530add(0xd3),'type':'string','required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':a41_0x530add(0xcf),'required':!![],'description':a41_0x530add(0xbf),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x530add(0xde)}};function summarizeService(_0x28388e){const _0x4b778a=a41_0x530add;return{'serviceCode':_0x28388e[_0x4b778a(0xc6)],'name':_0x28388e[_0x4b778a(0xc9)]['service']['name'],'version':_0x28388e[_0x4b778a(0xc4)],'importedAt':_0x28388e[_0x4b778a(0xd9)],'source':_0x28388e['source'],'commandCount':_0x28388e[_0x4b778a(0xc9)][_0x4b778a(0xd8)]['length'],'commands':_0x28388e[_0x4b778a(0xc9)][_0x4b778a(0xd8)][_0x4b778a(0xeb)](_0x1e0452=>({'path':_0x1e0452[_0x4b778a(0xda)],'description':_0x1e0452[_0x4b778a(0xe5)],'risk':_0x1e0452['risk'],'target':toPublicServiceTreeTarget(_0x1e0452[_0x4b778a(0xc0)]),'flags':_0x1e0452[_0x4b778a(0xe6)]['map'](_0x3fc009=>({'name':_0x3fc009['name'],'cliName':_0x3fc009[_0x4b778a(0xd4)],'type':_0x3fc009['type'],'required':_0x3fc009[_0x4b778a(0xbe)]===!![]}))}))};}function summarizeLoadedManifest(_0x4e2899){const _0x397931=a41_0x530add;return{'service':_0x4e2899[_0x397931(0xc9)]?.[_0x397931(0xb6)],'version':_0x4e2899[_0x397931(0xc9)]?.[_0x397931(0xc4)],'commandCount':_0x4e2899[_0x397931(0xc9)]?.['commands']['length']??0x0,'commands':_0x4e2899[_0x397931(0xc9)]?.[_0x397931(0xd8)][_0x397931(0xeb)](_0x3bc39d=>({'path':_0x3bc39d['cliPath'],'risk':_0x3bc39d[_0x397931(0xb8)],'target':toPublicServiceTreeTarget(_0x3bc39d['target'])}))??[],'registryIndex':_0x4e2899[_0x397931(0xdc)],'registryServiceCode':_0x4e2899[_0x397931(0xd6)],'errors':_0x4e2899['report']['errors'],'warnings':_0x4e2899[_0x397931(0xc1)][_0x397931(0xb2)]};}export const serviceDefinitions=[{'service':a41_0x530add(0xb6),'command':a41_0x530add(0xb4),'description':a41_0x530add(0xe4),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x36b3ab){const _0x2297f5=a41_0x530add,_0x27f785=loadServiceManifestFromFile(_0x36b3ab[_0x2297f5(0xd0)](_0x2297f5(0xd3)));if(!_0x27f785['report']['ok'])return{'ok':![],'data':{'file':_0x27f785[_0x2297f5(0xd1)],'hash':_0x27f785['hash'],'kind':_0x27f785[_0x2297f5(0xb1)],'serviceCount':_0x27f785[_0x2297f5(0xbb)]['length'],'services':_0x27f785[_0x2297f5(0xbb)][_0x2297f5(0xeb)](summarizeLoadedManifest),'errors':_0x27f785[_0x2297f5(0xc1)][_0x2297f5(0xdb)],'warnings':_0x27f785['report']['warnings']},'message':formatValidationFailure(_0x27f785[_0x2297f5(0xc1)])};if(_0x27f785[_0x2297f5(0xb1)]===_0x2297f5(0xe9)||_0x27f785[_0x2297f5(0xbb)][_0x2297f5(0xc7)]!==0x1)return{'ok':!![],'data':{'file':_0x27f785['filePath'],'hash':_0x27f785[_0x2297f5(0xf4)],'kind':_0x27f785[_0x2297f5(0xb1)],'serviceCount':_0x27f785[_0x2297f5(0xbb)]['length'],'commandCount':_0x27f785[_0x2297f5(0xbb)][_0x2297f5(0xb9)]((_0x4cac2,_0x317529)=>_0x4cac2+(_0x317529[_0x2297f5(0xc9)]?.[_0x2297f5(0xd8)][_0x2297f5(0xc7)]??0x0),0x0),'services':_0x27f785[_0x2297f5(0xbb)][_0x2297f5(0xeb)](summarizeLoadedManifest),'warnings':_0x27f785['report']['warnings']},'message':_0x2297f5(0xc8)};return{'ok':!![],'data':{'file':_0x27f785['filePath'],'hash':_0x27f785[_0x2297f5(0xf4)],'kind':_0x27f785[_0x2297f5(0xb1)],'service':_0x27f785[_0x2297f5(0xc9)]?.['service'],'version':_0x27f785[_0x2297f5(0xc9)]?.[_0x2297f5(0xc4)],'commandCount':_0x27f785[_0x2297f5(0xc9)]?.['commands'][_0x2297f5(0xc7)]??0x0,'commands':_0x27f785[_0x2297f5(0xc9)]?.['commands'][_0x2297f5(0xeb)](_0x2f2040=>({'path':_0x2f2040[_0x2297f5(0xda)],'risk':_0x2f2040[_0x2297f5(0xb8)],'target':toPublicServiceTreeTarget(_0x2f2040[_0x2297f5(0xc0)])})),'warnings':_0x27f785['report'][_0x2297f5(0xb2)]},'message':_0x2297f5(0xe7)};}},{'service':a41_0x530add(0xb6),'command':a41_0x530add(0xe3),'description':a41_0x530add(0xf1),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0xa35a84){const _0x315e60=a41_0x530add,_0x1cd429=loadServiceManifestFromFile(_0xa35a84[_0x315e60(0xd0)](_0x315e60(0xd3)));return{'method':_0x315e60(0xf7),'url':getServiceRegistryPath(),'body':{'file':_0x1cd429[_0x315e60(0xd1)],'hash':_0x1cd429[_0x315e60(0xf4)],'kind':_0x1cd429[_0x315e60(0xb1)],'ok':_0x1cd429['report']['ok'],'service':_0x1cd429[_0x315e60(0xc9)]?.[_0x315e60(0xb6)],'version':_0x1cd429[_0x315e60(0xc9)]?.[_0x315e60(0xc4)],'serviceCount':_0x1cd429[_0x315e60(0xbb)][_0x315e60(0xc7)],'services':_0x1cd429[_0x315e60(0xbb)][_0x315e60(0xeb)](_0x2451dc=>({'service':_0x2451dc[_0x315e60(0xc9)]?.[_0x315e60(0xb6)],'version':_0x2451dc[_0x315e60(0xc9)]?.[_0x315e60(0xc4)],'commandCount':_0x2451dc[_0x315e60(0xc9)]?.[_0x315e60(0xd8)][_0x315e60(0xc7)]??0x0,'errors':_0x2451dc[_0x315e60(0xc1)][_0x315e60(0xdb)]})),'errors':_0x1cd429['report']['errors'],'commandCount':_0x1cd429['normalizedManifest']?.[_0x315e60(0xd8)][_0x315e60(0xc7)]??0x0},'description':_0x315e60(0xcb)};},async 'execute'(_0x498d7e){const _0x168471=a41_0x530add,_0x4eabfa=importServiceManifest(_0x498d7e[_0x168471(0xd0)](_0x168471(0xd3)));if(_0x4eabfa[_0x168471(0xcd)][_0x168471(0xc7)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x4eabfa['registryPath'],'imported':_0x4eabfa[_0x168471(0xf2)],'updated':_0x4eabfa['updated'],'serviceCount':_0x4eabfa[_0x168471(0xf5)],'services':_0x4eabfa[_0x168471(0xcd)][_0x168471(0xeb)](summarizeService)},'message':_0x168471(0xf6)+_0x4eabfa['imported']+_0x168471(0xc3)+_0x4eabfa[_0x168471(0xd7)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x4eabfa[_0x168471(0xb0)],'replaced':_0x4eabfa[_0x168471(0xb3)],'imported':_0x4eabfa[_0x168471(0xf2)],'updated':_0x4eabfa[_0x168471(0xd7)],'serviceCount':_0x4eabfa[_0x168471(0xf5)],'service':summarizeService(_0x4eabfa[_0x168471(0xf0)])},'message':(_0x4eabfa[_0x168471(0xb3)]?_0x168471(0xd5):_0x168471(0xe8))+_0x168471(0xca)+_0x4eabfa['entry'][_0x168471(0xc6)]+'.'};}},{'service':a41_0x530add(0xb6),'command':'export','description':a41_0x530add(0xe0),'risk':a41_0x530add(0xbc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x34a252){const _0x2efd30=a41_0x530add,_0x42e68e=getLocalServiceEntry(_0x34a252[_0x2efd30(0xd0)](_0x2efd30(0xb6)));return{'method':_0x2efd30(0xf7),'url':_0x34a252[_0x2efd30(0xd0)](_0x2efd30(0xd3)),'body':{'service':_0x34a252[_0x2efd30(0xd0)]('service'),'found':Boolean(_0x42e68e),'version':_0x42e68e?.[_0x2efd30(0xc4)],'source':_0x42e68e?.[_0x2efd30(0xdf)]},'description':_0x2efd30(0xf3)};},async 'execute'(_0xaa9597){const _0x430801=a41_0x530add,_0x191c93=exportServiceManifest(_0xaa9597['str'](_0x430801(0xb6)),_0xaa9597[_0x430801(0xd0)](_0x430801(0xd3)));return{'ok':!![],'data':{'registryPath':_0x191c93[_0x430801(0xb0)],'file':_0x191c93[_0x430801(0xd1)],'service':summarizeService(_0x191c93[_0x430801(0xf0)])},'message':_0x430801(0xba)+_0x191c93[_0x430801(0xf0)][_0x430801(0xc6)]+'.'};}},{'service':a41_0x530add(0xb6),'command':'list','description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a41_0x530add(0xdd),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0xebdf78=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xebdf78['length'],'services':_0xebdf78['map'](summarizeService)}};}},{'service':a41_0x530add(0xb6),'command':'remove','description':'从本地运行态注册表移除\x20Service\x20Tree\x20清单','risk':a41_0x530add(0xbc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x26bb64){const _0x91dcfe=a41_0x530add,_0x77b034=getLocalServiceEntry(_0x26bb64['str'](_0x91dcfe(0xb6)));return{'method':_0x91dcfe(0xf7),'url':getServiceRegistryPath(),'body':{'service':_0x26bb64[_0x91dcfe(0xd0)](_0x91dcfe(0xb6)),'found':Boolean(_0x77b034),'version':_0x77b034?.['version'],'source':_0x77b034?.['source']},'description':_0x91dcfe(0xed)};},async 'execute'(_0x2cbf2f){const _0x1db6ae=a41_0x530add,_0x5f426b=removeServiceManifest(_0x2cbf2f[_0x1db6ae(0xd0)](_0x1db6ae(0xb6)));return{'ok':!![],'data':{'registryPath':_0x5f426b[_0x1db6ae(0xb0)],'serviceCount':_0x5f426b[_0x1db6ae(0xf5)],'service':summarizeService(_0x5f426b[_0x1db6ae(0xf0)])},'message':_0x1db6ae(0xce)+_0x5f426b[_0x1db6ae(0xf0)][_0x1db6ae(0xc6)]+'.'};}},{'service':a41_0x530add(0xb6),'command':a41_0x530add(0xb7),'description':a41_0x530add(0xea),'risk':a41_0x530add(0xdd),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x3009f4){const _0x3f80ca=a41_0x530add,_0x304807=getLocalServiceEntry(_0x3009f4['str'](_0x3f80ca(0xb6)));if(!_0x304807)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x3009f4['str'](_0x3f80ca(0xb6))},'message':_0x3f80ca(0xcc)+_0x3009f4['str'](_0x3f80ca(0xb6))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x304807),'manifest':_0x304807[_0x3f80ca(0xec)],'normalizedManifest':toPublicNormalizedServiceTree(_0x304807[_0x3f80ca(0xc9)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a42_0x2a62(){const _0x4f35a0=['50SvKIac','findIndex','missing','ENOENT','service','filePath','$.services[','startsWith','services','registryIndex','214227wPxntD','importedAt','risk','update','digest','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','503288EuuFGP','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','map','message','Invalid\x20service\x20manifest\x20JSON:\x20','cliPath','utf8','isArray','trim','241845GfTFKk','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','].manifest','hex','validation','path','serviceCode','toISOString','normalizedManifest','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','360156BGeRME','schemaVersion','target','empty','4JoXPEq','parse','warnings','report','homeDir','sourceHash','slice','Unsupported\x20schemaVersion:\x20','7230zZHcBe','invalid','1972912gFsEZQ','Local\x20service\x20not\x20found:\x20','stringify','553xuwQet','length','homeDirName','join','reduce','].manifest.','Service\x20manifest\x20validation\x20failed:\x0a','find','localeCompare','command','now','updatedAt','push','description','bff\x20target\x20requires\x20functionName.','splice','sha256','.tmp','version','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','services\x20must\x20be\x20an\x20array','errors','name','Unsupported\x20service\x20registry\x20schemaVersion:\x20','flatMap','commandCount','Cannot\x20write\x20service\x20registry:\x20','manifest','1458890EgKzEU'];a42_0x2a62=function(){return _0x4f35a0;};return a42_0x2a62();}(function(_0x3dd9b8,_0x9be4ef){const _0x2b1387=a42_0x57fb,_0x1370e2=_0x3dd9b8();while(!![]){try{const _0x49c613=-parseInt(_0x2b1387(0x1c8))/0x1+parseInt(_0x2b1387(0x1bf))/0x2+parseInt(_0x2b1387(0x1d2))/0x3+parseInt(_0x2b1387(0x1d6))/0x4*(parseInt(_0x2b1387(0x1ae))/0x5)+parseInt(_0x2b1387(0x1de))/0x6*(parseInt(_0x2b1387(0x192))/0x7)+-parseInt(_0x2b1387(0x1e0))/0x8+-parseInt(_0x2b1387(0x1b9))/0x9*(parseInt(_0x2b1387(0x1af))/0xa);if(_0x49c613===_0x9be4ef)break;else _0x1370e2['push'](_0x1370e2['shift']());}catch(_0x5d4a94){_0x1370e2['push'](_0x1370e2['shift']());}}}(a42_0x2a62,0x24e9b));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';function a42_0x57fb(_0x5c5b3d,_0x196bc5){_0x5c5b3d=_0x5c5b3d-0x192;const _0x2a629e=a42_0x2a62();let _0x57fb76=_0x2a629e[_0x5c5b3d];return _0x57fb76;}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';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x30d118={}){const _0x421572=a42_0x57fb;return resolve(_0x30d118[_0x421572(0x1da)]??homedir(),PRODUCT_CONFIG[_0x421572(0x194)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x16ee48={}){const _0x159d30=a42_0x57fb,_0x574b03=getServiceRegistryPath(_0x16ee48);if(!existsSync(_0x574b03))return emptyServiceRegistry();try{const _0xec468c=readFileSync(_0x574b03,'utf8');if(!_0xec468c[_0x159d30(0x1c7)]())return emptyServiceRegistry();const _0x4f7058=JSON[_0x159d30(0x1d7)](_0xec468c);if(_0x4f7058[_0x159d30(0x1d3)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x159d30(0x1a9)+String(_0x4f7058[_0x159d30(0x1d3)]),'Remove\x20or\x20migrate\x20'+_0x574b03+'.');if(!Array[_0x159d30(0x1c6)](_0x4f7058[_0x159d30(0x1b7)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4f7058[_0x159d30(0x19d)],'services':_0x4f7058[_0x159d30(0x1b7)]};}catch(_0x346c33){if(_0x346c33 instanceof Error&&_0x346c33[_0x159d30(0x1a8)]==='CliError')throw _0x346c33;throw CliErrors[_0x159d30(0x1cc)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x574b03,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x170a35,_0x26ef31={}){const _0x3b87c7=a42_0x57fb,_0x26f5e3=getServiceRegistryPath(_0x26ef31),_0x5bb9c5=dirname(_0x26f5e3);!existsSync(_0x5bb9c5)&&mkdirSync(_0x5bb9c5,{'recursive':!![]});const _0x390d76=_0x26f5e3+_0x3b87c7(0x1a3);try{writeFileSync(_0x390d76,JSON['stringify'](_0x170a35,null,0x2)+'\x0a',{'encoding':_0x3b87c7(0x1c5),'mode':0x180}),renameSync(_0x390d76,_0x26f5e3);}catch(_0x39b521){try{unlinkSync(_0x390d76);}catch{}if(_0x39b521?.['code']===_0x3b87c7(0x1b2))throw CliErrors[_0x3b87c7(0x1cc)](_0x3b87c7(0x1ac)+_0x26f5e3);throw _0x39b521;}return _0x26f5e3;}export function loadServiceManifestFromFile(_0xbf01c4){const _0xf65848=a42_0x57fb,_0xd5cacf=resolve(_0xbf01c4);if(!existsSync(_0xd5cacf))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0xbf01c4);let _0x4736fb;const _0xe1d372=readFileSync(_0xd5cacf,_0xf65848(0x1c5));try{_0x4736fb=JSON[_0xf65848(0x1d7)](_0xe1d372);}catch{throw CliErrors[_0xf65848(0x1cc)](_0xf65848(0x1c3)+_0xbf01c4,_0xf65848(0x1c0));}const _0x469bf7=sha256(_0xe1d372),_0x3e7451=extractLoadedServiceManifests(_0x4736fb,_0x469bf7),_0x6187f8=aggregateValidationReports(_0x3e7451),_0x5dacdf=_0x3e7451[0x0];return{'filePath':_0xd5cacf,'hash':_0x469bf7,'kind':isServiceRegistryLike(_0x4736fb)?'registry':_0xf65848(0x1ad),'manifest':_0x5dacdf?.[_0xf65848(0x1ad)]??_0x4736fb,'report':_0x6187f8,'normalizedManifest':_0x3e7451['length']===0x1?_0x5dacdf?.['normalizedManifest']:undefined,'manifests':_0x3e7451};}export function importServiceManifest(_0x230884,_0x1baa4b={}){const _0x387e6d=a42_0x57fb,_0xae6bbc=loadServiceManifestFromFile(_0x230884);if(!_0xae6bbc[_0x387e6d(0x1d9)]['ok'])throw CliErrors[_0x387e6d(0x1cc)](formatValidationFailure(_0xae6bbc[_0x387e6d(0x1d9)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0xae6bbc['manifests'][_0x387e6d(0x193)]===0x0)throw CliErrors[_0x387e6d(0x1cc)](_0x387e6d(0x1c9),_0x387e6d(0x1d1));const _0x208703=readServiceRegistry(_0x1baa4b),_0x1b0f46=(_0x1baa4b['now']??(()=>new Date()))()[_0x387e6d(0x1cf)](),_0x3a1026=[];let _0x356d8=0x0,_0x293657=0x0;for(const _0x482c90 of _0xae6bbc['manifests']){if(!_0x482c90[_0x387e6d(0x1d0)])continue;const _0x48a0c7=_0x482c90['normalizedManifest']['service']['code'],_0xb27eb5={'serviceCode':_0x48a0c7,'version':_0x482c90[_0x387e6d(0x1d0)]['version'],'importedAt':_0x1b0f46,'source':{'type':'file','path':_0xae6bbc[_0x387e6d(0x1b4)],'hash':_0x482c90[_0x387e6d(0x1db)]},'manifest':_0x482c90[_0x387e6d(0x1ad)],'normalizedManifest':_0x482c90['normalizedManifest']},_0x4166ea=_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x1b0)](_0x1876f1=>_0x1876f1[_0x387e6d(0x1ce)]===_0x48a0c7);_0x4166ea>=0x0?(_0x208703[_0x387e6d(0x1b7)][_0x4166ea]=_0xb27eb5,_0x293657++):(_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x19e)](_0xb27eb5),_0x356d8++),_0x3a1026[_0x387e6d(0x19e)](_0xb27eb5);}_0x208703['services']['sort']((_0x592fa2,_0x2a9827)=>_0x592fa2[_0x387e6d(0x1ce)][_0x387e6d(0x19a)](_0x2a9827[_0x387e6d(0x1ce)])),_0x208703[_0x387e6d(0x19d)]=_0x1b0f46;const _0x59a8f1=writeServiceRegistry(_0x208703,_0x1baa4b);return{'registryPath':_0x59a8f1,'entry':_0x3a1026[0x0],'replaced':_0x3a1026[_0x387e6d(0x193)]===0x1?_0x293657===0x1:_0x293657>0x0,'entries':_0x3a1026,'imported':_0x356d8,'updated':_0x293657,'serviceCount':_0x208703[_0x387e6d(0x1b7)][_0x387e6d(0x193)]};}export function exportServiceManifest(_0x45e710,_0x42bc37,_0x2bb3e0={}){const _0x33ae7f=a42_0x57fb,_0x5c1f00=getServiceRegistryPath(_0x2bb3e0),_0x435897=getLocalServiceEntry(_0x45e710,_0x2bb3e0);if(!_0x435897)throw CliErrors['validation'](_0x33ae7f(0x1e1)+_0x45e710,_0x33ae7f(0x1a5));const _0x54a99a=resolve(_0x42bc37),_0xa303a8=dirname(_0x54a99a);return!existsSync(_0xa303a8)&&mkdirSync(_0xa303a8,{'recursive':!![]}),writeFileSync(_0x54a99a,JSON[_0x33ae7f(0x1e2)](_0x435897[_0x33ae7f(0x1ad)],null,0x2)+'\x0a',{'encoding':_0x33ae7f(0x1c5),'mode':0x180}),{'registryPath':_0x5c1f00,'filePath':_0x54a99a,'entry':_0x435897};}export function removeServiceManifest(_0x504e99,_0x3f9874={}){const _0x1baf36=a42_0x57fb,_0x1529b4=readServiceRegistry(_0x3f9874),_0x2dae64=_0x504e99[_0x1baf36(0x1c7)](),_0x4d5f94=_0x1529b4[_0x1baf36(0x1b7)]['findIndex'](_0x32fd67=>_0x32fd67[_0x1baf36(0x1ce)]===_0x2dae64);if(_0x4d5f94<0x0)throw CliErrors[_0x1baf36(0x1cc)]('Local\x20service\x20not\x20found:\x20'+_0x2dae64,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x46fa57]=_0x1529b4['services'][_0x1baf36(0x1a1)](_0x4d5f94,0x1),_0x2a3f0b=(_0x3f9874[_0x1baf36(0x19c)]??(()=>new Date()))()[_0x1baf36(0x1cf)]();_0x1529b4['updatedAt']=_0x2a3f0b;const _0x3c17bf=writeServiceRegistry(_0x1529b4,_0x3f9874);return{'registryPath':_0x3c17bf,'entry':_0x46fa57,'serviceCount':_0x1529b4['services'][_0x1baf36(0x193)]};}export function listLocalServices(_0xa13bd3={}){const _0x3d763b=a42_0x57fb;return readServiceRegistry(_0xa13bd3)[_0x3d763b(0x1b7)];}export function getLocalServiceEntry(_0x459690,_0x231312={}){const _0x23b21a=a42_0x57fb;return readServiceRegistry(_0x231312)[_0x23b21a(0x1b7)][_0x23b21a(0x199)](_0x1c5b24=>_0x1c5b24[_0x23b21a(0x1ce)]===_0x459690['trim']());}export function listLocalServiceTrees(_0x3f330e={}){const _0x331c1b=a42_0x57fb;return readServiceRegistry(_0x3f330e)[_0x331c1b(0x1b7)][_0x331c1b(0x1c1)](_0x3dbb19=>_0x3dbb19[_0x331c1b(0x1d0)]);}export function inspectServiceRegistry(_0x57dabe={}){const _0x4153bc=a42_0x57fb,_0x1ce515=getServiceRegistryPath(_0x57dabe);if(!existsSync(_0x1ce515))return emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1b1),![]);try{const _0x4ad50d=readFileSync(_0x1ce515,_0x4153bc(0x1c5));if(!_0x4ad50d[_0x4153bc(0x1c7)]())return emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1d5),!![]);const _0x5a03ee=JSON[_0x4153bc(0x1d7)](_0x4ad50d);if(_0x5a03ee['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'schemaVersion':_0x5a03ee[_0x4153bc(0x1d3)],'message':_0x4153bc(0x1dd)+String(_0x5a03ee[_0x4153bc(0x1d3)])};if(!Array['isArray'](_0x5a03ee[_0x4153bc(0x1b7)]))return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a03ee[_0x4153bc(0x19d)],'message':_0x4153bc(0x1a6)};const _0x300010=_0x5a03ee[_0x4153bc(0x1b7)][_0x4153bc(0x1c1)](summarizeLocalServiceEntry);return{'registryPath':_0x1ce515,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5a03ee[_0x4153bc(0x19d)],'serviceCount':_0x300010[_0x4153bc(0x193)],'commandCount':_0x300010[_0x4153bc(0x196)]((_0x153e61,_0x491b37)=>_0x153e61+_0x491b37[_0x4153bc(0x1ab)],0x0),'services':_0x300010};}catch(_0x2d6269){return{...emptyServiceRegistryInspection(_0x1ce515,_0x4153bc(0x1df),!![]),'message':_0x2d6269 instanceof Error?_0x2d6269[_0x4153bc(0x1c2)]:String(_0x2d6269)};}}export function formatValidationFailure(_0xe37e42){const _0x3b780e=a42_0x57fb,_0x3986cc=_0xe37e42[_0x3b780e(0x1a7)][_0x3b780e(0x1c1)](_0x2886b2=>_0x2886b2[_0x3b780e(0x1cd)]+':\x20'+_0x2886b2[_0x3b780e(0x1c2)]);return _0x3b780e(0x198)+_0x3986cc[_0x3b780e(0x195)]('\x0a');}function extractLoadedServiceManifests(_0x522057,_0x369cbb){const _0x3144ab=a42_0x57fb;if(!isServiceRegistryLike(_0x522057)){const _0x38f3cc=_0x522057,{manifest:_0x30d453,errors:_0x3728fa}=adaptServiceTreeManifestForLegacyFramework(_0x38f3cc),_0x438396=validateServiceTreeManifest(_0x30d453),_0x5ccc2e=mergeValidationErrors(_0x438396,_0x3728fa);return[{'manifest':_0x38f3cc,'report':_0x5ccc2e,'normalizedManifest':_0x5ccc2e['ok']?normalizeServiceTreeManifest(_0x30d453):undefined,'sourceHash':_0x369cbb}];}return _0x522057[_0x3144ab(0x1b7)][_0x3144ab(0x1c1)]((_0x51838d,_0x12d6f1)=>{const _0x1f562e=_0x3144ab,_0x9d7e9d=isObjectRecord(_0x51838d)?_0x51838d[_0x1f562e(0x1ad)]:undefined,{manifest:_0x2e3840,errors:_0x21ccc3}=adaptServiceTreeManifestForLegacyFramework(_0x9d7e9d),_0x4cbbcd=validateServiceTreeManifest(_0x2e3840),_0x4ac3da=mergeValidationErrors(_0x4cbbcd,_0x21ccc3),_0x4ecc7c=isObjectRecord(_0x51838d)&&typeof _0x51838d[_0x1f562e(0x1ce)]==='string'?_0x51838d[_0x1f562e(0x1ce)]:undefined;return{'manifest':_0x9d7e9d,'report':_0x4ac3da,'normalizedManifest':_0x4ac3da['ok']?normalizeServiceTreeManifest(_0x2e3840):undefined,'sourceHash':sha256(JSON[_0x1f562e(0x1e2)](_0x9d7e9d,null,0x2)+'\x0a'),'registryIndex':_0x12d6f1,'registryServiceCode':_0x4ecc7c};});}function mergeValidationErrors(_0x551fcd,_0x3b3f62){const _0x24144a=a42_0x57fb,_0x18054b=_0x551fcd[_0x24144a(0x1a7)][_0x24144a(0x1c1)](_0x42d20f=>_0x42d20f[_0x24144a(0x1c2)]===_0x24144a(0x1be)?{..._0x42d20f,'message':_0x24144a(0x1a0)}:_0x42d20f),_0x4855e4=[..._0x3b3f62,..._0x18054b];return{'ok':_0x4855e4['length']===0x0,'errors':_0x4855e4,'warnings':_0x551fcd[_0x24144a(0x1d8)]};}function aggregateValidationReports(_0x546e5b){const _0x1573a1=a42_0x57fb,_0xa9d5bc=_0x546e5b[_0x1573a1(0x1aa)](_0x225b08=>_0x225b08['registryIndex']===undefined?_0x225b08[_0x1573a1(0x1d9)][_0x1573a1(0x1a7)]:_0x225b08[_0x1573a1(0x1d9)][_0x1573a1(0x1a7)]['map'](_0x5afc3b=>({..._0x5afc3b,'path':prefixRegistryIssuePath(_0x225b08['registryIndex'],_0x5afc3b[_0x1573a1(0x1cd)])}))),_0x3df592=_0x546e5b[_0x1573a1(0x1aa)](_0x47503f=>_0x47503f[_0x1573a1(0x1b8)]===undefined?_0x47503f[_0x1573a1(0x1d9)]['warnings']:_0x47503f[_0x1573a1(0x1d9)][_0x1573a1(0x1d8)]['map'](_0x205259=>({..._0x205259,'path':prefixRegistryIssuePath(_0x47503f[_0x1573a1(0x1b8)],_0x205259[_0x1573a1(0x1cd)])})));return{'ok':_0xa9d5bc[_0x1573a1(0x193)]===0x0,'errors':_0xa9d5bc,'warnings':_0x3df592};}function prefixRegistryIssuePath(_0x4f4f5e,_0x4a6545){const _0x4176f9=a42_0x57fb;if(_0x4a6545==='$')return'$.services['+_0x4f4f5e+'].manifest';if(_0x4a6545[_0x4176f9(0x1b6)]('$.'))return'$.services['+_0x4f4f5e+_0x4176f9(0x1ca)+_0x4a6545[_0x4176f9(0x1dc)](0x1);if(_0x4a6545['startsWith']('$['))return _0x4176f9(0x1b5)+_0x4f4f5e+_0x4176f9(0x1ca)+_0x4a6545['slice'](0x1);return _0x4176f9(0x1b5)+_0x4f4f5e+_0x4176f9(0x197)+_0x4a6545;}function isServiceRegistryLike(_0x144d5d){const _0x7a7be3=a42_0x57fb;return isObjectRecord(_0x144d5d)&&_0x144d5d[_0x7a7be3(0x1d3)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x7a7be3(0x1c6)](_0x144d5d[_0x7a7be3(0x1b7)]);}function isObjectRecord(_0x150cb8){const _0x2b5502=a42_0x57fb;return Boolean(_0x150cb8)&&typeof _0x150cb8==='object'&&!Array[_0x2b5502(0x1c6)](_0x150cb8);}function emptyServiceRegistryInspection(_0x198753,_0x482cc3,_0x2104c9){return{'registryPath':_0x198753,'exists':_0x2104c9,'status':_0x482cc3,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x427b00){const _0x76650b=a42_0x57fb,_0x2ba136=_0x427b00['normalizedManifest'],_0x45c134=_0x2ba136['commands']['map'](_0x3cf6e4=>({'path':_0x3cf6e4[_0x76650b(0x1c4)],'description':_0x3cf6e4[_0x76650b(0x19f)],'risk':_0x3cf6e4[_0x76650b(0x1bb)],'targetKind':_0x3cf6e4[_0x76650b(0x1d4)]['kind'],'targetCommand':_0x3cf6e4[_0x76650b(0x1d4)][_0x76650b(0x19b)]}));return{'serviceCode':_0x427b00[_0x76650b(0x1ce)],'name':_0x2ba136[_0x76650b(0x1b3)][_0x76650b(0x1a8)],'description':_0x2ba136[_0x76650b(0x1b3)][_0x76650b(0x19f)],'version':_0x427b00[_0x76650b(0x1a4)],'importedAt':_0x427b00[_0x76650b(0x1ba)],'source':_0x427b00['source'],'commandCount':_0x45c134[_0x76650b(0x193)],'commands':_0x45c134};}function sha256(_0x148cfc){const _0x29fe03=a42_0x57fb;return createHash(_0x29fe03(0x1a2))[_0x29fe03(0x1bc)](_0x148cfc)[_0x29fe03(0x1bd)](_0x29fe03(0x1cb));}
|
|
1
|
+
const a42_0x534e1d=a42_0x1d8f;(function(_0x5dcbac,_0x297d48){const _0x46701e=a42_0x1d8f,_0x5747d2=_0x5dcbac();while(!![]){try{const _0x5807ca=-parseInt(_0x46701e(0x80))/0x1+-parseInt(_0x46701e(0xa8))/0x2*(-parseInt(_0x46701e(0x85))/0x3)+parseInt(_0x46701e(0x9b))/0x4+-parseInt(_0x46701e(0x9d))/0x5+parseInt(_0x46701e(0x84))/0x6*(parseInt(_0x46701e(0x7e))/0x7)+parseInt(_0x46701e(0xb0))/0x8+-parseInt(_0x46701e(0xa7))/0x9;if(_0x5807ca===_0x297d48)break;else _0x5747d2['push'](_0x5747d2['shift']());}catch(_0x1e1047){_0x5747d2['push'](_0x5747d2['shift']());}}}(a42_0x52d7,0x5710b));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';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x534e1d(0xc0);export function getServiceRegistryPath(_0x176e1f={}){const _0xdac5fc=a42_0x534e1d;return resolve(_0x176e1f[_0xdac5fc(0xa5)]??homedir(),PRODUCT_CONFIG[_0xdac5fc(0x99)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x2bbc19={}){const _0x4af001=a42_0x534e1d,_0x54165e=getServiceRegistryPath(_0x2bbc19);if(!existsSync(_0x54165e))return emptyServiceRegistry();try{const _0x447b5c=readFileSync(_0x54165e,_0x4af001(0xc4));if(!_0x447b5c[_0x4af001(0xb3)]())return emptyServiceRegistry();const _0x19cd58=JSON[_0x4af001(0xa0)](_0x447b5c);if(_0x19cd58[_0x4af001(0xcc)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x4af001(0x93)+String(_0x19cd58['schemaVersion']),_0x4af001(0xc3)+_0x54165e+'.');if(!Array['isArray'](_0x19cd58[_0x4af001(0x89)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x19cd58[_0x4af001(0x7d)],'services':_0x19cd58['services']};}catch(_0x2aaa1d){if(_0x2aaa1d instanceof Error&&_0x2aaa1d[_0x4af001(0xa2)]===_0x4af001(0x8e))throw _0x2aaa1d;throw CliErrors[_0x4af001(0x94)](_0x4af001(0xa6)+_0x54165e,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x90c9d3,_0x21bdd9={}){const _0x2f70d7=a42_0x534e1d,_0x11ddb0=getServiceRegistryPath(_0x21bdd9),_0x5dc26f=dirname(_0x11ddb0);!existsSync(_0x5dc26f)&&mkdirSync(_0x5dc26f,{'recursive':!![]});const _0x2f6b60=_0x11ddb0+_0x2f70d7(0xad);try{writeFileSync(_0x2f6b60,JSON[_0x2f70d7(0xb5)](_0x90c9d3,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x2f6b60,_0x11ddb0);}catch(_0x3ebb76){try{unlinkSync(_0x2f6b60);}catch{}if(_0x3ebb76?.[_0x2f70d7(0x9f)]==='ENOENT')throw CliErrors['validation'](_0x2f70d7(0xaf)+_0x11ddb0);throw _0x3ebb76;}return _0x11ddb0;}export function loadServiceManifestFromFile(_0x2da218){const _0x26c08b=a42_0x534e1d,_0x4ee51f=resolve(_0x2da218);if(!existsSync(_0x4ee51f))throw CliErrors[_0x26c08b(0x94)](_0x26c08b(0x9e)+_0x2da218);let _0x7607cc;const _0x51a1c1=readFileSync(_0x4ee51f,_0x26c08b(0xc4));try{_0x7607cc=JSON[_0x26c08b(0xa0)](_0x51a1c1);}catch{throw CliErrors['validation'](_0x26c08b(0x8a)+_0x2da218,_0x26c08b(0xb9));}const _0x25c723=sha256(_0x51a1c1),_0xefe8ea=extractLoadedServiceManifests(_0x7607cc,_0x25c723),_0x8e2807=aggregateValidationReports(_0xefe8ea),_0x27f292=_0xefe8ea[0x0];return{'filePath':_0x4ee51f,'hash':_0x25c723,'kind':isServiceRegistryLike(_0x7607cc)?'registry':_0x26c08b(0xaa),'manifest':_0x27f292?.[_0x26c08b(0xaa)]??_0x7607cc,'report':_0x8e2807,'normalizedManifest':_0xefe8ea[_0x26c08b(0x97)]===0x1?_0x27f292?.['normalizedManifest']:undefined,'manifests':_0xefe8ea};}export function importServiceManifest(_0x2c24e9,_0x5525c1={}){const _0x344a77=a42_0x534e1d,_0x3cdfd3=loadServiceManifestFromFile(_0x2c24e9);if(!_0x3cdfd3[_0x344a77(0x8c)]['ok'])throw CliErrors[_0x344a77(0x94)](formatValidationFailure(_0x3cdfd3[_0x344a77(0x8c)]),_0x344a77(0xb8));if(_0x3cdfd3[_0x344a77(0x91)][_0x344a77(0x97)]===0x0)throw CliErrors['validation'](_0x344a77(0xc9),_0x344a77(0xc2));const _0x4f8fac=readServiceRegistry(_0x5525c1),_0x3cc84c=(_0x5525c1['now']??(()=>new Date()))()['toISOString'](),_0x2cb072=[];let _0x27d796=0x0,_0xf60a7=0x0;for(const _0x23744a of _0x3cdfd3[_0x344a77(0x91)]){if(!_0x23744a['normalizedManifest'])continue;const _0xf8a09a=_0x23744a[_0x344a77(0x95)][_0x344a77(0xb1)][_0x344a77(0x9f)],_0x2a8131={'serviceCode':_0xf8a09a,'version':_0x23744a['normalizedManifest']['version'],'importedAt':_0x3cc84c,'source':{'type':_0x344a77(0x82),'path':_0x3cdfd3['filePath'],'hash':_0x23744a['sourceHash']},'manifest':_0x23744a[_0x344a77(0xaa)],'normalizedManifest':_0x23744a[_0x344a77(0x95)]},_0x183af1=_0x4f8fac[_0x344a77(0x89)][_0x344a77(0xcd)](_0x1976e9=>_0x1976e9[_0x344a77(0xbe)]===_0xf8a09a);_0x183af1>=0x0?(_0x4f8fac['services'][_0x183af1]=_0x2a8131,_0xf60a7++):(_0x4f8fac[_0x344a77(0x89)][_0x344a77(0x8d)](_0x2a8131),_0x27d796++),_0x2cb072['push'](_0x2a8131);}_0x4f8fac['services'][_0x344a77(0x92)]((_0x247272,_0x495988)=>_0x247272[_0x344a77(0xbe)][_0x344a77(0xa3)](_0x495988[_0x344a77(0xbe)])),_0x4f8fac[_0x344a77(0x7d)]=_0x3cc84c;const _0x172231=writeServiceRegistry(_0x4f8fac,_0x5525c1);return{'registryPath':_0x172231,'entry':_0x2cb072[0x0],'replaced':_0x2cb072[_0x344a77(0x97)]===0x1?_0xf60a7===0x1:_0xf60a7>0x0,'entries':_0x2cb072,'imported':_0x27d796,'updated':_0xf60a7,'serviceCount':_0x4f8fac[_0x344a77(0x89)]['length']};}export function exportServiceManifest(_0x449fa2,_0x1e8c73,_0x20c4f7={}){const _0x256c5e=a42_0x534e1d,_0x49b154=getServiceRegistryPath(_0x20c4f7),_0x1040cc=getLocalServiceEntry(_0x449fa2,_0x20c4f7);if(!_0x1040cc)throw CliErrors['validation'](_0x256c5e(0xc5)+_0x449fa2,_0x256c5e(0x98));const _0x21e82d=resolve(_0x1e8c73),_0x168346=dirname(_0x21e82d);return!existsSync(_0x168346)&&mkdirSync(_0x168346,{'recursive':!![]}),writeFileSync(_0x21e82d,JSON[_0x256c5e(0xb5)](_0x1040cc['manifest'],null,0x2)+'\x0a',{'encoding':_0x256c5e(0xc4),'mode':0x180}),{'registryPath':_0x49b154,'filePath':_0x21e82d,'entry':_0x1040cc};}export function removeServiceManifest(_0xe0063,_0x3e6de6={}){const _0x5f3bc8=a42_0x534e1d,_0xa295d1=readServiceRegistry(_0x3e6de6),_0x1dd00c=_0xe0063[_0x5f3bc8(0xb3)](),_0x430d34=_0xa295d1['services'][_0x5f3bc8(0xcd)](_0x3ee7ff=>_0x3ee7ff[_0x5f3bc8(0xbe)]===_0x1dd00c);if(_0x430d34<0x0)throw CliErrors[_0x5f3bc8(0x94)](_0x5f3bc8(0xc5)+_0x1dd00c,_0x5f3bc8(0x98));const [_0x588aa9]=_0xa295d1[_0x5f3bc8(0x89)][_0x5f3bc8(0xc8)](_0x430d34,0x1),_0x4f9679=(_0x3e6de6['now']??(()=>new Date()))()[_0x5f3bc8(0x9a)]();_0xa295d1['updatedAt']=_0x4f9679;const _0x557bdd=writeServiceRegistry(_0xa295d1,_0x3e6de6);return{'registryPath':_0x557bdd,'entry':_0x588aa9,'serviceCount':_0xa295d1[_0x5f3bc8(0x89)]['length']};}export function listLocalServices(_0x4d8478={}){const _0x59b44a=a42_0x534e1d;return readServiceRegistry(_0x4d8478)[_0x59b44a(0x89)];}export function getLocalServiceEntry(_0x252c33,_0x505dea={}){const _0x7cc598=a42_0x534e1d;return readServiceRegistry(_0x505dea)['services'][_0x7cc598(0x9c)](_0x47d680=>_0x47d680[_0x7cc598(0xbe)]===_0x252c33[_0x7cc598(0xb3)]());}export function listLocalServiceTrees(_0x4a1e95={}){const _0x4e22e7=a42_0x534e1d;return readServiceRegistry(_0x4a1e95)[_0x4e22e7(0x89)][_0x4e22e7(0xb7)](_0x4fe038=>_0x4fe038[_0x4e22e7(0x95)]);}function a42_0x52d7(){const _0x3e3141=['sort','Unsupported\x20service\x20registry\x20schemaVersion:\x20','validation','normalizedManifest','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','length','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','homeDirName','toISOString','2602220PDGkdH','find','261455gmBsLZ','Service\x20manifest\x20file\x20not\x20found:\x20','code','parse','].manifest.','name','localeCompare','path','homeDir','Invalid\x20service\x20registry\x20JSON:\x20','3811869mWnDjf','1076KVxWQd','services\x20must\x20be\x20an\x20array','manifest','registryIndex','object','.tmp','slice','Cannot\x20write\x20service\x20registry:\x20','1956808scwyCd','service','flatMap','trim','reduce','stringify','description','map','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','startsWith','Service\x20manifest\x20validation\x20failed:\x0a','$.services[','command','serviceCode','digest','service.json','commandCount','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','Remove\x20or\x20migrate\x20','utf8','Local\x20service\x20not\x20found:\x20','message','warnings','splice','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','importedAt','invalid','schemaVersion','findIndex','join','updatedAt','42qGoPJj','source','266817bVFEPs','kind','file','sha256','9894qsvpzX','1083szEVPd','].manifest','version','target','services','Invalid\x20service\x20manifest\x20JSON:\x20','update','report','push','CliError','isArray','errors','manifests'];a42_0x52d7=function(){return _0x3e3141;};return a42_0x52d7();}export function inspectServiceRegistry(_0x4b087f={}){const _0x51a14c=a42_0x534e1d,_0x316260=getServiceRegistryPath(_0x4b087f);if(!existsSync(_0x316260))return emptyServiceRegistryInspection(_0x316260,'missing',![]);try{const _0x4c1577=readFileSync(_0x316260,_0x51a14c(0xc4));if(!_0x4c1577[_0x51a14c(0xb3)]())return emptyServiceRegistryInspection(_0x316260,'empty',!![]);const _0x3c80a4=JSON[_0x51a14c(0xa0)](_0x4c1577);if(_0x3c80a4[_0x51a14c(0xcc)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x316260,_0x51a14c(0xcb),!![]),'schemaVersion':_0x3c80a4[_0x51a14c(0xcc)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x3c80a4['schemaVersion'])};if(!Array['isArray'](_0x3c80a4[_0x51a14c(0x89)]))return{...emptyServiceRegistryInspection(_0x316260,_0x51a14c(0xcb),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3c80a4[_0x51a14c(0x7d)],'message':_0x51a14c(0xa9)};const _0x599a88=_0x3c80a4['services'][_0x51a14c(0xb7)](summarizeLocalServiceEntry);return{'registryPath':_0x316260,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3c80a4[_0x51a14c(0x7d)],'serviceCount':_0x599a88[_0x51a14c(0x97)],'commandCount':_0x599a88[_0x51a14c(0xb4)]((_0x59bf47,_0x3be134)=>_0x59bf47+_0x3be134[_0x51a14c(0xc1)],0x0),'services':_0x599a88};}catch(_0x15b128){return{...emptyServiceRegistryInspection(_0x316260,_0x51a14c(0xcb),!![]),'message':_0x15b128 instanceof Error?_0x15b128[_0x51a14c(0xc6)]:String(_0x15b128)};}}export function formatValidationFailure(_0x49da38){const _0x264b34=a42_0x534e1d,_0xfffd5d=_0x49da38['errors'][_0x264b34(0xb7)](_0x36f5c6=>_0x36f5c6[_0x264b34(0xa4)]+':\x20'+_0x36f5c6[_0x264b34(0xc6)]);return _0x264b34(0xbb)+_0xfffd5d[_0x264b34(0x7c)]('\x0a');}function extractLoadedServiceManifests(_0x48eda5,_0x4370ce){const _0xba4e7f=a42_0x534e1d;if(!isServiceRegistryLike(_0x48eda5)){const _0x45a933=_0x48eda5,{manifest:_0xecb838,errors:_0x5b4131}=adaptServiceTreeManifestForLegacyFramework(_0x45a933),_0x4d5523=validateServiceTreeManifest(_0xecb838),_0x1e76d6=mergeValidationErrors(_0x4d5523,_0x5b4131);return[{'manifest':_0x45a933,'report':_0x1e76d6,'normalizedManifest':_0x1e76d6['ok']?normalizeServiceTreeManifest(_0xecb838):undefined,'sourceHash':_0x4370ce}];}return _0x48eda5[_0xba4e7f(0x89)][_0xba4e7f(0xb7)]((_0x51802e,_0x514828)=>{const _0x4d9f83=_0xba4e7f,_0x1c2be2=isObjectRecord(_0x51802e)?_0x51802e[_0x4d9f83(0xaa)]:undefined,{manifest:_0x151f47,errors:_0x8498a2}=adaptServiceTreeManifestForLegacyFramework(_0x1c2be2),_0xf69dca=validateServiceTreeManifest(_0x151f47),_0x16294c=mergeValidationErrors(_0xf69dca,_0x8498a2),_0x384ac1=isObjectRecord(_0x51802e)&&typeof _0x51802e[_0x4d9f83(0xbe)]==='string'?_0x51802e[_0x4d9f83(0xbe)]:undefined;return{'manifest':_0x1c2be2,'report':_0x16294c,'normalizedManifest':_0x16294c['ok']?normalizeServiceTreeManifest(_0x151f47):undefined,'sourceHash':sha256(JSON[_0x4d9f83(0xb5)](_0x1c2be2,null,0x2)+'\x0a'),'registryIndex':_0x514828,'registryServiceCode':_0x384ac1};});}function a42_0x1d8f(_0x468203,_0x5b0633){_0x468203=_0x468203-0x7c;const _0x52d732=a42_0x52d7();let _0x1d8f54=_0x52d732[_0x468203];return _0x1d8f54;}function mergeValidationErrors(_0x4fd8ef,_0x572232){const _0x2462db=a42_0x534e1d,_0x3e3c5b=_0x4fd8ef[_0x2462db(0x90)][_0x2462db(0xb7)](_0xbad098=>_0xbad098['message']===_0x2462db(0x96)?{..._0xbad098,'message':'bff\x20target\x20requires\x20functionName.'}:_0xbad098),_0x123645=[..._0x572232,..._0x3e3c5b];return{'ok':_0x123645[_0x2462db(0x97)]===0x0,'errors':_0x123645,'warnings':_0x4fd8ef[_0x2462db(0xc7)]};}function aggregateValidationReports(_0x1d024e){const _0x2e1d3f=a42_0x534e1d,_0x4e74e4=_0x1d024e[_0x2e1d3f(0xb2)](_0x3320d7=>_0x3320d7[_0x2e1d3f(0xab)]===undefined?_0x3320d7['report'][_0x2e1d3f(0x90)]:_0x3320d7[_0x2e1d3f(0x8c)][_0x2e1d3f(0x90)][_0x2e1d3f(0xb7)](_0x388e2d=>({..._0x388e2d,'path':prefixRegistryIssuePath(_0x3320d7[_0x2e1d3f(0xab)],_0x388e2d['path'])}))),_0x3ac110=_0x1d024e[_0x2e1d3f(0xb2)](_0x418e27=>_0x418e27[_0x2e1d3f(0xab)]===undefined?_0x418e27[_0x2e1d3f(0x8c)]['warnings']:_0x418e27[_0x2e1d3f(0x8c)][_0x2e1d3f(0xc7)][_0x2e1d3f(0xb7)](_0x39dbc0=>({..._0x39dbc0,'path':prefixRegistryIssuePath(_0x418e27['registryIndex'],_0x39dbc0['path'])})));return{'ok':_0x4e74e4[_0x2e1d3f(0x97)]===0x0,'errors':_0x4e74e4,'warnings':_0x3ac110};}function prefixRegistryIssuePath(_0x1b3114,_0x361f08){const _0x3686eb=a42_0x534e1d;if(_0x361f08==='$')return'$.services['+_0x1b3114+'].manifest';if(_0x361f08[_0x3686eb(0xba)]('$.'))return'$.services['+_0x1b3114+_0x3686eb(0x86)+_0x361f08['slice'](0x1);if(_0x361f08[_0x3686eb(0xba)]('$['))return _0x3686eb(0xbc)+_0x1b3114+'].manifest'+_0x361f08[_0x3686eb(0xae)](0x1);return _0x3686eb(0xbc)+_0x1b3114+_0x3686eb(0xa1)+_0x361f08;}function isServiceRegistryLike(_0x1a689a){const _0x29042e=a42_0x534e1d;return isObjectRecord(_0x1a689a)&&_0x1a689a[_0x29042e(0xcc)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x29042e(0x8f)](_0x1a689a[_0x29042e(0x89)]);}function isObjectRecord(_0x14c30c){const _0x5a5905=a42_0x534e1d;return Boolean(_0x14c30c)&&typeof _0x14c30c===_0x5a5905(0xac)&&!Array['isArray'](_0x14c30c);}function emptyServiceRegistryInspection(_0x6be3c2,_0x513983,_0x45fbcd){return{'registryPath':_0x6be3c2,'exists':_0x45fbcd,'status':_0x513983,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x2166d7){const _0x3d15a6=a42_0x534e1d,_0x53524f=_0x2166d7[_0x3d15a6(0x95)],_0x5a2a0f=_0x53524f['commands'][_0x3d15a6(0xb7)](_0x336e33=>({'path':_0x336e33['cliPath'],'description':_0x336e33[_0x3d15a6(0xb6)],'risk':_0x336e33['risk'],'targetKind':_0x336e33['target'][_0x3d15a6(0x81)],'targetCommand':_0x336e33[_0x3d15a6(0x88)][_0x3d15a6(0xbd)]}));return{'serviceCode':_0x2166d7['serviceCode'],'name':_0x53524f[_0x3d15a6(0xb1)][_0x3d15a6(0xa2)],'description':_0x53524f['service'][_0x3d15a6(0xb6)],'version':_0x2166d7[_0x3d15a6(0x87)],'importedAt':_0x2166d7[_0x3d15a6(0xca)],'source':_0x2166d7[_0x3d15a6(0x7f)],'commandCount':_0x5a2a0f[_0x3d15a6(0x97)],'commands':_0x5a2a0f};}function sha256(_0xf30f5){const _0x1e940d=a42_0x534e1d;return createHash(_0x1e940d(0x83))[_0x1e940d(0x8b)](_0xf30f5)[_0x1e940d(0xbf)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x4f7ec6=a43_0x49c5;(function(_0x16005f,_0x7c4764){const _0x3b8891=a43_0x49c5,_0x5da56d=_0x16005f();while(!![]){try{const _0x75d000=parseInt(_0x3b8891(0x15d))/0x1*(parseInt(_0x3b8891(0x14a))/0x2)+parseInt(_0x3b8891(0x15b))/0x3+parseInt(_0x3b8891(0x141))/0x4+parseInt(_0x3b8891(0x147))/0x5+-parseInt(_0x3b8891(0x154))/0x6*(parseInt(_0x3b8891(0x159))/0x7)+parseInt(_0x3b8891(0x14c))/0x8+-parseInt(_0x3b8891(0x15a))/0x9*(parseInt(_0x3b8891(0x146))/0xa);if(_0x75d000===_0x7c4764)break;else _0x5da56d['push'](_0x5da56d['shift']());}catch(_0x2af349){_0x5da56d['push'](_0x5da56d['shift']());}}}(a43_0x5bab,0xd2170));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.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':a43_0x4f7ec6(0x14b),'command':a43_0x4f7ec6(0x155),'description':'创建本地自包含的运行态\x20Skill\x20草稿','risk':a43_0x4f7ec6(0x15e),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x5bc941){const _0x4a29df=a43_0x4f7ec6,_0x38b0a0=buildSkillCreatePlan(_0x5bc941[_0x4a29df(0x151)](_0x4a29df(0x152)),_0x5bc941[_0x4a29df(0x151)](_0x4a29df(0x14e)),_0x5bc941[_0x4a29df(0x151)](_0x4a29df(0x143)));return{'method':_0x4a29df(0x162),'url':_0x38b0a0[_0x4a29df(0x161)],'body':{'skillName':_0x38b0a0['rendered'][_0x4a29df(0x163)],'type':_0x38b0a0[_0x4a29df(0x15c)][_0x4a29df(0x14e)],'selfContained':!![],'files':_0x38b0a0[_0x4a29df(0x15c)][_0x4a29df(0x15f)]['map'](_0x3acdc6=>_0x3acdc6['path'])},'description':_0x4a29df(0x145)};},async 'execute'(_0x457411){const _0x59359f=a43_0x4f7ec6,_0x115852=buildSkillCreatePlan(_0x457411['str'](_0x59359f(0x152)),_0x457411[_0x59359f(0x151)]('type'),_0x457411[_0x59359f(0x151)](_0x59359f(0x143)));return writeSkillDraft(_0x115852,_0x457411[_0x59359f(0x157)]('force')),{'ok':!![],'data':{'skillName':_0x115852['rendered'][_0x59359f(0x163)],'type':_0x115852[_0x59359f(0x15c)][_0x59359f(0x14e)],'dir':_0x115852[_0x59359f(0x161)],'files':_0x115852['rendered'][_0x59359f(0x15f)]['map'](_0x371d97=>_0x371d97['path'])},'message':_0x59359f(0x149)+_0x115852[_0x59359f(0x15c)][_0x59359f(0x163)]};}};function buildSkillCreatePlan(_0x595e62,_0x2544cd,_0x2d2ef7){const _0x25f476=a43_0x4f7ec6,_0x5bffaa=_0x2544cd[_0x25f476(0x153)](),_0x42ad5c=renderSkillTemplate({'skillName':_0x595e62,'type':_0x5bffaa});!_0x5bffaa&&writeCliSideChannelLine(_0x25f476(0x142));const _0x54f253=resolve(normalizeSkillTarget(_0x2d2ef7));return{'rendered':_0x42ad5c,'targetRoot':_0x54f253,'skillDir':resolve(_0x54f253,_0x42ad5c['skillName'])};}function normalizeSkillTarget(_0x5c75e5){const _0x22d9b0=a43_0x4f7ec6;return(_0x5c75e5||DEFAULT_SKILL_TARGET)[_0x22d9b0(0x153)]()||DEFAULT_SKILL_TARGET;}function a43_0x49c5(_0x1c817d,_0x1c8d41){_0x1c817d=_0x1c817d-0x141;const _0x5bab2f=a43_0x5bab();let _0x49c5ea=_0x5bab2f[_0x1c817d];return _0x49c5ea;}function a43_0x5bab(){const _0x13b14e=['Refusing\x20to\x20overwrite\x20symlink:\x20','isDirectory','str','name','trim','369102cxeVtP','create','path','bool','content','91luPNbg','306awSRGY','1805289rhqRuE','rendered','1MxUlnn','write','files','isSymbolicLink','skillDir','WRITE','skillName','984272BeSGPi','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','target','validation','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','201830cNmlil','2606320GglqVP','utf8','Created\x20local\x20Skill\x20draft\x20','141686qnkHhY','skill','7252264YCFxbu','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','type'];a43_0x5bab=function(){return _0x13b14e;};return a43_0x5bab();}function writeSkillDraft(_0x31e11d,_0x666086){const _0x109a5c=a43_0x4f7ec6;if(existsSync(_0x31e11d[_0x109a5c(0x161)])){const _0x448f7c=lstatSync(_0x31e11d[_0x109a5c(0x161)]);if(!_0x448f7c[_0x109a5c(0x150)]()||_0x448f7c['isSymbolicLink']())throw CliErrors[_0x109a5c(0x144)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x31e11d[_0x109a5c(0x161)]);if(!_0x666086)throw CliErrors['validation']('Skill\x20directory\x20already\x20exists:\x20'+_0x31e11d[_0x109a5c(0x161)],_0x109a5c(0x14d));}for(const _0x4d3508 of _0x31e11d['rendered']['files']){const _0x36aad6=resolve(_0x31e11d[_0x109a5c(0x161)],_0x4d3508[_0x109a5c(0x156)]),_0xdde01b=dirname(_0x36aad6);mkdirSync(_0xdde01b,{'recursive':!![]});if(existsSync(_0x36aad6)&&lstatSync(_0x36aad6)[_0x109a5c(0x160)]())throw CliErrors['validation'](_0x109a5c(0x14f)+_0x36aad6);writeFileSync(_0x36aad6,_0x4d3508[_0x109a5c(0x158)],_0x109a5c(0x148));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x161cd1=a44_0x49b1;(function(_0x9ae7fe,_0x144864){const _0x2f8763=a44_0x49b1,_0x1fc19f=_0x9ae7fe();while(!![]){try{const _0x13a7e4=-parseInt(_0x2f8763(0x177))/0x1*(-parseInt(_0x2f8763(0x192))/0x2)+parseInt(_0x2f8763(0x197))/0x3+-parseInt(_0x2f8763(0x18b))/0x4*(-parseInt(_0x2f8763(0x179))/0x5)+parseInt(_0x2f8763(0x187))/0x6+parseInt(_0x2f8763(0x19b))/0x7*(-parseInt(_0x2f8763(0x172))/0x8)+parseInt(_0x2f8763(0x16e))/0x9+parseInt(_0x2f8763(0x183))/0xa*(-parseInt(_0x2f8763(0x180))/0xb);if(_0x13a7e4===_0x144864)break;else _0x1fc19f['push'](_0x1fc19f['shift']());}catch(_0x246b30){_0x1fc19f['push'](_0x1fc19f['shift']());}}}(a44_0x4775,0xf364a));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x4775(){const _0x4e1536=['str','7pagdPD','read','\x20is\x20unchanged.','personal','17336844tBCqem','diagram-validate','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','write','1482264qfWtGr','expectedDiagramRevision','Created','appCode','found','38zAmmVJ','scope','134765jukGXF','\x20Skill\x20diagram\x20for\x20','diagram-push','Skill\x20diagram\x20for\x20','unchanged','diagram-file','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','33ZqYGpG','Skill\x20diagram\x20validation\x20passed\x20for\x20','created','13661430zEFqQS','num','skill',';\x20next\x20write\x20expects\x20revision\x20','3750084LtBsgL','skillCode','version','validation','8mmFVtq','skill-code','trim','Updated','company','isInteger','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','63548goZBwu','source-fingerprint','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','diagram-show','action','4404006bUMvJR','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.'];a44_0x4775=function(){return _0x4e1536;};return a44_0x4775();}import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function a44_0x49b1(_0x3572df,_0x2eb17){_0x3572df=_0x3572df-0x16b;const _0x47750e=a44_0x4775();let _0x49b19c=_0x47750e[_0x3572df];return _0x49b19c;}function readDiagramTarget(_0x7a5775){const _0x54d3ff=a44_0x49b1,_0x42c610=_0x7a5775['str'](_0x54d3ff(0x18c))[_0x54d3ff(0x18d)](),_0x4157ee=_0x7a5775[_0x54d3ff(0x19a)](_0x54d3ff(0x189))[_0x54d3ff(0x18d)](),_0x337c46=_0x7a5775[_0x54d3ff(0x19a)](_0x54d3ff(0x178));if(!_0x42c610||!_0x4157ee||_0x337c46!==_0x54d3ff(0x16d)&&_0x337c46!==_0x54d3ff(0x18f))throw CliErrors[_0x54d3ff(0x18a)](_0x54d3ff(0x17f));return{'skillCode':_0x42c610,'version':_0x4157ee,'scope':_0x337c46};}async function readDiagramWriteInput(_0x580bef){const _0x1b5191=a44_0x49b1,_0x20b1d3=_0x580bef[_0x1b5191(0x184)]('expected-diagram-revision'),_0xe54fb8=_0x580bef[_0x1b5191(0x19a)](_0x1b5191(0x193))[_0x1b5191(0x18d)]();if(!Number[_0x1b5191(0x190)](_0x20b1d3)||_0x20b1d3<0x0)throw CliErrors[_0x1b5191(0x18a)](_0x1b5191(0x170));if(!/^sha256:[0-9a-f]{64}$/['test'](_0xe54fb8))throw CliErrors[_0x1b5191(0x18a)](_0x1b5191(0x199));return{'expectedDiagramRevision':_0x20b1d3,'sourceFingerprint':_0xe54fb8,'diagram':await readRequiredSkillDiagram(_0x580bef[_0x1b5191(0x19a)](_0x1b5191(0x17e)))};}export const diagramValidateCommand={'service':a44_0x161cd1(0x185),'command':a44_0x161cd1(0x16f),'description':a44_0x161cd1(0x198),'risk':a44_0x161cd1(0x16b),'flags':WRITE_FLAGS,async 'execute'(_0x2573ad){const _0x6c7a51=a44_0x161cd1,_0x39794d=readDiagramTarget(_0x2573ad),_0x41734d=await validateRuntimeSkillVersionDiagram(_0x2573ad[_0x6c7a51(0x175)],_0x39794d[_0x6c7a51(0x188)],_0x39794d[_0x6c7a51(0x189)],_0x39794d[_0x6c7a51(0x178)],await readDiagramWriteInput(_0x2573ad));return{'ok':!![],'data':_0x41734d,'message':_0x6c7a51(0x181)+_0x39794d[_0x6c7a51(0x188)]+'@'+_0x39794d[_0x6c7a51(0x189)]+'.'};}};export const diagramPushCommand={'service':a44_0x161cd1(0x185),'command':a44_0x161cd1(0x17b),'description':a44_0x161cd1(0x191),'risk':a44_0x161cd1(0x171),'flags':WRITE_FLAGS,async 'execute'(_0x16992b){const _0x20f17b=a44_0x161cd1,_0x4e196c=readDiagramTarget(_0x16992b),_0x574a6a=await putRuntimeSkillVersionDiagram(_0x16992b['appCode'],_0x4e196c['skillCode'],_0x4e196c[_0x20f17b(0x189)],_0x4e196c[_0x20f17b(0x178)],await readDiagramWriteInput(_0x16992b));return{'ok':!![],'data':_0x574a6a,'message':_0x574a6a[_0x20f17b(0x196)]===_0x20f17b(0x17d)?_0x20f17b(0x17c)+_0x4e196c[_0x20f17b(0x188)]+'@'+_0x4e196c[_0x20f17b(0x189)]+_0x20f17b(0x16c):(_0x574a6a['action']===_0x20f17b(0x182)?_0x20f17b(0x174):_0x20f17b(0x18e))+_0x20f17b(0x17a)+_0x4e196c[_0x20f17b(0x188)]+'@'+_0x4e196c[_0x20f17b(0x189)]+'.'};}};export const diagramShowCommand={'service':a44_0x161cd1(0x185),'command':a44_0x161cd1(0x195),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':'read','flags':TARGET_FLAGS,async 'execute'(_0xd7a64f){const _0x4316f2=a44_0x161cd1,_0x4c31bf=readDiagramTarget(_0xd7a64f),_0x58e04d=await getRuntimeSkillVersionDiagram(_0xd7a64f[_0x4316f2(0x175)],_0x4c31bf['skillCode'],_0x4c31bf[_0x4316f2(0x189)],_0x4c31bf[_0x4316f2(0x178)]);return{'ok':!![],'data':_0x58e04d,'message':_0x58e04d[_0x4316f2(0x176)]?'Found\x20Skill\x20diagram\x20for\x20'+_0x4c31bf[_0x4316f2(0x188)]+'@'+_0x4c31bf[_0x4316f2(0x189)]+_0x4316f2(0x186)+_0x58e04d[_0x4316f2(0x173)]+'.':_0x4316f2(0x194)+_0x4c31bf[_0x4316f2(0x188)]+'@'+_0x4c31bf[_0x4316f2(0x189)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x58e04d[_0x4316f2(0x173)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x28f176=a45_0xe43d;function a45_0xa25e(){const _0x52a498=['accessKey','envName','341300bhTjDT','603jcGqrE','4HOkcUH','128490SReDwD','1465962HdTIEK','global','includes','skillCode','version','scope','filter','trim','personal','appCode','project','force','1947CVKcXB','code','production','Installed\x20','flatMap','681378mMZCtT','install','company','32824XkqyOL','skipped','\x20company\x20Skill(s).','1209260yIixEm','removed','unchanged','1112010SwYKRO','push','bool','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','reduce','7tqxpzl','skillRoots','updated','\x20personal\x20and\x20','action','length','map'];a45_0xa25e=function(){return _0x52a498;};return a45_0xa25e();}(function(_0x4f1dd4,_0x1f705a){const _0xf0dc22=a45_0xe43d,_0x4df2ee=_0x4f1dd4();while(!![]){try{const _0x2f90d5=-parseInt(_0xf0dc22(0x14b))/0x1+-parseInt(_0xf0dc22(0x151))/0x2+-parseInt(_0xf0dc22(0x166))/0x3*(parseInt(_0xf0dc22(0x164))/0x4)+-parseInt(_0xf0dc22(0x162))/0x5+parseInt(_0xf0dc22(0x154))/0x6*(parseInt(_0xf0dc22(0x159))/0x7)+-parseInt(_0xf0dc22(0x14e))/0x8*(parseInt(_0xf0dc22(0x163))/0x9)+parseInt(_0xf0dc22(0x165))/0xa*(parseInt(_0xf0dc22(0x146))/0xb);if(_0x2f90d5===_0x1f705a)break;else _0x4df2ee['push'](_0x4df2ee['shift']());}catch(_0x108f57){_0x4df2ee['push'](_0x4df2ee['shift']());}}}(a45_0xa25e,0x53719));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';function a45_0xe43d(_0x531c07,_0x5357f5){_0x531c07=_0x531c07-0x146;const _0xa25eb3=a45_0xa25e();let _0xe43de8=_0xa25eb3[_0x531c07];return _0xe43de8;}import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x28f176(0x14c),'description':a45_0x28f176(0x157),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x45d1ce){return syncRuntimeSkills(_0x45d1ce);}};async function syncRuntimeSkills(_0xbb95f4){const _0x2afe33=a45_0x28f176,{downloadRuntimeSkillPackage:_0x55a2b5,listRuntimeSkills:_0x485dd5}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x3f9142,materializeRuntimeSkill:_0x1d91f4,pruneStaleRuntimeSkillCache:_0x1105cb,pruneStaleRuntimeSkillLinks:_0x41159c,resolveRuntimeSkillInstallTarget:_0xa2f74d}=await import('../../../skills/runtime-skill-sync.js'),_0x433283=_0xbb95f4['str'](_0x2afe33(0x147)),_0xc0e3e2=normalizeSyncScopes(_0xbb95f4['str'](_0x2afe33(0x16b))),_0xfe5711=_0xbb95f4[_0x2afe33(0x161)]??_0x2afe33(0x148),_0x5f3a5a=_0xbb95f4[_0x2afe33(0x160)],_0x165269=_0xbb95f4['bool'](_0x2afe33(0x171));if(!_0x5f3a5a)throw CliErrors['authRequired']('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0xbd430f=_0xa2f74d(_0xbb95f4[_0x2afe33(0x16f)],_0xbb95f4[_0x2afe33(0x156)](_0x2afe33(0x170))?_0x2afe33(0x170):_0x2afe33(0x167)),_0x5150c1=_0xa2f74d(_0xbb95f4['appCode'],_0xbd430f['scope']==='project'?_0x2afe33(0x167):_0x2afe33(0x170)),_0x4781bc=await Promise['all'](_0xc0e3e2[_0x2afe33(0x15f)](_0x41dbe7=>_0x485dd5({'appCode':_0xbb95f4[_0x2afe33(0x16f)],'scope':_0x41dbe7,'code':_0x433283[_0x2afe33(0x16d)]()||undefined}))),_0x56f905=_0xc0e3e2['includes']('personal')?_0x4781bc[_0x2afe33(0x14a)]((_0x153357,_0x2f8f74)=>_0xc0e3e2[_0x2f8f74]===_0x2afe33(0x16e)?_0x153357[_0x2afe33(0x16e)]:[]):[],_0x4c0a4a=_0xc0e3e2[_0x2afe33(0x168)](_0x2afe33(0x14d))?_0x4781bc[_0x2afe33(0x14a)]((_0x1ff95b,_0x11a738)=>_0xc0e3e2[_0x11a738]==='company'?_0x1ff95b[_0x2afe33(0x14d)]:[]):[],_0xdc5af8=new Set([..._0x56f905[_0x2afe33(0x15f)](_0x247611=>_0x247611[_0x2afe33(0x169)]?.[_0x2afe33(0x16d)]())[_0x2afe33(0x16c)](_0x3946a9=>Boolean(_0x3946a9)),..._0x4c0a4a[_0x2afe33(0x15f)](_0x4ac734=>_0x4ac734['skillCode']?.[_0x2afe33(0x16d)]())[_0x2afe33(0x16c)](_0x173c3d=>Boolean(_0x173c3d))]),_0x4ee3d1=_0x433283[_0x2afe33(0x16d)]()?[_0x433283[_0x2afe33(0x16d)]()]:undefined,_0x15f15e=_0xc0e3e2[_0x2afe33(0x15e)]===0x2&&_0xc0e3e2[_0x2afe33(0x168)](_0x2afe33(0x16e))&&_0xc0e3e2[_0x2afe33(0x168)](_0x2afe33(0x14d)),_0x21005c=_0x15f15e?_0x41159c(_0xbd430f,_0xdc5af8,_0x4ee3d1):[],_0xd7270c=_0x1105cb({'env':_0xfe5711,'accessKey':_0x5f3a5a,'appCode':_0xbb95f4[_0x2afe33(0x16f)],'activeSkillCodes':_0xdc5af8,'pruneSkillCodes':_0x4ee3d1,'scopes':_0xc0e3e2,'protectedLinkRoots':_0x5150c1[_0x2afe33(0x15a)]}),_0x51acb0=[];for(const _0x13ec5c of _0x56f905){_0x51acb0[_0x2afe33(0x155)](_0x1d91f4(_0x13ec5c,_0x2afe33(0x16e),{'env':_0xfe5711,'accessKey':_0x5f3a5a,'appCode':_0xbb95f4[_0x2afe33(0x16f)],'force':_0x165269,'packageBytes':await downloadSkillPackage(_0x13ec5c,_0x2afe33(0x16e),_0xbb95f4[_0x2afe33(0x16f)],_0x55a2b5)}));}for(const _0x1ce95d of _0x4c0a4a){_0x51acb0['push'](_0x1d91f4(_0x1ce95d,_0x2afe33(0x14d),{'env':_0xfe5711,'accessKey':_0x5f3a5a,'appCode':_0xbb95f4[_0x2afe33(0x16f)],'force':_0x165269,'packageBytes':await downloadSkillPackage(_0x1ce95d,_0x2afe33(0x14d),_0xbb95f4[_0x2afe33(0x16f)],_0x55a2b5)}));}const _0x54d240=_0x3f9142(_0x51acb0,_0xbd430f),_0x2b85d0=countLinkActions(_0x54d240);return{'ok':!![],'data':{'appCode':_0xbb95f4['appCode'],..._0xbd430f[_0x2afe33(0x16b)]===_0x2afe33(0x170)?{'installTarget':{'scope':_0xbd430f[_0x2afe33(0x16b)],'skillRoots':[..._0xbd430f[_0x2afe33(0x15a)]]}}:{},'personal':_0x56f905['length'],'company':_0x4c0a4a[_0x2afe33(0x15e)],'materialized':_0x51acb0[_0x2afe33(0x15e)],'links':{'total':_0x54d240['length'],'created':_0x2b85d0['created']??0x0,'updated':_0x2b85d0[_0x2afe33(0x15b)]??0x0,'unchanged':_0x2b85d0[_0x2afe33(0x153)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x21005c[_0x2afe33(0x16c)](_0x456674=>_0x456674[_0x2afe33(0x15d)]==='removed')[_0x2afe33(0x15e)],'cacheDirs':_0xd7270c['filter'](_0x547c6d=>_0x547c6d[_0x2afe33(0x15d)]===_0x2afe33(0x152))[_0x2afe33(0x15e)],'skipped':[..._0x21005c,..._0xd7270c][_0x2afe33(0x16c)](_0xbc5bd9=>_0xbc5bd9[_0x2afe33(0x15d)]===_0x2afe33(0x14f))['length']},'skills':{'personal':_0x56f905['map'](summarizeRuntimeSkill),'company':_0x4c0a4a[_0x2afe33(0x15f)](summarizeRuntimeSkill)}},'message':_0x2afe33(0x149)+_0x56f905[_0x2afe33(0x15e)]+_0x2afe33(0x15c)+_0x4c0a4a[_0x2afe33(0x15e)]+_0x2afe33(0x150)};}async function downloadSkillPackage(_0x320a85,_0x54273b,_0xd9ebc,_0x4d1cd4){const _0x598dfe=a45_0x28f176,_0x3c9350=_0x320a85[_0x598dfe(0x16a)]?.[_0x598dfe(0x16d)]();return _0x3c9350?_0x4d1cd4(_0x54273b,_0x320a85[_0x598dfe(0x169)],_0xd9ebc,_0x3c9350):_0x4d1cd4(_0x54273b,_0x320a85[_0x598dfe(0x169)],_0xd9ebc);}function countLinkActions(_0x90ff2f){const _0xacbd1f=a45_0x28f176;return _0x90ff2f[_0xacbd1f(0x158)]((_0x59a4a1,_0x31ae90)=>{const _0xb62802=_0xacbd1f;return _0x59a4a1[_0x31ae90[_0xb62802(0x15d)]]=(_0x59a4a1[_0x31ae90['action']]??0x0)+0x1,_0x59a4a1;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x3c4ede=a46_0x1859;(function(_0x35cbf0,_0x112d4f){const _0x269ceb=a46_0x1859,_0x40b09d=_0x35cbf0();while(!![]){try{const _0x21948d=-parseInt(_0x269ceb(0x16d))/0x1+parseInt(_0x269ceb(0x162))/0x2+-parseInt(_0x269ceb(0x154))/0x3+parseInt(_0x269ceb(0x16a))/0x4*(parseInt(_0x269ceb(0x155))/0x5)+-parseInt(_0x269ceb(0x157))/0x6+parseInt(_0x269ceb(0x159))/0x7+-parseInt(_0x269ceb(0x16e))/0x8;if(_0x21948d===_0x112d4f)break;else _0x40b09d['push'](_0x40b09d['shift']());}catch(_0x1ac630){_0x40b09d['push'](_0x40b09d['shift']());}}}(a46_0x58fe,0xebda9));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x3c4ede(0x171),'command':a46_0x3c4ede(0x169),'description':a46_0x3c4ede(0x16f),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2ec2f7){const _0x3efa2d=a46_0x3c4ede,_0x154b98=_0x2ec2f7[_0x3efa2d(0x163)](_0x3efa2d(0x161)),_0x4852a3=normalizeListScope(_0x2ec2f7['str'](_0x3efa2d(0x16c)));if(_0x2ec2f7[_0x3efa2d(0x152)](_0x3efa2d(0x15a))){const _0x529e1a=_0x2ec2f7[_0x3efa2d(0x15f)];if(!_0x529e1a)throw CliErrors[_0x3efa2d(0x165)]();const {listLocalRuntimeSkills:_0x2849c1,resolveRuntimeSkillInstallTarget:_0x1457b3}=await import(_0x3efa2d(0x164)),_0x2ff679=_0x1457b3(_0x2ec2f7['appCode'],_0x2ec2f7[_0x3efa2d(0x152)](_0x3efa2d(0x15d))?'project':'global'),_0x5108fb=_0x2849c1({'env':_0x2ec2f7['envName']??_0x3efa2d(0x160),'accessKey':_0x529e1a,'appCode':_0x2ec2f7[_0x3efa2d(0x15b)],'scopes':listScopeToRuntimeScopes(_0x4852a3),'code':_0x154b98[_0x3efa2d(0x158)]()||undefined},_0x2ff679),_0x3db156=groupLocalRuntimeSkills(_0x5108fb);return{'ok':!![],'data':{'appCode':_0x2ec2f7[_0x3efa2d(0x15b)],'source':_0x3efa2d(0x15a),..._0x2ff679[_0x3efa2d(0x16c)]===_0x3efa2d(0x15d)?{'installScope':_0x2ff679[_0x3efa2d(0x16c)]}:{},'scope':_0x4852a3,'total':_0x5108fb['length'],'personal':_0x3db156[_0x3efa2d(0x16b)][_0x3efa2d(0x156)],'company':_0x3db156['company'][_0x3efa2d(0x156)],'items':_0x5108fb['map'](summarizeLocalRuntimeSkill),'skills':{'personal':_0x3db156[_0x3efa2d(0x16b)][_0x3efa2d(0x166)](summarizeLocalRuntimeSkill),'company':_0x3db156[_0x3efa2d(0x167)][_0x3efa2d(0x166)](summarizeLocalRuntimeSkill)}},'message':_0x3efa2d(0x153)+_0x5108fb[_0x3efa2d(0x156)]+_0x3efa2d(0x168)};}const {listRuntimeSkills:_0x99645a}=await import(_0x3efa2d(0x172)),_0xa70c68=await _0x99645a({'appCode':_0x2ec2f7['appCode'],'scope':listScopeToRemoteScope(_0x4852a3),'code':_0x154b98['trim']()||undefined}),_0x1e09af=shouldListScope(_0x4852a3,_0x3efa2d(0x16b))?_0xa70c68['personal']??[]:[],_0x3e3d17=shouldListScope(_0x4852a3,_0x3efa2d(0x167))?_0xa70c68['company']??[]:[],_0x17e86d=[..._0x1e09af,..._0x3e3d17];return{'ok':!![],'data':{'appCode':_0x2ec2f7[_0x3efa2d(0x15b)],'source':_0x3efa2d(0x173),'scope':_0x4852a3,'total':_0x17e86d[_0x3efa2d(0x156)],'personal':_0x1e09af[_0x3efa2d(0x156)],'company':_0x3e3d17['length'],'items':_0x17e86d[_0x3efa2d(0x166)](summarizeRuntimeSkill),'skills':{'personal':_0x1e09af['map'](summarizeRuntimeSkill),'company':_0x3e3d17[_0x3efa2d(0x166)](summarizeRuntimeSkill)}},'message':_0x3efa2d(0x153)+_0x17e86d[_0x3efa2d(0x156)]+_0x3efa2d(0x15e)};}};function a46_0x58fe(){const _0x482124=['bool','Listed\x20','5350011MghYPL','545DCVWLk','length','2045454FdCxCt','trim','8653624XBaNHP','local','appCode','builtin','project','\x20remote\x20Skill(s).','accessKey','production','code','2824740ehYFFp','str','../../../skills/runtime-skill-sync.js','authRequired','map','company','\x20local\x20Skill(s).','list','53296eBlYen','personal','scope','325919VUyfEf','5477568BPEPVO','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','filter','skill','../../../core/api-client.js','remote'];a46_0x58fe=function(){return _0x482124;};return a46_0x58fe();}function a46_0x1859(_0x5765c9,_0x57dd69){_0x5765c9=_0x5765c9-0x152;const _0x58fec6=a46_0x58fe();let _0x185936=_0x58fec6[_0x5765c9];return _0x185936;}function groupLocalRuntimeSkills(_0x5f35d7){const _0x51f9cc=a46_0x3c4ede;return{'personal':_0x5f35d7[_0x51f9cc(0x170)](_0x59930b=>_0x59930b[_0x51f9cc(0x16c)]==='personal'),'company':_0x5f35d7[_0x51f9cc(0x170)](_0x3dea26=>_0x3dea26[_0x51f9cc(0x16c)]===_0x51f9cc(0x167)),'builtin':_0x5f35d7[_0x51f9cc(0x170)](_0x1be346=>_0x1be346[_0x51f9cc(0x16c)]===_0x51f9cc(0x15c))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x21c7(){const _0x40fb1b=['skill','6DPIWkM','6416135pJdDwK','620337WsAMLw','push','1123128VceWNE','2940406dvTLum','write','2EhfFIU','2120176rnIxAl','651048XaUepo','1211599JfAMYf','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核'];a47_0x21c7=function(){return _0x40fb1b;};return a47_0x21c7();}const a47_0x4d9bc9=a47_0x260a;(function(_0x2cec21,_0x28e107){const _0x31c508=a47_0x260a,_0x6cc007=_0x2cec21();while(!![]){try{const _0x1f582c=-parseInt(_0x31c508(0x1d4))/0x1*(parseInt(_0x31c508(0x1de))/0x2)+parseInt(_0x31c508(0x1d9))/0x3+parseInt(_0x31c508(0x1d3))/0x4+parseInt(_0x31c508(0x1d8))/0x5+-parseInt(_0x31c508(0x1d7))/0x6*(-parseInt(_0x31c508(0x1dc))/0x7)+-parseInt(_0x31c508(0x1df))/0x8+parseInt(_0x31c508(0x1db))/0x9;if(_0x1f582c===_0x28e107)break;else _0x6cc007['push'](_0x6cc007['shift']());}catch(_0x3ededf){_0x6cc007['push'](_0x6cc007['shift']());}}}(a47_0x21c7,0xb0065));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';function a47_0x260a(_0x2a6b63,_0x3cf2da){_0x2a6b63=_0x2a6b63-0x1d3;const _0x21c747=a47_0x21c7();let _0x260a4f=_0x21c747[_0x2a6b63];return _0x260a4f;}import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':a47_0x4d9bc9(0x1d6),'command':a47_0x4d9bc9(0x1da),'description':a47_0x4d9bc9(0x1d5),'risk':a47_0x4d9bc9(0x1dd),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x551012=a48_0xfee7;(function(_0x2ddac7,_0x362ca4){const _0x45b8f1=a48_0xfee7,_0x539f9b=_0x2ddac7();while(!![]){try{const _0x144dcc=parseInt(_0x45b8f1(0x9f))/0x1*(-parseInt(_0x45b8f1(0xaf))/0x2)+parseInt(_0x45b8f1(0xa4))/0x3+parseInt(_0x45b8f1(0xa9))/0x4*(-parseInt(_0x45b8f1(0xa5))/0x5)+parseInt(_0x45b8f1(0xb0))/0x6*(-parseInt(_0x45b8f1(0xac))/0x7)+-parseInt(_0x45b8f1(0xaa))/0x8+-parseInt(_0x45b8f1(0xab))/0x9+parseInt(_0x45b8f1(0x9e))/0xa*(parseInt(_0x45b8f1(0xa6))/0xb);if(_0x144dcc===_0x362ca4)break;else _0x539f9b['push'](_0x539f9b['shift']());}catch(_0x5d09cf){_0x539f9b['push'](_0x539f9b['shift']());}}}(a48_0x281d,0x3d55c));function a48_0xfee7(_0x49eb67,_0x5cd112){_0x49eb67=_0x49eb67-0x9e;const _0x281d44=a48_0x281d();let _0xfee77a=_0x281d44[_0x49eb67];return _0xfee77a;}import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':'skill','command':'validate','description':a48_0x551012(0xa0),'risk':a48_0x551012(0xa8),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x168cd2){const _0x4f5943=a48_0x551012,_0x5df4f1=_0x168cd2[_0x4f5943(0xae)](_0x4f5943(0xa2)),_0x22122f=validateSkillDirectory(_0x168cd2[_0x4f5943(0xa3)](_0x4f5943(0xad)),{'strict':_0x5df4f1});return throwIfSkillValidationFailed(_0x22122f,_0x5df4f1),{'ok':!![],'data':{'dir':_0x22122f[_0x4f5943(0xad)],'type':_0x22122f[_0x4f5943(0xa7)],'errors':_0x22122f['errors'],'warnings':_0x22122f['warnings']},'message':_0x4f5943(0xa1)};}};function a48_0x281d(){const _0x258daf=['Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','Skill\x20validation\x20passed.','strict','str','854802OuXlNV','504035KBmhSv','11980529HEpesj','type','read','4STqDTG','2390368TICSfg','2268936AiMJwW','7lJLZoC','dir','bool','46xbrqRE','2096394DSOQAD','10DwfpaP','5293dhGYoG'];a48_0x281d=function(){return _0x258daf;};return a48_0x281d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4be3da,_0x5baa3d){const _0x4edd13=a49_0x44b8,_0x384553=_0x4be3da();while(!![]){try{const _0x2870ee=-parseInt(_0x4edd13(0x20a))/0x1+parseInt(_0x4edd13(0x202))/0x2*(parseInt(_0x4edd13(0x1fd))/0x3)+-parseInt(_0x4edd13(0x203))/0x4*(parseInt(_0x4edd13(0x209))/0x5)+parseInt(_0x4edd13(0x1f9))/0x6+-parseInt(_0x4edd13(0x201))/0x7+-parseInt(_0x4edd13(0x200))/0x8+parseInt(_0x4edd13(0x1fb))/0x9*(parseInt(_0x4edd13(0x205))/0xa);if(_0x2870ee===_0x5baa3d)break;else _0x384553['push'](_0x384553['shift']());}catch(_0x2e32ec){_0x384553['push'](_0x384553['shift']());}}}(a49_0x3a8d,0xba4fe));function a49_0x44b8(_0x3862e5,_0x36edf1){_0x3862e5=_0x3862e5-0x1f3;const _0x3a8d36=a49_0x3a8d();let _0x44b8e9=_0x3a8d36[_0x3862e5];return _0x44b8e9;}function a49_0x3a8d(){const _0x191ae6=['124ItlkXV','replace','30xGFDMC','parse','defineProperties','utf8','116810hBghFC','184418dZQyyw','validation','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','default','7797276wwlSrQ','window','4435569rwMIMV','document','8871ykgxnJ','isFile','Mermaid\x20syntax\x20validation\x20failed.','4912232Hllkkp','9552067TpbbHY','590cpPmLI'];a49_0x3a8d=function(){return _0x191ae6;};return a49_0x3a8d();}import{existsSync,readFileSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x1b5b9f){const _0x140daf=a49_0x44b8,_0x5f5dd1=_0x1b5b9f['trim']();if(!_0x5f5dd1)throw CliErrors[_0x140daf(0x1f3)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0x140daf(0x1f4));let _0x4b66d9;if(_0x5f5dd1==='-')try{_0x4b66d9=readFileSync(0x0,_0x140daf(0x208));}catch{throw CliErrors[_0x140daf(0x1f3)]('Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.');}else{const _0x4fb3fb=resolve(_0x5f5dd1);if(!existsSync(_0x4fb3fb))throw CliErrors[_0x140daf(0x1f3)](_0x140daf(0x1f6)+_0x4fb3fb);if(!statSync(_0x4fb3fb)[_0x140daf(0x1fe)]())throw CliErrors['validation'](_0x140daf(0x1f7)+_0x4fb3fb);_0x4b66d9=readFileSync(_0x4fb3fb,_0x140daf(0x208));}return{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x4b66d9)};}export async function validateAndCanonicalizeMermaid(_0x1ad0ea){const _0x7b6657=a49_0x44b8,_0x21a33e=_0x1ad0ea['replace'](/\r\n/g,'\x0a')[_0x7b6657(0x204)](/\r/g,'\x0a')[_0x7b6657(0x204)](/\n+$/,'')+'\x0a';try{const _0x2ed896=await loadMermaidApi();await _0x2ed896[_0x7b6657(0x206)](_0x21a33e);}catch{throw diagramValidationError();}return _0x21a33e;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x1a127c=a49_0x44b8;if(!(_0x1a127c(0x1fa)in globalThis)||!(_0x1a127c(0x1fc)in globalThis)){const _0x1cfd1e=new JSDOM('');Object[_0x1a127c(0x207)](globalThis,{'window':{'configurable':!![],'value':_0x1cfd1e[_0x1a127c(0x1fa)]},'document':{'configurable':!![],'value':_0x1cfd1e[_0x1a127c(0x1fa)][_0x1a127c(0x1fc)]}});}return(await import('mermaid'))[_0x1a127c(0x1f8)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x11453a=a49_0x44b8;return CliErrors['validation'](_0x11453a(0x1ff),_0x11453a(0x1f5));}
|