@lovrabet/lovrabet-cli 2.1.16-beta.2 → 2.1.16
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/artifact/index.js +1 -1
- package/lib/commands/auth/device.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
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a29_0x1552(_0x10863a,_0x1414ee){_0x10863a=_0x10863a-0xdd;const _0x5e7903=a29_0x5e79();let _0x155275=_0x5e7903[_0x10863a];return _0x155275;}const a29_0xa3d1ac=a29_0x1552;(function(_0x11351a,_0x36cdbc){const _0x5938d3=a29_0x1552,_0x22e9f9=_0x11351a();while(!![]){try{const _0x27a0f6=-parseInt(_0x5938d3(0xf2))/0x1*(-parseInt(_0x5938d3(0xed))/0x2)+-parseInt(_0x5938d3(0x115))/0x3*(parseInt(_0x5938d3(0x100))/0x4)+parseInt(_0x5938d3(0x124))/0x5+-parseInt(_0x5938d3(0xe0))/0x6*(-parseInt(_0x5938d3(0x133))/0x7)+-parseInt(_0x5938d3(0xf5))/0x8+parseInt(_0x5938d3(0x118))/0x9*(-parseInt(_0x5938d3(0xdd))/0xa)+parseInt(_0x5938d3(0x12f))/0xb;if(_0x27a0f6===_0x36cdbc)break;else _0x22e9f9['push'](_0x22e9f9['shift']());}catch(_0x35586c){_0x22e9f9['push'](_0x22e9f9['shift']());}}}(a29_0x5e79,0x1c541));import a29_0x448e65 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';function a29_0x5e79(){const _0x3a6da7=['gray','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','commandCount','repeat','yellow','Project','currentApp','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(missing)','(not\x20set)','1142630YNPzjq','(unnamed)','format','message','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','missing','\x20Imported\x20from:\x20','path','✗\x20Invalid','registryPath','389136UhGyMN','⚠\x20Empty','accessKey','red','7nWhDjQ','verbose','70yXEqmT','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','Global','1020846rlGkGd','services','green','ClientAk','appCode','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','defaultApp','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','serviceCode','\x20\x20─','(no\x20file)','1066USqAFw','\x20(legacy/compat\x20only)','serviceCount','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','121evVPHD','(not\x20found)','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1668936DXdlnY','\x20\x20Config\x20JSON','\x20\x20auth\x20(effective):\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20(accessKey)','(default)','doctor','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','length','✓\x20Loaded','64556OJtLNa','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Auth','source','padEnd','bold','locale','⚠\x20Empty\x20(treated\x20as\x20{})','riskLevel','env','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','(none)','\x20\x20API\x20Endpoints','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','(default:\x20','status','\x20\x20Service\x20Tree','arch','\x20commands)','empty','15INdOhm','check','log','119817moAgCC'];a29_0x5e79=function(){return _0x3a6da7;};return a29_0x5e79();}async function execute(_0x5aecb7){const _0x333d26=a29_0x1552,_0x575ec9=getCliVersion(),_0x34e659=buildConfigFromFlags({});await initGlobalEnvironment(_0x34e659),console['log'](),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x105)](CLI_BIN_NAME+'\x20doctor')),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x119)]('─'[_0x333d26(0x11d)](0x32))),console['log'](_0x333d26(0x10e)+_0x575ec9),console[_0x333d26(0x117)](_0x333d26(0xf4)+process['version']),console[_0x333d26(0x117)](_0x333d26(0xde)+process[_0x333d26(0x11b)]+'\x20'+process[_0x333d26(0x112)]),console[_0x333d26(0x117)](),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x105)]('\x20\x20Config\x20Files')),console['log'](a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xeb)[_0x333d26(0x11d)](0x1e)));const _0x21091b=getGlobalConfigPath(),_0x2f8bcb=getProjectConfigPath();console['log'](_0x333d26(0x121)+(_0x21091b||a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xf3)))),console['log'](_0x333d26(0xe6)+(_0x2f8bcb||a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xf3)))),console['log'](),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x105)](_0x333d26(0xf6))),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xeb)['repeat'](0x1e)));const _0x2608d6=(_0x593eb0,_0x4d1efd)=>{const _0x25751c=_0x333d26;if(!_0x4d1efd){console[_0x25751c(0x117)]('\x20\x20'+_0x593eb0[_0x25751c(0x104)](0x11)+'\x20'+a29_0x448e65[_0x25751c(0x119)](_0x25751c(0xec)));return;}const _0x36afa7=inspectCliConfigJsonFile(_0x4d1efd);if(_0x36afa7[_0x25751c(0x110)]==='ok')console[_0x25751c(0x117)]('\x20\x20'+_0x593eb0['padEnd'](0x11)+'\x20'+a29_0x448e65[_0x25751c(0xe2)](_0x25751c(0x10b)));else{if(_0x36afa7[_0x25751c(0x110)]==='empty')console[_0x25751c(0x117)]('\x20\x20'+_0x593eb0[_0x25751c(0x104)](0x11)+'\x20'+a29_0x448e65[_0x25751c(0x11e)](_0x25751c(0x107)));else _0x36afa7[_0x25751c(0x110)]==='missing'?console[_0x25751c(0x117)]('\x20\x20'+_0x593eb0[_0x25751c(0x104)](0x11)+'\x20'+a29_0x448e65['gray'](_0x25751c(0x122))):(console[_0x25751c(0x117)]('\x20\x20'+_0x593eb0[_0x25751c(0x104)](0x11)+'\x20'+a29_0x448e65['red']('✗\x20Invalid\x20JSON')),console['log']('\x20\x20'+''['padEnd'](0x11)+'\x20'+a29_0x448e65[_0x25751c(0x132)](_0x36afa7[_0x25751c(0x127)])));}};_0x2608d6(_0x333d26(0xdf),_0x21091b),_0x2608d6(_0x333d26(0x11f),_0x2f8bcb),console[_0x333d26(0x117)](),console[_0x333d26(0x117)](a29_0x448e65['bold']('\x20\x20Merged\x20Config')),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xeb)[_0x333d26(0x11d)](0x1e))),console[_0x333d26(0x117)](_0x333d26(0x11a)+(_0x34e659[_0x333d26(0xe4)]||a29_0x448e65[_0x333d26(0x132)](_0x333d26(0x123)))),console[_0x333d26(0x117)]('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x34e659[_0x333d26(0x109)]);const _0x33f469=isLegacyCompatConfigKey(_0x333d26(0x106))?a29_0x448e65[_0x333d26(0x119)](_0x34e659[_0x333d26(0x106)]+_0x333d26(0xee)):_0x34e659[_0x333d26(0x106)];console[_0x333d26(0x117)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x33f469),console[_0x333d26(0x117)](_0x333d26(0xf8)+(_0x34e659[_0x333d26(0xe7)]||a29_0x448e65[_0x333d26(0x119)](_0x333d26(0x10c)))),console[_0x333d26(0x117)](_0x333d26(0xe8)+(_0x34e659[_0x333d26(0x120)]||a29_0x448e65[_0x333d26(0x119)]('(none)'))),console[_0x333d26(0x117)](_0x333d26(0x10a)+(_0x34e659['format']||a29_0x448e65[_0x333d26(0x119)](_0x333d26(0x10f)+DEFAULT_CONFIG_VALUES[_0x333d26(0x126)]+')'))),console[_0x333d26(0x117)](_0x333d26(0x128)+(_0x34e659['pageSize']??a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xfb)))),console[_0x333d26(0x117)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x34e659[_0x333d26(0x108)]),console[_0x333d26(0x117)]('\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x34e659[_0x333d26(0x134)]),console[_0x333d26(0x117)](_0x333d26(0xf7)+AUTH_MODE[_0x333d26(0xe3)]),console[_0x333d26(0x117)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x34e659[_0x333d26(0x131)]?a29_0x448e65[_0x333d26(0xe2)]('(set,\x20length='+_0x34e659['accessKey'][_0x333d26(0xfe)]+')'):a29_0x448e65[_0x333d26(0x119)](_0x333d26(0x10c)))),console[_0x333d26(0x117)](),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x105)](_0x333d26(0x10d))),console['log'](a29_0x448e65['gray'](_0x333d26(0xeb)[_0x333d26(0x11d)](0x1e))),console[_0x333d26(0x117)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x333d26(0x117)](_0x333d26(0xf0)+getUserDomain()),console[_0x333d26(0x117)](_0x333d26(0xf1)+getRuntimeDomain()),console[_0x333d26(0x117)](),console['log'](a29_0x448e65[_0x333d26(0x105)](_0x333d26(0x111))),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x119)](_0x333d26(0xeb)['repeat'](0x1e)));const _0x200763=inspectServiceRegistry();console[_0x333d26(0x117)](_0x333d26(0xfd)+_0x200763[_0x333d26(0x12e)]),console[_0x333d26(0x117)](_0x333d26(0xe5)+formatServiceRegistryStatus(_0x200763)),console['log'](_0x333d26(0xe9)+_0x200763[_0x333d26(0xef)]),console[_0x333d26(0x117)](_0x333d26(0xf9)+_0x200763[_0x333d26(0x11c)]);for(const _0x38755a of _0x200763[_0x333d26(0xe1)]){console[_0x333d26(0x117)]('\x20\x20'+(_0x38755a[_0x333d26(0xea)]+':')[_0x333d26(0x104)](0x11)+'\x20'+(_0x38755a['name']||a29_0x448e65[_0x333d26(0x119)](_0x333d26(0x125)))+'\x20('+_0x38755a[_0x333d26(0x11c)]+_0x333d26(0x113)),console['log']('\x20\x20'+''['padEnd'](0x11)+_0x333d26(0x12b)+_0x38755a[_0x333d26(0x103)][_0x333d26(0x12c)]);}return console[_0x333d26(0x117)](),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x105)](_0x333d26(0x102))),console[_0x333d26(0x117)](a29_0x448e65[_0x333d26(0x119)]('\x20\x20─'[_0x333d26(0x11d)](0x1e))),console[_0x333d26(0x117)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x448e65[_0x333d26(0xe2)](AUTH_MODE['ClientAk']+_0x333d26(0xfa))),console[_0x333d26(0x117)](_0x333d26(0x101)+a29_0x448e65[_0x333d26(0x119)]('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x333d26(0x117)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x2a9e17){const _0x1a9e1c=a29_0x1552;if(_0x2a9e17[_0x1a9e1c(0x110)]==='ok')return a29_0x448e65[_0x1a9e1c(0xe2)](_0x1a9e1c(0xff));if(_0x2a9e17[_0x1a9e1c(0x110)]===_0x1a9e1c(0x12a))return a29_0x448e65[_0x1a9e1c(0x119)]('(not\x20found)');if(_0x2a9e17['status']===_0x1a9e1c(0x114))return a29_0x448e65[_0x1a9e1c(0x11e)](_0x1a9e1c(0x130));return a29_0x448e65['red'](_0x1a9e1c(0x12d)+(_0x2a9e17['message']?':\x20'+_0x2a9e17[_0x1a9e1c(0x127)]:''));}export const doctorDefinition={'service':a29_0xa3d1ac(0xfc),'command':a29_0xa3d1ac(0x116),'description':a29_0xa3d1ac(0x129),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x37732a=a30_0x2cdf;function a30_0x2cdf(_0x1408ab,_0x31c99b){_0x1408ab=_0x1408ab-0x8d;const _0x59b940=a30_0x59b9();let _0x2cdffa=_0x59b940[_0x1408ab];return _0x2cdffa;}function a30_0x59b9(){const _0x1f00f0=['appCode','157386oFgDUg','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','build','validation','83088zyktNn','POST','/client/uploadFile','104jBEnus','40eAogwr','write','337437yVSEaF','bool','string','1331113WDJTnH','\x20to\x20runtime\x20app\x20','Uploaded\x20file:\x20','long-term','6yAreHb','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','download','832070IjhpCH','Preview:\x20upload\x20','51575FUiASI','filepath','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','filePath','boolean','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','File','read','path','file','2596NzRlmv','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','1Tyqdbl','7133650RVohvy','Path\x20to\x20the\x20local\x20file\x20to\x20upload','str','upload','body'];a30_0x59b9=function(){return _0x1f00f0;};return a30_0x59b9();}(function(_0x4b3ef9,_0x5495e2){const _0x576a8a=a30_0x2cdf,_0x2fd79e=_0x4b3ef9();while(!![]){try{const _0x2de54a=parseInt(_0x576a8a(0x99))/0x1*(parseInt(_0x576a8a(0xb4))/0x2)+-parseInt(_0x576a8a(0xa0))/0x3+-parseInt(_0x576a8a(0xa7))/0x4*(parseInt(_0x576a8a(0x8d))/0x5)+parseInt(_0x576a8a(0xb1))/0x6*(-parseInt(_0x576a8a(0xad))/0x7)+-parseInt(_0x576a8a(0xa8))/0x8*(parseInt(_0x576a8a(0xaa))/0x9)+-parseInt(_0x576a8a(0x9a))/0xa+-parseInt(_0x576a8a(0x97))/0xb*(-parseInt(_0x576a8a(0xa4))/0xc);if(_0x2de54a===_0x5495e2)break;else _0x2fd79e['push'](_0x2fd79e['shift']());}catch(_0x603306){_0x2fd79e['push'](_0x2fd79e['shift']());}}}(a30_0x59b9,0x9bdfa));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_0x37732a(0x96),'type':a30_0x37732a(0xac),'required':!![],'description':a30_0x37732a(0x9b)},FILEPATH_FLAG={'name':a30_0x37732a(0x8e),'type':a30_0x37732a(0xac),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':'download','type':a30_0x37732a(0x91),'description':a30_0x37732a(0xa1)},LONG_TERM_FLAG={'name':'long-term','type':'boolean','description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x50b7f3){const _0x438d64=a30_0x37732a,_0xfd71e2=_0x50b7f3['trim']();if(!_0xfd71e2)throw CliErrors[_0x438d64(0xa3)]('filePath\x20is\x20required.');return _0xfd71e2;}const fileUpload={'service':a30_0x37732a(0x96),'command':a30_0x37732a(0x9d),'description':a30_0x37732a(0x98),'risk':a30_0x37732a(0xa9),'flags':[FILE_FLAG],async 'dryRun'(_0x5eae42){const _0xc97b58=a30_0x37732a,_0x35424d=requireRuntimeUploadFile(_0x5eae42[_0xc97b58(0x9c)](_0xc97b58(0x96)),_0xc97b58(0x93));return dryRun(_0xc97b58(0xa5),_0xc97b58(0xa6))[_0xc97b58(0x9e)]({'appCode':_0x5eae42['appCode'],'multipart':{'file':_0x35424d}})['description'](_0xc97b58(0xb5)+_0x35424d[_0xc97b58(0x95)]+_0xc97b58(0xae)+_0x5eae42['appCode'])[_0xc97b58(0xa2)]();},async 'execute'(_0x537bd1){const _0x2cfb6e=a30_0x37732a,_0xc279ef=requireRuntimeUploadFile(_0x537bd1[_0x2cfb6e(0x9c)](_0x2cfb6e(0x96)),'File'),_0x3273a6=await uploadRuntimeFile(_0x537bd1[_0x2cfb6e(0x9f)],_0xc279ef[_0x2cfb6e(0x95)]);return{'ok':!![],'data':_0x3273a6,'message':_0x3273a6[_0x2cfb6e(0x90)]?_0x2cfb6e(0xaf)+_0x3273a6[_0x2cfb6e(0x90)]+_0x2cfb6e(0xb2):_0x2cfb6e(0x92)};}},fileQueryUrl={'service':'file','command':'query-url','description':a30_0x37732a(0x8f),'risk':a30_0x37732a(0x94),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x43e4ee){const _0x40c9fe=a30_0x37732a,_0x3aff6a=requireFilePath(_0x43e4ee[_0x40c9fe(0x9c)]('filepath')),_0x195b57=await queryRuntimeFileUrl(_0x3aff6a,{'download':_0x43e4ee[_0x40c9fe(0xab)](_0x40c9fe(0xb3)),'longTerm':_0x43e4ee[_0x40c9fe(0xab)](_0x40c9fe(0xb0))});return{'ok':!![],'data':_0x195b57};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x276696=a31_0x4df6;(function(_0x34642b,_0x8a392a){const _0x165678=a31_0x4df6,_0x34670f=_0x34642b();while(!![]){try{const _0x5409b1=parseInt(_0x165678(0x87))/0x1*(parseInt(_0x165678(0xa3))/0x2)+parseInt(_0x165678(0xae))/0x3+parseInt(_0x165678(0x72))/0x4*(-parseInt(_0x165678(0xa7))/0x5)+parseInt(_0x165678(0x8b))/0x6+-parseInt(_0x165678(0x77))/0x7*(parseInt(_0x165678(0x6e))/0x8)+parseInt(_0x165678(0x78))/0x9+-parseInt(_0x165678(0x8d))/0xa*(-parseInt(_0x165678(0x86))/0xb);if(_0x5409b1===_0x8a392a)break;else _0x34670f['push'](_0x34670f['shift']());}catch(_0x16561c){_0x34670f['push'](_0x34670f['shift']());}}}(a31_0x22f0,0xa6dac));import{existsSync,readFileSync}from'node:fs';function a31_0x22f0(){const _0x1ac159=['[y/N]','join','\x22.\x20Allowed:\x20',')\x20instead\x20of\x20project','User\x20aborted\x20prompt','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','SIGINT','app','Skip\x20confirmation\x20when\x20overwriting','Source\x20file\x20not\x20found:\x20','stdout','appcode','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`.','global','string','34peTQZv','AbortPrompt','toLowerCase','removeListener','15jfrIok','File\x20','trim','apiDir','\x20\x20appcode:\x20','boolean','\x20\x20config:\x20\x20','223239YoHOBh','yes','apps','Write\x20to\x20global\x20(~/','\x0aInitialized\x20','App\x20code','Target\x20environment\x20(default\x20','\x20init\x20—\x20Create\x20','Failed\x20to\x20parse\x20source\x20file:\x20','8pLeufb','App\x20code\x20for\x20the\x20project','Initialized\x20','App\x20code\x20cannot\x20be\x20empty.','1764040RQtYSE','includes','utf8','riskLevel','cwd','2327297cpyGaC','1568430OsQdwR','flagMissing','race','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','[Y/n]','Aborted.','Imported\x20from\x20','validation','question','\x20\x20env:\x20\x20\x20\x20\x20','newConfigFileName','\x20already\x20exists.\x20Overwrite?','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','parse','11rKcIdU','60087qUIRDH','file','object','project','4171824xeGdgt','\x20\x20default:\x20','3734710WfgRHV','env','once','close','log','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','name'];a31_0x22f0=function(){return _0x1ac159;};return a31_0x22f0();}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_0x276696(0x9f),'type':a31_0x276696(0xa2),'description':a31_0x276696(0x6f)},{'name':'env','type':'string','description':a31_0x276696(0x6b)+DEFAULT_CONFIG_VALUES[a31_0x276696(0x8e)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x276696(0xa1),'type':'boolean','description':a31_0x276696(0x68)+PRODUCT_CONFIG[a31_0x276696(0x82)]+a31_0x276696(0x97),'default':![]},{'name':a31_0x276696(0xaf),'type':a31_0x276696(0xac),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x276696(0x88),'type':a31_0x276696(0xa2),'description':a31_0x276696(0x99),'required':!![]},{'name':a31_0x276696(0x9f),'type':a31_0x276696(0xa2),'description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x276696(0x8e),'type':a31_0x276696(0xa2),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x276696(0xac),'description':a31_0x276696(0x68)+PRODUCT_CONFIG[a31_0x276696(0x82)]+a31_0x276696(0x97),'default':![]},{'name':a31_0x276696(0xaf),'type':a31_0x276696(0xac),'description':a31_0x276696(0x9c),'default':![]}];export async function runInit(_0x399fb1){const _0x11678a=a31_0x276696,_0x56760b=isNonInteractiveMode(_0x399fb1),_0x689573=_0x399fb1[_0x11678a(0xa1)]?'global':_0x11678a(0x8a),_0x556309=resolveWriteConfigPath(_0x689573);try{_0x56760b?await runNonInteractive(_0x399fb1,_0x556309):await runInteractive(_0x399fb1,_0x556309);}catch(_0x58b4b7){if(_0x58b4b7 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x58b4b7;}}export async function runInitImport(_0x110559){const _0x35d524=a31_0x276696,_0xf847d1=_0x110559[_0x35d524(0xa1)]?_0x35d524(0xa1):_0x35d524(0x8a),_0x330309=resolveWriteConfigPath(_0xf847d1);await runFromImport(_0x110559,_0x330309);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x276696(0xaa)]);async function runFromImport(_0x5e5a70,_0xbe2bb2){const _0x332429=a31_0x276696,_0x1e8d5d=resolveFilePath(_0x5e5a70[_0x332429(0x88)]);if(!existsSync(_0x1e8d5d))throw CliErrors[_0x332429(0x7f)](_0x332429(0x9d)+_0x1e8d5d);const _0x56a3b6=readSourceFile(_0x1e8d5d),_0x373864=convertToRuntimeConfig(_0x56a3b6);_0x5e5a70['appcode']&&(_0x373864[_0x332429(0x9f)]=String(_0x5e5a70['appcode']));_0x5e5a70['env']&&(_0x373864[_0x332429(0x8e)]=resolveInitEnv(_0x5e5a70));if(!_0x373864[_0x332429(0x9f)])throw CliErrors[_0x332429(0x7f)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x332429(0xa0));await writeInitConfig(_0xbe2bb2,_0x373864,_0x5e5a70),console[_0x332429(0x91)](_0x332429(0x7e)+_0x1e8d5d),console[_0x332429(0x91)](_0x332429(0xad)+_0xbe2bb2),console['log'](_0x332429(0xab)+_0x373864[_0x332429(0x9f)]);if(_0x373864['defaultApp'])console[_0x332429(0x91)](_0x332429(0x8c)+_0x373864['defaultApp']);}function convertToRuntimeConfig(_0x2a059b){const _0x4f1bb9=a31_0x276696;if(_0x2a059b[_0x4f1bb9(0x67)]&&typeof _0x2a059b[_0x4f1bb9(0x67)]===_0x4f1bb9(0x89))throw CliErrors['validation'](_0x4f1bb9(0x92),_0x4f1bb9(0x7b));const _0x560271={};for(const _0x2eafde of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2a059b[_0x2eafde]!==undefined&&(_0x560271[_0x2eafde]=_0x2a059b[_0x2eafde]);}return!_0x560271[_0x4f1bb9(0x75)]&&(_0x560271[_0x4f1bb9(0x75)]=DEFAULT_CONFIG_VALUES[_0x4f1bb9(0x75)]),_0x560271;}async function runNonInteractive(_0x50fa8a,_0x4c789f){const _0x32df8a=a31_0x276696,_0x59bc65=_0x50fa8a[_0x32df8a(0x9f)];if(!_0x59bc65)throw CliErrors[_0x32df8a(0x79)](_0x32df8a(0x9f),'Usage:\x20'+CLI_BIN_NAME+_0x32df8a(0x84));const _0x1b5c0c=resolveInitEnv(_0x50fa8a);await writeInitConfig(_0x4c789f,{'appcode':_0x59bc65,'env':_0x1b5c0c},_0x50fa8a),console[_0x32df8a(0x91)](_0x32df8a(0x70)+_0x4c789f),console['log'](_0x32df8a(0xab)+_0x59bc65),console['log'](_0x32df8a(0x81)+_0x1b5c0c);}async function runInteractive(_0x4c4246,_0x4c1a3d){const _0x2d4174=a31_0x276696,_0x293d4c=loadExisting(_0x4c1a3d),_0x423883=typeof _0x293d4c?.[_0x2d4174(0x9f)]==='string'?_0x293d4c[_0x2d4174(0x9f)]:'',_0x163e82=resolveInitEnv(_0x4c4246);console[_0x2d4174(0x91)](CLI_BIN_NAME+_0x2d4174(0x6c)+PRODUCT_CONFIG[_0x2d4174(0x82)]+'\x0a');if(existsSync(_0x4c1a3d)&&!_0x4c4246[_0x2d4174(0xaf)]){const _0x778328=await promptYesNo(_0x2d4174(0xa8)+_0x4c1a3d+_0x2d4174(0x83),![]);if(!_0x778328){console[_0x2d4174(0x91)](_0x2d4174(0x7d));return;}}const _0x1c3d22=typeof _0x4c4246[_0x2d4174(0x9f)]===_0x2d4174(0xa2)?_0x4c4246['appcode'][_0x2d4174(0xa9)]():'';let _0x2e71da=_0x1c3d22;!_0x2e71da&&(_0x2e71da=await promptInput(_0x2d4174(0x6a),_0x423883));if(!_0x2e71da['trim']())throw CliErrors[_0x2d4174(0x7f)](_0x2d4174(0x71));await writeInitConfig(_0x4c1a3d,{'appcode':_0x2e71da[_0x2d4174(0xa9)](),'env':_0x163e82},_0x4c4246),console[_0x2d4174(0x91)](_0x2d4174(0x69)+_0x4c1a3d),console[_0x2d4174(0x91)](_0x2d4174(0xab)+_0x2e71da[_0x2d4174(0xa9)]()),console['log'](_0x2d4174(0x81)+_0x163e82);}async function writeInitConfig(_0x595c21,_0x1f8af2,_0x5cf2f9){const _0x1d0fd2=a31_0x276696;let _0x4b9d49={};existsSync(_0x595c21)&&!_0x5cf2f9[_0x1d0fd2(0xaf)]&&(_0x4b9d49=readConfigFile(_0x595c21));for(const [_0x1c4b60,_0x2eb613]of Object['entries'](_0x1f8af2)){_0x2eb613!==undefined&&(_0x4b9d49[_0x1c4b60]=_0x2eb613);}if(_0x4b9d49[_0x1d0fd2(0x9b)])delete _0x4b9d49[_0x1d0fd2(0x9b)];writeConfigFile(_0x595c21,_0x4b9d49);}class AbortPrompt extends Error{constructor(){const _0x1dae16=a31_0x276696;super(_0x1dae16(0x98)),this[_0x1dae16(0x93)]=_0x1dae16(0xa4);}}function createSafeRl(){const _0x20ef9c=a31_0x276696,_0x159b1b=createInterface({'input':process['stdin'],'output':process[_0x20ef9c(0x9e)]});let _0x3f259c;const _0xe77786=new Promise((_0x57d8ae,_0x421a02)=>{const _0x519896=_0x20ef9c;_0x3f259c=()=>{_0x3f259c&&(_0x159b1b['removeListener']('SIGINT',_0x3f259c),_0x3f259c=undefined);try{_0x159b1b['close']();}catch{}_0x421a02(new AbortPrompt());},_0x159b1b[_0x519896(0x8f)](_0x519896(0x9a),_0x3f259c);}),_0x494d96=()=>{const _0x29d26e=_0x20ef9c;_0x3f259c&&(_0x159b1b[_0x29d26e(0xa6)](_0x29d26e(0x9a),_0x3f259c),_0x3f259c=undefined);try{_0x159b1b[_0x29d26e(0x90)]();}catch{}};return{'rl':_0x159b1b,'abortPromise':_0xe77786,'disposeSuccess':_0x494d96};}async function promptInput(_0x472651,_0x464561){const _0x128dbb=a31_0x276696,{rl:_0x583cf6,abortPromise:_0x1e5373,disposeSuccess:_0x42e865}=createSafeRl(),_0x55a6c7=new Promise(_0x18e0ef=>{const _0x1ce2af=_0x464561?'\x20\x20'+_0x472651+'\x20('+_0x464561+'):\x20':'\x20\x20'+_0x472651+':\x20';_0x583cf6['question'](_0x1ce2af,_0x5f4c7e=>{_0x42e865(),_0x18e0ef(_0x5f4c7e['trim']()||_0x464561);});});return Promise[_0x128dbb(0x7a)]([_0x55a6c7,_0x1e5373]);}async function promptYesNo(_0x3bf71e,_0x39afc6){const _0x4cc119=a31_0x276696,{rl:_0x24dbfd,abortPromise:_0x1d94ee,disposeSuccess:_0x243525}=createSafeRl(),_0x17604b=new Promise(_0x2dbe1c=>{const _0x4818fd=a31_0x4df6,_0x3b215f=_0x39afc6?_0x4818fd(0x7c):_0x4818fd(0x94);_0x24dbfd[_0x4818fd(0x80)]('\x20\x20'+_0x3bf71e+'\x20'+_0x3b215f+':\x20',_0x46c55e=>{const _0xb12849=_0x4818fd;_0x243525();const _0x48e95c=_0x46c55e[_0xb12849(0xa9)]()[_0xb12849(0xa5)]();if(_0x48e95c==='y'||_0x48e95c==='yes')_0x2dbe1c(!![]);else{if(_0x48e95c==='n'||_0x48e95c==='no')_0x2dbe1c(![]);else _0x2dbe1c(_0x39afc6);}});});return Promise[_0x4cc119(0x7a)]([_0x17604b,_0x1d94ee]);}function loadExisting(_0x5112da){if(!existsSync(_0x5112da))return null;return readConfigFile(_0x5112da);}function a31_0x4df6(_0x459d47,_0x3eebdc){_0x459d47=_0x459d47-0x67;const _0x22f09a=a31_0x22f0();let _0x4df641=_0x22f09a[_0x459d47];return _0x4df641;}function resolveFilePath(_0x30b8cd){const _0x4d00cd=a31_0x276696;return isAbsolute(_0x30b8cd)?_0x30b8cd:resolve(process[_0x4d00cd(0x76)](),_0x30b8cd);}function readSourceFile(_0x112e69){const _0x177ade=a31_0x276696;try{const _0x17e834=readFileSync(_0x112e69,{'encoding':_0x177ade(0x74)});return JSON[_0x177ade(0x85)](_0x17e834);}catch(_0x368cc3){throw CliErrors[_0x177ade(0x7f)](_0x177ade(0x6d)+_0x368cc3['message']);}}function resolveInitEnv(_0x3f0f86){const _0x331bee=a31_0x276696,_0x756b6e=_0x3f0f86[_0x331bee(0x8e)];if(_0x756b6e===undefined||_0x756b6e==='')return DEFAULT_CONFIG_VALUES[_0x331bee(0x8e)];if(!RUNTIME_ENV_VALUES[_0x331bee(0x73)](_0x756b6e))throw CliErrors[_0x331bee(0x7f)]('Invalid\x20env\x20\x22'+_0x756b6e+_0x331bee(0x96)+RUNTIME_ENV_VALUES[_0x331bee(0x95)](',\x20'));return _0x756b6e;}
|
|
1
|
+
const a31_0x3b9ca0=a31_0x2da2;(function(_0xdc86a7,_0x25f6e3){const _0x5ce44b=a31_0x2da2,_0x10d59b=_0xdc86a7();while(!![]){try{const _0x3a16f5=-parseInt(_0x5ce44b(0x8f))/0x1*(parseInt(_0x5ce44b(0x74))/0x2)+parseInt(_0x5ce44b(0x82))/0x3*(-parseInt(_0x5ce44b(0x9e))/0x4)+-parseInt(_0x5ce44b(0x73))/0x5+parseInt(_0x5ce44b(0x72))/0x6*(-parseInt(_0x5ce44b(0x9a))/0x7)+-parseInt(_0x5ce44b(0x78))/0x8+parseInt(_0x5ce44b(0x89))/0x9*(parseInt(_0x5ce44b(0x96))/0xa)+parseInt(_0x5ce44b(0x66))/0xb;if(_0x3a16f5===_0x25f6e3)break;else _0x10d59b['push'](_0x10d59b['shift']());}catch(_0x163eca){_0x10d59b['push'](_0x10d59b['shift']());}}}(a31_0xc1df,0x855d8));import{existsSync,readFileSync}from'node:fs';function a31_0x2da2(_0x1db4cc,_0x2c48bf){_0x1db4cc=_0x1db4cc-0x66;const _0xc1dff6=a31_0xc1df();let _0x2da2d1=_0xc1dff6[_0x1db4cc];return _0x2da2d1;}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_0x3b9ca0(0x6c),'type':a31_0x3b9ca0(0x67),'description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x3b9ca0(0x7f),'type':'string','description':a31_0x3b9ca0(0x83)+DEFAULT_CONFIG_VALUES[a31_0x3b9ca0(0x7f)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x3b9ca0(0x94),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x3b9ca0(0xa6)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x3b9ca0(0x87),'type':a31_0x3b9ca0(0x94),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x3b9ca0(0x6a),'type':'string','description':a31_0x3b9ca0(0x99),'required':!![]},{'name':a31_0x3b9ca0(0x6c),'type':a31_0x3b9ca0(0x67),'description':a31_0x3b9ca0(0x80)},{'name':'env','type':a31_0x3b9ca0(0x67),'description':a31_0x3b9ca0(0x84),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x3b9ca0(0x91),'type':a31_0x3b9ca0(0x94),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x3b9ca0(0xa6)]+a31_0x3b9ca0(0x75),'default':![]},{'name':a31_0x3b9ca0(0x87),'type':'boolean','description':a31_0x3b9ca0(0x71),'default':![]}];export async function runInit(_0x4b2f14){const _0x3ea0d9=a31_0x3b9ca0,_0x5936d1=isNonInteractiveMode(_0x4b2f14),_0x16682f=_0x4b2f14['global']?_0x3ea0d9(0x91):_0x3ea0d9(0x98),_0x149ef2=resolveWriteConfigPath(_0x16682f);try{_0x5936d1?await runNonInteractive(_0x4b2f14,_0x149ef2):await runInteractive(_0x4b2f14,_0x149ef2);}catch(_0xf67c3d){if(_0xf67c3d instanceof AbortPrompt)throw CliErrors[_0x3ea0d9(0xa4)]();throw _0xf67c3d;}}export async function runInitImport(_0xb54280){const _0x2e020e=a31_0x3b9ca0,_0x5847ce=_0xb54280[_0x2e020e(0x91)]?_0x2e020e(0x91):_0x2e020e(0x98),_0x385cea=resolveWriteConfigPath(_0x5847ce);await runFromImport(_0xb54280,_0x385cea);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x3b9ca0(0x86)]);async function runFromImport(_0xd6bc1d,_0x5cda40){const _0x32054a=a31_0x3b9ca0,_0x108c43=resolveFilePath(_0xd6bc1d[_0x32054a(0x6a)]);if(!existsSync(_0x108c43))throw CliErrors[_0x32054a(0x6b)]('Source\x20file\x20not\x20found:\x20'+_0x108c43);const _0xa0fdb5=readSourceFile(_0x108c43),_0x28ed3c=convertToRuntimeConfig(_0xa0fdb5);_0xd6bc1d[_0x32054a(0x6c)]&&(_0x28ed3c[_0x32054a(0x6c)]=String(_0xd6bc1d[_0x32054a(0x6c)]));_0xd6bc1d[_0x32054a(0x7f)]&&(_0x28ed3c[_0x32054a(0x7f)]=resolveInitEnv(_0xd6bc1d));if(!_0x28ed3c['appcode'])throw CliErrors[_0x32054a(0x6b)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x5cda40,_0x28ed3c,_0xd6bc1d),console[_0x32054a(0x77)](_0x32054a(0x7d)+_0x108c43),console[_0x32054a(0x77)](_0x32054a(0xa7)+_0x5cda40),console[_0x32054a(0x77)](_0x32054a(0x9d)+_0x28ed3c['appcode']);if(_0x28ed3c[_0x32054a(0x7a)])console[_0x32054a(0x77)](_0x32054a(0x93)+_0x28ed3c[_0x32054a(0x7a)]);}function convertToRuntimeConfig(_0x18418f){const _0x488b4e=a31_0x3b9ca0;if(_0x18418f['apps']&&typeof _0x18418f['apps']===_0x488b4e(0x88))throw CliErrors[_0x488b4e(0x6b)](_0x488b4e(0x6d),_0x488b4e(0xa3));const _0x1feb0a={};for(const _0x2a3ec9 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x18418f[_0x2a3ec9]!==undefined&&(_0x1feb0a[_0x2a3ec9]=_0x18418f[_0x2a3ec9]);}return!_0x1feb0a[_0x488b4e(0x90)]&&(_0x1feb0a['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1feb0a;}async function runNonInteractive(_0x21a19c,_0x433ee0){const _0x425d92=a31_0x3b9ca0,_0x8b3efc=_0x21a19c[_0x425d92(0x6c)];if(!_0x8b3efc)throw CliErrors['flagMissing']('appcode',_0x425d92(0x6e)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x39bbf3=resolveInitEnv(_0x21a19c);await writeInitConfig(_0x433ee0,{'appcode':_0x8b3efc,'env':_0x39bbf3},_0x21a19c),console[_0x425d92(0x77)]('Initialized\x20'+_0x433ee0),console[_0x425d92(0x77)](_0x425d92(0x9d)+_0x8b3efc),console[_0x425d92(0x77)](_0x425d92(0xa2)+_0x39bbf3);}async function runInteractive(_0xe19712,_0x1abbdc){const _0x46dd30=a31_0x3b9ca0,_0x3fb9a0=loadExisting(_0x1abbdc),_0x53008e=typeof _0x3fb9a0?.['appcode']===_0x46dd30(0x67)?_0x3fb9a0[_0x46dd30(0x6c)]:'',_0x232b7e=resolveInitEnv(_0xe19712);console[_0x46dd30(0x77)](CLI_BIN_NAME+_0x46dd30(0x76)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x1abbdc)&&!_0xe19712[_0x46dd30(0x87)]){const _0xa353a3=await promptYesNo(_0x46dd30(0x69)+_0x1abbdc+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0xa353a3){console[_0x46dd30(0x77)]('Aborted.');return;}}const _0x19c1a0=typeof _0xe19712[_0x46dd30(0x6c)]===_0x46dd30(0x67)?_0xe19712[_0x46dd30(0x6c)][_0x46dd30(0x9b)]():'';let _0x14881d=_0x19c1a0;!_0x14881d&&(_0x14881d=await promptInput(_0x46dd30(0x8e),_0x53008e));if(!_0x14881d[_0x46dd30(0x9b)]())throw CliErrors[_0x46dd30(0x6b)](_0x46dd30(0x7c));await writeInitConfig(_0x1abbdc,{'appcode':_0x14881d[_0x46dd30(0x9b)](),'env':_0x232b7e},_0xe19712),console[_0x46dd30(0x77)](_0x46dd30(0x9f)+_0x1abbdc),console[_0x46dd30(0x77)](_0x46dd30(0x9d)+_0x14881d[_0x46dd30(0x9b)]()),console[_0x46dd30(0x77)](_0x46dd30(0xa2)+_0x232b7e);}async function writeInitConfig(_0x1bfbb9,_0x243ef2,_0x44cd74){const _0x467c1e=a31_0x3b9ca0;let _0x398e1a={};existsSync(_0x1bfbb9)&&!_0x44cd74[_0x467c1e(0x87)]&&(_0x398e1a=readConfigFile(_0x1bfbb9));for(const [_0x3bf04d,_0xf13952]of Object[_0x467c1e(0x85)](_0x243ef2)){_0xf13952!==undefined&&(_0x398e1a[_0x3bf04d]=_0xf13952);}if(_0x398e1a[_0x467c1e(0x8b)])delete _0x398e1a['app'];writeConfigFile(_0x1bfbb9,_0x398e1a);}class AbortPrompt extends Error{constructor(){const _0x514652=a31_0x3b9ca0;super(_0x514652(0x8c)),this['name']=_0x514652(0x8d);}}function a31_0xc1df(){const _0x7f5d1c=['apiDir','yes','object','4113newuPa','parse','app','User\x20aborted\x20prompt','AbortPrompt','App\x20code','128411CJGGhb','riskLevel','global','cwd','\x20\x20default:\x20','boolean','race','1290DULaXY','stdout','project','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','128723VRNhlL','trim','\x22.\x20Allowed:\x20','\x20\x20appcode:\x20','132Kbxdup','\x0aInitialized\x20','stdin','question','\x20\x20env:\x20\x20\x20\x20\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','cancelled','Failed\x20to\x20parse\x20source\x20file:\x20','newConfigFileName','\x20\x20config:\x20\x20','22712096ocIYhV','string','SIGINT','File\x20','file','validation','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','join','removeListener','Skip\x20confirmation\x20when\x20overwriting','138wvBqqv','2082050UKLzXC','4Skrbtl',')\x20instead\x20of\x20project','\x20init\x20—\x20Create\x20','log','2104136UfUQHi','toLowerCase','defaultApp','close','App\x20code\x20cannot\x20be\x20empty.','Imported\x20from\x20','once','env','Override\x20imported\x20default\x20appcode','utf8','19839VNVpIu','Target\x20environment\x20(default\x20','Override\x20imported\x20default\x20env','entries'];a31_0xc1df=function(){return _0x7f5d1c;};return a31_0xc1df();}function createSafeRl(){const _0x18f703=a31_0x3b9ca0,_0x3707be=createInterface({'input':process[_0x18f703(0xa0)],'output':process[_0x18f703(0x97)]});let _0x3b4e58;const _0x4bb563=new Promise((_0x357a96,_0x59af6b)=>{const _0x1705c8=_0x18f703;_0x3b4e58=()=>{const _0x2c5323=a31_0x2da2;_0x3b4e58&&(_0x3707be['removeListener'](_0x2c5323(0x68),_0x3b4e58),_0x3b4e58=undefined);try{_0x3707be[_0x2c5323(0x7b)]();}catch{}_0x59af6b(new AbortPrompt());},_0x3707be[_0x1705c8(0x7e)](_0x1705c8(0x68),_0x3b4e58);}),_0x31d384=()=>{const _0x535b95=_0x18f703;_0x3b4e58&&(_0x3707be[_0x535b95(0x70)]('SIGINT',_0x3b4e58),_0x3b4e58=undefined);try{_0x3707be['close']();}catch{}};return{'rl':_0x3707be,'abortPromise':_0x4bb563,'disposeSuccess':_0x31d384};}async function promptInput(_0x1c8b51,_0x5e6f66){const _0x1367ac=a31_0x3b9ca0,{rl:_0x5d59dd,abortPromise:_0x1f04f1,disposeSuccess:_0x3decb9}=createSafeRl(),_0x1f1d6e=new Promise(_0x176d01=>{const _0x3bef71=a31_0x2da2,_0x233893=_0x5e6f66?'\x20\x20'+_0x1c8b51+'\x20('+_0x5e6f66+'):\x20':'\x20\x20'+_0x1c8b51+':\x20';_0x5d59dd[_0x3bef71(0xa1)](_0x233893,_0x111aaa=>{const _0x30c1e3=_0x3bef71;_0x3decb9(),_0x176d01(_0x111aaa[_0x30c1e3(0x9b)]()||_0x5e6f66);});});return Promise[_0x1367ac(0x95)]([_0x1f1d6e,_0x1f04f1]);}async function promptYesNo(_0x25618e,_0xb131ff){const _0x23b9b4=a31_0x3b9ca0,{rl:_0x42f136,abortPromise:_0x55164e,disposeSuccess:_0x28f7a5}=createSafeRl(),_0x439b1c=new Promise(_0x5be9f5=>{const _0x166b68=a31_0x2da2,_0x49b473=_0xb131ff?'[Y/n]':'[y/N]';_0x42f136[_0x166b68(0xa1)]('\x20\x20'+_0x25618e+'\x20'+_0x49b473+':\x20',_0x8730b7=>{const _0x3dde56=_0x166b68;_0x28f7a5();const _0x4e69fa=_0x8730b7[_0x3dde56(0x9b)]()[_0x3dde56(0x79)]();if(_0x4e69fa==='y'||_0x4e69fa===_0x3dde56(0x87))_0x5be9f5(!![]);else{if(_0x4e69fa==='n'||_0x4e69fa==='no')_0x5be9f5(![]);else _0x5be9f5(_0xb131ff);}});});return Promise[_0x23b9b4(0x95)]([_0x439b1c,_0x55164e]);}function loadExisting(_0x5aee35){if(!existsSync(_0x5aee35))return null;return readConfigFile(_0x5aee35);}function resolveFilePath(_0xa314ca){const _0x4e045a=a31_0x3b9ca0;return isAbsolute(_0xa314ca)?_0xa314ca:resolve(process[_0x4e045a(0x92)](),_0xa314ca);}function readSourceFile(_0xa4fa7e){const _0x13ac79=a31_0x3b9ca0;try{const _0x1db252=readFileSync(_0xa4fa7e,{'encoding':_0x13ac79(0x81)});return JSON[_0x13ac79(0x8a)](_0x1db252);}catch(_0xfe7414){throw CliErrors[_0x13ac79(0x6b)](_0x13ac79(0xa5)+_0xfe7414['message']);}}function resolveInitEnv(_0x44c98d){const _0x371324=a31_0x3b9ca0,_0x419620=_0x44c98d[_0x371324(0x7f)];if(_0x419620===undefined||_0x419620==='')return DEFAULT_CONFIG_VALUES[_0x371324(0x7f)];if(!RUNTIME_ENV_VALUES['includes'](_0x419620))throw CliErrors['validation']('Invalid\x20env\x20\x22'+_0x419620+_0x371324(0x9c)+RUNTIME_ENV_VALUES[_0x371324(0x6f)](',\x20'));return _0x419620;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a32_0x38cf(){const _0x473426=['Created\x20KB\x20entry\x20','map','4nrlbRa','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','create','file','ragErrorMessage','metadata','bool','description','/client/knowledge-base/personal/create','81wsGiuc','/client/knowledge-base/personal/','length','string','16214720VCgEvi','ragStatus','score','POST','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Override\x20the\x20existing\x20entry\x20title','query','1gMUXZV','isFile','updateTime','--topk\x20must\x20be\x20a\x20positive\x20number.','Personal\x20knowledge-base\x20entry\x20title','update','version','body','File\x20is\x20not\x20a\x20regular\x20file:\x20','number','trim','1257618QnprHD','write','str','userId','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','File\x20not\x20found:\x20','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','utf8','455416RCGPwM','flag','File\x20path\x20is\x20required.','3022626YCMCBb','createTime','validation','num','4827690XtnnLJ','detail','scope','9469810BtVRJP','weightedScore','title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','1621534fOqaIx','read','search','topk','Search\x20query\x20is\x20required.','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','build','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','appCode','Personal\x20knowledge-base\x20entry\x20ID','isFinite'];a32_0x38cf=function(){return _0x473426;};return a32_0x38cf();}const a32_0x4a66af=a32_0x5e87;(function(_0x30528f,_0x49dbb9){const _0x353c92=a32_0x5e87,_0x28fda6=_0x30528f();while(!![]){try{const _0x1edcb8=parseInt(_0x353c92(0x191))/0x1*(-parseInt(_0x353c92(0x170))/0x2)+-parseInt(_0x353c92(0x165))/0x3*(-parseInt(_0x353c92(0x17d))/0x4)+parseInt(_0x353c92(0x169))/0x5+-parseInt(_0x353c92(0x19c))/0x6+-parseInt(_0x353c92(0x16c))/0x7+parseInt(_0x353c92(0x162))/0x8*(-parseInt(_0x353c92(0x186))/0x9)+parseInt(_0x353c92(0x18a))/0xa;if(_0x1edcb8===_0x49dbb9)break;else _0x28fda6['push'](_0x28fda6['shift']());}catch(_0x4b6a40){_0x28fda6['push'](_0x28fda6['shift']());}}}(a32_0x38cf,0xad191));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';function a32_0x5e87(_0x37dd87,_0x32e588){_0x37dd87=_0x37dd87-0x15d;const _0x38cfae=a32_0x38cf();let _0x5e8707=_0x38cfae[_0x37dd87];return _0x5e8707;}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x4a66af(0x16e),'type':a32_0x4a66af(0x189),'required':!![],'description':a32_0x4a66af(0x195)},FILE_FLAG={'name':a32_0x4a66af(0x180),'type':a32_0x4a66af(0x189),'required':!![],'description':a32_0x4a66af(0x16f)},QUERY_FLAG={'name':a32_0x4a66af(0x190),'type':a32_0x4a66af(0x189),'required':!![],'description':a32_0x4a66af(0x177)},TOPK_FLAG={'name':'topk','type':a32_0x4a66af(0x19a),'description':a32_0x4a66af(0x160)};function readKnowledgeFile(_0x372a86){const _0x173c6f=a32_0x4a66af;if(!_0x372a86)throw CliErrors[_0x173c6f(0x167)](_0x173c6f(0x164));if(!existsSync(_0x372a86))throw CliErrors[_0x173c6f(0x167)](_0x173c6f(0x15f)+_0x372a86);if(!statSync(_0x372a86)[_0x173c6f(0x192)]())throw CliErrors[_0x173c6f(0x167)](_0x173c6f(0x199)+_0x372a86);return readFileSync(_0x372a86,_0x173c6f(0x161));}function summarizePersonalItem(_0x28d9c5){const _0x2c866a=a32_0x4a66af;return{'id':_0x28d9c5['id'],'title':_0x28d9c5['title'],'version':_0x28d9c5[_0x2c866a(0x197)],'ragStatus':_0x28d9c5[_0x2c866a(0x18b)],'ragErrorMessage':_0x28d9c5['ragErrorMessage'],'updateTime':_0x28d9c5['updateTime']};}function detailPersonalItem(_0x243270){const _0x47939f=a32_0x4a66af;return{'id':_0x243270['id'],'appCode':_0x243270[_0x47939f(0x178)],'scope':_0x243270[_0x47939f(0x16b)],'userId':_0x243270[_0x47939f(0x15d)],'title':_0x243270[_0x47939f(0x16e)],'content':_0x243270['content']??'','version':_0x243270[_0x47939f(0x197)],'ragStatus':_0x243270['ragStatus'],'ragErrorMessage':_0x243270[_0x47939f(0x181)],'createTime':_0x243270[_0x47939f(0x166)],'updateTime':_0x243270[_0x47939f(0x193)]};}function summarizeSearchHit(_0x4b4147){const _0x324af7=a32_0x4a66af;return{'scope':_0x4b4147['scope'],'title':_0x4b4147[_0x324af7(0x16e)],'docId':_0x4b4147['docId'],'score':_0x4b4147[_0x324af7(0x18c)],'weightedScore':_0x4b4147[_0x324af7(0x16d)],'content':_0x4b4147['content'],'metadata':_0x4b4147[_0x324af7(0x182)]};}function readTopK(_0x2bf7af){const _0x437fbd=a32_0x4a66af,_0x1363b5=_0x2bf7af[_0x437fbd(0x163)](_0x437fbd(0x173));if(_0x1363b5===undefined||_0x1363b5===null||_0x1363b5==='')return undefined;const _0x43e61d=_0x2bf7af['num']('topk');if(!Number[_0x437fbd(0x17a)](_0x43e61d)||_0x43e61d<0x1)throw CliErrors[_0x437fbd(0x167)](_0x437fbd(0x194));return _0x43e61d;}const kbList={'service':'kb','command':'list','description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':a32_0x4a66af(0x171),'flags':[VERBOSE_FLAG],async 'execute'(_0x40cc65){const _0x40fa95=a32_0x4a66af,_0x4824be=await listPersonalKnowledgeBaseItems(_0x40cc65['appCode']);if(_0x40cc65[_0x40fa95(0x183)]('verbose'))return{'ok':!![],'data':{'total':_0x4824be[_0x40fa95(0x188)],'items':_0x4824be}};return{'ok':!![],'data':{'total':_0x4824be['length'],'items':_0x4824be['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x4a66af(0x16a),'description':a32_0x4a66af(0x17e),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x4a66af(0x179)}],async 'execute'(_0x24b75f){const _0x3287cb=a32_0x4a66af,_0x247e58=await getPersonalKnowledgeBaseItem(_0x24b75f['num']('id'),_0x24b75f[_0x3287cb(0x178)]);return{'ok':!![],'data':detailPersonalItem(_0x247e58)};}},kbCreate={'service':'kb','command':a32_0x4a66af(0x17f),'description':a32_0x4a66af(0x18e),'risk':a32_0x4a66af(0x19d),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x2414db){const _0x356b5f=a32_0x4a66af,_0x48b354=_0x2414db['str']('title'),_0x3d61b6=readKnowledgeFile(_0x2414db['str'](_0x356b5f(0x180))),_0x3b185c=await createPersonalKnowledgeBaseItem(_0x2414db[_0x356b5f(0x178)],{'title':_0x48b354,'content':_0x3d61b6});return{'ok':!![],'data':summarizePersonalItem(_0x3b185c),'message':_0x356b5f(0x17b)+_0x3b185c['id']+'\x20('+_0x3b185c[_0x356b5f(0x16e)]+')'};},async 'dryRun'(_0x1877d3){const _0xf12652=a32_0x4a66af,_0x5415d3=_0x1877d3[_0xf12652(0x19e)](_0xf12652(0x16e)),_0x28f782=readKnowledgeFile(_0x1877d3[_0xf12652(0x19e)](_0xf12652(0x180)));return dryRun(_0xf12652(0x18d),_0xf12652(0x185))[_0xf12652(0x198)]({'appCode':_0x1877d3[_0xf12652(0x178)],'title':_0x5415d3,'content':_0x28f782})[_0xf12652(0x184)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x5415d3+'\x22')[_0xf12652(0x176)]();}},kbUpdate={'service':'kb','command':a32_0x4a66af(0x196),'description':a32_0x4a66af(0x15e),'risk':a32_0x4a66af(0x19d),'flags':[{...ID_FLAG,'description':a32_0x4a66af(0x179)},{...TITLE_FLAG,'required':![],'description':a32_0x4a66af(0x18f)},FILE_FLAG],async 'execute'(_0x4fd612){const _0x3cab6c=a32_0x4a66af,_0x47b356=_0x4fd612[_0x3cab6c(0x168)]('id'),_0x38b257=readKnowledgeFile(_0x4fd612[_0x3cab6c(0x19e)](_0x3cab6c(0x180))),_0x34adc7=_0x4fd612[_0x3cab6c(0x19e)](_0x3cab6c(0x16e))||(await getPersonalKnowledgeBaseItem(_0x47b356,_0x4fd612['appCode']))[_0x3cab6c(0x16e)],_0x48fe80=await updatePersonalKnowledgeBaseItem(_0x47b356,_0x4fd612[_0x3cab6c(0x178)],{'title':_0x34adc7,'content':_0x38b257});return{'ok':!![],'data':summarizePersonalItem(_0x48fe80),'message':'Updated\x20KB\x20entry\x20'+_0x48fe80['id']+'\x20('+_0x48fe80[_0x3cab6c(0x16e)]+')'};},async 'dryRun'(_0x3e25a3){const _0x2e70f0=a32_0x4a66af,_0x171adf=_0x3e25a3['num']('id'),_0x1f65fd=readKnowledgeFile(_0x3e25a3['str'](_0x2e70f0(0x180))),_0x7e420=_0x3e25a3[_0x2e70f0(0x19e)](_0x2e70f0(0x16e))||(await getPersonalKnowledgeBaseItem(_0x171adf,_0x3e25a3[_0x2e70f0(0x178)]))[_0x2e70f0(0x16e)];return dryRun(_0x2e70f0(0x18d),_0x2e70f0(0x187)+_0x171adf+'/update')[_0x2e70f0(0x198)]({'appCode':_0x3e25a3[_0x2e70f0(0x178)],'title':_0x7e420,'content':_0x1f65fd})[_0x2e70f0(0x184)](_0x2e70f0(0x175)+_0x171adf)[_0x2e70f0(0x176)]();}},kbSearch={'service':'kb','command':a32_0x4a66af(0x172),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x4a66af(0x171),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x422832){const _0x4ee14e=a32_0x4a66af;if(!_0x422832['str'](_0x4ee14e(0x190))[_0x4ee14e(0x19b)]())throw CliErrors['validation'](_0x4ee14e(0x174));readTopK(_0x422832);},async 'execute'(_0x5be0f6){const _0xfece48=a32_0x4a66af,_0x435409=_0x5be0f6[_0xfece48(0x19e)](_0xfece48(0x190))['trim'](),_0x980b38=readTopK(_0x5be0f6),_0x12c155=await searchKnowledgeBase(_0x5be0f6['appCode'],{'query':_0x435409,'topK':_0x980b38});return{'ok':!![],'data':{'total':_0x12c155[_0xfece48(0x188)],'hits':_0x12c155[_0xfece48(0x17c)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0x1e0ad1=a33_0x2c47;(function(_0x5ca70b,_0x53fa88){const _0x2c86cf=a33_0x2c47,_0x239750=_0x5ca70b();while(!![]){try{const _0x27e465=-parseInt(_0x2c86cf(0x1b5))/0x1+parseInt(_0x2c86cf(0x1a8))/0x2+parseInt(_0x2c86cf(0x1b4))/0x3*(-parseInt(_0x2c86cf(0x1a6))/0x4)+parseInt(_0x2c86cf(0x1c1))/0x5+-parseInt(_0x2c86cf(0x1bb))/0x6+parseInt(_0x2c86cf(0x1a9))/0x7*(-parseInt(_0x2c86cf(0x1b0))/0x8)+parseInt(_0x2c86cf(0x1a3))/0x9;if(_0x27e465===_0x53fa88)break;else _0x239750['push'](_0x239750['shift']());}catch(_0x2aacbf){_0x239750['push'](_0x239750['shift']());}}}(a33_0x319b,0x34206));function a33_0x319b(){const _0x28078d=['*\x20No\x20logs\x20found','message','read','keys','success','level','8wbISWi','warn','Clear\x20command\x20history\x20logs','\x20logs:\x0a','3XSAlqj','42460sVGNJD','timestamp','duration','\x20\x20\x20Time:\x20','clearLogs','write','141030ImFMKB','details','log','readLogs','error','en-US','1514700ebbxAX','clear','*\x20Logs\x20cleared','toLocaleString','stringify','\x20\x20\x20Details:\x20','4827258uyoiNP','length','logs','1635220disQrB','command','20446XWJlwv','1128715ltjwLp'];a33_0x319b=function(){return _0x28078d;};return a33_0x319b();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x5695b1){const _0x56684e=a33_0x2c47;if(_0x5695b1[_0x56684e(0x1a4)]===0x0){console['log'](_0x56684e(0x1aa));return;}console[_0x56684e(0x1bd)]('*\x20'+CLI_DISPLAY_NAME+_0x56684e(0x1b3)),_0x5695b1['forEach']((_0x2953e4,_0x3015ad)=>{const _0x145707=_0x56684e,_0x58b72e=new Date(_0x2953e4[_0x145707(0x1b6)])[_0x145707(0x1c4)](_0x145707(0x1c0)),_0x308cfa=_0x2953e4[_0x145707(0x1af)]===_0x145707(0x1ae)?'√':_0x2953e4[_0x145707(0x1af)]===_0x145707(0x1bf)?'×':_0x2953e4['level']===_0x145707(0x1b1)?'!':'i';console[_0x145707(0x1bd)](_0x3015ad+0x1+'.\x20'+_0x308cfa+'\x20['+_0x2953e4[_0x145707(0x1a7)]+']\x20'+_0x2953e4[_0x145707(0x1ab)]),console[_0x145707(0x1bd)](_0x145707(0x1b8)+_0x58b72e),_0x2953e4[_0x145707(0x1b7)]&&console[_0x145707(0x1bd)]('\x20\x20\x20Duration:\x20'+_0x2953e4['duration']+'ms'),_0x2953e4[_0x145707(0x1bc)]&&Object[_0x145707(0x1ad)](_0x2953e4['details'])[_0x145707(0x1a4)]>0x0&&console['log'](_0x145707(0x1a2)+JSON[_0x145707(0x1c5)](_0x2953e4[_0x145707(0x1bc)],null,0x2)),console[_0x145707(0x1bd)]('');});}function a33_0x2c47(_0x5eaad2,_0x576eb3){_0x5eaad2=_0x5eaad2-0x1a2;const _0x319bff=a33_0x319b();let _0x2c4758=_0x319bff[_0x5eaad2];return _0x2c4758;}export const logsDefinitions=[{'service':a33_0x1e0ad1(0x1a5),'command':'show','description':'View\x20command\x20history\x20logs','risk':a33_0x1e0ad1(0x1ac),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x31edf1){const _0x3df498=a33_0x1e0ad1;return printLogs(logger[_0x3df498(0x1be)]()),{'ok':!![]};}},{'service':'logs','command':a33_0x1e0ad1(0x1c2),'description':a33_0x1e0ad1(0x1b2),'risk':a33_0x1e0ad1(0x1ba),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2de784){const _0x17c77d=a33_0x1e0ad1;return logger[_0x17c77d(0x1b9)](),console[_0x17c77d(0x1bd)](_0x17c77d(0x1c3)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x1ce356=a34_0x3bc2;function a34_0x3bc2(_0x3e8584,_0x37a5c0){_0x3e8584=_0x3e8584-0xc6;const _0x5b5d0f=a34_0x5b5d();let _0x3bc2ac=_0x5b5d0f[_0x3e8584];return _0x3bc2ac;}(function(_0x3bf018,_0x1aea98){const _0x234314=a34_0x3bc2,_0x505bbd=_0x3bf018();while(!![]){try{const _0x439bc7=parseInt(_0x234314(0xc9))/0x1+parseInt(_0x234314(0xd2))/0x2+-parseInt(_0x234314(0xe8))/0x3+parseInt(_0x234314(0xe7))/0x4+parseInt(_0x234314(0xdf))/0x5+-parseInt(_0x234314(0xeb))/0x6+-parseInt(_0x234314(0xdc))/0x7*(parseInt(_0x234314(0xe1))/0x8);if(_0x439bc7===_0x1aea98)break;else _0x505bbd['push'](_0x505bbd['shift']());}catch(_0x2aa2fb){_0x505bbd['push'](_0x505bbd['shift']());}}}(a34_0x5b5d,0xee27f));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x5b5d(){const _0x4bd6b1=['filePath','/client/ocr','length','image-url','path','\x20OCR\x20from\x20URL','Unsupported\x20OCR\x20scene:\x20','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','string','invoice','idCard','File\x20URL\x20response\x20missing\x20fileUrl.','Invoice','/client/uploadFile','write','1538820TSmOJq','ocr','toLowerCase','validation','trim','/client/queryFileUrl','\x20OCR','<filePath\x20returned\x20by\x20/client/uploadFile>','apiError','2401806HQQyOF','str','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','fileUrl','filter','appCode','POST','body','Table','General','413qkZCCj','recognize','image-file','813210iRYXEn','count','121888QJxgTc','general','description','scene','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','imageFile','1734888wsqwlx','2586966luFapY','IdCard','imageUrl','3596124Gnesgd'];a34_0x5b5d=function(){return _0x4bd6b1;};return a34_0x5b5d();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x1ce356(0xf5),a34_0x1ce356(0xe2),'form',a34_0x1ce356(0xf6)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x1ce356(0xc6),'general':a34_0x1ce356(0xdb),'form':a34_0x1ce356(0xda),'idCard':a34_0x1ce356(0xe9)},SCENE_FLAG={'name':a34_0x1ce356(0xe4),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x1ce356(0xf3)},IMAGE_FILE_FLAG={'name':a34_0x1ce356(0xde),'type':a34_0x1ce356(0xf4),'description':a34_0x1ce356(0xd4)},IMAGE_URL_FLAG={'name':a34_0x1ce356(0xef),'type':a34_0x1ce356(0xf4),'description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x50c084){const _0x506485=a34_0x1ce356,_0x4da020=_0x50c084[_0x506485(0xcd)]()[_0x506485(0xcb)]();if(_0x4da020==='idcard')return'idCard';if(_0x4da020===_0x506485(0xf5)||_0x4da020===_0x506485(0xe2)||_0x4da020==='form')return _0x4da020;throw CliErrors[_0x506485(0xcc)](_0x506485(0xf2)+_0x50c084+'.\x20Supported\x20scenes:\x20'+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x2113f9){const _0x752132=a34_0x1ce356,_0x23445c=_0x2113f9[_0x752132(0xd3)]('image-file')[_0x752132(0xcd)](),_0x1a6c92=_0x2113f9[_0x752132(0xd3)](_0x752132(0xef))[_0x752132(0xcd)]();return{'imageFile':_0x23445c,'imageUrl':_0x1a6c92,'count':[_0x23445c,_0x1a6c92][_0x752132(0xd6)](Boolean)[_0x752132(0xee)]};}function validateInputSelection(_0xc8429a){const _0x32617b=a34_0x1ce356,_0x4c4290=selectedInputs(_0xc8429a);if(_0x4c4290[_0x32617b(0xe0)]!==0x1)throw CliErrors[_0x32617b(0xcc)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x4c4290;}function withScene(_0x7f9b16,_0x3fd5f2,_0x409e02){const _0x102251=a34_0x1ce356;return{..._0x7f9b16,'scene':_0x3fd5f2,..._0x409e02?{'sourceFile':{'fileName':_0x409e02['fileName'],'filePath':_0x409e02[_0x102251(0xec)]}}:{}};}const ocrRecognize={'service':a34_0x1ce356(0xca),'command':a34_0x1ce356(0xdd),'description':a34_0x1ce356(0xe5),'risk':a34_0x1ce356(0xc8),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x578749){const _0x3e4a73=a34_0x1ce356,_0x3314cd=normalizeScene(_0x578749['str'](_0x3e4a73(0xe4))),_0x558435=SCENE_TO_LEGACY_TYPE[_0x3314cd],_0x28c2e8=validateInputSelection(_0x578749);if(_0x28c2e8[_0x3e4a73(0xea)])return dryRun(_0x3e4a73(0xd8),_0x3e4a73(0xed))[_0x3e4a73(0xd9)]({'appCode':_0x578749[_0x3e4a73(0xd7)],'url':_0x28c2e8['imageUrl'],'type':_0x558435})['description']('Preview:\x20recognize\x20'+_0x3314cd+_0x3e4a73(0xf1))['build']();const _0x29f655=requireRuntimeUploadFile(_0x28c2e8[_0x3e4a73(0xe6)],_0x3e4a73(0xde));return dryRun(_0x3e4a73(0xd8),_0x3e4a73(0xc7))[_0x3e4a73(0xd9)]({'steps':[{'method':_0x3e4a73(0xd8),'url':_0x3e4a73(0xc7),'body':{'appCode':_0x578749[_0x3e4a73(0xd7)],'multipart':{'file':_0x29f655}}},{'method':_0x3e4a73(0xd8),'url':_0x3e4a73(0xce),'body':{'filePath':_0x3e4a73(0xd0),'downloadFlag':![]}},{'method':_0x3e4a73(0xd8),'url':'/client/ocr','body':{'appCode':_0x578749['appCode'],'url':'<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','type':_0x558435}}]})[_0x3e4a73(0xe3)]('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x3314cd+_0x3e4a73(0xcf))['build']();},async 'execute'(_0x36362c){const _0xf5507d=a34_0x1ce356,_0x223252=normalizeScene(_0x36362c[_0xf5507d(0xd3)](_0xf5507d(0xe4))),_0x44f50e=SCENE_TO_LEGACY_TYPE[_0x223252],_0x504465=validateInputSelection(_0x36362c);if(_0x504465[_0xf5507d(0xea)]){const _0xe10ecd=await recognizeRuntimeOcr(_0x36362c[_0xf5507d(0xd7)],{'url':_0x504465['imageUrl'],'type':_0x44f50e});return{'ok':!![],'data':withScene(_0xe10ecd,_0x223252)};}const _0x1ae339=requireRuntimeUploadFile(_0x504465[_0xf5507d(0xe6)],_0xf5507d(0xde)),_0x5ea90d=await uploadRuntimeFile(_0x36362c[_0xf5507d(0xd7)],_0x1ae339[_0xf5507d(0xf0)]);if(!_0x5ea90d['filePath'])throw CliErrors['apiError']('File\x20upload\x20response\x20missing\x20filePath.');const _0x45b210=await queryRuntimeFileUrl(_0x5ea90d[_0xf5507d(0xec)],{'download':![]});if(!_0x45b210['fileUrl'])throw CliErrors[_0xf5507d(0xd1)](_0xf5507d(0xf7));const _0x9a5b80=await recognizeRuntimeOcr(_0x36362c[_0xf5507d(0xd7)],{'url':_0x45b210[_0xf5507d(0xd5)],'type':_0x44f50e});return{'ok':!![],'data':withScene(_0x9a5b80,_0x223252,_0x5ea90d)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x11c540=a35_0x22bd;(function(_0x46b439,_0x80ec2c){const _0x11898c=a35_0x22bd,_0x543ad7=_0x46b439();while(!![]){try{const _0x353afd=-parseInt(_0x11898c(0x1b3))/0x1*(-parseInt(_0x11898c(0x1ea))/0x2)+parseInt(_0x11898c(0x1c7))/0x3+-parseInt(_0x11898c(0x1bb))/0x4+parseInt(_0x11898c(0x1cc))/0x5+-parseInt(_0x11898c(0x1c5))/0x6+parseInt(_0x11898c(0x1ae))/0x7*(parseInt(_0x11898c(0x1bc))/0x8)+-parseInt(_0x11898c(0x1ec))/0x9;if(_0x353afd===_0x80ec2c)break;else _0x543ad7['push'](_0x543ad7['shift']());}catch(_0x11daca){_0x543ad7['push'](_0x543ad7['shift']());}}}(a35_0x3a32,0xc97c1));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a35_0x22bd(_0x20f1b2,_0x297fd4){_0x20f1b2=_0x20f1b2-0x1a6;const _0x3a32ec=a35_0x3a32();let _0x22bdf1=_0x3a32ec[_0x20f1b2];return _0x22bdf1;}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_0x11c540(0x1df),'type':a35_0x11c540(0x1b9),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x11c540(0x1d7),'type':a35_0x11c540(0x1b9),'required':!![],'description':a35_0x11c540(0x1c6)},DESCRIPTION_FLAG={'name':a35_0x11c540(0x1c1),'type':a35_0x11c540(0x1b9),'description':a35_0x11c540(0x1b4)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0x11c540(0x1d0)};function a35_0x3a32(){const _0x3b78af=['flag','scriptContent','Show\x20one\x20personal\x20BFF\x20by\x20id','create','list','scriptType','name','num','isFile','functionName','build','gmtCreate','verbose','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','file','length','Created\x20personal\x20BFF\x20','sourceSessionId','/client/runtime-bff/personal/','personal-bff','Executed\x20personal\x20BFF\x20','read','gmtModified','source-session-id','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','20eIxvlq','updateTime','3934296RnJZQC','File\x20not\x20found:\x20','Preview:\x20create\x20personal\x20BFF\x20','Preview:\x20update\x20personal\x20BFF\x20','/update','params','Personal\x20BFF\x20script\x20ID','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','test','266QEMVIB','/client/runtime-bff/personal/create','createUserId','utf8','POST','143028oqZXrN','Personal\x20BFF\x20description','validation','version','keys','bool','string','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','4484012FfjmqV','137544LALuiJ','appCode','Update\x20a\x20personal\x20BFF\x20by\x20id','File\x20path\x20is\x20required.','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','description','detail','createTime','update','6773112zsZKDd','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','2849790bhJhUS','Updated\x20personal\x20BFF\x20','str','high-risk-write','write','2393680masfqm','trim','File\x20is\x20not\x20a\x20regular\x20file:\x20','config','Optional\x20source\x20RuntimeAgent\x20session\x20id'];a35_0x3a32=function(){return _0x3b78af;};return a35_0x3a32();}function normalizeFunctionName(_0x3a0e4d){const _0x426c01=a35_0x11c540,_0x508bcc=String(_0x3a0e4d||'')[_0x426c01(0x1cd)]();if(!_0x508bcc||!FUNCTION_NAME_PATTERN[_0x426c01(0x1ad)](_0x508bcc))throw CliErrors[_0x426c01(0x1b5)](_0x426c01(0x1c0));return _0x508bcc;}function readScriptFile(_0x1fc448){const _0x211282=a35_0x11c540;if(!_0x1fc448)throw CliErrors['validation'](_0x211282(0x1bf));if(!existsSync(_0x1fc448))throw CliErrors[_0x211282(0x1b5)](_0x211282(0x1a6)+_0x1fc448);if(!statSync(_0x1fc448)[_0x211282(0x1d9)]())throw CliErrors[_0x211282(0x1b5)](_0x211282(0x1ce)+_0x1fc448);const _0x2bf28d=readFileSync(_0x1fc448,_0x211282(0x1b1));if(!_0x2bf28d['trim']())throw CliErrors[_0x211282(0x1b5)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x2bf28d;}function optionalTrimmed(_0x22adea){const _0x89d095=a35_0x11c540,_0x233833=String(_0x22adea||'')[_0x89d095(0x1cd)]();return _0x233833||undefined;}function summarizeBff(_0x44baee){const _0x4b3b09=a35_0x11c540;return{'id':_0x44baee['id'],'appCode':_0x44baee['appCode'],'functionName':_0x44baee[_0x4b3b09(0x1da)],'description':_0x44baee[_0x4b3b09(0x1c1)],'scriptType':_0x44baee[_0x4b3b09(0x1d6)],'version':_0x44baee[_0x4b3b09(0x1b6)],'gmtModified':_0x44baee[_0x4b3b09(0x1e7)],'updateTime':_0x44baee[_0x4b3b09(0x1eb)]};}function detailBff(_0x256240){const _0x4eaf86=a35_0x11c540;return{'id':_0x256240['id'],'appCode':_0x256240['appCode'],'functionName':_0x256240['functionName'],'description':_0x256240[_0x4eaf86(0x1c1)],'scriptType':_0x256240[_0x4eaf86(0x1d6)],'scriptContent':_0x256240[_0x4eaf86(0x1d2)]??'','config':_0x256240[_0x4eaf86(0x1cf)],'version':_0x256240[_0x4eaf86(0x1b6)],'createUserId':_0x256240[_0x4eaf86(0x1b0)],'gmtCreate':_0x256240[_0x4eaf86(0x1dc)],'gmtModified':_0x256240[_0x4eaf86(0x1e7)],'createTime':_0x256240[_0x4eaf86(0x1c3)],'updateTime':_0x256240[_0x4eaf86(0x1eb)]};}function buildCreateInput(_0x1a044f){const _0x5744f7=a35_0x11c540;return{'functionName':normalizeFunctionName(_0x1a044f[_0x5744f7(0x1c9)](_0x5744f7(0x1d7))),...optionalTrimmed(_0x1a044f[_0x5744f7(0x1c9)](_0x5744f7(0x1c1)))?{'description':optionalTrimmed(_0x1a044f['str'](_0x5744f7(0x1c1)))}:{},'scriptContent':readScriptFile(_0x1a044f[_0x5744f7(0x1c9)](_0x5744f7(0x1df))),...optionalTrimmed(_0x1a044f[_0x5744f7(0x1c9)](_0x5744f7(0x1e8)))?{'sourceSessionId':optionalTrimmed(_0x1a044f[_0x5744f7(0x1c9)](_0x5744f7(0x1e8)))}:{}};}function buildUpdateInput(_0x52e1b9){const _0x41782d=a35_0x11c540,_0xc0adeb={};optionalTrimmed(_0x52e1b9[_0x41782d(0x1c9)](_0x41782d(0x1d7)))&&(_0xc0adeb[_0x41782d(0x1da)]=normalizeFunctionName(_0x52e1b9[_0x41782d(0x1c9)](_0x41782d(0x1d7))));_0x52e1b9[_0x41782d(0x1d1)]('description')!==undefined&&(_0xc0adeb[_0x41782d(0x1c1)]=_0x52e1b9[_0x41782d(0x1c9)](_0x41782d(0x1c1)));optionalTrimmed(_0x52e1b9[_0x41782d(0x1c9)](_0x41782d(0x1df)))&&(_0xc0adeb[_0x41782d(0x1d2)]=readScriptFile(_0x52e1b9[_0x41782d(0x1c9)](_0x41782d(0x1df))));_0x52e1b9[_0x41782d(0x1d1)](_0x41782d(0x1e8))!==undefined&&(_0xc0adeb[_0x41782d(0x1e2)]=_0x52e1b9['str']('source-session-id'));if(Object[_0x41782d(0x1b7)](_0xc0adeb)[_0x41782d(0x1e0)]===0x0)throw CliErrors[_0x41782d(0x1b5)](_0x41782d(0x1ac));return _0xc0adeb;}function parseExecParams(_0x2e17e1){const _0x4bf125=a35_0x11c540,_0x3ff6d4=parseJsonParams(_0x2e17e1)??{};if(Array['isArray'](_0x3ff6d4))throw CliErrors[_0x4bf125(0x1b5)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3ff6d4;}const personalBffList={'service':a35_0x11c540(0x1e4),'command':a35_0x11c540(0x1d5),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x11c540(0x1e6),'flags':[VERBOSE_FLAG],async 'execute'(_0x45d888){const _0x2b046c=a35_0x11c540,_0x3856aa=await listPersonalBffs(_0x45d888['appCode']);return{'ok':!![],'data':{'total':_0x3856aa[_0x2b046c(0x1e0)],'items':_0x45d888[_0x2b046c(0x1b8)](_0x2b046c(0x1dd))?_0x3856aa:_0x3856aa['map'](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x11c540(0x1c2),'description':a35_0x11c540(0x1d3),'risk':a35_0x11c540(0x1e6),'flags':[{...ID_FLAG,'description':a35_0x11c540(0x1ab)}],async 'execute'(_0x5bf0c9){const _0x2371ed=a35_0x11c540,_0x21f9e2=await getPersonalBff(_0x5bf0c9[_0x2371ed(0x1d8)]('id'),_0x5bf0c9[_0x2371ed(0x1bd)]);return{'ok':!![],'data':detailBff(_0x21f9e2)};}},personalBffCreate={'service':a35_0x11c540(0x1e4),'command':a35_0x11c540(0x1d4),'description':a35_0x11c540(0x1de),'risk':a35_0x11c540(0x1cb),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x46f6a0){const _0x229acf=a35_0x11c540,_0x32ef5d=buildCreateInput(_0x46f6a0),_0xe59d92=await createPersonalBff(_0x46f6a0['appCode'],_0x32ef5d);return{'ok':!![],'data':detailBff(_0xe59d92),'message':_0x229acf(0x1e1)+_0xe59d92['id']+(_0xe59d92[_0x229acf(0x1da)]?'\x20('+_0xe59d92['functionName']+')':'')};},async 'dryRun'(_0x3a1671){const _0x57e314=a35_0x11c540,_0x3f323b=buildCreateInput(_0x3a1671);return dryRun(_0x57e314(0x1b2),_0x57e314(0x1af))['body']({'appCode':_0x3a1671['appCode'],..._0x3f323b})[_0x57e314(0x1c1)](_0x57e314(0x1a7)+_0x3f323b[_0x57e314(0x1da)])[_0x57e314(0x1db)]();}},personalBffUpdate={'service':a35_0x11c540(0x1e4),'command':a35_0x11c540(0x1c4),'description':a35_0x11c540(0x1be),'risk':a35_0x11c540(0x1cb),'flags':[{...ID_FLAG,'description':a35_0x11c540(0x1ab)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3e4e6a){const _0x5d52f5=a35_0x11c540,_0xf0f54d=_0x3e4e6a['num']('id'),_0x228461=buildUpdateInput(_0x3e4e6a),_0x44d39e=await updatePersonalBff(_0xf0f54d,_0x3e4e6a[_0x5d52f5(0x1bd)],_0x228461);return{'ok':!![],'data':detailBff(_0x44d39e),'message':_0x5d52f5(0x1c8)+_0x44d39e['id']+(_0x44d39e[_0x5d52f5(0x1da)]?'\x20('+_0x44d39e[_0x5d52f5(0x1da)]+')':'')};},async 'dryRun'(_0x17f6cd){const _0x2dc4a6=a35_0x11c540,_0x3b14c5=_0x17f6cd[_0x2dc4a6(0x1d8)]('id'),_0x9c7d7b=buildUpdateInput(_0x17f6cd);return dryRun('POST',_0x2dc4a6(0x1e3)+_0x3b14c5+_0x2dc4a6(0x1a9))['body']({'appCode':_0x17f6cd[_0x2dc4a6(0x1bd)],..._0x9c7d7b})[_0x2dc4a6(0x1c1)](_0x2dc4a6(0x1a8)+_0x3b14c5)['build']();}},personalBffExec={'service':'personal-bff','command':'exec','description':a35_0x11c540(0x1e9),'risk':a35_0x11c540(0x1ca),'flags':[{...ID_FLAG,'description':a35_0x11c540(0x1ab)},{...PARAMS_FLAG,'description':a35_0x11c540(0x1ba)}],async 'validate'(_0x19cf0b){const _0x27215b=a35_0x11c540;parseExecParams(_0x19cf0b['str'](_0x27215b(0x1aa)));},async 'execute'(_0x1e6f02){const _0x5c1228=a35_0x11c540,_0x780e3d=_0x1e6f02[_0x5c1228(0x1d8)]('id'),_0x303d0e=parseExecParams(_0x1e6f02[_0x5c1228(0x1c9)](_0x5c1228(0x1aa))),_0x49b9a5=await executePersonalBff(_0x780e3d,_0x1e6f02[_0x5c1228(0x1bd)],_0x303d0e);return{'ok':!![],'data':{'result':_0x49b9a5},'message':_0x5c1228(0x1e5)+_0x780e3d};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x2948b1=a35_0x1272;(function(_0x11a5c8,_0x1bf0b2){const _0xb12ee=a35_0x1272,_0x29a4f9=_0x11a5c8();while(!![]){try{const _0x1e7520=-parseInt(_0xb12ee(0xc0))/0x1*(parseInt(_0xb12ee(0xac))/0x2)+-parseInt(_0xb12ee(0xb2))/0x3*(-parseInt(_0xb12ee(0xc3))/0x4)+parseInt(_0xb12ee(0xc9))/0x5*(parseInt(_0xb12ee(0x99))/0x6)+-parseInt(_0xb12ee(0x95))/0x7+-parseInt(_0xb12ee(0xc1))/0x8*(-parseInt(_0xb12ee(0xa9))/0x9)+-parseInt(_0xb12ee(0xa7))/0xa+parseInt(_0xb12ee(0xa8))/0xb*(-parseInt(_0xb12ee(0x96))/0xc);if(_0x1e7520===_0x1bf0b2)break;else _0x29a4f9['push'](_0x29a4f9['shift']());}catch(_0x362a25){_0x29a4f9['push'](_0x29a4f9['shift']());}}}(a35_0x18af,0x35ae7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x2948b1(0xd4),'type':a35_0x2948b1(0xd7),'description':a35_0x2948b1(0xd5)},FUNCTION_NAME_FLAG={'name':a35_0x2948b1(0xa0),'type':a35_0x2948b1(0xd7),'required':!![],'description':a35_0x2948b1(0xcc)},DESCRIPTION_FLAG={'name':a35_0x2948b1(0xcb),'type':'string','description':a35_0x2948b1(0xaa)},SOURCE_SESSION_FLAG={'name':a35_0x2948b1(0xaf),'type':'string','description':a35_0x2948b1(0x9c)};function normalizeFunctionName(_0x29a2bf){const _0x8fb16c=a35_0x2948b1,_0x259327=String(_0x29a2bf||'')['trim']();if(!_0x259327||!FUNCTION_NAME_PATTERN[_0x8fb16c(0xb5)](_0x259327))throw CliErrors['validation'](_0x8fb16c(0xa1));return _0x259327;}function a35_0x18af(){const _0x47fb31=['POST','57gWcxMf','1353736lvpVxp','read','4972zLVHqD','Preview:\x20update\x20personal\x20BFF\x20','/update','scriptContent','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','high-risk-write','35XPXaNj','bool','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','flag','list','/client/runtime-bff/personal/create','File\x20is\x20not\x20a\x20regular\x20file:\x20','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','personal-bff','keys','file','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','version','string','str','build','gmtModified','Preview:\x20create\x20personal\x20BFF\x20','243691WUUjbR','804zIsdNb','updateTime','scriptType','149712MdMfKT','File\x20not\x20found:\x20','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Optional\x20source\x20RuntimeAgent\x20session\x20id','appCode','trim','params','name','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','exec','map','write','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20ID','1326090NcqMKp','22517nYQaUs','9AUQuSJ','Personal\x20BFF\x20description','Created\x20personal\x20BFF\x20','9060AqIIoc','create','verbose','source-session-id','Show\x20one\x20personal\x20BFF\x20by\x20id','Executed\x20personal\x20BFF\x20','1059QzwSVc','validation','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','test','isArray','Update\x20a\x20personal\x20BFF\x20by\x20id','length','num','createTime','gmtCreate','detail','utf8','functionName'];a35_0x18af=function(){return _0x47fb31;};return a35_0x18af();}function readScriptFile(_0x1e4fe2){const _0x3ebd76=a35_0x2948b1;if(!_0x1e4fe2)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x1e4fe2))throw CliErrors[_0x3ebd76(0xb3)](_0x3ebd76(0x9a)+_0x1e4fe2);if(!statSync(_0x1e4fe2)['isFile']())throw CliErrors[_0x3ebd76(0xb3)](_0x3ebd76(0xd0)+_0x1e4fe2);const _0x5166ac=readFileSync(_0x1e4fe2,_0x3ebd76(0xbd));if(!_0x5166ac['trim']())throw CliErrors[_0x3ebd76(0xb3)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x5166ac;}function optionalTrimmed(_0x4cd7e3){const _0x436bc3=a35_0x2948b1,_0x3a4069=String(_0x4cd7e3||'')[_0x436bc3(0x9e)]();return _0x3a4069||undefined;}function summarizeBff(_0x1a2c30){const _0x23e485=a35_0x2948b1;return{'id':_0x1a2c30['id'],'appCode':_0x1a2c30[_0x23e485(0x9d)],'functionName':_0x1a2c30[_0x23e485(0xbe)],'description':_0x1a2c30[_0x23e485(0xcb)],'scriptType':_0x1a2c30[_0x23e485(0x98)],'version':_0x1a2c30[_0x23e485(0xd6)],'gmtModified':_0x1a2c30[_0x23e485(0xda)],'updateTime':_0x1a2c30[_0x23e485(0x97)]};}function detailBff(_0x18ad2e){const _0x176cee=a35_0x2948b1;return{'id':_0x18ad2e['id'],'appCode':_0x18ad2e[_0x176cee(0x9d)],'functionName':_0x18ad2e[_0x176cee(0xbe)],'description':_0x18ad2e['description'],'scriptType':_0x18ad2e[_0x176cee(0x98)],'scriptContent':_0x18ad2e[_0x176cee(0xc6)]??'','config':_0x18ad2e['config'],'version':_0x18ad2e['version'],'createUserId':_0x18ad2e['createUserId'],'gmtCreate':_0x18ad2e[_0x176cee(0xbb)],'gmtModified':_0x18ad2e[_0x176cee(0xda)],'createTime':_0x18ad2e[_0x176cee(0xba)],'updateTime':_0x18ad2e['updateTime']};}function buildCreateInput(_0x2b5c6d){const _0x46adda=a35_0x2948b1;return{'functionName':normalizeFunctionName(_0x2b5c6d[_0x46adda(0xd8)]('name')),...optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xcb)))?{'description':optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xcb)))}:{},'scriptContent':readScriptFile(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xd4))),...optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xaf)))?{'sourceSessionId':optionalTrimmed(_0x2b5c6d['str'](_0x46adda(0xaf)))}:{}};}function buildUpdateInput(_0x297a10){const _0x3ec440=a35_0x2948b1,_0x1b8edd={};optionalTrimmed(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xa0)))&&(_0x1b8edd['functionName']=normalizeFunctionName(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xa0))));_0x297a10[_0x3ec440(0xcd)]('description')!==undefined&&(_0x1b8edd[_0x3ec440(0xcb)]=_0x297a10[_0x3ec440(0xd8)]('description'));optionalTrimmed(_0x297a10['str']('file'))&&(_0x1b8edd[_0x3ec440(0xc6)]=readScriptFile(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xd4))));_0x297a10[_0x3ec440(0xcd)](_0x3ec440(0xaf))!==undefined&&(_0x1b8edd['sourceSessionId']=_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xaf)));if(Object[_0x3ec440(0xd3)](_0x1b8edd)['length']===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x1b8edd;}function a35_0x1272(_0x235d6b,_0x455c43){_0x235d6b=_0x235d6b-0x95;const _0x18af9e=a35_0x18af();let _0x1272da=_0x18af9e[_0x235d6b];return _0x1272da;}function parseExecParams(_0x52f11f){const _0xa4d615=a35_0x2948b1,_0x32c92f=parseJsonParams(_0x52f11f)??{};if(Array[_0xa4d615(0xb6)](_0x32c92f))throw CliErrors[_0xa4d615(0xb3)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x32c92f;}const personalBffList={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xce),'description':a35_0x2948b1(0xd1),'risk':a35_0x2948b1(0xc2),'flags':[VERBOSE_FLAG],async 'execute'(_0x407224){const _0x2fdf1d=a35_0x2948b1,_0x3c559d=await listPersonalBffs(_0x407224[_0x2fdf1d(0x9d)]);return{'ok':!![],'data':{'total':_0x3c559d[_0x2fdf1d(0xb8)],'items':_0x407224[_0x2fdf1d(0xca)](_0x2fdf1d(0xae))?_0x3c559d:_0x3c559d[_0x2fdf1d(0xa3)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x2948b1(0xbc),'description':a35_0x2948b1(0xb0),'risk':a35_0x2948b1(0xc2),'flags':[{...ID_FLAG,'description':a35_0x2948b1(0xa6)}],async 'execute'(_0x12c26c){const _0x391710=a35_0x2948b1,_0x226dfb=await getPersonalBff(_0x12c26c[_0x391710(0xb9)]('id'),_0x12c26c['appCode']);return{'ok':!![],'data':detailBff(_0x226dfb)};}},personalBffCreate={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xad),'description':a35_0x2948b1(0x9b),'risk':a35_0x2948b1(0xa4),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x512468){const _0x4320cd=a35_0x2948b1,_0x57b226=buildCreateInput(_0x512468),_0x3ee774=await createPersonalBff(_0x512468[_0x4320cd(0x9d)],_0x57b226);return{'ok':!![],'data':detailBff(_0x3ee774),'message':_0x4320cd(0xab)+_0x3ee774['id']+(_0x3ee774['functionName']?'\x20('+_0x3ee774[_0x4320cd(0xbe)]+')':'')};},async 'dryRun'(_0x572f9a){const _0x5c90a7=a35_0x2948b1,_0x5489c1=buildCreateInput(_0x572f9a);return dryRun(_0x5c90a7(0xbf),_0x5c90a7(0xcf))['body']({'appCode':_0x572f9a[_0x5c90a7(0x9d)],..._0x5489c1})[_0x5c90a7(0xcb)](_0x5c90a7(0xdb)+_0x5489c1[_0x5c90a7(0xbe)])[_0x5c90a7(0xd9)]();}},personalBffUpdate={'service':a35_0x2948b1(0xd2),'command':'update','description':a35_0x2948b1(0xb7),'risk':a35_0x2948b1(0xa4),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5c619a){const _0x58cdeb=a35_0x2948b1,_0x3fca5e=_0x5c619a[_0x58cdeb(0xb9)]('id'),_0x16f65d=buildUpdateInput(_0x5c619a),_0x17da71=await updatePersonalBff(_0x3fca5e,_0x5c619a[_0x58cdeb(0x9d)],_0x16f65d);return{'ok':!![],'data':detailBff(_0x17da71),'message':_0x58cdeb(0xa5)+_0x17da71['id']+(_0x17da71[_0x58cdeb(0xbe)]?'\x20('+_0x17da71['functionName']+')':'')};},async 'dryRun'(_0xa83bd1){const _0x482f15=a35_0x2948b1,_0x22e349=_0xa83bd1['num']('id'),_0x2363d8=buildUpdateInput(_0xa83bd1);return dryRun(_0x482f15(0xbf),'/client/runtime-bff/personal/'+_0x22e349+_0x482f15(0xc5))['body']({'appCode':_0xa83bd1[_0x482f15(0x9d)],..._0x2363d8})['description'](_0x482f15(0xc4)+_0x22e349)[_0x482f15(0xd9)]();}},personalBffExec={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xa2),'description':a35_0x2948b1(0xb4),'risk':a35_0x2948b1(0xc8),'flags':[{...ID_FLAG,'description':a35_0x2948b1(0xa6)},{...PARAMS_FLAG,'description':a35_0x2948b1(0xc7)}],async 'validate'(_0x3aa431){const _0x22b7ed=a35_0x2948b1;parseExecParams(_0x3aa431[_0x22b7ed(0xd8)]('params'));},async 'execute'(_0x4a2df4){const _0x5e0616=a35_0x2948b1,_0x87f9e7=_0x4a2df4[_0x5e0616(0xb9)]('id'),_0x50a2c7=parseExecParams(_0x4a2df4[_0x5e0616(0xd8)](_0x5e0616(0x9f))),_0x7c657b=await executePersonalBff(_0x87f9e7,_0x4a2df4[_0x5e0616(0x9d)],_0x50a2c7);return{'ok':!![],'data':{'result':_0x7c657b},'message':_0x5e0616(0xb1)+_0x87f9e7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2b6b1f=a36_0x37cb;(function(_0x4806a0,_0x35ea76){const _0xded7d0=a36_0x37cb,_0x352906=_0x4806a0();while(!![]){try{const _0x1f335d=parseInt(_0xded7d0(0x18a))/0x1*(parseInt(_0xded7d0(0x1a2))/0x2)+-parseInt(_0xded7d0(0x18b))/0x3+-parseInt(_0xded7d0(0x19f))/0x4*(parseInt(_0xded7d0(0x1a7))/0x5)+-parseInt(_0xded7d0(0x1a8))/0x6*(parseInt(_0xded7d0(0x17b))/0x7)+-parseInt(_0xded7d0(0x188))/0x8*(parseInt(_0xded7d0(0x185))/0x9)+-parseInt(_0xded7d0(0x183))/0xa+parseInt(_0xded7d0(0x18d))/0xb;if(_0x1f335d===_0x35ea76)break;else _0x352906['push'](_0x352906['shift']());}catch(_0x5b43e1){_0x352906['push'](_0x352906['shift']());}}}(a36_0x16bb,0x82733));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';function a36_0x37cb(_0x276619,_0x23cc7f){_0x276619=_0x276619-0x17a;const _0x16bb21=a36_0x16bb();let _0x37cb0a=_0x16bb21[_0x276619];return _0x37cb0a;}import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0x16bb(){const _0xfcc700=['CLI\x20Built-in\x20Skill','has','Artifacts','service','risk','\x20\x20[write]','Instant\x20API','1901756IeTKIx','set','Self\x20Update','19730iXWuGC','command','Skills','Authentication','write','5XbtWRo','404988mYihnh','SQL\x20Queries','Knowledge\x20Base','14ZrVnmc','File','list','push','show','map','description','API\x20Documentation','513020AEeGnX','OCR','3789kaqjYS','install','Schema','15888IuHUjX','App\x20Management','41MGjxQo','527970DPyhRE','Service\x20Tree','19840601sMlmue','isSingleCommand','Logs','from','Diagnostics','get','read','values','Workspace','run','Configuration'];a36_0x16bb=function(){return _0xfcc700;};return a36_0x16bb();}import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x3502c7){const _0x4ad6b0=a36_0x37cb;for(const _0x27233c of _0x3502c7){definitions[_0x4ad6b0(0x1a0)](_0x27233c['service']+':'+_0x27233c[_0x4ad6b0(0x1a3)],_0x27233c);let _0x4b9dbd=serviceGroups[_0x4ad6b0(0x192)](_0x27233c['service']);!_0x4b9dbd&&(_0x4b9dbd=[],serviceGroups[_0x4ad6b0(0x1a0)](_0x27233c['service'],_0x4b9dbd)),_0x4b9dbd[_0x4ad6b0(0x17e)](_0x27233c);}}function registerService(_0xc3a4dd,_0x377204,_0x2ca486){const _0x545f57=a36_0x37cb;registerDefinitions(_0x377204);const _0x57aa17=_0x3b0c5b=>_0x3b0c5b===_0x545f57(0x193)?'':_0x3b0c5b===_0x545f57(0x1a6)?_0x545f57(0x19d):'\x20\x20[high-risk-write]',_0x5cb61e={'service':_0x377204[0x0][_0x545f57(0x19b)],'label':_0xc3a4dd,'commands':_0x377204[_0x545f57(0x180)](_0x38f0d4=>({'command':_0x38f0d4[_0x545f57(0x1a3)],'description':_0x38f0d4[_0x545f57(0x181)],'tag':_0x57aa17(_0x38f0d4[_0x545f57(0x19c)])})),'defaultCommand':_0x2ca486?.['defaultCommand']??(_0x2ca486?.[_0x545f57(0x18e)]?_0x377204[0x0]['command']:undefined),'isSingleCommand':_0x2ca486?.[_0x545f57(0x18e)]};serviceRegistry[_0x545f57(0x17e)](_0x5cb61e),serviceByName['set'](_0x5cb61e[_0x545f57(0x19b)],_0x5cb61e);}registerService(a36_0x2b6b1f(0x1a5),authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x2b6b1f(0x189),appDefinitions,{'defaultCommand':'list'}),registerService(a36_0x2b6b1f(0x195),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x2b6b1f(0x197),configDefinitions,{'defaultCommand':a36_0x2b6b1f(0x17d)}),registerService(a36_0x2b6b1f(0x182),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x2b6b1f(0x19e),dataDefinitions),registerService(a36_0x2b6b1f(0x1a9),sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a36_0x2b6b1f(0x19a),artifactDefinitions),registerService(a36_0x2b6b1f(0x17c),fileDefinitions),registerService(a36_0x2b6b1f(0x184),ocrDefinitions),registerService(a36_0x2b6b1f(0x17a),kbDefinitions),registerService(a36_0x2b6b1f(0x18c),serviceDefinitions,{'defaultCommand':a36_0x2b6b1f(0x17d)}),registerService(a36_0x2b6b1f(0x1a4),skillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x2b6b1f(0x198),cliSkillDefinitions,{'defaultCommand':a36_0x2b6b1f(0x186)}),registerService(a36_0x2b6b1f(0x1a1),[updateDefinition],{'defaultCommand':a36_0x2b6b1f(0x196),'isSingleCommand':!![]}),registerService(a36_0x2b6b1f(0x191),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2b6b1f(0x187),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2b6b1f(0x18f),logsDefinitions,{'defaultCommand':a36_0x2b6b1f(0x17f)});export function findDefinition(_0x45937b,_0x477c14){const _0x1fe777=a36_0x2b6b1f;return definitions[_0x1fe777(0x192)](_0x45937b+':'+_0x477c14);}export function isKnownService(_0x38c4f4){const _0x3b6fff=a36_0x2b6b1f;return serviceByName[_0x3b6fff(0x199)](_0x38c4f4);}export function getServiceEntry(_0x3e7dc8){return serviceByName['get'](_0x3e7dc8);}export function getAllDefinitions(){const _0x1eeece=a36_0x2b6b1f;return Array[_0x1eeece(0x190)](definitions[_0x1eeece(0x194)]());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a37_0x379a(_0xa4f6a5,_0x1147aa){_0xa4f6a5=_0xa4f6a5-0x19a;const _0x198054=a37_0x1980();let _0x379aa1=_0x198054[_0xa4f6a5];return _0x379aa1;}const a37_0x3487de=a37_0x379a;(function(_0x5b5d29,_0x29f703){const _0xff0d1c=a37_0x379a,_0x186640=_0x5b5d29();while(!![]){try{const _0x25117b=-parseInt(_0xff0d1c(0x1a3))/0x1*(-parseInt(_0xff0d1c(0x1a1))/0x2)+parseInt(_0xff0d1c(0x1a9))/0x3+-parseInt(_0xff0d1c(0x19f))/0x4*(-parseInt(_0xff0d1c(0x19a))/0x5)+-parseInt(_0xff0d1c(0x19c))/0x6+-parseInt(_0xff0d1c(0x19e))/0x7*(-parseInt(_0xff0d1c(0x1a8))/0x8)+-parseInt(_0xff0d1c(0x1a4))/0x9*(parseInt(_0xff0d1c(0x1a6))/0xa)+-parseInt(_0xff0d1c(0x1a5))/0xb*(-parseInt(_0xff0d1c(0x1a2))/0xc);if(_0x25117b===_0x29f703)break;else _0x186640['push'](_0x186640['shift']());}catch(_0x4e443f){_0x186640['push'](_0x186640['shift']());}}}(a37_0x1980,0xdf67d));import{buildSchemaPayload}from'../framework/schema-export.js';function a37_0x1980(){const _0x12e484=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','2126DaCVxP','24xlsfLo','253cUueeg','9pFQiVy','10399994gynXOV','13999060ftCQef','read','2416816HwQaDr','2457483bHqQRS','25DKNxaV','export','9451134ppkWen','schema','21uyYAyS','3880UKfXdo'];a37_0x1980=function(){return _0x12e484;};return a37_0x1980();}async function execute(_0x1a6b5b){const _0x15608e=await buildSchemaPayload();return{'ok':!![],'data':_0x15608e};}export const schemaDefinition={'service':a37_0x3487de(0x19d),'command':a37_0x3487de(0x19b),'description':a37_0x3487de(0x1a0),'risk':a37_0x3487de(0x1a7),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x245348,_0x388501){const _0x20d418=a38_0x32c0,_0x4f7a27=_0x245348();while(!![]){try{const _0x27ae89=-parseInt(_0x20d418(0x1ea))/0x1+parseInt(_0x20d418(0x18f))/0x2*(-parseInt(_0x20d418(0x1b9))/0x3)+-parseInt(_0x20d418(0x18a))/0x4+parseInt(_0x20d418(0x1a7))/0x5*(-parseInt(_0x20d418(0x1c9))/0x6)+parseInt(_0x20d418(0x19b))/0x7+parseInt(_0x20d418(0x1b2))/0x8+parseInt(_0x20d418(0x1d6))/0x9*(parseInt(_0x20d418(0x1b0))/0xa);if(_0x27ae89===_0x388501)break;else _0x4f7a27['push'](_0x4f7a27['shift']());}catch(_0x152ee9){_0x4f7a27['push'](_0x4f7a27['shift']());}}}(a38_0x9338,0x56829));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(_0x4de891,_0x243129){const _0x22496c=a38_0x32c0,_0x2936d0=listLocalServiceTrees();let _0x2eeb8b;for(const _0x4c3e39 of _0x2936d0){const _0x1c4daa=matchServiceTreeCommand(_0x4c3e39,_0x4de891);if(!_0x1c4daa)continue;(!_0x2eeb8b||_0x1c4daa['command'][_0x22496c(0x1eb)]['length']>_0x2eeb8b[_0x22496c(0x19a)][_0x22496c(0x1eb)][_0x22496c(0x185)])&&(_0x2eeb8b={'tree':_0x4c3e39,'command':_0x1c4daa[_0x22496c(0x19a)],'remainingArgs':_0x1c4daa[_0x22496c(0x1da)]});}if(!_0x2eeb8b)return undefined;const _0x2aa2f4={..._0x243129};return applyAppBinding(_0x2eeb8b[_0x22496c(0x18b)],_0x2eeb8b[_0x22496c(0x19a)],_0x2aa2f4),{'definition':buildDynamicCommandDefinition(_0x2eeb8b['tree'],_0x2eeb8b[_0x22496c(0x19a)]),'args':_0x2eeb8b[_0x22496c(0x1da)],'flags':_0x2aa2f4,'tree':_0x2eeb8b[_0x22496c(0x18b)],'command':_0x2eeb8b[_0x22496c(0x19a)]};}export function generateDynamicServiceHelp(_0x5565fd){const _0xb1e9b=a38_0x32c0,_0x412244=listLocalServiceTrees()[_0xb1e9b(0x1cc)](_0x4a2f34=>_0x4a2f34[_0xb1e9b(0x1c3)][_0xb1e9b(0x1a9)]===_0x5565fd);if(!_0x412244)return undefined;const _0x98399=[CLI_BIN_NAME+'\x20'+_0x5565fd+'\x20<command>\x20[flags]','',_0x412244['service'][_0xb1e9b(0x1a6)]||_0x5565fd,_0x412244[_0xb1e9b(0x1c3)][_0xb1e9b(0x18d)]?'\x20\x20'+_0x412244['service'][_0xb1e9b(0x18d)]:'','',_0xb1e9b(0x1be),..._0x412244[_0xb1e9b(0x184)][_0xb1e9b(0x1e1)](_0x5663d7=>{const _0x577139=_0xb1e9b,_0x2c72d1=_0x5663d7[_0x577139(0x1eb)][_0x577139(0x19c)](0x1)['join']('\x20'),_0x5d58fb=_0x5663d7[_0x577139(0x1af)]===_0x577139(0x198)?'':'\x20['+_0x5663d7[_0x577139(0x1af)]+']';return'\x20\x20'+_0x2c72d1[_0x577139(0x1e9)](0x18)+'\x20'+(_0x5663d7[_0x577139(0x18d)]||'')+_0x5d58fb;}),'','Use\x20`'+CLI_BIN_NAME+_0xb1e9b(0x1cf)+_0x5565fd+_0xb1e9b(0x1b8)][_0xb1e9b(0x1e8)](Boolean);return _0x98399[_0xb1e9b(0x1ce)]('\x0a');}export function listDynamicServiceEntries(){const _0x1464c7=a38_0x32c0;return listLocalServices()[_0x1464c7(0x1e1)](_0x3d1ab8=>{const _0x5b102f=_0x1464c7,_0x5cd629=_0x3d1ab8[_0x5b102f(0x192)];return{'service':_0x5cd629[_0x5b102f(0x1c3)][_0x5b102f(0x1a9)],'label':_0x5cd629[_0x5b102f(0x1c3)][_0x5b102f(0x1a6)]||_0x5cd629[_0x5b102f(0x1c3)]['code'],'commands':_0x5cd629[_0x5b102f(0x184)][_0x5b102f(0x1e1)](_0x3be0bc=>({'command':dynamicCommandName(_0x3be0bc),'description':_0x3be0bc[_0x5b102f(0x18d)]||_0x5b102f(0x1d1)+_0x3be0bc[_0x5b102f(0x19f)],'tag':riskTag(_0x3be0bc[_0x5b102f(0x1af)])}))};});}function a38_0x32c0(_0x214913,_0x31c211){_0x214913=_0x214913-0x183;const _0x9338b4=a38_0x9338();let _0x32c01e=_0x9338b4[_0x214913];return _0x32c01e;}export function getDynamicServiceEntry(_0x4b2cec){const _0x31ba07=a38_0x32c0;return listDynamicServiceEntries()['find'](_0x3427b2=>_0x3427b2[_0x31ba07(0x1c3)]===_0x4b2cec);}export function listDynamicServiceDefinitions(_0xa75f95){const _0x5ec451=a38_0x32c0;return listLocalServiceTrees()['filter'](_0x345311=>!_0xa75f95||_0x345311[_0x5ec451(0x1c3)]['code']===_0xa75f95)['flatMap'](_0x107e58=>_0x107e58['commands'][_0x5ec451(0x1e1)](_0x189f94=>buildDynamicCommandDefinition(_0x107e58,_0x189f94)));}export function getDynamicServiceDefinitions(_0x19ce2d){const _0x11863a=a38_0x32c0,_0x1f5acb=listDynamicServiceDefinitions(_0x19ce2d);return _0x1f5acb[_0x11863a(0x185)]>0x0?_0x1f5acb:undefined;}export function findDynamicServiceDefinition(_0x293afe,_0x3c84ef){const _0x3d8203=a38_0x32c0;return listDynamicServiceDefinitions(_0x293afe)[_0x3d8203(0x1cc)](_0x63c877=>_0x63c877[_0x3d8203(0x19a)]===_0x3c84ef);}export function buildDynamicCommandDefinition(_0x2cbff1,_0x4eff95){const _0x57ba3f=a38_0x32c0;return{'service':_0x2cbff1['service'][_0x57ba3f(0x1a9)],'command':dynamicCommandName(_0x4eff95),'description':_0x4eff95['description']||_0x57ba3f(0x1d1)+_0x4eff95['cliPath'],'risk':_0x4eff95['risk'],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x4eff95[_0x57ba3f(0x195)]['map'](_0x32612d=>({'name':_0x32612d[_0x57ba3f(0x1a6)],'description':_0x32612d[_0x57ba3f(0x18d)]||_0x32612d[_0x57ba3f(0x1a6)],'required':_0x32612d[_0x57ba3f(0x196)]})),'flags':_0x4eff95[_0x57ba3f(0x1db)][_0x57ba3f(0x1e1)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x4eff95),async 'dryRun'(_0x3b0e5d){const _0x5bc6a9=_0x57ba3f,_0x5c9be2=await compilePlan(_0x4eff95,_0x3b0e5d);return{'method':_0x5bc6a9(0x1e0),'url':_0x4eff95[_0x5bc6a9(0x19f)],'body':{'target':targetPreview(_0x5c9be2),'params':_0x5c9be2[_0x5bc6a9(0x1e5)]},'description':_0x5bc6a9(0x197)+_0x4eff95['cliPath']};},async 'execute'(_0x228f5c){const _0x31af9b=_0x57ba3f,_0x9a357f=await compilePlan(_0x4eff95,_0x228f5c),_0x578b70=Date[_0x31af9b(0x193)](),_0x50e988=await executePlan(_0x9a357f,_0x4eff95,_0x228f5c),_0x20f99d=Date[_0x31af9b(0x193)]()-_0x578b70;return{'ok':!![],'data':{'service':_0x2cbff1[_0x31af9b(0x1c3)],'command':_0x4eff95[_0x31af9b(0x19f)],'target':targetPreview(_0x9a357f),'result':_0x50e988,'elapsed':_0x20f99d},'message':_0x31af9b(0x199)+_0x4eff95['cliPath']+'\x20completed\x20in\x20'+_0x20f99d+'ms'};}};}function dynamicCommandName(_0x4c4f94){return _0x4c4f94['fullPath']['slice'](0x1)['join']('\x20');}function riskTag(_0x48acb7){const _0x26aefa=a38_0x32c0;return _0x48acb7===_0x26aefa(0x198)?'':_0x26aefa(0x19d)+_0x48acb7+']';}function flagToCommandFlag(_0x5d600b){const _0x560001=a38_0x32c0;return{'name':_0x5d600b[_0x560001(0x1d4)],'type':_0x5d600b[_0x560001(0x186)]==='json'?_0x560001(0x1c0):_0x5d600b[_0x560001(0x186)],'description':_0x5d600b[_0x560001(0x18d)]||_0x5d600b['name'],'required':_0x5d600b['required'],'default':isPrimitiveFlagDefault(_0x5d600b[_0x560001(0x1e2)])?_0x5d600b['default']:undefined,'enum':_0x5d600b[_0x560001(0x188)]};}async function compilePlan(_0x5a6737,_0x2b52c6){const _0x56d1ba=a38_0x32c0;return compileServiceTreeCommand(_0x5a6737,{'flags':_0x2b52c6[_0x56d1ba(0x1bc)],'args':_0x2b52c6[_0x56d1ba(0x195)],'context':await buildServiceContext(_0x5a6737,_0x2b52c6)});}async function buildServiceContext(_0xf03ad1,_0x18a668){const _0x67a6cc=a38_0x32c0,_0x38d854={'appCode':_0x18a668['appCode'],'env':_0x18a668[_0x67a6cc(0x1d3)],'envName':_0x18a668['envName']};if(!usesRuntimeContext(_0xf03ad1))return _0x38d854;const _0x200a32=await getLoginUserInfo(),_0x1e978f=pickFirst(_0x200a32['userId'],_0x200a32['id']);return{..._0x38d854,'user':_0x200a32,'userId':_0x1e978f,'id':_0x200a32['id'],'username':pickFirst(_0x200a32[_0x67a6cc(0x1a1)],_0x200a32[_0x67a6cc(0x18e)],_0x200a32[_0x67a6cc(0x1e6)]),'userName':_0x200a32[_0x67a6cc(0x18e)],'nickname':pickFirst(_0x200a32['nickname'],_0x200a32['nickName']),'nickName':_0x200a32['nickName'],'tenantCode':_0x200a32[_0x67a6cc(0x19e)],'employeeId':_0x200a32[_0x67a6cc(0x1c4)]};}function usesRuntimeContext(_0x406e64){const _0x36d8ef=a38_0x32c0;return _0x406e64[_0x36d8ef(0x1d8)][_0x36d8ef(0x1dd)](_0x49f068=>typeof _0x49f068[_0x36d8ef(0x1d2)]===_0x36d8ef(0x1c0)&&(_0x49f068[_0x36d8ef(0x1d2)][_0x36d8ef(0x1ab)](_0x36d8ef(0x1ba))||_0x49f068['source'][_0x36d8ef(0x1ab)](_0x36d8ef(0x194))));}function pickFirst(..._0x719d62){const _0x186d62=a38_0x32c0;return _0x719d62[_0x186d62(0x1cc)](_0x2504e2=>_0x2504e2!==undefined&&_0x2504e2!==null);}async function executePlan(_0x23fb11,_0x58a06c,_0x1e09b4){const _0x594481=a38_0x32c0;if(_0x23fb11[_0x594481(0x1d9)]===_0x594481(0x1c8)){const _0x466d2f=await resolveDatasetCode(_0x23fb11,_0x58a06c,_0x1e09b4);return executeData(_0x466d2f,_0x23fb11[_0x594481(0x19a)],_0x23fb11[_0x594481(0x1e5)]);}if(_0x23fb11[_0x594481(0x1d9)]===_0x594481(0x1d7)){if(!_0x23fb11[_0x594481(0x1b3)])throw CliErrors['validation']('Service\x20command\x20'+_0x58a06c['cliPath']+_0x594481(0x1c2));return executeSdkSql(_0x23fb11[_0x594481(0x1b3)],normalizeScalarParams(_0x23fb11[_0x594481(0x1e5)]));}if(_0x23fb11[_0x594481(0x1d9)]===_0x594481(0x1aa)){const _0x197d2d=_0x23fb11['scriptName']||_0x23fb11[_0x594481(0x1c5)]||(_0x23fb11['bffId']==null?'':String(_0x23fb11[_0x594481(0x1b5)]));if(!_0x197d2d)throw CliErrors['validation']('Service\x20command\x20'+_0x58a06c[_0x594481(0x19f)]+_0x594481(0x1ae));return executeSdkBff(_0x197d2d,_0x23fb11['params']);}throw CliErrors['validation'](_0x594481(0x1d0)+_0x23fb11[_0x594481(0x1d9)]);}async function resolveDatasetCode(_0xc515ea,_0x30eeac,_0x2f2339){const _0x45d9eb=a38_0x32c0;if(_0xc515ea[_0x45d9eb(0x1a4)])return _0xc515ea[_0x45d9eb(0x1a4)];if(!_0xc515ea[_0x45d9eb(0x18c)])throw CliErrors[_0x45d9eb(0x1c7)](_0x45d9eb(0x199)+_0x30eeac[_0x45d9eb(0x19f)]+_0x45d9eb(0x1b4));const _0xc1e109=await listDatasets(_0x2f2339[_0x45d9eb(0x1bd)]),_0x2b4f55=_0xc1e109[_0x45d9eb(0x1cc)](_0x485011=>_0x485011['dbtableConfig']?.[_0x45d9eb(0x1bb)]===_0xc515ea[_0x45d9eb(0x18c)]);if(!_0x2b4f55?.[_0x45d9eb(0x1a9)])throw CliErrors[_0x45d9eb(0x1c7)](_0x45d9eb(0x1e3)+_0xc515ea[_0x45d9eb(0x18c)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x2f2339[_0x45d9eb(0x1bd)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x2b4f55[_0x45d9eb(0x1a9)];}function applyAppBinding(_0x1a397f,_0x421875,_0x567425){const _0x3c65bb=a38_0x32c0,_0x2b9e30=_0x421875[_0x3c65bb(0x1d5)][_0x3c65bb(0x1a3)];if(!_0x2b9e30)return;const _0x178bde=_0x1a397f[_0x3c65bb(0x1de)][_0x2b9e30];if(!_0x178bde)throw CliErrors['validation'](_0x3c65bb(0x1ac)+_0x2b9e30+_0x3c65bb(0x1a2)+_0x421875[_0x3c65bb(0x19f)]+'.',_0x3c65bb(0x183));const _0x586620=_0x178bde[_0x3c65bb(0x1ca)]||_0x178bde[_0x3c65bb(0x1bd)];_0x586620&&!hasText(_0x567425[_0x3c65bb(0x1ca)])&&(_0x567425[_0x3c65bb(0x1ca)]=_0x586620),_0x178bde[_0x3c65bb(0x190)]&&!hasText(_0x567425[_0x3c65bb(0x190)])&&!hasText(_0x567425['appcode'])&&(_0x567425[_0x3c65bb(0x190)]=_0x178bde[_0x3c65bb(0x190)]),_0x178bde['env']&&!hasText(_0x567425['env'])&&(_0x567425[_0x3c65bb(0x1bf)]=_0x178bde[_0x3c65bb(0x1bf)]);}function renderDynamicCommandHelp(_0x298b9){const _0x200d90=a38_0x32c0,_0x3cd2b9=[_0x200d90(0x187),_0x200d90(0x189)+_0x298b9['target']['kind'],_0x200d90(0x1df)+_0x298b9['target'][_0x200d90(0x19a)]];if(_0x298b9[_0x200d90(0x1d5)][_0x200d90(0x1a4)])_0x3cd2b9[_0x200d90(0x1a8)](_0x200d90(0x1b7)+_0x298b9['target'][_0x200d90(0x1a4)]);if(_0x298b9[_0x200d90(0x1d5)][_0x200d90(0x18c)])_0x3cd2b9[_0x200d90(0x1a8)](_0x200d90(0x1a0)+_0x298b9[_0x200d90(0x1d5)]['datatable']);if(_0x298b9[_0x200d90(0x1d5)][_0x200d90(0x1b3)])_0x3cd2b9[_0x200d90(0x1a8)](_0x200d90(0x1cb)+_0x298b9['target']['sqlCode']);if(_0x298b9[_0x200d90(0x1d5)][_0x200d90(0x1e4)])_0x3cd2b9[_0x200d90(0x1a8)](_0x200d90(0x1a5)+_0x298b9[_0x200d90(0x1d5)]['scriptName']);if(_0x298b9[_0x200d90(0x1d8)]['length']>0x0){_0x3cd2b9[_0x200d90(0x1a8)]('','\x20\x20MAP\x20TO');for(const _0x18601a of _0x298b9[_0x200d90(0x1d8)]){_0x3cd2b9[_0x200d90(0x1a8)](_0x200d90(0x1dc)+(_0x18601a[_0x200d90(0x1d2)]||_0x200d90(0x1e7))+_0x200d90(0x1b6)+_0x18601a[_0x200d90(0x1d5)]+(_0x18601a[_0x200d90(0x1ad)]?'.'+_0x18601a[_0x200d90(0x1ad)]:''));}}return _0x3cd2b9['join']('\x0a');}function targetPreview(_0x22bccc){const _0x9cfb37=a38_0x32c0;return{'kind':_0x22bccc[_0x9cfb37(0x1d9)],'command':_0x22bccc[_0x9cfb37(0x19a)],'appRef':_0x22bccc['appRef'],'datasetCode':_0x22bccc['datasetCode'],'datatable':_0x22bccc[_0x9cfb37(0x18c)],'sqlCode':_0x22bccc[_0x9cfb37(0x1b3)],'bffCode':_0x22bccc[_0x9cfb37(0x1c5)],'bffId':_0x22bccc[_0x9cfb37(0x1b5)],'functionName':_0x22bccc['scriptName']};}function a38_0x9338(){const _0x19786f=['commands','length','type','\x20\x20SERVICE\x20TREE\x20TARGET','enum','\x20\x20\x20\x20kind:\x20\x20\x20\x20','1829208ASfVhR','tree','datatable','description','userName','166fdtkjp','app','trim','normalizedManifest','now','ctx.','args','required','Preview\x20dynamic\x20service\x20command:\x20','read','Service\x20command\x20','command','3957954gOuXSp','slice','\x20\x20[','tenantCode','cliPath','\x20\x20\x20\x20datatable:\x20','username','\x22\x20in\x20service\x20command\x20','appRef','datasetCode','\x20\x20\x20\x20functionName:\x20','name','10nLTzjH','push','code','bff','startsWith','Unknown\x20appRef\x20\x22','operator','\x20requires\x20target.functionName.','risk','10BpMkTJ','number','1421440yBazNr','sqlCode','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bffId','\x20->\x20','\x20\x20\x20\x20datasetCode:\x20','`\x20to\x20inspect\x20the\x20manifest.','23007IPmXJn','context.','tableName','rawFlags','appCode','Commands:','env','string','boolean','\x20requires\x20target.sqlCode.','service','employeeId','bffCode','entries','validation','data','1988760whKcyz','appcode','\x20\x20\x20\x20sqlCode:\x20','find','fromEntries','join','\x20service\x20detail\x20--service\x20','Unsupported\x20service\x20target\x20kind:\x20','Run\x20service\x20command\x20','source','envName','cliName','target','16756533hAkiOm','sql','mapTo','kind','remainingArgs','flags','\x20\x20\x20\x20','some','appBindings','\x20\x20\x20\x20command:\x20','SERVICE_TREE','map','default','Cannot\x20resolve\x20datatable\x20\x22','scriptName','params','loginName','const','filter','padEnd','493845sXCdmI','fullPath','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.'];a38_0x9338=function(){return _0x19786f;};return a38_0x9338();}function normalizeScalarParams(_0x505228){const _0x41aecf=a38_0x32c0;return Object[_0x41aecf(0x1cd)](Object[_0x41aecf(0x1c6)](_0x505228)[_0x41aecf(0x1e8)](([,_0x51fd9d])=>typeof _0x51fd9d===_0x41aecf(0x1c0)||typeof _0x51fd9d===_0x41aecf(0x1b1)));}function hasText(_0x24fe06){const _0x3db72e=a38_0x32c0;return typeof _0x24fe06===_0x3db72e(0x1c0)&&_0x24fe06[_0x3db72e(0x191)]()[_0x3db72e(0x185)]>0x0;}function isPrimitiveFlagDefault(_0x333664){const _0x2c23d4=a38_0x32c0;return _0x333664===undefined||typeof _0x333664===_0x2c23d4(0x1c0)||typeof _0x333664==='number'||typeof _0x333664===_0x2c23d4(0x1c1);}
|
|
1
|
+
(function(_0x59e7a0,_0x218ea5){const _0x1ceb61=a38_0x32c7,_0x491091=_0x59e7a0();while(!![]){try{const _0x2ab95b=parseInt(_0x1ceb61(0xa8))/0x1+parseInt(_0x1ceb61(0xb4))/0x2*(-parseInt(_0x1ceb61(0xc1))/0x3)+parseInt(_0x1ceb61(0xcd))/0x4*(parseInt(_0x1ceb61(0xc4))/0x5)+-parseInt(_0x1ceb61(0x88))/0x6*(parseInt(_0x1ceb61(0x82))/0x7)+-parseInt(_0x1ceb61(0x9f))/0x8*(-parseInt(_0x1ceb61(0xca))/0x9)+parseInt(_0x1ceb61(0xaa))/0xa+-parseInt(_0x1ceb61(0x8f))/0xb;if(_0x2ab95b===_0x218ea5)break;else _0x491091['push'](_0x491091['shift']());}catch(_0x13e998){_0x491091['push'](_0x491091['shift']());}}}(a38_0x3122,0xc3ede));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a38_0x32c7(_0x2509fb,_0x289cbe){_0x2509fb=_0x2509fb-0x7f;const _0x3122c2=a38_0x3122();let _0x32c7e8=_0x3122c2[_0x2509fb];return _0x32c7e8;}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(_0x50a869,_0x294006){const _0x1cf3a0=a38_0x32c7,_0x1fd568=listLocalServiceTrees();let _0x37dd51;for(const _0x40d42d of _0x1fd568){const _0x2ce205=matchServiceTreeCommand(_0x40d42d,_0x50a869);if(!_0x2ce205)continue;(!_0x37dd51||_0x2ce205[_0x1cf3a0(0x84)][_0x1cf3a0(0xa9)][_0x1cf3a0(0xbd)]>_0x37dd51[_0x1cf3a0(0x84)][_0x1cf3a0(0xa9)][_0x1cf3a0(0xbd)])&&(_0x37dd51={'tree':_0x40d42d,'command':_0x2ce205['command'],'remainingArgs':_0x2ce205['remainingArgs']});}if(!_0x37dd51)return undefined;const _0x47e43f={..._0x294006};return applyAppBinding(_0x37dd51[_0x1cf3a0(0xb3)],_0x37dd51[_0x1cf3a0(0x84)],_0x47e43f),{'definition':buildDynamicCommandDefinition(_0x37dd51[_0x1cf3a0(0xb3)],_0x37dd51[_0x1cf3a0(0x84)]),'args':_0x37dd51[_0x1cf3a0(0x98)],'flags':_0x47e43f,'tree':_0x37dd51[_0x1cf3a0(0xb3)],'command':_0x37dd51[_0x1cf3a0(0x84)]};}export function generateDynamicServiceHelp(_0x1c67e7){const _0x261c98=a38_0x32c7,_0x1ef41d=listLocalServiceTrees()[_0x261c98(0xdf)](_0x6e291=>_0x6e291[_0x261c98(0x9d)][_0x261c98(0xd0)]===_0x1c67e7);if(!_0x1ef41d)return undefined;const _0x440e5f=[CLI_BIN_NAME+'\x20'+_0x1c67e7+'\x20<command>\x20[flags]','',_0x1ef41d[_0x261c98(0x9d)][_0x261c98(0xd9)]||_0x1c67e7,_0x1ef41d[_0x261c98(0x9d)][_0x261c98(0xb0)]?'\x20\x20'+_0x1ef41d[_0x261c98(0x9d)][_0x261c98(0xb0)]:'','',_0x261c98(0x90),..._0x1ef41d[_0x261c98(0x9e)][_0x261c98(0x89)](_0x4d04a3=>{const _0x3e659a=_0x261c98,_0x5b7c88=_0x4d04a3['fullPath'][_0x3e659a(0xbc)](0x1)['join']('\x20'),_0x5303df=_0x4d04a3[_0x3e659a(0x8d)]==='read'?'':'\x20['+_0x4d04a3[_0x3e659a(0x8d)]+']';return'\x20\x20'+_0x5b7c88['padEnd'](0x18)+'\x20'+(_0x4d04a3[_0x3e659a(0xb0)]||'')+_0x5303df;}),'',_0x261c98(0xb6)+CLI_BIN_NAME+_0x261c98(0xa6)+_0x1c67e7+'`\x20to\x20inspect\x20the\x20manifest.'][_0x261c98(0xc3)](Boolean);return _0x440e5f[_0x261c98(0xa5)]('\x0a');}export function listDynamicServiceEntries(){const _0x51af19=a38_0x32c7;return listLocalServices()[_0x51af19(0x89)](_0x1631c6=>{const _0xd4f1b9=_0x51af19,_0x5e67ba=_0x1631c6['normalizedManifest'];return{'service':_0x5e67ba[_0xd4f1b9(0x9d)]['code'],'label':_0x5e67ba[_0xd4f1b9(0x9d)][_0xd4f1b9(0xd9)]||_0x5e67ba[_0xd4f1b9(0x9d)][_0xd4f1b9(0xd0)],'commands':_0x5e67ba[_0xd4f1b9(0x9e)][_0xd4f1b9(0x89)](_0x5b2e38=>({'command':dynamicCommandName(_0x5b2e38),'description':_0x5b2e38[_0xd4f1b9(0xb0)]||_0xd4f1b9(0xd6)+_0x5b2e38['cliPath'],'tag':riskTag(_0x5b2e38[_0xd4f1b9(0x8d)])}))};});}export function getDynamicServiceEntry(_0x7310e5){const _0x12526a=a38_0x32c7;return listDynamicServiceEntries()[_0x12526a(0xdf)](_0x570024=>_0x570024['service']===_0x7310e5);}export function listDynamicServiceDefinitions(_0x1cd915){const _0x34ecfc=a38_0x32c7;return listLocalServiceTrees()[_0x34ecfc(0xc3)](_0x3761a8=>!_0x1cd915||_0x3761a8[_0x34ecfc(0x9d)][_0x34ecfc(0xd0)]===_0x1cd915)['flatMap'](_0xde1ac3=>_0xde1ac3[_0x34ecfc(0x9e)]['map'](_0xdfe751=>buildDynamicCommandDefinition(_0xde1ac3,_0xdfe751)));}export function getDynamicServiceDefinitions(_0x26d9f1){const _0x3ae699=a38_0x32c7,_0x191571=listDynamicServiceDefinitions(_0x26d9f1);return _0x191571[_0x3ae699(0xbd)]>0x0?_0x191571:undefined;}export function findDynamicServiceDefinition(_0x23011d,_0x7ad6f1){const _0x35d073=a38_0x32c7;return listDynamicServiceDefinitions(_0x23011d)[_0x35d073(0xdf)](_0x3d1b07=>_0x3d1b07[_0x35d073(0x84)]===_0x7ad6f1);}function a38_0x3122(){const _0x2a4960=['\x20service\x20detail\x20--service\x20','trim','1367337OiwLoH','fullPath','12436560VpDTSk','\x20\x20\x20\x20','datatable','target','datasetCode','nickname','description','SERVICE_TREE','username','tree','223490MjLYYf','app','Use\x20`','bffId','Unknown\x20appRef\x20\x22','env','appRef','employeeId','slice','length','args','userId','Preview\x20dynamic\x20service\x20command:\x20','21BfbVXl','cliPath','filter','139770lwVKbs','params','rawFlags','sqlCode','envName','context.','2661237QXbrgc','push','Cannot\x20resolve\x20datatable\x20\x22','36vMiaWo','number','source','code','tableName','tenantCode','\x20\x20SERVICE\x20TREE\x20TARGET','userName','default','Run\x20service\x20command\x20','\x20->\x20','entries','name','\x20\x20\x20\x20datasetCode:\x20','\x20\x20\x20\x20functionName:\x20','startsWith','operator','flags','find','appCode','\x20\x20\x20\x20datatable:\x20','required','loginName','some','891485LPXcRT','appcode','command','\x20requires\x20target.sqlCode.','bffCode','json','12MUvnWi','map','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','scriptName','dbtableConfig','risk','sql','14507031STywiR','Commands:','fromEntries','Service\x20command\x20','bff','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','mapTo','ctx.','enum','remainingArgs','read','string','type','kind','service','commands','8zmzSIt','validation','\x20\x20MAP\x20TO','cliName','nickName','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','join'];a38_0x3122=function(){return _0x2a4960;};return a38_0x3122();}export function buildDynamicCommandDefinition(_0x141e41,_0x397d51){const _0x1cbb86=a38_0x32c7;return{'service':_0x141e41[_0x1cbb86(0x9d)]['code'],'command':dynamicCommandName(_0x397d51),'description':_0x397d51[_0x1cbb86(0xb0)]||_0x1cbb86(0xd6)+_0x397d51[_0x1cbb86(0xc2)],'risk':_0x397d51[_0x1cbb86(0x8d)],'requiresAuth':!![],'requiresAppCode':!![],'args':_0x397d51[_0x1cbb86(0xbe)][_0x1cbb86(0x89)](_0x586caf=>({'name':_0x586caf[_0x1cbb86(0xd9)],'description':_0x586caf[_0x1cbb86(0xb0)]||_0x586caf[_0x1cbb86(0xd9)],'required':_0x586caf[_0x1cbb86(0x7f)]})),'flags':_0x397d51[_0x1cbb86(0xde)][_0x1cbb86(0x89)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x397d51),async 'dryRun'(_0x1e12bb){const _0x3d77bb=_0x1cbb86,_0x2dffa7=await compilePlan(_0x397d51,_0x1e12bb);return{'method':_0x3d77bb(0xb1),'url':_0x397d51[_0x3d77bb(0xc2)],'body':{'target':targetPreview(_0x2dffa7),'params':_0x2dffa7[_0x3d77bb(0xc5)]},'description':_0x3d77bb(0xc0)+_0x397d51['cliPath']};},async 'execute'(_0x54c8fb){const _0x5539e3=_0x1cbb86,_0x44da88=await compilePlan(_0x397d51,_0x54c8fb),_0x416f47=Date['now'](),_0x128cd4=await executePlan(_0x44da88,_0x397d51,_0x54c8fb),_0x1baa2b=Date['now']()-_0x416f47;return{'ok':!![],'data':{'service':_0x141e41[_0x5539e3(0x9d)],'command':_0x397d51[_0x5539e3(0xc2)],'target':targetPreview(_0x44da88),'result':_0x128cd4,'elapsed':_0x1baa2b},'message':_0x5539e3(0x92)+_0x397d51[_0x5539e3(0xc2)]+'\x20completed\x20in\x20'+_0x1baa2b+'ms'};}};}function dynamicCommandName(_0x4987d1){const _0x47f862=a38_0x32c7;return _0x4987d1['fullPath'][_0x47f862(0xbc)](0x1)[_0x47f862(0xa5)]('\x20');}function riskTag(_0x529e51){const _0x1f3563=a38_0x32c7;return _0x529e51===_0x1f3563(0x99)?'':'\x20\x20['+_0x529e51+']';}function flagToCommandFlag(_0x5f2ea7){const _0x8b582d=a38_0x32c7;return{'name':_0x5f2ea7[_0x8b582d(0xa2)],'type':_0x5f2ea7[_0x8b582d(0x9b)]===_0x8b582d(0x87)?_0x8b582d(0x9a):_0x5f2ea7['type'],'description':_0x5f2ea7[_0x8b582d(0xb0)]||_0x5f2ea7[_0x8b582d(0xd9)],'required':_0x5f2ea7[_0x8b582d(0x7f)],'default':isPrimitiveFlagDefault(_0x5f2ea7['default'])?_0x5f2ea7[_0x8b582d(0xd5)]:undefined,'enum':_0x5f2ea7[_0x8b582d(0x97)]};}async function compilePlan(_0xcad908,_0x594c5b){const _0x1072d3=a38_0x32c7;return compileServiceTreeCommand(_0xcad908,{'flags':_0x594c5b[_0x1072d3(0xc6)],'args':_0x594c5b[_0x1072d3(0xbe)],'context':await buildServiceContext(_0xcad908,_0x594c5b)});}async function buildServiceContext(_0x3ad203,_0x1bcf28){const _0x4524ea=a38_0x32c7,_0x432489={'appCode':_0x1bcf28['appCode'],'env':_0x1bcf28[_0x4524ea(0xc8)],'envName':_0x1bcf28['envName']};if(!usesRuntimeContext(_0x3ad203))return _0x432489;const _0xb3cbc3=await getLoginUserInfo(),_0x12b3e7=pickFirst(_0xb3cbc3[_0x4524ea(0xbf)],_0xb3cbc3['id']);return{..._0x432489,'user':_0xb3cbc3,'userId':_0x12b3e7,'id':_0xb3cbc3['id'],'username':pickFirst(_0xb3cbc3[_0x4524ea(0xb2)],_0xb3cbc3['userName'],_0xb3cbc3[_0x4524ea(0x80)]),'userName':_0xb3cbc3[_0x4524ea(0xd4)],'nickname':pickFirst(_0xb3cbc3[_0x4524ea(0xaf)],_0xb3cbc3[_0x4524ea(0xa3)]),'nickName':_0xb3cbc3['nickName'],'tenantCode':_0xb3cbc3[_0x4524ea(0xd2)],'employeeId':_0xb3cbc3[_0x4524ea(0xbb)]};}function usesRuntimeContext(_0x5d2379){const _0x4e0e1b=a38_0x32c7;return _0x5d2379[_0x4e0e1b(0x95)][_0x4e0e1b(0x81)](_0x1b4065=>typeof _0x1b4065[_0x4e0e1b(0xcf)]===_0x4e0e1b(0x9a)&&(_0x1b4065[_0x4e0e1b(0xcf)]['startsWith'](_0x4e0e1b(0xc9))||_0x1b4065[_0x4e0e1b(0xcf)][_0x4e0e1b(0xdc)](_0x4e0e1b(0x96))));}function pickFirst(..._0x344008){const _0x4af181=a38_0x32c7;return _0x344008[_0x4af181(0xdf)](_0x53fa89=>_0x53fa89!==undefined&&_0x53fa89!==null);}async function executePlan(_0x140476,_0xc21274,_0x17cde5){const _0x14608a=a38_0x32c7;if(_0x140476[_0x14608a(0x9c)]==='data'){const _0x3db6fb=await resolveDatasetCode(_0x140476,_0xc21274,_0x17cde5);return executeData(_0x3db6fb,_0x140476[_0x14608a(0x84)],_0x140476[_0x14608a(0xc5)]);}if(_0x140476[_0x14608a(0x9c)]===_0x14608a(0x8e)){if(!_0x140476[_0x14608a(0xc7)])throw CliErrors[_0x14608a(0xa0)]('Service\x20command\x20'+_0xc21274[_0x14608a(0xc2)]+_0x14608a(0x85));return executeSdkSql(_0x140476['sqlCode'],normalizeScalarParams(_0x140476[_0x14608a(0xc5)]));}if(_0x140476[_0x14608a(0x9c)]===_0x14608a(0x93)){const _0x1d3e9f=_0x140476[_0x14608a(0x8b)]||_0x140476[_0x14608a(0x86)]||(_0x140476[_0x14608a(0xb7)]==null?'':String(_0x140476[_0x14608a(0xb7)]));if(!_0x1d3e9f)throw CliErrors['validation'](_0x14608a(0x92)+_0xc21274['cliPath']+'\x20requires\x20target.functionName.');return executeSdkBff(_0x1d3e9f,_0x140476[_0x14608a(0xc5)]);}throw CliErrors[_0x14608a(0xa0)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x140476[_0x14608a(0x9c)]);}async function resolveDatasetCode(_0x14e144,_0x5b6024,_0x4c9fbf){const _0x2e87ef=a38_0x32c7;if(_0x14e144[_0x2e87ef(0xae)])return _0x14e144[_0x2e87ef(0xae)];if(!_0x14e144[_0x2e87ef(0xac)])throw CliErrors[_0x2e87ef(0xa0)]('Service\x20command\x20'+_0x5b6024['cliPath']+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x3ed981=await listDatasets(_0x4c9fbf['appCode']),_0x350f42=_0x3ed981[_0x2e87ef(0xdf)](_0x531b87=>_0x531b87[_0x2e87ef(0x8c)]?.[_0x2e87ef(0xd1)]===_0x14e144[_0x2e87ef(0xac)]);if(!_0x350f42?.[_0x2e87ef(0xd0)])throw CliErrors[_0x2e87ef(0xa0)](_0x2e87ef(0xcc)+_0x14e144[_0x2e87ef(0xac)]+_0x2e87ef(0x94)+_0x4c9fbf[_0x2e87ef(0xe0)]+'.',_0x2e87ef(0xa4));return _0x350f42[_0x2e87ef(0xd0)];}function applyAppBinding(_0x581160,_0x3f6d90,_0x4d1245){const _0x18e6c4=a38_0x32c7,_0x1f13d7=_0x3f6d90[_0x18e6c4(0xad)][_0x18e6c4(0xba)];if(!_0x1f13d7)return;const _0x4d7720=_0x581160['appBindings'][_0x1f13d7];if(!_0x4d7720)throw CliErrors['validation'](_0x18e6c4(0xb8)+_0x1f13d7+'\x22\x20in\x20service\x20command\x20'+_0x3f6d90['cliPath']+'.',_0x18e6c4(0x8a));const _0x38125c=_0x4d7720[_0x18e6c4(0x83)]||_0x4d7720[_0x18e6c4(0xe0)];_0x38125c&&!hasText(_0x4d1245['appcode'])&&(_0x4d1245[_0x18e6c4(0x83)]=_0x38125c),_0x4d7720[_0x18e6c4(0xb5)]&&!hasText(_0x4d1245[_0x18e6c4(0xb5)])&&!hasText(_0x4d1245[_0x18e6c4(0x83)])&&(_0x4d1245['app']=_0x4d7720[_0x18e6c4(0xb5)]),_0x4d7720['env']&&!hasText(_0x4d1245[_0x18e6c4(0xb9)])&&(_0x4d1245[_0x18e6c4(0xb9)]=_0x4d7720[_0x18e6c4(0xb9)]);}function renderDynamicCommandHelp(_0x166c8d){const _0x577233=a38_0x32c7,_0x7813d0=[_0x577233(0xd3),'\x20\x20\x20\x20kind:\x20\x20\x20\x20'+_0x166c8d['target']['kind'],'\x20\x20\x20\x20command:\x20'+_0x166c8d['target'][_0x577233(0x84)]];if(_0x166c8d[_0x577233(0xad)][_0x577233(0xae)])_0x7813d0['push'](_0x577233(0xda)+_0x166c8d['target']['datasetCode']);if(_0x166c8d[_0x577233(0xad)][_0x577233(0xac)])_0x7813d0[_0x577233(0xcb)](_0x577233(0xe1)+_0x166c8d[_0x577233(0xad)][_0x577233(0xac)]);if(_0x166c8d[_0x577233(0xad)][_0x577233(0xc7)])_0x7813d0[_0x577233(0xcb)]('\x20\x20\x20\x20sqlCode:\x20'+_0x166c8d['target']['sqlCode']);if(_0x166c8d[_0x577233(0xad)][_0x577233(0x8b)])_0x7813d0[_0x577233(0xcb)](_0x577233(0xdb)+_0x166c8d['target'][_0x577233(0x8b)]);if(_0x166c8d[_0x577233(0x95)][_0x577233(0xbd)]>0x0){_0x7813d0[_0x577233(0xcb)]('',_0x577233(0xa1));for(const _0x957c77 of _0x166c8d[_0x577233(0x95)]){_0x7813d0['push'](_0x577233(0xab)+(_0x957c77[_0x577233(0xcf)]||'const')+_0x577233(0xd7)+_0x957c77[_0x577233(0xad)]+(_0x957c77[_0x577233(0xdd)]?'.'+_0x957c77[_0x577233(0xdd)]:''));}}return _0x7813d0[_0x577233(0xa5)]('\x0a');}function targetPreview(_0x5d7a44){const _0xa8843e=a38_0x32c7;return{'kind':_0x5d7a44['kind'],'command':_0x5d7a44[_0xa8843e(0x84)],'appRef':_0x5d7a44[_0xa8843e(0xba)],'datasetCode':_0x5d7a44[_0xa8843e(0xae)],'datatable':_0x5d7a44[_0xa8843e(0xac)],'sqlCode':_0x5d7a44[_0xa8843e(0xc7)],'bffCode':_0x5d7a44[_0xa8843e(0x86)],'bffId':_0x5d7a44[_0xa8843e(0xb7)],'functionName':_0x5d7a44[_0xa8843e(0x8b)]};}function normalizeScalarParams(_0xd53ba5){const _0x5010c5=a38_0x32c7;return Object[_0x5010c5(0x91)](Object[_0x5010c5(0xd8)](_0xd53ba5)[_0x5010c5(0xc3)](([,_0x10ae69])=>typeof _0x10ae69===_0x5010c5(0x9a)||typeof _0x10ae69==='number'));}function hasText(_0x4cdd0b){const _0x7f902c=a38_0x32c7;return typeof _0x4cdd0b==='string'&&_0x4cdd0b[_0x7f902c(0xa7)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x109fa9){const _0x1bfe51=a38_0x32c7;return _0x109fa9===undefined||typeof _0x109fa9===_0x1bfe51(0x9a)||typeof _0x109fa9===_0x1bfe51(0xce)||typeof _0x109fa9==='boolean';}
|