@lovrabet/lovrabet-cli 2.2.4-beta.2 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/permit/dataset-get.js +1 -1
- package/lib/commands/permit/dataset-set.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.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.d.ts +19 -0
- package/lib/commands/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.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/postinstall.js +1 -1
- package/lib/runtime/confirmation.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/builtin-skill.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/skills/skill-presence.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
- package/skills/lovrabet/SKILL.md +4 -4
- package/skills/lovrabet/references/lovrabet-ocr-workflow.md +17 -2
- package/skills/lovrabet.manifest.json +3 -3
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a58_0x2d9d(_0x14d5d6,_0x5c14b8){_0x14d5d6=_0x14d5d6-0x120;const _0x31e752=a58_0x31e7();let _0x2d9dbb=_0x31e752[_0x14d5d6];return _0x2d9dbb;}const a58_0x343c9c=a58_0x2d9d;(function(_0x3bdd90,_0x4af48e){const _0x24314e=a58_0x2d9d,_0x5095d3=_0x3bdd90();while(!![]){try{const _0x4d7b22=-parseInt(_0x24314e(0x125))/0x1*(-parseInt(_0x24314e(0x128))/0x2)+-parseInt(_0x24314e(0x126))/0x3*(parseInt(_0x24314e(0x124))/0x4)+-parseInt(_0x24314e(0x127))/0x5*(-parseInt(_0x24314e(0x123))/0x6)+-parseInt(_0x24314e(0x121))/0x7*(parseInt(_0x24314e(0x129))/0x8)+-parseInt(_0x24314e(0x12a))/0x9*(-parseInt(_0x24314e(0x12c))/0xa)+parseInt(_0x24314e(0x120))/0xb+-parseInt(_0x24314e(0x12b))/0xc;if(_0x4d7b22===_0x4af48e)break;else _0x5095d3['push'](_0x5095d3['shift']());}catch(_0x215f28){_0x5095d3['push'](_0x5095d3['shift']());}}}(a58_0x31e7,0x1cdd8));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x11025c){const _0x185bef=await buildSchemaPayload();return{'ok':!![],'data':_0x185bef};}export const schemaDefinition={'service':a58_0x343c9c(0x122),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};function a58_0x31e7(){const _0x144431=['58815iYfIhL','5310132pirEYP','130YMNArb','2425335rVltcV','809851UGYEuy','schema','456DaDfnZ','8URDVHH','1wmXPSc','55326gmfFke','12715qBkPcj','429224fyXbVH','8zQjkSe'];a58_0x31e7=function(){return _0x144431;};return a58_0x31e7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4a4a54,_0x4e96a7){const _0x260169=a59_0x5d37,_0x1f70c5=_0x4a4a54();while(!![]){try{const _0x422250=-parseInt(_0x260169(0x212))/0x1+parseInt(_0x260169(0x1b6))/0x2*(-parseInt(_0x260169(0x1e0))/0x3)+-parseInt(_0x260169(0x1bf))/0x4*(parseInt(_0x260169(0x1d6))/0x5)+parseInt(_0x260169(0x1c5))/0x6+parseInt(_0x260169(0x1fe))/0x7+parseInt(_0x260169(0x1e2))/0x8+parseInt(_0x260169(0x1f4))/0x9;if(_0x422250===_0x4e96a7)break;else _0x1f70c5['push'](_0x1f70c5['shift']());}catch(_0x55550e){_0x1f70c5['push'](_0x1f70c5['shift']());}}}(a59_0x42e1,0x77837));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(_0x58405a,_0x356875){const _0xef7f25=a59_0x5d37,_0x25e038=listLocalServiceTrees();let _0x2a8585;for(const _0xeb9756 of _0x25e038){const _0x271679=matchServiceTreeCommand(_0xeb9756,_0x58405a);if(!_0x271679)continue;(!_0x2a8585||_0x271679[_0xef7f25(0x1c7)][_0xef7f25(0x1ff)][_0xef7f25(0x1e9)]>_0x2a8585[_0xef7f25(0x1c7)][_0xef7f25(0x1ff)][_0xef7f25(0x1e9)])&&(_0x2a8585={'tree':_0xeb9756,'command':_0x271679['command'],'remainingArgs':_0x271679[_0xef7f25(0x211)]});}if(!_0x2a8585)return undefined;const _0x47872d={..._0x356875};return applyAppBinding(_0x2a8585[_0xef7f25(0x1e1)],_0x2a8585['command'],_0x47872d),{'definition':buildDynamicCommandDefinition(_0x2a8585[_0xef7f25(0x1e1)],_0x2a8585['command']),'args':_0x2a8585[_0xef7f25(0x211)],'flags':_0x47872d,'tree':_0x2a8585[_0xef7f25(0x1e1)],'command':_0x2a8585['command']};}export function generateDynamicServiceHelp(_0x3ade8f){const _0x3cb397=a59_0x5d37,_0x64cadc=listLocalServiceTrees()['find'](_0x46619f=>_0x46619f[_0x3cb397(0x21b)][_0x3cb397(0x1d7)]===_0x3ade8f);if(!_0x64cadc)return undefined;const _0x31a919=[CLI_BIN_NAME+'\x20'+_0x3ade8f+'\x20<command>\x20[flags]','',_0x64cadc['service'][_0x3cb397(0x1cf)]||_0x3ade8f,_0x64cadc['service']['description']?'\x20\x20'+_0x64cadc[_0x3cb397(0x21b)][_0x3cb397(0x1ea)]:'','',_0x3cb397(0x1b8),..._0x64cadc[_0x3cb397(0x1f1)][_0x3cb397(0x1fd)](_0x59d0db=>{const _0x2aeb08=_0x3cb397,_0x46bfec=_0x59d0db['fullPath'][_0x2aeb08(0x219)](0x1)[_0x2aeb08(0x214)]('\x20'),_0x613a48=_0x59d0db[_0x2aeb08(0x1ce)]===_0x2aeb08(0x1f5)?'':'\x20['+_0x59d0db[_0x2aeb08(0x1ce)]+']';return'\x20\x20'+_0x46bfec[_0x2aeb08(0x1b5)](0x18)+'\x20'+(_0x59d0db['description']||'')+_0x613a48;}),'',_0x3cb397(0x1eb)+CLI_BIN_NAME+_0x3cb397(0x1ba)+_0x3ade8f+'`\x20to\x20inspect\x20the\x20manifest.'][_0x3cb397(0x21c)](Boolean);return _0x31a919[_0x3cb397(0x214)]('\x0a');}export function listDynamicServiceEntries(){const _0x2eca4f=a59_0x5d37;return listLocalServices()[_0x2eca4f(0x1fd)](_0x310fed=>{const _0x488e4c=_0x2eca4f,_0x25b90b=_0x310fed[_0x488e4c(0x1c8)];return{'service':_0x25b90b['service'][_0x488e4c(0x1d7)],'label':_0x25b90b['service'][_0x488e4c(0x1cf)]||_0x25b90b['service']['code'],'commands':_0x25b90b[_0x488e4c(0x1f1)]['map'](_0x15f0c4=>({'command':dynamicCommandName(_0x15f0c4),'description':_0x15f0c4[_0x488e4c(0x1ea)]||_0x488e4c(0x218)+_0x15f0c4[_0x488e4c(0x1f8)],'tag':riskTag(_0x15f0c4[_0x488e4c(0x1ce)])}))};});}export function getDynamicServiceEntry(_0x1c5426){const _0x3661b9=a59_0x5d37;return listDynamicServiceEntries()['find'](_0x416f01=>_0x416f01[_0x3661b9(0x21b)]===_0x1c5426);}export function listDynamicServiceDefinitions(_0x1a291f){const _0x35d8e7=a59_0x5d37;return listLocalServiceTrees()['filter'](_0x9f77b7=>!_0x1a291f||_0x9f77b7[_0x35d8e7(0x21b)][_0x35d8e7(0x1d7)]===_0x1a291f)[_0x35d8e7(0x1e8)](_0x347486=>_0x347486['commands'][_0x35d8e7(0x1fd)](_0x3046ec=>buildDynamicCommandDefinition(_0x347486,_0x3046ec)));}export function getDynamicServiceDefinitions(_0x5cdff9){const _0x3fea01=a59_0x5d37,_0x3dfd70=listDynamicServiceDefinitions(_0x5cdff9);return _0x3dfd70[_0x3fea01(0x1e9)]>0x0?_0x3dfd70:undefined;}export function findDynamicServiceDefinition(_0x41c7ac,_0x55a67c){const _0x418946=a59_0x5d37;return listDynamicServiceDefinitions(_0x41c7ac)[_0x418946(0x215)](_0x5e23d0=>_0x5e23d0['command']===_0x55a67c);}export function buildDynamicCommandDefinition(_0x5ebf82,_0x2d3c36){const _0x2d0305=a59_0x5d37;return{'service':_0x5ebf82[_0x2d0305(0x21b)][_0x2d0305(0x1d7)],'command':dynamicCommandName(_0x2d3c36),'description':_0x2d3c36[_0x2d0305(0x1ea)]||'Run\x20service\x20command\x20'+_0x2d3c36['cliPath'],'risk':_0x2d3c36[_0x2d0305(0x1ce)],..._0x2d3c36[_0x2d0305(0x1ce)]==='read'?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x2d3c36)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x2d3c36[_0x2d0305(0x208)][_0x2d0305(0x1fd)](_0x40743e=>({'name':_0x40743e[_0x2d0305(0x1cf)],'description':_0x40743e[_0x2d0305(0x1ea)]||_0x40743e['name'],'required':_0x40743e[_0x2d0305(0x205)]})),'flags':_0x2d3c36[_0x2d0305(0x1b9)][_0x2d0305(0x1fd)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x2d3c36),async 'dryRun'(_0x366a6d){const _0x126cb1=_0x2d0305,_0xbbd15c=await compilePlan(_0x2d3c36,_0x366a6d);return{'method':'SERVICE_TREE','url':_0x2d3c36[_0x126cb1(0x1f8)],'body':{'target':targetPreview(_0xbbd15c),'params':_0xbbd15c['params']},'description':_0x126cb1(0x1fc)+_0x2d3c36[_0x126cb1(0x1f8)]};},async 'execute'(_0x5c9c51){const _0x76d95f=_0x2d0305,_0x839763=await compilePlan(_0x2d3c36,_0x5c9c51),_0x29d905=Date[_0x76d95f(0x21d)](),_0x5666f0=await executePlan(_0x839763,_0x2d3c36,_0x5c9c51),_0x206dae=Date[_0x76d95f(0x21d)]()-_0x29d905;return{'ok':!![],'data':{'service':_0x5ebf82['service'],'command':_0x2d3c36['cliPath'],'target':targetPreview(_0x839763),'result':_0x5666f0,'elapsed':_0x206dae},'message':_0x76d95f(0x1c9)+_0x2d3c36[_0x76d95f(0x1f8)]+_0x76d95f(0x1dc)+_0x206dae+'ms'};}};}function a59_0x5d37(_0x3bbe0d,_0x483f6d){_0x3bbe0d=_0x3bbe0d-0x1b0;const _0x42e127=a59_0x42e1();let _0x5d3785=_0x42e127[_0x3bbe0d];return _0x5d3785;}function buildDynamicConfirmationDescription(_0x686261){const _0x40b117=a59_0x5d37,_0xf3c1ad=_0x686261[_0x40b117(0x1ea)]||_0x686261['cliPath'],_0x56a8b8=_0x686261[_0x40b117(0x1ce)]==='high-risk-write'?_0x40b117(0x1c4):_0x40b117(0x1d1);return _0x40b117(0x1b3)+_0xf3c1ad+'”。'+_0x56a8b8;}function dynamicCommandName(_0x2871e3){const _0x3d299f=a59_0x5d37;return _0x2871e3[_0x3d299f(0x1ff)][_0x3d299f(0x219)](0x1)['join']('\x20');}function riskTag(_0x3ade31){const _0x4c20c5=a59_0x5d37;return _0x3ade31==='read'?'':_0x4c20c5(0x21a)+_0x3ade31+']';}function flagToCommandFlag(_0x5e05f8){const _0x4c21b1=a59_0x5d37;return{'name':_0x5e05f8[_0x4c21b1(0x1df)],'type':_0x5e05f8['type']===_0x4c21b1(0x1e5)?_0x4c21b1(0x1e6):_0x5e05f8['type'],'description':_0x5e05f8['description']||_0x5e05f8[_0x4c21b1(0x1cf)],'required':_0x5e05f8[_0x4c21b1(0x205)],'default':isPrimitiveFlagDefault(_0x5e05f8['default'])?_0x5e05f8[_0x4c21b1(0x204)]:undefined,'enum':_0x5e05f8[_0x4c21b1(0x217)]};}async function compilePlan(_0x4084a1,_0x57853c){const _0x1e08fb=a59_0x5d37;return compileServiceTreeCommand(_0x4084a1,{'flags':_0x57853c[_0x1e08fb(0x213)],'args':_0x57853c[_0x1e08fb(0x208)],'context':await buildServiceContext(_0x4084a1,_0x57853c)});}async function buildServiceContext(_0x48919e,_0x540ef5){const _0x30b289=a59_0x5d37,_0x1ca59f={'appCode':_0x540ef5[_0x30b289(0x1ee)],'env':_0x540ef5[_0x30b289(0x1b0)],'envName':_0x540ef5[_0x30b289(0x1b0)]};if(!usesRuntimeContext(_0x48919e))return _0x1ca59f;const _0x459837=await getLoginUserInfo(),_0x3b339b=pickFirst(_0x459837[_0x30b289(0x1ec)],_0x459837['id']);return{..._0x1ca59f,'user':_0x459837,'userId':_0x3b339b,'id':_0x459837['id'],'username':pickFirst(_0x459837[_0x30b289(0x1f3)],_0x459837[_0x30b289(0x1d5)],_0x459837['loginName']),'userName':_0x459837[_0x30b289(0x1d5)],'nickname':pickFirst(_0x459837['nickname'],_0x459837['nickName']),'nickName':_0x459837[_0x30b289(0x1f2)],'tenantCode':_0x459837[_0x30b289(0x20c)],'employeeId':_0x459837[_0x30b289(0x1c3)]};}function usesRuntimeContext(_0x30937f){const _0x38fd54=a59_0x5d37;return _0x30937f[_0x38fd54(0x1f6)][_0x38fd54(0x1b2)](_0x20b6ce=>typeof _0x20b6ce[_0x38fd54(0x20f)]==='string'&&(_0x20b6ce[_0x38fd54(0x20f)][_0x38fd54(0x1de)](_0x38fd54(0x1c0))||_0x20b6ce[_0x38fd54(0x20f)][_0x38fd54(0x1de)](_0x38fd54(0x1cb))));}function pickFirst(..._0x136d68){return _0x136d68['find'](_0x587b5d=>_0x587b5d!==undefined&&_0x587b5d!==null);}function a59_0x42e1(){const _0x4ab510=['mapTo','\x20\x20\x20\x20functionName:\x20','cliPath','scriptName','boolean','\x20->\x20','Preview\x20dynamic\x20service\x20command:\x20','map','2952215OHCLWQ','fullPath','Cannot\x20resolve\x20datatable\x20\x22','env','dbtableConfig','app','default','required','bffCode','operator','args','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20','appRef','tenantCode','datasetCode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','source','\x20requires\x20target.functionName.','remainingArgs','192377zWtUPe','rawFlags','join','find','bff','enum','Run\x20service\x20command\x20','slice','\x20\x20[','service','filter','now','envName','target','some','将通过\x20Service\x20Tree\x20执行“','entries','padEnd','4luZqfg','params','Commands:','flags','\x20service\x20detail\x20--service\x20','\x20\x20\x20\x20sqlCode:\x20','const','sqlCode','\x22\x20in\x20service\x20command\x20','124pYmZOP','context.','\x20requires\x20target.sqlCode.','\x20\x20\x20\x20datasetCode:\x20','employeeId','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','1472226sohFCu','\x20\x20\x20\x20command:\x20','command','normalizedManifest','Service\x20command\x20','validation','ctx.','Unsupported\x20service\x20target\x20kind:\x20','\x20\x20SERVICE\x20TREE\x20TARGET','risk','name','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','该命令被清单标记为写入,可能修改业务数据或服务状态。','bffId','appBindings','number','userName','132985Ceetwt','code','datatable','push','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','kind','\x20completed\x20in\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','startsWith','cliName','1088733wIHodS','tree','6655832VRZqdS','\x20\x20MAP\x20TO','appcode','json','string','sql','flatMap','length','description','Use\x20`','userId','tableName','appCode','trim','Unknown\x20appRef\x20\x22','commands','nickName','username','6598242mgXFFj','read'];a59_0x42e1=function(){return _0x4ab510;};return a59_0x42e1();}async function executePlan(_0x1a305f,_0x1c559c,_0x5d8f82){const _0x47ae4a=a59_0x5d37;if(_0x1a305f[_0x47ae4a(0x1db)]==='data'){const _0x2b4e0d=await resolveDatasetCode(_0x1a305f,_0x1c559c,_0x5d8f82);return executeData(_0x2b4e0d,_0x1a305f[_0x47ae4a(0x1c7)],_0x1a305f[_0x47ae4a(0x1b7)]);}if(_0x1a305f[_0x47ae4a(0x1db)]===_0x47ae4a(0x1e7)){if(!_0x1a305f[_0x47ae4a(0x1bd)])throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1c9)+_0x1c559c[_0x47ae4a(0x1f8)]+_0x47ae4a(0x1c1));return executeSdkSql(_0x1a305f['sqlCode'],normalizeScalarParams(_0x1a305f[_0x47ae4a(0x1b7)]));}if(_0x1a305f[_0x47ae4a(0x1db)]===_0x47ae4a(0x216)){const _0x4ea546=_0x1a305f[_0x47ae4a(0x1f9)]||_0x1a305f[_0x47ae4a(0x206)]||(_0x1a305f[_0x47ae4a(0x1d2)]==null?'':String(_0x1a305f['bffId']));if(!_0x4ea546)throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1c9)+_0x1c559c[_0x47ae4a(0x1f8)]+_0x47ae4a(0x210));return executeSdkBff(_0x4ea546,_0x1a305f['params']);}throw CliErrors[_0x47ae4a(0x1ca)](_0x47ae4a(0x1cc)+_0x1a305f[_0x47ae4a(0x1db)]);}async function resolveDatasetCode(_0x37455b,_0x4df812,_0x5c9ab7){const _0x2b3f56=a59_0x5d37;if(_0x37455b[_0x2b3f56(0x20d)])return _0x37455b['datasetCode'];if(!_0x37455b[_0x2b3f56(0x1d8)])throw CliErrors[_0x2b3f56(0x1ca)]('Service\x20command\x20'+_0x4df812[_0x2b3f56(0x1f8)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x550e21=await listDatasets(_0x5c9ab7[_0x2b3f56(0x1ee)]),_0x2d6a19=_0x550e21['find'](_0x5df4cc=>_0x5df4cc[_0x2b3f56(0x202)]?.[_0x2b3f56(0x1ed)]===_0x37455b['datatable']);if(!_0x2d6a19?.['code'])throw CliErrors['validation'](_0x2b3f56(0x200)+_0x37455b[_0x2b3f56(0x1d8)]+_0x2b3f56(0x20e)+_0x5c9ab7[_0x2b3f56(0x1ee)]+'.',_0x2b3f56(0x1d0));return _0x2d6a19['code'];}function applyAppBinding(_0x10f3fe,_0x144303,_0x1c80e0){const _0x5299da=a59_0x5d37,_0x511a9d=_0x144303['target']['appRef'];if(!_0x511a9d)return;const _0x5c84b0=_0x10f3fe[_0x5299da(0x1d3)][_0x511a9d];if(!_0x5c84b0)throw CliErrors[_0x5299da(0x1ca)](_0x5299da(0x1f0)+_0x511a9d+_0x5299da(0x1be)+_0x144303[_0x5299da(0x1f8)]+'.',_0x5299da(0x1da));const _0x55ff53=_0x5c84b0['appcode']||_0x5c84b0[_0x5299da(0x1ee)];_0x55ff53&&!hasText(_0x1c80e0['appcode'])&&(_0x1c80e0['appcode']=_0x55ff53),_0x5c84b0[_0x5299da(0x203)]&&!hasText(_0x1c80e0[_0x5299da(0x203)])&&!hasText(_0x1c80e0[_0x5299da(0x1e4)])&&(_0x1c80e0[_0x5299da(0x203)]=_0x5c84b0[_0x5299da(0x203)]),_0x5c84b0[_0x5299da(0x201)]&&!hasText(_0x1c80e0[_0x5299da(0x201)])&&(_0x1c80e0['env']=_0x5c84b0[_0x5299da(0x201)]);}function renderDynamicCommandHelp(_0x47c0e3){const _0xb98829=a59_0x5d37,_0x1ef5e8=[_0xb98829(0x1cd),_0xb98829(0x1dd)+_0x47c0e3['target']['kind'],_0xb98829(0x1c6)+_0x47c0e3['target']['command']];if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x20d)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1c2)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x20d)]);if(_0x47c0e3['target']['datatable'])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x209)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1d8)]);if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1bd)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1bb)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1bd)]);if(_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1f9)])_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x1f7)+_0x47c0e3[_0xb98829(0x1b1)][_0xb98829(0x1f9)]);if(_0x47c0e3[_0xb98829(0x1f6)]['length']>0x0){_0x1ef5e8[_0xb98829(0x1d9)]('',_0xb98829(0x1e3));for(const _0x5e2ac7 of _0x47c0e3[_0xb98829(0x1f6)]){_0x1ef5e8[_0xb98829(0x1d9)](_0xb98829(0x20a)+(_0x5e2ac7['source']||_0xb98829(0x1bc))+_0xb98829(0x1fb)+_0x5e2ac7[_0xb98829(0x1b1)]+(_0x5e2ac7[_0xb98829(0x207)]?'.'+_0x5e2ac7[_0xb98829(0x207)]:''));}}return _0x1ef5e8['join']('\x0a');}function targetPreview(_0x2ef79d){const _0xf35d5=a59_0x5d37;return{'kind':_0x2ef79d[_0xf35d5(0x1db)],'command':_0x2ef79d['command'],'appRef':_0x2ef79d[_0xf35d5(0x20b)],'datasetCode':_0x2ef79d[_0xf35d5(0x20d)],'datatable':_0x2ef79d[_0xf35d5(0x1d8)],'sqlCode':_0x2ef79d[_0xf35d5(0x1bd)],'bffCode':_0x2ef79d['bffCode'],'bffId':_0x2ef79d[_0xf35d5(0x1d2)],'functionName':_0x2ef79d[_0xf35d5(0x1f9)]};}function normalizeScalarParams(_0x4283a0){const _0x5c70ba=a59_0x5d37;return Object['fromEntries'](Object[_0x5c70ba(0x1b4)](_0x4283a0)[_0x5c70ba(0x21c)](([,_0x91c4a1])=>typeof _0x91c4a1===_0x5c70ba(0x1e6)||typeof _0x91c4a1===_0x5c70ba(0x1d4)));}function hasText(_0x5b7303){const _0x5f2212=a59_0x5d37;return typeof _0x5b7303===_0x5f2212(0x1e6)&&_0x5b7303[_0x5f2212(0x1ef)]()[_0x5f2212(0x1e9)]>0x0;}function isPrimitiveFlagDefault(_0xc53005){const _0x1e55e8=a59_0x5d37;return _0xc53005===undefined||typeof _0xc53005==='string'||typeof _0xc53005===_0x1e55e8(0x1d4)||typeof _0xc53005===_0x1e55e8(0x1fa);}
|
|
1
|
+
(function(_0x28175f,_0x26b1cd){const _0x25f9b3=a59_0x56e5,_0x5477ed=_0x28175f();while(!![]){try{const _0x1f17b9=parseInt(_0x25f9b3(0xd0))/0x1+-parseInt(_0x25f9b3(0xb6))/0x2+-parseInt(_0x25f9b3(0xbc))/0x3+-parseInt(_0x25f9b3(0xba))/0x4+parseInt(_0x25f9b3(0xdb))/0x5+parseInt(_0x25f9b3(0xc7))/0x6+parseInt(_0x25f9b3(0xcf))/0x7;if(_0x1f17b9===_0x26b1cd)break;else _0x5477ed['push'](_0x5477ed['shift']());}catch(_0x2d8fd4){_0x5477ed['push'](_0x5477ed['shift']());}}}(a59_0xc87c,0x8946a));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(_0x4819b4,_0x6eed16){const _0x5636c3=a59_0x56e5,_0x4e75f6=listLocalServiceTrees();let _0x56b92d;for(const _0x20a77f of _0x4e75f6){const _0x5e178c=matchServiceTreeCommand(_0x20a77f,_0x4819b4);if(!_0x5e178c)continue;(!_0x56b92d||_0x5e178c['command']['fullPath'][_0x5636c3(0xda)]>_0x56b92d[_0x5636c3(0x102)][_0x5636c3(0xb9)][_0x5636c3(0xda)])&&(_0x56b92d={'tree':_0x20a77f,'command':_0x5e178c[_0x5636c3(0x102)],'remainingArgs':_0x5e178c[_0x5636c3(0xee)]});}if(!_0x56b92d)return undefined;const _0x440f76={..._0x6eed16};return applyAppBinding(_0x56b92d[_0x5636c3(0xec)],_0x56b92d[_0x5636c3(0x102)],_0x440f76),{'definition':buildDynamicCommandDefinition(_0x56b92d[_0x5636c3(0xec)],_0x56b92d[_0x5636c3(0x102)]),'args':_0x56b92d[_0x5636c3(0xee)],'flags':_0x440f76,'tree':_0x56b92d[_0x5636c3(0xec)],'command':_0x56b92d[_0x5636c3(0x102)]};}export function generateDynamicServiceHelp(_0x5401f5){const _0x5c73e8=a59_0x56e5,_0x40500e=listLocalServiceTrees()[_0x5c73e8(0xc8)](_0xad60f0=>_0xad60f0[_0x5c73e8(0xef)][_0x5c73e8(0xb7)]===_0x5401f5);if(!_0x40500e)return undefined;const _0x413ff9=[CLI_BIN_NAME+'\x20'+_0x5401f5+_0x5c73e8(0xe1),'',_0x40500e[_0x5c73e8(0xef)][_0x5c73e8(0xce)]||_0x5401f5,_0x40500e['service'][_0x5c73e8(0xf3)]?'\x20\x20'+_0x40500e[_0x5c73e8(0xef)]['description']:'','',_0x5c73e8(0xf1),..._0x40500e[_0x5c73e8(0x10a)][_0x5c73e8(0xfc)](_0x4bcfd3=>{const _0x38d9b4=_0x5c73e8,_0x125302=_0x4bcfd3[_0x38d9b4(0xb9)][_0x38d9b4(0xcb)](0x1)[_0x38d9b4(0x109)]('\x20'),_0x3862b4=_0x4bcfd3[_0x38d9b4(0xde)]==='read'?'':'\x20['+_0x4bcfd3['risk']+']';return'\x20\x20'+_0x125302[_0x38d9b4(0x107)](0x18)+'\x20'+(_0x4bcfd3[_0x38d9b4(0xf3)]||'')+_0x3862b4;}),'','Use\x20`'+CLI_BIN_NAME+_0x5c73e8(0xaf)+_0x5401f5+_0x5c73e8(0xf0)][_0x5c73e8(0x101)](Boolean);return _0x413ff9['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3bbdd1=a59_0x56e5;return listLocalServices()[_0x3bbdd1(0xfc)](_0x5f14cd=>{const _0x630390=_0x3bbdd1,_0x301a98=_0x5f14cd['normalizedManifest'];return{'service':_0x301a98[_0x630390(0xef)]['code'],'label':_0x301a98[_0x630390(0xef)][_0x630390(0xce)]||_0x301a98[_0x630390(0xef)][_0x630390(0xb7)],'commands':_0x301a98[_0x630390(0x10a)][_0x630390(0xfc)](_0x3ee95f=>({'command':dynamicCommandName(_0x3ee95f),'description':_0x3ee95f[_0x630390(0xf3)]||'Run\x20service\x20command\x20'+_0x3ee95f['cliPath'],'tag':riskTag(_0x3ee95f[_0x630390(0xde)])}))};});}export function getDynamicServiceEntry(_0x47f81a){const _0x3b0ff9=a59_0x56e5;return listDynamicServiceEntries()[_0x3b0ff9(0xc8)](_0x44ae6a=>_0x44ae6a[_0x3b0ff9(0xef)]===_0x47f81a);}export function listDynamicServiceDefinitions(_0x3414a6){const _0x32cbbe=a59_0x56e5;return listLocalServiceTrees()[_0x32cbbe(0x101)](_0x181e20=>!_0x3414a6||_0x181e20[_0x32cbbe(0xef)]['code']===_0x3414a6)[_0x32cbbe(0xc9)](_0x1b88ba=>_0x1b88ba[_0x32cbbe(0x10a)][_0x32cbbe(0xfc)](_0x35c8a2=>buildDynamicCommandDefinition(_0x1b88ba,_0x35c8a2)));}export function getDynamicServiceDefinitions(_0x22a6ef){const _0x298a03=listDynamicServiceDefinitions(_0x22a6ef);return _0x298a03['length']>0x0?_0x298a03:undefined;}export function findDynamicServiceDefinition(_0x16b078,_0x4346cf){const _0x4fc0a1=a59_0x56e5;return listDynamicServiceDefinitions(_0x16b078)[_0x4fc0a1(0xc8)](_0x4f6326=>_0x4f6326['command']===_0x4346cf);}export function buildDynamicCommandDefinition(_0x5bd6e4,_0x3321b2){const _0x7aa1ff=a59_0x56e5;return{'service':_0x5bd6e4[_0x7aa1ff(0xef)][_0x7aa1ff(0xb7)],'command':dynamicCommandName(_0x3321b2),'description':_0x3321b2[_0x7aa1ff(0xf3)]||'Run\x20service\x20command\x20'+_0x3321b2[_0x7aa1ff(0xd2)],'risk':_0x3321b2[_0x7aa1ff(0xde)],..._0x3321b2[_0x7aa1ff(0xde)]===_0x7aa1ff(0xdd)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x3321b2)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3321b2[_0x7aa1ff(0xac)][_0x7aa1ff(0xfc)](_0x46b0e8=>({'name':_0x46b0e8[_0x7aa1ff(0xce)],'description':_0x46b0e8['description']||_0x46b0e8[_0x7aa1ff(0xce)],'required':_0x46b0e8[_0x7aa1ff(0xfa)]})),'flags':_0x3321b2[_0x7aa1ff(0xb1)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3321b2),async 'dryRun'(_0x7d8a68){const _0x23ea53=_0x7aa1ff,_0x59d388=await compilePlan(_0x3321b2,_0x7d8a68);return{'method':_0x23ea53(0xcd),'url':_0x3321b2[_0x23ea53(0xd2)],'body':{'target':targetPreview(_0x59d388),'params':_0x59d388[_0x23ea53(0xfe)]},'description':_0x23ea53(0xe9)+_0x3321b2[_0x23ea53(0xd2)]};},async 'execute'(_0x25d32c){const _0x3bd043=_0x7aa1ff,_0x503eea=await compilePlan(_0x3321b2,_0x25d32c),_0x235bcf=Date['now'](),_0x147df4=await executePlan(_0x503eea,_0x3321b2,_0x25d32c),_0x54727f=Date['now']()-_0x235bcf;return{'ok':!![],'data':{'service':_0x5bd6e4[_0x3bd043(0xef)],'command':_0x3321b2[_0x3bd043(0xd2)],'target':targetPreview(_0x503eea),'result':_0x147df4,'elapsed':_0x54727f},'message':'Service\x20command\x20'+_0x3321b2[_0x3bd043(0xd2)]+_0x3bd043(0xbf)+_0x54727f+'ms'};}};}function buildDynamicConfirmationDescription(_0x3b443e){const _0x287836=a59_0x56e5,_0x20d8dc=_0x3b443e[_0x287836(0xf3)]||_0x3b443e['cliPath'],_0x3656aa=_0x3b443e[_0x287836(0xde)]==='high-risk-write'?'该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。':_0x287836(0xc1);return _0x287836(0xe5)+_0x20d8dc+'”。'+_0x3656aa;}function dynamicCommandName(_0xb39c0f){const _0x197ba3=a59_0x56e5;return _0xb39c0f[_0x197ba3(0xb9)][_0x197ba3(0xcb)](0x1)[_0x197ba3(0x109)]('\x20');}function riskTag(_0x338f90){const _0x43fe06=a59_0x56e5;return _0x338f90===_0x43fe06(0xdd)?'':_0x43fe06(0xd3)+_0x338f90+']';}function flagToCommandFlag(_0x248a81){const _0x1a95e5=a59_0x56e5;return{'name':_0x248a81['cliName'],'type':_0x248a81[_0x1a95e5(0xd6)]===_0x1a95e5(0xb0)?_0x1a95e5(0xdf):_0x248a81['type'],'description':_0x248a81[_0x1a95e5(0xf3)]||_0x248a81[_0x1a95e5(0xce)],'required':_0x248a81[_0x1a95e5(0xfa)],'default':isPrimitiveFlagDefault(_0x248a81['default'])?_0x248a81[_0x1a95e5(0xc5)]:undefined,'enum':_0x248a81['enum']};}function a59_0x56e5(_0x12d084,_0x142960){_0x12d084=_0x12d084-0xac;const _0xc87c16=a59_0xc87c();let _0x56e5eb=_0xc87c16[_0x12d084];return _0x56e5eb;}async function compilePlan(_0x57fd48,_0x55f239){const _0x210b72=a59_0x56e5;return compileServiceTreeCommand(_0x57fd48,{'flags':_0x55f239['rawFlags'],'args':_0x55f239[_0x210b72(0xac)],'context':await buildServiceContext(_0x57fd48,_0x55f239)});}async function buildServiceContext(_0x4091c6,_0x1c1598){const _0x36fcac=a59_0x56e5,_0x372467={'appCode':_0x1c1598['appCode'],'env':_0x1c1598[_0x36fcac(0xc4)],'envName':_0x1c1598[_0x36fcac(0xc4)]};if(!usesRuntimeContext(_0x4091c6))return _0x372467;const _0x376d12=await getLoginUserInfo(),_0x5d9f49=pickFirst(_0x376d12[_0x36fcac(0xe7)],_0x376d12['id']);return{..._0x372467,'user':_0x376d12,'userId':_0x5d9f49,'id':_0x376d12['id'],'username':pickFirst(_0x376d12[_0x36fcac(0x104)],_0x376d12[_0x36fcac(0xf6)],_0x376d12['loginName']),'userName':_0x376d12[_0x36fcac(0xf6)],'nickname':pickFirst(_0x376d12[_0x36fcac(0xc0)],_0x376d12[_0x36fcac(0xed)]),'nickName':_0x376d12[_0x36fcac(0xed)],'tenantCode':_0x376d12[_0x36fcac(0xd9)],'employeeId':_0x376d12['employeeId']};}function usesRuntimeContext(_0x18abf3){const _0x23e304=a59_0x56e5;return _0x18abf3[_0x23e304(0xbb)]['some'](_0x2efca1=>typeof _0x2efca1[_0x23e304(0x108)]===_0x23e304(0xdf)&&(_0x2efca1[_0x23e304(0x108)][_0x23e304(0xf9)](_0x23e304(0xd8))||_0x2efca1[_0x23e304(0x108)]['startsWith'](_0x23e304(0xd5))));}function pickFirst(..._0x41fdd8){const _0x3ac0af=a59_0x56e5;return _0x41fdd8[_0x3ac0af(0xc8)](_0x22831d=>_0x22831d!==undefined&&_0x22831d!==null);}async function executePlan(_0x2048f5,_0x1be6e5,_0x4a3b5c){const _0x2ce59f=a59_0x56e5;if(_0x2048f5[_0x2ce59f(0xb2)]===_0x2ce59f(0x103)){const _0x50c81a=await resolveDatasetCode(_0x2048f5,_0x1be6e5,_0x4a3b5c);return executeData(_0x50c81a,_0x2048f5[_0x2ce59f(0x102)],_0x2048f5['params']);}if(_0x2048f5[_0x2ce59f(0xb2)]==='sql'){if(!_0x2048f5[_0x2ce59f(0xe0)])throw CliErrors['validation']('Service\x20command\x20'+_0x1be6e5[_0x2ce59f(0xd2)]+_0x2ce59f(0xe6));return executeSdkSql(_0x2048f5[_0x2ce59f(0xe0)],normalizeScalarParams(_0x2048f5[_0x2ce59f(0xfe)]));}if(_0x2048f5[_0x2ce59f(0xb2)]==='bff'){const _0x3a4411=_0x2048f5[_0x2ce59f(0xc3)]||_0x2048f5[_0x2ce59f(0x105)]||(_0x2048f5['bffId']==null?'':String(_0x2048f5[_0x2ce59f(0xea)]));if(!_0x3a4411)throw CliErrors['validation'](_0x2ce59f(0xb8)+_0x1be6e5[_0x2ce59f(0xd2)]+_0x2ce59f(0xe8));return executeSdkBff(_0x3a4411,_0x2048f5[_0x2ce59f(0xfe)]);}throw CliErrors['validation'](_0x2ce59f(0xf8)+_0x2048f5[_0x2ce59f(0xb2)]);}function a59_0xc87c(){const _0x38039b=['Service\x20command\x20','fullPath','4283024AQnoZp','mapTo','61887zXlgSE','validation','appBindings','\x20completed\x20in\x20','nickname','该命令被清单标记为写入,可能修改业务数据或服务状态。','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','scriptName','envName','default','dbtableConfig','1394916SoPjHZ','find','flatMap','\x20\x20\x20\x20datatable:\x20','slice','operator','SERVICE_TREE','name','10375869tqpYEM','2843AXhkYt','push','cliPath','\x20\x20[','appCode','ctx.','type','\x20\x20\x20\x20command:\x20','context.','tenantCode','length','4317820fzTvYs','appRef','read','risk','string','sqlCode','\x20<command>\x20[flags]','target','appcode','app','将通过\x20Service\x20Tree\x20执行“','\x20requires\x20target.sqlCode.','userId','\x20requires\x20target.functionName.','Preview\x20dynamic\x20service\x20command:\x20','bffId','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','tree','nickName','remainingArgs','service','`\x20to\x20inspect\x20the\x20manifest.','Commands:','\x20\x20\x20\x20sqlCode:\x20','description','\x20\x20MAP\x20TO','datatable','userName','\x20\x20\x20\x20','Unsupported\x20service\x20target\x20kind:\x20','startsWith','required','Cannot\x20resolve\x20datatable\x20\x22','map','trim','params','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','env','filter','command','data','username','bffCode','number','padEnd','source','join','commands','args','\x20\x20\x20\x20datasetCode:\x20','fromEntries','\x20service\x20detail\x20--service\x20','json','flags','kind','\x20->\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datasetCode','1854986VzETUz','code'];a59_0xc87c=function(){return _0x38039b;};return a59_0xc87c();}async function resolveDatasetCode(_0x426f19,_0x56c00a,_0xeae0d5){const _0x217aaf=a59_0x56e5;if(_0x426f19[_0x217aaf(0xb5)])return _0x426f19[_0x217aaf(0xb5)];if(!_0x426f19['datatable'])throw CliErrors[_0x217aaf(0xbd)](_0x217aaf(0xb8)+_0x56c00a[_0x217aaf(0xd2)]+_0x217aaf(0xff));const _0x3fb377=await listDatasets(_0xeae0d5[_0x217aaf(0xd4)]),_0x2d511f=_0x3fb377['find'](_0x2fc41f=>_0x2fc41f[_0x217aaf(0xc6)]?.['tableName']===_0x426f19[_0x217aaf(0xf5)]);if(!_0x2d511f?.[_0x217aaf(0xb7)])throw CliErrors['validation'](_0x217aaf(0xfb)+_0x426f19[_0x217aaf(0xf5)]+_0x217aaf(0xeb)+_0xeae0d5[_0x217aaf(0xd4)]+'.',_0x217aaf(0xc2));return _0x2d511f[_0x217aaf(0xb7)];}function applyAppBinding(_0x19d951,_0x51a60b,_0x1c6f64){const _0x4a828f=a59_0x56e5,_0x4031d6=_0x51a60b['target'][_0x4a828f(0xdc)];if(!_0x4031d6)return;const _0x13adc1=_0x19d951[_0x4a828f(0xbe)][_0x4031d6];if(!_0x13adc1)throw CliErrors[_0x4a828f(0xbd)]('Unknown\x20appRef\x20\x22'+_0x4031d6+'\x22\x20in\x20service\x20command\x20'+_0x51a60b[_0x4a828f(0xd2)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x330cb3=_0x13adc1[_0x4a828f(0xe3)]||_0x13adc1[_0x4a828f(0xd4)];_0x330cb3&&!hasText(_0x1c6f64[_0x4a828f(0xe3)])&&(_0x1c6f64['appcode']=_0x330cb3),_0x13adc1['app']&&!hasText(_0x1c6f64[_0x4a828f(0xe4)])&&!hasText(_0x1c6f64[_0x4a828f(0xe3)])&&(_0x1c6f64[_0x4a828f(0xe4)]=_0x13adc1[_0x4a828f(0xe4)]),_0x13adc1[_0x4a828f(0x100)]&&!hasText(_0x1c6f64['env'])&&(_0x1c6f64['env']=_0x13adc1['env']);}function renderDynamicCommandHelp(_0x98d907){const _0x453090=a59_0x56e5,_0x58a458=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x453090(0xb4)+_0x98d907[_0x453090(0xe2)][_0x453090(0xb2)],_0x453090(0xd7)+_0x98d907['target'][_0x453090(0x102)]];if(_0x98d907[_0x453090(0xe2)][_0x453090(0xb5)])_0x58a458[_0x453090(0xd1)](_0x453090(0xad)+_0x98d907[_0x453090(0xe2)][_0x453090(0xb5)]);if(_0x98d907[_0x453090(0xe2)][_0x453090(0xf5)])_0x58a458['push'](_0x453090(0xca)+_0x98d907[_0x453090(0xe2)][_0x453090(0xf5)]);if(_0x98d907[_0x453090(0xe2)][_0x453090(0xe0)])_0x58a458[_0x453090(0xd1)](_0x453090(0xf2)+_0x98d907[_0x453090(0xe2)][_0x453090(0xe0)]);if(_0x98d907[_0x453090(0xe2)]['scriptName'])_0x58a458[_0x453090(0xd1)]('\x20\x20\x20\x20functionName:\x20'+_0x98d907[_0x453090(0xe2)][_0x453090(0xc3)]);if(_0x98d907['mapTo'][_0x453090(0xda)]>0x0){_0x58a458[_0x453090(0xd1)]('',_0x453090(0xf4));for(const _0x5d2d0b of _0x98d907['mapTo']){_0x58a458[_0x453090(0xd1)](_0x453090(0xf7)+(_0x5d2d0b[_0x453090(0x108)]||'const')+_0x453090(0xb3)+_0x5d2d0b[_0x453090(0xe2)]+(_0x5d2d0b[_0x453090(0xcc)]?'.'+_0x5d2d0b[_0x453090(0xcc)]:''));}}return _0x58a458[_0x453090(0x109)]('\x0a');}function targetPreview(_0x76c6dd){const _0x54cae7=a59_0x56e5;return{'kind':_0x76c6dd[_0x54cae7(0xb2)],'command':_0x76c6dd[_0x54cae7(0x102)],'appRef':_0x76c6dd[_0x54cae7(0xdc)],'datasetCode':_0x76c6dd[_0x54cae7(0xb5)],'datatable':_0x76c6dd[_0x54cae7(0xf5)],'sqlCode':_0x76c6dd['sqlCode'],'bffCode':_0x76c6dd['bffCode'],'bffId':_0x76c6dd[_0x54cae7(0xea)],'functionName':_0x76c6dd[_0x54cae7(0xc3)]};}function normalizeScalarParams(_0x432b6c){const _0x4e062b=a59_0x56e5;return Object[_0x4e062b(0xae)](Object['entries'](_0x432b6c)[_0x4e062b(0x101)](([,_0xca3b41])=>typeof _0xca3b41===_0x4e062b(0xdf)||typeof _0xca3b41===_0x4e062b(0x106)));}function hasText(_0x24a3bf){const _0x27033e=a59_0x56e5;return typeof _0x24a3bf===_0x27033e(0xdf)&&_0x24a3bf[_0x27033e(0xfd)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x4a2555){const _0x3c2aa0=a59_0x56e5;return _0x4a2555===undefined||typeof _0x4a2555==='string'||typeof _0x4a2555===_0x3c2aa0(0x106)||typeof _0x4a2555==='boolean';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4490a8,_0xf8c8e4){const _0x3195ab=a60_0x5beb,_0x13b202=_0x4490a8();while(!![]){try{const _0x1db556=-parseInt(_0x3195ab(0x151))/0x1*(parseInt(_0x3195ab(0x157))/0x2)+-parseInt(_0x3195ab(0x155))/0x3+parseInt(_0x3195ab(0x14b))/0x4*(-parseInt(_0x3195ab(0x148))/0x5)+-parseInt(_0x3195ab(0x146))/0x6+parseInt(_0x3195ab(0x138))/0x7+parseInt(_0x3195ab(0x137))/0x8+-parseInt(_0x3195ab(0x156))/0x9*(-parseInt(_0x3195ab(0x153))/0xa);if(_0x1db556===_0xf8c8e4)break;else _0x13b202['push'](_0x13b202['shift']());}catch(_0x55df42){_0x13b202['push'](_0x13b202['shift']());}}}(a60_0x3e2c,0x5d053));export function adaptServiceTreeManifestForLegacyFramework(_0x527848){const _0x928acb=a60_0x5beb,_0x372d3b=cloneJsonValue(_0x527848),_0x1016b8=[];if(!isObjectRecord(_0x372d3b))return{'manifest':_0x372d3b,'errors':_0x1016b8};return Array['isArray'](_0x372d3b['commands'])&&_0x372d3b[_0x928acb(0x143)]['forEach']((_0x2e8b95,_0x29dab2)=>{const _0x3355c8=_0x928acb;if(!isObjectRecord(_0x2e8b95))return;adaptBffTarget(_0x2e8b95[_0x3355c8(0x131)],_0x3355c8(0x154)+_0x29dab2+_0x3355c8(0x14c),_0x1016b8);}),adaptResources(_0x372d3b[_0x928acb(0x13b)],_0x928acb(0x134),_0x1016b8),{'manifest':_0x372d3b,'errors':_0x1016b8};}export function toPublicServiceTreeTarget(_0x444384){const _0x1c3218=a60_0x5beb,{scriptName:_0xabc80c,..._0xe2662e}=_0x444384;return typeof _0xabc80c==='string'&&_0xabc80c[_0x1c3218(0x136)]()&&(_0xe2662e[_0x1c3218(0x13f)]=_0xabc80c),_0xe2662e;}export function toPublicNormalizedServiceTree(_0x51f4ca){const _0x21e28d=a60_0x5beb;return{..._0x51f4ca,'commands':_0x51f4ca[_0x21e28d(0x143)]['map'](_0x56aa42=>({..._0x56aa42,'target':toPublicServiceTreeTarget(_0x56aa42[_0x21e28d(0x131)])}))};}function adaptResources(_0x414eb5,_0x500ddb,_0x1bd18d){const _0x3ce0c2=a60_0x5beb;if(!isObjectRecord(_0x414eb5))return;for(const [_0x5e6dec,_0x4bc3c1]of Object[_0x3ce0c2(0x149)](_0x414eb5)){if(!isObjectRecord(_0x4bc3c1))continue;const _0x453aa9=_0x500ddb+'.'+_0x5e6dec;if(isObjectRecord(_0x4bc3c1[_0x3ce0c2(0x13d)]))for(const [_0xb74e40,_0x2ed39a]of Object['entries'](_0x4bc3c1[_0x3ce0c2(0x13d)])){if(!isObjectRecord(_0x2ed39a))continue;const _0x58d47b=_0x453aa9+_0x3ce0c2(0x135)+_0xb74e40,_0x4990cc=isObjectRecord(_0x2ed39a[_0x3ce0c2(0x131)])&&_0x2ed39a[_0x3ce0c2(0x131)]['kind']===_0x3ce0c2(0x132);adaptBffTarget(_0x2ed39a[_0x3ce0c2(0x131)],_0x58d47b+'.target',_0x1bd18d),(_0x4990cc||isBffAction(_0x2ed39a))&&adaptFunctionNameField(_0x2ed39a,_0x58d47b,_0x1bd18d);}adaptResources(_0x4bc3c1['resources'],_0x453aa9+_0x3ce0c2(0x140),_0x1bd18d);}}function adaptBffTarget(_0x2fd894,_0x3ef614,_0x5adb4f){const _0x34ca7c=a60_0x5beb;if(!isObjectRecord(_0x2fd894)||_0x2fd894[_0x34ca7c(0x14f)]!==_0x34ca7c(0x132))return;adaptFunctionNameField(_0x2fd894,_0x3ef614,_0x5adb4f);}function a60_0x3e2c(){const _0x280792=['error','actions','string','functionName','.resources','push','object','commands','call','prototype','3209898MdaMpI','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','157405qOXviQ','entries','map','96KOvCCu','].target','action','hasOwnProperty','kind','.scriptName','5027sTjMwP','bff.exec','3630zmnbwW','$.commands[','17736KLzvkl','35658IfoyJO','286eciDoi','target','bff','.functionName','$.resources','.actions.','trim','3739608XVnqsI','3434578VIfhKL','functionName\x20must\x20be\x20a\x20non-empty\x20string.','isArray','resources'];a60_0x3e2c=function(){return _0x280792;};return a60_0x3e2c();}function adaptFunctionNameField(_0x17dc0b,_0x1bc12e,_0x580418){const _0x2ace59=a60_0x5beb;Object[_0x2ace59(0x145)][_0x2ace59(0x14e)][_0x2ace59(0x144)](_0x17dc0b,'scriptName')&&_0x580418[_0x2ace59(0x141)]({'level':_0x2ace59(0x13c),'path':_0x1bc12e+_0x2ace59(0x150),'message':_0x2ace59(0x147)});if(Object[_0x2ace59(0x145)][_0x2ace59(0x14e)][_0x2ace59(0x144)](_0x17dc0b,_0x2ace59(0x13f))){if(typeof _0x17dc0b[_0x2ace59(0x13f)]!==_0x2ace59(0x13e)||!_0x17dc0b[_0x2ace59(0x13f)][_0x2ace59(0x136)]()){_0x580418['push']({'level':'error','path':_0x1bc12e+_0x2ace59(0x133),'message':_0x2ace59(0x139)}),delete _0x17dc0b[_0x2ace59(0x13f)];return;}_0x17dc0b['scriptName']=_0x17dc0b[_0x2ace59(0x13f)],delete _0x17dc0b[_0x2ace59(0x13f)];}}function isBffAction(_0x24708d){const _0x2368b8=a60_0x5beb;return _0x24708d[_0x2368b8(0x14f)]===_0x2368b8(0x132)||_0x24708d[_0x2368b8(0x14d)]==='bff.exec'||_0x24708d[_0x2368b8(0x131)]===_0x2368b8(0x152);}function cloneJsonValue(_0x5bc8d3){const _0x26b687=a60_0x5beb;if(Array[_0x26b687(0x13a)](_0x5bc8d3))return _0x5bc8d3[_0x26b687(0x14a)](_0x469a76=>cloneJsonValue(_0x469a76));if(isObjectRecord(_0x5bc8d3))return Object['fromEntries'](Object[_0x26b687(0x149)](_0x5bc8d3)[_0x26b687(0x14a)](([_0xb93eef,_0x196965])=>[_0xb93eef,cloneJsonValue(_0x196965)]));return _0x5bc8d3;}function a60_0x5beb(_0x5ef94e,_0x5c39eb){_0x5ef94e=_0x5ef94e-0x131;const _0x3e2c3c=a60_0x3e2c();let _0x5beb28=_0x3e2c3c[_0x5ef94e];return _0x5beb28;}function isObjectRecord(_0x4f6d53){const _0x4848d6=a60_0x5beb;return Boolean(_0x4f6d53)&&typeof _0x4f6d53===_0x4848d6(0x142)&&!Array[_0x4848d6(0x13a)](_0x4f6d53);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a61_0x2aae0a=a61_0x2d1a;(function(_0x1f89f4,_0x27524f){const _0x281690=a61_0x2d1a,_0x3d91fb=_0x1f89f4();while(!![]){try{const _0x41f152=parseInt(_0x281690(0x1b7))/0x1*(-parseInt(_0x281690(0x186))/0x2)+-parseInt(_0x281690(0x181))/0x3*(parseInt(_0x281690(0x196))/0x4)+parseInt(_0x281690(0x185))/0x5*(parseInt(_0x281690(0x1b4))/0x6)+-parseInt(_0x281690(0x17c))/0x7+parseInt(_0x281690(0x1b2))/0x8+-parseInt(_0x281690(0x1b3))/0x9*(-parseInt(_0x281690(0x188))/0xa)+parseInt(_0x281690(0x173))/0xb;if(_0x41f152===_0x27524f)break;else _0x3d91fb['push'](_0x3d91fb['shift']());}catch(_0x2bb657){_0x3d91fb['push'](_0x3d91fb['shift']());}}}(a61_0x3276,0x3f274));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a61_0x2d1a(_0x2145a9,_0x4d9ef0){_0x2145a9=_0x2145a9-0x16e;const _0x3276af=a61_0x3276();let _0x2d1abc=_0x3276af[_0x2145a9];return _0x2d1abc;}function a61_0x3276(){const _0xe1d3cc=['hash','service','manifest','length','180300FfKfRq','Imported\x20','str','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','entry','entries','Exported\x20service\x20','list','Local\x20service\x20code,\x20for\x20example\x20crm','description','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','read','import','importedAt','write','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','cliPath','将\x20Service\x20Tree\x20清单导入本地运行态注册表','Service\x20registry\x20validation\x20passed.','kind','map','export','registryIndex','required','lower\x20kebab-case\x20service\x20code','normalizedManifest','manifests','warnings','678936iayxaF','1293687AKAeHk','24IUelBJ','\x20service(s),\x20updated\x20','version','1rwXkaV','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCount','name','Service\x20manifest\x20validation\x20passed.','string','4082903ciTAsl','commands','errors','registryPath','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','source','remove','Imported','file','994329zpJMuC','registryServiceCode','target','type','report','33kXCXSv','filePath','risk','serviceCode','602655Ejrhli','370718XXFoxj','imported','10ZFZIvA','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Removed\x20service\x20','updated','Updated','WRITE','reduce','cliName','replaced'];a61_0x3276=function(){return _0xe1d3cc;};return a61_0x3276();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a61_0x2aae0a(0x17b),'type':a61_0x2aae0a(0x172),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':a61_0x2aae0a(0x172),'required':!![],'description':a61_0x2aae0a(0x19e),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x2aae0a(0x1ae)}};function summarizeService(_0x3075b5){const _0x57a4fc=a61_0x2aae0a;return{'serviceCode':_0x3075b5[_0x57a4fc(0x184)],'name':_0x3075b5[_0x57a4fc(0x1af)]['service'][_0x57a4fc(0x170)],'version':_0x3075b5[_0x57a4fc(0x1b6)],'importedAt':_0x3075b5[_0x57a4fc(0x1a3)],'source':_0x3075b5[_0x57a4fc(0x178)],'commandCount':_0x3075b5['normalizedManifest'][_0x57a4fc(0x174)][_0x57a4fc(0x195)],'commands':_0x3075b5[_0x57a4fc(0x1af)][_0x57a4fc(0x174)][_0x57a4fc(0x1aa)](_0x4fb204=>({'path':_0x4fb204[_0x57a4fc(0x1a6)],'description':_0x4fb204[_0x57a4fc(0x19f)],'risk':_0x4fb204[_0x57a4fc(0x183)],'target':toPublicServiceTreeTarget(_0x4fb204[_0x57a4fc(0x17e)]),'flags':_0x4fb204['flags'][_0x57a4fc(0x1aa)](_0x4f8924=>({'name':_0x4f8924[_0x57a4fc(0x170)],'cliName':_0x4f8924[_0x57a4fc(0x190)],'type':_0x4f8924[_0x57a4fc(0x17f)],'required':_0x4f8924[_0x57a4fc(0x1ad)]===!![]}))}))};}function summarizeLoadedManifest(_0xbcb2a1){const _0x5e4af=a61_0x2aae0a;return{'service':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x193)],'version':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x1b6)],'commandCount':_0xbcb2a1['normalizedManifest']?.[_0x5e4af(0x174)][_0x5e4af(0x195)]??0x0,'commands':_0xbcb2a1[_0x5e4af(0x1af)]?.[_0x5e4af(0x174)][_0x5e4af(0x1aa)](_0x41fbd7=>({'path':_0x41fbd7['cliPath'],'risk':_0x41fbd7['risk'],'target':toPublicServiceTreeTarget(_0x41fbd7[_0x5e4af(0x17e)])}))??[],'registryIndex':_0xbcb2a1[_0x5e4af(0x1ac)],'registryServiceCode':_0xbcb2a1[_0x5e4af(0x17d)],'errors':_0xbcb2a1[_0x5e4af(0x180)][_0x5e4af(0x175)],'warnings':_0xbcb2a1[_0x5e4af(0x180)]['warnings']};}export const serviceDefinitions=[{'service':a61_0x2aae0a(0x193),'command':'validate','description':a61_0x2aae0a(0x18a),'risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x54ac8e){const _0x13e7eb=a61_0x2aae0a,_0x9dc0a0=loadServiceManifestFromFile(_0x54ac8e[_0x13e7eb(0x198)](_0x13e7eb(0x17b)));if(!_0x9dc0a0[_0x13e7eb(0x180)]['ok'])return{'ok':![],'data':{'file':_0x9dc0a0[_0x13e7eb(0x182)],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'serviceCount':_0x9dc0a0['manifests'][_0x13e7eb(0x195)],'services':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x1aa)](summarizeLoadedManifest),'errors':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x175)],'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':formatValidationFailure(_0x9dc0a0[_0x13e7eb(0x180)])};if(_0x9dc0a0[_0x13e7eb(0x1a9)]==='registry'||_0x9dc0a0[_0x13e7eb(0x1b0)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x9dc0a0[_0x13e7eb(0x182)],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'serviceCount':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x195)],'commandCount':_0x9dc0a0[_0x13e7eb(0x1b0)][_0x13e7eb(0x18f)]((_0x1c395e,_0x5815c4)=>_0x1c395e+(_0x5815c4['normalizedManifest']?.[_0x13e7eb(0x174)][_0x13e7eb(0x195)]??0x0),0x0),'services':_0x9dc0a0['manifests']['map'](summarizeLoadedManifest),'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':_0x13e7eb(0x1a8)};return{'ok':!![],'data':{'file':_0x9dc0a0['filePath'],'hash':_0x9dc0a0[_0x13e7eb(0x192)],'kind':_0x9dc0a0[_0x13e7eb(0x1a9)],'service':_0x9dc0a0[_0x13e7eb(0x1af)]?.['service'],'version':_0x9dc0a0['normalizedManifest']?.[_0x13e7eb(0x1b6)],'commandCount':_0x9dc0a0[_0x13e7eb(0x1af)]?.[_0x13e7eb(0x174)][_0x13e7eb(0x195)]??0x0,'commands':_0x9dc0a0['normalizedManifest']?.[_0x13e7eb(0x174)][_0x13e7eb(0x1aa)](_0x333121=>({'path':_0x333121['cliPath'],'risk':_0x333121[_0x13e7eb(0x183)],'target':toPublicServiceTreeTarget(_0x333121[_0x13e7eb(0x17e)])})),'warnings':_0x9dc0a0[_0x13e7eb(0x180)][_0x13e7eb(0x1b1)]},'message':_0x13e7eb(0x171)};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x1a2),'description':a61_0x2aae0a(0x1a7),'risk':a61_0x2aae0a(0x1a4),'confirmationDescription':a61_0x2aae0a(0x177),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x117043){const _0x3befa8=a61_0x2aae0a,_0x572bd8=loadServiceManifestFromFile(_0x117043[_0x3befa8(0x198)](_0x3befa8(0x17b)));return{'method':_0x3befa8(0x18e),'url':getServiceRegistryPath(),'body':{'file':_0x572bd8[_0x3befa8(0x182)],'hash':_0x572bd8[_0x3befa8(0x192)],'kind':_0x572bd8[_0x3befa8(0x1a9)],'ok':_0x572bd8[_0x3befa8(0x180)]['ok'],'service':_0x572bd8[_0x3befa8(0x1af)]?.[_0x3befa8(0x193)],'version':_0x572bd8[_0x3befa8(0x1af)]?.[_0x3befa8(0x1b6)],'serviceCount':_0x572bd8[_0x3befa8(0x1b0)][_0x3befa8(0x195)],'services':_0x572bd8['manifests'][_0x3befa8(0x1aa)](_0x37cd34=>({'service':_0x37cd34[_0x3befa8(0x1af)]?.[_0x3befa8(0x193)],'version':_0x37cd34[_0x3befa8(0x1af)]?.['version'],'commandCount':_0x37cd34[_0x3befa8(0x1af)]?.[_0x3befa8(0x174)][_0x3befa8(0x195)]??0x0,'errors':_0x37cd34[_0x3befa8(0x180)][_0x3befa8(0x175)]})),'errors':_0x572bd8[_0x3befa8(0x180)][_0x3befa8(0x175)],'commandCount':_0x572bd8['normalizedManifest']?.['commands'][_0x3befa8(0x195)]??0x0},'description':_0x3befa8(0x16e)};},async 'execute'(_0x4e2697){const _0x43c868=a61_0x2aae0a,_0x54ca4c=importServiceManifest(_0x4e2697[_0x43c868(0x198)](_0x43c868(0x17b)));if(_0x54ca4c[_0x43c868(0x19b)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x54ca4c[_0x43c868(0x176)],'imported':_0x54ca4c['imported'],'updated':_0x54ca4c['updated'],'serviceCount':_0x54ca4c['serviceCount'],'services':_0x54ca4c[_0x43c868(0x19b)][_0x43c868(0x1aa)](summarizeService)},'message':_0x43c868(0x197)+_0x54ca4c[_0x43c868(0x187)]+_0x43c868(0x1b5)+_0x54ca4c[_0x43c868(0x18c)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x54ca4c[_0x43c868(0x176)],'replaced':_0x54ca4c['replaced'],'imported':_0x54ca4c[_0x43c868(0x187)],'updated':_0x54ca4c[_0x43c868(0x18c)],'serviceCount':_0x54ca4c[_0x43c868(0x16f)],'service':summarizeService(_0x54ca4c['entry'])},'message':(_0x54ca4c[_0x43c868(0x191)]?_0x43c868(0x18d):_0x43c868(0x17a))+'\x20service\x20'+_0x54ca4c['entry'][_0x43c868(0x184)]+'.'};}},{'service':'service','command':a61_0x2aae0a(0x1ab),'description':a61_0x2aae0a(0x189),'risk':a61_0x2aae0a(0x1a4),'confirmationDescription':a61_0x2aae0a(0x1a5),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x32220b){const _0xb5bc89=a61_0x2aae0a,_0x21a57e=getLocalServiceEntry(_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x193)));return{'method':'WRITE','url':_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x17b)),'body':{'service':_0x32220b[_0xb5bc89(0x198)](_0xb5bc89(0x193)),'found':Boolean(_0x21a57e),'version':_0x21a57e?.['version'],'source':_0x21a57e?.['source']},'description':_0xb5bc89(0x199)};},async 'execute'(_0x3eb64b){const _0x4d9069=a61_0x2aae0a,_0x911c05=exportServiceManifest(_0x3eb64b['str']('service'),_0x3eb64b['str'](_0x4d9069(0x17b)));return{'ok':!![],'data':{'registryPath':_0x911c05[_0x4d9069(0x176)],'file':_0x911c05['filePath'],'service':summarizeService(_0x911c05[_0x4d9069(0x19a)])},'message':_0x4d9069(0x19c)+_0x911c05[_0x4d9069(0x19a)]['serviceCode']+'.'};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x19d),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3ced05=a61_0x2aae0a,_0x571bf8=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x571bf8[_0x3ced05(0x195)],'services':_0x571bf8[_0x3ced05(0x1aa)](summarizeService)}};}},{'service':a61_0x2aae0a(0x193),'command':a61_0x2aae0a(0x179),'description':'从本地运行态注册表移除\x20Service\x20Tree\x20清单','risk':a61_0x2aae0a(0x1a4),'confirmationDescription':'将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x5ab8d8){const _0x290a62=a61_0x2aae0a,_0x15bff7=getLocalServiceEntry(_0x5ab8d8[_0x290a62(0x198)](_0x290a62(0x193)));return{'method':_0x290a62(0x18e),'url':getServiceRegistryPath(),'body':{'service':_0x5ab8d8[_0x290a62(0x198)](_0x290a62(0x193)),'found':Boolean(_0x15bff7),'version':_0x15bff7?.['version'],'source':_0x15bff7?.[_0x290a62(0x178)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x181a3e){const _0x2f237=a61_0x2aae0a,_0x52f9b7=removeServiceManifest(_0x181a3e[_0x2f237(0x198)](_0x2f237(0x193)));return{'ok':!![],'data':{'registryPath':_0x52f9b7[_0x2f237(0x176)],'serviceCount':_0x52f9b7[_0x2f237(0x16f)],'service':summarizeService(_0x52f9b7['entry'])},'message':_0x2f237(0x18b)+_0x52f9b7[_0x2f237(0x19a)][_0x2f237(0x184)]+'.'};}},{'service':a61_0x2aae0a(0x193),'command':'detail','description':a61_0x2aae0a(0x1a0),'risk':a61_0x2aae0a(0x1a1),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x9bbf6c){const _0xf6e3d4=a61_0x2aae0a,_0x15712e=getLocalServiceEntry(_0x9bbf6c[_0xf6e3d4(0x198)]('service'));if(!_0x15712e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x9bbf6c['str'](_0xf6e3d4(0x193))},'message':'Local\x20service\x20not\x20found:\x20'+_0x9bbf6c['str']('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x15712e),'manifest':_0x15712e[_0xf6e3d4(0x194)],'normalizedManifest':toPublicNormalizedServiceTree(_0x15712e['normalizedManifest'])}};}}];
|
|
1
|
+
const a61_0x357366=a61_0x3044;(function(_0x75dfe5,_0x356ea2){const _0x4643e5=a61_0x3044,_0x425ef4=_0x75dfe5();while(!![]){try{const _0x163e38=parseInt(_0x4643e5(0x226))/0x1*(parseInt(_0x4643e5(0x21a))/0x2)+parseInt(_0x4643e5(0x1ed))/0x3+-parseInt(_0x4643e5(0x1fc))/0x4+parseInt(_0x4643e5(0x229))/0x5+parseInt(_0x4643e5(0x1fd))/0x6*(parseInt(_0x4643e5(0x228))/0x7)+-parseInt(_0x4643e5(0x205))/0x8*(-parseInt(_0x4643e5(0x224))/0x9)+parseInt(_0x4643e5(0x202))/0xa*(-parseInt(_0x4643e5(0x1f5))/0xb);if(_0x163e38===_0x356ea2)break;else _0x425ef4['push'](_0x425ef4['shift']());}catch(_0x2a372a){_0x425ef4['push'](_0x425ef4['shift']());}}}(a61_0x47c4,0xbbc4f));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 a61_0x47c4(){const _0x539fff=['Service\x20manifest\x20validation\x20passed.','entries','11XQBrCE','warnings','Service\x20registry\x20validation\x20passed.','registry','description','replaced','reduce','3040112xPAyNs','2238NiQGKm','cliName','serviceCount','type','remove','36955780IPYyWQ','Removed\x20service\x20','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','7502560gFHrYA','normalizedManifest','entry','file','filePath','source','cliPath','Exported\x20service\x20','read','\x20service\x20','Imported\x20','hash','\x20service(s),\x20updated\x20','imported','将\x20Service\x20Tree\x20清单导入本地运行态注册表','version','validate','Imported','length','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','service','213090DBhoyH','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Updated','write','updated','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','Service\x20Tree\x20manifest\x20file\x20path','required','str','string','9BuViBU','name','14FCksRn','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','6545BYDMWV','5299665IuFWCv','Local\x20service\x20code,\x20for\x20example\x20crm','manifests','kind','target','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','errors','report','\x20service(s).','risk','map','Local\x20service\x20not\x20found:\x20','export','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','registryServiceCode','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','commands','serviceCode','4159713ZQwvRq','list','WRITE','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registryPath','lower\x20kebab-case\x20service\x20code'];a61_0x47c4=function(){return _0x539fff;};return a61_0x47c4();}const FILE_FLAG={'name':a61_0x357366(0x208),'type':a61_0x357366(0x223),'required':!![],'description':a61_0x357366(0x220)},SERVICE_FLAG={'name':a61_0x357366(0x219),'type':a61_0x357366(0x223),'required':!![],'description':a61_0x357366(0x22a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a61_0x357366(0x1f2)}};function a61_0x3044(_0x284bec,_0x4077d4){_0x284bec=_0x284bec-0x1e4;const _0x47c491=a61_0x47c4();let _0x3044fa=_0x47c491[_0x284bec];return _0x3044fa;}function summarizeService(_0x4d0131){const _0x3d5660=a61_0x357366;return{'serviceCode':_0x4d0131[_0x3d5660(0x1ec)],'name':_0x4d0131[_0x3d5660(0x206)][_0x3d5660(0x219)]['name'],'version':_0x4d0131['version'],'importedAt':_0x4d0131['importedAt'],'source':_0x4d0131['source'],'commandCount':_0x4d0131[_0x3d5660(0x206)][_0x3d5660(0x1eb)]['length'],'commands':_0x4d0131[_0x3d5660(0x206)]['commands'][_0x3d5660(0x1e5)](_0x4c1618=>({'path':_0x4c1618[_0x3d5660(0x20b)],'description':_0x4c1618[_0x3d5660(0x1f9)],'risk':_0x4c1618[_0x3d5660(0x1e4)],'target':toPublicServiceTreeTarget(_0x4c1618['target']),'flags':_0x4c1618['flags'][_0x3d5660(0x1e5)](_0x3a9ef2=>({'name':_0x3a9ef2[_0x3d5660(0x225)],'cliName':_0x3a9ef2[_0x3d5660(0x1fe)],'type':_0x3a9ef2[_0x3d5660(0x200)],'required':_0x3a9ef2[_0x3d5660(0x221)]===!![]}))}))};}function summarizeLoadedManifest(_0x1c4236){const _0x291538=a61_0x357366;return{'service':_0x1c4236['normalizedManifest']?.[_0x291538(0x219)],'version':_0x1c4236[_0x291538(0x206)]?.[_0x291538(0x214)],'commandCount':_0x1c4236[_0x291538(0x206)]?.['commands'][_0x291538(0x217)]??0x0,'commands':_0x1c4236[_0x291538(0x206)]?.[_0x291538(0x1eb)][_0x291538(0x1e5)](_0x53393a=>({'path':_0x53393a[_0x291538(0x20b)],'risk':_0x53393a[_0x291538(0x1e4)],'target':toPublicServiceTreeTarget(_0x53393a['target'])}))??[],'registryIndex':_0x1c4236['registryIndex'],'registryServiceCode':_0x1c4236[_0x291538(0x1e9)],'errors':_0x1c4236[_0x291538(0x230)][_0x291538(0x22f)],'warnings':_0x1c4236['report'][_0x291538(0x1f6)]};}export const serviceDefinitions=[{'service':'service','command':a61_0x357366(0x215),'description':a61_0x357366(0x204),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x47686c){const _0x48b276=a61_0x357366,_0x29772d=loadServiceManifestFromFile(_0x47686c['str'](_0x48b276(0x208)));if(!_0x29772d[_0x48b276(0x230)]['ok'])return{'ok':![],'data':{'file':_0x29772d[_0x48b276(0x209)],'hash':_0x29772d['hash'],'kind':_0x29772d['kind'],'serviceCount':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x217)],'services':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x1e5)](summarizeLoadedManifest),'errors':_0x29772d[_0x48b276(0x230)][_0x48b276(0x22f)],'warnings':_0x29772d[_0x48b276(0x230)]['warnings']},'message':formatValidationFailure(_0x29772d[_0x48b276(0x230)])};if(_0x29772d[_0x48b276(0x22c)]===_0x48b276(0x1f8)||_0x29772d['manifests'][_0x48b276(0x217)]!==0x1)return{'ok':!![],'data':{'file':_0x29772d['filePath'],'hash':_0x29772d[_0x48b276(0x210)],'kind':_0x29772d['kind'],'serviceCount':_0x29772d['manifests']['length'],'commandCount':_0x29772d[_0x48b276(0x22b)][_0x48b276(0x1fb)]((_0x2c56ae,_0x5d2605)=>_0x2c56ae+(_0x5d2605[_0x48b276(0x206)]?.['commands'][_0x48b276(0x217)]??0x0),0x0),'services':_0x29772d['manifests'][_0x48b276(0x1e5)](summarizeLoadedManifest),'warnings':_0x29772d[_0x48b276(0x230)][_0x48b276(0x1f6)]},'message':_0x48b276(0x1f7)};return{'ok':!![],'data':{'file':_0x29772d[_0x48b276(0x209)],'hash':_0x29772d[_0x48b276(0x210)],'kind':_0x29772d[_0x48b276(0x22c)],'service':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x219)],'version':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x214)],'commandCount':_0x29772d[_0x48b276(0x206)]?.[_0x48b276(0x1eb)]['length']??0x0,'commands':_0x29772d['normalizedManifest']?.['commands']['map'](_0x5baf3c=>({'path':_0x5baf3c['cliPath'],'risk':_0x5baf3c[_0x48b276(0x1e4)],'target':toPublicServiceTreeTarget(_0x5baf3c[_0x48b276(0x22d)])})),'warnings':_0x29772d[_0x48b276(0x230)][_0x48b276(0x1f6)]},'message':_0x48b276(0x1f3)};}},{'service':a61_0x357366(0x219),'command':'import','description':a61_0x357366(0x213),'risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x1ea),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x4bb071){const _0x219316=a61_0x357366,_0x322a36=loadServiceManifestFromFile(_0x4bb071['str'](_0x219316(0x208)));return{'method':_0x219316(0x1ef),'url':getServiceRegistryPath(),'body':{'file':_0x322a36[_0x219316(0x209)],'hash':_0x322a36[_0x219316(0x210)],'kind':_0x322a36[_0x219316(0x22c)],'ok':_0x322a36['report']['ok'],'service':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x219)],'version':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x214)],'serviceCount':_0x322a36[_0x219316(0x22b)][_0x219316(0x217)],'services':_0x322a36['manifests'][_0x219316(0x1e5)](_0x3d1947=>({'service':_0x3d1947['normalizedManifest']?.[_0x219316(0x219)],'version':_0x3d1947['normalizedManifest']?.[_0x219316(0x214)],'commandCount':_0x3d1947[_0x219316(0x206)]?.[_0x219316(0x1eb)][_0x219316(0x217)]??0x0,'errors':_0x3d1947['report']['errors']})),'errors':_0x322a36[_0x219316(0x230)]['errors'],'commandCount':_0x322a36[_0x219316(0x206)]?.[_0x219316(0x1eb)][_0x219316(0x217)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x2e2677){const _0x38eaf1=a61_0x357366,_0x5b60b1=importServiceManifest(_0x2e2677['str'](_0x38eaf1(0x208)));if(_0x5b60b1[_0x38eaf1(0x1f4)][_0x38eaf1(0x217)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x5b60b1[_0x38eaf1(0x1f1)],'imported':_0x5b60b1[_0x38eaf1(0x212)],'updated':_0x5b60b1[_0x38eaf1(0x21e)],'serviceCount':_0x5b60b1[_0x38eaf1(0x1ff)],'services':_0x5b60b1[_0x38eaf1(0x1f4)][_0x38eaf1(0x1e5)](summarizeService)},'message':_0x38eaf1(0x20f)+_0x5b60b1['imported']+_0x38eaf1(0x211)+_0x5b60b1[_0x38eaf1(0x21e)]+_0x38eaf1(0x231)};return{'ok':!![],'data':{'registryPath':_0x5b60b1[_0x38eaf1(0x1f1)],'replaced':_0x5b60b1[_0x38eaf1(0x1fa)],'imported':_0x5b60b1[_0x38eaf1(0x212)],'updated':_0x5b60b1[_0x38eaf1(0x21e)],'serviceCount':_0x5b60b1[_0x38eaf1(0x1ff)],'service':summarizeService(_0x5b60b1['entry'])},'message':(_0x5b60b1[_0x38eaf1(0x1fa)]?_0x38eaf1(0x21c):_0x38eaf1(0x216))+_0x38eaf1(0x20e)+_0x5b60b1[_0x38eaf1(0x207)]['serviceCode']+'.'};}},{'service':'service','command':a61_0x357366(0x1e7),'description':a61_0x357366(0x22e),'risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x21b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x15ece3){const _0xc2f462=a61_0x357366,_0x2bd171=getLocalServiceEntry(_0x15ece3['str']('service'));return{'method':_0xc2f462(0x1ef),'url':_0x15ece3[_0xc2f462(0x222)](_0xc2f462(0x208)),'body':{'service':_0x15ece3[_0xc2f462(0x222)](_0xc2f462(0x219)),'found':Boolean(_0x2bd171),'version':_0x2bd171?.[_0xc2f462(0x214)],'source':_0x2bd171?.[_0xc2f462(0x20a)]},'description':_0xc2f462(0x227)};},async 'execute'(_0x114852){const _0x1b338f=a61_0x357366,_0x2c71ad=exportServiceManifest(_0x114852[_0x1b338f(0x222)](_0x1b338f(0x219)),_0x114852[_0x1b338f(0x222)](_0x1b338f(0x208)));return{'ok':!![],'data':{'registryPath':_0x2c71ad[_0x1b338f(0x1f1)],'file':_0x2c71ad[_0x1b338f(0x209)],'service':summarizeService(_0x2c71ad[_0x1b338f(0x207)])},'message':_0x1b338f(0x20c)+_0x2c71ad[_0x1b338f(0x207)][_0x1b338f(0x1ec)]+'.'};}},{'service':a61_0x357366(0x219),'command':a61_0x357366(0x1ee),'description':a61_0x357366(0x1f0),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x41acfa=a61_0x357366,_0x2c1e31=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2c1e31[_0x41acfa(0x217)],'services':_0x2c1e31['map'](summarizeService)}};}},{'service':a61_0x357366(0x219),'command':a61_0x357366(0x201),'description':'从本地运行态注册表移除\x20Service\x20Tree\x20清单','risk':a61_0x357366(0x21d),'confirmationDescription':a61_0x357366(0x1e8),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x548960){const _0xf1f97e=a61_0x357366,_0x2d309c=getLocalServiceEntry(_0x548960[_0xf1f97e(0x222)](_0xf1f97e(0x219)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x548960[_0xf1f97e(0x222)]('service'),'found':Boolean(_0x2d309c),'version':_0x2d309c?.['version'],'source':_0x2d309c?.[_0xf1f97e(0x20a)]},'description':_0xf1f97e(0x21f)};},async 'execute'(_0x395233){const _0x238118=a61_0x357366,_0x4c1ac0=removeServiceManifest(_0x395233[_0x238118(0x222)](_0x238118(0x219)));return{'ok':!![],'data':{'registryPath':_0x4c1ac0[_0x238118(0x1f1)],'serviceCount':_0x4c1ac0['serviceCount'],'service':summarizeService(_0x4c1ac0[_0x238118(0x207)])},'message':_0x238118(0x203)+_0x4c1ac0[_0x238118(0x207)][_0x238118(0x1ec)]+'.'};}},{'service':a61_0x357366(0x219),'command':'detail','description':a61_0x357366(0x218),'risk':a61_0x357366(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1b1625){const _0x3e69cf=a61_0x357366,_0x2847fa=getLocalServiceEntry(_0x1b1625[_0x3e69cf(0x222)](_0x3e69cf(0x219)));if(!_0x2847fa)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1b1625['str']('service')},'message':_0x3e69cf(0x1e6)+_0x1b1625[_0x3e69cf(0x222)](_0x3e69cf(0x219))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2847fa),'manifest':_0x2847fa['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x2847fa[_0x3e69cf(0x206)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x15322d=a62_0x43bf;(function(_0x31f68a,_0x30b0dc){const _0x3b0b5f=a62_0x43bf,_0x1f6601=_0x31f68a();while(!![]){try{const _0x428efb=-parseInt(_0x3b0b5f(0x184))/0x1*(parseInt(_0x3b0b5f(0x1be))/0x2)+-parseInt(_0x3b0b5f(0x1ad))/0x3+-parseInt(_0x3b0b5f(0x18b))/0x4+-parseInt(_0x3b0b5f(0x186))/0x5*(parseInt(_0x3b0b5f(0x1d4))/0x6)+parseInt(_0x3b0b5f(0x1a7))/0x7+-parseInt(_0x3b0b5f(0x197))/0x8+parseInt(_0x3b0b5f(0x182))/0x9;if(_0x428efb===_0x30b0dc)break;else _0x1f6601['push'](_0x1f6601['shift']());}catch(_0x158111){_0x1f6601['push'](_0x1f6601['shift']());}}}(a62_0x538b,0xbe06b));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=a62_0x15322d(0x1bb);export function getServiceRegistryPath(_0x50b32b={}){const _0x482cb4=a62_0x15322d;return resolve(_0x50b32b[_0x482cb4(0x181)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5e8e71={}){const _0x4f2d04=a62_0x15322d,_0x4b2ead=getServiceRegistryPath(_0x5e8e71);if(!existsSync(_0x4b2ead))return emptyServiceRegistry();try{const _0x5ce480=readFileSync(_0x4b2ead,'utf8');if(!_0x5ce480[_0x4f2d04(0x1b9)]())return emptyServiceRegistry();const _0x123ff2=JSON[_0x4f2d04(0x19e)](_0x5ce480);if(_0x123ff2[_0x4f2d04(0x1d1)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x4f2d04(0x1a3)](_0x4f2d04(0x1c4)+String(_0x123ff2[_0x4f2d04(0x1d1)]),_0x4f2d04(0x19b)+_0x4b2ead+'.');if(!Array[_0x4f2d04(0x1a2)](_0x123ff2[_0x4f2d04(0x1b1)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x123ff2['updatedAt'],'services':_0x123ff2['services']};}catch(_0x427fae){if(_0x427fae instanceof Error&&_0x427fae[_0x4f2d04(0x1d6)]==='CliError')throw _0x427fae;throw CliErrors['validation'](_0x4f2d04(0x183)+_0x4b2ead,_0x4f2d04(0x1b4));}}export function writeServiceRegistry(_0x13b309,_0x16315c={}){const _0x4222e1=a62_0x15322d,_0x68c09e=getServiceRegistryPath(_0x16315c),_0x407938=dirname(_0x68c09e);!existsSync(_0x407938)&&mkdirSync(_0x407938,{'recursive':!![]});const _0x49b776=_0x68c09e+_0x4222e1(0x18f);try{writeFileSync(_0x49b776,JSON['stringify'](_0x13b309,null,0x2)+'\x0a',{'encoding':_0x4222e1(0x1c2),'mode':0x180}),renameSync(_0x49b776,_0x68c09e);}catch(_0x4f3cc6){try{unlinkSync(_0x49b776);}catch{}if(_0x4f3cc6?.['code']===_0x4222e1(0x1ab))throw CliErrors[_0x4222e1(0x1a3)](_0x4222e1(0x1cf)+_0x68c09e);throw _0x4f3cc6;}return _0x68c09e;}export function loadServiceManifestFromFile(_0x17c91e){const _0x3cb7e4=a62_0x15322d,_0x4cd426=resolve(_0x17c91e);if(!existsSync(_0x4cd426))throw CliErrors[_0x3cb7e4(0x1a3)](_0x3cb7e4(0x1b8)+_0x17c91e);let _0x11b215;const _0x49aab6=readFileSync(_0x4cd426,_0x3cb7e4(0x1c2));try{_0x11b215=JSON[_0x3cb7e4(0x19e)](_0x49aab6);}catch{throw CliErrors['validation'](_0x3cb7e4(0x18e)+_0x17c91e,_0x3cb7e4(0x1bf));}const _0x1fb186=sha256(_0x49aab6),_0x2565ec=extractLoadedServiceManifests(_0x11b215,_0x1fb186),_0x4c5813=aggregateValidationReports(_0x2565ec),_0x34c608=_0x2565ec[0x0];return{'filePath':_0x4cd426,'hash':_0x1fb186,'kind':isServiceRegistryLike(_0x11b215)?_0x3cb7e4(0x1ce):_0x3cb7e4(0x1d0),'manifest':_0x34c608?.[_0x3cb7e4(0x1d0)]??_0x11b215,'report':_0x4c5813,'normalizedManifest':_0x2565ec[_0x3cb7e4(0x19c)]===0x1?_0x34c608?.[_0x3cb7e4(0x1d5)]:undefined,'manifests':_0x2565ec};}export function importServiceManifest(_0x27e2e5,_0x3441ad={}){const _0xf79a34=a62_0x15322d,_0x26324d=loadServiceManifestFromFile(_0x27e2e5);if(!_0x26324d['report']['ok'])throw CliErrors[_0xf79a34(0x1a3)](formatValidationFailure(_0x26324d[_0xf79a34(0x199)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x26324d[_0xf79a34(0x1c5)]['length']===0x0)throw CliErrors[_0xf79a34(0x1a3)](_0xf79a34(0x1bd),_0xf79a34(0x195));const _0x3b7f94=readServiceRegistry(_0x3441ad),_0x289eb7=(_0x3441ad[_0xf79a34(0x1a0)]??(()=>new Date()))()[_0xf79a34(0x1a4)](),_0x37e58a=[];let _0x220f04=0x0,_0x5108d2=0x0;for(const _0x204505 of _0x26324d['manifests']){if(!_0x204505[_0xf79a34(0x1d5)])continue;const _0x16290c=_0x204505[_0xf79a34(0x1d5)]['service']['code'],_0x38e21a={'serviceCode':_0x16290c,'version':_0x204505[_0xf79a34(0x1d5)][_0xf79a34(0x1c0)],'importedAt':_0x289eb7,'source':{'type':_0xf79a34(0x1d3),'path':_0x26324d[_0xf79a34(0x185)],'hash':_0x204505['sourceHash']},'manifest':_0x204505[_0xf79a34(0x1d0)],'normalizedManifest':_0x204505['normalizedManifest']},_0x20473a=_0x3b7f94[_0xf79a34(0x1b1)][_0xf79a34(0x1b5)](_0x4601aa=>_0x4601aa[_0xf79a34(0x1cd)]===_0x16290c);_0x20473a>=0x0?(_0x3b7f94['services'][_0x20473a]=_0x38e21a,_0x5108d2++):(_0x3b7f94[_0xf79a34(0x1b1)][_0xf79a34(0x1cb)](_0x38e21a),_0x220f04++),_0x37e58a[_0xf79a34(0x1cb)](_0x38e21a);}_0x3b7f94['services'][_0xf79a34(0x198)]((_0x9234dc,_0x154a65)=>_0x9234dc['serviceCode'][_0xf79a34(0x1ae)](_0x154a65[_0xf79a34(0x1cd)])),_0x3b7f94['updatedAt']=_0x289eb7;const _0x395847=writeServiceRegistry(_0x3b7f94,_0x3441ad);return{'registryPath':_0x395847,'entry':_0x37e58a[0x0],'replaced':_0x37e58a['length']===0x1?_0x5108d2===0x1:_0x5108d2>0x0,'entries':_0x37e58a,'imported':_0x220f04,'updated':_0x5108d2,'serviceCount':_0x3b7f94['services']['length']};}export function exportServiceManifest(_0x27a61f,_0x1a075a,_0xa9169f={}){const _0x128682=a62_0x15322d,_0x56c36f=getServiceRegistryPath(_0xa9169f),_0x39128e=getLocalServiceEntry(_0x27a61f,_0xa9169f);if(!_0x39128e)throw CliErrors[_0x128682(0x1a3)](_0x128682(0x1c8)+_0x27a61f,_0x128682(0x190));const _0x34c789=resolve(_0x1a075a),_0x2b82c2=dirname(_0x34c789);return!existsSync(_0x2b82c2)&&mkdirSync(_0x2b82c2,{'recursive':!![]}),writeFileSync(_0x34c789,JSON['stringify'](_0x39128e[_0x128682(0x1d0)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x56c36f,'filePath':_0x34c789,'entry':_0x39128e};}export function removeServiceManifest(_0x31765a,_0x419d63={}){const _0x570235=a62_0x15322d,_0x2d7edf=readServiceRegistry(_0x419d63),_0x5de44b=_0x31765a[_0x570235(0x1b9)](),_0x4c2d7b=_0x2d7edf[_0x570235(0x1b1)]['findIndex'](_0x4d11e0=>_0x4d11e0[_0x570235(0x1cd)]===_0x5de44b);if(_0x4c2d7b<0x0)throw CliErrors[_0x570235(0x1a3)](_0x570235(0x1c8)+_0x5de44b,_0x570235(0x190));const [_0x6e165f]=_0x2d7edf[_0x570235(0x1b1)][_0x570235(0x19a)](_0x4c2d7b,0x1),_0x3dfa44=(_0x419d63[_0x570235(0x1a0)]??(()=>new Date()))()['toISOString']();_0x2d7edf['updatedAt']=_0x3dfa44;const _0x2339c2=writeServiceRegistry(_0x2d7edf,_0x419d63);return{'registryPath':_0x2339c2,'entry':_0x6e165f,'serviceCount':_0x2d7edf[_0x570235(0x1b1)][_0x570235(0x19c)]};}export function listLocalServices(_0x3d825c={}){const _0x4a16ef=a62_0x15322d;return readServiceRegistry(_0x3d825c)[_0x4a16ef(0x1b1)];}export function getLocalServiceEntry(_0x130a78,_0x590e33={}){const _0x5953e0=a62_0x15322d;return readServiceRegistry(_0x590e33)[_0x5953e0(0x1b1)][_0x5953e0(0x1a9)](_0x394183=>_0x394183[_0x5953e0(0x1cd)]===_0x130a78[_0x5953e0(0x1b9)]());}export function listLocalServiceTrees(_0x2f4056={}){const _0x561049=a62_0x15322d;return readServiceRegistry(_0x2f4056)[_0x561049(0x1b1)][_0x561049(0x18a)](_0x16207d=>_0x16207d[_0x561049(0x1d5)]);}export function inspectServiceRegistry(_0x1c14ba={}){const _0x19abfc=a62_0x15322d,_0x2b497d=getServiceRegistryPath(_0x1c14ba);if(!existsSync(_0x2b497d))return emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x191),![]);try{const _0x5bff0c=readFileSync(_0x2b497d,_0x19abfc(0x1c2));if(!_0x5bff0c['trim']())return emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x194),!![]);const _0x3bda80=JSON['parse'](_0x5bff0c);if(_0x3bda80[_0x19abfc(0x1d1)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'schemaVersion':_0x3bda80['schemaVersion'],'message':_0x19abfc(0x18d)+String(_0x3bda80[_0x19abfc(0x1d1)])};if(!Array[_0x19abfc(0x1a2)](_0x3bda80[_0x19abfc(0x1b1)]))return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3bda80[_0x19abfc(0x193)],'message':_0x19abfc(0x1b2)};const _0x4b2d7e=_0x3bda80[_0x19abfc(0x1b1)][_0x19abfc(0x18a)](summarizeLocalServiceEntry);return{'registryPath':_0x2b497d,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3bda80['updatedAt'],'serviceCount':_0x4b2d7e['length'],'commandCount':_0x4b2d7e['reduce']((_0x3d5a89,_0x109e8a)=>_0x3d5a89+_0x109e8a[_0x19abfc(0x18c)],0x0),'services':_0x4b2d7e};}catch(_0x3ca3c4){return{...emptyServiceRegistryInspection(_0x2b497d,_0x19abfc(0x188),!![]),'message':_0x3ca3c4 instanceof Error?_0x3ca3c4[_0x19abfc(0x1c7)]:String(_0x3ca3c4)};}}export function formatValidationFailure(_0x311261){const _0x5a56b9=a62_0x15322d,_0x53c8c2=_0x311261[_0x5a56b9(0x1bc)]['map'](_0x51c7de=>_0x51c7de[_0x5a56b9(0x1b6)]+':\x20'+_0x51c7de['message']);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x53c8c2['join']('\x0a');}function extractLoadedServiceManifests(_0xd7e1e7,_0x11f31d){const _0xba47b4=a62_0x15322d;if(!isServiceRegistryLike(_0xd7e1e7)){const _0x21404f=_0xd7e1e7,{manifest:_0x3cafe1,errors:_0x1e01a7}=adaptServiceTreeManifestForLegacyFramework(_0x21404f),_0x1c123e=validateServiceTreeManifest(_0x3cafe1),_0x14bbb6=mergeValidationErrors(_0x1c123e,_0x1e01a7);return[{'manifest':_0x21404f,'report':_0x14bbb6,'normalizedManifest':_0x14bbb6['ok']?normalizeServiceTreeManifest(_0x3cafe1):undefined,'sourceHash':_0x11f31d}];}return _0xd7e1e7[_0xba47b4(0x1b1)][_0xba47b4(0x18a)]((_0x3a2af7,_0x1d764d)=>{const _0x236f1b=_0xba47b4,_0x2cd629=isObjectRecord(_0x3a2af7)?_0x3a2af7[_0x236f1b(0x1d0)]:undefined,{manifest:_0x53137e,errors:_0x3a068b}=adaptServiceTreeManifestForLegacyFramework(_0x2cd629),_0x26cddd=validateServiceTreeManifest(_0x53137e),_0x431ec8=mergeValidationErrors(_0x26cddd,_0x3a068b),_0x5a6ae7=isObjectRecord(_0x3a2af7)&&typeof _0x3a2af7[_0x236f1b(0x1cd)]===_0x236f1b(0x1c1)?_0x3a2af7[_0x236f1b(0x1cd)]:undefined;return{'manifest':_0x2cd629,'report':_0x431ec8,'normalizedManifest':_0x431ec8['ok']?normalizeServiceTreeManifest(_0x53137e):undefined,'sourceHash':sha256(JSON[_0x236f1b(0x187)](_0x2cd629,null,0x2)+'\x0a'),'registryIndex':_0x1d764d,'registryServiceCode':_0x5a6ae7};});}function a62_0x43bf(_0x2bb7eb,_0x1506ab){_0x2bb7eb=_0x2bb7eb-0x181;const _0x538b47=a62_0x538b();let _0x43bf7a=_0x538b47[_0x2bb7eb];return _0x43bf7a;}function mergeValidationErrors(_0x5ae5fc,_0x51fab4){const _0x518f58=a62_0x15322d,_0x55fd91=_0x5ae5fc[_0x518f58(0x1bc)][_0x518f58(0x18a)](_0x108e82=>_0x108e82[_0x518f58(0x1c7)]===_0x518f58(0x1a5)?{..._0x108e82,'message':_0x518f58(0x196)}:_0x108e82),_0x3eb8a5=[..._0x51fab4,..._0x55fd91];return{'ok':_0x3eb8a5[_0x518f58(0x19c)]===0x0,'errors':_0x3eb8a5,'warnings':_0x5ae5fc['warnings']};}function aggregateValidationReports(_0x10f8a4){const _0x27f373=a62_0x15322d,_0x169972=_0x10f8a4[_0x27f373(0x1af)](_0x2e9067=>_0x2e9067[_0x27f373(0x1a8)]===undefined?_0x2e9067[_0x27f373(0x199)][_0x27f373(0x1bc)]:_0x2e9067[_0x27f373(0x199)][_0x27f373(0x1bc)][_0x27f373(0x18a)](_0x4496c5=>({..._0x4496c5,'path':prefixRegistryIssuePath(_0x2e9067['registryIndex'],_0x4496c5[_0x27f373(0x1b6)])}))),_0x2d6780=_0x10f8a4[_0x27f373(0x1af)](_0x287533=>_0x287533[_0x27f373(0x1a8)]===undefined?_0x287533[_0x27f373(0x199)][_0x27f373(0x1d2)]:_0x287533[_0x27f373(0x199)][_0x27f373(0x1d2)][_0x27f373(0x18a)](_0x8b7dc0=>({..._0x8b7dc0,'path':prefixRegistryIssuePath(_0x287533['registryIndex'],_0x8b7dc0[_0x27f373(0x1b6)])})));return{'ok':_0x169972[_0x27f373(0x19c)]===0x0,'errors':_0x169972,'warnings':_0x2d6780};}function prefixRegistryIssuePath(_0x380bab,_0x2d984f){const _0x3bff81=a62_0x15322d;if(_0x2d984f==='$')return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x1c3);if(_0x2d984f[_0x3bff81(0x1cc)]('$.'))return _0x3bff81(0x1c9)+_0x380bab+'].manifest'+_0x2d984f[_0x3bff81(0x1a6)](0x1);if(_0x2d984f[_0x3bff81(0x1cc)]('$['))return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x1c3)+_0x2d984f['slice'](0x1);return _0x3bff81(0x1c9)+_0x380bab+_0x3bff81(0x19f)+_0x2d984f;}function a62_0x538b(){const _0x4060c7=['Invalid\x20service\x20manifest\x20JSON:\x20','.tmp','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','missing','importedAt','updatedAt','empty','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','bff\x20target\x20requires\x20functionName.','5198368xXkdVk','sort','report','splice','Remove\x20or\x20migrate\x20','length','hex','parse','].manifest.','now','command','isArray','validation','toISOString','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','slice','5986344Wubvtb','registryIndex','find','service','ENOENT','risk','4353597ubWfBS','localeCompare','flatMap','commands','services','services\x20must\x20be\x20an\x20array','kind','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','findIndex','path','source','Service\x20manifest\x20file\x20not\x20found:\x20','trim','description','service.json','errors','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','1409112LAVknO','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','version','string','utf8','].manifest','Unsupported\x20service\x20registry\x20schemaVersion:\x20','manifests','digest','message','Local\x20service\x20not\x20found:\x20','$.services[','target','push','startsWith','serviceCode','registry','Cannot\x20write\x20service\x20registry:\x20','manifest','schemaVersion','warnings','file','6Sttglc','normalizedManifest','name','homeDir','46796004cgVfxI','Invalid\x20service\x20registry\x20JSON:\x20','1yPHUXS','filePath','6544670VHpzbl','stringify','invalid','object','map','4647664pyRqUa','commandCount','Unsupported\x20schemaVersion:\x20'];a62_0x538b=function(){return _0x4060c7;};return a62_0x538b();}function isServiceRegistryLike(_0x76dfbc){const _0x227fbd=a62_0x15322d;return isObjectRecord(_0x76dfbc)&&_0x76dfbc['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x227fbd(0x1a2)](_0x76dfbc[_0x227fbd(0x1b1)]);}function isObjectRecord(_0x13c4b8){const _0x1aee54=a62_0x15322d;return Boolean(_0x13c4b8)&&typeof _0x13c4b8===_0x1aee54(0x189)&&!Array[_0x1aee54(0x1a2)](_0x13c4b8);}function emptyServiceRegistryInspection(_0xfe133,_0x233ed0,_0xb7a8d){return{'registryPath':_0xfe133,'exists':_0xb7a8d,'status':_0x233ed0,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x38aa36){const _0x51f957=a62_0x15322d,_0x552cdb=_0x38aa36[_0x51f957(0x1d5)],_0x12af5f=_0x552cdb[_0x51f957(0x1b0)][_0x51f957(0x18a)](_0x3abf76=>({'path':_0x3abf76['cliPath'],'description':_0x3abf76[_0x51f957(0x1ba)],'risk':_0x3abf76[_0x51f957(0x1ac)],'targetKind':_0x3abf76[_0x51f957(0x1ca)][_0x51f957(0x1b3)],'targetCommand':_0x3abf76[_0x51f957(0x1ca)][_0x51f957(0x1a1)]}));return{'serviceCode':_0x38aa36[_0x51f957(0x1cd)],'name':_0x552cdb['service'][_0x51f957(0x1d6)],'description':_0x552cdb[_0x51f957(0x1aa)][_0x51f957(0x1ba)],'version':_0x38aa36[_0x51f957(0x1c0)],'importedAt':_0x38aa36[_0x51f957(0x192)],'source':_0x38aa36[_0x51f957(0x1b7)],'commandCount':_0x12af5f[_0x51f957(0x19c)],'commands':_0x12af5f};}function sha256(_0x4a900e){const _0x2ee270=a62_0x15322d;return createHash('sha256')['update'](_0x4a900e)[_0x2ee270(0x1c6)](_0x2ee270(0x19d));}
|
|
1
|
+
function a62_0x5125(_0xf2b6dd,_0xbcc518){_0xf2b6dd=_0xf2b6dd-0x1d6;const _0x57a384=a62_0x57a3();let _0x5125ab=_0x57a384[_0xf2b6dd];return _0x5125ab;}const a62_0x22ee08=a62_0x5125;(function(_0x179163,_0x60b7ff){const _0x5eb2f9=a62_0x5125,_0x110cec=_0x179163();while(!![]){try{const _0x552ef2=-parseInt(_0x5eb2f9(0x218))/0x1+parseInt(_0x5eb2f9(0x216))/0x2+-parseInt(_0x5eb2f9(0x207))/0x3+-parseInt(_0x5eb2f9(0x1db))/0x4+-parseInt(_0x5eb2f9(0x1ff))/0x5*(parseInt(_0x5eb2f9(0x1fe))/0x6)+-parseInt(_0x5eb2f9(0x1ed))/0x7*(-parseInt(_0x5eb2f9(0x1d8))/0x8)+parseInt(_0x5eb2f9(0x21f))/0x9*(parseInt(_0x5eb2f9(0x224))/0xa);if(_0x552ef2===_0x60b7ff)break;else _0x110cec['push'](_0x110cec['shift']());}catch(_0x4181d0){_0x110cec['push'](_0x110cec['shift']());}}}(a62_0x57a3,0x65a73));import{createHash}from'node:crypto';function a62_0x57a3(){const _0x5d81b8=['10AgsIqR','update','empty','62856dYQBCb','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','Cannot\x20write\x20service\x20registry:\x20','2678864iDspDb','errors','kind','string','description','].manifest.','digest','slice','service.json','registryIndex','Unsupported\x20schemaVersion:\x20','command','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','.tmp','Local\x20service\x20not\x20found:\x20','code','push','missing','581pwAXcL','name','updatedAt','findIndex','localeCompare','trim','homeDir','length','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','serviceCode','bff\x20target\x20requires\x20functionName.','Unsupported\x20service\x20registry\x20schemaVersion:\x20','schemaVersion','sourceHash','Service\x20manifest\x20file\x20not\x20found:\x20','file','parse','84jwRePQ','274610kwACeM','now','services','commands','sort','sha256','commandCount','invalid','2391912ZePxBi','isArray','map','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','path','validation','warnings','toISOString','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Remove\x20or\x20migrate\x20','homeDirName','report','$.services[','flatMap','service','1592468ONhwZm','utf8','410495dDcKsA','manifest','message','risk','manifests','cliPath','source','14529861mdOpXb','normalizedManifest','stringify','hex','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.'];a62_0x57a3=function(){return _0x5d81b8;};return a62_0x57a3();}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=a62_0x22ee08(0x1e3);export function getServiceRegistryPath(_0x14b32b={}){const _0x7e77bf=a62_0x22ee08;return resolve(_0x14b32b[_0x7e77bf(0x1f3)]??homedir(),PRODUCT_CONFIG[_0x7e77bf(0x211)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x23e20a={}){const _0x11b1fa=a62_0x22ee08,_0x3f274e=getServiceRegistryPath(_0x23e20a);if(!existsSync(_0x3f274e))return emptyServiceRegistry();try{const _0x131f3a=readFileSync(_0x3f274e,_0x11b1fa(0x217));if(!_0x131f3a[_0x11b1fa(0x1f2)]())return emptyServiceRegistry();const _0x4ff258=JSON[_0x11b1fa(0x1fd)](_0x131f3a);if(_0x4ff258['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x11b1fa(0x1f8)+String(_0x4ff258[_0x11b1fa(0x1f9)]),_0x11b1fa(0x210)+_0x3f274e+'.');if(!Array[_0x11b1fa(0x208)](_0x4ff258[_0x11b1fa(0x201)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4ff258[_0x11b1fa(0x1ef)],'services':_0x4ff258[_0x11b1fa(0x201)]};}catch(_0x7a8609){if(_0x7a8609 instanceof Error&&_0x7a8609[_0x11b1fa(0x1ee)]==='CliError')throw _0x7a8609;throw CliErrors['validation']('Invalid\x20service\x20registry\x20JSON:\x20'+_0x3f274e,_0x11b1fa(0x223));}}export function writeServiceRegistry(_0xaa3905,_0x2cf969={}){const _0x3a423c=a62_0x22ee08,_0x2a8bac=getServiceRegistryPath(_0x2cf969),_0x154e49=dirname(_0x2a8bac);!existsSync(_0x154e49)&&mkdirSync(_0x154e49,{'recursive':!![]});const _0x781c95=_0x2a8bac+_0x3a423c(0x1e8);try{writeFileSync(_0x781c95,JSON[_0x3a423c(0x221)](_0xaa3905,null,0x2)+'\x0a',{'encoding':_0x3a423c(0x217),'mode':0x180}),renameSync(_0x781c95,_0x2a8bac);}catch(_0x2a7a5f){try{unlinkSync(_0x781c95);}catch{}if(_0x2a7a5f?.[_0x3a423c(0x1ea)]==='ENOENT')throw CliErrors[_0x3a423c(0x20c)](_0x3a423c(0x1da)+_0x2a8bac);throw _0x2a7a5f;}return _0x2a8bac;}export function loadServiceManifestFromFile(_0x163a6a){const _0x3f6784=a62_0x22ee08,_0x5dc908=resolve(_0x163a6a);if(!existsSync(_0x5dc908))throw CliErrors[_0x3f6784(0x20c)](_0x3f6784(0x1fb)+_0x163a6a);let _0xb43dde;const _0x593613=readFileSync(_0x5dc908,_0x3f6784(0x217));try{_0xb43dde=JSON[_0x3f6784(0x1fd)](_0x593613);}catch{throw CliErrors[_0x3f6784(0x20c)]('Invalid\x20service\x20manifest\x20JSON:\x20'+_0x163a6a,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x18b1d2=sha256(_0x593613),_0x23a1a5=extractLoadedServiceManifests(_0xb43dde,_0x18b1d2),_0x303e49=aggregateValidationReports(_0x23a1a5),_0x461807=_0x23a1a5[0x0];return{'filePath':_0x5dc908,'hash':_0x18b1d2,'kind':isServiceRegistryLike(_0xb43dde)?'registry':_0x3f6784(0x219),'manifest':_0x461807?.[_0x3f6784(0x219)]??_0xb43dde,'report':_0x303e49,'normalizedManifest':_0x23a1a5['length']===0x1?_0x461807?.[_0x3f6784(0x220)]:undefined,'manifests':_0x23a1a5};}export function importServiceManifest(_0x3b4cfb,_0x1bc3c1={}){const _0x54c57b=a62_0x22ee08,_0x3f5f39=loadServiceManifestFromFile(_0x3b4cfb);if(!_0x3f5f39[_0x54c57b(0x212)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x3f5f39[_0x54c57b(0x212)]),_0x54c57b(0x1d9));if(_0x3f5f39[_0x54c57b(0x21c)][_0x54c57b(0x1f4)]===0x0)throw CliErrors[_0x54c57b(0x20c)](_0x54c57b(0x20f),_0x54c57b(0x20a));const _0x2f2c81=readServiceRegistry(_0x1bc3c1),_0x44d209=(_0x1bc3c1[_0x54c57b(0x200)]??(()=>new Date()))()['toISOString'](),_0x51bef0=[];let _0x4723c8=0x0,_0x2e3534=0x0;for(const _0x4e1f4a of _0x3f5f39['manifests']){if(!_0x4e1f4a[_0x54c57b(0x220)])continue;const _0x2101fc=_0x4e1f4a[_0x54c57b(0x220)]['service'][_0x54c57b(0x1ea)],_0x4f7536={'serviceCode':_0x2101fc,'version':_0x4e1f4a['normalizedManifest']['version'],'importedAt':_0x44d209,'source':{'type':_0x54c57b(0x1fc),'path':_0x3f5f39['filePath'],'hash':_0x4e1f4a[_0x54c57b(0x1fa)]},'manifest':_0x4e1f4a[_0x54c57b(0x219)],'normalizedManifest':_0x4e1f4a['normalizedManifest']},_0x4b74fb=_0x2f2c81[_0x54c57b(0x201)]['findIndex'](_0x1911c5=>_0x1911c5[_0x54c57b(0x1f6)]===_0x2101fc);_0x4b74fb>=0x0?(_0x2f2c81[_0x54c57b(0x201)][_0x4b74fb]=_0x4f7536,_0x2e3534++):(_0x2f2c81[_0x54c57b(0x201)][_0x54c57b(0x1eb)](_0x4f7536),_0x4723c8++),_0x51bef0['push'](_0x4f7536);}_0x2f2c81[_0x54c57b(0x201)][_0x54c57b(0x203)]((_0x3be49a,_0x404e58)=>_0x3be49a[_0x54c57b(0x1f6)][_0x54c57b(0x1f1)](_0x404e58[_0x54c57b(0x1f6)])),_0x2f2c81['updatedAt']=_0x44d209;const _0xf5e6a9=writeServiceRegistry(_0x2f2c81,_0x1bc3c1);return{'registryPath':_0xf5e6a9,'entry':_0x51bef0[0x0],'replaced':_0x51bef0[_0x54c57b(0x1f4)]===0x1?_0x2e3534===0x1:_0x2e3534>0x0,'entries':_0x51bef0,'imported':_0x4723c8,'updated':_0x2e3534,'serviceCount':_0x2f2c81['services'][_0x54c57b(0x1f4)]};}export function exportServiceManifest(_0x1bcd87,_0x2a404f,_0x16d042={}){const _0x372cd7=a62_0x22ee08,_0x5392a6=getServiceRegistryPath(_0x16d042),_0x52a480=getLocalServiceEntry(_0x1bcd87,_0x16d042);if(!_0x52a480)throw CliErrors['validation'](_0x372cd7(0x1e9)+_0x1bcd87,_0x372cd7(0x1e7));const _0x47c9f4=resolve(_0x2a404f),_0x310afd=dirname(_0x47c9f4);return!existsSync(_0x310afd)&&mkdirSync(_0x310afd,{'recursive':!![]}),writeFileSync(_0x47c9f4,JSON[_0x372cd7(0x221)](_0x52a480[_0x372cd7(0x219)],null,0x2)+'\x0a',{'encoding':_0x372cd7(0x217),'mode':0x180}),{'registryPath':_0x5392a6,'filePath':_0x47c9f4,'entry':_0x52a480};}export function removeServiceManifest(_0x123e2f,_0x18a622={}){const _0xe83356=a62_0x22ee08,_0x4b889e=readServiceRegistry(_0x18a622),_0xe9bebd=_0x123e2f[_0xe83356(0x1f2)](),_0x5a0c2b=_0x4b889e[_0xe83356(0x201)][_0xe83356(0x1f0)](_0x244ad4=>_0x244ad4[_0xe83356(0x1f6)]===_0xe9bebd);if(_0x5a0c2b<0x0)throw CliErrors[_0xe83356(0x20c)](_0xe83356(0x1e9)+_0xe9bebd,_0xe83356(0x1e7));const [_0x2c5a57]=_0x4b889e[_0xe83356(0x201)]['splice'](_0x5a0c2b,0x1),_0x5dce42=(_0x18a622[_0xe83356(0x200)]??(()=>new Date()))()[_0xe83356(0x20e)]();_0x4b889e['updatedAt']=_0x5dce42;const _0xa5525c=writeServiceRegistry(_0x4b889e,_0x18a622);return{'registryPath':_0xa5525c,'entry':_0x2c5a57,'serviceCount':_0x4b889e[_0xe83356(0x201)][_0xe83356(0x1f4)]};}export function listLocalServices(_0x5f4e35={}){const _0x376384=a62_0x22ee08;return readServiceRegistry(_0x5f4e35)[_0x376384(0x201)];}export function getLocalServiceEntry(_0x217e8e,_0x11ce63={}){const _0x42afbe=a62_0x22ee08;return readServiceRegistry(_0x11ce63)[_0x42afbe(0x201)]['find'](_0x451803=>_0x451803[_0x42afbe(0x1f6)]===_0x217e8e[_0x42afbe(0x1f2)]());}export function listLocalServiceTrees(_0x3a3f04={}){const _0x2f45cd=a62_0x22ee08;return readServiceRegistry(_0x3a3f04)['services'][_0x2f45cd(0x209)](_0x4c6f94=>_0x4c6f94[_0x2f45cd(0x220)]);}export function inspectServiceRegistry(_0x330a7f={}){const _0x25209a=a62_0x22ee08,_0x7b6c00=getServiceRegistryPath(_0x330a7f);if(!existsSync(_0x7b6c00))return emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x1ec),![]);try{const _0x376939=readFileSync(_0x7b6c00,'utf8');if(!_0x376939['trim']())return emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x1d7),!![]);const _0x28d900=JSON[_0x25209a(0x1fd)](_0x376939);if(_0x28d900[_0x25209a(0x1f9)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'schemaVersion':_0x28d900[_0x25209a(0x1f9)],'message':_0x25209a(0x1e5)+String(_0x28d900[_0x25209a(0x1f9)])};if(!Array[_0x25209a(0x208)](_0x28d900['services']))return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x28d900[_0x25209a(0x1ef)],'message':'services\x20must\x20be\x20an\x20array'};const _0x19e5c3=_0x28d900[_0x25209a(0x201)]['map'](summarizeLocalServiceEntry);return{'registryPath':_0x7b6c00,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x28d900[_0x25209a(0x1ef)],'serviceCount':_0x19e5c3[_0x25209a(0x1f4)],'commandCount':_0x19e5c3['reduce']((_0x522bc7,_0x20925d)=>_0x522bc7+_0x20925d[_0x25209a(0x205)],0x0),'services':_0x19e5c3};}catch(_0xd85afb){return{...emptyServiceRegistryInspection(_0x7b6c00,_0x25209a(0x206),!![]),'message':_0xd85afb instanceof Error?_0xd85afb[_0x25209a(0x21a)]:String(_0xd85afb)};}}export function formatValidationFailure(_0x516ad1){const _0x3b9a44=a62_0x22ee08,_0x4b5294=_0x516ad1['errors'][_0x3b9a44(0x209)](_0x46d03f=>_0x46d03f[_0x3b9a44(0x20b)]+':\x20'+_0x46d03f[_0x3b9a44(0x21a)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x4b5294['join']('\x0a');}function extractLoadedServiceManifests(_0x41d3dd,_0x25bc95){const _0xce39dd=a62_0x22ee08;if(!isServiceRegistryLike(_0x41d3dd)){const _0x4366eb=_0x41d3dd,{manifest:_0x5bc3bf,errors:_0x45ced5}=adaptServiceTreeManifestForLegacyFramework(_0x4366eb),_0x4d9631=validateServiceTreeManifest(_0x5bc3bf),_0x3f1b21=mergeValidationErrors(_0x4d9631,_0x45ced5);return[{'manifest':_0x4366eb,'report':_0x3f1b21,'normalizedManifest':_0x3f1b21['ok']?normalizeServiceTreeManifest(_0x5bc3bf):undefined,'sourceHash':_0x25bc95}];}return _0x41d3dd['services'][_0xce39dd(0x209)]((_0x3c650e,_0x163fa6)=>{const _0x20f98e=_0xce39dd,_0x4f7d92=isObjectRecord(_0x3c650e)?_0x3c650e[_0x20f98e(0x219)]:undefined,{manifest:_0x2898d7,errors:_0x59dc09}=adaptServiceTreeManifestForLegacyFramework(_0x4f7d92),_0x4de403=validateServiceTreeManifest(_0x2898d7),_0x3780f8=mergeValidationErrors(_0x4de403,_0x59dc09),_0x235652=isObjectRecord(_0x3c650e)&&typeof _0x3c650e[_0x20f98e(0x1f6)]===_0x20f98e(0x1de)?_0x3c650e['serviceCode']:undefined;return{'manifest':_0x4f7d92,'report':_0x3780f8,'normalizedManifest':_0x3780f8['ok']?normalizeServiceTreeManifest(_0x2898d7):undefined,'sourceHash':sha256(JSON[_0x20f98e(0x221)](_0x4f7d92,null,0x2)+'\x0a'),'registryIndex':_0x163fa6,'registryServiceCode':_0x235652};});}function mergeValidationErrors(_0x39e94b,_0x22a72e){const _0x4afd71=a62_0x22ee08,_0x2ce339=_0x39e94b[_0x4afd71(0x1dc)]['map'](_0x32bcaa=>_0x32bcaa['message']===_0x4afd71(0x1f5)?{..._0x32bcaa,'message':_0x4afd71(0x1f7)}:_0x32bcaa),_0x36249b=[..._0x22a72e,..._0x2ce339];return{'ok':_0x36249b[_0x4afd71(0x1f4)]===0x0,'errors':_0x36249b,'warnings':_0x39e94b[_0x4afd71(0x20d)]};}function aggregateValidationReports(_0x4e9c79){const _0x4d4dbc=a62_0x22ee08,_0x4708de=_0x4e9c79[_0x4d4dbc(0x214)](_0x1fb715=>_0x1fb715['registryIndex']===undefined?_0x1fb715['report'][_0x4d4dbc(0x1dc)]:_0x1fb715['report'][_0x4d4dbc(0x1dc)][_0x4d4dbc(0x209)](_0x26c7f4=>({..._0x26c7f4,'path':prefixRegistryIssuePath(_0x1fb715[_0x4d4dbc(0x1e4)],_0x26c7f4[_0x4d4dbc(0x20b)])}))),_0x5a8d7a=_0x4e9c79[_0x4d4dbc(0x214)](_0x2af385=>_0x2af385['registryIndex']===undefined?_0x2af385[_0x4d4dbc(0x212)][_0x4d4dbc(0x20d)]:_0x2af385[_0x4d4dbc(0x212)][_0x4d4dbc(0x20d)]['map'](_0xa7aa42=>({..._0xa7aa42,'path':prefixRegistryIssuePath(_0x2af385[_0x4d4dbc(0x1e4)],_0xa7aa42[_0x4d4dbc(0x20b)])})));return{'ok':_0x4708de[_0x4d4dbc(0x1f4)]===0x0,'errors':_0x4708de,'warnings':_0x5a8d7a};}function prefixRegistryIssuePath(_0x32422f,_0xf64b59){const _0x56fff0=a62_0x22ee08;if(_0xf64b59==='$')return _0x56fff0(0x213)+_0x32422f+'].manifest';if(_0xf64b59['startsWith']('$.'))return _0x56fff0(0x213)+_0x32422f+'].manifest'+_0xf64b59[_0x56fff0(0x1e2)](0x1);if(_0xf64b59['startsWith']('$['))return'$.services['+_0x32422f+'].manifest'+_0xf64b59[_0x56fff0(0x1e2)](0x1);return _0x56fff0(0x213)+_0x32422f+_0x56fff0(0x1e0)+_0xf64b59;}function isServiceRegistryLike(_0x591418){const _0x3cd162=a62_0x22ee08;return isObjectRecord(_0x591418)&&_0x591418[_0x3cd162(0x1f9)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x591418['services']);}function isObjectRecord(_0x205cd0){return Boolean(_0x205cd0)&&typeof _0x205cd0==='object'&&!Array['isArray'](_0x205cd0);}function emptyServiceRegistryInspection(_0xfd360e,_0x2a0eda,_0x346c61){return{'registryPath':_0xfd360e,'exists':_0x346c61,'status':_0x2a0eda,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x4298d2){const _0x504789=a62_0x22ee08,_0x1b39d9=_0x4298d2[_0x504789(0x220)],_0x4afd95=_0x1b39d9[_0x504789(0x202)][_0x504789(0x209)](_0x379b56=>({'path':_0x379b56[_0x504789(0x21d)],'description':_0x379b56['description'],'risk':_0x379b56[_0x504789(0x21b)],'targetKind':_0x379b56['target'][_0x504789(0x1dd)],'targetCommand':_0x379b56['target'][_0x504789(0x1e6)]}));return{'serviceCode':_0x4298d2[_0x504789(0x1f6)],'name':_0x1b39d9['service'][_0x504789(0x1ee)],'description':_0x1b39d9[_0x504789(0x215)][_0x504789(0x1df)],'version':_0x4298d2['version'],'importedAt':_0x4298d2['importedAt'],'source':_0x4298d2[_0x504789(0x21e)],'commandCount':_0x4afd95[_0x504789(0x1f4)],'commands':_0x4afd95};}function sha256(_0x19bd05){const _0x363b2c=a62_0x22ee08;return createHash(_0x363b2c(0x204))[_0x363b2c(0x1d6)](_0x19bd05)[_0x363b2c(0x1e1)](_0x363b2c(0x222));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x148eb6=a63_0xb155;(function(_0x16a8a6,_0x1141c8){const _0x1c6392=a63_0xb155,_0x5d2b57=_0x16a8a6();while(!![]){try{const _0xc48bc1=-parseInt(_0x1c6392(0x167))/0x1*(-parseInt(_0x1c6392(0x168))/0x2)+-parseInt(_0x1c6392(0x155))/0x3*(parseInt(_0x1c6392(0x15d))/0x4)+-parseInt(_0x1c6392(0x15e))/0x5*(parseInt(_0x1c6392(0x16a))/0x6)+-parseInt(_0x1c6392(0x162))/0x7+parseInt(_0x1c6392(0x14a))/0x8*(-parseInt(_0x1c6392(0x146))/0x9)+parseInt(_0x1c6392(0x148))/0xa*(parseInt(_0x1c6392(0x158))/0xb)+parseInt(_0x1c6392(0x15a))/0xc;if(_0xc48bc1===_0x1141c8)break;else _0x5d2b57['push'](_0x5d2b57['shift']());}catch(_0x20d82a){_0x5d2b57['push'](_0x5d2b57['shift']());}}}(a63_0x1f76,0x85a08));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';function a63_0xb155(_0x2679c0,_0x2b27ab){_0x2679c0=_0x2679c0-0x145;const _0x1f7613=a63_0x1f76();let _0xb15524=_0x1f7613[_0x2679c0];return _0xb15524;}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':a63_0x148eb6(0x153),'command':a63_0x148eb6(0x149),'description':a63_0x148eb6(0x160),'risk':a63_0x148eb6(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x3aadde){const _0x362803=a63_0x148eb6,_0x2fe4f6=buildSkillCreatePlan(_0x3aadde[_0x362803(0x166)]('name'),_0x3aadde[_0x362803(0x166)](_0x362803(0x14e)),_0x3aadde[_0x362803(0x166)]('target'));return{'method':_0x362803(0x156),'url':_0x2fe4f6[_0x362803(0x15c)],'body':{'skillName':_0x2fe4f6[_0x362803(0x163)][_0x362803(0x145)],'type':_0x2fe4f6[_0x362803(0x163)][_0x362803(0x14e)],'selfContained':!![],'files':_0x2fe4f6['rendered'][_0x362803(0x152)][_0x362803(0x151)](_0x40b279=>_0x40b279[_0x362803(0x15f)])},'description':_0x362803(0x159)};},async 'execute'(_0x6a283c){const _0x17d223=a63_0x148eb6,_0x4b9f18=buildSkillCreatePlan(_0x6a283c[_0x17d223(0x166)](_0x17d223(0x169)),_0x6a283c['str'](_0x17d223(0x14e)),_0x6a283c['str'](_0x17d223(0x157)));return writeSkillDraft(_0x4b9f18,_0x6a283c[_0x17d223(0x14c)](_0x17d223(0x165))),{'ok':!![],'data':{'skillName':_0x4b9f18['rendered'][_0x17d223(0x145)],'type':_0x4b9f18['rendered']['type'],'dir':_0x4b9f18[_0x17d223(0x15c)],'files':_0x4b9f18[_0x17d223(0x163)][_0x17d223(0x152)][_0x17d223(0x151)](_0x3cf471=>_0x3cf471['path'])},'message':_0x17d223(0x14f)+_0x4b9f18[_0x17d223(0x163)][_0x17d223(0x145)]};}};function a63_0x1f76(){const _0x39a734=['18pFhcGM','name','318nyeLkn','skillName','242775iWlgbq','isDirectory','450BtaoXE','create','16XZexTy','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','bool','utf8','type','Created\x20local\x20Skill\x20draft\x20','validation','map','files','skill','read','14925ohEVpF','WRITE','target','136950BalgcT','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','28063680vYIfws','isSymbolicLink','skillDir','764TyUWXi','65345gmAuvP','path','创建本地自包含的运行态\x20Skill\x20草稿','trim','7432733CnWcCX','rendered','content','force','str','45233TazZpL'];a63_0x1f76=function(){return _0x39a734;};return a63_0x1f76();}function buildSkillCreatePlan(_0x3f149c,_0x4c9bd4,_0x30ff46){const _0x52cc9=a63_0x148eb6,_0x48fc96=_0x4c9bd4[_0x52cc9(0x161)](),_0x50393e=renderSkillTemplate({'skillName':_0x3f149c,'type':_0x48fc96});!_0x48fc96&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x196b1f=resolve(normalizeSkillTarget(_0x30ff46));return{'rendered':_0x50393e,'targetRoot':_0x196b1f,'skillDir':resolve(_0x196b1f,_0x50393e['skillName'])};}function normalizeSkillTarget(_0x3c9aba){const _0x24e2db=a63_0x148eb6;return(_0x3c9aba||DEFAULT_SKILL_TARGET)[_0x24e2db(0x161)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x2405d0,_0x329412){const _0x2ebf27=a63_0x148eb6;if(existsSync(_0x2405d0[_0x2ebf27(0x15c)])){const _0xad1dd1=lstatSync(_0x2405d0[_0x2ebf27(0x15c)]);if(!_0xad1dd1[_0x2ebf27(0x147)]()||_0xad1dd1[_0x2ebf27(0x15b)]())throw CliErrors[_0x2ebf27(0x150)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x2405d0[_0x2ebf27(0x15c)]);if(!_0x329412)throw CliErrors[_0x2ebf27(0x150)]('Skill\x20directory\x20already\x20exists:\x20'+_0x2405d0[_0x2ebf27(0x15c)],_0x2ebf27(0x14b));}for(const _0x1c1fb8 of _0x2405d0[_0x2ebf27(0x163)][_0x2ebf27(0x152)]){const _0xfe07e6=resolve(_0x2405d0['skillDir'],_0x1c1fb8[_0x2ebf27(0x15f)]),_0x2aa487=dirname(_0xfe07e6);mkdirSync(_0x2aa487,{'recursive':!![]});if(existsSync(_0xfe07e6)&&lstatSync(_0xfe07e6)[_0x2ebf27(0x15b)]())throw CliErrors[_0x2ebf27(0x150)]('Refusing\x20to\x20overwrite\x20symlink:\x20'+_0xfe07e6);writeFileSync(_0xfe07e6,_0x1c1fb8[_0x2ebf27(0x164)],_0x2ebf27(0x14d));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x291e78=a64_0x500a;(function(_0x2c7876,_0x107a34){const _0x386724=a64_0x500a,_0x462cc9=_0x2c7876();while(!![]){try{const _0x294aa9=-parseInt(_0x386724(0xb9))/0x1+parseInt(_0x386724(0xa6))/0x2*(-parseInt(_0x386724(0xa3))/0x3)+-parseInt(_0x386724(0xa9))/0x4+parseInt(_0x386724(0xbd))/0x5*(-parseInt(_0x386724(0xb5))/0x6)+-parseInt(_0x386724(0xc9))/0x7+-parseInt(_0x386724(0xac))/0x8*(parseInt(_0x386724(0xc3))/0x9)+parseInt(_0x386724(0xbb))/0xa;if(_0x294aa9===_0x107a34)break;else _0x462cc9['push'](_0x462cc9['shift']());}catch(_0x44d107){_0x462cc9['push'](_0x462cc9['shift']());}}}(a64_0x4170,0x3a8f4));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';function a64_0x4170(){const _0x19a568=['trim','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','720330bvBwow','Created','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','str','100191CofGeq','source-fingerprint','11503120Xypawo','read','15YMayPV','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','scope','skill','version','personal','48843pAtpxk','validation','\x20is\x20unchanged.','unchanged','skill-code','write','917441OqnFSj','Found\x20Skill\x20diagram\x20for\x20','Skill\x20diagram\x20validation\x20passed\x20for\x20',';\x20first\x20write\x20expects\x20revision\x20','expected-diagram-revision','company','3SoUucV','isInteger','found','406194tFEzxh','test','skillCode','311788Wqnhrq','num','Skill\x20diagram\x20for\x20','56WZXPdi','appCode','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','action','expectedDiagramRevision','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.'];a64_0x4170=function(){return _0x19a568;};return a64_0x4170();}function a64_0x500a(_0x21c9eb,_0x1797f3){_0x21c9eb=_0x21c9eb-0x9e;const _0x41702b=a64_0x4170();let _0x500a95=_0x41702b[_0x21c9eb];return _0x500a95;}import{readRequiredSkillDiagram}from'../diagram.js';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 readDiagramTarget(_0x1460b2){const _0x2c3114=a64_0x500a,_0x3551cc=_0x1460b2['str'](_0x2c3114(0xc7))[_0x2c3114(0xb3)](),_0x5c1464=_0x1460b2[_0x2c3114(0xb8)](_0x2c3114(0xc1))['trim'](),_0x35717c=_0x1460b2[_0x2c3114(0xb8)](_0x2c3114(0xbf));if(!_0x3551cc||!_0x5c1464||_0x35717c!==_0x2c3114(0xc2)&&_0x35717c!==_0x2c3114(0xa2))throw CliErrors[_0x2c3114(0xc4)](_0x2c3114(0xb4));return{'skillCode':_0x3551cc,'version':_0x5c1464,'scope':_0x35717c};}async function readDiagramWriteInput(_0x4edd26){const _0xb63aea=a64_0x500a,_0x1dab8d=_0x4edd26[_0xb63aea(0xaa)](_0xb63aea(0xa1)),_0x45fa5b=_0x4edd26['str'](_0xb63aea(0xba))[_0xb63aea(0xb3)]();if(!Number[_0xb63aea(0xa4)](_0x1dab8d)||_0x1dab8d<0x0)throw CliErrors[_0xb63aea(0xc4)](_0xb63aea(0xb2));if(!/^sha256:[0-9a-f]{64}$/[_0xb63aea(0xa7)](_0x45fa5b))throw CliErrors[_0xb63aea(0xc4)](_0xb63aea(0xae));return{'expectedDiagramRevision':_0x1dab8d,'sourceFingerprint':_0x45fa5b,'diagram':await readRequiredSkillDiagram(_0x4edd26[_0xb63aea(0xb8)]('diagram-file'))};}export const diagramValidateCommand={'service':'skill','command':'diagram-validate','description':a64_0x291e78(0xb7),'risk':a64_0x291e78(0xbc),'flags':WRITE_FLAGS,async 'execute'(_0x59fda0){const _0x12dfa5=a64_0x291e78,_0x595139=readDiagramTarget(_0x59fda0),_0x4856d2=await validateRuntimeSkillVersionDiagram(_0x59fda0[_0x12dfa5(0xad)],_0x595139[_0x12dfa5(0xa8)],_0x595139['version'],_0x595139['scope'],await readDiagramWriteInput(_0x59fda0));return{'ok':!![],'data':_0x4856d2,'message':_0x12dfa5(0x9f)+_0x595139['skillCode']+'@'+_0x595139['version']+'.'};}};export const diagramPushCommand={'service':'skill','command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a64_0x291e78(0xc8),'confirmationDescription':a64_0x291e78(0xaf),'flags':WRITE_FLAGS,async 'execute'(_0x4c7755){const _0x26e7f6=a64_0x291e78,_0x582573=readDiagramTarget(_0x4c7755),_0x50db29=await putRuntimeSkillVersionDiagram(_0x4c7755['appCode'],_0x582573['skillCode'],_0x582573[_0x26e7f6(0xc1)],_0x582573[_0x26e7f6(0xbf)],await readDiagramWriteInput(_0x4c7755));return{'ok':!![],'data':_0x50db29,'message':_0x50db29[_0x26e7f6(0xb0)]===_0x26e7f6(0xc6)?_0x26e7f6(0xab)+_0x582573[_0x26e7f6(0xa8)]+'@'+_0x582573['version']+_0x26e7f6(0xc5):(_0x50db29['action']==='created'?_0x26e7f6(0xb6):'Updated')+'\x20Skill\x20diagram\x20for\x20'+_0x582573[_0x26e7f6(0xa8)]+'@'+_0x582573[_0x26e7f6(0xc1)]+'.'};}};export const diagramShowCommand={'service':a64_0x291e78(0xc0),'command':'diagram-show','description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a64_0x291e78(0xbc),'flags':TARGET_FLAGS,async 'execute'(_0x128b2e){const _0x22e991=a64_0x291e78,_0x51eb5d=readDiagramTarget(_0x128b2e),_0x1b853c=await getRuntimeSkillVersionDiagram(_0x128b2e['appCode'],_0x51eb5d[_0x22e991(0xa8)],_0x51eb5d[_0x22e991(0xc1)],_0x51eb5d[_0x22e991(0xbf)]);return{'ok':!![],'data':_0x1b853c,'message':_0x1b853c[_0x22e991(0xa5)]?_0x22e991(0x9e)+_0x51eb5d['skillCode']+'@'+_0x51eb5d[_0x22e991(0xc1)]+';\x20next\x20write\x20expects\x20revision\x20'+_0x1b853c[_0x22e991(0xb1)]+'.':_0x22e991(0xbe)+_0x51eb5d[_0x22e991(0xa8)]+'@'+_0x51eb5d[_0x22e991(0xc1)]+_0x22e991(0xa0)+_0x1b853c[_0x22e991(0xb1)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a65_0x4b684f=a65_0x5064;(function(_0x416b54,_0x2a576f){const _0x3cb2f2=a65_0x5064,_0x4a15e5=_0x416b54();while(!![]){try{const _0x4733a9=-parseInt(_0x3cb2f2(0x114))/0x1*(parseInt(_0x3cb2f2(0x10a))/0x2)+-parseInt(_0x3cb2f2(0xfd))/0x3*(parseInt(_0x3cb2f2(0x110))/0x4)+parseInt(_0x3cb2f2(0xf0))/0x5+-parseInt(_0x3cb2f2(0xe3))/0x6+parseInt(_0x3cb2f2(0xf3))/0x7*(-parseInt(_0x3cb2f2(0xf4))/0x8)+-parseInt(_0x3cb2f2(0xe9))/0x9+parseInt(_0x3cb2f2(0x10b))/0xa*(parseInt(_0x3cb2f2(0x10d))/0xb);if(_0x4733a9===_0x2a576f)break;else _0x4a15e5['push'](_0x4a15e5['shift']());}catch(_0x3f1c3e){_0x4a15e5['push'](_0x4a15e5['shift']());}}}(a65_0x2720,0x563de));import{CliErrors}from'../../../errors.js';function a65_0x5064(_0x4d3460,_0x569b39){_0x4d3460=_0x4d3460-0xe3;const _0x272061=a65_0x2720();let _0x50648f=_0x272061[_0x4d3460];return _0x50648f;}import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a65_0x4b684f(0xe6),'command':a65_0x4b684f(0xf1),'description':a65_0x4b684f(0xe8),'risk':a65_0x4b684f(0x107),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x71d002){return syncRuntimeSkills(_0x71d002);}};function a65_0x2720(){const _0x1efadc=['3ouHSXY','company','skillRoots','map','all','push','project','bool','skillCode','includes','read','created','personal','22tYvmgB','250JuPaGK','force','889570waAFkX','production','../../../skills/runtime-skill-sync.js','2015852fXTQhs','length','unchanged','skipped','35503BHuzoL','trim','3852000gzTrSF','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','Installed\x20','skill','str','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','2054943pzupBy','\x20personal\x20and\x20','envName','accessKey','global','action','removed','1405275OraPgg','install','flatMap','644QHxWhN','16064YcgcIm','appCode','code','authRequired','scope','reduce','version','filter','updated'];a65_0x2720=function(){return _0x1efadc;};return a65_0x2720();}async function syncRuntimeSkills(_0x53e4b5){const _0x337b33=a65_0x4b684f,{downloadRuntimeSkillPackage:_0x5e5bf1,listRuntimeSkills:_0x165d1f}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x2ba97e,materializeRuntimeSkill:_0x5558f3,pruneStaleRuntimeSkillCache:_0x1dbce0,pruneStaleRuntimeSkillLinks:_0x3976dc,resolveRuntimeSkillInstallTarget:_0x15e4be}=await import(_0x337b33(0x10f)),_0x44e823=_0x53e4b5['str'](_0x337b33(0xf6)),_0x114588=normalizeSyncScopes(_0x53e4b5[_0x337b33(0xe7)](_0x337b33(0xf8))),_0xcb1b77=_0x53e4b5[_0x337b33(0xeb)]??_0x337b33(0x10e),_0x355ff6=_0x53e4b5[_0x337b33(0xec)],_0x2e919b=_0x53e4b5['bool'](_0x337b33(0x10c));if(!_0x355ff6)throw CliErrors[_0x337b33(0xf7)](_0x337b33(0xe4));const _0x32cd8c=_0x15e4be(_0x53e4b5['appCode'],_0x53e4b5[_0x337b33(0x104)](_0x337b33(0x103))?_0x337b33(0x103):_0x337b33(0xed)),_0x579e65=_0x15e4be(_0x53e4b5[_0x337b33(0xf5)],_0x32cd8c[_0x337b33(0xf8)]==='project'?_0x337b33(0xed):_0x337b33(0x103)),_0x807dce=await Promise[_0x337b33(0x101)](_0x114588['map'](_0x1d2fd1=>_0x165d1f({'appCode':_0x53e4b5[_0x337b33(0xf5)],'scope':_0x1d2fd1,'code':_0x44e823[_0x337b33(0x115)]()||undefined}))),_0x12d033=_0x114588[_0x337b33(0x106)](_0x337b33(0x109))?_0x807dce[_0x337b33(0xf2)]((_0x3f6211,_0xd8d3e3)=>_0x114588[_0xd8d3e3]==='personal'?_0x3f6211[_0x337b33(0x109)]:[]):[],_0x4b3240=_0x114588[_0x337b33(0x106)](_0x337b33(0xfe))?_0x807dce[_0x337b33(0xf2)]((_0x10d008,_0x1431d6)=>_0x114588[_0x1431d6]===_0x337b33(0xfe)?_0x10d008['company']:[]):[],_0x3b60a5=new Set([..._0x12d033[_0x337b33(0x100)](_0x8adc79=>_0x8adc79[_0x337b33(0x105)]?.[_0x337b33(0x115)]())['filter'](_0xede89c=>Boolean(_0xede89c)),..._0x4b3240['map'](_0x1262f8=>_0x1262f8['skillCode']?.[_0x337b33(0x115)]())['filter'](_0x3edf94=>Boolean(_0x3edf94))]),_0x46a8a3=_0x44e823[_0x337b33(0x115)]()?[_0x44e823[_0x337b33(0x115)]()]:undefined,_0x7ff7bb=_0x114588[_0x337b33(0x111)]===0x2&&_0x114588[_0x337b33(0x106)](_0x337b33(0x109))&&_0x114588[_0x337b33(0x106)](_0x337b33(0xfe)),_0x4a60af=_0x7ff7bb?_0x3976dc(_0x32cd8c,_0x3b60a5,_0x46a8a3):[],_0x5252ae=_0x1dbce0({'env':_0xcb1b77,'accessKey':_0x355ff6,'appCode':_0x53e4b5[_0x337b33(0xf5)],'activeSkillCodes':_0x3b60a5,'pruneSkillCodes':_0x46a8a3,'scopes':_0x114588,'protectedLinkRoots':_0x579e65[_0x337b33(0xff)]}),_0x5b2468=[];for(const _0x149a22 of _0x12d033){_0x5b2468['push'](_0x5558f3(_0x149a22,'personal',{'env':_0xcb1b77,'accessKey':_0x355ff6,'appCode':_0x53e4b5[_0x337b33(0xf5)],'force':_0x2e919b,'packageBytes':await downloadSkillPackage(_0x149a22,_0x337b33(0x109),_0x53e4b5['appCode'],_0x5e5bf1)}));}for(const _0x2175ad of _0x4b3240){_0x5b2468[_0x337b33(0x102)](_0x5558f3(_0x2175ad,'company',{'env':_0xcb1b77,'accessKey':_0x355ff6,'appCode':_0x53e4b5[_0x337b33(0xf5)],'force':_0x2e919b,'packageBytes':await downloadSkillPackage(_0x2175ad,_0x337b33(0xfe),_0x53e4b5[_0x337b33(0xf5)],_0x5e5bf1)}));}const _0x2b2288=_0x2ba97e(_0x5b2468,_0x32cd8c),_0x2a6e98=countLinkActions(_0x2b2288);return{'ok':!![],'data':{'appCode':_0x53e4b5[_0x337b33(0xf5)],..._0x32cd8c[_0x337b33(0xf8)]===_0x337b33(0x103)?{'installTarget':{'scope':_0x32cd8c[_0x337b33(0xf8)],'skillRoots':[..._0x32cd8c[_0x337b33(0xff)]]}}:{},'personal':_0x12d033[_0x337b33(0x111)],'company':_0x4b3240['length'],'materialized':_0x5b2468['length'],'links':{'total':_0x2b2288['length'],'created':_0x2a6e98[_0x337b33(0x108)]??0x0,'updated':_0x2a6e98[_0x337b33(0xfc)]??0x0,'unchanged':_0x2a6e98[_0x337b33(0x112)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x4a60af[_0x337b33(0xfb)](_0x48b88c=>_0x48b88c[_0x337b33(0xee)]===_0x337b33(0xef))[_0x337b33(0x111)],'cacheDirs':_0x5252ae[_0x337b33(0xfb)](_0x4fc30c=>_0x4fc30c['action']==='removed')[_0x337b33(0x111)],'skipped':[..._0x4a60af,..._0x5252ae]['filter'](_0x58c4e2=>_0x58c4e2[_0x337b33(0xee)]===_0x337b33(0x113))['length']},'skills':{'personal':_0x12d033[_0x337b33(0x100)](summarizeRuntimeSkill),'company':_0x4b3240['map'](summarizeRuntimeSkill)}},'message':_0x337b33(0xe5)+_0x12d033[_0x337b33(0x111)]+_0x337b33(0xea)+_0x4b3240[_0x337b33(0x111)]+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x8b5c3c,_0x383db4,_0x2c7505,_0x130d7d){const _0x1cfaed=a65_0x4b684f,_0x2f8250=_0x8b5c3c[_0x1cfaed(0xfa)]?.['trim']();return _0x2f8250?_0x130d7d(_0x383db4,_0x8b5c3c[_0x1cfaed(0x105)],_0x2c7505,_0x2f8250):_0x130d7d(_0x383db4,_0x8b5c3c[_0x1cfaed(0x105)],_0x2c7505);}function countLinkActions(_0x3e8663){const _0x29449e=a65_0x4b684f;return _0x3e8663[_0x29449e(0xf9)]((_0xbe0c77,_0x1db49d)=>{const _0x1a076a=_0x29449e;return _0xbe0c77[_0x1db49d[_0x1a076a(0xee)]]=(_0xbe0c77[_0x1db49d[_0x1a076a(0xee)]]??0x0)+0x1,_0xbe0c77;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a66_0x2ddee2=a66_0x2230;(function(_0x1f6f48,_0x1f07d0){const _0x142afc=a66_0x2230,_0x596727=_0x1f6f48();while(!![]){try{const _0x2994cd=parseInt(_0x142afc(0x150))/0x1*(-parseInt(_0x142afc(0x152))/0x2)+-parseInt(_0x142afc(0x163))/0x3*(parseInt(_0x142afc(0x15d))/0x4)+parseInt(_0x142afc(0x149))/0x5*(parseInt(_0x142afc(0x14e))/0x6)+parseInt(_0x142afc(0x14b))/0x7+parseInt(_0x142afc(0x156))/0x8*(-parseInt(_0x142afc(0x162))/0x9)+-parseInt(_0x142afc(0x14c))/0xa*(parseInt(_0x142afc(0x154))/0xb)+-parseInt(_0x142afc(0x166))/0xc*(-parseInt(_0x142afc(0x15c))/0xd);if(_0x2994cd===_0x1f07d0)break;else _0x596727['push'](_0x596727['shift']());}catch(_0x5df34f){_0x596727['push'](_0x596727['shift']());}}}(a66_0x31a5,0x2d660));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';function a66_0x2230(_0xd4cc5b,_0x377b5f){_0xd4cc5b=_0xd4cc5b-0x145;const _0x31a549=a66_0x31a5();let _0x223032=_0x31a549[_0xd4cc5b];return _0x223032;}import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a66_0x2ddee2(0x15e),'command':a66_0x2ddee2(0x160),'description':a66_0x2ddee2(0x14d),'risk':a66_0x2ddee2(0x169),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2d9400){const _0x534055=a66_0x2ddee2,_0x68eb73=_0x2d9400[_0x534055(0x148)]('code'),_0xcd3d08=normalizeListScope(_0x2d9400[_0x534055(0x148)](_0x534055(0x16b)));if(_0x2d9400['bool']('local')){const _0x202209=_0x2d9400['accessKey'];if(!_0x202209)throw CliErrors[_0x534055(0x151)]();const {listLocalRuntimeSkills:_0x8619f4,resolveRuntimeSkillInstallTarget:_0x371181}=await import(_0x534055(0x159)),_0x624606=_0x371181(_0x2d9400[_0x534055(0x145)],_0x2d9400['bool']('project')?'project':_0x534055(0x15f)),_0x332e12=_0x8619f4({'env':_0x2d9400[_0x534055(0x155)]??_0x534055(0x167),'accessKey':_0x202209,'appCode':_0x2d9400[_0x534055(0x145)],'scopes':listScopeToRuntimeScopes(_0xcd3d08),'code':_0x68eb73['trim']()||undefined},_0x624606),_0x1f90f3=groupLocalRuntimeSkills(_0x332e12);return{'ok':!![],'data':{'appCode':_0x2d9400[_0x534055(0x145)],'source':_0x534055(0x14f),..._0x624606[_0x534055(0x16b)]===_0x534055(0x147)?{'installScope':_0x624606[_0x534055(0x16b)]}:{},'scope':_0xcd3d08,'total':_0x332e12[_0x534055(0x157)],'personal':_0x1f90f3[_0x534055(0x14a)][_0x534055(0x157)],'company':_0x1f90f3[_0x534055(0x164)]['length'],'items':_0x332e12[_0x534055(0x161)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x1f90f3[_0x534055(0x14a)][_0x534055(0x161)](summarizeLocalRuntimeSkill),'company':_0x1f90f3[_0x534055(0x164)][_0x534055(0x161)](summarizeLocalRuntimeSkill)}},'message':_0x534055(0x15b)+_0x332e12['length']+_0x534055(0x158)};}const {listRuntimeSkills:_0x4c4f8d}=await import(_0x534055(0x165)),_0xb5e96=await _0x4c4f8d({'appCode':_0x2d9400[_0x534055(0x145)],'scope':listScopeToRemoteScope(_0xcd3d08),'code':_0x68eb73[_0x534055(0x153)]()||undefined}),_0xb8f202=shouldListScope(_0xcd3d08,_0x534055(0x14a))?_0xb5e96[_0x534055(0x14a)]??[]:[],_0x41a8e0=shouldListScope(_0xcd3d08,_0x534055(0x164))?_0xb5e96[_0x534055(0x164)]??[]:[],_0x207f97=[..._0xb8f202,..._0x41a8e0];return{'ok':!![],'data':{'appCode':_0x2d9400[_0x534055(0x145)],'source':_0x534055(0x15a),'scope':_0xcd3d08,'total':_0x207f97['length'],'personal':_0xb8f202[_0x534055(0x157)],'company':_0x41a8e0[_0x534055(0x157)],'items':_0x207f97[_0x534055(0x161)](summarizeRuntimeSkill),'skills':{'personal':_0xb8f202[_0x534055(0x161)](summarizeRuntimeSkill),'company':_0x41a8e0['map'](summarizeRuntimeSkill)}},'message':_0x534055(0x15b)+_0x207f97[_0x534055(0x157)]+_0x534055(0x146)};}};function a66_0x31a5(){const _0x119569=['3565573Ojgusm','envName','288136xNgrSZ','length','\x20local\x20Skill(s).','../../../skills/runtime-skill-sync.js','remote','Listed\x20','65143GEeqVD','24DsLyiz','skill','global','list','map','27eUPYkJ','115713prrfrQ','company','../../../core/api-client.js','2280swDMDA','production','builtin','read','filter','scope','appCode','\x20remote\x20Skill(s).','project','str','5JcxHGW','personal','41713ksTIPx','10aMAjIZ','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','1566318sKkZIl','local','184765PgGfYb','authRequired','4fFvnND','trim'];a66_0x31a5=function(){return _0x119569;};return a66_0x31a5();}function groupLocalRuntimeSkills(_0x4f104f){const _0x470894=a66_0x2ddee2;return{'personal':_0x4f104f['filter'](_0x5af675=>_0x5af675[_0x470894(0x16b)]===_0x470894(0x14a)),'company':_0x4f104f[_0x470894(0x16a)](_0x18c2dd=>_0x18c2dd[_0x470894(0x16b)]===_0x470894(0x164)),'builtin':_0x4f104f[_0x470894(0x16a)](_0x11811f=>_0x11811f[_0x470894(0x16b)]===_0x470894(0x168))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a67_0x210b(_0x14ed36,_0x2a735c){_0x14ed36=_0x14ed36-0x66;const _0x44580a=a67_0x4458();let _0x210b57=_0x44580a[_0x14ed36];return _0x210b57;}const a67_0x5f1e97=a67_0x210b;(function(_0xb84e61,_0x28a15f){const _0x2b3e29=a67_0x210b,_0x4f57a4=_0xb84e61();while(!![]){try{const _0x5e9fa2=parseInt(_0x2b3e29(0x66))/0x1+parseInt(_0x2b3e29(0x70))/0x2*(-parseInt(_0x2b3e29(0x73))/0x3)+-parseInt(_0x2b3e29(0x6b))/0x4+parseInt(_0x2b3e29(0x6c))/0x5*(parseInt(_0x2b3e29(0x69))/0x6)+parseInt(_0x2b3e29(0x67))/0x7*(parseInt(_0x2b3e29(0x72))/0x8)+parseInt(_0x2b3e29(0x71))/0x9+parseInt(_0x2b3e29(0x6e))/0xa*(-parseInt(_0x2b3e29(0x6a))/0xb);if(_0x5e9fa2===_0x28a15f)break;else _0x4f57a4['push'](_0x4f57a4['shift']());}catch(_0x27a6b4){_0x4f57a4['push'](_0x4f57a4['shift']());}}}(a67_0x4458,0xd462c));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a67_0x4458(){const _0x52e41f=['47924hUQEYV','14406192VKfzlk','2660200xWQpcW','63AsHkUe','1091508AASXdI','35SpulfN','skill','3750jmTZJm','44YmrEOi','2455600hRstkz','11645MBssxq','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','9558530feEyfA','write'];a67_0x4458=function(){return _0x52e41f;};return a67_0x4458();}export const pushCommand={'service':a67_0x5f1e97(0x68),'command':'push','description':'将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','risk':a67_0x5f1e97(0x6f),'confirmationDescription':a67_0x5f1e97(0x6d),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x1960ed=a68_0x1cb6;function a68_0x1cb6(_0x397d03,_0x4655b0){_0x397d03=_0x397d03-0xc9;const _0x12f753=a68_0x12f7();let _0x1cb62c=_0x12f753[_0x397d03];return _0x1cb62c;}(function(_0x51ad4b,_0x532e35){const _0x12c3cf=a68_0x1cb6,_0x106f89=_0x51ad4b();while(!![]){try{const _0x3af8b0=parseInt(_0x12c3cf(0xcc))/0x1*(-parseInt(_0x12c3cf(0xd2))/0x2)+-parseInt(_0x12c3cf(0xd6))/0x3+parseInt(_0x12c3cf(0xd4))/0x4+-parseInt(_0x12c3cf(0xce))/0x5*(parseInt(_0x12c3cf(0xcd))/0x6)+-parseInt(_0x12c3cf(0xd7))/0x7+parseInt(_0x12c3cf(0xd5))/0x8*(-parseInt(_0x12c3cf(0xd9))/0x9)+parseInt(_0x12c3cf(0xcb))/0xa;if(_0x3af8b0===_0x532e35)break;else _0x106f89['push'](_0x106f89['shift']());}catch(_0x50c9e2){_0x106f89['push'](_0x106f89['shift']());}}}(a68_0x12f7,0xe57d0));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a68_0x12f7(){const _0x5aa7a3=['dir','4118788EEmvRi','1484464rpwfYt','356688JfgibX','9331119ulFiYX','skill','36zEReIx','warnings','errors','51134810quuwqo','7441UmIjKg','6IvhiYd','7343810ADibdz','type','str','validate','414nNfhGm'];a68_0x12f7=function(){return _0x5aa7a3;};return a68_0x12f7();}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a68_0x1960ed(0xd8),'command':a68_0x1960ed(0xd1),'description':'Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x343233){const _0x4608c0=a68_0x1960ed,_0x51a0e8=_0x343233['bool']('strict'),_0x26a9c7=validateSkillDirectory(_0x343233[_0x4608c0(0xd0)]('dir'),{'strict':_0x51a0e8});return throwIfSkillValidationFailed(_0x26a9c7,_0x51a0e8),{'ok':!![],'data':{'dir':_0x26a9c7[_0x4608c0(0xd3)],'type':_0x26a9c7[_0x4608c0(0xcf)],'errors':_0x26a9c7[_0x4608c0(0xca)],'warnings':_0x26a9c7[_0x4608c0(0xc9)]},'message':'Skill\x20validation\x20passed.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x529f52,_0x2a9227){const _0xde907f=a69_0x5f2d,_0x3c16c3=_0x529f52();while(!![]){try{const _0xa58625=-parseInt(_0xde907f(0x12e))/0x1*(parseInt(_0xde907f(0x130))/0x2)+parseInt(_0xde907f(0x134))/0x3+parseInt(_0xde907f(0x13b))/0x4+-parseInt(_0xde907f(0x13d))/0x5+-parseInt(_0xde907f(0x135))/0x6+-parseInt(_0xde907f(0x131))/0x7*(parseInt(_0xde907f(0x13a))/0x8)+parseInt(_0xde907f(0x140))/0x9;if(_0xa58625===_0x2a9227)break;else _0x3c16c3['push'](_0x3c16c3['shift']());}catch(_0x464a24){_0x3c16c3['push'](_0x3c16c3['shift']());}}}(a69_0x4d47,0x2a761));function a69_0x5f2d(_0x12031f,_0x28b95f){_0x12031f=_0x12031f-0x12c;const _0x4d4775=a69_0x4d47();let _0x5f2d67=_0x4d4775[_0x12031f];return _0x5f2d67;}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x5518e1){const _0x18e241=a69_0x5f2d;return(await readRequiredSkillDiagramInput(_0x5518e1))[_0x18e241(0x133)];}export async function readRequiredSkillDiagramInput(_0x39364a){const _0x25e2b9=a69_0x5f2d,_0xcc0884=_0x39364a['trim']();if(!_0xcc0884)throw CliErrors[_0x25e2b9(0x139)](_0x25e2b9(0x138),'Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.');let _0x158fde,_0x31f941;if(_0xcc0884==='-')try{_0x158fde=readFileSync(0x0,_0x25e2b9(0x13e));}catch{throw CliErrors[_0x25e2b9(0x139)](_0x25e2b9(0x12d));}else{const _0x5b14be=resolve(_0xcc0884);if(!existsSync(_0x5b14be))throw CliErrors['validation'](_0x25e2b9(0x141)+_0x5b14be);if(!statSync(_0x5b14be)[_0x25e2b9(0x12f)]())throw CliErrors[_0x25e2b9(0x139)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x5b14be);_0x31f941=realpathSync(_0x5b14be),_0x158fde=readFileSync(_0x31f941,_0x25e2b9(0x13e));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x158fde)},'sourceFilePath':_0x31f941};}export async function validateAndCanonicalizeMermaid(_0x6568d4){const _0x5bf64a=a69_0x5f2d,_0x2bb1bc=_0x6568d4[_0x5bf64a(0x132)](/\r\n/g,'\x0a')['replace'](/\r/g,'\x0a')['replace'](/\n+$/,'')+'\x0a';try{const _0x5323d9=await loadMermaidApi();await _0x5323d9['parse'](_0x2bb1bc);}catch{throw diagramValidationError();}return _0x2bb1bc;}function a69_0x4d47(){const _0x46d69b=['--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','validation','13944yJIQYL','634660EPVHkD','mermaid','1057925CihEaQ','utf8','defineProperties','3092616zZIIxM','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','document','window','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','5VDrOza','isFile','35186MlEFuW','70KExylj','replace','diagram','762579DJlWVn','1593486fwOfmu','Mermaid\x20syntax\x20validation\x20failed.','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.'];a69_0x4d47=function(){return _0x46d69b;};return a69_0x4d47();}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x15621e=a69_0x5f2d;if(!(_0x15621e(0x12c)in globalThis)||!(_0x15621e(0x142)in globalThis)){const _0x29991e=new JSDOM('');Object[_0x15621e(0x13f)](globalThis,{'window':{'configurable':!![],'value':_0x29991e['window']},'document':{'configurable':!![],'value':_0x29991e[_0x15621e(0x12c)][_0x15621e(0x142)]}});}return(await import(_0x15621e(0x13c)))['default'];})()),mermaidApiPromise;}function diagramValidationError(){const _0x51e9db=a69_0x5f2d;return CliErrors[_0x51e9db(0x139)](_0x51e9db(0x136),_0x51e9db(0x137));}
|