@lovrabet/lovrabet-cli 2.1.23-beta.4 → 2.1.23
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.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.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_0x32c796=a28_0x615b;(function(_0x46db2c,_0x58581e){const _0x53db9c=a28_0x615b,_0x522f6b=_0x46db2c();while(!![]){try{const _0x318ec0=parseInt(_0x53db9c(0x19a))/0x1+parseInt(_0x53db9c(0x197))/0x2+parseInt(_0x53db9c(0x198))/0x3*(-parseInt(_0x53db9c(0x194))/0x4)+parseInt(_0x53db9c(0x1a2))/0x5+-parseInt(_0x53db9c(0x1a6))/0x6*(parseInt(_0x53db9c(0x1a4))/0x7)+-parseInt(_0x53db9c(0x1a0))/0x8*(-parseInt(_0x53db9c(0x196))/0x9)+parseInt(_0x53db9c(0x19c))/0xa*(-parseInt(_0x53db9c(0x19d))/0xb);if(_0x318ec0===_0x58581e)break;else _0x522f6b['push'](_0x522f6b['shift']());}catch(_0x366b2f){_0x522f6b['push'](_0x522f6b['shift']());}}}(a28_0xfb85,0xadbad));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';function a28_0x615b(_0x4ac60a,_0x15f5fb){_0x4ac60a=_0x4ac60a-0x194;const _0xfb850f=a28_0xfb85();let _0x615bc6=_0xfb850f[_0x4ac60a];return _0x615bc6;}const DEFAULT_MARKDOWN=a28_0x32c796(0x195);export function formatDatasetSdkMarkdown(_0x4b99be){const _0x21c42a=a28_0x32c796,_0x4d98f0=typeof _0x4b99be===_0x21c42a(0x1a3)?_0x4b99be[_0x21c42a(0x1a1)]():'';return _0x4d98f0||DEFAULT_MARKDOWN;}function a28_0xfb85(){const _0x3436e5=['#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','243pDNxZt','2210532hobgPZ','430347SxxCQM','str','741635GbFcFC','code','10nfpAAT','19487413vrWfBG','Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','dataset','111688tLntSh','trim','6477500lUrHnD','string','2083011Rbpjta','appCode','18UgoQwM','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','4IDKqlO'];a28_0xfb85=function(){return _0x3436e5;};return a28_0xfb85();}export const datasetSdkDoc={'service':a28_0x32c796(0x19f),'command':'sdk-doc','description':a28_0x32c796(0x19e),'risk':'read','flags':[{...CODE_FLAG,'description':a28_0x32c796(0x1a7)}],async 'execute'(_0x19be9b){const _0x4ccdc0=a28_0x32c796,_0x5240b0=_0x19be9b[_0x4ccdc0(0x199)](_0x4ccdc0(0x19b)),_0x241bb1=await getDatasetSdkUsageDoc(_0x5240b0,_0x19be9b[_0x4ccdc0(0x1a5)]);return{'ok':!![],'data':{'code':_0x5240b0,'appCode':_0x19be9b[_0x4ccdc0(0x1a5)],'markdown':formatDatasetSdkMarkdown(_0x241bb1)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a29_0x1ec8(){const _0x566d10=['format','currentApp','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','534104xsYSse','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','message','\x20doctor','36ASEMuE','locale','(no\x20file)','green','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','length','log','appCode','env','7kbBrpZ','\x20\x20─','\x20(accessKey)','2791344BTFbHq','red','(default)','\x20\x20Service\x20Tree','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20auth\x20(effective):\x20','(not\x20found)','path','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','repeat','\x20\x20Auth','services','\x20\x20Merged\x20Config','arch','yellow','\x20\x20runtimeDomain:\x20\x20\x20','5SFBPHg','29066dOWwvq','Global','(missing)','(set,\x20length=','866104GmvpxO','(default:\x20','read','commandCount','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','✓\x20Valid\x20JSON','empty','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','3990811KjTvAQ','source','2dpVVhz','Project','✓\x20Loaded','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','status','gray','\x20\x20Config\x20JSON','⚠\x20Empty\x20(treated\x20as\x20{})','Diagnose\x20CLI\x20configuration\x20and\x20environment','\x20\x20API\x20Endpoints','⚠\x20Empty','riskLevel','\x20\x20Config\x20Files','registryPath','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','doctor','\x20Imported\x20from:\x20','10XyVVZI','pageSize','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','bold','version','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','platform','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','verbose','79494Lxnwxn','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','missing','(removed\x20—\x20cookie\x20auth\x20disabled)','743844PivILa','ClientAk','(none)','padEnd'];a29_0x1ec8=function(){return _0x566d10;};return a29_0x1ec8();}const a29_0x289b7e=a29_0x17df;(function(_0x3447e1,_0xb48ec){const _0x373578=a29_0x17df,_0x14e822=_0x3447e1();while(!![]){try{const _0x2a4ac0=parseInt(_0x373578(0x1a8))/0x1*(parseInt(_0x373578(0x1b6))/0x2)+parseInt(_0x373578(0x1db))/0x3+parseInt(_0x373578(0x1e2))/0x4*(parseInt(_0x373578(0x1a7))/0x5)+-parseInt(_0x373578(0x1d3))/0x6*(-parseInt(_0x373578(0x193))/0x7)+parseInt(_0x373578(0x1ac))/0x8*(parseInt(_0x373578(0x18a))/0x9)+parseInt(_0x373578(0x1c9))/0xa*(-parseInt(_0x373578(0x1b4))/0xb)+-parseInt(_0x373578(0x196))/0xc;if(_0x2a4ac0===_0xb48ec)break;else _0x14e822['push'](_0x14e822['shift']());}catch(_0x526409){_0x14e822['push'](_0x14e822['shift']());}}}(a29_0x1ec8,0x3fd34));import a29_0x43935f from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';function a29_0x17df(_0x5c8d77,_0x1c8704){_0x5c8d77=_0x5c8d77-0x187;const _0x1ec870=a29_0x1ec8();let _0x17df03=_0x1ec870[_0x5c8d77];return _0x17df03;}import{inspectServiceRegistry}from'../commands/service/registry.js';async function execute(_0x33c6ad){const _0x494d29=a29_0x17df,_0x7a9058=getCliVersion(),_0x5e5672=buildConfigFromFlags({});await initGlobalEnvironment(_0x5e5672),console[_0x494d29(0x190)](),console['log'](a29_0x43935f[_0x494d29(0x1cc)](CLI_BIN_NAME+_0x494d29(0x189))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)]('─'[_0x494d29(0x1a0)](0x32))),console['log'](_0x494d29(0x1cf)+_0x7a9058),console[_0x494d29(0x190)](_0x494d29(0x1d7)+process[_0x494d29(0x1cd)]),console['log'](_0x494d29(0x187)+process[_0x494d29(0x1d0)]+'\x20'+process[_0x494d29(0x1a4)]),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1c2))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x3ea0aa=getGlobalConfigPath(),_0x1512f6=getProjectConfigPath();console[_0x494d29(0x190)](_0x494d29(0x19a)+(_0x3ea0aa||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x19d)))),console[_0x494d29(0x190)](_0x494d29(0x1b0)+(_0x1512f6||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x19d)))),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1bc))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x23ed47=(_0x4e9c89,_0xccbb85)=>{const _0x446c92=_0x494d29;if(!_0xccbb85){console['log']('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1bb)](_0x446c92(0x18c)));return;}const _0x2f1dd3=inspectCliConfigJsonFile(_0xccbb85);if(_0x2f1dd3['status']==='ok')console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x18d)](_0x446c92(0x1b1)));else{if(_0x2f1dd3['status']===_0x446c92(0x1b2))console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1a5)](_0x446c92(0x1bd)));else _0x2f1dd3[_0x446c92(0x1ba)]==='missing'?console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f[_0x446c92(0x1bb)](_0x446c92(0x1aa))):(console[_0x446c92(0x190)]('\x20\x20'+_0x4e9c89[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f['red'](_0x446c92(0x1e4))),console['log']('\x20\x20'+''[_0x446c92(0x1de)](0x11)+'\x20'+a29_0x43935f['red'](_0x2f1dd3[_0x446c92(0x188)])));}};_0x23ed47(_0x494d29(0x1a9),_0x3ea0aa),_0x23ed47(_0x494d29(0x1b7),_0x1512f6),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1a3))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)['repeat'](0x1e))),console[_0x494d29(0x190)]('\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x5e5672[_0x494d29(0x191)]||a29_0x43935f['red']('(not\x20set)'))),console['log'](_0x494d29(0x1b9)+_0x5e5672[_0x494d29(0x192)]);const _0x1d5545=isLegacyCompatConfigKey(_0x494d29(0x18b))?a29_0x43935f[_0x494d29(0x1bb)](_0x5e5672[_0x494d29(0x18b)]+'\x20(legacy/compat\x20only)'):_0x5e5672[_0x494d29(0x18b)];console[_0x494d29(0x190)](_0x494d29(0x1e3)+_0x1d5545),console[_0x494d29(0x190)](_0x494d29(0x1c5)+(_0x5e5672['defaultApp']||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console[_0x494d29(0x190)](_0x494d29(0x1d5)+(_0x5e5672[_0x494d29(0x1e0)]||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console['log'](_0x494d29(0x19f)+(_0x5e5672[_0x494d29(0x1df)]||a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1ad)+DEFAULT_CONFIG_VALUES[_0x494d29(0x1df)]+')'))),console[_0x494d29(0x190)](_0x494d29(0x1d1)+(_0x5e5672[_0x494d29(0x1ca)]??a29_0x43935f['gray'](_0x494d29(0x198)))),console[_0x494d29(0x190)](_0x494d29(0x1ce)+_0x5e5672[_0x494d29(0x1c1)]),console[_0x494d29(0x190)](_0x494d29(0x18e)+_0x5e5672[_0x494d29(0x1d2)]),console[_0x494d29(0x190)](_0x494d29(0x19c)+AUTH_MODE[_0x494d29(0x1dc)]),console[_0x494d29(0x190)](_0x494d29(0x1d6)+(_0x5e5672['accessKey']?a29_0x43935f[_0x494d29(0x18d)](_0x494d29(0x1ab)+_0x5e5672['accessKey'][_0x494d29(0x18f)]+')'):a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1dd)))),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1bf))),console[_0x494d29(0x190)](a29_0x43935f['gray'](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e))),console[_0x494d29(0x190)](_0x494d29(0x1b3)+getApiDomain()),console[_0x494d29(0x190)]('\x20\x20userDomain:\x20\x20\x20\x20\x20\x20'+getUserDomain()),console['log'](_0x494d29(0x1a6)+getRuntimeDomain()),console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x199))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e)));const _0x5dd13d=inspectServiceRegistry();console[_0x494d29(0x190)](_0x494d29(0x1cb)+_0x5dd13d[_0x494d29(0x1c3)]),console[_0x494d29(0x190)](_0x494d29(0x1e1)+formatServiceRegistryStatus(_0x5dd13d)),console['log'](_0x494d29(0x1c4)+_0x5dd13d['serviceCount']),console[_0x494d29(0x190)](_0x494d29(0x19b)+_0x5dd13d[_0x494d29(0x1af)]);for(const _0x2e6e3d of _0x5dd13d[_0x494d29(0x1a2)]){console[_0x494d29(0x190)]('\x20\x20'+(_0x2e6e3d['serviceCode']+':')[_0x494d29(0x1de)](0x11)+'\x20'+(_0x2e6e3d['name']||a29_0x43935f['gray']('(unnamed)'))+'\x20('+_0x2e6e3d[_0x494d29(0x1af)]+'\x20commands)'),console['log']('\x20\x20'+''['padEnd'](0x11)+_0x494d29(0x1c8)+_0x2e6e3d[_0x494d29(0x1b5)][_0x494d29(0x19e)]);}return console[_0x494d29(0x190)](),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1cc)](_0x494d29(0x1a1))),console[_0x494d29(0x190)](a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x194)[_0x494d29(0x1a0)](0x1e))),console['log'](_0x494d29(0x1c6)+a29_0x43935f[_0x494d29(0x18d)](AUTH_MODE[_0x494d29(0x1dc)]+_0x494d29(0x195))),console[_0x494d29(0x190)](_0x494d29(0x1d4)+a29_0x43935f[_0x494d29(0x1bb)](_0x494d29(0x1da))),console[_0x494d29(0x190)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x9c8d1){const _0x71f4f7=a29_0x17df;if(_0x9c8d1['status']==='ok')return a29_0x43935f[_0x71f4f7(0x18d)](_0x71f4f7(0x1b8));if(_0x9c8d1['status']===_0x71f4f7(0x1d9))return a29_0x43935f[_0x71f4f7(0x1bb)](_0x71f4f7(0x19d));if(_0x9c8d1['status']===_0x71f4f7(0x1b2))return a29_0x43935f[_0x71f4f7(0x1a5)](_0x71f4f7(0x1c0));return a29_0x43935f[_0x71f4f7(0x197)](_0x71f4f7(0x1d8)+(_0x9c8d1[_0x71f4f7(0x188)]?':\x20'+_0x9c8d1['message']:''));}export const doctorDefinition={'service':a29_0x289b7e(0x1c7),'command':'check','description':a29_0x289b7e(0x1be),'risk':a29_0x289b7e(0x1ae),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
1
|
+
const a29_0x283b7f=a29_0x2cc0;(function(_0x3f854d,_0x5a8e78){const _0x55bedd=a29_0x2cc0,_0x3a260c=_0x3f854d();while(!![]){try{const _0x2ce596=-parseInt(_0x55bedd(0xad))/0x1+-parseInt(_0x55bedd(0x9f))/0x2*(-parseInt(_0x55bedd(0xcb))/0x3)+-parseInt(_0x55bedd(0x8a))/0x4*(parseInt(_0x55bedd(0xac))/0x5)+-parseInt(_0x55bedd(0xc1))/0x6*(parseInt(_0x55bedd(0xb1))/0x7)+parseInt(_0x55bedd(0x95))/0x8+-parseInt(_0x55bedd(0xbd))/0x9+parseInt(_0x55bedd(0xbb))/0xa;if(_0x2ce596===_0x5a8e78)break;else _0x3a260c['push'](_0x3a260c['shift']());}catch(_0x3ba3e4){_0x3a260c['push'](_0x3a260c['shift']());}}}(a29_0x4a06,0x63004));function a29_0x4a06(){const _0x36848d=['6HlkzIc','bold','services','source','\x20Imported\x20from:\x20','riskLevel','\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','✗\x20Invalid','(set,\x20length=','gray','3atyEPU','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','name','(none)','Global','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','arch','empty','(default:\x20','format','(missing)','⚠\x20Empty\x20(treated\x20as\x20{})','\x20commands)','path','ClientAk','read','message','✗\x20Invalid\x20JSON','commandCount','1808OniOVs','\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20','(no\x20file)','defaultApp','\x20\x20Service\x20Tree','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','red','locale','repeat','\x20\x20Auth','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','548792ksrQQd','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','currentApp','\x20doctor','platform','\x20\x20Config\x20Files','✓\x20Valid\x20JSON','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','(default)','18454OyfFkg','accessKey','yellow','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','(not\x20found)','registryPath','\x20\x20─','✓\x20Loaded','env','missing','\x20(accessKey)','\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20','(not\x20set)','2230vTGAYW','705769mZAsEy','verbose','status','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','3600485afvkGi','Diagnose\x20CLI\x20configuration\x20and\x20environment','log','\x20\x20Merged\x20Config','version','(removed\x20—\x20cookie\x20auth\x20disabled)','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','padEnd','green','serviceCount','19656960ggjtMM','appCode','1946682alnywf','\x20\x20currentApp:\x20\x20\x20\x20\x20\x20','\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x4a06=function(){return _0x36848d;};return a29_0x4a06();}import a29_0x4d2769 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';function a29_0x2cc0(_0x8d354d,_0x1984f1){_0x8d354d=_0x8d354d-0x7d;const _0x4a0619=a29_0x4a06();let _0x2cc036=_0x4a0619[_0x8d354d];return _0x2cc036;}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(_0x24b76c){const _0x26eb4d=a29_0x2cc0,_0x566725=getCliVersion(),_0x1452da=buildConfigFromFlags({});await initGlobalEnvironment(_0x1452da),console[_0x26eb4d(0xb3)](),console['log'](a29_0x4d2769[_0x26eb4d(0xc2)](CLI_BIN_NAME+_0x26eb4d(0x98))),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xca)]('─'[_0x26eb4d(0x92)](0x32))),console[_0x26eb4d(0xb3)]('\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20'+_0x566725),console['log'](_0x26eb4d(0x94)+process[_0x26eb4d(0xb5)]),console[_0x26eb4d(0xb3)](_0x26eb4d(0x9c)+process[_0x26eb4d(0x99)]+'\x20'+process[_0x26eb4d(0x7d)]),console[_0x26eb4d(0xb3)](),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xc2)](_0x26eb4d(0x9a))),console['log'](a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xa5)[_0x26eb4d(0x92)](0x1e)));const _0x596d4f=getGlobalConfigPath(),_0x35ef2a=getProjectConfigPath();console[_0x26eb4d(0xb3)](_0x26eb4d(0xc0)+(_0x596d4f||a29_0x4d2769[_0x26eb4d(0xca)]('(not\x20found)'))),console[_0x26eb4d(0xb3)]('\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x35ef2a||a29_0x4d2769['gray'](_0x26eb4d(0xa3)))),console[_0x26eb4d(0xb3)](),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xc2)]('\x20\x20Config\x20JSON')),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xa5)[_0x26eb4d(0x92)](0x1e)));const _0x5521ff=(_0x7582ac,_0x5e14b9)=>{const _0x7dd5a9=_0x26eb4d;if(!_0x5e14b9){console[_0x7dd5a9(0xb3)]('\x20\x20'+_0x7582ac[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769['gray'](_0x7dd5a9(0x8c)));return;}const _0x56f79c=inspectCliConfigJsonFile(_0x5e14b9);if(_0x56f79c['status']==='ok')console[_0x7dd5a9(0xb3)]('\x20\x20'+_0x7582ac[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769[_0x7dd5a9(0xb9)](_0x7dd5a9(0x9b)));else{if(_0x56f79c['status']===_0x7dd5a9(0x7e))console[_0x7dd5a9(0xb3)]('\x20\x20'+_0x7582ac[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769[_0x7dd5a9(0xa1)](_0x7dd5a9(0x82)));else _0x56f79c[_0x7dd5a9(0xaf)]===_0x7dd5a9(0xa8)?console[_0x7dd5a9(0xb3)]('\x20\x20'+_0x7582ac[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769['gray'](_0x7dd5a9(0x81))):(console[_0x7dd5a9(0xb3)]('\x20\x20'+_0x7582ac[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769[_0x7dd5a9(0x90)](_0x7dd5a9(0x88))),console[_0x7dd5a9(0xb3)]('\x20\x20'+''[_0x7dd5a9(0xb8)](0x11)+'\x20'+a29_0x4d2769['red'](_0x56f79c[_0x7dd5a9(0x87)])));}};_0x5521ff(_0x26eb4d(0xcf),_0x596d4f),_0x5521ff('Project',_0x35ef2a),console[_0x26eb4d(0xb3)](),console['log'](a29_0x4d2769[_0x26eb4d(0xc2)](_0x26eb4d(0xb4))),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xca)]('\x20\x20─'[_0x26eb4d(0x92)](0x1e))),console[_0x26eb4d(0xb3)](_0x26eb4d(0x8f)+(_0x1452da[_0x26eb4d(0xbc)]||a29_0x4d2769[_0x26eb4d(0x90)](_0x26eb4d(0xab)))),console[_0x26eb4d(0xb3)](_0x26eb4d(0xc7)+_0x1452da[_0x26eb4d(0xa7)]);const _0x568c6c=isLegacyCompatConfigKey(_0x26eb4d(0x91))?a29_0x4d2769[_0x26eb4d(0xca)](_0x1452da[_0x26eb4d(0x91)]+'\x20(legacy/compat\x20only)'):_0x1452da['locale'];console[_0x26eb4d(0xb3)](_0x26eb4d(0x9d)+_0x568c6c),console[_0x26eb4d(0xb3)](_0x26eb4d(0x96)+(_0x1452da[_0x26eb4d(0x8d)]||a29_0x4d2769['gray'](_0x26eb4d(0xce)))),console[_0x26eb4d(0xb3)](_0x26eb4d(0xbe)+(_0x1452da[_0x26eb4d(0x97)]||a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xce)))),console[_0x26eb4d(0xb3)](_0x26eb4d(0xbf)+(_0x1452da[_0x26eb4d(0x80)]||a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0x7f)+DEFAULT_CONFIG_VALUES[_0x26eb4d(0x80)]+')'))),console[_0x26eb4d(0xb3)]('\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x1452da['pageSize']??a29_0x4d2769['gray'](_0x26eb4d(0x9e)))),console[_0x26eb4d(0xb3)](_0x26eb4d(0xaa)+_0x1452da[_0x26eb4d(0xc6)]),console['log'](_0x26eb4d(0xa2)+_0x1452da[_0x26eb4d(0xae)]),console[_0x26eb4d(0xb3)]('\x20\x20auth\x20(effective):\x20'+AUTH_MODE[_0x26eb4d(0x85)]),console[_0x26eb4d(0xb3)](_0x26eb4d(0xd0)+(_0x1452da[_0x26eb4d(0xa0)]?a29_0x4d2769['green'](_0x26eb4d(0xc9)+_0x1452da[_0x26eb4d(0xa0)]['length']+')'):a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xce)))),console[_0x26eb4d(0xb3)](),console[_0x26eb4d(0xb3)](a29_0x4d2769['bold']('\x20\x20API\x20Endpoints')),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xa5)['repeat'](0x1e))),console[_0x26eb4d(0xb3)](_0x26eb4d(0x8b)+getApiDomain()),console[_0x26eb4d(0xb3)](_0x26eb4d(0xb0)+getUserDomain()),console['log']('\x20\x20runtimeDomain:\x20\x20\x20'+getRuntimeDomain()),console[_0x26eb4d(0xb3)](),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xc2)](_0x26eb4d(0x8e))),console[_0x26eb4d(0xb3)](a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xa5)[_0x26eb4d(0x92)](0x1e)));const _0x38c7d2=inspectServiceRegistry();console[_0x26eb4d(0xb3)](_0x26eb4d(0xcc)+_0x38c7d2[_0x26eb4d(0xa4)]),console[_0x26eb4d(0xb3)]('\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+formatServiceRegistryStatus(_0x38c7d2)),console[_0x26eb4d(0xb3)](_0x26eb4d(0xb7)+_0x38c7d2[_0x26eb4d(0xba)]),console['log']('\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20'+_0x38c7d2['commandCount']);for(const _0x544130 of _0x38c7d2[_0x26eb4d(0xc3)]){console[_0x26eb4d(0xb3)]('\x20\x20'+(_0x544130['serviceCode']+':')['padEnd'](0x11)+'\x20'+(_0x544130[_0x26eb4d(0xcd)]||a29_0x4d2769['gray']('(unnamed)'))+'\x20('+_0x544130[_0x26eb4d(0x89)]+_0x26eb4d(0x83)),console[_0x26eb4d(0xb3)]('\x20\x20'+''['padEnd'](0x11)+_0x26eb4d(0xc5)+_0x544130[_0x26eb4d(0xc4)][_0x26eb4d(0x84)]);}return console[_0x26eb4d(0xb3)](),console[_0x26eb4d(0xb3)](a29_0x4d2769['bold'](_0x26eb4d(0x93))),console['log'](a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xa5)[_0x26eb4d(0x92)](0x1e))),console[_0x26eb4d(0xb3)]('\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+a29_0x4d2769['green'](AUTH_MODE[_0x26eb4d(0x85)]+_0x26eb4d(0xa9))),console['log']('\x20\x20Session\x20check:\x20\x20\x20'+a29_0x4d2769[_0x26eb4d(0xca)](_0x26eb4d(0xb6))),console[_0x26eb4d(0xb3)](),{'ok':!![]};}function formatServiceRegistryStatus(_0x3af2a3){const _0x7f9429=a29_0x2cc0;if(_0x3af2a3['status']==='ok')return a29_0x4d2769[_0x7f9429(0xb9)](_0x7f9429(0xa6));if(_0x3af2a3[_0x7f9429(0xaf)]==='missing')return a29_0x4d2769[_0x7f9429(0xca)]('(not\x20found)');if(_0x3af2a3[_0x7f9429(0xaf)]===_0x7f9429(0x7e))return a29_0x4d2769[_0x7f9429(0xa1)]('⚠\x20Empty');return a29_0x4d2769[_0x7f9429(0x90)](_0x7f9429(0xc8)+(_0x3af2a3['message']?':\x20'+_0x3af2a3['message']:''));}export const doctorDefinition={'service':'doctor','command':'check','description':a29_0x283b7f(0xb2),'risk':a29_0x283b7f(0x86),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x433887=a30_0xf679;function a30_0xf679(_0x312b81,_0x450a28){_0x312b81=_0x312b81-0x1f1;const _0x44a974=a30_0x44a9();let _0xf6793a=_0x44a974[_0x312b81];return _0xf6793a;}(function(_0x236c06,_0x57ce9b){const _0x6417a1=a30_0xf679,_0x1533fa=_0x236c06();while(!![]){try{const _0x867a11=parseInt(_0x6417a1(0x209))/0x1*(-parseInt(_0x6417a1(0x204))/0x2)+parseInt(_0x6417a1(0x1fe))/0x3*(parseInt(_0x6417a1(0x20d))/0x4)+-parseInt(_0x6417a1(0x20b))/0x5*(parseInt(_0x6417a1(0x1f4))/0x6)+-parseInt(_0x6417a1(0x214))/0x7*(parseInt(_0x6417a1(0x1fc))/0x8)+-parseInt(_0x6417a1(0x211))/0x9*(-parseInt(_0x6417a1(0x1fa))/0xa)+parseInt(_0x6417a1(0x202))/0xb+parseInt(_0x6417a1(0x212))/0xc*(-parseInt(_0x6417a1(0x20a))/0xd);if(_0x867a11===_0x57ce9b)break;else _0x1533fa['push'](_0x1533fa['shift']());}catch(_0x18905d){_0x1533fa['push'](_0x1533fa['shift']());}}}(a30_0x44a9,0x8f525));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const FILE_FLAG={'name':a30_0x433887(0x216),'type':a30_0x433887(0x1fd),'required':!![],'description':a30_0x433887(0x1f6)},FILEPATH_FLAG={'name':a30_0x433887(0x1f8),'type':'string','required':!![],'description':a30_0x433887(0x213)},DOWNLOAD_FLAG={'name':a30_0x433887(0x203),'type':'boolean','description':'Return\x20a\x20short-lived\x20download\x20URL\x20instead\x20of\x20a\x20short-lived\x20preview\x20URL'},LONG_TERM_FLAG={'name':a30_0x433887(0x201),'type':a30_0x433887(0x208),'description':a30_0x433887(0x1f1)};function a30_0x44a9(){const _0x108e0b=['90lmeynP','str','20FliQUd','Upload\x20a\x20local\x20file\x20and\x20return\x20filePath\x20for\x20durable\x20references','bool','trim','153SogSqO','5166924MYRpVV','Runtime\x20filePath\x20returned\x20by\x20file\x20upload;\x20store\x20it\x20in\x20file\x20fields\x20and\x20durable\x20data','12376BOghzk','upload','file','Return\x20a\x203-year\x20URL\x20for\x20URL-only\x20content\x20embedding\x20such\x20as\x20rich\x20text,\x20Markdown,\x20or\x20HTML','filePath','Uploaded\x20file:\x20','29718oBESHg','appCode','Path\x20to\x20the\x20local\x20file\x20to\x20upload','File','filepath','build','298620erfiaq','/client/uploadFile','816eozbaM','string','355533PejBXe','filePath\x20is\x20required.','path','long-term','4383478fnpXkz','download','84638UQjWRJ','read','Query\x20a\x20short-lived\x20URL\x20for\x20preview,\x20download,\x20OCR,\x20or\x20immediate\x20access','description','boolean','5tyUpej','13PpKvwl'];a30_0x44a9=function(){return _0x108e0b;};return a30_0x44a9();}function requireFilePath(_0x19a6fc){const _0x4eda4a=a30_0x433887,_0x237cdf=_0x19a6fc[_0x4eda4a(0x210)]();if(!_0x237cdf)throw CliErrors['validation'](_0x4eda4a(0x1ff));return _0x237cdf;}const fileUpload={'service':'file','command':a30_0x433887(0x215),'description':a30_0x433887(0x20e),'risk':a30_0x433887(0x205),'flags':[FILE_FLAG],async 'dryRun'(_0x28d122){const _0x36ec0d=a30_0x433887,_0x9c9147=requireRuntimeUploadFile(_0x28d122['str'](_0x36ec0d(0x216)),_0x36ec0d(0x1f7));return dryRun('POST',_0x36ec0d(0x1fb))['body']({'appCode':_0x28d122[_0x36ec0d(0x1f5)],'multipart':{'file':_0x9c9147}})[_0x36ec0d(0x207)]('Preview:\x20upload\x20'+_0x9c9147[_0x36ec0d(0x200)]+'\x20to\x20runtime\x20app\x20'+_0x28d122[_0x36ec0d(0x1f5)])[_0x36ec0d(0x1f9)]();},async 'execute'(_0x359c02){const _0x5859da=a30_0x433887,_0x42f067=requireRuntimeUploadFile(_0x359c02['str'](_0x5859da(0x216)),_0x5859da(0x1f7)),_0x3073a7=await uploadRuntimeFile(_0x359c02[_0x5859da(0x1f5)],_0x42f067['path']);return{'ok':!![],'data':_0x3073a7,'message':_0x3073a7['filePath']?_0x5859da(0x1f3)+_0x3073a7[_0x5859da(0x1f2)]+'.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.':'Uploaded\x20file.\x20Store\x20filePath\x20for\x20durable\x20references;\x20use\x20file\x20query-url\x20for\x20short-lived\x20access.'};}},fileQueryUrl={'service':a30_0x433887(0x216),'command':'query-url','description':a30_0x433887(0x206),'risk':'read','flags':[FILEPATH_FLAG,DOWNLOAD_FLAG,LONG_TERM_FLAG],async 'execute'(_0x41d481){const _0x13a594=a30_0x433887,_0x228d0b=requireFilePath(_0x41d481[_0x13a594(0x20c)](_0x13a594(0x1f8))),_0x429fa4=await queryRuntimeFileUrl(_0x228d0b,{'download':_0x41d481['bool']('download'),'longTerm':_0x41d481[_0x13a594(0x20f)](_0x13a594(0x201))});return{'ok':!![],'data':_0x429fa4};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a31_0x570a2e=a31_0x23a9;(function(_0x4e1712,_0x34f502){const _0x366eef=a31_0x23a9,_0x13fee9=_0x4e1712();while(!![]){try{const _0x185040=-parseInt(_0x366eef(0x20c))/0x1+parseInt(_0x366eef(0x205))/0x2+parseInt(_0x366eef(0x1fb))/0x3+-parseInt(_0x366eef(0x208))/0x4+parseInt(_0x366eef(0x1f7))/0x5+parseInt(_0x366eef(0x209))/0x6*(parseInt(_0x366eef(0x212))/0x7)+-parseInt(_0x366eef(0x1ff))/0x8;if(_0x185040===_0x34f502)break;else _0x13fee9['push'](_0x13fee9['shift']());}catch(_0x464036){_0x13fee9['push'](_0x13fee9['shift']());}}}(a31_0x4ea5,0xe9261));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';function a31_0x23a9(_0x42face,_0x1f7989){_0x42face=_0x42face-0x1f0;const _0x4ea515=a31_0x4ea5();let _0x23a97f=_0x4ea515[_0x42face];return _0x23a97f;}import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';function a31_0x4ea5(){const _0x109f36=[')\x20instead\x20of\x20project','Write\x20to\x20global\x20(~/','54406wfwPFX','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','parse','validation','app','\x22.\x20Allowed:\x20','14kyZiEZ','Imported\x20from\x20','Failed\x20to\x20parse\x20source\x20file:\x20','string','entries','Override\x20imported\x20default\x20appcode','riskLevel','boolean','global','project','newConfigFileName','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`.','includes','4223565dViYQL','env','log','\x20\x20appcode:\x20','1564041alzTut','defaultApp','object','appcode','19630576rjzWPj','join','apps','yes','\x20\x20config:\x20\x20','cwd','3379796wMFhyS','file','Skip\x20confirmation\x20when\x20overwriting','1378316edqEjO','2255478FDScox'];a31_0x4ea5=function(){return _0x109f36;};return a31_0x4ea5();}import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const appImportFlagDefs=[{'name':'file','type':a31_0x570a2e(0x215),'description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x570a2e(0x1fe),'type':'string','description':a31_0x570a2e(0x217)},{'name':a31_0x570a2e(0x1f8),'type':a31_0x570a2e(0x215),'description':'Override\x20imported\x20default\x20env','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x570a2e(0x1f2),'type':a31_0x570a2e(0x1f1),'description':a31_0x570a2e(0x20b)+PRODUCT_CONFIG[a31_0x570a2e(0x1f4)]+a31_0x570a2e(0x20a),'default':![]},{'name':a31_0x570a2e(0x202),'type':a31_0x570a2e(0x1f1),'description':a31_0x570a2e(0x207),'default':![]}];export async function runAppImport(_0x305666){const _0x26f960=a31_0x570a2e,_0x2e5327=_0x305666[_0x26f960(0x1f2)]?'global':_0x26f960(0x1f3),_0x210052=resolveWriteConfigPath(_0x2e5327);await runFromImport(_0x305666,_0x210052);}async function runFromImport(_0xd81cc3,_0x3a580f){const _0x1efed1=a31_0x570a2e,_0x277925=resolveFilePath(_0xd81cc3[_0x1efed1(0x206)]);if(!existsSync(_0x277925))throw CliErrors['validation']('Source\x20file\x20not\x20found:\x20'+_0x277925);const _0x253da9=readSourceFile(_0x277925),_0x343f49=convertToRuntimeConfig(_0x253da9);_0xd81cc3['appcode']&&(_0x343f49[_0x1efed1(0x1fe)]=String(_0xd81cc3[_0x1efed1(0x1fe)]));_0xd81cc3['env']&&(_0x343f49[_0x1efed1(0x1f8)]=resolveImportEnv(_0xd81cc3));if(!_0x343f49[_0x1efed1(0x1fe)])throw CliErrors['validation'](_0x1efed1(0x20d),_0x1efed1(0x1f5));await writeImportConfig(_0x3a580f,_0x343f49,_0xd81cc3),console[_0x1efed1(0x1f9)](_0x1efed1(0x213)+_0x277925),console[_0x1efed1(0x1f9)](_0x1efed1(0x203)+_0x3a580f),console['log'](_0x1efed1(0x1fa)+_0x343f49[_0x1efed1(0x1fe)]);if(_0x343f49[_0x1efed1(0x1fc)])console['log']('\x20\x20default:\x20'+_0x343f49['defaultApp']);}function convertToRuntimeConfig(_0x5ba5c3){const _0x48d404=a31_0x570a2e;if(_0x5ba5c3['apps']&&typeof _0x5ba5c3[_0x48d404(0x201)]===_0x48d404(0x1fd))throw CliErrors[_0x48d404(0x20f)]('Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.');const _0x277fea={};for(const _0x4acd78 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x5ba5c3[_0x4acd78]!==undefined&&(_0x277fea[_0x4acd78]=_0x5ba5c3[_0x4acd78]);}return!_0x277fea[_0x48d404(0x1f0)]&&(_0x277fea[_0x48d404(0x1f0)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x277fea;}async function writeImportConfig(_0x4466de,_0x2ed099,_0x219912){const _0x47d3b4=a31_0x570a2e;let _0x5eea2b={};existsSync(_0x4466de)&&!_0x219912[_0x47d3b4(0x202)]&&(_0x5eea2b=readConfigFile(_0x4466de));for(const [_0x4ce2c4,_0xf6f187]of Object[_0x47d3b4(0x216)](_0x2ed099)){_0xf6f187!==undefined&&(_0x5eea2b[_0x4ce2c4]=_0xf6f187);}if(_0x5eea2b[_0x47d3b4(0x210)])delete _0x5eea2b[_0x47d3b4(0x210)];writeConfigFile(_0x4466de,_0x5eea2b);}function resolveFilePath(_0x32f3b2){const _0x665a5e=a31_0x570a2e;return isAbsolute(_0x32f3b2)?_0x32f3b2:resolve(process[_0x665a5e(0x204)](),_0x32f3b2);}function readSourceFile(_0x43f018){const _0xa0c371=a31_0x570a2e;try{const _0x1103b4=readFileSync(_0x43f018,{'encoding':'utf8'});return JSON[_0xa0c371(0x20e)](_0x1103b4);}catch(_0x38b982){throw CliErrors['validation'](_0xa0c371(0x214)+_0x38b982['message']);}}function resolveImportEnv(_0x4ca893){const _0x4a08cb=a31_0x570a2e,_0x210b83=_0x4ca893[_0x4a08cb(0x1f8)];if(_0x210b83===undefined||_0x210b83==='')return DEFAULT_CONFIG_VALUES['env'];if(!RUNTIME_ENV_VALUES[_0x4a08cb(0x1f6)](_0x210b83))throw CliErrors[_0x4a08cb(0x20f)]('Invalid\x20env\x20\x22'+_0x210b83+_0x4a08cb(0x211)+RUNTIME_ENV_VALUES[_0x4a08cb(0x200)](',\x20'));return _0x210b83;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x5d662b=a32_0x76af;(function(_0x5847a0,_0x4c79a9){const _0x3b27f2=a32_0x76af,_0xf2be96=_0x5847a0();while(!![]){try{const _0x21a341=-parseInt(_0x3b27f2(0xc7))/0x1*(-parseInt(_0x3b27f2(0xc4))/0x2)+parseInt(_0x3b27f2(0xf9))/0x3+-parseInt(_0x3b27f2(0xbb))/0x4+-parseInt(_0x3b27f2(0xf4))/0x5+-parseInt(_0x3b27f2(0xea))/0x6*(-parseInt(_0x3b27f2(0xde))/0x7)+-parseInt(_0x3b27f2(0xfb))/0x8+parseInt(_0x3b27f2(0xf6))/0x9*(parseInt(_0x3b27f2(0xfd))/0xa);if(_0x21a341===_0x4c79a9)break;else _0xf2be96['push'](_0xf2be96['shift']());}catch(_0x102995){_0xf2be96['push'](_0xf2be96['shift']());}}}(a32_0x4e9b,0xcb2f4));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':'title','type':'string','required':!![],'description':a32_0x5d662b(0xc2)},FILE_FLAG={'name':'file','type':'string','required':!![],'description':a32_0x5d662b(0xc3)},QUERY_FLAG={'name':a32_0x5d662b(0xcb),'type':a32_0x5d662b(0xd8),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x5d662b(0xf0),'type':a32_0x5d662b(0xd1),'description':a32_0x5d662b(0xda)};function readKnowledgeFile(_0x2c5d13){const _0x104d27=a32_0x5d662b;if(!_0x2c5d13)throw CliErrors[_0x104d27(0xfa)](_0x104d27(0xcd));if(!existsSync(_0x2c5d13))throw CliErrors[_0x104d27(0xfa)](_0x104d27(0xcf)+_0x2c5d13);if(!statSync(_0x2c5d13)[_0x104d27(0xcc)]())throw CliErrors['validation'](_0x104d27(0xf3)+_0x2c5d13);return readFileSync(_0x2c5d13,_0x104d27(0xec));}function summarizePersonalItem(_0x216143){const _0x1c99c1=a32_0x5d662b;return{'id':_0x216143['id'],'title':_0x216143[_0x1c99c1(0xbd)],'version':_0x216143['version'],'ragStatus':_0x216143[_0x1c99c1(0xdd)],'ragErrorMessage':_0x216143[_0x1c99c1(0xe5)],'updateTime':_0x216143['updateTime']};}function a32_0x76af(_0x13caa4,_0x2ece43){_0x13caa4=_0x13caa4-0xbb;const _0x4e9b6c=a32_0x4e9b();let _0x76af4f=_0x4e9b6c[_0x13caa4];return _0x76af4f;}function a32_0x4e9b(){const _0x426521=['/update','把本地文件内容保存为个人知识库条目,并进入后续检索同步流程。','trim','List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','3606uBwduu','str','utf8','num','version','Search\x20query\x20is\x20required.','topk','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','file','File\x20is\x20not\x20a\x20regular\x20file:\x20','2549100yaEtSe','map','484713jPbPhY','Created\x20KB\x20entry\x20','metadata','4795383RjeSEK','validation','7999160SaQteh','create','200zgiwkM','scope','Personal\x20knowledge-base\x20entry\x20ID','6602488HSrLfT','docId','title','POST','updateTime','userId','flag','Personal\x20knowledge-base\x20entry\x20title','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','2cwSGsu','verbose','根据本地文件更新个人知识库条目','1067565CaccdB','weightedScore','update','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','query','isFile','File\x20path\x20is\x20required.','/client/knowledge-base/personal/','File\x20not\x20found:\x20','length','number','Override\x20the\x20existing\x20entry\x20title','--topk\x20must\x20be\x20a\x20positive\x20number.','bool','Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20','body','isFinite','string','appCode','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','write','ragStatus','2905DwxqpL','search','description','content','createTime','根据本地文件创建个人知识库条目','read','ragErrorMessage'];a32_0x4e9b=function(){return _0x426521;};return a32_0x4e9b();}function detailPersonalItem(_0x2c6c54){const _0x4c2034=a32_0x5d662b;return{'id':_0x2c6c54['id'],'appCode':_0x2c6c54[_0x4c2034(0xd9)],'scope':_0x2c6c54[_0x4c2034(0xfe)],'userId':_0x2c6c54[_0x4c2034(0xc0)],'title':_0x2c6c54[_0x4c2034(0xbd)],'content':_0x2c6c54['content']??'','version':_0x2c6c54[_0x4c2034(0xee)],'ragStatus':_0x2c6c54[_0x4c2034(0xdd)],'ragErrorMessage':_0x2c6c54[_0x4c2034(0xe5)],'createTime':_0x2c6c54[_0x4c2034(0xe2)],'updateTime':_0x2c6c54[_0x4c2034(0xbf)]};}function summarizeSearchHit(_0x3ca418){const _0x391b97=a32_0x5d662b;return{'scope':_0x3ca418['scope'],'title':_0x3ca418[_0x391b97(0xbd)],'docId':_0x3ca418[_0x391b97(0xbc)],'score':_0x3ca418['score'],'weightedScore':_0x3ca418[_0x391b97(0xc8)],'content':_0x3ca418[_0x391b97(0xe1)],'metadata':_0x3ca418[_0x391b97(0xf8)]};}function readTopK(_0x139670){const _0x25e8a7=a32_0x5d662b,_0x4b6bb3=_0x139670[_0x25e8a7(0xc1)](_0x25e8a7(0xf0));if(_0x4b6bb3===undefined||_0x4b6bb3===null||_0x4b6bb3==='')return undefined;const _0x37272d=_0x139670['num'](_0x25e8a7(0xf0));if(!Number[_0x25e8a7(0xd7)](_0x37272d)||_0x37272d<0x1)throw CliErrors['validation'](_0x25e8a7(0xd3));return _0x37272d;}const kbList={'service':'kb','command':'list','description':a32_0x5d662b(0xe9),'risk':a32_0x5d662b(0xe4),'flags':[VERBOSE_FLAG],async 'execute'(_0xa4d1ec){const _0x3b196f=a32_0x5d662b,_0xfbcde7=await listPersonalKnowledgeBaseItems(_0xa4d1ec[_0x3b196f(0xd9)]);if(_0xa4d1ec[_0x3b196f(0xd4)](_0x3b196f(0xc5)))return{'ok':!![],'data':{'total':_0xfbcde7[_0x3b196f(0xd0)],'items':_0xfbcde7}};return{'ok':!![],'data':{'total':_0xfbcde7['length'],'items':_0xfbcde7['map'](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':'detail','description':a32_0x5d662b(0xf1),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x5d662b(0xff)}],async 'execute'(_0xc8ba1f){const _0x5b6f46=a32_0x5d662b,_0x465d25=await getPersonalKnowledgeBaseItem(_0xc8ba1f[_0x5b6f46(0xed)]('id'),_0xc8ba1f[_0x5b6f46(0xd9)]);return{'ok':!![],'data':detailPersonalItem(_0x465d25)};}},kbCreate={'service':'kb','command':a32_0x5d662b(0xfc),'description':a32_0x5d662b(0xe3),'risk':a32_0x5d662b(0xdc),'confirmationDescription':a32_0x5d662b(0xe7),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x502c0c){const _0x29b18f=a32_0x5d662b,_0x31752c=_0x502c0c['str'](_0x29b18f(0xbd)),_0x5ef5bd=readKnowledgeFile(_0x502c0c[_0x29b18f(0xeb)](_0x29b18f(0xf2))),_0x41005a=await createPersonalKnowledgeBaseItem(_0x502c0c['appCode'],{'title':_0x31752c,'content':_0x5ef5bd});return{'ok':!![],'data':summarizePersonalItem(_0x41005a),'message':_0x29b18f(0xf7)+_0x41005a['id']+'\x20('+_0x41005a[_0x29b18f(0xbd)]+')'};},async 'dryRun'(_0x4ea2ea){const _0x4ba420=a32_0x5d662b,_0x24528c=_0x4ea2ea['str']('title'),_0x1558e8=readKnowledgeFile(_0x4ea2ea['str'](_0x4ba420(0xf2)));return dryRun('POST','/client/knowledge-base/personal/create')['body']({'appCode':_0x4ea2ea[_0x4ba420(0xd9)],'title':_0x24528c,'content':_0x1558e8})['description'](_0x4ba420(0xca)+_0x24528c+'\x22')['build']();}},kbUpdate={'service':'kb','command':a32_0x5d662b(0xc9),'description':a32_0x5d662b(0xc6),'risk':a32_0x5d662b(0xdc),'confirmationDescription':'用本地文件内容替换个人知识库条目正文,并触发新的检索同步。','flags':[{...ID_FLAG,'description':a32_0x5d662b(0xff)},{...TITLE_FLAG,'required':![],'description':a32_0x5d662b(0xd2)},FILE_FLAG],async 'execute'(_0x39e78e){const _0x1d3b51=a32_0x5d662b,_0x5a0294=_0x39e78e['num']('id'),_0x20e731=readKnowledgeFile(_0x39e78e[_0x1d3b51(0xeb)](_0x1d3b51(0xf2))),_0x38b70d=_0x39e78e[_0x1d3b51(0xeb)](_0x1d3b51(0xbd))||(await getPersonalKnowledgeBaseItem(_0x5a0294,_0x39e78e['appCode']))[_0x1d3b51(0xbd)],_0x5b3d22=await updatePersonalKnowledgeBaseItem(_0x5a0294,_0x39e78e[_0x1d3b51(0xd9)],{'title':_0x38b70d,'content':_0x20e731});return{'ok':!![],'data':summarizePersonalItem(_0x5b3d22),'message':'Updated\x20KB\x20entry\x20'+_0x5b3d22['id']+'\x20('+_0x5b3d22[_0x1d3b51(0xbd)]+')'};},async 'dryRun'(_0xcbab38){const _0x4d196c=a32_0x5d662b,_0x4a6734=_0xcbab38['num']('id'),_0x217caf=readKnowledgeFile(_0xcbab38[_0x4d196c(0xeb)](_0x4d196c(0xf2))),_0x412f01=_0xcbab38['str']('title')||(await getPersonalKnowledgeBaseItem(_0x4a6734,_0xcbab38[_0x4d196c(0xd9)]))['title'];return dryRun(_0x4d196c(0xbe),_0x4d196c(0xce)+_0x4a6734+_0x4d196c(0xe6))[_0x4d196c(0xd6)]({'appCode':_0xcbab38[_0x4d196c(0xd9)],'title':_0x412f01,'content':_0x217caf})[_0x4d196c(0xe0)](_0x4d196c(0xd5)+_0x4a6734)['build']();}},kbSearch={'service':'kb','command':a32_0x5d662b(0xdf),'description':a32_0x5d662b(0xdb),'risk':a32_0x5d662b(0xe4),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x396a7f){const _0x6408b6=a32_0x5d662b;if(!_0x396a7f[_0x6408b6(0xeb)](_0x6408b6(0xcb))[_0x6408b6(0xe8)]())throw CliErrors[_0x6408b6(0xfa)](_0x6408b6(0xef));readTopK(_0x396a7f);},async 'execute'(_0x15b673){const _0x38919e=a32_0x5d662b,_0x330667=_0x15b673['str'](_0x38919e(0xcb))[_0x38919e(0xe8)](),_0x11d6ef=readTopK(_0x15b673),_0x355b2c=await searchKnowledgeBase(_0x15b673['appCode'],{'query':_0x330667,'topK':_0x11d6ef});return{'ok':!![],'data':{'total':_0x355b2c[_0x38919e(0xd0)],'hits':_0x355b2c[_0x38919e(0xf5)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x1de2bc=a33_0x4f7e;(function(_0x4eed14,_0x1c34d7){const _0x1bd7e6=a33_0x4f7e,_0x5127eb=_0x4eed14();while(!![]){try{const _0x7e5981=parseInt(_0x1bd7e6(0x105))/0x1*(-parseInt(_0x1bd7e6(0xf1))/0x2)+-parseInt(_0x1bd7e6(0xfb))/0x3+parseInt(_0x1bd7e6(0xf5))/0x4+parseInt(_0x1bd7e6(0xf6))/0x5+-parseInt(_0x1bd7e6(0x101))/0x6*(parseInt(_0x1bd7e6(0xf2))/0x7)+-parseInt(_0x1bd7e6(0x107))/0x8*(parseInt(_0x1bd7e6(0xf4))/0x9)+-parseInt(_0x1bd7e6(0x100))/0xa*(-parseInt(_0x1bd7e6(0xf3))/0xb);if(_0x7e5981===_0x1c34d7)break;else _0x5127eb['push'](_0x5127eb['shift']());}catch(_0x434b3e){_0x5127eb['push'](_0x5127eb['shift']());}}}(a33_0x5842,0xbdefc));import{logger}from'../../utils/logger.js';function a33_0x4f7e(_0x12feb2,_0xde91d5){_0x12feb2=_0x12feb2-0xf1;const _0x5842cc=a33_0x5842();let _0x4f7e8c=_0x5842cc[_0x12feb2];return _0x4f7e8c;}import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x337fe3){const _0x253ddb=a33_0x4f7e;if(_0x337fe3[_0x253ddb(0x110)]===0x0){console['log'](_0x253ddb(0xfc));return;}console[_0x253ddb(0xf7)]('*\x20'+CLI_DISPLAY_NAME+'\x20logs:\x0a'),_0x337fe3[_0x253ddb(0x103)]((_0x54fe90,_0x4bf647)=>{const _0x2a67a7=_0x253ddb,_0x5f4308=new Date(_0x54fe90[_0x2a67a7(0xf8)])[_0x2a67a7(0xfd)]('en-US'),_0x320d33=_0x54fe90[_0x2a67a7(0xff)]===_0x2a67a7(0x10f)?'√':_0x54fe90[_0x2a67a7(0xff)]===_0x2a67a7(0x106)?'×':_0x54fe90[_0x2a67a7(0xff)]==='warn'?'!':'i';console[_0x2a67a7(0xf7)](_0x4bf647+0x1+'.\x20'+_0x320d33+'\x20['+_0x54fe90[_0x2a67a7(0xf9)]+']\x20'+_0x54fe90[_0x2a67a7(0x10a)]),console['log'](_0x2a67a7(0x109)+_0x5f4308),_0x54fe90[_0x2a67a7(0x10e)]&&console[_0x2a67a7(0xf7)](_0x2a67a7(0x104)+_0x54fe90[_0x2a67a7(0x10e)]+'ms'),_0x54fe90[_0x2a67a7(0x10d)]&&Object['keys'](_0x54fe90[_0x2a67a7(0x10d)])['length']>0x0&&console[_0x2a67a7(0xf7)](_0x2a67a7(0x10b)+JSON[_0x2a67a7(0x10c)](_0x54fe90[_0x2a67a7(0x10d)],null,0x2)),console[_0x2a67a7(0xf7)]('');});}export const logsDefinitions=[{'service':a33_0x1de2bc(0x108),'command':a33_0x1de2bc(0xfe),'description':a33_0x1de2bc(0xfa),'risk':a33_0x1de2bc(0x102),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x24fa8b){return printLogs(logger['readLogs']()),{'ok':!![]};}}];function a33_0x5842(){const _0x5cbb31=['45534929qucPQk','6138ScRkjH','1713016QeWely','259125KUUnph','log','timestamp','command','View\x20command\x20history\x20logs','1685931cJzfXX','*\x20No\x20logs\x20found','toLocaleString','show','level','10jAMycK','18JTqRvo','read','forEach','\x20\x20\x20Duration:\x20','470927rGiHrY','error','6248mxbgUr','logs','\x20\x20\x20Time:\x20','message','\x20\x20\x20Details:\x20','stringify','details','duration','success','length','6EZspaJ','3113222AMiSvA'];a33_0x5842=function(){return _0x5cbb31;};return a33_0x5842();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x50ffdf=a34_0x5d1d;(function(_0x3aa91b,_0x20bfed){const _0x33affb=a34_0x5d1d,_0x123201=_0x3aa91b();while(!![]){try{const _0x52cf4d=parseInt(_0x33affb(0x167))/0x1*(parseInt(_0x33affb(0x165))/0x2)+parseInt(_0x33affb(0x153))/0x3*(parseInt(_0x33affb(0x148))/0x4)+parseInt(_0x33affb(0x15e))/0x5+-parseInt(_0x33affb(0x155))/0x6*(-parseInt(_0x33affb(0x15d))/0x7)+parseInt(_0x33affb(0x16a))/0x8+parseInt(_0x33affb(0x14d))/0x9+-parseInt(_0x33affb(0x173))/0xa;if(_0x52cf4d===_0x20bfed)break;else _0x123201['push'](_0x123201['shift']());}catch(_0x528548){_0x123201['push'](_0x123201['shift']());}}}(a34_0x1a58,0xe0f5f));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';function a34_0x5d1d(_0x2a3dc4,_0x47a7be){_0x2a3dc4=_0x2a3dc4-0x141;const _0x1a5856=a34_0x1a58();let _0x5d1dd0=_0x1a5856[_0x2a3dc4];return _0x5d1dd0;}import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';function a34_0x1a58(){const _0x41a2f9=['form','<filePath\x20returned\x20by\x20/client/uploadFile>','IdCard','170733yKwvjp','image-url','1174818sughXF','POST','image-file','imageUrl','File\x20upload\x20response\x20missing\x20filePath.','使用运行态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','toLowerCase','appCode','63JjXbMx','2265185IOgeVR','str','description','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','scene','/client/uploadFile','idCard','46UzQCGK','general','21433aHJtRC','Publicly\x20accessible\x20image\x20or\x20file\x20URL','read','3912552VMWXZn','Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','string','.\x20Supported\x20scenes:\x20','\x20OCR','File\x20URL\x20response\x20missing\x20fileUrl.','Table','ocr','imageFile','49479540AiaFrh','trim','General','filter','/client/queryFileUrl','count','recognize','build','apiError','/client/ocr','104XwVqOB','invoice','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','Invoice','filePath','10731735xwDISD','validation','body'];a34_0x1a58=function(){return _0x41a2f9;};return a34_0x1a58();}const SUPPORTED_SCENES=[a34_0x50ffdf(0x149),a34_0x50ffdf(0x166),a34_0x50ffdf(0x150),'idCard'],SCENE_TO_LEGACY_TYPE={'invoice':a34_0x50ffdf(0x14b),'general':a34_0x50ffdf(0x175),'form':a34_0x50ffdf(0x170),'idCard':a34_0x50ffdf(0x152)},SCENE_FLAG={'name':a34_0x50ffdf(0x162),'type':a34_0x50ffdf(0x16c),'required':!![],'enum':[...SUPPORTED_SCENES],'description':'OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard'},IMAGE_FILE_FLAG={'name':a34_0x50ffdf(0x157),'type':a34_0x50ffdf(0x16c),'description':a34_0x50ffdf(0x16b)},IMAGE_URL_FLAG={'name':'image-url','type':a34_0x50ffdf(0x16c),'description':a34_0x50ffdf(0x168)};function normalizeScene(_0x27d10b){const _0x21761f=a34_0x50ffdf,_0x2a88a6=_0x27d10b[_0x21761f(0x174)]()[_0x21761f(0x15b)]();if(_0x2a88a6==='idcard')return _0x21761f(0x164);if(_0x2a88a6===_0x21761f(0x149)||_0x2a88a6==='general'||_0x2a88a6==='form')return _0x2a88a6;throw CliErrors[_0x21761f(0x14e)]('Unsupported\x20OCR\x20scene:\x20'+_0x27d10b+_0x21761f(0x16d)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x2b318d){const _0x1878e8=a34_0x50ffdf,_0x119896=_0x2b318d[_0x1878e8(0x15f)](_0x1878e8(0x157))[_0x1878e8(0x174)](),_0x38b7b2=_0x2b318d['str'](_0x1878e8(0x154))[_0x1878e8(0x174)]();return{'imageFile':_0x119896,'imageUrl':_0x38b7b2,'count':[_0x119896,_0x38b7b2][_0x1878e8(0x141)](Boolean)['length']};}function validateInputSelection(_0x5030c1){const _0x4771bb=a34_0x50ffdf,_0x183e6d=selectedInputs(_0x5030c1);if(_0x183e6d[_0x4771bb(0x143)]!==0x1)throw CliErrors[_0x4771bb(0x14e)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x183e6d;}function withScene(_0x1e8447,_0x5723a2,_0x1f770c){const _0x15c67e=a34_0x50ffdf;return{..._0x1e8447,'scene':_0x5723a2,..._0x1f770c?{'sourceFile':{'fileName':_0x1f770c['fileName'],'filePath':_0x1f770c[_0x15c67e(0x14c)]}}:{}};}const ocrRecognize={'service':a34_0x50ffdf(0x171),'command':a34_0x50ffdf(0x144),'description':a34_0x50ffdf(0x15a),'risk':a34_0x50ffdf(0x169),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x257e9f){const _0x10c822=a34_0x50ffdf,_0x549b98=normalizeScene(_0x257e9f[_0x10c822(0x15f)](_0x10c822(0x162))),_0x53078e=SCENE_TO_LEGACY_TYPE[_0x549b98],_0x2ebae4=validateInputSelection(_0x257e9f);if(_0x2ebae4[_0x10c822(0x158)])return dryRun('POST','/client/ocr')[_0x10c822(0x14f)]({'appCode':_0x257e9f[_0x10c822(0x15c)],'url':_0x2ebae4[_0x10c822(0x158)],'type':_0x53078e})['description']('Preview:\x20recognize\x20'+_0x549b98+'\x20OCR\x20from\x20URL')[_0x10c822(0x145)]();const _0x430114=requireRuntimeUploadFile(_0x2ebae4[_0x10c822(0x172)],'image-file');return dryRun(_0x10c822(0x156),_0x10c822(0x163))[_0x10c822(0x14f)]({'steps':[{'method':_0x10c822(0x156),'url':_0x10c822(0x163),'body':{'appCode':_0x257e9f[_0x10c822(0x15c)],'multipart':{'file':_0x430114}}},{'method':_0x10c822(0x156),'url':_0x10c822(0x142),'body':{'filePath':_0x10c822(0x151),'downloadFlag':![]}},{'method':_0x10c822(0x156),'url':_0x10c822(0x147),'body':{'appCode':_0x257e9f[_0x10c822(0x15c)],'url':_0x10c822(0x161),'type':_0x53078e}}]})[_0x10c822(0x160)](_0x10c822(0x14a)+_0x549b98+_0x10c822(0x16e))[_0x10c822(0x145)]();},async 'execute'(_0x43371a){const _0x5cee23=a34_0x50ffdf,_0x442453=normalizeScene(_0x43371a['str'](_0x5cee23(0x162))),_0x4adbbd=SCENE_TO_LEGACY_TYPE[_0x442453],_0x5f29e9=validateInputSelection(_0x43371a);if(_0x5f29e9[_0x5cee23(0x158)]){const _0x1deaea=await recognizeRuntimeOcr(_0x43371a[_0x5cee23(0x15c)],{'url':_0x5f29e9[_0x5cee23(0x158)],'type':_0x4adbbd});return{'ok':!![],'data':withScene(_0x1deaea,_0x442453)};}const _0x43c10a=requireRuntimeUploadFile(_0x5f29e9['imageFile'],_0x5cee23(0x157)),_0x2886d9=await uploadRuntimeFile(_0x43371a[_0x5cee23(0x15c)],_0x43c10a['path']);if(!_0x2886d9[_0x5cee23(0x14c)])throw CliErrors[_0x5cee23(0x146)](_0x5cee23(0x159));const _0x131c3f=await queryRuntimeFileUrl(_0x2886d9['filePath'],{'download':![]});if(!_0x131c3f['fileUrl'])throw CliErrors['apiError'](_0x5cee23(0x16f));const _0x47165c=await recognizeRuntimeOcr(_0x43371a[_0x5cee23(0x15c)],{'url':_0x131c3f['fileUrl'],'type':_0x4adbbd});return{'ok':!![],'data':withScene(_0x47165c,_0x442453,_0x2886d9)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x26974f=a35_0x336c;(function(_0x193ff3,_0x348f0a){const _0x1a9902=a35_0x336c,_0x7c48b2=_0x193ff3();while(!![]){try{const _0x6c06fc=parseInt(_0x1a9902(0x12d))/0x1+parseInt(_0x1a9902(0x12b))/0x2+-parseInt(_0x1a9902(0x14e))/0x3+-parseInt(_0x1a9902(0x150))/0x4*(parseInt(_0x1a9902(0x15e))/0x5)+parseInt(_0x1a9902(0x152))/0x6*(-parseInt(_0x1a9902(0x151))/0x7)+-parseInt(_0x1a9902(0x162))/0x8*(-parseInt(_0x1a9902(0x15f))/0x9)+-parseInt(_0x1a9902(0x157))/0xa*(parseInt(_0x1a9902(0x13e))/0xb);if(_0x6c06fc===_0x348f0a)break;else _0x7c48b2['push'](_0x7c48b2['shift']());}catch(_0x341969){_0x7c48b2['push'](_0x7c48b2['shift']());}}}(a35_0x5a5c,0xeb920));import{existsSync,readFileSync,statSync}from'node:fs';function a35_0x336c(_0x463274,_0x191318){_0x463274=_0x463274-0x12b;const _0x5a5c8d=a35_0x5a5c();let _0x336c46=_0x5a5c8d[_0x463274];return _0x336c46;}import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x26974f(0x156),'type':a35_0x26974f(0x138),'description':a35_0x26974f(0x153)},FUNCTION_NAME_FLAG={'name':a35_0x26974f(0x14b),'type':a35_0x26974f(0x138),'required':!![],'description':a35_0x26974f(0x154)},DESCRIPTION_FLAG={'name':a35_0x26974f(0x14d),'type':a35_0x26974f(0x138),'description':'Personal\x20BFF\x20description'},SOURCE_SESSION_FLAG={'name':a35_0x26974f(0x145),'type':'string','description':a35_0x26974f(0x135)};function normalizeFunctionName(_0x5587a7){const _0x4f7eef=a35_0x26974f,_0x5de50a=String(_0x5587a7||'')['trim']();if(!_0x5de50a||!FUNCTION_NAME_PATTERN[_0x4f7eef(0x14c)](_0x5de50a))throw CliErrors[_0x4f7eef(0x15c)](_0x4f7eef(0x13a));return _0x5de50a;}function readScriptFile(_0x539cb0){const _0x1c8ac0=a35_0x26974f;if(!_0x539cb0)throw CliErrors[_0x1c8ac0(0x15c)]('File\x20path\x20is\x20required.');if(!existsSync(_0x539cb0))throw CliErrors[_0x1c8ac0(0x15c)](_0x1c8ac0(0x14f)+_0x539cb0);if(!statSync(_0x539cb0)[_0x1c8ac0(0x14a)]())throw CliErrors[_0x1c8ac0(0x15c)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x539cb0);const _0x54f332=readFileSync(_0x539cb0,_0x1c8ac0(0x158));if(!_0x54f332['trim']())throw CliErrors[_0x1c8ac0(0x15c)](_0x1c8ac0(0x141));return _0x54f332;}function optionalTrimmed(_0x233e59){const _0x311f53=a35_0x26974f,_0x28badc=String(_0x233e59||'')[_0x311f53(0x12c)]();return _0x28badc||undefined;}function summarizeBff(_0x14f77f){const _0x217310=a35_0x26974f;return{'id':_0x14f77f['id'],'appCode':_0x14f77f[_0x217310(0x15d)],'functionName':_0x14f77f[_0x217310(0x143)],'description':_0x14f77f[_0x217310(0x14d)],'scriptType':_0x14f77f[_0x217310(0x160)],'version':_0x14f77f['version'],'gmtModified':_0x14f77f[_0x217310(0x142)],'updateTime':_0x14f77f[_0x217310(0x136)]};}function detailBff(_0x5aa8ec){const _0x4eb3bc=a35_0x26974f;return{'id':_0x5aa8ec['id'],'appCode':_0x5aa8ec['appCode'],'functionName':_0x5aa8ec['functionName'],'description':_0x5aa8ec[_0x4eb3bc(0x14d)],'scriptType':_0x5aa8ec[_0x4eb3bc(0x160)],'scriptContent':_0x5aa8ec[_0x4eb3bc(0x139)]??'','config':_0x5aa8ec[_0x4eb3bc(0x132)],'version':_0x5aa8ec['version'],'createUserId':_0x5aa8ec['createUserId'],'gmtCreate':_0x5aa8ec[_0x4eb3bc(0x155)],'gmtModified':_0x5aa8ec['gmtModified'],'createTime':_0x5aa8ec[_0x4eb3bc(0x166)],'updateTime':_0x5aa8ec[_0x4eb3bc(0x136)]};}function buildCreateInput(_0x575658){const _0x2e0632=a35_0x26974f;return{'functionName':normalizeFunctionName(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x14b))),...optionalTrimmed(_0x575658[_0x2e0632(0x13d)]('description'))?{'description':optionalTrimmed(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x14d)))}:{},'scriptContent':readScriptFile(_0x575658['str'](_0x2e0632(0x156))),...optionalTrimmed(_0x575658[_0x2e0632(0x13d)](_0x2e0632(0x145)))?{'sourceSessionId':optionalTrimmed(_0x575658['str']('source-session-id'))}:{}};}function buildUpdateInput(_0x5d2dac){const _0x24e71a=a35_0x26974f,_0x53f7ac={};optionalTrimmed(_0x5d2dac['str'](_0x24e71a(0x14b)))&&(_0x53f7ac['functionName']=normalizeFunctionName(_0x5d2dac[_0x24e71a(0x13d)](_0x24e71a(0x14b))));_0x5d2dac['flag'](_0x24e71a(0x14d))!==undefined&&(_0x53f7ac[_0x24e71a(0x14d)]=_0x5d2dac['str'](_0x24e71a(0x14d)));optionalTrimmed(_0x5d2dac[_0x24e71a(0x13d)]('file'))&&(_0x53f7ac[_0x24e71a(0x139)]=readScriptFile(_0x5d2dac['str'](_0x24e71a(0x156))));_0x5d2dac['flag'](_0x24e71a(0x145))!==undefined&&(_0x53f7ac[_0x24e71a(0x12f)]=_0x5d2dac[_0x24e71a(0x13d)]('source-session-id'));if(Object[_0x24e71a(0x13f)](_0x53f7ac)[_0x24e71a(0x12e)]===0x0)throw CliErrors['validation']('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x53f7ac;}function a35_0x5a5c(){const _0x4a0da5=['scriptType','detail','8qeoGPL','Updated\x20personal\x20BFF\x20','body','更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','createTime','list','Show\x20one\x20personal\x20BFF\x20by\x20id','根据\x20ID\x20更新个人\x20BFF','3556488JetFJq','trim','1824855rZVJbr','length','sourceSessionId','map','POST','config','num','/client/runtime-bff/personal/create','Optional\x20source\x20RuntimeAgent\x20session\x20id','updateTime','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','string','scriptContent','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','根据本地脚本文件创建个人\x20BFF','build','str','1289387dFdevJ','keys','personal-bff','Personal\x20BFF\x20script\x20file\x20is\x20blank.','gmtModified','functionName','exec','source-session-id','/update','params','bool','update','isFile','name','test','description','5455980KvlSbQ','File\x20not\x20found:\x20','712792PxnMKm','7RzCuVE','2106726jJppsk','Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','gmtCreate','file','130EkMhEp','utf8','Personal\x20BFF\x20script\x20ID','write','Preview:\x20create\x20personal\x20BFF\x20','validation','appCode','5tPQHss','11102373FHITuQ'];a35_0x5a5c=function(){return _0x4a0da5;};return a35_0x5a5c();}function parseExecParams(_0x4da413){const _0x179137=parseJsonParams(_0x4da413)??{};if(Array['isArray'](_0x179137))throw CliErrors['validation']('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x179137;}const personalBffList={'service':a35_0x26974f(0x140),'command':a35_0x26974f(0x167),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xa984f1){const _0x3869f1=a35_0x26974f,_0x5f3f2e=await listPersonalBffs(_0xa984f1[_0x3869f1(0x15d)]);return{'ok':!![],'data':{'total':_0x5f3f2e[_0x3869f1(0x12e)],'items':_0xa984f1[_0x3869f1(0x148)]('verbose')?_0x5f3f2e:_0x5f3f2e[_0x3869f1(0x130)](summarizeBff)}};}},personalBffDetail={'service':'personal-bff','command':a35_0x26974f(0x161),'description':a35_0x26974f(0x168),'risk':'read','flags':[{...ID_FLAG,'description':a35_0x26974f(0x159)}],async 'execute'(_0x703b80){const _0x3e2deb=a35_0x26974f,_0x4d30c2=await getPersonalBff(_0x703b80[_0x3e2deb(0x133)]('id'),_0x703b80[_0x3e2deb(0x15d)]);return{'ok':!![],'data':detailBff(_0x4d30c2)};}},personalBffCreate={'service':a35_0x26974f(0x140),'command':'create','description':a35_0x26974f(0x13b),'risk':'write','confirmationDescription':a35_0x26974f(0x137),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x148e7f){const _0x5c6224=a35_0x26974f,_0x1a609d=buildCreateInput(_0x148e7f),_0x43990f=await createPersonalBff(_0x148e7f['appCode'],_0x1a609d);return{'ok':!![],'data':detailBff(_0x43990f),'message':'Created\x20personal\x20BFF\x20'+_0x43990f['id']+(_0x43990f[_0x5c6224(0x143)]?'\x20('+_0x43990f[_0x5c6224(0x143)]+')':'')};},async 'dryRun'(_0x44cc2b){const _0x4f23ca=a35_0x26974f,_0x57c6f6=buildCreateInput(_0x44cc2b);return dryRun(_0x4f23ca(0x131),_0x4f23ca(0x134))[_0x4f23ca(0x164)]({'appCode':_0x44cc2b['appCode'],..._0x57c6f6})[_0x4f23ca(0x14d)](_0x4f23ca(0x15b)+_0x57c6f6[_0x4f23ca(0x143)])[_0x4f23ca(0x13c)]();}},personalBffUpdate={'service':a35_0x26974f(0x140),'command':a35_0x26974f(0x149),'description':a35_0x26974f(0x169),'risk':a35_0x26974f(0x15a),'confirmationDescription':a35_0x26974f(0x165),'flags':[{...ID_FLAG,'description':a35_0x26974f(0x159)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x335e99){const _0x5392bd=a35_0x26974f,_0x2a646d=_0x335e99['num']('id'),_0x452f66=buildUpdateInput(_0x335e99),_0x1d02f3=await updatePersonalBff(_0x2a646d,_0x335e99[_0x5392bd(0x15d)],_0x452f66);return{'ok':!![],'data':detailBff(_0x1d02f3),'message':_0x5392bd(0x163)+_0x1d02f3['id']+(_0x1d02f3[_0x5392bd(0x143)]?'\x20('+_0x1d02f3[_0x5392bd(0x143)]+')':'')};},async 'dryRun'(_0x52c399){const _0x37c486=a35_0x26974f,_0x82a4eb=_0x52c399['num']('id'),_0x311e2d=buildUpdateInput(_0x52c399);return dryRun(_0x37c486(0x131),'/client/runtime-bff/personal/'+_0x82a4eb+_0x37c486(0x146))[_0x37c486(0x164)]({'appCode':_0x52c399[_0x37c486(0x15d)],..._0x311e2d})[_0x37c486(0x14d)]('Preview:\x20update\x20personal\x20BFF\x20'+_0x82a4eb)[_0x37c486(0x13c)]();}},personalBffExec={'service':'personal-bff','command':a35_0x26974f(0x144),'description':'根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','risk':a35_0x26974f(0x15a),'confirmationDescription':'执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':'JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution'}],async 'validate'(_0x5f3669){const _0x1fe1af=a35_0x26974f;parseExecParams(_0x5f3669[_0x1fe1af(0x13d)]('params'));},async 'execute'(_0x576db9){const _0x41933f=a35_0x26974f,_0x68013e=_0x576db9[_0x41933f(0x133)]('id'),_0x3e9273=parseExecParams(_0x576db9['str'](_0x41933f(0x147))),_0x346e57=await executePersonalBff(_0x68013e,_0x576db9['appCode'],_0x3e9273);return{'ok':!![],'data':{'result':_0x346e57},'message':'Executed\x20personal\x20BFF\x20'+_0x68013e};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x571701=a35_0x3a25;(function(_0x5838fc,_0x14b65f){const _0x3eb3da=a35_0x3a25,_0x5923c5=_0x5838fc();while(!![]){try{const _0x2e8507=parseInt(_0x3eb3da(0x18c))/0x1*(-parseInt(_0x3eb3da(0x18e))/0x2)+parseInt(_0x3eb3da(0x1a7))/0x3*(parseInt(_0x3eb3da(0x1ba))/0x4)+-parseInt(_0x3eb3da(0x1a9))/0x5+parseInt(_0x3eb3da(0x1ab))/0x6*(-parseInt(_0x3eb3da(0x1a6))/0x7)+-parseInt(_0x3eb3da(0x1b0))/0x8*(parseInt(_0x3eb3da(0x17a))/0x9)+parseInt(_0x3eb3da(0x1ad))/0xa+parseInt(_0x3eb3da(0x1a0))/0xb;if(_0x2e8507===_0x14b65f)break;else _0x5923c5['push'](_0x5923c5['shift']());}catch(_0x4cc094){_0x5923c5['push'](_0x5923c5['shift']());}}}(a35_0x36ce,0x81284));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a35_0x3a25(_0x15f170,_0x5a78eb){_0x15f170=_0x15f170-0x174;const _0x36ce46=a35_0x36ce();let _0x3a25b8=_0x36ce46[_0x15f170];return _0x3a25b8;}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_0x571701(0x1bb),'type':a35_0x571701(0x174),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x571701(0x1b4),'type':a35_0x571701(0x174),'required':!![],'description':a35_0x571701(0x176)},DESCRIPTION_FLAG={'name':a35_0x571701(0x1a1),'type':'string','description':a35_0x571701(0x179)},SOURCE_SESSION_FLAG={'name':'source-session-id','type':'string','description':a35_0x571701(0x199)};function normalizeFunctionName(_0x4c3c1c){const _0x1e5df8=a35_0x571701,_0x571148=String(_0x4c3c1c||'')[_0x1e5df8(0x186)]();if(!_0x571148||!FUNCTION_NAME_PATTERN[_0x1e5df8(0x17d)](_0x571148))throw CliErrors[_0x1e5df8(0x17f)](_0x1e5df8(0x180));return _0x571148;}function a35_0x36ce(){const _0x4e63dd=['更新个人\x20BFF\x20的脚本或元信息;之后的调用将使用新版本。','update','Updated\x20personal\x20BFF\x20','File\x20path\x20is\x20required.','29412405uudtdg','description','appCode','map','read','Personal\x20BFF\x20script\x20ID','553tyIVqM','618996QmAdDb','File\x20is\x20not\x20a\x20regular\x20file:\x20','5240340TeYIgU','exec','79134XUXrWn','config','109230KVCUME','source-session-id','/update','1784mvliRr','scriptContent','list','length','name','createTime','执行个人\x20BFF\x20脚本;脚本可能读取或修改业务数据,也可能调用外部服务。','params','functionName','根据\x20ID\x20执行个人\x20BFF,并可传入\x20JSON\x20参数','12aLzjGa','file','string','File\x20not\x20found:\x20','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','POST','Created\x20personal\x20BFF\x20','Personal\x20BFF\x20description','1665itDLea','flag','/client/runtime-bff/personal/','test','根据本地脚本文件创建个人\x20BFF','validation','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','version','personal-bff','updateTime','body','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','trim','write','build','detail','Preview:\x20update\x20personal\x20BFF\x20','gmtCreate','160873QmzNgk','bool','8ePDxnu','num','--params\x20must\x20be\x20a\x20JSON\x20object.','sourceSessionId','根据\x20ID\x20更新个人\x20BFF','createUserId','isFile','/client/runtime-bff/personal/create','isArray','Executed\x20personal\x20BFF\x20','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Optional\x20source\x20RuntimeAgent\x20session\x20id','把本地脚本保存为个人\x20BFF;之后可在当前应用中调用该脚本。','str'];a35_0x36ce=function(){return _0x4e63dd;};return a35_0x36ce();}function readScriptFile(_0x45e2bf){const _0x22ecf4=a35_0x571701;if(!_0x45e2bf)throw CliErrors['validation'](_0x22ecf4(0x19f));if(!existsSync(_0x45e2bf))throw CliErrors[_0x22ecf4(0x17f)](_0x22ecf4(0x175)+_0x45e2bf);if(!statSync(_0x45e2bf)[_0x22ecf4(0x194)]())throw CliErrors['validation'](_0x22ecf4(0x1a8)+_0x45e2bf);const _0x1044fb=readFileSync(_0x45e2bf,'utf8');if(!_0x1044fb[_0x22ecf4(0x186)]())throw CliErrors[_0x22ecf4(0x17f)]('Personal\x20BFF\x20script\x20file\x20is\x20blank.');return _0x1044fb;}function optionalTrimmed(_0x3b8890){const _0x3fa2ad=a35_0x571701,_0x553b22=String(_0x3b8890||'')[_0x3fa2ad(0x186)]();return _0x553b22||undefined;}function summarizeBff(_0x4e637b){const _0x5ebe04=a35_0x571701;return{'id':_0x4e637b['id'],'appCode':_0x4e637b[_0x5ebe04(0x1a2)],'functionName':_0x4e637b[_0x5ebe04(0x1b8)],'description':_0x4e637b['description'],'scriptType':_0x4e637b['scriptType'],'version':_0x4e637b[_0x5ebe04(0x181)],'gmtModified':_0x4e637b['gmtModified'],'updateTime':_0x4e637b[_0x5ebe04(0x183)]};}function detailBff(_0x3a34a9){const _0x3615ec=a35_0x571701;return{'id':_0x3a34a9['id'],'appCode':_0x3a34a9[_0x3615ec(0x1a2)],'functionName':_0x3a34a9['functionName'],'description':_0x3a34a9[_0x3615ec(0x1a1)],'scriptType':_0x3a34a9['scriptType'],'scriptContent':_0x3a34a9[_0x3615ec(0x1b1)]??'','config':_0x3a34a9[_0x3615ec(0x1ac)],'version':_0x3a34a9[_0x3615ec(0x181)],'createUserId':_0x3a34a9[_0x3615ec(0x193)],'gmtCreate':_0x3a34a9[_0x3615ec(0x18b)],'gmtModified':_0x3a34a9['gmtModified'],'createTime':_0x3a34a9[_0x3615ec(0x1b5)],'updateTime':_0x3a34a9['updateTime']};}function buildCreateInput(_0x3cc7ae){const _0xd5740f=a35_0x571701;return{'functionName':normalizeFunctionName(_0x3cc7ae[_0xd5740f(0x19b)](_0xd5740f(0x1b4))),...optionalTrimmed(_0x3cc7ae[_0xd5740f(0x19b)](_0xd5740f(0x1a1)))?{'description':optionalTrimmed(_0x3cc7ae[_0xd5740f(0x19b)](_0xd5740f(0x1a1)))}:{},'scriptContent':readScriptFile(_0x3cc7ae['str'](_0xd5740f(0x1bb))),...optionalTrimmed(_0x3cc7ae['str'](_0xd5740f(0x1ae)))?{'sourceSessionId':optionalTrimmed(_0x3cc7ae['str'](_0xd5740f(0x1ae)))}:{}};}function buildUpdateInput(_0x28a155){const _0x28ce3d=a35_0x571701,_0x26c5da={};optionalTrimmed(_0x28a155[_0x28ce3d(0x19b)](_0x28ce3d(0x1b4)))&&(_0x26c5da['functionName']=normalizeFunctionName(_0x28a155[_0x28ce3d(0x19b)](_0x28ce3d(0x1b4))));_0x28a155[_0x28ce3d(0x17b)](_0x28ce3d(0x1a1))!==undefined&&(_0x26c5da[_0x28ce3d(0x1a1)]=_0x28a155['str'](_0x28ce3d(0x1a1)));optionalTrimmed(_0x28a155[_0x28ce3d(0x19b)]('file'))&&(_0x26c5da[_0x28ce3d(0x1b1)]=readScriptFile(_0x28a155[_0x28ce3d(0x19b)](_0x28ce3d(0x1bb))));_0x28a155[_0x28ce3d(0x17b)](_0x28ce3d(0x1ae))!==undefined&&(_0x26c5da[_0x28ce3d(0x191)]=_0x28a155['str'](_0x28ce3d(0x1ae)));if(Object['keys'](_0x26c5da)[_0x28ce3d(0x1b3)]===0x0)throw CliErrors[_0x28ce3d(0x17f)]('personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.');return _0x26c5da;}function parseExecParams(_0x1a3fa1){const _0x27b2d3=a35_0x571701,_0x2052cd=parseJsonParams(_0x1a3fa1)??{};if(Array[_0x27b2d3(0x196)](_0x2052cd))throw CliErrors['validation'](_0x27b2d3(0x190));return _0x2052cd;}const personalBffList={'service':a35_0x571701(0x182),'command':a35_0x571701(0x1b2),'description':a35_0x571701(0x185),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x140a04){const _0x59f1a3=a35_0x571701,_0x73d74e=await listPersonalBffs(_0x140a04[_0x59f1a3(0x1a2)]);return{'ok':!![],'data':{'total':_0x73d74e[_0x59f1a3(0x1b3)],'items':_0x140a04[_0x59f1a3(0x18d)]('verbose')?_0x73d74e:_0x73d74e[_0x59f1a3(0x1a3)](summarizeBff)}};}},personalBffDetail={'service':a35_0x571701(0x182),'command':a35_0x571701(0x189),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x571701(0x1a4),'flags':[{...ID_FLAG,'description':a35_0x571701(0x1a5)}],async 'execute'(_0x1374b0){const _0x560b08=a35_0x571701,_0x3c4277=await getPersonalBff(_0x1374b0[_0x560b08(0x18f)]('id'),_0x1374b0[_0x560b08(0x1a2)]);return{'ok':!![],'data':detailBff(_0x3c4277)};}},personalBffCreate={'service':'personal-bff','command':'create','description':a35_0x571701(0x17e),'risk':a35_0x571701(0x187),'confirmationDescription':a35_0x571701(0x19a),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x26b733){const _0x3f0f3a=a35_0x571701,_0x4604da=buildCreateInput(_0x26b733),_0x17af50=await createPersonalBff(_0x26b733[_0x3f0f3a(0x1a2)],_0x4604da);return{'ok':!![],'data':detailBff(_0x17af50),'message':_0x3f0f3a(0x178)+_0x17af50['id']+(_0x17af50[_0x3f0f3a(0x1b8)]?'\x20('+_0x17af50[_0x3f0f3a(0x1b8)]+')':'')};},async 'dryRun'(_0x135a85){const _0x1b7003=a35_0x571701,_0x5b3a05=buildCreateInput(_0x135a85);return dryRun(_0x1b7003(0x177),_0x1b7003(0x195))[_0x1b7003(0x184)]({'appCode':_0x135a85[_0x1b7003(0x1a2)],..._0x5b3a05})[_0x1b7003(0x1a1)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x5b3a05[_0x1b7003(0x1b8)])[_0x1b7003(0x188)]();}},personalBffUpdate={'service':a35_0x571701(0x182),'command':a35_0x571701(0x19d),'description':a35_0x571701(0x192),'risk':a35_0x571701(0x187),'confirmationDescription':a35_0x571701(0x19c),'flags':[{...ID_FLAG,'description':a35_0x571701(0x1a5)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x8ffb6c){const _0x548162=a35_0x571701,_0x2e3c74=_0x8ffb6c[_0x548162(0x18f)]('id'),_0xb1cda7=buildUpdateInput(_0x8ffb6c),_0x3acfd2=await updatePersonalBff(_0x2e3c74,_0x8ffb6c[_0x548162(0x1a2)],_0xb1cda7);return{'ok':!![],'data':detailBff(_0x3acfd2),'message':_0x548162(0x19e)+_0x3acfd2['id']+(_0x3acfd2[_0x548162(0x1b8)]?'\x20('+_0x3acfd2[_0x548162(0x1b8)]+')':'')};},async 'dryRun'(_0x492710){const _0x448cce=a35_0x571701,_0x2a18b9=_0x492710[_0x448cce(0x18f)]('id'),_0x3d25e7=buildUpdateInput(_0x492710);return dryRun(_0x448cce(0x177),_0x448cce(0x17c)+_0x2a18b9+_0x448cce(0x1af))[_0x448cce(0x184)]({'appCode':_0x492710[_0x448cce(0x1a2)],..._0x3d25e7})['description'](_0x448cce(0x18a)+_0x2a18b9)[_0x448cce(0x188)]();}},personalBffExec={'service':a35_0x571701(0x182),'command':a35_0x571701(0x1aa),'description':a35_0x571701(0x1b9),'risk':'write','confirmationDescription':a35_0x571701(0x1b6),'flags':[{...ID_FLAG,'description':a35_0x571701(0x1a5)},{...PARAMS_FLAG,'description':a35_0x571701(0x198)}],async 'validate'(_0x5c7944){const _0xbf5cd1=a35_0x571701;parseExecParams(_0x5c7944[_0xbf5cd1(0x19b)](_0xbf5cd1(0x1b7)));},async 'execute'(_0x46d270){const _0x118fab=a35_0x571701,_0x100bb6=_0x46d270[_0x118fab(0x18f)]('id'),_0x23e19f=parseExecParams(_0x46d270['str'](_0x118fab(0x1b7))),_0x55217a=await executePersonalBff(_0x100bb6,_0x46d270[_0x118fab(0x1a2)],_0x23e19f);return{'ok':!![],'data':{'result':_0x55217a},'message':_0x118fab(0x197)+_0x100bb6};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x11c562=a36_0xc791;(function(_0x29598d,_0x3de4e6){const _0xe86dfd=a36_0xc791,_0x13bbc1=_0x29598d();while(!![]){try{const _0x23fa86=-parseInt(_0xe86dfd(0xff))/0x1+parseInt(_0xe86dfd(0xda))/0x2+-parseInt(_0xe86dfd(0x107))/0x3*(parseInt(_0xe86dfd(0xf1))/0x4)+-parseInt(_0xe86dfd(0xef))/0x5*(parseInt(_0xe86dfd(0xdf))/0x6)+-parseInt(_0xe86dfd(0xeb))/0x7*(parseInt(_0xe86dfd(0x109))/0x8)+-parseInt(_0xe86dfd(0xf0))/0x9+parseInt(_0xe86dfd(0x10a))/0xa*(parseInt(_0xe86dfd(0x101))/0xb);if(_0x23fa86===_0x3de4e6)break;else _0x13bbc1['push'](_0x13bbc1['shift']());}catch(_0x2edf1a){_0x13bbc1['push'](_0x13bbc1['shift']());}}}(a36_0x5c49,0xba4c5));import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{serviceDefinitions}from'../commands/service/index.js';import{updateDefinition}from'../commands/update.js';import{doctorDefinition}from'../commands/doctor.js';import{schemaDefinition}from'../commands/schema.js';import{appDefinitions}from'../commands/app/definitions.js';function a36_0xc791(_0x2b3692,_0x1457dd){_0x2b3692=_0x2b3692-0xd3;const _0x5c4980=a36_0x5c49();let _0xc791cd=_0x5c4980[_0x2b3692];return _0xc791cd;}import{workspaceDefinitions}from'../commands/workspace/index.js';function a36_0x5c49(){const _0x486cd5=['read','command','Service\x20Tree','`lovrabet\x20app\x20use`\x20has\x20been\x20removed.','Skills','Artifacts','API\x20Documentation','7hUIAVw','get','app','map','2711990pZZDtg','10794132AxAAFE','77060OYEqJr','CLI\x20Built-in\x20Skill','File','Schema','Runtime\x20App\x20Config','show','Instant\x20API','install','Knowledge\x20Base','clear','Use\x20`lovrabet\x20workspace\x20use\x20--app\x20<name>`\x20instead.','Personal\x20BFF','Configuration','Datasets','131312UGMzIw','login','11XGqvKh','\x20\x20[high-risk-write]','logs','BFF\x20Scripts','App\x20Management','service','87oqHYXy','run','5587816YIfBLs','35511250qGOWpt','list','Authentication','Diagnostics','defaultCommand','values','\x20\x20[write]','push','684344WrYMkm','Logs','isSingleCommand','Use\x20`lovrabet\x20logs\x20show`\x20to\x20view\x20command\x20history.','app\x20use','6CFLDET','has','init','SQL\x20Queries','set'];a36_0x5c49=function(){return _0x486cd5;};return a36_0x5c49();}import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';import{scheduleDefinitions}from'../commands/schedule/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x1517f8){const _0x2b8357=a36_0xc791;for(const _0x2f622a of _0x1517f8){definitions[_0x2b8357(0xe3)](_0x2f622a['service']+':'+_0x2f622a['command'],_0x2f622a);let _0x239bd6=serviceGroups['get'](_0x2f622a['service']);!_0x239bd6&&(_0x239bd6=[],serviceGroups[_0x2b8357(0xe3)](_0x2f622a['service'],_0x239bd6)),_0x239bd6[_0x2b8357(0xd9)](_0x2f622a);}}function registerService(_0x37a7c4,_0x2dba9a,_0x26b63a){const _0x15b89f=a36_0xc791;registerDefinitions(_0x2dba9a);const _0x352852=_0x533058=>_0x533058===_0x15b89f(0xe4)?'':_0x533058==='write'?_0x15b89f(0xd8):_0x15b89f(0x102),_0x597a81={'service':_0x2dba9a[0x0][_0x15b89f(0x106)],'label':_0x37a7c4,'commands':_0x2dba9a[_0x15b89f(0xee)](_0x4213e4=>({'command':_0x4213e4[_0x15b89f(0xe5)],'description':_0x4213e4['description'],'tag':_0x352852(_0x4213e4['risk'])})),'defaultCommand':_0x26b63a?.[_0x15b89f(0xd6)]??(_0x26b63a?.['isSingleCommand']?_0x2dba9a[0x0][_0x15b89f(0xe5)]:undefined),'isSingleCommand':_0x26b63a?.[_0x15b89f(0xdc)]};serviceRegistry[_0x15b89f(0xd9)](_0x597a81),serviceByName['set'](_0x597a81[_0x15b89f(0x106)],_0x597a81);}registerService(a36_0x11c562(0xd4),authDefinitions,{'defaultCommand':a36_0x11c562(0x100)}),registerService(a36_0x11c562(0x105),appDefinitions,{'defaultCommand':a36_0x11c562(0xd3)}),registerService('Workspace',workspaceDefinitions),registerService(a36_0x11c562(0xf5),appConfigDefinitions),registerService(a36_0x11c562(0xfd),configDefinitions,{'defaultCommand':a36_0x11c562(0xd3)}),registerService(a36_0x11c562(0xea),apiDocDefinitions),registerService(a36_0x11c562(0xfe),datasetDefinitions),registerService(a36_0x11c562(0xf7),dataDefinitions),registerService(a36_0x11c562(0xe2),sqlDefinitions),registerService(a36_0x11c562(0x104),bffDefinitions),registerService(a36_0x11c562(0xfc),personalBffDefinitions),registerService(a36_0x11c562(0xe9),artifactDefinitions),registerService(a36_0x11c562(0xf3),fileDefinitions),registerService('OCR',ocrDefinitions),registerService(a36_0x11c562(0xf9),kbDefinitions),registerService('Agent\x20Schedules',scheduleDefinitions,{'defaultCommand':'list'}),registerService(a36_0x11c562(0xe6),serviceDefinitions,{'defaultCommand':a36_0x11c562(0xd3)}),registerService(a36_0x11c562(0xe8),skillDefinitions,{'defaultCommand':a36_0x11c562(0xf8)}),registerService(a36_0x11c562(0xf2),cliSkillDefinitions,{'defaultCommand':a36_0x11c562(0xf8)}),registerService('Self\x20Update',[updateDefinition],{'defaultCommand':a36_0x11c562(0x108),'isSingleCommand':!![]}),registerService(a36_0x11c562(0xd5),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x11c562(0xf4),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x11c562(0xdb),logsDefinitions,{'defaultCommand':a36_0x11c562(0xf6)});export function findDefinition(_0x408079,_0xfbd313){const _0x5f23b7=a36_0x11c562;return definitions[_0x5f23b7(0xec)](_0x408079+':'+_0xfbd313);}export function resolveRemovedCommand(_0x21fe31,_0x3c0c1b){const _0x170c24=a36_0x11c562;if(_0x21fe31===_0x170c24(0xed)&&_0x3c0c1b===_0x170c24(0xe1))return{'command':'app\x20init','message':'`lovrabet\x20app\x20init`\x20has\x20been\x20removed.','hint':'Use\x20`lovrabet\x20workspace\x20init\x20--appcode\x20<code>`\x20instead.'};if(_0x21fe31===_0x170c24(0xed)&&_0x3c0c1b==='use')return{'command':_0x170c24(0xde),'message':_0x170c24(0xe7),'hint':_0x170c24(0xfb)};if(_0x21fe31===_0x170c24(0x103)&&_0x3c0c1b===_0x170c24(0xfa))return{'command':'logs\x20clear','message':'`lovrabet\x20logs\x20clear`\x20has\x20been\x20removed.','hint':_0x170c24(0xdd)};return undefined;}export function isKnownService(_0x5f5026){const _0x5a6e3f=a36_0x11c562;return serviceByName[_0x5a6e3f(0xe0)](_0x5f5026);}export function getServiceEntry(_0x544d47){const _0x3e3fb9=a36_0x11c562;return serviceByName[_0x3e3fb9(0xec)](_0x544d47);}export function getAllDefinitions(){const _0x5c50a3=a36_0x11c562;return Array['from'](definitions[_0x5c50a3(0xd7)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a37_0x20b9(_0x2cabcc,_0x3ab083){_0x2cabcc=_0x2cabcc-0x129;const _0x53a23a=a37_0x53a2();let _0x20b97b=_0x53a23a[_0x2cabcc];return _0x20b97b;}const a37_0x5a482e=a37_0x20b9;(function(_0x575c09,_0x128577){const _0x31bab3=a37_0x20b9,_0x3906dc=_0x575c09();while(!![]){try{const _0x5949c3=parseInt(_0x31bab3(0x159))/0x1+parseInt(_0x31bab3(0x136))/0x2+-parseInt(_0x31bab3(0x12a))/0x3*(-parseInt(_0x31bab3(0x129))/0x4)+-parseInt(_0x31bab3(0x165))/0x5+-parseInt(_0x31bab3(0x135))/0x6*(-parseInt(_0x31bab3(0x149))/0x7)+parseInt(_0x31bab3(0x12c))/0x8*(-parseInt(_0x31bab3(0x162))/0x9)+parseInt(_0x31bab3(0x14f))/0xa*(-parseInt(_0x31bab3(0x14c))/0xb);if(_0x5949c3===_0x128577)break;else _0x3906dc['push'](_0x3906dc['shift']());}catch(_0x2d218f){_0x3906dc['push'](_0x3906dc['shift']());}}}(a37_0x53a2,0x9ed01));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':'string','required':!![],'enum':[a37_0x5a482e(0x12f),a37_0x5a482e(0x143)],'description':a37_0x5a482e(0x130)},CRON_FLAG={'name':a37_0x5a482e(0x14b),'type':a37_0x5a482e(0x142),'description':a37_0x5a482e(0x156)},SCHEDULED_AT_FLAG={'name':a37_0x5a482e(0x164),'type':a37_0x5a482e(0x142),'description':a37_0x5a482e(0x141)},TITLE_FLAG={'name':'title','type':'string','required':!![],'description':a37_0x5a482e(0x151)},PROMPT_FLAG={'name':'prompt','type':a37_0x5a482e(0x142),'required':!![],'description':a37_0x5a482e(0x15f)},CHANNEL_FLAG={'name':'channel','type':a37_0x5a482e(0x142),'enum':[a37_0x5a482e(0x12b),a37_0x5a482e(0x12e)],'default':a37_0x5a482e(0x12e),'description':a37_0x5a482e(0x150)},SCHEDULE_ID_FLAG={'name':a37_0x5a482e(0x13c),'type':a37_0x5a482e(0x142),'required':!![],'description':a37_0x5a482e(0x163),'pattern':{'regex':SCHEDULE_ID_PATTERN,'description':a37_0x5a482e(0x15e)}},LIMIT_FLAG={'name':a37_0x5a482e(0x131),'type':a37_0x5a482e(0x16c),'default':0x14,'description':a37_0x5a482e(0x13b)},CURSOR_FLAG={'name':a37_0x5a482e(0x169),'type':a37_0x5a482e(0x142),'description':'Opaque\x20nextCursor\x20returned\x20by\x20the\x20previous\x20list\x20call'},INPUT_FLAGS=[KIND_FLAG,CRON_FLAG,SCHEDULED_AT_FLAG,TITLE_FLAG,PROMPT_FLAG,CHANNEL_FLAG];function readScheduleInput(_0x1d6bed){const _0x40cddb=a37_0x5a482e,_0x4b2c13=_0x1d6bed[_0x40cddb(0x16f)](_0x40cddb(0x146)),_0x4f9e54=_0x1d6bed[_0x40cddb(0x16f)]('title')[_0x40cddb(0x138)](),_0x21d5ba=_0x1d6bed[_0x40cddb(0x16f)]('prompt')[_0x40cddb(0x138)](),_0x461915=_0x1d6bed['str'](_0x40cddb(0x139)),_0x45a1ec=_0x1d6bed['str'](_0x40cddb(0x14b)),_0x13d793=_0x1d6bed[_0x40cddb(0x16f)]('scheduled-at');if(!_0x4f9e54)throw CliErrors[_0x40cddb(0x15a)]('--title\x20must\x20not\x20be\x20blank.');if(!_0x21d5ba)throw CliErrors[_0x40cddb(0x15a)]('--prompt\x20must\x20not\x20be\x20blank.');if(_0x4b2c13===_0x40cddb(0x12f)){if(!_0x45a1ec||_0x13d793)throw CliErrors[_0x40cddb(0x15a)](_0x40cddb(0x137));return{'kind':_0x4b2c13,'timezone':_0x40cddb(0x14d),'cron':_0x45a1ec,'title':_0x4f9e54,'prompt':_0x21d5ba,'channel':_0x461915};}if(_0x4b2c13===_0x40cddb(0x143)){if(!_0x13d793||_0x45a1ec)throw CliErrors[_0x40cddb(0x15a)](_0x40cddb(0x13e));return{'kind':_0x4b2c13,'timezone':'UTC','scheduledAt':_0x13d793,'title':_0x4f9e54,'prompt':_0x21d5ba,'channel':_0x461915};}throw CliErrors[_0x40cddb(0x15a)](_0x40cddb(0x13d));}function scheduleCollectionPath(_0x4ec018){const _0x52b209=a37_0x5a482e;return _0x52b209(0x12d)+encodeURIComponent(_0x4ec018)+_0x52b209(0x13a);}function a37_0x53a2(){const _0x1772f7=['ONCE\x20schedules\x20require\x20--scheduled-at\x20and\x20do\x20not\x20accept\x20--cron.','--limit\x20must\x20be\x20an\x20integer\x20from\x201\x20to\x20100.','num','Canonical\x20UTC\x20ISO\x20datetime\x20for\x20ONCE\x20schedules','string','ONCE','Preview:\x20create\x20an\x20Agent\x20schedule','description','kind','POST','build','14aVICOM','Preview:\x20delete\x20schedule\x20','cron','3777070itYzJf','UTC','appCode','10UaBXUA','Task\x20channel:\x20auto\x20or\x20premium','Schedule\x20title','high-risk-write','立即运行一次定时任务并创建\x20Task','length','Preview:\x20run\x20schedule\x20','Five-field\x20UTC\x20cron\x20expression\x20for\x20CRON\x20schedules','\x20immediately','run','965527BSJbWS','validation','将忽略原定触发时间,立即运行一次该定时任务并创建新的\x20Agent\x20Task。','List\x20current\x20user\x27s\x20schedules\x20for\x20the\x20current\x20app','schedule','a\x20UUID\x20returned\x20by\x20schedule\x20create/list','Prompt\x20sent\x20to\x20the\x20Agent\x20when\x20the\x20schedule\x20runs','read','创建周期性或单次执行的\x20Agent\x20定时任务','603UCOLku','Schedule\x20UUID','scheduled-at','5737300mEziip','/run','Created\x20','Validate\x20a\x20UTC\x20schedule\x20without\x20creating\x20it','cursor','taskId','body','number','删除定时任务并停止其后续触发','--cursor\x20must\x20be\x20the\x20unchanged\x20nextCursor\x20from\x20schedule\x20list.','str','4CZQgSA','2330274pfAoOz','auto','33576ODdYel','/api/harness/apps/','premium','CRON','Schedule\x20kind:\x20CRON\x20or\x20ONCE','limit','Schedule\x20input\x20is\x20valid','list','Show\x20one\x20schedule\x20by\x20schedule\x20ID','1110954EfeABH','619846AwxFve','CRON\x20schedules\x20require\x20--cron\x20and\x20do\x20not\x20accept\x20--scheduled-at.','trim','channel','/schedules','Page\x20size\x20from\x201\x20to\x20100','schedule-id','--kind\x20must\x20be\x20CRON\x20or\x20ONCE.'];a37_0x53a2=function(){return _0x1772f7;};return a37_0x53a2();}function scheduleItemPath(_0x1094d4,_0x5ee803){return scheduleCollectionPath(_0x1094d4)+'/'+encodeURIComponent(_0x5ee803);}const scheduleValidate={'service':a37_0x5a482e(0x15d),'command':'validate','description':a37_0x5a482e(0x168),'risk':a37_0x5a482e(0x160),'flags':INPUT_FLAGS,async 'validate'(_0x3ff9b8){readScheduleInput(_0x3ff9b8);},async 'execute'(_0x4553c3){const _0x660746=a37_0x5a482e,_0x370713=readScheduleInput(_0x4553c3),_0x58ceaa=await validateRuntimeSchedule(_0x4553c3[_0x660746(0x14e)],_0x370713);return{'ok':!![],'data':_0x58ceaa,'message':_0x660746(0x132)};}},scheduleCreate={'service':'schedule','command':'create','description':a37_0x5a482e(0x161),'risk':a37_0x5a482e(0x152),'confirmationDescription':'将在当前应用中创建可自动触发\x20Agent\x20的定时任务;到达设定时间后会按任务内容创建并执行\x20Task。','flags':INPUT_FLAGS,async 'validate'(_0x3022b3){readScheduleInput(_0x3022b3);},async 'execute'(_0x3182d3){const _0x8a911b=a37_0x5a482e,_0x2544b9=readScheduleInput(_0x3182d3),_0x45687a=await validateRuntimeSchedule(_0x3182d3[_0x8a911b(0x14e)],_0x2544b9),_0x5cc58b=await createRuntimeSchedule(_0x3182d3[_0x8a911b(0x14e)],_0x45687a);return{'ok':!![],'data':_0x5cc58b,'message':_0x8a911b(0x167)+_0x5cc58b[_0x8a911b(0x146)]+'\x20schedule\x20'+_0x5cc58b['scheduleId']};},async 'dryRun'(_0x18a144){const _0x4ae6d7=a37_0x5a482e,_0x5d45cf=readScheduleInput(_0x18a144);return dryRun(_0x4ae6d7(0x147),scheduleCollectionPath(_0x18a144[_0x4ae6d7(0x14e)]))[_0x4ae6d7(0x16b)](_0x5d45cf)['description'](_0x4ae6d7(0x144))[_0x4ae6d7(0x148)]();}},scheduleList={'service':'schedule','command':a37_0x5a482e(0x133),'description':a37_0x5a482e(0x15c),'risk':a37_0x5a482e(0x160),'flags':[LIMIT_FLAG,CURSOR_FLAG],async 'validate'(_0x301735){const _0x42b61b=a37_0x5a482e,_0x29278c=_0x301735[_0x42b61b(0x140)]('limit');if(!Number['isSafeInteger'](_0x29278c)||_0x29278c<0x1||_0x29278c>0x64)throw CliErrors[_0x42b61b(0x15a)](_0x42b61b(0x13f));const _0x4c2e90=_0x301735['str'](_0x42b61b(0x169));if(_0x4c2e90&&(_0x4c2e90[_0x42b61b(0x154)]>0x400||_0x4c2e90['trim']()!==_0x4c2e90))throw CliErrors['validation'](_0x42b61b(0x16e));},async 'execute'(_0x51b725){const _0x1cf486=a37_0x5a482e,_0x13d9d7=_0x51b725[_0x1cf486(0x16f)](_0x1cf486(0x169)),_0x42671f=await listRuntimeSchedules(_0x51b725[_0x1cf486(0x14e)],{'limit':_0x51b725[_0x1cf486(0x140)](_0x1cf486(0x131)),..._0x13d9d7?{'cursor':_0x13d9d7}:{}});return{'ok':!![],'data':_0x42671f};}},scheduleDetail={'service':'schedule','command':'detail','description':a37_0x5a482e(0x134),'risk':'read','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x1382fd){const _0x1ade7f=a37_0x5a482e,_0x5d98e3=await getRuntimeSchedule(_0x1382fd[_0x1ade7f(0x14e)],_0x1382fd[_0x1ade7f(0x16f)](_0x1ade7f(0x13c)));return{'ok':!![],'data':_0x5d98e3};}},scheduleRun={'service':a37_0x5a482e(0x15d),'command':a37_0x5a482e(0x158),'description':a37_0x5a482e(0x153),'risk':'high-risk-write','confirmationDescription':a37_0x5a482e(0x15b),'flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x3e6146){const _0x5a25b9=a37_0x5a482e,_0x555bbd=_0x3e6146['str'](_0x5a25b9(0x13c)),_0x38be76=await runRuntimeSchedule(_0x3e6146[_0x5a25b9(0x14e)],_0x555bbd);return{'ok':!![],'data':_0x38be76,'message':'Queued\x20Task\x20'+_0x38be76[_0x5a25b9(0x16a)]+'\x20from\x20schedule\x20'+_0x555bbd};},async 'dryRun'(_0x427295){const _0x4c0a61=a37_0x5a482e,_0x2d057f=_0x427295['str'](_0x4c0a61(0x13c));return dryRun('POST',scheduleItemPath(_0x427295[_0x4c0a61(0x14e)],_0x2d057f)+_0x4c0a61(0x166))['description'](_0x4c0a61(0x155)+_0x2d057f+_0x4c0a61(0x157))['build']();}},scheduleDelete={'service':a37_0x5a482e(0x15d),'command':'delete','description':a37_0x5a482e(0x16d),'risk':'high-risk-write','confirmationDescription':'将永久删除该定时任务并停止后续自动触发;已经创建的历史\x20Task\x20不受影响。','flags':[SCHEDULE_ID_FLAG],async 'execute'(_0x14e0fd){const _0x84b05e=a37_0x5a482e,_0x7acd1=_0x14e0fd[_0x84b05e(0x16f)](_0x84b05e(0x13c)),_0x2685fc=await deleteRuntimeSchedule(_0x14e0fd[_0x84b05e(0x14e)],_0x7acd1);return{'ok':!![],'data':_0x2685fc,'message':'Deleted\x20schedule\x20'+_0x7acd1};},async 'dryRun'(_0xe79d41){const _0x4f7cf8=a37_0x5a482e,_0x2604ba=_0xe79d41[_0x4f7cf8(0x16f)](_0x4f7cf8(0x13c));return dryRun('DELETE',scheduleItemPath(_0xe79d41[_0x4f7cf8(0x14e)],_0x2604ba))[_0x4f7cf8(0x145)](_0x4f7cf8(0x14a)+_0x2604ba)[_0x4f7cf8(0x148)]();}};export const scheduleDefinitions=[scheduleValidate,scheduleCreate,scheduleList,scheduleDetail,scheduleRun,scheduleDelete];
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a38_0x234c33=a38_0x690c;function a38_0x690c(_0x520730,_0x5ea89b){_0x520730=_0x520730-0x146;const _0x205e98=a38_0x205e();let _0x690cdf=_0x205e98[_0x520730];return _0x690cdf;}function a38_0x205e(){const _0x55e346=['18WaFYtE','71921DsaHZi','4uHDirX','270318TTzwJV','Export\x20machine-readable\x20command\x20schema\x20(JSON)','12GiXvft','1985886lLRaOn','read','283688qJbqdm','5351360RhTJBw','1365156qewtJG','schema','966804jKtqKP','110YHwJbn','export','5FoQfeL'];a38_0x205e=function(){return _0x55e346;};return a38_0x205e();}(function(_0x118161,_0x35c971){const _0x46c2ce=a38_0x690c,_0x213338=_0x118161();while(!![]){try{const _0xf95445=-parseInt(_0x46c2ce(0x14b))/0x1+-parseInt(_0x46c2ce(0x14c))/0x2*(parseInt(_0x46c2ce(0x14d))/0x3)+parseInt(_0x46c2ce(0x154))/0x4*(parseInt(_0x46c2ce(0x149))/0x5)+-parseInt(_0x46c2ce(0x14f))/0x6*(-parseInt(_0x46c2ce(0x150))/0x7)+-parseInt(_0x46c2ce(0x152))/0x8*(parseInt(_0x46c2ce(0x14a))/0x9)+parseInt(_0x46c2ce(0x153))/0xa+parseInt(_0x46c2ce(0x147))/0xb*(-parseInt(_0x46c2ce(0x146))/0xc);if(_0xf95445===_0x35c971)break;else _0x213338['push'](_0x213338['shift']());}catch(_0x2c8ea5){_0x213338['push'](_0x213338['shift']());}}}(a38_0x205e,0x4ced8));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2986ec){const _0x1507dd=await buildSchemaPayload();return{'ok':!![],'data':_0x1507dd};}export const schemaDefinition={'service':a38_0x234c33(0x155),'command':a38_0x234c33(0x148),'description':a38_0x234c33(0x14e),'risk':a38_0x234c33(0x151),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|