@lovrabet/lovrabet-cli 2.1.11-beta.2 → 2.1.11
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/rate-limit.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/lossless-json.js +1 -0
- 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_0x83b06f=a30_0x3810;(function(_0x1caf4b,_0x4793c3){const _0x55f756=a30_0x3810,_0x4e57ab=_0x1caf4b();while(!![]){try{const _0x4550a5=-parseInt(_0x55f756(0x6c))/0x1+parseInt(_0x55f756(0x89))/0x2+parseInt(_0x55f756(0x72))/0x3*(-parseInt(_0x55f756(0x88))/0x4)+parseInt(_0x55f756(0x7a))/0x5+-parseInt(_0x55f756(0x7e))/0x6*(-parseInt(_0x55f756(0x7f))/0x7)+parseInt(_0x55f756(0x78))/0x8+-parseInt(_0x55f756(0x7c))/0x9;if(_0x4550a5===_0x4793c3)break;else _0x4e57ab['push'](_0x4e57ab['shift']());}catch(_0x5e8fa0){_0x4e57ab['push'](_0x4e57ab['shift']());}}}(a30_0x3fe9,0x294f9));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x3810(_0x130286,_0x6dd189){_0x130286=_0x130286-0x6b;const _0x3fe9cf=a30_0x3fe9();let _0x38107e=_0x3fe9cf[_0x130286];return _0x38107e;}function a30_0x3fe9(){const _0x26d711=['Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','appCode','filePath','Uploaded\x20file:\x20','file','validation','POST','229968BFdItt','403028BNjKaQ','string','download','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','225849zGWEGo','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Path\x20to\x20the\x20local\x20file\x20to\x20upload','File','\x20to\x20runtime\x20app\x20','path','9MulUPp','str','bool','long-term','read','description','899864bYUTFO','write','1149035WmNxfJ','Preview:\x20upload\x20','1575855TBhznA','boolean','30PMBSLO','278355IYxvbX','filepath'];a30_0x3fe9=function(){return _0x26d711;};return a30_0x3fe9();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x83b06f(0x85),'type':a30_0x83b06f(0x8a),'required':!![],'description':a30_0x83b06f(0x6e)},FILEPATH_FLAG={'name':a30_0x83b06f(0x80),'type':a30_0x83b06f(0x8a),'required':!![],'description':a30_0x83b06f(0x81)},DOWNLOAD_FLAG={'name':'download','type':a30_0x83b06f(0x7d),'description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':a30_0x83b06f(0x75),'type':a30_0x83b06f(0x7d),'description':a30_0x83b06f(0x8c)};function requireFilePath(_0xbfb8f3){const _0x29a6cd=a30_0x83b06f,_0x85e6a4=_0xbfb8f3['trim']();if(!_0x85e6a4)throw CliErrors[_0x29a6cd(0x86)]('filePath\x20is\x20required.');return _0x85e6a4;}const fileUpload={'service':a30_0x83b06f(0x85),'command':'upload','description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':a30_0x83b06f(0x79),'flags':[FILE_FLAG],async 'dryRun'(_0x523b76){const _0xf8dd0=a30_0x83b06f,_0x25e97b=requireRuntimeUploadFile(_0x523b76[_0xf8dd0(0x73)](_0xf8dd0(0x85)),'File');return dryRun(_0xf8dd0(0x87),'/client/uploadFile')['body']({'appCode':_0x523b76['appCode'],'multipart':{'file':_0x25e97b}})[_0xf8dd0(0x77)](_0xf8dd0(0x7b)+_0x25e97b['path']+_0xf8dd0(0x70)+_0x523b76[_0xf8dd0(0x82)])['build']();},async 'execute'(_0x452e38){const _0x40754e=a30_0x83b06f,_0x244cbf=requireRuntimeUploadFile(_0x452e38[_0x40754e(0x73)](_0x40754e(0x85)),_0x40754e(0x6f)),_0x50b047=await uploadRuntimeFile(_0x452e38[_0x40754e(0x82)],_0x244cbf[_0x40754e(0x71)]);return{'ok':!![],'data':_0x50b047,'message':_0x50b047[_0x40754e(0x83)]?_0x40754e(0x84)+_0x50b047[_0x40754e(0x83)]+_0x40754e(0x6d):_0x40754e(0x6b)};}},fileQueryUrl={'service':'file','command':'query-url','description':'Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','risk':a30_0x83b06f(0x76),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x1d2c5f){const _0x2d33b7=a30_0x83b06f,_0x4cafdd=requireFilePath(_0x1d2c5f['str'](_0x2d33b7(0x80))),_0xf92593=await queryRuntimeFileUrl(_0x4cafdd,{'download':_0x1d2c5f[_0x2d33b7(0x74)](_0x2d33b7(0x8b)),'longTerm':_0x1d2c5f[_0x2d33b7(0x74)](_0x2d33b7(0x75))});return{'ok':!![],'data':_0xf92593};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x2d7e72=a31_0x3995;(function(_0x1f7bf1,_0x5a3e32){const _0x257a1b=a31_0x3995,_0x15f711=_0x1f7bf1();while(!![]){try{const _0x1f9d20=parseInt(_0x257a1b(0x1e2))/0x1*(parseInt(_0x257a1b(0x1ca))/0x2)+parseInt(_0x257a1b(0x1c1))/0x3+parseInt(_0x257a1b(0x1af))/0x4+parseInt(_0x257a1b(0x1a3))/0x5*(parseInt(_0x257a1b(0x1d5))/0x6)+-parseInt(_0x257a1b(0x1ac))/0x7+-parseInt(_0x257a1b(0x1df))/0x8*(parseInt(_0x257a1b(0x1b5))/0x9)+parseInt(_0x257a1b(0x1c7))/0xa*(parseInt(_0x257a1b(0x1e4))/0xb);if(_0x1f9d20===_0x5a3e32)break;else _0x15f711['push'](_0x15f711['shift']());}catch(_0x6bd427){_0x15f711['push'](_0x15f711['shift']());}}}(a31_0x36e8,0x91afd));import{existsSync,readFileSync}from'node:fs';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';function a31_0x3995(_0x2b4270,_0x5aa708){_0x2b4270=_0x2b4270-0x1a2;const _0x36e8a5=a31_0x36e8();let _0x39950c=_0x36e8a5[_0x2b4270];return _0x39950c;}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x2d7e72(0x1d1),'type':a31_0x2d7e72(0x1ae),'description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x2d7e72(0x1cc),'type':a31_0x2d7e72(0x1ae),'description':a31_0x2d7e72(0x1dd)+DEFAULT_CONFIG_VALUES[a31_0x2d7e72(0x1cc)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2d7e72(0x1bb),'type':a31_0x2d7e72(0x1ce),'description':a31_0x2d7e72(0x1e0)+PRODUCT_CONFIG[a31_0x2d7e72(0x1b2)]+a31_0x2d7e72(0x1b6),'default':![]},{'name':a31_0x2d7e72(0x1ba),'type':a31_0x2d7e72(0x1ce),'description':a31_0x2d7e72(0x1d4),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x2d7e72(0x1ad),'type':a31_0x2d7e72(0x1ae),'description':a31_0x2d7e72(0x1cd),'required':!![]},{'name':a31_0x2d7e72(0x1d1),'type':a31_0x2d7e72(0x1ae),'description':a31_0x2d7e72(0x1b9)},{'name':a31_0x2d7e72(0x1cc),'type':a31_0x2d7e72(0x1ae),'description':a31_0x2d7e72(0x1dc),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2d7e72(0x1bb),'type':a31_0x2d7e72(0x1ce),'description':a31_0x2d7e72(0x1e0)+PRODUCT_CONFIG['newConfigFileName']+a31_0x2d7e72(0x1b6),'default':![]},{'name':a31_0x2d7e72(0x1ba),'type':a31_0x2d7e72(0x1ce),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x13f0c8){const _0x568508=a31_0x2d7e72,_0x347f6d=isNonInteractiveMode(_0x13f0c8),_0x26ef7f=_0x13f0c8['global']?_0x568508(0x1bb):_0x568508(0x1a2),_0x383cc7=resolveWriteConfigPath(_0x26ef7f);try{_0x347f6d?await runNonInteractive(_0x13f0c8,_0x383cc7):await runInteractive(_0x13f0c8,_0x383cc7);}catch(_0x1eeda3){if(_0x1eeda3 instanceof AbortPrompt)throw CliErrors[_0x568508(0x1b0)]();throw _0x1eeda3;}}function a31_0x36e8(){const _0x34993f=['Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','toLowerCase','SIGINT','68856zyXdOQ','\x20\x20config:\x20\x20','defaultApp','removeListener','app','User\x20aborted\x20prompt','20zkELOx','\x20already\x20exists.\x20Overwrite?','riskLevel','401086olMHGz','validation','env','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','boolean','log','AbortPrompt','appcode','race','\x20\x20appcode:\x20','Skip\x20confirmation\x20when\x20overwriting','355248sEHzlY','[Y/n]','entries','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','stdin','\x22.\x20Allowed:\x20','Override\x20imported\x20default\x20env','Target\x20environment\x20(default\x20','):\x20','3128TfdwlY','Write\x20to\x20global\x20(~/','question','1uKtmIU','trim','11042042WVdxeR','App\x20code','\x20init\x20—\x20Create\x20','project','10bNruwq','close','object','apiDir','includes','apps','message','parse','once','7846678LgXCpF','file','string','1390348jGNJOt','cancelled','Initialized\x20','newConfigFileName','\x20\x20default:\x20','Failed\x20to\x20parse\x20source\x20file:\x20','22545htsEwt',')\x20instead\x20of\x20project','\x20\x20env:\x20\x20\x20\x20\x20','cwd','Override\x20imported\x20default\x20appcode','yes','global','File\x20','\x0aInitialized\x20'];a31_0x36e8=function(){return _0x34993f;};return a31_0x36e8();}export async function runInitImport(_0x5ba26f){const _0x3a9054=a31_0x2d7e72,_0xbd3020=_0x5ba26f[_0x3a9054(0x1bb)]?'global':_0x3a9054(0x1a2),_0x246c63=resolveWriteConfigPath(_0xbd3020);await runFromImport(_0x5ba26f,_0x246c63);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2d7e72(0x1a6)]);async function runFromImport(_0x4331cf,_0xab6762){const _0x16d33e=a31_0x2d7e72,_0x5f17bd=resolveFilePath(_0x4331cf[_0x16d33e(0x1ad)]);if(!existsSync(_0x5f17bd))throw CliErrors[_0x16d33e(0x1cb)]('Source\x20file\x20not\x20found:\x20'+_0x5f17bd);const _0x2ffe7e=readSourceFile(_0x5f17bd),_0x329247=convertToRuntimeConfig(_0x2ffe7e);_0x4331cf[_0x16d33e(0x1d1)]&&(_0x329247[_0x16d33e(0x1d1)]=String(_0x4331cf[_0x16d33e(0x1d1)]));_0x4331cf[_0x16d33e(0x1cc)]&&(_0x329247[_0x16d33e(0x1cc)]=resolveInitEnv(_0x4331cf));if(!_0x329247[_0x16d33e(0x1d1)])throw CliErrors['validation'](_0x16d33e(0x1d8),'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`.');await writeInitConfig(_0xab6762,_0x329247,_0x4331cf),console['log']('Imported\x20from\x20'+_0x5f17bd),console[_0x16d33e(0x1cf)](_0x16d33e(0x1c2)+_0xab6762),console[_0x16d33e(0x1cf)](_0x16d33e(0x1d3)+_0x329247[_0x16d33e(0x1d1)]);if(_0x329247[_0x16d33e(0x1c3)])console['log'](_0x16d33e(0x1b3)+_0x329247[_0x16d33e(0x1c3)]);}function convertToRuntimeConfig(_0x3d0884){const _0x3576a4=a31_0x2d7e72;if(_0x3d0884[_0x3576a4(0x1a8)]&&typeof _0x3d0884[_0x3576a4(0x1a8)]===_0x3576a4(0x1a5))throw CliErrors[_0x3576a4(0x1cb)](_0x3576a4(0x1be),_0x3576a4(0x1d9));const _0x21c086={};for(const _0x2734c1 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3d0884[_0x2734c1]!==undefined&&(_0x21c086[_0x2734c1]=_0x3d0884[_0x2734c1]);}return!_0x21c086[_0x3576a4(0x1c9)]&&(_0x21c086[_0x3576a4(0x1c9)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x21c086;}async function runNonInteractive(_0x2dcb59,_0x5ac8fe){const _0x141de4=a31_0x2d7e72,_0x42abc5=_0x2dcb59[_0x141de4(0x1d1)];if(!_0x42abc5)throw CliErrors['flagMissing'](_0x141de4(0x1d1),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x131881=resolveInitEnv(_0x2dcb59);await writeInitConfig(_0x5ac8fe,{'appcode':_0x42abc5,'env':_0x131881},_0x2dcb59),console['log'](_0x141de4(0x1b1)+_0x5ac8fe),console[_0x141de4(0x1cf)]('\x20\x20appcode:\x20'+_0x42abc5),console[_0x141de4(0x1cf)](_0x141de4(0x1b7)+_0x131881);}async function runInteractive(_0xf19567,_0x2fd853){const _0x52123b=a31_0x2d7e72,_0x509cc8=loadExisting(_0x2fd853),_0x5240c5=typeof _0x509cc8?.[_0x52123b(0x1d1)]===_0x52123b(0x1ae)?_0x509cc8[_0x52123b(0x1d1)]:'',_0x134e74=resolveInitEnv(_0xf19567);console[_0x52123b(0x1cf)](CLI_BIN_NAME+_0x52123b(0x1e6)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x2fd853)&&!_0xf19567[_0x52123b(0x1ba)]){const _0x32a1c2=await promptYesNo(_0x52123b(0x1bc)+_0x2fd853+_0x52123b(0x1c8),![]);if(!_0x32a1c2){console[_0x52123b(0x1cf)]('Aborted.');return;}}const _0x3f54b5=typeof _0xf19567[_0x52123b(0x1d1)]==='string'?_0xf19567[_0x52123b(0x1d1)][_0x52123b(0x1e3)]():'';let _0x45aa4c=_0x3f54b5;!_0x45aa4c&&(_0x45aa4c=await promptInput(_0x52123b(0x1e5),_0x5240c5));if(!_0x45aa4c[_0x52123b(0x1e3)]())throw CliErrors[_0x52123b(0x1cb)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x2fd853,{'appcode':_0x45aa4c[_0x52123b(0x1e3)](),'env':_0x134e74},_0xf19567),console['log'](_0x52123b(0x1bd)+_0x2fd853),console[_0x52123b(0x1cf)](_0x52123b(0x1d3)+_0x45aa4c[_0x52123b(0x1e3)]()),console[_0x52123b(0x1cf)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x134e74);}async function writeInitConfig(_0xea7aa6,_0x100955,_0xaa6b33){const _0xcf4649=a31_0x2d7e72;let _0x2fd7f3={};existsSync(_0xea7aa6)&&!_0xaa6b33[_0xcf4649(0x1ba)]&&(_0x2fd7f3=readConfigFile(_0xea7aa6));for(const [_0x1f7476,_0x4d61df]of Object[_0xcf4649(0x1d7)](_0x100955)){_0x4d61df!==undefined&&(_0x2fd7f3[_0x1f7476]=_0x4d61df);}if(_0x2fd7f3['app'])delete _0x2fd7f3[_0xcf4649(0x1c5)];writeConfigFile(_0xea7aa6,_0x2fd7f3);}class AbortPrompt extends Error{constructor(){const _0x24157b=a31_0x2d7e72;super(_0x24157b(0x1c6)),this['name']=_0x24157b(0x1d0);}}function createSafeRl(){const _0x101306=a31_0x2d7e72,_0x376b78=createInterface({'input':process[_0x101306(0x1da)],'output':process['stdout']});let _0x46cd06;const _0x458c45=new Promise((_0x2b3599,_0x287388)=>{const _0xe396c=_0x101306;_0x46cd06=()=>{const _0x58b131=a31_0x3995;_0x46cd06&&(_0x376b78[_0x58b131(0x1c4)](_0x58b131(0x1c0),_0x46cd06),_0x46cd06=undefined);try{_0x376b78[_0x58b131(0x1a4)]();}catch{}_0x287388(new AbortPrompt());},_0x376b78[_0xe396c(0x1ab)](_0xe396c(0x1c0),_0x46cd06);}),_0x40e647=()=>{const _0x1a9ddf=_0x101306;_0x46cd06&&(_0x376b78[_0x1a9ddf(0x1c4)](_0x1a9ddf(0x1c0),_0x46cd06),_0x46cd06=undefined);try{_0x376b78['close']();}catch{}};return{'rl':_0x376b78,'abortPromise':_0x458c45,'disposeSuccess':_0x40e647};}async function promptInput(_0x26b052,_0x312aec){const {rl:_0x19fc4a,abortPromise:_0x5c9dca,disposeSuccess:_0x5248d2}=createSafeRl(),_0x44d9d2=new Promise(_0x4ca5de=>{const _0x6ae7=a31_0x3995,_0x3f6f50=_0x312aec?'\x20\x20'+_0x26b052+'\x20('+_0x312aec+_0x6ae7(0x1de):'\x20\x20'+_0x26b052+':\x20';_0x19fc4a[_0x6ae7(0x1e1)](_0x3f6f50,_0x16b309=>{const _0x5e8ae3=_0x6ae7;_0x5248d2(),_0x4ca5de(_0x16b309[_0x5e8ae3(0x1e3)]()||_0x312aec);});});return Promise['race']([_0x44d9d2,_0x5c9dca]);}async function promptYesNo(_0x2e07ff,_0x32e3cb){const _0x50a066=a31_0x2d7e72,{rl:_0x225bc2,abortPromise:_0x105bca,disposeSuccess:_0x2314e9}=createSafeRl(),_0x419068=new Promise(_0x199ba2=>{const _0x199c51=a31_0x3995,_0x5d0027=_0x32e3cb?_0x199c51(0x1d6):'[y/N]';_0x225bc2[_0x199c51(0x1e1)]('\x20\x20'+_0x2e07ff+'\x20'+_0x5d0027+':\x20',_0x5397b4=>{const _0x5c942e=_0x199c51;_0x2314e9();const _0x4b84e0=_0x5397b4[_0x5c942e(0x1e3)]()[_0x5c942e(0x1bf)]();if(_0x4b84e0==='y'||_0x4b84e0==='yes')_0x199ba2(!![]);else{if(_0x4b84e0==='n'||_0x4b84e0==='no')_0x199ba2(![]);else _0x199ba2(_0x32e3cb);}});});return Promise[_0x50a066(0x1d2)]([_0x419068,_0x105bca]);}function loadExisting(_0x1304cd){if(!existsSync(_0x1304cd))return null;return readConfigFile(_0x1304cd);}function resolveFilePath(_0x1183f0){const _0x38cc27=a31_0x2d7e72;return isAbsolute(_0x1183f0)?_0x1183f0:resolve(process[_0x38cc27(0x1b8)](),_0x1183f0);}function readSourceFile(_0x207ab1){const _0x38f43d=a31_0x2d7e72;try{const _0x37a92f=readFileSync(_0x207ab1,{'encoding':'utf8'});return JSON[_0x38f43d(0x1aa)](_0x37a92f);}catch(_0xbccf13){throw CliErrors[_0x38f43d(0x1cb)](_0x38f43d(0x1b4)+_0xbccf13[_0x38f43d(0x1a9)]);}}function resolveInitEnv(_0xd4894f){const _0x2edadf=a31_0x2d7e72,_0x12eb4a=_0xd4894f[_0x2edadf(0x1cc)];if(_0x12eb4a===undefined||_0x12eb4a==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x2edadf(0x1a7)](_0x12eb4a))throw CliErrors[_0x2edadf(0x1cb)]('Invalid\x20env\x20\x22'+_0x12eb4a+_0x2edadf(0x1db)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x12eb4a;}
|
|
1
|
+
const a31_0x1f0da8=a31_0xb451;(function(_0x1c0705,_0x577d5c){const _0xbd8632=a31_0xb451,_0x1541ef=_0x1c0705();while(!![]){try{const _0x54a1ce=-parseInt(_0xbd8632(0x1f7))/0x1*(parseInt(_0xbd8632(0x1fc))/0x2)+parseInt(_0xbd8632(0x1ec))/0x3+parseInt(_0xbd8632(0x200))/0x4+parseInt(_0xbd8632(0x1f4))/0x5+-parseInt(_0xbd8632(0x20f))/0x6+parseInt(_0xbd8632(0x226))/0x7*(-parseInt(_0xbd8632(0x217))/0x8)+-parseInt(_0xbd8632(0x215))/0x9*(-parseInt(_0xbd8632(0x202))/0xa);if(_0x54a1ce===_0x577d5c)break;else _0x1541ef['push'](_0x1541ef['shift']());}catch(_0x3e71fd){_0x1541ef['push'](_0x1541ef['shift']());}}}(a31_0x1877,0x56565));function a31_0x1877(){const _0x515030=['2920UJYSzG','global','File\x20','newConfigFileName','appcode','\x20\x20config:\x20\x20','Override\x20imported\x20default\x20appcode','parse','[Y/n]','utf8','Aborted.','app','\x20\x20default:\x20','1420404tTbDqw','close','Write\x20to\x20global\x20(~/','Target\x20environment\x20(default\x20','cwd','\x22.\x20Allowed:\x20','18144HEVlnH','string','191304Bkunce','name','trim','env','Imported\x20from\x20','Skip\x20confirmation\x20when\x20overwriting','once','stdin','\x0aInitialized\x20','AbortPrompt','Failed\x20to\x20parse\x20source\x20file:\x20','riskLevel','yes','Invalid\x20env\x20\x22','validation','154JvzKDi','cancelled','race','entries','apiDir','question','[y/N]','Usage:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','defaultApp','removeListener','881397GeYYwa','SIGINT','stdout','App\x20code\x20for\x20the\x20project','\x20\x20appcode:\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Source\x20file\x20not\x20found:\x20','message','418015dHHEjh','join','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','913HwkPIO','boolean','object','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Initialized\x20','1174YMnLcl','log','App\x20code','apps','2745256FFAhYh','file'];a31_0x1877=function(){return _0x515030;};return a31_0x1877();}import{existsSync,readFileSync}from'node:fs';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';function a31_0xb451(_0x528b16,_0x38ba61){_0x528b16=_0x528b16-0x1e7;const _0x1877af=a31_0x1877();let _0xb45191=_0x1877af[_0x528b16];return _0xb45191;}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_0x1f0da8(0x206),'type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x1ef)},{'name':'env','type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x212)+DEFAULT_CONFIG_VALUES[a31_0x1f0da8(0x21a)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x211)+PRODUCT_CONFIG[a31_0x1f0da8(0x205)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x21c),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x1f0da8(0x201),'type':a31_0x1f0da8(0x216),'description':a31_0x1f0da8(0x1e9),'required':!![]},{'name':a31_0x1f0da8(0x206),'type':'string','description':a31_0x1f0da8(0x208)},{'name':'env','type':a31_0x1f0da8(0x216),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1f0da8(0x203),'type':a31_0x1f0da8(0x1f8),'description':a31_0x1f0da8(0x211)+PRODUCT_CONFIG[a31_0x1f0da8(0x205)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x1f0da8(0x223),'type':'boolean','description':a31_0x1f0da8(0x21c),'default':![]}];export async function runInit(_0x18276d){const _0x3b9bcb=a31_0x1f0da8,_0x3e6c7a=isNonInteractiveMode(_0x18276d),_0x41e637=_0x18276d[_0x3b9bcb(0x203)]?_0x3b9bcb(0x203):'project',_0x403416=resolveWriteConfigPath(_0x41e637);try{_0x3e6c7a?await runNonInteractive(_0x18276d,_0x403416):await runInteractive(_0x18276d,_0x403416);}catch(_0x3b3ca9){if(_0x3b3ca9 instanceof AbortPrompt)throw CliErrors[_0x3b9bcb(0x227)]();throw _0x3b3ca9;}}export async function runInitImport(_0xc5e608){const _0x5f9db6=a31_0x1f0da8,_0x2cd037=_0xc5e608[_0x5f9db6(0x203)]?_0x5f9db6(0x203):'project',_0x5498db=resolveWriteConfigPath(_0x2cd037);await runFromImport(_0xc5e608,_0x5498db);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1f0da8(0x22a)]);async function runFromImport(_0x445937,_0x482d5e){const _0x1122df=a31_0x1f0da8,_0x5dd35a=resolveFilePath(_0x445937[_0x1122df(0x201)]);if(!existsSync(_0x5dd35a))throw CliErrors[_0x1122df(0x225)](_0x1122df(0x1f2)+_0x5dd35a);const _0x25492f=readSourceFile(_0x5dd35a),_0x2863ed=convertToRuntimeConfig(_0x25492f);_0x445937[_0x1122df(0x206)]&&(_0x2863ed[_0x1122df(0x206)]=String(_0x445937['appcode']));_0x445937[_0x1122df(0x21a)]&&(_0x2863ed[_0x1122df(0x21a)]=resolveInitEnv(_0x445937));if(!_0x2863ed[_0x1122df(0x206)])throw CliErrors[_0x1122df(0x225)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','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`.');await writeInitConfig(_0x482d5e,_0x2863ed,_0x445937),console['log'](_0x1122df(0x21b)+_0x5dd35a),console[_0x1122df(0x1fd)](_0x1122df(0x207)+_0x482d5e),console[_0x1122df(0x1fd)](_0x1122df(0x1f0)+_0x2863ed['appcode']);if(_0x2863ed[_0x1122df(0x1ea)])console[_0x1122df(0x1fd)](_0x1122df(0x20e)+_0x2863ed[_0x1122df(0x1ea)]);}function convertToRuntimeConfig(_0x50203f){const _0x43c06b=a31_0x1f0da8;if(_0x50203f['apps']&&typeof _0x50203f[_0x43c06b(0x1ff)]===_0x43c06b(0x1f9))throw CliErrors[_0x43c06b(0x225)](_0x43c06b(0x1f1),_0x43c06b(0x1fa));const _0x1ed044={};for(const _0x89179e of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x50203f[_0x89179e]!==undefined&&(_0x1ed044[_0x89179e]=_0x50203f[_0x89179e]);}return!_0x1ed044[_0x43c06b(0x222)]&&(_0x1ed044[_0x43c06b(0x222)]=DEFAULT_CONFIG_VALUES[_0x43c06b(0x222)]),_0x1ed044;}async function runNonInteractive(_0x19123c,_0x21d5ea){const _0x5105ce=a31_0x1f0da8,_0x340bf2=_0x19123c[_0x5105ce(0x206)];if(!_0x340bf2)throw CliErrors['flagMissing'](_0x5105ce(0x206),_0x5105ce(0x1e8)+CLI_BIN_NAME+_0x5105ce(0x1f6));const _0x3b157b=resolveInitEnv(_0x19123c);await writeInitConfig(_0x21d5ea,{'appcode':_0x340bf2,'env':_0x3b157b},_0x19123c),console['log'](_0x5105ce(0x1fb)+_0x21d5ea),console[_0x5105ce(0x1fd)](_0x5105ce(0x1f0)+_0x340bf2),console[_0x5105ce(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x3b157b);}async function runInteractive(_0x1e74c8,_0x1c3bd4){const _0x2269fc=a31_0x1f0da8,_0xbfa3bd=loadExisting(_0x1c3bd4),_0x42c419=typeof _0xbfa3bd?.[_0x2269fc(0x206)]===_0x2269fc(0x216)?_0xbfa3bd['appcode']:'',_0x35d8f6=resolveInitEnv(_0x1e74c8);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x2269fc(0x205)]+'\x0a');if(existsSync(_0x1c3bd4)&&!_0x1e74c8[_0x2269fc(0x223)]){const _0x2e505e=await promptYesNo(_0x2269fc(0x204)+_0x1c3bd4+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2e505e){console[_0x2269fc(0x1fd)](_0x2269fc(0x20c));return;}}const _0x39d18e=typeof _0x1e74c8[_0x2269fc(0x206)]===_0x2269fc(0x216)?_0x1e74c8[_0x2269fc(0x206)][_0x2269fc(0x219)]():'';let _0x2759b6=_0x39d18e;!_0x2759b6&&(_0x2759b6=await promptInput(_0x2269fc(0x1fe),_0x42c419));if(!_0x2759b6[_0x2269fc(0x219)]())throw CliErrors[_0x2269fc(0x225)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x1c3bd4,{'appcode':_0x2759b6['trim'](),'env':_0x35d8f6},_0x1e74c8),console[_0x2269fc(0x1fd)](_0x2269fc(0x21f)+_0x1c3bd4),console[_0x2269fc(0x1fd)](_0x2269fc(0x1f0)+_0x2759b6[_0x2269fc(0x219)]()),console[_0x2269fc(0x1fd)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x35d8f6);}async function writeInitConfig(_0x188527,_0x41812e,_0x1181d6){const _0x19a6ea=a31_0x1f0da8;let _0x8e410c={};existsSync(_0x188527)&&!_0x1181d6[_0x19a6ea(0x223)]&&(_0x8e410c=readConfigFile(_0x188527));for(const [_0x80144b,_0x14f155]of Object[_0x19a6ea(0x229)](_0x41812e)){_0x14f155!==undefined&&(_0x8e410c[_0x80144b]=_0x14f155);}if(_0x8e410c[_0x19a6ea(0x20d)])delete _0x8e410c[_0x19a6ea(0x20d)];writeConfigFile(_0x188527,_0x8e410c);}class AbortPrompt extends Error{constructor(){const _0x1aa070=a31_0x1f0da8;super('User\x20aborted\x20prompt'),this[_0x1aa070(0x218)]=_0x1aa070(0x220);}}function createSafeRl(){const _0x5e2a19=a31_0x1f0da8,_0x5caf86=createInterface({'input':process[_0x5e2a19(0x21e)],'output':process[_0x5e2a19(0x1ee)]});let _0x4e7c3a;const _0x11cdd7=new Promise((_0xd49eb5,_0x32d952)=>{const _0x3d57df=_0x5e2a19;_0x4e7c3a=()=>{const _0x1bfe16=a31_0xb451;_0x4e7c3a&&(_0x5caf86[_0x1bfe16(0x1eb)](_0x1bfe16(0x1ed),_0x4e7c3a),_0x4e7c3a=undefined);try{_0x5caf86[_0x1bfe16(0x210)]();}catch{}_0x32d952(new AbortPrompt());},_0x5caf86[_0x3d57df(0x21d)](_0x3d57df(0x1ed),_0x4e7c3a);}),_0x388cd6=()=>{const _0x211c9e=_0x5e2a19;_0x4e7c3a&&(_0x5caf86['removeListener'](_0x211c9e(0x1ed),_0x4e7c3a),_0x4e7c3a=undefined);try{_0x5caf86['close']();}catch{}};return{'rl':_0x5caf86,'abortPromise':_0x11cdd7,'disposeSuccess':_0x388cd6};}async function promptInput(_0x5cbb45,_0x6042a7){const {rl:_0x521657,abortPromise:_0x24f8c2,disposeSuccess:_0x107d3d}=createSafeRl(),_0x20606e=new Promise(_0x52fee1=>{const _0x40a454=a31_0xb451,_0x3bdacd=_0x6042a7?'\x20\x20'+_0x5cbb45+'\x20('+_0x6042a7+'):\x20':'\x20\x20'+_0x5cbb45+':\x20';_0x521657[_0x40a454(0x22b)](_0x3bdacd,_0x48d3e4=>{const _0x18dbe6=_0x40a454;_0x107d3d(),_0x52fee1(_0x48d3e4[_0x18dbe6(0x219)]()||_0x6042a7);});});return Promise['race']([_0x20606e,_0x24f8c2]);}async function promptYesNo(_0x59ccb5,_0x731dad){const _0x2c395d=a31_0x1f0da8,{rl:_0x23dab0,abortPromise:_0x465183,disposeSuccess:_0xf581f4}=createSafeRl(),_0x20d944=new Promise(_0x3147db=>{const _0x27cf1e=a31_0xb451,_0x2fdf45=_0x731dad?_0x27cf1e(0x20a):_0x27cf1e(0x1e7);_0x23dab0[_0x27cf1e(0x22b)]('\x20\x20'+_0x59ccb5+'\x20'+_0x2fdf45+':\x20',_0x28d0bb=>{const _0x392966=_0x27cf1e;_0xf581f4();const _0x4419d4=_0x28d0bb[_0x392966(0x219)]()['toLowerCase']();if(_0x4419d4==='y'||_0x4419d4===_0x392966(0x223))_0x3147db(!![]);else{if(_0x4419d4==='n'||_0x4419d4==='no')_0x3147db(![]);else _0x3147db(_0x731dad);}});});return Promise[_0x2c395d(0x228)]([_0x20d944,_0x465183]);}function loadExisting(_0x4be514){if(!existsSync(_0x4be514))return null;return readConfigFile(_0x4be514);}function resolveFilePath(_0x4534fa){const _0x118312=a31_0x1f0da8;return isAbsolute(_0x4534fa)?_0x4534fa:resolve(process[_0x118312(0x213)](),_0x4534fa);}function readSourceFile(_0x35110b){const _0x440a8f=a31_0x1f0da8;try{const _0xa2084e=readFileSync(_0x35110b,{'encoding':_0x440a8f(0x20b)});return JSON[_0x440a8f(0x209)](_0xa2084e);}catch(_0x1c0707){throw CliErrors[_0x440a8f(0x225)](_0x440a8f(0x221)+_0x1c0707[_0x440a8f(0x1f3)]);}}function resolveInitEnv(_0x3c7e84){const _0x17d130=a31_0x1f0da8,_0x5e4a06=_0x3c7e84[_0x17d130(0x21a)];if(_0x5e4a06===undefined||_0x5e4a06==='')return DEFAULT_CONFIG_VALUES[_0x17d130(0x21a)];if(!RUNTIME_ENV_VALUES['includes'](_0x5e4a06))throw CliErrors[_0x17d130(0x225)](_0x17d130(0x224)+_0x5e4a06+_0x17d130(0x214)+RUNTIME_ENV_VALUES[_0x17d130(0x1f5)](',\x20'));return _0x5e4a06;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a32_0x50180a=a32_0x170f;(function(_0x5a8e8b,_0x706ca){const _0x27964c=a32_0x170f,_0x13c0a3=_0x5a8e8b();while(!![]){try{const _0x5ad027=-parseInt(_0x27964c(0xd6))/0x1*(parseInt(_0x27964c(0xd0))/0x2)+-parseInt(_0x27964c(0xd2))/0x3+parseInt(_0x27964c(0xc4))/0x4+parseInt(_0x27964c(0xcb))/0x5*(parseInt(_0x27964c(0xe9))/0x6)+parseInt(_0x27964c(0xf4))/0x7*(-parseInt(_0x27964c(0xd4))/0x8)+parseInt(_0x27964c(0xe7))/0x9+parseInt(_0x27964c(0xbc))/0xa;if(_0x5ad027===_0x706ca)break;else _0x13c0a3['push'](_0x13c0a3['shift']());}catch(_0x38a16e){_0x13c0a3['push'](_0x13c0a3['shift']());}}}(a32_0x20d7,0x2d7e9));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_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xd5)},FILE_FLAG={'name':a32_0x50180a(0xef),'type':a32_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xf0)},QUERY_FLAG={'name':a32_0x50180a(0xb6),'type':a32_0x50180a(0xc7),'required':!![],'description':a32_0x50180a(0xe5)},TOPK_FLAG={'name':a32_0x50180a(0xe1),'type':a32_0x50180a(0xea),'description':a32_0x50180a(0xde)};function readKnowledgeFile(_0x7513fd){const _0x580970=a32_0x50180a;if(!_0x7513fd)throw CliErrors[_0x580970(0xcd)](_0x580970(0xb8));if(!existsSync(_0x7513fd))throw CliErrors[_0x580970(0xcd)]('File\x20not\x20found:\x20'+_0x7513fd);if(!statSync(_0x7513fd)[_0x580970(0xce)]())throw CliErrors['validation'](_0x580970(0xd7)+_0x7513fd);return readFileSync(_0x7513fd,_0x580970(0xf1));}function a32_0x170f(_0x422fd9,_0x9594ae){_0x422fd9=_0x422fd9-0xb6;const _0x20d736=a32_0x20d7();let _0x170ff6=_0x20d736[_0x422fd9];return _0x170ff6;}function summarizePersonalItem(_0x373fce){const _0x47aa14=a32_0x50180a;return{'id':_0x373fce['id'],'title':_0x373fce[_0x47aa14(0xe8)],'version':_0x373fce['version'],'ragStatus':_0x373fce[_0x47aa14(0xdb)],'ragErrorMessage':_0x373fce[_0x47aa14(0xd8)],'updateTime':_0x373fce[_0x47aa14(0xc6)]};}function detailPersonalItem(_0x5539db){const _0x2b2412=a32_0x50180a;return{'id':_0x5539db['id'],'appCode':_0x5539db['appCode'],'scope':_0x5539db[_0x2b2412(0xcf)],'userId':_0x5539db[_0x2b2412(0xd3)],'title':_0x5539db[_0x2b2412(0xe8)],'content':_0x5539db['content']??'','version':_0x5539db[_0x2b2412(0xcc)],'ragStatus':_0x5539db['ragStatus'],'ragErrorMessage':_0x5539db[_0x2b2412(0xd8)],'createTime':_0x5539db['createTime'],'updateTime':_0x5539db[_0x2b2412(0xc6)]};}function summarizeSearchHit(_0x257de9){const _0x3ce588=a32_0x50180a;return{'scope':_0x257de9[_0x3ce588(0xcf)],'docId':_0x257de9[_0x3ce588(0xc2)],'score':_0x257de9['score'],'weightedScore':_0x257de9[_0x3ce588(0xf3)],'content':_0x257de9[_0x3ce588(0xf2)],'metadata':_0x257de9[_0x3ce588(0xbe)]};}function readTopK(_0x508b2b){const _0x48583e=a32_0x50180a,_0x411f04=_0x508b2b[_0x48583e(0xc3)]('topk');if(_0x411f04===undefined||_0x411f04===null||_0x411f04==='')return undefined;const _0x18b19e=_0x508b2b[_0x48583e(0xec)](_0x48583e(0xe1));if(!Number[_0x48583e(0xca)](_0x18b19e)||_0x18b19e<0x1)throw CliErrors[_0x48583e(0xcd)](_0x48583e(0xc9));return _0x18b19e;}const kbList={'service':'kb','command':'list','description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x50180a(0xdc),'flags':[VERBOSE_FLAG],async 'execute'(_0x16ce8b){const _0x3f4a97=a32_0x50180a,_0x572a3b=await listPersonalKnowledgeBaseItems(_0x16ce8b[_0x3f4a97(0xe6)]);if(_0x16ce8b[_0x3f4a97(0xd1)]('verbose'))return{'ok':!![],'data':{'total':_0x572a3b[_0x3f4a97(0xb7)],'items':_0x572a3b}};return{'ok':!![],'data':{'total':_0x572a3b[_0x3f4a97(0xb7)],'items':_0x572a3b[_0x3f4a97(0xe0)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x50180a(0xbd),'description':a32_0x50180a(0xc8),'risk':a32_0x50180a(0xdc),'flags':[{...ID_FLAG,'description':a32_0x50180a(0xda)}],async 'execute'(_0x5d5aa8){const _0x3d485b=a32_0x50180a,_0x1477f9=await getPersonalKnowledgeBaseItem(_0x5d5aa8[_0x3d485b(0xec)]('id'),_0x5d5aa8[_0x3d485b(0xe6)]);return{'ok':!![],'data':detailPersonalItem(_0x1477f9)};}},kbCreate={'service':'kb','command':a32_0x50180a(0xee),'description':a32_0x50180a(0xf5),'risk':a32_0x50180a(0xba),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x3be625){const _0x1f7548=a32_0x50180a,_0x414c01=_0x3be625[_0x1f7548(0xe2)]('title'),_0x3f4c35=readKnowledgeFile(_0x3be625[_0x1f7548(0xe2)]('file')),_0x1ce6db=await createPersonalKnowledgeBaseItem(_0x3be625[_0x1f7548(0xe6)],{'title':_0x414c01,'content':_0x3f4c35});return{'ok':!![],'data':summarizePersonalItem(_0x1ce6db),'message':'Created\x20KB\x20entry\x20'+_0x1ce6db['id']+'\x20('+_0x1ce6db[_0x1f7548(0xe8)]+')'};},async 'dryRun'(_0x4fea1b){const _0x204363=a32_0x50180a,_0xc0a9ae=_0x4fea1b['str'](_0x204363(0xe8)),_0x1e43d1=readKnowledgeFile(_0x4fea1b[_0x204363(0xe2)](_0x204363(0xef)));return dryRun(_0x204363(0xbb),'/client/knowledge-base/personal/create')[_0x204363(0xdf)]({'appCode':_0x4fea1b['appCode'],'title':_0xc0a9ae,'content':_0x1e43d1})[_0x204363(0xc0)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0xc0a9ae+'\x22')[_0x204363(0xc1)]();}},kbUpdate={'service':'kb','command':a32_0x50180a(0xbf),'description':a32_0x50180a(0xeb),'risk':a32_0x50180a(0xba),'flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a32_0x50180a(0xb9)},FILE_FLAG],async 'execute'(_0x4ea1e3){const _0x4392ed=a32_0x50180a,_0x3a7b18=_0x4ea1e3[_0x4392ed(0xec)]('id'),_0x473928=readKnowledgeFile(_0x4ea1e3[_0x4392ed(0xe2)](_0x4392ed(0xef))),_0x3fef6c=_0x4ea1e3[_0x4392ed(0xe2)](_0x4392ed(0xe8))||(await getPersonalKnowledgeBaseItem(_0x3a7b18,_0x4ea1e3['appCode']))['title'],_0x2605cd=await updatePersonalKnowledgeBaseItem(_0x3a7b18,_0x4ea1e3[_0x4392ed(0xe6)],{'title':_0x3fef6c,'content':_0x473928});return{'ok':!![],'data':summarizePersonalItem(_0x2605cd),'message':_0x4392ed(0xe3)+_0x2605cd['id']+'\x20('+_0x2605cd[_0x4392ed(0xe8)]+')'};},async 'dryRun'(_0x3a0580){const _0x3e796c=a32_0x50180a,_0xf21394=_0x3a0580[_0x3e796c(0xec)]('id'),_0x2a1164=readKnowledgeFile(_0x3a0580[_0x3e796c(0xe2)](_0x3e796c(0xef))),_0x9224ca=_0x3a0580[_0x3e796c(0xe2)](_0x3e796c(0xe8))||(await getPersonalKnowledgeBaseItem(_0xf21394,_0x3a0580[_0x3e796c(0xe6)]))[_0x3e796c(0xe8)];return dryRun('POST','/client/knowledge-base/personal/'+_0xf21394+'/update')[_0x3e796c(0xdf)]({'appCode':_0x3a0580[_0x3e796c(0xe6)],'title':_0x9224ca,'content':_0x2a1164})[_0x3e796c(0xc0)](_0x3e796c(0xe4)+_0xf21394)[_0x3e796c(0xc1)]();}},kbSearch={'service':'kb','command':a32_0x50180a(0xd9),'description':a32_0x50180a(0xc5),'risk':a32_0x50180a(0xdc),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x5e6986){const _0x2691af=a32_0x50180a;if(!_0x5e6986['str']('query')[_0x2691af(0xdd)]())throw CliErrors[_0x2691af(0xcd)](_0x2691af(0xed));readTopK(_0x5e6986);},async 'execute'(_0x17c958){const _0x33fe2e=a32_0x50180a,_0xbe6efc=_0x17c958['str'](_0x33fe2e(0xb6))['trim'](),_0x5b8d98=readTopK(_0x17c958),_0x20e9a0=await searchKnowledgeBase(_0x17c958[_0x33fe2e(0xe6)],{'query':_0xbe6efc,'topK':_0x5b8d98});return{'ok':!![],'data':{'total':_0x20e9a0[_0x33fe2e(0xb7)],'hits':_0x20e9a0[_0x33fe2e(0xe0)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];function a32_0x20d7(){const _0x31bb2a=['docId','flag','449864CRWIJZ','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','updateTime','string','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','--topk\x20must\x20be\x20a\x20positive\x20number.','isFinite','1394205qEcwll','version','validation','isFile','scope','2JorefH','bool','913149PcOTRZ','userId','110392WxHDkD','Personal\x20knowledge-base\x20entry\x20title','200665zjazrR','File\x20is\x20not\x20a\x20regular\x20file:\x20','ragErrorMessage','search','Personal\x20knowledge-base\x20entry\x20ID','ragStatus','read','trim','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','body','map','topk','str','Updated\x20KB\x20entry\x20','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','appCode','979398MmGlPC','title','6NxEXCc','number','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','num','Search\x20query\x20is\x20required.','create','file','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','utf8','content','weightedScore','126ywcOBf','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','query','length','File\x20path\x20is\x20required.','Override\x20the\x20existing\x20entry\x20title','write','POST','4396460ZTWCCD','detail','metadata','update','description','build'];a32_0x20d7=function(){return _0x31bb2a;};return a32_0x20d7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0xffecae=a33_0x68cd;(function(_0x291eb3,_0x453441){const _0x8f0ad9=a33_0x68cd,_0x43b035=_0x291eb3();while(!![]){try{const _0x18b41f=-parseInt(_0x8f0ad9(0x176))/0x1+-parseInt(_0x8f0ad9(0x171))/0x2*(parseInt(_0x8f0ad9(0x179))/0x3)+-parseInt(_0x8f0ad9(0x188))/0x4+parseInt(_0x8f0ad9(0x17d))/0x5*(-parseInt(_0x8f0ad9(0x18b))/0x6)+parseInt(_0x8f0ad9(0x189))/0x7+parseInt(_0x8f0ad9(0x17e))/0x8*(parseInt(_0x8f0ad9(0x186))/0x9)+-parseInt(_0x8f0ad9(0x182))/0xa*(-parseInt(_0x8f0ad9(0x184))/0xb);if(_0x18b41f===_0x453441)break;else _0x43b035['push'](_0x43b035['shift']());}catch(_0x4497c6){_0x43b035['push'](_0x43b035['shift']());}}}(a33_0xf191,0x71711));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function a33_0xf191(){const _0x59c8ca=['success','duration','566533oacTiP','timestamp','toLocaleString','6bnxvbr','details','show','\x20\x20\x20Details:\x20','19020zaoZTz','307848mgPIDK','logs','clearLogs','write','10ARByfI','warn','16889158zJwHaY','View\x20command\x20history\x20logs','207ocyfzA','readLogs','2595280OiWpfm','934171OVfVRl','error','300DTHfil','length','clear','keys','read','log','level','*\x20Logs\x20cleared','stringify','683684dBHyZg','forEach','\x20\x20\x20Time:\x20'];a33_0xf191=function(){return _0x59c8ca;};return a33_0xf191();}function a33_0x68cd(_0x2b1c14,_0x337239){_0x2b1c14=_0x2b1c14-0x16c;const _0xf19114=a33_0xf191();let _0x68cda6=_0xf19114[_0x2b1c14];return _0x68cda6;}function printLogs(_0x40e460){const _0x304a1d=a33_0x68cd;if(_0x40e460[_0x304a1d(0x18c)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x304a1d(0x16d)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x40e460[_0x304a1d(0x172)]((_0x43ff28,_0x73b5b0)=>{const _0x336fd7=_0x304a1d,_0xdd6e9f=new Date(_0x43ff28[_0x336fd7(0x177)])[_0x336fd7(0x178)]('en-US'),_0x29a4dd=_0x43ff28[_0x336fd7(0x16e)]===_0x336fd7(0x174)?'√':_0x43ff28['level']===_0x336fd7(0x18a)?'×':_0x43ff28[_0x336fd7(0x16e)]===_0x336fd7(0x183)?'!':'i';console['log'](_0x73b5b0+0x1+'.\x20'+_0x29a4dd+'\x20['+_0x43ff28['command']+']\x20'+_0x43ff28['message']),console['log'](_0x336fd7(0x173)+_0xdd6e9f),_0x43ff28[_0x336fd7(0x175)]&&console[_0x336fd7(0x16d)]('\x20\x20\x20Duration:\x20'+_0x43ff28[_0x336fd7(0x175)]+'ms'),_0x43ff28[_0x336fd7(0x17a)]&&Object[_0x336fd7(0x18e)](_0x43ff28['details'])['length']>0x0&&console[_0x336fd7(0x16d)](_0x336fd7(0x17c)+JSON[_0x336fd7(0x170)](_0x43ff28[_0x336fd7(0x17a)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0xffecae(0x17f),'command':a33_0xffecae(0x17b),'description':a33_0xffecae(0x185),'risk':a33_0xffecae(0x16c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x444eb6){const _0x1b0ec9=a33_0xffecae;return printLogs(logger[_0x1b0ec9(0x187)]()),{'ok':!![]};}},{'service':a33_0xffecae(0x17f),'command':a33_0xffecae(0x18d),'description':'Clear\x20command\x20history\x20logs','risk':a33_0xffecae(0x181),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x29796c){const _0x37ca88=a33_0xffecae;return logger[_0x37ca88(0x180)](),console[_0x37ca88(0x16d)](_0x37ca88(0x16f)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x353f0e=a34_0x20bc;(function(_0x36c482,_0x2c3e54){const _0x55fa4b=a34_0x20bc,_0x24fc98=_0x36c482();while(!![]){try{const _0x71ece0=-parseInt(_0x55fa4b(0xb5))/0x1+-parseInt(_0x55fa4b(0xd3))/0x2+parseInt(_0x55fa4b(0xe6))/0x3+-parseInt(_0x55fa4b(0xca))/0x4*(-parseInt(_0x55fa4b(0xcf))/0x5)+parseInt(_0x55fa4b(0xd0))/0x6*(parseInt(_0x55fa4b(0xe5))/0x7)+-parseInt(_0x55fa4b(0xb3))/0x8+parseInt(_0x55fa4b(0xe1))/0x9;if(_0x71ece0===_0x2c3e54)break;else _0x24fc98['push'](_0x24fc98['shift']());}catch(_0x25faca){_0x24fc98['push'](_0x24fc98['shift']());}}}(a34_0x1d9c,0xbc6e7));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';function a34_0x20bc(_0xe84a5e,_0x2f36b3){_0xe84a5e=_0xe84a5e-0xb3;const _0x1d9ca9=a34_0x1d9c();let _0x20bc73=_0x1d9ca9[_0xe84a5e];return _0x20bc73;}const SUPPORTED_SCENES=[a34_0x353f0e(0xda),a34_0x353f0e(0xc7),a34_0x353f0e(0xe0),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x353f0e(0xb4),'general':a34_0x353f0e(0xd8),'form':'Table','idCard':'IdCard'},SCENE_FLAG={'name':a34_0x353f0e(0xbc),'type':a34_0x353f0e(0xbd),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x353f0e(0xba)},IMAGE_FILE_FLAG={'name':a34_0x353f0e(0xc6),'type':a34_0x353f0e(0xbd),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':'image-url','type':a34_0x353f0e(0xbd),'description':a34_0x353f0e(0xde)};function normalizeScene(_0x34ef94){const _0x517a61=a34_0x353f0e,_0x470ee9=_0x34ef94[_0x517a61(0xcc)]()['toLowerCase']();if(_0x470ee9===_0x517a61(0xdd))return _0x517a61(0xcd);if(_0x470ee9===_0x517a61(0xda)||_0x470ee9===_0x517a61(0xc7)||_0x470ee9===_0x517a61(0xe0))return _0x470ee9;throw CliErrors[_0x517a61(0xc0)]('Unsupported\x20OCR\x20scene:\x20'+_0x34ef94+_0x517a61(0xdb)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x1d9c(){const _0x1ad7e3=['scene','string','imageFile','/client/uploadFile','validation','\x20OCR','ocr','count','fileName','imageUrl','image-file','general','image-url','apiError','87668KCgIcD','fileUrl','trim','idCard','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','185hZpMbM','1122774FXNPfW','appCode','body','2896970emiele','/client/ocr','filePath','str','File\x20upload\x20response\x20missing\x20filePath.','General','filter','invoice','.\x20Supported\x20scenes:\x20','write','idcard','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Preview:\x20recognize\x20','form','13315851oMRVAk','build','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','<filePath\x20returned\x20by\x20/client/uploadFile>','42hKxhto','4569150DkiFdT','9702472BRWacA','Invoice','1503183JZSPXE','File\x20URL\x20response\x20missing\x20fileUrl.','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','path','/client/queryFileUrl','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','POST'];a34_0x1d9c=function(){return _0x1ad7e3;};return a34_0x1d9c();}function selectedInputs(_0x58dbb0){const _0x47ffd4=a34_0x353f0e,_0x43d0ba=_0x58dbb0[_0x47ffd4(0xd6)](_0x47ffd4(0xc6))[_0x47ffd4(0xcc)](),_0x105be3=_0x58dbb0[_0x47ffd4(0xd6)](_0x47ffd4(0xc8))[_0x47ffd4(0xcc)]();return{'imageFile':_0x43d0ba,'imageUrl':_0x105be3,'count':[_0x43d0ba,_0x105be3][_0x47ffd4(0xd9)](Boolean)['length']};}function validateInputSelection(_0x2dec04){const _0x577fbb=a34_0x353f0e,_0x5edbca=selectedInputs(_0x2dec04);if(_0x5edbca[_0x577fbb(0xc3)]!==0x1)throw CliErrors[_0x577fbb(0xc0)](_0x577fbb(0xb7));return _0x5edbca;}function withScene(_0x512173,_0x372386,_0x466087){const _0x3a6aa4=a34_0x353f0e;return{..._0x512173,'scene':_0x372386,..._0x466087?{'sourceFile':{'fileName':_0x466087[_0x3a6aa4(0xc4)],'filePath':_0x466087[_0x3a6aa4(0xd5)]}}:{}};}const ocrRecognize={'service':a34_0x353f0e(0xc2),'command':'recognize','description':a34_0x353f0e(0xce),'risk':a34_0x353f0e(0xdc),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x1e32dc){const _0x3fcb5b=a34_0x353f0e,_0xed162c=normalizeScene(_0x1e32dc['str'](_0x3fcb5b(0xbc))),_0x5b55f0=SCENE_TO_LEGACY_TYPE[_0xed162c],_0xe5541a=validateInputSelection(_0x1e32dc);if(_0xe5541a[_0x3fcb5b(0xc5)])return dryRun(_0x3fcb5b(0xbb),_0x3fcb5b(0xd4))['body']({'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'url':_0xe5541a[_0x3fcb5b(0xc5)],'type':_0x5b55f0})['description'](_0x3fcb5b(0xdf)+_0xed162c+'\x20OCR\x20from\x20URL')[_0x3fcb5b(0xe2)]();const _0x63eaea=requireRuntimeUploadFile(_0xe5541a[_0x3fcb5b(0xbe)],_0x3fcb5b(0xc6));return dryRun(_0x3fcb5b(0xbb),_0x3fcb5b(0xbf))[_0x3fcb5b(0xd2)]({'steps':[{'method':_0x3fcb5b(0xbb),'url':'/client/uploadFile','body':{'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'multipart':{'file':_0x63eaea}}},{'method':_0x3fcb5b(0xbb),'url':_0x3fcb5b(0xb9),'body':{'filePath':_0x3fcb5b(0xe4),'downloadFlag':![]}},{'method':'POST','url':_0x3fcb5b(0xd4),'body':{'appCode':_0x1e32dc[_0x3fcb5b(0xd1)],'url':_0x3fcb5b(0xe3),'type':_0x5b55f0}}]})['description']('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0xed162c+_0x3fcb5b(0xc1))['build']();},async 'execute'(_0x4a2799){const _0x25d2e1=a34_0x353f0e,_0x50e709=normalizeScene(_0x4a2799[_0x25d2e1(0xd6)](_0x25d2e1(0xbc))),_0x58ec77=SCENE_TO_LEGACY_TYPE[_0x50e709],_0x4fea07=validateInputSelection(_0x4a2799);if(_0x4fea07[_0x25d2e1(0xc5)]){const _0x5159fe=await recognizeRuntimeOcr(_0x4a2799[_0x25d2e1(0xd1)],{'url':_0x4fea07['imageUrl'],'type':_0x58ec77});return{'ok':!![],'data':withScene(_0x5159fe,_0x50e709)};}const _0x1260ec=requireRuntimeUploadFile(_0x4fea07[_0x25d2e1(0xbe)],'image-file'),_0x4dbe47=await uploadRuntimeFile(_0x4a2799[_0x25d2e1(0xd1)],_0x1260ec[_0x25d2e1(0xb8)]);if(!_0x4dbe47[_0x25d2e1(0xd5)])throw CliErrors[_0x25d2e1(0xc9)](_0x25d2e1(0xd7));const _0x4fbf9a=await queryRuntimeFileUrl(_0x4dbe47[_0x25d2e1(0xd5)],{'download':![]});if(!_0x4fbf9a[_0x25d2e1(0xcb)])throw CliErrors[_0x25d2e1(0xc9)](_0x25d2e1(0xb6));const _0xdcd57f=await recognizeRuntimeOcr(_0x4a2799[_0x25d2e1(0xd1)],{'url':_0x4fbf9a[_0x25d2e1(0xcb)],'type':_0x58ec77});return{'ok':!![],'data':withScene(_0xdcd57f,_0x50e709,_0x4dbe47)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x3b0886=a35_0x5518;(function(_0x3cf069,_0x647bb6){const _0x472721=a35_0x5518,_0x3e3f3a=_0x3cf069();while(!![]){try{const _0x10085e=parseInt(_0x472721(0x1c9))/0x1+-parseInt(_0x472721(0x1c4))/0x2*(parseInt(_0x472721(0x1ed))/0x3)+parseInt(_0x472721(0x1d2))/0x4*(-parseInt(_0x472721(0x1b1))/0x5)+parseInt(_0x472721(0x1c1))/0x6*(parseInt(_0x472721(0x1dd))/0x7)+parseInt(_0x472721(0x1d6))/0x8*(-parseInt(_0x472721(0x1c2))/0x9)+parseInt(_0x472721(0x1e0))/0xa*(-parseInt(_0x472721(0x1f0))/0xb)+parseInt(_0x472721(0x1d1))/0xc;if(_0x10085e===_0x647bb6)break;else _0x3e3f3a['push'](_0x3e3f3a['shift']());}catch(_0x53f1a4){_0x3e3f3a['push'](_0x3e3f3a['shift']());}}}(a35_0x2162,0x9a83f));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a35_0x5518(_0x394c3a,_0x3ac87d){_0x394c3a=_0x394c3a-0x1b0;const _0x21626f=a35_0x2162();let _0x55181f=_0x21626f[_0x394c3a];return _0x55181f;}import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';function a35_0x2162(){const _0x44a55c=['Updated\x20personal\x20BFF\x20','isFile','Update\x20a\x20personal\x20BFF\x20by\x20id','file','read','18utkBxg','validation','build','7997JYnYiV','File\x20is\x20not\x20a\x20regular\x20file:\x20','high-risk-write','params','3355uDRHPE','Preview:\x20update\x20personal\x20BFF\x20','num','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','flag','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','description','length','test','/client/runtime-bff/personal/create','write','File\x20path\x20is\x20required.','/update','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','update','personal-bff','6wpQfqS','117sRBhrg','create','15062jFAgEn','trim','Optional\x20source\x20RuntimeAgent\x20session\x20id','functionName','Personal\x20BFF\x20description','647173waGqkL','Personal\x20BFF\x20script\x20ID','str','string','gmtCreate','bool','source-session-id','detail','1224684rgzWKj','1780gQIcdO','version','utf8','Created\x20personal\x20BFF\x20','211952QoAgSn','scriptType','body','sourceSessionId','updateTime','createTime','appCode','6461063nHGNRo','config','/client/runtime-bff/personal/','4830PFsVXQ','gmtModified','Preview:\x20create\x20personal\x20BFF\x20','isArray','name','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','POST','scriptContent'];a35_0x2162=function(){return _0x44a55c;};return a35_0x2162();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':a35_0x3b0886(0x1cc),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x3b0886(0x1e4),'type':a35_0x3b0886(0x1cc),'required':!![],'description':'Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':a35_0x3b0886(0x1b7),'type':a35_0x3b0886(0x1cc),'description':a35_0x3b0886(0x1c8)},SOURCE_SESSION_FLAG={'name':a35_0x3b0886(0x1cf),'type':a35_0x3b0886(0x1cc),'description':a35_0x3b0886(0x1c6)};function normalizeFunctionName(_0x44b773){const _0x52cf13=a35_0x3b0886,_0x406d78=String(_0x44b773||'')[_0x52cf13(0x1c5)]();if(!_0x406d78||!FUNCTION_NAME_PATTERN[_0x52cf13(0x1b9)](_0x406d78))throw CliErrors[_0x52cf13(0x1ee)](_0x52cf13(0x1b4));return _0x406d78;}function readScriptFile(_0x3215b0){const _0xe0652e=a35_0x3b0886;if(!_0x3215b0)throw CliErrors['validation'](_0xe0652e(0x1bc));if(!existsSync(_0x3215b0))throw CliErrors[_0xe0652e(0x1ee)]('File\x20not\x20found:\x20'+_0x3215b0);if(!statSync(_0x3215b0)[_0xe0652e(0x1e9)]())throw CliErrors[_0xe0652e(0x1ee)](_0xe0652e(0x1f1)+_0x3215b0);const _0x29d9de=readFileSync(_0x3215b0,_0xe0652e(0x1d4));if(!_0x29d9de[_0xe0652e(0x1c5)]())throw CliErrors[_0xe0652e(0x1ee)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x29d9de;}function optionalTrimmed(_0x51d657){const _0x6fcd5f=a35_0x3b0886,_0x1c46f3=String(_0x51d657||'')[_0x6fcd5f(0x1c5)]();return _0x1c46f3||undefined;}function summarizeBff(_0xb344a0){const _0x5b8166=a35_0x3b0886;return{'id':_0xb344a0['id'],'appCode':_0xb344a0[_0x5b8166(0x1dc)],'functionName':_0xb344a0[_0x5b8166(0x1c7)],'description':_0xb344a0[_0x5b8166(0x1b7)],'scriptType':_0xb344a0[_0x5b8166(0x1d7)],'version':_0xb344a0[_0x5b8166(0x1d3)],'gmtModified':_0xb344a0[_0x5b8166(0x1e1)],'updateTime':_0xb344a0[_0x5b8166(0x1da)]};}function detailBff(_0x1a5368){const _0x6e1686=a35_0x3b0886;return{'id':_0x1a5368['id'],'appCode':_0x1a5368[_0x6e1686(0x1dc)],'functionName':_0x1a5368[_0x6e1686(0x1c7)],'description':_0x1a5368[_0x6e1686(0x1b7)],'scriptType':_0x1a5368[_0x6e1686(0x1d7)],'scriptContent':_0x1a5368[_0x6e1686(0x1e7)]??'','config':_0x1a5368[_0x6e1686(0x1de)],'version':_0x1a5368[_0x6e1686(0x1d3)],'createUserId':_0x1a5368['createUserId'],'gmtCreate':_0x1a5368[_0x6e1686(0x1cd)],'gmtModified':_0x1a5368['gmtModified'],'createTime':_0x1a5368[_0x6e1686(0x1db)],'updateTime':_0x1a5368[_0x6e1686(0x1da)]};}function buildCreateInput(_0x4cfc95){const _0x14cce3=a35_0x3b0886;return{'functionName':normalizeFunctionName(_0x4cfc95['str'](_0x14cce3(0x1e4))),...optionalTrimmed(_0x4cfc95['str'](_0x14cce3(0x1b7)))?{'description':optionalTrimmed(_0x4cfc95[_0x14cce3(0x1cb)](_0x14cce3(0x1b7)))}:{},'scriptContent':readScriptFile(_0x4cfc95['str'](_0x14cce3(0x1eb))),...optionalTrimmed(_0x4cfc95[_0x14cce3(0x1cb)](_0x14cce3(0x1cf)))?{'sourceSessionId':optionalTrimmed(_0x4cfc95[_0x14cce3(0x1cb)](_0x14cce3(0x1cf)))}:{}};}function buildUpdateInput(_0x2a62a0){const _0x37f6a4=a35_0x3b0886,_0x23befe={};optionalTrimmed(_0x2a62a0[_0x37f6a4(0x1cb)](_0x37f6a4(0x1e4)))&&(_0x23befe[_0x37f6a4(0x1c7)]=normalizeFunctionName(_0x2a62a0[_0x37f6a4(0x1cb)](_0x37f6a4(0x1e4))));_0x2a62a0[_0x37f6a4(0x1b5)]('description')!==undefined&&(_0x23befe[_0x37f6a4(0x1b7)]=_0x2a62a0[_0x37f6a4(0x1cb)](_0x37f6a4(0x1b7)));optionalTrimmed(_0x2a62a0[_0x37f6a4(0x1cb)]('file'))&&(_0x23befe['scriptContent']=readScriptFile(_0x2a62a0[_0x37f6a4(0x1cb)](_0x37f6a4(0x1eb))));_0x2a62a0['flag'](_0x37f6a4(0x1cf))!==undefined&&(_0x23befe[_0x37f6a4(0x1d9)]=_0x2a62a0[_0x37f6a4(0x1cb)](_0x37f6a4(0x1cf)));if(Object['keys'](_0x23befe)['length']===0x0)throw CliErrors['validation'](_0x37f6a4(0x1e5));return _0x23befe;}function parseExecParams(_0x44f396){const _0x44b62d=a35_0x3b0886,_0x430574=parseJsonParams(_0x44f396)??{};if(Array[_0x44b62d(0x1e3)](_0x430574))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x430574;}const personalBffList={'service':'personal-bff','command':'list','description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x3b0886(0x1ec),'flags':[VERBOSE_FLAG],async 'execute'(_0xd92b26){const _0x41d05d=a35_0x3b0886,_0x2a91da=await listPersonalBffs(_0xd92b26['appCode']);return{'ok':!![],'data':{'total':_0x2a91da[_0x41d05d(0x1b8)],'items':_0xd92b26[_0x41d05d(0x1ce)]('verbose')?_0x2a91da:_0x2a91da['map'](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x3b0886(0x1d0),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x3b0886(0x1ec),'flags':[{...ID_FLAG,'description':a35_0x3b0886(0x1ca)}],async 'execute'(_0x32a553){const _0x3cc71c=a35_0x3b0886,_0x57ec76=await getPersonalBff(_0x32a553[_0x3cc71c(0x1b3)]('id'),_0x32a553[_0x3cc71c(0x1dc)]);return{'ok':!![],'data':detailBff(_0x57ec76)};}},personalBffCreate={'service':a35_0x3b0886(0x1c0),'command':a35_0x3b0886(0x1c3),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x3b0886(0x1bb),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5bc469){const _0x2308c2=a35_0x3b0886,_0xc0a1e3=buildCreateInput(_0x5bc469),_0x240685=await createPersonalBff(_0x5bc469[_0x2308c2(0x1dc)],_0xc0a1e3);return{'ok':!![],'data':detailBff(_0x240685),'message':_0x2308c2(0x1d5)+_0x240685['id']+(_0x240685[_0x2308c2(0x1c7)]?'\x20('+_0x240685[_0x2308c2(0x1c7)]+')':'')};},async 'dryRun'(_0x5db697){const _0x58f320=a35_0x3b0886,_0x192b32=buildCreateInput(_0x5db697);return dryRun(_0x58f320(0x1e6),_0x58f320(0x1ba))['body']({'appCode':_0x5db697[_0x58f320(0x1dc)],..._0x192b32})[_0x58f320(0x1b7)](_0x58f320(0x1e2)+_0x192b32[_0x58f320(0x1c7)])[_0x58f320(0x1ef)]();}},personalBffUpdate={'service':a35_0x3b0886(0x1c0),'command':a35_0x3b0886(0x1bf),'description':a35_0x3b0886(0x1ea),'risk':a35_0x3b0886(0x1bb),'flags':[{...ID_FLAG,'description':a35_0x3b0886(0x1ca)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x113a6f){const _0xe38d9a=a35_0x3b0886,_0x23aa43=_0x113a6f[_0xe38d9a(0x1b3)]('id'),_0x3d3639=buildUpdateInput(_0x113a6f),_0x4135c3=await updatePersonalBff(_0x23aa43,_0x113a6f[_0xe38d9a(0x1dc)],_0x3d3639);return{'ok':!![],'data':detailBff(_0x4135c3),'message':_0xe38d9a(0x1e8)+_0x4135c3['id']+(_0x4135c3[_0xe38d9a(0x1c7)]?'\x20('+_0x4135c3[_0xe38d9a(0x1c7)]+')':'')};},async 'dryRun'(_0x33107a){const _0x527aae=a35_0x3b0886,_0x48ceb0=_0x33107a['num']('id'),_0x187111=buildUpdateInput(_0x33107a);return dryRun('POST',_0x527aae(0x1df)+_0x48ceb0+_0x527aae(0x1bd))[_0x527aae(0x1d8)]({'appCode':_0x33107a[_0x527aae(0x1dc)],..._0x187111})[_0x527aae(0x1b7)](_0x527aae(0x1b2)+_0x48ceb0)[_0x527aae(0x1ef)]();}},personalBffExec={'service':'personal-bff','command':'exec','description':a35_0x3b0886(0x1be),'risk':a35_0x3b0886(0x1f2),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0x3b0886(0x1b6)}],async 'validate'(_0x577309){const _0x30a68c=a35_0x3b0886;parseExecParams(_0x577309[_0x30a68c(0x1cb)]('params'));},async 'execute'(_0x2ef736){const _0x2a9d7f=a35_0x3b0886,_0x1b494a=_0x2ef736[_0x2a9d7f(0x1b3)]('id'),_0x2d8583=parseExecParams(_0x2ef736['str'](_0x2a9d7f(0x1b0))),_0xbcbb5f=await executePersonalBff(_0x1b494a,_0x2ef736[_0x2a9d7f(0x1dc)],_0x2d8583);return{'ok':!![],'data':{'result':_0xbcbb5f},'message':'Executed\x20personal\x20BFF\x20'+_0x1b494a};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x477128=a35_0x3073;(function(_0x5a80f5,_0x553afd){const _0x12960c=a35_0x3073,_0x3bbcdb=_0x5a80f5();while(!![]){try{const _0x4fd052=-parseInt(_0x12960c(0x1e7))/0x1+parseInt(_0x12960c(0x1d8))/0x2*(-parseInt(_0x12960c(0x1c8))/0x3)+parseInt(_0x12960c(0x1ba))/0x4+-parseInt(_0x12960c(0x1d2))/0x5+parseInt(_0x12960c(0x1d0))/0x6*(-parseInt(_0x12960c(0x1cc))/0x7)+-parseInt(_0x12960c(0x1c4))/0x8+parseInt(_0x12960c(0x1e9))/0x9*(parseInt(_0x12960c(0x1cd))/0xa);if(_0x4fd052===_0x553afd)break;else _0x3bbcdb['push'](_0x3bbcdb['shift']());}catch(_0x49b7a4){_0x3bbcdb['push'](_0x3bbcdb['shift']());}}}(a35_0x2042,0x446b5));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x2042(){const _0x45b451=['19926SxFVkU','file','1998165ofptBm','createUserId','config','utf8','body','length','22qkbuyl','source-session-id','personal-bff','--params\x20must\x20be\x20a\x20JSON\x20object.','build','createTime','/client/runtime-bff/personal/','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','gmtCreate','create','high-risk-write','Personal\x20BFF\x20script\x20file\x20is\x20blank.','isArray','sourceSessionId','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','482649mLmvCv','Show\x20one\x20personal\x20BFF\x20by\x20id','9gxlbcU','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','/client/runtime-bff/personal/create','File\x20is\x20not\x20a\x20regular\x20file:\x20','write','/update','Updated\x20personal\x20BFF\x20','POST','File\x20not\x20found:\x20','detail','list','flag','Personal\x20BFF\x20script\x20ID','functionName','validation','num','Optional\x20source\x20RuntimeAgent\x20session\x20id','name','params','updateTime','File\x20path\x20is\x20required.','1844468hQgzCp','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','verbose','str','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','scriptType','Preview:\x20create\x20personal\x20BFF\x20','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','string','appCode','3397400PMBEBT','update','version','read','32223FBiITs','Created\x20personal\x20BFF\x20','description','trim','749PcSnhV','15995830KupOrw','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Preview:\x20update\x20personal\x20BFF\x20'];a35_0x2042=function(){return _0x45b451;};return a35_0x2042();}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x477128(0x1d1),'type':a35_0x477128(0x1c2),'description':a35_0x477128(0x1c1)},FUNCTION_NAME_FLAG={'name':a35_0x477128(0x1fb),'type':a35_0x477128(0x1c2),'required':!![],'description':a35_0x477128(0x1ce)},DESCRIPTION_FLAG={'name':'description','type':a35_0x477128(0x1c2),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x477128(0x1d9),'type':a35_0x477128(0x1c2),'description':a35_0x477128(0x1fa)};function normalizeFunctionName(_0x5cf02b){const _0xcec6a2=a35_0x477128,_0x502f1a=String(_0x5cf02b||'')[_0xcec6a2(0x1cb)]();if(!_0x502f1a||!FUNCTION_NAME_PATTERN['test'](_0x502f1a))throw CliErrors['validation'](_0xcec6a2(0x1bb));return _0x502f1a;}function readScriptFile(_0x4e2055){const _0x1432f4=a35_0x477128;if(!_0x4e2055)throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1fe));if(!existsSync(_0x4e2055))throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1f2)+_0x4e2055);if(!statSync(_0x4e2055)['isFile']())throw CliErrors['validation'](_0x1432f4(0x1ed)+_0x4e2055);const _0x201c3a=readFileSync(_0x4e2055,_0x1432f4(0x1d5));if(!_0x201c3a['trim']())throw CliErrors[_0x1432f4(0x1f8)](_0x1432f4(0x1e3));return _0x201c3a;}function optionalTrimmed(_0x39e08f){const _0x58607d=a35_0x477128,_0x3b4dd9=String(_0x39e08f||'')[_0x58607d(0x1cb)]();return _0x3b4dd9||undefined;}function summarizeBff(_0x34d71b){const _0x4c6581=a35_0x477128;return{'id':_0x34d71b['id'],'appCode':_0x34d71b[_0x4c6581(0x1c3)],'functionName':_0x34d71b[_0x4c6581(0x1f7)],'description':_0x34d71b[_0x4c6581(0x1ca)],'scriptType':_0x34d71b[_0x4c6581(0x1bf)],'version':_0x34d71b['version'],'gmtModified':_0x34d71b['gmtModified'],'updateTime':_0x34d71b[_0x4c6581(0x1fd)]};}function detailBff(_0x7dc4e4){const _0x44f452=a35_0x477128;return{'id':_0x7dc4e4['id'],'appCode':_0x7dc4e4['appCode'],'functionName':_0x7dc4e4[_0x44f452(0x1f7)],'description':_0x7dc4e4[_0x44f452(0x1ca)],'scriptType':_0x7dc4e4[_0x44f452(0x1bf)],'scriptContent':_0x7dc4e4['scriptContent']??'','config':_0x7dc4e4[_0x44f452(0x1d4)],'version':_0x7dc4e4[_0x44f452(0x1c6)],'createUserId':_0x7dc4e4[_0x44f452(0x1d3)],'gmtCreate':_0x7dc4e4[_0x44f452(0x1e0)],'gmtModified':_0x7dc4e4['gmtModified'],'createTime':_0x7dc4e4[_0x44f452(0x1dd)],'updateTime':_0x7dc4e4['updateTime']};}function buildCreateInput(_0x543376){const _0x30f04e=a35_0x477128;return{'functionName':normalizeFunctionName(_0x543376[_0x30f04e(0x1bd)](_0x30f04e(0x1fb))),...optionalTrimmed(_0x543376[_0x30f04e(0x1bd)](_0x30f04e(0x1ca)))?{'description':optionalTrimmed(_0x543376[_0x30f04e(0x1bd)]('description'))}:{},'scriptContent':readScriptFile(_0x543376['str'](_0x30f04e(0x1d1))),...optionalTrimmed(_0x543376['str'](_0x30f04e(0x1d9)))?{'sourceSessionId':optionalTrimmed(_0x543376[_0x30f04e(0x1bd)]('source-session-id'))}:{}};}function buildUpdateInput(_0xf928da){const _0x2bdc72=a35_0x477128,_0x3916bb={};optionalTrimmed(_0xf928da['str']('name'))&&(_0x3916bb[_0x2bdc72(0x1f7)]=normalizeFunctionName(_0xf928da[_0x2bdc72(0x1bd)]('name')));_0xf928da[_0x2bdc72(0x1f5)](_0x2bdc72(0x1ca))!==undefined&&(_0x3916bb[_0x2bdc72(0x1ca)]=_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1ca)));optionalTrimmed(_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d1)))&&(_0x3916bb['scriptContent']=readScriptFile(_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d1))));_0xf928da[_0x2bdc72(0x1f5)](_0x2bdc72(0x1d9))!==undefined&&(_0x3916bb[_0x2bdc72(0x1e5)]=_0xf928da[_0x2bdc72(0x1bd)](_0x2bdc72(0x1d9)));if(Object['keys'](_0x3916bb)['length']===0x0)throw CliErrors[_0x2bdc72(0x1f8)](_0x2bdc72(0x1ea));return _0x3916bb;}function a35_0x3073(_0x426972,_0x2004b0){_0x426972=_0x426972-0x1ba;const _0x204257=a35_0x2042();let _0x307339=_0x204257[_0x426972];return _0x307339;}function parseExecParams(_0x44f0a6){const _0x428c63=a35_0x477128,_0xa0e4ce=parseJsonParams(_0x44f0a6)??{};if(Array[_0x428c63(0x1e4)](_0xa0e4ce))throw CliErrors['validation'](_0x428c63(0x1db));return _0xa0e4ce;}const personalBffList={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1f4),'description':a35_0x477128(0x1be),'risk':a35_0x477128(0x1c7),'flags':[VERBOSE_FLAG],async 'execute'(_0x293b4e){const _0xfbbefd=a35_0x477128,_0x46f105=await listPersonalBffs(_0x293b4e['appCode']);return{'ok':!![],'data':{'total':_0x46f105[_0xfbbefd(0x1d7)],'items':_0x293b4e['bool'](_0xfbbefd(0x1bc))?_0x46f105:_0x46f105['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1f3),'description':a35_0x477128(0x1e8),'risk':a35_0x477128(0x1c7),'flags':[{...ID_FLAG,'description':a35_0x477128(0x1f6)}],async 'execute'(_0xc15c2f){const _0x511d9a=a35_0x477128,_0x59e3a5=await getPersonalBff(_0xc15c2f['num']('id'),_0xc15c2f[_0x511d9a(0x1c3)]);return{'ok':!![],'data':detailBff(_0x59e3a5)};}},personalBffCreate={'service':a35_0x477128(0x1da),'command':a35_0x477128(0x1e1),'description':a35_0x477128(0x1e6),'risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4586e3){const _0x4f1f3f=a35_0x477128,_0x1589c6=buildCreateInput(_0x4586e3),_0x4fa999=await createPersonalBff(_0x4586e3[_0x4f1f3f(0x1c3)],_0x1589c6);return{'ok':!![],'data':detailBff(_0x4fa999),'message':_0x4f1f3f(0x1c9)+_0x4fa999['id']+(_0x4fa999[_0x4f1f3f(0x1f7)]?'\x20('+_0x4fa999[_0x4f1f3f(0x1f7)]+')':'')};},async 'dryRun'(_0x2ad33e){const _0x9f3cf9=a35_0x477128,_0xef65ba=buildCreateInput(_0x2ad33e);return dryRun(_0x9f3cf9(0x1f1),_0x9f3cf9(0x1ec))[_0x9f3cf9(0x1d6)]({'appCode':_0x2ad33e[_0x9f3cf9(0x1c3)],..._0xef65ba})[_0x9f3cf9(0x1ca)](_0x9f3cf9(0x1c0)+_0xef65ba['functionName'])[_0x9f3cf9(0x1dc)]();}},personalBffUpdate={'service':'personal-bff','command':a35_0x477128(0x1c5),'description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':a35_0x477128(0x1ee),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5cd01a){const _0x1120ef=a35_0x477128,_0x5778da=_0x5cd01a[_0x1120ef(0x1f9)]('id'),_0x4fd52e=buildUpdateInput(_0x5cd01a),_0xcc8f05=await updatePersonalBff(_0x5778da,_0x5cd01a[_0x1120ef(0x1c3)],_0x4fd52e);return{'ok':!![],'data':detailBff(_0xcc8f05),'message':_0x1120ef(0x1f0)+_0xcc8f05['id']+(_0xcc8f05[_0x1120ef(0x1f7)]?'\x20('+_0xcc8f05[_0x1120ef(0x1f7)]+')':'')};},async 'dryRun'(_0x1c11a3){const _0x5be3ae=a35_0x477128,_0x59945e=_0x1c11a3['num']('id'),_0x1593a1=buildUpdateInput(_0x1c11a3);return dryRun('POST',_0x5be3ae(0x1de)+_0x59945e+_0x5be3ae(0x1ef))[_0x5be3ae(0x1d6)]({'appCode':_0x1c11a3[_0x5be3ae(0x1c3)],..._0x1593a1})['description'](_0x5be3ae(0x1cf)+_0x59945e)[_0x5be3ae(0x1dc)]();}},personalBffExec={'service':a35_0x477128(0x1da),'command':'exec','description':a35_0x477128(0x1eb),'risk':a35_0x477128(0x1e2),'flags':[{...ID_FLAG,'description':a35_0x477128(0x1f6)},{...PARAMS_FLAG,'description':a35_0x477128(0x1df)}],async 'validate'(_0x2c29af){const _0x4b2b72=a35_0x477128;parseExecParams(_0x2c29af['str'](_0x4b2b72(0x1fc)));},async 'execute'(_0x596edb){const _0x1cbb30=a35_0x477128,_0x58180b=_0x596edb[_0x1cbb30(0x1f9)]('id'),_0x5b2730=parseExecParams(_0x596edb[_0x1cbb30(0x1bd)]('params')),_0x3872b4=await executePersonalBff(_0x58180b,_0x596edb[_0x1cbb30(0x1c3)],_0x5b2730);return{'ok':!![],'data':{'result':_0x3872b4},'message':'Executed\x20personal\x20BFF\x20'+_0x58180b};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x160942=a36_0x2138;(function(_0x109c93,_0x5dcb44){const _0x365565=a36_0x2138,_0xe5d422=_0x109c93();while(!![]){try{const _0x188aa7=parseInt(_0x365565(0xb2))/0x1+parseInt(_0x365565(0xc3))/0x2+parseInt(_0x365565(0xc1))/0x3*(-parseInt(_0x365565(0xc6))/0x4)+-parseInt(_0x365565(0xaa))/0x5*(-parseInt(_0x365565(0xa5))/0x6)+parseInt(_0x365565(0xb6))/0x7+parseInt(_0x365565(0xa6))/0x8+-parseInt(_0x365565(0xba))/0x9;if(_0x188aa7===_0x5dcb44)break;else _0xe5d422['push'](_0xe5d422['shift']());}catch(_0x58eaaf){_0xe5d422['push'](_0xe5d422['shift']());}}}(a36_0x10ff,0xda54c));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a36_0x2138(_0x154054,_0x18ddae){_0x154054=_0x154054-0xa2;const _0x10ff29=a36_0x10ff();let _0x2138ed=_0x10ff29[_0x154054];return _0x2138ed;}import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';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(_0x6dbab2){const _0x51c33a=a36_0x2138;for(const _0x4ccb71 of _0x6dbab2){definitions[_0x51c33a(0xb1)](_0x4ccb71[_0x51c33a(0xc9)]+':'+_0x4ccb71[_0x51c33a(0xa3)],_0x4ccb71);let _0x4b3578=serviceGroups[_0x51c33a(0xc4)](_0x4ccb71[_0x51c33a(0xc9)]);!_0x4b3578&&(_0x4b3578=[],serviceGroups[_0x51c33a(0xb1)](_0x4ccb71[_0x51c33a(0xc9)],_0x4b3578)),_0x4b3578[_0x51c33a(0xbe)](_0x4ccb71);}}function registerService(_0x2e0089,_0x53476e,_0xae0b17){const _0x3a9a73=a36_0x2138;registerDefinitions(_0x53476e);const _0x5d8b0c=_0x3f38e9=>_0x3f38e9===_0x3a9a73(0xaf)?'':_0x3f38e9===_0x3a9a73(0xb0)?_0x3a9a73(0xa2):'\x20\x20[high-risk-write]',_0x482340={'service':_0x53476e[0x0][_0x3a9a73(0xc9)],'label':_0x2e0089,'commands':_0x53476e['map'](_0x496719=>({'command':_0x496719[_0x3a9a73(0xa3)],'description':_0x496719[_0x3a9a73(0xc0)],'tag':_0x5d8b0c(_0x496719[_0x3a9a73(0xc5)])})),'defaultCommand':_0xae0b17?.[_0x3a9a73(0xad)]??(_0xae0b17?.[_0x3a9a73(0xb3)]?_0x53476e[0x0]['command']:undefined),'isSingleCommand':_0xae0b17?.[_0x3a9a73(0xb3)]};serviceRegistry[_0x3a9a73(0xbe)](_0x482340),serviceByName['set'](_0x482340[_0x3a9a73(0xc9)],_0x482340);}registerService('Authentication',authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x160942(0xb9),appDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService(a36_0x160942(0xab),workspaceDefinitions),registerService(a36_0x160942(0xbf),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x160942(0xa8),datasetDefinitions),registerService(a36_0x160942(0xca),dataDefinitions),registerService(a36_0x160942(0xc8),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0x160942(0xae),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x160942(0xc2),fileDefinitions),registerService(a36_0x160942(0xcb),ocrDefinitions),registerService(a36_0x160942(0xbd),kbDefinitions),registerService(a36_0x160942(0xa4),serviceDefinitions,{'defaultCommand':a36_0x160942(0xcc)}),registerService(a36_0x160942(0xbc),skillDefinitions,{'defaultCommand':a36_0x160942(0xb5)}),registerService(a36_0x160942(0xbb),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x160942(0xb7),[updateDefinition],{'defaultCommand':a36_0x160942(0xb8),'isSingleCommand':!![]}),registerService(a36_0x160942(0xac),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x160942(0xa9),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x160942(0xc7),logsDefinitions,{'defaultCommand':a36_0x160942(0xa7)});export function findDefinition(_0x5ac63c,_0x45841c){return definitions['get'](_0x5ac63c+':'+_0x45841c);}export function isKnownService(_0x5bd5b1){const _0x55a84d=a36_0x160942;return serviceByName[_0x55a84d(0xb4)](_0x5bd5b1);}export function getServiceEntry(_0x40a40c){const _0x565c93=a36_0x160942;return serviceByName[_0x565c93(0xc4)](_0x40a40c);}function a36_0x10ff(){const _0x41c17f=['38957553jJrqPF','CLI\x20Built-in\x20Skill','Skills','Knowledge\x20Base','push','Runtime\x20App\x20Config','description','12blyMWC','File','2155128nSzrRG','get','risk','925032RyjRIb','Logs','SQL\x20Queries','service','Instant\x20API','OCR','list','\x20\x20[write]','command','Service\x20Tree','10649202iCbJsy','4727776nJqhXF','show','Datasets','Schema','5tOxUpN','Workspace','Diagnostics','defaultCommand','Personal\x20BFF','read','write','set','1645913SOAdOl','isSingleCommand','has','install','7410319PsDdgG','Self\x20Update','run','App\x20Management'];a36_0x10ff=function(){return _0x41c17f;};return a36_0x10ff();}export function getAllDefinitions(){return Array['from'](definitions['values']());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x13d0b6=a37_0x7148;function a37_0x7148(_0xac95a3,_0x139e97){_0xac95a3=_0xac95a3-0xb0;const _0x4dc5a4=a37_0x4dc5();let _0x714830=_0x4dc5a4[_0xac95a3];return _0x714830;}function a37_0x4dc5(){const _0x1005d6=['909128uDJSxj','12zRaiua','871312XJLjmZ','1711962PiWRyC','2555IrmfyW','753632gqvgdk','1650777UzeSsu','1533300sdmTjt','schema','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','84iQqtKX','3516uxzaJT'];a37_0x4dc5=function(){return _0x1005d6;};return a37_0x4dc5();}(function(_0x326d8a,_0x1a52d4){const _0x4e0729=a37_0x7148,_0x5154dd=_0x326d8a();while(!![]){try{const _0x3ad1ee=parseInt(_0x4e0729(0xb1))/0x1+-parseInt(_0x4e0729(0xba))/0x2+-parseInt(_0x4e0729(0xb9))/0x3*(-parseInt(_0x4e0729(0xb0))/0x4)+parseInt(_0x4e0729(0xbc))/0x5*(parseInt(_0x4e0729(0xb7))/0x6)+-parseInt(_0x4e0729(0xb6))/0x7*(parseInt(_0x4e0729(0xb8))/0x8)+-parseInt(_0x4e0729(0xbb))/0x9+parseInt(_0x4e0729(0xb2))/0xa;if(_0x3ad1ee===_0x1a52d4)break;else _0x5154dd['push'](_0x5154dd['shift']());}catch(_0x4119ae){_0x5154dd['push'](_0x5154dd['shift']());}}}(a37_0x4dc5,0xd3d23));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x3937b3){const _0x9713bc=await buildSchemaPayload();return{'ok':!![],'data':_0x9713bc};}export const schemaDefinition={'service':a37_0x13d0b6(0xb3),'command':a37_0x13d0b6(0xb4),'description':a37_0x13d0b6(0xb5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x7323d,_0x55bf3f){const _0x43e904=a38_0x3782,_0x495c0f=_0x7323d();while(!![]){try{const _0xe7efaa=-parseInt(_0x43e904(0x15e))/0x1+-parseInt(_0x43e904(0x137))/0x2*(-parseInt(_0x43e904(0x155))/0x3)+parseInt(_0x43e904(0x16d))/0x4*(-parseInt(_0x43e904(0x14a))/0x5)+parseInt(_0x43e904(0x163))/0x6*(-parseInt(_0x43e904(0x144))/0x7)+parseInt(_0x43e904(0x118))/0x8*(-parseInt(_0x43e904(0x161))/0x9)+-parseInt(_0x43e904(0x117))/0xa*(-parseInt(_0x43e904(0x146))/0xb)+parseInt(_0x43e904(0x12a))/0xc;if(_0xe7efaa===_0x55bf3f)break;else _0x495c0f['push'](_0x495c0f['shift']());}catch(_0x211070){_0x495c0f['push'](_0x495c0f['shift']());}}}(a38_0x3707,0xebe57));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(_0x4d24e9,_0x3bfb63){const _0x47d61b=a38_0x3782,_0x340115=listLocalServiceTrees();let _0xba164d;for(const _0x308d3e of _0x340115){const _0x11dc62=matchServiceTreeCommand(_0x308d3e,_0x4d24e9);if(!_0x11dc62)continue;(!_0xba164d||_0x11dc62[_0x47d61b(0x129)][_0x47d61b(0x15f)]['length']>_0xba164d[_0x47d61b(0x129)][_0x47d61b(0x15f)]['length'])&&(_0xba164d={'tree':_0x308d3e,'command':_0x11dc62[_0x47d61b(0x129)],'remainingArgs':_0x11dc62[_0x47d61b(0x168)]});}if(!_0xba164d)return undefined;const _0x127969={..._0x3bfb63};return applyAppBinding(_0xba164d['tree'],_0xba164d['command'],_0x127969),{'definition':buildDynamicCommandDefinition(_0xba164d['tree'],_0xba164d[_0x47d61b(0x129)]),'args':_0xba164d[_0x47d61b(0x168)],'flags':_0x127969,'tree':_0xba164d[_0x47d61b(0x11f)],'command':_0xba164d[_0x47d61b(0x129)]};}export function generateDynamicServiceHelp(_0x30d239){const _0x540a5f=a38_0x3782,_0xc4b20d=listLocalServiceTrees()[_0x540a5f(0x126)](_0x358d7d=>_0x358d7d['service'][_0x540a5f(0x145)]===_0x30d239);if(!_0xc4b20d)return undefined;const _0x1a4fda=[CLI_BIN_NAME+'\x20'+_0x30d239+'\x20<command>\x20[flags]','',_0xc4b20d[_0x540a5f(0x176)][_0x540a5f(0x16c)]||_0x30d239,_0xc4b20d[_0x540a5f(0x176)]['description']?'\x20\x20'+_0xc4b20d[_0x540a5f(0x176)][_0x540a5f(0x120)]:'','',_0x540a5f(0x140),..._0xc4b20d[_0x540a5f(0x12e)][_0x540a5f(0x157)](_0x2f2bbb=>{const _0x4d33f7=_0x540a5f,_0x932e13=_0x2f2bbb[_0x4d33f7(0x15f)][_0x4d33f7(0x177)](0x1)[_0x4d33f7(0x131)]('\x20'),_0x2d596a=_0x2f2bbb['risk']==='read'?'':'\x20['+_0x2f2bbb['risk']+']';return'\x20\x20'+_0x932e13[_0x4d33f7(0x151)](0x18)+'\x20'+(_0x2f2bbb['description']||'')+_0x2d596a;}),'',_0x540a5f(0x153)+CLI_BIN_NAME+_0x540a5f(0x128)+_0x30d239+_0x540a5f(0x16b)][_0x540a5f(0x175)](Boolean);return _0x1a4fda['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3257bb=a38_0x3782;return listLocalServices()[_0x3257bb(0x157)](_0x80ed18=>{const _0x281a47=_0x3257bb,_0x3c5802=_0x80ed18[_0x281a47(0x15d)];return{'service':_0x3c5802[_0x281a47(0x176)][_0x281a47(0x145)],'label':_0x3c5802[_0x281a47(0x176)][_0x281a47(0x16c)]||_0x3c5802[_0x281a47(0x176)]['code'],'commands':_0x3c5802[_0x281a47(0x12e)][_0x281a47(0x157)](_0x2aa8d6=>({'command':dynamicCommandName(_0x2aa8d6),'description':_0x2aa8d6[_0x281a47(0x120)]||_0x281a47(0x16e)+_0x2aa8d6[_0x281a47(0x135)],'tag':riskTag(_0x2aa8d6[_0x281a47(0x11b)])}))};});}export function getDynamicServiceEntry(_0x1355f5){const _0x5799f8=a38_0x3782;return listDynamicServiceEntries()[_0x5799f8(0x126)](_0x548455=>_0x548455[_0x5799f8(0x176)]===_0x1355f5);}export function listDynamicServiceDefinitions(_0x1481e6){const _0x292157=a38_0x3782;return listLocalServiceTrees()[_0x292157(0x175)](_0x504f3b=>!_0x1481e6||_0x504f3b[_0x292157(0x176)]['code']===_0x1481e6)['flatMap'](_0x3cf09e=>_0x3cf09e[_0x292157(0x12e)][_0x292157(0x157)](_0x8beedc=>buildDynamicCommandDefinition(_0x3cf09e,_0x8beedc)));}export function getDynamicServiceDefinitions(_0x38ca50){const _0x23187a=a38_0x3782,_0x382d88=listDynamicServiceDefinitions(_0x38ca50);return _0x382d88[_0x23187a(0x162)]>0x0?_0x382d88:undefined;}export function findDynamicServiceDefinition(_0x28184b,_0x23fa15){return listDynamicServiceDefinitions(_0x28184b)['find'](_0x8cece1=>_0x8cece1['command']===_0x23fa15);}function a38_0x3707(){const _0x24639d=['SERVICE_TREE','rawFlags','number','trim','dbtableConfig','normalizedManifest','702114jPZLCy','fullPath','sqlCode','18LigIwr','length','6VwZvoN','bffCode','default','json','\x20completed\x20in\x20','remainingArgs','app','ctx.','`\x20to\x20inspect\x20the\x20manifest.','name','18336YlSZRt','Run\x20service\x20command\x20','operator','\x20\x20[','bffId','cliName','now','flags','filter','service','slice','appCode','employeeId','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20\x20\x20scriptName:\x20','8697190nTMlVJ','1618576ccxxFP','kind','tenantCode','risk','Service\x20command\x20','nickname','tableName','tree','description','datatable','startsWith','data','required','nickName','find','string','\x20service\x20detail\x20--service\x20','command','23863092bimyPx','envName','userName','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','commands','args','\x20\x20\x20\x20','join','appcode','appRef','env','cliPath','scriptName','1508450WWONxU','Cannot\x20resolve\x20datatable\x20\x22','mapTo','\x20\x20\x20\x20datatable:\x20','some','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20requires\x20target.sqlCode.','\x20\x20\x20\x20kind:\x20\x20\x20\x20','datasetCode','Commands:','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','boolean','\x22\x20in\x20service\x20command\x20','9895501IdNejt','code','11AVzReF','username','\x20requires\x20target.scriptName.','params','960kXiWSE','appBindings','type','push','target','\x20\x20MAP\x20TO','source','padEnd','validation','Use\x20`','loginName','6BMOARn','userId','map'];a38_0x3707=function(){return _0x24639d;};return a38_0x3707();}export function buildDynamicCommandDefinition(_0x4e4a30,_0x876737){const _0x110feb=a38_0x3782;return{'service':_0x4e4a30['service'][_0x110feb(0x145)],'command':dynamicCommandName(_0x876737),'description':_0x876737[_0x110feb(0x120)]||_0x110feb(0x16e)+_0x876737[_0x110feb(0x135)],'risk':_0x876737[_0x110feb(0x11b)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x876737['args'][_0x110feb(0x157)](_0x524d2c=>({'name':_0x524d2c[_0x110feb(0x16c)],'description':_0x524d2c['description']||_0x524d2c['name'],'required':_0x524d2c['required']})),'flags':_0x876737[_0x110feb(0x174)][_0x110feb(0x157)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x876737),async 'dryRun'(_0x3243f2){const _0x12fc7b=_0x110feb,_0x3c78e1=await compilePlan(_0x876737,_0x3243f2);return{'method':_0x12fc7b(0x158),'url':_0x876737[_0x12fc7b(0x135)],'body':{'target':targetPreview(_0x3c78e1),'params':_0x3c78e1[_0x12fc7b(0x149)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x876737[_0x12fc7b(0x135)]};},async 'execute'(_0x5ab936){const _0x10c8a6=_0x110feb,_0x42bcea=await compilePlan(_0x876737,_0x5ab936),_0x6d2733=Date[_0x10c8a6(0x173)](),_0x5a82e5=await executePlan(_0x42bcea,_0x876737,_0x5ab936),_0x52aa76=Date[_0x10c8a6(0x173)]()-_0x6d2733;return{'ok':!![],'data':{'service':_0x4e4a30[_0x10c8a6(0x176)],'command':_0x876737[_0x10c8a6(0x135)],'target':targetPreview(_0x42bcea),'result':_0x5a82e5,'elapsed':_0x52aa76},'message':_0x10c8a6(0x11c)+_0x876737['cliPath']+_0x10c8a6(0x167)+_0x52aa76+'ms'};}};}function dynamicCommandName(_0xb5b0a3){const _0x23bf08=a38_0x3782;return _0xb5b0a3[_0x23bf08(0x15f)]['slice'](0x1)[_0x23bf08(0x131)]('\x20');}function riskTag(_0x5efbcc){const _0x1ed7a8=a38_0x3782;return _0x5efbcc==='read'?'':_0x1ed7a8(0x170)+_0x5efbcc+']';}function flagToCommandFlag(_0x2fe2e6){const _0x101b63=a38_0x3782;return{'name':_0x2fe2e6[_0x101b63(0x172)],'type':_0x2fe2e6[_0x101b63(0x14c)]===_0x101b63(0x166)?_0x101b63(0x127):_0x2fe2e6[_0x101b63(0x14c)],'description':_0x2fe2e6[_0x101b63(0x120)]||_0x2fe2e6[_0x101b63(0x16c)],'required':_0x2fe2e6[_0x101b63(0x124)],'default':isPrimitiveFlagDefault(_0x2fe2e6['default'])?_0x2fe2e6[_0x101b63(0x165)]:undefined,'enum':_0x2fe2e6['enum']};}async function compilePlan(_0xfe0782,_0x4731f4){const _0x2ae089=a38_0x3782;return compileServiceTreeCommand(_0xfe0782,{'flags':_0x4731f4[_0x2ae089(0x159)],'args':_0x4731f4[_0x2ae089(0x12f)],'context':await buildServiceContext(_0xfe0782,_0x4731f4)});}async function buildServiceContext(_0x6b2c74,_0x191a64){const _0x1183b6=a38_0x3782,_0x4c7eef={'appCode':_0x191a64[_0x1183b6(0x178)],'env':_0x191a64[_0x1183b6(0x12b)],'envName':_0x191a64[_0x1183b6(0x12b)]};if(!usesRuntimeContext(_0x6b2c74))return _0x4c7eef;const _0x5282d3=await getLoginUserInfo(),_0x260d68=pickFirst(_0x5282d3[_0x1183b6(0x156)],_0x5282d3['id']);return{..._0x4c7eef,'user':_0x5282d3,'userId':_0x260d68,'id':_0x5282d3['id'],'username':pickFirst(_0x5282d3[_0x1183b6(0x147)],_0x5282d3[_0x1183b6(0x12c)],_0x5282d3[_0x1183b6(0x154)]),'userName':_0x5282d3['userName'],'nickname':pickFirst(_0x5282d3[_0x1183b6(0x11d)],_0x5282d3['nickName']),'nickName':_0x5282d3[_0x1183b6(0x125)],'tenantCode':_0x5282d3[_0x1183b6(0x11a)],'employeeId':_0x5282d3[_0x1183b6(0x114)]};}function usesRuntimeContext(_0x118d22){const _0x7df0c=a38_0x3782;return _0x118d22[_0x7df0c(0x139)][_0x7df0c(0x13b)](_0x34e86b=>typeof _0x34e86b['source']==='string'&&(_0x34e86b['source'][_0x7df0c(0x122)]('context.')||_0x34e86b[_0x7df0c(0x150)][_0x7df0c(0x122)](_0x7df0c(0x16a))));}function pickFirst(..._0x2f2ae7){const _0x58142a=a38_0x3782;return _0x2f2ae7[_0x58142a(0x126)](_0x57cde6=>_0x57cde6!==undefined&&_0x57cde6!==null);}async function executePlan(_0x457a40,_0x2c801d,_0x879b40){const _0x7678f3=a38_0x3782;if(_0x457a40[_0x7678f3(0x119)]===_0x7678f3(0x123)){const _0x2828c5=await resolveDatasetCode(_0x457a40,_0x2c801d,_0x879b40);return executeData(_0x2828c5,_0x457a40[_0x7678f3(0x129)],_0x457a40[_0x7678f3(0x149)]);}if(_0x457a40['kind']==='sql'){if(!_0x457a40[_0x7678f3(0x160)])throw CliErrors[_0x7678f3(0x152)]('Service\x20command\x20'+_0x2c801d[_0x7678f3(0x135)]+_0x7678f3(0x13d));return executeSdkSql(_0x457a40[_0x7678f3(0x160)],normalizeScalarParams(_0x457a40['params']));}if(_0x457a40[_0x7678f3(0x119)]==='bff'){const _0x3320c2=_0x457a40[_0x7678f3(0x136)]||_0x457a40[_0x7678f3(0x164)]||(_0x457a40[_0x7678f3(0x171)]==null?'':String(_0x457a40[_0x7678f3(0x171)]));if(!_0x3320c2)throw CliErrors[_0x7678f3(0x152)](_0x7678f3(0x11c)+_0x2c801d[_0x7678f3(0x135)]+_0x7678f3(0x148));return executeSdkBff(_0x3320c2,_0x457a40[_0x7678f3(0x149)]);}throw CliErrors[_0x7678f3(0x152)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x457a40[_0x7678f3(0x119)]);}async function resolveDatasetCode(_0x1ffcfd,_0x598167,_0x300982){const _0x536c85=a38_0x3782;if(_0x1ffcfd[_0x536c85(0x13f)])return _0x1ffcfd['datasetCode'];if(!_0x1ffcfd['datatable'])throw CliErrors[_0x536c85(0x152)]('Service\x20command\x20'+_0x598167[_0x536c85(0x135)]+_0x536c85(0x141));const _0x228f8f=await listDatasets(_0x300982[_0x536c85(0x178)]),_0x1a9dd9=_0x228f8f[_0x536c85(0x126)](_0x192747=>_0x192747[_0x536c85(0x15c)]?.[_0x536c85(0x11e)]===_0x1ffcfd[_0x536c85(0x121)]);if(!_0x1a9dd9?.[_0x536c85(0x145)])throw CliErrors[_0x536c85(0x152)](_0x536c85(0x138)+_0x1ffcfd[_0x536c85(0x121)]+_0x536c85(0x115)+_0x300982[_0x536c85(0x178)]+'.',_0x536c85(0x12d));return _0x1a9dd9[_0x536c85(0x145)];}function applyAppBinding(_0x397a07,_0x34fb01,_0x1d7d33){const _0x577c36=a38_0x3782,_0x25a91c=_0x34fb01[_0x577c36(0x14e)][_0x577c36(0x133)];if(!_0x25a91c)return;const _0x50f522=_0x397a07[_0x577c36(0x14b)][_0x25a91c];if(!_0x50f522)throw CliErrors[_0x577c36(0x152)]('Unknown\x20appRef\x20\x22'+_0x25a91c+_0x577c36(0x143)+_0x34fb01['cliPath']+'.',_0x577c36(0x13c));const _0x1432b6=_0x50f522[_0x577c36(0x132)]||_0x50f522[_0x577c36(0x178)];_0x1432b6&&!hasText(_0x1d7d33[_0x577c36(0x132)])&&(_0x1d7d33[_0x577c36(0x132)]=_0x1432b6),_0x50f522[_0x577c36(0x169)]&&!hasText(_0x1d7d33['app'])&&!hasText(_0x1d7d33['appcode'])&&(_0x1d7d33['app']=_0x50f522[_0x577c36(0x169)]),_0x50f522[_0x577c36(0x134)]&&!hasText(_0x1d7d33[_0x577c36(0x134)])&&(_0x1d7d33['env']=_0x50f522['env']);}function renderDynamicCommandHelp(_0x29cd16){const _0x4cc2c8=a38_0x3782,_0x541469=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x4cc2c8(0x13e)+_0x29cd16[_0x4cc2c8(0x14e)][_0x4cc2c8(0x119)],'\x20\x20\x20\x20command:\x20'+_0x29cd16[_0x4cc2c8(0x14e)][_0x4cc2c8(0x129)]];if(_0x29cd16['target'][_0x4cc2c8(0x13f)])_0x541469['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x29cd16[_0x4cc2c8(0x14e)][_0x4cc2c8(0x13f)]);if(_0x29cd16[_0x4cc2c8(0x14e)][_0x4cc2c8(0x121)])_0x541469[_0x4cc2c8(0x14d)](_0x4cc2c8(0x13a)+_0x29cd16[_0x4cc2c8(0x14e)][_0x4cc2c8(0x121)]);if(_0x29cd16[_0x4cc2c8(0x14e)]['sqlCode'])_0x541469['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x29cd16['target']['sqlCode']);if(_0x29cd16['target'][_0x4cc2c8(0x136)])_0x541469[_0x4cc2c8(0x14d)](_0x4cc2c8(0x116)+_0x29cd16[_0x4cc2c8(0x14e)]['scriptName']);if(_0x29cd16[_0x4cc2c8(0x139)][_0x4cc2c8(0x162)]>0x0){_0x541469[_0x4cc2c8(0x14d)]('',_0x4cc2c8(0x14f));for(const _0x38aff5 of _0x29cd16['mapTo']){_0x541469[_0x4cc2c8(0x14d)](_0x4cc2c8(0x130)+(_0x38aff5[_0x4cc2c8(0x150)]||'const')+'\x20->\x20'+_0x38aff5[_0x4cc2c8(0x14e)]+(_0x38aff5[_0x4cc2c8(0x16f)]?'.'+_0x38aff5[_0x4cc2c8(0x16f)]:''));}}return _0x541469['join']('\x0a');}function targetPreview(_0x4cb65c){const _0x562f80=a38_0x3782;return{'kind':_0x4cb65c[_0x562f80(0x119)],'command':_0x4cb65c[_0x562f80(0x129)],'appRef':_0x4cb65c[_0x562f80(0x133)],'datasetCode':_0x4cb65c[_0x562f80(0x13f)],'datatable':_0x4cb65c['datatable'],'sqlCode':_0x4cb65c[_0x562f80(0x160)],'bffCode':_0x4cb65c['bffCode'],'bffId':_0x4cb65c[_0x562f80(0x171)],'scriptName':_0x4cb65c[_0x562f80(0x136)]};}function normalizeScalarParams(_0x57a243){const _0x5a84ba=a38_0x3782;return Object['fromEntries'](Object['entries'](_0x57a243)['filter'](([,_0x243bf0])=>typeof _0x243bf0===_0x5a84ba(0x127)||typeof _0x243bf0===_0x5a84ba(0x15a)));}function hasText(_0x21df16){const _0x4bc378=a38_0x3782;return typeof _0x21df16===_0x4bc378(0x127)&&_0x21df16[_0x4bc378(0x15b)]()[_0x4bc378(0x162)]>0x0;}function a38_0x3782(_0xcbf2f,_0x2098e6){_0xcbf2f=_0xcbf2f-0x114;const _0x370721=a38_0x3707();let _0x37822c=_0x370721[_0xcbf2f];return _0x37822c;}function isPrimitiveFlagDefault(_0x182202){const _0x42b885=a38_0x3782;return _0x182202===undefined||typeof _0x182202===_0x42b885(0x127)||typeof _0x182202==='number'||typeof _0x182202===_0x42b885(0x142);}
|
|
1
|
+
(function(_0x302bcb,_0x4c3ef1){const _0x5714e0=a38_0x168b,_0x55f19d=_0x302bcb();while(!![]){try{const _0xe2840d=parseInt(_0x5714e0(0x110))/0x1+-parseInt(_0x5714e0(0xf9))/0x2*(parseInt(_0x5714e0(0x11b))/0x3)+-parseInt(_0x5714e0(0xe5))/0x4+-parseInt(_0x5714e0(0x10c))/0x5+-parseInt(_0x5714e0(0xed))/0x6+parseInt(_0x5714e0(0xd6))/0x7*(-parseInt(_0x5714e0(0x12d))/0x8)+parseInt(_0x5714e0(0xea))/0x9;if(_0xe2840d===_0x4c3ef1)break;else _0x55f19d['push'](_0x55f19d['shift']());}catch(_0xa72cb){_0x55f19d['push'](_0x55f19d['shift']());}}}(a38_0x2942,0xbc3f0));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(_0x426c29,_0x557853){const _0x1ad5f7=a38_0x168b,_0x57bd52=listLocalServiceTrees();let _0x973a10;for(const _0x1dd4f7 of _0x57bd52){const _0x48bc11=matchServiceTreeCommand(_0x1dd4f7,_0x426c29);if(!_0x48bc11)continue;(!_0x973a10||_0x48bc11[_0x1ad5f7(0x109)]['fullPath'][_0x1ad5f7(0x116)]>_0x973a10[_0x1ad5f7(0x109)][_0x1ad5f7(0x102)][_0x1ad5f7(0x116)])&&(_0x973a10={'tree':_0x1dd4f7,'command':_0x48bc11[_0x1ad5f7(0x109)],'remainingArgs':_0x48bc11['remainingArgs']});}if(!_0x973a10)return undefined;const _0x3cc807={..._0x557853};return applyAppBinding(_0x973a10['tree'],_0x973a10[_0x1ad5f7(0x109)],_0x3cc807),{'definition':buildDynamicCommandDefinition(_0x973a10['tree'],_0x973a10['command']),'args':_0x973a10['remainingArgs'],'flags':_0x3cc807,'tree':_0x973a10['tree'],'command':_0x973a10[_0x1ad5f7(0x109)]};}export function generateDynamicServiceHelp(_0x1dc76a){const _0x349023=a38_0x168b,_0x2c6ef3=listLocalServiceTrees()[_0x349023(0x105)](_0x3c3440=>_0x3c3440[_0x349023(0x115)]['code']===_0x1dc76a);if(!_0x2c6ef3)return undefined;const _0x4d42e1=[CLI_BIN_NAME+'\x20'+_0x1dc76a+'\x20<command>\x20[flags]','',_0x2c6ef3[_0x349023(0x115)][_0x349023(0x104)]||_0x1dc76a,_0x2c6ef3[_0x349023(0x115)][_0x349023(0x126)]?'\x20\x20'+_0x2c6ef3[_0x349023(0x115)][_0x349023(0x126)]:'','',_0x349023(0x128),..._0x2c6ef3[_0x349023(0x118)][_0x349023(0x129)](_0x30a7fb=>{const _0x4d5e35=_0x349023,_0x438486=_0x30a7fb[_0x4d5e35(0x102)][_0x4d5e35(0x119)](0x1)[_0x4d5e35(0x11e)]('\x20'),_0x5d5e7a=_0x30a7fb[_0x4d5e35(0x130)]===_0x4d5e35(0x12b)?'':'\x20['+_0x30a7fb[_0x4d5e35(0x130)]+']';return'\x20\x20'+_0x438486[_0x4d5e35(0xd3)](0x18)+'\x20'+(_0x30a7fb[_0x4d5e35(0x126)]||'')+_0x5d5e7a;}),'',_0x349023(0x12c)+CLI_BIN_NAME+_0x349023(0xd8)+_0x1dc76a+_0x349023(0xe6)][_0x349023(0xdd)](Boolean);return _0x4d42e1['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x46c450=>{const _0x34a9b4=a38_0x168b,_0x270e8d=_0x46c450['normalizedManifest'];return{'service':_0x270e8d[_0x34a9b4(0x115)]['code'],'label':_0x270e8d[_0x34a9b4(0x115)][_0x34a9b4(0x104)]||_0x270e8d['service'][_0x34a9b4(0x12e)],'commands':_0x270e8d[_0x34a9b4(0x118)][_0x34a9b4(0x129)](_0x1a821a=>({'command':dynamicCommandName(_0x1a821a),'description':_0x1a821a[_0x34a9b4(0x126)]||_0x34a9b4(0x117)+_0x1a821a[_0x34a9b4(0xeb)],'tag':riskTag(_0x1a821a[_0x34a9b4(0x130)])}))};});}export function getDynamicServiceEntry(_0x26193c){const _0x455291=a38_0x168b;return listDynamicServiceEntries()[_0x455291(0x105)](_0x121d17=>_0x121d17['service']===_0x26193c);}export function listDynamicServiceDefinitions(_0x26fc10){const _0x1e9dbb=a38_0x168b;return listLocalServiceTrees()[_0x1e9dbb(0xdd)](_0x3d1e8b=>!_0x26fc10||_0x3d1e8b[_0x1e9dbb(0x115)]['code']===_0x26fc10)[_0x1e9dbb(0x11f)](_0x36daa9=>_0x36daa9['commands'][_0x1e9dbb(0x129)](_0xa0ba72=>buildDynamicCommandDefinition(_0x36daa9,_0xa0ba72)));}export function getDynamicServiceDefinitions(_0x3d5395){const _0x2f678=listDynamicServiceDefinitions(_0x3d5395);return _0x2f678['length']>0x0?_0x2f678:undefined;}export function findDynamicServiceDefinition(_0x1c6e9a,_0x53726b){const _0x5e7c8e=a38_0x168b;return listDynamicServiceDefinitions(_0x1c6e9a)[_0x5e7c8e(0x105)](_0x5b414a=>_0x5b414a[_0x5e7c8e(0x109)]===_0x53726b);}export function buildDynamicCommandDefinition(_0x367035,_0x58157f){const _0x92318e=a38_0x168b;return{'service':_0x367035[_0x92318e(0x115)][_0x92318e(0x12e)],'command':dynamicCommandName(_0x58157f),'description':_0x58157f[_0x92318e(0x126)]||'Run\x20service\x20command\x20'+_0x58157f[_0x92318e(0xeb)],'risk':_0x58157f[_0x92318e(0x130)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x58157f[_0x92318e(0x10b)][_0x92318e(0x129)](_0x22b300=>({'name':_0x22b300[_0x92318e(0x104)],'description':_0x22b300[_0x92318e(0x126)]||_0x22b300[_0x92318e(0x104)],'required':_0x22b300[_0x92318e(0x124)]})),'flags':_0x58157f[_0x92318e(0x125)][_0x92318e(0x129)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x58157f),async 'dryRun'(_0x8d483){const _0x27204b=_0x92318e,_0x36dd11=await compilePlan(_0x58157f,_0x8d483);return{'method':_0x27204b(0x11d),'url':_0x58157f['cliPath'],'body':{'target':targetPreview(_0x36dd11),'params':_0x36dd11[_0x27204b(0xee)]},'description':_0x27204b(0xe2)+_0x58157f['cliPath']};},async 'execute'(_0x2c41fa){const _0x4c75af=_0x92318e,_0x407513=await compilePlan(_0x58157f,_0x2c41fa),_0xae7900=Date[_0x4c75af(0x112)](),_0x192b03=await executePlan(_0x407513,_0x58157f,_0x2c41fa),_0x30c004=Date[_0x4c75af(0x112)]()-_0xae7900;return{'ok':!![],'data':{'service':_0x367035['service'],'command':_0x58157f['cliPath'],'target':targetPreview(_0x407513),'result':_0x192b03,'elapsed':_0x30c004},'message':_0x4c75af(0x114)+_0x58157f[_0x4c75af(0xeb)]+'\x20completed\x20in\x20'+_0x30c004+'ms'};}};}function a38_0x2942(){const _0x1000a8=['mapTo','\x20\x20MAP\x20TO','1480036hLjOUx','bffId','now','rawFlags','Service\x20command\x20','service','length','Run\x20service\x20command\x20','commands','slice','Cannot\x20resolve\x20datatable\x20\x22','33SftHdQ','bffCode','SERVICE_TREE','join','flatMap','Unsupported\x20service\x20target\x20kind:\x20','boolean','\x20->\x20','nickName','required','flags','description','userId','Commands:','map','startsWith','read','Use\x20`','72OFLbKQ','code','validation','risk','scriptName','some','padEnd','trim','userName','816515UrLHIZ','envName','\x20service\x20detail\x20--service\x20','\x20\x20\x20\x20datatable:\x20','operator','sqlCode','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','filter','json','\x20\x20SERVICE\x20TREE\x20TARGET','appCode','\x20requires\x20target.scriptName.','Preview\x20dynamic\x20service\x20command:\x20','username','string','2288568kUiJiy','`\x20to\x20inspect\x20the\x20manifest.','employeeId','\x20\x20\x20\x20','default','23070276TGGzPQ','cliPath','fromEntries','1105698kUgnoM','params','loginName','target','datasetCode','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','data','appRef','appcode','datatable','app','push','153638ocDyiJ','bff','Unknown\x20appRef\x20\x22','kind','\x22\x20in\x20service\x20command\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20\x20\x20\x20command:\x20','env','type','fullPath','context.','name','find','source','tableName','nickname','command','tenantCode','args','3105525jHiiQt','enum'];a38_0x2942=function(){return _0x1000a8;};return a38_0x2942();}function dynamicCommandName(_0x4f67e7){const _0x55bfd0=a38_0x168b;return _0x4f67e7[_0x55bfd0(0x102)][_0x55bfd0(0x119)](0x1)['join']('\x20');}function riskTag(_0x2caf4f){const _0x590ac4=a38_0x168b;return _0x2caf4f===_0x590ac4(0x12b)?'':'\x20\x20['+_0x2caf4f+']';}function flagToCommandFlag(_0x54cad7){const _0xe90e4e=a38_0x168b;return{'name':_0x54cad7['cliName'],'type':_0x54cad7[_0xe90e4e(0x101)]===_0xe90e4e(0xde)?_0xe90e4e(0xe4):_0x54cad7[_0xe90e4e(0x101)],'description':_0x54cad7['description']||_0x54cad7['name'],'required':_0x54cad7[_0xe90e4e(0x124)],'default':isPrimitiveFlagDefault(_0x54cad7[_0xe90e4e(0xe9)])?_0x54cad7[_0xe90e4e(0xe9)]:undefined,'enum':_0x54cad7[_0xe90e4e(0x10d)]};}async function compilePlan(_0x231282,_0x5852b2){const _0x4e87e6=a38_0x168b;return compileServiceTreeCommand(_0x231282,{'flags':_0x5852b2[_0x4e87e6(0x113)],'args':_0x5852b2['args'],'context':await buildServiceContext(_0x231282,_0x5852b2)});}async function buildServiceContext(_0x2167e2,_0x4ee594){const _0x2a517e=a38_0x168b,_0xc06c67={'appCode':_0x4ee594['appCode'],'env':_0x4ee594[_0x2a517e(0xd7)],'envName':_0x4ee594['envName']};if(!usesRuntimeContext(_0x2167e2))return _0xc06c67;const _0x275bc5=await getLoginUserInfo(),_0x4ad6a7=pickFirst(_0x275bc5[_0x2a517e(0x127)],_0x275bc5['id']);return{..._0xc06c67,'user':_0x275bc5,'userId':_0x4ad6a7,'id':_0x275bc5['id'],'username':pickFirst(_0x275bc5[_0x2a517e(0xe3)],_0x275bc5[_0x2a517e(0xd5)],_0x275bc5[_0x2a517e(0xef)]),'userName':_0x275bc5[_0x2a517e(0xd5)],'nickname':pickFirst(_0x275bc5[_0x2a517e(0x108)],_0x275bc5[_0x2a517e(0x123)]),'nickName':_0x275bc5['nickName'],'tenantCode':_0x275bc5[_0x2a517e(0x10a)],'employeeId':_0x275bc5[_0x2a517e(0xe7)]};}function usesRuntimeContext(_0x479eed){const _0x50e697=a38_0x168b;return _0x479eed[_0x50e697(0x10e)][_0x50e697(0xd2)](_0x3faa81=>typeof _0x3faa81['source']===_0x50e697(0xe4)&&(_0x3faa81[_0x50e697(0x106)][_0x50e697(0x12a)](_0x50e697(0x103))||_0x3faa81[_0x50e697(0x106)]['startsWith']('ctx.')));}function pickFirst(..._0x1b5c17){const _0x1ea69b=a38_0x168b;return _0x1b5c17[_0x1ea69b(0x105)](_0x594bb0=>_0x594bb0!==undefined&&_0x594bb0!==null);}async function executePlan(_0x26532a,_0x4a21ee,_0x1c6eb2){const _0x1bc1e7=a38_0x168b;if(_0x26532a[_0x1bc1e7(0xfc)]===_0x1bc1e7(0xf3)){const _0x497f79=await resolveDatasetCode(_0x26532a,_0x4a21ee,_0x1c6eb2);return executeData(_0x497f79,_0x26532a[_0x1bc1e7(0x109)],_0x26532a[_0x1bc1e7(0xee)]);}if(_0x26532a['kind']==='sql'){if(!_0x26532a[_0x1bc1e7(0xdb)])throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x114)+_0x4a21ee[_0x1bc1e7(0xeb)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x26532a[_0x1bc1e7(0xdb)],normalizeScalarParams(_0x26532a[_0x1bc1e7(0xee)]));}if(_0x26532a[_0x1bc1e7(0xfc)]===_0x1bc1e7(0xfa)){const _0x558657=_0x26532a[_0x1bc1e7(0x131)]||_0x26532a[_0x1bc1e7(0x11c)]||(_0x26532a[_0x1bc1e7(0x111)]==null?'':String(_0x26532a['bffId']));if(!_0x558657)throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x114)+_0x4a21ee[_0x1bc1e7(0xeb)]+_0x1bc1e7(0xe1));return executeSdkBff(_0x558657,_0x26532a['params']);}throw CliErrors[_0x1bc1e7(0x12f)](_0x1bc1e7(0x120)+_0x26532a[_0x1bc1e7(0xfc)]);}async function resolveDatasetCode(_0x8a8061,_0x5a0424,_0x1a2f26){const _0x31ee4f=a38_0x168b;if(_0x8a8061[_0x31ee4f(0xf1)])return _0x8a8061[_0x31ee4f(0xf1)];if(!_0x8a8061[_0x31ee4f(0xf6)])throw CliErrors[_0x31ee4f(0x12f)](_0x31ee4f(0x114)+_0x5a0424[_0x31ee4f(0xeb)]+_0x31ee4f(0xdc));const _0x47e76d=await listDatasets(_0x1a2f26[_0x31ee4f(0xe0)]),_0x3593a3=_0x47e76d['find'](_0xf5665d=>_0xf5665d['dbtableConfig']?.[_0x31ee4f(0x107)]===_0x8a8061['datatable']);if(!_0x3593a3?.['code'])throw CliErrors[_0x31ee4f(0x12f)](_0x31ee4f(0x11a)+_0x8a8061[_0x31ee4f(0xf6)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1a2f26[_0x31ee4f(0xe0)]+'.',_0x31ee4f(0xf2));return _0x3593a3[_0x31ee4f(0x12e)];}function applyAppBinding(_0x472494,_0xbc9c87,_0x4e1ccf){const _0x463589=a38_0x168b,_0x43b0e9=_0xbc9c87[_0x463589(0xf0)][_0x463589(0xf4)];if(!_0x43b0e9)return;const _0x52b1cc=_0x472494['appBindings'][_0x43b0e9];if(!_0x52b1cc)throw CliErrors[_0x463589(0x12f)](_0x463589(0xfb)+_0x43b0e9+_0x463589(0xfd)+_0xbc9c87['cliPath']+'.',_0x463589(0xfe));const _0x27381c=_0x52b1cc[_0x463589(0xf5)]||_0x52b1cc[_0x463589(0xe0)];_0x27381c&&!hasText(_0x4e1ccf['appcode'])&&(_0x4e1ccf['appcode']=_0x27381c),_0x52b1cc[_0x463589(0xf7)]&&!hasText(_0x4e1ccf[_0x463589(0xf7)])&&!hasText(_0x4e1ccf['appcode'])&&(_0x4e1ccf[_0x463589(0xf7)]=_0x52b1cc['app']),_0x52b1cc['env']&&!hasText(_0x4e1ccf['env'])&&(_0x4e1ccf[_0x463589(0x100)]=_0x52b1cc[_0x463589(0x100)]);}function a38_0x168b(_0x2267b3,_0x5ac179){_0x2267b3=_0x2267b3-0xd2;const _0x2942af=a38_0x2942();let _0x168b36=_0x2942af[_0x2267b3];return _0x168b36;}function renderDynamicCommandHelp(_0x4b855f){const _0x1214aa=a38_0x168b,_0x35cdb8=[_0x1214aa(0xdf),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xfc)],_0x1214aa(0xff)+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0x109)]];if(_0x4b855f[_0x1214aa(0xf0)]['datasetCode'])_0x35cdb8[_0x1214aa(0xf8)]('\x20\x20\x20\x20datasetCode:\x20'+_0x4b855f[_0x1214aa(0xf0)]['datasetCode']);if(_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xf6)])_0x35cdb8['push'](_0x1214aa(0xd9)+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xf6)]);if(_0x4b855f['target'][_0x1214aa(0xdb)])_0x35cdb8['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x4b855f[_0x1214aa(0xf0)][_0x1214aa(0xdb)]);if(_0x4b855f['target']['scriptName'])_0x35cdb8[_0x1214aa(0xf8)]('\x20\x20\x20\x20scriptName:\x20'+_0x4b855f['target'][_0x1214aa(0x131)]);if(_0x4b855f[_0x1214aa(0x10e)][_0x1214aa(0x116)]>0x0){_0x35cdb8[_0x1214aa(0xf8)]('',_0x1214aa(0x10f));for(const _0x398e25 of _0x4b855f['mapTo']){_0x35cdb8['push'](_0x1214aa(0xe8)+(_0x398e25['source']||'const')+_0x1214aa(0x122)+_0x398e25[_0x1214aa(0xf0)]+(_0x398e25[_0x1214aa(0xda)]?'.'+_0x398e25['operator']:''));}}return _0x35cdb8['join']('\x0a');}function targetPreview(_0x423db7){const _0x229919=a38_0x168b;return{'kind':_0x423db7['kind'],'command':_0x423db7[_0x229919(0x109)],'appRef':_0x423db7['appRef'],'datasetCode':_0x423db7[_0x229919(0xf1)],'datatable':_0x423db7['datatable'],'sqlCode':_0x423db7[_0x229919(0xdb)],'bffCode':_0x423db7[_0x229919(0x11c)],'bffId':_0x423db7[_0x229919(0x111)],'scriptName':_0x423db7[_0x229919(0x131)]};}function normalizeScalarParams(_0x3b5e44){const _0x1c37f8=a38_0x168b;return Object[_0x1c37f8(0xec)](Object['entries'](_0x3b5e44)[_0x1c37f8(0xdd)](([,_0xb45216])=>typeof _0xb45216==='string'||typeof _0xb45216==='number'));}function hasText(_0x2cf5d8){const _0x3eeb24=a38_0x168b;return typeof _0x2cf5d8===_0x3eeb24(0xe4)&&_0x2cf5d8[_0x3eeb24(0xd4)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x4b8226){const _0x299ec1=a38_0x168b;return _0x4b8226===undefined||typeof _0x4b8226==='string'||typeof _0x4b8226==='number'||typeof _0x4b8226===_0x299ec1(0x121);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a39_0x30e8(_0xbdbe74,_0x2c691c){_0xbdbe74=_0xbdbe74-0xae;const _0x2dbcc6=a39_0x2dbc();let _0x30e809=_0x2dbcc6[_0xbdbe74];return _0x30e809;}const a39_0x3f56ff=a39_0x30e8;(function(_0x4c4655,_0xa96024){const _0x487f30=a39_0x30e8,_0x3bbaa1=_0x4c4655();while(!![]){try{const _0x173bfb=parseInt(_0x487f30(0xc8))/0x1*(parseInt(_0x487f30(0xc9))/0x2)+-parseInt(_0x487f30(0xe6))/0x3+parseInt(_0x487f30(0xc4))/0x4*(parseInt(_0x487f30(0xd1))/0x5)+parseInt(_0x487f30(0xec))/0x6+parseInt(_0x487f30(0xcb))/0x7+parseInt(_0x487f30(0xd4))/0x8+parseInt(_0x487f30(0xe0))/0x9*(-parseInt(_0x487f30(0xbd))/0xa);if(_0x173bfb===_0xa96024)break;else _0x3bbaa1['push'](_0x3bbaa1['shift']());}catch(_0x516f95){_0x3bbaa1['push'](_0x3bbaa1['shift']());}}}(a39_0x2dbc,0x47e2b));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':'file','type':a39_0x3f56ff(0xd5),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0x3f56ff(0xb2),'type':'string','required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x3f56ff(0xe1)}};function summarizeService(_0x35234c){const _0x1b95dc=a39_0x3f56ff;return{'serviceCode':_0x35234c[_0x1b95dc(0xe5)],'name':_0x35234c['normalizedManifest'][_0x1b95dc(0xb2)][_0x1b95dc(0xc3)],'version':_0x35234c['version'],'importedAt':_0x35234c[_0x1b95dc(0xc0)],'source':_0x35234c['source'],'commandCount':_0x35234c[_0x1b95dc(0xdd)]['commands']['length'],'commands':_0x35234c[_0x1b95dc(0xdd)][_0x1b95dc(0xeb)][_0x1b95dc(0xb3)](_0xc19b6f=>({'path':_0xc19b6f['cliPath'],'description':_0xc19b6f[_0x1b95dc(0xb5)],'risk':_0xc19b6f[_0x1b95dc(0xde)],'target':_0xc19b6f[_0x1b95dc(0xb8)],'flags':_0xc19b6f[_0x1b95dc(0xf3)][_0x1b95dc(0xb3)](_0x7db42=>({'name':_0x7db42['name'],'cliName':_0x7db42[_0x1b95dc(0xe3)],'type':_0x7db42[_0x1b95dc(0xe9)],'required':_0x7db42[_0x1b95dc(0xf0)]===!![]}))}))};}function summarizeLoadedManifest(_0x1f874b){const _0x454f7c=a39_0x3f56ff;return{'service':_0x1f874b[_0x454f7c(0xdd)]?.['service'],'version':_0x1f874b['normalizedManifest']?.['version'],'commandCount':_0x1f874b[_0x454f7c(0xdd)]?.[_0x454f7c(0xeb)]['length']??0x0,'commands':_0x1f874b[_0x454f7c(0xdd)]?.[_0x454f7c(0xeb)][_0x454f7c(0xb3)](_0x165612=>({'path':_0x165612[_0x454f7c(0xe8)],'risk':_0x165612[_0x454f7c(0xde)],'target':_0x165612[_0x454f7c(0xb8)]}))??[],'registryIndex':_0x1f874b[_0x454f7c(0xb0)],'registryServiceCode':_0x1f874b[_0x454f7c(0xc6)],'errors':_0x1f874b['report']['errors'],'warnings':_0x1f874b['report'][_0x454f7c(0xd6)]};}function a39_0x2dbc(){const _0xa8815d=['report','import','errors','14055dOdCJw','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','file','4355304NIqnyM','string','warnings','str','source','hash','serviceCount','export','length','normalizedManifest','risk','Updated','261kTJbCP','lower\x20kebab-case\x20service\x20code','registryPath','cliName','write','serviceCode','1388823rfJUEb','manifest','cliPath','type','validate','commands','1636602GICpAH','kind','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','reduce','required','entry','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','flags','\x20service(s).','Imported','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','registry','Service\x20manifest\x20validation\x20passed.','registryIndex','list','service','map','filePath','description','entries','imported','target','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','manifests','\x20service\x20','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','272770zMyWhU','WRITE','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','importedAt','Service\x20registry\x20validation\x20passed.','version','name','200ZSyRKO','remove','registryServiceCode','read','406849JLPhNn','2fEcBYX','detail','1286866rsRess','updated','replaced'];a39_0x2dbc=function(){return _0xa8815d;};return a39_0x2dbc();}export const serviceDefinitions=[{'service':'service','command':a39_0x3f56ff(0xea),'description':a39_0x3f56ff(0xbf),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x3b513d){const _0x268727=a39_0x3f56ff,_0x2afa46=loadServiceManifestFromFile(_0x3b513d['str'](_0x268727(0xd3)));if(!_0x2afa46[_0x268727(0xce)]['ok'])return{'ok':![],'data':{'file':_0x2afa46['filePath'],'hash':_0x2afa46[_0x268727(0xd9)],'kind':_0x2afa46['kind'],'serviceCount':_0x2afa46['manifests']['length'],'services':_0x2afa46[_0x268727(0xba)][_0x268727(0xb3)](summarizeLoadedManifest),'errors':_0x2afa46[_0x268727(0xce)][_0x268727(0xd0)],'warnings':_0x2afa46[_0x268727(0xce)][_0x268727(0xd6)]},'message':formatValidationFailure(_0x2afa46['report'])};if(_0x2afa46['kind']===_0x268727(0xae)||_0x2afa46[_0x268727(0xba)][_0x268727(0xdc)]!==0x1)return{'ok':!![],'data':{'file':_0x2afa46[_0x268727(0xb4)],'hash':_0x2afa46['hash'],'kind':_0x2afa46[_0x268727(0xed)],'serviceCount':_0x2afa46['manifests'][_0x268727(0xdc)],'commandCount':_0x2afa46[_0x268727(0xba)][_0x268727(0xef)]((_0x4ccbad,_0x42f160)=>_0x4ccbad+(_0x42f160[_0x268727(0xdd)]?.[_0x268727(0xeb)][_0x268727(0xdc)]??0x0),0x0),'services':_0x2afa46[_0x268727(0xba)][_0x268727(0xb3)](summarizeLoadedManifest),'warnings':_0x2afa46[_0x268727(0xce)][_0x268727(0xd6)]},'message':_0x268727(0xc1)};return{'ok':!![],'data':{'file':_0x2afa46['filePath'],'hash':_0x2afa46['hash'],'kind':_0x2afa46[_0x268727(0xed)],'service':_0x2afa46[_0x268727(0xdd)]?.[_0x268727(0xb2)],'version':_0x2afa46[_0x268727(0xdd)]?.[_0x268727(0xc2)],'commandCount':_0x2afa46['normalizedManifest']?.[_0x268727(0xeb)]['length']??0x0,'commands':_0x2afa46[_0x268727(0xdd)]?.[_0x268727(0xeb)][_0x268727(0xb3)](_0x1fe2de=>({'path':_0x1fe2de[_0x268727(0xe8)],'risk':_0x1fe2de[_0x268727(0xde)],'target':_0x1fe2de[_0x268727(0xb8)]})),'warnings':_0x2afa46[_0x268727(0xce)]['warnings']},'message':_0x268727(0xaf)};}},{'service':a39_0x3f56ff(0xb2),'command':a39_0x3f56ff(0xcf),'description':a39_0x3f56ff(0xee),'risk':a39_0x3f56ff(0xe4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1aaa27){const _0x4b7bee=a39_0x3f56ff,_0x27d06b=loadServiceManifestFromFile(_0x1aaa27[_0x4b7bee(0xd7)](_0x4b7bee(0xd3)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x27d06b[_0x4b7bee(0xb4)],'hash':_0x27d06b[_0x4b7bee(0xd9)],'kind':_0x27d06b['kind'],'ok':_0x27d06b[_0x4b7bee(0xce)]['ok'],'service':_0x27d06b[_0x4b7bee(0xdd)]?.['service'],'version':_0x27d06b[_0x4b7bee(0xdd)]?.[_0x4b7bee(0xc2)],'serviceCount':_0x27d06b[_0x4b7bee(0xba)][_0x4b7bee(0xdc)],'services':_0x27d06b[_0x4b7bee(0xba)][_0x4b7bee(0xb3)](_0x2076e8=>({'service':_0x2076e8[_0x4b7bee(0xdd)]?.[_0x4b7bee(0xb2)],'version':_0x2076e8['normalizedManifest']?.[_0x4b7bee(0xc2)],'commandCount':_0x2076e8[_0x4b7bee(0xdd)]?.[_0x4b7bee(0xeb)][_0x4b7bee(0xdc)]??0x0,'errors':_0x2076e8[_0x4b7bee(0xce)][_0x4b7bee(0xd0)]})),'errors':_0x27d06b['report'][_0x4b7bee(0xd0)],'commandCount':_0x27d06b[_0x4b7bee(0xdd)]?.[_0x4b7bee(0xeb)]['length']??0x0},'description':_0x4b7bee(0xbc)};},async 'execute'(_0x6812a6){const _0x53c684=a39_0x3f56ff,_0x5b871a=importServiceManifest(_0x6812a6[_0x53c684(0xd7)](_0x53c684(0xd3)));if(_0x5b871a[_0x53c684(0xb6)][_0x53c684(0xdc)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x5b871a[_0x53c684(0xe2)],'imported':_0x5b871a[_0x53c684(0xb7)],'updated':_0x5b871a[_0x53c684(0xcc)],'serviceCount':_0x5b871a[_0x53c684(0xda)],'services':_0x5b871a[_0x53c684(0xb6)][_0x53c684(0xb3)](summarizeService)},'message':'Imported\x20'+_0x5b871a[_0x53c684(0xb7)]+'\x20service(s),\x20updated\x20'+_0x5b871a['updated']+_0x53c684(0xf4)};return{'ok':!![],'data':{'registryPath':_0x5b871a[_0x53c684(0xe2)],'replaced':_0x5b871a[_0x53c684(0xcd)],'imported':_0x5b871a['imported'],'updated':_0x5b871a[_0x53c684(0xcc)],'serviceCount':_0x5b871a[_0x53c684(0xda)],'service':summarizeService(_0x5b871a['entry'])},'message':(_0x5b871a[_0x53c684(0xcd)]?_0x53c684(0xdf):_0x53c684(0xf5))+_0x53c684(0xbb)+_0x5b871a[_0x53c684(0xf1)][_0x53c684(0xe5)]+'.'};}},{'service':a39_0x3f56ff(0xb2),'command':a39_0x3f56ff(0xdb),'description':'Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','risk':a39_0x3f56ff(0xe4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x114476){const _0x272f68=a39_0x3f56ff,_0x39808d=getLocalServiceEntry(_0x114476[_0x272f68(0xd7)]('service'));return{'method':_0x272f68(0xbe),'url':_0x114476['str'](_0x272f68(0xd3)),'body':{'service':_0x114476['str']('service'),'found':Boolean(_0x39808d),'version':_0x39808d?.['version'],'source':_0x39808d?.[_0x272f68(0xd8)]},'description':_0x272f68(0xd2)};},async 'execute'(_0x3d7928){const _0x15b9cf=a39_0x3f56ff,_0x12890b=exportServiceManifest(_0x3d7928['str'](_0x15b9cf(0xb2)),_0x3d7928[_0x15b9cf(0xd7)](_0x15b9cf(0xd3)));return{'ok':!![],'data':{'registryPath':_0x12890b[_0x15b9cf(0xe2)],'file':_0x12890b[_0x15b9cf(0xb4)],'service':summarizeService(_0x12890b[_0x15b9cf(0xf1)])},'message':'Exported\x20service\x20'+_0x12890b[_0x15b9cf(0xf1)][_0x15b9cf(0xe5)]+'.'};}},{'service':a39_0x3f56ff(0xb2),'command':a39_0x3f56ff(0xb1),'description':a39_0x3f56ff(0xf6),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x4f1a56=a39_0x3f56ff,_0x129eeb=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x129eeb[_0x4f1a56(0xdc)],'services':_0x129eeb[_0x4f1a56(0xb3)](summarizeService)}};}},{'service':a39_0x3f56ff(0xb2),'command':a39_0x3f56ff(0xc5),'description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x3f56ff(0xe4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x53a87a){const _0x556c49=a39_0x3f56ff,_0x4efb07=getLocalServiceEntry(_0x53a87a['str'](_0x556c49(0xb2)));return{'method':_0x556c49(0xbe),'url':getServiceRegistryPath(),'body':{'service':_0x53a87a[_0x556c49(0xd7)](_0x556c49(0xb2)),'found':Boolean(_0x4efb07),'version':_0x4efb07?.[_0x556c49(0xc2)],'source':_0x4efb07?.[_0x556c49(0xd8)]},'description':_0x556c49(0xb9)};},async 'execute'(_0x599a6d){const _0x4ecc0f=a39_0x3f56ff,_0xc53506=removeServiceManifest(_0x599a6d[_0x4ecc0f(0xd7)](_0x4ecc0f(0xb2)));return{'ok':!![],'data':{'registryPath':_0xc53506['registryPath'],'serviceCount':_0xc53506[_0x4ecc0f(0xda)],'service':summarizeService(_0xc53506[_0x4ecc0f(0xf1)])},'message':'Removed\x20service\x20'+_0xc53506[_0x4ecc0f(0xf1)][_0x4ecc0f(0xe5)]+'.'};}},{'service':a39_0x3f56ff(0xb2),'command':a39_0x3f56ff(0xca),'description':a39_0x3f56ff(0xf2),'risk':a39_0x3f56ff(0xc7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x5ebe24){const _0x186172=a39_0x3f56ff,_0x3d4cc6=getLocalServiceEntry(_0x5ebe24[_0x186172(0xd7)](_0x186172(0xb2)));if(!_0x3d4cc6)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x5ebe24[_0x186172(0xd7)]('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x5ebe24[_0x186172(0xd7)](_0x186172(0xb2))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3d4cc6),'manifest':_0x3d4cc6[_0x186172(0xe7)],'normalizedManifest':_0x3d4cc6[_0x186172(0xdd)]}};}}];
|
|
1
|
+
const a39_0x18b36d=a39_0x4ede;function a39_0x4ede(_0x11a9b7,_0x4fa6cd){_0x11a9b7=_0x11a9b7-0x1b0;const _0x5c982d=a39_0x5c98();let _0x4ede04=_0x5c982d[_0x11a9b7];return _0x4ede04;}(function(_0x29d82d,_0x295a6f){const _0x366eed=a39_0x4ede,_0x8ba112=_0x29d82d();while(!![]){try{const _0x250382=parseInt(_0x366eed(0x1c4))/0x1+parseInt(_0x366eed(0x1eb))/0x2+-parseInt(_0x366eed(0x1c7))/0x3+-parseInt(_0x366eed(0x1dc))/0x4+-parseInt(_0x366eed(0x1b2))/0x5*(parseInt(_0x366eed(0x1e7))/0x6)+parseInt(_0x366eed(0x1ca))/0x7*(parseInt(_0x366eed(0x1c9))/0x8)+-parseInt(_0x366eed(0x1c1))/0x9*(-parseInt(_0x366eed(0x1ed))/0xa);if(_0x250382===_0x295a6f)break;else _0x8ba112['push'](_0x8ba112['shift']());}catch(_0x3c6ff5){_0x8ba112['push'](_0x8ba112['shift']());}}}(a39_0x5c98,0x8ed58));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x5c98(){const _0x305fa7=['type','\x20service\x20','Imported','target','Service\x20registry\x20validation\x20passed.','registry','Updated','registryPath','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','registryServiceCode','2972164FsJHWn','manifests','Local\x20service\x20code,\x20for\x20example\x20crm','hash','entry','file','write','string','service','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','report','42yjAvUF','remove','errors','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','1665230kGInpF','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','550sWTCTn','cliName','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','warnings','kind','str','cliPath','WRITE','serviceCount','Imported\x20','read','length','replaced','imported','source','650605jwxjSJ','version','registryIndex','risk','Service\x20manifest\x20validation\x20passed.','required','description','\x20service(s).','filePath','Exported\x20service\x20','import','\x20service(s),\x20updated\x20','normalizedManifest','validate','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','65718MVgmcT','commands','lower\x20kebab-case\x20service\x20code','1005972NPOAcN','export','flags','2466483EQgBRf','list','1641800LpacOw','28WpRVdv','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','serviceCode','updated','entries','Service\x20Tree\x20manifest\x20file\x20path','map','manifest'];a39_0x5c98=function(){return _0x305fa7;};return a39_0x5c98();}const FILE_FLAG={'name':a39_0x18b36d(0x1e1),'type':a39_0x18b36d(0x1e3),'required':!![],'description':a39_0x18b36d(0x1cf)},SERVICE_FLAG={'name':a39_0x18b36d(0x1e4),'type':a39_0x18b36d(0x1e3),'required':!![],'description':a39_0x18b36d(0x1de),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x18b36d(0x1c3)}};function summarizeService(_0x3f38f1){const _0x12eac7=a39_0x18b36d;return{'serviceCode':_0x3f38f1['serviceCode'],'name':_0x3f38f1['normalizedManifest'][_0x12eac7(0x1e4)]['name'],'version':_0x3f38f1['version'],'importedAt':_0x3f38f1['importedAt'],'source':_0x3f38f1[_0x12eac7(0x1b1)],'commandCount':_0x3f38f1[_0x12eac7(0x1be)][_0x12eac7(0x1c2)][_0x12eac7(0x1f8)],'commands':_0x3f38f1[_0x12eac7(0x1be)]['commands'][_0x12eac7(0x1d0)](_0xfeae48=>({'path':_0xfeae48[_0x12eac7(0x1f3)],'description':_0xfeae48[_0x12eac7(0x1b8)],'risk':_0xfeae48['risk'],'target':_0xfeae48[_0x12eac7(0x1d5)],'flags':_0xfeae48[_0x12eac7(0x1c6)][_0x12eac7(0x1d0)](_0xbbe015=>({'name':_0xbbe015['name'],'cliName':_0xbbe015[_0x12eac7(0x1ee)],'type':_0xbbe015[_0x12eac7(0x1d2)],'required':_0xbbe015[_0x12eac7(0x1b7)]===!![]}))}))};}function summarizeLoadedManifest(_0x426d71){const _0x4b7490=a39_0x18b36d;return{'service':_0x426d71[_0x4b7490(0x1be)]?.[_0x4b7490(0x1e4)],'version':_0x426d71[_0x4b7490(0x1be)]?.[_0x4b7490(0x1b3)],'commandCount':_0x426d71[_0x4b7490(0x1be)]?.['commands'][_0x4b7490(0x1f8)]??0x0,'commands':_0x426d71['normalizedManifest']?.[_0x4b7490(0x1c2)][_0x4b7490(0x1d0)](_0x11d05a=>({'path':_0x11d05a['cliPath'],'risk':_0x11d05a[_0x4b7490(0x1b5)],'target':_0x11d05a['target']}))??[],'registryIndex':_0x426d71[_0x4b7490(0x1b4)],'registryServiceCode':_0x426d71[_0x4b7490(0x1db)],'errors':_0x426d71[_0x4b7490(0x1e6)][_0x4b7490(0x1e9)],'warnings':_0x426d71['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1bf),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x5588ef){const _0x32a067=a39_0x18b36d,_0x1b492e=loadServiceManifestFromFile(_0x5588ef['str']('file'));if(!_0x1b492e['report']['ok'])return{'ok':![],'data':{'file':_0x1b492e[_0x32a067(0x1ba)],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e['kind'],'serviceCount':_0x1b492e['manifests']['length'],'services':_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1d0)](summarizeLoadedManifest),'errors':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1e9)],'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':formatValidationFailure(_0x1b492e[_0x32a067(0x1e6)])};if(_0x1b492e[_0x32a067(0x1f1)]===_0x32a067(0x1d7)||_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1f8)]!==0x1)return{'ok':!![],'data':{'file':_0x1b492e['filePath'],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e['kind'],'serviceCount':_0x1b492e['manifests'][_0x32a067(0x1f8)],'commandCount':_0x1b492e['manifests']['reduce']((_0x458459,_0x1c46e6)=>_0x458459+(_0x1c46e6[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1f8)]??0x0),0x0),'services':_0x1b492e[_0x32a067(0x1dd)][_0x32a067(0x1d0)](summarizeLoadedManifest),'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':_0x32a067(0x1d6)};return{'ok':!![],'data':{'file':_0x1b492e[_0x32a067(0x1ba)],'hash':_0x1b492e[_0x32a067(0x1df)],'kind':_0x1b492e[_0x32a067(0x1f1)],'service':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1e4)],'version':_0x1b492e['normalizedManifest']?.[_0x32a067(0x1b3)],'commandCount':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1f8)]??0x0,'commands':_0x1b492e[_0x32a067(0x1be)]?.[_0x32a067(0x1c2)][_0x32a067(0x1d0)](_0xe63950=>({'path':_0xe63950['cliPath'],'risk':_0xe63950[_0x32a067(0x1b5)],'target':_0xe63950['target']})),'warnings':_0x1b492e[_0x32a067(0x1e6)][_0x32a067(0x1f0)]},'message':_0x32a067(0x1b6)};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1bc),'description':a39_0x18b36d(0x1da),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x20d00f){const _0x3bae9c=a39_0x18b36d,_0x355d8e=loadServiceManifestFromFile(_0x20d00f[_0x3bae9c(0x1f2)](_0x3bae9c(0x1e1)));return{'method':_0x3bae9c(0x1f4),'url':getServiceRegistryPath(),'body':{'file':_0x355d8e[_0x3bae9c(0x1ba)],'hash':_0x355d8e[_0x3bae9c(0x1df)],'kind':_0x355d8e[_0x3bae9c(0x1f1)],'ok':_0x355d8e[_0x3bae9c(0x1e6)]['ok'],'service':_0x355d8e[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1e4)],'version':_0x355d8e[_0x3bae9c(0x1be)]?.['version'],'serviceCount':_0x355d8e[_0x3bae9c(0x1dd)][_0x3bae9c(0x1f8)],'services':_0x355d8e[_0x3bae9c(0x1dd)][_0x3bae9c(0x1d0)](_0x3fe340=>({'service':_0x3fe340[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1e4)],'version':_0x3fe340[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1b3)],'commandCount':_0x3fe340['normalizedManifest']?.['commands'][_0x3bae9c(0x1f8)]??0x0,'errors':_0x3fe340[_0x3bae9c(0x1e6)]['errors']})),'errors':_0x355d8e[_0x3bae9c(0x1e6)][_0x3bae9c(0x1e9)],'commandCount':_0x355d8e[_0x3bae9c(0x1be)]?.[_0x3bae9c(0x1c2)][_0x3bae9c(0x1f8)]??0x0},'description':_0x3bae9c(0x1c0)};},async 'execute'(_0x478b7b){const _0x493380=a39_0x18b36d,_0x2351a1=importServiceManifest(_0x478b7b['str']('file'));if(_0x2351a1['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x2351a1['registryPath'],'imported':_0x2351a1[_0x493380(0x1b0)],'updated':_0x2351a1[_0x493380(0x1cd)],'serviceCount':_0x2351a1[_0x493380(0x1f5)],'services':_0x2351a1[_0x493380(0x1ce)][_0x493380(0x1d0)](summarizeService)},'message':_0x493380(0x1f6)+_0x2351a1[_0x493380(0x1b0)]+_0x493380(0x1bd)+_0x2351a1[_0x493380(0x1cd)]+_0x493380(0x1b9)};return{'ok':!![],'data':{'registryPath':_0x2351a1[_0x493380(0x1d9)],'replaced':_0x2351a1[_0x493380(0x1f9)],'imported':_0x2351a1[_0x493380(0x1b0)],'updated':_0x2351a1[_0x493380(0x1cd)],'serviceCount':_0x2351a1[_0x493380(0x1f5)],'service':summarizeService(_0x2351a1[_0x493380(0x1e0)])},'message':(_0x2351a1[_0x493380(0x1f9)]?_0x493380(0x1d8):_0x493380(0x1d4))+_0x493380(0x1d3)+_0x2351a1[_0x493380(0x1e0)][_0x493380(0x1cc)]+'.'};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1c5),'description':a39_0x18b36d(0x1ea),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x54cf7d){const _0xa24e14=a39_0x18b36d,_0x37006a=getLocalServiceEntry(_0x54cf7d[_0xa24e14(0x1f2)]('service'));return{'method':'WRITE','url':_0x54cf7d[_0xa24e14(0x1f2)]('file'),'body':{'service':_0x54cf7d['str'](_0xa24e14(0x1e4)),'found':Boolean(_0x37006a),'version':_0x37006a?.['version'],'source':_0x37006a?.['source']},'description':_0xa24e14(0x1cb)};},async 'execute'(_0x36cc85){const _0x3ad32f=a39_0x18b36d,_0x2c60d6=exportServiceManifest(_0x36cc85[_0x3ad32f(0x1f2)](_0x3ad32f(0x1e4)),_0x36cc85[_0x3ad32f(0x1f2)]('file'));return{'ok':!![],'data':{'registryPath':_0x2c60d6[_0x3ad32f(0x1d9)],'file':_0x2c60d6[_0x3ad32f(0x1ba)],'service':summarizeService(_0x2c60d6['entry'])},'message':_0x3ad32f(0x1bb)+_0x2c60d6[_0x3ad32f(0x1e0)][_0x3ad32f(0x1cc)]+'.'};}},{'service':'service','command':a39_0x18b36d(0x1c8),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x4528fa=a39_0x18b36d,_0xc5a308=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0xc5a308[_0x4528fa(0x1f8)],'services':_0xc5a308[_0x4528fa(0x1d0)](summarizeService)}};}},{'service':a39_0x18b36d(0x1e4),'command':a39_0x18b36d(0x1e8),'description':a39_0x18b36d(0x1ec),'risk':a39_0x18b36d(0x1e2),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3642d9){const _0x466cb5=a39_0x18b36d,_0x5cb749=getLocalServiceEntry(_0x3642d9[_0x466cb5(0x1f2)](_0x466cb5(0x1e4)));return{'method':_0x466cb5(0x1f4),'url':getServiceRegistryPath(),'body':{'service':_0x3642d9[_0x466cb5(0x1f2)]('service'),'found':Boolean(_0x5cb749),'version':_0x5cb749?.['version'],'source':_0x5cb749?.[_0x466cb5(0x1b1)]},'description':_0x466cb5(0x1e5)};},async 'execute'(_0x554c95){const _0x6e347f=a39_0x18b36d,_0x509654=removeServiceManifest(_0x554c95['str'](_0x6e347f(0x1e4)));return{'ok':!![],'data':{'registryPath':_0x509654[_0x6e347f(0x1d9)],'serviceCount':_0x509654[_0x6e347f(0x1f5)],'service':summarizeService(_0x509654[_0x6e347f(0x1e0)])},'message':'Removed\x20service\x20'+_0x509654['entry']['serviceCode']+'.'};}},{'service':a39_0x18b36d(0x1e4),'command':'detail','description':a39_0x18b36d(0x1ef),'risk':a39_0x18b36d(0x1f7),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1bb32f){const _0x49bfe1=a39_0x18b36d,_0x2e06bd=getLocalServiceEntry(_0x1bb32f[_0x49bfe1(0x1f2)](_0x49bfe1(0x1e4)));if(!_0x2e06bd)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1bb32f[_0x49bfe1(0x1f2)](_0x49bfe1(0x1e4))},'message':'Local\x20service\x20not\x20found:\x20'+_0x1bb32f[_0x49bfe1(0x1f2)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2e06bd),'manifest':_0x2e06bd[_0x49bfe1(0x1d1)],'normalizedManifest':_0x2e06bd['normalizedManifest']}};}}];
|