@lovrabet/lovrabet-cli 2.1.20 → 2.1.21-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0xbcae8c=a29_0x4cc8;(function(_0x3f3c82,_0x156b08){const _0x23df6a=a29_0x4cc8,_0x548250=_0x3f3c82();while(!![]){try{const _0x58d2f4=parseInt(_0x23df6a(0x116))/0x1*(parseInt(_0x23df6a(0x140))/0x2)+parseInt(_0x23df6a(0x101))/0x3*(-parseInt(_0x23df6a(0x14a))/0x4)+parseInt(_0x23df6a(0xfd))/0x5+parseInt(_0x23df6a(0x145))/0x6+-parseInt(_0x23df6a(0x121))/0x7+-parseInt(_0x23df6a(0xfe))/0x8+parseInt(_0x23df6a(0x10b))/0x9*(parseInt(_0x23df6a(0x142))/0xa);if(_0x58d2f4===_0x156b08)break;else _0x548250['push'](_0x548250['shift']());}catch(_0x262b8a){_0x548250['push'](_0x548250['shift']());}}}(a29_0x40fa,0x3f68d));import a29_0x717c3c from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';function a29_0x4cc8(_0x11cea4,_0x286db9){_0x11cea4=_0x11cea4-0xfd;const _0x40facf=a29_0x40fa();let _0x4cc89d=_0x40facf[_0x11cea4];return _0x4cc89d;}async function execute(_0x842ce7){const _0x5b78f1=a29_0x4cc8,_0x15bfc3=getCliVersion(),_0x20c952=buildConfigFromFlags({});await initGlobalEnvironment(_0x20c952),console[_0x5b78f1(0x130)](),console[_0x5b78f1(0x130)](a29_0x717c3c['bold'](CLI_BIN_NAME+_0x5b78f1(0x12e))),console[_0x5b78f1(0x130)](a29_0x717c3c['gray']('─'[_0x5b78f1(0x106)](0x32))),console[_0x5b78f1(0x130)](_0x5b78f1(0x100)+_0x15bfc3),console[_0x5b78f1(0x130)](_0x5b78f1(0x123)+process[_0x5b78f1(0x11e)]),console[_0x5b78f1(0x130)]('\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20'+process[_0x5b78f1(0x12a)]+'\x20'+process['arch']),console['log'](),console[_0x5b78f1(0x130)](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x148))),console['log'](a29_0x717c3c['gray'](_0x5b78f1(0x139)[_0x5b78f1(0x106)](0x1e)));const _0x487735=getGlobalConfigPath(),_0x51a95f=getProjectConfigPath();console[_0x5b78f1(0x130)](_0x5b78f1(0x111)+(_0x487735||a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x133)))),console['log']('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x51a95f||a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x133)))),console[_0x5b78f1(0x130)](),console['log'](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x124))),console[_0x5b78f1(0x130)](a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x139)[_0x5b78f1(0x106)](0x1e)));const _0x27ff02=(_0x18f744,_0xba4fce)=>{const _0x82f00e=_0x5b78f1;if(!_0xba4fce){console[_0x82f00e(0x130)]('\x20\x20'+_0x18f744['padEnd'](0x11)+'\x20'+a29_0x717c3c[_0x82f00e(0x125)](_0x82f00e(0x114)));return;}const _0x2c1018=inspectCliConfigJsonFile(_0xba4fce);if(_0x2c1018[_0x82f00e(0x128)]==='ok')console[_0x82f00e(0x130)]('\x20\x20'+_0x18f744[_0x82f00e(0x13e)](0x11)+'\x20'+a29_0x717c3c['green'](_0x82f00e(0x134)));else{if(_0x2c1018['status']==='empty')console['log']('\x20\x20'+_0x18f744[_0x82f00e(0x13e)](0x11)+'\x20'+a29_0x717c3c[_0x82f00e(0x14d)]('⚠\x20Empty\x20(treated\x20as\x20{})'));else _0x2c1018[_0x82f00e(0x128)]===_0x82f00e(0x12b)?console['log']('\x20\x20'+_0x18f744[_0x82f00e(0x13e)](0x11)+'\x20'+a29_0x717c3c[_0x82f00e(0x125)](_0x82f00e(0xff))):(console['log']('\x20\x20'+_0x18f744[_0x82f00e(0x13e)](0x11)+'\x20'+a29_0x717c3c[_0x82f00e(0x13a)](_0x82f00e(0x120))),console[_0x82f00e(0x130)]('\x20\x20'+''[_0x82f00e(0x13e)](0x11)+'\x20'+a29_0x717c3c['red'](_0x2c1018['message'])));}};_0x27ff02(_0x5b78f1(0x155),_0x487735),_0x27ff02(_0x5b78f1(0x141),_0x51a95f),console[_0x5b78f1(0x130)](),console[_0x5b78f1(0x130)](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x11c))),console['log'](a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x139)[_0x5b78f1(0x106)](0x1e))),console['log']('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x20c952['appCode']||a29_0x717c3c[_0x5b78f1(0x13a)](_0x5b78f1(0x105)))),console['log'](_0x5b78f1(0x115)+_0x20c952['env']);const _0x1d1ecc=isLegacyCompatConfigKey(_0x5b78f1(0x135))?a29_0x717c3c[_0x5b78f1(0x125)](_0x20c952[_0x5b78f1(0x135)]+_0x5b78f1(0x151)):_0x20c952[_0x5b78f1(0x135)];console['log'](_0x5b78f1(0x14c)+_0x1d1ecc),console[_0x5b78f1(0x130)](_0x5b78f1(0x108)+(_0x20c952[_0x5b78f1(0x13b)]||a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x119)))),console['log'](_0x5b78f1(0x14f)+(_0x20c952[_0x5b78f1(0x137)]||a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x119)))),console['log']('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x20c952[_0x5b78f1(0x152)]||a29_0x717c3c['gray'](_0x5b78f1(0x10f)+DEFAULT_CONFIG_VALUES[_0x5b78f1(0x152)]+')'))),console[_0x5b78f1(0x130)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x20c952[_0x5b78f1(0x104)]??a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x10e)))),console['log'](_0x5b78f1(0x122)+_0x20c952[_0x5b78f1(0x11f)]),console['log'](_0x5b78f1(0x103)+_0x20c952['verbose']),console[_0x5b78f1(0x130)](_0x5b78f1(0x109)+AUTH_MODE['ClientAk']),console[_0x5b78f1(0x130)](_0x5b78f1(0x107)+(_0x20c952[_0x5b78f1(0x153)]?a29_0x717c3c[_0x5b78f1(0x136)]('(set,\x20length='+_0x20c952[_0x5b78f1(0x153)][_0x5b78f1(0x10d)]+')'):a29_0x717c3c[_0x5b78f1(0x125)]('(none)'))),console[_0x5b78f1(0x130)](),console['log'](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x138))),console[_0x5b78f1(0x130)](a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x139)[_0x5b78f1(0x106)](0x1e))),console[_0x5b78f1(0x130)](_0x5b78f1(0x11a)+getApiDomain()),console[_0x5b78f1(0x130)](_0x5b78f1(0x150)+getUserDomain()),console[_0x5b78f1(0x130)](_0x5b78f1(0x13d)+getRuntimeDomain()),console[_0x5b78f1(0x130)](),console['log'](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x102))),console[_0x5b78f1(0x130)](a29_0x717c3c['gray'](_0x5b78f1(0x139)['repeat'](0x1e)));const _0xb1f756=inspectServiceRegistry();console[_0x5b78f1(0x130)](_0x5b78f1(0x110)+_0xb1f756[_0x5b78f1(0x149)]),console[_0x5b78f1(0x130)](_0x5b78f1(0x11b)+formatServiceRegistryStatus(_0xb1f756)),console[_0x5b78f1(0x130)]('\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20'+_0xb1f756[_0x5b78f1(0x11d)]),console[_0x5b78f1(0x130)](_0x5b78f1(0x117)+_0xb1f756[_0x5b78f1(0x13c)]);for(const _0x878c96 of _0xb1f756[_0x5b78f1(0x118)]){console['log']('\x20\x20'+(_0x878c96[_0x5b78f1(0x146)]+':')['padEnd'](0x11)+'\x20'+(_0x878c96[_0x5b78f1(0x129)]||a29_0x717c3c[_0x5b78f1(0x125)](_0x5b78f1(0x154)))+'\x20('+_0x878c96[_0x5b78f1(0x13c)]+_0x5b78f1(0x14e)),console[_0x5b78f1(0x130)]('\x20\x20'+''[_0x5b78f1(0x13e)](0x11)+_0x5b78f1(0x147)+_0x878c96[_0x5b78f1(0x12d)][_0x5b78f1(0x144)]);}return console['log'](),console['log'](a29_0x717c3c[_0x5b78f1(0x13f)](_0x5b78f1(0x112))),console[_0x5b78f1(0x130)](a29_0x717c3c['gray']('\x20\x20─'[_0x5b78f1(0x106)](0x1e))),console[_0x5b78f1(0x130)](_0x5b78f1(0x113)+a29_0x717c3c['green'](AUTH_MODE[_0x5b78f1(0x12f)]+_0x5b78f1(0x132))),console['log'](_0x5b78f1(0x143)+a29_0x717c3c['gray']('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x5b78f1(0x130)](),{'ok':!![]};}function a29_0x40fa(){const _0x30b262=['(no\x20file)','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','107103NkHqUK','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','services','(none)','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Merged\x20Config','serviceCount','version','riskLevel','✗\x20Invalid\x20JSON','1629236ZIMkNd','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Config\x20JSON','gray','✗\x20Invalid','✓\x20Loaded','status','name','platform','missing','Diagnose\x20CLI\x20configuration\x20and\x20environment','source','\x20doctor','ClientAk','log','⚠\x20Empty','\x20(accessKey)','(not\x20found)','✓\x20Valid\x20JSON','locale','green','currentApp','\x20\x20API\x20Endpoints','\x20\x20─','red','defaultApp','commandCount','\x20\x20runtimeDomain:\x20\x20\x20','padEnd','bold','6WoBoBM','Project','1673110jdJPfI','\x20\x20Session\x20check:\x20\x20\x20','path','1942638KixEUa','serviceCode','\x20Imported\x20from:\x20','\x20\x20Config\x20Files','registryPath','509276hJpCTA','read','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','yellow','\x20commands)','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','\x20(legacy/compat\x20only)','format','accessKey','(unnamed)','Global','617370luNjDb','1829984nHNKcg','(missing)','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','9SsOMjO','\x20\x20Service\x20Tree','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','pageSize','(not\x20set)','repeat','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','doctor','18pFTtiq','empty','length','(default)','(default:\x20','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Auth','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x40fa=function(){return _0x30b262;};return a29_0x40fa();}function formatServiceRegistryStatus(_0x25244e){const _0x2470c8=a29_0x4cc8;if(_0x25244e[_0x2470c8(0x128)]==='ok')return a29_0x717c3c[_0x2470c8(0x136)](_0x2470c8(0x127));if(_0x25244e[_0x2470c8(0x128)]===_0x2470c8(0x12b))return a29_0x717c3c[_0x2470c8(0x125)](_0x2470c8(0x133));if(_0x25244e['status']===_0x2470c8(0x10c))return a29_0x717c3c['yellow'](_0x2470c8(0x131));return a29_0x717c3c[_0x2470c8(0x13a)](_0x2470c8(0x126)+(_0x25244e['message']?':\x20'+_0x25244e['message']:''));}export const doctorDefinition={'service':a29_0xbcae8c(0x10a),'command':'check','description':a29_0xbcae8c(0x12c),'risk':a29_0xbcae8c(0x14b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x2c4a01=a30_0x3262;(function(_0x18ce00,_0x40a1b2){const _0xab717c=a30_0x3262,_0x3cb3ba=_0x18ce00();while(!![]){try{const _0x47a5af=-parseInt(_0xab717c(0x8c))/0x1+parseInt(_0xab717c(0x90))/0x2*(parseInt(_0xab717c(0x7e))/0x3)+parseInt(_0xab717c(0x8a))/0x4+-parseInt(_0xab717c(0x7a))/0x5*(-parseInt(_0xab717c(0x88))/0x6)+parseInt(_0xab717c(0x95))/0x7+-parseInt(_0xab717c(0x84))/0x8*(parseInt(_0xab717c(0x9c))/0x9)+-parseInt(_0xab717c(0x7f))/0xa*(parseInt(_0xab717c(0x8f))/0xb);if(_0x47a5af===_0x40a1b2)break;else _0x3cb3ba['push'](_0x3cb3ba['shift']());}catch(_0x1d0f98){_0x3cb3ba['push'](_0x3cb3ba['shift']());}}}(a30_0x524a,0xea1e1));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';function a30_0x3262(_0x4a93b9,_0x25c359){_0x4a93b9=_0x4a93b9-0x77;const _0x524aed=a30_0x524a();let _0x3262e4=_0x524aed[_0x4a93b9];return _0x3262e4;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x2c4a01(0x9d),'type':a30_0x2c4a01(0x86),'required':!![],'description':a30_0x2c4a01(0x7c)},FILEPATH_FLAG={'name':a30_0x2c4a01(0x78),'type':a30_0x2c4a01(0x86),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'},DOWNLOAD_FLAG={'name':a30_0x2c4a01(0x9f),'type':a30_0x2c4a01(0x85),'description':a30_0x2c4a01(0x7b)},LONG_TERM_FLAG={'name':'long-term','type':a30_0x2c4a01(0x85),'description':a30_0x2c4a01(0x7d)};function requireFilePath(_0x5026d4){const _0x432ea8=a30_0x2c4a01,_0x1a7acd=_0x5026d4[_0x432ea8(0x93)]();if(!_0x1a7acd)throw CliErrors[_0x432ea8(0x98)]('filePath\x20is\x20required.');return _0x1a7acd;}const fileUpload={'service':a30_0x2c4a01(0x9d),'command':a30_0x2c4a01(0x83),'description':a30_0x2c4a01(0x9a),'risk':a30_0x2c4a01(0x87),'flags':[FILE_FLAG],async 'dryRun'(_0x633b14){const _0x11c90b=a30_0x2c4a01,_0x3ffdf8=requireRuntimeUploadFile(_0x633b14['str'](_0x11c90b(0x9d)),_0x11c90b(0x8b));return dryRun('POST',_0x11c90b(0x96))[_0x11c90b(0x79)]({'appCode':_0x633b14[_0x11c90b(0x9b)],'multipart':{'file':_0x3ffdf8}})[_0x11c90b(0x81)](_0x11c90b(0x92)+_0x3ffdf8[_0x11c90b(0x80)]+_0x11c90b(0x82)+_0x633b14[_0x11c90b(0x9b)])[_0x11c90b(0x8e)]();},async 'execute'(_0x8cab6d){const _0x37f531=a30_0x2c4a01,_0x3e963c=requireRuntimeUploadFile(_0x8cab6d[_0x37f531(0x99)]('file'),_0x37f531(0x8b)),_0x2182e8=await uploadRuntimeFile(_0x8cab6d['appCode'],_0x3e963c[_0x37f531(0x80)]);return{'ok':!![],'data':_0x2182e8,'message':_0x2182e8[_0x37f531(0x8d)]?_0x37f531(0x91)+_0x2182e8[_0x37f531(0x8d)]+_0x37f531(0x9e):_0x37f531(0x89)};}},fileQueryUrl={'service':'file','command':a30_0x2c4a01(0x97),'description':a30_0x2c4a01(0x77),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x5702fb){const _0xab66b7=a30_0x2c4a01,_0xc7a8a1=requireFilePath(_0x5702fb[_0xab66b7(0x99)]('filepath')),_0x1c1f1f=await queryRuntimeFileUrl(_0xc7a8a1,{'download':_0x5702fb[_0xab66b7(0x94)](_0xab66b7(0x9f)),'longTerm':_0x5702fb[_0xab66b7(0x94)]('long-term')});return{'ok':!![],'data':_0x1c1f1f};}};function a30_0x524a(){const _0x13cf83=['query-url','validation','str','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','appCode','117Pqlpec','file','.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','download','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','filepath','body','1765SkZDDu','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','Path\x20to\x20the\x20local\x20file\x20to\x20upload','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','3UtjdmC','16760SjQEeu','path','description','\x20to\x20runtime\x20app\x20','upload','663224hHCWid','boolean','string','read','5340fUWFzP','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','5200980XUYlsm','File','396413NaIUyQ','filePath','build','5599chjSNN','807406rwcLkm','Uploaded\x20file:\x20','Preview:\x20upload\x20','trim','bool','8876441BytXBq','/client/uploadFile'];a30_0x524a=function(){return _0x13cf83;};return a30_0x524a();}export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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;}
|
|
1
|
+
const a31_0x11a723=a31_0x4d08;(function(_0x43247e,_0x370caf){const _0x1d6dfd=a31_0x4d08,_0xc1f52c=_0x43247e();while(!![]){try{const _0x4278b3=parseInt(_0x1d6dfd(0x162))/0x1*(parseInt(_0x1d6dfd(0x159))/0x2)+parseInt(_0x1d6dfd(0x168))/0x3+-parseInt(_0x1d6dfd(0x173))/0x4*(parseInt(_0x1d6dfd(0x184))/0x5)+-parseInt(_0x1d6dfd(0x176))/0x6*(-parseInt(_0x1d6dfd(0x15a))/0x7)+-parseInt(_0x1d6dfd(0x153))/0x8+-parseInt(_0x1d6dfd(0x194))/0x9*(-parseInt(_0x1d6dfd(0x180))/0xa)+parseInt(_0x1d6dfd(0x174))/0xb;if(_0x4278b3===_0x370caf)break;else _0xc1f52c['push'](_0xc1f52c['shift']());}catch(_0x310a8e){_0xc1f52c['push'](_0xc1f52c['shift']());}}}(a31_0x276d,0x958fc));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';function a31_0x4d08(_0x5a9ed8,_0x1f79f0){_0x5a9ed8=_0x5a9ed8-0x14f;const _0x276d5e=a31_0x276d();let _0x4d0865=_0x276d5e[_0x5a9ed8];return _0x4d0865;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x11a723(0x183),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x18a)},{'name':a31_0x11a723(0x14f),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x177)+DEFAULT_CONFIG_VALUES[a31_0x11a723(0x14f)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x11a723(0x164),'type':a31_0x11a723(0x192),'description':a31_0x11a723(0x190)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x11a723(0x17e),'type':'boolean','description':a31_0x11a723(0x157),'default':![]}];function a31_0x276d(){const _0x3f185e=['log','global','User\x20aborted\x20prompt','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','\x20\x20config:\x20\x20','1823214JMRTuh','cwd','message','Source\x20file\x20not\x20found:\x20','app','apps','stdout','Initialized\x20','defaultApp','\x20\x20default:\x20','Override\x20imported\x20default\x20appcode','38072oyWuoC','1267915TLqKoC','close','246dsNqaw','Target\x20environment\x20(default\x20','newConfigFileName','string','\x20init\x20—\x20Create\x20','Usage:\x20','trim','validation','yes','Aborted.','69710PFzLSY','cancelled','Provide\x20--appcode\x20<code>\x20or\x20use\x20an\x20upgraded\x20.rabetbase.json\x20with\x20top-level\x20appcode.\x20Legacy\x20files\x20must\x20be\x20upgraded\x20first\x20with\x20`rabetbase\x20project\x20upgrade`.','appcode','300rLuSKe','once','apiDir','AbortPrompt','[y/N]','race','App\x20code\x20for\x20the\x20project','entries','\x20\x20env:\x20\x20\x20\x20\x20','Invalid\x20env\x20\x22','SIGINT','includes','Write\x20to\x20global\x20(~/','File\x20','boolean','riskLevel','423dASsTx','project','Failed\x20to\x20parse\x20source\x20file:\x20','env','question','[Y/n]','file','7596784oNrRpk','flagMissing','\x22.\x20Allowed:\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','Skip\x20confirmation\x20when\x20overwriting','\x20\x20appcode:\x20','32OXpZlI','94654vbhBUK','removeListener','\x20already\x20exists.\x20Overwrite?',')\x20instead\x20of\x20project','):\x20','object','Override\x20imported\x20default\x20env','stdin','33015RdEiCn'];a31_0x276d=function(){return _0x3f185e;};return a31_0x276d();}export const initImportFlagDefs=[{'name':a31_0x11a723(0x152),'type':a31_0x11a723(0x179),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x11a723(0x183),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x172)},{'name':a31_0x11a723(0x14f),'type':a31_0x11a723(0x179),'description':a31_0x11a723(0x160),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x11a723(0x164),'type':a31_0x11a723(0x192),'description':a31_0x11a723(0x190)+PRODUCT_CONFIG[a31_0x11a723(0x178)]+a31_0x11a723(0x15d),'default':![]},{'name':a31_0x11a723(0x17e),'type':a31_0x11a723(0x192),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x4d9110){const _0x106a4c=a31_0x11a723,_0x4d0ae9=isNonInteractiveMode(_0x4d9110),_0x2ffb89=_0x4d9110[_0x106a4c(0x164)]?_0x106a4c(0x164):_0x106a4c(0x195),_0x3e4294=resolveWriteConfigPath(_0x2ffb89);try{_0x4d0ae9?await runNonInteractive(_0x4d9110,_0x3e4294):await runInteractive(_0x4d9110,_0x3e4294);}catch(_0x27588e){if(_0x27588e instanceof AbortPrompt)throw CliErrors[_0x106a4c(0x181)]();throw _0x27588e;}}export async function runInitImport(_0x5b6738){const _0x2bcd03=a31_0x11a723,_0x58f642=_0x5b6738['global']?_0x2bcd03(0x164):'project',_0x2ffa2e=resolveWriteConfigPath(_0x58f642);await runFromImport(_0x5b6738,_0x2ffa2e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x11a723(0x186)]);async function runFromImport(_0x5781af,_0x32670c){const _0x14f353=a31_0x11a723,_0xaf4bbc=resolveFilePath(_0x5781af[_0x14f353(0x152)]);if(!existsSync(_0xaf4bbc))throw CliErrors[_0x14f353(0x17d)](_0x14f353(0x16b)+_0xaf4bbc);const _0x572ab4=readSourceFile(_0xaf4bbc),_0x3e07d6=convertToRuntimeConfig(_0x572ab4);_0x5781af[_0x14f353(0x183)]&&(_0x3e07d6[_0x14f353(0x183)]=String(_0x5781af[_0x14f353(0x183)]));_0x5781af[_0x14f353(0x14f)]&&(_0x3e07d6[_0x14f353(0x14f)]=resolveInitEnv(_0x5781af));if(!_0x3e07d6[_0x14f353(0x183)])throw CliErrors['validation'](_0x14f353(0x156),_0x14f353(0x182));await writeInitConfig(_0x32670c,_0x3e07d6,_0x5781af),console[_0x14f353(0x163)]('Imported\x20from\x20'+_0xaf4bbc),console[_0x14f353(0x163)](_0x14f353(0x167)+_0x32670c),console['log'](_0x14f353(0x158)+_0x3e07d6[_0x14f353(0x183)]);if(_0x3e07d6[_0x14f353(0x170)])console[_0x14f353(0x163)](_0x14f353(0x171)+_0x3e07d6[_0x14f353(0x170)]);}function convertToRuntimeConfig(_0x438a6d){const _0x2f5f7e=a31_0x11a723;if(_0x438a6d[_0x2f5f7e(0x16d)]&&typeof _0x438a6d[_0x2f5f7e(0x16d)]===_0x2f5f7e(0x15f))throw CliErrors[_0x2f5f7e(0x17d)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.',_0x2f5f7e(0x166));const _0x4b780c={};for(const _0x1307d2 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x438a6d[_0x1307d2]!==undefined&&(_0x4b780c[_0x1307d2]=_0x438a6d[_0x1307d2]);}return!_0x4b780c[_0x2f5f7e(0x193)]&&(_0x4b780c[_0x2f5f7e(0x193)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x4b780c;}async function runNonInteractive(_0x55d33f,_0x1ca99e){const _0x218642=a31_0x11a723,_0x2bc7d2=_0x55d33f[_0x218642(0x183)];if(!_0x2bc7d2)throw CliErrors[_0x218642(0x154)]('appcode',_0x218642(0x17b)+CLI_BIN_NAME+'\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]');const _0x1aa3e8=resolveInitEnv(_0x55d33f);await writeInitConfig(_0x1ca99e,{'appcode':_0x2bc7d2,'env':_0x1aa3e8},_0x55d33f),console[_0x218642(0x163)](_0x218642(0x16f)+_0x1ca99e),console['log']('\x20\x20appcode:\x20'+_0x2bc7d2),console['log'](_0x218642(0x18c)+_0x1aa3e8);}async function runInteractive(_0x5f33aa,_0x4b74be){const _0x48e92a=a31_0x11a723,_0x50901f=loadExisting(_0x4b74be),_0x528c2b=typeof _0x50901f?.[_0x48e92a(0x183)]===_0x48e92a(0x179)?_0x50901f[_0x48e92a(0x183)]:'',_0x1e52a8=resolveInitEnv(_0x5f33aa);console['log'](CLI_BIN_NAME+_0x48e92a(0x17a)+PRODUCT_CONFIG[_0x48e92a(0x178)]+'\x0a');if(existsSync(_0x4b74be)&&!_0x5f33aa[_0x48e92a(0x17e)]){const _0x4c7d66=await promptYesNo(_0x48e92a(0x191)+_0x4b74be+_0x48e92a(0x15c),![]);if(!_0x4c7d66){console['log'](_0x48e92a(0x17f));return;}}const _0xf96224=typeof _0x5f33aa[_0x48e92a(0x183)]===_0x48e92a(0x179)?_0x5f33aa[_0x48e92a(0x183)][_0x48e92a(0x17c)]():'';let _0x39d995=_0xf96224;!_0x39d995&&(_0x39d995=await promptInput('App\x20code',_0x528c2b));if(!_0x39d995[_0x48e92a(0x17c)]())throw CliErrors[_0x48e92a(0x17d)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x4b74be,{'appcode':_0x39d995[_0x48e92a(0x17c)](),'env':_0x1e52a8},_0x5f33aa),console[_0x48e92a(0x163)]('\x0aInitialized\x20'+_0x4b74be),console[_0x48e92a(0x163)]('\x20\x20appcode:\x20'+_0x39d995['trim']()),console[_0x48e92a(0x163)](_0x48e92a(0x18c)+_0x1e52a8);}async function writeInitConfig(_0x44ed5e,_0x1d33d5,_0x3901ec){const _0x3aa30f=a31_0x11a723;let _0x56b318={};existsSync(_0x44ed5e)&&!_0x3901ec['yes']&&(_0x56b318=readConfigFile(_0x44ed5e));for(const [_0x48cc35,_0x27e8c8]of Object[_0x3aa30f(0x18b)](_0x1d33d5)){_0x27e8c8!==undefined&&(_0x56b318[_0x48cc35]=_0x27e8c8);}if(_0x56b318[_0x3aa30f(0x16c)])delete _0x56b318[_0x3aa30f(0x16c)];writeConfigFile(_0x44ed5e,_0x56b318);}class AbortPrompt extends Error{constructor(){const _0x1db13a=a31_0x11a723;super(_0x1db13a(0x165)),this['name']=_0x1db13a(0x187);}}function createSafeRl(){const _0x5638d2=a31_0x11a723,_0x40f749=createInterface({'input':process[_0x5638d2(0x161)],'output':process[_0x5638d2(0x16e)]});let _0x407a4f;const _0x358ddb=new Promise((_0x3ea68b,_0x4616e0)=>{const _0x13276b=_0x5638d2;_0x407a4f=()=>{const _0x44d50e=a31_0x4d08;_0x407a4f&&(_0x40f749[_0x44d50e(0x15b)](_0x44d50e(0x18e),_0x407a4f),_0x407a4f=undefined);try{_0x40f749[_0x44d50e(0x175)]();}catch{}_0x4616e0(new AbortPrompt());},_0x40f749[_0x13276b(0x185)](_0x13276b(0x18e),_0x407a4f);}),_0x2eb78a=()=>{const _0x118807=_0x5638d2;_0x407a4f&&(_0x40f749[_0x118807(0x15b)](_0x118807(0x18e),_0x407a4f),_0x407a4f=undefined);try{_0x40f749['close']();}catch{}};return{'rl':_0x40f749,'abortPromise':_0x358ddb,'disposeSuccess':_0x2eb78a};}async function promptInput(_0x238049,_0x2d499b){const _0x576c9c=a31_0x11a723,{rl:_0x54c941,abortPromise:_0x568b9e,disposeSuccess:_0xa57461}=createSafeRl(),_0x47fb4f=new Promise(_0x4f0131=>{const _0x374b6c=a31_0x4d08,_0x42bbf0=_0x2d499b?'\x20\x20'+_0x238049+'\x20('+_0x2d499b+_0x374b6c(0x15e):'\x20\x20'+_0x238049+':\x20';_0x54c941['question'](_0x42bbf0,_0x507503=>{const _0x1c973d=_0x374b6c;_0xa57461(),_0x4f0131(_0x507503[_0x1c973d(0x17c)]()||_0x2d499b);});});return Promise[_0x576c9c(0x189)]([_0x47fb4f,_0x568b9e]);}async function promptYesNo(_0x4459e9,_0x18a9fc){const _0x548c08=a31_0x11a723,{rl:_0x47abb7,abortPromise:_0x3eeba4,disposeSuccess:_0x772d12}=createSafeRl(),_0x4de078=new Promise(_0x204631=>{const _0x4d8650=a31_0x4d08,_0x4d04fa=_0x18a9fc?_0x4d8650(0x151):_0x4d8650(0x188);_0x47abb7[_0x4d8650(0x150)]('\x20\x20'+_0x4459e9+'\x20'+_0x4d04fa+':\x20',_0x45098c=>{const _0x45bfe8=_0x4d8650;_0x772d12();const _0x3ae8e4=_0x45098c[_0x45bfe8(0x17c)]()['toLowerCase']();if(_0x3ae8e4==='y'||_0x3ae8e4===_0x45bfe8(0x17e))_0x204631(!![]);else{if(_0x3ae8e4==='n'||_0x3ae8e4==='no')_0x204631(![]);else _0x204631(_0x18a9fc);}});});return Promise[_0x548c08(0x189)]([_0x4de078,_0x3eeba4]);}function loadExisting(_0x4985a3){if(!existsSync(_0x4985a3))return null;return readConfigFile(_0x4985a3);}function resolveFilePath(_0xd4e5a4){const _0x373c2c=a31_0x11a723;return isAbsolute(_0xd4e5a4)?_0xd4e5a4:resolve(process[_0x373c2c(0x169)](),_0xd4e5a4);}function readSourceFile(_0x5b7e7e){const _0x4f7317=a31_0x11a723;try{const _0x1fc3a5=readFileSync(_0x5b7e7e,{'encoding':'utf8'});return JSON['parse'](_0x1fc3a5);}catch(_0x314dca){throw CliErrors[_0x4f7317(0x17d)](_0x4f7317(0x196)+_0x314dca[_0x4f7317(0x16a)]);}}function resolveInitEnv(_0x45ac6a){const _0xfa6411=a31_0x11a723,_0x364a11=_0x45ac6a[_0xfa6411(0x14f)];if(_0x364a11===undefined||_0x364a11==='')return DEFAULT_CONFIG_VALUES[_0xfa6411(0x14f)];if(!RUNTIME_ENV_VALUES[_0xfa6411(0x18f)](_0x364a11))throw CliErrors[_0xfa6411(0x17d)](_0xfa6411(0x18d)+_0x364a11+_0xfa6411(0x155)+RUNTIME_ENV_VALUES['join'](',\x20'));return _0x364a11;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x58c811=a32_0x1239;(function(_0x13f7f2,_0x3491f0){const _0x7ddecb=a32_0x1239,_0xe926ee=_0x13f7f2();while(!![]){try{const _0x340278=parseInt(_0x7ddecb(0x181))/0x1+parseInt(_0x7ddecb(0x169))/0x2*(parseInt(_0x7ddecb(0x159))/0x3)+parseInt(_0x7ddecb(0x18b))/0x4*(-parseInt(_0x7ddecb(0x189))/0x5)+-parseInt(_0x7ddecb(0x15a))/0x6+parseInt(_0x7ddecb(0x16e))/0x7*(-parseInt(_0x7ddecb(0x184))/0x8)+-parseInt(_0x7ddecb(0x155))/0x9*(parseInt(_0x7ddecb(0x156))/0xa)+parseInt(_0x7ddecb(0x171))/0xb*(parseInt(_0x7ddecb(0x191))/0xc);if(_0x340278===_0x3491f0)break;else _0xe926ee['push'](_0xe926ee['shift']());}catch(_0x432ed2){_0xe926ee['push'](_0xe926ee['shift']());}}}(a32_0x221e,0x9a891));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';function a32_0x221e(){const _0x4e8304=['1803162utTiER','bool','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','POST','Created\x20KB\x20entry\x20','num','verbose','content','scope','docId','ragStatus','read','flag','build','isFinite','2gDKrxd','detail','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','number','6485577JjVVEM','length','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','33xWrIsp','str','trim','title','search','userId','score','description','string','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','isFile','topk','Search\x20query\x20is\x20required.','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','/update','/client/knowledge-base/personal/create','367617QFiUHO','validation','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','8PEKvZX','metadata','map','/client/knowledge-base/personal/','appCode','30565oadBdB','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','452ugIwcR','File\x20not\x20found:\x20','createTime','Personal\x20knowledge-base\x20entry\x20ID','Override\x20the\x20existing\x20entry\x20title','body','5537400CmDOUf','File\x20path\x20is\x20required.','version','list','Personal\x20knowledge-base\x20entry\x20title','query','Updated\x20KB\x20entry\x20','File\x20is\x20not\x20a\x20regular\x20file:\x20','file','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','utf8','weightedScore','4086pKjsPf','670TgFAaz','write','ragErrorMessage','2487705LUZyvL'];a32_0x221e=function(){return _0x4e8304;};return a32_0x221e();}import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':'title','type':a32_0x58c811(0x179),'required':!![],'description':a32_0x58c811(0x195)},FILE_FLAG={'name':'file','type':a32_0x58c811(0x179),'required':!![],'description':a32_0x58c811(0x183)},QUERY_FLAG={'name':a32_0x58c811(0x196),'type':a32_0x58c811(0x179),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x58c811(0x17c),'type':a32_0x58c811(0x16d),'description':a32_0x58c811(0x16c)};function readKnowledgeFile(_0x119865){const _0x1eb4bb=a32_0x58c811;if(!_0x119865)throw CliErrors[_0x1eb4bb(0x182)](_0x1eb4bb(0x192));if(!existsSync(_0x119865))throw CliErrors['validation'](_0x1eb4bb(0x18c)+_0x119865);if(!statSync(_0x119865)[_0x1eb4bb(0x17b)]())throw CliErrors[_0x1eb4bb(0x182)](_0x1eb4bb(0x150)+_0x119865);return readFileSync(_0x119865,_0x1eb4bb(0x153));}function summarizePersonalItem(_0x52d31d){const _0x3f2dd0=a32_0x58c811;return{'id':_0x52d31d['id'],'title':_0x52d31d['title'],'version':_0x52d31d[_0x3f2dd0(0x193)],'ragStatus':_0x52d31d['ragStatus'],'ragErrorMessage':_0x52d31d[_0x3f2dd0(0x158)],'updateTime':_0x52d31d['updateTime']};}function detailPersonalItem(_0x36176a){const _0x5deec7=a32_0x58c811;return{'id':_0x36176a['id'],'appCode':_0x36176a['appCode'],'scope':_0x36176a[_0x5deec7(0x162)],'userId':_0x36176a[_0x5deec7(0x176)],'title':_0x36176a[_0x5deec7(0x174)],'content':_0x36176a[_0x5deec7(0x161)]??'','version':_0x36176a[_0x5deec7(0x193)],'ragStatus':_0x36176a[_0x5deec7(0x164)],'ragErrorMessage':_0x36176a[_0x5deec7(0x158)],'createTime':_0x36176a[_0x5deec7(0x18d)],'updateTime':_0x36176a['updateTime']};}function summarizeSearchHit(_0x1a5505){const _0x185437=a32_0x58c811;return{'scope':_0x1a5505[_0x185437(0x162)],'title':_0x1a5505[_0x185437(0x174)],'docId':_0x1a5505[_0x185437(0x163)],'score':_0x1a5505[_0x185437(0x177)],'weightedScore':_0x1a5505[_0x185437(0x154)],'content':_0x1a5505[_0x185437(0x161)],'metadata':_0x1a5505[_0x185437(0x185)]};}function readTopK(_0x10c861){const _0x4d4c35=a32_0x58c811,_0x1fa418=_0x10c861[_0x4d4c35(0x166)]('topk');if(_0x1fa418===undefined||_0x1fa418===null||_0x1fa418==='')return undefined;const _0x4d1808=_0x10c861[_0x4d4c35(0x15f)](_0x4d4c35(0x17c));if(!Number[_0x4d4c35(0x168)](_0x4d1808)||_0x4d1808<0x1)throw CliErrors[_0x4d4c35(0x182)]('--topk\x20must\x20be\x20a\x20positive\x20number.');return _0x4d1808;}function a32_0x1239(_0x622395,_0x277dcc){_0x622395=_0x622395-0x14f;const _0x221e4b=a32_0x221e();let _0x123920=_0x221e4b[_0x622395];return _0x123920;}const kbList={'service':'kb','command':a32_0x58c811(0x194),'description':a32_0x58c811(0x18a),'risk':a32_0x58c811(0x165),'flags':[VERBOSE_FLAG],async 'execute'(_0x26e4b3){const _0x49f81d=a32_0x58c811,_0x2fa1dd=await listPersonalKnowledgeBaseItems(_0x26e4b3[_0x49f81d(0x188)]);if(_0x26e4b3[_0x49f81d(0x15b)](_0x49f81d(0x160)))return{'ok':!![],'data':{'total':_0x2fa1dd[_0x49f81d(0x16f)],'items':_0x2fa1dd}};return{'ok':!![],'data':{'total':_0x2fa1dd[_0x49f81d(0x16f)],'items':_0x2fa1dd['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x58c811(0x16a),'description':a32_0x58c811(0x15c),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x58c811(0x18e)}],async 'execute'(_0x1a8654){const _0x245649=a32_0x58c811,_0x193fb1=await getPersonalKnowledgeBaseItem(_0x1a8654['num']('id'),_0x1a8654[_0x245649(0x188)]);return{'ok':!![],'data':detailPersonalItem(_0x193fb1)};}},kbCreate={'service':'kb','command':'create','description':a32_0x58c811(0x16b),'risk':a32_0x58c811(0x157),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x1276d9){const _0x520697=a32_0x58c811,_0x3d1c74=_0x1276d9[_0x520697(0x172)]('title'),_0x33c6d5=readKnowledgeFile(_0x1276d9[_0x520697(0x172)](_0x520697(0x151))),_0x233e4a=await createPersonalKnowledgeBaseItem(_0x1276d9[_0x520697(0x188)],{'title':_0x3d1c74,'content':_0x33c6d5});return{'ok':!![],'data':summarizePersonalItem(_0x233e4a),'message':_0x520697(0x15e)+_0x233e4a['id']+'\x20('+_0x233e4a[_0x520697(0x174)]+')'};},async 'dryRun'(_0x1a0a57){const _0x2c18ea=a32_0x58c811,_0x24b7ba=_0x1a0a57['str'](_0x2c18ea(0x174)),_0x7851da=readKnowledgeFile(_0x1a0a57['str'](_0x2c18ea(0x151)));return dryRun(_0x2c18ea(0x15d),_0x2c18ea(0x180))['body']({'appCode':_0x1a0a57[_0x2c18ea(0x188)],'title':_0x24b7ba,'content':_0x7851da})[_0x2c18ea(0x178)](_0x2c18ea(0x17e)+_0x24b7ba+'\x22')[_0x2c18ea(0x167)]();}},kbUpdate={'service':'kb','command':'update','description':a32_0x58c811(0x170),'risk':'write','flags':[{...ID_FLAG,'description':'Personal\x20knowledge-base\x20entry\x20ID'},{...TITLE_FLAG,'required':![],'description':a32_0x58c811(0x18f)},FILE_FLAG],async 'execute'(_0x4bfd0d){const _0x15d434=a32_0x58c811,_0x4685ae=_0x4bfd0d[_0x15d434(0x15f)]('id'),_0xccdb6=readKnowledgeFile(_0x4bfd0d['str'](_0x15d434(0x151))),_0x1780a5=_0x4bfd0d[_0x15d434(0x172)](_0x15d434(0x174))||(await getPersonalKnowledgeBaseItem(_0x4685ae,_0x4bfd0d[_0x15d434(0x188)]))[_0x15d434(0x174)],_0x4d4dbc=await updatePersonalKnowledgeBaseItem(_0x4685ae,_0x4bfd0d[_0x15d434(0x188)],{'title':_0x1780a5,'content':_0xccdb6});return{'ok':!![],'data':summarizePersonalItem(_0x4d4dbc),'message':_0x15d434(0x14f)+_0x4d4dbc['id']+'\x20('+_0x4d4dbc[_0x15d434(0x174)]+')'};},async 'dryRun'(_0x33d406){const _0x5c1a54=a32_0x58c811,_0x171843=_0x33d406[_0x5c1a54(0x15f)]('id'),_0x1bbd1c=readKnowledgeFile(_0x33d406[_0x5c1a54(0x172)](_0x5c1a54(0x151))),_0x459f70=_0x33d406[_0x5c1a54(0x172)](_0x5c1a54(0x174))||(await getPersonalKnowledgeBaseItem(_0x171843,_0x33d406['appCode']))[_0x5c1a54(0x174)];return dryRun('POST',_0x5c1a54(0x187)+_0x171843+_0x5c1a54(0x17f))[_0x5c1a54(0x190)]({'appCode':_0x33d406[_0x5c1a54(0x188)],'title':_0x459f70,'content':_0x1bbd1c})[_0x5c1a54(0x178)](_0x5c1a54(0x17a)+_0x171843)[_0x5c1a54(0x167)]();}},kbSearch={'service':'kb','command':a32_0x58c811(0x175),'description':a32_0x58c811(0x152),'risk':a32_0x58c811(0x165),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x546579){const _0x414253=a32_0x58c811;if(!_0x546579[_0x414253(0x172)](_0x414253(0x196))[_0x414253(0x173)]())throw CliErrors[_0x414253(0x182)](_0x414253(0x17d));readTopK(_0x546579);},async 'execute'(_0x641fde){const _0x39a886=a32_0x58c811,_0x444911=_0x641fde[_0x39a886(0x172)](_0x39a886(0x196))[_0x39a886(0x173)](),_0x140cd8=readTopK(_0x641fde),_0x32de81=await searchKnowledgeBase(_0x641fde['appCode'],{'query':_0x444911,'topK':_0x140cd8});return{'ok':!![],'data':{'total':_0x32de81[_0x39a886(0x16f)],'hits':_0x32de81[_0x39a886(0x186)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x5d5bfd=a33_0x2dfc;(function(_0x1da8e5,_0x3e225e){const _0x35a004=a33_0x2dfc,_0x478060=_0x1da8e5();while(!![]){try{const _0x231b40=parseInt(_0x35a004(0x1ac))/0x1+parseInt(_0x35a004(0x1c2))/0x2*(parseInt(_0x35a004(0x1c3))/0x3)+parseInt(_0x35a004(0x1b9))/0x4*(-parseInt(_0x35a004(0x1ad))/0x5)+-parseInt(_0x35a004(0x1aa))/0x6+-parseInt(_0x35a004(0x1a7))/0x7*(-parseInt(_0x35a004(0x1bc))/0x8)+parseInt(_0x35a004(0x1b4))/0x9+-parseInt(_0x35a004(0x1a9))/0xa;if(_0x231b40===_0x3e225e)break;else _0x478060['push'](_0x478060['shift']());}catch(_0x48df00){_0x478060['push'](_0x478060['shift']());}}}(a33_0x3694,0x51707));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x1f09d8){const _0x5deada=a33_0x2dfc;if(_0x1f09d8[_0x5deada(0x1bb)]===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x5deada(0x1c1)]('*\x20'+CLI_DISPLAY_NAME+_0x5deada(0x1ab)),_0x1f09d8[_0x5deada(0x1b5)]((_0x2f2f1b,_0x40188f)=>{const _0x436d0f=_0x5deada,_0x4e5871=new Date(_0x2f2f1b[_0x436d0f(0x1b6)])[_0x436d0f(0x1a8)](_0x436d0f(0x1b0)),_0x9359a1=_0x2f2f1b['level']==='success'?'√':_0x2f2f1b[_0x436d0f(0x1be)]===_0x436d0f(0x1c0)?'×':_0x2f2f1b[_0x436d0f(0x1be)]===_0x436d0f(0x1c7)?'!':'i';console[_0x436d0f(0x1c1)](_0x40188f+0x1+'.\x20'+_0x9359a1+'\x20['+_0x2f2f1b[_0x436d0f(0x1b2)]+']\x20'+_0x2f2f1b[_0x436d0f(0x1c5)]),console[_0x436d0f(0x1c1)](_0x436d0f(0x1b8)+_0x4e5871),_0x2f2f1b['duration']&&console['log'](_0x436d0f(0x1af)+_0x2f2f1b[_0x436d0f(0x1ae)]+'ms'),_0x2f2f1b[_0x436d0f(0x1a6)]&&Object[_0x436d0f(0x1c8)](_0x2f2f1b['details'])[_0x436d0f(0x1bb)]>0x0&&console['log'](_0x436d0f(0x1c9)+JSON[_0x436d0f(0x1bd)](_0x2f2f1b['details'],null,0x2)),console[_0x436d0f(0x1c1)]('');});}function a33_0x3694(){const _0x3416f4=['command','clearLogs','3997719JyHayC','forEach','timestamp','logs','\x20\x20\x20Time:\x20','964UlLjBC','write','length','488gpyQUp','stringify','level','Clear\x20command\x20history\x20logs','error','log','1226tLASyL','78gzBmtT','read','message','readLogs','warn','keys','\x20\x20\x20Details:\x20','details','22645lMMdHt','toLocaleString','1592570kUUHhm','2272080jgbtKc','\x20logs:\x0a','465411DCQWvU','5215UdIjfk','duration','\x20\x20\x20Duration:\x20','en-US','clear'];a33_0x3694=function(){return _0x3416f4;};return a33_0x3694();}function a33_0x2dfc(_0x94dcc9,_0x30de8b){_0x94dcc9=_0x94dcc9-0x1a6;const _0x36941d=a33_0x3694();let _0x2dfcfe=_0x36941d[_0x94dcc9];return _0x2dfcfe;}export const logsDefinitions=[{'service':a33_0x5d5bfd(0x1b7),'command':'show','description':'View\x20command\x20history\x20logs','risk':a33_0x5d5bfd(0x1c4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xdc95f){const _0xa4957d=a33_0x5d5bfd;return printLogs(logger[_0xa4957d(0x1c6)]()),{'ok':!![]};}},{'service':a33_0x5d5bfd(0x1b7),'command':a33_0x5d5bfd(0x1b1),'description':a33_0x5d5bfd(0x1bf),'risk':a33_0x5d5bfd(0x1ba),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x235237){const _0x4e9d09=a33_0x5d5bfd;return logger[_0x4e9d09(0x1b3)](),console[_0x4e9d09(0x1c1)]('*\x20Logs\x20cleared'),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x378393=a34_0x4243;(function(_0x31bdd9,_0x4a83aa){const _0x616c63=a34_0x4243,_0x621bc4=_0x31bdd9();while(!![]){try{const _0x129b8e=parseInt(_0x616c63(0x18a))/0x1+-parseInt(_0x616c63(0x172))/0x2+parseInt(_0x616c63(0x19a))/0x3+-parseInt(_0x616c63(0x191))/0x4*(parseInt(_0x616c63(0x18f))/0x5)+-parseInt(_0x616c63(0x18e))/0x6*(parseInt(_0x616c63(0x181))/0x7)+parseInt(_0x616c63(0x17c))/0x8+parseInt(_0x616c63(0x173))/0x9;if(_0x129b8e===_0x4a83aa)break;else _0x621bc4['push'](_0x621bc4['shift']());}catch(_0x392116){_0x621bc4['push'](_0x621bc4['shift']());}}}(a34_0x26ce,0x5413b));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0x26ce(){const _0xea5492=['Table','build','1331718GDCObU','4560948VxiwQB','/client/ocr','appCode','description','filter','imageFile','imageUrl','path','<filePath\x20returned\x20by\x20/client/uploadFile>','2310208YIMCqJ','idCard','form','image-url','fileUrl','110068pWmDaw','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','Publicly\x20accessible\x20image\x20or\x20file\x20URL','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','ocr','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','IdCard','recognize','File\x20URL\x20response\x20missing\x20fileUrl.','181196PeVqmn','POST','string','trim','18HIbFVD','2852870hfXWvZ','image-file','4QiYThN','length','/client/queryFileUrl','.\x20Supported\x20scenes:\x20','validation','Unsupported\x20OCR\x20scene:\x20','\x20OCR','write','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','1953720zcPNDf','fileName','body','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','idcard','general','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','scene','apiError','filePath','str','/client/uploadFile','invoice'];a34_0x26ce=function(){return _0xea5492;};return a34_0x26ce();}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';function a34_0x4243(_0x2e6502,_0x4e8ab3){_0x2e6502=_0x2e6502-0x167;const _0x26ce29=a34_0x26ce();let _0x424382=_0x26ce29[_0x2e6502];return _0x424382;}import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=['invoice','general',a34_0x378393(0x17e),a34_0x378393(0x17d)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':'General','form':a34_0x378393(0x170),'idCard':a34_0x378393(0x187)},SCENE_FLAG={'name':a34_0x378393(0x16a),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x378393(0x169)},IMAGE_FILE_FLAG={'name':a34_0x378393(0x190),'type':a34_0x378393(0x18c),'description':a34_0x378393(0x184)},IMAGE_URL_FLAG={'name':a34_0x378393(0x17f),'type':'string','description':a34_0x378393(0x183)};function normalizeScene(_0x230ffc){const _0x26a3c7=a34_0x378393,_0x588fc6=_0x230ffc[_0x26a3c7(0x18d)]()['toLowerCase']();if(_0x588fc6===_0x26a3c7(0x167))return _0x26a3c7(0x17d);if(_0x588fc6===_0x26a3c7(0x16f)||_0x588fc6===_0x26a3c7(0x168)||_0x588fc6===_0x26a3c7(0x17e))return _0x588fc6;throw CliErrors['validation'](_0x26a3c7(0x196)+_0x230ffc+_0x26a3c7(0x194)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0xd92c4a){const _0x28a345=a34_0x378393,_0x5153d0=_0xd92c4a['str']('image-file')['trim'](),_0x189d2d=_0xd92c4a[_0x28a345(0x16d)](_0x28a345(0x17f))[_0x28a345(0x18d)]();return{'imageFile':_0x5153d0,'imageUrl':_0x189d2d,'count':[_0x5153d0,_0x189d2d][_0x28a345(0x177)](Boolean)[_0x28a345(0x192)]};}function validateInputSelection(_0x547063){const _0x5d9fec=a34_0x378393,_0x35e904=selectedInputs(_0x547063);if(_0x35e904['count']!==0x1)throw CliErrors[_0x5d9fec(0x195)](_0x5d9fec(0x19d));return _0x35e904;}function withScene(_0x1e0737,_0x53c376,_0x4994e2){const _0x166b22=a34_0x378393;return{..._0x1e0737,'scene':_0x53c376,..._0x4994e2?{'sourceFile':{'fileName':_0x4994e2[_0x166b22(0x19b)],'filePath':_0x4994e2['filePath']}}:{}};}const ocrRecognize={'service':a34_0x378393(0x185),'command':a34_0x378393(0x188),'description':a34_0x378393(0x186),'risk':a34_0x378393(0x198),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x3a20d6){const _0x37f043=a34_0x378393,_0x23a4ef=normalizeScene(_0x3a20d6['str']('scene')),_0x44396c=SCENE_TO_LEGACY_TYPE[_0x23a4ef],_0x1ea445=validateInputSelection(_0x3a20d6);if(_0x1ea445[_0x37f043(0x179)])return dryRun('POST','/client/ocr')[_0x37f043(0x19c)]({'appCode':_0x3a20d6[_0x37f043(0x175)],'url':_0x1ea445[_0x37f043(0x179)],'type':_0x44396c})[_0x37f043(0x176)]('Preview:\x20recognize\x20'+_0x23a4ef+'\x20OCR\x20from\x20URL')[_0x37f043(0x171)]();const _0x548c12=requireRuntimeUploadFile(_0x1ea445[_0x37f043(0x178)],_0x37f043(0x190));return dryRun(_0x37f043(0x18b),_0x37f043(0x16e))[_0x37f043(0x19c)]({'steps':[{'method':_0x37f043(0x18b),'url':'/client/uploadFile','body':{'appCode':_0x3a20d6['appCode'],'multipart':{'file':_0x548c12}}},{'method':_0x37f043(0x18b),'url':_0x37f043(0x193),'body':{'filePath':_0x37f043(0x17b),'downloadFlag':![]}},{'method':_0x37f043(0x18b),'url':_0x37f043(0x174),'body':{'appCode':_0x3a20d6[_0x37f043(0x175)],'url':_0x37f043(0x182),'type':_0x44396c}}]})[_0x37f043(0x176)](_0x37f043(0x199)+_0x23a4ef+_0x37f043(0x197))[_0x37f043(0x171)]();},async 'execute'(_0x10df49){const _0x3773e2=a34_0x378393,_0x1c416b=normalizeScene(_0x10df49[_0x3773e2(0x16d)](_0x3773e2(0x16a))),_0x417fb4=SCENE_TO_LEGACY_TYPE[_0x1c416b],_0x46283b=validateInputSelection(_0x10df49);if(_0x46283b[_0x3773e2(0x179)]){const _0x17a6b7=await recognizeRuntimeOcr(_0x10df49[_0x3773e2(0x175)],{'url':_0x46283b['imageUrl'],'type':_0x417fb4});return{'ok':!![],'data':withScene(_0x17a6b7,_0x1c416b)};}const _0x35a0f6=requireRuntimeUploadFile(_0x46283b[_0x3773e2(0x178)],'image-file'),_0x1ec022=await uploadRuntimeFile(_0x10df49[_0x3773e2(0x175)],_0x35a0f6[_0x3773e2(0x17a)]);if(!_0x1ec022[_0x3773e2(0x16c)])throw CliErrors[_0x3773e2(0x16b)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x2e7f64=await queryRuntimeFileUrl(_0x1ec022['filePath'],{'download':![]});if(!_0x2e7f64[_0x3773e2(0x180)])throw CliErrors['apiError'](_0x3773e2(0x189));const _0x4e9f2c=await recognizeRuntimeOcr(_0x10df49[_0x3773e2(0x175)],{'url':_0x2e7f64[_0x3773e2(0x180)],'type':_0x417fb4});return{'ok':!![],'data':withScene(_0x4e9f2c,_0x1c416b,_0x1ec022)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
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];
|
|
1
|
+
const a35_0x5a8e40=a35_0x2392;(function(_0x4b6d8c,_0x549f08){const _0x5ac280=a35_0x2392,_0x4c39ae=_0x4b6d8c();while(!![]){try{const _0x127c70=-parseInt(_0x5ac280(0x1e7))/0x1*(parseInt(_0x5ac280(0x209))/0x2)+parseInt(_0x5ac280(0x1ff))/0x3*(parseInt(_0x5ac280(0x1f7))/0x4)+parseInt(_0x5ac280(0x201))/0x5+parseInt(_0x5ac280(0x1d3))/0x6*(parseInt(_0x5ac280(0x1fb))/0x7)+-parseInt(_0x5ac280(0x200))/0x8+parseInt(_0x5ac280(0x1ea))/0x9*(parseInt(_0x5ac280(0x1e8))/0xa)+parseInt(_0x5ac280(0x1fe))/0xb*(parseInt(_0x5ac280(0x207))/0xc);if(_0x127c70===_0x549f08)break;else _0x4c39ae['push'](_0x4c39ae['shift']());}catch(_0x5a11d1){_0x4c39ae['push'](_0x4c39ae['shift']());}}}(a35_0x22ec,0xe1ea2));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x5a8e40(0x1d1),'type':a35_0x5a8e40(0x1e0),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':'name','type':a35_0x5a8e40(0x1e0),'required':!![],'description':a35_0x5a8e40(0x1dc)},DESCRIPTION_FLAG={'name':a35_0x5a8e40(0x1cc),'type':'string','description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x5a8e40(0x1f8),'type':a35_0x5a8e40(0x1e0),'description':a35_0x5a8e40(0x1dd)};function normalizeFunctionName(_0x1c9fd5){const _0x5e5933=a35_0x5a8e40,_0x4c16c2=String(_0x1c9fd5||'')[_0x5e5933(0x1c6)]();if(!_0x4c16c2||!FUNCTION_NAME_PATTERN[_0x5e5933(0x1ed)](_0x4c16c2))throw CliErrors[_0x5e5933(0x204)]('--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.');return _0x4c16c2;}function a35_0x22ec(){const _0xfae469=['high-risk-write','Update\x20a\x20personal\x20BFF\x20by\x20id','Preview:\x20create\x20personal\x20BFF\x20','exec','detail','658655sKgBpy','60iGPhEj','name','1354734WXNrCQ','verbose','params','test','appCode','personal-bff','write','isArray','map','createUserId','bool','updateTime','createTime','356uvMCer','source-session-id','Personal\x20BFF\x20script\x20ID','version','42fRwWrn','create','read','319xkjWkL','28533vHEPhc','9134792lqVDwO','4392315mbLmGl','functionName','scriptType','validation','Executed\x20personal\x20BFF\x20','Personal\x20BFF\x20script\x20file\x20is\x20blank.','22332VnwOlO','File\x20not\x20found:\x20','4kCeENZ','Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','trim','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','config','File\x20path\x20is\x20required.','num','isFile','description','scriptContent','--params\x20must\x20be\x20a\x20JSON\x20object.','Created\x20personal\x20BFF\x20','Updated\x20personal\x20BFF\x20','file','gmtModified','702438neAMVx','POST','flag','File\x20is\x20not\x20a\x20regular\x20file:\x20','str','keys','list','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','body','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','Optional\x20source\x20RuntimeAgent\x20session\x20id','Preview:\x20update\x20personal\x20BFF\x20','Show\x20one\x20personal\x20BFF\x20by\x20id','string','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'];a35_0x22ec=function(){return _0xfae469;};return a35_0x22ec();}function readScriptFile(_0x39d01f){const _0x4faadd=a35_0x5a8e40;if(!_0x39d01f)throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x1c9));if(!existsSync(_0x39d01f))throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x208)+_0x39d01f);if(!statSync(_0x39d01f)[_0x4faadd(0x1cb)]())throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x1d6)+_0x39d01f);const _0x5e3182=readFileSync(_0x39d01f,'utf8');if(!_0x5e3182[_0x4faadd(0x1c6)]())throw CliErrors[_0x4faadd(0x204)](_0x4faadd(0x206));return _0x5e3182;}function optionalTrimmed(_0x2f46ff){const _0x4e3bc9=String(_0x2f46ff||'')['trim']();return _0x4e3bc9||undefined;}function summarizeBff(_0x1cfdce){const _0x4a6494=a35_0x5a8e40;return{'id':_0x1cfdce['id'],'appCode':_0x1cfdce[_0x4a6494(0x1ee)],'functionName':_0x1cfdce['functionName'],'description':_0x1cfdce[_0x4a6494(0x1cc)],'scriptType':_0x1cfdce[_0x4a6494(0x203)],'version':_0x1cfdce[_0x4a6494(0x1fa)],'gmtModified':_0x1cfdce[_0x4a6494(0x1d2)],'updateTime':_0x1cfdce[_0x4a6494(0x1f5)]};}function detailBff(_0x485b28){const _0x696149=a35_0x5a8e40;return{'id':_0x485b28['id'],'appCode':_0x485b28[_0x696149(0x1ee)],'functionName':_0x485b28[_0x696149(0x202)],'description':_0x485b28[_0x696149(0x1cc)],'scriptType':_0x485b28[_0x696149(0x203)],'scriptContent':_0x485b28[_0x696149(0x1cd)]??'','config':_0x485b28[_0x696149(0x1c8)],'version':_0x485b28['version'],'createUserId':_0x485b28[_0x696149(0x1f3)],'gmtCreate':_0x485b28['gmtCreate'],'gmtModified':_0x485b28[_0x696149(0x1d2)],'createTime':_0x485b28[_0x696149(0x1f6)],'updateTime':_0x485b28[_0x696149(0x1f5)]};}function a35_0x2392(_0x2b1944,_0x212ff6){_0x2b1944=_0x2b1944-0x1c5;const _0x22ec30=a35_0x22ec();let _0x2392ce=_0x22ec30[_0x2b1944];return _0x2392ce;}function buildCreateInput(_0x1949d3){const _0x2a5c4e=a35_0x5a8e40;return{'functionName':normalizeFunctionName(_0x1949d3[_0x2a5c4e(0x1d7)]('name')),...optionalTrimmed(_0x1949d3['str'](_0x2a5c4e(0x1cc)))?{'description':optionalTrimmed(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1cc)))}:{},'scriptContent':readScriptFile(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1d1))),...optionalTrimmed(_0x1949d3[_0x2a5c4e(0x1d7)](_0x2a5c4e(0x1f8)))?{'sourceSessionId':optionalTrimmed(_0x1949d3['str'](_0x2a5c4e(0x1f8)))}:{}};}function buildUpdateInput(_0x110df4){const _0x404a4a=a35_0x5a8e40,_0x585c3c={};optionalTrimmed(_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1e9)))&&(_0x585c3c[_0x404a4a(0x202)]=normalizeFunctionName(_0x110df4['str'](_0x404a4a(0x1e9))));_0x110df4[_0x404a4a(0x1d5)](_0x404a4a(0x1cc))!==undefined&&(_0x585c3c[_0x404a4a(0x1cc)]=_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1cc)));optionalTrimmed(_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1d1)))&&(_0x585c3c[_0x404a4a(0x1cd)]=readScriptFile(_0x110df4[_0x404a4a(0x1d7)]('file')));_0x110df4[_0x404a4a(0x1d5)]('source-session-id')!==undefined&&(_0x585c3c['sourceSessionId']=_0x110df4[_0x404a4a(0x1d7)](_0x404a4a(0x1f8)));if(Object[_0x404a4a(0x1d8)](_0x585c3c)['length']===0x0)throw CliErrors[_0x404a4a(0x204)](_0x404a4a(0x1da));return _0x585c3c;}function parseExecParams(_0x5a0560){const _0x3c6e37=a35_0x5a8e40,_0xa6d0f4=parseJsonParams(_0x5a0560)??{};if(Array[_0x3c6e37(0x1f1)](_0xa6d0f4))throw CliErrors[_0x3c6e37(0x204)](_0x3c6e37(0x1ce));return _0xa6d0f4;}const personalBffList={'service':'personal-bff','command':a35_0x5a8e40(0x1d9),'description':a35_0x5a8e40(0x1c7),'risk':a35_0x5a8e40(0x1fd),'flags':[VERBOSE_FLAG],async 'execute'(_0x4fbd36){const _0x10a009=a35_0x5a8e40,_0x314005=await listPersonalBffs(_0x4fbd36[_0x10a009(0x1ee)]);return{'ok':!![],'data':{'total':_0x314005['length'],'items':_0x4fbd36[_0x10a009(0x1f4)](_0x10a009(0x1eb))?_0x314005:_0x314005[_0x10a009(0x1f2)](summarizeBff)}};}},personalBffDetail={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1e6),'description':a35_0x5a8e40(0x1df),'risk':a35_0x5a8e40(0x1fd),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)}],async 'execute'(_0x26b7ba){const _0x89558a=a35_0x5a8e40,_0x47c417=await getPersonalBff(_0x26b7ba[_0x89558a(0x1ca)]('id'),_0x26b7ba[_0x89558a(0x1ee)]);return{'ok':!![],'data':detailBff(_0x47c417)};}},personalBffCreate={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1fc),'description':a35_0x5a8e40(0x1c5),'risk':a35_0x5a8e40(0x1f0),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x390260){const _0x571a4e=a35_0x5a8e40,_0x3ef570=buildCreateInput(_0x390260),_0x46f8ef=await createPersonalBff(_0x390260['appCode'],_0x3ef570);return{'ok':!![],'data':detailBff(_0x46f8ef),'message':_0x571a4e(0x1cf)+_0x46f8ef['id']+(_0x46f8ef[_0x571a4e(0x202)]?'\x20('+_0x46f8ef[_0x571a4e(0x202)]+')':'')};},async 'dryRun'(_0x36ec90){const _0x2c18c8=a35_0x5a8e40,_0xad202e=buildCreateInput(_0x36ec90);return dryRun(_0x2c18c8(0x1d4),'/client/runtime-bff/personal/create')[_0x2c18c8(0x1db)]({'appCode':_0x36ec90[_0x2c18c8(0x1ee)],..._0xad202e})[_0x2c18c8(0x1cc)](_0x2c18c8(0x1e4)+_0xad202e[_0x2c18c8(0x202)])['build']();}},personalBffUpdate={'service':a35_0x5a8e40(0x1ef),'command':'update','description':a35_0x5a8e40(0x1e3),'risk':a35_0x5a8e40(0x1f0),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x38a199){const _0x286ec4=a35_0x5a8e40,_0x20b081=_0x38a199[_0x286ec4(0x1ca)]('id'),_0xa0e562=buildUpdateInput(_0x38a199),_0x56700a=await updatePersonalBff(_0x20b081,_0x38a199[_0x286ec4(0x1ee)],_0xa0e562);return{'ok':!![],'data':detailBff(_0x56700a),'message':_0x286ec4(0x1d0)+_0x56700a['id']+(_0x56700a[_0x286ec4(0x202)]?'\x20('+_0x56700a[_0x286ec4(0x202)]+')':'')};},async 'dryRun'(_0x564687){const _0x714469=a35_0x5a8e40,_0x3528ce=_0x564687['num']('id'),_0x2fda46=buildUpdateInput(_0x564687);return dryRun(_0x714469(0x1d4),'/client/runtime-bff/personal/'+_0x3528ce+'/update')['body']({'appCode':_0x564687['appCode'],..._0x2fda46})[_0x714469(0x1cc)](_0x714469(0x1de)+_0x3528ce)['build']();}},personalBffExec={'service':a35_0x5a8e40(0x1ef),'command':a35_0x5a8e40(0x1e5),'description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0x5a8e40(0x1e2),'flags':[{...ID_FLAG,'description':a35_0x5a8e40(0x1f9)},{...PARAMS_FLAG,'description':a35_0x5a8e40(0x1e1)}],async 'validate'(_0xbc6ca0){const _0x59a362=a35_0x5a8e40;parseExecParams(_0xbc6ca0[_0x59a362(0x1d7)]('params'));},async 'execute'(_0x92d006){const _0xacdd65=a35_0x5a8e40,_0x30d169=_0x92d006[_0xacdd65(0x1ca)]('id'),_0xeb2524=parseExecParams(_0x92d006[_0xacdd65(0x1d7)](_0xacdd65(0x1ec))),_0x31c4db=await executePersonalBff(_0x30d169,_0x92d006[_0xacdd65(0x1ee)],_0xeb2524);return{'ok':!![],'data':{'result':_0x31c4db},'message':_0xacdd65(0x205)+_0x30d169};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2b3426=a36_0xe38c;(function(_0x5491cd,_0x4046d0){const _0x41223b=a36_0xe38c,_0x550774=_0x5491cd();while(!![]){try{const _0x4d5ccd=parseInt(_0x41223b(0xed))/0x1*(-parseInt(_0x41223b(0xe6))/0x2)+parseInt(_0x41223b(0xef))/0x3*(-parseInt(_0x41223b(0xd7))/0x4)+parseInt(_0x41223b(0xe0))/0x5+parseInt(_0x41223b(0xe5))/0x6+parseInt(_0x41223b(0xd4))/0x7+-parseInt(_0x41223b(0xd6))/0x8*(-parseInt(_0x41223b(0xe3))/0x9)+parseInt(_0x41223b(0xdb))/0xa*(parseInt(_0x41223b(0xd3))/0xb);if(_0x4d5ccd===_0x4046d0)break;else _0x550774['push'](_0x550774['shift']());}catch(_0x44df8e){_0x550774['push'](_0x550774['shift']());}}}(a36_0x556c,0x32aad));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';function a36_0x556c(){const _0x48a9d5=['write','CLI\x20Built-in\x20Skill','Self\x20Update','325477ywNrAD','OCR','465fyQtiz','Datasets','API\x20Documentation','Service\x20Tree','command','Workspace','risk','SQL\x20Queries','Instant\x20API','Schema','File','description','values','login','Skills','defaultCommand','isSingleCommand','Knowledge\x20Base','Agent\x20Schedules','121KWSnHI','2649857FQBrKv','service','435384jzbQLT','7972hFPMbq','get','BFF\x20Scripts','show','108790izVsph','install','set','Personal\x20BFF','Artifacts','49870FcFzuM','push','list','54lkJXRD','run','43158xtqYDW','2LCQlzw','map','\x20\x20[write]','Diagnostics'];a36_0x556c=function(){return _0x48a9d5;};return a36_0x556c();}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';function a36_0xe38c(_0x5e2bc8,_0x12bc59){_0x5e2bc8=_0x5e2bc8-0xcd;const _0x556c5d=a36_0x556c();let _0xe38c38=_0x556c5d[_0x5e2bc8];return _0xe38c38;}export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x58be0c){const _0x49ec2a=a36_0xe38c;for(const _0xd7d6f8 of _0x58be0c){definitions[_0x49ec2a(0xdd)](_0xd7d6f8[_0x49ec2a(0xd5)]+':'+_0xd7d6f8[_0x49ec2a(0xf3)],_0xd7d6f8);let _0x43266a=serviceGroups[_0x49ec2a(0xd8)](_0xd7d6f8[_0x49ec2a(0xd5)]);!_0x43266a&&(_0x43266a=[],serviceGroups[_0x49ec2a(0xdd)](_0xd7d6f8['service'],_0x43266a)),_0x43266a['push'](_0xd7d6f8);}}function registerService(_0x269bb4,_0x3c4aa6,_0x27c68b){const _0x36a7a6=a36_0xe38c;registerDefinitions(_0x3c4aa6);const _0x5e6739=_0x46e65e=>_0x46e65e==='read'?'':_0x46e65e===_0x36a7a6(0xea)?_0x36a7a6(0xe8):'\x20\x20[high-risk-write]',_0x181c5c={'service':_0x3c4aa6[0x0][_0x36a7a6(0xd5)],'label':_0x269bb4,'commands':_0x3c4aa6[_0x36a7a6(0xe7)](_0x1ba678=>({'command':_0x1ba678[_0x36a7a6(0xf3)],'description':_0x1ba678[_0x36a7a6(0xfa)],'tag':_0x5e6739(_0x1ba678[_0x36a7a6(0xf5)])})),'defaultCommand':_0x27c68b?.[_0x36a7a6(0xcf)]??(_0x27c68b?.[_0x36a7a6(0xd0)]?_0x3c4aa6[0x0]['command']:undefined),'isSingleCommand':_0x27c68b?.['isSingleCommand']};serviceRegistry[_0x36a7a6(0xe1)](_0x181c5c),serviceByName['set'](_0x181c5c['service'],_0x181c5c);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x2b3426(0xcd)}),registerService('App\x20Management',appDefinitions,{'defaultCommand':a36_0x2b3426(0xe2)}),registerService(a36_0x2b3426(0xf4),workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x2b3426(0xe2)}),registerService(a36_0x2b3426(0xf1),apiDocDefinitions),registerService(a36_0x2b3426(0xf0),datasetDefinitions),registerService(a36_0x2b3426(0xf7),dataDefinitions),registerService(a36_0x2b3426(0xf6),sqlDefinitions),registerService(a36_0x2b3426(0xd9),bffDefinitions),registerService(a36_0x2b3426(0xde),personalBffDefinitions),registerService(a36_0x2b3426(0xdf),artifactDefinitions),registerService(a36_0x2b3426(0xf9),fileDefinitions),registerService(a36_0x2b3426(0xee),ocrDefinitions),registerService(a36_0x2b3426(0xd1),kbDefinitions),registerService(a36_0x2b3426(0xd2),scheduleDefinitions,{'defaultCommand':a36_0x2b3426(0xe2)}),registerService(a36_0x2b3426(0xf2),serviceDefinitions,{'defaultCommand':a36_0x2b3426(0xe2)}),registerService(a36_0x2b3426(0xce),skillDefinitions,{'defaultCommand':a36_0x2b3426(0xdc)}),registerService(a36_0x2b3426(0xeb),cliSkillDefinitions,{'defaultCommand':a36_0x2b3426(0xdc)}),registerService(a36_0x2b3426(0xec),[updateDefinition],{'defaultCommand':a36_0x2b3426(0xe4),'isSingleCommand':!![]}),registerService(a36_0x2b3426(0xe9),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x2b3426(0xf8),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x2b3426(0xda)});export function findDefinition(_0x3e09e1,_0x51a499){const _0xaa046f=a36_0x2b3426;return definitions[_0xaa046f(0xd8)](_0x3e09e1+':'+_0x51a499);}export function isKnownService(_0x113bf1){return serviceByName['has'](_0x113bf1);}export function getServiceEntry(_0x2896f6){return serviceByName['get'](_0x2896f6);}export function getAllDefinitions(){const _0x46c54e=a36_0x2b3426;return Array['from'](definitions[_0x46c54e(0xfb)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x1e6163=a37_0x40f6;function a37_0x40f6(_0x3a6061,_0x176ae5){_0x3a6061=_0x3a6061-0x1b7;const _0x408429=a37_0x4084();let _0x40f670=_0x408429[_0x3a6061];return _0x40f670;}(function(_0xb6acd1,_0x45b1bb){const _0x4da412=a37_0x40f6,_0x1c573b=_0xb6acd1();while(!![]){try{const _0x324a78=parseInt(_0x4da412(0x1e9))/0x1*(parseInt(_0x4da412(0x1ca))/0x2)+parseInt(_0x4da412(0x1c5))/0x3+-parseInt(_0x4da412(0x1e8))/0x4*(-parseInt(_0x4da412(0x1e6))/0x5)+-parseInt(_0x4da412(0x1e3))/0x6+-parseInt(_0x4da412(0x1da))/0x7*(-parseInt(_0x4da412(0x1c7))/0x8)+-parseInt(_0x4da412(0x1dc))/0x9+parseInt(_0x4da412(0x1ee))/0xa*(-parseInt(_0x4da412(0x1e1))/0xb);if(_0x324a78===_0x45b1bb)break;else _0x1c573b['push'](_0x1c573b['shift']());}catch(_0x19d51e){_0x1c573b['push'](_0x1c573b['shift']());}}}(a37_0x4084,0x859cf));import{createRuntimeSchedule,deleteRuntimeSchedule,getRuntimeSchedule,listRuntimeSchedules,runRuntimeSchedule,validateRuntimeSchedule}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SCHEDULE_ID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,KIND_FLAG={'name':a37_0x1e6163(0x1fd),'type':a37_0x1e6163(0x1f2),'required':!![],'enum':[a37_0x1e6163(0x1d7),'ONCE'],'description':a37_0x1e6163(0x1cc)},CRON_FLAG={'name':a37_0x1e6163(0x1f9),'type':'string','description':a37_0x1e6163(0x201)},SCHEDULED_AT_FLAG={'name':a37_0x1e6163(0x1d1),'type':'string','description':a37_0x1e6163(0x1b9)},TITLE_FLAG={'name':a37_0x1e6163(0x200),'type':a37_0x1e6163(0x1f2),'required':!![],'description':a37_0x1e6163(0x1c3)},PROMPT_FLAG={'name':'prompt','type':a37_0x1e6163(0x1f2),'required':!![],'description':a37_0x1e6163(0x1ce)},CHANNEL_FLAG={'name':a37_0x1e6163(0x1e7),'type':a37_0x1e6163(0x1f2),'enum':[a37_0x1e6163(0x1ea),a37_0x1e6163(0x1d0)],'default':a37_0x1e6163(0x1d0),'description':a37_0x1e6163(0x1f7)},SCHEDULE_ID_FLAG={'name':a37_0x1e6163(0x202),'type':a37_0x1e6163(0x1f2),'required':!![],'description':a37_0x1e6163(0x1e0),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x1e6163(0x1cf)}},LIMIT_FLAG={'name':'limit','type':a37_0x1e6163(0x1d9),'default':0x14,'description':a37_0x1e6163(0x1bb)},CURSOR_FLAG={'name':a37_0x1e6163(0x1fa),'type':a37_0x1e6163(0x1f2),'description':a37_0x1e6163(0x1c1)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0xb0223e){const _0x1d780d=a37_0x1e6163,_0x2964e1=_0xb0223e['str'](_0x1d780d(0x1fd)),_0x1bfcf4=_0xb0223e['str'](_0x1d780d(0x200))[_0x1d780d(0x1e4)](),_0xce4cd2=_0xb0223e['str'](_0x1d780d(0x1df))[_0x1d780d(0x1e4)](),_0x549338=_0xb0223e[_0x1d780d(0x1ef)](_0x1d780d(0x1e7)),_0x3435f8=_0xb0223e[_0x1d780d(0x1ef)](_0x1d780d(0x1f9)),_0x40c8c0=_0xb0223e[_0x1d780d(0x1ef)](_0x1d780d(0x1d1));if(!_0x1bfcf4)throw CliErrors[_0x1d780d(0x1ff)]('--title\x20must\x20not\x20be\x20blank.');if(!_0xce4cd2)throw CliErrors[_0x1d780d(0x1ff)](_0x1d780d(0x1bf));if(_0x2964e1===_0x1d780d(0x1d7)){if(!_0x3435f8||_0x40c8c0)throw CliErrors['validation'](_0x1d780d(0x1dd));return{'kind':_0x2964e1,'timezone':_0x1d780d(0x1bd),'cron':_0x3435f8,'title':_0x1bfcf4,'prompt':_0xce4cd2,'channel':_0x549338};}if(_0x2964e1===_0x1d780d(0x1c8)){if(!_0x40c8c0||_0x3435f8)throw CliErrors[_0x1d780d(0x1ff)](_0x1d780d(0x1f6));return{'kind':_0x2964e1,'timezone':'UTC','scheduledAt':_0x40c8c0,'title':_0x1bfcf4,'prompt':_0xce4cd2,'channel':_0x549338};}throw CliErrors[_0x1d780d(0x1ff)](_0x1d780d(0x1d4));}function scheduleCollectionPath(_0x1c91ac){const _0x1fe7e1=a37_0x1e6163;return'/api/harness/apps/'+encodeURIComponent(_0x1c91ac)+_0x1fe7e1(0x1e5);}function scheduleItemPath(_0x2367ed,_0x1d4326){return scheduleCollectionPath(_0x2367ed)+'/'+encodeURIComponent(_0x1d4326);}const scheduleValidate={'service':'schedule','command':a37_0x1e6163(0x1be),'description':a37_0x1e6163(0x1db),'risk':'read','flags':INPUT_FLAGS,async 'validate'(_0x5d5233){readScheduleInput(_0x5d5233);},async 'execute'(_0x343cbc){const _0x215b10=a37_0x1e6163,_0xea0b8b=readScheduleInput(_0x343cbc),_0x1d499b=await validateRuntimeSchedule(_0x343cbc[_0x215b10(0x1fe)],_0xea0b8b);return{'ok':!![],'data':_0x1d499b,'message':_0x215b10(0x1b8)};}},scheduleCreate={'service':a37_0x1e6163(0x1d3),'command':a37_0x1e6163(0x1f3),'description':a37_0x1e6163(0x1fb),'risk':a37_0x1e6163(0x1f8),'flags':INPUT_FLAGS,async 'validate'(_0x521b66){readScheduleInput(_0x521b66);},async 'execute'(_0x36acaa){const _0x45df5c=a37_0x1e6163,_0x16b317=readScheduleInput(_0x36acaa),_0xea0015=await validateRuntimeSchedule(_0x36acaa['appCode'],_0x16b317),_0xdead59=await createRuntimeSchedule(_0x36acaa[_0x45df5c(0x1fe)],_0xea0015);return{'ok':!![],'data':_0xdead59,'message':_0x45df5c(0x1c9)+_0xdead59[_0x45df5c(0x1fd)]+_0x45df5c(0x1d8)+_0xdead59[_0x45df5c(0x1ed)]};},async 'dryRun'(_0x2da549){const _0x3d6977=a37_0x1e6163,_0x445825=readScheduleInput(_0x2da549);return dryRun(_0x3d6977(0x1eb),scheduleCollectionPath(_0x2da549[_0x3d6977(0x1fe)]))[_0x3d6977(0x1f0)](_0x445825)['description'](_0x3d6977(0x1de))['build']();}},scheduleList={'service':a37_0x1e6163(0x1d3),'command':a37_0x1e6163(0x1cd),'description':a37_0x1e6163(0x205),'risk':a37_0x1e6163(0x1c4),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x1770dc){const _0xc5c08b=a37_0x1e6163,_0x5b4b81=_0x1770dc[_0xc5c08b(0x1bc)]('limit');if(!Number['isSafeInteger'](_0x5b4b81)||_0x5b4b81<0x1||_0x5b4b81>0x64)throw CliErrors['validation']('--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.');const _0x448731=_0x1770dc[_0xc5c08b(0x1ef)](_0xc5c08b(0x1fa));if(_0x448731&&(_0x448731[_0xc5c08b(0x1d5)]>0x400||_0x448731[_0xc5c08b(0x1e4)]()!==_0x448731))throw CliErrors[_0xc5c08b(0x1ff)](_0xc5c08b(0x1f4));},async 'execute'(_0x97430e){const _0xa6a54d=a37_0x1e6163,_0x4358d4=_0x97430e[_0xa6a54d(0x1ef)](_0xa6a54d(0x1fa)),_0x13ed25=await listRuntimeSchedules(_0x97430e['appCode'],{'limit':_0x97430e[_0xa6a54d(0x1bc)](_0xa6a54d(0x1c0)),..._0x4358d4?{'cursor':_0x4358d4}:{}});return{'ok':!![],'data':_0x13ed25};}},scheduleDetail={'service':a37_0x1e6163(0x1d3),'command':a37_0x1e6163(0x1e2),'description':a37_0x1e6163(0x1f1),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xc81d8b){const _0x495e70=a37_0x1e6163,_0x27d3fc=await getRuntimeSchedule(_0xc81d8b['appCode'],_0xc81d8b['str'](_0x495e70(0x202)));return{'ok':!![],'data':_0x27d3fc};}},scheduleRun={'service':a37_0x1e6163(0x1d3),'command':a37_0x1e6163(0x1d2),'description':'Run\x20one\x20schedule\x20immediately\x20and\x20create\x20a\x20Task','risk':a37_0x1e6163(0x1f8),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2873e7){const _0x129495=a37_0x1e6163,_0x6f6fb0=_0x2873e7[_0x129495(0x1ef)]('schedule-id'),_0x4369e9=await runRuntimeSchedule(_0x2873e7['appCode'],_0x6f6fb0);return{'ok':!![],'data':_0x4369e9,'message':_0x129495(0x1b7)+_0x4369e9['taskId']+_0x129495(0x1ec)+_0x6f6fb0};},async 'dryRun'(_0x2a9870){const _0x222ae6=a37_0x1e6163,_0x28e6ce=_0x2a9870[_0x222ae6(0x1ef)](_0x222ae6(0x202));return dryRun(_0x222ae6(0x1eb),scheduleItemPath(_0x2a9870['appCode'],_0x28e6ce)+_0x222ae6(0x203))[_0x222ae6(0x1c2)](_0x222ae6(0x204)+_0x28e6ce+_0x222ae6(0x1ba))[_0x222ae6(0x1c6)]();}},scheduleDelete={'service':a37_0x1e6163(0x1d3),'command':a37_0x1e6163(0x1fc),'description':a37_0x1e6163(0x1f5),'risk':'high-risk-write','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0xd03ef){const _0x16dd87=a37_0x1e6163,_0x52b1d4=_0xd03ef[_0x16dd87(0x1ef)](_0x16dd87(0x202)),_0x309ebd=await deleteRuntimeSchedule(_0xd03ef[_0x16dd87(0x1fe)],_0x52b1d4);return{'ok':!![],'data':_0x309ebd,'message':'Deleted\x20schedule\x20'+_0x52b1d4};},async 'dryRun'(_0x389566){const _0x41bf86=a37_0x1e6163,_0x4ca190=_0x389566[_0x41bf86(0x1ef)](_0x41bf86(0x202));return dryRun(_0x41bf86(0x1d6),scheduleItemPath(_0x389566['appCode'],_0x4ca190))[_0x41bf86(0x1c2)](_0x41bf86(0x1cb)+_0x4ca190)[_0x41bf86(0x1c6)]();}};function a37_0x4084(){const _0x445695=['high-risk-write','cron','cursor','Create\x20a\x20recurring\x20or\x20one-time\x20Agent\x20schedule','delete','kind','appCode','validation','title','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','schedule-id','/run','Preview:\x20run\x20schedule\x20','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','Queued\x20Task\x20','Schedule\x20input\x20is\x20valid','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','\x20immediately','Page\x20size\x20from\x201\x20to\x20100','num','UTC','validate','--prompt\x20must\x20not\x20be\x20blank.','limit','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','description','Schedule\x20title','read','2944785kyGtnD','build','8zfDyzu','ONCE','Created\x20','11922KidzLG','Preview:\x20delete\x20schedule\x20','Schedule\x20kind:\x20CRON\x20or\x20ONCE','list','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','premium','scheduled-at','run','schedule','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','length','DELETE','CRON','\x20schedule\x20','number','1145235LIvJwU','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','1957887CwpQGY','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','Preview:\x20create\x20an\x20Agent\x20schedule','prompt','Schedule\x20UUID','12207602bGhgjc','detail','5407806vxXcck','trim','/schedules','5FGnRhJ','channel','2803156zdHObP','156nNNDEY','auto','POST','\x20from\x20schedule\x20','scheduleId','10ibUVpt','str','body','Show\x20one\x20schedule\x20by\x20schedule\x20ID','string','create','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Delete\x20a\x20schedule\x20and\x20stop\x20its\x20future\x20triggers','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Task\x20channel:\x20auto\x20or\x20premium'];a37_0x4084=function(){return _0x445695;};return a37_0x4084();}export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x51850a=a38_0x2ef2;(function(_0x71dc31,_0x5cd7db){const _0x7331fc=a38_0x2ef2,_0x310316=_0x71dc31();while(!![]){try{const _0x417130=-parseInt(_0x7331fc(0x11d))/0x1+-parseInt(_0x7331fc(0x121))/0x2*(-parseInt(_0x7331fc(0x11e))/0x3)+parseInt(_0x7331fc(0x120))/0x4*(-parseInt(_0x7331fc(0x124))/0x5)+-parseInt(_0x7331fc(0x123))/0x6*(parseInt(_0x7331fc(0x128))/0x7)+parseInt(_0x7331fc(0x11b))/0x8*(parseInt(_0x7331fc(0x126))/0x9)+parseInt(_0x7331fc(0x11c))/0xa+parseInt(_0x7331fc(0x125))/0xb*(parseInt(_0x7331fc(0x127))/0xc);if(_0x417130===_0x5cd7db)break;else _0x310316['push'](_0x310316['shift']());}catch(_0x3ac987){_0x310316['push'](_0x310316['shift']());}}}(a38_0x1a91,0xc8e63));function a38_0x1a91(){const _0x7ee5ec=['read','247206SnEARa','10PMDMuv','66RNRVZX','130698tSxmCO','1762248IeRKxt','203ESkbkA','344ZakCpW','7792430ebRvMj','798476JtOXmW','20745fKOaST','schema','748980BPvggk','262SqgqMa'];a38_0x1a91=function(){return _0x7ee5ec;};return a38_0x1a91();}function a38_0x2ef2(_0x28d82a,_0x2e3e94){_0x28d82a=_0x28d82a-0x11b;const _0x1a91ab=a38_0x1a91();let _0x2ef285=_0x1a91ab[_0x28d82a];return _0x2ef285;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x1e966c){const _0x1ed0b0=await buildSchemaPayload();return{'ok':!![],'data':_0x1ed0b0};}export const schemaDefinition={'service':a38_0x51850a(0x11f),'command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a38_0x51850a(0x122),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|