@lovrabet/lovrabet-cli 2.1.21-beta.1 → 2.1.21
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/schedule/index.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/raw-flags.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.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/install-target.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
|
+
const a29_0x83e468=a29_0x55f8;(function(_0x51a629,_0x4430fa){const _0x10ace2=a29_0x55f8,_0x409db6=_0x51a629();while(!![]){try{const _0x2c84cd=parseInt(_0x10ace2(0xe0))/0x1+-parseInt(_0x10ace2(0x118))/0x2*(parseInt(_0x10ace2(0xf1))/0x3)+parseInt(_0x10ace2(0xe5))/0x4+-parseInt(_0x10ace2(0x107))/0x5*(-parseInt(_0x10ace2(0x108))/0x6)+parseInt(_0x10ace2(0x100))/0x7*(-parseInt(_0x10ace2(0x114))/0x8)+parseInt(_0x10ace2(0xe4))/0x9+parseInt(_0x10ace2(0xf0))/0xa*(-parseInt(_0x10ace2(0xf4))/0xb);if(_0x2c84cd===_0x4430fa)break;else _0x409db6['push'](_0x409db6['shift']());}catch(_0x14ad2f){_0x409db6['push'](_0x409db6['shift']());}}}(a29_0x1e82,0x87573));import a29_0x115406 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a29_0x1e82(){const _0x44ae46=['\x20\x20Config\x20JSON','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Service\x20Tree','✗\x20Invalid','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','length','\x20\x20Auth','8fTQVQq','red','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Project','104qjyBgs','\x20(accessKey)','empty','riskLevel','status','yellow','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','message','padEnd','repeat','log','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20─','\x20\x20Config\x20Files','path','(no\x20file)','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','missing','source','env','128440FOCtcL','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','8344386rpGAKI','4155400FfMBlb','\x20(legacy/compat\x20only)','\x20\x20API\x20Endpoints','(missing)','(none)','doctor','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','green','⚠\x20Empty','\x20commands)','20FVFJUD','55227WEzJhy','Diagnose\x20CLI\x20configuration\x20and\x20environment','locale','3989931JuXMlJ','read','check','registryPath','\x20Imported\x20from:\x20','Global','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','services','346689wqfBJw','gray','commandCount','(not\x20found)','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','2420cZxGky','2382FrfTSd','pageSize','bold','✓\x20Valid\x20JSON','accessKey'];a29_0x1e82=function(){return _0x44ae46;};return a29_0x1e82();}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';function a29_0x55f8(_0x4af248,_0x7f875c){_0x4af248=_0x4af248-0xd7;const _0x1e828a=a29_0x1e82();let _0x55f88d=_0x1e828a[_0x4af248];return _0x55f88d;}import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x44ae80){const _0x19853a=a29_0x55f8,_0x356f46=getCliVersion(),_0x2795f0=buildConfigFromFlags({});await initGlobalEnvironment(_0x2795f0),console[_0x19853a(0x122)](),console['log'](a29_0x115406[_0x19853a(0x10a)](CLI_BIN_NAME+'\x20doctor')),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x101)]('─'[_0x19853a(0x121)](0x32))),console[_0x19853a(0x122)](_0x19853a(0xe1)+_0x356f46),console['log'](_0x19853a(0xe2)+process['version']),console[_0x19853a(0x122)](_0x19853a(0xe3)+process[_0x19853a(0xdc)]+'\x20'+process['arch']),console[_0x19853a(0x122)](),console[_0x19853a(0x122)](a29_0x115406['bold'](_0x19853a(0xd8))),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x101)](_0x19853a(0xd7)[_0x19853a(0x121)](0x1e)));const _0xc03e08=getGlobalConfigPath(),_0x3ec0fd=getProjectConfigPath();console['log'](_0x19853a(0x104)+(_0xc03e08||a29_0x115406['gray'](_0x19853a(0x103)))),console[_0x19853a(0x122)](_0x19853a(0x123)+(_0x3ec0fd||a29_0x115406[_0x19853a(0x101)](_0x19853a(0x103)))),console[_0x19853a(0x122)](),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x10a)](_0x19853a(0x10d))),console['log'](a29_0x115406[_0x19853a(0x101)](_0x19853a(0xd7)['repeat'](0x1e)));const _0x2a6d67=(_0x59078d,_0x537ff9)=>{const _0x191a59=_0x19853a;if(!_0x537ff9){console[_0x191a59(0x122)]('\x20\x20'+_0x59078d[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0x101)](_0x191a59(0xda)));return;}const _0x37231b=inspectCliConfigJsonFile(_0x537ff9);if(_0x37231b['status']==='ok')console[_0x191a59(0x122)]('\x20\x20'+_0x59078d[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0xed)](_0x191a59(0x10b)));else{if(_0x37231b[_0x191a59(0x11c)]==='empty')console[_0x191a59(0x122)]('\x20\x20'+_0x59078d[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0x11d)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x37231b[_0x191a59(0x11c)]==='missing'?console[_0x191a59(0x122)]('\x20\x20'+_0x59078d[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0x101)](_0x191a59(0xe8))):(console[_0x191a59(0x122)]('\x20\x20'+_0x59078d[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0x115)]('✗\x20Invalid\x20JSON')),console[_0x191a59(0x122)]('\x20\x20'+''[_0x191a59(0x120)](0x11)+'\x20'+a29_0x115406[_0x191a59(0x115)](_0x37231b[_0x191a59(0x11f)])));}};_0x2a6d67(_0x19853a(0xf9),_0xc03e08),_0x2a6d67(_0x19853a(0x117),_0x3ec0fd),console['log'](),console[_0x19853a(0x122)](a29_0x115406['bold']('\x20\x20Merged\x20Config')),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x101)](_0x19853a(0xd7)[_0x19853a(0x121)](0x1e))),console[_0x19853a(0x122)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x2795f0['appCode']||a29_0x115406[_0x19853a(0x115)](_0x19853a(0xec)))),console[_0x19853a(0x122)](_0x19853a(0xdb)+_0x2795f0[_0x19853a(0xdf)]);const _0x1734c4=isLegacyCompatConfigKey('locale')?a29_0x115406[_0x19853a(0x101)](_0x2795f0['locale']+_0x19853a(0xe6)):_0x2795f0[_0x19853a(0xf3)];console['log'](_0x19853a(0x116)+_0x1734c4),console[_0x19853a(0x122)](_0x19853a(0xfe)+(_0x2795f0['defaultApp']||a29_0x115406[_0x19853a(0x101)](_0x19853a(0xe9)))),console[_0x19853a(0x122)](_0x19853a(0xfc)+(_0x2795f0['currentApp']||a29_0x115406['gray']('(none)'))),console[_0x19853a(0x122)](_0x19853a(0xfa)+(_0x2795f0['format']||a29_0x115406['gray']('(default:\x20'+DEFAULT_CONFIG_VALUES['format']+')'))),console[_0x19853a(0x122)](_0x19853a(0x106)+(_0x2795f0[_0x19853a(0x109)]??a29_0x115406[_0x19853a(0x101)]('(default)'))),console[_0x19853a(0x122)](_0x19853a(0x10e)+_0x2795f0[_0x19853a(0x11b)]),console[_0x19853a(0x122)](_0x19853a(0x11e)+_0x2795f0['verbose']),console[_0x19853a(0x122)](_0x19853a(0x105)+AUTH_MODE['ClientAk']),console[_0x19853a(0x122)]('\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20'+(_0x2795f0[_0x19853a(0x10c)]?a29_0x115406['green']('(set,\x20length='+_0x2795f0[_0x19853a(0x10c)][_0x19853a(0x112)]+')'):a29_0x115406[_0x19853a(0x101)](_0x19853a(0xe9)))),console[_0x19853a(0x122)](),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x10a)](_0x19853a(0xe7))),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x101)]('\x20\x20─'['repeat'](0x1e))),console['log']('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x19853a(0x122)](_0x19853a(0x111)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x19853a(0x122)](),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x10a)](_0x19853a(0x10f))),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x101)](_0x19853a(0xd7)[_0x19853a(0x121)](0x1e)));const _0x7942d3=inspectServiceRegistry();console[_0x19853a(0x122)]('\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x7942d3[_0x19853a(0xf7)]),console[_0x19853a(0x122)]('\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+formatServiceRegistryStatus(_0x7942d3)),console[_0x19853a(0x122)]('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x7942d3['serviceCount']),console['log'](_0x19853a(0xeb)+_0x7942d3[_0x19853a(0x102)]);for(const _0x3d3d6c of _0x7942d3[_0x19853a(0xff)]){console[_0x19853a(0x122)]('\x20\x20'+(_0x3d3d6c['serviceCode']+':')[_0x19853a(0x120)](0x11)+'\x20'+(_0x3d3d6c['name']||a29_0x115406[_0x19853a(0x101)]('(unnamed)'))+'\x20('+_0x3d3d6c[_0x19853a(0x102)]+_0x19853a(0xef)),console[_0x19853a(0x122)]('\x20\x20'+''[_0x19853a(0x120)](0x11)+_0x19853a(0xf8)+_0x3d3d6c[_0x19853a(0xde)][_0x19853a(0xd9)]);}return console['log'](),console[_0x19853a(0x122)](a29_0x115406[_0x19853a(0x10a)](_0x19853a(0x113))),console['log'](a29_0x115406['gray']('\x20\x20─'[_0x19853a(0x121)](0x1e))),console[_0x19853a(0x122)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x115406[_0x19853a(0xed)](AUTH_MODE['ClientAk']+_0x19853a(0x119))),console[_0x19853a(0x122)](_0x19853a(0xfd)+a29_0x115406[_0x19853a(0x101)](_0x19853a(0xfb))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0xb8d387){const _0x43b68c=a29_0x55f8;if(_0xb8d387[_0x43b68c(0x11c)]==='ok')return a29_0x115406[_0x43b68c(0xed)]('✓\x20Loaded');if(_0xb8d387['status']===_0x43b68c(0xdd))return a29_0x115406['gray'](_0x43b68c(0x103));if(_0xb8d387[_0x43b68c(0x11c)]===_0x43b68c(0x11a))return a29_0x115406[_0x43b68c(0x11d)](_0x43b68c(0xee));return a29_0x115406[_0x43b68c(0x115)](_0x43b68c(0x110)+(_0xb8d387['message']?':\x20'+_0xb8d387['message']:''));}export const doctorDefinition={'service':a29_0x83e468(0xea),'command':a29_0x83e468(0xf6),'description':a29_0x83e468(0xf2),'risk':a29_0x83e468(0xf5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x1c15a7=a30_0x49a9;(function(_0x9ff619,_0x550805){const _0x4a00a6=a30_0x49a9,_0x4fd3dd=_0x9ff619();while(!![]){try{const _0x2b75bb=parseInt(_0x4a00a6(0x152))/0x1*(parseInt(_0x4a00a6(0x148))/0x2)+-parseInt(_0x4a00a6(0x153))/0x3+-parseInt(_0x4a00a6(0x146))/0x4+parseInt(_0x4a00a6(0x13f))/0x5+-parseInt(_0x4a00a6(0x13d))/0x6*(parseInt(_0x4a00a6(0x14c))/0x7)+parseInt(_0x4a00a6(0x138))/0x8+parseInt(_0x4a00a6(0x13b))/0x9;if(_0x2b75bb===_0x550805)break;else _0x4fd3dd['push'](_0x4fd3dd['shift']());}catch(_0x51265c){_0x4fd3dd['push'](_0x4fd3dd['shift']());}}}(a30_0x1075,0xaeb31));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a30_0x1075(){const _0x59023d=['Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','file','download','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','boolean','1022472seOyeC','trim','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','6164163DMCVSH','long-term','9228yJrDPk','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','5247690UOjBrq','str','Path\x20to\x20the\x20local\x20file\x20to\x20upload','description','build','string','File','4159196CniIbc','upload','68024LcDGgN','filepath','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','query-url','1421COHsjO','read','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','/client/uploadFile','validation','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','19ZFANUE','1322700vlwxja','filePath\x20is\x20required.','Uploaded\x20file:\x20','bool','appCode','filePath'];a30_0x1075=function(){return _0x59023d;};return a30_0x1075();}import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x1c15a7(0x15a),'type':a30_0x1c15a7(0x144),'required':!![],'description':a30_0x1c15a7(0x141)},FILEPATH_FLAG={'name':a30_0x1c15a7(0x149),'type':a30_0x1c15a7(0x144),'required':!![],'description':a30_0x1c15a7(0x151)},DOWNLOAD_FLAG={'name':a30_0x1c15a7(0x15b),'type':a30_0x1c15a7(0x137),'description':a30_0x1c15a7(0x15c)},LONG_TERM_FLAG={'name':a30_0x1c15a7(0x13c),'type':a30_0x1c15a7(0x137),'description':a30_0x1c15a7(0x159)};function requireFilePath(_0x31d36d){const _0x52caca=a30_0x1c15a7,_0x122e86=_0x31d36d[_0x52caca(0x139)]();if(!_0x122e86)throw CliErrors[_0x52caca(0x150)](_0x52caca(0x154));return _0x122e86;}const fileUpload={'service':a30_0x1c15a7(0x15a),'command':a30_0x1c15a7(0x147),'description':a30_0x1c15a7(0x13e),'risk':a30_0x1c15a7(0x14d),'flags':[FILE_FLAG],async 'dryRun'(_0x36798a){const _0xfb1c5=a30_0x1c15a7,_0x50bf7d=requireRuntimeUploadFile(_0x36798a['str'](_0xfb1c5(0x15a)),_0xfb1c5(0x145));return dryRun('POST',_0xfb1c5(0x14f))['body']({'appCode':_0x36798a[_0xfb1c5(0x157)],'multipart':{'file':_0x50bf7d}})[_0xfb1c5(0x142)]('Preview:\x20upload\x20'+_0x50bf7d['path']+'\x20to\x20runtime\x20app\x20'+_0x36798a[_0xfb1c5(0x157)])[_0xfb1c5(0x143)]();},async 'execute'(_0x199678){const _0x12fadc=a30_0x1c15a7,_0x5e04ce=requireRuntimeUploadFile(_0x199678['str'](_0x12fadc(0x15a)),'File'),_0xf377f9=await uploadRuntimeFile(_0x199678[_0x12fadc(0x157)],_0x5e04ce['path']);return{'ok':!![],'data':_0xf377f9,'message':_0xf377f9[_0x12fadc(0x158)]?_0x12fadc(0x155)+_0xf377f9['filePath']+_0x12fadc(0x13a):_0x12fadc(0x14e)};}},fileQueryUrl={'service':'file','command':a30_0x1c15a7(0x14b),'description':a30_0x1c15a7(0x14a),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x19b619){const _0x3a0121=a30_0x1c15a7,_0x3ee640=requireFilePath(_0x19b619[_0x3a0121(0x140)](_0x3a0121(0x149))),_0x4b580a=await queryRuntimeFileUrl(_0x3ee640,{'download':_0x19b619[_0x3a0121(0x156)](_0x3a0121(0x15b)),'longTerm':_0x19b619['bool']('long-term')});return{'ok':!![],'data':_0x4b580a};}};function a30_0x49a9(_0x2488d6,_0x354f6d){_0x2488d6=_0x2488d6-0x137;const _0x10758d=a30_0x1075();let _0x49a9a6=_0x10758d[_0x2488d6];return _0x49a9a6;}export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x11a723=a31_0x4d08;(function(_0x43247e,_0x370caf){const _0x1d6dfd=a31_0x4d08,_0xc1f52c=_0x43247e();while(!![]){try{const _0x4278b3=parseInt(_0x1d6dfd(0x162))/0x1*(parseInt(_0x1d6dfd(0x159))/0x2)+parseInt(_0x1d6dfd(0x168))/0x3+-parseInt(_0x1d6dfd(0x173))/0x4*(parseInt(_0x1d6dfd(0x184))/0x5)+-parseInt(_0x1d6dfd(0x176))/0x6*(-parseInt(_0x1d6dfd(0x15a))/0x7)+-parseInt(_0x1d6dfd(0x153))/0x8+-parseInt(_0x1d6dfd(0x194))/0x9*(-parseInt(_0x1d6dfd(0x180))/0xa)+parseInt(_0x1d6dfd(0x174))/0xb;if(_0x4278b3===_0x370caf)break;else _0xc1f52c['push'](_0xc1f52c['shift']());}catch(_0x310a8e){_0xc1f52c['push'](_0xc1f52c['shift']());}}}(a31_0x276d,0x958fc));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a31_0x4d08(_0x5a9ed8,_0x1f79f0){_0x5a9ed8=_0x5a9ed8-0x14f;const _0x276d5e=a31_0x276d();let _0x4d0865=_0x276d5e[_0x5a9ed8];return _0x4d0865;}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_0x11a723(0x183),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x18a)},{'name':a31_0x11a723(0x14f),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x177)+DEFAULT_CONFIG_VALUES[a31_0x11a723(0x14f)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x11a723(0x164),'type':a31_0x11a723(0x192),'description':a31_0x11a723(0x190)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x11a723(0x17e),'type':'boolean','description':a31_0x11a723(0x157),'default':![]}];function a31_0x276d(){const _0x3f185e=['log','global','User\x20aborted\x20prompt','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20\x20config:\x20\x20','1823214JMRTuh','cwd','message','Source\x20file\x20not\x20found:\x20','app','apps','stdout','Initialized\x20','defaultApp','\x20\x20default:\x20','Override\x20imported\x20default\x20appcode','38072oyWuoC','1267915TLqKoC','close','246dsNqaw','Target\x20environment\x20(default\x20','newConfigFileName','string','\x20init\x20—\x20Create\x20','Usage:\x20','trim','validation','yes','Aborted.','69710PFzLSY','cancelled','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`.','appcode','300rLuSKe','once','apiDir','AbortPrompt','[y/N]','race','App\x20code\x20for\x20the\x20project','entries','\x20\x20env:\x20\x20\x20\x20\x20','Invalid\x20env\x20\x22','SIGINT','includes','Write\x20to\x20global\x20(~/','File\x20','boolean','riskLevel','423dASsTx','project','Failed\x20to\x20parse\x20source\x20file:\x20','env','question','[Y/n]','file','7596784oNrRpk','flagMissing','\x22.\x20Allowed:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Skip\x20confirmation\x20when\x20overwriting','\x20\x20appcode:\x20','32OXpZlI','94654vbhBUK','removeListener','\x20already\x20exists.\x20Overwrite?',')\x20instead\x20of\x20project','):\x20','object','Override\x20imported\x20default\x20env','stdin','33015RdEiCn'];a31_0x276d=function(){return _0x3f185e;};return a31_0x276d();}export const initImportFlagDefs=[{'name':a31_0x11a723(0x152),'type':a31_0x11a723(0x179),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x11a723(0x183),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x172)},{'name':a31_0x11a723(0x14f),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x160),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x11a723(0x164),'type':a31_0x11a723(0x192),'description':a31_0x11a723(0x190)+PRODUCT_CONFIG[a31_0x11a723(0x178)]+a31_0x11a723(0x15d),'default':![]},{'name':a31_0x11a723(0x17e),'type':a31_0x11a723(0x192),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x4d9110){const _0x106a4c=a31_0x11a723,_0x4d0ae9=isNonInteractiveMode(_0x4d9110),_0x2ffb89=_0x4d9110[_0x106a4c(0x164)]?_0x106a4c(0x164):_0x106a4c(0x195),_0x3e4294=resolveWriteConfigPath(_0x2ffb89);try{_0x4d0ae9?await runNonInteractive(_0x4d9110,_0x3e4294):await runInteractive(_0x4d9110,_0x3e4294);}catch(_0x27588e){if(_0x27588e instanceof AbortPrompt)throw CliErrors[_0x106a4c(0x181)]();throw _0x27588e;}}export async function runInitImport(_0x5b6738){const _0x2bcd03=a31_0x11a723,_0x58f642=_0x5b6738['global']?_0x2bcd03(0x164):'project',_0x2ffa2e=resolveWriteConfigPath(_0x58f642);await runFromImport(_0x5b6738,_0x2ffa2e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x11a723(0x186)]);async function runFromImport(_0x5781af,_0x32670c){const _0x14f353=a31_0x11a723,_0xaf4bbc=resolveFilePath(_0x5781af[_0x14f353(0x152)]);if(!existsSync(_0xaf4bbc))throw CliErrors[_0x14f353(0x17d)](_0x14f353(0x16b)+_0xaf4bbc);const _0x572ab4=readSourceFile(_0xaf4bbc),_0x3e07d6=convertToRuntimeConfig(_0x572ab4);_0x5781af[_0x14f353(0x183)]&&(_0x3e07d6[_0x14f353(0x183)]=String(_0x5781af[_0x14f353(0x183)]));_0x5781af[_0x14f353(0x14f)]&&(_0x3e07d6[_0x14f353(0x14f)]=resolveInitEnv(_0x5781af));if(!_0x3e07d6[_0x14f353(0x183)])throw CliErrors['validation'](_0x14f353(0x156),_0x14f353(0x182));await writeInitConfig(_0x32670c,_0x3e07d6,_0x5781af),console[_0x14f353(0x163)]('Imported\x20from\x20'+_0xaf4bbc),console[_0x14f353(0x163)](_0x14f353(0x167)+_0x32670c),console['log'](_0x14f353(0x158)+_0x3e07d6[_0x14f353(0x183)]);if(_0x3e07d6[_0x14f353(0x170)])console[_0x14f353(0x163)](_0x14f353(0x171)+_0x3e07d6[_0x14f353(0x170)]);}function convertToRuntimeConfig(_0x438a6d){const _0x2f5f7e=a31_0x11a723;if(_0x438a6d[_0x2f5f7e(0x16d)]&&typeof _0x438a6d[_0x2f5f7e(0x16d)]===_0x2f5f7e(0x15f))throw CliErrors[_0x2f5f7e(0x17d)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x2f5f7e(0x166));const _0x4b780c={};for(const _0x1307d2 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x438a6d[_0x1307d2]!==undefined&&(_0x4b780c[_0x1307d2]=_0x438a6d[_0x1307d2]);}return!_0x4b780c[_0x2f5f7e(0x193)]&&(_0x4b780c[_0x2f5f7e(0x193)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x4b780c;}async function runNonInteractive(_0x55d33f,_0x1ca99e){const _0x218642=a31_0x11a723,_0x2bc7d2=_0x55d33f[_0x218642(0x183)];if(!_0x2bc7d2)throw CliErrors[_0x218642(0x154)]('appcode',_0x218642(0x17b)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x1aa3e8=resolveInitEnv(_0x55d33f);await writeInitConfig(_0x1ca99e,{'appcode':_0x2bc7d2,'env':_0x1aa3e8},_0x55d33f),console[_0x218642(0x163)](_0x218642(0x16f)+_0x1ca99e),console['log']('\x20\x20appcode:\x20'+_0x2bc7d2),console['log'](_0x218642(0x18c)+_0x1aa3e8);}async function runInteractive(_0x5f33aa,_0x4b74be){const _0x48e92a=a31_0x11a723,_0x50901f=loadExisting(_0x4b74be),_0x528c2b=typeof _0x50901f?.[_0x48e92a(0x183)]===_0x48e92a(0x179)?_0x50901f[_0x48e92a(0x183)]:'',_0x1e52a8=resolveInitEnv(_0x5f33aa);console['log'](CLI_BIN_NAME+_0x48e92a(0x17a)+PRODUCT_CONFIG[_0x48e92a(0x178)]+'\x0a');if(existsSync(_0x4b74be)&&!_0x5f33aa[_0x48e92a(0x17e)]){const _0x4c7d66=await promptYesNo(_0x48e92a(0x191)+_0x4b74be+_0x48e92a(0x15c),![]);if(!_0x4c7d66){console['log'](_0x48e92a(0x17f));return;}}const _0xf96224=typeof _0x5f33aa[_0x48e92a(0x183)]===_0x48e92a(0x179)?_0x5f33aa[_0x48e92a(0x183)][_0x48e92a(0x17c)]():'';let _0x39d995=_0xf96224;!_0x39d995&&(_0x39d995=await promptInput('App\x20code',_0x528c2b));if(!_0x39d995[_0x48e92a(0x17c)]())throw CliErrors[_0x48e92a(0x17d)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x4b74be,{'appcode':_0x39d995[_0x48e92a(0x17c)](),'env':_0x1e52a8},_0x5f33aa),console[_0x48e92a(0x163)]('\x0aInitialized\x20'+_0x4b74be),console[_0x48e92a(0x163)]('\x20\x20appcode:\x20'+_0x39d995['trim']()),console[_0x48e92a(0x163)](_0x48e92a(0x18c)+_0x1e52a8);}async function writeInitConfig(_0x44ed5e,_0x1d33d5,_0x3901ec){const _0x3aa30f=a31_0x11a723;let _0x56b318={};existsSync(_0x44ed5e)&&!_0x3901ec['yes']&&(_0x56b318=readConfigFile(_0x44ed5e));for(const [_0x48cc35,_0x27e8c8]of Object[_0x3aa30f(0x18b)](_0x1d33d5)){_0x27e8c8!==undefined&&(_0x56b318[_0x48cc35]=_0x27e8c8);}if(_0x56b318[_0x3aa30f(0x16c)])delete _0x56b318[_0x3aa30f(0x16c)];writeConfigFile(_0x44ed5e,_0x56b318);}class AbortPrompt extends Error{constructor(){const _0x1db13a=a31_0x11a723;super(_0x1db13a(0x165)),this['name']=_0x1db13a(0x187);}}function createSafeRl(){const _0x5638d2=a31_0x11a723,_0x40f749=createInterface({'input':process[_0x5638d2(0x161)],'output':process[_0x5638d2(0x16e)]});let _0x407a4f;const _0x358ddb=new Promise((_0x3ea68b,_0x4616e0)=>{const _0x13276b=_0x5638d2;_0x407a4f=()=>{const _0x44d50e=a31_0x4d08;_0x407a4f&&(_0x40f749[_0x44d50e(0x15b)](_0x44d50e(0x18e),_0x407a4f),_0x407a4f=undefined);try{_0x40f749[_0x44d50e(0x175)]();}catch{}_0x4616e0(new AbortPrompt());},_0x40f749[_0x13276b(0x185)](_0x13276b(0x18e),_0x407a4f);}),_0x2eb78a=()=>{const _0x118807=_0x5638d2;_0x407a4f&&(_0x40f749[_0x118807(0x15b)](_0x118807(0x18e),_0x407a4f),_0x407a4f=undefined);try{_0x40f749['close']();}catch{}};return{'rl':_0x40f749,'abortPromise':_0x358ddb,'disposeSuccess':_0x2eb78a};}async function promptInput(_0x238049,_0x2d499b){const _0x576c9c=a31_0x11a723,{rl:_0x54c941,abortPromise:_0x568b9e,disposeSuccess:_0xa57461}=createSafeRl(),_0x47fb4f=new Promise(_0x4f0131=>{const _0x374b6c=a31_0x4d08,_0x42bbf0=_0x2d499b?'\x20\x20'+_0x238049+'\x20('+_0x2d499b+_0x374b6c(0x15e):'\x20\x20'+_0x238049+':\x20';_0x54c941['question'](_0x42bbf0,_0x507503=>{const _0x1c973d=_0x374b6c;_0xa57461(),_0x4f0131(_0x507503[_0x1c973d(0x17c)]()||_0x2d499b);});});return Promise[_0x576c9c(0x189)]([_0x47fb4f,_0x568b9e]);}async function promptYesNo(_0x4459e9,_0x18a9fc){const _0x548c08=a31_0x11a723,{rl:_0x47abb7,abortPromise:_0x3eeba4,disposeSuccess:_0x772d12}=createSafeRl(),_0x4de078=new Promise(_0x204631=>{const _0x4d8650=a31_0x4d08,_0x4d04fa=_0x18a9fc?_0x4d8650(0x151):_0x4d8650(0x188);_0x47abb7[_0x4d8650(0x150)]('\x20\x20'+_0x4459e9+'\x20'+_0x4d04fa+':\x20',_0x45098c=>{const _0x45bfe8=_0x4d8650;_0x772d12();const _0x3ae8e4=_0x45098c[_0x45bfe8(0x17c)]()['toLowerCase']();if(_0x3ae8e4==='y'||_0x3ae8e4===_0x45bfe8(0x17e))_0x204631(!![]);else{if(_0x3ae8e4==='n'||_0x3ae8e4==='no')_0x204631(![]);else _0x204631(_0x18a9fc);}});});return Promise[_0x548c08(0x189)]([_0x4de078,_0x3eeba4]);}function loadExisting(_0x4985a3){if(!existsSync(_0x4985a3))return null;return readConfigFile(_0x4985a3);}function resolveFilePath(_0xd4e5a4){const _0x373c2c=a31_0x11a723;return isAbsolute(_0xd4e5a4)?_0xd4e5a4:resolve(process[_0x373c2c(0x169)](),_0xd4e5a4);}function readSourceFile(_0x5b7e7e){const _0x4f7317=a31_0x11a723;try{const _0x1fc3a5=readFileSync(_0x5b7e7e,{'encoding':'utf8'});return JSON['parse'](_0x1fc3a5);}catch(_0x314dca){throw CliErrors[_0x4f7317(0x17d)](_0x4f7317(0x196)+_0x314dca[_0x4f7317(0x16a)]);}}function resolveInitEnv(_0x45ac6a){const _0xfa6411=a31_0x11a723,_0x364a11=_0x45ac6a[_0xfa6411(0x14f)];if(_0x364a11===undefined||_0x364a11==='')return DEFAULT_CONFIG_VALUES[_0xfa6411(0x14f)];if(!RUNTIME_ENV_VALUES[_0xfa6411(0x18f)](_0x364a11))throw CliErrors[_0xfa6411(0x17d)](_0xfa6411(0x18d)+_0x364a11+_0xfa6411(0x155)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x364a11;}
|
|
1
|
+
const a31_0x44c116=a31_0x27f0;(function(_0x4509c0,_0x1ec5cd){const _0x27b828=a31_0x27f0,_0x1af056=_0x4509c0();while(!![]){try{const _0x59ae32=-parseInt(_0x27b828(0xad))/0x1*(-parseInt(_0x27b828(0xd3))/0x2)+-parseInt(_0x27b828(0xc2))/0x3*(parseInt(_0x27b828(0xba))/0x4)+parseInt(_0x27b828(0xdb))/0x5+-parseInt(_0x27b828(0xe4))/0x6+-parseInt(_0x27b828(0xd6))/0x7+-parseInt(_0x27b828(0xd5))/0x8+-parseInt(_0x27b828(0xd0))/0x9*(-parseInt(_0x27b828(0xaa))/0xa);if(_0x59ae32===_0x1ec5cd)break;else _0x1af056['push'](_0x1af056['shift']());}catch(_0x3f8a5c){_0x1af056['push'](_0x1af056['shift']());}}}(a31_0x1aaf,0xa0932));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';function a31_0x1aaf(){const _0x5e12f1=['9kMRhoZ','\x0aInitialized\x20','removeListener','11348FQtKqb','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','7708672QJkarN','8071161zcCSIW','\x20\x20config:\x20\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','question','Skip\x20confirmation\x20when\x20overwriting','3013995HUpIrc','appcode','newConfigFileName','log',')\x20instead\x20of\x20project','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','includes','utf8','Write\x20to\x20global\x20(~/','318522lcyXFM','apiDir','global','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','AbortPrompt','entries','SIGINT','validation','\x20\x20default:\x20','cancelled','24044410ePiCxo','apps','stdout','198IouOYr','cwd','yes','[y/N]','string','riskLevel','race','Override\x20imported\x20default\x20appcode','\x20\x20env:\x20\x20\x20\x20\x20','App\x20code\x20for\x20the\x20project','trim','Source\x20file\x20not\x20found:\x20','Aborted.','24gBRvWk','boolean','defaultApp','file','message','join','name','\x20\x20appcode:\x20','651642xBEint','project','\x20already\x20exists.\x20Overwrite?','App\x20code\x20cannot\x20be\x20empty.','flagMissing','close','toLowerCase','env','Imported\x20from\x20','):\x20','stdin','Target\x20environment\x20(default\x20','app','object'];a31_0x1aaf=function(){return _0x5e12f1;};return a31_0x1aaf();}import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x44c116(0xdc),'type':a31_0x44c116(0xb1),'description':a31_0x44c116(0xb6)},{'name':a31_0x44c116(0xc9),'type':a31_0x44c116(0xb1),'description':a31_0x44c116(0xcd)+DEFAULT_CONFIG_VALUES[a31_0x44c116(0xc9)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x44c116(0xe6),'type':'boolean','description':a31_0x44c116(0xe3)+PRODUCT_CONFIG[a31_0x44c116(0xdd)]+a31_0x44c116(0xdf),'default':![]},{'name':a31_0x44c116(0xaf),'type':'boolean','description':a31_0x44c116(0xda),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x44c116(0xbd),'type':a31_0x44c116(0xb1),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x44c116(0xdc),'type':a31_0x44c116(0xb1),'description':a31_0x44c116(0xb4)},{'name':'env','type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x44c116(0xe6),'type':a31_0x44c116(0xbb),'description':a31_0x44c116(0xe3)+PRODUCT_CONFIG[a31_0x44c116(0xdd)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x44c116(0xbb),'description':a31_0x44c116(0xda),'default':![]}];export async function runInit(_0x4435dc){const _0x26d1b9=a31_0x44c116,_0x372b2a=isNonInteractiveMode(_0x4435dc),_0x32e3ba=_0x4435dc[_0x26d1b9(0xe6)]?_0x26d1b9(0xe6):_0x26d1b9(0xc3),_0x30805f=resolveWriteConfigPath(_0x32e3ba);try{_0x372b2a?await runNonInteractive(_0x4435dc,_0x30805f):await runInteractive(_0x4435dc,_0x30805f);}catch(_0x4e76ec){if(_0x4e76ec instanceof AbortPrompt)throw CliErrors[_0x26d1b9(0xa9)]();throw _0x4e76ec;}}export async function runInitImport(_0x5254ef){const _0x4bd98a=a31_0x44c116,_0xbc41fa=_0x5254ef[_0x4bd98a(0xe6)]?_0x4bd98a(0xe6):_0x4bd98a(0xc3),_0x3913ce=resolveWriteConfigPath(_0xbc41fa);await runFromImport(_0x5254ef,_0x3913ce);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x44c116(0xe5)]);function a31_0x27f0(_0x3a305b,_0x22673c){_0x3a305b=_0x3a305b-0xa4;const _0x1aaffc=a31_0x1aaf();let _0x27f0bc=_0x1aaffc[_0x3a305b];return _0x27f0bc;}async function runFromImport(_0x317e46,_0x2b9777){const _0xaec19=a31_0x44c116,_0x50e02f=resolveFilePath(_0x317e46['file']);if(!existsSync(_0x50e02f))throw CliErrors[_0xaec19(0xa7)](_0xaec19(0xb8)+_0x50e02f);const _0x5758ee=readSourceFile(_0x50e02f),_0x2aa7ea=convertToRuntimeConfig(_0x5758ee);_0x317e46[_0xaec19(0xdc)]&&(_0x2aa7ea[_0xaec19(0xdc)]=String(_0x317e46[_0xaec19(0xdc)]));_0x317e46[_0xaec19(0xc9)]&&(_0x2aa7ea[_0xaec19(0xc9)]=resolveInitEnv(_0x317e46));if(!_0x2aa7ea['appcode'])throw CliErrors['validation'](_0xaec19(0xe7),'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(_0x2b9777,_0x2aa7ea,_0x317e46),console[_0xaec19(0xde)](_0xaec19(0xca)+_0x50e02f),console[_0xaec19(0xde)](_0xaec19(0xd7)+_0x2b9777),console[_0xaec19(0xde)](_0xaec19(0xc1)+_0x2aa7ea[_0xaec19(0xdc)]);if(_0x2aa7ea[_0xaec19(0xbc)])console[_0xaec19(0xde)](_0xaec19(0xa8)+_0x2aa7ea[_0xaec19(0xbc)]);}function convertToRuntimeConfig(_0x442fca){const _0xf5c1d2=a31_0x44c116;if(_0x442fca[_0xf5c1d2(0xab)]&&typeof _0x442fca[_0xf5c1d2(0xab)]===_0xf5c1d2(0xcf))throw CliErrors[_0xf5c1d2(0xa7)](_0xf5c1d2(0xd4),_0xf5c1d2(0xd8));const _0x197eeb={};for(const _0x33af62 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x442fca[_0x33af62]!==undefined&&(_0x197eeb[_0x33af62]=_0x442fca[_0x33af62]);}return!_0x197eeb[_0xf5c1d2(0xb2)]&&(_0x197eeb[_0xf5c1d2(0xb2)]=DEFAULT_CONFIG_VALUES[_0xf5c1d2(0xb2)]),_0x197eeb;}async function runNonInteractive(_0x44de2f,_0x48ebfb){const _0xd1c531=a31_0x44c116,_0x16ec17=_0x44de2f[_0xd1c531(0xdc)];if(!_0x16ec17)throw CliErrors[_0xd1c531(0xc6)](_0xd1c531(0xdc),'Usage:\x20'+CLI_BIN_NAME+_0xd1c531(0xe0));const _0x1b7f05=resolveInitEnv(_0x44de2f);await writeInitConfig(_0x48ebfb,{'appcode':_0x16ec17,'env':_0x1b7f05},_0x44de2f),console['log']('Initialized\x20'+_0x48ebfb),console['log'](_0xd1c531(0xc1)+_0x16ec17),console[_0xd1c531(0xde)](_0xd1c531(0xb5)+_0x1b7f05);}async function runInteractive(_0x260248,_0x31bc7b){const _0x58a047=a31_0x44c116,_0x3e881c=loadExisting(_0x31bc7b),_0x13806a=typeof _0x3e881c?.[_0x58a047(0xdc)]==='string'?_0x3e881c['appcode']:'',_0x55e6e4=resolveInitEnv(_0x260248);console[_0x58a047(0xde)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x58a047(0xdd)]+'\x0a');if(existsSync(_0x31bc7b)&&!_0x260248[_0x58a047(0xaf)]){const _0x3a04ec=await promptYesNo('File\x20'+_0x31bc7b+_0x58a047(0xc4),![]);if(!_0x3a04ec){console[_0x58a047(0xde)](_0x58a047(0xb9));return;}}const _0x3ef96e=typeof _0x260248[_0x58a047(0xdc)]==='string'?_0x260248[_0x58a047(0xdc)][_0x58a047(0xb7)]():'';let _0x50b744=_0x3ef96e;!_0x50b744&&(_0x50b744=await promptInput('App\x20code',_0x13806a));if(!_0x50b744['trim']())throw CliErrors[_0x58a047(0xa7)](_0x58a047(0xc5));await writeInitConfig(_0x31bc7b,{'appcode':_0x50b744[_0x58a047(0xb7)](),'env':_0x55e6e4},_0x260248),console[_0x58a047(0xde)](_0x58a047(0xd1)+_0x31bc7b),console[_0x58a047(0xde)]('\x20\x20appcode:\x20'+_0x50b744['trim']()),console[_0x58a047(0xde)](_0x58a047(0xb5)+_0x55e6e4);}async function writeInitConfig(_0x57f933,_0x3de4df,_0x578c74){const _0x814e61=a31_0x44c116;let _0x4d8fa0={};existsSync(_0x57f933)&&!_0x578c74['yes']&&(_0x4d8fa0=readConfigFile(_0x57f933));for(const [_0x1c3622,_0x4e4f88]of Object[_0x814e61(0xa5)](_0x3de4df)){_0x4e4f88!==undefined&&(_0x4d8fa0[_0x1c3622]=_0x4e4f88);}if(_0x4d8fa0['app'])delete _0x4d8fa0[_0x814e61(0xce)];writeConfigFile(_0x57f933,_0x4d8fa0);}class AbortPrompt extends Error{constructor(){const _0x2746c3=a31_0x44c116;super('User\x20aborted\x20prompt'),this[_0x2746c3(0xc0)]=_0x2746c3(0xa4);}}function createSafeRl(){const _0x4b018e=a31_0x44c116,_0x100ecb=createInterface({'input':process[_0x4b018e(0xcc)],'output':process[_0x4b018e(0xac)]});let _0x504f9f;const _0x5cfa57=new Promise((_0x66d98a,_0x2bbb7f)=>{const _0x41d3c5=_0x4b018e;_0x504f9f=()=>{const _0x56a48f=a31_0x27f0;_0x504f9f&&(_0x100ecb[_0x56a48f(0xd2)](_0x56a48f(0xa6),_0x504f9f),_0x504f9f=undefined);try{_0x100ecb[_0x56a48f(0xc7)]();}catch{}_0x2bbb7f(new AbortPrompt());},_0x100ecb['once'](_0x41d3c5(0xa6),_0x504f9f);}),_0x10fcac=()=>{const _0x394dd3=_0x4b018e;_0x504f9f&&(_0x100ecb['removeListener'](_0x394dd3(0xa6),_0x504f9f),_0x504f9f=undefined);try{_0x100ecb[_0x394dd3(0xc7)]();}catch{}};return{'rl':_0x100ecb,'abortPromise':_0x5cfa57,'disposeSuccess':_0x10fcac};}async function promptInput(_0x4bc8fe,_0x213e70){const {rl:_0x4e66e5,abortPromise:_0x20c141,disposeSuccess:_0x4776ff}=createSafeRl(),_0x4a0b90=new Promise(_0x9a3704=>{const _0x452859=a31_0x27f0,_0x191d51=_0x213e70?'\x20\x20'+_0x4bc8fe+'\x20('+_0x213e70+_0x452859(0xcb):'\x20\x20'+_0x4bc8fe+':\x20';_0x4e66e5['question'](_0x191d51,_0x685d5c=>{const _0x706a24=_0x452859;_0x4776ff(),_0x9a3704(_0x685d5c[_0x706a24(0xb7)]()||_0x213e70);});});return Promise['race']([_0x4a0b90,_0x20c141]);}async function promptYesNo(_0x429699,_0xf67297){const _0x440aa5=a31_0x44c116,{rl:_0x574139,abortPromise:_0x210f81,disposeSuccess:_0x13dc6c}=createSafeRl(),_0x40edc3=new Promise(_0x49dd71=>{const _0x525f66=a31_0x27f0,_0x18ac22=_0xf67297?'[Y/n]':_0x525f66(0xb0);_0x574139[_0x525f66(0xd9)]('\x20\x20'+_0x429699+'\x20'+_0x18ac22+':\x20',_0x5d6589=>{const _0xf41bff=_0x525f66;_0x13dc6c();const _0x42e77a=_0x5d6589[_0xf41bff(0xb7)]()[_0xf41bff(0xc8)]();if(_0x42e77a==='y'||_0x42e77a===_0xf41bff(0xaf))_0x49dd71(!![]);else{if(_0x42e77a==='n'||_0x42e77a==='no')_0x49dd71(![]);else _0x49dd71(_0xf67297);}});});return Promise[_0x440aa5(0xb3)]([_0x40edc3,_0x210f81]);}function loadExisting(_0x40aa38){if(!existsSync(_0x40aa38))return null;return readConfigFile(_0x40aa38);}function resolveFilePath(_0xeccc01){const _0x5282ce=a31_0x44c116;return isAbsolute(_0xeccc01)?_0xeccc01:resolve(process[_0x5282ce(0xae)](),_0xeccc01);}function readSourceFile(_0x1e8d77){const _0x39338a=a31_0x44c116;try{const _0x548748=readFileSync(_0x1e8d77,{'encoding':_0x39338a(0xe2)});return JSON['parse'](_0x548748);}catch(_0x597470){throw CliErrors['validation']('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x597470[_0x39338a(0xbe)]);}}function resolveInitEnv(_0x542c78){const _0x6522d2=a31_0x44c116,_0x36757e=_0x542c78[_0x6522d2(0xc9)];if(_0x36757e===undefined||_0x36757e==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x6522d2(0xe1)](_0x36757e))throw CliErrors[_0x6522d2(0xa7)]('Invalid\x20env\x20\x22'+_0x36757e+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES[_0x6522d2(0xbf)](',\x20'));return _0x36757e;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x2f7801=a32_0x5460;(function(_0x3804a5,_0x267c9a){const _0x2a9905=a32_0x5460,_0x45a04c=_0x3804a5();while(!![]){try{const _0x2bb785=parseInt(_0x2a9905(0x20e))/0x1*(-parseInt(_0x2a9905(0x211))/0x2)+parseInt(_0x2a9905(0x1da))/0x3*(-parseInt(_0x2a9905(0x1dd))/0x4)+-parseInt(_0x2a9905(0x20f))/0x5+parseInt(_0x2a9905(0x212))/0x6+-parseInt(_0x2a9905(0x1f6))/0x7*(parseInt(_0x2a9905(0x20d))/0x8)+parseInt(_0x2a9905(0x205))/0x9+parseInt(_0x2a9905(0x1ec))/0xa;if(_0x2bb785===_0x267c9a)break;else _0x45a04c['push'](_0x45a04c['shift']());}catch(_0x983a48){_0x45a04c['push'](_0x45a04c['shift']());}}}(a32_0x1dfc,0x65a85));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x2f7801(0x219),'type':a32_0x2f7801(0x1ea),'required':!![],'description':a32_0x2f7801(0x1e8)},FILE_FLAG={'name':a32_0x2f7801(0x1ed),'type':a32_0x2f7801(0x1ea),'required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a32_0x2f7801(0x1e1),'type':'string','required':!![],'description':a32_0x2f7801(0x20b)},TOPK_FLAG={'name':a32_0x2f7801(0x1e7),'type':'number','description':a32_0x2f7801(0x1f0)};function readKnowledgeFile(_0x4b9e5a){const _0x98fb9d=a32_0x2f7801;if(!_0x4b9e5a)throw CliErrors[_0x98fb9d(0x1fd)](_0x98fb9d(0x20a));if(!existsSync(_0x4b9e5a))throw CliErrors['validation'](_0x98fb9d(0x1fe)+_0x4b9e5a);if(!statSync(_0x4b9e5a)[_0x98fb9d(0x1f9)]())throw CliErrors[_0x98fb9d(0x1fd)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x4b9e5a);return readFileSync(_0x4b9e5a,_0x98fb9d(0x215));}function summarizePersonalItem(_0x12b6fd){const _0x13bcfb=a32_0x2f7801;return{'id':_0x12b6fd['id'],'title':_0x12b6fd[_0x13bcfb(0x219)],'version':_0x12b6fd[_0x13bcfb(0x1f1)],'ragStatus':_0x12b6fd[_0x13bcfb(0x207)],'ragErrorMessage':_0x12b6fd['ragErrorMessage'],'updateTime':_0x12b6fd[_0x13bcfb(0x202)]};}function detailPersonalItem(_0xdc07d){const _0x474b93=a32_0x2f7801;return{'id':_0xdc07d['id'],'appCode':_0xdc07d[_0x474b93(0x210)],'scope':_0xdc07d['scope'],'userId':_0xdc07d[_0x474b93(0x204)],'title':_0xdc07d['title'],'content':_0xdc07d[_0x474b93(0x1ff)]??'','version':_0xdc07d['version'],'ragStatus':_0xdc07d[_0x474b93(0x207)],'ragErrorMessage':_0xdc07d[_0x474b93(0x1df)],'createTime':_0xdc07d[_0x474b93(0x1ef)],'updateTime':_0xdc07d[_0x474b93(0x202)]};}function summarizeSearchHit(_0x296282){const _0x280534=a32_0x2f7801;return{'scope':_0x296282['scope'],'title':_0x296282[_0x280534(0x219)],'docId':_0x296282[_0x280534(0x1ee)],'score':_0x296282[_0x280534(0x1f2)],'weightedScore':_0x296282[_0x280534(0x1e3)],'content':_0x296282[_0x280534(0x1ff)],'metadata':_0x296282[_0x280534(0x1f4)]};}function a32_0x5460(_0x538021,_0x48121c){_0x538021=_0x538021-0x1da;const _0x1dfcf3=a32_0x1dfc();let _0x5460be=_0x1dfcf3[_0x538021];return _0x5460be;}function a32_0x1dfc(){const _0x54d8e4=['build','ragStatus','update','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','File\x20path\x20is\x20required.','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','trim','2392aVvqBg','97PCeBtG','1460990KlQvuY','appCode','3166KSmsjT','3742560lNSVXo','Override\x20the\x20existing\x20entry\x20title','num','utf8','body','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','length','title','1275xbKFBx','write','/client/knowledge-base/personal/create','6268dLAjZJ','read','ragErrorMessage','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','query','--topk\x20must\x20be\x20a\x20positive\x20number.','weightedScore','str','Created\x20KB\x20entry\x20','list','topk','Personal\x20knowledge-base\x20entry\x20title','search','string','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','5180090DplCGx','file','docId','createTime','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','version','score','description','metadata','POST','8491laUWcb','Personal\x20knowledge-base\x20entry\x20ID','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','isFile','map','verbose','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','validation','File\x20not\x20found:\x20','content','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','detail','updateTime','isFinite','userId','6741279SDPokI'];a32_0x1dfc=function(){return _0x54d8e4;};return a32_0x1dfc();}function readTopK(_0x50cec4){const _0x13e734=a32_0x2f7801,_0x5bc072=_0x50cec4['flag'](_0x13e734(0x1e7));if(_0x5bc072===undefined||_0x5bc072===null||_0x5bc072==='')return undefined;const _0x26aaa4=_0x50cec4[_0x13e734(0x214)](_0x13e734(0x1e7));if(!Number[_0x13e734(0x203)](_0x26aaa4)||_0x26aaa4<0x1)throw CliErrors[_0x13e734(0x1fd)](_0x13e734(0x1e2));return _0x26aaa4;}const kbList={'service':'kb','command':a32_0x2f7801(0x1e6),'description':a32_0x2f7801(0x1e0),'risk':a32_0x2f7801(0x1de),'flags':[VERBOSE_FLAG],async 'execute'(_0x41577e){const _0x6cac82=a32_0x2f7801,_0x36245a=await listPersonalKnowledgeBaseItems(_0x41577e[_0x6cac82(0x210)]);if(_0x41577e['bool'](_0x6cac82(0x1fb)))return{'ok':!![],'data':{'total':_0x36245a['length'],'items':_0x36245a}};return{'ok':!![],'data':{'total':_0x36245a[_0x6cac82(0x218)],'items':_0x36245a[_0x6cac82(0x1fa)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2f7801(0x201),'description':a32_0x2f7801(0x1eb),'risk':a32_0x2f7801(0x1de),'flags':[{...ID_FLAG,'description':a32_0x2f7801(0x1f7)}],async 'execute'(_0x50e21c){const _0x699cd6=a32_0x2f7801,_0x3c347d=await getPersonalKnowledgeBaseItem(_0x50e21c[_0x699cd6(0x214)]('id'),_0x50e21c[_0x699cd6(0x210)]);return{'ok':!![],'data':detailPersonalItem(_0x3c347d)};}},kbCreate={'service':'kb','command':'create','description':a32_0x2f7801(0x200),'risk':a32_0x2f7801(0x1db),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x310770){const _0xccb884=a32_0x2f7801,_0x4463f6=_0x310770[_0xccb884(0x1e4)](_0xccb884(0x219)),_0x5d7064=readKnowledgeFile(_0x310770[_0xccb884(0x1e4)]('file')),_0x2bcbaf=await createPersonalKnowledgeBaseItem(_0x310770[_0xccb884(0x210)],{'title':_0x4463f6,'content':_0x5d7064});return{'ok':!![],'data':summarizePersonalItem(_0x2bcbaf),'message':_0xccb884(0x1e5)+_0x2bcbaf['id']+'\x20('+_0x2bcbaf['title']+')'};},async 'dryRun'(_0x54ae55){const _0x52dba0=a32_0x2f7801,_0x4be262=_0x54ae55[_0x52dba0(0x1e4)]('title'),_0x25f82f=readKnowledgeFile(_0x54ae55[_0x52dba0(0x1e4)]('file'));return dryRun(_0x52dba0(0x1f5),_0x52dba0(0x1dc))[_0x52dba0(0x216)]({'appCode':_0x54ae55[_0x52dba0(0x210)],'title':_0x4be262,'content':_0x25f82f})[_0x52dba0(0x1f3)](_0x52dba0(0x209)+_0x4be262+'\x22')[_0x52dba0(0x206)]();}},kbUpdate={'service':'kb','command':a32_0x2f7801(0x208),'description':a32_0x2f7801(0x1fc),'risk':a32_0x2f7801(0x1db),'flags':[{...ID_FLAG,'description':a32_0x2f7801(0x1f7)},{...TITLE_FLAG,'required':![],'description':a32_0x2f7801(0x213)},FILE_FLAG],async 'execute'(_0x251e1b){const _0x52ab89=a32_0x2f7801,_0x995581=_0x251e1b[_0x52ab89(0x214)]('id'),_0xc5f70d=readKnowledgeFile(_0x251e1b['str'](_0x52ab89(0x1ed))),_0x3f76c2=_0x251e1b[_0x52ab89(0x1e4)]('title')||(await getPersonalKnowledgeBaseItem(_0x995581,_0x251e1b[_0x52ab89(0x210)]))[_0x52ab89(0x219)],_0x1ba7ab=await updatePersonalKnowledgeBaseItem(_0x995581,_0x251e1b[_0x52ab89(0x210)],{'title':_0x3f76c2,'content':_0xc5f70d});return{'ok':!![],'data':summarizePersonalItem(_0x1ba7ab),'message':'Updated\x20KB\x20entry\x20'+_0x1ba7ab['id']+'\x20('+_0x1ba7ab[_0x52ab89(0x219)]+')'};},async 'dryRun'(_0x27f053){const _0x424700=a32_0x2f7801,_0x2404c2=_0x27f053[_0x424700(0x214)]('id'),_0x503fbb=readKnowledgeFile(_0x27f053[_0x424700(0x1e4)]('file')),_0x5e7b39=_0x27f053['str']('title')||(await getPersonalKnowledgeBaseItem(_0x2404c2,_0x27f053[_0x424700(0x210)]))[_0x424700(0x219)];return dryRun(_0x424700(0x1f5),'/client/knowledge-base/personal/'+_0x2404c2+'/update')[_0x424700(0x216)]({'appCode':_0x27f053['appCode'],'title':_0x5e7b39,'content':_0x503fbb})[_0x424700(0x1f3)](_0x424700(0x217)+_0x2404c2)[_0x424700(0x206)]();}},kbSearch={'service':'kb','command':a32_0x2f7801(0x1e9),'description':a32_0x2f7801(0x1f8),'risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x260a58){const _0x4ba0b5=a32_0x2f7801;if(!_0x260a58[_0x4ba0b5(0x1e4)](_0x4ba0b5(0x1e1))[_0x4ba0b5(0x20c)]())throw CliErrors[_0x4ba0b5(0x1fd)]('Search\x20query\x20is\x20required.');readTopK(_0x260a58);},async 'execute'(_0x53c158){const _0x412c76=a32_0x2f7801,_0x32be7d=_0x53c158[_0x412c76(0x1e4)](_0x412c76(0x1e1))['trim'](),_0x5db1df=readTopK(_0x53c158),_0x3d746f=await searchKnowledgeBase(_0x53c158[_0x412c76(0x210)],{'query':_0x32be7d,'topK':_0x5db1df});return{'ok':!![],'data':{'total':_0x3d746f[_0x412c76(0x218)],'hits':_0x3d746f[_0x412c76(0x1fa)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x6ef6b3=a33_0x2766;function a33_0x17fd(){const _0x24b7ea=['duration','21814430BKeEPH','command','2tLUpGN','View\x20command\x20history\x20logs','\x20logs:\x0a','keys','timestamp','level','2934824SJbnKH','3529026OXyWHj','logs','477MvTUBJ','9776053cTGYrI','1766861sLdVSP','log','Clear\x20command\x20history\x20logs','success','clear','length','write','\x20\x20\x20Duration:\x20','details','193736sHfjTh','4816266OWEfAU','warn','5ayBTPc','\x20\x20\x20Details:\x20','error'];a33_0x17fd=function(){return _0x24b7ea;};return a33_0x17fd();}(function(_0x1d6849,_0x343e04){const _0x5de700=a33_0x2766,_0x2d8cdd=_0x1d6849();while(!![]){try{const _0x1c136e=parseInt(_0x5de700(0x109))/0x1*(parseInt(_0x5de700(0x11b))/0x2)+parseInt(_0x5de700(0x122))/0x3+-parseInt(_0x5de700(0x121))/0x4*(parseInt(_0x5de700(0x115))/0x5)+-parseInt(_0x5de700(0x113))/0x6+-parseInt(_0x5de700(0x125))/0x7+parseInt(_0x5de700(0x112))/0x8*(-parseInt(_0x5de700(0x124))/0x9)+parseInt(_0x5de700(0x119))/0xa;if(_0x1c136e===_0x343e04)break;else _0x2d8cdd['push'](_0x2d8cdd['shift']());}catch(_0x123d6c){_0x2d8cdd['push'](_0x2d8cdd['shift']());}}}(a33_0x17fd,0xddb75));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x1ca581){const _0x2a9412=a33_0x2766;if(_0x1ca581[_0x2a9412(0x10e)]===0x0){console[_0x2a9412(0x10a)]('*\x20No\x20logs\x20found');return;}console['log']('*\x20'+CLI_DISPLAY_NAME+_0x2a9412(0x11d)),_0x1ca581['forEach']((_0x396d9f,_0x415c15)=>{const _0x3cf5d9=_0x2a9412,_0x27b015=new Date(_0x396d9f[_0x3cf5d9(0x11f)])['toLocaleString']('en-US'),_0x36724d=_0x396d9f[_0x3cf5d9(0x120)]===_0x3cf5d9(0x10c)?'√':_0x396d9f[_0x3cf5d9(0x120)]===_0x3cf5d9(0x117)?'×':_0x396d9f[_0x3cf5d9(0x120)]===_0x3cf5d9(0x114)?'!':'i';console['log'](_0x415c15+0x1+'.\x20'+_0x36724d+'\x20['+_0x396d9f[_0x3cf5d9(0x11a)]+']\x20'+_0x396d9f['message']),console[_0x3cf5d9(0x10a)]('\x20\x20\x20Time:\x20'+_0x27b015),_0x396d9f[_0x3cf5d9(0x118)]&&console[_0x3cf5d9(0x10a)](_0x3cf5d9(0x110)+_0x396d9f['duration']+'ms'),_0x396d9f[_0x3cf5d9(0x111)]&&Object[_0x3cf5d9(0x11e)](_0x396d9f['details'])[_0x3cf5d9(0x10e)]>0x0&&console[_0x3cf5d9(0x10a)](_0x3cf5d9(0x116)+JSON['stringify'](_0x396d9f[_0x3cf5d9(0x111)],null,0x2)),console[_0x3cf5d9(0x10a)]('');});}function a33_0x2766(_0x3228ab,_0x51b3c9){_0x3228ab=_0x3228ab-0x109;const _0x17fd98=a33_0x17fd();let _0x27665a=_0x17fd98[_0x3228ab];return _0x27665a;}export const logsDefinitions=[{'service':a33_0x6ef6b3(0x123),'command':'show','description':a33_0x6ef6b3(0x11c),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x516a1e){return printLogs(logger['readLogs']()),{'ok':!![]};}},{'service':'logs','command':a33_0x6ef6b3(0x10d),'description':a33_0x6ef6b3(0x10b),'risk':a33_0x6ef6b3(0x10f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x477ae3){const _0x4de8c2=a33_0x6ef6b3;return logger['clearLogs'](),console[_0x4de8c2(0x10a)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x581540=a34_0x3769;(function(_0x1382db,_0x5057de){const _0x549baa=a34_0x3769,_0x46e621=_0x1382db();while(!![]){try{const _0x42198b=-parseInt(_0x549baa(0x12f))/0x1+parseInt(_0x549baa(0x14f))/0x2*(-parseInt(_0x549baa(0x150))/0x3)+parseInt(_0x549baa(0x136))/0x4+-parseInt(_0x549baa(0x13c))/0x5+parseInt(_0x549baa(0x134))/0x6*(-parseInt(_0x549baa(0x14b))/0x7)+-parseInt(_0x549baa(0x14d))/0x8*(parseInt(_0x549baa(0x147))/0x9)+parseInt(_0x549baa(0x13a))/0xa;if(_0x42198b===_0x5057de)break;else _0x46e621['push'](_0x46e621['shift']());}catch(_0x5b0fca){_0x46e621['push'](_0x46e621['shift']());}}}(a34_0x28df,0x8f324));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=['invoice','general',a34_0x581540(0x14a),a34_0x581540(0x145)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x581540(0x132),'general':a34_0x581540(0x144),'form':a34_0x581540(0x138),'idCard':a34_0x581540(0x133)},SCENE_FLAG={'name':'scene','type':a34_0x581540(0x15d),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x581540(0x146)},IMAGE_FILE_FLAG={'name':'image-file','type':a34_0x581540(0x15d),'description':a34_0x581540(0x15f)},IMAGE_URL_FLAG={'name':'image-url','type':'string','description':a34_0x581540(0x14c)};function normalizeScene(_0x3deed7){const _0x2ebfab=a34_0x581540,_0xb25e99=_0x3deed7[_0x2ebfab(0x143)]()[_0x2ebfab(0x157)]();if(_0xb25e99==='idcard')return'idCard';if(_0xb25e99===_0x2ebfab(0x142)||_0xb25e99===_0x2ebfab(0x15e)||_0xb25e99===_0x2ebfab(0x14a))return _0xb25e99;throw CliErrors[_0x2ebfab(0x159)](_0x2ebfab(0x154)+_0x3deed7+_0x2ebfab(0x15b)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x4c6702){const _0x2b6bad=a34_0x581540,_0x11e683=_0x4c6702[_0x2b6bad(0x151)](_0x2b6bad(0x148))[_0x2b6bad(0x143)](),_0x4cbd0a=_0x4c6702[_0x2b6bad(0x151)](_0x2b6bad(0x140))[_0x2b6bad(0x143)]();return{'imageFile':_0x11e683,'imageUrl':_0x4cbd0a,'count':[_0x11e683,_0x4cbd0a][_0x2b6bad(0x15a)](Boolean)[_0x2b6bad(0x13b)]};}function validateInputSelection(_0x5c0499){const _0x12e388=a34_0x581540,_0x3835a6=selectedInputs(_0x5c0499);if(_0x3835a6[_0x12e388(0x139)]!==0x1)throw CliErrors[_0x12e388(0x159)](_0x12e388(0x130));return _0x3835a6;}function a34_0x3769(_0x228e43,_0x5f429c){_0x228e43=_0x228e43-0x12c;const _0x28df84=a34_0x28df();let _0x376900=_0x28df84[_0x228e43];return _0x376900;}function a34_0x28df(){const _0x370910=['Publicly\x20accessible\x20image\x20or\x20file\x20URL','976AmYXTR','apiError','1332202hlwAJC','3jZBGgt','str','scene','build','Unsupported\x20OCR\x20scene:\x20','fileName','/client/ocr','toLowerCase','<filePath\x20returned\x20by\x20/client/uploadFile>','validation','filter','.\x20Supported\x20scenes:\x20','recognize','string','general','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','/client/uploadFile','appCode','/client/queryFileUrl','File\x20upload\x20response\x20missing\x20filePath.','1061472JAixjb','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','POST','Invoice','IdCard','2486766KWwjWO','fileUrl','4163456RPgSeI','filePath','Table','count','35111630gRApBM','length','1739220YyHOhb','imageUrl','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','imageFile','image-url','description','invoice','trim','General','idCard','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','78282ZCNevi','image-file','body','form','14QXnvIZ'];a34_0x28df=function(){return _0x370910;};return a34_0x28df();}function withScene(_0x100c1f,_0x31c262,_0x340411){const _0xab4370=a34_0x581540;return{..._0x100c1f,'scene':_0x31c262,..._0x340411?{'sourceFile':{'fileName':_0x340411[_0xab4370(0x155)],'filePath':_0x340411[_0xab4370(0x137)]}}:{}};}const ocrRecognize={'service':'ocr','command':a34_0x581540(0x15c),'description':'Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','risk':'write','flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x2aa2b7){const _0x5be6d2=a34_0x581540,_0x501f8c=normalizeScene(_0x2aa2b7[_0x5be6d2(0x151)]('scene')),_0xf0a163=SCENE_TO_LEGACY_TYPE[_0x501f8c],_0x59dd0a=validateInputSelection(_0x2aa2b7);if(_0x59dd0a['imageUrl'])return dryRun('POST',_0x5be6d2(0x156))[_0x5be6d2(0x149)]({'appCode':_0x2aa2b7['appCode'],'url':_0x59dd0a[_0x5be6d2(0x13d)],'type':_0xf0a163})[_0x5be6d2(0x141)]('Preview:\x20recognize\x20'+_0x501f8c+'\x20OCR\x20from\x20URL')['build']();const _0x27a880=requireRuntimeUploadFile(_0x59dd0a[_0x5be6d2(0x13f)],_0x5be6d2(0x148));return dryRun('POST',_0x5be6d2(0x160))['body']({'steps':[{'method':_0x5be6d2(0x131),'url':_0x5be6d2(0x160),'body':{'appCode':_0x2aa2b7[_0x5be6d2(0x12c)],'multipart':{'file':_0x27a880}}},{'method':'POST','url':_0x5be6d2(0x12d),'body':{'filePath':_0x5be6d2(0x158),'downloadFlag':![]}},{'method':_0x5be6d2(0x131),'url':_0x5be6d2(0x156),'body':{'appCode':_0x2aa2b7[_0x5be6d2(0x12c)],'url':_0x5be6d2(0x13e),'type':_0xf0a163}}]})['description']('Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20'+_0x501f8c+'\x20OCR')[_0x5be6d2(0x153)]();},async 'execute'(_0x53c240){const _0x52dbb4=a34_0x581540,_0x236277=normalizeScene(_0x53c240['str'](_0x52dbb4(0x152))),_0x49e0b6=SCENE_TO_LEGACY_TYPE[_0x236277],_0x5a8d43=validateInputSelection(_0x53c240);if(_0x5a8d43[_0x52dbb4(0x13d)]){const _0x148b16=await recognizeRuntimeOcr(_0x53c240[_0x52dbb4(0x12c)],{'url':_0x5a8d43[_0x52dbb4(0x13d)],'type':_0x49e0b6});return{'ok':!![],'data':withScene(_0x148b16,_0x236277)};}const _0xbc71df=requireRuntimeUploadFile(_0x5a8d43[_0x52dbb4(0x13f)],'image-file'),_0x32f5e9=await uploadRuntimeFile(_0x53c240[_0x52dbb4(0x12c)],_0xbc71df['path']);if(!_0x32f5e9['filePath'])throw CliErrors['apiError'](_0x52dbb4(0x12e));const _0x5a3fd2=await queryRuntimeFileUrl(_0x32f5e9[_0x52dbb4(0x137)],{'download':![]});if(!_0x5a3fd2['fileUrl'])throw CliErrors[_0x52dbb4(0x14e)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x382ce8=await recognizeRuntimeOcr(_0x53c240[_0x52dbb4(0x12c)],{'url':_0x5a3fd2[_0x52dbb4(0x135)],'type':_0x49e0b6});return{'ok':!![],'data':withScene(_0x382ce8,_0x236277,_0x32f5e9)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x5a8e40=a35_0x2392;(function(_0x4b6d8c,_0x549f08){const _0x5ac280=a35_0x2392,_0x4c39ae=_0x4b6d8c();while(!![]){try{const _0x127c70=-parseInt(_0x5ac280(0x1e7))/0x1*(parseInt(_0x5ac280(0x209))/0x2)+parseInt(_0x5ac280(0x1ff))/0x3*(parseInt(_0x5ac280(0x1f7))/0x4)+parseInt(_0x5ac280(0x201))/0x5+parseInt(_0x5ac280(0x1d3))/0x6*(parseInt(_0x5ac280(0x1fb))/0x7)+-parseInt(_0x5ac280(0x200))/0x8+parseInt(_0x5ac280(0x1ea))/0x9*(parseInt(_0x5ac280(0x1e8))/0xa)+parseInt(_0x5ac280(0x1fe))/0xb*(parseInt(_0x5ac280(0x207))/0xc);if(_0x127c70===_0x549f08)break;else _0x4c39ae['push'](_0x4c39ae['shift']());}catch(_0x5a11d1){_0x4c39ae['push'](_0x4c39ae['shift']());}}}(a35_0x22ec,0xe1ea2));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_0x5a8e40(0x1d1),'type':a35_0x5a8e40(0x1e0),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x5a8e40(0x1e0),'required':!![],'description':a35_0x5a8e40(0x1dc)},DESCRIPTION_FLAG={'name':a35_0x5a8e40(0x1cc),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x5a8e40(0x1f8),'type':a35_0x5a8e40(0x1e0),'description':a35_0x5a8e40(0x1dd)};function normalizeFunctionName(_0x1c9fd5){const _0x5e5933=a35_0x5a8e40,_0x4c16c2=String(_0x1c9fd5||'')[_0x5e5933(0x1c6)]();if(!_0x4c16c2||!FUNCTION_NAME_PATTERN[_0x5e5933(0x1ed)](_0x4c16c2))throw CliErrors[_0x5e5933(0x204)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x4c16c2;}function a35_0x22ec(){const _0xfae469=['high-risk-write','Update\x20a\x20personal\x20BFF\x20by\x20id','Preview:\x20create\x20personal\x20BFF\x20','exec','detail','658655sKgBpy','60iGPhEj','name','1354734WXNrCQ','verbose','params','test','appCode','personal-bff','write','isArray','map','createUserId','bool','updateTime','createTime','356uvMCer','source-session-id','Personal\x20BFF\x20script\x20ID','version','42fRwWrn','create','read','319xkjWkL','28533vHEPhc','9134792lqVDwO','4392315mbLmGl','functionName','scriptType','validation','Executed\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20file\x20is\x20blank.','22332VnwOlO','File\x20not\x20found:\x20','4kCeENZ','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','trim','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','config','File\x20path\x20is\x20required.','num','isFile','description','scriptContent','--params\x20must\x20be\x20a\x20JSON\x20object.','Created\x20personal\x20BFF\x20','Updated\x20personal\x20BFF\x20','file','gmtModified','702438neAMVx','POST','flag','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','keys','list','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','body','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Optional\x20source\x20RuntimeAgent\x20session\x20id','Preview:\x20update\x20personal\x20BFF\x20','Show\x20one\x20personal\x20BFF\x20by\x20id','string','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'];a35_0x22ec=function(){return _0xfae469;};return a35_0x22ec();}function readScriptFile(_0x39d01f){const _0x4faadd=a35_0x5a8e40;if(!_0x39d01f)throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x1c9));if(!existsSync(_0x39d01f))throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x208)+_0x39d01f);if(!statSync(_0x39d01f)[_0x4faadd(0x1cb)]())throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x1d6)+_0x39d01f);const _0x5e3182=readFileSync(_0x39d01f,'utf8');if(!_0x5e3182[_0x4faadd(0x1c6)]())throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x206));return _0x5e3182;}function optionalTrimmed(_0x2f46ff){const _0x4e3bc9=String(_0x2f46ff||'')['trim']();return _0x4e3bc9||undefined;}function summarizeBff(_0x1cfdce){const _0x4a6494=a35_0x5a8e40;return{'id':_0x1cfdce['id'],'appCode':_0x1cfdce[_0x4a6494(0x1ee)],'functionName':_0x1cfdce['functionName'],'description':_0x1cfdce[_0x4a6494(0x1cc)],'scriptType':_0x1cfdce[_0x4a6494(0x203)],'version':_0x1cfdce[_0x4a6494(0x1fa)],'gmtModified':_0x1cfdce[_0x4a6494(0x1d2)],'updateTime':_0x1cfdce[_0x4a6494(0x1f5)]};}function detailBff(_0x485b28){const _0x696149=a35_0x5a8e40;return{'id':_0x485b28['id'],'appCode':_0x485b28[_0x696149(0x1ee)],'functionName':_0x485b28[_0x696149(0x202)],'description':_0x485b28[_0x696149(0x1cc)],'scriptType':_0x485b28[_0x696149(0x203)],'scriptContent':_0x485b28[_0x696149(0x1cd)]??'','config':_0x485b28[_0x696149(0x1c8)],'version':_0x485b28['version'],'createUserId':_0x485b28[_0x696149(0x1f3)],'gmtCreate':_0x485b28['gmtCreate'],'gmtModified':_0x485b28[_0x696149(0x1d2)],'createTime':_0x485b28[_0x696149(0x1f6)],'updateTime':_0x485b28[_0x696149(0x1f5)]};}function a35_0x2392(_0x2b1944,_0x212ff6){_0x2b1944=_0x2b1944-0x1c5;const _0x22ec30=a35_0x22ec();let _0x2392ce=_0x22ec30[_0x2b1944];return _0x2392ce;}function buildCreateInput(_0x1949d3){const _0x2a5c4e=a35_0x5a8e40;return{'functionName':normalizeFunctionName(_0x1949d3[_0x2a5c4e(0x1d7)]('name')),...optionalTrimmed(_0x1949d3['str'](_0x2a5c4e(0x1cc)))?{'description':optionalTrimmed(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1cc)))}:{},'scriptContent':readScriptFile(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1d1))),...optionalTrimmed(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1f8)))?{'sourceSessionId':optionalTrimmed(_0x1949d3['str'](_0x2a5c4e(0x1f8)))}:{}};}function buildUpdateInput(_0x110df4){const _0x404a4a=a35_0x5a8e40,_0x585c3c={};optionalTrimmed(_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1e9)))&&(_0x585c3c[_0x404a4a(0x202)]=normalizeFunctionName(_0x110df4['str'](_0x404a4a(0x1e9))));_0x110df4[_0x404a4a(0x1d5)](_0x404a4a(0x1cc))!==undefined&&(_0x585c3c[_0x404a4a(0x1cc)]=_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1cc)));optionalTrimmed(_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1d1)))&&(_0x585c3c[_0x404a4a(0x1cd)]=readScriptFile(_0x110df4[_0x404a4a(0x1d7)]('file')));_0x110df4[_0x404a4a(0x1d5)]('source-session-id')!==undefined&&(_0x585c3c['sourceSessionId']=_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1f8)));if(Object[_0x404a4a(0x1d8)](_0x585c3c)['length']===0x0)throw CliErrors[_0x404a4a(0x204)](_0x404a4a(0x1da));return _0x585c3c;}function parseExecParams(_0x5a0560){const _0x3c6e37=a35_0x5a8e40,_0xa6d0f4=parseJsonParams(_0x5a0560)??{};if(Array[_0x3c6e37(0x1f1)](_0xa6d0f4))throw CliErrors[_0x3c6e37(0x204)](_0x3c6e37(0x1ce));return _0xa6d0f4;}const personalBffList={'service':'personal-bff','command':a35_0x5a8e40(0x1d9),'description':a35_0x5a8e40(0x1c7),'risk':a35_0x5a8e40(0x1fd),'flags':[VERBOSE_FLAG],async 'execute'(_0x4fbd36){const _0x10a009=a35_0x5a8e40,_0x314005=await listPersonalBffs(_0x4fbd36[_0x10a009(0x1ee)]);return{'ok':!![],'data':{'total':_0x314005['length'],'items':_0x4fbd36[_0x10a009(0x1f4)](_0x10a009(0x1eb))?_0x314005:_0x314005[_0x10a009(0x1f2)](summarizeBff)}};}},personalBffDetail={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1e6),'description':a35_0x5a8e40(0x1df),'risk':a35_0x5a8e40(0x1fd),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)}],async 'execute'(_0x26b7ba){const _0x89558a=a35_0x5a8e40,_0x47c417=await getPersonalBff(_0x26b7ba[_0x89558a(0x1ca)]('id'),_0x26b7ba[_0x89558a(0x1ee)]);return{'ok':!![],'data':detailBff(_0x47c417)};}},personalBffCreate={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1fc),'description':a35_0x5a8e40(0x1c5),'risk':a35_0x5a8e40(0x1f0),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x390260){const _0x571a4e=a35_0x5a8e40,_0x3ef570=buildCreateInput(_0x390260),_0x46f8ef=await createPersonalBff(_0x390260['appCode'],_0x3ef570);return{'ok':!![],'data':detailBff(_0x46f8ef),'message':_0x571a4e(0x1cf)+_0x46f8ef['id']+(_0x46f8ef[_0x571a4e(0x202)]?'\x20('+_0x46f8ef[_0x571a4e(0x202)]+')':'')};},async 'dryRun'(_0x36ec90){const _0x2c18c8=a35_0x5a8e40,_0xad202e=buildCreateInput(_0x36ec90);return dryRun(_0x2c18c8(0x1d4),'/client/runtime-bff/personal/create')[_0x2c18c8(0x1db)]({'appCode':_0x36ec90[_0x2c18c8(0x1ee)],..._0xad202e})[_0x2c18c8(0x1cc)](_0x2c18c8(0x1e4)+_0xad202e[_0x2c18c8(0x202)])['build']();}},personalBffUpdate={'service':a35_0x5a8e40(0x1ef),'command':'update','description':a35_0x5a8e40(0x1e3),'risk':a35_0x5a8e40(0x1f0),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x38a199){const _0x286ec4=a35_0x5a8e40,_0x20b081=_0x38a199[_0x286ec4(0x1ca)]('id'),_0xa0e562=buildUpdateInput(_0x38a199),_0x56700a=await updatePersonalBff(_0x20b081,_0x38a199[_0x286ec4(0x1ee)],_0xa0e562);return{'ok':!![],'data':detailBff(_0x56700a),'message':_0x286ec4(0x1d0)+_0x56700a['id']+(_0x56700a[_0x286ec4(0x202)]?'\x20('+_0x56700a[_0x286ec4(0x202)]+')':'')};},async 'dryRun'(_0x564687){const _0x714469=a35_0x5a8e40,_0x3528ce=_0x564687['num']('id'),_0x2fda46=buildUpdateInput(_0x564687);return dryRun(_0x714469(0x1d4),'/client/runtime-bff/personal/'+_0x3528ce+'/update')['body']({'appCode':_0x564687['appCode'],..._0x2fda46})[_0x714469(0x1cc)](_0x714469(0x1de)+_0x3528ce)['build']();}},personalBffExec={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1e5),'description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x5a8e40(0x1e2),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)},{...PARAMS_FLAG,'description':a35_0x5a8e40(0x1e1)}],async 'validate'(_0xbc6ca0){const _0x59a362=a35_0x5a8e40;parseExecParams(_0xbc6ca0[_0x59a362(0x1d7)]('params'));},async 'execute'(_0x92d006){const _0xacdd65=a35_0x5a8e40,_0x30d169=_0x92d006[_0xacdd65(0x1ca)]('id'),_0xeb2524=parseExecParams(_0x92d006[_0xacdd65(0x1d7)](_0xacdd65(0x1ec))),_0x31c4db=await executePersonalBff(_0x30d169,_0x92d006[_0xacdd65(0x1ee)],_0xeb2524);return{'ok':!![],'data':{'result':_0x31c4db},'message':_0xacdd65(0x205)+_0x30d169};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x1f63ad=a35_0x5892;(function(_0x259375,_0x248e7e){const _0x171d1e=a35_0x5892,_0x42542e=_0x259375();while(!![]){try{const _0x46cd36=parseInt(_0x171d1e(0xdf))/0x1*(-parseInt(_0x171d1e(0xef))/0x2)+-parseInt(_0x171d1e(0xc6))/0x3*(parseInt(_0x171d1e(0xc7))/0x4)+-parseInt(_0x171d1e(0xf1))/0x5+-parseInt(_0x171d1e(0xd4))/0x6+-parseInt(_0x171d1e(0xc8))/0x7+parseInt(_0x171d1e(0xc5))/0x8+-parseInt(_0x171d1e(0xd1))/0x9*(-parseInt(_0x171d1e(0xd7))/0xa);if(_0x46cd36===_0x248e7e)break;else _0x42542e['push'](_0x42542e['shift']());}catch(_0x362ec2){_0x42542e['push'](_0x42542e['shift']());}}}(a35_0x22ed,0x9f7ab));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x22ed(){const _0x18f7bf=['Optional\x20source\x20RuntimeAgent\x20session\x20id','/client/runtime-bff/personal/','params','Update\x20a\x20personal\x20BFF\x20by\x20id','scriptType','gmtCreate','sourceSessionId','2377638luqXIa','update','verbose','5662362NZQNVy','file','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','110LxfXwf','scriptContent','Executed\x20personal\x20BFF\x20','appCode','version','map','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','7aFbBmD','isFile','functionName','name','trim','File\x20not\x20found:\x20','isArray','updateTime','/client/runtime-bff/personal/create','list','Show\x20one\x20personal\x20BFF\x20by\x20id','POST','read','Personal\x20BFF\x20description','high-risk-write','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','62362bYNTXh','createUserId','880000RfJOFZ','Preview:\x20create\x20personal\x20BFF\x20','Created\x20personal\x20BFF\x20','build','config','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','create','body','bool','utf8','Preview:\x20update\x20personal\x20BFF\x20','test','flag','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','str','Personal\x20BFF\x20script\x20ID','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','validation','gmtModified','write','personal-bff','exec','keys','num','string','source-session-id','6542528QZpTEk','3tbMtdY','2740412sCRLqY','7332458PcQoGk','File\x20path\x20is\x20required.'];a35_0x22ed=function(){return _0x18f7bf;};return a35_0x22ed();}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':'file','type':a35_0x1f63ad(0xc3),'description':a35_0x1f63ad(0xd6)},FUNCTION_NAME_FLAG={'name':a35_0x1f63ad(0xe2),'type':'string','required':!![],'description':a35_0x1f63ad(0xde)},DESCRIPTION_FLAG={'name':a35_0x1f63ad(0xdd),'type':a35_0x1f63ad(0xc3),'description':a35_0x1f63ad(0xec)},SOURCE_SESSION_FLAG={'name':a35_0x1f63ad(0xc4),'type':a35_0x1f63ad(0xc3),'description':a35_0x1f63ad(0xca)};function normalizeFunctionName(_0x3d7e02){const _0x3a4cea=a35_0x1f63ad,_0xba2c04=String(_0x3d7e02||'')[_0x3a4cea(0xe3)]();if(!_0xba2c04||!FUNCTION_NAME_PATTERN[_0x3a4cea(0xfc)](_0xba2c04))throw CliErrors[_0x3a4cea(0xbc)](_0x3a4cea(0xf6));return _0xba2c04;}function readScriptFile(_0x542bfb){const _0x31305e=a35_0x1f63ad;if(!_0x542bfb)throw CliErrors['validation'](_0x31305e(0xc9));if(!existsSync(_0x542bfb))throw CliErrors[_0x31305e(0xbc)](_0x31305e(0xe4)+_0x542bfb);if(!statSync(_0x542bfb)[_0x31305e(0xe0)]())throw CliErrors[_0x31305e(0xbc)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x542bfb);const _0x55c1e9=readFileSync(_0x542bfb,_0x31305e(0xfa));if(!_0x55c1e9[_0x31305e(0xe3)]())throw CliErrors[_0x31305e(0xbc)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x55c1e9;}function optionalTrimmed(_0x4ab6aa){const _0x561dd0=String(_0x4ab6aa||'')['trim']();return _0x561dd0||undefined;}function summarizeBff(_0x52cccf){const _0x5973c2=a35_0x1f63ad;return{'id':_0x52cccf['id'],'appCode':_0x52cccf[_0x5973c2(0xda)],'functionName':_0x52cccf[_0x5973c2(0xe1)],'description':_0x52cccf[_0x5973c2(0xdd)],'scriptType':_0x52cccf[_0x5973c2(0xce)],'version':_0x52cccf[_0x5973c2(0xdb)],'gmtModified':_0x52cccf[_0x5973c2(0xbd)],'updateTime':_0x52cccf[_0x5973c2(0xe6)]};}function detailBff(_0x2a76b4){const _0x3c2260=a35_0x1f63ad;return{'id':_0x2a76b4['id'],'appCode':_0x2a76b4[_0x3c2260(0xda)],'functionName':_0x2a76b4[_0x3c2260(0xe1)],'description':_0x2a76b4[_0x3c2260(0xdd)],'scriptType':_0x2a76b4[_0x3c2260(0xce)],'scriptContent':_0x2a76b4[_0x3c2260(0xd8)]??'','config':_0x2a76b4[_0x3c2260(0xf5)],'version':_0x2a76b4[_0x3c2260(0xdb)],'createUserId':_0x2a76b4[_0x3c2260(0xf0)],'gmtCreate':_0x2a76b4[_0x3c2260(0xcf)],'gmtModified':_0x2a76b4[_0x3c2260(0xbd)],'createTime':_0x2a76b4['createTime'],'updateTime':_0x2a76b4[_0x3c2260(0xe6)]};}function a35_0x5892(_0xa73534,_0x349130){_0xa73534=_0xa73534-0xb9;const _0x22edc8=a35_0x22ed();let _0x5892fb=_0x22edc8[_0xa73534];return _0x5892fb;}function buildCreateInput(_0x18a8d5){const _0x5e2925=a35_0x1f63ad;return{'functionName':normalizeFunctionName(_0x18a8d5[_0x5e2925(0xb9)]('name')),...optionalTrimmed(_0x18a8d5[_0x5e2925(0xb9)](_0x5e2925(0xdd)))?{'description':optionalTrimmed(_0x18a8d5[_0x5e2925(0xb9)](_0x5e2925(0xdd)))}:{},'scriptContent':readScriptFile(_0x18a8d5[_0x5e2925(0xb9)](_0x5e2925(0xd5))),...optionalTrimmed(_0x18a8d5[_0x5e2925(0xb9)](_0x5e2925(0xc4)))?{'sourceSessionId':optionalTrimmed(_0x18a8d5['str'](_0x5e2925(0xc4)))}:{}};}function buildUpdateInput(_0xfdf460){const _0x5b3a6a=a35_0x1f63ad,_0x178262={};optionalTrimmed(_0xfdf460[_0x5b3a6a(0xb9)]('name'))&&(_0x178262[_0x5b3a6a(0xe1)]=normalizeFunctionName(_0xfdf460['str'](_0x5b3a6a(0xe2))));_0xfdf460['flag'](_0x5b3a6a(0xdd))!==undefined&&(_0x178262[_0x5b3a6a(0xdd)]=_0xfdf460['str'](_0x5b3a6a(0xdd)));optionalTrimmed(_0xfdf460[_0x5b3a6a(0xb9)](_0x5b3a6a(0xd5)))&&(_0x178262[_0x5b3a6a(0xd8)]=readScriptFile(_0xfdf460['str'](_0x5b3a6a(0xd5))));_0xfdf460[_0x5b3a6a(0xfd)]('source-session-id')!==undefined&&(_0x178262[_0x5b3a6a(0xd0)]=_0xfdf460[_0x5b3a6a(0xb9)](_0x5b3a6a(0xc4)));if(Object[_0x5b3a6a(0xc1)](_0x178262)['length']===0x0)throw CliErrors[_0x5b3a6a(0xbc)](_0x5b3a6a(0xbb));return _0x178262;}function parseExecParams(_0xea13d2){const _0x218f0d=a35_0x1f63ad,_0x20c058=parseJsonParams(_0xea13d2)??{};if(Array[_0x218f0d(0xe5)](_0x20c058))throw CliErrors[_0x218f0d(0xbc)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x20c058;}const personalBffList={'service':a35_0x1f63ad(0xbf),'command':a35_0x1f63ad(0xe8),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0x1f63ad(0xeb),'flags':[VERBOSE_FLAG],async 'execute'(_0x3e9945){const _0x395f4c=a35_0x1f63ad,_0xa4efb1=await listPersonalBffs(_0x3e9945[_0x395f4c(0xda)]);return{'ok':!![],'data':{'total':_0xa4efb1['length'],'items':_0x3e9945[_0x395f4c(0xf9)](_0x395f4c(0xd3))?_0xa4efb1:_0xa4efb1[_0x395f4c(0xdc)](summarizeBff)}};}},personalBffDetail={'service':a35_0x1f63ad(0xbf),'command':'detail','description':a35_0x1f63ad(0xe9),'risk':'read','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'}],async 'execute'(_0x21fd2a){const _0x46c5ab=a35_0x1f63ad,_0x2edbf6=await getPersonalBff(_0x21fd2a[_0x46c5ab(0xc2)]('id'),_0x21fd2a[_0x46c5ab(0xda)]);return{'ok':!![],'data':detailBff(_0x2edbf6)};}},personalBffCreate={'service':a35_0x1f63ad(0xbf),'command':a35_0x1f63ad(0xf7),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x1f63ad(0xbe),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x257b64){const _0x3076d3=a35_0x1f63ad,_0x74e642=buildCreateInput(_0x257b64),_0x1ca965=await createPersonalBff(_0x257b64['appCode'],_0x74e642);return{'ok':!![],'data':detailBff(_0x1ca965),'message':_0x3076d3(0xf3)+_0x1ca965['id']+(_0x1ca965['functionName']?'\x20('+_0x1ca965[_0x3076d3(0xe1)]+')':'')};},async 'dryRun'(_0x518027){const _0x5bdb1d=a35_0x1f63ad,_0x282c7c=buildCreateInput(_0x518027);return dryRun(_0x5bdb1d(0xea),_0x5bdb1d(0xe7))[_0x5bdb1d(0xf8)]({'appCode':_0x518027['appCode'],..._0x282c7c})['description'](_0x5bdb1d(0xf2)+_0x282c7c[_0x5bdb1d(0xe1)])[_0x5bdb1d(0xf4)]();}},personalBffUpdate={'service':a35_0x1f63ad(0xbf),'command':a35_0x1f63ad(0xd2),'description':a35_0x1f63ad(0xcd),'risk':a35_0x1f63ad(0xbe),'flags':[{...ID_FLAG,'description':a35_0x1f63ad(0xba)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x26f8c9){const _0x25f55c=a35_0x1f63ad,_0x385606=_0x26f8c9[_0x25f55c(0xc2)]('id'),_0x19a8c5=buildUpdateInput(_0x26f8c9),_0x33837e=await updatePersonalBff(_0x385606,_0x26f8c9[_0x25f55c(0xda)],_0x19a8c5);return{'ok':!![],'data':detailBff(_0x33837e),'message':'Updated\x20personal\x20BFF\x20'+_0x33837e['id']+(_0x33837e['functionName']?'\x20('+_0x33837e[_0x25f55c(0xe1)]+')':'')};},async 'dryRun'(_0x47b5b5){const _0x48b530=a35_0x1f63ad,_0xad4344=_0x47b5b5[_0x48b530(0xc2)]('id'),_0xd6b18e=buildUpdateInput(_0x47b5b5);return dryRun(_0x48b530(0xea),_0x48b530(0xcb)+_0xad4344+'/update')[_0x48b530(0xf8)]({'appCode':_0x47b5b5[_0x48b530(0xda)],..._0xd6b18e})[_0x48b530(0xdd)](_0x48b530(0xfb)+_0xad4344)[_0x48b530(0xf4)]();}},personalBffExec={'service':a35_0x1f63ad(0xbf),'command':a35_0x1f63ad(0xc0),'description':a35_0x1f63ad(0xee),'risk':a35_0x1f63ad(0xed),'flags':[{...ID_FLAG,'description':a35_0x1f63ad(0xba)},{...PARAMS_FLAG,'description':a35_0x1f63ad(0xfe)}],async 'validate'(_0x3d102e){const _0x56ef4a=a35_0x1f63ad;parseExecParams(_0x3d102e[_0x56ef4a(0xb9)](_0x56ef4a(0xcc)));},async 'execute'(_0x2cfa24){const _0x12e865=a35_0x1f63ad,_0x1156de=_0x2cfa24[_0x12e865(0xc2)]('id'),_0x1fc9c2=parseExecParams(_0x2cfa24[_0x12e865(0xb9)](_0x12e865(0xcc))),_0x139edc=await executePersonalBff(_0x1156de,_0x2cfa24[_0x12e865(0xda)],_0x1fc9c2);return{'ok':!![],'data':{'result':_0x139edc},'message':_0x12e865(0xd9)+_0x1156de};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x332eec=a36_0x3cae;(function(_0x2c4dba,_0x37aa94){const _0x7b2d7d=a36_0x3cae,_0x176126=_0x2c4dba();while(!![]){try{const _0x27d39d=-parseInt(_0x7b2d7d(0x1ff))/0x1*(-parseInt(_0x7b2d7d(0x1fa))/0x2)+-parseInt(_0x7b2d7d(0x20a))/0x3+-parseInt(_0x7b2d7d(0x1fc))/0x4*(parseInt(_0x7b2d7d(0x20c))/0x5)+parseInt(_0x7b2d7d(0x211))/0x6*(parseInt(_0x7b2d7d(0x1f1))/0x7)+-parseInt(_0x7b2d7d(0x1f3))/0x8+parseInt(_0x7b2d7d(0x1fb))/0x9*(parseInt(_0x7b2d7d(0x215))/0xa)+parseInt(_0x7b2d7d(0x203))/0xb;if(_0x27d39d===_0x37aa94)break;else _0x176126['push'](_0x176126['shift']());}catch(_0x351eb2){_0x176126['push'](_0x176126['shift']());}}}(a36_0x401f,0xcee87));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';function a36_0x3cae(_0x553c0e,_0x2c9f9e){_0x553c0e=_0x553c0e-0x1f1;const _0x401f55=a36_0x401f();let _0x3caea6=_0x401f55[_0x553c0e];return _0x3caea6;}import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];function a36_0x401f(){const _0x3f2286=['Logs','set','Instant\x20API','69562HRmXsp','963pjOFxZ','4xkXgXD','login','read','32ziTUIh','Datasets','risk','map','15067173NgHYNt','values','get','run','Skills','push','defaultCommand','2716485SEDTlD','App\x20Management','4864085opXlks','show','Diagnostics','Knowledge\x20Base','BFF\x20Scripts','45570JdQROB','CLI\x20Built-in\x20Skill','SQL\x20Queries','list','15790PGeuIj','Schema','description','write','from','isSingleCommand','357EPrPZm','command','2505808EESBiQ','install','service','Runtime\x20App\x20Config'];a36_0x401f=function(){return _0x3f2286;};return a36_0x401f();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5365cd){const _0x3d8dd9=a36_0x3cae;for(const _0x5d003a of _0x5365cd){definitions['set'](_0x5d003a['service']+':'+_0x5d003a[_0x3d8dd9(0x1f2)],_0x5d003a);let _0x4f3d79=serviceGroups[_0x3d8dd9(0x205)](_0x5d003a[_0x3d8dd9(0x1f5)]);!_0x4f3d79&&(_0x4f3d79=[],serviceGroups['set'](_0x5d003a['service'],_0x4f3d79)),_0x4f3d79[_0x3d8dd9(0x208)](_0x5d003a);}}function registerService(_0x1f2519,_0x29b605,_0x3c5a39){const _0x38ba72=a36_0x3cae;registerDefinitions(_0x29b605);const _0x571b80=_0x15f783=>_0x15f783===_0x38ba72(0x1fe)?'':_0x15f783===_0x38ba72(0x218)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x588d0c={'service':_0x29b605[0x0][_0x38ba72(0x1f5)],'label':_0x1f2519,'commands':_0x29b605[_0x38ba72(0x202)](_0x3fc9cf=>({'command':_0x3fc9cf[_0x38ba72(0x1f2)],'description':_0x3fc9cf[_0x38ba72(0x217)],'tag':_0x571b80(_0x3fc9cf[_0x38ba72(0x201)])})),'defaultCommand':_0x3c5a39?.[_0x38ba72(0x209)]??(_0x3c5a39?.[_0x38ba72(0x21a)]?_0x29b605[0x0][_0x38ba72(0x1f2)]:undefined),'isSingleCommand':_0x3c5a39?.['isSingleCommand']};serviceRegistry[_0x38ba72(0x208)](_0x588d0c),serviceByName[_0x38ba72(0x1f8)](_0x588d0c[_0x38ba72(0x1f5)],_0x588d0c);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x332eec(0x1fd)}),registerService(a36_0x332eec(0x20b),appDefinitions,{'defaultCommand':a36_0x332eec(0x214)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x332eec(0x1f6),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x332eec(0x214)}),registerService('API\x20Documentation',apiDocDefinitions),registerService(a36_0x332eec(0x200),datasetDefinitions),registerService(a36_0x332eec(0x1f9),dataDefinitions),registerService(a36_0x332eec(0x213),sqlDefinitions),registerService(a36_0x332eec(0x210),bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService('File',fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x332eec(0x20f),kbDefinitions),registerService('Agent\x20Schedules',scheduleDefinitions,{'defaultCommand':a36_0x332eec(0x214)}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x332eec(0x214)}),registerService(a36_0x332eec(0x207),skillDefinitions,{'defaultCommand':a36_0x332eec(0x1f4)}),registerService(a36_0x332eec(0x212),cliSkillDefinitions,{'defaultCommand':a36_0x332eec(0x1f4)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x332eec(0x206),'isSingleCommand':!![]}),registerService(a36_0x332eec(0x20e),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x332eec(0x216),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x332eec(0x1f7),logsDefinitions,{'defaultCommand':a36_0x332eec(0x20d)});export function findDefinition(_0x5f1b91,_0x543833){const _0x2da1cd=a36_0x332eec;return definitions[_0x2da1cd(0x205)](_0x5f1b91+':'+_0x543833);}export function isKnownService(_0xf76d13){return serviceByName['has'](_0xf76d13);}export function getServiceEntry(_0x4c2bf9){const _0x75a7e=a36_0x332eec;return serviceByName[_0x75a7e(0x205)](_0x4c2bf9);}export function getAllDefinitions(){const _0x249fa0=a36_0x332eec;return Array[_0x249fa0(0x219)](definitions[_0x249fa0(0x204)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x457e51=a37_0x2598;function a37_0x47b0(){const _0x214f9f=['isSafeInteger','1098525ZvtVLl','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','num','--title\x20must\x20not\x20be\x20blank.','cursor','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','schedule-id','read','kind','7669386ldZKZD','7222ozIMNH','taskId','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','string','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','940828uowhnU','7157313Cpkfva','str','validation','Schedule\x20UUID','Show\x20one\x20schedule\x20by\x20schedule\x20ID','\x20schedule\x20','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','/run','CRON','high-risk-write','Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','schedule','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','create','body','Schedule\x20kind:\x20CRON\x20or\x20ONCE','7gulgbl','length','DELETE','run','Queued\x20Task\x20','Task\x20channel:\x20auto\x20or\x20premium','scheduled-at','cron','1691144ZyfpWG','ONCE','2653980lqfPrn','/api/harness/apps/','Deleted\x20schedule\x20','124CtMwsY','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','--prompt\x20must\x20not\x20be\x20blank.','appCode','build','scheduleId','limit','POST','description','Preview:\x20delete\x20schedule\x20','\x20immediately','title','validate','UTC','channel','Page\x20size\x20from\x201\x20to\x20100','/schedules','detail','\x20from\x20schedule\x20','prompt','premium','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Schedule\x20input\x20is\x20valid','trim','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','Preview:\x20run\x20schedule\x20','Preview:\x20create\x20an\x20Agent\x20schedule'];a37_0x47b0=function(){return _0x214f9f;};return a37_0x47b0();}function a37_0x2598(_0x174f8f,_0x51d14d){_0x174f8f=_0x174f8f-0x93;const _0x47b056=a37_0x47b0();let _0x25987e=_0x47b056[_0x174f8f];return _0x25987e;}(function(_0x256286,_0x500d71){const _0x131877=a37_0x2598,_0x3b93e1=_0x256286();while(!![]){try{const _0x8f5e5e=-parseInt(_0x131877(0xcd))/0x1*(parseInt(_0x131877(0xa6))/0x2)+-parseInt(_0x131877(0xc2))/0x3+parseInt(_0x131877(0xd2))/0x4+parseInt(_0x131877(0xa3))/0x5+-parseInt(_0x131877(0xcc))/0x6*(-parseInt(_0x131877(0x99))/0x7)+parseInt(_0x131877(0xa1))/0x8+-parseInt(_0x131877(0xd3))/0x9;if(_0x8f5e5e===_0x500d71)break;else _0x3b93e1['push'](_0x3b93e1['shift']());}catch(_0x306807){_0x3b93e1['push'](_0x3b93e1['shift']());}}}(a37_0x47b0,0x9dd1f));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a37_0x457e51(0xcb),'type':a37_0x457e51(0xd0),'required':!![],'enum':[a37_0x457e51(0xdb),'ONCE'],'description':a37_0x457e51(0x98)},CRON_FLAG={'name':'cron','type':a37_0x457e51(0xd0),'description':a37_0x457e51(0xd1)},SCHEDULED_AT_FLAG={'name':a37_0x457e51(0x9f),'type':a37_0x457e51(0xd0),'description':a37_0x457e51(0x95)},TITLE_FLAG={'name':'title','type':a37_0x457e51(0xd0),'required':!![],'description':'Schedule\x20title'},PROMPT_FLAG={'name':a37_0x457e51(0xb9),'type':a37_0x457e51(0xd0),'required':!![],'description':'Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs'},CHANNEL_FLAG={'name':a37_0x457e51(0xb4),'type':a37_0x457e51(0xd0),'enum':['auto',a37_0x457e51(0xba)],'default':a37_0x457e51(0xba),'description':a37_0x457e51(0x9e)},SCHEDULE_ID_FLAG={'name':a37_0x457e51(0xc9),'type':a37_0x457e51(0xd0),'required':!![],'description':a37_0x457e51(0xd6),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a37_0x457e51(0xac),'type':'number','default':0x14,'description':a37_0x457e51(0xb5)},CURSOR_FLAG={'name':a37_0x457e51(0xc6),'type':a37_0x457e51(0xd0),'description':a37_0x457e51(0xcf)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x3b7f1e){const _0x5a7822=a37_0x457e51,_0x3cb41b=_0x3b7f1e[_0x5a7822(0xd4)]('kind'),_0x585ec0=_0x3b7f1e[_0x5a7822(0xd4)](_0x5a7822(0xb1))['trim'](),_0x5ab739=_0x3b7f1e[_0x5a7822(0xd4)](_0x5a7822(0xb9))[_0x5a7822(0xbd)](),_0x529f99=_0x3b7f1e[_0x5a7822(0xd4)]('channel'),_0x32bc28=_0x3b7f1e[_0x5a7822(0xd4)](_0x5a7822(0xa0)),_0x323509=_0x3b7f1e[_0x5a7822(0xd4)](_0x5a7822(0x9f));if(!_0x585ec0)throw CliErrors[_0x5a7822(0xd5)](_0x5a7822(0xc5));if(!_0x5ab739)throw CliErrors[_0x5a7822(0xd5)](_0x5a7822(0xa8));if(_0x3cb41b===_0x5a7822(0xdb)){if(!_0x32bc28||_0x323509)throw CliErrors[_0x5a7822(0xd5)](_0x5a7822(0xa7));return{'kind':_0x3cb41b,'timezone':_0x5a7822(0xb3),'cron':_0x32bc28,'title':_0x585ec0,'prompt':_0x5ab739,'channel':_0x529f99};}if(_0x3cb41b===_0x5a7822(0xa2)){if(!_0x323509||_0x32bc28)throw CliErrors[_0x5a7822(0xd5)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x3cb41b,'timezone':_0x5a7822(0xb3),'scheduledAt':_0x323509,'title':_0x585ec0,'prompt':_0x5ab739,'channel':_0x529f99};}throw CliErrors[_0x5a7822(0xd5)](_0x5a7822(0xc8));}function scheduleCollectionPath(_0x19039c){const _0x2b66c8=a37_0x457e51;return _0x2b66c8(0xa4)+encodeURIComponent(_0x19039c)+_0x2b66c8(0xb6);}function scheduleItemPath(_0x130e9e,_0x247907){return scheduleCollectionPath(_0x130e9e)+'/'+encodeURIComponent(_0x247907);}const scheduleValidate={'service':a37_0x457e51(0x94),'command':a37_0x457e51(0xb2),'description':a37_0x457e51(0xbe),'risk':a37_0x457e51(0xca),'flags':INPUT_FLAGS,async 'validate'(_0x4f1bd4){readScheduleInput(_0x4f1bd4);},async 'execute'(_0x2b16d3){const _0x1e461d=a37_0x457e51,_0x3f0e9f=readScheduleInput(_0x2b16d3),_0x4c6fa6=await validateRuntimeSchedule(_0x2b16d3[_0x1e461d(0xa9)],_0x3f0e9f);return{'ok':!![],'data':_0x4c6fa6,'message':_0x1e461d(0xbc)};}},scheduleCreate={'service':a37_0x457e51(0x94),'command':a37_0x457e51(0x96),'description':a37_0x457e51(0xc7),'risk':a37_0x457e51(0xdc),'flags':INPUT_FLAGS,async 'validate'(_0x165651){readScheduleInput(_0x165651);},async 'execute'(_0x21e7f3){const _0x203f3d=a37_0x457e51,_0x17f505=readScheduleInput(_0x21e7f3),_0x467230=await validateRuntimeSchedule(_0x21e7f3[_0x203f3d(0xa9)],_0x17f505),_0x5599f1=await createRuntimeSchedule(_0x21e7f3[_0x203f3d(0xa9)],_0x467230);return{'ok':!![],'data':_0x5599f1,'message':'Created\x20'+_0x5599f1[_0x203f3d(0xcb)]+_0x203f3d(0xd8)+_0x5599f1[_0x203f3d(0xab)]};},async 'dryRun'(_0x43b7b1){const _0x505779=a37_0x457e51,_0x26ba7f=readScheduleInput(_0x43b7b1);return dryRun('POST',scheduleCollectionPath(_0x43b7b1[_0x505779(0xa9)]))[_0x505779(0x97)](_0x26ba7f)[_0x505779(0xae)](_0x505779(0xc0))[_0x505779(0xaa)]();}},scheduleList={'service':a37_0x457e51(0x94),'command':'list','description':a37_0x457e51(0xd9),'risk':'read','flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x47afc4){const _0x33bcf2=a37_0x457e51,_0x37c6aa=_0x47afc4['num']('limit');if(!Number[_0x33bcf2(0xc1)](_0x37c6aa)||_0x37c6aa<0x1||_0x37c6aa>0x64)throw CliErrors[_0x33bcf2(0xd5)](_0x33bcf2(0xc3));const _0x2f90c2=_0x47afc4['str'](_0x33bcf2(0xc6));if(_0x2f90c2&&(_0x2f90c2[_0x33bcf2(0x9a)]>0x400||_0x2f90c2['trim']()!==_0x2f90c2))throw CliErrors['validation'](_0x33bcf2(0xbb));},async 'execute'(_0x29f113){const _0x3283f6=a37_0x457e51,_0x387267=_0x29f113['str'](_0x3283f6(0xc6)),_0x3e0a1d=await listRuntimeSchedules(_0x29f113[_0x3283f6(0xa9)],{'limit':_0x29f113[_0x3283f6(0xc4)](_0x3283f6(0xac)),..._0x387267?{'cursor':_0x387267}:{}});return{'ok':!![],'data':_0x3e0a1d};}},scheduleDetail={'service':a37_0x457e51(0x94),'command':a37_0x457e51(0xb7),'description':a37_0x457e51(0xd7),'risk':a37_0x457e51(0xca),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x41b715){const _0x36836d=a37_0x457e51,_0x18dd89=await getRuntimeSchedule(_0x41b715[_0x36836d(0xa9)],_0x41b715[_0x36836d(0xd4)](_0x36836d(0xc9)));return{'ok':!![],'data':_0x18dd89};}},scheduleRun={'service':'schedule','command':a37_0x457e51(0x9c),'description':a37_0x457e51(0x93),'risk':a37_0x457e51(0xdc),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1fbd7d){const _0x7b5b11=a37_0x457e51,_0x55accb=_0x1fbd7d['str'](_0x7b5b11(0xc9)),_0x504e8f=await runRuntimeSchedule(_0x1fbd7d['appCode'],_0x55accb);return{'ok':!![],'data':_0x504e8f,'message':_0x7b5b11(0x9d)+_0x504e8f[_0x7b5b11(0xce)]+_0x7b5b11(0xb8)+_0x55accb};},async 'dryRun'(_0x47813){const _0x2dbac5=a37_0x457e51,_0x5840d7=_0x47813['str'](_0x2dbac5(0xc9));return dryRun(_0x2dbac5(0xad),scheduleItemPath(_0x47813['appCode'],_0x5840d7)+_0x2dbac5(0xda))['description'](_0x2dbac5(0xbf)+_0x5840d7+_0x2dbac5(0xb0))[_0x2dbac5(0xaa)]();}},scheduleDelete={'service':a37_0x457e51(0x94),'command':'delete','description':'Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','risk':a37_0x457e51(0xdc),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x590a6a){const _0x1083de=a37_0x457e51,_0x400652=_0x590a6a[_0x1083de(0xd4)](_0x1083de(0xc9)),_0xb8371e=await deleteRuntimeSchedule(_0x590a6a[_0x1083de(0xa9)],_0x400652);return{'ok':!![],'data':_0xb8371e,'message':_0x1083de(0xa5)+_0x400652};},async 'dryRun'(_0x3038fa){const _0x20215d=a37_0x457e51,_0x4a563a=_0x3038fa[_0x20215d(0xd4)](_0x20215d(0xc9));return dryRun(_0x20215d(0x9b),scheduleItemPath(_0x3038fa[_0x20215d(0xa9)],_0x4a563a))[_0x20215d(0xae)](_0x20215d(0xaf)+_0x4a563a)['build']();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x49483c=a38_0x6f18;(function(_0x35a7c6,_0x65b434){const _0x564db1=a38_0x6f18,_0x138abe=_0x35a7c6();while(!![]){try{const _0x51c1da=parseInt(_0x564db1(0x183))/0x1*(parseInt(_0x564db1(0x186))/0x2)+parseInt(_0x564db1(0x188))/0x3*(parseInt(_0x564db1(0x18a))/0x4)+-parseInt(_0x564db1(0x18c))/0x5+-parseInt(_0x564db1(0x181))/0x6+-parseInt(_0x564db1(0x189))/0x7*(parseInt(_0x564db1(0x185))/0x8)+parseInt(_0x564db1(0x184))/0x9*(parseInt(_0x564db1(0x18b))/0xa)+parseInt(_0x564db1(0x182))/0xb;if(_0x51c1da===_0x65b434)break;else _0x138abe['push'](_0x138abe['shift']());}catch(_0x4f9e98){_0x138abe['push'](_0x138abe['shift']());}}}(a38_0x4889,0x5de40));function a38_0x4889(){const _0x4198ce=['1265157SeZtTL','16Bcsrgl','297226qnkPsf','Export\x20machine-readable\x20command\x20schema\x20(JSON)','33MCAVvk','1994587ciCyVG','152068DUgWLR','20MeeETq','3808350tXxGpx','export','3860676JBPBrp','16627908ItVpGq','1mtFeyp'];a38_0x4889=function(){return _0x4198ce;};return a38_0x4889();}import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x6f18(_0x40a673,_0x47ea8b){_0x40a673=_0x40a673-0x180;const _0x488944=a38_0x4889();let _0x6f1878=_0x488944[_0x40a673];return _0x6f1878;}async function execute(_0x1d0d30){const _0x12ed67=await buildSchemaPayload();return{'ok':!![],'data':_0x12ed67};}export const schemaDefinition={'service':'schema','command':a38_0x49483c(0x180),'description':a38_0x49483c(0x187),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|