@lovrabet/lovrabet-cli 2.1.19 → 2.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.d.ts +12 -0
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.d.ts +12 -0
- package/lib/framework/raw-flags.js +1 -0
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x5ddd5d=a29_0x1f38;(function(_0x1823f7,_0x33170e){const _0xdd8977=a29_0x1f38,_0x30724d=_0x1823f7();while(!![]){try{const _0x95f3d7=-parseInt(_0xdd8977(0x9c))/0x1*(-parseInt(_0xdd8977(0x94))/0x2)+parseInt(_0xdd8977(0x8e))/0x3*(-parseInt(_0xdd8977(0x9d))/0x4)+-parseInt(_0xdd8977(0xb7))/0x5*(parseInt(_0xdd8977(0xa0))/0x6)+-parseInt(_0xdd8977(0x6f))/0x7+-parseInt(_0xdd8977(0x65))/0x8*(-parseInt(_0xdd8977(0xa5))/0x9)+-parseInt(_0xdd8977(0x8a))/0xa+parseInt(_0xdd8977(0xb8))/0xb;if(_0x95f3d7===_0x33170e)break;else _0x30724d['push'](_0x30724d['shift']());}catch(_0x4527e4){_0x30724d['push'](_0x30724d['shift']());}}}(a29_0x4399,0xacf7d));import a29_0x5d7c31 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';function a29_0x1f38(_0x5592db,_0x295ff8){_0x5592db=_0x5592db-0x64;const _0x4399e6=a29_0x4399();let _0x1f381b=_0x4399e6[_0x5592db];return _0x1f381b;}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';function a29_0x4399(){const _0x5e66c3=['\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty\x20(treated\x20as\x20{})','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','305zbghDA','10296880FswKEa','\x20(accessKey)','locale','\x20doctor','gray','33688PguYau','status','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','(not\x20found)','(default)','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','appCode','2671431DQXuiX','doctor','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','missing','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','accessKey','Project','\x20\x20Service\x20Tree','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','commandCount','\x20\x20API\x20Endpoints','\x20commands)','(default:\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','currentApp','✓\x20Loaded','bold','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','platform','env','format','4129940dHhtMg','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Merged\x20Config','12ZfFGSG','empty','services','serviceCode','serviceCount','(set,\x20length=','1507028LNlyEk','padEnd','verbose','yellow','read','defaultApp','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','log','1eqktoY','290552AIgSCr','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','(none)','115266Wrctxx','ClientAk','✓\x20Valid\x20JSON','name','version','2727QNXVFm','\x20\x20─','repeat','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','registryPath','\x20\x20Config\x20JSON','check','red','(unnamed)','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','green','message','riskLevel','(no\x20file)'];a29_0x4399=function(){return _0x5e66c3;};return a29_0x4399();}import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x97c1b8){const _0xad34f5=a29_0x1f38,_0x4c2e6d=getCliVersion(),_0x33a3f1=buildConfigFromFlags({});await initGlobalEnvironment(_0x33a3f1),console[_0xad34f5(0x9b)](),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x85)](CLI_BIN_NAME+_0xad34f5(0xbb))),console['log'](a29_0x5d7c31[_0xad34f5(0x64)]('─'[_0xad34f5(0xa7)](0x32))),console[_0xad34f5(0x9b)](_0xad34f5(0x6d)+_0x4c2e6d),console[_0xad34f5(0x9b)](_0xad34f5(0xb6)+process[_0xad34f5(0xa4)]),console[_0xad34f5(0x9b)](_0xad34f5(0x80)+process[_0xad34f5(0x87)]+'\x20'+process['arch']),console[_0xad34f5(0x9b)](),console['log'](a29_0x5d7c31[_0xad34f5(0x85)]('\x20\x20Config\x20Files')),console['log'](a29_0x5d7c31[_0xad34f5(0x64)]('\x20\x20─'[_0xad34f5(0xa7)](0x1e)));const _0x225e7d=getGlobalConfigPath(),_0x26e60f=getProjectConfigPath();console[_0xad34f5(0x9b)](_0xad34f5(0x71)+(_0x225e7d||a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x6b)))),console[_0xad34f5(0x9b)](_0xad34f5(0xa8)+(_0x26e60f||a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x6b)))),console[_0xad34f5(0x9b)](),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x85)](_0xad34f5(0xaa))),console[_0xad34f5(0x9b)](a29_0x5d7c31['gray']('\x20\x20─'[_0xad34f5(0xa7)](0x1e)));const _0x301bc=(_0x108fd2,_0x43aa47)=>{const _0x1522bf=_0xad34f5;if(!_0x43aa47){console[_0x1522bf(0x9b)]('\x20\x20'+_0x108fd2[_0x1522bf(0x95)](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0x64)](_0x1522bf(0xb3)));return;}const _0x119510=inspectCliConfigJsonFile(_0x43aa47);if(_0x119510[_0x1522bf(0x66)]==='ok')console[_0x1522bf(0x9b)]('\x20\x20'+_0x108fd2['padEnd'](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0xb0)](_0x1522bf(0xa2)));else{if(_0x119510[_0x1522bf(0x66)]===_0x1522bf(0x8f))console[_0x1522bf(0x9b)]('\x20\x20'+_0x108fd2[_0x1522bf(0x95)](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0x97)](_0x1522bf(0xb5)));else _0x119510[_0x1522bf(0x66)]===_0x1522bf(0x72)?console[_0x1522bf(0x9b)]('\x20\x20'+_0x108fd2[_0x1522bf(0x95)](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0x64)]('(missing)')):(console[_0x1522bf(0x9b)]('\x20\x20'+_0x108fd2['padEnd'](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0xac)]('✗\x20Invalid\x20JSON')),console[_0x1522bf(0x9b)]('\x20\x20'+''[_0x1522bf(0x95)](0x11)+'\x20'+a29_0x5d7c31[_0x1522bf(0xac)](_0x119510[_0x1522bf(0xb1)])));}};_0x301bc('Global',_0x225e7d),_0x301bc(_0xad34f5(0x77),_0x26e60f),console[_0xad34f5(0x9b)](),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x85)](_0xad34f5(0x8d))),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0xa6)[_0xad34f5(0xa7)](0x1e))),console[_0xad34f5(0x9b)](_0xad34f5(0x81)+(_0x33a3f1[_0xad34f5(0x6e)]||a29_0x5d7c31[_0xad34f5(0xac)]('(not\x20set)'))),console[_0xad34f5(0x9b)](_0xad34f5(0x7b)+_0x33a3f1[_0xad34f5(0x88)]);const _0x581c94=isLegacyCompatConfigKey(_0xad34f5(0xba))?a29_0x5d7c31[_0xad34f5(0x64)](_0x33a3f1[_0xad34f5(0xba)]+'\x20(legacy/compat\x20only)'):_0x33a3f1[_0xad34f5(0xba)];console['log'](_0xad34f5(0x68)+_0x581c94),console[_0xad34f5(0x9b)](_0xad34f5(0x9e)+(_0x33a3f1[_0xad34f5(0x99)]||a29_0x5d7c31[_0xad34f5(0x64)]('(none)'))),console[_0xad34f5(0x9b)](_0xad34f5(0x86)+(_0x33a3f1[_0xad34f5(0x83)]||a29_0x5d7c31['gray'](_0xad34f5(0x9f)))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x33a3f1[_0xad34f5(0x89)]||a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x7f)+DEFAULT_CONFIG_VALUES[_0xad34f5(0x89)]+')'))),console[_0xad34f5(0x9b)](_0xad34f5(0x75)+(_0x33a3f1['pageSize']??a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x6c)))),console[_0xad34f5(0x9b)](_0xad34f5(0x82)+_0x33a3f1[_0xad34f5(0xb2)]),console[_0xad34f5(0x9b)](_0xad34f5(0xae)+_0x33a3f1[_0xad34f5(0x96)]),console[_0xad34f5(0x9b)](_0xad34f5(0x6a)+AUTH_MODE['ClientAk']),console['log'](_0xad34f5(0xb4)+(_0x33a3f1['accessKey']?a29_0x5d7c31[_0xad34f5(0xb0)](_0xad34f5(0x93)+_0x33a3f1[_0xad34f5(0x76)]['length']+')'):a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x9f)))),console[_0xad34f5(0x9b)](),console[_0xad34f5(0x9b)](a29_0x5d7c31['bold'](_0xad34f5(0x7d))),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x64)]('\x20\x20─'[_0xad34f5(0xa7)](0x1e))),console[_0xad34f5(0x9b)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0xad34f5(0x9b)](_0xad34f5(0x7a)+getUserDomain()),console['log'](_0xad34f5(0x8c)+getRuntimeDomain()),console[_0xad34f5(0x9b)](),console['log'](a29_0x5d7c31[_0xad34f5(0x85)](_0xad34f5(0x78))),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x64)]('\x20\x20─'[_0xad34f5(0xa7)](0x1e)));const _0x533f08=inspectServiceRegistry();console[_0xad34f5(0x9b)](_0xad34f5(0x9a)+_0x533f08[_0xad34f5(0xa9)]),console[_0xad34f5(0x9b)](_0xad34f5(0x69)+formatServiceRegistryStatus(_0x533f08)),console[_0xad34f5(0x9b)](_0xad34f5(0x73)+_0x533f08[_0xad34f5(0x92)]),console[_0xad34f5(0x9b)](_0xad34f5(0xaf)+_0x533f08[_0xad34f5(0x7c)]);for(const _0x204014 of _0x533f08[_0xad34f5(0x90)]){console['log']('\x20\x20'+(_0x204014[_0xad34f5(0x91)]+':')['padEnd'](0x11)+'\x20'+(_0x204014[_0xad34f5(0xa3)]||a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0xad)))+'\x20('+_0x204014[_0xad34f5(0x7c)]+_0xad34f5(0x7e)),console[_0xad34f5(0x9b)]('\x20\x20'+''[_0xad34f5(0x95)](0x11)+'\x20Imported\x20from:\x20'+_0x204014['source']['path']);}return console[_0xad34f5(0x9b)](),console['log'](a29_0x5d7c31[_0xad34f5(0x85)]('\x20\x20Auth')),console[_0xad34f5(0x9b)](a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0xa6)[_0xad34f5(0xa7)](0x1e))),console[_0xad34f5(0x9b)](_0xad34f5(0x8b)+a29_0x5d7c31[_0xad34f5(0xb0)](AUTH_MODE[_0xad34f5(0xa1)]+_0xad34f5(0xb9))),console[_0xad34f5(0x9b)]('\x20\x20Session\x20check:\x20\x20\x20'+a29_0x5d7c31[_0xad34f5(0x64)](_0xad34f5(0x67))),console[_0xad34f5(0x9b)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x2c36c3){const _0x37a0c3=a29_0x1f38;if(_0x2c36c3['status']==='ok')return a29_0x5d7c31[_0x37a0c3(0xb0)](_0x37a0c3(0x84));if(_0x2c36c3[_0x37a0c3(0x66)]===_0x37a0c3(0x72))return a29_0x5d7c31[_0x37a0c3(0x64)]('(not\x20found)');if(_0x2c36c3[_0x37a0c3(0x66)]===_0x37a0c3(0x8f))return a29_0x5d7c31[_0x37a0c3(0x97)](_0x37a0c3(0x74));return a29_0x5d7c31[_0x37a0c3(0xac)]('✗\x20Invalid'+(_0x2c36c3['message']?':\x20'+_0x2c36c3[_0x37a0c3(0xb1)]:''));}export const doctorDefinition={'service':a29_0x5ddd5d(0x70),'command':a29_0x5ddd5d(0xab),'description':a29_0x5ddd5d(0x79),'risk':a29_0x5ddd5d(0x98),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x28e410=a30_0x56de;(function(_0x52b705,_0x321f53){const _0x4ec36a=a30_0x56de,_0x1213b4=_0x52b705();while(!![]){try{const _0x3df847=-parseInt(_0x4ec36a(0xf5))/0x1*(-parseInt(_0x4ec36a(0xe4))/0x2)+-parseInt(_0x4ec36a(0x102))/0x3+-parseInt(_0x4ec36a(0xda))/0x4+-parseInt(_0x4ec36a(0xe1))/0x5+-parseInt(_0x4ec36a(0xf3))/0x6*(parseInt(_0x4ec36a(0xdb))/0x7)+parseInt(_0x4ec36a(0xdd))/0x8*(-parseInt(_0x4ec36a(0xe6))/0x9)+parseInt(_0x4ec36a(0xf9))/0xa;if(_0x3df847===_0x321f53)break;else _0x1213b4['push'](_0x1213b4['shift']());}catch(_0x242ac7){_0x1213b4['push'](_0x1213b4['shift']());}}}(a30_0x5e07,0x36d9c));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x56de(_0x26d72a,_0x234645){_0x26d72a=_0x26d72a-0xda;const _0x5e0725=a30_0x5e07();let _0x56de5a=_0x5e0725[_0x26d72a];return _0x56de5a;}function a30_0x5e07(){const _0xc7c848=['2574XYgdhu','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','\x20to\x20runtime\x20app\x20','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','File','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','path','body','/client/uploadFile','filePath\x20is\x20required.','build','bool','filepath','18DsuXJx','string','10xEKTUZ','str','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','boolean','11265400DoqdIb','Path\x20to\x20the\x20local\x20file\x20to\x20upload','query-url','appCode','trim','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','filePath','upload','file','519534WZmZst','1393648cFDHHs','1687EITCpN','download','6752SAeNnC','long-term','Uploaded\x20file:\x20','description','1375125GOCefB','POST','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','27370GjRPKi','Preview:\x20upload\x20'];a30_0x5e07=function(){return _0xc7c848;};return a30_0x5e07();}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x28e410(0x101),'type':a30_0x28e410(0xf4),'required':!![],'description':a30_0x28e410(0xfa)},FILEPATH_FLAG={'name':a30_0x28e410(0xf2),'type':'string','required':!![],'description':a30_0x28e410(0xe9)},DOWNLOAD_FLAG={'name':a30_0x28e410(0xdc),'type':a30_0x28e410(0xf8),'description':a30_0x28e410(0xf7)},LONG_TERM_FLAG={'name':a30_0x28e410(0xde),'type':a30_0x28e410(0xf8),'description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x2d1435){const _0x5dd292=a30_0x28e410,_0x52f2e6=_0x2d1435[_0x5dd292(0xfd)]();if(!_0x52f2e6)throw CliErrors['validation'](_0x5dd292(0xef));return _0x52f2e6;}const fileUpload={'service':a30_0x28e410(0x101),'command':a30_0x28e410(0x100),'description':a30_0x28e410(0xe3),'risk':'write','flags':[FILE_FLAG],async 'dryRun'(_0x5ac52e){const _0x50c95f=a30_0x28e410,_0x12b365=requireRuntimeUploadFile(_0x5ac52e['str'](_0x50c95f(0x101)),'File');return dryRun(_0x50c95f(0xe2),_0x50c95f(0xee))[_0x50c95f(0xed)]({'appCode':_0x5ac52e['appCode'],'multipart':{'file':_0x12b365}})[_0x50c95f(0xe0)](_0x50c95f(0xe5)+_0x12b365['path']+_0x50c95f(0xe8)+_0x5ac52e[_0x50c95f(0xfc)])[_0x50c95f(0xf0)]();},async 'execute'(_0x3d0f3f){const _0x3c540b=a30_0x28e410,_0x48a16f=requireRuntimeUploadFile(_0x3d0f3f[_0x3c540b(0xf6)](_0x3c540b(0x101)),_0x3c540b(0xea)),_0x83e8=await uploadRuntimeFile(_0x3d0f3f['appCode'],_0x48a16f[_0x3c540b(0xec)]);return{'ok':!![],'data':_0x83e8,'message':_0x83e8[_0x3c540b(0xff)]?_0x3c540b(0xdf)+_0x83e8[_0x3c540b(0xff)]+_0x3c540b(0xe7):_0x3c540b(0xeb)};}},fileQueryUrl={'service':a30_0x28e410(0x101),'command':a30_0x28e410(0xfb),'description':a30_0x28e410(0xfe),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x1ac934){const _0x1b7487=a30_0x28e410,_0x432e67=requireFilePath(_0x1ac934[_0x1b7487(0xf6)](_0x1b7487(0xf2))),_0x19215f=await queryRuntimeFileUrl(_0x432e67,{'download':_0x1ac934['bool']('download'),'longTerm':_0x1ac934[_0x1b7487(0xf1)](_0x1b7487(0xde))});return{'ok':!![],'data':_0x19215f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x2dca36=a31_0x3c54;(function(_0x207684,_0x3e9866){const _0x17b57e=a31_0x3c54,_0x435a0e=_0x207684();while(!![]){try{const _0x18d586=parseInt(_0x17b57e(0x1c4))/0x1*(-parseInt(_0x17b57e(0x1c2))/0x2)+parseInt(_0x17b57e(0x1c6))/0x3*(-parseInt(_0x17b57e(0x1e2))/0x4)+-parseInt(_0x17b57e(0x1bf))/0x5+parseInt(_0x17b57e(0x1d5))/0x6+parseInt(_0x17b57e(0x1bc))/0x7+-parseInt(_0x17b57e(0x1ef))/0x8+parseInt(_0x17b57e(0x1cc))/0x9;if(_0x18d586===_0x3e9866)break;else _0x435a0e['push'](_0x435a0e['shift']());}catch(_0x3b7fb8){_0x435a0e['push'](_0x435a0e['shift']());}}}(a31_0x4d40,0x47ec5));import{existsSync,readFileSync}from'node:fs';function a31_0x4d40(){const _0x1816fb=['231940WXQcnT','close','129309lPFsSi','App\x20code\x20for\x20the\x20project','App\x20code\x20cannot\x20be\x20empty.','entries','object','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','12087936olFiqL','[Y/n]','\x20already\x20exists.\x20Overwrite?','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','appcode','newConfigFileName','[y/N]','name','File\x20','428784gFrEUB','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','\x0aInitialized\x20','log','defaultApp','Imported\x20from\x20','once','\x22.\x20Allowed:\x20','SIGINT','Failed\x20to\x20parse\x20source\x20file:\x20','message','User\x20aborted\x20prompt','App\x20code','32xNPtTW','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','question','validation','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`.','Write\x20to\x20global\x20(~/','removeListener','yes','string','stdout','):\x20','Override\x20imported\x20default\x20env','file','631952zNhdiD','includes','\x20\x20default:\x20','apiDir','global','\x20\x20appcode:\x20','toLowerCase','app','race','riskLevel','\x20\x20env:\x20\x20\x20\x20\x20','cwd','cancelled','trim','boolean','Source\x20file\x20not\x20found:\x20','utf8','project','Usage:\x20','\x20\x20config:\x20\x20','176855YyQiXI','join','env','1287690IjeMzT','AbortPrompt','Skip\x20confirmation\x20when\x20overwriting','4SrSdMw','parse'];a31_0x4d40=function(){return _0x1816fb;};return a31_0x4d40();}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';function a31_0x3c54(_0x4dc013,_0x36da6b){_0x4dc013=_0x4dc013-0x1b6;const _0x4d4015=a31_0x4d40();let _0x3c544d=_0x4d4015[_0x4dc013];return _0x3c544d;}export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x2dca36(0x1ea),'description':a31_0x2dca36(0x1c7)},{'name':a31_0x2dca36(0x1be),'type':'string','description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x2dca36(0x1be)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2dca36(0x1f3),'type':a31_0x2dca36(0x1b6),'description':a31_0x2dca36(0x1e7)+PRODUCT_CONFIG[a31_0x2dca36(0x1d1)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x2dca36(0x1e9),'type':a31_0x2dca36(0x1b6),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x2dca36(0x1ee),'type':'string','description':a31_0x2dca36(0x1d6),'required':!![]},{'name':a31_0x2dca36(0x1d0),'type':a31_0x2dca36(0x1ea),'description':'Override\x20imported\x20default\x20appcode'},{'name':'env','type':a31_0x2dca36(0x1ea),'description':a31_0x2dca36(0x1ed),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2dca36(0x1f3),'type':a31_0x2dca36(0x1b6),'description':a31_0x2dca36(0x1e7)+PRODUCT_CONFIG[a31_0x2dca36(0x1d1)]+')\x20instead\x20of\x20project','default':![]},{'name':'yes','type':a31_0x2dca36(0x1b6),'description':a31_0x2dca36(0x1c1),'default':![]}];export async function runInit(_0xea9d6d){const _0x5bcb05=a31_0x2dca36,_0xeabf72=isNonInteractiveMode(_0xea9d6d),_0x1c19f6=_0xea9d6d['global']?_0x5bcb05(0x1f3):_0x5bcb05(0x1b9),_0x2b355d=resolveWriteConfigPath(_0x1c19f6);try{_0xeabf72?await runNonInteractive(_0xea9d6d,_0x2b355d):await runInteractive(_0xea9d6d,_0x2b355d);}catch(_0x4ec405){if(_0x4ec405 instanceof AbortPrompt)throw CliErrors[_0x5bcb05(0x1fb)]();throw _0x4ec405;}}export async function runInitImport(_0xc70c11){const _0x33d9a2=a31_0x2dca36,_0x23697d=_0xc70c11[_0x33d9a2(0x1f3)]?_0x33d9a2(0x1f3):_0x33d9a2(0x1b9),_0xb3bdb=resolveWriteConfigPath(_0x23697d);await runFromImport(_0xc70c11,_0xb3bdb);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2dca36(0x1f2)]);async function runFromImport(_0x1dbbf7,_0xdbc40){const _0x23ef5f=a31_0x2dca36,_0x2a0b1a=resolveFilePath(_0x1dbbf7[_0x23ef5f(0x1ee)]);if(!existsSync(_0x2a0b1a))throw CliErrors[_0x23ef5f(0x1e5)](_0x23ef5f(0x1b7)+_0x2a0b1a);const _0x5cd3b7=readSourceFile(_0x2a0b1a),_0x54476d=convertToRuntimeConfig(_0x5cd3b7);_0x1dbbf7[_0x23ef5f(0x1d0)]&&(_0x54476d[_0x23ef5f(0x1d0)]=String(_0x1dbbf7['appcode']));_0x1dbbf7[_0x23ef5f(0x1be)]&&(_0x54476d[_0x23ef5f(0x1be)]=resolveInitEnv(_0x1dbbf7));if(!_0x54476d[_0x23ef5f(0x1d0)])throw CliErrors['validation'](_0x23ef5f(0x1cb),_0x23ef5f(0x1e6));await writeInitConfig(_0xdbc40,_0x54476d,_0x1dbbf7),console[_0x23ef5f(0x1d8)](_0x23ef5f(0x1da)+_0x2a0b1a),console['log'](_0x23ef5f(0x1bb)+_0xdbc40),console[_0x23ef5f(0x1d8)](_0x23ef5f(0x1f4)+_0x54476d[_0x23ef5f(0x1d0)]);if(_0x54476d[_0x23ef5f(0x1d9)])console[_0x23ef5f(0x1d8)](_0x23ef5f(0x1f1)+_0x54476d[_0x23ef5f(0x1d9)]);}function convertToRuntimeConfig(_0x4afe6f){const _0x1c08b0=a31_0x2dca36;if(_0x4afe6f['apps']&&typeof _0x4afe6f['apps']===_0x1c08b0(0x1ca))throw CliErrors[_0x1c08b0(0x1e5)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x1c08b0(0x1cf));const _0x413f98={};for(const _0x1d8203 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x4afe6f[_0x1d8203]!==undefined&&(_0x413f98[_0x1d8203]=_0x4afe6f[_0x1d8203]);}return!_0x413f98['riskLevel']&&(_0x413f98[_0x1c08b0(0x1f8)]=DEFAULT_CONFIG_VALUES[_0x1c08b0(0x1f8)]),_0x413f98;}async function runNonInteractive(_0x20919f,_0x1e37d1){const _0x3c32a3=a31_0x2dca36,_0x739a9d=_0x20919f[_0x3c32a3(0x1d0)];if(!_0x739a9d)throw CliErrors['flagMissing'](_0x3c32a3(0x1d0),_0x3c32a3(0x1ba)+CLI_BIN_NAME+_0x3c32a3(0x1e3));const _0x1941a8=resolveInitEnv(_0x20919f);await writeInitConfig(_0x1e37d1,{'appcode':_0x739a9d,'env':_0x1941a8},_0x20919f),console[_0x3c32a3(0x1d8)]('Initialized\x20'+_0x1e37d1),console[_0x3c32a3(0x1d8)](_0x3c32a3(0x1f4)+_0x739a9d),console[_0x3c32a3(0x1d8)](_0x3c32a3(0x1f9)+_0x1941a8);}async function runInteractive(_0x456034,_0x4b78b0){const _0x5eeb57=a31_0x2dca36,_0x45c4a0=loadExisting(_0x4b78b0),_0x186198=typeof _0x45c4a0?.[_0x5eeb57(0x1d0)]===_0x5eeb57(0x1ea)?_0x45c4a0[_0x5eeb57(0x1d0)]:'',_0xd8e5dd=resolveInitEnv(_0x456034);console['log'](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x5eeb57(0x1d1)]+'\x0a');if(existsSync(_0x4b78b0)&&!_0x456034[_0x5eeb57(0x1e9)]){const _0x50b635=await promptYesNo(_0x5eeb57(0x1d4)+_0x4b78b0+_0x5eeb57(0x1ce),![]);if(!_0x50b635){console[_0x5eeb57(0x1d8)]('Aborted.');return;}}const _0x7a0b68=typeof _0x456034['appcode']===_0x5eeb57(0x1ea)?_0x456034['appcode'][_0x5eeb57(0x1fc)]():'';let _0x1bf53f=_0x7a0b68;!_0x1bf53f&&(_0x1bf53f=await promptInput(_0x5eeb57(0x1e1),_0x186198));if(!_0x1bf53f[_0x5eeb57(0x1fc)]())throw CliErrors[_0x5eeb57(0x1e5)](_0x5eeb57(0x1c8));await writeInitConfig(_0x4b78b0,{'appcode':_0x1bf53f[_0x5eeb57(0x1fc)](),'env':_0xd8e5dd},_0x456034),console[_0x5eeb57(0x1d8)](_0x5eeb57(0x1d7)+_0x4b78b0),console[_0x5eeb57(0x1d8)](_0x5eeb57(0x1f4)+_0x1bf53f[_0x5eeb57(0x1fc)]()),console['log'](_0x5eeb57(0x1f9)+_0xd8e5dd);}async function writeInitConfig(_0x1629c5,_0x4ea83d,_0x205b84){const _0x46534c=a31_0x2dca36;let _0x25332e={};existsSync(_0x1629c5)&&!_0x205b84[_0x46534c(0x1e9)]&&(_0x25332e=readConfigFile(_0x1629c5));for(const [_0x1817f3,_0xbadc4a]of Object[_0x46534c(0x1c9)](_0x4ea83d)){_0xbadc4a!==undefined&&(_0x25332e[_0x1817f3]=_0xbadc4a);}if(_0x25332e[_0x46534c(0x1f6)])delete _0x25332e[_0x46534c(0x1f6)];writeConfigFile(_0x1629c5,_0x25332e);}class AbortPrompt extends Error{constructor(){const _0x301108=a31_0x2dca36;super(_0x301108(0x1e0)),this[_0x301108(0x1d3)]=_0x301108(0x1c0);}}function createSafeRl(){const _0x23f500=a31_0x2dca36,_0x1c2aef=createInterface({'input':process['stdin'],'output':process[_0x23f500(0x1eb)]});let _0x1103bb;const _0x5a4b28=new Promise((_0x42658d,_0xa0c485)=>{const _0x17cf48=_0x23f500;_0x1103bb=()=>{const _0xb1a1a6=a31_0x3c54;_0x1103bb&&(_0x1c2aef[_0xb1a1a6(0x1e8)]('SIGINT',_0x1103bb),_0x1103bb=undefined);try{_0x1c2aef[_0xb1a1a6(0x1c5)]();}catch{}_0xa0c485(new AbortPrompt());},_0x1c2aef[_0x17cf48(0x1db)](_0x17cf48(0x1dd),_0x1103bb);}),_0x5707d8=()=>{const _0x2ab67d=_0x23f500;_0x1103bb&&(_0x1c2aef['removeListener'](_0x2ab67d(0x1dd),_0x1103bb),_0x1103bb=undefined);try{_0x1c2aef[_0x2ab67d(0x1c5)]();}catch{}};return{'rl':_0x1c2aef,'abortPromise':_0x5a4b28,'disposeSuccess':_0x5707d8};}async function promptInput(_0x35a29a,_0xe0c55f){const _0x24571d=a31_0x2dca36,{rl:_0x29702c,abortPromise:_0x1f0b86,disposeSuccess:_0x4b4d1c}=createSafeRl(),_0x379e2b=new Promise(_0x4054e5=>{const _0x2e7fbe=a31_0x3c54,_0xcd0aaf=_0xe0c55f?'\x20\x20'+_0x35a29a+'\x20('+_0xe0c55f+_0x2e7fbe(0x1ec):'\x20\x20'+_0x35a29a+':\x20';_0x29702c[_0x2e7fbe(0x1e4)](_0xcd0aaf,_0x942f66=>{const _0xd2dcd7=_0x2e7fbe;_0x4b4d1c(),_0x4054e5(_0x942f66[_0xd2dcd7(0x1fc)]()||_0xe0c55f);});});return Promise[_0x24571d(0x1f7)]([_0x379e2b,_0x1f0b86]);}async function promptYesNo(_0x29ce6a,_0x46b4fa){const {rl:_0xa260e0,abortPromise:_0xe33885,disposeSuccess:_0x2d3e34}=createSafeRl(),_0x3c043f=new Promise(_0x2574df=>{const _0x30d1bb=a31_0x3c54,_0x257ade=_0x46b4fa?_0x30d1bb(0x1cd):_0x30d1bb(0x1d2);_0xa260e0['question']('\x20\x20'+_0x29ce6a+'\x20'+_0x257ade+':\x20',_0x50f420=>{const _0x472343=_0x30d1bb;_0x2d3e34();const _0x387bb0=_0x50f420[_0x472343(0x1fc)]()[_0x472343(0x1f5)]();if(_0x387bb0==='y'||_0x387bb0===_0x472343(0x1e9))_0x2574df(!![]);else{if(_0x387bb0==='n'||_0x387bb0==='no')_0x2574df(![]);else _0x2574df(_0x46b4fa);}});});return Promise['race']([_0x3c043f,_0xe33885]);}function loadExisting(_0x2e4c22){if(!existsSync(_0x2e4c22))return null;return readConfigFile(_0x2e4c22);}function resolveFilePath(_0x473c73){const _0x2d757f=a31_0x2dca36;return isAbsolute(_0x473c73)?_0x473c73:resolve(process[_0x2d757f(0x1fa)](),_0x473c73);}function readSourceFile(_0x39a8bd){const _0x21b96a=a31_0x2dca36;try{const _0x1fd2a6=readFileSync(_0x39a8bd,{'encoding':_0x21b96a(0x1b8)});return JSON[_0x21b96a(0x1c3)](_0x1fd2a6);}catch(_0x1ce8a4){throw CliErrors['validation'](_0x21b96a(0x1de)+_0x1ce8a4[_0x21b96a(0x1df)]);}}function resolveInitEnv(_0x27c289){const _0x494076=a31_0x2dca36,_0x5eed5f=_0x27c289[_0x494076(0x1be)];if(_0x5eed5f===undefined||_0x5eed5f==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x494076(0x1f0)](_0x5eed5f))throw CliErrors['validation']('Invalid\x20env\x20\x22'+_0x5eed5f+_0x494076(0x1dc)+RUNTIME_ENV_VALUES[_0x494076(0x1bd)](',\x20'));return _0x5eed5f;}
|
|
1
|
+
const a31_0x5b54d4=a31_0x5f11;(function(_0x420fd3,_0x3553d9){const _0xf9ec53=a31_0x5f11,_0x10e5e8=_0x420fd3();while(!![]){try{const _0x3f30a1=-parseInt(_0xf9ec53(0xf8))/0x1*(-parseInt(_0xf9ec53(0x135))/0x2)+-parseInt(_0xf9ec53(0x105))/0x3+parseInt(_0xf9ec53(0xff))/0x4+-parseInt(_0xf9ec53(0x106))/0x5+-parseInt(_0xf9ec53(0x107))/0x6+parseInt(_0xf9ec53(0x120))/0x7*(parseInt(_0xf9ec53(0x125))/0x8)+parseInt(_0xf9ec53(0x121))/0x9;if(_0x3f30a1===_0x3553d9)break;else _0x10e5e8['push'](_0x10e5e8['shift']());}catch(_0x4b8f82){_0x10e5e8['push'](_0x10e5e8['shift']());}}}(a31_0x5424,0xd6c29));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x5b54d4(0x133),'type':'string','description':a31_0x5b54d4(0x122)},{'name':a31_0x5b54d4(0x112),'type':a31_0x5b54d4(0x11c),'description':a31_0x5b54d4(0x11a)+DEFAULT_CONFIG_VALUES[a31_0x5b54d4(0x112)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':'boolean','description':a31_0x5b54d4(0x132)+PRODUCT_CONFIG[a31_0x5b54d4(0x11b)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x5b54d4(0x111),'type':a31_0x5b54d4(0xf7),'description':a31_0x5b54d4(0x114),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x5b54d4(0xfd),'type':'string','description':a31_0x5b54d4(0x119),'required':!![]},{'name':a31_0x5b54d4(0x133),'type':a31_0x5b54d4(0x11c),'description':a31_0x5b54d4(0x115)},{'name':a31_0x5b54d4(0x112),'type':a31_0x5b54d4(0x11c),'description':a31_0x5b54d4(0xf6),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x5b54d4(0x136),'type':a31_0x5b54d4(0xf7),'description':a31_0x5b54d4(0x132)+PRODUCT_CONFIG[a31_0x5b54d4(0x11b)]+a31_0x5b54d4(0xfc),'default':![]},{'name':a31_0x5b54d4(0x111),'type':a31_0x5b54d4(0xf7),'description':a31_0x5b54d4(0x114),'default':![]}];export async function runInit(_0x5ea89a){const _0x5f1520=a31_0x5b54d4,_0x46c85e=isNonInteractiveMode(_0x5ea89a),_0x171182=_0x5ea89a[_0x5f1520(0x136)]?_0x5f1520(0x136):_0x5f1520(0x10f),_0xe0a3fd=resolveWriteConfigPath(_0x171182);try{_0x46c85e?await runNonInteractive(_0x5ea89a,_0xe0a3fd):await runInteractive(_0x5ea89a,_0xe0a3fd);}catch(_0x57a6e8){if(_0x57a6e8 instanceof AbortPrompt)throw CliErrors[_0x5f1520(0x123)]();throw _0x57a6e8;}}export async function runInitImport(_0x2361ea){const _0x337275=a31_0x5b54d4,_0x43cfa4=_0x2361ea[_0x337275(0x136)]?_0x337275(0x136):_0x337275(0x10f),_0xaa062d=resolveWriteConfigPath(_0x43cfa4);await runFromImport(_0x2361ea,_0xaa062d);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x5b54d4(0x10b)]);async function runFromImport(_0x28a320,_0x4872dc){const _0x406e71=a31_0x5b54d4,_0x315aed=resolveFilePath(_0x28a320[_0x406e71(0xfd)]);if(!existsSync(_0x315aed))throw CliErrors[_0x406e71(0x137)](_0x406e71(0x131)+_0x315aed);const _0x210713=readSourceFile(_0x315aed),_0x9d679d=convertToRuntimeConfig(_0x210713);_0x28a320[_0x406e71(0x133)]&&(_0x9d679d['appcode']=String(_0x28a320[_0x406e71(0x133)]));_0x28a320[_0x406e71(0x112)]&&(_0x9d679d['env']=resolveInitEnv(_0x28a320));if(!_0x9d679d[_0x406e71(0x133)])throw CliErrors['validation'](_0x406e71(0x110),'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(_0x4872dc,_0x9d679d,_0x28a320),console[_0x406e71(0x12d)]('Imported\x20from\x20'+_0x315aed),console[_0x406e71(0x12d)]('\x20\x20config:\x20\x20'+_0x4872dc),console[_0x406e71(0x12d)](_0x406e71(0x127)+_0x9d679d['appcode']);if(_0x9d679d['defaultApp'])console['log'](_0x406e71(0x126)+_0x9d679d[_0x406e71(0x100)]);}function convertToRuntimeConfig(_0x40cc91){const _0x42ebd4=a31_0x5b54d4;if(_0x40cc91[_0x42ebd4(0xfa)]&&typeof _0x40cc91[_0x42ebd4(0xfa)]==='object')throw CliErrors[_0x42ebd4(0x137)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x4b11f2={};for(const _0x475361 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x40cc91[_0x475361]!==undefined&&(_0x4b11f2[_0x475361]=_0x40cc91[_0x475361]);}return!_0x4b11f2[_0x42ebd4(0x12f)]&&(_0x4b11f2['riskLevel']=DEFAULT_CONFIG_VALUES[_0x42ebd4(0x12f)]),_0x4b11f2;}async function runNonInteractive(_0x3be8a3,_0x27326e){const _0x1750e1=a31_0x5b54d4,_0x126146=_0x3be8a3[_0x1750e1(0x133)];if(!_0x126146)throw CliErrors[_0x1750e1(0x102)](_0x1750e1(0x133),_0x1750e1(0x12c)+CLI_BIN_NAME+_0x1750e1(0x109));const _0x23de8b=resolveInitEnv(_0x3be8a3);await writeInitConfig(_0x27326e,{'appcode':_0x126146,'env':_0x23de8b},_0x3be8a3),console[_0x1750e1(0x12d)](_0x1750e1(0x11f)+_0x27326e),console[_0x1750e1(0x12d)](_0x1750e1(0x127)+_0x126146),console[_0x1750e1(0x12d)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x23de8b);}async function runInteractive(_0x59861b,_0x40390c){const _0x4ab33b=a31_0x5b54d4,_0x26456a=loadExisting(_0x40390c),_0x10431c=typeof _0x26456a?.['appcode']===_0x4ab33b(0x11c)?_0x26456a[_0x4ab33b(0x133)]:'',_0xe7fb01=resolveInitEnv(_0x59861b);console['log'](CLI_BIN_NAME+_0x4ab33b(0x124)+PRODUCT_CONFIG[_0x4ab33b(0x11b)]+'\x0a');if(existsSync(_0x40390c)&&!_0x59861b['yes']){const _0x192c2b=await promptYesNo('File\x20'+_0x40390c+_0x4ab33b(0x117),![]);if(!_0x192c2b){console[_0x4ab33b(0x12d)](_0x4ab33b(0xf9));return;}}const _0x10579f=typeof _0x59861b[_0x4ab33b(0x133)]===_0x4ab33b(0x11c)?_0x59861b[_0x4ab33b(0x133)][_0x4ab33b(0x10d)]():'';let _0x33ac8b=_0x10579f;!_0x33ac8b&&(_0x33ac8b=await promptInput(_0x4ab33b(0x103),_0x10431c));if(!_0x33ac8b[_0x4ab33b(0x10d)]())throw CliErrors['validation'](_0x4ab33b(0x134));await writeInitConfig(_0x40390c,{'appcode':_0x33ac8b[_0x4ab33b(0x10d)](),'env':_0xe7fb01},_0x59861b),console['log'](_0x4ab33b(0x10a)+_0x40390c),console['log'](_0x4ab33b(0x127)+_0x33ac8b[_0x4ab33b(0x10d)]()),console[_0x4ab33b(0x12d)](_0x4ab33b(0x10c)+_0xe7fb01);}function a31_0x5424(){const _0xc087cd=['race','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','Target\x20environment\x20(default\x20','newConfigFileName','string','utf8','[Y/n]','Initialized\x20','7JlmEDP','11383092RvjJnf','App\x20code\x20for\x20the\x20project','cancelled','\x20init\x20—\x20Create\x20','178072fBAqIz','\x20\x20default:\x20','\x20\x20appcode:\x20','includes','AbortPrompt','name','close','Usage:\x20','log','cwd','riskLevel','removeListener','Source\x20file\x20not\x20found:\x20','Write\x20to\x20global\x20(~/','appcode','App\x20code\x20cannot\x20be\x20empty.','642MZXPjq','global','validation','parse','Failed\x20to\x20parse\x20source\x20file:\x20','Override\x20imported\x20default\x20env','boolean','1736PYcEfD','Aborted.','apps','[y/N]',')\x20instead\x20of\x20project','file','entries','4722372jyjqqd','defaultApp','question','flagMissing','App\x20code','stdin','2228373invAIZ','1417050ZLSQJP','6714228GnaOfW','SIGINT','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x0aInitialized\x20','apiDir','\x20\x20env:\x20\x20\x20\x20\x20','trim','Invalid\x20env\x20\x22','project','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','yes','env','stdout','Skip\x20confirmation\x20when\x20overwriting','Override\x20imported\x20default\x20appcode','app','\x20already\x20exists.\x20Overwrite?'];a31_0x5424=function(){return _0xc087cd;};return a31_0x5424();}async function writeInitConfig(_0x1aac77,_0x1dac4f,_0x58a490){const _0x5668f0=a31_0x5b54d4;let _0x14fe29={};existsSync(_0x1aac77)&&!_0x58a490[_0x5668f0(0x111)]&&(_0x14fe29=readConfigFile(_0x1aac77));for(const [_0x267ecf,_0x59dc34]of Object[_0x5668f0(0xfe)](_0x1dac4f)){_0x59dc34!==undefined&&(_0x14fe29[_0x267ecf]=_0x59dc34);}if(_0x14fe29[_0x5668f0(0x116)])delete _0x14fe29[_0x5668f0(0x116)];writeConfigFile(_0x1aac77,_0x14fe29);}class AbortPrompt extends Error{constructor(){const _0x2a2e97=a31_0x5b54d4;super('User\x20aborted\x20prompt'),this[_0x2a2e97(0x12a)]=_0x2a2e97(0x129);}}function createSafeRl(){const _0x238363=a31_0x5b54d4,_0x194019=createInterface({'input':process[_0x238363(0x104)],'output':process[_0x238363(0x113)]});let _0x117750;const _0x477178=new Promise((_0xedc184,_0x91dc6c)=>{const _0x3d4495=_0x238363;_0x117750=()=>{const _0x2227de=a31_0x5f11;_0x117750&&(_0x194019[_0x2227de(0x130)](_0x2227de(0x108),_0x117750),_0x117750=undefined);try{_0x194019[_0x2227de(0x12b)]();}catch{}_0x91dc6c(new AbortPrompt());},_0x194019['once'](_0x3d4495(0x108),_0x117750);}),_0x44a097=()=>{const _0x8fcc28=_0x238363;_0x117750&&(_0x194019['removeListener'](_0x8fcc28(0x108),_0x117750),_0x117750=undefined);try{_0x194019[_0x8fcc28(0x12b)]();}catch{}};return{'rl':_0x194019,'abortPromise':_0x477178,'disposeSuccess':_0x44a097};}async function promptInput(_0x3503df,_0x2419c6){const _0x2ee126=a31_0x5b54d4,{rl:_0x18b100,abortPromise:_0x1508e4,disposeSuccess:_0x5dd710}=createSafeRl(),_0x1ed2d3=new Promise(_0x30d502=>{const _0x420d9a=a31_0x5f11,_0x5a0bad=_0x2419c6?'\x20\x20'+_0x3503df+'\x20('+_0x2419c6+'):\x20':'\x20\x20'+_0x3503df+':\x20';_0x18b100[_0x420d9a(0x101)](_0x5a0bad,_0x56a5ac=>{const _0x55d02b=_0x420d9a;_0x5dd710(),_0x30d502(_0x56a5ac[_0x55d02b(0x10d)]()||_0x2419c6);});});return Promise[_0x2ee126(0x118)]([_0x1ed2d3,_0x1508e4]);}function a31_0x5f11(_0x10416e,_0x1c05b6){_0x10416e=_0x10416e-0xf5;const _0x542498=a31_0x5424();let _0x5f11b4=_0x542498[_0x10416e];return _0x5f11b4;}async function promptYesNo(_0x4bf353,_0x39291a){const _0x2639dd=a31_0x5b54d4,{rl:_0x49f635,abortPromise:_0x1449fb,disposeSuccess:_0x5af9e6}=createSafeRl(),_0x59d930=new Promise(_0x5f0315=>{const _0x177016=a31_0x5f11,_0x7da50f=_0x39291a?_0x177016(0x11e):_0x177016(0xfb);_0x49f635[_0x177016(0x101)]('\x20\x20'+_0x4bf353+'\x20'+_0x7da50f+':\x20',_0x54e27c=>{const _0x1b93ec=_0x177016;_0x5af9e6();const _0x510422=_0x54e27c[_0x1b93ec(0x10d)]()['toLowerCase']();if(_0x510422==='y'||_0x510422===_0x1b93ec(0x111))_0x5f0315(!![]);else{if(_0x510422==='n'||_0x510422==='no')_0x5f0315(![]);else _0x5f0315(_0x39291a);}});});return Promise[_0x2639dd(0x118)]([_0x59d930,_0x1449fb]);}function loadExisting(_0x54cf05){if(!existsSync(_0x54cf05))return null;return readConfigFile(_0x54cf05);}function resolveFilePath(_0x25008b){const _0x91bd7d=a31_0x5b54d4;return isAbsolute(_0x25008b)?_0x25008b:resolve(process[_0x91bd7d(0x12e)](),_0x25008b);}function readSourceFile(_0x309a18){const _0x18ed16=a31_0x5b54d4;try{const _0x89bb58=readFileSync(_0x309a18,{'encoding':_0x18ed16(0x11d)});return JSON[_0x18ed16(0x138)](_0x89bb58);}catch(_0x30b38f){throw CliErrors[_0x18ed16(0x137)](_0x18ed16(0xf5)+_0x30b38f['message']);}}function resolveInitEnv(_0x5536d0){const _0x25d4ac=a31_0x5b54d4,_0x4f69f5=_0x5536d0[_0x25d4ac(0x112)];if(_0x4f69f5===undefined||_0x4f69f5==='')return DEFAULT_CONFIG_VALUES[_0x25d4ac(0x112)];if(!RUNTIME_ENV_VALUES[_0x25d4ac(0x128)](_0x4f69f5))throw CliErrors[_0x25d4ac(0x137)](_0x25d4ac(0x10e)+_0x4f69f5+'\x22.\x20Allowed:\x20'+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x4f69f5;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x33542e=a32_0x1d02;(function(_0x3f87b9,_0x1bf006){const _0x93ef7f=a32_0x1d02,_0x114783=_0x3f87b9();while(!![]){try{const _0x583fbf=parseInt(_0x93ef7f(0x193))/0x1+-parseInt(_0x93ef7f(0x195))/0x2+parseInt(_0x93ef7f(0x192))/0x3+parseInt(_0x93ef7f(0x1be))/0x4*(parseInt(_0x93ef7f(0x18b))/0x5)+-parseInt(_0x93ef7f(0x1af))/0x6+parseInt(_0x93ef7f(0x1b1))/0x7+-parseInt(_0x93ef7f(0x18d))/0x8;if(_0x583fbf===_0x1bf006)break;else _0x114783['push'](_0x114783['shift']());}catch(_0x5a768c){_0x114783['push'](_0x114783['shift']());}}}(a32_0x44bc,0x6edc8));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a32_0x44bc(){const _0x898d9d=['ragStatus','file','1973550ysWBnv','594871lAIgkd','validation','1472226dfMoBT','scope','updateTime','version','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','File\x20path\x20is\x20required.','map','description','topk','File\x20is\x20not\x20a\x20regular\x20file:\x20','length','score','isFile','ragErrorMessage','bool','str','Override\x20the\x20existing\x20entry\x20title','createTime','verbose','query','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','POST','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','list','build','Personal\x20knowledge-base\x20entry\x20ID','161838CLYmie','write','2611441dIVgBS','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','trim','appCode','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','utf8','num','userId','string','/client/knowledge-base/personal/create','/client/knowledge-base/personal/','number','content','92RNopjR','search','metadata','File\x20not\x20found:\x20','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','--topk\x20must\x20be\x20a\x20positive\x20number.','flag','title','detail','76655iKEmdq','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','6089784nKkkwz','create','body'];a32_0x44bc=function(){return _0x898d9d;};return a32_0x44bc();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x33542e(0x189),'type':a32_0x33542e(0x1b9),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x33542e(0x191),'type':a32_0x33542e(0x1b9),'required':!![],'description':a32_0x33542e(0x1b2)},QUERY_FLAG={'name':'query','type':'string','required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x33542e(0x19d),'type':a32_0x33542e(0x1bc),'description':a32_0x33542e(0x199)};function readKnowledgeFile(_0x533ea1){const _0x1be4ab=a32_0x33542e;if(!_0x533ea1)throw CliErrors['validation'](_0x1be4ab(0x19a));if(!existsSync(_0x533ea1))throw CliErrors['validation'](_0x1be4ab(0x1c1)+_0x533ea1);if(!statSync(_0x533ea1)[_0x1be4ab(0x1a1)]())throw CliErrors[_0x1be4ab(0x194)](_0x1be4ab(0x19e)+_0x533ea1);return readFileSync(_0x533ea1,_0x1be4ab(0x1b6));}function summarizePersonalItem(_0x368ec2){const _0x37dfc1=a32_0x33542e;return{'id':_0x368ec2['id'],'title':_0x368ec2[_0x37dfc1(0x189)],'version':_0x368ec2[_0x37dfc1(0x198)],'ragStatus':_0x368ec2[_0x37dfc1(0x190)],'ragErrorMessage':_0x368ec2[_0x37dfc1(0x1a2)],'updateTime':_0x368ec2['updateTime']};}function detailPersonalItem(_0x1e304c){const _0x1167f6=a32_0x33542e;return{'id':_0x1e304c['id'],'appCode':_0x1e304c[_0x1167f6(0x1b4)],'scope':_0x1e304c[_0x1167f6(0x196)],'userId':_0x1e304c[_0x1167f6(0x1b8)],'title':_0x1e304c['title'],'content':_0x1e304c[_0x1167f6(0x1bd)]??'','version':_0x1e304c[_0x1167f6(0x198)],'ragStatus':_0x1e304c['ragStatus'],'ragErrorMessage':_0x1e304c[_0x1167f6(0x1a2)],'createTime':_0x1e304c[_0x1167f6(0x1a6)],'updateTime':_0x1e304c[_0x1167f6(0x197)]};}function summarizeSearchHit(_0x3d6c42){const _0x3a8c01=a32_0x33542e;return{'scope':_0x3d6c42[_0x3a8c01(0x196)],'title':_0x3d6c42[_0x3a8c01(0x189)],'docId':_0x3d6c42['docId'],'score':_0x3d6c42[_0x3a8c01(0x1a0)],'weightedScore':_0x3d6c42['weightedScore'],'content':_0x3d6c42[_0x3a8c01(0x1bd)],'metadata':_0x3d6c42[_0x3a8c01(0x1c0)]};}function readTopK(_0x406463){const _0x4bfdf8=a32_0x33542e,_0x46c96d=_0x406463[_0x4bfdf8(0x188)](_0x4bfdf8(0x19d));if(_0x46c96d===undefined||_0x46c96d===null||_0x46c96d==='')return undefined;const _0x2f8ada=_0x406463['num']('topk');if(!Number['isFinite'](_0x2f8ada)||_0x2f8ada<0x1)throw CliErrors[_0x4bfdf8(0x194)](_0x4bfdf8(0x187));return _0x2f8ada;}function a32_0x1d02(_0x5480e2,_0x492f3f){_0x5480e2=_0x5480e2-0x187;const _0x44bcde=a32_0x44bc();let _0x1d0277=_0x44bcde[_0x5480e2];return _0x1d0277;}const kbList={'service':'kb','command':a32_0x33542e(0x1ac),'description':a32_0x33542e(0x1a9),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x409d3f){const _0x59da07=a32_0x33542e,_0x5280d6=await listPersonalKnowledgeBaseItems(_0x409d3f[_0x59da07(0x1b4)]);if(_0x409d3f[_0x59da07(0x1a3)](_0x59da07(0x1a7)))return{'ok':!![],'data':{'total':_0x5280d6[_0x59da07(0x19f)],'items':_0x5280d6}};return{'ok':!![],'data':{'total':_0x5280d6[_0x59da07(0x19f)],'items':_0x5280d6[_0x59da07(0x19b)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x33542e(0x18a),'description':a32_0x33542e(0x1c2),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x33542e(0x1ae)}],async 'execute'(_0x2130d8){const _0x54a402=a32_0x33542e,_0x51140d=await getPersonalKnowledgeBaseItem(_0x2130d8[_0x54a402(0x1b7)]('id'),_0x2130d8[_0x54a402(0x1b4)]);return{'ok':!![],'data':detailPersonalItem(_0x51140d)};}},kbCreate={'service':'kb','command':a32_0x33542e(0x18e),'description':a32_0x33542e(0x18c),'risk':a32_0x33542e(0x1b0),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x16102e){const _0x68d89d=a32_0x33542e,_0x9b4bf=_0x16102e[_0x68d89d(0x1a4)]('title'),_0x2aa14e=readKnowledgeFile(_0x16102e[_0x68d89d(0x1a4)](_0x68d89d(0x191))),_0x409451=await createPersonalKnowledgeBaseItem(_0x16102e['appCode'],{'title':_0x9b4bf,'content':_0x2aa14e});return{'ok':!![],'data':summarizePersonalItem(_0x409451),'message':'Created\x20KB\x20entry\x20'+_0x409451['id']+'\x20('+_0x409451[_0x68d89d(0x189)]+')'};},async 'dryRun'(_0x5c243d){const _0x4b7f5e=a32_0x33542e,_0x2a5363=_0x5c243d[_0x4b7f5e(0x1a4)](_0x4b7f5e(0x189)),_0x539e4a=readKnowledgeFile(_0x5c243d[_0x4b7f5e(0x1a4)](_0x4b7f5e(0x191)));return dryRun('POST',_0x4b7f5e(0x1ba))[_0x4b7f5e(0x18f)]({'appCode':_0x5c243d[_0x4b7f5e(0x1b4)],'title':_0x2a5363,'content':_0x539e4a})[_0x4b7f5e(0x19c)](_0x4b7f5e(0x1b5)+_0x2a5363+'\x22')[_0x4b7f5e(0x1ad)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x33542e(0x1ab),'risk':a32_0x33542e(0x1b0),'flags':[{...ID_FLAG,'description':a32_0x33542e(0x1ae)},{...TITLE_FLAG,'required':![],'description':a32_0x33542e(0x1a5)},FILE_FLAG],async 'execute'(_0x2a122b){const _0x29ebc0=a32_0x33542e,_0x13a3d0=_0x2a122b['num']('id'),_0x415c0c=readKnowledgeFile(_0x2a122b[_0x29ebc0(0x1a4)]('file')),_0x323215=_0x2a122b[_0x29ebc0(0x1a4)]('title')||(await getPersonalKnowledgeBaseItem(_0x13a3d0,_0x2a122b[_0x29ebc0(0x1b4)]))['title'],_0x1c2440=await updatePersonalKnowledgeBaseItem(_0x13a3d0,_0x2a122b['appCode'],{'title':_0x323215,'content':_0x415c0c});return{'ok':!![],'data':summarizePersonalItem(_0x1c2440),'message':'Updated\x20KB\x20entry\x20'+_0x1c2440['id']+'\x20('+_0x1c2440[_0x29ebc0(0x189)]+')'};},async 'dryRun'(_0x2baa62){const _0x6796df=a32_0x33542e,_0x390b1e=_0x2baa62['num']('id'),_0x1de8a6=readKnowledgeFile(_0x2baa62['str'](_0x6796df(0x191))),_0x2ab96a=_0x2baa62['str'](_0x6796df(0x189))||(await getPersonalKnowledgeBaseItem(_0x390b1e,_0x2baa62['appCode']))[_0x6796df(0x189)];return dryRun(_0x6796df(0x1aa),_0x6796df(0x1bb)+_0x390b1e+'/update')['body']({'appCode':_0x2baa62[_0x6796df(0x1b4)],'title':_0x2ab96a,'content':_0x1de8a6})[_0x6796df(0x19c)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x390b1e)[_0x6796df(0x1ad)]();}},kbSearch={'service':'kb','command':a32_0x33542e(0x1bf),'description':'Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','risk':'read','flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x1e2e78){const _0x330c5b=a32_0x33542e;if(!_0x1e2e78[_0x330c5b(0x1a4)](_0x330c5b(0x1a8))[_0x330c5b(0x1b3)]())throw CliErrors[_0x330c5b(0x194)]('Search\x20query\x20is\x20required.');readTopK(_0x1e2e78);},async 'execute'(_0x4d30ce){const _0x4b99ec=a32_0x33542e,_0x150a1f=_0x4d30ce[_0x4b99ec(0x1a4)]('query')[_0x4b99ec(0x1b3)](),_0x4bf3b6=readTopK(_0x4d30ce),_0x2d0e68=await searchKnowledgeBase(_0x4d30ce[_0x4b99ec(0x1b4)],{'query':_0x150a1f,'topK':_0x4bf3b6});return{'ok':!![],'data':{'total':_0x2d0e68[_0x4b99ec(0x19f)],'hits':_0x2d0e68[_0x4b99ec(0x19b)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x2c8c2a=a33_0x2368;(function(_0x3026a3,_0x465c7a){const _0xf9f2f1=a33_0x2368,_0x430d28=_0x3026a3();while(!![]){try{const _0x7fb68a=parseInt(_0xf9f2f1(0x6f))/0x1*(parseInt(_0xf9f2f1(0x65))/0x2)+-parseInt(_0xf9f2f1(0x78))/0x3*(-parseInt(_0xf9f2f1(0x86))/0x4)+parseInt(_0xf9f2f1(0x84))/0x5+parseInt(_0xf9f2f1(0x75))/0x6+-parseInt(_0xf9f2f1(0x77))/0x7+-parseInt(_0xf9f2f1(0x6b))/0x8*(parseInt(_0xf9f2f1(0x87))/0x9)+-parseInt(_0xf9f2f1(0x7c))/0xa;if(_0x7fb68a===_0x465c7a)break;else _0x430d28['push'](_0x430d28['shift']());}catch(_0x4ab028){_0x430d28['push'](_0x430d28['shift']());}}}(a33_0x1867,0xdaf2b));import{logger}from'../../utils/logger.js';function a33_0x2368(_0x205178,_0x2548a8){_0x205178=_0x205178-0x64;const _0x1867a6=a33_0x1867();let _0x236844=_0x1867a6[_0x205178];return _0x236844;}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x2626f1){const _0x35fd1b=a33_0x2368;if(_0x2626f1[_0x35fd1b(0x6c)]===0x0){console['log'](_0x35fd1b(0x7e));return;}console[_0x35fd1b(0x83)]('*\x20'+CLI_DISPLAY_NAME+_0x35fd1b(0x74)),_0x2626f1[_0x35fd1b(0x6e)]((_0x3c9e83,_0x50a17f)=>{const _0x1abd63=_0x35fd1b,_0x590743=new Date(_0x3c9e83['timestamp'])[_0x1abd63(0x81)]('en-US'),_0x272676=_0x3c9e83[_0x1abd63(0x85)]===_0x1abd63(0x7a)?'√':_0x3c9e83['level']===_0x1abd63(0x6d)?'×':_0x3c9e83[_0x1abd63(0x85)]===_0x1abd63(0x80)?'!':'i';console[_0x1abd63(0x83)](_0x50a17f+0x1+'.\x20'+_0x272676+'\x20['+_0x3c9e83[_0x1abd63(0x7f)]+']\x20'+_0x3c9e83[_0x1abd63(0x7d)]),console[_0x1abd63(0x83)](_0x1abd63(0x69)+_0x590743),_0x3c9e83[_0x1abd63(0x6a)]&&console['log'](_0x1abd63(0x67)+_0x3c9e83['duration']+'ms'),_0x3c9e83[_0x1abd63(0x66)]&&Object[_0x1abd63(0x76)](_0x3c9e83['details'])['length']>0x0&&console[_0x1abd63(0x83)](_0x1abd63(0x68)+JSON['stringify'](_0x3c9e83['details'],null,0x2)),console['log']('');});}function a33_0x1867(){const _0x70be17=['2543850yEWXVh','*\x20Logs\x20cleared','13516EMyens','details','\x20\x20\x20Duration:\x20','\x20\x20\x20Details:\x20','\x20\x20\x20Time:\x20','duration','8kUVOXG','length','error','forEach','236EPZFYz','write','show','logs','readLogs','\x20logs:\x0a','1893876uvWNGL','keys','11161626IVFzeV','39dLDsZc','View\x20command\x20history\x20logs','success','clearLogs','16850490NjWATU','message','*\x20No\x20logs\x20found','command','warn','toLocaleString','read','log','5365360sIAOPF','level','453976pyapgX'];a33_0x1867=function(){return _0x70be17;};return a33_0x1867();}export const logsDefinitions=[{'service':a33_0x2c8c2a(0x72),'command':a33_0x2c8c2a(0x71),'description':a33_0x2c8c2a(0x79),'risk':a33_0x2c8c2a(0x82),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xbc3297){const _0x11d714=a33_0x2c8c2a;return printLogs(logger[_0x11d714(0x73)]()),{'ok':!![]};}},{'service':a33_0x2c8c2a(0x72),'command':'clear','description':'Clear\x20command\x20history\x20logs','risk':a33_0x2c8c2a(0x70),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b011f){const _0x429b68=a33_0x2c8c2a;return logger[_0x429b68(0x7b)](),console['log'](_0x429b68(0x64)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a34_0x32345f=a34_0x1667;(function(_0x34f06a,_0x564518){const _0x2ef896=a34_0x1667,_0x35cb31=_0x34f06a();while(!![]){try{const _0x292612=-parseInt(_0x2ef896(0x134))/0x1*(-parseInt(_0x2ef896(0x132))/0x2)+-parseInt(_0x2ef896(0x12a))/0x3+parseInt(_0x2ef896(0x131))/0x4+-parseInt(_0x2ef896(0x11d))/0x5*(parseInt(_0x2ef896(0x107))/0x6)+parseInt(_0x2ef896(0x11c))/0x7+parseInt(_0x2ef896(0x124))/0x8+-parseInt(_0x2ef896(0x103))/0x9;if(_0x292612===_0x564518)break;else _0x35cb31['push'](_0x35cb31['shift']());}catch(_0x27624e){_0x35cb31['push'](_0x35cb31['shift']());}}}(a34_0x25a2,0x94d30));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=['invoice',a34_0x32345f(0x118),a34_0x32345f(0x119),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a34_0x32345f(0x116),'form':a34_0x32345f(0x120),'idCard':'IdCard'},SCENE_FLAG={'name':'scene','type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x32345f(0x10c)},IMAGE_FILE_FLAG={'name':a34_0x32345f(0x123),'type':a34_0x32345f(0x100),'description':a34_0x32345f(0x112)},IMAGE_URL_FLAG={'name':'image-url','type':a34_0x32345f(0x100),'description':a34_0x32345f(0x12b)};function normalizeScene(_0xb6c6ea){const _0x4d9fb5=a34_0x32345f,_0x1b563a=_0xb6c6ea[_0x4d9fb5(0x130)]()['toLowerCase']();if(_0x1b563a===_0x4d9fb5(0x127))return _0x4d9fb5(0x11a);if(_0x1b563a===_0x4d9fb5(0x101)||_0x1b563a==='general'||_0x1b563a===_0x4d9fb5(0x119))return _0x1b563a;throw CliErrors['validation']('Unsupported\x20OCR\x20scene:\x20'+_0xb6c6ea+_0x4d9fb5(0x102)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0xef87b2){const _0x2d9196=a34_0x32345f,_0x24dad7=_0xef87b2[_0x2d9196(0x11f)]('image-file')[_0x2d9196(0x130)](),_0x15313c=_0xef87b2[_0x2d9196(0x11f)](_0x2d9196(0x113))['trim']();return{'imageFile':_0x24dad7,'imageUrl':_0x15313c,'count':[_0x24dad7,_0x15313c][_0x2d9196(0x126)](Boolean)['length']};}function a34_0x1667(_0x28688c,_0x27f3ae){_0x28688c=_0x28688c-0x100;const _0x25a23c=a34_0x25a2();let _0x166711=_0x25a23c[_0x28688c];return _0x166711;}function validateInputSelection(_0x7dad10){const _0x54482d=a34_0x32345f,_0x4df5aa=selectedInputs(_0x7dad10);if(_0x4df5aa[_0x54482d(0x121)]!==0x1)throw CliErrors[_0x54482d(0x11e)](_0x54482d(0x110));return _0x4df5aa;}function withScene(_0x5e6a06,_0x915a6e,_0x5cbb78){const _0x4239ec=a34_0x32345f;return{..._0x5e6a06,'scene':_0x915a6e,..._0x5cbb78?{'sourceFile':{'fileName':_0x5cbb78[_0x4239ec(0x114)],'filePath':_0x5cbb78[_0x4239ec(0x133)]}}:{}};}const ocrRecognize={'service':a34_0x32345f(0x128),'command':'recognize','description':a34_0x32345f(0x10a),'risk':a34_0x32345f(0x129),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x246154){const _0x243b73=a34_0x32345f,_0x33cfee=normalizeScene(_0x246154[_0x243b73(0x11f)](_0x243b73(0x10f))),_0x527275=SCENE_TO_LEGACY_TYPE[_0x33cfee],_0x519c8c=validateInputSelection(_0x246154);if(_0x519c8c[_0x243b73(0x115)])return dryRun('POST',_0x243b73(0x10e))[_0x243b73(0x12c)]({'appCode':_0x246154[_0x243b73(0x111)],'url':_0x519c8c[_0x243b73(0x115)],'type':_0x527275})['description'](_0x243b73(0x122)+_0x33cfee+_0x243b73(0x105))['build']();const _0xe8d2f=requireRuntimeUploadFile(_0x519c8c[_0x243b73(0x12e)],_0x243b73(0x123));return dryRun(_0x243b73(0x10d),_0x243b73(0x104))[_0x243b73(0x12c)]({'steps':[{'method':_0x243b73(0x10d),'url':_0x243b73(0x104),'body':{'appCode':_0x246154['appCode'],'multipart':{'file':_0xe8d2f}}},{'method':_0x243b73(0x10d),'url':'/client/queryFileUrl','body':{'filePath':'<filePath\x20returned\x20by\x20/client/uploadFile>','downloadFlag':![]}},{'method':_0x243b73(0x10d),'url':_0x243b73(0x10e),'body':{'appCode':_0x246154['appCode'],'url':_0x243b73(0x10b),'type':_0x527275}}]})[_0x243b73(0x109)](_0x243b73(0x108)+_0x33cfee+_0x243b73(0x125))[_0x243b73(0x12f)]();},async 'execute'(_0x4ad5d){const _0x9ad5fd=a34_0x32345f,_0x396389=normalizeScene(_0x4ad5d['str']('scene')),_0x1c0eaf=SCENE_TO_LEGACY_TYPE[_0x396389],_0x3a1e3c=validateInputSelection(_0x4ad5d);if(_0x3a1e3c[_0x9ad5fd(0x115)]){const _0x215a11=await recognizeRuntimeOcr(_0x4ad5d[_0x9ad5fd(0x111)],{'url':_0x3a1e3c[_0x9ad5fd(0x115)],'type':_0x1c0eaf});return{'ok':!![],'data':withScene(_0x215a11,_0x396389)};}const _0x9ad9f=requireRuntimeUploadFile(_0x3a1e3c[_0x9ad5fd(0x12e)],'image-file'),_0x360d22=await uploadRuntimeFile(_0x4ad5d[_0x9ad5fd(0x111)],_0x9ad9f['path']);if(!_0x360d22['filePath'])throw CliErrors['apiError'](_0x9ad5fd(0x11b));const _0x30696f=await queryRuntimeFileUrl(_0x360d22['filePath'],{'download':![]});if(!_0x30696f[_0x9ad5fd(0x12d)])throw CliErrors[_0x9ad5fd(0x117)](_0x9ad5fd(0x106));const _0x554ca5=await recognizeRuntimeOcr(_0x4ad5d[_0x9ad5fd(0x111)],{'url':_0x30696f[_0x9ad5fd(0x12d)],'type':_0x1c0eaf});return{'ok':!![],'data':withScene(_0x554ca5,_0x396389,_0x360d22)};}};function a34_0x25a2(){const _0x249535=['write','1473339xaWVkx','Publicly\x20accessible\x20image\x20or\x20file\x20URL','body','fileUrl','imageFile','build','trim','1214020LSeCJb','2104636JgGGDA','filePath','1MzVWkl','string','invoice','.\x20Supported\x20scenes:\x20','2037870PAFHes','/client/uploadFile','\x20OCR\x20from\x20URL','File\x20URL\x20response\x20missing\x20fileUrl.','348186LmhjBZ','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','description','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','POST','/client/ocr','scene','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','appCode','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','image-url','fileName','imageUrl','General','apiError','general','form','idCard','File\x20upload\x20response\x20missing\x20filePath.','6217512gojjKF','80LQjnhv','validation','str','Table','count','Preview:\x20recognize\x20','image-file','92672dLknIF','\x20OCR','filter','idcard','ocr'];a34_0x25a2=function(){return _0x249535;};return a34_0x25a2();}export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x537a6c=a35_0x821a;(function(_0x2e5421,_0x50f54e){const _0xf40080=a35_0x821a,_0x2cad4e=_0x2e5421();while(!![]){try{const _0x29475e=-parseInt(_0xf40080(0x122))/0x1*(parseInt(_0xf40080(0x133))/0x2)+parseInt(_0xf40080(0x121))/0x3+-parseInt(_0xf40080(0x146))/0x4*(-parseInt(_0xf40080(0x139))/0x5)+parseInt(_0xf40080(0x12c))/0x6*(parseInt(_0xf40080(0x118))/0x7)+-parseInt(_0xf40080(0x14f))/0x8*(-parseInt(_0xf40080(0x128))/0x9)+parseInt(_0xf40080(0x147))/0xa*(-parseInt(_0xf40080(0x141))/0xb)+parseInt(_0xf40080(0x155))/0xc*(-parseInt(_0xf40080(0x152))/0xd);if(_0x29475e===_0x50f54e)break;else _0x2cad4e['push'](_0x2cad4e['shift']());}catch(_0x3f14a3){_0x2cad4e['push'](_0x2cad4e['shift']());}}}(a35_0x5dfc,0xf1278));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';function a35_0x5dfc(){const _0x3ef240=['Preview:\x20update\x20personal\x20BFF\x20','str','functionName','createUserId','write','812488EMmzeL','file','version','1963AntcAP','Preview:\x20create\x20personal\x20BFF\x20','File\x20path\x20is\x20required.','174240nMuswz','updateTime','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','verbose','/client/runtime-bff/personal/','personal-bff','POST','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','sourceSessionId','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','File\x20not\x20found:\x20','3811437TbRZdy','validation','createTime','length','source-session-id','/update','trim','high-risk-write','detail','3990267QPgEMN','47jStXJl','scriptContent','map','Show\x20one\x20personal\x20BFF\x20by\x20id','File\x20is\x20not\x20a\x20regular\x20file:\x20','flag','99VLAUdW','body','Personal\x20BFF\x20description','Updated\x20personal\x20BFF\x20','6aPbxOy','gmtCreate','Created\x20personal\x20BFF\x20','name','isFile','bool','read','26830msgrDV','appCode','exec','string','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','2346865YcCoRI','num','Personal\x20BFF\x20script\x20ID','config','scriptType','Optional\x20source\x20RuntimeAgent\x20session\x20id','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','params','465718nZqBgu','Personal\x20BFF\x20script\x20file\x20is\x20blank.','gmtModified','description','Update\x20a\x20personal\x20BFF\x20by\x20id','16vNPsMs','250hKTEMT','utf8','isArray'];a35_0x5dfc=function(){return _0x3ef240;};return a35_0x5dfc();}const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x537a6c(0x150),'type':'string','description':a35_0x537a6c(0x116)},FUNCTION_NAME_FLAG={'name':a35_0x537a6c(0x12f),'type':a35_0x537a6c(0x136),'required':!![],'description':a35_0x537a6c(0x137)},DESCRIPTION_FLAG={'name':a35_0x537a6c(0x144),'type':'string','description':a35_0x537a6c(0x12a)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0x537a6c(0x13e)};function normalizeFunctionName(_0x3cfd93){const _0x3afb71=a35_0x537a6c,_0x3c830b=String(_0x3cfd93||'')[_0x3afb71(0x11e)]();if(!_0x3c830b||!FUNCTION_NAME_PATTERN['test'](_0x3c830b))throw CliErrors['validation'](_0x3afb71(0x157));return _0x3c830b;}function readScriptFile(_0x77b329){const _0x270186=a35_0x537a6c;if(!_0x77b329)throw CliErrors[_0x270186(0x119)](_0x270186(0x154));if(!existsSync(_0x77b329))throw CliErrors[_0x270186(0x119)](_0x270186(0x117)+_0x77b329);if(!statSync(_0x77b329)[_0x270186(0x130)]())throw CliErrors[_0x270186(0x119)](_0x270186(0x126)+_0x77b329);const _0x4fa53e=readFileSync(_0x77b329,_0x270186(0x148));if(!_0x4fa53e['trim']())throw CliErrors[_0x270186(0x119)](_0x270186(0x142));return _0x4fa53e;}function a35_0x821a(_0x14a5b9,_0xd553dd){_0x14a5b9=_0x14a5b9-0x110;const _0x5dfc7f=a35_0x5dfc();let _0x821aa=_0x5dfc7f[_0x14a5b9];return _0x821aa;}function optionalTrimmed(_0x2e67bb){const _0x548b93=String(_0x2e67bb||'')['trim']();return _0x548b93||undefined;}function summarizeBff(_0x490d8b){const _0x56fb17=a35_0x537a6c;return{'id':_0x490d8b['id'],'appCode':_0x490d8b[_0x56fb17(0x134)],'functionName':_0x490d8b[_0x56fb17(0x14c)],'description':_0x490d8b['description'],'scriptType':_0x490d8b[_0x56fb17(0x13d)],'version':_0x490d8b[_0x56fb17(0x151)],'gmtModified':_0x490d8b[_0x56fb17(0x143)],'updateTime':_0x490d8b[_0x56fb17(0x156)]};}function detailBff(_0x529260){const _0x348bcc=a35_0x537a6c;return{'id':_0x529260['id'],'appCode':_0x529260[_0x348bcc(0x134)],'functionName':_0x529260[_0x348bcc(0x14c)],'description':_0x529260[_0x348bcc(0x144)],'scriptType':_0x529260[_0x348bcc(0x13d)],'scriptContent':_0x529260[_0x348bcc(0x123)]??'','config':_0x529260[_0x348bcc(0x13c)],'version':_0x529260[_0x348bcc(0x151)],'createUserId':_0x529260[_0x348bcc(0x14d)],'gmtCreate':_0x529260[_0x348bcc(0x12d)],'gmtModified':_0x529260[_0x348bcc(0x143)],'createTime':_0x529260[_0x348bcc(0x11a)],'updateTime':_0x529260[_0x348bcc(0x156)]};}function buildCreateInput(_0x22c7be){const _0x598bcc=a35_0x537a6c;return{'functionName':normalizeFunctionName(_0x22c7be[_0x598bcc(0x14b)](_0x598bcc(0x12f))),...optionalTrimmed(_0x22c7be['str'](_0x598bcc(0x144)))?{'description':optionalTrimmed(_0x22c7be[_0x598bcc(0x14b)](_0x598bcc(0x144)))}:{},'scriptContent':readScriptFile(_0x22c7be[_0x598bcc(0x14b)](_0x598bcc(0x150))),...optionalTrimmed(_0x22c7be[_0x598bcc(0x14b)](_0x598bcc(0x11c)))?{'sourceSessionId':optionalTrimmed(_0x22c7be[_0x598bcc(0x14b)]('source-session-id'))}:{}};}function buildUpdateInput(_0x514054){const _0x44be62=a35_0x537a6c,_0x550a6d={};optionalTrimmed(_0x514054[_0x44be62(0x14b)](_0x44be62(0x12f)))&&(_0x550a6d['functionName']=normalizeFunctionName(_0x514054[_0x44be62(0x14b)]('name')));_0x514054[_0x44be62(0x127)](_0x44be62(0x144))!==undefined&&(_0x550a6d[_0x44be62(0x144)]=_0x514054[_0x44be62(0x14b)](_0x44be62(0x144)));optionalTrimmed(_0x514054[_0x44be62(0x14b)](_0x44be62(0x150)))&&(_0x550a6d[_0x44be62(0x123)]=readScriptFile(_0x514054['str'](_0x44be62(0x150))));_0x514054[_0x44be62(0x127)](_0x44be62(0x11c))!==undefined&&(_0x550a6d[_0x44be62(0x115)]=_0x514054[_0x44be62(0x14b)]('source-session-id'));if(Object['keys'](_0x550a6d)[_0x44be62(0x11b)]===0x0)throw CliErrors[_0x44be62(0x119)]('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x550a6d;}function parseExecParams(_0x30a1b7){const _0x2a2808=a35_0x537a6c,_0x3d61a5=parseJsonParams(_0x30a1b7)??{};if(Array[_0x2a2808(0x149)](_0x3d61a5))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x3d61a5;}const personalBffList={'service':a35_0x537a6c(0x112),'command':'list','description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x49df0a){const _0x5b51c3=a35_0x537a6c,_0x40ed83=await listPersonalBffs(_0x49df0a[_0x5b51c3(0x134)]);return{'ok':!![],'data':{'total':_0x40ed83[_0x5b51c3(0x11b)],'items':_0x49df0a[_0x5b51c3(0x131)](_0x5b51c3(0x110))?_0x40ed83:_0x40ed83[_0x5b51c3(0x124)](summarizeBff)}};}},personalBffDetail={'service':a35_0x537a6c(0x112),'command':a35_0x537a6c(0x120),'description':a35_0x537a6c(0x125),'risk':a35_0x537a6c(0x132),'flags':[{...ID_FLAG,'description':a35_0x537a6c(0x13b)}],async 'execute'(_0x39a2c8){const _0x593f3e=a35_0x537a6c,_0x4c74d3=await getPersonalBff(_0x39a2c8[_0x593f3e(0x13a)]('id'),_0x39a2c8[_0x593f3e(0x134)]);return{'ok':!![],'data':detailBff(_0x4c74d3)};}},personalBffCreate={'service':a35_0x537a6c(0x112),'command':'create','description':a35_0x537a6c(0x114),'risk':a35_0x537a6c(0x14e),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x36b7bc){const _0x5f567f=a35_0x537a6c,_0x391e10=buildCreateInput(_0x36b7bc),_0x4747a3=await createPersonalBff(_0x36b7bc[_0x5f567f(0x134)],_0x391e10);return{'ok':!![],'data':detailBff(_0x4747a3),'message':_0x5f567f(0x12e)+_0x4747a3['id']+(_0x4747a3['functionName']?'\x20('+_0x4747a3[_0x5f567f(0x14c)]+')':'')};},async 'dryRun'(_0xc906aa){const _0x83303f=a35_0x537a6c,_0x598923=buildCreateInput(_0xc906aa);return dryRun(_0x83303f(0x113),'/client/runtime-bff/personal/create')[_0x83303f(0x129)]({'appCode':_0xc906aa['appCode'],..._0x598923})['description'](_0x83303f(0x153)+_0x598923['functionName'])['build']();}},personalBffUpdate={'service':'personal-bff','command':'update','description':a35_0x537a6c(0x145),'risk':a35_0x537a6c(0x14e),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x32fa40){const _0x3a39cc=a35_0x537a6c,_0x12fd02=_0x32fa40[_0x3a39cc(0x13a)]('id'),_0x2bb0bf=buildUpdateInput(_0x32fa40),_0x45ed00=await updatePersonalBff(_0x12fd02,_0x32fa40[_0x3a39cc(0x134)],_0x2bb0bf);return{'ok':!![],'data':detailBff(_0x45ed00),'message':_0x3a39cc(0x12b)+_0x45ed00['id']+(_0x45ed00[_0x3a39cc(0x14c)]?'\x20('+_0x45ed00[_0x3a39cc(0x14c)]+')':'')};},async 'dryRun'(_0x2ea337){const _0x12d824=a35_0x537a6c,_0x815341=_0x2ea337['num']('id'),_0xbfec27=buildUpdateInput(_0x2ea337);return dryRun(_0x12d824(0x113),_0x12d824(0x111)+_0x815341+_0x12d824(0x11d))[_0x12d824(0x129)]({'appCode':_0x2ea337[_0x12d824(0x134)],..._0xbfec27})[_0x12d824(0x144)](_0x12d824(0x14a)+_0x815341)['build']();}},personalBffExec={'service':'personal-bff','command':a35_0x537a6c(0x135),'description':a35_0x537a6c(0x13f),'risk':a35_0x537a6c(0x11f),'flags':[{...ID_FLAG,'description':a35_0x537a6c(0x13b)},{...PARAMS_FLAG,'description':a35_0x537a6c(0x138)}],async 'validate'(_0x181a4b){const _0x2d6e41=a35_0x537a6c;parseExecParams(_0x181a4b[_0x2d6e41(0x14b)](_0x2d6e41(0x140)));},async 'execute'(_0x208d88){const _0x154bfe=a35_0x537a6c,_0x4545f7=_0x208d88[_0x154bfe(0x13a)]('id'),_0x4915ed=parseExecParams(_0x208d88[_0x154bfe(0x14b)](_0x154bfe(0x140))),_0xd06cd0=await executePersonalBff(_0x4545f7,_0x208d88['appCode'],_0x4915ed);return{'ok':!![],'data':{'result':_0xd06cd0},'message':'Executed\x20personal\x20BFF\x20'+_0x4545f7};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x2a786e=a35_0x3254;(function(_0x35c149,_0x27dfa1){const _0x2fde04=a35_0x3254,_0x1caa45=_0x35c149();while(!![]){try{const _0x1a7ef5=parseInt(_0x2fde04(0xee))/0x1*(-parseInt(_0x2fde04(0x100))/0x2)+-parseInt(_0x2fde04(0xf0))/0x3+parseInt(_0x2fde04(0x110))/0x4*(parseInt(_0x2fde04(0xfa))/0x5)+parseInt(_0x2fde04(0x125))/0x6+-parseInt(_0x2fde04(0xfb))/0x7*(parseInt(_0x2fde04(0x10e))/0x8)+-parseInt(_0x2fde04(0xfc))/0x9*(parseInt(_0x2fde04(0x111))/0xa)+parseInt(_0x2fde04(0xe7))/0xb;if(_0x1a7ef5===_0x27dfa1)break;else _0x1caa45['push'](_0x1caa45['shift']());}catch(_0x4a1069){_0x1caa45['push'](_0x1caa45['shift']());}}}(a35_0x864a,0xba37f));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x3254(_0x4ceb70,_0x489e38){_0x4ceb70=_0x4ceb70-0xe4;const _0x864a9d=a35_0x864a();let _0x3254af=_0x864a9d[_0x4ceb70];return _0x3254af;}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_0x2a786e(0x123),'type':a35_0x2a786e(0xf2),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x2a786e(0xeb),'type':a35_0x2a786e(0xf2),'required':!![],'description':'Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders'},DESCRIPTION_FLAG={'name':'description','type':a35_0x2a786e(0xf2),'description':a35_0x2a786e(0x106)},SOURCE_SESSION_FLAG={'name':a35_0x2a786e(0x126),'type':a35_0x2a786e(0xf2),'description':a35_0x2a786e(0xf9)};function normalizeFunctionName(_0x82207b){const _0x2a4680=a35_0x2a786e,_0x17ed96=String(_0x82207b||'')[_0x2a4680(0x11b)]();if(!_0x17ed96||!FUNCTION_NAME_PATTERN[_0x2a4680(0xf6)](_0x17ed96))throw CliErrors['validation'](_0x2a4680(0x122));return _0x17ed96;}function readScriptFile(_0x40c655){const _0xcf4d62=a35_0x2a786e;if(!_0x40c655)throw CliErrors[_0xcf4d62(0xf3)](_0xcf4d62(0x116));if(!existsSync(_0x40c655))throw CliErrors[_0xcf4d62(0xf3)]('File\x20not\x20found:\x20'+_0x40c655);if(!statSync(_0x40c655)['isFile']())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x40c655);const _0x1f6508=readFileSync(_0x40c655,_0xcf4d62(0x112));if(!_0x1f6508[_0xcf4d62(0x11b)]())throw CliErrors['validation']('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x1f6508;}function optionalTrimmed(_0x24960a){const _0x20999b=String(_0x24960a||'')['trim']();return _0x20999b||undefined;}function a35_0x864a(){const _0x1991f3=['update','Optional\x20source\x20RuntimeAgent\x20session\x20id','181820ICmMko','922908reFeJT','423PfhGNI','Show\x20one\x20personal\x20BFF\x20by\x20id','map','updateTime','148qeaiqF','exec','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','body','write','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','Personal\x20BFF\x20description','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','POST','gmtModified','personal-bff','scriptType','length','8Xpwlfy','createUserId','52lfifsv','96290ntkMeS','utf8','str','--params\x20must\x20be\x20a\x20JSON\x20object.','/client/runtime-bff/personal/','File\x20path\x20is\x20required.','Executed\x20personal\x20BFF\x20','version','gmtCreate','config','trim','keys','Preview:\x20update\x20personal\x20BFF\x20','Preview:\x20create\x20personal\x20BFF\x20','params','functionName','sourceSessionId','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','file','Update\x20a\x20personal\x20BFF\x20by\x20id','5363904CuopGa','source-session-id','build','Updated\x20personal\x20BFF\x20','list','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','7824509NeCaea','create','scriptContent','Personal\x20BFF\x20script\x20ID','name','description','verbose','2185GXSXgj','appCode','1707561gNblFF','read','string','validation','bool','flag','test','num'];a35_0x864a=function(){return _0x1991f3;};return a35_0x864a();}function summarizeBff(_0x1908b0){const _0x4e5b3f=a35_0x2a786e;return{'id':_0x1908b0['id'],'appCode':_0x1908b0[_0x4e5b3f(0xef)],'functionName':_0x1908b0[_0x4e5b3f(0x120)],'description':_0x1908b0[_0x4e5b3f(0xec)],'scriptType':_0x1908b0[_0x4e5b3f(0x10c)],'version':_0x1908b0['version'],'gmtModified':_0x1908b0[_0x4e5b3f(0x10a)],'updateTime':_0x1908b0[_0x4e5b3f(0xff)]};}function detailBff(_0x22afe2){const _0xa09fd4=a35_0x2a786e;return{'id':_0x22afe2['id'],'appCode':_0x22afe2['appCode'],'functionName':_0x22afe2[_0xa09fd4(0x120)],'description':_0x22afe2['description'],'scriptType':_0x22afe2[_0xa09fd4(0x10c)],'scriptContent':_0x22afe2['scriptContent']??'','config':_0x22afe2[_0xa09fd4(0x11a)],'version':_0x22afe2[_0xa09fd4(0x118)],'createUserId':_0x22afe2[_0xa09fd4(0x10f)],'gmtCreate':_0x22afe2[_0xa09fd4(0x119)],'gmtModified':_0x22afe2[_0xa09fd4(0x10a)],'createTime':_0x22afe2['createTime'],'updateTime':_0x22afe2[_0xa09fd4(0xff)]};}function buildCreateInput(_0x4e2230){const _0x1dd9cf=a35_0x2a786e;return{'functionName':normalizeFunctionName(_0x4e2230[_0x1dd9cf(0x113)]('name')),...optionalTrimmed(_0x4e2230[_0x1dd9cf(0x113)]('description'))?{'description':optionalTrimmed(_0x4e2230[_0x1dd9cf(0x113)](_0x1dd9cf(0xec)))}:{},'scriptContent':readScriptFile(_0x4e2230[_0x1dd9cf(0x113)](_0x1dd9cf(0x123))),...optionalTrimmed(_0x4e2230[_0x1dd9cf(0x113)](_0x1dd9cf(0x126)))?{'sourceSessionId':optionalTrimmed(_0x4e2230['str']('source-session-id'))}:{}};}function buildUpdateInput(_0x30ab84){const _0x34126d=a35_0x2a786e,_0x2c6f8c={};optionalTrimmed(_0x30ab84[_0x34126d(0x113)]('name'))&&(_0x2c6f8c[_0x34126d(0x120)]=normalizeFunctionName(_0x30ab84[_0x34126d(0x113)](_0x34126d(0xeb))));_0x30ab84[_0x34126d(0xf5)](_0x34126d(0xec))!==undefined&&(_0x2c6f8c[_0x34126d(0xec)]=_0x30ab84['str']('description'));optionalTrimmed(_0x30ab84[_0x34126d(0x113)](_0x34126d(0x123)))&&(_0x2c6f8c[_0x34126d(0xe9)]=readScriptFile(_0x30ab84['str']('file')));_0x30ab84['flag']('source-session-id')!==undefined&&(_0x2c6f8c[_0x34126d(0x121)]=_0x30ab84[_0x34126d(0x113)](_0x34126d(0x126)));if(Object[_0x34126d(0x11c)](_0x2c6f8c)[_0x34126d(0x10d)]===0x0)throw CliErrors['validation'](_0x34126d(0x107));return _0x2c6f8c;}function parseExecParams(_0x5c9bbc){const _0x1b1049=a35_0x2a786e,_0x386c83=parseJsonParams(_0x5c9bbc)??{};if(Array['isArray'](_0x386c83))throw CliErrors['validation'](_0x1b1049(0x114));return _0x386c83;}const personalBffList={'service':a35_0x2a786e(0x10b),'command':a35_0x2a786e(0xe5),'description':a35_0x2a786e(0xe6),'risk':a35_0x2a786e(0xf1),'flags':[VERBOSE_FLAG],async 'execute'(_0x5caa52){const _0x4006ea=a35_0x2a786e,_0x140497=await listPersonalBffs(_0x5caa52['appCode']);return{'ok':!![],'data':{'total':_0x140497[_0x4006ea(0x10d)],'items':_0x5caa52[_0x4006ea(0xf4)](_0x4006ea(0xed))?_0x140497:_0x140497[_0x4006ea(0xfe)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':'detail','description':a35_0x2a786e(0xfd),'risk':a35_0x2a786e(0xf1),'flags':[{...ID_FLAG,'description':a35_0x2a786e(0xea)}],async 'execute'(_0x43171e){const _0x11cab5=a35_0x2a786e,_0x47d490=await getPersonalBff(_0x43171e[_0x11cab5(0xf7)]('id'),_0x43171e[_0x11cab5(0xef)]);return{'ok':!![],'data':detailBff(_0x47d490)};}},personalBffCreate={'service':a35_0x2a786e(0x10b),'command':a35_0x2a786e(0xe8),'description':a35_0x2a786e(0x105),'risk':a35_0x2a786e(0x104),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x381b46){const _0x31be55=a35_0x2a786e,_0x408010=buildCreateInput(_0x381b46),_0x409bf5=await createPersonalBff(_0x381b46['appCode'],_0x408010);return{'ok':!![],'data':detailBff(_0x409bf5),'message':'Created\x20personal\x20BFF\x20'+_0x409bf5['id']+(_0x409bf5[_0x31be55(0x120)]?'\x20('+_0x409bf5[_0x31be55(0x120)]+')':'')};},async 'dryRun'(_0x54ad7b){const _0x40614c=a35_0x2a786e,_0x4d360e=buildCreateInput(_0x54ad7b);return dryRun(_0x40614c(0x109),'/client/runtime-bff/personal/create')['body']({'appCode':_0x54ad7b[_0x40614c(0xef)],..._0x4d360e})[_0x40614c(0xec)](_0x40614c(0x11e)+_0x4d360e[_0x40614c(0x120)])[_0x40614c(0x127)]();}},personalBffUpdate={'service':a35_0x2a786e(0x10b),'command':a35_0x2a786e(0xf8),'description':a35_0x2a786e(0x124),'risk':a35_0x2a786e(0x104),'flags':[{...ID_FLAG,'description':a35_0x2a786e(0xea)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x36c762){const _0x19eb01=a35_0x2a786e,_0x23bf6f=_0x36c762[_0x19eb01(0xf7)]('id'),_0x1fbe39=buildUpdateInput(_0x36c762),_0x1d86d6=await updatePersonalBff(_0x23bf6f,_0x36c762['appCode'],_0x1fbe39);return{'ok':!![],'data':detailBff(_0x1d86d6),'message':_0x19eb01(0xe4)+_0x1d86d6['id']+(_0x1d86d6['functionName']?'\x20('+_0x1d86d6[_0x19eb01(0x120)]+')':'')};},async 'dryRun'(_0x19f2d0){const _0x3aaeee=a35_0x2a786e,_0x383795=_0x19f2d0[_0x3aaeee(0xf7)]('id'),_0x494eb1=buildUpdateInput(_0x19f2d0);return dryRun('POST',_0x3aaeee(0x115)+_0x383795+'/update')[_0x3aaeee(0x103)]({'appCode':_0x19f2d0['appCode'],..._0x494eb1})['description'](_0x3aaeee(0x11d)+_0x383795)[_0x3aaeee(0x127)]();}},personalBffExec={'service':a35_0x2a786e(0x10b),'command':a35_0x2a786e(0x101),'description':a35_0x2a786e(0x108),'risk':'high-risk-write','flags':[{...ID_FLAG,'description':a35_0x2a786e(0xea)},{...PARAMS_FLAG,'description':a35_0x2a786e(0x102)}],async 'validate'(_0x1c92e7){const _0x56ee20=a35_0x2a786e;parseExecParams(_0x1c92e7[_0x56ee20(0x113)](_0x56ee20(0x11f)));},async 'execute'(_0x833669){const _0x40b114=a35_0x2a786e,_0x41dfce=_0x833669[_0x40b114(0xf7)]('id'),_0x334adb=parseExecParams(_0x833669[_0x40b114(0x113)](_0x40b114(0x11f))),_0xd4e642=await executePersonalBff(_0x41dfce,_0x833669['appCode'],_0x334adb);return{'ok':!![],'data':{'result':_0xd4e642},'message':_0x40b114(0x117)+_0x41dfce};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x171eec=a36_0x1fe6;(function(_0x13e0cc,_0x4a5bbf){const _0x1a9aa1=a36_0x1fe6,_0x13c5d3=_0x13e0cc();while(!![]){try{const _0x486e93=parseInt(_0x1a9aa1(0x180))/0x1+-parseInt(_0x1a9aa1(0x175))/0x2*(-parseInt(_0x1a9aa1(0x164))/0x3)+-parseInt(_0x1a9aa1(0x169))/0x4*(-parseInt(_0x1a9aa1(0x17c))/0x5)+parseInt(_0x1a9aa1(0x179))/0x6*(-parseInt(_0x1a9aa1(0x167))/0x7)+-parseInt(_0x1a9aa1(0x16e))/0x8+parseInt(_0x1a9aa1(0x16c))/0x9+parseInt(_0x1a9aa1(0x16d))/0xa;if(_0x486e93===_0x4a5bbf)break;else _0x13c5d3['push'](_0x13c5d3['shift']());}catch(_0x5a2e85){_0x13c5d3['push'](_0x13c5d3['shift']());}}}(a36_0x5765,0x5c9fc));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';function a36_0x1fe6(_0x47afda,_0x50a716){_0x47afda=_0x47afda-0x159;const _0x576579=a36_0x5765();let _0x1fe602=_0x576579[_0x47afda];return _0x1fe602;}import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];function a36_0x5765(){const _0x2ace1e=['Instant\x20API','Agent\x20Schedules','2146131WOWSqd','5784810mCbCpH','5840832vJoPlc','service','read','get','install','Workspace','command','307778pcMWzo','Service\x20Tree','\x20\x20[write]','Knowledge\x20Base','65694YYBeoG','set','Artifacts','15SCRehO','CLI\x20Built-in\x20Skill','risk','show','280161WNGlPv','Skills','isSingleCommand','has','values','Logs','from','list','App\x20Management','Configuration','\x20\x20[high-risk-write]','push','File','Authentication','6dUIJLy','run','OCR','371wWnMWs','description','379880KHPJkk'];a36_0x5765=function(){return _0x2ace1e;};return a36_0x5765();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x42cd07){const _0x1fa3b1=a36_0x1fe6;for(const _0x3749ae of _0x42cd07){definitions[_0x1fa3b1(0x17a)](_0x3749ae[_0x1fa3b1(0x16f)]+':'+_0x3749ae[_0x1fa3b1(0x174)],_0x3749ae);let _0x37243d=serviceGroups[_0x1fa3b1(0x171)](_0x3749ae[_0x1fa3b1(0x16f)]);!_0x37243d&&(_0x37243d=[],serviceGroups['set'](_0x3749ae[_0x1fa3b1(0x16f)],_0x37243d)),_0x37243d['push'](_0x3749ae);}}function registerService(_0x496b97,_0x3d8af8,_0x3114ea){const _0x1cee62=a36_0x1fe6;registerDefinitions(_0x3d8af8);const _0x4e80dc=_0x5e9115=>_0x5e9115===_0x1cee62(0x170)?'':_0x5e9115==='write'?_0x1cee62(0x177):_0x1cee62(0x160),_0x5ec0c8={'service':_0x3d8af8[0x0][_0x1cee62(0x16f)],'label':_0x496b97,'commands':_0x3d8af8['map'](_0x85608c=>({'command':_0x85608c[_0x1cee62(0x174)],'description':_0x85608c[_0x1cee62(0x168)],'tag':_0x4e80dc(_0x85608c[_0x1cee62(0x17e)])})),'defaultCommand':_0x3114ea?.['defaultCommand']??(_0x3114ea?.['isSingleCommand']?_0x3d8af8[0x0]['command']:undefined),'isSingleCommand':_0x3114ea?.[_0x1cee62(0x182)]};serviceRegistry[_0x1cee62(0x161)](_0x5ec0c8),serviceByName[_0x1cee62(0x17a)](_0x5ec0c8[_0x1cee62(0x16f)],_0x5ec0c8);}registerService(a36_0x171eec(0x163),authDefinitions,{'defaultCommand':'login'}),registerService(a36_0x171eec(0x15e),appDefinitions,{'defaultCommand':a36_0x171eec(0x15d)}),registerService(a36_0x171eec(0x173),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x171eec(0x15f),configDefinitions,{'defaultCommand':a36_0x171eec(0x15d)}),registerService('API\x20Documentation',apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x171eec(0x16a),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService('BFF\x20Scripts',bffDefinitions),registerService('Personal\x20BFF',personalBffDefinitions),registerService(a36_0x171eec(0x17b),artifactDefinitions),registerService(a36_0x171eec(0x162),fileDefinitions),registerService(a36_0x171eec(0x166),ocrDefinitions),registerService(a36_0x171eec(0x178),kbDefinitions),registerService(a36_0x171eec(0x16b),scheduleDefinitions,{'defaultCommand':a36_0x171eec(0x15d)}),registerService(a36_0x171eec(0x176),serviceDefinitions,{'defaultCommand':a36_0x171eec(0x15d)}),registerService(a36_0x171eec(0x181),skillDefinitions,{'defaultCommand':a36_0x171eec(0x172)}),registerService(a36_0x171eec(0x17d),cliSkillDefinitions,{'defaultCommand':a36_0x171eec(0x172)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x171eec(0x165),'isSingleCommand':!![]}),registerService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerService('Schema',[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x171eec(0x15b),logsDefinitions,{'defaultCommand':a36_0x171eec(0x17f)});export function findDefinition(_0x50412f,_0x3b62bc){const _0x33ec29=a36_0x171eec;return definitions[_0x33ec29(0x171)](_0x50412f+':'+_0x3b62bc);}export function isKnownService(_0x4a5b60){const _0x5581ab=a36_0x171eec;return serviceByName[_0x5581ab(0x159)](_0x4a5b60);}export function getServiceEntry(_0x337ac4){const _0xb37f90=a36_0x171eec;return serviceByName[_0xb37f90(0x171)](_0x337ac4);}export function getAllDefinitions(){const _0x220447=a36_0x171eec;return Array[_0x220447(0x15c)](definitions[_0x220447(0x15a)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x5efa81=a37_0x57f1;(function(_0x436796,_0x5abc9b){const _0x3dbbfb=a37_0x57f1,_0x10c7c0=_0x436796();while(!![]){try{const _0x195665=parseInt(_0x3dbbfb(0xb1))/0x1*(parseInt(_0x3dbbfb(0x91))/0x2)+-parseInt(_0x3dbbfb(0x97))/0x3*(parseInt(_0x3dbbfb(0x95))/0x4)+-parseInt(_0x3dbbfb(0xa2))/0x5*(-parseInt(_0x3dbbfb(0xcc))/0x6)+-parseInt(_0x3dbbfb(0x88))/0x7+-parseInt(_0x3dbbfb(0x92))/0x8+parseInt(_0x3dbbfb(0xc5))/0x9+parseInt(_0x3dbbfb(0xca))/0xa*(parseInt(_0x3dbbfb(0xaa))/0xb);if(_0x195665===_0x5abc9b)break;else _0x10c7c0['push'](_0x10c7c0['shift']());}catch(_0x40b898){_0x10c7c0['push'](_0x10c7c0['shift']());}}}(a37_0x3e8f,0x68788));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a37_0x57f1(_0x28c83a,_0x3ed20f){_0x28c83a=_0x28c83a-0x88;const _0x3e8fd7=a37_0x3e8f();let _0x57f197=_0x3e8fd7[_0x28c83a];return _0x57f197;}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_0x5efa81(0xb7),'type':'string','required':!![],'enum':[a37_0x5efa81(0xa6),a37_0x5efa81(0xc8)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':'cron','type':'string','description':a37_0x5efa81(0x8c)},SCHEDULED_AT_FLAG={'name':a37_0x5efa81(0xa9),'type':a37_0x5efa81(0xae),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a37_0x5efa81(0xb6),'type':a37_0x5efa81(0xae),'required':!![],'description':a37_0x5efa81(0x8a)},PROMPT_FLAG={'name':a37_0x5efa81(0xa7),'type':a37_0x5efa81(0xae),'required':!![],'description':a37_0x5efa81(0xb0)},CHANNEL_FLAG={'name':a37_0x5efa81(0xbd),'type':a37_0x5efa81(0xae),'enum':[a37_0x5efa81(0x8b),a37_0x5efa81(0x98)],'default':a37_0x5efa81(0x98),'description':a37_0x5efa81(0x8f)},SCHEDULE_ID_FLAG={'name':a37_0x5efa81(0xc3),'type':a37_0x5efa81(0xae),'required':!![],'description':a37_0x5efa81(0xb9),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a37_0x5efa81(0x9a),'type':a37_0x5efa81(0x89),'default':0x14,'description':a37_0x5efa81(0xd0)},CURSOR_FLAG={'name':'cursor','type':'string','description':a37_0x5efa81(0xbf)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x3cb31d){const _0x45a483=a37_0x5efa81,_0x5aac14=_0x3cb31d[_0x45a483(0xac)](_0x45a483(0xb7)),_0x5bc459=_0x3cb31d[_0x45a483(0xac)](_0x45a483(0xb6))[_0x45a483(0xb2)](),_0xa111c3=_0x3cb31d[_0x45a483(0xac)](_0x45a483(0xa7))['trim'](),_0x2ffb61=_0x3cb31d['str'](_0x45a483(0xbd)),_0x3c7166=_0x3cb31d['str'](_0x45a483(0xbe)),_0x4d86c6=_0x3cb31d[_0x45a483(0xac)](_0x45a483(0xa9));if(!_0x5bc459)throw CliErrors[_0x45a483(0x99)](_0x45a483(0xc7));if(!_0xa111c3)throw CliErrors[_0x45a483(0x99)](_0x45a483(0x8e));if(_0x5aac14===_0x45a483(0xa6)){if(!_0x3c7166||_0x4d86c6)throw CliErrors['validation'](_0x45a483(0xb4));return{'kind':_0x5aac14,'timezone':_0x45a483(0xa5),'cron':_0x3c7166,'title':_0x5bc459,'prompt':_0xa111c3,'channel':_0x2ffb61};}if(_0x5aac14==='ONCE'){if(!_0x4d86c6||_0x3c7166)throw CliErrors[_0x45a483(0x99)](_0x45a483(0xa3));return{'kind':_0x5aac14,'timezone':_0x45a483(0xa5),'scheduledAt':_0x4d86c6,'title':_0x5bc459,'prompt':_0xa111c3,'channel':_0x2ffb61};}throw CliErrors[_0x45a483(0x99)](_0x45a483(0xaf));}function scheduleCollectionPath(_0x58ffae){const _0x3daa9f=a37_0x5efa81;return _0x3daa9f(0xc1)+encodeURIComponent(_0x58ffae)+_0x3daa9f(0x8d);}function a37_0x3e8f(){const _0xa1b693=['CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','title','kind','DELETE','Schedule\x20UUID','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','Queued\x20Task\x20','\x20from\x20schedule\x20','channel','cron','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','num','/api/harness/apps/','body','schedule-id','POST','293670kvIMDM','appCode','--title\x20must\x20not\x20be\x20blank.','ONCE','scheduleId','3974470vBhzez','schedule','18LYqHaZ','high-risk-write','Preview:\x20run\x20schedule\x20','Schedule\x20input\x20is\x20valid','Page\x20size\x20from\x201\x20to\x20100','/run','Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','build','run','4141879mLSxye','number','Schedule\x20title','auto','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','/schedules','--prompt\x20must\x20not\x20be\x20blank.','Task\x20channel:\x20auto\x20or\x20premium','create','913642kvaEzb','584360oiuDfC','cursor','read','4PPbZlm','description','761211CxftHP','premium','validation','limit','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','detail','Created\x20','list','delete','\x20immediately','\x20schedule\x20','103410nnDhgE','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','taskId','UTC','CRON','prompt','Deleted\x20schedule\x20','scheduled-at','22QsPPmK','validate','str','Show\x20one\x20schedule\x20by\x20schedule\x20ID','string','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','1NPpTzw','trim','length'];a37_0x3e8f=function(){return _0xa1b693;};return a37_0x3e8f();}function scheduleItemPath(_0x293602,_0x351300){return scheduleCollectionPath(_0x293602)+'/'+encodeURIComponent(_0x351300);}const scheduleValidate={'service':a37_0x5efa81(0xcb),'command':a37_0x5efa81(0xab),'description':'Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','risk':a37_0x5efa81(0x94),'flags':INPUT_FLAGS,async 'validate'(_0x3131ab){readScheduleInput(_0x3131ab);},async 'execute'(_0x621a16){const _0x499713=a37_0x5efa81,_0x3246da=readScheduleInput(_0x621a16),_0x1a3b46=await validateRuntimeSchedule(_0x621a16[_0x499713(0xc6)],_0x3246da);return{'ok':!![],'data':_0x1a3b46,'message':_0x499713(0xcf)};}},scheduleCreate={'service':a37_0x5efa81(0xcb),'command':a37_0x5efa81(0x90),'description':a37_0x5efa81(0x9b),'risk':a37_0x5efa81(0xcd),'flags':INPUT_FLAGS,async 'validate'(_0x4683c4){readScheduleInput(_0x4683c4);},async 'execute'(_0x197d65){const _0x4e16db=a37_0x5efa81,_0x252fbd=readScheduleInput(_0x197d65),_0x3e96ff=await validateRuntimeSchedule(_0x197d65['appCode'],_0x252fbd),_0x2f13b9=await createRuntimeSchedule(_0x197d65['appCode'],_0x3e96ff);return{'ok':!![],'data':_0x2f13b9,'message':_0x4e16db(0x9d)+_0x2f13b9[_0x4e16db(0xb7)]+_0x4e16db(0xa1)+_0x2f13b9[_0x4e16db(0xc9)]};},async 'dryRun'(_0x18dfb0){const _0x5a33d7=a37_0x5efa81,_0x5b7ab8=readScheduleInput(_0x18dfb0);return dryRun(_0x5a33d7(0xc4),scheduleCollectionPath(_0x18dfb0[_0x5a33d7(0xc6)]))[_0x5a33d7(0xc2)](_0x5b7ab8)[_0x5a33d7(0x96)]('Preview:\x20create\x20an\x20Agent\x20schedule')[_0x5a33d7(0xd3)]();}},scheduleList={'service':'schedule','command':a37_0x5efa81(0x9e),'description':a37_0x5efa81(0xb5),'risk':a37_0x5efa81(0x94),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x3ff31a){const _0x148405=a37_0x5efa81,_0x121089=_0x3ff31a[_0x148405(0xc0)](_0x148405(0x9a));if(!Number['isSafeInteger'](_0x121089)||_0x121089<0x1||_0x121089>0x64)throw CliErrors[_0x148405(0x99)](_0x148405(0xba));const _0x5300bf=_0x3ff31a[_0x148405(0xac)](_0x148405(0x93));if(_0x5300bf&&(_0x5300bf[_0x148405(0xb3)]>0x400||_0x5300bf[_0x148405(0xb2)]()!==_0x5300bf))throw CliErrors['validation']('--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.');},async 'execute'(_0x4b505b){const _0x3fa18a=a37_0x5efa81,_0xf7b6c1=_0x4b505b[_0x3fa18a(0xac)](_0x3fa18a(0x93)),_0x4bc369=await listRuntimeSchedules(_0x4b505b[_0x3fa18a(0xc6)],{'limit':_0x4b505b[_0x3fa18a(0xc0)](_0x3fa18a(0x9a)),..._0xf7b6c1?{'cursor':_0xf7b6c1}:{}});return{'ok':!![],'data':_0x4bc369};}},scheduleDetail={'service':a37_0x5efa81(0xcb),'command':a37_0x5efa81(0x9c),'description':a37_0x5efa81(0xad),'risk':a37_0x5efa81(0x94),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x19a073){const _0x3afcd9=a37_0x5efa81,_0x47eec2=await getRuntimeSchedule(_0x19a073[_0x3afcd9(0xc6)],_0x19a073[_0x3afcd9(0xac)](_0x3afcd9(0xc3)));return{'ok':!![],'data':_0x47eec2};}},scheduleRun={'service':a37_0x5efa81(0xcb),'command':a37_0x5efa81(0xd4),'description':'Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','risk':a37_0x5efa81(0xcd),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3682d7){const _0x580c79=a37_0x5efa81,_0x39d9c5=_0x3682d7[_0x580c79(0xac)](_0x580c79(0xc3)),_0x583880=await runRuntimeSchedule(_0x3682d7[_0x580c79(0xc6)],_0x39d9c5);return{'ok':!![],'data':_0x583880,'message':_0x580c79(0xbb)+_0x583880[_0x580c79(0xa4)]+_0x580c79(0xbc)+_0x39d9c5};},async 'dryRun'(_0x31cfcc){const _0x416090=a37_0x5efa81,_0x20c701=_0x31cfcc['str']('schedule-id');return dryRun(_0x416090(0xc4),scheduleItemPath(_0x31cfcc['appCode'],_0x20c701)+_0x416090(0xd1))[_0x416090(0x96)](_0x416090(0xce)+_0x20c701+_0x416090(0xa0))['build']();}},scheduleDelete={'service':'schedule','command':a37_0x5efa81(0x9f),'description':a37_0x5efa81(0xd2),'risk':'high-risk-write','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x658368){const _0x273d4d=a37_0x5efa81,_0x20f21b=_0x658368[_0x273d4d(0xac)]('schedule-id'),_0x3ed705=await deleteRuntimeSchedule(_0x658368['appCode'],_0x20f21b);return{'ok':!![],'data':_0x3ed705,'message':_0x273d4d(0xa8)+_0x20f21b};},async 'dryRun'(_0x2f4a9c){const _0x5a12a5=a37_0x5efa81,_0x2c2299=_0x2f4a9c[_0x5a12a5(0xac)]('schedule-id');return dryRun(_0x5a12a5(0xb8),scheduleItemPath(_0x2f4a9c[_0x5a12a5(0xc6)],_0x2c2299))[_0x5a12a5(0x96)]('Preview:\x20delete\x20schedule\x20'+_0x2c2299)[_0x5a12a5(0xd3)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x1b3536=a38_0x4e4c;function a38_0x4e4c(_0x547652,_0x455fc6){_0x547652=_0x547652-0xae;const _0x497b6a=a38_0x497b();let _0x4e4c00=_0x497b6a[_0x547652];return _0x4e4c00;}function a38_0x497b(){const _0x31723c=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','export','3691128QtOncp','9YDNvmT','4138296VIbuTp','1358096nnGoke','5evEbXt','7vdUYQC','6209514CMHfzr','schema','1369772XOcZHu','1256681ByPEHB','37213180uEKWxG'];a38_0x497b=function(){return _0x31723c;};return a38_0x497b();}(function(_0x5ae01e,_0xe01728){const _0xea803=a38_0x4e4c,_0x529fe8=_0x5ae01e();while(!![]){try{const _0x4657d7=-parseInt(_0xea803(0xb8))/0x1+-parseInt(_0xea803(0xb7))/0x2+-parseInt(_0xea803(0xaf))/0x3+parseInt(_0xea803(0xb2))/0x4*(-parseInt(_0xea803(0xb3))/0x5)+parseInt(_0xea803(0xb5))/0x6+parseInt(_0xea803(0xb4))/0x7*(-parseInt(_0xea803(0xb1))/0x8)+-parseInt(_0xea803(0xb0))/0x9*(-parseInt(_0xea803(0xb9))/0xa);if(_0x4657d7===_0xe01728)break;else _0x529fe8['push'](_0x529fe8['shift']());}catch(_0x344c21){_0x529fe8['push'](_0x529fe8['shift']());}}}(a38_0x497b,0xb19bb));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x36cc45){const _0x28e414=await buildSchemaPayload();return{'ok':!![],'data':_0x28e414};}export const schemaDefinition={'service':a38_0x1b3536(0xb6),'command':a38_0x1b3536(0xae),'description':a38_0x1b3536(0xba),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|