@lovrabet/lovrabet-cli 2.1.22 → 2.1.23-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/diagram.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/diagram.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/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.d.ts +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.d.ts +2 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x1b496f=a28_0xd874;(function(_0x4c24f0,_0xc2c1df){const _0x45e5a5=a28_0xd874,_0x19dd6f=_0x4c24f0();while(!![]){try{const _0x12f236=parseInt(_0x45e5a5(0x94))/0x1+parseInt(_0x45e5a5(0x95))/0x2+parseInt(_0x45e5a5(0x92))/0x3+-parseInt(_0x45e5a5(0x90))/0x4+-parseInt(_0x45e5a5(0x93))/0x5+-parseInt(_0x45e5a5(0x8c))/0x6+parseInt(_0x45e5a5(0x8b))/0x7;if(_0x12f236===_0xc2c1df)break;else _0x19dd6f['push'](_0x19dd6f['shift']());}catch(_0x382966){_0x19dd6f['push'](_0x19dd6f['shift']());}}}(a28_0x2de4,0x9bac3));function a28_0xd874(_0x1c354e,_0x52b621){_0x1c354e=_0x1c354e-0x86;const _0x2de47=a28_0x2de4();let _0xd874d5=_0x2de47[_0x1c354e];return _0xd874d5;}import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a28_0x1b496f(0x86);export function formatDatasetSdkMarkdown(_0x142ced){const _0x133e7d=a28_0x1b496f,_0x2cc2a0=typeof _0x142ced===_0x133e7d(0x8f)?_0x142ced[_0x133e7d(0x88)]():'';return _0x2cc2a0||DEFAULT_MARKDOWN;}function a28_0x2de4(){const _0x19f1d2=['appCode','string','4539888iYZGxY','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','3373752DNMVRn','6203880gSvZoP','856224BasCIX','291170jjYrov','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','sdk-doc','trim','read','dataset','13937399wrCEBp','6624402RykOXa','str'];a28_0x2de4=function(){return _0x19f1d2;};return a28_0x2de4();}export const datasetSdkDoc={'service':a28_0x1b496f(0x8a),'command':a28_0x1b496f(0x87),'description':a28_0x1b496f(0x96),'risk':a28_0x1b496f(0x89),'flags':[{...CODE_FLAG,'description':a28_0x1b496f(0x91)}],async 'execute'(_0x2bb77d){const _0x2e3f0a=a28_0x1b496f,_0x507aac=_0x2bb77d[_0x2e3f0a(0x8d)]('code'),_0x2ff602=await getDatasetSdkUsageDoc(_0x507aac,_0x2bb77d[_0x2e3f0a(0x8e)]);return{'ok':!![],'data':{'code':_0x507aac,'appCode':_0x2bb77d['appCode'],'markdown':formatDatasetSdkMarkdown(_0x2ff602)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a29_0x1135f9=a29_0x1a5c;function a29_0x1a5c(_0x516a5a,_0x3c9526){_0x516a5a=_0x516a5a-0xa2;const _0x5c5aa5=a29_0x5c5a();let _0x1a5c51=_0x5c5aa5[_0x516a5a];return _0x1a5c51;}(function(_0x49662a,_0x17bf16){const _0x5a5c5b=a29_0x1a5c,_0x231e96=_0x49662a();while(!![]){try{const _0x18b045=-parseInt(_0x5a5c5b(0xd5))/0x1+parseInt(_0x5a5c5b(0xc9))/0x2*(parseInt(_0x5a5c5b(0xa9))/0x3)+parseInt(_0x5a5c5b(0xd6))/0x4+parseInt(_0x5a5c5b(0xb1))/0x5*(-parseInt(_0x5a5c5b(0xf2))/0x6)+parseInt(_0x5a5c5b(0xe9))/0x7+-parseInt(_0x5a5c5b(0xbb))/0x8+parseInt(_0x5a5c5b(0xac))/0x9;if(_0x18b045===_0x17bf16)break;else _0x231e96['push'](_0x231e96['shift']());}catch(_0x2056bb){_0x231e96['push'](_0x231e96['shift']());}}}(a29_0x5c5a,0xdb3aa));import a29_0x2d9fea from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';function a29_0x5c5a(){const _0x179312=['\x20\x20Service\x20Tree','commandCount','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','read','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','missing','6364686rrUunS','\x20doctor','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','Diagnose\x20CLI\x20configuration\x20and\x20environment','format','red','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Global','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20API\x20Endpoints','yellow','723OGtqGT','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','platform','11524167tCwNdD','\x20\x20auth\x20(effective):\x20','(set,\x20length=','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','gray','5sCdwIO','(default)','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','pageSize','defaultApp','(not\x20found)','\x20\x20Config\x20Files','env','appCode','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','2922048hzkxqB','⚠\x20Empty','(not\x20set)','currentApp','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20runtimeDomain:\x20\x20\x20','\x20\x20Config\x20JSON','check','\x20(legacy/compat\x20only)','status','empty','(none)','version','\x20\x20─','12670UDomOo','repeat','log','riskLevel','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','(unnamed)','Project','accessKey','verbose','message','✗\x20Invalid\x20JSON','green','1312700dYqNNA','2285352qhkGyP','locale','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','registryPath','✓\x20Valid\x20JSON','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','serviceCode','padEnd','bold','\x20commands)','(no\x20file)','services','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','path','length','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Session\x20check:\x20\x20\x20','1807141vBewxm','⚠\x20Empty\x20(treated\x20as\x20{})'];a29_0x5c5a=function(){return _0x179312;};return a29_0x5c5a();}import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x5c02b){const _0x4c235e=a29_0x1a5c,_0x837fe=getCliVersion(),_0x27a474=buildConfigFromFlags({});await initGlobalEnvironment(_0x27a474),console[_0x4c235e(0xcb)](),console['log'](a29_0x2d9fea[_0x4c235e(0xdf)](CLI_BIN_NAME+_0x4c235e(0xf3))),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xb0)]('─'[_0x4c235e(0xca)](0x32))),console[_0x4c235e(0xcb)](_0x4c235e(0xe3)+_0x837fe),console['log'](_0x4c235e(0xa5)+process[_0x4c235e(0xc7)]),console[_0x4c235e(0xcb)](_0x4c235e(0xba)+process[_0x4c235e(0xab)]+'\x20'+process['arch']),console[_0x4c235e(0xcb)](),console['log'](a29_0x2d9fea['bold'](_0x4c235e(0xb7))),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc8)[_0x4c235e(0xca)](0x1e)));const _0x122336=getGlobalConfigPath(),_0x49b30c=getProjectConfigPath();console[_0x4c235e(0xcb)](_0x4c235e(0xa4)+(_0x122336||a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xb6)))),console[_0x4c235e(0xcb)](_0x4c235e(0xaf)+(_0x49b30c||a29_0x2d9fea['gray']('(not\x20found)'))),console[_0x4c235e(0xcb)](),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xdf)](_0x4c235e(0xc1))),console['log'](a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc8)[_0x4c235e(0xca)](0x1e)));const _0x44a85e=(_0x30ec89,_0x4975da)=>{const _0x1c4620=_0x4c235e;if(!_0x4975da){console[_0x1c4620(0xcb)]('\x20\x20'+_0x30ec89[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xb0)](_0x1c4620(0xe1)));return;}const _0x5af13f=inspectCliConfigJsonFile(_0x4975da);if(_0x5af13f['status']==='ok')console[_0x1c4620(0xcb)]('\x20\x20'+_0x30ec89[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xd4)](_0x1c4620(0xda)));else{if(_0x5af13f[_0x1c4620(0xc4)]==='empty')console['log']('\x20\x20'+_0x30ec89[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xa8)](_0x1c4620(0xea)));else _0x5af13f['status']===_0x1c4620(0xf1)?console[_0x1c4620(0xcb)]('\x20\x20'+_0x30ec89[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xb0)]('(missing)')):(console[_0x1c4620(0xcb)]('\x20\x20'+_0x30ec89[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xf7)](_0x1c4620(0xd3))),console[_0x1c4620(0xcb)]('\x20\x20'+''[_0x1c4620(0xde)](0x11)+'\x20'+a29_0x2d9fea[_0x1c4620(0xf7)](_0x5af13f[_0x1c4620(0xd2)])));}};_0x44a85e(_0x4c235e(0xa3),_0x122336),_0x44a85e(_0x4c235e(0xcf),_0x49b30c),console[_0x4c235e(0xcb)](),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xdf)]('\x20\x20Merged\x20Config')),console[_0x4c235e(0xcb)](a29_0x2d9fea['gray'](_0x4c235e(0xc8)[_0x4c235e(0xca)](0x1e))),console['log']('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x27a474[_0x4c235e(0xb9)]||a29_0x2d9fea[_0x4c235e(0xf7)](_0x4c235e(0xbd)))),console[_0x4c235e(0xcb)](_0x4c235e(0xb3)+_0x27a474[_0x4c235e(0xb8)]);const _0x1e2993=isLegacyCompatConfigKey(_0x4c235e(0xd7))?a29_0x2d9fea[_0x4c235e(0xb0)](_0x27a474[_0x4c235e(0xd7)]+_0x4c235e(0xc3)):_0x27a474[_0x4c235e(0xd7)];console[_0x4c235e(0xcb)](_0x4c235e(0xa6)+_0x1e2993),console['log']('\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20'+(_0x27a474[_0x4c235e(0xb5)]||a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc6)))),console[_0x4c235e(0xcb)](_0x4c235e(0xd8)+(_0x27a474[_0x4c235e(0xbe)]||a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc6)))),console['log'](_0x4c235e(0xed)+(_0x27a474[_0x4c235e(0xf6)]||a29_0x2d9fea[_0x4c235e(0xb0)]('(default:\x20'+DEFAULT_CONFIG_VALUES['format']+')'))),console['log'](_0x4c235e(0xe7)+(_0x27a474[_0x4c235e(0xb4)]??a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xb2)))),console[_0x4c235e(0xcb)](_0x4c235e(0xdc)+_0x27a474[_0x4c235e(0xcc)]),console[_0x4c235e(0xcb)](_0x4c235e(0xbf)+_0x27a474[_0x4c235e(0xd1)]),console[_0x4c235e(0xcb)](_0x4c235e(0xad)+AUTH_MODE[_0x4c235e(0xf0)]),console[_0x4c235e(0xcb)](_0x4c235e(0xcd)+(_0x27a474[_0x4c235e(0xd0)]?a29_0x2d9fea[_0x4c235e(0xd4)](_0x4c235e(0xae)+_0x27a474['accessKey'][_0x4c235e(0xe6)]+')'):a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc6)))),console[_0x4c235e(0xcb)](),console[_0x4c235e(0xcb)](a29_0x2d9fea['bold'](_0x4c235e(0xa7))),console[_0x4c235e(0xcb)](a29_0x2d9fea['gray'](_0x4c235e(0xc8)[_0x4c235e(0xca)](0x1e))),console[_0x4c235e(0xcb)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x4c235e(0xcb)](_0x4c235e(0xe4)+getUserDomain()),console[_0x4c235e(0xcb)](_0x4c235e(0xc0)+getRuntimeDomain()),console[_0x4c235e(0xcb)](),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xdf)](_0x4c235e(0xeb))),console[_0x4c235e(0xcb)](a29_0x2d9fea['gray']('\x20\x20─'[_0x4c235e(0xca)](0x1e)));const _0x28b766=inspectServiceRegistry();console[_0x4c235e(0xcb)](_0x4c235e(0xdb)+_0x28b766[_0x4c235e(0xd9)]),console[_0x4c235e(0xcb)](_0x4c235e(0xaa)+formatServiceRegistryStatus(_0x28b766)),console['log'](_0x4c235e(0xf4)+_0x28b766['serviceCount']),console['log'](_0x4c235e(0xef)+_0x28b766['commandCount']);for(const _0x2a07ce of _0x28b766[_0x4c235e(0xe2)]){console[_0x4c235e(0xcb)]('\x20\x20'+(_0x2a07ce[_0x4c235e(0xdd)]+':')['padEnd'](0x11)+'\x20'+(_0x2a07ce['name']||a29_0x2d9fea['gray'](_0x4c235e(0xce)))+'\x20('+_0x2a07ce[_0x4c235e(0xec)]+_0x4c235e(0xe0)),console[_0x4c235e(0xcb)]('\x20\x20'+''['padEnd'](0x11)+'\x20Imported\x20from:\x20'+_0x2a07ce['source'][_0x4c235e(0xe5)]);}return console['log'](),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xdf)]('\x20\x20Auth')),console[_0x4c235e(0xcb)](a29_0x2d9fea[_0x4c235e(0xb0)](_0x4c235e(0xc8)[_0x4c235e(0xca)](0x1e))),console[_0x4c235e(0xcb)](_0x4c235e(0xa2)+a29_0x2d9fea[_0x4c235e(0xd4)](AUTH_MODE[_0x4c235e(0xf0)]+'\x20(accessKey)')),console[_0x4c235e(0xcb)](_0x4c235e(0xe8)+a29_0x2d9fea['gray']('(removed\x20—\x20cookie\x20auth\x20disabled)')),console[_0x4c235e(0xcb)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3a436a){const _0x4d1ed8=a29_0x1a5c;if(_0x3a436a[_0x4d1ed8(0xc4)]==='ok')return a29_0x2d9fea[_0x4d1ed8(0xd4)]('✓\x20Loaded');if(_0x3a436a[_0x4d1ed8(0xc4)]===_0x4d1ed8(0xf1))return a29_0x2d9fea[_0x4d1ed8(0xb0)](_0x4d1ed8(0xb6));if(_0x3a436a[_0x4d1ed8(0xc4)]===_0x4d1ed8(0xc5))return a29_0x2d9fea['yellow'](_0x4d1ed8(0xbc));return a29_0x2d9fea[_0x4d1ed8(0xf7)]('✗\x20Invalid'+(_0x3a436a['message']?':\x20'+_0x3a436a[_0x4d1ed8(0xd2)]:''));}export const doctorDefinition={'service':'doctor','command':a29_0x1135f9(0xc2),'description':a29_0x1135f9(0xf5),'risk':a29_0x1135f9(0xee),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x594d51=a30_0x522a;(function(_0x3a2b3c,_0x39e365){const _0x549886=a30_0x522a,_0x2d1da4=_0x3a2b3c();while(!![]){try{const _0x36ff4b=-parseInt(_0x549886(0x120))/0x1+parseInt(_0x549886(0x11b))/0x2*(-parseInt(_0x549886(0x135))/0x3)+-parseInt(_0x549886(0x117))/0x4*(parseInt(_0x549886(0x125))/0x5)+parseInt(_0x549886(0x122))/0x6*(-parseInt(_0x549886(0x137))/0x7)+parseInt(_0x549886(0x12f))/0x8*(parseInt(_0x549886(0x121))/0x9)+-parseInt(_0x549886(0x136))/0xa+-parseInt(_0x549886(0x113))/0xb*(-parseInt(_0x549886(0x115))/0xc);if(_0x36ff4b===_0x39e365)break;else _0x2d1da4['push'](_0x2d1da4['shift']());}catch(_0x4d0fe0){_0x2d1da4['push'](_0x2d1da4['shift']());}}}(a30_0x3b96,0xa4f98));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a30_0x522a(_0x5d1aac,_0x31e5b2){_0x5d1aac=_0x5d1aac-0x113;const _0x3b96e4=a30_0x3b96();let _0x522a60=_0x3b96e4[_0x5d1aac];return _0x522a60;}import{dryRun}from'../../framework/dryrun.js';function a30_0x3b96(){const _0x5d479a=['File','long-term','548110ASaamX','99ntAgPj','806772LWZWnG','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','validation','5FzjYeJ','query-url','path','Preview:\x20upload\x20','download','string','appCode','bool','upload','boolean','393496SguTkh','filePath','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','filepath','file','POST','18lqNqQP','6283560LPMvTk','70xhbTrS','Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.','Path\x20to\x20the\x20local\x20file\x20to\x20upload','858YhJaPH','filePath\x20is\x20required.','636756akzkKy','Uploaded\x20file:\x20','2966412vlRsxW','str','body','Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL','247182lmDwQw','/client/uploadFile','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data'];a30_0x3b96=function(){return _0x5d479a;};return a30_0x3b96();}const FILE_FLAG={'name':a30_0x594d51(0x133),'type':a30_0x594d51(0x12a),'required':!![],'description':a30_0x594d51(0x139)},FILEPATH_FLAG={'name':a30_0x594d51(0x132),'type':a30_0x594d51(0x12a),'required':!![],'description':a30_0x594d51(0x11d)},DOWNLOAD_FLAG={'name':'download','type':a30_0x594d51(0x12e),'description':a30_0x594d51(0x11a)},LONG_TERM_FLAG={'name':'long-term','type':a30_0x594d51(0x12e),'description':'Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML'};function requireFilePath(_0x24f269){const _0x24c534=a30_0x594d51,_0x5d14ad=_0x24f269['trim']();if(!_0x5d14ad)throw CliErrors[_0x24c534(0x124)](_0x24c534(0x114));return _0x5d14ad;}const fileUpload={'service':a30_0x594d51(0x133),'command':a30_0x594d51(0x12d),'description':a30_0x594d51(0x123),'risk':'read','flags':[FILE_FLAG],async 'dryRun'(_0x2915e6){const _0x3a38d9=a30_0x594d51,_0x2885b5=requireRuntimeUploadFile(_0x2915e6['str']('file'),_0x3a38d9(0x11e));return dryRun(_0x3a38d9(0x134),_0x3a38d9(0x11c))[_0x3a38d9(0x119)]({'appCode':_0x2915e6[_0x3a38d9(0x12b)],'multipart':{'file':_0x2885b5}})['description'](_0x3a38d9(0x128)+_0x2885b5[_0x3a38d9(0x127)]+'\x20to\x20runtime\x20app\x20'+_0x2915e6['appCode'])['build']();},async 'execute'(_0x2ed5f7){const _0x3297cc=a30_0x594d51,_0x38beec=requireRuntimeUploadFile(_0x2ed5f7[_0x3297cc(0x118)](_0x3297cc(0x133)),_0x3297cc(0x11e)),_0x2ae42a=await uploadRuntimeFile(_0x2ed5f7['appCode'],_0x38beec[_0x3297cc(0x127)]);return{'ok':!![],'data':_0x2ae42a,'message':_0x2ae42a[_0x3297cc(0x130)]?_0x3297cc(0x116)+_0x2ae42a[_0x3297cc(0x130)]+'.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.':_0x3297cc(0x138)};}},fileQueryUrl={'service':a30_0x594d51(0x133),'command':a30_0x594d51(0x126),'description':a30_0x594d51(0x131),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x3b1dd0){const _0x4d2c59=a30_0x594d51,_0x9686c2=requireFilePath(_0x3b1dd0['str'](_0x4d2c59(0x132))),_0x1df18f=await queryRuntimeFileUrl(_0x9686c2,{'download':_0x3b1dd0[_0x4d2c59(0x12c)](_0x4d2c59(0x129)),'longTerm':_0x3b1dd0['bool'](_0x4d2c59(0x11f))});return{'ok':!![],'data':_0x1df18f};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x4d5bae=a31_0x8f5d;(function(_0x46a591,_0x5ef3b4){const _0x2d7de4=a31_0x8f5d,_0x3c8b08=_0x46a591();while(!![]){try{const _0x305c28=parseInt(_0x2d7de4(0x177))/0x1*(parseInt(_0x2d7de4(0x17f))/0x2)+-parseInt(_0x2d7de4(0x1b5))/0x3+-parseInt(_0x2d7de4(0x1a4))/0x4*(-parseInt(_0x2d7de4(0x19b))/0x5)+parseInt(_0x2d7de4(0x1a6))/0x6*(parseInt(_0x2d7de4(0x187))/0x7)+parseInt(_0x2d7de4(0x1a7))/0x8*(parseInt(_0x2d7de4(0x1b2))/0x9)+-parseInt(_0x2d7de4(0x1a5))/0xa+-parseInt(_0x2d7de4(0x18e))/0xb;if(_0x305c28===_0x5ef3b4)break;else _0x3c8b08['push'](_0x3c8b08['shift']());}catch(_0x971c9){_0x3c8b08['push'](_0x3c8b08['shift']());}}}(a31_0x3f9a,0xeffdb));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';function a31_0x3f9a(){const _0x5d2f6c=['file','race','cwd','22966ETtpPM','[y/N]','apiDir','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','User\x20aborted\x20prompt','\x20\x20default:\x20','entries','yes','1876cxORIU','\x20\x20env:\x20\x20\x20\x20\x20','Usage:\x20','object','trim','global','close','16611067XIBNSQ','SIGINT','once','boolean','defaultApp','Override\x20imported\x20default\x20appcode','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','[Y/n]','newConfigFileName','Write\x20to\x20global\x20(~/','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','string','app','920lHXnTc','Aborted.','name','\x20\x20config:\x20\x20','):\x20','Invalid\x20env\x20\x22','stdin','App\x20code','message','41804BeUkhV','18825230eZYQio','38562xWBAOV','19752mGdAdN','appcode','riskLevel','File\x20','join','toLowerCase','App\x20code\x20for\x20the\x20project','AbortPrompt','\x20\x20appcode:\x20','Imported\x20from\x20','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','657CeDJcf','validation','log','3069615pBxxYc','apps','Target\x20environment\x20(default\x20','env','Initialized\x20','\x20already\x20exists.\x20Overwrite?','137mWOaBE','question','flagMissing','removeListener','\x22.\x20Allowed:\x20'];a31_0x3f9a=function(){return _0x5d2f6c;};return a31_0x3f9a();}import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4d5bae(0x1a8),'type':a31_0x4d5bae(0x199),'description':a31_0x4d5bae(0x1ad)},{'name':'env','type':a31_0x4d5bae(0x199),'description':a31_0x4d5bae(0x1b7)+DEFAULT_CONFIG_VALUES[a31_0x4d5bae(0x1b8)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4d5bae(0x18c),'type':'boolean','description':a31_0x4d5bae(0x197)+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x4d5bae(0x186),'type':'boolean','description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export const initImportFlagDefs=[{'name':a31_0x4d5bae(0x17c),'type':a31_0x4d5bae(0x199),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':'appcode','type':a31_0x4d5bae(0x199),'description':a31_0x4d5bae(0x193)},{'name':a31_0x4d5bae(0x1b8),'type':'string','description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4d5bae(0x18c),'type':'boolean','description':a31_0x4d5bae(0x197)+PRODUCT_CONFIG[a31_0x4d5bae(0x196)]+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x4d5bae(0x186),'type':a31_0x4d5bae(0x191),'description':'Skip\x20confirmation\x20when\x20overwriting','default':![]}];export async function runInit(_0x3b272c){const _0x516dfe=a31_0x4d5bae,_0x1d2afc=isNonInteractiveMode(_0x3b272c),_0x1a7634=_0x3b272c[_0x516dfe(0x18c)]?_0x516dfe(0x18c):'project',_0x416eca=resolveWriteConfigPath(_0x1a7634);try{_0x1d2afc?await runNonInteractive(_0x3b272c,_0x416eca):await runInteractive(_0x3b272c,_0x416eca);}catch(_0x1ca070){if(_0x1ca070 instanceof AbortPrompt)throw CliErrors['cancelled']();throw _0x1ca070;}}export async function runInitImport(_0x41698f){const _0x113290=a31_0x4d5bae,_0x3bea0e=_0x41698f[_0x113290(0x18c)]?_0x113290(0x18c):'project',_0x1c23b6=resolveWriteConfigPath(_0x3bea0e);await runFromImport(_0x41698f,_0x1c23b6);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x4d5bae(0x181)]);async function runFromImport(_0x54b7f8,_0x12f09e){const _0x2731b3=a31_0x4d5bae,_0xe4901b=resolveFilePath(_0x54b7f8['file']);if(!existsSync(_0xe4901b))throw CliErrors[_0x2731b3(0x1b3)]('Source\x20file\x20not\x20found:\x20'+_0xe4901b);const _0x4cc5fa=readSourceFile(_0xe4901b),_0xb70ecf=convertToRuntimeConfig(_0x4cc5fa);_0x54b7f8[_0x2731b3(0x1a8)]&&(_0xb70ecf[_0x2731b3(0x1a8)]=String(_0x54b7f8[_0x2731b3(0x1a8)]));_0x54b7f8['env']&&(_0xb70ecf[_0x2731b3(0x1b8)]=resolveInitEnv(_0x54b7f8));if(!_0xb70ecf[_0x2731b3(0x1a8)])throw CliErrors[_0x2731b3(0x1b3)](_0x2731b3(0x1b1),'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(_0x12f09e,_0xb70ecf,_0x54b7f8),console['log'](_0x2731b3(0x1b0)+_0xe4901b),console['log'](_0x2731b3(0x19e)+_0x12f09e),console[_0x2731b3(0x1b4)](_0x2731b3(0x1af)+_0xb70ecf[_0x2731b3(0x1a8)]);if(_0xb70ecf[_0x2731b3(0x192)])console[_0x2731b3(0x1b4)](_0x2731b3(0x184)+_0xb70ecf['defaultApp']);}function convertToRuntimeConfig(_0x9637e0){const _0x12eadc=a31_0x4d5bae;if(_0x9637e0[_0x12eadc(0x1b6)]&&typeof _0x9637e0[_0x12eadc(0x1b6)]===_0x12eadc(0x18a))throw CliErrors[_0x12eadc(0x1b3)](_0x12eadc(0x194),_0x12eadc(0x182));const _0x1c0da8={};for(const _0xa3115f of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x9637e0[_0xa3115f]!==undefined&&(_0x1c0da8[_0xa3115f]=_0x9637e0[_0xa3115f]);}return!_0x1c0da8[_0x12eadc(0x1a9)]&&(_0x1c0da8[_0x12eadc(0x1a9)]=DEFAULT_CONFIG_VALUES[_0x12eadc(0x1a9)]),_0x1c0da8;}async function runNonInteractive(_0x4fa154,_0x52a8b4){const _0x4f0892=a31_0x4d5bae,_0x4096ff=_0x4fa154[_0x4f0892(0x1a8)];if(!_0x4096ff)throw CliErrors[_0x4f0892(0x179)](_0x4f0892(0x1a8),_0x4f0892(0x189)+CLI_BIN_NAME+_0x4f0892(0x198));const _0x43e035=resolveInitEnv(_0x4fa154);await writeInitConfig(_0x52a8b4,{'appcode':_0x4096ff,'env':_0x43e035},_0x4fa154),console[_0x4f0892(0x1b4)](_0x4f0892(0x1b9)+_0x52a8b4),console[_0x4f0892(0x1b4)]('\x20\x20appcode:\x20'+_0x4096ff),console[_0x4f0892(0x1b4)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x43e035);}async function runInteractive(_0x5c0567,_0x132d2e){const _0x2191e7=a31_0x4d5bae,_0x493187=loadExisting(_0x132d2e),_0x160fd4=typeof _0x493187?.['appcode']===_0x2191e7(0x199)?_0x493187[_0x2191e7(0x1a8)]:'',_0x3d6e48=resolveInitEnv(_0x5c0567);console[_0x2191e7(0x1b4)](CLI_BIN_NAME+'\x20init\x20—\x20Create\x20'+PRODUCT_CONFIG[_0x2191e7(0x196)]+'\x0a');if(existsSync(_0x132d2e)&&!_0x5c0567[_0x2191e7(0x186)]){const _0x4964c1=await promptYesNo(_0x2191e7(0x1aa)+_0x132d2e+_0x2191e7(0x1ba),![]);if(!_0x4964c1){console[_0x2191e7(0x1b4)](_0x2191e7(0x19c));return;}}const _0x2c4736=typeof _0x5c0567['appcode']===_0x2191e7(0x199)?_0x5c0567[_0x2191e7(0x1a8)][_0x2191e7(0x18b)]():'';let _0x31ebd7=_0x2c4736;!_0x31ebd7&&(_0x31ebd7=await promptInput(_0x2191e7(0x1a2),_0x160fd4));if(!_0x31ebd7['trim']())throw CliErrors[_0x2191e7(0x1b3)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x132d2e,{'appcode':_0x31ebd7[_0x2191e7(0x18b)](),'env':_0x3d6e48},_0x5c0567),console['log']('\x0aInitialized\x20'+_0x132d2e),console[_0x2191e7(0x1b4)](_0x2191e7(0x1af)+_0x31ebd7[_0x2191e7(0x18b)]()),console[_0x2191e7(0x1b4)](_0x2191e7(0x188)+_0x3d6e48);}async function writeInitConfig(_0x5b03b7,_0x513197,_0x19d834){const _0x9411c1=a31_0x4d5bae;let _0x577d5d={};existsSync(_0x5b03b7)&&!_0x19d834[_0x9411c1(0x186)]&&(_0x577d5d=readConfigFile(_0x5b03b7));for(const [_0x18bd40,_0x35b438]of Object[_0x9411c1(0x185)](_0x513197)){_0x35b438!==undefined&&(_0x577d5d[_0x18bd40]=_0x35b438);}if(_0x577d5d[_0x9411c1(0x19a)])delete _0x577d5d[_0x9411c1(0x19a)];writeConfigFile(_0x5b03b7,_0x577d5d);}class AbortPrompt extends Error{constructor(){const _0x5f3954=a31_0x4d5bae;super(_0x5f3954(0x183)),this[_0x5f3954(0x19d)]=_0x5f3954(0x1ae);}}function createSafeRl(){const _0x1201c1=a31_0x4d5bae,_0x4f8418=createInterface({'input':process[_0x1201c1(0x1a1)],'output':process['stdout']});let _0x33940e;const _0x39cafa=new Promise((_0xbc072d,_0x36deeb)=>{const _0x2a3b0a=_0x1201c1;_0x33940e=()=>{const _0x12385c=a31_0x8f5d;_0x33940e&&(_0x4f8418[_0x12385c(0x17a)](_0x12385c(0x18f),_0x33940e),_0x33940e=undefined);try{_0x4f8418[_0x12385c(0x18d)]();}catch{}_0x36deeb(new AbortPrompt());},_0x4f8418[_0x2a3b0a(0x190)](_0x2a3b0a(0x18f),_0x33940e);}),_0x49cf49=()=>{const _0x21a236=_0x1201c1;_0x33940e&&(_0x4f8418[_0x21a236(0x17a)](_0x21a236(0x18f),_0x33940e),_0x33940e=undefined);try{_0x4f8418[_0x21a236(0x18d)]();}catch{}};return{'rl':_0x4f8418,'abortPromise':_0x39cafa,'disposeSuccess':_0x49cf49};}async function promptInput(_0x35e328,_0x4ef636){const _0x234c07=a31_0x4d5bae,{rl:_0x125f7a,abortPromise:_0x10a2c1,disposeSuccess:_0x4131f6}=createSafeRl(),_0x6fce11=new Promise(_0x5655d7=>{const _0x42cfca=a31_0x8f5d,_0x15e93a=_0x4ef636?'\x20\x20'+_0x35e328+'\x20('+_0x4ef636+_0x42cfca(0x19f):'\x20\x20'+_0x35e328+':\x20';_0x125f7a[_0x42cfca(0x178)](_0x15e93a,_0x1d88ce=>{const _0x5e9b40=_0x42cfca;_0x4131f6(),_0x5655d7(_0x1d88ce[_0x5e9b40(0x18b)]()||_0x4ef636);});});return Promise[_0x234c07(0x17d)]([_0x6fce11,_0x10a2c1]);}async function promptYesNo(_0x49a06d,_0x9f6db5){const _0x2f7c80=a31_0x4d5bae,{rl:_0x4a7df3,abortPromise:_0x430dca,disposeSuccess:_0x5e3e2f}=createSafeRl(),_0x46e432=new Promise(_0x346fb0=>{const _0x36acc3=a31_0x8f5d,_0x5cdc12=_0x9f6db5?_0x36acc3(0x195):_0x36acc3(0x180);_0x4a7df3[_0x36acc3(0x178)]('\x20\x20'+_0x49a06d+'\x20'+_0x5cdc12+':\x20',_0x1475b0=>{const _0xf24b21=_0x36acc3;_0x5e3e2f();const _0x507631=_0x1475b0[_0xf24b21(0x18b)]()[_0xf24b21(0x1ac)]();if(_0x507631==='y'||_0x507631===_0xf24b21(0x186))_0x346fb0(!![]);else{if(_0x507631==='n'||_0x507631==='no')_0x346fb0(![]);else _0x346fb0(_0x9f6db5);}});});return Promise[_0x2f7c80(0x17d)]([_0x46e432,_0x430dca]);}function loadExisting(_0x3f1616){if(!existsSync(_0x3f1616))return null;return readConfigFile(_0x3f1616);}function resolveFilePath(_0xd8ef77){const _0x42c058=a31_0x4d5bae;return isAbsolute(_0xd8ef77)?_0xd8ef77:resolve(process[_0x42c058(0x17e)](),_0xd8ef77);}function a31_0x8f5d(_0x42b843,_0x17ae4a){_0x42b843=_0x42b843-0x177;const _0x3f9af3=a31_0x3f9a();let _0x8f5d94=_0x3f9af3[_0x42b843];return _0x8f5d94;}function readSourceFile(_0x4bf85a){const _0x107e54=a31_0x4d5bae;try{const _0x124a08=readFileSync(_0x4bf85a,{'encoding':'utf8'});return JSON['parse'](_0x124a08);}catch(_0x2fee29){throw CliErrors[_0x107e54(0x1b3)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x2fee29[_0x107e54(0x1a3)]);}}function resolveInitEnv(_0x41d7cd){const _0x55c60e=a31_0x4d5bae,_0x108dec=_0x41d7cd[_0x55c60e(0x1b8)];if(_0x108dec===undefined||_0x108dec==='')return DEFAULT_CONFIG_VALUES[_0x55c60e(0x1b8)];if(!RUNTIME_ENV_VALUES['includes'](_0x108dec))throw CliErrors[_0x55c60e(0x1b3)](_0x55c60e(0x1a0)+_0x108dec+_0x55c60e(0x17b)+RUNTIME_ENV_VALUES[_0x55c60e(0x1ab)](',\x20'));return _0x108dec;}
|
|
1
|
+
const a31_0x2e19db=a31_0x29bb;(function(_0x1197db,_0x5615c9){const _0x3d6039=a31_0x29bb,_0x458d4=_0x1197db();while(!![]){try{const _0x45f365=-parseInt(_0x3d6039(0x13d))/0x1+-parseInt(_0x3d6039(0x134))/0x2+-parseInt(_0x3d6039(0x13a))/0x3*(parseInt(_0x3d6039(0x13b))/0x4)+parseInt(_0x3d6039(0x102))/0x5*(-parseInt(_0x3d6039(0x120))/0x6)+-parseInt(_0x3d6039(0x127))/0x7+-parseInt(_0x3d6039(0x111))/0x8+parseInt(_0x3d6039(0x10e))/0x9;if(_0x45f365===_0x5615c9)break;else _0x458d4['push'](_0x458d4['shift']());}catch(_0x190675){_0x458d4['push'](_0x458d4['shift']());}}}(a31_0x47bc,0x6356d));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':'string','description':'App\x20code\x20for\x20the\x20project'},{'name':a31_0x2e19db(0x143),'type':a31_0x2e19db(0x113),'description':a31_0x2e19db(0x106)+DEFAULT_CONFIG_VALUES[a31_0x2e19db(0x143)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2e19db(0x12b),'type':a31_0x2e19db(0x135),'description':a31_0x2e19db(0x101)+PRODUCT_CONFIG[a31_0x2e19db(0x144)]+a31_0x2e19db(0x108),'default':![]},{'name':a31_0x2e19db(0x10a),'type':a31_0x2e19db(0x135),'description':a31_0x2e19db(0x11e),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x2e19db(0x114),'type':'string','description':a31_0x2e19db(0x11b),'required':!![]},{'name':a31_0x2e19db(0x128),'type':a31_0x2e19db(0x113),'description':a31_0x2e19db(0x145)},{'name':a31_0x2e19db(0x143),'type':a31_0x2e19db(0x113),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x2e19db(0x135),'description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x2e19db(0x144)]+a31_0x2e19db(0x108),'default':![]},{'name':'yes','type':a31_0x2e19db(0x135),'description':a31_0x2e19db(0x11e),'default':![]}];export async function runInit(_0x5424b2){const _0x33e468=a31_0x2e19db,_0xd66da8=isNonInteractiveMode(_0x5424b2),_0x31c74f=_0x5424b2[_0x33e468(0x12b)]?'global':_0x33e468(0x141),_0xba8d96=resolveWriteConfigPath(_0x31c74f);try{_0xd66da8?await runNonInteractive(_0x5424b2,_0xba8d96):await runInteractive(_0x5424b2,_0xba8d96);}catch(_0x32d384){if(_0x32d384 instanceof AbortPrompt)throw CliErrors[_0x33e468(0x12a)]();throw _0x32d384;}}function a31_0x29bb(_0x2d7581,_0x21a6a0){_0x2d7581=_0x2d7581-0x101;const _0x47bc19=a31_0x47bc();let _0x29bbe3=_0x47bc19[_0x2d7581];return _0x29bbe3;}export async function runInitImport(_0x4a90ed){const _0x25b5ae=a31_0x2e19db,_0x3828fd=_0x4a90ed[_0x25b5ae(0x12b)]?_0x25b5ae(0x12b):'project',_0x39d293=resolveWriteConfigPath(_0x3828fd);await runFromImport(_0x4a90ed,_0x39d293);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2e19db(0x125)]);async function runFromImport(_0x5bcd7d,_0x1053d7){const _0x12cc9d=a31_0x2e19db,_0x231832=resolveFilePath(_0x5bcd7d['file']);if(!existsSync(_0x231832))throw CliErrors['validation'](_0x12cc9d(0x123)+_0x231832);const _0x9ec2c=readSourceFile(_0x231832),_0xf5654=convertToRuntimeConfig(_0x9ec2c);_0x5bcd7d[_0x12cc9d(0x128)]&&(_0xf5654[_0x12cc9d(0x128)]=String(_0x5bcd7d[_0x12cc9d(0x128)]));_0x5bcd7d[_0x12cc9d(0x143)]&&(_0xf5654[_0x12cc9d(0x143)]=resolveInitEnv(_0x5bcd7d));if(!_0xf5654[_0x12cc9d(0x128)])throw CliErrors[_0x12cc9d(0x105)]('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x12cc9d(0x12e));await writeInitConfig(_0x1053d7,_0xf5654,_0x5bcd7d),console[_0x12cc9d(0x115)](_0x12cc9d(0x122)+_0x231832),console[_0x12cc9d(0x115)](_0x12cc9d(0x112)+_0x1053d7),console[_0x12cc9d(0x115)](_0x12cc9d(0x119)+_0xf5654[_0x12cc9d(0x128)]);if(_0xf5654[_0x12cc9d(0x109)])console[_0x12cc9d(0x115)](_0x12cc9d(0x10c)+_0xf5654[_0x12cc9d(0x109)]);}function convertToRuntimeConfig(_0x159bf3){const _0x252eea=a31_0x2e19db;if(_0x159bf3['apps']&&typeof _0x159bf3[_0x252eea(0x131)]===_0x252eea(0x13e))throw CliErrors[_0x252eea(0x105)](_0x252eea(0x11a),_0x252eea(0x116));const _0x24a5aa={};for(const _0x200be1 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x159bf3[_0x200be1]!==undefined&&(_0x24a5aa[_0x200be1]=_0x159bf3[_0x200be1]);}return!_0x24a5aa[_0x252eea(0x117)]&&(_0x24a5aa[_0x252eea(0x117)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x24a5aa;}async function runNonInteractive(_0x4dd1a6,_0x2f20e7){const _0x98681e=a31_0x2e19db,_0xde42e4=_0x4dd1a6['appcode'];if(!_0xde42e4)throw CliErrors[_0x98681e(0x12d)](_0x98681e(0x128),_0x98681e(0x129)+CLI_BIN_NAME+_0x98681e(0x12c));const _0x1ec21d=resolveInitEnv(_0x4dd1a6);await writeInitConfig(_0x2f20e7,{'appcode':_0xde42e4,'env':_0x1ec21d},_0x4dd1a6),console[_0x98681e(0x115)](_0x98681e(0x136)+_0x2f20e7),console[_0x98681e(0x115)]('\x20\x20appcode:\x20'+_0xde42e4),console[_0x98681e(0x115)](_0x98681e(0x104)+_0x1ec21d);}async function runInteractive(_0x3ce92b,_0x4f064f){const _0x1d6f8f=a31_0x2e19db,_0x453654=loadExisting(_0x4f064f),_0x1eff9a=typeof _0x453654?.[_0x1d6f8f(0x128)]==='string'?_0x453654[_0x1d6f8f(0x128)]:'',_0x129ef4=resolveInitEnv(_0x3ce92b);console[_0x1d6f8f(0x115)](CLI_BIN_NAME+_0x1d6f8f(0x146)+PRODUCT_CONFIG[_0x1d6f8f(0x144)]+'\x0a');if(existsSync(_0x4f064f)&&!_0x3ce92b[_0x1d6f8f(0x10a)]){const _0x4a0ffd=await promptYesNo('File\x20'+_0x4f064f+_0x1d6f8f(0x103),![]);if(!_0x4a0ffd){console[_0x1d6f8f(0x115)]('Aborted.');return;}}const _0x2c8487=typeof _0x3ce92b[_0x1d6f8f(0x128)]===_0x1d6f8f(0x113)?_0x3ce92b['appcode'][_0x1d6f8f(0x133)]():'';let _0x1437b1=_0x2c8487;!_0x1437b1&&(_0x1437b1=await promptInput(_0x1d6f8f(0x10d),_0x1eff9a));if(!_0x1437b1[_0x1d6f8f(0x133)]())throw CliErrors[_0x1d6f8f(0x105)](_0x1d6f8f(0x11c));await writeInitConfig(_0x4f064f,{'appcode':_0x1437b1[_0x1d6f8f(0x133)](),'env':_0x129ef4},_0x3ce92b),console['log']('\x0aInitialized\x20'+_0x4f064f),console[_0x1d6f8f(0x115)](_0x1d6f8f(0x119)+_0x1437b1[_0x1d6f8f(0x133)]()),console['log'](_0x1d6f8f(0x104)+_0x129ef4);}async function writeInitConfig(_0x159dd3,_0x2ccfee,_0x4c8f5b){const _0x2b3533=a31_0x2e19db;let _0x26cdca={};existsSync(_0x159dd3)&&!_0x4c8f5b[_0x2b3533(0x10a)]&&(_0x26cdca=readConfigFile(_0x159dd3));for(const [_0x57d8f0,_0x2435ff]of Object['entries'](_0x2ccfee)){_0x2435ff!==undefined&&(_0x26cdca[_0x57d8f0]=_0x2435ff);}if(_0x26cdca[_0x2b3533(0x12f)])delete _0x26cdca[_0x2b3533(0x12f)];writeConfigFile(_0x159dd3,_0x26cdca);}class AbortPrompt extends Error{constructor(){const _0x5049e1=a31_0x2e19db;super(_0x5049e1(0x13c)),this['name']=_0x5049e1(0x118);}}function createSafeRl(){const _0x473cfa=a31_0x2e19db,_0x1af238=createInterface({'input':process['stdin'],'output':process[_0x473cfa(0x138)]});let _0x23cf78;const _0x3a5a07=new Promise((_0x430c4f,_0x3c0254)=>{const _0x5c5381=_0x473cfa;_0x23cf78=()=>{const _0x4b2fe1=a31_0x29bb;_0x23cf78&&(_0x1af238[_0x4b2fe1(0x137)](_0x4b2fe1(0x110),_0x23cf78),_0x23cf78=undefined);try{_0x1af238[_0x4b2fe1(0x11d)]();}catch{}_0x3c0254(new AbortPrompt());},_0x1af238['once'](_0x5c5381(0x110),_0x23cf78);}),_0x4af2ce=()=>{const _0x1779c2=_0x473cfa;_0x23cf78&&(_0x1af238['removeListener'](_0x1779c2(0x110),_0x23cf78),_0x23cf78=undefined);try{_0x1af238[_0x1779c2(0x11d)]();}catch{}};return{'rl':_0x1af238,'abortPromise':_0x3a5a07,'disposeSuccess':_0x4af2ce};}async function promptInput(_0x53adf0,_0x14b049){const _0x197d35=a31_0x2e19db,{rl:_0x1a7ecd,abortPromise:_0xf897a1,disposeSuccess:_0x4dff78}=createSafeRl(),_0x1e46e5=new Promise(_0x2db418=>{const _0x133d84=a31_0x29bb,_0x2decca=_0x14b049?'\x20\x20'+_0x53adf0+'\x20('+_0x14b049+_0x133d84(0x142):'\x20\x20'+_0x53adf0+':\x20';_0x1a7ecd[_0x133d84(0x124)](_0x2decca,_0x3a22e8=>{const _0x46b46d=_0x133d84;_0x4dff78(),_0x2db418(_0x3a22e8[_0x46b46d(0x133)]()||_0x14b049);});});return Promise[_0x197d35(0x130)]([_0x1e46e5,_0xf897a1]);}async function promptYesNo(_0x42cf80,_0x376a56){const _0x52ae2c=a31_0x2e19db,{rl:_0x5846c2,abortPromise:_0x5f0d60,disposeSuccess:_0x148801}=createSafeRl(),_0x170b20=new Promise(_0x4281ce=>{const _0x1d3567=a31_0x29bb,_0x50c329=_0x376a56?_0x1d3567(0x10f):_0x1d3567(0x140);_0x5846c2[_0x1d3567(0x124)]('\x20\x20'+_0x42cf80+'\x20'+_0x50c329+':\x20',_0x413428=>{const _0x3a930f=_0x1d3567;_0x148801();const _0x5b321f=_0x413428['trim']()[_0x3a930f(0x11f)]();if(_0x5b321f==='y'||_0x5b321f==='yes')_0x4281ce(!![]);else{if(_0x5b321f==='n'||_0x5b321f==='no')_0x4281ce(![]);else _0x4281ce(_0x376a56);}});});return Promise[_0x52ae2c(0x130)]([_0x170b20,_0x5f0d60]);}function a31_0x47bc(){const _0x35bed0=['defaultApp','yes','join','\x20\x20default:\x20','App\x20code','27040707sYkYHi','[Y/n]','SIGINT','3058624vjZTrd','\x20\x20config:\x20\x20','string','file','log','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','riskLevel','AbortPrompt','\x20\x20appcode:\x20','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','App\x20code\x20cannot\x20be\x20empty.','close','Skip\x20confirmation\x20when\x20overwriting','toLowerCase','6054UMooJE','Failed\x20to\x20parse\x20source\x20file:\x20','Imported\x20from\x20','Source\x20file\x20not\x20found:\x20','question','apiDir','Invalid\x20env\x20\x22','1698564HIyGgG','appcode','Usage:\x20','cancelled','global','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','flagMissing','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`.','app','race','apps','cwd','trim','1415862DDoYmU','boolean','Initialized\x20','removeListener','stdout','utf8','30543LLBmOG','52CmFDmR','User\x20aborted\x20prompt','374607ywShsz','object','\x22.\x20Allowed:\x20','[y/N]','project','):\x20','env','newConfigFileName','Override\x20imported\x20default\x20appcode','\x20init\x20—\x20Create\x20','Write\x20to\x20global\x20(~/','3755UPRxdm','\x20already\x20exists.\x20Overwrite?','\x20\x20env:\x20\x20\x20\x20\x20','validation','Target\x20environment\x20(default\x20','includes',')\x20instead\x20of\x20project'];a31_0x47bc=function(){return _0x35bed0;};return a31_0x47bc();}function loadExisting(_0x1d8653){if(!existsSync(_0x1d8653))return null;return readConfigFile(_0x1d8653);}function resolveFilePath(_0x105611){const _0x32bd3d=a31_0x2e19db;return isAbsolute(_0x105611)?_0x105611:resolve(process[_0x32bd3d(0x132)](),_0x105611);}function readSourceFile(_0x3151e6){const _0x233aa2=a31_0x2e19db;try{const _0x6d3d6b=readFileSync(_0x3151e6,{'encoding':_0x233aa2(0x139)});return JSON['parse'](_0x6d3d6b);}catch(_0x23ac82){throw CliErrors[_0x233aa2(0x105)](_0x233aa2(0x121)+_0x23ac82['message']);}}function resolveInitEnv(_0x4f0600){const _0xff90ba=a31_0x2e19db,_0x49bd66=_0x4f0600[_0xff90ba(0x143)];if(_0x49bd66===undefined||_0x49bd66==='')return DEFAULT_CONFIG_VALUES[_0xff90ba(0x143)];if(!RUNTIME_ENV_VALUES[_0xff90ba(0x107)](_0x49bd66))throw CliErrors[_0xff90ba(0x105)](_0xff90ba(0x126)+_0x49bd66+_0xff90ba(0x13f)+RUNTIME_ENV_VALUES[_0xff90ba(0x10b)](',\x20'));return _0x49bd66;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a32_0x1a81d1=a32_0x151d;function a32_0x195a(){const _0x5b4ce9=['/client/knowledge-base/personal/create','body','verbose','string','bool','length','27WhOuYy','num','flag','132WDJvSj','Override\x20the\x20existing\x20entry\x20title','appCode','search','Personal\x20knowledge-base\x20entry\x20title','用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','query','file','write','list','utf8','topk','str','4232876aYFafC','ragStatus','50334wJXAgJ','createTime','title','548119XWhgjb','根据本地文件更新个人知识库条目','create','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','1249836UKnGXK','File\x20is\x20not\x20a\x20regular\x20file:\x20','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','5145015NflZHS','--topk\x20must\x20be\x20a\x20positive\x20number.','/client/knowledge-base/personal/','read','userId','Search\x20query\x20is\x20required.','根据本地文件创建个人知识库条目','description','Created\x20KB\x20entry\x20','update','ragErrorMessage','content','581HnxsWB','map','isFinite','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','number','updateTime','weightedScore','File\x20not\x20found:\x20','trim','validation','docId','version','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','POST','build','79456MPcXGJ','scope','isFile','Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge','Personal\x20knowledge-base\x20entry\x20ID','/update','2478790ohYTar'];a32_0x195a=function(){return _0x5b4ce9;};return a32_0x195a();}(function(_0x3ad69b,_0x22bce8){const _0x114f56=a32_0x151d,_0x38bd8e=_0x3ad69b();while(!![]){try{const _0x4486cc=-parseInt(_0x114f56(0x110))/0x1+-parseInt(_0x114f56(0xfe))/0x2*(-parseInt(_0x114f56(0x10d))/0x3)+-parseInt(_0x114f56(0x10b))/0x4+parseInt(_0x114f56(0x118))/0x5+parseInt(_0x114f56(0x115))/0x6+-parseInt(_0x114f56(0x124))/0x7*(parseInt(_0x114f56(0xee))/0x8)+-parseInt(_0x114f56(0xfb))/0x9*(-parseInt(_0x114f56(0xf4))/0xa);if(_0x4486cc===_0x22bce8)break;else _0x38bd8e['push'](_0x38bd8e['shift']());}catch(_0x13f2d7){_0x38bd8e['push'](_0x38bd8e['shift']());}}}(a32_0x195a,0xa08c0));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x1a81d1(0x10f),'type':a32_0x1a81d1(0xf8),'required':!![],'description':a32_0x1a81d1(0x102)},FILE_FLAG={'name':a32_0x1a81d1(0x105),'type':'string','required':!![],'description':'Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file'},QUERY_FLAG={'name':a32_0x1a81d1(0x104),'type':a32_0x1a81d1(0xf8),'required':!![],'description':a32_0x1a81d1(0xf1)},TOPK_FLAG={'name':'topk','type':a32_0x1a81d1(0xe3),'description':'Maximum\x20number\x20of\x20search\x20hits\x20to\x20return'};function readKnowledgeFile(_0x3a4b71){const _0xbb08c8=a32_0x1a81d1;if(!_0x3a4b71)throw CliErrors[_0xbb08c8(0xe8)]('File\x20path\x20is\x20required.');if(!existsSync(_0x3a4b71))throw CliErrors['validation'](_0xbb08c8(0xe6)+_0x3a4b71);if(!statSync(_0x3a4b71)[_0xbb08c8(0xf0)]())throw CliErrors[_0xbb08c8(0xe8)](_0xbb08c8(0x116)+_0x3a4b71);return readFileSync(_0x3a4b71,_0xbb08c8(0x108));}function summarizePersonalItem(_0x5a7d93){const _0x3dc965=a32_0x1a81d1;return{'id':_0x5a7d93['id'],'title':_0x5a7d93[_0x3dc965(0x10f)],'version':_0x5a7d93['version'],'ragStatus':_0x5a7d93[_0x3dc965(0x10c)],'ragErrorMessage':_0x5a7d93[_0x3dc965(0x122)],'updateTime':_0x5a7d93[_0x3dc965(0xe4)]};}function a32_0x151d(_0x15ee3b,_0x4053d1){_0x15ee3b=_0x15ee3b-0xe0;const _0x195a1b=a32_0x195a();let _0x151de5=_0x195a1b[_0x15ee3b];return _0x151de5;}function detailPersonalItem(_0x7892cc){const _0x2a54c0=a32_0x1a81d1;return{'id':_0x7892cc['id'],'appCode':_0x7892cc['appCode'],'scope':_0x7892cc[_0x2a54c0(0xef)],'userId':_0x7892cc[_0x2a54c0(0x11c)],'title':_0x7892cc['title'],'content':_0x7892cc[_0x2a54c0(0x123)]??'','version':_0x7892cc[_0x2a54c0(0xea)],'ragStatus':_0x7892cc['ragStatus'],'ragErrorMessage':_0x7892cc[_0x2a54c0(0x122)],'createTime':_0x7892cc[_0x2a54c0(0x10e)],'updateTime':_0x7892cc[_0x2a54c0(0xe4)]};}function summarizeSearchHit(_0x468fe6){const _0x3264da=a32_0x1a81d1;return{'scope':_0x468fe6[_0x3264da(0xef)],'title':_0x468fe6[_0x3264da(0x10f)],'docId':_0x468fe6[_0x3264da(0xe9)],'score':_0x468fe6['score'],'weightedScore':_0x468fe6[_0x3264da(0xe5)],'content':_0x468fe6[_0x3264da(0x123)],'metadata':_0x468fe6['metadata']};}function readTopK(_0x2b232d){const _0x1264f3=a32_0x1a81d1,_0x5b0984=_0x2b232d[_0x1264f3(0xfd)](_0x1264f3(0x109));if(_0x5b0984===undefined||_0x5b0984===null||_0x5b0984==='')return undefined;const _0x18e057=_0x2b232d['num'](_0x1264f3(0x109));if(!Number[_0x1264f3(0xe1)](_0x18e057)||_0x18e057<0x1)throw CliErrors[_0x1264f3(0xe8)](_0x1264f3(0x119));return _0x18e057;}const kbList={'service':'kb','command':a32_0x1a81d1(0x107),'description':a32_0x1a81d1(0x117),'risk':a32_0x1a81d1(0x11b),'flags':[VERBOSE_FLAG],async 'execute'(_0x77e588){const _0x50c256=a32_0x1a81d1,_0x321a83=await listPersonalKnowledgeBaseItems(_0x77e588[_0x50c256(0x100)]);if(_0x77e588[_0x50c256(0xf9)](_0x50c256(0xf7)))return{'ok':!![],'data':{'total':_0x321a83[_0x50c256(0xfa)],'items':_0x321a83}};return{'ok':!![],'data':{'total':_0x321a83[_0x50c256(0xfa)],'items':_0x321a83[_0x50c256(0xe0)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a32_0x1a81d1(0xeb),'risk':a32_0x1a81d1(0x11b),'flags':[{...ID_FLAG,'description':a32_0x1a81d1(0xf2)}],async 'execute'(_0x200345){const _0x4fa472=a32_0x1a81d1,_0x1f36ba=await getPersonalKnowledgeBaseItem(_0x200345[_0x4fa472(0xfc)]('id'),_0x200345[_0x4fa472(0x100)]);return{'ok':!![],'data':detailPersonalItem(_0x1f36ba)};}},kbCreate={'service':'kb','command':a32_0x1a81d1(0x112),'description':a32_0x1a81d1(0x11e),'risk':a32_0x1a81d1(0x106),'confirmationDescription':a32_0x1a81d1(0x114),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x31c104){const _0x140715=a32_0x1a81d1,_0x47e062=_0x31c104[_0x140715(0x10a)]('title'),_0x785f66=readKnowledgeFile(_0x31c104[_0x140715(0x10a)](_0x140715(0x105))),_0x5f163c=await createPersonalKnowledgeBaseItem(_0x31c104['appCode'],{'title':_0x47e062,'content':_0x785f66});return{'ok':!![],'data':summarizePersonalItem(_0x5f163c),'message':_0x140715(0x120)+_0x5f163c['id']+'\x20('+_0x5f163c[_0x140715(0x10f)]+')'};},async 'dryRun'(_0x4558e2){const _0x3ee304=a32_0x1a81d1,_0x58160d=_0x4558e2[_0x3ee304(0x10a)](_0x3ee304(0x10f)),_0x539b87=readKnowledgeFile(_0x4558e2['str']('file'));return dryRun('POST',_0x3ee304(0xf5))[_0x3ee304(0xf6)]({'appCode':_0x4558e2[_0x3ee304(0x100)],'title':_0x58160d,'content':_0x539b87})['description']('Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22'+_0x58160d+'\x22')[_0x3ee304(0xed)]();}},kbUpdate={'service':'kb','command':a32_0x1a81d1(0x121),'description':a32_0x1a81d1(0x111),'risk':a32_0x1a81d1(0x106),'confirmationDescription':a32_0x1a81d1(0x103),'flags':[{...ID_FLAG,'description':a32_0x1a81d1(0xf2)},{...TITLE_FLAG,'required':![],'description':a32_0x1a81d1(0xff)},FILE_FLAG],async 'execute'(_0x3be8e0){const _0x20ad12=a32_0x1a81d1,_0x3dc3f8=_0x3be8e0[_0x20ad12(0xfc)]('id'),_0x1d83fe=readKnowledgeFile(_0x3be8e0['str'](_0x20ad12(0x105))),_0x30c163=_0x3be8e0[_0x20ad12(0x10a)]('title')||(await getPersonalKnowledgeBaseItem(_0x3dc3f8,_0x3be8e0[_0x20ad12(0x100)]))['title'],_0x56b9af=await updatePersonalKnowledgeBaseItem(_0x3dc3f8,_0x3be8e0[_0x20ad12(0x100)],{'title':_0x30c163,'content':_0x1d83fe});return{'ok':!![],'data':summarizePersonalItem(_0x56b9af),'message':'Updated\x20KB\x20entry\x20'+_0x56b9af['id']+'\x20('+_0x56b9af[_0x20ad12(0x10f)]+')'};},async 'dryRun'(_0x4c6846){const _0x504f2f=a32_0x1a81d1,_0x34a62e=_0x4c6846[_0x504f2f(0xfc)]('id'),_0x131ef0=readKnowledgeFile(_0x4c6846[_0x504f2f(0x10a)](_0x504f2f(0x105))),_0x283aa8=_0x4c6846[_0x504f2f(0x10a)](_0x504f2f(0x10f))||(await getPersonalKnowledgeBaseItem(_0x34a62e,_0x4c6846['appCode']))[_0x504f2f(0x10f)];return dryRun(_0x504f2f(0xec),_0x504f2f(0x11a)+_0x34a62e+_0x504f2f(0xf3))[_0x504f2f(0xf6)]({'appCode':_0x4c6846[_0x504f2f(0x100)],'title':_0x283aa8,'content':_0x131ef0})[_0x504f2f(0x11f)](_0x504f2f(0x113)+_0x34a62e)[_0x504f2f(0xed)]();}},kbSearch={'service':'kb','command':a32_0x1a81d1(0x101),'description':a32_0x1a81d1(0xe2),'risk':a32_0x1a81d1(0x11b),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x586643){const _0x4f98bb=a32_0x1a81d1;if(!_0x586643[_0x4f98bb(0x10a)](_0x4f98bb(0x104))[_0x4f98bb(0xe7)]())throw CliErrors[_0x4f98bb(0xe8)](_0x4f98bb(0x11d));readTopK(_0x586643);},async 'execute'(_0x3597fc){const _0x2fbb74=a32_0x1a81d1,_0x20f21d=_0x3597fc[_0x2fbb74(0x10a)](_0x2fbb74(0x104))['trim'](),_0x45fc2f=readTopK(_0x3597fc),_0x1e510e=await searchKnowledgeBase(_0x3597fc[_0x2fbb74(0x100)],{'query':_0x20f21d,'topK':_0x45fc2f});return{'ok':!![],'data':{'total':_0x1e510e['length'],'hits':_0x1e510e['map'](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x5f4c(_0x143d49,_0x2748bf){_0x143d49=_0x143d49-0xf3;const _0x315f21=a33_0x315f();let _0x5f4c1f=_0x315f21[_0x143d49];return _0x5f4c1f;}const a33_0x4fc868=a33_0x5f4c;(function(_0x3581dc,_0x1a0194){const _0x10ab95=a33_0x5f4c,_0x1f0198=_0x3581dc();while(!![]){try{const _0x5a0469=parseInt(_0x10ab95(0xfa))/0x1*(-parseInt(_0x10ab95(0x104))/0x2)+-parseInt(_0x10ab95(0x110))/0x3*(parseInt(_0x10ab95(0x107))/0x4)+-parseInt(_0x10ab95(0x109))/0x5*(-parseInt(_0x10ab95(0xf7))/0x6)+-parseInt(_0x10ab95(0xfd))/0x7+-parseInt(_0x10ab95(0xf3))/0x8+-parseInt(_0x10ab95(0x115))/0x9+parseInt(_0x10ab95(0x101))/0xa*(parseInt(_0x10ab95(0xf9))/0xb);if(_0x5a0469===_0x1a0194)break;else _0x1f0198['push'](_0x1f0198['shift']());}catch(_0x102b79){_0x1f0198['push'](_0x1f0198['shift']());}}}(a33_0x315f,0xda24b));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x58a3da){const _0x2c0390=a33_0x5f4c;if(_0x58a3da['length']===0x0){console['log']('*\x20No\x20logs\x20found');return;}console[_0x2c0390(0x102)]('*\x20'+CLI_DISPLAY_NAME+_0x2c0390(0xfb)),_0x58a3da['forEach']((_0xffcea5,_0x1d6beb)=>{const _0x549ac5=_0x2c0390,_0x4c6f56=new Date(_0xffcea5[_0x549ac5(0x103)])[_0x549ac5(0xf5)](_0x549ac5(0x106)),_0x385307=_0xffcea5['level']===_0x549ac5(0x10b)?'√':_0xffcea5[_0x549ac5(0xfc)]==='error'?'×':_0xffcea5[_0x549ac5(0xfc)]===_0x549ac5(0x116)?'!':'i';console[_0x549ac5(0x102)](_0x1d6beb+0x1+'.\x20'+_0x385307+'\x20['+_0xffcea5[_0x549ac5(0x108)]+']\x20'+_0xffcea5[_0x549ac5(0xff)]),console[_0x549ac5(0x102)](_0x549ac5(0xf8)+_0x4c6f56),_0xffcea5[_0x549ac5(0x10d)]&&console[_0x549ac5(0x102)](_0x549ac5(0x113)+_0xffcea5[_0x549ac5(0x10d)]+'ms'),_0xffcea5['details']&&Object[_0x549ac5(0x10a)](_0xffcea5[_0x549ac5(0xf6)])[_0x549ac5(0x105)]>0x0&&console[_0x549ac5(0x102)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0xffcea5[_0x549ac5(0xf6)],null,0x2)),console[_0x549ac5(0x102)]('');});}export const logsDefinitions=[{'service':a33_0x4fc868(0x10e),'command':a33_0x4fc868(0x10f),'description':'View\x20command\x20history\x20logs','risk':a33_0x4fc868(0x10c),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x10e09c){const _0xcf171a=a33_0x4fc868;return printLogs(logger[_0xcf171a(0xf4)]()),{'ok':!![]};}},{'service':a33_0x4fc868(0x10e),'command':a33_0x4fc868(0x112),'description':a33_0x4fc868(0x114),'risk':a33_0x4fc868(0xfe),'confirmationDescription':'将永久清空当前工作目录下的\x20Lovrabet\x20CLI\x20本地诊断日志;不会影响平台业务数据。','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x13d52f){const _0x59503a=a33_0x4fc868;return logger[_0x59503a(0x100)](),console['log'](_0x59503a(0x111)),{'ok':!![]};}}];function a33_0x315f(){const _0xb893b1=['\x20logs:\x0a','level','8423303OyfPCY','write','message','clearLogs','11366510nvuQZf','log','timestamp','32BXtcIz','length','en-US','1280552TEopbb','command','8139895vdSAjd','keys','success','read','duration','logs','show','3QbEahR','*\x20Logs\x20cleared','clear','\x20\x20\x20Duration:\x20','清除命令历史日志','12569391IizzKs','warn','13674448LfELLS','readLogs','toLocaleString','details','6QdEYDC','\x20\x20\x20Time:\x20','44JHPhNM','40731VoGckM'];a33_0x315f=function(){return _0xb893b1;};return a33_0x315f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x3877bd=a34_0x1c47;(function(_0x3aea78,_0x14e972){const _0x10ac20=a34_0x1c47,_0x2766f7=_0x3aea78();while(!![]){try{const _0x566e8d=parseInt(_0x10ac20(0x20b))/0x1*(parseInt(_0x10ac20(0x1f6))/0x2)+-parseInt(_0x10ac20(0x1dc))/0x3*(-parseInt(_0x10ac20(0x207))/0x4)+parseInt(_0x10ac20(0x1fd))/0x5+parseInt(_0x10ac20(0x20d))/0x6*(-parseInt(_0x10ac20(0x1f9))/0x7)+-parseInt(_0x10ac20(0x1eb))/0x8+parseInt(_0x10ac20(0x1f5))/0x9+-parseInt(_0x10ac20(0x1d6))/0xa*(parseInt(_0x10ac20(0x1d8))/0xb);if(_0x566e8d===_0x14e972)break;else _0x2766f7['push'](_0x2766f7['shift']());}catch(_0x197e47){_0x2766f7['push'](_0x2766f7['shift']());}}}(a34_0x39db,0xc3189));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x3877bd(0x1fb),a34_0x3877bd(0x1f1),'form',a34_0x3877bd(0x1e3)],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x3877bd(0x1ef),'general':a34_0x3877bd(0x1e7),'form':a34_0x3877bd(0x1f8),'idCard':a34_0x3877bd(0x1dd)},SCENE_FLAG={'name':a34_0x3877bd(0x20a),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':'image-file','type':'string','description':a34_0x3877bd(0x1f3)},IMAGE_URL_FLAG={'name':a34_0x3877bd(0x1ee),'type':a34_0x3877bd(0x1ec),'description':a34_0x3877bd(0x20c)};function normalizeScene(_0x4f7d50){const _0x5e6464=a34_0x3877bd,_0x345fd4=_0x4f7d50[_0x5e6464(0x1d7)]()[_0x5e6464(0x1df)]();if(_0x345fd4===_0x5e6464(0x1e8))return _0x5e6464(0x1e3);if(_0x345fd4===_0x5e6464(0x1fb)||_0x345fd4===_0x5e6464(0x1f1)||_0x345fd4===_0x5e6464(0x202))return _0x345fd4;throw CliErrors[_0x5e6464(0x206)](_0x5e6464(0x203)+_0x4f7d50+_0x5e6464(0x210)+SUPPORTED_SCENES[_0x5e6464(0x208)](',\x20'));}function selectedInputs(_0x116f09){const _0x124c57=a34_0x3877bd,_0x3bb6d9=_0x116f09[_0x124c57(0x1e9)](_0x124c57(0x1e4))['trim'](),_0x5b6a72=_0x116f09['str'](_0x124c57(0x1ee))['trim']();return{'imageFile':_0x3bb6d9,'imageUrl':_0x5b6a72,'count':[_0x3bb6d9,_0x5b6a72][_0x124c57(0x1f4)](Boolean)[_0x124c57(0x1f7)]};}function validateInputSelection(_0x4643c0){const _0x90951=a34_0x3877bd,_0x3b888e=selectedInputs(_0x4643c0);if(_0x3b888e['count']!==0x1)throw CliErrors['validation'](_0x90951(0x201));return _0x3b888e;}function a34_0x1c47(_0x3d47c8,_0x1aab93){_0x3d47c8=_0x3d47c8-0x1d6;const _0x39db32=a34_0x39db();let _0x1c4719=_0x39db32[_0x3d47c8];return _0x1c4719;}function withScene(_0x3732bc,_0x26fc26,_0xde7b3){return{..._0x3732bc,'scene':_0x26fc26,..._0xde7b3?{'sourceFile':{'fileName':_0xde7b3['fileName'],'filePath':_0xde7b3['filePath']}}:{}};}const ocrRecognize={'service':a34_0x3877bd(0x1e2),'command':a34_0x3877bd(0x1e1),'description':a34_0x3877bd(0x1e6),'risk':a34_0x3877bd(0x1e0),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x319a48){const _0x40ee34=a34_0x3877bd,_0x1bd719=normalizeScene(_0x319a48[_0x40ee34(0x1e9)]('scene')),_0x45e97d=SCENE_TO_LEGACY_TYPE[_0x1bd719],_0x391481=validateInputSelection(_0x319a48);if(_0x391481['imageUrl'])return dryRun(_0x40ee34(0x1f0),_0x40ee34(0x20e))[_0x40ee34(0x1ed)]({'appCode':_0x319a48[_0x40ee34(0x1fe)],'url':_0x391481[_0x40ee34(0x1ea)],'type':_0x45e97d})[_0x40ee34(0x1fc)](_0x40ee34(0x211)+_0x1bd719+_0x40ee34(0x1d9))['build']();const _0x3770a4=requireRuntimeUploadFile(_0x391481[_0x40ee34(0x1da)],_0x40ee34(0x1e4));return dryRun(_0x40ee34(0x1f0),_0x40ee34(0x1de))[_0x40ee34(0x1ed)]({'steps':[{'method':_0x40ee34(0x1f0),'url':_0x40ee34(0x1de),'body':{'appCode':_0x319a48[_0x40ee34(0x1fe)],'multipart':{'file':_0x3770a4}}},{'method':'POST','url':'/client/queryFileUrl','body':{'filePath':_0x40ee34(0x1db),'downloadFlag':![]}},{'method':'POST','url':_0x40ee34(0x20e),'body':{'appCode':_0x319a48[_0x40ee34(0x1fe)],'url':_0x40ee34(0x1e5),'type':_0x45e97d}}]})['description'](_0x40ee34(0x200)+_0x1bd719+_0x40ee34(0x204))['build']();},async 'execute'(_0x26623d){const _0x384b36=a34_0x3877bd,_0x3b3e78=normalizeScene(_0x26623d[_0x384b36(0x1e9)]('scene')),_0x537cea=SCENE_TO_LEGACY_TYPE[_0x3b3e78],_0x59d46a=validateInputSelection(_0x26623d);if(_0x59d46a[_0x384b36(0x1ea)]){const _0x4e9fac=await recognizeRuntimeOcr(_0x26623d[_0x384b36(0x1fe)],{'url':_0x59d46a[_0x384b36(0x1ea)],'type':_0x537cea});return{'ok':!![],'data':withScene(_0x4e9fac,_0x3b3e78)};}const _0x3d55fb=requireRuntimeUploadFile(_0x59d46a[_0x384b36(0x1da)],_0x384b36(0x1e4)),_0xa6841b=await uploadRuntimeFile(_0x26623d[_0x384b36(0x1fe)],_0x3d55fb[_0x384b36(0x1ff)]);if(!_0xa6841b[_0x384b36(0x205)])throw CliErrors[_0x384b36(0x20f)](_0x384b36(0x1f2));const _0x25c22f=await queryRuntimeFileUrl(_0xa6841b[_0x384b36(0x205)],{'download':![]});if(!_0x25c22f[_0x384b36(0x209)])throw CliErrors['apiError'](_0x384b36(0x1fa));const _0x1c2b77=await recognizeRuntimeOcr(_0x26623d['appCode'],{'url':_0x25c22f[_0x384b36(0x209)],'type':_0x537cea});return{'ok':!![],'data':withScene(_0x1c2b77,_0x3b3e78,_0xa6841b)};}};function a34_0x39db(){const _0x43fea6=['Table','6167jkagUs','File\x20URL\x20response\x20missing\x20fileUrl.','invoice','description','5325845KhjHCw','appCode','path','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','form','Unsupported\x20OCR\x20scene:\x20','\x20OCR','filePath','validation','72796YizRdc','join','fileUrl','scene','233BgxJGV','Publicly\x20accessible\x20image\x20or\x20file\x20URL','1284zaNtmS','/client/ocr','apiError','.\x20Supported\x20scenes:\x20','Preview:\x20recognize\x20','30469550mQboiN','trim','11frVDkV','\x20OCR\x20from\x20URL','imageFile','<filePath\x20returned\x20by\x20/client/uploadFile>','213iVOFtq','IdCard','/client/uploadFile','toLowerCase','read','recognize','ocr','idCard','image-file','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','General','idcard','str','imageUrl','2065208kVlXxB','string','body','image-url','Invoice','POST','general','File\x20upload\x20response\x20missing\x20filePath.','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','filter','12256281UbcliN','4924siKZqP','length'];a34_0x39db=function(){return _0x43fea6;};return a34_0x39db();}export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x254dc7=a35_0x10ca;(function(_0x56f546,_0x16a8d4){const _0xd28655=a35_0x10ca,_0x3c850d=_0x56f546();while(!![]){try{const _0x3121d1=parseInt(_0xd28655(0x12a))/0x1+-parseInt(_0xd28655(0x153))/0x2+parseInt(_0xd28655(0x16f))/0x3*(parseInt(_0xd28655(0x164))/0x4)+-parseInt(_0xd28655(0x134))/0x5+parseInt(_0xd28655(0x13e))/0x6+parseInt(_0xd28655(0x163))/0x7*(parseInt(_0xd28655(0x142))/0x8)+-parseInt(_0xd28655(0x15e))/0x9*(parseInt(_0xd28655(0x14d))/0xa);if(_0x3121d1===_0x16a8d4)break;else _0x3c850d['push'](_0x3c850d['shift']());}catch(_0x7397e0){_0x3c850d['push'](_0x3c850d['shift']());}}}(a35_0x5cc0,0xbf34e));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';function a35_0x10ca(_0x48a3d2,_0x5791be){_0x48a3d2=_0x48a3d2-0x123;const _0x5cc0ec=a35_0x5cc0();let _0x10ca91=_0x5cc0ec[_0x48a3d2];return _0x10ca91;}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_0x254dc7(0x15a),'type':a35_0x254dc7(0x16a),'description':a35_0x254dc7(0x160)},FUNCTION_NAME_FLAG={'name':'name','type':'string','required':!![],'description':a35_0x254dc7(0x158)},DESCRIPTION_FLAG={'name':'description','type':a35_0x254dc7(0x16a),'description':a35_0x254dc7(0x138)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':a35_0x254dc7(0x16a),'description':a35_0x254dc7(0x14f)};function normalizeFunctionName(_0x35b534){const _0x2657e6=a35_0x254dc7,_0x1ca78e=String(_0x35b534||'')[_0x2657e6(0x13a)]();if(!_0x1ca78e||!FUNCTION_NAME_PATTERN['test'](_0x1ca78e))throw CliErrors['validation'](_0x2657e6(0x147));return _0x1ca78e;}function readScriptFile(_0x304a77){const _0x159fb7=a35_0x254dc7;if(!_0x304a77)throw CliErrors[_0x159fb7(0x16b)](_0x159fb7(0x151));if(!existsSync(_0x304a77))throw CliErrors[_0x159fb7(0x16b)](_0x159fb7(0x161)+_0x304a77);if(!statSync(_0x304a77)[_0x159fb7(0x13d)]())throw CliErrors[_0x159fb7(0x16b)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x304a77);const _0x3923c8=readFileSync(_0x304a77,_0x159fb7(0x16e));if(!_0x3923c8[_0x159fb7(0x13a)]())throw CliErrors['validation'](_0x159fb7(0x14c));return _0x3923c8;}function optionalTrimmed(_0x1332ba){const _0x17a601=a35_0x254dc7,_0x46dde0=String(_0x1332ba||'')[_0x17a601(0x13a)]();return _0x46dde0||undefined;}function summarizeBff(_0x409735){const _0x14a3a8=a35_0x254dc7;return{'id':_0x409735['id'],'appCode':_0x409735[_0x14a3a8(0x144)],'functionName':_0x409735[_0x14a3a8(0x12b)],'description':_0x409735['description'],'scriptType':_0x409735['scriptType'],'version':_0x409735[_0x14a3a8(0x127)],'gmtModified':_0x409735[_0x14a3a8(0x15d)],'updateTime':_0x409735[_0x14a3a8(0x15c)]};}function detailBff(_0x5891e7){const _0x8636ec=a35_0x254dc7;return{'id':_0x5891e7['id'],'appCode':_0x5891e7['appCode'],'functionName':_0x5891e7[_0x8636ec(0x12b)],'description':_0x5891e7[_0x8636ec(0x12e)],'scriptType':_0x5891e7[_0x8636ec(0x169)],'scriptContent':_0x5891e7[_0x8636ec(0x15f)]??'','config':_0x5891e7[_0x8636ec(0x156)],'version':_0x5891e7['version'],'createUserId':_0x5891e7[_0x8636ec(0x14b)],'gmtCreate':_0x5891e7[_0x8636ec(0x145)],'gmtModified':_0x5891e7[_0x8636ec(0x15d)],'createTime':_0x5891e7[_0x8636ec(0x157)],'updateTime':_0x5891e7[_0x8636ec(0x15c)]};}function buildCreateInput(_0x26469f){const _0x50cb74=a35_0x254dc7;return{'functionName':normalizeFunctionName(_0x26469f[_0x50cb74(0x12d)](_0x50cb74(0x14a))),...optionalTrimmed(_0x26469f[_0x50cb74(0x12d)](_0x50cb74(0x12e)))?{'description':optionalTrimmed(_0x26469f[_0x50cb74(0x12d)](_0x50cb74(0x12e)))}:{},'scriptContent':readScriptFile(_0x26469f[_0x50cb74(0x12d)](_0x50cb74(0x15a))),...optionalTrimmed(_0x26469f['str'](_0x50cb74(0x168)))?{'sourceSessionId':optionalTrimmed(_0x26469f[_0x50cb74(0x12d)](_0x50cb74(0x168)))}:{}};}function buildUpdateInput(_0x7d2333){const _0x3857eb=a35_0x254dc7,_0x1a75c0={};optionalTrimmed(_0x7d2333[_0x3857eb(0x12d)](_0x3857eb(0x14a)))&&(_0x1a75c0['functionName']=normalizeFunctionName(_0x7d2333[_0x3857eb(0x12d)](_0x3857eb(0x14a))));_0x7d2333[_0x3857eb(0x137)]('description')!==undefined&&(_0x1a75c0['description']=_0x7d2333[_0x3857eb(0x12d)](_0x3857eb(0x12e)));optionalTrimmed(_0x7d2333[_0x3857eb(0x12d)](_0x3857eb(0x15a)))&&(_0x1a75c0[_0x3857eb(0x15f)]=readScriptFile(_0x7d2333['str'](_0x3857eb(0x15a))));_0x7d2333[_0x3857eb(0x137)]('source-session-id')!==undefined&&(_0x1a75c0[_0x3857eb(0x149)]=_0x7d2333[_0x3857eb(0x12d)]('source-session-id'));if(Object[_0x3857eb(0x135)](_0x1a75c0)[_0x3857eb(0x166)]===0x0)throw CliErrors[_0x3857eb(0x16b)](_0x3857eb(0x139));return _0x1a75c0;}function a35_0x5cc0(){const _0x35f6f3=['write','bool','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','2395775BRZBPF','keys','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','flag','Personal\x20BFF\x20description','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','trim','detail','isArray','isFile','5771094WUyOEI','Preview:\x20create\x20personal\x20BFF\x20','params','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','16Nxixkq','/client/runtime-bff/personal/create','appCode','gmtCreate','high-risk-write','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','POST','sourceSessionId','name','createUserId','Personal\x20BFF\x20script\x20file\x20is\x20blank.','10SMKNKX','map','Optional\x20source\x20RuntimeAgent\x20session\x20id','exec','File\x20path\x20is\x20required.','update','2847680Bffpfb','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','body','config','createTime','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','file','Personal\x20BFF\x20script\x20ID','updateTime','gmtModified','6456519tpFAAT','scriptContent','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','File\x20not\x20found:\x20','Created\x20personal\x20BFF\x20','1216922sLaTKL','284168VQaydN','create','length','personal-bff','source-session-id','scriptType','string','validation','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Executed\x20personal\x20BFF\x20','utf8','24VymvOd','build','list','根据本地脚本文件创建个人\x20BFF','根据\x20ID\x20更新个人\x20BFF','version','read','num','1525691rqJhsI','functionName','Updated\x20personal\x20BFF\x20','str','description','Preview:\x20update\x20personal\x20BFF\x20','verbose'];a35_0x5cc0=function(){return _0x35f6f3;};return a35_0x5cc0();}function parseExecParams(_0x3a2b24){const _0x109de3=a35_0x254dc7,_0x4c866f=parseJsonParams(_0x3a2b24)??{};if(Array[_0x109de3(0x13c)](_0x4c866f))throw CliErrors[_0x109de3(0x16b)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x4c866f;}const personalBffList={'service':'personal-bff','command':a35_0x254dc7(0x124),'description':a35_0x254dc7(0x136),'risk':a35_0x254dc7(0x128),'flags':[VERBOSE_FLAG],async 'execute'(_0x40be84){const _0x1179f6=a35_0x254dc7,_0x1bb43d=await listPersonalBffs(_0x40be84[_0x1179f6(0x144)]);return{'ok':!![],'data':{'total':_0x1bb43d[_0x1179f6(0x166)],'items':_0x40be84[_0x1179f6(0x132)](_0x1179f6(0x130))?_0x1bb43d:_0x1bb43d[_0x1179f6(0x14e)](summarizeBff)}};}},personalBffDetail={'service':a35_0x254dc7(0x167),'command':a35_0x254dc7(0x13b),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x254dc7(0x128),'flags':[{...ID_FLAG,'description':a35_0x254dc7(0x15b)}],async 'execute'(_0xc0d0ec){const _0x3abf5d=a35_0x254dc7,_0xe04666=await getPersonalBff(_0xc0d0ec[_0x3abf5d(0x129)]('id'),_0xc0d0ec[_0x3abf5d(0x144)]);return{'ok':!![],'data':detailBff(_0xe04666)};}},personalBffCreate={'service':a35_0x254dc7(0x167),'command':a35_0x254dc7(0x165),'description':a35_0x254dc7(0x125),'risk':a35_0x254dc7(0x131),'confirmationDescription':a35_0x254dc7(0x141),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3aadd1){const _0x320488=a35_0x254dc7,_0x1a630e=buildCreateInput(_0x3aadd1),_0x573003=await createPersonalBff(_0x3aadd1[_0x320488(0x144)],_0x1a630e);return{'ok':!![],'data':detailBff(_0x573003),'message':_0x320488(0x162)+_0x573003['id']+(_0x573003[_0x320488(0x12b)]?'\x20('+_0x573003[_0x320488(0x12b)]+')':'')};},async 'dryRun'(_0x3f8007){const _0x2cd7c3=a35_0x254dc7,_0x15019b=buildCreateInput(_0x3f8007);return dryRun(_0x2cd7c3(0x148),_0x2cd7c3(0x143))[_0x2cd7c3(0x155)]({'appCode':_0x3f8007[_0x2cd7c3(0x144)],..._0x15019b})['description'](_0x2cd7c3(0x13f)+_0x15019b['functionName'])[_0x2cd7c3(0x123)]();}},personalBffUpdate={'service':'personal-bff','command':a35_0x254dc7(0x152),'description':a35_0x254dc7(0x126),'risk':a35_0x254dc7(0x131),'confirmationDescription':a35_0x254dc7(0x159),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0xaf61d9){const _0xa67f53=a35_0x254dc7,_0x160053=_0xaf61d9['num']('id'),_0x2438be=buildUpdateInput(_0xaf61d9),_0x100d21=await updatePersonalBff(_0x160053,_0xaf61d9[_0xa67f53(0x144)],_0x2438be);return{'ok':!![],'data':detailBff(_0x100d21),'message':_0xa67f53(0x12c)+_0x100d21['id']+(_0x100d21['functionName']?'\x20('+_0x100d21[_0xa67f53(0x12b)]+')':'')};},async 'dryRun'(_0x4db761){const _0x1f336e=a35_0x254dc7,_0x1a7e9c=_0x4db761['num']('id'),_0x4faab0=buildUpdateInput(_0x4db761);return dryRun(_0x1f336e(0x148),'/client/runtime-bff/personal/'+_0x1a7e9c+'/update')['body']({'appCode':_0x4db761[_0x1f336e(0x144)],..._0x4faab0})['description'](_0x1f336e(0x12f)+_0x1a7e9c)[_0x1f336e(0x123)]();}},personalBffExec={'service':a35_0x254dc7(0x167),'command':a35_0x254dc7(0x150),'description':a35_0x254dc7(0x133),'risk':a35_0x254dc7(0x146),'confirmationDescription':a35_0x254dc7(0x154),'flags':[{...ID_FLAG,'description':a35_0x254dc7(0x15b)},{...PARAMS_FLAG,'description':a35_0x254dc7(0x16c)}],async 'validate'(_0x30e537){const _0x3ad152=a35_0x254dc7;parseExecParams(_0x30e537[_0x3ad152(0x12d)]('params'));},async 'execute'(_0x489385){const _0x1a1d9c=a35_0x254dc7,_0x538c9b=_0x489385['num']('id'),_0x28e554=parseExecParams(_0x489385['str'](_0x1a1d9c(0x140))),_0x46f59e=await executePersonalBff(_0x538c9b,_0x489385[_0x1a1d9c(0x144)],_0x28e554);return{'ok':!![],'data':{'result':_0x46f59e},'message':_0x1a1d9c(0x16d)+_0x538c9b};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x5850f9=a35_0x4bc3;(function(_0x272315,_0x3f0fae){const _0x25bae4=a35_0x4bc3,_0xc9ac9a=_0x272315();while(!![]){try{const _0x3dc2fb=parseInt(_0x25bae4(0xc5))/0x1*(parseInt(_0x25bae4(0xa4))/0x2)+-parseInt(_0x25bae4(0x9d))/0x3*(parseInt(_0x25bae4(0xb3))/0x4)+parseInt(_0x25bae4(0xc9))/0x5+parseInt(_0x25bae4(0xa5))/0x6+-parseInt(_0x25bae4(0xba))/0x7*(parseInt(_0x25bae4(0xa0))/0x8)+parseInt(_0x25bae4(0xcd))/0x9*(-parseInt(_0x25bae4(0xd4))/0xa)+parseInt(_0x25bae4(0xa3))/0xb;if(_0x3dc2fb===_0x3f0fae)break;else _0xc9ac9a['push'](_0xc9ac9a['shift']());}catch(_0x16030e){_0xc9ac9a['push'](_0xc9ac9a['shift']());}}}(a35_0x29a9,0xf20de));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';function a35_0x4bc3(_0x136c9a,_0x23795f){_0x136c9a=_0x136c9a-0x9b;const _0x29a95f=a35_0x29a9();let _0x4bc374=_0x29a95f[_0x136c9a];return _0x4bc374;}function a35_0x29a9(){const _0x1246d3=['verbose','test','params','functionName','gmtModified','read','isFile','/update','map','4MBTHuu','write','personal-bff','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','/client/runtime-bff/personal/create','create','1741145qkCznY','source-session-id','createUserId','keys','updateTime','appCode','File\x20path\x20is\x20required.','name','update','flag','trim','4ANiNsT','scriptType','gmtCreate','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','5091150wDorMy','File\x20is\x20not\x20a\x20regular\x20file:\x20','length','validation','40428VIvZDY','isArray','Created\x20personal\x20BFF\x20','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','utf8','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','3210GpDlWU','exec','Personal\x20BFF\x20script\x20ID','File\x20not\x20found:\x20','sourceSessionId','build','description','body','string','list','version','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','num','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','POST','Preview:\x20update\x20personal\x20BFF\x20','config','根据\x20ID\x20更新个人\x20BFF','scriptContent','5406063yobDHC','file','str','8vnlCNJ','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','high-risk-write','14437885axOCwK','501546BfbvUA','6901710KDqCmt','Updated\x20personal\x20BFF\x20','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','根据本地脚本文件创建个人\x20BFF','Preview:\x20create\x20personal\x20BFF\x20'];a35_0x29a9=function(){return _0x1246d3;};return a35_0x29a9();}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_0x5850f9(0x9e),'type':a35_0x5850f9(0xdc),'description':a35_0x5850f9(0xa7)},FUNCTION_NAME_FLAG={'name':a35_0x5850f9(0xc1),'type':a35_0x5850f9(0xdc),'required':!![],'description':a35_0x5850f9(0xdf)},DESCRIPTION_FLAG={'name':a35_0x5850f9(0xda),'type':a35_0x5850f9(0xdc),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x5850f9(0xbb),'type':a35_0x5850f9(0xdc),'description':'Optional\x20source\x20RuntimeAgent\x20session\x20id'};function normalizeFunctionName(_0x166c53){const _0x3d08a0=a35_0x5850f9,_0x2eb203=String(_0x166c53||'')['trim']();if(!_0x2eb203||!FUNCTION_NAME_PATTERN[_0x3d08a0(0xab)](_0x2eb203))throw CliErrors['validation'](_0x3d08a0(0xa1));return _0x2eb203;}function readScriptFile(_0xb81fe2){const _0x521f2e=a35_0x5850f9;if(!_0xb81fe2)throw CliErrors[_0x521f2e(0xcc)](_0x521f2e(0xc0));if(!existsSync(_0xb81fe2))throw CliErrors[_0x521f2e(0xcc)](_0x521f2e(0xd7)+_0xb81fe2);if(!statSync(_0xb81fe2)[_0x521f2e(0xb0)]())throw CliErrors[_0x521f2e(0xcc)](_0x521f2e(0xca)+_0xb81fe2);const _0x52661b=readFileSync(_0xb81fe2,_0x521f2e(0xd2));if(!_0x52661b[_0x521f2e(0xc4)]())throw CliErrors[_0x521f2e(0xcc)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x52661b;}function optionalTrimmed(_0x1bd914){const _0x1dc932=a35_0x5850f9,_0x47c8a0=String(_0x1bd914||'')[_0x1dc932(0xc4)]();return _0x47c8a0||undefined;}function summarizeBff(_0x1140b8){const _0x1c1516=a35_0x5850f9;return{'id':_0x1140b8['id'],'appCode':_0x1140b8[_0x1c1516(0xbf)],'functionName':_0x1140b8['functionName'],'description':_0x1140b8[_0x1c1516(0xda)],'scriptType':_0x1140b8[_0x1c1516(0xc6)],'version':_0x1140b8[_0x1c1516(0xde)],'gmtModified':_0x1140b8[_0x1c1516(0xae)],'updateTime':_0x1140b8[_0x1c1516(0xbe)]};}function detailBff(_0x6b9a07){const _0x429649=a35_0x5850f9;return{'id':_0x6b9a07['id'],'appCode':_0x6b9a07[_0x429649(0xbf)],'functionName':_0x6b9a07[_0x429649(0xad)],'description':_0x6b9a07['description'],'scriptType':_0x6b9a07[_0x429649(0xc6)],'scriptContent':_0x6b9a07['scriptContent']??'','config':_0x6b9a07[_0x429649(0xe4)],'version':_0x6b9a07[_0x429649(0xde)],'createUserId':_0x6b9a07[_0x429649(0xbc)],'gmtCreate':_0x6b9a07[_0x429649(0xc7)],'gmtModified':_0x6b9a07['gmtModified'],'createTime':_0x6b9a07['createTime'],'updateTime':_0x6b9a07[_0x429649(0xbe)]};}function buildCreateInput(_0x2fc631){const _0x3df14d=a35_0x5850f9;return{'functionName':normalizeFunctionName(_0x2fc631[_0x3df14d(0x9f)](_0x3df14d(0xc1))),...optionalTrimmed(_0x2fc631[_0x3df14d(0x9f)](_0x3df14d(0xda)))?{'description':optionalTrimmed(_0x2fc631['str'](_0x3df14d(0xda)))}:{},'scriptContent':readScriptFile(_0x2fc631[_0x3df14d(0x9f)](_0x3df14d(0x9e))),...optionalTrimmed(_0x2fc631[_0x3df14d(0x9f)]('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x2fc631[_0x3df14d(0x9f)](_0x3df14d(0xbb)))}:{}};}function buildUpdateInput(_0x180376){const _0xd3d218=a35_0x5850f9,_0x35fdfb={};optionalTrimmed(_0x180376[_0xd3d218(0x9f)](_0xd3d218(0xc1)))&&(_0x35fdfb[_0xd3d218(0xad)]=normalizeFunctionName(_0x180376[_0xd3d218(0x9f)](_0xd3d218(0xc1))));_0x180376[_0xd3d218(0xc3)](_0xd3d218(0xda))!==undefined&&(_0x35fdfb[_0xd3d218(0xda)]=_0x180376['str']('description'));optionalTrimmed(_0x180376[_0xd3d218(0x9f)]('file'))&&(_0x35fdfb[_0xd3d218(0x9c)]=readScriptFile(_0x180376[_0xd3d218(0x9f)](_0xd3d218(0x9e))));_0x180376[_0xd3d218(0xc3)](_0xd3d218(0xbb))!==undefined&&(_0x35fdfb[_0xd3d218(0xd8)]=_0x180376[_0xd3d218(0x9f)](_0xd3d218(0xbb)));if(Object[_0xd3d218(0xbd)](_0x35fdfb)[_0xd3d218(0xcb)]===0x0)throw CliErrors[_0xd3d218(0xcc)](_0xd3d218(0xe1));return _0x35fdfb;}function parseExecParams(_0x428441){const _0x274628=a35_0x5850f9,_0x547649=parseJsonParams(_0x428441)??{};if(Array[_0x274628(0xce)](_0x547649))throw CliErrors[_0x274628(0xcc)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x547649;}const personalBffList={'service':a35_0x5850f9(0xb5),'command':a35_0x5850f9(0xdd),'description':a35_0x5850f9(0xd3),'risk':a35_0x5850f9(0xaf),'flags':[VERBOSE_FLAG],async 'execute'(_0x4c3cc2){const _0x5b8d8e=a35_0x5850f9,_0x489226=await listPersonalBffs(_0x4c3cc2[_0x5b8d8e(0xbf)]);return{'ok':!![],'data':{'total':_0x489226[_0x5b8d8e(0xcb)],'items':_0x4c3cc2['bool'](_0x5b8d8e(0xaa))?_0x489226:_0x489226[_0x5b8d8e(0xb2)](summarizeBff)}};}},personalBffDetail={'service':a35_0x5850f9(0xb5),'command':'detail','description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x5850f9(0xaf),'flags':[{...ID_FLAG,'description':a35_0x5850f9(0xd6)}],async 'execute'(_0x57b79b){const _0x5503d6=a35_0x5850f9,_0x2272b5=await getPersonalBff(_0x57b79b['num']('id'),_0x57b79b[_0x5503d6(0xbf)]);return{'ok':!![],'data':detailBff(_0x2272b5)};}},personalBffCreate={'service':a35_0x5850f9(0xb5),'command':a35_0x5850f9(0xb9),'description':a35_0x5850f9(0xa8),'risk':'write','confirmationDescription':a35_0x5850f9(0xb7),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4163d9){const _0x693c70=a35_0x5850f9,_0x2c3cb3=buildCreateInput(_0x4163d9),_0x3434d2=await createPersonalBff(_0x4163d9[_0x693c70(0xbf)],_0x2c3cb3);return{'ok':!![],'data':detailBff(_0x3434d2),'message':_0x693c70(0xcf)+_0x3434d2['id']+(_0x3434d2[_0x693c70(0xad)]?'\x20('+_0x3434d2[_0x693c70(0xad)]+')':'')};},async 'dryRun'(_0x1b0444){const _0x2f47c8=a35_0x5850f9,_0x381c76=buildCreateInput(_0x1b0444);return dryRun(_0x2f47c8(0xe2),_0x2f47c8(0xb8))[_0x2f47c8(0xdb)]({'appCode':_0x1b0444[_0x2f47c8(0xbf)],..._0x381c76})[_0x2f47c8(0xda)](_0x2f47c8(0xa9)+_0x381c76[_0x2f47c8(0xad)])[_0x2f47c8(0xd9)]();}},personalBffUpdate={'service':'personal-bff','command':a35_0x5850f9(0xc2),'description':a35_0x5850f9(0x9b),'risk':a35_0x5850f9(0xb4),'confirmationDescription':a35_0x5850f9(0xb6),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4d1613){const _0xdb2af2=a35_0x5850f9,_0x23e388=_0x4d1613[_0xdb2af2(0xe0)]('id'),_0x413434=buildUpdateInput(_0x4d1613),_0x424fe6=await updatePersonalBff(_0x23e388,_0x4d1613['appCode'],_0x413434);return{'ok':!![],'data':detailBff(_0x424fe6),'message':_0xdb2af2(0xa6)+_0x424fe6['id']+(_0x424fe6[_0xdb2af2(0xad)]?'\x20('+_0x424fe6[_0xdb2af2(0xad)]+')':'')};},async 'dryRun'(_0x4266b1){const _0x197382=a35_0x5850f9,_0x4bc3cb=_0x4266b1[_0x197382(0xe0)]('id'),_0x2e8705=buildUpdateInput(_0x4266b1);return dryRun(_0x197382(0xe2),'/client/runtime-bff/personal/'+_0x4bc3cb+_0x197382(0xb1))[_0x197382(0xdb)]({'appCode':_0x4266b1[_0x197382(0xbf)],..._0x2e8705})[_0x197382(0xda)](_0x197382(0xe3)+_0x4bc3cb)[_0x197382(0xd9)]();}},personalBffExec={'service':'personal-bff','command':a35_0x5850f9(0xd5),'description':a35_0x5850f9(0xd0),'risk':a35_0x5850f9(0xa2),'confirmationDescription':a35_0x5850f9(0xd1),'flags':[{...ID_FLAG,'description':a35_0x5850f9(0xd6)},{...PARAMS_FLAG,'description':a35_0x5850f9(0xc8)}],async 'validate'(_0x1c2bce){const _0x5bbaab=a35_0x5850f9;parseExecParams(_0x1c2bce[_0x5bbaab(0x9f)](_0x5bbaab(0xac)));},async 'execute'(_0x15ebae){const _0x547205=a35_0x5850f9,_0x41133d=_0x15ebae[_0x547205(0xe0)]('id'),_0x41b3e3=parseExecParams(_0x15ebae[_0x547205(0x9f)]('params')),_0x542473=await executePersonalBff(_0x41133d,_0x15ebae[_0x547205(0xbf)],_0x41b3e3);return{'ok':!![],'data':{'result':_0x542473},'message':'Executed\x20personal\x20BFF\x20'+_0x41133d};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x5e441f=a36_0x1519;(function(_0x4c4751,_0x5b8347){const _0x42c259=a36_0x1519,_0x5d2804=_0x4c4751();while(!![]){try{const _0x2e3dfe=parseInt(_0x42c259(0x19c))/0x1+-parseInt(_0x42c259(0x18f))/0x2*(parseInt(_0x42c259(0x1a1))/0x3)+-parseInt(_0x42c259(0x17c))/0x4+parseInt(_0x42c259(0x193))/0x5+parseInt(_0x42c259(0x1a3))/0x6+parseInt(_0x42c259(0x186))/0x7+parseInt(_0x42c259(0x17a))/0x8*(-parseInt(_0x42c259(0x187))/0x9);if(_0x2e3dfe===_0x5b8347)break;else _0x5d2804['push'](_0x5d2804['shift']());}catch(_0x5bef55){_0x5d2804['push'](_0x5d2804['shift']());}}}(a36_0x3c4d,0xd00ea));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';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';function a36_0x1519(_0x5bd514,_0x9d2fa0){_0x5bd514=_0x5bd514-0x179;const _0x3c4dde=a36_0x3c4d();let _0x1519ca=_0x3c4dde[_0x5bd514];return _0x1519ca;}import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];function a36_0x3c4d(){const _0x2d387e=['BFF\x20Scripts','File','list','407046xXxgYH','install','login','from','push','2677641GyMOzq','Instant\x20API','945360UJhQSK','Personal\x20BFF','4968688MVLQrD','Authentication','2192996SQNYZA','Artifacts','show','map','write','API\x20Documentation','Diagnostics','command','Configuration','Agent\x20Schedules','9219448fDitLf','18xFzPFi','description','values','get','set','isSingleCommand','Self\x20Update','OCR','2NUZKJj','App\x20Management','risk','Schema','8267500wIoltX','service','\x20\x20[write]','defaultCommand','Datasets','has'];a36_0x3c4d=function(){return _0x2d387e;};return a36_0x3c4d();}const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0xb0ed03){const _0x2e080f=a36_0x1519;for(const _0x542590 of _0xb0ed03){definitions[_0x2e080f(0x18b)](_0x542590[_0x2e080f(0x194)]+':'+_0x542590[_0x2e080f(0x183)],_0x542590);let _0x5632a5=serviceGroups[_0x2e080f(0x18a)](_0x542590[_0x2e080f(0x194)]);!_0x5632a5&&(_0x5632a5=[],serviceGroups[_0x2e080f(0x18b)](_0x542590[_0x2e080f(0x194)],_0x5632a5)),_0x5632a5[_0x2e080f(0x1a0)](_0x542590);}}function registerService(_0x2af2cd,_0x438740,_0x36aa1a){const _0x444dd1=a36_0x1519;registerDefinitions(_0x438740);const _0x49e36d=_0x2aeba3=>_0x2aeba3==='read'?'':_0x2aeba3===_0x444dd1(0x180)?_0x444dd1(0x195):'\x20\x20[high-risk-write]',_0x39dba3={'service':_0x438740[0x0][_0x444dd1(0x194)],'label':_0x2af2cd,'commands':_0x438740[_0x444dd1(0x17f)](_0x3aa0ba=>({'command':_0x3aa0ba[_0x444dd1(0x183)],'description':_0x3aa0ba[_0x444dd1(0x188)],'tag':_0x49e36d(_0x3aa0ba[_0x444dd1(0x191)])})),'defaultCommand':_0x36aa1a?.[_0x444dd1(0x196)]??(_0x36aa1a?.[_0x444dd1(0x18c)]?_0x438740[0x0][_0x444dd1(0x183)]:undefined),'isSingleCommand':_0x36aa1a?.['isSingleCommand']};serviceRegistry['push'](_0x39dba3),serviceByName[_0x444dd1(0x18b)](_0x39dba3[_0x444dd1(0x194)],_0x39dba3);}registerService(a36_0x5e441f(0x17b),authDefinitions,{'defaultCommand':a36_0x5e441f(0x19e)}),registerService(a36_0x5e441f(0x190),appDefinitions,{'defaultCommand':'list'}),registerService('Workspace',workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService(a36_0x5e441f(0x184),configDefinitions,{'defaultCommand':a36_0x5e441f(0x19b)}),registerService(a36_0x5e441f(0x181),apiDocDefinitions),registerService(a36_0x5e441f(0x197),datasetDefinitions),registerService(a36_0x5e441f(0x1a2),dataDefinitions),registerService('SQL\x20Queries',sqlDefinitions),registerService(a36_0x5e441f(0x199),bffDefinitions),registerService(a36_0x5e441f(0x179),personalBffDefinitions),registerService(a36_0x5e441f(0x17d),artifactDefinitions),registerService(a36_0x5e441f(0x19a),fileDefinitions),registerService(a36_0x5e441f(0x18e),ocrDefinitions),registerService('Knowledge\x20Base',kbDefinitions),registerService(a36_0x5e441f(0x185),scheduleDefinitions,{'defaultCommand':a36_0x5e441f(0x19b)}),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x5e441f(0x19b)}),registerService('Skills',skillDefinitions,{'defaultCommand':a36_0x5e441f(0x19d)}),registerService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x5e441f(0x18d),[updateDefinition],{'defaultCommand':'run','isSingleCommand':!![]}),registerService(a36_0x5e441f(0x182),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x5e441f(0x192),[schemaDefinition],{'isSingleCommand':!![]}),registerService('Logs',logsDefinitions,{'defaultCommand':a36_0x5e441f(0x17e)});export function findDefinition(_0x278ef5,_0x2ded88){return definitions['get'](_0x278ef5+':'+_0x2ded88);}export function isKnownService(_0x376565){const _0x4bacd7=a36_0x5e441f;return serviceByName[_0x4bacd7(0x198)](_0x376565);}export function getServiceEntry(_0x4c35a0){const _0x5bfcd2=a36_0x5e441f;return serviceByName[_0x5bfcd2(0x18a)](_0x4c35a0);}export function getAllDefinitions(){const _0x5c7924=a36_0x5e441f;return Array[_0x5c7924(0x19f)](definitions[_0x5c7924(0x189)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a37_0x2c4a(_0x27b623,_0x4677de){_0x27b623=_0x27b623-0x159;const _0x25984c=a37_0x2598();let _0x2c4a44=_0x25984c[_0x27b623];return _0x2c4a44;}const a37_0x1bcf94=a37_0x2c4a;function a37_0x2598(){const _0x43acd7=['2QeJQJe','validation','3296nPiStH','title','创建周期性或单次执行的\x20Agent\x20定时任务','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','Deleted\x20schedule\x20','377439DWkaaC','ONCE','\x20schedule\x20','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','Preview:\x20run\x20schedule\x20','212124DXTfTy','\x20immediately','45WprOqw','Show\x20one\x20schedule\x20by\x20schedule\x20ID','117480JPCivP','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Page\x20size\x20from\x201\x20to\x20100','body','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','detail','\x20from\x20schedule\x20','Schedule\x20title','Schedule\x20UUID','prompt','235834HrjlMO','taskId','create','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','build','list','cursor','read','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','立即运行一次定时任务并创建\x20Task','scheduled-at','ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','319401HMmOCH','10675VeTqOu','CRON','Created\x20','schedule','30RfbzRP','/schedules','appCode','POST','Preview:\x20delete\x20schedule\x20','validate','kind','isSafeInteger','cron','schedule-id','--prompt\x20must\x20not\x20be\x20blank.','premium','str','number','string','high-risk-write','limit','trim','/run','Schedule\x20input\x20is\x20valid','删除定时任务并停止其后续触发','Preview:\x20create\x20an\x20Agent\x20schedule','UTC','description','num','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','channel','2015934OeRwqJ','scheduleId','671GuXwBF','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','length'];a37_0x2598=function(){return _0x43acd7;};return a37_0x2598();}(function(_0x43fa2e,_0x477bb8){const _0x304726=a37_0x2c4a,_0x3e8bc4=_0x43fa2e();while(!![]){try{const _0x15fccd=parseInt(_0x304726(0x183))/0x1+-parseInt(_0x304726(0x169))/0x2*(-parseInt(_0x304726(0x170))/0x3)+parseInt(_0x304726(0x175))/0x4*(parseInt(_0x304726(0x177))/0x5)+-parseInt(_0x304726(0x164))/0x6+-parseInt(_0x304726(0x190))/0x7*(-parseInt(_0x304726(0x16b))/0x8)+parseInt(_0x304726(0x18f))/0x9*(-parseInt(_0x304726(0x194))/0xa)+parseInt(_0x304726(0x166))/0xb*(-parseInt(_0x304726(0x179))/0xc);if(_0x15fccd===_0x477bb8)break;else _0x3e8bc4['push'](_0x3e8bc4['shift']());}catch(_0x42f57a){_0x3e8bc4['push'](_0x3e8bc4['shift']());}}}(a37_0x2598,0x6863c));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_0x1bcf94(0x19a),'type':a37_0x1bcf94(0x1a2),'required':!![],'enum':[a37_0x1bcf94(0x191),a37_0x1bcf94(0x171)],'description':'Schedule\x20kind:\x20CRON\x20or\x20ONCE'},CRON_FLAG={'name':a37_0x1bcf94(0x19c),'type':a37_0x1bcf94(0x1a2),'description':'Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules'},SCHEDULED_AT_FLAG={'name':a37_0x1bcf94(0x18d),'type':a37_0x1bcf94(0x1a2),'description':'Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules'},TITLE_FLAG={'name':a37_0x1bcf94(0x16c),'type':'string','required':!![],'description':a37_0x1bcf94(0x180)},PROMPT_FLAG={'name':a37_0x1bcf94(0x182),'type':a37_0x1bcf94(0x1a2),'required':!![],'description':a37_0x1bcf94(0x16e)},CHANNEL_FLAG={'name':a37_0x1bcf94(0x163),'type':a37_0x1bcf94(0x1a2),'enum':['auto',a37_0x1bcf94(0x19f)],'default':'premium','description':'Task\x20channel:\x20auto\x20or\x20premium'},SCHEDULE_ID_FLAG={'name':a37_0x1bcf94(0x19d),'type':a37_0x1bcf94(0x1a2),'required':!![],'description':a37_0x1bcf94(0x181),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':'a\x20UUID\x20returned\x20by\x20schedule\x20create/list'}},LIMIT_FLAG={'name':a37_0x1bcf94(0x159),'type':a37_0x1bcf94(0x1a1),'default':0x14,'description':a37_0x1bcf94(0x17b)},CURSOR_FLAG={'name':a37_0x1bcf94(0x189),'type':'string','description':a37_0x1bcf94(0x18b)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x1ec360){const _0x317870=a37_0x1bcf94,_0x4b7501=_0x1ec360['str']('kind'),_0x4b37a1=_0x1ec360[_0x317870(0x1a0)]('title')[_0x317870(0x15a)](),_0x7ecfd4=_0x1ec360['str'](_0x317870(0x182))[_0x317870(0x15a)](),_0x37b547=_0x1ec360['str'](_0x317870(0x163)),_0x1cca6c=_0x1ec360['str'](_0x317870(0x19c)),_0x207ff9=_0x1ec360[_0x317870(0x1a0)](_0x317870(0x18d));if(!_0x4b37a1)throw CliErrors[_0x317870(0x16a)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x7ecfd4)throw CliErrors[_0x317870(0x16a)](_0x317870(0x19e));if(_0x4b7501===_0x317870(0x191)){if(!_0x1cca6c||_0x207ff9)throw CliErrors[_0x317870(0x16a)](_0x317870(0x167));return{'kind':_0x4b7501,'timezone':'UTC','cron':_0x1cca6c,'title':_0x4b37a1,'prompt':_0x7ecfd4,'channel':_0x37b547};}if(_0x4b7501===_0x317870(0x171)){if(!_0x207ff9||_0x1cca6c)throw CliErrors[_0x317870(0x16a)](_0x317870(0x18e));return{'kind':_0x4b7501,'timezone':_0x317870(0x15f),'scheduledAt':_0x207ff9,'title':_0x4b37a1,'prompt':_0x7ecfd4,'channel':_0x37b547};}throw CliErrors[_0x317870(0x16a)](_0x317870(0x186));}function scheduleCollectionPath(_0x35aa19){const _0x23d63c=a37_0x1bcf94;return'/api/harness/apps/'+encodeURIComponent(_0x35aa19)+_0x23d63c(0x195);}function scheduleItemPath(_0x28d57b,_0x43a0f9){return scheduleCollectionPath(_0x28d57b)+'/'+encodeURIComponent(_0x43a0f9);}const scheduleValidate={'service':a37_0x1bcf94(0x193),'command':a37_0x1bcf94(0x199),'description':a37_0x1bcf94(0x162),'risk':a37_0x1bcf94(0x18a),'flags':INPUT_FLAGS,async 'validate'(_0x282747){readScheduleInput(_0x282747);},async 'execute'(_0x3fda32){const _0x1ae924=a37_0x1bcf94,_0xb889da=readScheduleInput(_0x3fda32),_0x1d0592=await validateRuntimeSchedule(_0x3fda32['appCode'],_0xb889da);return{'ok':!![],'data':_0x1d0592,'message':_0x1ae924(0x15c)};}},scheduleCreate={'service':a37_0x1bcf94(0x193),'command':a37_0x1bcf94(0x185),'description':a37_0x1bcf94(0x16d),'risk':a37_0x1bcf94(0x1a3),'confirmationDescription':a37_0x1bcf94(0x173),'flags':INPUT_FLAGS,async 'validate'(_0x59f5d1){readScheduleInput(_0x59f5d1);},async 'execute'(_0x57f3c){const _0x58453a=a37_0x1bcf94,_0x17356e=readScheduleInput(_0x57f3c),_0x4c0910=await validateRuntimeSchedule(_0x57f3c[_0x58453a(0x196)],_0x17356e),_0x2f36db=await createRuntimeSchedule(_0x57f3c[_0x58453a(0x196)],_0x4c0910);return{'ok':!![],'data':_0x2f36db,'message':_0x58453a(0x192)+_0x2f36db[_0x58453a(0x19a)]+_0x58453a(0x172)+_0x2f36db[_0x58453a(0x165)]};},async 'dryRun'(_0x5f185a){const _0x57626a=a37_0x1bcf94,_0x30e929=readScheduleInput(_0x5f185a);return dryRun(_0x57626a(0x197),scheduleCollectionPath(_0x5f185a[_0x57626a(0x196)]))[_0x57626a(0x17c)](_0x30e929)[_0x57626a(0x160)](_0x57626a(0x15e))[_0x57626a(0x187)]();}},scheduleList={'service':'schedule','command':a37_0x1bcf94(0x188),'description':'List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','risk':a37_0x1bcf94(0x18a),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x47c8a7){const _0xf6351a=a37_0x1bcf94,_0x464243=_0x47c8a7['num']('limit');if(!Number[_0xf6351a(0x19b)](_0x464243)||_0x464243<0x1||_0x464243>0x64)throw CliErrors[_0xf6351a(0x16a)](_0xf6351a(0x17d));const _0x300888=_0x47c8a7[_0xf6351a(0x1a0)](_0xf6351a(0x189));if(_0x300888&&(_0x300888[_0xf6351a(0x168)]>0x400||_0x300888[_0xf6351a(0x15a)]()!==_0x300888))throw CliErrors[_0xf6351a(0x16a)](_0xf6351a(0x17a));},async 'execute'(_0x419757){const _0x3c6967=a37_0x1bcf94,_0x4bd508=_0x419757[_0x3c6967(0x1a0)]('cursor'),_0x34eb7d=await listRuntimeSchedules(_0x419757[_0x3c6967(0x196)],{'limit':_0x419757[_0x3c6967(0x161)](_0x3c6967(0x159)),..._0x4bd508?{'cursor':_0x4bd508}:{}});return{'ok':!![],'data':_0x34eb7d};}},scheduleDetail={'service':a37_0x1bcf94(0x193),'command':a37_0x1bcf94(0x17e),'description':a37_0x1bcf94(0x178),'risk':a37_0x1bcf94(0x18a),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1c6920){const _0x44e87e=a37_0x1bcf94,_0x414e21=await getRuntimeSchedule(_0x1c6920[_0x44e87e(0x196)],_0x1c6920[_0x44e87e(0x1a0)](_0x44e87e(0x19d)));return{'ok':!![],'data':_0x414e21};}},scheduleRun={'service':a37_0x1bcf94(0x193),'command':'run','description':a37_0x1bcf94(0x18c),'risk':a37_0x1bcf94(0x1a3),'confirmationDescription':'将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x24b7ee){const _0xe3d4a8=a37_0x1bcf94,_0xc7618=_0x24b7ee['str'](_0xe3d4a8(0x19d)),_0x3b1396=await runRuntimeSchedule(_0x24b7ee[_0xe3d4a8(0x196)],_0xc7618);return{'ok':!![],'data':_0x3b1396,'message':'Queued\x20Task\x20'+_0x3b1396[_0xe3d4a8(0x184)]+_0xe3d4a8(0x17f)+_0xc7618};},async 'dryRun'(_0x3dfbb0){const _0x5154d8=a37_0x1bcf94,_0x2b33ce=_0x3dfbb0[_0x5154d8(0x1a0)]('schedule-id');return dryRun('POST',scheduleItemPath(_0x3dfbb0['appCode'],_0x2b33ce)+_0x5154d8(0x15b))[_0x5154d8(0x160)](_0x5154d8(0x174)+_0x2b33ce+_0x5154d8(0x176))[_0x5154d8(0x187)]();}},scheduleDelete={'service':'schedule','command':'delete','description':a37_0x1bcf94(0x15d),'risk':a37_0x1bcf94(0x1a3),'confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3b5f6c){const _0x17e72b=a37_0x1bcf94,_0x4b15a4=_0x3b5f6c[_0x17e72b(0x1a0)]('schedule-id'),_0x27c3c6=await deleteRuntimeSchedule(_0x3b5f6c[_0x17e72b(0x196)],_0x4b15a4);return{'ok':!![],'data':_0x27c3c6,'message':_0x17e72b(0x16f)+_0x4b15a4};},async 'dryRun'(_0x13ccbe){const _0x4c8db3=a37_0x1bcf94,_0x12490e=_0x13ccbe[_0x4c8db3(0x1a0)](_0x4c8db3(0x19d));return dryRun('DELETE',scheduleItemPath(_0x13ccbe[_0x4c8db3(0x196)],_0x12490e))['description'](_0x4c8db3(0x198)+_0x12490e)[_0x4c8db3(0x187)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
|
1
|
+
function a37_0x3c47(_0x367fc8,_0x512466){_0x367fc8=_0x367fc8-0x125;const _0x8d15f6=a37_0x8d15();let _0x3c4776=_0x8d15f6[_0x367fc8];return _0x3c4776;}const a37_0x5bccce=a37_0x3c47;(function(_0xe13e87,_0x4dd787){const _0x52445a=a37_0x3c47,_0x4c4c7e=_0xe13e87();while(!![]){try{const _0x5c734b=-parseInt(_0x52445a(0x166))/0x1+parseInt(_0x52445a(0x175))/0x2*(parseInt(_0x52445a(0x153))/0x3)+-parseInt(_0x52445a(0x15f))/0x4+-parseInt(_0x52445a(0x13c))/0x5*(-parseInt(_0x52445a(0x135))/0x6)+parseInt(_0x52445a(0x14c))/0x7*(-parseInt(_0x52445a(0x140))/0x8)+parseInt(_0x52445a(0x176))/0x9+parseInt(_0x52445a(0x13f))/0xa;if(_0x5c734b===_0x4dd787)break;else _0x4c4c7e['push'](_0x4c4c7e['shift']());}catch(_0x13265a){_0x4c4c7e['push'](_0x4c4c7e['shift']());}}}(a37_0x8d15,0x58b37));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':'kind','type':a37_0x5bccce(0x167),'required':!![],'enum':[a37_0x5bccce(0x134),a37_0x5bccce(0x16d)],'description':a37_0x5bccce(0x155)},CRON_FLAG={'name':a37_0x5bccce(0x161),'type':a37_0x5bccce(0x167),'description':a37_0x5bccce(0x156)},SCHEDULED_AT_FLAG={'name':a37_0x5bccce(0x132),'type':'string','description':a37_0x5bccce(0x14f)},TITLE_FLAG={'name':a37_0x5bccce(0x13a),'type':'string','required':!![],'description':a37_0x5bccce(0x169)},PROMPT_FLAG={'name':'prompt','type':a37_0x5bccce(0x167),'required':!![],'description':a37_0x5bccce(0x129)},CHANNEL_FLAG={'name':a37_0x5bccce(0x126),'type':'string','enum':[a37_0x5bccce(0x12e),a37_0x5bccce(0x178)],'default':'premium','description':a37_0x5bccce(0x16c)},SCHEDULE_ID_FLAG={'name':a37_0x5bccce(0x159),'type':a37_0x5bccce(0x167),'required':!![],'description':a37_0x5bccce(0x152),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x5bccce(0x164)}},LIMIT_FLAG={'name':a37_0x5bccce(0x14a),'type':a37_0x5bccce(0x13e),'default':0x14,'description':a37_0x5bccce(0x127)},CURSOR_FLAG={'name':'cursor','type':'string','description':a37_0x5bccce(0x16e)},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x4a7200){const _0x5604a0=a37_0x5bccce,_0x245d0e=_0x4a7200[_0x5604a0(0x12f)]('kind'),_0x2b9cfb=_0x4a7200[_0x5604a0(0x12f)](_0x5604a0(0x13a))[_0x5604a0(0x16f)](),_0x398de9=_0x4a7200[_0x5604a0(0x12f)](_0x5604a0(0x158))[_0x5604a0(0x16f)](),_0x436892=_0x4a7200['str'](_0x5604a0(0x126)),_0x3eb510=_0x4a7200[_0x5604a0(0x12f)](_0x5604a0(0x161)),_0x444414=_0x4a7200['str'](_0x5604a0(0x132));if(!_0x2b9cfb)throw CliErrors[_0x5604a0(0x12a)](_0x5604a0(0x147));if(!_0x398de9)throw CliErrors[_0x5604a0(0x12a)](_0x5604a0(0x149));if(_0x245d0e===_0x5604a0(0x134)){if(!_0x3eb510||_0x444414)throw CliErrors[_0x5604a0(0x12a)](_0x5604a0(0x12b));return{'kind':_0x245d0e,'timezone':_0x5604a0(0x15c),'cron':_0x3eb510,'title':_0x2b9cfb,'prompt':_0x398de9,'channel':_0x436892};}if(_0x245d0e===_0x5604a0(0x16d)){if(!_0x444414||_0x3eb510)throw CliErrors[_0x5604a0(0x12a)](_0x5604a0(0x14d));return{'kind':_0x245d0e,'timezone':_0x5604a0(0x15c),'scheduledAt':_0x444414,'title':_0x2b9cfb,'prompt':_0x398de9,'channel':_0x436892};}throw CliErrors[_0x5604a0(0x12a)](_0x5604a0(0x144));}function scheduleCollectionPath(_0x568b57){const _0x20c3f2=a37_0x5bccce;return _0x20c3f2(0x130)+encodeURIComponent(_0x568b57)+_0x20c3f2(0x141);}function scheduleItemPath(_0x5b7273,_0x4035c6){return scheduleCollectionPath(_0x5b7273)+'/'+encodeURIComponent(_0x4035c6);}const scheduleValidate={'service':'schedule','command':a37_0x5bccce(0x163),'description':a37_0x5bccce(0x177),'risk':a37_0x5bccce(0x14b),'flags':INPUT_FLAGS,async 'validate'(_0x199990){readScheduleInput(_0x199990);},async 'execute'(_0x43cf67){const _0x417d7d=a37_0x5bccce,_0x186724=readScheduleInput(_0x43cf67),_0x52f433=await validateRuntimeSchedule(_0x43cf67[_0x417d7d(0x15b)],_0x186724);return{'ok':!![],'data':_0x52f433,'message':_0x417d7d(0x138)};}},scheduleCreate={'service':a37_0x5bccce(0x15d),'command':a37_0x5bccce(0x157),'description':a37_0x5bccce(0x133),'risk':a37_0x5bccce(0x128),'confirmationDescription':a37_0x5bccce(0x173),'flags':INPUT_FLAGS,async 'validate'(_0x47ded1){readScheduleInput(_0x47ded1);},async 'execute'(_0x20c414){const _0xc5389=a37_0x5bccce,_0x22afb3=readScheduleInput(_0x20c414),_0x5c67cd=await validateRuntimeSchedule(_0x20c414[_0xc5389(0x15b)],_0x22afb3),_0x5b6792=await createRuntimeSchedule(_0x20c414[_0xc5389(0x15b)],_0x5c67cd);return{'ok':!![],'data':_0x5b6792,'message':'Created\x20'+_0x5b6792[_0xc5389(0x165)]+_0xc5389(0x137)+_0x5b6792[_0xc5389(0x15a)]};},async 'dryRun'(_0x5f047f){const _0x12bf70=a37_0x5bccce,_0x4ebf5d=readScheduleInput(_0x5f047f);return dryRun(_0x12bf70(0x16b),scheduleCollectionPath(_0x5f047f[_0x12bf70(0x15b)]))[_0x12bf70(0x16a)](_0x4ebf5d)[_0x12bf70(0x13d)]('Preview:\x20create\x20an\x20Agent\x20schedule')[_0x12bf70(0x170)]();}},scheduleList={'service':a37_0x5bccce(0x15d),'command':a37_0x5bccce(0x148),'description':a37_0x5bccce(0x168),'risk':'read','flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x4afdb6){const _0x52bf45=a37_0x5bccce,_0x41a505=_0x4afdb6[_0x52bf45(0x171)](_0x52bf45(0x14a));if(!Number[_0x52bf45(0x17a)](_0x41a505)||_0x41a505<0x1||_0x41a505>0x64)throw CliErrors[_0x52bf45(0x12a)](_0x52bf45(0x160));const _0x5cc6be=_0x4afdb6[_0x52bf45(0x12f)](_0x52bf45(0x15e));if(_0x5cc6be&&(_0x5cc6be[_0x52bf45(0x125)]>0x400||_0x5cc6be['trim']()!==_0x5cc6be))throw CliErrors[_0x52bf45(0x12a)](_0x52bf45(0x154));},async 'execute'(_0x26016e){const _0xcf2eb9=a37_0x5bccce,_0x5767e5=_0x26016e[_0xcf2eb9(0x12f)](_0xcf2eb9(0x15e)),_0x50b855=await listRuntimeSchedules(_0x26016e[_0xcf2eb9(0x15b)],{'limit':_0x26016e[_0xcf2eb9(0x171)](_0xcf2eb9(0x14a)),..._0x5767e5?{'cursor':_0x5767e5}:{}});return{'ok':!![],'data':_0x50b855};}},scheduleDetail={'service':'schedule','command':a37_0x5bccce(0x136),'description':a37_0x5bccce(0x14e),'risk':a37_0x5bccce(0x14b),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x2c0b26){const _0x222ac2=a37_0x5bccce,_0x1c719f=await getRuntimeSchedule(_0x2c0b26[_0x222ac2(0x15b)],_0x2c0b26[_0x222ac2(0x12f)]('schedule-id'));return{'ok':!![],'data':_0x1c719f};}},scheduleRun={'service':'schedule','command':a37_0x5bccce(0x139),'description':a37_0x5bccce(0x142),'risk':'high-risk-write','confirmationDescription':a37_0x5bccce(0x150),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x26d00e){const _0x17d8b1=a37_0x5bccce,_0x329fb6=_0x26d00e[_0x17d8b1(0x12f)](_0x17d8b1(0x159)),_0x53c7ad=await runRuntimeSchedule(_0x26d00e[_0x17d8b1(0x15b)],_0x329fb6);return{'ok':!![],'data':_0x53c7ad,'message':_0x17d8b1(0x12d)+_0x53c7ad[_0x17d8b1(0x174)]+_0x17d8b1(0x172)+_0x329fb6};},async 'dryRun'(_0x4c74b8){const _0x3b167e=a37_0x5bccce,_0x1aecd7=_0x4c74b8[_0x3b167e(0x12f)](_0x3b167e(0x159));return dryRun(_0x3b167e(0x16b),scheduleItemPath(_0x4c74b8[_0x3b167e(0x15b)],_0x1aecd7)+_0x3b167e(0x162))[_0x3b167e(0x13d)](_0x3b167e(0x143)+_0x1aecd7+_0x3b167e(0x151))[_0x3b167e(0x170)]();}},scheduleDelete={'service':a37_0x5bccce(0x15d),'command':a37_0x5bccce(0x12c),'description':a37_0x5bccce(0x131),'risk':a37_0x5bccce(0x128),'confirmationDescription':a37_0x5bccce(0x145),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3aa5d4){const _0x652b77=a37_0x5bccce,_0x29eff4=_0x3aa5d4[_0x652b77(0x12f)](_0x652b77(0x159)),_0x572ef6=await deleteRuntimeSchedule(_0x3aa5d4[_0x652b77(0x15b)],_0x29eff4);return{'ok':!![],'data':_0x572ef6,'message':_0x652b77(0x13b)+_0x29eff4};},async 'dryRun'(_0x3c4397){const _0x406a37=a37_0x5bccce,_0x544fe2=_0x3c4397[_0x406a37(0x12f)]('schedule-id');return dryRun(_0x406a37(0x146),scheduleItemPath(_0x3c4397[_0x406a37(0x15b)],_0x544fe2))[_0x406a37(0x13d)](_0x406a37(0x179)+_0x544fe2)[_0x406a37(0x170)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];function a37_0x8d15(){const _0x4f5b70=['ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','Show\x20one\x20schedule\x20by\x20schedule\x20ID','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','\x20immediately','Schedule\x20UUID','1407492FlDoWl','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','Schedule\x20kind:\x20CRON\x20or\x20ONCE','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','create','prompt','schedule-id','scheduleId','appCode','UTC','schedule','cursor','707508vEWhLX','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','cron','/run','validate','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','kind','672579WIYqwM','string','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','Schedule\x20title','body','POST','Task\x20channel:\x20auto\x20or\x20premium','ONCE','Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call','trim','build','num','\x20from\x20schedule\x20','将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','taskId','2nosWnI','1708992eYfxHD','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','premium','Preview:\x20delete\x20schedule\x20','isSafeInteger','length','channel','Page\x20size\x20from\x201\x20to\x20100','high-risk-write','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','validation','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','delete','Queued\x20Task\x20','auto','str','/api/harness/apps/','删除定时任务并停止其后续触发','scheduled-at','创建周期性或单次执行的\x20Agent\x20定时任务','CRON','1741494WQZTrg','detail','\x20schedule\x20','Schedule\x20input\x20is\x20valid','run','title','Deleted\x20schedule\x20','5wdsoMi','description','number','3155160rSlIfL','208168bSpVEi','/schedules','立即运行一次定时任务并创建\x20Task','Preview:\x20run\x20schedule\x20','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.','将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','DELETE','--title\x20must\x20not\x20be\x20blank.','list','--prompt\x20must\x20not\x20be\x20blank.','limit','read','14Hzaoid'];a37_0x8d15=function(){return _0x4f5b70;};return a37_0x8d15();}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a38_0xcf62(){const _0x438d65=['46131800kHcSDu','3476hjVxDd','2674MyOGlY','10537758cLvxIj','2346276dzqyqY','export','6768pXXBpT','381wccWfp','15cbaGJk','4511448RjlEAl','164039CTDmLZ','Export\x20machine-readable\x20command\x20schema\x20(JSON)'];a38_0xcf62=function(){return _0x438d65;};return a38_0xcf62();}function a38_0x1706(_0x5e84ef,_0x2a6eaf){_0x5e84ef=_0x5e84ef-0xe7;const _0xcf6249=a38_0xcf62();let _0x170603=_0xcf6249[_0x5e84ef];return _0x170603;}const a38_0x54e34f=a38_0x1706;(function(_0x41b9bf,_0x3b4376){const _0x3eb184=a38_0x1706,_0x3e650a=_0x41b9bf();while(!![]){try{const _0x571a08=-parseInt(_0x3eb184(0xeb))/0x1+-parseInt(_0x3eb184(0xee))/0x2*(-parseInt(_0x3eb184(0xe8))/0x3)+parseInt(_0x3eb184(0xf1))/0x4*(-parseInt(_0x3eb184(0xe9))/0x5)+-parseInt(_0x3eb184(0xf0))/0x6+-parseInt(_0x3eb184(0xef))/0x7*(-parseInt(_0x3eb184(0xe7))/0x8)+-parseInt(_0x3eb184(0xea))/0x9+parseInt(_0x3eb184(0xed))/0xa;if(_0x571a08===_0x3b4376)break;else _0x3e650a['push'](_0x3e650a['shift']());}catch(_0x500b3a){_0x3e650a['push'](_0x3e650a['shift']());}}}(a38_0xcf62,0xee397));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x520b9f){const _0x4f9fcc=await buildSchemaPayload();return{'ok':!![],'data':_0x4f9fcc};}export const schemaDefinition={'service':'schema','command':a38_0x54e34f(0xf2),'description':a38_0x54e34f(0xec),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|