@lovrabet/lovrabet-cli 2.1.9-beta.2 → 2.1.9-beta.3
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/NOTICE +5 -0
- package/README.md +156 -0
- 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/app-config/shared.js +1 -1
- package/lib/commands/artifact/index.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/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/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 +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4bb997,_0x35cad3){const _0x259743=a26_0x16f8,_0x586c9c=_0x4bb997();while(!![]){try{const _0x511fd6=-parseInt(_0x259743(0xca))/0x1+-parseInt(_0x259743(0xcb))/0x2+-parseInt(_0x259743(0xd2))/0x3+parseInt(_0x259743(0xd1))/0x4*(-parseInt(_0x259743(0xcf))/0x5)+parseInt(_0x259743(0xcc))/0x6+parseInt(_0x259743(0xcd))/0x7+-parseInt(_0x259743(0xce))/0x8*(-parseInt(_0x259743(0xd0))/0x9);if(_0x511fd6===_0x35cad3)break;else _0x586c9c['push'](_0x586c9c['shift']());}catch(_0x454c22){_0x586c9c['push'](_0x586c9c['shift']());}}}(a26_0x58fa,0xcadd4));function a26_0x16f8(_0x2d8d52,_0x85f163){_0x2d8d52=_0x2d8d52-0xca;const _0x58fa8a=a26_0x58fa();let _0x16f84d=_0x58fa8a[_0x2d8d52];return _0x16f84d;}import{datasetList}from'../../commands/dataset/list.js';import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetSdkDoc}from'../../commands/dataset/sdk-doc.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetSdkDoc];function a26_0x58fa(){const _0x4a3500=['710536rdxENg','5697490lHJNky','279NJqaKJ','4eMuvim','1666164HaCXwt','1291344auHejZ','767154rsBVZG','8043078EoigMQ','748293ZsxeVC'];a26_0x58fa=function(){return _0x4a3500;};return a26_0x58fa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x2a8afc=a27_0x1667;(function(_0xe3b76f,_0x52c1c3){const _0x3aee64=a27_0x1667,_0x458406=_0xe3b76f();while(!![]){try{const _0x1ea177=parseInt(_0x3aee64(0x1e2))/0x1*(parseInt(_0x3aee64(0x1eb))/0x2)+parseInt(_0x3aee64(0x1e1))/0x3+parseInt(_0x3aee64(0x1f2))/0x4+-parseInt(_0x3aee64(0x1e4))/0x5*(parseInt(_0x3aee64(0x1d9))/0x6)+-parseInt(_0x3aee64(0x1d7))/0x7+parseInt(_0x3aee64(0x1ef))/0x8+parseInt(_0x3aee64(0x1ee))/0x9;if(_0x1ea177===_0x52c1c3)break;else _0x458406['push'](_0x458406['shift']());}catch(_0x1f5dec){_0x458406['push'](_0x458406['shift']());}}}(a27_0x25bf,0x8ecee));import{listDatasets}from'../../core/api-client.js';function a27_0x25bf(){const _0x1b2485=['tableName','map','2353756oFbfoo','dbtableConfig','appCode','Filter\x20by\x20dataset\x20code\x20(server-side\x20exact\x20match)','174797CwemVO','split','771990ZNjidD','code','trim','str','description','string','length','List\x20datasets\x20in\x20the\x20app\x20(supports\x20server-side\x20name/code\x20filtering)','194238zmCnYg','217sffwGP','allFields','35axgAGS','read','name','list','Filter\x20by\x20dataset\x20name\x20(server-side\x20fuzzy\x20match)','pkField','datasetKey','1858fzcBLd','source','dataset','2832363mbeAEI','2728664YTkoVi'];a27_0x25bf=function(){return _0x1b2485;};return a27_0x25bf();}import{CODE_FLAG}from'../../commands/common/flags.js';function a27_0x1667(_0x48cb9c,_0x483e10){_0x48cb9c=_0x48cb9c-0x1d5;const _0x25bf97=a27_0x25bf();let _0x16676b=_0x25bf97[_0x48cb9c];return _0x16676b;}export const datasetList={'service':a27_0x2a8afc(0x1ed),'command':a27_0x2a8afc(0x1e7),'description':a27_0x2a8afc(0x1e0),'risk':a27_0x2a8afc(0x1e5),'flags':[{'name':a27_0x2a8afc(0x1e6),'type':a27_0x2a8afc(0x1de),'description':a27_0x2a8afc(0x1e8)},{...CODE_FLAG,'required':![],'description':a27_0x2a8afc(0x1d6)}],async 'execute'(_0x381be1){const _0x26b031=a27_0x2a8afc,_0x38df19=_0x381be1[_0x26b031(0x1dc)](_0x26b031(0x1e6)),_0xe0af7e=_0x381be1[_0x26b031(0x1dc)](_0x26b031(0x1da)),_0x3a0a57=await listDatasets(_0x381be1[_0x26b031(0x1d5)],{..._0x38df19&&{'name':_0x38df19},..._0xe0af7e&&{'code':_0xe0af7e}});return{'ok':!![],'data':{'total':_0x3a0a57[_0x26b031(0x1df)],'datasets':_0x3a0a57[_0x26b031(0x1f1)](_0x1a25b4=>{const _0x1baddd=_0x26b031,_0x9a237c=_0x1a25b4[_0x1baddd(0x1f3)]??{};return{'id':_0x1a25b4['id'],'code':_0x1a25b4[_0x1baddd(0x1da)],'name':_0x1a25b4['name'],'source':_0x1a25b4[_0x1baddd(0x1ec)],'description':_0x1a25b4[_0x1baddd(0x1dd)],'table':_0x9a237c[_0x1baddd(0x1f0)],'datasetKey':_0x9a237c[_0x1baddd(0x1ea)],'pk':_0x9a237c[_0x1baddd(0x1e9)],'fields':_0x9a237c[_0x1baddd(0x1e3)]?_0x9a237c[_0x1baddd(0x1e3)][_0x1baddd(0x1d8)](',')[_0x1baddd(0x1f1)](_0x2c3858=>_0x2c3858[_0x1baddd(0x1db)]()):[]};})}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a28_0x1b3a(){const _0x1295f1=['92464ihaorF','string','4277510mMBxVl','sdk-doc','204808hXdQLo','#\x20Dataset\x20SDK\x20Usage\x20Documentation\x0a\x0a暂无\x20SDK\x20使用文档','9132112FHOrBn','1WZwCzv','7ojojZC','code','237483smvyEU','dataset','Dataset\x20code\x20(32\x20characters).\x20Numeric\x20dataset\x20IDs\x20are\x20not\x20accepted.','7017448xMAarR','6193434VcTLsh','18mZeoXH','310ChONtH','trim','appCode'];a28_0x1b3a=function(){return _0x1295f1;};return a28_0x1b3a();}const a28_0x3c104d=a28_0x6390;(function(_0x5b54db,_0x3471ad){const _0x656ed8=a28_0x6390,_0x3c8f2e=_0x5b54db();while(!![]){try{const _0x396f13=parseInt(_0x656ed8(0xc9))/0x1*(-parseInt(_0x656ed8(0xd5))/0x2)+-parseInt(_0x656ed8(0xd1))/0x3*(parseInt(_0x656ed8(0xd9))/0x4)+parseInt(_0x656ed8(0xd7))/0x5+parseInt(_0x656ed8(0xd0))/0x6+parseInt(_0x656ed8(0xca))/0x7*(-parseInt(_0x656ed8(0xcf))/0x8)+parseInt(_0x656ed8(0xcc))/0x9*(-parseInt(_0x656ed8(0xd2))/0xa)+parseInt(_0x656ed8(0xdb))/0xb;if(_0x396f13===_0x3471ad)break;else _0x3c8f2e['push'](_0x3c8f2e['shift']());}catch(_0x21fdb0){_0x3c8f2e['push'](_0x3c8f2e['shift']());}}}(a28_0x1b3a,0xa367f));import{getDatasetSdkUsageDoc}from'../../core/api-client.js';import{CODE_FLAG}from'../../commands/common/flags.js';const DEFAULT_MARKDOWN=a28_0x3c104d(0xda);function a28_0x6390(_0x4f36e3,_0x419942){_0x4f36e3=_0x4f36e3-0xc9;const _0x1b3ac4=a28_0x1b3a();let _0x639061=_0x1b3ac4[_0x4f36e3];return _0x639061;}export function formatDatasetSdkMarkdown(_0xcae412){const _0x166e5c=a28_0x3c104d,_0x434a10=typeof _0xcae412===_0x166e5c(0xd6)?_0xcae412[_0x166e5c(0xd3)]():'';return _0x434a10||DEFAULT_MARKDOWN;}export const datasetSdkDoc={'service':a28_0x3c104d(0xcd),'command':a28_0x3c104d(0xd8),'description':'Get\x20SDK\x20usage\x20markdown\x20for\x20a\x20dataset\x20code','risk':'read','flags':[{...CODE_FLAG,'description':a28_0x3c104d(0xce)}],async 'execute'(_0x408c3){const _0x37d258=a28_0x3c104d,_0x16c186=_0x408c3['str'](_0x37d258(0xcb)),_0x45056e=await getDatasetSdkUsageDoc(_0x16c186,_0x408c3[_0x37d258(0xd4)]);return{'ok':!![],'data':{'code':_0x16c186,'appCode':_0x408c3[_0x37d258(0xd4)],'markdown':formatDatasetSdkMarkdown(_0x45056e)}};}};
|
package/lib/commands/doctor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a29_0x401939=a29_0x4899;(function(_0x265f06,_0x1c7551){const _0x1cea1b=a29_0x4899,_0x2e329f=_0x265f06();while(!![]){try{const _0x1b9c04=parseInt(_0x1cea1b(0xd8))/0x1*(parseInt(_0x1cea1b(0xeb))/0x2)+parseInt(_0x1cea1b(0xd5))/0x3+-parseInt(_0x1cea1b(0x10d))/0x4*(parseInt(_0x1cea1b(0xbd))/0x5)+parseInt(_0x1cea1b(0xf6))/0x6+-parseInt(_0x1cea1b(0x101))/0x7*(-parseInt(_0x1cea1b(0xe3))/0x8)+-parseInt(_0x1cea1b(0xe8))/0x9*(-parseInt(_0x1cea1b(0xfd))/0xa)+-parseInt(_0x1cea1b(0xb7))/0xb;if(_0x1b9c04===_0x1c7551)break;else _0x2e329f['push'](_0x2e329f['shift']());}catch(_0x3ee628){_0x2e329f['push'](_0x2e329f['shift']());}}}(a29_0x2dd2,0x57ad6));import a29_0x9d9620 from'chalk';import{CLI_BIN_NAME}from'../constant/cli.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{getCliVersion}from'../utils/version.js';import{getApiDomain,getRuntimeDomain,getUserDomain}from'../constant/domain.js';import{buildConfigFromFlags,initGlobalEnvironment,getProjectConfigPath,getGlobalConfigPath,inspectCliConfigJsonFile}from'../context.js';import{AUTH_MODE}from'../constant/auth-mode.js';import{isLegacyCompatConfigKey}from'../config/schema.js';import{inspectServiceRegistry}from'../commands/service/registry.js';function a29_0x4899(_0x583675,_0x58abc3){_0x583675=_0x583675-0xb7;const _0x2dd26d=a29_0x2dd2();let _0x4899b3=_0x2dd26d[_0x583675];return _0x4899b3;}async function execute(_0x5a5223){const _0x167137=a29_0x4899,_0x3bd66c=getCliVersion(),_0x3b5fde=buildConfigFromFlags({});await initGlobalEnvironment(_0x3b5fde),console[_0x167137(0x10c)](),console[_0x167137(0x10c)](a29_0x9d9620['bold'](CLI_BIN_NAME+_0x167137(0xcf))),console[_0x167137(0x10c)](a29_0x9d9620['gray']('─'[_0x167137(0xfe)](0x32))),console[_0x167137(0x10c)](_0x167137(0xc5)+_0x3bd66c),console['log'](_0x167137(0xcc)+process[_0x167137(0xd1)]),console[_0x167137(0x10c)](_0x167137(0x104)+process[_0x167137(0xdd)]+'\x20'+process[_0x167137(0xca)]),console[_0x167137(0x10c)](),console['log'](a29_0x9d9620[_0x167137(0xdc)](_0x167137(0xc2))),console['log'](a29_0x9d9620['gray'](_0x167137(0xe9)[_0x167137(0xfe)](0x1e)));const _0xf169fe=getGlobalConfigPath(),_0x330ff6=getProjectConfigPath();console['log'](_0x167137(0xe2)+(_0xf169fe||a29_0x9d9620['gray'](_0x167137(0xdf)))),console[_0x167137(0x10c)](_0x167137(0xbc)+(_0x330ff6||a29_0x9d9620[_0x167137(0x106)](_0x167137(0xdf)))),console['log'](),console[_0x167137(0x10c)](a29_0x9d9620['bold'](_0x167137(0xf9))),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0x106)](_0x167137(0xe9)[_0x167137(0xfe)](0x1e)));const _0xbfce9f=(_0x18d566,_0x2f7252)=>{const _0x4d0d12=_0x167137;if(!_0x2f7252){console[_0x4d0d12(0x10c)]('\x20\x20'+_0x18d566[_0x4d0d12(0xc0)](0x11)+'\x20'+a29_0x9d9620[_0x4d0d12(0x106)](_0x4d0d12(0xe1)));return;}const _0x3fd4c6=inspectCliConfigJsonFile(_0x2f7252);if(_0x3fd4c6[_0x4d0d12(0xf0)]==='ok')console[_0x4d0d12(0x10c)]('\x20\x20'+_0x18d566['padEnd'](0x11)+'\x20'+a29_0x9d9620[_0x4d0d12(0xc7)](_0x4d0d12(0x10a)));else{if(_0x3fd4c6[_0x4d0d12(0xf0)]===_0x4d0d12(0xd3))console[_0x4d0d12(0x10c)]('\x20\x20'+_0x18d566[_0x4d0d12(0xc0)](0x11)+'\x20'+a29_0x9d9620[_0x4d0d12(0xf2)](_0x4d0d12(0xe5)));else _0x3fd4c6[_0x4d0d12(0xf0)]===_0x4d0d12(0xbb)?console[_0x4d0d12(0x10c)]('\x20\x20'+_0x18d566[_0x4d0d12(0xc0)](0x11)+'\x20'+a29_0x9d9620[_0x4d0d12(0x106)](_0x4d0d12(0xfa))):(console[_0x4d0d12(0x10c)]('\x20\x20'+_0x18d566[_0x4d0d12(0xc0)](0x11)+'\x20'+a29_0x9d9620['red'](_0x4d0d12(0xe0))),console['log']('\x20\x20'+''[_0x4d0d12(0xc0)](0x11)+'\x20'+a29_0x9d9620['red'](_0x3fd4c6[_0x4d0d12(0x105)])));}};_0xbfce9f(_0x167137(0x102),_0xf169fe),_0xbfce9f('Project',_0x330ff6),console[_0x167137(0x10c)](),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0xdc)](_0x167137(0xdb))),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0x106)](_0x167137(0xe9)[_0x167137(0xfe)](0x1e))),console[_0x167137(0x10c)](_0x167137(0xb9)+(_0x3b5fde['appCode']||a29_0x9d9620[_0x167137(0xd0)](_0x167137(0x109)))),console['log']('\x20\x20env:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+_0x3b5fde[_0x167137(0xea)]);const _0x26425f=isLegacyCompatConfigKey('locale')?a29_0x9d9620[_0x167137(0x106)](_0x3b5fde[_0x167137(0xba)]+'\x20(legacy/compat\x20only)'):_0x3b5fde[_0x167137(0xba)];console[_0x167137(0x10c)](_0x167137(0xd9)+_0x26425f),console[_0x167137(0x10c)](_0x167137(0xcb)+(_0x3b5fde['defaultApp']||a29_0x9d9620[_0x167137(0x106)]('(none)'))),console[_0x167137(0x10c)]('\x20\x20currentApp:\x20\x20\x20\x20\x20\x20'+(_0x3b5fde[_0x167137(0x10f)]||a29_0x9d9620[_0x167137(0x106)]('(none)'))),console[_0x167137(0x10c)]('\x20\x20format:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'+(_0x3b5fde[_0x167137(0xef)]||a29_0x9d9620[_0x167137(0x106)](_0x167137(0xbf)+DEFAULT_CONFIG_VALUES[_0x167137(0xef)]+')'))),console['log'](_0x167137(0xff)+(_0x3b5fde[_0x167137(0xd4)]??a29_0x9d9620[_0x167137(0x106)](_0x167137(0xc3)))),console[_0x167137(0x10c)]('\x20\x20riskLevel:\x20\x20\x20\x20\x20\x20\x20'+_0x3b5fde['riskLevel']),console[_0x167137(0x10c)](_0x167137(0xe4)+_0x3b5fde[_0x167137(0x10b)]),console[_0x167137(0x10c)](_0x167137(0x103)+AUTH_MODE[_0x167137(0xda)]),console['log'](_0x167137(0x100)+(_0x3b5fde['accessKey']?a29_0x9d9620[_0x167137(0xc7)]('(set,\x20length='+_0x3b5fde[_0x167137(0xe6)][_0x167137(0xf7)]+')'):a29_0x9d9620[_0x167137(0x106)](_0x167137(0xf5)))),console[_0x167137(0x10c)](),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0xdc)](_0x167137(0xc8))),console['log'](a29_0x9d9620[_0x167137(0x106)](_0x167137(0xe9)[_0x167137(0xfe)](0x1e))),console[_0x167137(0x10c)]('\x20\x20apiDomain:\x20\x20\x20\x20\x20\x20\x20'+getApiDomain()),console[_0x167137(0x10c)](_0x167137(0xf1)+getUserDomain()),console[_0x167137(0x10c)](_0x167137(0x108)+getRuntimeDomain()),console[_0x167137(0x10c)](),console[_0x167137(0x10c)](a29_0x9d9620['bold'](_0x167137(0xb8))),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0x106)](_0x167137(0xe9)[_0x167137(0xfe)](0x1e)));const _0x5670fb=inspectServiceRegistry();console[_0x167137(0x10c)](_0x167137(0xfb)+_0x5670fb[_0x167137(0xc9)]),console[_0x167137(0x10c)](_0x167137(0xd2)+formatServiceRegistryStatus(_0x5670fb)),console['log'](_0x167137(0xcd)+_0x5670fb[_0x167137(0xc1)]),console[_0x167137(0x10c)](_0x167137(0xed)+_0x5670fb['commandCount']);for(const _0x5e3eaf of _0x5670fb[_0x167137(0xe7)]){console[_0x167137(0x10c)]('\x20\x20'+(_0x5e3eaf[_0x167137(0xc4)]+':')[_0x167137(0xc0)](0x11)+'\x20'+(_0x5e3eaf['name']||a29_0x9d9620[_0x167137(0x106)]('(unnamed)'))+'\x20('+_0x5e3eaf[_0x167137(0xee)]+_0x167137(0x107)),console[_0x167137(0x10c)]('\x20\x20'+''[_0x167137(0xc0)](0x11)+_0x167137(0xd6)+_0x5e3eaf[_0x167137(0xce)][_0x167137(0xec)]);}return console['log'](),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0xdc)](_0x167137(0x10e))),console[_0x167137(0x10c)](a29_0x9d9620[_0x167137(0x106)](_0x167137(0xe9)[_0x167137(0xfe)](0x1e))),console['log'](_0x167137(0xfc)+a29_0x9d9620[_0x167137(0xc7)](AUTH_MODE[_0x167137(0xda)]+'\x20(accessKey)')),console[_0x167137(0x10c)](_0x167137(0xf8)+a29_0x9d9620[_0x167137(0x106)](_0x167137(0xf3))),console['log'](),{'ok':!![]};}function a29_0x2dd2(){const _0x1a9396=['empty','pageSize','526542VWXCmM','\x20Imported\x20from:\x20','⚠\x20Empty','1tNrHBH','\x20\x20locale:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','ClientAk','\x20\x20Merged\x20Config','bold','platform','✗\x20Invalid','(not\x20found)','✗\x20Invalid\x20JSON','(no\x20file)','\x20\x20Global:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','5545712lMpkyD','\x20\x20verbose:\x20\x20\x20\x20\x20\x20\x20\x20\x20','⚠\x20Empty\x20(treated\x20as\x20{})','accessKey','services','738171isGsBO','\x20\x20─','env','14098tqpJjZ','path','\x20\x20Commands:\x20\x20\x20\x20\x20\x20\x20\x20','commandCount','format','status','\x20\x20userDomain:\x20\x20\x20\x20\x20\x20','yellow','(removed\x20—\x20cookie\x20auth\x20disabled)','doctor','(none)','1000524HJmOUq','length','\x20\x20Session\x20check:\x20\x20\x20','\x20\x20Config\x20JSON','(missing)','\x20\x20Registry:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Mode:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','80LNMgtu','repeat','\x20\x20pageSize:\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20accessKey:\x20\x20\x20\x20\x20\x20\x20','7rnZePY','Global','\x20\x20auth\x20(effective):\x20','\x20\x20Platform:\x20\x20\x20\x20\x20\x20\x20\x20','message','gray','\x20commands)','\x20\x20runtimeDomain:\x20\x20\x20','(not\x20set)','✓\x20Valid\x20JSON','verbose','log','140JuzWLH','\x20\x20Auth','currentApp','7912157LAFFvd','\x20\x20Service\x20Tree','\x20\x20appCode:\x20\x20\x20\x20\x20\x20\x20\x20\x20','locale','missing','\x20\x20Project:\x20\x20\x20\x20\x20\x20\x20\x20\x20','88610XxSpRS','Diagnose\x20CLI\x20configuration\x20and\x20environment','(default:\x20','padEnd','serviceCount','\x20\x20Config\x20Files','(default)','serviceCode','\x20\x20CLI\x20Version:\x20\x20\x20\x20\x20','read','green','\x20\x20API\x20Endpoints','registryPath','arch','\x20\x20defaultApp:\x20\x20\x20\x20\x20\x20','\x20\x20Node:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20Services:\x20\x20\x20\x20\x20\x20\x20\x20','source','\x20doctor','red','version','\x20\x20Status:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];a29_0x2dd2=function(){return _0x1a9396;};return a29_0x2dd2();}function formatServiceRegistryStatus(_0x309bc6){const _0x55d9e8=a29_0x4899;if(_0x309bc6[_0x55d9e8(0xf0)]==='ok')return a29_0x9d9620[_0x55d9e8(0xc7)]('✓\x20Loaded');if(_0x309bc6[_0x55d9e8(0xf0)]===_0x55d9e8(0xbb))return a29_0x9d9620[_0x55d9e8(0x106)]('(not\x20found)');if(_0x309bc6[_0x55d9e8(0xf0)]===_0x55d9e8(0xd3))return a29_0x9d9620[_0x55d9e8(0xf2)](_0x55d9e8(0xd7));return a29_0x9d9620[_0x55d9e8(0xd0)](_0x55d9e8(0xde)+(_0x309bc6[_0x55d9e8(0x105)]?':\x20'+_0x309bc6[_0x55d9e8(0x105)]:''));}export const doctorDefinition={'service':a29_0x401939(0xf4),'command':'check','description':a29_0x401939(0xbe),'risk':a29_0x401939(0xc6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a30_0x50a4a1=a30_0x4b42;function a30_0x4b42(_0x53d9c1,_0x143eb5){_0x53d9c1=_0x53d9c1-0x6a;const _0x2df086=a30_0x2df0();let _0x4b4258=_0x2df086[_0x53d9c1];return _0x4b4258;}(function(_0x3b420e,_0x57b063){const _0x143724=a30_0x4b42,_0x4e81dd=_0x3b420e();while(!![]){try{const _0x4fb0b5=-parseInt(_0x143724(0x70))/0x1+parseInt(_0x143724(0x76))/0x2*(parseInt(_0x143724(0x71))/0x3)+-parseInt(_0x143724(0x82))/0x4*(parseInt(_0x143724(0x89))/0x5)+-parseInt(_0x143724(0x74))/0x6+parseInt(_0x143724(0x7e))/0x7+parseInt(_0x143724(0x85))/0x8*(parseInt(_0x143724(0x79))/0x9)+parseInt(_0x143724(0x88))/0xa*(-parseInt(_0x143724(0x75))/0xb);if(_0x4fb0b5===_0x57b063)break;else _0x4e81dd['push'](_0x4e81dd['shift']());}catch(_0x4f7801){_0x4e81dd['push'](_0x4e81dd['shift']());}}}(a30_0x2df0,0x79a2d));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_0x50a4a1(0x7a),'type':a30_0x50a4a1(0x8b),'required':!![],'description':a30_0x50a4a1(0x8c)},FILEPATH_FLAG={'name':'filepath','type':a30_0x50a4a1(0x8b),'required':!![],'description':'Runtime\x20filePath\x20returned\x20by\x20file\x20upload'},DOWNLOAD_FLAG={'name':a30_0x50a4a1(0x8d),'type':'boolean','description':a30_0x50a4a1(0x80)};function a30_0x2df0(){const _0x1dc9c6=['appCode','4vkJEcr','filepath','File','8hEfNQL','Preview:\x20upload\x20','path','30RWETha','1854790TDZtJX','POST','string','Path\x20to\x20the\x20local\x20file\x20to\x20upload','download','Uploaded\x20file.','query-url','str','read','upload','write','\x20to\x20runtime\x20app\x20','765416TNTEDp','251070yPiQnF','trim','body','1006176upbpio','1059938PTTBWK','22ohQZEB','bool','build','6050394BZIjHr','file','Uploaded\x20file:\x20','description','validation','3489563QsTkeR','filePath','Return\x20a\x20download\x20URL\x20instead\x20of\x20a\x20preview\x20URL\x20when\x20supported'];a30_0x2df0=function(){return _0x1dc9c6;};return a30_0x2df0();}function requireFilePath(_0x295cc2){const _0x26b335=a30_0x50a4a1,_0xebcb7=_0x295cc2[_0x26b335(0x72)]();if(!_0xebcb7)throw CliErrors[_0x26b335(0x7d)]('filePath\x20is\x20required.');return _0xebcb7;}const fileUpload={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6d),'description':'Upload\x20a\x20local\x20file\x20to\x20the\x20current\x20runtime\x20app','risk':a30_0x50a4a1(0x6e),'flags':[FILE_FLAG],async 'dryRun'(_0x27dcca){const _0x126662=a30_0x50a4a1,_0x496279=requireRuntimeUploadFile(_0x27dcca[_0x126662(0x6b)](_0x126662(0x7a)),_0x126662(0x84));return dryRun(_0x126662(0x8a),'/client/uploadFile')[_0x126662(0x73)]({'appCode':_0x27dcca['appCode'],'multipart':{'file':_0x496279}})[_0x126662(0x7c)](_0x126662(0x86)+_0x496279[_0x126662(0x87)]+_0x126662(0x6f)+_0x27dcca[_0x126662(0x81)])[_0x126662(0x78)]();},async 'execute'(_0x43f8a0){const _0x473769=a30_0x50a4a1,_0x54b2f0=requireRuntimeUploadFile(_0x43f8a0[_0x473769(0x6b)](_0x473769(0x7a)),_0x473769(0x84)),_0x554f31=await uploadRuntimeFile(_0x43f8a0[_0x473769(0x81)],_0x54b2f0['path']);return{'ok':!![],'data':_0x554f31,'message':_0x554f31['filePath']?_0x473769(0x7b)+_0x554f31[_0x473769(0x7f)]:_0x473769(0x8e)};}},fileQueryUrl={'service':a30_0x50a4a1(0x7a),'command':a30_0x50a4a1(0x6a),'description':'Query\x20a\x20temporary\x20URL\x20for\x20an\x20uploaded\x20runtime\x20file','risk':a30_0x50a4a1(0x6c),'flags':[FILEPATH_FLAG,DOWNLOAD_FLAG],async 'execute'(_0x37dd33){const _0x429e0f=a30_0x50a4a1,_0x5f11b7=requireFilePath(_0x37dd33['str'](_0x429e0f(0x83))),_0x60ccf7=await queryRuntimeFileUrl(_0x5f11b7,{'download':_0x37dd33[_0x429e0f(0x77)]('download')});return{'ok':!![],'data':_0x60ccf7};}};export const fileDefinitions=[fileUpload,fileQueryUrl];
|
package/lib/commands/init.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x2014d5=a31_0x56d6;(function(_0x5009aa,_0x5f0794){const _0x1e5023=a31_0x56d6,_0x4e8209=_0x5009aa();while(!![]){try{const _0x2e1084=-parseInt(_0x1e5023(0x13f))/0x1*(parseInt(_0x1e5023(0x115))/0x2)+-parseInt(_0x1e5023(0x132))/0x3+parseInt(_0x1e5023(0x134))/0x4*(parseInt(_0x1e5023(0x136))/0x5)+-parseInt(_0x1e5023(0x106))/0x6+-parseInt(_0x1e5023(0x125))/0x7*(-parseInt(_0x1e5023(0x10d))/0x8)+-parseInt(_0x1e5023(0x114))/0x9*(parseInt(_0x1e5023(0x127))/0xa)+parseInt(_0x1e5023(0x141))/0xb;if(_0x2e1084===_0x5f0794)break;else _0x4e8209['push'](_0x4e8209['shift']());}catch(_0x445025){_0x4e8209['push'](_0x4e8209['shift']());}}}(a31_0x22a8,0x6d5eb));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';function a31_0x22a8(){const _0x91d382=['toLowerCase','File\x20','Source\x20file\x20not\x20found:\x20','Override\x20imported\x20default\x20appcode','[y/N]','\x20\x20config:\x20\x20','riskLevel','\x20\x20default:\x20','newConfigFileName','file','Override\x20imported\x20default\x20env','join','Imported\x20from\x20','\x22.\x20Allowed:\x20','397224TStOPy','trim','removeListener','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`.','cwd','yes','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','16WOoUHq','env','once','cancelled','User\x20aborted\x20prompt','):\x20','appcode','2069109QpORFg','526UfRKmn','AbortPrompt','Initialized\x20','apiDir','log','parse','close','string','\x20\x20env:\x20\x20\x20\x20\x20','Invalid\x20env\x20\x22','[Y/n]','object','question','defaultApp','stdout','validation','158921CcwaGU','\x20init\x20—\x20Create\x20','10BCsJrB','race','app','apps','\x0aInitialized\x20','App\x20code\x20for\x20the\x20project','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','project',')\x20instead\x20of\x20project','Usage:\x20','Skip\x20confirmation\x20when\x20overwriting','1753641Bscevr','SIGINT','24964JnaBHl','entries','490FnfUYL','Failed\x20to\x20parse\x20source\x20file:\x20','Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','message','boolean','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','Aborted.','\x20\x20appcode:\x20','stdin','491uOkwoI','global','8808140WByiEn','name','flagMissing'];a31_0x22a8=function(){return _0x91d382;};return a31_0x22a8();}import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':'appcode','type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x12c)},{'name':a31_0x2014d5(0x10e),'type':a31_0x2014d5(0x11c),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES['env']+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2014d5(0x140),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG[a31_0x2014d5(0x14c)]+a31_0x2014d5(0x12f),'default':![]},{'name':'yes','type':'boolean','description':a31_0x2014d5(0x131),'default':![]}];export const initImportFlagDefs=[{'name':'file','type':'string','description':a31_0x2014d5(0x138),'required':!![]},{'name':a31_0x2014d5(0x113),'type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x147)},{'name':a31_0x2014d5(0x10e),'type':a31_0x2014d5(0x11c),'description':a31_0x2014d5(0x14e),'enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x2014d5(0x140),'type':'boolean','description':'Write\x20to\x20global\x20(~/'+PRODUCT_CONFIG['newConfigFileName']+')\x20instead\x20of\x20project','default':![]},{'name':a31_0x2014d5(0x10b),'type':a31_0x2014d5(0x13a),'description':a31_0x2014d5(0x131),'default':![]}];export async function runInit(_0x50ffdb){const _0x2beab7=a31_0x2014d5,_0x237513=isNonInteractiveMode(_0x50ffdb),_0x3c5f5c=_0x50ffdb[_0x2beab7(0x140)]?_0x2beab7(0x140):_0x2beab7(0x12e),_0x5c3303=resolveWriteConfigPath(_0x3c5f5c);try{_0x237513?await runNonInteractive(_0x50ffdb,_0x5c3303):await runInteractive(_0x50ffdb,_0x5c3303);}catch(_0x243426){if(_0x243426 instanceof AbortPrompt)throw CliErrors[_0x2beab7(0x110)]();throw _0x243426;}}export async function runInitImport(_0x1031a9){const _0x53487c=a31_0x2014d5,_0x17ecd9=_0x1031a9[_0x53487c(0x140)]?_0x53487c(0x140):_0x53487c(0x12e),_0x394f4e=resolveWriteConfigPath(_0x17ecd9);await runFromImport(_0x1031a9,_0x394f4e);}const RUNTIME_IRRELEVANT_KEYS=new Set([a31_0x2014d5(0x118)]);async function runFromImport(_0x20a80c,_0x1f39cd){const _0x17bf8=a31_0x2014d5,_0x2361ce=resolveFilePath(_0x20a80c[_0x17bf8(0x14d)]);if(!existsSync(_0x2361ce))throw CliErrors[_0x17bf8(0x124)](_0x17bf8(0x146)+_0x2361ce);const _0x178a82=readSourceFile(_0x2361ce),_0x2c9ca2=convertToRuntimeConfig(_0x178a82);_0x20a80c[_0x17bf8(0x113)]&&(_0x2c9ca2[_0x17bf8(0x113)]=String(_0x20a80c['appcode']));_0x20a80c[_0x17bf8(0x10e)]&&(_0x2c9ca2[_0x17bf8(0x10e)]=resolveInitEnv(_0x20a80c));if(!_0x2c9ca2[_0x17bf8(0x113)])throw CliErrors['validation']('Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.',_0x17bf8(0x109));await writeInitConfig(_0x1f39cd,_0x2c9ca2,_0x20a80c),console[_0x17bf8(0x119)](_0x17bf8(0x104)+_0x2361ce),console[_0x17bf8(0x119)](_0x17bf8(0x149)+_0x1f39cd),console['log'](_0x17bf8(0x13d)+_0x2c9ca2[_0x17bf8(0x113)]);if(_0x2c9ca2[_0x17bf8(0x122)])console['log'](_0x17bf8(0x14b)+_0x2c9ca2[_0x17bf8(0x122)]);}function convertToRuntimeConfig(_0x344fe8){const _0x43d633=a31_0x2014d5;if(_0x344fe8[_0x43d633(0x12a)]&&typeof _0x344fe8['apps']===_0x43d633(0x120))throw CliErrors[_0x43d633(0x124)](_0x43d633(0x12d),_0x43d633(0x13b));const _0x3a5da9={};for(const _0xdd9095 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x344fe8[_0xdd9095]!==undefined&&(_0x3a5da9[_0xdd9095]=_0x344fe8[_0xdd9095]);}return!_0x3a5da9[_0x43d633(0x14a)]&&(_0x3a5da9[_0x43d633(0x14a)]=DEFAULT_CONFIG_VALUES[_0x43d633(0x14a)]),_0x3a5da9;}async function runNonInteractive(_0x3c1363,_0x49d808){const _0x5357b9=a31_0x2014d5,_0x1480f3=_0x3c1363['appcode'];if(!_0x1480f3)throw CliErrors[_0x5357b9(0x143)](_0x5357b9(0x113),_0x5357b9(0x130)+CLI_BIN_NAME+_0x5357b9(0x10c));const _0x3acb4c=resolveInitEnv(_0x3c1363);await writeInitConfig(_0x49d808,{'appcode':_0x1480f3,'env':_0x3acb4c},_0x3c1363),console['log'](_0x5357b9(0x117)+_0x49d808),console[_0x5357b9(0x119)](_0x5357b9(0x13d)+_0x1480f3),console['log'](_0x5357b9(0x11d)+_0x3acb4c);}async function runInteractive(_0x21efd8,_0x3a9343){const _0x1c957d=a31_0x2014d5,_0xbd3605=loadExisting(_0x3a9343),_0x3eb9a3=typeof _0xbd3605?.['appcode']==='string'?_0xbd3605[_0x1c957d(0x113)]:'',_0xf10c70=resolveInitEnv(_0x21efd8);console['log'](CLI_BIN_NAME+_0x1c957d(0x126)+PRODUCT_CONFIG[_0x1c957d(0x14c)]+'\x0a');if(existsSync(_0x3a9343)&&!_0x21efd8[_0x1c957d(0x10b)]){const _0x19ade0=await promptYesNo(_0x1c957d(0x145)+_0x3a9343+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x19ade0){console[_0x1c957d(0x119)](_0x1c957d(0x13c));return;}}const _0x5bf381=typeof _0x21efd8[_0x1c957d(0x113)]==='string'?_0x21efd8[_0x1c957d(0x113)][_0x1c957d(0x107)]():'';let _0x269a15=_0x5bf381;!_0x269a15&&(_0x269a15=await promptInput('App\x20code',_0x3eb9a3));if(!_0x269a15[_0x1c957d(0x107)]())throw CliErrors[_0x1c957d(0x124)]('App\x20code\x20cannot\x20be\x20empty.');await writeInitConfig(_0x3a9343,{'appcode':_0x269a15['trim'](),'env':_0xf10c70},_0x21efd8),console[_0x1c957d(0x119)](_0x1c957d(0x12b)+_0x3a9343),console[_0x1c957d(0x119)](_0x1c957d(0x13d)+_0x269a15[_0x1c957d(0x107)]()),console[_0x1c957d(0x119)](_0x1c957d(0x11d)+_0xf10c70);}async function writeInitConfig(_0x10e7d4,_0x512475,_0x1b4faf){const _0x5d3765=a31_0x2014d5;let _0x5dd7ac={};existsSync(_0x10e7d4)&&!_0x1b4faf['yes']&&(_0x5dd7ac=readConfigFile(_0x10e7d4));for(const [_0x362ee6,_0x142bb3]of Object[_0x5d3765(0x135)](_0x512475)){_0x142bb3!==undefined&&(_0x5dd7ac[_0x362ee6]=_0x142bb3);}if(_0x5dd7ac[_0x5d3765(0x129)])delete _0x5dd7ac[_0x5d3765(0x129)];writeConfigFile(_0x10e7d4,_0x5dd7ac);}class AbortPrompt extends Error{constructor(){const _0x20b2c9=a31_0x2014d5;super(_0x20b2c9(0x111)),this[_0x20b2c9(0x142)]=_0x20b2c9(0x116);}}function createSafeRl(){const _0x384ec4=a31_0x2014d5,_0x28e64d=createInterface({'input':process[_0x384ec4(0x13e)],'output':process[_0x384ec4(0x123)]});let _0x3cc819;const _0x1bc2fa=new Promise((_0x425791,_0x2a0a85)=>{const _0x54d24c=_0x384ec4;_0x3cc819=()=>{const _0x198f13=a31_0x56d6;_0x3cc819&&(_0x28e64d[_0x198f13(0x108)](_0x198f13(0x133),_0x3cc819),_0x3cc819=undefined);try{_0x28e64d[_0x198f13(0x11b)]();}catch{}_0x2a0a85(new AbortPrompt());},_0x28e64d[_0x54d24c(0x10f)](_0x54d24c(0x133),_0x3cc819);}),_0x1c21f7=()=>{const _0x1e48e0=_0x384ec4;_0x3cc819&&(_0x28e64d[_0x1e48e0(0x108)](_0x1e48e0(0x133),_0x3cc819),_0x3cc819=undefined);try{_0x28e64d[_0x1e48e0(0x11b)]();}catch{}};return{'rl':_0x28e64d,'abortPromise':_0x1bc2fa,'disposeSuccess':_0x1c21f7};}async function promptInput(_0xb96c0f,_0x181e3b){const {rl:_0xbdc190,abortPromise:_0x32694e,disposeSuccess:_0x59d59b}=createSafeRl(),_0x4a2324=new Promise(_0x351153=>{const _0x3d1864=a31_0x56d6,_0x194f6b=_0x181e3b?'\x20\x20'+_0xb96c0f+'\x20('+_0x181e3b+_0x3d1864(0x112):'\x20\x20'+_0xb96c0f+':\x20';_0xbdc190[_0x3d1864(0x121)](_0x194f6b,_0x314b3e=>{_0x59d59b(),_0x351153(_0x314b3e['trim']()||_0x181e3b);});});return Promise['race']([_0x4a2324,_0x32694e]);}async function promptYesNo(_0x10e416,_0x5383e1){const _0x446702=a31_0x2014d5,{rl:_0x12884f,abortPromise:_0x527e97,disposeSuccess:_0x127972}=createSafeRl(),_0x4c8dcf=new Promise(_0x31e01c=>{const _0x158984=a31_0x56d6,_0x14dfe0=_0x5383e1?_0x158984(0x11f):_0x158984(0x148);_0x12884f[_0x158984(0x121)]('\x20\x20'+_0x10e416+'\x20'+_0x14dfe0+':\x20',_0x23c72f=>{const _0x3ffeb8=_0x158984;_0x127972();const _0x3b072f=_0x23c72f[_0x3ffeb8(0x107)]()[_0x3ffeb8(0x144)]();if(_0x3b072f==='y'||_0x3b072f===_0x3ffeb8(0x10b))_0x31e01c(!![]);else{if(_0x3b072f==='n'||_0x3b072f==='no')_0x31e01c(![]);else _0x31e01c(_0x5383e1);}});});return Promise[_0x446702(0x128)]([_0x4c8dcf,_0x527e97]);}function loadExisting(_0x3c5cd1){if(!existsSync(_0x3c5cd1))return null;return readConfigFile(_0x3c5cd1);}function a31_0x56d6(_0x2e6549,_0x275fb2){_0x2e6549=_0x2e6549-0x103;const _0x22a887=a31_0x22a8();let _0x56d6df=_0x22a887[_0x2e6549];return _0x56d6df;}function resolveFilePath(_0x8a4ff9){const _0xa61152=a31_0x2014d5;return isAbsolute(_0x8a4ff9)?_0x8a4ff9:resolve(process[_0xa61152(0x10a)](),_0x8a4ff9);}function readSourceFile(_0x101b90){const _0x1c6b36=a31_0x2014d5;try{const _0x3ef04e=readFileSync(_0x101b90,{'encoding':'utf8'});return JSON[_0x1c6b36(0x11a)](_0x3ef04e);}catch(_0x46f433){throw CliErrors[_0x1c6b36(0x124)](_0x1c6b36(0x137)+_0x46f433[_0x1c6b36(0x139)]);}}function resolveInitEnv(_0x17832){const _0x467fda=a31_0x2014d5,_0x4bccba=_0x17832['env'];if(_0x4bccba===undefined||_0x4bccba==='')return DEFAULT_CONFIG_VALUES[_0x467fda(0x10e)];if(!RUNTIME_ENV_VALUES['includes'](_0x4bccba))throw CliErrors[_0x467fda(0x124)](_0x467fda(0x11e)+_0x4bccba+_0x467fda(0x105)+RUNTIME_ENV_VALUES[_0x467fda(0x103)](',\x20'));return _0x4bccba;}
|
|
1
|
+
const a31_0x4ddddd=a31_0x579b;(function(_0x3156a7,_0x1ddc51){const _0x188162=a31_0x579b,_0x573910=_0x3156a7();while(!![]){try{const _0x7587c5=parseInt(_0x188162(0x193))/0x1*(-parseInt(_0x188162(0x1b3))/0x2)+-parseInt(_0x188162(0x185))/0x3+parseInt(_0x188162(0x188))/0x4+-parseInt(_0x188162(0x1b1))/0x5*(parseInt(_0x188162(0x18a))/0x6)+-parseInt(_0x188162(0x197))/0x7*(parseInt(_0x188162(0x1a2))/0x8)+parseInt(_0x188162(0x19f))/0x9+parseInt(_0x188162(0x194))/0xa*(parseInt(_0x188162(0x189))/0xb);if(_0x7587c5===_0x1ddc51)break;else _0x573910['push'](_0x573910['shift']());}catch(_0x9b00b8){_0x573910['push'](_0x573910['shift']());}}}(a31_0x4bc5,0x3396e));import{existsSync,readFileSync}from'node:fs';import{resolve,isAbsolute}from'node:path';import{createInterface}from'node:readline';import{CliErrors}from'../errors.js';import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RUNTIME_ENV_VALUES}from'../constant/env.js';import{IMPORTABLE_RUNTIME_CONFIG_KEYS}from'../config/schema.js';import{resolveWriteConfigPath,readConfigFile,writeConfigFile,isNonInteractiveMode}from'../context.js';import{CLI_BIN_NAME}from'../constant/cli.js';import{PRODUCT_CONFIG}from'../constant/product.js';export const initCreateFlagDefs=[{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x199)},{'name':a31_0x4ddddd(0x1b7),'type':a31_0x4ddddd(0x19e),'description':'Target\x20environment\x20(default\x20'+DEFAULT_CONFIG_VALUES[a31_0x4ddddd(0x1b7)]+')','enum':[...RUNTIME_ENV_VALUES]},{'name':a31_0x4ddddd(0x17e),'type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':a31_0x4ddddd(0x18f),'type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export const initImportFlagDefs=[{'name':a31_0x4ddddd(0x19c),'type':'string','description':'Import\x20from\x20a\x20.rabetbase.json\x20file\x20path','required':!![]},{'name':a31_0x4ddddd(0x179),'type':a31_0x4ddddd(0x19e),'description':a31_0x4ddddd(0x1a7)},{'name':a31_0x4ddddd(0x1b7),'type':'string','description':a31_0x4ddddd(0x181),'enum':[...RUNTIME_ENV_VALUES]},{'name':'global','type':a31_0x4ddddd(0x1a5),'description':a31_0x4ddddd(0x18e)+PRODUCT_CONFIG[a31_0x4ddddd(0x190)]+a31_0x4ddddd(0x182),'default':![]},{'name':'yes','type':'boolean','description':a31_0x4ddddd(0x178),'default':![]}];export async function runInit(_0x2aa960){const _0xe99c62=a31_0x4ddddd,_0x564465=isNonInteractiveMode(_0x2aa960),_0x8f63d2=_0x2aa960[_0xe99c62(0x17e)]?_0xe99c62(0x17e):_0xe99c62(0x17c),_0x37ac28=resolveWriteConfigPath(_0x8f63d2);try{_0x564465?await runNonInteractive(_0x2aa960,_0x37ac28):await runInteractive(_0x2aa960,_0x37ac28);}catch(_0x30ebfc){if(_0x30ebfc instanceof AbortPrompt)throw CliErrors[_0xe99c62(0x17f)]();throw _0x30ebfc;}}export async function runInitImport(_0x194540){const _0x25c816=a31_0x4ddddd,_0x52e205=_0x194540[_0x25c816(0x17e)]?'global':_0x25c816(0x17c),_0x4ab9a9=resolveWriteConfigPath(_0x52e205);await runFromImport(_0x194540,_0x4ab9a9);}const RUNTIME_IRRELEVANT_KEYS=new Set(['apiDir']);async function runFromImport(_0x24b4b3,_0xb98036){const _0x200f7a=a31_0x4ddddd,_0x22bdd9=resolveFilePath(_0x24b4b3['file']);if(!existsSync(_0x22bdd9))throw CliErrors[_0x200f7a(0x186)](_0x200f7a(0x1b4)+_0x22bdd9);const _0x2678d9=readSourceFile(_0x22bdd9),_0x3d71e8=convertToRuntimeConfig(_0x2678d9);_0x24b4b3[_0x200f7a(0x179)]&&(_0x3d71e8['appcode']=String(_0x24b4b3[_0x200f7a(0x179)]));_0x24b4b3[_0x200f7a(0x1b7)]&&(_0x3d71e8[_0x200f7a(0x1b7)]=resolveInitEnv(_0x24b4b3));if(!_0x3d71e8[_0x200f7a(0x179)])throw CliErrors['validation'](_0x200f7a(0x1a4),_0x200f7a(0x192));await writeInitConfig(_0xb98036,_0x3d71e8,_0x24b4b3),console[_0x200f7a(0x196)](_0x200f7a(0x17d)+_0x22bdd9),console[_0x200f7a(0x196)]('\x20\x20config:\x20\x20'+_0xb98036),console['log'](_0x200f7a(0x195)+_0x3d71e8[_0x200f7a(0x179)]);if(_0x3d71e8[_0x200f7a(0x1ac)])console[_0x200f7a(0x196)]('\x20\x20default:\x20'+_0x3d71e8['defaultApp']);}function convertToRuntimeConfig(_0x24177c){const _0x517c4c=a31_0x4ddddd;if(_0x24177c[_0x517c4c(0x1b0)]&&typeof _0x24177c['apps']===_0x517c4c(0x1a9))throw CliErrors['validation'](_0x517c4c(0x180),_0x517c4c(0x1b2));const _0x285a94={};for(const _0x11bfe8 of IMPORTABLE_RUNTIME_CONFIG_KEYS){_0x24177c[_0x11bfe8]!==undefined&&(_0x285a94[_0x11bfe8]=_0x24177c[_0x11bfe8]);}return!_0x285a94[_0x517c4c(0x1a3)]&&(_0x285a94[_0x517c4c(0x1a3)]=DEFAULT_CONFIG_VALUES['riskLevel']),_0x285a94;}async function runNonInteractive(_0x150b12,_0x4d8fd4){const _0x310097=a31_0x4ddddd,_0xb29c93=_0x150b12[_0x310097(0x179)];if(!_0xb29c93)throw CliErrors[_0x310097(0x183)](_0x310097(0x179),'Usage:\x20'+CLI_BIN_NAME+_0x310097(0x1ad));const _0x5905f4=resolveInitEnv(_0x150b12);await writeInitConfig(_0x4d8fd4,{'appcode':_0xb29c93,'env':_0x5905f4},_0x150b12),console[_0x310097(0x196)](_0x310097(0x1b8)+_0x4d8fd4),console[_0x310097(0x196)](_0x310097(0x195)+_0xb29c93),console[_0x310097(0x196)](_0x310097(0x1ae)+_0x5905f4);}function a31_0x579b(_0x19b575,_0x40d972){_0x19b575=_0x19b575-0x177;const _0x4bc530=a31_0x4bc5();let _0x579b31=_0x4bc530[_0x19b575];return _0x579b31;}async function runInteractive(_0x574443,_0x55bb15){const _0x268003=a31_0x4ddddd,_0x36bbfa=loadExisting(_0x55bb15),_0x2be27a=typeof _0x36bbfa?.[_0x268003(0x179)]===_0x268003(0x19e)?_0x36bbfa['appcode']:'',_0x6cc82d=resolveInitEnv(_0x574443);console['log'](CLI_BIN_NAME+_0x268003(0x18b)+PRODUCT_CONFIG[_0x268003(0x190)]+'\x0a');if(existsSync(_0x55bb15)&&!_0x574443[_0x268003(0x18f)]){const _0x2d0d9f=await promptYesNo(_0x268003(0x1a1)+_0x55bb15+'\x20already\x20exists.\x20Overwrite?',![]);if(!_0x2d0d9f){console[_0x268003(0x196)](_0x268003(0x1af));return;}}const _0xa932d7=typeof _0x574443['appcode']==='string'?_0x574443[_0x268003(0x179)][_0x268003(0x1b5)]():'';let _0x5b132f=_0xa932d7;!_0x5b132f&&(_0x5b132f=await promptInput(_0x268003(0x177),_0x2be27a));if(!_0x5b132f[_0x268003(0x1b5)]())throw CliErrors['validation'](_0x268003(0x191));await writeInitConfig(_0x55bb15,{'appcode':_0x5b132f[_0x268003(0x1b5)](),'env':_0x6cc82d},_0x574443),console[_0x268003(0x196)](_0x268003(0x187)+_0x55bb15),console[_0x268003(0x196)]('\x20\x20appcode:\x20'+_0x5b132f[_0x268003(0x1b5)]()),console[_0x268003(0x196)]('\x20\x20env:\x20\x20\x20\x20\x20'+_0x6cc82d);}async function writeInitConfig(_0x3249e5,_0x30c1d8,_0x2d6f7a){const _0x434654=a31_0x4ddddd;let _0x456ed8={};existsSync(_0x3249e5)&&!_0x2d6f7a[_0x434654(0x18f)]&&(_0x456ed8=readConfigFile(_0x3249e5));for(const [_0x2e5eac,_0x4c2251]of Object[_0x434654(0x1ab)](_0x30c1d8)){_0x4c2251!==undefined&&(_0x456ed8[_0x2e5eac]=_0x4c2251);}if(_0x456ed8[_0x434654(0x17b)])delete _0x456ed8[_0x434654(0x17b)];writeConfigFile(_0x3249e5,_0x456ed8);}class AbortPrompt extends Error{constructor(){const _0x3cccf3=a31_0x4ddddd;super(_0x3cccf3(0x18d)),this['name']=_0x3cccf3(0x198);}}function createSafeRl(){const _0x53bc7d=a31_0x4ddddd,_0x4caa0e=createInterface({'input':process[_0x53bc7d(0x19a)],'output':process['stdout']});let _0x49d7b8;const _0x4e62c0=new Promise((_0x46449e,_0x200631)=>{const _0x5c89da=_0x53bc7d;_0x49d7b8=()=>{const _0x190352=a31_0x579b;_0x49d7b8&&(_0x4caa0e[_0x190352(0x1b9)]('SIGINT',_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}_0x200631(new AbortPrompt());},_0x4caa0e['once'](_0x5c89da(0x1b6),_0x49d7b8);}),_0x33e245=()=>{const _0x1c4eb=_0x53bc7d;_0x49d7b8&&(_0x4caa0e[_0x1c4eb(0x1b9)](_0x1c4eb(0x1b6),_0x49d7b8),_0x49d7b8=undefined);try{_0x4caa0e['close']();}catch{}};return{'rl':_0x4caa0e,'abortPromise':_0x4e62c0,'disposeSuccess':_0x33e245};}async function promptInput(_0x266108,_0x229105){const _0x440cb1=a31_0x4ddddd,{rl:_0x5726ca,abortPromise:_0x4d45ce,disposeSuccess:_0x42d901}=createSafeRl(),_0x2f5287=new Promise(_0x44a5e7=>{const _0xe38b=a31_0x579b,_0x50df91=_0x229105?'\x20\x20'+_0x266108+'\x20('+_0x229105+_0xe38b(0x1ba):'\x20\x20'+_0x266108+':\x20';_0x5726ca[_0xe38b(0x1a8)](_0x50df91,_0x1c0edc=>{const _0x58ee34=_0xe38b;_0x42d901(),_0x44a5e7(_0x1c0edc[_0x58ee34(0x1b5)]()||_0x229105);});});return Promise[_0x440cb1(0x18c)]([_0x2f5287,_0x4d45ce]);}async function promptYesNo(_0x17da4f,_0x55f7e6){const _0x4a2989=a31_0x4ddddd,{rl:_0x399882,abortPromise:_0x180c2a,disposeSuccess:_0x38d39f}=createSafeRl(),_0xac70f5=new Promise(_0x51340a=>{const _0x3b06bd=a31_0x579b,_0x4f6ae5=_0x55f7e6?'[Y/n]':_0x3b06bd(0x19d);_0x399882['question']('\x20\x20'+_0x17da4f+'\x20'+_0x4f6ae5+':\x20',_0x22688c=>{const _0x15c42c=_0x3b06bd;_0x38d39f();const _0x4f6b45=_0x22688c[_0x15c42c(0x1b5)]()[_0x15c42c(0x1a6)]();if(_0x4f6b45==='y'||_0x4f6b45===_0x15c42c(0x18f))_0x51340a(!![]);else{if(_0x4f6b45==='n'||_0x4f6b45==='no')_0x51340a(![]);else _0x51340a(_0x55f7e6);}});});return Promise[_0x4a2989(0x18c)]([_0xac70f5,_0x180c2a]);}function loadExisting(_0x2ed11a){if(!existsSync(_0x2ed11a))return null;return readConfigFile(_0x2ed11a);}function a31_0x4bc5(){const _0x5d515d=['env','Initialized\x20','removeListener','):\x20','App\x20code','Skip\x20confirmation\x20when\x20overwriting','appcode','parse','app','project','Imported\x20from\x20','global','cancelled','Legacy\x20/\x20multi-app\x20.rabetbase.json\x20is\x20no\x20longer\x20supported\x20for\x20import.','Override\x20imported\x20default\x20env',')\x20instead\x20of\x20project','flagMissing','\x22.\x20Allowed:\x20','415095KvYJXr','validation','\x0aInitialized\x20','160508wsdSzW','584606ilnCIU','771246JDiZCA','\x20init\x20—\x20Create\x20','race','User\x20aborted\x20prompt','Write\x20to\x20global\x20(~/','yes','newConfigFileName','App\x20code\x20cannot\x20be\x20empty.','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`.','141gzuRYM','220yqOrts','\x20\x20appcode:\x20','log','7fwEEWN','AbortPrompt','App\x20code\x20for\x20the\x20project','stdin','cwd','file','[y/N]','string','2119401dNbiIa','Invalid\x20env\x20\x22','File\x20','2520096XzbZQO','riskLevel','Source\x20file\x20does\x20not\x20contain\x20an\x20importable\x20appcode.','boolean','toLowerCase','Override\x20imported\x20default\x20appcode','question','object','join','entries','defaultApp','\x20app\x20init\x20--appcode\x20<code>\x20[--env\x20daily]\x20[--global]','\x20\x20env:\x20\x20\x20\x20\x20','Aborted.','apps','15CrwTcx','Run\x20`rabetbase\x20project\x20upgrade`\x20first,\x20then\x20retry\x20`lovrabet\x20app\x20import`.','5596fhgOot','Source\x20file\x20not\x20found:\x20','trim','SIGINT'];a31_0x4bc5=function(){return _0x5d515d;};return a31_0x4bc5();}function resolveFilePath(_0x336b21){const _0x1ce3e2=a31_0x4ddddd;return isAbsolute(_0x336b21)?_0x336b21:resolve(process[_0x1ce3e2(0x19b)](),_0x336b21);}function readSourceFile(_0x59195c){const _0x1a5a3c=a31_0x4ddddd;try{const _0x33dad6=readFileSync(_0x59195c,{'encoding':'utf8'});return JSON[_0x1a5a3c(0x17a)](_0x33dad6);}catch(_0x21f50d){throw CliErrors[_0x1a5a3c(0x186)]('Failed\x20to\x20parse\x20source\x20file:\x20'+_0x21f50d['message']);}}function resolveInitEnv(_0x1a8502){const _0x21628b=a31_0x4ddddd,_0x57af46=_0x1a8502[_0x21628b(0x1b7)];if(_0x57af46===undefined||_0x57af46==='')return DEFAULT_CONFIG_VALUES[_0x21628b(0x1b7)];if(!RUNTIME_ENV_VALUES['includes'](_0x57af46))throw CliErrors[_0x21628b(0x186)](_0x21628b(0x1a0)+_0x57af46+_0x21628b(0x184)+RUNTIME_ENV_VALUES[_0x21628b(0x1aa)](',\x20'));return _0x57af46;}
|
package/lib/commands/kb/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x2eb38e=a32_0x30bd;(function(_0x3fb39b,_0x828fd1){const _0x1ba58e=a32_0x30bd,_0x5f8d13=_0x3fb39b();while(!![]){try{const _0x333ed3=parseInt(_0x1ba58e(0x182))/0x1*(-parseInt(_0x1ba58e(0x189))/0x2)+parseInt(_0x1ba58e(0x18d))/0x3*(parseInt(_0x1ba58e(0x172))/0x4)+parseInt(_0x1ba58e(0x187))/0x5+-parseInt(_0x1ba58e(0x191))/0x6+-parseInt(_0x1ba58e(0x169))/0x7+parseInt(_0x1ba58e(0x18c))/0x8+parseInt(_0x1ba58e(0x185))/0x9*(parseInt(_0x1ba58e(0x15a))/0xa);if(_0x333ed3===_0x828fd1)break;else _0x5f8d13['push'](_0x5f8d13['shift']());}catch(_0x466678){_0x5f8d13['push'](_0x5f8d13['shift']());}}}(a32_0x3d8b,0x603ad));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalKnowledgeBaseItem,getPersonalKnowledgeBaseItem,listPersonalKnowledgeBaseItems,searchKnowledgeBase,updatePersonalKnowledgeBaseItem}from'../../core/api-client.js';import{ID_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a32_0x3d8b(){const _0x110636=['isFile','/client/knowledge-base/personal/','length','topk','list','appCode','File\x20path\x20is\x20required.','description','530OImQwr','detail','Created\x20KB\x20entry\x20','Update\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','read','Updated\x20KB\x20entry\x20','Path\x20to\x20a\x20local\x20UTF-8\x20text\x20or\x20Markdown\x20file','string','version','ragStatus','--topk\x20must\x20be\x20a\x20positive\x20number.','bool','createTime','build','userId','4433072LRgpCu','validation','POST','metadata','map','file','title','/update','trim','4mIkYEI','number','search','scope','verbose','update','Create\x20a\x20personal\x20knowledge-base\x20entry\x20from\x20a\x20local\x20file','body','docId','create','Search\x20visible\x20company\x20and\x20personal\x20knowledge\x20base\x20content','utf8','ragErrorMessage','/client/knowledge-base/personal/create','Maximum\x20number\x20of\x20search\x20hits\x20to\x20return','str','321MDUwMV','File\x20not\x20found:\x20','Preview:\x20create\x20personal\x20knowledge-base\x20entry\x20\x22','171621YEGZPo','Show\x20one\x20personal\x20knowledge-base\x20entry\x20by\x20id','1045020igwjoa','flag','1744JzBGNo','write','Personal\x20knowledge-base\x20entry\x20ID','969480YwZCJQ','1156179yvxGbA','content','updateTime','query','2513244cbNjBy','num'];a32_0x3d8b=function(){return _0x110636;};return a32_0x3d8b();}import{dryRun}from'../../framework/dryrun.js';const TITLE_FLAG={'name':a32_0x2eb38e(0x16f),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Personal\x20knowledge-base\x20entry\x20title'},FILE_FLAG={'name':a32_0x2eb38e(0x16e),'type':a32_0x2eb38e(0x161),'required':!![],'description':a32_0x2eb38e(0x160)},QUERY_FLAG={'name':a32_0x2eb38e(0x190),'type':a32_0x2eb38e(0x161),'required':!![],'description':'Search\x20query\x20for\x20visible\x20company\x20and\x20personal\x20knowledge'},TOPK_FLAG={'name':a32_0x2eb38e(0x196),'type':a32_0x2eb38e(0x173),'description':a32_0x2eb38e(0x180)};function readKnowledgeFile(_0x354425){const _0x2e2bed=a32_0x2eb38e;if(!_0x354425)throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x158));if(!existsSync(_0x354425))throw CliErrors[_0x2e2bed(0x16a)](_0x2e2bed(0x183)+_0x354425);if(!statSync(_0x354425)[_0x2e2bed(0x193)]())throw CliErrors[_0x2e2bed(0x16a)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x354425);return readFileSync(_0x354425,_0x2e2bed(0x17d));}function a32_0x30bd(_0x3beb5b,_0x2ff78f){_0x3beb5b=_0x3beb5b-0x158;const _0x3d8beb=a32_0x3d8b();let _0x30bd74=_0x3d8beb[_0x3beb5b];return _0x30bd74;}function summarizePersonalItem(_0x263ab9){const _0x472d7e=a32_0x2eb38e;return{'id':_0x263ab9['id'],'title':_0x263ab9['title'],'version':_0x263ab9['version'],'ragStatus':_0x263ab9[_0x472d7e(0x163)],'ragErrorMessage':_0x263ab9[_0x472d7e(0x17e)],'updateTime':_0x263ab9[_0x472d7e(0x18f)]};}function detailPersonalItem(_0x4567c2){const _0x3efeeb=a32_0x2eb38e;return{'id':_0x4567c2['id'],'appCode':_0x4567c2['appCode'],'scope':_0x4567c2[_0x3efeeb(0x175)],'userId':_0x4567c2[_0x3efeeb(0x168)],'title':_0x4567c2[_0x3efeeb(0x16f)],'content':_0x4567c2[_0x3efeeb(0x18e)]??'','version':_0x4567c2[_0x3efeeb(0x162)],'ragStatus':_0x4567c2[_0x3efeeb(0x163)],'ragErrorMessage':_0x4567c2['ragErrorMessage'],'createTime':_0x4567c2[_0x3efeeb(0x166)],'updateTime':_0x4567c2['updateTime']};}function summarizeSearchHit(_0x3119a0){const _0x6a08ab=a32_0x2eb38e;return{'scope':_0x3119a0[_0x6a08ab(0x175)],'docId':_0x3119a0[_0x6a08ab(0x17a)],'score':_0x3119a0['score'],'weightedScore':_0x3119a0['weightedScore'],'content':_0x3119a0['content'],'metadata':_0x3119a0[_0x6a08ab(0x16c)]};}function readTopK(_0x2a2196){const _0x4e6c5b=a32_0x2eb38e,_0x38440c=_0x2a2196[_0x4e6c5b(0x188)](_0x4e6c5b(0x196));if(_0x38440c===undefined||_0x38440c===null||_0x38440c==='')return undefined;const _0x3592a8=_0x2a2196['num'](_0x4e6c5b(0x196));if(!Number['isFinite'](_0x3592a8)||_0x3592a8<0x1)throw CliErrors[_0x4e6c5b(0x16a)](_0x4e6c5b(0x164));return _0x3592a8;}const kbList={'service':'kb','command':a32_0x2eb38e(0x197),'description':'List\x20personal\x20knowledge-base\x20entries\x20for\x20the\x20current\x20app','risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0xe54a3a){const _0x877d3a=a32_0x2eb38e,_0x192900=await listPersonalKnowledgeBaseItems(_0xe54a3a[_0x877d3a(0x198)]);if(_0xe54a3a[_0x877d3a(0x165)](_0x877d3a(0x176)))return{'ok':!![],'data':{'total':_0x192900[_0x877d3a(0x195)],'items':_0x192900}};return{'ok':!![],'data':{'total':_0x192900['length'],'items':_0x192900[_0x877d3a(0x16d)](summarizePersonalItem)}};}},kbDetail={'service':'kb','command':a32_0x2eb38e(0x15b),'description':a32_0x2eb38e(0x186),'risk':'read','flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)}],async 'execute'(_0x3f1923){const _0x175e52=await getPersonalKnowledgeBaseItem(_0x3f1923['num']('id'),_0x3f1923['appCode']);return{'ok':!![],'data':detailPersonalItem(_0x175e52)};}},kbCreate={'service':'kb','command':a32_0x2eb38e(0x17b),'description':a32_0x2eb38e(0x178),'risk':a32_0x2eb38e(0x18a),'flags':[TITLE_FLAG,FILE_FLAG],async 'execute'(_0x538c1e){const _0x5b1c1b=a32_0x2eb38e,_0x5357b0=_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16f)),_0x151a76=readKnowledgeFile(_0x538c1e[_0x5b1c1b(0x181)](_0x5b1c1b(0x16e))),_0x42786c=await createPersonalKnowledgeBaseItem(_0x538c1e[_0x5b1c1b(0x198)],{'title':_0x5357b0,'content':_0x151a76});return{'ok':!![],'data':summarizePersonalItem(_0x42786c),'message':_0x5b1c1b(0x15c)+_0x42786c['id']+'\x20('+_0x42786c['title']+')'};},async 'dryRun'(_0x1ada76){const _0xcc9a38=a32_0x2eb38e,_0x33a2cc=_0x1ada76['str'](_0xcc9a38(0x16f)),_0x9c6e06=readKnowledgeFile(_0x1ada76['str'](_0xcc9a38(0x16e)));return dryRun(_0xcc9a38(0x16b),_0xcc9a38(0x17f))['body']({'appCode':_0x1ada76['appCode'],'title':_0x33a2cc,'content':_0x9c6e06})[_0xcc9a38(0x159)](_0xcc9a38(0x184)+_0x33a2cc+'\x22')[_0xcc9a38(0x167)]();}},kbUpdate={'service':'kb','command':a32_0x2eb38e(0x177),'description':a32_0x2eb38e(0x15d),'risk':a32_0x2eb38e(0x18a),'flags':[{...ID_FLAG,'description':a32_0x2eb38e(0x18b)},{...TITLE_FLAG,'required':![],'description':'Override\x20the\x20existing\x20entry\x20title'},FILE_FLAG],async 'execute'(_0x116e31){const _0x2aa04b=a32_0x2eb38e,_0x3186b3=_0x116e31[_0x2aa04b(0x192)]('id'),_0x5d8b73=readKnowledgeFile(_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16e))),_0x4ea52b=_0x116e31[_0x2aa04b(0x181)](_0x2aa04b(0x16f))||(await getPersonalKnowledgeBaseItem(_0x3186b3,_0x116e31[_0x2aa04b(0x198)]))[_0x2aa04b(0x16f)],_0x1b3767=await updatePersonalKnowledgeBaseItem(_0x3186b3,_0x116e31['appCode'],{'title':_0x4ea52b,'content':_0x5d8b73});return{'ok':!![],'data':summarizePersonalItem(_0x1b3767),'message':_0x2aa04b(0x15f)+_0x1b3767['id']+'\x20('+_0x1b3767[_0x2aa04b(0x16f)]+')'};},async 'dryRun'(_0x29bb86){const _0xa6721a=a32_0x2eb38e,_0x4f418a=_0x29bb86[_0xa6721a(0x192)]('id'),_0x2c85b9=readKnowledgeFile(_0x29bb86['str'](_0xa6721a(0x16e))),_0x1d6243=_0x29bb86[_0xa6721a(0x181)]('title')||(await getPersonalKnowledgeBaseItem(_0x4f418a,_0x29bb86[_0xa6721a(0x198)]))[_0xa6721a(0x16f)];return dryRun(_0xa6721a(0x16b),_0xa6721a(0x194)+_0x4f418a+_0xa6721a(0x170))[_0xa6721a(0x179)]({'appCode':_0x29bb86[_0xa6721a(0x198)],'title':_0x1d6243,'content':_0x2c85b9})[_0xa6721a(0x159)]('Preview:\x20update\x20personal\x20knowledge-base\x20entry\x20'+_0x4f418a)['build']();}},kbSearch={'service':'kb','command':a32_0x2eb38e(0x174),'description':a32_0x2eb38e(0x17c),'risk':a32_0x2eb38e(0x15e),'flags':[QUERY_FLAG,TOPK_FLAG],async 'validate'(_0x361645){const _0x297a00=a32_0x2eb38e;if(!_0x361645[_0x297a00(0x181)](_0x297a00(0x190))['trim']())throw CliErrors[_0x297a00(0x16a)]('Search\x20query\x20is\x20required.');readTopK(_0x361645);},async 'execute'(_0x2f0f09){const _0x34fea4=a32_0x2eb38e,_0x5e494c=_0x2f0f09['str'](_0x34fea4(0x190))[_0x34fea4(0x171)](),_0x1c668d=readTopK(_0x2f0f09),_0x464d97=await searchKnowledgeBase(_0x2f0f09[_0x34fea4(0x198)],{'query':_0x5e494c,'topK':_0x1c668d});return{'ok':!![],'data':{'total':_0x464d97[_0x34fea4(0x195)],'hits':_0x464d97[_0x34fea4(0x16d)](summarizeSearchHit)}};}};export const kbDefinitions=[kbList,kbDetail,kbCreate,kbUpdate,kbSearch];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a33_0x50be(_0x58f3a9,_0x3bd8f0){_0x58f3a9=_0x58f3a9-0x1e4;const _0x345cf3=a33_0x345c();let _0x50be6f=_0x345cf3[_0x58f3a9];return _0x50be6f;}const a33_0x135345=a33_0x50be;(function(_0x18c9c4,_0x28df6f){const _0xc76fd9=a33_0x50be,_0x3bac7e=_0x18c9c4();while(!![]){try{const _0x62107b=-parseInt(_0xc76fd9(0x203))/0x1*(parseInt(_0xc76fd9(0x1fd))/0x2)+parseInt(_0xc76fd9(0x1f4))/0x3*(-parseInt(_0xc76fd9(0x1f9))/0x4)+-parseInt(_0xc76fd9(0x202))/0x5*(parseInt(_0xc76fd9(0x1eb))/0x6)+-parseInt(_0xc76fd9(0x206))/0x7*(parseInt(_0xc76fd9(0x1ee))/0x8)+parseInt(_0xc76fd9(0x1ea))/0x9+parseInt(_0xc76fd9(0x1e8))/0xa*(-parseInt(_0xc76fd9(0x1f1))/0xb)+parseInt(_0xc76fd9(0x207))/0xc;if(_0x62107b===_0x28df6f)break;else _0x3bac7e['push'](_0x3bac7e['shift']());}catch(_0x5e1245){_0x3bac7e['push'](_0x3bac7e['shift']());}}}(a33_0x345c,0xe7678));import{logger}from'../../utils/logger.js';import{CLI_DISPLAY_NAME}from'../../constant/cli.js';function printLogs(_0x131a6a){const _0x3b2bf6=a33_0x50be;if(_0x131a6a['length']===0x0){console['log'](_0x3b2bf6(0x1f5));return;}console[_0x3b2bf6(0x1ed)]('*\x20'+CLI_DISPLAY_NAME+_0x3b2bf6(0x1e9)),_0x131a6a[_0x3b2bf6(0x1ff)]((_0x49cf5a,_0x2d4dbb)=>{const _0x1d6403=_0x3b2bf6,_0x1f8ca4=new Date(_0x49cf5a[_0x1d6403(0x1fe)])[_0x1d6403(0x1f7)](_0x1d6403(0x1e4)),_0x24b61=_0x49cf5a[_0x1d6403(0x205)]==='success'?'√':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1fb)?'×':_0x49cf5a[_0x1d6403(0x205)]===_0x1d6403(0x1ec)?'!':'i';console[_0x1d6403(0x1ed)](_0x2d4dbb+0x1+'.\x20'+_0x24b61+'\x20['+_0x49cf5a['command']+']\x20'+_0x49cf5a[_0x1d6403(0x1f8)]),console[_0x1d6403(0x1ed)]('\x20\x20\x20Time:\x20'+_0x1f8ca4),_0x49cf5a[_0x1d6403(0x1f2)]&&console[_0x1d6403(0x1ed)](_0x1d6403(0x1e6)+_0x49cf5a[_0x1d6403(0x1f2)]+'ms'),_0x49cf5a[_0x1d6403(0x1fc)]&&Object[_0x1d6403(0x1ef)](_0x49cf5a[_0x1d6403(0x1fc)])[_0x1d6403(0x1f6)]>0x0&&console[_0x1d6403(0x1ed)]('\x20\x20\x20Details:\x20'+JSON['stringify'](_0x49cf5a[_0x1d6403(0x1fc)],null,0x2)),console['log']('');});}function a33_0x345c(){const _0x2f842a=['614qplpIX','timestamp','forEach','show','Clear\x20command\x20history\x20logs','5MGxEqW','5567CLeHfb','View\x20command\x20history\x20logs','level','203jFmkJC','55975884gORtMz','*\x20Logs\x20cleared','en-US','read','\x20\x20\x20Duration:\x20','clearLogs','290IZMtHU','\x20logs:\x0a','12157623eQDkgQ','4677348nEPvhV','warn','log','160856HfRjjS','keys','readLogs','502953zIApvL','duration','clear','15KJhPMG','*\x20No\x20logs\x20found','length','toLocaleString','message','535980gFeBzQ','logs','error','details'];a33_0x345c=function(){return _0x2f842a;};return a33_0x345c();}export const logsDefinitions=[{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x200),'description':a33_0x135345(0x204),'risk':a33_0x135345(0x1e5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x130cd4){const _0x2327c2=a33_0x135345;return printLogs(logger[_0x2327c2(0x1f0)]()),{'ok':!![]};}},{'service':a33_0x135345(0x1fa),'command':a33_0x135345(0x1f3),'description':a33_0x135345(0x201),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x567384){const _0x1682de=a33_0x135345;return logger[_0x1682de(0x1e7)](),console['log'](_0x1682de(0x208)),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x5c90(_0xa61fc1,_0x3af61c){_0xa61fc1=_0xa61fc1-0x1a3;const _0xa13515=a34_0xa135();let _0x5c909f=_0xa13515[_0xa61fc1];return _0x5c909f;}const a34_0x45ea15=a34_0x5c90;(function(_0x5322d1,_0x2600a1){const _0x43d930=a34_0x5c90,_0x50a4dd=_0x5322d1();while(!![]){try{const _0x744bf6=-parseInt(_0x43d930(0x1a4))/0x1*(-parseInt(_0x43d930(0x1d7))/0x2)+parseInt(_0x43d930(0x1bd))/0x3*(parseInt(_0x43d930(0x1af))/0x4)+-parseInt(_0x43d930(0x1ac))/0x5+parseInt(_0x43d930(0x1b5))/0x6+parseInt(_0x43d930(0x1c7))/0x7*(parseInt(_0x43d930(0x1cd))/0x8)+parseInt(_0x43d930(0x1d9))/0x9*(-parseInt(_0x43d930(0x1c2))/0xa)+-parseInt(_0x43d930(0x1bc))/0xb;if(_0x744bf6===_0x2600a1)break;else _0x50a4dd['push'](_0x50a4dd['shift']());}catch(_0x2a1428){_0x50a4dd['push'](_0x50a4dd['shift']());}}}(a34_0xa135,0x24997));import{requireRuntimeUploadFile}from'../../commands/common/local-file.js';import{queryRuntimeFileUrl,recognizeRuntimeOcr,uploadRuntimeFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';const SUPPORTED_SCENES=[a34_0x45ea15(0x1aa),a34_0x45ea15(0x1cb),'form',a34_0x45ea15(0x1d2)],SCENE_TO_LEGACY_TYPE={'invoice':'Invoice','general':a34_0x45ea15(0x1c5),'form':'Table','idCard':a34_0x45ea15(0x1b8)},SCENE_FLAG={'name':'scene','type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a34_0x45ea15(0x1d5)},IMAGE_FILE_FLAG={'name':a34_0x45ea15(0x1ca),'type':a34_0x45ea15(0x1c0),'description':'Local\x20image\x20or\x20PDF\x20file;\x20current\x20backend\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':a34_0x45ea15(0x1a9),'type':'string','description':'Publicly\x20accessible\x20image\x20or\x20file\x20URL'};function normalizeScene(_0x5ba5cd){const _0x534660=a34_0x45ea15,_0x126281=_0x5ba5cd['trim']()[_0x534660(0x1b1)]();if(_0x126281==='idcard')return'idCard';if(_0x126281===_0x534660(0x1aa)||_0x126281===_0x534660(0x1cb)||_0x126281==='form')return _0x126281;throw CliErrors[_0x534660(0x1d6)](_0x534660(0x1a3)+_0x5ba5cd+_0x534660(0x1d1)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x389288){const _0x43abdd=a34_0x45ea15,_0x15b675=_0x389288[_0x43abdd(0x1a8)](_0x43abdd(0x1ca))[_0x43abdd(0x1c3)](),_0x4eb70d=_0x389288['str'](_0x43abdd(0x1a9))[_0x43abdd(0x1c3)]();return{'imageFile':_0x15b675,'imageUrl':_0x4eb70d,'count':[_0x15b675,_0x4eb70d][_0x43abdd(0x1be)](Boolean)[_0x43abdd(0x1a7)]};}function a34_0xa135(){const _0x1efcec=['count','Recognize\x20text\x20from\x20a\x20URL\x20or\x20local\x20file\x20using\x20the\x20runtime\x20OCR\x20service','IdCard','fileName','apiError','appCode','4487637pzUxIe','3NkHbCB','filter','scene','string','POST','10FSSoVi','trim','fileUrl','General','/client/uploadFile','2765QLbYCa','imageUrl','description','image-file','general','write','4008wVgeCv','<filePath\x20returned\x20by\x20/client/uploadFile>','/client/ocr','Preview:\x20recognize\x20','.\x20Supported\x20scenes:\x20','idCard','File\x20URL\x20response\x20missing\x20fileUrl.','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','validation','296QCjbeh','filePath','652689MPNDNi','Unsupported\x20OCR\x20scene:\x20','1282xjFZAr','File\x20upload\x20response\x20missing\x20filePath.','\x20OCR','length','str','image-url','invoice','body','676065AyvmSI','<fileUrl\x20returned\x20by\x20/client/queryFileUrl>','imageFile','991712NGQUgi','path','toLowerCase','build','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','/client/queryFileUrl','780318jFEPdn'];a34_0xa135=function(){return _0x1efcec;};return a34_0xa135();}function validateInputSelection(_0x10da91){const _0x12c9b3=a34_0x45ea15,_0x8cd523=selectedInputs(_0x10da91);if(_0x8cd523[_0x12c9b3(0x1b6)]!==0x1)throw CliErrors[_0x12c9b3(0x1d6)](_0x12c9b3(0x1b3));return _0x8cd523;}function withScene(_0xedd107,_0x13ae1c,_0x3f3ec3){const _0xec58e=a34_0x45ea15;return{..._0xedd107,'scene':_0x13ae1c,..._0x3f3ec3?{'sourceFile':{'fileName':_0x3f3ec3[_0xec58e(0x1b9)],'filePath':_0x3f3ec3[_0xec58e(0x1d8)]}}:{}};}const ocrRecognize={'service':'ocr','command':'recognize','description':a34_0x45ea15(0x1b7),'risk':a34_0x45ea15(0x1cc),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x139c1e){const _0x63f8ca=a34_0x45ea15,_0x1d7998=normalizeScene(_0x139c1e[_0x63f8ca(0x1a8)](_0x63f8ca(0x1bf))),_0x1d39f4=SCENE_TO_LEGACY_TYPE[_0x1d7998],_0x59918f=validateInputSelection(_0x139c1e);if(_0x59918f[_0x63f8ca(0x1c8)])return dryRun(_0x63f8ca(0x1c1),_0x63f8ca(0x1cf))[_0x63f8ca(0x1ab)]({'appCode':_0x139c1e[_0x63f8ca(0x1bb)],'url':_0x59918f[_0x63f8ca(0x1c8)],'type':_0x1d39f4})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d0)+_0x1d7998+'\x20OCR\x20from\x20URL')[_0x63f8ca(0x1b2)]();const _0x2cc992=requireRuntimeUploadFile(_0x59918f['imageFile'],_0x63f8ca(0x1ca));return dryRun(_0x63f8ca(0x1c1),'/client/uploadFile')['body']({'steps':[{'method':'POST','url':_0x63f8ca(0x1c6),'body':{'appCode':_0x139c1e['appCode'],'multipart':{'file':_0x2cc992}}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1b4),'body':{'filePath':_0x63f8ca(0x1ce),'downloadFlag':![]}},{'method':_0x63f8ca(0x1c1),'url':_0x63f8ca(0x1cf),'body':{'appCode':_0x139c1e['appCode'],'url':_0x63f8ca(0x1ad),'type':_0x1d39f4}}]})[_0x63f8ca(0x1c9)](_0x63f8ca(0x1d4)+_0x1d7998+_0x63f8ca(0x1a6))[_0x63f8ca(0x1b2)]();},async 'execute'(_0x365673){const _0x3026aa=a34_0x45ea15,_0x6e217f=normalizeScene(_0x365673[_0x3026aa(0x1a8)](_0x3026aa(0x1bf))),_0x462ac7=SCENE_TO_LEGACY_TYPE[_0x6e217f],_0x2f759a=validateInputSelection(_0x365673);if(_0x2f759a[_0x3026aa(0x1c8)]){const _0x46af96=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x2f759a[_0x3026aa(0x1c8)],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x46af96,_0x6e217f)};}const _0x1df7ba=requireRuntimeUploadFile(_0x2f759a[_0x3026aa(0x1ae)],_0x3026aa(0x1ca)),_0x488ee7=await uploadRuntimeFile(_0x365673[_0x3026aa(0x1bb)],_0x1df7ba[_0x3026aa(0x1b0)]);if(!_0x488ee7[_0x3026aa(0x1d8)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1a5));const _0x498249=await queryRuntimeFileUrl(_0x488ee7['filePath'],{'download':![]});if(!_0x498249[_0x3026aa(0x1c4)])throw CliErrors[_0x3026aa(0x1ba)](_0x3026aa(0x1d3));const _0x2d43ec=await recognizeRuntimeOcr(_0x365673[_0x3026aa(0x1bb)],{'url':_0x498249['fileUrl'],'type':_0x462ac7});return{'ok':!![],'data':withScene(_0x2d43ec,_0x6e217f,_0x488ee7)};}};export const ocrDefinitions=[ocrRecognize];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0xe04603=a35_0x4a6a;(function(_0x30451e,_0xbdb89e){const _0xb4479d=a35_0x4a6a,_0x384785=_0x30451e();while(!![]){try{const _0x3488a3=-parseInt(_0xb4479d(0x114))/0x1+-parseInt(_0xb4479d(0xd8))/0x2+-parseInt(_0xb4479d(0xf9))/0x3+parseInt(_0xb4479d(0x116))/0x4*(-parseInt(_0xb4479d(0xeb))/0x5)+-parseInt(_0xb4479d(0x113))/0x6*(parseInt(_0xb4479d(0xec))/0x7)+parseInt(_0xb4479d(0xf8))/0x8*(-parseInt(_0xb4479d(0x107))/0x9)+parseInt(_0xb4479d(0xe1))/0xa*(parseInt(_0xb4479d(0xed))/0xb);if(_0x3488a3===_0xbdb89e)break;else _0x384785['push'](_0x384785['shift']());}catch(_0x405dd3){_0x384785['push'](_0x384785['shift']());}}}(a35_0x8bc1,0x551e3));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0xe04603(0x110),'type':a35_0xe04603(0xf7),'description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0xe04603(0xee),'type':'string','required':!![],'description':a35_0xe04603(0x11a)},DESCRIPTION_FLAG={'name':a35_0xe04603(0xe6),'type':a35_0xe04603(0xf7),'description':a35_0xe04603(0xdc)},SOURCE_SESSION_FLAG={'name':a35_0xe04603(0x10a),'type':'string','description':a35_0xe04603(0xdf)};function normalizeFunctionName(_0x33ed9c){const _0x1ef74a=a35_0xe04603,_0x6b6f20=String(_0x33ed9c||'')[_0x1ef74a(0x111)]();if(!_0x6b6f20||!FUNCTION_NAME_PATTERN[_0x1ef74a(0xf0)](_0x6b6f20))throw CliErrors[_0x1ef74a(0xf2)](_0x1ef74a(0xd9));return _0x6b6f20;}function readScriptFile(_0x18aa27){const _0x436a65=a35_0xe04603;if(!_0x18aa27)throw CliErrors[_0x436a65(0xf2)](_0x436a65(0xf1));if(!existsSync(_0x18aa27))throw CliErrors[_0x436a65(0xf2)](_0x436a65(0xff)+_0x18aa27);if(!statSync(_0x18aa27)[_0x436a65(0x106)]())throw CliErrors['validation']('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x18aa27);const _0x2a0bc1=readFileSync(_0x18aa27,_0x436a65(0xd7));if(!_0x2a0bc1[_0x436a65(0x111)]())throw CliErrors[_0x436a65(0xf2)](_0x436a65(0x119));return _0x2a0bc1;}function a35_0x4a6a(_0x383384,_0x32649c){_0x383384=_0x383384-0xd6;const _0x8bc11d=a35_0x8bc1();let _0x4a6a6d=_0x8bc11d[_0x383384];return _0x4a6a6d;}function optionalTrimmed(_0x10ddc7){const _0x5a5db0=String(_0x10ddc7||'')['trim']();return _0x5a5db0||undefined;}function summarizeBff(_0x4c79e4){const _0x365728=a35_0xe04603;return{'id':_0x4c79e4['id'],'appCode':_0x4c79e4[_0x365728(0x100)],'functionName':_0x4c79e4[_0x365728(0xf4)],'description':_0x4c79e4[_0x365728(0xe6)],'scriptType':_0x4c79e4['scriptType'],'version':_0x4c79e4[_0x365728(0x10c)],'gmtModified':_0x4c79e4['gmtModified'],'updateTime':_0x4c79e4[_0x365728(0x10e)]};}function detailBff(_0x3cd105){const _0x4b6b5a=a35_0xe04603;return{'id':_0x3cd105['id'],'appCode':_0x3cd105[_0x4b6b5a(0x100)],'functionName':_0x3cd105[_0x4b6b5a(0xf4)],'description':_0x3cd105['description'],'scriptType':_0x3cd105[_0x4b6b5a(0xdd)],'scriptContent':_0x3cd105[_0x4b6b5a(0x103)]??'','config':_0x3cd105['config'],'version':_0x3cd105[_0x4b6b5a(0x10c)],'createUserId':_0x3cd105['createUserId'],'gmtCreate':_0x3cd105[_0x4b6b5a(0xe8)],'gmtModified':_0x3cd105[_0x4b6b5a(0x104)],'createTime':_0x3cd105[_0x4b6b5a(0xe4)],'updateTime':_0x3cd105[_0x4b6b5a(0x10e)]};}function buildCreateInput(_0x50af10){const _0x6b09bb=a35_0xe04603;return{'functionName':normalizeFunctionName(_0x50af10['str'](_0x6b09bb(0xee))),...optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0xe6)))?{'description':optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0xe6)))}:{},'scriptContent':readScriptFile(_0x50af10[_0x6b09bb(0xf6)]('file')),...optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)](_0x6b09bb(0x10a)))?{'sourceSessionId':optionalTrimmed(_0x50af10[_0x6b09bb(0xf6)]('source-session-id'))}:{}};}function buildUpdateInput(_0x3f57ad){const _0x3cb1d8=a35_0xe04603,_0x29bcb4={};optionalTrimmed(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0xee)))&&(_0x29bcb4['functionName']=normalizeFunctionName(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0xee))));_0x3f57ad[_0x3cb1d8(0x112)](_0x3cb1d8(0xe6))!==undefined&&(_0x29bcb4[_0x3cb1d8(0xe6)]=_0x3f57ad['str'](_0x3cb1d8(0xe6)));optionalTrimmed(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0x110)))&&(_0x29bcb4['scriptContent']=readScriptFile(_0x3f57ad[_0x3cb1d8(0xf6)](_0x3cb1d8(0x110))));_0x3f57ad[_0x3cb1d8(0x112)](_0x3cb1d8(0x10a))!==undefined&&(_0x29bcb4[_0x3cb1d8(0xfd)]=_0x3f57ad[_0x3cb1d8(0xf6)]('source-session-id'));if(Object['keys'](_0x29bcb4)[_0x3cb1d8(0x109)]===0x0)throw CliErrors['validation'](_0x3cb1d8(0x10f));return _0x29bcb4;}function a35_0x8bc1(){const _0x24bb92=['write','10ACvbXq','read','bool','createTime','params','description','personal-bff','gmtCreate','isArray','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','517785PzFJZz','1191673bhNHto','20542225eenVRr','name','/client/runtime-bff/personal/','test','File\x20path\x20is\x20required.','validation','/update','functionName','Preview:\x20update\x20personal\x20BFF\x20','str','string','40otKjat','1586133jmWMOT','high-risk-write','create','Update\x20a\x20personal\x20BFF\x20by\x20id','sourceSessionId','detail','File\x20not\x20found:\x20','appCode','Created\x20personal\x20BFF\x20','Updated\x20personal\x20BFF\x20','scriptContent','gmtModified','map','isFile','1566QfSyKi','list','length','source-session-id','Show\x20one\x20personal\x20BFF\x20by\x20id','version','update','updateTime','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','file','trim','flag','6ENXQgw','65185EJTpDG','Executed\x20personal\x20BFF\x20','8XGPMIj','/client/runtime-bff/personal/create','Personal\x20BFF\x20script\x20ID','Personal\x20BFF\x20script\x20file\x20is\x20blank.','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','num','utf8','1093426epvqdn','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','verbose','POST','Personal\x20BFF\x20description','scriptType','--params\x20must\x20be\x20a\x20JSON\x20object.','Optional\x20source\x20RuntimeAgent\x20session\x20id'];a35_0x8bc1=function(){return _0x24bb92;};return a35_0x8bc1();}function parseExecParams(_0x606330){const _0x4d318f=a35_0xe04603,_0x2aabc8=parseJsonParams(_0x606330)??{};if(Array[_0x4d318f(0xe9)](_0x2aabc8))throw CliErrors[_0x4d318f(0xf2)](_0x4d318f(0xde));return _0x2aabc8;}const personalBffList={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0x108),'description':'List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','risk':a35_0xe04603(0xe2),'flags':[VERBOSE_FLAG],async 'execute'(_0x1eba01){const _0x47b89c=a35_0xe04603,_0x426fd8=await listPersonalBffs(_0x1eba01[_0x47b89c(0x100)]);return{'ok':!![],'data':{'total':_0x426fd8[_0x47b89c(0x109)],'items':_0x1eba01[_0x47b89c(0xe3)](_0x47b89c(0xda))?_0x426fd8:_0x426fd8[_0x47b89c(0x105)](summarizeBff)}};}},personalBffDetail={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0xfe),'description':a35_0xe04603(0x10b),'risk':a35_0xe04603(0xe2),'flags':[{...ID_FLAG,'description':a35_0xe04603(0x118)}],async 'execute'(_0x1d850b){const _0x133231=await getPersonalBff(_0x1d850b['num']('id'),_0x1d850b['appCode']);return{'ok':!![],'data':detailBff(_0x133231)};}},personalBffCreate={'service':'personal-bff','command':a35_0xe04603(0xfb),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0xe04603(0xe0),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x456d16){const _0x4798df=a35_0xe04603,_0xa28e2f=buildCreateInput(_0x456d16),_0x51017a=await createPersonalBff(_0x456d16['appCode'],_0xa28e2f);return{'ok':!![],'data':detailBff(_0x51017a),'message':_0x4798df(0x101)+_0x51017a['id']+(_0x51017a[_0x4798df(0xf4)]?'\x20('+_0x51017a['functionName']+')':'')};},async 'dryRun'(_0x21d104){const _0x21b79e=a35_0xe04603,_0xed80b6=buildCreateInput(_0x21d104);return dryRun(_0x21b79e(0xdb),_0x21b79e(0x117))['body']({'appCode':_0x21d104[_0x21b79e(0x100)],..._0xed80b6})[_0x21b79e(0xe6)]('Preview:\x20create\x20personal\x20BFF\x20'+_0xed80b6[_0x21b79e(0xf4)])['build']();}},personalBffUpdate={'service':a35_0xe04603(0xe7),'command':a35_0xe04603(0x10d),'description':a35_0xe04603(0xfc),'risk':a35_0xe04603(0xe0),'flags':[{...ID_FLAG,'description':a35_0xe04603(0x118)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x4b3900){const _0x113893=a35_0xe04603,_0x4eac96=_0x4b3900[_0x113893(0xd6)]('id'),_0x2abd00=buildUpdateInput(_0x4b3900),_0x1f2bd4=await updatePersonalBff(_0x4eac96,_0x4b3900[_0x113893(0x100)],_0x2abd00);return{'ok':!![],'data':detailBff(_0x1f2bd4),'message':_0x113893(0x102)+_0x1f2bd4['id']+(_0x1f2bd4[_0x113893(0xf4)]?'\x20('+_0x1f2bd4['functionName']+')':'')};},async 'dryRun'(_0x3a06a4){const _0x4a1fff=a35_0xe04603,_0x1af589=_0x3a06a4[_0x4a1fff(0xd6)]('id'),_0x5cf5a6=buildUpdateInput(_0x3a06a4);return dryRun(_0x4a1fff(0xdb),_0x4a1fff(0xef)+_0x1af589+_0x4a1fff(0xf3))['body']({'appCode':_0x3a06a4['appCode'],..._0x5cf5a6})[_0x4a1fff(0xe6)](_0x4a1fff(0xf5)+_0x1af589)['build']();}},personalBffExec={'service':a35_0xe04603(0xe7),'command':'exec','description':'Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','risk':a35_0xe04603(0xfa),'flags':[{...ID_FLAG,'description':'Personal\x20BFF\x20script\x20ID'},{...PARAMS_FLAG,'description':a35_0xe04603(0xea)}],async 'validate'(_0x11852d){const _0x4c9012=a35_0xe04603;parseExecParams(_0x11852d['str'](_0x4c9012(0xe5)));},async 'execute'(_0x3d67b7){const _0x479768=a35_0xe04603,_0x18bde0=_0x3d67b7['num']('id'),_0x43af5f=parseExecParams(_0x3d67b7['str'](_0x479768(0xe5))),_0x4f7dfa=await executePersonalBff(_0x18bde0,_0x3d67b7[_0x479768(0x100)],_0x43af5f);return{'ok':!![],'data':{'result':_0x4f7dfa},'message':_0x479768(0x115)+_0x18bde0};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
|
1
|
+
const a35_0x177ccc=a35_0x111a;(function(_0x2e50d0,_0x23bf25){const _0x44db0=a35_0x111a,_0x37d751=_0x2e50d0();while(!![]){try{const _0x3c624d=parseInt(_0x44db0(0xb2))/0x1+-parseInt(_0x44db0(0xce))/0x2*(-parseInt(_0x44db0(0xbf))/0x3)+parseInt(_0x44db0(0xd6))/0x4*(parseInt(_0x44db0(0xc8))/0x5)+parseInt(_0x44db0(0xa0))/0x6+parseInt(_0x44db0(0xa6))/0x7+parseInt(_0x44db0(0xdb))/0x8*(parseInt(_0x44db0(0xb6))/0x9)+parseInt(_0x44db0(0xcd))/0xa*(-parseInt(_0x44db0(0xcf))/0xb);if(_0x3c624d===_0x23bf25)break;else _0x37d751['push'](_0x37d751['shift']());}catch(_0x541220){_0x37d751['push'](_0x37d751['shift']());}}}(a35_0x550a,0xbd57c));import{existsSync,readFileSync,statSync}from'node:fs';import{createPersonalBff,executePersonalBff,getPersonalBff,listPersonalBffs,updatePersonalBff}from'../../core/api-client.js';import{ID_FLAG,PARAMS_FLAG,VERBOSE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{dryRun}from'../../framework/dryrun.js';import{parseJsonParams}from'../../utils/params.js';const FUNCTION_NAME_PATTERN=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/,FILE_FLAG={'name':a35_0x177ccc(0xc3),'type':'string','description':'Path\x20to\x20a\x20local\x20UTF-8\x20JavaScript\x20or\x20TypeScript\x20file'},FUNCTION_NAME_FLAG={'name':a35_0x177ccc(0xd2),'type':a35_0x177ccc(0xe2),'required':!![],'description':a35_0x177ccc(0xae)},DESCRIPTION_FLAG={'name':'description','type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xa9)},SOURCE_SESSION_FLAG={'name':a35_0x177ccc(0xaf),'type':a35_0x177ccc(0xe2),'description':a35_0x177ccc(0xc0)};function normalizeFunctionName(_0x585576){const _0x500b40=a35_0x177ccc,_0x499b3d=String(_0x585576||'')[_0x500b40(0xa3)]();if(!_0x499b3d||!FUNCTION_NAME_PATTERN[_0x500b40(0xaa)](_0x499b3d))throw CliErrors['validation'](_0x500b40(0xc5));return _0x499b3d;}function readScriptFile(_0x3efed4){const _0x33558b=a35_0x177ccc;if(!_0x3efed4)throw CliErrors[_0x33558b(0xc9)]('File\x20path\x20is\x20required.');if(!existsSync(_0x3efed4))throw CliErrors['validation'](_0x33558b(0xba)+_0x3efed4);if(!statSync(_0x3efed4)[_0x33558b(0xd9)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xc2)+_0x3efed4);const _0x597028=readFileSync(_0x3efed4,_0x33558b(0xb3));if(!_0x597028[_0x33558b(0xa3)]())throw CliErrors[_0x33558b(0xc9)](_0x33558b(0xd1));return _0x597028;}function optionalTrimmed(_0x427be8){const _0x3662aa=String(_0x427be8||'')['trim']();return _0x3662aa||undefined;}function summarizeBff(_0x5327bc){const _0x5041aa=a35_0x177ccc;return{'id':_0x5327bc['id'],'appCode':_0x5327bc['appCode'],'functionName':_0x5327bc[_0x5041aa(0xe1)],'description':_0x5327bc[_0x5041aa(0xca)],'scriptType':_0x5327bc[_0x5041aa(0xb5)],'version':_0x5327bc['version'],'gmtModified':_0x5327bc[_0x5041aa(0xc7)],'updateTime':_0x5327bc[_0x5041aa(0xd4)]};}function detailBff(_0x715276){const _0x58beb2=a35_0x177ccc;return{'id':_0x715276['id'],'appCode':_0x715276[_0x58beb2(0xc6)],'functionName':_0x715276[_0x58beb2(0xe1)],'description':_0x715276[_0x58beb2(0xca)],'scriptType':_0x715276[_0x58beb2(0xb5)],'scriptContent':_0x715276['scriptContent']??'','config':_0x715276['config'],'version':_0x715276[_0x58beb2(0xe0)],'createUserId':_0x715276[_0x58beb2(0xc1)],'gmtCreate':_0x715276[_0x58beb2(0xac)],'gmtModified':_0x715276[_0x58beb2(0xc7)],'createTime':_0x715276[_0x58beb2(0xa4)],'updateTime':_0x715276['updateTime']};}function a35_0x550a(){const _0x364510=['personal-bff','Updated\x20personal\x20BFF\x20','Personal\x20BFF\x20description','test','num','gmtCreate','JSON\x20object\x20passed\x20to\x20the\x20personal\x20BFF\x20execution','Personal\x20BFF\x20functionName,\x20for\x20example\x20loadOrders','source-session-id','Personal\x20BFF\x20script\x20ID','high-risk-write','59832ANbgrt','utf8','Preview:\x20update\x20personal\x20BFF\x20','scriptType','141399gqmInS','write','create','POST','File\x20not\x20found:\x20','length','detail','Executed\x20personal\x20BFF\x20','flag','3rfbNUK','Optional\x20source\x20RuntimeAgent\x20session\x20id','createUserId','File\x20is\x20not\x20a\x20regular\x20file:\x20','file','str','--name\x20must\x20be\x20a\x20valid\x20JavaScript\x20identifier,\x20for\x20example\x20loadOrders.','appCode','gmtModified','2197355bovUha','validation','description','bool','personal-bff\x20update\x20requires\x20at\x20least\x20one\x20of\x20--name,\x20--description,\x20--file,\x20or\x20--source-session-id.','1038290hgRGRY','765868JaDeyc','451FSIQky','sourceSessionId','Personal\x20BFF\x20script\x20file\x20is\x20blank.','name','Execute\x20a\x20personal\x20BFF\x20by\x20id\x20with\x20optional\x20JSON\x20params','updateTime','Created\x20personal\x20BFF\x20','12iVYfaM','/client/runtime-bff/personal/create','exec','isFile','scriptContent','648APczcT','/client/runtime-bff/personal/','params','list','body','version','functionName','string','read','4987164zuqVUY','/update','List\x20current\x20user\x27s\x20personal\x20BFF\x20scripts\x20for\x20the\x20current\x20app','trim','createTime','build','8173011wlVKeU'];a35_0x550a=function(){return _0x364510;};return a35_0x550a();}function buildCreateInput(_0x1791f5){const _0x52fc74=a35_0x177ccc;return{'functionName':normalizeFunctionName(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xd2))),...optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('description'))?{'description':optionalTrimmed(_0x1791f5['str']('description'))}:{},'scriptContent':readScriptFile(_0x1791f5[_0x52fc74(0xc4)](_0x52fc74(0xc3))),...optionalTrimmed(_0x1791f5['str']('source-session-id'))?{'sourceSessionId':optionalTrimmed(_0x1791f5[_0x52fc74(0xc4)]('source-session-id'))}:{}};}function buildUpdateInput(_0x249174){const _0x37ae75=a35_0x177ccc,_0x252dfe={};optionalTrimmed(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xd2)))&&(_0x252dfe['functionName']=normalizeFunctionName(_0x249174['str'](_0x37ae75(0xd2))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xca))!==undefined&&(_0x252dfe['description']=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xca)));optionalTrimmed(_0x249174['str'](_0x37ae75(0xc3)))&&(_0x252dfe[_0x37ae75(0xda)]=readScriptFile(_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xc3))));_0x249174[_0x37ae75(0xbe)](_0x37ae75(0xaf))!==undefined&&(_0x252dfe[_0x37ae75(0xd0)]=_0x249174[_0x37ae75(0xc4)](_0x37ae75(0xaf)));if(Object['keys'](_0x252dfe)[_0x37ae75(0xbb)]===0x0)throw CliErrors['validation'](_0x37ae75(0xcc));return _0x252dfe;}function a35_0x111a(_0xf80546,_0x1bb01a){_0xf80546=_0xf80546-0xa0;const _0x550a00=a35_0x550a();let _0x111acd=_0x550a00[_0xf80546];return _0x111acd;}function parseExecParams(_0x2b1097){const _0x231eb1=a35_0x177ccc,_0x5be810=parseJsonParams(_0x2b1097)??{};if(Array['isArray'](_0x5be810))throw CliErrors[_0x231eb1(0xc9)]('--params\x20must\x20be\x20a\x20JSON\x20object.');return _0x5be810;}const personalBffList={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xde),'description':a35_0x177ccc(0xa2),'risk':'read','flags':[VERBOSE_FLAG],async 'execute'(_0x1a2020){const _0xb536e1=a35_0x177ccc,_0x4acf85=await listPersonalBffs(_0x1a2020[_0xb536e1(0xc6)]);return{'ok':!![],'data':{'total':_0x4acf85[_0xb536e1(0xbb)],'items':_0x1a2020[_0xb536e1(0xcb)]('verbose')?_0x4acf85:_0x4acf85['map'](summarizeBff)}};}},personalBffDetail={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xbc),'description':'Show\x20one\x20personal\x20BFF\x20by\x20id','risk':a35_0x177ccc(0xe3),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)}],async 'execute'(_0x14fed1){const _0x5db39e=a35_0x177ccc,_0xfbaddc=await getPersonalBff(_0x14fed1[_0x5db39e(0xab)]('id'),_0x14fed1['appCode']);return{'ok':!![],'data':detailBff(_0xfbaddc)};}},personalBffCreate={'service':'personal-bff','command':a35_0x177ccc(0xb8),'description':'Create\x20a\x20personal\x20BFF\x20from\x20a\x20local\x20script\x20file','risk':a35_0x177ccc(0xb7),'flags':[FUNCTION_NAME_FLAG,{...FILE_FLAG,'required':!![]},DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3a954c){const _0x704daf=a35_0x177ccc,_0xd941a1=buildCreateInput(_0x3a954c),_0x41a1ba=await createPersonalBff(_0x3a954c['appCode'],_0xd941a1);return{'ok':!![],'data':detailBff(_0x41a1ba),'message':_0x704daf(0xd5)+_0x41a1ba['id']+(_0x41a1ba['functionName']?'\x20('+_0x41a1ba['functionName']+')':'')};},async 'dryRun'(_0x308f39){const _0x399d9e=a35_0x177ccc,_0x311ff4=buildCreateInput(_0x308f39);return dryRun('POST',_0x399d9e(0xd7))[_0x399d9e(0xdf)]({'appCode':_0x308f39[_0x399d9e(0xc6)],..._0x311ff4})[_0x399d9e(0xca)]('Preview:\x20create\x20personal\x20BFF\x20'+_0x311ff4['functionName'])[_0x399d9e(0xa5)]();}},personalBffUpdate={'service':a35_0x177ccc(0xa7),'command':'update','description':'Update\x20a\x20personal\x20BFF\x20by\x20id','risk':'write','flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...FUNCTION_NAME_FLAG,'required':![]},FILE_FLAG,DESCRIPTION_FLAG,SOURCE_SESSION_FLAG],async 'execute'(_0x3c5cf4){const _0x435e8b=a35_0x177ccc,_0x1bfef6=_0x3c5cf4[_0x435e8b(0xab)]('id'),_0x1f8f71=buildUpdateInput(_0x3c5cf4),_0x387a50=await updatePersonalBff(_0x1bfef6,_0x3c5cf4[_0x435e8b(0xc6)],_0x1f8f71);return{'ok':!![],'data':detailBff(_0x387a50),'message':_0x435e8b(0xa8)+_0x387a50['id']+(_0x387a50['functionName']?'\x20('+_0x387a50[_0x435e8b(0xe1)]+')':'')};},async 'dryRun'(_0x3b4e75){const _0x119b8d=a35_0x177ccc,_0xb681a4=_0x3b4e75[_0x119b8d(0xab)]('id'),_0x402efe=buildUpdateInput(_0x3b4e75);return dryRun(_0x119b8d(0xb9),_0x119b8d(0xdc)+_0xb681a4+_0x119b8d(0xa1))[_0x119b8d(0xdf)]({'appCode':_0x3b4e75[_0x119b8d(0xc6)],..._0x402efe})['description'](_0x119b8d(0xb4)+_0xb681a4)['build']();}},personalBffExec={'service':a35_0x177ccc(0xa7),'command':a35_0x177ccc(0xd8),'description':a35_0x177ccc(0xd3),'risk':a35_0x177ccc(0xb1),'flags':[{...ID_FLAG,'description':a35_0x177ccc(0xb0)},{...PARAMS_FLAG,'description':a35_0x177ccc(0xad)}],async 'validate'(_0x585089){const _0x290c98=a35_0x177ccc;parseExecParams(_0x585089['str'](_0x290c98(0xdd)));},async 'execute'(_0x4d6984){const _0xf513b7=a35_0x177ccc,_0x1fd392=_0x4d6984['num']('id'),_0x407038=parseExecParams(_0x4d6984[_0xf513b7(0xc4)]('params')),_0x5e24b1=await executePersonalBff(_0x1fd392,_0x4d6984[_0xf513b7(0xc6)],_0x407038);return{'ok':!![],'data':{'result':_0x5e24b1},'message':_0xf513b7(0xbd)+_0x1fd392};}};export const personalBffDefinitions=[personalBffList,personalBffDetail,personalBffCreate,personalBffUpdate,personalBffExec];
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x504c5c=a36_0x22eb;(function(_0x98bbcf,_0x309192){const _0x2f8912=a36_0x22eb,_0x32edeb=_0x98bbcf();while(!![]){try{const _0x136037=-parseInt(_0x2f8912(0x171))/0x1+-parseInt(_0x2f8912(0x16e))/0x2*(-parseInt(_0x2f8912(0x165))/0x3)+-parseInt(_0x2f8912(0x161))/0x4+parseInt(_0x2f8912(0x147))/0x5+-parseInt(_0x2f8912(0x153))/0x6+parseInt(_0x2f8912(0x166))/0x7*(parseInt(_0x2f8912(0x16f))/0x8)+parseInt(_0x2f8912(0x16c))/0x9*(parseInt(_0x2f8912(0x15a))/0xa);if(_0x136037===_0x309192)break;else _0x32edeb['push'](_0x32edeb['shift']());}catch(_0x303c9e){_0x32edeb['push'](_0x32edeb['shift']());}}}(a36_0x72ce,0xdffa4));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_0x22eb(_0x53b39f,_0x4dbb5e){_0x53b39f=_0x53b39f-0x147;const _0x72ce10=a36_0x72ce();let _0x22eb05=_0x72ce10[_0x53b39f];return _0x22eb05;}import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/definitions.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{dataDefinitions}from'../commands/data/index.js';import{kbDefinitions}from'../commands/kb/index.js';import{artifactDefinitions}from'../commands/artifact/index.js';import{personalBffDefinitions}from'../commands/personal-bff/index.js';import{apiDocDefinitions}from'../commands/api-doc/index.js';import{appConfigDefinitions}from'../commands/app-config/index.js';import{fileDefinitions}from'../commands/file/index.js';import{ocrDefinitions}from'../commands/ocr/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function a36_0x72ce(){const _0x32151e=['API\x20Documentation','5819368LiSGFZ','CLI\x20Built-in\x20Skill','install','login','9HQcgak','1152193OBdBue','Logs','run','from','command','File','7298703cijrzR','Self\x20Update','450302DDpaAj','72FoLsrK','BFF\x20Scripts','1173958rFOlUy','map','2691580rzWkZO','service','has','get','OCR','Knowledge\x20Base','Artifacts','list','risk','Schema','Instant\x20API','\x20\x20[write]','4625292ZniVJq','read','Diagnostics','push','write','description','Personal\x20BFF','20MgXrsA','SQL\x20Queries','set','isSingleCommand','App\x20Management','Skills'];a36_0x72ce=function(){return _0x32151e;};return a36_0x72ce();}function registerDefinitions(_0x559035){const _0x86946b=a36_0x22eb;for(const _0x1ac086 of _0x559035){definitions[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)]+':'+_0x1ac086[_0x86946b(0x16a)],_0x1ac086);let _0x36b398=serviceGroups[_0x86946b(0x14a)](_0x1ac086[_0x86946b(0x148)]);!_0x36b398&&(_0x36b398=[],serviceGroups[_0x86946b(0x15c)](_0x1ac086[_0x86946b(0x148)],_0x36b398)),_0x36b398[_0x86946b(0x156)](_0x1ac086);}}function registerService(_0x5497ba,_0x578bc9,_0x15246c){const _0x4a2f26=a36_0x22eb;registerDefinitions(_0x578bc9);const _0x13a442=_0x32f3d8=>_0x32f3d8===_0x4a2f26(0x154)?'':_0x32f3d8===_0x4a2f26(0x157)?_0x4a2f26(0x152):'\x20\x20[high-risk-write]',_0x506442={'service':_0x578bc9[0x0][_0x4a2f26(0x148)],'label':_0x5497ba,'commands':_0x578bc9[_0x4a2f26(0x172)](_0x286d9e=>({'command':_0x286d9e[_0x4a2f26(0x16a)],'description':_0x286d9e[_0x4a2f26(0x158)],'tag':_0x13a442(_0x286d9e[_0x4a2f26(0x14f)])})),'defaultCommand':_0x15246c?.['defaultCommand']??(_0x15246c?.['isSingleCommand']?_0x578bc9[0x0][_0x4a2f26(0x16a)]:undefined),'isSingleCommand':_0x15246c?.[_0x4a2f26(0x15d)]};serviceRegistry[_0x4a2f26(0x156)](_0x506442),serviceByName['set'](_0x506442[_0x4a2f26(0x148)],_0x506442);}registerService('Authentication',authDefinitions,{'defaultCommand':a36_0x504c5c(0x164)}),registerService(a36_0x504c5c(0x15e),appDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService('Workspace',workspaceDefinitions),registerService('Runtime\x20App\x20Config',appConfigDefinitions),registerService('Configuration',configDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x160),apiDocDefinitions),registerService('Datasets',datasetDefinitions),registerService(a36_0x504c5c(0x151),dataDefinitions),registerService(a36_0x504c5c(0x15b),sqlDefinitions),registerService(a36_0x504c5c(0x170),bffDefinitions),registerService(a36_0x504c5c(0x159),personalBffDefinitions),registerService(a36_0x504c5c(0x14d),artifactDefinitions),registerService(a36_0x504c5c(0x16b),fileDefinitions),registerService(a36_0x504c5c(0x14b),ocrDefinitions),registerService(a36_0x504c5c(0x14c),kbDefinitions),registerService('Service\x20Tree',serviceDefinitions,{'defaultCommand':a36_0x504c5c(0x14e)}),registerService(a36_0x504c5c(0x15f),skillDefinitions,{'defaultCommand':a36_0x504c5c(0x163)}),registerService(a36_0x504c5c(0x162),cliSkillDefinitions,{'defaultCommand':'install'}),registerService(a36_0x504c5c(0x16d),[updateDefinition],{'defaultCommand':a36_0x504c5c(0x168),'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x155),[doctorDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x150),[schemaDefinition],{'isSingleCommand':!![]}),registerService(a36_0x504c5c(0x167),logsDefinitions,{'defaultCommand':'show'});export function findDefinition(_0x2525d7,_0xf122c4){const _0x59c0e5=a36_0x504c5c;return definitions[_0x59c0e5(0x14a)](_0x2525d7+':'+_0xf122c4);}export function isKnownService(_0xbd410f){const _0x5898fd=a36_0x504c5c;return serviceByName[_0x5898fd(0x149)](_0xbd410f);}export function getServiceEntry(_0x12e2ee){const _0x3eb8ac=a36_0x504c5c;return serviceByName[_0x3eb8ac(0x14a)](_0x12e2ee);}export function getAllDefinitions(){const _0x453a2c=a36_0x504c5c;return Array[_0x453a2c(0x169)](definitions['values']());}
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a37_0x3dc1(_0x3abe2e,_0x2d6f73){_0x3abe2e=_0x3abe2e-0x14b;const _0x5a465f=a37_0x5a46();let _0x3dc151=_0x5a465f[_0x3abe2e];return _0x3dc151;}const a37_0x399b43=a37_0x3dc1;function a37_0x5a46(){const _0x55db24=['21388JjDIZN','341260HEEgcH','717438wZUida','2286gldhac','99kHeVmo','148664vlunRw','Export\x20machine-readable\x20command\x20schema\x20(JSON)','201cXGokw','1430244GcxmDm','schema','6129CMocBv','9170UkqSSp','301MdviyX','13170gqaRWn'];a37_0x5a46=function(){return _0x55db24;};return a37_0x5a46();}(function(_0x127586,_0x49de6f){const _0x1be872=a37_0x3dc1,_0x4bf0e3=_0x127586();while(!![]){try{const _0x4fb75f=parseInt(_0x1be872(0x14b))/0x1+-parseInt(_0x1be872(0x14c))/0x2+parseInt(_0x1be872(0x151))/0x3*(parseInt(_0x1be872(0x158))/0x4)+-parseInt(_0x1be872(0x157))/0x5*(parseInt(_0x1be872(0x14d))/0x6)+-parseInt(_0x1be872(0x156))/0x7*(-parseInt(_0x1be872(0x14f))/0x8)+-parseInt(_0x1be872(0x154))/0x9*(parseInt(_0x1be872(0x155))/0xa)+-parseInt(_0x1be872(0x14e))/0xb*(-parseInt(_0x1be872(0x152))/0xc);if(_0x4fb75f===_0x49de6f)break;else _0x4bf0e3['push'](_0x4bf0e3['shift']());}catch(_0x3a31b7){_0x4bf0e3['push'](_0x4bf0e3['shift']());}}}(a37_0x5a46,0x8eb3f));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x13d71c){const _0x448758=await buildSchemaPayload();return{'ok':!![],'data':_0x448758};}export const schemaDefinition={'service':a37_0x399b43(0x153),'command':'export','description':a37_0x399b43(0x150),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'flags':[],'execute':execute};
|