@lovrabet/lovrabet-cli 2.1.16 → 2.1.18-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/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 -0
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a29_0x5317(){const _0x389219=['appCode','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','serviceCode','arch','repeat','Global','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','8671JQCikU','1299340gnJgrp','✗\x20Invalid\x20JSON','⚠\x20Empty\x20(treated\x20as\x20{})','(set,\x20length=','status','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20Imported\x20from:\x20','\x20\x20runtimeDomain:\x20\x20\x20','padEnd','\x20commands)','path','(removed\x20—\x20cookie\x20auth\x20disabled)','2809940GBYAFc','source','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','locale','platform','38tawPEo','\x20\x20Config\x20JSON','serviceCount','Project','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','verbose','read','missing','doctor','yellow','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20Files','accessKey','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','(missing)','\x20doctor','⚠\x20Empty','log','commandCount','(unnamed)','471840cLvEwo','\x20\x20API\x20Endpoints','version','red','name','1025619GYaSfJ','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','riskLevel','\x20(legacy/compat\x20only)','check','\x20\x20─','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','(none)','\x20\x20Session\x20check:\x20\x20\x20','format','(not\x20found)','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','10395224eBQxvc','2101444TSVpsi','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','green','\x20\x20Auth','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','message','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','bold','\x20\x20Merged\x20Config','(default)','(default:\x20','gray','✓\x20Valid\x20JSON','empty','defaultApp','services','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x5317=function(){return _0x389219;};return a29_0x5317();}function a29_0x1d0f(_0x53f84f,_0x3e58fd){_0x53f84f=_0x53f84f-0x16e;const _0x531706=a29_0x5317();let _0x1d0f35=_0x531706[_0x53f84f];return _0x1d0f35;}const a29_0x24bf91=a29_0x1d0f;(function(_0x25ed18,_0x263ed5){const _0x497b2d=a29_0x1d0f,_0x2b183f=_0x25ed18();while(!![]){try{const _0x28cb7d=-parseInt(_0x497b2d(0x1a7))/0x1*(-parseInt(_0x497b2d(0x1b9))/0x2)+parseInt(_0x497b2d(0x17e))/0x3+parseInt(_0x497b2d(0x18c))/0x4+parseInt(_0x497b2d(0x1a8))/0x5+-parseInt(_0x497b2d(0x179))/0x6+parseInt(_0x497b2d(0x1b4))/0x7+-parseInt(_0x497b2d(0x18b))/0x8;if(_0x28cb7d===_0x263ed5)break;else _0x2b183f['push'](_0x2b183f['shift']());}catch(_0x27daee){_0x2b183f['push'](_0x2b183f['shift']());}}}(a29_0x5317,0x4cf5c));import a29_0x305f66 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x19a866){const _0x2d1bdb=a29_0x1d0f,_0x21936a=getCliVersion(),_0x9aefd3=buildConfigFromFlags({});await initGlobalEnvironment(_0x9aefd3),console[_0x2d1bdb(0x176)](),console[_0x2d1bdb(0x176)](a29_0x305f66['bold'](CLI_BIN_NAME+_0x2d1bdb(0x174))),console[_0x2d1bdb(0x176)](a29_0x305f66['gray']('─'['repeat'](0x32))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x192)+_0x21936a),console['log']('\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x2d1bdb(0x17b)]),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x1a6)+process[_0x2d1bdb(0x1b8)]+'\x20'+process[_0x2d1bdb(0x1a3)]),console[_0x2d1bdb(0x176)](),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x195)](_0x2d1bdb(0x16f))),console['log'](a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x184)['repeat'](0x1e)));const _0x181ae9=getGlobalConfigPath(),_0x9a8424=getProjectConfigPath();console[_0x2d1bdb(0x176)](_0x2d1bdb(0x17f)+(_0x181ae9||a29_0x305f66[_0x2d1bdb(0x199)]('(not\x20found)'))),console['log'](_0x2d1bdb(0x194)+(_0x9a8424||a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x189)))),console[_0x2d1bdb(0x176)](),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x195)](_0x2d1bdb(0x1ba))),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x184)[_0x2d1bdb(0x1a4)](0x1e)));const _0x4a84f9=(_0x2db8fd,_0x429dd7)=>{const _0x46076a=_0x2d1bdb;if(!_0x429dd7){console['log']('\x20\x20'+_0x2db8fd['padEnd'](0x11)+'\x20'+a29_0x305f66[_0x46076a(0x199)]('(no\x20file)'));return;}const _0x21fe3a=inspectCliConfigJsonFile(_0x429dd7);if(_0x21fe3a[_0x46076a(0x1ac)]==='ok')console[_0x46076a(0x176)]('\x20\x20'+_0x2db8fd[_0x46076a(0x1b0)](0x11)+'\x20'+a29_0x305f66['green'](_0x46076a(0x19a)));else{if(_0x21fe3a[_0x46076a(0x1ac)]===_0x46076a(0x19b))console[_0x46076a(0x176)]('\x20\x20'+_0x2db8fd[_0x46076a(0x1b0)](0x11)+'\x20'+a29_0x305f66['yellow'](_0x46076a(0x1aa)));else _0x21fe3a['status']===_0x46076a(0x1c1)?console[_0x46076a(0x176)]('\x20\x20'+_0x2db8fd[_0x46076a(0x1b0)](0x11)+'\x20'+a29_0x305f66[_0x46076a(0x199)](_0x46076a(0x173))):(console['log']('\x20\x20'+_0x2db8fd[_0x46076a(0x1b0)](0x11)+'\x20'+a29_0x305f66[_0x46076a(0x17c)](_0x46076a(0x1a9))),console[_0x46076a(0x176)]('\x20\x20'+''[_0x46076a(0x1b0)](0x11)+'\x20'+a29_0x305f66[_0x46076a(0x17c)](_0x21fe3a[_0x46076a(0x191)])));}};_0x4a84f9(_0x2d1bdb(0x1a5),_0x181ae9),_0x4a84f9(_0x2d1bdb(0x1bc),_0x9a8424),console[_0x2d1bdb(0x176)](),console[_0x2d1bdb(0x176)](a29_0x305f66['bold'](_0x2d1bdb(0x196))),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x199)]('\x20\x20─'[_0x2d1bdb(0x1a4)](0x1e))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x1be)+(_0x9aefd3[_0x2d1bdb(0x1a0)]||a29_0x305f66[_0x2d1bdb(0x17c)]('(not\x20set)'))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x190)+_0x9aefd3['env']);const _0x1614bd=isLegacyCompatConfigKey(_0x2d1bdb(0x1b7))?a29_0x305f66[_0x2d1bdb(0x199)](_0x9aefd3['locale']+_0x2d1bdb(0x182)):_0x9aefd3['locale'];console[_0x2d1bdb(0x176)]('\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x1614bd),console[_0x2d1bdb(0x176)]('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x9aefd3[_0x2d1bdb(0x19c)]||a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x186)))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x172)+(_0x9aefd3['currentApp']||a29_0x305f66['gray'](_0x2d1bdb(0x186)))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x16e)+(_0x9aefd3[_0x2d1bdb(0x188)]||a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x198)+DEFAULT_CONFIG_VALUES[_0x2d1bdb(0x188)]+')'))),console[_0x2d1bdb(0x176)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x9aefd3['pageSize']??a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x197)))),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x19e)+_0x9aefd3[_0x2d1bdb(0x181)]),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x18d)+_0x9aefd3[_0x2d1bdb(0x1bf)]),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x193)+AUTH_MODE['ClientAk']),console['log'](_0x2d1bdb(0x18a)+(_0x9aefd3[_0x2d1bdb(0x170)]?a29_0x305f66[_0x2d1bdb(0x18e)](_0x2d1bdb(0x1ab)+_0x9aefd3[_0x2d1bdb(0x170)]['length']+')'):a29_0x305f66[_0x2d1bdb(0x199)]('(none)'))),console['log'](),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x195)](_0x2d1bdb(0x17a))),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x184)[_0x2d1bdb(0x1a4)](0x1e))),console['log'](_0x2d1bdb(0x185)+getApiDomain()),console['log'](_0x2d1bdb(0x1b6)+getUserDomain()),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x1af)+getRuntimeDomain()),console[_0x2d1bdb(0x176)](),console['log'](a29_0x305f66['bold']('\x20\x20Service\x20Tree')),console['log'](a29_0x305f66['gray'](_0x2d1bdb(0x184)['repeat'](0x1e)));const _0x34ebde=inspectServiceRegistry();console[_0x2d1bdb(0x176)](_0x2d1bdb(0x19f)+_0x34ebde[_0x2d1bdb(0x180)]),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x1a1)+formatServiceRegistryStatus(_0x34ebde)),console[_0x2d1bdb(0x176)](_0x2d1bdb(0x1ad)+_0x34ebde[_0x2d1bdb(0x1bb)]),console['log'](_0x2d1bdb(0x171)+_0x34ebde[_0x2d1bdb(0x177)]);for(const _0x3fbd3f of _0x34ebde[_0x2d1bdb(0x19d)]){console[_0x2d1bdb(0x176)]('\x20\x20'+(_0x3fbd3f[_0x2d1bdb(0x1a2)]+':')[_0x2d1bdb(0x1b0)](0x11)+'\x20'+(_0x3fbd3f[_0x2d1bdb(0x17d)]||a29_0x305f66[_0x2d1bdb(0x199)](_0x2d1bdb(0x178)))+'\x20('+_0x3fbd3f[_0x2d1bdb(0x177)]+_0x2d1bdb(0x1b1)),console[_0x2d1bdb(0x176)]('\x20\x20'+''['padEnd'](0x11)+_0x2d1bdb(0x1ae)+_0x3fbd3f[_0x2d1bdb(0x1b5)][_0x2d1bdb(0x1b2)]);}return console['log'](),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x195)](_0x2d1bdb(0x18f))),console[_0x2d1bdb(0x176)](a29_0x305f66[_0x2d1bdb(0x199)]('\x20\x20─'[_0x2d1bdb(0x1a4)](0x1e))),console['log']('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x305f66[_0x2d1bdb(0x18e)](AUTH_MODE['ClientAk']+'\x20(accessKey)')),console['log'](_0x2d1bdb(0x187)+a29_0x305f66['gray'](_0x2d1bdb(0x1b3))),console['log'](),{'ok':!![]};}function formatServiceRegistryStatus(_0x5c03e7){const _0x154219=a29_0x1d0f;if(_0x5c03e7[_0x154219(0x1ac)]==='ok')return a29_0x305f66[_0x154219(0x18e)]('✓\x20Loaded');if(_0x5c03e7[_0x154219(0x1ac)]===_0x154219(0x1c1))return a29_0x305f66[_0x154219(0x199)]('(not\x20found)');if(_0x5c03e7['status']==='empty')return a29_0x305f66[_0x154219(0x1c3)](_0x154219(0x175));return a29_0x305f66['red']('✗\x20Invalid'+(_0x5c03e7[_0x154219(0x191)]?':\x20'+_0x5c03e7[_0x154219(0x191)]:''));}export const doctorDefinition={'service':a29_0x24bf91(0x1c2),'command':a29_0x24bf91(0x183),'description':a29_0x24bf91(0x1bd),'risk':a29_0x24bf91(0x1c0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x416fcb=a30_0x1862;(function(_0x57fbfc,_0x27e875){const _0x249140=a30_0x1862,_0x5267ed=_0x57fbfc();while(!![]){try{const _0x59bb1c=parseInt(_0x249140(0x133))/0x1*(-parseInt(_0x249140(0x144))/0x2)+parseInt(_0x249140(0x13c))/0x3*(parseInt(_0x249140(0x154))/0x4)+parseInt(_0x249140(0x14f))/0x5*(parseInt(_0x249140(0x149))/0x6)+-parseInt(_0x249140(0x141))/0x7*(parseInt(_0x249140(0x13d))/0x8)+-parseInt(_0x249140(0x155))/0x9+parseInt(_0x249140(0x136))/0xa*(parseInt(_0x249140(0x150))/0xb)+parseInt(_0x249140(0x156))/0xc*(parseInt(_0x249140(0x14d))/0xd);if(_0x59bb1c===_0x27e875)break;else _0x5267ed['push'](_0x5267ed['shift']());}catch(_0x12615a){_0x5267ed['push'](_0x5267ed['shift']());}}}(a30_0x5ce4,0x9ab8c));function a30_0x5ce4(){const _0x4be722=['3531XDYhKv','build','string','1530920tJOynt','upload','download','bool','trim','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','136494eBgYya','635512mPrOau','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Preview:\x20upload\x20','body','49LqtETR','long-term','File','432vRtiei','boolean','file','POST','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','11166ByaoQc','Path\x20to\x20the\x20local\x20file\x20to\x20upload','filePath','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','2378441aMqBlL','/client/uploadFile','3085fvefgC','22MoNwRs','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','\x20to\x20runtime\x20app\x20','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','60ArRhIJ','6599277FEqraM','36piDGEg','filePath\x20is\x20required.','filepath','appCode','write','Uploaded\x20file:\x20','str','path','read'];a30_0x5ce4=function(){return _0x4be722;};return a30_0x5ce4();}import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a30_0x1862(_0x1c55e8,_0x4a5716){_0x1c55e8=_0x1c55e8-0x12e;const _0x5ce483=a30_0x5ce4();let _0x1862b1=_0x5ce483[_0x1c55e8];return _0x1862b1;}const FILE_FLAG={'name':a30_0x416fcb(0x146),'type':'string','required':!![],'description':a30_0x416fcb(0x14a)},FILEPATH_FLAG={'name':a30_0x416fcb(0x158),'type':a30_0x416fcb(0x135),'required':!![],'description':a30_0x416fcb(0x151)},DOWNLOAD_FLAG={'name':'download','type':a30_0x416fcb(0x145),'description':a30_0x416fcb(0x14c)},LONG_TERM_FLAG={'name':a30_0x416fcb(0x142),'type':a30_0x416fcb(0x145),'description':a30_0x416fcb(0x148)};function requireFilePath(_0xa6d5){const _0x332ea8=a30_0x416fcb,_0x37c86b=_0xa6d5[_0x332ea8(0x13a)]();if(!_0x37c86b)throw CliErrors['validation'](_0x332ea8(0x157));return _0x37c86b;}const fileUpload={'service':'file','command':a30_0x416fcb(0x137),'description':a30_0x416fcb(0x13b),'risk':a30_0x416fcb(0x12e),'flags':[FILE_FLAG],async 'dryRun'(_0x1570a2){const _0x42637b=a30_0x416fcb,_0x451f97=requireRuntimeUploadFile(_0x1570a2[_0x42637b(0x130)](_0x42637b(0x146)),_0x42637b(0x143));return dryRun(_0x42637b(0x147),_0x42637b(0x14e))[_0x42637b(0x140)]({'appCode':_0x1570a2[_0x42637b(0x159)],'multipart':{'file':_0x451f97}})['description'](_0x42637b(0x13f)+_0x451f97[_0x42637b(0x131)]+_0x42637b(0x152)+_0x1570a2[_0x42637b(0x159)])[_0x42637b(0x134)]();},async 'execute'(_0x556dc4){const _0x1b50da=a30_0x416fcb,_0x5a2c8e=requireRuntimeUploadFile(_0x556dc4['str'](_0x1b50da(0x146)),'File'),_0x3b1920=await uploadRuntimeFile(_0x556dc4[_0x1b50da(0x159)],_0x5a2c8e['path']);return{'ok':!![],'data':_0x3b1920,'message':_0x3b1920[_0x1b50da(0x14b)]?_0x1b50da(0x12f)+_0x3b1920[_0x1b50da(0x14b)]+_0x1b50da(0x13e):'Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.'};}},fileQueryUrl={'service':a30_0x416fcb(0x146),'command':'query-url','description':a30_0x416fcb(0x153),'risk':a30_0x416fcb(0x132),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3b238b){const _0x4f6483=a30_0x416fcb,_0x30447f=requireFilePath(_0x3b238b['str']('filepath')),_0x55941f=await queryRuntimeFileUrl(_0x30447f,{'download':_0x3b238b[_0x4f6483(0x139)](_0x4f6483(0x138)),'longTerm':_0x3b238b[_0x4f6483(0x139)](_0x4f6483(0x142))});return{'ok':!![],'data':_0x55941f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x3b9ca0=a31_0x2da2;(function(_0xdc86a7,_0x25f6e3){const _0x5ce44b=a31_0x2da2,_0x10d59b=_0xdc86a7();while(!![]){try{const _0x3a16f5=-parseInt(_0x5ce44b(0x8f))/0x1*(parseInt(_0x5ce44b(0x74))/0x2)+parseInt(_0x5ce44b(0x82))/0x3*(-parseInt(_0x5ce44b(0x9e))/0x4)+-parseInt(_0x5ce44b(0x73))/0x5+parseInt(_0x5ce44b(0x72))/0x6*(-parseInt(_0x5ce44b(0x9a))/0x7)+-parseInt(_0x5ce44b(0x78))/0x8+parseInt(_0x5ce44b(0x89))/0x9*(parseInt(_0x5ce44b(0x96))/0xa)+parseInt(_0x5ce44b(0x66))/0xb;if(_0x3a16f5===_0x25f6e3)break;else _0x10d59b['push'](_0x10d59b['shift']());}catch(_0x163eca){_0x10d59b['push'](_0x10d59b['shift']());}}}(a31_0xc1df,0x855d8));import{existsSync,readFileSync}from'node:fs';function a31_0x2da2(_0x1db4cc,_0x2c48bf){_0x1db4cc=_0x1db4cc-0x66;const _0xc1dff6=a31_0xc1df();let _0x2da2d1=_0xc1dff6[_0x1db4cc];return _0x2da2d1;}import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x3b9ca0(0x6c),'type':a31_0x3b9ca0(0x67),'description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x3b9ca0(0x7f),'type':'string','description':a31_0x3b9ca0(0x83)+DEFAULT_CONFIG_VALUES[a31_0x3b9ca0(0x7f)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x3b9ca0(0x94),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x3b9ca0(0xa6)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x3b9ca0(0x87),'type':a31_0x3b9ca0(0x94),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x3b9ca0(0x6a),'type':'string','description':a31_0x3b9ca0(0x99),'required':!![]},{'name':a31_0x3b9ca0(0x6c),'type':a31_0x3b9ca0(0x67),'description':a31_0x3b9ca0(0x80)},{'name':'env','type':a31_0x3b9ca0(0x67),'description':a31_0x3b9ca0(0x84),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x3b9ca0(0x91),'type':a31_0x3b9ca0(0x94),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x3b9ca0(0xa6)]+a31_0x3b9ca0(0x75),'default':![]},{'name':a31_0x3b9ca0(0x87),'type':'boolean','description':a31_0x3b9ca0(0x71),'default':![]}];export async function runInit(_0x4b2f14){const _0x3ea0d9=a31_0x3b9ca0,_0x5936d1=isNonInteractiveMode(_0x4b2f14),_0x16682f=_0x4b2f14['global']?_0x3ea0d9(0x91):_0x3ea0d9(0x98),_0x149ef2=resolveWriteConfigPath(_0x16682f);try{_0x5936d1?await runNonInteractive(_0x4b2f14,_0x149ef2):await runInteractive(_0x4b2f14,_0x149ef2);}catch(_0xf67c3d){if(_0xf67c3d instanceof AbortPrompt)throw CliErrors[_0x3ea0d9(0xa4)]();throw _0xf67c3d;}}export async function runInitImport(_0xb54280){const _0x2e020e=a31_0x3b9ca0,_0x5847ce=_0xb54280[_0x2e020e(0x91)]?_0x2e020e(0x91):_0x2e020e(0x98),_0x385cea=resolveWriteConfigPath(_0x5847ce);await runFromImport(_0xb54280,_0x385cea);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x3b9ca0(0x86)]);async function runFromImport(_0xd6bc1d,_0x5cda40){const _0x32054a=a31_0x3b9ca0,_0x108c43=resolveFilePath(_0xd6bc1d[_0x32054a(0x6a)]);if(!existsSync(_0x108c43))throw CliErrors[_0x32054a(0x6b)]('Source\x20file\x20not\x20found:\x20'+_0x108c43);const _0xa0fdb5=readSourceFile(_0x108c43),_0x28ed3c=convertToRuntimeConfig(_0xa0fdb5);_0xd6bc1d[_0x32054a(0x6c)]&&(_0x28ed3c[_0x32054a(0x6c)]=String(_0xd6bc1d[_0x32054a(0x6c)]));_0xd6bc1d[_0x32054a(0x7f)]&&(_0x28ed3c[_0x32054a(0x7f)]=resolveInitEnv(_0xd6bc1d));if(!_0x28ed3c['appcode'])throw CliErrors[_0x32054a(0x6b)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.');await writeInitConfig(_0x5cda40,_0x28ed3c,_0xd6bc1d),console[_0x32054a(0x77)](_0x32054a(0x7d)+_0x108c43),console[_0x32054a(0x77)](_0x32054a(0xa7)+_0x5cda40),console[_0x32054a(0x77)](_0x32054a(0x9d)+_0x28ed3c['appcode']);if(_0x28ed3c[_0x32054a(0x7a)])console[_0x32054a(0x77)](_0x32054a(0x93)+_0x28ed3c[_0x32054a(0x7a)]);}function convertToRuntimeConfig(_0x18418f){const _0x488b4e=a31_0x3b9ca0;if(_0x18418f['apps']&&typeof _0x18418f['apps']===_0x488b4e(0x88))throw CliErrors[_0x488b4e(0x6b)](_0x488b4e(0x6d),_0x488b4e(0xa3));const _0x1feb0a={};for(const _0x2a3ec9 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x18418f[_0x2a3ec9]!==undefined&&(_0x1feb0a[_0x2a3ec9]=_0x18418f[_0x2a3ec9]);}return!_0x1feb0a[_0x488b4e(0x90)]&&(_0x1feb0a['riskLevel']=DEFAULT_CONFIG_VALUES['riskLevel']),_0x1feb0a;}async function runNonInteractive(_0x21a19c,_0x433ee0){const _0x425d92=a31_0x3b9ca0,_0x8b3efc=_0x21a19c[_0x425d92(0x6c)];if(!_0x8b3efc)throw CliErrors['flagMissing']('appcode',_0x425d92(0x6e)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x39bbf3=resolveInitEnv(_0x21a19c);await writeInitConfig(_0x433ee0,{'appcode':_0x8b3efc,'env':_0x39bbf3},_0x21a19c),console[_0x425d92(0x77)]('Initialized\x20'+_0x433ee0),console[_0x425d92(0x77)](_0x425d92(0x9d)+_0x8b3efc),console[_0x425d92(0x77)](_0x425d92(0xa2)+_0x39bbf3);}async function runInteractive(_0xe19712,_0x1abbdc){const _0x46dd30=a31_0x3b9ca0,_0x3fb9a0=loadExisting(_0x1abbdc),_0x53008e=typeof _0x3fb9a0?.['appcode']===_0x46dd30(0x67)?_0x3fb9a0[_0x46dd30(0x6c)]:'',_0x232b7e=resolveInitEnv(_0xe19712);console[_0x46dd30(0x77)](CLI_BIN_NAME+_0x46dd30(0x76)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x1abbdc)&&!_0xe19712[_0x46dd30(0x87)]){const _0xa353a3=await promptYesNo(_0x46dd30(0x69)+_0x1abbdc+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0xa353a3){console[_0x46dd30(0x77)]('Aborted.');return;}}const _0x19c1a0=typeof _0xe19712[_0x46dd30(0x6c)]===_0x46dd30(0x67)?_0xe19712[_0x46dd30(0x6c)][_0x46dd30(0x9b)]():'';let _0x14881d=_0x19c1a0;!_0x14881d&&(_0x14881d=await promptInput(_0x46dd30(0x8e),_0x53008e));if(!_0x14881d[_0x46dd30(0x9b)]())throw CliErrors[_0x46dd30(0x6b)](_0x46dd30(0x7c));await writeInitConfig(_0x1abbdc,{'appcode':_0x14881d[_0x46dd30(0x9b)](),'env':_0x232b7e},_0xe19712),console[_0x46dd30(0x77)](_0x46dd30(0x9f)+_0x1abbdc),console[_0x46dd30(0x77)](_0x46dd30(0x9d)+_0x14881d[_0x46dd30(0x9b)]()),console[_0x46dd30(0x77)](_0x46dd30(0xa2)+_0x232b7e);}async function writeInitConfig(_0x1bfbb9,_0x243ef2,_0x44cd74){const _0x467c1e=a31_0x3b9ca0;let _0x398e1a={};existsSync(_0x1bfbb9)&&!_0x44cd74[_0x467c1e(0x87)]&&(_0x398e1a=readConfigFile(_0x1bfbb9));for(const [_0x3bf04d,_0xf13952]of Object[_0x467c1e(0x85)](_0x243ef2)){_0xf13952!==undefined&&(_0x398e1a[_0x3bf04d]=_0xf13952);}if(_0x398e1a[_0x467c1e(0x8b)])delete _0x398e1a['app'];writeConfigFile(_0x1bfbb9,_0x398e1a);}class AbortPrompt extends Error{constructor(){const _0x514652=a31_0x3b9ca0;super(_0x514652(0x8c)),this['name']=_0x514652(0x8d);}}function a31_0xc1df(){const _0x7f5d1c=['apiDir','yes','object','4113newuPa','parse','app','User\x20aborted\x20prompt','AbortPrompt','App\x20code','128411CJGGhb','riskLevel','global','cwd','\x20\x20default:\x20','boolean','race','1290DULaXY','stdout','project','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','128723VRNhlL','trim','\x22.\x20Allowed:\x20','\x20\x20appcode:\x20','132Kbxdup','\x0aInitialized\x20','stdin','question','\x20\x20env:\x20\x20\x20\x20\x20','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','cancelled','Failed\x20to\x20parse\x20source\x20file:\x20','newConfigFileName','\x20\x20config:\x20\x20','22712096ocIYhV','string','SIGINT','File\x20','file','validation','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Usage:\x20','join','removeListener','Skip\x20confirmation\x20when\x20overwriting','138wvBqqv','2082050UKLzXC','4Skrbtl',')\x20instead\x20of\x20project','\x20init\x20—\x20Create\x20','log','2104136UfUQHi','toLowerCase','defaultApp','close','App\x20code\x20cannot\x20be\x20empty.','Imported\x20from\x20','once','env','Override\x20imported\x20default\x20appcode','utf8','19839VNVpIu','Target\x20environment\x20(default\x20','Override\x20imported\x20default\x20env','entries'];a31_0xc1df=function(){return _0x7f5d1c;};return a31_0xc1df();}function createSafeRl(){const _0x18f703=a31_0x3b9ca0,_0x3707be=createInterface({'input':process[_0x18f703(0xa0)],'output':process[_0x18f703(0x97)]});let _0x3b4e58;const _0x4bb563=new Promise((_0x357a96,_0x59af6b)=>{const _0x1705c8=_0x18f703;_0x3b4e58=()=>{const _0x2c5323=a31_0x2da2;_0x3b4e58&&(_0x3707be['removeListener'](_0x2c5323(0x68),_0x3b4e58),_0x3b4e58=undefined);try{_0x3707be[_0x2c5323(0x7b)]();}catch{}_0x59af6b(new AbortPrompt());},_0x3707be[_0x1705c8(0x7e)](_0x1705c8(0x68),_0x3b4e58);}),_0x31d384=()=>{const _0x535b95=_0x18f703;_0x3b4e58&&(_0x3707be[_0x535b95(0x70)]('SIGINT',_0x3b4e58),_0x3b4e58=undefined);try{_0x3707be['close']();}catch{}};return{'rl':_0x3707be,'abortPromise':_0x4bb563,'disposeSuccess':_0x31d384};}async function promptInput(_0x1c8b51,_0x5e6f66){const _0x1367ac=a31_0x3b9ca0,{rl:_0x5d59dd,abortPromise:_0x1f04f1,disposeSuccess:_0x3decb9}=createSafeRl(),_0x1f1d6e=new Promise(_0x176d01=>{const _0x3bef71=a31_0x2da2,_0x233893=_0x5e6f66?'\x20\x20'+_0x1c8b51+'\x20('+_0x5e6f66+'):\x20':'\x20\x20'+_0x1c8b51+':\x20';_0x5d59dd[_0x3bef71(0xa1)](_0x233893,_0x111aaa=>{const _0x30c1e3=_0x3bef71;_0x3decb9(),_0x176d01(_0x111aaa[_0x30c1e3(0x9b)]()||_0x5e6f66);});});return Promise[_0x1367ac(0x95)]([_0x1f1d6e,_0x1f04f1]);}async function promptYesNo(_0x25618e,_0xb131ff){const _0x23b9b4=a31_0x3b9ca0,{rl:_0x42f136,abortPromise:_0x55164e,disposeSuccess:_0x28f7a5}=createSafeRl(),_0x439b1c=new Promise(_0x5be9f5=>{const _0x166b68=a31_0x2da2,_0x49b473=_0xb131ff?'[Y/n]':'[y/N]';_0x42f136[_0x166b68(0xa1)]('\x20\x20'+_0x25618e+'\x20'+_0x49b473+':\x20',_0x8730b7=>{const _0x3dde56=_0x166b68;_0x28f7a5();const _0x4e69fa=_0x8730b7[_0x3dde56(0x9b)]()[_0x3dde56(0x79)]();if(_0x4e69fa==='y'||_0x4e69fa===_0x3dde56(0x87))_0x5be9f5(!![]);else{if(_0x4e69fa==='n'||_0x4e69fa==='no')_0x5be9f5(![]);else _0x5be9f5(_0xb131ff);}});});return Promise[_0x23b9b4(0x95)]([_0x439b1c,_0x55164e]);}function loadExisting(_0x5aee35){if(!existsSync(_0x5aee35))return null;return readConfigFile(_0x5aee35);}function resolveFilePath(_0xa314ca){const _0x4e045a=a31_0x3b9ca0;return isAbsolute(_0xa314ca)?_0xa314ca:resolve(process[_0x4e045a(0x92)](),_0xa314ca);}function readSourceFile(_0xa4fa7e){const _0x13ac79=a31_0x3b9ca0;try{const _0x1db252=readFileSync(_0xa4fa7e,{'encoding':_0x13ac79(0x81)});return JSON[_0x13ac79(0x8a)](_0x1db252);}catch(_0xfe7414){throw CliErrors[_0x13ac79(0x6b)](_0x13ac79(0xa5)+_0xfe7414['message']);}}function resolveInitEnv(_0x44c98d){const _0x371324=a31_0x3b9ca0,_0x419620=_0x44c98d[_0x371324(0x7f)];if(_0x419620===undefined||_0x419620==='')return DEFAULT_CONFIG_VALUES[_0x371324(0x7f)];if(!RUNTIME_ENV_VALUES['includes'](_0x419620))throw CliErrors['validation']('Invalid\x20env\x20\x22'+_0x419620+_0x371324(0x9c)+RUNTIME_ENV_VALUES[_0x371324(0x6f)](',\x20'));return _0x419620;}
|
|
1
|
+
const a31_0x5d3b72=a31_0x2ec0;(function(_0x1ab848,_0x3f2060){const _0x521eef=a31_0x2ec0,_0x2319be=_0x1ab848();while(!![]){try{const _0x3c51a0=parseInt(_0x521eef(0x137))/0x1*(parseInt(_0x521eef(0x10f))/0x2)+parseInt(_0x521eef(0x135))/0x3+parseInt(_0x521eef(0x125))/0x4*(-parseInt(_0x521eef(0x11c))/0x5)+parseInt(_0x521eef(0x107))/0x6*(-parseInt(_0x521eef(0x10d))/0x7)+parseInt(_0x521eef(0x104))/0x8*(-parseInt(_0x521eef(0x129))/0x9)+parseInt(_0x521eef(0x133))/0xa*(parseInt(_0x521eef(0x10e))/0xb)+-parseInt(_0x521eef(0x12d))/0xc;if(_0x3c51a0===_0x3f2060)break;else _0x2319be['push'](_0x2319be['shift']());}catch(_0x4421f6){_0x2319be['push'](_0x2319be['shift']());}}}(a31_0x55d6,0xc7355));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x5d3b72(0x114),'description':a31_0x5d3b72(0x110)},{'name':'env','type':a31_0x5d3b72(0x114),'description':a31_0x5d3b72(0x108)+DEFAULT_CONFIG_VALUES[a31_0x5d3b72(0x12e)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5d3b72(0x122),'type':a31_0x5d3b72(0x11a),'description':a31_0x5d3b72(0x12f)+PRODUCT_CONFIG[a31_0x5d3b72(0x134)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':'file','type':a31_0x5d3b72(0x114),'description':a31_0x5d3b72(0xf9),'required':!![]},{'name':a31_0x5d3b72(0x112),'type':'string','description':'Override\x20imported\x20default\x20appcode'},{'name':a31_0x5d3b72(0x12e),'type':'string','description':a31_0x5d3b72(0x120),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5d3b72(0x122),'type':a31_0x5d3b72(0x11a),'description':a31_0x5d3b72(0x12f)+PRODUCT_CONFIG['newConfigFileName']+a31_0x5d3b72(0x123),'default':![]},{'name':'yes','type':a31_0x5d3b72(0x11a),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3cf0cc){const _0x35212f=a31_0x5d3b72,_0x65479c=isNonInteractiveMode(_0x3cf0cc),_0x2d6824=_0x3cf0cc[_0x35212f(0x122)]?_0x35212f(0x122):_0x35212f(0xfa),_0x14376c=resolveWriteConfigPath(_0x2d6824);try{_0x65479c?await runNonInteractive(_0x3cf0cc,_0x14376c):await runInteractive(_0x3cf0cc,_0x14376c);}catch(_0x3f0a27){if(_0x3f0a27 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x3f0a27;}}export async function runInitImport(_0x38dd6e){const _0x1169cd=a31_0x5d3b72,_0x1c1dc1=_0x38dd6e[_0x1169cd(0x122)]?_0x1169cd(0x122):'project',_0x1d6ca7=resolveWriteConfigPath(_0x1c1dc1);await runFromImport(_0x38dd6e,_0x1d6ca7);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x38975e,_0x1a22b9){const _0xc92413=a31_0x5d3b72,_0x10971e=resolveFilePath(_0x38975e['file']);if(!existsSync(_0x10971e))throw CliErrors[_0xc92413(0x106)]('Source\x20file\x20not\x20found:\x20'+_0x10971e);const _0x336cf3=readSourceFile(_0x10971e),_0x525522=convertToRuntimeConfig(_0x336cf3);_0x38975e[_0xc92413(0x112)]&&(_0x525522[_0xc92413(0x112)]=String(_0x38975e[_0xc92413(0x112)]));_0x38975e[_0xc92413(0x12e)]&&(_0x525522['env']=resolveInitEnv(_0x38975e));if(!_0x525522[_0xc92413(0x112)])throw CliErrors[_0xc92413(0x106)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0xc92413(0x103));await writeInitConfig(_0x1a22b9,_0x525522,_0x38975e),console[_0xc92413(0x11d)](_0xc92413(0x12c)+_0x10971e),console[_0xc92413(0x11d)](_0xc92413(0x105)+_0x1a22b9),console[_0xc92413(0x11d)]('\x20\x20appcode:\x20'+_0x525522[_0xc92413(0x112)]);if(_0x525522[_0xc92413(0xff)])console[_0xc92413(0x11d)]('\x20\x20default:\x20'+_0x525522[_0xc92413(0xff)]);}function convertToRuntimeConfig(_0x2b308a){const _0x242130=a31_0x5d3b72;if(_0x2b308a[_0x242130(0x115)]&&typeof _0x2b308a[_0x242130(0x115)]==='object')throw CliErrors[_0x242130(0x106)](_0x242130(0x113),_0x242130(0x101));const _0x43361f={};for(const _0x47473b of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x2b308a[_0x47473b]!==undefined&&(_0x43361f[_0x47473b]=_0x2b308a[_0x47473b]);}return!_0x43361f[_0x242130(0x124)]&&(_0x43361f[_0x242130(0x124)]=DEFAULT_CONFIG_VALUES[_0x242130(0x124)]),_0x43361f;}async function runNonInteractive(_0x44c58c,_0x5a1a2c){const _0x295cf8=a31_0x5d3b72,_0x1b1421=_0x44c58c[_0x295cf8(0x112)];if(!_0x1b1421)throw CliErrors[_0x295cf8(0x111)](_0x295cf8(0x112),'Usage:\x20'+CLI_BIN_NAME+_0x295cf8(0x128));const _0x2800ee=resolveInitEnv(_0x44c58c);await writeInitConfig(_0x5a1a2c,{'appcode':_0x1b1421,'env':_0x2800ee},_0x44c58c),console['log'](_0x295cf8(0x12a)+_0x5a1a2c),console[_0x295cf8(0x11d)]('\x20\x20appcode:\x20'+_0x1b1421),console['log']('\x20\x20env:\x20\x20\x20\x20\x20'+_0x2800ee);}async function runInteractive(_0x379acc,_0x335e13){const _0x2f94eb=a31_0x5d3b72,_0x3c80e5=loadExisting(_0x335e13),_0x142b81=typeof _0x3c80e5?.[_0x2f94eb(0x112)]===_0x2f94eb(0x114)?_0x3c80e5[_0x2f94eb(0x112)]:'',_0x563a2e=resolveInitEnv(_0x379acc);console[_0x2f94eb(0x11d)](CLI_BIN_NAME+_0x2f94eb(0x10a)+PRODUCT_CONFIG['newConfigFileName']+'\x0a');if(existsSync(_0x335e13)&&!_0x379acc[_0x2f94eb(0x126)]){const _0x10c1e7=await promptYesNo(_0x2f94eb(0x11b)+_0x335e13+_0x2f94eb(0x100),![]);if(!_0x10c1e7){console[_0x2f94eb(0x11d)](_0x2f94eb(0x131));return;}}const _0xea4c53=typeof _0x379acc[_0x2f94eb(0x112)]===_0x2f94eb(0x114)?_0x379acc[_0x2f94eb(0x112)][_0x2f94eb(0x116)]():'';let _0x7b9d35=_0xea4c53;!_0x7b9d35&&(_0x7b9d35=await promptInput('App\x20code',_0x142b81));if(!_0x7b9d35[_0x2f94eb(0x116)]())throw CliErrors[_0x2f94eb(0x106)](_0x2f94eb(0x136));await writeInitConfig(_0x335e13,{'appcode':_0x7b9d35[_0x2f94eb(0x116)](),'env':_0x563a2e},_0x379acc),console[_0x2f94eb(0x11d)](_0x2f94eb(0xfb)+_0x335e13),console[_0x2f94eb(0x11d)](_0x2f94eb(0xfc)+_0x7b9d35[_0x2f94eb(0x116)]()),console[_0x2f94eb(0x11d)](_0x2f94eb(0xfe)+_0x563a2e);}async function writeInitConfig(_0x343ed4,_0x2f9bc1,_0x235455){const _0x54e6d9=a31_0x5d3b72;let _0xcd5d1={};existsSync(_0x343ed4)&&!_0x235455[_0x54e6d9(0x126)]&&(_0xcd5d1=readConfigFile(_0x343ed4));for(const [_0x379363,_0x25b1a5]of Object['entries'](_0x2f9bc1)){_0x25b1a5!==undefined&&(_0xcd5d1[_0x379363]=_0x25b1a5);}if(_0xcd5d1['app'])delete _0xcd5d1['app'];writeConfigFile(_0x343ed4,_0xcd5d1);}class AbortPrompt extends Error{constructor(){const _0x513881=a31_0x5d3b72;super(_0x513881(0x12b)),this['name']='AbortPrompt';}}function createSafeRl(){const _0x55e59f=a31_0x5d3b72,_0xb9e758=createInterface({'input':process['stdin'],'output':process[_0x55e59f(0x127)]});let _0x23c22e;const _0x5d9e49=new Promise((_0x3e4418,_0x2d193e)=>{_0x23c22e=()=>{const _0x2c983e=a31_0x2ec0;_0x23c22e&&(_0xb9e758[_0x2c983e(0x109)](_0x2c983e(0x117),_0x23c22e),_0x23c22e=undefined);try{_0xb9e758['close']();}catch{}_0x2d193e(new AbortPrompt());},_0xb9e758['once']('SIGINT',_0x23c22e);}),_0x20d811=()=>{const _0x3eb2e2=_0x55e59f;_0x23c22e&&(_0xb9e758[_0x3eb2e2(0x109)](_0x3eb2e2(0x117),_0x23c22e),_0x23c22e=undefined);try{_0xb9e758[_0x3eb2e2(0x130)]();}catch{}};return{'rl':_0xb9e758,'abortPromise':_0x5d9e49,'disposeSuccess':_0x20d811};}function a31_0x2ec0(_0x29da20,_0x5229d8){_0x29da20=_0x29da20-0xf9;const _0x55d6a9=a31_0x55d6();let _0x2ec023=_0x55d6a9[_0x29da20];return _0x2ec023;}async function promptInput(_0x1c1d99,_0x40b05d){const _0x1fc25f=a31_0x5d3b72,{rl:_0x239050,abortPromise:_0xf12e7c,disposeSuccess:_0x1e4106}=createSafeRl(),_0x5ce7e2=new Promise(_0x493a45=>{const _0x472331=a31_0x2ec0,_0x5837fb=_0x40b05d?'\x20\x20'+_0x1c1d99+'\x20('+_0x40b05d+_0x472331(0x10b):'\x20\x20'+_0x1c1d99+':\x20';_0x239050[_0x472331(0x11f)](_0x5837fb,_0x400b80=>{const _0x1492fa=_0x472331;_0x1e4106(),_0x493a45(_0x400b80[_0x1492fa(0x116)]()||_0x40b05d);});});return Promise[_0x1fc25f(0x102)]([_0x5ce7e2,_0xf12e7c]);}function a31_0x55d6(){const _0x2de0b9=['toLowerCase','boolean','File\x20','4705rMoEsw','log','\x22.\x20Allowed:\x20','question','Override\x20imported\x20default\x20env','Failed\x20to\x20parse\x20source\x20file:\x20','global',')\x20instead\x20of\x20project','riskLevel','1272CKaBRO','yes','stdout','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','36jHLyBT','Initialized\x20','User\x20aborted\x20prompt','Imported\x20from\x20','8151996nOnbGA','env','Write\x20to\x20global\x20(~/','close','Aborted.','utf8','16174370RWAJzv','newConfigFileName','2779026wwAFgW','App\x20code\x20cannot\x20be\x20empty.','593694bYZQPl','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','project','\x0aInitialized\x20','\x20\x20appcode:\x20','[Y/n]','\x20\x20env:\x20\x20\x20\x20\x20','defaultApp','\x20already\x20exists.\x20Overwrite?','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','race','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`.','1309240oBLxHt','\x20\x20config:\x20\x20','validation','4129950QtrYvx','Target\x20environment\x20(default\x20','removeListener','\x20init\x20—\x20Create\x20','):\x20','Invalid\x20env\x20\x22','7ZyAGxF','11PVTCzS','2MbUcXx','App\x20code\x20for\x20the\x20project','flagMissing','appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','string','apps','trim','SIGINT','join'];a31_0x55d6=function(){return _0x2de0b9;};return a31_0x55d6();}async function promptYesNo(_0xb46bbc,_0x159fc3){const {rl:_0x4f4d13,abortPromise:_0x3fa635,disposeSuccess:_0x3a2930}=createSafeRl(),_0x596754=new Promise(_0x239a7c=>{const _0x3d896f=a31_0x2ec0,_0x498995=_0x159fc3?_0x3d896f(0xfd):'[y/N]';_0x4f4d13[_0x3d896f(0x11f)]('\x20\x20'+_0xb46bbc+'\x20'+_0x498995+':\x20',_0x1c14e6=>{const _0x2a394f=_0x3d896f;_0x3a2930();const _0x1d43bb=_0x1c14e6[_0x2a394f(0x116)]()[_0x2a394f(0x119)]();if(_0x1d43bb==='y'||_0x1d43bb===_0x2a394f(0x126))_0x239a7c(!![]);else{if(_0x1d43bb==='n'||_0x1d43bb==='no')_0x239a7c(![]);else _0x239a7c(_0x159fc3);}});});return Promise['race']([_0x596754,_0x3fa635]);}function loadExisting(_0x2254e4){if(!existsSync(_0x2254e4))return null;return readConfigFile(_0x2254e4);}function resolveFilePath(_0x376e01){return isAbsolute(_0x376e01)?_0x376e01:resolve(process['cwd'](),_0x376e01);}function readSourceFile(_0x3baea0){const _0x592b43=a31_0x5d3b72;try{const _0x3d5467=readFileSync(_0x3baea0,{'encoding':_0x592b43(0x132)});return JSON['parse'](_0x3d5467);}catch(_0x22ee9b){throw CliErrors[_0x592b43(0x106)](_0x592b43(0x121)+_0x22ee9b['message']);}}function resolveInitEnv(_0x2da81b){const _0x5b611a=a31_0x5d3b72,_0x1ab5df=_0x2da81b[_0x5b611a(0x12e)];if(_0x1ab5df===undefined||_0x1ab5df==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES['includes'](_0x1ab5df))throw CliErrors[_0x5b611a(0x106)](_0x5b611a(0x10c)+_0x1ab5df+_0x5b611a(0x11e)+RUNTIME_ENV_VALUES[_0x5b611a(0x118)](',\x20'));return _0x1ab5df;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a32_0x5acad2=a32_0x28bc;(function(_0x36ec96,_0x441418){const _0x1c2627=a32_0x28bc,_0xd9be8=_0x36ec96();while(!![]){try{const _0x337609=parseInt(_0x1c2627(0x1a4))/0x1*(parseInt(_0x1c2627(0x1af))/0x2)+parseInt(_0x1c2627(0x1b0))/0x3*(-parseInt(_0x1c2627(0x1cb))/0x4)+parseInt(_0x1c2627(0x1c5))/0x5+parseInt(_0x1c2627(0x1a3))/0x6*(parseInt(_0x1c2627(0x198))/0x7)+-parseInt(_0x1c2627(0x1a7))/0x8+parseInt(_0x1c2627(0x1a6))/0x9+parseInt(_0x1c2627(0x19f))/0xa*(parseInt(_0x1c2627(0x1a8))/0xb);if(_0x337609===_0x441418)break;else _0xd9be8['push'](_0xd9be8['shift']());}catch(_0x32d7fb){_0xd9be8['push'](_0xd9be8['shift']());}}}(a32_0x4e61,0xd2418));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0x4e61(){const _0x266718=['trim','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Personal\x20knowledge-base\x20entry\x20title','ragStatus','body','appCode','Override\x20the\x20existing\x20entry\x20title','list','/client/knowledge-base/personal/create','num','userId','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','/update','detail','title','topk','description','496860nPgGkp','ragErrorMessage','create','content','str','query','4gXLWnN','utf8','validation','Created\x20KB\x20entry\x20','string','scope','isFile','Personal\x20knowledge-base\x20entry\x20ID','build','length','POST','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','read','14CwvbxA','File\x20path\x20is\x20required.','write','file','Updated\x20KB\x20entry\x20','search','verbose','6626220ymIZaV','bool','version','File\x20not\x20found:\x20','2906058LMnGzt','9KCeifS','--topk\x20must\x20be\x20a\x20positive\x20number.','6574149EFrDpT','8402472UhJayE','11JTDeSo','update','/client/knowledge-base/personal/','updateTime','number','isFinite','Search\x20query\x20is\x20required.','246762dSEjVU','4980159Tytomo','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','map','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id'];a32_0x4e61=function(){return _0x266718;};return a32_0x4e61();}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a32_0x28bc(_0x51c1b1,_0x45b265){_0x51c1b1=_0x51c1b1-0x192;const _0x4e61f9=a32_0x4e61();let _0x28bc39=_0x4e61f9[_0x51c1b1];return _0x28bc39;}const TITLE_FLAG={'name':a32_0x5acad2(0x1c2),'type':a32_0x5acad2(0x1cf),'required':!![],'description':a32_0x5acad2(0x1b6)},FILE_FLAG={'name':a32_0x5acad2(0x19b),'type':'string','required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a32_0x5acad2(0x1ca),'type':a32_0x5acad2(0x1cf),'required':!![],'description':a32_0x5acad2(0x1b5)},TOPK_FLAG={'name':a32_0x5acad2(0x1c3),'type':a32_0x5acad2(0x1ac),'description':a32_0x5acad2(0x196)};function readKnowledgeFile(_0x55f4d3){const _0x4f0b6d=a32_0x5acad2;if(!_0x55f4d3)throw CliErrors['validation'](_0x4f0b6d(0x199));if(!existsSync(_0x55f4d3))throw CliErrors[_0x4f0b6d(0x1cd)](_0x4f0b6d(0x1a2)+_0x55f4d3);if(!statSync(_0x55f4d3)[_0x4f0b6d(0x1d1)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x55f4d3);return readFileSync(_0x55f4d3,_0x4f0b6d(0x1cc));}function summarizePersonalItem(_0x59e436){const _0x47a35a=a32_0x5acad2;return{'id':_0x59e436['id'],'title':_0x59e436['title'],'version':_0x59e436[_0x47a35a(0x1a1)],'ragStatus':_0x59e436[_0x47a35a(0x1b7)],'ragErrorMessage':_0x59e436[_0x47a35a(0x1c6)],'updateTime':_0x59e436[_0x47a35a(0x1ab)]};}function detailPersonalItem(_0x4186ab){const _0x49236f=a32_0x5acad2;return{'id':_0x4186ab['id'],'appCode':_0x4186ab['appCode'],'scope':_0x4186ab[_0x49236f(0x1d0)],'userId':_0x4186ab[_0x49236f(0x1be)],'title':_0x4186ab[_0x49236f(0x1c2)],'content':_0x4186ab[_0x49236f(0x1c8)]??'','version':_0x4186ab[_0x49236f(0x1a1)],'ragStatus':_0x4186ab[_0x49236f(0x1b7)],'ragErrorMessage':_0x4186ab['ragErrorMessage'],'createTime':_0x4186ab['createTime'],'updateTime':_0x4186ab[_0x49236f(0x1ab)]};}function summarizeSearchHit(_0x9bae42){const _0xe69246=a32_0x5acad2;return{'scope':_0x9bae42[_0xe69246(0x1d0)],'title':_0x9bae42['title'],'docId':_0x9bae42['docId'],'score':_0x9bae42['score'],'weightedScore':_0x9bae42['weightedScore'],'content':_0x9bae42[_0xe69246(0x1c8)],'metadata':_0x9bae42['metadata']};}function readTopK(_0x487b6e){const _0x53ad68=a32_0x5acad2,_0x2f581e=_0x487b6e['flag'](_0x53ad68(0x1c3));if(_0x2f581e===undefined||_0x2f581e===null||_0x2f581e==='')return undefined;const _0x447475=_0x487b6e[_0x53ad68(0x1bd)](_0x53ad68(0x1c3));if(!Number[_0x53ad68(0x1ad)](_0x447475)||_0x447475<0x1)throw CliErrors[_0x53ad68(0x1cd)](_0x53ad68(0x1a5));return _0x447475;}const kbList={'service':'kb','command':a32_0x5acad2(0x1bb),'description':a32_0x5acad2(0x1bf),'risk':a32_0x5acad2(0x197),'flags':[VERBOSE_FLAG],async 'execute'(_0x549018){const _0x45e46d=a32_0x5acad2,_0x5c5ed8=await listPersonalKnowledgeBaseItems(_0x549018[_0x45e46d(0x1b9)]);if(_0x549018[_0x45e46d(0x1a0)](_0x45e46d(0x19e)))return{'ok':!![],'data':{'total':_0x5c5ed8[_0x45e46d(0x194)],'items':_0x5c5ed8}};return{'ok':!![],'data':{'total':_0x5c5ed8[_0x45e46d(0x194)],'items':_0x5c5ed8[_0x45e46d(0x1b2)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x5acad2(0x1c1),'description':a32_0x5acad2(0x1b3),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x5acad2(0x192)}],async 'execute'(_0x4a7450){const _0x4b3700=a32_0x5acad2,_0x58acc8=await getPersonalKnowledgeBaseItem(_0x4a7450[_0x4b3700(0x1bd)]('id'),_0x4a7450[_0x4b3700(0x1b9)]);return{'ok':!![],'data':detailPersonalItem(_0x58acc8)};}},kbCreate={'service':'kb','command':a32_0x5acad2(0x1c7),'description':'Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','risk':a32_0x5acad2(0x19a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x35868b){const _0x5d1162=a32_0x5acad2,_0x10248e=_0x35868b[_0x5d1162(0x1c9)](_0x5d1162(0x1c2)),_0xfea818=readKnowledgeFile(_0x35868b['str']('file')),_0x39b1ba=await createPersonalKnowledgeBaseItem(_0x35868b[_0x5d1162(0x1b9)],{'title':_0x10248e,'content':_0xfea818});return{'ok':!![],'data':summarizePersonalItem(_0x39b1ba),'message':_0x5d1162(0x1ce)+_0x39b1ba['id']+'\x20('+_0x39b1ba[_0x5d1162(0x1c2)]+')'};},async 'dryRun'(_0x32ea63){const _0x21b965=a32_0x5acad2,_0x4bef1d=_0x32ea63[_0x21b965(0x1c9)](_0x21b965(0x1c2)),_0x3e75c4=readKnowledgeFile(_0x32ea63['str'](_0x21b965(0x19b)));return dryRun(_0x21b965(0x195),_0x21b965(0x1bc))['body']({'appCode':_0x32ea63[_0x21b965(0x1b9)],'title':_0x4bef1d,'content':_0x3e75c4})[_0x21b965(0x1c4)]('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x4bef1d+'\x22')[_0x21b965(0x193)]();}},kbUpdate={'service':'kb','command':a32_0x5acad2(0x1a9),'description':a32_0x5acad2(0x1b1),'risk':a32_0x5acad2(0x19a),'flags':[{...ID_FLAG,'description':a32_0x5acad2(0x192)},{...TITLE_FLAG,'required':![],'description':a32_0x5acad2(0x1ba)},FILE_FLAG],async 'execute'(_0x2d8110){const _0x39601d=a32_0x5acad2,_0x2d601b=_0x2d8110['num']('id'),_0x367e81=readKnowledgeFile(_0x2d8110['str'](_0x39601d(0x19b))),_0x5a5d83=_0x2d8110[_0x39601d(0x1c9)]('title')||(await getPersonalKnowledgeBaseItem(_0x2d601b,_0x2d8110['appCode']))['title'],_0x328108=await updatePersonalKnowledgeBaseItem(_0x2d601b,_0x2d8110['appCode'],{'title':_0x5a5d83,'content':_0x367e81});return{'ok':!![],'data':summarizePersonalItem(_0x328108),'message':_0x39601d(0x19c)+_0x328108['id']+'\x20('+_0x328108[_0x39601d(0x1c2)]+')'};},async 'dryRun'(_0x2fe9d7){const _0x2b2b9e=a32_0x5acad2,_0x571817=_0x2fe9d7['num']('id'),_0x28d368=readKnowledgeFile(_0x2fe9d7['str'](_0x2b2b9e(0x19b))),_0x68c8b7=_0x2fe9d7['str'](_0x2b2b9e(0x1c2))||(await getPersonalKnowledgeBaseItem(_0x571817,_0x2fe9d7[_0x2b2b9e(0x1b9)]))[_0x2b2b9e(0x1c2)];return dryRun(_0x2b2b9e(0x195),_0x2b2b9e(0x1aa)+_0x571817+_0x2b2b9e(0x1c0))[_0x2b2b9e(0x1b8)]({'appCode':_0x2fe9d7[_0x2b2b9e(0x1b9)],'title':_0x68c8b7,'content':_0x28d368})['description']('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x571817)[_0x2b2b9e(0x193)]();}},kbSearch={'service':'kb','command':a32_0x5acad2(0x19d),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':a32_0x5acad2(0x197),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x437136){const _0x36f896=a32_0x5acad2;if(!_0x437136[_0x36f896(0x1c9)](_0x36f896(0x1ca))[_0x36f896(0x1b4)]())throw CliErrors[_0x36f896(0x1cd)](_0x36f896(0x1ae));readTopK(_0x437136);},async 'execute'(_0x463ea8){const _0x9b33cd=a32_0x5acad2,_0x16e045=_0x463ea8[_0x9b33cd(0x1c9)](_0x9b33cd(0x1ca))[_0x9b33cd(0x1b4)](),_0x556181=readTopK(_0x463ea8),_0x19a980=await searchKnowledgeBase(_0x463ea8['appCode'],{'query':_0x16e045,'topK':_0x556181});return{'ok':!![],'data':{'total':_0x19a980[_0x9b33cd(0x194)],'hits':_0x19a980['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x19f903=a33_0x27a3;(function(_0x20d2fb,_0x45d057){const _0x4ddce8=a33_0x27a3,_0x24c973=_0x20d2fb();while(!![]){try{const _0x163179=-parseInt(_0x4ddce8(0x1ac))/0x1*(parseInt(_0x4ddce8(0x1c3))/0x2)+-parseInt(_0x4ddce8(0x1b6))/0x3+parseInt(_0x4ddce8(0x1a3))/0x4+parseInt(_0x4ddce8(0x1a4))/0x5*(-parseInt(_0x4ddce8(0x1c1))/0x6)+parseInt(_0x4ddce8(0x1b2))/0x7*(-parseInt(_0x4ddce8(0x1bb))/0x8)+parseInt(_0x4ddce8(0x1bc))/0x9+parseInt(_0x4ddce8(0x1b3))/0xa*(parseInt(_0x4ddce8(0x1b4))/0xb);if(_0x163179===_0x45d057)break;else _0x24c973['push'](_0x24c973['shift']());}catch(_0x2e39f8){_0x24c973['push'](_0x24c973['shift']());}}}(a33_0x5648,0x9bd02));function a33_0x27a3(_0x8d4e7b,_0x29d6fe){_0x8d4e7b=_0x8d4e7b-0x1a3;const _0x564800=a33_0x5648();let _0x27a364=_0x564800[_0x8d4e7b];return _0x27a364;}function a33_0x5648(){const _0x66288f=['*\x20No\x20logs\x20found','readLogs','level','View\x20command\x20history\x20logs','3064dDYSEO','3156003SwEiPB','show','error','clear','\x20\x20\x20Details:\x20','60FZRovD','duration','224iBNNaS','write','length','timestamp','*\x20Logs\x20cleared','3874404mvxVjz','6410QkOvnm','details','logs','clearLogs','log','message','read','toLocaleString','6331QKxMAH','Clear\x20command\x20history\x20logs','forEach','command','keys','en-US','10801hxnDvV','170JLYFGw','444642azUzNK','warn','166113leXZdo'];a33_0x5648=function(){return _0x66288f;};return a33_0x5648();}import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x94f7ce){const _0x1f9322=a33_0x27a3;if(_0x94f7ce[_0x1f9322(0x1c5)]===0x0){console[_0x1f9322(0x1a8)](_0x1f9322(0x1b7));return;}console[_0x1f9322(0x1a8)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x94f7ce[_0x1f9322(0x1ae)]((_0x2a9558,_0x549a57)=>{const _0x1f4caf=_0x1f9322,_0x474f14=new Date(_0x2a9558[_0x1f4caf(0x1c6)])[_0x1f4caf(0x1ab)](_0x1f4caf(0x1b1)),_0x5e1978=_0x2a9558[_0x1f4caf(0x1b9)]==='success'?'√':_0x2a9558[_0x1f4caf(0x1b9)]===_0x1f4caf(0x1be)?'×':_0x2a9558['level']===_0x1f4caf(0x1b5)?'!':'i';console[_0x1f4caf(0x1a8)](_0x549a57+0x1+'.\x20'+_0x5e1978+'\x20['+_0x2a9558[_0x1f4caf(0x1af)]+']\x20'+_0x2a9558[_0x1f4caf(0x1a9)]),console[_0x1f4caf(0x1a8)]('\x20\x20\x20Time:\x20'+_0x474f14),_0x2a9558[_0x1f4caf(0x1c2)]&&console[_0x1f4caf(0x1a8)]('\x20\x20\x20Duration:\x20'+_0x2a9558[_0x1f4caf(0x1c2)]+'ms'),_0x2a9558[_0x1f4caf(0x1a5)]&&Object[_0x1f4caf(0x1b0)](_0x2a9558['details'])[_0x1f4caf(0x1c5)]>0x0&&console[_0x1f4caf(0x1a8)](_0x1f4caf(0x1c0)+JSON['stringify'](_0x2a9558[_0x1f4caf(0x1a5)],null,0x2)),console['log']('');});}export const logsDefinitions=[{'service':a33_0x19f903(0x1a6),'command':a33_0x19f903(0x1bd),'description':a33_0x19f903(0x1ba),'risk':a33_0x19f903(0x1aa),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x54e556){const _0x3db7bc=a33_0x19f903;return printLogs(logger[_0x3db7bc(0x1b8)]()),{'ok':!![]};}},{'service':'logs','command':a33_0x19f903(0x1bf),'description':a33_0x19f903(0x1ad),'risk':a33_0x19f903(0x1c4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4be2af){const _0x252a46=a33_0x19f903;return logger[_0x252a46(0x1a7)](),console['log'](_0x252a46(0x1c7)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x5e5f50=a34_0x40e5;(function(_0x29ab3d,_0x416db2){const _0x4d7580=a34_0x40e5,_0xad67e3=_0x29ab3d();while(!![]){try{const _0xf99c66=parseInt(_0x4d7580(0x9f))/0x1*(parseInt(_0x4d7580(0xb0))/0x2)+parseInt(_0x4d7580(0xa2))/0x3+parseInt(_0x4d7580(0xb4))/0x4*(-parseInt(_0x4d7580(0xa4))/0x5)+-parseInt(_0x4d7580(0xac))/0x6+-parseInt(_0x4d7580(0x9d))/0x7+parseInt(_0x4d7580(0xb6))/0x8+-parseInt(_0x4d7580(0xab))/0x9;if(_0xf99c66===_0x416db2)break;else _0xad67e3['push'](_0xad67e3['shift']());}catch(_0x4723f6){_0xad67e3['push'](_0xad67e3['shift']());}}}(a34_0x18f9,0x862ec));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x18f9(){const _0x294419=['\x20OCR','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','.\x20Supported\x20scenes:\x20','build','length','general','IdCard','validation','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','body','/client/queryFileUrl','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','trim','/client/uploadFile','join','Preview:\x20recognize\x20','General','Publicly\x20accessible\x20image\x20or\x20file\x20URL','/client/ocr','imageFile','idCard','ocr','write','396186gArgdQ','description','2VRmutA','str','invoice','1406625DUPfEQ','fileUrl','5JBVvNI','count','<filePath\x20returned\x20by\x20/client/uploadFile>','File\x20upload\x20response\x20missing\x20filePath.','Table','toLowerCase','image-file','2568447ExjafF','1124592iNTuBr','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','image-url','Unsupported\x20OCR\x20scene:\x20','503946wsTcGe','POST','scene','filePath','134956xObvLa','string','1119544ccgnFY','imageUrl','appCode','form','apiError'];a34_0x18f9=function(){return _0x294419;};return a34_0x18f9();}import{dryRun}from'../../framework/dryrun.js';function a34_0x40e5(_0x484caa,_0x5829d0){_0x484caa=_0x484caa-0x85;const _0x18f970=a34_0x18f9();let _0x40e558=_0x18f970[_0x484caa];return _0x40e558;}const SUPPORTED_SCENES=[a34_0x5e5f50(0xa1),a34_0x5e5f50(0x8b),a34_0x5e5f50(0xb9),a34_0x5e5f50(0x9a)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a34_0x5e5f50(0x96),'form':a34_0x5e5f50(0xa8),'idCard':a34_0x5e5f50(0x8c)},SCENE_FLAG={'name':'scene','type':a34_0x5e5f50(0xb5),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x5e5f50(0xad)},IMAGE_FILE_FLAG={'name':a34_0x5e5f50(0xaa),'type':'string','description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x5e5f50(0xae),'type':a34_0x5e5f50(0xb5),'description':a34_0x5e5f50(0x97)};function normalizeScene(_0xcebe26){const _0x261ac2=a34_0x5e5f50,_0x500e8a=_0xcebe26[_0x261ac2(0x92)]()[_0x261ac2(0xa9)]();if(_0x500e8a==='idcard')return _0x261ac2(0x9a);if(_0x500e8a===_0x261ac2(0xa1)||_0x500e8a===_0x261ac2(0x8b)||_0x500e8a===_0x261ac2(0xb9))return _0x500e8a;throw CliErrors['validation'](_0x261ac2(0xaf)+_0xcebe26+_0x261ac2(0x88)+SUPPORTED_SCENES[_0x261ac2(0x94)](',\x20'));}function selectedInputs(_0x3f6fbb){const _0x1a53a1=a34_0x5e5f50,_0x2028b2=_0x3f6fbb['str'](_0x1a53a1(0xaa))[_0x1a53a1(0x92)](),_0x4f4cb1=_0x3f6fbb[_0x1a53a1(0xa0)](_0x1a53a1(0xae))['trim']();return{'imageFile':_0x2028b2,'imageUrl':_0x4f4cb1,'count':[_0x2028b2,_0x4f4cb1]['filter'](Boolean)[_0x1a53a1(0x8a)]};}function validateInputSelection(_0x18e296){const _0xc8754c=a34_0x5e5f50,_0x33e57a=selectedInputs(_0x18e296);if(_0x33e57a[_0xc8754c(0xa5)]!==0x1)throw CliErrors[_0xc8754c(0x8d)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x33e57a;}function withScene(_0x527424,_0x1400de,_0x321528){const _0x1a6c41=a34_0x5e5f50;return{..._0x527424,'scene':_0x1400de,..._0x321528?{'sourceFile':{'fileName':_0x321528['fileName'],'filePath':_0x321528[_0x1a6c41(0xb3)]}}:{}};}const ocrRecognize={'service':a34_0x5e5f50(0x9b),'command':'recognize','description':a34_0x5e5f50(0x87),'risk':a34_0x5e5f50(0x9c),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0xf22e89){const _0x4d947a=a34_0x5e5f50,_0x690f38=normalizeScene(_0xf22e89[_0x4d947a(0xa0)](_0x4d947a(0xb2))),_0x4cd127=SCENE_TO_LEGACY_TYPE[_0x690f38],_0x13ffde=validateInputSelection(_0xf22e89);if(_0x13ffde['imageUrl'])return dryRun(_0x4d947a(0xb1),'/client/ocr')[_0x4d947a(0x8f)]({'appCode':_0xf22e89[_0x4d947a(0xb8)],'url':_0x13ffde[_0x4d947a(0xb7)],'type':_0x4cd127})[_0x4d947a(0x9e)](_0x4d947a(0x95)+_0x690f38+'\x20OCR\x20from\x20URL')[_0x4d947a(0x89)]();const _0x207ed1=requireRuntimeUploadFile(_0x13ffde[_0x4d947a(0x99)],'image-file');return dryRun('POST',_0x4d947a(0x93))[_0x4d947a(0x8f)]({'steps':[{'method':_0x4d947a(0xb1),'url':'/client/uploadFile','body':{'appCode':_0xf22e89[_0x4d947a(0xb8)],'multipart':{'file':_0x207ed1}}},{'method':_0x4d947a(0xb1),'url':_0x4d947a(0x90),'body':{'filePath':_0x4d947a(0xa6),'downloadFlag':![]}},{'method':_0x4d947a(0xb1),'url':_0x4d947a(0x98),'body':{'appCode':_0xf22e89[_0x4d947a(0xb8)],'url':_0x4d947a(0x91),'type':_0x4cd127}}]})[_0x4d947a(0x9e)](_0x4d947a(0x8e)+_0x690f38+_0x4d947a(0x86))[_0x4d947a(0x89)]();},async 'execute'(_0x22814b){const _0x208f7e=a34_0x5e5f50,_0x45fc8f=normalizeScene(_0x22814b[_0x208f7e(0xa0)](_0x208f7e(0xb2))),_0x5679f3=SCENE_TO_LEGACY_TYPE[_0x45fc8f],_0x4d2599=validateInputSelection(_0x22814b);if(_0x4d2599[_0x208f7e(0xb7)]){const _0xa4d082=await recognizeRuntimeOcr(_0x22814b[_0x208f7e(0xb8)],{'url':_0x4d2599[_0x208f7e(0xb7)],'type':_0x5679f3});return{'ok':!![],'data':withScene(_0xa4d082,_0x45fc8f)};}const _0x44ff0c=requireRuntimeUploadFile(_0x4d2599[_0x208f7e(0x99)],_0x208f7e(0xaa)),_0x3797cb=await uploadRuntimeFile(_0x22814b[_0x208f7e(0xb8)],_0x44ff0c['path']);if(!_0x3797cb[_0x208f7e(0xb3)])throw CliErrors[_0x208f7e(0x85)](_0x208f7e(0xa7));const _0x175465=await queryRuntimeFileUrl(_0x3797cb['filePath'],{'download':![]});if(!_0x175465[_0x208f7e(0xa3)])throw CliErrors[_0x208f7e(0x85)]('File\x20URL\x20response\x20missing\x20fileUrl.');const _0x4ee64a=await recognizeRuntimeOcr(_0x22814b[_0x208f7e(0xb8)],{'url':_0x175465[_0x208f7e(0xa3)],'type':_0x5679f3});return{'ok':!![],'data':withScene(_0x4ee64a,_0x45fc8f,_0x3797cb)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x2948b1=a35_0x1272;(function(_0x11a5c8,_0x1bf0b2){const _0xb12ee=a35_0x1272,_0x29a4f9=_0x11a5c8();while(!![]){try{const _0x1e7520=-parseInt(_0xb12ee(0xc0))/0x1*(parseInt(_0xb12ee(0xac))/0x2)+-parseInt(_0xb12ee(0xb2))/0x3*(-parseInt(_0xb12ee(0xc3))/0x4)+parseInt(_0xb12ee(0xc9))/0x5*(parseInt(_0xb12ee(0x99))/0x6)+-parseInt(_0xb12ee(0x95))/0x7+-parseInt(_0xb12ee(0xc1))/0x8*(-parseInt(_0xb12ee(0xa9))/0x9)+-parseInt(_0xb12ee(0xa7))/0xa+parseInt(_0xb12ee(0xa8))/0xb*(-parseInt(_0xb12ee(0x96))/0xc);if(_0x1e7520===_0x1bf0b2)break;else _0x29a4f9['push'](_0x29a4f9['shift']());}catch(_0x362a25){_0x29a4f9['push'](_0x29a4f9['shift']());}}}(a35_0x18af,0x35ae7));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x2948b1(0xd4),'type':a35_0x2948b1(0xd7),'description':a35_0x2948b1(0xd5)},FUNCTION_NAME_FLAG={'name':a35_0x2948b1(0xa0),'type':a35_0x2948b1(0xd7),'required':!![],'description':a35_0x2948b1(0xcc)},DESCRIPTION_FLAG={'name':a35_0x2948b1(0xcb),'type':'string','description':a35_0x2948b1(0xaa)},SOURCE_SESSION_FLAG={'name':a35_0x2948b1(0xaf),'type':'string','description':a35_0x2948b1(0x9c)};function normalizeFunctionName(_0x29a2bf){const _0x8fb16c=a35_0x2948b1,_0x259327=String(_0x29a2bf||'')['trim']();if(!_0x259327||!FUNCTION_NAME_PATTERN[_0x8fb16c(0xb5)](_0x259327))throw CliErrors['validation'](_0x8fb16c(0xa1));return _0x259327;}function a35_0x18af(){const _0x47fb31=['POST','57gWcxMf','1353736lvpVxp','read','4972zLVHqD','Preview:\x20update\x20personal\x20BFF\x20','/update','scriptContent','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','high-risk-write','35XPXaNj','bool','description','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','flag','list','/client/runtime-bff/personal/create','File\x20is\x20not\x20a\x20regular\x20file:\x20','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','personal-bff','keys','file','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','version','string','str','build','gmtModified','Preview:\x20create\x20personal\x20BFF\x20','243691WUUjbR','804zIsdNb','updateTime','scriptType','149712MdMfKT','File\x20not\x20found:\x20','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Optional\x20source\x20RuntimeAgent\x20session\x20id','appCode','trim','params','name','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','exec','map','write','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20ID','1326090NcqMKp','22517nYQaUs','9AUQuSJ','Personal\x20BFF\x20description','Created\x20personal\x20BFF\x20','9060AqIIoc','create','verbose','source-session-id','Show\x20one\x20personal\x20BFF\x20by\x20id','Executed\x20personal\x20BFF\x20','1059QzwSVc','validation','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','test','isArray','Update\x20a\x20personal\x20BFF\x20by\x20id','length','num','createTime','gmtCreate','detail','utf8','functionName'];a35_0x18af=function(){return _0x47fb31;};return a35_0x18af();}function readScriptFile(_0x1e4fe2){const _0x3ebd76=a35_0x2948b1;if(!_0x1e4fe2)throw CliErrors['validation']('File\x20path\x20is\x20required.');if(!existsSync(_0x1e4fe2))throw CliErrors[_0x3ebd76(0xb3)](_0x3ebd76(0x9a)+_0x1e4fe2);if(!statSync(_0x1e4fe2)['isFile']())throw CliErrors[_0x3ebd76(0xb3)](_0x3ebd76(0xd0)+_0x1e4fe2);const _0x5166ac=readFileSync(_0x1e4fe2,_0x3ebd76(0xbd));if(!_0x5166ac['trim']())throw CliErrors[_0x3ebd76(0xb3)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x5166ac;}function optionalTrimmed(_0x4cd7e3){const _0x436bc3=a35_0x2948b1,_0x3a4069=String(_0x4cd7e3||'')[_0x436bc3(0x9e)]();return _0x3a4069||undefined;}function summarizeBff(_0x1a2c30){const _0x23e485=a35_0x2948b1;return{'id':_0x1a2c30['id'],'appCode':_0x1a2c30[_0x23e485(0x9d)],'functionName':_0x1a2c30[_0x23e485(0xbe)],'description':_0x1a2c30[_0x23e485(0xcb)],'scriptType':_0x1a2c30[_0x23e485(0x98)],'version':_0x1a2c30[_0x23e485(0xd6)],'gmtModified':_0x1a2c30[_0x23e485(0xda)],'updateTime':_0x1a2c30[_0x23e485(0x97)]};}function detailBff(_0x18ad2e){const _0x176cee=a35_0x2948b1;return{'id':_0x18ad2e['id'],'appCode':_0x18ad2e[_0x176cee(0x9d)],'functionName':_0x18ad2e[_0x176cee(0xbe)],'description':_0x18ad2e['description'],'scriptType':_0x18ad2e[_0x176cee(0x98)],'scriptContent':_0x18ad2e[_0x176cee(0xc6)]??'','config':_0x18ad2e['config'],'version':_0x18ad2e['version'],'createUserId':_0x18ad2e['createUserId'],'gmtCreate':_0x18ad2e[_0x176cee(0xbb)],'gmtModified':_0x18ad2e[_0x176cee(0xda)],'createTime':_0x18ad2e[_0x176cee(0xba)],'updateTime':_0x18ad2e['updateTime']};}function buildCreateInput(_0x2b5c6d){const _0x46adda=a35_0x2948b1;return{'functionName':normalizeFunctionName(_0x2b5c6d[_0x46adda(0xd8)]('name')),...optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xcb)))?{'description':optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xcb)))}:{},'scriptContent':readScriptFile(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xd4))),...optionalTrimmed(_0x2b5c6d[_0x46adda(0xd8)](_0x46adda(0xaf)))?{'sourceSessionId':optionalTrimmed(_0x2b5c6d['str'](_0x46adda(0xaf)))}:{}};}function buildUpdateInput(_0x297a10){const _0x3ec440=a35_0x2948b1,_0x1b8edd={};optionalTrimmed(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xa0)))&&(_0x1b8edd['functionName']=normalizeFunctionName(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xa0))));_0x297a10[_0x3ec440(0xcd)]('description')!==undefined&&(_0x1b8edd[_0x3ec440(0xcb)]=_0x297a10[_0x3ec440(0xd8)]('description'));optionalTrimmed(_0x297a10['str']('file'))&&(_0x1b8edd[_0x3ec440(0xc6)]=readScriptFile(_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xd4))));_0x297a10[_0x3ec440(0xcd)](_0x3ec440(0xaf))!==undefined&&(_0x1b8edd['sourceSessionId']=_0x297a10[_0x3ec440(0xd8)](_0x3ec440(0xaf)));if(Object[_0x3ec440(0xd3)](_0x1b8edd)['length']===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x1b8edd;}function a35_0x1272(_0x235d6b,_0x455c43){_0x235d6b=_0x235d6b-0x95;const _0x18af9e=a35_0x18af();let _0x1272da=_0x18af9e[_0x235d6b];return _0x1272da;}function parseExecParams(_0x52f11f){const _0xa4d615=a35_0x2948b1,_0x32c92f=parseJsonParams(_0x52f11f)??{};if(Array[_0xa4d615(0xb6)](_0x32c92f))throw CliErrors[_0xa4d615(0xb3)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x32c92f;}const personalBffList={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xce),'description':a35_0x2948b1(0xd1),'risk':a35_0x2948b1(0xc2),'flags':[VERBOSE_FLAG],async 'execute'(_0x407224){const _0x2fdf1d=a35_0x2948b1,_0x3c559d=await listPersonalBffs(_0x407224[_0x2fdf1d(0x9d)]);return{'ok':!![],'data':{'total':_0x3c559d[_0x2fdf1d(0xb8)],'items':_0x407224[_0x2fdf1d(0xca)](_0x2fdf1d(0xae))?_0x3c559d:_0x3c559d[_0x2fdf1d(0xa3)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x2948b1(0xbc),'description':a35_0x2948b1(0xb0),'risk':a35_0x2948b1(0xc2),'flags':[{...ID_FLAG,'description':a35_0x2948b1(0xa6)}],async 'execute'(_0x12c26c){const _0x391710=a35_0x2948b1,_0x226dfb=await getPersonalBff(_0x12c26c[_0x391710(0xb9)]('id'),_0x12c26c['appCode']);return{'ok':!![],'data':detailBff(_0x226dfb)};}},personalBffCreate={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xad),'description':a35_0x2948b1(0x9b),'risk':a35_0x2948b1(0xa4),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x512468){const _0x4320cd=a35_0x2948b1,_0x57b226=buildCreateInput(_0x512468),_0x3ee774=await createPersonalBff(_0x512468[_0x4320cd(0x9d)],_0x57b226);return{'ok':!![],'data':detailBff(_0x3ee774),'message':_0x4320cd(0xab)+_0x3ee774['id']+(_0x3ee774['functionName']?'\x20('+_0x3ee774[_0x4320cd(0xbe)]+')':'')};},async 'dryRun'(_0x572f9a){const _0x5c90a7=a35_0x2948b1,_0x5489c1=buildCreateInput(_0x572f9a);return dryRun(_0x5c90a7(0xbf),_0x5c90a7(0xcf))['body']({'appCode':_0x572f9a[_0x5c90a7(0x9d)],..._0x5489c1})[_0x5c90a7(0xcb)](_0x5c90a7(0xdb)+_0x5489c1[_0x5c90a7(0xbe)])[_0x5c90a7(0xd9)]();}},personalBffUpdate={'service':a35_0x2948b1(0xd2),'command':'update','description':a35_0x2948b1(0xb7),'risk':a35_0x2948b1(0xa4),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5c619a){const _0x58cdeb=a35_0x2948b1,_0x3fca5e=_0x5c619a[_0x58cdeb(0xb9)]('id'),_0x16f65d=buildUpdateInput(_0x5c619a),_0x17da71=await updatePersonalBff(_0x3fca5e,_0x5c619a[_0x58cdeb(0x9d)],_0x16f65d);return{'ok':!![],'data':detailBff(_0x17da71),'message':_0x58cdeb(0xa5)+_0x17da71['id']+(_0x17da71[_0x58cdeb(0xbe)]?'\x20('+_0x17da71['functionName']+')':'')};},async 'dryRun'(_0xa83bd1){const _0x482f15=a35_0x2948b1,_0x22e349=_0xa83bd1['num']('id'),_0x2363d8=buildUpdateInput(_0xa83bd1);return dryRun(_0x482f15(0xbf),'/client/runtime-bff/personal/'+_0x22e349+_0x482f15(0xc5))['body']({'appCode':_0xa83bd1[_0x482f15(0x9d)],..._0x2363d8})['description'](_0x482f15(0xc4)+_0x22e349)[_0x482f15(0xd9)]();}},personalBffExec={'service':a35_0x2948b1(0xd2),'command':a35_0x2948b1(0xa2),'description':a35_0x2948b1(0xb4),'risk':a35_0x2948b1(0xc8),'flags':[{...ID_FLAG,'description':a35_0x2948b1(0xa6)},{...PARAMS_FLAG,'description':a35_0x2948b1(0xc7)}],async 'validate'(_0x3aa431){const _0x22b7ed=a35_0x2948b1;parseExecParams(_0x3aa431[_0x22b7ed(0xd8)]('params'));},async 'execute'(_0x4a2df4){const _0x5e0616=a35_0x2948b1,_0x87f9e7=_0x4a2df4[_0x5e0616(0xb9)]('id'),_0x50a2c7=parseExecParams(_0x4a2df4[_0x5e0616(0xd8)](_0x5e0616(0x9f))),_0x7c657b=await executePersonalBff(_0x87f9e7,_0x4a2df4[_0x5e0616(0x9d)],_0x50a2c7);return{'ok':!![],'data':{'result':_0x7c657b},'message':_0x5e0616(0xb1)+_0x87f9e7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x35e830=a35_0xf97a;(function(_0x27789e,_0x3ae3db){const _0x311220=a35_0xf97a,_0x293445=_0x27789e();while(!![]){try{const _0x775775=-parseInt(_0x311220(0x11e))/0x1+parseInt(_0x311220(0x118))/0x2+-parseInt(_0x311220(0x133))/0x3+parseInt(_0x311220(0x10b))/0x4+parseInt(_0x311220(0x121))/0x5*(parseInt(_0x311220(0x127))/0x6)+-parseInt(_0x311220(0x135))/0x7+parseInt(_0x311220(0x107))/0x8*(parseInt(_0x311220(0x139))/0x9);if(_0x775775===_0x3ae3db)break;else _0x293445['push'](_0x293445['shift']());}catch(_0x459afc){_0x293445['push'](_0x293445['shift']());}}}(a35_0x3bcb,0xeec7c));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0xf97a(_0x313f44,_0x1600e4){_0x313f44=_0x313f44-0x102;const _0x3bcb91=a35_0x3bcb();let _0xf97afc=_0x3bcb91[_0x313f44];return _0xf97afc;}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_0x35e830(0x132),'description':a35_0x35e830(0x110)},FUNCTION_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a35_0x35e830(0x114)},DESCRIPTION_FLAG={'name':a35_0x35e830(0x10c),'type':a35_0x35e830(0x132),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x35e830(0x120),'type':a35_0x35e830(0x132),'description':a35_0x35e830(0x13b)};function normalizeFunctionName(_0x482e6f){const _0x1b497b=a35_0x35e830,_0x28743c=String(_0x482e6f||'')['trim']();if(!_0x28743c||!FUNCTION_NAME_PATTERN['test'](_0x28743c))throw CliErrors[_0x1b497b(0x125)](_0x1b497b(0x103));return _0x28743c;}function readScriptFile(_0x4f29f8){const _0x4680ae=a35_0x35e830;if(!_0x4f29f8)throw CliErrors[_0x4680ae(0x125)](_0x4680ae(0x11c));if(!existsSync(_0x4f29f8))throw CliErrors[_0x4680ae(0x125)]('File\x20not\x20found:\x20'+_0x4f29f8);if(!statSync(_0x4f29f8)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x4f29f8);const _0x303587=readFileSync(_0x4f29f8,'utf8');if(!_0x303587[_0x4680ae(0x124)]())throw CliErrors[_0x4680ae(0x125)](_0x4680ae(0x122));return _0x303587;}function optionalTrimmed(_0x4c0863){const _0x4612c8=String(_0x4c0863||'')['trim']();return _0x4612c8||undefined;}function summarizeBff(_0x5a5b7d){const _0x3026aa=a35_0x35e830;return{'id':_0x5a5b7d['id'],'appCode':_0x5a5b7d[_0x3026aa(0x12c)],'functionName':_0x5a5b7d[_0x3026aa(0x13a)],'description':_0x5a5b7d[_0x3026aa(0x10c)],'scriptType':_0x5a5b7d['scriptType'],'version':_0x5a5b7d[_0x3026aa(0x11a)],'gmtModified':_0x5a5b7d[_0x3026aa(0x131)],'updateTime':_0x5a5b7d[_0x3026aa(0x10a)]};}function detailBff(_0x1cfc08){const _0x2ed36c=a35_0x35e830;return{'id':_0x1cfc08['id'],'appCode':_0x1cfc08[_0x2ed36c(0x12c)],'functionName':_0x1cfc08[_0x2ed36c(0x13a)],'description':_0x1cfc08[_0x2ed36c(0x10c)],'scriptType':_0x1cfc08[_0x2ed36c(0x129)],'scriptContent':_0x1cfc08['scriptContent']??'','config':_0x1cfc08[_0x2ed36c(0x116)],'version':_0x1cfc08[_0x2ed36c(0x11a)],'createUserId':_0x1cfc08[_0x2ed36c(0x128)],'gmtCreate':_0x1cfc08[_0x2ed36c(0x11f)],'gmtModified':_0x1cfc08[_0x2ed36c(0x131)],'createTime':_0x1cfc08['createTime'],'updateTime':_0x1cfc08['updateTime']};}function a35_0x3bcb(){const _0x47e71a=['trim','validation','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','6ZJeBBH','createUserId','scriptType','personal-bff','Preview:\x20create\x20personal\x20BFF\x20','appCode','create','/update','num','isArray','gmtModified','string','4560651bWpvoN','POST','11177327DyYxhf','bool','file','read','1647oLprKv','functionName','Optional\x20source\x20RuntimeAgent\x20session\x20id','Personal\x20BFF\x20script\x20ID','Update\x20a\x20personal\x20BFF\x20by\x20id','/client/runtime-bff/personal/create','Created\x20personal\x20BFF\x20','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','str','body','9944qprguc','verbose','build','updateTime','7495432pQhXLN','description','sourceSessionId','Executed\x20personal\x20BFF\x20','keys','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','write','name','length','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','list','config','flag','3057482GvSXDH','map','version','--params\x20must\x20be\x20a\x20JSON\x20object.','File\x20path\x20is\x20required.','high-risk-write','1205553ofECDe','gmtCreate','source-session-id','8352535LVGpLt','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Show\x20one\x20personal\x20BFF\x20by\x20id'];a35_0x3bcb=function(){return _0x47e71a;};return a35_0x3bcb();}function buildCreateInput(_0x2f04c7){const _0x4f9884=a35_0x35e830;return{'functionName':normalizeFunctionName(_0x2f04c7[_0x4f9884(0x105)](_0x4f9884(0x112))),...optionalTrimmed(_0x2f04c7[_0x4f9884(0x105)](_0x4f9884(0x10c)))?{'description':optionalTrimmed(_0x2f04c7['str'](_0x4f9884(0x10c)))}:{},'scriptContent':readScriptFile(_0x2f04c7[_0x4f9884(0x105)]('file')),...optionalTrimmed(_0x2f04c7[_0x4f9884(0x105)](_0x4f9884(0x120)))?{'sourceSessionId':optionalTrimmed(_0x2f04c7['str'](_0x4f9884(0x120)))}:{}};}function buildUpdateInput(_0x5502d8){const _0x57d22b=a35_0x35e830,_0x4020b1={};optionalTrimmed(_0x5502d8[_0x57d22b(0x105)]('name'))&&(_0x4020b1[_0x57d22b(0x13a)]=normalizeFunctionName(_0x5502d8[_0x57d22b(0x105)](_0x57d22b(0x112))));_0x5502d8[_0x57d22b(0x117)]('description')!==undefined&&(_0x4020b1[_0x57d22b(0x10c)]=_0x5502d8[_0x57d22b(0x105)](_0x57d22b(0x10c)));optionalTrimmed(_0x5502d8[_0x57d22b(0x105)](_0x57d22b(0x137)))&&(_0x4020b1['scriptContent']=readScriptFile(_0x5502d8[_0x57d22b(0x105)](_0x57d22b(0x137))));_0x5502d8[_0x57d22b(0x117)]('source-session-id')!==undefined&&(_0x4020b1[_0x57d22b(0x10d)]=_0x5502d8[_0x57d22b(0x105)](_0x57d22b(0x120)));if(Object[_0x57d22b(0x10f)](_0x4020b1)[_0x57d22b(0x113)]===0x0)throw CliErrors[_0x57d22b(0x125)](_0x57d22b(0x126));return _0x4020b1;}function parseExecParams(_0x5e27d5){const _0x159383=a35_0x35e830,_0x5cba0a=parseJsonParams(_0x5e27d5)??{};if(Array[_0x159383(0x130)](_0x5cba0a))throw CliErrors[_0x159383(0x125)](_0x159383(0x11b));return _0x5cba0a;}const personalBffList={'service':a35_0x35e830(0x12a),'command':a35_0x35e830(0x115),'description':a35_0x35e830(0x104),'risk':a35_0x35e830(0x138),'flags':[VERBOSE_FLAG],async 'execute'(_0xff24ad){const _0x2df42f=a35_0x35e830,_0x28846d=await listPersonalBffs(_0xff24ad[_0x2df42f(0x12c)]);return{'ok':!![],'data':{'total':_0x28846d[_0x2df42f(0x113)],'items':_0xff24ad[_0x2df42f(0x136)](_0x2df42f(0x108))?_0x28846d:_0x28846d[_0x2df42f(0x119)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':'detail','description':a35_0x35e830(0x123),'risk':'read','flags':[{...ID_FLAG,'description':a35_0x35e830(0x13c)}],async 'execute'(_0x596a2c){const _0x577f15=a35_0x35e830,_0x257042=await getPersonalBff(_0x596a2c[_0x577f15(0x12f)]('id'),_0x596a2c[_0x577f15(0x12c)]);return{'ok':!![],'data':detailBff(_0x257042)};}},personalBffCreate={'service':a35_0x35e830(0x12a),'command':a35_0x35e830(0x12d),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':'write','flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x411d5e){const _0x26e6b0=a35_0x35e830,_0xaca9dd=buildCreateInput(_0x411d5e),_0x3f6708=await createPersonalBff(_0x411d5e[_0x26e6b0(0x12c)],_0xaca9dd);return{'ok':!![],'data':detailBff(_0x3f6708),'message':_0x26e6b0(0x102)+_0x3f6708['id']+(_0x3f6708[_0x26e6b0(0x13a)]?'\x20('+_0x3f6708[_0x26e6b0(0x13a)]+')':'')};},async 'dryRun'(_0x2dec2){const _0x3abb69=a35_0x35e830,_0x11182a=buildCreateInput(_0x2dec2);return dryRun('POST',_0x3abb69(0x13e))[_0x3abb69(0x106)]({'appCode':_0x2dec2[_0x3abb69(0x12c)],..._0x11182a})[_0x3abb69(0x10c)](_0x3abb69(0x12b)+_0x11182a[_0x3abb69(0x13a)])[_0x3abb69(0x109)]();}},personalBffUpdate={'service':'personal-bff','command':'update','description':a35_0x35e830(0x13d),'risk':a35_0x35e830(0x111),'flags':[{...ID_FLAG,'description':a35_0x35e830(0x13c)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x5e8884){const _0x5ed220=_0x5e8884['num']('id'),_0x461453=buildUpdateInput(_0x5e8884),_0x1c6fd8=await updatePersonalBff(_0x5ed220,_0x5e8884['appCode'],_0x461453);return{'ok':!![],'data':detailBff(_0x1c6fd8),'message':'Updated\x20personal\x20BFF\x20'+_0x1c6fd8['id']+(_0x1c6fd8['functionName']?'\x20('+_0x1c6fd8['functionName']+')':'')};},async 'dryRun'(_0x3fb765){const _0x15e20d=a35_0x35e830,_0x439ab0=_0x3fb765['num']('id'),_0x727e27=buildUpdateInput(_0x3fb765);return dryRun(_0x15e20d(0x134),'/client/runtime-bff/personal/'+_0x439ab0+_0x15e20d(0x12e))[_0x15e20d(0x106)]({'appCode':_0x3fb765['appCode'],..._0x727e27})[_0x15e20d(0x10c)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x439ab0)[_0x15e20d(0x109)]();}},personalBffExec={'service':a35_0x35e830(0x12a),'command':'exec','description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x35e830(0x11d),'flags':[{...ID_FLAG,'description':a35_0x35e830(0x13c)},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x43b07d){const _0x4395c6=a35_0x35e830;parseExecParams(_0x43b07d[_0x4395c6(0x105)]('params'));},async 'execute'(_0x52b334){const _0x403cdc=a35_0x35e830,_0xefcc28=_0x52b334[_0x403cdc(0x12f)]('id'),_0x1b53b3=parseExecParams(_0x52b334[_0x403cdc(0x105)]('params')),_0x1f520b=await executePersonalBff(_0xefcc28,_0x52b334[_0x403cdc(0x12c)],_0x1b53b3);return{'ok':!![],'data':{'result':_0x1f520b},'message':_0x403cdc(0x10e)+_0xefcc28};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x145064=a36_0x182d;(function(_0xad1526,_0x12bc6a){const _0x4d3b99=a36_0x182d,_0x51230d=_0xad1526();while(!![]){try{const _0x5f1c42=-parseInt(_0x4d3b99(0x154))/0x1*(-parseInt(_0x4d3b99(0x142))/0x2)+-parseInt(_0x4d3b99(0x161))/0x3+-parseInt(_0x4d3b99(0x158))/0x4+-parseInt(_0x4d3b99(0x166))/0x5+parseInt(_0x4d3b99(0x165))/0x6+-parseInt(_0x4d3b99(0x147))/0x7+parseInt(_0x4d3b99(0x13c))/0x8*(parseInt(_0x4d3b99(0x151))/0x9);if(_0x5f1c42===_0x12bc6a)break;else _0x51230d['push'](_0x51230d['shift']());}catch(_0x3ed8dc){_0x51230d['push'](_0x51230d['shift']());}}}(a36_0xbfdc,0x1f7fd));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0xbfdc(){const _0xb18b21=['Skills','API\x20Documentation','574144jgqAVB','write','Knowledge\x20Base','defaultCommand','Personal\x20BFF','Schema','Instant\x20API','\x20\x20[write]','OCR','99240wIaUpM','\x20\x20[high-risk-write]','Datasets','get','634914mTvYeG','558890QjPknE','command','values','CLI\x20Built-in\x20Skill','Agent\x20Schedules','map','Authentication','954104kepguI','isSingleCommand','risk','description','list','from','426946zJCIyV','Runtime\x20App\x20Config','Diagnostics','SQL\x20Queries','Self\x20Update','147980Qmhzyw','App\x20Management','has','login','Service\x20Tree','Logs','service','show','install','BFF\x20Scripts','9SpiBVO','push','set','1VduYEd','File'];a36_0xbfdc=function(){return _0xb18b21;};return a36_0xbfdc();}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=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function a36_0x182d(_0x384cb2,_0x105632){_0x384cb2=_0x384cb2-0x13b;const _0xbfdc6a=a36_0xbfdc();let _0x182d86=_0xbfdc6a[_0x384cb2];return _0x182d86;}function registerDefinitions(_0x789dd1){const _0x3dcf92=a36_0x182d;for(const _0x59ed16 of _0x789dd1){definitions[_0x3dcf92(0x153)](_0x59ed16['service']+':'+_0x59ed16[_0x3dcf92(0x167)],_0x59ed16);let _0x159b0f=serviceGroups[_0x3dcf92(0x164)](_0x59ed16[_0x3dcf92(0x14d)]);!_0x159b0f&&(_0x159b0f=[],serviceGroups[_0x3dcf92(0x153)](_0x59ed16[_0x3dcf92(0x14d)],_0x159b0f)),_0x159b0f[_0x3dcf92(0x152)](_0x59ed16);}}function registerService(_0x3e2946,_0x217ab7,_0x4c9479){const _0xd4aa58=a36_0x182d;registerDefinitions(_0x217ab7);const _0x94c037=_0xe88b4c=>_0xe88b4c==='read'?'':_0xe88b4c===_0xd4aa58(0x159)?_0xd4aa58(0x15f):_0xd4aa58(0x162),_0xa10e1f={'service':_0x217ab7[0x0][_0xd4aa58(0x14d)],'label':_0x3e2946,'commands':_0x217ab7[_0xd4aa58(0x16b)](_0x664ce0=>({'command':_0x664ce0[_0xd4aa58(0x167)],'description':_0x664ce0[_0xd4aa58(0x13f)],'tag':_0x94c037(_0x664ce0[_0xd4aa58(0x13e)])})),'defaultCommand':_0x4c9479?.[_0xd4aa58(0x15b)]??(_0x4c9479?.[_0xd4aa58(0x13d)]?_0x217ab7[0x0]['command']:undefined),'isSingleCommand':_0x4c9479?.['isSingleCommand']};serviceRegistry[_0xd4aa58(0x152)](_0xa10e1f),serviceByName[_0xd4aa58(0x153)](_0xa10e1f[_0xd4aa58(0x14d)],_0xa10e1f);}registerService(a36_0x145064(0x13b),authDefinitions,{'defaultCommand':a36_0x145064(0x14a)}),registerService(a36_0x145064(0x148),appDefinitions,{'defaultCommand':a36_0x145064(0x140)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x145064(0x143),appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':'list'}),registerService(a36_0x145064(0x157),apiDocDefinitions),registerService(a36_0x145064(0x163),datasetDefinitions),registerService(a36_0x145064(0x15e),dataDefinitions),registerService(a36_0x145064(0x145),sqlDefinitions),registerService(a36_0x145064(0x150),bffDefinitions),registerService(a36_0x145064(0x15c),personalBffDefinitions),registerService('Artifacts',artifactDefinitions),registerService(a36_0x145064(0x155),fileDefinitions),registerService(a36_0x145064(0x160),ocrDefinitions),registerService(a36_0x145064(0x15a),kbDefinitions),registerService(a36_0x145064(0x16a),scheduleDefinitions,{'defaultCommand':a36_0x145064(0x140)}),registerService(a36_0x145064(0x14b),serviceDefinitions,{'defaultCommand':a36_0x145064(0x140)}),registerService(a36_0x145064(0x156),skillDefinitions,{'defaultCommand':a36_0x145064(0x14f)}),registerService(a36_0x145064(0x169),cliSkillDefinitions,{'defaultCommand':a36_0x145064(0x14f)}),registerService(a36_0x145064(0x146),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x145064(0x144),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x145064(0x15d),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x145064(0x14c),logsDefinitions,{'defaultCommand':a36_0x145064(0x14e)});export function findDefinition(_0x5a11d,_0x29b37e){return definitions['get'](_0x5a11d+':'+_0x29b37e);}export function isKnownService(_0x4040cf){const _0x14d1d3=a36_0x145064;return serviceByName[_0x14d1d3(0x149)](_0x4040cf);}export function getServiceEntry(_0x5ec040){const _0x3282c7=a36_0x145064;return serviceByName[_0x3282c7(0x164)](_0x5ec040);}export function getAllDefinitions(){const _0x14bb7c=a36_0x145064;return Array[_0x14bb7c(0x141)](definitions[_0x14bb7c(0x168)]());}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a37_0x1f50b0=a37_0x1c61;(function(_0x16965f,_0x5778d1){const _0x32a140=a37_0x1c61,_0x32cdce=_0x16965f();while(!![]){try{const _0x116925=-parseInt(_0x32a140(0x1fb))/0x1*(parseInt(_0x32a140(0x1ea))/0x2)+-parseInt(_0x32a140(0x22f))/0x3*(-parseInt(_0x32a140(0x224))/0x4)+-parseInt(_0x32a140(0x205))/0x5+-parseInt(_0x32a140(0x1fd))/0x6*(parseInt(_0x32a140(0x226))/0x7)+-parseInt(_0x32a140(0x22e))/0x8+-parseInt(_0x32a140(0x1fa))/0x9*(-parseInt(_0x32a140(0x202))/0xa)+parseInt(_0x32a140(0x21e))/0xb;if(_0x116925===_0x5778d1)break;else _0x32cdce['push'](_0x32cdce['shift']());}catch(_0x1e2069){_0x32cdce['push'](_0x32cdce['shift']());}}}(a37_0x4f80,0xda774));function a37_0x4f80(){const _0x12f29c=['a\x20UUID\x20returned\x20by\x20schedule\x20create/list','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','cursor','scheduleId','delete','list','Task\x20channel:\x20auto\x20or\x20premium','schedule','/api/harness/apps/','high-risk-write','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','auto','num','string','UTC','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','/schedules','--title\x20must\x20not\x20be\x20blank.','CRON','40433063hnsUbb','Deleted\x20schedule\x20','prompt','taskId','Preview:\x20delete\x20schedule\x20','Page\x20size\x20from\x201\x20to\x20100','142300XMUhzU','premium','14HraOvC','DELETE','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','\x20from\x20schedule\x20','Schedule\x20title','trim','/run','5114936DPAclM','15EBTDZc','\x20immediately','Queued\x20Task\x20','Created\x20','str','schedule-id','Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','1081148QiCrsP','Preview:\x20run\x20schedule\x20','number','POST','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','Preview:\x20create\x20an\x20Agent\x20schedule','kind','Show\x20one\x20schedule\x20by\x20schedule\x20ID','scheduled-at','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','description','title','channel','body','appCode','2709poXFqr','1mtEaOm','run','4927572HkciId','validation','ONCE','limit','Schedule\x20input\x20is\x20valid','39950tRtThq','read','Schedule\x20kind:\x20CRON\x20or\x20ONCE','6694010ejkJJS','detail','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','isSafeInteger','\x20schedule\x20'];a37_0x4f80=function(){return _0x12f29c;};return a37_0x4f80();}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_0x1f50b0(0x1f0),'type':a37_0x1f50b0(0x218),'required':!![],'enum':[a37_0x1f50b0(0x21d),a37_0x1f50b0(0x1ff)],'description':a37_0x1f50b0(0x204)},CRON_FLAG={'name':'cron','type':'string','description':a37_0x1f50b0(0x207)},SCHEDULED_AT_FLAG={'name':a37_0x1f50b0(0x1f2),'type':a37_0x1f50b0(0x218),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a37_0x1f50b0(0x1f6),'type':a37_0x1f50b0(0x218),'required':!![],'description':a37_0x1f50b0(0x22b)},PROMPT_FLAG={'name':'prompt','type':a37_0x1f50b0(0x218),'required':!![],'description':a37_0x1f50b0(0x1f3)},CHANNEL_FLAG={'name':a37_0x1f50b0(0x1f7),'type':a37_0x1f50b0(0x218),'enum':[a37_0x1f50b0(0x216),a37_0x1f50b0(0x225)],'default':'auto','description':a37_0x1f50b0(0x210)},SCHEDULE_ID_FLAG={'name':a37_0x1f50b0(0x1e8),'type':a37_0x1f50b0(0x218),'required':!![],'description':'Schedule\x20UUID','pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x1f50b0(0x20a)}},LIMIT_FLAG={'name':a37_0x1f50b0(0x200),'type':a37_0x1f50b0(0x1ec),'default':0x14,'description':a37_0x1f50b0(0x223)},CURSOR_FLAG={'name':a37_0x1f50b0(0x20c),'type':a37_0x1f50b0(0x218),'description':a37_0x1f50b0(0x229)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0xc572fe){const _0x396ab1=a37_0x1f50b0,_0x2611f9=_0xc572fe['str'](_0x396ab1(0x1f0)),_0x2eaec6=_0xc572fe[_0x396ab1(0x1e7)](_0x396ab1(0x1f6))[_0x396ab1(0x22c)](),_0x24f88b=_0xc572fe['str'](_0x396ab1(0x220))['trim'](),_0xdfce75=_0xc572fe[_0x396ab1(0x1e7)](_0x396ab1(0x1f7)),_0x549d81=_0xc572fe[_0x396ab1(0x1e7)]('cron'),_0x1e02e3=_0xc572fe[_0x396ab1(0x1e7)]('scheduled-at');if(!_0x2eaec6)throw CliErrors['validation'](_0x396ab1(0x21c));if(!_0x24f88b)throw CliErrors[_0x396ab1(0x1fe)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x2611f9===_0x396ab1(0x21d)){if(!_0x549d81||_0x1e02e3)throw CliErrors[_0x396ab1(0x1fe)](_0x396ab1(0x228));return{'kind':_0x2611f9,'timezone':'UTC','cron':_0x549d81,'title':_0x2eaec6,'prompt':_0x24f88b,'channel':_0xdfce75};}if(_0x2611f9===_0x396ab1(0x1ff)){if(!_0x1e02e3||_0x549d81)throw CliErrors[_0x396ab1(0x1fe)]('ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.');return{'kind':_0x2611f9,'timezone':_0x396ab1(0x219),'scheduledAt':_0x1e02e3,'title':_0x2eaec6,'prompt':_0x24f88b,'channel':_0xdfce75};}throw CliErrors[_0x396ab1(0x1fe)](_0x396ab1(0x1ee));}function a37_0x1c61(_0x2a88e1,_0x59bf8f){_0x2a88e1=_0x2a88e1-0x1e6;const _0x4f805c=a37_0x4f80();let _0x1c61bf=_0x4f805c[_0x2a88e1];return _0x1c61bf;}function scheduleCollectionPath(_0x541b3e){const _0x407cb3=a37_0x1f50b0;return _0x407cb3(0x212)+encodeURIComponent(_0x541b3e)+_0x407cb3(0x21b);}function scheduleItemPath(_0x41be48,_0x409957){return scheduleCollectionPath(_0x41be48)+'/'+encodeURIComponent(_0x409957);}const scheduleValidate={'service':a37_0x1f50b0(0x211),'command':'validate','description':a37_0x1f50b0(0x215),'risk':a37_0x1f50b0(0x203),'flags':INPUT_FLAGS,async 'validate'(_0x14c81f){readScheduleInput(_0x14c81f);},async 'execute'(_0x11964c){const _0x1a4fd1=a37_0x1f50b0,_0x5ca028=readScheduleInput(_0x11964c),_0x13b496=await validateRuntimeSchedule(_0x11964c[_0x1a4fd1(0x1f9)],_0x5ca028);return{'ok':!![],'data':_0x13b496,'message':_0x1a4fd1(0x201)};}},scheduleCreate={'service':a37_0x1f50b0(0x211),'command':'create','description':a37_0x1f50b0(0x21a),'risk':a37_0x1f50b0(0x213),'flags':INPUT_FLAGS,async 'validate'(_0x2e451f){readScheduleInput(_0x2e451f);},async 'execute'(_0x12aa45){const _0x3338f5=a37_0x1f50b0,_0x2dc9e1=readScheduleInput(_0x12aa45),_0x4c887c=await validateRuntimeSchedule(_0x12aa45[_0x3338f5(0x1f9)],_0x2dc9e1),_0x278dd4=await createRuntimeSchedule(_0x12aa45['appCode'],_0x4c887c);return{'ok':!![],'data':_0x278dd4,'message':_0x3338f5(0x1e6)+_0x278dd4[_0x3338f5(0x1f0)]+_0x3338f5(0x209)+_0x278dd4[_0x3338f5(0x20d)]};},async 'dryRun'(_0x168130){const _0x4b5245=a37_0x1f50b0,_0x12ddd3=readScheduleInput(_0x168130);return dryRun(_0x4b5245(0x1ed),scheduleCollectionPath(_0x168130[_0x4b5245(0x1f9)]))[_0x4b5245(0x1f8)](_0x12ddd3)[_0x4b5245(0x1f5)](_0x4b5245(0x1ef))['build']();}},scheduleList={'service':'schedule','command':a37_0x1f50b0(0x20f),'description':a37_0x1f50b0(0x1f4),'risk':a37_0x1f50b0(0x203),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x23b1f6){const _0x300ae7=a37_0x1f50b0,_0x6cc567=_0x23b1f6[_0x300ae7(0x217)]('limit');if(!Number[_0x300ae7(0x208)](_0x6cc567)||_0x6cc567<0x1||_0x6cc567>0x64)throw CliErrors[_0x300ae7(0x1fe)](_0x300ae7(0x214));const _0x30f0e1=_0x23b1f6['str'](_0x300ae7(0x20c));if(_0x30f0e1&&(_0x30f0e1['length']>0x400||_0x30f0e1[_0x300ae7(0x22c)]()!==_0x30f0e1))throw CliErrors[_0x300ae7(0x1fe)](_0x300ae7(0x20b));},async 'execute'(_0x134e2d){const _0xd20067=a37_0x1f50b0,_0x3e52d0=_0x134e2d['str'](_0xd20067(0x20c)),_0x3009a6=await listRuntimeSchedules(_0x134e2d['appCode'],{'limit':_0x134e2d[_0xd20067(0x217)](_0xd20067(0x200)),..._0x3e52d0?{'cursor':_0x3e52d0}:{}});return{'ok':!![],'data':_0x3009a6};}},scheduleDetail={'service':a37_0x1f50b0(0x211),'command':a37_0x1f50b0(0x206),'description':a37_0x1f50b0(0x1f1),'risk':a37_0x1f50b0(0x203),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3c61cb){const _0x5e7509=a37_0x1f50b0,_0x1e5339=await getRuntimeSchedule(_0x3c61cb['appCode'],_0x3c61cb[_0x5e7509(0x1e7)](_0x5e7509(0x1e8)));return{'ok':!![],'data':_0x1e5339};}},scheduleRun={'service':a37_0x1f50b0(0x211),'command':a37_0x1f50b0(0x1fc),'description':'Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','risk':a37_0x1f50b0(0x213),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x143179){const _0x5b105b=a37_0x1f50b0,_0x17fbba=_0x143179['str'](_0x5b105b(0x1e8)),_0x23e5c0=await runRuntimeSchedule(_0x143179['appCode'],_0x17fbba);return{'ok':!![],'data':_0x23e5c0,'message':_0x5b105b(0x231)+_0x23e5c0[_0x5b105b(0x221)]+_0x5b105b(0x22a)+_0x17fbba};},async 'dryRun'(_0xd56cf7){const _0x460c7f=a37_0x1f50b0,_0x3e85d7=_0xd56cf7[_0x460c7f(0x1e7)](_0x460c7f(0x1e8));return dryRun(_0x460c7f(0x1ed),scheduleItemPath(_0xd56cf7[_0x460c7f(0x1f9)],_0x3e85d7)+_0x460c7f(0x22d))[_0x460c7f(0x1f5)](_0x460c7f(0x1eb)+_0x3e85d7+_0x460c7f(0x230))['build']();}},scheduleDelete={'service':a37_0x1f50b0(0x211),'command':a37_0x1f50b0(0x20e),'description':a37_0x1f50b0(0x1e9),'risk':a37_0x1f50b0(0x213),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2745fa){const _0x5c588b=a37_0x1f50b0,_0x2d93a3=_0x2745fa[_0x5c588b(0x1e7)](_0x5c588b(0x1e8)),_0x1bf69d=await deleteRuntimeSchedule(_0x2745fa['appCode'],_0x2d93a3);return{'ok':!![],'data':_0x1bf69d,'message':_0x5c588b(0x21f)+_0x2d93a3};},async 'dryRun'(_0x142f3b){const _0x421481=a37_0x1f50b0,_0x4b59c6=_0x142f3b[_0x421481(0x1e7)]('schedule-id');return dryRun(_0x421481(0x227),scheduleItemPath(_0x142f3b[_0x421481(0x1f9)],_0x4b59c6))[_0x421481(0x1f5)](_0x421481(0x222)+_0x4b59c6)['build']();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a38_0x1b98(_0x5dc7d4,_0x106360){_0x5dc7d4=_0x5dc7d4-0x11e;const _0x27b1dd=a38_0x27b1();let _0x1b9876=_0x27b1dd[_0x5dc7d4];return _0x1b9876;}const a38_0x336f56=a38_0x1b98;(function(_0x3702b8,_0x5b857b){const _0x26f0cc=a38_0x1b98,_0x183810=_0x3702b8();while(!![]){try{const _0x391182=-parseInt(_0x26f0cc(0x123))/0x1*(-parseInt(_0x26f0cc(0x126))/0x2)+-parseInt(_0x26f0cc(0x12a))/0x3*(parseInt(_0x26f0cc(0x120))/0x4)+parseInt(_0x26f0cc(0x124))/0x5+-parseInt(_0x26f0cc(0x12b))/0x6*(-parseInt(_0x26f0cc(0x122))/0x7)+parseInt(_0x26f0cc(0x11e))/0x8+-parseInt(_0x26f0cc(0x127))/0x9+-parseInt(_0x26f0cc(0x128))/0xa;if(_0x391182===_0x5b857b)break;else _0x183810['push'](_0x183810['shift']());}catch(_0x5dc744){_0x183810['push'](_0x183810['shift']());}}}(a38_0x27b1,0xc7817));import{buildSchemaPayload}from'../framework/schema-export.js';function a38_0x27b1(){const _0x3d2be3=['11440NfbZsI','export','553LUrvVf','1TLCDrs','4770155tWTJWO','Export\x20machine-readable\x20command\x20schema\x20(JSON)','1691622xWzkfE','5879493jOXEiS','6383000aWuxPy','read','852rJcSeD','1674CiHEYa','8792872UZnRDK','schema'];a38_0x27b1=function(){return _0x3d2be3;};return a38_0x27b1();}async function execute(_0x5107ef){const _0x317f0a=await buildSchemaPayload();return{'ok':!![],'data':_0x317f0a};}export const schemaDefinition={'service':a38_0x336f56(0x11f),'command':a38_0x336f56(0x121),'description':a38_0x336f56(0x125),'risk':a38_0x336f56(0x129),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|