@lovrabet/lovrabet-cli 2.1.8-beta.3 → 2.1.8
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/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/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.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1a1b71=a30_0x2712;(function(_0x27d54d,_0x10abd6){const _0x2b9f71=a30_0x2712,_0x13bc13=_0x27d54d();while(!![]){try{const _0xd6e657=-parseInt(_0x2b9f71(0x88))/0x1*(-parseInt(_0x2b9f71(0x80))/0x2)+-parseInt(_0x2b9f71(0x90))/0x3*(parseInt(_0x2b9f71(0x85))/0x4)+-parseInt(_0x2b9f71(0x96))/0x5*(parseInt(_0x2b9f71(0x8e))/0x6)+parseInt(_0x2b9f71(0x78))/0x7+-parseInt(_0x2b9f71(0x8f))/0x8+-parseInt(_0x2b9f71(0x86))/0x9+parseInt(_0x2b9f71(0x77))/0xa*(parseInt(_0x2b9f71(0x8a))/0xb);if(_0xd6e657===_0x10abd6)break;else _0x13bc13['push'](_0x13bc13['shift']());}catch(_0x55f878){_0x13bc13['push'](_0x13bc13['shift']());}}}(a30_0x327d,0x6ef81));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x1a1b71(0x82),'type':'string','required':!![],'description':a30_0x1a1b71(0x7d)},FILEPATH_FLAG={'name':a30_0x1a1b71(0x92),'type':a30_0x1a1b71(0x7f),'required':!![],'description':a30_0x1a1b71(0x81)},DOWNLOAD_FLAG={'name':'download','type':a30_0x1a1b71(0x76),'description':a30_0x1a1b71(0x8b)};function requireFilePath(_0xe66ec7){const _0xc13f54=a30_0x1a1b71,_0x59fe54=_0xe66ec7[_0xc13f54(0x93)]();if(!_0x59fe54)throw CliErrors[_0xc13f54(0x84)](_0xc13f54(0x87));return _0x59fe54;}function a30_0x2712(_0x14efd7,_0x2f5c13){_0x14efd7=_0x14efd7-0x74;const _0x327d14=a30_0x327d();let _0x27123f=_0x327d14[_0x14efd7];return _0x27123f;}const fileUpload={'service':a30_0x1a1b71(0x82),'command':a30_0x1a1b71(0x83),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x1a1b71(0x74),'flags':[FILE_FLAG],async 'dryRun'(_0x31480d){const _0x573d5a=a30_0x1a1b71,_0xac6e=requireRuntimeUploadFile(_0x31480d['str'](_0x573d5a(0x82)),_0x573d5a(0x89));return dryRun(_0x573d5a(0x94),_0x573d5a(0x79))['body']({'appCode':_0x31480d['appCode'],'multipart':{'file':_0xac6e}})[_0x573d5a(0x8c)]('Preview:\x20upload\x20'+_0xac6e[_0x573d5a(0x91)]+_0x573d5a(0x98)+_0x31480d['appCode'])['build']();},async 'execute'(_0x1ebd9c){const _0x6a98df=a30_0x1a1b71,_0x11e622=requireRuntimeUploadFile(_0x1ebd9c[_0x6a98df(0x95)](_0x6a98df(0x82)),'File'),_0x11ec90=await uploadRuntimeFile(_0x1ebd9c[_0x6a98df(0x75)],_0x11e622[_0x6a98df(0x91)]);return{'ok':!![],'data':_0x11ec90,'message':_0x11ec90[_0x6a98df(0x97)]?_0x6a98df(0x7b)+_0x11ec90['filePath']:'Uploaded\x20file.'};}},fileQueryUrl={'service':a30_0x1a1b71(0x82),'command':a30_0x1a1b71(0x7e),'description':a30_0x1a1b71(0x7c),'risk':a30_0x1a1b71(0x7a),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x4227de){const _0x1196b1=a30_0x1a1b71,_0x3cc23b=requireFilePath(_0x4227de[_0x1196b1(0x95)](_0x1196b1(0x92))),_0x5a5748=await queryRuntimeFileUrl(_0x3cc23b,{'download':_0x4227de[_0x1196b1(0x8d)]('download')});return{'ok':!![],'data':_0x5a5748};}};function a30_0x327d(){const _0x4223b8=['query-url','string','14ajtsMT','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','file','upload','validation','12OfnQvJ','739053YKFMzp','filePath\x20is\x20required.','43285MtORkA','File','34045ktCcZi','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','description','bool','6hpqzjA','5594640zmLnGC','760278FdNmXA','path','filepath','trim','POST','str','457220WxNIez','filePath','\x20to\x20runtime\x20app\x20','write','appCode','boolean','4290NPiMPZ','3198636KjLuVb','/client/uploadFile','read','Uploaded\x20file:\x20','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','Path\x20to\x20the\x20local\x20file\x20to\x20upload'];a30_0x327d=function(){return _0x4223b8;};return a30_0x327d();}export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x1cff7d=a31_0x42ac;(function(_0x1df5f8,_0x525912){const _0x1af7d4=a31_0x42ac,_0x30fc86=_0x1df5f8();while(!![]){try{const _0x2736eb=-parseInt(_0x1af7d4(0x8a))/0x1*(-parseInt(_0x1af7d4(0xab))/0x2)+-parseInt(_0x1af7d4(0x91))/0x3*(parseInt(_0x1af7d4(0xa2))/0x4)+-parseInt(_0x1af7d4(0x83))/0x5*(-parseInt(_0x1af7d4(0x99))/0x6)+-parseInt(_0x1af7d4(0xb7))/0x7*(parseInt(_0x1af7d4(0xc4))/0x8)+-parseInt(_0x1af7d4(0xbe))/0x9+parseInt(_0x1af7d4(0x90))/0xa+parseInt(_0x1af7d4(0xb4))/0xb*(parseInt(_0x1af7d4(0x8c))/0xc);if(_0x2736eb===_0x525912)break;else _0x30fc86['push'](_0x30fc86['shift']());}catch(_0x4d478c){_0x30fc86['push'](_0x30fc86['shift']());}}}(a31_0x4080,0xd7390));import{existsSync,readFileSync}from'node:fs';function a31_0x4080(){const _0x48f01a=['\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','77668qJYCXG','Target\x20environment\x20(default\x20','Failed\x20to\x20parse\x20source\x20file:\x20','Usage:\x20','app','boolean','File\x20','\x20already\x20exists.\x20Overwrite?','once','44UcavfB','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','utf8','602679zkZLlT','newConfigFileName','string','cwd','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','global','name','7252731XBeIQZ','\x22.\x20Allowed:\x20','\x0aInitialized\x20','\x20\x20env:\x20\x20\x20\x20\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','trim','104qXjlhi','Override\x20imported\x20default\x20env','message','App\x20code\x20cannot\x20be\x20empty.','log',')\x20instead\x20of\x20project','project','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','Override\x20imported\x20default\x20appcode','Initialized\x20','appcode','\x20init\x20—\x20Create\x20','2871865EYoLRi','[y/N]','AbortPrompt','Imported\x20from\x20','removeListener','User\x20aborted\x20prompt','file','17LivGPU','apps','653316FKaXGD','Write\x20to\x20global\x20(~/','validation','question','16140620PRmRtG','3WAWbjn','App\x20code','\x20\x20config:\x20\x20','stdout','riskLevel','\x20\x20default:\x20','App\x20code\x20for\x20the\x20project','object','6ZLMVTq','yes','SIGINT','\x20\x20appcode:\x20','defaultApp','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','apiDir','[Y/n]','Skip\x20confirmation\x20when\x20overwriting','1038852mRtfBB','):\x20','race','join','close','toLowerCase','env','stdin'];a31_0x4080=function(){return _0x48f01a;};return a31_0x4080();}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':'string','description':a31_0x1cff7d(0x97)},{'name':a31_0x1cff7d(0xa8),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0xac)+DEFAULT_CONFIG_VALUES[a31_0x1cff7d(0xa8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+a31_0x1cff7d(0xc9),'default':![]},{'name':a31_0x1cff7d(0x9a),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x1cff7d(0x89),'type':'string','description':a31_0x1cff7d(0x9e),'required':!![]},{'name':a31_0x1cff7d(0x81),'type':a31_0x1cff7d(0xb9),'description':a31_0x1cff7d(0x7f)},{'name':'env','type':'string','description':a31_0x1cff7d(0xc5),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1cff7d(0xbc),'type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0x8d)+PRODUCT_CONFIG[a31_0x1cff7d(0xb8)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x1cff7d(0xb0),'description':a31_0x1cff7d(0xa1),'default':![]}];export async function runInit(_0x2df9d2){const _0x972ecb=a31_0x1cff7d,_0x3c8b44=isNonInteractiveMode(_0x2df9d2),_0x13284c=_0x2df9d2[_0x972ecb(0xbc)]?'global':_0x972ecb(0x7d),_0x2bc30d=resolveWriteConfigPath(_0x13284c);try{_0x3c8b44?await runNonInteractive(_0x2df9d2,_0x2bc30d):await runInteractive(_0x2df9d2,_0x2bc30d);}catch(_0x5f0ff4){if(_0x5f0ff4 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x5f0ff4;}}export async function runInitImport(_0x886ce){const _0x8ca5ab=a31_0x1cff7d,_0x3f3c71=_0x886ce['global']?_0x8ca5ab(0xbc):_0x8ca5ab(0x7d),_0x261278=resolveWriteConfigPath(_0x3f3c71);await runFromImport(_0x886ce,_0x261278);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1cff7d(0x9f)]);async function runFromImport(_0x24e1a4,_0x29d885){const _0x5d111f=a31_0x1cff7d,_0x20cdfa=resolveFilePath(_0x24e1a4[_0x5d111f(0x89)]);if(!existsSync(_0x20cdfa))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x20cdfa);const _0x1af61b=readSourceFile(_0x20cdfa),_0xcebad4=convertToRuntimeConfig(_0x1af61b);_0x24e1a4[_0x5d111f(0x81)]&&(_0xcebad4[_0x5d111f(0x81)]=String(_0x24e1a4[_0x5d111f(0x81)]));_0x24e1a4[_0x5d111f(0xa8)]&&(_0xcebad4[_0x5d111f(0xa8)]=resolveInitEnv(_0x24e1a4));if(!_0xcebad4[_0x5d111f(0x81)])throw CliErrors[_0x5d111f(0x8e)](_0x5d111f(0xc2),_0x5d111f(0x7e));await writeInitConfig(_0x29d885,_0xcebad4,_0x24e1a4),console[_0x5d111f(0xc8)](_0x5d111f(0x86)+_0x20cdfa),console[_0x5d111f(0xc8)](_0x5d111f(0x93)+_0x29d885),console['log']('\x20\x20appcode:\x20'+_0xcebad4[_0x5d111f(0x81)]);if(_0xcebad4[_0x5d111f(0x9d)])console['log'](_0x5d111f(0x96)+_0xcebad4[_0x5d111f(0x9d)]);}function convertToRuntimeConfig(_0x5ebeee){const _0x550c95=a31_0x1cff7d;if(_0x5ebeee[_0x550c95(0x8b)]&&typeof _0x5ebeee['apps']===_0x550c95(0x98))throw CliErrors['validation'](_0x550c95(0xbb),_0x550c95(0xb5));const _0x1de773={};for(const _0x38bd01 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5ebeee[_0x38bd01]!==undefined&&(_0x1de773[_0x38bd01]=_0x5ebeee[_0x38bd01]);}return!_0x1de773[_0x550c95(0x95)]&&(_0x1de773['riskLevel']=DEFAULT_CONFIG_VALUES[_0x550c95(0x95)]),_0x1de773;}async function runNonInteractive(_0x828c2e,_0x3a8390){const _0x35455f=a31_0x1cff7d,_0x2d8c2f=_0x828c2e[_0x35455f(0x81)];if(!_0x2d8c2f)throw CliErrors['flagMissing'](_0x35455f(0x81),_0x35455f(0xae)+CLI_BIN_NAME+_0x35455f(0xaa));const _0x42c3bb=resolveInitEnv(_0x828c2e);await writeInitConfig(_0x3a8390,{'appcode':_0x2d8c2f,'env':_0x42c3bb},_0x828c2e),console[_0x35455f(0xc8)](_0x35455f(0x80)+_0x3a8390),console['log'](_0x35455f(0x9c)+_0x2d8c2f),console[_0x35455f(0xc8)](_0x35455f(0xc1)+_0x42c3bb);}async function runInteractive(_0x2592d1,_0x34cd62){const _0x5ae2a4=a31_0x1cff7d,_0x587e45=loadExisting(_0x34cd62),_0x288e36=typeof _0x587e45?.[_0x5ae2a4(0x81)]==='string'?_0x587e45[_0x5ae2a4(0x81)]:'',_0x4e15de=resolveInitEnv(_0x2592d1);console['log'](CLI_BIN_NAME+_0x5ae2a4(0x82)+PRODUCT_CONFIG[_0x5ae2a4(0xb8)]+'\x0a');if(existsSync(_0x34cd62)&&!_0x2592d1[_0x5ae2a4(0x9a)]){const _0x3a5dd2=await promptYesNo(_0x5ae2a4(0xb1)+_0x34cd62+_0x5ae2a4(0xb2),![]);if(!_0x3a5dd2){console[_0x5ae2a4(0xc8)]('Aborted.');return;}}const _0x2e8b97=typeof _0x2592d1[_0x5ae2a4(0x81)]==='string'?_0x2592d1[_0x5ae2a4(0x81)][_0x5ae2a4(0xc3)]():'';let _0x12519e=_0x2e8b97;!_0x12519e&&(_0x12519e=await promptInput(_0x5ae2a4(0x92),_0x288e36));if(!_0x12519e[_0x5ae2a4(0xc3)]())throw CliErrors[_0x5ae2a4(0x8e)](_0x5ae2a4(0xc7));await writeInitConfig(_0x34cd62,{'appcode':_0x12519e['trim'](),'env':_0x4e15de},_0x2592d1),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc0)+_0x34cd62),console[_0x5ae2a4(0xc8)]('\x20\x20appcode:\x20'+_0x12519e[_0x5ae2a4(0xc3)]()),console[_0x5ae2a4(0xc8)](_0x5ae2a4(0xc1)+_0x4e15de);}async function writeInitConfig(_0x28b93b,_0x3115ca,_0x325f5f){const _0x73c48c=a31_0x1cff7d;let _0x3d1b7a={};existsSync(_0x28b93b)&&!_0x325f5f[_0x73c48c(0x9a)]&&(_0x3d1b7a=readConfigFile(_0x28b93b));for(const [_0x562664,_0x4f7c1b]of Object['entries'](_0x3115ca)){_0x4f7c1b!==undefined&&(_0x3d1b7a[_0x562664]=_0x4f7c1b);}if(_0x3d1b7a[_0x73c48c(0xaf)])delete _0x3d1b7a['app'];writeConfigFile(_0x28b93b,_0x3d1b7a);}class AbortPrompt extends Error{constructor(){const _0x2fdafa=a31_0x1cff7d;super(_0x2fdafa(0x88)),this[_0x2fdafa(0xbd)]=_0x2fdafa(0x85);}}function createSafeRl(){const _0x55843f=a31_0x1cff7d,_0x569bcd=createInterface({'input':process[_0x55843f(0xa9)],'output':process[_0x55843f(0x94)]});let _0x352e15;const _0x5fc081=new Promise((_0x427627,_0x1518ae)=>{const _0xe2f3ac=_0x55843f;_0x352e15=()=>{const _0x9e1144=a31_0x42ac;_0x352e15&&(_0x569bcd[_0x9e1144(0x87)](_0x9e1144(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd['close']();}catch{}_0x1518ae(new AbortPrompt());},_0x569bcd[_0xe2f3ac(0xb3)]('SIGINT',_0x352e15);}),_0x21218e=()=>{const _0x52c492=_0x55843f;_0x352e15&&(_0x569bcd['removeListener'](_0x52c492(0x9b),_0x352e15),_0x352e15=undefined);try{_0x569bcd[_0x52c492(0xa6)]();}catch{}};return{'rl':_0x569bcd,'abortPromise':_0x5fc081,'disposeSuccess':_0x21218e};}async function promptInput(_0x4f3cab,_0x1eb537){const _0x2a9c0b=a31_0x1cff7d,{rl:_0x1162ad,abortPromise:_0x4159d2,disposeSuccess:_0x417522}=createSafeRl(),_0x466237=new Promise(_0x2b38db=>{const _0x16143f=a31_0x42ac,_0x75bf6a=_0x1eb537?'\x20\x20'+_0x4f3cab+'\x20('+_0x1eb537+_0x16143f(0xa3):'\x20\x20'+_0x4f3cab+':\x20';_0x1162ad['question'](_0x75bf6a,_0x4fc205=>{const _0x26a0c5=_0x16143f;_0x417522(),_0x2b38db(_0x4fc205[_0x26a0c5(0xc3)]()||_0x1eb537);});});return Promise[_0x2a9c0b(0xa4)]([_0x466237,_0x4159d2]);}async function promptYesNo(_0x5d4068,_0x34503e){const _0x5d1f35=a31_0x1cff7d,{rl:_0x32be7d,abortPromise:_0x581e4b,disposeSuccess:_0x36e7d4}=createSafeRl(),_0x4b0da8=new Promise(_0x151652=>{const _0x46f80f=a31_0x42ac,_0x55fdce=_0x34503e?_0x46f80f(0xa0):_0x46f80f(0x84);_0x32be7d[_0x46f80f(0x8f)]('\x20\x20'+_0x5d4068+'\x20'+_0x55fdce+':\x20',_0x3c4a8d=>{const _0x5b3ca1=_0x46f80f;_0x36e7d4();const _0x8e0752=_0x3c4a8d[_0x5b3ca1(0xc3)]()[_0x5b3ca1(0xa7)]();if(_0x8e0752==='y'||_0x8e0752==='yes')_0x151652(!![]);else{if(_0x8e0752==='n'||_0x8e0752==='no')_0x151652(![]);else _0x151652(_0x34503e);}});});return Promise[_0x5d1f35(0xa4)]([_0x4b0da8,_0x581e4b]);}function a31_0x42ac(_0x2b2814,_0x3e5373){_0x2b2814=_0x2b2814-0x7d;const _0x4080e1=a31_0x4080();let _0x42accf=_0x4080e1[_0x2b2814];return _0x42accf;}function loadExisting(_0x31337d){if(!existsSync(_0x31337d))return null;return readConfigFile(_0x31337d);}function resolveFilePath(_0x95c088){const _0x4b1715=a31_0x1cff7d;return isAbsolute(_0x95c088)?_0x95c088:resolve(process[_0x4b1715(0xba)](),_0x95c088);}function readSourceFile(_0x3d3246){const _0x148d3b=a31_0x1cff7d;try{const _0x1d6e8e=readFileSync(_0x3d3246,{'encoding':_0x148d3b(0xb6)});return JSON['parse'](_0x1d6e8e);}catch(_0x19db0f){throw CliErrors[_0x148d3b(0x8e)](_0x148d3b(0xad)+_0x19db0f[_0x148d3b(0xc6)]);}}function resolveInitEnv(_0x312295){const _0x4be3ce=a31_0x1cff7d,_0x1ad3ec=_0x312295[_0x4be3ce(0xa8)];if(_0x1ad3ec===undefined||_0x1ad3ec==='')return DEFAULT_CONFIG_VALUES[_0x4be3ce(0xa8)];if(!RUNTIME_ENV_VALUES['includes'](_0x1ad3ec))throw CliErrors[_0x4be3ce(0x8e)]('Invalid\x20env\x20\x22'+_0x1ad3ec+_0x4be3ce(0xbf)+RUNTIME_ENV_VALUES[_0x4be3ce(0xa5)](',\x20'));return _0x1ad3ec;}
|
|
1
|
+
const a31_0x4c8aaa=a31_0x5ad5;(function(_0xd29538,_0x506ce8){const _0x5f0871=a31_0x5ad5,_0x362dde=_0xd29538();while(!![]){try{const _0x3e43db=-parseInt(_0x5f0871(0x1e1))/0x1*(parseInt(_0x5f0871(0x1d8))/0x2)+parseInt(_0x5f0871(0x1fb))/0x3*(parseInt(_0x5f0871(0x1c6))/0x4)+-parseInt(_0x5f0871(0x1d1))/0x5+-parseInt(_0x5f0871(0x1b7))/0x6+parseInt(_0x5f0871(0x1e4))/0x7+-parseInt(_0x5f0871(0x1f1))/0x8*(parseInt(_0x5f0871(0x1fd))/0x9)+-parseInt(_0x5f0871(0x1d7))/0xa*(-parseInt(_0x5f0871(0x1f7))/0xb);if(_0x3e43db===_0x506ce8)break;else _0x362dde['push'](_0x362dde['shift']());}catch(_0x3e5971){_0x362dde['push'](_0x362dde['shift']());}}}(a31_0x52f6,0x9bddf));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a31_0x5ad5(_0x278056,_0x10c027){_0x278056=_0x278056-0x1b6;const _0x52f697=a31_0x52f6();let _0x5ad5f9=_0x52f697[_0x278056];return _0x5ad5f9;}import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4c8aaa(0x1e6),'type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x4c8aaa(0x1c8),'type':'string','description':a31_0x4c8aaa(0x1f5)+DEFAULT_CONFIG_VALUES[a31_0x4c8aaa(0x1c8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4c8aaa(0x1f0),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e3)+PRODUCT_CONFIG[a31_0x4c8aaa(0x1dc)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':'boolean','description':a31_0x4c8aaa(0x1e5),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x4c8aaa(0x1f2),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4c8aaa(0x1e6),'type':a31_0x4c8aaa(0x1f2),'description':a31_0x4c8aaa(0x1da)},{'name':a31_0x4c8aaa(0x1c8),'type':a31_0x4c8aaa(0x1f2),'description':a31_0x4c8aaa(0x1c2),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4c8aaa(0x1f0),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e3)+PRODUCT_CONFIG[a31_0x4c8aaa(0x1dc)]+a31_0x4c8aaa(0x1f4),'default':![]},{'name':a31_0x4c8aaa(0x1bd),'type':a31_0x4c8aaa(0x1eb),'description':a31_0x4c8aaa(0x1e5),'default':![]}];export async function runInit(_0x42653e){const _0x477b3a=a31_0x4c8aaa,_0x300a03=isNonInteractiveMode(_0x42653e),_0x44b1ba=_0x42653e['global']?_0x477b3a(0x1f0):_0x477b3a(0x1d2),_0x5bbc66=resolveWriteConfigPath(_0x44b1ba);try{_0x300a03?await runNonInteractive(_0x42653e,_0x5bbc66):await runInteractive(_0x42653e,_0x5bbc66);}catch(_0x3e3dc9){if(_0x3e3dc9 instanceof AbortPrompt)throw CliErrors[_0x477b3a(0x1e9)]();throw _0x3e3dc9;}}export async function runInitImport(_0xe21081){const _0x4b1019=a31_0x4c8aaa,_0x551f01=_0xe21081[_0x4b1019(0x1f0)]?'global':_0x4b1019(0x1d2),_0x336797=resolveWriteConfigPath(_0x551f01);await runFromImport(_0xe21081,_0x336797);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x4c8aaa(0x1c9)]);async function runFromImport(_0x425357,_0x412986){const _0x3f06ee=a31_0x4c8aaa,_0x4ef830=resolveFilePath(_0x425357[_0x3f06ee(0x1ce)]);if(!existsSync(_0x4ef830))throw CliErrors['validation'](_0x3f06ee(0x1d9)+_0x4ef830);const _0x14d83f=readSourceFile(_0x4ef830),_0x592c22=convertToRuntimeConfig(_0x14d83f);_0x425357[_0x3f06ee(0x1e6)]&&(_0x592c22['appcode']=String(_0x425357['appcode']));_0x425357[_0x3f06ee(0x1c8)]&&(_0x592c22[_0x3f06ee(0x1c8)]=resolveInitEnv(_0x425357));if(!_0x592c22[_0x3f06ee(0x1e6)])throw CliErrors['validation'](_0x3f06ee(0x1bb),_0x3f06ee(0x1f8));await writeInitConfig(_0x412986,_0x592c22,_0x425357),console[_0x3f06ee(0x1d4)]('Imported\x20from\x20'+_0x4ef830),console[_0x3f06ee(0x1d4)]('\x20\x20config:\x20\x20'+_0x412986),console['log'](_0x3f06ee(0x1e8)+_0x592c22[_0x3f06ee(0x1e6)]);if(_0x592c22['defaultApp'])console['log'](_0x3f06ee(0x1bf)+_0x592c22[_0x3f06ee(0x1de)]);}function convertToRuntimeConfig(_0x319024){const _0x32339f=a31_0x4c8aaa;if(_0x319024[_0x32339f(0x1dd)]&&typeof _0x319024['apps']===_0x32339f(0x1ee))throw CliErrors[_0x32339f(0x1ef)](_0x32339f(0x1c3),_0x32339f(0x1cf));const _0x22b6ac={};for(const _0x314036 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x319024[_0x314036]!==undefined&&(_0x22b6ac[_0x314036]=_0x319024[_0x314036]);}return!_0x22b6ac['riskLevel']&&(_0x22b6ac[_0x32339f(0x1ca)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x22b6ac;}async function runNonInteractive(_0x5b25e0,_0x405f4c){const _0x6c0e8d=a31_0x4c8aaa,_0x31fa6d=_0x5b25e0[_0x6c0e8d(0x1e6)];if(!_0x31fa6d)throw CliErrors[_0x6c0e8d(0x1f6)]('appcode','Usage:\x20'+CLI_BIN_NAME+_0x6c0e8d(0x1d0));const _0x124179=resolveInitEnv(_0x5b25e0);await writeInitConfig(_0x405f4c,{'appcode':_0x31fa6d,'env':_0x124179},_0x5b25e0),console[_0x6c0e8d(0x1d4)](_0x6c0e8d(0x1e2)+_0x405f4c),console['log']('\x20\x20appcode:\x20'+_0x31fa6d),console['log'](_0x6c0e8d(0x1d5)+_0x124179);}async function runInteractive(_0x595615,_0x3e5290){const _0x1dfef9=a31_0x4c8aaa,_0x1a2800=loadExisting(_0x3e5290),_0x34ba1f=typeof _0x1a2800?.[_0x1dfef9(0x1e6)]===_0x1dfef9(0x1f2)?_0x1a2800[_0x1dfef9(0x1e6)]:'',_0x4546b1=resolveInitEnv(_0x595615);console[_0x1dfef9(0x1d4)](CLI_BIN_NAME+_0x1dfef9(0x1cc)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x3e5290)&&!_0x595615[_0x1dfef9(0x1bd)]){const _0x309f22=await promptYesNo(_0x1dfef9(0x1b6)+_0x3e5290+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x309f22){console[_0x1dfef9(0x1d4)]('Aborted.');return;}}const _0x18901e=typeof _0x595615[_0x1dfef9(0x1e6)]==='string'?_0x595615[_0x1dfef9(0x1e6)][_0x1dfef9(0x1e7)]():'';let _0x2f6a26=_0x18901e;!_0x2f6a26&&(_0x2f6a26=await promptInput('App\x20code',_0x34ba1f));if(!_0x2f6a26[_0x1dfef9(0x1e7)]())throw CliErrors[_0x1dfef9(0x1ef)](_0x1dfef9(0x1c5));await writeInitConfig(_0x3e5290,{'appcode':_0x2f6a26[_0x1dfef9(0x1e7)](),'env':_0x4546b1},_0x595615),console['log'](_0x1dfef9(0x1df)+_0x3e5290),console['log'](_0x1dfef9(0x1e8)+_0x2f6a26[_0x1dfef9(0x1e7)]()),console[_0x1dfef9(0x1d4)](_0x1dfef9(0x1d5)+_0x4546b1);}async function writeInitConfig(_0x3159e6,_0x5d7d25,_0xfb7c4e){const _0xd50e5a=a31_0x4c8aaa;let _0x5f2e2b={};existsSync(_0x3159e6)&&!_0xfb7c4e[_0xd50e5a(0x1bd)]&&(_0x5f2e2b=readConfigFile(_0x3159e6));for(const [_0x9fe059,_0x2600ec]of Object[_0xd50e5a(0x1b8)](_0x5d7d25)){_0x2600ec!==undefined&&(_0x5f2e2b[_0x9fe059]=_0x2600ec);}if(_0x5f2e2b['app'])delete _0x5f2e2b[_0xd50e5a(0x1ec)];writeConfigFile(_0x3159e6,_0x5f2e2b);}class AbortPrompt extends Error{constructor(){const _0xdf4e08=a31_0x4c8aaa;super(_0xdf4e08(0x1ed)),this['name']=_0xdf4e08(0x1d3);}}function createSafeRl(){const _0x22a227=a31_0x4c8aaa,_0x1fa3b6=createInterface({'input':process[_0x22a227(0x1be)],'output':process[_0x22a227(0x1fa)]});let _0x1c45f2;const _0x16cb6b=new Promise((_0x6647c1,_0xb6b985)=>{const _0x7e1245=_0x22a227;_0x1c45f2=()=>{const _0x183550=a31_0x5ad5;_0x1c45f2&&(_0x1fa3b6['removeListener'](_0x183550(0x1c0),_0x1c45f2),_0x1c45f2=undefined);try{_0x1fa3b6[_0x183550(0x1cd)]();}catch{}_0xb6b985(new AbortPrompt());},_0x1fa3b6[_0x7e1245(0x1d6)](_0x7e1245(0x1c0),_0x1c45f2);}),_0x318c55=()=>{const _0x471d19=_0x22a227;_0x1c45f2&&(_0x1fa3b6[_0x471d19(0x1e0)](_0x471d19(0x1c0),_0x1c45f2),_0x1c45f2=undefined);try{_0x1fa3b6[_0x471d19(0x1cd)]();}catch{}};return{'rl':_0x1fa3b6,'abortPromise':_0x16cb6b,'disposeSuccess':_0x318c55};}function a31_0x52f6(){const _0x2f6731=['validation','global','2047200UimJNA','string','Invalid\x20env\x20\x22',')\x20instead\x20of\x20project','Target\x20environment\x20(default\x20','flagMissing','297WnIVNX','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','toLowerCase','stdout','2071713NWxAJB','question','9NEifuk','File\x20','4330128nFZPbI','entries','):\x20','cwd','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','race','yes','stdin','\x20\x20default:\x20','SIGINT','utf8','Override\x20imported\x20default\x20env','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','[y/N]','App\x20code\x20cannot\x20be\x20empty.','4FUwDtF','join','env','apiDir','riskLevel','includes','\x20init\x20—\x20Create\x20','close','file','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','3287940RfGpDd','project','AbortPrompt','log','\x20\x20env:\x20\x20\x20\x20\x20','once','325110VcNRme','4quskMR','Source\x20file\x20not\x20found:\x20','Override\x20imported\x20default\x20appcode','Failed\x20to\x20parse\x20source\x20file:\x20','newConfigFileName','apps','defaultApp','\x0aInitialized\x20','removeListener','232429pZADLA','Initialized\x20','Write\x20to\x20global\x20(~/','8190679JZLZjF','Skip\x20confirmation\x20when\x20overwriting','appcode','trim','\x20\x20appcode:\x20','cancelled','[Y/n]','boolean','app','User\x20aborted\x20prompt','object'];a31_0x52f6=function(){return _0x2f6731;};return a31_0x52f6();}async function promptInput(_0x3bd7f6,_0x1760da){const _0x584fb3=a31_0x4c8aaa,{rl:_0x351d24,abortPromise:_0x4374ac,disposeSuccess:_0x112024}=createSafeRl(),_0x4a6610=new Promise(_0x461406=>{const _0x1289be=a31_0x5ad5,_0x247d6f=_0x1760da?'\x20\x20'+_0x3bd7f6+'\x20('+_0x1760da+_0x1289be(0x1b9):'\x20\x20'+_0x3bd7f6+':\x20';_0x351d24[_0x1289be(0x1fc)](_0x247d6f,_0x498f44=>{_0x112024(),_0x461406(_0x498f44['trim']()||_0x1760da);});});return Promise[_0x584fb3(0x1bc)]([_0x4a6610,_0x4374ac]);}async function promptYesNo(_0x7d5617,_0x383460){const _0x13dc5c=a31_0x4c8aaa,{rl:_0x3b50dd,abortPromise:_0x2f4083,disposeSuccess:_0x10df9a}=createSafeRl(),_0x4ae7ba=new Promise(_0x308733=>{const _0x770547=a31_0x5ad5,_0x5b7d98=_0x383460?_0x770547(0x1ea):_0x770547(0x1c4);_0x3b50dd[_0x770547(0x1fc)]('\x20\x20'+_0x7d5617+'\x20'+_0x5b7d98+':\x20',_0x1fa664=>{const _0x56a30c=_0x770547;_0x10df9a();const _0x1e265f=_0x1fa664['trim']()[_0x56a30c(0x1f9)]();if(_0x1e265f==='y'||_0x1e265f===_0x56a30c(0x1bd))_0x308733(!![]);else{if(_0x1e265f==='n'||_0x1e265f==='no')_0x308733(![]);else _0x308733(_0x383460);}});});return Promise[_0x13dc5c(0x1bc)]([_0x4ae7ba,_0x2f4083]);}function loadExisting(_0x2d52b2){if(!existsSync(_0x2d52b2))return null;return readConfigFile(_0x2d52b2);}function resolveFilePath(_0x4f7034){const _0x4f4cb6=a31_0x4c8aaa;return isAbsolute(_0x4f7034)?_0x4f7034:resolve(process[_0x4f4cb6(0x1ba)](),_0x4f7034);}function readSourceFile(_0x3b42a3){const _0x9d3798=a31_0x4c8aaa;try{const _0x1cefe2=readFileSync(_0x3b42a3,{'encoding':_0x9d3798(0x1c1)});return JSON['parse'](_0x1cefe2);}catch(_0x27e077){throw CliErrors['validation'](_0x9d3798(0x1db)+_0x27e077['message']);}}function resolveInitEnv(_0x4e3e7f){const _0x54e210=a31_0x4c8aaa,_0x42036e=_0x4e3e7f['env'];if(_0x42036e===undefined||_0x42036e==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x54e210(0x1cb)](_0x42036e))throw CliErrors[_0x54e210(0x1ef)](_0x54e210(0x1f3)+_0x42036e+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x54e210(0x1c7)](',\x20'));return _0x42036e;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x111545=a32_0x19f0;(function(_0x35fc3c,_0x345b21){const _0x459c88=a32_0x19f0,_0x4b9744=_0x35fc3c();while(!![]){try{const _0x300ad0=-parseInt(_0x459c88(0x179))/0x1+parseInt(_0x459c88(0x181))/0x2+parseInt(_0x459c88(0x164))/0x3*(-parseInt(_0x459c88(0x168))/0x4)+-parseInt(_0x459c88(0x169))/0x5+parseInt(_0x459c88(0x17a))/0x6+parseInt(_0x459c88(0x170))/0x7*(-parseInt(_0x459c88(0x16e))/0x8)+parseInt(_0x459c88(0x18a))/0x9;if(_0x300ad0===_0x345b21)break;else _0x4b9744['push'](_0x4b9744['shift']());}catch(_0x18ad82){_0x4b9744['push'](_0x4b9744['shift']());}}}(a32_0x4399,0x20813));function a32_0x19f0(_0x4a3aae,_0x5ddfec){_0x4a3aae=_0x4a3aae-0x152;const _0x4399fe=a32_0x4399();let _0x19f046=_0x4399fe[_0x4a3aae];return _0x19f046;}import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x15b)},FILE_FLAG={'name':'file','type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x153)},QUERY_FLAG={'name':a32_0x111545(0x16c),'type':a32_0x111545(0x182),'required':!![],'description':a32_0x111545(0x18c)},TOPK_FLAG={'name':a32_0x111545(0x15c),'type':'number','description':a32_0x111545(0x171)};function readKnowledgeFile(_0x23d7ac){const _0xb3f51d=a32_0x111545;if(!_0x23d7ac)throw CliErrors[_0xb3f51d(0x176)](_0xb3f51d(0x155));if(!existsSync(_0x23d7ac))throw CliErrors[_0xb3f51d(0x176)]('File\x20not\x20found:\x20'+_0x23d7ac);if(!statSync(_0x23d7ac)['isFile']())throw CliErrors['validation'](_0xb3f51d(0x160)+_0x23d7ac);return readFileSync(_0x23d7ac,'utf8');}function summarizePersonalItem(_0x7845a2){const _0xdb4782=a32_0x111545;return{'id':_0x7845a2['id'],'title':_0x7845a2[_0xdb4782(0x17b)],'version':_0x7845a2[_0xdb4782(0x178)],'ragStatus':_0x7845a2['ragStatus'],'ragErrorMessage':_0x7845a2[_0xdb4782(0x172)],'updateTime':_0x7845a2['updateTime']};}function detailPersonalItem(_0x47c0a2){const _0x2b7b94=a32_0x111545;return{'id':_0x47c0a2['id'],'appCode':_0x47c0a2[_0x2b7b94(0x17c)],'scope':_0x47c0a2['scope'],'userId':_0x47c0a2['userId'],'title':_0x47c0a2[_0x2b7b94(0x17b)],'content':_0x47c0a2[_0x2b7b94(0x161)]??'','version':_0x47c0a2[_0x2b7b94(0x178)],'ragStatus':_0x47c0a2[_0x2b7b94(0x152)],'ragErrorMessage':_0x47c0a2[_0x2b7b94(0x172)],'createTime':_0x47c0a2[_0x2b7b94(0x154)],'updateTime':_0x47c0a2['updateTime']};}function summarizeSearchHit(_0x465361){const _0x5d1b45=a32_0x111545;return{'scope':_0x465361['scope'],'docId':_0x465361[_0x5d1b45(0x187)],'score':_0x465361[_0x5d1b45(0x159)],'weightedScore':_0x465361[_0x5d1b45(0x186)],'content':_0x465361[_0x5d1b45(0x161)],'metadata':_0x465361[_0x5d1b45(0x17e)]};}function a32_0x4399(){const _0x43ca9a=['ragErrorMessage','build','write','read','validation','/update','version','261829AAWBkn','49110eycMMw','title','appCode','map','metadata','POST','verbose','44072cTqkXt','string','description','file','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','weightedScore','docId','body','flag','6470343gMibWN','Created\x20KB\x20entry\x20','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','length','ragStatus','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','createTime','File\x20path\x20is\x20required.','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','--topk\x20must\x20be\x20a\x20positive\x20number.','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','score','Override\x20the\x20existing\x20entry\x20title','Personal\x20knowledge-base\x20entry\x20title','topk','Search\x20query\x20is\x20required.','search','num','File\x20is\x20not\x20a\x20regular\x20file:\x20','content','bool','Personal\x20knowledge-base\x20entry\x20ID','460377DhjrZZ','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','detail','4vLXLcz','438775AXDVqu','update','str','query','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','903728xuZsgI','trim','7NqlrOs','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'];a32_0x4399=function(){return _0x43ca9a;};return a32_0x4399();}function readTopK(_0x290fc4){const _0x4f768d=a32_0x111545,_0x38a810=_0x290fc4[_0x4f768d(0x189)](_0x4f768d(0x15c));if(_0x38a810===undefined||_0x38a810===null||_0x38a810==='')return undefined;const _0x2bbab1=_0x290fc4[_0x4f768d(0x15f)](_0x4f768d(0x15c));if(!Number['isFinite'](_0x2bbab1)||_0x2bbab1<0x1)throw CliErrors['validation'](_0x4f768d(0x157));return _0x2bbab1;}const kbList={'service':'kb','command':'list','description':a32_0x111545(0x165),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x20de32){const _0x1d5ba5=a32_0x111545,_0x506cc5=await listPersonalKnowledgeBaseItems(_0x20de32['appCode']);if(_0x20de32[_0x1d5ba5(0x162)](_0x1d5ba5(0x180)))return{'ok':!![],'data':{'total':_0x506cc5['length'],'items':_0x506cc5}};return{'ok':!![],'data':{'total':_0x506cc5[_0x1d5ba5(0x18d)],'items':_0x506cc5[_0x1d5ba5(0x17d)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x111545(0x167),'description':a32_0x111545(0x166),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x111545(0x163)}],async 'execute'(_0x84d711){const _0x179b75=a32_0x111545,_0x279414=await getPersonalKnowledgeBaseItem(_0x84d711[_0x179b75(0x15f)]('id'),_0x84d711[_0x179b75(0x17c)]);return{'ok':!![],'data':detailPersonalItem(_0x279414)};}},kbCreate={'service':'kb','command':'create','description':a32_0x111545(0x16d),'risk':'write','flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1d508c){const _0x52386a=a32_0x111545,_0x5718d5=_0x1d508c[_0x52386a(0x16b)](_0x52386a(0x17b)),_0x46657f=readKnowledgeFile(_0x1d508c['str'](_0x52386a(0x184))),_0x254f7e=await createPersonalKnowledgeBaseItem(_0x1d508c[_0x52386a(0x17c)],{'title':_0x5718d5,'content':_0x46657f});return{'ok':!![],'data':summarizePersonalItem(_0x254f7e),'message':_0x52386a(0x18b)+_0x254f7e['id']+'\x20('+_0x254f7e['title']+')'};},async 'dryRun'(_0x356635){const _0x373209=a32_0x111545,_0x1bfd8a=_0x356635['str'](_0x373209(0x17b)),_0xf68e46=readKnowledgeFile(_0x356635['str'](_0x373209(0x184)));return dryRun(_0x373209(0x17f),'/client/knowledge-base/personal/create')[_0x373209(0x188)]({'appCode':_0x356635[_0x373209(0x17c)],'title':_0x1bfd8a,'content':_0xf68e46})[_0x373209(0x183)](_0x373209(0x185)+_0x1bfd8a+'\x22')[_0x373209(0x173)]();}},kbUpdate={'service':'kb','command':a32_0x111545(0x16a),'description':a32_0x111545(0x156),'risk':a32_0x111545(0x174),'flags':[{...ID_FLAG,'description':a32_0x111545(0x163)},{...TITLE_FLAG,'required':![],'description':a32_0x111545(0x15a)},FILE_FLAG],async 'execute'(_0x55d6e7){const _0x5123e7=a32_0x111545,_0x3d9c16=_0x55d6e7[_0x5123e7(0x15f)]('id'),_0x6b5253=readKnowledgeFile(_0x55d6e7[_0x5123e7(0x16b)](_0x5123e7(0x184))),_0x1de9af=_0x55d6e7[_0x5123e7(0x16b)](_0x5123e7(0x17b))||(await getPersonalKnowledgeBaseItem(_0x3d9c16,_0x55d6e7[_0x5123e7(0x17c)]))[_0x5123e7(0x17b)],_0x34edc2=await updatePersonalKnowledgeBaseItem(_0x3d9c16,_0x55d6e7[_0x5123e7(0x17c)],{'title':_0x1de9af,'content':_0x6b5253});return{'ok':!![],'data':summarizePersonalItem(_0x34edc2),'message':'Updated\x20KB\x20entry\x20'+_0x34edc2['id']+'\x20('+_0x34edc2['title']+')'};},async 'dryRun'(_0x42ca1a){const _0x24ad0a=a32_0x111545,_0x3ac549=_0x42ca1a[_0x24ad0a(0x15f)]('id'),_0x591b5f=readKnowledgeFile(_0x42ca1a['str']('file')),_0x2e91a2=_0x42ca1a['str']('title')||(await getPersonalKnowledgeBaseItem(_0x3ac549,_0x42ca1a['appCode']))[_0x24ad0a(0x17b)];return dryRun(_0x24ad0a(0x17f),'/client/knowledge-base/personal/'+_0x3ac549+_0x24ad0a(0x177))[_0x24ad0a(0x188)]({'appCode':_0x42ca1a[_0x24ad0a(0x17c)],'title':_0x2e91a2,'content':_0x591b5f})[_0x24ad0a(0x183)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x3ac549)['build']();}},kbSearch={'service':'kb','command':a32_0x111545(0x15e),'description':a32_0x111545(0x158),'risk':a32_0x111545(0x175),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x2b798f){const _0x4172e9=a32_0x111545;if(!_0x2b798f[_0x4172e9(0x16b)](_0x4172e9(0x16c))[_0x4172e9(0x16f)]())throw CliErrors[_0x4172e9(0x176)](_0x4172e9(0x15d));readTopK(_0x2b798f);},async 'execute'(_0x2d00e6){const _0x3c0310=a32_0x111545,_0x6a4cea=_0x2d00e6[_0x3c0310(0x16b)](_0x3c0310(0x16c))[_0x3c0310(0x16f)](),_0xd36515=readTopK(_0x2d00e6),_0x3e39d6=await searchKnowledgeBase(_0x2d00e6['appCode'],{'query':_0x6a4cea,'topK':_0xd36515});return{'ok':!![],'data':{'total':_0x3e39d6[_0x3c0310(0x18d)],'hits':_0x3e39d6[_0x3c0310(0x17d)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0x337f(_0xd20375,_0x236666){_0xd20375=_0xd20375-0x12c;const _0x3f8718=a33_0x3f87();let _0x337fce=_0x3f8718[_0xd20375];return _0x337fce;}function a33_0x3f87(){const _0x12f43c=['\x20\x20\x20Time:\x20','readLogs','*\x20Logs\x20cleared','forEach','show','length','\x20logs:\x0a','12106408wRmDpa','write','read','1335442UMCrXt','22272480cBnwRi','35106krhofl','Clear\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','2qLZpJI','error','logs','328UYZRUA','message','en-US','*\x20No\x20logs\x20found','7646295qETnOr','log','level','1861174SGAboQ','toLocaleString','keys','clear','View\x20command\x20history\x20logs','stringify','10283292smcjtA','details','clearLogs','timestamp','command'];a33_0x3f87=function(){return _0x12f43c;};return a33_0x3f87();}const a33_0x7d6737=a33_0x337f;(function(_0x3ffb39,_0x76bbdb){const _0x416bd7=a33_0x337f,_0x37433d=_0x3ffb39();while(!![]){try{const _0x3bc4a2=parseInt(_0x416bd7(0x13b))/0x1*(parseInt(_0x416bd7(0x140))/0x2)+-parseInt(_0x416bd7(0x13d))/0x3*(parseInt(_0x416bd7(0x143))/0x4)+parseInt(_0x416bd7(0x147))/0x5+-parseInt(_0x416bd7(0x12c))/0x6+-parseInt(_0x416bd7(0x14a))/0x7+-parseInt(_0x416bd7(0x138))/0x8+parseInt(_0x416bd7(0x13c))/0x9;if(_0x3bc4a2===_0x76bbdb)break;else _0x37433d['push'](_0x37433d['shift']());}catch(_0x5c3a93){_0x37433d['push'](_0x37433d['shift']());}}}(a33_0x3f87,0xd8808));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0xbea31a){const _0x23384d=a33_0x337f;if(_0xbea31a['length']===0x0){console[_0x23384d(0x148)](_0x23384d(0x146));return;}console[_0x23384d(0x148)]('*\x20'+CLI_DISPLAY_NAME+_0x23384d(0x137)),_0xbea31a[_0x23384d(0x134)]((_0x3c71e6,_0x561da6)=>{const _0x46f14a=_0x23384d,_0x1491aa=new Date(_0x3c71e6[_0x46f14a(0x12f)])[_0x46f14a(0x14b)](_0x46f14a(0x145)),_0x495322=_0x3c71e6[_0x46f14a(0x149)]==='success'?'√':_0x3c71e6[_0x46f14a(0x149)]===_0x46f14a(0x141)?'×':_0x3c71e6[_0x46f14a(0x149)]==='warn'?'!':'i';console[_0x46f14a(0x148)](_0x561da6+0x1+'.\x20'+_0x495322+'\x20['+_0x3c71e6[_0x46f14a(0x130)]+']\x20'+_0x3c71e6[_0x46f14a(0x144)]),console[_0x46f14a(0x148)](_0x46f14a(0x131)+_0x1491aa),_0x3c71e6['duration']&&console['log'](_0x46f14a(0x13f)+_0x3c71e6['duration']+'ms'),_0x3c71e6['details']&&Object[_0x46f14a(0x14c)](_0x3c71e6[_0x46f14a(0x12d)])[_0x46f14a(0x136)]>0x0&&console[_0x46f14a(0x148)]('\x20\x20\x20Details:\x20'+JSON[_0x46f14a(0x14f)](_0x3c71e6['details'],null,0x2)),console[_0x46f14a(0x148)]('');});}export const logsDefinitions=[{'service':a33_0x7d6737(0x142),'command':a33_0x7d6737(0x135),'description':a33_0x7d6737(0x14e),'risk':a33_0x7d6737(0x13a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b9227){const _0x203fca=a33_0x7d6737;return printLogs(logger[_0x203fca(0x132)]()),{'ok':!![]};}},{'service':a33_0x7d6737(0x142),'command':a33_0x7d6737(0x14d),'description':a33_0x7d6737(0x13e),'risk':a33_0x7d6737(0x139),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x318365){const _0x4664a5=a33_0x7d6737;return logger[_0x4664a5(0x12e)](),console[_0x4664a5(0x148)](_0x4664a5(0x133)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x2f0a(){const _0x2fc2f7=['toLowerCase','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','329550lPfiqG','139209RqdHHT','\x20OCR','filePath','\x20OCR\x20from\x20URL','126OOOxXJ','1710068afWQUV','imageFile','56dUmUwR','Publicly\x20accessible\x20image\x20or\x20file\x20URL','form','POST','Invoice','filter','fileName','description','File\x20URL\x20response\x20missing\x20fileUrl.','trim','.\x20Supported\x20scenes:\x20','Unsupported\x20OCR\x20scene:\x20','image-file','IdCard','build','idcard','idCard','/client/ocr','image-url','fileUrl','join','173276UYFwMy','general','scene','1377055deyaKp','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','Preview:\x20recognize\x20','imageUrl','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','File\x20upload\x20response\x20missing\x20filePath.','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','appCode','5570256aRMwBa','ocr','count','str','string','125LEVKPm','Table','apiError','body','write','1689588LrcBJq','validation','recognize','invoice','/client/uploadFile'];a34_0x2f0a=function(){return _0x2fc2f7;};return a34_0x2f0a();}const a34_0x5c1b86=a34_0x4e20;(function(_0x51ce8c,_0x27bc27){const _0xe48c27=a34_0x4e20,_0x3e5ab9=_0x51ce8c();while(!![]){try{const _0x590f43=parseInt(_0xe48c27(0x1b5))/0x1+-parseInt(_0xe48c27(0x19b))/0x2+parseInt(_0xe48c27(0x1c7))/0x3+-parseInt(_0xe48c27(0x1b2))/0x4*(-parseInt(_0xe48c27(0x1c2))/0x5)+-parseInt(_0xe48c27(0x1bd))/0x6+-parseInt(_0xe48c27(0x196))/0x7*(-parseInt(_0xe48c27(0x19d))/0x8)+-parseInt(_0xe48c27(0x19a))/0x9*(parseInt(_0xe48c27(0x195))/0xa);if(_0x590f43===_0x27bc27)break;else _0x3e5ab9['push'](_0x3e5ab9['shift']());}catch(_0x34abb0){_0x3e5ab9['push'](_0x3e5ab9['shift']());}}}(a34_0x2f0a,0xe0097));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x5c1b86(0x191),a34_0x5c1b86(0x1b3),a34_0x5c1b86(0x19f),a34_0x5c1b86(0x1ad)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x5c1b86(0x1a1),'general':'General','form':a34_0x5c1b86(0x1c3),'idCard':a34_0x5c1b86(0x1aa)},SCENE_FLAG={'name':a34_0x5c1b86(0x1b4),'type':a34_0x5c1b86(0x1c1),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5c1b86(0x1b9)},IMAGE_FILE_FLAG={'name':a34_0x5c1b86(0x1a9),'type':a34_0x5c1b86(0x1c1),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x5c1b86(0x1af),'type':a34_0x5c1b86(0x1c1),'description':a34_0x5c1b86(0x19e)};function normalizeScene(_0x3f1922){const _0x41d145=a34_0x5c1b86,_0x2126e1=_0x3f1922['trim']()[_0x41d145(0x193)]();if(_0x2126e1===_0x41d145(0x1ac))return _0x41d145(0x1ad);if(_0x2126e1===_0x41d145(0x191)||_0x2126e1===_0x41d145(0x1b3)||_0x2126e1===_0x41d145(0x19f))return _0x2126e1;throw CliErrors[_0x41d145(0x18f)](_0x41d145(0x1a8)+_0x3f1922+_0x41d145(0x1a7)+SUPPORTED_SCENES[_0x41d145(0x1b1)](',\x20'));}function selectedInputs(_0x5d06b4){const _0x44f04c=a34_0x5c1b86,_0x8da13b=_0x5d06b4[_0x44f04c(0x1c0)](_0x44f04c(0x1a9))[_0x44f04c(0x1a6)](),_0x164293=_0x5d06b4[_0x44f04c(0x1c0)](_0x44f04c(0x1af))[_0x44f04c(0x1a6)]();return{'imageFile':_0x8da13b,'imageUrl':_0x164293,'count':[_0x8da13b,_0x164293][_0x44f04c(0x1a2)](Boolean)['length']};}function validateInputSelection(_0x5987e8){const _0x482f5b=a34_0x5c1b86,_0xe0e215=selectedInputs(_0x5987e8);if(_0xe0e215[_0x482f5b(0x1bf)]!==0x1)throw CliErrors['validation'](_0x482f5b(0x1b6));return _0xe0e215;}function a34_0x4e20(_0x682fac,_0x267902){_0x682fac=_0x682fac-0x18f;const _0x2f0a5f=a34_0x2f0a();let _0x4e20bd=_0x2f0a5f[_0x682fac];return _0x4e20bd;}function withScene(_0x172034,_0x1c9ca8,_0x35958f){const _0xae1de=a34_0x5c1b86;return{..._0x172034,'scene':_0x1c9ca8,..._0x35958f?{'sourceFile':{'fileName':_0x35958f[_0xae1de(0x1a3)],'filePath':_0x35958f[_0xae1de(0x198)]}}:{}};}const ocrRecognize={'service':a34_0x5c1b86(0x1be),'command':a34_0x5c1b86(0x190),'description':a34_0x5c1b86(0x194),'risk':a34_0x5c1b86(0x1c6),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x35ef4d){const _0x6f1e1d=a34_0x5c1b86,_0x944e4d=normalizeScene(_0x35ef4d['str']('scene')),_0x3ee955=SCENE_TO_LEGACY_TYPE[_0x944e4d],_0x15b633=validateInputSelection(_0x35ef4d);if(_0x15b633[_0x6f1e1d(0x1b8)])return dryRun(_0x6f1e1d(0x1a0),_0x6f1e1d(0x1ae))[_0x6f1e1d(0x1c5)]({'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'url':_0x15b633[_0x6f1e1d(0x1b8)],'type':_0x3ee955})[_0x6f1e1d(0x1a4)](_0x6f1e1d(0x1b7)+_0x944e4d+_0x6f1e1d(0x199))[_0x6f1e1d(0x1ab)]();const _0x5e96a5=requireRuntimeUploadFile(_0x15b633[_0x6f1e1d(0x19c)],_0x6f1e1d(0x1a9));return dryRun(_0x6f1e1d(0x1a0),_0x6f1e1d(0x192))[_0x6f1e1d(0x1c5)]({'steps':[{'method':_0x6f1e1d(0x1a0),'url':_0x6f1e1d(0x192),'body':{'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'multipart':{'file':_0x5e96a5}}},{'method':_0x6f1e1d(0x1a0),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x6f1e1d(0x1a0),'url':'/client/ocr','body':{'appCode':_0x35ef4d[_0x6f1e1d(0x1bc)],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x3ee955}}]})[_0x6f1e1d(0x1a4)](_0x6f1e1d(0x1bb)+_0x944e4d+_0x6f1e1d(0x197))[_0x6f1e1d(0x1ab)]();},async 'execute'(_0x4ee37e){const _0x4b0325=a34_0x5c1b86,_0x3c38ac=normalizeScene(_0x4ee37e['str'](_0x4b0325(0x1b4))),_0x53bf00=SCENE_TO_LEGACY_TYPE[_0x3c38ac],_0x30e2ba=validateInputSelection(_0x4ee37e);if(_0x30e2ba['imageUrl']){const _0x15ba00=await recognizeRuntimeOcr(_0x4ee37e[_0x4b0325(0x1bc)],{'url':_0x30e2ba[_0x4b0325(0x1b8)],'type':_0x53bf00});return{'ok':!![],'data':withScene(_0x15ba00,_0x3c38ac)};}const _0x342bc7=requireRuntimeUploadFile(_0x30e2ba[_0x4b0325(0x19c)],_0x4b0325(0x1a9)),_0xb74d81=await uploadRuntimeFile(_0x4ee37e['appCode'],_0x342bc7['path']);if(!_0xb74d81[_0x4b0325(0x198)])throw CliErrors[_0x4b0325(0x1c4)](_0x4b0325(0x1ba));const _0x3c92cf=await queryRuntimeFileUrl(_0xb74d81[_0x4b0325(0x198)],{'download':![]});if(!_0x3c92cf[_0x4b0325(0x1b0)])throw CliErrors['apiError'](_0x4b0325(0x1a5));const _0x26c29c=await recognizeRuntimeOcr(_0x4ee37e['appCode'],{'url':_0x3c92cf[_0x4b0325(0x1b0)],'type':_0x53bf00});return{'ok':!![],'data':withScene(_0x26c29c,_0x3c38ac,_0xb74d81)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0xe987ff=a35_0x1436;(function(_0x2f9822,_0x2af292){const _0x1af91f=a35_0x1436,_0x1accba=_0x2f9822();while(!![]){try{const _0x430aaf=parseInt(_0x1af91f(0x17c))/0x1*(-parseInt(_0x1af91f(0x150))/0x2)+-parseInt(_0x1af91f(0x14e))/0x3+parseInt(_0x1af91f(0x14f))/0x4+parseInt(_0x1af91f(0x162))/0x5*(parseInt(_0x1af91f(0x171))/0x6)+-parseInt(_0x1af91f(0x16a))/0x7+parseInt(_0x1af91f(0x138))/0x8*(-parseInt(_0x1af91f(0x15c))/0x9)+parseInt(_0x1af91f(0x13c))/0xa*(parseInt(_0x1af91f(0x170))/0xb);if(_0x430aaf===_0x2af292)break;else _0x1accba['push'](_0x1accba['shift']());}catch(_0x2afdad){_0x1accba['push'](_0x1accba['shift']());}}}(a35_0xdc7f,0x259ce));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x1436(_0x2e297b,_0x2495b1){_0x2e297b=_0x2e297b-0x137;const _0xdc7f8a=a35_0xdc7f();let _0x14363d=_0xdc7f8a[_0x2e297b];return _0x14363d;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x156)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0xe987ff(0x13d),'required':!![],'description':a35_0xe987ff(0x13b)},DESCRIPTION_FLAG={'name':a35_0xe987ff(0x13a),'type':'string','description':a35_0xe987ff(0x169)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0xe987ff(0x13d),'description':a35_0xe987ff(0x166)};function normalizeFunctionName(_0x3e074a){const _0x796658=a35_0xe987ff,_0x39670e=String(_0x3e074a||'')[_0x796658(0x16d)]();if(!_0x39670e||!FUNCTION_NAME_PATTERN[_0x796658(0x168)](_0x39670e))throw CliErrors[_0x796658(0x16b)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x39670e;}function a35_0xdc7f(){const _0x24af62=['47205TSZwMK','body','params','createTime','Executed\x20personal\x20BFF\x20','str','5AoaNMe','POST','name','/update','Optional\x20source\x20RuntimeAgent\x20session\x20id','write','test','Personal\x20BFF\x20description','1393294osNqPk','validation','Created\x20personal\x20BFF\x20','trim','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Update\x20a\x20personal\x20BFF\x20by\x20id','14311sQLNMg','119754wjBjrX','create','config','/client/runtime-bff/personal/create','verbose','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','isFile','list','isArray','personal-bff','functionName','238197dWqywy','appCode','392UrxyNy','update','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','5570ZpoaYj','string','utf8','file','length','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','source-session-id','exec','File\x20path\x20is\x20required.','scriptType','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Updated\x20personal\x20BFF\x20','high-risk-write','File\x20not\x20found:\x20','gmtModified','createUserId','build','read','518940UuFisZ','1106680DrHwSF','2RGdzLk','keys','num','Show\x20one\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/','version','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Preview:\x20create\x20personal\x20BFF\x20','Preview:\x20update\x20personal\x20BFF\x20','map','Personal\x20BFF\x20script\x20ID','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file'];a35_0xdc7f=function(){return _0x24af62;};return a35_0xdc7f();}function readScriptFile(_0x3f3ece){const _0x3393ce=a35_0xe987ff;if(!_0x3f3ece)throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x144));if(!existsSync(_0x3f3ece))throw CliErrors[_0x3393ce(0x16b)](_0x3393ce(0x149)+_0x3f3ece);if(!statSync(_0x3f3ece)[_0x3393ce(0x177)]())throw CliErrors[_0x3393ce(0x16b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x3f3ece);const _0x143749=readFileSync(_0x3f3ece,_0x3393ce(0x13e));if(!_0x143749['trim']())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x143749;}function optionalTrimmed(_0x232392){const _0x2905ab=a35_0xe987ff,_0x20a9ed=String(_0x232392||'')[_0x2905ab(0x16d)]();return _0x20a9ed||undefined;}function summarizeBff(_0x3e8a44){const _0x2f1554=a35_0xe987ff;return{'id':_0x3e8a44['id'],'appCode':_0x3e8a44['appCode'],'functionName':_0x3e8a44[_0x2f1554(0x17b)],'description':_0x3e8a44['description'],'scriptType':_0x3e8a44[_0x2f1554(0x145)],'version':_0x3e8a44[_0x2f1554(0x155)],'gmtModified':_0x3e8a44[_0x2f1554(0x14a)],'updateTime':_0x3e8a44['updateTime']};}function detailBff(_0x54ff7e){const _0x58ffa3=a35_0xe987ff;return{'id':_0x54ff7e['id'],'appCode':_0x54ff7e[_0x58ffa3(0x137)],'functionName':_0x54ff7e['functionName'],'description':_0x54ff7e['description'],'scriptType':_0x54ff7e[_0x58ffa3(0x145)],'scriptContent':_0x54ff7e['scriptContent']??'','config':_0x54ff7e[_0x58ffa3(0x173)],'version':_0x54ff7e[_0x58ffa3(0x155)],'createUserId':_0x54ff7e[_0x58ffa3(0x14b)],'gmtCreate':_0x54ff7e['gmtCreate'],'gmtModified':_0x54ff7e['gmtModified'],'createTime':_0x54ff7e[_0x58ffa3(0x15f)],'updateTime':_0x54ff7e['updateTime']};}function buildCreateInput(_0x19c333){const _0x5dbb24=a35_0xe987ff;return{'functionName':normalizeFunctionName(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x164))),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x13a)))?{'description':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)]('description'))}:{},'scriptContent':readScriptFile(_0x19c333[_0x5dbb24(0x161)]('file')),...optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))?{'sourceSessionId':optionalTrimmed(_0x19c333[_0x5dbb24(0x161)](_0x5dbb24(0x142)))}:{}};}function buildUpdateInput(_0x2a1b68){const _0x5bcf9d=a35_0xe987ff,_0x135b9e={};optionalTrimmed(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164)))&&(_0x135b9e[_0x5bcf9d(0x17b)]=normalizeFunctionName(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x164))));_0x2a1b68['flag'](_0x5bcf9d(0x13a))!==undefined&&(_0x135b9e[_0x5bcf9d(0x13a)]=_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13a)));optionalTrimmed(_0x2a1b68['str'](_0x5bcf9d(0x13f)))&&(_0x135b9e['scriptContent']=readScriptFile(_0x2a1b68[_0x5bcf9d(0x161)](_0x5bcf9d(0x13f))));_0x2a1b68['flag']('source-session-id')!==undefined&&(_0x135b9e['sourceSessionId']=_0x2a1b68[_0x5bcf9d(0x161)]('source-session-id'));if(Object[_0x5bcf9d(0x151)](_0x135b9e)[_0x5bcf9d(0x140)]===0x0)throw CliErrors[_0x5bcf9d(0x16b)](_0x5bcf9d(0x146));return _0x135b9e;}function parseExecParams(_0x169046){const _0x5c7972=a35_0xe987ff,_0x3697d6=parseJsonParams(_0x169046)??{};if(Array[_0x5c7972(0x179)](_0x3697d6))throw CliErrors[_0x5c7972(0x16b)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3697d6;}const personalBffList={'service':'personal-bff','command':a35_0xe987ff(0x178),'description':a35_0xe987ff(0x141),'risk':a35_0xe987ff(0x14d),'flags':[VERBOSE_FLAG],async 'execute'(_0x28d6cd){const _0x3f66e4=a35_0xe987ff,_0x55b58b=await listPersonalBffs(_0x28d6cd['appCode']);return{'ok':!![],'data':{'total':_0x55b58b[_0x3f66e4(0x140)],'items':_0x28d6cd['bool'](_0x3f66e4(0x175))?_0x55b58b:_0x55b58b[_0x3f66e4(0x159)](summarizeBff)}};}},personalBffDetail={'service':a35_0xe987ff(0x17a),'command':'detail','description':a35_0xe987ff(0x153),'risk':a35_0xe987ff(0x14d),'flags':[{...ID_FLAG,'description':a35_0xe987ff(0x15a)}],async 'execute'(_0x4ee7dc){const _0xdee11=a35_0xe987ff,_0x2f8489=await getPersonalBff(_0x4ee7dc[_0xdee11(0x152)]('id'),_0x4ee7dc['appCode']);return{'ok':!![],'data':detailBff(_0x2f8489)};}},personalBffCreate={'service':'personal-bff','command':a35_0xe987ff(0x172),'description':a35_0xe987ff(0x15b),'risk':a35_0xe987ff(0x167),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xd5c95e){const _0x16b862=a35_0xe987ff,_0x30b2d7=buildCreateInput(_0xd5c95e),_0x5d16b7=await createPersonalBff(_0xd5c95e[_0x16b862(0x137)],_0x30b2d7);return{'ok':!![],'data':detailBff(_0x5d16b7),'message':_0x16b862(0x16c)+_0x5d16b7['id']+(_0x5d16b7[_0x16b862(0x17b)]?'\x20('+_0x5d16b7['functionName']+')':'')};},async 'dryRun'(_0x3e10c4){const _0x4f355e=a35_0xe987ff,_0x30d7a9=buildCreateInput(_0x3e10c4);return dryRun('POST',_0x4f355e(0x174))[_0x4f355e(0x15d)]({'appCode':_0x3e10c4[_0x4f355e(0x137)],..._0x30d7a9})[_0x4f355e(0x13a)](_0x4f355e(0x157)+_0x30d7a9['functionName'])['build']();}},personalBffUpdate={'service':'personal-bff','command':a35_0xe987ff(0x139),'description':a35_0xe987ff(0x16f),'risk':a35_0xe987ff(0x167),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x302917){const _0x1890b0=a35_0xe987ff,_0x586a8f=_0x302917[_0x1890b0(0x152)]('id'),_0x4db59d=buildUpdateInput(_0x302917),_0x14d988=await updatePersonalBff(_0x586a8f,_0x302917['appCode'],_0x4db59d);return{'ok':!![],'data':detailBff(_0x14d988),'message':_0x1890b0(0x147)+_0x14d988['id']+(_0x14d988[_0x1890b0(0x17b)]?'\x20('+_0x14d988[_0x1890b0(0x17b)]+')':'')};},async 'dryRun'(_0x9882b9){const _0x3935fa=a35_0xe987ff,_0x3e36b1=_0x9882b9[_0x3935fa(0x152)]('id'),_0x1a99a7=buildUpdateInput(_0x9882b9);return dryRun(_0x3935fa(0x163),_0x3935fa(0x154)+_0x3e36b1+_0x3935fa(0x165))[_0x3935fa(0x15d)]({'appCode':_0x9882b9[_0x3935fa(0x137)],..._0x1a99a7})[_0x3935fa(0x13a)](_0x3935fa(0x158)+_0x3e36b1)[_0x3935fa(0x14c)]();}},personalBffExec={'service':a35_0xe987ff(0x17a),'command':a35_0xe987ff(0x143),'description':a35_0xe987ff(0x176),'risk':a35_0xe987ff(0x148),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0xe987ff(0x16e)}],async 'validate'(_0x26a49f){const _0x5655a3=a35_0xe987ff;parseExecParams(_0x26a49f[_0x5655a3(0x161)](_0x5655a3(0x15e)));},async 'execute'(_0x3142de){const _0x4137db=a35_0xe987ff,_0x5d2057=_0x3142de[_0x4137db(0x152)]('id'),_0x37d54b=parseExecParams(_0x3142de[_0x4137db(0x161)](_0x4137db(0x15e))),_0x3a9e5a=await executePersonalBff(_0x5d2057,_0x3142de[_0x4137db(0x137)],_0x37d54b);return{'ok':!![],'data':{'result':_0x3a9e5a},'message':_0x4137db(0x160)+_0x5d2057};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x535e76=a35_0x39f9;(function(_0x6d3d55,_0x2fbe54){const _0x3d8103=a35_0x39f9,_0x1fab73=_0x6d3d55();while(!![]){try{const _0x394af7=-parseInt(_0x3d8103(0x184))/0x1+parseInt(_0x3d8103(0x19e))/0x2+-parseInt(_0x3d8103(0x1a3))/0x3*(parseInt(_0x3d8103(0x18a))/0x4)+parseInt(_0x3d8103(0x174))/0x5*(parseInt(_0x3d8103(0x16c))/0x6)+parseInt(_0x3d8103(0x192))/0x7+-parseInt(_0x3d8103(0x182))/0x8*(parseInt(_0x3d8103(0x19c))/0x9)+parseInt(_0x3d8103(0x17d))/0xa*(parseInt(_0x3d8103(0x189))/0xb);if(_0x394af7===_0x2fbe54)break;else _0x1fab73['push'](_0x1fab73['shift']());}catch(_0x23534b){_0x1fab73['push'](_0x1fab73['shift']());}}}(a35_0x2d5c,0xb50d6));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x39f9(_0x5a16eb,_0x3ddd45){_0x5a16eb=_0x5a16eb-0x166;const _0x2d5cdd=a35_0x2d5c();let _0x39f9c2=_0x2d5cdd[_0x5a16eb];return _0x39f9c2;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a35_0x2d5c(){const _0x4ca347=['Personal\x20BFF\x20script\x20ID','scriptType','/client/runtime-bff/personal/','personal-bff','body','flag','params','File\x20not\x20found:\x20','File\x20path\x20is\x20required.','read','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','name','858wnHNXZ','Show\x20one\x20personal\x20BFF\x20by\x20id','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','list','str','length','/update','write','34495ErTGzC','sourceSessionId','scriptContent','updateTime','build','createTime','high-risk-write','gmtCreate','string','5314270ELLATs','gmtModified','keys','detail','createUserId','679928FimYQy','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','1235949klAFCP','Created\x20personal\x20BFF\x20','create','file','config','22nhbQeQ','158372yNrMyt','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','num','bool','appCode','map','Preview:\x20create\x20personal\x20BFF\x20','functionName','1051260NEFLMf','isFile','Update\x20a\x20personal\x20BFF\x20by\x20id','Executed\x20personal\x20BFF\x20','description','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','trim','update','POST','version','18EFmtEO','Preview:\x20update\x20personal\x20BFF\x20','2033882kCbUuK','source-session-id','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','test','File\x20is\x20not\x20a\x20regular\x20file:\x20','81bUdNOZ','validation'];a35_0x2d5c=function(){return _0x4ca347;};return a35_0x2d5c();}import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0x535e76(0x17c),'description':a35_0x535e76(0x1a0)},FUNCTION_NAME_FLAG={'name':a35_0x535e76(0x16b),'type':'string','required':!![],'description':a35_0x535e76(0x183)},DESCRIPTION_FLAG={'name':a35_0x535e76(0x196),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x535e76(0x17c),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x3f2599){const _0x5c9b8a=a35_0x535e76,_0xd779f4=String(_0x3f2599||'')[_0x5c9b8a(0x198)]();if(!_0xd779f4||!FUNCTION_NAME_PATTERN[_0x5c9b8a(0x1a1)](_0xd779f4))throw CliErrors[_0x5c9b8a(0x1a4)](_0x5c9b8a(0x16a));return _0xd779f4;}function readScriptFile(_0x445d90){const _0x5d903e=a35_0x535e76;if(!_0x445d90)throw CliErrors[_0x5d903e(0x1a4)](_0x5d903e(0x168));if(!existsSync(_0x445d90))throw CliErrors['validation'](_0x5d903e(0x167)+_0x445d90);if(!statSync(_0x445d90)[_0x5d903e(0x193)]())throw CliErrors[_0x5d903e(0x1a4)](_0x5d903e(0x1a2)+_0x445d90);const _0x2b240b=readFileSync(_0x445d90,'utf8');if(!_0x2b240b['trim']())throw CliErrors[_0x5d903e(0x1a4)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x2b240b;}function optionalTrimmed(_0x15738a){const _0x57ebf0=a35_0x535e76,_0x25fce4=String(_0x15738a||'')[_0x57ebf0(0x198)]();return _0x25fce4||undefined;}function summarizeBff(_0x563600){const _0x7ecf4f=a35_0x535e76;return{'id':_0x563600['id'],'appCode':_0x563600['appCode'],'functionName':_0x563600[_0x7ecf4f(0x191)],'description':_0x563600[_0x7ecf4f(0x196)],'scriptType':_0x563600[_0x7ecf4f(0x1a6)],'version':_0x563600[_0x7ecf4f(0x19b)],'gmtModified':_0x563600[_0x7ecf4f(0x17e)],'updateTime':_0x563600['updateTime']};}function detailBff(_0x393f9d){const _0x24882a=a35_0x535e76;return{'id':_0x393f9d['id'],'appCode':_0x393f9d[_0x24882a(0x18e)],'functionName':_0x393f9d['functionName'],'description':_0x393f9d['description'],'scriptType':_0x393f9d[_0x24882a(0x1a6)],'scriptContent':_0x393f9d[_0x24882a(0x176)]??'','config':_0x393f9d[_0x24882a(0x188)],'version':_0x393f9d[_0x24882a(0x19b)],'createUserId':_0x393f9d[_0x24882a(0x181)],'gmtCreate':_0x393f9d[_0x24882a(0x17b)],'gmtModified':_0x393f9d[_0x24882a(0x17e)],'createTime':_0x393f9d[_0x24882a(0x179)],'updateTime':_0x393f9d[_0x24882a(0x177)]};}function buildCreateInput(_0x542f1e){const _0x4bc2dd=a35_0x535e76;return{'functionName':normalizeFunctionName(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x16b))),...optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)]('description'))?{'description':optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x196)))}:{},'scriptContent':readScriptFile(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x187))),...optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x542f1e[_0x4bc2dd(0x170)](_0x4bc2dd(0x19f)))}:{}};}function buildUpdateInput(_0x31a004){const _0x2a86e7=a35_0x535e76,_0x4e8da1={};optionalTrimmed(_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x16b)))&&(_0x4e8da1[_0x2a86e7(0x191)]=normalizeFunctionName(_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x16b))));_0x31a004[_0x2a86e7(0x1aa)](_0x2a86e7(0x196))!==undefined&&(_0x4e8da1[_0x2a86e7(0x196)]=_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x196)));optionalTrimmed(_0x31a004['str']('file'))&&(_0x4e8da1['scriptContent']=readScriptFile(_0x31a004['str'](_0x2a86e7(0x187))));_0x31a004['flag'](_0x2a86e7(0x19f))!==undefined&&(_0x4e8da1[_0x2a86e7(0x175)]=_0x31a004[_0x2a86e7(0x170)](_0x2a86e7(0x19f)));if(Object[_0x2a86e7(0x17f)](_0x4e8da1)[_0x2a86e7(0x171)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x4e8da1;}function parseExecParams(_0x39a443){const _0xff0c96=a35_0x535e76,_0x4b4943=parseJsonParams(_0x39a443)??{};if(Array['isArray'](_0x4b4943))throw CliErrors[_0xff0c96(0x1a4)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x4b4943;}const personalBffList={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x16f),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x535e76(0x169),'flags':[VERBOSE_FLAG],async 'execute'(_0x52476d){const _0x19f3d1=a35_0x535e76,_0x41a9e1=await listPersonalBffs(_0x52476d[_0x19f3d1(0x18e)]);return{'ok':!![],'data':{'total':_0x41a9e1['length'],'items':_0x52476d[_0x19f3d1(0x18d)]('verbose')?_0x41a9e1:_0x41a9e1[_0x19f3d1(0x18f)](summarizeBff)}};}},personalBffDetail={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x180),'description':a35_0x535e76(0x16d),'risk':a35_0x535e76(0x169),'flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)}],async 'execute'(_0x120cc8){const _0x2a745b=a35_0x535e76,_0xa36628=await getPersonalBff(_0x120cc8['num']('id'),_0x120cc8[_0x2a745b(0x18e)]);return{'ok':!![],'data':detailBff(_0xa36628)};}},personalBffCreate={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x186),'description':a35_0x535e76(0x18b),'risk':a35_0x535e76(0x173),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x316056){const _0x1973e4=a35_0x535e76,_0x48ff69=buildCreateInput(_0x316056),_0x367452=await createPersonalBff(_0x316056[_0x1973e4(0x18e)],_0x48ff69);return{'ok':!![],'data':detailBff(_0x367452),'message':_0x1973e4(0x185)+_0x367452['id']+(_0x367452[_0x1973e4(0x191)]?'\x20('+_0x367452[_0x1973e4(0x191)]+')':'')};},async 'dryRun'(_0x2a9b31){const _0x5477c5=a35_0x535e76,_0x25ca53=buildCreateInput(_0x2a9b31);return dryRun(_0x5477c5(0x19a),'/client/runtime-bff/personal/create')[_0x5477c5(0x1a9)]({'appCode':_0x2a9b31[_0x5477c5(0x18e)],..._0x25ca53})[_0x5477c5(0x196)](_0x5477c5(0x190)+_0x25ca53[_0x5477c5(0x191)])['build']();}},personalBffUpdate={'service':a35_0x535e76(0x1a8),'command':a35_0x535e76(0x199),'description':a35_0x535e76(0x194),'risk':'write','flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5c72df){const _0x28a044=a35_0x535e76,_0x438128=_0x5c72df[_0x28a044(0x18c)]('id'),_0x218017=buildUpdateInput(_0x5c72df),_0x4057bc=await updatePersonalBff(_0x438128,_0x5c72df[_0x28a044(0x18e)],_0x218017);return{'ok':!![],'data':detailBff(_0x4057bc),'message':'Updated\x20personal\x20BFF\x20'+_0x4057bc['id']+(_0x4057bc[_0x28a044(0x191)]?'\x20('+_0x4057bc[_0x28a044(0x191)]+')':'')};},async 'dryRun'(_0x194536){const _0x2b12e4=a35_0x535e76,_0x591014=_0x194536[_0x2b12e4(0x18c)]('id'),_0x37cd57=buildUpdateInput(_0x194536);return dryRun(_0x2b12e4(0x19a),_0x2b12e4(0x1a7)+_0x591014+_0x2b12e4(0x172))[_0x2b12e4(0x1a9)]({'appCode':_0x194536[_0x2b12e4(0x18e)],..._0x37cd57})[_0x2b12e4(0x196)](_0x2b12e4(0x19d)+_0x591014)[_0x2b12e4(0x178)]();}},personalBffExec={'service':a35_0x535e76(0x1a8),'command':'exec','description':a35_0x535e76(0x197),'risk':a35_0x535e76(0x17a),'flags':[{...ID_FLAG,'description':a35_0x535e76(0x1a5)},{...PARAMS_FLAG,'description':a35_0x535e76(0x16e)}],async 'validate'(_0xb7b82a){parseExecParams(_0xb7b82a['str']('params'));},async 'execute'(_0x26499f){const _0x2f0246=a35_0x535e76,_0x4af9b3=_0x26499f[_0x2f0246(0x18c)]('id'),_0x5ad1c7=parseExecParams(_0x26499f[_0x2f0246(0x170)](_0x2f0246(0x166))),_0x2a980c=await executePersonalBff(_0x4af9b3,_0x26499f['appCode'],_0x5ad1c7);return{'ok':!![],'data':{'result':_0x2a980c},'message':_0x2f0246(0x195)+_0x4af9b3};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x31117b=a36_0x36d7;(function(_0x18c0ab,_0x4967e1){const _0x52ef05=a36_0x36d7,_0x3125ec=_0x18c0ab();while(!![]){try{const _0x34b759=parseInt(_0x52ef05(0x158))/0x1+-parseInt(_0x52ef05(0x15d))/0x2+parseInt(_0x52ef05(0x16b))/0x3+-parseInt(_0x52ef05(0x162))/0x4+parseInt(_0x52ef05(0x150))/0x5+-parseInt(_0x52ef05(0x155))/0x6*(parseInt(_0x52ef05(0x156))/0x7)+parseInt(_0x52ef05(0x165))/0x8;if(_0x34b759===_0x4967e1)break;else _0x3125ec['push'](_0x3125ec['shift']());}catch(_0xfc3dc2){_0x3125ec['push'](_0x3125ec['shift']());}}}(a36_0x40df,0xe574f));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0x36d7(_0x5a6c85,_0x68c251){_0x5a6c85=_0x5a6c85-0x13e;const _0x40dff7=a36_0x40df();let _0x36d7e9=_0x40dff7[_0x5a6c85];return _0x36d7e9;}import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x20d368){const _0xe27477=a36_0x36d7;for(const _0x4008ca of _0x20d368){definitions[_0xe27477(0x148)](_0x4008ca[_0xe27477(0x141)]+':'+_0x4008ca['command'],_0x4008ca);let _0x5d6ee7=serviceGroups[_0xe27477(0x15f)](_0x4008ca['service']);!_0x5d6ee7&&(_0x5d6ee7=[],serviceGroups[_0xe27477(0x148)](_0x4008ca['service'],_0x5d6ee7)),_0x5d6ee7[_0xe27477(0x15c)](_0x4008ca);}}function registerService(_0x223f8c,_0x4e5587,_0x48a928){const _0x55d5c1=a36_0x36d7;registerDefinitions(_0x4e5587);const _0x363694=_0x2ebcdc=>_0x2ebcdc===_0x55d5c1(0x157)?'':_0x2ebcdc===_0x55d5c1(0x144)?_0x55d5c1(0x149):_0x55d5c1(0x147),_0x4157b6={'service':_0x4e5587[0x0]['service'],'label':_0x223f8c,'commands':_0x4e5587[_0x55d5c1(0x142)](_0x19c75b=>({'command':_0x19c75b[_0x55d5c1(0x15b)],'description':_0x19c75b['description'],'tag':_0x363694(_0x19c75b[_0x55d5c1(0x169)])})),'defaultCommand':_0x48a928?.[_0x55d5c1(0x145)]??(_0x48a928?.[_0x55d5c1(0x161)]?_0x4e5587[0x0][_0x55d5c1(0x15b)]:undefined),'isSingleCommand':_0x48a928?.[_0x55d5c1(0x161)]};serviceRegistry[_0x55d5c1(0x15c)](_0x4157b6),serviceByName[_0x55d5c1(0x148)](_0x4157b6[_0x55d5c1(0x141)],_0x4157b6);}function a36_0x40df(){const _0x53042b=['command','push','3639826AuoGYY','Personal\x20BFF','get','Configuration','isSingleCommand','7428572ZMHuPS','list','Artifacts','29307288WCjBrV','install','values','CLI\x20Built-in\x20Skill','risk','Self\x20Update','4771722nEacSw','File','Diagnostics','Skills','App\x20Management','service','map','SQL\x20Queries','write','defaultCommand','has','\x20\x20[high-risk-write]','set','\x20\x20[write]','show','BFF\x20Scripts','Logs','OCR','Schema','Runtime\x20App\x20Config','2501245FNPFMj','Knowledge\x20Base','Authentication','from','login','12HSGmBe','4972555XLWciL','read','283407YJfRvY','run','Datasets'];a36_0x40df=function(){return _0x53042b;};return a36_0x40df();}registerService(a36_0x31117b(0x152),authDefinitions,{'defaultCommand':a36_0x31117b(0x154)}),registerService(a36_0x31117b(0x140),appDefinitions,{'defaultCommand':a36_0x31117b(0x163)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x31117b(0x14f),appConfigDefinitions),registerService(a36_0x31117b(0x160),configDefinitions,{'defaultCommand':'list'}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x31117b(0x15a),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x31117b(0x143),sqlDefinitions),registerService(a36_0x31117b(0x14b),bffDefinitions),registerService(a36_0x31117b(0x15e),personalBffDefinitions),registerService(a36_0x31117b(0x164),artifactDefinitions),registerService(a36_0x31117b(0x16c),fileDefinitions),registerService(a36_0x31117b(0x14d),ocrDefinitions),registerService(a36_0x31117b(0x151),kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x31117b(0x163)}),registerService(a36_0x31117b(0x13f),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x31117b(0x168),cliSkillDefinitions,{'defaultCommand':a36_0x31117b(0x166)}),registerService(a36_0x31117b(0x16a),[updateDefinition],{'defaultCommand':a36_0x31117b(0x159),'isSingleCommand':!![]}),registerService(a36_0x31117b(0x13e),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x31117b(0x14e),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x31117b(0x14c),logsDefinitions,{'defaultCommand':a36_0x31117b(0x14a)});export function findDefinition(_0x376e65,_0x47490c){const _0x946905=a36_0x31117b;return definitions[_0x946905(0x15f)](_0x376e65+':'+_0x47490c);}export function isKnownService(_0x2be3d1){const _0x216b90=a36_0x31117b;return serviceByName[_0x216b90(0x146)](_0x2be3d1);}export function getServiceEntry(_0x33cce0){const _0x583014=a36_0x31117b;return serviceByName[_0x583014(0x15f)](_0x33cce0);}export function getAllDefinitions(){const _0x3c8b2d=a36_0x31117b;return Array[_0x3c8b2d(0x153)](definitions[_0x3c8b2d(0x167)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a37_0x35da(_0x588ec2,_0x3d970c){_0x588ec2=_0x588ec2-0xf2;const _0x1dab63=a37_0x1dab();let _0x35dacd=_0x1dab63[_0x588ec2];return _0x35dacd;}function a37_0x1dab(){const _0x5dca4f=['280767CQoySf','2020mAQGdv','2191625foNhpi','4437OybKGT','schema','export','28sTxVun','15070ubcLfS','8510dMWwRf','8728zpIBiE','1460515PEyHzY','1609392RYyZXk','read','604LbDyzC'];a37_0x1dab=function(){return _0x5dca4f;};return a37_0x1dab();}const a37_0x83dc07=a37_0x35da;(function(_0x4c709e,_0x43f378){const _0x37ecb4=a37_0x35da,_0x51264c=_0x4c709e();while(!![]){try{const _0x4f4def=parseInt(_0x37ecb4(0xf2))/0x1*(-parseInt(_0x37ecb4(0xfe))/0x2)+-parseInt(_0x37ecb4(0xff))/0x3*(-parseInt(_0x37ecb4(0xf7))/0x4)+parseInt(_0x37ecb4(0xf3))/0x5+-parseInt(_0x37ecb4(0xfc))/0x6+-parseInt(_0x37ecb4(0xfb))/0x7+-parseInt(_0x37ecb4(0xfa))/0x8*(parseInt(_0x37ecb4(0xf4))/0x9)+-parseInt(_0x37ecb4(0xf9))/0xa*(-parseInt(_0x37ecb4(0xf8))/0xb);if(_0x4f4def===_0x43f378)break;else _0x51264c['push'](_0x51264c['shift']());}catch(_0x159d3a){_0x51264c['push'](_0x51264c['shift']());}}}(a37_0x1dab,0x9aeaa));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1f0f52){const _0xf08fdf=await buildSchemaPayload();return{'ok':!![],'data':_0xf08fdf};}export const schemaDefinition={'service':a37_0x83dc07(0xf5),'command':a37_0x83dc07(0xf6),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a37_0x83dc07(0xfd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xcf2a27,_0x1be363){const _0x17a60b=a38_0xd068,_0x17009c=_0xcf2a27();while(!![]){try{const _0x27f4ca=-parseInt(_0x17a60b(0x130))/0x1+parseInt(_0x17a60b(0x149))/0x2*(parseInt(_0x17a60b(0x151))/0x3)+parseInt(_0x17a60b(0x176))/0x4+-parseInt(_0x17a60b(0x150))/0x5*(-parseInt(_0x17a60b(0x17b))/0x6)+-parseInt(_0x17a60b(0x170))/0x7+-parseInt(_0x17a60b(0x135))/0x8+parseInt(_0x17a60b(0x12f))/0x9;if(_0x27f4ca===_0x1be363)break;else _0x17009c['push'](_0x17009c['shift']());}catch(_0x21d5b9){_0x17009c['push'](_0x17009c['shift']());}}}(a38_0x58e8,0x7fd58));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';function a38_0xd068(_0x43e997,_0x5047fe){_0x43e997=_0x43e997-0x11a;const _0x58e864=a38_0x58e8();let _0xd068d4=_0x58e864[_0x43e997];return _0xd068d4;}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x11e05c,_0x1dd20c){const _0xa3f930=a38_0xd068,_0x391576=listLocalServiceTrees();let _0x4c4c6e;for(const _0x41b514 of _0x391576){const _0xb43d22=matchServiceTreeCommand(_0x41b514,_0x11e05c);if(!_0xb43d22)continue;(!_0x4c4c6e||_0xb43d22[_0xa3f930(0x174)][_0xa3f930(0x159)]['length']>_0x4c4c6e[_0xa3f930(0x174)]['fullPath'][_0xa3f930(0x145)])&&(_0x4c4c6e={'tree':_0x41b514,'command':_0xb43d22[_0xa3f930(0x174)],'remainingArgs':_0xb43d22[_0xa3f930(0x13e)]});}if(!_0x4c4c6e)return undefined;const _0x1811ee={..._0x1dd20c};return applyAppBinding(_0x4c4c6e['tree'],_0x4c4c6e[_0xa3f930(0x174)],_0x1811ee),{'definition':buildDynamicCommandDefinition(_0x4c4c6e[_0xa3f930(0x120)],_0x4c4c6e['command']),'args':_0x4c4c6e[_0xa3f930(0x13e)],'flags':_0x1811ee,'tree':_0x4c4c6e['tree'],'command':_0x4c4c6e['command']};}export function generateDynamicServiceHelp(_0x24d451){const _0x170ebf=a38_0xd068,_0x1b219d=listLocalServiceTrees()['find'](_0x579889=>_0x579889[_0x170ebf(0x167)][_0x170ebf(0x137)]===_0x24d451);if(!_0x1b219d)return undefined;const _0x308cd3=[CLI_BIN_NAME+'\x20'+_0x24d451+_0x170ebf(0x169),'',_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x156)]||_0x24d451,_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]?'\x20\x20'+_0x1b219d[_0x170ebf(0x167)][_0x170ebf(0x141)]:'','',_0x170ebf(0x15a),..._0x1b219d['commands'][_0x170ebf(0x11e)](_0x9297ad=>{const _0x31e3d4=_0x170ebf,_0x32a77e=_0x9297ad[_0x31e3d4(0x159)][_0x31e3d4(0x124)](0x1)[_0x31e3d4(0x165)]('\x20'),_0x387782=_0x9297ad[_0x31e3d4(0x13c)]===_0x31e3d4(0x12a)?'':'\x20['+_0x9297ad['risk']+']';return'\x20\x20'+_0x32a77e['padEnd'](0x18)+'\x20'+(_0x9297ad[_0x31e3d4(0x141)]||'')+_0x387782;}),'','Use\x20`'+CLI_BIN_NAME+_0x170ebf(0x123)+_0x24d451+'`\x20to\x20inspect\x20the\x20manifest.'][_0x170ebf(0x133)](Boolean);return _0x308cd3[_0x170ebf(0x165)]('\x0a');}export function listDynamicServiceEntries(){const _0x2827da=a38_0xd068;return listLocalServices()[_0x2827da(0x11e)](_0x49a736=>{const _0xe0a92a=_0x2827da,_0x52faa9=_0x49a736[_0xe0a92a(0x11a)];return{'service':_0x52faa9['service']['code'],'label':_0x52faa9['service']['name']||_0x52faa9[_0xe0a92a(0x167)][_0xe0a92a(0x137)],'commands':_0x52faa9[_0xe0a92a(0x11f)]['map'](_0x36e22a=>({'command':dynamicCommandName(_0x36e22a),'description':_0x36e22a[_0xe0a92a(0x141)]||_0xe0a92a(0x16e)+_0x36e22a[_0xe0a92a(0x178)],'tag':riskTag(_0x36e22a['risk'])}))};});}export function getDynamicServiceEntry(_0x2f7555){const _0x38ed3a=a38_0xd068;return listDynamicServiceEntries()['find'](_0x14188a=>_0x14188a[_0x38ed3a(0x167)]===_0x2f7555);}export function listDynamicServiceDefinitions(_0x1c7d43){const _0x492e38=a38_0xd068;return listLocalServiceTrees()[_0x492e38(0x133)](_0x5b0ae3=>!_0x1c7d43||_0x5b0ae3[_0x492e38(0x167)]['code']===_0x1c7d43)[_0x492e38(0x14b)](_0x3f24a7=>_0x3f24a7[_0x492e38(0x11f)][_0x492e38(0x11e)](_0x5c99a3=>buildDynamicCommandDefinition(_0x3f24a7,_0x5c99a3)));}export function getDynamicServiceDefinitions(_0x3570f9){const _0x3dbe76=listDynamicServiceDefinitions(_0x3570f9);return _0x3dbe76['length']>0x0?_0x3dbe76:undefined;}export function findDynamicServiceDefinition(_0x452785,_0x4d1bab){const _0xc17b92=a38_0xd068;return listDynamicServiceDefinitions(_0x452785)[_0xc17b92(0x138)](_0x5c2d95=>_0x5c2d95[_0xc17b92(0x174)]===_0x4d1bab);}export function buildDynamicCommandDefinition(_0x41e88b,_0x3a4a9f){const _0x23bd5c=a38_0xd068;return{'service':_0x41e88b[_0x23bd5c(0x167)][_0x23bd5c(0x137)],'command':dynamicCommandName(_0x3a4a9f),'description':_0x3a4a9f[_0x23bd5c(0x141)]||_0x23bd5c(0x16e)+_0x3a4a9f[_0x23bd5c(0x178)],'risk':_0x3a4a9f[_0x23bd5c(0x13c)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3a4a9f['args']['map'](_0x5cafd8=>({'name':_0x5cafd8[_0x23bd5c(0x156)],'description':_0x5cafd8[_0x23bd5c(0x141)]||_0x5cafd8[_0x23bd5c(0x156)],'required':_0x5cafd8[_0x23bd5c(0x142)]})),'flags':_0x3a4a9f[_0x23bd5c(0x13d)][_0x23bd5c(0x11e)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3a4a9f),async 'dryRun'(_0x54f568){const _0x268949=_0x23bd5c,_0x4e9953=await compilePlan(_0x3a4a9f,_0x54f568);return{'method':_0x268949(0x136),'url':_0x3a4a9f['cliPath'],'body':{'target':targetPreview(_0x4e9953),'params':_0x4e9953['params']},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x3a4a9f['cliPath']};},async 'execute'(_0x5aeee2){const _0x31ef3f=_0x23bd5c,_0x5a5cbe=await compilePlan(_0x3a4a9f,_0x5aeee2),_0x2323ca=Date[_0x31ef3f(0x166)](),_0x442398=await executePlan(_0x5a5cbe,_0x3a4a9f,_0x5aeee2),_0x2ace76=Date[_0x31ef3f(0x166)]()-_0x2323ca;return{'ok':!![],'data':{'service':_0x41e88b['service'],'command':_0x3a4a9f['cliPath'],'target':targetPreview(_0x5a5cbe),'result':_0x442398,'elapsed':_0x2ace76},'message':_0x31ef3f(0x15b)+_0x3a4a9f[_0x31ef3f(0x178)]+'\x20completed\x20in\x20'+_0x2ace76+'ms'};}};}function dynamicCommandName(_0x16ffbc){const _0x3f7876=a38_0xd068;return _0x16ffbc[_0x3f7876(0x159)][_0x3f7876(0x124)](0x1)[_0x3f7876(0x165)]('\x20');}function riskTag(_0x39d6cc){return _0x39d6cc==='read'?'':'\x20\x20['+_0x39d6cc+']';}function flagToCommandFlag(_0x1996f8){const _0x2542e7=a38_0xd068;return{'name':_0x1996f8[_0x2542e7(0x121)],'type':_0x1996f8[_0x2542e7(0x143)]===_0x2542e7(0x144)?_0x2542e7(0x11d):_0x1996f8[_0x2542e7(0x143)],'description':_0x1996f8[_0x2542e7(0x141)]||_0x1996f8['name'],'required':_0x1996f8[_0x2542e7(0x142)],'default':isPrimitiveFlagDefault(_0x1996f8[_0x2542e7(0x14e)])?_0x1996f8[_0x2542e7(0x14e)]:undefined,'enum':_0x1996f8[_0x2542e7(0x171)]};}async function compilePlan(_0x560f0c,_0x234d5d){return compileServiceTreeCommand(_0x560f0c,{'flags':_0x234d5d['rawFlags'],'args':_0x234d5d['args'],'context':await buildServiceContext(_0x560f0c,_0x234d5d)});}async function buildServiceContext(_0x5e7a5a,_0x116b81){const _0x29bc0b=a38_0xd068,_0x2c96ce={'appCode':_0x116b81[_0x29bc0b(0x16d)],'env':_0x116b81[_0x29bc0b(0x153)],'envName':_0x116b81[_0x29bc0b(0x153)]};if(!usesRuntimeContext(_0x5e7a5a))return _0x2c96ce;const _0x3d7a62=await getLoginUserInfo(),_0x119f36=pickFirst(_0x3d7a62[_0x29bc0b(0x162)],_0x3d7a62['id']);return{..._0x2c96ce,'user':_0x3d7a62,'userId':_0x119f36,'id':_0x3d7a62['id'],'username':pickFirst(_0x3d7a62[_0x29bc0b(0x152)],_0x3d7a62[_0x29bc0b(0x131)],_0x3d7a62[_0x29bc0b(0x14d)]),'userName':_0x3d7a62['userName'],'nickname':pickFirst(_0x3d7a62[_0x29bc0b(0x12d)],_0x3d7a62[_0x29bc0b(0x140)]),'nickName':_0x3d7a62[_0x29bc0b(0x140)],'tenantCode':_0x3d7a62[_0x29bc0b(0x15c)],'employeeId':_0x3d7a62[_0x29bc0b(0x163)]};}function usesRuntimeContext(_0x58fe99){const _0x85bdfd=a38_0xd068;return _0x58fe99[_0x85bdfd(0x164)][_0x85bdfd(0x128)](_0x38e783=>typeof _0x38e783[_0x85bdfd(0x158)]===_0x85bdfd(0x11d)&&(_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14c))||_0x38e783[_0x85bdfd(0x158)][_0x85bdfd(0x15d)](_0x85bdfd(0x14f))));}function pickFirst(..._0x27b75f){const _0x18703f=a38_0xd068;return _0x27b75f[_0x18703f(0x138)](_0x148557=>_0x148557!==undefined&&_0x148557!==null);}async function executePlan(_0x53737f,_0x2e1cba,_0x518f30){const _0x558827=a38_0xd068;if(_0x53737f['kind']===_0x558827(0x177)){const _0x24e447=await resolveDatasetCode(_0x53737f,_0x2e1cba,_0x518f30);return executeData(_0x24e447,_0x53737f['command'],_0x53737f[_0x558827(0x11c)]);}if(_0x53737f['kind']===_0x558827(0x155)){if(!_0x53737f[_0x558827(0x179)])throw CliErrors[_0x558827(0x134)]('Service\x20command\x20'+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x15e));return executeSdkSql(_0x53737f['sqlCode'],normalizeScalarParams(_0x53737f[_0x558827(0x11c)]));}if(_0x53737f['kind']===_0x558827(0x12b)){const _0x2528b0=_0x53737f[_0x558827(0x168)]||_0x53737f[_0x558827(0x126)]||(_0x53737f[_0x558827(0x16b)]==null?'':String(_0x53737f[_0x558827(0x16b)]));if(!_0x2528b0)throw CliErrors[_0x558827(0x134)](_0x558827(0x15b)+_0x2e1cba[_0x558827(0x178)]+_0x558827(0x172));return executeSdkBff(_0x2528b0,_0x53737f['params']);}throw CliErrors[_0x558827(0x134)](_0x558827(0x154)+_0x53737f[_0x558827(0x16a)]);}function a38_0x58e8(){const _0xa3e8f7=['default','ctx.','312105BdOLSY','166857irBLTx','username','envName','Unsupported\x20service\x20target\x20kind:\x20','sql','name','\x20\x20\x20\x20datatable:\x20','source','fullPath','Commands:','Service\x20command\x20','tenantCode','startsWith','\x20requires\x20target.sqlCode.','app','\x20\x20\x20\x20command:\x20','datatable','userId','employeeId','mapTo','join','now','service','scriptName','\x20<command>\x20[flags]','kind','bffId','\x20->\x20','appCode','Run\x20service\x20command\x20','datasetCode','6636224rSVmFt','enum','\x20requires\x20target.scriptName.','dbtableConfig','command','trim','416388KhbqBP','data','cliPath','sqlCode','appRef','30vfudPG','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','normalizedManifest','env','params','string','map','commands','tree','cliName','number','\x20service\x20detail\x20--service\x20','slice','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bffCode','Cannot\x20resolve\x20datatable\x20\x22','some','target','read','bff','\x20\x20SERVICE\x20TREE\x20TARGET','nickname','appBindings','11723247QOEqNp','306089cUoLlc','userName','push','filter','validation','863304IPWnvE','SERVICE_TREE','code','find','\x20\x20\x20\x20scriptName:\x20','Unknown\x20appRef\x20\x22','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','flags','remainingArgs','appcode','nickName','description','required','type','json','length','operator','entries','\x20\x20\x20\x20sqlCode:\x20','6pRMvHh','\x20\x20\x20\x20datasetCode:\x20','flatMap','context.','loginName'];a38_0x58e8=function(){return _0xa3e8f7;};return a38_0x58e8();}async function resolveDatasetCode(_0x7bcf29,_0x2f8ba0,_0x4a1085){const _0x54fbc7=a38_0xd068;if(_0x7bcf29[_0x54fbc7(0x16f)])return _0x7bcf29[_0x54fbc7(0x16f)];if(!_0x7bcf29[_0x54fbc7(0x161)])throw CliErrors[_0x54fbc7(0x134)]('Service\x20command\x20'+_0x2f8ba0[_0x54fbc7(0x178)]+_0x54fbc7(0x17c));const _0x4bda95=await listDatasets(_0x4a1085[_0x54fbc7(0x16d)]),_0x5140f2=_0x4bda95[_0x54fbc7(0x138)](_0x1f457d=>_0x1f457d[_0x54fbc7(0x173)]?.['tableName']===_0x7bcf29[_0x54fbc7(0x161)]);if(!_0x5140f2?.[_0x54fbc7(0x137)])throw CliErrors[_0x54fbc7(0x134)](_0x54fbc7(0x127)+_0x7bcf29['datatable']+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4a1085[_0x54fbc7(0x16d)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x5140f2[_0x54fbc7(0x137)];}function applyAppBinding(_0x396c9a,_0x418395,_0x1bdc73){const _0x401efc=a38_0xd068,_0x35cf35=_0x418395[_0x401efc(0x129)][_0x401efc(0x17a)];if(!_0x35cf35)return;const _0x52c134=_0x396c9a[_0x401efc(0x12e)][_0x35cf35];if(!_0x52c134)throw CliErrors['validation'](_0x401efc(0x13a)+_0x35cf35+'\x22\x20in\x20service\x20command\x20'+_0x418395[_0x401efc(0x178)]+'.',_0x401efc(0x125));const _0xddaa30=_0x52c134['appcode']||_0x52c134[_0x401efc(0x16d)];_0xddaa30&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x13f)]=_0xddaa30),_0x52c134['app']&&!hasText(_0x1bdc73['app'])&&!hasText(_0x1bdc73[_0x401efc(0x13f)])&&(_0x1bdc73[_0x401efc(0x15f)]=_0x52c134[_0x401efc(0x15f)]),_0x52c134[_0x401efc(0x11b)]&&!hasText(_0x1bdc73[_0x401efc(0x11b)])&&(_0x1bdc73[_0x401efc(0x11b)]=_0x52c134[_0x401efc(0x11b)]);}function renderDynamicCommandHelp(_0xc37e63){const _0x4af61e=a38_0xd068,_0x1c28b2=[_0x4af61e(0x12c),_0x4af61e(0x13b)+_0xc37e63['target'][_0x4af61e(0x16a)],_0x4af61e(0x160)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x174)]];if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x14a)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x16f)]);if(_0xc37e63['target'][_0x4af61e(0x161)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x157)+_0xc37e63['target'][_0x4af61e(0x161)]);if(_0xc37e63['target'][_0x4af61e(0x179)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x148)+_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x179)]);if(_0xc37e63[_0x4af61e(0x129)][_0x4af61e(0x168)])_0x1c28b2[_0x4af61e(0x132)](_0x4af61e(0x139)+_0xc37e63['target'][_0x4af61e(0x168)]);if(_0xc37e63[_0x4af61e(0x164)][_0x4af61e(0x145)]>0x0){_0x1c28b2[_0x4af61e(0x132)]('','\x20\x20MAP\x20TO');for(const _0x3419ea of _0xc37e63[_0x4af61e(0x164)]){_0x1c28b2['push']('\x20\x20\x20\x20'+(_0x3419ea[_0x4af61e(0x158)]||'const')+_0x4af61e(0x16c)+_0x3419ea[_0x4af61e(0x129)]+(_0x3419ea[_0x4af61e(0x146)]?'.'+_0x3419ea[_0x4af61e(0x146)]:''));}}return _0x1c28b2[_0x4af61e(0x165)]('\x0a');}function targetPreview(_0x313576){const _0x59cceb=a38_0xd068;return{'kind':_0x313576[_0x59cceb(0x16a)],'command':_0x313576['command'],'appRef':_0x313576['appRef'],'datasetCode':_0x313576[_0x59cceb(0x16f)],'datatable':_0x313576[_0x59cceb(0x161)],'sqlCode':_0x313576[_0x59cceb(0x179)],'bffCode':_0x313576[_0x59cceb(0x126)],'bffId':_0x313576[_0x59cceb(0x16b)],'scriptName':_0x313576['scriptName']};}function normalizeScalarParams(_0xc612ec){const _0x2f26cd=a38_0xd068;return Object['fromEntries'](Object[_0x2f26cd(0x147)](_0xc612ec)['filter'](([,_0x3b3ac2])=>typeof _0x3b3ac2==='string'||typeof _0x3b3ac2===_0x2f26cd(0x122)));}function hasText(_0x185573){const _0x3835ce=a38_0xd068;return typeof _0x185573==='string'&&_0x185573[_0x3835ce(0x175)]()[_0x3835ce(0x145)]>0x0;}function isPrimitiveFlagDefault(_0x35bdfa){const _0x1c8c86=a38_0xd068;return _0x35bdfa===undefined||typeof _0x35bdfa===_0x1c8c86(0x11d)||typeof _0x35bdfa===_0x1c8c86(0x122)||typeof _0x35bdfa==='boolean';}
|
|
1
|
+
(function(_0x5892f5,_0x381e8a){const _0x278247=a38_0x54d5,_0x4f8e7f=_0x5892f5();while(!![]){try{const _0x434914=-parseInt(_0x278247(0x140))/0x1+-parseInt(_0x278247(0x162))/0x2*(-parseInt(_0x278247(0x12d))/0x3)+parseInt(_0x278247(0x160))/0x4+-parseInt(_0x278247(0x136))/0x5*(-parseInt(_0x278247(0x16a))/0x6)+parseInt(_0x278247(0x14b))/0x7+-parseInt(_0x278247(0x126))/0x8+-parseInt(_0x278247(0x105))/0x9;if(_0x434914===_0x381e8a)break;else _0x4f8e7f['push'](_0x4f8e7f['shift']());}catch(_0x4860b4){_0x4f8e7f['push'](_0x4f8e7f['shift']());}}}(a38_0x18df,0xc57f0));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(_0x5ed988,_0x4b6b30){const _0x3cc9be=a38_0x54d5,_0x4a7578=listLocalServiceTrees();let _0x52f08d;for(const _0x4638f5 of _0x4a7578){const _0x2302ea=matchServiceTreeCommand(_0x4638f5,_0x5ed988);if(!_0x2302ea)continue;(!_0x52f08d||_0x2302ea['command']['fullPath'][_0x3cc9be(0x138)]>_0x52f08d[_0x3cc9be(0x10f)]['fullPath'][_0x3cc9be(0x138)])&&(_0x52f08d={'tree':_0x4638f5,'command':_0x2302ea['command'],'remainingArgs':_0x2302ea[_0x3cc9be(0x15a)]});}if(!_0x52f08d)return undefined;const _0x443d0e={..._0x4b6b30};return applyAppBinding(_0x52f08d[_0x3cc9be(0x13c)],_0x52f08d[_0x3cc9be(0x10f)],_0x443d0e),{'definition':buildDynamicCommandDefinition(_0x52f08d[_0x3cc9be(0x13c)],_0x52f08d[_0x3cc9be(0x10f)]),'args':_0x52f08d[_0x3cc9be(0x15a)],'flags':_0x443d0e,'tree':_0x52f08d[_0x3cc9be(0x13c)],'command':_0x52f08d['command']};}export function generateDynamicServiceHelp(_0x4022d3){const _0x18503e=a38_0x54d5,_0x285dcc=listLocalServiceTrees()[_0x18503e(0x10a)](_0x13e85e=>_0x13e85e[_0x18503e(0x135)][_0x18503e(0x14f)]===_0x4022d3);if(!_0x285dcc)return undefined;const _0x3676c3=[CLI_BIN_NAME+'\x20'+_0x4022d3+_0x18503e(0x146),'',_0x285dcc['service'][_0x18503e(0x115)]||_0x4022d3,_0x285dcc['service'][_0x18503e(0x111)]?'\x20\x20'+_0x285dcc[_0x18503e(0x135)][_0x18503e(0x111)]:'','',_0x18503e(0x116),..._0x285dcc[_0x18503e(0x142)]['map'](_0x1b2f70=>{const _0xc835f7=_0x18503e,_0x384483=_0x1b2f70['fullPath'][_0xc835f7(0x144)](0x1)[_0xc835f7(0x11b)]('\x20'),_0x4a751e=_0x1b2f70[_0xc835f7(0x158)]===_0xc835f7(0x129)?'':'\x20['+_0x1b2f70['risk']+']';return'\x20\x20'+_0x384483[_0xc835f7(0x132)](0x18)+'\x20'+(_0x1b2f70[_0xc835f7(0x111)]||'')+_0x4a751e;}),'',_0x18503e(0x108)+CLI_BIN_NAME+_0x18503e(0x151)+_0x4022d3+'`\x20to\x20inspect\x20the\x20manifest.']['filter'](Boolean);return _0x3676c3['join']('\x0a');}export function listDynamicServiceEntries(){const _0x1fcbfe=a38_0x54d5;return listLocalServices()[_0x1fcbfe(0x10b)](_0x2f08a3=>{const _0x192c2f=_0x1fcbfe,_0x5e9df7=_0x2f08a3[_0x192c2f(0x110)];return{'service':_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x14f)],'label':_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x115)]||_0x5e9df7[_0x192c2f(0x135)][_0x192c2f(0x14f)],'commands':_0x5e9df7[_0x192c2f(0x142)][_0x192c2f(0x10b)](_0x3761b8=>({'command':dynamicCommandName(_0x3761b8),'description':_0x3761b8['description']||_0x192c2f(0x109)+_0x3761b8[_0x192c2f(0x125)],'tag':riskTag(_0x3761b8['risk'])}))};});}export function getDynamicServiceEntry(_0x140c36){const _0x147393=a38_0x54d5;return listDynamicServiceEntries()[_0x147393(0x10a)](_0x41d915=>_0x41d915[_0x147393(0x135)]===_0x140c36);}export function listDynamicServiceDefinitions(_0x2aa775){const _0x4fc263=a38_0x54d5;return listLocalServiceTrees()[_0x4fc263(0x133)](_0x5d5c17=>!_0x2aa775||_0x5d5c17[_0x4fc263(0x135)][_0x4fc263(0x14f)]===_0x2aa775)[_0x4fc263(0x11f)](_0x453d13=>_0x453d13['commands'][_0x4fc263(0x10b)](_0x840235=>buildDynamicCommandDefinition(_0x453d13,_0x840235)));}export function getDynamicServiceDefinitions(_0x4de172){const _0x1f551d=a38_0x54d5,_0x1c7801=listDynamicServiceDefinitions(_0x4de172);return _0x1c7801[_0x1f551d(0x138)]>0x0?_0x1c7801:undefined;}export function findDynamicServiceDefinition(_0x25ce7f,_0x3c3179){const _0x587acb=a38_0x54d5;return listDynamicServiceDefinitions(_0x25ce7f)['find'](_0x1f3a81=>_0x1f3a81[_0x587acb(0x10f)]===_0x3c3179);}export function buildDynamicCommandDefinition(_0x2ac700,_0x40b063){const _0x16dd5f=a38_0x54d5;return{'service':_0x2ac700[_0x16dd5f(0x135)]['code'],'command':dynamicCommandName(_0x40b063),'description':_0x40b063[_0x16dd5f(0x111)]||_0x16dd5f(0x109)+_0x40b063['cliPath'],'risk':_0x40b063[_0x16dd5f(0x158)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x40b063[_0x16dd5f(0x14c)][_0x16dd5f(0x10b)](_0x20eb9c=>({'name':_0x20eb9c[_0x16dd5f(0x115)],'description':_0x20eb9c['description']||_0x20eb9c['name'],'required':_0x20eb9c[_0x16dd5f(0x141)]})),'flags':_0x40b063[_0x16dd5f(0x10d)][_0x16dd5f(0x10b)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x40b063),async 'dryRun'(_0x31e5ff){const _0x475c05=_0x16dd5f,_0x1e87b0=await compilePlan(_0x40b063,_0x31e5ff);return{'method':'SERVICE_TREE','url':_0x40b063[_0x475c05(0x125)],'body':{'target':targetPreview(_0x1e87b0),'params':_0x1e87b0[_0x475c05(0x137)]},'description':_0x475c05(0x131)+_0x40b063[_0x475c05(0x125)]};},async 'execute'(_0x372893){const _0x3dd261=_0x16dd5f,_0x4de7a2=await compilePlan(_0x40b063,_0x372893),_0x37f5ef=Date[_0x3dd261(0x164)](),_0x3d352b=await executePlan(_0x4de7a2,_0x40b063,_0x372893),_0x175c03=Date['now']()-_0x37f5ef;return{'ok':!![],'data':{'service':_0x2ac700[_0x3dd261(0x135)],'command':_0x40b063[_0x3dd261(0x125)],'target':targetPreview(_0x4de7a2),'result':_0x3d352b,'elapsed':_0x175c03},'message':_0x3dd261(0x148)+_0x40b063[_0x3dd261(0x125)]+_0x3dd261(0x159)+_0x175c03+'ms'};}};}function dynamicCommandName(_0x4dc1bd){const _0x359bc1=a38_0x54d5;return _0x4dc1bd[_0x359bc1(0x12c)][_0x359bc1(0x144)](0x1)[_0x359bc1(0x11b)]('\x20');}function riskTag(_0x1eacbd){const _0x34615d=a38_0x54d5;return _0x1eacbd===_0x34615d(0x129)?'':'\x20\x20['+_0x1eacbd+']';}function flagToCommandFlag(_0x4b2057){const _0x4eb672=a38_0x54d5;return{'name':_0x4b2057['cliName'],'type':_0x4b2057[_0x4eb672(0x119)]===_0x4eb672(0x112)?_0x4eb672(0x14a):_0x4b2057[_0x4eb672(0x119)],'description':_0x4b2057[_0x4eb672(0x111)]||_0x4b2057[_0x4eb672(0x115)],'required':_0x4b2057[_0x4eb672(0x141)],'default':isPrimitiveFlagDefault(_0x4b2057[_0x4eb672(0x155)])?_0x4b2057['default']:undefined,'enum':_0x4b2057[_0x4eb672(0x139)]};}async function compilePlan(_0x57898f,_0x150c37){const _0x10e4e9=a38_0x54d5;return compileServiceTreeCommand(_0x57898f,{'flags':_0x150c37['rawFlags'],'args':_0x150c37[_0x10e4e9(0x14c)],'context':await buildServiceContext(_0x57898f,_0x150c37)});}async function buildServiceContext(_0x40c775,_0x414df8){const _0x3ddf78=a38_0x54d5,_0x141df9={'appCode':_0x414df8['appCode'],'env':_0x414df8['envName'],'envName':_0x414df8[_0x3ddf78(0x169)]};if(!usesRuntimeContext(_0x40c775))return _0x141df9;const _0x37dcdf=await getLoginUserInfo(),_0x5666a5=pickFirst(_0x37dcdf[_0x3ddf78(0x11d)],_0x37dcdf['id']);return{..._0x141df9,'user':_0x37dcdf,'userId':_0x5666a5,'id':_0x37dcdf['id'],'username':pickFirst(_0x37dcdf[_0x3ddf78(0x166)],_0x37dcdf['userName'],_0x37dcdf['loginName']),'userName':_0x37dcdf[_0x3ddf78(0x106)],'nickname':pickFirst(_0x37dcdf[_0x3ddf78(0x153)],_0x37dcdf[_0x3ddf78(0x11e)]),'nickName':_0x37dcdf[_0x3ddf78(0x11e)],'tenantCode':_0x37dcdf[_0x3ddf78(0x121)],'employeeId':_0x37dcdf['employeeId']};}function usesRuntimeContext(_0x11eab4){const _0x10f386=a38_0x54d5;return _0x11eab4[_0x10f386(0x13e)][_0x10f386(0x11a)](_0x21000b=>typeof _0x21000b[_0x10f386(0x163)]===_0x10f386(0x14a)&&(_0x21000b[_0x10f386(0x163)][_0x10f386(0x123)](_0x10f386(0x14d))||_0x21000b[_0x10f386(0x163)]['startsWith'](_0x10f386(0x130))));}function pickFirst(..._0x420c05){const _0x2076bf=a38_0x54d5;return _0x420c05[_0x2076bf(0x10a)](_0x4aec48=>_0x4aec48!==undefined&&_0x4aec48!==null);}async function executePlan(_0x49af86,_0x2b0144,_0x3910a8){const _0xe6d8c=a38_0x54d5;if(_0x49af86[_0xe6d8c(0x15e)]==='data'){const _0x1c6ecd=await resolveDatasetCode(_0x49af86,_0x2b0144,_0x3910a8);return executeData(_0x1c6ecd,_0x49af86[_0xe6d8c(0x10f)],_0x49af86[_0xe6d8c(0x137)]);}if(_0x49af86[_0xe6d8c(0x15e)]==='sql'){if(!_0x49af86['sqlCode'])throw CliErrors[_0xe6d8c(0x147)]('Service\x20command\x20'+_0x2b0144['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x49af86[_0xe6d8c(0x118)],normalizeScalarParams(_0x49af86['params']));}if(_0x49af86[_0xe6d8c(0x15e)]===_0xe6d8c(0x15c)){const _0xf0908e=_0x49af86['scriptName']||_0x49af86[_0xe6d8c(0x157)]||(_0x49af86[_0xe6d8c(0x127)]==null?'':String(_0x49af86[_0xe6d8c(0x127)]));if(!_0xf0908e)throw CliErrors[_0xe6d8c(0x147)]('Service\x20command\x20'+_0x2b0144[_0xe6d8c(0x125)]+_0xe6d8c(0x156));return executeSdkBff(_0xf0908e,_0x49af86['params']);}throw CliErrors[_0xe6d8c(0x147)](_0xe6d8c(0x152)+_0x49af86['kind']);}async function resolveDatasetCode(_0x16c542,_0x443c62,_0x43c2b0){const _0x5da2c2=a38_0x54d5;if(_0x16c542[_0x5da2c2(0x15f)])return _0x16c542[_0x5da2c2(0x15f)];if(!_0x16c542[_0x5da2c2(0x120)])throw CliErrors[_0x5da2c2(0x147)](_0x5da2c2(0x148)+_0x443c62['cliPath']+_0x5da2c2(0x15b));const _0x506164=await listDatasets(_0x43c2b0[_0x5da2c2(0x167)]),_0x7148f6=_0x506164[_0x5da2c2(0x10a)](_0x2d04a7=>_0x2d04a7[_0x5da2c2(0x12b)]?.[_0x5da2c2(0x13b)]===_0x16c542[_0x5da2c2(0x120)]);if(!_0x7148f6?.[_0x5da2c2(0x14f)])throw CliErrors['validation']('Cannot\x20resolve\x20datatable\x20\x22'+_0x16c542[_0x5da2c2(0x120)]+_0x5da2c2(0x12f)+_0x43c2b0[_0x5da2c2(0x167)]+'.',_0x5da2c2(0x13a));return _0x7148f6[_0x5da2c2(0x14f)];}function applyAppBinding(_0x42fa35,_0x1c675b,_0x56cd72){const _0x4013ae=a38_0x54d5,_0x3002f0=_0x1c675b[_0x4013ae(0x113)][_0x4013ae(0x10c)];if(!_0x3002f0)return;const _0x121057=_0x42fa35[_0x4013ae(0x114)][_0x3002f0];if(!_0x121057)throw CliErrors[_0x4013ae(0x147)](_0x4013ae(0x11c)+_0x3002f0+_0x4013ae(0x149)+_0x1c675b['cliPath']+'.',_0x4013ae(0x154));const _0x595331=_0x121057[_0x4013ae(0x12e)]||_0x121057[_0x4013ae(0x167)];_0x595331&&!hasText(_0x56cd72[_0x4013ae(0x12e)])&&(_0x56cd72['appcode']=_0x595331),_0x121057['app']&&!hasText(_0x56cd72[_0x4013ae(0x122)])&&!hasText(_0x56cd72[_0x4013ae(0x12e)])&&(_0x56cd72['app']=_0x121057['app']),_0x121057[_0x4013ae(0x15d)]&&!hasText(_0x56cd72[_0x4013ae(0x15d)])&&(_0x56cd72[_0x4013ae(0x15d)]=_0x121057[_0x4013ae(0x15d)]);}function renderDynamicCommandHelp(_0x135291){const _0x1d2633=a38_0x54d5,_0x41a426=[_0x1d2633(0x145),_0x1d2633(0x165)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15e)],_0x1d2633(0x168)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x10f)]];if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15f)])_0x41a426['push'](_0x1d2633(0x143)+_0x135291[_0x1d2633(0x113)][_0x1d2633(0x15f)]);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x120)])_0x41a426[_0x1d2633(0x13f)](_0x1d2633(0x150)+_0x135291['target']['datatable']);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x118)])_0x41a426[_0x1d2633(0x13f)]('\x20\x20\x20\x20sqlCode:\x20'+_0x135291[_0x1d2633(0x113)]['sqlCode']);if(_0x135291[_0x1d2633(0x113)][_0x1d2633(0x124)])_0x41a426[_0x1d2633(0x13f)]('\x20\x20\x20\x20scriptName:\x20'+_0x135291['target'][_0x1d2633(0x124)]);if(_0x135291[_0x1d2633(0x13e)][_0x1d2633(0x138)]>0x0){_0x41a426[_0x1d2633(0x13f)]('',_0x1d2633(0x12a));for(const _0x5bd2cb of _0x135291['mapTo']){_0x41a426[_0x1d2633(0x13f)](_0x1d2633(0x107)+(_0x5bd2cb[_0x1d2633(0x163)]||_0x1d2633(0x14e))+_0x1d2633(0x117)+_0x5bd2cb[_0x1d2633(0x113)]+(_0x5bd2cb[_0x1d2633(0x161)]?'.'+_0x5bd2cb[_0x1d2633(0x161)]:''));}}return _0x41a426[_0x1d2633(0x11b)]('\x0a');}function targetPreview(_0x95ec94){const _0x11c357=a38_0x54d5;return{'kind':_0x95ec94[_0x11c357(0x15e)],'command':_0x95ec94[_0x11c357(0x10f)],'appRef':_0x95ec94[_0x11c357(0x10c)],'datasetCode':_0x95ec94[_0x11c357(0x15f)],'datatable':_0x95ec94[_0x11c357(0x120)],'sqlCode':_0x95ec94[_0x11c357(0x118)],'bffCode':_0x95ec94[_0x11c357(0x157)],'bffId':_0x95ec94['bffId'],'scriptName':_0x95ec94[_0x11c357(0x124)]};}function normalizeScalarParams(_0x252e02){const _0x33d9e4=a38_0x54d5;return Object['fromEntries'](Object[_0x33d9e4(0x128)](_0x252e02)['filter'](([,_0x206975])=>typeof _0x206975==='string'||typeof _0x206975===_0x33d9e4(0x10e)));}function hasText(_0x780333){const _0x36eeda=a38_0x54d5;return typeof _0x780333==='string'&&_0x780333[_0x36eeda(0x13d)]()[_0x36eeda(0x138)]>0x0;}function a38_0x54d5(_0x3c1574,_0x574771){_0x3c1574=_0x3c1574-0x105;const _0x18dfb5=a38_0x18df();let _0x54d50f=_0x18dfb5[_0x3c1574];return _0x54d50f;}function isPrimitiveFlagDefault(_0x411927){const _0x4f1201=a38_0x54d5;return _0x411927===undefined||typeof _0x411927===_0x4f1201(0x14a)||typeof _0x411927===_0x4f1201(0x10e)||typeof _0x411927===_0x4f1201(0x134);}function a38_0x18df(){const _0x158c7e=['\x20requires\x20target.scriptName.','bffCode','risk','\x20completed\x20in\x20','remainingArgs','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bff','env','kind','datasetCode','1725244osWtvM','operator','1454974KDHJur','source','now','\x20\x20\x20\x20kind:\x20\x20\x20\x20','username','appCode','\x20\x20\x20\x20command:\x20','envName','4218006GIsjAo','7028271GywGfW','userName','\x20\x20\x20\x20','Use\x20`','Run\x20service\x20command\x20','find','map','appRef','flags','number','command','normalizedManifest','description','json','target','appBindings','name','Commands:','\x20->\x20','sqlCode','type','some','join','Unknown\x20appRef\x20\x22','userId','nickName','flatMap','datatable','tenantCode','app','startsWith','scriptName','cliPath','351560MKTHkY','bffId','entries','read','\x20\x20MAP\x20TO','dbtableConfig','fullPath','3WRAUQx','appcode','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','ctx.','Preview\x20dynamic\x20service\x20command:\x20','padEnd','filter','boolean','service','5OvmpIV','params','length','enum','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','tableName','tree','trim','mapTo','push','753429rypOwB','required','commands','\x20\x20\x20\x20datasetCode:\x20','slice','\x20\x20SERVICE\x20TREE\x20TARGET','\x20<command>\x20[flags]','validation','Service\x20command\x20','\x22\x20in\x20service\x20command\x20','string','3678066pokGjX','args','context.','const','code','\x20\x20\x20\x20datatable:\x20','\x20service\x20detail\x20--service\x20','Unsupported\x20service\x20target\x20kind:\x20','nickname','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','default'];a38_0x18df=function(){return _0x158c7e;};return a38_0x18df();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x1ffdfd=a39_0x3f62;(function(_0xdb86ee,_0x54cacf){const _0x40dcec=a39_0x3f62,_0x10b2b0=_0xdb86ee();while(!![]){try{const _0x583122=-parseInt(_0x40dcec(0xd2))/0x1*(parseInt(_0x40dcec(0xc2))/0x2)+-parseInt(_0x40dcec(0xb3))/0x3*(-parseInt(_0x40dcec(0xc9))/0x4)+parseInt(_0x40dcec(0xac))/0x5*(parseInt(_0x40dcec(0xa8))/0x6)+parseInt(_0x40dcec(0xe0))/0x7+parseInt(_0x40dcec(0xb2))/0x8+parseInt(_0x40dcec(0xc1))/0x9+-parseInt(_0x40dcec(0xc4))/0xa;if(_0x583122===_0x54cacf)break;else _0x10b2b0['push'](_0x10b2b0['shift']());}catch(_0x4043f9){_0x10b2b0['push'](_0x10b2b0['shift']());}}}(a39_0x1b43,0x3ec34));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x1ffdfd(0xab),'type':a39_0x1ffdfd(0xa4),'required':!![],'description':a39_0x1ffdfd(0xdb)},SERVICE_FLAG={'name':a39_0x1ffdfd(0xae),'type':a39_0x1ffdfd(0xa4),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x1ffdfd(0xc3)}};function summarizeService(_0xb921de){const _0x5b2eca=a39_0x1ffdfd;return{'serviceCode':_0xb921de['serviceCode'],'name':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xae)][_0x5b2eca(0xb6)],'version':_0xb921de[_0x5b2eca(0xc8)],'importedAt':_0xb921de[_0x5b2eca(0xe4)],'source':_0xb921de[_0x5b2eca(0xb4)],'commandCount':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xd9)][_0x5b2eca(0xcd)],'commands':_0xb921de[_0x5b2eca(0xa2)][_0x5b2eca(0xd9)]['map'](_0x15a71e=>({'path':_0x15a71e[_0x5b2eca(0xb9)],'description':_0x15a71e[_0x5b2eca(0xdd)],'risk':_0x15a71e[_0x5b2eca(0xc7)],'target':_0x15a71e[_0x5b2eca(0xce)],'flags':_0x15a71e['flags'][_0x5b2eca(0xb7)](_0x140fe6=>({'name':_0x140fe6['name'],'cliName':_0x140fe6['cliName'],'type':_0x140fe6[_0x5b2eca(0xda)],'required':_0x140fe6[_0x5b2eca(0xd3)]===!![]}))}))};}function a39_0x1b43(){const _0x2a074e=['6LqysBC','Imported\x20','Service\x20manifest\x20validation\x20passed.','file','1383240YEWGkM','Updated','service','write','imported','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','3789096fZHTXp','415137oIwoFb','source','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','name','map','serviceCount','cliPath','\x20service(s).','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','validate','registryServiceCode','list','errors','remove','3083274XaGPky','107412RADRgg','lower\x20kebab-case\x20service\x20code','13859680Hadzhq','filePath','manifests','risk','version','8LnFPAK','serviceCode','kind','\x20service(s),\x20updated\x20','length','target','read','reduce','export','2MkfYrD','required','hash','updated','str','registry','import','commands','type','Service\x20Tree\x20manifest\x20file\x20path','registryPath','description','entry','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','2665789fPJJEV','\x20service\x20','replaced','warnings','importedAt','Removed\x20service\x20','normalizedManifest','entries','string','report','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Imported'];a39_0x1b43=function(){return _0x2a074e;};return a39_0x1b43();}function summarizeLoadedManifest(_0x4cda39){const _0x249cf4=a39_0x1ffdfd;return{'service':_0x4cda39[_0x249cf4(0xa2)]?.['service'],'version':_0x4cda39['normalizedManifest']?.['version'],'commandCount':_0x4cda39[_0x249cf4(0xa2)]?.['commands']['length']??0x0,'commands':_0x4cda39[_0x249cf4(0xa2)]?.['commands'][_0x249cf4(0xb7)](_0x4a47f4=>({'path':_0x4a47f4[_0x249cf4(0xb9)],'risk':_0x4a47f4[_0x249cf4(0xc7)],'target':_0x4a47f4[_0x249cf4(0xce)]}))??[],'registryIndex':_0x4cda39['registryIndex'],'registryServiceCode':_0x4cda39[_0x249cf4(0xbd)],'errors':_0x4cda39[_0x249cf4(0xa5)][_0x249cf4(0xbf)],'warnings':_0x4cda39['report'][_0x249cf4(0xe3)]};}function a39_0x3f62(_0x43d994,_0x35e545){_0x43d994=_0x43d994-0xa2;const _0x1b4309=a39_0x1b43();let _0x3f62c2=_0x1b4309[_0x43d994];return _0x3f62c2;}export const serviceDefinitions=[{'service':'service','command':a39_0x1ffdfd(0xbc),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x48e5db){const _0x13f246=a39_0x1ffdfd,_0x21e635=loadServiceManifestFromFile(_0x48e5db[_0x13f246(0xd6)](_0x13f246(0xab)));if(!_0x21e635[_0x13f246(0xa5)]['ok'])return{'ok':![],'data':{'file':_0x21e635[_0x13f246(0xc5)],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635[_0x13f246(0xcb)],'serviceCount':_0x21e635[_0x13f246(0xc6)]['length'],'services':_0x21e635['manifests']['map'](summarizeLoadedManifest),'errors':_0x21e635[_0x13f246(0xa5)]['errors'],'warnings':_0x21e635[_0x13f246(0xa5)]['warnings']},'message':formatValidationFailure(_0x21e635[_0x13f246(0xa5)])};if(_0x21e635[_0x13f246(0xcb)]===_0x13f246(0xd7)||_0x21e635[_0x13f246(0xc6)][_0x13f246(0xcd)]!==0x1)return{'ok':!![],'data':{'file':_0x21e635[_0x13f246(0xc5)],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635['kind'],'serviceCount':_0x21e635['manifests']['length'],'commandCount':_0x21e635[_0x13f246(0xc6)][_0x13f246(0xd0)]((_0x44a702,_0x171efd)=>_0x44a702+(_0x171efd['normalizedManifest']?.['commands'][_0x13f246(0xcd)]??0x0),0x0),'services':_0x21e635['manifests'][_0x13f246(0xb7)](summarizeLoadedManifest),'warnings':_0x21e635['report']['warnings']},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x21e635['filePath'],'hash':_0x21e635[_0x13f246(0xd4)],'kind':_0x21e635[_0x13f246(0xcb)],'service':_0x21e635[_0x13f246(0xa2)]?.['service'],'version':_0x21e635['normalizedManifest']?.[_0x13f246(0xc8)],'commandCount':_0x21e635[_0x13f246(0xa2)]?.[_0x13f246(0xd9)][_0x13f246(0xcd)]??0x0,'commands':_0x21e635[_0x13f246(0xa2)]?.[_0x13f246(0xd9)]['map'](_0x560f9c=>({'path':_0x560f9c[_0x13f246(0xb9)],'risk':_0x560f9c[_0x13f246(0xc7)],'target':_0x560f9c[_0x13f246(0xce)]})),'warnings':_0x21e635[_0x13f246(0xa5)][_0x13f246(0xe3)]},'message':_0x13f246(0xaa)};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xd8),'description':a39_0x1ffdfd(0xb5),'risk':a39_0x1ffdfd(0xaf),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x42a20e){const _0xca710c=a39_0x1ffdfd,_0x11cd3d=loadServiceManifestFromFile(_0x42a20e[_0xca710c(0xd6)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x11cd3d[_0xca710c(0xc5)],'hash':_0x11cd3d[_0xca710c(0xd4)],'kind':_0x11cd3d[_0xca710c(0xcb)],'ok':_0x11cd3d[_0xca710c(0xa5)]['ok'],'service':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xae)],'version':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xc8)],'serviceCount':_0x11cd3d[_0xca710c(0xc6)][_0xca710c(0xcd)],'services':_0x11cd3d[_0xca710c(0xc6)][_0xca710c(0xb7)](_0x323eff=>({'service':_0x323eff[_0xca710c(0xa2)]?.[_0xca710c(0xae)],'version':_0x323eff['normalizedManifest']?.[_0xca710c(0xc8)],'commandCount':_0x323eff[_0xca710c(0xa2)]?.[_0xca710c(0xd9)][_0xca710c(0xcd)]??0x0,'errors':_0x323eff[_0xca710c(0xa5)][_0xca710c(0xbf)]})),'errors':_0x11cd3d[_0xca710c(0xa5)][_0xca710c(0xbf)],'commandCount':_0x11cd3d[_0xca710c(0xa2)]?.[_0xca710c(0xd9)][_0xca710c(0xcd)]??0x0},'description':_0xca710c(0xa6)};},async 'execute'(_0x3acdad){const _0x389883=a39_0x1ffdfd,_0x7c10c7=importServiceManifest(_0x3acdad['str']('file'));if(_0x7c10c7[_0x389883(0xa3)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x7c10c7[_0x389883(0xdc)],'imported':_0x7c10c7[_0x389883(0xb0)],'updated':_0x7c10c7['updated'],'serviceCount':_0x7c10c7[_0x389883(0xb8)],'services':_0x7c10c7[_0x389883(0xa3)][_0x389883(0xb7)](summarizeService)},'message':_0x389883(0xa9)+_0x7c10c7[_0x389883(0xb0)]+_0x389883(0xcc)+_0x7c10c7['updated']+_0x389883(0xba)};return{'ok':!![],'data':{'registryPath':_0x7c10c7['registryPath'],'replaced':_0x7c10c7[_0x389883(0xe2)],'imported':_0x7c10c7[_0x389883(0xb0)],'updated':_0x7c10c7[_0x389883(0xd5)],'serviceCount':_0x7c10c7[_0x389883(0xb8)],'service':summarizeService(_0x7c10c7[_0x389883(0xde)])},'message':(_0x7c10c7[_0x389883(0xe2)]?_0x389883(0xad):_0x389883(0xa7))+_0x389883(0xe1)+_0x7c10c7[_0x389883(0xde)][_0x389883(0xca)]+'.'};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xd1),'description':a39_0x1ffdfd(0xb1),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xb844dd){const _0x2a0f86=a39_0x1ffdfd,_0x30217b=getLocalServiceEntry(_0xb844dd[_0x2a0f86(0xd6)](_0x2a0f86(0xae)));return{'method':'WRITE','url':_0xb844dd['str'](_0x2a0f86(0xab)),'body':{'service':_0xb844dd[_0x2a0f86(0xd6)](_0x2a0f86(0xae)),'found':Boolean(_0x30217b),'version':_0x30217b?.['version'],'source':_0x30217b?.[_0x2a0f86(0xb4)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x15e341){const _0x10d6d4=a39_0x1ffdfd,_0x190a77=exportServiceManifest(_0x15e341[_0x10d6d4(0xd6)](_0x10d6d4(0xae)),_0x15e341[_0x10d6d4(0xd6)](_0x10d6d4(0xab)));return{'ok':!![],'data':{'registryPath':_0x190a77['registryPath'],'file':_0x190a77[_0x10d6d4(0xc5)],'service':summarizeService(_0x190a77[_0x10d6d4(0xde)])},'message':'Exported\x20service\x20'+_0x190a77[_0x10d6d4(0xde)][_0x10d6d4(0xca)]+'.'};}},{'service':a39_0x1ffdfd(0xae),'command':a39_0x1ffdfd(0xbe),'description':a39_0x1ffdfd(0xbb),'risk':a39_0x1ffdfd(0xcf),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3f84c9=a39_0x1ffdfd,_0x1cfa37=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1cfa37['length'],'services':_0x1cfa37[_0x3f84c9(0xb7)](summarizeService)}};}},{'service':'service','command':a39_0x1ffdfd(0xc0),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x1ffdfd(0xaf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x37ae53){const _0x6e3cf2=a39_0x1ffdfd,_0x319dee=getLocalServiceEntry(_0x37ae53[_0x6e3cf2(0xd6)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x37ae53['str'](_0x6e3cf2(0xae)),'found':Boolean(_0x319dee),'version':_0x319dee?.[_0x6e3cf2(0xc8)],'source':_0x319dee?.[_0x6e3cf2(0xb4)]},'description':_0x6e3cf2(0xdf)};},async 'execute'(_0x5c91e7){const _0x49f678=a39_0x1ffdfd,_0x5844be=removeServiceManifest(_0x5c91e7[_0x49f678(0xd6)](_0x49f678(0xae)));return{'ok':!![],'data':{'registryPath':_0x5844be['registryPath'],'serviceCount':_0x5844be[_0x49f678(0xb8)],'service':summarizeService(_0x5844be[_0x49f678(0xde)])},'message':_0x49f678(0xe5)+_0x5844be[_0x49f678(0xde)][_0x49f678(0xca)]+'.'};}},{'service':'service','command':'detail','description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':a39_0x1ffdfd(0xcf),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x5bcf97){const _0xe6dcb1=a39_0x1ffdfd,_0x5d22fe=getLocalServiceEntry(_0x5bcf97[_0xe6dcb1(0xd6)](_0xe6dcb1(0xae)));if(!_0x5d22fe)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x5bcf97[_0xe6dcb1(0xd6)](_0xe6dcb1(0xae))},'message':'Local\x20service\x20not\x20found:\x20'+_0x5bcf97['str'](_0xe6dcb1(0xae))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5d22fe),'manifest':_0x5d22fe['manifest'],'normalizedManifest':_0x5d22fe[_0xe6dcb1(0xa2)]}};}}];
|
|
1
|
+
const a39_0x4298ba=a39_0x5b40;(function(_0x1ce098,_0x458a22){const _0x660e60=a39_0x5b40,_0x25aaff=_0x1ce098();while(!![]){try{const _0x3bb90e=parseInt(_0x660e60(0x16d))/0x1*(parseInt(_0x660e60(0x160))/0x2)+parseInt(_0x660e60(0x167))/0x3+-parseInt(_0x660e60(0x175))/0x4+parseInt(_0x660e60(0x15d))/0x5+-parseInt(_0x660e60(0x198))/0x6*(-parseInt(_0x660e60(0x16f))/0x7)+parseInt(_0x660e60(0x168))/0x8*(parseInt(_0x660e60(0x15a))/0x9)+-parseInt(_0x660e60(0x19b))/0xa;if(_0x3bb90e===_0x458a22)break;else _0x25aaff['push'](_0x25aaff['shift']());}catch(_0x13c7ab){_0x25aaff['push'](_0x25aaff['shift']());}}}(a39_0x55d6,0x3e106));function a39_0x55d6(){const _0x4284fb=['errors','hash','registryIndex','commands','manifest','Updated','Service\x20registry\x20validation\x20passed.','filePath','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','import','map','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','detail','WRITE','manifests','entry','entries','cliPath','registryPath','description','normalizedManifest','5322scszBN','reduce','Exported\x20service\x20','15251140KhUBkJ','report','Removed\x20service\x20','string','length','name','validate','remove','9HwQPPz','target','cliName','2307455EOBSnI','risk','Local\x20service\x20code,\x20for\x20example\x20crm','424882lzsIBk','Local\x20service\x20not\x20found:\x20','lower\x20kebab-case\x20service\x20code','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','flags','type','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','1338600qCGzAF','3645304BbFQxQ','\x20service\x20','file','source','\x20service(s),\x20updated\x20','2pfraXx','service','742SgSXuy','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','list','\x20service(s).','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registryServiceCode','411720VcOIrG','kind','imported','serviceCode','write','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','serviceCount','str','version','updated','export','warnings','replaced','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file'];a39_0x55d6=function(){return _0x4284fb;};return a39_0x55d6();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':'file','type':a39_0x4298ba(0x19e),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':'service','type':'string','required':!![],'description':a39_0x4298ba(0x15f),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x4298ba(0x162)}};function summarizeService(_0x49f5cf){const _0x186536=a39_0x4298ba;return{'serviceCode':_0x49f5cf['serviceCode'],'name':_0x49f5cf['normalizedManifest']['service'][_0x186536(0x1a0)],'version':_0x49f5cf[_0x186536(0x17d)],'importedAt':_0x49f5cf['importedAt'],'source':_0x49f5cf['source'],'commandCount':_0x49f5cf[_0x186536(0x197)][_0x186536(0x186)][_0x186536(0x19f)],'commands':_0x49f5cf[_0x186536(0x197)][_0x186536(0x186)]['map'](_0x1c91ce=>({'path':_0x1c91ce[_0x186536(0x194)],'description':_0x1c91ce[_0x186536(0x196)],'risk':_0x1c91ce['risk'],'target':_0x1c91ce[_0x186536(0x15b)],'flags':_0x1c91ce[_0x186536(0x164)][_0x186536(0x18d)](_0x2d1dac=>({'name':_0x2d1dac[_0x186536(0x1a0)],'cliName':_0x2d1dac[_0x186536(0x15c)],'type':_0x2d1dac[_0x186536(0x165)],'required':_0x2d1dac['required']===!![]}))}))};}function summarizeLoadedManifest(_0x311292){const _0x4cae2d=a39_0x4298ba;return{'service':_0x311292[_0x4cae2d(0x197)]?.[_0x4cae2d(0x16e)],'version':_0x311292['normalizedManifest']?.[_0x4cae2d(0x17d)],'commandCount':_0x311292[_0x4cae2d(0x197)]?.[_0x4cae2d(0x186)][_0x4cae2d(0x19f)]??0x0,'commands':_0x311292['normalizedManifest']?.[_0x4cae2d(0x186)]['map'](_0x1d1d81=>({'path':_0x1d1d81['cliPath'],'risk':_0x1d1d81[_0x4cae2d(0x15e)],'target':_0x1d1d81['target']}))??[],'registryIndex':_0x311292[_0x4cae2d(0x185)],'registryServiceCode':_0x311292[_0x4cae2d(0x174)],'errors':_0x311292[_0x4cae2d(0x19c)]['errors'],'warnings':_0x311292[_0x4cae2d(0x19c)][_0x4cae2d(0x180)]};}function a39_0x5b40(_0x374f91,_0x10cc7f){_0x374f91=_0x374f91-0x159;const _0x55d623=a39_0x55d6();let _0x5b4047=_0x55d623[_0x374f91];return _0x5b4047;}export const serviceDefinitions=[{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x1a1),'description':a39_0x4298ba(0x17a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x307994){const _0xbf8d5b=a39_0x4298ba,_0x3bb743=loadServiceManifestFromFile(_0x307994[_0xbf8d5b(0x17c)](_0xbf8d5b(0x16a)));if(!_0x3bb743[_0xbf8d5b(0x19c)]['ok'])return{'ok':![],'data':{'file':_0x3bb743[_0xbf8d5b(0x18a)],'hash':_0x3bb743['hash'],'kind':_0x3bb743[_0xbf8d5b(0x176)],'serviceCount':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x19f)],'services':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x18d)](summarizeLoadedManifest),'errors':_0x3bb743[_0xbf8d5b(0x19c)][_0xbf8d5b(0x183)],'warnings':_0x3bb743['report'][_0xbf8d5b(0x180)]},'message':formatValidationFailure(_0x3bb743[_0xbf8d5b(0x19c)])};if(_0x3bb743[_0xbf8d5b(0x176)]==='registry'||_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x19f)]!==0x1)return{'ok':!![],'data':{'file':_0x3bb743[_0xbf8d5b(0x18a)],'hash':_0x3bb743[_0xbf8d5b(0x184)],'kind':_0x3bb743[_0xbf8d5b(0x176)],'serviceCount':_0x3bb743['manifests'][_0xbf8d5b(0x19f)],'commandCount':_0x3bb743['manifests'][_0xbf8d5b(0x199)]((_0x3ab943,_0x33b9ec)=>_0x3ab943+(_0x33b9ec[_0xbf8d5b(0x197)]?.['commands'][_0xbf8d5b(0x19f)]??0x0),0x0),'services':_0x3bb743[_0xbf8d5b(0x191)][_0xbf8d5b(0x18d)](summarizeLoadedManifest),'warnings':_0x3bb743[_0xbf8d5b(0x19c)][_0xbf8d5b(0x180)]},'message':_0xbf8d5b(0x189)};return{'ok':!![],'data':{'file':_0x3bb743['filePath'],'hash':_0x3bb743[_0xbf8d5b(0x184)],'kind':_0x3bb743['kind'],'service':_0x3bb743['normalizedManifest']?.[_0xbf8d5b(0x16e)],'version':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x17d)],'commandCount':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x186)][_0xbf8d5b(0x19f)]??0x0,'commands':_0x3bb743[_0xbf8d5b(0x197)]?.[_0xbf8d5b(0x186)][_0xbf8d5b(0x18d)](_0x3cabc7=>({'path':_0x3cabc7[_0xbf8d5b(0x194)],'risk':_0x3cabc7[_0xbf8d5b(0x15e)],'target':_0x3cabc7[_0xbf8d5b(0x15b)]})),'warnings':_0x3bb743['report']['warnings']},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x18c),'description':a39_0x4298ba(0x18b),'risk':a39_0x4298ba(0x179),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x188906){const _0xd09e8c=a39_0x4298ba,_0x580b79=loadServiceManifestFromFile(_0x188906[_0xd09e8c(0x17c)](_0xd09e8c(0x16a)));return{'method':_0xd09e8c(0x190),'url':getServiceRegistryPath(),'body':{'file':_0x580b79[_0xd09e8c(0x18a)],'hash':_0x580b79[_0xd09e8c(0x184)],'kind':_0x580b79[_0xd09e8c(0x176)],'ok':_0x580b79['report']['ok'],'service':_0x580b79[_0xd09e8c(0x197)]?.['service'],'version':_0x580b79[_0xd09e8c(0x197)]?.['version'],'serviceCount':_0x580b79[_0xd09e8c(0x191)]['length'],'services':_0x580b79[_0xd09e8c(0x191)][_0xd09e8c(0x18d)](_0x1032f7=>({'service':_0x1032f7['normalizedManifest']?.[_0xd09e8c(0x16e)],'version':_0x1032f7[_0xd09e8c(0x197)]?.[_0xd09e8c(0x17d)],'commandCount':_0x1032f7[_0xd09e8c(0x197)]?.[_0xd09e8c(0x186)][_0xd09e8c(0x19f)]??0x0,'errors':_0x1032f7[_0xd09e8c(0x19c)][_0xd09e8c(0x183)]})),'errors':_0x580b79[_0xd09e8c(0x19c)][_0xd09e8c(0x183)],'commandCount':_0x580b79[_0xd09e8c(0x197)]?.[_0xd09e8c(0x186)][_0xd09e8c(0x19f)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x3bc0f3){const _0x4f23f8=a39_0x4298ba,_0x22b5e6=importServiceManifest(_0x3bc0f3[_0x4f23f8(0x17c)](_0x4f23f8(0x16a)));if(_0x22b5e6[_0x4f23f8(0x193)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x22b5e6[_0x4f23f8(0x195)],'imported':_0x22b5e6[_0x4f23f8(0x177)],'updated':_0x22b5e6[_0x4f23f8(0x17e)],'serviceCount':_0x22b5e6[_0x4f23f8(0x17b)],'services':_0x22b5e6[_0x4f23f8(0x193)][_0x4f23f8(0x18d)](summarizeService)},'message':'Imported\x20'+_0x22b5e6[_0x4f23f8(0x177)]+_0x4f23f8(0x16c)+_0x22b5e6[_0x4f23f8(0x17e)]+_0x4f23f8(0x172)};return{'ok':!![],'data':{'registryPath':_0x22b5e6['registryPath'],'replaced':_0x22b5e6['replaced'],'imported':_0x22b5e6[_0x4f23f8(0x177)],'updated':_0x22b5e6[_0x4f23f8(0x17e)],'serviceCount':_0x22b5e6['serviceCount'],'service':summarizeService(_0x22b5e6[_0x4f23f8(0x192)])},'message':(_0x22b5e6[_0x4f23f8(0x181)]?_0x4f23f8(0x188):'Imported')+_0x4f23f8(0x169)+_0x22b5e6['entry'][_0x4f23f8(0x178)]+'.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x17f),'description':a39_0x4298ba(0x182),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x235a94){const _0x52be32=a39_0x4298ba,_0x4403c5=getLocalServiceEntry(_0x235a94[_0x52be32(0x17c)](_0x52be32(0x16e)));return{'method':'WRITE','url':_0x235a94['str'](_0x52be32(0x16a)),'body':{'service':_0x235a94['str'](_0x52be32(0x16e)),'found':Boolean(_0x4403c5),'version':_0x4403c5?.[_0x52be32(0x17d)],'source':_0x4403c5?.[_0x52be32(0x16b)]},'description':_0x52be32(0x166)};},async 'execute'(_0x451b3e){const _0xf5cb1c=a39_0x4298ba,_0x38b860=exportServiceManifest(_0x451b3e[_0xf5cb1c(0x17c)](_0xf5cb1c(0x16e)),_0x451b3e[_0xf5cb1c(0x17c)]('file'));return{'ok':!![],'data':{'registryPath':_0x38b860[_0xf5cb1c(0x195)],'file':_0x38b860['filePath'],'service':summarizeService(_0x38b860['entry'])},'message':_0xf5cb1c(0x19a)+_0x38b860[_0xf5cb1c(0x192)][_0xf5cb1c(0x178)]+'.'};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x171),'description':a39_0x4298ba(0x173),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x58243f=a39_0x4298ba,_0x33e700=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x33e700['length'],'services':_0x33e700[_0x58243f(0x18d)](summarizeService)}};}},{'service':a39_0x4298ba(0x16e),'command':a39_0x4298ba(0x159),'description':a39_0x4298ba(0x18e),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x191baa){const _0x145316=a39_0x4298ba,_0x32c793=getLocalServiceEntry(_0x191baa[_0x145316(0x17c)](_0x145316(0x16e)));return{'method':_0x145316(0x190),'url':getServiceRegistryPath(),'body':{'service':_0x191baa[_0x145316(0x17c)]('service'),'found':Boolean(_0x32c793),'version':_0x32c793?.['version'],'source':_0x32c793?.[_0x145316(0x16b)]},'description':_0x145316(0x170)};},async 'execute'(_0x17a72d){const _0x4f53da=a39_0x4298ba,_0x3e74c4=removeServiceManifest(_0x17a72d['str'](_0x4f53da(0x16e)));return{'ok':!![],'data':{'registryPath':_0x3e74c4[_0x4f53da(0x195)],'serviceCount':_0x3e74c4[_0x4f53da(0x17b)],'service':summarizeService(_0x3e74c4['entry'])},'message':_0x4f53da(0x19d)+_0x3e74c4[_0x4f53da(0x192)][_0x4f53da(0x178)]+'.'};}},{'service':'service','command':a39_0x4298ba(0x18f),'description':a39_0x4298ba(0x163),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x365b45){const _0x282926=a39_0x4298ba,_0x60940d=getLocalServiceEntry(_0x365b45[_0x282926(0x17c)]('service'));if(!_0x60940d)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x365b45['str']('service')},'message':_0x282926(0x161)+_0x365b45[_0x282926(0x17c)](_0x282926(0x16e))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x60940d),'manifest':_0x60940d[_0x282926(0x187)],'normalizedManifest':_0x60940d[_0x282926(0x197)]}};}}];
|