@lovrabet/lovrabet-cli 2.1.10 → 2.1.11-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a30_0x17bb(_0x41669e,_0x417ab2){_0x41669e=_0x41669e-0xc2;const _0x25d803=a30_0x25d8();let _0x17bba3=_0x25d803[_0x41669e];return _0x17bba3;}const a30_0x29c4f8=a30_0x17bb;(function(_0x27357e,_0x2ed1a5){const _0x1469fc=a30_0x17bb,_0x70608e=_0x27357e();while(!![]){try{const _0x449fcd=-parseInt(_0x1469fc(0xe5))/0x1+-parseInt(_0x1469fc(0xd9))/0x2+-parseInt(_0x1469fc(0xdb))/0x3*(parseInt(_0x1469fc(0xd3))/0x4)+-parseInt(_0x1469fc(0xe6))/0x5*(-parseInt(_0x1469fc(0xc4))/0x6)+-parseInt(_0x1469fc(0xda))/0x7*(-parseInt(_0x1469fc(0xc8))/0x8)+-parseInt(_0x1469fc(0xc3))/0x9*(-parseInt(_0x1469fc(0xdd))/0xa)+parseInt(_0x1469fc(0xe4))/0xb;if(_0x449fcd===_0x2ed1a5)break;else _0x70608e['push'](_0x70608e['shift']());}catch(_0x4f3ceb){_0x70608e['push'](_0x70608e['shift']());}}}(a30_0x25d8,0xd587a));function a30_0x25d8(){const _0x530105=['build','1810tkmajG','description','validation','string','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported','str','filePath\x20is\x20required.','8412074zwOhSi','341169HEhKRN','4767405lvizST','appCode','write','51201YeMdcO','6xXScTw','Uploaded\x20file.','File','upload','4333768CKeYbn','Preview:\x20upload\x20','query-url','Path\x20to\x20the\x20local\x20file\x20to\x20upload','body','download','/client/uploadFile','filePath','Uploaded\x20file:\x20','POST','filepath','3024312zqbgal','Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','trim','Runtime\x20filePath\x20returned\x20by\x20file\x20upload','file','Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','2635560MiKxyp','7lKWjyG','3ZKbbrg'];a30_0x25d8=function(){return _0x530105;};return a30_0x25d8();}import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x29c4f8(0xd7),'type':a30_0x29c4f8(0xe0),'required':!![],'description':a30_0x29c4f8(0xcb)},FILEPATH_FLAG={'name':a30_0x29c4f8(0xd2),'type':a30_0x29c4f8(0xe0),'required':!![],'description':a30_0x29c4f8(0xd6)},DOWNLOAD_FLAG={'name':a30_0x29c4f8(0xcd),'type':'boolean','description':a30_0x29c4f8(0xe1)};function requireFilePath(_0x23fdd9){const _0x19fd95=a30_0x29c4f8,_0x1f2a63=_0x23fdd9[_0x19fd95(0xd5)]();if(!_0x1f2a63)throw CliErrors[_0x19fd95(0xdf)](_0x19fd95(0xe3));return _0x1f2a63;}const fileUpload={'service':'file','command':a30_0x29c4f8(0xc7),'description':a30_0x29c4f8(0xd4),'risk':a30_0x29c4f8(0xc2),'flags':[FILE_FLAG],async 'dryRun'(_0x3c3c03){const _0x59c7b9=a30_0x29c4f8,_0x342154=requireRuntimeUploadFile(_0x3c3c03['str'](_0x59c7b9(0xd7)),'File');return dryRun(_0x59c7b9(0xd1),_0x59c7b9(0xce))[_0x59c7b9(0xcc)]({'appCode':_0x3c3c03[_0x59c7b9(0xe7)],'multipart':{'file':_0x342154}})[_0x59c7b9(0xde)](_0x59c7b9(0xc9)+_0x342154['path']+'\x20to\x20runtime\x20app\x20'+_0x3c3c03[_0x59c7b9(0xe7)])[_0x59c7b9(0xdc)]();},async 'execute'(_0x28a960){const _0x120f04=a30_0x29c4f8,_0x1f3a6e=requireRuntimeUploadFile(_0x28a960[_0x120f04(0xe2)](_0x120f04(0xd7)),_0x120f04(0xc6)),_0x121845=await uploadRuntimeFile(_0x28a960[_0x120f04(0xe7)],_0x1f3a6e['path']);return{'ok':!![],'data':_0x121845,'message':_0x121845[_0x120f04(0xcf)]?_0x120f04(0xd0)+_0x121845[_0x120f04(0xcf)]:_0x120f04(0xc5)};}},fileQueryUrl={'service':a30_0x29c4f8(0xd7),'command':a30_0x29c4f8(0xca),'description':a30_0x29c4f8(0xd8),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x28cb98){const _0x398b85=a30_0x29c4f8,_0x42e95f=requireFilePath(_0x28cb98['str'](_0x398b85(0xd2))),_0xa70882=await queryRuntimeFileUrl(_0x42e95f,{'download':_0x28cb98['bool'](_0x398b85(0xcd))});return{'ok':!![],'data':_0xa70882};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x465e3c=a31_0x15ce;(function(_0x29688a,_0x208655){const _0x1fca02=a31_0x15ce,_0x14da55=_0x29688a();while(!![]){try{const _0x318ef=parseInt(_0x1fca02(0x107))/0x1+-parseInt(_0x1fca02(0xdc))/0x2*(-parseInt(_0x1fca02(0xdf))/0x3)+parseInt(_0x1fca02(0xfe))/0x4*(parseInt(_0x1fca02(0xd8))/0x5)+-parseInt(_0x1fca02(0xf3))/0x6+parseInt(_0x1fca02(0x105))/0x7+parseInt(_0x1fca02(0xc8))/0x8*(parseInt(_0x1fca02(0x108))/0x9)+-parseInt(_0x1fca02(0xdb))/0xa*(parseInt(_0x1fca02(0xfd))/0xb);if(_0x318ef===_0x208655)break;else _0x14da55['push'](_0x14da55['shift']());}catch(_0x284335){_0x14da55['push'](_0x14da55['shift']());}}}(a31_0x4601,0xb83fc));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_0x15ce(_0x538e7f,_0x5de2cb){_0x538e7f=_0x538e7f-0xc6;const _0x46018c=a31_0x4601();let _0x15ceab=_0x46018c[_0x538e7f];return _0x15ceab;}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_0x465e3c(0xe2),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xd2)},{'name':a31_0x465e3c(0xfa),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xda)+DEFAULT_CONFIG_VALUES[a31_0x465e3c(0xfa)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x465e3c(0xd5),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0x100)+PRODUCT_CONFIG[a31_0x465e3c(0xea)]+a31_0x465e3c(0xf4),'default':![]},{'name':a31_0x465e3c(0xef),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0xf6),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x465e3c(0xed),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0x109),'required':!![]},{'name':a31_0x465e3c(0xe2),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xee)},{'name':a31_0x465e3c(0xfa),'type':a31_0x465e3c(0xc9),'description':a31_0x465e3c(0xe8),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x465e3c(0xd5),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0x100)+PRODUCT_CONFIG[a31_0x465e3c(0xea)]+a31_0x465e3c(0xf4),'default':![]},{'name':a31_0x465e3c(0xef),'type':a31_0x465e3c(0xec),'description':a31_0x465e3c(0xf6),'default':![]}];export async function runInit(_0x580e71){const _0x28ee5d=a31_0x465e3c,_0x466706=isNonInteractiveMode(_0x580e71),_0x12d437=_0x580e71[_0x28ee5d(0xd5)]?_0x28ee5d(0xd5):_0x28ee5d(0xce),_0x1424b1=resolveWriteConfigPath(_0x12d437);try{_0x466706?await runNonInteractive(_0x580e71,_0x1424b1):await runInteractive(_0x580e71,_0x1424b1);}catch(_0x13ca01){if(_0x13ca01 instanceof AbortPrompt)throw CliErrors[_0x28ee5d(0xdd)]();throw _0x13ca01;}}export async function runInitImport(_0x501f16){const _0x3861ae=a31_0x465e3c,_0x53957d=_0x501f16['global']?_0x3861ae(0xd5):_0x3861ae(0xce),_0x4572c2=resolveWriteConfigPath(_0x53957d);await runFromImport(_0x501f16,_0x4572c2);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x465e3c(0xd7)]);async function runFromImport(_0x56a16b,_0x20c0a5){const _0x415562=a31_0x465e3c,_0xcda567=resolveFilePath(_0x56a16b[_0x415562(0xed)]);if(!existsSync(_0xcda567))throw CliErrors['validation'](_0x415562(0xe4)+_0xcda567);const _0x22b278=readSourceFile(_0xcda567),_0x536a0f=convertToRuntimeConfig(_0x22b278);_0x56a16b[_0x415562(0xe2)]&&(_0x536a0f[_0x415562(0xe2)]=String(_0x56a16b[_0x415562(0xe2)]));_0x56a16b[_0x415562(0xfa)]&&(_0x536a0f[_0x415562(0xfa)]=resolveInitEnv(_0x56a16b));if(!_0x536a0f[_0x415562(0xe2)])throw CliErrors[_0x415562(0x103)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x415562(0xc7));await writeInitConfig(_0x20c0a5,_0x536a0f,_0x56a16b),console[_0x415562(0x101)]('Imported\x20from\x20'+_0xcda567),console[_0x415562(0x101)](_0x415562(0xf5)+_0x20c0a5),console[_0x415562(0x101)](_0x415562(0xd9)+_0x536a0f['appcode']);if(_0x536a0f[_0x415562(0xf1)])console[_0x415562(0x101)]('\x20\x20default:\x20'+_0x536a0f[_0x415562(0xf1)]);}function convertToRuntimeConfig(_0x2f3b08){const _0x4c3873=a31_0x465e3c;if(_0x2f3b08[_0x4c3873(0xe3)]&&typeof _0x2f3b08[_0x4c3873(0xe3)]===_0x4c3873(0xcc))throw CliErrors[_0x4c3873(0x103)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x4c3873(0xe0));const _0x37f58e={};for(const _0x510659 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2f3b08[_0x510659]!==undefined&&(_0x37f58e[_0x510659]=_0x2f3b08[_0x510659]);}return!_0x37f58e['riskLevel']&&(_0x37f58e[_0x4c3873(0x102)]=DEFAULT_CONFIG_VALUES[_0x4c3873(0x102)]),_0x37f58e;}async function runNonInteractive(_0x15d558,_0x3021ef){const _0x3bef3e=a31_0x465e3c,_0x2f393f=_0x15d558[_0x3bef3e(0xe2)];if(!_0x2f393f)throw CliErrors['flagMissing'](_0x3bef3e(0xe2),_0x3bef3e(0xd1)+CLI_BIN_NAME+_0x3bef3e(0xd0));const _0xbd84ec=resolveInitEnv(_0x15d558);await writeInitConfig(_0x3021ef,{'appcode':_0x2f393f,'env':_0xbd84ec},_0x15d558),console['log'](_0x3bef3e(0xcf)+_0x3021ef),console[_0x3bef3e(0x101)]('\x20\x20appcode:\x20'+_0x2f393f),console[_0x3bef3e(0x101)](_0x3bef3e(0x104)+_0xbd84ec);}async function runInteractive(_0x14d0b2,_0x38fa74){const _0x525d8e=a31_0x465e3c,_0x581074=loadExisting(_0x38fa74),_0x292438=typeof _0x581074?.[_0x525d8e(0xe2)]==='string'?_0x581074[_0x525d8e(0xe2)]:'',_0x54ca4d=resolveInitEnv(_0x14d0b2);console[_0x525d8e(0x101)](CLI_BIN_NAME+_0x525d8e(0xe6)+PRODUCT_CONFIG[_0x525d8e(0xea)]+'\x0a');if(existsSync(_0x38fa74)&&!_0x14d0b2[_0x525d8e(0xef)]){const _0x2d38e5=await promptYesNo(_0x525d8e(0xe9)+_0x38fa74+_0x525d8e(0xe1),![]);if(!_0x2d38e5){console[_0x525d8e(0x101)]('Aborted.');return;}}const _0x36d139=typeof _0x14d0b2[_0x525d8e(0xe2)]===_0x525d8e(0xc9)?_0x14d0b2[_0x525d8e(0xe2)]['trim']():'';let _0x70d66a=_0x36d139;!_0x70d66a&&(_0x70d66a=await promptInput(_0x525d8e(0xf7),_0x292438));if(!_0x70d66a['trim']())throw CliErrors['validation'](_0x525d8e(0xd3));await writeInitConfig(_0x38fa74,{'appcode':_0x70d66a['trim'](),'env':_0x54ca4d},_0x14d0b2),console[_0x525d8e(0x101)]('\x0aInitialized\x20'+_0x38fa74),console[_0x525d8e(0x101)]('\x20\x20appcode:\x20'+_0x70d66a[_0x525d8e(0x10a)]()),console[_0x525d8e(0x101)](_0x525d8e(0x104)+_0x54ca4d);}async function writeInitConfig(_0x2c2aa6,_0x28f250,_0x4fb240){const _0x4d9ee6=a31_0x465e3c;let _0x23a28d={};existsSync(_0x2c2aa6)&&!_0x4fb240[_0x4d9ee6(0xef)]&&(_0x23a28d=readConfigFile(_0x2c2aa6));for(const [_0x2ce707,_0x4054b3]of Object[_0x4d9ee6(0x10c)](_0x28f250)){_0x4054b3!==undefined&&(_0x23a28d[_0x2ce707]=_0x4054b3);}if(_0x23a28d[_0x4d9ee6(0xf8)])delete _0x23a28d[_0x4d9ee6(0xf8)];writeConfigFile(_0x2c2aa6,_0x23a28d);}class AbortPrompt extends Error{constructor(){const _0x25f771=a31_0x465e3c;super(_0x25f771(0xde)),this['name']='AbortPrompt';}}function a31_0x4601(){const _0x1d2d87=['string','race','SIGINT','object','includes','project','Initialized\x20','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','Usage:\x20','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','utf8','global','stdin','apiDir','5yrdIxu','\x20\x20appcode:\x20','Target\x20environment\x20(default\x20','3219470qioxxM','814FGGfNg','cancelled','User\x20aborted\x20prompt','2529iyGeJY','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20already\x20exists.\x20Overwrite?','appcode','apps','Source\x20file\x20not\x20found:\x20','removeListener','\x20init\x20—\x20Create\x20','parse','Override\x20imported\x20default\x20env','File\x20','newConfigFileName','question','boolean','file','Override\x20imported\x20default\x20appcode','yes','close','defaultApp','toLowerCase','6587496RzQUip',')\x20instead\x20of\x20project','\x20\x20config:\x20\x20','Skip\x20confirmation\x20when\x20overwriting','App\x20code','app','Failed\x20to\x20parse\x20source\x20file:\x20','env','[Y/n]','message','88imnHqa','4872844aUvgAa','cwd','Write\x20to\x20global\x20(~/','log','riskLevel','validation','\x20\x20env:\x20\x20\x20\x20\x20','10132017AEqGYj','stdout','1301830WFVydB','657aVJrpM','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','trim','[y/N]','entries','Invalid\x20env\x20\x22','\x22.\x20Allowed:\x20','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`.','12888tZDPxn'];a31_0x4601=function(){return _0x1d2d87;};return a31_0x4601();}function createSafeRl(){const _0x179e71=a31_0x465e3c,_0x59430c=createInterface({'input':process[_0x179e71(0xd6)],'output':process[_0x179e71(0x106)]});let _0x305da1;const _0x1f9780=new Promise((_0x2736bf,_0x5867a4)=>{const _0xc694ef=_0x179e71;_0x305da1=()=>{const _0x33f153=a31_0x15ce;_0x305da1&&(_0x59430c[_0x33f153(0xe5)](_0x33f153(0xcb),_0x305da1),_0x305da1=undefined);try{_0x59430c[_0x33f153(0xf0)]();}catch{}_0x5867a4(new AbortPrompt());},_0x59430c['once'](_0xc694ef(0xcb),_0x305da1);}),_0x5cf855=()=>{const _0x543fca=_0x179e71;_0x305da1&&(_0x59430c['removeListener'](_0x543fca(0xcb),_0x305da1),_0x305da1=undefined);try{_0x59430c[_0x543fca(0xf0)]();}catch{}};return{'rl':_0x59430c,'abortPromise':_0x1f9780,'disposeSuccess':_0x5cf855};}async function promptInput(_0x4e530d,_0xb2a8ff){const _0x4a5e33=a31_0x465e3c,{rl:_0x4155b1,abortPromise:_0x273bf4,disposeSuccess:_0x3c811e}=createSafeRl(),_0x4b6f52=new Promise(_0x543000=>{const _0x11063c=_0xb2a8ff?'\x20\x20'+_0x4e530d+'\x20('+_0xb2a8ff+'):\x20':'\x20\x20'+_0x4e530d+':\x20';_0x4155b1['question'](_0x11063c,_0xe9e795=>{const _0x3e42f4=a31_0x15ce;_0x3c811e(),_0x543000(_0xe9e795[_0x3e42f4(0x10a)]()||_0xb2a8ff);});});return Promise[_0x4a5e33(0xca)]([_0x4b6f52,_0x273bf4]);}async function promptYesNo(_0x26c219,_0x27f520){const _0x3d1f53=a31_0x465e3c,{rl:_0x518e35,abortPromise:_0xf1307c,disposeSuccess:_0x592b04}=createSafeRl(),_0x4977f0=new Promise(_0x417618=>{const _0x569291=a31_0x15ce,_0x5ad20b=_0x27f520?_0x569291(0xfb):_0x569291(0x10b);_0x518e35[_0x569291(0xeb)]('\x20\x20'+_0x26c219+'\x20'+_0x5ad20b+':\x20',_0x1628eb=>{const _0x46656f=_0x569291;_0x592b04();const _0x18dcc9=_0x1628eb[_0x46656f(0x10a)]()[_0x46656f(0xf2)]();if(_0x18dcc9==='y'||_0x18dcc9===_0x46656f(0xef))_0x417618(!![]);else{if(_0x18dcc9==='n'||_0x18dcc9==='no')_0x417618(![]);else _0x417618(_0x27f520);}});});return Promise[_0x3d1f53(0xca)]([_0x4977f0,_0xf1307c]);}function loadExisting(_0x493eb2){if(!existsSync(_0x493eb2))return null;return readConfigFile(_0x493eb2);}function resolveFilePath(_0x1ac0f5){const _0x8e0128=a31_0x465e3c;return isAbsolute(_0x1ac0f5)?_0x1ac0f5:resolve(process[_0x8e0128(0xff)](),_0x1ac0f5);}function readSourceFile(_0x1c9531){const _0x5ad687=a31_0x465e3c;try{const _0x146bab=readFileSync(_0x1c9531,{'encoding':_0x5ad687(0xd4)});return JSON[_0x5ad687(0xe7)](_0x146bab);}catch(_0x1951b1){throw CliErrors['validation'](_0x5ad687(0xf9)+_0x1951b1[_0x5ad687(0xfc)]);}}function resolveInitEnv(_0x3d8406){const _0x3ac7ba=a31_0x465e3c,_0x3234fd=_0x3d8406['env'];if(_0x3234fd===undefined||_0x3234fd==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x3ac7ba(0xcd)](_0x3234fd))throw CliErrors[_0x3ac7ba(0x103)](_0x3ac7ba(0x10d)+_0x3234fd+_0x3ac7ba(0xc6)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x3234fd;}
|
|
1
|
+
const a31_0x2349c7=a31_0x1007;(function(_0x39f54a,_0x394777){const _0x27d3a7=a31_0x1007,_0x53c40a=_0x39f54a();while(!![]){try{const _0x445af9=-parseInt(_0x27d3a7(0x1fe))/0x1*(-parseInt(_0x27d3a7(0x1f6))/0x2)+-parseInt(_0x27d3a7(0x1c6))/0x3*(parseInt(_0x27d3a7(0x202))/0x4)+parseInt(_0x27d3a7(0x1d9))/0x5+parseInt(_0x27d3a7(0x1e6))/0x6+parseInt(_0x27d3a7(0x208))/0x7+parseInt(_0x27d3a7(0x1ec))/0x8*(-parseInt(_0x27d3a7(0x1f7))/0x9)+parseInt(_0x27d3a7(0x1ff))/0xa*(-parseInt(_0x27d3a7(0x1d4))/0xb);if(_0x445af9===_0x394777)break;else _0x53c40a['push'](_0x53c40a['shift']());}catch(_0xcc941a){_0x53c40a['push'](_0x53c40a['shift']());}}}(a31_0x60f7,0xaf6b7));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_0x2349c7(0x1e4),'type':'string','description':a31_0x2349c7(0x201)},{'name':'env','type':'string','description':a31_0x2349c7(0x1e2)+DEFAULT_CONFIG_VALUES[a31_0x2349c7(0x1dd)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e9)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e8),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x2349c7(0x200),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x2349c7(0x1e4),'type':a31_0x2349c7(0x1da),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x2349c7(0x1dd),'type':'string','description':a31_0x2349c7(0x207),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2349c7(0x1f1),'type':a31_0x2349c7(0x1e7),'description':a31_0x2349c7(0x1e9)+PRODUCT_CONFIG[a31_0x2349c7(0x1c7)]+a31_0x2349c7(0x1fb),'default':![]},{'name':'yes','type':'boolean','description':a31_0x2349c7(0x1e8),'default':![]}];function a31_0x1007(_0x1c0c4e,_0x55fa9f){_0x1c0c4e=_0x1c0c4e-0x1c4;const _0x60f745=a31_0x60f7();let _0x10077c=_0x60f745[_0x1c0c4e];return _0x10077c;}export async function runInit(_0x280e29){const _0x3a0266=a31_0x2349c7,_0x1be77f=isNonInteractiveMode(_0x280e29),_0x122eab=_0x280e29[_0x3a0266(0x1f1)]?_0x3a0266(0x1f1):'project',_0x2543a1=resolveWriteConfigPath(_0x122eab);try{_0x1be77f?await runNonInteractive(_0x280e29,_0x2543a1):await runInteractive(_0x280e29,_0x2543a1);}catch(_0xf832ff){if(_0xf832ff instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0xf832ff;}}export async function runInitImport(_0x4b8b3d){const _0x1ec00c=a31_0x2349c7,_0x599982=_0x4b8b3d[_0x1ec00c(0x1f1)]?'global':_0x1ec00c(0x1d6),_0x30aad0=resolveWriteConfigPath(_0x599982);await runFromImport(_0x4b8b3d,_0x30aad0);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2349c7(0x1c9)]);async function runFromImport(_0x62736c,_0x4ce295){const _0x2ea1fb=a31_0x2349c7,_0x369c7a=resolveFilePath(_0x62736c['file']);if(!existsSync(_0x369c7a))throw CliErrors[_0x2ea1fb(0x1d7)](_0x2ea1fb(0x1fa)+_0x369c7a);const _0x174c1d=readSourceFile(_0x369c7a),_0x21373d=convertToRuntimeConfig(_0x174c1d);_0x62736c[_0x2ea1fb(0x1e4)]&&(_0x21373d[_0x2ea1fb(0x1e4)]=String(_0x62736c[_0x2ea1fb(0x1e4)]));_0x62736c[_0x2ea1fb(0x1dd)]&&(_0x21373d['env']=resolveInitEnv(_0x62736c));if(!_0x21373d[_0x2ea1fb(0x1e4)])throw CliErrors[_0x2ea1fb(0x1d7)](_0x2ea1fb(0x1c8),'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(_0x4ce295,_0x21373d,_0x62736c),console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1df)+_0x369c7a),console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1de)+_0x4ce295),console[_0x2ea1fb(0x1f4)]('\x20\x20appcode:\x20'+_0x21373d[_0x2ea1fb(0x1e4)]);if(_0x21373d[_0x2ea1fb(0x1f3)])console[_0x2ea1fb(0x1f4)](_0x2ea1fb(0x1d8)+_0x21373d[_0x2ea1fb(0x1f3)]);}function a31_0x60f7(){const _0x59ce33=['File\x20','Invalid\x20env\x20\x22','349050jaSIek','newConfigFileName','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','apiDir','\x20init\x20—\x20Create\x20','object','removeListener','app','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','yes','trim','utf8','stdin','523314bogjNc','message','project','validation','\x20\x20default:\x20','4482555XfItSA','string','race','\x20\x20env:\x20\x20\x20\x20\x20','env','\x20\x20config:\x20\x20','Imported\x20from\x20','SIGINT','name','Target\x20environment\x20(default\x20','Failed\x20to\x20parse\x20source\x20file:\x20','appcode','once','3445212txHhyN','boolean','Skip\x20confirmation\x20when\x20overwriting','Write\x20to\x20global\x20(~/','\x20already\x20exists.\x20Overwrite?','toLowerCase','103776RnwBMZ','entries','AbortPrompt','includes','\x22.\x20Allowed:\x20','global','question','defaultApp','log','App\x20code\x20cannot\x20be\x20empty.','606836absKjq','288mSDNDu','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','riskLevel','Source\x20file\x20not\x20found:\x20',')\x20instead\x20of\x20project','\x20\x20appcode:\x20','stdout','3xDETCc','390VKbFSx','file','App\x20code\x20for\x20the\x20project','20fjDrss','flagMissing','Aborted.','apps','parse','Override\x20imported\x20default\x20env','8328544yiOETw'];a31_0x60f7=function(){return _0x59ce33;};return a31_0x60f7();}function convertToRuntimeConfig(_0x5b7183){const _0x431b0f=a31_0x2349c7;if(_0x5b7183[_0x431b0f(0x205)]&&typeof _0x5b7183[_0x431b0f(0x205)]===_0x431b0f(0x1cb))throw CliErrors[_0x431b0f(0x1d7)](_0x431b0f(0x1ce),_0x431b0f(0x1f8));const _0x27da7d={};for(const _0xa752f1 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5b7183[_0xa752f1]!==undefined&&(_0x27da7d[_0xa752f1]=_0x5b7183[_0xa752f1]);}return!_0x27da7d[_0x431b0f(0x1f9)]&&(_0x27da7d['riskLevel']=DEFAULT_CONFIG_VALUES[_0x431b0f(0x1f9)]),_0x27da7d;}async function runNonInteractive(_0x2f4e4d,_0x38f9be){const _0x20a844=a31_0x2349c7,_0x314a57=_0x2f4e4d[_0x20a844(0x1e4)];if(!_0x314a57)throw CliErrors[_0x20a844(0x203)]('appcode',_0x20a844(0x1cf)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x4b439a=resolveInitEnv(_0x2f4e4d);await writeInitConfig(_0x38f9be,{'appcode':_0x314a57,'env':_0x4b439a},_0x2f4e4d),console['log']('Initialized\x20'+_0x38f9be),console[_0x20a844(0x1f4)](_0x20a844(0x1fc)+_0x314a57),console['log'](_0x20a844(0x1dc)+_0x4b439a);}async function runInteractive(_0x570a90,_0x567a57){const _0x3d9268=a31_0x2349c7,_0x19c77a=loadExisting(_0x567a57),_0x338704=typeof _0x19c77a?.[_0x3d9268(0x1e4)]===_0x3d9268(0x1da)?_0x19c77a['appcode']:'',_0x534147=resolveInitEnv(_0x570a90);console[_0x3d9268(0x1f4)](CLI_BIN_NAME+_0x3d9268(0x1ca)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x567a57)&&!_0x570a90['yes']){const _0x2b08d1=await promptYesNo(_0x3d9268(0x1c4)+_0x567a57+_0x3d9268(0x1ea),![]);if(!_0x2b08d1){console[_0x3d9268(0x1f4)](_0x3d9268(0x204));return;}}const _0x5d1e95=typeof _0x570a90[_0x3d9268(0x1e4)]===_0x3d9268(0x1da)?_0x570a90['appcode'][_0x3d9268(0x1d1)]():'';let _0x40850b=_0x5d1e95;!_0x40850b&&(_0x40850b=await promptInput('App\x20code',_0x338704));if(!_0x40850b['trim']())throw CliErrors[_0x3d9268(0x1d7)](_0x3d9268(0x1f5));await writeInitConfig(_0x567a57,{'appcode':_0x40850b[_0x3d9268(0x1d1)](),'env':_0x534147},_0x570a90),console[_0x3d9268(0x1f4)]('\x0aInitialized\x20'+_0x567a57),console[_0x3d9268(0x1f4)](_0x3d9268(0x1fc)+_0x40850b[_0x3d9268(0x1d1)]()),console[_0x3d9268(0x1f4)](_0x3d9268(0x1dc)+_0x534147);}async function writeInitConfig(_0x2d61cf,_0x3fbe55,_0x2601cc){const _0x44448d=a31_0x2349c7;let _0x4311bb={};existsSync(_0x2d61cf)&&!_0x2601cc['yes']&&(_0x4311bb=readConfigFile(_0x2d61cf));for(const [_0x5bd244,_0x4db7f1]of Object[_0x44448d(0x1ed)](_0x3fbe55)){_0x4db7f1!==undefined&&(_0x4311bb[_0x5bd244]=_0x4db7f1);}if(_0x4311bb[_0x44448d(0x1cd)])delete _0x4311bb['app'];writeConfigFile(_0x2d61cf,_0x4311bb);}class AbortPrompt extends Error{constructor(){const _0x322e3a=a31_0x2349c7;super('User\x20aborted\x20prompt'),this[_0x322e3a(0x1e1)]=_0x322e3a(0x1ee);}}function createSafeRl(){const _0x225ffa=a31_0x2349c7,_0x22e92a=createInterface({'input':process[_0x225ffa(0x1d3)],'output':process[_0x225ffa(0x1fd)]});let _0x20f41f;const _0x5062a1=new Promise((_0x192728,_0x31bf13)=>{const _0x5e4477=_0x225ffa;_0x20f41f=()=>{const _0x10736f=a31_0x1007;_0x20f41f&&(_0x22e92a[_0x10736f(0x1cc)]('SIGINT',_0x20f41f),_0x20f41f=undefined);try{_0x22e92a['close']();}catch{}_0x31bf13(new AbortPrompt());},_0x22e92a[_0x5e4477(0x1e5)](_0x5e4477(0x1e0),_0x20f41f);}),_0x20494f=()=>{const _0x30c2b2=_0x225ffa;_0x20f41f&&(_0x22e92a[_0x30c2b2(0x1cc)](_0x30c2b2(0x1e0),_0x20f41f),_0x20f41f=undefined);try{_0x22e92a['close']();}catch{}};return{'rl':_0x22e92a,'abortPromise':_0x5062a1,'disposeSuccess':_0x20494f};}async function promptInput(_0x4bb83b,_0x85e78f){const {rl:_0xc492be,abortPromise:_0x1074c9,disposeSuccess:_0x3d1d38}=createSafeRl(),_0x118b89=new Promise(_0x22eaae=>{const _0x4c9bd7=a31_0x1007,_0x5df890=_0x85e78f?'\x20\x20'+_0x4bb83b+'\x20('+_0x85e78f+'):\x20':'\x20\x20'+_0x4bb83b+':\x20';_0xc492be[_0x4c9bd7(0x1f2)](_0x5df890,_0x450d30=>{const _0x228524=_0x4c9bd7;_0x3d1d38(),_0x22eaae(_0x450d30[_0x228524(0x1d1)]()||_0x85e78f);});});return Promise['race']([_0x118b89,_0x1074c9]);}async function promptYesNo(_0x2b2a60,_0x300326){const _0x112300=a31_0x2349c7,{rl:_0x185bbb,abortPromise:_0x5c49cc,disposeSuccess:_0x173d57}=createSafeRl(),_0x1a78d7=new Promise(_0x1bf6c3=>{const _0x2c8cf5=_0x300326?'[Y/n]':'[y/N]';_0x185bbb['question']('\x20\x20'+_0x2b2a60+'\x20'+_0x2c8cf5+':\x20',_0x4bfab6=>{const _0x16df6d=a31_0x1007;_0x173d57();const _0x87ac68=_0x4bfab6[_0x16df6d(0x1d1)]()[_0x16df6d(0x1eb)]();if(_0x87ac68==='y'||_0x87ac68===_0x16df6d(0x1d0))_0x1bf6c3(!![]);else{if(_0x87ac68==='n'||_0x87ac68==='no')_0x1bf6c3(![]);else _0x1bf6c3(_0x300326);}});});return Promise[_0x112300(0x1db)]([_0x1a78d7,_0x5c49cc]);}function loadExisting(_0x4edf96){if(!existsSync(_0x4edf96))return null;return readConfigFile(_0x4edf96);}function resolveFilePath(_0x340f20){return isAbsolute(_0x340f20)?_0x340f20:resolve(process['cwd'](),_0x340f20);}function readSourceFile(_0x2232af){const _0x515510=a31_0x2349c7;try{const _0x5a8ceb=readFileSync(_0x2232af,{'encoding':_0x515510(0x1d2)});return JSON[_0x515510(0x206)](_0x5a8ceb);}catch(_0x26c42c){throw CliErrors[_0x515510(0x1d7)](_0x515510(0x1e3)+_0x26c42c[_0x515510(0x1d5)]);}}function resolveInitEnv(_0x50306f){const _0x126fb6=a31_0x2349c7,_0x5bb819=_0x50306f[_0x126fb6(0x1dd)];if(_0x5bb819===undefined||_0x5bb819==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x126fb6(0x1ef)](_0x5bb819))throw CliErrors[_0x126fb6(0x1d7)](_0x126fb6(0x1c5)+_0x5bb819+_0x126fb6(0x1f0)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x5bb819;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x1ad86f=a32_0xf906;(function(_0x432c87,_0x19abd6){const _0x383e5a=a32_0xf906,_0x284d71=_0x432c87();while(!![]){try{const _0x359982=-parseInt(_0x383e5a(0x1fe))/0x1*(-parseInt(_0x383e5a(0x21a))/0x2)+parseInt(_0x383e5a(0x207))/0x3+-parseInt(_0x383e5a(0x201))/0x4+-parseInt(_0x383e5a(0x1ed))/0x5*(parseInt(_0x383e5a(0x216))/0x6)+parseInt(_0x383e5a(0x218))/0x7+parseInt(_0x383e5a(0x1f9))/0x8+-parseInt(_0x383e5a(0x1f0))/0x9;if(_0x359982===_0x19abd6)break;else _0x284d71['push'](_0x284d71['shift']());}catch(_0x346bf4){_0x284d71['push'](_0x284d71['shift']());}}}(a32_0x3434,0x50904));function a32_0xf906(_0x1bef60,_0x1714c4){_0x1bef60=_0x1bef60-0x1df;const _0x343454=a32_0x3434();let _0xf906e7=_0x343454[_0x1bef60];return _0xf906e7;}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':a32_0x1ad86f(0x1f6),'type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x20e)},FILE_FLAG={'name':'file','type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x20f)},QUERY_FLAG={'name':a32_0x1ad86f(0x217),'type':a32_0x1ad86f(0x1f7),'required':!![],'description':a32_0x1ad86f(0x213)},TOPK_FLAG={'name':a32_0x1ad86f(0x215),'type':a32_0x1ad86f(0x200),'description':a32_0x1ad86f(0x1ee)};function readKnowledgeFile(_0x1a3597){const _0x132126=a32_0x1ad86f;if(!_0x1a3597)throw CliErrors[_0x132126(0x209)]('File\x20path\x20is\x20required.');if(!existsSync(_0x1a3597))throw CliErrors[_0x132126(0x209)](_0x132126(0x1e8)+_0x1a3597);if(!statSync(_0x1a3597)[_0x132126(0x1e9)]())throw CliErrors['validation'](_0x132126(0x205)+_0x1a3597);return readFileSync(_0x1a3597,_0x132126(0x1f8));}function summarizePersonalItem(_0x5b03aa){const _0x32e3d8=a32_0x1ad86f;return{'id':_0x5b03aa['id'],'title':_0x5b03aa[_0x32e3d8(0x1f6)],'version':_0x5b03aa['version'],'ragStatus':_0x5b03aa[_0x32e3d8(0x1e0)],'ragErrorMessage':_0x5b03aa[_0x32e3d8(0x210)],'updateTime':_0x5b03aa[_0x32e3d8(0x1e4)]};}function a32_0x3434(){const _0x2a6910=['map','userId','9375evembf','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','score','7554825EOyhDl','/client/knowledge-base/personal/','length','createTime','file','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','title','string','utf8','3858992EQcXpl','read','trim','str','Personal\x20knowledge-base\x20entry\x20ID','17VGETwI','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','number','284772sVATQH','/client/knowledge-base/personal/create','scope','Updated\x20KB\x20entry\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','weightedScore','1375527OXkjKW','version','validation','appCode','POST','Override\x20the\x20existing\x20entry\x20title','detail','Personal\x20knowledge-base\x20entry\x20title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','ragErrorMessage','build','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Created\x20KB\x20entry\x20','topk','1362aADDPc','query','2385061okBMWw','list','45250DtEieT','body','write','ragStatus','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','description','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','updateTime','/update','verbose','num','File\x20not\x20found:\x20','isFile','isFinite'];a32_0x3434=function(){return _0x2a6910;};return a32_0x3434();}function detailPersonalItem(_0x20b69c){const _0x2b1406=a32_0x1ad86f;return{'id':_0x20b69c['id'],'appCode':_0x20b69c[_0x2b1406(0x20a)],'scope':_0x20b69c['scope'],'userId':_0x20b69c[_0x2b1406(0x1ec)],'title':_0x20b69c[_0x2b1406(0x1f6)],'content':_0x20b69c['content']??'','version':_0x20b69c[_0x2b1406(0x208)],'ragStatus':_0x20b69c[_0x2b1406(0x1e0)],'ragErrorMessage':_0x20b69c[_0x2b1406(0x210)],'createTime':_0x20b69c[_0x2b1406(0x1f3)],'updateTime':_0x20b69c['updateTime']};}function summarizeSearchHit(_0x104423){const _0x4b528e=a32_0x1ad86f;return{'scope':_0x104423[_0x4b528e(0x203)],'docId':_0x104423['docId'],'score':_0x104423[_0x4b528e(0x1ef)],'weightedScore':_0x104423[_0x4b528e(0x206)],'content':_0x104423['content'],'metadata':_0x104423['metadata']};}function readTopK(_0x4e5a3d){const _0x2ef794=a32_0x1ad86f,_0xa0410c=_0x4e5a3d['flag'](_0x2ef794(0x215));if(_0xa0410c===undefined||_0xa0410c===null||_0xa0410c==='')return undefined;const _0x2b7a0a=_0x4e5a3d[_0x2ef794(0x1e7)](_0x2ef794(0x215));if(!Number[_0x2ef794(0x1ea)](_0x2b7a0a)||_0x2b7a0a<0x1)throw CliErrors['validation']('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x2b7a0a;}const kbList={'service':'kb','command':a32_0x1ad86f(0x219),'description':a32_0x1ad86f(0x212),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x260035){const _0x59ab41=a32_0x1ad86f,_0x1a85b4=await listPersonalKnowledgeBaseItems(_0x260035['appCode']);if(_0x260035['bool'](_0x59ab41(0x1e6)))return{'ok':!![],'data':{'total':_0x1a85b4[_0x59ab41(0x1f2)],'items':_0x1a85b4}};return{'ok':!![],'data':{'total':_0x1a85b4[_0x59ab41(0x1f2)],'items':_0x1a85b4['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x1ad86f(0x20d),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a32_0x1ad86f(0x1fd)}],async 'execute'(_0x2daad3){const _0x1ce68b=a32_0x1ad86f,_0x3febe1=await getPersonalKnowledgeBaseItem(_0x2daad3['num']('id'),_0x2daad3[_0x1ce68b(0x20a)]);return{'ok':!![],'data':detailPersonalItem(_0x3febe1)};}},kbCreate={'service':'kb','command':'create','description':a32_0x1ad86f(0x1f5),'risk':a32_0x1ad86f(0x1df),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x22486d){const _0xb68362=a32_0x1ad86f,_0x1414ae=_0x22486d[_0xb68362(0x1fc)](_0xb68362(0x1f6)),_0x5adadd=readKnowledgeFile(_0x22486d[_0xb68362(0x1fc)](_0xb68362(0x1f4))),_0x2b0b51=await createPersonalKnowledgeBaseItem(_0x22486d[_0xb68362(0x20a)],{'title':_0x1414ae,'content':_0x5adadd});return{'ok':!![],'data':summarizePersonalItem(_0x2b0b51),'message':_0xb68362(0x214)+_0x2b0b51['id']+'\x20('+_0x2b0b51[_0xb68362(0x1f6)]+')'};},async 'dryRun'(_0x4cf30b){const _0x2b5501=a32_0x1ad86f,_0x3c65d3=_0x4cf30b[_0x2b5501(0x1fc)](_0x2b5501(0x1f6)),_0x286617=readKnowledgeFile(_0x4cf30b['str'](_0x2b5501(0x1f4)));return dryRun(_0x2b5501(0x20b),_0x2b5501(0x202))[_0x2b5501(0x21b)]({'appCode':_0x4cf30b[_0x2b5501(0x20a)],'title':_0x3c65d3,'content':_0x286617})[_0x2b5501(0x1e2)](_0x2b5501(0x1e3)+_0x3c65d3+'\x22')[_0x2b5501(0x211)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x1ad86f(0x1ff),'risk':a32_0x1ad86f(0x1df),'flags':[{...ID_FLAG,'description':a32_0x1ad86f(0x1fd)},{...TITLE_FLAG,'required':![],'description':a32_0x1ad86f(0x20c)},FILE_FLAG],async 'execute'(_0x20781b){const _0x323223=a32_0x1ad86f,_0xa0a63d=_0x20781b[_0x323223(0x1e7)]('id'),_0x94c9e3=readKnowledgeFile(_0x20781b['str'](_0x323223(0x1f4))),_0x14037a=_0x20781b[_0x323223(0x1fc)](_0x323223(0x1f6))||(await getPersonalKnowledgeBaseItem(_0xa0a63d,_0x20781b['appCode']))[_0x323223(0x1f6)],_0x2104fb=await updatePersonalKnowledgeBaseItem(_0xa0a63d,_0x20781b['appCode'],{'title':_0x14037a,'content':_0x94c9e3});return{'ok':!![],'data':summarizePersonalItem(_0x2104fb),'message':_0x323223(0x204)+_0x2104fb['id']+'\x20('+_0x2104fb[_0x323223(0x1f6)]+')'};},async 'dryRun'(_0x22db69){const _0xc7dba8=a32_0x1ad86f,_0x13e18f=_0x22db69[_0xc7dba8(0x1e7)]('id'),_0x38d811=readKnowledgeFile(_0x22db69[_0xc7dba8(0x1fc)]('file')),_0x4c808e=_0x22db69[_0xc7dba8(0x1fc)](_0xc7dba8(0x1f6))||(await getPersonalKnowledgeBaseItem(_0x13e18f,_0x22db69[_0xc7dba8(0x20a)]))[_0xc7dba8(0x1f6)];return dryRun(_0xc7dba8(0x20b),_0xc7dba8(0x1f1)+_0x13e18f+_0xc7dba8(0x1e5))[_0xc7dba8(0x21b)]({'appCode':_0x22db69['appCode'],'title':_0x4c808e,'content':_0x38d811})[_0xc7dba8(0x1e2)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x13e18f)[_0xc7dba8(0x211)]();}},kbSearch={'service':'kb','command':'search','description':a32_0x1ad86f(0x1e1),'risk':a32_0x1ad86f(0x1fa),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x28a352){const _0x3b4bcc=a32_0x1ad86f;if(!_0x28a352[_0x3b4bcc(0x1fc)](_0x3b4bcc(0x217))[_0x3b4bcc(0x1fb)]())throw CliErrors[_0x3b4bcc(0x209)]('Search\x20query\x20is\x20required.');readTopK(_0x28a352);},async 'execute'(_0x6381ab){const _0x55c90a=a32_0x1ad86f,_0x335b2e=_0x6381ab[_0x55c90a(0x1fc)](_0x55c90a(0x217))['trim'](),_0x51bcd2=readTopK(_0x6381ab),_0xfa5c4d=await searchKnowledgeBase(_0x6381ab[_0x55c90a(0x20a)],{'query':_0x335b2e,'topK':_0x51bcd2});return{'ok':!![],'data':{'total':_0xfa5c4d[_0x55c90a(0x1f2)],'hits':_0xfa5c4d[_0x55c90a(0x1eb)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x5a85(){const _0x631c42=['warn','clear','\x20logs:\x0a','*\x20No\x20logs\x20found','logs','log','timestamp','\x20\x20\x20Time:\x20','details','duration','command','16bOOize','6016090QPqDzG','write','2489988dRunPk','1165746LbhjkW','10016712WKvkEL','View\x20command\x20history\x20logs','\x20\x20\x20Duration:\x20','2325uMDsas','stringify','5823405SQnKWn','545184tyseQc','read','1450umZpVg','readLogs','error','length','keys','*\x20Logs\x20cleared','Clear\x20command\x20history\x20logs','level'];a33_0x5a85=function(){return _0x631c42;};return a33_0x5a85();}const a33_0x375462=a33_0x3829;(function(_0x12f322,_0xf6d21d){const _0x5a9db5=a33_0x3829,_0x1f08cd=_0x12f322();while(!![]){try{const _0x2d69dc=parseInt(_0x5a9db5(0x10e))/0x1+-parseInt(_0x5a9db5(0xf7))/0x2*(parseInt(_0x5a9db5(0x112))/0x3)+-parseInt(_0x5a9db5(0x115))/0x4+parseInt(_0x5a9db5(0x10b))/0x5+parseInt(_0x5a9db5(0x10d))/0x6+parseInt(_0x5a9db5(0x114))/0x7+parseInt(_0x5a9db5(0x10a))/0x8*(-parseInt(_0x5a9db5(0x10f))/0x9);if(_0x2d69dc===_0xf6d21d)break;else _0x1f08cd['push'](_0x1f08cd['shift']());}catch(_0x218867){_0x1f08cd['push'](_0x1f08cd['shift']());}}}(a33_0x5a85,0xa8e3a));function a33_0x3829(_0x3b5952,_0x43aa43){_0x3b5952=_0x3b5952-0xf6;const _0x5a859e=a33_0x5a85();let _0x3829d5=_0x5a859e[_0x3b5952];return _0x3829d5;}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x25ed43){const _0x205e59=a33_0x3829;if(_0x25ed43[_0x205e59(0xfa)]===0x0){console[_0x205e59(0x104)](_0x205e59(0x102));return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x205e59(0x101)),_0x25ed43['forEach']((_0x5893e3,_0x11bdc3)=>{const _0x4beb07=_0x205e59,_0x118d05=new Date(_0x5893e3[_0x4beb07(0x105)])['toLocaleString']('en-US'),_0x1a390b=_0x5893e3[_0x4beb07(0xfe)]==='success'?'√':_0x5893e3[_0x4beb07(0xfe)]===_0x4beb07(0xf9)?'×':_0x5893e3[_0x4beb07(0xfe)]===_0x4beb07(0xff)?'!':'i';console[_0x4beb07(0x104)](_0x11bdc3+0x1+'.\x20'+_0x1a390b+'\x20['+_0x5893e3[_0x4beb07(0x109)]+']\x20'+_0x5893e3['message']),console[_0x4beb07(0x104)](_0x4beb07(0x106)+_0x118d05),_0x5893e3[_0x4beb07(0x108)]&&console[_0x4beb07(0x104)](_0x4beb07(0x111)+_0x5893e3['duration']+'ms'),_0x5893e3['details']&&Object[_0x4beb07(0xfb)](_0x5893e3[_0x4beb07(0x107)])[_0x4beb07(0xfa)]>0x0&&console[_0x4beb07(0x104)]('\x20\x20\x20Details:\x20'+JSON[_0x4beb07(0x113)](_0x5893e3['details'],null,0x2)),console[_0x4beb07(0x104)]('');});}export const logsDefinitions=[{'service':a33_0x375462(0x103),'command':'show','description':a33_0x375462(0x110),'risk':a33_0x375462(0xf6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2b9d06){const _0x58275c=a33_0x375462;return printLogs(logger[_0x58275c(0xf8)]()),{'ok':!![]};}},{'service':a33_0x375462(0x103),'command':a33_0x375462(0x100),'description':a33_0x375462(0xfd),'risk':a33_0x375462(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x24c7b2){const _0x3178be=a33_0x375462;return logger['clearLogs'](),console[_0x3178be(0x104)](_0x3178be(0xfc)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x3b2c37=a34_0x382b;(function(_0x543b1a,_0x496b78){const _0x560a5a=a34_0x382b,_0x207c84=_0x543b1a();while(!![]){try{const _0x4fde49=-parseInt(_0x560a5a(0x115))/0x1+-parseInt(_0x560a5a(0xff))/0x2*(-parseInt(_0x560a5a(0x124))/0x3)+parseInt(_0x560a5a(0x11f))/0x4*(-parseInt(_0x560a5a(0xed))/0x5)+-parseInt(_0x560a5a(0xfb))/0x6+-parseInt(_0x560a5a(0x11c))/0x7+parseInt(_0x560a5a(0x10e))/0x8*(-parseInt(_0x560a5a(0xf8))/0x9)+parseInt(_0x560a5a(0x10d))/0xa;if(_0x4fde49===_0x496b78)break;else _0x207c84['push'](_0x207c84['shift']());}catch(_0x398e9d){_0x207c84['push'](_0x207c84['shift']());}}}(a34_0x307a,0xb9012));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x307a(){const _0x519cd6=['673238FTbDuv','idCard','recognize','invoice','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','fileName','/client/queryFileUrl','5876787iSYVqG','Publicly\x20accessible\x20image\x20or\x20file\x20URL','File\x20URL\x20response\x20missing\x20fileUrl.','452PUQqhA','string','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','appCode','image-file','3261TyBSOr','description','scene','45955cSEvzu','<filePath\x20returned\x20by\x20/client/uploadFile>','imageUrl','idcard','path','\x20OCR','.\x20Supported\x20scenes:\x20','image-url','toLowerCase','form','\x20OCR\x20from\x20URL','3283083jsJfFZ','build','/client/uploadFile','5966262qtOlPb','General','ocr','Invoice','2612wnjgWN','write','/client/ocr','validation','trim','POST','Preview:\x20recognize\x20','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Unsupported\x20OCR\x20scene:\x20','apiError','body','File\x20upload\x20response\x20missing\x20filePath.','imageFile','general','36134690NAMflK','16kzgJDn','IdCard','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','filter','str','filePath','fileUrl'];a34_0x307a=function(){return _0x519cd6;};return a34_0x307a();}import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x3b2c37(0x118),a34_0x3b2c37(0x10c),'form',a34_0x3b2c37(0x116)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3b2c37(0xfe),'general':a34_0x3b2c37(0xfc),'form':'Table','idCard':a34_0x3b2c37(0x10f)},SCENE_FLAG={'name':a34_0x3b2c37(0xec),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x3b2c37(0x123),'type':a34_0x3b2c37(0x120),'description':a34_0x3b2c37(0x106)},IMAGE_URL_FLAG={'name':a34_0x3b2c37(0xf4),'type':a34_0x3b2c37(0x120),'description':a34_0x3b2c37(0x11d)};function normalizeScene(_0x1cf8e8){const _0x192bac=a34_0x3b2c37,_0x45a7fb=_0x1cf8e8['trim']()[_0x192bac(0xf5)]();if(_0x45a7fb===_0x192bac(0xf0))return _0x192bac(0x116);if(_0x45a7fb===_0x192bac(0x118)||_0x45a7fb===_0x192bac(0x10c)||_0x45a7fb===_0x192bac(0xf6))return _0x45a7fb;throw CliErrors[_0x192bac(0x102)](_0x192bac(0x107)+_0x1cf8e8+_0x192bac(0xf3)+SUPPORTED_SCENES['join'](',\x20'));}function a34_0x382b(_0x253805,_0x492a74){_0x253805=_0x253805-0xeb;const _0x307a71=a34_0x307a();let _0x382bdc=_0x307a71[_0x253805];return _0x382bdc;}function selectedInputs(_0x40eb70){const _0x7043f=a34_0x3b2c37,_0x26deeb=_0x40eb70[_0x7043f(0x112)]('image-file')[_0x7043f(0x103)](),_0x267a01=_0x40eb70['str'](_0x7043f(0xf4))['trim']();return{'imageFile':_0x26deeb,'imageUrl':_0x267a01,'count':[_0x26deeb,_0x267a01][_0x7043f(0x111)](Boolean)['length']};}function validateInputSelection(_0x353078){const _0x1bb0d2=a34_0x3b2c37,_0x4d29f9=selectedInputs(_0x353078);if(_0x4d29f9['count']!==0x1)throw CliErrors['validation'](_0x1bb0d2(0x119));return _0x4d29f9;}function withScene(_0x5e8d0b,_0x161576,_0x4bbd55){const _0x4e183a=a34_0x3b2c37;return{..._0x5e8d0b,'scene':_0x161576,..._0x4bbd55?{'sourceFile':{'fileName':_0x4bbd55[_0x4e183a(0x11a)],'filePath':_0x4bbd55[_0x4e183a(0x113)]}}:{}};}const ocrRecognize={'service':a34_0x3b2c37(0xfd),'command':a34_0x3b2c37(0x117),'description':a34_0x3b2c37(0x121),'risk':a34_0x3b2c37(0x100),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x569ced){const _0x3dd21e=a34_0x3b2c37,_0x3bdd9c=normalizeScene(_0x569ced[_0x3dd21e(0x112)]('scene')),_0x3cc56c=SCENE_TO_LEGACY_TYPE[_0x3bdd9c],_0x2be46f=validateInputSelection(_0x569ced);if(_0x2be46f[_0x3dd21e(0xef)])return dryRun(_0x3dd21e(0x104),_0x3dd21e(0x101))['body']({'appCode':_0x569ced[_0x3dd21e(0x122)],'url':_0x2be46f[_0x3dd21e(0xef)],'type':_0x3cc56c})[_0x3dd21e(0xeb)](_0x3dd21e(0x105)+_0x3bdd9c+_0x3dd21e(0xf7))[_0x3dd21e(0xf9)]();const _0x19639e=requireRuntimeUploadFile(_0x2be46f[_0x3dd21e(0x10b)],_0x3dd21e(0x123));return dryRun('POST','/client/uploadFile')[_0x3dd21e(0x109)]({'steps':[{'method':'POST','url':_0x3dd21e(0xfa),'body':{'appCode':_0x569ced[_0x3dd21e(0x122)],'multipart':{'file':_0x19639e}}},{'method':_0x3dd21e(0x104),'url':_0x3dd21e(0x11b),'body':{'filePath':_0x3dd21e(0xee),'downloadFlag':![]}},{'method':'POST','url':_0x3dd21e(0x101),'body':{'appCode':_0x569ced[_0x3dd21e(0x122)],'url':_0x3dd21e(0x110),'type':_0x3cc56c}}]})[_0x3dd21e(0xeb)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x3bdd9c+_0x3dd21e(0xf2))['build']();},async 'execute'(_0x440313){const _0x56a47e=a34_0x3b2c37,_0x44099e=normalizeScene(_0x440313['str'](_0x56a47e(0xec))),_0x46fd1f=SCENE_TO_LEGACY_TYPE[_0x44099e],_0x16ebff=validateInputSelection(_0x440313);if(_0x16ebff[_0x56a47e(0xef)]){const _0x208c4a=await recognizeRuntimeOcr(_0x440313['appCode'],{'url':_0x16ebff[_0x56a47e(0xef)],'type':_0x46fd1f});return{'ok':!![],'data':withScene(_0x208c4a,_0x44099e)};}const _0x30d85d=requireRuntimeUploadFile(_0x16ebff['imageFile'],_0x56a47e(0x123)),_0x41dbab=await uploadRuntimeFile(_0x440313[_0x56a47e(0x122)],_0x30d85d[_0x56a47e(0xf1)]);if(!_0x41dbab['filePath'])throw CliErrors[_0x56a47e(0x108)](_0x56a47e(0x10a));const _0x3aa313=await queryRuntimeFileUrl(_0x41dbab[_0x56a47e(0x113)],{'download':![]});if(!_0x3aa313[_0x56a47e(0x114)])throw CliErrors['apiError'](_0x56a47e(0x11e));const _0x25f0aa=await recognizeRuntimeOcr(_0x440313[_0x56a47e(0x122)],{'url':_0x3aa313[_0x56a47e(0x114)],'type':_0x46fd1f});return{'ok':!![],'data':withScene(_0x25f0aa,_0x44099e,_0x41dbab)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x3e8ed3=a35_0x4761;(function(_0x4e4fed,_0x317629){const _0xc1f36d=a35_0x4761,_0x150cc5=_0x4e4fed();while(!![]){try{const _0x1efbcb=parseInt(_0xc1f36d(0xf0))/0x1*(-parseInt(_0xc1f36d(0x121))/0x2)+parseInt(_0xc1f36d(0x114))/0x3*(-parseInt(_0xc1f36d(0xee))/0x4)+-parseInt(_0xc1f36d(0xf5))/0x5*(parseInt(_0xc1f36d(0x102))/0x6)+-parseInt(_0xc1f36d(0xea))/0x7*(parseInt(_0xc1f36d(0xf3))/0x8)+-parseInt(_0xc1f36d(0x11f))/0x9*(parseInt(_0xc1f36d(0x103))/0xa)+-parseInt(_0xc1f36d(0xde))/0xb*(-parseInt(_0xc1f36d(0xff))/0xc)+-parseInt(_0xc1f36d(0x106))/0xd*(-parseInt(_0xc1f36d(0xfd))/0xe);if(_0x1efbcb===_0x317629)break;else _0x150cc5['push'](_0x150cc5['shift']());}catch(_0x59f635){_0x150cc5['push'](_0x150cc5['shift']());}}}(a35_0x23c6,0xe795b));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x23c6(){const _0x1ceaf7=['test','File\x20is\x20not\x20a\x20regular\x20file:\x20','read','Created\x20personal\x20BFF\x20','write','appCode','description','5297262tLzxSt','scriptType','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','trim','update','/update','body','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','bool','string','config','726183mBMODo','str','770KHkjvt','Personal\x20BFF\x20description','POST','Updated\x20personal\x20BFF\x20','43175xlNYze','name','Update\x20a\x20personal\x20BFF\x20by\x20id','flag','keys','isArray','scriptContent','Personal\x20BFF\x20script\x20ID','File\x20path\x20is\x20required.','source-session-id','Preview:\x20create\x20personal\x20BFF\x20','File\x20not\x20found:\x20','168NBCzmO','build','Preview:\x20update\x20personal\x20BFF\x20','high-risk-write','4wdFtDT','createTime','273EzNWnu','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','detail','109368izDSMa','num','195PBZDMW','Executed\x20personal\x20BFF\x20','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','Optional\x20source\x20RuntimeAgent\x20session\x20id','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','file','version','sourceSessionId','1582jUPwxZ','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','2004JLpfQq','updateTime','verbose','77340hYozon','140HxFoMw','create','validation','474487kdVdUQ','personal-bff','functionName','utf8','length','params','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params'];a35_0x23c6=function(){return _0x1ceaf7;};return a35_0x23c6();}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_0x3e8ed3(0xfa),'type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0x116)},FUNCTION_NAME_FLAG={'name':a35_0x3e8ed3(0xdf),'type':a35_0x3e8ed3(0x11d),'required':!![],'description':a35_0x3e8ed3(0xf1)},DESCRIPTION_FLAG={'name':a35_0x3e8ed3(0x113),'type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0xdb)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x3e8ed3(0x11d),'description':a35_0x3e8ed3(0xf8)};function normalizeFunctionName(_0xb75366){const _0x12182d=a35_0x3e8ed3,_0x289ebf=String(_0xb75366||'')[_0x12182d(0x117)]();if(!_0x289ebf||!FUNCTION_NAME_PATTERN[_0x12182d(0x10d)](_0x289ebf))throw CliErrors['validation'](_0x12182d(0xf9));return _0x289ebf;}function readScriptFile(_0x78d15){const _0x1f8754=a35_0x3e8ed3;if(!_0x78d15)throw CliErrors['validation'](_0x1f8754(0xe6));if(!existsSync(_0x78d15))throw CliErrors[_0x1f8754(0x105)](_0x1f8754(0xe9)+_0x78d15);if(!statSync(_0x78d15)['isFile']())throw CliErrors[_0x1f8754(0x105)](_0x1f8754(0x10e)+_0x78d15);const _0x35bafa=readFileSync(_0x78d15,_0x1f8754(0x109));if(!_0x35bafa[_0x1f8754(0x117)]())throw CliErrors[_0x1f8754(0x105)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x35bafa;}function optionalTrimmed(_0x137ace){const _0x63f560=String(_0x137ace||'')['trim']();return _0x63f560||undefined;}function summarizeBff(_0x2c4a40){const _0x1e4aa5=a35_0x3e8ed3;return{'id':_0x2c4a40['id'],'appCode':_0x2c4a40['appCode'],'functionName':_0x2c4a40[_0x1e4aa5(0x108)],'description':_0x2c4a40[_0x1e4aa5(0x113)],'scriptType':_0x2c4a40['scriptType'],'version':_0x2c4a40[_0x1e4aa5(0xfb)],'gmtModified':_0x2c4a40['gmtModified'],'updateTime':_0x2c4a40[_0x1e4aa5(0x100)]};}function detailBff(_0x55c8c9){const _0x3274a5=a35_0x3e8ed3;return{'id':_0x55c8c9['id'],'appCode':_0x55c8c9[_0x3274a5(0x112)],'functionName':_0x55c8c9['functionName'],'description':_0x55c8c9[_0x3274a5(0x113)],'scriptType':_0x55c8c9[_0x3274a5(0x115)],'scriptContent':_0x55c8c9[_0x3274a5(0xe4)]??'','config':_0x55c8c9[_0x3274a5(0x11e)],'version':_0x55c8c9[_0x3274a5(0xfb)],'createUserId':_0x55c8c9['createUserId'],'gmtCreate':_0x55c8c9['gmtCreate'],'gmtModified':_0x55c8c9['gmtModified'],'createTime':_0x55c8c9[_0x3274a5(0xef)],'updateTime':_0x55c8c9[_0x3274a5(0x100)]};}function a35_0x4761(_0x556335,_0x27ad80){_0x556335=_0x556335-0xdb;const _0x23c66a=a35_0x23c6();let _0x476122=_0x23c66a[_0x556335];return _0x476122;}function buildCreateInput(_0x53ac45){const _0x8c3445=a35_0x3e8ed3;return{'functionName':normalizeFunctionName(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xdf))),...optionalTrimmed(_0x53ac45[_0x8c3445(0x120)]('description'))?{'description':optionalTrimmed(_0x53ac45['str'](_0x8c3445(0x113)))}:{},'scriptContent':readScriptFile(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xfa))),...optionalTrimmed(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xe7)))?{'sourceSessionId':optionalTrimmed(_0x53ac45[_0x8c3445(0x120)](_0x8c3445(0xe7)))}:{}};}function buildUpdateInput(_0x26e015){const _0x161e49=a35_0x3e8ed3,_0x326cd7={};optionalTrimmed(_0x26e015[_0x161e49(0x120)](_0x161e49(0xdf)))&&(_0x326cd7[_0x161e49(0x108)]=normalizeFunctionName(_0x26e015['str'](_0x161e49(0xdf))));_0x26e015[_0x161e49(0xe1)]('description')!==undefined&&(_0x326cd7[_0x161e49(0x113)]=_0x26e015[_0x161e49(0x120)]('description'));optionalTrimmed(_0x26e015['str']('file'))&&(_0x326cd7[_0x161e49(0xe4)]=readScriptFile(_0x26e015[_0x161e49(0x120)]('file')));_0x26e015[_0x161e49(0xe1)](_0x161e49(0xe7))!==undefined&&(_0x326cd7[_0x161e49(0xfc)]=_0x26e015['str']('source-session-id'));if(Object[_0x161e49(0xe2)](_0x326cd7)[_0x161e49(0x10a)]===0x0)throw CliErrors[_0x161e49(0x105)](_0x161e49(0x11b));return _0x326cd7;}function parseExecParams(_0x13a797){const _0x1f60b9=a35_0x3e8ed3,_0xb76740=parseJsonParams(_0x13a797)??{};if(Array[_0x1f60b9(0xe3)](_0xb76740))throw CliErrors[_0x1f60b9(0x105)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0xb76740;}const personalBffList={'service':'personal-bff','command':'list','description':a35_0x3e8ed3(0xf7),'risk':a35_0x3e8ed3(0x10f),'flags':[VERBOSE_FLAG],async 'execute'(_0x4b573d){const _0x1fa63f=a35_0x3e8ed3,_0x2b0b66=await listPersonalBffs(_0x4b573d[_0x1fa63f(0x112)]);return{'ok':!![],'data':{'total':_0x2b0b66[_0x1fa63f(0x10a)],'items':_0x4b573d[_0x1fa63f(0x11c)](_0x1fa63f(0x101))?_0x2b0b66:_0x2b0b66['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0xf2),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x3e8ed3(0x10f),'flags':[{...ID_FLAG,'description':a35_0x3e8ed3(0xe5)}],async 'execute'(_0x563548){const _0xbbda51=a35_0x3e8ed3,_0x28e0ae=await getPersonalBff(_0x563548[_0xbbda51(0xf4)]('id'),_0x563548[_0xbbda51(0x112)]);return{'ok':!![],'data':detailBff(_0x28e0ae)};}},personalBffCreate={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0x104),'description':a35_0x3e8ed3(0xfe),'risk':a35_0x3e8ed3(0x111),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x29d8a4){const _0x1375af=a35_0x3e8ed3,_0x2677cb=buildCreateInput(_0x29d8a4),_0xd247f4=await createPersonalBff(_0x29d8a4[_0x1375af(0x112)],_0x2677cb);return{'ok':!![],'data':detailBff(_0xd247f4),'message':_0x1375af(0x110)+_0xd247f4['id']+(_0xd247f4[_0x1375af(0x108)]?'\x20('+_0xd247f4[_0x1375af(0x108)]+')':'')};},async 'dryRun'(_0x7dab0f){const _0x41dfc9=a35_0x3e8ed3,_0x21211b=buildCreateInput(_0x7dab0f);return dryRun(_0x41dfc9(0xdc),'/client/runtime-bff/personal/create')[_0x41dfc9(0x11a)]({'appCode':_0x7dab0f['appCode'],..._0x21211b})[_0x41dfc9(0x113)](_0x41dfc9(0xe8)+_0x21211b[_0x41dfc9(0x108)])['build']();}},personalBffUpdate={'service':a35_0x3e8ed3(0x107),'command':a35_0x3e8ed3(0x118),'description':a35_0x3e8ed3(0xe0),'risk':a35_0x3e8ed3(0x111),'flags':[{...ID_FLAG,'description':a35_0x3e8ed3(0xe5)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4cb73c){const _0x127998=a35_0x3e8ed3,_0x2e5e65=_0x4cb73c[_0x127998(0xf4)]('id'),_0x10e2d2=buildUpdateInput(_0x4cb73c),_0x4b102a=await updatePersonalBff(_0x2e5e65,_0x4cb73c['appCode'],_0x10e2d2);return{'ok':!![],'data':detailBff(_0x4b102a),'message':_0x127998(0xdd)+_0x4b102a['id']+(_0x4b102a['functionName']?'\x20('+_0x4b102a[_0x127998(0x108)]+')':'')};},async 'dryRun'(_0x328202){const _0x1b76d2=a35_0x3e8ed3,_0xeba996=_0x328202[_0x1b76d2(0xf4)]('id'),_0x1b2850=buildUpdateInput(_0x328202);return dryRun(_0x1b76d2(0xdc),'/client/runtime-bff/personal/'+_0xeba996+_0x1b76d2(0x119))[_0x1b76d2(0x11a)]({'appCode':_0x328202['appCode'],..._0x1b2850})['description'](_0x1b76d2(0xec)+_0xeba996)[_0x1b76d2(0xeb)]();}},personalBffExec={'service':a35_0x3e8ed3(0x107),'command':'exec','description':a35_0x3e8ed3(0x10c),'risk':a35_0x3e8ed3(0xed),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x2dcdeb){const _0x5b688e=a35_0x3e8ed3;parseExecParams(_0x2dcdeb[_0x5b688e(0x120)](_0x5b688e(0x10b)));},async 'execute'(_0x515851){const _0x14f539=a35_0x3e8ed3,_0x13a1f7=_0x515851[_0x14f539(0xf4)]('id'),_0x513a76=parseExecParams(_0x515851[_0x14f539(0x120)](_0x14f539(0x10b))),_0x55a4de=await executePersonalBff(_0x13a1f7,_0x515851[_0x14f539(0x112)],_0x513a76);return{'ok':!![],'data':{'result':_0x55a4de},'message':_0x14f539(0xf6)+_0x13a1f7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x1b62c1=a35_0x1751;(function(_0x2c656c,_0x188d8d){const _0x2f39cd=a35_0x1751,_0x4e9018=_0x2c656c();while(!![]){try{const _0x4c3d06=-parseInt(_0x2f39cd(0x1b4))/0x1+parseInt(_0x2f39cd(0x1c8))/0x2+-parseInt(_0x2f39cd(0x1a4))/0x3+parseInt(_0x2f39cd(0x1bc))/0x4+-parseInt(_0x2f39cd(0x1c4))/0x5+-parseInt(_0x2f39cd(0x1c6))/0x6+parseInt(_0x2f39cd(0x1a6))/0x7;if(_0x4c3d06===_0x188d8d)break;else _0x4e9018['push'](_0x4e9018['shift']());}catch(_0x32658b){_0x4e9018['push'](_0x4e9018['shift']());}}}(a35_0x5963,0xd8800));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_0x1b62c1(0x1c2),'type':'string','description':a35_0x1b62c1(0x1a3)},FUNCTION_NAME_FLAG={'name':a35_0x1b62c1(0x1ce),'type':a35_0x1b62c1(0x1d0),'required':!![],'description':a35_0x1b62c1(0x1c3)},DESCRIPTION_FLAG={'name':'description','type':a35_0x1b62c1(0x1d0),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x1b62c1(0x1d8),'type':a35_0x1b62c1(0x1d0),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x456c53){const _0xcad87a=a35_0x1b62c1,_0x3cc256=String(_0x456c53||'')[_0xcad87a(0x1de)]();if(!_0x3cc256||!FUNCTION_NAME_PATTERN[_0xcad87a(0x1b1)](_0x3cc256))throw CliErrors[_0xcad87a(0x1c5)](_0xcad87a(0x1ad));return _0x3cc256;}function readScriptFile(_0x3389d6){const _0x18e3a1=a35_0x1b62c1;if(!_0x3389d6)throw CliErrors['validation'](_0x18e3a1(0x1d3));if(!existsSync(_0x3389d6))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x3389d6);if(!statSync(_0x3389d6)['isFile']())throw CliErrors[_0x18e3a1(0x1c5)](_0x18e3a1(0x1b2)+_0x3389d6);const _0x50fd55=readFileSync(_0x3389d6,_0x18e3a1(0x1e2));if(!_0x50fd55['trim']())throw CliErrors[_0x18e3a1(0x1c5)](_0x18e3a1(0x1b0));return _0x50fd55;}function optionalTrimmed(_0x18e83c){const _0x1d2d49=a35_0x1b62c1,_0x17583e=String(_0x18e83c||'')[_0x1d2d49(0x1de)]();return _0x17583e||undefined;}function summarizeBff(_0x30e1b9){const _0x107344=a35_0x1b62c1;return{'id':_0x30e1b9['id'],'appCode':_0x30e1b9[_0x107344(0x1bf)],'functionName':_0x30e1b9[_0x107344(0x1b5)],'description':_0x30e1b9[_0x107344(0x1c0)],'scriptType':_0x30e1b9[_0x107344(0x1b8)],'version':_0x30e1b9[_0x107344(0x1c1)],'gmtModified':_0x30e1b9[_0x107344(0x1ba)],'updateTime':_0x30e1b9[_0x107344(0x1cb)]};}function detailBff(_0x48def4){const _0x351cab=a35_0x1b62c1;return{'id':_0x48def4['id'],'appCode':_0x48def4[_0x351cab(0x1bf)],'functionName':_0x48def4[_0x351cab(0x1b5)],'description':_0x48def4[_0x351cab(0x1c0)],'scriptType':_0x48def4[_0x351cab(0x1b8)],'scriptContent':_0x48def4['scriptContent']??'','config':_0x48def4['config'],'version':_0x48def4[_0x351cab(0x1c1)],'createUserId':_0x48def4[_0x351cab(0x1e4)],'gmtCreate':_0x48def4[_0x351cab(0x1c9)],'gmtModified':_0x48def4[_0x351cab(0x1ba)],'createTime':_0x48def4[_0x351cab(0x1d7)],'updateTime':_0x48def4['updateTime']};}function a35_0x5963(){const _0x3c3281=['flag','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','body','list','Personal\x20BFF\x20script\x20file\x20is\x20blank.','test','File\x20is\x20not\x20a\x20regular\x20file:\x20','Executed\x20personal\x20BFF\x20','721192zQLIvv','functionName','num','Show\x20one\x20personal\x20BFF\x20by\x20id','scriptType','Updated\x20personal\x20BFF\x20','gmtModified','str','3841276ELnhwb','--params\x20must\x20be\x20a\x20JSON\x20object.','exec','appCode','description','version','file','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','3426805xVRUgh','validation','5465952osUfCN','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','3482354CBuhle','gmtCreate','scriptContent','updateTime','params','create','name','Created\x20personal\x20BFF\x20','string','write','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','File\x20path\x20is\x20required.','build','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','read','createTime','source-session-id','personal-bff','isArray','Preview:\x20update\x20personal\x20BFF\x20','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','map','trim','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','bool','POST','utf8','Update\x20a\x20personal\x20BFF\x20by\x20id','createUserId','keys','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','93657iQdpQL','/client/runtime-bff/personal/','3738364ppvWaf','Personal\x20BFF\x20script\x20ID','detail','sourceSessionId','update','/update'];a35_0x5963=function(){return _0x3c3281;};return a35_0x5963();}function buildCreateInput(_0x3c0063){const _0x37dc45=a35_0x1b62c1;return{'functionName':normalizeFunctionName(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1ce))),...optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1c0)))?{'description':optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)]('description'))}:{},'scriptContent':readScriptFile(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1c2))),...optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1d8)))?{'sourceSessionId':optionalTrimmed(_0x3c0063[_0x37dc45(0x1bb)](_0x37dc45(0x1d8)))}:{}};}function a35_0x1751(_0x27bd8f,_0xb581e7){_0x27bd8f=_0x27bd8f-0x1a2;const _0x59637c=a35_0x5963();let _0x17516c=_0x59637c[_0x27bd8f];return _0x17516c;}function buildUpdateInput(_0x5e6505){const _0x2876a0=a35_0x1b62c1,_0x3a6d69={};optionalTrimmed(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1ce)))&&(_0x3a6d69['functionName']=normalizeFunctionName(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1ce))));_0x5e6505['flag'](_0x2876a0(0x1c0))!==undefined&&(_0x3a6d69[_0x2876a0(0x1c0)]=_0x5e6505['str'](_0x2876a0(0x1c0)));optionalTrimmed(_0x5e6505['str'](_0x2876a0(0x1c2)))&&(_0x3a6d69[_0x2876a0(0x1ca)]=readScriptFile(_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1c2))));_0x5e6505[_0x2876a0(0x1ac)](_0x2876a0(0x1d8))!==undefined&&(_0x3a6d69[_0x2876a0(0x1a9)]=_0x5e6505[_0x2876a0(0x1bb)](_0x2876a0(0x1d8)));if(Object[_0x2876a0(0x1a2)](_0x3a6d69)['length']===0x0)throw CliErrors[_0x2876a0(0x1c5)](_0x2876a0(0x1d2));return _0x3a6d69;}function parseExecParams(_0x3e3b59){const _0x182be0=a35_0x1b62c1,_0x12d114=parseJsonParams(_0x3e3b59)??{};if(Array[_0x182be0(0x1da)](_0x12d114))throw CliErrors[_0x182be0(0x1c5)](_0x182be0(0x1bd));return _0x12d114;}const personalBffList={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1af),'description':a35_0x1b62c1(0x1df),'risk':a35_0x1b62c1(0x1d6),'flags':[VERBOSE_FLAG],async 'execute'(_0x2c3346){const _0x312c91=a35_0x1b62c1,_0x542ce5=await listPersonalBffs(_0x2c3346['appCode']);return{'ok':!![],'data':{'total':_0x542ce5['length'],'items':_0x2c3346[_0x312c91(0x1e0)]('verbose')?_0x542ce5:_0x542ce5[_0x312c91(0x1dd)](summarizeBff)}};}},personalBffDetail={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1a8),'description':a35_0x1b62c1(0x1b7),'risk':a35_0x1b62c1(0x1d6),'flags':[{...ID_FLAG,'description':a35_0x1b62c1(0x1a7)}],async 'execute'(_0x5a57bc){const _0xba0f62=a35_0x1b62c1,_0x57cac9=await getPersonalBff(_0x5a57bc[_0xba0f62(0x1b6)]('id'),_0x5a57bc[_0xba0f62(0x1bf)]);return{'ok':!![],'data':detailBff(_0x57cac9)};}},personalBffCreate={'service':'personal-bff','command':a35_0x1b62c1(0x1cd),'description':a35_0x1b62c1(0x1d5),'risk':a35_0x1b62c1(0x1d1),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x57ef10){const _0x5a6ff2=a35_0x1b62c1,_0x44927a=buildCreateInput(_0x57ef10),_0x476bcb=await createPersonalBff(_0x57ef10['appCode'],_0x44927a);return{'ok':!![],'data':detailBff(_0x476bcb),'message':_0x5a6ff2(0x1cf)+_0x476bcb['id']+(_0x476bcb[_0x5a6ff2(0x1b5)]?'\x20('+_0x476bcb['functionName']+')':'')};},async 'dryRun'(_0x4d3c50){const _0x35c4cf=a35_0x1b62c1,_0x3e6142=buildCreateInput(_0x4d3c50);return dryRun(_0x35c4cf(0x1e1),'/client/runtime-bff/personal/create')['body']({'appCode':_0x4d3c50[_0x35c4cf(0x1bf)],..._0x3e6142})['description']('Preview:\x20create\x20personal\x20BFF\x20'+_0x3e6142['functionName'])[_0x35c4cf(0x1d4)]();}},personalBffUpdate={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1aa),'description':a35_0x1b62c1(0x1e3),'risk':a35_0x1b62c1(0x1d1),'flags':[{...ID_FLAG,'description':a35_0x1b62c1(0x1a7)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xed5a21){const _0x333a28=a35_0x1b62c1,_0x2e4d69=_0xed5a21[_0x333a28(0x1b6)]('id'),_0x28a07e=buildUpdateInput(_0xed5a21),_0x22a648=await updatePersonalBff(_0x2e4d69,_0xed5a21[_0x333a28(0x1bf)],_0x28a07e);return{'ok':!![],'data':detailBff(_0x22a648),'message':_0x333a28(0x1b9)+_0x22a648['id']+(_0x22a648[_0x333a28(0x1b5)]?'\x20('+_0x22a648['functionName']+')':'')};},async 'dryRun'(_0x374f20){const _0xc833ce=a35_0x1b62c1,_0x55716a=_0x374f20['num']('id'),_0x3c31c5=buildUpdateInput(_0x374f20);return dryRun(_0xc833ce(0x1e1),_0xc833ce(0x1a5)+_0x55716a+_0xc833ce(0x1ab))[_0xc833ce(0x1ae)]({'appCode':_0x374f20[_0xc833ce(0x1bf)],..._0x3c31c5})['description'](_0xc833ce(0x1db)+_0x55716a)[_0xc833ce(0x1d4)]();}},personalBffExec={'service':a35_0x1b62c1(0x1d9),'command':a35_0x1b62c1(0x1be),'description':a35_0x1b62c1(0x1dc),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0x1b62c1(0x1c7)}],async 'validate'(_0x42e8dc){const _0x210735=a35_0x1b62c1;parseExecParams(_0x42e8dc[_0x210735(0x1bb)]('params'));},async 'execute'(_0x404e49){const _0x2f0b0f=a35_0x1b62c1,_0x4f11d4=_0x404e49[_0x2f0b0f(0x1b6)]('id'),_0x19c5fe=parseExecParams(_0x404e49['str'](_0x2f0b0f(0x1cc))),_0x8b8944=await executePersonalBff(_0x4f11d4,_0x404e49['appCode'],_0x19c5fe);return{'ok':!![],'data':{'result':_0x8b8944},'message':_0x2f0b0f(0x1b3)+_0x4f11d4};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x5f51cd=a36_0x1e91;(function(_0x15051a,_0x1bcf48){const _0x472ed4=a36_0x1e91,_0x18ad58=_0x15051a();while(!![]){try{const _0x302767=-parseInt(_0x472ed4(0x98))/0x1*(parseInt(_0x472ed4(0x91))/0x2)+parseInt(_0x472ed4(0x8d))/0x3+parseInt(_0x472ed4(0x97))/0x4*(parseInt(_0x472ed4(0xb3))/0x5)+parseInt(_0x472ed4(0xb2))/0x6+parseInt(_0x472ed4(0xa7))/0x7*(parseInt(_0x472ed4(0xb4))/0x8)+-parseInt(_0x472ed4(0x96))/0x9*(-parseInt(_0x472ed4(0x9c))/0xa)+parseInt(_0x472ed4(0xa6))/0xb*(-parseInt(_0x472ed4(0xb8))/0xc);if(_0x302767===_0x1bcf48)break;else _0x18ad58['push'](_0x18ad58['shift']());}catch(_0x244926){_0x18ad58['push'](_0x18ad58['shift']());}}}(a36_0x4c63,0x3a15f));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';function a36_0x1e91(_0x5a335b,_0x27cb16){_0x5a335b=_0x5a335b-0x8b;const _0x4c6358=a36_0x4c63();let _0x1e9118=_0x4c6358[_0x5a335b];return _0x1e9118;}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';function a36_0x4c63(){const _0x4a67de=['read','description','get','Skills','Runtime\x20App\x20Config','has','from','9157313UDoyNC','14pIoviJ','App\x20Management','install','values','write','\x20\x20[write]','set','Knowledge\x20Base','Service\x20Tree','SQL\x20Queries','list','2475330PHcNMR','28335PlDtmd','270280iwUhWU','OCR','Personal\x20BFF','CLI\x20Built-in\x20Skill','12AfshSk','Self\x20Update','push','1380006mIZdNe','Authentication','Workspace','service','1580rtwglr','isSingleCommand','show','API\x20Documentation','Datasets','18yBMHWC','332hpRFwW','431qbPlUh','login','Configuration','\x20\x20[high-risk-write]','2020RpFihS','File','command'];a36_0x4c63=function(){return _0x4a67de;};return a36_0x4c63();}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(_0x543485){const _0x510a40=a36_0x1e91;for(const _0x420b7c of _0x543485){definitions[_0x510a40(0xad)](_0x420b7c[_0x510a40(0x90)]+':'+_0x420b7c[_0x510a40(0x9e)],_0x420b7c);let _0x178de7=serviceGroups[_0x510a40(0xa1)](_0x420b7c[_0x510a40(0x90)]);!_0x178de7&&(_0x178de7=[],serviceGroups[_0x510a40(0xad)](_0x420b7c[_0x510a40(0x90)],_0x178de7)),_0x178de7[_0x510a40(0x8c)](_0x420b7c);}}function registerService(_0xec8459,_0x2c3b02,_0x91fca){const _0x3999ae=a36_0x1e91;registerDefinitions(_0x2c3b02);const _0x24f65c=_0x13daaa=>_0x13daaa===_0x3999ae(0x9f)?'':_0x13daaa===_0x3999ae(0xab)?_0x3999ae(0xac):_0x3999ae(0x9b),_0x409102={'service':_0x2c3b02[0x0]['service'],'label':_0xec8459,'commands':_0x2c3b02['map'](_0x2d7c07=>({'command':_0x2d7c07[_0x3999ae(0x9e)],'description':_0x2d7c07[_0x3999ae(0xa0)],'tag':_0x24f65c(_0x2d7c07['risk'])})),'defaultCommand':_0x91fca?.['defaultCommand']??(_0x91fca?.[_0x3999ae(0x92)]?_0x2c3b02[0x0][_0x3999ae(0x9e)]:undefined),'isSingleCommand':_0x91fca?.[_0x3999ae(0x92)]};serviceRegistry['push'](_0x409102),serviceByName[_0x3999ae(0xad)](_0x409102[_0x3999ae(0x90)],_0x409102);}registerService(a36_0x5f51cd(0x8e),authDefinitions,{'defaultCommand':a36_0x5f51cd(0x99)}),registerService(a36_0x5f51cd(0xa8),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5f51cd(0x8f),workspaceDefinitions),registerService(a36_0x5f51cd(0xa3),appConfigDefinitions),registerService(a36_0x5f51cd(0x9a),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x5f51cd(0x94),apiDocDefinitions),registerService(a36_0x5f51cd(0x95),datasetDefinitions),registerService('Instant\x20API',dataDefinitions),registerService(a36_0x5f51cd(0xb0),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0x5f51cd(0xb6),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x5f51cd(0x9d),fileDefinitions),registerService(a36_0x5f51cd(0xb5),ocrDefinitions),registerService(a36_0x5f51cd(0xae),kbDefinitions),registerService(a36_0x5f51cd(0xaf),serviceDefinitions,{'defaultCommand':a36_0x5f51cd(0xb1)}),registerService(a36_0x5f51cd(0xa2),skillDefinitions,{'defaultCommand':a36_0x5f51cd(0xa9)}),registerService(a36_0x5f51cd(0xb7),cliSkillDefinitions,{'defaultCommand':a36_0x5f51cd(0xa9)}),registerService(a36_0x5f51cd(0x8b),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x5f51cd(0x93)});export function findDefinition(_0x16fcba,_0x7b8712){const _0x54337f=a36_0x5f51cd;return definitions[_0x54337f(0xa1)](_0x16fcba+':'+_0x7b8712);}export function isKnownService(_0x1c75ad){const _0x511682=a36_0x5f51cd;return serviceByName[_0x511682(0xa4)](_0x1c75ad);}export function getServiceEntry(_0x13f5ff){const _0x5da45b=a36_0x5f51cd;return serviceByName[_0x5da45b(0xa1)](_0x13f5ff);}export function getAllDefinitions(){const _0x341a2f=a36_0x5f51cd;return Array[_0x341a2f(0xa5)](definitions[_0x341a2f(0xaa)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0xce5a01=a37_0x48a5;function a37_0x19f7(){const _0x46cd31=['4524399HacPIo','9pBOToS','32jjxprx','read','1379372qMXlkv','1188075zaqzYX','Export\x20machine-readable\x20command\x20schema\x20(JSON)','50617pAJHPq','1oXNHeb','3XiHYSX','881002XJlRop','schema','5255300MZnHAQ','1200924DjLwqF'];a37_0x19f7=function(){return _0x46cd31;};return a37_0x19f7();}(function(_0x27afd5,_0x3f87d1){const _0x21d302=a37_0x48a5,_0x594f22=_0x27afd5();while(!![]){try{const _0x81f9d9=parseInt(_0x21d302(0xe8))/0x1*(parseInt(_0x21d302(0xea))/0x2)+-parseInt(_0x21d302(0xe9))/0x3*(parseInt(_0x21d302(0xe4))/0x4)+parseInt(_0x21d302(0xe5))/0x5+-parseInt(_0x21d302(0xed))/0x6+parseInt(_0x21d302(0xe7))/0x7*(parseInt(_0x21d302(0xe2))/0x8)+-parseInt(_0x21d302(0xe1))/0x9*(-parseInt(_0x21d302(0xec))/0xa)+-parseInt(_0x21d302(0xee))/0xb;if(_0x81f9d9===_0x3f87d1)break;else _0x594f22['push'](_0x594f22['shift']());}catch(_0x49b205){_0x594f22['push'](_0x594f22['shift']());}}}(a37_0x19f7,0x43728));function a37_0x48a5(_0x3fa983,_0x26de85){_0x3fa983=_0x3fa983-0xe1;const _0x19f765=a37_0x19f7();let _0x48a5bd=_0x19f765[_0x3fa983];return _0x48a5bd;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5a19c1){const _0x151259=await buildSchemaPayload();return{'ok':!![],'data':_0x151259};}export const schemaDefinition={'service':a37_0xce5a01(0xeb),'command':'export','description':a37_0xce5a01(0xe6),'risk':a37_0xce5a01(0xe3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x365bf2,_0x539427){const _0x333a00=a38_0x97eb,_0x181002=_0x365bf2();while(!![]){try{const _0x3eecdc=-parseInt(_0x333a00(0x18f))/0x1*(-parseInt(_0x333a00(0x1a0))/0x2)+-parseInt(_0x333a00(0x1c7))/0x3+-parseInt(_0x333a00(0x1b8))/0x4+parseInt(_0x333a00(0x1e2))/0x5*(parseInt(_0x333a00(0x1b7))/0x6)+parseInt(_0x333a00(0x1d0))/0x7*(parseInt(_0x333a00(0x1a4))/0x8)+parseInt(_0x333a00(0x1d9))/0x9+-parseInt(_0x333a00(0x1af))/0xa;if(_0x3eecdc===_0x539427)break;else _0x181002['push'](_0x181002['shift']());}catch(_0x5f502b){_0x181002['push'](_0x181002['shift']());}}}(a38_0x568c,0x3f84f));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(_0x3ba6ef,_0x362dcf){const _0x27c730=a38_0x97eb,_0x58438f=listLocalServiceTrees();let _0x28ba34;for(const _0x5efc3d of _0x58438f){const _0x42aea7=matchServiceTreeCommand(_0x5efc3d,_0x3ba6ef);if(!_0x42aea7)continue;(!_0x28ba34||_0x42aea7[_0x27c730(0x1b6)][_0x27c730(0x1dc)]['length']>_0x28ba34[_0x27c730(0x1b6)][_0x27c730(0x1dc)][_0x27c730(0x1a2)])&&(_0x28ba34={'tree':_0x5efc3d,'command':_0x42aea7['command'],'remainingArgs':_0x42aea7[_0x27c730(0x199)]});}if(!_0x28ba34)return undefined;const _0xb88df2={..._0x362dcf};return applyAppBinding(_0x28ba34[_0x27c730(0x198)],_0x28ba34[_0x27c730(0x1b6)],_0xb88df2),{'definition':buildDynamicCommandDefinition(_0x28ba34[_0x27c730(0x198)],_0x28ba34[_0x27c730(0x1b6)]),'args':_0x28ba34[_0x27c730(0x199)],'flags':_0xb88df2,'tree':_0x28ba34[_0x27c730(0x198)],'command':_0x28ba34[_0x27c730(0x1b6)]};}export function generateDynamicServiceHelp(_0x2d4431){const _0x20eb04=a38_0x97eb,_0x5933a6=listLocalServiceTrees()[_0x20eb04(0x19e)](_0x5082d6=>_0x5082d6[_0x20eb04(0x1eb)][_0x20eb04(0x1b5)]===_0x2d4431);if(!_0x5933a6)return undefined;const _0x46a802=[CLI_BIN_NAME+'\x20'+_0x2d4431+_0x20eb04(0x191),'',_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c3)]||_0x2d4431,_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c1)]?'\x20\x20'+_0x5933a6[_0x20eb04(0x1eb)][_0x20eb04(0x1c1)]:'','','Commands:',..._0x5933a6[_0x20eb04(0x19d)][_0x20eb04(0x195)](_0x3fe814=>{const _0x5b010c=_0x20eb04,_0x36bc01=_0x3fe814['fullPath']['slice'](0x1)[_0x5b010c(0x1b0)]('\x20'),_0x5265ef=_0x3fe814['risk']===_0x5b010c(0x1ce)?'':'\x20['+_0x3fe814[_0x5b010c(0x1df)]+']';return'\x20\x20'+_0x36bc01[_0x5b010c(0x1ec)](0x18)+'\x20'+(_0x3fe814[_0x5b010c(0x1c1)]||'')+_0x5265ef;}),'','Use\x20`'+CLI_BIN_NAME+_0x20eb04(0x1c2)+_0x2d4431+_0x20eb04(0x1f1)][_0x20eb04(0x1bb)](Boolean);return _0x46a802[_0x20eb04(0x1b0)]('\x0a');}export function listDynamicServiceEntries(){const _0x52233d=a38_0x97eb;return listLocalServices()[_0x52233d(0x195)](_0x44ac4d=>{const _0x50e46e=_0x52233d,_0x401b9b=_0x44ac4d[_0x50e46e(0x1e0)];return{'service':_0x401b9b[_0x50e46e(0x1eb)]['code'],'label':_0x401b9b[_0x50e46e(0x1eb)][_0x50e46e(0x1c3)]||_0x401b9b[_0x50e46e(0x1eb)][_0x50e46e(0x1b5)],'commands':_0x401b9b['commands'][_0x50e46e(0x195)](_0x4257a2=>({'command':dynamicCommandName(_0x4257a2),'description':_0x4257a2[_0x50e46e(0x1c1)]||_0x50e46e(0x1cd)+_0x4257a2[_0x50e46e(0x1a9)],'tag':riskTag(_0x4257a2[_0x50e46e(0x1df)])}))};});}export function getDynamicServiceEntry(_0x3c67e2){const _0x26f49d=a38_0x97eb;return listDynamicServiceEntries()[_0x26f49d(0x19e)](_0x1bc95d=>_0x1bc95d[_0x26f49d(0x1eb)]===_0x3c67e2);}export function listDynamicServiceDefinitions(_0x4a6d2c){const _0x215534=a38_0x97eb;return listLocalServiceTrees()[_0x215534(0x1bb)](_0x36d7cc=>!_0x4a6d2c||_0x36d7cc[_0x215534(0x1eb)][_0x215534(0x1b5)]===_0x4a6d2c)['flatMap'](_0x5f24be=>_0x5f24be[_0x215534(0x19d)][_0x215534(0x195)](_0x14e972=>buildDynamicCommandDefinition(_0x5f24be,_0x14e972)));}export function getDynamicServiceDefinitions(_0x470f36){const _0x5675a9=a38_0x97eb,_0x49498d=listDynamicServiceDefinitions(_0x470f36);return _0x49498d[_0x5675a9(0x1a2)]>0x0?_0x49498d:undefined;}function a38_0x97eb(_0x4f462d,_0x5a483f){_0x4f462d=_0x4f462d-0x18f;const _0x568c54=a38_0x568c();let _0x97ebfe=_0x568c54[_0x4f462d];return _0x97ebfe;}export function findDynamicServiceDefinition(_0x4c205d,_0x2f3d17){const _0x426f25=a38_0x97eb;return listDynamicServiceDefinitions(_0x4c205d)['find'](_0x12562f=>_0x12562f[_0x426f25(0x1b6)]===_0x2f3d17);}export function buildDynamicCommandDefinition(_0x1ba7d8,_0x142a0a){const _0x5a1e9b=a38_0x97eb;return{'service':_0x1ba7d8['service']['code'],'command':dynamicCommandName(_0x142a0a),'description':_0x142a0a['description']||'Run\x20service\x20command\x20'+_0x142a0a[_0x5a1e9b(0x1a9)],'risk':_0x142a0a['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x142a0a[_0x5a1e9b(0x1e6)][_0x5a1e9b(0x195)](_0x45f0d3=>({'name':_0x45f0d3[_0x5a1e9b(0x1c3)],'description':_0x45f0d3[_0x5a1e9b(0x1c1)]||_0x45f0d3[_0x5a1e9b(0x1c3)],'required':_0x45f0d3['required']})),'flags':_0x142a0a['flags'][_0x5a1e9b(0x195)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x142a0a),async 'dryRun'(_0x446e09){const _0x4e0a6b=_0x5a1e9b,_0x22d721=await compilePlan(_0x142a0a,_0x446e09);return{'method':_0x4e0a6b(0x194),'url':_0x142a0a[_0x4e0a6b(0x1a9)],'body':{'target':targetPreview(_0x22d721),'params':_0x22d721['params']},'description':_0x4e0a6b(0x1b1)+_0x142a0a[_0x4e0a6b(0x1a9)]};},async 'execute'(_0x5d1e0f){const _0x401276=_0x5a1e9b,_0x33cd13=await compilePlan(_0x142a0a,_0x5d1e0f),_0x261e99=Date['now'](),_0x4859f7=await executePlan(_0x33cd13,_0x142a0a,_0x5d1e0f),_0xffb80e=Date[_0x401276(0x192)]()-_0x261e99;return{'ok':!![],'data':{'service':_0x1ba7d8[_0x401276(0x1eb)],'command':_0x142a0a[_0x401276(0x1a9)],'target':targetPreview(_0x33cd13),'result':_0x4859f7,'elapsed':_0xffb80e},'message':_0x401276(0x1ad)+_0x142a0a['cliPath']+'\x20completed\x20in\x20'+_0xffb80e+'ms'};}};}function dynamicCommandName(_0x36fb3a){const _0x49e450=a38_0x97eb;return _0x36fb3a['fullPath'][_0x49e450(0x1b2)](0x1)[_0x49e450(0x1b0)]('\x20');}function riskTag(_0x2a24f2){const _0x122044=a38_0x97eb;return _0x2a24f2==='read'?'':_0x122044(0x1ae)+_0x2a24f2+']';}function flagToCommandFlag(_0x24c54c){const _0xc75676=a38_0x97eb;return{'name':_0x24c54c[_0xc75676(0x1a5)],'type':_0x24c54c[_0xc75676(0x1be)]===_0xc75676(0x1ed)?_0xc75676(0x19c):_0x24c54c[_0xc75676(0x1be)],'description':_0x24c54c[_0xc75676(0x1c1)]||_0x24c54c['name'],'required':_0x24c54c['required'],'default':isPrimitiveFlagDefault(_0x24c54c['default'])?_0x24c54c['default']:undefined,'enum':_0x24c54c['enum']};}async function compilePlan(_0x291153,_0xb4b7d){const _0x408d31=a38_0x97eb;return compileServiceTreeCommand(_0x291153,{'flags':_0xb4b7d[_0x408d31(0x1bf)],'args':_0xb4b7d[_0x408d31(0x1e6)],'context':await buildServiceContext(_0x291153,_0xb4b7d)});}async function buildServiceContext(_0x494bce,_0x479e37){const _0x3a4ad3=a38_0x97eb,_0x1b4d34={'appCode':_0x479e37['appCode'],'env':_0x479e37[_0x3a4ad3(0x1a8)],'envName':_0x479e37[_0x3a4ad3(0x1a8)]};if(!usesRuntimeContext(_0x494bce))return _0x1b4d34;const _0x31dd99=await getLoginUserInfo(),_0x1fe460=pickFirst(_0x31dd99[_0x3a4ad3(0x1ee)],_0x31dd99['id']);return{..._0x1b4d34,'user':_0x31dd99,'userId':_0x1fe460,'id':_0x31dd99['id'],'username':pickFirst(_0x31dd99[_0x3a4ad3(0x1e4)],_0x31dd99['userName'],_0x31dd99[_0x3a4ad3(0x1e5)]),'userName':_0x31dd99[_0x3a4ad3(0x1ab)],'nickname':pickFirst(_0x31dd99[_0x3a4ad3(0x1d5)],_0x31dd99[_0x3a4ad3(0x1a7)]),'nickName':_0x31dd99['nickName'],'tenantCode':_0x31dd99[_0x3a4ad3(0x1c8)],'employeeId':_0x31dd99[_0x3a4ad3(0x1e3)]};}function usesRuntimeContext(_0x489996){const _0x2891ed=a38_0x97eb;return _0x489996[_0x2891ed(0x1db)][_0x2891ed(0x193)](_0x1043c3=>typeof _0x1043c3['source']==='string'&&(_0x1043c3[_0x2891ed(0x19b)]['startsWith'](_0x2891ed(0x1ca))||_0x1043c3[_0x2891ed(0x19b)][_0x2891ed(0x1a3)](_0x2891ed(0x1de))));}function pickFirst(..._0x4644c9){const _0x54ba62=a38_0x97eb;return _0x4644c9[_0x54ba62(0x19e)](_0x477a62=>_0x477a62!==undefined&&_0x477a62!==null);}async function executePlan(_0x4e7337,_0x52b931,_0x47e065){const _0x32f8fe=a38_0x97eb;if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x1d4)){const _0x216d89=await resolveDatasetCode(_0x4e7337,_0x52b931,_0x47e065);return executeData(_0x216d89,_0x4e7337['command'],_0x4e7337[_0x32f8fe(0x1c5)]);}if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x1aa)){if(!_0x4e7337[_0x32f8fe(0x190)])throw CliErrors[_0x32f8fe(0x1b4)]('Service\x20command\x20'+_0x52b931[_0x32f8fe(0x1a9)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x4e7337[_0x32f8fe(0x190)],normalizeScalarParams(_0x4e7337[_0x32f8fe(0x1c5)]));}if(_0x4e7337[_0x32f8fe(0x1c4)]===_0x32f8fe(0x196)){const _0x2fa75d=_0x4e7337['scriptName']||_0x4e7337[_0x32f8fe(0x1f0)]||(_0x4e7337[_0x32f8fe(0x1e1)]==null?'':String(_0x4e7337[_0x32f8fe(0x1e1)]));if(!_0x2fa75d)throw CliErrors[_0x32f8fe(0x1b4)](_0x32f8fe(0x1ad)+_0x52b931['cliPath']+_0x32f8fe(0x1d6));return executeSdkBff(_0x2fa75d,_0x4e7337[_0x32f8fe(0x1c5)]);}throw CliErrors[_0x32f8fe(0x1b4)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x4e7337[_0x32f8fe(0x1c4)]);}function a38_0x568c(){const _0x31acc6=['mapTo','fullPath','Cannot\x20resolve\x20datatable\x20\x22','ctx.','risk','normalizedManifest','bffId','200MrsMnp','employeeId','username','loginName','args','appcode','\x20\x20\x20\x20scriptName:\x20','entries','\x20\x20\x20\x20kind:\x20\x20\x20\x20','service','padEnd','json','userId','target','bffCode','`\x20to\x20inspect\x20the\x20manifest.','datasetCode','operator','1685dOaXfT','sqlCode','\x20<command>\x20[flags]','now','some','SERVICE_TREE','map','bff','appCode','tree','remainingArgs','app','source','string','commands','find','\x22\x20in\x20service\x20command\x20','130MzgcHb','const','length','startsWith','424uEdAme','cliName','tableName','nickName','envName','cliPath','sql','userName','\x20\x20\x20\x20datasetCode:\x20','Service\x20command\x20','\x20\x20[','5333500yBPPQE','join','Preview\x20dynamic\x20service\x20command:\x20','slice','appRef','validation','code','command','64254RqUsOT','826020ntSgMs','boolean','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','filter','datatable','dbtableConfig','type','rawFlags','\x20->\x20','description','\x20service\x20detail\x20--service\x20','name','kind','params','number','331266dUHYtP','tenantCode','scriptName','context.','push','\x20\x20\x20\x20sqlCode:\x20','Run\x20service\x20command\x20','read','\x20\x20\x20\x20command:\x20','61649iGsVkR','\x20\x20\x20\x20datatable:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20\x20\x20','data','nickname','\x20requires\x20target.scriptName.','fromEntries','env','952164jPovrA','Unknown\x20appRef\x20\x22'];a38_0x568c=function(){return _0x31acc6;};return a38_0x568c();}async function resolveDatasetCode(_0x5569ca,_0x130de2,_0x3904ef){const _0xe63af0=a38_0x97eb;if(_0x5569ca[_0xe63af0(0x1f2)])return _0x5569ca[_0xe63af0(0x1f2)];if(!_0x5569ca[_0xe63af0(0x1bc)])throw CliErrors[_0xe63af0(0x1b4)](_0xe63af0(0x1ad)+_0x130de2[_0xe63af0(0x1a9)]+_0xe63af0(0x1ba));const _0x2e4c0d=await listDatasets(_0x3904ef[_0xe63af0(0x197)]),_0x38100d=_0x2e4c0d[_0xe63af0(0x19e)](_0x5e4ebc=>_0x5e4ebc[_0xe63af0(0x1bd)]?.[_0xe63af0(0x1a6)]===_0x5569ca['datatable']);if(!_0x38100d?.[_0xe63af0(0x1b5)])throw CliErrors[_0xe63af0(0x1b4)](_0xe63af0(0x1dd)+_0x5569ca[_0xe63af0(0x1bc)]+_0xe63af0(0x1d2)+_0x3904ef[_0xe63af0(0x197)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x38100d[_0xe63af0(0x1b5)];}function applyAppBinding(_0x2d8a41,_0x34a5b3,_0x159f38){const _0x5e111b=a38_0x97eb,_0x177094=_0x34a5b3[_0x5e111b(0x1ef)]['appRef'];if(!_0x177094)return;const _0x3df37c=_0x2d8a41['appBindings'][_0x177094];if(!_0x3df37c)throw CliErrors['validation'](_0x5e111b(0x1da)+_0x177094+_0x5e111b(0x19f)+_0x34a5b3[_0x5e111b(0x1a9)]+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x87f045=_0x3df37c[_0x5e111b(0x1e7)]||_0x3df37c[_0x5e111b(0x197)];_0x87f045&&!hasText(_0x159f38['appcode'])&&(_0x159f38[_0x5e111b(0x1e7)]=_0x87f045),_0x3df37c[_0x5e111b(0x19a)]&&!hasText(_0x159f38[_0x5e111b(0x19a)])&&!hasText(_0x159f38['appcode'])&&(_0x159f38[_0x5e111b(0x19a)]=_0x3df37c['app']),_0x3df37c[_0x5e111b(0x1d8)]&&!hasText(_0x159f38[_0x5e111b(0x1d8)])&&(_0x159f38[_0x5e111b(0x1d8)]=_0x3df37c[_0x5e111b(0x1d8)]);}function renderDynamicCommandHelp(_0x523031){const _0x632fb8=a38_0x97eb,_0x5f0174=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x632fb8(0x1ea)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c4)],_0x632fb8(0x1cf)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1b6)]];if(_0x523031['target'][_0x632fb8(0x1f2)])_0x5f0174['push'](_0x632fb8(0x1ac)+_0x523031[_0x632fb8(0x1ef)]['datasetCode']);if(_0x523031[_0x632fb8(0x1ef)]['datatable'])_0x5f0174['push'](_0x632fb8(0x1d1)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1bc)]);if(_0x523031[_0x632fb8(0x1ef)]['sqlCode'])_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1cc)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x190)]);if(_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c9)])_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1e8)+_0x523031[_0x632fb8(0x1ef)][_0x632fb8(0x1c9)]);if(_0x523031[_0x632fb8(0x1db)]['length']>0x0){_0x5f0174[_0x632fb8(0x1cb)]('','\x20\x20MAP\x20TO');for(const _0x177bfa of _0x523031['mapTo']){_0x5f0174[_0x632fb8(0x1cb)](_0x632fb8(0x1d3)+(_0x177bfa['source']||_0x632fb8(0x1a1))+_0x632fb8(0x1c0)+_0x177bfa[_0x632fb8(0x1ef)]+(_0x177bfa[_0x632fb8(0x1f3)]?'.'+_0x177bfa[_0x632fb8(0x1f3)]:''));}}return _0x5f0174['join']('\x0a');}function targetPreview(_0x1a722c){const _0x1e8a39=a38_0x97eb;return{'kind':_0x1a722c['kind'],'command':_0x1a722c['command'],'appRef':_0x1a722c[_0x1e8a39(0x1b3)],'datasetCode':_0x1a722c[_0x1e8a39(0x1f2)],'datatable':_0x1a722c[_0x1e8a39(0x1bc)],'sqlCode':_0x1a722c[_0x1e8a39(0x190)],'bffCode':_0x1a722c[_0x1e8a39(0x1f0)],'bffId':_0x1a722c[_0x1e8a39(0x1e1)],'scriptName':_0x1a722c['scriptName']};}function normalizeScalarParams(_0x1ee55f){const _0x9109e6=a38_0x97eb;return Object[_0x9109e6(0x1d7)](Object[_0x9109e6(0x1e9)](_0x1ee55f)[_0x9109e6(0x1bb)](([,_0x21afe9])=>typeof _0x21afe9==='string'||typeof _0x21afe9===_0x9109e6(0x1c6)));}function hasText(_0x2a8e6a){const _0x3adf5e=a38_0x97eb;return typeof _0x2a8e6a===_0x3adf5e(0x19c)&&_0x2a8e6a['trim']()[_0x3adf5e(0x1a2)]>0x0;}function isPrimitiveFlagDefault(_0x407232){const _0x17f21c=a38_0x97eb;return _0x407232===undefined||typeof _0x407232===_0x17f21c(0x19c)||typeof _0x407232===_0x17f21c(0x1c6)||typeof _0x407232===_0x17f21c(0x1b9);}
|
|
1
|
+
(function(_0x590701,_0x2c5c77){const _0x1b097a=a38_0x58ff,_0x27571d=_0x590701();while(!![]){try{const _0x300f50=-parseInt(_0x1b097a(0x11f))/0x1+parseInt(_0x1b097a(0xf8))/0x2*(-parseInt(_0x1b097a(0x138))/0x3)+-parseInt(_0x1b097a(0x121))/0x4+-parseInt(_0x1b097a(0x139))/0x5*(parseInt(_0x1b097a(0x13b))/0x6)+parseInt(_0x1b097a(0xf2))/0x7+-parseInt(_0x1b097a(0x104))/0x8+parseInt(_0x1b097a(0x12f))/0x9;if(_0x300f50===_0x2c5c77)break;else _0x27571d['push'](_0x27571d['shift']());}catch(_0x591e26){_0x27571d['push'](_0x27571d['shift']());}}}(a38_0x4ebf,0xde7a8));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';function a38_0x4ebf(){const _0x169c47=['service','startsWith','sql','name','description','type','\x20\x20\x20\x20kind:\x20\x20\x20\x20','Service\x20command\x20','\x20<command>\x20[flags]','slice','\x20\x20\x20\x20scriptName:\x20','number','join','bffCode','json','\x20\x20\x20\x20datasetCode:\x20','default','\x20\x20\x20\x20command:\x20','\x20\x20\x20\x20','Commands:','\x20completed\x20in\x20','fullPath','code','map','tenantCode','6274737BaRVcA','\x20requires\x20target.scriptName.','bffId','app','Run\x20service\x20command\x20','\x20requires\x20target.sqlCode.','2HzomsC','flatMap','`\x20to\x20inspect\x20the\x20manifest.','userId','context.','required','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','appRef','\x20->\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','appCode','\x20\x20MAP\x20TO','7191320jqcAAL','flags','appBindings','target','length','userName','Preview\x20dynamic\x20service\x20command:\x20','params','nickname','\x22\x20in\x20service\x20command\x20','now','padEnd','cliPath','enum','kind','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','datatable','tree','command','find','Unknown\x20appRef\x20\x22','datasetCode','filter','scriptName','\x20\x20\x20\x20sqlCode:\x20','remainingArgs','commands','573712UtJcwG','sqlCode','439668QjspVN','env','Cannot\x20resolve\x20datatable\x20\x22','normalizedManifest','\x20\x20[','mapTo','SERVICE_TREE','\x20\x20\x20\x20datatable:\x20','appcode','const','dbtableConfig','ctx.','args','cliName','35510328AGVaTD','Use\x20`','bff','boolean','data','username','push','envName','read','5365881wkfOug','2020yJwhsB','source','8310xehQDP','risk','loginName','operator','string','validation','fromEntries','entries'];a38_0x4ebf=function(){return _0x169c47;};return a38_0x4ebf();}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x5b2386,_0x530d73){const _0x3722b6=a38_0x58ff,_0x418d46=listLocalServiceTrees();let _0xea2785;for(const _0x973a91 of _0x418d46){const _0x544402=matchServiceTreeCommand(_0x973a91,_0x5b2386);if(!_0x544402)continue;(!_0xea2785||_0x544402['command']['fullPath'][_0x3722b6(0x108)]>_0xea2785[_0x3722b6(0x116)]['fullPath'][_0x3722b6(0x108)])&&(_0xea2785={'tree':_0x973a91,'command':_0x544402[_0x3722b6(0x116)],'remainingArgs':_0x544402['remainingArgs']});}if(!_0xea2785)return undefined;const _0x1ba228={..._0x530d73};return applyAppBinding(_0xea2785[_0x3722b6(0x115)],_0xea2785[_0x3722b6(0x116)],_0x1ba228),{'definition':buildDynamicCommandDefinition(_0xea2785[_0x3722b6(0x115)],_0xea2785[_0x3722b6(0x116)]),'args':_0xea2785[_0x3722b6(0x11d)],'flags':_0x1ba228,'tree':_0xea2785['tree'],'command':_0xea2785[_0x3722b6(0x116)]};}export function generateDynamicServiceHelp(_0x1aeec5){const _0x32dcb1=a38_0x58ff,_0x219a26=listLocalServiceTrees()[_0x32dcb1(0x117)](_0x164ca6=>_0x164ca6[_0x32dcb1(0x143)][_0x32dcb1(0xef)]===_0x1aeec5);if(!_0x219a26)return undefined;const _0x56637d=[CLI_BIN_NAME+'\x20'+_0x1aeec5+_0x32dcb1(0x14b),'',_0x219a26[_0x32dcb1(0x143)][_0x32dcb1(0x146)]||_0x1aeec5,_0x219a26[_0x32dcb1(0x143)]['description']?'\x20\x20'+_0x219a26['service']['description']:'','',_0x32dcb1(0xec),..._0x219a26['commands']['map'](_0x33d294=>{const _0x116421=_0x32dcb1,_0x47099f=_0x33d294[_0x116421(0xee)][_0x116421(0x14c)](0x1)[_0x116421(0x14f)]('\x20'),_0x4b039e=_0x33d294[_0x116421(0x13c)]===_0x116421(0x137)?'':'\x20['+_0x33d294[_0x116421(0x13c)]+']';return'\x20\x20'+_0x47099f[_0x116421(0x10f)](0x18)+'\x20'+(_0x33d294[_0x116421(0x147)]||'')+_0x4b039e;}),'',_0x32dcb1(0x130)+CLI_BIN_NAME+'\x20service\x20detail\x20--service\x20'+_0x1aeec5+_0x32dcb1(0xfa)][_0x32dcb1(0x11a)](Boolean);return _0x56637d['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x51a6fd=>{const _0x2cafdf=a38_0x58ff,_0x56d487=_0x51a6fd[_0x2cafdf(0x124)];return{'service':_0x56d487['service'][_0x2cafdf(0xef)],'label':_0x56d487[_0x2cafdf(0x143)][_0x2cafdf(0x146)]||_0x56d487[_0x2cafdf(0x143)][_0x2cafdf(0xef)],'commands':_0x56d487[_0x2cafdf(0x11e)]['map'](_0x3ff8a0=>({'command':dynamicCommandName(_0x3ff8a0),'description':_0x3ff8a0[_0x2cafdf(0x147)]||_0x2cafdf(0xf6)+_0x3ff8a0[_0x2cafdf(0x110)],'tag':riskTag(_0x3ff8a0[_0x2cafdf(0x13c)])}))};});}export function getDynamicServiceEntry(_0x550b7f){const _0x5d445b=a38_0x58ff;return listDynamicServiceEntries()[_0x5d445b(0x117)](_0x3d5bd7=>_0x3d5bd7[_0x5d445b(0x143)]===_0x550b7f);}export function listDynamicServiceDefinitions(_0x2a6fbf){const _0x310da1=a38_0x58ff;return listLocalServiceTrees()['filter'](_0x23237d=>!_0x2a6fbf||_0x23237d[_0x310da1(0x143)][_0x310da1(0xef)]===_0x2a6fbf)[_0x310da1(0xf9)](_0x457ab8=>_0x457ab8[_0x310da1(0x11e)][_0x310da1(0xf0)](_0x5eafd8=>buildDynamicCommandDefinition(_0x457ab8,_0x5eafd8)));}function a38_0x58ff(_0x2764a0,_0x30c081){_0x2764a0=_0x2764a0-0xeb;const _0x4ebf57=a38_0x4ebf();let _0x58ffc0=_0x4ebf57[_0x2764a0];return _0x58ffc0;}export function getDynamicServiceDefinitions(_0x2892b5){const _0x1d40cb=listDynamicServiceDefinitions(_0x2892b5);return _0x1d40cb['length']>0x0?_0x1d40cb:undefined;}export function findDynamicServiceDefinition(_0x3d64f3,_0x3d4934){const _0x3af4da=a38_0x58ff;return listDynamicServiceDefinitions(_0x3d64f3)[_0x3af4da(0x117)](_0x5518a6=>_0x5518a6[_0x3af4da(0x116)]===_0x3d4934);}export function buildDynamicCommandDefinition(_0x315062,_0x3e0770){const _0x4e9860=a38_0x58ff;return{'service':_0x315062[_0x4e9860(0x143)][_0x4e9860(0xef)],'command':dynamicCommandName(_0x3e0770),'description':_0x3e0770[_0x4e9860(0x147)]||_0x4e9860(0xf6)+_0x3e0770[_0x4e9860(0x110)],'risk':_0x3e0770[_0x4e9860(0x13c)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3e0770[_0x4e9860(0x12d)][_0x4e9860(0xf0)](_0x4b8d43=>({'name':_0x4b8d43[_0x4e9860(0x146)],'description':_0x4b8d43[_0x4e9860(0x147)]||_0x4b8d43[_0x4e9860(0x146)],'required':_0x4b8d43[_0x4e9860(0xfd)]})),'flags':_0x3e0770[_0x4e9860(0x105)][_0x4e9860(0xf0)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3e0770),async 'dryRun'(_0x107645){const _0x4a302e=_0x4e9860,_0x199514=await compilePlan(_0x3e0770,_0x107645);return{'method':_0x4a302e(0x127),'url':_0x3e0770[_0x4a302e(0x110)],'body':{'target':targetPreview(_0x199514),'params':_0x199514[_0x4a302e(0x10b)]},'description':_0x4a302e(0x10a)+_0x3e0770[_0x4a302e(0x110)]};},async 'execute'(_0x3b2cc6){const _0x157e43=_0x4e9860,_0x52a207=await compilePlan(_0x3e0770,_0x3b2cc6),_0x52a3d0=Date[_0x157e43(0x10e)](),_0x51a364=await executePlan(_0x52a207,_0x3e0770,_0x3b2cc6),_0x1a58a5=Date[_0x157e43(0x10e)]()-_0x52a3d0;return{'ok':!![],'data':{'service':_0x315062[_0x157e43(0x143)],'command':_0x3e0770[_0x157e43(0x110)],'target':targetPreview(_0x52a207),'result':_0x51a364,'elapsed':_0x1a58a5},'message':_0x157e43(0x14a)+_0x3e0770[_0x157e43(0x110)]+_0x157e43(0xed)+_0x1a58a5+'ms'};}};}function dynamicCommandName(_0x41aa2e){const _0x14f401=a38_0x58ff;return _0x41aa2e[_0x14f401(0xee)][_0x14f401(0x14c)](0x1)[_0x14f401(0x14f)]('\x20');}function riskTag(_0x2ca060){const _0x5be4e7=a38_0x58ff;return _0x2ca060===_0x5be4e7(0x137)?'':_0x5be4e7(0x125)+_0x2ca060+']';}function flagToCommandFlag(_0x5b1c89){const _0x5d0ca0=a38_0x58ff;return{'name':_0x5b1c89[_0x5d0ca0(0x12e)],'type':_0x5b1c89[_0x5d0ca0(0x148)]===_0x5d0ca0(0x151)?_0x5d0ca0(0x13f):_0x5b1c89[_0x5d0ca0(0x148)],'description':_0x5b1c89[_0x5d0ca0(0x147)]||_0x5b1c89[_0x5d0ca0(0x146)],'required':_0x5b1c89[_0x5d0ca0(0xfd)],'default':isPrimitiveFlagDefault(_0x5b1c89[_0x5d0ca0(0x153)])?_0x5b1c89['default']:undefined,'enum':_0x5b1c89[_0x5d0ca0(0x111)]};}async function compilePlan(_0xcc5a92,_0x9b5fe3){const _0x3579d9=a38_0x58ff;return compileServiceTreeCommand(_0xcc5a92,{'flags':_0x9b5fe3['rawFlags'],'args':_0x9b5fe3[_0x3579d9(0x12d)],'context':await buildServiceContext(_0xcc5a92,_0x9b5fe3)});}async function buildServiceContext(_0x975e0e,_0x5b2b1c){const _0x5eae38=a38_0x58ff,_0x56698c={'appCode':_0x5b2b1c[_0x5eae38(0x102)],'env':_0x5b2b1c['envName'],'envName':_0x5b2b1c[_0x5eae38(0x136)]};if(!usesRuntimeContext(_0x975e0e))return _0x56698c;const _0x3cac2b=await getLoginUserInfo(),_0x1b5a75=pickFirst(_0x3cac2b[_0x5eae38(0xfb)],_0x3cac2b['id']);return{..._0x56698c,'user':_0x3cac2b,'userId':_0x1b5a75,'id':_0x3cac2b['id'],'username':pickFirst(_0x3cac2b[_0x5eae38(0x134)],_0x3cac2b[_0x5eae38(0x109)],_0x3cac2b[_0x5eae38(0x13d)]),'userName':_0x3cac2b[_0x5eae38(0x109)],'nickname':pickFirst(_0x3cac2b[_0x5eae38(0x10c)],_0x3cac2b['nickName']),'nickName':_0x3cac2b['nickName'],'tenantCode':_0x3cac2b[_0x5eae38(0xf1)],'employeeId':_0x3cac2b['employeeId']};}function usesRuntimeContext(_0x3fb6cb){const _0x3f58fb=a38_0x58ff;return _0x3fb6cb['mapTo']['some'](_0x23bfd3=>typeof _0x23bfd3[_0x3f58fb(0x13a)]===_0x3f58fb(0x13f)&&(_0x23bfd3['source'][_0x3f58fb(0x144)](_0x3f58fb(0xfc))||_0x23bfd3[_0x3f58fb(0x13a)][_0x3f58fb(0x144)](_0x3f58fb(0x12c))));}function pickFirst(..._0x5e5f48){const _0x5a0876=a38_0x58ff;return _0x5e5f48[_0x5a0876(0x117)](_0x11cc6a=>_0x11cc6a!==undefined&&_0x11cc6a!==null);}async function executePlan(_0x142dc8,_0x21284e,_0x3b4802){const _0x53c58d=a38_0x58ff;if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x133)){const _0x26584b=await resolveDatasetCode(_0x142dc8,_0x21284e,_0x3b4802);return executeData(_0x26584b,_0x142dc8['command'],_0x142dc8[_0x53c58d(0x10b)]);}if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x145)){if(!_0x142dc8[_0x53c58d(0x120)])throw CliErrors[_0x53c58d(0x140)](_0x53c58d(0x14a)+_0x21284e[_0x53c58d(0x110)]+_0x53c58d(0xf7));return executeSdkSql(_0x142dc8[_0x53c58d(0x120)],normalizeScalarParams(_0x142dc8['params']));}if(_0x142dc8[_0x53c58d(0x112)]===_0x53c58d(0x131)){const _0x4d536d=_0x142dc8[_0x53c58d(0x11b)]||_0x142dc8[_0x53c58d(0x150)]||(_0x142dc8['bffId']==null?'':String(_0x142dc8[_0x53c58d(0xf4)]));if(!_0x4d536d)throw CliErrors[_0x53c58d(0x140)](_0x53c58d(0x14a)+_0x21284e[_0x53c58d(0x110)]+_0x53c58d(0xf3));return executeSdkBff(_0x4d536d,_0x142dc8['params']);}throw CliErrors[_0x53c58d(0x140)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x142dc8[_0x53c58d(0x112)]);}async function resolveDatasetCode(_0xb4560a,_0x2c4ef6,_0x587d78){const _0x13150a=a38_0x58ff;if(_0xb4560a[_0x13150a(0x119)])return _0xb4560a['datasetCode'];if(!_0xb4560a[_0x13150a(0x114)])throw CliErrors[_0x13150a(0x140)](_0x13150a(0x14a)+_0x2c4ef6[_0x13150a(0x110)]+_0x13150a(0xfe));const _0x4681a4=await listDatasets(_0x587d78[_0x13150a(0x102)]),_0x2cea9f=_0x4681a4[_0x13150a(0x117)](_0x1988ee=>_0x1988ee[_0x13150a(0x12b)]?.['tableName']===_0xb4560a['datatable']);if(!_0x2cea9f?.['code'])throw CliErrors[_0x13150a(0x140)](_0x13150a(0x123)+_0xb4560a[_0x13150a(0x114)]+_0x13150a(0x101)+_0x587d78[_0x13150a(0x102)]+'.',_0x13150a(0x113));return _0x2cea9f[_0x13150a(0xef)];}function applyAppBinding(_0x5b7fb2,_0x39bc6c,_0x9428af){const _0x6ec439=a38_0x58ff,_0xcc3208=_0x39bc6c[_0x6ec439(0x107)][_0x6ec439(0xff)];if(!_0xcc3208)return;const _0x5be8bf=_0x5b7fb2[_0x6ec439(0x106)][_0xcc3208];if(!_0x5be8bf)throw CliErrors[_0x6ec439(0x140)](_0x6ec439(0x118)+_0xcc3208+_0x6ec439(0x10d)+_0x39bc6c['cliPath']+'.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.');const _0x8b73aa=_0x5be8bf['appcode']||_0x5be8bf[_0x6ec439(0x102)];_0x8b73aa&&!hasText(_0x9428af['appcode'])&&(_0x9428af['appcode']=_0x8b73aa),_0x5be8bf[_0x6ec439(0xf5)]&&!hasText(_0x9428af[_0x6ec439(0xf5)])&&!hasText(_0x9428af[_0x6ec439(0x129)])&&(_0x9428af[_0x6ec439(0xf5)]=_0x5be8bf[_0x6ec439(0xf5)]),_0x5be8bf['env']&&!hasText(_0x9428af['env'])&&(_0x9428af[_0x6ec439(0x122)]=_0x5be8bf[_0x6ec439(0x122)]);}function renderDynamicCommandHelp(_0x437bbb){const _0x3a8ff7=a38_0x58ff,_0x337574=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x3a8ff7(0x149)+_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x112)],_0x3a8ff7(0x154)+_0x437bbb['target']['command']];if(_0x437bbb['target'][_0x3a8ff7(0x119)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x152)+_0x437bbb[_0x3a8ff7(0x107)]['datasetCode']);if(_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x114)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x128)+_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x114)]);if(_0x437bbb[_0x3a8ff7(0x107)][_0x3a8ff7(0x120)])_0x337574[_0x3a8ff7(0x135)](_0x3a8ff7(0x11c)+_0x437bbb['target'][_0x3a8ff7(0x120)]);if(_0x437bbb['target'][_0x3a8ff7(0x11b)])_0x337574['push'](_0x3a8ff7(0x14d)+_0x437bbb['target'][_0x3a8ff7(0x11b)]);if(_0x437bbb[_0x3a8ff7(0x126)][_0x3a8ff7(0x108)]>0x0){_0x337574[_0x3a8ff7(0x135)]('',_0x3a8ff7(0x103));for(const _0x5597cf of _0x437bbb[_0x3a8ff7(0x126)]){_0x337574['push'](_0x3a8ff7(0xeb)+(_0x5597cf[_0x3a8ff7(0x13a)]||_0x3a8ff7(0x12a))+_0x3a8ff7(0x100)+_0x5597cf[_0x3a8ff7(0x107)]+(_0x5597cf['operator']?'.'+_0x5597cf[_0x3a8ff7(0x13e)]:''));}}return _0x337574[_0x3a8ff7(0x14f)]('\x0a');}function targetPreview(_0x3da482){const _0x49271c=a38_0x58ff;return{'kind':_0x3da482[_0x49271c(0x112)],'command':_0x3da482[_0x49271c(0x116)],'appRef':_0x3da482[_0x49271c(0xff)],'datasetCode':_0x3da482[_0x49271c(0x119)],'datatable':_0x3da482[_0x49271c(0x114)],'sqlCode':_0x3da482[_0x49271c(0x120)],'bffCode':_0x3da482[_0x49271c(0x150)],'bffId':_0x3da482[_0x49271c(0xf4)],'scriptName':_0x3da482[_0x49271c(0x11b)]};}function normalizeScalarParams(_0x40ff5c){const _0x5dd8f2=a38_0x58ff;return Object[_0x5dd8f2(0x141)](Object[_0x5dd8f2(0x142)](_0x40ff5c)[_0x5dd8f2(0x11a)](([,_0x328e18])=>typeof _0x328e18===_0x5dd8f2(0x13f)||typeof _0x328e18===_0x5dd8f2(0x14e)));}function hasText(_0x274242){const _0x452b18=a38_0x58ff;return typeof _0x274242===_0x452b18(0x13f)&&_0x274242['trim']()[_0x452b18(0x108)]>0x0;}function isPrimitiveFlagDefault(_0x362270){const _0x26ff90=a38_0x58ff;return _0x362270===undefined||typeof _0x362270===_0x26ff90(0x13f)||typeof _0x362270==='number'||typeof _0x362270===_0x26ff90(0x132);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x1b976b=a39_0x5c55;(function(_0x445ef4,_0x3972ef){const _0x5296a2=a39_0x5c55,_0x11bace=_0x445ef4();while(!![]){try{const _0x25335d=parseInt(_0x5296a2(0x215))/0x1*(-parseInt(_0x5296a2(0x1f0))/0x2)+-parseInt(_0x5296a2(0x219))/0x3*(-parseInt(_0x5296a2(0x20e))/0x4)+-parseInt(_0x5296a2(0x1ef))/0x5*(-parseInt(_0x5296a2(0x21b))/0x6)+-parseInt(_0x5296a2(0x1fc))/0x7*(parseInt(_0x5296a2(0x21e))/0x8)+parseInt(_0x5296a2(0x20f))/0x9*(parseInt(_0x5296a2(0x20b))/0xa)+parseInt(_0x5296a2(0x1fd))/0xb+parseInt(_0x5296a2(0x202))/0xc;if(_0x25335d===_0x3972ef)break;else _0x11bace['push'](_0x11bace['shift']());}catch(_0x5d4dda){_0x11bace['push'](_0x11bace['shift']());}}}(a39_0x1484,0x2593e));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x1b976b(0x201),'type':a39_0x1b976b(0x22d),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a39_0x1b976b(0x1e7),'type':a39_0x1b976b(0x22d),'required':!![],'description':a39_0x1b976b(0x1f2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a39_0x1b976b(0x1f9)}};function a39_0x1484(){const _0x58e6de=['name','serviceCount','registryPath','str','cliName','export','description','Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','11190uAljmJ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','detail','4912wGbwlH','927Uhuzlc','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Imported\x20','kind','manifest','map','153239nNyNTv','Service\x20registry\x20validation\x20passed.','\x20service\x20','\x20service(s).','282UAKCvt','version','267510crPkqj','type','risk','24qetfdJ','write','normalizedManifest','updated','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','warnings','commands','import','filePath','errors','imported','Removed\x20service\x20','manifests','remove','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','string','registryServiceCode','replaced','Exported\x20service\x20','source','required','service','reduce','length','Updated','flags','cliPath','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','target','5iyRaJV','2FkgyEo','serviceCode','Local\x20service\x20code,\x20for\x20example\x20crm','hash','entries','WRITE','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','Service\x20manifest\x20validation\x20passed.','lower\x20kebab-case\x20service\x20code','\x20service(s),\x20updated\x20','report','632737ssFAjc','1538438BtnRKa','entry','registry','read','file','1958376wquSmq'];a39_0x1484=function(){return _0x58e6de;};return a39_0x1484();}function summarizeService(_0x1b4636){const _0x10655d=a39_0x1b976b;return{'serviceCode':_0x1b4636[_0x10655d(0x1f1)],'name':_0x1b4636[_0x10655d(0x220)][_0x10655d(0x1e7)][_0x10655d(0x203)],'version':_0x1b4636[_0x10655d(0x21a)],'importedAt':_0x1b4636['importedAt'],'source':_0x1b4636[_0x10655d(0x231)],'commandCount':_0x1b4636[_0x10655d(0x220)][_0x10655d(0x224)]['length'],'commands':_0x1b4636['normalizedManifest'][_0x10655d(0x224)]['map'](_0x556686=>({'path':_0x556686[_0x10655d(0x1ec)],'description':_0x556686[_0x10655d(0x209)],'risk':_0x556686[_0x10655d(0x21d)],'target':_0x556686[_0x10655d(0x1ee)],'flags':_0x556686[_0x10655d(0x1eb)]['map'](_0x212ec5=>({'name':_0x212ec5[_0x10655d(0x203)],'cliName':_0x212ec5[_0x10655d(0x207)],'type':_0x212ec5[_0x10655d(0x21c)],'required':_0x212ec5[_0x10655d(0x1e6)]===!![]}))}))};}function summarizeLoadedManifest(_0x471540){const _0x21535c=a39_0x1b976b;return{'service':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x1e7)],'version':_0x471540['normalizedManifest']?.['version'],'commandCount':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x224)][_0x21535c(0x1e9)]??0x0,'commands':_0x471540[_0x21535c(0x220)]?.[_0x21535c(0x224)][_0x21535c(0x214)](_0x380e3b=>({'path':_0x380e3b[_0x21535c(0x1ec)],'risk':_0x380e3b[_0x21535c(0x21d)],'target':_0x380e3b[_0x21535c(0x1ee)]}))??[],'registryIndex':_0x471540['registryIndex'],'registryServiceCode':_0x471540[_0x21535c(0x22e)],'errors':_0x471540[_0x21535c(0x1fb)][_0x21535c(0x227)],'warnings':_0x471540[_0x21535c(0x1fb)][_0x21535c(0x223)]};}function a39_0x5c55(_0x3e3e4b,_0x1abf78){_0x3e3e4b=_0x3e3e4b-0x1e6;const _0x148456=a39_0x1484();let _0x5c5539=_0x148456[_0x3e3e4b];return _0x5c5539;}export const serviceDefinitions=[{'service':'service','command':'validate','description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x6b9365){const _0x275b5e=a39_0x1b976b,_0xba4629=loadServiceManifestFromFile(_0x6b9365[_0x275b5e(0x206)](_0x275b5e(0x201)));if(!_0xba4629[_0x275b5e(0x1fb)]['ok'])return{'ok':![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629[_0x275b5e(0x1f3)],'kind':_0xba4629[_0x275b5e(0x212)],'serviceCount':_0xba4629['manifests']['length'],'services':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x214)](summarizeLoadedManifest),'errors':_0xba4629[_0x275b5e(0x1fb)][_0x275b5e(0x227)],'warnings':_0xba4629[_0x275b5e(0x1fb)]['warnings']},'message':formatValidationFailure(_0xba4629['report'])};if(_0xba4629[_0x275b5e(0x212)]===_0x275b5e(0x1ff)||_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e9)]!==0x1)return{'ok':!![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629['hash'],'kind':_0xba4629[_0x275b5e(0x212)],'serviceCount':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e9)],'commandCount':_0xba4629[_0x275b5e(0x22a)][_0x275b5e(0x1e8)]((_0x310822,_0x5b1acd)=>_0x310822+(_0x5b1acd[_0x275b5e(0x220)]?.[_0x275b5e(0x224)][_0x275b5e(0x1e9)]??0x0),0x0),'services':_0xba4629['manifests']['map'](summarizeLoadedManifest),'warnings':_0xba4629['report'][_0x275b5e(0x223)]},'message':_0x275b5e(0x216)};return{'ok':!![],'data':{'file':_0xba4629[_0x275b5e(0x226)],'hash':_0xba4629[_0x275b5e(0x1f3)],'kind':_0xba4629['kind'],'service':_0xba4629[_0x275b5e(0x220)]?.['service'],'version':_0xba4629[_0x275b5e(0x220)]?.[_0x275b5e(0x21a)],'commandCount':_0xba4629[_0x275b5e(0x220)]?.[_0x275b5e(0x224)][_0x275b5e(0x1e9)]??0x0,'commands':_0xba4629[_0x275b5e(0x220)]?.['commands'][_0x275b5e(0x214)](_0x52687a=>({'path':_0x52687a['cliPath'],'risk':_0x52687a['risk'],'target':_0x52687a['target']})),'warnings':_0xba4629[_0x275b5e(0x1fb)][_0x275b5e(0x223)]},'message':_0x275b5e(0x1f8)};}},{'service':'service','command':a39_0x1b976b(0x225),'description':a39_0x1b976b(0x1f7),'risk':a39_0x1b976b(0x21f),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x5e8834){const _0x1ae462=a39_0x1b976b,_0x4b2438=loadServiceManifestFromFile(_0x5e8834['str'](_0x1ae462(0x201)));return{'method':_0x1ae462(0x1f5),'url':getServiceRegistryPath(),'body':{'file':_0x4b2438[_0x1ae462(0x226)],'hash':_0x4b2438[_0x1ae462(0x1f3)],'kind':_0x4b2438[_0x1ae462(0x212)],'ok':_0x4b2438[_0x1ae462(0x1fb)]['ok'],'service':_0x4b2438[_0x1ae462(0x220)]?.['service'],'version':_0x4b2438[_0x1ae462(0x220)]?.[_0x1ae462(0x21a)],'serviceCount':_0x4b2438[_0x1ae462(0x22a)][_0x1ae462(0x1e9)],'services':_0x4b2438[_0x1ae462(0x22a)][_0x1ae462(0x214)](_0x4c8561=>({'service':_0x4c8561['normalizedManifest']?.[_0x1ae462(0x1e7)],'version':_0x4c8561[_0x1ae462(0x220)]?.[_0x1ae462(0x21a)],'commandCount':_0x4c8561[_0x1ae462(0x220)]?.[_0x1ae462(0x224)]['length']??0x0,'errors':_0x4c8561[_0x1ae462(0x1fb)]['errors']})),'errors':_0x4b2438[_0x1ae462(0x1fb)][_0x1ae462(0x227)],'commandCount':_0x4b2438['normalizedManifest']?.['commands'][_0x1ae462(0x1e9)]??0x0},'description':_0x1ae462(0x1f6)};},async 'execute'(_0x2573a1){const _0x33e6c0=a39_0x1b976b,_0x53affd=importServiceManifest(_0x2573a1[_0x33e6c0(0x206)]('file'));if(_0x53affd[_0x33e6c0(0x1f4)][_0x33e6c0(0x1e9)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x53affd[_0x33e6c0(0x205)],'imported':_0x53affd[_0x33e6c0(0x228)],'updated':_0x53affd['updated'],'serviceCount':_0x53affd[_0x33e6c0(0x204)],'services':_0x53affd['entries']['map'](summarizeService)},'message':_0x33e6c0(0x211)+_0x53affd['imported']+_0x33e6c0(0x1fa)+_0x53affd[_0x33e6c0(0x221)]+_0x33e6c0(0x218)};return{'ok':!![],'data':{'registryPath':_0x53affd['registryPath'],'replaced':_0x53affd[_0x33e6c0(0x22f)],'imported':_0x53affd[_0x33e6c0(0x228)],'updated':_0x53affd[_0x33e6c0(0x221)],'serviceCount':_0x53affd[_0x33e6c0(0x204)],'service':summarizeService(_0x53affd[_0x33e6c0(0x1fe)])},'message':(_0x53affd[_0x33e6c0(0x22f)]?_0x33e6c0(0x1ea):'Imported')+_0x33e6c0(0x217)+_0x53affd[_0x33e6c0(0x1fe)][_0x33e6c0(0x1f1)]+'.'};}},{'service':'service','command':a39_0x1b976b(0x208),'description':a39_0x1b976b(0x22c),'risk':a39_0x1b976b(0x21f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x4539a4){const _0x425465=a39_0x1b976b,_0x10595=getLocalServiceEntry(_0x4539a4[_0x425465(0x206)]('service'));return{'method':'WRITE','url':_0x4539a4['str']('file'),'body':{'service':_0x4539a4[_0x425465(0x206)](_0x425465(0x1e7)),'found':Boolean(_0x10595),'version':_0x10595?.[_0x425465(0x21a)],'source':_0x10595?.['source']},'description':_0x425465(0x210)};},async 'execute'(_0x12e47f){const _0x59693b=a39_0x1b976b,_0x30d389=exportServiceManifest(_0x12e47f[_0x59693b(0x206)](_0x59693b(0x1e7)),_0x12e47f[_0x59693b(0x206)]('file'));return{'ok':!![],'data':{'registryPath':_0x30d389[_0x59693b(0x205)],'file':_0x30d389[_0x59693b(0x226)],'service':summarizeService(_0x30d389[_0x59693b(0x1fe)])},'message':_0x59693b(0x230)+_0x30d389[_0x59693b(0x1fe)][_0x59693b(0x1f1)]+'.'};}},{'service':a39_0x1b976b(0x1e7),'command':'list','description':a39_0x1b976b(0x20c),'risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x558092=a39_0x1b976b,_0x37d371=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x37d371['length'],'services':_0x37d371[_0x558092(0x214)](summarizeService)}};}},{'service':'service','command':a39_0x1b976b(0x22b),'description':a39_0x1b976b(0x20a),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x7878d6){const _0x2a98cc=a39_0x1b976b,_0x2acc8d=getLocalServiceEntry(_0x7878d6[_0x2a98cc(0x206)]('service'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x7878d6[_0x2a98cc(0x206)]('service'),'found':Boolean(_0x2acc8d),'version':_0x2acc8d?.['version'],'source':_0x2acc8d?.[_0x2a98cc(0x231)]},'description':_0x2a98cc(0x222)};},async 'execute'(_0x3d0c24){const _0x46fa20=a39_0x1b976b,_0x7b7bd0=removeServiceManifest(_0x3d0c24[_0x46fa20(0x206)](_0x46fa20(0x1e7)));return{'ok':!![],'data':{'registryPath':_0x7b7bd0[_0x46fa20(0x205)],'serviceCount':_0x7b7bd0[_0x46fa20(0x204)],'service':summarizeService(_0x7b7bd0[_0x46fa20(0x1fe)])},'message':_0x46fa20(0x229)+_0x7b7bd0[_0x46fa20(0x1fe)][_0x46fa20(0x1f1)]+'.'};}},{'service':'service','command':a39_0x1b976b(0x20d),'description':a39_0x1b976b(0x1ed),'risk':a39_0x1b976b(0x200),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x18e1aa){const _0x14a04d=a39_0x1b976b,_0xdf4de3=getLocalServiceEntry(_0x18e1aa[_0x14a04d(0x206)](_0x14a04d(0x1e7)));if(!_0xdf4de3)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x18e1aa[_0x14a04d(0x206)](_0x14a04d(0x1e7))},'message':'Local\x20service\x20not\x20found:\x20'+_0x18e1aa['str'](_0x14a04d(0x1e7))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0xdf4de3),'manifest':_0xdf4de3[_0x14a04d(0x213)],'normalizedManifest':_0xdf4de3[_0x14a04d(0x220)]}};}}];
|
|
1
|
+
const a39_0x45ec33=a39_0x1d01;(function(_0x4c0007,_0x352cac){const _0x3051a0=a39_0x1d01,_0x278ef3=_0x4c0007();while(!![]){try{const _0x420457=parseInt(_0x3051a0(0xf5))/0x1*(parseInt(_0x3051a0(0xd2))/0x2)+parseInt(_0x3051a0(0xd6))/0x3*(-parseInt(_0x3051a0(0xdb))/0x4)+-parseInt(_0x3051a0(0xca))/0x5+parseInt(_0x3051a0(0xd9))/0x6*(parseInt(_0x3051a0(0xc8))/0x7)+parseInt(_0x3051a0(0x101))/0x8+parseInt(_0x3051a0(0x103))/0x9+-parseInt(_0x3051a0(0x104))/0xa*(parseInt(_0x3051a0(0xf0))/0xb);if(_0x420457===_0x352cac)break;else _0x278ef3['push'](_0x278ef3['shift']());}catch(_0x2eaf3b){_0x278ef3['push'](_0x278ef3['shift']());}}}(a39_0x5eb3,0x3bab5));function a39_0x5eb3(){const _0x4de795=['registryPath','59517OPpmSB','entry','risk','30jXCtZy','serviceCount','80EgrBUW','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','cliPath','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','registry','read','hash','Local\x20service\x20code,\x20for\x20example\x20crm','write','export','filePath','registryIndex','manifests','description','Removed\x20service\x20','Service\x20manifest\x20validation\x20passed.','reduce','import','kind','Imported\x20','Import\x20a\x20Service\x20Tree\x20manifest\x20into\x20the\x20local\x20runtime\x20registry','11ybLIwK','normalizedManifest','map','Service\x20registry\x20validation\x20passed.','source','1tSZxxW','\x20service(s).','string','replaced','entries','str','report','commands','serviceCode','imported','list','Service\x20Tree\x20manifest\x20file\x20path','2829672RUwqTc','file','835398eoyAWS','1047070BbztpB','WRITE','importedAt','name','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','type','version','Imported','errors','required','validate','flags','\x20service\x20','updated','135121vWUvTC','service','814555fcpbgu','Updated','warnings','Export\x20a\x20local\x20Service\x20Tree\x20manifest\x20to\x20a\x20JSON\x20file','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','length','target','731514gynIfx','detail','Exported\x20service\x20'];a39_0x5eb3=function(){return _0x4de795;};return a39_0x5eb3();}import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';const FILE_FLAG={'name':a39_0x45ec33(0x102),'type':a39_0x45ec33(0xf7),'required':!![],'description':a39_0x45ec33(0x100)},SERVICE_FLAG={'name':a39_0x45ec33(0xc9),'type':'string','required':!![],'description':a39_0x45ec33(0xe2),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function a39_0x1d01(_0x92e3ee,_0x2390c5){_0x92e3ee=_0x92e3ee-0xbf;const _0x5eb343=a39_0x5eb3();let _0x1d019c=_0x5eb343[_0x92e3ee];return _0x1d019c;}function summarizeService(_0x3b6204){const _0x5c62b2=a39_0x45ec33;return{'serviceCode':_0x3b6204[_0x5c62b2(0xfd)],'name':_0x3b6204[_0x5c62b2(0xf1)]['service'][_0x5c62b2(0x107)],'version':_0x3b6204[_0x5c62b2(0xc0)],'importedAt':_0x3b6204[_0x5c62b2(0x106)],'source':_0x3b6204['source'],'commandCount':_0x3b6204['normalizedManifest'][_0x5c62b2(0xfc)]['length'],'commands':_0x3b6204[_0x5c62b2(0xf1)][_0x5c62b2(0xfc)][_0x5c62b2(0xf2)](_0x2c35a3=>({'path':_0x2c35a3[_0x5c62b2(0xdd)],'description':_0x2c35a3[_0x5c62b2(0xe8)],'risk':_0x2c35a3[_0x5c62b2(0xd8)],'target':_0x2c35a3['target'],'flags':_0x2c35a3[_0x5c62b2(0xc5)][_0x5c62b2(0xf2)](_0x3022ba=>({'name':_0x3022ba['name'],'cliName':_0x3022ba['cliName'],'type':_0x3022ba[_0x5c62b2(0xbf)],'required':_0x3022ba[_0x5c62b2(0xc3)]===!![]}))}))};}function summarizeLoadedManifest(_0x39f400){const _0x16637e=a39_0x45ec33;return{'service':_0x39f400[_0x16637e(0xf1)]?.[_0x16637e(0xc9)],'version':_0x39f400['normalizedManifest']?.['version'],'commandCount':_0x39f400['normalizedManifest']?.[_0x16637e(0xfc)][_0x16637e(0xd0)]??0x0,'commands':_0x39f400[_0x16637e(0xf1)]?.[_0x16637e(0xfc)][_0x16637e(0xf2)](_0x1ce41b=>({'path':_0x1ce41b['cliPath'],'risk':_0x1ce41b[_0x16637e(0xd8)],'target':_0x1ce41b[_0x16637e(0xd1)]}))??[],'registryIndex':_0x39f400[_0x16637e(0xe6)],'registryServiceCode':_0x39f400['registryServiceCode'],'errors':_0x39f400[_0x16637e(0xfb)]['errors'],'warnings':_0x39f400['report']['warnings']};}export const serviceDefinitions=[{'service':a39_0x45ec33(0xc9),'command':a39_0x45ec33(0xc4),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4bf309){const _0x5d99c7=a39_0x45ec33,_0x1fe5b1=loadServiceManifestFromFile(_0x4bf309[_0x5d99c7(0xfa)](_0x5d99c7(0x102)));if(!_0x1fe5b1['report']['ok'])return{'ok':![],'data':{'file':_0x1fe5b1[_0x5d99c7(0xe5)],'hash':_0x1fe5b1[_0x5d99c7(0xe1)],'kind':_0x1fe5b1[_0x5d99c7(0xed)],'serviceCount':_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xd0)],'services':_0x1fe5b1['manifests']['map'](summarizeLoadedManifest),'errors':_0x1fe5b1['report'][_0x5d99c7(0xc2)],'warnings':_0x1fe5b1['report']['warnings']},'message':formatValidationFailure(_0x1fe5b1[_0x5d99c7(0xfb)])};if(_0x1fe5b1[_0x5d99c7(0xed)]===_0x5d99c7(0xdf)||_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xd0)]!==0x1)return{'ok':!![],'data':{'file':_0x1fe5b1[_0x5d99c7(0xe5)],'hash':_0x1fe5b1[_0x5d99c7(0xe1)],'kind':_0x1fe5b1['kind'],'serviceCount':_0x1fe5b1['manifests'][_0x5d99c7(0xd0)],'commandCount':_0x1fe5b1[_0x5d99c7(0xe7)][_0x5d99c7(0xeb)]((_0x2a4a94,_0x4fa666)=>_0x2a4a94+(_0x4fa666[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)]['length']??0x0),0x0),'services':_0x1fe5b1['manifests'][_0x5d99c7(0xf2)](summarizeLoadedManifest),'warnings':_0x1fe5b1[_0x5d99c7(0xfb)][_0x5d99c7(0xcc)]},'message':_0x5d99c7(0xf3)};return{'ok':!![],'data':{'file':_0x1fe5b1['filePath'],'hash':_0x1fe5b1['hash'],'kind':_0x1fe5b1[_0x5d99c7(0xed)],'service':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xc9)],'version':_0x1fe5b1['normalizedManifest']?.[_0x5d99c7(0xc0)],'commandCount':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)][_0x5d99c7(0xd0)]??0x0,'commands':_0x1fe5b1[_0x5d99c7(0xf1)]?.[_0x5d99c7(0xfc)]['map'](_0x1da149=>({'path':_0x1da149[_0x5d99c7(0xdd)],'risk':_0x1da149['risk'],'target':_0x1da149[_0x5d99c7(0xd1)]})),'warnings':_0x1fe5b1[_0x5d99c7(0xfb)][_0x5d99c7(0xcc)]},'message':_0x5d99c7(0xea)};}},{'service':'service','command':a39_0x45ec33(0xec),'description':a39_0x45ec33(0xef),'risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x23f3bc){const _0x15e5d6=a39_0x45ec33,_0x1bd4a0=loadServiceManifestFromFile(_0x23f3bc[_0x15e5d6(0xfa)]('file'));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'file':_0x1bd4a0[_0x15e5d6(0xe5)],'hash':_0x1bd4a0[_0x15e5d6(0xe1)],'kind':_0x1bd4a0[_0x15e5d6(0xed)],'ok':_0x1bd4a0[_0x15e5d6(0xfb)]['ok'],'service':_0x1bd4a0[_0x15e5d6(0xf1)]?.['service'],'version':_0x1bd4a0[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xc0)],'serviceCount':_0x1bd4a0[_0x15e5d6(0xe7)][_0x15e5d6(0xd0)],'services':_0x1bd4a0[_0x15e5d6(0xe7)][_0x15e5d6(0xf2)](_0x388820=>({'service':_0x388820[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xc9)],'version':_0x388820[_0x15e5d6(0xf1)]?.['version'],'commandCount':_0x388820[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xfc)][_0x15e5d6(0xd0)]??0x0,'errors':_0x388820[_0x15e5d6(0xfb)]['errors']})),'errors':_0x1bd4a0[_0x15e5d6(0xfb)][_0x15e5d6(0xc2)],'commandCount':_0x1bd4a0[_0x15e5d6(0xf1)]?.[_0x15e5d6(0xfc)]['length']??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x535ac8){const _0x1c6569=a39_0x45ec33,_0x25e9ff=importServiceManifest(_0x535ac8['str']('file'));if(_0x25e9ff[_0x1c6569(0xf9)]['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x25e9ff[_0x1c6569(0xd5)],'imported':_0x25e9ff[_0x1c6569(0xfe)],'updated':_0x25e9ff[_0x1c6569(0xc7)],'serviceCount':_0x25e9ff[_0x1c6569(0xda)],'services':_0x25e9ff[_0x1c6569(0xf9)][_0x1c6569(0xf2)](summarizeService)},'message':_0x1c6569(0xee)+_0x25e9ff[_0x1c6569(0xfe)]+'\x20service(s),\x20updated\x20'+_0x25e9ff[_0x1c6569(0xc7)]+_0x1c6569(0xf6)};return{'ok':!![],'data':{'registryPath':_0x25e9ff[_0x1c6569(0xd5)],'replaced':_0x25e9ff[_0x1c6569(0xf8)],'imported':_0x25e9ff[_0x1c6569(0xfe)],'updated':_0x25e9ff[_0x1c6569(0xc7)],'serviceCount':_0x25e9ff[_0x1c6569(0xda)],'service':summarizeService(_0x25e9ff[_0x1c6569(0xd7)])},'message':(_0x25e9ff['replaced']?_0x1c6569(0xcb):_0x1c6569(0xc1))+_0x1c6569(0xc6)+_0x25e9ff[_0x1c6569(0xd7)]['serviceCode']+'.'};}},{'service':a39_0x45ec33(0xc9),'command':a39_0x45ec33(0xe4),'description':a39_0x45ec33(0xcd),'risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x1ec801){const _0x58d116=a39_0x45ec33,_0x4ecdf8=getLocalServiceEntry(_0x1ec801['str'](_0x58d116(0xc9)));return{'method':_0x58d116(0x105),'url':_0x1ec801[_0x58d116(0xfa)]('file'),'body':{'service':_0x1ec801['str']('service'),'found':Boolean(_0x4ecdf8),'version':_0x4ecdf8?.[_0x58d116(0xc0)],'source':_0x4ecdf8?.[_0x58d116(0xf4)]},'description':_0x58d116(0x108)};},async 'execute'(_0xa2f08c){const _0x43b82e=a39_0x45ec33,_0x2de2fb=exportServiceManifest(_0xa2f08c[_0x43b82e(0xfa)](_0x43b82e(0xc9)),_0xa2f08c[_0x43b82e(0xfa)](_0x43b82e(0x102)));return{'ok':!![],'data':{'registryPath':_0x2de2fb[_0x43b82e(0xd5)],'file':_0x2de2fb[_0x43b82e(0xe5)],'service':summarizeService(_0x2de2fb[_0x43b82e(0xd7)])},'message':_0x43b82e(0xd4)+_0x2de2fb[_0x43b82e(0xd7)][_0x43b82e(0xfd)]+'.'};}},{'service':'service','command':a39_0x45ec33(0xff),'description':a39_0x45ec33(0xdc),'risk':a39_0x45ec33(0xe0),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5d28fa=a39_0x45ec33,_0x400099=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x400099[_0x5d28fa(0xd0)],'services':_0x400099[_0x5d28fa(0xf2)](summarizeService)}};}},{'service':'service','command':'remove','description':'Remove\x20a\x20local\x20Service\x20Tree\x20manifest\x20from\x20the\x20runtime\x20registry','risk':a39_0x45ec33(0xe3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1e9ef4){const _0x3023d3=a39_0x45ec33,_0x2abaa6=getLocalServiceEntry(_0x1e9ef4['str'](_0x3023d3(0xc9)));return{'method':_0x3023d3(0x105),'url':getServiceRegistryPath(),'body':{'service':_0x1e9ef4[_0x3023d3(0xfa)](_0x3023d3(0xc9)),'found':Boolean(_0x2abaa6),'version':_0x2abaa6?.[_0x3023d3(0xc0)],'source':_0x2abaa6?.[_0x3023d3(0xf4)]},'description':_0x3023d3(0xde)};},async 'execute'(_0x282d9a){const _0x4daf92=a39_0x45ec33,_0xcfe76f=removeServiceManifest(_0x282d9a[_0x4daf92(0xfa)](_0x4daf92(0xc9)));return{'ok':!![],'data':{'registryPath':_0xcfe76f[_0x4daf92(0xd5)],'serviceCount':_0xcfe76f[_0x4daf92(0xda)],'service':summarizeService(_0xcfe76f[_0x4daf92(0xd7)])},'message':_0x4daf92(0xe9)+_0xcfe76f[_0x4daf92(0xd7)][_0x4daf92(0xfd)]+'.'};}},{'service':'service','command':a39_0x45ec33(0xd3),'description':a39_0x45ec33(0xce),'risk':a39_0x45ec33(0xe0),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x13dcf7){const _0x4317e5=a39_0x45ec33,_0x3e8183=getLocalServiceEntry(_0x13dcf7['str'](_0x4317e5(0xc9)));if(!_0x3e8183)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x13dcf7[_0x4317e5(0xfa)](_0x4317e5(0xc9))},'message':_0x4317e5(0xcf)+_0x13dcf7[_0x4317e5(0xfa)](_0x4317e5(0xc9))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x3e8183),'manifest':_0x3e8183['manifest'],'normalizedManifest':_0x3e8183[_0x4317e5(0xf1)]}};}}];
|