@lovrabet/lovrabet-cli 2.1.11-beta.3 → 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 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_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_0x1444cf=a31_0xd1a9;(function(_0x76115e,_0x1d243c){const _0x25d703=a31_0xd1a9,_0x1ce621=_0x76115e();while(!![]){try{const _0x39d042=-parseInt(_0x25d703(0x1c6))/0x1+parseInt(_0x25d703(0x1b7))/0x2*(parseInt(_0x25d703(0x198))/0x3)+parseInt(_0x25d703(0x184))/0x4*(-parseInt(_0x25d703(0x181))/0x5)+-parseInt(_0x25d703(0x19e))/0x6+parseInt(_0x25d703(0x192))/0x7*(parseInt(_0x25d703(0x1b6))/0x8)+parseInt(_0x25d703(0x186))/0x9+parseInt(_0x25d703(0x1a0))/0xa;if(_0x39d042===_0x1d243c)break;else _0x1ce621['push'](_0x1ce621['shift']());}catch(_0x224e5b){_0x1ce621['push'](_0x1ce621['shift']());}}}(a31_0x508e,0x38e33));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';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x1444cf(0x1a4),'type':'string','description':a31_0x1444cf(0x1be)},{'name':a31_0x1444cf(0x1c0),'type':a31_0x1444cf(0x1b2),'description':a31_0x1444cf(0x195)+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1444cf(0x189),'type':a31_0x1444cf(0x1bf),'description':a31_0x1444cf(0x19f)+PRODUCT_CONFIG[a31_0x1444cf(0x1c2)]+a31_0x1444cf(0x1a2),'default':![]},{'name':'yes','type':a31_0x1444cf(0x1bf),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x1444cf(0x18d),'type':a31_0x1444cf(0x1b2),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x1444cf(0x1a4),'type':a31_0x1444cf(0x1b2),'description':a31_0x1444cf(0x1ab)},{'name':a31_0x1444cf(0x1c0),'type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x1444cf(0x189),'type':'boolean','description':a31_0x1444cf(0x19f)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x1444cf(0x18e),'type':a31_0x1444cf(0x1bf),'description':a31_0x1444cf(0x1a3),'default':![]}];export async function runInit(_0x40fbcf){const _0x380b59=a31_0x1444cf,_0xf778f8=isNonInteractiveMode(_0x40fbcf),_0x23abc9=_0x40fbcf[_0x380b59(0x189)]?_0x380b59(0x189):'project',_0x551aac=resolveWriteConfigPath(_0x23abc9);try{_0xf778f8?await runNonInteractive(_0x40fbcf,_0x551aac):await runInteractive(_0x40fbcf,_0x551aac);}catch(_0x145798){if(_0x145798 instanceof AbortPrompt)throw CliErrors[_0x380b59(0x1bd)]();throw _0x145798;}}export async function runInitImport(_0x2d7f5a){const _0x1d9c0a=a31_0x1444cf,_0x29c7aa=_0x2d7f5a['global']?_0x1d9c0a(0x189):_0x1d9c0a(0x1c4),_0x1cad43=resolveWriteConfigPath(_0x29c7aa);await runFromImport(_0x2d7f5a,_0x1cad43);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x1444cf(0x190)]);async function runFromImport(_0xb80ffc,_0x2b7059){const _0x1670b8=a31_0x1444cf,_0x337623=resolveFilePath(_0xb80ffc[_0x1670b8(0x18d)]);if(!existsSync(_0x337623))throw CliErrors[_0x1670b8(0x1ad)](_0x1670b8(0x180)+_0x337623);const _0x262b94=readSourceFile(_0x337623),_0x7f3e6b=convertToRuntimeConfig(_0x262b94);_0xb80ffc[_0x1670b8(0x1a4)]&&(_0x7f3e6b['appcode']=String(_0xb80ffc['appcode']));_0xb80ffc[_0x1670b8(0x1c0)]&&(_0x7f3e6b[_0x1670b8(0x1c0)]=resolveInitEnv(_0xb80ffc));if(!_0x7f3e6b[_0x1670b8(0x1a4)])throw CliErrors['validation'](_0x1670b8(0x1a1),'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(_0x2b7059,_0x7f3e6b,_0xb80ffc),console[_0x1670b8(0x1a9)](_0x1670b8(0x197)+_0x337623),console[_0x1670b8(0x1a9)](_0x1670b8(0x1ac)+_0x2b7059),console[_0x1670b8(0x1a9)]('\x20\x20appcode:\x20'+_0x7f3e6b[_0x1670b8(0x1a4)]);if(_0x7f3e6b['defaultApp'])console[_0x1670b8(0x1a9)]('\x20\x20default:\x20'+_0x7f3e6b[_0x1670b8(0x17f)]);}function a31_0x508e(){const _0x5817f9=['9492KnAEST','cwd','2094822FJLxeB','[y/N]','once','global','Usage:\x20','Initialized\x20','app','file','yes','File\x20','apiDir','race','7QnVNND','utf8','SIGINT','Target\x20environment\x20(default\x20','\x0aInitialized\x20','Imported\x20from\x20','9084zlLPWY','question','User\x20aborted\x20prompt','object','App\x20code','flagMissing','1525530ItQUmc','Write\x20to\x20global\x20(~/','1816390eyeCNZ','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',')\x20instead\x20of\x20project','Skip\x20confirmation\x20when\x20overwriting','appcode','[Y/n]','trim','parse','close','log','stdin','Override\x20imported\x20default\x20appcode','\x20\x20config:\x20\x20','validation','apps','name','\x20\x20appcode:\x20','message','string','stdout','Aborted.','AbortPrompt','1630984QSxLyh','8Emcnso','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','join','):\x20','\x22.\x20Allowed:\x20','riskLevel','cancelled','App\x20code\x20for\x20the\x20project','boolean','env','Invalid\x20env\x20\x22','newConfigFileName','toLowerCase','project','App\x20code\x20cannot\x20be\x20empty.','102775ASFpyX','defaultApp','Source\x20file\x20not\x20found:\x20','85OeUtxe','includes','\x20\x20env:\x20\x20\x20\x20\x20'];a31_0x508e=function(){return _0x5817f9;};return a31_0x508e();}function convertToRuntimeConfig(_0x3f53a7){const _0x312dba=a31_0x1444cf;if(_0x3f53a7[_0x312dba(0x1ae)]&&typeof _0x3f53a7[_0x312dba(0x1ae)]===_0x312dba(0x19b))throw CliErrors['validation'](_0x312dba(0x1b8),'Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x41f465={};for(const _0x545058 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x3f53a7[_0x545058]!==undefined&&(_0x41f465[_0x545058]=_0x3f53a7[_0x545058]);}return!_0x41f465[_0x312dba(0x1bc)]&&(_0x41f465[_0x312dba(0x1bc)]=DEFAULT_CONFIG_VALUES[_0x312dba(0x1bc)]),_0x41f465;}async function runNonInteractive(_0x3e52fd,_0x6b764c){const _0x364d35=a31_0x1444cf,_0x1cfab4=_0x3e52fd[_0x364d35(0x1a4)];if(!_0x1cfab4)throw CliErrors[_0x364d35(0x19d)]('appcode',_0x364d35(0x18a)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x1e6843=resolveInitEnv(_0x3e52fd);await writeInitConfig(_0x6b764c,{'appcode':_0x1cfab4,'env':_0x1e6843},_0x3e52fd),console[_0x364d35(0x1a9)](_0x364d35(0x18b)+_0x6b764c),console[_0x364d35(0x1a9)]('\x20\x20appcode:\x20'+_0x1cfab4),console[_0x364d35(0x1a9)](_0x364d35(0x183)+_0x1e6843);}async function runInteractive(_0x3888a2,_0x773f78){const _0x288152=a31_0x1444cf,_0xb8d53f=loadExisting(_0x773f78),_0x234b40=typeof _0xb8d53f?.['appcode']===_0x288152(0x1b2)?_0xb8d53f[_0x288152(0x1a4)]:'',_0x1677d3=resolveInitEnv(_0x3888a2);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x288152(0x1c2)]+'\x0a');if(existsSync(_0x773f78)&&!_0x3888a2[_0x288152(0x18e)]){const _0x322f26=await promptYesNo(_0x288152(0x18f)+_0x773f78+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x322f26){console[_0x288152(0x1a9)](_0x288152(0x1b4));return;}}const _0x4da01e=typeof _0x3888a2[_0x288152(0x1a4)]===_0x288152(0x1b2)?_0x3888a2[_0x288152(0x1a4)][_0x288152(0x1a6)]():'';let _0x4a5bcc=_0x4da01e;!_0x4a5bcc&&(_0x4a5bcc=await promptInput(_0x288152(0x19c),_0x234b40));if(!_0x4a5bcc[_0x288152(0x1a6)]())throw CliErrors[_0x288152(0x1ad)](_0x288152(0x1c5));await writeInitConfig(_0x773f78,{'appcode':_0x4a5bcc[_0x288152(0x1a6)](),'env':_0x1677d3},_0x3888a2),console['log'](_0x288152(0x196)+_0x773f78),console[_0x288152(0x1a9)](_0x288152(0x1b0)+_0x4a5bcc[_0x288152(0x1a6)]()),console[_0x288152(0x1a9)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x1677d3);}function a31_0xd1a9(_0x4d1754,_0x566df9){_0x4d1754=_0x4d1754-0x17f;const _0x508e99=a31_0x508e();let _0xd1a959=_0x508e99[_0x4d1754];return _0xd1a959;}async function writeInitConfig(_0x4e9951,_0x320c69,_0x130128){const _0x15efba=a31_0x1444cf;let _0xf7c952={};existsSync(_0x4e9951)&&!_0x130128[_0x15efba(0x18e)]&&(_0xf7c952=readConfigFile(_0x4e9951));for(const [_0x2ffc75,_0x57753b]of Object['entries'](_0x320c69)){_0x57753b!==undefined&&(_0xf7c952[_0x2ffc75]=_0x57753b);}if(_0xf7c952[_0x15efba(0x18c)])delete _0xf7c952[_0x15efba(0x18c)];writeConfigFile(_0x4e9951,_0xf7c952);}class AbortPrompt extends Error{constructor(){const _0x2ec583=a31_0x1444cf;super(_0x2ec583(0x19a)),this[_0x2ec583(0x1af)]=_0x2ec583(0x1b5);}}function createSafeRl(){const _0x5b1d19=a31_0x1444cf,_0x410f34=createInterface({'input':process[_0x5b1d19(0x1aa)],'output':process[_0x5b1d19(0x1b3)]});let _0x23385d;const _0x1d9d83=new Promise((_0x23950e,_0xc490ec)=>{const _0x27cb96=_0x5b1d19;_0x23385d=()=>{const _0x416c67=a31_0xd1a9;_0x23385d&&(_0x410f34['removeListener'](_0x416c67(0x194),_0x23385d),_0x23385d=undefined);try{_0x410f34['close']();}catch{}_0xc490ec(new AbortPrompt());},_0x410f34[_0x27cb96(0x188)]('SIGINT',_0x23385d);}),_0xd371ce=()=>{const _0x2c2eac=_0x5b1d19;_0x23385d&&(_0x410f34['removeListener']('SIGINT',_0x23385d),_0x23385d=undefined);try{_0x410f34[_0x2c2eac(0x1a8)]();}catch{}};return{'rl':_0x410f34,'abortPromise':_0x1d9d83,'disposeSuccess':_0xd371ce};}async function promptInput(_0xb73746,_0x564734){const _0x1328af=a31_0x1444cf,{rl:_0x50a625,abortPromise:_0x39fabe,disposeSuccess:_0xc8934b}=createSafeRl(),_0x47aa1f=new Promise(_0x1e91c2=>{const _0x105d06=a31_0xd1a9,_0x395c4b=_0x564734?'\x20\x20'+_0xb73746+'\x20('+_0x564734+_0x105d06(0x1ba):'\x20\x20'+_0xb73746+':\x20';_0x50a625[_0x105d06(0x199)](_0x395c4b,_0x15162c=>{const _0x228377=_0x105d06;_0xc8934b(),_0x1e91c2(_0x15162c[_0x228377(0x1a6)]()||_0x564734);});});return Promise[_0x1328af(0x191)]([_0x47aa1f,_0x39fabe]);}async function promptYesNo(_0x5c08c7,_0xe6b9f4){const _0x3acc91=a31_0x1444cf,{rl:_0x135e20,abortPromise:_0x19939b,disposeSuccess:_0x1adc25}=createSafeRl(),_0x2bd815=new Promise(_0x458ab3=>{const _0x19348d=a31_0xd1a9,_0x52c752=_0xe6b9f4?_0x19348d(0x1a5):_0x19348d(0x187);_0x135e20[_0x19348d(0x199)]('\x20\x20'+_0x5c08c7+'\x20'+_0x52c752+':\x20',_0x1be0a9=>{const _0x4135a0=_0x19348d;_0x1adc25();const _0xdff363=_0x1be0a9[_0x4135a0(0x1a6)]()[_0x4135a0(0x1c3)]();if(_0xdff363==='y'||_0xdff363===_0x4135a0(0x18e))_0x458ab3(!![]);else{if(_0xdff363==='n'||_0xdff363==='no')_0x458ab3(![]);else _0x458ab3(_0xe6b9f4);}});});return Promise[_0x3acc91(0x191)]([_0x2bd815,_0x19939b]);}function loadExisting(_0xf322ef){if(!existsSync(_0xf322ef))return null;return readConfigFile(_0xf322ef);}function resolveFilePath(_0xda9825){const _0x1767e8=a31_0x1444cf;return isAbsolute(_0xda9825)?_0xda9825:resolve(process[_0x1767e8(0x185)](),_0xda9825);}function readSourceFile(_0x1b7dae){const _0x1eb643=a31_0x1444cf;try{const _0x388586=readFileSync(_0x1b7dae,{'encoding':_0x1eb643(0x193)});return JSON[_0x1eb643(0x1a7)](_0x388586);}catch(_0x13a77e){throw CliErrors[_0x1eb643(0x1ad)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x13a77e[_0x1eb643(0x1b1)]);}}function resolveInitEnv(_0x382a75){const _0x4ee7d4=a31_0x1444cf,_0x9e7140=_0x382a75[_0x4ee7d4(0x1c0)];if(_0x9e7140===undefined||_0x9e7140==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x4ee7d4(0x182)](_0x9e7140))throw CliErrors[_0x4ee7d4(0x1ad)](_0x4ee7d4(0x1c1)+_0x9e7140+_0x4ee7d4(0x1bb)+RUNTIME_ENV_VALUES[_0x4ee7d4(0x1b9)](',\x20'));return _0x9e7140;}
|
|
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
|
-
const
|
|
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
|
-
|
|
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
|
-
function a35_0x4d1a(_0x4167cc,_0x1c84c9){_0x4167cc=_0x4167cc-0x139;const _0x598867=a35_0x5988();let _0x4d1a72=_0x598867[_0x4167cc];return _0x4d1a72;}const a35_0x3a5729=a35_0x4d1a;(function(_0x3af67e,_0x20cd97){const _0xa8676c=a35_0x4d1a,_0x218fdf=_0x3af67e();while(!![]){try{const _0x5d03f0=-parseInt(_0xa8676c(0x14a))/0x1*(-parseInt(_0xa8676c(0x178))/0x2)+parseInt(_0xa8676c(0x141))/0x3*(parseInt(_0xa8676c(0x13d))/0x4)+parseInt(_0xa8676c(0x158))/0x5*(parseInt(_0xa8676c(0x14c))/0x6)+parseInt(_0xa8676c(0x15b))/0x7*(-parseInt(_0xa8676c(0x157))/0x8)+parseInt(_0xa8676c(0x150))/0x9+-parseInt(_0xa8676c(0x151))/0xa*(-parseInt(_0xa8676c(0x156))/0xb)+-parseInt(_0xa8676c(0x164))/0xc;if(_0x5d03f0===_0x20cd97)break;else _0x218fdf['push'](_0x218fdf['shift']());}catch(_0x2c9a6c){_0x218fdf['push'](_0x218fdf['shift']());}}}(a35_0x5988,0x6211c));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';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_0x3a5729(0x14b),'type':a35_0x3a5729(0x173),'description':a35_0x3a5729(0x16d)},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x3a5729(0x173),'required':!![],'description':a35_0x3a5729(0x160)},DESCRIPTION_FLAG={'name':a35_0x3a5729(0x179),'type':'string','description':a35_0x3a5729(0x145)},SOURCE_SESSION_FLAG={'name':a35_0x3a5729(0x175),'type':'string','description':a35_0x3a5729(0x16a)};function normalizeFunctionName(_0x4f431b){const _0x73837c=a35_0x3a5729,_0x5e8064=String(_0x4f431b||'')[_0x73837c(0x16f)]();if(!_0x5e8064||!FUNCTION_NAME_PATTERN['test'](_0x5e8064))throw CliErrors[_0x73837c(0x16b)](_0x73837c(0x177));return _0x5e8064;}function readScriptFile(_0x2aa4bd){const _0x5eea42=a35_0x3a5729;if(!_0x2aa4bd)throw CliErrors[_0x5eea42(0x16b)](_0x5eea42(0x176));if(!existsSync(_0x2aa4bd))throw CliErrors['validation'](_0x5eea42(0x140)+_0x2aa4bd);if(!statSync(_0x2aa4bd)[_0x5eea42(0x153)]())throw CliErrors[_0x5eea42(0x16b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x2aa4bd);const _0x136f70=readFileSync(_0x2aa4bd,'utf8');if(!_0x136f70[_0x5eea42(0x16f)]())throw CliErrors[_0x5eea42(0x16b)](_0x5eea42(0x147));return _0x136f70;}function optionalTrimmed(_0x581e65){const _0x26be85=a35_0x3a5729,_0x48845e=String(_0x581e65||'')[_0x26be85(0x16f)]();return _0x48845e||undefined;}function summarizeBff(_0x18381c){const _0xbda98b=a35_0x3a5729;return{'id':_0x18381c['id'],'appCode':_0x18381c['appCode'],'functionName':_0x18381c[_0xbda98b(0x170)],'description':_0x18381c[_0xbda98b(0x179)],'scriptType':_0x18381c['scriptType'],'version':_0x18381c[_0xbda98b(0x15f)],'gmtModified':_0x18381c[_0xbda98b(0x152)],'updateTime':_0x18381c[_0xbda98b(0x16c)]};}function detailBff(_0xc0a779){const _0x7dd107=a35_0x3a5729;return{'id':_0xc0a779['id'],'appCode':_0xc0a779[_0x7dd107(0x149)],'functionName':_0xc0a779[_0x7dd107(0x170)],'description':_0xc0a779[_0x7dd107(0x179)],'scriptType':_0xc0a779[_0x7dd107(0x154)],'scriptContent':_0xc0a779[_0x7dd107(0x174)]??'','config':_0xc0a779[_0x7dd107(0x148)],'version':_0xc0a779['version'],'createUserId':_0xc0a779[_0x7dd107(0x17b)],'gmtCreate':_0xc0a779['gmtCreate'],'gmtModified':_0xc0a779[_0x7dd107(0x152)],'createTime':_0xc0a779['createTime'],'updateTime':_0xc0a779[_0x7dd107(0x16c)]};}function buildCreateInput(_0x57e735){const _0x4ce7f5=a35_0x3a5729;return{'functionName':normalizeFunctionName(_0x57e735[_0x4ce7f5(0x142)](_0x4ce7f5(0x13b))),...optionalTrimmed(_0x57e735[_0x4ce7f5(0x142)]('description'))?{'description':optionalTrimmed(_0x57e735[_0x4ce7f5(0x142)](_0x4ce7f5(0x179)))}:{},'scriptContent':readScriptFile(_0x57e735['str'](_0x4ce7f5(0x14b))),...optionalTrimmed(_0x57e735[_0x4ce7f5(0x142)](_0x4ce7f5(0x175)))?{'sourceSessionId':optionalTrimmed(_0x57e735[_0x4ce7f5(0x142)](_0x4ce7f5(0x175)))}:{}};}function buildUpdateInput(_0x1a0b31){const _0x45e0d1=a35_0x3a5729,_0x358d28={};optionalTrimmed(_0x1a0b31['str'](_0x45e0d1(0x13b)))&&(_0x358d28[_0x45e0d1(0x170)]=normalizeFunctionName(_0x1a0b31[_0x45e0d1(0x142)]('name')));_0x1a0b31['flag']('description')!==undefined&&(_0x358d28[_0x45e0d1(0x179)]=_0x1a0b31[_0x45e0d1(0x142)](_0x45e0d1(0x179)));optionalTrimmed(_0x1a0b31[_0x45e0d1(0x142)](_0x45e0d1(0x14b)))&&(_0x358d28[_0x45e0d1(0x174)]=readScriptFile(_0x1a0b31[_0x45e0d1(0x142)]('file')));_0x1a0b31[_0x45e0d1(0x163)](_0x45e0d1(0x175))!==undefined&&(_0x358d28[_0x45e0d1(0x168)]=_0x1a0b31[_0x45e0d1(0x142)]('source-session-id'));if(Object[_0x45e0d1(0x143)](_0x358d28)['length']===0x0)throw CliErrors[_0x45e0d1(0x16b)](_0x45e0d1(0x16e));return _0x358d28;}function parseExecParams(_0x336888){const _0xe2f0cf=a35_0x3a5729,_0x530d59=parseJsonParams(_0x336888)??{};if(Array[_0xe2f0cf(0x144)](_0x530d59))throw CliErrors[_0xe2f0cf(0x16b)](_0xe2f0cf(0x166));return _0x530d59;}function a35_0x5988(){const _0x5236e0=['Update\x20a\x20personal\x20BFF\x20by\x20id','name','Preview:\x20update\x20personal\x20BFF\x20','31516LRZETq','update','params','File\x20not\x20found:\x20','291PPdnZH','str','keys','isArray','Personal\x20BFF\x20description','Show\x20one\x20personal\x20BFF\x20by\x20id','Personal\x20BFF\x20script\x20file\x20is\x20blank.','config','appCode','349IJJvZy','file','403464HbkfEw','build','/client/runtime-bff/personal/','/update','2717991riGMhP','1294120vdAbIL','gmtModified','isFile','scriptType','personal-bff','11InRiAL','40SrzAKD','50KdXjTI','create','detail','353402Zqlgjr','exec','num','/client/runtime-bff/personal/create','version','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Created\x20personal\x20BFF\x20','write','flag','20967168toSDuf','POST','--params\x20must\x20be\x20a\x20JSON\x20object.','Updated\x20personal\x20BFF\x20','sourceSessionId','list','Optional\x20source\x20RuntimeAgent\x20session\x20id','validation','updateTime','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','trim','functionName','read','high-risk-write','string','scriptContent','source-session-id','File\x20path\x20is\x20required.','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','3056JQhbkA','description','body','createUserId','Executed\x20personal\x20BFF\x20'];a35_0x5988=function(){return _0x5236e0;};return a35_0x5988();}const personalBffList={'service':a35_0x3a5729(0x155),'command':a35_0x3a5729(0x169),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x3a5729(0x171),'flags':[VERBOSE_FLAG],async 'execute'(_0x4b7cb1){const _0x3bca3a=a35_0x3a5729,_0x17140a=await listPersonalBffs(_0x4b7cb1[_0x3bca3a(0x149)]);return{'ok':!![],'data':{'total':_0x17140a['length'],'items':_0x4b7cb1['bool']('verbose')?_0x17140a:_0x17140a['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x3a5729(0x155),'command':a35_0x3a5729(0x15a),'description':a35_0x3a5729(0x146),'risk':a35_0x3a5729(0x171),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x5250e0){const _0x34de6b=a35_0x3a5729,_0x35473f=await getPersonalBff(_0x5250e0['num']('id'),_0x5250e0[_0x34de6b(0x149)]);return{'ok':!![],'data':detailBff(_0x35473f)};}},personalBffCreate={'service':a35_0x3a5729(0x155),'command':a35_0x3a5729(0x159),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x3a5729(0x162),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x16b5a0){const _0x395025=a35_0x3a5729,_0x520629=buildCreateInput(_0x16b5a0),_0x52b8a0=await createPersonalBff(_0x16b5a0[_0x395025(0x149)],_0x520629);return{'ok':!![],'data':detailBff(_0x52b8a0),'message':_0x395025(0x161)+_0x52b8a0['id']+(_0x52b8a0[_0x395025(0x170)]?'\x20('+_0x52b8a0[_0x395025(0x170)]+')':'')};},async 'dryRun'(_0x590dcf){const _0x186c30=a35_0x3a5729,_0xc70a8c=buildCreateInput(_0x590dcf);return dryRun(_0x186c30(0x165),_0x186c30(0x15e))[_0x186c30(0x17a)]({'appCode':_0x590dcf[_0x186c30(0x149)],..._0xc70a8c})[_0x186c30(0x179)]('Preview:\x20create\x20personal\x20BFF\x20'+_0xc70a8c[_0x186c30(0x170)])['build']();}},personalBffUpdate={'service':a35_0x3a5729(0x155),'command':a35_0x3a5729(0x13e),'description':a35_0x3a5729(0x13a),'risk':a35_0x3a5729(0x162),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x2928b0){const _0x5f5ba6=a35_0x3a5729,_0x3b4c67=_0x2928b0[_0x5f5ba6(0x15d)]('id'),_0x4b65a5=buildUpdateInput(_0x2928b0),_0x4f2ce7=await updatePersonalBff(_0x3b4c67,_0x2928b0['appCode'],_0x4b65a5);return{'ok':!![],'data':detailBff(_0x4f2ce7),'message':_0x5f5ba6(0x167)+_0x4f2ce7['id']+(_0x4f2ce7[_0x5f5ba6(0x170)]?'\x20('+_0x4f2ce7['functionName']+')':'')};},async 'dryRun'(_0x590115){const _0x14146a=a35_0x3a5729,_0x566aeb=_0x590115['num']('id'),_0x341ba0=buildUpdateInput(_0x590115);return dryRun('POST',_0x14146a(0x14e)+_0x566aeb+_0x14146a(0x14f))[_0x14146a(0x17a)]({'appCode':_0x590115[_0x14146a(0x149)],..._0x341ba0})['description'](_0x14146a(0x13c)+_0x566aeb)[_0x14146a(0x14d)]();}},personalBffExec={'service':a35_0x3a5729(0x155),'command':a35_0x3a5729(0x15c),'description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x3a5729(0x172),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x5c48b6){const _0x33dfe1=a35_0x3a5729;parseExecParams(_0x5c48b6[_0x33dfe1(0x142)]('params'));},async 'execute'(_0x3d9974){const _0x12549a=a35_0x3a5729,_0x445412=_0x3d9974[_0x12549a(0x15d)]('id'),_0x483d92=parseExecParams(_0x3d9974['str'](_0x12549a(0x13f))),_0x3a7010=await executePersonalBff(_0x445412,_0x3d9974[_0x12549a(0x149)],_0x483d92);return{'ok':!![],'data':{'result':_0x3a7010},'message':_0x12549a(0x139)+_0x445412};}};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
|
-
function
|
|
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(_0x263773,_0x2793d1){const _0x3c7c18=a38_0x503e,_0x4be2ff=_0x263773();while(!![]){try{const _0x39612c=parseInt(_0x3c7c18(0x20f))/0x1*(-parseInt(_0x3c7c18(0x21e))/0x2)+parseInt(_0x3c7c18(0x217))/0x3+-parseInt(_0x3c7c18(0x232))/0x4*(parseInt(_0x3c7c18(0x1df))/0x5)+-parseInt(_0x3c7c18(0x23d))/0x6*(-parseInt(_0x3c7c18(0x241))/0x7)+parseInt(_0x3c7c18(0x1fa))/0x8+parseInt(_0x3c7c18(0x1e1))/0x9+parseInt(_0x3c7c18(0x223))/0xa*(-parseInt(_0x3c7c18(0x1e9))/0xb);if(_0x39612c===_0x2793d1)break;else _0x4be2ff['push'](_0x4be2ff['shift']());}catch(_0x5d908d){_0x4be2ff['push'](_0x4be2ff['shift']());}}}(a38_0x5431,0x9a3fa));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(_0x4b0431,_0x257560){const _0x365913=a38_0x503e,_0x1d1f93=listLocalServiceTrees();let _0x3d61a9;for(const _0xad8891 of _0x1d1f93){const _0x13e867=matchServiceTreeCommand(_0xad8891,_0x4b0431);if(!_0x13e867)continue;(!_0x3d61a9||_0x13e867[_0x365913(0x225)][_0x365913(0x22c)][_0x365913(0x229)]>_0x3d61a9['command']['fullPath'][_0x365913(0x229)])&&(_0x3d61a9={'tree':_0xad8891,'command':_0x13e867[_0x365913(0x225)],'remainingArgs':_0x13e867[_0x365913(0x1ea)]});}if(!_0x3d61a9)return undefined;const _0x16fc72={..._0x257560};return applyAppBinding(_0x3d61a9[_0x365913(0x239)],_0x3d61a9[_0x365913(0x225)],_0x16fc72),{'definition':buildDynamicCommandDefinition(_0x3d61a9[_0x365913(0x239)],_0x3d61a9['command']),'args':_0x3d61a9[_0x365913(0x1ea)],'flags':_0x16fc72,'tree':_0x3d61a9[_0x365913(0x239)],'command':_0x3d61a9[_0x365913(0x225)]};}export function generateDynamicServiceHelp(_0x2dff40){const _0x5b7d60=a38_0x503e,_0x456df3=listLocalServiceTrees()[_0x5b7d60(0x214)](_0x517ea2=>_0x517ea2[_0x5b7d60(0x1e8)][_0x5b7d60(0x23e)]===_0x2dff40);if(!_0x456df3)return undefined;const _0x57b6a7=[CLI_BIN_NAME+'\x20'+_0x2dff40+_0x5b7d60(0x222),'',_0x456df3[_0x5b7d60(0x1e8)]['name']||_0x2dff40,_0x456df3[_0x5b7d60(0x1e8)]['description']?'\x20\x20'+_0x456df3[_0x5b7d60(0x1e8)][_0x5b7d60(0x1e3)]:'','',_0x5b7d60(0x202),..._0x456df3['commands']['map'](_0x36b009=>{const _0xb4a501=_0x5b7d60,_0x8e7f1c=_0x36b009[_0xb4a501(0x22c)][_0xb4a501(0x240)](0x1)[_0xb4a501(0x231)]('\x20'),_0x53368d=_0x36b009[_0xb4a501(0x1e4)]==='read'?'':'\x20['+_0x36b009[_0xb4a501(0x1e4)]+']';return'\x20\x20'+_0x8e7f1c[_0xb4a501(0x1e0)](0x18)+'\x20'+(_0x36b009[_0xb4a501(0x1e3)]||'')+_0x53368d;}),'',_0x5b7d60(0x207)+CLI_BIN_NAME+_0x5b7d60(0x1e5)+_0x2dff40+_0x5b7d60(0x21f)][_0x5b7d60(0x22f)](Boolean);return _0x57b6a7['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x21a0a0=>{const _0xc88036=a38_0x503e,_0x355f52=_0x21a0a0['normalizedManifest'];return{'service':_0x355f52[_0xc88036(0x1e8)][_0xc88036(0x23e)],'label':_0x355f52['service'][_0xc88036(0x234)]||_0x355f52[_0xc88036(0x1e8)]['code'],'commands':_0x355f52[_0xc88036(0x1f4)][_0xc88036(0x230)](_0x3ccf30=>({'command':dynamicCommandName(_0x3ccf30),'description':_0x3ccf30['description']||_0xc88036(0x219)+_0x3ccf30[_0xc88036(0x22a)],'tag':riskTag(_0x3ccf30[_0xc88036(0x1e4)])}))};});}export function getDynamicServiceEntry(_0x16c3a4){const _0x1dc032=a38_0x503e;return listDynamicServiceEntries()[_0x1dc032(0x214)](_0x40f5d0=>_0x40f5d0[_0x1dc032(0x1e8)]===_0x16c3a4);}export function listDynamicServiceDefinitions(_0xa45ab){const _0x4df2eb=a38_0x503e;return listLocalServiceTrees()[_0x4df2eb(0x22f)](_0x231d35=>!_0xa45ab||_0x231d35['service'][_0x4df2eb(0x23e)]===_0xa45ab)[_0x4df2eb(0x233)](_0x364448=>_0x364448[_0x4df2eb(0x1f4)][_0x4df2eb(0x230)](_0x1cb348=>buildDynamicCommandDefinition(_0x364448,_0x1cb348)));}export function getDynamicServiceDefinitions(_0x1c937b){const _0x37287f=a38_0x503e,_0x250944=listDynamicServiceDefinitions(_0x1c937b);return _0x250944[_0x37287f(0x229)]>0x0?_0x250944:undefined;}export function findDynamicServiceDefinition(_0x35ea8d,_0x12ec3f){const _0x473106=a38_0x503e;return listDynamicServiceDefinitions(_0x35ea8d)[_0x473106(0x214)](_0x3afc45=>_0x3afc45[_0x473106(0x225)]===_0x12ec3f);}export function buildDynamicCommandDefinition(_0x35428c,_0x28ab84){const _0x41ab8f=a38_0x503e;return{'service':_0x35428c['service']['code'],'command':dynamicCommandName(_0x28ab84),'description':_0x28ab84[_0x41ab8f(0x1e3)]||_0x41ab8f(0x219)+_0x28ab84[_0x41ab8f(0x22a)],'risk':_0x28ab84[_0x41ab8f(0x1e4)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x28ab84['args'][_0x41ab8f(0x230)](_0x3743dd=>({'name':_0x3743dd['name'],'description':_0x3743dd[_0x41ab8f(0x1e3)]||_0x3743dd[_0x41ab8f(0x234)],'required':_0x3743dd[_0x41ab8f(0x22e)]})),'flags':_0x28ab84['flags']['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x28ab84),async 'dryRun'(_0x318b24){const _0x4ff9ad=_0x41ab8f,_0x3f4018=await compilePlan(_0x28ab84,_0x318b24);return{'method':'SERVICE_TREE','url':_0x28ab84['cliPath'],'body':{'target':targetPreview(_0x3f4018),'params':_0x3f4018[_0x4ff9ad(0x226)]},'description':_0x4ff9ad(0x1e2)+_0x28ab84[_0x4ff9ad(0x22a)]};},async 'execute'(_0x44d882){const _0x319483=_0x41ab8f,_0x5b60a1=await compilePlan(_0x28ab84,_0x44d882),_0x33abf8=Date[_0x319483(0x206)](),_0x4c36b0=await executePlan(_0x5b60a1,_0x28ab84,_0x44d882),_0x558667=Date[_0x319483(0x206)]()-_0x33abf8;return{'ok':!![],'data':{'service':_0x35428c['service'],'command':_0x28ab84[_0x319483(0x22a)],'target':targetPreview(_0x5b60a1),'result':_0x4c36b0,'elapsed':_0x558667},'message':_0x319483(0x216)+_0x28ab84[_0x319483(0x22a)]+_0x319483(0x1f2)+_0x558667+'ms'};}};}function dynamicCommandName(_0x3fc03d){const _0x28f3eb=a38_0x503e;return _0x3fc03d[_0x28f3eb(0x22c)]['slice'](0x1)[_0x28f3eb(0x231)]('\x20');}function riskTag(_0x38e26b){return _0x38e26b==='read'?'':'\x20\x20['+_0x38e26b+']';}function flagToCommandFlag(_0x117d05){const _0x57c2cf=a38_0x503e;return{'name':_0x117d05[_0x57c2cf(0x1eb)],'type':_0x117d05[_0x57c2cf(0x1f0)]===_0x57c2cf(0x1f8)?'string':_0x117d05[_0x57c2cf(0x1f0)],'description':_0x117d05['description']||_0x117d05['name'],'required':_0x117d05[_0x57c2cf(0x22e)],'default':isPrimitiveFlagDefault(_0x117d05[_0x57c2cf(0x23f)])?_0x117d05['default']:undefined,'enum':_0x117d05['enum']};}async function compilePlan(_0x2d2191,_0x237a89){const _0x22e4cc=a38_0x503e;return compileServiceTreeCommand(_0x2d2191,{'flags':_0x237a89[_0x22e4cc(0x237)],'args':_0x237a89['args'],'context':await buildServiceContext(_0x2d2191,_0x237a89)});}async function buildServiceContext(_0x447efa,_0x2a1640){const _0x2984cc=a38_0x503e,_0x2b8ad5={'appCode':_0x2a1640[_0x2984cc(0x22d)],'env':_0x2a1640['envName'],'envName':_0x2a1640[_0x2984cc(0x20d)]};if(!usesRuntimeContext(_0x447efa))return _0x2b8ad5;const _0x490351=await getLoginUserInfo(),_0xbb1674=pickFirst(_0x490351[_0x2984cc(0x1f9)],_0x490351['id']);return{..._0x2b8ad5,'user':_0x490351,'userId':_0xbb1674,'id':_0x490351['id'],'username':pickFirst(_0x490351[_0x2984cc(0x23c)],_0x490351['userName'],_0x490351[_0x2984cc(0x201)]),'userName':_0x490351[_0x2984cc(0x1f6)],'nickname':pickFirst(_0x490351[_0x2984cc(0x213)],_0x490351[_0x2984cc(0x224)]),'nickName':_0x490351['nickName'],'tenantCode':_0x490351[_0x2984cc(0x210)],'employeeId':_0x490351[_0x2984cc(0x211)]};}function usesRuntimeContext(_0x57a442){const _0x57aee3=a38_0x503e;return _0x57a442[_0x57aee3(0x1f5)]['some'](_0x55b9bc=>typeof _0x55b9bc[_0x57aee3(0x1f3)]===_0x57aee3(0x1de)&&(_0x55b9bc[_0x57aee3(0x1f3)]['startsWith'](_0x57aee3(0x1f1))||_0x55b9bc[_0x57aee3(0x1f3)]['startsWith'](_0x57aee3(0x1ec))));}function pickFirst(..._0x690cb4){return _0x690cb4['find'](_0x3d1f0c=>_0x3d1f0c!==undefined&&_0x3d1f0c!==null);}async function executePlan(_0x292ad8,_0x430f23,_0x32a0ac){const _0x50c2ae=a38_0x503e;if(_0x292ad8[_0x50c2ae(0x1e7)]===_0x50c2ae(0x1dd)){const _0x45f3aa=await resolveDatasetCode(_0x292ad8,_0x430f23,_0x32a0ac);return executeData(_0x45f3aa,_0x292ad8[_0x50c2ae(0x225)],_0x292ad8['params']);}if(_0x292ad8[_0x50c2ae(0x1e7)]===_0x50c2ae(0x204)){if(!_0x292ad8[_0x50c2ae(0x236)])throw CliErrors[_0x50c2ae(0x21c)](_0x50c2ae(0x216)+_0x430f23['cliPath']+_0x50c2ae(0x218));return executeSdkSql(_0x292ad8[_0x50c2ae(0x236)],normalizeScalarParams(_0x292ad8['params']));}if(_0x292ad8[_0x50c2ae(0x1e7)]===_0x50c2ae(0x220)){const _0x330ad1=_0x292ad8[_0x50c2ae(0x228)]||_0x292ad8['bffCode']||(_0x292ad8['bffId']==null?'':String(_0x292ad8[_0x50c2ae(0x22b)]));if(!_0x330ad1)throw CliErrors[_0x50c2ae(0x21c)](_0x50c2ae(0x216)+_0x430f23[_0x50c2ae(0x22a)]+_0x50c2ae(0x1ed));return executeSdkBff(_0x330ad1,_0x292ad8[_0x50c2ae(0x226)]);}throw CliErrors[_0x50c2ae(0x21c)](_0x50c2ae(0x1fd)+_0x292ad8[_0x50c2ae(0x1e7)]);}function a38_0x503e(_0x1d57b5,_0x2005ab){_0x1d57b5=_0x1d57b5-0x1dd;const _0x543124=a38_0x5431();let _0x503ee6=_0x543124[_0x1d57b5];return _0x503ee6;}async function resolveDatasetCode(_0x299d36,_0x2e3f11,_0x1d9648){const _0x482225=a38_0x503e;if(_0x299d36[_0x482225(0x221)])return _0x299d36['datasetCode'];if(!_0x299d36[_0x482225(0x1ff)])throw CliErrors['validation'](_0x482225(0x216)+_0x2e3f11['cliPath']+_0x482225(0x23a));const _0x1222cc=await listDatasets(_0x1d9648[_0x482225(0x22d)]),_0x1ca902=_0x1222cc[_0x482225(0x214)](_0x48e912=>_0x48e912[_0x482225(0x23b)]?.[_0x482225(0x227)]===_0x299d36[_0x482225(0x1ff)]);if(!_0x1ca902?.[_0x482225(0x23e)])throw CliErrors[_0x482225(0x21c)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x299d36['datatable']+_0x482225(0x20b)+_0x1d9648[_0x482225(0x22d)]+'.',_0x482225(0x215));return _0x1ca902['code'];}function applyAppBinding(_0x204fa8,_0x488e36,_0x211579){const _0x291d78=a38_0x503e,_0x3e84b5=_0x488e36[_0x291d78(0x21d)][_0x291d78(0x212)];if(!_0x3e84b5)return;const _0x294494=_0x204fa8[_0x291d78(0x205)][_0x3e84b5];if(!_0x294494)throw CliErrors[_0x291d78(0x21c)](_0x291d78(0x1fc)+_0x3e84b5+_0x291d78(0x242)+_0x488e36[_0x291d78(0x22a)]+'.',_0x291d78(0x238));const _0xc9e8bd=_0x294494[_0x291d78(0x20c)]||_0x294494[_0x291d78(0x22d)];_0xc9e8bd&&!hasText(_0x211579[_0x291d78(0x20c)])&&(_0x211579[_0x291d78(0x20c)]=_0xc9e8bd),_0x294494[_0x291d78(0x1fe)]&&!hasText(_0x211579['app'])&&!hasText(_0x211579[_0x291d78(0x20c)])&&(_0x211579[_0x291d78(0x1fe)]=_0x294494[_0x291d78(0x1fe)]),_0x294494[_0x291d78(0x209)]&&!hasText(_0x211579['env'])&&(_0x211579['env']=_0x294494[_0x291d78(0x209)]);}function renderDynamicCommandHelp(_0xe87156){const _0x469250=a38_0x503e,_0x1fb37e=[_0x469250(0x1ee),_0x469250(0x1f7)+_0xe87156[_0x469250(0x21d)]['kind'],_0x469250(0x21b)+_0xe87156['target'][_0x469250(0x225)]];if(_0xe87156[_0x469250(0x21d)][_0x469250(0x221)])_0x1fb37e['push']('\x20\x20\x20\x20datasetCode:\x20'+_0xe87156[_0x469250(0x21d)][_0x469250(0x221)]);if(_0xe87156[_0x469250(0x21d)][_0x469250(0x1ff)])_0x1fb37e[_0x469250(0x203)](_0x469250(0x21a)+_0xe87156[_0x469250(0x21d)][_0x469250(0x1ff)]);if(_0xe87156[_0x469250(0x21d)][_0x469250(0x236)])_0x1fb37e[_0x469250(0x203)]('\x20\x20\x20\x20sqlCode:\x20'+_0xe87156['target'][_0x469250(0x236)]);if(_0xe87156[_0x469250(0x21d)][_0x469250(0x228)])_0x1fb37e[_0x469250(0x203)]('\x20\x20\x20\x20scriptName:\x20'+_0xe87156[_0x469250(0x21d)][_0x469250(0x228)]);if(_0xe87156[_0x469250(0x1f5)][_0x469250(0x229)]>0x0){_0x1fb37e[_0x469250(0x203)]('','\x20\x20MAP\x20TO');for(const _0x59b500 of _0xe87156[_0x469250(0x1f5)]){_0x1fb37e[_0x469250(0x203)](_0x469250(0x20a)+(_0x59b500[_0x469250(0x1f3)]||_0x469250(0x200))+_0x469250(0x1fb)+_0x59b500[_0x469250(0x21d)]+(_0x59b500[_0x469250(0x1e6)]?'.'+_0x59b500[_0x469250(0x1e6)]:''));}}return _0x1fb37e[_0x469250(0x231)]('\x0a');}function a38_0x5431(){const _0x18c153=['Unknown\x20appRef\x20\x22','Unsupported\x20service\x20target\x20kind:\x20','app','datatable','const','loginName','Commands:','push','sql','appBindings','now','Use\x20`','number','env','\x20\x20\x20\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','appcode','envName','entries','133486hTRVWi','tenantCode','employeeId','appRef','nickname','find','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','Service\x20command\x20','105000bxLypk','\x20requires\x20target.sqlCode.','Run\x20service\x20command\x20','\x20\x20\x20\x20datatable:\x20','\x20\x20\x20\x20command:\x20','validation','target','16iPDuOV','`\x20to\x20inspect\x20the\x20manifest.','bff','datasetCode','\x20<command>\x20[flags]','5030xvkmfc','nickName','command','params','tableName','scriptName','length','cliPath','bffId','fullPath','appCode','required','filter','map','join','42364CKNuoj','flatMap','name','fromEntries','sqlCode','rawFlags','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','tree','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','dbtableConfig','username','6CXVYYY','code','default','slice','7114219jZRYHR','\x22\x20in\x20service\x20command\x20','data','string','90uLIbZT','padEnd','9911907ehWEqi','Preview\x20dynamic\x20service\x20command:\x20','description','risk','\x20service\x20detail\x20--service\x20','operator','kind','service','28017TEvDle','remainingArgs','cliName','ctx.','\x20requires\x20target.scriptName.','\x20\x20SERVICE\x20TREE\x20TARGET','boolean','type','context.','\x20completed\x20in\x20','source','commands','mapTo','userName','\x20\x20\x20\x20kind:\x20\x20\x20\x20','json','userId','8150632VDDlHB','\x20->\x20'];a38_0x5431=function(){return _0x18c153;};return a38_0x5431();}function targetPreview(_0x2abb6d){const _0x6f4a5f=a38_0x503e;return{'kind':_0x2abb6d[_0x6f4a5f(0x1e7)],'command':_0x2abb6d['command'],'appRef':_0x2abb6d['appRef'],'datasetCode':_0x2abb6d['datasetCode'],'datatable':_0x2abb6d['datatable'],'sqlCode':_0x2abb6d[_0x6f4a5f(0x236)],'bffCode':_0x2abb6d['bffCode'],'bffId':_0x2abb6d[_0x6f4a5f(0x22b)],'scriptName':_0x2abb6d[_0x6f4a5f(0x228)]};}function normalizeScalarParams(_0xb84337){const _0x8b67cb=a38_0x503e;return Object[_0x8b67cb(0x235)](Object[_0x8b67cb(0x20e)](_0xb84337)[_0x8b67cb(0x22f)](([,_0x263d81])=>typeof _0x263d81===_0x8b67cb(0x1de)||typeof _0x263d81===_0x8b67cb(0x208)));}function hasText(_0x415cc4){const _0x2bcdfe=a38_0x503e;return typeof _0x415cc4===_0x2bcdfe(0x1de)&&_0x415cc4['trim']()['length']>0x0;}function isPrimitiveFlagDefault(_0x4f9f9c){const _0x5f414d=a38_0x503e;return _0x4f9f9c===undefined||typeof _0x4f9f9c===_0x5f414d(0x1de)||typeof _0x4f9f9c===_0x5f414d(0x208)||typeof _0x4f9f9c===_0x5f414d(0x1ef);}
|
|
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
|
-
const a39_0xbf5b75=a39_0x58de;(function(_0x2abf9a,_0x56f29c){const _0x5b05af=a39_0x58de,_0x1f5b37=_0x2abf9a();while(!![]){try{const _0x386d48=-parseInt(_0x5b05af(0xf1))/0x1*(parseInt(_0x5b05af(0x133))/0x2)+parseInt(_0x5b05af(0x130))/0x3*(-parseInt(_0x5b05af(0x119))/0x4)+parseInt(_0x5b05af(0x111))/0x5+-parseInt(_0x5b05af(0x103))/0x6*(parseInt(_0x5b05af(0x115))/0x7)+-parseInt(_0x5b05af(0x11a))/0x8*(parseInt(_0x5b05af(0x12c))/0x9)+-parseInt(_0x5b05af(0x107))/0xa*(-parseInt(_0x5b05af(0x117))/0xb)+parseInt(_0x5b05af(0x106))/0xc*(parseInt(_0x5b05af(0x128))/0xd);if(_0x386d48===_0x56f29c)break;else _0x1f5b37['push'](_0x1f5b37['shift']());}catch(_0x2725b1){_0x1f5b37['push'](_0x1f5b37['shift']());}}}(a39_0x17e1,0x212fe));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a39_0x58de(_0x3ba42c,_0x3dcc7f){_0x3ba42c=_0x3ba42c-0xed;const _0x17e14d=a39_0x17e1();let _0x58de25=_0x17e14d[_0x3ba42c];return _0x58de25;}const FILE_FLAG={'name':a39_0xbf5b75(0x136),'type':a39_0xbf5b75(0x101),'required':!![],'description':a39_0xbf5b75(0x12f)},SERVICE_FLAG={'name':a39_0xbf5b75(0xf9),'type':a39_0xbf5b75(0x101),'required':!![],'description':'Local\x20service\x20code,\x20for\x20example\x20crm','pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0xbf5b75(0x113)}};function a39_0x17e1(){const _0x564c98=['type','length','registry','entry','required','serviceCode','normalizedManifest','cliPath','Exported\x20service\x20','risk','13uoQwre','warnings','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','replaced','27DYTrKH','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','write','Service\x20Tree\x20manifest\x20file\x20path','3UosOEJ','version','errors','254066OFQBDo','str','detail','file','importedAt','entries','WRITE','flags','1RBQSJD','cliName','manifests','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','hash','list','target','remove','service','registryServiceCode','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Removed\x20service\x20','commands','\x20service(s).','string','\x20service\x20','53790HxcSII','registryPath','imported','4054512aDiNBL','22260wQjevb','map','serviceCount','name','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','\x20service(s),\x20updated\x20','updated','registryIndex','kind','report','266650LIVQlx','filePath','lower\x20kebab-case\x20service\x20code','Imported\x20','77qMQHDu','validate','1199UnHHAR','Service\x20registry\x20validation\x20passed.','823652DZXgQD','176920aaQUxs','read','description','Imported'];a39_0x17e1=function(){return _0x564c98;};return a39_0x17e1();}function summarizeService(_0x81d66b){const _0x8dcef7=a39_0xbf5b75;return{'serviceCode':_0x81d66b[_0x8dcef7(0x123)],'name':_0x81d66b[_0x8dcef7(0x124)][_0x8dcef7(0xf9)][_0x8dcef7(0x10a)],'version':_0x81d66b[_0x8dcef7(0x131)],'importedAt':_0x81d66b[_0x8dcef7(0xed)],'source':_0x81d66b['source'],'commandCount':_0x81d66b[_0x8dcef7(0x124)][_0x8dcef7(0xff)][_0x8dcef7(0x11f)],'commands':_0x81d66b['normalizedManifest']['commands'][_0x8dcef7(0x108)](_0x21d59a=>({'path':_0x21d59a[_0x8dcef7(0x125)],'description':_0x21d59a[_0x8dcef7(0x11c)],'risk':_0x21d59a[_0x8dcef7(0x127)],'target':_0x21d59a[_0x8dcef7(0xf7)],'flags':_0x21d59a[_0x8dcef7(0xf0)][_0x8dcef7(0x108)](_0x3574a4=>({'name':_0x3574a4[_0x8dcef7(0x10a)],'cliName':_0x3574a4[_0x8dcef7(0xf2)],'type':_0x3574a4[_0x8dcef7(0x11e)],'required':_0x3574a4[_0x8dcef7(0x122)]===!![]}))}))};}function summarizeLoadedManifest(_0x232cc1){const _0x208323=a39_0xbf5b75;return{'service':_0x232cc1[_0x208323(0x124)]?.['service'],'version':_0x232cc1[_0x208323(0x124)]?.[_0x208323(0x131)],'commandCount':_0x232cc1[_0x208323(0x124)]?.[_0x208323(0xff)][_0x208323(0x11f)]??0x0,'commands':_0x232cc1['normalizedManifest']?.[_0x208323(0xff)][_0x208323(0x108)](_0x4b4b0f=>({'path':_0x4b4b0f['cliPath'],'risk':_0x4b4b0f[_0x208323(0x127)],'target':_0x4b4b0f['target']}))??[],'registryIndex':_0x232cc1[_0x208323(0x10e)],'registryServiceCode':_0x232cc1[_0x208323(0xfa)],'errors':_0x232cc1['report'][_0x208323(0x132)],'warnings':_0x232cc1[_0x208323(0x110)]['warnings']};}export const serviceDefinitions=[{'service':a39_0xbf5b75(0xf9),'command':a39_0xbf5b75(0x116),'description':a39_0xbf5b75(0xfb),'risk':a39_0xbf5b75(0x11b),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x1bb4a9){const _0x5fc5c6=a39_0xbf5b75,_0x4138ff=loadServiceManifestFromFile(_0x1bb4a9[_0x5fc5c6(0x134)](_0x5fc5c6(0x136)));if(!_0x4138ff['report']['ok'])return{'ok':![],'data':{'file':_0x4138ff[_0x5fc5c6(0x112)],'hash':_0x4138ff['hash'],'kind':_0x4138ff[_0x5fc5c6(0x10f)],'serviceCount':_0x4138ff[_0x5fc5c6(0xf3)][_0x5fc5c6(0x11f)],'services':_0x4138ff['manifests'][_0x5fc5c6(0x108)](summarizeLoadedManifest),'errors':_0x4138ff[_0x5fc5c6(0x110)][_0x5fc5c6(0x132)],'warnings':_0x4138ff['report']['warnings']},'message':formatValidationFailure(_0x4138ff[_0x5fc5c6(0x110)])};if(_0x4138ff[_0x5fc5c6(0x10f)]===_0x5fc5c6(0x120)||_0x4138ff[_0x5fc5c6(0xf3)][_0x5fc5c6(0x11f)]!==0x1)return{'ok':!![],'data':{'file':_0x4138ff[_0x5fc5c6(0x112)],'hash':_0x4138ff[_0x5fc5c6(0xf5)],'kind':_0x4138ff[_0x5fc5c6(0x10f)],'serviceCount':_0x4138ff['manifests'][_0x5fc5c6(0x11f)],'commandCount':_0x4138ff[_0x5fc5c6(0xf3)]['reduce']((_0x6b4c79,_0x51d982)=>_0x6b4c79+(_0x51d982[_0x5fc5c6(0x124)]?.['commands'][_0x5fc5c6(0x11f)]??0x0),0x0),'services':_0x4138ff[_0x5fc5c6(0xf3)][_0x5fc5c6(0x108)](summarizeLoadedManifest),'warnings':_0x4138ff[_0x5fc5c6(0x110)][_0x5fc5c6(0x129)]},'message':_0x5fc5c6(0x118)};return{'ok':!![],'data':{'file':_0x4138ff['filePath'],'hash':_0x4138ff[_0x5fc5c6(0xf5)],'kind':_0x4138ff[_0x5fc5c6(0x10f)],'service':_0x4138ff[_0x5fc5c6(0x124)]?.[_0x5fc5c6(0xf9)],'version':_0x4138ff['normalizedManifest']?.['version'],'commandCount':_0x4138ff[_0x5fc5c6(0x124)]?.['commands'][_0x5fc5c6(0x11f)]??0x0,'commands':_0x4138ff[_0x5fc5c6(0x124)]?.['commands'][_0x5fc5c6(0x108)](_0x3bbfe5=>({'path':_0x3bbfe5[_0x5fc5c6(0x125)],'risk':_0x3bbfe5[_0x5fc5c6(0x127)],'target':_0x3bbfe5[_0x5fc5c6(0xf7)]})),'warnings':_0x4138ff[_0x5fc5c6(0x110)][_0x5fc5c6(0x129)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':a39_0xbf5b75(0xf9),'command':'import','description':'Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','risk':a39_0xbf5b75(0x12e),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x159852){const _0x4fb7b0=a39_0xbf5b75,_0x51e3ae=loadServiceManifestFromFile(_0x159852[_0x4fb7b0(0x134)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x51e3ae[_0x4fb7b0(0x112)],'hash':_0x51e3ae[_0x4fb7b0(0xf5)],'kind':_0x51e3ae['kind'],'ok':_0x51e3ae['report']['ok'],'service':_0x51e3ae[_0x4fb7b0(0x124)]?.[_0x4fb7b0(0xf9)],'version':_0x51e3ae[_0x4fb7b0(0x124)]?.[_0x4fb7b0(0x131)],'serviceCount':_0x51e3ae[_0x4fb7b0(0xf3)][_0x4fb7b0(0x11f)],'services':_0x51e3ae[_0x4fb7b0(0xf3)]['map'](_0x3a3233=>({'service':_0x3a3233['normalizedManifest']?.[_0x4fb7b0(0xf9)],'version':_0x3a3233['normalizedManifest']?.[_0x4fb7b0(0x131)],'commandCount':_0x3a3233[_0x4fb7b0(0x124)]?.[_0x4fb7b0(0xff)][_0x4fb7b0(0x11f)]??0x0,'errors':_0x3a3233[_0x4fb7b0(0x110)][_0x4fb7b0(0x132)]})),'errors':_0x51e3ae[_0x4fb7b0(0x110)][_0x4fb7b0(0x132)],'commandCount':_0x51e3ae[_0x4fb7b0(0x124)]?.[_0x4fb7b0(0xff)][_0x4fb7b0(0x11f)]??0x0},'description':_0x4fb7b0(0x12d)};},async 'execute'(_0x258650){const _0x3841e1=a39_0xbf5b75,_0x5621a5=importServiceManifest(_0x258650[_0x3841e1(0x134)](_0x3841e1(0x136)));if(_0x5621a5[_0x3841e1(0xee)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x5621a5['registryPath'],'imported':_0x5621a5[_0x3841e1(0x105)],'updated':_0x5621a5[_0x3841e1(0x10d)],'serviceCount':_0x5621a5[_0x3841e1(0x109)],'services':_0x5621a5[_0x3841e1(0xee)][_0x3841e1(0x108)](summarizeService)},'message':_0x3841e1(0x114)+_0x5621a5['imported']+_0x3841e1(0x10c)+_0x5621a5['updated']+_0x3841e1(0x100)};return{'ok':!![],'data':{'registryPath':_0x5621a5[_0x3841e1(0x104)],'replaced':_0x5621a5[_0x3841e1(0x12b)],'imported':_0x5621a5[_0x3841e1(0x105)],'updated':_0x5621a5[_0x3841e1(0x10d)],'serviceCount':_0x5621a5['serviceCount'],'service':summarizeService(_0x5621a5[_0x3841e1(0x121)])},'message':(_0x5621a5[_0x3841e1(0x12b)]?'Updated':_0x3841e1(0x11d))+_0x3841e1(0x102)+_0x5621a5['entry'][_0x3841e1(0x123)]+'.'};}},{'service':'service','command':'export','description':a39_0xbf5b75(0xfd),'risk':a39_0xbf5b75(0x12e),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x107a9b){const _0x1bf76a=a39_0xbf5b75,_0x547c81=getLocalServiceEntry(_0x107a9b['str'](_0x1bf76a(0xf9)));return{'method':_0x1bf76a(0xef),'url':_0x107a9b[_0x1bf76a(0x134)](_0x1bf76a(0x136)),'body':{'service':_0x107a9b[_0x1bf76a(0x134)]('service'),'found':Boolean(_0x547c81),'version':_0x547c81?.['version'],'source':_0x547c81?.['source']},'description':_0x1bf76a(0x12a)};},async 'execute'(_0x55b56b){const _0x1b13d2=a39_0xbf5b75,_0xf8973d=exportServiceManifest(_0x55b56b[_0x1b13d2(0x134)]('service'),_0x55b56b[_0x1b13d2(0x134)](_0x1b13d2(0x136)));return{'ok':!![],'data':{'registryPath':_0xf8973d['registryPath'],'file':_0xf8973d[_0x1b13d2(0x112)],'service':summarizeService(_0xf8973d[_0x1b13d2(0x121)])},'message':_0x1b13d2(0x126)+_0xf8973d[_0x1b13d2(0x121)][_0x1b13d2(0x123)]+'.'};}},{'service':a39_0xbf5b75(0xf9),'command':a39_0xbf5b75(0xf6),'description':a39_0xbf5b75(0xfc),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x306f42=a39_0xbf5b75,_0x3287f6=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3287f6[_0x306f42(0x11f)],'services':_0x3287f6[_0x306f42(0x108)](summarizeService)}};}},{'service':a39_0xbf5b75(0xf9),'command':a39_0xbf5b75(0xf8),'description':a39_0xbf5b75(0x10b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x3666f3){const _0x4f9ad8=a39_0xbf5b75,_0x1d57c2=getLocalServiceEntry(_0x3666f3['str']('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x3666f3[_0x4f9ad8(0x134)]('service'),'found':Boolean(_0x1d57c2),'version':_0x1d57c2?.[_0x4f9ad8(0x131)],'source':_0x1d57c2?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0xf151a0){const _0x118d09=a39_0xbf5b75,_0x58081a=removeServiceManifest(_0xf151a0[_0x118d09(0x134)](_0x118d09(0xf9)));return{'ok':!![],'data':{'registryPath':_0x58081a['registryPath'],'serviceCount':_0x58081a[_0x118d09(0x109)],'service':summarizeService(_0x58081a[_0x118d09(0x121)])},'message':_0x118d09(0xfe)+_0x58081a[_0x118d09(0x121)]['serviceCode']+'.'};}},{'service':a39_0xbf5b75(0xf9),'command':a39_0xbf5b75(0x135),'description':a39_0xbf5b75(0xf4),'risk':a39_0xbf5b75(0x11b),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x28c164){const _0x36e626=a39_0xbf5b75,_0x2d1827=getLocalServiceEntry(_0x28c164[_0x36e626(0x134)]('service'));if(!_0x2d1827)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x28c164[_0x36e626(0x134)](_0x36e626(0xf9))},'message':'Local\x20service\x20not\x20found:\x20'+_0x28c164[_0x36e626(0x134)](_0x36e626(0xf9))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x2d1827),'manifest':_0x2d1827['manifest'],'normalizedManifest':_0x2d1827[_0x36e626(0x124)]}};}}];
|
|
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']}};}}];
|