@lovrabet/lovrabet-cli 2.1.13-beta.1 → 2.1.13
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/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1c6243=a30_0x1c62;(function(_0x5bba66,_0x4c1ec6){const _0xb223f2=a30_0x1c62,_0x19d064=_0x5bba66();while(!![]){try{const _0x54709e=-parseInt(_0xb223f2(0x101))/0x1*(parseInt(_0xb223f2(0x109))/0x2)+-parseInt(_0xb223f2(0x100))/0x3+-parseInt(_0xb223f2(0x108))/0x4*(parseInt(_0xb223f2(0xfa))/0x5)+parseInt(_0xb223f2(0x105))/0x6*(-parseInt(_0xb223f2(0xfc))/0x7)+parseInt(_0xb223f2(0x104))/0x8*(parseInt(_0xb223f2(0x10e))/0x9)+-parseInt(_0xb223f2(0x10b))/0xa*(-parseInt(_0xb223f2(0x10f))/0xb)+parseInt(_0xb223f2(0x102))/0xc;if(_0x54709e===_0x4c1ec6)break;else _0x19d064['push'](_0x19d064['shift']());}catch(_0x15d8b7){_0x19d064['push'](_0x19d064['shift']());}}}(a30_0x7d23,0xac4e0));function a30_0x1c62(_0x1cabac,_0x1b10cc){_0x1cabac=_0x1cabac-0xf6;const _0x7d23b7=a30_0x7d23();let _0x1c6297=_0x7d23b7[_0x1cabac];return _0x1c6297;}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_0x1c6243(0x112),'type':'string','required':!![],'description':a30_0x1c6243(0x116)},FILEPATH_FLAG={'name':'filepath','type':a30_0x1c6243(0x103),'required':!![],'description':a30_0x1c6243(0x110)},DOWNLOAD_FLAG={'name':a30_0x1c6243(0x117),'type':a30_0x1c6243(0x114),'description':a30_0x1c6243(0x11d)},LONG_TERM_FLAG={'name':a30_0x1c6243(0x106),'type':a30_0x1c6243(0x114),'description':a30_0x1c6243(0x119)};function a30_0x7d23(){const _0x512d85=['bool','486060QVyTdT','2266382LHPRNP','\x20to\x20runtime\x20app\x20','40BIpRzl','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Uploaded\x20file:\x20','406773LZpfOy','2761451nZOKwt','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','/client/uploadFile','file','File','boolean','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Path\x20to\x20the\x20local\x20file\x20to\x20upload','download','description','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','build','POST','path','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','filePath\x20is\x20required.','trim','validation','str','45VdxuHb','filePath','1337PiLAIB','appCode','write','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','2793636sKQOLX','1RsXukm','33000372bNTixi','string','200pzDbjI','32052kLYcdO','long-term'];a30_0x7d23=function(){return _0x512d85;};return a30_0x7d23();}function requireFilePath(_0x43b8cd){const _0x1722e8=a30_0x1c6243,_0xd7287c=_0x43b8cd[_0x1722e8(0xf7)]();if(!_0xd7287c)throw CliErrors[_0x1722e8(0xf8)](_0x1722e8(0xf6));return _0xd7287c;}const fileUpload={'service':a30_0x1c6243(0x112),'command':'upload','description':'Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','risk':a30_0x1c6243(0xfe),'flags':[FILE_FLAG],async 'dryRun'(_0x2444f0){const _0xa04d5f=a30_0x1c6243,_0x2d8307=requireRuntimeUploadFile(_0x2444f0['str'](_0xa04d5f(0x112)),_0xa04d5f(0x113));return dryRun(_0xa04d5f(0x11b),_0xa04d5f(0x111))['body']({'appCode':_0x2444f0['appCode'],'multipart':{'file':_0x2d8307}})[_0xa04d5f(0x118)]('Preview:\x20upload\x20'+_0x2d8307[_0xa04d5f(0x11c)]+_0xa04d5f(0x10a)+_0x2444f0[_0xa04d5f(0xfd)])[_0xa04d5f(0x11a)]();},async 'execute'(_0x34f7da){const _0x3c199b=a30_0x1c6243,_0xd1be1=requireRuntimeUploadFile(_0x34f7da[_0x3c199b(0xf9)](_0x3c199b(0x112)),_0x3c199b(0x113)),_0x3c5aeb=await uploadRuntimeFile(_0x34f7da['appCode'],_0xd1be1['path']);return{'ok':!![],'data':_0x3c5aeb,'message':_0x3c5aeb[_0x3c199b(0xfb)]?_0x3c199b(0x10d)+_0x3c5aeb['filePath']+_0x3c199b(0x115):_0x3c199b(0x10c)};}},fileQueryUrl={'service':a30_0x1c6243(0x112),'command':'query-url','description':a30_0x1c6243(0xff),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3e31de){const _0x4fa4b0=a30_0x1c6243,_0x2678cd=requireFilePath(_0x3e31de[_0x4fa4b0(0xf9)]('filepath')),_0x4b98f0=await queryRuntimeFileUrl(_0x2678cd,{'download':_0x3e31de['bool'](_0x4fa4b0(0x117)),'longTerm':_0x3e31de[_0x4fa4b0(0x107)]('long-term')});return{'ok':!![],'data':_0x4b98f0};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x65ba39=a31_0x1da6;(function(_0x4c4b0c,_0x1d05b7){const _0x10fad5=a31_0x1da6,_0x2dd170=_0x4c4b0c();while(!![]){try{const _0x34070f=-parseInt(_0x10fad5(0x1d4))/0x1*(-parseInt(_0x10fad5(0x1cd))/0x2)+-parseInt(_0x10fad5(0x1c1))/0x3*(parseInt(_0x10fad5(0x1e1))/0x4)+parseInt(_0x10fad5(0x1b9))/0x5+parseInt(_0x10fad5(0x1d2))/0x6*(parseInt(_0x10fad5(0x1db))/0x7)+-parseInt(_0x10fad5(0x1d7))/0x8+-parseInt(_0x10fad5(0x1bb))/0x9+-parseInt(_0x10fad5(0x1c5))/0xa*(-parseInt(_0x10fad5(0x1e0))/0xb);if(_0x34070f===_0x1d05b7)break;else _0x2dd170['push'](_0x2dd170['shift']());}catch(_0x3008a6){_0x2dd170['push'](_0x2dd170['shift']());}}}(a31_0x8044,0x9ca09));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_0x65ba39(0x1a4),'type':a31_0x65ba39(0x1b6),'description':'App\x20code\x20for\x20the\x20project'},{'name':'env','type':a31_0x65ba39(0x1b6),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x65ba39(0x1b1)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x65ba39(0x1ae),'type':'boolean','description':a31_0x65ba39(0x199)+PRODUCT_CONFIG[a31_0x65ba39(0x1a3)]+a31_0x65ba39(0x1c9),'default':![]},{'name':a31_0x65ba39(0x19c),'type':'boolean','description':a31_0x65ba39(0x1ac),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x65ba39(0x1ab),'type':a31_0x65ba39(0x1b6),'description':a31_0x65ba39(0x1ba),'required':!![]},{'name':a31_0x65ba39(0x1a4),'type':a31_0x65ba39(0x1b6),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x65ba39(0x1b1),'type':a31_0x65ba39(0x1b6),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x65ba39(0x1ca),'description':a31_0x65ba39(0x199)+PRODUCT_CONFIG[a31_0x65ba39(0x1a3)]+a31_0x65ba39(0x1c9),'default':![]},{'name':a31_0x65ba39(0x19c),'type':a31_0x65ba39(0x1ca),'description':a31_0x65ba39(0x1ac),'default':![]}];function a31_0x8044(){const _0x2e1d3c=['riskLevel','apiDir','App\x20code','string','entries','\x22.\x20Allowed:\x20','1064900sjMktM','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','2294406yvvtxC','trim','apps','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','race','project','2859kwfVdh','[y/N]','removeListener','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`.','7472390WtOnbT','close','log','\x20\x20env:\x20\x20\x20\x20\x20',')\x20instead\x20of\x20project','boolean','\x20already\x20exists.\x20Overwrite?','\x20\x20appcode:\x20','121822qNZcem','app','join','\x20\x20default:\x20','once','84oEcosJ','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','3JMHtim','message','utf8','5472288CBswiY','Initialized\x20','Aborted.','Failed\x20to\x20parse\x20source\x20file:\x20','475615yYThOH','question','\x20init\x20—\x20Create\x20','Invalid\x20env\x20\x22','cwd','11EZThne','2156MvvlPM','SIGINT','Write\x20to\x20global\x20(~/','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','AbortPrompt','yes','flagMissing','validation','Usage:\x20','toLowerCase','File\x20','stdin','newConfigFileName','appcode','Source\x20file\x20not\x20found:\x20','\x0aInitialized\x20','includes','User\x20aborted\x20prompt','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','parse','file','Skip\x20confirmation\x20when\x20overwriting','defaultApp','global','cancelled','name','env','stdout'];a31_0x8044=function(){return _0x2e1d3c;};return a31_0x8044();}export async function runInit(_0x24990e){const _0x4edb7b=a31_0x65ba39,_0x265a16=isNonInteractiveMode(_0x24990e),_0x26bcde=_0x24990e[_0x4edb7b(0x1ae)]?_0x4edb7b(0x1ae):_0x4edb7b(0x1c0),_0x478b79=resolveWriteConfigPath(_0x26bcde);try{_0x265a16?await runNonInteractive(_0x24990e,_0x478b79):await runInteractive(_0x24990e,_0x478b79);}catch(_0x535cd5){if(_0x535cd5 instanceof AbortPrompt)throw CliErrors[_0x4edb7b(0x1af)]();throw _0x535cd5;}}export async function runInitImport(_0x4070e7){const _0x38e793=a31_0x65ba39,_0x5d72bc=_0x4070e7[_0x38e793(0x1ae)]?_0x38e793(0x1ae):'project',_0x449510=resolveWriteConfigPath(_0x5d72bc);await runFromImport(_0x4070e7,_0x449510);}function a31_0x1da6(_0x27e244,_0x374b1a){_0x27e244=_0x27e244-0x199;const _0x804404=a31_0x8044();let _0x1da64d=_0x804404[_0x27e244];return _0x1da64d;}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x65ba39(0x1b4)]);async function runFromImport(_0x1cb819,_0x37c063){const _0x39a0a3=a31_0x65ba39,_0x41bfad=resolveFilePath(_0x1cb819['file']);if(!existsSync(_0x41bfad))throw CliErrors['validation'](_0x39a0a3(0x1a5)+_0x41bfad);const _0x569111=readSourceFile(_0x41bfad),_0x8bf35d=convertToRuntimeConfig(_0x569111);_0x1cb819[_0x39a0a3(0x1a4)]&&(_0x8bf35d[_0x39a0a3(0x1a4)]=String(_0x1cb819['appcode']));_0x1cb819[_0x39a0a3(0x1b1)]&&(_0x8bf35d[_0x39a0a3(0x1b1)]=resolveInitEnv(_0x1cb819));if(!_0x8bf35d[_0x39a0a3(0x1a4)])throw CliErrors['validation'](_0x39a0a3(0x1a9),_0x39a0a3(0x1c4));await writeInitConfig(_0x37c063,_0x8bf35d,_0x1cb819),console[_0x39a0a3(0x1c7)]('Imported\x20from\x20'+_0x41bfad),console[_0x39a0a3(0x1c7)]('\x20\x20config:\x20\x20'+_0x37c063),console[_0x39a0a3(0x1c7)](_0x39a0a3(0x1cc)+_0x8bf35d[_0x39a0a3(0x1a4)]);if(_0x8bf35d[_0x39a0a3(0x1ad)])console[_0x39a0a3(0x1c7)](_0x39a0a3(0x1d0)+_0x8bf35d['defaultApp']);}function convertToRuntimeConfig(_0x53a923){const _0x3f2f4e=a31_0x65ba39;if(_0x53a923[_0x3f2f4e(0x1bd)]&&typeof _0x53a923[_0x3f2f4e(0x1bd)]==='object')throw CliErrors[_0x3f2f4e(0x19e)](_0x3f2f4e(0x1be),_0x3f2f4e(0x1d3));const _0x508a3f={};for(const _0x24c6bb of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x53a923[_0x24c6bb]!==undefined&&(_0x508a3f[_0x24c6bb]=_0x53a923[_0x24c6bb]);}return!_0x508a3f['riskLevel']&&(_0x508a3f[_0x3f2f4e(0x1b3)]=DEFAULT_CONFIG_VALUES[_0x3f2f4e(0x1b3)]),_0x508a3f;}async function runNonInteractive(_0x4269e9,_0x2ad9e2){const _0x3bdd16=a31_0x65ba39,_0x2827bc=_0x4269e9[_0x3bdd16(0x1a4)];if(!_0x2827bc)throw CliErrors[_0x3bdd16(0x19d)]('appcode',_0x3bdd16(0x19f)+CLI_BIN_NAME+_0x3bdd16(0x19a));const _0x30e9e5=resolveInitEnv(_0x4269e9);await writeInitConfig(_0x2ad9e2,{'appcode':_0x2827bc,'env':_0x30e9e5},_0x4269e9),console['log'](_0x3bdd16(0x1d8)+_0x2ad9e2),console[_0x3bdd16(0x1c7)](_0x3bdd16(0x1cc)+_0x2827bc),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x30e9e5);}async function runInteractive(_0x1ead72,_0x27e85c){const _0x146aa9=a31_0x65ba39,_0x390c11=loadExisting(_0x27e85c),_0xaa02c7=typeof _0x390c11?.['appcode']===_0x146aa9(0x1b6)?_0x390c11[_0x146aa9(0x1a4)]:'',_0x2dfd69=resolveInitEnv(_0x1ead72);console[_0x146aa9(0x1c7)](CLI_BIN_NAME+_0x146aa9(0x1dd)+PRODUCT_CONFIG[_0x146aa9(0x1a3)]+'\x0a');if(existsSync(_0x27e85c)&&!_0x1ead72['yes']){const _0x4810b4=await promptYesNo(_0x146aa9(0x1a1)+_0x27e85c+_0x146aa9(0x1cb),![]);if(!_0x4810b4){console[_0x146aa9(0x1c7)](_0x146aa9(0x1d9));return;}}const _0x5b4cb8=typeof _0x1ead72[_0x146aa9(0x1a4)]===_0x146aa9(0x1b6)?_0x1ead72[_0x146aa9(0x1a4)][_0x146aa9(0x1bc)]():'';let _0x381457=_0x5b4cb8;!_0x381457&&(_0x381457=await promptInput(_0x146aa9(0x1b5),_0xaa02c7));if(!_0x381457['trim']())throw CliErrors['validation']('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x27e85c,{'appcode':_0x381457[_0x146aa9(0x1bc)](),'env':_0x2dfd69},_0x1ead72),console['log'](_0x146aa9(0x1a6)+_0x27e85c),console[_0x146aa9(0x1c7)]('\x20\x20appcode:\x20'+_0x381457[_0x146aa9(0x1bc)]()),console['log'](_0x146aa9(0x1c8)+_0x2dfd69);}async function writeInitConfig(_0x5b8a4a,_0xa459c6,_0xce4c13){const _0x549ad3=a31_0x65ba39;let _0x474059={};existsSync(_0x5b8a4a)&&!_0xce4c13[_0x549ad3(0x19c)]&&(_0x474059=readConfigFile(_0x5b8a4a));for(const [_0x393965,_0x2090b7]of Object[_0x549ad3(0x1b7)](_0xa459c6)){_0x2090b7!==undefined&&(_0x474059[_0x393965]=_0x2090b7);}if(_0x474059[_0x549ad3(0x1ce)])delete _0x474059[_0x549ad3(0x1ce)];writeConfigFile(_0x5b8a4a,_0x474059);}class AbortPrompt extends Error{constructor(){const _0x34631c=a31_0x65ba39;super(_0x34631c(0x1a8)),this[_0x34631c(0x1b0)]=_0x34631c(0x19b);}}function createSafeRl(){const _0x4caa49=a31_0x65ba39,_0x1370e9=createInterface({'input':process[_0x4caa49(0x1a2)],'output':process[_0x4caa49(0x1b2)]});let _0x291754;const _0x5d9eb5=new Promise((_0x50168c,_0x23d274)=>{const _0x2656a2=_0x4caa49;_0x291754=()=>{const _0x155ae6=a31_0x1da6;_0x291754&&(_0x1370e9[_0x155ae6(0x1c3)](_0x155ae6(0x1e2),_0x291754),_0x291754=undefined);try{_0x1370e9[_0x155ae6(0x1c6)]();}catch{}_0x23d274(new AbortPrompt());},_0x1370e9[_0x2656a2(0x1d1)](_0x2656a2(0x1e2),_0x291754);}),_0x121bc6=()=>{const _0x3799a6=_0x4caa49;_0x291754&&(_0x1370e9['removeListener'](_0x3799a6(0x1e2),_0x291754),_0x291754=undefined);try{_0x1370e9[_0x3799a6(0x1c6)]();}catch{}};return{'rl':_0x1370e9,'abortPromise':_0x5d9eb5,'disposeSuccess':_0x121bc6};}async function promptInput(_0x5c9175,_0x27e919){const _0x4f6afc=a31_0x65ba39,{rl:_0x1aed05,abortPromise:_0x54a62a,disposeSuccess:_0x4e505b}=createSafeRl(),_0x3cd9ae=new Promise(_0x24a8bb=>{const _0x270bc1=a31_0x1da6,_0x336adb=_0x27e919?'\x20\x20'+_0x5c9175+'\x20('+_0x27e919+'):\x20':'\x20\x20'+_0x5c9175+':\x20';_0x1aed05[_0x270bc1(0x1dc)](_0x336adb,_0x167298=>{const _0x195839=_0x270bc1;_0x4e505b(),_0x24a8bb(_0x167298[_0x195839(0x1bc)]()||_0x27e919);});});return Promise[_0x4f6afc(0x1bf)]([_0x3cd9ae,_0x54a62a]);}async function promptYesNo(_0x2c2a03,_0x98260e){const {rl:_0x1286d5,abortPromise:_0xb46c12,disposeSuccess:_0x362cac}=createSafeRl(),_0x24668a=new Promise(_0x374362=>{const _0x416395=a31_0x1da6,_0x4657c0=_0x98260e?'[Y/n]':_0x416395(0x1c2);_0x1286d5[_0x416395(0x1dc)]('\x20\x20'+_0x2c2a03+'\x20'+_0x4657c0+':\x20',_0x40672c=>{const _0x5a146c=_0x416395;_0x362cac();const _0x4a93be=_0x40672c[_0x5a146c(0x1bc)]()[_0x5a146c(0x1a0)]();if(_0x4a93be==='y'||_0x4a93be===_0x5a146c(0x19c))_0x374362(!![]);else{if(_0x4a93be==='n'||_0x4a93be==='no')_0x374362(![]);else _0x374362(_0x98260e);}});});return Promise['race']([_0x24668a,_0xb46c12]);}function loadExisting(_0x1ea489){if(!existsSync(_0x1ea489))return null;return readConfigFile(_0x1ea489);}function resolveFilePath(_0x29b818){const _0x44a30c=a31_0x65ba39;return isAbsolute(_0x29b818)?_0x29b818:resolve(process[_0x44a30c(0x1df)](),_0x29b818);}function readSourceFile(_0x4f5473){const _0x1da77f=a31_0x65ba39;try{const _0xa3b267=readFileSync(_0x4f5473,{'encoding':_0x1da77f(0x1d6)});return JSON[_0x1da77f(0x1aa)](_0xa3b267);}catch(_0x5cd50d){throw CliErrors['validation'](_0x1da77f(0x1da)+_0x5cd50d[_0x1da77f(0x1d5)]);}}function resolveInitEnv(_0x2fceb3){const _0xbddbc8=a31_0x65ba39,_0x1c8f1c=_0x2fceb3[_0xbddbc8(0x1b1)];if(_0x1c8f1c===undefined||_0x1c8f1c==='')return DEFAULT_CONFIG_VALUES[_0xbddbc8(0x1b1)];if(!RUNTIME_ENV_VALUES[_0xbddbc8(0x1a7)](_0x1c8f1c))throw CliErrors[_0xbddbc8(0x19e)](_0xbddbc8(0x1de)+_0x1c8f1c+_0xbddbc8(0x1b8)+RUNTIME_ENV_VALUES[_0xbddbc8(0x1cf)](',\x20'));return _0x1c8f1c;}
|
|
1
|
+
const a31_0x5afdf6=a31_0x47cc;(function(_0x4e9c8e,_0x2c61d8){const _0x2927a0=a31_0x47cc,_0x404064=_0x4e9c8e();while(!![]){try{const _0x1ef9bc=-parseInt(_0x2927a0(0x15b))/0x1+parseInt(_0x2927a0(0x152))/0x2*(parseInt(_0x2927a0(0x15a))/0x3)+-parseInt(_0x2927a0(0x134))/0x4+-parseInt(_0x2927a0(0x120))/0x5+parseInt(_0x2927a0(0x14c))/0x6*(-parseInt(_0x2927a0(0x131))/0x7)+parseInt(_0x2927a0(0x146))/0x8*(-parseInt(_0x2927a0(0x144))/0x9)+-parseInt(_0x2927a0(0x14d))/0xa*(-parseInt(_0x2927a0(0x142))/0xb);if(_0x1ef9bc===_0x2c61d8)break;else _0x404064['push'](_0x404064['shift']());}catch(_0x4a560e){_0x404064['push'](_0x404064['shift']());}}}(a31_0x2737,0xda320));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_0x2737(){const _0x115955=['Initialized\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20\x20default:\x20','join','[Y/n]','6UhAoxw','10WEGTFd','File\x20','\x20already\x20exists.\x20Overwrite?','\x20\x20appcode:\x20','utf8','2VOcogV','global','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','SIGINT','removeListener','App\x20code\x20cannot\x20be\x20empty.','question','App\x20code','4359669nFmjCf','1139856uhjLKp','\x20\x20config:\x20\x20','message','string','stdout','User\x20aborted\x20prompt','entries','riskLevel','validation','once','\x22.\x20Allowed:\x20','boolean','defaultApp','Override\x20imported\x20default\x20env','6660945eFZjJN','):\x20','trim','parse','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x0aInitialized\x20','appcode','cancelled','flagMissing','Invalid\x20env\x20\x22','Override\x20imported\x20default\x20appcode','newConfigFileName',')\x20instead\x20of\x20project','apps','env','[y/N]','Imported\x20from\x20','11044138fnMEGC','close','cwd','3208812nveyhA','log','includes','Target\x20environment\x20(default\x20','toLowerCase','Write\x20to\x20global\x20(~/','Usage:\x20','Aborted.','\x20\x20env:\x20\x20\x20\x20\x20','Failed\x20to\x20parse\x20source\x20file:\x20','AbortPrompt','\x20init\x20—\x20Create\x20','yes','Source\x20file\x20not\x20found:\x20','47965951zVGUIh','file','18OLAlMM','project','272216mABCnA'];a31_0x2737=function(){return _0x115955;};return a31_0x2737();}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_0x5afdf6(0x126),'type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x5afdf6(0x12e),'type':'string','description':a31_0x5afdf6(0x137)+DEFAULT_CONFIG_VALUES[a31_0x5afdf6(0x12e)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5afdf6(0x153),'type':a31_0x5afdf6(0x166),'description':a31_0x5afdf6(0x139)+PRODUCT_CONFIG[a31_0x5afdf6(0x12b)]+a31_0x5afdf6(0x12c),'default':![]},{'name':a31_0x5afdf6(0x140),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x5afdf6(0x15e),'description':a31_0x5afdf6(0x124),'required':!![]},{'name':a31_0x5afdf6(0x126),'type':a31_0x5afdf6(0x15e),'description':a31_0x5afdf6(0x12a)},{'name':a31_0x5afdf6(0x12e),'type':a31_0x5afdf6(0x15e),'description':a31_0x5afdf6(0x11f),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5afdf6(0x153),'type':'boolean','description':a31_0x5afdf6(0x139)+PRODUCT_CONFIG['newConfigFileName']+a31_0x5afdf6(0x12c),'default':![]},{'name':a31_0x5afdf6(0x140),'type':a31_0x5afdf6(0x166),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x2acc2c){const _0x4eaf86=a31_0x5afdf6,_0x2c4915=isNonInteractiveMode(_0x2acc2c),_0x4cb427=_0x2acc2c[_0x4eaf86(0x153)]?'global':_0x4eaf86(0x145),_0x213cb0=resolveWriteConfigPath(_0x4cb427);try{_0x2c4915?await runNonInteractive(_0x2acc2c,_0x213cb0):await runInteractive(_0x2acc2c,_0x213cb0);}catch(_0x53228d){if(_0x53228d instanceof AbortPrompt)throw CliErrors[_0x4eaf86(0x127)]();throw _0x53228d;}}export async function runInitImport(_0x5ebf38){const _0x510e37=a31_0x5afdf6,_0x2c89a1=_0x5ebf38[_0x510e37(0x153)]?_0x510e37(0x153):_0x510e37(0x145),_0x5f40a6=resolveWriteConfigPath(_0x2c89a1);await runFromImport(_0x5ebf38,_0x5f40a6);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);function a31_0x47cc(_0x2bf199,_0x3d917e){_0x2bf199=_0x2bf199-0x11e;const _0x27378a=a31_0x2737();let _0x47ccea=_0x27378a[_0x2bf199];return _0x47ccea;}async function runFromImport(_0x41c89d,_0x47d3bf){const _0x37e5ae=a31_0x5afdf6,_0x2d7a82=resolveFilePath(_0x41c89d[_0x37e5ae(0x143)]);if(!existsSync(_0x2d7a82))throw CliErrors[_0x37e5ae(0x163)](_0x37e5ae(0x141)+_0x2d7a82);const _0xd49c84=readSourceFile(_0x2d7a82),_0x2dd603=convertToRuntimeConfig(_0xd49c84);_0x41c89d['appcode']&&(_0x2dd603[_0x37e5ae(0x126)]=String(_0x41c89d[_0x37e5ae(0x126)]));_0x41c89d[_0x37e5ae(0x12e)]&&(_0x2dd603[_0x37e5ae(0x12e)]=resolveInitEnv(_0x41c89d));if(!_0x2dd603[_0x37e5ae(0x126)])throw CliErrors[_0x37e5ae(0x163)](_0x37e5ae(0x154),'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(_0x47d3bf,_0x2dd603,_0x41c89d),console['log'](_0x37e5ae(0x130)+_0x2d7a82),console[_0x37e5ae(0x135)](_0x37e5ae(0x15c)+_0x47d3bf),console['log'](_0x37e5ae(0x150)+_0x2dd603[_0x37e5ae(0x126)]);if(_0x2dd603[_0x37e5ae(0x11e)])console[_0x37e5ae(0x135)](_0x37e5ae(0x149)+_0x2dd603[_0x37e5ae(0x11e)]);}function convertToRuntimeConfig(_0x475164){const _0x2b9d73=a31_0x5afdf6;if(_0x475164[_0x2b9d73(0x12d)]&&typeof _0x475164[_0x2b9d73(0x12d)]==='object')throw CliErrors[_0x2b9d73(0x163)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x2b9d73(0x148));const _0x516b42={};for(const _0x4c6774 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x475164[_0x4c6774]!==undefined&&(_0x516b42[_0x4c6774]=_0x475164[_0x4c6774]);}return!_0x516b42['riskLevel']&&(_0x516b42['riskLevel']=DEFAULT_CONFIG_VALUES[_0x2b9d73(0x162)]),_0x516b42;}async function runNonInteractive(_0x7f83ba,_0x358ab4){const _0x3df00d=a31_0x5afdf6,_0x561b47=_0x7f83ba[_0x3df00d(0x126)];if(!_0x561b47)throw CliErrors[_0x3df00d(0x128)]('appcode',_0x3df00d(0x13a)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x2f8d0a=resolveInitEnv(_0x7f83ba);await writeInitConfig(_0x358ab4,{'appcode':_0x561b47,'env':_0x2f8d0a},_0x7f83ba),console[_0x3df00d(0x135)](_0x3df00d(0x147)+_0x358ab4),console[_0x3df00d(0x135)](_0x3df00d(0x150)+_0x561b47),console[_0x3df00d(0x135)](_0x3df00d(0x13c)+_0x2f8d0a);}async function runInteractive(_0x5331cf,_0x20267d){const _0x5d083b=a31_0x5afdf6,_0xd6634c=loadExisting(_0x20267d),_0xdb332d=typeof _0xd6634c?.['appcode']==='string'?_0xd6634c[_0x5d083b(0x126)]:'',_0x5e282d=resolveInitEnv(_0x5331cf);console[_0x5d083b(0x135)](CLI_BIN_NAME+_0x5d083b(0x13f)+PRODUCT_CONFIG[_0x5d083b(0x12b)]+'\x0a');if(existsSync(_0x20267d)&&!_0x5331cf[_0x5d083b(0x140)]){const _0x5b4ae7=await promptYesNo(_0x5d083b(0x14e)+_0x20267d+_0x5d083b(0x14f),![]);if(!_0x5b4ae7){console[_0x5d083b(0x135)](_0x5d083b(0x13b));return;}}const _0x327f99=typeof _0x5331cf['appcode']===_0x5d083b(0x15e)?_0x5331cf[_0x5d083b(0x126)][_0x5d083b(0x122)]():'';let _0x34de8b=_0x327f99;!_0x34de8b&&(_0x34de8b=await promptInput(_0x5d083b(0x159),_0xdb332d));if(!_0x34de8b['trim']())throw CliErrors[_0x5d083b(0x163)](_0x5d083b(0x157));await writeInitConfig(_0x20267d,{'appcode':_0x34de8b['trim'](),'env':_0x5e282d},_0x5331cf),console['log'](_0x5d083b(0x125)+_0x20267d),console[_0x5d083b(0x135)](_0x5d083b(0x150)+_0x34de8b[_0x5d083b(0x122)]()),console[_0x5d083b(0x135)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x5e282d);}async function writeInitConfig(_0x14b528,_0x22b8b1,_0x14edda){const _0x2e5954=a31_0x5afdf6;let _0x4f0986={};existsSync(_0x14b528)&&!_0x14edda[_0x2e5954(0x140)]&&(_0x4f0986=readConfigFile(_0x14b528));for(const [_0x977e77,_0x35e4a3]of Object[_0x2e5954(0x161)](_0x22b8b1)){_0x35e4a3!==undefined&&(_0x4f0986[_0x977e77]=_0x35e4a3);}if(_0x4f0986['app'])delete _0x4f0986['app'];writeConfigFile(_0x14b528,_0x4f0986);}class AbortPrompt extends Error{constructor(){const _0x38a3b0=a31_0x5afdf6;super(_0x38a3b0(0x160)),this['name']=_0x38a3b0(0x13e);}}function createSafeRl(){const _0x1b400e=a31_0x5afdf6,_0x3be809=createInterface({'input':process['stdin'],'output':process[_0x1b400e(0x15f)]});let _0x204019;const _0x5608a8=new Promise((_0x5ca876,_0x440c38)=>{const _0x132ac5=_0x1b400e;_0x204019=()=>{const _0x1abfb8=a31_0x47cc;_0x204019&&(_0x3be809[_0x1abfb8(0x156)](_0x1abfb8(0x155),_0x204019),_0x204019=undefined);try{_0x3be809[_0x1abfb8(0x132)]();}catch{}_0x440c38(new AbortPrompt());},_0x3be809[_0x132ac5(0x164)](_0x132ac5(0x155),_0x204019);}),_0x5c67b2=()=>{const _0x400d0d=_0x1b400e;_0x204019&&(_0x3be809[_0x400d0d(0x156)](_0x400d0d(0x155),_0x204019),_0x204019=undefined);try{_0x3be809[_0x400d0d(0x132)]();}catch{}};return{'rl':_0x3be809,'abortPromise':_0x5608a8,'disposeSuccess':_0x5c67b2};}async function promptInput(_0x6b7c2d,_0x4a04f3){const {rl:_0x49dff7,abortPromise:_0x384b01,disposeSuccess:_0x323ee5}=createSafeRl(),_0x49ab72=new Promise(_0x4be471=>{const _0x285ef7=a31_0x47cc,_0x41fa55=_0x4a04f3?'\x20\x20'+_0x6b7c2d+'\x20('+_0x4a04f3+_0x285ef7(0x121):'\x20\x20'+_0x6b7c2d+':\x20';_0x49dff7['question'](_0x41fa55,_0x2a8561=>{_0x323ee5(),_0x4be471(_0x2a8561['trim']()||_0x4a04f3);});});return Promise['race']([_0x49ab72,_0x384b01]);}async function promptYesNo(_0x1bb9b4,_0x4c594){const {rl:_0x1ee4f2,abortPromise:_0x2dbb29,disposeSuccess:_0x1f6e2d}=createSafeRl(),_0x1aa649=new Promise(_0x3fde04=>{const _0x477fe5=a31_0x47cc,_0x1e7517=_0x4c594?_0x477fe5(0x14b):_0x477fe5(0x12f);_0x1ee4f2[_0x477fe5(0x158)]('\x20\x20'+_0x1bb9b4+'\x20'+_0x1e7517+':\x20',_0x1d215e=>{const _0x539434=_0x477fe5;_0x1f6e2d();const _0x4d86b3=_0x1d215e['trim']()[_0x539434(0x138)]();if(_0x4d86b3==='y'||_0x4d86b3===_0x539434(0x140))_0x3fde04(!![]);else{if(_0x4d86b3==='n'||_0x4d86b3==='no')_0x3fde04(![]);else _0x3fde04(_0x4c594);}});});return Promise['race']([_0x1aa649,_0x2dbb29]);}function loadExisting(_0x5cff89){if(!existsSync(_0x5cff89))return null;return readConfigFile(_0x5cff89);}function resolveFilePath(_0x4105ce){const _0x72693b=a31_0x5afdf6;return isAbsolute(_0x4105ce)?_0x4105ce:resolve(process[_0x72693b(0x133)](),_0x4105ce);}function readSourceFile(_0x53d4c0){const _0xfc1a83=a31_0x5afdf6;try{const _0x4db9e2=readFileSync(_0x53d4c0,{'encoding':_0xfc1a83(0x151)});return JSON[_0xfc1a83(0x123)](_0x4db9e2);}catch(_0x2435d1){throw CliErrors[_0xfc1a83(0x163)](_0xfc1a83(0x13d)+_0x2435d1[_0xfc1a83(0x15d)]);}}function resolveInitEnv(_0x587e78){const _0x39f8f6=a31_0x5afdf6,_0x1a7f62=_0x587e78[_0x39f8f6(0x12e)];if(_0x1a7f62===undefined||_0x1a7f62==='')return DEFAULT_CONFIG_VALUES[_0x39f8f6(0x12e)];if(!RUNTIME_ENV_VALUES[_0x39f8f6(0x136)](_0x1a7f62))throw CliErrors[_0x39f8f6(0x163)](_0x39f8f6(0x129)+_0x1a7f62+_0x39f8f6(0x165)+RUNTIME_ENV_VALUES[_0x39f8f6(0x14a)](',\x20'));return _0x1a7f62;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x2616f7=a32_0x8e24;(function(_0x18204b,_0xbfc66e){const _0x513207=a32_0x8e24,_0x121591=_0x18204b();while(!![]){try{const _0x113638=-parseInt(_0x513207(0x1b4))/0x1*(parseInt(_0x513207(0x1b6))/0x2)+parseInt(_0x513207(0x1c1))/0x3*(-parseInt(_0x513207(0x19c))/0x4)+-parseInt(_0x513207(0x18e))/0x5+parseInt(_0x513207(0x18c))/0x6*(parseInt(_0x513207(0x18a))/0x7)+parseInt(_0x513207(0x18d))/0x8+parseInt(_0x513207(0x1b2))/0x9+parseInt(_0x513207(0x195))/0xa;if(_0x113638===_0xbfc66e)break;else _0x121591['push'](_0x121591['shift']());}catch(_0x365907){_0x121591['push'](_0x121591['shift']());}}}(a32_0x9d20,0x519e3));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_0x2616f7(0x193),'type':a32_0x2616f7(0x1a0),'required':!![],'description':a32_0x2616f7(0x1a5)},FILE_FLAG={'name':a32_0x2616f7(0x1a4),'type':'string','required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':'query','type':a32_0x2616f7(0x1a0),'required':!![],'description':a32_0x2616f7(0x182)},TOPK_FLAG={'name':a32_0x2616f7(0x1b9),'type':a32_0x2616f7(0x19d),'description':a32_0x2616f7(0x1bc)};function readKnowledgeFile(_0x1122ba){const _0x947a5a=a32_0x2616f7;if(!_0x1122ba)throw CliErrors[_0x947a5a(0x1ba)](_0x947a5a(0x1a7));if(!existsSync(_0x1122ba))throw CliErrors[_0x947a5a(0x1ba)](_0x947a5a(0x1be)+_0x1122ba);if(!statSync(_0x1122ba)[_0x947a5a(0x1aa)]())throw CliErrors['validation'](_0x947a5a(0x188)+_0x1122ba);return readFileSync(_0x1122ba,_0x947a5a(0x1ab));}function summarizePersonalItem(_0x32c670){const _0xd563d7=a32_0x2616f7;return{'id':_0x32c670['id'],'title':_0x32c670[_0xd563d7(0x193)],'version':_0x32c670['version'],'ragStatus':_0x32c670[_0xd563d7(0x198)],'ragErrorMessage':_0x32c670[_0xd563d7(0x19b)],'updateTime':_0x32c670[_0xd563d7(0x1bf)]};}function a32_0x8e24(_0x2ebaae,_0x504eb5){_0x2ebaae=_0x2ebaae-0x182;const _0x9d20cb=a32_0x9d20();let _0x8e2438=_0x9d20cb[_0x2ebaae];return _0x8e2438;}function detailPersonalItem(_0xf6e3b0){const _0x2d6ee1=a32_0x2616f7;return{'id':_0xf6e3b0['id'],'appCode':_0xf6e3b0[_0x2d6ee1(0x1ac)],'scope':_0xf6e3b0[_0x2d6ee1(0x19f)],'userId':_0xf6e3b0[_0x2d6ee1(0x199)],'title':_0xf6e3b0[_0x2d6ee1(0x193)],'content':_0xf6e3b0[_0x2d6ee1(0x191)]??'','version':_0xf6e3b0[_0x2d6ee1(0x1b1)],'ragStatus':_0xf6e3b0[_0x2d6ee1(0x198)],'ragErrorMessage':_0xf6e3b0[_0x2d6ee1(0x19b)],'createTime':_0xf6e3b0['createTime'],'updateTime':_0xf6e3b0[_0x2d6ee1(0x1bf)]};}function summarizeSearchHit(_0x1d0e4e){const _0x55925a=a32_0x2616f7;return{'scope':_0x1d0e4e[_0x55925a(0x19f)],'title':_0x1d0e4e[_0x55925a(0x193)],'docId':_0x1d0e4e[_0x55925a(0x196)],'score':_0x1d0e4e[_0x55925a(0x197)],'weightedScore':_0x1d0e4e['weightedScore'],'content':_0x1d0e4e[_0x55925a(0x191)],'metadata':_0x1d0e4e['metadata']};}function readTopK(_0x45ff7f){const _0x2a58b4=a32_0x2616f7,_0x186887=_0x45ff7f[_0x2a58b4(0x18b)](_0x2a58b4(0x1b9));if(_0x186887===undefined||_0x186887===null||_0x186887==='')return undefined;const _0x4defb3=_0x45ff7f['num'](_0x2a58b4(0x1b9));if(!Number[_0x2a58b4(0x1c0)](_0x4defb3)||_0x4defb3<0x1)throw CliErrors['validation']('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x4defb3;}const kbList={'service':'kb','command':'list','description':a32_0x2616f7(0x186),'risk':a32_0x2616f7(0x1a3),'flags':[VERBOSE_FLAG],async 'execute'(_0x44216c){const _0x4fea28=a32_0x2616f7,_0x14723f=await listPersonalKnowledgeBaseItems(_0x44216c[_0x4fea28(0x1ac)]);if(_0x44216c[_0x4fea28(0x1ae)](_0x4fea28(0x1a9)))return{'ok':!![],'data':{'total':_0x14723f[_0x4fea28(0x1bd)],'items':_0x14723f}};return{'ok':!![],'data':{'total':_0x14723f[_0x4fea28(0x1bd)],'items':_0x14723f[_0x4fea28(0x1a6)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2616f7(0x19a),'description':'Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','risk':'read','flags':[{...ID_FLAG,'description':a32_0x2616f7(0x1b0)}],async 'execute'(_0x23579f){const _0x5a825c=a32_0x2616f7,_0x23d730=await getPersonalKnowledgeBaseItem(_0x23579f[_0x5a825c(0x194)]('id'),_0x23579f[_0x5a825c(0x1ac)]);return{'ok':!![],'data':detailPersonalItem(_0x23d730)};}},kbCreate={'service':'kb','command':a32_0x2616f7(0x190),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x2616f7(0x1bb),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x4f1b97){const _0x43027d=a32_0x2616f7,_0x42c03c=_0x4f1b97[_0x43027d(0x189)](_0x43027d(0x193)),_0x185c7e=readKnowledgeFile(_0x4f1b97[_0x43027d(0x189)](_0x43027d(0x1a4))),_0x57ae1b=await createPersonalKnowledgeBaseItem(_0x4f1b97[_0x43027d(0x1ac)],{'title':_0x42c03c,'content':_0x185c7e});return{'ok':!![],'data':summarizePersonalItem(_0x57ae1b),'message':_0x43027d(0x1ad)+_0x57ae1b['id']+'\x20('+_0x57ae1b[_0x43027d(0x193)]+')'};},async 'dryRun'(_0x4de905){const _0x1c5a4d=a32_0x2616f7,_0x43f104=_0x4de905['str'](_0x1c5a4d(0x193)),_0x2be93e=readKnowledgeFile(_0x4de905[_0x1c5a4d(0x189)](_0x1c5a4d(0x1a4)));return dryRun(_0x1c5a4d(0x185),_0x1c5a4d(0x1a8))[_0x1c5a4d(0x1af)]({'appCode':_0x4de905['appCode'],'title':_0x43f104,'content':_0x2be93e})['description']('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x43f104+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x2616f7(0x184),'description':a32_0x2616f7(0x1b7),'risk':a32_0x2616f7(0x1bb),'flags':[{...ID_FLAG,'description':a32_0x2616f7(0x1b0)},{...TITLE_FLAG,'required':![],'description':a32_0x2616f7(0x1a1)},FILE_FLAG],async 'execute'(_0x55477b){const _0x151013=a32_0x2616f7,_0x1531f9=_0x55477b[_0x151013(0x194)]('id'),_0x2b462c=readKnowledgeFile(_0x55477b[_0x151013(0x189)](_0x151013(0x1a4))),_0xcd969a=_0x55477b[_0x151013(0x189)](_0x151013(0x193))||(await getPersonalKnowledgeBaseItem(_0x1531f9,_0x55477b[_0x151013(0x1ac)]))[_0x151013(0x193)],_0xf4b045=await updatePersonalKnowledgeBaseItem(_0x1531f9,_0x55477b[_0x151013(0x1ac)],{'title':_0xcd969a,'content':_0x2b462c});return{'ok':!![],'data':summarizePersonalItem(_0xf4b045),'message':'Updated\x20KB\x20entry\x20'+_0xf4b045['id']+'\x20('+_0xf4b045[_0x151013(0x193)]+')'};},async 'dryRun'(_0x3328b4){const _0x3a22c9=a32_0x2616f7,_0x72837b=_0x3328b4[_0x3a22c9(0x194)]('id'),_0x2e8be7=readKnowledgeFile(_0x3328b4[_0x3a22c9(0x189)]('file')),_0x4b07f8=_0x3328b4['str']('title')||(await getPersonalKnowledgeBaseItem(_0x72837b,_0x3328b4[_0x3a22c9(0x1ac)]))[_0x3a22c9(0x193)];return dryRun('POST',_0x3a22c9(0x1b5)+_0x72837b+_0x3a22c9(0x187))['body']({'appCode':_0x3328b4[_0x3a22c9(0x1ac)],'title':_0x4b07f8,'content':_0x2e8be7})[_0x3a22c9(0x183)](_0x3a22c9(0x192)+_0x72837b)['build']();}},kbSearch={'service':'kb','command':a32_0x2616f7(0x1b8),'description':a32_0x2616f7(0x1b3),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x278f4d){const _0x35c191=a32_0x2616f7;if(!_0x278f4d[_0x35c191(0x189)](_0x35c191(0x19e))[_0x35c191(0x18f)]())throw CliErrors['validation'](_0x35c191(0x1a2));readTopK(_0x278f4d);},async 'execute'(_0x909b73){const _0x5ea0c1=a32_0x2616f7,_0x2bbeec=_0x909b73[_0x5ea0c1(0x189)](_0x5ea0c1(0x19e))[_0x5ea0c1(0x18f)](),_0x5e006e=readTopK(_0x909b73),_0x45afb3=await searchKnowledgeBase(_0x909b73[_0x5ea0c1(0x1ac)],{'query':_0x2bbeec,'topK':_0x5e006e});return{'ok':!![],'data':{'total':_0x45afb3[_0x5ea0c1(0x1bd)],'hits':_0x45afb3[_0x5ea0c1(0x1a6)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];function a32_0x9d20(){const _0x16643c=['List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','/update','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','287qPlHIH','flag','82848lwaRme','2018192dwObTM','1824405sIHskn','trim','create','content','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','title','num','2445590SJCfjN','docId','score','ragStatus','userId','detail','ragErrorMessage','1629164EQpneo','number','query','scope','string','Override\x20the\x20existing\x20entry\x20title','Search\x20query\x20is\x20required.','read','file','Personal\x20knowledge-base\x20entry\x20title','map','File\x20path\x20is\x20required.','/client/knowledge-base/personal/create','verbose','isFile','utf8','appCode','Created\x20KB\x20entry\x20','bool','body','Personal\x20knowledge-base\x20entry\x20ID','version','3703392poeHMN','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','183985fqwMMz','/client/knowledge-base/personal/','4RWJrXw','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','search','topk','validation','write','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','length','File\x20not\x20found:\x20','updateTime','isFinite','3zSRRJX','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','description','update','POST'];a32_0x9d20=function(){return _0x16643c;};return a32_0x9d20();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x3cf3(_0x2527d1,_0x69711d){_0x2527d1=_0x2527d1-0x1d7;const _0x40748e=a33_0x4074();let _0x3cf3ad=_0x40748e[_0x2527d1];return _0x3cf3ad;}const a33_0x2ef847=a33_0x3cf3;(function(_0x156e23,_0x38e227){const _0x1bb98c=a33_0x3cf3,_0x4a50b0=_0x156e23();while(!![]){try{const _0x36edf5=parseInt(_0x1bb98c(0x1da))/0x1*(parseInt(_0x1bb98c(0x1fb))/0x2)+parseInt(_0x1bb98c(0x1db))/0x3+-parseInt(_0x1bb98c(0x1e0))/0x4*(parseInt(_0x1bb98c(0x1e3))/0x5)+parseInt(_0x1bb98c(0x1d8))/0x6+parseInt(_0x1bb98c(0x1f7))/0x7*(-parseInt(_0x1bb98c(0x1e8))/0x8)+-parseInt(_0x1bb98c(0x1fd))/0x9+parseInt(_0x1bb98c(0x1dd))/0xa*(parseInt(_0x1bb98c(0x1eb))/0xb);if(_0x36edf5===_0x38e227)break;else _0x4a50b0['push'](_0x4a50b0['shift']());}catch(_0x39c6d){_0x4a50b0['push'](_0x4a50b0['shift']());}}}(a33_0x4074,0xefad9));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x36c72f){const _0x4329e=a33_0x3cf3;if(_0x36c72f['length']===0x0){console[_0x4329e(0x1ea)](_0x4329e(0x1e1));return;}console[_0x4329e(0x1ea)]('*\x20'+CLI_DISPLAY_NAME+_0x4329e(0x1e4)),_0x36c72f[_0x4329e(0x1f2)]((_0x546ac9,_0x48dd0d)=>{const _0x56bdba=_0x4329e,_0x4397d3=new Date(_0x546ac9[_0x56bdba(0x1e6)])[_0x56bdba(0x1f8)](_0x56bdba(0x1e2)),_0x490663=_0x546ac9[_0x56bdba(0x1f5)]==='success'?'√':_0x546ac9[_0x56bdba(0x1f5)]===_0x56bdba(0x1f4)?'×':_0x546ac9['level']===_0x56bdba(0x1e5)?'!':'i';console[_0x56bdba(0x1ea)](_0x48dd0d+0x1+'.\x20'+_0x490663+'\x20['+_0x546ac9[_0x56bdba(0x1d7)]+']\x20'+_0x546ac9[_0x56bdba(0x1ee)]),console[_0x56bdba(0x1ea)](_0x56bdba(0x1e7)+_0x4397d3),_0x546ac9[_0x56bdba(0x1fa)]&&console[_0x56bdba(0x1ea)](_0x56bdba(0x1fc)+_0x546ac9['duration']+'ms'),_0x546ac9[_0x56bdba(0x1fe)]&&Object[_0x56bdba(0x1ef)](_0x546ac9['details'])[_0x56bdba(0x1f3)]>0x0&&console[_0x56bdba(0x1ea)](_0x56bdba(0x1d9)+JSON[_0x56bdba(0x1e9)](_0x546ac9[_0x56bdba(0x1fe)],null,0x2)),console[_0x56bdba(0x1ea)]('');});}export const logsDefinitions=[{'service':a33_0x2ef847(0x1ed),'command':a33_0x2ef847(0x1df),'description':a33_0x2ef847(0x1f1),'risk':a33_0x2ef847(0x1dc),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1dee4f){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':a33_0x2ef847(0x1ed),'command':a33_0x2ef847(0x1de),'description':a33_0x2ef847(0x1ec),'risk':a33_0x2ef847(0x1f0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x476c91){const _0x556caa=a33_0x2ef847;return logger[_0x556caa(0x1f6)](),console[_0x556caa(0x1ea)](_0x556caa(0x1f9)),{'ok':!![]};}}];function a33_0x4074(){const _0x105bdd=['details','command','9537894tMlhQI','\x20\x20\x20Details:\x20','1umNOEK','2693979UJUykl','read','660430vvGrBP','clear','show','1968tzGlgL','*\x20No\x20logs\x20found','en-US','17105jYKRyZ','\x20logs:\x0a','warn','timestamp','\x20\x20\x20Time:\x20','136egwaMc','stringify','log','275tmlnoj','Clear\x20command\x20history\x20logs','logs','message','keys','write','View\x20command\x20history\x20logs','forEach','length','error','level','clearLogs','634123NLrGlD','toLocaleString','*\x20Logs\x20cleared','duration','1457766SKMqWK','\x20\x20\x20Duration:\x20','5964606SbSSQB'];a33_0x4074=function(){return _0x105bdd;};return a33_0x4074();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x54ea06=a34_0x1a16;(function(_0x3432b4,_0x6e72c2){const _0x9c68a8=a34_0x1a16,_0x29744b=_0x3432b4();while(!![]){try{const _0x18ad05=parseInt(_0x9c68a8(0x91))/0x1+-parseInt(_0x9c68a8(0x98))/0x2*(-parseInt(_0x9c68a8(0xab))/0x3)+parseInt(_0x9c68a8(0x95))/0x4+parseInt(_0x9c68a8(0x9d))/0x5*(parseInt(_0x9c68a8(0xa4))/0x6)+-parseInt(_0x9c68a8(0x9b))/0x7+parseInt(_0x9c68a8(0x9c))/0x8+-parseInt(_0x9c68a8(0xb2))/0x9;if(_0x18ad05===_0x6e72c2)break;else _0x29744b['push'](_0x29744b['shift']());}catch(_0x57097f){_0x29744b['push'](_0x29744b['shift']());}}}(a34_0x16bd,0xc25a8));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x1a16(_0xbfa1ec,_0x4bb6f2){_0xbfa1ec=_0xbfa1ec-0x81;const _0x16bd68=a34_0x16bd();let _0x1a1694=_0x16bd68[_0xbfa1ec];return _0x1a1694;}const SUPPORTED_SCENES=[a34_0x54ea06(0x8d),a34_0x54ea06(0x99),a34_0x54ea06(0x94),a34_0x54ea06(0x90)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':'General','form':a34_0x54ea06(0x8b),'idCard':'IdCard'},SCENE_FLAG={'name':a34_0x54ea06(0x92),'type':a34_0x54ea06(0xb1),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x54ea06(0x9f)},IMAGE_FILE_FLAG={'name':a34_0x54ea06(0xa1),'type':a34_0x54ea06(0xb1),'description':a34_0x54ea06(0x8a)},IMAGE_URL_FLAG={'name':a34_0x54ea06(0x84),'type':a34_0x54ea06(0xb1),'description':a34_0x54ea06(0x9a)};function normalizeScene(_0x56c39f){const _0x2d4538=a34_0x54ea06,_0xcca2d7=_0x56c39f[_0x2d4538(0x88)]()[_0x2d4538(0xb0)]();if(_0xcca2d7==='idcard')return _0x2d4538(0x90);if(_0xcca2d7===_0x2d4538(0x8d)||_0xcca2d7===_0x2d4538(0x99)||_0xcca2d7===_0x2d4538(0x94))return _0xcca2d7;throw CliErrors[_0x2d4538(0xa2)](_0x2d4538(0x8c)+_0x56c39f+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES[_0x2d4538(0xa0)](',\x20'));}function selectedInputs(_0x5b10e3){const _0x45b1f5=a34_0x54ea06,_0x55bc1a=_0x5b10e3[_0x45b1f5(0xa8)](_0x45b1f5(0xa1))['trim'](),_0x17ee97=_0x5b10e3[_0x45b1f5(0xa8)](_0x45b1f5(0x84))[_0x45b1f5(0x88)]();return{'imageFile':_0x55bc1a,'imageUrl':_0x17ee97,'count':[_0x55bc1a,_0x17ee97]['filter'](Boolean)[_0x45b1f5(0x83)]};}function validateInputSelection(_0x3f8351){const _0x3f8da8=a34_0x54ea06,_0x172ad6=selectedInputs(_0x3f8351);if(_0x172ad6[_0x3f8da8(0x82)]!==0x1)throw CliErrors['validation'](_0x3f8da8(0xaf));return _0x172ad6;}function a34_0x16bd(){const _0x26606e=['scene','Preview:\x20recognize\x20','form','5055076ImHkzW','build','imageUrl','1015366olTxEz','general','Publicly\x20accessible\x20image\x20or\x20file\x20URL','8105223LlDDBb','11371752ooQRAd','1596115eMIhNJ','description','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','join','image-file','validation','body','6reVCkk','apiError','filePath','recognize','str','/client/ocr','File\x20upload\x20response\x20missing\x20filePath.','3FTcUBZ','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','/client/uploadFile','/client/queryFileUrl','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','toLowerCase','string','19624311kKtVIB','appCode','File\x20URL\x20response\x20missing\x20fileUrl.','count','length','image-url','\x20OCR\x20from\x20URL','ocr','fileUrl','trim','POST','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','Table','Unsupported\x20OCR\x20scene:\x20','invoice','imageFile','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','idCard','622296hlLUJQ'];a34_0x16bd=function(){return _0x26606e;};return a34_0x16bd();}function withScene(_0x6f0156,_0x1c7c9d,_0x5a1632){return{..._0x6f0156,'scene':_0x1c7c9d,..._0x5a1632?{'sourceFile':{'fileName':_0x5a1632['fileName'],'filePath':_0x5a1632['filePath']}}:{}};}const ocrRecognize={'service':a34_0x54ea06(0x86),'command':a34_0x54ea06(0xa7),'description':a34_0x54ea06(0xac),'risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0xc2f663){const _0x2ec8bf=a34_0x54ea06,_0x3e1a58=normalizeScene(_0xc2f663[_0x2ec8bf(0xa8)](_0x2ec8bf(0x92))),_0x58eccd=SCENE_TO_LEGACY_TYPE[_0x3e1a58],_0x10ebda=validateInputSelection(_0xc2f663);if(_0x10ebda[_0x2ec8bf(0x97)])return dryRun(_0x2ec8bf(0x89),_0x2ec8bf(0xa9))[_0x2ec8bf(0xa3)]({'appCode':_0xc2f663[_0x2ec8bf(0xb3)],'url':_0x10ebda[_0x2ec8bf(0x97)],'type':_0x58eccd})[_0x2ec8bf(0x9e)](_0x2ec8bf(0x93)+_0x3e1a58+_0x2ec8bf(0x85))[_0x2ec8bf(0x96)]();const _0x4ac123=requireRuntimeUploadFile(_0x10ebda[_0x2ec8bf(0x8e)],_0x2ec8bf(0xa1));return dryRun(_0x2ec8bf(0x89),_0x2ec8bf(0xad))[_0x2ec8bf(0xa3)]({'steps':[{'method':_0x2ec8bf(0x89),'url':_0x2ec8bf(0xad),'body':{'appCode':_0xc2f663[_0x2ec8bf(0xb3)],'multipart':{'file':_0x4ac123}}},{'method':'POST','url':_0x2ec8bf(0xae),'body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x2ec8bf(0x89),'url':_0x2ec8bf(0xa9),'body':{'appCode':_0xc2f663['appCode'],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x58eccd}}]})[_0x2ec8bf(0x9e)](_0x2ec8bf(0x8f)+_0x3e1a58+'\x20OCR')[_0x2ec8bf(0x96)]();},async 'execute'(_0x10d9e6){const _0x94c524=a34_0x54ea06,_0x4d4717=normalizeScene(_0x10d9e6[_0x94c524(0xa8)](_0x94c524(0x92))),_0x98b792=SCENE_TO_LEGACY_TYPE[_0x4d4717],_0x332c18=validateInputSelection(_0x10d9e6);if(_0x332c18['imageUrl']){const _0x31ede2=await recognizeRuntimeOcr(_0x10d9e6[_0x94c524(0xb3)],{'url':_0x332c18[_0x94c524(0x97)],'type':_0x98b792});return{'ok':!![],'data':withScene(_0x31ede2,_0x4d4717)};}const _0x576559=requireRuntimeUploadFile(_0x332c18['imageFile'],_0x94c524(0xa1)),_0x153264=await uploadRuntimeFile(_0x10d9e6[_0x94c524(0xb3)],_0x576559['path']);if(!_0x153264[_0x94c524(0xa6)])throw CliErrors[_0x94c524(0xa5)](_0x94c524(0xaa));const _0x1e3485=await queryRuntimeFileUrl(_0x153264[_0x94c524(0xa6)],{'download':![]});if(!_0x1e3485[_0x94c524(0x87)])throw CliErrors['apiError'](_0x94c524(0x81));const _0x29ac5f=await recognizeRuntimeOcr(_0x10d9e6['appCode'],{'url':_0x1e3485['fileUrl'],'type':_0x98b792});return{'ok':!![],'data':withScene(_0x29ac5f,_0x4d4717,_0x153264)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x2922ea=a35_0x51b7;(function(_0x3e478e,_0x318baa){const _0x52bf9f=a35_0x51b7,_0x5a59d4=_0x3e478e();while(!![]){try{const _0x3e02ce=parseInt(_0x52bf9f(0x13c))/0x1+parseInt(_0x52bf9f(0x13a))/0x2*(parseInt(_0x52bf9f(0x157))/0x3)+parseInt(_0x52bf9f(0x149))/0x4*(parseInt(_0x52bf9f(0x12c))/0x5)+parseInt(_0x52bf9f(0x15a))/0x6*(parseInt(_0x52bf9f(0x124))/0x7)+parseInt(_0x52bf9f(0x152))/0x8+parseInt(_0x52bf9f(0x129))/0x9+parseInt(_0x52bf9f(0x148))/0xa*(-parseInt(_0x52bf9f(0x15e))/0xb);if(_0x3e02ce===_0x318baa)break;else _0x5a59d4['push'](_0x5a59d4['shift']());}catch(_0x3b29b8){_0x5a59d4['push'](_0x5a59d4['shift']());}}}(a35_0xbfa2,0xb13f0));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x51b7(_0x20f6b1,_0x11c35f){_0x20f6b1=_0x20f6b1-0x11e;const _0xbfa2e0=a35_0xbfa2();let _0x51b776=_0xbfa2e0[_0x20f6b1];return _0x51b776;}import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a35_0xbfa2(){const _0x131d0f=['keys','327214kfCQXQ','createUserId','string','updateTime','personal-bff','/client/runtime-bff/personal/create','Preview:\x20create\x20personal\x20BFF\x20','/client/runtime-bff/personal/','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','update','gmtModified','flag','4444730RKxAJl','748876JPdIJw','Personal\x20BFF\x20script\x20ID','num','validation','description','Update\x20a\x20personal\x20BFF\x20by\x20id','POST','body','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','7477216vdWeUE','appCode','Updated\x20personal\x20BFF\x20','high-risk-write','sourceSessionId','3537219rMuvuP','scriptContent','write','12FErnoE','read','File\x20is\x20not\x20a\x20regular\x20file:\x20','bool','99aIJSdc','version','Personal\x20BFF\x20description','params','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','build','createTime','File\x20path\x20is\x20required.','Show\x20one\x20personal\x20BFF\x20by\x20id','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','create','test','3500581JSOyyl','File\x20not\x20found:\x20','isArray','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','length','1456542pLqdcr','str','name','30PmsSyS','verbose','config','utf8','source-session-id','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','trim','Preview:\x20update\x20personal\x20BFF\x20','Created\x20personal\x20BFF\x20','Executed\x20personal\x20BFF\x20','file','functionName','scriptType','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','2BiELgE'];a35_0xbfa2=function(){return _0x131d0f;};return a35_0xbfa2();}import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':'file','type':'string','description':a35_0x2922ea(0x139)},FUNCTION_NAME_FLAG={'name':a35_0x2922ea(0x12b),'type':a35_0x2922ea(0x13e),'required':!![],'description':a35_0x2922ea(0x144)},DESCRIPTION_FLAG={'name':'description','type':a35_0x2922ea(0x13e),'description':a35_0x2922ea(0x160)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x2922ea(0x13e),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x1c98d0){const _0x289c62=a35_0x2922ea,_0x2b5c0a=String(_0x1c98d0||'')['trim']();if(!_0x2b5c0a||!FUNCTION_NAME_PATTERN[_0x289c62(0x123)](_0x2b5c0a))throw CliErrors[_0x289c62(0x14c)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x2b5c0a;}function readScriptFile(_0x47aa0e){const _0x5c731e=a35_0x2922ea;if(!_0x47aa0e)throw CliErrors[_0x5c731e(0x14c)](_0x5c731e(0x11f));if(!existsSync(_0x47aa0e))throw CliErrors['validation'](_0x5c731e(0x125)+_0x47aa0e);if(!statSync(_0x47aa0e)['isFile']())throw CliErrors[_0x5c731e(0x14c)](_0x5c731e(0x15c)+_0x47aa0e);const _0x1eec74=readFileSync(_0x47aa0e,_0x5c731e(0x12f));if(!_0x1eec74['trim']())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x1eec74;}function optionalTrimmed(_0x5cd400){const _0x4200cc=a35_0x2922ea,_0x2a1bf6=String(_0x5cd400||'')[_0x4200cc(0x132)]();return _0x2a1bf6||undefined;}function summarizeBff(_0x246215){const _0x154d8d=a35_0x2922ea;return{'id':_0x246215['id'],'appCode':_0x246215[_0x154d8d(0x153)],'functionName':_0x246215[_0x154d8d(0x137)],'description':_0x246215['description'],'scriptType':_0x246215['scriptType'],'version':_0x246215['version'],'gmtModified':_0x246215[_0x154d8d(0x146)],'updateTime':_0x246215[_0x154d8d(0x13f)]};}function detailBff(_0x39c47f){const _0x40b116=a35_0x2922ea;return{'id':_0x39c47f['id'],'appCode':_0x39c47f[_0x40b116(0x153)],'functionName':_0x39c47f['functionName'],'description':_0x39c47f['description'],'scriptType':_0x39c47f[_0x40b116(0x138)],'scriptContent':_0x39c47f[_0x40b116(0x158)]??'','config':_0x39c47f[_0x40b116(0x12e)],'version':_0x39c47f[_0x40b116(0x15f)],'createUserId':_0x39c47f[_0x40b116(0x13d)],'gmtCreate':_0x39c47f['gmtCreate'],'gmtModified':_0x39c47f[_0x40b116(0x146)],'createTime':_0x39c47f[_0x40b116(0x11e)],'updateTime':_0x39c47f[_0x40b116(0x13f)]};}function buildCreateInput(_0x803743){const _0x1997cd=a35_0x2922ea;return{'functionName':normalizeFunctionName(_0x803743['str']('name')),...optionalTrimmed(_0x803743[_0x1997cd(0x12a)](_0x1997cd(0x14d)))?{'description':optionalTrimmed(_0x803743[_0x1997cd(0x12a)](_0x1997cd(0x14d)))}:{},'scriptContent':readScriptFile(_0x803743[_0x1997cd(0x12a)](_0x1997cd(0x136))),...optionalTrimmed(_0x803743[_0x1997cd(0x12a)](_0x1997cd(0x130)))?{'sourceSessionId':optionalTrimmed(_0x803743[_0x1997cd(0x12a)](_0x1997cd(0x130)))}:{}};}function buildUpdateInput(_0x3cae0){const _0x2f1495=a35_0x2922ea,_0x3d3612={};optionalTrimmed(_0x3cae0[_0x2f1495(0x12a)](_0x2f1495(0x12b)))&&(_0x3d3612[_0x2f1495(0x137)]=normalizeFunctionName(_0x3cae0['str'](_0x2f1495(0x12b))));_0x3cae0[_0x2f1495(0x147)](_0x2f1495(0x14d))!==undefined&&(_0x3d3612[_0x2f1495(0x14d)]=_0x3cae0[_0x2f1495(0x12a)](_0x2f1495(0x14d)));optionalTrimmed(_0x3cae0[_0x2f1495(0x12a)](_0x2f1495(0x136)))&&(_0x3d3612[_0x2f1495(0x158)]=readScriptFile(_0x3cae0['str']('file')));_0x3cae0[_0x2f1495(0x147)](_0x2f1495(0x130))!==undefined&&(_0x3d3612[_0x2f1495(0x156)]=_0x3cae0[_0x2f1495(0x12a)]('source-session-id'));if(Object[_0x2f1495(0x13b)](_0x3d3612)[_0x2f1495(0x128)]===0x0)throw CliErrors[_0x2f1495(0x14c)](_0x2f1495(0x162));return _0x3d3612;}function parseExecParams(_0x16ba19){const _0x394142=a35_0x2922ea,_0x17a368=parseJsonParams(_0x16ba19)??{};if(Array[_0x394142(0x126)](_0x17a368))throw CliErrors[_0x394142(0x14c)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x17a368;}const personalBffList={'service':'personal-bff','command':'list','description':a35_0x2922ea(0x131),'risk':a35_0x2922ea(0x15b),'flags':[VERBOSE_FLAG],async 'execute'(_0x5f972d){const _0xd9f81c=a35_0x2922ea,_0x5d3ce5=await listPersonalBffs(_0x5f972d[_0xd9f81c(0x153)]);return{'ok':!![],'data':{'total':_0x5d3ce5['length'],'items':_0x5f972d[_0xd9f81c(0x15d)](_0xd9f81c(0x12d))?_0x5d3ce5:_0x5d3ce5['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x2922ea(0x140),'command':'detail','description':a35_0x2922ea(0x120),'risk':a35_0x2922ea(0x15b),'flags':[{...ID_FLAG,'description':a35_0x2922ea(0x14a)}],async 'execute'(_0x2dd222){const _0x2d6924=a35_0x2922ea,_0x4122fa=await getPersonalBff(_0x2dd222[_0x2d6924(0x14b)]('id'),_0x2dd222[_0x2d6924(0x153)]);return{'ok':!![],'data':detailBff(_0x4122fa)};}},personalBffCreate={'service':a35_0x2922ea(0x140),'command':a35_0x2922ea(0x122),'description':a35_0x2922ea(0x121),'risk':a35_0x2922ea(0x159),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x50d482){const _0x2918c8=a35_0x2922ea,_0x145b19=buildCreateInput(_0x50d482),_0x174c5b=await createPersonalBff(_0x50d482[_0x2918c8(0x153)],_0x145b19);return{'ok':!![],'data':detailBff(_0x174c5b),'message':_0x2918c8(0x134)+_0x174c5b['id']+(_0x174c5b[_0x2918c8(0x137)]?'\x20('+_0x174c5b[_0x2918c8(0x137)]+')':'')};},async 'dryRun'(_0x1c8b76){const _0x317564=a35_0x2922ea,_0x1c28b0=buildCreateInput(_0x1c8b76);return dryRun(_0x317564(0x14f),_0x317564(0x141))[_0x317564(0x150)]({'appCode':_0x1c8b76[_0x317564(0x153)],..._0x1c28b0})['description'](_0x317564(0x142)+_0x1c28b0[_0x317564(0x137)])[_0x317564(0x163)]();}},personalBffUpdate={'service':a35_0x2922ea(0x140),'command':a35_0x2922ea(0x145),'description':a35_0x2922ea(0x14e),'risk':a35_0x2922ea(0x159),'flags':[{...ID_FLAG,'description':a35_0x2922ea(0x14a)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x15fd48){const _0xfa8500=a35_0x2922ea,_0x467b18=_0x15fd48[_0xfa8500(0x14b)]('id'),_0x46c9d3=buildUpdateInput(_0x15fd48),_0x3a41e7=await updatePersonalBff(_0x467b18,_0x15fd48[_0xfa8500(0x153)],_0x46c9d3);return{'ok':!![],'data':detailBff(_0x3a41e7),'message':_0xfa8500(0x154)+_0x3a41e7['id']+(_0x3a41e7['functionName']?'\x20('+_0x3a41e7[_0xfa8500(0x137)]+')':'')};},async 'dryRun'(_0x2f2916){const _0x3ec32d=a35_0x2922ea,_0xd9d18d=_0x2f2916['num']('id'),_0x30eb2b=buildUpdateInput(_0x2f2916);return dryRun(_0x3ec32d(0x14f),_0x3ec32d(0x143)+_0xd9d18d+'/update')['body']({'appCode':_0x2f2916['appCode'],..._0x30eb2b})[_0x3ec32d(0x14d)](_0x3ec32d(0x133)+_0xd9d18d)[_0x3ec32d(0x163)]();}},personalBffExec={'service':'personal-bff','command':'exec','description':a35_0x2922ea(0x151),'risk':a35_0x2922ea(0x155),'flags':[{...ID_FLAG,'description':a35_0x2922ea(0x14a)},{...PARAMS_FLAG,'description':a35_0x2922ea(0x127)}],async 'validate'(_0xdaa13e){const _0x5069e2=a35_0x2922ea;parseExecParams(_0xdaa13e[_0x5069e2(0x12a)](_0x5069e2(0x161)));},async 'execute'(_0x39dc6c){const _0x551f0d=a35_0x2922ea,_0x3c11a7=_0x39dc6c[_0x551f0d(0x14b)]('id'),_0x1562cb=parseExecParams(_0x39dc6c[_0x551f0d(0x12a)]('params')),_0x4d024d=await executePersonalBff(_0x3c11a7,_0x39dc6c[_0x551f0d(0x153)],_0x1562cb);return{'ok':!![],'data':{'result':_0x4d024d},'message':_0x551f0d(0x135)+_0x3c11a7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x6a44ad=a35_0x4e3b;(function(_0x47bc1b,_0x132b79){const _0x5539f6=a35_0x4e3b,_0x24c1a8=_0x47bc1b();while(!![]){try{const _0x15b9d7=parseInt(_0x5539f6(0x9e))/0x1*(-parseInt(_0x5539f6(0xa2))/0x2)+-parseInt(_0x5539f6(0xa5))/0x3*(parseInt(_0x5539f6(0xc2))/0x4)+-parseInt(_0x5539f6(0xb2))/0x5*(-parseInt(_0x5539f6(0xdb))/0x6)+-parseInt(_0x5539f6(0xd6))/0x7+-parseInt(_0x5539f6(0xb1))/0x8*(parseInt(_0x5539f6(0xdc))/0x9)+-parseInt(_0x5539f6(0xc7))/0xa+-parseInt(_0x5539f6(0xaa))/0xb*(-parseInt(_0x5539f6(0xe0))/0xc);if(_0x15b9d7===_0x132b79)break;else _0x24c1a8['push'](_0x24c1a8['shift']());}catch(_0x301df6){_0x24c1a8['push'](_0x24c1a8['shift']());}}}(a35_0x49dd,0x1d786));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x4e3b(_0xaf74b2,_0x2af2d6){_0xaf74b2=_0xaf74b2-0x9c;const _0x49dd67=a35_0x49dd();let _0x4e3b3d=_0x49dd67[_0xaf74b2];return _0x4e3b3d;}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_0x6a44ad(0xdf),'type':a35_0x6a44ad(0xae),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':'string','required':!![],'description':'Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':a35_0x6a44ad(0xc6),'type':a35_0x6a44ad(0xae),'description':a35_0x6a44ad(0xd5)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x6a44ad(0xae),'description':a35_0x6a44ad(0xb6)};function normalizeFunctionName(_0x2c2c71){const _0x1c323c=a35_0x6a44ad,_0x554264=String(_0x2c2c71||'')['trim']();if(!_0x554264||!FUNCTION_NAME_PATTERN['test'](_0x554264))throw CliErrors[_0x1c323c(0xcb)](_0x1c323c(0xac));return _0x554264;}function readScriptFile(_0x84bb3f){const _0x5c56cb=a35_0x6a44ad;if(!_0x84bb3f)throw CliErrors[_0x5c56cb(0xcb)](_0x5c56cb(0xc3));if(!existsSync(_0x84bb3f))throw CliErrors['validation'](_0x5c56cb(0xca)+_0x84bb3f);if(!statSync(_0x84bb3f)[_0x5c56cb(0xb0)]())throw CliErrors[_0x5c56cb(0xcb)](_0x5c56cb(0xcd)+_0x84bb3f);const _0x25c73f=readFileSync(_0x84bb3f,_0x5c56cb(0xad));if(!_0x25c73f[_0x5c56cb(0xc1)]())throw CliErrors[_0x5c56cb(0xcb)](_0x5c56cb(0xcc));return _0x25c73f;}function optionalTrimmed(_0x3e1307){const _0x1243be=a35_0x6a44ad,_0xb2b3c1=String(_0x3e1307||'')[_0x1243be(0xc1)]();return _0xb2b3c1||undefined;}function summarizeBff(_0x57faf5){const _0x196d19=a35_0x6a44ad;return{'id':_0x57faf5['id'],'appCode':_0x57faf5[_0x196d19(0xc5)],'functionName':_0x57faf5[_0x196d19(0xa1)],'description':_0x57faf5[_0x196d19(0xc6)],'scriptType':_0x57faf5[_0x196d19(0xa0)],'version':_0x57faf5[_0x196d19(0xaf)],'gmtModified':_0x57faf5[_0x196d19(0x9f)],'updateTime':_0x57faf5[_0x196d19(0xab)]};}function detailBff(_0x1afd26){const _0x4d5011=a35_0x6a44ad;return{'id':_0x1afd26['id'],'appCode':_0x1afd26[_0x4d5011(0xc5)],'functionName':_0x1afd26[_0x4d5011(0xa1)],'description':_0x1afd26['description'],'scriptType':_0x1afd26[_0x4d5011(0xa0)],'scriptContent':_0x1afd26[_0x4d5011(0xd1)]??'','config':_0x1afd26[_0x4d5011(0xb3)],'version':_0x1afd26['version'],'createUserId':_0x1afd26['createUserId'],'gmtCreate':_0x1afd26[_0x4d5011(0xbb)],'gmtModified':_0x1afd26[_0x4d5011(0x9f)],'createTime':_0x1afd26[_0x4d5011(0xc4)],'updateTime':_0x1afd26[_0x4d5011(0xab)]};}function buildCreateInput(_0x1d646e){const _0x36680a=a35_0x6a44ad;return{'functionName':normalizeFunctionName(_0x1d646e['str'](_0x36680a(0xa9))),...optionalTrimmed(_0x1d646e[_0x36680a(0xb9)](_0x36680a(0xc6)))?{'description':optionalTrimmed(_0x1d646e[_0x36680a(0xb9)](_0x36680a(0xc6)))}:{},'scriptContent':readScriptFile(_0x1d646e[_0x36680a(0xb9)](_0x36680a(0xdf))),...optionalTrimmed(_0x1d646e[_0x36680a(0xb9)](_0x36680a(0xb7)))?{'sourceSessionId':optionalTrimmed(_0x1d646e[_0x36680a(0xb9)](_0x36680a(0xb7)))}:{}};}function a35_0x49dd(){const _0x157044=['str','Preview:\x20update\x20personal\x20BFF\x20','gmtCreate','keys','params','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','body','trim','519664fkrALU','File\x20path\x20is\x20required.','createTime','appCode','description','1995330DHvJdG','length','write','File\x20not\x20found:\x20','validation','Personal\x20BFF\x20script\x20file\x20is\x20blank.','File\x20is\x20not\x20a\x20regular\x20file:\x20','POST','list','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','scriptContent','Created\x20personal\x20BFF\x20','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','Personal\x20BFF\x20description','761726LmgGxm','/client/runtime-bff/personal/create','sourceSessionId','Personal\x20BFF\x20script\x20ID','exec','6mNBhWe','1803879ZYMRiJ','create','update','file','2880EbqHQC','--params\x20must\x20be\x20a\x20JSON\x20object.','num','39633dlYXRt','gmtModified','scriptType','functionName','2eLCNDj','build','personal-bff','3KqXKka','detail','Show\x20one\x20personal\x20BFF\x20by\x20id','bool','name','35200zYWqkd','updateTime','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','utf8','string','version','isFile','8MJgehe','155205yFSCAy','config','Update\x20a\x20personal\x20BFF\x20by\x20id','Executed\x20personal\x20BFF\x20','Optional\x20source\x20RuntimeAgent\x20session\x20id','source-session-id','/update'];a35_0x49dd=function(){return _0x157044;};return a35_0x49dd();}function buildUpdateInput(_0xa40c14){const _0x53a824=a35_0x6a44ad,_0x4074fc={};optionalTrimmed(_0xa40c14['str']('name'))&&(_0x4074fc[_0x53a824(0xa1)]=normalizeFunctionName(_0xa40c14[_0x53a824(0xb9)](_0x53a824(0xa9))));_0xa40c14['flag'](_0x53a824(0xc6))!==undefined&&(_0x4074fc[_0x53a824(0xc6)]=_0xa40c14['str'](_0x53a824(0xc6)));optionalTrimmed(_0xa40c14[_0x53a824(0xb9)](_0x53a824(0xdf)))&&(_0x4074fc['scriptContent']=readScriptFile(_0xa40c14[_0x53a824(0xb9)](_0x53a824(0xdf))));_0xa40c14['flag']('source-session-id')!==undefined&&(_0x4074fc[_0x53a824(0xd8)]=_0xa40c14['str'](_0x53a824(0xb7)));if(Object[_0x53a824(0xbc)](_0x4074fc)[_0x53a824(0xc8)]===0x0)throw CliErrors[_0x53a824(0xcb)](_0x53a824(0xbe));return _0x4074fc;}function parseExecParams(_0x1288bb){const _0x40adda=a35_0x6a44ad,_0x230bc5=parseJsonParams(_0x1288bb)??{};if(Array['isArray'](_0x230bc5))throw CliErrors['validation'](_0x40adda(0x9c));return _0x230bc5;}const personalBffList={'service':'personal-bff','command':a35_0x6a44ad(0xcf),'description':a35_0x6a44ad(0xbf),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x59ad43){const _0x43daee=a35_0x6a44ad,_0x27c71a=await listPersonalBffs(_0x59ad43[_0x43daee(0xc5)]);return{'ok':!![],'data':{'total':_0x27c71a['length'],'items':_0x59ad43[_0x43daee(0xa8)]('verbose')?_0x27c71a:_0x27c71a['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x6a44ad(0xa4),'command':a35_0x6a44ad(0xa6),'description':a35_0x6a44ad(0xa7),'risk':'read','flags':[{...ID_FLAG,'description':a35_0x6a44ad(0xd9)}],async 'execute'(_0x32f312){const _0x85cee1=a35_0x6a44ad,_0x56ed30=await getPersonalBff(_0x32f312[_0x85cee1(0x9d)]('id'),_0x32f312[_0x85cee1(0xc5)]);return{'ok':!![],'data':detailBff(_0x56ed30)};}},personalBffCreate={'service':a35_0x6a44ad(0xa4),'command':a35_0x6a44ad(0xdd),'description':a35_0x6a44ad(0xd3),'risk':a35_0x6a44ad(0xc9),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x579160){const _0x1778fc=a35_0x6a44ad,_0x4cd81b=buildCreateInput(_0x579160),_0x44a540=await createPersonalBff(_0x579160[_0x1778fc(0xc5)],_0x4cd81b);return{'ok':!![],'data':detailBff(_0x44a540),'message':_0x1778fc(0xd2)+_0x44a540['id']+(_0x44a540[_0x1778fc(0xa1)]?'\x20('+_0x44a540[_0x1778fc(0xa1)]+')':'')};},async 'dryRun'(_0x36c57f){const _0x357cdb=a35_0x6a44ad,_0x4b1b37=buildCreateInput(_0x36c57f);return dryRun(_0x357cdb(0xce),_0x357cdb(0xd7))['body']({'appCode':_0x36c57f[_0x357cdb(0xc5)],..._0x4b1b37})[_0x357cdb(0xc6)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x4b1b37[_0x357cdb(0xa1)])[_0x357cdb(0xa3)]();}},personalBffUpdate={'service':a35_0x6a44ad(0xa4),'command':a35_0x6a44ad(0xde),'description':a35_0x6a44ad(0xb4),'risk':a35_0x6a44ad(0xc9),'flags':[{...ID_FLAG,'description':a35_0x6a44ad(0xd9)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4b9e2f){const _0x158650=a35_0x6a44ad,_0x2eb434=_0x4b9e2f[_0x158650(0x9d)]('id'),_0x1ff649=buildUpdateInput(_0x4b9e2f),_0x190726=await updatePersonalBff(_0x2eb434,_0x4b9e2f[_0x158650(0xc5)],_0x1ff649);return{'ok':!![],'data':detailBff(_0x190726),'message':'Updated\x20personal\x20BFF\x20'+_0x190726['id']+(_0x190726[_0x158650(0xa1)]?'\x20('+_0x190726['functionName']+')':'')};},async 'dryRun'(_0x5413ad){const _0x5722b0=a35_0x6a44ad,_0x32d875=_0x5413ad['num']('id'),_0x104198=buildUpdateInput(_0x5413ad);return dryRun(_0x5722b0(0xce),'/client/runtime-bff/personal/'+_0x32d875+_0x5722b0(0xb8))[_0x5722b0(0xc0)]({'appCode':_0x5413ad[_0x5722b0(0xc5)],..._0x104198})['description'](_0x5722b0(0xba)+_0x32d875)[_0x5722b0(0xa3)]();}},personalBffExec={'service':a35_0x6a44ad(0xa4),'command':a35_0x6a44ad(0xda),'description':a35_0x6a44ad(0xd4),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':a35_0x6a44ad(0xd9)},{...PARAMS_FLAG,'description':a35_0x6a44ad(0xd0)}],async 'validate'(_0x257319){const _0x2b621c=a35_0x6a44ad;parseExecParams(_0x257319[_0x2b621c(0xb9)](_0x2b621c(0xbd)));},async 'execute'(_0x5271c0){const _0x3cb311=a35_0x6a44ad,_0x428ae0=_0x5271c0[_0x3cb311(0x9d)]('id'),_0x1bd089=parseExecParams(_0x5271c0['str']('params')),_0x38a9cc=await executePersonalBff(_0x428ae0,_0x5271c0[_0x3cb311(0xc5)],_0x1bd089);return{'ok':!![],'data':{'result':_0x38a9cc},'message':_0x3cb311(0xb5)+_0x428ae0};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xb95d52=a36_0x2654;(function(_0x266737,_0x4cf2ef){const _0x3e1d06=a36_0x2654,_0x55f356=_0x266737();while(!![]){try{const _0x22a3fc=parseInt(_0x3e1d06(0x135))/0x1*(-parseInt(_0x3e1d06(0x10f))/0x2)+-parseInt(_0x3e1d06(0x122))/0x3*(-parseInt(_0x3e1d06(0x117))/0x4)+-parseInt(_0x3e1d06(0x10e))/0x5*(-parseInt(_0x3e1d06(0x139))/0x6)+-parseInt(_0x3e1d06(0x119))/0x7+parseInt(_0x3e1d06(0x121))/0x8+-parseInt(_0x3e1d06(0x12e))/0x9*(-parseInt(_0x3e1d06(0x131))/0xa)+-parseInt(_0x3e1d06(0x126))/0xb;if(_0x22a3fc===_0x4cf2ef)break;else _0x55f356['push'](_0x55f356['shift']());}catch(_0x1ce80c){_0x55f356['push'](_0x55f356['shift']());}}}(a36_0x5728,0x45288));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';function a36_0x2654(_0x4aaf98,_0x3ef69a){_0x4aaf98=_0x4aaf98-0x10c;const _0x5728d3=a36_0x5728();let _0x265426=_0x5728d3[_0x4aaf98];return _0x265426;}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];function a36_0x5728(){const _0x52af4d=['run','read','list','Artifacts','Instant\x20API','254908ktQeHN','show','1056692PfsEGQ','\x20\x20[write]','values','File','API\x20Documentation','OCR','install','Personal\x20BFF','1740456cqsQeo','3irCbnG','get','from','Logs','2045109keDWvL','has','Service\x20Tree','description','Skills','isSingleCommand','set','Authentication','531WYcbBz','login','Self\x20Update','69770DhXhOK','Schema','App\x20Management','CLI\x20Built-in\x20Skill','3lIAXwH','push','Workspace','Runtime\x20App\x20Config','6SzlPbg','defaultCommand','command','Configuration','1751265JPAnGM','282022JDkElj','service','Diagnostics'];a36_0x5728=function(){return _0x52af4d;};return a36_0x5728();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x4f65d7){const _0x23d7ef=a36_0x2654;for(const _0x840cf0 of _0x4f65d7){definitions['set'](_0x840cf0[_0x23d7ef(0x110)]+':'+_0x840cf0[_0x23d7ef(0x10c)],_0x840cf0);let _0x823d57=serviceGroups['get'](_0x840cf0[_0x23d7ef(0x110)]);!_0x823d57&&(_0x823d57=[],serviceGroups[_0x23d7ef(0x12c)](_0x840cf0[_0x23d7ef(0x110)],_0x823d57)),_0x823d57[_0x23d7ef(0x136)](_0x840cf0);}}function registerService(_0x1b0efa,_0x2fe6ac,_0x5ab136){const _0x154bf8=a36_0x2654;registerDefinitions(_0x2fe6ac);const _0x3bcf6e=_0x19407f=>_0x19407f===_0x154bf8(0x113)?'':_0x19407f==='write'?_0x154bf8(0x11a):'\x20\x20[high-risk-write]',_0x59c085={'service':_0x2fe6ac[0x0][_0x154bf8(0x110)],'label':_0x1b0efa,'commands':_0x2fe6ac['map'](_0x38048a=>({'command':_0x38048a[_0x154bf8(0x10c)],'description':_0x38048a[_0x154bf8(0x129)],'tag':_0x3bcf6e(_0x38048a['risk'])})),'defaultCommand':_0x5ab136?.[_0x154bf8(0x13a)]??(_0x5ab136?.['isSingleCommand']?_0x2fe6ac[0x0][_0x154bf8(0x10c)]:undefined),'isSingleCommand':_0x5ab136?.[_0x154bf8(0x12b)]};serviceRegistry[_0x154bf8(0x136)](_0x59c085),serviceByName[_0x154bf8(0x12c)](_0x59c085[_0x154bf8(0x110)],_0x59c085);}registerService(a36_0xb95d52(0x12d),authDefinitions,{'defaultCommand':a36_0xb95d52(0x12f)}),registerService(a36_0xb95d52(0x133),appDefinitions,{'defaultCommand':a36_0xb95d52(0x114)}),registerService(a36_0xb95d52(0x137),workspaceDefinitions),registerService(a36_0xb95d52(0x138),appConfigDefinitions),registerService(a36_0xb95d52(0x10d),configDefinitions,{'defaultCommand':'list'}),registerService(a36_0xb95d52(0x11d),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0xb95d52(0x116),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService(a36_0xb95d52(0x120),personalBffDefinitions),registerService(a36_0xb95d52(0x115),artifactDefinitions),registerService(a36_0xb95d52(0x11c),fileDefinitions),registerService(a36_0xb95d52(0x11e),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0xb95d52(0x128),serviceDefinitions,{'defaultCommand':a36_0xb95d52(0x114)}),registerService(a36_0xb95d52(0x12a),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0xb95d52(0x134),cliSkillDefinitions,{'defaultCommand':a36_0xb95d52(0x11f)}),registerService(a36_0xb95d52(0x130),[updateDefinition],{'defaultCommand':a36_0xb95d52(0x112),'isSingleCommand':!![]}),registerService(a36_0xb95d52(0x111),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0xb95d52(0x132),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0xb95d52(0x125),logsDefinitions,{'defaultCommand':a36_0xb95d52(0x118)});export function findDefinition(_0xc71f92,_0x458aa6){const _0x564575=a36_0xb95d52;return definitions[_0x564575(0x123)](_0xc71f92+':'+_0x458aa6);}export function isKnownService(_0x4375df){const _0x484d59=a36_0xb95d52;return serviceByName[_0x484d59(0x127)](_0x4375df);}export function getServiceEntry(_0xc6d7f1){return serviceByName['get'](_0xc6d7f1);}export function getAllDefinitions(){const _0xc5bfde=a36_0xb95d52;return Array[_0xc5bfde(0x124)](definitions[_0xc5bfde(0x11b)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x13596a=a37_0x2940;function a37_0x502c(){const _0x226b06=['1199bCfzsq','34630uSoTon','72fKrpzt','157275rbEYoM','schema','1722318ciHGFE','75213ocWVwe','184ZaxNOx','41043kdHcPx','read','Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','16ICEarT','2613429lQHzMn','147490bKdQnP'];a37_0x502c=function(){return _0x226b06;};return a37_0x502c();}(function(_0x4e5b8e,_0x445668){const _0x52ec70=a37_0x2940,_0x3684ec=_0x4e5b8e();while(!![]){try{const _0x1cb16d=-parseInt(_0x52ec70(0x110))/0x1*(parseInt(_0x52ec70(0x114))/0x2)+-parseInt(_0x52ec70(0x10e))/0x3*(-parseInt(_0x52ec70(0x119))/0x4)+parseInt(_0x52ec70(0x116))/0x5+-parseInt(_0x52ec70(0x10d))/0x6+parseInt(_0x52ec70(0x115))/0x7+parseInt(_0x52ec70(0x10f))/0x8*(parseInt(_0x52ec70(0x11a))/0x9)+parseInt(_0x52ec70(0x118))/0xa*(-parseInt(_0x52ec70(0x117))/0xb);if(_0x1cb16d===_0x445668)break;else _0x3684ec['push'](_0x3684ec['shift']());}catch(_0x536f29){_0x3684ec['push'](_0x3684ec['shift']());}}}(a37_0x502c,0x40410));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x5be503){const _0x3d0ce2=await buildSchemaPayload();return{'ok':!![],'data':_0x3d0ce2};}function a37_0x2940(_0x2f89ee,_0x54bde0){_0x2f89ee=_0x2f89ee-0x10c;const _0x502c62=a37_0x502c();let _0x29400a=_0x502c62[_0x2f89ee];return _0x29400a;}export const schemaDefinition={'service':a37_0x13596a(0x10c),'command':a37_0x13596a(0x113),'description':a37_0x13596a(0x112),'risk':a37_0x13596a(0x111),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x21cb5b,_0x4d89ba){const _0x1b2478=a38_0x2f17,_0x385d6e=_0x21cb5b();while(!![]){try{const _0x4380fe=parseInt(_0x1b2478(0xb9))/0x1*(parseInt(_0x1b2478(0xf2))/0x2)+parseInt(_0x1b2478(0xd5))/0x3*(-parseInt(_0x1b2478(0xd7))/0x4)+parseInt(_0x1b2478(0xc6))/0x5+parseInt(_0x1b2478(0xba))/0x6*(-parseInt(_0x1b2478(0xa5))/0x7)+-parseInt(_0x1b2478(0xa9))/0x8*(-parseInt(_0x1b2478(0xa7))/0x9)+parseInt(_0x1b2478(0xf9))/0xa*(parseInt(_0x1b2478(0xda))/0xb)+parseInt(_0x1b2478(0xed))/0xc*(-parseInt(_0x1b2478(0xa4))/0xd);if(_0x4380fe===_0x4d89ba)break;else _0x385d6e['push'](_0x385d6e['shift']());}catch(_0x43e995){_0x385d6e['push'](_0x385d6e['shift']());}}}(a38_0x23b8,0xaa8d0));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(_0x2f550e,_0x1f7d89){const _0x4bf717=a38_0x2f17,_0x1c75d1=listLocalServiceTrees();let _0x41fdee;for(const _0x5e9cc1 of _0x1c75d1){const _0x489c24=matchServiceTreeCommand(_0x5e9cc1,_0x2f550e);if(!_0x489c24)continue;(!_0x41fdee||_0x489c24[_0x4bf717(0xfa)][_0x4bf717(0xea)][_0x4bf717(0xcc)]>_0x41fdee[_0x4bf717(0xfa)]['fullPath'][_0x4bf717(0xcc)])&&(_0x41fdee={'tree':_0x5e9cc1,'command':_0x489c24['command'],'remainingArgs':_0x489c24[_0x4bf717(0xce)]});}if(!_0x41fdee)return undefined;const _0x17110f={..._0x1f7d89};return applyAppBinding(_0x41fdee[_0x4bf717(0x105)],_0x41fdee[_0x4bf717(0xfa)],_0x17110f),{'definition':buildDynamicCommandDefinition(_0x41fdee['tree'],_0x41fdee[_0x4bf717(0xfa)]),'args':_0x41fdee[_0x4bf717(0xce)],'flags':_0x17110f,'tree':_0x41fdee[_0x4bf717(0x105)],'command':_0x41fdee[_0x4bf717(0xfa)]};}export function generateDynamicServiceHelp(_0x4e6d02){const _0x5500d5=a38_0x2f17,_0x55bb18=listLocalServiceTrees()[_0x5500d5(0xe8)](_0x45ad9a=>_0x45ad9a[_0x5500d5(0xcd)][_0x5500d5(0xab)]===_0x4e6d02);if(!_0x55bb18)return undefined;const _0x4dbd4a=[CLI_BIN_NAME+'\x20'+_0x4e6d02+_0x5500d5(0x102),'',_0x55bb18['service']['name']||_0x4e6d02,_0x55bb18[_0x5500d5(0xcd)]['description']?'\x20\x20'+_0x55bb18['service'][_0x5500d5(0xa3)]:'','',_0x5500d5(0xae),..._0x55bb18[_0x5500d5(0x106)][_0x5500d5(0xc9)](_0x4684ff=>{const _0x40344e=_0x5500d5,_0x26266=_0x4684ff[_0x40344e(0xea)][_0x40344e(0xd3)](0x1)[_0x40344e(0xaa)]('\x20'),_0x4e324c=_0x4684ff[_0x40344e(0xef)]===_0x40344e(0x109)?'':'\x20['+_0x4684ff[_0x40344e(0xef)]+']';return'\x20\x20'+_0x26266[_0x40344e(0xd1)](0x18)+'\x20'+(_0x4684ff['description']||'')+_0x4e324c;}),'',_0x5500d5(0xe7)+CLI_BIN_NAME+_0x5500d5(0x104)+_0x4e6d02+_0x5500d5(0x10b)][_0x5500d5(0xbc)](Boolean);return _0x4dbd4a['join']('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0x190236=>{const _0x5b6528=a38_0x2f17,_0x498c99=_0x190236['normalizedManifest'];return{'service':_0x498c99[_0x5b6528(0xcd)][_0x5b6528(0xab)],'label':_0x498c99[_0x5b6528(0xcd)]['name']||_0x498c99[_0x5b6528(0xcd)]['code'],'commands':_0x498c99[_0x5b6528(0x106)]['map'](_0x1286da=>({'command':dynamicCommandName(_0x1286da),'description':_0x1286da[_0x5b6528(0xa3)]||'Run\x20service\x20command\x20'+_0x1286da[_0x5b6528(0xe9)],'tag':riskTag(_0x1286da[_0x5b6528(0xef)])}))};});}export function getDynamicServiceEntry(_0x5ba19c){return listDynamicServiceEntries()['find'](_0x490a03=>_0x490a03['service']===_0x5ba19c);}export function listDynamicServiceDefinitions(_0x1adf0c){const _0x530135=a38_0x2f17;return listLocalServiceTrees()['filter'](_0x269af0=>!_0x1adf0c||_0x269af0[_0x530135(0xcd)][_0x530135(0xab)]===_0x1adf0c)['flatMap'](_0x297305=>_0x297305[_0x530135(0x106)][_0x530135(0xc9)](_0xa2e80d=>buildDynamicCommandDefinition(_0x297305,_0xa2e80d)));}export function getDynamicServiceDefinitions(_0x2949f6){const _0x3f1b4e=listDynamicServiceDefinitions(_0x2949f6);return _0x3f1b4e['length']>0x0?_0x3f1b4e:undefined;}export function findDynamicServiceDefinition(_0x171301,_0x863651){const _0x56f666=a38_0x2f17;return listDynamicServiceDefinitions(_0x171301)[_0x56f666(0xe8)](_0x4ec8c0=>_0x4ec8c0[_0x56f666(0xfa)]===_0x863651);}export function buildDynamicCommandDefinition(_0x270aa5,_0x10cfb3){const _0x453253=a38_0x2f17;return{'service':_0x270aa5[_0x453253(0xcd)][_0x453253(0xab)],'command':dynamicCommandName(_0x10cfb3),'description':_0x10cfb3[_0x453253(0xa3)]||_0x453253(0xd0)+_0x10cfb3[_0x453253(0xe9)],'risk':_0x10cfb3[_0x453253(0xef)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x10cfb3[_0x453253(0xb4)][_0x453253(0xc9)](_0x420192=>({'name':_0x420192[_0x453253(0xb3)],'description':_0x420192[_0x453253(0xa3)]||_0x420192[_0x453253(0xb3)],'required':_0x420192[_0x453253(0xd8)]})),'flags':_0x10cfb3['flags'][_0x453253(0xc9)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x10cfb3),async 'dryRun'(_0x31fa68){const _0x3c56c2=_0x453253,_0x395c90=await compilePlan(_0x10cfb3,_0x31fa68);return{'method':_0x3c56c2(0xf6),'url':_0x10cfb3[_0x3c56c2(0xe9)],'body':{'target':targetPreview(_0x395c90),'params':_0x395c90['params']},'description':_0x3c56c2(0xc0)+_0x10cfb3[_0x3c56c2(0xe9)]};},async 'execute'(_0x366977){const _0x1c3ea6=_0x453253,_0x15791a=await compilePlan(_0x10cfb3,_0x366977),_0x22a439=Date[_0x1c3ea6(0xf1)](),_0xabf23a=await executePlan(_0x15791a,_0x10cfb3,_0x366977),_0x4ccb00=Date[_0x1c3ea6(0xf1)]()-_0x22a439;return{'ok':!![],'data':{'service':_0x270aa5[_0x1c3ea6(0xcd)],'command':_0x10cfb3['cliPath'],'target':targetPreview(_0x15791a),'result':_0xabf23a,'elapsed':_0x4ccb00},'message':_0x1c3ea6(0x101)+_0x10cfb3[_0x1c3ea6(0xe9)]+_0x1c3ea6(0xc3)+_0x4ccb00+'ms'};}};}function dynamicCommandName(_0xc68cc8){const _0xd29607=a38_0x2f17;return _0xc68cc8['fullPath'][_0xd29607(0xd3)](0x1)[_0xd29607(0xaa)]('\x20');}function riskTag(_0x1b1249){const _0x3330c3=a38_0x2f17;return _0x1b1249===_0x3330c3(0x109)?'':'\x20\x20['+_0x1b1249+']';}function a38_0x2f17(_0x523369,_0x361334){_0x523369=_0x523369-0xa2;const _0x23b8b0=a38_0x23b8();let _0x2f1741=_0x23b8b0[_0x523369];return _0x2f1741;}function flagToCommandFlag(_0x2fabe2){const _0x2d8865=a38_0x2f17;return{'name':_0x2fabe2[_0x2d8865(0xc2)],'type':_0x2fabe2[_0x2d8865(0xb1)]===_0x2d8865(0xb5)?_0x2d8865(0xb8):_0x2fabe2['type'],'description':_0x2fabe2[_0x2d8865(0xa3)]||_0x2fabe2[_0x2d8865(0xb3)],'required':_0x2fabe2['required'],'default':isPrimitiveFlagDefault(_0x2fabe2['default'])?_0x2fabe2[_0x2d8865(0xca)]:undefined,'enum':_0x2fabe2['enum']};}function a38_0x23b8(){const _0x1312db=['nickname','now','2xhrWLF','\x20\x20\x20\x20sqlCode:\x20','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20\x20MAP\x20TO','SERVICE_TREE','kind','validation','200wQeLgr','command','userName','employeeId','nickName','username','env','rawFlags','Service\x20command\x20','\x20<command>\x20[flags]','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x20service\x20detail\x20--service\x20','tree','commands','target','\x20\x20\x20\x20kind:\x20\x20\x20\x20','read','\x20\x20SERVICE\x20TREE\x20TARGET','`\x20to\x20inspect\x20the\x20manifest.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','description','169xAiyUK','259OhlbwE','trim','9POIphj','dbtableConfig','475352fIAYEG','join','code','boolean','appRef','Commands:','mapTo','userId','type','data','name','args','json','datasetCode','sql','string','340369McrhtE','6078Nywqca','scriptName','filter','params','startsWith','bff','Preview\x20dynamic\x20service\x20command:\x20','\x20->\x20','cliName','\x20completed\x20in\x20','sqlCode','bffCode','2298585FHQaNR','\x20requires\x20target.functionName.','push','map','default','\x22\x20in\x20service\x20command\x20','length','service','remainingArgs','datatable','Run\x20service\x20command\x20','padEnd','envName','slice','bffId','1342443MCStSO','number','4stvYVY','required','\x20\x20\x20\x20datasetCode:\x20','544577KKKnbD','operator','const','\x20requires\x20target.sqlCode.','Cannot\x20resolve\x20datatable\x20\x22','appBindings','source','Unknown\x20appRef\x20\x22','tenantCode','appcode','tableName','Unsupported\x20service\x20target\x20kind:\x20','appCode','Use\x20`','find','cliPath','fullPath','app','ctx.','614868otoCUO','\x20\x20\x20\x20','risk'];a38_0x23b8=function(){return _0x1312db;};return a38_0x23b8();}async function compilePlan(_0x23c9e0,_0x5ba310){const _0x238974=a38_0x2f17;return compileServiceTreeCommand(_0x23c9e0,{'flags':_0x5ba310[_0x238974(0x100)],'args':_0x5ba310[_0x238974(0xb4)],'context':await buildServiceContext(_0x23c9e0,_0x5ba310)});}async function buildServiceContext(_0x4bfd4c,_0x45f83a){const _0x583bca=a38_0x2f17,_0x2066e6={'appCode':_0x45f83a[_0x583bca(0xe6)],'env':_0x45f83a[_0x583bca(0xd2)],'envName':_0x45f83a['envName']};if(!usesRuntimeContext(_0x4bfd4c))return _0x2066e6;const _0x12ce7f=await getLoginUserInfo(),_0x4f1f11=pickFirst(_0x12ce7f[_0x583bca(0xb0)],_0x12ce7f['id']);return{..._0x2066e6,'user':_0x12ce7f,'userId':_0x4f1f11,'id':_0x12ce7f['id'],'username':pickFirst(_0x12ce7f[_0x583bca(0xfe)],_0x12ce7f[_0x583bca(0xfb)],_0x12ce7f['loginName']),'userName':_0x12ce7f[_0x583bca(0xfb)],'nickname':pickFirst(_0x12ce7f[_0x583bca(0xf0)],_0x12ce7f[_0x583bca(0xfd)]),'nickName':_0x12ce7f[_0x583bca(0xfd)],'tenantCode':_0x12ce7f[_0x583bca(0xe2)],'employeeId':_0x12ce7f[_0x583bca(0xfc)]};}function usesRuntimeContext(_0x13033d){const _0x36b054=a38_0x2f17;return _0x13033d[_0x36b054(0xaf)]['some'](_0x206698=>typeof _0x206698[_0x36b054(0xe0)]===_0x36b054(0xb8)&&(_0x206698[_0x36b054(0xe0)][_0x36b054(0xbe)]('context.')||_0x206698[_0x36b054(0xe0)][_0x36b054(0xbe)](_0x36b054(0xec))));}function pickFirst(..._0x2554a6){const _0x29d801=a38_0x2f17;return _0x2554a6[_0x29d801(0xe8)](_0x2ac18d=>_0x2ac18d!==undefined&&_0x2ac18d!==null);}async function executePlan(_0x3df2a2,_0x5572e8,_0x5b1f4f){const _0x2d27d0=a38_0x2f17;if(_0x3df2a2['kind']===_0x2d27d0(0xb2)){const _0x4b249e=await resolveDatasetCode(_0x3df2a2,_0x5572e8,_0x5b1f4f);return executeData(_0x4b249e,_0x3df2a2[_0x2d27d0(0xfa)],_0x3df2a2['params']);}if(_0x3df2a2['kind']===_0x2d27d0(0xb7)){if(!_0x3df2a2[_0x2d27d0(0xc4)])throw CliErrors[_0x2d27d0(0xf8)](_0x2d27d0(0x101)+_0x5572e8['cliPath']+_0x2d27d0(0xdd));return executeSdkSql(_0x3df2a2[_0x2d27d0(0xc4)],normalizeScalarParams(_0x3df2a2[_0x2d27d0(0xbd)]));}if(_0x3df2a2[_0x2d27d0(0xf7)]===_0x2d27d0(0xbf)){const _0x493438=_0x3df2a2[_0x2d27d0(0xbb)]||_0x3df2a2[_0x2d27d0(0xc5)]||(_0x3df2a2[_0x2d27d0(0xd4)]==null?'':String(_0x3df2a2[_0x2d27d0(0xd4)]));if(!_0x493438)throw CliErrors[_0x2d27d0(0xf8)]('Service\x20command\x20'+_0x5572e8[_0x2d27d0(0xe9)]+_0x2d27d0(0xc7));return executeSdkBff(_0x493438,_0x3df2a2[_0x2d27d0(0xbd)]);}throw CliErrors[_0x2d27d0(0xf8)](_0x2d27d0(0xe5)+_0x3df2a2[_0x2d27d0(0xf7)]);}async function resolveDatasetCode(_0x4fdc2a,_0x4d1f04,_0x1dbf6b){const _0x5ee96c=a38_0x2f17;if(_0x4fdc2a[_0x5ee96c(0xb6)])return _0x4fdc2a[_0x5ee96c(0xb6)];if(!_0x4fdc2a[_0x5ee96c(0xcf)])throw CliErrors['validation'](_0x5ee96c(0x101)+_0x4d1f04[_0x5ee96c(0xe9)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x1e4599=await listDatasets(_0x1dbf6b[_0x5ee96c(0xe6)]),_0x267d1e=_0x1e4599[_0x5ee96c(0xe8)](_0x34dfaa=>_0x34dfaa[_0x5ee96c(0xa8)]?.[_0x5ee96c(0xe4)]===_0x4fdc2a['datatable']);if(!_0x267d1e?.['code'])throw CliErrors[_0x5ee96c(0xf8)](_0x5ee96c(0xde)+_0x4fdc2a[_0x5ee96c(0xcf)]+_0x5ee96c(0xf4)+_0x1dbf6b['appCode']+'.',_0x5ee96c(0x103));return _0x267d1e[_0x5ee96c(0xab)];}function applyAppBinding(_0x5c7c27,_0x3f3b5c,_0xbec9e){const _0xcd8ef=a38_0x2f17,_0x2aa6ea=_0x3f3b5c[_0xcd8ef(0x107)][_0xcd8ef(0xad)];if(!_0x2aa6ea)return;const _0x2e4add=_0x5c7c27[_0xcd8ef(0xdf)][_0x2aa6ea];if(!_0x2e4add)throw CliErrors[_0xcd8ef(0xf8)](_0xcd8ef(0xe1)+_0x2aa6ea+_0xcd8ef(0xcb)+_0x3f3b5c[_0xcd8ef(0xe9)]+'.',_0xcd8ef(0xa2));const _0x55a549=_0x2e4add[_0xcd8ef(0xe3)]||_0x2e4add['appCode'];_0x55a549&&!hasText(_0xbec9e[_0xcd8ef(0xe3)])&&(_0xbec9e[_0xcd8ef(0xe3)]=_0x55a549),_0x2e4add['app']&&!hasText(_0xbec9e[_0xcd8ef(0xeb)])&&!hasText(_0xbec9e[_0xcd8ef(0xe3)])&&(_0xbec9e[_0xcd8ef(0xeb)]=_0x2e4add[_0xcd8ef(0xeb)]),_0x2e4add[_0xcd8ef(0xff)]&&!hasText(_0xbec9e['env'])&&(_0xbec9e[_0xcd8ef(0xff)]=_0x2e4add['env']);}function renderDynamicCommandHelp(_0x50cb1d){const _0x1f69d1=a38_0x2f17,_0x21ab93=[_0x1f69d1(0x10a),_0x1f69d1(0x108)+_0x50cb1d[_0x1f69d1(0x107)]['kind'],'\x20\x20\x20\x20command:\x20'+_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xfa)]];if(_0x50cb1d['target'][_0x1f69d1(0xb6)])_0x21ab93['push'](_0x1f69d1(0xd9)+_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xb6)]);if(_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xcf)])_0x21ab93[_0x1f69d1(0xc8)]('\x20\x20\x20\x20datatable:\x20'+_0x50cb1d['target']['datatable']);if(_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xc4)])_0x21ab93['push'](_0x1f69d1(0xf3)+_0x50cb1d[_0x1f69d1(0x107)]['sqlCode']);if(_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xbb)])_0x21ab93[_0x1f69d1(0xc8)]('\x20\x20\x20\x20functionName:\x20'+_0x50cb1d[_0x1f69d1(0x107)][_0x1f69d1(0xbb)]);if(_0x50cb1d[_0x1f69d1(0xaf)][_0x1f69d1(0xcc)]>0x0){_0x21ab93[_0x1f69d1(0xc8)]('',_0x1f69d1(0xf5));for(const _0xa59be4 of _0x50cb1d[_0x1f69d1(0xaf)]){_0x21ab93[_0x1f69d1(0xc8)](_0x1f69d1(0xee)+(_0xa59be4[_0x1f69d1(0xe0)]||_0x1f69d1(0xdc))+_0x1f69d1(0xc1)+_0xa59be4[_0x1f69d1(0x107)]+(_0xa59be4['operator']?'.'+_0xa59be4[_0x1f69d1(0xdb)]:''));}}return _0x21ab93[_0x1f69d1(0xaa)]('\x0a');}function targetPreview(_0x7d4f96){const _0x389b38=a38_0x2f17;return{'kind':_0x7d4f96[_0x389b38(0xf7)],'command':_0x7d4f96[_0x389b38(0xfa)],'appRef':_0x7d4f96[_0x389b38(0xad)],'datasetCode':_0x7d4f96[_0x389b38(0xb6)],'datatable':_0x7d4f96['datatable'],'sqlCode':_0x7d4f96[_0x389b38(0xc4)],'bffCode':_0x7d4f96['bffCode'],'bffId':_0x7d4f96['bffId'],'functionName':_0x7d4f96[_0x389b38(0xbb)]};}function normalizeScalarParams(_0x576f57){const _0x2dabe1=a38_0x2f17;return Object['fromEntries'](Object['entries'](_0x576f57)[_0x2dabe1(0xbc)](([,_0x25772c])=>typeof _0x25772c===_0x2dabe1(0xb8)||typeof _0x25772c===_0x2dabe1(0xd6)));}function hasText(_0xfad37b){const _0x12fe26=a38_0x2f17;return typeof _0xfad37b==='string'&&_0xfad37b[_0x12fe26(0xa6)]()[_0x12fe26(0xcc)]>0x0;}function isPrimitiveFlagDefault(_0x3c3720){const _0x21fbb2=a38_0x2f17;return _0x3c3720===undefined||typeof _0x3c3720===_0x21fbb2(0xb8)||typeof _0x3c3720==='number'||typeof _0x3c3720===_0x21fbb2(0xac);}
|
|
1
|
+
(function(_0x679ab0,_0x1f0c9d){const _0x1556ae=a38_0x21f6,_0xbf6741=_0x679ab0();while(!![]){try{const _0x3a466a=-parseInt(_0x1556ae(0x1eb))/0x1*(parseInt(_0x1556ae(0x217))/0x2)+-parseInt(_0x1556ae(0x20c))/0x3+parseInt(_0x1556ae(0x1f8))/0x4+-parseInt(_0x1556ae(0x1ed))/0x5*(parseInt(_0x1556ae(0x1cf))/0x6)+-parseInt(_0x1556ae(0x1db))/0x7+parseInt(_0x1556ae(0x222))/0x8*(-parseInt(_0x1556ae(0x20e))/0x9)+parseInt(_0x1556ae(0x225))/0xa*(parseInt(_0x1556ae(0x228))/0xb);if(_0x3a466a===_0x1f0c9d)break;else _0xbf6741['push'](_0xbf6741['shift']());}catch(_0xcd3311){_0xbf6741['push'](_0xbf6741['shift']());}}}(a38_0x2cc1,0xd2ede));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_0x21f6(_0x30e97c,_0x54021e){_0x30e97c=_0x30e97c-0x1c7;const _0x2cc129=a38_0x2cc1();let _0x21f6b5=_0x2cc129[_0x30e97c];return _0x21f6b5;}import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x1cb315,_0x449292){const _0x65d082=a38_0x21f6,_0x13cfd2=listLocalServiceTrees();let _0x19b9dc;for(const _0x43d643 of _0x13cfd2){const _0x1dd364=matchServiceTreeCommand(_0x43d643,_0x1cb315);if(!_0x1dd364)continue;(!_0x19b9dc||_0x1dd364['command'][_0x65d082(0x20b)][_0x65d082(0x1f7)]>_0x19b9dc['command']['fullPath'][_0x65d082(0x1f7)])&&(_0x19b9dc={'tree':_0x43d643,'command':_0x1dd364[_0x65d082(0x1cd)],'remainingArgs':_0x1dd364[_0x65d082(0x1e2)]});}if(!_0x19b9dc)return undefined;const _0x6fe870={..._0x449292};return applyAppBinding(_0x19b9dc['tree'],_0x19b9dc[_0x65d082(0x1cd)],_0x6fe870),{'definition':buildDynamicCommandDefinition(_0x19b9dc[_0x65d082(0x227)],_0x19b9dc[_0x65d082(0x1cd)]),'args':_0x19b9dc[_0x65d082(0x1e2)],'flags':_0x6fe870,'tree':_0x19b9dc[_0x65d082(0x227)],'command':_0x19b9dc[_0x65d082(0x1cd)]};}export function generateDynamicServiceHelp(_0x5e0d91){const _0x87b526=a38_0x21f6,_0x377216=listLocalServiceTrees()['find'](_0x5e9832=>_0x5e9832['service'][_0x87b526(0x1d7)]===_0x5e0d91);if(!_0x377216)return undefined;const _0x57b51a=[CLI_BIN_NAME+'\x20'+_0x5e0d91+'\x20<command>\x20[flags]','',_0x377216[_0x87b526(0x200)]['name']||_0x5e0d91,_0x377216['service'][_0x87b526(0x1dd)]?'\x20\x20'+_0x377216[_0x87b526(0x200)][_0x87b526(0x1dd)]:'','',_0x87b526(0x203),..._0x377216[_0x87b526(0x1e6)][_0x87b526(0x21a)](_0x44cd0c=>{const _0x208db2=_0x87b526,_0x15a50a=_0x44cd0c[_0x208db2(0x20b)][_0x208db2(0x208)](0x1)[_0x208db2(0x1fd)]('\x20'),_0xd48611=_0x44cd0c[_0x208db2(0x219)]===_0x208db2(0x1d1)?'':'\x20['+_0x44cd0c['risk']+']';return'\x20\x20'+_0x15a50a[_0x208db2(0x215)](0x18)+'\x20'+(_0x44cd0c[_0x208db2(0x1dd)]||'')+_0xd48611;}),'',_0x87b526(0x207)+CLI_BIN_NAME+_0x87b526(0x1fe)+_0x5e0d91+_0x87b526(0x1ca)][_0x87b526(0x223)](Boolean);return _0x57b51a[_0x87b526(0x1fd)]('\x0a');}export function listDynamicServiceEntries(){return listLocalServices()['map'](_0xf5e2f1=>{const _0x1352bd=a38_0x21f6,_0x1aa29a=_0xf5e2f1['normalizedManifest'];return{'service':_0x1aa29a[_0x1352bd(0x200)][_0x1352bd(0x1d7)],'label':_0x1aa29a['service'][_0x1352bd(0x212)]||_0x1aa29a[_0x1352bd(0x200)][_0x1352bd(0x1d7)],'commands':_0x1aa29a['commands'][_0x1352bd(0x21a)](_0xea2bd1=>({'command':dynamicCommandName(_0xea2bd1),'description':_0xea2bd1['description']||'Run\x20service\x20command\x20'+_0xea2bd1['cliPath'],'tag':riskTag(_0xea2bd1['risk'])}))};});}export function getDynamicServiceEntry(_0x4a0e99){const _0x568211=a38_0x21f6;return listDynamicServiceEntries()[_0x568211(0x1cc)](_0x4eb43c=>_0x4eb43c['service']===_0x4a0e99);}export function listDynamicServiceDefinitions(_0x2b269d){const _0x39ef09=a38_0x21f6;return listLocalServiceTrees()[_0x39ef09(0x223)](_0x685023=>!_0x2b269d||_0x685023[_0x39ef09(0x200)][_0x39ef09(0x1d7)]===_0x2b269d)[_0x39ef09(0x1d4)](_0x1a9521=>_0x1a9521['commands']['map'](_0x44d26c=>buildDynamicCommandDefinition(_0x1a9521,_0x44d26c)));}export function getDynamicServiceDefinitions(_0x5cad48){const _0x554871=a38_0x21f6,_0x331211=listDynamicServiceDefinitions(_0x5cad48);return _0x331211[_0x554871(0x1f7)]>0x0?_0x331211:undefined;}export function findDynamicServiceDefinition(_0x1ab8f9,_0x6c949){const _0x51e1f8=a38_0x21f6;return listDynamicServiceDefinitions(_0x1ab8f9)[_0x51e1f8(0x1cc)](_0x1bb5df=>_0x1bb5df[_0x51e1f8(0x1cd)]===_0x6c949);}export function buildDynamicCommandDefinition(_0x18ab9a,_0xb6c735){const _0x340278=a38_0x21f6;return{'service':_0x18ab9a['service'][_0x340278(0x1d7)],'command':dynamicCommandName(_0xb6c735),'description':_0xb6c735['description']||_0x340278(0x1c8)+_0xb6c735['cliPath'],'risk':_0xb6c735[_0x340278(0x219)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0xb6c735[_0x340278(0x21b)][_0x340278(0x21a)](_0x27067a=>({'name':_0x27067a[_0x340278(0x212)],'description':_0x27067a[_0x340278(0x1dd)]||_0x27067a[_0x340278(0x212)],'required':_0x27067a['required']})),'flags':_0xb6c735['flags'][_0x340278(0x21a)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0xb6c735),async 'dryRun'(_0x26cbf0){const _0x2b98b6=_0x340278,_0x5825d5=await compilePlan(_0xb6c735,_0x26cbf0);return{'method':_0x2b98b6(0x213),'url':_0xb6c735[_0x2b98b6(0x1c7)],'body':{'target':targetPreview(_0x5825d5),'params':_0x5825d5['params']},'description':_0x2b98b6(0x1f4)+_0xb6c735[_0x2b98b6(0x1c7)]};},async 'execute'(_0x36fc92){const _0x30bb54=_0x340278,_0x5455f2=await compilePlan(_0xb6c735,_0x36fc92),_0x26f99c=Date['now'](),_0x1f90ee=await executePlan(_0x5455f2,_0xb6c735,_0x36fc92),_0x514e57=Date[_0x30bb54(0x220)]()-_0x26f99c;return{'ok':!![],'data':{'service':_0x18ab9a[_0x30bb54(0x200)],'command':_0xb6c735[_0x30bb54(0x1c7)],'target':targetPreview(_0x5455f2),'result':_0x1f90ee,'elapsed':_0x514e57},'message':'Service\x20command\x20'+_0xb6c735[_0x30bb54(0x1c7)]+_0x30bb54(0x1d9)+_0x514e57+'ms'};}};}function dynamicCommandName(_0xcf195b){const _0x54ca7f=a38_0x21f6;return _0xcf195b[_0x54ca7f(0x20b)][_0x54ca7f(0x208)](0x1)['join']('\x20');}function riskTag(_0x34cd38){return _0x34cd38==='read'?'':'\x20\x20['+_0x34cd38+']';}function flagToCommandFlag(_0x2e0960){const _0x5f33d2=a38_0x21f6;return{'name':_0x2e0960[_0x5f33d2(0x21e)],'type':_0x2e0960['type']===_0x5f33d2(0x218)?_0x5f33d2(0x1f9):_0x2e0960['type'],'description':_0x2e0960[_0x5f33d2(0x1dd)]||_0x2e0960[_0x5f33d2(0x212)],'required':_0x2e0960[_0x5f33d2(0x226)],'default':isPrimitiveFlagDefault(_0x2e0960[_0x5f33d2(0x1fc)])?_0x2e0960[_0x5f33d2(0x1fc)]:undefined,'enum':_0x2e0960[_0x5f33d2(0x1ea)]};}async function compilePlan(_0x326bbf,_0xf942b6){const _0x30f474=a38_0x21f6;return compileServiceTreeCommand(_0x326bbf,{'flags':_0xf942b6[_0x30f474(0x1d3)],'args':_0xf942b6[_0x30f474(0x21b)],'context':await buildServiceContext(_0x326bbf,_0xf942b6)});}async function buildServiceContext(_0x38df47,_0x3b8b00){const _0x4b7d05=a38_0x21f6,_0x37581a={'appCode':_0x3b8b00[_0x4b7d05(0x201)],'env':_0x3b8b00[_0x4b7d05(0x1d5)],'envName':_0x3b8b00[_0x4b7d05(0x1d5)]};if(!usesRuntimeContext(_0x38df47))return _0x37581a;const _0x194670=await getLoginUserInfo(),_0x1b5d9b=pickFirst(_0x194670['userId'],_0x194670['id']);return{..._0x37581a,'user':_0x194670,'userId':_0x1b5d9b,'id':_0x194670['id'],'username':pickFirst(_0x194670[_0x4b7d05(0x20d)],_0x194670[_0x4b7d05(0x20f)],_0x194670[_0x4b7d05(0x216)]),'userName':_0x194670[_0x4b7d05(0x20f)],'nickname':pickFirst(_0x194670[_0x4b7d05(0x1fb)],_0x194670['nickName']),'nickName':_0x194670['nickName'],'tenantCode':_0x194670['tenantCode'],'employeeId':_0x194670['employeeId']};}function usesRuntimeContext(_0x4c48bf){const _0x15344c=a38_0x21f6;return _0x4c48bf['mapTo'][_0x15344c(0x1e4)](_0x28551e=>typeof _0x28551e['source']==='string'&&(_0x28551e['source'][_0x15344c(0x1d6)](_0x15344c(0x1f2))||_0x28551e[_0x15344c(0x221)]['startsWith'](_0x15344c(0x1ee))));}function pickFirst(..._0x1980fd){const _0x214a31=a38_0x21f6;return _0x1980fd[_0x214a31(0x1cc)](_0xa45cf2=>_0xa45cf2!==undefined&&_0xa45cf2!==null);}async function executePlan(_0x15060d,_0x564a99,_0x55b32b){const _0x4466a5=a38_0x21f6;if(_0x15060d[_0x4466a5(0x1e8)]==='data'){const _0x1c1728=await resolveDatasetCode(_0x15060d,_0x564a99,_0x55b32b);return executeData(_0x1c1728,_0x15060d['command'],_0x15060d[_0x4466a5(0x1d2)]);}if(_0x15060d[_0x4466a5(0x1e8)]===_0x4466a5(0x202)){if(!_0x15060d[_0x4466a5(0x1ff)])throw CliErrors['validation'](_0x4466a5(0x1ec)+_0x564a99[_0x4466a5(0x1c7)]+_0x4466a5(0x1d8));return executeSdkSql(_0x15060d[_0x4466a5(0x1ff)],normalizeScalarParams(_0x15060d[_0x4466a5(0x1d2)]));}if(_0x15060d[_0x4466a5(0x1e8)]==='bff'){const _0x22302b=_0x15060d['scriptName']||_0x15060d['bffCode']||(_0x15060d[_0x4466a5(0x204)]==null?'':String(_0x15060d[_0x4466a5(0x204)]));if(!_0x22302b)throw CliErrors[_0x4466a5(0x1f1)](_0x4466a5(0x1ec)+_0x564a99[_0x4466a5(0x1c7)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x22302b,_0x15060d[_0x4466a5(0x1d2)]);}throw CliErrors[_0x4466a5(0x1f1)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x15060d[_0x4466a5(0x1e8)]);}async function resolveDatasetCode(_0x1e9317,_0x30c02a,_0x5eb308){const _0x128e65=a38_0x21f6;if(_0x1e9317[_0x128e65(0x214)])return _0x1e9317['datasetCode'];if(!_0x1e9317[_0x128e65(0x1ef)])throw CliErrors[_0x128e65(0x1f1)](_0x128e65(0x1ec)+_0x30c02a[_0x128e65(0x1c7)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x171dd1=await listDatasets(_0x5eb308[_0x128e65(0x201)]),_0x513764=_0x171dd1[_0x128e65(0x1cc)](_0xf419dd=>_0xf419dd[_0x128e65(0x209)]?.[_0x128e65(0x21f)]===_0x1e9317[_0x128e65(0x1ef)]);if(!_0x513764?.[_0x128e65(0x1d7)])throw CliErrors[_0x128e65(0x1f1)](_0x128e65(0x229)+_0x1e9317['datatable']+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x5eb308['appCode']+'.',_0x128e65(0x1e0));return _0x513764[_0x128e65(0x1d7)];}function applyAppBinding(_0x4b5309,_0xc4dcdc,_0x35bbf3){const _0x4184cb=a38_0x21f6,_0x3c8e51=_0xc4dcdc[_0x4184cb(0x211)][_0x4184cb(0x224)];if(!_0x3c8e51)return;const _0x160edd=_0x4b5309[_0x4184cb(0x1e5)][_0x3c8e51];if(!_0x160edd)throw CliErrors[_0x4184cb(0x1f1)](_0x4184cb(0x1d0)+_0x3c8e51+_0x4184cb(0x20a)+_0xc4dcdc[_0x4184cb(0x1c7)]+'.',_0x4184cb(0x1f3));const _0x5a0438=_0x160edd[_0x4184cb(0x210)]||_0x160edd[_0x4184cb(0x201)];_0x5a0438&&!hasText(_0x35bbf3[_0x4184cb(0x210)])&&(_0x35bbf3[_0x4184cb(0x210)]=_0x5a0438),_0x160edd[_0x4184cb(0x1cb)]&&!hasText(_0x35bbf3[_0x4184cb(0x1cb)])&&!hasText(_0x35bbf3[_0x4184cb(0x210)])&&(_0x35bbf3[_0x4184cb(0x1cb)]=_0x160edd['app']),_0x160edd[_0x4184cb(0x1de)]&&!hasText(_0x35bbf3[_0x4184cb(0x1de)])&&(_0x35bbf3[_0x4184cb(0x1de)]=_0x160edd[_0x4184cb(0x1de)]);}function a38_0x2cc1(){const _0x505e2e=['6RgVVgt','Unknown\x20appRef\x20\x22','read','params','rawFlags','flatMap','envName','startsWith','code','\x20requires\x20target.sqlCode.','\x20completed\x20in\x20','\x20\x20\x20\x20command:\x20','2726941uLiQDs','operator','description','env','\x20\x20\x20\x20kind:\x20\x20\x20\x20','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','trim','remainingArgs','scriptName','some','appBindings','commands','fromEntries','kind','\x20\x20SERVICE\x20TREE\x20TARGET','enum','1YmgrqX','Service\x20command\x20','7660025RQSNEA','ctx.','datatable','\x20\x20\x20\x20datasetCode:\x20','validation','context.','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','Preview\x20dynamic\x20service\x20command:\x20','const','push','length','1427720OfvJQG','string','mapTo','nickname','default','join','\x20service\x20detail\x20--service\x20','sqlCode','service','appCode','sql','Commands:','bffId','\x20\x20\x20\x20functionName:\x20','\x20\x20\x20\x20sqlCode:\x20','Use\x20`','slice','dbtableConfig','\x22\x20in\x20service\x20command\x20','fullPath','3941097NxjZbo','username','3384UmpNrS','userName','appcode','target','name','SERVICE_TREE','datasetCode','padEnd','loginName','2476090QQTzaY','json','risk','map','args','boolean','number','cliName','tableName','now','source','31448BcLOnE','filter','appRef','3399160mXnyar','required','tree','209ShzNWb','Cannot\x20resolve\x20datatable\x20\x22','cliPath','Run\x20service\x20command\x20','\x20\x20\x20\x20datatable:\x20','`\x20to\x20inspect\x20the\x20manifest.','app','find','command','\x20->\x20'];a38_0x2cc1=function(){return _0x505e2e;};return a38_0x2cc1();}function renderDynamicCommandHelp(_0x6af9a2){const _0x3da93b=a38_0x21f6,_0x3ee9f5=[_0x3da93b(0x1e9),_0x3da93b(0x1df)+_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x1e8)],_0x3da93b(0x1da)+_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x1cd)]];if(_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x214)])_0x3ee9f5[_0x3da93b(0x1f6)](_0x3da93b(0x1f0)+_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x214)]);if(_0x6af9a2['target']['datatable'])_0x3ee9f5['push'](_0x3da93b(0x1c9)+_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x1ef)]);if(_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x1ff)])_0x3ee9f5[_0x3da93b(0x1f6)](_0x3da93b(0x206)+_0x6af9a2['target'][_0x3da93b(0x1ff)]);if(_0x6af9a2['target'][_0x3da93b(0x1e3)])_0x3ee9f5[_0x3da93b(0x1f6)](_0x3da93b(0x205)+_0x6af9a2[_0x3da93b(0x211)][_0x3da93b(0x1e3)]);if(_0x6af9a2[_0x3da93b(0x1fa)][_0x3da93b(0x1f7)]>0x0){_0x3ee9f5[_0x3da93b(0x1f6)]('','\x20\x20MAP\x20TO');for(const _0x2c159f of _0x6af9a2['mapTo']){_0x3ee9f5[_0x3da93b(0x1f6)]('\x20\x20\x20\x20'+(_0x2c159f[_0x3da93b(0x221)]||_0x3da93b(0x1f5))+_0x3da93b(0x1ce)+_0x2c159f[_0x3da93b(0x211)]+(_0x2c159f[_0x3da93b(0x1dc)]?'.'+_0x2c159f[_0x3da93b(0x1dc)]:''));}}return _0x3ee9f5[_0x3da93b(0x1fd)]('\x0a');}function targetPreview(_0x4a97b6){const _0x541d08=a38_0x21f6;return{'kind':_0x4a97b6[_0x541d08(0x1e8)],'command':_0x4a97b6[_0x541d08(0x1cd)],'appRef':_0x4a97b6[_0x541d08(0x224)],'datasetCode':_0x4a97b6[_0x541d08(0x214)],'datatable':_0x4a97b6['datatable'],'sqlCode':_0x4a97b6[_0x541d08(0x1ff)],'bffCode':_0x4a97b6['bffCode'],'bffId':_0x4a97b6[_0x541d08(0x204)],'functionName':_0x4a97b6[_0x541d08(0x1e3)]};}function normalizeScalarParams(_0x20d7ce){const _0x56bc22=a38_0x21f6;return Object[_0x56bc22(0x1e7)](Object['entries'](_0x20d7ce)[_0x56bc22(0x223)](([,_0x19782a])=>typeof _0x19782a===_0x56bc22(0x1f9)||typeof _0x19782a===_0x56bc22(0x21d)));}function hasText(_0x44d021){const _0x3591d5=a38_0x21f6;return typeof _0x44d021===_0x3591d5(0x1f9)&&_0x44d021[_0x3591d5(0x1e1)]()[_0x3591d5(0x1f7)]>0x0;}function isPrimitiveFlagDefault(_0x2ff1ec){const _0x5c126e=a38_0x21f6;return _0x2ff1ec===undefined||typeof _0x2ff1ec===_0x5c126e(0x1f9)||typeof _0x2ff1ec==='number'||typeof _0x2ff1ec===_0x5c126e(0x21c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e7fe3,_0x10f9de){const _0x44280e=a39_0x15a9,_0xab9e25=_0x3e7fe3();while(!![]){try{const _0xd2f424=parseInt(_0x44280e(0x95))/0x1+parseInt(_0x44280e(0xa6))/0x2+parseInt(_0x44280e(0xab))/0x3*(-parseInt(_0x44280e(0xa1))/0x4)+-parseInt(_0x44280e(0xad))/0x5+-parseInt(_0x44280e(0xa7))/0x6+parseInt(_0x44280e(0xa9))/0x7+-parseInt(_0x44280e(0x9b))/0x8;if(_0xd2f424===_0x10f9de)break;else _0xab9e25['push'](_0xab9e25['shift']());}catch(_0x21faa){_0xab9e25['push'](_0xab9e25['shift']());}}}(a39_0x125c,0xb95d7));export function adaptServiceTreeManifestForLegacyFramework(_0x253f99){const _0x324873=a39_0x15a9,_0x533ab8=cloneJsonValue(_0x253f99),_0x473094=[];if(!isObjectRecord(_0x533ab8))return{'manifest':_0x533ab8,'errors':_0x473094};return Array['isArray'](_0x533ab8[_0x324873(0xa2)])&&_0x533ab8[_0x324873(0xa2)][_0x324873(0xac)]((_0x9b153f,_0xafc337)=>{const _0x2fc259=_0x324873;if(!isObjectRecord(_0x9b153f))return;adaptBffTarget(_0x9b153f[_0x2fc259(0xb2)],'$.commands['+_0xafc337+_0x2fc259(0xaa),_0x473094);}),adaptResources(_0x533ab8[_0x324873(0xae)],_0x324873(0xb3),_0x473094),{'manifest':_0x533ab8,'errors':_0x473094};}function a39_0x15a9(_0x43691a,_0x2387b0){_0x43691a=_0x43691a-0x91;const _0x125c32=a39_0x125c();let _0x15a9c5=_0x125c32[_0x43691a];return _0x15a9c5;}export function toPublicServiceTreeTarget(_0x139c92){const _0x48b3e1=a39_0x15a9,{scriptName:_0x47aab5,..._0x214762}=_0x139c92;return typeof _0x47aab5===_0x48b3e1(0x92)&&_0x47aab5[_0x48b3e1(0xaf)]()&&(_0x214762[_0x48b3e1(0x9d)]=_0x47aab5),_0x214762;}export function toPublicNormalizedServiceTree(_0x1f0aa8){const _0x52c9ae=a39_0x15a9;return{..._0x1f0aa8,'commands':_0x1f0aa8[_0x52c9ae(0xa2)][_0x52c9ae(0x97)](_0x37a85a=>({..._0x37a85a,'target':toPublicServiceTreeTarget(_0x37a85a['target'])}))};}function adaptResources(_0x2ee2da,_0xbc14e4,_0x49980e){const _0x81a9b9=a39_0x15a9;if(!isObjectRecord(_0x2ee2da))return;for(const [_0x412a9,_0x130667]of Object['entries'](_0x2ee2da)){if(!isObjectRecord(_0x130667))continue;const _0x420229=_0xbc14e4+'.'+_0x412a9;if(isObjectRecord(_0x130667[_0x81a9b9(0xb0)]))for(const [_0x328c18,_0x3fbd9f]of Object['entries'](_0x130667[_0x81a9b9(0xb0)])){if(!isObjectRecord(_0x3fbd9f))continue;const _0x448ec3=_0x420229+_0x81a9b9(0x98)+_0x328c18,_0x39a8f9=isObjectRecord(_0x3fbd9f[_0x81a9b9(0xb2)])&&_0x3fbd9f[_0x81a9b9(0xb2)][_0x81a9b9(0x99)]===_0x81a9b9(0x9e);adaptBffTarget(_0x3fbd9f[_0x81a9b9(0xb2)],_0x448ec3+'.target',_0x49980e),(_0x39a8f9||isBffAction(_0x3fbd9f))&&adaptFunctionNameField(_0x3fbd9f,_0x448ec3,_0x49980e);}adaptResources(_0x130667[_0x81a9b9(0xae)],_0x420229+_0x81a9b9(0xb1),_0x49980e);}}function adaptBffTarget(_0x152b6d,_0x1148f8,_0x10242b){const _0x2228f9=a39_0x15a9;if(!isObjectRecord(_0x152b6d)||_0x152b6d[_0x2228f9(0x99)]!==_0x2228f9(0x9e))return;adaptFunctionNameField(_0x152b6d,_0x1148f8,_0x10242b);}function adaptFunctionNameField(_0x23d019,_0x4ad927,_0x47ffd8){const _0x2b8a22=a39_0x15a9;Object['prototype'][_0x2b8a22(0xa0)][_0x2b8a22(0x93)](_0x23d019,_0x2b8a22(0x96))&&_0x47ffd8['push']({'level':_0x2b8a22(0x94),'path':_0x4ad927+_0x2b8a22(0x91),'message':'Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.'});if(Object[_0x2b8a22(0x9f)][_0x2b8a22(0xa0)]['call'](_0x23d019,_0x2b8a22(0x9d))){if(typeof _0x23d019['functionName']!==_0x2b8a22(0x92)||!_0x23d019[_0x2b8a22(0x9d)][_0x2b8a22(0xaf)]()){_0x47ffd8[_0x2b8a22(0xa3)]({'level':_0x2b8a22(0x94),'path':_0x4ad927+_0x2b8a22(0x9c),'message':_0x2b8a22(0x9a)}),delete _0x23d019[_0x2b8a22(0x9d)];return;}_0x23d019['scriptName']=_0x23d019[_0x2b8a22(0x9d)],delete _0x23d019['functionName'];}}function a39_0x125c(){const _0x36ba1c=['scriptName','map','.actions.','kind','functionName\x20must\x20be\x20a\x20non-empty\x20string.','10681632WRXlVj','.functionName','functionName','bff','prototype','hasOwnProperty','21896QMSLjV','commands','push','object','fromEntries','1625426FixzlZ','28368AcaxUz','bff.exec','4211186MXTJDK','].target','114PaoDyP','forEach','986830cPocnY','resources','trim','actions','.resources','target','$.resources','.scriptName','string','call','error','1090254MiJSyx'];a39_0x125c=function(){return _0x36ba1c;};return a39_0x125c();}function isBffAction(_0xdb7f7){const _0x447c19=a39_0x15a9;return _0xdb7f7[_0x447c19(0x99)]===_0x447c19(0x9e)||_0xdb7f7['action']===_0x447c19(0xa8)||_0xdb7f7['target']==='bff.exec';}function cloneJsonValue(_0x2970db){const _0x38ee8c=a39_0x15a9;if(Array['isArray'](_0x2970db))return _0x2970db['map'](_0x219126=>cloneJsonValue(_0x219126));if(isObjectRecord(_0x2970db))return Object[_0x38ee8c(0xa5)](Object['entries'](_0x2970db)['map'](([_0x96d94c,_0x238943])=>[_0x96d94c,cloneJsonValue(_0x238943)]));return _0x2970db;}function isObjectRecord(_0xddc52c){const _0x3e1804=a39_0x15a9;return Boolean(_0xddc52c)&&typeof _0xddc52c===_0x3e1804(0xa4)&&!Array['isArray'](_0xddc52c);}
|